|
@@ -300,6 +300,51 @@
|
|
|
<span class="equipment-section__item-more" aria-hidden="true" data-work-order-more>查看详情 ›</span>
|
|
<span class="equipment-section__item-more" aria-hidden="true" data-work-order-more>查看详情 ›</span>
|
|
|
</summary>
|
|
</summary>
|
|
|
|
|
|
|
|
|
|
+ <!-- 维护者 2026-11-23:详情分「工单信息 / 处置流程」两个子页签,各自独立查看。 -->
|
|
|
|
|
+ <div class="equipment-section__wo-tabs" role="tablist" data-work-order-tabs>
|
|
|
|
|
+ <button
|
|
|
|
|
+ v-for="tab in WORK_ORDER_DETAIL_TABS"
|
|
|
|
|
+ :key="tab.key"
|
|
|
|
|
+ type="button"
|
|
|
|
|
+ role="tab"
|
|
|
|
|
+ class="equipment-section__wo-tab"
|
|
|
|
|
+ :data-work-order-tab="tab.key"
|
|
|
|
|
+ :data-active="woTabOf(order) === tab.key ? 'true' : 'false'"
|
|
|
|
|
+ :aria-selected="woTabOf(order) === tab.key ? 'true' : 'false'"
|
|
|
|
|
+ @click="setWoTab(order, tab.key)"
|
|
|
|
|
+ >{{ tab.label }}</button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <template v-if="woTabOf(order) === 'info'">
|
|
|
|
|
+ <dl class="equipment-section__detail equipment-section__wo-detail" data-history-detail>
|
|
|
|
|
+ <div v-for="row in workOrderDetailRows(order)" :key="row.label" class="equipment-section__detail-row" :data-detail-row="row.label">
|
|
|
|
|
+ <dt>{{ row.label }}</dt>
|
|
|
|
|
+ <dd>{{ row.value }}</dd>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </dl>
|
|
|
|
|
+ <!-- 维修前/后附件:缩略图直接点开查看(维护者 2026-11-23)。 -->
|
|
|
|
|
+ <div
|
|
|
|
|
+ v-for="group in workOrderAttachmentGroups(order)"
|
|
|
|
|
+ :key="group.key"
|
|
|
|
|
+ class="equipment-section__wo-attachments"
|
|
|
|
|
+ :data-work-order-images="group.key"
|
|
|
|
|
+ >
|
|
|
|
|
+ <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>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </template>
|
|
|
|
|
+
|
|
|
<!--
|
|
<!--
|
|
|
票 12:这张工单自己的状态路径 + 动作轨迹。
|
|
票 12:这张工单自己的状态路径 + 动作轨迹。
|
|
|
· 轨迹分区拿到了数据 → 完整轨迹(状态路径 + 动作流水);
|
|
· 轨迹分区拿到了数据 → 完整轨迹(状态路径 + 动作流水);
|
|
@@ -308,20 +353,17 @@
|
|
|
"这张工单现在在哪一态"也一起不画,等于丢掉已有的信息。
|
|
"这张工单现在在哪一态"也一起不画,等于丢掉已有的信息。
|
|
|
分区自己的成败由下面那条整块占位说明如实交代。
|
|
分区自己的成败由下面那条整块占位说明如实交代。
|
|
|
-->
|
|
-->
|
|
|
- <WorkOrderTimeline
|
|
|
|
|
- v-if="trackOfOrder(order)"
|
|
|
|
|
- :track="trackOfOrder(order)"
|
|
|
|
|
- :path-only="!timeline.hasContent"
|
|
|
|
|
- />
|
|
|
|
|
- <p v-else-if="timeline.hasContent" class="equipment-section__hint" data-wo-timeline-missing>
|
|
|
|
|
- 这张工单没有动作记录
|
|
|
|
|
- </p>
|
|
|
|
|
- <dl class="equipment-section__detail equipment-section__wo-detail" data-history-detail>
|
|
|
|
|
- <div v-for="row in workOrderDetailRows(order)" :key="row.label" class="equipment-section__detail-row" :data-detail-row="row.label">
|
|
|
|
|
- <dt>{{ row.label }}</dt>
|
|
|
|
|
- <dd>{{ row.value }}</dd>
|
|
|
|
|
- </div>
|
|
|
|
|
- </dl>
|
|
|
|
|
|
|
+ <template v-else>
|
|
|
|
|
+ <WorkOrderTimeline
|
|
|
|
|
+ v-if="trackOfOrder(order)"
|
|
|
|
|
+ :track="trackOfOrder(order)"
|
|
|
|
|
+ :path-only="!timeline.hasContent"
|
|
|
|
|
+ @preview="openStepProof"
|
|
|
|
|
+ />
|
|
|
|
|
+ <p v-else-if="timeline.hasContent" class="equipment-section__hint" data-wo-timeline-missing>
|
|
|
|
|
+ 这张工单没有动作记录
|
|
|
|
|
+ </p>
|
|
|
|
|
+ </template>
|
|
|
</details>
|
|
</details>
|
|
|
<!-- 轨迹分区自己失败/为空:整块说一句(不按每张工单重复同一句话,那是噪音) -->
|
|
<!-- 轨迹分区自己失败/为空:整块说一句(不按每张工单重复同一句话,那是噪音) -->
|
|
|
<p v-if="timeline.placeholder" class="equipment-section__hint" data-wo-timeline-placeholder>
|
|
<p v-if="timeline.placeholder" class="equipment-section__hint" data-wo-timeline-placeholder>
|
|
@@ -374,6 +416,12 @@
|
|
|
<button type="button" autofocus class="equipment-image-viewer__close" @click="imageDialog.close()">关闭</button>
|
|
<button type="button" autofocus class="equipment-image-viewer__close" @click="imageDialog.close()">关闭</button>
|
|
|
<img :src="currentImageUrl" :alt="`${deviceCode} 设备图片`" />
|
|
<img :src="currentImageUrl" :alt="`${deviceCode} 设备图片`" />
|
|
|
</dialog>
|
|
</dialog>
|
|
|
|
|
+ <!-- 维修附件 / 维修过程截图:与设备图片同一个查看器交互(点背景或按关闭收起)。 -->
|
|
|
|
|
+ <dialog ref="proofDialog" class="equipment-image-viewer" aria-label="维修附件查看" @click="closeProofBackdrop">
|
|
|
|
|
+ <button type="button" autofocus class="equipment-image-viewer__close" @click="proofDialog.close()">关闭</button>
|
|
|
|
|
+ <img :src="proofUrl" :alt="proofImage.caption" />
|
|
|
|
|
+ <p class="equipment-section__meta" data-proof-caption>{{ proofImage.caption }}</p>
|
|
|
|
|
+ </dialog>
|
|
|
<!--
|
|
<!--
|
|
|
音频播放条:贴在播放键上方渐入的小浮层(Teleport 到 body,避免被滚动容器裁剪)。
|
|
音频播放条:贴在播放键上方渐入的小浮层(Teleport 到 body,避免被滚动容器裁剪)。
|
|
|
不再用居中大弹窗/背景虚化;点击外部、滚动或 Esc 都会收起。
|
|
不再用居中大弹窗/背景虚化;点击外部、滚动或 Esc 都会收起。
|
|
@@ -422,6 +470,7 @@ import {
|
|
|
tabCount,
|
|
tabCount,
|
|
|
timelineSource,
|
|
timelineSource,
|
|
|
workOrderDetailRows,
|
|
workOrderDetailRows,
|
|
|
|
|
+ workOrderAttachmentGroups,
|
|
|
workOrderRows,
|
|
workOrderRows,
|
|
|
} from '../domain/equipmentDetailView.js'
|
|
} from '../domain/equipmentDetailView.js'
|
|
|
import { pathOnlyTrack } from '../domain/workOrderTimeline.js'
|
|
import { pathOnlyTrack } from '../domain/workOrderTimeline.js'
|
|
@@ -442,13 +491,6 @@ const props = defineProps({
|
|
|
const sectionsRoot = ref(null)
|
|
const sectionsRoot = ref(null)
|
|
|
const panels = computed(() => equipmentPanels(props.aggregate))
|
|
const panels = computed(() => equipmentPanels(props.aggregate))
|
|
|
const videoDevice = ref(null)
|
|
const videoDevice = ref(null)
|
|
|
-// 工单详情要显示「设备类型」,但工单接口不下发它:面板里每张工单都属于当前这台设备,
|
|
|
|
|
-// 所以用档案分区的类型名兜底(拿不到就留空,详情里那一行自然不出现)。
|
|
|
|
|
-const archiveDeviceTypeName = computed(() => {
|
|
|
|
|
- const archive = panels.value.find((panel) => panel.kind === 'archive')?.section.data
|
|
|
|
|
- return String(archive?.deviceTypeName ?? '').trim()
|
|
|
|
|
-})
|
|
|
|
|
-
|
|
|
|
|
// 档案 type 是 deviceType 的领域字段;只认当前设备的摄像机正证据,不以能力查询失败推断传感器。
|
|
// 档案 type 是 deviceType 的领域字段;只认当前设备的摄像机正证据,不以能力查询失败推断传感器。
|
|
|
const isCamera = computed(() => {
|
|
const isCamera = computed(() => {
|
|
|
const archive = panels.value.find((panel) => panel.kind === 'archive')?.section.data
|
|
const archive = panels.value.find((panel) => panel.kind === 'archive')?.section.data
|
|
@@ -456,6 +498,48 @@ const isCamera = computed(() => {
|
|
|
|| (videoDevice.value?.deviceCode === props.deviceCode && videoDevice.value?.typeCode === '20')
|
|
|| (videoDevice.value?.deviceCode === props.deviceCode && videoDevice.value?.typeCode === '20')
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
|
|
+/**
|
|
|
|
|
+ * 工单详情的两个子页签(维护者 2026-11-23:信息与流水分开看,便于查看)。
|
|
|
|
|
+ * 停在哪个页签**按工单号记忆**,互不影响;默认停在「工单信息」。
|
|
|
|
|
+ */
|
|
|
|
|
+const WORK_ORDER_DETAIL_TABS = [
|
|
|
|
|
+ { key: 'info', label: '工单信息' },
|
|
|
|
|
+ { key: 'flow', label: '处置流程' },
|
|
|
|
|
+]
|
|
|
|
|
+const woTabs = ref({})
|
|
|
|
|
+function woTabOf(order) {
|
|
|
|
|
+ return woTabs.value[order?.code] || 'info'
|
|
|
|
|
+}
|
|
|
|
|
+function setWoTab(order, key) {
|
|
|
|
|
+ if (!order?.code || woTabOf(order) === key) return
|
|
|
|
|
+ woTabs.value = { ...woTabs.value, [order.code]: key }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+/**
|
|
|
|
|
+ * 附件/流水图片的查看弹窗:缩略图与流水截图共用同一个 <dialog>。
|
|
|
|
|
+ * 路径走 `resolveDeviceImageUrl`(维修附件与设备图片同一对象基址);解析不出就不弹空窗。
|
|
|
|
|
+ */
|
|
|
|
|
+const proofDialog = ref(null)
|
|
|
|
|
+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 }
|
|
|
|
|
+ proofDialog.value?.showModal()
|
|
|
|
|
+}
|
|
|
|
|
+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')
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
// ---- 票 46 返工第 1 条:标签页切换(弃用六块竖排的长滚动)----
|
|
// ---- 票 46 返工第 1 条:标签页切换(弃用六块竖排的长滚动)----
|
|
|
|
|
|
|
|
/** 页签清单(domain 给顺序与背后的分区归属;计数给预警/报警/工单三页)。 */
|
|
/** 页签清单(domain 给顺序与背后的分区归属;计数给预警/报警/工单三页)。 */
|
|
@@ -597,7 +681,7 @@ onBeforeUnmount(detachAudioGuards)
|
|
|
function rowsOf(panel) {
|
|
function rowsOf(panel) {
|
|
|
const data = panel.section.data
|
|
const data = panel.section.data
|
|
|
if (panel.kind === 'archive') return archiveRows(data)
|
|
if (panel.kind === 'archive') return archiveRows(data)
|
|
|
- if (panel.kind === 'orders') return workOrderRows(data, { deviceTypeName: archiveDeviceTypeName.value })
|
|
|
|
|
|
|
+ if (panel.kind === 'orders') return workOrderRows(data)
|
|
|
return eventRows(data)
|
|
return eventRows(data)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -707,12 +791,21 @@ const currentImageUrl = computed(() => {
|
|
|
})
|
|
})
|
|
|
watch([() => props.deviceCode, currentImageUrl], () => {
|
|
watch([() => props.deviceCode, currentImageUrl], () => {
|
|
|
imageDialog.value?.close()
|
|
imageDialog.value?.close()
|
|
|
|
|
+ proofDialog.value?.close()
|
|
|
|
|
+ proofImage.value = { url: '', caption: '' }
|
|
|
imageFailed.value = false
|
|
imageFailed.value = false
|
|
|
imageLoading.value = true
|
|
imageLoading.value = true
|
|
|
})
|
|
})
|
|
|
watch([() => props.deviceCode, activeTab], () => {
|
|
watch([() => props.deviceCode, activeTab], () => {
|
|
|
closeAudioPlayer()
|
|
closeAudioPlayer()
|
|
|
})
|
|
})
|
|
|
|
|
+/** 点对话框外的背景才关(点图片本身不关)。 */
|
|
|
|
|
+function closeProofBackdrop(event) {
|
|
|
|
|
+ const dialog = proofDialog.value
|
|
|
|
|
+ if (!dialog || event.target !== dialog) return
|
|
|
|
|
+ const rect = dialog.getBoundingClientRect()
|
|
|
|
|
+ if (event.clientX < rect.left || event.clientX > rect.right || event.clientY < rect.top || event.clientY > rect.bottom) dialog.close()
|
|
|
|
|
+}
|
|
|
function closeImageBackdrop(event) {
|
|
function closeImageBackdrop(event) {
|
|
|
if (event.target !== imageDialog.value) return
|
|
if (event.target !== imageDialog.value) return
|
|
|
const rect = imageDialog.value.getBoundingClientRect()
|
|
const rect = imageDialog.value.getBoundingClientRect()
|
|
@@ -1174,6 +1267,53 @@ function isPlaceholder(text) {
|
|
|
line-height: 1.5;
|
|
line-height: 1.5;
|
|
|
}
|
|
}
|
|
|
.equipment-section__wo-row > span:last-child { min-width: 0; overflow-wrap: anywhere; }
|
|
.equipment-section__wo-row > span:last-child { min-width: 0; overflow-wrap: anywhere; }
|
|
|
|
|
+/* 工单详情子页签(维护者 2026-11-23):工单信息与处置流程分开看,各自独立。 */
|
|
|
|
|
+.equipment-section__wo-tabs {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ gap: calc(6 * var(--u, 1px));
|
|
|
|
|
+ margin: calc(2 * var(--u, 1px)) 0;
|
|
|
|
|
+}
|
|
|
|
|
+.equipment-section__wo-tab {
|
|
|
|
|
+ padding: calc(2 * var(--u, 1px)) calc(10 * var(--u, 1px));
|
|
|
|
|
+ border: 1px solid rgba(1, 171, 234, .3);
|
|
|
|
|
+ border-radius: 999px;
|
|
|
|
|
+ background: transparent;
|
|
|
|
|
+ color: var(--muted, #5680b0);
|
|
|
|
|
+ font-size: var(--fs-caption, 10.5px);
|
|
|
|
|
+ line-height: 1.6;
|
|
|
|
|
+ cursor: pointer;
|
|
|
|
|
+}
|
|
|
|
|
+.equipment-section__wo-tab[data-active='true'] {
|
|
|
|
|
+ border-color: var(--lv3, #1aabff);
|
|
|
|
|
+ color: var(--lv3, #1aabff);
|
|
|
|
|
+ background: color-mix(in srgb, var(--lv3, #1aabff) 14%, transparent);
|
|
|
|
|
+}
|
|
|
|
|
+/* 维修前/后附件:缩略图点开看大图(取不到就压暗并标注,不画破图)。 */
|
|
|
|
|
+.equipment-section__wo-attachments {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: flex-start;
|
|
|
|
|
+ gap: calc(8 * 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)); }
|
|
|
|
|
|