Merge pull request 'fix: 冲突修复' (#180) from fix/merge into test

Reviewed-on: #180
pull/181/head
刘释隆 1 year ago
commit 6400ab613a

9
components.d.ts vendored

@ -11,6 +11,7 @@ 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']
@ -21,6 +22,8 @@ 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']
@ -32,16 +35,20 @@ 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']
NScrollbar: typeof import('naive-ui')['NScrollbar'] NScrollbar: typeof import('naive-ui')['NScrollbar']
NSelect: typeof import('naive-ui')['NSelect'] NSelect: typeof import('naive-ui')['NSelect']
NSlider: typeof import('naive-ui')['NSlider'] NSlider: typeof import('naive-ui')['NSlider']
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']

@ -26,6 +26,7 @@ module.exports = antfu(
// eslint-disable-next-line node/prefer-global/process // eslint-disable-next-line node/prefer-global/process
process.env.MODE === 'production' ? 2 : 0, process.env.MODE === 'production' ? 2 : 0,
], ],
'array-callback-return': ['error', { allowImplicit: true }],
}, },
}, },
) )

@ -4,7 +4,6 @@ import { defineProps, onMounted, onUnmounted, reactive, ref, watch } from 'vue'
import ListItem from './ListItem.vue' import ListItem from './ListItem.vue'
import emitter from '@/utils/mitt' import emitter from '@/utils/mitt'
import { useTaskStore } from '@/store/modules/task' import { useTaskStore } from '@/store/modules/task'
import { filter } from 'lodash'
defineProps({ defineProps({
showFieldList: { showFieldList: {
@ -28,9 +27,9 @@ const pagination = reactive({
function selectHandler(item, index: number) { function selectHandler(item, index: number) {
activeId.value = item.id activeId.value = item.id
console.log(activeId.value,item.id) console.log(activeId.value, item.id)
console.log(index) console.log(index)
taskStore.setActive(index,item.id) taskStore.setActive(index, item.id)
} }
useInfiniteScroll( useInfiniteScroll(
@ -61,7 +60,7 @@ async function fetchList() {
const result = await taskStore.fetchApprovalList({ const result = await taskStore.fetchApprovalList({
...pagination, ...pagination,
keyword: keyword.value, keyword: keyword.value,
userSearchId:searchId.value userSearchId: searchId.value,
}) })
const { data, pageCount } = result const { data, pageCount } = result
canloadMore.value = pageCount >= pagination.pageNo canloadMore.value = pageCount >= pagination.pageNo
@ -80,25 +79,26 @@ watch(
}, },
) )
watch( watch(
() => taskStore.inFileId, () => taskStore.inFileId,
async (newVal) => { async (newVal) => {
let newlist=[] const newlist = []
let filterid=newVal.taskname const filterid = newVal.taskname
console.log(filterid) console.log(filterid)
const index = data.value.findIndex(person => person.fromtaskname === filterid); const index = data.value.findIndex(person => person.fromtaskname === filterid)
let ovelist = data.value.filter(item => item. fromtaskname !== filterid); const ovelist = data.value.filter(item => item.fromtaskname !== filterid)
ovelist.map((item)=>{ ovelist.map((item) => {
newlist.push(item) newlist.push(item)
return item
}) })
data.value=newlist data.value = newlist
activeId.value = newlist[index].id activeId.value = newlist[index].id
taskStore.setActive(index,newlist[index].id) taskStore.setActive(index, newlist[index].id)
//taskStore.setActive(index) // taskStore.setActive(index)
// activeId.value = data[index+1].id // activeId.value = data[index+1].id
//selectHandler(data[index].id, index) // selectHandler(data[index].id, index)
/* let ovelist = data.value.filter(item => item. fromtaskname !== filterid); /* let ovelist = data.value.filter(item => item. fromtaskname !== filterid);
let newlist=[] let newlist=[]
ovelist.map((item)=>{ ovelist.map((item)=>{
@ -106,9 +106,9 @@ let ovelist = data.value.filter(item => item. fromtaskname !== filterid);
}) })
data.value=newlist data.value=newlist
taskStore.setActive(2) taskStore.setActive(2)
alert(1)*/ alert(1) */
} },
); )
function reset() { function reset() {
pagination.pageNo = 0 pagination.pageNo = 0
pagination.pageSize = 30 pagination.pageSize = 30
@ -131,10 +131,10 @@ async function search(word: string) {
onMounted(() => { onMounted(() => {
emitter.on('refresh', refreshHandler) emitter.on('refresh', refreshHandler)
emitter.on('filter',async(id)=>{ emitter.on('filter', async (id) => {
await reset(); await reset()
searchId.value = id; searchId.value = id
data.value = await fetchList(); data.value = await fetchList()
activeId.value = data.value[0].id activeId.value = data.value[0].id
console.log(data.value) console.log(data.value)
}) })
@ -162,7 +162,6 @@ defineExpose({
<template> <template>
<n-spin :show="isLoading"> <n-spin :show="isLoading">
<div ref="el" class="list"> <div ref="el" class="list">
<ListItem <ListItem
v-for="(item, index) in data" v-for="(item, index) in data"
:key="item.id" :key="item.id"
@ -170,9 +169,7 @@ defineExpose({
:selected="activeId === item.id" :selected="activeId === item.id"
:list-item="item" :list-item="item"
@click="selectHandler(item, index)" @click="selectHandler(item, index)"
> />
</ListItem>
</div> </div>
</n-spin> </n-spin>
</template> </template>

@ -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,67 +22,70 @@ 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) batch.value = !value; if (value && batch.value)
else batch.value = value; 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) selectItems.value.push(item); if (index === -1 && checked)
else selectItems.value.splice(index, 1); selectItems.value.push(item)
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) return "至少选中一个任务"; if (items.length === 0)
return '至少选中一个任务'
// for (const item of items) { // for (const item of items) {
// const { iztrueorfalse, history, states } = item // const { iztrueorfalse, history, states } = item
@ -96,159 +99,163 @@ 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) return; if (loading.value || el.value == null)
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) { }
canloadMore = false; catch (error) {
return []; canloadMore = false
return []
} }
} }
const layout = debounce(() => { 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) => { _imagesload.on('done', (instance) => {
if (!el.value) return; if (!el.value)
loading.value = false; return
}); 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) {
@ -256,233 +263,241 @@ function overTaskHandelr(item: any) {
// return // return
// } // }
if (validate([item]) == null && batch.value === false) overTask.value = item; if (validate([item]) == null && batch.value === false)
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) return; 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) { 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 { }
message.error(res.message); else {
} 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) { }
cloneItem = clone(overTask.value); else if (overTask.value) {
processItems = [cloneItem]; 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) { 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 { }
message.error(res.message); else {
} 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 { }
message.error(res.message); else {
message.error(res.message)
} }
}); })
}, },
onNegativeClick: () => {}, onNegativeClick: () => {},
}); })
} }
defineExpose({ defineExpose({
queryDetail, queryDetail,
}); })
</script> </script>
<template> <template>
@ -553,8 +568,7 @@ defineExpose({
</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(taskDetailInfo?.submitDateTimestamp, "yyyy-MM-dd HH:mm:ss") ? format(taskDetailInfo?.submitDateTimestamp, "yyyy-MM-dd HH:mm:ss")
: "-" : "-"
@ -568,13 +582,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">
@ -585,7 +599,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">
@ -600,12 +614,11 @@ 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" <span class="value num">{{ totalCount }}<span class="unit"></span>
>{{ totalCount }}<span class="unit"></span>
</span> </span>
<span class="label">相似匹配</span> <span class="label">相似匹配</span>
</n-gi> </n-gi>
@ -662,8 +675,7 @@ 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="
@ -749,14 +761,10 @@ defineExpose({
@update:checked="onCheckChange($event, item)" @update:checked="onCheckChange($event, item)"
/> />
</div> </div>
<<<<<<< HEAD
<div class="percent">
=======
<div class="percent" :class="{ 'percent-red': item?.maxSimilarity >= 100 }"> <div class="percent" :class="{ 'percent-red': item?.maxSimilarity >= 100 }">
>>>>>>> test
<SvgIcon <SvgIcon
size="42" size="42"
:name="item.maxSimilarity == 100 ? 'error_tag' : 'tag'" :name="Number(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)
@ -789,7 +797,6 @@ defineExpose({
@click.stop="handleRejectdubiousfileyd" @click.stop="handleRejectdubiousfileyd"
/> />
</div> </div>
</div>
<n-back-top <n-back-top
:listen-to="wrapperListRef" :listen-to="wrapperListRef"
:bottom="220" :bottom="220"

Loading…
Cancel
Save