|
@@ -3,9 +3,7 @@ import useQuickSearchModel from '@jy/data-models/modules/quick-search/model'
|
|
|
import { useSearchFilterModel } from './modules/filter'
|
|
|
import { showFilter, loginFlag, goToPublish } from './modules/search-header'
|
|
|
import { replaceKeyword, dateFromNow } from '@/utils'
|
|
|
-import { mixinVisited } from '@/utils/mixins/visited-setup.js'
|
|
|
|
|
|
-const { pathVisited, createPathItem } = mixinVisited()
|
|
|
// 解构基础业务
|
|
|
const APIModel = useQuickSearchModel({
|
|
|
type: 'search-supply'
|
|
@@ -65,6 +63,11 @@ const formatList = computed(() => {
|
|
|
value: item.province
|
|
|
})
|
|
|
}
|
|
|
+ if (item.city && item.city.replace('市', '') !== item.province) {
|
|
|
+ tags.push({
|
|
|
+ value: item.city.replace('市', '')
|
|
|
+ })
|
|
|
+ }
|
|
|
return {
|
|
|
id: item.id,
|
|
|
title: replaceKeyword(item.title, inputKeywordsState.value.input, [
|
|
@@ -76,14 +79,21 @@ const formatList = computed(() => {
|
|
|
'</span>'
|
|
|
]) : '',
|
|
|
time: dateFromNow(item.publish_time * 1000),
|
|
|
- tags: tags,
|
|
|
- visited: false
|
|
|
+ tags: tags
|
|
|
}
|
|
|
})
|
|
|
})
|
|
|
|
|
|
+// 页码总数只在第一页返回-记录保存
|
|
|
+const pageInfo = reactive({
|
|
|
+ total: 0
|
|
|
+})
|
|
|
// search-list 组件所需参数
|
|
|
const searchListProps = computed(() => {
|
|
|
+ if (listState.pageNum === 1) {
|
|
|
+ pageInfo.total = listState.total
|
|
|
+ }
|
|
|
+ listState.total = pageInfo.total
|
|
|
return {
|
|
|
showSelect: false,
|
|
|
headerActions: [],
|
|
@@ -118,12 +128,13 @@ function getParams(params = {}) {
|
|
|
{
|
|
|
searchType: 'title',
|
|
|
keywords: inputKeywordsState.value.input || '',
|
|
|
- pageNum: listState.pageNum,
|
|
|
+ pageIndex: listState.pageNum,
|
|
|
pageSize: listState.pageSize
|
|
|
},
|
|
|
getFormatAPIParams(),
|
|
|
params
|
|
|
)
|
|
|
+ console.log(result, 'result')
|
|
|
return result
|
|
|
}
|
|
|
|
|
@@ -131,7 +142,6 @@ export {
|
|
|
showFilter,
|
|
|
loginFlag,
|
|
|
goToPublish,
|
|
|
- mixinVisited,
|
|
|
// 列表
|
|
|
list,
|
|
|
doQuery,
|