|
@@ -40,7 +40,7 @@
|
|
|
<div class="label">搜索记录</div>
|
|
|
<div class="result">
|
|
|
<template v-for="(item, index) in state.historyList">
|
|
|
- <span class="__hover" @click="toList(item, true)">{{index + 1}}.{{item}}</span>
|
|
|
+ <span class="__hover" @click="toList(item.keyword, true)">{{index + 1}}.{{item.keyword}}</span>
|
|
|
</template>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -74,10 +74,12 @@
|
|
|
import {computed, getCurrentInstance, onMounted, reactive} from "vue";
|
|
|
import router from "@/router";
|
|
|
import {ElMessage} from "element-plus";
|
|
|
-import {useThemeStore, useWebStore} from "@/stores";
|
|
|
+import {useAppStore, useThemeStore, useWebStore} from "@/stores";
|
|
|
import {mockGetSearchHistory} from "@/api/modules/mock/mock";
|
|
|
+import {searchLogsGetKeyWordByUserId} from "@/api/modules/web/list";
|
|
|
|
|
|
const {proxy} = getCurrentInstance()
|
|
|
+const AppStore = useAppStore()
|
|
|
const WebStore = useWebStore()
|
|
|
const ThemeStore = useThemeStore()
|
|
|
const state: any = reactive({
|
|
@@ -119,7 +121,10 @@ const noAreaCpt = computed(() => {
|
|
|
return !(state.areaList.length > 0)
|
|
|
})
|
|
|
const initHistory = () => {
|
|
|
- mockGetSearchHistory().then(res => {
|
|
|
+ searchLogsGetKeyWordByUserId(proxy.$util.formatGetParam({
|
|
|
+ userId: AppStore.userInfo?.id,
|
|
|
+ size: 10
|
|
|
+ })).then(res => {
|
|
|
state.historyList = res.data
|
|
|
})
|
|
|
}
|
|
@@ -136,8 +141,6 @@ const onIndexTabAll = () => {
|
|
|
})
|
|
|
}
|
|
|
const toList = (text, isAll = false) => {
|
|
|
- console.log(searchAreaCpt.value.arr)
|
|
|
-
|
|
|
if (text) {
|
|
|
const routerUrl = router.resolve({
|
|
|
name: '4f6dd2ea-7c0a-4923-9a57-932ef42235f6',
|
|
@@ -156,7 +159,7 @@ const toList = (text, isAll = false) => {
|
|
|
}
|
|
|
}
|
|
|
onMounted(() => {
|
|
|
- // initHistory()
|
|
|
+ initHistory()
|
|
|
initArea()
|
|
|
})
|
|
|
</script>
|