Merge branch 'test' of https://git.mcnetmart.com/guoxiangbin/ocr-web into fix/suspiciousSort

pull/119/head
raofuzi 1 year ago
commit 57ceccc5e1

13909
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -1,5 +1,5 @@
import type { AsideEntity } from './aside' import type { AsideEntity } from './aside'
import { IzApprovalStatus, IzProjectVue, IzStatus, IztaskrromVue, PictureDownloadVue, PlanVue, ReportUserVue, TimeVue, IzCustomname, IzCustomtype, IzVisitcity, IzCustomlevel, IzProjecttype, IzProductVue, IzvisitproVue, IzfirmVue } from '@/views/home/aside/comp/items' import { IzApprovalStatus, IzCustomlevel, IzCustomname, IzCustomtype, IzProductVue, IzProjectVue, IzProjecttype, IzShowAll, IzStatus, IzVisitcity, IzfirmVue, IztaskrromVue, IzvisitproVue, PictureDownloadVue, PlanVue, ReportUserVue, TimeVue } from '@/views/home/aside/comp/items'
export interface RowData { export interface RowData {
id: string id: string
@ -125,12 +125,11 @@ export const asideMap: Recordable<AsideEntity> = {
defaultValue: true, defaultValue: true,
isDefaultFilter: false, isDefaultFilter: false,
key: 'izshowall', key: 'izshowall',
component: PictureDownloadVue, component: IzShowAll,
inFilterList: false, inFilterList: false,
}, },
} }
// 审批添加筛选配置 (左侧) // 审批添加筛选配置 (左侧)
export const asideTaskMap: Recordable<AsideEntity> = { export const asideTaskMap: Recordable<AsideEntity> = {
izstatus: { izstatus: {
@ -194,7 +193,7 @@ export const asideTaskMap: Recordable<AsideEntity> = {
defaultValue: null, defaultValue: null,
isDefaultFilter: true, isDefaultFilter: true,
key: 'izcustomlevel', key: 'izcustomlevel',
component: IzCustomlevel component: IzCustomlevel,
}, },
izprojecttype: { izprojecttype: {
label: '项目类别', label: '项目类别',
@ -223,5 +222,5 @@ export const asideTaskMap: Recordable<AsideEntity> = {
isDefaultFilter: true, isDefaultFilter: true,
key: 'izfirm', key: 'izfirm',
component: IzfirmVue, component: IzfirmVue,
} },
} }

@ -28,9 +28,10 @@ const routes: Array<RouteRecordRaw> = [
children: [ children: [
{ {
path: 'final', path: 'final',
name: 'final-main', name: 'FinalMain',
meta: { meta: {
title: '任务终审', title: '任务终审',
keepAlive: true,
}, },
component: () => import('@/views/final/index.vue'), component: () => import('@/views/final/index.vue'),
}, },

@ -5,6 +5,7 @@ import { getFilter } from '@/api/home/filter'
export interface ConfigState { export interface ConfigState {
customConfig: string[] | null customConfig: string[] | null
asideValue: any asideValue: any
listKey: number
} }
export const useFinalStore = defineStore({ export const useFinalStore = defineStore({
@ -12,6 +13,7 @@ export const useFinalStore = defineStore({
state: (): ConfigState => ({ state: (): ConfigState => ({
customConfig: null, customConfig: null,
asideValue: null, asideValue: null,
listKey: 0,
}), }),
getters: { getters: {
getCustomConfig(): string[] | null { getCustomConfig(): string[] | null {
@ -25,6 +27,9 @@ export const useFinalStore = defineStore({
setAsideValue(value) { setAsideValue(value) {
this.asideValue = value this.asideValue = value
}, },
setListKey() {
this.listKey = new Date().getTime()
},
// 获取终审个性化配置 // 获取终审个性化配置
async fetchCustomConfig() { async fetchCustomConfig() {
const res = await getFilter(1) const res = await getFilter(1)

@ -58,7 +58,6 @@ const actionsColumns = {
title: '操作', title: '操作',
key: 'actions', key: 'actions',
minWidth: 200, minWidth: 200,
width: 200,
fixed: 'right', fixed: 'right',
render(row) { render(row) {
return h(ListAction, { return h(ListAction, {
@ -265,7 +264,7 @@ async function formatColumns() {
title: '任务ID', title: '任务ID',
key: columnsRef.value[index].key, // "id" key: columnsRef.value[index].key, // "id"
fixed: columnsRef.value[index].fixed || undefined, fixed: columnsRef.value[index].fixed || undefined,
width: 160, width: 200,
render(row) { render(row) {
const item: any = izstatusList.value.find( const item: any = izstatusList.value.find(
(item: any) => item.value == row.states, (item: any) => item.value == row.states,
@ -388,6 +387,27 @@ async function formatColumns() {
}, },
} }
} }
index = columnsRef.value.findIndex(v => v.title == '提报人')
if (index > -1) {
columnsRef.value[index] = {
title: '提报人',
key: columnsRef.value[index].key,
fixed: columnsRef.value[index].fixed || undefined,
width: 200,
sorter: 'default',
renderSorterIcon: ({ order }) => {
if (order === false)
return h(SvgIcon, { name: 'sort-2' })
if (order === 'ascend')
return h(SvgIcon, { name: 'sort-1' })
if (order === 'descend')
return h(SvgIcon, { name: 'sort-3' })
},
render(row: any) {
return row.fromusername
},
}
}
index = columnsRef.value.findIndex(v => v.title == '更新时间') index = columnsRef.value.findIndex(v => v.title == '更新时间')
if (index > -1) { if (index > -1) {
@ -468,7 +488,8 @@ const finalStore = useFinal()
async function query(page: number, pageSize: number, filterId?: any, taskName?: string) { async function query(page: number, pageSize: number, filterId?: any, taskName?: string) {
const asideParmas = unref(finalStore.getAsideValue) const asideParmas = unref(finalStore.getAsideValue)
// 使使 // 使使
const params = filterId ? { userSearchId: filterId } : asideParmas let params = filterId ? { userSearchId: filterId } : asideParmas
params = params.izshowall ? {} : params
const result = await getFinalList({ const result = await getFinalList({
sortorder: sortorder.value, sortorder: sortorder.value,
pageSize, pageSize,
@ -555,22 +576,6 @@ const maxHeight = computed(() => {
return tableData.value.length ? `${unref(deviceHeight)}px` : 'auto' return tableData.value.length ? `${unref(deviceHeight)}px` : 'auto'
}) })
const scrollX = computed(() => {
const table = unref(tableRef)
if (!table)
return
const tableEl: any = table?.$el
const wrapper = tableEl.querySelector('.n-data-table-wrapper')
const arr = columnsRef.value.filter(item => item.fixed)
let width = 0
arr.forEach((item) => {
width += Number(item.width) || 200
})
console.log(wrapper.offsetWidth + width)
console.log(arr)
return wrapper.offsetWidth + width
})
query(pagination.page, pagination.pageSize) query(pagination.page, pagination.pageSize)
const customTabelRef = ref(null) const customTabelRef = ref(null)
@ -824,6 +829,13 @@ watch(
{ deep: true }, { deep: true },
) )
watch(
() => finalStore.listKey,
(newVal, oldVal) => {
refreshHandler()
},
)
function reset() { function reset() {
pagination.page = 1 pagination.page = 1
pagination.pageCount = 1 pagination.pageCount = 1
@ -959,7 +971,7 @@ defineExpose({
v-model:checked-row-keys="checkedRowKeys" v-model:checked-row-keys="checkedRowKeys"
remote remote
:columns="columnsRef" :columns="columnsRef"
:scroll-x="scrollX" :scroll-x="1250"
:max-height="maxHeight" :max-height="maxHeight"
:data="tableData" :data="tableData"
:loading="loading" :loading="loading"

@ -4,25 +4,26 @@ import Aside from './aside/Aside.vue'
import Content from './content/Content.vue' import Content from './content/Content.vue'
import ListContent from './content/ListContent.vue' import ListContent from './content/ListContent.vue'
const showList = ref(false); defineOptions({
const contentRef:any = ref(null); name: 'FinalMain',
const inputChange = (keyword)=>{ })
const showList = ref(false)
const contentRef: any = ref(null)
function inputChange(keyword) {
contentRef.value.filterTableData(keyword) contentRef.value.filterTableData(keyword)
} }
</script> </script>
<template> <template>
<div class="main"> <div class="main">
<!-- 侧边 --> <!-- 侧边 -->
<Aside @inputChange="inputChange" /> <Aside @input-change="inputChange" />
<!-- 内容 --> <!-- 内容 -->
<Content @changeShow="showList=true" ref="contentRef" v-show="!showList" /> <Content v-show="!showList" ref="contentRef" @change-show="showList = true" />
<!-- 任务管理 --> <!-- 任务管理 -->
<!-- TODO:本地演示即可 上传注释注释 --> <!-- TODO:本地演示即可 上传注释注释 -->
<ListContent v-show="showList" @changeShow="showList=false" /> <ListContent v-show="showList" @change-show="showList = false" />
</div> </div>
</template> </template>

@ -0,0 +1,46 @@
<script lang="ts" setup>
import { ref } from 'vue'
import { useConfig } from '@/store/modules/asideConfig'
const props = defineProps({
value: {
type: Boolean,
default: true,
},
label: {
type: String,
default: '',
},
})
const emit = defineEmits<{
(e: 'update:value', value: boolean): void
}>()
const configStore = useConfig()
const download = ref(props.value)
function onChange(value: boolean) {
emit('update:value', value)
}
</script>
<template>
<div class="download">
<span class="download-title">{{ label }}</span>
<n-switch v-model:value="download" @update:value="onChange" />
</div>
</template>
<style lang="less" scoped>
.download {
display: flex;
padding: 10px;
justify-content: space-between;
&-title {
font-weight: bold;
}
}
</style>

@ -20,6 +20,6 @@ import ReportUserVue from './ReportUser.vue'
import SimilarityVue from './Similarity.vue' import SimilarityVue from './Similarity.vue'
import TimeVue from './Time.vue' import TimeVue from './Time.vue'
import IzApprovalStatus from './IzApprovalStatus.vue' import IzApprovalStatus from './IzApprovalStatus.vue'
import IzShowAll from './IzShowAll.vue'
export { IzProjecttype, IzStatus, IzVisitcity, IzCustomlevel, IzCustomtype, IzCustomname, IzfirmVue, IzProductVue, IzvisitproVue, IztaskstatusVue, IztaskrromVue, IzProjectVue, PictureDownloadVue, PictureUploadVue, PlaceHolderVue, RegionVue, SimilarityVue, ReportUserVue, PlanVue, PictureTypeVue, TimeVue, IzApprovalStatus } export { IzProjecttype, IzStatus, IzVisitcity, IzCustomlevel, IzCustomtype, IzCustomname, IzfirmVue, IzProductVue, IzvisitproVue, IztaskstatusVue, IztaskrromVue, IzProjectVue, PictureDownloadVue, PictureUploadVue, PlaceHolderVue, RegionVue, SimilarityVue, ReportUserVue, PlanVue, PictureTypeVue, TimeVue, IzApprovalStatus, IzShowAll }

@ -1,103 +1,110 @@
<script lang="ts" setup> <script lang="ts" setup>
import { computed, onMounted, onUnmounted, reactive, ref, unref, watch } from 'vue' import {
import { chunk, clone } from 'lodash-es' computed,
import { useDialog, useMessage } from 'naive-ui' onMounted,
import { useRoute, useRouter } from 'vue-router' onUnmounted,
import BatchModal from '../modal/BatchModal.vue' reactive,
import CustomSettingModal from '../modal/CustomSettingModal.vue' ref,
import PictureTable from './PictureTable.vue' unref,
import TaskTable from './TaskTable.vue' watch,
import History from './History.vue' } from "vue";
import NotPassed from '@/components/Approval/NotPassed.vue' import { chunk, clone } from "lodash-es";
import { getAllfieldList, getfieldList } from '@/api/home/filter' import { useDialog, useMessage } from "naive-ui";
import { TASK_STATUS_OBJ } from '@/enums/index' import { useRoute, useRouter } from "vue-router";
import BatchModal from "../modal/BatchModal.vue";
import CustomSettingModal from "../modal/CustomSettingModal.vue";
import PictureTable from "./PictureTable.vue";
import TaskTable from "./TaskTable.vue";
import History from "./History.vue";
import NotPassed from "@/components/Approval/NotPassed.vue";
import { getAllfieldList, getfieldList } from "@/api/home/filter";
import { TASK_STATUS_OBJ } from "@/enums/index";
import { useFinal } from "@/store/modules/final";
import { import {
audit, audit,
dubiousfileyd, dubiousfileyd,
getSimilarityList, getSimilarityList,
getTaskDetailInfo, getTaskDetailInfo,
} from '@/api/task/task' } from "@/api/task/task";
import { useTask } from '@/store/modules/task' import { useTask } from "@/store/modules/task";
import { useUser } from '@/store/modules/user' import { useUser } from "@/store/modules/user";
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";
const emit = defineEmits(['setAsideItemName']) const emit = defineEmits(["setAsideItemName"]);
const router = useRouter() const router = useRouter();
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 notPassModalRef = ref(null) const notPassModalRef = ref(null);
const batchModalRef: any = ref(null) const batchModalRef: any = ref(null);
const totalCount = ref(0) const totalCount = ref(0);
const taskId: any = ref('') // id const taskId: any = ref(""); // id
const packageId: any = ref('') // id const packageId: any = ref(""); // id
const CustomSettingModalRef = ref(null) const CustomSettingModalRef = ref(null);
const taskTableData = ref<any[]>([]) const taskTableData = ref<any[]>([]);
const route = useRoute() const route = useRoute();
const isDetail = ref(false) // const isDetail = ref(false); //
const finalStore = useFinal();
const sortBy: any = { const sortBy: any = {
orderType: 'desc', orderType: "desc",
orderName: 'similarityScore', orderName: "similarityScore",
} };
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: 30, pageSize: 30,
}) });
const taskStore = useTask() const taskStore = useTask();
const overTask = ref<any>(null) const overTask = ref<any>(null);
const taskDetailInfo = ref<any>({}) const taskDetailInfo = ref<any>({});
const taskDetailPictureList = ref<any[]>([]) const taskDetailPictureList = ref<any[]>([]);
const userStore = useUser() const userStore = useUser();
const imageRef = ref<ComponentElRef | null>() const imageRef = ref<ComponentElRef | null>();
let processItems: any[] = [] let processItems: any[] = [];
const isFullScreen = ref(false) const isFullScreen = ref(false);
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" : "",
})) }));
onMounted(() => { onMounted(() => {
window.addEventListener('keydown', handleKeydown) window.addEventListener("keydown", handleKeydown);
if (route.query.id) { if (route.query.id) {
taskId.value = route.query.id taskId.value = route.query.id;
packageId.value = route.query.packageid packageId.value = route.query.packageid;
isDetail.value = true isDetail.value = true;
getDetail() getDetail();
} }
}) });
// //
function handleKeydown(event) { function handleKeydown(event) {
if (event.key === 'ArrowLeft') if (event.key === "ArrowLeft") backHandler();
backHandler()
// //
else if (event.key === 'ArrowRight') else if (event.key === "ArrowRight") forwardHandler();
forwardHandler()
// //
} }
@ -105,27 +112,26 @@ function setBatch(value: boolean) {
// if (totalCount.value === 0) // if (totalCount.value === 0)
// return // return
batch.value = value batch.value = value;
if (value === false) { if (value === false) {
taskDetailInfo.value.checked = false taskDetailInfo.value.checked = false;
selectItems.value = [] selectItems.value = [];
taskDetailPictureList.value.forEach((item) => { taskDetailPictureList.value.forEach((item) => {
item.checked = false item.checked = false;
}) });
} }
} }
// storeid // storeid
function currentTaskId() { function currentTaskId() {
const index = taskStore.getCurrentIndex const index = taskStore.getCurrentIndex;
return taskStore.getApprovalList[index]?.id || '' return taskStore.getApprovalList[index]?.id || "";
} }
// states:1234 // states:1234
function validate(items: any[]) { function validate(items: any[]) {
if (items.length === 0) if (items.length === 0) return "至少选中一个任务";
return '至少选中一个任务'
// const useInfo = userStore.getUserInfo // const useInfo = userStore.getUserInfo
// const username = useInfo.loginname // const username = useInfo.loginname
@ -142,131 +148,129 @@ function validate(items: any[]) {
// return '' // return ''
// } // }
return null return null;
} }
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;
} }
console.log(processItems) console.log(processItems);
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 rejectHandler(items?: any) { function rejectHandler(items?: any) {
const modal = unref(notPassModalRef)! as any const modal = unref(notPassModalRef)! as any;
modal.showModal(items) modal.showModal(items);
} }
function singleRejectHandler() { function singleRejectHandler() {
const modal = unref(notPassModalRef)! as any const modal = unref(notPassModalRef)! as any;
modal.showModal([taskDetailInfo.value]) modal.showModal([taskDetailInfo.value]);
} }
function doAudit(param: any) { function doAudit(param: any) {
audit(param).then((res) => { audit(param).then((res) => {
const { code } = res const { code } = res;
if (code === 'OK') { if (code === "OK") {
message.success(res.message) message.success(res.message);
setBatch(false) setBatch(false);
reloadList(param, '通过') reloadList(param, "通过");
batchModalRef.value.reload() batchModalRef.value.reload();
} }
}) });
} }
function showModal(modalRef: any) { function showModal(modalRef: any) {
const modal = unref(modalRef)! as any const modal = unref(modalRef)! as any;
modal.showModal(taskId.value) modal.showModal(taskId.value);
} }
function forwardHandler() { function forwardHandler() {
taskStore.forward() taskStore.forward();
} }
function backHandler() { function backHandler() {
taskStore.back() taskStore.back();
} }
async function handleDragEnd(event, item) { async function handleDragEnd(event, item) {
// //
const flag = taskStore.getInFile const flag = taskStore.getInFile;
if (flag) { if (flag) {
const res = await dubiousfileyd({ pictureid: item.pictureId }) const res = await dubiousfileyd({ pictureid: item.pictureId });
if (res.code === 'OK') { if (res.code === "OK") {
message.success('加入成功') message.success("加入成功");
setBatch(false) setBatch(false);
getTableData() getTableData();
getImgList() getImgList();
} } else {
else { 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 = [];
const reviewType = 3 // const reviewType = 3; //
let res = await getAllfieldList(reviewType) let res = await getAllfieldList(reviewType);
const fieldList = (res as any)?.data const fieldList = (res as any)?.data;
res = await getfieldList(reviewType, useInfo.id) res = await getfieldList(reviewType, useInfo.id);
const userFieldList = (res as any)?.data.userFieldFixed const userFieldList = (res as any)?.data.userFieldFixed;
const blueList = [ const blueList = [
'拜访终端名称', "拜访终端名称",
'定位信息', "定位信息",
'拜访日期', "拜访日期",
'定位距离', "定位距离",
'拜访小结', "拜访小结",
'拜访项目类别', "拜访项目类别",
] ];
fieldList.map((v) => { fieldList.map((v) => {
if (userFieldList.includes(v.name)) { if (userFieldList.includes(v.name)) {
const item = { const item = {
@ -274,11 +278,11 @@ async function getTableData() {
value: taskDetailInfo.value.ocrPicture[v.name], value: taskDetailInfo.value.ocrPicture[v.name],
key: v.name, key: v.name,
blue: blueList.includes(v.fieldDesc), blue: blueList.includes(v.fieldDesc),
} };
listData.push(item) listData.push(item);
} }
}) });
taskTableData.value = chunk(listData, 2) taskTableData.value = chunk(listData, 2);
} }
async function getImgList() { async function getImgList() {
@ -287,98 +291,97 @@ async function getImgList() {
...taskpagination, ...taskpagination,
...sortBy, ...sortBy,
pictureId: taskDetailInfo.value.ocrPicture.id, pictureId: taskDetailInfo.value.ocrPicture.id,
}) });
taskDetailPictureList.value = data taskDetailPictureList.value = data;
totalCount.value = total totalCount.value = total;
} } else {
else { taskDetailPictureList.value.length = 0;
taskDetailPictureList.value.length = 0 totalCount.value = 0;
totalCount.value = 0
} }
} }
function overTaskHandle() { function overTaskHandle() {
const item = taskDetailInfo.value 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 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
} }
function leaveTaskHandler() { function leaveTaskHandler() {
overTask.value = null overTask.value = null;
} }
function showActionsModal() { function showActionsModal() {
const modal = unref(CustomSettingModalRef)! as any const modal = unref(CustomSettingModalRef)! as any;
modal.showModal() modal.showModal();
} }
onUnmounted(() => { onUnmounted(() => {
taskStore.reset() taskStore.reset();
window.removeEventListener('keydown', handleKeydown) window.removeEventListener("keydown", handleKeydown);
}) });
function immersionHandler() { function immersionHandler() {
// taskStore.updateImmersion() // taskStore.updateImmersion()
toggleFullScreen() toggleFullScreen();
} }
// //
function toggleFullScreen() { function toggleFullScreen() {
isFullScreen.value = !isFullScreen.value isFullScreen.value = !isFullScreen.value;
} }
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();
} }
watch( watch(
() => [taskStore.activeId], () => [taskStore.activeId],
() => { () => {
if (!isEmpty(taskStore.getActiveId)) { if (!isEmpty(taskStore.getActiveId)) {
packageId.value = taskStore.getPackageid packageId.value = taskStore.getPackageid;
taskId.value = taskStore.getActiveId taskId.value = taskStore.getActiveId;
getDetail() getDetail();
} }
}, }
) );
// //
async function getDetail() { async function getDetail() {
taskDetailInfo.value = await getTaskDetailInfo(taskId.value, packageId.value) taskDetailInfo.value = await getTaskDetailInfo(taskId.value, packageId.value);
setBatch(false) setBatch(false);
getTableData() getTableData();
getImgList() getImgList();
} }
function notPassSuccess(param) { function notPassSuccess(param) {
batchModalRef.value.reload() batchModalRef.value.reload();
reloadList(param, '不通过') reloadList(param, "不通过");
} }
function reloadList(param, text) { function reloadList(param, text) {
// //
const id = currentTaskId() const id = currentTaskId();
const hasCurrentId = param.flowTaskInfoList.find(item => item.formId === id) const hasCurrentId = param.flowTaskInfoList.find(
(item) => item.formId === id
if (hasCurrentId) );
emit('setAsideItemName', text) finalStore.setListKey();
if (hasCurrentId) emit("setAsideItemName", text);
getDetail()
getDetail();
} }
function goBack() { function goBack() {
router.back() router.back();
} }
function switchBatch() { function switchBatch() {
setBatch(!batch.value) setBatch(!batch.value);
} }
</script> </script>
@ -388,8 +391,18 @@ function switchBatch() {
<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 size="22" class="forward" name="arrow-left" @click="backHandler" /> <SvgIcon
<SvgIcon size="22" class="back" name="arrow-right" @click="forwardHandler" /> size="22"
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">
@ -424,8 +437,20 @@ function switchBatch() {
</ul> </ul>
</n-popover> --> </n-popover> -->
<div class="icon-wrap"> <div class="icon-wrap">
<SvgIcon v-if="isFullScreen" size="20" name="power-off" style="cursor: pointer;" @click="immersionHandler" /> <SvgIcon
<SvgIcon v-else size="20" name="immersion-model" style="cursor: pointer;" @click="immersionHandler" /> v-if="isFullScreen"
size="20"
name="power-off"
style="cursor: pointer"
@click="immersionHandler"
/>
<SvgIcon
v-else
size="20"
name="immersion-model"
style="cursor: pointer"
@click="immersionHandler"
/>
</div> </div>
</div> </div>
<div v-show="showActions" class="batch"> <div v-show="showActions" class="batch">
@ -440,14 +465,14 @@ function switchBatch() {
src="@/assets/images/task/btn-not-pass.png" src="@/assets/images/task/btn-not-pass.png"
alt="" alt=""
@click.stop="rejectHandler(selectItems)" @click.stop="rejectHandler(selectItems)"
> />
<SvgIcon size="24" name="vs" /> <SvgIcon size="24" name="vs" />
<img <img
class="btn-approval" class="btn-approval"
src="@/assets/images/task/btn-pass.png" src="@/assets/images/task/btn-pass.png"
alt="" alt=""
@click.stop="approvalHandler" @click.stop="approvalHandler"
> />
</div> </div>
</div> </div>
<div v-else class="right"> <div v-else class="right">
@ -500,19 +525,27 @@ function switchBatch() {
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?.userapprove?.statshis === 3" v-show="taskDetailInfo?.userapprove?.statshis === 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="mark"> <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>
<div class="mark"> <div class="mark">
<SvgIcon v-show="taskDetailInfo?.iztrueorfalse === 1" size="128" 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">
@ -522,7 +555,11 @@ function switchBatch() {
<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 class="icon-status" src="@/assets/images/task/status.png" alt=""> <img
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">
@ -537,23 +574,47 @@ function switchBatch() {
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> <span class="value num"
>{{ 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 class="svg-time" color="#FFF" size="16" name="camera-time" /> <SvgIcon
<span>{{ taskDetailInfo?.ocrPicture?.photoDateTimestamp ? formatToDateHMS(Number(taskDetailInfo.ocrPicture.photoDateTimestamp)) : '-' }}</span> class="svg-time"
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 class="svg-time" color="#FFF" size="16" name="submit-time" /> <SvgIcon
<span>{{ taskDetailInfo?.ocrPicture?.submitDateTimestamp ? formatToDateHMS(Number(taskDetailInfo.ocrPicture.submitDateTimestamp)) : '-' }}</span> class="svg-time"
color="#FFF"
size="16"
name="submit-time"
/>
<span>{{
taskDetailInfo?.ocrPicture?.submitDateTimestamp
? formatToDateHMS(
Number(taskDetailInfo.ocrPicture.submitDateTimestamp)
)
: "-"
}}</span>
</div> </div>
</div> </div>
<div style="display: none"> <div style="display: none">
@ -577,11 +638,23 @@ function switchBatch() {
/> />
</div> </div>
<div class="list"> <div class="list">
<div v-for="item in taskDetailPictureList" :key="item.id" class="item"> <div
v-for="item in taskDetailPictureList"
:key="item.id"
class="item"
draggable="true"
@dragend="
(event) => {
handleDragEnd(event, item);
}
"
>
<div <div
draggable="true" draggable="true"
class="img-wrapper" class="img-wrapper"
:style="{ 'background-image': `url(${item.serverThumbnailUrl})` }" :style="{
'background-image': `url(${item.serverThumbnailUrl})`,
}"
@dragend=" @dragend="
(event) => { (event) => {
handleDragEnd(event, item); handleDragEnd(event, item);
@ -603,21 +676,39 @@ function switchBatch() {
class="tag-status" class="tag-status"
src="@/assets/images/task/tag-pass.png" src="@/assets/images/task/tag-pass.png"
alt="" alt=""
> />
<img <img
v-if="item.historyStates === 3" v-if="item.historyStates === 3"
class="tag-status" class="tag-status"
src="@/assets/images/task/tag-not-pass.png" src="@/assets/images/task/tag-not-pass.png"
alt="" alt=""
> />
<div class="time"> <div class="time">
<div class="time-item"> <div class="time-item">
<SvgIcon class="svg-time" color="#FFF" size="8" name="camera-time" /> <SvgIcon
<span>{{ item.photoDateTimestamp ? formatToDateHMS(Number(item.photoDateTimestamp)) : '-' }}</span> class="svg-time"
color="#FFF"
size="8"
name="camera-time"
/>
<span>{{
item.photoDateTimestamp
? formatToDateHMS(Number(item.photoDateTimestamp))
: "-"
}}</span>
</div> </div>
<div class="time-item time-item2"> <div class="time-item time-item2">
<SvgIcon class="svg-time" color="#FFF" size="8" name="submit-time" /> <SvgIcon
<span>{{ item.submitDateTimestamp ? formatToDateHMS(Number(item.submitDateTimestamp)) : '-' }}</span> class="svg-time"
color="#FFF"
size="8"
name="submit-time"
/>
<span>{{
item.submitDateTimestamp
? formatToDateHMS(Number(item.submitDateTimestamp))
: "-"
}}</span>
</div> </div>
</div> </div>
<div <div
@ -649,10 +740,7 @@ function switchBatch() {
<History :data="taskDetailInfo" /> <History :data="taskDetailInfo" />
</n-tab-pane> </n-tab-pane>
</n-tabs> </n-tabs>
<NotPassed <NotPassed ref="notPassModalRef" @success="notPassSuccess" />
ref="notPassModalRef"
@success="notPassSuccess"
/>
<BatchModal <BatchModal
ref="batchModalRef" ref="batchModalRef"
@reject="rejectHandler" @reject="rejectHandler"
@ -840,7 +928,7 @@ function switchBatch() {
z-index: 3; z-index: 3;
width: 30px; width: 30px;
height: 30px; height: 30px;
background: rgba(255, 255, 255, 0.20); background: rgba(255, 255, 255, 0.2);
border-radius: 6px; border-radius: 6px;
backdrop-filter: blur(10px); backdrop-filter: blur(10px);
display: flex; display: flex;
@ -849,7 +937,7 @@ function switchBatch() {
cursor: pointer; cursor: pointer;
} }
.big-mark{ .big-mark {
width: 100%; width: 100%;
height: 151px; height: 151px;
background: linear-gradient( background: linear-gradient(
@ -910,7 +998,10 @@ function switchBatch() {
z-index: 3; z-index: 3;
left: 16px; left: 16px;
bottom: 16px; bottom: 16px;
padding-left: 10px;
width: 195px;
background: rgba(216, 216, 216, 0.4);
border-radius: 7px;
.time-item { .time-item {
display: flex; display: flex;
align-items: center; align-items: center;
@ -1026,6 +1117,10 @@ function switchBatch() {
z-index: 3; z-index: 3;
left: 3px; left: 3px;
bottom: 3px; bottom: 3px;
width: 98%;
background: rgba(216, 216, 216, 0.4);
border-radius: 7px;
.time-item { .time-item {
display: flex; display: flex;
align-items: center; align-items: center;

Loading…
Cancel
Save