@hr-components-dev/cli 1.1.8 → 1.1.9

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 (2) hide show
  1. package/package.json +5 -5
  2. package/src/amis/index.vue +19 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hr-components-dev/cli",
3
- "version": "1.1.8",
3
+ "version": "1.1.9",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -37,7 +37,7 @@
37
37
  "!**/*.spec.js"
38
38
  ],
39
39
  "dependencies": {
40
- "@fortawesome/fontawesome-free": "^7.1.0",
40
+ "@fortawesome/fontawesome-free": "^7.2.0",
41
41
  "@vue/tsconfig": "^0.8.1",
42
42
  "ts-node": "^10.9.2"
43
43
  },
@@ -60,9 +60,9 @@
60
60
  },
61
61
  "devDependencies": {
62
62
  "@types/lodash": "^4.17.23",
63
- "@types/node": "^25.0.6",
64
- "@types/react": "^19.2.8",
63
+ "@types/node": "^25.2.3",
64
+ "@types/react": "^19.2.13",
65
65
  "typescript": "~5.9.3",
66
- "vue-tsc": "^3.2.2"
66
+ "vue-tsc": "^3.2.4"
67
67
  }
68
68
  }
@@ -5,6 +5,18 @@ import { reactive, ref, toRefs } from 'vue';
5
5
  import AmisRenderer from './components/amis.vue';
6
6
  import { ConvertSchemaMarkToJSON, evalFc } from './components/utils/evalScope';
7
7
 
8
+
9
+ // amisData数据类型
10
+ type DefaultAmisDataType = {
11
+ entity: any;
12
+ view: any;
13
+ "sys架构": string;
14
+ env: boolean;
15
+ user: any;
16
+ theme: 'light' | 'dark' | 'auto';
17
+ lang: 'en-US' | 'zh-CN';
18
+ }
19
+
8
20
  /**
9
21
  * 预览后的页面 Schema
10
22
  */
@@ -232,7 +244,7 @@ const defaultSchema = ref<Schema>({
232
244
  /**
233
245
  * amis 顶级 data 数据
234
246
  */
235
- const defaultAmisData = ref({
247
+ const defaultAmisData = ref<DefaultAmisDataType>({
236
248
  entity: {
237
249
  "icon": "fa fa-file",
238
250
  "_id": "6490433386348a0a8db0ad27",
@@ -259,13 +271,17 @@ const defaultAmisData = ref({
259
271
  "roles": [
260
272
  "630c897c962bc822fe5c3767"
261
273
  ]
262
- }
274
+ },
275
+ theme: 'dark',
276
+ lang: "zh-CN"
263
277
  });
264
278
  /**
265
279
  * amis context 数据
266
280
  */
267
281
  const defaultAmisContext = ref({
268
- onInit: (amisInstance?: IScopedContext & amis.TypeEmbed) => consola.success('onInit事件触发:', amisInstance)
282
+ onInit: (amisInstance?: IScopedContext & amis.TypeEmbed) => consola.success('onInit事件触发:', amisInstance),
283
+ changeLocale: (lang: 'en-US' | 'zh-CN'): void => { consola.log('changeLocale', lang) },
284
+ changeTheme: (): void => { consola.log('changeTheme') }
269
285
  });
270
286
  const amisReady = (amisInstance: IScopedContext & amis.TypeEmbed) => {
271
287
  instance.value = amisInstance;