@kengic/vue 0.9.0 → 0.9.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -5937,6 +5937,7 @@ const without$1 = without, en = {
5937
5937
  emptyText: "Too many data, please click the Query button to load.",
5938
5938
  saveVarGridMaster: "Save Grid View",
5939
5939
  saveVarGridMasterAs: "Save Grid View As ...",
5940
+ saveVarGridMasterSuccessMessage: "Save Grid View Successfully.",
5940
5941
  totalText: "{from} - {to} of {total} items",
5941
5942
  varGridMasters: "Grid Views"
5942
5943
  },
@@ -6083,6 +6084,7 @@ const without$1 = without, en = {
6083
6084
  emptyText: "\u5F53\u524D\u6570\u636E\u91CF\u5927, \u8BF7\u70B9\u51FB\u67E5\u8BE2\u52A0\u8F7D\u6570\u636E.",
6084
6085
  saveVarGridMaster: "\u4FDD\u5B58\u89C6\u56FE",
6085
6086
  saveVarGridMasterAs: "\u53E6\u5B58\u89C6\u56FE ...",
6087
+ saveVarGridMasterSuccessMessage: "\u4FDD\u5B58\u89C6\u56FE\u6210\u529F.",
6086
6088
  totalText: "\u7B2C {from} - {to} \u6761, \u5171 {total} \u6761",
6087
6089
  varGridMasters: "\u89C6\u56FE"
6088
6090
  },
