修复PSAP需求
This commit is contained in:
@@ -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<DictType[]>([]);
|
||||
@@ -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<string, any>;
|
||||
/**确定按钮 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(() => {
|
||||
|
||||
<template>
|
||||
<PageContainer>
|
||||
<a-card v-show="tableState.seached" :bordered="false" :body-style="{ marginBottom: '24px', paddingBottom: 0 }">
|
||||
<a-card
|
||||
v-show="tableState.seached"
|
||||
:bordered="false"
|
||||
:body-style="{ marginBottom: '24px', paddingBottom: 0 }"
|
||||
>
|
||||
<!-- 表格搜索栏 -->
|
||||
<a-form :model="queryParams" name="queryParams" layout="horizontal">
|
||||
<a-row :gutter="16">
|
||||
<a-col :lg="6" :md="12" :xs="24">
|
||||
<a-form-item label="PSAP对象" name="neId ">
|
||||
<a-select v-model:value="queryParams.neId" :options="neOtions" :placeholder="t('common.selectPlease')"
|
||||
@change="fnGetList(1)" />
|
||||
<a-select
|
||||
v-model:value="queryParams.neId"
|
||||
:options="neOtions"
|
||||
:placeholder="t('common.selectPlease')"
|
||||
@change="fnGetList(1)"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6" :md="12" :xs="24">
|
||||
<a-form-item :label="t('views.agentManage.callback.callerIdNumber')" name="callerNumber">
|
||||
<a-input v-model:value="queryParams.callerNumber" allow-clear
|
||||
:placeholder="t('common.inputPlease')"></a-input>
|
||||
<a-form-item
|
||||
:label="t('views.agentManage.callback.callerIdNumber')"
|
||||
name="callerNumber"
|
||||
>
|
||||
<a-input
|
||||
v-model:value="queryParams.callerNumber"
|
||||
allow-clear
|
||||
:placeholder="t('common.inputPlease')"
|
||||
></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6" :md="12" :xs="24">
|
||||
<a-form-item :label="t('views.agentManage.callback.agentName')" name="agentName">
|
||||
<a-input v-model:value="queryParams.agentName" allow-clear
|
||||
:placeholder="t('common.inputPlease')"></a-input>
|
||||
<a-form-item
|
||||
:label="t('views.agentManage.callback.agentName')"
|
||||
name="agentName"
|
||||
>
|
||||
<a-input
|
||||
v-model:value="queryParams.agentName"
|
||||
allow-clear
|
||||
:placeholder="t('common.inputPlease')"
|
||||
></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6" :md="12" :xs="24">
|
||||
@@ -273,15 +385,32 @@ onMounted(() => {
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6" :md="12" :xs="24">
|
||||
<a-form-item :label="t('views.agentManage.callback.status')" name="status">
|
||||
<a-select v-model:value="queryParams.status" :options="dictStatus">
|
||||
<a-form-item
|
||||
:label="t('views.agentManage.callback.status')"
|
||||
name="status"
|
||||
>
|
||||
<a-select
|
||||
v-model:value="queryParams.status"
|
||||
:options="dictStatus"
|
||||
:allow-clear="true"
|
||||
>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="8" :md="12" :xs="24">
|
||||
<a-form-item :label="t('views.agentManage.callback.startTime')" name="queryRangePicker">
|
||||
<a-range-picker v-model:value="queryRangePicker" allow-clear bordered :show-time="{ format: 'HH:mm:ss' }"
|
||||
format="YYYY-MM-DD HH:mm:ss" value-format="x" style="width: 100%"></a-range-picker>
|
||||
<a-form-item
|
||||
:label="t('views.agentManage.callback.startTime')"
|
||||
name="queryRangePicker"
|
||||
>
|
||||
<a-range-picker
|
||||
v-model:value="queryRangePicker"
|
||||
allow-clear
|
||||
bordered
|
||||
:show-time="{ format: 'HH:mm:ss' }"
|
||||
format="YYYY-MM-DD HH:mm:ss"
|
||||
value-format="x"
|
||||
style="width: 100%"
|
||||
></a-range-picker>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
@@ -312,7 +441,10 @@ onMounted(() => {
|
||||
</template>
|
||||
</a-button>
|
||||
<template #overlay>
|
||||
<a-menu :selected-keys="[tableState.size as string]" @click="fnTableSize">
|
||||
<a-menu
|
||||
:selected-keys="[tableState.size as string]"
|
||||
@click="fnTableSize"
|
||||
>
|
||||
<a-menu-item key="default">
|
||||
{{ t('common.size.default') }}
|
||||
</a-menu-item>
|
||||
@@ -330,11 +462,176 @@ onMounted(() => {
|
||||
</template>
|
||||
|
||||
<!-- 表格列表 -->
|
||||
<a-table class="table" row-key="id" :columns="tableColumns" :loading="tableState.loading"
|
||||
:data-source="tableState.data" :size="tableState.size" :pagination="tablePagination"
|
||||
:scroll="{ x: 1500, y: 400 }">
|
||||
<a-table
|
||||
class="table"
|
||||
row-key="id"
|
||||
:columns="tableColumns"
|
||||
:loading="tableState.loading"
|
||||
:data-source="tableState.data"
|
||||
:size="tableState.size"
|
||||
:pagination="tablePagination"
|
||||
:scroll="{ x: 1500, y: 400 }"
|
||||
>
|
||||
<template #bodyCell="{ column, record }">
|
||||
|
||||
<template v-if="column.key === 'status'">
|
||||
<DictTag :options="dictStatus" :value="record.status" />
|
||||
</template>
|
||||
|
||||
<template v-if="column.key === 'callbackId'">
|
||||
<a-space :size="8" align="center">
|
||||
<a-tooltip>
|
||||
<template #title>{{ t('common.viewText') }}</template>
|
||||
<a-button
|
||||
type="link"
|
||||
@click.prevent="fnModalVisibleByEdit(record)"
|
||||
>
|
||||
<template #icon><InfoCircleOutlined /></template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
</a-space>
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
</a-card>
|
||||
|
||||
<ProModal
|
||||
:drag="true"
|
||||
:width="800"
|
||||
:destroyOnClose="true"
|
||||
style="top: 0px"
|
||||
:body-style="{ maxHeight: '600px', 'overflow-y': 'auto' }"
|
||||
:keyboard="false"
|
||||
:mask-closable="false"
|
||||
:open="modalState.openByEdit"
|
||||
:title="modalState.title"
|
||||
:confirm-loading="modalState.confirmLoading"
|
||||
@cancel="fnModalCancel"
|
||||
@ok="fnModalOk"
|
||||
:okText=" t('views.faultManage.activeAlarm.confirm') "
|
||||
>
|
||||
<a-form
|
||||
name="modalStateFrom"
|
||||
layout="horizontal"
|
||||
:label-col="{ span: 6 }"
|
||||
:labelWrap="true"
|
||||
>
|
||||
<a-row>
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
:label="t('views.agentManage.callback.ticketId')"
|
||||
name="ticketId"
|
||||
>
|
||||
<a-input
|
||||
:disabled="true"
|
||||
v-model:value="modalState.from.ticketId"
|
||||
></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
:label="t('views.agentManage.callback.agentName')"
|
||||
name="agentName"
|
||||
>
|
||||
<a-input
|
||||
:disabled="true"
|
||||
v-model:value="modalState.from.agentName"
|
||||
></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
<a-row>
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
:label="t('views.agentManage.callback.callerIdNumber')"
|
||||
name="callerNumber"
|
||||
>
|
||||
<a-input
|
||||
:disabled="true"
|
||||
v-model:value="modalState.from.callerNumber"
|
||||
></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
:label="t('views.agentManage.callback.calleeIdNumber')"
|
||||
name="calleeNumber"
|
||||
>
|
||||
<a-input
|
||||
:disabled="true"
|
||||
v-model:value="modalState.from.calleeNumber"
|
||||
></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
<a-row>
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
:label="t('views.agentManage.callback.agentEmail')"
|
||||
name="agentEmail"
|
||||
>
|
||||
<a-input
|
||||
:disabled="true"
|
||||
v-model:value="modalState.from.agentEmail"
|
||||
></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
:label="t('views.agentManage.callback.agentMobile')"
|
||||
name="agentMobile"
|
||||
>
|
||||
<a-input
|
||||
:disabled="true"
|
||||
v-model:value="modalState.from.agentMobile"
|
||||
></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
<a-row>
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
:label="t('views.agentManage.callback.status')"
|
||||
name="status"
|
||||
>
|
||||
<a-input
|
||||
:disabled="true"
|
||||
v-model:value="modalState.from.status"
|
||||
></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
:label="t('views.agentManage.callback.startTime')"
|
||||
name="createdAt"
|
||||
>
|
||||
<a-input
|
||||
:disabled="true"
|
||||
v-model:value="modalState.from.createdAt"
|
||||
></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
<a-form-item
|
||||
:label="t('views.agentManage.callback.comment')"
|
||||
:label-col="{ span: 3 }"
|
||||
name="comment"
|
||||
>
|
||||
<a-input
|
||||
:disabled="true"
|
||||
v-model:value="modalState.from.comment"
|
||||
></a-input>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</ProModal>
|
||||
</PageContainer>
|
||||
</template>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user