| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- <!--
- 资产详情(公用组件):地下管线详情视图右侧「资产详情」页签的正文。
- 维护者 2026-11-12:设备详情从三维场景浮层改为右侧页签,避免遮挡 3D 区域;
- 同时设施详情与设备详情共用这一个容器,新增资产类型只需在
- `domain/assetDetail.js` 的适配器注册表登记一条,本组件无需改动。
- -->
- <template>
- <div class="asset-detail" data-asset-detail :data-asset-kind="view.kind">
- <template v-if="view.available">
- <header class="asset-detail__head">
- <strong class="asset-detail__title" data-asset-title>{{ view.title }}</strong>
- <slot name="actions" />
- </header>
- <p v-if="view.subtitle" class="asset-detail__subtitle">{{ view.subtitle }}</p>
- <slot />
- </template>
- <p v-else class="asset-detail__empty" data-asset-empty>
- 在左侧列表或三维场景中选择设施或设备,这里显示它的详情。
- </p>
- </div>
- </template>
- <script setup>
- import { computed } from 'vue'
- import { assetDetailView } from '../domain/assetDetail.js'
- const props = defineProps({
- /** 资产上下文:{ device?, facility? },由视图按当前选中对象组装。 */
- context: { type: Object, default: () => ({}) },
- })
- const view = computed(() => assetDetailView(props.context))
- </script>
- <style scoped>
- .asset-detail {
- display: flex;
- flex-direction: column;
- min-height: 0;
- gap: calc(6 * var(--u, 1px));
- }
- .asset-detail__head {
- display: flex;
- align-items: center;
- justify-content: space-between;
- gap: calc(8 * var(--u, 1px));
- min-width: 0;
- }
- .asset-detail__title {
- min-width: 0;
- overflow: hidden;
- color: var(--text-strong, #fff);
- font-size: var(--fs-body, 14px);
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- .asset-detail__subtitle {
- margin: 0;
- color: var(--muted, #5680b0);
- font-size: var(--fs-caption, 11.5px);
- line-height: 1.5;
- }
- .asset-detail__empty {
- margin: 0;
- padding: calc(12 * var(--u, 1px));
- color: var(--muted, #5680b0);
- font-size: var(--fs-caption, 11.5px);
- line-height: 1.6;
- }
- </style>
|