@kengic/vue 0.28.1-beta.1 → 0.28.1-beta.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -2695,12 +2695,12 @@ reactExports.forwardRef((e, G) => IconComponent({
2695
2695
  ...e,
2696
2696
  _ref: G
2697
2697
  }));
2698
- import("./close-outlined-DMcSQWxQ.537d8ddf.mjs").then(({ default: e }) => addIcon$1("ant-design:close-outlined", e));
2699
- import("./fullscreen-exit-outlined-X1iYkFc4.37edd487.mjs").then(({ default: e }) => addIcon$1("ant-design:fullscreen-exit-outlined", e));
2700
- import("./fullscreen-outlined-DDBrsRcy.db231def.mjs").then(({ default: e }) => addIcon$1("ant-design:fullscreen-outlined", e));
2701
- import("./exclamation-circle-outlined-DZrXCnvM.a3e96b6e.mjs").then(({ default: e }) => addIcon$1("ant-design:exclamation-circle-outlined", e));
2702
- import("./search-outlined-Od1M_oxf.1b143df4.mjs").then(({ default: e }) => addIcon$1("ant-design:search-outlined", e));
2703
- import("./three-dots-loading-bIlrTJYR.bd624bcf.mjs").then(({ default: e }) => addIcon$1("eos-icons:three-dots-loading", e));
2698
+ import("./close-outlined-DMcSQWxQ.9ca932eb.mjs").then(({ default: e }) => addIcon$1("ant-design:close-outlined", e));
2699
+ import("./fullscreen-exit-outlined-X1iYkFc4.1e8e8688.mjs").then(({ default: e }) => addIcon$1("ant-design:fullscreen-exit-outlined", e));
2700
+ import("./fullscreen-outlined-DDBrsRcy.b539229d.mjs").then(({ default: e }) => addIcon$1("ant-design:fullscreen-outlined", e));
2701
+ import("./exclamation-circle-outlined-DZrXCnvM.217ef68f.mjs").then(({ default: e }) => addIcon$1("ant-design:exclamation-circle-outlined", e));
2702
+ import("./search-outlined-Od1M_oxf.fd26a590.mjs").then(({ default: e }) => addIcon$1("ant-design:search-outlined", e));
2703
+ import("./three-dots-loading-bIlrTJYR.4bf0b865.mjs").then(({ default: e }) => addIcon$1("eos-icons:three-dots-loading", e));
2704
2704
  var jsxRuntime = { exports: {} }, reactJsxRuntime_production_min = {};
