|
@@ -1,10 +1,15 @@
|
|
|
-import { computed, reactive, ref, toRefs, onMounted, getCurrentInstance } from 'vue'
|
|
|
+import { computed, reactive, ref, toRefs, onMounted, onBeforeUnmount, getCurrentInstance } from 'vue'
|
|
|
import { without, throttle } from 'lodash'
|
|
|
import { useStore } from '@/store'
|
|
|
import { useRoute, useRouter } from 'vue-router/composables'
|
|
|
import { MessageBox } from 'element-ui'
|
|
|
-import { mixinVisited } from '@/utils/mixins/visited-setup.js'
|
|
|
-import { FilterHistoryAjaxModelRestore, getParam, openLinkInWorkspace, InContainer} from '@/utils'
|
|
|
+import {
|
|
|
+ FilterHistoryAjaxModelRestore,
|
|
|
+ FilterHistoryAjaxModel2ViewModel,
|
|
|
+ getParam,
|
|
|
+ openLinkInWorkspace,
|
|
|
+ InContainer
|
|
|
+} from '@/utils'
|
|
|
import $bus from '@/utils/bus'
|
|
|
// 筛选条件动态组件方法
|
|
|
import { getCreateSearchSchema } from '@/views/search/bidding/constant/index'
|
|
@@ -29,7 +34,10 @@ import { joinBidActionsModel } from './modules/join-bid-actions'
|
|
|
import { dataEmployActionsModel } from './modules/data-employ-actions'
|
|
|
// 添加业务
|
|
|
import { dataAddActionsModel } from './modules/data-add-actions'
|
|
|
-
|
|
|
+// 进行搜索前业务判断
|
|
|
+import { beforeSearchModel } from './modules/before-search'
|
|
|
+// 潜在客户引流--市场分析报告&&超前项目推荐数据请求
|
|
|
+import { recommendCardModel } from './modules/recommend-card'
|
|
|
|
|
|
export default function () {
|
|
|
const that = getCurrentInstance().proxy
|
|
@@ -68,6 +76,7 @@ export default function () {
|
|
|
|
|
|
|
|
|
// 是否在工作台内
|
|
|
+ // 本地调试,可改为工作台内isInApp = ref(true), isInWeb = ref(false) 提交记得改回!
|
|
|
const isInApp = ref(InContainer.inApp)
|
|
|
const isInWeb = ref(InContainer.inWeb)
|
|
|
|
|
@@ -95,16 +104,33 @@ export default function () {
|
|
|
return inResourceBIIframe || inResourceBIIframe || inInjectBI
|
|
|
})
|
|
|
|
|
|
+ // 是否是领域化页面(医械通)
|
|
|
+ const isBidField = location.href.includes('/jylab/medical/index')
|
|
|
+
|
|
|
+ // 缓存存储配置
|
|
|
+ const storageConfig = {
|
|
|
+ listTab: {
|
|
|
+ key: 'pc_search_bidding_listTabActive',
|
|
|
+ _storage: localStorage
|
|
|
+ },
|
|
|
+ // 筛选条件上次搜索筛选项缓存key
|
|
|
+ filter: {
|
|
|
+ key: 'pc_search_bidding_lastFilters',
|
|
|
+ _storage: localStorage
|
|
|
+ },
|
|
|
+ // 页面tab(筛选项的searchGroup)
|
|
|
+ searchGroup: {
|
|
|
+ key: 'pc_search_bidding_lastSearchGroup',
|
|
|
+ _storage: localStorage
|
|
|
+ }
|
|
|
+ }
|
|
|
// 解构基础业务
|
|
|
const APIModel = useQuickSearchModel({
|
|
|
type: 'search-bid'
|
|
|
})
|
|
|
- const {
|
|
|
- pathVisiting,
|
|
|
- createPathItem,
|
|
|
- pathVisited
|
|
|
- } = mixinVisited()
|
|
|
-
|
|
|
+ /**
|
|
|
+ * 列表相关model
|
|
|
+ */
|
|
|
const {
|
|
|
list,
|
|
|
total,
|
|
@@ -121,16 +147,34 @@ export default function () {
|
|
|
doClearAllSelection,
|
|
|
doQuery: doRunQuery
|
|
|
} = APIModel
|
|
|
-
|
|
|
+ /**
|
|
|
+ * 关键词搜索相关
|
|
|
+ */
|
|
|
const {
|
|
|
inputKeywordsState,
|
|
|
searchModelOptions,
|
|
|
- getFormatAPIParams: getFormatOfInputKeywords
|
|
|
+ getFormatAPIParams: getFormatOfInputKeywords,
|
|
|
+ updateInputKeywordsState,
|
|
|
} = useSearchInputKeywordsModel()
|
|
|
+ /**
|
|
|
+ * 筛选v-model数据
|
|
|
+ */
|
|
|
const {
|
|
|
filterState,
|
|
|
+ filterBase,
|
|
|
getFormatAPIParams: getFormatOfFilter,
|
|
|
- } = useSearchFilterModel({ inBIPropertyIframe })
|
|
|
+ updateFilterBase
|
|
|
+ } = useSearchFilterModel({ inBIPropertyIframe, isFree, isInApp, isBidField })
|
|
|
+ /**
|
|
|
+ * 搜索前校验
|
|
|
+ */
|
|
|
+ const {
|
|
|
+ onTheWhiteList,
|
|
|
+ checkAndClearTextIncludesCommonWords
|
|
|
+ } = beforeSearchModel({ inputKeywordsState })
|
|
|
+ /**
|
|
|
+ * 列表头操作
|
|
|
+ */
|
|
|
const {
|
|
|
limitActions,
|
|
|
headerActions,
|
|
@@ -140,9 +184,14 @@ export default function () {
|
|
|
disabledHeaderActions
|
|
|
} = useSearchListHeaderActionsModel()
|
|
|
|
|
|
- // 页面tab切换Model
|
|
|
+ $bus.$on('bidding:updateInputKeywords', function (obj) {
|
|
|
+ updateInputKeywordsState(obj)
|
|
|
+ })
|
|
|
|
|
|
- const SearchTabsModel = useSearchTabsModel({ showTabs2: !isInApp.value })
|
|
|
+ /**
|
|
|
+ * 页面tab切换Model
|
|
|
+ */
|
|
|
+ const SearchTabsModel = useSearchTabsModel({ showTabs2: !isInApp.value, inInjectBI })
|
|
|
const { activeTab, doChangeTab } = SearchTabsModel
|
|
|
// tab切换处理
|
|
|
function onChangeTab (item) {
|
|
@@ -151,14 +200,17 @@ export default function () {
|
|
|
})
|
|
|
doChangeTab(item)
|
|
|
if(isInApp.value) {
|
|
|
- doQuery()
|
|
|
+ doQuery({}, 'tab')
|
|
|
} else {
|
|
|
if(item.link) {
|
|
|
- location.replace(item.link)
|
|
|
+ window.location.replace(item.link)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- // 筛选条件动态配置处理
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 筛选条件动态配置处理
|
|
|
+ */
|
|
|
const {
|
|
|
createSearchBidBaseSchema,
|
|
|
createSearchBidMoreSchema
|
|
@@ -189,7 +241,9 @@ export default function () {
|
|
|
vipUser: isVip.value && isInApp.value,
|
|
|
oldUser: isOld.value && isInApp.value,
|
|
|
showVip: isLogin.value && isInApp.value,
|
|
|
- infoType: infoTypeDataType.value
|
|
|
+ infoType: infoTypeDataType.value,
|
|
|
+ isBidField: isBidField,
|
|
|
+ inInjectBI: inInjectBI
|
|
|
}
|
|
|
})
|
|
|
|
|
@@ -201,7 +255,7 @@ export default function () {
|
|
|
const searchBidMoreVipSchema = ref([])
|
|
|
|
|
|
SearchBidBaseSchema.value = createSearchBidBaseSchema(conf.value)
|
|
|
- SearchBidMoreSchema.value = createSearchBidMoreSchema()
|
|
|
+ SearchBidMoreSchema.value = createSearchBidMoreSchema(conf.value)
|
|
|
|
|
|
searchBidMoreFreeSchema.value = SearchBidMoreSchema.value?.filter(
|
|
|
(s) => !s.vipMark
|
|
@@ -211,9 +265,13 @@ export default function () {
|
|
|
)
|
|
|
|
|
|
|
|
|
- function doUpdateData(schema) {
|
|
|
+ function doUpdateData(schema, type) {
|
|
|
const payload = schema || conf.value
|
|
|
- SearchBidBaseSchema.value = createSearchBidBaseSchema(payload)
|
|
|
+ if(type === 'more') {
|
|
|
+ SearchBidMoreSchema.value = createSearchBidMoreSchema(payload)
|
|
|
+ } else {
|
|
|
+ SearchBidBaseSchema.value = createSearchBidBaseSchema(payload)
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
return {
|
|
@@ -231,9 +289,9 @@ export default function () {
|
|
|
loading,
|
|
|
pageNum: 1,
|
|
|
pageSize: 50,
|
|
|
- total
|
|
|
+ total,
|
|
|
+ pageTotal: 0
|
|
|
})
|
|
|
-
|
|
|
// 当前展示的列表
|
|
|
const activeList = computed(() => {
|
|
|
return list.value.map((v) => {
|
|
@@ -242,6 +300,14 @@ export default function () {
|
|
|
return v
|
|
|
})
|
|
|
})
|
|
|
+ // 表格展示的数据
|
|
|
+ const tableList = ref([])
|
|
|
+
|
|
|
+ // 搜索关键词限制
|
|
|
+ const interceptKeywords = reactive({
|
|
|
+ interceptOtherWords: '',
|
|
|
+ interceptLimit: 0
|
|
|
+ })
|
|
|
|
|
|
// 根据权限处理列表头部的操作按钮展示
|
|
|
const limitFilterHeaderActions = computed(() => {
|
|
@@ -266,7 +332,7 @@ export default function () {
|
|
|
limitActions.value['employ-bid'] = true
|
|
|
}
|
|
|
// 展示分发
|
|
|
- if(isEntAdmin.value || isDepartmentAdmin.value) {
|
|
|
+ if((isEntAdmin.value || isDepartmentAdmin.value) && !inBIPropertyIframe && !inResourceBIIframe) {
|
|
|
limitActions.value['distribute-bid'] = true
|
|
|
}
|
|
|
return headerActions.value
|
|
@@ -300,8 +366,31 @@ export default function () {
|
|
|
...styleTypes
|
|
|
)
|
|
|
activeHeaderActions.value.push(type)
|
|
|
+ // 记录列表风格切换--存到缓存
|
|
|
+ if(type !== 'table') {
|
|
|
+ const { _storage, key } = storageConfig['listTab']
|
|
|
+ _storage.setItem(key, type)
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 恢复以前选过的tab
|
|
|
+ */
|
|
|
+ function restoreListTabActive() {
|
|
|
+ const { _storage, key } = storageConfig['listTab']
|
|
|
+ const storage = _storage.getItem(key)
|
|
|
+ if (storage) {
|
|
|
+ if(storage === 'detailed-list' && isVip.value && isLogin.value) {
|
|
|
+ doChangeItemStyleType('detailed-list')
|
|
|
+ } else {
|
|
|
+ doChangeItemStyleType('refined-list')
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ _storage.setItem(key, 'refined-list')
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* 列表顶部按钮操作事件统一入口
|
|
|
* @param item - 按钮原型
|
|
@@ -360,19 +449,19 @@ export default function () {
|
|
|
// 分页事件
|
|
|
function doChangePageNum(page) {
|
|
|
listState.pageNum = page
|
|
|
- doQuery()
|
|
|
+ doQuery({}, 'pageNumChange', page)
|
|
|
}
|
|
|
|
|
|
// 分页大小事件
|
|
|
function doChangePageSize(size) {
|
|
|
listState.pageSize = size
|
|
|
listState.pageNum = 1
|
|
|
- doQuery()
|
|
|
+ doQuery({}, 'pageNumChange')
|
|
|
}
|
|
|
// 登录
|
|
|
$bus.$on('bidding:goLogin', goLogin)
|
|
|
function goLogin () {
|
|
|
- that.$checkLogin()
|
|
|
+ that.$showLoginDialog()
|
|
|
}
|
|
|
// 跳转详情页
|
|
|
function toDetail(item) {
|
|
@@ -399,7 +488,6 @@ export default function () {
|
|
|
)
|
|
|
} catch (error) {}
|
|
|
if(isLogin.value) {
|
|
|
- checkVisited(item)
|
|
|
const prefix = isInApp.value ? '/article/content/' : '/nologin/content/'
|
|
|
const targetLink = `${prefix}${id}${aHref}`
|
|
|
|
|
@@ -409,7 +497,6 @@ export default function () {
|
|
|
newTab: true,
|
|
|
})
|
|
|
} else{//没有登录跳转新的详情
|
|
|
- checkVisited(item, 'nologin')
|
|
|
// 一切都好渠道合作页,未登录跳转需要弹出登录,重置到已登录后的详情页
|
|
|
if(cooperateCode.value) {
|
|
|
window.location.href = '/notin/page'
|
|
@@ -422,51 +509,56 @@ export default function () {
|
|
|
}
|
|
|
// 列表tag跳转处理
|
|
|
function tagToDetail (item, label) {
|
|
|
+ let link = ''
|
|
|
if(label === 'subtype') {
|
|
|
- let val = item['stypeadd'] || item['toptype'] || 'ZBXYXX_HT'
|
|
|
- if(item.subtype === '中标') {
|
|
|
- val = 'ZHB'
|
|
|
- } else if(item.subtype === '招标') {
|
|
|
- val = 'ZB'
|
|
|
- }
|
|
|
- window.open(`/list/stype/${val}.html`)
|
|
|
- return
|
|
|
+ link = item['subtypeUrl']
|
|
|
} else if(label === 'area'){
|
|
|
- const val = item['areaadd'] || 'HN'
|
|
|
- window.open(`/list/area/${val}.html`)
|
|
|
- return
|
|
|
+ link = item['areaUrl']
|
|
|
}
|
|
|
- }
|
|
|
- // 检测是否已经存储已读
|
|
|
- function checkVisited (item, val) {
|
|
|
- const id = item.id
|
|
|
- let visited = false
|
|
|
- if (val) {
|
|
|
- visited = pathVisited(
|
|
|
- createPathItem('/nologin/content/*.html', 'id=' + id)
|
|
|
- )
|
|
|
- } else {
|
|
|
- visited = pathVisited(
|
|
|
- createPathItem('/article/content/*.html', 'id=' + id)
|
|
|
- )
|
|
|
+ if(link) {
|
|
|
+ window.open(link)
|
|
|
}
|
|
|
-
|
|
|
- item.visited = visited
|
|
|
}
|
|
|
-
|
|
|
// 获取 store getters
|
|
|
const userType = computed(() => {
|
|
|
return useStore().getters['user/userType']
|
|
|
})
|
|
|
|
|
|
+ /**
|
|
|
+ * 变更搜索模式
|
|
|
+ * @type {boolean}
|
|
|
+ */
|
|
|
+ // P260需求精准搜索无结果时 自动切换到模糊搜索(查询) 模糊搜索也无结果时再切回精准(不查询)
|
|
|
+ // 条件:1.精准搜索模式 2.返回无数据 3.有主关键词或附加词
|
|
|
+ let autoSwitchModel = false
|
|
|
+ function changeSearchMode () {
|
|
|
+ const total = listState.total
|
|
|
+ const { searchMode, additionalWords, input } = inputKeywordsState.value
|
|
|
+ const jzModel = searchMode === '0' && (additionalWords || input)
|
|
|
+ const mhModel = searchMode === '1' && (additionalWords || input)
|
|
|
+ if(!autoSwitchModel && jzModel && total === 0) {
|
|
|
+ autoSwitchModel = true
|
|
|
+ inputKeywordsState.value.searchMode = '1'
|
|
|
+ doQuery()
|
|
|
+ }
|
|
|
+ if(mhModel && autoSwitchModel) {
|
|
|
+ if( total > 0) {
|
|
|
+ that.$toast('精准搜索无结果,已为您自动切换到模糊搜索')
|
|
|
+ autoSwitchModel = false
|
|
|
+ } else {
|
|
|
+ // 模糊搜索无结果时 再切回精准
|
|
|
+ inputKeywordsState.value.searchMode = '0'
|
|
|
+ autoSwitchModel = false
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 格式化请求参数
|
|
|
* @param [params] - 可选值,部分情况会提供,默认会和该函数返回值进行合并
|
|
|
*/
|
|
|
|
|
|
function getParams(params = {}) {
|
|
|
- // 物业专版筛选条件待处理
|
|
|
- // filterProperty
|
|
|
// 合并所有模型的搜索筛选项
|
|
|
const result = Object.assign(
|
|
|
{
|
|
@@ -485,62 +577,144 @@ export default function () {
|
|
|
)
|
|
|
return result
|
|
|
}
|
|
|
+
|
|
|
+ function beforeSearch (searchType) {
|
|
|
+ // 第一次搜索或者tab切换不校验白名单规则
|
|
|
+ if (searchType) {
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ // 如果在反爬白名单,则空搜索刷新搜索结果(即允许空搜索)
|
|
|
+ // 不在,则不允许空搜索(此处空搜索指的是主搜索框是否为空)
|
|
|
+ if (!onTheWhiteList.value) {
|
|
|
+ const searchKeywords = inputKeywordsState.value.input
|
|
|
+ const hasOneKey = (filterState.value.buyer?.length || filterState.value.winner?.length || filterState.value.agency?.length) > 0
|
|
|
+ // 切换三种筛选类型时候判断(切换tab时不弹窗)
|
|
|
+ // if (!searchKeywords && !hasOneKey) {
|
|
|
+ // if (from.indexOf('tab-') !== -1) {
|
|
|
+ // return false
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // 关键词去两边空格后为空
|
|
|
+ if (!searchKeywords && inputKeywordsState.value.additionalWords.length === 0) {
|
|
|
+ if (!hasOneKey) {
|
|
|
+ that.$toast('请先输入关键词')
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ // 判断关键词中是否有通用词,并清空对应通用词的项
|
|
|
+ const hasCommonWords = checkAndClearTextIncludesCommonWords(searchKeywords)
|
|
|
+ if (hasCommonWords) {
|
|
|
+ that.$toast('请输入项目名称等关键词')
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return true
|
|
|
+ }
|
|
|
/**
|
|
|
* 统一查询入口
|
|
|
* - 拦截 doQuery 进行一些返回值处理
|
|
|
* @param [params] - 可选值,默认会和 getParams(params) 返回值进行合并
|
|
|
*/
|
|
|
- function doQuery(params = {}) {
|
|
|
- return doRunQuery(getParams(params)).then((res) => {
|
|
|
+ function doQuery(params = {}, searchType, pageNum) {
|
|
|
+ const bSearch = beforeSearch(searchType)
|
|
|
+ if(!bSearch) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if(!pageNum) {
|
|
|
+ listState.pageNum = 1
|
|
|
+ }
|
|
|
+ // 如果列表展示状态为table,将列表展现形式换成详细列表或者精简列表
|
|
|
+ if(activeItemStyleType.value === 'T') {
|
|
|
+ restoreListTabActive()
|
|
|
+ }
|
|
|
+ // 存储筛选条件
|
|
|
+ if(isInApp.value && isLogin.value && listState.pageNum === 1 && !inBIPropertyIframe) {
|
|
|
+ saveSearchGroupToLocal()
|
|
|
|
|
|
- let matchKeys = []
|
|
|
if(inputKeywordsState.value.input) {
|
|
|
- matchKeys.push(inputKeywordsState.value.input)
|
|
|
- }
|
|
|
- if(inputKeywordsState.value.selectMoreKey) {
|
|
|
- if(inputKeywordsState.value.additionalWords?.length) {
|
|
|
- matchKeys = matchKeys.concat(inputKeywordsState.value.additionalWords)
|
|
|
- }
|
|
|
+ saveFilterToLocal()
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
- // 用于搜索关键词高亮
|
|
|
- inputKeywordsState.value.matchKeys = res.origin?.heightWords?.split(' ') || matchKeys
|
|
|
+ //P271需求--潜客圈进引流需求
|
|
|
+ if(!advancedInfo.show && !getShowChart.value && inputKeywordsState.value.input) {
|
|
|
+ getCustomReportData({ keywords: inputKeywordsState.value.input })
|
|
|
+ }
|
|
|
|
|
|
- // 列表无数据,禁用数据导出按钮
|
|
|
- if(listState.total === 0) {
|
|
|
- disabledHeaderActions.value = ['data-export']
|
|
|
- } else {
|
|
|
- disabledHeaderActions.value = []
|
|
|
+ // Ajax请求
|
|
|
+ return doRunQuery(getParams(params)).then((res) => {
|
|
|
+ afterQueryAjax(res)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ // 处理查询请求后的数据以及其他业务
|
|
|
+ function afterQueryAjax (res) {
|
|
|
+ // 变更搜索模式
|
|
|
+ changeSearchMode()
|
|
|
+
|
|
|
+ const { origin } = res
|
|
|
+
|
|
|
+ listState.pageTotal = origin?.count || 0
|
|
|
+ // 限制关键词
|
|
|
+ interceptKeywords.interceptOtherWords = origin?.interceptOtherWords
|
|
|
+ interceptKeywords.interceptLimit = origin?.interceptLimit
|
|
|
+
|
|
|
+ let matchKeys = []
|
|
|
+ if(inputKeywordsState.value.input) {
|
|
|
+ matchKeys.push(inputKeywordsState.value.input)
|
|
|
+ }
|
|
|
+ if(inputKeywordsState.value.selectMoreKey) {
|
|
|
+ if(inputKeywordsState.value.additionalWords?.length) {
|
|
|
+ matchKeys = matchKeys.concat(inputKeywordsState.value.additionalWords)
|
|
|
}
|
|
|
+ }
|
|
|
+ // 用于搜索关键词高亮
|
|
|
+ inputKeywordsState.value.matchKeys = res.origin?.keyWords?.split(' ') || matchKeys
|
|
|
|
|
|
- if(isLogin.value) {
|
|
|
- // 获取参标的数据
|
|
|
- getJoinBidInfo(listIds.value)
|
|
|
- // BI 是否批量收录,获取收录数据
|
|
|
- if(inBIPropertyIframe || inResourceBIIframe) {
|
|
|
- getEmployData(listIds.value)
|
|
|
- }
|
|
|
- // 个人报告嵌套BI页面
|
|
|
- if(inInjectBI) {
|
|
|
- getBidAddInfos()
|
|
|
- }
|
|
|
+ //表格列表数据--只取第一页的前20条展示
|
|
|
+ if(listState.pageNum === 1) {
|
|
|
+
|
|
|
+ }
|
|
|
+ if(listState.pageNum === 1 && listState.total > 0) {
|
|
|
+ tableList.value = list.value.slice(0, 20)
|
|
|
+ }
|
|
|
|
|
|
+ // 列表无数据,禁用数据导出按钮
|
|
|
+ if(listState.total === 0) {
|
|
|
+ disabledHeaderActions.value = ['data-export']
|
|
|
+ } else {
|
|
|
+ disabledHeaderActions.value = []
|
|
|
+ }
|
|
|
+
|
|
|
+ if(isLogin.value) {
|
|
|
+ // 获取参标的数据
|
|
|
+ getJoinBidInfo(listIds.value)
|
|
|
+ // BI 是否批量收录,获取收录数据
|
|
|
+ if(inBIPropertyIframe || inResourceBIIframe) {
|
|
|
+ getEmployData(listIds.value)
|
|
|
+ }
|
|
|
+ // 个人报告嵌套BI页面
|
|
|
+ if(inInjectBI) {
|
|
|
+ getBidAddInfos()
|
|
|
}
|
|
|
- list.value = list.value.map(item => {
|
|
|
- // 添加是否已读标志
|
|
|
- const visited = pathVisited(
|
|
|
- createPathItem('/article/content/*.html', `id=${item.id}`)
|
|
|
- )
|
|
|
- that.$set(item, 'visited', visited)
|
|
|
- // 收藏字段显示
|
|
|
- that.$set(item, 'collection', item.isCollected ? 1 : 0)
|
|
|
|
|
|
- // 收录字段
|
|
|
- that.$set(item, 'isEmploy', false)
|
|
|
+ }
|
|
|
+ list.value = list.value.map(item => {
|
|
|
+ // 收藏字段显示
|
|
|
+ that.$set(item, 'collection', item.isCollected ? 1 : 0)
|
|
|
|
|
|
- return item
|
|
|
- })
|
|
|
+ // 收录字段
|
|
|
+ that.$set(item, 'isEmploy', false)
|
|
|
|
|
|
+ return item
|
|
|
+ })
|
|
|
+
|
|
|
+ // 列表底部-是否展示需要切换模糊搜索的tip
|
|
|
+ checkToggleSearchMode({
|
|
|
+ pageNum: 1,
|
|
|
+ count: origin.total || 0,
|
|
|
+ blurCount: origin.bCount || 0,
|
|
|
+ searchMode: Number(inputKeywordsState.value.searchMode)
|
|
|
})
|
|
|
}
|
|
|
|
|
@@ -551,7 +725,7 @@ export default function () {
|
|
|
showFilter.value = !showFilter.value
|
|
|
}
|
|
|
|
|
|
- // 组合好的筛选条件
|
|
|
+ // 组合好的组件格式的筛选条件
|
|
|
function packageFilter () {
|
|
|
const originParams = Object.assign(
|
|
|
{
|
|
@@ -564,6 +738,14 @@ export default function () {
|
|
|
return originParams
|
|
|
}
|
|
|
|
|
|
+// P271需求,潜客圈进,展示超前项目or分析报告引流
|
|
|
+ const recommendCardCircleModel = recommendCardModel({ that })
|
|
|
+ const {
|
|
|
+ getShowChart,
|
|
|
+ advancedInfo,
|
|
|
+ getCustomReportData,
|
|
|
+ } = recommendCardCircleModel
|
|
|
+
|
|
|
/******开通超级订阅弹窗start**********/
|
|
|
|
|
|
// 开通超级订阅弹窗配置
|
|
@@ -610,9 +792,9 @@ export default function () {
|
|
|
// 组件筛选条件
|
|
|
const originParams = packageFilter()
|
|
|
sessionStorage.setItem('search:bidding:filter', JSON.stringify(originParams))
|
|
|
- window.location.replace(location.origin + '/swordfish/page_big_pc/search/bidding?goback=true')
|
|
|
+ // window.location.replace('/swordfish/page_big_pc/search/bidding?goback=true')
|
|
|
|
|
|
- // window.location.replace(`/page_workDesktop/work-bench/page?link=${encodeURIComponent(goHref_ + 'goback=')}`)
|
|
|
+ window.location.replace(`/page_workDesktop/work-bench/page?link=${encodeURIComponent(goHref_ + '?goback=true')}`)
|
|
|
}
|
|
|
// 监听路由事件
|
|
|
onMounted(() => {
|
|
@@ -625,9 +807,7 @@ export default function () {
|
|
|
doChangeTab({ key})
|
|
|
} else if(subtype && subtype ==='采购意向' && inBIPropertyIframe) {
|
|
|
// 物业专版,采购意向回显
|
|
|
- filterState.value = Object.assign(filterState.value, {
|
|
|
- subtype: {采购意向: ['采购意向']}
|
|
|
- })
|
|
|
+ filterState.value.subType = {采购意向: ['采购意向']}
|
|
|
}
|
|
|
})
|
|
|
// 回显筛选条件
|
|
@@ -650,10 +830,6 @@ export default function () {
|
|
|
checkFilterPass, // 检测是否可以保存筛选条件
|
|
|
} = disposeFilterActionModel
|
|
|
|
|
|
- if(isLogin.value) {
|
|
|
- getFilterHistoryList()
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* 保存筛选条件
|
|
|
*/
|
|
@@ -686,7 +862,25 @@ export default function () {
|
|
|
})
|
|
|
})
|
|
|
.catch(() => {
|
|
|
- restoreFilter(item, 'saveBack')
|
|
|
+ // 之前是付费用户,现在变成普通用户了,需要重置一些vip选项!!!!
|
|
|
+ const params = Object.assign(item,{
|
|
|
+ bidField: isBidField ? 'medical' : '',
|
|
|
+ publishTime: 'thisyear',
|
|
|
+ selectType: ['title'],
|
|
|
+ subtype: item.subtype,
|
|
|
+ regionMap: {},
|
|
|
+ industry: item.industry,
|
|
|
+ fileExists: item.fileExists,
|
|
|
+ price: item.price,
|
|
|
+ buyerclass: {},
|
|
|
+ buyertel: '',
|
|
|
+ winnertel: '',
|
|
|
+ notkey: '',
|
|
|
+ buyer: '',
|
|
|
+ winner: '',
|
|
|
+ agency: ''
|
|
|
+ })
|
|
|
+ restoreFilter(params, 'saveBack')
|
|
|
historyFilterDialogVisible.value = false
|
|
|
})
|
|
|
} else {
|
|
@@ -700,7 +894,9 @@ export default function () {
|
|
|
} else {
|
|
|
resultFilter = viewFilter
|
|
|
}
|
|
|
+ doChangeTab({ key: resultFilter.searchGroup })
|
|
|
filterState.value = {
|
|
|
+ bidField: isBidField ? 'medical' : '',
|
|
|
publishTime: resultFilter.publishTime,
|
|
|
selectType: resultFilter.selectType,
|
|
|
subtype: resultFilter.subtype,
|
|
@@ -727,46 +923,16 @@ export default function () {
|
|
|
additionalWords: resultFilter.additionalWords,
|
|
|
selectMoreKey: resultFilter.additionalWords?.length > 0
|
|
|
}
|
|
|
- doChangeTab({ key: resultFilter.searchGroup })
|
|
|
if(type === 'saveBack') {
|
|
|
historyFilterDialogVisible.value = false
|
|
|
}
|
|
|
- doQuery()
|
|
|
+ doQuery({}, 'not-filter')
|
|
|
}
|
|
|
|
|
|
// 重置筛选条件
|
|
|
function onResetFilter () {
|
|
|
- filterState.value = {
|
|
|
- // 发布时间
|
|
|
- publishTime: 'thisyear',
|
|
|
- // 搜索范围
|
|
|
- selectType: ['content', 'title'],
|
|
|
- // 信息类型
|
|
|
- subtype: [],
|
|
|
- // 地区
|
|
|
- regionMap: {},
|
|
|
- // 行业
|
|
|
- industry: null,
|
|
|
- // 附件
|
|
|
- fileExists: '',
|
|
|
- // 金额区间
|
|
|
- price: null,
|
|
|
- // 采购单位类型
|
|
|
- buyerclass: {},
|
|
|
- // 采购单位联系方式
|
|
|
- buyertel: '',
|
|
|
- // 中标企业联系方式
|
|
|
- winnertel: '',
|
|
|
- // 排除词
|
|
|
- notkey: [],
|
|
|
- // 采购单位
|
|
|
- buyer: [],
|
|
|
- // 中标企业
|
|
|
- winner: [],
|
|
|
- // 招标代理机构
|
|
|
- agency: []
|
|
|
- }
|
|
|
- doQuery()
|
|
|
+ updateFilterBase()
|
|
|
+ doQuery({}, 'not-filter')
|
|
|
}
|
|
|
/**保存、重置、查看筛选条件end******/
|
|
|
|
|
@@ -802,11 +968,12 @@ export default function () {
|
|
|
dataExport,
|
|
|
setExport,
|
|
|
exportDialogChange,
|
|
|
- showDataExportDialog
|
|
|
+ showDataExportDialog,
|
|
|
+ toPayDataExport
|
|
|
} = dataExportActionsModel ()
|
|
|
|
|
|
// 数据导出操作
|
|
|
- function onClickDataExport () {
|
|
|
+ function onClickDataExport (table) {
|
|
|
if(!isLogin.value) {
|
|
|
goLogin()
|
|
|
return
|
|
@@ -819,7 +986,12 @@ export default function () {
|
|
|
selectIds: selectIds.value,
|
|
|
filter: originParams
|
|
|
}
|
|
|
- dataExport(params)
|
|
|
+ if(table) {
|
|
|
+ toPayDataExport(params)
|
|
|
+ } else {
|
|
|
+ dataExport(params)
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
/*******数据导出 end ***********/
|
|
@@ -982,6 +1154,226 @@ export default function () {
|
|
|
}
|
|
|
/*****BI添加操作end*********/
|
|
|
|
|
|
+ // 处理数据列表为空时,需要展示的提示文案包含时间
|
|
|
+ const timeSelectorText = computed(() => {
|
|
|
+ const publishTime = filterState.value.publishTime
|
|
|
+ const split = inBIPropertyIframe ? '-' : '_'
|
|
|
+ const { publishTimeText } = FilterHistoryAjaxModel2ViewModel.formatTime(publishTime, split)
|
|
|
+ let result = ''
|
|
|
+ if(publishTimeText) {
|
|
|
+ if(publishTimeText.includes('最')) {
|
|
|
+ result = publishTimeText.replace('最', '')
|
|
|
+ } else if(publishTimeText.includes('以后')){
|
|
|
+ result = publishTimeText.replace('以后', '')
|
|
|
+ }else if(publishTimeText.includes('以前')) {
|
|
|
+ result = publishTimeText.replace('以前', '')
|
|
|
+ } else {
|
|
|
+ result = publishTimeText
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ result = inBIPropertyIframe ? '近5年' : '近一年'
|
|
|
+ }
|
|
|
+
|
|
|
+ return result
|
|
|
+ })
|
|
|
+
|
|
|
+
|
|
|
+ /*********页面留资相关************/
|
|
|
+ // 打开留资弹窗
|
|
|
+ const collectElementRef = ref(null)
|
|
|
+ // 免费用户点免费体验留资
|
|
|
+ function onFreeTaste () {
|
|
|
+ if( collectElementRef.value) {
|
|
|
+ collectElementRef.value.isNeedSubmit('jylab_see500_plus', () => {
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * searchGroup筛选项缓存
|
|
|
+ */
|
|
|
+ function saveSearchGroupToLocal() {
|
|
|
+ const { key, _storage } = storageConfig.searchGroup
|
|
|
+ const params = {
|
|
|
+ searchGroup: activeTab.value
|
|
|
+ }
|
|
|
+ _storage.setItem(key, JSON.stringify(params))
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 从缓存恢复searchGroup筛选项
|
|
|
+ */
|
|
|
+ function restoreSearchGroupFromLocal() {
|
|
|
+ const { key, _storage } = storageConfig.searchGroup
|
|
|
+ const params =_storage.getItem(key)
|
|
|
+ const jParams = JSON.parse(params)
|
|
|
+ if (jParams) {
|
|
|
+ doChangeTab({ key: jParams.searchGroup })
|
|
|
+ filterState.value.searchGroup = jParams.searchGroup
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 恢复和保存筛选条件到本地业务说明:
|
|
|
+ * 工作台内 1、所有用户都存 2、只有付费用户回显上次筛选
|
|
|
+ * 工作台外:所有用户不存不会回显
|
|
|
+ *
|
|
|
+ * 补充业务:
|
|
|
+ * 付费用户回显筛选条件逻辑:
|
|
|
+ * 本地缓存有,则恢复本地缓存
|
|
|
+ * 本地缓存无,则恢复保存的筛选条件第一条
|
|
|
+ * 本地缓存无,已存筛选条件无,不处理回显
|
|
|
+ *
|
|
|
+ * 搜索范围缓存单独处理
|
|
|
+ * 工作台内外:本地有缓存有则回显,无则默认选中标题
|
|
|
+ */
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 保存筛选条件到本地
|
|
|
+ * @param replace
|
|
|
+ */
|
|
|
+ function saveFilterToLocal(replace = {}) {
|
|
|
+ const { key, _storage } = storageConfig.filter
|
|
|
+ const originParams = packageFilter()
|
|
|
+ let params = originParams
|
|
|
+ if (replace && Object.keys(replace).length) {
|
|
|
+ params = Object.assign(params, replace)
|
|
|
+ }
|
|
|
+ _storage.setItem(key, JSON.stringify(params))
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 从本地缓存恢复筛选条件
|
|
|
+ *
|
|
|
+ */
|
|
|
+ function restoreFilterFromLocal () {
|
|
|
+ const { key, _storage } = storageConfig.filter
|
|
|
+ const params =_storage.getItem(key)
|
|
|
+ if (params) {
|
|
|
+ restoreFilter(JSON.parse(params), 'localBack')
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 恢复筛选条件
|
|
|
+ function getLastFilter () {
|
|
|
+ if(isLogin.value) {
|
|
|
+ const { key, _storage } = storageConfig.filter
|
|
|
+ const params =_storage.getItem(key)
|
|
|
+ const jParams = params ? JSON.parse(params) : null
|
|
|
+ // 搜索范围--无论用户身份和工作台内外,有则恢复
|
|
|
+ if(jParams) {
|
|
|
+ const defaultSelectType = ['title']
|
|
|
+ const selectType = jParams.selectType
|
|
|
+ if(selectType.indexOf('content') > -1) {
|
|
|
+ defaultSelectType.push('content')
|
|
|
+ }
|
|
|
+ if(selectType.indexOf('file') > -1) {
|
|
|
+ defaultSelectType.push('file')
|
|
|
+ }
|
|
|
+ filterState.value.selectType = defaultSelectType
|
|
|
+ }
|
|
|
+ // 工作台内
|
|
|
+ if(isInApp.value) {
|
|
|
+ // 免费用户仅恢复tab
|
|
|
+ if(isFree.value) {
|
|
|
+ restoreSearchGroupFromLocal()
|
|
|
+ }
|
|
|
+
|
|
|
+ // 仅vip恢复筛选
|
|
|
+ if(isVip.value && jParams) {
|
|
|
+ restoreFilterFromLocal()
|
|
|
+ }
|
|
|
+
|
|
|
+ // 获取已存筛选条件的列表
|
|
|
+ getFilterHistoryList(null,function (arr) {
|
|
|
+ if(isVip.value) {
|
|
|
+ // 付费用户,优先恢复本地缓存,本地无缓存,则恢复已存筛选第一条数据
|
|
|
+ if(!jParams && Array.isArray(arr) && arr.length > 0){
|
|
|
+ restoreFilter(arr[0], 'saveBack')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * 检查是否需要切换模糊搜索、是否展示提示
|
|
|
+ * 1. 精准搜索无数据 (自动切换模糊搜索)
|
|
|
+ * 2. 精准搜索有数据,< 50,提示手动切换搜索模式
|
|
|
+ */
|
|
|
+
|
|
|
+ const toggleSearchBlurData = reactive( {
|
|
|
+ show: false,
|
|
|
+ count: ''
|
|
|
+ })
|
|
|
+ function checkToggleSearchMode(params) {
|
|
|
+ const searchMode = params.searchMode
|
|
|
+ const pageNum = params.pageNum
|
|
|
+ const count = params.count || 0
|
|
|
+ const blurCount = params.blurCount || 0
|
|
|
+
|
|
|
+ if (pageNum === 1) {
|
|
|
+ // 重置变量
|
|
|
+ toggleSearchBlurData.show = false
|
|
|
+ toggleSearchBlurData.count = ''
|
|
|
+
|
|
|
+ if (searchMode === 0) {
|
|
|
+ const canShowToggleBlurModeTip = count >= 1 && count < 50 && blurCount > count
|
|
|
+
|
|
|
+ if (canShowToggleBlurModeTip) {
|
|
|
+ toggleSearchBlurData.show = true
|
|
|
+ toggleSearchBlurData.count = blurCount
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 切换到模糊搜索
|
|
|
+ function doToggleSearchBlurMode() {
|
|
|
+ inputKeywordsState.value.searchMode = '1'
|
|
|
+ setTimeout(function() {
|
|
|
+ scrollToTop(572)
|
|
|
+ }, 50)
|
|
|
+ doQuery()
|
|
|
+ }
|
|
|
+ // 滚动到某个位置
|
|
|
+ function scrollToTop(scrollTop) {
|
|
|
+ document.scrollingElement.scrollTop = scrollTop || 0
|
|
|
+ }
|
|
|
+ // 切换模糊搜索
|
|
|
+ const toggleBlurModeTip = computed( () => {
|
|
|
+ const isBlurMode = Number(inputKeywordsState.value.searchMode) === 1
|
|
|
+ let canShow = isBlurMode ? false : toggleSearchBlurData.show
|
|
|
+ if(listState.loading) {
|
|
|
+ canShow = false
|
|
|
+ }
|
|
|
+ const result = {
|
|
|
+ show: canShow,
|
|
|
+ count: toggleSearchBlurData.count
|
|
|
+ }
|
|
|
+ return result
|
|
|
+ })
|
|
|
+
|
|
|
+ // 页面初始化
|
|
|
+ function initPage () {
|
|
|
+ // 恢复以前选过的tab
|
|
|
+ restoreListTabActive()
|
|
|
+
|
|
|
+ // // 恢复上次筛选条件
|
|
|
+ onMounted(() => {
|
|
|
+ if(!inBIPropertyIframe) {
|
|
|
+ getLastFilter()
|
|
|
+ }
|
|
|
+
|
|
|
+ // P271潜客圈进--客户引流请求
|
|
|
+ if(inputKeywordsState.value.input) {
|
|
|
+ getCustomReportData({ keywords: inputKeywordsState.value.input})
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ }
|
|
|
+ initPage()
|
|
|
+
|
|
|
return {
|
|
|
isLogin,
|
|
|
isInApp,
|
|
@@ -990,17 +1382,22 @@ export default function () {
|
|
|
inBIPropertyIframe,
|
|
|
inInjectBI,
|
|
|
isInBI,
|
|
|
+ isFree,
|
|
|
isVip,
|
|
|
+ isBidField,
|
|
|
goLogin,
|
|
|
guideGoWorkSpace,
|
|
|
cooperateCode,
|
|
|
list,
|
|
|
+ tableList,
|
|
|
searchModelOptions,
|
|
|
searchListProps,
|
|
|
SearchTabsModel,
|
|
|
inputKeywordsState,
|
|
|
filterState,
|
|
|
+ updateFilterBase,
|
|
|
listState,
|
|
|
+ interceptKeywords,
|
|
|
activeItemStyleType,
|
|
|
disposeFilterSchema,
|
|
|
doQuery,
|
|
@@ -1038,6 +1435,13 @@ export default function () {
|
|
|
onSingleEmploy,
|
|
|
onAddInfoOfBI,
|
|
|
onSingleAddInfo,
|
|
|
- goWorkSpace
|
|
|
+ goWorkSpace,
|
|
|
+ timeSelectorText,
|
|
|
+ collectElementRef,
|
|
|
+ onFreeTaste,
|
|
|
+ getLastFilter,
|
|
|
+ toggleBlurModeTip,
|
|
|
+ doToggleSearchBlurMode,
|
|
|
+ recommendCardCircleModel
|
|
|
}
|
|
|
}
|