diff --git a/src/views/storeManage/warehouse3DConfig/index.vue b/src/views/storeManage/warehouse3DConfig/index.vue index 96548b8..f1213b9 100644 --- a/src/views/storeManage/warehouse3DConfig/index.vue +++ b/src/views/storeManage/warehouse3DConfig/index.vue @@ -125,11 +125,23 @@ export default { 'form.divPosition'(newVal, oldVal) { if (newVal && newVal.includes('OAO')) { this.isMultiple = true + } else { + this.isMultiple = false } // 解决单选,多选切换后, 上次值残留 this.$nextTick(function() { - this.$refs.paramsSelect.selectedLabel = '' + // this.form.deviceSpecParams + const selectedParams = this.paramsOptions.filter((item) => { return this.form.deviceSpecParams === item.value || (Array.isArray(this.form.deviceSpecParams) && this.form.deviceSpecParams.includes(item.value)) }) + console.log(this.form.deviceSpecParams) + if (selectedParams.length > 0) { + this.$refs.paramsSelect.selectedLabel = selectedParams.map((item) => { return item.label }).join(',') + } else { + this.$refs.paramsSelect.selectedLabel = '' + } }) + // setTimeout(() => { + // this.update = true + // }, 0) } }, created() { @@ -189,7 +201,7 @@ export default { if (this.form.divPosition.includes('TOP')) { formParams = formParams[0] } - this.$set(this.form, 'deviceSpecParams', formParams) + this.form.deviceSpecParams = formParams } } else { // 清除参数选项 @@ -249,6 +261,7 @@ export default { if (this.form.deviceInfo.id) { getParams({ deviceInfoId: this.form.deviceInfo.id }).then((data) => { this.paramsOptions = data.map(data => { return { value: data.id, label: data.paramName, info: data.paramId, self: data } }) + console.log(3333, this.paramsOptions) }) } },