|
@@ -77,6 +77,7 @@
|
|
|
:page.sync="page"
|
|
|
@on-load="onLoad"
|
|
|
@selection-change="selectionChange"
|
|
|
+ :table-loading="tabloading"
|
|
|
>
|
|
|
|
|
|
<template slot="menuRight">
|
|
@@ -98,7 +99,7 @@
|
|
|
</el-button>
|
|
|
</template>
|
|
|
<template slot="menuLeft" slot-scope="{size}">
|
|
|
- <el-input placeholder="请输入你想搜索的表单名称" v-model="input3" :size="size" >
|
|
|
+ <el-input placeholder="请输入你想搜索的表单名称" v-model="input3" :size="size" @clear="clearinput" clearable>
|
|
|
<i class="el-icon-search" slot="append" @click="searchChange"></i>
|
|
|
</el-input>
|
|
|
</template>
|
|
@@ -513,6 +514,7 @@ export default {
|
|
|
return {
|
|
|
input3:'',
|
|
|
editElementFormTag:false,//编辑元素
|
|
|
+ tabloading:false,
|
|
|
formDatass: [],
|
|
|
selectionList:[],
|
|
|
tableTypelist:[],
|
|
@@ -854,24 +856,33 @@ export default {
|
|
|
nodeClick(data,node){
|
|
|
console.log(data,node,'treedata');
|
|
|
this.curNode=node
|
|
|
+ this.curTreeData=data
|
|
|
+ this.treeId=data.id
|
|
|
+
|
|
|
if(data.hasChildren){
|
|
|
+ this.tabloading=true;
|
|
|
this.tabTypeLazyTreeAll(data.id, this.page.current,this.page.size).then((res)=>{
|
|
|
this.loadData=res.records
|
|
|
this.page.total=res.total
|
|
|
+ this.tabloading=false;
|
|
|
})
|
|
|
}
|
|
|
if(data.hasChildren===false&&node.level==2){
|
|
|
+ this.tabloading=true;
|
|
|
let arr=[]
|
|
|
arr.push(data)
|
|
|
this.loadData=arr
|
|
|
this.page.total=1
|
|
|
+ setTimeout(() => {
|
|
|
+ this.tabloading=false
|
|
|
+
|
|
|
+ }, 1000);
|
|
|
}else{
|
|
|
this.loadData=[]
|
|
|
this.page.total=0
|
|
|
+
|
|
|
}
|
|
|
- this.curTreeData=data
|
|
|
- this.treeId=data.id
|
|
|
-
|
|
|
+
|
|
|
},
|
|
|
|
|
|
|
|
@@ -889,15 +900,17 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
//编辑后刷新
|
|
|
- onLoad1(page){
|
|
|
- // console.log(this.level,'1111111111');
|
|
|
+ onLoad1(){
|
|
|
if(this.curNode.level===1&&this.curNode.data.hasChildren){
|
|
|
- this.tabTypeLazyTreeAll(this.treeId, page.currentPage,page.pageSize).then((res)=>{
|
|
|
+ this.tabloading=true;
|
|
|
+ this.tabTypeLazyTreeAll(this.treeId, this.page.current,this.page.size,this.input3).then((res)=>{
|
|
|
this.loadData=res.records
|
|
|
this.page.total=res.total
|
|
|
+ this.tabloading=false
|
|
|
})
|
|
|
}else{
|
|
|
- this.tabTypeLazyTreeAll(this.curNode.data.parentId, page.currentPage,page.pageSize).then((res)=>{
|
|
|
+
|
|
|
+ this.tabTypeLazyTreeAll(this.curNode.data.parentId,this.page.current,this.page.size,this.input3).then((res)=>{
|
|
|
let faArr=res.records;
|
|
|
this.loadData=faArr.filter((item)=>{
|
|
|
if(item.id===this.treeId){
|
|
@@ -906,21 +919,48 @@ export default {
|
|
|
})
|
|
|
})
|
|
|
}
|
|
|
- // this.refreshTreeData()
|
|
|
+
|
|
|
+
|
|
|
},
|
|
|
//搜索
|
|
|
searchChange(){
|
|
|
if(this.treeId){
|
|
|
- this.tabTypeLazyTreeAll(this.treeId, this.page.current,this.page.size,this.input3).then((res)=>{
|
|
|
- this.loadData=res.records
|
|
|
- this.page.total=res.total
|
|
|
+ if(this.curTreeData.hasChildren){
|
|
|
+ this.tabloading=true;
|
|
|
+ this.tabTypeLazyTreeAll(this.curTreeData.id, this.page.current,this.page.size,this.input3).then((res)=>{
|
|
|
+ this.loadData=res.records
|
|
|
+ this.page.total=res.total
|
|
|
+ this.tabloading=false;
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if(this.curTreeData.hasChildren===false&&this.curNode.level==2){
|
|
|
+ this.tabloading=true;
|
|
|
+ let arr=[]
|
|
|
+ arr.push(this.curTreeData)
|
|
|
+ this.loadData=arr
|
|
|
+ this.page.total=1;
|
|
|
+ setTimeout(() => {
|
|
|
+ this.tabloading=false
|
|
|
+
|
|
|
+ }, 1000);
|
|
|
+ }else{
|
|
|
+ this.loadData=[]
|
|
|
+ this.page.total=0
|
|
|
+ setTimeout(() => {
|
|
|
+ this.tabloading=false
|
|
|
+
|
|
|
+ }, 1000);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
- })
|
|
|
}else{
|
|
|
this.$message.warning("请选选择左侧节点");
|
|
|
}
|
|
|
|
|
|
},
|
|
|
+ clearinput(){
|
|
|
+ this.searchChange()
|
|
|
+ },
|
|
|
resetChange(item){
|
|
|
console.log(item);
|
|
|
this.tabTypeLazyTreeAll(this.treeId, this.page.current,this.page.size).then((res)=>{
|