From bf82b4786b84aa198d0b0ef54f80f422e277d1d7 Mon Sep 17 00:00:00 2001 From: hui <770260999@qq.com> Date: Tue, 6 Feb 2024 17:29:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sensitive/components/AddNEditDialog.vue | 22 ++++++++++++++++--- .../pages/service/sensitive/index.vue | 4 ++-- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/service/sensitive/components/AddNEditDialog.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/service/sensitive/components/AddNEditDialog.vue index 3cc86f02..ea6cabfd 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/service/sensitive/components/AddNEditDialog.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/service/sensitive/components/AddNEditDialog.vue @@ -4,7 +4,7 @@
- + this.checkRepeat(); @@ -38,7 +38,8 @@ export default { }, props: { visible: Boolean, - data: Object + data: Object, + dataAll: Array }, data() { return { @@ -70,11 +71,26 @@ export default { } }, methods: { + checkRepeat(word){ + let temp = _.find(this.data, { word: word }); + console.log(temp, 'ttttttttttt') + if (temp) { + this.$message.danger("该关键词已存在。") + return false + } else { + return true; + } + }, handleSubmit() { this.$refs.FormConfigRef.validate() .then((data) => { - this.submitting = true; + data.word = data.word.trim(); + + if(!this.checkRepeat(data.word)){ + return ; + } + this.submitting = true; if (this.data) data.id = this.data.id; request({ diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/service/sensitive/index.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/service/sensitive/index.vue index 505e8bd5..23b4321f 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/service/sensitive/index.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/service/sensitive/index.vue @@ -50,7 +50,7 @@ -