Kaynağa Gözat

admin-mp字典功能优化

skyline 1 hafta önce
ebeveyn
işleme
98cfb80d5f

+ 402 - 0
admin-mp/package-lock.json

@@ -34,6 +34,7 @@
         "@dcloudio/uni-stacktracey": "3.0.0-alpha-5000020260104004",
         "@dcloudio/vite-plugin-uni": "3.0.0-alpha-5000020260104004",
         "@vue/compiler-sfc": "^3.4.21",
+        "sass": "^1.99.0",
         "vite": "5.2.8",
         "vue-tsc": "^1.0.24"
       }
@@ -4688,6 +4689,330 @@
         "node": ">= 8"
       }
     },
+    "node_modules/@parcel/watcher": {
+      "version": "2.5.6",
+      "resolved": "https://registry.npmmirror.com/@parcel/watcher/-/watcher-2.5.6.tgz",
+      "integrity": "sha512-tmmZ3lQxAe/k/+rNnXQRawJ4NjxO2hqiOLTHvWchtGZULp4RyFeh6aU4XdOYBFe2KE1oShQTv4AblOs2iOrNnQ==",
+      "dev": true,
+      "hasInstallScript": true,
+      "license": "MIT",
+      "optional": true,
+      "dependencies": {
+        "detect-libc": "^2.0.3",
+        "is-glob": "^4.0.3",
+        "node-addon-api": "^7.0.0",
+        "picomatch": "^4.0.3"
+      },
+      "engines": {
+        "node": ">= 10.0.0"
+      },
+      "funding": {
+        "type": "opencollective",
+        "url": "https://opencollective.com/parcel"
+      },
+      "optionalDependencies": {
+        "@parcel/watcher-android-arm64": "2.5.6",
+        "@parcel/watcher-darwin-arm64": "2.5.6",
+        "@parcel/watcher-darwin-x64": "2.5.6",
+        "@parcel/watcher-freebsd-x64": "2.5.6",
+        "@parcel/watcher-linux-arm-glibc": "2.5.6",
+        "@parcel/watcher-linux-arm-musl": "2.5.6",
+        "@parcel/watcher-linux-arm64-glibc": "2.5.6",
+        "@parcel/watcher-linux-arm64-musl": "2.5.6",
+        "@parcel/watcher-linux-x64-glibc": "2.5.6",
+        "@parcel/watcher-linux-x64-musl": "2.5.6",
+        "@parcel/watcher-win32-arm64": "2.5.6",
+        "@parcel/watcher-win32-ia32": "2.5.6",
+        "@parcel/watcher-win32-x64": "2.5.6"
+      }
+    },
+    "node_modules/@parcel/watcher-android-arm64": {
+      "version": "2.5.6",
+      "resolved": "https://registry.npmmirror.com/@parcel/watcher-android-arm64/-/watcher-android-arm64-2.5.6.tgz",
+      "integrity": "sha512-YQxSS34tPF/6ZG7r/Ih9xy+kP/WwediEUsqmtf0cuCV5TPPKw/PQHRhueUo6JdeFJaqV3pyjm0GdYjZotbRt/A==",
+      "cpu": [
+        "arm64"
+      ],
+      "dev": true,
+      "license": "MIT",
+      "optional": true,
+      "os": [
+        "android"
+      ],
+      "engines": {
+        "node": ">= 10.0.0"
+      },
+      "funding": {
+        "type": "opencollective",
+        "url": "https://opencollective.com/parcel"
+      }
+    },
+    "node_modules/@parcel/watcher-darwin-arm64": {
+      "version": "2.5.6",
+      "resolved": "https://registry.npmmirror.com/@parcel/watcher-darwin-arm64/-/watcher-darwin-arm64-2.5.6.tgz",
+      "integrity": "sha512-Z2ZdrnwyXvvvdtRHLmM4knydIdU9adO3D4n/0cVipF3rRiwP+3/sfzpAwA/qKFL6i1ModaabkU7IbpeMBgiVEA==",
+      "cpu": [
+        "arm64"
+      ],
+      "dev": true,
+      "license": "MIT",
+      "optional": true,
+      "os": [
+        "darwin"
+      ],
+      "engines": {
+        "node": ">= 10.0.0"
+      },
+      "funding": {
+        "type": "opencollective",
+        "url": "https://opencollective.com/parcel"
+      }
+    },
+    "node_modules/@parcel/watcher-darwin-x64": {
+      "version": "2.5.6",
+      "resolved": "https://registry.npmmirror.com/@parcel/watcher-darwin-x64/-/watcher-darwin-x64-2.5.6.tgz",
+      "integrity": "sha512-HgvOf3W9dhithcwOWX9uDZyn1lW9R+7tPZ4sug+NGrGIo4Rk1hAXLEbcH1TQSqxts0NYXXlOWqVpvS1SFS4fRg==",
+      "cpu": [
+        "x64"
+      ],
+      "dev": true,
+      "license": "MIT",
+      "optional": true,
+      "os": [
+        "darwin"
+      ],
+      "engines": {
+        "node": ">= 10.0.0"
+      },
+      "funding": {
+        "type": "opencollective",
+        "url": "https://opencollective.com/parcel"
+      }
+    },
+    "node_modules/@parcel/watcher-freebsd-x64": {
+      "version": "2.5.6",
+      "resolved": "https://registry.npmmirror.com/@parcel/watcher-freebsd-x64/-/watcher-freebsd-x64-2.5.6.tgz",
+      "integrity": "sha512-vJVi8yd/qzJxEKHkeemh7w3YAn6RJCtYlE4HPMoVnCpIXEzSrxErBW5SJBgKLbXU3WdIpkjBTeUNtyBVn8TRng==",
+      "cpu": [
+        "x64"
+      ],
+      "dev": true,
+      "license": "MIT",
+      "optional": true,
+      "os": [
+        "freebsd"
+      ],
+      "engines": {
+        "node": ">= 10.0.0"
+      },
+      "funding": {
+        "type": "opencollective",
+        "url": "https://opencollective.com/parcel"
+      }
+    },
+    "node_modules/@parcel/watcher-linux-arm-glibc": {
+      "version": "2.5.6",
+      "resolved": "https://registry.npmmirror.com/@parcel/watcher-linux-arm-glibc/-/watcher-linux-arm-glibc-2.5.6.tgz",
+      "integrity": "sha512-9JiYfB6h6BgV50CCfasfLf/uvOcJskMSwcdH1PHH9rvS1IrNy8zad6IUVPVUfmXr+u+Km9IxcfMLzgdOudz9EQ==",
+      "cpu": [
+        "arm"
+      ],
+      "dev": true,
+      "license": "MIT",
+      "optional": true,
+      "os": [
+        "linux"
+      ],
+      "engines": {
+        "node": ">= 10.0.0"
+      },
+      "funding": {
+        "type": "opencollective",
+        "url": "https://opencollective.com/parcel"
+      }
+    },
+    "node_modules/@parcel/watcher-linux-arm-musl": {
+      "version": "2.5.6",
+      "resolved": "https://registry.npmmirror.com/@parcel/watcher-linux-arm-musl/-/watcher-linux-arm-musl-2.5.6.tgz",
+      "integrity": "sha512-Ve3gUCG57nuUUSyjBq/MAM0CzArtuIOxsBdQ+ftz6ho8n7s1i9E1Nmk/xmP323r2YL0SONs1EuwqBp2u1k5fxg==",
+      "cpu": [
+        "arm"
+      ],
+      "dev": true,
+      "license": "MIT",
+      "optional": true,
+      "os": [
+        "linux"
+      ],
+      "engines": {
+        "node": ">= 10.0.0"
+      },
+      "funding": {
+        "type": "opencollective",
+        "url": "https://opencollective.com/parcel"
+      }
+    },
+    "node_modules/@parcel/watcher-linux-arm64-glibc": {
+      "version": "2.5.6",
+      "resolved": "https://registry.npmmirror.com/@parcel/watcher-linux-arm64-glibc/-/watcher-linux-arm64-glibc-2.5.6.tgz",
+      "integrity": "sha512-f2g/DT3NhGPdBmMWYoxixqYr3v/UXcmLOYy16Bx0TM20Tchduwr4EaCbmxh1321TABqPGDpS8D/ggOTaljijOA==",
+      "cpu": [
+        "arm64"
+      ],
+      "dev": true,
+      "license": "MIT",
+      "optional": true,
+      "os": [
+        "linux"
+      ],
+      "engines": {
+        "node": ">= 10.0.0"
+      },
+      "funding": {
+        "type": "opencollective",
+        "url": "https://opencollective.com/parcel"
+      }
+    },
+    "node_modules/@parcel/watcher-linux-arm64-musl": {
+      "version": "2.5.6",
+      "resolved": "https://registry.npmmirror.com/@parcel/watcher-linux-arm64-musl/-/watcher-linux-arm64-musl-2.5.6.tgz",
+      "integrity": "sha512-qb6naMDGlbCwdhLj6hgoVKJl2odL34z2sqkC7Z6kzir8b5W65WYDpLB6R06KabvZdgoHI/zxke4b3zR0wAbDTA==",
+      "cpu": [
+        "arm64"
+      ],
+      "dev": true,
+      "license": "MIT",
+      "optional": true,
+      "os": [
+        "linux"
+      ],
+      "engines": {
+        "node": ">= 10.0.0"
+      },
+      "funding": {
+        "type": "opencollective",
+        "url": "https://opencollective.com/parcel"
+      }
+    },
+    "node_modules/@parcel/watcher-linux-x64-glibc": {
+      "version": "2.5.6",
+      "resolved": "https://registry.npmmirror.com/@parcel/watcher-linux-x64-glibc/-/watcher-linux-x64-glibc-2.5.6.tgz",
+      "integrity": "sha512-kbT5wvNQlx7NaGjzPFu8nVIW1rWqV780O7ZtkjuWaPUgpv2NMFpjYERVi0UYj1msZNyCzGlaCWEtzc+exjMGbQ==",
+      "cpu": [
+        "x64"
+      ],
+      "dev": true,
+      "license": "MIT",
+      "optional": true,
+      "os": [
+        "linux"
+      ],
+      "engines": {
+        "node": ">= 10.0.0"
+      },
+      "funding": {
+        "type": "opencollective",
+        "url": "https://opencollective.com/parcel"
+      }
+    },
+    "node_modules/@parcel/watcher-linux-x64-musl": {
+      "version": "2.5.6",
+      "resolved": "https://registry.npmmirror.com/@parcel/watcher-linux-x64-musl/-/watcher-linux-x64-musl-2.5.6.tgz",
+      "integrity": "sha512-1JRFeC+h7RdXwldHzTsmdtYR/Ku8SylLgTU/reMuqdVD7CtLwf0VR1FqeprZ0eHQkO0vqsbvFLXUmYm/uNKJBg==",
+      "cpu": [
+        "x64"
+      ],
+      "dev": true,
+      "license": "MIT",
+      "optional": true,
+      "os": [
+        "linux"
+      ],
+      "engines": {
+        "node": ">= 10.0.0"
+      },
+      "funding": {
+        "type": "opencollective",
+        "url": "https://opencollective.com/parcel"
+      }
+    },
+    "node_modules/@parcel/watcher-win32-arm64": {
+      "version": "2.5.6",
+      "resolved": "https://registry.npmmirror.com/@parcel/watcher-win32-arm64/-/watcher-win32-arm64-2.5.6.tgz",
+      "integrity": "sha512-3ukyebjc6eGlw9yRt678DxVF7rjXatWiHvTXqphZLvo7aC5NdEgFufVwjFfY51ijYEWpXbqF5jtrK275z52D4Q==",
+      "cpu": [
+        "arm64"
+      ],
+      "dev": true,
+      "license": "MIT",
+      "optional": true,
+      "os": [
+        "win32"
+      ],
+      "engines": {
+        "node": ">= 10.0.0"
+      },
+      "funding": {
+        "type": "opencollective",
+        "url": "https://opencollective.com/parcel"
+      }
+    },
+    "node_modules/@parcel/watcher-win32-ia32": {
+      "version": "2.5.6",
+      "resolved": "https://registry.npmmirror.com/@parcel/watcher-win32-ia32/-/watcher-win32-ia32-2.5.6.tgz",
+      "integrity": "sha512-k35yLp1ZMwwee3Ez/pxBi5cf4AoBKYXj00CZ80jUz5h8prpiaQsiRPKQMxoLstNuqe2vR4RNPEAEcjEFzhEz/g==",
+      "cpu": [
+        "ia32"
+      ],
+      "dev": true,
+      "license": "MIT",
+      "optional": true,
+      "os": [
+        "win32"
+      ],
+      "engines": {
+        "node": ">= 10.0.0"
+      },
+      "funding": {
+        "type": "opencollective",
+        "url": "https://opencollective.com/parcel"
+      }
+    },
+    "node_modules/@parcel/watcher-win32-x64": {
+      "version": "2.5.6",
+      "resolved": "https://registry.npmmirror.com/@parcel/watcher-win32-x64/-/watcher-win32-x64-2.5.6.tgz",
+      "integrity": "sha512-hbQlYcCq5dlAX9Qx+kFb0FHue6vbjlf0FrNzSKdYK2APUf7tGfGxQCk2ihEREmbR6ZMc0MVAD5RIX/41gpUzTw==",
+      "cpu": [
+        "x64"
+      ],
+      "dev": true,
+      "license": "MIT",
+      "optional": true,
+      "os": [
+        "win32"
+      ],
+      "engines": {
+        "node": ">= 10.0.0"
+      },
+      "funding": {
+        "type": "opencollective",
+        "url": "https://opencollective.com/parcel"
+      }
+    },
+    "node_modules/@parcel/watcher/node_modules/picomatch": {
+      "version": "4.0.4",
+      "resolved": "https://registry.npmmirror.com/picomatch/-/picomatch-4.0.4.tgz",
+      "integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==",
+      "dev": true,
+      "license": "MIT",
+      "optional": true,
+      "engines": {
+        "node": ">=12"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/jonschlinkert"
+      }
+    },
     "node_modules/@rollup/pluginutils": {
       "version": "5.1.0",
       "resolved": "https://registry.npmmirror.com/@rollup/pluginutils/-/pluginutils-5.1.0.tgz",
@@ -6999,6 +7324,17 @@
         "npm": "1.2.8000 || >= 1.4.16"
       }
     },
