|
@@ -332,18 +332,7 @@
|
|
|
:data-work-order-images="group.key"
|
|
:data-work-order-images="group.key"
|
|
|
>
|
|
>
|
|
|
<span class="equipment-section__wo-label">{{ group.label }}附件</span>
|
|
<span class="equipment-section__wo-label">{{ group.label }}附件</span>
|
|
|
- <span class="equipment-section__thumbs">
|
|
|
|
|
- <button
|
|
|
|
|
- v-for="(path, index) in group.images"
|
|
|
|
|
- :key="`${group.key}-${index}`"
|
|
|
|
|
- type="button"
|
|
|
|
|
- class="equipment-section__thumb"
|
|
|
|
|
- :aria-label="`查看${group.label}附件${index + 1}`"
|
|
|
|
|
- @click="openProof(order, group, path)"
|
|
|
|
|
- >
|
|
|
|
|
- <img :src="resolveDeviceImageUrl(path)" :alt="`${group.label}附件${index + 1}`" loading="lazy" @error="markProofFailed($event)" />
|
|
|
|
|
- </button>
|
|
|
|
|
- </span>
|
|
|
|
|
|
|
+ <ImageGallery :items="proofItems(order, group)" empty-text="暂无附件" />
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -360,7 +349,6 @@
|
|
|
v-if="trackOfOrder(order)"
|
|
v-if="trackOfOrder(order)"
|
|
|
:track="trackOfOrder(order)"
|
|
:track="trackOfOrder(order)"
|
|
|
:path-only="!timeline.hasContent"
|
|
:path-only="!timeline.hasContent"
|
|
|
- @preview="openStepProof"
|
|
|
|
|
/>
|
|
/>
|
|
|
<p v-else-if="timeline.hasContent" class="equipment-section__hint" data-wo-timeline-missing>
|
|
<p v-else-if="timeline.hasContent" class="equipment-section__hint" data-wo-timeline-missing>
|
|
|
这张工单没有动作记录
|
|
这张工单没有动作记录
|
|
@@ -387,15 +375,15 @@
|
|
|
|
|
|
|
|
<!-- 设备图片:只画后端指定的那一张(前端不索引、不挑选) -->
|
|
<!-- 设备图片:只画后端指定的那一张(前端不索引、不挑选) -->
|
|
|
<figure v-else-if="panel.kind === 'image'" class="equipment-section__figure" data-latest-image>
|
|
<figure v-else-if="panel.kind === 'image'" class="equipment-section__figure" data-latest-image>
|
|
|
- <template v-if="image(panel).hasImage">
|
|
|
|
|
- <button v-if="!imageFailed" type="button" class="equipment-section__image-button" aria-label="放大查看设备图片" @click="imagePreviewOpen = true">
|
|
|
|
|
- <img class="equipment-section__img" :src="image(panel).url" :alt="`${deviceCode} 设备图片`" @load="imageLoading = false" @error="imageFailed = true; imageLoading = false" />
|
|
|
|
|
- <span>{{ imageLoading ? '图片加载中…' : '点击放大' }}</span>
|
|
|
|
|
- </button>
|
|
|
|
|
- <p v-else class="equipment-section__hint" role="status">图片加载失败,请检查图片服务地址或文件是否可访问。<button type="button" @click="imageFailed = false; imageLoading = true">重试</button></p>
|
|
|
|
|
- <figcaption class="equipment-section__meta">拍摄于 {{ image(panel).capturedAt }}</figcaption>
|
|
|
|
|
- </template>
|
|
|
|
|
- <p v-else class="equipment-section__hint" data-latest-image-empty>后端未提供该设备的图片</p>
|
|
|
|
|
|
|
+ <ImageGallery
|
|
|
|
|
+ :key="deviceImageKey(panel)"
|
|
|
|
|
+ :items="deviceImageItems(panel)"
|
|
|
|
|
+ size="large"
|
|
|
|
|
+ hint="点击放大"
|
|
|
|
|
+ empty-text="后端未提供该设备的图片"
|
|
|
|
|
+ :style="{ '--image-gallery-max-height': 'calc(140 * var(--u, 1px))' }"
|
|
|
|
|
+ />
|
|
|
|
|
+ <figcaption v-if="image(panel).hasImage" class="equipment-section__meta">拍摄于 {{ image(panel).capturedAt }}</figcaption>
|
|
|
</figure>
|
|
</figure>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -414,9 +402,6 @@
|
|
|
</p>
|
|
</p>
|
|
|
</section>
|
|
</section>
|
|
|
</div>
|
|
</div>
|
|
|
- <!-- 设备图片 / 维修附件共用通用图片查看器(背景虚化压暗、右上角 × 关闭、不画背景板)。 -->
|
|
|
|
|
- <ImagePreview :open="imagePreviewOpen" :src="currentImageUrl" :alt="`${deviceCode} 设备图片`" @close="imagePreviewOpen = false" />
|
|
|
|
|
- <ImagePreview :open="proofPreviewOpen" :src="proofUrl" :alt="proofImage.caption" :caption="proofImage.caption" @close="proofPreviewOpen = false" />
|
|
|
|
|
<!--
|
|
<!--
|
|
|
音频播放条:贴在播放键上方渐入的小浮层(Teleport 到 body,避免被滚动容器裁剪)。
|
|
音频播放条:贴在播放键上方渐入的小浮层(Teleport 到 body,避免被滚动容器裁剪)。
|
|
|
不再用居中大弹窗/背景虚化;点击外部、滚动或 Esc 都会收起。
|
|
不再用居中大弹窗/背景虚化;点击外部、滚动或 Esc 都会收起。
|
|
@@ -474,7 +459,7 @@ import SectionStateTag from './SectionStateTag.vue'
|
|
|
import WorkOrderTimeline from './WorkOrderTimeline.vue'
|
|
import WorkOrderTimeline from './WorkOrderTimeline.vue'
|
|
|
import PagerNav from './PagerNav.vue'
|
|
import PagerNav from './PagerNav.vue'
|
|
|
import MetricStateHint from './MetricStateHint.vue'
|
|
import MetricStateHint from './MetricStateHint.vue'
|
|
|
-import ImagePreview from './ImagePreview.vue'
|
|
|
|
|
|
|
+import ImageGallery from './ImageGallery.vue'
|
|
|
|
|
|
|
|
const props = defineProps({
|
|
const props = defineProps({
|
|
|
/** `stores/detailStore.js` 的 `sections.equipmentAggregate`。 */
|
|
/** `stores/detailStore.js` 的 `sections.equipmentAggregate`。 */
|
|
@@ -517,29 +502,10 @@ function setWoTab(order, key) {
|
|
|
woTabs.value = { ...woTabs.value, [order.code]: key }
|
|
woTabs.value = { ...woTabs.value, [order.code]: key }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-/**
|
|
|
|
|
- * 附件/流水图片的查看弹窗:缩略图与流水截图共用同一个 <dialog>。
|
|
|
|
|
- * 路径走 `resolveDeviceImageUrl`(维修附件与设备图片同一对象基址);解析不出就不弹空窗。
|
|
|
|
|
- */
|
|
|
|
|
-const proofPreviewOpen = ref(false)
|
|
|
|
|
-const proofImage = ref({ url: '', caption: '' })
|
|
|
|
|
-const proofUrl = computed(() => proofImage.value.url)
|
|
|
|
|
-function showProof(path, caption) {
|
|
|
|
|
- const url = resolveDeviceImageUrl(path)
|
|
|
|
|
- if (!url) return
|
|
|
|
|
- proofImage.value = { url, caption }
|
|
|
|
|
- proofPreviewOpen.value = true
|
|
|
|
|
-}
|
|
|
|
|
-function openProof(order, group, path) {
|
|
|
|
|
- showProof(path, `${order?.title || '工单'} · ${group.label}附件`)
|
|
|
|
|
-}
|
|
|
|
|
-function openStepProof(detail) {
|
|
|
|
|
- showProof(detail?.path, detail?.caption || '维修过程附件')
|
|
|
|
|
-}
|
|
|
|
|
-/** 缩略图取不到就压暗并明确标出来,不画破图。 */
|
|
|
|
|
-function markProofFailed(event) {
|
|
|
|
|
- const img = event?.target
|
|
|
|
|
- if (img && typeof img.setAttribute === 'function') img.setAttribute('data-broken', 'true')
|
|
|
|
|
|
|
+/** 工单维修前/后附件:每张带同一句 caption(工单 · 前后),不让组件猜。 */
|
|
|
|
|
+function proofItems(order, group) {
|
|
|
|
|
+ const title = order?.title || '工单'
|
|
|
|
|
+ return (group.images || []).map((path) => ({ url: path, caption: `${title} · ${group.label}附件` }))
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// ---- 票 46 返工第 1 条:标签页切换(弃用六块竖排的长滚动)----
|
|
// ---- 票 46 返工第 1 条:标签页切换(弃用六块竖排的长滚动)----
|
|
@@ -780,28 +746,30 @@ function trackOfOrder(order) {
|
|
|
return full || pathOnlyTrack(order)
|
|
return full || pathOnlyTrack(order)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+/** 设备图片视图:有没有后端点名的那一张、拍摄于何时(地址解析交给展示组件)。 */
|
|
|
function image(panel) {
|
|
function image(panel) {
|
|
|
|
|
+ return imageView(panel.section.data)
|
|
|
|
|
+}
|
|
|
|
|
+/**
|
|
|
|
|
+ * 设备图片只有后端点名的那一张;没有就给空列表,由组件说「后端未提供」。
|
|
|
|
|
+ *
|
|
|
|
|
+ * 这里传**原始地址**,解析交给组件的唯一解析器:如果把已解析结果塞回去,
|
|
|
|
|
+ * 解析器拒绝(带凭据 / 非法协议)时会变成空地址,界面就会把「地址不可用」
|
|
|
|
|
+ * 误说成「后端未提供」,还会与下面的「拍摄于 …」自相矛盾。
|
|
|
|
|
+ */
|
|
|
|
|
+function deviceImageItems(panel) {
|
|
|
const view = imageView(panel.section.data)
|
|
const view = imageView(panel.section.data)
|
|
|
- return { ...view, url: resolveDeviceImageUrl(view.url) }
|
|
|
|
|
-}
|
|
|
|
|
-const imagePreviewOpen = ref(false)
|
|
|
|
|
-const imageFailed = ref(false)
|
|
|
|
|
-const imageLoading = ref(true)
|
|
|
|
|
-const currentImageUrl = computed(() => {
|
|
|
|
|
- const panel = panels.value.find((item) => item.kind === 'image')
|
|
|
|
|
- return panel ? image(panel).url : ''
|
|
|
|
|
-})
|
|
|
|
|
-watch([() => props.deviceCode, currentImageUrl], () => {
|
|
|
|
|
- imagePreviewOpen.value = false
|
|
|
|
|
- proofPreviewOpen.value = false
|
|
|
|
|
- proofImage.value = { url: '', caption: '' }
|
|
|
|
|
- imageFailed.value = false
|
|
|
|
|
- imageLoading.value = true
|
|
|
|
|
-})
|
|
|
|
|
|
|
+ return view.hasImage ? [{ url: view.url, alt: `${props.deviceCode} 设备图片` }] : []
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+/** 换设备/换图时重建组件(连带复位预览与加载状态);用后端原始地址做键。 */
|
|
|
|
|
+function deviceImageKey(panel) {
|
|
|
|
|
+ return imageView(panel.section.data).url
|
|
|
|
|
+}
|
|
|
watch([() => props.deviceCode, activeTab], () => {
|
|
watch([() => props.deviceCode, activeTab], () => {
|
|
|
closeAudioPlayer()
|
|
closeAudioPlayer()
|
|
|
})
|
|
})
|
|
|
-/** 图片查看交互已收口到通用 ImagePreview(背景点击 / Esc 关闭)。 */
|
|
|
|
|
|
|
+/** 图片查看交互已收口到通用 ImageGallery(内部弹 ImagePreview,背景点击 / Esc 关闭)。 */
|
|
|
|
|
|
|
|
function emptyList(label) {
|
|
function emptyList(label) {
|
|
|
return emptyListText(label)
|
|
return emptyListText(label)
|
|
@@ -1300,24 +1268,6 @@ function isPlaceholder(text) {
|
|
|
gap: calc(8 * var(--u, 1px));
|
|
gap: calc(8 * var(--u, 1px));
|
|
|
margin-top: calc(4 * var(--u, 1px));
|
|
margin-top: calc(4 * var(--u, 1px));
|
|
|
}
|
|
}
|
|
|
-.equipment-section__thumbs {
|
|
|
|
|
- display: flex;
|
|
|
|
|
- flex-wrap: wrap;
|
|
|
|
|
- gap: calc(4 * var(--u, 1px));
|
|
|
|
|
- min-width: 0;
|
|
|
|
|
-}
|
|
|
|
|
-.equipment-section__thumb {
|
|
|
|
|
- width: calc(44 * var(--u, 1px));
|
|
|
|
|
- height: calc(44 * var(--u, 1px));
|
|
|
|
|
- padding: 0;
|
|
|
|
|
- overflow: hidden;
|
|
|
|
|
- border: 1px solid rgba(1, 171, 234, .3);
|
|
|
|
|
- border-radius: calc(3 * var(--u, 1px));
|
|
|
|
|
- background: rgba(1, 12, 32, .5);
|
|
|
|
|
- cursor: zoom-in;
|
|
|
|
|
-}
|
|
|
|
|
-.equipment-section__thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
|
|
|
|
|
-.equipment-section__thumb img[data-broken='true'] { opacity: .3; }
|
|
|
|
|
|
|
|
|
|
/* 工单详情:面板较窄,两列键值改为竖向一行一项,字号与正文一致。 */
|
|
/* 工单详情:面板较窄,两列键值改为竖向一行一项,字号与正文一致。 */
|
|
|
.equipment-section__wo-detail { gap: calc(6 * var(--u, 1px)); }
|
|
.equipment-section__wo-detail { gap: calc(6 * var(--u, 1px)); }
|
|
@@ -1435,15 +1385,6 @@ function isPlaceholder(text) {
|
|
|
margin: 0;
|
|
margin: 0;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-.equipment-section__img {
|
|
|
|
|
- display: block;
|
|
|
|
|
- width: 100%;
|
|
|
|
|
- max-height: calc(140 * var(--u, 1px));
|
|
|
|
|
- object-fit: cover;
|
|
|
|
|
- border: 1px solid rgba(1, 171, 234, 0.35);
|
|
|
|
|
- border-radius: calc(8 * var(--u, 1px));
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
.equipment-section__hint,
|
|
.equipment-section__hint,
|
|
|
.equipment-section__missing,
|
|
.equipment-section__missing,
|
|
|
.is-muted {
|
|
.is-muted {
|
|
@@ -1461,29 +1402,7 @@ function isPlaceholder(text) {
|
|
|
font-family: var(--num, monospace);
|
|
font-family: var(--num, monospace);
|
|
|
letter-spacing: 0.04em;
|
|
letter-spacing: 0.04em;
|
|
|
}
|
|
}
|
|
|
-.equipment-section__image-button {
|
|
|
|
|
- display: grid;
|
|
|
|
|
- gap: 6px;
|
|
|
|
|
- width: 100%;
|
|
|
|
|
- padding: 0;
|
|
|
|
|
- border: 0;
|
|
|
|
|
- background: transparent;
|
|
|
|
|
- color: var(--cyan-hi);
|
|
|
|
|
- font: inherit;
|
|
|
|
|
- cursor: zoom-in;
|
|
|
|
|
-}
|
|
|
|
|
-.equipment-image-viewer {
|
|
|
|
|
- width: min(90vw, 1200px);
|
|
|
|
|
- max-height: 90vh;
|
|
|
|
|
- padding: 16px;
|
|
|
|
|
- border: 1px solid var(--cyan);
|
|
|
|
|
- border-radius: calc(8 * var(--u, 1px));
|
|
|
|
|
- background: var(--bg-0);
|
|
|
|
|
- color: var(--text);
|
|
|
|
|
-}
|
|
|
|
|
-.equipment-image-viewer::backdrop { background: rgba(1, 5, 20, .8); backdrop-filter: blur(6px); }
|
|
|
|
|
-.equipment-image-viewer img { display: block; width: 100%; height: auto; max-height: 78vh; object-fit: contain; }
|
|
|
|
|
-.equipment-image-viewer__close { display: block; margin-left: auto; margin-bottom: 8px; cursor: pointer; }
|
|
|
|
|
|
|
+
|
|
|
/* 音频播放条:贴播放键上方渐入的小浮层,不遮罩、不虚化整屏 UI。 */
|
|
/* 音频播放条:贴播放键上方渐入的小浮层,不遮罩、不虚化整屏 UI。 */
|
|
|
.collection-audio-player {
|
|
.collection-audio-player {
|
|
|
position: fixed;
|
|
position: fixed;
|