| | |
| | | this.$message.error('请至少选择一条数据'); |
| | | return; |
| | | } |
| | | ; |
| | | this.$confirm('您确定要删除所选择的数据吗?', '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | deleteLink(this.nodeRow).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.$message.success('删除成功'); |
| | | this.getTreeList(); |
| | | } |
| | | }) |
| | | }).catch(() => { |
| | | this.$message({ |
| | | type: 'info', |
| | | message: '已取消删除' |
| | | }); |
| | | }); |
| | | }, |
| | | |
| | | // 创建按钮 |
| | |
| | | |
| | | // 一致性检查 |
| | | checkClickHandler() { |
| | | checkLinkType().then(res => { |
| | | if (res && res.data && res.data.data) { |
| | | this.conCheckVisible = true; |
| | | this.conCheckLoading = true; |
| | | checkLinkType().then(res => { |
| | | if (res.data.code === 200) { |
| | | const data = res.data.data; |
| | | this.conDefaultCheckData = data; // 保留一份原始数据 |
| | |
| | | if (splitMethods[0].startsWith('_ADD')) { |
| | | outputData.push({ |
| | | id: id, |
| | | methods: '增加列(' + splitMethods[1].slice(0, -1) + ')', // 结束位置减去)的字符 |
| | | methods: '增加列(' + splitMethods[0].slice(0, -1) + ')', // 结束位置减去)的字符 |
| | | status: '未修复' |
| | | }); |
| | | } else if (splitMethods[0].startsWith('_CREATE')) { |
| | | outputData.push({ |
| | | id: id, |
| | | methods: '创建表(' + splitMethods[1].slice(0, -1) + ')', |
| | | methods: '创建表(' + splitMethods[0].slice(0, -1) + ')', |
| | | status: '未修复' |
| | | }); |
| | | } else if (splitMethods[0].startsWith('_DROP')) { |
| | | outputData.push({ |
| | | id: id, |
| | | methods: '移除列(' + splitMethods[1].slice(0, -1) + ')', |
| | | methods: '移除列(' + splitMethods[0].slice(0, -1) + ')', |
| | | status: '未修复' |
| | | }); |
| | | } else { |
| | |
| | | }); |
| | | this.conCheckData = outputData; |
| | | } |
| | | } else { |
| | | this.$message.success(res.data.msg); |
| | | } |
| | | }).catch(err => { |
| | | this.$message.error(err); |
| | | }) |
| | |
| | | |
| | | // 修复一致性检查 |
| | | repairClickHandler() { |
| | | console.log(this.conDefaultCheckData) |
| | | const params = this.conDefaultCheckData[0]; |
| | | repairTable(params).then(res => { |
| | | if (func.isEmptyObject(res.data.obj[0])) { |
| | | this.$message.success('修复成功'); |
| | | this.conCheckData = []; |
| | | } else { |
| | | this.$message.error('修复失败,请重新尝试!'); |
| | | } |
| | |
| | | this.createViewLoading = false; |
| | | this.$message.success(res.data.obj); |
| | | } |
| | | }).catch(err => { |
| | | this.createViewLoading = false; |
| | | }) |
| | | }, |
| | | |