+    "node_modules/detect-libc": {
+      "version": "2.1.2",
+      "resolved": "https://registry.npmmirror.com/detect-libc/-/detect-libc-2.1.2.tgz",
+      "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==",
+      "dev": true,
+      "license": "Apache-2.0",
+      "optional": true,
+      "engines": {
+        "node": ">=8"
+      }
+    },
     "node_modules/detect-newline": {
       "version": "3.1.0",
       "resolved": "https://registry.npmmirror.com/detect-newline/-/detect-newline-3.1.0.tgz",
@@ -8047,6 +8383,13 @@
       ],
       "license": "BSD-3-Clause"
     },
+    "node_modules/immutable": {
+      "version": "5.1.5",
+      "resolved": "https://registry.npmmirror.com/immutable/-/immutable-5.1.5.tgz",
+      "integrity": "sha512-t7xcm2siw+hlUM68I+UEOK+z84RzmN59as9DZ7P1l0994DKUWV7UXBMQZVxaoMSRQ+PBZbHCOoBt7a2wxOMt+A==",
+      "devOptional": true,
+      "license": "MIT"
+    },
     "node_modules/import-local": {
       "version": "3.2.0",
       "resolved": "https://registry.npmmirror.com/import-local/-/import-local-3.2.0.tgz",
@@ -10957,6 +11300,14 @@
         "node": ">= 0.6"
       }
     },
