mirror of
https://gitee.com/js-yhsec/energy_storage.git
synced 2026-05-28 03:09:24 +08:00
```
refactor(config): 更新配置文件和组件逻辑 - 在 `EditCom.vue` 中修改 `workModeIdSelect` 的监听器,添加异步处理逻辑,并引入新的方法 `getPolicyList` 以获取策略列表。 - 在 `device.vue` 中更新状态显示逻辑,使用 `is_error` 和 `is_running` 替换 `is_online`。
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user