@kengic/vue 0.19.2-beta.6 → 0.19.2-beta.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,16 @@
1
+ import { IRequestConfig, IRequestOptions } from '../../../../services';
2
+ import * as DEF from '../../../def';
3
+ /** 请求参数. */
4
+ export declare class ValidateVarButtonVarNameQuery {
5
+ }
6
+ /**
7
+ * 校验按钮的变量名称是否有效.
8
+ *
9
+ * @param config 请求配置.
10
+ * @param option 请求选项.
11
+ */
12
+ export declare function ValidateVarButtonVarName(config?: IRequestConfig<ValidateVarButtonVarNameQuery, DEF.WMS.ValidateVarButtonVarNameQuery>, option?: IRequestOptions): Promise<string>;
13
+ export declare namespace ValidateVarButtonVarName {
14
+ var method: "POST";
15
+ var url: string;
16
+ }
@@ -6,3 +6,4 @@ export { ValidateDeleteSql, ValidateDeleteSqlQuery } from './ValidateDeleteSql';
6
6
  export { ValidateFrmId, ValidateFrmIdQuery } from './ValidateFrmId';
7
7
  export { ValidateSearchSql, ValidateSearchSqlQuery } from './ValidateSearchSql';
8
8
  export { ValidateUpdateSql, ValidateUpdateSqlQuery } from './ValidateUpdateSql';
9
+ export { ValidateVarButtonVarName, ValidateVarButtonVarNameQuery } from './ValidateVarButtonVarName';
@@ -313,6 +313,12 @@ export declare class ValidateSqlQuery {
313
313
  sql?: string | null;
314
314
  constructor(obj?: ValidateSqlQuery);
315
315
  }
316
+ /** 校验按钮的变量名称是否有效. */
317
+ export declare class ValidateVarButtonVarNameQuery {
318
+ /** 变量名称. */
319
+ varName?: string | null;
320
+ constructor(obj?: ValidateVarButtonVarNameQuery);
321
+ }
316
322
  /** 按钮 */
