Browse Source

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

origin/feature/monitoring
yujt 5 years ago
parent
commit
7aa0edff75
  1. 31
      src/views/modules/screen/screendeptinfo-add-or-update.vue
  2. 18
      src/views/modules/screen/screendeptinfo.vue
  3. 8
      src/views/modules/user/unauthorized.vue

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

@ -4,12 +4,12 @@
<el-form-item label="机构名称" prop="deptId"> <el-form-item label="机构名称" prop="deptId">
<el-cascader v-model="deptIdList" <el-cascader v-model="deptIdList"
:options="options" :options="options"
v-if="dataForm.id == null" v-if="!dataForm.id"
:props="{ checkStrictly: true }" :props="{ checkStrictly: true }"
ref="dept" ref="deptLabel"
style="width: 345px" style="width: 345px"
clearable></el-cascader> clearable></el-cascader>
<el-form-item v-if="dataForm.id != null"> <el-form-item v-if="dataForm.id">
{{dataForm.deptName}} {{dataForm.deptName}}
</el-form-item> </el-form-item>
</el-form-item> </el-form-item>
@ -141,21 +141,25 @@ export default {
'deptIdList': function (val) { 'deptIdList': function (val) {
if (val.length !== 0) { if (val.length !== 0) {
this.dataForm.deptId = val[val.length - 1] this.dataForm.deptId = val[val.length - 1]
let casLabelVal = this.$refs['deptLabel'].getCheckedNodes()[0].pathLabels
this.dataForm.deptName = casLabelVal[val.length - 1]
} else { } else {
this.dataForm.deptId = '' this.dataForm.deptId = ''
this.dataForm.deptName = ''
} }
} }
}, },
created () { created () {
this.$http this.$http
.get(`/sys/user/deptOptions/getByLoginUser`) .get(`/sys/user/deptOptions/getByLoginUser`)
.then(({ data: res }) => { .then(({ data: res }) => {
if (res.code !== 0) { if (res.code !== 0) {
return this.$message.error(res.msg) return this.$message.error(res.msg)
} }
this.options = res.data.options this.options = res.data.options
}) })
.catch(() => { }) .catch(() => { })
}, },
methods: { methods: {
init () { init () {
@ -185,9 +189,6 @@ export default {
if (!valid) { if (!valid) {
return false 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 }) => { this.$http[!this.dataForm.id ? 'post' : 'put']('/sys/screendeptinfo/', this.dataForm).then(({ data: res }) => {
if (res.code !== 0) { if (res.code !== 0) {
return this.$message.error(res.msg) return this.$message.error(res.msg)
@ -199,11 +200,11 @@ export default {
onClose: () => { onClose: () => {
this.visible = false this.visible = false
this.$emit('refreshDataList') this.$emit('refreshDataList')
this.deptIdList = []
} }
}) })
}).catch(() => {}) }).catch(() => {})
}) })
this.deptIdList = []
}, 1000, { 'leading': true, 'trailing': false }) }, 1000, { 'leading': true, 'trailing': false })
} }
} }

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

@ -62,7 +62,7 @@ export default {
deleteIsBatch: true deleteIsBatch: true
}, },
dataForm: { dataForm: {
id: '', id: ''
}, },
options: [], options: [],
deptIdList: [] deptIdList: []
@ -82,14 +82,14 @@ export default {
}, },
created () { created () {
this.$http this.$http
.get(`/sys/user/deptOptions/getByLoginUser`) .get(`/sys/user/deptOptions/getByLoginUser`)
.then(({ data: res }) => { .then(({ data: res }) => {
if (res.code !== 0) { if (res.code !== 0) {
return this.$message.error(res.msg) return this.$message.error(res.msg)
} }
this.options = res.data.options this.options = res.data.options
}) })
.catch(() => { }) .catch(() => { })
} }
} }
</script> </script>

8
src/views/modules/user/unauthorized.vue

@ -169,7 +169,7 @@ export default {
streetId: '', streetId: '',
communityId: '', communityId: '',
gridId: '', gridId: '',
deptId:'', deptId: '',
realName: '', realName: '',
mobile: '', mobile: '',
identityNo: '', identityNo: '',
@ -210,19 +210,19 @@ export default {
this.dataForm.communityId = '' this.dataForm.communityId = ''
this.dataForm.gridId = '' this.dataForm.gridId = ''
this.dataForm.deptId = '' this.dataForm.deptId = ''
}else } else
if (val.length === 1) { if (val.length === 1) {
this.dataForm.streetId = this.deptIdList[0] this.dataForm.streetId = this.deptIdList[0]
this.dataForm.communityId = '' this.dataForm.communityId = ''
this.dataForm.gridId = '' this.dataForm.gridId = ''
this.dataForm.deptId = this.deptIdList[0] this.dataForm.deptId = this.deptIdList[0]
}else } else
if (val.length === 2) { if (val.length === 2) {
this.dataForm.streetId = this.deptIdList[0] this.dataForm.streetId = this.deptIdList[0]
this.dataForm.communityId = this.deptIdList[1] this.dataForm.communityId = this.deptIdList[1]
this.dataForm.gridId = '' this.dataForm.gridId = ''
this.dataForm.deptId = this.deptIdList[1] this.dataForm.deptId = this.deptIdList[1]
}else } else
if (val.length === 3) { if (val.length === 3) {
this.dataForm.streetId = this.deptIdList[0] this.dataForm.streetId = this.deptIdList[0]
this.dataForm.communityId = this.deptIdList[1] this.dataForm.communityId = this.deptIdList[1]

Loading…
Cancel
Save