diff --git a/web/public/config/columnList.js b/web/public/config/columnList.js index ebb9567..fac1d4a 100644 --- a/web/public/config/columnList.js +++ b/web/public/config/columnList.js @@ -693,20 +693,7 @@ export const stationOptions = [ value: undefined, key: 'policy_id', type: 'unshow', - list: [ - { - label: '削峰套利', - value: '1' - }, - { - label: '需求响应', - value: '2' - }, - { - label: '自发自用', - value: '3' - } - ] + list: [] } ], ruleForm: {} diff --git a/web/src/components/EditCom.vue b/web/src/components/EditCom.vue index ac71c0e..4854cb4 100644 --- a/web/src/components/EditCom.vue +++ b/web/src/components/EditCom.vue @@ -176,14 +176,21 @@ export default { computed: {}, watch: { workModeIdSelect: { - handler(n) { + async handler(n,o) { + if(n !== o){ + this.detailInfos[0].ruleForm.policy_id='' + } switch (n) { case '1': this.detailInfos[0].list[this.detailInfos[0].list.length - 1].type = 'select' + this.detailInfos[0].list[this.detailInfos[0].list.length - 1].list = + await this.getPolicyList(1) break case '5': this.detailInfos[0].list[this.detailInfos[0].list.length - 1].type = 'select' + this.detailInfos[0].list[this.detailInfos[0].list.length - 1].list = + await this.getPolicyList(5) break default: @@ -263,6 +270,23 @@ export default { console.log('modal') }, methods: { + async getPolicyList(type) { + let list = [] + try { + const res = await getReq('/queryPolicyByType', { type }) + if (res.errcode == 0) { + list = res.data + .map((item) => { + + return {label:item.name,value:item.policy_id } + }) + } + } catch (error) { + console.log(error) + } + + return list + }, async getRoleIdList() { const params = { page_size: 1000, diff --git a/web/src/components/monitor/device.vue b/web/src/components/monitor/device.vue index 689d8dc..51a7aeb 100644 --- a/web/src/components/monitor/device.vue +++ b/web/src/components/monitor/device.vue @@ -21,15 +21,15 @@ 在线状态