2705
2705
  /**
2706
2706
  * @license React
@@ -59010,7 +59010,7 @@ Object.defineProperty(zh_CN$5, "__esModule", {
59010
59010
  });
59011
59011
  zh_CN$5.default = void 0;
59012
59012
  var _zh_CN$2 = _interopRequireDefault$2(zh_CN$4), _zh_CN2$1 = _interopRequireDefault$2(zh_CN$3);
59013
- const locale = {
59013
+ const locale$x = {
59014
59014
  lang: Object.assign({
59015
59015
  placeholder: "\u8BF7\u9009\u62E9\u65E5\u671F",
59016
59016
  yearPlaceholder: "\u8BF7\u9009\u62E9\u5E74\u4EFD",
@@ -59025,8 +59025,8 @@ const locale = {
59025
59025
  }, _zh_CN$2.default),
59026
59026
  timePickerLocale: Object.assign({}, _zh_CN2$1.default)
59027
59027
  };
59028
- locale.lang.ok = "\u786E\u5B9A";
59029
- zh_CN$5.default = locale;
59028
+ locale$x.lang.ok = "\u786E\u5B9A";
59029
+ zh_CN$5.default = locale$x;
59030
59030
  var _interopRequireDefault$1 = interopRequireDefaultExports.default;
59031
59031
  Object.defineProperty(zh_CN$6, "__esModule", {
59032
59032
  value: !0
@@ -66395,7 +66395,7 @@ class KgUtil$1 {
66395
66395
  function KgWorkStationModal() {
66396
66396
  var Ba, Ga, Va;
66397
66397
  var e;
66398
- const G = useID(), U = doKgWorkStation(G), te = useIntl(), ne = useKg$1(), oe = useDispatch(), ie = useSelector(isVisibleSelector(G)), ue = useSelector(isOpenSelector(G)), [st, ea] = reactExports.useState([]), [ta, na] = reactExports.useState(!1), [oa, la] = reactExports.useState([]), [da, ca] = reactExports.useState([]), [fa, pa] = reactExports.useState(""), [ga, ha] = reactExports.useState(""), Ea = useSelector(workStationSelector()), ba = useSelector(workStationAreaSelector()), Sa = (Ba = (e = st.find((za) => za.devcod === oa[0])) == null ? void 0 : e.workstationAreas) != null ? Ba : [], Ta = (Ga = st.filter((za) => {
66398
+ const G = useID(), U = doKgWorkStation(G), te = useIntl(), ne = useKg$1(), oe = useDispatch(), ie = useSelector(isVisibleSelector(G)), ue = useSelector(isOpenSelector(G)), [st, ea] = reactExports.useState([]), [ta, na] = reactExports.useState(!1), [oa, la] = reactExports.useState([]), [da, ca] = reactExports.useState([]), [fa, pa] = reactExports.useState(""), [ga, ha] = reactExports.useState(""), Ea = useSelector(workStationSelector()), ba = useSelector(workStationAreaSelector()), Sa = (Ba = (e = st.find((za) => za.devcod === oa[0])) == null ? void 0 : e.workstationAndAreaRelationshipDTOList) != null ? Ba : [], Ta = (Ga = st.filter((za) => {
66399
66399
  var Ya, La, Qa, pi;
66400
66400
  return fa ? ((La = (Ya = za.devcod) == null ? void 0 : Ya.toLowerCase()) == null ? void 0 : La.includes(fa.toLowerCase())) || ((pi = (Qa = za.devcodDsc) == null ? void 0 : Qa.toLowerCase()) == null ? void 0 : pi.includes(fa.toLowerCase())) : za;
66401
66401
  })) != null ? Ga : [], Na = (Va = Sa.filter((za) => {
@@ -66485,7 +66485,7 @@ function KgWorkStationModal() {
66485
66485
  try {
66486
66486
  na(!0);
66487
66487
  const Qa = (La = (za = await List$3({ params: { pageNo: 1, pageSize: 999 } })) == null ? void 0 : za.records) != null ? La : [];
66488
- Qa.find((pi) => pi.devcod === (Ea == null ? void 0 : Ea.devcod)) ? (la([Ea == null ? void 0 : Ea.devcod]), (Ya = Ea == null ? void 0 : Ea.workstationAreas) != null && Ya.find((pi) => pi.wrkare === (ba == null ? void 0 : ba.wrkare)) ? ca([ba == null ? void 0 : ba.wrkare]) : ca([])) : (la([]), ca([])), ea(Qa);
66488
+ Qa.find((pi) => pi.devcod === (Ea == null ? void 0 : Ea.devcod)) ? (la([Ea == null ? void 0 : Ea.devcod]), (Ya = Ea == null ? void 0 : Ea.workstationAndAreaRelationshipDTOList) != null && Ya.find((pi) => pi.wrkare === (ba == null ? void 0 : ba.wrkare)) ? ca([ba == null ? void 0 : ba.wrkare]) : ca([])) : (la([]), ca([])), ea(Qa);
66489
66489
  } finally {
66490
66490
  na(!1);
66491
66491
  }
@@ -70091,7 +70091,7 @@ function fi(e) {
70091
70091
  })
70092
70092
  );
70093
70093
  }
70094
- const version = "0.28.1-beta.1", en$1 = {
70094
+ const version = "0.28.1-beta.2", en$1 = {
70095
70095
  kg: {
70096
70096
  KgAppSelect: {
70097
70097
  businessManager: "Business Manager",
@@ -72014,8 +72014,8 @@ const localeSetting = {
72014
72014
  availableLocales: localeList.map((e) => e.event)
72015
72015
  };
72016
72016
  function setupKgLocale(e) {
72017
- const { defaultLocale: G = "zh_CN", availableLocales: U } = e != null ? e : {};
72018
- localeSetting.locale = G, U && U.length > 0 && (localeSetting.availableLocales = U, localeList = localeList.filter((te) => U.includes(te.event)));
72017
+ const { defaultLocale: G = "zh_CN", availableLocales: U, I18N: te } = e != null ? e : {};
72018
+ localeSetting.locale = G, U && U.length > 0 && (localeSetting.availableLocales = U, localeList = localeList.filter((ne) => U.includes(ne.event))), te && useKg().store.setI18N(te);
72019
72019
  }
72020
72020
  const I18N = {
72021
72021
  en: en$1,
@@ -75802,60 +75802,6 @@ function useLocale() {
75802
75802
  };
75803
75803
  }
75804
75804
  const useKgStore = defineStore("Kg", {
75805
- state: () => ({
75806
- I18N: {},
75807
- descriptionMap: /* @__PURE__ */ new Map(),
75808
- i18n: null,
75809
- isDescriptionsRequestingMap: /* @__PURE__ */ new Map(),
75810
- locale: null,
75811
- option: {},
75812
- pFunction: null,
75813
- router: null,
75814
- tFunction: null,
75815
- usePermissionStore: null,
75816
- useUserStore: null
75817
- }),
75818
- getters: {
75819
- getDescription() {
75820
- return (e) => {
75821
- var te, ne;
75822
- const { codeName: G, codeValue: U } = e != null ? e : {};
75823
- return !G || !U ? null : (ne = (te = this.descriptionMap.get(G)) == null ? void 0 : te.get(U)) != null ? ne : null;
75824
- };
75825
- },
75826
- getDescriptions() {
75827
- return (e) => {
75828
- var U, te;
75829
- const { codeName: G } = e != null ? e : {};
75830
- return G ? [...(te = (U = this.descriptionMap.get(G)) == null ? void 0 : U.values()) != null ? te : []] : [];
75831
- };
75832
- },
75833
- getI18N() {
75834
- var e;
75835
- return (e = this.I18N) != null ? e : {};
75836
- },
75837
- getI18n() {
75838
- var e;
75839
- return (e = this.i18n) != null ? e : {};
75840
- },
75841
- getOption() {
75842
- var e;
75843
- return (e = this.option) != null ? e : {};
75844
- },
75845
- getPublicPath() {
75846
- var e;
75847
- return ((e = this.option) == null ? void 0 : e.publicPath) || "/kengic-boot";
75848
- },
75849
- getRouter() {
75850
- return this.router;
75851
- },
75852
- getUsePermissionStore() {
75853
- return this.usePermissionStore;
75854
- },
75855
- getUseUserStore() {
75856
- return this.useUserStore;
75857
- }
75858
- },
75859
75805
  actions: {
75860
75806
  p(e) {
75861
75807
  return this.pFunction ? this.pFunction(e) : (Ne("\u68C0\u67E5\u6743\u9650\u7684\u65B9\u6CD5\u4E3A\u7A7A.", { permissionCode: e }), !0);
@@ -75896,7 +75842,7 @@ const useKgStore = defineStore("Kg", {
75896
75842
  ne.codval && te.set(ne.codval, ne);
75897
75843
  },
75898
75844
  setI18N(e) {
75899
- this.I18N = e;
75845
+ e && (this.I18N = e);
75900
75846
  },
75901
75847
  setI18n(e) {
75902
75848
  this.i18n = e;
@@ -75933,11 +75879,66 @@ const useKgStore = defineStore("Kg", {
75933
75879
  let U = e != null ? e : "";
75934
75880
  return (U.startsWith("t('") && U.endsWith("')") || U.startsWith('t("') && U.endsWith('")')) && (U = (ne = (te = U.match(/^t\(['|"](.*)?['|"]\)$/)) == null ? void 0 : te[1]) != null ? ne : U), this.tFunction(U, ...G);
75935
75881
  }
75936
- }
75882
+ },
75883
+ getters: {
75884
+ getDescription() {
75885
+ return (e) => {
75886
+ var te, ne;
75887
+ const { codeName: G, codeValue: U } = e != null ? e : {};
75888
+ return !G || !U ? null : (ne = (te = this.descriptionMap.get(G)) == null ? void 0 : te.get(U)) != null ? ne : null;
75889
+ };
75890
+ },
75891
+ getDescriptions() {
75892
+ return (e) => {
75893
+ var U, te;
75894
+ const { codeName: G } = e != null ? e : {};
75895
+ return G ? [...(te = (U = this.descriptionMap.get(G)) == null ? void 0 : U.values()) != null ? te : []] : [];
75896
+ };
75897
+ },
75898
+ getI18N() {
75899
+ var e;
75900
+ return (e = this.I18N) != null ? e : {};
75901
+ },
75902
+ getI18n() {
75903
+ var e;
75904
+ return (e = this.i18n) != null ? e : {};
75905
+ },
75906
+ getOption() {
75907
+ var e;
75908
+ return (e = this.option) != null ? e : {};
75909
+ },
75910
+ getPublicPath() {
75911
+ var e;
75912
+ return ((e = this.option) == null ? void 0 : e.publicPath) || "/kengic-boot";
75913
+ },
75914
+ getRouter() {
75915
+ return this.router;
75916
+ },
75917
+ getUsePermissionStore() {
75918
+ return this.usePermissionStore;
75919
+ },
75920
+ getUseUserStore() {
75921
+ return this.useUserStore;
75922
+ }
75923
+ },
75924
+ state: () => ({
75925
+ I18N: {},
75926
+ descriptionMap: /* @__PURE__ */ new Map(),
75927
+ i18n: null,
75928
+ isDescriptionsRequestingMap: /* @__PURE__ */ new Map(),
75929
+ locale: null,
75930
+ option: {},
75931
+ pFunction: null,
75932
+ router: null,
75933
+ tFunction: null,
75934
+ usePermissionStore: null,
75935
+ useUserStore: null
75936
+ })
75937
75937
  });
75938
75938
  function useKg() {
75939
75939
  const e = useKgStore(pinia);
75940
75940
  return {
75941
+ I18N$$: computed(() => e.getI18N),
75941
75942
  getDescription(G) {
75942
75943
  return e.getDescription(G);
75943
75944
  },
@@ -76002,7 +76003,7 @@ async function setup(e) {
76002
76003
  if (ai(`${version}`), !e.pFunction)
76003
76004
  throw Ne("setup() | \u7F3A\u5C11\u5FC5\u8981\u7684\u521D\u59CB\u5316\u53C2\u6570.", { options: e }), new Error("[@kengic/vue] \u521D\u59CB\u5316\u5931\u8D25, \u7F3A\u5C11\u5FC5\u8981\u7684\u53C2\u6570.");
76004
76005
  const G = useKg();
76005
- G.store.setI18N(e.I18N), G.store.setI18n(e.i18n), G.store.setOption((U = e.option) != null ? U : {}), G.store.setP(e.pFunction), G.store.setRouter(e.router), G.store.setUsePermissionStore(e.usePermissionStore), G.store.setUseUserStore(e.useUserStore), G.store.setT(e.i18n), initKgCoreReact({
76006
+ G.store.setI18n(e.i18n), G.store.setOption((U = e.option) != null ? U : {}), G.store.setP(e.pFunction), G.store.setRouter(e.router), G.store.setUsePermissionStore(e.usePermissionStore), G.store.setUseUserStore(e.useUserStore), G.store.setT(e.i18n), initKgCoreReact({
76006
76007
  ref: ref$1,
76007
76008
  option: {
76008
76009
  KgWorkStation: (te = e.option) == null ? void 0 : te.KgStation
@@ -91850,19 +91851,19 @@ if (process.env.NODE_ENV !== "production" || __INTLIFY_PROD_DEVTOOLS__) {
91850
91851
  e.__INTLIFY__ = !0, setDevToolsHook(e.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__);
91851
91852
  }
91852
91853
  process.env.NODE_ENV;
91853
- const { fallback, availableLocales } = localeSetting;
91854
+ const { fallback, availableLocales, locale } = localeSetting;
91854
91855
  let i18n;
91855
91856
  async function createI18nOptions() {
91856
- var ne, oe;
91857
- const G = useLocaleStore().getLocale, te = (oe = (ne = (await __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({}), `./lang/${G}.ts`)).default) == null ? void 0 : ne.message) != null ? oe : {};
91858
- return setHtmlPageLang(G), setLoadLocalePool((ie) => {
91859
- ie.push(G);
91857
+ var U, te;
91858
+ const G = (te = (U = (await __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({}), `./lang/${locale}.ts`)).default) == null ? void 0 : U.message) != null ? te : {};
91859
+ return setHtmlPageLang(locale), setLoadLocalePool((ne) => {
91860
+ ne.push(locale);
91860
91861
  }), {
91861
91862
  legacy: !1,
91862
- locale: G,
91863
+ locale,
91863
91864
  fallbackLocale: fallback,
91864
91865
  messages: {
91865
- [G]: te
91866
+ [locale]: G
91866
91867
  },
91867
91868
  availableLocales,
91868
91869
  sync: !0,
@@ -5,11 +5,11 @@ export declare const KG_VAR_CONFIG_MODAL__CONTEXT: {
5
5
  */
6
6
  DEFAULT: string;
7
7
  /**
8
- * 从查询条件组件中, 点击配置按钮打开, 只显示查询条件视图配置.
8
+ * 从查询条件组件中, 点击配置按钮打开, 只显示查询条件配置.
9
9
  */
10
10
  SEARCH: string;
11
11
  /**
12
- * 从表格中, 点击视图配置菜单打开, 只显示表格视图配置.
12
+ * 从表格中, 点击视图配置菜单打开, 只显示表格配置.
13
13
  */
14
14
  TABLE: string;
15
15
  };
@@ -1,8 +1,13 @@
1
1
  import { ComputedRef } from 'vue';
2
+ import { Router } from 'vue-router';
2
3
  import { Description } from '../api/WMS/models';
3
4
  import { LocaleType } from '../project/types/config';
4
- import { IKgStore, P, T } from './config.store';
5
+ import { IKgOption, IKgStore, P, T } from './config.store';
5
6
  export interface IUseKg {
7
+ /**
8
+ * 语言数据.
9
+ */
10
+ I18N$$: ComputedRef<Record<string, any>>;
6
11
  /**
7
12
  * 获取当前语言下的某个描述.
8
13
  *
@@ -18,13 +23,13 @@ export interface IUseKg {
18
23
  /**
19
24
  * 组件库的配置参数.
20
25
  */
21
- option: ComputedRef<IKgStore['getOption']>;
26
+ option: ComputedRef<IKgOption>;
22
27
  /** 检查权限. */
23
28
  p: P;
24
29
  /**
25
30
  * 路由对象.
26
31
  */
27
- router: ComputedRef<IKgStore['getRouter']>;
32
+ router: ComputedRef<Router | null>;
28
33
  store: IKgStore;
29
34
  /** 翻译. */
30
35
  t: T;
@@ -299,7 +299,7 @@ export interface IUseKgStoreActions {
299
299
  codeName: string | null | undefined;
300
300
  descriptions: Array<DescriptionDTO>;
301
301
  }): void;
302
- setI18N(I18N: Record<string, any>): void;
302
+ setI18N(I18N?: Record<string, any>): void;
303
303
  setI18n(i18n: any): void;
304
304
  setOption(option: IKgOption): void;
305
305
  setP(fn: P): void;
@@ -4,10 +4,6 @@ import { Router } from 'vue-router';
4
4
  import { IKgOption, P } from './config.store';
5
5
  import '@kengic/core.react/index.css';
6
6
  export declare type IKgOptions = {
7
- /**
8
- * 语言数据.
9
- */
10
- I18N: Record<string, any>;
11
7
  app: App;
12
8
  i18n: any;
13
9
  /** 配置参数. */
@@ -13,7 +13,11 @@ export declare let localeList: DropMenu[];
13
13
  export declare const localeSetting: LocaleSetting;
14
14
  export declare type IKgLocaleOptions = {
15
15
  /**
16
- * <p>可选语言. 如果为空则为所有语言.</p>
16
+ * 语言数据.
17
+ */
18
+ I18N?: Record<string, any>;
19
+ /**
20
+ * <p>可选择的语言. 默认可选所有语言.</p>
17
21
  */
18
22
  availableLocales?: Array<LocaleType>;
19
23
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kengic/vue",
3
- "version": "0.28.1-beta.1",
3
+ "version": "0.28.1-beta.2",
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",
@@ -39,7 +39,7 @@
39
39
  "@iconify-icons/ph": "1.2.5",
40
40
  "@iconify/vue": "4.1.2",
41
41
  "@kengic/core.core": "0.0.1-beta.22",
42
- "@kengic/core.react": "0.0.2-beta.5",
42
+ "@kengic/core.react": "0.0.2-beta.6",
43
43
  "@kengic/pont": "1.2.17-beta.5",
44
44
  "@rys-fe/vite-plugin-theme": "0.8.6",
45
45
  "@thymine/xunee": "0.4.9-beta.8",