af-mobile-client-vue3 1.3.54 → 1.3.57

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.
Files changed (56) hide show
  1. package/package.json +115 -115
  2. package/public/favicon.svg +4 -4
  3. package/scripts/verifyCommit.js +19 -19
  4. package/src/App.vue +1 -1
  5. package/src/api/user/index.ts +45 -45
  6. package/src/components/data/UserDetail/types.ts +1 -1
  7. package/src/components/data/XReportGrid/XAddReport/index.ts +1 -1
  8. package/src/components/data/XReportGrid/XReportDrawer/index.ts +1 -1
  9. package/src/components/data/XTag/index.vue +10 -10
  10. package/src/components/layout/TabBarLayout/index.vue +40 -40
  11. package/src/font-style/Inter-Bold.woff2 +0 -0
  12. package/src/font-style/Inter-Medium.woff2 +0 -0
  13. package/src/font-style/Inter-Regular.woff2 +0 -0
  14. package/src/font-style/Inter-SemiBold.woff2 +0 -0
  15. package/src/font-style/PingFangSC-Medium.subset.woff2 +0 -0
  16. package/src/font-style/PingFangSC-Medium.woff2 +0 -0
  17. package/src/font-style/PingFangSC-Regular.subset.woff2 +0 -0
  18. package/src/font-style/PingFangSC-Semibold.subset.woff2 +0 -0
  19. package/src/font-style/PingFangSC-Semibold.woff2 +0 -0
  20. package/src/font-style/font.css +59 -2
  21. package/src/hooks/useCommon.ts +9 -9
  22. package/src/plugins/AppData.ts +38 -38
  23. package/src/router/external-routes.ts +69 -69
  24. package/src/router/guards.ts +131 -131
  25. package/src/router/invoiceRoutes.ts +33 -33
  26. package/src/router/routes.ts +421 -421
  27. package/src/services/api/Login.ts +6 -6
  28. package/src/services/api/common.ts +109 -109
  29. package/src/services/api/manage.ts +8 -8
  30. package/src/services/api/search.ts +16 -16
  31. package/src/services/restTools.ts +56 -56
  32. package/src/services/v3Api.ts +11 -11
  33. package/src/stores/modules/user.ts +1 -1
  34. package/src/styles/login.less +109 -109
  35. package/src/types/platform.ts +194 -194
  36. package/src/utils/authority-utils.ts +84 -84
  37. package/src/utils/crypto.ts +39 -39
  38. package/src/utils/environment.ts +10 -10
  39. package/src/utils/platform-auth.ts +150 -150
  40. package/src/utils/routerUtil.ts +81 -2
  41. package/src/utils/runEvalFunction.ts +13 -13
  42. package/src/utils/wechat.ts +297 -297
  43. package/src/views/component/EvaluateRecordView/index.vue +40 -40
  44. package/src/views/component/XCellDetailView/index.vue +217 -217
  45. package/src/views/component/XReportFormIframeView/index.vue +47 -47
  46. package/src/views/component/XReportFormView/index.vue +13 -13
  47. package/src/views/component/XSignatureView/index.vue +50 -50
  48. package/src/views/component/notice.vue +46 -46
  49. package/src/views/component/topNav.vue +36 -36
  50. package/src/views/invoiceShow/index.vue +61 -61
  51. package/src/views/loading/AuthLoading.vue +378 -378
  52. package/src/views/user/login/index.vue +22 -22
  53. package/src/views/user/register/index.vue +1 -1
  54. package/vite.config.ts +114 -114
  55. package/certs/127.0.0.1+2-key.pem +0 -28
  56. package/certs/127.0.0.1+2.pem +0 -27
@@ -105,14 +105,93 @@ function loadRoutes(routesConfig?: any) {
105
105
  const newRoutes = parseRoutes(routesConfig, routes)
106
106
  // 设置路由首页
107
107
  newRoutes[0].redirect = '/'
108
- const finalRoutes = mergeRoutes(routes, newRoutes)
108
+ let finalRoutes = mergeRoutes(routes, newRoutes)
109
109
  formatRoutes(finalRoutes)
110
+ const duplicates = checkDuplicateRouteNames(finalRoutes)
111
+ if (duplicates.length > 0) {
112
+ // 可以选择在这里处理重复的路由名称
113
+ finalRoutes = deduplicateRouteNames(finalRoutes)
114
+ }
110
115
  finalRoutes.forEach((row) => {
111
116
  router.addRoute(row)
112
117
  })
113
118
  }
