新增黄金指标,性能任务管理,修正历史活动告警
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { reactive, onMounted, toRaw } from 'vue';
|
||||
import { reactive, onMounted, ref, toRaw } from 'vue';
|
||||
import { PageContainer } from '@ant-design-vue/pro-layout';
|
||||
import { Form, message, Modal } from 'ant-design-vue/lib';
|
||||
import { SizeType } from 'ant-design-vue/lib/config-provider';
|
||||
@@ -11,25 +11,19 @@ import useI18n from '@/hooks/useI18n';
|
||||
import useUserStore from '@/store/modules/user';
|
||||
import useNeInfoStore from '@/store/modules/neinfo';
|
||||
import {
|
||||
addTraceTask,
|
||||
delTraceTask,
|
||||
getTraceTask,
|
||||
addPerfTask,
|
||||
delPerfTask,
|
||||
getPerfTask,
|
||||
listPerfTask,
|
||||
updateTraceTask,
|
||||
updatePerfTask,
|
||||
taskStop,
|
||||
taskRun,
|
||||
} from '@/api/perfManage/taskManage';
|
||||
import useDictStore from '@/store/modules/dict';
|
||||
import { regExpIPv4, regExpPort } from '@/utils/regular-utils';
|
||||
const { getDict } = useDictStore();
|
||||
const { t, currentLocale } = useI18n();
|
||||
|
||||
/**字典数据 */
|
||||
let dict: {
|
||||
/**跟踪类型 */
|
||||
traceType: DictType[];
|
||||
} = reactive({
|
||||
traceType: [],
|
||||
});
|
||||
|
||||
/**表格所需option */
|
||||
const taskManageOption = reactive({
|
||||
granulOption: [
|
||||
@@ -39,8 +33,58 @@ const taskManageOption = reactive({
|
||||
{ label: '24H', value: '24H' },
|
||||
],
|
||||
timeSlotAll: [{ label: '', value: '' }],
|
||||
bigPlan: [
|
||||
{ label: '周测量计划', value: 'Weekly' },
|
||||
{ label: '月测量计划', value: 'Monthly' },
|
||||
],
|
||||
smPlan: {
|
||||
Weekly: [
|
||||
{ label: '星期一', value: '1' },
|
||||
{ label: '星期二', value: '2' },
|
||||
{ label: '星期三', value: '3' },
|
||||
{ label: '星期四', value: '4' },
|
||||
{ label: '星期五', value: '5' },
|
||||
{ label: '星期六', value: '6' },
|
||||
{ label: '星期天', value: '7' },
|
||||
],
|
||||
Monthly: [
|
||||
{ label: '1', value: '1' },
|
||||
{ label: '2', value: '2' },
|
||||
{ label: '3', value: '3' },
|
||||
{ label: '4', value: '4' },
|
||||
{ label: '5', value: '5' },
|
||||
{ label: '6', value: '6' },
|
||||
{ label: '7', value: '7' },
|
||||
{ label: '8', value: '8' },
|
||||
{ label: '9', value: '9' },
|
||||
{ label: '10', value: '10' },
|
||||
{ label: '11', value: '11' },
|
||||
{ label: '12', value: '12' },
|
||||
{ label: '13', value: '13' },
|
||||
{ label: '14', value: '14' },
|
||||
{ label: '15', value: '15' },
|
||||
{ label: '16', value: '16' },
|
||||
{ label: '17', value: '17' },
|
||||
{ label: '18', value: '18' },
|
||||
{ label: '19', value: '19' },
|
||||
{ label: '20', value: '20' },
|
||||
{ label: '21', value: '21' },
|
||||
{ label: '22', value: '22' },
|
||||
{ label: '23', value: '23' },
|
||||
{ label: '24', value: '24' },
|
||||
{ label: '25', value: '25' },
|
||||
{ label: '26', value: '26' },
|
||||
{ label: '27', value: '27' },
|
||||
{ label: '28', value: '28' },
|
||||
{ label: '29', value: '29' },
|
||||
{ label: '30', value: '30' },
|
||||
],
|
||||
},
|
||||
});
|
||||
|
||||
/**记录开始结束时间 */
|
||||
let queryRangePicker = ref<[string, string]>(['', '']);
|
||||
|
||||
/**查询参数 */
|
||||
let queryParams = reactive({
|
||||
/**网元类型 */
|
||||
@@ -167,17 +211,17 @@ function fnTableSize({ key }: MenuInfo) {
|
||||
* 备份信息删除
|
||||
* @param row 记录编号ID
|
||||
*/
|
||||
function fnRecordDelete(id: string) {
|
||||
function fnRecordDelete(row: Record<string, any>) {
|
||||
Modal.confirm({
|
||||
title: t('common.tipTitle'),
|
||||
content: t('views.traceManage.task.delTaskTip', { num: id }),
|
||||
content: t('views.perfManage.taskManage.delPerfTip', { num: row.id }),
|
||||
onOk() {
|
||||
const key = 'delTraceTask';
|
||||
message.loading({ content: t('common.loading'), key });
|
||||
delTraceTask(id).then(res => {
|
||||
delPerfTask(row).then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
message.success({
|
||||
content: t('views.traceManage.task.delTask', { num: id }),
|
||||
content: t('views.perfManage.taskManage.delPerf', { num: row.id }),
|
||||
key,
|
||||
duration: 2,
|
||||
});
|
||||
@@ -219,20 +263,21 @@ type ModalStateType = {
|
||||
visibleByEdit: boolean;
|
||||
/**标题 */
|
||||
title: string;
|
||||
/**选择后清空 */
|
||||
initPeriods: [];
|
||||
/**网元类型设备对象 */
|
||||
neType: string[];
|
||||
/**网元类型设备对象接口 */
|
||||
neTypeInterface: Record<string, any>[];
|
||||
/**网元类型性能测量集 */
|
||||
neTypPerformance: Record<string, any>[];
|
||||
/**网元类型性能测量集选择 */
|
||||
neTypPerformanceList: [];
|
||||
/**网元类型设备对象接口选择 */
|
||||
neTypeInterfaceSelect: string[];
|
||||
/**任务开始结束时间 */
|
||||
timeRangePicker: [string, string];
|
||||
/**时间段多选 */
|
||||
timeSlotAll: [];
|
||||
timeSlotAll: string[];
|
||||
/**时间段多选 */
|
||||
periodsStep: number;
|
||||
|
||||
/**表单数据 */
|
||||
from: Record<string, any>;
|
||||
/**确定按钮 loading */
|
||||
@@ -244,32 +289,28 @@ let modalState: ModalStateType = reactive({
|
||||
visibleByView: false,
|
||||
visibleByEdit: false,
|
||||
title: '',
|
||||
initPeriods: [],
|
||||
neType: [],
|
||||
neTypeInterface: [],
|
||||
neTypPerformance: [],
|
||||
neTypPerformanceList: [],
|
||||
neTypeInterfaceSelect: [],
|
||||
timeRangePicker: ['', ''],
|
||||
timeSlotAll: [],
|
||||
periodsStep: 30,
|
||||
|
||||
from: {
|
||||
id: '',
|
||||
neType: '',
|
||||
neId: '',
|
||||
granulOption: '',
|
||||
traceType: 'Device',
|
||||
startTime: '',
|
||||
endTime: '',
|
||||
bigPlan: '',
|
||||
smPlan: [],
|
||||
comment: '',
|
||||
// 跟踪类型用户
|
||||
imsi: '',
|
||||
msisdn: '',
|
||||
// 跟踪类型接口
|
||||
srcIp: '',
|
||||
dstIp: '',
|
||||
|
||||
performanceArr: '',
|
||||
kpiSet: '',
|
||||
periods: [],
|
||||
signalPort: '',
|
||||
},
|
||||
confirmLoading: false,
|
||||
});
|
||||
@@ -278,12 +319,6 @@ let modalState: ModalStateType = reactive({
|
||||
const modalStateFrom = Form.useForm(
|
||||
modalState.from,
|
||||
reactive({
|
||||
traceType: [
|
||||
{
|
||||
required: true,
|
||||
message: t('views.traceManage.task.trackTypePlease'),
|
||||
},
|
||||
],
|
||||
neId: [
|
||||
{
|
||||
required: true,
|
||||
@@ -296,27 +331,6 @@ const modalStateFrom = Form.useForm(
|
||||
message: t('views.traceManage.task.rangePickerPlease'),
|
||||
},
|
||||
],
|
||||
// 跟踪用户
|
||||
imsi: [
|
||||
{
|
||||
required: true,
|
||||
message: t('views.traceManage.task.imsiPlease'),
|
||||
},
|
||||
],
|
||||
msisdn: [
|
||||
{
|
||||
required: true,
|
||||
message: t('views.traceManage.task.msisdnPlease'),
|
||||
},
|
||||
],
|
||||
// 跟踪接口
|
||||
srcIp: [
|
||||
{
|
||||
required: true,
|
||||
pattern: regExpIPv4,
|
||||
message: t('views.traceManage.task.srcIpPlease'),
|
||||
},
|
||||
],
|
||||
dstIp: [
|
||||
{
|
||||
required: true,
|
||||
@@ -324,17 +338,10 @@ const modalStateFrom = Form.useForm(
|
||||
message: t('views.traceManage.task.dstIpPlease'),
|
||||
},
|
||||
],
|
||||
interfaces: [
|
||||
performanceArr: [
|
||||
{
|
||||
required: true,
|
||||
message: t('views.traceManage.task.interfacesPlease'),
|
||||
},
|
||||
],
|
||||
signalPort: [
|
||||
{
|
||||
required: true,
|
||||
pattern: regExpPort,
|
||||
message: t('views.traceManage.task.signalPortPlease'),
|
||||
message: t('views.perfManage.taskManage.performanceSelect'),
|
||||
},
|
||||
],
|
||||
})
|
||||
@@ -345,37 +352,31 @@ function fnNeChange(_: any, item: any) {
|
||||
modalState.from.neType = item[1].neType;
|
||||
modalState.from.neId = item[1].neId;
|
||||
|
||||
modalState.from.interfaces = '';
|
||||
modalState.neTypeInterfaceSelect = [];
|
||||
modalState.neTypPerformanceList = [];
|
||||
|
||||
// 网元信令接口
|
||||
fnSelectInterfaceInit(item[1].neType);
|
||||
}
|
||||
|
||||
function fnPeriodsSelect(item: any, timeString: any) {
|
||||
console.log(item);
|
||||
console.log(timeString);
|
||||
|
||||
taskManageOption.timeSlotAll.push({
|
||||
label: timeString.join(','),
|
||||
value: item.join(','),
|
||||
});
|
||||
modalState.from.timeSlotAll.push(timeString.join(','));
|
||||
fnSelectPerformanceInit(item[1].neType);
|
||||
}
|
||||
|
||||
/**开始结束时间选择对应修改 */
|
||||
function fnRangePickerChange(_: any, item: any) {
|
||||
console.log(item);
|
||||
modalState.from.startTime = item[0];
|
||||
modalState.from.endTime = item[1];
|
||||
}
|
||||
|
||||
/**时间段的选择对应的修改 */
|
||||
function fnPeriodsSelect(item: any, timeString: any) {
|
||||
taskManageOption.timeSlotAll.push({
|
||||
label: timeString.join(','),
|
||||
value: item.join(','),
|
||||
});
|
||||
modalState.timeSlotAll.push(item.join(','));
|
||||
modalState.from.periods = modalState.timeSlotAll;
|
||||
}
|
||||
/**时间段选择后回调 */
|
||||
function fnChange(open: any) {
|
||||
console.log(open);
|
||||
if (!open) {
|
||||
modalState.from.periods.push(modalState.from.timeSlotAll);
|
||||
if (!open && queryRangePicker.value[0] && queryRangePicker.value[1]) {
|
||||
queryRangePicker.value = ['', ''];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -405,7 +406,7 @@ function fnSelectInterface(s: any, option: any) {
|
||||
}
|
||||
|
||||
/**性能测量数据集选择初始 */
|
||||
function fnSelectInterfaceInit(neType: string) {
|
||||
function fnSelectPerformanceInit(neType: string) {
|
||||
//console.logg(currentLocale.value); //当前语言
|
||||
const performance = useNeInfoStore().perMeasurementList.filter(
|
||||
i => i.neType === neType
|
||||
@@ -419,6 +420,8 @@ function fnSelectInterfaceInit(neType: string) {
|
||||
groups[kpiCode].push(rest);
|
||||
return groups;
|
||||
}, {});
|
||||
|
||||
//渲染出性能测量集的选择项
|
||||
modalState.neTypPerformance = Object.keys(groupedData).map(kpiCode => {
|
||||
return {
|
||||
label: kpiCode,
|
||||
@@ -437,34 +440,43 @@ function fnSelectInterfaceInit(neType: string) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 对话框弹出显示为 新增或者修改
|
||||
* 对话框弹出显示为 详情框
|
||||
* @param noticeId 网元id, 不传为新增
|
||||
*/
|
||||
function fnModalVisibleByVive(id: string) {
|
||||
if (modalState.confirmLoading) return;
|
||||
const hide = message.loading(t('common.loading'), 0);
|
||||
modalState.confirmLoading = true;
|
||||
getTraceTask(id).then(res => {
|
||||
getPerfTask(id).then(res => {
|
||||
modalState.confirmLoading = false;
|
||||
hide();
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
modalState.neType = [res.data.neType, res.data.neId];
|
||||
if (res.data.kpiSet.includes('[') && res.data.neIds.includes('[')) {
|
||||
modalState.neType = [res.data.neType, JSON.parse(res.data.neIds)[0]];
|
||||
modalState.neTypPerformanceList = JSON.parse(res.data.kpiSet).reduce(
|
||||
(acc: any, item: any) => acc.concat(item.KPIs),
|
||||
[]
|
||||
);
|
||||
}
|
||||
|
||||
if (res.data.periods.includes('[') && res.data.periods.length > 4) {
|
||||
const jsonArray = JSON.parse(res.data.periods);
|
||||
modalState.initPeriods = jsonArray.map(
|
||||
(item: any) => `${item.Start} - ${item.End}`
|
||||
);
|
||||
}
|
||||
|
||||
if (res.data.schedule.includes('[') && res.data.schedule.length > 4) {
|
||||
modalState.from.bigPlan = JSON.parse(res.data.schedule)[0].Type;
|
||||
modalState.from.smPlan = JSON.parse(res.data.schedule)[0].Days;
|
||||
}
|
||||
|
||||
modalState.timeRangePicker = [res.data.startTime, res.data.endTime];
|
||||
modalState.from = Object.assign(modalState.from, res.data);
|
||||
// 接口
|
||||
if (res.data.traceType === 'Interface') {
|
||||
if (
|
||||
res.data.interfaces.length > 4 &&
|
||||
res.data.interfaces.includes('[')
|
||||
) {
|
||||
modalState.neTypeInterfaceSelect = JSON.parse(res.data.interfaces);
|
||||
}
|
||||
fnSelectInterfaceInit(res.data.neType);
|
||||
}
|
||||
modalState.title = t('views.traceManage.task.viewTask');
|
||||
modalState.title = t('views.perfManage.taskManage.viewTask');
|
||||
modalState.visibleByView = true;
|
||||
} else {
|
||||
message.error(t('views.traceManage.task.errorTaskInfo'), 3);
|
||||
message.error(t('views.perfManage.taskManage.errorTaskInfo'), 3);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -476,33 +488,66 @@ function fnModalVisibleByVive(id: string) {
|
||||
function fnModalVisibleByEdit(id?: string) {
|
||||
if (!id) {
|
||||
modalStateFrom.resetFields();
|
||||
modalState.title = t('views.traceManage.task.addTask');
|
||||
modalState.title = t('views.perfManage.taskManage.addTask');
|
||||
modalState.visibleByEdit = true;
|
||||
} else {
|
||||
if (modalState.confirmLoading) return;
|
||||
const hide = message.loading(t('common.loading'), 0);
|
||||
modalState.confirmLoading = true;
|
||||
getTraceTask(id).then(res => {
|
||||
getPerfTask(id).then(res => {
|
||||
modalState.confirmLoading = false;
|
||||
hide();
|
||||
if (res.code === RESULT_CODE_SUCCESS && res.data) {
|
||||
modalState.neType = [res.data.neType, res.data.neId];
|
||||
modalState.periodsStep = parseInt(
|
||||
res.data.granulOption.substring(0, 2)
|
||||
);
|
||||
|
||||
if (res.data.kpiSet.includes('[') && res.data.neIds.includes('[')) {
|
||||
modalState.neType = [res.data.neType, JSON.parse(res.data.neIds)[0]];
|
||||
modalState.neTypPerformanceList = JSON.parse(res.data.kpiSet).reduce(
|
||||
(acc: any, item: any) => acc.concat(item.KPIs),
|
||||
[]
|
||||
);
|
||||
}
|
||||
|
||||
if (res.data.schedule.includes('[') && res.data.schedule.length > 4) {
|
||||
modalState.from.bigPlan = JSON.parse(res.data.schedule)[0].Type;
|
||||
modalState.from.smPlan = JSON.parse(res.data.schedule)[0].Days;
|
||||
}
|
||||
|
||||
modalState.timeRangePicker = [res.data.startTime, res.data.endTime];
|
||||
modalState.from = Object.assign(modalState.from, res.data);
|
||||
// 接口
|
||||
if (res.data.traceType === 'Interface') {
|
||||
if (
|
||||
res.data.interfaces.length > 4 &&
|
||||
res.data.interfaces.includes('[')
|
||||
) {
|
||||
modalState.neTypeInterfaceSelect = JSON.parse(res.data.interfaces);
|
||||
|
||||
if (res.data.periods.includes('[') && res.data.periods.length > 4) {
|
||||
const jsonArray = JSON.parse(res.data.periods);
|
||||
modalState.initPeriods = jsonArray.map(
|
||||
(item: any) => `${item.Start},${item.End}`
|
||||
);
|
||||
if (modalState.initPeriods.length) {
|
||||
modalState.timeSlotAll = [];
|
||||
taskManageOption.timeSlotAll = [];
|
||||
const updatedTimeRanges = modalState.initPeriods.map(
|
||||
(timeRange: any) => {
|
||||
const [startTime, endTime] = timeRange.split(',');
|
||||
const updatedStartTime = startTime.slice(0, -3);
|
||||
const updatedEndTime = endTime.slice(0, -3);
|
||||
taskManageOption.timeSlotAll.push({
|
||||
label: `${updatedStartTime},${updatedEndTime}`,
|
||||
value: timeRange,
|
||||
});
|
||||
return `${updatedStartTime},${updatedEndTime}`;
|
||||
}
|
||||
);
|
||||
|
||||
modalState.timeSlotAll.push(...modalState.initPeriods);
|
||||
modalState.initPeriods = [];
|
||||
modalState.from.periods = modalState.timeSlotAll;
|
||||
}
|
||||
fnSelectInterfaceInit(res.data.neType);
|
||||
}
|
||||
modalState.title = t('views.traceManage.task.editTask');
|
||||
modalState.title = t('views.perfManage.taskManage.editTask');
|
||||
modalState.visibleByEdit = true;
|
||||
} else {
|
||||
message.error(t('views.traceManage.task.errorTaskInfo'), 3);
|
||||
message.error(t('views.perfManage.taskManage.errorTaskInfo'), 3);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -514,47 +559,42 @@ function fnModalVisibleByEdit(id?: string) {
|
||||
*/
|
||||
function fnModalOk() {
|
||||
const from = toRaw(modalState.from);
|
||||
let valids = ['traceType', 'neId', 'endTime'];
|
||||
if (from.traceType === 'UE') {
|
||||
valids = valids.concat(['imsi', 'msisdn']);
|
||||
}
|
||||
if (from.traceType === 'Interface') {
|
||||
valids = valids.concat(['srcIp', 'dstIp', 'interfaces', 'signalPort']);
|
||||
}
|
||||
from.accountId = useUserStore().userName;
|
||||
modalStateFrom
|
||||
.validate(valids)
|
||||
.then(e => {
|
||||
modalState.confirmLoading = true;
|
||||
const traceTask = from.id ? updateTraceTask(from) : addTraceTask(from);
|
||||
const hide = message.loading(t('common.loading'), 0);
|
||||
traceTask
|
||||
.then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
message.success({
|
||||
content: t('common.msgSuccess', { msg: modalState.title }),
|
||||
duration: 3,
|
||||
});
|
||||
modalState.visibleByEdit = false;
|
||||
modalStateFrom.resetFields();
|
||||
} else {
|
||||
message.error({
|
||||
content: `${res.msg}`,
|
||||
duration: 3,
|
||||
});
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
hide();
|
||||
modalState.confirmLoading = false;
|
||||
fnGetList();
|
||||
console.log(from);
|
||||
modalState.confirmLoading = true;
|
||||
const perfTask = from.id ? updatePerfTask(from) : addPerfTask(from);
|
||||
const hide = message.loading(t('common.loading'), 0);
|
||||
perfTask
|
||||
.then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
message.success({
|
||||
content: t('common.msgSuccess', { msg: modalState.title }),
|
||||
duration: 3,
|
||||
});
|
||||
modalState.visibleByEdit = false;
|
||||
modalStateFrom.resetFields();
|
||||
} else {
|
||||
message.error({
|
||||
content: `${res.msg}`,
|
||||
duration: 3,
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch(e => {
|
||||
message.error(t('common.errorFields', { num: e.errorFields.length }), 3);
|
||||
.finally(() => {
|
||||
hide();
|
||||
modalState.confirmLoading = false;
|
||||
fnGetList();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 为时间段设置步长
|
||||
*/
|
||||
function updateStep(str: any) {
|
||||
modalState.from.periods = [];
|
||||
modalState.periodsStep = parseInt(str.substring(0, 2));
|
||||
}
|
||||
|
||||
/**
|
||||
* 对话框弹出关闭执行函数
|
||||
* 进行表达规则校验
|
||||
@@ -565,20 +605,106 @@ function fnModalCancel() {
|
||||
modalState.confirmLoading = false;
|
||||
modalStateFrom.resetFields();
|
||||
modalState.timeRangePicker = ['', ''];
|
||||
modalState.neTypeInterfaceSelect = [];
|
||||
modalState.neTypPerformanceList = [];
|
||||
|
||||
modalState.initPeriods = [];
|
||||
modalState.neType = [];
|
||||
modalState.neTypeInterface = [];
|
||||
modalState.timeSlotAll = [];
|
||||
}
|
||||
|
||||
/**
|
||||
* 激活任务
|
||||
* @param row 网元编号ID
|
||||
*/
|
||||
function fnRecordRun(row: Record<string, any>) {
|
||||
Modal.confirm({
|
||||
title: '提示',
|
||||
content: `确认激活编号为 【${row.id}】 的任务?`,
|
||||
onOk() {
|
||||
const key = 'taskRun';
|
||||
message.loading({ content: '请稍等...', key });
|
||||
taskRun(row).then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
message.success({
|
||||
content: `激活成功`,
|
||||
key,
|
||||
duration: 2,
|
||||
});
|
||||
} else {
|
||||
message.error({
|
||||
content: `${res.msg}`,
|
||||
key: key,
|
||||
duration: 2,
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 激活任务
|
||||
* @param row 网元编号ID
|
||||
*/
|
||||
function fnRecordStop(row: Record<string, any>) {
|
||||
Modal.confirm({
|
||||
title: '提示',
|
||||
content: `确认挂起编号为 【${row.id}】 的任务?`,
|
||||
onOk() {
|
||||
const key = 'taskStop';
|
||||
message.loading({ content: '请稍等...', key });
|
||||
taskStop(row).then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
message.success({
|
||||
content: `挂起成功`,
|
||||
key,
|
||||
duration: 2,
|
||||
});
|
||||
} else {
|
||||
message.error({
|
||||
content: `${res.msg}`,
|
||||
key: key,
|
||||
duration: 2,
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 记录多项选择
|
||||
*/
|
||||
function fnTaskModalVisible(type: string | number, row: Record<string, any>) {
|
||||
if (type === 'run') {
|
||||
if (row.status === 'Active') {
|
||||
var key = 'Active';
|
||||
message.error({
|
||||
content: `禁止激活已激活的任务`,
|
||||
key: key,
|
||||
duration: 2,
|
||||
});
|
||||
return false;
|
||||
}
|
||||
fnRecordRun(row);
|
||||
}
|
||||
|
||||
if (type === 'stop') {
|
||||
if (row.status === 'Inactive') {
|
||||
var key = 'stop';
|
||||
message.error({
|
||||
content: `禁止挂起未激活的测量任务`,
|
||||
key: key,
|
||||
duration: 2,
|
||||
});
|
||||
return false;
|
||||
}
|
||||
fnRecordStop(row);
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
// 初始字典数据
|
||||
Promise.allSettled([getDict('trace_type')]).then(resArr => {
|
||||
if (resArr[0].status === 'fulfilled') {
|
||||
dict.traceType = resArr[0].value;
|
||||
}
|
||||
});
|
||||
|
||||
Promise.allSettled([
|
||||
// 获取网元网元列表
|
||||
useNeInfoStore().fnNelist(),
|
||||
@@ -698,9 +824,6 @@ onMounted(() => {
|
||||
:scroll="{ x: true }"
|
||||
>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.key === 'traceType'">
|
||||
<DictTag :options="dict.traceType" :value="record.traceType" />
|
||||
</template>
|
||||
<template v-if="column.key === 'id'">
|
||||
<a-space :size="8" align="center">
|
||||
<a-tooltip>
|
||||
@@ -717,19 +840,42 @@ onMounted(() => {
|
||||
<a-button
|
||||
type="link"
|
||||
@click.prevent="fnModalVisibleByEdit(record.id)"
|
||||
:disabled="record.status === 'Active'"
|
||||
>
|
||||
<template #icon><FormOutlined /></template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
<a-tooltip>
|
||||
<template #title>{{ t('common.deleteText') }}</template>
|
||||
<a-button
|
||||
type="link"
|
||||
@click.prevent="fnRecordDelete(record.id)"
|
||||
>
|
||||
<a-button type="link" @click.prevent="fnRecordDelete(record)">
|
||||
<template #icon><DeleteOutlined /></template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
<a-tooltip>
|
||||
<template #title>{{ t('common.moreText') }}</template>
|
||||
<a-dropdown
|
||||
placement="bottomRight"
|
||||
:trigger="['hover', 'click']"
|
||||
>
|
||||
<a-button type="link">
|
||||
<template #icon><EllipsisOutlined /> </template>
|
||||
</a-button>
|
||||
<template #overlay>
|
||||
<a-menu
|
||||
@click="({ key }:any) => fnTaskModalVisible(key, record)"
|
||||
>
|
||||
<a-menu-item key="run">
|
||||
<ThunderboltOutlined />
|
||||
{{ t('views.configManage.softwareManage.runBtn') }}
|
||||
</a-menu-item>
|
||||
<a-menu-item key="stop">
|
||||
<UndoOutlined />
|
||||
{{ t('views.perfManage.taskManage.stopTask') }}
|
||||
</a-menu-item>
|
||||
</a-menu>
|
||||
</template>
|
||||
</a-dropdown>
|
||||
</a-tooltip>
|
||||
</a-space>
|
||||
</template>
|
||||
</template>
|
||||
@@ -745,17 +891,6 @@ onMounted(() => {
|
||||
>
|
||||
<a-form layout="horizontal">
|
||||
<a-row :gutter="16">
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
:label="t('views.traceManage.task.trackType')"
|
||||
name="traceType"
|
||||
>
|
||||
<DictTag
|
||||
:options="dict.traceType"
|
||||
:value="modalState.from.traceType"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
:label="t('views.traceManage.task.neType')"
|
||||
@@ -770,53 +905,6 @@ onMounted(() => {
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
<!-- 用户跟踪 -->
|
||||
<template v-if="modalState.from.traceType === 'UE'">
|
||||
<a-form-item
|
||||
:label="t('views.traceManage.task.msisdn')"
|
||||
name="msisdn"
|
||||
>
|
||||
{{ modalState.from.msisdn }}
|
||||
</a-form-item>
|
||||
<a-form-item :label="t('views.traceManage.task.imsi')" name="imsi">
|
||||
{{ modalState.from.imsi }}
|
||||
</a-form-item>
|
||||
</template>
|
||||
|
||||
<!-- 接口跟踪 -->
|
||||
<template v-if="modalState.from.traceType === 'Interface'">
|
||||
<a-row :gutter="16">
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
:label="t('views.traceManage.task.srcIp')"
|
||||
name="srcIp"
|
||||
>
|
||||
{{ modalState.from.srcIp }}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
:label="t('views.traceManage.task.dstIp')"
|
||||
name="dstIp"
|
||||
>
|
||||
{{ modalState.from.dstIp }}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-form-item
|
||||
:label="t('views.traceManage.task.interfaces')"
|
||||
name="endTime"
|
||||
>
|
||||
{{ modalState.neTypeInterfaceSelect }}
|
||||
</a-form-item>
|
||||
<a-form-item
|
||||
:label="t('views.traceManage.task.signalPort')"
|
||||
name="endTime"
|
||||
>
|
||||
{{ modalState.from.signalPort }}
|
||||
</a-form-item>
|
||||
</template>
|
||||
|
||||
<a-form-item
|
||||
:label="t('views.traceManage.task.rangePicker')"
|
||||
name="endTime"
|
||||
@@ -832,6 +920,64 @@ onMounted(() => {
|
||||
style="width: 100%"
|
||||
></a-range-picker>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item
|
||||
:label="t('views.perfManage.taskManage.performanceList')"
|
||||
name="performanceArr"
|
||||
>
|
||||
{{ modalState.neTypPerformanceList }}
|
||||
</a-form-item>
|
||||
|
||||
<a-row :gutter="16">
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
name="granulOption"
|
||||
:label="t('views.perfManage.taskManage.granulOption')"
|
||||
>
|
||||
<a-select
|
||||
v-model:value="modalState.from.granulOption"
|
||||
:options="taskManageOption.granulOption"
|
||||
disabled
|
||||
>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
<a-form-item
|
||||
:label="t('views.perfManage.taskManage.period')"
|
||||
name="performanceArr"
|
||||
>
|
||||
{{ modalState.initPeriods }}
|
||||
</a-form-item>
|
||||
|
||||
<a-row :gutter="16">
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
:label="t('views.perfManage.taskManage.plan')"
|
||||
name="bigPlan"
|
||||
>
|
||||
<a-select
|
||||
v-model:value="modalState.from.bigPlan"
|
||||
:options="taskManageOption.bigPlan"
|
||||
disabled
|
||||
>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item name="smPlan">
|
||||
<a-select
|
||||
v-model:value="modalState.from.smPlan"
|
||||
mode="multiple"
|
||||
:options="taskManageOption.smPlan[modalState.from.bigPlan as 'Weekly' | 'Monthly']"
|
||||
disabled
|
||||
>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
<a-form-item
|
||||
:label="t('views.traceManage.task.comment')"
|
||||
name="comment"
|
||||
@@ -877,10 +1023,10 @@ onMounted(() => {
|
||||
</a-row>
|
||||
|
||||
<a-form-item
|
||||
:label="t('views.traceManage.task.interfaces')"
|
||||
name="interfaces"
|
||||
v-bind="modalStateFrom.validateInfos.interfaces"
|
||||
:label="t('views.perfManage.taskManage.performanceList')"
|
||||
name="performanceArr"
|
||||
v-show="modalState.neType.length !== 0"
|
||||
v-bind="modalStateFrom.validateInfos.performanceArr"
|
||||
>
|
||||
<a-select
|
||||
mode="multiple"
|
||||
@@ -923,6 +1069,7 @@ onMounted(() => {
|
||||
<a-select
|
||||
v-model:value="modalState.from.granulOption"
|
||||
:options="taskManageOption.granulOption"
|
||||
@change="updateStep"
|
||||
>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
@@ -930,9 +1077,8 @@ onMounted(() => {
|
||||
</a-row>
|
||||
|
||||
<a-form-item
|
||||
:label="t('views.traceManage.task.interfaces')"
|
||||
name="interfaces"
|
||||
v-bind="modalStateFrom.validateInfos.interfaces"
|
||||
:label="t('views.perfManage.taskManage.period')"
|
||||
name="period"
|
||||
v-if="
|
||||
modalState.from.granulOption &&
|
||||
modalState.from.granulOption !== '24H'
|
||||
@@ -949,10 +1095,38 @@ onMounted(() => {
|
||||
<a-time-range-picker
|
||||
format="HH:mm"
|
||||
value-format="HH:MM:00"
|
||||
v-model:value="queryRangePicker"
|
||||
@change="fnPeriodsSelect"
|
||||
@open-change="fnChange"
|
||||
:minute-step="modalState.periodsStep"
|
||||
/>
|
||||
</a-form-item>
|
||||
|
||||
<a-row :gutter="16">
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
:label="t('views.perfManage.taskManage.plan')"
|
||||
name="bigPlan"
|
||||
>
|
||||
<a-select
|
||||
v-model:value="modalState.from.bigPlan"
|
||||
:options="taskManageOption.bigPlan"
|
||||
>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item name="smPlan" v-show="modalState.from.bigPlan">
|
||||
<a-select
|
||||
v-model:value="modalState.from.smPlan"
|
||||
mode="multiple"
|
||||
:options="taskManageOption.smPlan[modalState.from.bigPlan as 'Weekly' | 'Monthly']"
|
||||
>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
<a-form-item
|
||||
:label="t('views.traceManage.task.comment')"
|
||||
name="comment"
|
||||
|
||||
Reference in New Issue
Block a user