fix: 合并test分支处理冲突

pull/178/head
zhouxiaoan 2 years ago
commit 037f5d30d0

8
components.d.ts vendored

@ -11,7 +11,6 @@ declare module 'vue' {
BasicModal: typeof import('./src/components/Modal/BasicModal.vue')['default'] BasicModal: typeof import('./src/components/Modal/BasicModal.vue')['default']
DataHeader: typeof import('./src/components/DataHeader/index.vue')['default'] DataHeader: typeof import('./src/components/DataHeader/index.vue')['default']
NAvatar: typeof import('naive-ui')['NAvatar'] NAvatar: typeof import('naive-ui')['NAvatar']
NBackTop: typeof import('naive-ui')['NBackTop']
NButton: typeof import('naive-ui')['NButton'] NButton: typeof import('naive-ui')['NButton']
NCard: typeof import('naive-ui')['NCard'] NCard: typeof import('naive-ui')['NCard']
NCheckbox: typeof import('naive-ui')['NCheckbox'] NCheckbox: typeof import('naive-ui')['NCheckbox']
@ -22,8 +21,6 @@ declare module 'vue' {
NDialogProvider: typeof import('naive-ui')['NDialogProvider'] NDialogProvider: typeof import('naive-ui')['NDialogProvider']
NDivider: typeof import('naive-ui')['NDivider'] NDivider: typeof import('naive-ui')['NDivider']
NDropdown: typeof import('naive-ui')['NDropdown'] NDropdown: typeof import('naive-ui')['NDropdown']
NEllipsis: typeof import('naive-ui')['NEllipsis']
NEmpty: typeof import('naive-ui')['NEmpty']
NForm: typeof import('naive-ui')['NForm'] NForm: typeof import('naive-ui')['NForm']
NFormItem: typeof import('naive-ui')['NFormItem'] NFormItem: typeof import('naive-ui')['NFormItem']
NGi: typeof import('naive-ui')['NGi'] NGi: typeof import('naive-ui')['NGi']
@ -35,7 +32,6 @@ declare module 'vue' {
NModal: typeof import('naive-ui')['NModal'] NModal: typeof import('naive-ui')['NModal']
NNotificationProvider: typeof import('naive-ui')['NNotificationProvider'] NNotificationProvider: typeof import('naive-ui')['NNotificationProvider']
NotPassed: typeof import('./src/components/NotPassed.vue')['default'] NotPassed: typeof import('./src/components/NotPassed.vue')['default']
NPopconfirm: typeof import('naive-ui')['NPopconfirm']
NPopover: typeof import('naive-ui')['NPopover'] NPopover: typeof import('naive-ui')['NPopover']
NPopselect: typeof import('naive-ui')['NPopselect'] NPopselect: typeof import('naive-ui')['NPopselect']
NProgress: typeof import('naive-ui')['NProgress'] NProgress: typeof import('naive-ui')['NProgress']
@ -45,11 +41,7 @@ declare module 'vue' {
NSpace: typeof import('naive-ui')['NSpace'] NSpace: typeof import('naive-ui')['NSpace']
NSpin: typeof import('naive-ui')['NSpin'] NSpin: typeof import('naive-ui')['NSpin']
NSwitch: typeof import('naive-ui')['NSwitch'] NSwitch: typeof import('naive-ui')['NSwitch']
NTabPane: typeof import('naive-ui')['NTabPane']
NTabs: typeof import('naive-ui')['NTabs']
NTag: typeof import('naive-ui')['NTag'] NTag: typeof import('naive-ui')['NTag']
NTimeline: typeof import('naive-ui')['NTimeline']
NTimelineItem: typeof import('naive-ui')['NTimelineItem']
NTooltip: typeof import('naive-ui')['NTooltip'] NTooltip: typeof import('naive-ui')['NTooltip']
NUpload: typeof import('naive-ui')['NUpload'] NUpload: typeof import('naive-ui')['NUpload']
NUploadDragger: typeof import('naive-ui')['NUploadDragger'] NUploadDragger: typeof import('naive-ui')['NUploadDragger']

@ -71,7 +71,7 @@ defineExpose({
</div> </div>
<div class="item"> <div class="item">
<SvgIcon name="modal_reImg" width="49" height="58" /> <SvgIcon name="modal_reImg" width="49" height="58" />
<div class="num_box">{{ 83 }}</div> <div class="num_box">{{ toolsData?.repeat }}</div>
<div class="title_box">重复图片</div> <div class="title_box">重复图片</div>
</div> </div>
</div> </div>

@ -148,16 +148,12 @@ function handleKeydown(event) {
// //
clearTimeout(keyPressTimer); clearTimeout(keyPressTimer);
const item = taskDetailInfo.value; const item = taskDetailInfo.value;
if ( if (item?.userapprove?.statshis === 2 || item?.userapprove?.statshis == 3) {
item?.userapprove?.statshis === 2 ||
item?.userapprove?.statshis == 3
) {
overTask.value = null; overTask.value = null;
return; return;
} }
if (validate([item]) == null && batch.value === false) if (validate([item]) == null && batch.value === false) overTask.value = item;
overTask.value = item;
// //
approvalHandler(); approvalHandler();
@ -183,16 +179,12 @@ function handleKeydown(event) {
// //
clearTimeout(keyPressTimer); clearTimeout(keyPressTimer);
const item = taskDetailInfo.value; const item = taskDetailInfo.value;
if ( if (item?.userapprove?.statshis === 2 || item?.userapprove?.statshis == 3) {
item?.userapprove?.statshis === 2 ||
item?.userapprove?.statshis == 3
) {
overTask.value = null; overTask.value = null;
return; return;
} }
if (validate([item]) == null && batch.value === false) if (validate([item]) == null && batch.value === false) overTask.value = item;
overTask.value = item;
// //
const modal = unref(notPassModalRef)! as any; const modal = unref(notPassModalRef)! as any;
modal.showModal([taskDetailInfo.value]); modal.showModal([taskDetailInfo.value]);
@ -265,8 +257,7 @@ function approvalHandler(items?: any) {
processItems = [cloneItem]; processItems = [cloneItem];
} }
if (items !== undefined && !(items instanceof PointerEvent)) if (items !== undefined && !(items instanceof PointerEvent)) processItems = items;
processItems = items;
const msg = validate(processItems); const msg = validate(processItems);
@ -520,9 +511,7 @@ function notPassSuccess(param) {
function reloadList(param, text) { function reloadList(param, text) {
// //
const id = currentTaskId(); const id = currentTaskId();
const hasCurrentId = param.flowTaskInfoList.find( const hasCurrentId = param.flowTaskInfoList.find((item) => item.formId === id);
(item) => item.formId === id
);
finalStore.setListKey(); finalStore.setListKey();
if (hasCurrentId) emit("setAsideItemName", text); if (hasCurrentId) emit("setAsideItemName", text);
@ -556,8 +545,7 @@ function overTaskHandelr(item: any) {
return; return;
} }
if (validate([item]) == null && batchtwo.value === false) if (validate([item]) == null && batchtwo.value === false) overTasktwo.value = item;
overTasktwo.value = item;
} }
function closePassno() { function closePassno() {
console.log(notPassModalRef.value); console.log(notPassModalRef.value);
@ -591,8 +579,7 @@ function checkBottom() {
const scrollTop = window.pageYOffset || document.documentElement.scrollTop; const scrollTop = window.pageYOffset || document.documentElement.scrollTop;
// //
const clientHeight = const clientHeight = window.innerHeight || document.documentElement.clientHeight;
window.innerHeight || document.documentElement.clientHeight;
// //
const scrollHeight = document.documentElement.scrollHeight; const scrollHeight = document.documentElement.scrollHeight;
@ -661,18 +648,8 @@ function sortHandler(orderby: "similarityScore" | "createdate") {
<div class="left"> <div class="left">
<span class="font">任务ID{{ taskDetailInfo.fromtaskname }}</span> <span class="font">任务ID{{ taskDetailInfo.fromtaskname }}</span>
<template v-if="!isDetail"> <template v-if="!isDetail">
<SvgIcon <SvgIcon size="22" class="forward" name="arrow-left" @click="backHandler" />
size="22" <SvgIcon size="22" class="back" name="arrow-right" @click="forwardHandler" />
class="forward"
name="arrow-left"
@click="backHandler"
/>
<SvgIcon
size="22"
class="back"
name="arrow-right"
@click="forwardHandler"
/>
</template> </template>
</div> </div>
<div v-if="!isDetail" class="right"> <div v-if="!isDetail" class="right">
@ -760,7 +737,6 @@ function sortHandler(orderby: "similarityScore" | "createdate") {
isFullScreen isFullScreen
? { ? {
height: '596px', height: '596px',
} }
: {} : {}
" "
@ -769,16 +745,14 @@ function sortHandler(orderby: "similarityScore" | "createdate") {
v-show="!imgbigshow" v-show="!imgbigshow"
:style="{ :style="{
position: 'fixed', position: 'fixed',
height: '100vh',
zIndex: 169, zIndex: 169,
height: '100vh',
background: 'rgb(80, 122, 253)', background: 'rgb(80, 122, 253)',
right: '16px', right: '16px',
marginTop: '5px', marginTop: '5px',
width: '2px', width: '2px',
height: '91.5vh', height: '91.5vh',
}" }"
></div> />
<div <div
v-show="!imgbigshow" v-show="!imgbigshow"
class="aside-collapse-btn" class="aside-collapse-btn"
@ -864,21 +838,17 @@ function sortHandler(orderby: "similarityScore" | "createdate") {
class="img-status" class="img-status"
src="@/assets/images/task/not_pass.png" src="@/assets/images/task/not_pass.png"
alt="" alt=""
HEAD
/> />
</div> </div>
<div class="mark"> <div class="mark">
<SvgIcon <SvgIcon v-show="taskDetailInfo?.iztrueorfalse === 0" size="128" name="jia" />
v-show="taskDetailInfo?.iztrueorfalse === 0"
size="128"
name="jia"
/>
</div> </div>
<div class="mark"> <div class="mark">
<SvgIcon <SvgIcon v-show="taskDetailInfo?.iztrueorfalse === 0" size="128" name="jia" />
v-show="taskDetailInfo?.iztrueorfalse === 1" </div>
size="128" <div class="mark">
name="zhen" <SvgIcon v-show="taskDetailInfo?.iztrueorfalse === 1" size="128" name="zhen" />
/>
</div> </div>
<div class="big-mark" /> <div class="big-mark" />
<div class="preview" @click="previewHandler"> <div class="preview" @click="previewHandler">
@ -888,11 +858,7 @@ function sortHandler(orderby: "similarityScore" | "createdate") {
<n-grid x-gap="12" y-gap="10" :cols="12"> <n-grid x-gap="12" y-gap="10" :cols="12">
<n-gi span="4" class="gi1"> <n-gi span="4" class="gi1">
<span> <span>
<img <img class="icon-status" src="@/assets/images/task/status.png" alt="" />t
class="icon-status"
src="@/assets/images/task/status.png"
alt=""
/>
</span> </span>
</n-gi> </n-gi>
<n-gi span="8" class="gi2"> <n-gi span="8" class="gi2">
@ -911,39 +877,23 @@ function sortHandler(orderby: "similarityScore" | "createdate") {
</span> </span>
</n-gi> </n-gi>
<n-gi span="8" class="gi2"> <n-gi span="8" class="gi2">
<span class="value num" <span class="value num">{{ totalCount }}<span class="unit"></span> </span>
>{{ totalCount }}<span class="unit"></span>
</span>
<span class="label">相似匹配</span> <span class="label">相似匹配</span>
</n-gi> </n-gi>
</n-grid> </n-grid>
</div> </div>
<div class="time"> <div class="time">
<div class="time-item"> <div class="time-item">
<SvgIcon <SvgIcon class="svg-time" color="#FFF" size="16" name="camera-time" />
class="svg-time"
color="#FFF"
size="16"
name="camera-time"
/>
<span>{{ <span>{{ taskDetailInfo?.ocrPicture?.photoDateTimestamp ?? "-" }}</span>
taskDetailInfo?.ocrPicture?.photoDateTimestamp ?? "-"
}}</span>
</div> </div>
<div class="time-item time-item2"> <div class="time-item time-item2">
<SvgIcon <SvgIcon class="svg-time" color="#FFF" size="16" name="submit-time" />
class="svg-time"
color="#FFF"
size="16"
name="submit-time"
/>
<span>{{ <span>{{
taskDetailInfo?.ocrPicture?.submitDateTimestamp taskDetailInfo?.ocrPicture?.submitDateTimestamp
? formatToDateHMS( ? formatToDateHMS(Number(taskDetailInfo.ocrPicture.submitDateTimestamp))
Number(taskDetailInfo.ocrPicture.submitDateTimestamp)
)
: "-" : "-"
}}</span> }}</span>
</div> </div>
@ -962,15 +912,16 @@ function sortHandler(orderby: "similarityScore" | "createdate") {
class="right" class="right"
:style=" :style="
isFullScreen isFullScreen
? {flex: 0.3, ? {
flex: 0.3,
// flex: 0, // flex: 0,
//width: '30vw', //width: '30vw',
borderLeft: '2px solid #507AFD', borderLeft: '2px solid #507AFD',
position: 'relative', position: 'relative',
borderRadius: 0, borderRadius: 0,
height:'596px' height: '596px',
} }
: { flex: 0.5} : { flex: 0.5 }
" "
> >
<div <div
@ -1043,12 +994,7 @@ function sortHandler(orderby: "similarityScore" | "createdate") {
/> />
<div class="time"> <div class="time">
<div class="time-item"> <div class="time-item">
<SvgIcon <SvgIcon class="svg-time" color="#FFF" size="8" name="camera-time" />
class="svg-time"
color="#FFF"
size="8"
name="camera-time"
/>
<span>{{ <span>{{
item.photoDateTimestamp item.photoDateTimestamp
? formatToDateHMS(Number(item.photoDateTimestamp)) ? formatToDateHMS(Number(item.photoDateTimestamp))
@ -1056,12 +1002,7 @@ function sortHandler(orderby: "similarityScore" | "createdate") {
}}</span> }}</span>
</div> </div>
<div class="time-item time-item2"> <div class="time-item time-item2">
<SvgIcon <SvgIcon class="svg-time" color="#FFF" size="8" name="submit-time" />
class="svg-time"
color="#FFF"
size="8"
name="submit-time"
/>
<span>{{ <span>{{
item.submitDateTimestamp item.submitDateTimestamp
? formatToDateHMS(Number(item.submitDateTimestamp)) ? formatToDateHMS(Number(item.submitDateTimestamp))
@ -1078,9 +1019,7 @@ function sortHandler(orderby: "similarityScore" | "createdate") {
</div> </div>
</div> </div>
<n-scrollbar v-else style="max-height: 100%"> <n-scrollbar v-else style="max-height: 100%">
<div <div :style="{ fontSize: '22px', fontWeight: 500, color: '#0D0B22' }">
:style="{ fontSize: '22px', fontWeight: 500, color: '#0D0B22' }"
>
{{ taskDetailInfo.fromtaskname }} {{ taskDetailInfo.fromtaskname }}
</div> </div>
<div class="tags"> <div class="tags">
@ -1143,16 +1082,10 @@ function sortHandler(orderby: "similarityScore" | "createdate") {
{{ item[0].value }} {{ item[0].value }}
</div> </div>
</div> </div>
<div <div v-if="!(item[0].label == '拜访终端名称')" class="viewlabel">
v-if="!(item[0].label == '拜访终端名称')"
class="viewlabel"
>
{{ item[0].label }} {{ item[0].label }}
</div> </div>
<div <div v-if="!(item[0].label == '拜访终端名称')" class="viewvalue">
v-if="!(item[0].label == '拜访终端名称')"
class="viewvalue"
>
{{ item[0].value }} {{ item[0].value }}
</div> </div>
<div <div
@ -1195,11 +1128,7 @@ function sortHandler(orderby: "similarityScore" | "createdate") {
<div v-else class="imgbottom"> <div v-else class="imgbottom">
<div <div
v-show="imgbigshow" v-show="imgbigshow"
style=" style="display: flex; justify-content: space-between; padding: 12px 0px 3px 0"
display: flex;
justify-content: space-between;
padding: 12px 0px 3px 0;
"
> >
<div> <div>
<span <span
@ -1223,36 +1152,16 @@ function sortHandler(orderby: "similarityScore" | "createdate") {
> >
<div style="cursor: pointer" @click="sortHandler('createdate')"> <div style="cursor: pointer" @click="sortHandler('createdate')">
<span>时间排序</span> <span>时间排序</span>
<SvgIcon <SvgIcon v-if="true" style="margin-left: 5px" name="sort" size="12" />
v-if="true" <SvgIcon v-else style="margin-left: 5px" name="active-sort" size="12" />
style="margin-left: 5px"
name="sort"
size="12"
/>
<SvgIcon
v-else
style="margin-left: 5px"
name="active-sort"
size="12"
/>
</div> </div>
<div <div
style="margin-left: 15px; cursor: pointer" style="margin-left: 15px; cursor: pointer"
@click="sortHandler('similarityScore')" @click="sortHandler('similarityScore')"
> >
<span>相似度排序</span> <span>相似度排序</span>
<SvgIcon <SvgIcon v-if="true" style="margin-left: 5px" name="sort" size="12" />
v-if="true" <SvgIcon v-else style="margin-left: 5px" name="active-sort" size="12" />
style="margin-left: 5px"
name="sort"
size="12"
/>
<SvgIcon
v-else
style="margin-left: 5px"
name="active-sort"
size="12"
/>
</div> </div>
</div> </div>
</div> </div>
@ -1317,12 +1226,7 @@ function sortHandler(orderby: "similarityScore" | "createdate") {
/> />
<div class="time"> <div class="time">
<div class="time-item"> <div class="time-item">
<SvgIcon <SvgIcon class="svg-time" color="#FFF" size="16" name="camera-time" />
class="svg-time"
color="#FFF"
size="16"
name="camera-time"
/>
<span>{{ <span>{{
item.photoDateTimestamp item.photoDateTimestamp
? formatToDateHMS(Number(item.photoDateTimestamp)) ? formatToDateHMS(Number(item.photoDateTimestamp))
@ -1330,12 +1234,7 @@ function sortHandler(orderby: "similarityScore" | "createdate") {
}}</span> }}</span>
</div> </div>
<div class="time-item time-item2"> <div class="time-item time-item2">
<SvgIcon <SvgIcon class="svg-time" color="#FFF" size="16" name="submit-time" />
class="svg-time"
color="#FFF"
size="16"
name="submit-time"
/>
<span>{{ <span>{{
item.submitDateTimestamp item.submitDateTimestamp
? formatToDateHMS(Number(item.submitDateTimestamp)) ? formatToDateHMS(Number(item.submitDateTimestamp))
@ -1343,10 +1242,7 @@ function sortHandler(orderby: "similarityScore" | "createdate") {
}}</span> }}</span>
</div> </div>
</div> </div>
<div <div :class="{ 'percent-red': item.similarityScore === 100 }" class="percent">
:class="{ 'percent-red': item.similarityScore === 100 }"
class="percent"
>
{{ item.similarityScore }}<span class="percent-unit">%</span> {{ item.similarityScore }}<span class="percent-unit">%</span>
</div> </div>
</div> </div>
@ -1433,16 +1329,8 @@ function sortHandler(orderby: "similarityScore" | "createdate") {
</div> </div>
</div> --> </div> -->
</div> </div>
<NotPassed <NotPassed ref="notPassModalRef" @success="notPassSuccess" @close="closePassno" />
ref="notPassModalRef" <BatchModal ref="batchModalRef" @reject="rejectHandler" @approval="approvalHandler" />
@success="notPassSuccess"
@close="closePassno"
/>
<BatchModal
ref="batchModalRef"
@reject="rejectHandler"
@approval="approvalHandler"
/>
<CustomSettingModal ref="CustomSettingModalRef" @on-ok="getDetail" /> <CustomSettingModal ref="CustomSettingModalRef" @on-ok="getDetail" />
</div> </div>
</template> </template>
@ -2151,11 +2039,7 @@ function sortHandler(orderby: "similarityScore" | "createdate") {
.small-mark { .small-mark {
width: 100%; width: 100%;
height: 53px; height: 53px;
background: linear-gradient( background: linear-gradient(180deg, rgba(0, 0, 0, 0.01), rgba(0, 0, 0, 0.44) 88%);
180deg,
rgba(0, 0, 0, 0.01),
rgba(0, 0, 0, 0.44) 88%
);
border-radius: 0px 8px 8px 8px; border-radius: 0px 8px 8px 8px;
position: absolute; position: absolute;
left: 0; left: 0;

@ -1,18 +1,18 @@
<script lang="ts" setup> <script lang="ts" setup>
import { audit } from '@/api/task/task' import { audit } from "@/api/task/task";
import { getPictureSimilarityList, getTaskDetailInfo } from '@/api/work/work' import { getPictureSimilarityList, getTaskDetailInfo } from "@/api/work/work";
import NotPassed from '@/components/Approval/NotPassed.vue' import NotPassed from "@/components/Approval/NotPassed.vue";
import { TASK_STATUS_OBJ } from '@/enums/index' import { TASK_STATUS_OBJ } from "@/enums/index";
import { useWorkOrder } from '@/store/modules/workOrder' import { useWorkOrder } from "@/store/modules/workOrder";
import { isEmpty } from '@/utils' import { isEmpty } from "@/utils";
import { formatToDateHMS } from '@/utils/dateUtil' import { formatToDateHMS } from "@/utils/dateUtil";
import { hideDownload } from '@/utils/image' import { hideDownload } from "@/utils/image";
import emitter from '@/utils/mitt' import emitter from "@/utils/mitt";
import { useInfiniteScroll } from '@vueuse/core' import { useInfiniteScroll } from "@vueuse/core";
import { format } from 'date-fns' import { format } from "date-fns";
import imagesloaded from 'imagesloaded' import imagesloaded from "imagesloaded";
import { clone, cloneDeep, debounce, pickBy } from 'lodash-es' import { clone, cloneDeep, debounce, pickBy } from "lodash-es";
import { useDialog, useMessage } from 'naive-ui' import { useDialog, useMessage } from "naive-ui";
import { import {
computed, computed,
onMounted, onMounted,
@ -22,70 +22,67 @@ import {
ref, ref,
unref, unref,
watch, watch,
} from 'vue' } from "vue";
import PictureInfo from '../components/PictureInfo.vue' import PictureInfo from "../components/PictureInfo.vue";
import ConfrimModal from '../modal/ConfrimModal.vue' import ConfrimModal from "../modal/ConfrimModal.vue";
import type { ApprovalParam, SimilarityPictureSortParam } from '/#/api' import type { ApprovalParam, SimilarityPictureSortParam } from "/#/api";
const batch = ref(false) // const batch = ref(false); //
const selectItems = ref<any[]>([]) const selectItems = ref<any[]>([]);
const message = useMessage() const message = useMessage();
const dialog = useDialog() const dialog = useDialog();
const totalCount = ref(0) const totalCount = ref(0);
let _imagesload: any let _imagesload: any;
function setBatch(value: boolean) { function setBatch(value: boolean) {
if (value && batch.value) if (value && batch.value) batch.value = !value;
batch.value = !value else batch.value = value;
else batch.value = value
if (value === false) { if (value === false) {
selectItems.value.forEach(item => (item.checked = false)) selectItems.value.forEach((item) => (item.checked = false));
selectItems.value.length = 0 selectItems.value.length = 0;
} }
} }
function onCheckChange(checked: any, item: any) { function onCheckChange(checked: any, item: any) {
const index = selectItems.value.indexOf(item) const index = selectItems.value.indexOf(item);
item.checked = checked item.checked = checked;
if (index === -1 && checked) if (index === -1 && checked) selectItems.value.push(item);
selectItems.value.push(item) else selectItems.value.splice(index, 1);
else selectItems.value.splice(index, 1)
} }
const showActions = computed(() => { const showActions = computed(() => {
return selectItems.value.length > 0 && batch return selectItems.value.length > 0 && batch;
}) });
const taskpagination = reactive({ const taskpagination = reactive({
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10,
}) });
const sortBy: SimilarityPictureSortParam = { const sortBy: SimilarityPictureSortParam = {
orderType: 'desc', orderType: "desc",
orderName: 'similarityScore', orderName: "similarityScore",
} };
const workStore = useWorkOrder() const workStore = useWorkOrder();
const selectTask = ref<any>(null) const selectTask = ref<any>(null);
const overTask = ref<any>(null) const overTask = ref<any>(null);
const taskDetailInfo = ref<any>({}) const taskDetailInfo = ref<any>({});
const confrimModalRef = ref(null) const confrimModalRef = ref(null);
const imageRef = ref<ComponentElRef | null>() const imageRef = ref<ComponentElRef | null>();
const listData = ref<any[]>([]) const listData = ref<any[]>([]);
const loading = ref(false) const loading = ref(false);
const el = ref<HTMLDivElement | null>(null) const el = ref<HTMLDivElement | null>(null);
const selectedSortName = ref('') const selectedSortName = ref("");
const isFullScreen = ref(false) const isFullScreen = ref(false);
const notPassModalRef = ref(null) const notPassModalRef = ref(null);
const mainImageModalRef = ref(null) const mainImageModalRef = ref(null);
const wrapperListRef = ref<HTMLElement | undefined>(undefined) const wrapperListRef = ref<HTMLElement | undefined>(undefined);
let canloadMore = true let canloadMore = true;
let processItems: any[] = [] let processItems: any[] = [];
function validate(items: any[]) { function validate(items: any[]) {
if (items.length === 0) if (items.length === 0) return "至少选中一个任务";
return '至少选中一个任务'
// for (const item of items) { // for (const item of items) {
// const { iztrueorfalse, history, states } = item // const { iztrueorfalse, history, states } = item
@ -99,163 +96,159 @@ function validate(items: any[]) {
// return '' // return ''
// } // }
return null return null;
} }
function forwardHandler() { function forwardHandler() {
workStore.forward() workStore.forward();
} }
function backHandler() { function backHandler() {
workStore.back() workStore.back();
} }
function reset() { function reset() {
taskpagination.pageNo = 0 taskpagination.pageNo = 0;
taskpagination.pageSize = 20 taskpagination.pageSize = 20;
listData.value.length = 0 listData.value.length = 0;
loading.value = false loading.value = false;
canloadMore = true canloadMore = true;
} }
async function refreshHandler() { async function refreshHandler() {
reset() reset();
useInfiniteScroll( useInfiniteScroll(
el as any, el as any,
() => { () => {
loadMore() loadMore();
}, },
{ distance: 10, canLoadMore: () => canloadMore }, { distance: 10, canLoadMore: () => canloadMore }
) );
} }
async function loadMore() { async function loadMore() {
if (loading.value || el.value == null) if (loading.value || el.value == null) return;
return
const more = await featchList() const more = await featchList();
listData.value.push(...more) listData.value.push(...more);
} }
async function featchList() { async function featchList() {
loading.value = true loading.value = true;
try { try {
taskpagination.pageNo += 1 taskpagination.pageNo += 1;
const { data, total, pageCount } = await getPictureSimilarityList({ const { data, total, pageCount } = await getPictureSimilarityList({
...taskpagination, ...taskpagination,
...sortBy, ...sortBy,
checkDuplicateId: workStore.activeId, checkDuplicateId: workStore.activeId,
pictureId: taskDetailInfo.value.id, pictureId: taskDetailInfo.value.id,
}) });
totalCount.value = total totalCount.value = total;
canloadMore = pageCount >= taskpagination.pageNo && pageCount > 0 canloadMore = pageCount >= taskpagination.pageNo && pageCount > 0;
return data return data;
} } catch (error) {
catch (error) { canloadMore = false;
canloadMore = false return [];
return []
} }
} }
const layout = debounce(() => { const layout = debounce(() => {
if (el.value == null) if (el.value == null) return;
return
_imagesload = imagesloaded('.grid-item') _imagesload = imagesloaded(".grid-item");
_imagesload.on('done', (instance) => { _imagesload.on("done", (instance) => {
if (!el.value) if (!el.value) return;
return loading.value = false;
loading.value = false });
})
_imagesload.on('fail', (instance) => { _imagesload.on("fail", (instance) => {
message.error('图片错误') message.error("图片错误");
loading.value = false loading.value = false;
}) });
}, 300) }, 300);
const fullscreenStyles = computed<any>(() => ({ const fullscreenStyles = computed<any>(() => ({
width: isFullScreen.value ? '100vw' : '', width: isFullScreen.value ? "100vw" : "",
height: isFullScreen.value ? '100vh' : '', height: isFullScreen.value ? "100vh" : "",
position: isFullScreen.value ? 'fixed' : '', position: isFullScreen.value ? "fixed" : "",
top: isFullScreen.value ? '0' : '', top: isFullScreen.value ? "0" : "",
left: isFullScreen.value ? '0' : '', left: isFullScreen.value ? "0" : "",
zIndex: isFullScreen.value ? '100' : '', zIndex: isFullScreen.value ? "100" : "",
})) }));
// //
function toggleFullScreen() { function toggleFullScreen() {
isFullScreen.value = !isFullScreen.value isFullScreen.value = !isFullScreen.value;
} }
onUpdated(() => { onUpdated(() => {
layout() layout();
}) });
watch( watch(
() => workStore.activeId, () => workStore.activeId,
async (newValue, oldValue) => { async (newValue, oldValue) => {
const packageid = workStore.getActiveId const packageid = workStore.getActiveId;
if (isEmpty(packageid)) { if (isEmpty(packageid)) {
listData.value.length = 0 listData.value.length = 0;
totalCount.value = 0 totalCount.value = 0;
taskDetailInfo.value = {} taskDetailInfo.value = {};
return return;
} }
queryDetail(packageid) queryDetail(packageid);
// const res = await getPackageTaskList(newValue, packagepagination); // const res = await getPackageTaskList(newValue, packagepagination);
// const { data } = res; // const { data } = res;
// taskList.value = data; // taskList.value = data;
// if (taskList.value.length > 0) handleSelect(taskList.value[0]); // // if (taskList.value.length > 0) handleSelect(taskList.value[0]); //
}, }
) );
const packageName = computed(() => { const packageName = computed(() => {
const index = workStore.getCurrentIndex const index = workStore.getCurrentIndex;
return workStore.getOrderList[index]?.name || '' return workStore.getOrderList[index]?.name || "";
}) });
async function queryDetail(checkDuplicateId: any) { async function queryDetail(checkDuplicateId: any) {
taskDetailInfo.value = await getTaskDetailInfo(checkDuplicateId) taskDetailInfo.value = await getTaskDetailInfo(checkDuplicateId);
const packageid = workStore.getActiveId const packageid = workStore.getActiveId;
if (isEmpty(packageid)) { if (isEmpty(packageid)) {
listData.value.length = 0 listData.value.length = 0;
totalCount.value = 0 totalCount.value = 0;
return return;
} }
refreshHandler() refreshHandler();
} }
// //
async function handleSelect(item: any) { async function handleSelect(item: any) {
// taskDetailInfo.value = await getTaskDetailInfo(item.id) // taskDetailInfo.value = await getTaskDetailInfo(item.id)
const packageid = workStore.getActiveId const packageid = workStore.getActiveId;
if (isEmpty(packageid)) { if (isEmpty(packageid)) {
listData.value.length = 0 listData.value.length = 0;
totalCount.value = 0 totalCount.value = 0;
} }
// refreshHandler(); // refreshHandler();
} }
async function sortHandler(orderby: 'similarityScore' | 'createdate') { async function sortHandler(orderby: "similarityScore" | "createdate") {
selectedSortName.value = orderby selectedSortName.value = orderby;
sortBy.orderName = orderby sortBy.orderName = orderby;
sortBy.orderType = sortBy.orderType === 'asc' ? 'desc' : 'asc' sortBy.orderType = sortBy.orderType === "asc" ? "desc" : "asc";
refreshHandler() refreshHandler();
} }
const propertys = computed(() => { const propertys = computed(() => {
const { ocrPicture } = taskDetailInfo.value const { ocrPicture } = taskDetailInfo.value;
const v = pickBy(ocrPicture, (value, key: string) => { const v = pickBy(ocrPicture, (value, key: string) => {
return key.startsWith('field') && value !== null return key.startsWith("field") && value !== null;
}) });
return v return v;
}) });
function overTaskHandelr(item: any) { function overTaskHandelr(item: any) {
// console.log(item, 'item') // console.log(item, 'item')
// if (item?.historyStates === 2 || item?.historyStates == 3) { // if (item?.historyStates === 2 || item?.historyStates == 3) {
@ -263,241 +256,233 @@ function overTaskHandelr(item: any) {
// return // return
// } // }
if (validate([item]) == null && batch.value === false) if (validate([item]) == null && batch.value === false) overTask.value = item;
overTask.value = item
} }
function leaveTaskHandler() { function leaveTaskHandler() {
overTask.value = null overTask.value = null;
} }
function onEsc() { function onEsc() {
if (isFullScreen.value && !document.querySelector('.n-modal-container')) if (isFullScreen.value && !document.querySelector(".n-modal-container"))
isFullScreen.value = false isFullScreen.value = false;
} }
function resizeImage() { function resizeImage() {
const container = document.querySelector('.image-container')! const container = document.querySelector(".image-container")!;
const containerWidth = container.offsetWidth const containerWidth = container.offsetWidth;
const containerHeight = container.offsetHeight const containerHeight = container.offsetHeight;
} }
onUnmounted(() => { onUnmounted(() => {
workStore.reset() workStore.reset();
document.removeEventListener('keydown', onEsc) document.removeEventListener("keydown", onEsc);
}) });
onMounted(() => { onMounted(() => {
document.addEventListener('keydown', onEsc) document.addEventListener("keydown", onEsc);
window.addEventListener('resize', resizeImage) window.addEventListener("resize", resizeImage);
}) });
function immersionHandler() { function immersionHandler() {
// class="wrapper" // class="wrapper"
// workStore.updateImmersion(); // workStore.updateImmersion();
toggleFullScreen() toggleFullScreen();
} }
function showAction() { function showAction() {
const item = taskDetailInfo.value const item = taskDetailInfo.value;
if (item.historyStates === 2 || item.historyStates === 3) if (item.historyStates === 2 || item.historyStates === 3) return;
return
if (batch.value === false) if (batch.value === false) overTask.value = item;
overTask.value = item
} }
function hideAction(event) { function hideAction(event) {
// overTask.value = null // overTask.value = null
previewHandler(event) previewHandler(event);
} }
function previewHandler(event: MouseEvent) { function previewHandler(event: MouseEvent) {
event.stopImmediatePropagation() event.stopImmediatePropagation();
event.stopPropagation() event.stopPropagation();
if (imageRef.value && (imageRef.value as any).src) if (imageRef.value && (imageRef.value as any).src)
(imageRef.value as any).mergedOnClick() (imageRef.value as any).mergedOnClick();
} }
function rejectHandler() { function rejectHandler() {
const modal = unref(notPassModalRef)! as any const modal = unref(notPassModalRef)! as any;
modal.showModal(selectItems.value) modal.showModal(selectItems.value);
} }
function singleRejectHandler(item) { function singleRejectHandler(item) {
const modal = unref(notPassModalRef)! as any const modal = unref(notPassModalRef)! as any;
modal.showModal([item]) modal.showModal([item]);
} }
function reject(idOrDesc: string, backId: string, isOther: boolean) { function reject(idOrDesc: string, backId: string, isOther: boolean) {
const formIds: string[] = processItems.map(item => item.id) const formIds: string[] = processItems.map((item) => item.id);
const taskIds: string[] = processItems.map(item => item.taskId) const taskIds: string[] = processItems.map((item) => item.taskId);
const tasknames: string[] = processItems.map(item => item.taskname) const tasknames: string[] = processItems.map((item) => item.taskname);
const param: ApprovalParam = { const param: ApprovalParam = {
formid: formIds, formid: formIds,
taskId: taskIds, taskId: taskIds,
approvd: false, approvd: false,
taskComment: idOrDesc, taskComment: idOrDesc,
taskname: isOther ? tasknames : ['其他'], taskname: isOther ? tasknames : ["其他"],
} };
doAudit(param) doAudit(param);
} }
function handleRejectMainImage() { function handleRejectMainImage() {
const modal = unref(mainImageModalRef)! as any const modal = unref(mainImageModalRef)! as any;
const params = cloneDeep(taskDetailInfo.value) const params = cloneDeep(taskDetailInfo.value);
params.id = params.taskchildpictureid params.id = params.taskchildpictureid;
modal.showModal([params]) modal.showModal([params]);
} }
async function reloadDetailInfo() { async function reloadDetailInfo() {
const packageid = workStore.getActiveId const packageid = workStore.getActiveId;
taskDetailInfo.value = await getTaskDetailInfo(packageid) taskDetailInfo.value = await getTaskDetailInfo(packageid);
} }
function handleApproveMainImage(items?: any) { function handleApproveMainImage(items?: any) {
let cloneItem: any let cloneItem: any;
if (overTask.value) { if (overTask.value) {
cloneItem = clone(overTask.value) cloneItem = clone(overTask.value);
cloneItem.id = cloneItem.taskchildpictureid cloneItem.id = cloneItem.taskchildpictureid;
processItems = [cloneItem] processItems = [cloneItem];
} }
const msg = validate(processItems) const msg = validate(processItems);
if (msg !== null) { if (msg !== null) {
message.error(msg) message.error(msg);
return return;
} }
const list: any = [] const list: any = [];
processItems.forEach((item) => { processItems.forEach((item) => {
list.push({ list.push({
formId: item.id, formId: item.id,
taskId: item.taskId, taskId: item.taskId,
taskName: item.fromTaskName, taskName: item.fromTaskName,
}) });
}) });
const param = { const param = {
result: true, result: true,
comment: '', comment: "",
disposeType: '', disposeType: "",
disposeTypeId: '', disposeTypeId: "",
failCauseId: '', failCauseId: "",
failCauseName: '', failCauseName: "",
flowTaskInfoList: list, flowTaskInfoList: list,
} };
dialog.info({ dialog.info({
title: '确认提示', title: "确认提示",
content: '确认给该任务审批为【通过】吗?', content: "确认给该任务审批为【通过】吗?",
positiveText: '确定', positiveText: "确定",
negativeText: '取消', negativeText: "取消",
onPositiveClick: () => { onPositiveClick: () => {
audit(param).then(async (res) => { audit(param).then(async (res) => {
const { code } = res const { code } = res;
if (code === 'OK') { if (code === "OK") {
message.info(res.message) message.info(res.message);
const packageid = workStore.getActiveId const packageid = workStore.getActiveId;
taskDetailInfo.value = await getTaskDetailInfo(packageid) taskDetailInfo.value = await getTaskDetailInfo(packageid);
} } else {
else { message.error(res.message);
message.error(res.message) }
} });
})
}, },
onNegativeClick: () => {}, onNegativeClick: () => {},
}) });
} }
function approvalHandler(items?: any) { function approvalHandler(items?: any) {
let cloneItem: any let cloneItem: any;
if (batch.value) { if (batch.value) {
processItems = selectItems.value processItems = selectItems.value;
} } else if (overTask.value) {
else if (overTask.value) { cloneItem = clone(overTask.value);
cloneItem = clone(overTask.value) processItems = [cloneItem];
processItems = [cloneItem]
} }
// => => / // => => /
if (items !== undefined && !(items instanceof PointerEvent)) if (items !== undefined && !(items instanceof PointerEvent)) processItems = [items];
processItems = [items]
const msg = validate(processItems) const msg = validate(processItems);
if (msg !== null) { if (msg !== null) {
message.error(msg) message.error(msg);
return return;
} }
const list: any = [] const list: any = [];
processItems.forEach((item) => { processItems.forEach((item) => {
list.push({ list.push({
formId: item.id, formId: item.id,
taskId: item.taskId, taskId: item.taskId,
taskName: item.fromTaskName, taskName: item.fromTaskName,
}) });
}) });
const param = { const param = {
result: true, result: true,
comment: '', comment: "",
disposeType: '', disposeType: "",
disposeTypeId: '', disposeTypeId: "",
failCauseId: '', failCauseId: "",
failCauseName: '', failCauseName: "",
flowTaskInfoList: list, flowTaskInfoList: list,
} };
dialog.info({ dialog.info({
title: '确认提示', title: "确认提示",
content: '确认给该任务审批为【通过】吗?', content: "确认给该任务审批为【通过】吗?",
positiveText: '确定', positiveText: "确定",
negativeText: '取消', negativeText: "取消",
onPositiveClick: () => { onPositiveClick: () => {
doAudit(param) doAudit(param);
}, },
onNegativeClick: () => {}, onNegativeClick: () => {},
}) });
} }
function doAudit(param: any) { function doAudit(param: any) {
audit(param).then((res) => { audit(param).then((res) => {
const { code } = res const { code } = res;
setBatch(false) setBatch(false);
if (code === 'OK') { if (code === "OK") {
message.info(res.message) message.info(res.message);
emitter.emit('refresh') emitter.emit("refresh");
refreshHandler() refreshHandler();
} } else {
else { message.error(res.message);
message.error(res.message) }
} });
})
} }
function reloadList() { function reloadList() {
setBatch(false) setBatch(false);
refreshHandler() refreshHandler();
} }
function handleRejectdubiousfileyd() { function handleRejectdubiousfileyd() {
dialog.info({ dialog.info({
title: '确认提示', title: "确认提示",
content: '确认将图片移入可疑文件夹吗?', content: "确认将图片移入可疑文件夹吗?",
positiveText: '确定', positiveText: "确定",
negativeText: '取消', negativeText: "取消",
onPositiveClick: () => { onPositiveClick: () => {
audit(param).then(async (res) => { audit(param).then(async (res) => {
const { code } = res const { code } = res;
if (code === 'OK') { if (code === "OK") {
dubiousfileyd(taskDetailInfo.value.pictureId).then(() => { dubiousfileyd(taskDetailInfo.value.pictureId).then(() => {
refreshHandler() refreshHandler();
}) });
} } else {
else { message.error(res.message);
message.error(res.message)
} }
}) });
}, },
onNegativeClick: () => {}, onNegativeClick: () => {},
}) });
} }
defineExpose({ defineExpose({
queryDetail, queryDetail,
}) });
</script> </script>
<template> <template>
@ -505,18 +490,8 @@ defineExpose({
<div class="wrapper-header"> <div class="wrapper-header">
<div class="left"> <div class="left">
<span class="font">{{ packageName }}</span> <span class="font">{{ packageName }}</span>
<SvgIcon <SvgIcon size="22" class="forward" name="arrow-left" @click="backHandler" />
size="22" <SvgIcon size="22" class="back" name="arrow-right" @click="forwardHandler" />
class="forward"
name="arrow-left"
@click="backHandler"
/>
<SvgIcon
size="22"
class="back"
name="arrow-right"
@click="forwardHandler"
/>
</div> </div>
<div class="right"> <div class="right">
<div v-show="!showActions" style="display: flex; align-items: center"> <div v-show="!showActions" style="display: flex; align-items: center">
@ -549,10 +524,7 @@ defineExpose({
</template> </template>
返回 返回
</n-button> </n-button>
<div <div style="cursor: pointer; margin-left: 16px" @click.stop="rejectHandler">
style="cursor: pointer; margin-left: 16px"
@click.stop="rejectHandler"
>
<SvgIcon width="64" height="28" name="a1" /> <SvgIcon width="64" height="28" name="a1" />
</div> </div>
<SvgIcon size="24" name="vs" /> <SvgIcon size="24" name="vs" />
@ -577,17 +549,14 @@ defineExpose({
<div class="footer-times"> <div class="footer-times">
<div class="time" style="margin-bottom: 4px"> <div class="time" style="margin-bottom: 4px">
<SvgIcon color="#FFF" size="16" name="camera" /> <SvgIcon color="#FFF" size="16" name="camera" />
<span class="time-value">{{ taskDetailInfo?.photoDateTimestamp }} <span class="time-value">{{ taskDetailInfo?.photoDateTimestamp }} </span>
</span>
</div> </div>
<div class="time"> <div class="time">
<SvgIcon color="#FFF" size="16" name="save" /> <SvgIcon color="#FFF" size="16" name="save" />
<span class="time-value">{{ <span class="time-value"
>{{
taskDetailInfo?.submitDateTimestamp taskDetailInfo?.submitDateTimestamp
? format( ? format(taskDetailInfo?.submitDateTimestamp, "yyyy-MM-dd HH:mm:ss")
taskDetailInfo?.submitDateTimestamp,
"yyyy-MM-dd HH:mm:ss",
)
: "-" : "-"
}} }}
</span> </span>
@ -599,13 +568,13 @@ defineExpose({
class="img-status" class="img-status"
src="@/assets/images/task/pass.png" src="@/assets/images/task/pass.png"
alt="" alt=""
> />
<img <img
v-show="taskDetailInfo?.historyStates === 3" v-show="taskDetailInfo?.historyStates === 3"
class="img-status" class="img-status"
src="@/assets/images/task/not_pass.png" src="@/assets/images/task/not_pass.png"
alt="" alt=""
> />
</div> </div>
<!-- 右下信息 --> <!-- 右下信息 -->
<div class="info img-info"> <div class="info img-info">
@ -616,7 +585,7 @@ defineExpose({
class="icon-status" class="icon-status"
src="@/assets/images/task/status.png" src="@/assets/images/task/status.png"
alt="" alt=""
> />
</span> </span>
</n-gi> </n-gi>
<n-gi span="8" class="gi2"> <n-gi span="8" class="gi2">
@ -631,11 +600,12 @@ defineExpose({
class="icon-status" class="icon-status"
src="@/assets/images/task/similarity.png" src="@/assets/images/task/similarity.png"
alt="" alt=""
> />
</span> </span>
</n-gi> </n-gi>
<n-gi span="8" class="gi2"> <n-gi span="8" class="gi2">
<span class="value num">{{ totalCount }}<span class="unit"></span> <span class="value num"
>{{ totalCount }}<span class="unit"></span>
</span> </span>
<span class="label">相似匹配</span> <span class="label">相似匹配</span>
</n-gi> </n-gi>
@ -682,11 +652,7 @@ defineExpose({
<PictureInfo :task-detail-info="taskDetailInfo" /> <PictureInfo :task-detail-info="taskDetailInfo" />
</div> </div>
<div <div
style=" style="display: flex; justify-content: space-between; padding: 12px 0px 3px 0"
display: flex;
justify-content: space-between;
padding: 12px 0px 3px 0;
"
> >
<div> <div>
<span <span
@ -696,7 +662,8 @@ defineExpose({
color: #333333; color: #333333;
font-family: PingFang SC, PingFang SC-Medium; font-family: PingFang SC, PingFang SC-Medium;
" "
>任务包图片</span> >任务包图片</span
>
</div> </div>
<div <div
style=" style="
@ -776,22 +743,23 @@ defineExpose({
</div> </div>
<div class="check"> <div class="check">
<n-checkbox <n-checkbox
v-show=" v-show="batch && item.historyStates !== 2 && item.historyStates !== 3"
batch && item.historyStates !== 2 && item.historyStates !== 3
"
v-model:checked="item.checked" v-model:checked="item.checked"
@click.stop @click.stop
@update:checked="onCheckChange($event, item)" @update:checked="onCheckChange($event, item)"
/> />
</div> </div>
<<<<<<< HEAD
<div class="percent"> <div class="percent">
=======
<div class="percent" :class="{ 'percent-red': item?.maxSimilarity >= 100 }">
>>>>>>> test
<SvgIcon <SvgIcon
size="42" size="42"
:name="item.maxSimilarity == 100 ? 'error_tag' : 'tag'" :name="item.maxSimilarity == 100 ? 'error_tag' : 'tag'"
/> />
<div class="val"> <div class="val">
{{ {{ item?.maxSimilarity && Number(item?.maxSimilarity).toFixed(0)
item?.maxSimilarity && Number(item?.maxSimilarity).toFixed(0)
}}<span class="percent-unit">%</span> }}<span class="percent-unit">%</span>
</div> </div>
</div> </div>
@ -853,6 +821,7 @@ defineExpose({
</n-back-top> </n-back-top>
</div> </div>
</div> </div>
</div>
</n-spin> </n-spin>
<ConfrimModal ref="confrimModalRef" @commit="reject" /> <ConfrimModal ref="confrimModalRef" @commit="reject" />
<NotPassed ref="notPassModalRef" @success="reloadList" /> <NotPassed ref="notPassModalRef" @success="reloadList" />
@ -958,14 +927,14 @@ defineExpose({
.left { .left {
flex: 0.6; flex: 0.6;
background-size: auto 346px; // background-size: auto 346px;
background-size: cover;
background-position: center; background-position: center;
background-repeat: no-repeat; background-repeat: no-repeat;
border-radius: 8px; border-radius: 8px;
position: relative; position: relative;
width: 632px; // width: 632px;
height: 346px; // height: 346px;
.preview { .preview {
position: absolute; position: absolute;
@ -1359,11 +1328,7 @@ defineExpose({
border-radius: 8px; border-radius: 8px;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
background: linear-gradient( background: linear-gradient(180deg, rgba(0, 0, 0, 0.01), rgba(0, 0, 0, 0.44) 88%);
180deg,
rgba(0, 0, 0, 0.01),
rgba(0, 0, 0, 0.44) 88%
);
} }
} }
} }

Loading…
Cancel
Save