From 2959a7ec7cfcb7b92950d67abba37059561c5109 Mon Sep 17 00:00:00 2001 From: liaozetao <1107136310@qq.com> Date: Thu, 21 Mar 2024 15:06:26 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=96=E6=B6=88=E6=96=B0=E5=A2=9E=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/lucky/LuckyGiftRangeConfigView.vue | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/views/lucky/LuckyGiftRangeConfigView.vue b/src/views/lucky/LuckyGiftRangeConfigView.vue index 797d6b8..62a51d5 100644 --- a/src/views/lucky/LuckyGiftRangeConfigView.vue +++ b/src/views/lucky/LuckyGiftRangeConfigView.vue @@ -109,6 +109,7 @@ export default { return { isEdit: false, items: [], + cache: {}, }; }, setup() { @@ -133,6 +134,7 @@ export default { $this.renderTableInfo(); }); $(".js-add").click(function () { + $this.cache = {}; $("#minValue").val(""); $("#maxValue").val(""); $("#addModal").modal("show"); @@ -161,6 +163,10 @@ export default { minValue: minValue, maxValue: maxValue, }; + this.cache = { + minValue: minValue, + maxValue: maxValue, + }; this.items.splice(this.items.length, 0, item); this.items = this.items.sort((a, b) => { if (a.minValue < b.minValue) { @@ -182,6 +188,16 @@ export default { if (apiResult(res)) { this.disableTableInfo(); this.getTableInfo(); + } else { + let cache = this.cache; + let items = this.items; + for (let i = 0; i < items.length; i++) { + let item = items[i]; + if (cache.minValue == item.minValue && cache.maxValue == item.maxValue) { + this.items.splice(i, 1); + break; + } + } } }); }, @@ -224,7 +240,7 @@ export default { ); } else { tds.push( - `