From fa3bdcbc7e2c72fbe83b6814292781c78d1f72e5 Mon Sep 17 00:00:00 2001 From: shiran Date: Tue, 14 Jul 2026 18:17:05 +0800 Subject: [PATCH 1/7] feat: extend SMS signature and setting file support --- src/components/admin/ImageSelector.vue | 97 +++++++-- src/views/sms/SmsSignature.vue | 270 +++++++++++++++++++++++-- src/views/system/SettingManage.vue | 58 ++++-- 3 files changed, 375 insertions(+), 50 deletions(-) diff --git a/src/components/admin/ImageSelector.vue b/src/components/admin/ImageSelector.vue index 10585f6..3f794d6 100644 --- a/src/components/admin/ImageSelector.vue +++ b/src/components/admin/ImageSelector.vue @@ -1,7 +1,7 @@ + + + + + + @@ -1463,26 +1474,48 @@ const fetchUserBalance = async () => { // 订单状态 const getOrderStatusText = (state) => { - const map = { 0: '待支付', 1: '已支付', 2: '已取消', 3: '已退款', 4: '已完成' } + const map = { 0: '待支付', 1: '已支付', 2: '已失效' } return map[state] || '未知' } const getOrderStatusType = (state) => { - const map = { 0: 'warning', 1: 'success', 2: 'info', 3: 'danger', 4: 'success' } + const map = { 0: 'warning', 1: 'success', 2: 'info' } return map[state] || 'info' } // 订单类型 const getOrderTypeText = (type) => { - const map = { create: '新购', renew: '续费', upgrade: '升级' } + const map = { create: '新购', renew: '续费', update: '升级', snapshot: '快照', backup: '备份', data_volume: '数据盘', ipv4: 'IPv4', ipv6: 'IPv6', traffic: '流量', rebuild_image_diff: '重装差价' } return map[type] || type || '未知' } const getOrderTypeTag = (type) => { - const map = { create: 'primary', renew: 'success', upgrade: 'warning' } + const map = { create: 'primary', renew: 'success', update: 'warning' } return map[type] || 'info' } +const getOrderPayTypeText = (payType) => { + const map = { + default: '默认/余额', + balance: '余额', + '007pay': '007pay', + admin: '管理员', + ali: '支付宝', + wx: '微信' + } + return map[payType] || payType || '-' +} + +const getOrderRefundStatusText = (status) => { + const map = { pending: '退款中', success: '已退款', failed: '退款失败' } + return map[status] || status || '-' +} + +const getOrderRefundStatusType = (status) => { + const map = { pending: 'warning', success: 'success', failed: 'danger' } + return map[status] || 'info' +} + // 工单状态 const getTicketStatusText = (status) => { const map = { 0: '待处理', 1: '处理中', 2: '已回复', 3: '已关闭' } -- 2.54.0 From afc00141f7abfcdb4490c7844a4abd6cfc112a2d Mon Sep 17 00:00:00 2001 From: shiran Date: Fri, 17 Jul 2026 17:26:10 +0800 Subject: [PATCH 3/7] fix: support sms signature file download --- src/views/sms/SmsSignature.vue | 94 ++++++++++++++++++++++++++++++++-- 1 file changed, 91 insertions(+), 3 deletions(-) diff --git a/src/views/sms/SmsSignature.vue b/src/views/sms/SmsSignature.vue index a272912..db18dd7 100644 --- a/src/views/sms/SmsSignature.vue +++ b/src/views/sms/SmsSignature.vue @@ -288,8 +288,17 @@
申请文件 - 查看申请文件 - 未上传 + + + 下载申请文件 + + 暂无可下载文件
- - -
@@ -131,6 +126,16 @@ 减少 + + + @@ -180,28 +185,6 @@ - - - - - - - - - - - - 退回余额 - 提现 - -
退回余额:将退款金额添加到对应余额;提现:将退款金额提现
-
-
- -
@@ -210,7 +193,7 @@ import { ref, reactive, onMounted, computed, watch } from 'vue' import { useRoute, useRouter } from 'vue-router' import { ElMessage } from 'element-plus' import { Refresh, ArrowLeft } from '@element-plus/icons-vue' -import { getUserBalanceRecord, editUserBalance, addUserConsumption, getUserBalanceCount, getUserList, refundBalance } from '@/api/admin/user' +import { getUserBalanceRecord, editUserBalance, addUserConsumption, getUserBalanceCount, getUserList } from '@/api/admin/user' const route = useRoute() const router = useRouter() @@ -246,11 +229,8 @@ const userList = ref([]) // 对话框 const balanceDialogVisible = ref(false) const recordDialogVisible = ref(false) -const refundDialogVisible = ref(false) const balanceFormRef = ref(null) const recordFormRef = ref(null) -const refundFormRef = ref(null) -const refundLoading = ref(false) // 余额表单 const balanceForm = reactive({ @@ -258,7 +238,8 @@ const balanceForm = reactive({ balance_type: '', price: 0, state: 'add', - note: '' + note: '', + account_amount: false }) const balanceRules = { @@ -290,18 +271,6 @@ const recordRules = { note: [{ required: true, message: '请输入备注', trigger: 'blur' }] } -// 退款表单 -const refundForm = reactive({ - history_id: 0, - order_id: 0, - bandwidth: false -}) - -const refundRules = { - order_id: [{ required: true, message: '请输入订单ID', trigger: 'blur' }], - bandwidth: [{ required: true, message: '请选择退款方式', trigger: 'change' }] -} - // 当前余额显示 const currentBalanceDisplay = computed(() => { const balance = balanceList.value.find(b => userBalance[b.type]?.type === balanceForm.balance_type) @@ -445,7 +414,8 @@ const handleEditBalance = (balanceType) => { balance_type: apiType, price: 0, state: 'add', - note: '' + note: '', + account_amount: false }) balanceDialogVisible.value = true } @@ -471,7 +441,11 @@ const submitBalanceForm = () => { balanceFormRef.value?.validate(async (valid) => { if (valid) { try { - const res = await editUserBalance(balanceForm) + const submitData = { ...balanceForm } + if (submitData.state !== 'add' || !submitData.account_amount) { + delete submitData.account_amount + } + const res = await editUserBalance(submitData) if (res.data.code === 200) { ElMessage.success('修改成功') balanceDialogVisible.value = false @@ -517,40 +491,6 @@ const handleRecordCurrentChange = () => { fetchBalanceRecord() } -// 退款 -const handleRefund = (row) => { - Object.assign(refundForm, { - history_id: row.Id, - order_id: String(row.OrderId) || 0, - bandwidth: false - }) - refundDialogVisible.value = true -} - -// 提交退款 -const submitRefundForm = () => { - refundFormRef.value?.validate(async (valid) => { - if (valid) { - refundLoading.value = true - try { - const res = await refundBalance(refundForm) - if (res.data.code === 200) { - ElMessage.success('退款成功') - refundDialogVisible.value = false - fetchUserBalance() - } else { - ElMessage.error(res.data.message || '退款失败') - } - } catch (error) { - console.error('退款错误:', error) - ElMessage.error('退款失败') - } finally { - refundLoading.value = false - } - } - }) -} - // 初始化 onMounted(() => { getUserListData() @@ -573,6 +513,15 @@ watch( }, { immediate: true } ) + +watch( + () => balanceForm.state, + (state) => { + if (state !== 'add') { + balanceForm.account_amount = false + } + } +) -- 2.54.0 From c9e8f2ae15d40475077eb438c63da30fae0758cd Mon Sep 17 00:00:00 2001 From: shiran Date: Fri, 24 Jul 2026 21:51:58 +0800 Subject: [PATCH 7/7] =?UTF-8?q?fix:=20=E7=BB=9F=E4=B8=80=E6=8C=87=E6=A0=87?= =?UTF-8?q?=E6=A6=9C=E5=8D=95=E6=95=B0=E5=80=BC=E7=B2=BE=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/virtualization/HostDetail.vue | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/views/virtualization/HostDetail.vue b/src/views/virtualization/HostDetail.vue index ee65818..a6ec006 100644 --- a/src/views/virtualization/HostDetail.vue +++ b/src/views/virtualization/HostDetail.vue @@ -1567,7 +1567,14 @@ const getMetricTopBarPercent = (value) => { const formatMetricTopValue = (item) => { const value = Number(item?.value) || 0 if (item?.unit === '%' || metricTopMetric.value.endsWith('_percent')) return `${value.toFixed(2)}%` - return formatSpeedAuto(value) + const units = [ + { threshold: 1073741824, divisor: 1073741824, label: 'GB/s' }, + { threshold: 1048576, divisor: 1048576, label: 'MB/s' }, + { threshold: 1024, divisor: 1024, label: 'KB/s' } + ] + const unit = units.find(option => Math.abs(value) >= option.threshold) + if (unit) return `${(value / unit.divisor).toFixed(2)} ${unit.label}` + return `${value.toFixed(2)} B/s` } const formatMetricTopSampleTime = (value) => { -- 2.54.0