+    "node_modules/node-addon-api": {
+      "version": "7.1.1",
+      "resolved": "https://registry.npmmirror.com/node-addon-api/-/node-addon-api-7.1.1.tgz",
+      "integrity": "sha512-5m3bsyrjFWE1xf7nz7YXdN4udnVtXK6/Yfgn5qnahL6bCkf2yKt4k3nuTKAtT4r3IG8JNR2ncsIMdZuAzJjHQQ==",
+      "dev": true,
+      "license": "MIT",
+      "optional": true
+    },
     "node_modules/node-int64": {
       "version": "0.4.0",
       "resolved": "https://registry.npmmirror.com/node-int64/-/node-int64-0.4.0.tgz",
@@ -12059,6 +12410,57 @@
       "dev": true,
       "license": "MIT"
     },
+    "node_modules/sass": {
+      "version": "1.99.0",
+      "resolved": "https://registry.npmmirror.com/sass/-/sass-1.99.0.tgz",
+      "integrity": "sha512-kgW13M54DUB7IsIRM5LvJkNlpH+WhMpooUcaWGFARkF1Tc82v9mIWkCbCYf+MBvpIUBSeSOTilpZjEPr2VYE6Q==",
+      "devOptional": true,
+      "license": "MIT",
+      "dependencies": {
+        "chokidar": "^4.0.0",
+        "immutable": "^5.1.5",
+        "source-map-js": ">=0.6.2 <2.0.0"
+      },
+      "bin": {
+        "sass": "sass.js"
+      },
+      "engines": {
+        "node": ">=14.0.0"
+      },
+      "optionalDependencies": {
+        "@parcel/watcher": "^2.4.1"
+      }
+    },
+    "node_modules/sass/node_modules/chokidar": {
+      "version": "4.0.3",
+      "resolved": "https://registry.npmmirror.com/chokidar/-/chokidar-4.0.3.tgz",
+      "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==",
+      "devOptional": true,
+      "license": "MIT",
+      "dependencies": {
+        "readdirp": "^4.0.1"
+      },
+      "engines": {
+        "node": ">= 14.16.0"
+      },
+      "funding": {
+        "url": "https://paulmillr.com/funding/"
+      }
+    },
+    "node_modules/sass/node_modules/readdirp": {
+      "version": "4.1.2",
+      "resolved": "https://registry.npmmirror.com/readdirp/-/readdirp-4.1.2.tgz",
+      "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==",
+      "devOptional": true,
+      "license": "MIT",
+      "engines": {
+        "node": ">= 14.18.0"
+      },
+      "funding": {
+        "type": "individual",
+        "url": "https://paulmillr.com/funding/"
+      }
+    },
     "node_modules/sax": {
       "version": "1.4.4",
       "resolved": "https://registry.npmmirror.com/sax/-/sax-1.4.4.tgz",

+ 1 - 0
admin-mp/package.json

@@ -35,6 +35,7 @@
     "@dcloudio/uni-stacktracey": "3.0.0-alpha-5000020260104004",
     "@dcloudio/vite-plugin-uni": "3.0.0-alpha-5000020260104004",
     "@vue/compiler-sfc": "^3.4.21",
+    "sass": "^1.99.0",
     "vite": "5.2.8",
     "vue-tsc": "^1.0.24"
   },

