fix: 合并test分支处理冲突

pull/178/head
zhouxiaoan 1 year ago
commit 037f5d30d0

8
components.d.ts vendored

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

@ -71,7 +71,7 @@ defineExpose({
</div>
<div class="item">
<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>
</div>

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

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

Loading…
Cancel
Save