From a829497d582549d9b6b070719825f3938b24ab77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BA=B7=E5=86=89=E5=86=89?= Date: Mon, 29 Sep 2025 18:36:36 +0800 Subject: [PATCH] ... --- src/api/disRevenue/resource.js | 8 +++++ src/components/form/index.vue | 1 + .../earnManage/server/relevantData.vue | 6 ++-- .../resource/monitorTemp/details.vue | 21 ++++---------- .../resource/serverScript/dynamicForm.vue | 7 ++++- .../serverScript/serverScriptDetails.vue | 29 ++++++++++++++----- 6 files changed, 46 insertions(+), 26 deletions(-) diff --git a/src/api/disRevenue/resource.js b/src/api/disRevenue/resource.js index b50ea1e..65e08cb 100644 --- a/src/api/disRevenue/resource.js +++ b/src/api/disRevenue/resource.js @@ -359,6 +359,14 @@ export function listRegisterList(data) { data: data }) } +// 通过资源查包含设备 +export function listArrRegisterList(data) { + return request({ + url: '/system/resourceMonitor/getAllRegisterListByGroupId', + method: 'post', + data: data + }) +} /** ----------------AGENT更新------------ */ // 查询列表 export function listAgentManage(query) { diff --git a/src/components/form/index.vue b/src/components/form/index.vue index c1935b8..633ac26 100644 --- a/src/components/form/index.vue +++ b/src/components/form/index.vue @@ -36,6 +36,7 @@ 0) { - this.monitorTable.nodeTow[0].tableList = this.tempContent['switch'].switchNet; setTimeout(() => { this.$refs[`tableRef_web1`][0].selectAllRows(); },500); - } else { - this.monitorTable.nodeTow[0].tableList = res.data.switchNet; } // 光模块 + this.monitorTable.nodeTow[1].tableList = res.data.switchModule; if (this.tempContent['switch'] && this.tempContent['switch'].switchModule && this.tempContent['switch'].switchModule.length > 0) { - this.monitorTable.nodeTow[1].tableList = this.tempContent['switch'].switchModule; setTimeout(() => { this.$refs[`tableRef_web2`][0].selectAllRows(); },500); - } else { - this.monitorTable.nodeTow[1].tableList = res.data.switchModule; } // MPU + this.monitorTable.nodeTow[2].tableList = res.data.switchMpu; if (this.tempContent['switch'] && this.tempContent['switch'].switchMpu && this.tempContent['switch'].switchMpu.length > 0) { - this.monitorTable.nodeTow[2].tableList = this.tempContent['switch'].switchMpu; setTimeout(() => { this.$refs[`tableRef_web3`][0].selectAllRows(); },500); } else { - this.monitorTable.nodeTow[2].tableList = res.data.switchMpu; } // 电源 + this.monitorTable.nodeTow[3].tableList = res.data.switchPwr; if (this.tempContent['switch'] && this.tempContent['switch'].switchPwr && this.tempContent['switch'].switchPwr.length > 0) { - this.monitorTable.nodeTow[3].tableList = this.tempContent['switch'].switchPwr; setTimeout(() => { this.$refs[`tableRef_web4`][0].selectAllRows(); },500); - } else { - this.monitorTable.nodeTow[3].tableList = res.data.switchPwr; } // 风扇 + this.monitorTable.nodeTow[4].tableList = res.data.switchFan; if (this.tempContent['switch'] && this.tempContent['switch'].switchFan && this.tempContent['switch'].switchFan.length > 0) { - this.monitorTable.nodeTow[4].tableList = this.tempContent['switch'].switchFan; setTimeout(() => { this.$refs[`tableRef_web5`][0].selectAllRows(); },500); - } else { - this.monitorTable.nodeTow[4].tableList = res.data.switchFan; } } else { this.monitorTable.nodeTow[0].tableList = res.data.switchNet; diff --git a/src/views/disRevenue/resource/serverScript/dynamicForm.vue b/src/views/disRevenue/resource/serverScript/dynamicForm.vue index 4182064..b72c8d8 100644 --- a/src/views/disRevenue/resource/serverScript/dynamicForm.vue +++ b/src/views/disRevenue/resource/serverScript/dynamicForm.vue @@ -19,7 +19,12 @@ - + + diff --git a/src/views/disRevenue/resource/serverScript/serverScriptDetails.vue b/src/views/disRevenue/resource/serverScript/serverScriptDetails.vue index 387b9bc..61b3028 100644 --- a/src/views/disRevenue/resource/serverScript/serverScriptDetails.vue +++ b/src/views/disRevenue/resource/serverScript/serverScriptDetails.vue @@ -37,7 +37,7 @@ import Form from '@/components/form/index.vue'; import TableList from "@/components/table/index.vue" import DynamicForm from './dynamicForm' - import {getPolicy, addPolicy, updatePolicy, getResMonitorGroup, resNameList} from "@/api/disRevenue/resource" + import {getPolicy, addPolicy, updatePolicy, getResMonitorGroup, resNameList, listArrRegisterList} from "@/api/disRevenue/resource" export default { name: 'ServerScriptDetails', components: {Form, TableList, DynamicForm}, @@ -46,7 +46,10 @@ active: 0, synthesisList: {}, // 第一节点 - ruleFormData: {}, + ruleFormData: { + resourceGroupId: '', + includedDevicesDataList: [] + }, config: { buttonGroup: [] }, @@ -76,8 +79,8 @@ id: {label: 'ID',hidden: true}, policyName: {label: '策略名称', span: 12, type: 'input', rules: [{required: true, message: '请输入模版名称', trigger: 'blur'}]}, description: {label: '描述', span: 12, type: 'textarea'}, - resourceGroupId: {label: '关联资源组', span: 12, type: 'select', options:[]}, - includedDevicesDataList: {label: '包含设备', span: 12, type: 'select', options:[], multiple: true} + resourceGroupId: {label: '关联资源组', span: 12, eventName: 'change', type: 'select', options:[]}, + includedDevicesDataList: {label: '包含设备', span: 12, type: 'select', eventName: 'change', options:[], multiple: true, collapseTags: true} } }]; }, @@ -97,7 +100,7 @@ if (val) { this.formList[0].controls['includedDevicesDataList']['options']= val && val.map(item => { this.includedDevicesList[item.id] = item; - return Object.assign({label: item.resourceName, value: item.id}); + return Object.assign({label: item.id + '_' + item.resourceName, value: item.id}); }); } }).catch(() => { @@ -235,8 +238,20 @@ callback(result, dataVal, formVal) { if (result && result.fnCode) { switch (result.fnCode) { - case 'submit': - console.log('dataVal===',dataVal); + case 'resourceGroupId': + this.ruleFormData['resourceGroupId'] = dataVal; + this.ruleFormData['includedDevicesDataList'] = []; + listArrRegisterList({id: dataVal}).then(res => { + if (res && res.data) { + res.data.forEach(item => { + this.ruleFormData['includedDevicesDataList'].push(Number(item.id)); + }); + } + }); + break; + case 'includedDevicesDataList': + this.ruleFormData['resourceGroupId'] = null; + this.ruleFormData['includedDevicesDataList'] = dataVal; break; default: }