@kengic/vue 0.5.21-beta.1 → 0.5.21-beta.2

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.
@@ -34,6 +34,8 @@ export interface IKgTableCellDisplayTypeProperties {
34
34
  nValue: any;
35
35
  };
36
36
  ENUM: Array<{
37
+ /** 变量名称. */
38
+ varName: string;
37
39
  /** 数据. */
38
40
  value: any;
39
41
  /**
@@ -41,26 +43,24 @@ export interface IKgTableCellDisplayTypeProperties {
41
43
  * @default 'default'
42
44
  */
43
45
  color?: string;
44
- /** 变量名称. */
45
- varName: string;
46
46
  }>;
47
47
  PROGRESS: {
48
- /**
49
- * 左侧数值对应的列.
50
- */
48
+ /** 左侧数值对应的列. */
51
49
  leftColumn: string;
52
- /**
53
- * 右侧数值对应的列.
54
- */
50
+ /** 右侧数值对应的列. */
55
51
  rightColumn: string;
56
52
  /**
57
53
  * 右侧文本的宽度. 例如: "100px".
58
54
  * @default 'auto'
59
55
  */
60
- textWidth: 'auto' | string;
56
+ textWidth?: 'auto' | string;
61
57
  };
62
58
  FILE_SIZE: {};
63
59
  UPDATE_LINK: {};
60
+ ROUTE_LINK: {
61
+ /** 要跳转的路由地址. */
62
+ path: string;
63
+ };
64
64
  }
65
65
  /** 列的默认宽度. 如果 VarGridDetail 没有配置宽度, 则使用该宽度. */
66
66
  export declare const KG_TABLE_TD_DEFAULT_WIDTH = 120;
@@ -1,11 +1,13 @@
1
1
  import { Pinia } from 'pinia';
2
2
  import { ComputedRef } from 'vue';
3
+ import { Router } from 'vue-router';
3
4
  import { IKgLocale } from '../consts';
4
5
  import { IKgStateOption, IKgStore, P, T } from './index.store';
5
6
  export declare type IUseKg = {
6
7
  store: IKgStore;
7
8
  /** 语言. */
8
9
  locale: ComputedRef<IKgLocale> | null;
10
+ router: ComputedRef<Router | null>;
9
11
  /** 配置参数. */
10
12
  option: ComputedRef<IKgStateOption>;
11
13
  /** 翻译. */
@@ -1,5 +1,6 @@
1
1
  import { Pinia, StoreDefinition } from 'pinia';
2
2
  import { ComputedRef } from 'vue';
3
+ import { Router } from 'vue-router';
3
4
  import { IKgLocale } from '../consts';
4
5
  export declare type IKgStateOption = {
5
6
  /** 仓库选择. */
@@ -30,16 +31,19 @@ export interface IKgState {
30
31
  tFunction: T | null;
31
32
  /** 检查权限的方法. */
32
33
  pFunction: P | null;
34
+ router: Router | null;
33
35
  /** 配置参数. */
34
36
  option: IKgStateOption;
35
37
  }
36
38
  export declare type IKgStoreDefinition = StoreDefinition<'Kg', IKgState, {
37
39
  /** 获取配置参数. */
38
40
  getLocale: ComputedRef<IKgLocale> | null;
41
+ getRouter: Router | null;
39
42
  /** 获取配置参数. */
40
43
  getOption: IKgStateOption;
41
44
  }, {
42
45
  setLocale(locale: ComputedRef<IKgLocale> | null): void;
46
+ setRouter(router: Router): void;
43
47
  setT(i18n: any): void;
44
48
  setP(fn: P): void;
45
49
  setOption(option: IKgStateOption): void;
@@ -1,5 +1,6 @@
1
1
  import { Pinia } from 'pinia';
2
2
  import { App, ComputedRef } from 'vue';
3
+ import { Router } from 'vue-router';
3
4
  import { IKgLocale } from '../consts';
4
5
  import { IKgStateOption, P } from './index.store';
5
6
  /**
@@ -23,6 +24,7 @@ export declare type IKgOptions = {
23
24
  i18n: any;
24
25
  /** 检查权限的方法. */
25
26
  pFunction: P;
27
+ router: Router;
26
28
  /** 配置参数. */
27
29
  option?: IKgStateOption;
28
30
  };
@@ -67,7 +67,9 @@ export declare const enum KG_TABLE_CELL_DISPLAY_TYPE {
67
67
  /** 文件大小, 将以字节(byte)为单位的数字格式化显示(XXX MB, XXX GB, ...). */
68
68
  FILE_SIZE = "FILE_SIZE",
69
69
  /** 显示为超链接, 点击打开更新弹窗. */
70
- UPDATE_LINK = "UPDATE_LINK"
70
+ UPDATE_LINK = "UPDATE_LINK",
71
+ /** 显示为超链接, 点击跳转到其他页面. */
72
+ ROUTE_LINK = "ROUTE_LINK"
71
73
  }
72
74
  /** 按钮类型. */
73
75
  export declare const enum KG_BUTTON_TYPE {
@@ -1,3 +1,4 @@
1
+ import dayjs from 'dayjs';
1
2
  /**
2
3
  * 变量相关工具.
3
4
  */
@@ -12,8 +13,9 @@ export declare class KgVarUtil {
12
13
  * 根据控件类型, 将任意的值(可能非法)转换为合法的值.
13
14
  * @param formID 界面标识.
14
15
  * @param var_name 变量名称.
16
+ * @param $dayjs
15
17
  * @param value 原始的值.
16
18
  * @return 转换后的合法的值.
17
19
  */
18
- static transformValueByControlType(formID: string, var_name: string, value: any): any;
20
+ static transformValueByControlType(formID: string, var_name: string, $dayjs: typeof dayjs, value: any): any;
19
21
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kengic/vue",
3
- "version": "0.5.21-beta.1",
3
+ "version": "0.5.21-beta.2",
4
4
  "scripts": {
5
5
  "build": "rimraf dist && vue-tsc && vite build",
6
6
  "build:dev": "rimraf dist && vue-tsc && vite build --mode development",