| | |
| | | old_dirDat: [], //el树数据(拖动前) |
| | | newData: [], //拖动后原始数据 |
| | | itemdetail: {}, |
| | | itemaName: null, |
| | | backUpData: '', |
| | | formLabelWidth: '150px', |
| | | delChildID: '', |
| | |
| | | this.oriData = res.result; |
| | | this.newData = res.result; |
| | | this.dirList = this.treeData(res.result); |
| | | // this.$nextTick(() => { |
| | | |
| | | if (this.itemdetail.id != null) { |
| | | // this.expandData=[15] |
| | | // this.$refs.tree.setCurrentKey(15); |
| | | |
| | | // }); |
| | | if (this.itemaName != null) { |
| | | this.$nextTick(() => { |
| | | |
| | | // this.expandData=[1] |
| | | // this.$refs.tree.setCurrentKey(this.itemdetail.id); |
| | | // document.getElementById(this.itemdetail.id).click(); |
| | | this.expandData = [this.itemaName] |
| | | this.$refs.tree.setCurrentKey(this.itemaName); |
| | | |
| | | }); |
| | | } |
| | | |
| | |
| | | if (res == 1) {//新增同级 |
| | | id = this.itemdetail.pid; |
| | | orderNum = this.getMaxOrderNum(this.newNode.parent.childNodes) |
| | | |
| | | lever = this.itemdetail.level; |
| | | } else if (res == 2) {//新增子级 |
| | | id = this.itemdetail.id; |
| | | orderNum = this.getMaxOrderNum(this.newNode.childNodes) |
| | | |
| | | lever = this.itemdetail.level + 1; |
| | | } |
| | | |
| | |
| | | .then((res) => { |
| | | setTimeout(() => { |
| | | this.fullscreenLoading = false; |
| | | |
| | | if (res.code == 200) { |
| | | this.$message({ |
| | | message: '添加成功', |
| | | type: 'success', |
| | | }); |
| | | |
| | | this.itemaName = res.result; |
| | | this.itemdetail = {}; |
| | | this.ruleForm = {}; |
| | | this.dialogFormVisible = false; |
| | |
| | | }); |
| | | }, |
| | | remove(node, data) { |
| | | this.itemaName =node.parent.data.id; |
| | | |
| | | this.$confirm('此操作将删除该节点, 是否继续?', '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | |
| | | message: '删除成功!', |
| | | }); |
| | | this.itemdetail = {}; |
| | | |
| | | this.getDirTree(); |
| | | } else if (res[0].code == 200) { |
| | | this.$message.error('删除成功,位置调整失败'); |
| | |
| | | }, |
| | | handleNodeClick(data, node) { |
| | | // console.log(data); |
| | | |
| | | this.newNode = node; |
| | | this.backUpData = JSON.stringify(data); |
| | | this.itemdetail = JSON.parse(JSON.stringify(data)); |