diff --git a/src/i18n/locales/en-US.ts b/src/i18n/locales/en-US.ts index 784a35f1..771cd2c4 100644 --- a/src/i18n/locales/en-US.ts +++ b/src/i18n/locales/en-US.ts @@ -368,6 +368,10 @@ export default { updateTime:'Update Time', msdData:'MSD Info', agentName: 'Agent Name', + comment: 'Comment', + agentEmail: 'Agent Email', + agentMobile: 'Agent Mobile', + title: ' Ticket List', } }, cbc:{ @@ -508,7 +512,28 @@ export default { sgwcVolumeGPRSUplink: 'GPRS Uplink', sgwcVolumeGPRSDownlink: 'GPRS Downlink', recordPath:'Record Path', - msd:'MSD', + msd:' MSD', + automaticActivation: 'Automatic Activation', + positionCanBeTrusted: 'Position Can Be Trusted', + testCall: 'Test Call', + vehicleType:'Vehicle Type', + messageIdentifier: 'Message Identifier', + numberOfOccupants: 'Number Of Occupants', + n1latitudeDelta:'Recent Vehicle Location N1-Latitude Delta', + n1longitudeDelta: 'Recent Vehicle Location N1-Longitude Delta', + n2latitudeDelta:'Recent Vehicle Location N2-Latitude Delta', + n2longitudeDelta: 'Recent Vehicle Location N2-Longitude Delta', + timestamp: 'Timestamp', + vehicleDirection: 'Vehicle Direction', + isovds: 'Vehicle Descriptor Section', + isovisModelyear:'Vehicle Identifier Section Year', + isovisSeqPlant: 'Vehicle Identifier Section Serial Factory', + isowmi: 'World Manufacturer Identifier', + positionLatitude: 'Position Latitude', + positionLongitude: 'Position Longitude', + dieselTankPresent: 'Diesel Tank Present', + electricEnergyStorage: 'Electric Energy Storage', + gasolineTankPresent: 'Gasoline Tank Present', }, ue: { eventType: "Event Type", diff --git a/src/i18n/locales/zh-CN.ts b/src/i18n/locales/zh-CN.ts index 880ce0a1..162e847c 100644 --- a/src/i18n/locales/zh-CN.ts +++ b/src/i18n/locales/zh-CN.ts @@ -372,6 +372,10 @@ export default { updateTime:'更新时间', msdData:'MSD内容', agentName: '座席名称', + comment: '备注', + agentEmail: '座席邮箱', + agentMobile: '座席手机', + title: '工单列表', } }, cbc:{ @@ -513,6 +517,27 @@ export default { sgwcVolumeGPRSDownlink: 'GPRS 下行链路', recordPath:'录音文件路径', msd:'最小数据集', + automaticActivation: '自动激活', + positionCanBeTrusted: '位置可信', + testCall: '测试呼叫', + vehicleType:'车辆类型', + messageIdentifier: '消息标识', + numberOfOccupants: '乘员数量', + n1latitudeDelta:'最近车辆位置N1-纬度增量', + n1longitudeDelta: '最近车辆位置N1-经度增量', + n2latitudeDelta:' 最近车辆位置N2-纬度增量', + n2longitudeDelta: '最近车辆位置N2-经度增量', + timestamp: '时间戳', + vehicleDirection: '车辆行驶方向', + isovds: '车辆描述段', + isovisModelyear:'车辆描述段', + isovisSeqPlant: '车辆标识段序列工厂', + isowmi: '世界制造商标识', + positionLatitude: '位置纬度', + positionLongitude: '位置经度', + dieselTankPresent: '柴油罐存在', + electricEnergyStorage: '电力储能', + gasolineTankPresent: '汽油罐存在', }, ue: { eventType: "事件类型", diff --git a/src/views/agentManage/callback/index.vue b/src/views/agentManage/callback/index.vue index 446fbe02..304ff200 100644 --- a/src/views/agentManage/callback/index.vue +++ b/src/views/agentManage/callback/index.vue @@ -6,11 +6,15 @@ import { MenuInfo } from 'ant-design-vue/es/menu/src/interface'; import { ColumnsType } from 'ant-design-vue/es/table'; import { parseDateToStr, parseStrToDate } from '@/utils/date-utils'; import { RESULT_CODE_SUCCESS } from '@/constants/result-constants'; -import { listCallBack } from '@/api/agentManage/callback'; +import { listCallBack, updateStatus } from '@/api/agentManage/callback'; import useNeInfoStore from '@/store/modules/neinfo'; import useDictStore from '@/store/modules/dict'; import useI18n from '@/hooks/useI18n'; import { message } from 'ant-design-vue'; +import { ProModal } from 'antdv-pro-modal'; +import { create } from 'domain'; +import { commentProps } from 'ant-design-vue/es/comment'; + const { getDict } = useDictStore(); const { t } = useI18n(); let dictStatus = ref([]); @@ -36,7 +40,6 @@ let queryParams = reactive({ pageSize: 20, }); - /**查询参数重置 */ function fnQueryReset() { queryParams = Object.assign(queryParams, { @@ -104,6 +107,7 @@ let tableColumns: ColumnsType = [ { title: t('views.agentManage.callback.status'), dataIndex: 'status', + key: 'status', align: 'center', width: 4, }, @@ -127,10 +131,16 @@ let tableColumns: ColumnsType = [ return parseDateToStr(opt.value / 1000); }, }, + // { + // title: t('views.agentManage.callback.msdData'), + // dataIndex: 'msdData', + // align: 'center', + // width: 6, + // }, { - title: t('views.agentManage.callback.msdData'), - dataIndex: 'msdData', - align: 'center', + title: t('common.operate'), + key: 'callbackId', + align: 'left', width: 6, }, ]; @@ -186,7 +196,11 @@ function fnGetList(pageNum?: number) { if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { tablePagination.total = res.total; tableState.data = res.data; - if (tablePagination.total <= (queryParams.pageNum - 1) * tablePagination.pageSize && queryParams.pageNum !== 1) { + if ( + tablePagination.total <= + (queryParams.pageNum - 1) * tablePagination.pageSize && + queryParams.pageNum !== 1 + ) { tableState.loading = false; fnGetList(queryParams.pageNum - 1); } @@ -195,6 +209,84 @@ function fnGetList(pageNum?: number) { }); } +/**对话框对象信息状态类型 */ +type ModalStateType = { + /**详情框是否显示 */ + openByView: boolean; + /**新增框或修改框是否显示 */ + openByEdit: boolean; + /**标题 */ + title: string; + /**表单数据 */ + from: Record; + /**确定按钮 loading */ + confirmLoading: boolean; + /**更新加载数据按钮 loading */ + loadDataLoading: boolean; +}; + +/**对话框对象信息状态 */ +let modalState: ModalStateType = reactive({ + openByView: false, + openByEdit: false, + title: 'callback', + from: { + id: undefined, + ticketId: '', + agentName: '', + callerNumber: '', + calleeNumber: '', + agentEmail: '', + agentMobile: '', + status: '', + createdAt: '', + comment: '', + }, + confirmLoading: false, + loadDataLoading: false, +}); + +function fnModalVisibleByEdit(record: any) { + modalState.title = t('common.viewText') + t('views.agentManage.callback.title'); + modalState.openByEdit = true; + modalState.from = Object.assign(modalState.from, record, { + createdAt: record.createdAt ? parseDateToStr(record.createdAt / 1000) : '', + }); +} + +function fnModalOk() { + const from = Object.assign({}, toRaw(modalState.from)); + + modalState.confirmLoading = true; + const hide = message.loading(t('common.loading'), 0); + updateStatus(from) + .then(res => { + if (res.code === RESULT_CODE_SUCCESS) { + message.success({ + content: t('common.msgSuccess', { msg: modalState.title }), + duration: 3, + }); + fnGetList(1); + } else { + message.error({ + content: `${res.msg}`, + duration: 3, + }); + } + }) + .finally(() => { + hide(); + fnModalCancel(); + modalState.confirmLoading = false; + }); +} + +function fnModalCancel() { + modalState.openByEdit = false; + //modalState.openByView = false; + //modalStateFrom.resetFields(); +} + onMounted(() => { getDict('callback_status').then(res => { dictStatus.value = res; @@ -232,26 +324,46 @@ onMounted(() => { - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/views/agentManage/callings/index.vue b/src/views/agentManage/callings/index.vue index 268878fd..3b0e6dbf 100644 --- a/src/views/agentManage/callings/index.vue +++ b/src/views/agentManage/callings/index.vue @@ -82,12 +82,6 @@ let tableColumns: ColumnsType = [ align: 'center', width: 5, }, - { - title: t('views.agentManage.callings.msdData'), - dataIndex: 'msdData', - align: 'center', - width: 6, - }, ]; /**表格分页器参数 */ diff --git a/src/views/dashboard/mfCDR/index.vue b/src/views/dashboard/mfCDR/index.vue index 8355b329..2e86f5c7 100644 --- a/src/views/dashboard/mfCDR/index.vue +++ b/src/views/dashboard/mfCDR/index.vue @@ -12,17 +12,15 @@ import { } from '@/constants/result-constants'; import useDictStore from '@/store/modules/dict'; import useNeInfoStore from '@/store/modules/neinfo'; -import { - delMFDataCDR, - exportMFDataCDR, - listMFDataCDR, -} from '@/api/neData/mf'; +import { delMFDataCDR, exportMFDataCDR, listMFDataCDR } from '@/api/neData/mf'; import { parseDateToStr, parseDuration } from '@/utils/date-utils'; import { OptionsType, WS } from '@/plugins/ws-websocket'; import saveAs from 'file-saver'; import PQueue from 'p-queue'; import { useClipboard } from '@vueuse/core'; import dayjs, { type Dayjs } from 'dayjs'; +import { ProModal } from 'antdv-pro-modal'; + const { copy } = useClipboard({ legacy: true }); const { t } = useI18n(); const { getDict } = useDictStore(); @@ -216,12 +214,12 @@ let tableColumns: ColumnsType = [ { title: t('views.dashboard.cdr.msd'), dataIndex: 'cdrJSON', - key: 'msd', + key: 'msdData', align: 'left', width: 100, customRender(opt) { const cdrJSON = opt.value; - return cdrJSON.msd; + return cdrJSON.msdData; }, }, { @@ -301,12 +299,64 @@ type ModalStateType = { confirmLoading: boolean; /**最大ID值 */ maxId: number; + /**详情框是否显示 */ + openByView: boolean; + /**标题 */ + title: string; + /**表单数据 */ + from: Record; + /**确定按钮 loading */ + /**更新加载数据按钮 loading */ + loadDataLoading: boolean; }; /**对话框对象信息状态 */ let modalState: ModalStateType = reactive({ confirmLoading: false, maxId: 0, + openByView: false, + title: 'mfCDR', + from: { + control: { + automaticActivation: true, + positionCanBeTrusted: true, + testCall: false, + vehicleType: '', + }, + + messageIdentifier: 0, + numberOfOccupants: 0, + + recentVehicleLocationN1: { + latitudeDelta: 0, + longitudeDelta: 0, + }, + recentVehicleLocationN2: { + latitudeDelta: 0, + longitudeDelta: 0, + }, + + timestamp: 0, + vehicleDirection: 0, + vehicleIdentificationNumber: { + isovds: '', + isovisModelyear: '', + isovisSeqPlant: '', + isowmi: '', + }, + + vehicleLocation: { + positionLatitude: 0, + positionLongitude: 0, + }, + + vehiclePropulsionStorageType: { + dieselTankPresent: false, + electricEnergyStorage: true, + gasolineTankPresent: true, + }, + }, + loadDataLoading: false, }); /** @@ -376,6 +426,7 @@ function fnGetList(pageNum?: number) { ) { queryParams.startTime = queryRangePicker.value[0].valueOf(); queryParams.endTime = queryRangePicker.value[1].valueOf(); + console.log(queryRangePicker.value[0].valueOf()); } else { queryParams.startTime = undefined; queryParams.endTime = undefined; @@ -514,6 +565,34 @@ function wsMessage(res: Record) { } } +function fnModalVisibleByEdit(record: Record) { + modalState.title = t('common.viewText') + t('views.dashboard.cdr.msd'); + modalState.openByView = true; + modalState.from = Object.assign(modalState.from, record.cdrJSON.msdData); + console.log(record, modalState.from); + // if (!record || !record.cdrJSON) return; + // const cdrJSON = record.cdrJSON; + // Modal.info({ + // title: t('views.dashboard.cdr.msdData'), + // width: '80%', + // content: ( + //
+  //       {JSON.stringify(cdrJSON, null, 2)}
+  //     
+ // ), + // okText: t('common.copy'), + // onOk() { + // fnRecordCopy(JSON.stringify(cdrJSON, null, 2)); + // }, + // }); +} + +function fnModalCancel() { + // modalState.openByEdit = false; + modalState.openByView = false; + //modalStateFrom.resetFields(); +} + onMounted(() => { // 初始字典数据 Promise.allSettled([getDict('cdr_sip_code'), getDict('cdr_call_type')]).then( @@ -565,26 +644,46 @@ onBeforeUnmount(() => {