af-mobile-client-vue3 1.1.30 → 1.1.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,111 +1,100 @@
1
- {
2
- "name": "af-mobile-client-vue3",
3
- "type": "module",
4
- "version": "1.1.30",
5
- "description": "Vue + Vite component lib",
6
- "license": "MIT",
7
- "engines": {
8
- "node": ">=18.12.0",
9
- "pnpm": ">=8.15.0"
10
- },
11
- "scripts": {
12
- "dev": "cross-env MOCK_SERVER_PORT=8086 vite",
13
- "build": "vue-tsc --noEmit && vite build",
14
- "build:dev": "vue-tsc --noEmit && vite build --mode=development",
15
- "preview": "vite preview",
16
- "lint": "eslint . && vue-tsc --noEmit",
17
- "lint:fix": "eslint . --fix",
18
- "test": "vitest",
19
- "release": "bumpp --commit --push --tag"
20
- },
21
- "dependencies": {
22
- "@micro-zoe/micro-app": "1.0.0-rc.24",
23
- "@vant/area-data": "^2.0.0",
24
- "@unhead/vue": "^2.0.5",
25
- "@vant/touch-emulator": "^1.4.0",
26
- "@vant/use": "^1.6.0",
27
- "@vueuse/core": "^13.1.0",
28
- "@iconify/vue": "4.3.0",
29
- "animate.css": "^4.1.1",
30
- "axios": "^1.8.4",
31
- "crypto-js": "^4.2.0",
32
- "echarts": "^5.6.0",
33
- "lodash-es": "^4.17.21",
34
- "nprogress": "^0.2.0",
35
- "ol": "^10.5.0",
36
- "pinia": "^3.0.2",
37
- "pinia-plugin-persistedstate": "^4.2.0",
38
- "qs": "^6.14.0",
39
- "resize-detector": "^0.3.0",
40
- "store": "^2.0.12",
41
- "vant": "^4.9.18",
42
- "vconsole": "^3.15.1",
43
- "vue": "^3.5.13",
44
- "vue-router": "^4.5.0"
45
- },
46
- "devDependencies": {
47
- "@antfu/eslint-config": "^4.12.0",
48
- "@iconify/json": "2.2.318",
49
- "@types/crypto-js": "^4.2.2",
50
- "@types/lodash-es": "^4.17.12",
51
- "@types/node": "^22.14.1",
52
- "@types/nprogress": "^0.2.3",
53
- "@types/store": "^2.0.5",
54
- "@unocss/eslint-plugin": "^66.1.0-beta.11",
55
- "@unocss/preset-rem-to-px": "66.1.0-beta.11",
56
- "@vitejs/plugin-legacy": "^6.0.2",
57
- "@vitejs/plugin-vue": "^5.2.3",
58
- "autoprefixer": "^10.4.21",
59
- "bumpp": "^10.1.0",
60
- "commitizen": "^4.3.1",
61
- "consola": "^3.4.2",
62
- "cross-env": "^7.0.3",
63
- "cz-emoji-chinese": "^0.3.1",
64
- "eslint": "^9.24.0",
65
- "eslint-ts-patch": "^8.57.0-0",
66
- "husky": "^9.1.7",
67
- "less": "^4.3.0",
68
- "mockjs": "^1.1.0",
69
- "postcss-mobile-forever": "^5.0.0",
70
- "rollup": "^4.40.0",
71
- "terser": "^5.39.0",
72
- "typescript": "^5.8.3",
73
- "unocss": "^66.1.0-beta.11",
74
- "unplugin-auto-import": "^19.1.2",
75
- "unplugin-vue-components": "^28.4.1",
76
- "unplugin-vue-router": "^0.12.0",
77
- "vite": "^6.2.6",
78
- "vite-plugin-compression": "^0.5.1",
79
- "vite-plugin-mock-dev-server": "^1.8.5",
80
- "vite-plugin-pwa": "^1.0.0",
81
- "vite-plugin-sitemap": "^0.7.1",
82
- "vite-plugin-svg-icons": "^2.0.1",
83
- "vite-plugin-vconsole": "^2.1.1",
84
- "vite-plugin-vue-devtools": "^7.7.2",
85
- "vite-plugin-vue-layouts": "^0.11.0",
86
- "vitest": "^3.1.1",
87
- "vue-tsc": "^2.2.8"
88
- },
89
- "pnpm": {
90
- "peerDependencyRules": {
91
- "ignoreMissing": [
92
- "postcss",
93
- "esbuild"
94
- ],
95
- "allowedVersions": {
96
- "rollup": "^4.x"
97
- }
98
- }
99
- },
100
- "config": {
101
- "commitizen": {
102
- "path": "./node_modules/cz-emoji-chinese"
103
- },
104
- "cz-emoji-chinese": {
105
- "skipQuestions": [
106
- "body",
107
- "scope"
108
- ]
109
- }
110
- }
111
- }
1
+ {
2
+ "name": "af-mobile-client-vue3",
3
+ "type": "module",
4
+ "version": "1.1.32",
5
+ "description": "Vue + Vite component lib",
6
+ "license": "MIT",
7
+ "engines": {
8
+ "node": ">=18.12.0",
9
+ "pnpm": ">=8.15.0"
10
+ },
11
+ "dependencies": {
12
+ "@micro-zoe/micro-app": "1.0.0-rc.24",
13
+ "@vant/area-data": "^2.0.0",
14
+ "@unhead/vue": "^2.0.5",
15
+ "@vant/touch-emulator": "^1.4.0",
16
+ "@vant/use": "^1.6.0",
17
+ "@vueuse/core": "^13.1.0",
18
+ "@iconify/vue": "4.3.0",
19
+ "animate.css": "^4.1.1",
20
+ "axios": "^1.8.4",
21
+ "crypto-js": "^4.2.0",
22
+ "echarts": "^5.6.0",
23
+ "lodash-es": "^4.17.21",
24
+ "nprogress": "^0.2.0",
25
+ "ol": "^10.5.0",
26
+ "pinia": "^3.0.2",
27
+ "pinia-plugin-persistedstate": "^4.2.0",
28
+ "qs": "^6.14.0",
29
+ "resize-detector": "^0.3.0",
30
+ "store": "^2.0.12",
31
+ "vant": "^4.9.18",
32
+ "vconsole": "^3.15.1",
33
+ "vue": "^3.5.13",
34
+ "vue-router": "^4.5.0"
35
+ },
36
+ "devDependencies": {
37
+ "@antfu/eslint-config": "^4.12.0",
38
+ "@iconify/json": "2.2.318",
39
+ "@types/crypto-js": "^4.2.2",
40
+ "@types/lodash-es": "^4.17.12",
41
+ "@types/node": "^22.14.1",
42
+ "@types/nprogress": "^0.2.3",
43
+ "@types/store": "^2.0.5",
44
+ "@unocss/eslint-plugin": "^66.1.0-beta.11",
45
+ "@unocss/preset-rem-to-px": "66.1.0-beta.11",
46
+ "@vitejs/plugin-legacy": "^6.0.2",
47
+ "@vitejs/plugin-vue": "^5.2.3",
48
+ "autoprefixer": "^10.4.21",
49
+ "bumpp": "^10.1.0",
50
+ "commitizen": "^4.3.1",
51
+ "consola": "^3.4.2",
52
+ "cross-env": "^7.0.3",
53
+ "cz-emoji-chinese": "^0.3.1",
54
+ "eslint": "^9.24.0",
55
+ "eslint-ts-patch": "^8.57.0-0",
56
+ "husky": "^9.1.7",
57
+ "less": "^4.3.0",
58
+ "mockjs": "^1.1.0",
59
+ "postcss-mobile-forever": "^5.0.0",
60
+ "rollup": "^4.40.0",
61
+ "terser": "^5.39.0",
62
+ "typescript": "^5.8.3",
63
+ "unocss": "^66.1.0-beta.11",
64
+ "unplugin-auto-import": "^19.1.2",
65
+ "unplugin-vue-components": "^28.4.1",
66
+ "unplugin-vue-router": "^0.12.0",
67
+ "vite": "^6.2.6",
68
+ "vite-plugin-compression": "^0.5.1",
69
+ "vite-plugin-mock-dev-server": "^1.8.5",
70
+ "vite-plugin-pwa": "^1.0.0",
71
+ "vite-plugin-sitemap": "^0.7.1",
72
+ "vite-plugin-svg-icons": "^2.0.1",
73
+ "vite-plugin-vconsole": "^2.1.1",
74
+ "vite-plugin-vue-devtools": "^7.7.2",
75
+ "vite-plugin-vue-layouts": "^0.11.0",
76
+ "vitest": "^3.1.1",
77
+ "vue-tsc": "^2.2.8"
78
+ },
79
+ "config": {
80
+ "commitizen": {
81
+ "path": "./node_modules/cz-emoji-chinese"
82
+ },
83
+ "cz-emoji-chinese": {
84
+ "skipQuestions": [
85
+ "body",
86
+ "scope"
87
+ ]
88
+ }
89
+ },
90
+ "scripts": {
91
+ "dev": "cross-env MOCK_SERVER_PORT=8086 vite",
92
+ "build": "vue-tsc --noEmit && vite build",
93
+ "build:dev": "vue-tsc --noEmit && vite build --mode=development",
94
+ "preview": "vite preview",
95
+ "lint": "eslint . && vue-tsc --noEmit",
96
+ "lint:fix": "eslint . --fix",
97
+ "test": "vitest",
98
+ "release": "bumpp --commit --push --tag"
99
+ }
100
+ }
@@ -512,6 +512,14 @@ defineExpose({
512
512
  <template>
513
513
  <div id="XCellList">
514
514
  <VanRow class="filter-condition">
515
+ <!-- 左侧动态插槽区域 -->
516
+ <template v-for="(_, name) in slots" :key="name">
517
+ <template v-if="typeof name === 'string' && name.startsWith('search-left-')">
518
+ <div class="filter-icon-box">
519
+ <slot :name="name" />
520
+ </div>
521
+ </template>
522
+ </template>
515
523
  <VanCol class="search-col">
516
524
  <VanSearch
517
525
  v-model="searchValue"
@@ -522,7 +530,7 @@ defineExpose({
522
530
  @search="onRefresh"
523
531
  />
524
532
  </VanCol>
525
- <!-- 动态插槽区域 -->
533
+ <!-- 右侧动态插槽区域 -->
526
534
  <template v-for="(_, name) in slots" :key="name">
527
535
  <template v-if="typeof name === 'string' && name.startsWith('search-right-')">
528
536
  <div class="filter-icon-box">
@@ -478,7 +478,10 @@ function init() {
478
478
  }
479
479
 
480
480
  function getDataCallback(res) {
481
- option.value = res
481
+ option.value = res.map(item => ({
482
+ ...item,
483
+ value: item.label, // 将value设置为label的值
484
+ }))
482
485
  if (attr.type === 'radio')
483
486
  initRadioValue()
484
487
  }
@@ -1,6 +1,7 @@
1
1
  import type { RouteRecordRaw } from 'vue-router'
2
2
  import { doLogout, login, OALogin } from '@af-mobile-client-vue3/api/user'
3
3
  import router from '@af-mobile-client-vue3/router/index'
4
+ import { useSettingStore } from '@af-mobile-client-vue3/stores/modules/setting'
4
5
  import {
5
6
  ACCESS_TOKEN,
6
7
  APP_LOGIN_KEY,
@@ -10,6 +11,7 @@ import {
10
11
  CURRENT_USER,
11
12
  } from '@af-mobile-client-vue3/stores/mutation-type'
12
13
  import crypto from '@af-mobile-client-vue3/utils/crypto'
14
+ import { indexedDB } from '@af-mobile-client-vue3/utils/indexedDB'
13
15
  import { createStorage } from '@af-mobile-client-vue3/utils/Storage'
14
16
  import { defineStore } from 'pinia'
15
17
  import { ref } from 'vue'
@@ -181,14 +183,24 @@ export const useUserStore = defineStore('app-user', () => {
181
183
  }
182
184
  setToken(undefined)
183
185
  setUserInfo(null)
184
- Storage.remove(ACCESS_TOKEN)
185
- Storage.remove(CURRENT_USER)
186
- Storage.remove(APP_LOGIN_KEY)
187
- Storage.remove(APP_PERMISSIONS_KEY)
188
- Storage.remove(APP_ROLES_KEY)
189
- Storage.remove(APP_ROUTES_KEY)
190
- Storage.remove('LoginTicket')
191
- router.push('/login')
186
+ // Storage.remove(ACCESS_TOKEN)
187
+ // Storage.remove(CURRENT_USER)
188
+ // Storage.remove(APP_LOGIN_KEY)
189
+ // Storage.remove(APP_PERMISSIONS_KEY)
190
+ // Storage.remove(APP_ROLES_KEY)
191
+ // Storage.remove(APP_ROUTES_KEY)
192
+ // 开始清空缓存
193
+ try {
194
+ Storage.clear()
195
+ await indexedDB.clearDB()
196
+ await useSettingStore().init()
197
+ // 添加页面刷新
198
+ await router.replace('/login')
199
+ window.location.reload()
200
+ }
201
+ catch (e) {
202
+ console.error(e)
203
+ }
192
204
  }
193
205
 
194
206
  return {
@@ -172,6 +172,21 @@ export const indexedDB = {
172
172
  }
173
173
  })
174
174
  },
175
+ clearDB() {
176
+ return new Promise<void>((resolve, reject) => {
177
+ this.openDB((res: IDBDatabase) => {
178
+ // 删除存储空间全部记录
179
+ const request = res.transaction('metaCache', 'readwrite').objectStore('metaCache').clear()
180
+
181
+ request.onerror = () => {
182
+ reject(new Error('数据删除失败'))
183
+ }
184
+ request.onsuccess = () => {
185
+ resolve()
186
+ }
187
+ })
188
+ })
189
+ },
175
190
  clearCache() {
176
191
  indexedDB.clear(() => {
177
192
  location.reload()