mirror of
https://gitee.com/js-yhsec/energy_storage.git
synced 2026-05-28 03:09:24 +08:00
修改菜单+权限+图表渲染
This commit is contained in:
@@ -15,16 +15,15 @@
|
||||
ref="comTable"
|
||||
:table-option="tableOption"
|
||||
:page-option="pageOption"
|
||||
:table-h="tableH"
|
||||
>
|
||||
<template #status="record">
|
||||
<span>{{ ['未启用', '启用'][record.status] }}</span>
|
||||
</template>
|
||||
<template #work_mode="record">
|
||||
<span>{{workModeList.find(item=>record.value==item.value)?.label|| '' }}</span>
|
||||
<span>{{ workModeList.find((item) => record.value == item.value)?.label || '' }}</span>
|
||||
</template>
|
||||
<template #policy_id="record">
|
||||
<span>{{policyList.find(item=>record.value==item.value)?.label|| ''}}</span>
|
||||
<span>{{ policyList.find((item) => record.value == item.value)?.label || '' }}</span>
|
||||
</template>
|
||||
|
||||
<template #action="record">
|
||||
@@ -65,6 +64,9 @@ export default {
|
||||
props: {},
|
||||
data() {
|
||||
return {
|
||||
tableOption: {
|
||||
select:false
|
||||
},
|
||||
formModal: false,
|
||||
formState: {},
|
||||
formStatus: 'add', //表单状态辑状态 add:新增 edit:编辑
|
||||
@@ -74,33 +76,33 @@ export default {
|
||||
},
|
||||
btnOptionList: [],
|
||||
paramsDate: {},
|
||||
workModeList:[
|
||||
workModeList: [
|
||||
{
|
||||
label:'最优经济化',
|
||||
value:1
|
||||
label: '最优经济化',
|
||||
value: 1
|
||||
},
|
||||
{
|
||||
label:'支撑电网稳定',
|
||||
value:2
|
||||
label: '支撑电网稳定',
|
||||
value: 2
|
||||
},
|
||||
{
|
||||
label:'自定义',
|
||||
value:3
|
||||
},
|
||||
label: '自定义',
|
||||
value: 3
|
||||
}
|
||||
],
|
||||
policyList:[
|
||||
policyList: [
|
||||
{
|
||||
label:'削峰套利',
|
||||
value:1
|
||||
label: '削峰套利',
|
||||
value: 1
|
||||
},
|
||||
{
|
||||
label:'需求响应',
|
||||
value:2
|
||||
label: '需求响应',
|
||||
value: 2
|
||||
},
|
||||
{
|
||||
label:'自发自用',
|
||||
value:3
|
||||
},
|
||||
label: '自发自用',
|
||||
value: 3
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
@@ -155,7 +157,7 @@ export default {
|
||||
}
|
||||
},
|
||||
operateForm(type, record = {}) {
|
||||
console.log(record,record.id,'rrrrrrrrrr')
|
||||
console.log(record, record.id, 'rrrrrrrrrr')
|
||||
this.formStatus = type
|
||||
switch (type) {
|
||||
case 'add':
|
||||
@@ -170,9 +172,9 @@ export default {
|
||||
this.formState = record
|
||||
this.getRuleFormInfo(record)
|
||||
break
|
||||
|
||||
|
||||
case 'del':
|
||||
this.handleDelete([record.station_id],this.getList)
|
||||
this.handleDelete([record.station_id], this.getList)
|
||||
|
||||
break
|
||||
|
||||
@@ -186,7 +188,7 @@ export default {
|
||||
}
|
||||
},
|
||||
// 删除操作
|
||||
async handleDelete(id,callback) {
|
||||
async handleDelete(id, callback) {
|
||||
const that = this
|
||||
Modal.confirm({
|
||||
title: '你确认删除数据吗?',
|
||||
@@ -194,10 +196,10 @@ export default {
|
||||
|
||||
async onOk() {
|
||||
try {
|
||||
const res = await getReq('/deleteStation',{station_id:id})
|
||||
const res = await getReq('/deleteStation', { station_id: id })
|
||||
if (res.errcode === 0) {
|
||||
this.$message.success(res.errmsg)
|
||||
this.pageOption.page=1
|
||||
this.pageOption.page = 1
|
||||
callback()
|
||||
} else {
|
||||
throw res
|
||||
@@ -230,7 +232,6 @@ export default {
|
||||
}
|
||||
stationOptions.forEach((e, index) => {
|
||||
e.list.forEach((i) => {
|
||||
|
||||
e.ruleForm[i.key] = row ? row[i.key] : ''
|
||||
e.ruleForm.id = row.id
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user