| | |
| | | total: 0, |
| | | }, |
| | | option: { |
| | | rowKey: "id", |
| | | treeProps: { |
| | | children: "children", |
| | | hasChildren: 'hasChildren', |
| | | }, |
| | | lazy: true, |
| | | rowKey: 'id', |
| | | addBtn: false, |
| | |
| | | ], |
| | | }, |
| | | data: [], |
| | | upData: [] |
| | | }; |
| | | }, |
| | | computed: { |
| | |
| | | return false; |
| | | }, |
| | | uploadAfter() { |
| | | alert(123) |
| | | }, |
| | | uploadmodalSubmit(row,done) { |
| | | if(this.file == null) { |
| | |
| | | // 更新节点数据 |
| | | nodes[i].children = [...newChildren]; |
| | | this.data = [...this.data]; // 替换顶层引用 |
| | | |
| | | return true; |
| | | } |
| | | if (Array.isArray(nodes[i].children) && nodes[i].children.length > 0) { |
| | |
| | | return false; |
| | | }; |
| | | updateTree(this.data); |
| | | // this.upData = JSON.parse(JSON.stringify(this.data)); |
| | | // this.data = []; |
| | | // 强制刷新 |
| | | this.$nextTick(() => { |
| | | this.$refs.crud?.refreshTable(); |
| | | //this.$refs.crud.toggleRowExpansion('0', true); |
| | | console.log(this.data,222) |
| | | //this.data = this.upData; |
| | | }); |
| | | // setTimeout(()=> { |
| | | // this.data = this.upData; |
| | | // this.option.defaultExpandAll = true; |
| | | // console.log(this.data,222) |
| | | // },3000) |
| | | }, |
| | | updateLocalTreeNode(nodeData) { //修改的方法 |
| | | const updateNode = (nodes) => { |