|
@@ -17,14 +17,13 @@
|
|
|
<template>
|
|
<template>
|
|
|
<a-tree
|
|
<a-tree
|
|
|
:selected-keys="selectedKeys"
|
|
:selected-keys="selectedKeys"
|
|
|
- :checked-keys="checkedKeys"
|
|
|
|
|
- :tree-data="departTree"
|
|
|
|
|
|
|
+ :tree-data="treeData"
|
|
|
:check-strictly="checkStrictly"
|
|
:check-strictly="checkStrictly"
|
|
|
:expanded-keys="iExpandedKeys"
|
|
:expanded-keys="iExpandedKeys"
|
|
|
:auto-expand-parent="autoExpandParent"
|
|
:auto-expand-parent="autoExpandParent"
|
|
|
@select="onSelect"
|
|
@select="onSelect"
|
|
|
- @check="onCheck"
|
|
|
|
|
@expand="onExpand"
|
|
@expand="onExpand"
|
|
|
|
|
+ :replaceFields="{children:'children', title:'label', key:'id', value: 'id' }"
|
|
|
/>
|
|
/>
|
|
|
</template>
|
|
</template>
|
|
|
</a-col>
|
|
</a-col>
|
|
@@ -43,27 +42,21 @@ export default {
|
|
|
iExpandedKeys: [],
|
|
iExpandedKeys: [],
|
|
|
loading: false,
|
|
loading: false,
|
|
|
autoExpandParent: true,
|
|
autoExpandParent: true,
|
|
|
- currFlowId: '',
|
|
|
|
|
- currFlowName: '',
|
|
|
|
|
treeData: [],
|
|
treeData: [],
|
|
|
- departTree: [],
|
|
|
|
|
hiding: true,
|
|
hiding: true,
|
|
|
- checkedKeys: [],
|
|
|
|
|
selectedKeys: ['1'],
|
|
selectedKeys: ['1'],
|
|
|
currSelected: {},
|
|
currSelected: {},
|
|
|
allTreeKeys: [],
|
|
allTreeKeys: [],
|
|
|
checkStrictly: true,
|
|
checkStrictly: true,
|
|
|
url: {
|
|
url: {
|
|
|
- tree: '/system/sjConfigProcess/queryTreeList'
|
|
|
|
|
|
|
+ tree: '/system/dept/treeSelect'
|
|
|
},
|
|
},
|
|
|
orgCategoryDisabled: false
|
|
orgCategoryDisabled: false
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
computed: {},
|
|
computed: {},
|
|
|
created() {
|
|
created() {
|
|
|
- this.currFlowId = this.$route.params.id
|
|
|
|
|
- this.currFlowName = this.$route.params.name
|
|
|
|
|
- // this.loadTree()
|
|
|
|
|
|
|
+ this.loadTree()
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
loadData() {
|
|
loadData() {
|
|
@@ -72,18 +65,15 @@ export default {
|
|
|
loadTree() {
|
|
loadTree() {
|
|
|
var that = this
|
|
var that = this
|
|
|
that.treeData = []
|
|
that.treeData = []
|
|
|
- that.departTree = []
|
|
|
|
|
getAction(this.url.tree).then((res) => {
|
|
getAction(this.url.tree).then((res) => {
|
|
|
- if (res.success) {
|
|
|
|
|
|
|
+ if (res.code === 200) {
|
|
|
// 部门全选后,再添加部门,选中数量增多
|
|
// 部门全选后,再添加部门,选中数量增多
|
|
|
this.allTreeKeys = []
|
|
this.allTreeKeys = []
|
|
|
- for (let i = 0; i < res.result.length; i++) {
|
|
|
|
|
- const temp = res.result[i]
|
|
|
|
|
|
|
+ for (let i = 0; i < res.data.length; i++) {
|
|
|
|
|
+ const temp = res.data[i]
|
|
|
that.treeData.push(temp)
|
|
that.treeData.push(temp)
|
|
|
- that.departTree.push(temp)
|
|
|
|
|
that.setThisExpandedKeys(temp)
|
|
that.setThisExpandedKeys(temp)
|
|
|
that.getAllKeys(temp)
|
|
that.getAllKeys(temp)
|
|
|
- // console.log(temp.id)
|
|
|
|
|
}
|
|
}
|
|
|
this.loading = false
|
|
this.loading = false
|
|
|
}
|
|
}
|
|
@@ -106,22 +96,6 @@ export default {
|
|
|
this.iExpandedKeys = expandedKeys
|
|
this.iExpandedKeys = expandedKeys
|
|
|
this.autoExpandParent = false
|
|
this.autoExpandParent = false
|
|
|
},
|
|
},
|
|
|
- nodeModalOk() {
|
|
|
|
|
- this.loadTree()
|
|
|
|
|
- },
|
|
|
|
|
- nodeModalClose() {
|
|
|
|
|
- },
|
|
|
|
|
- onCheck(checkedKeys, info) {
|
|
|
|
|
- console.log('onCheck', checkedKeys, info)
|
|
|
|
|
- this.hiding = false
|
|
|
|
|
- // ---- author:os_chengtgen -- date:20190827 -- for:切换父子勾选模式 =======------
|
|
|
|
|
- if (this.checkStrictly) {
|
|
|
|
|
- this.checkedKeys = checkedKeys.checked
|
|
|
|
|
- } else {
|
|
|
|
|
- this.checkedKeys = checkedKeys
|
|
|
|
|
- }
|
|
|
|
|
- // ---- author:os_chengtgen -- date:20190827 -- for:切换父子勾选模式 =======------
|
|
|
|
|
- },
|
|
|
|
|
onSelect(selectedKeys, e) {
|
|
onSelect(selectedKeys, e) {
|
|
|
console.log('selected', selectedKeys, e)
|
|
console.log('selected', selectedKeys, e)
|
|
|
this.hiding = false
|
|
this.hiding = false
|
|
@@ -131,15 +105,10 @@ export default {
|
|
|
this.selectedKeys = [record.key]
|
|
this.selectedKeys = [record.key]
|
|
|
this.$emit('selected', this.currSelected)
|
|
this.$emit('selected', this.currSelected)
|
|
|
},
|
|
},
|
|
|
- getCurrSelectedTitle() {
|
|
|
|
|
- return !this.currSelected.title ? '' : this.currSelected.title
|
|
|
|
|
- },
|
|
|
|
|
onClearSelected() {
|
|
onClearSelected() {
|
|
|
this.hiding = true
|
|
this.hiding = true
|
|
|
- this.checkedKeys = []
|
|
|
|
|
this.currSelected = {}
|
|
this.currSelected = {}
|
|
|
this.selectedKeys = []
|
|
this.selectedKeys = []
|
|
|
- this.$refs.departAuth.departId = ''
|
|
|
|
|
},
|
|
},
|
|
|
// ---- author:os_chengtgen -- date:20190827 -- for:切换父子勾选模式 =======------
|
|
// ---- author:os_chengtgen -- date:20190827 -- for:切换父子勾选模式 =======------
|
|
|
expandAll() {
|
|
expandAll() {
|
|
@@ -149,8 +118,7 @@ export default {
|
|
|
this.iExpandedKeys = []
|
|
this.iExpandedKeys = []
|
|
|
},
|
|
},
|
|
|
getAllKeys(node) {
|
|
getAllKeys(node) {
|
|
|
- // console.log('node',node);
|
|
|
|
|
- this.allTreeKeys.push(node.key)
|
|
|
|
|
|
|
+ this.allTreeKeys.push(node.id)
|
|
|
if (node.children && node.children.length > 0) {
|
|
if (node.children && node.children.length > 0) {
|
|
|
for (let a = 0; a < node.children.length; a++) {
|
|
for (let a = 0; a < node.children.length; a++) {
|
|
|
this.getAllKeys(node.children[a])
|
|
this.getAllKeys(node.children[a])
|