Procházet zdrojové kódy

fix : 1.修改游记列表搜索

suwenjiang před 4 týdny
rodič
revize
e23137a391

+ 13 - 11
src/pages/note-create/index.client.vue

@@ -1074,21 +1074,23 @@ onMounted(() => {
   color: #606266;
 }
 
-::v-deep .ql-mention-list-item.selected {
-  background-color: #fff7e6 !important;
-}
-
 .member-item {
   display: flex;
   align-items: center;
   height: 30px;
+}
 
-  .member-header {
-    object-fit: cover;
-    width: 24px;
-    height: 24px;
-    border-radius: 50%;
-    margin-right: 10px;
-  }
+.member-item .member-header {
+  object-fit: cover;
+  width: 24px;
+  height: 24px;
+  border-radius: 50%;
+  margin-right: 10px;
+}
+</style>
+<style>
+#quill-mention-list .selected {
+  background-color: #fff7e6 !important;
+  color: #ff9300;
 }
 </style>

+ 45 - 22
src/pages/travel-notes/index.vue

@@ -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()