|
@@ -8,8 +8,8 @@
|
|
|
style="display: inline-block;min-width: 100%;"
|
|
|
ref="trees"
|
|
|
:loading="loading"
|
|
|
-
|
|
|
-
|
|
|
+ :load="loadNode"
|
|
|
+ lazy
|
|
|
:data="data"
|
|
|
:props="defaultProps"
|
|
|
@node-click="nodeClick"
|
|
@@ -195,17 +195,8 @@
|
|
|
|
|
|
<script>
|
|
|
import {tabTypeLazyTree,delAprojectTab} from "@/api/manager/wbsprivate";
|
|
|
-import {
|
|
|
- updateBatchNodeTableInfo,
|
|
|
- selectByNodeTable,
|
|
|
- selectFormElements,
|
|
|
-} from "@/api/manager/wbstree";
|
|
|
-import {
|
|
|
- getList,
|
|
|
- tabLazytreeAll,
|
|
|
- saveLinkTab,
|
|
|
- getExcelHtml,
|
|
|
-} from "@/api/exctab/excelmodel"
|
|
|
+import {selectFormElements,} from "@/api/manager/wbstree";
|
|
|
+import {getExcelHtml} from "@/api/exctab/excelmodel"
|
|
|
import Qute from "./qutediaolog/qute.vue";//引入元素库
|
|
|
import Relation from './qutediaolog/relation.vue'//关联清表
|
|
|
import EditElement from "@/views/manager/projectinfo/editElement/editElement.vue";//编辑元素
|
|
@@ -240,30 +231,10 @@ export default {
|
|
|
defaultProps: {
|
|
|
children: "children",
|
|
|
isLeaf: function (data) {
|
|
|
- return data.hasChildren;
|
|
|
+ return !data.hasChildren;
|
|
|
},
|
|
|
},
|
|
|
allTreeShow:false,//是否显示整棵树
|
|
|
- treeOption: {
|
|
|
- defaultExpandAll: true,
|
|
|
- filter: false,
|
|
|
- addBtn: false,
|
|
|
- formOption: {
|
|
|
- labelWidth: 100,
|
|
|
- column: [
|
|
|
- {
|
|
|
- label: "自定义项",
|
|
|
- prop: "test",
|
|
|
- },
|
|
|
- ],
|
|
|
- },
|
|
|
- props: {
|
|
|
- labelText: "标题",
|
|
|
- label: "label",
|
|
|
- value: "value",
|
|
|
- children: "children",
|
|
|
- },
|
|
|
- },
|
|
|
loadData: [],
|
|
|
loadData1: [
|
|
|
{
|
|
@@ -398,7 +369,7 @@ export default {
|
|
|
// this.loadData = this.loadData1;
|
|
|
this.projectid = this.$route.query.pid;
|
|
|
this.wbsid=this.$route.query.wbsid;
|
|
|
- this.treeLoad1()
|
|
|
+ // this.treeLoad1()
|
|
|
},
|
|
|
methods: {
|
|
|
|
|
@@ -418,7 +389,17 @@ export default {
|
|
|
return res.data
|
|
|
}
|
|
|
},
|
|
|
-
|
|
|
+ loadNode(node, resolve) {
|
|
|
+ const parentId = (node.level === 0) ? 12345678910 : node.data.id;
|
|
|
+ tabTypeLazyTree({parentId,projectId:this.projectid,current:1,size:200}).then(res => {
|
|
|
+ resolve(res.data.data.records.map(item => {
|
|
|
+ return {
|
|
|
+ ...item,
|
|
|
+ leaf: !item.hasChildren
|
|
|
+ }
|
|
|
+ }))
|
|
|
+ });
|
|
|
+ },
|
|
|
searchChange(){
|
|
|
if(this.treeId){
|
|
|
this.tabTypeLazyTree(this.treeId, this.projectid,this.page.current,this.page.size,this.input3).then((res)=>{
|
|
@@ -460,13 +441,21 @@ export default {
|
|
|
nodeClick (data) {//外层树结构
|
|
|
console.log(data,'treedata');
|
|
|
this.treeId=data.id
|
|
|
- this.tabTypeLazyTree(data.id, this.projectid,this.page.current,this.page.size).then((res)=>{
|
|
|
+ if(data.hasChildren){
|
|
|
+ this.tabTypeLazyTree(data.id, this.projectid,this.page.current,this.page.size).then((res)=>{
|
|
|
console.log(res.records);
|
|
|
this.loadData=res.records;
|
|
|
this.page.total=res.total
|
|
|
-
|
|
|
- })
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ let arr=[]
|
|
|
+ arr.push(data)
|
|
|
+ this.loadData=arr
|
|
|
+ this.page.total=1
|
|
|
+ }
|
|
|
+
|
|
|
},
|
|
|
+
|
|
|
handleClose(done) {
|
|
|
this.$confirm("确认关闭?")
|
|
|
.then((_) => {
|