diff --git a/src/i18n/locales/en-US.ts b/src/i18n/locales/en-US.ts index 51eca940..c5027753 100644 --- a/src/i18n/locales/en-US.ts +++ b/src/i18n/locales/en-US.ts @@ -364,7 +364,8 @@ export default { calleeIdNumber:'Callee Number', status:'Status', ticketId:'Ticket ID', - startTime:'Start Time', + startTime:'Created Time', + updateTime:'Update Time', msdData:'MSD Info', agentName: 'Agent Name', } diff --git a/src/i18n/locales/zh-CN.ts b/src/i18n/locales/zh-CN.ts index 0dc333f3..8d5019f8 100644 --- a/src/i18n/locales/zh-CN.ts +++ b/src/i18n/locales/zh-CN.ts @@ -364,7 +364,8 @@ export default { calleeIdNumber:'被叫号码', status:'状态', ticketId:'工单编号', - startTime:'开始时间', + startTime:'创建时间', + updateTime:'更新时间', msdData:'MSD内容', agentName: '座席名称', } diff --git a/src/views/agentManage/callback/index.vue b/src/views/agentManage/callback/index.vue index 47296b19..9278e40e 100644 --- a/src/views/agentManage/callback/index.vue +++ b/src/views/agentManage/callback/index.vue @@ -4,25 +4,32 @@ import { PageContainer } from 'antdv-pro-layout'; import { SizeType } from 'ant-design-vue/es/config-provider'; 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 { parseDateToStr, parseStrToDate } from '@/utils/date-utils'; import { RESULT_CODE_SUCCESS } from '@/constants/result-constants'; import { listCallBack } 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'; const { getDict } = useDictStore(); const { t } = useI18n(); +let dictStatus = ref([]); - - +/**网元参数 */ +let neOtions = ref[]>([]); +/**开始结束时间 */ +let queryRangePicker = ref<[string, string]>(['', '']); /**查询参数 */ let queryParams = reactive({ /**网元类型 */ neId: '001', /**记录时间 */ - beginTime: '', + startTime: '', endTime: '', + callerNumber: '', + agentName: '', + status: 'New', /**当前页数 */ pageNum: 1, /**每页条数 */ @@ -30,6 +37,24 @@ let queryParams = reactive({ }); +/**查询参数重置 */ +function fnQueryReset() { + queryParams = Object.assign(queryParams, { + neId: '001', + status: 'New', + beginTime: '', + endTime: '', + callerNumber: '', + agentName: '', + pageNum: 1, + pageSize: 20, + }); + queryRangePicker.value = ['', '']; + tablePagination.current = 1; + tablePagination.pageSize = 20; + fnGetList(); +} + /**表格状态类型 */ type TabeStateType = { /**加载等待 */ @@ -76,6 +101,12 @@ let tableColumns: ColumnsType = [ align: 'center', width: 5, }, + { + title: t('views.agentManage.callback.status'), + dataIndex: 'status', + align: 'center', + width: 4, + }, { title: t('views.agentManage.callback.startTime'), dataIndex: 'createdAt', @@ -83,14 +114,18 @@ let tableColumns: ColumnsType = [ width: 6, customRender(opt) { if (!opt.value) return ''; - return parseDateToStr(opt.value/1000); + return parseDateToStr(opt.value / 1000); }, }, { - title: t('views.agentManage.callback.status'), - dataIndex: 'status', + title: t('views.agentManage.callback.updateTime'), + dataIndex: 'updatedAt', align: 'center', - width: 4, + width: 6, + customRender(opt) { + if (!opt.value) return ''; + return parseDateToStr(opt.value / 1000); + }, }, { title: t('views.agentManage.callback.msdData'), @@ -141,6 +176,11 @@ function fnGetList(pageNum?: number) { queryParams.pageNum = pageNum; } + if (!queryRangePicker.value) { + queryRangePicker.value = ['', '']; + } + queryParams.startTime = queryRangePicker.value[0]; + queryParams.endTime = queryRangePicker.value[1]; listCallBack(toRaw(queryParams)).then(res => { if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { @@ -156,14 +196,99 @@ function fnGetList(pageNum?: number) { } onMounted(() => { - // 获取列表数据 - fnGetList(); + getDict('callback_status').then(res => { + dictStatus.value = res; + console.log('dictStatus', dictStatus.value); + + }); + // 获取网元网元列表 + useNeInfoStore() + .fnNelist() + .then(res => { + if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { + if (res.data.length > 0) { + let arr: Record[] = []; + res.data.forEach(i => { + if (i.neType === 'MF') { + arr.push({ value: i.neId, label: i.neName }); + } + }); + neOtions.value = arr; + if (arr.length > 0) { + queryParams.neId = arr[0].value; + } + } + } else { + message.warning({ + content: t('common.noData'), + duration: 2, + }); + } + }) + .finally(() => { + // 获取列表数据 + fnGetList(); + }); });