@kengic/vue 0.22.0 → 0.22.1-beta.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -2462,7 +2462,7 @@ const emptyIcon = {
2462
2462
  ...t.data
2463
2463
  }, r);
2464
2464
  }
2465
- }), version = "0.22.0";
2465
+ }), version = "0.22.1-beta.0";
2466
2466
  var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
2467
2467
  const freeGlobal$1 = freeGlobal;
2468
2468
  var freeSelf = typeof self == "object" && self && self.Object === Object && self, root = freeGlobal$1 || freeSelf || Function("return this")();
@@ -4665,8 +4665,8 @@ class KgRouteUtil {
4665
4665
  var a;
4666
4666
  if (!t)
4667
4667
  return null;
4668
- for (let n of t.filter((s) => !s.hideMenu)) {
4669
- if (n.path === r)
4668
+ for (let n of t) {
4669
+ if (!n.hideMenu && n.path === r)
4670
4670
  return n;
4671
4671
  if ((a = n.children) != null && a.length) {
4672
4672
  const s = KgRouteUtil.getMenuByPath(n.children, r);
@@ -12304,7 +12304,9 @@ const KgTable_Setting_ConfigModal_VarGridMaster = "", getProps$z = () => ({
12304
12304
  var _, b;
12305
12305
  const m = g.value;
12306
12306
  return m.frm_id = a.formID, m.varGridDetails = (b = (_ = s.value) == null ? void 0 : _.filter((E) => i.value.includes(E.id))) != null ? b : [], !1;
12307
- }), n.kgSubmit().onOk(async () => (a.store.retrieve(a.formID), !1)), n.kgButton().onClick((g) => {
12307
+ }), n.kgSubmit().onOk(async () => (a.store.retrieve(a.formID), !1)), n.kgButton().onClick(({
12308
+ button: g
12309
+ }) => {
12308
12310
  const m = n.kgTable().selectedRow.value;
12309
12311
  return (g == null ? void 0 : g.typ) === KG_BUTTON_TYPE.UPDATE && (m == null ? void 0 : m.cust_lvl) === KG_CUSTOM_LEVEL.L0 ? new Promise((_) => {
12310
12312
  KgUtil.confirm({
@@ -16089,7 +16091,9 @@ const getProps$o = () => ({
16089
16091
  setup(e) {
16090
16092
  const t = inject(DI_KG_VAR__KG_SLOTS, null), r = inject(DI_KG_VAR__KG_PROPS, null), a = useKg(), n = useKgVar(), s = computed(() => !1);
16091
16093
  function i(m) {
16092
- return n.kgButton().store.emit(n.formID, "click", m);
16094
+ return n.kgButton().store.emit(n.formID, "click", {
16095
+ button: m
16096
+ });
16093
16097
  }
16094
16098
  function o(m) {
16095
16099
  return computed(() => {
@@ -16478,9 +16482,6 @@ function useKgButton(e) {
16478
16482
  return {
16479
16483
  formID: t.formID,
16480
16484
  store: r,
16481
- click(a) {
16482
- r.click(t.formID, a.type, a.variableName);
16483
- },
16484
16485
  currentButton: computed(() => r.getCurrentButton(t.formID)),
16485
16486
  searchButton: computed(() => r.getSearchButton(t.formID)),
16486
16487
  isCurrentButtonClickIntercepted: computed(() => {
@@ -16488,6 +16489,9 @@ function useKgButton(e) {
16488
16489
  return r.isClickIntercepted(t.formID, { varName: (a = r.getCurrentButton(t.formID)) == null ? void 0 : a.var_nam });
16489
16490
  }),
16490
16491
  isCurrentButtonRequesting: computed(() => r.isCurrentButtonRequesting(t.formID)),
16492
+ click(a) {
16493
+ r.click(t.formID, a.type, a.variableName);
16494
+ },
16491
16495
  setCurrentButton(a) {
16492
16496
  return r.setCurrentButton(t.formID, a);
16493
16497
  },
@@ -16865,7 +16869,9 @@ const KgSearch_ConfigModal_VarProfileMaster = "", getProps$m = () => ({
16865
16869
  var T, g;
16866
16870
  const v = d.value;
16867
16871
  return v.frm_id = r.formID, v.varProfileDetails = (g = (T = n.value) == null ? void 0 : T.filter((m) => s.value.includes(m.id))) != null ? g : [], !1;
16868
- }), a.kgSubmit().onOk(async () => (r.store.retrieve(r.formID), !1)), a.kgButton().onClick((d) => {
16872
+ }), a.kgSubmit().onOk(async () => (r.store.retrieve(r.formID), !1)), a.kgButton().onClick(({
16873
+ button: d
16874
+ }) => {
16869
16875
  const v = a.kgTable().selectedRow.value;
16870
16876
  return (d == null ? void 0 : d.typ) === KG_BUTTON_TYPE.UPDATE && (v == null ? void 0 : v.cust_lvl) === KG_CUSTOM_LEVEL.L0 ? new Promise((T) => {
16871
16877
  KgUtil.confirm({
@@ -22102,7 +22108,9 @@ const getProps$8 = () => ({}), KgPageDdaCreateBasic = defineComponent({
22102
22108
  name: "KgPageDda",
22103
22109
  props: getProps(),
22104
22110
  setup(e) {
22105
- useKgVar(FORM_ID, !0).kgButton().onClick(async (s) => {
22111
+ useKgVar(FORM_ID, !0).kgButton().onClick(async ({
22112
+ button: s
22113
+ }) => {
22106
22114
  switch (s.typ) {
22107
22115
  case KG_BUTTON_TYPE.CREATE:
22108
22116
  return n(), !0;
@@ -1,152 +1,20 @@
1
+ import { ComputedRef } from 'vue';
1
2
  import { VarButton } from '../../apis/WMS/models';
2
- import { KG_BUTTON_TYPE } from '../../consts';
3
- import { IKgButtonClickCb, IKgButtonEvent, IKgButtonImportOkCb, IKgButtonSubmitCancelCb, IKgButtonSubmitSaveCb } from './index.store';
4
- /**
5
- * @param formID 界面标识.
6
- */
7
- export declare function useKgButton(formID?: string | null): {
3
+ import { IRemoveEventListenerHandler, KG_BUTTON_TYPE } from '../../consts';
4
+ import { IKgButtonClickCb, IKgButtonImportOkCb, IKgButtonSubmitCancelCb, IKgButtonSubmitSaveCb, useKgButtonStore } from './index.store';
5
+ export interface IUseKgButton {
6
+ /**
7
+ * 界面标识.
8
+ */
8
9
  formID: string;
9
- store: import("pinia").Store<"KgButton", {
10
- currentButtonMap: Map<string, VarButton | null>;
11
- isCurrentButtonRequestingMap: Map<string, boolean>;
12
- isClickInterceptedMap: Map<string, boolean>;
13
- clickListenersMap: Map<string, IKgButtonClickCb[]>;
14
- importOkListenersMap: Map<string, IKgButtonImportOkCb[]>;
15
- submitCancelListenersMap: Map<string, IKgButtonSubmitCancelCb[]>;
16
- submitSaveListenersMap: Map<string, IKgButtonSubmitSaveCb[]>;
17
- }, {
18
- isClickIntercepted(state: {
19
- currentButtonMap: Map<string, VarButton | null>;
20
- isCurrentButtonRequestingMap: Map<string, boolean>;
21
- isClickInterceptedMap: Map<string, boolean>;
22
- clickListenersMap: Map<string, IKgButtonClickCb[]>;
23
- importOkListenersMap: Map<string, IKgButtonImportOkCb[]>;
24
- submitCancelListenersMap: Map<string, IKgButtonSubmitCancelCb[]>;
25
- submitSaveListenersMap: Map<string, IKgButtonSubmitSaveCb[]>;
26
- } & import("pinia").PiniaCustomStateProperties<{
27
- currentButtonMap: Map<string, VarButton | null>;
28
- isCurrentButtonRequestingMap: Map<string, boolean>;
29
- isClickInterceptedMap: Map<string, boolean>;
30
- clickListenersMap: Map<string, IKgButtonClickCb[]>;
31
- importOkListenersMap: Map<string, IKgButtonImportOkCb[]>;
32
- submitCancelListenersMap: Map<string, IKgButtonSubmitCancelCb[]>;
33
- submitSaveListenersMap: Map<string, IKgButtonSubmitSaveCb[]>;
34
- }>): (formID: string | null | undefined, param: {
35
- type?: KG_BUTTON_TYPE | undefined; /**
36
- * <p>判断某个按钮是否是「当前按钮」.</p>
37
- *
38
- * <ul>
39
- * <li>
40
- * <p>如果参数 {@link param.type} !== <code>undefined</code> && {@link param.type} !== {@link KG_BUTTON_TYPE.OTHER}, 则根据参数 {@link param.type} 获取按钮.</p>
41
- * <p>调用方式如下: <code>isCurrentButton({ type: KG_BUTTON_TYPE.CREATE });</code></p>
42
- * </li>
43
- * <li>
44
- * <p>如果参数 {@link param.type} === <code>undefined</code> || {@link param.type} === {@link KG_BUTTON_TYPE.OTHER}, 则参数 {@link param.varName} 必须传值, 否则报错.</p>
45
- * <p>根据参数 {@link param.varName} 获取按钮.</p>
46
- * <p>调用方式如下: <code>isCurrentButton({ varName: 'SOME-OTHER-BUTTON' });</code></p>
47
- * </li>
48
- * </ul>
49
- *
50
- * @param param.type <p>按钮的类型, 对应的是 {@link VarButton.typ} 属性, 取值请参考 {@link KG_BUTTON_TYPE}.</p>
51
- * @param param.varName <p>按钮的变量名称, 对应的是 {@link VarButton.var_nam} 属性.</p>
52
- */
53
- varName?: string | null | undefined;
54
- }) => boolean;
55
- isCurrentButtonRequesting(state: {
56
- currentButtonMap: Map<string, VarButton | null>;
57
- isCurrentButtonRequestingMap: Map<string, boolean>;
58
- isClickInterceptedMap: Map<string, boolean>;
59
- clickListenersMap: Map<string, IKgButtonClickCb[]>;
60
- importOkListenersMap: Map<string, IKgButtonImportOkCb[]>;
61
- submitCancelListenersMap: Map<string, IKgButtonSubmitCancelCb[]>;
62
- submitSaveListenersMap: Map<string, IKgButtonSubmitSaveCb[]>;
63
- } & import("pinia").PiniaCustomStateProperties<{
64
- currentButtonMap: Map<string, VarButton | null>;
65
- isCurrentButtonRequestingMap: Map<string, boolean>;
66
- isClickInterceptedMap: Map<string, boolean>;
67
- clickListenersMap: Map<string, IKgButtonClickCb[]>;
68
- importOkListenersMap: Map<string, IKgButtonImportOkCb[]>;
69
- submitCancelListenersMap: Map<string, IKgButtonSubmitCancelCb[]>;
70
- submitSaveListenersMap: Map<string, IKgButtonSubmitSaveCb[]>;
71
- }>): (formID: string | null | undefined) => boolean;
72
- getCurrentButton: (state: {
73
- currentButtonMap: Map<string, VarButton | null>;
74
- isCurrentButtonRequestingMap: Map<string, boolean>;
75
- isClickInterceptedMap: Map<string, boolean>;
76
- clickListenersMap: Map<string, IKgButtonClickCb[]>;
77
- importOkListenersMap: Map<string, IKgButtonImportOkCb[]>;
78
- submitCancelListenersMap: Map<string, IKgButtonSubmitCancelCb[]>;
79
- submitSaveListenersMap: Map<string, IKgButtonSubmitSaveCb[]>;
80
- } & import("pinia").PiniaCustomStateProperties<{
81
- currentButtonMap: Map<string, VarButton | null>;
82
- isCurrentButtonRequestingMap: Map<string, boolean>;
83
- isClickInterceptedMap: Map<string, boolean>;
84
- clickListenersMap: Map<string, IKgButtonClickCb[]>;
85
- importOkListenersMap: Map<string, IKgButtonImportOkCb[]>;
86
- submitCancelListenersMap: Map<string, IKgButtonSubmitCancelCb[]>;
87
- submitSaveListenersMap: Map<string, IKgButtonSubmitSaveCb[]>;
88
- }>) => (formID: string | null | undefined) => VarButton | null;
89
- isCurrentButton(state: {
90
- currentButtonMap: Map<string, VarButton | null>;
91
- isCurrentButtonRequestingMap: Map<string, boolean>;
92
- isClickInterceptedMap: Map<string, boolean>;
93
- clickListenersMap: Map<string, IKgButtonClickCb[]>;
94
- importOkListenersMap: Map<string, IKgButtonImportOkCb[]>;
95
- submitCancelListenersMap: Map<string, IKgButtonSubmitCancelCb[]>;
96
- submitSaveListenersMap: Map<string, IKgButtonSubmitSaveCb[]>;
97
- } & import("pinia").PiniaCustomStateProperties<{
98
- currentButtonMap: Map<string, VarButton | null>;
99
- isCurrentButtonRequestingMap: Map<string, boolean>;
100
- isClickInterceptedMap: Map<string, boolean>;
101
- clickListenersMap: Map<string, IKgButtonClickCb[]>;
102
- importOkListenersMap: Map<string, IKgButtonImportOkCb[]>;
103
- submitCancelListenersMap: Map<string, IKgButtonSubmitCancelCb[]>;
104
- submitSaveListenersMap: Map<string, IKgButtonSubmitSaveCb[]>;
105
- }>): (formID: string, param: {
106
- varName?: string | undefined;
107
- type?: KG_BUTTON_TYPE | undefined;
108
- }) => boolean;
109
- getSearchButton(state: {
110
- currentButtonMap: Map<string, VarButton | null>;
111
- isCurrentButtonRequestingMap: Map<string, boolean>;
112
- isClickInterceptedMap: Map<string, boolean>;
113
- clickListenersMap: Map<string, IKgButtonClickCb[]>;
114
- importOkListenersMap: Map<string, IKgButtonImportOkCb[]>;
115
- submitCancelListenersMap: Map<string, IKgButtonSubmitCancelCb[]>;
116
- submitSaveListenersMap: Map<string, IKgButtonSubmitSaveCb[]>;
117
- } & import("pinia").PiniaCustomStateProperties<{
118
- currentButtonMap: Map<string, VarButton | null>;
119
- isCurrentButtonRequestingMap: Map<string, boolean>;
120
- isClickInterceptedMap: Map<string, boolean>;
121
- clickListenersMap: Map<string, IKgButtonClickCb[]>;
122
- importOkListenersMap: Map<string, IKgButtonImportOkCb[]>;
123
- submitCancelListenersMap: Map<string, IKgButtonSubmitCancelCb[]>;
124
- submitSaveListenersMap: Map<string, IKgButtonSubmitSaveCb[]>;
125
- }>): (formID: string | null | undefined) => VarButton | null;
126
- }, {
127
- dispose(formID: string | null | undefined): void;
128
- addEventListener(formID: string, event: IKgButtonEvent, cb: import("./index.store").IKgButtonCb): void;
129
- removeEventListener(formID: string, event: IKgButtonEvent, cb?: import("./index.store").IKgButtonCb | undefined): void;
130
- emit(formID: string, event: IKgButtonEvent, param: any): Promise<boolean>;
131
- setIsClickIntercepted(formID: string | null | undefined, param: {
132
- isIntercepted: boolean;
133
- type?: KG_BUTTON_TYPE | undefined;
134
- varName?: string | null | undefined;
135
- }): void;
136
- setIsCurrentButtonRequesting(formID: string | null | undefined, param: {
137
- isRequesting: boolean;
138
- }): void;
139
- setCurrentButton(formID: string, param: {
140
- type?: KG_BUTTON_TYPE | undefined;
141
- varName?: string | null | undefined;
142
- } | null): Promise<void>;
143
- click(formID: string, type: KG_BUTTON_TYPE, variableName?: string | undefined): void;
144
- }>;
10
+ /**
11
+ * 状态数据.
12
+ */
13
+ store: ReturnType<typeof useKgButtonStore>;
145
14
  /**
146
15
  * <p>手动点击某个按钮.</p>
147
16
  * <p>调用此方法相当于手动触发某个按钮的点击事件.</p>
148
17
  *
149
- * @param param.
150
18
  * @param param.type 按钮类型.
151
19
  * @param param.variableName 按钮变量名称.
152
20
  */
@@ -157,19 +25,19 @@ export declare function useKgButton(formID?: string | null): {
157
25
  /**
158
26
  * <p>「当前按钮」.</p>
159
27
  */
160
- currentButton: import("vue").ComputedRef<VarButton | null>;
28
+ currentButton: ComputedRef<VarButton | null>;
161
29
  /**
162
30
  * <p>「查询按钮」.</p>
163
31
  */
164
- searchButton: import("vue").ComputedRef<VarButton | null>;
32
+ searchButton: ComputedRef<VarButton | null>;
165
33
  /**
166
34
  * <p>判断「当前按钮」的 click 事件是否被拦截.</p>
167
35
  */
168
- isCurrentButtonClickIntercepted: import("vue").ComputedRef<boolean>;
36
+ isCurrentButtonClickIntercepted: ComputedRef<boolean>;
169
37
  /**
170
38
  * <p>判断「当前按钮」是否正在请求后端接口.</p>
171
39
  */
172
- isCurrentButtonRequesting: import("vue").ComputedRef<boolean>;
40
+ isCurrentButtonRequesting: ComputedRef<boolean>;
173
41
  /**
174
42
  * <p>设置「当前按钮」. 比如点击「创建」按钮, 则此时「创建」按钮就是「当前按钮」, 同一时间最多只会有一个按钮处于「正在执行」状态.</p>
175
43
  *
@@ -276,26 +144,34 @@ export declare function useKgButton(formID?: string | null): {
276
144
  }): void;
277
145
  /**
278
146
  * 事件: 点击按钮.
147
+ *
279
148
  * @param cb 回调函数.
280
149
  * @param once 是否只会触发一次. 默认为 undefined.
281
150
  */
282
- onClick: (cb: IKgButtonClickCb, once?: boolean | undefined) => import("../../consts").IRemoveEventListenerHandler;
151
+ onClick(cb: IKgButtonClickCb, once?: boolean): IRemoveEventListenerHandler;
283
152
  /**
284
153
  * 事件: 导入成功, 导入接口调用成功.
154
+ *
285
155
  * @param cb 回调函数.
286
156
  * @param once 是否只会触发一次. 默认为 undefined.
287
157
  */
288
- onImportOk: (cb: IKgButtonImportOkCb, once?: boolean | undefined) => import("../../consts").IRemoveEventListenerHandler;
158
+ onImportOk(cb: IKgButtonImportOkCb, once?: boolean): IRemoveEventListenerHandler;
289
159
  /**
290
160
  * 事件: 表格内编辑时, 点击保存按钮.
161
+ *
291
162
  * @param cb 回调函数.
292
163
  * @param once 是否只会触发一次. 默认为 undefined.
293
164
  */
294
- onSubmitSave: (cb: IKgButtonSubmitSaveCb, once?: boolean | undefined) => import("../../consts").IRemoveEventListenerHandler;
165
+ onSubmitSave(cb: IKgButtonSubmitSaveCb, once?: boolean): IRemoveEventListenerHandler;
295
166
  /**
296
167
  * 事件: 表格内编辑时, 点击取消按钮.
168
+ *
297
169
  * @param cb 回调函数.
298
170
  * @param once 是否只会触发一次. 默认为 undefined.
299
171
  */
300
- onSubmitCancel: (cb: IKgButtonSubmitCancelCb, once?: boolean | undefined) => import("../../consts").IRemoveEventListenerHandler;
301
- };
172
+ onSubmitCancel(cb: IKgButtonSubmitCancelCb, once?: boolean): IRemoveEventListenerHandler;
173
+ }
174
+ /**
175
+ * @param formID 界面标识.
176
+ */
177
+ export declare function useKgButton(formID?: string | null): IUseKgButton;
@@ -9,16 +9,19 @@ import { IKgEventCb, KG_BUTTON_TYPE } from '../../consts';
9
9
  */
10
10
  export declare type IKgButtonEvent = 'click' | 'importOk' | 'submitSave' | 'submitCancel';
11
11
  export declare type IKgButtonClickCbParam = {
12
+ /**
13
+ * 被点击的按钮.
14
+ */
12
15
  button: VarButton;
13
16
  };
14
- export declare type IKgButtonClickCb = ((button: VarButton) => Promise<boolean>) & IKgEventCb;
17
+ export declare type IKgButtonClickCb = ((param: IKgButtonClickCbParam) => Promise<boolean>) & IKgEventCb;
15
18
  export declare type IKgButtonImportOkCbParam = {
16
19
  button?: VarButton | null;
17
20
  };
18
21
  export declare type IKgButtonImportOkCb = ((args: IKgButtonImportOkCbParam) => Promise<boolean>) & IKgEventCb;
19
22
  export declare type IKgButtonSubmitSaveCb = (() => Promise<boolean>) & IKgEventCb;
20
23
  export declare type IKgButtonSubmitCancelCb = (() => Promise<boolean>) & IKgEventCb;
21
- export declare type IKgButtonCbParam = IKgButtonClickCbParam | IKgButtonImportOkCbParam | any;
24
+ export declare type IKgButtonCbParam = IKgButtonClickCbParam | IKgButtonImportOkCbParam;
22
25
  export declare type IKgButtonCb = IKgButtonClickCb | IKgButtonImportOkCb | IKgButtonSubmitSaveCb | IKgButtonSubmitCancelCb;
23
26
  export declare const useKgButtonStore: import("pinia").StoreDefinition<"KgButton", {
24
27
  /**
@@ -161,161 +161,7 @@ export declare function useKgVar(formID?: string | null, isInit?: boolean, level
161
161
  /**
162
162
  * 等价于 {@link useKgButton()}.
163
163
  */
164
- kgButton(): {
165
- formID: string;
166
- store: import("pinia").Store<"KgButton", {
167
- currentButtonMap: Map<string, import("../../apis/WMS/models").VarButton | null>;
168
- isCurrentButtonRequestingMap: Map<string, boolean>;
169
- isClickInterceptedMap: Map<string, boolean>;
170
- clickListenersMap: Map<string, import("../KgButton").IKgButtonClickCb[]>;
171
- importOkListenersMap: Map<string, import("../KgButton").IKgButtonImportOkCb[]>;
172
- submitCancelListenersMap: Map<string, import("../KgButton").IKgButtonSubmitCancelCb[]>;
173
- submitSaveListenersMap: Map<string, import("../KgButton").IKgButtonSubmitSaveCb[]>;
174
- }, {
175
- isClickIntercepted(state: {
176
- currentButtonMap: Map<string, import("../../apis/WMS/models").VarButton | null>;
177
- isCurrentButtonRequestingMap: Map<string, boolean>;
178
- isClickInterceptedMap: Map<string, boolean>;
179
- clickListenersMap: Map<string, import("../KgButton").IKgButtonClickCb[]>;
180
- importOkListenersMap: Map<string, import("../KgButton").IKgButtonImportOkCb[]>;
181
- submitCancelListenersMap: Map<string, import("../KgButton").IKgButtonSubmitCancelCb[]>;
182
- submitSaveListenersMap: Map<string, import("../KgButton").IKgButtonSubmitSaveCb[]>;
183
- } & import("pinia").PiniaCustomStateProperties<{
184
- currentButtonMap: Map<string, import("../../apis/WMS/models").VarButton | null>;
185
- isCurrentButtonRequestingMap: Map<string, boolean>;
186
- isClickInterceptedMap: Map<string, boolean>;
187
- clickListenersMap: Map<string, import("../KgButton").IKgButtonClickCb[]>;
188
- importOkListenersMap: Map<string, import("../KgButton").IKgButtonImportOkCb[]>;
189
- submitCancelListenersMap: Map<string, import("../KgButton").IKgButtonSubmitCancelCb[]>;
190
- submitSaveListenersMap: Map<string, import("../KgButton").IKgButtonSubmitSaveCb[]>;
191
- }>): (formID: string | null | undefined, param: {
192
- type?: KG_BUTTON_TYPE | undefined;
193
- varName?: string | null | undefined;
194
- }) => boolean;
195
- isCurrentButtonRequesting(state: {
196
- currentButtonMap: Map<string, import("../../apis/WMS/models").VarButton | null>;
197
- isCurrentButtonRequestingMap: Map<string, boolean>;
198
- isClickInterceptedMap: Map<string, boolean>;
199
- clickListenersMap: Map<string, import("../KgButton").IKgButtonClickCb[]>;
200
- importOkListenersMap: Map<string, import("../KgButton").IKgButtonImportOkCb[]>;
201
- submitCancelListenersMap: Map<string, import("../KgButton").IKgButtonSubmitCancelCb[]>;
202
- submitSaveListenersMap: Map<string, import("../KgButton").IKgButtonSubmitSaveCb[]>;
203
- } & import("pinia").PiniaCustomStateProperties<{
204
- currentButtonMap: Map<string, import("../../apis/WMS/models").VarButton | null>;
205
- isCurrentButtonRequestingMap: Map<string, boolean>;
206
- isClickInterceptedMap: Map<string, boolean>;
207
- clickListenersMap: Map<string, import("../KgButton").IKgButtonClickCb[]>;
208
- importOkListenersMap: Map<string, import("../KgButton").IKgButtonImportOkCb[]>;
209
- submitCancelListenersMap: Map<string, import("../KgButton").IKgButtonSubmitCancelCb[]>;
210
- submitSaveListenersMap: Map<string, import("../KgButton").IKgButtonSubmitSaveCb[]>;
211
- }>): (formID: string | null | undefined) => boolean;
212
- getCurrentButton: (state: {
213
- currentButtonMap: Map<string, import("../../apis/WMS/models").VarButton | null>;
214
- isCurrentButtonRequestingMap: Map<string, boolean>;
215
- isClickInterceptedMap: Map<string, boolean>;
216
- clickListenersMap: Map<string, import("../KgButton").IKgButtonClickCb[]>;
217
- importOkListenersMap: Map<string, import("../KgButton").IKgButtonImportOkCb[]>;
218
- submitCancelListenersMap: Map<string, import("../KgButton").IKgButtonSubmitCancelCb[]>;
219
- submitSaveListenersMap: Map<string, import("../KgButton").IKgButtonSubmitSaveCb[]>;
220
- } & import("pinia").PiniaCustomStateProperties<{
221
- currentButtonMap: Map<string, import("../../apis/WMS/models").VarButton | null>;
222
- isCurrentButtonRequestingMap: Map<string, boolean>;
223
- isClickInterceptedMap: Map<string, boolean>;
224
- clickListenersMap: Map<string, import("../KgButton").IKgButtonClickCb[]>;
225
- importOkListenersMap: Map<string, import("../KgButton").IKgButtonImportOkCb[]>;
226
- submitCancelListenersMap: Map<string, import("../KgButton").IKgButtonSubmitCancelCb[]>;
227
- submitSaveListenersMap: Map<string, import("../KgButton").IKgButtonSubmitSaveCb[]>;
228
- }>) => (formID: string | null | undefined) => import("../../apis/WMS/models").VarButton | null;
229
- isCurrentButton(state: {
230
- currentButtonMap: Map<string, import("../../apis/WMS/models").VarButton | null>;
231
- isCurrentButtonRequestingMap: Map<string, boolean>;
232
- isClickInterceptedMap: Map<string, boolean>;
233
- clickListenersMap: Map<string, import("../KgButton").IKgButtonClickCb[]>;
234
- importOkListenersMap: Map<string, import("../KgButton").IKgButtonImportOkCb[]>;
235
- submitCancelListenersMap: Map<string, import("../KgButton").IKgButtonSubmitCancelCb[]>;
236
- submitSaveListenersMap: Map<string, import("../KgButton").IKgButtonSubmitSaveCb[]>;
237
- } & import("pinia").PiniaCustomStateProperties<{
238
- currentButtonMap: Map<string, import("../../apis/WMS/models").VarButton | null>;
239
- isCurrentButtonRequestingMap: Map<string, boolean>;
240
- isClickInterceptedMap: Map<string, boolean>;
241
- clickListenersMap: Map<string, import("../KgButton").IKgButtonClickCb[]>;
242
- importOkListenersMap: Map<string, import("../KgButton").IKgButtonImportOkCb[]>;
243
- submitCancelListenersMap: Map<string, import("../KgButton").IKgButtonSubmitCancelCb[]>;
244
- submitSaveListenersMap: Map<string, import("../KgButton").IKgButtonSubmitSaveCb[]>;
245
- }>): (formID: string, param: {
246
- varName?: string | undefined;
247
- type?: KG_BUTTON_TYPE | undefined;
248
- }) => boolean;
249
- getSearchButton(state: {
250
- currentButtonMap: Map<string, import("../../apis/WMS/models").VarButton | null>;
251
- isCurrentButtonRequestingMap: Map<string, boolean>;
252
- isClickInterceptedMap: Map<string, boolean>;
253
- clickListenersMap: Map<string, import("../KgButton").IKgButtonClickCb[]>;
254
- importOkListenersMap: Map<string, import("../KgButton").IKgButtonImportOkCb[]>;
255
- submitCancelListenersMap: Map<string, import("../KgButton").IKgButtonSubmitCancelCb[]>;
256
- submitSaveListenersMap: Map<string, import("../KgButton").IKgButtonSubmitSaveCb[]>;
257
- } & import("pinia").PiniaCustomStateProperties<{
258
- currentButtonMap: Map<string, import("../../apis/WMS/models").VarButton | null>;
259
- isCurrentButtonRequestingMap: Map<string, boolean>;
260
- isClickInterceptedMap: Map<string, boolean>;
261
- clickListenersMap: Map<string, import("../KgButton").IKgButtonClickCb[]>;
262
- importOkListenersMap: Map<string, import("../KgButton").IKgButtonImportOkCb[]>;
263
- submitCancelListenersMap: Map<string, import("../KgButton").IKgButtonSubmitCancelCb[]>;
264
- submitSaveListenersMap: Map<string, import("../KgButton").IKgButtonSubmitSaveCb[]>;
265
- }>): (formID: string | null | undefined) => import("../../apis/WMS/models").VarButton | null;
266
- }, {
267
- dispose(formID: string | null | undefined): void;
268
- addEventListener(formID: string, event: import("../KgButton").IKgButtonEvent, cb: import("../KgButton").IKgButtonCb): void;
269
- removeEventListener(formID: string, event: import("../KgButton").IKgButtonEvent, cb?: import("../KgButton").IKgButtonCb | undefined): void;
270
- emit(formID: string, event: import("../KgButton").IKgButtonEvent, param: any): Promise<boolean>;
271
- setIsClickIntercepted(formID: string | null | undefined, param: {
272
- isIntercepted: boolean;
273
- type?: KG_BUTTON_TYPE | undefined;
274
- varName?: string | null | undefined;
275
- }): void;
276
- setIsCurrentButtonRequesting(formID: string | null | undefined, param: {
277
- isRequesting: boolean;
278
- }): void;
279
- setCurrentButton(formID: string, param: {
280
- type?: KG_BUTTON_TYPE | undefined;
281
- varName?: string | null | undefined;
282
- } | null): Promise<void>;
283
- click(formID: string, type: KG_BUTTON_TYPE, variableName?: string | undefined): void;
284
- }>;
285
- click(param: {
286
- type: KG_BUTTON_TYPE;
287
- variableName?: string | undefined;
288
- }): void;
289
- currentButton: ComputedRef<import("../../apis/WMS/models").VarButton | null>;
290
- searchButton: ComputedRef<import("../../apis/WMS/models").VarButton | null>;
291
- isCurrentButtonClickIntercepted: ComputedRef<boolean>;
292
- isCurrentButtonRequesting: ComputedRef<boolean>;
293
- setCurrentButton(param: {
294
- type?: KG_BUTTON_TYPE | undefined;
295
- varName?: string | null | undefined;
296
- } | null): Promise<void>;
297
- isCurrentButton(param: {
298
- type?: KG_BUTTON_TYPE | undefined;
299
- varName?: string | undefined;
300
- }): boolean;
301
- isClickIntercepted(param: {
302
- type?: KG_BUTTON_TYPE | undefined;
303
- varName?: string | null | undefined;
304
- }): boolean;
305
- setIsClickIntercepted(param: {
306
- isIntercepted: boolean;
307
- type?: KG_BUTTON_TYPE | undefined;
308
- varName?: string | null | undefined;
309
- }): void;
310
- setIsCurrentButtonRequesting(param: {
311
- isRequesting: boolean;
312
- }): void;
313
- onClick: (cb: import("../KgButton").IKgButtonClickCb, once?: boolean | undefined) => import("../../consts").IRemoveEventListenerHandler;
314
- onImportOk: (cb: import("../KgButton").IKgButtonImportOkCb, once?: boolean | undefined) => import("../../consts").IRemoveEventListenerHandler;
315
- onSubmitSave: (cb: import("../KgButton").IKgButtonSubmitSaveCb, once?: boolean | undefined) => import("../../consts").IRemoveEventListenerHandler;
316
- /** 所有的 VarProfileMaster 列表. */
317
- onSubmitCancel: (cb: import("../KgButton").IKgButtonSubmitCancelCb, once?: boolean | undefined) => import("../../consts").IRemoveEventListenerHandler;
318
- };
164
+ kgButton(): import("../KgButton").IUseKgButton;
319
165
  /**
320
166
  * 等价于 {@link useKgTable()}.
321
167
  */
@@ -7,9 +7,10 @@ export declare class KgRouteUtil {
7
7
  */
8
8
  static addOnlineRoutesForAllApps(routes: any[]): any[];
9
9
  /**
10
- * 根据地址获取菜单.
10
+ * 根据菜单地址地址获取菜单.
11
+ *
11
12
  * @param menus 菜单列表.
12
- * @param path 地址.
13
+ * @param path 菜单地址.
13
14
  * @return {} 如果能找到某个菜单的地址等于传入的地址, 则返回该菜单, 否则返回 null.
14
15
  */
15
16
  static getMenuByPath(menus: Array<Menu> | null | undefined, path: string): Menu | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kengic/vue",
3
- "version": "0.22.0",
3
+ "version": "0.22.1-beta.0",
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",