优化显示列

(cherry picked from commit ef4943d0fad11af48916a7f096906d21be3c6917)
This commit is contained in:
Xia Zekun
2024-09-06 17:25:45 +08:00
committed by mzaxd
parent 8f46ea0b3d
commit 2d9a8e4bee
2 changed files with 53 additions and 67 deletions
-2
View File
@@ -93,8 +93,6 @@ new Vue({
Toast(e.message)
})
}
console.log('跳转到搜索页')
this.$router.push({ path: '/search/generalSearch' })
},
render: h => h(App)
}).$mount('#app')
+53 -65
View File
@@ -14,21 +14,6 @@
@search="onInputSearch"
/>
</form>
<!-- 搜索框部分 -->
<!-- <div class="top-search-div">-->
<!-- <div class="top-search-div-content">-->
<!-- <a-input-search class="input-search"-->
<!-- :class="!isHasPermission('dashboard:generalSearch:search') ? 'search-no-btn' : ''"-->
<!-- :placeholder="$t('pleaseEnter')+$t('dashboard.generalSearch.queryCondition')"-->
<!-- v-model="searchValue"-->
<!-- :maxLength="50"-->
<!-- @search="onInputSearch()">-->
<!-- <van-button type="primary" slot="enterButton">-->
<!-- <i class="iconfont icon-Searchbar_Search_icon"></i>-->
<!-- </van-button>-->
<!-- </a-input-search>-->
<!-- </div>-->
<!-- </div>-->
<!-- 筛选区域 -->
<div class="filter-area-div" ref="filterArea">
<!-- 检索方式 -->
@@ -80,42 +65,22 @@
<template v-if="dataSource && dataSource.length > 0">
<!-- 查询结果展示区域 -->
<div class="result-wrapper">
<div class="result-div" v-for="item in dataSource" :key="item.id">
<div class="result-title-wrapper">
<!-- 正在搜索标题根据搜索内容高亮显示 -->
<a-tooltip>
<template #title>
<span v-html="item.title"></span>
</template>
<p class="result-title" v-html="item.title" @click="filePreviewAll(item)"></p>
</a-tooltip>
<div class="result-source-wrapper">
<p class="result-source">{{ resourceTypeOptions.find(i => i.key === item.resourceType).label }}</p>
</div>
<div v-show="judgeAbolish(item)" class="result-source-wrapper" >
<p class="result-abolish">{{ StandardStatus.ABOLISH.text }}</p>
</div>
<p class="result-date">{{ $t('dashboard.generalSearch.releaseDate') }} {{ item.releaseDate || global.emptyLine }}</p>
</div>
<van-cell v-for="item in dataSource" :key="item.id" @click="filePreviewAll(item)">
<template #title class="result-title-wrapper">
<span class="result-title" v-html="item.title" ></span>
<br/>
<van-tag color="#E63636" class="result-source">{{ getTagLabel(item) }}</van-tag>
<div class="inline"> &nbsp; </div>
<van-tag color="#B7B7B7" class="result-abolish" v-show="judgeAbolish(item)" >{{ StandardStatus.ABOLISH.text }}</van-tag>
<p class="inline-right">{{ item.releaseDate || global.emptyLine }}</p>
</template>
<template v-if="retrievalModeCurrent === '1'">
<!-- 全文检索 -->
<div v-html="item.content" class="result-content-wrapper"></div>
</template>
</div>
</van-cell>
</div>
<!-- <a-pagination-->
<!-- v-if="dataSource && dataSource.length > 0"-->
<!-- class="page-content"-->
<!-- show-quick-jumper-->
<!-- show-size-changer-->
<!-- v-model="ipagination.current"-->
<!-- :pageSize="ipagination.pageSize"-->
<!-- :pageSizeOptions="ipagination.pageSizeOptions"-->
<!-- :total="ipagination.total"-->
<!-- :showTotal="ipagination.showTotal"-->
<!-- @change="pageChange"-->
<!-- @showSizeChange="pageSizeChange"-->
<!-- />-->
<van-pagination
v-if="dataSource && dataSource.length > 0"
class="page-content"
@@ -132,12 +97,6 @@
@showSizeChange="pageSizeChange"
force-ellipses
/>
<!-- <van-pagination-->
<!-- v-model="currentPage"-->
<!-- :total-items="125"-->
<!-- :show-page-size="3"-->
<!-- force-ellipses-->
<!-- />-->
</template>
<van-empty v-else class="empty-content" description="暂无数据" />
@@ -270,6 +229,11 @@ export default {
methods: {
isHasPermission,
getTagLabel (item) {
const resourceTypeOption = this.resourceTypeOptions.find(i => i.key === item.resourceType)
if (resourceTypeOption && resourceTypeOption.label) return resourceTypeOption.label
},
loadResultFromSession () {
// 从session获取搜索结果
this.searchParam = JSON.parse(sessionStorage.getItem('searchParam'))
@@ -408,6 +372,8 @@ export default {
}
this.loading = true
func(this.searchParam).then(res => {
console.log('res', res)
this.loading = false
if (res.success) {
this.dataSource = res.result.records
if (res.result.total) {
@@ -769,6 +735,16 @@ export default {
<style scoped lang="less">
@import '~@assets/less/common.less';
.custom-title {
margin-right: 4px;
vertical-align: middle;
}
.search-icon {
font-size: 16px;
line-height: inherit;
}
//居中
.center-flex {
display: flex;
@@ -894,6 +870,20 @@ export default {
word-wrap: break-word;
}
.result-title {
color: #1D2129;
font-size: 14px;
font-family: PingFang SC-Semibold, PingFang SC;
font-weight: 600;
line-height: 28px;
margin-right: 20px;
max-height: calc(100% - 340px);
//overflow: hidden;
//text-overflow: ellipsis;
//white-space: nowrap;
//cursor: pointer;
}
// 单个查询结果
.result-div {
width: 100%;
@@ -910,19 +900,7 @@ export default {
p {
margin-bottom: 0;
}
.result-title {
color: #1D2129;
font-size: 18px;
font-family: PingFang SC-Semibold, PingFang SC;
font-weight: 600;
line-height: 28px;
margin-right: 20px;
max-height: calc(100% - 340px);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
cursor: pointer;
}
.result-source-wrapper {
min-width: 100px;
}
@@ -1008,4 +986,14 @@ export default {
}
}
}
.inline-right{
display: inline-block;
float: right;
}
.inline{
display: inline-block;
}
</style>