|
|
@@ -25,7 +25,7 @@
|
|
|
<section v-if="showPeople && view.people.length" class="entity-sections__group"><h3>相关人员</h3><ul><li v-for="item in view.people" :key="item.role"><span>{{ item.role }}</span><b>{{ item.name }}</b></li></ul></section>
|
|
|
<section v-if="showDevices && view.devices.length" class="entity-sections__group"><h3>设备信息</h3><ul><li v-for="item in view.devices" :key="item.code || item.name"><b>{{ item.name }}</b><span>{{ item.code }} · {{ item.status }}</span><small>{{ item.type || item.location }}</small><button v-if="item.code" type="button" class="entity-sections__locate" :data-locate-device="item.code" @click.stop="locateDevice(item.code)">定位 {{ item.code }}</button></li></ul></section>
|
|
|
<section v-if="showRecords && view.records.length" class="entity-sections__group"><h3>处置记录</h3><ol class="entity-sections__records"><li v-for="(item,index) in view.records" :key="index"><b>{{ item.title }}</b><time>{{ item.time }}</time><span>{{ item.operator }}</span><p>{{ item.description }}</p></li></ol></section>
|
|
|
- <section v-if="showAttachments" class="entity-sections__group"><h3>附件</h3><p v-if="!view.attachments.length">暂无附件</p><ul v-else><li v-for="(item,index) in view.attachments" :key="index"><a v-if="item.url" :href="item.url" target="_blank" rel="noopener">{{ item.name }}</a><span v-else>{{ item.name }}</span></li></ul></section>
|
|
|
+ <section v-if="showAttachments" class="entity-sections__group"><h3>附件</h3><p v-if="!view.attachments.length">暂无附件</p><ul v-else><li v-for="(item,index) in view.attachments" :key="index"><a v-if="item.url" :href="attachmentUrl(item.url)" target="_blank" rel="noopener">{{ item.name }}</a><span v-else>{{ item.name }}</span></li></ul></section>
|
|
|
<section v-if="showRelated" class="entity-sections__group"><h3>关联信息</h3><p v-if="!view.devices.length">暂无关联设备数据</p><ul v-else><li v-for="item in view.devices" :key="item.code || item.name"><b>{{ item.name }}</b><span>{{ item.code }} · {{ item.status }}</span><small>{{ item.type || item.location }}</small><button v-if="item.code" type="button" class="entity-sections__locate" :data-locate-device="item.code" @click.stop="locateDevice(item.code)">定位 {{ item.code }}</button></li></ul></section>
|
|
|
<section v-if="showAlarms" class="entity-sections__group"><h3>关联报警</h3><p v-if="!view.relatedAlarms.length">暂无关联报警</p><ul v-else><li v-for="item in view.relatedAlarms" :key="item.code"><b>{{ item.name }}</b><span>{{ item.code }} · {{ item.status }}</span></li></ul></section>
|
|
|
<section v-if="showFlow && view.track" class="entity-sections__group"><h3>处置轨迹</h3><WorkOrderTimeline :track="view.track" /></section>
|
|
|
@@ -35,9 +35,12 @@
|
|
|
import { computed, ref, watch } from 'vue'
|
|
|
import { entityDetailView } from '../domain/entityDetail.js'
|
|
|
import WorkOrderTimeline from './WorkOrderTimeline.vue'
|
|
|
+import { resolveDeviceImageUrl } from '../services/deviceImage.js'
|
|
|
const props = defineProps({ detail: { type: Object, default: null }, presentation: { type: String, default: 'entity' } })
|
|
|
const emit = defineEmits(['locate-device'])
|
|
|
const view = computed(() => entityDetailView(props.detail))
|
|
|
+// 维修附件可能是对象存储相对路径,走统一前缀拼接才能点开看(与设备图片同口径)。
|
|
|
+function attachmentUrl(url) { return resolveDeviceImageUrl(url) || url }
|
|
|
const activeTab = ref('')
|
|
|
const tabs = computed(() => view.value.tabs || [])
|
|
|
watch(() => props.detail && (props.detail.kind + '|' + props.detail.id), () => { activeTab.value = (tabs.value[0] && tabs.value[0].key) || '' }, { immediate: true })
|