|
@@ -32,6 +32,7 @@
|
|
|
node-key="id"
|
|
|
:expand-on-click-node="false"
|
|
|
v-show="!allTreeShow"
|
|
|
+ :default-expanded-keys="expandedKeys"
|
|
|
>
|
|
|
<span
|
|
|
class="custom-tree-node"
|
|
@@ -414,6 +415,7 @@ export default {
|
|
|
},
|
|
|
data () {
|
|
|
return {
|
|
|
+ expandedKeys:[],//默认展开的节点
|
|
|
excelId:'',
|
|
|
treeNode: {},
|
|
|
//#region 鼠标
|
|
@@ -505,10 +507,44 @@ export default {
|
|
|
sortTag: false,
|
|
|
sortTag2: false,
|
|
|
sort:[],
|
|
|
- curTreeData:{}
|
|
|
+ curTreeData:{},
|
|
|
+ defaultExpandKey:[],
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ //刷新左边树形数据
|
|
|
+ refreshTree(){
|
|
|
+ console.log(this.curTreeData,'this.curTreeData111111111');
|
|
|
+ //刷新左边树形数据
|
|
|
+ if(this.curTreeData.level===1){
|
|
|
+ const parentId =0
|
|
|
+ tabLazytree( {
|
|
|
+ parentId:this.curTreeData.parentId,
|
|
|
+ modeId:this.$route.params.id
|
|
|
+ }).then(res => {
|
|
|
+ this.data=res.data.data.data;
|
|
|
+ this.$nextTick(()=>{
|
|
|
+ this.defaultExpandKey.push(this.curTreeData.id);
|
|
|
+ this.$refs.trees.setCurrentKey(this.curTreeData.id);
|
|
|
+
|
|
|
+ })
|
|
|
+
|
|
|
+ });
|
|
|
+ }else{
|
|
|
+ this.updateTreeNewNode()
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ updateTreeNewNode () {
|
|
|
+ tabLazytree( {
|
|
|
+ parentId:this.curTreeData.parentId,
|
|
|
+ modeId:this.$route.params.id
|
|
|
+ }).then((res) => {
|
|
|
+ let node = this.$refs.trees.getNode(this.curTreeData.parentId.parentId);
|
|
|
+ this.$refs.trees.updateKeyChildren(this.curTreeData.parentId, res.data.data)
|
|
|
+ this.$refs.trees.setCurrentKey(this.curTreeData.id);
|
|
|
+ })
|
|
|
+ },
|
|
|
//#region 调整排序排序
|
|
|
async sortpai(data,node) {
|
|
|
console.log(data,node);
|
|
@@ -553,18 +589,7 @@ export default {
|
|
|
this.sort =res.data
|
|
|
}
|
|
|
},
|
|
|
- updateTreeNewNode () {
|
|
|
- tabLazytree( {
|
|
|
- parentId:this.curTreeData.parentId,
|
|
|
- modeId:this.$route.params.id
|
|
|
- }).then((res) => {
|
|
|
- let node = this.$refs.trees.getNode(this.curTreeData.parentId.parentId);
|
|
|
- // node.isLeaf = false;
|
|
|
- // node.isLeafByUser = false;
|
|
|
- //console.log(node)
|
|
|
- this.$refs.trees.updateKeyChildren(this.curTreeData.parentId, res.data.data)
|
|
|
- })
|
|
|
- },
|
|
|
+
|
|
|
async getLazytreessss() {
|
|
|
const { data: res } = await tabLazytree(
|
|
|
{
|
|
@@ -693,6 +718,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
async uploadExcel (data) {//上传清表
|
|
|
+ console.log('上传');
|
|
|
const { data: res } = await uploadExcel(data)
|
|
|
console.log(res);
|
|
|
if (res.code === 200) {
|
|
@@ -703,7 +729,13 @@ export default {
|
|
|
this.detailExcel(this.from.id)
|
|
|
this.from.checkd = true
|
|
|
}
|
|
|
- this.fileList = []
|
|
|
+ this.fileList = [];
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ this.refreshTree()
|
|
|
+
|
|
|
+
|
|
|
},
|
|
|
async deleteExcel (data) {//删除excel表
|
|
|
const { data: res } = await deleteExcel(data)
|
|
@@ -713,6 +745,10 @@ export default {
|
|
|
type: 'success'
|
|
|
})
|
|
|
this.detailExcel(this.from.id)
|
|
|
+ this.refreshTree()
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
},
|
|
|
//#endregion
|
|
@@ -796,6 +832,7 @@ export default {
|
|
|
return resolve(das)
|
|
|
},
|
|
|
nodeClick (data) {//外层树结构
|
|
|
+ this.curTreeData=data;
|
|
|
this.from.import=""
|
|
|
if (data.hasChildren == false) {
|
|
|
this.from.checkd = true
|