add search
This commit is contained in:
@@ -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',
|
||||
}
|
||||
|
||||
@@ -364,7 +364,8 @@ export default {
|
||||
calleeIdNumber:'被叫号码',
|
||||
status:'状态',
|
||||
ticketId:'工单编号',
|
||||
startTime:'开始时间',
|
||||
startTime:'创建时间',
|
||||
updateTime:'更新时间',
|
||||
msdData:'MSD内容',
|
||||
agentName: '座席名称',
|
||||
}
|
||||
|
||||
@@ -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<DictType[]>([]);
|
||||
|
||||
|
||||
|
||||
/**网元参数 */
|
||||
let neOtions = ref<Record<string, any>[]>([]);
|
||||
/**开始结束时间 */
|
||||
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<string, any>[] = [];
|
||||
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();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<PageContainer>
|
||||
|
||||
<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-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>
|
||||
</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>
|
||||
</a-col>
|
||||
<a-col :lg="6" :md="12" :xs="24">
|
||||
<a-form-item>
|
||||
<a-space :size="8">
|
||||
<a-button type="primary" @click.prevent="fnGetList(1)">
|
||||
<template #icon>
|
||||
<SearchOutlined />
|
||||
</template>
|
||||
{{ t('common.search') }}
|
||||
</a-button>
|
||||
<a-button type="default" @click.prevent="fnQueryReset">
|
||||
<template #icon>
|
||||
<ClearOutlined />
|
||||
</template>
|
||||
{{ t('common.reset') }}
|
||||
</a-button>
|
||||
</a-space>
|
||||
</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-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>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</a-card>
|
||||
|
||||
<a-card :bordered="false" :body-style="{ padding: '0px' }">
|
||||
<!-- 插槽-卡片左侧侧 -->
|
||||
|
||||
@@ -37,7 +37,6 @@ const isFirstLoad = ref(true);
|
||||
|
||||
// 更新图表数据的函数
|
||||
function updateChartData(newValue: number, dataArray: any) {
|
||||
if (newValue == 23) { console.log('更新图表数据', newValue, dataArray); }
|
||||
// 如果是第一次加载,用当前值填充整个数组
|
||||
if (isFirstLoad.value) {
|
||||
dataArray.value = Array(7).fill(newValue);
|
||||
@@ -249,19 +248,25 @@ function fnGetList() {
|
||||
|
||||
activeCallsChange.value = prevActiveCalls.value ? prevActiveCalls.value - activeCalls.value : 0;
|
||||
onlineCountChange.value = prevOnlineCount.value ? prevOnlineCount.value - onlineCount.value : 0;
|
||||
|
||||
// 更新图表数据
|
||||
updateUserChartData(activeCalls.value, activeCallsData);
|
||||
updateUserChartData(onlineCount.value, mosData);
|
||||
updateUserChartData(activeCalls.value ? activeCalls.value : 0, activeCallsData);
|
||||
updateUserChartData(onlineCount.value ? onlineCount.value : 0, mosData);
|
||||
|
||||
// 第一次加载完成后,设置标志为false
|
||||
if (isFirstLoadUser.value) {
|
||||
isFirstLoadUser.value = false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
})
|
||||
.catch(error => {
|
||||
updateUserChartData(0, activeCallsData);
|
||||
updateUserChartData(0, mosData);
|
||||
|
||||
// 第一次加载完成后,设置标志为false
|
||||
if (isFirstLoadUser.value) {
|
||||
isFirstLoadUser.value = false;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
@@ -322,7 +327,8 @@ onBeforeUnmount(() => {
|
||||
<div class="row-title">{{ t('views.dashboard.overview.userTitle') }}</div>
|
||||
<a-row :gutter="[48, 48]">
|
||||
<a-col :xs="24" :sm="24" :lg="8">
|
||||
<a-card :bordered="false" class="metric-card" @click="fnToRouter('NeConfig_2146',{neType:'MF',treeName:'agents'})">
|
||||
<a-card :bordered="false" class="metric-card"
|
||||
@click="fnToRouter('NeConfig_2146', { neType: 'MF', treeName: 'agents' })">
|
||||
<div class="card-title">{{ t('views.dashboard.overview.totalUser') }}</div>
|
||||
<div class="card-content">
|
||||
<div class="trend-chart">
|
||||
@@ -341,7 +347,8 @@ onBeforeUnmount(() => {
|
||||
</a-col>
|
||||
|
||||
<a-col :xs="24" :sm="24" :lg="8">
|
||||
<a-card :bordered="false" class="metric-card" @click="fnToRouter('NeConfig_2146',{neType:'MF',treeName:'agents'})">
|
||||
<a-card :bordered="false" class="metric-card"
|
||||
@click="fnToRouter('NeConfig_2146', { neType: 'MF', treeName: 'agents' })">
|
||||
<div class="card-title">{{ t('views.dashboard.overview.onlineUser') }}</div>
|
||||
<div class="card-content">
|
||||
<div class="trend-chart">
|
||||
@@ -362,7 +369,7 @@ onBeforeUnmount(() => {
|
||||
|
||||
|
||||
<a-col :xs="24" :sm="24" :lg="8">
|
||||
<a-card :bordered="false" class="metric-card" @click="fnToRouter('Callings_2201')">
|
||||
<a-card :bordered="false" class="metric-card" @click="fnToRouter('Callings_2201')">
|
||||
<div class="card-title">{{ t('views.dashboard.overview.parallelUser') }}</div>
|
||||
<div class="card-content">
|
||||
<div class="trend-chart">
|
||||
@@ -374,7 +381,8 @@ onBeforeUnmount(() => {
|
||||
<a-icon :class="['trend-icon', failedCallsCountChange >= 0 ? 'up' : 'down']"
|
||||
:type="failedCallsCountChange >= 0 ? 'arrow-up' : 'arrow-down'" />
|
||||
</div>
|
||||
<div class="metric-change">{{ failedCallsCountChange >= 0 ? '+' : '' }}{{ failedCallsCountChange }} last 10s</div>
|
||||
<div class="metric-change">{{ failedCallsCountChange >= 0 ? '+' : '' }}{{ failedCallsCountChange }} last
|
||||
10s</div>
|
||||
</div>
|
||||
</div>
|
||||
</a-card>
|
||||
|
||||
Reference in New Issue
Block a user