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;
|
||||
|
||||
@@ -136,6 +136,15 @@ export default {
|
||||
item.type = i.name
|
||||
}
|
||||
})
|
||||
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;
|
||||
|
||||
@@ -121,8 +121,9 @@ export default {
|
||||
this.tableH = this.tableHeight(260)
|
||||
this.isFold = this.searchBarWidth('energyReportSearchBox', 1180)
|
||||
})
|
||||
if (this.$route.params.startTime && this.$route.params.endTime) {
|
||||
this.formConfig[2].defaultSelect = [this.$route.params.startTime, this.$route.params.endTime]
|
||||
if (location.href.indexOf('?') > 0) {
|
||||
let arr = location.href.split('?')[1].split('&')
|
||||
this.formConfig[2].defaultSelect = [arr[0].split('=')[1], arr[1].split('=')[1]]
|
||||
} else {
|
||||
this.formConfig[2].defaultSelect = [Date.now() - 7*24*3600000, Date.now()]
|
||||
}
|
||||
@@ -138,8 +139,9 @@ export default {
|
||||
methods: {
|
||||
initData(to) {
|
||||
if (to.name === 'EnergyReportSearch') {
|
||||
if (this.$route.params.startTime && this.$route.params.endTime) {
|
||||
this.formConfig[2].defaultSelect = [this.$route.params.startTime, this.$route.params.endTime]
|
||||
if (location.href.indexOf('?') > 0) {
|
||||
let arr = location.href.split('?')[1].split('&')
|
||||
this.formConfig[2].defaultSelect = [arr[0].split('=')[1], arr[1].split('=')[1]]
|
||||
} else {
|
||||
this.formConfig[2].defaultSelect = [Date.now() - 7*24*3600000, Date.now()]
|
||||
}
|
||||
|
||||
@@ -115,7 +115,7 @@ export default {
|
||||
type: 'select',
|
||||
label: '能源类型',
|
||||
selectOptions: [],
|
||||
param: 'objType',
|
||||
param: 'energyTypeId',
|
||||
filterable: true,
|
||||
width: 120,
|
||||
clearable: false
|
||||
@@ -126,7 +126,7 @@ export default {
|
||||
selectOptions: this.getDictDatas(this.DICT_TYPE.OBJECT_TYPE),
|
||||
labelField: 'label',
|
||||
valueField: 'value',
|
||||
param: 'energyTypeId',
|
||||
param: 'objType',
|
||||
width: 100,
|
||||
clearable: false
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user