generator-mico-cli 0.2.33 → 1.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/README.md +6 -0
- package/generators/micro-react/README.md +1 -1
- package/generators/micro-react/index.js +9 -18
- package/generators/micro-react/templates/apps/layout/docs/feature-/344/270/273/351/242/230/350/211/262/345/210/207/346/215/242.md +1 -1
- package/generators/micro-react/templates/apps/layout/docs/feature-/345/276/256/345/211/215/347/253/257/346/250/241/345/274/217.md +1 -1
- package/generators/micro-react/templates/apps/layout/package.json +1 -0
- package/generators/micro-react/templates/apps/layout/src/app.tsx +5 -3
- package/generators/micro-react/templates/apps/layout/src/common/logger.ts +1 -1
- package/generators/micro-react/templates/apps/layout/src/components/AppTabs/index.less +4 -4
- package/generators/micro-react/templates/apps/layout/src/components/MicroAppLoader/index.tsx +7 -3
- package/generators/micro-react/templates/apps/layout/src/components/RightContent/avatar-dropdown.less +5 -5
- package/generators/micro-react/templates/apps/layout/src/components/RightContent/tenant-dropdown.less +4 -4
- package/generators/micro-react/templates/apps/layout/src/global.less +1 -2
- package/generators/micro-react/templates/apps/layout/src/layouts/components/header/index.less +17 -17
- package/generators/micro-react/templates/apps/layout/src/layouts/components/menu/index.less +15 -15
- package/generators/micro-react/templates/apps/layout/src/layouts/index.less +16 -16
- package/generators/micro-react/templates/apps/layout/src/layouts/index.tsx +3 -4
- package/generators/micro-react/templates/apps/layout/src/pages/Home/index.less +3 -3
- package/generators/micro-react/templates/apps/layout/src/pages/User/Login/index.less +46 -40
- package/generators/micro-react/templates/packages/common-intl/README.md +3 -2
- package/generators/subapp-react/index.js +10 -19
- package/generators/subapp-react/templates/homepage/config/config.dev.ts +1 -47
- package/generators/subapp-react/templates/homepage/package.json +1 -0
- package/generators/subapp-react/templates/homepage/src/app.tsx +10 -0
- package/generators/subapp-react/templates/homepage/src/common/logger.ts +1 -1
- package/generators/subapp-react/templates/homepage/src/global.less +1 -1
- package/generators/subapp-react/templates/homepage/src/pages/index.less +31 -31
- package/generators/subapp-react/templates/homepage/src/pages/index.tsx +2 -2
- package/generators/subapp-umd/index.js +6 -0
- package/generators/subapp-umd/templates/package.json +1 -1
- package/lib/utils.js +197 -0
- package/package.json +5 -1
|
@@ -7,9 +7,12 @@
|
|
|
7
7
|
width: 100%;
|
|
8
8
|
overflow: hidden;
|
|
9
9
|
position: relative;
|
|
10
|
-
background-color: @
|
|
11
|
-
background-image:
|
|
12
|
-
|
|
10
|
+
background-color: @fill-2;
|
|
11
|
+
background-image: radial-gradient(
|
|
12
|
+
at 10% 10%,
|
|
13
|
+
rgba(22, 93, 255, 0.08) 0%,
|
|
14
|
+
transparent 60%
|
|
15
|
+
),
|
|
13
16
|
radial-gradient(at 90% 90%, rgba(22, 93, 255, 0.08) 0%, transparent 60%);
|
|
14
17
|
}
|
|
15
18
|
|
|
@@ -32,8 +35,8 @@
|
|
|
32
35
|
width: 100%;
|
|
33
36
|
max-width: 420px;
|
|
34
37
|
padding: 48px;
|
|
35
|
-
background: @
|
|
36
|
-
border-radius: @border-radius-
|
|
38
|
+
background: @text-5;
|
|
39
|
+
border-radius: @border-radius-md;
|
|
37
40
|
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
|
|
38
41
|
transition: all 0.3s ease-in-out;
|
|
39
42
|
|
|
@@ -53,7 +56,7 @@
|
|
|
53
56
|
width: 56px;
|
|
54
57
|
height: 56px;
|
|
55
58
|
margin-bottom: 16px;
|
|
56
|
-
color: @
|
|
59
|
+
color: @brand2-6;
|
|
57
60
|
|
|
58
61
|
svg {
|
|
59
62
|
filter: drop-shadow(0 4px 8px rgba(22, 93, 255, 0.2));
|
|
@@ -69,14 +72,14 @@
|
|
|
69
72
|
font-size: 24px;
|
|
70
73
|
font-weight: 600;
|
|
71
74
|
line-height: 32px;
|
|
72
|
-
color: @
|
|
75
|
+
color: @text-1;
|
|
73
76
|
}
|
|
74
77
|
|
|
75
78
|
.subTitle {
|
|
76
79
|
margin-top: 8px;
|
|
77
80
|
font-size: 14px;
|
|
78
81
|
line-height: 22px;
|
|
79
|
-
color: @
|
|
82
|
+
color: @text-3;
|
|
80
83
|
display: block;
|
|
81
84
|
}
|
|
82
85
|
|
|
@@ -87,25 +90,25 @@
|
|
|
87
90
|
border-radius: @border-radius-sm;
|
|
88
91
|
padding-top: 6px;
|
|
89
92
|
padding-bottom: 6px;
|
|
90
|
-
border: 1px solid @
|
|
93
|
+
border: 1px solid @line-2;
|
|
91
94
|
transition: all 0.2s;
|
|
92
95
|
|
|
93
96
|
input {
|
|
94
97
|
background: transparent;
|
|
95
98
|
|
|
96
99
|
&::placeholder {
|
|
97
|
-
color: @
|
|
100
|
+
color: @text-3;
|
|
98
101
|
}
|
|
99
102
|
}
|
|
100
103
|
|
|
101
104
|
&:hover {
|
|
102
|
-
background-color: @
|
|
103
|
-
border-color: @
|
|
105
|
+
background-color: @fill-2;
|
|
106
|
+
border-color: @brand2-6;
|
|
104
107
|
}
|
|
105
108
|
|
|
106
109
|
&.arco-input-inner-wrapper-focus {
|
|
107
|
-
background-color: @
|
|
108
|
-
border-color: @
|
|
110
|
+
background-color: @text-5;
|
|
111
|
+
border-color: @brand2-6;
|
|
109
112
|
box-shadow: 0 0 0 2px rgba(22, 93, 255, 0.1);
|
|
110
113
|
}
|
|
111
114
|
}
|
|
@@ -113,7 +116,7 @@
|
|
|
113
116
|
// Input.Password 样式(边框在外层)
|
|
114
117
|
.arco-input-password {
|
|
115
118
|
border-radius: @border-radius-sm;
|
|
116
|
-
border: 1px solid @
|
|
119
|
+
border: 1px solid @line-2;
|
|
117
120
|
transition: all 0.2s;
|
|
118
121
|
|
|
119
122
|
// 内层不要边框,但保持 padding
|
|
@@ -136,18 +139,18 @@
|
|
|
136
139
|
background: transparent;
|
|
137
140
|
|
|
138
141
|
&::placeholder {
|
|
139
|
-
color: @
|
|
142
|
+
color: @text-3;
|
|
140
143
|
}
|
|
141
144
|
}
|
|
142
145
|
|
|
143
146
|
&:hover {
|
|
144
|
-
background-color: @
|
|
145
|
-
border-color: @
|
|
147
|
+
background-color: @fill-2;
|
|
148
|
+
border-color: @brand2-6;
|
|
146
149
|
}
|
|
147
150
|
|
|
148
151
|
&-focus {
|
|
149
|
-
background-color: @
|
|
150
|
-
border-color: @
|
|
152
|
+
background-color: @text-5;
|
|
153
|
+
border-color: @brand2-6;
|
|
151
154
|
box-shadow: 0 0 0 2px rgba(22, 93, 255, 0.1);
|
|
152
155
|
}
|
|
153
156
|
}
|
|
@@ -157,12 +160,12 @@
|
|
|
157
160
|
font-size: 16px;
|
|
158
161
|
font-weight: 500;
|
|
159
162
|
border-radius: @border-radius-sm;
|
|
160
|
-
background: linear-gradient(90deg, @
|
|
163
|
+
background: linear-gradient(90deg, @brand2-6 0%, @brand2-5 100%);
|
|
161
164
|
border: none;
|
|
162
165
|
box-shadow: 0 4px 10px rgba(24, 144, 255, 0.2);
|
|
163
166
|
|
|
164
167
|
&:hover {
|
|
165
|
-
background: linear-gradient(90deg, @
|
|
168
|
+
background: linear-gradient(90deg, @brand2-7 0%, @brand2-6 100%);
|
|
166
169
|
box-shadow: 0 6px 16px rgba(24, 144, 255, 0.28);
|
|
167
170
|
}
|
|
168
171
|
}
|
|
@@ -178,15 +181,18 @@
|
|
|
178
181
|
}
|
|
179
182
|
|
|
180
183
|
.copyright {
|
|
181
|
-
color: @
|
|
184
|
+
color: @text-3;
|
|
182
185
|
font-size: 12px;
|
|
183
186
|
}
|
|
184
187
|
|
|
185
188
|
body[data-theme='dark'] {
|
|
186
189
|
.container {
|
|
187
|
-
background-color: @
|
|
188
|
-
background-image:
|
|
189
|
-
|
|
190
|
+
background-color: @fill-1;
|
|
191
|
+
background-image: radial-gradient(
|
|
192
|
+
at 10% 10%,
|
|
193
|
+
rgba(24, 144, 255, 0.12) 0%,
|
|
194
|
+
transparent 60%
|
|
195
|
+
),
|
|
190
196
|
radial-gradient(at 90% 90%, rgba(24, 144, 255, 0.12) 0%, transparent 60%);
|
|
191
197
|
}
|
|
192
198
|
|
|
@@ -196,12 +202,12 @@ body[data-theme='dark'] {
|
|
|
196
202
|
}
|
|
197
203
|
|
|
198
204
|
.content {
|
|
199
|
-
background: @
|
|
205
|
+
background: @fill-2;
|
|
200
206
|
box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
|
|
201
207
|
}
|
|
202
208
|
|
|
203
209
|
.logo {
|
|
204
|
-
color: @
|
|
210
|
+
color: @brand2-5;
|
|
205
211
|
|
|
206
212
|
svg {
|
|
207
213
|
filter: drop-shadow(0 4px 10px rgba(24, 144, 255, 0.45));
|
|
@@ -211,30 +217,30 @@ body[data-theme='dark'] {
|
|
|
211
217
|
.form {
|
|
212
218
|
:global {
|
|
213
219
|
.arco-input-inner-wrapper {
|
|
214
|
-
border: 1px solid @
|
|
220
|
+
border: 1px solid @line-1;
|
|
215
221
|
|
|
216
222
|
input {
|
|
217
223
|
background: transparent;
|
|
218
224
|
|
|
219
225
|
&::placeholder {
|
|
220
|
-
color: @
|
|
226
|
+
color: @text-4;
|
|
221
227
|
}
|
|
222
228
|
}
|
|
223
229
|
|
|
224
230
|
&:hover {
|
|
225
|
-
background-color: @
|
|
226
|
-
border-color: @
|
|
231
|
+
background-color: @fill-2;
|
|
232
|
+
border-color: @brand2-6;
|
|
227
233
|
}
|
|
228
234
|
|
|
229
235
|
&.arco-input-inner-wrapper-focus {
|
|
230
|
-
background-color: @
|
|
231
|
-
border-color: @
|
|
236
|
+
background-color: @fill-1;
|
|
237
|
+
border-color: @brand2-6;
|
|
232
238
|
box-shadow: 0 0 0 2px rgba(22, 93, 255, 0.2);
|
|
233
239
|
}
|
|
234
240
|
}
|
|
235
241
|
|
|
236
242
|
.arco-input-password {
|
|
237
|
-
border: 1px solid @
|
|
243
|
+
border: 1px solid @line-1;
|
|
238
244
|
|
|
239
245
|
.arco-input-inner-wrapper {
|
|
240
246
|
border: none;
|
|
@@ -255,18 +261,18 @@ body[data-theme='dark'] {
|
|
|
255
261
|
background: transparent;
|
|
256
262
|
|
|
257
263
|
&::placeholder {
|
|
258
|
-
color: @
|
|
264
|
+
color: @text-4;
|
|
259
265
|
}
|
|
260
266
|
}
|
|
261
267
|
|
|
262
268
|
&:hover {
|
|
263
|
-
background-color: @
|
|
264
|
-
border-color: @
|
|
269
|
+
background-color: @fill-2;
|
|
270
|
+
border-color: @brand2-6;
|
|
265
271
|
}
|
|
266
272
|
|
|
267
273
|
&-focus {
|
|
268
|
-
background-color: @
|
|
269
|
-
border-color: @
|
|
274
|
+
background-color: @fill-1;
|
|
275
|
+
border-color: @brand2-6;
|
|
270
276
|
box-shadow: 0 0 0 2px rgba(22, 93, 255, 0.2);
|
|
271
277
|
}
|
|
272
278
|
}
|
|
@@ -43,14 +43,15 @@ const { fetchMultilingualData, i18n } = initIntl({
|
|
|
43
43
|
主应用(`apps/layout`)在 `app.tsx` 的 `render` 函数中调用 `fetchMultilingualData`,确保渲染前完成多语言数据加载:
|
|
44
44
|
|
|
45
45
|
```typescript
|
|
46
|
+
import { Message } from '@mico-platform/ui';
|
|
46
47
|
import { fetchMultilingualData, getCurrentLocale, type ILang } from '<%= packageScope %>/common-intl';
|
|
47
48
|
|
|
48
49
|
export function render(oldRender: () => void): void {
|
|
49
50
|
fetchMultilingualData({
|
|
50
51
|
requestInstance: commonRequest,
|
|
51
52
|
messageInstance: {
|
|
52
|
-
error:
|
|
53
|
-
warning:
|
|
53
|
+
error: Message.error,
|
|
54
|
+
warning: Message.warning,
|
|
54
55
|
},
|
|
55
56
|
lang: getCurrentLocale() as ILang,
|
|
56
57
|
localeRequestUrl: process.env.LOCALE_REQUEST_URL,
|
|
@@ -9,7 +9,7 @@ const {
|
|
|
9
9
|
collectFiles,
|
|
10
10
|
transformDestPath,
|
|
11
11
|
isTemplateFile,
|
|
12
|
-
|
|
12
|
+
getMicoTemplateVersions,
|
|
13
13
|
detectPackageScope,
|
|
14
14
|
setupErrorHandlers,
|
|
15
15
|
createLogger,
|
|
@@ -147,23 +147,14 @@ module.exports = class extends Generator {
|
|
|
147
147
|
|
|
148
148
|
// 在 mico_cli 根目录执行 npm view,以使用该目录 .npmrc 中的 Nexus 认证
|
|
149
149
|
const cliRoot = path.resolve(__dirname, '../..');
|
|
150
|
-
this.logger.verbose('Fetching
|
|
151
|
-
|
|
152
|
-
// 并行获取版本
|
|
153
|
-
const versions = await getPackageVersionsParallel(
|
|
154
|
-
[
|
|
155
|
-
{ name: '@mico-platform/ui', fallback: '1.0.0' },
|
|
156
|
-
{ name: '@mico-platform/theme', fallback: '1.0.0' },
|
|
157
|
-
],
|
|
158
|
-
8000,
|
|
159
|
-
cliRoot,
|
|
160
|
-
);
|
|
150
|
+
this.logger.verbose('Fetching mico package versions from manifest...');
|
|
161
151
|
|
|
162
|
-
const
|
|
163
|
-
const
|
|
152
|
+
const micoVersions = await getMicoTemplateVersions(cliRoot, 8000);
|
|
153
|
+
const ui = micoVersions['@mico-platform/ui'];
|
|
154
|
+
const theme = micoVersions['@mico-platform/theme'];
|
|
164
155
|
|
|
165
|
-
this.logger.verbose('@mico-platform/ui
|
|
166
|
-
this.logger.verbose('@mico-platform/theme
|
|
156
|
+
this.logger.verbose('@mico-platform/ui range:', ui.range, 'resolved:', ui.resolved);
|
|
157
|
+
this.logger.verbose('@mico-platform/theme range:', theme.range, 'resolved:', theme.resolved);
|
|
167
158
|
|
|
168
159
|
const templateData = {
|
|
169
160
|
appName: this.appName,
|
|
@@ -172,9 +163,9 @@ module.exports = class extends Generator {
|
|
|
172
163
|
appNameSnake: this.appName.replace(/-/g, '_'),
|
|
173
164
|
packageScope: this.packageScope,
|
|
174
165
|
devPort: this.devPort,
|
|
175
|
-
micoUiVersion: `^${
|
|
176
|
-
themeVersion: `^${
|
|
177
|
-
micoUiVersionExact:
|
|
166
|
+
micoUiVersion: `^${ui.resolved}`,
|
|
167
|
+
themeVersion: `^${theme.resolved}`,
|
|
168
|
+
micoUiVersionExact: ui.resolved,
|
|
178
169
|
};
|
|
179
170
|
|
|
180
171
|
this.logger.verbose('Template data:', JSON.stringify(templateData, null, 2));
|
|
@@ -2,17 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
import { defineConfig } from '@umijs/max';
|
|
4
4
|
|
|
5
|
-
/**
|
|
6
|
-
* ⚠️⚠️ 不要修改这个变量名,版本升级工具会读取这个变量名,进行版本升级
|
|
7
|
-
* @name mico-ui 版本
|
|
8
|
-
* @description 开发环境使用 mico-ui 的最新版本
|
|
9
|
-
*/
|
|
10
|
-
const MICO_UI_VERSION = '<%= micoUiVersionExact %>';
|
|
11
|
-
|
|
12
5
|
/**
|
|
13
6
|
* 开发环境配置
|
|
14
7
|
* - 不配置 externals,直接打包依赖,方便独立运行调试
|
|
15
8
|
* - 生产环境通过 config.prod.ts 配置 externals 复用主应用依赖
|
|
9
|
+
* - 样式由主应用 layout 提供;子应用独立运行时见 app.tsx 条件加载
|
|
16
10
|
*/
|
|
17
11
|
const config: ReturnType<typeof defineConfig> = {
|
|
18
12
|
publicPath: '/',
|
|
@@ -21,46 +15,6 @@ const config: ReturnType<typeof defineConfig> = {
|
|
|
21
15
|
define: {
|
|
22
16
|
'process.env.NODE_ENV': 'development',
|
|
23
17
|
},
|
|
24
|
-
// /**
|
|
25
|
-
// * @name 脚本加载配置
|
|
26
|
-
// * @description 开发环境独立运行时,通过 CDN 加载公共依赖
|
|
27
|
-
// * 作为微前端子应用运行时,这些库由主应用提供
|
|
28
|
-
// */
|
|
29
|
-
// headScripts: [
|
|
30
|
-
// 'https://unpkg.com/react@18/umd/react.development.js',
|
|
31
|
-
// 'https://unpkg.com/react-dom@18/umd/react-dom.development.js',
|
|
32
|
-
// 'https://unpkg.com/@mico-platform/ui@<%= micoUiVersionExact %>/dist/arco.min.js',
|
|
33
|
-
// ],
|
|
34
|
-
|
|
35
|
-
// /**
|
|
36
|
-
// * @name 样式加载配置
|
|
37
|
-
// * @description 开发环境独立运行时加载 @mico-platform/ui CSS
|
|
38
|
-
// */
|
|
39
|
-
// links: [
|
|
40
|
-
// {
|
|
41
|
-
// rel: 'stylesheet',
|
|
42
|
-
// href: 'https://unpkg.com/@mico-platform/ui@<%= micoUiVersionExact %>/dist/css/arco.min.css',
|
|
43
|
-
// },
|
|
44
|
-
// ],
|
|
45
|
-
|
|
46
|
-
// /**
|
|
47
|
-
// * @name 外部依赖配置
|
|
48
|
-
// * @description 开发环境也需要 externals,配合 CDN 使用
|
|
49
|
-
// */
|
|
50
|
-
// externals: {
|
|
51
|
-
// react: 'window.React',
|
|
52
|
-
// 'react-dom': 'window.ReactDOM',
|
|
53
|
-
// '@mico-platform/ui': 'window.micoUI',
|
|
54
|
-
// },
|
|
55
|
-
/**
|
|
56
|
-
* @name 样式加载配置
|
|
57
|
-
* @description 开发环境独立运行时加载 @mico-platform/ui CSS
|
|
58
|
-
* 作为微前端子应用运行时,样式由主应用提供
|
|
59
|
-
*/
|
|
60
|
-
styles: [
|
|
61
|
-
// @mico-platform/ui 基础样式(使用运行时解析的最新版本号,避免 latest 标签)
|
|
62
|
-
`https://cdn-portal.micoplatform.com/portal-center/mico-ui/${MICO_UI_VERSION}/ui/dist/css/mico-ui.min.css`,
|
|
63
|
-
],
|
|
64
18
|
|
|
65
19
|
/**
|
|
66
20
|
* @name MFSU 配置
|
|
@@ -38,6 +38,16 @@ import {
|
|
|
38
38
|
} from './common/intl';
|
|
39
39
|
import { getSubappCurrentLocale } from './common/intl/subappLocale';
|
|
40
40
|
|
|
41
|
+
// 子应用独立开发时加载完整 UI 样式;嵌入主应用时由 layout 全局提供
|
|
42
|
+
if (
|
|
43
|
+
process.env.NODE_ENV === 'development' &&
|
|
44
|
+
typeof window !== 'undefined' &&
|
|
45
|
+
!window.__POWERED_BY_QIANKUN__
|
|
46
|
+
) {
|
|
47
|
+
require('@mico-platform/ui/dist/css/mico-ui.min.css');
|
|
48
|
+
require('@mico-platform/theme/dist/css/theme.css');
|
|
49
|
+
}
|
|
50
|
+
|
|
41
51
|
// 子应用:将本地 request(自动桥接主应用 / 独立 umi)注入 shared 包,供共享服务层(getRequest)使用
|
|
42
52
|
// 注意:模块顶层注入,request 函数引用稳定;运行期由 request 内部根据是否处于 qiankun 选用 main / umi
|
|
43
53
|
configureRequest(request as <T = unknown>(url: string, options?: Record<string, unknown>) => Promise<T>);
|
|
@@ -23,7 +23,7 @@ function readVerboseDebugQueryOnce(): boolean {
|
|
|
23
23
|
}
|
|
24
24
|
try {
|
|
25
25
|
const v = new URLSearchParams(window.location.search).get(DEBUG_LOGS_QUERY_KEY);
|
|
26
|
-
if (v
|
|
26
|
+
if (v === null || v === '') {
|
|
27
27
|
return false;
|
|
28
28
|
}
|
|
29
29
|
const normalized = v.toLowerCase();
|
|
@@ -10,27 +10,27 @@
|
|
|
10
10
|
padding: @spacing-lg;
|
|
11
11
|
min-height: 100vh;
|
|
12
12
|
// 使用主题色变量 - 背景色会随主题切换自动变化
|
|
13
|
-
background-color: @
|
|
13
|
+
background-color: @fill-1;
|
|
14
14
|
transition: background-color 0.3s ease;
|
|
15
15
|
|
|
16
16
|
&-title {
|
|
17
17
|
font-size: @font-size-xxl;
|
|
18
18
|
font-weight: @font-weight-bold;
|
|
19
19
|
// 主要文字色 - 亮色模式为深色,暗色模式为浅色
|
|
20
|
-
color: @
|
|
20
|
+
color: @text-1;
|
|
21
21
|
margin-bottom: @spacing-md;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
&-subtitle {
|
|
25
25
|
font-size: @font-size-md;
|
|
26
26
|
// 次要文字色
|
|
27
|
-
color: @
|
|
27
|
+
color: @text-2;
|
|
28
28
|
margin-bottom: @spacing-lg;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
&-intl-hint {
|
|
32
32
|
margin-bottom: @spacing-sm;
|
|
33
|
-
color: @
|
|
33
|
+
color: @text-2;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
&-intl-meta {
|
|
@@ -41,10 +41,10 @@
|
|
|
41
41
|
&-card {
|
|
42
42
|
padding: @card-padding;
|
|
43
43
|
// 卡片背景色 - 使用 color-text-5(亮色模式为白色)
|
|
44
|
-
background-color: @
|
|
44
|
+
background-color: @text-5;
|
|
45
45
|
border-radius: @border-radius-card;
|
|
46
46
|
// 边框色
|
|
47
|
-
border: 1px solid @
|
|
47
|
+
border: 1px solid @line-2;
|
|
48
48
|
box-shadow: @shadow-card;
|
|
49
49
|
margin-bottom: @spacing-md;
|
|
50
50
|
}
|
|
@@ -67,27 +67,27 @@
|
|
|
67
67
|
width: 60px;
|
|
68
68
|
height: 60px;
|
|
69
69
|
border-radius: @border-radius-md;
|
|
70
|
-
border: 1px solid @
|
|
70
|
+
border: 1px solid @line-2;
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
&-color-label {
|
|
74
74
|
font-size: @font-size-sm;
|
|
75
|
-
color: @
|
|
75
|
+
color: @text-3;
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
// 品牌色示例
|
|
79
|
-
.brand-1 { background-color: @
|
|
80
|
-
.brand-2 { background-color: @
|
|
79
|
+
.brand-1 { background-color: @brand1-6; }
|
|
80
|
+
.brand-2 { background-color: @brand2-6; }
|
|
81
81
|
|
|
82
82
|
// 功能色示例
|
|
83
|
-
.success { background-color: @
|
|
84
|
-
.warning { background-color: @
|
|
85
|
-
.danger { background-color: @
|
|
83
|
+
.success { background-color: @success-6; }
|
|
84
|
+
.warning { background-color: @warning-6; }
|
|
85
|
+
.danger { background-color: @danger-6; }
|
|
86
86
|
|
|
87
87
|
// 中性色示例
|
|
88
|
-
.fill-1 { background-color: @
|
|
89
|
-
.fill-2 { background-color: @
|
|
90
|
-
.fill-3 { background-color: @
|
|
88
|
+
.fill-1 { background-color: @fill-1; }
|
|
89
|
+
.fill-2 { background-color: @fill-2; }
|
|
90
|
+
.fill-3 { background-color: @fill-3; }
|
|
91
91
|
|
|
92
92
|
// 按钮示例
|
|
93
93
|
&-button {
|
|
@@ -101,22 +101,22 @@
|
|
|
101
101
|
transition: all 0.2s ease;
|
|
102
102
|
|
|
103
103
|
&--primary {
|
|
104
|
-
background-color: @
|
|
105
|
-
color: @
|
|
104
|
+
background-color: @brand1-6;
|
|
105
|
+
color: @text-5;
|
|
106
106
|
border: none;
|
|
107
107
|
|
|
108
108
|
&:hover {
|
|
109
|
-
background-color: @
|
|
109
|
+
background-color: @brand1-5;
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
&--secondary {
|
|
114
114
|
background-color: transparent;
|
|
115
|
-
color: @
|
|
116
|
-
border: 1px solid @
|
|
115
|
+
color: @brand1-6;
|
|
116
|
+
border: 1px solid @brand1-6;
|
|
117
117
|
|
|
118
118
|
&:hover {
|
|
119
|
-
background-color: @
|
|
119
|
+
background-color: @brand1-1;
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
122
|
}
|
|
@@ -128,21 +128,21 @@
|
|
|
128
128
|
margin-top: @spacing-lg;
|
|
129
129
|
|
|
130
130
|
&--info {
|
|
131
|
-
background-color: @
|
|
132
|
-
border: 1px solid @
|
|
133
|
-
color: @
|
|
131
|
+
background-color: @brand2-1;
|
|
132
|
+
border: 1px solid @brand2-3;
|
|
133
|
+
color: @brand2-7;
|
|
134
134
|
}
|
|
135
135
|
|
|
136
136
|
&--success {
|
|
137
|
-
background-color: @
|
|
138
|
-
border: 1px solid @
|
|
139
|
-
color: @
|
|
137
|
+
background-color: @success-1;
|
|
138
|
+
border: 1px solid @success-3;
|
|
139
|
+
color: @success-7;
|
|
140
140
|
}
|
|
141
141
|
|
|
142
142
|
&--warning {
|
|
143
|
-
background-color: @
|
|
144
|
-
border: 1px solid @
|
|
145
|
-
color: @
|
|
143
|
+
background-color: @warning-1;
|
|
144
|
+
border: 1px solid @warning-3;
|
|
145
|
+
color: @warning-7;
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
148
|
}
|
|
@@ -246,7 +246,7 @@ export default function HomePage() {
|
|
|
246
246
|
{ label: '邮箱', value: userInfo.email },
|
|
247
247
|
{
|
|
248
248
|
label: '角色',
|
|
249
|
-
value: <Tag color="
|
|
249
|
+
value: <Tag color="dark-blue">{userInfo.role}</Tag>,
|
|
250
250
|
},
|
|
251
251
|
{ label: '部门', value: userInfo.department },
|
|
252
252
|
]}
|
|
@@ -369,7 +369,7 @@ export default function HomePage() {
|
|
|
369
369
|
<Divider />
|
|
370
370
|
|
|
371
371
|
<Space size="medium">
|
|
372
|
-
<Tag color="
|
|
372
|
+
<Tag color="dark-blue">Arco Blue</Tag>
|
|
373
373
|
<Tag color="green">Success</Tag>
|
|
374
374
|
<Tag color="gold">Warning</Tag>
|
|
375
375
|
<Tag color="red">Danger</Tag>
|
|
@@ -14,6 +14,7 @@ const {
|
|
|
14
14
|
setupErrorHandlers,
|
|
15
15
|
createLogger,
|
|
16
16
|
loadMicorc,
|
|
17
|
+
getMicoTemplateVersions,
|
|
17
18
|
} = require('../../lib/utils');
|
|
18
19
|
|
|
19
20
|
const IGNORE_LIST = require('./ignore-list.json');
|
|
@@ -145,6 +146,10 @@ module.exports = class extends Generator {
|
|
|
145
146
|
this.logger.verbose('Template directory:', this.templateDir);
|
|
146
147
|
this.logger.verbose('Destination directory:', this.destDir);
|
|
147
148
|
|
|
149
|
+
const cliRoot = path.resolve(__dirname, '../..');
|
|
150
|
+
const micoVersions = await getMicoTemplateVersions(cliRoot, 8000);
|
|
151
|
+
const ui = micoVersions['@mico-platform/ui'];
|
|
152
|
+
|
|
148
153
|
const templateData = {
|
|
149
154
|
appName: this.appName,
|
|
150
155
|
AppName: this.appNamePascal,
|
|
@@ -152,6 +157,7 @@ module.exports = class extends Generator {
|
|
|
152
157
|
umdGlobalName: this.umdGlobalName,
|
|
153
158
|
packageScope: this.packageScope,
|
|
154
159
|
devPort: this.devPort,
|
|
160
|
+
micoUiPeerRange: `^${ui.resolved}`,
|
|
155
161
|
};
|
|
156
162
|
|
|
157
163
|
this.logger.verbose('Template data:', JSON.stringify(templateData, null, 2));
|