|
@@ -2,6 +2,7 @@
|
|
|
<div class="j-container search-result-bidding top-radius">
|
|
|
<div
|
|
|
class="bidding-advanced-switch"
|
|
|
+ v-if="conf.searchGroupList.length"
|
|
|
:class="{ 'loading-mask': listState.loading }"
|
|
|
>
|
|
|
<van-tabs
|
|
@@ -30,7 +31,7 @@
|
|
|
<!-- 筛选器 -->
|
|
|
<BiddingSearchFilters
|
|
|
:bidColPower="pageState.bidColPower"
|
|
|
- class="top-radius "
|
|
|
+ class="top-radius"
|
|
|
:class="{ 'loading-mask': listState.loading }"
|
|
|
ref="searchFilters"
|
|
|
@noPower="onNoPower"
|
|
@@ -120,6 +121,25 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+ <div
|
|
|
+ class="tip-toggle-search-mode-container"
|
|
|
+ v-show="toggleBlurModeTip.show"
|
|
|
+ >
|
|
|
+ <div>
|
|
|
+ 如需查看更多相关信息,建议您将搜索模式切换为
|
|
|
+ <div class="tip-action highlight-text">
|
|
|
+ “模糊搜索”
|
|
|
+ <AppIcon
|
|
|
+ class="search-mode-label-icon"
|
|
|
+ name="help1"
|
|
|
+ @click="showSearchModeHelp"
|
|
|
+ >
|
|
|
+ </AppIcon>
|
|
|
+ </div>
|
|
|
+ 按照当前条件共匹配到{{ toggleBlurModeTip.count }}条公告。
|
|
|
+ </div>
|
|
|
+ <button @click="doToggleSearchBlurMode">立即切换查看</button>
|
|
|
+ </div>
|
|
|
<div class="list-wrapper" ref="listWrapper">
|
|
|
<van-popup
|
|
|
:style="popupHeight"
|
|
@@ -514,7 +534,7 @@ export default {
|
|
|
id: '5',
|
|
|
title: '招标结果',
|
|
|
name: 'zbjg'
|
|
|
- },
|
|
|
+ }
|
|
|
],
|
|
|
tabListFree: [
|
|
|
{
|
|
@@ -656,7 +676,11 @@ export default {
|
|
|
},
|
|
|
showBidStatus: false,
|
|
|
popupHeight: 'height: 440px',
|
|
|
- projectCellInfo: {}
|
|
|
+ projectCellInfo: {},
|
|
|
+ toggleSearchBlurData: {
|
|
|
+ show: false,
|
|
|
+ count: ''
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
@@ -835,6 +859,19 @@ export default {
|
|
|
*/
|
|
|
inInjectBI() {
|
|
|
return this.$route.name === 'search-bi-bidding'
|
|
|
+ },
|
|
|
+ // 切换模糊搜索
|
|
|
+ toggleBlurModeTip() {
|
|
|
+ const isBlurMode = this.filters.searchMode.indexOf('1') !== -1
|
|
|
+ let canShow = isBlurMode ? false : this.toggleSearchBlurData.show
|
|
|
+ if (this.listState.loading) {
|
|
|
+ canShow = false
|
|
|
+ }
|
|
|
+ const result = {
|
|
|
+ show: canShow,
|
|
|
+ count: this.toggleSearchBlurData.count
|
|
|
+ }
|
|
|
+ return result
|
|
|
}
|
|
|
},
|
|
|
provide() {
|
|
@@ -925,20 +962,35 @@ export default {
|
|
|
formatMoney,
|
|
|
dateFormatter,
|
|
|
replaceKeyword,
|
|
|
+ // 切换到模糊搜索
|
|
|
+ doToggleSearchBlurMode() {
|
|
|
+ this.switchSearchMode(1)
|
|
|
+ this.doSearch()
|
|
|
+ },
|
|
|
+ async showSearchModeHelp() {
|
|
|
+ return await this.$dialog.alert({
|
|
|
+ title: '搜索模式',
|
|
|
+ messageAlign: 'left',
|
|
|
+ className: 'j-confirm-dialog',
|
|
|
+ confirmButtonText: '我知道了',
|
|
|
+ message:
|
|
|
+ '<p>精准搜索: 搜索结果必须完全包含完整的关键词。如搜索"医疗设备" ,搜索结果一定完整包含“医疗设备”才能被搜索到,而“医疗的设备”或“设备医疗”的项目不会被搜索到。</p><br /><p>模糊搜索: 系统会先自动智能分词然后再进行搜索。如搜索"医疗设备" ,系统会自动分成“医疗”“设备”然后进行搜索,只要项目中出现“医疗”和“设备”都会被搜索到,前提是两个词必须一同出现在一则公告内,不分先后顺序。</p>'
|
|
|
+ })
|
|
|
+ },
|
|
|
initBiHeaderTab() {
|
|
|
// 山川应用下隐藏非招标结果的信息类型
|
|
|
// 仅保留['全部', '招标结果', '招标信用信息']
|
|
|
- this.searchGroupList = [
|
|
|
+ this.conf.searchGroupList = [
|
|
|
{
|
|
|
id: '0',
|
|
|
title: '全部',
|
|
|
name: ''
|
|
|
- },
|
|
|
- {
|
|
|
- id: '5',
|
|
|
- title: '招标结果',
|
|
|
- name: 'zbjg'
|
|
|
- },
|
|
|
+ }
|
|
|
+ // {
|
|
|
+ // id: '5',
|
|
|
+ // title: '招标结果',
|
|
|
+ // name: 'zbjg'
|
|
|
+ // }
|
|
|
]
|
|
|
},
|
|
|
/**
|
|
@@ -1003,7 +1055,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
initDefaultFilterState() {
|
|
|
- Object.assign(this.filters, this.defaultFilterState)
|
|
|
+ Object.assign(this.filters, JSON.parse(JSON.stringify(this.defaultFilterState)))
|
|
|
this.$nextTick(() => {
|
|
|
this.filters.keywords = this.topSearch.input
|
|
|
})
|
|
@@ -1015,11 +1067,13 @@ export default {
|
|
|
},
|
|
|
getQueryString() {
|
|
|
const { searchGroup } = this.$route.query
|
|
|
- const searchGroupMap = this.conf.searchGroupList.map((s) => s.id)
|
|
|
- if (searchGroup && searchGroupMap.includes(searchGroup)) {
|
|
|
- this.pageState.searchGroup = searchGroup
|
|
|
- } else {
|
|
|
- this.pageState.searchGroup = this.conf.searchGroupList[0].id
|
|
|
+ if (this.conf.searchGroupList.length) {
|
|
|
+ const searchGroupMap = this.conf.searchGroupList.map((s) => s.id)
|
|
|
+ if (searchGroup && searchGroupMap.includes(searchGroup)) {
|
|
|
+ this.pageState.searchGroup = searchGroup
|
|
|
+ } else {
|
|
|
+ this.pageState.searchGroup = this.conf.searchGroupList[0].id
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
calcInitFilters() {
|
|
@@ -1499,25 +1553,15 @@ export default {
|
|
|
this.$toast('精准搜索无结果,已为您自动切换到模糊搜索')
|
|
|
}
|
|
|
}
|
|
|
- } else {
|
|
|
- // 搜索结果无数据,自动切换搜索模式到模糊搜索
|
|
|
- /* 切换搜索模式逻辑 start */
|
|
|
- if (params.pageNum === 1) {
|
|
|
- if (params.searchMode === 0) {
|
|
|
- this.switchSearchMode(1)
|
|
|
- this.pageState.searchModeAutoChangedSearch = true
|
|
|
- this.doSearch({ from: 'searchModeAutoChangedSearch' })
|
|
|
- } else if (params.searchMode === 1) {
|
|
|
- if (this.pageState.searchModeAutoChangedSearch) {
|
|
|
- // 自动切换搜索模式搜索后还没查到数据,就改回精准搜索
|
|
|
- this.switchSearchMode(0)
|
|
|
- this.pageState.searchModeAutoChangedSearch = false
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- /* 切换搜索模式逻辑 end */
|
|
|
}
|
|
|
|
|
|
+ this.checkToggleSearchMode({
|
|
|
+ pageNum: params.pageNum,
|
|
|
+ count: data.total || 0,
|
|
|
+ blurCount: data?.bCount || 0,
|
|
|
+ searchMode: params.searchMode
|
|
|
+ })
|
|
|
+
|
|
|
if (params.pageNum === 1) {
|
|
|
// 保存更多关键词到历史记录中
|
|
|
this.saveAdditionalWordsToHistory()
|
|
@@ -1527,6 +1571,40 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
+ /**
|
|
|
+ * 检查是否需要切换模糊搜索、是否展示提示
|
|
|
+ * 1. 精准搜索无数据 (自动切换模糊搜索)
|
|
|
+ * 2. 精准搜索有数据,< 50,提示手动切换搜索模式
|
|
|
+ */
|
|
|
+ checkToggleSearchMode({
|
|
|
+ pageNum = 1,
|
|
|
+ searchMode = 0,
|
|
|
+ count = 0,
|
|
|
+ blurCount = 0
|
|
|
+ }) {
|
|
|
+ if (pageNum === 1) {
|
|
|
+ // 重置变量
|
|
|
+ this.toggleSearchBlurData.show = false
|
|
|
+ this.toggleSearchBlurData.count = ''
|
|
|
+
|
|
|
+ if (searchMode === 0) {
|
|
|
+ const canAutoToggleBlurMode = count < 1 && blurCount > count
|
|
|
+ const canShowToggleBlurModeTip =
|
|
|
+ count >= 1 && count < 50 && blurCount > count
|
|
|
+
|
|
|
+ if (canShowToggleBlurModeTip) {
|
|
|
+ this.toggleSearchBlurData.show = true
|
|
|
+ this.toggleSearchBlurData.count = blurCount
|
|
|
+ }
|
|
|
+
|
|
|
+ if (canAutoToggleBlurMode) {
|
|
|
+ this.switchSearchMode(1)
|
|
|
+ this.pageState.searchModeAutoChangedSearch = true
|
|
|
+ this.doSearch({ from: 'searchModeAutoChangedSearch' })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
// 切换搜索模式:精准搜索0/模糊搜索1
|
|
|
switchSearchMode(m) {
|
|
|
this.filters.searchMode = [m + '']
|
|
@@ -1610,7 +1688,8 @@ export default {
|
|
|
}
|
|
|
// 是否有附件
|
|
|
item.isFile = item?.fileExists || false
|
|
|
- item.leftTopBadgeText = item.site === '剑鱼信息发布平台' ? '业主委托项目' : ''
|
|
|
+ item.leftTopBadgeText =
|
|
|
+ item.site === '剑鱼信息发布平台' ? '业主委托项目' : ''
|
|
|
// 拟建项目独有参数
|
|
|
if (projectInfo) {
|
|
|
Object.assign(item, projectInfo)
|
|
@@ -2176,7 +2255,7 @@ export default {
|
|
|
done()
|
|
|
}
|
|
|
},
|
|
|
- formatFilterItems (item) {
|
|
|
+ formatFilterItems(item) {
|
|
|
item.scope = item.selectType
|
|
|
item.infotype = item.subtype
|
|
|
const formatted = FilterHistoryAjaxModel2ViewModel.formatAll(item)
|
|
@@ -2274,6 +2353,7 @@ export default {
|
|
|
listState: this.listState,
|
|
|
pageState: this.pageState,
|
|
|
BIInfo: this.BIInfo,
|
|
|
+ toggleSearchBlurData: this.toggleSearchBlurData,
|
|
|
recommendInfo: this.recommendInfo
|
|
|
},
|
|
|
{ storage: sessionStorage }
|
|
@@ -2374,16 +2454,15 @@ export default {
|
|
|
if (replace && Object.keys(replace).length) {
|
|
|
Object.assign(params, replace)
|
|
|
}
|
|
|
- this.$storage.set(
|
|
|
- BIDDING_SEARCH_LAST_FILTERS_CACHE_KEY,
|
|
|
- params,
|
|
|
- {
|
|
|
- login: true
|
|
|
- }
|
|
|
- )
|
|
|
+ this.$storage.set(BIDDING_SEARCH_LAST_FILTERS_CACHE_KEY, params, {
|
|
|
+ login: true
|
|
|
+ })
|
|
|
},
|
|
|
restoreSearchGroupFromLocal() {
|
|
|
- const params = this.$storage.get(BIDDING_SEARCH_GROUP_LAST_CACHE_KEY, false)
|
|
|
+ const params = this.$storage.get(
|
|
|
+ BIDDING_SEARCH_GROUP_LAST_CACHE_KEY,
|
|
|
+ false
|
|
|
+ )
|
|
|
if (params) {
|
|
|
this.pageState.searchGroup = params.searchGroup
|
|
|
}
|
|
@@ -2392,10 +2471,7 @@ export default {
|
|
|
const params = {
|
|
|
searchGroup: this.pageState.searchGroup
|
|
|
}
|
|
|
- this.$storage.set(
|
|
|
- BIDDING_SEARCH_GROUP_LAST_CACHE_KEY,
|
|
|
- params
|
|
|
- )
|
|
|
+ this.$storage.set(BIDDING_SEARCH_GROUP_LAST_CACHE_KEY, params)
|
|
|
},
|
|
|
beforeTabActiveChange(name) {
|
|
|
if (name === 'detailedList') {
|
|
@@ -2528,6 +2604,31 @@ export default {
|
|
|
}
|
|
|
</style>
|
|
|
<style lang="scss" scoped>
|
|
|
+.tip-toggle-search-mode-container {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ align-items: center;
|
|
|
+ margin: 8px 16px;
|
|
|
+ margin-top: 0;
|
|
|
+ padding: 12px 16px;
|
|
|
+ background: linear-gradient(180deg, #e8ffff 0%, #ffffff 100%);
|
|
|
+ border: 0.5px solid #2abed1;
|
|
|
+ border-radius: 8px;
|
|
|
+ color: #5f5e64;
|
|
|
+ font-size: 13px;
|
|
|
+ line-height: 20px;
|
|
|
+ .tip-action {
|
|
|
+ display: inline-flex;
|
|
|
+ align-items: center;
|
|
|
+ }
|
|
|
+ button {
|
|
|
+ margin-top: 12px;
|
|
|
+ background: #2abed1;
|
|
|
+ padding: 5px 12px;
|
|
|
+ border-radius: 4px;
|
|
|
+ color: #f7f9fa;
|
|
|
+ }
|
|
|
+}
|
|
|
.search-result-bidding {
|
|
|
background: #f5f5f5;
|
|
|
::v-deep {
|