- {{ city.name }}
- {{city.towName}}
+ {{ city.metricKey }}
+ {{city.metricName}}
- 采集周期: handleCheckedCitiesChange(changeVal, item)">
+ 采集周期: handleCheckedCitiesChange(changeVal, item)">
@@ -116,7 +116,7 @@
{{item.title}}
- 采集周期: handleCheckedCitiesChange(changeVal, item)">
+ 采集周期: handleCheckedCitiesChange(changeVal, item)">
@@ -124,8 +124,8 @@
- {{city.name}}
- {{city.towName}}
+ {{city.metricKey}}
+ {{city.metricName}}
@@ -137,7 +137,7 @@
-
@@ -153,114 +153,241 @@
import Form from '@/components/form/index.vue';
import TableList from "@/components/table/index.vue"
import MonitorStategyView from './view'
+ import {addMonitorPolicy, updateMonitorPolicy,getMonitorTemp, getMonitorPolicy, getMonitorPolicyTemp, getResMonitorGroup} from "@/api/disRevenue/resource"
export default {
name: 'MonitorStategyDetails',
components: {Form, TableList, MonitorStategyView},
+ dicts: ['collection_cycle'],
data() {
return {
active: 0,
- activeNames: [0, 1],
+ activeNames: [0, 1,2,3,4],
linuxActiveName: 'first',
hwActiveName: 'first',
+ resourceType: '',
checkAllParams: {},
checkParams: {week: '',cpu: [], other: [], mount: [], netPort:[]},
allSelectedData: {},
synthesisList: {},
+ tempContent: {},
// 第一节点
- ruleFormData: {
- monitorTemp: 1,
- },
+ ruleFormData: {},
config: {
buttonGroup: []
},
- formList: [{
- config: {title: ''},
- controls: {
- id: {label: 'ID',hidden: true},
- switchName: {label: '策略名称', span: 12, type: 'input', style: 'display: block;margin: 0 auto;', rules: [{required: true, message: '请输入模版名称', trigger: 'blur'}]},
- serverPort: {label: '描述', span: 12, type: 'textarea', style: 'display: block;margin: 0 auto;'},
- monitorTemp: {label: '关联监控模版', span: 12, type: 'select', style: 'display: block;margin: 0 auto;'},
- resourceGroup: {label: '关联资源组', span: 12, type: 'select'}
- }
- }],
+ policyTemp: {},
+ formList: [],
+ paramsList: [],
// 第二节点 1栏
- option: [{label: '60min', value: '60'},{label: '15min', value: '15'}],
+ option: [],
linuxSystem: {
- monitorList: [{
+ monitorItem: [{
firstTitle: 'Linux系统', secondTitle: '监控项', title: 'CPU监控', modelName: 'cpu',time: '',
- checkList: [
- {id: '1', name: 'system.cpu.load.avg1', towName: 'CPU的1分钟负载'},
- {id: '2', name: 'system.cpu.util.normal', towName: 'CPU正常运行时间'},
- {id: '3', name: 'system.cpu.load.avg5', towName: 'CPU的5分钟负载'},
- {id: '4', name: 'system.cpu.utilee.idle', towName: 'CPU空闲时间'},
- {id: '5', name: 'system.cpu.load.avg15', towName: 'CPU的15分钟负载'},
- ]
+ checkList: []
},{
firstTitle: 'Linux系统', secondTitle: '监控项', title: '其他监控', modelName: 'other',
- checkList: [
- {id: '6', name: 'system.swap.size.free', towName: '交换卷/文件的可用空间(字节)',time: ''},
- {id: '7', name: 'proc.num.run', towName: '正在运行的进程数',time: ''},
- {id: '8', name: 'memory.utilization', towName: '内存利用率',time: ''},
- {id: '9', name: 'system.users.num', towName: '登录用户数',time: ''},
- {id: '10', name: 'system.swap.size.percent', towName: '可用交换空间百分比',time: ''},
- ]
- }],
- autoFindList: [{
- firstTitle: 'Linux系统', secondTitle: '自动发现项', title: '发现挂载文件系统', modelName: 'mount', time: '',
- checkList: [
- {id: '1', name: 'vfs.fs.type', towName: '某个挂载点(如/)的文件系统类型'},
- {id: '2', name: 'vfs.fs.size.free', towName: '某个挂载点(如/)的可用空间'},
- {id: '3', name: 'vfs.fs.size.total', towName: '某个挂载点(如/)的总空间'},
- {id: '4', name: 'vfs.fs.util', towName: '某个挂载点(如/)的空间利用率'},
- ]},{
- firstTitle: 'Linux系统', secondTitle: '自动发现项', title: '发现网络接口', modelName: 'netPort', time: '',
- checkList: [
- {id: '1', name: 'net.if.in.dropped', towName: '某个网络接口(如interface eth0)的入站丢包'},
- {id: '2', name: 'net.if.out.dropped', towName: '某个网络接口(如interface eth0)的出站丢包'},
- {id: '3', name: 'net.if.out', towName: '某个网络接口(如interface eth0)的发送流量'},
- {id: '4', name: 'net.if.out.type', towName: '某个网络接口(如interface eth0)的接口类型'},
- {id: '5', name: 'net.if.in', towName: '某个网络接口(如interface eth0)的接收流量'}
- ]
+ checkList: []
}],
+ autodiscoverItem: [{
+ firstTitle: 'Linux系统', secondTitle: '自动发现项', title: '发现挂载文件系统', modelName: 'vfs', time: '',
+ checkList: []
+ },{
+ firstTitle: 'Linux系统', secondTitle: '自动发现项', title: '发现网络接口', modelName: 'net', time: '300',
+ checkList: []
+ },{
+ firstTitle: 'Linux系统', secondTitle: '自动发现项', title: '发现硬盘设备', modelName: 'disk', time: '',
+ checkList: []
+ }, {
+ firstTitle: 'Linux系统', secondTitle: '自动发现项', title: '发现docker', modelName: 'docker', time: '',
+ checkList: []
+ }],
},
// 第二节点 2栏 列显隐信息
monitorTable: {
- nodeOne: [{
- firstTitle: '华为交换机', secondTitle: '监控项', modelName: 'other',
- checkList: [
- {id: '1', name: 'net.if.in.dropped', towName: '某个网络接口(如interface eth0)的入站丢包',time: ''},
- {id: '2', name: 'net.if.out.dropped', towName: '某个网络接口(如interface eth0)的出站丢包',time: ''},
- {id: '3', name: 'net.if.out', towName: '某个网络接口(如interface eth0)的发送流量',time: ''},
- {id: '4', name: 'net.if.out.type', towName: '某个网络接口(如interface eth0)的接口类型',time: ''},
- {id: '5', name: 'net.if.in', towName: '某个网络接口(如interface eth0)的接收流量',time: ''}
- ]
- }],
+ nodeOne: [{firstTitle: '华为交换机', secondTitle: '监控项', modelName: 'other', checkList: []}],
nodeTow: [
- {
- firstTitle: '华为交换机', secondTitle: '自动发现项', title: '网络端口发现', modelName: 'server', time: '',
- checkList: [
- {id: '1', name: 'vfs.fs.type', towName: '某个挂载点(如/)的文件系统类型'},
- {id: '2', name: 'vfs.fs.size.free', towName: '某个挂载点(如/)的可用空间'},
- {id: '3', name: 'vfs.fs.size.total', towName: '某个挂载点(如/)的总空间'},
- {id: '4', name: 'vfs.fs.util', towName: '某个挂载点(如/)的空间利用率'},
- ]
- },
- {
- firstTitle: '华为交换机', secondTitle: '自动发现项',title: '光模块发现', modelName: 'light', time: '',
- checkList: [
- {id: '6', name: 'system.swap.size.free', towName: '交换卷/文件的可用空间(字节)'},
- {id: '7', name: 'proc.num.run', towName: '正在运行的进程数'},
- {id: '8', name: 'memory.utilization', towName: '内存利用率'},
- {id: '9', name: 'system.users.num', towName: '登录用户数'},
- {id: '10', name: 'system.swap.size.percent', towName: '可用交换空间百分比'},
- ]
- },
+ {firstTitle: '华为交换机', secondTitle: '自动发现项', title: '网络端口发现', modelName: 'switchNet', time: '300', checkList: []},
+ {firstTitle: '华为交换机', secondTitle: '自动发现项',title: '光模块发现', modelName: 'switchModule', time: '', checkList: []},
+ {firstTitle: '华为交换机', secondTitle: '自动发现项',title: 'MPU发现', modelName: 'switchMpu', time: '', checkList: []},
+ {firstTitle: '华为交换机', secondTitle: '自动发现项',title: '电源发现', modelName: 'switchPwr', time: '', checkList: []},
+ {firstTitle: '华为交换机', secondTitle: '自动发现项',title: '风扇发现', modelName: 'switchFan', time: '', checkList: []},
]},
}
},
- created() {},
+ created() {
+ this.option = this.dict.type.collection_cycle;
+ this.paramsData = this.$route && this.$route.query;
+ // console.log('paramsData===',this.paramsData);
+ if (this.paramsData && this.paramsData.id) {
+ this.getFormDataList(this.paramsData.id);
+ }
+ this.fnFormList();
+ this.fnResMonitorGroup();
+ this.fnMonitorPolicyTemp();
+ },
methods: {
+ fnFormList(){
+ this.formList = [{
+ config: {title: ''},
+ controls: {
+ id: {label: 'ID',hidden: true},
+ policyName: {label: '策略名称', span: 12, type: 'input', style: 'display: block;margin: 0 auto;', required: true},
+ description: {label: '描述', span: 12, type: 'textarea', style: 'display: block;margin: 0 auto;'},
+ templateId: {label: '关联监控模版', span: 12, type: 'select', required: true, options: [], eventName: 'change', style: 'display: block;margin: 0 auto;'},
+ resourceGroupId: {label: '关联资源组', span: 12, type: 'select', required: true, options:[]}
+ }
+ }];
+ },
+ // 资源组
+ fnResMonitorGroup(){
+ getResMonitorGroup().then(res => {
+ if (res && res.data) {
+ this.formList[0].controls['resourceGroupId']['options']= res && res.data.map(item => {
+ return Object.assign({label: item.groupName, value: item.id});
+ });
+ }
+ });
+ },
+ // 监控模版
+ fnMonitorPolicyTemp(){
+ getMonitorPolicyTemp().then(res => {
+ if (res && res.data) {
+ this.policyTemp = {};
+ this.formList[0].controls['templateId']['options']= res && res.data.map(item => {
+ this.policyTemp[item.id] = item;
+ return Object.assign({label: item.templateName, value: item.id});
+ });
+ }
+ });
+ },
+ // 获取详情
+ getFormDataList(id) {
+ this.tempContent = {};
+ getMonitorPolicy(id).then(val => {
+ console.log('val===',val);
+ if (val && val.data) {
+ // this.activeTypeName = val.data.template.resourcyType;
+ this.ruleFormData = val.data.policy;
+ this.resourceType = val.data.resourceType;
+ this.tempContent[val.data.resourceType] = val.data[val.data.resourceType];
+ console.log('tempContent====',this.tempContent);
+ }
+ }).catch(() => {
+ // this.$modal.msgError("操作失败")
+ });
+ },
+ // 通过监控模版选项 查询监控策略展示项
+ fnGetMonitorTempList(id) {
+ getMonitorTemp(id).then(res => {
+ console.log('res===',res);
+ if (res && res.data) {
+ if (this.resourceType === 'linux') {
+ // cpu 详情
+ this.linuxSystem.monitorItem[0].checkList = res.data && res.data['linux'] && res.data['linux'].cpu || [];
+ if (this.tempContent['linux'] && this.tempContent['linux'].cpu && this.tempContent['linux'].cpu.length > 0) {
+ if (this.tempContent['linux'].cpu[0] && this.tempContent['linux'].cpu[0].collectionCycle) {
+ this.linuxSystem.monitorItem[0].time = this.tempContent['linux'].cpu[0].collectionCycle.toString();
+ this.handleCheckedCitiesChange(this.linuxSystem.monitorItem[0].time, this.linuxSystem.monitorItem[0]);
+ }
+ }
+ // other
+ if (this.tempContent['linux'] && this.tempContent['linux'].other && this.tempContent['linux'].other.length > 0) {
+ this.tempContent['linux'].other.forEach(item => {
+ if (item && item.collectionCycle) {
+ item.time = item.collectionCycle.toString();
+ }
+ });
+ this.linuxSystem.monitorItem[1].checkList = this.tempContent['linux'].other;
+ } else {
+ this.linuxSystem.monitorItem[1].checkList = res.data && res.data['linux'] && res.data['linux'].other || [];
+ }
+ // 自动发现项
+ let linuxArr = [];
+ // 1
+ if (res.data && res.data['linux'] && res.data['linux'].vfs && res.data['linux'].vfs.length > 0) {
+ this.linuxSystem.autodiscoverItem[0].checkList = res.data && res.data['linux'] && res.data['linux'].vfs;
+ // 详情
+ if (this.tempContent['linux'] && this.tempContent['linux'].vfs && this.tempContent['linux'].vfs.length > 0) {
+ if (this.tempContent['linux'].vfs[0] && this.tempContent['linux'].vfs[0].collectionCycle) {
+ this.linuxSystem.autodiscoverItem[0].time = this.tempContent['linux'].vfs[0].collectionCycle.toString();
+ this.handleCheckedCitiesChange(this.linuxSystem.autodiscoverItem[0].time, this.linuxSystem.autodiscoverItem[0]);
+ }
+ }
+ linuxArr.push(this.linuxSystem.autodiscoverItem[0]);
+ }
+ // 2
+ if (res.data && res.data['linux'] && res.data['linux'].net && res.data['linux'].net.length > 0) {
+ this.linuxSystem.autodiscoverItem[1].checkList = res.data && res.data['linux'] && res.data['linux'].net;
+ linuxArr.push(this.linuxSystem.autodiscoverItem[1]);
+ // 带有默认时间的情况下,调用指定方法进行存储
+ if (this.linuxSystem.autodiscoverItem[1].time) {
+ this.handleCheckedCitiesChange(this.linuxSystem.autodiscoverItem[1].time, this.linuxSystem.autodiscoverItem[1]);
+ }
+ }
+ // 3
+ if (res.data && res.data['linux'] && res.data['linux'].disk && res.data['linux'].disk.length > 0) {
+ this.linuxSystem.autodiscoverItem[2].checkList = res.data && res.data['linux'] && res.data['linux'].disk;
+ if (this.tempContent['linux'] && this.tempContent['linux'].disk && this.tempContent['linux'].disk.length > 0) {
+ if (this.tempContent['linux'].disk[0] && this.tempContent['linux'].disk[0].collectionCycle) {
+ this.linuxSystem.autodiscoverItem[2].time = this.tempContent['linux'].disk[0].collectionCycle.toString();
+ this.handleCheckedCitiesChange(this.linuxSystem.autodiscoverItem[2].time, this.linuxSystem.autodiscoverItem[2]);
+ }
+ }
+ linuxArr.push(this.linuxSystem.autodiscoverItem[2]);
+ }
+ // 4
+ if (res.data && res.data['linux'] && res.data['linux'].docker && res.data['linux'].docker.length > 0) {
+ this.linuxSystem.autodiscoverItem[3].checkList = res.data && res.data['linux'] && res.data['linux'].docker;
+ if (this.tempContent['linux'] && this.tempContent['linux'].docker && this.tempContent['linux'].docker.length > 0) {
+ if (this.tempContent['linux'].docker[0] && this.tempContent['linux'].docker[0].collectionCycle) {
+ this.linuxSystem.autodiscoverItem[3].time = this.tempContent['linux'].docker[0].collectionCycle.toString();
+ this.handleCheckedCitiesChange(this.linuxSystem.autodiscoverItem[3].time, this.linuxSystem.autodiscoverItem[3]);
+ }
+ }
+ linuxArr.push(this.linuxSystem.autodiscoverItem[3]);
+ }
+ this.linuxSystem.autodiscoverItem = linuxArr;
+ } else {
+ // one
+ if (res.data && res.data['switch'] && res.data['switch'].switchOther && res.data['switch'].switchOther.length > 0) {
+ this.monitorTable.nodeOne[0].checkList = res.data && res.data['switch'] && res.data['switch'].switchOther;
+ }
+ let newArr = [];
+ // tow-1
+ if (res.data && res.data['switch'] && res.data['switch'].switchNet && res.data['switch'].switchNet.length > 0) {
+ this.monitorTable.nodeTow[0].checkList = res.data && res.data['switch'] && res.data['switch'].switchNet;
+ newArr.push(this.monitorTable.nodeTow[0]);
+ if (this.monitorTable.nodeTow[0].time) {
+ this.handleCheckedCitiesChange(this.monitorTable.nodeTow[0].time, this.monitorTable.nodeTow[0]);
+ }
+ }
+ // tow-2
+ if (res.data && res.data['switch'] && res.data['switch'].switchModule && res.data['switch'].switchModule.length > 0) {
+ this.monitorTable.nodeTow[1].checkList = res.data && res.data['switch'] && res.data['switch'].switchModule;
+ newArr.push(this.monitorTable.nodeTow[1]);
+ }
+ // tow-3
+ if (res.data && res.data['switch'] && res.data['switch'].switchMpu && res.data['switch'].switchMpu.length > 0) {
+ this.monitorTable.nodeTow[2].checkList = res.data && res.data['switch'] && res.data['switch'].switchMpu;
+ newArr.push(this.monitorTable.nodeTow[2]);
+ }
+ // tow-4
+ if (res.data && res.data['switch'] && res.data['switch'].switchPwr && res.data['switch'].switchPwr.length > 0) {
+ this.monitorTable.nodeTow[3].checkList = res.data && res.data['switch'] && res.data['switch'].switchPwr;
+ newArr.push(this.monitorTable.nodeTow[3]);
+ }
+ // tow-5
+ if (res.data && res.data['switch'] && res.data['switch'].switchNet && res.data['switch'].switchNet.length > 0) {
+ this.monitorTable.nodeTow[4].checkList = res.data && res.data['switch'] && res.data['switch'].switchFan;
+ newArr.push(this.monitorTable.nodeTow[4]);
+ }
+ this.monitorTable.nodeTow = newArr;
+ }
+ }
+ });
+ },
async next(num) {
+ console.log('num==',num,'active====',this.active);
if (num === '-1') {
this.active--;
} else {
@@ -269,6 +396,7 @@
return;
} else {
this.dataProcess();
+ this.fnGetMonitorTempList(this.ruleFormData.templateId);
}
}
if (this.active === 1) {
@@ -280,7 +408,7 @@
// 数据处理
dataProcess() {
let typeVal = {};
- if (this.ruleFormData && this.ruleFormData['monitorTemp'] === 1) {
+ if (this.resourceType === 'linux') {
typeVal = this.linuxSystem;
} else {
typeVal = this.monitorTable;
@@ -315,39 +443,66 @@
},
// 点击下一步,获取多个table列表中所选中的行数据
selectAllChange () {
- // this.allSelectedData = {};
- // Object.keys(this.monitorTable).forEach(res => {
- // this.monitorTable[res].forEach(item => {
- // // 获取子组件的ref(格式:tableRef_${tableKey})
- // const tableRef = this.$refs[`tableRef_${item.config.tableKey}`];
- // if (tableRef && tableRef.length && tableRef[0].ids.length) {
- // // 调用子组件的方法获取选中数据
- // const selectedData = tableRef[0].getSelectedData();
- // // firstTitle: '华为交换机', secondTitle: '监控项',
- // selectedData['firstTitle'] = item.firstTitle;
- // selectedData['secondTitle'] = item.secondTitle;
- // selectedData['lastTitle'] = item.title;
- // this.allSelectedData[selectedData.tableKey] = selectedData;
- // }
- // });
- // });
- this.lastStepView();
- },
- // 最后一步展示
- lastStepView() {
+ let obj = {};
+ this.option.forEach(item => {
+ obj[item.value] = item.label;
+ });
+ this.paramsList = [];
+ Object.keys(this.checkAllParams).forEach(item => {
+ if (this.checkAllParams[item].data && this.checkAllParams[item].data.length > 0) {
+ if (this.checkAllParams[item].time) {
+ this.checkAllParams[item]['timeLabel'] = obj[this.checkAllParams[item].time];
+ // 摘取数据 {id: '', collectionCycle: ''}
+ this.checkAllParams[item].data.forEach(val => {
+ this.paramsList.push({id: val.id,collectionCycle: this.checkAllParams[item].time});
+ });
+ } else {
+ let lastTimeList = [];
+ this.checkAllParams[item].data.forEach(val => {
+ if (val && val.time) {
+ val['timeLabel'] = obj[val.time];
+ lastTimeList.push(val);
+ this.paramsList.push({id: val.id,collectionCycle: val.time});
+ }
+ });
+ this.checkAllParams[item].data = lastTimeList;
+ }
+ }
+ });
+ console.log('params===',this.paramsList);
this.synthesisList = Object.assign({}, this.checkAllParams);
},
// 单个选择按钮
handleCheckedCitiesChange(changeVal,iteListAll) {
- if (iteListAll && iteListAll.time) {
- this.checkAllParams[iteListAll.modelName].time = iteListAll && iteListAll.time;
+ console.log('changeVal==',changeVal, 'iteListAll===',iteListAll, 'cvvvv===','time' in iteListAll);
+ if ('time' in iteListAll) {
+ if (changeVal) {
+ this.checkAllParams[iteListAll.modelName].time = iteListAll && iteListAll.time;
+ } else {
+ delete this.checkAllParams[iteListAll.modelName];
+ }
+ } else {
+ this.checkAllParams[iteListAll.modelName].data = iteListAll['checkList'];
}
- this.checkAllParams[iteListAll.modelName].data = iteListAll['checkList'];
},
// 提交
submit() {
console.log('ruleFormData==',this.ruleFormData);
console.log('synthesisList==',this.synthesisList);
+ let params = Object.assign({resourceType: this.resourceType}, {collectionAndIdList: this.paramsList}, this.ruleFormData);
+ let fnType = addMonitorPolicy;
+ if (this.paramsData && this.paramsData.id) {
+ fnType = updateMonitorPolicy;
+ }
+ this.$modal.loading();
+ fnType(params).then(response => {
+ this.$modal.msgSuccess(response.msg);
+ this.$router.push("/resource/monitorStategy");
+ this.$modal.closeLoading();
+ }).catch(error => {
+ this.$modal.closeLoading();
+ this.$modal.msgError("操作失败")
+ });
},
// 返回
goBack() {
@@ -357,8 +512,10 @@
callback(result, dataVal, formVal) {
if (result && result.fnCode) {
switch (result.fnCode) {
- case 'submit':
- console.log('dataVal===',dataVal);
+ case 'templateId':
+ if (dataVal) {
+ this.resourceType = this.policyTemp[dataVal].resourceType;
+ }
break;
default:
}
@@ -374,4 +531,7 @@
padding-left: 20px;
font-size: 1rem;
}
+ ::v-deep #selDisabled{
+ color: #303133!important;
+ }
diff --git a/src/views/disRevenue/resource/monitorStategy/index.vue b/src/views/disRevenue/resource/monitorStategy/index.vue
index a5c707e..ee80246 100644
--- a/src/views/disRevenue/resource/monitorStategy/index.vue
+++ b/src/views/disRevenue/resource/monitorStategy/index.vue
@@ -12,9 +12,9 @@
-
+
import TableList from "@/components/table/index.vue"
- import {listMonitorTemp, delMonitorTemp} from "@/api/disRevenue/resource"
+ import {listMonitorPolicy, delMonitorPolicy} from "@/api/disRevenue/resource"
export default {
name: 'MonitorStategy',
components: {TableList},
@@ -60,14 +60,14 @@
// 列显隐信息
columns: {
id: { label: `ID`,width: '50'},
- switchName: { label: `策略名称`, minWidth: '250', visible: true },
- switchSn: { label: `描述`,minWidth: '200',visible: false},
- interfaceName: { label: `关联资源组`,minWidth: '150', visible: true },
- serverName: { label: `包含设备`,minWidth: '200'},
- connectedDeviceType: { label: `关联监控模版`,minWidth: '150', visible: true },
+ policyName: { label: `策略名称`, minWidth: '250', visible: true },
+ description: { label: `描述`,minWidth: '200',visible: false},
+ resourceGroupId: { label: `关联资源组`,minWidth: '150', visible: true },
+ includedDevicesName: { label: `包含设备`,minWidth: '200'},
+ templateId: { label: `关联监控模版`,minWidth: '150', visible: true },
connected: { label: `策略内容`,minWidth: '200'},
- type: { label: `策略状态`, minWidth: '100', visible: true },
- conType: { label: `下发策略时间`,minWidth: '160'},
+ status: { label: `策略状态`, minWidth: '100', visible: true },
+ deployTime: { label: `下发策略时间`,minWidth: '160'},
createTime: { label: `创建时间`,minWidth: '160'},
updateTime:{ label: `修改时间`,minWidth: '160'}
},
@@ -84,8 +84,9 @@
line: [
{content: '修改', fnCode: 'edit', type: 'text', icon: 'el-icon-edit', hasPermi: 'disRevenue:resource:monitorStategy:edit'},
{content: '详情', fnCode: 'details', type: 'text', icon: 'el-icon-view', hasPermi: 'disRevenue:resource:monitorStategy:details'},
- {content: '复制', fnCode: 'copy', type: 'text', icon: 'el-icon-document-copy', hasPermi: 'disRevenue:resource:monitorStategy:copy'},
+ // {content: '复制', fnCode: 'copy', type: 'text', icon: 'el-icon-document-copy', hasPermi: 'disRevenue:resource:monitorStategy:copy'},
{content: '下发策略', fnCode: 'strategy', type: 'text', icon: 'el-icon-sort-down', hasPermi: 'disRevenue:resource:monitorStategy:strategy'},
+ {}
]
}
}
@@ -94,14 +95,21 @@
created() {
this.getList();
},
+ activated() {
+ this.$nextTick(() => {
+ this.getList();
+ });
+ },
methods: {
/** 查询列表 */
getList() {
- this.loading = true;
- listMonitorTemp(this.queryParams).then(response => {
+ this.$modal.loading();
+ listMonitorPolicy(this.queryParams).then(response => {
this.tableList = response.rows;
this.queryParams.total = response.total;
- this.loading = false;
+ this.$modal.closeLoading();
+ }).catch(err => {
+ this.$modal.closeLoading();
})
},
// 处理子组件传递的新值
@@ -122,7 +130,7 @@
this.handleQuery();
},
- callback(result, rowData, selectChange) {
+ callback(result, rowData, selectChange, selectList) {
if (result && result.fnCode) {
switch (result.fnCode) {
case 'add':
@@ -146,8 +154,12 @@
});
break;
case 'delete':
+ if (selectList && selectList.length <= 0) {
+ this.$modal.msgWarning("请选择数据!");
+ return;
+ }
this.$modal.confirm('是否确认删除数据项?').then(function() {
- return delMonitorTemp(selectChange)
+ return delMonitorPolicy(selectChange)
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功")
@@ -162,7 +174,7 @@
// });
// this.download("/system/monitorStategy/export", {properties: dataList,}, `拓扑管理_${new Date().getTime()}.xlsx`);
let paramsList = Object.assign({}, this.queryParams,rowData);
- this.download("system/monitorStategy/export", paramsList, `资源监控策略_${new Date().getTime()}.xlsx`, null, 'json');
+ this.download("rocketmq/monitorPolicy/export", paramsList, `资源监控策略_${new Date().getTime()}.xlsx`, null, 'json');
break;
default:
}
diff --git a/src/views/disRevenue/resource/monitorStategy/view.vue b/src/views/disRevenue/resource/monitorStategy/view.vue
index bfd0e6b..1dc1b50 100644
--- a/src/views/disRevenue/resource/monitorStategy/view.vue
+++ b/src/views/disRevenue/resource/monitorStategy/view.vue
@@ -8,29 +8,31 @@
{{item.firstTitle}}>>{{item.secondTitle}}>>{{item.lastTitle}}
- 当前所有子项的采集周期均为{{item.time || 0}}分钟
+ 当前所有子项的采集周期均为{{item.timeLabel || 0}}