Browse Source

修改

wangqin
hui 9 months ago
parent
commit
0766c1eacf
  1. 10
      ruoyi-ui/src/views/JiHeExpressway/pages/service/sensitive/components/AddNEditDialog.vue
  2. 87
      ruoyi-ui/src/views/JiHeExpressway/pages/service/sensitive/index.vue

10
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 {
@ -85,13 +85,13 @@ export default {
.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',

87
ruoyi-ui/src/views/JiHeExpressway/pages/service/sensitive/index.vue

@ -1,5 +1,6 @@
<template>
<div class='sensitiveWord'>
<div class="filter">
<div>
<ButtonGradient @click.native="handleAddEdit(true)">
@ -26,30 +27,38 @@
</div>
<div class="body">
<div class="body" :style="{'overflow-y': (data.length && data.length>42) ? 'scroll':'auto' }">
<Empty v-if="!data.length && !isFirst" class="no-data" style="position: absolute">暂无数据</Empty>
<template v-else>
<div class="cardBox" v-for="(item, index) in data" :key="index">
<div class="cardBox" v-for="(item, index) in data" :key="index" style="overflow: hidden; height: 145px;">
<Card :buttonIcon="null" :keyMap="keyMap" :cardData="item" class="card"
buttonText="详情">
<template #form-word="{ data }">
<div class="keyword">
{{ data.word }}
</div>
</template>
<template #button>
<Button @click.native="() => handleAddEdit(true, item)">
修改
</Button>
<Button style="background-color: #FF5F5F;" @click.native="handleDelete(item)">
删除
</Button>
</template>
</Card>
</div>
buttonText="详情">
<template #form-word="{ data }">
<div class="keyword">
{{ data.word }}
</div>
</template>
<template #button>
<Button @click.native="() => handleAddEdit(true, item)">
修改
</Button>
<Button style="background-color: #FF5F5F;" @click.native="handleDelete(item)">
删除
</Button>
</template>
</Card>
</div>
</template>
</div>
<AddNEditDialog v-model="isShowDialog" :data="dialogData" @onSuccess = "getData" :dataAll="data"/>;
<!-- 分页 -->
<div class="footer" v-if="numTotal>0">
<Pagination :total="numTotal" :current-page.sync="currentPage" :page-size="pageSize" layout="prev, pager, next"
@size-change="handleSizeChange" @current-change="handleCurrentChange" />
</div>
<AddNEditDialog v-model="isShowDialog" :data="dialogData" @onSuccess = "getData" :dataAll="data"/>
</div>
</template>
@ -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;
}
}
</style>

Loading…
Cancel
Save