Browse Source

情报板bug更改

wangqin
zhangzhang 9 months ago
parent
commit
5cc72a6450
  1. 17
      ruoyi-ui/src/views/JiHeExpressway/components/InputSearch/index.vue
  2. 162
      ruoyi-ui/src/views/JiHeExpressway/pages/service/sensitive/index.vue

17
ruoyi-ui/src/views/JiHeExpressway/components/InputSearch/index.vue

@ -23,7 +23,7 @@
:placeholder="placeholder" :placeholder="placeholder"
@change="handleSearch" @change="handleSearch"
></ElInput> ></ElInput>
<img src="./search.svg" @click="visible = !visible" /> <img src="./search.svg" v-show="!disable" @click="visible = !visible" />
</div> </div>
<div <div
class="InputSearch" class="InputSearch"
@ -75,6 +75,7 @@ export default {
Form, Form,
}, },
props: { props: {
//
type: { type: {
type: String, type: String,
default: "form", default: "form",
@ -83,15 +84,15 @@ export default {
type: String, type: String,
default: "请点击右侧图标筛选", default: "请点击右侧图标筛选",
}, },
valueData: { // type input
type: String, disable: {
type: Boolean,
default: false,
}, },
// type input
params: { params: {
type: String, type: String,
}, },
queryParams: {
type: Array,
},
formConfigOptions: { formConfigOptions: {
type: Object, type: Object,
default: null, default: null,
@ -143,7 +144,7 @@ export default {
let params = {}; let params = {};
params[this.params] = this.value; params[this.params] = this.value;
let result = {}; let result = {};
if (!this.disable) {
await this.$refs.FormConfigRef.validate() await this.$refs.FormConfigRef.validate()
.then((res) => { .then((res) => {
result = res; result = res;
@ -152,6 +153,8 @@ export default {
.catch((err) => { .catch((err) => {
console.log("catch"); console.log("catch");
}); });
}
let resultParams = { ...result, ...params }; let resultParams = { ...result, ...params };
this.$emit("handleSearch", resultParams); this.$emit("handleSearch", resultParams);
} else { } else {

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

@ -1,5 +1,10 @@
<template> <template>
<div class='sensitiveWord' v-loading="isLoading" element-loading-text="数据加载中" element-loading-background="rgba(0, 0, 0, 0.3)"> <div
class="sensitiveWord"
v-loading="isLoading"
element-loading-text="数据加载中"
element-loading-background="rgba(0, 0, 0, 0.3)"
>
<div class="filter"> <div class="filter">
<div> <div>
<ButtonGradient @click.native="handleAddEdit(true)"> <ButtonGradient @click.native="handleAddEdit(true)">
@ -22,16 +27,37 @@
</ButtonGradient> </ButtonGradient>
</div> </div>
<InputSearch style="width: 402px;" :formList="searchFormList" :formConfigOptions="{ labelWidth: '90px' }" :placeholder="searchText" @handleSearch="handleSearch" /> <InputSearch
style="width: 402px"
type="input"
params="word"
:disable="true"
:placeholder="searchText"
@handleSearch="handleSearch"
/>
</div> </div>
<div class="body"> <div class="body">
<Empty v-if="!data.length && !isFirst" class="no-data" style="position: absolute">暂无数据</Empty> <Empty
v-if="!data.length && !isFirst"
class="no-data"
style="position: absolute"
>暂无数据</Empty
>
<template v-else> <template v-else>
<div class="cardBox" v-for="(item, index) in data" :key="index" style="overflow: hidden; height: 145px;"> <div
<Card :buttonIcon="null" :keyMap="keyMap" :cardData="item" class="card" class="cardBox"
buttonText="详情"> 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 }"> <template #form-word="{ data }">
<div class="keyword"> <div class="keyword">
{{ data.word }} {{ data.word }}
@ -41,7 +67,10 @@
<Button @click.native="() => handleAddEdit(true, item)"> <Button @click.native="() => handleAddEdit(true, item)">
修改 修改
</Button> </Button>
<Button style="background-color: #FF5F5F;" @click.native="handleDelete(item)"> <Button
style="background-color: #ff5f5f"
@click.native="handleDelete(item)"
>
删除 删除
</Button> </Button>
</template> </template>
@ -50,24 +79,34 @@
</template> </template>
</div> </div>
<!-- 分页 --> <!-- 分页 -->
<div class="footer" v-if="numTotal>0"> <div class="footer" v-if="numTotal > 0">
<Pagination :total="numTotal" :current-page.sync="currentPage" :page-size="pageSize" layout="prev, pager, next" <Pagination
@size-change="handleSizeChange" @current-change="handleCurrentChange" /> :total="numTotal"
:current-page.sync="currentPage"
:page-size="pageSize"
layout="prev, pager, next,total, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
</div> </div>
<AddNEditDialog v-model="isShowDialog" :data="dialogData" @onSuccess = "getData" :dataAll="data"/> <AddNEditDialog
v-model="isShowDialog"
:data="dialogData"
@onSuccess="getData"
:dataAll="data"
/>
</div> </div>
</template> </template>
<script> <script>
import Card from "@screen/components/Card1/index.vue" import Card from "@screen/components/Card1/index.vue";
import AddNEditDialog from "./components/AddNEditDialog.vue" import AddNEditDialog from "./components/AddNEditDialog.vue";
import InputSearch from '@screen/components/InputSearch/index.vue'; import InputSearch from "@screen/components/InputSearch/index.vue";
import ButtonGradient from '@screen/components/Buttons/ButtonGradient.vue'; import ButtonGradient from "@screen/components/Buttons/ButtonGradient.vue";
import Button from '@screen/components/Buttons/Button.vue'; import Button from "@screen/components/Buttons/Button.vue";
import Pagination from '@screen/components/Pagination.vue'; import Pagination from "@screen/components/Pagination.vue";
import { searchFormList } from "./data"; import { searchFormList } from "./data";
import request from "@/utils/request"; import request from "@/utils/request";
@ -77,44 +116,44 @@ import { Message } from "element-ui";
// //
export default { export default {
name: 'sensitiveWord', name: "sensitiveWord",
components: { components: {
Pagination, Pagination,
Card, Card,
ButtonGradient, ButtonGradient,
InputSearch, InputSearch,
AddNEditDialog, AddNEditDialog,
Button Button,
}, },
data() { data() {
return { return {
isLoading:false, isLoading: false,
searchText:"关键词搜索", searchText: "请输入敏感词,回车搜索",
searchFormList, searchFormList,
numTotal:0, numTotal: 0,
pageSize:42, pageSize: 42,
currentPage:1, currentPage: 1,
keyMap: [ keyMap: [
{ {
key: "word", key: "word",
label: "关键词" label: "关键词",
}, },
{ {
key: "id", key: "id",
label: "id" label: "id",
}, },
{ {
key: "createTime", key: "createTime",
label: "创建时间" label: "创建时间",
} },
], ],
data: [], data: [],
dialogData: null, dialogData: null,
isShowDialog: false, isShowDialog: false,
isFirst: true isFirst: true,
} };
}, },
created() { created() {
this.getData(); this.getData();
@ -125,13 +164,13 @@ export default {
let params = { let params = {
word: this.searchData?.word, word: this.searchData?.word,
pageSize: this.pageSize, pageSize: this.pageSize,
pageNum: this.currentPage pageNum: this.currentPage,
}; };
// params = { // params = {
// pageSize: 1000000, // pageSize: 1000000,
// pageNum: 1 // pageNum: 1
// }; // };
return params return params;
}, },
async handleDelete(data) { async handleDelete(data) {
await confirm({ message: "是否要删除该敏感词?" }); await confirm({ message: "是否要删除该敏感词?" });
@ -139,16 +178,16 @@ export default {
request({ request({
url: `/business/dcInfoBoardVocabulary/${data.id}`, url: `/business/dcInfoBoardVocabulary/${data.id}`,
method: "DELETE", method: "DELETE",
data: {} data: {},
}) })
.then(result => { .then((result) => {
if (result.code != 200) return Message.error("删除失败"); if (result.code != 200) return Message.error("删除失败");
Message.success("删除成功") Message.success("删除成功");
this.getData(); this.getData();
}) })
.catch(() => { .catch(() => {
Message.error("删除失败") Message.error("删除失败");
}) });
}, },
handleAddEdit(bool, data) { handleAddEdit(bool, data) {
this.isShowDialog = bool; this.isShowDialog = bool;
@ -158,7 +197,7 @@ export default {
exportFile({ exportFile({
url: "/business/dcInfoBoardVocabulary/export", url: "/business/dcInfoBoardVocabulary/export",
filename: "情报板敏感词", filename: "情报板敏感词",
data: this.getSearchData() data: this.getSearchData(),
}); });
}, },
handleSearch(data) { handleSearch(data) {
@ -174,19 +213,21 @@ export default {
request({ request({
url: `/business/dcInfoBoardVocabulary/list`, url: `/business/dcInfoBoardVocabulary/list`,
method: "get", method: "get",
params: this.getSearchData() params: this.getSearchData(),
}).then(result => { })
this.searchText = this.searchData?.word || "关键词搜索"; .then((result) => {
this.searchText = this.searchData?.word || "请输入敏感词,回车搜索";
if (result.code != 200) return; if (result.code != 200) return;
this.data = result.rows; this.data = result.rows;
this.numTotal = result.total; this.numTotal = result.total;
// this.pageTotal = Math.ceil(result.total/this.pageSize); // this.pageTotal = Math.ceil(result.total/this.pageSize);
}).finally(() => { })
.finally(() => {
this.isFirst = false; this.isFirst = false;
// closeLoading(); // closeLoading();
this.isLoading = false; this.isLoading = false;
}) });
}, },
handleSizeChange(size) { handleSizeChange(size) {
@ -196,17 +237,16 @@ export default {
handleCurrentChange(currentPage) { handleCurrentChange(currentPage) {
this.currentPage = currentPage; this.currentPage = currentPage;
this.getData(); this.getData();
} },
},
} };
}
</script> </script>
<style lang='scss' scoped> <style lang="scss" scoped>
.sensitiveWord { .sensitiveWord {
padding: 20px; padding: 20px;
display: flex; flex-direction: column; display: flex;
flex-direction: column;
.filter { .filter {
height: 60px; height: 60px;
display: flex; display: flex;
@ -220,15 +260,22 @@ export default {
} }
.body { .body {
height: 0; flex: 1; overflow: hidden; height: 0;
display: flex; flex-wrap: wrap; align-content: flex-start; flex: 1;
.cardBox{ overflow: hidden;
flex-basis: percentage(1/7); width: 0; padding-right: 10px; padding-bottom: 10px; display: flex;
flex-wrap: wrap;
align-content: flex-start;
.cardBox {
flex-basis: percentage(1/7);
width: 0;
padding-right: 10px;
padding-bottom: 10px;
} }
.keyword { .keyword {
font-size: 14px; font-size: 14px;
font-weight: bold; font-weight: bold;
color: #00B3CC; color: #00b3cc;
} }
} }
@ -239,6 +286,5 @@ export default {
align-items: center; align-items: center;
justify-content: center; justify-content: center;
} }
} }
</style> </style>

Loading…
Cancel
Save