|
@@ -28,12 +28,15 @@
|
|
|
</span>
|
|
|
</template>
|
|
|
<template v-else>
|
|
|
- <span
|
|
|
- v-if="recordList.length"
|
|
|
- @click="handleClearSearchRecord"
|
|
|
- class="iconfont icon-delete-one text-black-9"
|
|
|
- style="font-size: 20px"
|
|
|
- ></span>
|
|
|
+ <div class="flex items-center text-base">
|
|
|
+ 全部删除
|
|
|
+ <span
|
|
|
+ v-if="recordList.length"
|
|
|
+ @click="handleClearSearchRecord"
|
|
|
+ class="iconfont icon-delete-one text-black-9 ml-4"
|
|
|
+ style="font-size: 20px"
|
|
|
+ ></span>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -41,7 +44,7 @@
|
|
|
<div
|
|
|
v-for="(item, index) in recordList"
|
|
|
:key="item.id"
|
|
|
- @click="showCancel = true"
|
|
|
+ @click="(value = item?.searchKeyword), (showCancel = true)"
|
|
|
class="h-38 bg-[#F7F7F7] box-border px-10 py-8 rounded-[4px] mr-8 mb-12"
|
|
|
>
|
|
|
{{ item?.searchKeyword }}
|
|
@@ -490,28 +493,48 @@ async function getSearchRecordList() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-//根据id 去清楚记录
|
|
|
+//根据id 去清除记录
|
|
|
async function handleDeleteSearchRecordById(id) {
|
|
|
- const res = await request('/website/tourism/projectSearchRecords/deleteSearchRecordById', {
|
|
|
- method: 'post',
|
|
|
- body: {
|
|
|
- id
|
|
|
- }
|
|
|
+ showConfirmDialog({
|
|
|
+ width: 260,
|
|
|
+ message: '是否删除这条历史记录?',
|
|
|
+ confirmButtonColor: '#FF9300'
|
|
|
})
|
|
|
+ .then(async () => {
|
|
|
+ const res = await request('/website/tourism/projectSearchRecords/deleteSearchRecordById', {
|
|
|
+ method: 'post',
|
|
|
+ body: {
|
|
|
+ id
|
|
|
+ }
|
|
|
+ })
|
|
|
|
|
|
- if (res && res.success) {
|
|
|
- getSearchRecordList()
|
|
|
- }
|
|
|
+ if (res && res.success) {
|
|
|
+ getSearchRecordList()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(() => {})
|
|
|
}
|
|
|
// 清空历史记录
|
|
|
-async function handleClearSearchRecord() {
|
|
|
- const res = await request('/website/tourism/projectSearchRecords/clearSearchRecord', {
|
|
|
- method: 'post'
|
|
|
+function handleClearSearchRecord() {
|
|
|
+ showConfirmDialog({
|
|
|
+ width: 260,
|
|
|
+ message: '是否全部删除历史记录?',
|
|
|
+ confirmButtonColor: '#FF9300'
|
|
|
})
|
|
|
+ .then(async () => {
|
|
|
+ const res = await request('/website/tourism/projectSearchRecords/clearSearchRecord', {
|
|
|
+ method: 'post',
|
|
|
+ body: {
|
|
|
+ // 0游记列表1话题列表
|
|
|
+ searchType: 0
|
|
|
+ }
|
|
|
+ })
|
|
|
|
|
|
- if (res && res.success) {
|
|
|
- recordList.value = []
|
|
|
- }
|
|
|
+ if (res && res.success) {
|
|
|
+ recordList.value = []
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(() => {})
|
|
|
}
|
|
|
onMounted(async () => {
|
|
|
getFilters()
|