|
@@ -732,22 +732,51 @@ export default {
|
|
|
this.formulaCurRow.globaltype = type;
|
|
|
},
|
|
|
//刷新左边树形数据
|
|
|
- refreshTree(){
|
|
|
+ // refreshTree(){
|
|
|
+ // //刷新左边树形数据
|
|
|
+ // const parentId =12345678910
|
|
|
+ // tabTypeLazyTree({parentId,projectId:this.projectid,current:1,size:1000}).then(res => {
|
|
|
+ // this.data=res.data.data.records;
|
|
|
+ // this.$nextTick(()=>{
|
|
|
+ // if(this.curNode.level==2){
|
|
|
+ // this.defaultExpandKey.push(this.curNode.data.parentId)
|
|
|
+ // }else{
|
|
|
+ // this.defaultExpandKey.push(this.curNode.data.id)
|
|
|
+ // }
|
|
|
+
|
|
|
+ // })
|
|
|
+
|
|
|
+ // });
|
|
|
+ // },
|
|
|
+ refreshTree(){
|
|
|
//刷新左边树形数据
|
|
|
- const parentId =12345678910
|
|
|
- tabTypeLazyTree({parentId,projectId:this.projectid,current:1,size:1000}).then(res => {
|
|
|
+ if(this.curNode.level===1){
|
|
|
+ const parentId =12345678910
|
|
|
+ tabTypeLazyTree({parentId,projectId:this.projectid,current:1,size:1000}).then(res => {
|
|
|
this.data=res.data.data.records;
|
|
|
this.$nextTick(()=>{
|
|
|
- if(this.curNode.level==2){
|
|
|
- this.defaultExpandKey.push(this.curNode.data.parentId)
|
|
|
- }else{
|
|
|
- this.defaultExpandKey.push(this.curNode.data.id)
|
|
|
- }
|
|
|
+ this.defaultExpandKey.push(this.curNode.data.id);
|
|
|
+ this.$refs.trees.setCurrentKey(this.curNode.data.id);
|
|
|
|
|
|
})
|
|
|
|
|
|
});
|
|
|
- }
|
|
|
+ }else{
|
|
|
+
|
|
|
+ this.updateTreeNewNode()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ updateTreeNewNode() {
|
|
|
+ tabTypeLazyTree(
|
|
|
+ {parentId:this.curTreeData.parentId,projectId:this.projectid,current:1,size:1000}
|
|
|
+ ).then((res) => {
|
|
|
+ this.$refs.trees.updateKeyChildren(
|
|
|
+ this.curTreeData.parentId,
|
|
|
+ res.data.data.records
|
|
|
+ );
|
|
|
+ this.$refs.trees.setCurrentKey(this.curNode.data.id);
|
|
|
+ });
|
|
|
+ },
|
|
|
// getNodeDetail(data, node) {
|
|
|
// let parentName = "";
|
|
|
// if (node.parent.data) {
|