From 9c27738b08abfca968525b5a1f37fb0654751c50 Mon Sep 17 00:00:00 2001 From: zqx0221 <2119066161@qq.com> Date: Tue, 27 Jul 2021 15:37:40 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E9=93=BE=E6=8E=A5=E7=AE=A1=E7=90=86=20?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E9=93=BE=E6=8E=A5=E4=BA=8C=E6=AC=A1=E5=BC=B9?= =?UTF-8?q?=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/config/pages/linkManage/index.vue | 106 ++++++++++++-------- 1 file changed, 65 insertions(+), 41 deletions(-) diff --git a/src/pages/config/pages/linkManage/index.vue b/src/pages/config/pages/linkManage/index.vue index 783a6a8dc..6f7caa83e 100644 --- a/src/pages/config/pages/linkManage/index.vue +++ b/src/pages/config/pages/linkManage/index.vue @@ -163,33 +163,46 @@ }, //表格中操作列删除操作弹窗 deleteLink (row) { + this.$confirm('此操作将删除该链接, 是否继续?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + this.$http.delete('sarUrl/tsUrl/delete', { - id: row.id + id: row.id }, { - _this: this, - loading: 'Loading' + _this: this, + loading: 'Loading' }, res => { - if (res.ok) { - this.$message.success('删除成功') - let arr = [] - for (let a = 0; a < this.linkList.length; a++) { - if (this.linkList[a].id === row.id) { - this.linkList.splice(a, 1) - } - } - this.linkList.forEach((item, index) => { - let json = {} - json.id = item.id - json.orderBy = index + 1 - arr.push(json) - }) - this.$http.putData('sarUrl/tsUrl/updateOrder', JSON.stringify(arr), {}, res => { - this.getLink() - }) - }else { - this.$message.warning(res.message) + if (res.ok) { + this.$message.success('删除成功') + let arr = [] + for (let a = 0; a < this.linkList.length; a++) { + if (this.linkList[a].id === row.id) { + this.linkList.splice(a, 1) + } } + this.linkList.forEach((item, index) => { + let json = {} + json.id = item.id + json.orderBy = index + 1 + arr.push(json) + }) + this.$http.putData('sarUrl/tsUrl/updateOrder', JSON.stringify(arr), {}, res => { + this.getLink() + }) + }else { + this.$message.warning(res.message) + } }) + }).catch(() => { + this.$message({ + type: 'info', + message: '已取消删除' + }); + }); + }, //头部删除按钮 deleteAllLink() { @@ -202,28 +215,39 @@ this.$message.warning('请选择要删除的链接') } else { this.modalRole = true + this.$confirm('此操作将删除链接, 是否继续?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { this.$http.delete('sarUrl/tsUrl/deleteBatch', { - ids: this.ids + ids: this.ids }, {}, res => { - if (res.ok) { - this.$message.success('删除成功') - let arr = this.linkList.filter(items => { - if (!this.ids.includes(items.id)) return items; - }) - let newArr = [] - arr.forEach((item, index) => { - let json = {} - json.id = item.id - json.orderBy = index + 1 - newArr.push(json) - }) - this.$http.putData('sarUrl/tsUrl/updateOrder', JSON.stringify(newArr), {}, res => { - this.getLink() - }) - }else { - this.$message.warning(res.message) - } + if (res.ok) { + this.$message.success('删除成功') + let arr = this.linkList.filter(items => { + if (!this.ids.includes(items.id)) return items; + }) + let newArr = [] + arr.forEach((item, index) => { + let json = {} + json.id = item.id + json.orderBy = index + 1 + newArr.push(json) + }) + this.$http.putData('sarUrl/tsUrl/updateOrder', JSON.stringify(newArr), {}, res => { + this.getLink() + }) + }else { + this.$message.warning(res.message) + } }) + }).catch(() => { + this.$message({ + type: 'info', + message: '已取消删除' + }); + }); } }, //弹窗关闭操作