+ 15 - 8
admin-mp/src/custom-tab-bar/index.vue

@@ -22,7 +22,14 @@
 </template>
 
 <script setup>
-import { ref, onMounted } from 'vue'
+import { ref, watch, onMounted } from 'vue'
+
+const props = defineProps({
+  selected: {
+    type: Number,
+    default: 0
+  }
+})
 
 const activeColor = '#C6171E'
 const inactiveColor = '#999999'
@@ -34,22 +41,22 @@ const tabs = [
   { pagePath: '/pages/finance/index', text: '财务', icon: 'dollar' },
 ]
 
-const current = ref(0)
+const current = ref(props.selected)
+
+watch(() => props.selected, (val) => {
+  current.value = val
+})
 
-const syncCurrent = () => {
+onMounted(() => {
   const pages = getCurrentPages()
   if (pages.length > 0) {
     const route = '/' + pages[pages.length - 1].route
     const idx = tabs.findIndex(t => t.pagePath === route)
     if (idx !== -1) current.value = idx
   }
-}
-
-onMounted(() => syncCurrent())
+})
 
 const switchTab = (tab) => {
-  const index = tabs.findIndex(t => t.pagePath === tab.pagePath)
-  if (index !== -1) current.value = index
   uni.switchTab({ url: tab.pagePath })
 }
 </script>