@@ -8590,7 +8592,7 @@ const useKgVarStore = () => (store$7 || (store$7 = defineStore("KgVar", {
8590
8592
  return (t) => {
8591
8593
  var a, n, s;
8592
8594
  if (!t)
8593
- return KgLogger.error("formID \u4E3A\u7A7A."), null;
8595
+ return KgLogger.error("frm_id \u4E3A\u7A7A."), null;
8594
8596
  const r = e.varProfileMap.get(t);
8595
8597
  return (s = (n = (a = r == null ? void 0 : r.varProfile) == null ? void 0 : a.varProfileMasters) == null ? void 0 : n.find((i) => i.id === (r == null ? void 0 : r.currentVarProfileMasterID))) != null ? s : null;
8596
8598
  };
@@ -8667,7 +8669,7 @@ const useKgVarStore = () => (store$7 || (store$7 = defineStore("KgVar", {
8667
8669
  getCurrentVarGridDetails(e) {
8668
8670
  return (t) => {
8669
8671
  var r, a;
8670
- return t ? (a = (r = this.getCurrentVarGridMaster(t)) == null ? void 0 : r.varGridDetails) != null ? a : null : (KgLogger.error("formID \u4E3A\u7A7A."), null);
8672
+ return t ? (a = (r = this.getCurrentVarGridMaster(t)) == null ? void 0 : r.varGridDetails) != null ? a : null : (KgLogger.error("frm_id \u4E3A\u7A7A."), null);
8671
8673
  };
8672
8674
  },
8673
8675
  getSystemVarGridDetails(e) {
@@ -8868,18 +8870,34 @@ const useKgVarStore = () => (store$7 || (store$7 = defineStore("KgVar", {
8868
8870
  });
8869
8871
  },
8870
8872
  patchVarProfileDetail(e, t, r) {
8871
- return !e || !t ? Promise.resolve() : new Promise((a) => {
8872
- const n = watch(
8873
+ return !e || !t ? Promise.resolve() : new Promise((a, n) => {
8874
+ const s = watch(
8873
8875
  () => this.isRetrievedMap.get(e),
8874
- (s) => {
8875
- if (s) {
8876
- const i = this.getVarProfileDetail(e, t);
8877
- i && setTimeout(() => {
8878
- n(), Object.entries(r).forEach(([o, l]) => {
8879
- o in i && (i[o] = l);
8880
- }), a();
8881
- });
8876
+ (i) => {
8877
+ if (!i)
8878
+ return;
8879
+ const o = this.getVarProfileDetail(e, t);
8880
+ if (!o) {
8881
+ KgLogger.error("\u6570\u636E\u4E3A\u7A7A.", { frm_id: e, var_nam: t }), n();
8882
+ return;
8882
8883
  }
8884
+ setTimeout(() => {
8885
+ s();
8886
+ let l = !1;
8887
+ if (Object.entries(r).forEach(([d, g]) => {
8888
+ d in o && o[d] !== g && (o[d] = g, l = !0);
8889
+ }), !l) {
8890
+ a();
8891
+ return;
8892
+ }
8893
+ const c = this.getCurrentVarProfileMaster(e);
8894
+ if (!(c && c.varProfileDetails)) {
8895
+ a();
8896
+ return;
8897
+ }
8898
+ const u = [...c.varProfileDetails];
8899
+ u.splice(c.varProfileDetails.indexOf(o), 1, { ...o }), c.varProfileDetails = u, a();
8900
+ });
8883
8901
  },
8884
8902
  { immediate: !0 }
8885
8903
  );
@@ -11827,14 +11845,36 @@ const getProps$m = () => ({
11827
11845
  emit: t
11828
11846
  }) {
11829
11847
  const r = useKgVar(e.hostFormID);
11830
- useKg(), useKgVar(FORM_ID__VAR_GRID_MASTER, !0, r ? r.store.getFormLevel(r.formID) + 1 : 1), useKgSearch(FORM_ID__VAR_GRID_MASTER);
11831
- const a = useKgButton(FORM_ID__VAR_GRID_MASTER), n = useKgSubmit(FORM_ID__VAR_GRID_MASTER);
11832
- return n.onOpen(async () => !1), n.onBeforeOk(async ({
11833
- model: s
11834
- }) => !1), n.onOk(async () => !1), a.onUpdateBeforeClick(async ({
11835
- row: s
11836
- }) => !1), () => createVNode(KgVar, {
11837
- class: "kg-table-config-modal-var-grid-master"
11848
+ useKg();
11849
+ const a = useKgVar(FORM_ID__VAR_GRID_MASTER, !0, r ? r.store.getFormLevel(r.formID) + 1 : 1), n = useKgSearch(a.formID), s = useKgButton(a.formID), i = useKgSubmit(a.formID), o = useKgTable(a.formID);
11850
+ n.onReady(async () => (await a.store.patchVarProfileDetail(a.formID, "frm_id", {
11851
+ dft_val: r.formID
11852
+ }), !1)), i.onOpen(async () => !1), i.onBeforeOk(async ({
11853
+ model: c
11854
+ }) => !1), i.onOk(async () => (r.store.retrieve(r.formID), !1)), i.onBeforeRequest(async ({
11855
+ params: c,
11856
+ data: u
11857
+ }) => {
11858
+ const d = o.selectedRows.value;
11859
+ return c.value = {}, u.value = d, !1;
11860
+ }), s.onUpdateBeforeClick(async ({
11861
+ row: c
11862
+ }) => !1);
11863
+ const l = computed(() => ({
11864
+ KgButton: {
11865
+ kgDisabled: (c) => {
11866
+ switch (c.var_nam) {
11867
+ case "create":
11868
+ case "update":
11869
+ case "copy":
11870
+ return !0;
11871
+ }
11872
+ }
11873
+ }
11874
+ }));
11875
+ return () => createVNode(KgVar, {
11876
+ class: "kg-table-config-modal-var-grid-master",
11877
+ kgProps: l.value
11838
11878
  }, null);
11839
11879
  }
11840
11880
  }), getProps$j = () => ({
@@ -12003,7 +12043,7 @@ const getProps$h = () => ({
12003
12043
  data: new UpdateVarGridMasterQuery({
12004
12044
  ...n.currentVarGridMaster.value
12005
12045
  })
12006
- }), KgUtil.hideLoading(), message.success(a.t("kg.updateSuccess"));
12046
+ }), KgUtil.hideLoading(), message.success(a.t("kg.KgTable.saveVarGridMasterSuccessMessage"));
12007
12047
  }
12008
12048
  async function p() {
12009
12049
  g.value = !0, await nextTick(), n.store.setIsCopying(FORM_ID__VAR_GRID_MASTER__SAVE, !0);
@@ -12902,13 +12942,13 @@ const KgTable$1 = "", getProps$g = () => ({
12902
12942
  await u.store.emit(o.formID, "beforeRetrieve", {
12903
12943
  params: Y,
12904
12944
  response: J
12905
- }) ? KgLogger.debug(`${o.formID} | KgTable | retrieve() | read() | \u89E6\u53D1 beforeRetrieve \u4E8B\u4EF6.`) : J.value = await httpClient().request({
12945
+ }) ? KgLogger.debug(`${o.formID} | KgTable | retrieve() | read() | \u89E6\u53D1 beforeRetrieve \u4E8B\u4EF6.`) : (J.value = await httpClient().request({
12906
12946
  method: "GET",
12907
12947
  url: C.value,
12908
12948
  params: Y
12909
12949
  }, {
12910
12950
  successMessageMode: "none"
12911
- });
12951
+ }), KgLogger.debug(`${o.formID} | KgTable | retrieve() | read() | \u67E5\u8BE2\u63A5\u53E3\u8C03\u7528\u6210\u529F.`));
12912
12952
  let ee = ref([]), ae = ref(0);
12913
12953
  switch (!0) {
12914
12954
  case !J.value:
@@ -14407,7 +14447,7 @@ const leftVarProfileDetailColumns = (e) => {
14407
14447
  }, null)
14408
14448
  }, {
14409
14449
  dataIndex: "dft_dyn_op",
14410
- width: 140,
14450
+ width: 150,
14411
14451
  title: t.t("dft_dyn_op").value,
14412
14452
  className: "input",
14413
14453
  customRender: ({
@@ -14761,9 +14801,9 @@ const KgSearch_ConfigModal_VarProfileMaster = "", getProps$c = () => ({
14761
14801
  }
14762
14802
  }
14763
14803
  return () => createVNode(KgVar, {
14804
+ class: "kg-search-config-modal-profile",
14764
14805
  kgSlots: d.value,
14765
- kgProps: u.value,
14766
- class: "kg-search-config-modal-profile"
14806
+ kgProps: u.value
14767
14807
  }, null);
14768
14808
  }
14769
14809
  }), getProps$b = () => ({
@@ -14969,7 +15009,11 @@ const KgSearch$1 = "", getProps$9 = () => ({
14969
15009
  s.store.dispose(n.formID);
14970
15010
  });
14971
15011
  async function N(K = !1) {
14972
- b.value || (o.value ? v.value && v.value.validate().then(async () => {
15012
+ if (b.value) {
15013
+ KgLogger.debug(`${n.formID} | KgSearch | onSearch() | \u91CD\u7F6E\u6309\u94AE\u7981\u7528.`);
15014
+ return;
15015
+ }
15016
+ o.value ? v.value && v.value.validate().then(async () => {
14973
15017
  await s.store.emit(n.formID, "search", {
14974
15018
  resetPageIndex: K
14975
15019
  });
@@ -14979,7 +15023,7 @@ const KgSearch$1 = "", getProps$9 = () => ({
14979
15023
  });
14980
15024
  }) : await s.store.emit(n.formID, "search", {
14981
15025
  resetPageIndex: K
14982
- }));
15026
+ });
14983
15027
  }
14984
15028
  s.store.setSearchFn(n.formID, N);
14985
15029
  async function R() {
@@ -138,6 +138,9 @@ export declare type IKgVarStoreDefinition = StoreDefinition<'KgVar', IKgVarState
138
138
  getVarButtonDelete(): (frm_id?: string | null) => VarButton | null;
139
139
  getVarProfileConfig(): (frm_id?: string | null) => VarProfileConfig | null;
140
140
  getVarProfileMasters(): (frm_id?: string | null) => Array<VarProfileMasterDTO> | null;
141
+ /**
142
+ * 根据 frm_id 和 var_nam 获取当前 VarProfileMaster 下的某个 VarProfileDetail.
143
+ */
141
144
  getVarProfileDetail(): (frm_id?: string | null, var_nam?: string | null) => VarProfileDetail | null;
142
145
  /**
143
146
  * 根据 frm_id 获取 VarProfileDetail 列表.
@@ -33,6 +33,7 @@ declare const _default: {
33
33
  emptyText: string;
34
34
  saveVarGridMaster: string;
35
35
  saveVarGridMasterAs: string;
36
+ saveVarGridMasterSuccessMessage: string;
36
37
  totalText: string;
37
38
  varGridMasters: string;
38
39
  };
@@ -33,6 +33,7 @@ declare const _default: {
33
33
  emptyText: string;
34
34
  saveVarGridMaster: string;
35
35
  saveVarGridMasterAs: string;
36
+ saveVarGridMasterSuccessMessage: string;
36
37
  totalText: string;
37
38
  varGridMasters: string;
38
39
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kengic/vue",
3
- "version": "0.9.0",
3
+ "version": "0.9.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",