handy 1 месяц назад
Родитель
Сommit
dc7376bd20
1 измененных файлов с 21 добавлено и 3 удалено
  1. 21 3
      src/components/WarehouseMap.vue

+ 21 - 3
src/components/WarehouseMap.vue

@@ -72,7 +72,7 @@
             </div>
           </div>
           <div
-            v-else-if="isSpecialCell(cell) && cell.label"
+            v-else-if="isSpecialCell(cell) && cell.label && !shouldHideNonLocationCells"
             :class="['special-cell-label', `special-cell-label-${cell.type}`]"
           >
             {{ cell.label }}
@@ -450,6 +450,18 @@ const isCellVisible = (cell: GridCell) => {
   return isCellMatched(cell) && isCellInSelectedRange(cell)
 }
 
+const shouldHideNonLocationCells = computed(() => {
+  return (
+    Boolean(props.selectedCategory) ||
+    Boolean(props.selectedLocationAttribute) ||
+    Boolean(props.selectedHasContainer) ||
+    Boolean(props.selectedZoneId) ||
+    Boolean(props.locGroupKeyword.trim()) ||
+    Boolean(props.locationIdKeyword.trim()) ||
+    Boolean(selectedRange.value)
+  )
+})
+
 const isSpecialCell = (cell: MapCell): cell is WarehouseLayoutSpecialCell => {
   return Boolean(cell && 'type' in cell && cell.type !== 'aisle')
 }
@@ -460,11 +472,11 @@ const isLocationCell = (cell: MapCell): cell is GridCell => {
 
 const getCellClass = (cell: MapCell) => {
   if (isSpecialCell(cell)) {
-    return [cell.type]
+    return shouldHideNonLocationCells.value ? ['hidden-cell'] : [cell.type]
   }
 
   if (!isLocationCell(cell)) {
-    return ['aisle']
+    return shouldHideNonLocationCells.value ? ['hidden-cell'] : ['aisle']
   }
 
   if (!isCellVisible(cell)) {
@@ -841,6 +853,12 @@ onBeforeUnmount(() => {
   cursor: default;
 }
 
+.grid-cell.hidden-cell {
+  background: transparent;
+  cursor: default;
+  pointer-events: none;
+}
+
 .grid-cell.category-a {
   background: rgba(31, 122, 63, 0.18);
 }