|
|
|
|
@ -1,14 +1,15 @@
|
|
|
|
|
<script lang="ts" setup>
|
|
|
|
|
import { EllipsisHorizontal, EyeOutline as EyeOutlineIcon } from "@vicons/ionicons5";
|
|
|
|
|
import { Download as DownloadIcon, Upload as UploadIcon } from "@vicons/tabler";
|
|
|
|
|
import { Icon } from "@vicons/utils";
|
|
|
|
|
import { useInfiniteScroll } from "@vueuse/core";
|
|
|
|
|
import dayjs from "dayjs";
|
|
|
|
|
import imagesloaded from "imagesloaded";
|
|
|
|
|
import { cloneDeep, debounce } from "lodash-es";
|
|
|
|
|
import Masonry from "masonry-layout";
|
|
|
|
|
import { NIcon, useMessage } from "naive-ui";
|
|
|
|
|
import type { Component } from "vue";
|
|
|
|
|
/** eslint-disable */
|
|
|
|
|
import { EllipsisHorizontal, EyeOutline as EyeOutlineIcon } from '@vicons/ionicons5'
|
|
|
|
|
import { Download as DownloadIcon, Upload as UploadIcon } from '@vicons/tabler'
|
|
|
|
|
import { Icon } from '@vicons/utils'
|
|
|
|
|
import { useInfiniteScroll } from '@vueuse/core'
|
|
|
|
|
import dayjs from 'dayjs'
|
|
|
|
|
import imagesloaded from 'imagesloaded'
|
|
|
|
|
import { cloneDeep, debounce } from 'lodash-es'
|
|
|
|
|
import Masonry from 'masonry-layout'
|
|
|
|
|
import { NIcon, useMessage } from 'naive-ui'
|
|
|
|
|
import type { Component } from 'vue'
|
|
|
|
|
import {
|
|
|
|
|
computed,
|
|
|
|
|
h,
|
|
|
|
|
@ -20,25 +21,25 @@ import {
|
|
|
|
|
ref,
|
|
|
|
|
unref,
|
|
|
|
|
watch,
|
|
|
|
|
} from "vue";
|
|
|
|
|
import axios from "axios";
|
|
|
|
|
import CheckingTaskModal from "./modal/CheckingTaskModal.vue";
|
|
|
|
|
import FinishPackageModal from "./modal/FinishPackageModal.vue";
|
|
|
|
|
import GeneratePackageModal from "./modal/GeneratePackageModal.vue";
|
|
|
|
|
import LoginSuccessModal from "./modal/LoginSuccessModal.vue";
|
|
|
|
|
import PackageSettingsModal from "./modal/PackageSettingsModal.vue";
|
|
|
|
|
import QueryRepeatedTasksModal from "./modal/QueryRepeatedTasksModal.vue";
|
|
|
|
|
import type { PictureSortParam } from "/#/api";
|
|
|
|
|
import defaultAvatar from "@/assets/icons/avatar.svg";
|
|
|
|
|
import baseImg from "@/assets/images/baseImg.png";
|
|
|
|
|
import { getImgUrl } from "@/utils/urlUtils";
|
|
|
|
|
import emitter from "@/utils/mitt";
|
|
|
|
|
import { hideDownload } from "@/utils/image";
|
|
|
|
|
import { getViewportOffset } from "@/utils/domUtils";
|
|
|
|
|
import { useConfig } from "@/store/modules/asideConfig";
|
|
|
|
|
import { useWindowSizeFn } from "@/hooks/event/useWindowSizeFn";
|
|
|
|
|
import { timeOptions, viewOptions } from "@/config/home";
|
|
|
|
|
import avatar from "@/assets/images/avatar.jpg";
|
|
|
|
|
} from 'vue'
|
|
|
|
|
import axios from 'axios'
|
|
|
|
|
import CheckingTaskModal from './modal/CheckingTaskModal.vue'
|
|
|
|
|
import FinishPackageModal from './modal/FinishPackageModal.vue'
|
|
|
|
|
import GeneratePackageModal from './modal/GeneratePackageModal.vue'
|
|
|
|
|
import LoginSuccessModal from './modal/LoginSuccessModal.vue'
|
|
|
|
|
import PackageSettingsModal from './modal/PackageSettingsModal.vue'
|
|
|
|
|
import QueryRepeatedTasksModal from './modal/QueryRepeatedTasksModal.vue'
|
|
|
|
|
import type { PictureSortParam } from '/#/api'
|
|
|
|
|
import defaultAvatar from '@/assets/icons/avatar.svg'
|
|
|
|
|
import baseImg from '@/assets/images/baseImg.png'
|
|
|
|
|
import { getImgUrl } from '@/utils/urlUtils'
|
|
|
|
|
import emitter from '@/utils/mitt'
|
|
|
|
|
import { hideDownload } from '@/utils/image'
|
|
|
|
|
import { getViewportOffset } from '@/utils/domUtils'
|
|
|
|
|
import { useConfig } from '@/store/modules/asideConfig'
|
|
|
|
|
import { useWindowSizeFn } from '@/hooks/event/useWindowSizeFn'
|
|
|
|
|
import { timeOptions, viewOptions } from '@/config/home'
|
|
|
|
|
import avatar from '@/assets/images/avatar.jpg'
|
|
|
|
|
import {
|
|
|
|
|
createPackage,
|
|
|
|
|
getCheckDuplicateStatus,
|
|
|
|
|
@ -47,178 +48,178 @@ import {
|
|
|
|
|
oneClickCheckTaskPackage,
|
|
|
|
|
queryPageListByCheckNo,
|
|
|
|
|
removeCheckDuplicate,
|
|
|
|
|
} from "@/api/home/main";
|
|
|
|
|
|
|
|
|
|
const listData = ref<any[]>([]);
|
|
|
|
|
const timer = ref();
|
|
|
|
|
const showClose = ref(false);
|
|
|
|
|
const deviceHeight = ref(600);
|
|
|
|
|
let _masonry: null | Masonry = null;
|
|
|
|
|
let _imagesload: any;
|
|
|
|
|
const masonryRef = ref<ComponentRef>(null);
|
|
|
|
|
const el = ref<HTMLDivElement | null>(null);
|
|
|
|
|
const viewMode = ref("masonry");
|
|
|
|
|
} from '@/api/home/main'
|
|
|
|
|
|
|
|
|
|
const listData = ref<any[]>([])
|
|
|
|
|
const timer = ref()
|
|
|
|
|
const showClose = ref(false)
|
|
|
|
|
const deviceHeight = ref(600)
|
|
|
|
|
let _masonry: null | Masonry = null
|
|
|
|
|
let _imagesload: any
|
|
|
|
|
const masonryRef = ref<ComponentRef>(null)
|
|
|
|
|
const el = ref<HTMLDivElement | null>(null)
|
|
|
|
|
const viewMode = ref('masonry')
|
|
|
|
|
const pagination = reactive({
|
|
|
|
|
pageNo: 0,
|
|
|
|
|
pageSize: 30,
|
|
|
|
|
});
|
|
|
|
|
const configStore = useConfig();
|
|
|
|
|
const packageModalRef = ref(null);
|
|
|
|
|
const generateModalRef = ref(null);
|
|
|
|
|
const queryRepeatedTasksModalRef = ref(null);
|
|
|
|
|
const LoginSuccessModalRef = ref(null);
|
|
|
|
|
const checkingTaskModalRef = ref(null);
|
|
|
|
|
const finishPackageModal = ref(null);
|
|
|
|
|
const loading = ref(false);
|
|
|
|
|
const message = useMessage();
|
|
|
|
|
const totalCount = ref(0);
|
|
|
|
|
})
|
|
|
|
|
const configStore = useConfig()
|
|
|
|
|
const packageModalRef = ref(null)
|
|
|
|
|
const generateModalRef = ref(null)
|
|
|
|
|
const queryRepeatedTasksModalRef = ref(null)
|
|
|
|
|
const LoginSuccessModalRef = ref(null)
|
|
|
|
|
const checkingTaskModalRef = ref(null)
|
|
|
|
|
const finishPackageModal = ref(null)
|
|
|
|
|
const loading = ref(false)
|
|
|
|
|
const message = useMessage()
|
|
|
|
|
const totalCount = ref(0)
|
|
|
|
|
const sortBy: PictureSortParam = {
|
|
|
|
|
orderbyname: "desc",
|
|
|
|
|
orderbyvalue: "pictureResult",
|
|
|
|
|
};
|
|
|
|
|
const imageRef = ref<ComponentElRef | null>();
|
|
|
|
|
const checkDuplicateNo = ref("");
|
|
|
|
|
const checkTaskStatus = ref(null); // 1.执行中 2.执行完毕 3.执行失败
|
|
|
|
|
const isRefresh = ref(true); // 生成任务包前,点击刷新数据,并将【一键查重】切换按钮为【生成任务包】
|
|
|
|
|
orderbyname: 'desc',
|
|
|
|
|
orderbyvalue: 'pictureResult',
|
|
|
|
|
}
|
|
|
|
|
const imageRef = ref<ComponentElRef | null>()
|
|
|
|
|
const checkDuplicateNo = ref('')
|
|
|
|
|
const checkTaskStatus = ref(null) // 1.执行中 2.执行完毕 3.执行失败
|
|
|
|
|
const isRefresh = ref(true) // 生成任务包前,点击刷新数据,并将【一键查重】切换按钮为【生成任务包】
|
|
|
|
|
|
|
|
|
|
let canloadMore = true;
|
|
|
|
|
let filterId = null;
|
|
|
|
|
let canloadMore = true
|
|
|
|
|
let filterId = null
|
|
|
|
|
|
|
|
|
|
async function computeListHeight() {
|
|
|
|
|
const headEl = document.querySelector(".wrapper-content")!;
|
|
|
|
|
const { bottomIncludeBody } = getViewportOffset(headEl);
|
|
|
|
|
const height = bottomIncludeBody;
|
|
|
|
|
deviceHeight.value = height - 40 - 16 - 24;
|
|
|
|
|
const headEl = document.querySelector('.wrapper-content')!
|
|
|
|
|
const { bottomIncludeBody } = getViewportOffset(headEl)
|
|
|
|
|
const height = bottomIncludeBody
|
|
|
|
|
deviceHeight.value = height - 40 - 16 - 24
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
useWindowSizeFn(computeListHeight);
|
|
|
|
|
useWindowSizeFn(computeListHeight)
|
|
|
|
|
|
|
|
|
|
const listStyle = computed(() => {
|
|
|
|
|
return {
|
|
|
|
|
height: `${deviceHeight.value}px`,
|
|
|
|
|
};
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const layout = debounce(() => {
|
|
|
|
|
if (masonryRef.value == null || el.value == null)
|
|
|
|
|
return;
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
if (_masonry !== null)
|
|
|
|
|
(_masonry as any).addItems();
|
|
|
|
|
(_masonry as any).addItems()
|
|
|
|
|
|
|
|
|
|
_masonry = new Masonry(masonryRef.value as any, {
|
|
|
|
|
itemSelector: ".grid-item",
|
|
|
|
|
itemSelector: '.grid-item',
|
|
|
|
|
gutter: 17,
|
|
|
|
|
columnWidth: 182,
|
|
|
|
|
percentPosition: true,
|
|
|
|
|
stagger: 10,
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
_imagesload = imagesloaded(".grid-item");
|
|
|
|
|
_imagesload = imagesloaded('.grid-item')
|
|
|
|
|
|
|
|
|
|
_imagesload.on("done", (instance) => {
|
|
|
|
|
(_masonry as any).layout();
|
|
|
|
|
_imagesload.on('done', (instance) => {
|
|
|
|
|
(_masonry as any).layout()
|
|
|
|
|
if (!el.value)
|
|
|
|
|
return;
|
|
|
|
|
loading.value = false;
|
|
|
|
|
});
|
|
|
|
|
return
|
|
|
|
|
loading.value = false
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
_imagesload.on("fail", (instance) => {
|
|
|
|
|
message.error("图片错误");
|
|
|
|
|
loading.value = false;
|
|
|
|
|
});
|
|
|
|
|
}, 300);
|
|
|
|
|
_imagesload.on('fail', (instance) => {
|
|
|
|
|
message.error('图片错误')
|
|
|
|
|
loading.value = false
|
|
|
|
|
})
|
|
|
|
|
}, 300)
|
|
|
|
|
|
|
|
|
|
useInfiniteScroll(
|
|
|
|
|
el as any,
|
|
|
|
|
() => {
|
|
|
|
|
loadMore();
|
|
|
|
|
loadMore()
|
|
|
|
|
},
|
|
|
|
|
{ distance: 10, canLoadMore: () => canloadMore },
|
|
|
|
|
);
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
onUpdated(() => {
|
|
|
|
|
layout();
|
|
|
|
|
});
|
|
|
|
|
layout()
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const timeRange = ref("");
|
|
|
|
|
const timeRange = ref('')
|
|
|
|
|
const timeLabel = computed(() => {
|
|
|
|
|
const item = timeOptions.find((option) => {
|
|
|
|
|
return option.value === timeRange.value;
|
|
|
|
|
});
|
|
|
|
|
return option.value === timeRange.value
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
return item?.label;
|
|
|
|
|
});
|
|
|
|
|
return item?.label
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const viewLabel = computed(() => {
|
|
|
|
|
const item = viewOptions.find((option) => {
|
|
|
|
|
return option.value === viewMode.value;
|
|
|
|
|
});
|
|
|
|
|
return option.value === viewMode.value
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
return item?.label;
|
|
|
|
|
});
|
|
|
|
|
return item?.label
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const isAllowDownload = ref(true);
|
|
|
|
|
const calNum = ref(0);
|
|
|
|
|
const searchValue = ref("");
|
|
|
|
|
const isInitSeaerch = ref(false); // 是否初始化搜索
|
|
|
|
|
const isAllowDownload = ref(true)
|
|
|
|
|
const calNum = ref(0)
|
|
|
|
|
const searchValue = ref('')
|
|
|
|
|
const isInitSeaerch = ref(false) // 是否初始化搜索
|
|
|
|
|
|
|
|
|
|
configStore.$subscribe(() => {
|
|
|
|
|
console.log("subscribe", "configStore");
|
|
|
|
|
isAllowDownload.value = configStore.isAllowDownload;
|
|
|
|
|
calNum.value = configStore.getTimeNum;
|
|
|
|
|
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");
|
|
|
|
|
});
|
|
|
|
|
searchValue.value = configStore.getSearchValue
|
|
|
|
|
console.log(configStore.getSearchValue, 'getSearchValue')
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
watch(
|
|
|
|
|
() => searchValue.value,
|
|
|
|
|
async (newVal, oldVal) => {
|
|
|
|
|
if (newVal) {
|
|
|
|
|
isInitSeaerch.value = true;
|
|
|
|
|
pagination.pageNo = 0;
|
|
|
|
|
const more = await featchList();
|
|
|
|
|
listData.value = more;
|
|
|
|
|
isInitSeaerch.value = false;
|
|
|
|
|
isInitSeaerch.value = true
|
|
|
|
|
pagination.pageNo = 0
|
|
|
|
|
const more = await featchList()
|
|
|
|
|
listData.value = more
|
|
|
|
|
isInitSeaerch.value = false
|
|
|
|
|
// configStore.setSearchValue("");
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
isInitSeaerch.value = true;
|
|
|
|
|
pagination.pageNo = 0;
|
|
|
|
|
const more = await featchList();
|
|
|
|
|
listData.value = more;
|
|
|
|
|
isInitSeaerch.value = false;
|
|
|
|
|
isInitSeaerch.value = true
|
|
|
|
|
pagination.pageNo = 0
|
|
|
|
|
const more = await featchList()
|
|
|
|
|
listData.value = more
|
|
|
|
|
isInitSeaerch.value = false
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
async function featchList(userSearchId?: string) {
|
|
|
|
|
loading.value = true;
|
|
|
|
|
loading.value = true
|
|
|
|
|
try {
|
|
|
|
|
const contentParams = {
|
|
|
|
|
search_month: timeRange.value,
|
|
|
|
|
search_history: 0,
|
|
|
|
|
userSearchId,
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pagination.pageNo += 1;
|
|
|
|
|
const searchValue = configStore.getSearchValue; // rao
|
|
|
|
|
const asideParams = unref(configStore.getAsideValue);
|
|
|
|
|
const params = filterId ? { userSearchId: filterId } : cloneDeep(asideParams);
|
|
|
|
|
pagination.pageNo += 1
|
|
|
|
|
const searchValue = configStore.getSearchValue // rao
|
|
|
|
|
const asideParams = unref(configStore.getAsideValue)
|
|
|
|
|
const params = filterId ? { userSearchId: filterId } : cloneDeep(asideParams)
|
|
|
|
|
let result = {
|
|
|
|
|
pageCount: 0,
|
|
|
|
|
data: [],
|
|
|
|
|
total: 0,
|
|
|
|
|
};
|
|
|
|
|
const sortObj: any = {}; // rao start
|
|
|
|
|
if (sortBy.orderbyvalue == "pictureResult")
|
|
|
|
|
sortObj.ordertype = sortBy.orderbyname;
|
|
|
|
|
else if (sortBy.orderbyvalue == "fromuptime")
|
|
|
|
|
sortObj.orderByTime = sortBy.orderbyname;
|
|
|
|
|
}
|
|
|
|
|
const sortObj: any = {} // rao start
|
|
|
|
|
if (sortBy.orderbyvalue == 'pictureResult')
|
|
|
|
|
sortObj.ordertype = sortBy.orderbyname
|
|
|
|
|
else if (sortBy.orderbyvalue == 'fromuptime')
|
|
|
|
|
sortObj.orderByTime = sortBy.orderbyname
|
|
|
|
|
|
|
|
|
|
if (params.izsimilarity && typeof params.izsimilarity != "string")
|
|
|
|
|
params.izsimilarity = params.izsimilarity.join("-");
|
|
|
|
|
if (params.izsimilarity && typeof params.izsimilarity != 'string')
|
|
|
|
|
params.izsimilarity = params.izsimilarity.join('-')
|
|
|
|
|
|
|
|
|
|
// rao end
|
|
|
|
|
|
|
|
|
|
@ -230,7 +231,7 @@ async function featchList(userSearchId?: string) {
|
|
|
|
|
...sortObj,
|
|
|
|
|
checkDuplicateNo: checkDuplicateNo.value,
|
|
|
|
|
upUserName: searchValue,
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
result = await getPictureList({
|
|
|
|
|
@ -239,11 +240,11 @@ async function featchList(userSearchId?: string) {
|
|
|
|
|
...params,
|
|
|
|
|
...sortObj,
|
|
|
|
|
upUserName: searchValue,
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
const { data, pageCount, total } = result;
|
|
|
|
|
totalCount.value = total;
|
|
|
|
|
canloadMore = pageCount >= pagination.pageNo && pageCount > 0;
|
|
|
|
|
const { data, pageCount, total } = result
|
|
|
|
|
totalCount.value = total
|
|
|
|
|
canloadMore = pageCount >= pagination.pageNo && pageCount > 0
|
|
|
|
|
|
|
|
|
|
const list = data.map((item) => {
|
|
|
|
|
return {
|
|
|
|
|
@ -255,172 +256,168 @@ async function featchList(userSearchId?: string) {
|
|
|
|
|
similar: item.similarityscore || -1,
|
|
|
|
|
imgName: item.imgname,
|
|
|
|
|
loadOver: false,
|
|
|
|
|
};
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
return list;
|
|
|
|
|
return list
|
|
|
|
|
}
|
|
|
|
|
catch (error) {
|
|
|
|
|
canloadMore = false;
|
|
|
|
|
return [];
|
|
|
|
|
canloadMore = false
|
|
|
|
|
return []
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async function loadMore() {
|
|
|
|
|
if (loading.value || el.value == null)
|
|
|
|
|
return;
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
const more = await featchList();
|
|
|
|
|
const more = await featchList()
|
|
|
|
|
// if(isInitSeaerch.value) {
|
|
|
|
|
// listData.value = [];
|
|
|
|
|
// isInitSeaerch.value = false;
|
|
|
|
|
// }
|
|
|
|
|
listData.value.push(...more);
|
|
|
|
|
listData.value.push(...more)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const gridHeight = computed(() => {
|
|
|
|
|
let height = "";
|
|
|
|
|
if (viewMode.value === "masonry")
|
|
|
|
|
height = "";
|
|
|
|
|
else if (viewMode.value === "horizontalVersion")
|
|
|
|
|
height = "145px";
|
|
|
|
|
else if (viewMode.value === "verticalVersion")
|
|
|
|
|
height = "300px";
|
|
|
|
|
else if (viewMode.value === "3:4")
|
|
|
|
|
height = "240px";
|
|
|
|
|
|
|
|
|
|
return height;
|
|
|
|
|
});
|
|
|
|
|
let height = ''
|
|
|
|
|
if (viewMode.value === 'masonry')
|
|
|
|
|
height = ''
|
|
|
|
|
else if (viewMode.value === 'horizontalVersion')
|
|
|
|
|
height = '145px'
|
|
|
|
|
else if (viewMode.value === 'verticalVersion')
|
|
|
|
|
height = '300px'
|
|
|
|
|
else if (viewMode.value === '3:4')
|
|
|
|
|
height = '240px'
|
|
|
|
|
|
|
|
|
|
return height
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
async function oneCheck() {
|
|
|
|
|
const asideVal = cloneDeep(configStore.getAsideValue);
|
|
|
|
|
asideVal.upUserName = searchValue.value;
|
|
|
|
|
console.log("searchValue", asideVal, searchValue.value);
|
|
|
|
|
const asideVal = cloneDeep(configStore.getAsideValue)
|
|
|
|
|
asideVal.upUserName = searchValue.value
|
|
|
|
|
console.log('searchValue', asideVal, searchValue.value)
|
|
|
|
|
|
|
|
|
|
if (asideVal.izyear && asideVal.izyear.length == 2) {
|
|
|
|
|
asideVal.izyear
|
|
|
|
|
= `${dayjs(asideVal.izyear[0]).format("YYYY/MM/DD")
|
|
|
|
|
}-${
|
|
|
|
|
dayjs(asideVal.izyear[1]).format("YYYY/MM/DD")}`;
|
|
|
|
|
asideVal.izyear = `${dayjs(asideVal.izyear[0]).format('YYYY/MM/DD')}-${dayjs(
|
|
|
|
|
asideVal.izyear[1],
|
|
|
|
|
).format('YYYY/MM/DD')}`
|
|
|
|
|
}
|
|
|
|
|
if (asideVal.izsimilarity && typeof asideVal.izsimilarity != "string")
|
|
|
|
|
asideVal.izsimilarity = asideVal.izsimilarity.join("-");
|
|
|
|
|
if (asideVal.izsimilarity && typeof asideVal.izsimilarity != 'string')
|
|
|
|
|
asideVal.izsimilarity = asideVal.izsimilarity.join('-')
|
|
|
|
|
|
|
|
|
|
const tasksLoadingModal = queryRepeatedTasksModalRef.value as any;
|
|
|
|
|
const tasksLoadingModal = queryRepeatedTasksModalRef.value as any
|
|
|
|
|
|
|
|
|
|
console.log("calNum.value111111111111111", calNum.value, checkTaskStatus.value);
|
|
|
|
|
console.log('calNum.value111111111111111', calNum.value, checkTaskStatus.value)
|
|
|
|
|
if (calNum.value == 0 && isRefresh.value) {
|
|
|
|
|
if (timer.value)
|
|
|
|
|
clearInterval(timer.value);
|
|
|
|
|
clearInterval(timer.value)
|
|
|
|
|
|
|
|
|
|
timer.value = setInterval(() => {
|
|
|
|
|
console.log("calNum.value2222222222222", calNum.value, checkTaskStatus.value);
|
|
|
|
|
console.log('calNum.value2222222222222', calNum.value, checkTaskStatus.value)
|
|
|
|
|
if (checkDuplicateNo.value) {
|
|
|
|
|
getCheckDuplicateStatus(checkDuplicateNo.value).then((res) => {
|
|
|
|
|
if (res.code === "OK") {
|
|
|
|
|
checkTaskStatus.value = res.data.status;
|
|
|
|
|
if (res.code === 'OK') {
|
|
|
|
|
checkTaskStatus.value = res.data.status
|
|
|
|
|
if (calNum.value < 90)
|
|
|
|
|
calNum.value = calNum.value + 10;
|
|
|
|
|
calNum.value = calNum.value + 10
|
|
|
|
|
|
|
|
|
|
configStore.setTimeNum(calNum.value);
|
|
|
|
|
configStore.setTimeNum(calNum.value)
|
|
|
|
|
if (checkTaskStatus.value === 2 || checkTaskStatus.value === 3) {
|
|
|
|
|
if (checkTaskStatus.value === 2)
|
|
|
|
|
message.success("任务执行完毕,正在刷新数据...");
|
|
|
|
|
else
|
|
|
|
|
message.error("查询异常");
|
|
|
|
|
message.success('任务执行完毕,正在刷新数据...')
|
|
|
|
|
else message.error('查询异常')
|
|
|
|
|
|
|
|
|
|
tasksLoadingModal.closeOnlyModal();
|
|
|
|
|
configStore.setTimeNum(100);
|
|
|
|
|
tasksLoadingModal.closeOnlyModal()
|
|
|
|
|
configStore.setTimeNum(100)
|
|
|
|
|
if (timer.value)
|
|
|
|
|
clearInterval(timer.value);
|
|
|
|
|
clearInterval(timer.value)
|
|
|
|
|
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
configStore.setTimeNum(0);
|
|
|
|
|
}, 1000);
|
|
|
|
|
reset();
|
|
|
|
|
loadMore();
|
|
|
|
|
configStore.setTimeNum(0)
|
|
|
|
|
}, 1000)
|
|
|
|
|
reset()
|
|
|
|
|
loadMore()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
if (timer.value)
|
|
|
|
|
clearInterval(timer.value);
|
|
|
|
|
|
|
|
|
|
clearInterval(timer.value)
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}, 1000);
|
|
|
|
|
}, 1000)
|
|
|
|
|
}
|
|
|
|
|
// 查重任务编号,状态不为空,或者状态执行中..
|
|
|
|
|
if (checkDuplicateNo.value && checkTaskStatus.value && checkTaskStatus.value === 1) {
|
|
|
|
|
// 暂时rao
|
|
|
|
|
tasksLoadingModal.showModal();
|
|
|
|
|
return;
|
|
|
|
|
tasksLoadingModal.showModal()
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
// 调用查重任务开启流程
|
|
|
|
|
oneClickCheckTaskPackage(asideVal).then((res) => {
|
|
|
|
|
if (res.code === "OK") {
|
|
|
|
|
checkDuplicateNo.value = res.data.checkDuplicateNo;
|
|
|
|
|
checkTaskStatus.value = res.data.status;
|
|
|
|
|
tasksLoadingModal.showModal(); // 暂时rao
|
|
|
|
|
if (res.code === 'OK') {
|
|
|
|
|
checkDuplicateNo.value = res.data.checkDuplicateNo
|
|
|
|
|
checkTaskStatus.value = res.data.status
|
|
|
|
|
tasksLoadingModal.showModal() // 暂时rao
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
message.error(res.message || "查重失败");
|
|
|
|
|
message.error(res.message || '查重失败')
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 显示添加任务包
|
|
|
|
|
*/
|
|
|
|
|
async function showAddPackage() {
|
|
|
|
|
const modal = packageModalRef.value as any;
|
|
|
|
|
modal.showModal();
|
|
|
|
|
const modal = packageModalRef.value as any
|
|
|
|
|
modal.showModal()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 查重任务加载提示框,关闭回调
|
|
|
|
|
async function tasksLoadingCloseCallback() {
|
|
|
|
|
const checkingTaskModal = checkingTaskModalRef.value as any;
|
|
|
|
|
checkingTaskModal.showModal();
|
|
|
|
|
const checkingTaskModal = checkingTaskModalRef.value as any
|
|
|
|
|
checkingTaskModal.showModal()
|
|
|
|
|
if (isRefresh.value)
|
|
|
|
|
refresh(true);
|
|
|
|
|
|
|
|
|
|
refresh(true)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async function showLoginSuccessModal() {
|
|
|
|
|
const modal = LoginSuccessModalRef.value as any;
|
|
|
|
|
modal.showModal();
|
|
|
|
|
const modal = LoginSuccessModalRef.value as any
|
|
|
|
|
modal.showModal()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 包id
|
|
|
|
|
const packageIdRef = ref("");
|
|
|
|
|
const packageIdRef = ref('')
|
|
|
|
|
|
|
|
|
|
async function commitHandler(settingParam) {
|
|
|
|
|
const params = {
|
|
|
|
|
name: settingParam.packagename,
|
|
|
|
|
checkDuplicateNo: checkDuplicateNo.value,
|
|
|
|
|
};
|
|
|
|
|
const modal = generateModalRef.value as any;
|
|
|
|
|
const finishModal = finishPackageModal.value as any;
|
|
|
|
|
modal.showModal();
|
|
|
|
|
}
|
|
|
|
|
const modal = generateModalRef.value as any
|
|
|
|
|
const finishModal = finishPackageModal.value as any
|
|
|
|
|
modal.showModal()
|
|
|
|
|
createPackage(params).then((res) => {
|
|
|
|
|
if (res.code === "OK") {
|
|
|
|
|
message.success(res.message);
|
|
|
|
|
packageIdRef.value = res.data.id;
|
|
|
|
|
modal.closeModal();
|
|
|
|
|
finishModal.showModal();
|
|
|
|
|
if (res.code === 'OK') {
|
|
|
|
|
message.success(res.message)
|
|
|
|
|
packageIdRef.value = res.data.id
|
|
|
|
|
modal.closeModal()
|
|
|
|
|
finishModal.showModal()
|
|
|
|
|
// 清空查重任务状态和编号
|
|
|
|
|
checkDuplicateNo.value = "";
|
|
|
|
|
checkTaskStatus.value = null;
|
|
|
|
|
checkDuplicateNo.value = ''
|
|
|
|
|
checkTaskStatus.value = null
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
const asideVal = configStore.getAsideValue;
|
|
|
|
|
const finalParam = { ...asideVal };
|
|
|
|
|
finalParam.buessinessno = settingParam.packagename;
|
|
|
|
|
finalParam.search_history = settingParam.comparehistory ? 1 : 0;
|
|
|
|
|
})
|
|
|
|
|
const asideVal = configStore.getAsideValue
|
|
|
|
|
const finalParam = { ...asideVal }
|
|
|
|
|
finalParam.buessinessno = settingParam.packagename
|
|
|
|
|
finalParam.search_history = settingParam.comparehistory ? 1 : 0
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
emitter.on("filter", refreshHandler);
|
|
|
|
|
emitter.on('filter', refreshHandler)
|
|
|
|
|
// emitter.on("filter", (searchId)=>{
|
|
|
|
|
// console.log("emitter on filter" + searchId)
|
|
|
|
|
// reset();
|
|
|
|
|
@ -428,119 +425,118 @@ onMounted(() => {
|
|
|
|
|
// });
|
|
|
|
|
// 一件键重——获取任务编号
|
|
|
|
|
getLastCheckNo().then((res) => {
|
|
|
|
|
if (res.code === "OK")
|
|
|
|
|
checkDuplicateNo.value = res.data;
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
if (res.code === 'OK')
|
|
|
|
|
checkDuplicateNo.value = res.data
|
|
|
|
|
})
|
|
|
|
|
nextTick(() => {
|
|
|
|
|
computeListHeight();
|
|
|
|
|
computeListHeight()
|
|
|
|
|
// 登录后展示成功
|
|
|
|
|
// showLoginSuccessModal()
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
onUnmounted(() => {
|
|
|
|
|
emitter.off("filter", refreshHandler);
|
|
|
|
|
});
|
|
|
|
|
emitter.off('filter', refreshHandler)
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
watch(timeRange, () => {
|
|
|
|
|
refreshHandler();
|
|
|
|
|
});
|
|
|
|
|
refreshHandler()
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
watch(
|
|
|
|
|
() => configStore.asideValue,
|
|
|
|
|
(newVal, oldVal) => {
|
|
|
|
|
refreshHandler();
|
|
|
|
|
refreshHandler()
|
|
|
|
|
},
|
|
|
|
|
{ deep: true },
|
|
|
|
|
);
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
function reset() {
|
|
|
|
|
pagination.pageNo = 0;
|
|
|
|
|
pagination.pageSize = 30;
|
|
|
|
|
listData.value.length = 0;
|
|
|
|
|
loading.value = false;
|
|
|
|
|
canloadMore = true;
|
|
|
|
|
filterId = null;
|
|
|
|
|
|
|
|
|
|
layout();
|
|
|
|
|
pagination.pageNo = 0
|
|
|
|
|
pagination.pageSize = 30
|
|
|
|
|
listData.value.length = 0
|
|
|
|
|
loading.value = false
|
|
|
|
|
canloadMore = true
|
|
|
|
|
filterId = null
|
|
|
|
|
|
|
|
|
|
layout()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async function refreshHandler(filtersearchId?: any) {
|
|
|
|
|
reset();
|
|
|
|
|
reset()
|
|
|
|
|
|
|
|
|
|
if (filtersearchId)
|
|
|
|
|
filterId = filtersearchId;
|
|
|
|
|
filterId = filtersearchId
|
|
|
|
|
|
|
|
|
|
nextTick(() => {
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
useInfiniteScroll(
|
|
|
|
|
el as any,
|
|
|
|
|
() => {
|
|
|
|
|
loadMore();
|
|
|
|
|
loadMore()
|
|
|
|
|
},
|
|
|
|
|
{ distance: 10, canLoadMore: () => canloadMore },
|
|
|
|
|
);
|
|
|
|
|
}, 300);
|
|
|
|
|
});
|
|
|
|
|
)
|
|
|
|
|
}, 300)
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function getAvatar(url: string): string {
|
|
|
|
|
return url ? getImgUrl(url) : avatar;
|
|
|
|
|
return url ? getImgUrl(url) : avatar
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function sortHandler(orderby: "pictureResult" | "fromuptime") {
|
|
|
|
|
sortBy.orderbyvalue = orderby;
|
|
|
|
|
sortBy.orderbyname = sortBy.orderbyname === "asc" ? "desc" : "asc";
|
|
|
|
|
function sortHandler(orderby: 'pictureResult' | 'fromuptime') {
|
|
|
|
|
sortBy.orderbyvalue = orderby
|
|
|
|
|
sortBy.orderbyname = sortBy.orderbyname === 'asc' ? 'desc' : 'asc'
|
|
|
|
|
|
|
|
|
|
refreshHandler();
|
|
|
|
|
refreshHandler()
|
|
|
|
|
}
|
|
|
|
|
async function downloadImage(item) {
|
|
|
|
|
if (!item.imgUrl) {
|
|
|
|
|
message.error("请输入有效的图片链接地址");
|
|
|
|
|
return;
|
|
|
|
|
message.error('请输入有效的图片链接地址')
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
try {
|
|
|
|
|
// 使用 fetch 发送 GET 请求获取图片
|
|
|
|
|
const response = await fetch(item.imgUrl, {
|
|
|
|
|
method: "GET",
|
|
|
|
|
mode: "cors", // 确保跨域请求被正确处理
|
|
|
|
|
cache: "default",
|
|
|
|
|
});
|
|
|
|
|
method: 'GET',
|
|
|
|
|
mode: 'cors', // 确保跨域请求被正确处理
|
|
|
|
|
cache: 'default',
|
|
|
|
|
})
|
|
|
|
|
// 检查响应状态码,确保请求成功
|
|
|
|
|
if (!response.ok)
|
|
|
|
|
throw new Error(`HTTP error! Status: ${response.status}`);
|
|
|
|
|
throw new Error(`HTTP error! Status: ${response.status}`)
|
|
|
|
|
|
|
|
|
|
// 读取 Blob 数据
|
|
|
|
|
const blob = await response.blob();
|
|
|
|
|
const blob = await response.blob()
|
|
|
|
|
|
|
|
|
|
// 创建一个新的a标签
|
|
|
|
|
const link = document.createElement("a");
|
|
|
|
|
link.href = URL.createObjectURL(blob);
|
|
|
|
|
link.download = item.imgName; // 设置下载的文件名
|
|
|
|
|
link.style.display = "none"; // 隐藏链接
|
|
|
|
|
const link = document.createElement('a')
|
|
|
|
|
link.href = URL.createObjectURL(blob)
|
|
|
|
|
link.download = item.imgName // 设置下载的文件名
|
|
|
|
|
link.style.display = 'none' // 隐藏链接
|
|
|
|
|
|
|
|
|
|
// 将链接添加到 DOM 中
|
|
|
|
|
document.body.appendChild(link);
|
|
|
|
|
document.body.appendChild(link)
|
|
|
|
|
|
|
|
|
|
// 触发下载
|
|
|
|
|
link.click();
|
|
|
|
|
link.click()
|
|
|
|
|
|
|
|
|
|
// 清理
|
|
|
|
|
URL.revokeObjectURL(link.href);
|
|
|
|
|
document.body.removeChild(link);
|
|
|
|
|
URL.revokeObjectURL(link.href)
|
|
|
|
|
document.body.removeChild(link)
|
|
|
|
|
}
|
|
|
|
|
catch (error) {
|
|
|
|
|
console.error("下载图片时发生错误:", error);
|
|
|
|
|
console.error('下载图片时发生错误:', error)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function previewHandler(index: number, event: MouseEvent) {
|
|
|
|
|
event.stopImmediatePropagation();
|
|
|
|
|
event.stopPropagation();
|
|
|
|
|
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();
|
|
|
|
|
(imageRef.value?.[index] as any).click()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
@ -548,11 +544,11 @@ function previewHandler(index: number, event: MouseEvent) {
|
|
|
|
|
*/
|
|
|
|
|
function refresh(val?: any) {
|
|
|
|
|
// delete asideVal.izsimilarity
|
|
|
|
|
const checkingTaskModal = checkingTaskModalRef.value as any;
|
|
|
|
|
const checkingTaskModal = checkingTaskModalRef.value as any
|
|
|
|
|
if (checkDuplicateNo.value) {
|
|
|
|
|
getCheckDuplicateStatus(checkDuplicateNo.value).then((res) => {
|
|
|
|
|
if (res.code === "OK") {
|
|
|
|
|
checkTaskStatus.value = res.data.status; // 1.执行中 2.执行完毕
|
|
|
|
|
if (res.code === 'OK') {
|
|
|
|
|
checkTaskStatus.value = res.data.status // 1.执行中 2.执行完毕
|
|
|
|
|
// if (isRefresh.value === false) {
|
|
|
|
|
// const modal = packageModalRef.value as any
|
|
|
|
|
// modal.showModal()
|
|
|
|
|
@ -563,27 +559,24 @@ function refresh(val?: any) {
|
|
|
|
|
(checkTaskStatus.value === 2 || checkTaskStatus.value === 3)
|
|
|
|
|
&& isRefresh.value
|
|
|
|
|
) {
|
|
|
|
|
configStore.setTimeNum(100);
|
|
|
|
|
checkingTaskModal.closeModal();
|
|
|
|
|
isRefresh.value = false;
|
|
|
|
|
configStore.setTimeNum(100)
|
|
|
|
|
checkingTaskModal.closeModal()
|
|
|
|
|
isRefresh.value = false
|
|
|
|
|
if (checkTaskStatus.value === 2)
|
|
|
|
|
message.success("任务执行完毕,正在刷新数据...");
|
|
|
|
|
else
|
|
|
|
|
message.error("查询异常");
|
|
|
|
|
message.success('任务执行完毕,正在刷新数据...')
|
|
|
|
|
else message.error('查询异常')
|
|
|
|
|
|
|
|
|
|
if (timer.value)
|
|
|
|
|
clearInterval(timer.value);
|
|
|
|
|
clearInterval(timer.value)
|
|
|
|
|
|
|
|
|
|
reset();
|
|
|
|
|
loadMore();
|
|
|
|
|
configStore.setTimeNum(0);
|
|
|
|
|
reset()
|
|
|
|
|
loadMore()
|
|
|
|
|
configStore.setTimeNum(0)
|
|
|
|
|
}
|
|
|
|
|
else if (checkTaskStatus.value === 1) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
@ -592,12 +585,12 @@ function refresh(val?: any) {
|
|
|
|
|
function cancel() {
|
|
|
|
|
if (checkTaskStatus.value === 1) {
|
|
|
|
|
removeCheckDuplicate(checkDuplicateNo.value).then((res) => {
|
|
|
|
|
if (res.code === "OK") {
|
|
|
|
|
checkDuplicateNo.value = "";
|
|
|
|
|
checkTaskStatus.value = null;
|
|
|
|
|
message.success("查重任务取消成功");
|
|
|
|
|
if (res.code === 'OK') {
|
|
|
|
|
checkDuplicateNo.value = ''
|
|
|
|
|
checkTaskStatus.value = null
|
|
|
|
|
message.success('查重任务取消成功')
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -605,36 +598,31 @@ function renderIcon(icon: Component) {
|
|
|
|
|
return () => {
|
|
|
|
|
return h(NIcon, null, {
|
|
|
|
|
default: () => h(icon),
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const dropdownOptions = ref([
|
|
|
|
|
{
|
|
|
|
|
label: "导入任务数据",
|
|
|
|
|
key: "profile",
|
|
|
|
|
label: '导入任务数据',
|
|
|
|
|
key: 'profile',
|
|
|
|
|
icon: renderIcon(UploadIcon),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "导出任务数据",
|
|
|
|
|
key: "editProfile",
|
|
|
|
|
label: '导出任务数据',
|
|
|
|
|
key: 'editProfile',
|
|
|
|
|
icon: renderIcon(DownloadIcon),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "查看导入记录",
|
|
|
|
|
key: "logout",
|
|
|
|
|
label: '查看导入记录',
|
|
|
|
|
key: 'logout',
|
|
|
|
|
icon: renderIcon(EyeOutlineIcon),
|
|
|
|
|
},
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
function loadImgOver(item) {
|
|
|
|
|
console.log("loadImgOver", item);
|
|
|
|
|
setTimeout(() => (item.loadOver = true), 2000);
|
|
|
|
|
}
|
|
|
|
|
])
|
|
|
|
|
|
|
|
|
|
defineExpose({
|
|
|
|
|
showLoginSuccessModal,
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<template>
|
|
|
|
|
|