|
|
@ -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> |
|
|
|