diff --git a/.env.development b/.env.development index f5143b4..80e0348 100644 --- a/.env.development +++ b/.env.development @@ -1,11 +1,7 @@ # VITE_API_BASE='http://54.251.137.151:10704/' # VITE_API_BASE='https://hwjb.homilychart.com/gold_htms_dev' # VITE_API_BASE='http://54.251.137.151:10704/' -<<<<<<< HEAD -VITE_API_BASE='http://192.168.8.94:8080/' -======= # VITE_API_BASE='http://192.168.8.225:8080/' # VITE_API_BASE='http://192.168.8.94:8080/' -VITE_API_BASE='http://192.168.8.247:8081/' +VITE_API_BASE='http://18.143.76.3/' ->>>>>>> milestone-20250623-金币前端 diff --git a/src/views/managerecharge/rate.vue b/src/views/managerecharge/rate.vue index 7f45288..3788d08 100644 --- a/src/views/managerecharge/rate.vue +++ b/src/views/managerecharge/rate.vue @@ -1,423 +1,8 @@ - - - - - - - - - 时间范围: - - - - - 今 - 昨 - 近7天 - - - 重置 - 查询 - - - - - - - - 新增汇率 - - - - - - {{ - scope.$index + 1 + (getObj.pageNum - 1) * getObj.pageSize - }} - - - - - - - {{ scope.row.exchangeRate }}{{ scope.row.currency }} :1新币 - - - - - - {{ formatDate(scope.row.createTime) }} - - - - - { - regeEdit = true - getEditData(scope.row) - }">编辑 - - - 删除 - - - 取消 - 确定 - - - - - - - - - - -======= - -// 编辑方法 表单 -const rateEdit = ref({ - id: null, - rateName: '', - num: null, - adminId: null, - updateTime: Date.now(), -}) - -//查询已有的数据 -const getEditData = async function (row) { - try { - console.log('搜索参数', getObj.value) - // 发送POST请求 - const result = await request({ - url: 'http://192.168.9.21:8081/rate/selectById', - data: {id: row.id} - }) - - // 将响应结果存储到响应式数据中 - console.log('根据id查 请求成功', result) - // 存储表格数据 - // rateEdit.value = result.data - // 只赋部分的 - rateEdit.value.id = row.id - rateEdit.value.rateName = row.rateName - rateEdit.value.num = row.num - console.log('根据id获取的数据', rateEdit.value) - rateEdit.value.adminId = adminData.value.adminId - - } catch (error) { - console.log('请求失败', error) - } -} - -const editRate = async function () { - try { - console.log('搜索参数', rateEdit.value) - // 发送POST请求 - const result = await request({ - url: 'http://192.168.9.21:8081/rate/update', - data: rateEdit.value - }) - // 将响应结果存储到响应式数据中 - console.log('请求成功', result) - await getAllRate() - } catch (error) { - console.log('请求失败', error) - } -} -const edit = () => { - ElMessageBox.confirm('确认修改?') - .then(() => { - editRate() - regeEdit.value = false - }) - .catch(() => { - regeEdit.value = false - }) -} - -// 关闭编辑弹窗时重置表单 -const cancelEdit = () => { - regeEdit.value = false - -} - - -const handleEditDialogClose = () => { - if (editFormRef.value) { - getAllRate() - } -} - - -// 挂载 -onMounted(async function () { - await getAllRate() - await getAdminData() -}) - - -//货币条目 -const options = [ - { - value: 'USD', - label: 'USD' - }, - { - value: 'HKD', - label: 'HKD' - }, - { - value: 'THB', - label: 'THB' - }, - { - value: 'VND', - label: 'VND' - }, - { - value: 'CAD', - label: 'CAD' - }, - { - value: 'MYR', - label: 'MYR' - }, - { - value: 'KRW', - label: 'KRW' - }, - { - value: 'JPY', - label: 'JPY' - }, - { - value: 'CNY', - label: 'CNY' - } -] - -function formatDate(value) { - if (!value) return '' - const date = new Date(value) - const year = date.getFullYear() - const month = (date.getMonth() + 1).toString().padStart(2, '0') - const day = date.getDate().toString().padStart(2, '0') - const hours = date.getHours().toString().padStart(2, '0') - const minutes = date.getMinutes().toString().padStart(2, '0') - const seconds = date.getSeconds().toString().padStart(2, '0') - return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}` -} - - -const checkFreeGoldRadio = function (rule, value, callback) { - if (value == '0' || value == null || value == '') { - callback(new Error('请输入汇率比')) - } else if (value < 0 || isNaN(value)) { - callback(new Error('请输入正确的格式')) - } else { - callback() - } -} -const rules = reactive({ - rateName: [{required: true, message: '请选择货币名称', trigger: 'blur'}], - num: [{validator: checkFreeGoldRadio, trigger: 'blur'}], -}) - -function handleInput(value) { - // 初始过滤非数字和小数点字符 - let validValue = value.replace(/[^\d.]/g, ''); - - // 处理多个小数点的情况,保留第一个,移除后续的 - const parts = validValue.split('.'); - if (parts.length > 2) { - validValue = parts[0] + '.' + parts.slice(1).join(''); - ElMessage.warning('请输入正确格式'); - } - - // 限制小数点后最多7位 - const [integerPart, decimalPart = ''] = validValue.split('.'); - if (decimalPart.length > 7) { - validValue = `${integerPart}.${decimalPart.slice(0, 7)}`; - ElMessage.warning('最多只能输入7位小数'); - } - - // 最终格式验证 - const isValidFormat = /^\d+(\.\d{0,7})?$/.test(validValue); - if (value && !isValidFormat) { - ElMessage.warning('请输入正确的数字格式'); - } - - // 更新表单值 - rateEdit.value.num = validValue; - return validValue; -} - -// 表单大小 -const formSize = ref('default') - - - @@ -488,7 +73,6 @@ const formSize = ref('default') ->>>>>>> milestone-20250623-金币前端 >>>>>> milestone-20250623-金币前端 const tableData = ref([]) //分页总条目 const total = ref(100) -<<<<<<< HEAD -======= // 搜索admin ->>>>>>> milestone-20250623-金币前端 const admin = ref({}) // 搜索对象 const getObj = ref({ @@ -41,10 +35,7 @@ const editObj = ref({}) // 删除权限的对象 const delObj = ref({}) -<<<<<<< HEAD -======= // 搜索接口search ->>>>>>> milestone-20250623-金币前端 const get = async function (val) { try { if (admin.value.jwcode) {
- {{ scope.row.exchangeRate }}{{ scope.row.currency }} :1新币 -