zant-admin 1.0.1 → 2.0.0

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 (67) hide show
  1. package/LICENSE +21 -0
  2. package/README.en.md +414 -25
  3. package/README.md +426 -277
  4. package/bin/cli.js +99 -99
  5. package/bin/generator.js +502 -502
  6. package/bin/prompts.js +158 -158
  7. package/bin/utils.js +133 -133
  8. package/package.json +3 -3
  9. package/public/logo.png +0 -0
  10. package/src/App.vue +1 -1
  11. package/src/api/methods/sysAccount.js +0 -1
  12. package/src/api/methods/sysDictItem.js +3 -3
  13. package/src/api/methods/system.js +10 -11
  14. package/src/api/request.js +39 -39
  15. package/src/assets/css/style.css +0 -11
  16. package/src/assets/css/zcui.css +1002 -319
  17. package/src/assets/imgs/logo.png +0 -0
  18. package/src/assets/imgs/md/console.png +0 -0
  19. package/src/assets/imgs/md/login.png +0 -0
  20. package/src/assets/imgs/md/menu.png +0 -0
  21. package/src/assets/imgs/md/serviceMonitoring.png +0 -0
  22. package/src/assets/imgs/md/statistics.png +0 -0
  23. package/src/components/FormTable.vue +50 -37
  24. package/src/components/IconPicker.vue +351 -344
  25. package/src/components/MainPage.vue +220 -339
  26. package/src/components/edit/QuartzEdit.vue +1 -1
  27. package/src/components/edit/SysAccountEdit.vue +15 -8
  28. package/src/components/edit/SysDictEdit.vue +6 -4
  29. package/src/components/edit/SysDictItemEdit.vue +8 -6
  30. package/src/components/edit/SysRoleEdit.vue +5 -3
  31. package/src/components/edit/sysMenuEdit.vue +10 -25
  32. package/src/config/index.js +74 -74
  33. package/src/directives/permission.js +49 -45
  34. package/src/main.js +2 -3
  35. package/src/router/index.js +48 -30
  36. package/src/stores/config.js +7 -1
  37. package/src/stores/menu.js +32 -8
  38. package/src/stores/user.js +17 -17
  39. package/src/utils/regionUtils.js +20 -16
  40. package/src/utils/useFormCRUD.js +59 -60
  41. package/src/views/baiscstatis/center.vue +53 -42
  42. package/src/views/baiscstatis/iframePage.vue +9 -11
  43. package/src/views/console.vue +92 -42
  44. package/src/views/demo/button.vue +269 -0
  45. package/src/views/demo/importexport.vue +8 -12
  46. package/src/views/demo/region.vue +103 -21
  47. package/src/views/demo/statistics.vue +38 -19
  48. package/src/views/home.vue +2 -3
  49. package/src/views/login.vue +254 -149
  50. package/src/views/operations/log/logQuartz.vue +0 -1
  51. package/src/views/operations/quartz.vue +22 -24
  52. package/src/views/system/sysAccount.vue +16 -11
  53. package/src/views/system/sysDict.vue +9 -6
  54. package/src/views/system/sysMenu.vue +17 -15
  55. package/src/views/system/sysRole.vue +44 -21
  56. package/SCAFFOLD_README.md +0 -215
  57. package/src/assets/imgs/md/1.png +0 -0
  58. package/src/assets/imgs/md/10.png +0 -0
  59. package/src/assets/imgs/md/11.png +0 -0
  60. package/src/assets/imgs/md/2.png +0 -0
  61. package/src/assets/imgs/md/3.png +0 -0
  62. package/src/assets/imgs/md/4.png +0 -0
  63. package/src/assets/imgs/md/5.png +0 -0
  64. package/src/assets/imgs/md/6.png +0 -0
  65. package/src/assets/imgs/md/7.png +0 -0
  66. package/src/assets/imgs/md/8.png +0 -0
  67. package/src/assets/imgs/md/9.png +0 -0
