|
@@ -206,20 +206,23 @@
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="执行说明" align="center" prop="repeatParam" />
|
|
|
+ <el-table-column label="策略描述" align="center" prop="strategyDesc" show-overflow-tooltip />
|
|
|
<el-table-column label="优先级" align="center" prop="priority" />
|
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button size="mini" type="text" icon="el-icon-edit" @click="handleStrategyUpdate(scope.row)"
|
|
|
+ <el-button size="mini" type="text" icon="el-icon-view" v-if="scope.row.editFlag==0" @click="handleStrategyDetail(scope.row)">
|
|
|
+ 查看</el-button>
|
|
|
+ <el-button size="mini" type="text" icon="el-icon-edit" v-else @click="handleStrategyUpdate(scope.row)"
|
|
|
v-hasPermi="['basecfg:price:edit']">修改</el-button>
|
|
|
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleStrategyDelete(scope.row)"
|
|
|
- v-hasPermi="['basecfg:price:del']">删除</el-button>
|
|
|
+ v-hasPermi="['basecfg:price:del']" :disabled="scope.row.editFlag==0">删除</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
|
|
|
<!-- 添加或修改峰谷电价策略配置对话框 -->
|
|
|
<el-dialog :title="title" :visible.sync="strategyDialog" width="750px" append-to-body>
|
|
|
- <el-form ref="strategyForm" :model="strategyForm" label-width="100px">
|
|
|
+ <el-form ref="strategyForm" class="strategyForm" :model="strategyForm" :disabled="ifDisabled" label-width="100px">
|
|
|
<el-form-item label="策略编码" prop="strategyCode" required :rules="[{required:true,message:'策略编码不能为空'}]">
|
|
|
<el-input v-model="strategyForm.strategyCode" placeholder="请输入策略编码" />
|
|
|
</el-form-item>
|
|
@@ -237,14 +240,18 @@
|
|
|
:picker-options="{selectableRange: '00:00:00 - 23:59:59'}" placeholder="选择时间">
|
|
|
</el-time-picker>
|
|
|
<el-checkbox-group v-else-if="strategyForm.repeatType==5" v-model="strategyForm.repeatParam">
|
|
|
- <el-checkbox v-for="day in weeks.filter(item=>item.value<6)" :checked="true" :label="day.value" :key="day.value">{{day.name}}</el-checkbox>
|
|
|
+ <el-checkbox v-for="day in weeks.filter(item=>item.value<6)" :label="day.value" :key="day.value">
|
|
|
+ {{day.name}}</el-checkbox>
|
|
|
</el-checkbox-group>
|
|
|
<el-checkbox-group v-else-if="strategyForm.repeatType==6" v-model="strategyForm.repeatParam">
|
|
|
<el-checkbox v-for="day in weeks" :label="day.value" :key="day.value">{{day.name}}</el-checkbox>
|
|
|
</el-checkbox-group>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item label="策略描述" prop="strategyDesc">
|
|
|
+ <el-input v-model="strategyForm.strategyDesc" placeholder="请输入策略描述" />
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="优先级" prop="priority" required>
|
|
|
- <el-input-number v-model="strategyForm.priority" :min="0" :max="10" label="描述文字"></el-input-number>
|
|
|
+ <el-input-number v-model="strategyForm.priority" :min="0" :max="100" label="描述文字"></el-input-number>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="小时电价">
|
|
|
<el-table class="sub-table" :data="strategyForm.hourList" max-height="200px">
|
|
@@ -272,7 +279,7 @@
|
|
|
</el-select>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column align="center" width="100">
|
|
|
+ <el-table-column align="center" width="100" v-if="!ifDisabled">
|
|
|
<template slot="header">
|
|
|
<div class="operateBtns" @click="addSub">
|
|
|
<span>操作</span><i class="el-icon-circle-plus-outline"></i>
|
|
@@ -286,7 +293,7 @@
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-form>
|
|
|
- <div slot="footer" class="dialog-footer">
|
|
|
+ <div slot="footer" class="dialog-footer" v-if="!ifDisabled">
|
|
|
<el-button type="primary" @click="submitStrategyForm">确 定</el-button>
|
|
|
<el-button @click="strategyCancel">取 消</el-button>
|
|
|
</div>
|
|
@@ -512,6 +519,7 @@ export default {
|
|
|
strategyForm: {
|
|
|
strategyCode: '',
|
|
|
strategyName: '',
|
|
|
+ strategyDesc: '',
|
|
|
repeatType: '',
|
|
|
repeatParam: [],
|
|
|
priority: 0,
|
|
@@ -532,7 +540,8 @@ export default {
|
|
|
waterComputeDesc: '',
|
|
|
relCoList: []
|
|
|
},
|
|
|
- zoningList: []
|
|
|
+ zoningList: [],
|
|
|
+ ifDisabled: false
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
@@ -830,7 +839,9 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
repeatTypeChange(val) {
|
|
|
- if (val == 5 || val == 6) {
|
|
|
+ if (val == 5) {
|
|
|
+ this.strategyForm.repeatParam = this.weeks.filter(item => item.value < 6).map(item => item.value)
|
|
|
+ } else if (val == 6) {
|
|
|
this.strategyForm.repeatParam = []
|
|
|
} else {
|
|
|
this.strategyForm.repeatParam = ''
|
|
@@ -845,13 +856,25 @@ export default {
|
|
|
this.strategyParams.loading = false
|
|
|
})
|
|
|
},
|
|
|
+ handleStrategyDetail(row) {
|
|
|
+ this.ifDisabled = true
|
|
|
+ this.resetForm('strategyForm')
|
|
|
+ Object.assign(this.strategyForm, row)
|
|
|
+ if ([5, 6].includes(this.strategyForm.repeatType)) {
|
|
|
+ this.strategyForm.repeatParam = this.strategyForm.repeatParam.split(',')
|
|
|
+ }
|
|
|
+ this.strategyDialog = true
|
|
|
+ this.title = '查看峰谷电价策略'
|
|
|
+ },
|
|
|
handleStrategyAdd() {
|
|
|
+ this.ifDisabled = false
|
|
|
this.resetForm('strategyForm')
|
|
|
this.strategyForm = this.$options.data().strategyForm
|
|
|
this.strategyDialog = true
|
|
|
this.title = '添加峰谷电价策略'
|
|
|
},
|
|
|
handleStrategyUpdate(row) {
|
|
|
+ this.ifDisabled = false
|
|
|
this.resetForm('strategyForm')
|
|
|
Object.assign(this.strategyForm, row)
|
|
|
if ([5, 6].includes(this.strategyForm.repeatType)) {
|
|
@@ -1053,6 +1076,12 @@ export default {
|
|
|
max-height: 120px;
|
|
|
overflow-y: auto;
|
|
|
}
|
|
|
+.strategyForm {
|
|
|
+ ::v-deep .el-input.is-disabled .el-input__inner {
|
|
|
+ color: #606266;
|
|
|
+ background: #fff;
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|
|
|
<style lang="scss">
|
|
|
.custom-dialog {
|