|
@@ -14,61 +14,61 @@
|
|
|
}"
|
|
|
:draggable="false"
|
|
|
/>
|
|
|
- <div class="furnitures">
|
|
|
- <furniture-icon
|
|
|
- v-for="item in filteredFurniture"
|
|
|
- :key="item.nanoid"
|
|
|
- :icon="item.type"
|
|
|
- :width="item.width"
|
|
|
- :height="item.length"
|
|
|
- :style="{
|
|
|
- left: `${item.left}px`,
|
|
|
- top: `${item.top}px`,
|
|
|
- position: 'absolute',
|
|
|
- rotate: `${item.rotate}deg`,
|
|
|
- cursor: 'default',
|
|
|
- }"
|
|
|
- :draggable="false"
|
|
|
- />
|
|
|
+ <div class="furnitures" :style="{ overflow: !!slots.furnitures ? 'visible' : 'hidden' }">
|
|
|
+ <slot name="furnitures">
|
|
|
+ <furniture-icon
|
|
|
+ v-for="item in filteredFurniture"
|
|
|
+ :key="item.nanoid"
|
|
|
+ :icon="item.type"
|
|
|
+ :width="item.width"
|
|
|
+ :height="item.length"
|
|
|
+ :style="{
|
|
|
+ left: `${item.left}px`,
|
|
|
+ top: `${item.top}px`,
|
|
|
+ position: 'absolute',
|
|
|
+ rotate: `${item.rotate}deg`,
|
|
|
+ cursor: 'default',
|
|
|
+ }"
|
|
|
+ :draggable="false"
|
|
|
+ />
|
|
|
+ </slot>
|
|
|
</div>
|
|
|
|
|
|
- <div class="targets">
|
|
|
- <template v-if="targets && Object.keys(targets).length > 0">
|
|
|
- <template v-for="t in targets" :key="t.id">
|
|
|
- <div
|
|
|
- class="target-dot"
|
|
|
- :style="{
|
|
|
- position: 'absolute',
|
|
|
- width: '18px',
|
|
|
- height: '18px',
|
|
|
- background: t.id === 0 ? 'red' : t.id === 1 ? 'blue' : 'green',
|
|
|
- borderRadius: '50%',
|
|
|
- transform: `translate3d(${t.displayX}px, ${-t.displayY!}px, 0) translate(-50%, -50%)`,
|
|
|
- zIndex: 10,
|
|
|
- transition: 'transform 1s linear',
|
|
|
- willChange: 'transform',
|
|
|
- }"
|
|
|
+ <div v-if="targets && Object.keys(targets).length > 0" class="targets">
|
|
|
+ <template v-for="t in targets" :key="t.id">
|
|
|
+ <div
|
|
|
+ class="target-dot"
|
|
|
+ :style="{
|
|
|
+ position: 'absolute',
|
|
|
+ width: '18px',
|
|
|
+ height: '18px',
|
|
|
+ background: t.id === 0 ? 'red' : t.id === 1 ? 'blue' : 'green',
|
|
|
+ borderRadius: '50%',
|
|
|
+ transform: `translate3d(${t.displayX}px, ${-t.displayY!}px, 0) translate(-50%, -50%)`,
|
|
|
+ zIndex: 10,
|
|
|
+ transition: 'transform 1s linear',
|
|
|
+ willChange: 'transform',
|
|
|
+ }"
|
|
|
+ >
|
|
|
+ <span
|
|
|
+ style="
|
|
|
+ color: #fff;
|
|
|
+ font-size: 12px;
|
|
|
+ font-weight: 600;
|
|
|
+ position: absolute;
|
|
|
+ left: 50%;
|
|
|
+ top: 50%;
|
|
|
+ transform: translate(-50%, -50%);
|
|
|
+ pointer-events: none;
|
|
|
+ "
|
|
|
>
|
|
|
- <span
|
|
|
- style="
|
|
|
- color: #fff;
|
|
|
- font-size: 12px;
|
|
|
- font-weight: 600;
|
|
|
- position: absolute;
|
|
|
- left: 50%;
|
|
|
- top: 50%;
|
|
|
- transform: translate(-50%, -50%);
|
|
|
- pointer-events: none;
|
|
|
- "
|
|
|
- >
|
|
|
- {{ t.id }}
|
|
|
- </span>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
+ {{ t.id }}
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
</div>
|
|
|
|
|
|
- <div class="content"><slot /></div>
|
|
|
+ <!-- <div class="content"><slot /></div> -->
|
|
|
|
|
|
<div v-if="showInfo" class="info-box">
|
|
|
检测区域:{{ areaWidth }} × {{ areaHeight }} cm<br />
|
|
@@ -100,11 +100,12 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
-import { computed, ref, type CSSProperties } from 'vue'
|
|
|
+import { computed, ref, type CSSProperties, useSlots } from 'vue'
|
|
|
import type { FurnitureItem, TargetPoint } from '@/types/radar'
|
|
|
import { QuestionCircleOutlined } from '@ant-design/icons-vue'
|
|
|
|
|
|
defineOptions({ name: 'RadarView' })
|
|
|
+const slots = useSlots()
|
|
|
|
|
|
interface Props {
|
|
|
coordinates: [number, number, number, number] // 坐标边界:[xStart, xEnd, yStart, yEnd]
|