diff --git a/components.d.ts b/components.d.ts index 298dbe9..6458938 100644 --- a/components.d.ts +++ b/components.d.ts @@ -11,6 +11,7 @@ declare module 'vue' { BasicModal: typeof import('./src/components/Modal/BasicModal.vue')['default'] DataHeader: typeof import('./src/components/DataHeader/index.vue')['default'] NAvatar: typeof import('naive-ui')['NAvatar'] + NBackTop: typeof import('naive-ui')['NBackTop'] NButton: typeof import('naive-ui')['NButton'] NCard: typeof import('naive-ui')['NCard'] NCheckbox: typeof import('naive-ui')['NCheckbox'] @@ -21,8 +22,11 @@ declare module 'vue' { NDialogProvider: typeof import('naive-ui')['NDialogProvider'] NDivider: typeof import('naive-ui')['NDivider'] NDropdown: typeof import('naive-ui')['NDropdown'] + NEllipsis: typeof import('naive-ui')['NEllipsis'] + NEmpty: typeof import('naive-ui')['NEmpty'] NForm: typeof import('naive-ui')['NForm'] NFormItem: typeof import('naive-ui')['NFormItem'] + NGi: typeof import('naive-ui')['NGi'] NGrid: typeof import('naive-ui')['NGrid'] NGridItem: typeof import('naive-ui')['NGridItem'] NImage: typeof import('naive-ui')['NImage'] @@ -31,6 +35,7 @@ declare module 'vue' { NModal: typeof import('naive-ui')['NModal'] NNotificationProvider: typeof import('naive-ui')['NNotificationProvider'] NotPassed: typeof import('./src/components/NotPassed.vue')['default'] + NPopconfirm: typeof import('naive-ui')['NPopconfirm'] NPopover: typeof import('naive-ui')['NPopover'] NPopselect: typeof import('naive-ui')['NPopselect'] NProgress: typeof import('naive-ui')['NProgress'] @@ -40,7 +45,11 @@ declare module 'vue' { NSpace: typeof import('naive-ui')['NSpace'] NSpin: typeof import('naive-ui')['NSpin'] NSwitch: typeof import('naive-ui')['NSwitch'] + NTabPane: typeof import('naive-ui')['NTabPane'] + NTabs: typeof import('naive-ui')['NTabs'] NTag: typeof import('naive-ui')['NTag'] + NTimeline: typeof import('naive-ui')['NTimeline'] + NTimelineItem: typeof import('naive-ui')['NTimelineItem'] NTooltip: typeof import('naive-ui')['NTooltip'] NUpload: typeof import('naive-ui')['NUpload'] NUploadDragger: typeof import('naive-ui')['NUploadDragger'] diff --git a/src/api/task/task.ts b/src/api/task/task.ts index a1f80c4..ed23233 100644 --- a/src/api/task/task.ts +++ b/src/api/task/task.ts @@ -94,7 +94,7 @@ export async function getSimilarityList(params: any) { const { data } = res if (data) { - const { records, pages, total } = data + const { records, pages, total, current } = data // 精简一下数据 const list = records.map((item) => { return { @@ -114,6 +114,7 @@ export async function getSimilarityList(params: any) { pageCount: pages, data: records, total, + current, } } else { diff --git a/src/layout/components/Header/RecycleModal.vue b/src/layout/components/Header/RecycleModal.vue index 731b26a..cb45839 100644 --- a/src/layout/components/Header/RecycleModal.vue +++ b/src/layout/components/Header/RecycleModal.vue @@ -1,5 +1,5 @@ @@ -667,18 +728,6 @@ watch(() => show.value, async (newVal) => { 相似度排序 -
@@ -696,26 +745,41 @@ watch(() => show.value, async (newVal) => { 返回
- - + +
- - + +
- -
+
+ 加载错误 show.value, async (newVal) => { :class="{ 'img-fit': viewMode === 'horizontalVersion', 'img-full': viewMode === '3:4' || viewMode === 'verticalVersion' }" - :style="{ backgroundImage: `url(${loading ? bgLoadingImg : 'none'})` }" + :style="{ backgroundImage: `url(${loading ? bgLoadingImg : 'none'})`, display: 'none' }" /> show.value, async (newVal) => { {{ item.similarityScore }}%
-
{{ item?.photoDateTimestamp @@ -765,7 +819,67 @@ watch(() => show.value, async (newVal) => {
- + +
+ 加载错误 + + + + + +
+ {{ item.similarityScore }}% +
+
+
+ + {{ item?.photoDateTimestamp + ? formatToDateHMS(Number(item.photoDateTimestamp)) : '- -' }} +
+
+ + {{ item.submitDateTimestamp + ? formatToDateHMS(Number(item.submitDateTimestamp)) : '- -' }} +
+
+
+
@@ -826,9 +940,19 @@ watch(() => show.value, async (newVal) => { } } +::v-deep(.vue-waterfall) { + overflow-x: hidden; + .vue-waterfall-column { + max-width: 190px; + } +} + .img { + width: 182px; + max-width: 182px; border-radius: 7px; display: block; + opacity: 1 !important; height: 100%; } @@ -846,7 +970,9 @@ watch(() => show.value, async (newVal) => { &-m32 { margin-left: 32px; } - + .grid-item-selected { + background-color: #dae3ff; + } &-content { &-form { display: flex; @@ -884,21 +1010,30 @@ watch(() => show.value, async (newVal) => { &-item { &-img { + width: 182px; border-radius: 7px; display: block; height: 100%; } &-img-fit { - width: 100%; + width: 182px; object-fit: cover; } } + .grid{ + grid-gap: 0px 20px; + } + .grid-item { - width: 214px; - padding: 16px; + box-sizing: content-box; + width: 182px; + padding: 6px; + transition: 0.5s; + margin-bottom: 20px; position: relative; + // background-color: #fff; .tag-status { width: 46px; @@ -909,9 +1044,6 @@ watch(() => show.value, async (newVal) => { } } - .grid-item-selected { - background-color: #dae3ff; - } .percent { position: absolute; @@ -925,7 +1057,7 @@ watch(() => show.value, async (newVal) => { border-radius: 6px 0px 6px 0px; z-index: 5; right: 28px; - top: 20px; + top: 0px; color: #fff; font-size: 14px; @@ -941,10 +1073,10 @@ watch(() => show.value, async (newVal) => { .time { position: absolute; width: 182px; - padding-left: 10px; + // padding-left: 10px; z-index: 3; - left: 16px; - bottom: 16px; + left: 6px; + bottom: 0px; background: linear-gradient(180deg,rgba(6,0,0,0.01),rgba(0, 0, 0, 0.44) 100%); border-radius: 0 0 7px 7px; .time-item { diff --git a/src/store/modules/asideConfig.ts b/src/store/modules/asideConfig.ts index 4fb75fb..ae0dfc5 100644 --- a/src/store/modules/asideConfig.ts +++ b/src/store/modules/asideConfig.ts @@ -13,6 +13,7 @@ export interface ConfigState { isAllowDownload: boolean timeNum: number filterConfig: string[] // 过滤筛选条件 + collapse: boolean // 是否展示左侧筛选条件 } export const useAsideConfigStore = defineStore({ @@ -21,12 +22,16 @@ export const useAsideConfigStore = defineStore({ systemConfig: null, customConfig: null, asideValue: null, - searchValue: "", + searchValue: '', isAllowDownload: true, timeNum: 0, filterConfig: [], + collapse: false, }), getters: { + getCollapse(): boolean { + return this.collapse + }, getConfig(): AsideConfig | null { return this.systemConfig }, @@ -50,6 +55,10 @@ export const useAsideConfigStore = defineStore({ }, }, actions: { + setCollapse(value) { + this.collapse = value + console.log('存起来啊啊 ', this.collapse) + }, setConfig(config: AsideConfig) { this.systemConfig = config }, diff --git a/src/views/home/aside/Aside.vue b/src/views/home/aside/Aside.vue index 6feb639..d11db1e 100644 --- a/src/views/home/aside/Aside.vue +++ b/src/views/home/aside/Aside.vue @@ -70,6 +70,8 @@ mousetrap.bind('[', collapseHandler) function collapseHandler() { collapse.value = !collapse.value + console.log('执行了啊啊啊啊啊啊啊啊啊啊啊啊', collapse.value) + configStore.setCollapse(collapse.value) } const asideWidth = computed(() => { diff --git a/src/views/home/content/Content.vue b/src/views/home/content/Content.vue index 9861822..79a4e6b 100644 --- a/src/views/home/content/Content.vue +++ b/src/views/home/content/Content.vue @@ -6,7 +6,7 @@ import { useInfiniteScroll } from '@vueuse/core' import dayjs from 'dayjs' // import imagesloaded from 'imagesloaded' -import { cloneDeep, debounce, isEqual } from 'lodash-es' +import { cloneDeep } from 'lodash-es' // import Masonry from 'masonry-layout' import { NIcon, useMessage } from 'naive-ui' @@ -147,16 +147,6 @@ useInfiniteScroll( ) onBeforeMount(async () => { - // const more = await featchList() - // more.forEach((item) => { - // item.calHeight = 182 * item.high / item.wide - // }) - // listData.value = more - // const tmore = await featchList() - // tmore.forEach((item) => { - // item.calHeight = 182 * item.high / item.wide - // }) - // listData.value = listData.value.concat(tmore) const screenWidth = window.screen.width if (screenWidth > 1920 && screenWidth <= 2560) cols.value = 11 @@ -189,14 +179,44 @@ const isAllowDownload = ref(true) const calNum = ref(0) const searchValue = ref('') const isInitSeaerch = ref(false) // 是否初始化搜索 +const collapse = ref(1) +nextTick(() => { + configStore.$subscribe(() => { + console.log('subscribe', 'configStore') + isAllowDownload.value = configStore.isAllowDownload + calNum.value = configStore.getTimeNum + // console.log("calNum.value----------", calNum.value); + searchValue.value = configStore.getSearchValue + console.log(configStore.getSearchValue, 'getSearchValue') + collapse.value = configStore.getCollapse ? 1 : 0 + console.log('collapse.value的这个肚饿的点点滴滴的点点滴滴', collapse.value) + }) +}) -configStore.$subscribe(() => { - console.log('subscribe', 'configStore') - isAllowDownload.value = configStore.isAllowDownload - calNum.value = configStore.getTimeNum - // console.log("calNum.value----------", calNum.value); - searchValue.value = configStore.getSearchValue - console.log(configStore.getSearchValue, 'getSearchValue') +watch(() => collapse.value, (newVal, oldVal) => { + // let val = newVal ? 1 : 0; + if (newVal == 1) { + const screenWidth = window.screen.width + if (screenWidth > 1920 && screenWidth <= 2560) + cols.value = 12 + else if (screenWidth <= 1920 && screenWidth >= 1792) + cols.value = 8 + else if (screenWidth < 1792 && screenWidth > 1440) + cols.value = 7 + else if (screenWidth <= 1440) + cols.value = 6 + } + else if (newVal == 0) { + const screenWidth = window.screen.width + if (screenWidth > 1920 && screenWidth <= 2560) + cols.value = 11 + else if (screenWidth <= 1920 && screenWidth >= 1792) + cols.value = 7 + else if (screenWidth < 1792 && screenWidth > 1440) + cols.value = 6 + else if (screenWidth <= 1440) + cols.value = 5 + } }) watch( @@ -224,7 +244,6 @@ watch( watch( () => configStore.getAsideValue, async (newVal, oldVal) => { - console.log('getAsideValue变化了', newVal, oldVal, isEqual(newVal, oldVal)) if (pagination.pageNo > 1 && newVal && !(Object.entries(newVal).toString() === Object.entries(oldVal).toString())) { reset() loadMore() @@ -330,11 +349,6 @@ async function loadMore() { waterfallRef.value?.resize() } else { - // setTimeout(() => { - // const height = el.value?.scrollHeight - 1000 - // console.log('listData.value出来了height', height) - // el.value?.scrollTo({ top: height, behavior: 'smooth' }) - // }, 50) listData.value = listData.value.concat(more) console.log('listData.value出来了', listData.value) waterfallRef.value?.mix() @@ -610,12 +624,13 @@ async function downloadImage(item) { } } -function previewHandler(index: number, event: MouseEvent) { +function previewHandler(index: number, event: MouseEvent, thumburl, imgUrl) { event.stopImmediatePropagation() event.stopPropagation() if (imageRef.value?.[index] && (imageRef.value[index] as any).src) // (imageRef.value?.[index] as any).mergedOnClick() - (imageRef.value?.[index] as any).click() + previewImageUrl(thumburl, imgUrl); + (imageRef.value?.[index] as any).click() } /** @@ -704,11 +719,29 @@ function finish() { console.log('finish') } -function scroll() { +const masonryRef = ref(null) +function loadImg(src) { + const promise = new Promise((resolve, reject) => { + const img = document.createElement('img') + img.src = src + img.onload = function () { + resolve(src) + } + img.onerror = function () { + reject(new Error('加载失败')) + } + }) + return promise } -const masonryRef = ref(null) +function previewImageUrl(img1, img2) { + setTimeout(async () => { + const img = document.getElementsByClassName('n-image-preview').item(0) + await loadImg(img2) + img.src = img2 + }, 50) +} defineExpose({ showLoginSuccessModal, @@ -750,15 +783,8 @@ defineExpose({
- @@ -782,225 +808,225 @@ defineExpose({ {{ totalCount }}
- -
-
-
- +
+
+
- -