feat: 适配后端字段 #156

Merged
liushilong merged 1 commits from fix/task_modules_error into test 1 year ago

@ -1,13 +1,5 @@
<script lang="ts" setup> <script lang="ts" setup>
import { import { computed, onMounted, onUnmounted, reactive, ref, unref, watch } from "vue";
computed,
onMounted,
onUnmounted,
reactive,
ref,
unref,
watch,
} from "vue";
import { chunk, clone } from "lodash-es"; import { chunk, clone } from "lodash-es";
import { useDialog, useMessage } from "naive-ui"; import { useDialog, useMessage } from "naive-ui";
import { useRoute, useRouter } from "vue-router"; import { useRoute, useRouter } from "vue-router";
@ -125,16 +117,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();
@ -157,17 +145,13 @@ function handleKeydown(event) {
// //
if (now - lastKeyPressTime < doubleClickInterval) { if (now - lastKeyPressTime < doubleClickInterval) {
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]);
@ -240,8 +224,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);
@ -278,24 +261,25 @@ function approvalHandler(items?: any) {
negativeText: "取消", negativeText: "取消",
onPositiveClick: () => { onPositiveClick: () => {
doAudit(param); doAudit(param);
overTask.value = null; overTask.value = null;
},
onNegativeClick: () => {
overTask.value = null;
}, },
onNegativeClick: () => {overTask.value = null;},
}); });
} }
function approvalHandlerx(item?:any){ function approvalHandlerx(item?: any) {
console.log(item);
console.log(item) alert(1);
alert(1)
} }
function singleRejectHandlex(item?:any){ function singleRejectHandlex(item?: any) {
console.log(item) console.log(item);
const modal = unref(notPassModalRef)! as any; const modal = unref(notPassModalRef)! as any;
modal.showModal([item]); modal.showModal([item]);
} }
function rejectHandler(items?: any) { function rejectHandler(items?: any) {
console.log(items) console.log(items);
const modal = unref(notPassModalRef)! as any; const modal = unref(notPassModalRef)! as any;
modal.showModal(items); modal.showModal(items);
} }
@ -348,14 +332,13 @@ async function handleDragEnd(event, item) {
} }
} }
async function addSuspicious() { async function addSuspicious() {
console.log(taskDetailInfo.value.ocrPicture);
console.log(taskDetailInfo.value.ocrPicture) if (taskDetailInfo.value.ocrPicture.pictureid) {
if (taskDetailInfo.value.ocrPicture.pictureid) {
const res = await dubiousfileyd({ const res = await dubiousfileyd({
pictureid: taskDetailInfo.value.ocrPicture.id, pictureid: taskDetailInfo.value.ocrPicture.id,
}); });
if (res.code === "OK") { if (res.code === "OK") {
message.success("加入成功"); message.success("加入成功");
setBatch(false); setBatch(false);
getTableData(); getTableData();
@ -364,8 +347,8 @@ async function addSuspicious() {
message.error(res.message); message.error(res.message);
} }
taskStore.setInFile(false); taskStore.setInFile(false);
}
}} }
async function getTableData() { async function getTableData() {
const useInfo = userStore.getUserInfo; const useInfo = userStore.getUserInfo;
const listData = []; const listData = [];
@ -431,7 +414,7 @@ function overTaskHandle() {
function leaveTaskHandler() { function leaveTaskHandler() {
overTask.value = null; overTask.value = null;
overTasktwo.value = null; overTasktwo.value = null;
} }
function showActionsModal() { function showActionsModal() {
@ -482,15 +465,13 @@ async function getDetail() {
function notPassSuccess(param) { function notPassSuccess(param) {
batchModalRef.value.reload(); batchModalRef.value.reload();
reloadList(param, "不通过"); reloadList(param, "不通过");
overTask.value=null overTask.value = null;
} }
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);
@ -515,9 +496,7 @@ function getrowValue(e) {
const hostname = window.location.hostname; const hostname = window.location.hostname;
const port = window.location.port; const port = window.location.port;
const hostWithPort = protocol + "//" + hostname + ":" + port + "/"; const hostWithPort = protocol + "//" + hostname + ":" + port + "/";
window.open( window.open(hostWithPort + "map" + "?name=" + name + "&lat=" + lat + "&lng=" + lng);
hostWithPort + "map" + "?name=" + name + "&lat=" + lat + "&lng=" + lng
);
} }
} }
function overTaskHandelr(item: any) { function overTaskHandelr(item: any) {
@ -526,11 +505,10 @@ 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() {
overTask.value=null overTask.value = null;
} }
</script> </script>
@ -540,18 +518,8 @@ function closePassno(){
<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">
@ -694,18 +662,10 @@ function closePassno(){
/> />
</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 === 1" size="128" name="zhen" />
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">
@ -715,11 +675,7 @@ function closePassno(){
<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="" />
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">
@ -738,41 +694,21 @@ function closePassno(){
</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" <span>{{ taskDetailInfo?.ocrPicture?.photoDateTimestamp ?? "-" }}</span>
color="#FFF"
size="16"
name="camera-time"
/>
<span>{{
taskDetailInfo?.ocrPicture?.photoDateTimestamp
? formatToDateHMS(
Number(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>
@ -840,12 +776,7 @@ function closePassno(){
/> />
<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))
@ -853,12 +784,7 @@ function closePassno(){
}}</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))
@ -927,16 +853,10 @@ function closePassno(){
{{ item[0].value }} {{ item[0].value }}
</div> </div>
</div> </div>
<div <div class="viewlabel" v-if="!(item[0].label == '拜访终端名称')">
class="viewlabel"
v-if="!(item[0].label == '拜访终端名称')"
>
{{ item[0].label }} {{ item[0].label }}
</div> </div>
<div <div class="viewvalue" v-if="!(item[0].label == '拜访终端名称')">
class="viewvalue"
v-if="!(item[0].label == '拜访终端名称')"
>
{{ item[0].value }} {{ item[0].value }}
</div> </div>
<div <div
@ -977,13 +897,7 @@ function closePassno(){
</n-tab-pane> </n-tab-pane>
</n-tabs> </n-tabs>
<div v-else class="imgbottom"> <div v-else class="imgbottom">
<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> <div>
<span <span
style=" style="
@ -1006,140 +920,100 @@ function closePassno(){
> >
<div style="cursor: pointer" @click="sortHandler('createdate')"> <div style="cursor: pointer" @click="sortHandler('createdate')">
<span>时间排序</span> <span>时间排序</span>
<SvgIcon <SvgIcon style="margin-left: 5px" name="sort" size="12" />
style="margin-left: 5px" <SvgIcon style="margin-left: 5px" name="active-sort" size="12" />
name="sort"
size="12"
/>
<SvgIcon
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"
>
<span>相似度排序</span> <span>相似度排序</span>
<SvgIcon <SvgIcon style="margin-left: 5px" name="sort" size="12" />
style="margin-left: 5px" <SvgIcon style="margin-left: 5px" name="active-sort" size="12" />
name="sort"
size="12"
/>
<SvgIcon
style="margin-left: 5px"
name="active-sort"
size="12"
/>
</div> </div>
</div> </div>
</div> </div>
<div class="allview"> <div class="allview">
<div class="list" > <div class="list">
<div
v-for="item in taskDetailPictureList"
:key="item.id"
class="item"
draggable="true"
@dragend="
(event) => {
handleDragEnd(event, item);
}
"
>
<div
class="img-wrapper"
:style="{
'background-image': `url(${item.serverThumbnailUrl})`,
}"
@mouseover="overTaskHandelr(item)"
@mouseleave="leaveTaskHandler"
>
<div <div
v-for="item in taskDetailPictureList" v-show="overTasktwo && overTasktwo.id === item.id && !batch"
:key="item.id" class="action"
class="item"
draggable="true"
@dragend="
(event) => {
handleDragEnd(event, item);
}
"
> >
<div <SvgIcon
class="img-wrapper" style="cursor: pointer"
:style="{ name="t1"
'background-image': `url(${item.serverThumbnailUrl})`, @click.stop="approvalHandler([item])"
}"
@mouseover="overTaskHandelr(item)"
@mouseleave="leaveTaskHandler"
>
<div
v-show="overTasktwo&& overTasktwo.id === item.id&&!batch"
class="action"
>
<SvgIcon
style="cursor: pointer"
name="t1"
@click.stop="approvalHandler([item])"
/>
<SvgIcon
style="cursor: pointer; margin-left: 40px"
name="t2"
@click.stop="singleRejectHandlex(item)"
/>
</div>
</div>
<div class="small-mark" />
<div class="check">
<n-checkbox
v-show="batch && item.historyStates === 1"
v-model:checked="item.checked"
@click.stop
@update:checked="onCheckChange($event, item)"
/>
</div>
<img
v-if="item.historyStates === 2"
class="tag-status"
src="@/assets/images/task/tag-pass.png"
alt=""
/> />
<img <SvgIcon
v-if="item.historyStates === 3" style="cursor: pointer; margin-left: 40px"
class="tag-status" name="t2"
src="@/assets/images/task/tag-not-pass.png" @click.stop="singleRejectHandlex(item)"
alt=""
/> />
<div class="time">
<div class="time-item">
<SvgIcon
class="svg-time"
color="#FFF"
size="16"
name="camera-time"
/>
<span>{{
item.photoDateTimestamp
? formatToDateHMS(Number(item.photoDateTimestamp))
: "-"
}}</span>
</div>
<div class="time-item time-item2">
<SvgIcon
class="svg-time"
color="#FFF"
size="16"
name="submit-time"
/>
<span>{{
item.submitDateTimestamp
? formatToDateHMS(Number(item.submitDateTimestamp))
: "-"
}}</span>
</div>
</div>
<div
:class="{ 'percent-red': item.similarityScore === 100 }"
class="percent"
>
{{ item.similarityScore }}<span class="percent-unit">%</span>
</div>
</div> </div>
</div>
<div class="small-mark" />
<div class="check">
<n-checkbox
v-show="batch && item.historyStates === 1"
v-model:checked="item.checked"
@click.stop
@update:checked="onCheckChange($event, item)"
/>
</div>
<img
v-if="item.historyStates === 2"
class="tag-status"
src="@/assets/images/task/tag-pass.png"
alt=""
/>
<img
v-if="item.historyStates === 3"
class="tag-status"
src="@/assets/images/task/tag-not-pass.png"
alt=""
/>
<div class="time">
<div class="time-item">
<SvgIcon class="svg-time" color="#FFF" size="16" name="camera-time" />
<span>{{
item.photoDateTimestamp
? formatToDateHMS(Number(item.photoDateTimestamp))
: "-"
}}</span>
</div>
<div class="time-item time-item2">
<SvgIcon class="svg-time" color="#FFF" size="16" name="submit-time" />
<span>{{
item.submitDateTimestamp
? formatToDateHMS(Number(item.submitDateTimestamp))
: "-"
}}</span>
</div>
</div> </div>
</div> <div :class="{ 'percent-red': item.similarityScore === 100 }" class="percent">
<!-- <div class="wrapper-list"> {{ item.similarityScore }}<span class="percent-unit">%</span>
</div>
</div>
</div>
</div>
<!-- <div class="wrapper-list">
<div <div
v-for="(item, index) in taskDetailPictureList" v-for="(item, index) in taskDetailPictureList"
:key="index" :key="index"
@ -1220,12 +1094,8 @@ function closePassno(){
</div> </div>
</div>--> </div>-->
</div> </div>
<NotPassed ref="notPassModalRef" @success="notPassSuccess" @close="closePassno"/> <NotPassed ref="notPassModalRef" @success="notPassSuccess" @close="closePassno" />
<BatchModal <BatchModal ref="batchModalRef" @reject="rejectHandler" @approval="approvalHandler" />
ref="batchModalRef"
@reject="rejectHandler"
@approval="approvalHandler"
/>
<CustomSettingModal ref="CustomSettingModalRef" @on-ok="getDetail" /> <CustomSettingModal ref="CustomSettingModalRef" @on-ok="getDetail" />
</div> </div>
</template> </template>
@ -1882,145 +1752,141 @@ function closePassno(){
margin: 3px 0 10px 0; margin: 3px 0 10px 0;
max-width: 650px; max-width: 650px;
} }
.allview { .allview {
flex: 0.5; flex: 0.5;
background: #f6f9fd; background: #f6f9fd;
border-radius: 8px; border-radius: 8px;
// margin-left: 20px; // margin-left: 20px;
padding-top: 24px; padding-top: 24px;
.action { .action {
position: absolute; position: absolute;
z-index: 10; z-index: 10;
width: 100%; width: 100%;
height: 100%; height: 100%;
display: flex; display: flex;
border-radius: 8px; border-radius: 8px;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
background-color: rgba(0, 0, 0, 0.5); background-color: rgba(0, 0, 0, 0.5);
} }
.right-card { .right-card {
padding: 3px; padding: 3px;
} }
.header {
display: flex;
justify-content: space-between;
font-size: 17px;
font-weight: bold;
color: #333333;
margin-bottom: 16px;
}
.list {
display: flex;
flex-wrap: wrap;
flex-direction: row;
justify-content: flex-start;
flex-shrink: 0;
}
.item {
// flex-basis: calc((100% - 48px) / 3);
box-sizing: border-box;
border-radius: 8px;
position: relative;
// overflow: hidden;
margin: 0px 16px 27px 0px;
.small-mark {
width: 100%;
height: 53px;
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;
bottom: 0;
z-index: 0;
}
.tag-status {
width: 46px;
height: 22px;
position: absolute;
left: -4px;
top: 4px;
}
.time {
position: absolute;
z-index: 3;
left: 3px;
bottom: 3px;
.time-item { .header {
display: flex; display: flex;
align-items: center; justify-content: space-between;
font-size: 16px; font-size: 17px;
font-family: PingFang SC, PingFang SC-Medium; font-weight: bold;
font-weight: 500; color: #333333;
color: #ffffff; margin-bottom: 16px;
margin-bottom: 2px; }
line-height: 12px;
}
.time-item2 { .list {
margin-bottom: 0; display: flex;
} flex-wrap: wrap;
flex-direction: row;
justify-content: flex-start;
flex-shrink: 0;
}
.svg-time { .item {
margin-right: 5px; // flex-basis: calc((100% - 48px) / 3);
} box-sizing: border-box;
} border-radius: 8px;
position: relative;
// overflow: hidden;
margin: 0px 16px 27px 0px;
.small-mark {
width: 100%;
height: 53px;
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;
bottom: 0;
z-index: 0;
}
.img-wrapper { .tag-status {
position: relative; width: 46px;
width: 230px; height: 22px;
height: 130px; position: absolute;
overflow: hidden; left: -4px;
background-size: cover; top: 4px;
background-position: center; }
background-repeat: no-repeat;
border-radius: 8px;
cursor: n-resize;
}
.check { .time {
position: absolute; position: absolute;
z-index: 5; z-index: 3;
left: 6px; left: 3px;
top: 4px; bottom: 3px;
}
}
.percent { .time-item {
position: absolute;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; font-size: 16px;
width: 35px; font-family: PingFang SC, PingFang SC-Medium;
height: 18px; font-weight: 500;
opacity: 0.9; color: #ffffff;
background: #6f92fd; margin-bottom: 2px;
border-radius: 6px 0px 6px 0px; line-height: 12px;
z-index: 5;
right: 12px;
top: 2px;
color: #fff;
font-size: 14px;
} }
.percent-unit { .time-item2 {
font-size: 8px; margin-bottom: 0;
margin-top: 4px;
} }
.percent-red { .svg-time {
background: #ff4e4f; margin-right: 5px;
} }
} }
.img-wrapper {
position: relative;
width: 230px;
height: 130px;
overflow: hidden;
background-size: cover;
background-position: center;
background-repeat: no-repeat;
border-radius: 8px;
cursor: n-resize;
}
.check {
position: absolute;
z-index: 5;
left: 6px;
top: 4px;
}
}
.percent {
position: absolute;
display: flex;
align-items: center;
justify-content: center;
width: 35px;
height: 18px;
opacity: 0.9;
background: #6f92fd;
border-radius: 6px 0px 6px 0px;
z-index: 5;
right: 12px;
top: 2px;
color: #fff;
font-size: 14px;
}
.percent-unit {
font-size: 8px;
margin-top: 4px;
}
.percent-red {
background: #ff4e4f;
}
}
</style> </style>

Loading…
Cancel
Save