@kengic/vue 0.27.1-beta.5 → 0.27.1-beta.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -70071,7 +70071,7 @@ function fi(e) {
70071
70071
  })
70072
70072
  );
70073
70073
  }
70074
- const version = "0.27.1-beta.5", en$1 = {
70074
+ const version = "0.27.1-beta.6", en$1 = {
70075
70075
  kg: {
70076
70076
  KgAppSelect: {
70077
70077
  businessManager: "Business Manager",
@@ -74548,54 +74548,55 @@ function requireCore() {
74548
74548
  });
74549
74549
  }(core)), core.exports;
74550
74550
  }
74551
- var encBase64 = { exports: {} };
74552
- (function(e, r) {
74553
- (function(n, a) {
74554
- e.exports = a(requireCore());
74555
- })(commonjsGlobal, function(n) {
74556
- return function() {
74557
- var a = n, o = a.lib, l = o.WordArray, u = a.enc;
74558
- u.Base64 = {
74559
- stringify: function(C) {
74560
- var w = C.words, N = C.sigBytes, U = this._map;
74561
- C.clamp();
74562
- for (var ne = [], oe = 0; oe < N; oe += 3)
74563
- for (var ue = w[oe >>> 2] >>> 24 - oe % 4 * 8 & 255, se = w[oe + 1 >>> 2] >>> 24 - (oe + 1) % 4 * 8 & 255, st = w[oe + 2 >>> 2] >>> 24 - (oe + 2) % 4 * 8 & 255, ut = ue << 16 | se << 8 | st, ea = 0; ea < 4 && oe + ea * 0.75 < N; ea++)
74564
- ne.push(U.charAt(ut >>> 6 * (3 - ea) & 63));
74565
- var ta = U.charAt(64);
74566
- if (ta)
74567
- for (; ne.length % 4; )
74568
- ne.push(ta);
74569
- return ne.join("");
74570
- },
74571
- parse: function(C) {
74572
- var w = C.length, N = this._map, U = this._reverseMap;
74573
- if (!U) {
74574
- U = this._reverseMap = [];
74575
- for (var ne = 0; ne < N.length; ne++)
74576
- U[N.charCodeAt(ne)] = ne;
74577
- }
74578
- var oe = N.charAt(64);
74579
- if (oe) {
74580
- var ue = C.indexOf(oe);
74581
- ue !== -1 && (w = ue);
74582
- }
74583
- return p(C, w, U);
74584
- },
74585
- _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
74586
- };
74587
- function p(C, w, N) {
74588
- for (var U = [], ne = 0, oe = 0; oe < w; oe++)
74589
- if (oe % 4) {
74590
- var ue = N[C.charCodeAt(oe - 1)] << oe % 4 * 2, se = N[C.charCodeAt(oe)] >>> 6 - oe % 4 * 2, st = ue | se;
74591
- U[ne >>> 2] |= st << 24 - ne % 4 * 8, ne++;
74592
- }
74593
- return l.create(U, ne);
74594
- }
74595
- }(), n.enc.Base64;
74596
- });
74597
- })(encBase64);
74598
- const Base64 = encBase64.exports;
74551
+ var encBase64 = { exports: {} }, hasRequiredEncBase64;
74552
+ function requireEncBase64() {
74553
+ return hasRequiredEncBase64 || (hasRequiredEncBase64 = 1, function(e, r) {
74554
+ (function(n, a) {
74555
+ e.exports = a(requireCore());
74556
+ })(commonjsGlobal, function(n) {
74557
+ return function() {
74558
+ var a = n, o = a.lib, l = o.WordArray, u = a.enc;
74559
+ u.Base64 = {
74560
+ stringify: function(C) {
74561
+ var w = C.words, N = C.sigBytes, U = this._map;
74562
+ C.clamp();
74563
+ for (var ne = [], oe = 0; oe < N; oe += 3)
74564
+ for (var ue = w[oe >>> 2] >>> 24 - oe % 4 * 8 & 255, se = w[oe + 1 >>> 2] >>> 24 - (oe + 1) % 4 * 8 & 255, st = w[oe + 2 >>> 2] >>> 24 - (oe + 2) % 4 * 8 & 255, ut = ue << 16 | se << 8 | st, ea = 0; ea < 4 && oe + ea * 0.75 < N; ea++)
74565
+ ne.push(U.charAt(ut >>> 6 * (3 - ea) & 63));
74566
+ var ta = U.charAt(64);
74567
+ if (ta)
74568
+ for (; ne.length % 4; )
74569
+ ne.push(ta);
74570
+ return ne.join("");
74571
+ },
74572
+ parse: function(C) {
74573
+ var w = C.length, N = this._map, U = this._reverseMap;
74574
+ if (!U) {
74575
+ U = this._reverseMap = [];
74576
+ for (var ne = 0; ne < N.length; ne++)
74577
+ U[N.charCodeAt(ne)] = ne;
74578
+ }
74579
+ var oe = N.charAt(64);
74580
+ if (oe) {
74581
+ var ue = C.indexOf(oe);
74582
+ ue !== -1 && (w = ue);
74583
+ }
74584
+ return p(C, w, U);
74585
+ },
74586
+ _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
74587
+ };
74588
+ function p(C, w, N) {
74589
+ for (var U = [], ne = 0, oe = 0; oe < w; oe++)
74590
+ if (oe % 4) {
74591
+ var ue = N[C.charCodeAt(oe - 1)] << oe % 4 * 2, se = N[C.charCodeAt(oe)] >>> 6 - oe % 4 * 2, st = ue | se;
74592
+ U[ne >>> 2] |= st << 24 - ne % 4 * 8, ne++;
74593
+ }
74594
+ return l.create(U, ne);
74595
+ }
74596
+ }(), n.enc.Base64;
74597
+ });
74598
+ }(encBase64)), encBase64.exports;
74599
+ }
74599
74600
  var md5 = { exports: {} }, hasRequiredMd5;
