From 995f994bf420004db68dbb268a249634c122cbf3 Mon Sep 17 00:00:00 2001 From: elseif Date: Fri, 15 Mar 2024 15:08:30 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=9B=BE=E7=89=87=E6=94=BE=E5=A4=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/image.ts | 8 +++---- src/views/task/content/Content.vue | 27 +++++++++++++++------ src/views/worksheet/content/Content.vue | 32 ++++++++++++++++++++----- 3 files changed, 50 insertions(+), 17 deletions(-) diff --git a/src/utils/image.ts b/src/utils/image.ts index 5c24810..c54af51 100644 --- a/src/utils/image.ts +++ b/src/utils/image.ts @@ -1,17 +1,17 @@ -import { unref } from 'vue' +import { nextTick, unref } from 'vue' import { useConfig } from '@/store/modules/asideConfig' const downloadSvg = '' export function hideDownload(e: MouseEvent) { - setTimeout(() => { + nextTick(() => { const configStore = useConfig() const downloadEle: any = document.querySelector('.n-image-preview-toolbar')?.children[5] const asideValue = unref(configStore.getAsideValue) - const download = asideValue.izimgdownload + const download = asideValue?.izimgdownload if (downloadEle && downloadEle.innerHTML === downloadSvg && download === false) downloadEle.style.display = 'none' else downloadEle.style.display = 'block' - }, 100) + }) } diff --git a/src/views/task/content/Content.vue b/src/views/task/content/Content.vue index a8783ae..4867330 100644 --- a/src/views/task/content/Content.vue +++ b/src/views/task/content/Content.vue @@ -12,6 +12,7 @@ import type { ApprovalParam, PictureSortParam } from '/#/api' import { getTaskDetailInfo, getTaskDetailPictureList } from '@/api/work/work' import { useUser } from '@/store/modules/user' import emitter from '@/utils/mitt' +import { hideDownload } from '@/utils/image' const batch = ref(false) const selectItems = ref([]) @@ -57,8 +58,9 @@ const taskStore = useTask() const overTask = ref(null) const taskDetailInfo = ref({}) const taskDetailPictureList = ref([]) -let processItems: any[] = [] const userStore = useUser() +const imageRef = ref() +let processItems: any[] = [] // states:1未提交,2待审批,3通过,4不通过 function validate(items: any[]) { @@ -231,6 +233,14 @@ const mark = computed(() => { function immersionHandler() { taskStore.updateImmersion() } + +function previewHandler(event: MouseEvent) { + event.stopImmediatePropagation() + event.stopPropagation() + + if (imageRef.value) + (imageRef.value as any).mergedOnClick() +} 返回 -
+
-
+
@@ -269,13 +279,13 @@ function immersionHandler() {
- +
@@ -310,6 +320,9 @@ function immersionHandler() { 2023-09-17 13:09:10
+
+ +
diff --git a/src/views/worksheet/content/Content.vue b/src/views/worksheet/content/Content.vue index bc78357..5c87466 100644 --- a/src/views/worksheet/content/Content.vue +++ b/src/views/worksheet/content/Content.vue @@ -7,6 +7,7 @@ import type { PictureSortParam, SetTFParam } from '/#/api' import { useWorkOrder } from '@/store/modules/workOrder' import { clearTF, getPackageTaskList, getTaskDetailInfo, getTaskDetailPictureList, setTF } from '@/api/work/work' import { fieldMap } from '@/config/workorder' +import { hideDownload } from '@/utils/image' const batch = ref(false) const selectItems = ref([]) @@ -55,8 +56,9 @@ const overTask = ref(null) const taskList = ref([]) const taskDetailInfo = ref({}) const taskDetailPictureList = ref([]) - const confrimModalRef = ref(null) +const imageRef = ref() + let processItems: any[] = [] function validate(items: any[]) { @@ -276,6 +278,14 @@ const mark = computed(() => { function immersionHandler() { workStore.updateImmersion() } + +function previewHandler(event: MouseEvent) { + event.stopImmediatePropagation() + event.stopPropagation() + + if (imageRef.value) + (imageRef.value as any).mergedOnClick() +}