diff --git a/components.d.ts b/components.d.ts index 11049e1..3057c17 100644 --- a/components.d.ts +++ b/components.d.ts @@ -10,23 +10,12 @@ declare module 'vue' { Application: typeof import('./src/components/Application/Application.vue')['default'] BasicModal: typeof import('./src/components/Modal/BasicModal.vue')['default'] DataHeader: typeof import('./src/components/DataHeader/index.vue')['default'] - NAvatar: typeof import('naive-ui')['NAvatar'] NButton: typeof import('naive-ui')['NButton'] - NCard: typeof import('naive-ui')['NCard'] NCheckbox: typeof import('naive-ui')['NCheckbox'] - NCollapse: typeof import('naive-ui')['NCollapse'] - NCollapseItem: typeof import('naive-ui')['NCollapseItem'] NConfigProvider: typeof import('naive-ui')['NConfigProvider'] - NDatePicker: typeof import('naive-ui')['NDatePicker'] NDialogProvider: typeof import('naive-ui')['NDialogProvider'] - NDivider: typeof import('naive-ui')['NDivider'] - NDropdown: typeof import('naive-ui')['NDropdown'] 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'] NInput: typeof import('naive-ui')['NInput'] NMessageProvider: typeof import('naive-ui')['NMessageProvider'] NModal: typeof import('naive-ui')['NModal'] diff --git a/src/assets/icons/lctname.svg b/src/assets/icons/lctname.svg new file mode 100644 index 0000000..404f96d --- /dev/null +++ b/src/assets/icons/lctname.svg @@ -0,0 +1,23 @@ + + + 位图 2 + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/views/task/content/Content.vue b/src/views/task/content/Content.vue index 591a015..15f6c00 100644 --- a/src/views/task/content/Content.vue +++ b/src/views/task/content/Content.vue @@ -8,202 +8,207 @@ import { ref, unref, watch, -} from 'vue' -import { chunk, clone } from 'lodash-es' -import { useDialog, useMessage } from 'naive-ui' -import { useRoute, useRouter } from 'vue-router' -import { useInfiniteScroll } from '@vueuse/core' -import BatchModal from '../modal/BatchModal.vue' -import CustomSettingModal from '../modal/CustomSettingModal.vue' -import PictureTable from './PictureTable.vue' -import TaskTable from './TaskTable.vue' -import History from './History.vue' -import NotPassed from '@/components/Approval/NotPassed.vue' -import { getAllfieldList, getfieldList } from '@/api/home/filter' -import { TASK_STATUS_OBJ } from '@/enums/index' -import { useFinal } from '@/store/modules/final' +} from "vue"; +import { chunk, clone } from "lodash-es"; +import { useDialog, useMessage } from "naive-ui"; +import { useRoute, useRouter } from "vue-router"; +import { useInfiniteScroll } from "@vueuse/core"; +import BatchModal from "../modal/BatchModal.vue"; +import CustomSettingModal from "../modal/CustomSettingModal.vue"; +import PictureTable from "./PictureTable.vue"; +import TaskTable from "./TaskTable.vue"; +import History from "./History.vue"; +import NotPassed from "@/components/Approval/NotPassed.vue"; +import { getAllfieldList, getfieldList } from "@/api/home/filter"; +import { TASK_STATUS_OBJ } from "@/enums/index"; +import { useFinal } from "@/store/modules/final"; import { audit, dubiousfileyd, getSimilarityList, getTaskDetailInfo, -} from '@/api/task/task' -import { useTask } from '@/store/modules/task' -import { useUser } from '@/store/modules/user' -import { isEmpty } from '@/utils' -import { formatToDateHMS } from '@/utils/dateUtil' -import { hideDownload } from '@/utils/image' - -const emit = defineEmits(['setAsideItemName']) - -const router = useRouter() -const loading = ref(false) -const batch = ref(false) -const batchtwo = ref(false) -const selectItems = ref([]) -const message = useMessage() -const dialog = useDialog() -const notPassModalRef = ref(null) -const batchModalRef: any = ref(null) -const totalCount = ref(0) -const taskId: any = ref('') // 任务id -const packageId: any = ref('') // 包id -const CustomSettingModalRef = ref(null) -const taskTableData = ref([]) -const route = useRoute() -const isDetail = ref(false) // 是否是详情 -const finalStore = useFinal() -const imgbigshow = ref(true) +} from "@/api/task/task"; +import { useTask } from "@/store/modules/task"; +import { useUser } from "@/store/modules/user"; +import { isEmpty } from "@/utils"; +import { formatToDateHMS } from "@/utils/dateUtil"; +import { hideDownload } from "@/utils/image"; + +const emit = defineEmits(["setAsideItemName"]); + +const router = useRouter(); +const loading = ref(false); +const batch = ref(false); +const batchtwo = ref(false); +const selectItems = ref([]); +const message = useMessage(); +const dialog = useDialog(); +const notPassModalRef = ref(null); +const batchModalRef: any = ref(null); +const totalCount = ref(0); +const taskId: any = ref(""); // 任务id +const packageId: any = ref(""); // 包id +const CustomSettingModalRef = ref(null); +const taskTableData = ref([]); +const route = useRoute(); +const isDetail = ref(false); // 是否是详情 +const finalStore = useFinal(); +const imgbigshow = ref(true); const sortBy: any = { - orderType: 'desc', - orderName: 'similarityScore', -} -const el = ref(null) + orderType: "desc", + orderName: "similarityScore", +}; +const el = ref(null); const pagination = reactive({ pageNo: 0, pageSize: 30, -}) +}); function onCheckChange(checked: any, item: any) { - const index = selectItems.value.indexOf(item) - item.checked = checked + const index = selectItems.value.indexOf(item); + item.checked = checked; - if (index === -1 && checked) - selectItems.value.push(item) - else selectItems.value.splice(index, 1) + if (index === -1 && checked) selectItems.value.push(item); + else selectItems.value.splice(index, 1); } const showActions = computed(() => { - return selectItems.value.length > 0 && batch -}) + return selectItems.value.length > 0 && batch; +}); const taskpagination = reactive({ pageNo: 1, pageSize: 30, -}) -const taskStore = useTask() -const overTask = ref(null) -const overTasktwo = ref(null) -const taskDetailInfo = ref({}) -const taskDetailPictureList = ref([]) -const userStore = useUser() -const imageRef = ref() -let processItems: any[] = [] -const isFullScreen = ref(false) +}); +const taskStore = useTask(); +const overTask = ref(null); +const overTasktwo = ref(null); +const taskDetailInfo = ref({}); +const taskDetailPictureList = ref([]); +const userStore = useUser(); +const imageRef = ref(); +let processItems: any[] = []; +const isFullScreen = ref(false); const fullscreenStyles = computed(() => ({ - width: isFullScreen.value ? '100vw' : '', - height: isFullScreen.value ? '100vh' : '', - position: isFullScreen.value ? 'fixed' : '', - top: isFullScreen.value ? '0' : '', - left: isFullScreen.value ? '0' : '', - zIndex: isFullScreen.value ? '100' : '', -})) - + width: isFullScreen.value ? "100vw" : "", + height: isFullScreen.value ? "100vh" : "", + position: isFullScreen.value ? "fixed" : "", + top: isFullScreen.value ? "0" : "", + left: isFullScreen.value ? "0" : "", + zIndex: isFullScreen.value ? "100" : "", +})); +const fullscreenStylestwo = computed(() => ({ + width: isFullScreen.value ? "100vw" : "", + height: isFullScreen.value ? "100vh" : "", + position: isFullScreen.value ? "fixed" : "", + top: isFullScreen.value ? "0" : "", + left: isFullScreen.value ? "0" : "", + zIndex: isFullScreen.value ? "160" : "", +})); onMounted(() => { - window.addEventListener('keydown', handleKeydown) + window.addEventListener("keydown", handleKeydown); if (route.query.id) { - taskId.value = route.query.id - packageId.value = route.query.packageid - isDetail.value = true - getDetail() + taskId.value = route.query.id; + packageId.value = route.query.packageid; + isDetail.value = true; + getDetail(); } -}) +}); -let lastKeyPressTime = 0 -let keyPressTimer = null +let lastKeyPressTime = 0; +let keyPressTimer = null; function changeimgbigshow() { - imgbigshow.value = !imgbigshow.value + imgbigshow.value = !imgbigshow.value; } -const doubleClickInterval = 300 // 可以自定义间隔时间,单位是毫秒 +const doubleClickInterval = 300; // 可以自定义间隔时间,单位是毫秒 // 键盘左右箭头快捷切换 function handleKeydown(event) { - if (event.key === 'ArrowLeft') { backHandler() } + if (event.key === "ArrowLeft") { + backHandler(); + } // 在这里执行左箭头的逻辑 - else if (event.key === 'ArrowRight') { forwardHandler() } + else if (event.key === "ArrowRight") { + forwardHandler(); + } // 在这里执行右箭头的逻辑 else if (event.keyCode === 67) { - isFullScreen.value = false + isFullScreen.value = false; // batchModalRef.value.closeModal() - } - else if (event.keyCode === 27) { - overTask.value = null - overTasktwo.value = null - } - else if (event.key === 'p' || event.key === 'P') { + } else if (event.keyCode === 27) { + overTask.value = null; + overTasktwo.value = null; + } else if (event.key === "p" || event.key === "P") { // 获取当前时间 - const now = Date.now() + const now = Date.now(); // 如果两次按键时间间隔小于我们设定的双击间隔,则认为是双击 if (now - lastKeyPressTime < doubleClickInterval) { // 清除已经设置的定时器(如果有的话) - clearTimeout(keyPressTimer) - const item = taskDetailInfo.value + clearTimeout(keyPressTimer); + const item = taskDetailInfo.value; if ( - item?.userapprove?.statshis === 2 - || item?.userapprove?.statshis == 3 + item?.userapprove?.statshis === 2 || + item?.userapprove?.statshis == 3 ) { - overTask.value = null - return + overTask.value = null; + return; } if (validate([item]) == null && batch.value === false) - overTask.value = item + overTask.value = item; // 执行想要的操作 - approvalHandler() + approvalHandler(); // 重置上次按键时间 - lastKeyPressTime = 0 - } - else { + lastKeyPressTime = 0; + } else { // 如果不是双击,则更新上次按键时间,并开始一个新的计时器 - lastKeyPressTime = now + lastKeyPressTime = now; // 通过定时器重置上次按键时间 // 这可以防止如果用户只按了一次键,也会触发双击的情况 - clearTimeout(keyPressTimer) + clearTimeout(keyPressTimer); keyPressTimer = setTimeout(() => { - lastKeyPressTime = 0 - }, doubleClickInterval) + lastKeyPressTime = 0; + }, doubleClickInterval); } - } - else if (event.key === 'x' || event.key === 'X') { + } else if (event.key === "x" || event.key === "X") { // 获取当前时间 - const now = Date.now() + const now = Date.now(); // 如果两次按键时间间隔小于我们设定的双击间隔,则认为是双击 if (now - lastKeyPressTime < doubleClickInterval) { // 清除已经设置的定时器(如果有的话) - clearTimeout(keyPressTimer) - const item = taskDetailInfo.value + clearTimeout(keyPressTimer); + const item = taskDetailInfo.value; if ( - item?.userapprove?.statshis === 2 - || item?.userapprove?.statshis == 3 + item?.userapprove?.statshis === 2 || + item?.userapprove?.statshis == 3 ) { - overTask.value = null - return + overTask.value = null; + return; } if (validate([item]) == null && batch.value === false) - overTask.value = item + overTask.value = item; // 执行想要的操作 - const modal = unref(notPassModalRef)! as any - modal.showModal([taskDetailInfo.value]) + const modal = unref(notPassModalRef)! as any; + modal.showModal([taskDetailInfo.value]); // 重置上次按键时间 - lastKeyPressTime = 0 - } - else { + lastKeyPressTime = 0; + } else { // 如果不是双击,则更新上次按键时间,并开始一个新的计时器 - lastKeyPressTime = now + lastKeyPressTime = now; // 通过定时器重置上次按键时间 // 这可以防止如果用户只按了一次键,也会触发双击的情况 - clearTimeout(keyPressTimer) + clearTimeout(keyPressTimer); keyPressTimer = setTimeout(() => { - lastKeyPressTime = 0 - }, doubleClickInterval) + lastKeyPressTime = 0; + }, doubleClickInterval); } } } @@ -212,27 +217,26 @@ function setBatch(value: boolean) { // if (totalCount.value === 0) // return - batch.value = value + batch.value = value; if (value === false) { - taskDetailInfo.value.checked = false - selectItems.value = [] + taskDetailInfo.value.checked = false; + selectItems.value = []; taskDetailPictureList.value.forEach((item) => { - item.checked = false - }) + item.checked = false; + }); } } // 从store里面获取任务id function currentTaskId() { - const index = taskStore.getCurrentIndex - return taskStore.getApprovalList[index]?.id || '' + const index = taskStore.getCurrentIndex; + return taskStore.getApprovalList[index]?.id || ""; } // states:1未提交,2待审批,3通过,4不通过 function validate(items: any[]) { - if (items.length === 0) - return '至少选中一个任务' + if (items.length === 0) return "至少选中一个任务"; // const useInfo = userStore.getUserInfo // const username = useInfo.loginname @@ -249,182 +253,180 @@ function validate(items: any[]) { // return '审批人不一致' // } - return null + return null; } function approvalHandler(items?: any) { - let cloneItem: any + let cloneItem: any; if (batch.value) { - processItems = selectItems.value - } - else if (overTask.value) { - cloneItem = clone(overTask.value) - processItems = [cloneItem] + processItems = selectItems.value; + } else if (overTask.value) { + cloneItem = clone(overTask.value); + processItems = [cloneItem]; } if (items !== undefined && !(items instanceof PointerEvent)) - processItems = items + processItems = items; - const msg = validate(processItems) + const msg = validate(processItems); if (msg !== null) { - message.error(msg) - return + message.error(msg); + return; } - console.log(processItems) + console.log(processItems); - const list: any = [] + const list: any = []; processItems.forEach((item) => { list.push({ formId: item.id, taskId: item.taskId, taskName: item.fromTaskName, - }) - }) + }); + }); const param = { result: true, - comment: '', - disposeType: '', - disposeTypeId: '', - failCauseId: '', - failCauseName: '', + comment: "", + disposeType: "", + disposeTypeId: "", + failCauseId: "", + failCauseName: "", flowTaskInfoList: list, - } + }; dialog.info({ - title: '确认提示', - content: '确认给该任务审批为【通过】吗?', - positiveText: '确定', - negativeText: '取消', + title: "确认提示", + content: "确认给该任务审批为【通过】吗?", + positiveText: "确定", + negativeText: "取消", onPositiveClick: () => { - doAudit(param) - overTask.value = null + doAudit(param); + overTask.value = null; }, onNegativeClick: () => { - overTask.value = null + overTask.value = null; }, - }) + }); } function approvalHandlerx(item?: any) { - console.log(item) - alert(1) + console.log(item); + alert(1); } function singleRejectHandlex(item?: any) { - console.log(item) - const modal = unref(notPassModalRef)! as any + console.log(item); + const modal = unref(notPassModalRef)! as any; - modal.showModal([item]) + modal.showModal([item]); } function rejectHandler(items?: any) { - console.log(items) - const modal = unref(notPassModalRef)! as any - modal.showModal(items) + console.log(items); + const modal = unref(notPassModalRef)! as any; + modal.showModal(items); } function singleRejectHandler() { - const modal = unref(notPassModalRef)! as any - modal.showModal([taskDetailInfo.value]) + const modal = unref(notPassModalRef)! as any; + modal.showModal([taskDetailInfo.value]); } function doAudit(param: any) { audit(param).then((res) => { - const { code } = res - if (code === 'OK') { - message.success(res.message) - setBatch(false) - reloadList(param, '通过') - batchModalRef.value.reload() + const { code } = res; + if (code === "OK") { + message.success(res.message); + setBatch(false); + reloadList(param, "通过"); + batchModalRef.value.reload(); } - }) + }); } function showModal(modalRef: any) { - const modal = unref(modalRef)! as any - modal.showModal(taskId.value) + const modal = unref(modalRef)! as any; + modal.showModal(taskId.value); } function forwardHandler() { - taskStore.forward() + taskStore.forward(); } function backHandler() { - taskStore.back() + taskStore.back(); } async function handleDragEnd(event, item) { - console.log(event, item) + console.log(event, item); // 可以在这里添加拖拽结束后的逻辑 - const flag = taskStore.getInFile + const flag = taskStore.getInFile; if (flag) { - const res = await dubiousfileyd({ pictureid: item.pictureId }) - if (res.code === 'OK') { - message.success('加入成功') - setBatch(false) - getTableData() - getImgList() + const res = await dubiousfileyd({ pictureid: item.pictureId }); + if (res.code === "OK") { + message.success("加入成功"); + setBatch(false); + getTableData(); + getImgList(); } - taskStore.setInFile(false) - taskStore.setInFile(item.pictureId) + taskStore.setInFile(false); + taskStore.setInFile(item.pictureId); } } async function addSuspicious() { - taskStore.setInFileId(taskDetailInfo.value.ocrPicture) - console.log(taskDetailInfo.value.ocrPicture) + taskStore.setInFileId(taskDetailInfo.value.ocrPicture); + console.log(taskDetailInfo.value.ocrPicture); if (taskDetailInfo.value.ocrPicture.pictureid) { const res = await dubiousfileyd({ pictureid: taskDetailInfo.value.ocrPicture.id, - }) - - if (res.code === 'OK') { - message.success('加入成功') - setBatch(false) - getTableData() - getImgList() - } - else { - message.error(res.message) + }); + + if (res.code === "OK") { + message.success("加入成功"); + setBatch(false); + getTableData(); + getImgList(); + } else { + message.error(res.message); } - taskStore.setInFile(false) + taskStore.setInFile(false); } } async function getTableData() { - const useInfo = userStore.getUserInfo - const listData = [] - const reviewType = 3 // 类型 - let res = await getAllfieldList(reviewType) - const fieldList = (res as any)?.data - res = await getfieldList(reviewType, useInfo.id) - const userFieldList = (res as any)?.data.userFieldFixed + const useInfo = userStore.getUserInfo; + const listData = []; + const reviewType = 3; // 类型 + let res = await getAllfieldList(reviewType); + const fieldList = (res as any)?.data; + res = await getfieldList(reviewType, useInfo.id); + const userFieldList = (res as any)?.data.userFieldFixed; const blueList = [ - '拜访终端名称', - '定位信息', - '拜访日期', - '定位距离', - '拜访小结', - '拜访项目类别', - ] + "拜访终端名称", + "定位信息", + "拜访日期", + "定位距离", + "拜访小结", + "拜访项目类别", + ]; fieldList.map((v) => { if (userFieldList.includes(v.name)) { - let locationobj = { address: '' } - if (v.name == 'location') - locationobj = JSON.parse(taskDetailInfo.value.ocrPicture[v.name]) + let locationobj = { address: "" }; + if (v.name == "location") + locationobj = JSON.parse(taskDetailInfo.value.ocrPicture[v.name]); const item = { label: v.fieldDesc, value: - v.name == 'location' + v.name == "location" ? locationobj.address : taskDetailInfo.value.ocrPicture[v.name], key: v.name, blue: blueList.includes(v.fieldDesc), - } - listData.push(item) + }; + listData.push(item); } - }) - taskTableData.value = chunk(listData, 2) + }); + taskTableData.value = chunk(listData, 2); } async function getImgList() { @@ -433,227 +435,218 @@ async function getImgList() { ...taskpagination, ...sortBy, pictureId: taskDetailInfo.value.ocrPicture.id, - }) - taskDetailPictureList.value = data - totalCount.value = total - } - else { - taskDetailPictureList.value.length = 0 - totalCount.value = 0 + }); + taskDetailPictureList.value = data; + totalCount.value = total; + } else { + taskDetailPictureList.value.length = 0; + totalCount.value = 0; } } function overTaskHandle() { - const item = taskDetailInfo.value + const item = taskDetailInfo.value; if (item?.userapprove?.statshis === 2 || item?.userapprove?.statshis == 3) { - overTask.value = null - return + overTask.value = null; + return; } - if (validate([item]) == null && batch.value === false) - overTask.value = item + if (validate([item]) == null && batch.value === false) overTask.value = item; } function leaveTaskHandler() { - overTask.value = null - overTasktwo.value = null + overTask.value = null; + overTasktwo.value = null; } function showActionsModal() { - const modal = unref(CustomSettingModalRef)! as any - modal.showModal() + const modal = unref(CustomSettingModalRef)! as any; + modal.showModal(); } onUnmounted(() => { - taskStore.reset() - window.removeEventListener('keydown', handleKeydown) -}) + taskStore.reset(); + window.removeEventListener("keydown", handleKeydown); +}); function immersionHandler() { + imgbigshow.value = true; // taskStore.updateImmersion() - toggleFullScreen() + toggleFullScreen(); } // 切换全屏状态 function toggleFullScreen() { - isFullScreen.value = !isFullScreen.value + isFullScreen.value = !isFullScreen.value; if (isFullScreen.value) { - fetchData() - window.addEventListener('scroll', checkBottom) - } - else { - window.removeEventListener('scroll', checkBottom) + fetchData(); + window.addEventListener("scroll", checkBottom); + } else { + window.removeEventListener("scroll", checkBottom); } } function previewHandler(event: MouseEvent) { - event.stopImmediatePropagation() - event.stopPropagation() + event.stopImmediatePropagation(); + event.stopPropagation(); if (imageRef.value && (imageRef.value as any).src) - (imageRef.value as any).mergedOnClick() + (imageRef.value as any).mergedOnClick(); } watch( () => [taskStore.activeId], () => { if (!isEmpty(taskStore.getActiveId)) { - packageId.value = taskStore.getPackageid - taskId.value = taskStore.getActiveId - getDetail() + packageId.value = taskStore.getPackageid; + taskId.value = taskStore.getActiveId; + getDetail(); } - }, -) + } +); // 获取数据 async function getDetail() { - taskDetailInfo.value = await getTaskDetailInfo(taskId.value, packageId.value) - setBatch(false) - getTableData() - getImgList() + taskDetailInfo.value = await getTaskDetailInfo(taskId.value, packageId.value); + setBatch(false); + getTableData(); + getImgList(); } function notPassSuccess(param) { - batchModalRef.value.reload() - reloadList(param, '不通过') - overTask.value = null + batchModalRef.value.reload(); + reloadList(param, "不通过"); + overTask.value = null; } function reloadList(param, text) { // 修改左侧状态 - const id = currentTaskId() + const id = currentTaskId(); const hasCurrentId = param.flowTaskInfoList.find( - item => item.formId === id, - ) - finalStore.setListKey() - if (hasCurrentId) - emit('setAsideItemName', text) + (item) => item.formId === id + ); + finalStore.setListKey(); + if (hasCurrentId) emit("setAsideItemName", text); - getDetail() + getDetail(); } function goBack() { - router.back() + router.back(); } function switchBatch() { - setBatch(!batch.value) + setBatch(!batch.value); } function getrowValue(e) { - if (e.key == 'location') { - const locationobj = JSON.parse(taskDetailInfo.value.ocrPicture.location) - const lat = locationobj.lat.$numberDecimal - const lng = locationobj.lng.$numberDecimal - const name = e.value - const protocol = window.location.protocol - const hostname = window.location.hostname - const port = window.location.port - const hostWithPort = `${protocol}//${hostname}:${port}/` - window.open( - `${hostWithPort}map` + `?name=${name}&lat=${lat}&lng=${lng}`, - ) + if (e.key == "location") { + const locationobj = JSON.parse(taskDetailInfo.value.ocrPicture.location); + const lat = locationobj.lat.$numberDecimal; + const lng = locationobj.lng.$numberDecimal; + const name = e.value; + const protocol = window.location.protocol; + const hostname = window.location.hostname; + const port = window.location.port; + const hostWithPort = `${protocol}//${hostname}:${port}/`; + window.open(`${hostWithPort}map` + `?name=${name}&lat=${lat}&lng=${lng}`); } } function overTaskHandelr(item: any) { if (item?.historyStates === 2 || item?.historyStates == 3) { - overTasktwo.value = null - return + overTasktwo.value = null; + return; } if (validate([item]) == null && batchtwo.value === false) - overTasktwo.value = item + overTasktwo.value = item; } function closePassno() { - console.log(notPassModalRef.value) - overTask.value = null + console.log(notPassModalRef.value); + overTask.value = null; } // const loadingx = ref(false); -const items = ref([]) -const scrollContainer = ref(null) -let debounceTimer +const items = ref([]); +const scrollContainer = ref(null); +let debounceTimer; async function fetchData() { - if (loading.value) - return // 如果已经在加载中,则不重复加载 + if (loading.value) return; // 如果已经在加载中,则不重复加载 - loading.value = true + loading.value = true; try { - loadMore() - } - finally { - loading.value = false + loadMore(); + } finally { + loading.value = false; } } // const throttledCheckScroll = throttle(checkBottom, 200); -let num = 1 +let num = 1; // 检查是否滚动到底部 function checkBottom() { - const container = scrollContainer.value + const container = scrollContainer.value; // console.log(1) - if (!container) - return + if (!container) return; // const { scrollTop, clientHeight, scrollHeight } = container; - const scrollTop = window.pageYOffset || document.documentElement.scrollTop + const scrollTop = window.pageYOffset || document.documentElement.scrollTop; // 获取视口的内部高度 - const clientHeight - = window.innerHeight || document.documentElement.clientHeight + const clientHeight = + window.innerHeight || document.documentElement.clientHeight; // 获取整个文档的高度 - const scrollHeight = document.documentElement.scrollHeight + const scrollHeight = document.documentElement.scrollHeight; - clearTimeout(debounceTimer) + clearTimeout(debounceTimer); debounceTimer = setTimeout(() => { if (scrollTop + clientHeight >= scrollHeight - 10) { - num = num + 1 - console.log(num) - fetchData() // 接近底部时加载更多数据 + num = num + 1; + console.log(num); + fetchData(); // 接近底部时加载更多数据 } - }, 500) + }, 500); } async function loadMore() { - console.log(loading.value) + console.log(loading.value); if (loading.value) { - const more = await fetchList() - taskDetailPictureList.value.push(...more) - console.log(taskDetailPictureList) + const more = await fetchList(); + taskDetailPictureList.value.push(...more); + console.log(taskDetailPictureList); } } -let canloadMore = true +let canloadMore = true; async function fetchList() { try { - pagination.pageNo += 1 + pagination.pageNo += 1; const { data, pageCount, total } = await getSimilarityList({ ...pagination, ...sortBy, pictureId: taskDetailInfo.value.ocrPicture.id, - }) - canloadMore = pageCount >= pagination.pageNo && pageCount > 0 - totalCount.value = total - return data - } - catch (error) { - canloadMore = false - return [] + }); + canloadMore = pageCount >= pagination.pageNo && pageCount > 0; + totalCount.value = total; + return data; + } catch (error) { + canloadMore = false; + return []; } } async function reset() { - pagination.pageNo = 0 - pagination.pageSize = 30 - taskDetailPictureList.value.length = 0 - loading.value = false - canloadMore = true + pagination.pageNo = 0; + pagination.pageSize = 30; + taskDetailPictureList.value.length = 0; + loading.value = false; + canloadMore = true; // layout() } async function refreshHandler() { - getImgList() + getImgList(); } -function sortHandler(orderby: 'similarityScore' | 'createdate') { - sortBy.orderName = orderby - sortBy.orderType = sortBy.orderType === 'asc' ? 'desc' : 'asc' - refreshHandler() +function sortHandler(orderby: "similarityScore" | "createdate") { + sortBy.orderName = orderby; + sortBy.orderType = sortBy.orderType === "asc" ? "desc" : "asc"; + refreshHandler(); } @@ -661,7 +654,7 @@ function sortHandler(orderby: 'similarityScore' | 'createdate') {
@@ -742,14 +735,14 @@ function sortHandler(orderby: 'similarityScore' | 'createdate') { src="@/assets/images/task/btn-not-pass.png" alt="" @click.stop="rejectHandler(selectItems)" - > + /> + />
@@ -766,11 +759,25 @@ function sortHandler(orderby: 'similarityScore' | 'createdate') { :style=" isFullScreen ? { - height: '596px', - } + height: '596px', + } : {} " > +
@@ -795,18 +802,19 @@ function sortHandler(orderby: 'similarityScore' | 'createdate') { isFullScreen ? imgbigshow ? { - 'position': 'relative', - 'flex': 2, - 'background-image': `url(${taskDetailInfo?.ocrPicture?.imgurl})`, - } + position: 'relative', + flex: 0.75, + 'background-image': `url(${taskDetailInfo?.ocrPicture?.imgurl})`, + } : { - 'height': '92vh', - 'flex': 2, + height: '92vh', + flex: 1, + + 'background-image': `url(${taskDetailInfo?.ocrPicture?.imgurl})`, + } + : { 'background-image': `url(${taskDetailInfo?.ocrPicture?.imgurl})`, } - : { - 'background-image': `url(${taskDetailInfo?.ocrPicture?.imgurl})`, - } " @mouseover="overTaskHandle" @mouseleave="leaveTaskHandler" @@ -847,13 +855,13 @@ function sortHandler(orderby: 'similarityScore' | 'createdate') { class="img-status" src="@/assets/images/task/pass.png" alt="" - > + /> + />
+ /> @@ -896,11 +904,12 @@ function sortHandler(orderby: 'similarityScore' | 'createdate') { class="icon-status" src="@/assets/images/task/similarity.png" alt="" - > + /> - {{ totalCount }} + {{ totalCount }} 相似匹配 @@ -930,8 +939,8 @@ function sortHandler(orderby: 'similarityScore' | 'createdate') { {{ taskDetailInfo?.ocrPicture?.submitDateTimestamp ? formatToDateHMS( - Number(taskDetailInfo.ocrPicture.submitDateTimestamp), - ) + Number(taskDetailInfo.ocrPicture.submitDateTimestamp) + ) : "-" }}
@@ -951,10 +960,11 @@ function sortHandler(orderby: 'similarityScore' | 'createdate') { :style=" isFullScreen ? { - width: '320px', - borderLeft: '2px solid #507AFD', - position: 'relative', - } + flex: '0.25', + borderLeft: '2px solid #507AFD', + position: 'relative', + borderRadius: 0, + } : {} " > @@ -1019,13 +1029,13 @@ function sortHandler(orderby: 'similarityScore' | 'createdate') { class="tag-status" src="@/assets/images/task/tag-pass.png" alt="" - > + /> + />
- + {{ taskDetailInfo.fromtaskname }}
@@ -1075,8 +1087,8 @@ function sortHandler(orderby: 'similarityScore' | 'createdate') {
@@ -1096,11 +1108,15 @@ function sortHandler(orderby: 'similarityScore' | 'createdate') {
-
-
+
+
+
{{ item[0].value }}
@@ -1181,7 +1204,8 @@ function sortHandler(orderby: 'similarityScore' | 'createdate') { color: #333333; font-family: PingFang SC, PingFang SC-Medium; " - >相似图片({{ totalCount }}) + >相似图片({{ totalCount }})
+ /> + />
-->
import { ref, watch } from "vue"; -import * as XLSX from 'xlsx'; +import * as XLSX from "xlsx"; defineProps({ data: { @@ -12,13 +12,13 @@ defineProps({ default: () => [[]], }, }); -const emit = defineEmits(["showModal","getrowValue"]); +const emit = defineEmits(["showModal", "getrowValue"]); function showActionsModal() { emit("showModal"); } -function getrowvalue(row){ - emit("getrowValue",row); +function getrowvalue(row) { + emit("getrowValue", row); } @@ -37,13 +37,27 @@ function getrowvalue(row){ {{ item[0].label }} - + + + {{ item[0].value }} {{ item[1].label }} - + + + + {{ item[1].value }} diff --git a/src/views/task/index.vue b/src/views/task/index.vue index 9eb6e38..da75ee2 100644 --- a/src/views/task/index.vue +++ b/src/views/task/index.vue @@ -32,6 +32,9 @@ function setAsideItemName(text) { :deep(.wrapper){ top:0 } +:deep(.ip_box){ + z-index: 105; +} .main { display: flex; flex-direction: row; diff --git a/src/views/task/modal/CustomFieldModal.vue b/src/views/task/modal/CustomFieldModal.vue index c50b804..aedb35c 100644 --- a/src/views/task/modal/CustomFieldModal.vue +++ b/src/views/task/modal/CustomFieldModal.vue @@ -1,10 +1,12 @@