74600
74601
  function requireMd5() {
74601
74602
  return hasRequiredMd5 || (hasRequiredMd5 = 1, function(e, r) {
@@ -74967,7 +74968,7 @@ function requireCipherCore() {
74967
74968
  }
74968
74969
  (function(e, r) {
74969
74970
  (function(n, a, o) {
74970
- e.exports = a(requireCore(), encBase64.exports, requireMd5(), requireEvpkdf(), requireCipherCore());
74971
+ e.exports = a(requireCore(), requireEncBase64(), requireMd5(), requireEvpkdf(), requireCipherCore());
74971
74972
  })(commonjsGlobal, function(n) {
74972
74973
  return function() {
74973
74974
  var a = n, o = a.lib, l = o.BlockCipher, u = a.algo, p = [], C = [], w = [], N = [], U = [], ne = [], oe = [], ue = [], se = [], st = [];
@@ -75022,7 +75023,7 @@ function requireCipherCore() {
75022
75023
  }(), n.AES;
75023
75024
  });
75024
75025
  })(aes);
75025
- var encUtf8 = { exports: {} };
75026
+ var encBase64Exports = requireEncBase64(), encUtf8 = { exports: {} };
75026
75027
  (function(e, r) {
75027
75028
  (function(n, a) {
75028
75029
  e.exports = a(requireCore());
@@ -75084,10 +75085,10 @@ class AesEncryption {
75084
75085
  }
75085
75086
  }
75086
75087
  function encryptByBase64(e) {
75087
- return UTF8.parse(e).toString(Base64);
75088
+ return UTF8.parse(e).toString(encBase64Exports);
75088
75089
  }
75089
75090
  function decodeByBase64(e) {
75090
- return Base64.parse(e).toString(UTF8);
75091
+ return encBase64Exports.parse(e).toString(UTF8);
75091
75092
  }
75092
75093
  function encryptByMd5(e) {
75093
75094
  return md5Exports(e).toString();
@@ -75951,7 +75952,7 @@ class _KgUtil {
75951
75952
  varName: o
75952
75953
  } = e != null ? e : {};
75953
75954
  if (typeof a != "string")
75954
- return "";
75955
+ return a;
75955
75956
  const l = useKg(), u = r ? useKgVar(r) : null;
75956
75957
  let p = (() => {
75957
75958
  var C, w, N, U, ne, oe, ue, se, st, ut, ea, ta, oa, aa, sa, ua, ga;
@@ -90102,7 +90103,7 @@ const getProps$F = () => ({
90102
90103
  });
90103
90104
  });
90104
90105
  }), !1;
90105
- }), w.kgTable.onRowDoubleClick(async () => (await se(), !1)), w.kgTable.patchVarGridConfig({
90106
+ }), w.kgTable.onRowDoubleClick(async () => (await se(), !1)), w.patchVarGridConfig({
90106
90107
  properties: {
90107
90108
  mult_flg: ((st = C.store.getVarConfigLookup(C.formID, o)) == null ? void 0 : st.mult_flg) === 1 ? 1 : 0
90108
90109
  }
@@ -96549,29 +96550,6 @@ const KgTable$1 = "", getProps$t = () => ({
96549
96550
  }
96550
96551
  return o;
96551
96552
  },
96552
- patchVarGridConfig(e, r) {
96553
- if (!e)
96554
- return Promise.resolve();
96555
- const { properties: n } = r != null ? r : {};
96556
- return new Promise((a) => {
96557
- const o = watch(
96558
- () => this.isRequestedMap.get(e),
96559
- (l) => {
96560
- if (!l)
96561
- return;
96562
- const p = useKgVar(e).store.getVarGridConfig(e);
96563
- if (!p)
96564
- return Pe(`${e} | kgTable.store.patchVarGridConfig() | VarGridConfig \u4E3A\u7A7A.`, { formID: e }), a();
96565
- setTimeout(() => {
96566
- o(), Object.entries(n).forEach(([C, w]) => {
96567
- C in p && (p[C] = w);
96568
- }), a();
96569
- });
96570
- },
96571
- { immediate: !0 }
96572
- );
96573
- });
96574
- },
96575
96553
  refreshSelectedRows(e) {
96576
96554
  var l, u;
96577
96555
  if (!e) {
@@ -96858,12 +96836,12 @@ function useKgTable(e) {
96858
96836
  var a, o;
96859
96837
  return JSON.parse((o = (a = r.varGridConfig.value) == null ? void 0 : a.pg_size_opts) != null ? o : "[]");
96860
96838
  }),
96861
- patchVarGridConfig: async (a) => n.patchVarGridConfig(r.formID, a),
96862
96839
  requestParams: computed(() => n.getRequestParams(r.formID)),
96863
96840
  selectedFirstRow: computed(() => n.getSelectedFirstRow(r.formID)),
96864
96841
  selectedRow: computed(() => n.getSelectedRow(r.formID)),
96865
96842
  selectedRows: computed(() => n.getSelectedRows(r.formID)),
96866
96843
  setIsShowDescription: (a) => n.setIsShowDescription(r.formID, a),
96844
+ setSelectedRows: (a) => n.setSelectedRows(r.formID, a.selectedRows),
96867
96845
  store: n
96868
96846
  };
96869
96847
  }
@@ -102299,6 +102277,28 @@ const KgVarConfig$1 = "", KgVarConfig = defineComponent({
102299
102277
  );
102300
102278
  });
102301
102279
  },
102280
+ patchVarGridConfig(e, r) {
102281
+ if (!e)
102282
+ return Promise.resolve();
102283
+ const { properties: n } = r != null ? r : {};
102284
+ return new Promise((a) => {
102285
+ const o = watch(
102286
+ () => this.isRequestedMap.get(e),
102287
+ (l) => {
102288
+ !l || setTimeout(() => {
102289
+ o();
102290
+ const u = this.getVarGridConfig(e);
102291
+ if (!u)
102292
+ return Pe(`${e} | kgVar.store.patchVarGridConfig() | VarGridConfig \u4E3A\u7A7A.`, { formID: e }), a();
102293
+ Object.entries(n).forEach(([p, C]) => {
102294
+ p in u && (u[p] = C);
102295
+ }), a();
102296
+ });
102297
+ },
102298
+ { immediate: !0 }
102299
+ );
102300
+ });
102301
+ },
102302
102302
  patchVarGridDetail(e, r) {
102303
102303
  const { varName: n, properties: a } = r != null ? r : {};
102304
102304
  return !e || !n ? Promise.resolve() : new Promise((o) => {
@@ -102396,7 +102396,18 @@ const KgVarConfig$1 = "", KgVarConfig = defineComponent({
102396
102396
  varSubmitConfigs: ma,
102397
102397
  varSubmitDetails: fa,
102398
102398
  varVariables: va
102399
- } = await GetAll({ data: { frm_id: e } }), xa = transformVarButtons(U), ba = transformVarButtonConfig(ne), ha = transformVarChildDetails(oe), Ca = oa != null ? oa : null, $a = transformVarConfigControls(ue), ka = se != null ? se : [], Ta = transformVarConfigInputs(st), Ra = transformVarConfigLookups(ut), Ia = transformVarConfigPossibilities(ea), Sa = transformVarConfigTips(ta), Ma = transformVarGridConfig(aa), Ka = transformVarGridMasters(sa), Ga = transformVarProfileConfig(ua), gi = transformVarProfileMasters(ga), Ei = transformVarSubmitConfigs(ma), _i = transformVarSubmitDetails(fa), bi = va != null ? va : [], Si = (l = (o = (ga == null ? void 0 : ga.find((Va) => Va.id === this.getCurrentVarProfileMasterID(e))) || (ga == null ? void 0 : ga.find((Va) => Va.def_flg === 1)) || (ga == null ? void 0 : ga.find((Va) => Va.cust_lvl === KG_CUSTOM_LEVEL.L0)) || (ga == null ? void 0 : ga.find(() => !0))) == null ? void 0 : o.id) != null ? l : null, Xa = (p = (u = (sa == null ? void 0 : sa.find((Va) => Va.id === this.getCurrentVarGridMasterID(e))) || (sa == null ? void 0 : sa.find((Va) => Va.def_flg === 1)) || (sa == null ? void 0 : sa.find((Va) => Va.cust_lvl === KG_CUSTOM_LEVEL.L0)) || (sa == null ? void 0 : sa.find(() => !0))) == null ? void 0 : u.id) != null ? p : null;
102399
+ } = await GetAll({
102400
+ data: {
102401
+ frm_id: (() => {
102402
+ var Aa, Ha;
102403
+ let Va = e;
102404
+ const Da = /CLONE\[(.*)?]TO\[(.*)?]/;
102405
+ if (Da.test(e) && (Va = (Ha = (Aa = Da.exec(e)) == null ? void 0 : Aa[1]) != null ? Ha : ""), !Va)
102406
+ throw new Error(`\u9519\u8BEF\u7684\u754C\u9762\u6807\u8BC6:${e}`);
102407
+ return Va;
102408
+ })()
102409
+ }
102410
+ }), xa = transformVarButtons(U), ba = transformVarButtonConfig(ne), ha = transformVarChildDetails(oe), Ca = oa != null ? oa : null, $a = transformVarConfigControls(ue), ka = se != null ? se : [], Ta = transformVarConfigInputs(st), Ra = transformVarConfigLookups(ut), Ia = transformVarConfigPossibilities(ea), Sa = transformVarConfigTips(ta), Ma = transformVarGridConfig(aa), Ka = transformVarGridMasters(sa), Ga = transformVarProfileConfig(ua), gi = transformVarProfileMasters(ga), Ei = transformVarSubmitConfigs(ma), _i = transformVarSubmitDetails(fa), bi = va != null ? va : [], Si = (l = (o = (ga == null ? void 0 : ga.find((Va) => Va.id === this.getCurrentVarProfileMasterID(e))) || (ga == null ? void 0 : ga.find((Va) => Va.def_flg === 1)) || (ga == null ? void 0 : ga.find((Va) => Va.cust_lvl === KG_CUSTOM_LEVEL.L0)) || (ga == null ? void 0 : ga.find(() => !0))) == null ? void 0 : o.id) != null ? l : null, Xa = (p = (u = (sa == null ? void 0 : sa.find((Va) => Va.id === this.getCurrentVarGridMasterID(e))) || (sa == null ? void 0 : sa.find((Va) => Va.def_flg === 1)) || (sa == null ? void 0 : sa.find((Va) => Va.cust_lvl === KG_CUSTOM_LEVEL.L0)) || (sa == null ? void 0 : sa.find(() => !0))) == null ? void 0 : u.id) != null ? p : null;
102400
102411
  createDefaultVarSubmitDetailsForVarProfileDetails(Ka, _i, xa), this.varButtonMap.set(e, xa), this.varButtonConfigMap.set(e, ba), this.varChildDetailMap.set(e, ha), this.varConfigControlMap.set(e, $a), this.varConfigDescriptionMap.set(e, ka), this.varConfigInputMap.set(e, Ta), this.varConfigLookupMap.set(e, Ra), this.varConfigPossibilityMap.set(e, Ia), this.varConfigTipMap.set(e, Sa), this.varDdaMap.set(e, Ca), this.varGridConfigMap.set(e, Ma), this.varGridMasterMap.set(e, { varGridMasters: Ka, currentVarGridMasterID: Xa }), this.varProfileConfigMap.set(e, Ga), this.varProfileMasterMap.set(e, { varProfileMasters: gi, currentVarProfileMasterID: Si }), this.varSubmitConfigMap.set(e, Ei), this.varSubmitDetailMap.set(e, _i), this.varVariableMap.set(e, bi), await Promise.all([
102401
102412
  this.setCurrentVarGridMasterID(e, this.getCurrentVarGridMasterID(e)),
102402
102413
  this.setCurrentVarProfileMasterID(e, this.getCurrentVarProfileMasterID(e))
@@ -102929,7 +102940,8 @@ function useKgVar(e, r, n = 0) {
102929
102940
  }),
102930
102941
  parent: computed(() => u.getParent(l)),
102931
102942
  patchVarButton: (se) => u.patchVarButton(l, se),
102932
- patchVarGridDetail: async (se) => u.patchVarGridDetail(l, se),
102943
+ patchVarGridConfig: (se) => u.patchVarGridConfig(l, se),
102944
+ patchVarGridDetail: (se) => u.patchVarGridDetail(l, se),
102933
102945
  props: computed(() => u.getProps(l)),
102934
102946
  requestAll: (se) => u.requestAll(l, se),
102935
102947
  setProps: (se) => u.setProps(l, se),
@@ -1,8 +1,8 @@
1
1
  import { IRemoveEventListener } from '@kengic/core.core';
2
2
  import { ComputedRef } from 'vue';
3
- import { VarGridConfig } from '../../api/WMS/models';
4
3
  import { IKgTableOnAfterRequestEventListener, IKgTableOnBeforeParseRequestParameterEventListener, IKgTableOnBeforeRequestEventListener, IKgTableOnBeforeSetDatasEventListener, IKgTableOnReadyEventListener, IKgTableOnRowDoubleClickEventListener } from './KgTable.event';
5
4
  import { IKgTableStore } from './KgTable.store';
5
+ import { IKgTableRow } from './KgTable.vm';
6
6
  export interface IUseKgTable {
7
7
  /**
8
8
  * 列表数据.
@@ -100,14 +100,6 @@ export interface IUseKgTable {
100
100
  pageSizeOption: ComputedRef<number>;
101
101
  /** 所有分页选项. */
102
102
  pageSizeOptions: ComputedRef<number[]>;
103
- /**
104
- * 修改「表格配置」的部分属性.
105
- *
106
- * @param param.properties 要修改的部分属性.
107
- */
108
- patchVarGridConfig(param: {
109
- properties: VarGridConfig;
110
- }): Promise<void>;
111
103
  /**
112
104
  * <p>查询参数.</p>
113
105
  * <p>此查询参数是最终传给后端接口的参数, 包含了查询条件, 还包含了表格中的排序和分页, 还包含了表格配置中的参数.</p>
@@ -120,6 +112,15 @@ export interface IUseKgTable {
120
112
  /** 当前勾选的所有行. */
121
113
  selectedRows: ComputedRef<ReturnType<IKgTableStore['getSelectedRows']>>;
122
114
  setIsShowDescription(value: boolean): void;
115
+ /**
116
+ * 设置勾选的行.
117
+ *
118
+ * @param param
119
+ * @param param.selectedRows 勾选的行.
120
+ */
121
+ setSelectedRows<T extends IKgTableRow = any>(param: {
122
+ selectedRows: Array<T>;
123
+ }): void;
123
124
  /** 状态数据. */
124
125
  store: IKgTableStore;
125
126
  }
@@ -1,7 +1,6 @@
1
1
  import { Key } from 'ant-design-vue/lib/_util/type';
2
2
  import { StoreDefinition } from 'pinia';
3
3
  import { Ref } from 'vue';
4
- import { VarGridConfig } from '../../api/WMS/models';
5
4
  import { IKgTableEvent, IKgTableEventListenerParameter, IKgTableOnAfterRequestEventListener, IKgTableOnBeforeParseRequestParameterEventListener, IKgTableOnBeforeRequestEventListener, IKgTableOnBeforeSetDatasEventListener, IKgTableOnReadyEventListener, IKgTableOnRowDoubleClickEventListener } from './KgTable.event';
6
5
  import { IKgTableRow, IKgTableRowHeight } from './KgTable.vm';
7
6
  export interface IUseKgTableStoreState {
@@ -109,16 +108,6 @@ export interface IUseKgTableStoreActions {
109
108
  * @param parameter 事件参数.
110
109
  */
111
110
  emit<T = IKgTableEventListenerParameter>(formID: string | null | undefined, event: IKgTableEvent, parameter: T): Promise<boolean>;
112
- /**
113
- * 修改「表格配置」的部分属性.
114
- *
115
- * @param formID 界面标识.
116
- * @param param
117
- * @param param.properties 要修改的部分属性.
118
- */
119
- patchVarGridConfig(formID: string | null | undefined, param: {
120
- properties: VarGridConfig;
121
- }): Promise<void>;
122
111
  /**
123
112
  * 刷新勾选的行. 表格列表数据变更之后, 需要同步到勾选的行.
124
113
  * @param formID 界面标识.
@@ -1,6 +1,6 @@
1
1
  import { IRemoveEventListener } from '@kengic/core.core';
2
2
  import { ComputedRef } from 'vue';
3
- import { VarButton, VarConfigControl, VarConfigDescription, VarConfigPossibility, VarGridDetail, VarGridMasterDTO } from '../../api/WMS/models';
3
+ import { VarButton, VarConfigControl, VarConfigDescription, VarConfigPossibility, VarGridConfig, VarGridDetail, VarGridMasterDTO } from '../../api/WMS/models';
4
4
  import { KG__VAR_BUTTON__TYPE } from '../../const';
5
5
  import { IUseKgButton } from '../KgButton';
6
6
  import { IUseKgForm } from '../KgForm';
@@ -172,6 +172,14 @@ export declare type IUseKgVar = {
172
172
  properties: VarButton;
173
173
  varName: string | null | undefined;
174
174
  }): Promise<void>;
175
+ /**
176
+ * 修改「表格配置」的部分属性.
177
+ *
178
+ * @param param.properties 要修改的部分属性.
179
+ */
180
+ patchVarGridConfig(param: {
181
+ properties: VarGridConfig;
182
+ }): Promise<void>;
175
183
  /**
176
184
  * 修改「表格视图明细」的部分属性.
177
185
  *
@@ -184,6 +184,16 @@ export interface IUseKgVarStoreActions {
184
184
  properties: VarButton;
185
185
  varName: string | null | undefined;
186
186
  }): Promise<void>;
187
+ /**
188
+ * 修改「表格配置」的部分属性.
189
+ *
190
+ * @param formID 界面标识.
191
+ * @param param
192
+ * @param param.properties 要修改的部分属性.
193
+ */
194
+ patchVarGridConfig(formID: string | null | undefined, param: {
195
+ properties: VarGridConfig;
196
+ }): Promise<void>;
187
197
  /**
188
198
  * 修改「表格视图明细」的部分属性.
189
199
  *
@@ -59,7 +59,7 @@ export declare class KgUtil {
59
59
  formID?: string | null;
60
60
  value: string;
61
61
  varName?: string | null;
62
- }): string;
62
+ }): any;
63
63
  /**
64
64
  * 处理请求参数: 解析 Dayjs 类型的参数值.
65
65
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kengic/vue",
3
- "version": "0.27.1-beta.5",
3
+ "version": "0.27.1-beta.6",
4
4
  "scripts": {
5
5
  "build": "npm run use-node && rimraf dist && vue-tsc && vite build",
6
6
  "build:dev": "npm run use-node && rimraf dist && vue-tsc && vite build --mode development",
@@ -1,3 +0,0 @@
1
- import { bumpVersionToProjects } from './bump-to';
2
-
3
- ['file:///D:/proj/kg/smartfactory.product.wms.wms--dev-3.2/wms-vue3'].forEach((projectPath) => bumpVersionToProjects(projectPath, []));
@@ -1,3 +0,0 @@
1
- import { bumpVersionToProjects } from './bump-to';
2
-
3
- ['file:///D:/proj/kg/smartfactory.product.wms.wms-vue3--focus'].forEach((projectPath) => bumpVersionToProjects(projectPath, []));
package/script/bump-to.ts DELETED
@@ -1,38 +0,0 @@
1
- import fs from 'fs';
2
- import chalk from 'chalk';
3
-
4
- /**
5
- * 更新前端项目中包的版本号.
6
- * 当我们升级了这些包的版本后, 可以使用该方法快速将新的版本号同步到前端项目中去.
7
- *
8
- * @param projectPath 前端项目目录.
9
- * @param excludes 要排除的包.
10
- */
11
- function bumpVersionToProjects(projectPath: string, excludes: Array<string> = []) {
12
- // file:///D:/foo/...
13
- const pkgPath = `${projectPath}/package.json`;
14
- // D:/foo/...
15
- const absolutePkgPath = pkgPath.replace('file:///', '');
16
-
17
- import(pkgPath)
18
- .then(({ default: json }) => {
19
- Promise.all([import('../package.json')])
20
- .then(([{ version, name, dependencies, devDependencies }]) => {
21
- if (json.dependencies[name]) {
22
- json.dependencies[name] = version;
23
- }
24
-
25
- fs.writeFileSync(absolutePkgPath, `${JSON.stringify(json, null, 2)}\n`, {});
26
- console.log();
27
- console.log(chalk.green(`版本更新成功`) + ' | ' + chalk.blueBright(version) + ' | ' + absolutePkgPath);
28
- })
29
- .catch((e) => {
30
- console.log(e);
31
- });
32
- })
33
- .catch((e) => {
34
- console.error(e);
35
- });
36
- }
37
-
38
- export { bumpVersionToProjects };
package/script/bump.ts DELETED
@@ -1,35 +0,0 @@
1
- import fs from 'fs';
2
- import semver from 'semver';
3
-
4
- //____________________________________________________________________________________________________
5
- // 自动更新所有包的版本号
6
- //____________________________________________________________________________________________________
7
-
8
- import('../package.json').then(({ default: json }) => {
9
- const type = process.argv[2];
10
- let version = json.version;
11
-
12
- switch (type) {
13
- case 'major':
14
- version = semver.inc(version, 'major');
15
- break;
16
- case 'minor':
17
- version = semver.inc(version, 'minor');
18
- break;
19
- case 'patch':
20
- version = semver.inc(version, 'patch');
21
- break;
22
- case 'beta':
23
- version = semver.inc(version, 'prerelease', 'beta');
24
- break;
25
- default:
26
- throw new Error('INVALID SEMVER TYPE');
27
- }
28
-
29
- import('../package.json').then(({ default: json }) => {
30
- json.version = version;
31
- fs.writeFileSync('./package.json', `${JSON.stringify(json, null, 4)}\n`, {});
32
- });
33
- });
34
-
35
- export {};
@@ -1,3 +0,0 @@
1
- import { copyToProject } from './copy-to';
2
-
3
- ['D:/proj/kg/smartfactory.product.wms.wms--dev-3.2/wms-vue3'].forEach((projectPath) => copyToProject(projectPath));
@@ -1,3 +0,0 @@
1
- import { copyToProject } from './copy-to';
2
-
3
- ['D:/proj/kg/smartfactory.product.wms.wms-vue3--focus'].forEach((projectPath) => copyToProject(projectPath));
@@ -1,3 +0,0 @@
1
- import { copyToProject } from './copy-to';
2
-
3
- ['D:/proj/kg/smartfactory.tyre.haohua.gantry.was-java--main/wms-vue3'].forEach((projectPath) => copyToProject(projectPath));
package/script/copy-to.ts DELETED
@@ -1,23 +0,0 @@
1
- import fs from 'fs';
2
- import path from 'path';
3
-
4
- /**
5
- * 开发时, 需要将打包后的文件复制到项目的 node_modules 目录下进行测试.
6
- *
7
- * @param projectPath 前端项目目录.
8
- */
9
- function copyToProject(projectPath: string) {
10
- const cacheDir = path.join(projectPath, '/node_modules/.vite/');
11
- if (fs.existsSync(cacheDir)) {
12
- fs.rmSync(cacheDir, { recursive: true, force: true });
13
- }
14
-
15
- const dir = path.join(projectPath, '/node_modules/@kengic/vue/dist/');
16
- if (fs.existsSync(dir)) {
17
- fs.rmSync(dir, { recursive: true, force: true });
18
- }
19
-
20
- fs.cpSync('./dist/', dir, { recursive: true });
21
- }
22
-
23
- export { copyToProject };
package/script/publish.ts DELETED
@@ -1,30 +0,0 @@
1
- import chalk from 'chalk';
2
- import { execSync } from 'node:child_process';
3
- import { name, version } from '../package.json';
4
-
5
- /*
6
- * 使用下面的脚本来简化打包发布流程.
7
- */
8
-
9
- const PKGNAME = `${name}@${version}`;
10
-
11
- //region 安装依赖
12
- //____________________________________________________________________________________________________
13
- console.log('');
14
- execSync('npm cache clean -f', { cwd: './', stdio: 'ignore' });
15
- execSync('pnpm install', { cwd: './', stdio: 'ignore' });
16
- console.log(`${chalk.blueBright('INSTALL ')}| ${PKGNAME}`);
17
- //endregion
18
-
19
- //region 打包
20
- //____________________________________________________________________________________________________
21
- execSync('npm run build', { cwd: './', stdio: 'ignore' });
22
- console.log(`${chalk.blueBright(' BUILD ')}| ${PKGNAME}`);
23
- //endregion
24
-
25
- //region 发布
26
- //____________________________________________________________________________________________________
27
- execSync('npm run publish:npm', { cwd: './', stdio: 'ignore' });
28
- console.log(`${chalk.blueBright('PUBLISH ')}| ${PKGNAME}`);
29
- console.log('');
30
- //endregion