@gx-design-vue/create-gx-cli 0.1.19 → 0.1.21
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/README.md +1 -4
- package/dist/index.js +36 -48
- package/package.json +5 -3
- package/template-mobile-vant-cli/.editorconfig +19 -0
- package/template-mobile-vant-cli/.env +3 -0
- package/template-mobile-vant-cli/.env.development +17 -0
- package/template-mobile-vant-cli/.env.pro +28 -0
- package/template-mobile-vant-cli/.env.production +31 -0
- package/template-mobile-vant-cli/.eslintignore +15 -0
- package/template-mobile-vant-cli/.prettierignore +9 -0
- package/template-mobile-vant-cli/README.md +1 -0
- package/template-mobile-vant-cli/commitlint.config.cjs +32 -0
- package/template-mobile-vant-cli/config/default/defaultSettings.ts +70 -0
- package/template-mobile-vant-cli/config/default/network.ts +10 -0
- package/template-mobile-vant-cli/config/default/proxy.ts +50 -0
- package/template-mobile-vant-cli/config/default/theme.ts +3 -0
- package/template-mobile-vant-cli/config/index.ts +11 -0
- package/template-mobile-vant-cli/eslint.config.js +58 -0
- package/template-mobile-vant-cli/index.html +25 -0
- package/template-mobile-vant-cli/internal/vite-config/generate/generateModifyVars.ts +7 -0
- package/template-mobile-vant-cli/internal/vite-config/rollupOptions/index.ts +22 -0
- package/template-mobile-vant-cli/internal/vite-config/util/hash.ts +17 -0
- package/template-mobile-vant-cli/internal/vite-config/util/index.ts +132 -0
- package/template-mobile-vant-cli/internal/vite-config/vite/cdn.ts +65 -0
- package/template-mobile-vant-cli/internal/vite-config/vite/optimizer.ts +26 -0
- package/template-mobile-vant-cli/internal/vite-config/vite/plugin/appConfig.ts +91 -0
- package/template-mobile-vant-cli/internal/vite-config/vite/plugin/autoImport.ts +28 -0
- package/template-mobile-vant-cli/internal/vite-config/vite/plugin/compress.ts +31 -0
- package/template-mobile-vant-cli/internal/vite-config/vite/plugin/html.ts +32 -0
- package/template-mobile-vant-cli/internal/vite-config/vite/plugin/index.ts +74 -0
- package/template-mobile-vant-cli/internal/vite-config/vite/plugin/visualizer.ts +14 -0
- package/template-mobile-vant-cli/internal/vite-config/vite/plugin/viteNotice.ts +40 -0
- package/template-mobile-vant-cli/mock/config/permissions.ts +15 -0
- package/template-mobile-vant-cli/mock/config/user/id.ts +5 -0
- package/template-mobile-vant-cli/mock/config/user/index.ts +96 -0
- package/template-mobile-vant-cli/mock/index.ts +55 -0
- package/template-mobile-vant-cli/mock/routers/table/index.fake.ts +22 -0
- package/template-mobile-vant-cli/mock/routers/user/account.fake.ts +52 -0
- package/template-mobile-vant-cli/mock/routers/user/index.fake.ts +46 -0
- package/template-mobile-vant-cli/mock/utils/crypto.ts +21 -0
- package/template-mobile-vant-cli/mock/utils/table.ts +96 -0
- package/template-mobile-vant-cli/mock/utils/util.ts +91 -0
- package/template-mobile-vant-cli/package.json +74 -0
- package/template-mobile-vant-cli/public/css/default.css +54 -0
- package/template-mobile-vant-cli/public/favicon.ico +0 -0
- package/template-mobile-vant-cli/src/App.vue +8 -0
- package/template-mobile-vant-cli/src/assets/logo.png +0 -0
- package/template-mobile-vant-cli/src/components/PageContainer/ProSkeleton.tsx +29 -0
- package/template-mobile-vant-cli/src/components/PageContainer/index.tsx +207 -0
- package/template-mobile-vant-cli/src/components/PageContainer/style.module.less +17 -0
- package/template-mobile-vant-cli/src/components/TabsMenu/index.vue +45 -0
- package/template-mobile-vant-cli/src/core/gx-design/index.ts +7 -0
- package/template-mobile-vant-cli/src/core/index.ts +5 -0
- package/template-mobile-vant-cli/src/design/color.less +1 -0
- package/template-mobile-vant-cli/src/design/config.less +5 -0
- package/template-mobile-vant-cli/src/design/index.less +3 -0
- package/template-mobile-vant-cli/src/design/mixin.less +65 -0
- package/template-mobile-vant-cli/src/design/reset.less +39 -0
- package/template-mobile-vant-cli/src/design/root.less +3 -0
- package/template-mobile-vant-cli/src/design/vant/index.less +0 -0
- package/template-mobile-vant-cli/src/hooks/web/index.ts +5 -0
- package/template-mobile-vant-cli/src/hooks/web/usePageLoading.ts +56 -0
- package/template-mobile-vant-cli/src/layout/BasicLayout/index.vue +18 -0
- package/template-mobile-vant-cli/src/layout/BasicLayout/style.less +3 -0
- package/template-mobile-vant-cli/src/layout/UserLayout/index.vue +18 -0
- package/template-mobile-vant-cli/src/layout/UserLayout/style.module.less +36 -0
- package/template-mobile-vant-cli/src/main.ts +34 -0
- package/template-mobile-vant-cli/src/pages/Account/details.vue +13 -0
- package/template-mobile-vant-cli/src/pages/Account/index.vue +102 -0
- package/template-mobile-vant-cli/src/pages/Home/index.vue +71 -0
- package/template-mobile-vant-cli/src/pages/user/login/index.vue +76 -0
- package/template-mobile-vant-cli/src/plugins/dayjs/index.ts +3 -0
- package/template-mobile-vant-cli/src/plugins/index.ts +2 -0
- package/template-mobile-vant-cli/src/router/guard/index.ts +18 -0
- package/template-mobile-vant-cli/src/router/guard/permissions.ts +41 -0
- package/template-mobile-vant-cli/src/router/guard/stateGuard.ts +10 -0
- package/template-mobile-vant-cli/src/router/index.ts +31 -0
- package/template-mobile-vant-cli/src/router/routes/index.ts +46 -0
- package/template-mobile-vant-cli/src/router/routes/modules/dataSource.ts +32 -0
- package/template-mobile-vant-cli/src/services/index.ts +31 -0
- package/template-mobile-vant-cli/src/services/userCenter/account.ts +42 -0
- package/template-mobile-vant-cli/src/services/userCenter/index.ts +28 -0
- package/template-mobile-vant-cli/src/store/index.ts +20 -0
- package/template-mobile-vant-cli/src/store/modules/global.ts +23 -0
- package/template-mobile-vant-cli/src/store/modules/user.ts +107 -0
- package/template-mobile-vant-cli/src/utils/accessToken.ts +97 -0
- package/template-mobile-vant-cli/src/utils/crypto/index.ts +56 -0
- package/template-mobile-vant-cli/src/utils/env.ts +50 -0
- package/template-mobile-vant-cli/src/utils/pageTitle.ts +20 -0
- package/template-mobile-vant-cli/src/utils/request/XHR.ts +137 -0
- package/template-mobile-vant-cli/src/utils/request/axiosCancel.ts +69 -0
- package/template-mobile-vant-cli/src/utils/request/checkStatus.ts +25 -0
- package/template-mobile-vant-cli/src/utils/request/index.ts +155 -0
- package/template-mobile-vant-cli/src/utils/request/typings.ts +171 -0
- package/template-mobile-vant-cli/src/utils/storage.ts +215 -0
- package/template-mobile-vant-cli/src/utils/util.ts +27 -0
- package/template-mobile-vant-cli/src/utils/validate.ts +211 -0
- package/template-mobile-vant-cli/tsconfig.json +50 -0
- package/template-mobile-vant-cli/types/auto-imports.d.ts +80 -0
- package/template-mobile-vant-cli/types/components.d.ts +7 -0
- package/template-mobile-vant-cli/types/config.d.ts +56 -0
- package/template-mobile-vant-cli/types/global.d.ts +80 -0
- package/template-mobile-vant-cli/types/mock.d.ts +34 -0
- package/template-mobile-vant-cli/types/module.d.ts +61 -0
- package/template-mobile-vant-cli/types/response.d.ts +17 -0
- package/template-mobile-vant-cli/types/system.d.ts +58 -0
- package/template-mobile-vant-cli/types/vant-import.d.ts +25 -0
- package/template-mobile-vant-cli/unocss.config.ts +161 -0
- package/template-mobile-vant-cli/vite.config.ts +142 -0
- package/template-mobile-vant-html/README.md +4 -0
- package/template-mobile-vant-html/css/global.css +293 -0
- package/template-mobile-vant-html/css/global.css.map +1 -0
- package/template-mobile-vant-html/css/global.less +293 -0
- package/template-mobile-vant-html/css/index.css +20 -0
- package/template-mobile-vant-html/css/index.css.map +1 -0
- package/template-mobile-vant-html/css/index.less +21 -0
- package/template-mobile-vant-html/image/disconnected.svg +60 -0
- package/template-mobile-vant-html/image/empty.svg +52 -0
- package/template-mobile-vant-html/image/error.svg +53 -0
- package/template-mobile-vant-html/image/loading.svg +1 -0
- package/template-mobile-vant-html/index.html +91 -0
- package/template-mobile-vant-html/js/index.js +29 -0
- package/template-mobile-vant-html/js/plugin/day.min.js +1 -0
- package/template-mobile-vant-html/js/plugin/fastclick.js +730 -0
- package/template-mobile-vant-html/js/plugin/jquery.min.js +2 -0
- package/template-mobile-vant-html/js/plugin/rem.js +28 -0
- package/template-mobile-vant-html/js/utils/appUtil.js +70 -0
- package/template-mobile-vant-html/js/utils/config.js +3 -0
- package/template-mobile-vant-html/js/utils/request.js +61 -0
- package/template-mobile-vant-html/js/utils/utils.js +65 -0
- package/template-mobile-vant-html/js/utils/validate.js +292 -0
- package/template-vite-project/.env +5 -0
- package/template-vite-project/.env.development +5 -0
- package/template-vite-project/.env.pro +5 -0
- package/template-vite-project/.env.production +5 -0
- package/template-vite-project/README.md +5 -0
- package/template-vite-project/_gitignore +24 -0
- package/template-vite-project/index.html +46 -0
- package/template-vite-project/internal/proxy/index.ts +47 -0
- package/template-vite-project/internal/vite/generate/generateModifyVars.ts +9 -0
- package/template-vite-project/internal/vite/rollupOptions/index.ts +18 -0
- package/template-vite-project/internal/vite/util/hash.ts +17 -0
- package/template-vite-project/internal/vite/util/index.ts +132 -0
- package/template-vite-project/internal/vite/vite/cdn.ts +65 -0
- package/template-vite-project/internal/vite/vite/plugin/appConfig.ts +91 -0
- package/template-vite-project/internal/vite/vite/plugin/autoImport.ts +28 -0
- package/template-vite-project/internal/vite/vite/plugin/compress.ts +31 -0
- package/template-vite-project/internal/vite/vite/plugin/html.ts +24 -0
- package/template-vite-project/internal/vite/vite/plugin/index.ts +72 -0
- package/template-vite-project/internal/vite/vite/plugin/visualizer.ts +14 -0
- package/template-vite-project/internal/vite/vite/plugin/viteNotice.ts +40 -0
- package/template-vite-project/node_modules/.bin/cross-env +21 -0
- package/template-vite-project/node_modules/.bin/cross-env-shell +21 -0
- package/template-vite-project/node_modules/.bin/esbuild +21 -0
- package/template-vite-project/node_modules/.bin/jiti +21 -0
- package/template-vite-project/node_modules/.bin/lessc +21 -0
- package/template-vite-project/node_modules/.bin/parser +21 -0
- package/template-vite-project/node_modules/.bin/rollup +21 -0
- package/template-vite-project/node_modules/.bin/terser +21 -0
- package/template-vite-project/node_modules/.bin/tsc +21 -0
- package/template-vite-project/node_modules/.bin/tsserver +21 -0
- package/template-vite-project/node_modules/.bin/vite +21 -0
- package/template-vite-project/node_modules/.bin/vue-tsc +21 -0
- package/template-vite-project/node_modules/.bin/yaml +21 -0
- package/template-vite-project/package.json +38 -0
- package/template-vite-project/public/css/index.css +89 -0
- package/template-vite-project/public/css/normalize.css +396 -0
- package/template-vite-project/public/vite.svg +1 -0
- package/template-vite-project/src/App.vue +30 -0
- package/template-vite-project/src/assets/vue.svg +1 -0
- package/template-vite-project/src/components/HelloWorld.vue +41 -0
- package/template-vite-project/src/design/config.less +0 -0
- package/template-vite-project/src/design/index.less +0 -0
- package/template-vite-project/src/main.ts +14 -0
- package/template-vite-project/src/utils/env.ts +50 -0
- package/template-vite-project/tsconfig.app.json +59 -0
- package/template-vite-project/tsconfig.json +7 -0
- package/template-vite-project/tsconfig.node.json +28 -0
- package/template-vite-project/types/global.d.ts +33 -0
- package/template-vite-project/unocss.config.ts +208 -0
- package/template-vite-project/vite.config.ts +88 -0
@@ -0,0 +1,211 @@
|
|
1
|
+
/**
|
2
|
+
* @author gx12358 2539306317@qq.com
|
3
|
+
* @description 判读是否为外链
|
4
|
+
* @param path
|
5
|
+
* @returns {boolean}
|
6
|
+
*/
|
7
|
+
export function isExternal(path) {
|
8
|
+
return /^(?:https?:|mailto:|tel:)/.test(path)
|
9
|
+
}
|
10
|
+
|
11
|
+
/**
|
12
|
+
* @author gx12358 2539306317@qq.com
|
13
|
+
* @description 判断是否是名称
|
14
|
+
* @param value
|
15
|
+
* @returns {boolean}
|
16
|
+
*/
|
17
|
+
export function isName(value) {
|
18
|
+
const reg = /^[\u4e00-\u9fa5a-z0-9]+$/i
|
19
|
+
return reg.test(value)
|
20
|
+
}
|
21
|
+
|
22
|
+
/**
|
23
|
+
* @author gx12358 2539306317@qq.com
|
24
|
+
* @description 判断是否为IP
|
25
|
+
* @param ip
|
26
|
+
* @returns {boolean}
|
27
|
+
*/
|
28
|
+
export function isIP(ip) {
|
29
|
+
const reg = /^(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/
|
30
|
+
return reg.test(ip)
|
31
|
+
}
|
32
|
+
|
33
|
+
/**
|
34
|
+
* @author gx12358 2539306317@qq.com
|
35
|
+
* @description 判断是否是传统网站
|
36
|
+
* @param url
|
37
|
+
* @returns {boolean}
|
38
|
+
*/
|
39
|
+
export function isUrl(url) {
|
40
|
+
const reg = /^(?:https?|ftp):\/\/(?:[a-zA-Z0-9.-]+(?::[a-zA-Z0-9.&%$-]+)*@)*(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d?)(?:\.(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]?\d)){3}|(?:[a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.(?:com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(?::\d+)*(?:\/(?:$|[\w.,?'\\+&%$#=~-]+))*$/
|
41
|
+
return reg.test(url)
|
42
|
+
}
|
43
|
+
|
44
|
+
/**
|
45
|
+
* @author gx12358 2539306317@qq.com
|
46
|
+
* @description 判断是否是小写字母
|
47
|
+
* @param value
|
48
|
+
* @returns {boolean}
|
49
|
+
*/
|
50
|
+
export function isLowerCase(value) {
|
51
|
+
const reg = /^[a-z]+$/
|
52
|
+
return reg.test(value)
|
53
|
+
}
|
54
|
+
|
55
|
+
/**
|
56
|
+
* @author gx12358 2539306317@qq.com
|
57
|
+
* @description 判断是否是大写字母
|
58
|
+
* @param value
|
59
|
+
* @returns {boolean}
|
60
|
+
*/
|
61
|
+
export function isUpperCase(value) {
|
62
|
+
const reg = /^[A-Z]+$/
|
63
|
+
return reg.test(value)
|
64
|
+
}
|
65
|
+
|
66
|
+
/**
|
67
|
+
* @author gx12358 2539306317@qq.com
|
68
|
+
* @description 判断是否是大写字母开头
|
69
|
+
* @param value
|
70
|
+
* @returns {boolean}
|
71
|
+
*/
|
72
|
+
export function isAlphabets(value) {
|
73
|
+
const reg = /^[A-Z]+$/i
|
74
|
+
return reg.test(value)
|
75
|
+
}
|
76
|
+
|
77
|
+
/**
|
78
|
+
* @author gx12358 2539306317@qq.com
|
79
|
+
* @description 判断是否是端口号
|
80
|
+
* @param value
|
81
|
+
* @returns {boolean}
|
82
|
+
*/
|
83
|
+
export function isPort(value) {
|
84
|
+
const reg = /^(?:\d|[1-9]\d|[1-9]\d{2}|[1-9]\d{3}|[1-5]\d{4}|6[0-4]\d{3}|65[0-4]\d{2}|655[0-2]\d|6553[0-5])$/
|
85
|
+
return reg.test(value)
|
86
|
+
}
|
87
|
+
|
88
|
+
/**
|
89
|
+
* @author gx12358 2539306317@qq.com
|
90
|
+
* @description 判断是否是手机号
|
91
|
+
* @param value
|
92
|
+
* @returns {boolean}
|
93
|
+
*/
|
94
|
+
export function isPhone(
|
95
|
+
value: string,
|
96
|
+
backReg?: false,
|
97
|
+
): boolean
|
98
|
+
export function isPhone(
|
99
|
+
value: string,
|
100
|
+
backReg?: true,
|
101
|
+
): RegExp
|
102
|
+
export function isPhone(value = '', backReg?: boolean) {
|
103
|
+
const reg = /^1\d{10}$/
|
104
|
+
return backReg ? reg : reg.test(value)
|
105
|
+
}
|
106
|
+
|
107
|
+
/**
|
108
|
+
* @author gx12358 2539306317@qq.com
|
109
|
+
* @description 判断是否是身份证号(第二代)
|
110
|
+
* @param value
|
111
|
+
* @returns {boolean}
|
112
|
+
*/
|
113
|
+
export function isIdCard(value) {
|
114
|
+
const reg = /^[1-9]\d{5}(?:18|19|[23]\d)\d{2}(?:0[1-9]|10|11|12)(?:[0-2][1-9]|10|20|30|31)\d{3}[0-9X]$/i
|
115
|
+
return reg.test(value)
|
116
|
+
}
|
117
|
+
|
118
|
+
/**
|
119
|
+
* @author gx12358 2539306317@qq.com
|
120
|
+
* @description 判断是否是邮箱
|
121
|
+
* @param value
|
122
|
+
* @returns {boolean}
|
123
|
+
*/
|
124
|
+
export function isEmail(
|
125
|
+
value: string,
|
126
|
+
backReg?: false,
|
127
|
+
): boolean
|
128
|
+
export function isEmail(
|
129
|
+
value: string,
|
130
|
+
backReg?: true,
|
131
|
+
): RegExp
|
132
|
+
export function isEmail(value = '', backReg?: boolean) {
|
133
|
+
const reg = /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/
|
134
|
+
return backReg ? reg : reg.test(value)
|
135
|
+
}
|
136
|
+
|
137
|
+
/**
|
138
|
+
* @author gx12358 2539306317@qq.com
|
139
|
+
* @description 判断是否中文
|
140
|
+
* @param value
|
141
|
+
* @returns {boolean}
|
142
|
+
*/
|
143
|
+
export function isChina(value) {
|
144
|
+
const reg = /^[\u4E00-\u9FA5]{2,4}$/
|
145
|
+
return reg.test(value)
|
146
|
+
}
|
147
|
+
|
148
|
+
/**
|
149
|
+
* @author gx12358 2539306317@qq.com
|
150
|
+
* @description 判断是否为空
|
151
|
+
* @param value
|
152
|
+
* @returns {boolean}
|
153
|
+
*/
|
154
|
+
export function isBlank(value) {
|
155
|
+
return (value == null || false || value === '' || value.trim() === '' || value.toLocaleLowerCase()
|
156
|
+
.trim() === 'null')
|
157
|
+
}
|
158
|
+
|
159
|
+
/**
|
160
|
+
* @author gx12358 2539306317@qq.com
|
161
|
+
* @description 判断是否为固话
|
162
|
+
* @param value
|
163
|
+
* @returns {boolean}
|
164
|
+
*/
|
165
|
+
export function isTel(value) {
|
166
|
+
const reg = /^(?:400|800)[0-9\\-]{7,10}|(?:(?:\d{4}|\d{3})[- ]?)?\d{7,8}(?:[- 转]*\d{1,4})?$/
|
167
|
+
return reg.test(value)
|
168
|
+
}
|
169
|
+
|
170
|
+
/**
|
171
|
+
* @author gx12358 2539306317@qq.com
|
172
|
+
* @description 判断经度 -180.0~+180.0(整数部分为0~180,必须输入1到5位小数)
|
173
|
+
* @param value
|
174
|
+
* @returns {boolean}
|
175
|
+
*/
|
176
|
+
export function isLongitude(value) {
|
177
|
+
const reg = /^[-|+]?(?:0?\d{1,2}\.\d{1,5}|1[0-7]?\d\.\d{1,5}|180\.0{1,5})$/
|
178
|
+
return reg.test(value)
|
179
|
+
}
|
180
|
+
|
181
|
+
/**
|
182
|
+
* @author gx12358 2539306317@qq.com
|
183
|
+
* @description 判断纬度 -90.0~+90.0(整数部分为0~90,必须输入1到5位小数)
|
184
|
+
* @param value
|
185
|
+
* @returns {boolean}
|
186
|
+
*/
|
187
|
+
export function isLatitude(value) {
|
188
|
+
const reg = /^[-|+]?(?:[0-8]?\d\.\d{1,5}|90\.0{1,5})$/
|
189
|
+
return reg.test(value)
|
190
|
+
}
|
191
|
+
|
192
|
+
/**
|
193
|
+
* @author gx12358 2539306317@qq.com
|
194
|
+
* @description rtsp校验,只要有rtsp://
|
195
|
+
* @param value
|
196
|
+
* @returns {boolean}
|
197
|
+
*/
|
198
|
+
export function isRTSP(value) {
|
199
|
+
const reg = /^rtsp:\/\/(?:[a-z]{0,10}:.{0,10}@)?(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/
|
200
|
+
const reg1 = /^rtsp:\/\/(?:[a-z]{0,10}:.{0,10}@)?(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5]):\d{1,5}/
|
201
|
+
const reg2 = /^rtsp:\/\/(?:[a-z]{0,10}:.{0,10}@)?(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\//
|
202
|
+
return reg.test(value) || reg1.test(value) || reg2.test(value)
|
203
|
+
}
|
204
|
+
|
205
|
+
export function checkURL(URL) {
|
206
|
+
const str = URL
|
207
|
+
// eslint-disable-next-line regexp/strict
|
208
|
+
const Expression = /https?:\/\/(?:[\w-]+\.)+[\w-]+(?:\/[\w- ./?%&=]*)?/
|
209
|
+
const objExp = new RegExp(Expression)
|
210
|
+
return objExp.test(str)
|
211
|
+
}
|
@@ -0,0 +1,50 @@
|
|
1
|
+
{
|
2
|
+
"compilerOptions": {
|
3
|
+
"target": "ESNext",
|
4
|
+
"module": "ESNext",
|
5
|
+
"moduleResolution": "Node",
|
6
|
+
"jsx": "preserve",
|
7
|
+
"jsxImportSource": "vue",
|
8
|
+
"baseUrl": "./",
|
9
|
+
"strict": true,
|
10
|
+
"allowJs": true,
|
11
|
+
"sourceMap": true,
|
12
|
+
"esModuleInterop": true,
|
13
|
+
"resolveJsonModule": true,
|
14
|
+
"noUnusedLocals": true,
|
15
|
+
"noUnusedParameters": true,
|
16
|
+
"lib": ["DOM", "ESNext"],
|
17
|
+
"types": ["vite/client", "unplugin-turbo-console/client"],
|
18
|
+
"noImplicitAny": false,
|
19
|
+
"skipLibCheck": true,
|
20
|
+
"strictFunctionTypes": false,
|
21
|
+
"experimentalDecorators": true,
|
22
|
+
"allowSyntheticDefaultImports": true,
|
23
|
+
"forceConsistentCasingInFileNames": true,
|
24
|
+
"paths": {
|
25
|
+
"@/*": ["src/*"],
|
26
|
+
"@gx-mock": ["mock/index.ts"],
|
27
|
+
"@gx-mock/*": ["mock/*"],
|
28
|
+
"@gx-config": ["config/index.ts"],
|
29
|
+
"@gx-vuex": ["src/store/index.ts"],
|
30
|
+
"@gx-mobile/hooks/*": ["src/hooks/*"],
|
31
|
+
"@gx-admin/vite-config/*": ["internal/vite-config/*"],
|
32
|
+
}
|
33
|
+
},
|
34
|
+
"include": [
|
35
|
+
"tests/**/*.ts",
|
36
|
+
"src/**/*.ts",
|
37
|
+
"src/**/*.less",
|
38
|
+
"src/**/*.d.ts",
|
39
|
+
"src/**/*.tsx",
|
40
|
+
"src/**/*.vue",
|
41
|
+
"types/*.d.ts",
|
42
|
+
"types/*.ts",
|
43
|
+
"internal/**/*.ts",
|
44
|
+
"internal/**/*.d.ts",
|
45
|
+
"mock/*.ts",
|
46
|
+
"mock/**/*.ts",
|
47
|
+
"vite.config.ts"
|
48
|
+
],
|
49
|
+
"exclude": ["node_modules", "dist", "**/*.js"]
|
50
|
+
}
|
@@ -0,0 +1,80 @@
|
|
1
|
+
/* eslint-disable */
|
2
|
+
/* prettier-ignore */
|
3
|
+
// @ts-nocheck
|
4
|
+
// noinspection JSUnusedGlobalSymbols
|
5
|
+
// Generated by unplugin-auto-import
|
6
|
+
// biome-ignore lint: disable
|
7
|
+
export {}
|
8
|
+
declare global {
|
9
|
+
const EffectScope: typeof import('vue')['EffectScope']
|
10
|
+
const computed: typeof import('vue')['computed']
|
11
|
+
const createApp: typeof import('vue')['createApp']
|
12
|
+
const customRef: typeof import('vue')['customRef']
|
13
|
+
const defineAsyncComponent: typeof import('vue')['defineAsyncComponent']
|
14
|
+
const defineComponent: typeof import('vue')['defineComponent']
|
15
|
+
const effectScope: typeof import('vue')['effectScope']
|
16
|
+
const getCurrentInstance: typeof import('vue')['getCurrentInstance']
|
17
|
+
const getCurrentScope: typeof import('vue')['getCurrentScope']
|
18
|
+
const h: typeof import('vue')['h']
|
19
|
+
const inject: typeof import('vue')['inject']
|
20
|
+
const isProxy: typeof import('vue')['isProxy']
|
21
|
+
const isReactive: typeof import('vue')['isReactive']
|
22
|
+
const isReadonly: typeof import('vue')['isReadonly']
|
23
|
+
const isRef: typeof import('vue')['isRef']
|
24
|
+
const markRaw: typeof import('vue')['markRaw']
|
25
|
+
const nextTick: typeof import('vue')['nextTick']
|
26
|
+
const onActivated: typeof import('vue')['onActivated']
|
27
|
+
const onBeforeMount: typeof import('vue')['onBeforeMount']
|
28
|
+
const onBeforeRouteLeave: typeof import('vue-router')['onBeforeRouteLeave']
|
29
|
+
const onBeforeRouteUpdate: typeof import('vue-router')['onBeforeRouteUpdate']
|
30
|
+
const onBeforeUnmount: typeof import('vue')['onBeforeUnmount']
|
31
|
+
const onBeforeUpdate: typeof import('vue')['onBeforeUpdate']
|
32
|
+
const onDeactivated: typeof import('vue')['onDeactivated']
|
33
|
+
const onErrorCaptured: typeof import('vue')['onErrorCaptured']
|
34
|
+
const onMounted: typeof import('vue')['onMounted']
|
35
|
+
const onRenderTracked: typeof import('vue')['onRenderTracked']
|
36
|
+
const onRenderTriggered: typeof import('vue')['onRenderTriggered']
|
37
|
+
const onScopeDispose: typeof import('vue')['onScopeDispose']
|
38
|
+
const onServerPrefetch: typeof import('vue')['onServerPrefetch']
|
39
|
+
const onUnmounted: typeof import('vue')['onUnmounted']
|
40
|
+
const onUpdated: typeof import('vue')['onUpdated']
|
41
|
+
const onWatcherCleanup: typeof import('vue')['onWatcherCleanup']
|
42
|
+
const provide: typeof import('vue')['provide']
|
43
|
+
const reactive: typeof import('vue')['reactive']
|
44
|
+
const readonly: typeof import('vue')['readonly']
|
45
|
+
const ref: typeof import('vue')['ref']
|
46
|
+
const resolveComponent: typeof import('vue')['resolveComponent']
|
47
|
+
const setupStore: typeof import('../src/store/index')['setupStore']
|
48
|
+
const shallowReactive: typeof import('vue')['shallowReactive']
|
49
|
+
const shallowReadonly: typeof import('vue')['shallowReadonly']
|
50
|
+
const shallowRef: typeof import('vue')['shallowRef']
|
51
|
+
const toRaw: typeof import('vue')['toRaw']
|
52
|
+
const toRef: typeof import('vue')['toRef']
|
53
|
+
const toRefs: typeof import('vue')['toRefs']
|
54
|
+
const toValue: typeof import('vue')['toValue']
|
55
|
+
const triggerRef: typeof import('vue')['triggerRef']
|
56
|
+
const unref: typeof import('vue')['unref']
|
57
|
+
const useAttrs: typeof import('vue')['useAttrs']
|
58
|
+
const useCssModule: typeof import('vue')['useCssModule']
|
59
|
+
const useCssVars: typeof import('vue')['useCssVars']
|
60
|
+
const useId: typeof import('vue')['useId']
|
61
|
+
const useLink: typeof import('vue-router')['useLink']
|
62
|
+
const useModel: typeof import('vue')['useModel']
|
63
|
+
const useRoute: typeof import('vue-router')['useRoute']
|
64
|
+
const useRouter: typeof import('vue-router')['useRouter']
|
65
|
+
const useSlots: typeof import('vue')['useSlots']
|
66
|
+
const useStore: typeof import('../src/store/index')['useStore']
|
67
|
+
const useStoreGlobal: typeof import('../src/store/index')['useStoreGlobal']
|
68
|
+
const useStoreUser: typeof import('../src/store/index')['useStoreUser']
|
69
|
+
const useTemplateRef: typeof import('vue')['useTemplateRef']
|
70
|
+
const watch: typeof import('vue')['watch']
|
71
|
+
const watchEffect: typeof import('vue')['watchEffect']
|
72
|
+
const watchPostEffect: typeof import('vue')['watchPostEffect']
|
73
|
+
const watchSyncEffect: typeof import('vue')['watchSyncEffect']
|
74
|
+
}
|
75
|
+
// for type re-export
|
76
|
+
declare global {
|
77
|
+
// @ts-ignore
|
78
|
+
export type { Component, ComponentPublicInstance, ComputedRef, DirectiveBinding, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, MaybeRef, MaybeRefOrGetter, VNode, WritableComputedRef } from 'vue'
|
79
|
+
import('vue')
|
80
|
+
}
|
@@ -0,0 +1,56 @@
|
|
1
|
+
declare interface CdnModuleList {
|
2
|
+
name: string;
|
3
|
+
globalName: string;
|
4
|
+
path: string;
|
5
|
+
css?: string;
|
6
|
+
}
|
7
|
+
|
8
|
+
declare interface SettingConfig {
|
9
|
+
servive: {
|
10
|
+
port: number;
|
11
|
+
};
|
12
|
+
build: {
|
13
|
+
publicPath: string;
|
14
|
+
outputDir: string;
|
15
|
+
assetsDir: string;
|
16
|
+
};
|
17
|
+
system: {
|
18
|
+
title: string;
|
19
|
+
shortName: string;
|
20
|
+
titleSeparator: string;
|
21
|
+
titleReverse: boolean;
|
22
|
+
routerMode: string;
|
23
|
+
appInit: {
|
24
|
+
loading: false | {
|
25
|
+
text: string;
|
26
|
+
}
|
27
|
+
};
|
28
|
+
routesWhiteList: string[];
|
29
|
+
loginInterception: boolean;
|
30
|
+
loginRSA: boolean;
|
31
|
+
};
|
32
|
+
cdn: {
|
33
|
+
use: boolean;
|
34
|
+
url: string;
|
35
|
+
modules?: CdnModuleList[]
|
36
|
+
};
|
37
|
+
proxy: {
|
38
|
+
use: boolean;
|
39
|
+
target: string | Record<string, any>;
|
40
|
+
};
|
41
|
+
mock: {
|
42
|
+
prefix: string;
|
43
|
+
// 0 校验是否有token值 1 校验是否有token值且token时有效的(mock用户) -1 不校验
|
44
|
+
checkToken: -1 | 0 | 1;
|
45
|
+
};
|
46
|
+
token: {
|
47
|
+
name: string;
|
48
|
+
storage: 'localStorage' | 'sessionStorage' | 'cookie';
|
49
|
+
storageName: string;
|
50
|
+
};
|
51
|
+
}
|
52
|
+
|
53
|
+
declare interface NetworkConfig {
|
54
|
+
requestTimeout: number;
|
55
|
+
successCode: (string | number)[];
|
56
|
+
}
|
@@ -0,0 +1,80 @@
|
|
1
|
+
import type { DeepPartial, ProAliasToken as GProAliasToken } from '@gx-design-vue/pro-provider'
|
2
|
+
import type {
|
3
|
+
CustomRenderResult as GCustomRenderResult,
|
4
|
+
ProColumnsType as GProColumnsType,
|
5
|
+
ProColumnType as GProColumnType,
|
6
|
+
ProTableBodyCellProps as GProTableBodyCellProps
|
7
|
+
} from '@gx-design-vue/pro-table'
|
8
|
+
import type { RecordType } from '@gx-design-vue/pro-utils'
|
9
|
+
import type { PropType, CSSProperties as VueCSSProperties } from 'vue'
|
10
|
+
|
11
|
+
declare global {
|
12
|
+
const __APP_INFO__: {
|
13
|
+
pkg: {
|
14
|
+
name: string
|
15
|
+
version: string
|
16
|
+
dependencies: Recordable<string>
|
17
|
+
devDependencies: Recordable<string>
|
18
|
+
}
|
19
|
+
lastBuildTime: string
|
20
|
+
}
|
21
|
+
|
22
|
+
declare interface LocalResult {
|
23
|
+
value: any
|
24
|
+
time: string
|
25
|
+
expired: number
|
26
|
+
}
|
27
|
+
|
28
|
+
declare type ProAliasToken = DeepPartial<GProAliasToken>
|
29
|
+
declare type ProColumnType<DataValue = any, SearchParama = RecordType> = GProColumnType<
|
30
|
+
DataValue,
|
31
|
+
SearchParama
|
32
|
+
>
|
33
|
+
declare type ProColumnsType<DataValue = any, SearchParama = RecordType> = GProColumnsType<
|
34
|
+
DataValue,
|
35
|
+
SearchParama
|
36
|
+
>
|
37
|
+
declare type ProTableBodyCellProps<T = Record<string, any>> = GProTableBodyCellProps<T>
|
38
|
+
declare type CustomRenderResult<T = Record<string, any>> = GCustomRenderResult<T>
|
39
|
+
|
40
|
+
// vue
|
41
|
+
declare type VuePropType<T> = PropType<T>
|
42
|
+
declare type CSSProperties = VueCSSProperties
|
43
|
+
|
44
|
+
declare type Recordable<T = any> = Record<string, T>
|
45
|
+
|
46
|
+
declare interface Fn<T = any, R = T> {
|
47
|
+
(...arg: T[]): R
|
48
|
+
}
|
49
|
+
|
50
|
+
declare interface ViteEnv {
|
51
|
+
VITE_PORT: number
|
52
|
+
VITE_IP_ADRESS: string
|
53
|
+
VITE_USE_MODE: 'development' | 'production' | 'pro'
|
54
|
+
// proxy 配置
|
55
|
+
VITE_PROXY_PREFIX: string;
|
56
|
+
// 全局 mock 开关
|
57
|
+
VITE_IS_MOCK: boolean
|
58
|
+
// 是否使用vconsole
|
59
|
+
VITE_USE_V_CONSOLE: boolean
|
60
|
+
VITE_USE_MOCK: boolean
|
61
|
+
VITE_NODE_ENV: 'development' | 'production'
|
62
|
+
VITE_BASE_URL: string
|
63
|
+
VITE_UPLOAD_PATH: string
|
64
|
+
VITE_APP_ENV: 'dev' | 'pro'
|
65
|
+
VUE_APP_VERSION: string
|
66
|
+
VITE_PROXY: [ string, string ][]
|
67
|
+
VITE_DROP_CONSOLE: boolean
|
68
|
+
VITE_BUILD_COMPRESS: 'gzip' | 'brotli' | 'none'
|
69
|
+
VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE: boolean
|
70
|
+
VITE_LEGACY: boolean
|
71
|
+
VITE_HOME_PAGE: string // 主页
|
72
|
+
}
|
73
|
+
|
74
|
+
interface Window {
|
75
|
+
editorConfig: {
|
76
|
+
isFirstRenderCropUpdated?: boolean
|
77
|
+
}
|
78
|
+
FilerobotImageEditor?: any
|
79
|
+
}
|
80
|
+
}
|
@@ -0,0 +1,34 @@
|
|
1
|
+
import { IncomingHttpHeaders, IncomingMessage as IncomingMessage$1, ServerResponse } from 'node:http'
|
2
|
+
|
3
|
+
interface IncomingMessage extends IncomingMessage$1 {
|
4
|
+
originalUrl?: IncomingMessage$1['url'];
|
5
|
+
}
|
6
|
+
|
7
|
+
type UppercaseHttpMethodType = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'HEAD' | 'OPTIONS' | 'CONNECT' | 'TRACE'
|
8
|
+
type lowercase<T extends string> = T extends Uppercase<T> ? Lowercase<T> : T
|
9
|
+
type LowercaseHttpMethod = lowercase<UppercaseHttpMethodType>
|
10
|
+
|
11
|
+
declare global {
|
12
|
+
type HttpMethodType = UppercaseHttpMethodType | LowercaseHttpMethod
|
13
|
+
|
14
|
+
export interface MockResponse {
|
15
|
+
body: any;
|
16
|
+
query: any;
|
17
|
+
headers: RequestHeater
|
18
|
+
}
|
19
|
+
|
20
|
+
interface RequestHeater extends IncomingHttpHeaders {
|
21
|
+
[key: string]: any;
|
22
|
+
}
|
23
|
+
|
24
|
+
interface FakeRouteConfig {
|
25
|
+
url: string;
|
26
|
+
method?: HttpMethodType;
|
27
|
+
timeout?: number;
|
28
|
+
statusCode?: number;
|
29
|
+
statusText?: string;
|
30
|
+
headers?: RequestHeater;
|
31
|
+
response?: (processedRequest: MockResponse, req: IncomingMessage, res: ServerResponse) => any;
|
32
|
+
rawResponse?: (req: IncomingMessage, res: ServerResponse) => void;
|
33
|
+
}
|
34
|
+
}
|
@@ -0,0 +1,61 @@
|
|
1
|
+
declare module '*.svg'
|
2
|
+
declare module '*.png'
|
3
|
+
declare module '*.jpg'
|
4
|
+
declare module '*.jpeg'
|
5
|
+
declare module '*.gif'
|
6
|
+
declare module '*.bmp'
|
7
|
+
declare module '*.tiff'
|
8
|
+
|
9
|
+
/// <reference types="unplugin-turbo-console/client" />
|
10
|
+
|
11
|
+
/// <reference types="vite/client" />
|
12
|
+
declare module '*.vue' {
|
13
|
+
import type { DefineComponent } from 'vue'
|
14
|
+
|
15
|
+
const Component: DefineComponent<Record<any, any>, Record<any, any>, any>
|
16
|
+
export default component
|
17
|
+
}
|
18
|
+
|
19
|
+
declare module '@gx-design-vue/pro-utils' {
|
20
|
+
export * from '@gx-design-vue/pro-utils/dist'
|
21
|
+
}
|
22
|
+
|
23
|
+
declare module '@gx-design-vue/pro-hooks' {
|
24
|
+
export * from '@gx-design-vue/pro-hooks/dist'
|
25
|
+
}
|
26
|
+
|
27
|
+
declare module 'diagram-js/lib/navigation/movecanvas' {}
|
28
|
+
declare module '@multiavatar/multiavatar/esm' {
|
29
|
+
export default function multiavatar(id: any): string
|
30
|
+
}
|
31
|
+
|
32
|
+
declare module '*.tsx' {
|
33
|
+
import Vue from 'compatible-vue'
|
34
|
+
|
35
|
+
export default Vue
|
36
|
+
}
|
37
|
+
|
38
|
+
declare module 'virtual:*' {
|
39
|
+
const result: any
|
40
|
+
export default result
|
41
|
+
}
|
42
|
+
|
43
|
+
declare global {
|
44
|
+
namespace JSX {
|
45
|
+
interface Element extends VNode {}
|
46
|
+
|
47
|
+
interface ElementClass extends Vue {}
|
48
|
+
|
49
|
+
interface ElementAttributesProperty {
|
50
|
+
$props: any
|
51
|
+
}
|
52
|
+
|
53
|
+
interface IntrinsicElements {
|
54
|
+
[elem: string]: any
|
55
|
+
}
|
56
|
+
|
57
|
+
interface IntrinsicAttributes {
|
58
|
+
[elem: string]: any
|
59
|
+
}
|
60
|
+
}
|
61
|
+
}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
declare interface DefaultResult<T> {
|
2
|
+
code: number;
|
3
|
+
msg?: string;
|
4
|
+
message?: string;
|
5
|
+
data: T;
|
6
|
+
rows: T[];
|
7
|
+
total?: number;
|
8
|
+
}
|
9
|
+
|
10
|
+
declare type ResponseResult<T = any, R = undefined> = R extends undefined
|
11
|
+
? DefaultResult<T>
|
12
|
+
: DefaultResult<T> & R
|
13
|
+
|
14
|
+
declare interface PageResult<T> {
|
15
|
+
list: T[];
|
16
|
+
totalCount: number;
|
17
|
+
}
|
@@ -0,0 +1,58 @@
|
|
1
|
+
import type { RouteRecordRaw } from 'vue-router'
|
2
|
+
|
3
|
+
declare global {
|
4
|
+
interface UserInfo {
|
5
|
+
deptType?: 'government' | 'enterprise';
|
6
|
+
roles: string[];
|
7
|
+
permissions: string[];
|
8
|
+
user: UserDetails;
|
9
|
+
}
|
10
|
+
|
11
|
+
interface UserDetails {
|
12
|
+
createBy?: string
|
13
|
+
createTime?: string
|
14
|
+
updateBy?: string
|
15
|
+
updateTime?: string
|
16
|
+
remark?: string
|
17
|
+
userId?: number
|
18
|
+
deptId?: number
|
19
|
+
userName?: string
|
20
|
+
nickName: string
|
21
|
+
address: string
|
22
|
+
email: string
|
23
|
+
phonenumber: string
|
24
|
+
sex?: string // 假设 '1' 代表某种性别,可能需要进一步定义
|
25
|
+
avatar?: string
|
26
|
+
password?: string
|
27
|
+
status?: string
|
28
|
+
delFlag?: string
|
29
|
+
loginIp?: string
|
30
|
+
loginDate?: string // ISO 8601 格式
|
31
|
+
dept?: DepartBaseInfo
|
32
|
+
roles?: RoleInfo[] // 根据具体结构可进一步定义
|
33
|
+
roleIds?: number[]
|
34
|
+
postIds?: number[]
|
35
|
+
roleId?: number
|
36
|
+
admin?: boolean
|
37
|
+
}
|
38
|
+
|
39
|
+
interface AppRouteRecordRaw {
|
40
|
+
meta?: {
|
41
|
+
icon?: string;
|
42
|
+
name?: string;
|
43
|
+
isMenu?: boolean;
|
44
|
+
menuSelectKey?: string;
|
45
|
+
};
|
46
|
+
children?: AppRouteRecordRaw[];
|
47
|
+
}
|
48
|
+
|
49
|
+
export type AppRouteModule = AppRouteRecordRaw & RouteRecordRaw
|
50
|
+
|
51
|
+
interface DefaultTableRecord {
|
52
|
+
id: any;
|
53
|
+
uuid: string;
|
54
|
+
createTime?: string | null;
|
55
|
+
}
|
56
|
+
|
57
|
+
type TableRecord<T = undefined> = T extends undefined ? DefaultTableRecord : DefaultTableRecord & T
|
58
|
+
}
|
@@ -0,0 +1,25 @@
|
|
1
|
+
/* eslint-disable */
|
2
|
+
// @ts-nocheck
|
3
|
+
// Generated by unplugin-vue-components
|
4
|
+
// Read more: https://github.com/vuejs/core/pull/3399
|
5
|
+
export {}
|
6
|
+
|
7
|
+
/* prettier-ignore */
|
8
|
+
declare module 'vue' {
|
9
|
+
export interface GlobalComponents {
|
10
|
+
RouterLink: typeof import('vue-router')['RouterLink']
|
11
|
+
RouterView: typeof import('vue-router')['RouterView']
|
12
|
+
TabsMenu: typeof import('./../src/components/TabsMenu/index.vue')['default']
|
13
|
+
VanButton: typeof import('vant/es')['Button']
|
14
|
+
VanCellGroup: typeof import('vant/es')['CellGroup']
|
15
|
+
VanConfigProvider: typeof import('vant/es')['ConfigProvider']
|
16
|
+
VanField: typeof import('vant/es')['Field']
|
17
|
+
VanForm: typeof import('vant/es')['Form']
|
18
|
+
VanIcon: typeof import('vant/es')['Icon']
|
19
|
+
VanImage: typeof import('vant/es')['Image']
|
20
|
+
VanProgress: typeof import('vant/es')['Progress']
|
21
|
+
VanTabbar: typeof import('vant/es')['Tabbar']
|
22
|
+
VanTabbarItem: typeof import('vant/es')['TabbarItem']
|
23
|
+
VanTag: typeof import('vant/es')['Tag']
|
24
|
+
}
|
25
|
+
}
|