Commit cba23c6e by 胡悦

修改场景内容第四个选项

1 parent ff1dd588
......@@ -553,10 +553,13 @@ export default {
contentList.forEach(item => {
if (item.paramValue.select) {
item.paramValue.list = this.deviceContentList.find(i => item.paramValue.select == i.id).contentList
getOrderValue({ orderId: item.paramValue.orderId }).then(res => {
const val = res.length === 0 ? null : res
item.paramValue.lastList = val
})
item.paramValue.orderType = item.paramValue.list.find(j => item.paramValue.orderId == j.id).orderType
if (item.paramValue.orderType == 2) {
getOrderValue({ orderId: item.paramValue.orderId }).then(res => {
const val = res.length === 0 ? null : res
item.paramValue.lastList = val
})
}
}
})
}
......@@ -707,14 +710,14 @@ export default {
if (val === '2') this.params.conditionList = [_.cloneDeep(this.defalutConditionObj)]
},
// 第一个下拉框change事件
selectChange(val, index, name) {
selectChange(e, index, name) {
if (name === 'condition') this.params.conditionList[index].paramValue = _.cloneDeep(this.defalutConditionObj.paramValue)
else if (name === 'content') this.params.contentList[index].paramValue = _.cloneDeep(this.defalutContentObj.paramValue)
},
// 设备状态第二个下拉框
firstChange(val, index, name) {
firstChange(e, index, name) {
if (name === 'condition') {
const arr = this.deviceConditionList.find(item => item.id === val).conditionList
const arr = this.deviceConditionList.find(item => item.id === e).conditionList
const value = this.params.conditionList[index].paramValue
value.list = arr
const valueArr = ['order', 'orderCondition', 'orderId', 'orderVal', 'value']
......@@ -724,7 +727,7 @@ export default {
if (value.id) this.$set(value, 'id', null)
if (value.noValue) value.noValue = false
} else {
const arr = this.deviceContentList.find(item => item.id === val).contentList
const arr = this.deviceContentList.find(item => item.id === e).contentList
const value = this.params.contentList[index].paramValue
value.list = arr
const valueArr = ['order', 'valType', 'orderId', 'valueId', 'orderVal', 'value']
......@@ -734,9 +737,10 @@ export default {
}
},
// 设备状态三个下拉框
secondChange(val, index, name) {
secondChange(e, index, name) {
console.log(e)
if (name === 'condition') {
const obj = this.params.conditionList[index].paramValue.list.find(item => item.id === val)
const obj = this.params.conditionList[index].paramValue.list.find(item => item.id === e)
const paramValue = this.params.conditionList[index].paramValue
paramValue.noValue = false
paramValue.order = obj.orderCode
......@@ -744,12 +748,12 @@ export default {
if (obj.orderValue) paramValue.orderVal = obj.orderValue
else paramValue.noValue = true
} else {
const obj = this.params.contentList[index].paramValue.list.find(item => item.id === val)
const obj = this.params.contentList[index].paramValue.list.find(item => item.id === e)
const paramValue = this.params.contentList[index].paramValue
paramValue.valType = obj.orderValueType
paramValue.orderType = obj.orderType
const id = obj.id
if (obj.orderType === '2') {
if (obj.orderType == 2) {
getOrderValue({ orderId: id }).then(res => {
const val = res.length === 0 ? null : res
this.$set(paramValue, 'lastList', val)
......@@ -757,8 +761,8 @@ export default {
}
}
},
lastChange(val, index) {
const obj = this.params.contentList[index].paramValue.lastList.find(item => item.id === val)
lastChange(e, index) {
const obj = this.params.contentList[index].paramValue.lastList.find(item => item.id === e)
const paramValue = this.params.contentList[index].paramValue
paramValue.orderVal = obj.deviceStatusCode
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!