@@ -42,38 +42,40 @@ const serviceAlova = createAlova({
42
42
  */
43
43
  onSuccess: async (response, method) => {
44
44
  message.destroy() // 请求成功后销毁加载提示
45
- // 检查是否为文件流响应
45
+ // 检查是否为文件流响应
46
46
  const contentType = response.headers.get('content-type')
47
- const isFileResponse =
47
+ const isFileResponse =
48
48
  contentType &&
49
49
  (contentType.includes('application/octet-stream') ||
50
50
  contentType.includes('text/plain') ||
51
- contentType.includes('application/pdf')||
52
- contentType.includes('application/vnd.openxmlformats-officedocument.spreadsheetml.sheet')
53
- ) // 添加其他需要的文件类型
51
+ contentType.includes('application/pdf') ||
52
+ contentType.includes(
53
+ 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
54
+ )) // 添加其他需要的文件类型
54
55
 
55
- if (isFileResponse) {
56
+ if (isFileResponse) {
57
+ // 处理文件流响应
58
+ const blob = await response.blob()
56
59
 
57
- // 处理文件流响应
58
- const blob = await response.blob()
60
+ // 尝试获取文件名
61
+ let fileName = ''
59
62
 
60
- // 尝试获取文件名
61
- let fileName = ''
63
+ // 1. 尝试从 Content-Disposition 获取
64
+ const contentDisposition = response.headers.get('content-disposition')
62
65
 
63
- // 1. 尝试从 Content-Disposition 获取
64
- const contentDisposition = response.headers.get('content-disposition')
65
-
66
- if (contentDisposition) {
67
- // 匹配标准格式: attachment; filename="encodedFileName"
68
- const match = contentDisposition.match(/filename\*?=['"]?(?:UTF-\d['"]*)?([^;]+)/i)
69
- if (match && match[1]) {
70
- // 解码 URL 编码的文件名
71
- fileName = decodeURIComponent(match[1].trim())
72
- }
73
- }
74
-
75
- return { blob, fileName }
66
+ if (contentDisposition) {
67
+ // 匹配标准格式: attachment; filename="encodedFileName"
68
+ const match = contentDisposition.match(
69
+ /filename\*?=['"]?(?:UTF-\d['"]*)?([^;]+)/i,
70
+ )
71
+ if (match && match[1]) {
72
+ // 解码 URL 编码的文件名
73
+ fileName = decodeURIComponent(match[1].trim())
76
74
  }
75
+ }
76
+
77
+ return { blob, fileName }
78
+ }
77
79
 
78
80
  if (response.status == 200) {
79
81
  const json = await response.json()
@@ -87,26 +89,24 @@ const serviceAlova = createAlova({
87
89
  message.error(json.errors)
88
90
  return Promise.reject(json)
89
91
  case 401:
90
- const userStore = useUserStore()
91
- userStore.token = '' // 清空 token
92
+ const userStore = useUserStore()
93
+ userStore.token = '' // 清空 token
92
94
  message.error({
93
95
  content: json.errors + ',请重新登录',
94
96
  duration: 1,
95
97
  onClose: () => {
96
98
  router.push('/login')
97
- }
99
+ },
98
100
  })
99
101
  return Promise.reject(json)
100
102
  case 500:
101
-
102
103
  message.error(json.errors)
103
104
  return Promise.reject(json)
104
105
  }
105
106
  // 解析的响应数据将传给method实例的transformData钩子函数,这些函数将在后续讲解
106
107
  return Promise.reject(json)
107
108
  } else {
108
-
109
- message.error(response.status+":请求地址无效")
109
+ message.error(response.status + ':请求地址无效')
110
110
  return Promise.reject(response.status)
111
111
  }
112
112
  },
@@ -127,8 +127,8 @@ const serviceAlova = createAlova({
127
127
  */
128
128
  onComplete: () => {
129
129
  // 处理请求完成逻辑
130
- }
131
- }
130
+ },
131
+ },
132
132
  })
133
133
 
134
134
  /**
@@ -183,11 +183,11 @@ export const downloadFileGet = (url, params = {}) => {
183
183
  config: {
184
184
  responseType: 'blob', // 关键:指定响应类型为 blob
185
185
  headers: {
186
- Accept: 'application/octet-stream' // 明确表示接受文件流
187
- }
188
- }
186
+ Accept: 'application/octet-stream', // 明确表示接受文件流
187
+ },
188
+ },
189
189
  })
190
- .then((result) => {
190
+ .then(result => {
191
191
  // 这里会收到拦截器返回的 { blob, fileName }
192
192
  resolve(result)
193
193
  })
@@ -210,11 +210,11 @@ export const downloadFilePost = (url, data = {}) => {
210
210
  config: {
211
211
  responseType: 'blob', // 关键:指定响应类型为 blob
212
212
  headers: {
213
- Accept: 'application/octet-stream' // 明确表示接受文件流
214
- }
215
- }
213
+ Accept: 'application/octet-stream', // 明确表示接受文件流
214
+ },
215
+ },
216
216
  })
217
- .then((result) => {
217
+ .then(result => {
218
218
  // 这里会收到拦截器返回的 { blob, fileName }
219
219
  resolve(result)
220
220
  })
@@ -2,17 +2,6 @@ body {
2
2
  margin: 0;
3
3
  min-height: 100vh;
4
4
  background-color: #f5f5f5;
5
-
6
- /* display: flex;
7
- place-items: center;
8
- min-width: 320px;
9
- min-height: 100vh; */
10
- }
11
- #app {
12
- /* max-width: 1280px;
13
- margin: 0 auto;
14
- padding: 2rem;
15
- text-align: center; */
16
5
  }
17
6
  section {
18
7
  height: 100vh;