Browse Source

大屏显示机构维护功能调整

origin/feature/monitoring
yujt 5 years ago
parent
commit
7aa0edff75
  1. 15
      src/views/modules/screen/screendeptinfo-add-or-update.vue
  2. 2
      src/views/modules/screen/screendeptinfo.vue

15
src/views/modules/screen/screendeptinfo-add-or-update.vue

@ -4,12 +4,12 @@
<el-form-item label="机构名称" prop="deptId">
<el-cascader v-model="deptIdList"
:options="options"
v-if="dataForm.id == null"
v-if="!dataForm.id"
:props="{ checkStrictly: true }"
ref="dept"
ref="deptLabel"
style="width: 345px"
clearable></el-cascader>
<el-form-item v-if="dataForm.id != null">
<el-form-item v-if="dataForm.id">
{{dataForm.deptName}}
</el-form-item>
</el-form-item>
@ -141,8 +141,12 @@ export default {
'deptIdList': function (val) {
if (val.length !== 0) {
this.dataForm.deptId = val[val.length - 1]
let casLabelVal = this.$refs['deptLabel'].getCheckedNodes()[0].pathLabels
this.dataForm.deptName = casLabelVal[val.length - 1]
} else {
this.dataForm.deptId = ''
this.dataForm.deptName = ''
}
}
},
@ -185,9 +189,6 @@ export default {
if (!valid) {
return false
}
if(!this.dataForm.id){
this.dataForm.deptName = this.$refs['dept'].inputValue.split('/').slice(-1).toString().replace(/\s+/g,'');
}
this.$http[!this.dataForm.id ? 'post' : 'put']('/sys/screendeptinfo/', this.dataForm).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
@ -199,11 +200,11 @@ export default {
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
this.deptIdList = []
}
})
}).catch(() => {})
})
this.deptIdList = []
}, 1000, { 'leading': true, 'trailing': false })
}
}

2
src/views/modules/screen/screendeptinfo.vue

@ -62,7 +62,7 @@ export default {
deleteIsBatch: true
},
dataForm: {
id: '',
id: ''
},
options: [],
deptIdList: []

Loading…
Cancel
Save