handy 1 месяц назад
Родитель
Сommit
ec8b59c9d7
3 измененных файлов с 18 добавлено и 17 удалено
  1. 13 14
      src/App.vue
  2. 4 2
      src/components/LoginModal.vue
  3. 1 1
      src/components/WarehouseMap.vue

+ 13 - 14
src/App.vue

@@ -118,8 +118,8 @@
         </label>
         <label class="filter-item">
           <select
-            v-model="selectedCategory"
             ref="categorySelectRef"
+            v-model="selectedCategory"
             :class="['level-select', { 'level-select-placeholder': !selectedCategory }]"
             :style="{ width: selectWidths.category ? `${selectWidths.category}px` : 'auto' }"
           >
@@ -135,8 +135,8 @@
         </label>
         <label class="filter-item">
           <select
-            v-model="selectedLocationAttribute"
             ref="locationAttributeSelectRef"
+            v-model="selectedLocationAttribute"
             :class="['level-select', { 'level-select-placeholder': !selectedLocationAttribute }]"
             :style="{ width: selectWidths.attribute ? `${selectWidths.attribute}px` : 'auto' }"
           >
@@ -152,8 +152,8 @@
         </label>
         <label class="filter-item">
           <select
-            v-model="selectedHasContainer"
             ref="hasContainerSelectRef"
+            v-model="selectedHasContainer"
             :class="['level-select', { 'level-select-placeholder': !selectedHasContainer }]"
             :style="{ width: selectWidths.container ? `${selectWidths.container}px` : 'auto' }"
           >
@@ -164,8 +164,8 @@
         </label>
         <label class="filter-item">
           <select
-            v-model="selectedZoneId"
             ref="zoneSelectRef"
+            v-model="selectedZoneId"
             :class="['level-select', { 'level-select-placeholder': !selectedZoneId }]"
             :style="{ width: selectWidths.zone ? `${selectWidths.zone}px` : 'auto' }"
           >
@@ -180,9 +180,9 @@
           </select>
         </label>
         <select
+          ref="levelSelectRef"
           v-model.number="currentLevel"
           class="level-select level-select-floor"
-          ref="levelSelectRef"
           :style="{ width: selectWidths.level ? `${selectWidths.level}px` : 'auto' }"
           @change="handleLevelChange"
         >
@@ -588,7 +588,9 @@ const getLocationAttributeLabel = (attribute: LocationAttributeCode) => {
 
 const categoryLabel = computed(() => selectedCategory.value || '热度')
 const locationAttributeLabel = computed(() =>
-  selectedLocationAttribute.value ? getLocationAttributeLabel(selectedLocationAttribute.value) : '状态'
+  selectedLocationAttribute.value
+    ? getLocationAttributeLabel(selectedLocationAttribute.value)
+    : '状态'
 )
 const hasContainerLabel = computed(() => {
   if (selectedHasContainer.value === 'Y') return '有'
@@ -932,14 +934,11 @@ watch(isLightTheme, (isLight) => {
   window.localStorage.setItem(THEME_STORAGE_KEY, isLight ? 'light' : 'dark')
 })
 
-watch(
-  [categoryLabel, locationAttributeLabel, hasContainerLabel, zoneLabel, levelLabel],
-  () => {
-    nextTick(() => {
-      updateSelectWidths()
-    })
-  }
-)
+watch([categoryLabel, locationAttributeLabel, hasContainerLabel, zoneLabel, levelLabel], () => {
+  nextTick(() => {
+    updateSelectWidths()
+  })
+})
 
 onBeforeUnmount(() => {
   if (refreshTimer !== null) {

+ 4 - 2
src/components/LoginModal.vue

@@ -116,8 +116,8 @@
               type="button"
               class="btn-token"
               :disabled="loading"
-              @click="openTokenModal"
               title="使用 Token 登录"
+              @click="openTokenModal"
             >
               <svg
                 viewBox="0 0 24 24"
@@ -138,7 +138,9 @@
           @click.self="closeTokenModal"
         >
           <div class="token-modal">
-            <div class="token-modal-header">Token 登录</div>
+            <div class="token-modal-header">
+              Token 登录
+            </div>
             <div
               v-if="tokenError"
               class="error-message"

+ 1 - 1
src/components/WarehouseMap.vue

@@ -18,9 +18,9 @@
         <div
           v-for="(cell, index) in gridData"
           :key="index"
+          :ref="(el) => setCellRef(el, index)"
           :class="['grid-cell', getCellClass(cell)]"
           :style="getCellStyle(cell)"
-          :ref="(el) => setCellRef(el, index)"
           @mousedown.left="handleCellMouseDown(index, $event)"
           @mouseenter="handleCellMouseEnter(cell, index, $event)"
           @mousemove="handleCellMouseMove($event)"