114
119
  }
115
120
 
121
+ function checkDuplicateRouteNames(routes) {
122
+ const names = new Set()
123
+ const duplicates = []
124
+
125
+ function check(route) {
126
+ if (route.name) {
127
+ if (names.has(`${route.name}_${route.path}`)) {
128
+ duplicates.push(`${route.name}_${route.path}`)
129
+ }
130
+ else {
131
+ names.add(`${route.name}_${route.path}`)
132
+ }
133
+ }
134
+ if (route.children) {
135
+ route.children.forEach(check)
136
+ }
137
+ }
138
+
139
+ routes.forEach(check)
140
+ return duplicates
141
+ }
142
+
143
+ // 处理重复路由名称的函数
144
+ function deduplicateRouteNames(routes) {
145
+ const namePathMap = new Map() // 存储 name_path 组合
146
+ const nameCountMap = new Map() // 存储仅 name 的计数
147
+
148
+ function deduplicate(route) {
149
+ if (!route)
150
+ return null
151
+
152
+ if (route.name) {
153
+ const namePathKey = `${route.name}_${route.path}`
154
+ const nameKey = route.name
155
+
156
+ // 检查 name 和 path 是否都重复
157
+ if (namePathMap.has(namePathKey)) {
158
+ // 完全重复的路由,直接移除
159
+ // console.log(`移除重复路由: name=${route.name}, path=${route.path}`)
160
+ return null
161
+ }
162
+ else {
163
+ // 记录这个 name 和 path 的组合
164
+ namePathMap.set(namePathKey, route)
165
+
166
+ // 检查是否只有 name 重复
167
+ if (nameCountMap.has(nameKey)) {
168
+ const count = nameCountMap.get(nameKey) + 1
169
+ nameCountMap.set(nameKey, count)
170
+ // 修改路由名称,添加计数后缀
171
+ route.name = `${nameKey}_${count}`
172
+ // console.log(`重命名重复路由: ${nameKey} -> ${route.name}`)
173
+ }
174
+ else {
175
+ nameCountMap.set(nameKey, 1)
176
+ }
177
+ }
178
+ }
179
+
180
+ // 递归处理子路由
181
+ if (route.children && route.children.length) {
182
+ route.children = route.children
183
+ .map(child => deduplicate({ ...child }))
184
+ .filter(child => child !== null) // 移除返回 null 的子路由
185
+ }
186
+
187
+ return route
188
+ }
189
+
190
+ // 处理所有路由并过滤掉返回 null 的路由
191
+ return routes
192
+ .map(route => deduplicate({ ...route }))
193
+ .filter(route => route !== null)
194
+ }
116
195
  /**
117
196
  * 合并路由
118
197
  * @param target
@@ -219,7 +298,7 @@ function parsefunc(func) {
219
298
  params: undefined,
220
299
  children: undefined,
221
300
  }
222
- if (row.link.includes('$')) {
301
+ if (row?.link?.includes('$')) {
223
302
  route.router = row.link.split('$')[1]
224
303
  route.params = row.link.split('$')[0]
225
304
  }
@@ -1,13 +1,13 @@
1
- export function executeStrFunction(funcString, args) {
2
- // 使用 eval 执行传入的函数字符串
3
- // eslint-disable-next-line no-eval
4
- return eval(`(${funcString})`)(...args)
5
- }
6
-
7
- export function executeStrFunctionByContext(context, fnStr, args) {
8
- // 使用 new Function 创建函数,并绑定 context 作为 this
9
- // eslint-disable-next-line no-new-func
10
- const fn = new Function(`return (${fnStr});`)()
11
- // 使用 bind 绑定 context,并立即调用
12
- return fn.bind(context)(...args)
13
- }
1
+ export function executeStrFunction(funcString, args) {
2
+ // 使用 eval 执行传入的函数字符串
3
+ // eslint-disable-next-line no-eval
4
+ return eval(`(${funcString})`)(...args)
5
+ }
6
+
7
+ export function executeStrFunctionByContext(context, fnStr, args) {
8
+ // 使用 new Function 创建函数,并绑定 context 作为 this
9
+ // eslint-disable-next-line no-new-func
10
+ const fn = new Function(`return (${fnStr});`)()
11
+ // 使用 bind 绑定 context,并立即调用
12
+ return fn.bind(context)(...args)
13
+ }