选人组件更改
This commit is contained in:
@@ -14,11 +14,16 @@
|
|||||||
>
|
>
|
||||||
<el-form-item class="form-item-disabled" style="margin: 10px;">
|
<el-form-item class="form-item-disabled" style="margin: 10px;">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="filterText"
|
v-model="filterText"
|
||||||
placeholder="请输入姓名"
|
placeholder="请输入姓名"
|
||||||
@input="changeInput"
|
@keyup.enter.native="searchChange"
|
||||||
></el-input>
|
></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item class="form-item-disabled" style="margin-top: 10px;">
|
||||||
|
<el-button size="medium " type="primary" @click="searchChange">
|
||||||
|
查询
|
||||||
|
</el-button>
|
||||||
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div class="divTree">
|
<div class="divTree">
|
||||||
<el-tree
|
<el-tree
|
||||||
@@ -31,6 +36,7 @@
|
|||||||
:data="treeData"
|
:data="treeData"
|
||||||
:props="defaultProps"
|
:props="defaultProps"
|
||||||
:default-checked-keys="nodeList2"
|
:default-checked-keys="nodeList2"
|
||||||
|
:default-expanded-keys="defaultKey"
|
||||||
highlight-current
|
highlight-current
|
||||||
check-strictly
|
check-strictly
|
||||||
@check="drawerCheck"
|
@check="drawerCheck"
|
||||||
@@ -38,7 +44,7 @@
|
|||||||
show-checkbox
|
show-checkbox
|
||||||
ref="tree"
|
ref="tree"
|
||||||
:load="loadNode"
|
:load="loadNode"
|
||||||
lazy>
|
:lazy="true">
|
||||||
<span class="custom-tree-node" slot-scope="{ node, data }">
|
<span class="custom-tree-node" slot-scope="{ node, data }">
|
||||||
<span :class="node.disabled ? 'is-show' : 'is-leaf-none'"></span>
|
<span :class="node.disabled ? 'is-show' : 'is-leaf-none'"></span>
|
||||||
<span> {{ node.label }} </span>
|
<span> {{ node.label }} </span>
|
||||||
@@ -54,13 +60,14 @@
|
|||||||
:props="defaultProps"
|
:props="defaultProps"
|
||||||
@check-change="checkChange2"
|
@check-change="checkChange2"
|
||||||
:default-checked-keys="nodeList2"
|
:default-checked-keys="nodeList2"
|
||||||
highlight-current
|
:default-expanded-keys="defaultKey"
|
||||||
check-strictly
|
|
||||||
@check="drawerCheck"
|
|
||||||
:expand-on-click-node="true"
|
|
||||||
default-expand-all
|
default-expand-all
|
||||||
|
highlight-current
|
||||||
|
:check-strictly="true"
|
||||||
|
@check="drawerCheck"
|
||||||
show-checkbox
|
show-checkbox
|
||||||
ref="tree">
|
ref="tree"
|
||||||
|
:lazy="false">
|
||||||
<span class="custom-tree-node" slot-scope="{ node, data }">
|
<span class="custom-tree-node" slot-scope="{ node, data }">
|
||||||
<span :class="node.disabled ? 'is-show' : 'is-leaf-none'"></span>
|
<span :class="node.disabled ? 'is-show' : 'is-leaf-none'"></span>
|
||||||
<span> {{ node.label }} </span>
|
<span> {{ node.label }} </span>
|
||||||
@@ -128,6 +135,52 @@
|
|||||||
},
|
},
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
|
data3: [{
|
||||||
|
id: 1,
|
||||||
|
label: '一级 1',
|
||||||
|
children: [{
|
||||||
|
id: 4,
|
||||||
|
label: '二级 1-1',
|
||||||
|
children: [{
|
||||||
|
id: 9,
|
||||||
|
label: '三级 1-1-1'
|
||||||
|
}, {
|
||||||
|
id: 10,
|
||||||
|
label: '三级 1-1-2'
|
||||||
|
}]
|
||||||
|
}]
|
||||||
|
}, {
|
||||||
|
id: 2,
|
||||||
|
label: '一级 2',
|
||||||
|
children: [{
|
||||||
|
id: 5,
|
||||||
|
label: '二级 2-1'
|
||||||
|
}, {
|
||||||
|
id: 6,
|
||||||
|
label: '二级 2-2'
|
||||||
|
}]
|
||||||
|
}, {
|
||||||
|
id: 3,
|
||||||
|
label: '一级 3',
|
||||||
|
children: [{
|
||||||
|
id: 7,
|
||||||
|
label: '二级 3-1'
|
||||||
|
}, {
|
||||||
|
id: 8,
|
||||||
|
label: '二级 3-2',
|
||||||
|
children: [{
|
||||||
|
id: 11,
|
||||||
|
label: '三级 3-2-1'
|
||||||
|
}, {
|
||||||
|
id: 12,
|
||||||
|
label: '三级 3-2-2'
|
||||||
|
}, {
|
||||||
|
id: 13,
|
||||||
|
label: '三级 3-2-3'
|
||||||
|
}]
|
||||||
|
}]
|
||||||
|
}],
|
||||||
|
defaultKey: [],
|
||||||
visible: false,
|
visible: false,
|
||||||
selectList: [],
|
selectList: [],
|
||||||
nodeList2: [],
|
nodeList2: [],
|
||||||
@@ -137,11 +190,6 @@
|
|||||||
defaultProps: {
|
defaultProps: {
|
||||||
children: 'children',
|
children: 'children',
|
||||||
label: 'name',
|
label: 'name',
|
||||||
isLeaf: (data, node) => {
|
|
||||||
if (!node.disabled) {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
treeData1: [],
|
treeData1: [],
|
||||||
treeData: [],
|
treeData: [],
|
||||||
@@ -193,6 +241,39 @@
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
|
searchChange(){
|
||||||
|
if (this.filterText.length) {
|
||||||
|
this.open1 = false
|
||||||
|
this.treeLoading = true
|
||||||
|
this.defaultKey = []
|
||||||
|
this.$http.get('SarInstitution/institution/getNextTwo', {
|
||||||
|
userName: this.filterText
|
||||||
|
}, {}, res => {
|
||||||
|
this.treeData1 = res
|
||||||
|
this.treeData1.forEach(item => {
|
||||||
|
this.defaultKey.push(item.id)
|
||||||
|
})
|
||||||
|
this.treeLoading = false
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// this.$http.get('SarInstitution/institution/institutionAndUser', {
|
||||||
|
// userName: this.filterText
|
||||||
|
// }, {}, res => {
|
||||||
|
// this.treeData1 = res.data
|
||||||
|
// this.treeData1.forEach(item => {
|
||||||
|
// this.defaultKey.push(item.id)
|
||||||
|
// })
|
||||||
|
// console.log(1);
|
||||||
|
// this.getChildren()
|
||||||
|
// this.treeLoading = false
|
||||||
|
// })
|
||||||
|
} else {
|
||||||
|
this.open1 = true
|
||||||
|
}
|
||||||
|
},
|
||||||
changeInput:debounce(function (val) {
|
changeInput:debounce(function (val) {
|
||||||
if (val.length) {
|
if (val.length) {
|
||||||
this.open1 = false
|
this.open1 = false
|
||||||
|
|||||||
Reference in New Issue
Block a user