|
@@ -103,7 +103,7 @@
|
|
>
|
|
>
|
|
<a-button size="small" type="link">清空</a-button>
|
|
<a-button size="small" type="link">清空</a-button>
|
|
</a-popconfirm>
|
|
</a-popconfirm>
|
|
- <a-button size="small" type="link" @click="modeRadio = 1">添加</a-button>
|
|
|
|
|
|
+ <!-- <a-button size="small" type="link" @click="modeRadio = 1">添加</a-button> -->
|
|
</a-space>
|
|
</a-space>
|
|
</div>
|
|
</div>
|
|
<div class="panel-ct">
|
|
<div class="panel-ct">
|
|
@@ -373,7 +373,7 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
-import { ref, computed, onUnmounted, reactive } from 'vue'
|
|
|
|
|
|
+import { ref, computed, onUnmounted, reactive, h } from 'vue'
|
|
import DetectionAreaView from '../DetectionAreaView/index.vue'
|
|
import DetectionAreaView from '../DetectionAreaView/index.vue'
|
|
import EditableFurniture from '../EditableFurniture/index.vue'
|
|
import EditableFurniture from '../EditableFurniture/index.vue'
|
|
import EditableSubregion from '../EditableSubregion/index.vue'
|
|
import EditableSubregion from '../EditableSubregion/index.vue'
|
|
@@ -427,17 +427,16 @@ const inputStyle = computed(() => ({ width: '70px' }))
|
|
// }
|
|
// }
|
|
|
|
|
|
function deleteFurniture(nanoid: string) {
|
|
function deleteFurniture(nanoid: string) {
|
|
|
|
+ const hasBed = roomStore.localFurnitureItems.some((i) => i.nanoid === nanoid && i.type === 'bed')
|
|
|
|
+ if (hasBed && roomStore.localSubRegions.length) {
|
|
|
|
+ roomStore.localSubRegions = roomStore.localSubRegions.map((region) => ({
|
|
|
|
+ ...region,
|
|
|
|
+ isBed: false,
|
|
|
|
+ }))
|
|
|
|
+ }
|
|
roomStore.localFurnitureItems = roomStore.localFurnitureItems.filter((i) => i.nanoid !== nanoid)
|
|
roomStore.localFurnitureItems = roomStore.localFurnitureItems.filter((i) => i.nanoid !== nanoid)
|
|
}
|
|
}
|
|
|
|
|
|
-// function addFurniture(item: FurnitureItem) {
|
|
|
|
-// // localFurniture.value.push(item)
|
|
|
|
-// roomStore.localFurnitureItems.push(item)
|
|
|
|
-// // emit('update:furnitureItems', [...roomStore.localFurnitureItems])
|
|
|
|
-// }
|
|
|
|
-
|
|
|
|
-// defineExpose({ addFurniture })
|
|
|
|
-
|
|
|
|
const modeRadio = ref<1 | 2 | 3>(1)
|
|
const modeRadio = ref<1 | 2 | 3>(1)
|
|
const sideRadio = ref<1 | 2 | 3 | 4>(1)
|
|
const sideRadio = ref<1 | 2 | 3 | 4>(1)
|
|
const editableSubregionRef = ref<InstanceType<typeof EditableSubregion>>()
|
|
const editableSubregionRef = ref<InstanceType<typeof EditableSubregion>>()
|
|
@@ -488,8 +487,6 @@ const add = (icon: FurnitureIconType) => {
|
|
type: icon,
|
|
type: icon,
|
|
width: originWidth,
|
|
width: originWidth,
|
|
length: originHeight,
|
|
length: originHeight,
|
|
- // top: 0,
|
|
|
|
- // left: 0,
|
|
|
|
rotate: 0,
|
|
rotate: 0,
|
|
x: 0,
|
|
x: 0,
|
|
y: 0,
|
|
y: 0,
|
|
@@ -497,6 +494,37 @@ const add = (icon: FurnitureIconType) => {
|
|
}
|
|
}
|
|
|
|
|
|
roomStore.localFurnitureItems.push(newItem)
|
|
roomStore.localFurnitureItems.push(newItem)
|
|
|
|
+ if (icon === 'bed') {
|
|
|
|
+ if (roomStore.localSubRegions.length) {
|
|
|
|
+ roomStore.localSubRegions[0].isBed = true
|
|
|
|
+ } else {
|
|
|
|
+ roomStore.localSubRegions.push({
|
|
|
|
+ nanoid: nanoid(),
|
|
|
|
+ startXx: 0,
|
|
|
|
+ stopXx: 0,
|
|
|
|
+ startYy: 0,
|
|
|
|
+ stopYy: 0,
|
|
|
|
+ startZz: 0,
|
|
|
|
+ stopZz: 0,
|
|
|
|
+ isLowSnr: 0,
|
|
|
|
+ isDoor: 0,
|
|
|
|
+ presenceEnterDuration: 0,
|
|
|
|
+ presenceExitDuration: 0,
|
|
|
|
+ trackPresence: 0,
|
|
|
|
+ excludeFalling: 0,
|
|
|
|
+ isDraging: false,
|
|
|
|
+ isResizing: false,
|
|
|
|
+ isActive: false,
|
|
|
|
+ isTracking: false,
|
|
|
|
+ isFalling: false,
|
|
|
|
+ pixelX: 0,
|
|
|
|
+ pixelY: 0,
|
|
|
|
+ pixelWidth: 0,
|
|
|
|
+ pixelHeight: 0,
|
|
|
|
+ isBed: true,
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ }
|
|
// message.success('已添加家具')
|
|
// message.success('已添加家具')
|
|
}
|
|
}
|
|
|
|
|