Browse Source

情报板bug更改

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

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

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

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

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

Loading…
Cancel
Save