317
323
  export declare class VarButton {
318
324
  /** 是否可用. */
@@ -1,13 +1,11 @@
1
- import { Rule } from 'ant-design-vue/es/form';
2
- import { ComputedRef, Ref } from 'vue';
1
+ import { ComputedRef } from 'vue';
3
2
  import { IKgFormItemProps } from './index.vm';
4
- export declare type IUseRules = {
3
+ export declare function _useFormRules(props: IKgFormItemProps): {
5
4
  /** 表单验证规则. */
6
- rules: Ref<Rule[]>;
5
+ formRules: ComputedRef<import("ant-design-vue/es/form").RuleObject[]>;
7
6
  /** 正在计算表单验证规则. */
8
- isRulesLoading: Ref<boolean>;
7
+ isFormRulesLoading: import("vue").Ref<boolean>;
9
8
  };
10
- export declare function _useRules(props: IKgFormItemProps): IUseRules;
11
9
  export declare type IUseKgFormItem<T = Record<string, any>> = {
12
10
  /** 控件类型. */
13
11
  controlType: ComputedRef<string | null | undefined>;
@@ -40,6 +40,7 @@ declare const _default: import("vue").DefineComponent<{
40
40
  'onUpdate:value': import("vue").PropType<(value: import("../index.vm").IKgFormItemValue | null) => void>;
41
41
  onKgSubmit: import("vue").PropType<() => void>;
42
42
  onKgChange: import("vue").PropType<(value: any) => void>;
43
+ /** 初始. */
43
44
  onKgSelectChange: import("vue").PropType<(value: any) => void>;
44
45
  onKgSelectDatasChange: import("vue").PropType<(datas: any[]) => void>;
45
46
  }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("kgSubmit" | "kgChange" | "kgSelectChange" | "update:value" | "kgSelectDatasChange")[], "kgSubmit" | "kgChange" | "kgSelectChange" | "update:value" | "kgSelectDatasChange", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
@@ -82,6 +83,7 @@ declare const _default: import("vue").DefineComponent<{
82
83
  'onUpdate:value': import("vue").PropType<(value: import("../index.vm").IKgFormItemValue | null) => void>;
83
84
  onKgSubmit: import("vue").PropType<() => void>;
84
85
  onKgChange: import("vue").PropType<(value: any) => void>;
86
+ /** 初始. */
85
87
  onKgSelectChange: import("vue").PropType<(value: any) => void>;
86
88
  onKgSelectDatasChange: import("vue").PropType<(datas: any[]) => void>;
87
89
  }>> & {
@@ -65,6 +65,10 @@ export declare const getProps: () => {
65
65
  type: PropType<PickerMode>;
66
66
  default: undefined;
67
67
  };
68
+ /**
69
+ * TODO 移除 props.kgRules, 直接使用 kgSubmit.rules,
70
+ * @deprecated
71
+ */
68
72
  kgRules: PropType<RuleObject[]>;
69
73
  value: {
70
74
  type: PropType<IKgFormItemValue>;
@@ -14,6 +14,12 @@ export declare function useKgSubmit(formID?: string | null): {
14
14
  getRules(): (formID?: string | null | undefined) => import("vue").Ref<Record<string, import("ant-design-vue/es/form").RuleObject[]>>;
15
15
  }, {
16
16
  dispose(formID?: string | null | undefined): void;
17
+ /**
18
+ * <p>事件: 请求失败. 请求失败了, 或者请求返回了错误消息.</p>
19
+ * @param cb 回调函数.
20
+ * @param once 是否只会触发一次. 默认为 undefined.
21
+ * @return {} 移除事件监听函数.
22
+ */
17
23
  addEventListener(formID: string, event: IKgSubmitEvent, cb: import("./index.store").IKgSubmitCb): void;
18
24
  removeEventListener(formID: string, event: IKgSubmitEvent, cb?: import("./index.store").IKgSubmitCb | undefined): void;
19
25
  emit(formID: string, event: IKgSubmitEvent, param: import("./index.store").IKgSubmitCbParam): Promise<boolean>;
@@ -43,8 +49,13 @@ export declare function useKgSubmit(formID?: string | null): {
43
49
  */
44
50
  onOpen: (cb: IKgSubmitOpenCb, once?: boolean | undefined) => import("../../consts").IRemoveEventListenerHandler;
45
51
  /**
46
- * <p>事件: 点击确认按钮之后, 执行默认逻辑之前. 可以在此时修改表单的值; 可以在此时对表单的值进行验证.</p>
52
+ * <p>事件: 点击确认按钮之后, 执行默认逻辑之前.</p>
53
+ * <ul>
54
+ * <li>可以在此时修改表单数据对象,</li>
55
+ * <li>可以在此时修改表单验证规则,</li>
56
+ * </ul>
47
57
  * <p>回调函数如果返回 true, 则不会再执行后面的代码.</p>
58
+ *
48
59
  * @param cb 回调函数.
49
60
  * @param once 是否只会触发一次. 默认为 undefined.
50
61
  * @return {} 移除事件监听函数.
@@ -53,6 +64,7 @@ export declare function useKgSubmit(formID?: string | null): {
53
64
  /**
54
65
  * <p>事件: 点击确认按钮之后, 表单验证完成.</p>
55
66
  * <p>回调函数如果返回 true, 则不会再执行后面的代码.</p>
67
+ *
56
68
  * @param cb 回调函数.
57
69
  * @param once 是否只会触发一次. 默认为 undefined.
58
70
  * @return {} 移除事件监听函数.
@@ -61,6 +73,7 @@ export declare function useKgSubmit(formID?: string | null): {
61
73
  /**
62
74
  * <p>事件: 发起接口请求之前. 表单验证完成, 参数解析完成.</p>
63
75
  * <p>回调函数如果返回 true, 则不会再执行后面的代码.</p>
76
+ *
64
77
  * @param cb 回调函数.
65
78
  * @param once 是否只会触发一次. 默认为 undefined.
66
79
  * @return {} 移除事件监听函数.
@@ -38,13 +38,22 @@ export declare type IKgSubmitOpenCbParam = {
38
38
  export declare type IKgSubmitOpenCb = ((param: IKgSubmitOpenCbParam) => Promise<boolean>) & IKgEventCb;
39
39
  /** 事件监听函数: beforeOk. */
40
40
  export declare type IKgSubmitBeforeOkCbParam = {
41
- isCreating: boolean | null;
42
- isUpdating: boolean | null;
43
41
  isCopying: boolean | null;
42
+ isCreating: boolean | null;
44
43
  isDeleting: boolean | null;
44
+ isUpdating: boolean | null;
45
+ /**
46
+ * 表单数据对象.
47
+ */
48
+ model: Ref<Record<string, any>>;
49
+ /**
50
+ * 表格当前勾选的唯一行.
51
+ */
45
52
  row: IKgTableRow | null;
53
+ /**
54
+ * 表单验证规则.
55
+ */
46
56
  rules: Ref<Record<string, RuleObject[]>>;
47
- model: Ref<Record<string, any>>;
48
57
  };
49
58
  export declare type IKgSubmitBeforeOkCb = ((param: IKgSubmitBeforeOkCbParam) => Promise<boolean>) & IKgEventCb;
50
59
  /** 事件监听函数: afterValidate. */
@@ -103,11 +112,13 @@ export interface IKgSubmitState {
103
112
  modelMap: Map<string, Record<string, any>>;
104
113
  /** 表单对象. */
105
114
  formRefMap: Map<string, Ref<FormInstance | null>>;
106
- /** 表单验证规则. 在 beforeOk 事件中会将该对象传给调用者, 调用者可以修改该对象, 从而添加自定义的验证规则. */
115
+ /**
116
+ * <p>表单验证规则.</p>
117
+ * <p>在 beforeOk 事件中会将此对象传给调用者, 调用者可以修改此对象, 从而添加自定义的验证规则.</p>
118
+ */
107
119
  rulesMap: Map<string, Ref<Record<string, Array<RuleObject>>>>;
108
120
  }
109
121
  export declare type IKgSubmitStoreDefinition = StoreDefinition<'KgSubmit', IKgSubmitState, {
110
- /** 是否处于加载状态. */
111
122
  isLoading(): (formID?: string | null) => boolean;
112
123
  getModel(): (formID: string | null | undefined) => Record<string, any> | null;
113
124
  getFormRef(): (formID?: string | null) => Ref<FormInstance | null>;
@@ -116,12 +127,6 @@ export declare type IKgSubmitStoreDefinition = StoreDefinition<'KgSubmit', IKgSu
116
127
  dispose(formID?: string | null): void;
117
128
  addEventListener(formID: string, event: IKgSubmitEvent, cb: IKgSubmitCb): void;
118
129
  removeEventListener(formID: string, event: IKgSubmitEvent, cb?: IKgSubmitCb): void;
119
- /**
120
- * 触发事件.
121
- * @param formID 界面标识.
122
- * @param event 事件名称.
123
- * @param param 事件参数.
124
- */
125
130
  emit(formID: string, event: IKgSubmitEvent, param: IKgSubmitCbParam): Promise<boolean>;
126
131
  setIsLoading(formID: string, value: boolean): void;
127
132
  setModel(formID: string, model: Record<string, any>): void;
@@ -22,39 +22,36 @@ export declare function useKgVar(formID?: string | null, init?: boolean, level?:
22
22
  getTopFormIDs(): string[];
23
23
  getFormLevel(): (frm_id: string | null | undefined) => number;
24
24
  t(): (frm_id: string | null | undefined, var_nam: string | null | undefined) => string;
25
- isRetrieving(): (frm_id: string | null | undefined) => boolean | null; /**
26
- * 界面标识.
27
- */
28
- isRetrievingVarProfileMaster(): (frm_id: string | null | undefined) => boolean | null; /** 状态数据. */
29
- isRetrievingVarGridMaster(): (frm_id: string | null | undefined) => boolean | null;
30
- isSearched(): (frm_id: string | null | undefined) => boolean; /** 正在查询 VarGridMaster. */
31
- isCreating(): (frm_id: string | null | undefined) => boolean | null; /** 变量配置是否查询完成. */
25
+ isRetrieving(): (frm_id: string | null | undefined) => boolean | null;
26
+ isRetrievingVarProfileMaster(): (frm_id: string | null | undefined) => boolean | null;
27
+ isRetrievingVarGridMaster(): (frm_id: string | null | undefined) => boolean | null; /** 正在查询变量配置. */
28
+ isSearched(): (frm_id: string | null | undefined) => boolean;
29
+ isCreating(): (frm_id: string | null | undefined) => boolean | null;
32
30
  isUpdating(): (frm_id: string | null | undefined) => boolean | null;
33
- isCopying(): (frm_id: string | null | undefined) => boolean | null;
34
- isDeleting(): (frm_id: string | null | undefined) => boolean | null; /** 正在更新:正在调用接口. */
31
+ isCopying(): (frm_id: string | null | undefined) => boolean | null; /** 正在创建:正在调用接口. */
32
+ isDeleting(): (frm_id: string | null | undefined) => boolean | null;
35
33
  isCreatingRequesting(): (frm_id: string | null | undefined) => boolean | null;
36
34
  isUpdatingRequesting(): (frm_id: string | null | undefined) => boolean | null;
37
35
  isCopyingRequesting(): (frm_id: string | null | undefined) => boolean | null;
38
36
  isDeletingRequesting(): (frm_id: string | null | undefined) => boolean | null;
37
+ /** 其他按钮:正在调用接口. */
39
38
  isOtherRequesting(): (frm_id: string | null | undefined) => boolean | null;
40
39
  getVarCatalogs(): (frm_id: string | null | undefined) => import("../../apis/WMS/models").VarVariableCatalog[] | null;
41
40
  getVarCatalog(): (frm_id: string | null | undefined, var_nam: string | null | undefined) => import("../../apis/WMS/models").VarVariableCatalog | null;
42
41
  getVarLookup(): (frm_id: string | null | undefined, var_nam: string | null | undefined) => import("../../apis/WMS/models").VarVariableLookup | null;
43
- getVarPossibility(): (frm_id: string | null | undefined, var_nam: string | null | undefined) => import("../../apis/WMS/models").VarVariablePossibility | null; /** 当前的 VarGridMaster. */
42
+ getVarPossibility(): (frm_id: string | null | undefined, var_nam: string | null | undefined) => import("../../apis/WMS/models").VarVariablePossibility | null;
44
43
  getVarVariableConfig(): (frm_id: string | null | undefined, var_nam: string | null | undefined) => import("../../apis/WMS/models").VarVariableConfig | null;
45
- getVarVariableInput(): (frm_id: string | null | undefined, var_nam: string | null | undefined) => import("../../apis/WMS/models").VarVariableInput | null;
44
+ getVarVariableInput(): (frm_id: string | null | undefined, var_nam: string | null | undefined) => import("../../apis/WMS/models").VarVariableInput | null; /**
45
+ * 设置'是否正在创建'.
46
+ * @param value 是否正在创建.
47
+ */
46
48
  getVarButtons(): (frm_id: string | null | undefined) => import("../../apis/WMS/models").VarButton[] | null;
47
49
  getVarSubmitConfig(): (frm_id: string | null | undefined) => import("../../apis/WMS/models").VarSubmitConfig | null;
48
50
  getVarSubmitConfigProps(): (frm_id: string | null | undefined) => import("../../consts").IKgSubmitConfigProps;
49
51
  getVarSubmitFields(): (frm_id: string | null | undefined) => VarSubmitField[] | null;
50
52
  getVarSubmitFieldsForCreate(): (frm_id: string | null | undefined) => VarSubmitField[] | null;
51
53
  getVarSubmitFieldsForCreateKey(): (frm_id: string | null | undefined) => VarSubmitField[] | null;
52
- getVarSubmitFieldsForCreateNotKey(): (frm_id: string | null | undefined) => VarSubmitField[] | null; /**
53
- * 修改 VarSubmitField 的部分属性.
54
- * @param variableName 变量名称
55
- * @param properties 要修改的部分属性.
56
- * @param isTriggerEvent 是否触发变更事件.
57
- */
54
+ getVarSubmitFieldsForCreateNotKey(): (frm_id: string | null | undefined) => VarSubmitField[] | null;
58
55
  getVarSubmitFieldsForCreateKeyVisible(): (frm_id: string | null | undefined) => VarSubmitField[] | null;
59
56
  getVarSubmitFieldsForCreateNotKeyVisible(): (frm_id: string | null | undefined) => VarSubmitField[] | null;
60
57
  getVarSubmitFieldsForUpdate(): (frm_id: string | null | undefined) => VarSubmitField[] | null;
@@ -82,9 +82,6 @@ export declare type IKgVarStoreDefinition = StoreDefinition<'KgVar', IKgVarState
82
82
  getTopFormIDs(): Array<string>;
83
83
  /** 获取界面层级. */
84
84
  getFormLevel(): (frm_id: string | null | undefined) => number;
85
- /**
86
- * 翻译变量.
87
- */
88
85
  t(): (frm_id: string | null | undefined, var_nam: string | null | undefined) => string;
89
86
  isRetrieving(): (frm_id: string | null | undefined) => boolean | null;
90
87
  isRetrievingVarProfileMaster(): (frm_id: string | null | undefined) => boolean | null;
@@ -25,6 +25,10 @@ declare const _default: {
25
25
  sql: string;
26
26
  type: string;
27
27
  };
28
+ KgPageDdaCreateButton: {
29
+ 'button-var-name-reserved': string;
30
+ 'button-var-name-used': string;
31
+ };
28
32
  KgPageDdaCreateMenu: {
29
33
  'parent-menu': string;
30
34
  };
@@ -25,6 +25,10 @@ declare const _default: {
25
25
  sql: string;
26
26
  type: string;
27
27
  };
28
+ KgPageDdaCreateButton: {
29
+ 'button-var-name-reserved': string;
30
+ 'button-var-name-used': string;
31
+ };
28
32
  KgPageDdaCreateMenu: {
29
33
  'parent-menu': string;
30
34
  };
@@ -529,33 +529,7 @@ export declare const useKgPageDdaCreateStore: import("pinia").StoreDefinition<"K
529
529
  }[] | null | undefined;
530
530
  }>;
531
531
  getFrmId: import("vue").ComputedRef<string | null | undefined>;
532
- getVarButtons: import("vue").ComputedRef<{
533
- available_flag?: number | null | undefined;
534
- cmd?: string | null | undefined;
535
- cmd_method?: string | null | undefined;
536
- cmd_prm?: string | null | undefined;
537
- color?: string | null | undefined;
538
- del_param_clm?: string | null | undefined;
539
- dis_mult_select_flg?: number | null | undefined;
540
- dis_no_select_flg?: number | null | undefined;
541
- ena_flg?: number | null | undefined;
542
- export_excel_filename?: string | null | undefined;
543
- export_excel_suffix?: string | null | undefined;
544
- frm_id?: string | null | undefined;
545
- icon?: string | null | undefined;
546
- id?: string | null | undefined;
547
- modal_props?: string | null | undefined;
548
- permission_code?: string | null | undefined;
549
- primary_flg?: number | null | undefined;
550
- re_select_after_reload_flg?: number | null | undefined;
551
- reload_all_after_done_flg?: number | null | undefined;
552
- show_modal_flg?: number | null | undefined;
553
- show_success_message_flg?: number | null | undefined;
554
- sql?: string | null | undefined;
555
- srtseq?: number | null | undefined;
556
- typ?: string | null | undefined;
557
- var_nam?: string | null | undefined;
558
- }[] | null | undefined>;
532
+ getVarButtons: import("vue").ComputedRef<VarButton[]>;
559
533
  setIsLoading: (_isLoading: boolean | null | undefined) => void;
560
534
  setResultSetMetadataColumns: (columns: Array<ResultSetMetadataColumn> | null | undefined) => void;
561
535
  setFrmId: (_frmId: string | null | undefined) => void;
@@ -1117,33 +1091,7 @@ export declare const useKgPageDdaCreateStore: import("pinia").StoreDefinition<"K
1117
1091
  }[] | null | undefined;
1118
1092
  }>;
1119
1093
  getFrmId: import("vue").ComputedRef<string | null | undefined>;
1120
- getVarButtons: import("vue").ComputedRef<{
1121
- available_flag?: number | null | undefined;
1122
- cmd?: string | null | undefined;
1123
- cmd_method?: string | null | undefined;
1124
- cmd_prm?: string | null | undefined;
1125
- color?: string | null | undefined;
1126
- del_param_clm?: string | null | undefined;
1127
- dis_mult_select_flg?: number | null | undefined;
1128
- dis_no_select_flg?: number | null | undefined;
1129
- ena_flg?: number | null | undefined;
1130
- export_excel_filename?: string | null | undefined;
1131
- export_excel_suffix?: string | null | undefined;
1132
- frm_id?: string | null | undefined;
1133
- icon?: string | null | undefined;
1134
- id?: string | null | undefined;
1135
- modal_props?: string | null | undefined;
1136
- permission_code?: string | null | undefined;
1137
- primary_flg?: number | null | undefined;
1138
- re_select_after_reload_flg?: number | null | undefined;
1139
- reload_all_after_done_flg?: number | null | undefined;
1140
- show_modal_flg?: number | null | undefined;
1141
- show_success_message_flg?: number | null | undefined;
1142
- sql?: string | null | undefined;
1143
- srtseq?: number | null | undefined;
1144
- typ?: string | null | undefined;
1145
- var_nam?: string | null | undefined;
1146
- }[] | null | undefined>;
1094
+ getVarButtons: import("vue").ComputedRef<VarButton[]>;
1147
1095
  setIsLoading: (_isLoading: boolean | null | undefined) => void;
1148
1096
  setResultSetMetadataColumns: (columns: Array<ResultSetMetadataColumn> | null | undefined) => void;
1149
1097
  setFrmId: (_frmId: string | null | undefined) => void;
@@ -1705,33 +1653,7 @@ export declare const useKgPageDdaCreateStore: import("pinia").StoreDefinition<"K
1705
1653
  }[] | null | undefined;
1706
1654
  }>;
1707
1655
  getFrmId: import("vue").ComputedRef<string | null | undefined>;
1708
- getVarButtons: import("vue").ComputedRef<{
1709
- available_flag?: number | null | undefined;
1710
- cmd?: string | null | undefined;
1711
- cmd_method?: string | null | undefined;
1712
- cmd_prm?: string | null | undefined;
1713
- color?: string | null | undefined;
1714
- del_param_clm?: string | null | undefined;
1715
- dis_mult_select_flg?: number | null | undefined;
1716
- dis_no_select_flg?: number | null | undefined;
1717
- ena_flg?: number | null | undefined;
1718
- export_excel_filename?: string | null | undefined;
1719
- export_excel_suffix?: string | null | undefined;
1720
- frm_id?: string | null | undefined;
1721
- icon?: string | null | undefined;
1722
- id?: string | null | undefined;
1723
- modal_props?: string | null | undefined;
1724
- permission_code?: string | null | undefined;
1725
- primary_flg?: number | null | undefined;
1726
- re_select_after_reload_flg?: number | null | undefined;
1727
- reload_all_after_done_flg?: number | null | undefined;
1728
- show_modal_flg?: number | null | undefined;
1729
- show_success_message_flg?: number | null | undefined;
1730
- sql?: string | null | undefined;
1731
- srtseq?: number | null | undefined;
1732
- typ?: string | null | undefined;
1733
- var_nam?: string | null | undefined;
1734
- }[] | null | undefined>;
1656
+ getVarButtons: import("vue").ComputedRef<VarButton[]>;
1735
1657
  setIsLoading: (_isLoading: boolean | null | undefined) => void;
1736
1658
  setResultSetMetadataColumns: (columns: Array<ResultSetMetadataColumn> | null | undefined) => void;
1737
1659
  setFrmId: (_frmId: string | null | undefined) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kengic/vue",
3
- "version": "0.19.2-beta.6",
3
+ "version": "0.19.2-beta.7",
4
4
  "scripts": {
5
5
  "build": "npm run switch-node-version && rimraf dist && vue-tsc && vite build",
6
6
  "build:dev": "npm run switch-node-version && rimraf dist && vue-tsc && vite build --mode development",