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.
- package/LICENSE +21 -0
- package/README.en.md +414 -25
- package/README.md +426 -277
- package/bin/cli.js +99 -99
- package/bin/generator.js +502 -502
- package/bin/prompts.js +158 -158
- package/bin/utils.js +133 -133
- package/package.json +3 -3
- package/public/logo.png +0 -0
- package/src/App.vue +1 -1
- package/src/api/methods/sysAccount.js +0 -1
- package/src/api/methods/sysDictItem.js +3 -3
- package/src/api/methods/system.js +10 -11
- package/src/api/request.js +39 -39
- package/src/assets/css/style.css +0 -11
- package/src/assets/css/zcui.css +1002 -319
- package/src/assets/imgs/logo.png +0 -0
- package/src/assets/imgs/md/console.png +0 -0
- package/src/assets/imgs/md/login.png +0 -0
- package/src/assets/imgs/md/menu.png +0 -0
- package/src/assets/imgs/md/serviceMonitoring.png +0 -0
- package/src/assets/imgs/md/statistics.png +0 -0
- package/src/components/FormTable.vue +50 -37
- package/src/components/IconPicker.vue +351 -344
- package/src/components/MainPage.vue +220 -339
- package/src/components/edit/QuartzEdit.vue +1 -1
- package/src/components/edit/SysAccountEdit.vue +15 -8
- package/src/components/edit/SysDictEdit.vue +6 -4
- package/src/components/edit/SysDictItemEdit.vue +8 -6
- package/src/components/edit/SysRoleEdit.vue +5 -3
- package/src/components/edit/sysMenuEdit.vue +10 -25
- package/src/config/index.js +74 -74
- package/src/directives/permission.js +49 -45
- package/src/main.js +2 -3
- package/src/router/index.js +48 -30
- package/src/stores/config.js +7 -1
- package/src/stores/menu.js +32 -8
- package/src/stores/user.js +17 -17
- package/src/utils/regionUtils.js +20 -16
- package/src/utils/useFormCRUD.js +59 -60
- package/src/views/baiscstatis/center.vue +53 -42
- package/src/views/baiscstatis/iframePage.vue +9 -11
- package/src/views/console.vue +92 -42
- package/src/views/demo/button.vue +269 -0
- package/src/views/demo/importexport.vue +8 -12
- package/src/views/demo/region.vue +103 -21
- package/src/views/demo/statistics.vue +38 -19
- package/src/views/home.vue +2 -3
- package/src/views/login.vue +254 -149
- package/src/views/operations/log/logQuartz.vue +0 -1
- package/src/views/operations/quartz.vue +22 -24
- package/src/views/system/sysAccount.vue +16 -11
- package/src/views/system/sysDict.vue +9 -6
- package/src/views/system/sysMenu.vue +17 -15
- package/src/views/system/sysRole.vue +44 -21
- package/SCAFFOLD_README.md +0 -215
- package/src/assets/imgs/md/1.png +0 -0
- package/src/assets/imgs/md/10.png +0 -0
- package/src/assets/imgs/md/11.png +0 -0
- package/src/assets/imgs/md/2.png +0 -0
- package/src/assets/imgs/md/3.png +0 -0
- package/src/assets/imgs/md/4.png +0 -0
- package/src/assets/imgs/md/5.png +0 -0
- package/src/assets/imgs/md/6.png +0 -0
- package/src/assets/imgs/md/7.png +0 -0
- package/src/assets/imgs/md/8.png +0 -0
- package/src/assets/imgs/md/9.png +0 -0
package/src/api/request.js
CHANGED
|
@@ -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
|
-
|
|
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(
|
|
53
|
-
|
|
51
|
+
contentType.includes('application/pdf') ||
|
|
52
|
+
contentType.includes(
|
|
53
|
+
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
|
54
|
+
)) // 添加其他需要的文件类型
|
|
54
55
|
|
|
55
|
-
|
|
56
|
+
if (isFileResponse) {
|
|
57
|
+
// 处理文件流响应
|
|
58
|
+
const blob = await response.blob()
|
|
56
59
|
|
|
57
|
-
|
|
58
|
-
|
|
60
|
+
// 尝试获取文件名
|
|
61
|
+
let fileName = ''
|
|
59
62
|
|
|
60
|
-
|
|
61
|
-
|
|
63
|
+
// 1. 尝试从 Content-Disposition 获取
|
|
64
|
+
const contentDisposition = response.headers.get('content-disposition')
|
|
62
65
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
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
|
-
|
|
91
|
-
|
|
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(
|
|
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(
|
|
217
|
+
.then(result => {
|
|
218
218
|
// 这里会收到拦截器返回的 { blob, fileName }
|
|
219
219
|
resolve(result)
|
|
220
220
|
})
|
package/src/assets/css/style.css
CHANGED
|
@@ -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;
|