@fmdevui/fm-dev 1.0.107 → 1.0.109

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! fm-dev v1.0.107 */
1
+ /*! fm-dev v1.0.109 */
2
2
  import { defineComponent, reactive, computed, watch, resolveComponent, createBlock, openBlock, withCtx, createVNode, createElementVNode, createTextVNode, toDisplayString as toDisplayString$1, withDirectives, createElementBlock, Fragment, renderList, vShow, ref, onMounted, nextTick, normalizeStyle, createCommentVNode, normalizeClass, withModifiers, mergeModels, useModel, effectScope, getCurrentInstance, shallowRef, isRef as isRef$1, inject, onUnmounted, h, Text, createSlots, renderSlot, markRaw, hasInjectionContext, toRaw as toRaw$1, isReactive as isReactive$1, toRef, unref, getCurrentScope, onScopeDispose, toRefs, resolveDirective, mergeProps, resolveDynamicComponent, useSlots, toHandlers, onBeforeUnmount, onUpdated, useAttrs, normalizeProps, guardReactiveProps } from 'vue';
3
3
  import crypto from 'crypto';
4
4
  import require$$0 from 'url';
@@ -35367,14 +35367,23 @@ const usefminputdropdownstore = defineStore("fminputdropdownstore", () => {
35367
35367
  const state = reactive({
35368
35368
  optionsData: {}
35369
35369
  });
35370
- const getOptionsData = async (apiService, apiAction, basecode, reload = false) => {
35370
+ const getOptionsData = async (apiService, apiAction, basecode, reload = false, multibasecode = []) => {
35371
35371
  if (!reload) {
35372
35372
  if (state.optionsData[basecode] && state.optionsData[basecode].length > 0) {
35373
35373
  return state.optionsData[basecode];
35374
35374
  }
35375
35375
  }
35376
- const res = await useBaseApi(apiService).get(null, apiAction + "/?codetype=" + basecode);
35377
- return state.optionsData[basecode] = res.data.result ?? [];
35376
+ const res = await useBaseApi(apiService).get(null, apiAction + "/?codetype=" + basecode + "&mcodes=" + multibasecode.join(","));
35377
+ if (multibasecode.length > 0) {
35378
+ const mdata = res.data.result ?? [];
35379
+ multibasecode.forEach((p) => {
35380
+ state.optionsData[p] = mdata.filter((p2) => {
35381
+ return p2.code === p2;
35382
+ }) ?? [];
35383
+ });
35384
+ } else {
35385
+ return state.optionsData[basecode] = res.data.result ?? [];
35386
+ }
35378
35387
  };
35379
35388
  return {
35380
35389
  state,
@@ -35421,7 +35430,7 @@ var _sfc_main$c = /* @__PURE__ */ defineComponent({
35421
35430
  },
35422
35431
  dropHeight: {
35423
35432
  type: String,
35424
- default: "300px"
35433
+ default: "180px"
35425
35434
  },
35426
35435
  /**
35427
35436
  * api service name
@@ -35443,6 +35452,20 @@ var _sfc_main$c = /* @__PURE__ */ defineComponent({
35443
35452
  basecode: {
35444
35453
  type: String,
35445
35454
  default: ""
35455
+ },
35456
+ /**
35457
+ * 基础编码 多个编码合在一起调用
35458
+ */
35459
+ multibasecode: {
35460
+ type: Array,
35461
+ default: []
35462
+ },
35463
+ /**
35464
+ * 是否默认加载数据
35465
+ */
35466
+ autoLoadData: {
35467
+ type: Boolean,
35468
+ default: true
35446
35469
  }
35447
35470
  }, {
35448
35471
  "id": {
@@ -35474,13 +35497,13 @@ var _sfc_main$c = /* @__PURE__ */ defineComponent({
35474
35497
  };
35475
35498
  onMounted(async () => {
35476
35499
  state.optionData = props.optionData;
35477
- if (props.basecode && props.basecode != "") {
35478
- state.optionData = await useBaseApi.getOptionsData(props.apiService, props.apiAction, props.basecode);
35500
+ if (props.autoLoadData && props.basecode && props.basecode != "") {
35501
+ state.optionData = await useBaseApi.getOptionsData(props.apiService, props.apiAction, props.basecode, false, props.multibasecode);
35479
35502
  }
35480
35503
  });
35481
35504
  const handRestdata = async () => {
35482
35505
  if (props.basecode && props.basecode != "") {
35483
- state.optionData = await useBaseApi.getOptionsData(props.apiService, props.apiAction, props.basecode, true);
35506
+ state.optionData = await useBaseApi.getOptionsData(props.apiService, props.apiAction, props.basecode, true, []);
35484
35507
  }
35485
35508
  };
35486
35509
  return (_ctx, _cache) => {
@@ -3,15 +3,15 @@ export declare const usefminputdropdownstore: StoreDefinition<"fminputdropdownst
3
3
  state: {
4
4
  optionsData: any;
5
5
  };
6
- getOptionsData: (apiService: string, apiAction: string, basecode: string, reload?: boolean) => Promise<any>;
6
+ getOptionsData: (apiService: string, apiAction: string, basecode: string, reload?: boolean, multibasecode?: Array<any>) => Promise<any>;
7
7
  }, "state">, Pick<{
8
8
  state: {
9
9
  optionsData: any;
10
10
  };
11
- getOptionsData: (apiService: string, apiAction: string, basecode: string, reload?: boolean) => Promise<any>;
11
+ getOptionsData: (apiService: string, apiAction: string, basecode: string, reload?: boolean, multibasecode?: Array<any>) => Promise<any>;
12
12
  }, never>, Pick<{
13
13
  state: {
14
14
  optionsData: any;
15
15
  };
16
- getOptionsData: (apiService: string, apiAction: string, basecode: string, reload?: boolean) => Promise<any>;
16
+ getOptionsData: (apiService: string, apiAction: string, basecode: string, reload?: boolean, multibasecode?: Array<any>) => Promise<any>;
17
17
  }, "getOptionsData">>;
@@ -756,6 +756,27 @@ declare const Fminputdropdown: DefineComponent<ExtractPropTypes<{
756
756
  type: StringConstructor;
757
757
  default: string;
758
758
  };
759
+ multibasecode: {
760
+ type: {
761
+ (arrayLength: number): any[];
762
+ (...items: any[]): any[];
763
+ new (arrayLength: number): any[];
764
+ new (...items: any[]): any[];
765
+ isArray(arg: any): arg is any[];
766
+ readonly prototype: any[];
767
+ from<T>(arrayLike: ArrayLike<T>): T[];
768
+ from<T, U>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
769
+ from<T>(iterable: Iterable<T> | ArrayLike<T>): T[];
770
+ from<T, U>(iterable: Iterable<T> | ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
771
+ of<T>(...items: T[]): T[];
772
+ readonly [Symbol.species]: ArrayConstructor;
773
+ };
774
+ default: never[];
775
+ };
776
+ autoLoadData: {
777
+ type: BooleanConstructor;
778
+ default: boolean;
779
+ };
759
780
  id: {
760
781
  type: PropType<any>;
761
782
  };
@@ -820,6 +841,27 @@ declare const Fminputdropdown: DefineComponent<ExtractPropTypes<{
820
841
  type: StringConstructor;
821
842
  default: string;
822
843
  };
844
+ multibasecode: {
845
+ type: {
846
+ (arrayLength: number): any[];
847
+ (...items: any[]): any[];
848
+ new (arrayLength: number): any[];
849
+ new (...items: any[]): any[];
850
+ isArray(arg: any): arg is any[];
851
+ readonly prototype: any[];
852
+ from<T>(arrayLike: ArrayLike<T>): T[];
853
+ from<T, U>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
854
+ from<T>(iterable: Iterable<T> | ArrayLike<T>): T[];
855
+ from<T, U>(iterable: Iterable<T> | ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
856
+ of<T>(...items: T[]): T[];
857
+ readonly [Symbol.species]: ArrayConstructor;
858
+ };
859
+ default: never[];
860
+ };
861
+ autoLoadData: {
862
+ type: BooleanConstructor;
863
+ default: boolean;
864
+ };
823
865
  id: {
824
866
  type: PropType<any>;
825
867
  };
@@ -841,6 +883,8 @@ declare const Fminputdropdown: DefineComponent<ExtractPropTypes<{
841
883
  dropWidth: string;
842
884
  dropHeight: string;
843
885
  basecode: string;
886
+ multibasecode: any[];
887
+ autoLoadData: boolean;
844
888
  }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
845
889
  declare const Fminputtable: {
846
890
  new (...args: any[]): CreateComponentPublicInstanceWithMixins<Readonly< ExtractPropTypes<{
@@ -68,6 +68,33 @@ declare const _default: DefineComponent<ExtractPropTypes<{
68
68
  type: StringConstructor;
69
69
  default: string;
70
70
  };
71
+ /**
72
+ * 基础编码 多个编码合在一起调用
73
+ */
74
+ multibasecode: {
75
+ type: {
76
+ (arrayLength: number): any[];
77
+ (...items: any[]): any[];
78
+ new (arrayLength: number): any[];
79
+ new (...items: any[]): any[];
80
+ isArray(arg: any): arg is any[];
81
+ readonly prototype: any[];
82
+ from<T>(arrayLike: ArrayLike<T>): T[];
83
+ from<T, U>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
84
+ from<T>(iterable: Iterable<T> | ArrayLike<T>): T[];
85
+ from<T, U>(iterable: Iterable<T> | ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
86
+ of<T>(...items: T[]): T[];
87
+ readonly [Symbol.species]: ArrayConstructor;
88
+ };
89
+ default: never[];
90
+ };
91
+ /**
92
+ * 是否默认加载数据
93
+ */
94
+ autoLoadData: {
95
+ type: BooleanConstructor;
96
+ default: boolean;
97
+ };
71
98
  id: {
72
99
  type: PropType<any>;
73
100
  };
@@ -147,6 +174,33 @@ declare const _default: DefineComponent<ExtractPropTypes<{
147
174
  type: StringConstructor;
148
175
  default: string;
149
176
  };
177
+ /**
178
+ * 基础编码 多个编码合在一起调用
179
+ */
180
+ multibasecode: {
181
+ type: {
182
+ (arrayLength: number): any[];
183
+ (...items: any[]): any[];
184
+ new (arrayLength: number): any[];
185
+ new (...items: any[]): any[];
186
+ isArray(arg: any): arg is any[];
187
+ readonly prototype: any[];
188
+ from<T>(arrayLike: ArrayLike<T>): T[];
189
+ from<T, U>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
190
+ from<T>(iterable: Iterable<T> | ArrayLike<T>): T[];
191
+ from<T, U>(iterable: Iterable<T> | ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
192
+ of<T>(...items: T[]): T[];
193
+ readonly [Symbol.species]: ArrayConstructor;
194
+ };
195
+ default: never[];
196
+ };
197
+ /**
198
+ * 是否默认加载数据
199
+ */
200
+ autoLoadData: {
201
+ type: BooleanConstructor;
202
+ default: boolean;
203
+ };
150
204
  id: {
151
205
  type: PropType<any>;
152
206
  };
@@ -168,5 +222,7 @@ declare const _default: DefineComponent<ExtractPropTypes<{
168
222
  dropWidth: string;
169
223
  dropHeight: string;
170
224
  basecode: string;
225
+ multibasecode: any[];
226
+ autoLoadData: boolean;
171
227
  }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
172
228
  export default _default;
@@ -8,14 +8,23 @@ const usefminputdropdownstore = pinia.defineStore("fminputdropdownstore", () =>
8
8
  const state = vue.reactive({
9
9
  optionsData: {}
10
10
  });
11
- const getOptionsData = async (apiService, apiAction, basecode, reload = false) => {
11
+ const getOptionsData = async (apiService, apiAction, basecode, reload = false, multibasecode = []) => {
12
12
  if (!reload) {
13
13
  if (state.optionsData[basecode] && state.optionsData[basecode].length > 0) {
14
14
  return state.optionsData[basecode];
15
15
  }
16
16
  }
17
- const res = await index.useBaseApi(apiService).get(null, apiAction + "/?codetype=" + basecode);
18
- return state.optionsData[basecode] = res.data.result ?? [];
17
+ const res = await index.useBaseApi(apiService).get(null, apiAction + "/?codetype=" + basecode + "&mcodes=" + multibasecode.join(","));
18
+ if (multibasecode.length > 0) {
19
+ const mdata = res.data.result ?? [];
20
+ multibasecode.forEach((p) => {
21
+ state.optionsData[p] = mdata.filter((p2) => {
22
+ return p2.code === p2;
23
+ }) ?? [];
24
+ });
25
+ } else {
26
+ return state.optionsData[basecode] = res.data.result ?? [];
27
+ }
19
28
  };
20
29
  return {
21
30
  state,
@@ -45,7 +45,7 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
45
45
  },
46
46
  dropHeight: {
47
47
  type: String,
48
- default: "300px"
48
+ default: "180px"
49
49
  },
50
50
  /**
51
51
  * api service name
@@ -67,6 +67,20 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
67
67
  basecode: {
68
68
  type: String,
69
69
  default: ""
70
+ },
71
+ /**
72
+ * 基础编码 多个编码合在一起调用
73
+ */
74
+ multibasecode: {
75
+ type: Array,
76
+ default: []
77
+ },
78
+ /**
79
+ * 是否默认加载数据
80
+ */
81
+ autoLoadData: {
82
+ type: Boolean,
83
+ default: true
70
84
  }
71
85
  }, {
72
86
  "id": {
@@ -98,13 +112,13 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
98
112
  };
99
113
  vue.onMounted(async () => {
100
114
  state.optionData = props.optionData;
101
- if (props.basecode && props.basecode != "") {
102
- state.optionData = await useBaseApi.getOptionsData(props.apiService, props.apiAction, props.basecode);
115
+ if (props.autoLoadData && props.basecode && props.basecode != "") {
116
+ state.optionData = await useBaseApi.getOptionsData(props.apiService, props.apiAction, props.basecode, false, props.multibasecode);
103
117
  }
104
118
  });
105
119
  const handRestdata = async () => {
106
120
  if (props.basecode && props.basecode != "") {
107
- state.optionData = await useBaseApi.getOptionsData(props.apiService, props.apiAction, props.basecode, true);
121
+ state.optionData = await useBaseApi.getOptionsData(props.apiService, props.apiAction, props.basecode, true, []);
108
122
  }
109
123
  };
110
124
  return (_ctx, _cache) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fmdevui/fm-dev",
3
- "version": "1.0.107",
3
+ "version": "1.0.109",
4
4
  "description": "Page level components developed based on Element Plus.",
5
5
  "author": "fmdevui",
6
6
  "keywords": [
File without changes