bug
This commit is contained in:
@@ -62,8 +62,9 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="消耗量阈值" prop="limitValue">
|
||||
<el-input-number v-model="form.limitValue" :min="0" :max="10000000000000000" style="width: 100%;"></el-input-number>
|
||||
<el-form-item label="消耗量阈值">
|
||||
<el-input-number v-model="form.minValue" placeholder="最小值" :max="10000000000000000" style="width: 50%;"></el-input-number>
|
||||
<el-input-number v-model="form.maxValue" placeholder="最大值" :max="10000000000000000" style="width: 50%;"></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -96,14 +97,16 @@ export default {
|
||||
type: '',
|
||||
plcParamId: '',
|
||||
limitType: '',
|
||||
limitValue: ''
|
||||
minValue: null,
|
||||
maxValue: null
|
||||
},
|
||||
objIds: [],// 回显数组
|
||||
isEdit: false, //是否是编辑
|
||||
rules: {
|
||||
objectId: [{ required: true, message: '对象不能为空', trigger: 'change' }],
|
||||
energyTypeId: [{ required: true, message: '能源类型不能为空', trigger: 'change' }],
|
||||
type: [{ required: true, message: '监控模式不能为空', trigger: 'change' }]
|
||||
type: [{ required: true, message: '监控模式不能为空', trigger: 'change' }],
|
||||
limitType: [{ required: true, message: '指标类型不能为空', trigger: 'change' }]
|
||||
},
|
||||
detailList: []
|
||||
}
|
||||
@@ -199,6 +202,12 @@ export default {
|
||||
this.$modal.msgError("监控模式为详细时,详细参数为必填");
|
||||
return false
|
||||
}
|
||||
if (this.form.minValue && this.form.maxValue) {
|
||||
if (this.form.minValue > this.form.maxValue) {
|
||||
this.$modal.msgError("消耗量阈值,最小值不能大于最大值");
|
||||
return false
|
||||
}
|
||||
}
|
||||
// this.form.limitType = Number(this.form.limitType)
|
||||
if (this.isEdit) {
|
||||
// 编辑
|
||||
@@ -223,6 +232,10 @@ export default {
|
||||
},
|
||||
formClear() {
|
||||
this.$refs.form.resetFields()
|
||||
this.form.type = ''
|
||||
this.form.plcParamId = ''
|
||||
this.form.minValue = null
|
||||
this.form.maxValue = null
|
||||
this.objIds = ''
|
||||
this.detailList = []
|
||||
this.isEdit = false
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
@cancel="handleCancel"
|
||||
@confirm="handleConfirm"
|
||||
:before-close="handleCancel"
|
||||
width='60%'
|
||||
>
|
||||
<energy-limit-add ref="energyLimit" @successSubmit="successSubmit" :energyTypeList="energyTypeList" :objList="objList"/>
|
||||
</base-dialog>
|
||||
@@ -199,6 +200,15 @@ export default {
|
||||
item.type = i.label
|
||||
}
|
||||
})
|
||||
if (item.minValue && item.maxValue) {
|
||||
item.limitValue = item.minValue + '-' + item.maxValue
|
||||
} else if(item.minValue){
|
||||
item.limitValue = '最小值' + item.minValue
|
||||
}else if(item.maxValue){
|
||||
item.limitValue = '最大值' + item.maxValue
|
||||
} else {
|
||||
item.limitValue = ''
|
||||
}
|
||||
})
|
||||
this.list = arr
|
||||
this.total = response.data.total;
|
||||
|
||||
Reference in New Issue
Block a user