@fmdeui/fmui 1.0.110 → 1.0.111

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/es/component.mjs CHANGED
@@ -15,6 +15,7 @@ import { FmTree } from './packages/components/fmtree/index.mjs';
15
15
  import { FmCascader } from './packages/components/fmcascader/index.mjs';
16
16
  import { FmInputNumber } from './packages/components/fm-inputnumber/index.mjs';
17
17
  import { FmAutocomplete } from './packages/components/fm-autocomplete/index.mjs';
18
+ import { FmSelect } from './packages/components/fm-select/index.mjs';
18
19
 
19
20
  const plugins = [
20
21
  FButton,
@@ -33,7 +34,8 @@ const plugins = [
33
34
  FmTree,
34
35
  FmCascader,
35
36
  FmInputNumber,
36
- FmAutocomplete
37
+ FmAutocomplete,
38
+ FmSelect
37
39
  ];
38
40
 
39
41
  export { plugins as default };
@@ -0,0 +1,194 @@
1
+ import { DefineComponent, ExtractPropTypes, PropType, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
2
+ export declare const FmSelect: DefineComponent<ExtractPropTypes<{
3
+ optionData: {
4
+ type: {
5
+ (arrayLength: number): any[];
6
+ (...items: any[]): any[];
7
+ new (arrayLength: number): any[];
8
+ new (...items: any[]): any[];
9
+ isArray(arg: any): arg is any[];
10
+ readonly prototype: any[];
11
+ from<T>(arrayLike: ArrayLike<T>): T[];
12
+ from<T, U>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
13
+ from<T>(iterable: Iterable<T> | ArrayLike<T>): T[];
14
+ from<T, U>(iterable: Iterable<T> | ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
15
+ of<T>(...items: T[]): T[];
16
+ readonly [Symbol.species]: ArrayConstructor;
17
+ };
18
+ default: never[];
19
+ };
20
+ bvalue: {
21
+ type: StringConstructor;
22
+ default: string;
23
+ };
24
+ blabel: {
25
+ type: StringConstructor;
26
+ default: string;
27
+ };
28
+ placeholder: {
29
+ type: StringConstructor;
30
+ default: string;
31
+ };
32
+ inputWidth: {
33
+ type: StringConstructor;
34
+ default: string;
35
+ };
36
+ dropWidth: {
37
+ type: StringConstructor;
38
+ default: string;
39
+ };
40
+ dropHeight: {
41
+ type: StringConstructor;
42
+ default: string;
43
+ };
44
+ apiService: {
45
+ type: StringConstructor;
46
+ default: string;
47
+ };
48
+ apiAction: {
49
+ type: StringConstructor;
50
+ default: string;
51
+ };
52
+ basecode: {
53
+ type: StringConstructor;
54
+ default: string;
55
+ };
56
+ multibasecode: {
57
+ type: {
58
+ (arrayLength: number): any[];
59
+ (...items: any[]): any[];
60
+ new (arrayLength: number): any[];
61
+ new (...items: any[]): any[];
62
+ isArray(arg: any): arg is any[];
63
+ readonly prototype: any[];
64
+ from<T>(arrayLike: ArrayLike<T>): T[];
65
+ from<T, U>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
66
+ from<T>(iterable: Iterable<T> | ArrayLike<T>): T[];
67
+ from<T, U>(iterable: Iterable<T> | ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
68
+ of<T>(...items: T[]): T[];
69
+ readonly [Symbol.species]: ArrayConstructor;
70
+ };
71
+ default: never[];
72
+ };
73
+ freshSize: {
74
+ type: (NumberConstructor | StringConstructor)[];
75
+ default: number;
76
+ };
77
+ autoLoadData: {
78
+ type: BooleanConstructor;
79
+ default: boolean;
80
+ };
81
+ id: {
82
+ type: PropType<number>;
83
+ };
84
+ name: {
85
+ type: PropType<string>;
86
+ };
87
+ }>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
88
+ change: (...args: any[]) => void;
89
+ "update:id": (value: number) => void;
90
+ "update:name": (value: string) => void;
91
+ }, string, PublicProps, Readonly< ExtractPropTypes<{
92
+ optionData: {
93
+ type: {
94
+ (arrayLength: number): any[];
95
+ (...items: any[]): any[];
96
+ new (arrayLength: number): any[];
97
+ new (...items: any[]): any[];
98
+ isArray(arg: any): arg is any[];
99
+ readonly prototype: any[];
100
+ from<T>(arrayLike: ArrayLike<T>): T[];
101
+ from<T, U>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
102
+ from<T>(iterable: Iterable<T> | ArrayLike<T>): T[];
103
+ from<T, U>(iterable: Iterable<T> | ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
104
+ of<T>(...items: T[]): T[];
105
+ readonly [Symbol.species]: ArrayConstructor;
106
+ };
107
+ default: never[];
108
+ };
109
+ bvalue: {
110
+ type: StringConstructor;
111
+ default: string;
112
+ };
113
+ blabel: {
114
+ type: StringConstructor;
115
+ default: string;
116
+ };
117
+ placeholder: {
118
+ type: StringConstructor;
119
+ default: string;
120
+ };
121
+ inputWidth: {
122
+ type: StringConstructor;
123
+ default: string;
124
+ };
125
+ dropWidth: {
126
+ type: StringConstructor;
127
+ default: string;
128
+ };
129
+ dropHeight: {
130
+ type: StringConstructor;
131
+ default: string;
132
+ };
133
+ apiService: {
134
+ type: StringConstructor;
135
+ default: string;
136
+ };
137
+ apiAction: {
138
+ type: StringConstructor;
139
+ default: string;
140
+ };
141
+ basecode: {
142
+ type: StringConstructor;
143
+ default: string;
144
+ };
145
+ multibasecode: {
146
+ type: {
147
+ (arrayLength: number): any[];
148
+ (...items: any[]): any[];
149
+ new (arrayLength: number): any[];
150
+ new (...items: any[]): any[];
151
+ isArray(arg: any): arg is any[];
152
+ readonly prototype: any[];
153
+ from<T>(arrayLike: ArrayLike<T>): T[];
154
+ from<T, U>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
155
+ from<T>(iterable: Iterable<T> | ArrayLike<T>): T[];
156
+ from<T, U>(iterable: Iterable<T> | ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
157
+ of<T>(...items: T[]): T[];
158
+ readonly [Symbol.species]: ArrayConstructor;
159
+ };
160
+ default: never[];
161
+ };
162
+ freshSize: {
163
+ type: (NumberConstructor | StringConstructor)[];
164
+ default: number;
165
+ };
166
+ autoLoadData: {
167
+ type: BooleanConstructor;
168
+ default: boolean;
169
+ };
170
+ id: {
171
+ type: PropType<number>;
172
+ };
173
+ name: {
174
+ type: PropType<string>;
175
+ };
176
+ }>> & Readonly<{
177
+ onChange?: ((...args: any[]) => any) | undefined;
178
+ "onUpdate:id"?: ((value: number) => any) | undefined;
179
+ "onUpdate:name"?: ((value: string) => any) | undefined;
180
+ }>, {
181
+ placeholder: string;
182
+ optionData: any[];
183
+ bvalue: string;
184
+ blabel: string;
185
+ inputWidth: string;
186
+ dropWidth: string;
187
+ dropHeight: string;
188
+ apiService: string;
189
+ apiAction: string;
190
+ basecode: string;
191
+ multibasecode: any[];
192
+ freshSize: string | number;
193
+ autoLoadData: boolean;
194
+ }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
@@ -0,0 +1,237 @@
1
+ import { DefineComponent, ExtractPropTypes, PropType, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
2
+ declare const _default: DefineComponent<ExtractPropTypes<{
3
+ optionData: {
4
+ type: {
5
+ (arrayLength: number): any[];
6
+ (...items: any[]): any[];
7
+ new (arrayLength: number): any[];
8
+ new (...items: any[]): any[];
9
+ isArray(arg: any): arg is any[];
10
+ readonly prototype: any[];
11
+ from<T>(arrayLike: ArrayLike<T>): T[];
12
+ from<T, U>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
13
+ from<T>(iterable: Iterable<T> | ArrayLike<T>): T[];
14
+ from<T, U>(iterable: Iterable<T> | ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
15
+ of<T>(...items: T[]): T[];
16
+ readonly [Symbol.species]: ArrayConstructor;
17
+ };
18
+ default: never[];
19
+ };
20
+ /**
21
+ * 值的属性值
22
+ */
23
+ bvalue: {
24
+ type: StringConstructor;
25
+ default: string;
26
+ };
27
+ /**
28
+ * 值的属性标签
29
+ */
30
+ blabel: {
31
+ type: StringConstructor;
32
+ default: string;
33
+ };
34
+ placeholder: {
35
+ type: StringConstructor;
36
+ default: string;
37
+ };
38
+ inputWidth: {
39
+ type: StringConstructor;
40
+ default: string;
41
+ };
42
+ dropWidth: {
43
+ type: StringConstructor;
44
+ default: string;
45
+ };
46
+ dropHeight: {
47
+ type: StringConstructor;
48
+ default: string;
49
+ };
50
+ /**
51
+ * api service name
52
+ */
53
+ apiService: {
54
+ type: StringConstructor;
55
+ default: string;
56
+ };
57
+ /**
58
+ * api service 下的方法
59
+ */
60
+ apiAction: {
61
+ type: StringConstructor;
62
+ default: string;
63
+ };
64
+ /**
65
+ * 基础编码 自动获取数据
66
+ */
67
+ basecode: {
68
+ type: StringConstructor;
69
+ default: string;
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
+ freshSize: {
92
+ type: (NumberConstructor | StringConstructor)[];
93
+ default: number;
94
+ };
95
+ /**
96
+ * 是否默认加载数据
97
+ */
98
+ autoLoadData: {
99
+ type: BooleanConstructor;
100
+ default: boolean;
101
+ };
102
+ id: {
103
+ type: PropType<number>;
104
+ };
105
+ name: {
106
+ type: PropType<string>;
107
+ };
108
+ }>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
109
+ change: (...args: any[]) => void;
110
+ "update:id": (value: number) => void;
111
+ "update:name": (value: string) => void;
112
+ }, string, PublicProps, Readonly< ExtractPropTypes<{
113
+ optionData: {
114
+ type: {
115
+ (arrayLength: number): any[];
116
+ (...items: any[]): any[];
117
+ new (arrayLength: number): any[];
118
+ new (...items: any[]): any[];
119
+ isArray(arg: any): arg is any[];
120
+ readonly prototype: any[];
121
+ from<T>(arrayLike: ArrayLike<T>): T[];
122
+ from<T, U>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
123
+ from<T>(iterable: Iterable<T> | ArrayLike<T>): T[];
124
+ from<T, U>(iterable: Iterable<T> | ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
125
+ of<T>(...items: T[]): T[];
126
+ readonly [Symbol.species]: ArrayConstructor;
127
+ };
128
+ default: never[];
129
+ };
130
+ /**
131
+ * 值的属性值
132
+ */
133
+ bvalue: {
134
+ type: StringConstructor;
135
+ default: string;
136
+ };
137
+ /**
138
+ * 值的属性标签
139
+ */
140
+ blabel: {
141
+ type: StringConstructor;
142
+ default: string;
143
+ };
144
+ placeholder: {
145
+ type: StringConstructor;
146
+ default: string;
147
+ };
148
+ inputWidth: {
149
+ type: StringConstructor;
150
+ default: string;
151
+ };
152
+ dropWidth: {
153
+ type: StringConstructor;
154
+ default: string;
155
+ };
156
+ dropHeight: {
157
+ type: StringConstructor;
158
+ default: string;
159
+ };
160
+ /**
161
+ * api service name
162
+ */
163
+ apiService: {
164
+ type: StringConstructor;
165
+ default: string;
166
+ };
167
+ /**
168
+ * api service 下的方法
169
+ */
170
+ apiAction: {
171
+ type: StringConstructor;
172
+ default: string;
173
+ };
174
+ /**
175
+ * 基础编码 自动获取数据
176
+ */
177
+ basecode: {
178
+ type: StringConstructor;
179
+ default: string;
180
+ };
181
+ /**
182
+ * 基础编码 多个编码合在一起调用
183
+ */
184
+ multibasecode: {
185
+ type: {
186
+ (arrayLength: number): any[];
187
+ (...items: any[]): any[];
188
+ new (arrayLength: number): any[];
189
+ new (...items: any[]): any[];
190
+ isArray(arg: any): arg is any[];
191
+ readonly prototype: any[];
192
+ from<T>(arrayLike: ArrayLike<T>): T[];
193
+ from<T, U>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
194
+ from<T>(iterable: Iterable<T> | ArrayLike<T>): T[];
195
+ from<T, U>(iterable: Iterable<T> | ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
196
+ of<T>(...items: T[]): T[];
197
+ readonly [Symbol.species]: ArrayConstructor;
198
+ };
199
+ default: never[];
200
+ };
201
+ freshSize: {
202
+ type: (NumberConstructor | StringConstructor)[];
203
+ default: number;
204
+ };
205
+ /**
206
+ * 是否默认加载数据
207
+ */
208
+ autoLoadData: {
209
+ type: BooleanConstructor;
210
+ default: boolean;
211
+ };
212
+ id: {
213
+ type: PropType<number>;
214
+ };
215
+ name: {
216
+ type: PropType<string>;
217
+ };
218
+ }>> & Readonly<{
219
+ onChange?: ((...args: any[]) => any) | undefined;
220
+ "onUpdate:id"?: ((value: number) => any) | undefined;
221
+ "onUpdate:name"?: ((value: string) => any) | undefined;
222
+ }>, {
223
+ placeholder: string;
224
+ optionData: any[];
225
+ bvalue: string;
226
+ blabel: string;
227
+ inputWidth: string;
228
+ dropWidth: string;
229
+ dropHeight: string;
230
+ apiService: string;
231
+ apiAction: string;
232
+ basecode: string;
233
+ multibasecode: any[];
234
+ freshSize: string | number;
235
+ autoLoadData: boolean;
236
+ }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
237
+ export default _default;
@@ -11,6 +11,7 @@ export * from './svgIcon';
11
11
  export * from './fm-layout';
12
12
  export * from './fm-settings';
13
13
  export * from './modifyRecord';
14
+ export * from './fm-select';
14
15
  export * from './fm-inputdropdown';
15
16
  export * from './fm-inputnumber';
16
17
  export * from './fm-autocomplete';
@@ -0,0 +1,6 @@
1
+ import './index.vue.mjs';
2
+ import _sfc_main from './index.vue2.mjs';
3
+
4
+ const FmSelect = _sfc_main;
5
+
6
+ export { FmSelect };
@@ -0,0 +1,5 @@
1
+ import _sfc_main from './index.vue2.mjs';
2
+
3
+
4
+
5
+ export { _sfc_main as default };
@@ -0,0 +1,177 @@
1
+ import { defineComponent, useModel, reactive, onMounted, resolveComponent, openBlock, createBlock, normalizeStyle, withCtx, createElementBlock, Fragment, renderList, createElementVNode, createVNode, unref, mergeModels } from 'vue';
2
+ import { RefreshLeft } from '@element-plus/icons-vue';
3
+ import '../../stores/index.mjs';
4
+ import { usefminputdropdownstore } from '../../stores/ainputdropdow.mjs';
5
+
6
+ const _hoisted_1 = { style: { "display": "flex", "justify-content": "end", "align-items": "right" } };
7
+ var _sfc_main = /* @__PURE__ */ defineComponent({
8
+ ...{
9
+ name: "FmSelect"
10
+ },
11
+ __name: "index",
12
+ props: /* @__PURE__ */ mergeModels({
13
+ //数据
14
+ optionData: {
15
+ type: Array,
16
+ default: []
17
+ },
18
+ /**
19
+ * 值的属性值
20
+ */
21
+ bvalue: {
22
+ type: String,
23
+ default: "id"
24
+ },
25
+ /**
26
+ * 值的属性标签
27
+ */
28
+ blabel: {
29
+ type: String,
30
+ default: "name"
31
+ },
32
+ placeholder: {
33
+ type: String,
34
+ default: "\u8BF7\u9009\u62E9"
35
+ },
36
+ inputWidth: {
37
+ type: String,
38
+ default: "40%"
39
+ },
40
+ dropWidth: {
41
+ type: String,
42
+ default: "90px"
43
+ },
44
+ dropHeight: {
45
+ type: String,
46
+ default: "180px"
47
+ },
48
+ /**
49
+ * api service name
50
+ */
51
+ apiService: {
52
+ type: String,
53
+ default: "baseData"
54
+ },
55
+ /**
56
+ * api service 下的方法
57
+ */
58
+ apiAction: {
59
+ type: String,
60
+ default: "baseDataList"
61
+ },
62
+ /**
63
+ * 基础编码 自动获取数据
64
+ */
65
+ basecode: {
66
+ type: String,
67
+ default: ""
68
+ },
69
+ /**
70
+ * 基础编码 多个编码合在一起调用
71
+ */
72
+ multibasecode: {
73
+ type: Array,
74
+ default: []
75
+ },
76
+ freshSize: {
77
+ type: [Number, String],
78
+ default: 20
79
+ },
80
+ /**
81
+ * 是否默认加载数据
82
+ */
83
+ autoLoadData: {
84
+ type: Boolean,
85
+ default: true
86
+ }
87
+ }, {
88
+ "id": { default: 0, required: false },
89
+ "idModifiers": {},
90
+ "name": { default: "", required: false },
91
+ "nameModifiers": {}
92
+ }),
93
+ emits: /* @__PURE__ */ mergeModels(["change"], ["update:id", "update:name"]),
94
+ setup(__props, { emit: __emit }) {
95
+ const modeValueId = useModel(__props, "id");
96
+ const modeValueName = useModel(__props, "name");
97
+ const props = __props;
98
+ const state = reactive({
99
+ optionData: props.optionData
100
+ });
101
+ const emit = __emit;
102
+ const handelChange = (val) => {
103
+ const fitem = state.optionData.find((item) => item[props.blabel] === val);
104
+ modeValueId.value = fitem != null ? fitem[props.bvalue] : 0;
105
+ modeValueName.value = fitem != null ? fitem[props.blabel] : "";
106
+ emit("change", val);
107
+ };
108
+ const handelClear = () => {
109
+ modeValueId.value = 0;
110
+ modeValueName.value = "";
111
+ emit("change", "");
112
+ };
113
+ onMounted(async () => {
114
+ if (props.optionData.length > 0) {
115
+ state.optionData = props.optionData;
116
+ }
117
+ if (props.autoLoadData && props.basecode && props.basecode != "") {
118
+ const useBaseApi = usefminputdropdownstore();
119
+ state.optionData = await useBaseApi.getOptionsData(props.apiService, props.apiAction, props.basecode, false, props.multibasecode);
120
+ }
121
+ });
122
+ const handRestdata = async () => {
123
+ if (props.basecode && props.basecode != "") {
124
+ const useBaseApi = usefminputdropdownstore();
125
+ state.optionData = await useBaseApi.getOptionsData(props.apiService, props.apiAction, props.basecode, true, []);
126
+ }
127
+ };
128
+ return (_ctx, _cache) => {
129
+ const _component_el_icon = resolveComponent("el-icon");
130
+ const _component_el_option = resolveComponent("el-option");
131
+ const _component_el_select = resolveComponent("el-select");
132
+ return openBlock(), createBlock(_component_el_select, {
133
+ modelValue: modeValueName.value,
134
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => modeValueName.value = $event),
135
+ placeholder: props.placeholder,
136
+ style: normalizeStyle({ width: __props.inputWidth }),
137
+ onChange: handelChange,
138
+ onClear: handelClear
139
+ }, {
140
+ header: withCtx(() => [
141
+ createElementVNode("div", _hoisted_1, [
142
+ createVNode(_component_el_icon, {
143
+ color: "#13c2c2",
144
+ size: __props.freshSize,
145
+ onClick: handRestdata
146
+ }, {
147
+ default: withCtx(() => [
148
+ createVNode(unref(RefreshLeft))
149
+ ]),
150
+ _: 1
151
+ /* STABLE */
152
+ }, 8, ["size"])
153
+ ])
154
+ ]),
155
+ default: withCtx(() => [
156
+ (openBlock(true), createElementBlock(
157
+ Fragment,
158
+ null,
159
+ renderList(state.optionData, (item, index) => {
160
+ return openBlock(), createBlock(_component_el_option, {
161
+ key: index,
162
+ label: item[__props.blabel],
163
+ value: item[__props.blabel]
164
+ }, null, 8, ["label", "value"]);
165
+ }),
166
+ 128
167
+ /* KEYED_FRAGMENT */
168
+ ))
169
+ ]),
170
+ _: 1
171
+ /* STABLE */
172
+ }, 8, ["modelValue", "placeholder", "style"]);
173
+ };
174
+ }
175
+ });
176
+
177
+ export { _sfc_main as default };
@@ -11,6 +11,7 @@ export { elSvg } from './svgIcon/index.mjs';
11
11
  export { FLayout } from './fm-layout/index.mjs';
12
12
  export { FSettings } from './fm-settings/index.mjs';
13
13
  export { FModifyRecord } from './modifyRecord/index.mjs';
14
+ export { FmSelect } from './fm-select/index.mjs';
14
15
  export { Fminputdropdown } from './fm-inputdropdown/index.mjs';
15
16
  export { FmInputNumber } from './fm-inputnumber/index.mjs';
16
17
  export { FmAutocomplete } from './fm-autocomplete/index.mjs';