diff --git a/src/api/search/search.ts b/src/api/search/search.ts index 20230cb..9df567d 100644 --- a/src/api/search/search.ts +++ b/src/api/search/search.ts @@ -27,3 +27,17 @@ export async function historySearch(params) { return res } + +/** + * 清除历史记录 + * @returns + */ +export async function deleteSearch(params) { + const res = await http.request({ + url: `/ocr/history/searchdelete`, + method: 'delete', + params, + }) + + return res +} diff --git a/src/assets/icons/delete-history.svg b/src/assets/icons/delete-history.svg new file mode 100644 index 0000000..4260184 --- /dev/null +++ b/src/assets/icons/delete-history.svg @@ -0,0 +1,22 @@ + + + 删除 + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/components/Search/Search.vue b/src/components/Search/Search.vue index de59eac..da3b834 100644 --- a/src/components/Search/Search.vue +++ b/src/components/Search/Search.vue @@ -1,56 +1,97 @@ @@ -63,7 +104,7 @@ getHistory() v-model:value="value" placeholder="搜索任务ID、任务名称、提报人、拜访终端" type="text" - @input="handlerSearch" + @input="inputHandler" @mousedown="handlerShowList" > @@ -73,17 +114,35 @@ getHistory() + + 历史搜索 + + + + + {{ item.historyname }} + + + + + + {{ item.title }} - + - {{ sitem.title }} + + @@ -144,4 +203,38 @@ getHistory() :deep(.n-input .n-input-wrapper) { margin: 8px; } + +.history-list{ + align-items: center; + padding-bottom: 9px; +} + +.tag-wrap{ + display: flex; + align-items: center; + flex: 1; + overflow-y: hidden; + overflow-x: auto; + + .tag{ + padding: 0 12px; + height: 22px; + border: 1px solid #e4e7ed; + border-radius: 12px; + margin-right: 12px; + font-size: 13px; + font-family: PingFang SC, PingFang SC-Regular; + font-weight: Regular; + text-align: left; + color: #666666; + } +} + +.icon-delete{ + cursor: pointer; +} + +.highlight{ + color: #507AFD; +} diff --git a/src/views/home/aside/Aside.vue b/src/views/home/aside/Aside.vue index 7445876..4c8fca0 100644 --- a/src/views/home/aside/Aside.vue +++ b/src/views/home/aside/Aside.vue @@ -145,7 +145,7 @@ function editFilter(filter: any) { watch(asideValue, (newVal) => { configStore.setAsideValue(newVal) -}) +}, { deep: true }) diff --git a/src/views/home/content/Content.vue b/src/views/home/content/Content.vue index 5081d14..d5fdf72 100644 --- a/src/views/home/content/Content.vue +++ b/src/views/home/content/Content.vue @@ -35,6 +35,7 @@ const LoginSuccessModalRef = ref(null) const loading = ref(false) const message = useMessage() const totalCount = ref(0) +const sortBy = ref<'asc' | 'desc'>('desc') let canloadMore = true let filterId = null @@ -74,10 +75,6 @@ const layout = debounce(() => { (_masonry as any).layout() if (!el.value) return - // const scrollHeight = el.value!.scrollHeight - // const clientHeight = el.value!.clientHeight - // const top = scrollHeight - clientHeight - 100 - // el.value!.scrollTo({ top, behavior: 'instant' }) loading.value = false }) @@ -130,7 +127,7 @@ async function featchList() { const asideParams = unref(configStore.getAsideValue) const params = filterId ? { userSearchId: filterId } : asideParams - const result = await getPictureList({ ...pagination, ...contentParams, ...params }) + const result = await getPictureList({ ...pagination, ...contentParams, ...params, ordertype: sortBy.value }) const { data, pageCount, total } = result totalCount.value = total canloadMore = pageCount >= pagination.pageNo && pageCount > 0 @@ -142,6 +139,7 @@ async function featchList() { upname: item.upname, ocrPictureclass: item.ocrPictureclass, uphead: item.uphead, + similar: item.similarityscore || 0, } }) @@ -224,6 +222,7 @@ function reset() { loading.value = false canloadMore = true filterId = null + layout() } @@ -234,19 +233,26 @@ async function refreshHandler(filtersearchId?: any) { filterId = filtersearchId nextTick(() => { - useInfiniteScroll( - el as any, - () => { - loadMore() - }, - { distance: 10, canLoadMore: () => canloadMore }, - ) + setTimeout(() => { + useInfiniteScroll( + el as any, + () => { + loadMore() + }, + { distance: 10, canLoadMore: () => canloadMore }, + ) + }, 500) }) } function getAvatar(url: string): string { return url ? getImgUrl(url) : avatar } + +function sortHandler() { + sortBy.value = sortBy.value === 'asc' ? 'desc' : 'asc' + refreshHandler() +} @@ -273,6 +279,10 @@ function getAvatar(url: string): string { + + 相似度排序 + + 共{{ totalCount }}项 @@ -290,6 +300,12 @@ function getAvatar(url: string): string { class="img" :img-props="{ onClick: hideDownload }" :class="{ 'img-fit': viewMode !== 'masonry' }" :src="item.thumburl" /> + + + + {{ `${item.similar}%` }} + + @@ -411,8 +427,30 @@ function getAvatar(url: string): string { border-radius: 7px; margin-bottom: 10px; overflow: hidden; + position: relative; } + .percent { + position: absolute; + text-align: center; + z-index: 3; + right: 0px; + top: -6px; + color: #FFF; + + .val { + position: absolute; + left: 0; + top: 0; + display: block; + width: 100%; + height: 100%; + display: flex; + align-items: center; + justify-content: center; + } + } + .scroll { overflow-y: scroll; } diff --git a/src/views/task/aside/ListItem.vue b/src/views/task/aside/ListItem.vue index 2f05272..cf73df8 100644 --- a/src/views/task/aside/ListItem.vue +++ b/src/views/task/aside/ListItem.vue @@ -1,8 +1,8 @@ - + - + 任务ID:{{ listItem.fromtaskname }} - 审批状态:{{ listItem.statshisText }} + + 审批状态:{{ listItem.statshisText }} + 审批节点:{{ listItem.tasknamehis }} - 提交时间:{{ format(new Date(), 'yyyy-MM-dd HH:mm:ss') }} + + 提交时间:{{ format(listItem.createdate, "yyyy-MM-dd HH:mm:ss") }} + 提报人:{{ listItem.fromUserName }} - @@ -60,7 +76,7 @@ const svgName = computed(() => { } &-selected { - color: #507AFD; + color: #507afd; } } @@ -72,12 +88,37 @@ const svgName = computed(() => { display: inline-block; display: flex; align-items: center; - + } + &-error { + &:before { + content: ""; + width: 6px; + height: 6px; + background: #e45656; + border-radius: 50%; + display: inline-block; + margin-left: 8px; + margin-right: 4px; + } + } + &-success { &:before { - content: ''; + content: ""; width: 6px; height: 6px; - background: #fe9800; + background: #53c21d; + border-radius: 50%; + display: inline-block; + margin-left: 8px; + margin-right: 4px; + } + } + &-watting { + &:before { + content: ""; + width: 6px; + height: 6px; + background: #398ade; border-radius: 50%; display: inline-block; margin-left: 8px; @@ -104,7 +145,6 @@ const svgName = computed(() => { position: absolute; bottom: 0px; } - } ../types diff --git a/src/views/task/aside/TaskList.vue b/src/views/task/aside/TaskList.vue index 3000949..5276096 100644 --- a/src/views/task/aside/TaskList.vue +++ b/src/views/task/aside/TaskList.vue @@ -1,9 +1,9 @@