From 1bae6e55e077bbe75533b2936aef02fe9b1469ec Mon Sep 17 00:00:00 2001 From: lai <371757574@qq.com> Date: Mon, 17 Jun 2024 14:06:51 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=8C=BA=E5=88=86=E7=A7=9F?= =?UTF-8?q?=E6=88=B7=E7=9A=84=E5=88=97(=E6=90=9C=E7=B4=A2=E6=97=B6?= =?UTF-8?q?=E6=B2=A1=E4=BC=A0=E9=80=92userName)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/i18n/locales/en-US.ts | 1 + src/i18n/locales/zh-CN.ts | 1 + src/views/dashboard/imsCDR/index.vue | 68 ++++++++++++++++++++++------ src/views/neUser/sub/index.vue | 1 - 4 files changed, 55 insertions(+), 16 deletions(-) diff --git a/src/i18n/locales/en-US.ts b/src/i18n/locales/en-US.ts index ab97d3a1..5d0fa132 100644 --- a/src/i18n/locales/en-US.ts +++ b/src/i18n/locales/en-US.ts @@ -569,6 +569,7 @@ export default { called: "Called", result: "Result", delTip: "Confirm deletion of the data item numbered [{msg}]?", + tenantName: "Tenant Name", }, ue: { eventType: "Event Type", diff --git a/src/i18n/locales/zh-CN.ts b/src/i18n/locales/zh-CN.ts index 87c808d7..48241fc7 100644 --- a/src/i18n/locales/zh-CN.ts +++ b/src/i18n/locales/zh-CN.ts @@ -569,6 +569,7 @@ export default { called: "被叫", result: "结果", delTip: "确认删除编号为【{msg}】的数据项?", + tenantName: "租户名称", }, ue: { eventType: "事件类型", diff --git a/src/views/dashboard/imsCDR/index.vue b/src/views/dashboard/imsCDR/index.vue index 57856434..314f2f25 100644 --- a/src/views/dashboard/imsCDR/index.vue +++ b/src/views/dashboard/imsCDR/index.vue @@ -5,6 +5,7 @@ import { message, Modal } from 'ant-design-vue/lib'; import { SizeType } from 'ant-design-vue/lib/config-provider'; import { MenuInfo } from 'ant-design-vue/lib/menu/src/interface'; import { ColumnsType } from 'ant-design-vue/lib/table'; +import TableColumnsDnd from '@/components/TableColumnsDnd/index.vue'; import useI18n from '@/hooks/useI18n'; import { RESULT_CODE_ERROR, @@ -15,6 +16,7 @@ import { delIMSDataCDR, listIMSDataCDR } from '@/api/neData/ims'; import { parseDateToStr, parseDuration } from '@/utils/date-utils'; import { OptionsType, WS } from '@/plugins/ws-websocket'; import PQueue from 'p-queue'; +import useUserStore from '@/store/modules/user'; const { t } = useI18n(); const { getDict } = useDictStore(); const ws = new WS(); @@ -39,6 +41,7 @@ let queryParams = reactive({ recordType: 'MOC', callerParty: '', calledParty: '', + tenantName: '', sortField: 'timestamp', sortOrder: 'desc', /**当前页数 */ @@ -54,6 +57,7 @@ function fnQueryReset() { recordType: 'MOC', callerParty: '', calledParty: '', + tenantName: '', pageNum: 1, pageSize: 20, }); @@ -162,6 +166,13 @@ let tableColumns: ColumnsType = [ align: 'left', width: 150, }, + { + title: t('views.dashboard.cdr.tenantName'), + dataIndex: 'tenantName', + align: 'center', + key: 'tenantName', + width: 150, + }, { title: t('views.dashboard.cdr.time'), dataIndex: 'cdrJSON', @@ -179,6 +190,9 @@ let tableColumns: ColumnsType = [ }, ]; +/**表格字段列排序 */ +let tableColumnsDnd = ref([]); + /**表格分页器参数 */ let tablePagination = reactive({ /**当前页数 */ @@ -309,6 +323,7 @@ function fnGetList(pageNum?: number) { modalState.maxId = Number(res.rows[0].id); } } + tableState.loading = false; }); } @@ -394,6 +409,19 @@ onMounted(() => { }) .finally(() => { // 获取列表数据 + console.log(useUserStore().roles); + if (useUserStore().roles.includes('tenant')) { + const operateColumnIndex = tableColumns.findIndex( + column => column.key === 'tenantName' + ); + console.log(operateColumnIndex); + + if (operateColumnIndex !== -1) { + tableColumns.splice(operateColumnIndex, 1); + } + console.log(tableColumns); + } + fnGetList(); }); }); @@ -431,7 +459,19 @@ onBeforeUnmount(() => { > - + + + + + + + { > - + { cancel-text="No" @confirm="fnRealTime()" > - + {{ !realTimeData @@ -497,17 +541,6 @@ onBeforeUnmount(() => { }} - - - - {{ t('common.deleteText') }} - @@ -529,6 +562,11 @@ onBeforeUnmount(() => { + @@ -560,7 +598,7 @@ onBeforeUnmount(() => { { } }) .finally(() => { - console.log(useUserStore().roles); if (useUserStore().roles.includes('tenant')) { const operateColumnIndex = tableColumns.findIndex( column => column.key === 'tenantName'