|
|
@@ -108,7 +108,16 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
-import { computed, inject, onBeforeUnmount, onMounted, ref, watch, type CSSProperties } from 'vue'
|
|
|
+import {
|
|
|
+ computed,
|
|
|
+ inject,
|
|
|
+ onBeforeUnmount,
|
|
|
+ onMounted,
|
|
|
+ ref,
|
|
|
+ watch,
|
|
|
+ type ComponentPublicInstance,
|
|
|
+ type CSSProperties
|
|
|
+} from 'vue'
|
|
|
import type { LocationResourceDataVO } from '../types'
|
|
|
import { applyWarehouseLayoutEnhancement } from './warehouse-layout-enhancers'
|
|
|
import {
|
|
|
@@ -360,11 +369,11 @@ const gridStyle = computed(() => {
|
|
|
const minY = gridBounds.value?.minY ?? 0
|
|
|
const rowHasLocation = Array.from({ length: gridMetrics.value.rows }, () => false)
|
|
|
const colHasLocation = Array.from({ length: gridMetrics.value.cols }, () => false)
|
|
|
- const isLocation = (cell: MapCell) => !('type' in cell)
|
|
|
+ const isLocation = (cell: MapCell): cell is GridCell => !('type' in cell)
|
|
|
for (const cell of gridData.value) {
|
|
|
if (!isLocation(cell)) continue
|
|
|
- const rowIndex = cell.gridRow - minX
|
|
|
- const colIndex = cell.gridCol - minY
|
|
|
+ const rowIndex = cell.parsed.gridRow - minX
|
|
|
+ const colIndex = cell.parsed.gridCol - minY
|
|
|
if (rowIndex >= 0 && rowIndex < rowHasLocation.length) rowHasLocation[rowIndex] = true
|
|
|
if (colIndex >= 0 && colIndex < colHasLocation.length) colHasLocation[colIndex] = true
|
|
|
}
|
|
|
@@ -701,8 +710,18 @@ const getCellStyle = (cell: MapCell): CSSProperties => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-const setCellRef = (el: Element | null, index: number) => {
|
|
|
- cellRefs.value[index] = el as HTMLElement | null
|
|
|
+const setCellRef = (el: Element | ComponentPublicInstance | null, index: number) => {
|
|
|
+ if (el instanceof HTMLElement || el === null) {
|
|
|
+ cellRefs.value[index] = el
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ if ('$el' in el) {
|
|
|
+ cellRefs.value[index] = el.$el instanceof HTMLElement ? el.$el : null
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ cellRefs.value[index] = null
|
|
|
}
|
|
|
|
|
|
const selectionPoints = computed(() => {
|