+ 3 - 2
admin-mp/src/pages/device/detail.vue

@@ -104,7 +104,7 @@
 import { ref, onMounted, computed } from 'vue'
 import { getDeviceDetail, stopDevice } from '../../api/device.js'
 import { formatTime, showToast, fmtDictName, getDictColor } from '../../utils/index.js'
-import dictUtil from '../../utils/dict.js'
+import dictUtil, { loadDicts } from '../../utils/dict.js'
 
 const deviceId = ref('')
 const deviceDetail = ref({})
@@ -192,7 +192,8 @@ const goBack = () => {
   uni.navigateBack()
 }
 
-onMounted(() => {
+onMounted(async () => {
+  await loadDicts()
   const pages = getCurrentPages()
   const currentPage = pages[pages.length - 1]
   const receivedDeviceId = currentPage.options.id || ''

+ 3 - 4
admin-mp/src/pages/device/list.vue

@@ -118,16 +118,14 @@
       <text class="loading-text">加载中...</text>
     </view>
 
-    <custom-tab-bar />
   </view>
 </template>
 
 <script setup>
 import { ref, onMounted, computed } from 'vue'
-import CustomTabBar from '../../custom-tab-bar/index.vue'
 import { getDeviceList, stopDevice, getDeviceConfigList, batchModifyDeviceConfig } from '../../api/device.js'
 import { showToast, fmtDictName, getDictColor } from '../../utils/index.js'
-import dictUtil from '../../utils/dict.js'
+import dictUtil, { loadDicts } from '../../utils/dict.js'
 
 const deviceList = ref([])
 const loading = ref(true)
@@ -144,7 +142,8 @@ const loadingConfig = ref(false)
 
 const filterOptions = computed(() => dictUtil.getDictFilterOptions('WashDevice.status'))
 
-onMounted(() => {
+onMounted(async () => {
+  await loadDicts()
   loadDeviceList()
 })
 

+ 3 - 3
admin-mp/src/pages/finance/index.vue

@@ -154,16 +154,15 @@
       <view class="loading-spinner"></view>
     </view>
 
-    <custom-tab-bar />
   </view>
 </template>
 
 <script setup>
 import { ref, onMounted } from 'vue'
-import CustomTabBar from '../../custom-tab-bar/index.vue'
 import { getStationAccounts, getSplitRecords } from '../../api/finance.js'
 import { getDashboardData } from '../../api/stat.js'
 import { formatTime, showToast, formatAmount, storage, fmtDictName, getDictColor } from '../../utils/index.js'
+import { loadDicts } from '../../utils/dict.js'
 
 const activeTab = ref(0)
 const tabOptions = ['站点账户', '分账记录']
@@ -183,7 +182,8 @@ const tabOptions = ['站点账户', '分账记录']
 const stationAccounts = ref([])
 const splitRecords = ref([])
 
-onMounted(() => {
+onMounted(async () => {
+  await loadDicts()
   loadFinanceData()
   loadStationAccounts()
   loadSplitRecords()

+ 3 - 2
admin-mp/src/pages/finance/refund.vue

@@ -102,7 +102,7 @@
 import { ref, onMounted, computed } from 'vue'
 import { getRefundLogs, processRefund } from '../../api/finance.js'
 import { formatTime, showToast, formatAmount, fmtDictName, getDictColor } from '../../utils/index.js'
-import dictUtil from '../../utils/dict.js'
+import dictUtil, { loadDicts } from '../../utils/dict.js'
 
 const list = ref([])
 const loading = ref(true)
@@ -206,7 +206,8 @@ const handleProcessRefund = (item) => {
   })
 }
 
-onMounted(() => {
+onMounted(async () => {
+  await loadDicts()
   loadData()
 })
 </script>

+ 3 - 2
admin-mp/src/pages/finance/settlement.vue

@@ -166,7 +166,7 @@ import { ref, onMounted, computed } from 'vue'
 import { getSettlementRecords } from '../../api/finance.js'
 import { getStationList } from '../../api/station.js'
 import { formatTime, showToast, formatAmount, fmtDictName, getDictColor } from '../../utils/index.js'
-import dictUtil from '../../utils/dict.js'
+import dictUtil, { loadDicts } from '../../utils/dict.js'
 
 const list = ref([])
 const loading = ref(true)
@@ -282,7 +282,8 @@ const closeDetail = () => {
   detailItem.value = null
 }
 
-onMounted(() => {
+onMounted(async () => {
+  await loadDicts()
   loadStations()
   loadData()
 })

+ 3 - 1
admin-mp/src/pages/finance/split-record.vue

@@ -87,6 +87,7 @@ import { ref, onMounted } from 'vue'
 import { getSplitRecords } from '../../api/finance.js'
 import { getStationList } from '../../api/station.js'
 import { formatTime, formatAmount, fmtDictName, getDictColor } from '../../utils/index.js'
+import { loadDicts } from '../../utils/dict.js'
 
 const list = ref([])
 const loading = ref(true)
@@ -206,7 +207,8 @@ const handleSearch = () => {
   loadData()
 }
 
-onMounted(() => {
+onMounted(async () => {
+  await loadDicts()
   loadStations()
   loadData()
 })

+ 3 - 2
admin-mp/src/pages/finance/withdraw.vue

@@ -136,7 +136,7 @@ import { ref, computed, onMounted } from 'vue'
 import { onLoad } from '@dcloudio/uni-app'
 import { getWithdrawnRecords, reviewWithdrawn, applyWithdrawn, getStationAccounts } from '../../api/finance.js'
 import { formatTime, showToast, formatAmount, fmtDictName, getDictColor } from '../../utils/index.js'
-import dictUtil from '../../utils/dict.js'
+import dictUtil, { loadDicts } from '../../utils/dict.js'
 
 const stationId = ref('')
 const stationName = ref('')
@@ -159,7 +159,8 @@ const activeFilter = ref(0)
 const filterOptions = computed(() => dictUtil.getDictFilterOptions('WithdrawnRecord.status'))
 const withdrawRecords = ref([])
 
-onLoad((options) => {
+onLoad(async (options) => {
+  await loadDicts()
   stationId.value = options.stationId || ''
   stationName.value = options.stationName || '站点'
   loadAccountData()

+ 0 - 2
admin-mp/src/pages/index/index.vue

@@ -143,14 +143,12 @@
       </view>
     </view>
 
-    <custom-tab-bar />
   </view>
 </template>
 
 <script setup>
 import { ref, computed, onMounted } from 'vue'
 import { onPullDownRefresh } from '@dcloudio/uni-app'
-import CustomTabBar from '../../custom-tab-bar/index.vue'
 import { logout } from '../../api/auth.js'
 import { getDashboardData, getDeviceStatus } from '../../api/stat.js'
 import { getStationList } from '../../api/station.js'

+ 13 - 11
admin-mp/src/pages/order/detail.vue

@@ -133,7 +133,7 @@
 import { ref, onMounted, computed } from 'vue'
 import { getOrderDetail, handleRefund as refundApi } from '../../api/order.js'
 import { formatTime, showToast, formatAmount, fmtDictName, getDictColor } from '../../utils/index.js'
-import dictUtil from '../../utils/dict.js'
+import dictUtil, { loadDicts } from '../../utils/dict.js'
 
 const orderId = ref('')
 const orderDetail = ref({})
@@ -141,27 +141,27 @@ const loading = ref(true)
 
 // 从字典获取订单状态文本
 const getOrderStatusText = (status) => {
-  return fmtDictName('WashOrder.orderStatus', status)
+  return fmtDictName('Order.status', status)
 }
 
 // 从字典获取支付状态文本
 const getPayStatusText = (status) => {
-  return fmtDictName('WashOrder.payStatus', status)
+  return fmtDictName('Order.pay', status)
 }
 
 // 从字典获取关机方式文本
 const getCloseTypeText = (type) => {
-  return fmtDictName('WashOrder.closeType', type)
+  return fmtDictName('Order.closeType', type)
 }
 
 // 从字典获取发票状态文本
 const getInvoiceStatusText = (status) => {
-  return fmtDictName('WashOrder.invoiceStatus', status)
+  return fmtDictName('Invoice.status', status)
 }
 
 // 从字典获取订单状态内联样式
 const getOrderStatusStyle = (status) => {
-  const color = getDictColor('WashOrder.orderStatus', status)
+  const color = getDictColor('Order.status', status)
   if (color) {
     return {
       color: color,
@@ -173,7 +173,7 @@ const getOrderStatusStyle = (status) => {
 
 // 计算是否可以处理退款
 const canHandleRefund = computed(() => {
-  const refundValue = dictUtil.getDictValue('WashOrder.orderStatus', '退款中')
+  const refundValue = dictUtil.getDictValue('Order.status', '退款中')
   return orderDetail.value.orderStatus === refundValue && orderDetail.value.refundLogId
 })
 
@@ -207,7 +207,7 @@ const loadOrderDetail = async () => {
         data.detail = data.detail
           .filter(item => item.amount > 0 || item.seconds > 0)
           .map(item => {
-            const serviceName = dictUtil.getDictLabel('WashOrder.feeType', item.name)
+            const serviceName = dictUtil.getDictLabel('Order.feeType', item.name)
             return {
               name: serviceName,
               seconds: formatDuration(item.seconds),
@@ -270,18 +270,20 @@ const goBack = () => {
 }
 
 // 页面加载时获取订单ID并加载详情
-onMounted(() => {
+onMounted(async () => {
+  await loadDicts()
+
   // 获取页面参数
   const pages = getCurrentPages()
   const currentPage = pages[pages.length - 1]
   const receivedOrderId = currentPage.options.orderId || ''
-  
+
   if (!receivedOrderId) {
     showToast('订单ID不存在,无法加载详情')
     loading.value = false
     return
   }
-  
+
   orderId.value = receivedOrderId
   loadOrderDetail()
 })

+ 48 - 15
admin-mp/src/pages/order/list.vue

@@ -29,12 +29,20 @@
             <text class="order-id-label">订单号</text>
             <text class="order-id">{{ order.orderId }}</text>
           </view>
-          <text
-            class="order-status"
-            :style="getOrderStatusStyle(order.orderStatus)"
-          >
-            {{ getOrderStatusText(order.orderStatus) }}
-          </text>
+          <view class="status-tags">
+            <text
+              class="order-status"
+              :style="getOrderStatusStyle(order.orderStatus)"
+            >
+              {{ getOrderStatusText(order.orderStatus) }}
+            </text>
+            <text
+              class="pay-status"
+              :style="getPayStatusStyle(order.payStatus)"
+            >
+              {{ getPayStatusText(order.payStatus) }}
+            </text>
+          </view>
         </view>
         
         <!-- 订单核心信息 -->
@@ -120,16 +128,14 @@
       </view>
     </view>
 
-    <custom-tab-bar />
   </view>
 </template>
 
 <script setup>
 import { ref, onMounted, reactive } from 'vue'
-import CustomTabBar from '../../custom-tab-bar/index.vue'
 import { getOrderList, handleRefund as refundApi } from '../../api/order.js'
 import { formatTime, showToast, formatAmount, fmtDictName, getDictColor } from '../../utils/index.js'
-import dictUtil from '../../utils/dict.js'
+import dictUtil, { loadDicts } from '../../utils/dict.js'
 
 const orderList = ref([])
 const loading = ref(true)
@@ -152,8 +158,8 @@ const state = reactive({
   }
 })
 
-onMounted(() => {
-  // 加载订单列表
+onMounted(async () => {
+  await loadDicts()
   loadOrderList()
 })
 
@@ -275,12 +281,29 @@ const handleRefund = async (refundLogId) => {
 
 // 从字典获取订单状态文本
 const getOrderStatusText = (status) => {
-  return fmtDictName('WashOrder.orderStatus', status)
+  return fmtDictName('Order.status', status)
 }
 
 // 从字典获取订单状态内联样式
 const getOrderStatusStyle = (status) => {
-  const color = getDictColor('WashOrder.orderStatus', status)
+  const color = getDictColor('Order.status', status)
+  if (color) {
+    return {
+      color: color,
+      backgroundColor: `${color}1A`
+    }
+  }
+  return {}
+}
+
+// 从字典获取支付状态文本
+const getPayStatusText = (status) => {
+  return fmtDictName('Order.pay', status)
+}
+
+// 从字典获取支付状态内联样式
+const getPayStatusStyle = (status) => {
+  const color = getDictColor('Order.pay', status)
   if (color) {
     return {
       color: color,
@@ -292,7 +315,7 @@ const getOrderStatusStyle = (status) => {
 
 // 判断是否为退款状态
 const isRefundStatus = (status) => {
-  return status === dictUtil.getDictValue('WashOrder.orderStatus', '退款中')
+  return status === dictUtil.getDictValue('Order.status', '退款中')
 }
 
 
@@ -423,8 +446,18 @@ const onPullDownRefresh = () => {
   line-height: 1.4;
 }
 
+/* 状态标签容器 */
+.status-tags {
+  display: flex;
+  flex-direction: column;
+  align-items: flex-end;
+  gap: 8rpx;
+  flex-shrink: 0;
+}
+
 /* 订单状态 */
-.order-status {
+.order-status,
+.pay-status {
   font-size: 24rpx;
   padding: 6rpx 24rpx;
   border-radius: 200rpx;

+ 3 - 1
admin-mp/src/pages/station/detail.vue

@@ -130,12 +130,14 @@ import { ref } from 'vue'
 import { onLoad } from '@dcloudio/uni-app'
 import { getStationDetail } from '../../api/station.js'
 import { formatTime, fmtDictName, getDictColor } from '../../utils/index.js'
+import { loadDicts } from '../../utils/dict.js'
 
 const loading = ref(true)
 const detail = ref(null)
 const stationName = ref('')
 
-onLoad((options) => {
+onLoad(async (options) => {
+  await loadDicts()
   const id = options.id || ''
   stationName.value = decodeURIComponent(options.name || '')
   if (id) {

+ 3 - 2
admin-mp/src/pages/station/list.vue

@@ -98,7 +98,7 @@
 import { ref, onMounted, computed } from 'vue'
 import { getStationList } from '../../api/station.js'
 import { formatTime, fmtDictName, getDictColor } from '../../utils/index.js'
-import dictUtil from '../../utils/dict.js'
+import dictUtil, { loadDicts } from '../../utils/dict.js'
 
 const list = ref([])
 const loading = ref(true)
@@ -186,7 +186,8 @@ const viewDetail = (item) => {
   })
 }
 
-onMounted(() => {
+onMounted(async () => {
+  await loadDicts()
   loadData()
 })
 </script>

+ 2 - 2
admin-mp/src/pages/system/feedback.vue

@@ -66,7 +66,7 @@
 import { ref, onMounted, computed } from 'vue'
 import { getFeedbackList } from '../../api/system.js'
 import { formatTime, fmtDictName, getDictColor } from '../../utils/index.js'
-import dictUtil from '../../utils/dict.js'
+import dictUtil, { loadDicts } from '../../utils/dict.js'
 
 const list = ref([])
 const loading = ref(true)
@@ -139,7 +139,7 @@ const previewImage = (url, urls) => {
   uni.previewImage({ urls, current: url })
 }
 
-onMounted(() => loadData())
+onMounted(async () => { await loadDicts(); loadData() })
 </script>
 
 <style scoped>

+ 2 - 1
admin-mp/src/pages/system/notice.vue

@@ -49,6 +49,7 @@
 import { ref, onMounted } from 'vue'
 import { getNoticeList } from '../../api/system.js'
 import { formatTime, fmtDictName, getDictColor } from '../../utils/index.js'
+import { loadDicts } from '../../utils/dict.js'
 
 const list = ref([])
 const loading = ref(true)
@@ -116,7 +117,7 @@ const viewDetail = (item) => {
   })
 }
 
-onMounted(() => loadData())
+onMounted(async () => { await loadDicts(); loadData() })
 </script>
 
 <style scoped>

+ 3 - 1
admin-mp/src/pages/user/list.vue

@@ -132,6 +132,7 @@ import { ref, onMounted } from 'vue'
 import { getAppUserList } from '../../api/user.js'
 import { applyRefund } from '../../api/finance.js'
 import { formatTime, showToast, formatAmount, fmtDictName, getDictColor } from '../../utils/index.js'
+import { loadDicts } from '../../utils/dict.js'
 
 const list = ref([])
 const loading = ref(true)
@@ -238,7 +239,8 @@ const confirmRefund = async () => {
   }
 }
 
-onMounted(() => {
+onMounted(async () => {
+  await loadDicts()
   loadData()
 })
 </script>