@kengic/vue 0.7.6-beta.0 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,8 @@
1
1
  import { ColumnsType } from 'ant-design-vue/es/table';
2
+ import { TransferItem } from 'ant-design-vue/es/transfer';
3
+ import { Ref, UnwrapRef } from 'vue';
2
4
  import { VarProfileDetail } from '../../../apis/WMS/models';
3
5
  export declare const leftVarProfileDetailColumns: (hostFormID: string) => ColumnsType<VarProfileDetail>;
4
6
  export declare const rightVarProfileDetailColumns: (hostFormID: string) => ColumnsType<VarProfileDetail>;
7
+ export declare type IUseDragRow = {};
8
+ export declare function _useDragRow(transferRef: Ref<UnwrapRef<HTMLDivElement | null>>, transferRightRows: Ref<UnwrapRef<Array<TransferItem>>>): IUseDragRow;
@@ -28,8 +28,10 @@ export declare type IKgTableBeforeRetrieveCbParam = {
28
28
  export declare type IKgTableBeforeRetrieveCb = ((param: IKgTableBeforeRetrieveCbParam) => Promise<boolean>) & IKgEventCb;
29
29
  /** 事件监听函数: beforeSetDatas. */
30
30
  export declare type IKgTableBeforeSetDatasCbParam = {
31
- /** 经过组件处理之后的列表数据. */
31
+ /** 列表数据. */
32
32
  datas: Ref<Array<IKgTableRow>>;
33
+ /** 设置列表数据. */
34
+ setDatas(datas: Array<IKgTableRow>): void;
33
35
  /** 总数. */
34
36
  total: Ref<number>;
35
37
  };
@@ -38,13 +40,17 @@ export declare type IKgTableBeforeSetDatasCb = ((param: IKgTableBeforeSetDatasCb
38
40
  export declare type IKgTableRetrieveCbParam = {
39
41
  /** 接口返回的分页数据. */
40
42
  page: IPage<IKgTableRow> | undefined | null;
41
- /** 经过组件处理之后的列表数据. */
43
+ /** 列表数据. */
42
44
  datas: Ref<Array<IKgTableRow>>;
45
+ /** 设置列表数据. */
46
+ setDatas(datas: Array<IKgTableRow>): void;
43
47
  };
44
48
  export declare type IKgTableRetrieveCb = ((param: IKgTableRetrieveCbParam) => Promise<boolean>) & IKgEventCb;
45
49
  export declare type IKgTableCbParam = IKgTableRowDoubleClickParam | IKgTableBeforeRetrieveCbParam | IKgTableBeforeSetDatasCbParam | IKgTableRetrieveCbParam;
46
50
  export declare type IKgTableCb = IKgTableRowDoubleClickCb | IKgTableBeforeRetrieveCb | IKgTableBeforeSetDatasCb | IKgTableRetrieveCb;
47
51
  export interface IKgTableState {
52
+ /** 列表数据. */
53
+ datasMap: Map<String, Array<IKgTableRow>>;
48
54
  /** 勾选的行的主键. */
49
55
  selectedRowKeysMap: Map<string, Ref<Array<Key>>>;
50
56
  /** 勾选的行. */
@@ -66,43 +72,51 @@ export interface IKgTableState {
66
72
  retrieveListenersMap: Map<string, Array<IKgTableRetrieveCb>>;
67
73
  }
68
74
  export declare type IKgTableStoreDefinition = StoreDefinition<'KgTable', IKgTableState, {
75
+ /** 列表数据. */
76
+ getDatas(): (formID: string | null | undefined) => Array<IKgTableRow>;
69
77
  /** 当前勾选的所有行的主键. */
70
- getSelectedRowKeys(): (formID?: string | null) => Ref<Array<Key>>;
78
+ getSelectedRowKeys(): (formID: string | null | undefined) => Ref<Array<Key>>;
71
79
  /** 当前勾选的所有行. */
72
- getSelectedRows(): (formID?: string | null) => Array<IKgTableRow> | null;
80
+ getSelectedRows(): (formID: string | null | undefined) => Array<IKgTableRow> | null;
73
81
  /** 当前勾选的第一行. */
74
- getSelectedFirstRow(): (formID?: string | null) => IKgTableRow | null;
82
+ getSelectedFirstRow(): (formID: string | null | undefined) => IKgTableRow | null;
75
83
  /** 当前勾选的唯一行. */
76
- getSelectedRow(): (formID?: string | null) => IKgTableRow | null;
77
- getIsRetrieved(): (formID?: string | null) => boolean | null;
78
- getIsRetrieving(): (formID?: string | null) => boolean | null;
79
- getTableWidth(): (formID?: string | null) => number | null;
84
+ getSelectedRow(): (formID: string | null | undefined) => IKgTableRow | null;
85
+ getIsRetrieved(): (formID: string | null | undefined) => boolean | null;
86
+ getIsRetrieving(): (formID: string | null | undefined) => boolean | null;
87
+ getTableWidth(): (formID: string | null | undefined) => number | null;
80
88
  }, {
81
- dispose(formID?: string | null): void;
82
- addEventListener(formID: string, event: IKgTableEvent, cb: IKgTableCb): void;
83
- removeEventListener(formID: string, event: IKgTableEvent, cb?: IKgTableCb): void;
84
- emit(formID: string, event: IKgTableEvent, param: IKgTableCbParam): Promise<boolean>;
89
+ dispose(formID: string | null | undefined): void;
90
+ addEventListener(formID: string | null | undefined, event: IKgTableEvent, cb: IKgTableCb): void;
91
+ removeEventListener(formID: string | null | undefined, event: IKgTableEvent, cb?: IKgTableCb): void;
92
+ emit(formID: string | null | undefined, event: IKgTableEvent, param: IKgTableCbParam): Promise<boolean>;
93
+ /**
94
+ * 设置列表数据.
95
+ * @param formID 界面标识.
96
+ * @param datas 列表数据.
97
+ */
98
+ setDatas(formID: string | null | undefined, datas: Array<IKgTableRow>): void;
85
99
  /**
86
100
  * 设置勾选的行.
87
101
  * @param formID 界面标识.
88
102
  * @param selectedRows 勾选的行.
89
103
  */
90
- setSelectedRows(formID: string, selectedRows: Array<IKgTableRow>): void;
104
+ setSelectedRows(formID: string | null | undefined, selectedRows: Array<IKgTableRow>): void;
91
105
  /**
92
106
  * 设置某行的勾选状态.
93
107
  * @param formID 界面标识.
94
108
  * @param row 行.
95
109
  * @param selected 是否勾选.
96
110
  */
97
- setRowSelect(formID: string, row: IKgTableRow, selected: boolean): void;
98
- setIsRetrieved(formID: string, value: boolean): void;
99
- setIsRetrieving(formID: string, value: boolean): void;
100
- setTableWidth(formID: string, value: number): void;
111
+ setRowSelect(formID: string | null | undefined, row: IKgTableRow, selected: boolean): void;
112
+ setIsRetrieved(formID: string | null | undefined, value: boolean): void;
113
+ setIsRetrieving(formID: string | null | undefined, value: boolean): void;
114
+ setTableWidth(formID: string | null | undefined, value: number): void;
101
115
  /**
102
116
  * 清空表格数据.
103
117
  * @param formID 界面标识.
104
118
  */
105
- clearDatas(formID: string): void;
119
+ clearDatas(formID: string | null | undefined): void;
106
120
  }>;
107
121
  export declare type IKgTableStore = ReturnType<IKgTableStoreDefinition>;
108
122
  export declare const useKgTableStore: () => IKgTableStoreDefinition;
@@ -86,7 +86,7 @@ export interface IKgTableCellDisplayTypeProperties {
86
86
  DESC: {
87
87
  /**
88
88
  * 对应的描述字段的名称.
89
- * @default 原字段 + '_dsc'
89
+ * @default 原字段 + '_dsc', 原字段 + 'Dsc'
90
90
  */
91
91
  dscFieldName?: string;
92
92
  /**
@@ -95,11 +95,11 @@ export interface IKgTableCellDisplayTypeProperties {
95
95
  */
96
96
  isTag?: boolean;
97
97
  /**
98
- * 如果 {@link IKgTableCellDisplayTypeProperties.DESC.isTag} 为 true,
99
- * 则该属性用来定义每个值对应的标签颜色是什么.
98
+ * 如果 {@link IKgTableCellDisplayTypeProperties.DESC.isTag} 为 true, 则该属性用来定义每个值对应的标签颜色分别是什么.
99
+ * 如果 {@link IKgTableCellDisplayTypeProperties.DESC.isTag} 为 false, 则该属性会被忽略.
100
100
  */
101
101
  tagColors?: Array<{
102
- /** 数据. */
102
+ /** 值. */
103
103
  value: any;
104
104
  /**
105
105
  * 颜色.
@@ -119,6 +119,7 @@ declare const _default: {
119
119
  delete: string;
120
120
  deleteSuccess: string;
121
121
  downloadImportTemplate: string;
122
+ dragToSort: string;
122
123
  edit: string;
123
124
  emptyText: string;
124
125
  export: string;
@@ -118,6 +118,7 @@ declare const _default: {
118
118
  delete: string;
119
119
  deleteSuccess: string;
120
120
  downloadImportTemplate: string;
121
+ dragToSort: string;
121
122
  edit: string;
122
123
  emptyText: string;
123
124
  export: string;
@@ -93,9 +93,9 @@ export declare const enum KG_TABLE_CELL_DISPLAY_TYPE {
93
93
  /** 显示为超链接, 点击跳转到其他路由. */
94
94
  ROUTE_LINK = "ROUTE_LINK",
95
95
  /**
96
- * 显示描述.
97
- * 假如原字段为 'status', 则实际上会显示描述字段 'status_dsc' 的值.
98
- * 默认, 描述字段是原字段加上 '_dsc' 后缀, 比如原字段为 'status', 则描述字段为 'status_dsc'.
96
+ * 显示描述字段.
97
+ * 假如原字段为 'status', 则实际上会显示描述字段 'status_dsc(或者 statusDsc)' 的值.
98
+ * 默认, 描述字段是原字段加上 '_dsc(或者 Dsc)' 后缀, 比如原字段为 'status', 则描述字段为 'status_dsc(或者 statusDsc)'.
99
99
  * 可以通过 {@link IKgTableCellDisplayTypeProperties.DESC.dscFieldName} 设置自定义的描述字段名.
100
100
  */
101
101
  DESC = "DESC"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kengic/vue",
3
- "version": "0.7.6-beta.0",
3
+ "version": "0.8.0",
4
4
  "scripts": {
5
5
  "build": "rimraf dist && vue-tsc && vite build",
6
6
  "build:dev": "rimraf dist && vue-tsc && vite build --mode development",