|
@@ -1001,32 +1001,58 @@ export default {
|
|
|
this.$refs.crud.toggleSelection();
|
|
|
});
|
|
|
},
|
|
|
- //刷新左边树形数据
|
|
|
- refreshTreeData(){
|
|
|
- const parentId =12345678910
|
|
|
- tabTypeLazyTreeAll({parentId,current:1,siez:1000}).then(res => {
|
|
|
- this.treeData=res.data.data.records;
|
|
|
- this.$nextTick(()=>{
|
|
|
- //树默认展开
|
|
|
- if(this.curNode.level===1){
|
|
|
- this.treeOption.defaultExpandedKeys.push(this.curNode.data.id);
|
|
|
- this.$refs.avueTree.setCurrentKey(this.curNode.data.id)
|
|
|
-
|
|
|
- }else{
|
|
|
- this.treeOption.defaultExpandedKeys.push(this.curNode.data.parentId);
|
|
|
- // 设置选中的节点
|
|
|
- this.treeOption.currentNode =this.curNode.data.id
|
|
|
- this.$refs.avueTree.setCurrentKey(this.curNode.data.id)
|
|
|
-
|
|
|
-
|
|
|
- }
|
|
|
+ // //刷新左边树形数据
|
|
|
+ // refreshTreeData(){
|
|
|
+ // const parentId =12345678910
|
|
|
+ // tabTypeLazyTreeAll({parentId,current:1,siez:1000}).then(res => {
|
|
|
+ // this.treeData=res.data.data.records;
|
|
|
+ // this.$nextTick(()=>{
|
|
|
+ // //树默认展开
|
|
|
+ // if(this.curNode.level===1){
|
|
|
+ // this.treeOption.defaultExpandedKeys.push(this.curNode.data.id);
|
|
|
+ // this.$refs.avueTree.setCurrentKey(this.curNode.data.id)
|
|
|
|
|
|
+ // }else{
|
|
|
+ // this.treeOption.defaultExpandedKeys.push(this.curNode.data.parentId);
|
|
|
+ // // 设置选中的节点
|
|
|
+ // this.treeOption.currentNode =this.curNode.data.id
|
|
|
+ // this.$refs.avueTree.setCurrentKey(this.curNode.data.id)
|
|
|
+ // }
|
|
|
|
|
|
- })
|
|
|
- });
|
|
|
+ // })
|
|
|
+ // });
|
|
|
+ // },
|
|
|
+ //刷新左边树形数据
|
|
|
+ refreshTreeData(){
|
|
|
+ //刷新左边树形数据
|
|
|
+ if(this.curNode.level===1){
|
|
|
+ const parentId =12345678910
|
|
|
+ tabTypeLazyTreeAll({parentId,current:1,size:1000}).then(res => {
|
|
|
+ this.data=res.data.data.records;
|
|
|
+ this.$nextTick(()=>{
|
|
|
+ this.defaultExpandKey.push(this.curNode.data.id);
|
|
|
+ this.$refs.avueTree.setCurrentKey(this.curNode.data.id);
|
|
|
+
|
|
|
+ })
|
|
|
+
|
|
|
+ });
|
|
|
+ }else{
|
|
|
+
|
|
|
+ this.updateTreeNewNode()
|
|
|
+ }
|
|
|
},
|
|
|
//编辑元素表单信息
|
|
|
-
|
|
|
+ updateTreeNewNode() {
|
|
|
+ tabTypeLazyTreeAll(
|
|
|
+ {parentId:this.curTreeData.parentId,current:1,size:1000}
|
|
|
+ ).then((res) => {
|
|
|
+ this.$refs.trees.updateKeyChildren(
|
|
|
+ this.curTreeData.parentId,
|
|
|
+ res.data.data.records
|
|
|
+ );
|
|
|
+ this.$refs.avueTree.setCurrentKey(this.curNode.data.id);
|
|
|
+ });
|
|
|
+ },
|
|
|
editElement (row) {
|
|
|
console.log(row,'row');
|
|
|
this.curEleTable = row;
|