@kengic/vue 0.9.6-beta.1 → 0.10.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,9 +1,14 @@
1
1
  import { IRemoveEventListenerHandler } from '../../consts';
2
- import { IKgFormLookupBeforeOkCb, IKgFormLookupOkCb, IKgFormStore } from './index.store';
2
+ import { IKgFormLookupBeforeOkCb, IKgFormLookupOkCb, IKgFormSelectChangeCb, IKgFormStore } from './index.store';
3
3
  export declare type IUseKgForm = {
4
4
  formID: string;
5
5
  /** 状态数据. */
6
6
  store: IKgFormStore;
7
+ /** 监听事件: 下拉列表选中某个(可能多个)数据.
8
+ * @param cb 回调函数.
9
+ * @param once 是否只会触发一次. 默认为 undefined.
10
+ */
11
+ onSelectChange(cb: IKgFormSelectChangeCb, once?: boolean): IRemoveEventListenerHandler;
7
12
  /**
8
13
  * 监听事件: 查找弹窗点击确定之前. 如果返回 true 则查找弹窗不会触发 kgOk 事件.
9
14
  * @param cb 回调函数.
@@ -4,10 +4,19 @@ import { IKgEventCb } from '../../consts';
4
4
  import { IKgTableRow } from '../KgTable';
5
5
  /**
6
6
  * 事件类型.
7
+ * 'selectChange': 下拉列表选中某个(可能多个)数据
7
8
  * 'lookupBeforeOk': 查找弹窗点击确定之前. 如果返回 true 则查找弹窗不会触发 kgOk 事件
8
9
  * 'lookupOk': 查找弹窗点击确定
9
10
  */
10
- export declare type IKgFormEvent = 'lookupBeforeOk' | 'lookupOk';
11
+ export declare type IKgFormEvent = 'selectChange' | 'lookupBeforeOk' | 'lookupOk';
12
+ /** 事件监听函数: selectChange. */
13
+ export declare type IKgFormSelectChangeCbParam = {
14
+ /** 变量. */
15
+ var_nam: string;
16
+ /** 选中的一个或者多个数据对象. */
17
+ rows: any | null;
18
+ };
19
+ export declare type IKgFormSelectChangeCb = ((param: IKgFormSelectChangeCbParam) => Promise<boolean>) & IKgEventCb;
11
20
  /** 事件监听函数: lookupBeforeOk. */
12
21
  export declare type IKgFormLookupBeforeOkCbParam = {
13
22
  /** 变量. */
@@ -42,9 +51,10 @@ export declare type IKgFormLookupOkCbParam = {
42
51
  rows?: Array<IKgTableRow> | null;
43
52
  };
44
53
  export declare type IKgFormLookupOkCb = ((param: IKgFormLookupOkCbParam) => Promise<boolean>) & IKgEventCb;
45
- export declare type IKgFormCb = IKgFormLookupBeforeOkCb | IKgFormLookupOkCb;
46
- export declare type IKgFormCbParam = IKgFormLookupBeforeOkCbParam | IKgFormLookupOkCbParam;
54
+ export declare type IKgFormCbParam = IKgFormLookupBeforeOkCbParam | IKgFormLookupOkCbParam | IKgFormSelectChangeCbParam;
55
+ export declare type IKgFormCb = IKgFormLookupBeforeOkCb | IKgFormLookupOkCb | IKgFormSelectChangeCb;
47
56
  export interface IKgFormState {
57
+ selectChangeListenersMap: Map<string, Array<IKgFormSelectChangeCb>>;
48
58
  lookupOkListenersMap: Map<string, Array<IKgFormLookupOkCb>>;
49
59
  lookupBeforeOkListenersMap: Map<string, Array<IKgFormLookupBeforeOkCb>>;
50
60
  }
@@ -19,6 +19,7 @@ declare const _default: import("vue").DefineComponent<{
19
19
  type: import("vue").PropType<boolean>;
20
20
  default: boolean;
21
21
  };
22
+ /** 获取下拉列表数据. */
22
23
  kgAllowClear: {
23
24
  type: import("vue").PropType<boolean>;
24
25
  default: boolean;
@@ -59,6 +60,7 @@ declare const _default: import("vue").DefineComponent<{
59
60
  type: import("vue").PropType<boolean>;
60
61
  default: boolean;
61
62
  };
63
+ /** 获取下拉列表数据. */
62
64
  kgAllowClear: {
63
65
  type: import("vue").PropType<boolean>;
64
66
  default: boolean;
@@ -5,10 +5,14 @@ export declare type IUseKgFormItemSelect = {
5
5
  varPossibility: ComputedRef<VarPossibility | null>;
6
6
  /** 作为数据的列. */
7
7
  val_clm: ComputedRef<string>;
8
+ /** 作为显示的列. */
9
+ lbl_clm: ComputedRef<string>;
8
10
  /** 查询参数. */
9
11
  commandParameter: ComputedRef<Record<string, any>>;
10
12
  /** 列表数据. */
11
13
  datas: Ref<Array<Record<string, any>>>;
14
+ /** 正在加载列表数据. */
15
+ isRetrieving: Ref<boolean>;
12
16
  /**
13
17
  * 处理列表数据.
14
18
  * @param datas 元素列表数据.
@@ -2,7 +2,7 @@ import { RuleObject } from 'ant-design-vue/es/form';
2
2
  import { FormInstance } from 'ant-design-vue/lib/form/Form';
3
3
  import { Ref } from 'vue';
4
4
  import { IRemoveEventListenerHandler, KG_VAR_SUBMIT__DISPLAY_TYPE } from '../../consts';
5
- import { IKgSubmitAfterValidateCb, IKgSubmitBeforeOkCb, IKgSubmitBeforeRequestCb, IKgSubmitCloseCb, IKgSubmitErrorCb, IKgSubmitLookupOkCb, IKgSubmitOkCb, IKgSubmitOpenCb, IKgSubmitStore } from './index.store';
5
+ import { IKgSubmitAfterValidateCb, IKgSubmitBeforeOkCb, IKgSubmitBeforeRequestCb, IKgSubmitCloseCb, IKgSubmitErrorCb, IKgSubmitOkCb, IKgSubmitOpenCb, IKgSubmitStore } from './index.store';
6
6
  export declare type IUseKgSubmit = {
7
7
  formID: string;
8
8
  /** 状态数据. */
@@ -50,11 +50,6 @@ export declare type IUseKgSubmit = {
50
50
  * @param once 是否只会触发一次. 默认为 undefined.
51
51
  */
52
52
  onClose(cb: IKgSubmitCloseCb, once?: boolean): IRemoveEventListenerHandler;
53
- /** 监听事件: 查找弹窗点击确定.
54
- * @param cb 回调函数.
55
- * @param once 是否只会触发一次. 默认为 undefined.
56
- */
57
- onLookupOk(cb: IKgSubmitLookupOkCb, once?: boolean): IRemoveEventListenerHandler;
58
53
  };
59
54
  /**
60
55
  * @param formID 界面标识.
@@ -13,10 +13,8 @@ import { IKgTableRow } from '../KgTable';
13
13
  * 'ok': 请求成功, 即将关闭弹窗
14
14
  * 'error': 请求失败. 请求失败了, 或者请求返回了错误消息
15
15
  * 'close': 关闭弹窗
16
- * 'lookupBeforeOk': 查找弹窗点击确定之前. 如果返回 true 则查找弹窗不会触发 kgOk 事件
17
- * 'lookupOk': 查找弹窗点击确定
18
16
  */
19
- export declare type IKgSubmitEvent = 'open' | 'beforeOk' | 'afterValidate' | 'beforeRequest' | 'ok' | 'error' | 'close' | 'lookupBeforeOk' | 'lookupOk';
17
+ export declare type IKgSubmitEvent = 'open' | 'beforeOk' | 'afterValidate' | 'beforeRequest' | 'ok' | 'error' | 'close';
20
18
  /** 事件监听函数: open. */
21
19
  export declare type IKgSubmitOpenCbParam = {
22
20
  isCreating: boolean | null;
@@ -76,18 +74,8 @@ export declare type IKgSubmitOkCb = ((param: IKgSubmitOkCbParam) => Promise<bool
76
74
  export declare type IKgSubmitErrorCb = ((param: any) => Promise<boolean>) & IKgEventCb;
77
75
  /** 事件监听函数: close. */
78
76
  export declare type IKgSubmitCloseCb = ((param?: any | null) => Promise<boolean>) & IKgEventCb;
79
- /** 事件监听函数: lookupOk. */
80
- export declare type IKgSubmitLookupOkCbParam = {
81
- /** 变量. */
82
- var_nam: string;
83
- /** 单选时, 勾选的那一行. */
84
- row: IKgTableRow | null;
85
- /** 多选时, 勾选的所有行. */
86
- rows: Array<IKgTableRow> | null;
87
- };
88
- export declare type IKgSubmitLookupOkCb = ((param: IKgSubmitLookupOkCbParam) => Promise<boolean>) & IKgEventCb;
89
- export declare type IKgSubmitCbParam = IKgSubmitOpenCbParam | IKgSubmitBeforeOkCbParam | IKgSubmitAfterValidateCbParam | IKgSubmitBeforeRequestCbParam | IKgSubmitOkCbParam | IKgSubmitLookupOkCbParam | null;
90
- export declare type IKgSubmitCb = IKgSubmitOpenCb | IKgSubmitBeforeOkCb | IKgSubmitAfterValidateCb | IKgSubmitBeforeRequestCb | IKgSubmitOkCb | IKgSubmitErrorCb | IKgSubmitCloseCb | IKgSubmitLookupOkCb;
77
+ export declare type IKgSubmitCbParam = IKgSubmitOpenCbParam | IKgSubmitBeforeOkCbParam | IKgSubmitAfterValidateCbParam | IKgSubmitBeforeRequestCbParam | IKgSubmitOkCbParam | null;
78
+ export declare type IKgSubmitCb = IKgSubmitOpenCb | IKgSubmitBeforeOkCb | IKgSubmitAfterValidateCb | IKgSubmitBeforeRequestCb | IKgSubmitOkCb | IKgSubmitErrorCb | IKgSubmitCloseCb;
91
79
  export interface IKgSubmitState {
92
80
  openListenersMap: Map<string, Array<IKgSubmitOpenCb>>;
93
81
  beforeOkListenersMap: Map<string, Array<IKgSubmitBeforeOkCb>>;
@@ -96,7 +84,6 @@ export interface IKgSubmitState {
96
84
  okListenersMap: Map<string, Array<IKgSubmitOkCb>>;
97
85
  errorListenersMap: Map<string, Array<IKgSubmitErrorCb>>;
98
86
  closeListenersMap: Map<string, Array<IKgSubmitCloseCb>>;
99
- lookupOkListenersMap: Map<string, Array<IKgSubmitLookupOkCb>>;
100
87
  isLoadingMap: Map<string, boolean>;
101
88
  /** 表单数据对象. */
102
89
  modelMap: Map<string, Record<string, any>>;
@@ -143,6 +143,7 @@ declare const _default: {
143
143
  deleteSuccess: string;
144
144
  downloadImportTemplate: string;
145
145
  edit: string;
146
+ empty: string;
146
147
  emptyText: string;
147
148
  export: string;
148
149
  exportSuccess: string;
@@ -150,6 +151,7 @@ declare const _default: {
150
151
  import: string;
151
152
  importSuccess: string;
152
153
  importTemplate: string;
154
+ loading: string;
153
155
  lookup: string;
154
156
  no: string;
155
157
  ok: string;
@@ -142,6 +142,7 @@ declare const _default: {
142
142
  deleteSuccess: string;
143
143
  downloadImportTemplate: string;
144
144
  edit: string;
145
+ empty: string;
145
146
  emptyText: string;
146
147
  export: string;
147
148
  exportSuccess: string;
@@ -149,6 +150,7 @@ declare const _default: {
149
150
  import: string;
150
151
  importSuccess: string;
151
152
  importTemplate: string;
153
+ loading: string;
152
154
  lookup: string;
153
155
  no: string;
154
156
  ok: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kengic/vue",
3
- "version": "0.9.6-beta.1",
3
+ "version": "0.10.1",
4
4
  "scripts": {
5
5
  "build": "rimraf dist && vue-tsc && vite build",
6
6
  "build:dev": "rimraf dist && vue-tsc && vite build --mode development",
@@ -48,7 +48,7 @@
48
48
  "vue-router": "4.1.6"
49
49
  },
50
50
  "devDependencies": {
51
- "@kengic/pont": "1.2.10-beta.45",
51
+ "@kengic/pont": "1.2.10",
52
52
  "@types/lodash-es": "4.17.9",
53
53
  "@types/node": "18.18.4",
54
54
  "@types/semver": "7.5.3",