[update] 修改检索历史

This commit is contained in:
lideqin
2023-11-17 11:18:13 +08:00
parent f1e8ec4888
commit 3dcb4e9eb9
7 changed files with 112 additions and 38 deletions
+31 -3
View File
@@ -1,8 +1,8 @@
@font-face { @font-face {
font-family: "iconfont"; /* Project id 4236293 */ font-family: "iconfont"; /* Project id 4236293 */
src: url('iconfont.woff2?t=1700117916443') format('woff2'), src: url('iconfont.woff2?t=1700186751229') format('woff2'),
url('iconfont.woff?t=1700117916443') format('woff'), url('iconfont.woff?t=1700186751229') format('woff'),
url('iconfont.ttf?t=1700117916443') format('truetype'); url('iconfont.ttf?t=1700186751229') format('truetype');
} }
.iconfont { .iconfont {
@@ -13,6 +13,34 @@
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
} }
.icon-a-moxingkuaisuchaifen1:before {
content: "\e60a";
}
.icon-jiaoseguanli:before {
content: "\e60b";
}
.icon-right:before {
content: "\e665";
}
.icon-wenda1:before {
content: "\e65e";
}
.icon-shengchanliuchengguanli:before {
content: "\e62a";
}
.icon-shoucang:before {
content: "\e6d9";
}
.icon-a-fagui1:before {
content: "\eb13";
}
.icon-settings:before { .icon-settings:before {
content: "\e699"; content: "\e699";
} }
File diff suppressed because one or more lines are too long
+49
View File
@@ -5,6 +5,55 @@
"css_prefix_text": "icon-", "css_prefix_text": "icon-",
"description": "", "description": "",
"glyphs": [ "glyphs": [
{
"icon_id": "38153617",
"name": "moxingkuaisuchaifen 1",
"font_class": "a-moxingkuaisuchaifen1",
"unicode": "e60a",
"unicode_decimal": 58890
},
{
"icon_id": "38153616",
"name": "jiaoseguanli",
"font_class": "jiaoseguanli",
"unicode": "e60b",
"unicode_decimal": 58891
},
{
"icon_id": "248926",
"name": "right",
"font_class": "right",
"unicode": "e665",
"unicode_decimal": 58981
},
{
"icon_id": "1071031",
"name": "问答1",
"font_class": "wenda1",
"unicode": "e65e",
"unicode_decimal": 58974
},
{
"icon_id": "6241671",
"name": "生产流程管理",
"font_class": "shengchanliuchengguanli",
"unicode": "e62a",
"unicode_decimal": 58922
},
{
"icon_id": "9874518",
"name": "KHCFDC_收藏",
"font_class": "shoucang",
"unicode": "e6d9",
"unicode_decimal": 59097
},
{
"icon_id": "35203462",
"name": "法规 (1)",
"font_class": "a-fagui1",
"unicode": "eb13",
"unicode_decimal": 60179
},
{ {
"icon_id": "8106221", "icon_id": "8106221",
"name": "settings", "name": "settings",
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -10,19 +10,21 @@
<a-spin :spinning="confirmLoading"> <a-spin :spinning="confirmLoading">
<template v-if="model && Object.keys(model).length > 0"> <template v-if="model && Object.keys(model).length > 0">
<div v-for="(item, key) in model" :key="key" class="content-wrapper" ref="contentWrapper" @scroll="contentWrapperScroll"> <div class="content-wrapper" ref="contentWrapper" @scroll="contentWrapperScroll">
<p class="time-p">{{ isCurrentDate(key) ? '最近' : key }}</p>
<a-checkbox-group @change="onCheckChange"> <a-checkbox-group @change="onCheckChange">
<div v-for="arrItem in item" :key="arrItem.id" class="search-value-div"> <template v-for="(item, key) in model">
<a-checkbox :value="arrItem.id"></a-checkbox> <p :key="key" class="time-p">{{ isCurrentDate(key) ? '最近' : key }}</p>
<a-tooltip> <div v-for="arrItem in item" :key="arrItem.id" class="search-value-div">
<template #title> <a-checkbox :value="arrItem.id"></a-checkbox>
{{ arrItem.searchContent }} <a-tooltip>
</template> <template #title>
<p>{{ arrItem.searchContent }}</p> {{ arrItem.searchContent }}
</a-tooltip> </template>
<i class="iconfont icon-shanchu_" @click="handleDelete(arrItem.id)"></i> <p>{{ arrItem.searchContent }}</p>
</div> </a-tooltip>
<i class="iconfont icon-shanchu_" @click="handleDelete(arrItem.id)"></i>
</div>
</template>
</a-checkbox-group> </a-checkbox-group>
</div> </div>
<!--<div class="record-item" v-for="record in recordList" :key="record.id">--> <!--<div class="record-item" v-for="record in recordList" :key="record.id">-->
@@ -68,7 +70,7 @@ export default {
open () { open () {
this.page = { this.page = {
pageNo: 1, pageNo: 1,
pageSize: 20, pageSize: 100,
total: 0, total: 0,
pages: 0 pages: 0
} }
@@ -89,7 +91,7 @@ export default {
}, },
// 内容展示区域滚动事件 // 内容展示区域滚动事件
contentWrapperScroll () { contentWrapperScroll () {
const contentWrapper = this.$refs.contentWrapper[0] const contentWrapper = this.$refs.contentWrapper
// 滚动条触底,并且还不是最后一页时获取下一页 // 滚动条触底,并且还不是最后一页时获取下一页
if (contentWrapper.scrollTop + contentWrapper.clientHeight === contentWrapper.scrollHeight && this.page.pageNo < this.page.pages) { if (contentWrapper.scrollTop + contentWrapper.clientHeight === contentWrapper.scrollHeight && this.page.pageNo < this.page.pages) {
this.page.pageNo++ this.page.pageNo++
@@ -97,7 +99,10 @@ export default {
} }
}, },
// 获取列表数据 // 获取列表数据
initData () { initData (arg) {
if (arg === 1) {
this.page.pageNo = 1
}
const param = {} const param = {}
param.pageNo = this.page.pageNo param.pageNo = this.page.pageNo
param.pageSize = this.page.pageSize param.pageSize = this.page.pageSize
@@ -124,18 +129,6 @@ export default {
this.confirmLoading = false this.confirmLoading = false
}) })
}, },
// 重新计算分页
reCalculatePage (count) {
// 总数量-count
const total = this.page.total - count
// 获取删除后的分页数
const currentIndex = Math.ceil(total / this.page.pageSize)
// 删除后的分页数<所在当前页
if (currentIndex < this.page.pageNo) {
this.page.current = currentIndex
}
console.log('currentIndex', currentIndex)
},
// 多选变化 // 多选变化
onCheckChange (checkedValue) { onCheckChange (checkedValue) {
this.checkedArr = checkedValue this.checkedArr = checkedValue
@@ -146,10 +139,12 @@ export default {
if (res.success) { if (res.success) {
this.$message.success(res.message) this.$message.success(res.message)
// 判断当前删除的数据是否是最后一页的最后一条数据,如果是的话页码减一 // 判断当前删除的数据是否是最后一页的最后一条数据,如果是的话页码减一
if (this.page.pageNo > 1 && ((this.page.pageNo - 1) * this.page.pageSize) + 1 === this.page.total) { // if (this.page.pageNo > 1 && ((this.page.pageNo - 1) * this.page.pageSize) + 1 === this.page.total) {
this.page.pageNo -= 1 // this.page.pageNo -= 1
} // }
this.initData() this.model = {}
this.dataList = []
this.initData(1)
} else { } else {
this.$message.warning(res.message) this.$message.warning(res.message)
} }
@@ -157,12 +152,13 @@ export default {
}, },
// 批量删除 // 批量删除
handleBatchDel () { handleBatchDel () {
batchDeleteSearchHistory({ ids: this.checkedArr.join(',') }).then(res => { batchDeleteSearchHistory({ id: this.checkedArr.join(',') }).then(res => {
if (res.success) { if (res.success) {
this.reCalculatePage(this.checkedArr.length)
this.$message.success(res.message) this.$message.success(res.message)
this.checkedArr = [] this.checkedArr = []
this.initData() this.model = {}
this.dataList = []
this.initData(1)
} else { } else {
this.$message.warning(res.message) this.$message.warning(res.message)
} }
@@ -186,6 +182,7 @@ export default {
overflow-y: auto; overflow-y: auto;
} }
.time-p { .time-p {
margin: 10px 0;
color: @primary-color; color: @primary-color;
} }
/deep/ .ant-checkbox-group { /deep/ .ant-checkbox-group {