|
|
|
@ -1,5 +1,5 @@
|
|
|
|
|
<script lang="ts" setup>
|
|
|
|
|
import { computed, onMounted, onUnmounted, onUpdated, reactive, ref, unref, watch } from 'vue'
|
|
|
|
|
import { computed, onUnmounted, onUpdated, reactive, ref, unref, watch } from 'vue'
|
|
|
|
|
import { useDialog, useMessage } from 'naive-ui'
|
|
|
|
|
import { clone, debounce, pickBy } from 'lodash-es'
|
|
|
|
|
import { useInfiniteScroll } from '@vueuse/core'
|
|
|
|
@ -51,15 +51,14 @@ const taskpagination = reactive({
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
})
|
|
|
|
|
const sortBy: PictureSortParam = {
|
|
|
|
|
orderbyname: 'desc',
|
|
|
|
|
orderbyvalue: 'fromuptime',
|
|
|
|
|
orderbyname: 'asc',
|
|
|
|
|
orderbyvalue: 'pictureResult',
|
|
|
|
|
}
|
|
|
|
|
const workStore = useWorkOrder()
|
|
|
|
|
const selectTask = ref<any>(null)
|
|
|
|
|
const overTask = ref<any>(null)
|
|
|
|
|
const taskList = ref<any[]>([])
|
|
|
|
|
const taskDetailInfo = ref<any>({})
|
|
|
|
|
const taskDetailPictureList = ref<any[]>([])
|
|
|
|
|
const confrimModalRef = ref(null)
|
|
|
|
|
const imageRef = ref<ComponentElRef | null>()
|
|
|
|
|
const listData = ref<any[]>([])
|
|
|
|
@ -175,13 +174,16 @@ function doSetTF(param: SetTFParam) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function updateList(param: SetTFParam) {
|
|
|
|
|
const list = taskDetailPictureList.value
|
|
|
|
|
const list = listData.value
|
|
|
|
|
const ids = param.taskchildpictureids.split(',')
|
|
|
|
|
|
|
|
|
|
for (const item of list) {
|
|
|
|
|
if (ids.includes(item.id))
|
|
|
|
|
item.iztrueorfalse = param.iztrueorfalse
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (ids.includes(taskDetailInfo.value.id))
|
|
|
|
|
taskDetailInfo.value.iztrueorfalse = param.iztrueorfalse
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function forwardHandler() {
|
|
|
|
@ -246,10 +248,10 @@ const layout = debounce(() => {
|
|
|
|
|
_imagesload.on('done', (instance) => {
|
|
|
|
|
if (!el.value)
|
|
|
|
|
return
|
|
|
|
|
const scrollHeight = el.value!.scrollHeight
|
|
|
|
|
const clientHeight = el.value!.clientHeight
|
|
|
|
|
const top = scrollHeight - clientHeight - 100
|
|
|
|
|
el.value!.scrollTo({ top, behavior: 'instant' })
|
|
|
|
|
// const scrollHeight = el.value!.scrollHeight
|
|
|
|
|
// const clientHeight = el.value!.clientHeight
|
|
|
|
|
// const top = scrollHeight - clientHeight - 100
|
|
|
|
|
// el.value!.scrollTo({ top, behavior: 'instant' })
|
|
|
|
|
loading.value = false
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
@ -299,6 +301,7 @@ async function sortHandler(orderby: 'pictureResult' | 'fromuptime') {
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
sortBy.orderbyvalue = orderby
|
|
|
|
|
sortBy.orderbyname = sortBy.orderbyname === 'asc' ? 'desc' : 'asc'
|
|
|
|
|
refreshHandler()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -362,11 +365,21 @@ function immersionHandler() {
|
|
|
|
|
workStore.updateImmersion()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function showAction() {
|
|
|
|
|
const item = taskDetailInfo.value
|
|
|
|
|
if (batch.value === false)
|
|
|
|
|
overTask.value = item
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function hideAction() {
|
|
|
|
|
overTask.value = null
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function previewHandler(event: MouseEvent) {
|
|
|
|
|
event.stopImmediatePropagation()
|
|
|
|
|
event.stopPropagation()
|
|
|
|
|
|
|
|
|
|
if (imageRef.value)
|
|
|
|
|
if (imageRef.value && (imageRef.value as any).src)
|
|
|
|
|
(imageRef.value as any).mergedOnClick()
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
@ -414,14 +427,16 @@ function previewHandler(event: MouseEvent) {
|
|
|
|
|
<div class="wrapper-detail">
|
|
|
|
|
<div
|
|
|
|
|
class="left" :style="{ 'background-image': `url(${taskDetailInfo?.ocrPicture?.imgurl})` }"
|
|
|
|
|
@click="previewHandler"
|
|
|
|
|
@click="showAction" @mouseleave="leaveTaskHandler"
|
|
|
|
|
>
|
|
|
|
|
<!-- 真假标记 -->
|
|
|
|
|
<div class="mark">
|
|
|
|
|
<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="info">
|
|
|
|
|
<n-grid x-gap="16" y-gap="0" :cols="12">
|
|
|
|
|
<n-gi span="4">
|
|
|
|
@ -444,8 +459,21 @@ function previewHandler(event: MouseEvent) {
|
|
|
|
|
</n-gi>
|
|
|
|
|
</n-grid>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- 右上点击大图 -->
|
|
|
|
|
<div class="preview" @click="previewHandler">
|
|
|
|
|
<SvgIcon size="30" name="zoom-out" />
|
|
|
|
|
</div>
|
|
|
|
|
<!-- 预览大图组件 -->
|
|
|
|
|
<div style="display: none;">
|
|
|
|
|
<n-image ref="imageRef" :img-props="{ onClick: hideDownload }" :src="taskDetailInfo?.ocrPicture?.imgurl" />
|
|
|
|
|
<n-image
|
|
|
|
|
ref="imageRef" :img-props="{ onClick: hideDownload }"
|
|
|
|
|
:src="taskDetailInfo?.ocrPicture?.imgurl"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- 操作 -->
|
|
|
|
|
<div v-show="overTask && overTask.id === taskDetailInfo.id" class="action" @click.stop="hideAction">
|
|
|
|
|
<SvgIcon style="cursor: pointer;" name="t1" @click.stop="trueHandler" />
|
|
|
|
|
<SvgIcon style="cursor: pointer;margin-left: 30px;" name="t2" @click.stop="falseHandler" />
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="right">
|
|
|
|
@ -609,6 +637,21 @@ function previewHandler(event: MouseEvent) {
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
position: relative;
|
|
|
|
|
|
|
|
|
|
.preview {
|
|
|
|
|
position: absolute;
|
|
|
|
|
z-index: 3;
|
|
|
|
|
right: 10px;
|
|
|
|
|
top: 10px;
|
|
|
|
|
width: 50px;
|
|
|
|
|
height: 50px;
|
|
|
|
|
background-color: rgba(255, 255, 255, 0.6);
|
|
|
|
|
border-radius: 10px;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.mark {
|
|
|
|
|
position: absolute;
|
|
|
|
|
z-index: 3;
|
|
|
|
@ -636,6 +679,18 @@ function previewHandler(event: MouseEvent) {
|
|
|
|
|
background: rgba(216, 216, 216, 0.4);
|
|
|
|
|
border-radius: 7px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.action {
|
|
|
|
|
position: absolute;
|
|
|
|
|
z-index: 3;
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 100%;
|
|
|
|
|
display: flex;
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
background-color: rgba(102, 102, 102, 0.5);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.right {
|
|
|
|
|