From 0766c1eacfa9e1c84ac0d63d5575ccfd1fef2ac5 Mon Sep 17 00:00:00 2001 From: hui <770260999@qq.com> Date: Sun, 18 Feb 2024 17:33:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sensitive/components/AddNEditDialog.vue | 10 +-- .../pages/service/sensitive/index.vue | 87 +++++++++++++------ 2 files changed, 65 insertions(+), 32 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 6538a1b9..acbc4b88 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 @@ -73,7 +73,7 @@ export default { methods: { checkRepeat(word){ let temp = _.find(this.dataAll, { word: word }); - if (temp && Object.keys(temp).length>0) { + if (temp && Object.keys(temp).length>0 && !(this.data && this.data.id==temp.id)) { this.$message.error("该关键词已存在。"); return false } else { @@ -84,14 +84,14 @@ export default { this.$refs.FormConfigRef.validate() .then((data) => { data.word = data.word.trim(); - - if(!this.checkRepeat(data.word)){ - return ; - } this.submitting = true; if (this.data) data.id = this.data.id; + if (!this.checkRepeat(data.word)) { + return; + } + request({ url: `/business/dcInfoBoardVocabulary`, method: this.data ? 'PUT' : 'POST', 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 76843925..07e3f758 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/service/sensitive/index.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/service/sensitive/index.vue @@ -1,5 +1,6 @@ @@ -59,6 +68,7 @@ import AddNEditDialog from "./components/AddNEditDialog.vue" import InputSearch from '@screen/components/InputSearch/index.vue'; import ButtonGradient from '@screen/components/Buttons/ButtonGradient.vue'; import Button from '@screen/components/Buttons/Button.vue'; +import Pagination from '@screen/components/Pagination.vue'; import { searchFormList } from "./data"; import request from "@/utils/request"; @@ -70,6 +80,7 @@ import { Message } from "element-ui"; export default { name: 'sensitiveWord', components: { + Pagination, Card, ButtonGradient, InputSearch, @@ -80,6 +91,11 @@ export default { return { searchText:"关键词搜索", searchFormList, + + numTotal:0, + pageSize:42, + currentPage:1, + keyMap: [ { key: "word", @@ -108,8 +124,8 @@ export default { getSearchData() { let params = { word: this.searchData?.word, - pageSize: 1000000, - pageNum: 1 + pageSize: this.pageSize, + pageNum: this.currentPage }; // params = { // pageSize: 1000000, @@ -162,16 +178,24 @@ export default { this.searchText = this.searchData?.word || "关键词搜索"; if (result.code != 200) return; this.data = result.rows; - // this.data = [ - // ...result.rows,...result.rows, ...result.rows, ...result.rows, ...result.rows, ...result.rows, ...result.rows, ...result.rows, ...result.rows, ...result.rows, ...result.rows - // , ...result.rows, ...result.rows, ...result.rows, ...result.rows, ...result.rows, ...result.rows, ...result.rows, ...result.rows, ...result.rows, ...result.rows - // ]; - Array.from(result.rows); + this.numTotal = result.total; + + // this.pageTotal = Math.ceil(result.total/this.pageSize); }).finally(() => { this.isFirst = false; closeLoading(); }) + }, + + handleSizeChange(size) { + this.pageSize = size; + this.getData(); + }, + handleCurrentChange(currentPage) { + this.currentPage = currentPage; + this.getData(); } + } } @@ -194,7 +218,7 @@ export default { } .body { - height: 0; flex: 1; overflow-y: scroll; + height: 0; flex: 1; display: flex; flex-wrap: wrap; align-content: flex-start; .cardBox{ flex-basis: percentage(1/7); width: 0; padding-right: 10px; padding-bottom: 10px; @@ -205,5 +229,14 @@ export default { color: #00B3CC; } } + + .footer { + margin-top: 15px; + height: 36px; + display: flex; + align-items: center; + justify-content: center; + } + }