diff --git a/src/components/business/OperationLogsDialog.vue b/src/components/business/OperationLogsDialog.vue new file mode 100644 index 0000000..af7c7a7 --- /dev/null +++ b/src/components/business/OperationLogsDialog.vue @@ -0,0 +1,44 @@ + + + diff --git a/src/types/components.d.ts b/src/types/components.d.ts index c29a624..f7f757a 100644 --- a/src/types/components.d.ts +++ b/src/types/components.d.ts @@ -137,6 +137,7 @@ declare module 'vue' { LoginLeftView: typeof import('./../components/core/views/login/LoginLeftView.vue')['default'] MenuLayoutSettings: typeof import('./../components/core/layouts/art-settings-panel/widget/MenuLayoutSettings.vue')['default'] MenuStyleSettings: typeof import('./../components/core/layouts/art-settings-panel/widget/MenuStyleSettings.vue')['default'] + OperationLogsDialog: typeof import('./../components/business/OperationLogsDialog.vue')['default'] OperatorSelect: typeof import('./../components/business/OperatorSelect.vue')['default'] PackageSelector: typeof import('./../components/business/PackageSelector.vue')['default'] PaymentVoucherDialog: typeof import('./../components/business/PaymentVoucherDialog.vue')['default'] diff --git a/src/views/asset-management/asset-information/composables/useAssetInfo.ts b/src/views/asset-management/asset-information/composables/useAssetInfo.ts index 1c9f938..afc4d8c 100644 --- a/src/views/asset-management/asset-information/composables/useAssetInfo.ts +++ b/src/views/asset-management/asset-information/composables/useAssetInfo.ts @@ -107,7 +107,7 @@ export function useAssetInfo() { packageSeries: data.series_name || '-', packageTotalFlow: formatDataSize(data.package_total_mb || 0), usedFlow: formatDataSize(data.package_used_mb || 0), - remainFlow: formatDataSize(data.package_remain_mb || 0), + remainFlow: formatDataSize((data.package_total_mb || 0) - (data.package_used_mb || 0)), usedFlowPercentage: data.package_total_mb > 0 ? `${((data.package_used_mb / data.package_total_mb) * 100).toFixed(2)}%` diff --git a/src/views/asset-management/device-list/index.vue b/src/views/asset-management/device-list/index.vue index 6f5a278..9a0c4d6 100644 --- a/src/views/asset-management/device-list/index.vue +++ b/src/views/asset-management/device-list/index.vue @@ -490,6 +490,12 @@ :current-policy="currentRealnamePolicy" @confirm="handleConfirmRealnamePolicy" /> + + + @@ -525,6 +531,7 @@ import { formatDateTime } from '@/utils/business/format' import type { PackageSeriesResponse } from '@/types/api' import RealnamePolicyDialog from '@/components/device/RealnamePolicyDialog.vue' + import OperationLogsDialog from '@/components/business/OperationLogsDialog.vue' defineOptions({ name: 'DeviceList' }) @@ -540,6 +547,8 @@ const allocateDialogVisible = ref(false) const recallDialogVisible = ref(false) const selectedDevices = ref([]) + const operationLogsDialogVisible = ref(false) + const operationLogsIdentifier = ref('') const shopCascadeOptions = ref([]) const shopCascadeProps = { lazy: true, @@ -1965,6 +1974,17 @@ }) } + if (hasAuth('device:operation_logs')) { + moreActions.push({ + label: '操作审计日志', + handler: () => { + operationLogsIdentifier.value = row.virtual_no + operationLogsDialogVisible.value = true + }, + type: 'primary' + }) + } + // 如果有更多操作,添加到 actions 中 if (moreActions.length > 0) { actions.push(...moreActions) diff --git a/src/views/asset-management/iot-card-management/index.vue b/src/views/asset-management/iot-card-management/index.vue index 9a23316..312e61e 100644 --- a/src/views/asset-management/iot-card-management/index.vue +++ b/src/views/asset-management/iot-card-management/index.vue @@ -42,19 +42,7 @@ > 批量设置套餐系列 - - 更多操作 - + @@ -508,92 +496,6 @@ - - -
- -
查询中...
-
- - - {{ flowUsageData.totalFlow || 0 }} MB - {{ flowUsageData.usedFlow || 0 }} MB - {{ flowUsageData.remainFlow || 0 }} MB - {{ - flowUsageData.extend - }} - - - -
- - - -
- -
查询中...
-
- - - {{ - realnameStatusData.status || '未知' - }} - {{ - realnameStatusData.extend - }} - - - -
- - - -
- -
查询中...
-
- - - {{ - cardStatusData.iccid || '--' - }} - {{ - cardStatusData.cardStatus || '未知' - }} - {{ - cardStatusData.extend - }} - - - -
- - - - + + + @@ -636,8 +544,6 @@ import { useUserStore } from '@/store/modules/user' import { storeToRefs } from 'pinia' import { formatDateTime } from '@/utils/business/format' - import ArtMenuRight from '@/components/core/others/ArtMenuRight.vue' - import type { MenuItemType } from '@/components/core/others/ArtMenuRight.vue' import type { StandaloneIotCard, StandaloneCardStatus, @@ -648,6 +554,7 @@ } from '@/types/api/card' import { CardSelectionType } from '@/types/api/card' import type { PackageSeriesResponse } from '@/types/api' + import OperationLogsDialog from '@/components/business/OperationLogsDialog.vue' defineOptions({ name: 'StandaloneCardList' }) @@ -675,6 +582,10 @@ failed_items: null }) + // 操作审计日志弹窗 + const operationLogsDialogVisible = ref(false) + const operationLogsIdentifier = ref('') + // 套餐系列绑定相关 const seriesBindingDialogVisible = ref(false) const seriesBindingLoading = ref(false) @@ -821,17 +732,6 @@ const currentCardDetail = ref(null) // IoT卡操作相关对话框 - const flowUsageDialogVisible = ref(false) - const flowUsageLoading = ref(false) - const flowUsageData = ref(null) - - const realnameStatusDialogVisible = ref(false) - const realnameStatusLoading = ref(false) - const realnameStatusData = ref(null) - - const cardStatusDialogVisible = ref(false) - const cardStatusLoading = ref(false) - const cardStatusData = ref(null) // 实名认证策略对话框 const realnamePolicyDialogVisible = ref(false) @@ -898,9 +798,6 @@ await getTableData() } - // 更多操作右键菜单 - const moreMenuRef = ref>() - // 店铺相关 const shopCascadeOptions = ref([]) const shopCascadeProps = { @@ -1556,6 +1453,17 @@ }) } + if (hasAuth('iot_card:operation_logs')) { + actions.push({ + label: '操作审计日志', + handler: () => { + operationLogsIdentifier.value = row.iccid + operationLogsDialogVisible.value = true + }, + type: 'primary' + }) + } + return actions } @@ -1906,59 +1814,6 @@ }) } - // 更多操作菜单项配置 - const moreMenuItems = computed((): MenuItemType[] => { - const items: MenuItemType[] = [] - - if (hasAuth('iot_card:batch_download')) { - items.push({ - key: 'download', - label: '批量下载' - }) - } - - if (hasAuth('iot_card:change_package')) { - items.push({ - key: 'changePackage', - label: '其他功能暂定' - }) - } - - return items - }) - - // 卡操作菜单项配置 - - // 显示更多操作菜单 (左键点击) - const showMoreMenuOnClick = (e: MouseEvent) => { - e.stopPropagation() - moreMenuRef.value?.show(e) - } - - // 处理更多操作菜单选择 - const handleMoreMenuSelect = (item: MenuItemType) => { - switch (item.key) { - case 'distribution': - cardDistribution() - break - case 'recharge': - batchRecharge() - break - case 'recycle': - cardRecycle() - break - case 'download': - batchDownload() - break - case 'changePackage': - changePackage() - break - case 'clearSeries': - handleClearCardSeries() - break - } - } - // 清除卡套餐系列绑定 const handleClearCardSeries = async () => { if (selectedCards.value.length === 0) { @@ -1999,31 +1854,6 @@ }) } - // 网卡分销 - 正在开发中 - const cardDistribution = () => { - ElMessage.info('功能正在开发中') - } - - // 批量充值 - 正在开发中 - const batchRecharge = () => { - ElMessage.info('功能正在开发中') - } - - // 网卡回收 - 正在开发中 - const cardRecycle = () => { - ElMessage.info('功能正在开发中') - } - - // 批量下载 - 正在开发中 - const batchDownload = () => { - ElMessage.info('功能正在开发中') - } - - // 变更套餐 - 正在开发中 - const changePackage = () => { - ElMessage.info('功能正在开发中') - } - // IoT卡操作处理函数 const handleCardOperation = (command: string, iccid: string, row?: any) => { switch (command) {