|
@@ -108,19 +108,22 @@
|
|
|
<!-- 单选 -->
|
|
|
<!--<el-select v-model="form.treeData" placeholder="请选择" style="width: 16rem">-->
|
|
|
<!-- 多选 -->
|
|
|
- <el-select v-model="form.treeData" multiple placeholder="请选择" style="width:100%">
|
|
|
- <el-option :value="treeDataValue" style="height: auto">
|
|
|
- <el-tree
|
|
|
- ref="selectTree"
|
|
|
- :data="data"
|
|
|
- :value="inputForm.manageOfficeIds"
|
|
|
- default-expand-all
|
|
|
- node-key="id"
|
|
|
- :props="defaultProps"
|
|
|
- @node-click="handleNodeClick"
|
|
|
- />
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
+ <SelectTree
|
|
|
+ ref="officeTree"
|
|
|
+ :props="{
|
|
|
+ value: 'id', // ID字段名
|
|
|
+ label: 'name', // 显示名称
|
|
|
+ children: 'children' // 子级字段名
|
|
|
+ }"
|
|
|
+ size="middle"
|
|
|
+ :url="`/sys/office/treeData?type=2`"
|
|
|
+ :value="inputForm.manageOfficeIds"
|
|
|
+ :clearable="false"
|
|
|
+ :accordion="true"
|
|
|
+ :showCheckbox="true"
|
|
|
+ :checkStrictly="true"
|
|
|
+ :checkOnClickNode="true"
|
|
|
+ @getValue="(value) => {inputForm.manageOfficeIds=value}"/>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
|
|
@@ -287,14 +290,14 @@ export default {
|
|
|
this.userService.queryById(this.inputForm.id).then(({data}) => {
|
|
|
this.inputForm = this.recover(this.inputForm, data)
|
|
|
this.inputForm.oldLoginName = this.inputForm.loginName
|
|
|
- if (!this.inputForm.manageOfficeNameList) {
|
|
|
- this.treeDataValue = ''
|
|
|
- this.form.treeData = []
|
|
|
- this.form.treeDataId = []
|
|
|
- } else {
|
|
|
- this.form.treeData = this.inputForm.manageOfficeNameList
|
|
|
- this.form.treeDataId = this.inputForm.manageOfficeIds.split(',')
|
|
|
- }
|
|
|
+ // if (!this.inputForm.manageOfficeNameList) {
|
|
|
+ // this.treeDataValue = ''
|
|
|
+ // this.form.treeData = []
|
|
|
+ // this.form.treeDataId = []
|
|
|
+ // } else {
|
|
|
+ // this.form.treeData = this.inputForm.manageOfficeNameList
|
|
|
+ // this.form.treeDataId = this.inputForm.manageOfficeIds.split(',')
|
|
|
+ // }
|
|
|
})
|
|
|
|
|
|
this.userService.getOffice().then(({data}) => {
|
|
@@ -326,10 +329,10 @@ export default {
|
|
|
doSubmit () {
|
|
|
this.$refs['inputForm'].validate((valid) => {
|
|
|
if (valid) {
|
|
|
- if (this.form.treeDataId) {
|
|
|
- var manageOfficeIds = this.form.treeData.toString()
|
|
|
- this.inputForm.manageOfficeIds = manageOfficeIds
|
|
|
- }
|
|
|
+ // if (this.form.treeDataId) {
|
|
|
+ // var manageOfficeIds = this.form.treeData.toString()
|
|
|
+ // this.inputForm.manageOfficeIds = manageOfficeIds
|
|
|
+ // }
|
|
|
this.loading = true
|
|
|
this.userService.save(this.inputForm).then(({data}) => {
|
|
|
this.loading = false
|