|
@@ -28,6 +28,7 @@
|
|
|
highlight-current
|
|
|
node-key="id"
|
|
|
ref="tree"
|
|
|
+ :default-expanded-keys="defaultExpandedKeys"
|
|
|
>
|
|
|
<span
|
|
|
class="custom-tree-node"
|
|
@@ -1315,6 +1316,7 @@ import { getList as getAttchFromOriginalName } from "@/api/resource/attach";
|
|
|
import { getDictionary } from "@/api/system/dict";
|
|
|
import { mapGetters } from "vuex";
|
|
|
import { getList, tabLazytreeAll, saveLinkTab, getExcelHtml } from '@/api/exctab/excelmodel'
|
|
|
+import {getStore,setStore} from '@/util/store'
|
|
|
export default {
|
|
|
data () {
|
|
|
|
|
@@ -1386,7 +1388,7 @@ export default {
|
|
|
children: 'children',
|
|
|
label: 'title',
|
|
|
isLeaf: function (data) {
|
|
|
- console.log(data, !data.hasChildren, data.isExistForm);
|
|
|
+ //console.log(data, !data.hasChildren, data.isExistForm);
|
|
|
let tag = false
|
|
|
if (!data.hasChildren) {
|
|
|
tag = true
|
|
@@ -1394,6 +1396,9 @@ export default {
|
|
|
if (data.isExistForm == 1) {
|
|
|
tag = true
|
|
|
}
|
|
|
+ if (data.deptCategory == 6) {
|
|
|
+ tag = true
|
|
|
+ }
|
|
|
return tag
|
|
|
// return !data.hasChildren || (data.isExistForm == 1);
|
|
|
},
|
|
@@ -1467,6 +1472,9 @@ export default {
|
|
|
excelSortTag2: false,
|
|
|
tableSortList: [],
|
|
|
//#endregion
|
|
|
+
|
|
|
+ //defaultExpandedKeys:[],
|
|
|
+ defaultExpandedKeys:[],
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
@@ -1495,6 +1503,8 @@ export default {
|
|
|
this.getTableTypelist();
|
|
|
this.getDataTypelist();
|
|
|
this.getOwnerTypelist();
|
|
|
+
|
|
|
+ this.defaultExpandedKeys = getStore({name:'projectTreeExpand'});
|
|
|
},
|
|
|
loadNode (node, resolve) {
|
|
|
let pid = 0;
|
|
@@ -1506,6 +1516,7 @@ export default {
|
|
|
if (Array.isArray(res.data.data)) {
|
|
|
arr = res.data.data;
|
|
|
}
|
|
|
+
|
|
|
return resolve(arr);
|
|
|
})
|
|
|
},
|
|
@@ -1606,6 +1617,9 @@ export default {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+ //获取节点展开路径
|
|
|
+ this.getExpandedKeys(node);
|
|
|
+
|
|
|
},
|
|
|
|
|
|
showFormElement () {
|
|
@@ -2478,6 +2492,23 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
//#endregion
|
|
|
+
|
|
|
+ //获取节点展开路径
|
|
|
+ getExpandedKeys(node){
|
|
|
+ //console.log(node)
|
|
|
+ let expandedKeys = [];
|
|
|
+ while(node.parent){
|
|
|
+ expandedKeys.push(node.data.id);
|
|
|
+ node = node.parent;
|
|
|
+ }
|
|
|
+ setStore({
|
|
|
+ name:'projectTreeExpand',
|
|
|
+ content:expandedKeys,
|
|
|
+ type:true//sessionStorage
|
|
|
+ })
|
|
|
+ //console.log(expandedKeys)
|
|
|
+ }
|
|
|
+
|
|
|
},
|
|
|
watch: {
|
|
|
'GLExcelFrom.search' (val) {
|