@kengic/vue 0.6.10-beta.8 → 0.6.10

Sign up to get free protection for your applications and to get access to all the features.
@@ -5863,6 +5863,7 @@ const without$1 = without, en = {
5863
5863
  add: "Add",
5864
5864
  button: "Button",
5865
5865
  cancel: "Cancel",
5866
+ close: "Close",
5866
5867
  confirm: "Confirm",
5867
5868
  confirmDelete: "Confirm delete ?",
5868
5869
  copy: "Copy",
@@ -6005,6 +6006,7 @@ const without$1 = without, en = {
6005
6006
  add: "\u65B0\u589E",
6006
6007
  button: "\u6309\u94AE",
6007
6008
  cancel: "\u53D6\u6D88",
6009
+ close: "\u5173\u95ED",
6008
6010
  confirm: "\u786E\u8BA4",
6009
6011
  confirmDelete: "\u786E\u8BA4\u5220\u9664 ?",
6010
6012
  copy: "\u590D\u5236",
@@ -6989,7 +6991,7 @@ const useKgAppSelectStore = () => (store$8 || (store$8 = defineStore("KgAppSelec
6989
6991
  }
6990
6992
  },
6991
6993
  emit(e, t) {
6992
- let r;
6994
+ let r, a = Promise.resolve(!1);
6993
6995
  switch (e) {
6994
6996
  case "gotoApp":
6995
6997
  r = this.gotoAppListenersMap.get("0");
@@ -6998,13 +7000,10 @@ const useKgAppSelectStore = () => (store$8 || (store$8 = defineStore("KgAppSelec
6998
7000
  r = this.gotoPathListenersMap.get("0");
6999
7001
  break;
7000
7002
  }
7001
- if (r) {
7002
- let a = Promise.resolve(!1);
7003
+ if (r)
7003
7004
  for (let n = 0; n < r.length; n++)
7004
7005
  a = r[n](t != null ? t : null);
7005
- return a;
7006
- }
7007
- return Promise.resolve(!1);
7006
+ return a;
7008
7007
  },
7009
7008
  async gotoApp(e) {
7010
7009
  const t = useKg();
@@ -9825,13 +9824,7 @@ const KgFormItemRadioGroup = defineComponent({
9825
9824
  case KG_FORM_ITEM_TYPE.SELECT:
9826
9825
  return createVNode(KgFormItemSelect, b.value, null);
9827
9826
  case KG_FORM_ITEM_TYPE.SWITCH:
9828
- switch (e.kgContext) {
9829
- case KG_FORM_CONTEXT.SEARCH:
9830
- return createVNode(KgFormItemSelect, b.value, null);
9831
- case KG_FORM_CONTEXT.SUBMIT:
9832
- default:
9833
- return createVNode(KgFormItemSwitch, b.value, null);
9834
- }
9827
+ return createVNode(KgFormItemSwitch, b.value, null);
9835
9828
  case KG_FORM_ITEM_TYPE.CHECKBOX:
9836
9829
  return createVNode(KgFormItemCheckbox, b.value, null);
9837
9830
  case KG_FORM_ITEM_TYPE.CHECKBOX_GROUP:
@@ -9966,7 +9959,7 @@ const useKgFormStore = () => (store$6 || (store$6 = defineStore("KgForm", {
9966
9959
  }
9967
9960
  },
9968
9961
  emit(e, t, r) {
9969
- let a;
9962
+ let a, n = Promise.resolve(!1);
9970
9963
  switch (t) {
9971
9964
  case "lookupBeforeOk":
9972
9965
  a = this.lookupBeforeOkListenersMap.get(e);
@@ -9975,13 +9968,10 @@ const useKgFormStore = () => (store$6 || (store$6 = defineStore("KgForm", {
9975
9968
  a = this.lookupOkListenersMap.get(e);
9976
9969
  break;
9977
9970
  }
9978
- if (a) {
9979
- let n = Promise.resolve(!1);
9971
+ if (a)
9980
9972
  for (let o = 0; o < a.length; o++)
9981
9973
  n = a[o](r != null ? r : null);
9982
- return n;
9983
- }
9984
- return Promise.resolve(!1);
9974
+ return n;
9985
9975
  }
9986
9976
  }
9987
9977
  }).bind(null, pinia())), store$6);
@@ -10160,7 +10150,7 @@ const useKgSubmitStore = () => (store$5 || (store$5 = defineStore("KgSubmit", {
10160
10150
  }
10161
10151
  },
10162
10152
  emit(e, t, r) {
10163
- let a;
10153
+ let a, n = Promise.resolve(!1);
10164
10154
  switch (t) {
10165
10155
  case "open":
10166
10156
  a = this.openListenersMap.get(e);
@@ -10188,15 +10178,14 @@ const useKgSubmitStore = () => (store$5 || (store$5 = defineStore("KgSubmit", {
10188
10178
  break;
10189
10179
  }
10190
10180
  if (a) {
10191
- const n = [];
10192
- let o = Promise.resolve(!1);
10181
+ const o = [];
10193
10182
  for (let i = 0; i < a.length; i++) {
10194
10183
  const s = a[i];
10195
- s.once && !s.invoked && (s.invoked = !0, n.push(s)), o = s(r);
10184
+ s.once && !s.invoked && (s.invoked = !0, o.push(s)), n = s(r);
10196
10185
  }
10197
- return n.forEach((i) => this.removeEventListener(e, t, i)), o;
10186
+ o.forEach((i) => this.removeEventListener(e, t, i));
10198
10187
  }
10199
- return Promise.resolve(!1);
10188
+ return n;
10200
10189
  },
10201
10190
  setIsLoading(e, t) {
10202
10191
  this.isLoadingMap.set(e, t);
@@ -10592,7 +10581,7 @@ const getProps$p = () => ({
10592
10581
  return u.value ? 398 : (B = (L = m.value) == null ? void 0 : L.max_width) != null ? B : DEFAULT_MAX_WIDTH;
10593
10582
  }), P = computed(() => u.value ? 398 : A.value.kgWidth), V = ref(null);
10594
10583
  _useResizeObserver$1(V);
10595
- const D = _useTitle(), O = computed(() => u.value ? 400 : A.value.kgWidth && A.value.kgWidth > 0 ? A.value.kgWidth + 2 : 0), R = computed(() => O.value === 0 ? !1 : !!(o.isCreating.value || o.isUpdating.value || o.isCopying.value || o.isDeleting.value)), x = reactive({
10584
+ const D = _useTitle(), O = computed(() => u.value ? 400 : A.value.kgWidth && A.value.kgWidth > 0 ? "auto" : 0), R = computed(() => O.value === 0 ? !1 : !!(o.isCreating.value || o.isUpdating.value || o.isCopying.value || o.isDeleting.value)), x = reactive({
10596
10585
  isFullscreen: !1
10597
10586
  }), {
10598
10587
  getClass: G
@@ -11065,9 +11054,9 @@ const useKgTableStore = () => (store$4 || (store$4 = defineStore("KgTable", {
11065
11054
  getSelectedRowKeys(e) {
11066
11055
  return (t) => {
11067
11056
  if (!t)
11068
- return KgLogger.error("formID \u4E3A\u7A7A."), null;
11057
+ return KgLogger.error("formID \u4E3A\u7A7A."), ref([]);
11069
11058
  let r = e.selectedRowKeysMap.get(t);
11070
- return r || (r = ref([]), e.selectedRowKeysMap.set(t, r)), r != null ? r : null;
11059
+ return r || (r = ref([]), e.selectedRowKeysMap.set(t, r)), r;
11071
11060
  };
11072
11061
  },
11073
11062
  getSelectedRows(e) {
@@ -11164,7 +11153,7 @@ const useKgTableStore = () => (store$4 || (store$4 = defineStore("KgTable", {
11164
11153
  }
11165
11154
  },
11166
11155
  emit(e, t, r) {
11167
- let a;
11156
+ let a, n = Promise.resolve(!1);
11168
11157
  switch (t) {
11169
11158
  case "rowDoubleClick":
11170
11159
  a = this.rowDoubleClickListenersMap.get(e);
@@ -11177,25 +11166,21 @@ const useKgTableStore = () => (store$4 || (store$4 = defineStore("KgTable", {
11177
11166
  break;
11178
11167
  }
11179
11168
  if (a) {
11180
- const n = [];
11181
- let o = Promise.resolve(!1);
11169
+ const o = [];
11182
11170
  for (let i = 0; i < a.length; i++) {
11183
11171
  const s = a[i];
11184
- s.once && !s.invoked && (s.invoked = !0, n.push(s)), o = s(r);
11172
+ s.once && !s.invoked && (s.invoked = !0, o.push(s)), n = s(r);
11185
11173
  }
11186
- return n.forEach((i) => this.removeEventListener(e, t, i)), o;
11174
+ o.forEach((i) => this.removeEventListener(e, t, i));
11187
11175
  }
11188
- return Promise.resolve(!1);
11176
+ return n;
11189
11177
  },
11190
11178
  setSelectedRows(e, t) {
11191
- var n, o;
11179
+ var o, i;
11192
11180
  const r = useKgVar(e);
11193
11181
  this.selectedRowsMap.set(e, unref(toRaw(t)));
11194
- const a = this.getSelectedRowKeys(e);
11195
- if (a) {
11196
- const i = (o = (n = r.varGridConfig.value) == null ? void 0 : n.id_clm) != null ? o : "id";
11197
- a.value = t.map((s) => s[i]);
11198
- }
11182
+ const a = (i = (o = r.varGridConfig.value) == null ? void 0 : o.id_clm) != null ? i : "id", n = this.getSelectedRowKeys(e);
11183
+ n.value = t.map((s) => s[a]);
11199
11184
  },
11200
11185
  setRowSelect(e, t, r) {
11201
11186
  },
@@ -11976,11 +11961,9 @@ const KgTable$1 = "", getProps$g = () => ({
11976
11961
  }) {
11977
11962
  var fe;
11978
11963
  const a = inject("$dayjs", dayjs), n = inject(DI_KG_VAR__KG_SLOTS, null), o = inject(DI_KG_VAR__KG_PROPS, null), i = useKg(), s = useKgVar(), l = useKgSearch(), c = useKgButton(), u = useKgTable(), d = useKgSubmit();
11979
- l.onSearch((K) => {
11980
- G(K);
11981
- }), l.onReset(() => {
11982
- G(!0);
11983
- }), u.store.$onAction(async ({
11964
+ l.onSearch(async ({
11965
+ resetPageIndex: K
11966
+ }) => (G(K), !1)), l.onReset(async () => (G(!0), !1)), u.store.$onAction(async ({
11984
11967
  name: K,
11985
11968
  args: U
11986
11969
  }) => {
@@ -12525,7 +12508,7 @@ const useKgButtonStore = () => (store$3 || (store$3 = defineStore("KgButton", {
12525
12508
  }
12526
12509
  },
12527
12510
  emit(e, t, r) {
12528
- let a;
12511
+ let a, n = Promise.resolve(!1);
12529
12512
  switch (t) {
12530
12513
  case "click":
12531
12514
  a = this.clickListenersMap.get(e);
@@ -12543,13 +12526,10 @@ const useKgButtonStore = () => (store$3 || (store$3 = defineStore("KgButton", {
12543
12526
  a = this.submitCancelListenersMap.get(e);
12544
12527
  break;
12545
12528
  }
12546
- if (a) {
12547
- let n = Promise.resolve(!1);
12529
+ if (a)
12548
12530
  for (let o = 0; o < a.length; o++)
12549
12531
  n = a[o](r != null ? r : null);
12550
- return n;
12551
- }
12552
- return Promise.resolve(!1);
12532
+ return n;
12553
12533
  },
12554
12534
  click(e, t, r, a) {
12555
12535
  }
@@ -13384,36 +13364,31 @@ const useKgSearchStore = () => (store$2 || (store$2 = defineStore("KgSearch", {
13384
13364
  }
13385
13365
  },
13386
13366
  emit(e, t, r) {
13387
- const n = [...useKgVar(e).store.getVarGridConfigMap.values()].filter((o) => (o == null ? void 0 : o.prf_frm_id) === e).map((o) => o == null ? void 0 : o.frm_id).filter((o) => !!o);
13388
- for (let o of [e, ...n])
13367
+ const n = [...useKgVar(e).store.getVarGridConfigMap.values()].filter((i) => (i == null ? void 0 : i.prf_frm_id) === e).map((i) => i == null ? void 0 : i.frm_id).filter((i) => !!i);
13368
+ let o = Promise.resolve(!1);
13369
+ for (let i of [e, ...n]) {
13370
+ let s;
13389
13371
  switch (t) {
13390
13372
  case "search":
13391
- {
13392
- const i = this.onSearchListenersMap.get(o);
13393
- i && i.forEach((s) => s(r == null ? void 0 : r.resetPageIndex));
13394
- }
13373
+ s = this.onSearchListenersMap.get(i);
13395
13374
  break;
13396
13375
  case "reset":
13397
- {
13398
- const i = this.onResetListenersMap.get(o);
13399
- i && i.forEach((s) => s({}));
13400
- }
13376
+ s = this.onResetListenersMap.get(i);
13401
13377
  break;
13402
13378
  case "ready":
13403
- {
13404
- const i = this.onReadyListenersMap.get(o);
13405
- if (i) {
13406
- const s = [];
13407
- Promise.resolve(!1);
13408
- for (let l = 0; l < i.length; l++) {
13409
- const c = i[l];
13410
- c.once && !c.invoked && (c.invoked = !0, s.push(c)), c(r);
13411
- }
13412
- s.forEach((l) => this.removeEventListener(o, "ready", l));
13413
- }
13414
- }
13379
+ s = this.onReadyListenersMap.get(i);
13415
13380
  break;
13416
13381
  }
13382
+ if (s) {
13383
+ const l = [];
13384
+ for (let c = 0; c < s.length; c++) {
13385
+ const u = s[c];
13386
+ u.once && !u.invoked && (u.invoked = !0, l.push(u)), o = u(r);
13387
+ }
13388
+ l.forEach((c) => this.removeEventListener(i, t, c));
13389
+ }
13390
+ }
13391
+ return o;
13417
13392
  },
13418
13393
  setIsReady(e, t) {
13419
13394
  !e || this.isReadyMap.set(e, !!t);
@@ -13970,16 +13945,16 @@ function _useFormModel(e, t) {
13970
13945
  } = _useCommon();
13971
13946
  let s;
13972
13947
  const l = ref({});
13973
- return watch(a.currentVarProfileDetails, (c) => {
13948
+ return watch(a.currentVarProfileDetails, async (c) => {
13974
13949
  l.value = {}, c != null && c.length && (c.forEach((u) => {
13975
13950
  var m, v;
13976
13951
  const d = (m = u.var_nam) != null ? m : "";
13977
13952
  l.value[d] = KgVarUtil.transformValueByControlType(a.formID, d, r, (v = u.dft_val) != null ? v : void 0, "R");
13978
- }), t.value.kgHeight = i.value, n.store.setModel(a.formID, l.value), o.value ? (s == null || s(), s = watch(e, (u) => {
13979
- u && (n.store.emit(a.formID, "ready"), n.store.setIsReady(a.formID, !0));
13953
+ }), t.value.kgHeight = i.value, n.store.setModel(a.formID, l.value), o.value ? (s == null || s(), s = watch(e, async (u) => {
13954
+ u && (await n.store.emit(a.formID, "ready", {}), n.store.setIsReady(a.formID, !0));
13980
13955
  }, {
13981
13956
  immediate: !0
13982
- })) : (n.store.emit(a.formID, "ready"), n.store.setIsReady(a.formID, !0)));
13957
+ })) : (await n.store.emit(a.formID, "ready", {}), n.store.setIsReady(a.formID, !0)));
13983
13958
  }, {
13984
13959
  immediate: !0
13985
13960
  }), {
@@ -14029,29 +14004,29 @@ const KgSearch$1 = "", getProps$9 = () => ({}), KgSearch = defineComponent({
14029
14004
  onUnmounted(() => {
14030
14005
  n.store.dispose(a.formID);
14031
14006
  });
14032
- function M(O = !1) {
14033
- T.value || (i.value ? m.value && m.value.validate().then(() => {
14034
- n.store.emit(a.formID, "search", {
14007
+ async function M(O = !1) {
14008
+ T.value || (i.value ? m.value && m.value.validate().then(async () => {
14009
+ await n.store.emit(a.formID, "search", {
14035
14010
  resetPageIndex: O
14036
14011
  });
14037
14012
  }).catch((R) => {
14038
14013
  KgLogger.debug(`${a.formID} | KgSearch | onSearch() | \u8868\u5355\u9A8C\u8BC1\u5931\u8D25.`, {
14039
14014
  e: R
14040
14015
  });
14041
- }) : n.store.emit(a.formID, "search", {
14016
+ }) : await n.store.emit(a.formID, "search", {
14042
14017
  resetPageIndex: O
14043
14018
  }));
14044
14019
  }
14045
14020
  n.store.setSearchFn(a.formID, M);
14046
- function A() {
14021
+ async function A() {
14047
14022
  var O;
14048
- (O = m.value) == null || O.resetFields(), i.value ? m.value && m.value.validate().then(() => {
14049
- n.store.emit(a.formID, "reset");
14023
+ (O = m.value) == null || O.resetFields(), i.value ? m.value && m.value.validate().then(async () => {
14024
+ await n.store.emit(a.formID, "reset", {});
14050
14025
  }).catch((R) => {
14051
14026
  KgLogger.debug("[KgSearch] \u8868\u5355\u9A8C\u8BC1\u5931\u8D25", {
14052
14027
  e: R
14053
14028
  });
14054
- }) : n.store.emit(a.formID, "reset");
14029
+ }) : await n.store.emit(a.formID, "reset", {});
14055
14030
  }
14056
14031
  n.store.setResetFn(a.formID, A);
14057
14032
  function w() {
@@ -7,17 +7,17 @@ import { IKgEventCb } from '../../consts';
7
7
  * 'ready': 查询字段初始完成, 查询组件渲染完成
8
8
  */
9
9
  export declare type IKgSearchEvent = 'search' | 'reset' | 'ready';
10
- /** 事件参数. */
11
- export declare type IKgSearchEventParam = {
10
+ /** 事件监听函数: search. */
11
+ export declare type IKgSearchSearchCbParam = {
12
12
  /** 是否从第一页开始查询. */
13
13
  resetPageIndex?: boolean;
14
14
  };
15
- /** 事件监听函数: search. */
16
- export declare type IKgSearchSearchCb = ((resetPageIndex?: boolean) => void) & IKgEventCb;
17
- /** 事件监听函数: 'reset'. */
18
- export declare type IKgSearchResetCb = ((param: any) => void) & IKgEventCb;
19
- /** 事件监听函数: 'ready'. */
20
- export declare type IKgSearchReadyCb = ((param: any) => void) & IKgEventCb;
15
+ export declare type IKgSearchSearchCb = ((param: IKgSearchSearchCbParam) => Promise<boolean>) & IKgEventCb;
16
+ /** 事件监听函数: reset. */
17
+ export declare type IKgSearchResetCb = ((param: any) => Promise<boolean>) & IKgEventCb;
18
+ /** 事件监听函数: ready. */
19
+ export declare type IKgSearchReadyCb = ((param: any) => Promise<boolean>) & IKgEventCb;
20
+ export declare type IKgSearchCbParam = IKgSearchSearchCbParam;
21
21
  export declare type IKgSearchCb = IKgSearchSearchCb | IKgSearchResetCb | IKgSearchReadyCb;
22
22
  /** 查询方法. */
23
23
  export declare type IKgSearchSearchFn = (resetPageIndex?: boolean) => void;
@@ -55,7 +55,7 @@ export declare type IKgSearchStoreDefinition = StoreDefinition<'KgSearch', IKgSe
55
55
  * @param event 事件名称.
56
56
  * @param param 事件参数.
57
57
  */
58
- emit(formID: string, event: IKgSearchEvent, param?: IKgSearchEventParam): void;
58
+ emit(formID: string, event: IKgSearchEvent, param: IKgSearchCbParam): Promise<boolean>;
59
59
  /**
60
60
  * 设置是否就绪.
61
61
  * @param formID 界面标识.
@@ -119,7 +119,7 @@ export declare type IKgSubmitStoreDefinition = StoreDefinition<'KgSubmit', IKgSu
119
119
  * 触发事件.
120
120
  * @param formID 界面标识.
121
121
  * @param event 事件名称.
122
- * @param param 数据.
122
+ * @param param 事件参数.
123
123
  */
124
124
  emit(formID: string, event: IKgSubmitEvent, param: IKgSubmitCbParam): Promise<boolean>;
125
125
  setIsLoading(formID: string, value: boolean): void;
@@ -57,7 +57,7 @@ export interface IKgTableState {
57
57
  }
58
58
  export declare type IKgTableStoreDefinition = StoreDefinition<'KgTable', IKgTableState, {
59
59
  /** 当前勾选的所有行的主键. */
60
- getSelectedRowKeys(): (formID?: string | null) => Ref<Array<Key>> | null;
60
+ getSelectedRowKeys(): (formID?: string | null) => Ref<Array<Key>>;
61
61
  /** 当前勾选的所有行. */
62
62
  getSelectedRows(): (formID?: string | null) => Array<IKgTableRow> | null;
63
63
  /** 当前勾选的第一行. */
@@ -107,6 +107,7 @@ declare const _default: {
107
107
  add: string;
108
108
  button: string;
109
109
  cancel: string;
110
+ close: string;
110
111
  confirm: string;
111
112
  confirmDelete: string;
112
113
  copy: string;
@@ -106,6 +106,7 @@ declare const _default: {
106
106
  add: string;
107
107
  button: string;
108
108
  cancel: string;
109
+ close: string;
109
110
  confirm: string;
110
111
  confirmDelete: string;
111
112
  copy: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kengic/vue",
3
- "version": "0.6.10-beta.8",
3
+ "version": "0.6.10",
4
4
  "scripts": {
5
5
  "build": "rimraf dist && vue-tsc && vite build",
6
6
  "build:dev": "rimraf dist && vue-tsc && vite build --mode development",