@fmdeui/fmui 1.0.60 → 1.0.62

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.
Files changed (43) hide show
  1. package/es/component.mjs +5 -1
  2. package/es/components/fmtree/index.d.ts +93 -0
  3. package/es/components/fmtree/index.vue.d.ts +106 -0
  4. package/es/components/index.d.ts +1 -0
  5. package/es/components/modifyRecord/index.d.ts +6 -0
  6. package/es/components/modifyRecord/index.vue.d.ts +6 -0
  7. package/es/packages/api/base/index.mjs +3 -3
  8. package/es/packages/components/fmtree/index.mjs +6 -0
  9. package/es/packages/components/fmtree/index.vue.mjs +5 -0
  10. package/es/packages/components/fmtree/index.vue2.mjs +273 -0
  11. package/es/packages/components/index.mjs +1 -0
  12. package/es/packages/components/modifyRecord/index.mjs +6 -0
  13. package/es/packages/components/modifyRecord/index.vue.mjs +5 -0
  14. package/es/packages/components/modifyRecord/index.vue2.mjs +267 -0
  15. package/index.js +620 -84
  16. package/index.min.js +6 -5
  17. package/index.min.mjs +7 -6
  18. package/index.mjs +622 -86
  19. package/lib/component.js +5 -1
  20. package/lib/components/fmtree/index.d.ts +93 -0
  21. package/lib/components/fmtree/index.vue.d.ts +106 -0
  22. package/lib/components/index.d.ts +1 -0
  23. package/lib/components/modifyRecord/index.d.ts +6 -0
  24. package/lib/components/modifyRecord/index.vue.d.ts +6 -0
  25. package/lib/packages/api/base/index.js +3 -3
  26. package/lib/packages/components/fmtree/index.js +8 -0
  27. package/lib/packages/components/fmtree/index.vue.js +9 -0
  28. package/lib/packages/components/fmtree/index.vue2.js +277 -0
  29. package/lib/packages/components/index.js +12 -10
  30. package/lib/packages/components/modifyRecord/index.js +8 -0
  31. package/lib/packages/components/modifyRecord/index.vue.js +9 -0
  32. package/lib/packages/components/modifyRecord/index.vue2.js +271 -0
  33. package/locale/en.js +1 -1
  34. package/locale/en.min.js +1 -1
  35. package/locale/en.min.mjs +1 -1
  36. package/locale/en.mjs +1 -1
  37. package/locale/zh-cn.js +1 -1
  38. package/locale/zh-cn.min.js +1 -1
  39. package/locale/zh-cn.min.mjs +1 -1
  40. package/locale/zh-cn.mjs +1 -1
  41. package/package.json +1 -1
  42. /package/es/{defaults.css → index.css} +0 -0
  43. /package/lib/{component.css → defaults.css} +0 -0
package/es/component.mjs CHANGED
@@ -9,6 +9,8 @@ import { FForm } from './packages/components/form/index.mjs';
9
9
  import { FChart } from './packages/components/chart/index.mjs';
10
10
  import { FLayout } from './packages/components/fm-layout/index.mjs';
11
11
  import { FSettings } from './packages/components/fm-settings/index.mjs';
12
+ import { FModifyRecord } from './packages/components/modifyRecord/index.mjs';
13
+ import { FmTree } from './packages/components/fmtree/index.mjs';
12
14
 
13
15
  const plugins = [
14
16
  FButton,
@@ -21,7 +23,9 @@ const plugins = [
21
23
  FChart,
22
24
  FForm,
23
25
  FLayout,
24
- FSettings
26
+ FSettings,
27
+ FModifyRecord,
28
+ FmTree
25
29
  ];
26
30
 
27
31
  export { plugins as default };
@@ -0,0 +1,93 @@
1
+ import { DefineComponent, ExtractPropTypes, PropType, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
2
+ import { TreeKey } from 'element-plus';
3
+ export declare const FmTree: DefineComponent<ExtractPropTypes<{
4
+ checkStrictly: {
5
+ type: BooleanConstructor;
6
+ default: boolean;
7
+ };
8
+ apiService: {
9
+ type: StringConstructor;
10
+ default: string;
11
+ };
12
+ apiAction: {
13
+ type: StringConstructor;
14
+ default: string;
15
+ };
16
+ paras: {
17
+ type: ObjectConstructor;
18
+ default: null;
19
+ };
20
+ nodeKey: {
21
+ type: StringConstructor;
22
+ default: string;
23
+ };
24
+ defaultProps: {
25
+ type: ObjectConstructor;
26
+ default: {
27
+ children: string;
28
+ label: string;
29
+ };
30
+ };
31
+ placeholder: {
32
+ type: StringConstructor;
33
+ default: string;
34
+ };
35
+ modelValue: {
36
+ type: PropType<any>;
37
+ };
38
+ }>, {
39
+ fetchTreeData: (showLoading?: boolean) => Promise<any>;
40
+ getCheckedKeys: () => TreeKey[];
41
+ setCurrentKey: (key?: TreeKey | undefined, shouldAutoExpandParent?: boolean | undefined) => void;
42
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
43
+ "node-click": (...args: any[]) => void;
44
+ "update:modelValue": (value: any) => void;
45
+ }, string, PublicProps, Readonly< ExtractPropTypes<{
46
+ checkStrictly: {
47
+ type: BooleanConstructor;
48
+ default: boolean;
49
+ };
50
+ apiService: {
51
+ type: StringConstructor;
52
+ default: string;
53
+ };
54
+ apiAction: {
55
+ type: StringConstructor;
56
+ default: string;
57
+ };
58
+ paras: {
59
+ type: ObjectConstructor;
60
+ default: null;
61
+ };
62
+ nodeKey: {
63
+ type: StringConstructor;
64
+ default: string;
65
+ };
66
+ defaultProps: {
67
+ type: ObjectConstructor;
68
+ default: {
69
+ children: string;
70
+ label: string;
71
+ };
72
+ };
73
+ placeholder: {
74
+ type: StringConstructor;
75
+ default: string;
76
+ };
77
+ modelValue: {
78
+ type: PropType<any>;
79
+ };
80
+ }>> & Readonly<{
81
+ "onUpdate:modelValue"?: ((value: any) => any) | undefined;
82
+ "onNode-click"?: ((...args: any[]) => any) | undefined;
83
+ }>, {
84
+ checkStrictly: boolean;
85
+ placeholder: string;
86
+ apiService: string;
87
+ apiAction: string;
88
+ paras: Record<string, any>;
89
+ nodeKey: string;
90
+ defaultProps: Record<string, any>;
91
+ }, {}, {}, {}, string, ComponentProvideOptions, true, {
92
+ treeRef: unknown;
93
+ }, any>;
@@ -0,0 +1,106 @@
1
+ import { TreeKey } from 'element-plus/es/components/tree/src/tree.type';
2
+ import { DefineComponent, ExtractPropTypes, PropType, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
3
+ declare const _default: DefineComponent<ExtractPropTypes<{
4
+ checkStrictly: {
5
+ type: BooleanConstructor;
6
+ default: boolean;
7
+ };
8
+ /**
9
+ * api service name
10
+ */
11
+ apiService: {
12
+ type: StringConstructor;
13
+ default: string;
14
+ };
15
+ /**
16
+ * api service 下的方法
17
+ */
18
+ apiAction: {
19
+ type: StringConstructor;
20
+ default: string;
21
+ };
22
+ paras: {
23
+ type: ObjectConstructor;
24
+ default: null;
25
+ };
26
+ nodeKey: {
27
+ type: StringConstructor;
28
+ default: string;
29
+ };
30
+ defaultProps: {
31
+ type: ObjectConstructor;
32
+ default: {
33
+ children: string;
34
+ label: string;
35
+ };
36
+ };
37
+ placeholder: {
38
+ type: StringConstructor;
39
+ default: string;
40
+ };
41
+ modelValue: {
42
+ type: PropType<any>;
43
+ };
44
+ }>, {
45
+ fetchTreeData: (showLoading?: boolean) => Promise<any>;
46
+ getCheckedKeys: () => TreeKey[];
47
+ setCurrentKey: (key?: TreeKey | undefined, shouldAutoExpandParent?: boolean | undefined) => void;
48
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
49
+ "node-click": (...args: any[]) => void;
50
+ "update:modelValue": (value: any) => void;
51
+ }, string, PublicProps, Readonly< ExtractPropTypes<{
52
+ checkStrictly: {
53
+ type: BooleanConstructor;
54
+ default: boolean;
55
+ };
56
+ /**
57
+ * api service name
58
+ */
59
+ apiService: {
60
+ type: StringConstructor;
61
+ default: string;
62
+ };
63
+ /**
64
+ * api service 下的方法
65
+ */
66
+ apiAction: {
67
+ type: StringConstructor;
68
+ default: string;
69
+ };
70
+ paras: {
71
+ type: ObjectConstructor;
72
+ default: null;
73
+ };
74
+ nodeKey: {
75
+ type: StringConstructor;
76
+ default: string;
77
+ };
78
+ defaultProps: {
79
+ type: ObjectConstructor;
80
+ default: {
81
+ children: string;
82
+ label: string;
83
+ };
84
+ };
85
+ placeholder: {
86
+ type: StringConstructor;
87
+ default: string;
88
+ };
89
+ modelValue: {
90
+ type: PropType<any>;
91
+ };
92
+ }>> & Readonly<{
93
+ "onUpdate:modelValue"?: ((value: any) => any) | undefined;
94
+ "onNode-click"?: ((...args: any[]) => any) | undefined;
95
+ }>, {
96
+ checkStrictly: boolean;
97
+ placeholder: string;
98
+ apiService: string;
99
+ apiAction: string;
100
+ paras: Record<string, any>;
101
+ nodeKey: string;
102
+ defaultProps: Record<string, any>;
103
+ }, {}, {}, {}, string, ComponentProvideOptions, true, {
104
+ treeRef: unknown;
105
+ }, any>;
106
+ export default _default;
@@ -10,3 +10,4 @@ export * from './form';
10
10
  export * from './svgIcon';
11
11
  export * from './fm-layout';
12
12
  export * from './fm-settings';
13
+ export * from './modifyRecord';
@@ -0,0 +1,6 @@
1
+ import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
2
+ export declare const FModifyRecord: DefineComponent<{
3
+ data: any;
4
+ }, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
5
+ data: any;
6
+ }> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
@@ -0,0 +1,6 @@
1
+ import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
2
+ type __VLS_Props = {
3
+ data: any;
4
+ };
5
+ declare const _default: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
6
+ export default _default;
@@ -87,9 +87,9 @@ const useBaseApi = (module, options = {}) => {
87
87
  detail: function(id, cancel = false) {
88
88
  return request(
89
89
  {
90
- url: baseUrl + "detail",
91
- method: "get",
92
- params: { id }
90
+ url: baseUrl + "detail/?id=" + id,
91
+ method: "get"
92
+ //params: { id },
93
93
  //data: { id },
94
94
  },
95
95
  cancel
@@ -0,0 +1,6 @@
1
+ import './index.vue.mjs';
2
+ import _sfc_main from './index.vue2.mjs';
3
+
4
+ const FmTree = _sfc_main;
5
+
6
+ export { FmTree };
@@ -0,0 +1,5 @@
1
+ import _sfc_main from './index.vue2.mjs';
2
+
3
+
4
+
5
+ export { _sfc_main as default };
@@ -0,0 +1,273 @@
1
+ import { defineComponent, useModel, ref, reactive, onMounted, watch, resolveComponent, resolveDirective, openBlock, createBlock, withCtx, withDirectives, createElementBlock, createVNode, createCommentVNode, createTextVNode, toDisplayString, createElementVNode, unref, mergeModels } from 'vue';
2
+ import { Search, MoreFilled } from '@element-plus/icons-vue';
3
+ import '../../api/index.mjs';
4
+ import { useBaseApi } from '../../api/base/index.mjs';
5
+
6
+ const _hoisted_1 = { style: { "padding": "5px" } };
7
+ const _hoisted_2 = { style: { "display": "flex", "align-items": "center", "gap": "8px", "flex-wrap": "nowrap", "overflow": "hidden" } };
8
+ const _hoisted_3 = { style: { "flex": "1 1 200px", "min-width": "0", "overflow": "hidden" } };
9
+ const _hoisted_4 = { style: { "display": "flex", "align-items": "center", "flex-shrink": "0", "white-space": "nowrap" } };
10
+ const _hoisted_5 = { style: { "margin-bottom": "45px" } };
11
+ var _sfc_main = /* @__PURE__ */ defineComponent({
12
+ ...{
13
+ name: "FmTree"
14
+ },
15
+ __name: "index",
16
+ props: /* @__PURE__ */ mergeModels({
17
+ checkStrictly: { type: Boolean, default: true },
18
+ /**
19
+ * api service name
20
+ */
21
+ apiService: {
22
+ type: String,
23
+ default: "planOrder"
24
+ },
25
+ /**
26
+ * api service 下的方法
27
+ */
28
+ apiAction: {
29
+ type: String,
30
+ default: "autoQuerySearch"
31
+ },
32
+ paras: {
33
+ type: Object,
34
+ default: null
35
+ },
36
+ nodeKey: {
37
+ type: String,
38
+ default: "id"
39
+ },
40
+ defaultProps: {
41
+ type: Object,
42
+ default: { children: "children", label: "name" }
43
+ },
44
+ placeholder: {
45
+ type: String,
46
+ default: "\u7C7B\u578B\u540D\u79F0"
47
+ }
48
+ }, {
49
+ "modelValue": {},
50
+ "modelModifiers": {}
51
+ }),
52
+ emits: /* @__PURE__ */ mergeModels(["node-click"], ["update:modelValue"]),
53
+ setup(__props, { expose: __expose, emit: __emit }) {
54
+ const props = __props;
55
+ const modeValue = useModel(__props, "modelValue");
56
+ const filterText = ref("");
57
+ const treeRef = ref();
58
+ const state = reactive({
59
+ loading: false,
60
+ folderData: [],
61
+ isShowCheckbox: false,
62
+ strictly: false
63
+ });
64
+ onMounted(async () => {
65
+ await fetchTreeData();
66
+ });
67
+ watch(filterText, (val) => {
68
+ treeRef.value.filter(val);
69
+ });
70
+ const fetchTreeData = async (showLoading = true) => {
71
+ var _a, _b;
72
+ if (showLoading) state.loading = true;
73
+ var res = await useBaseApi(props.apiService).get(props.paras, props.apiAction);
74
+ state.folderData = (_a = res.data.result) != null ? _a : [];
75
+ if (showLoading) state.loading = false;
76
+ const rtreeData = (_b = res.data.result) != null ? _b : [];
77
+ modeValue.value = rtreeData.length > 0 ? rtreeData[0] : { id: 0, name: "" };
78
+ return rtreeData;
79
+ };
80
+ const getCheckedKeys = () => {
81
+ return treeRef.value.getCheckedKeys();
82
+ };
83
+ const filterNode = (value, data) => {
84
+ if (!value) return true;
85
+ return data.name.includes(value);
86
+ };
87
+ const handleCommand = async (command) => {
88
+ var _a;
89
+ if ("expandAll" == command) {
90
+ for (let i = 0; i < treeRef.value.store._getAllNodes().length; i++) {
91
+ treeRef.value.store._getAllNodes()[i].expanded = true;
92
+ }
93
+ } else if ("collapseAll" == command) {
94
+ for (let i = 0; i < treeRef.value.store._getAllNodes().length; i++) {
95
+ treeRef.value.store._getAllNodes()[i].expanded = false;
96
+ }
97
+ } else if ("refresh" == command) {
98
+ fetchTreeData();
99
+ } else if ("rootNode" == command) {
100
+ (_a = treeRef.value) == null ? void 0 : _a.setCurrentKey();
101
+ modeValue.value = { id: 0, name: "" };
102
+ emit("node-click", { id: 0, name: "" });
103
+ }
104
+ };
105
+ const emit = __emit;
106
+ const nodeClick = (node) => {
107
+ modeValue.value = { id: node.id, name: node.name };
108
+ emit("node-click", { id: node.id, name: node.name });
109
+ };
110
+ const setCurrentKey = (key, shouldAutoExpandParent) => {
111
+ var _a;
112
+ (_a = treeRef.value) == null ? void 0 : _a.setCurrentKey(key, shouldAutoExpandParent);
113
+ };
114
+ __expose({ fetchTreeData, getCheckedKeys, setCurrentKey });
115
+ return (_ctx, _cache) => {
116
+ const _component_el_input = resolveComponent("el-input");
117
+ const _component_el_checkbox = resolveComponent("el-checkbox");
118
+ const _component_el_icon = resolveComponent("el-icon");
119
+ const _component_el_button = resolveComponent("el-button");
120
+ const _component_el_dropdown_item = resolveComponent("el-dropdown-item");
121
+ const _component_el_dropdown_menu = resolveComponent("el-dropdown-menu");
122
+ const _component_el_dropdown = resolveComponent("el-dropdown");
123
+ const _component_el_tree = resolveComponent("el-tree");
124
+ const _component_el_scrollbar = resolveComponent("el-scrollbar");
125
+ const _component_el_card = resolveComponent("el-card");
126
+ const _directive_loading = resolveDirective("loading");
127
+ return openBlock(), createBlock(_component_el_card, {
128
+ shadow: "hover",
129
+ "body-style": "height:100%;overflow:auto;padding:5px;width:100%;",
130
+ style: { "height": "100%" }
131
+ }, {
132
+ header: withCtx(() => [
133
+ createElementVNode("div", _hoisted_1, [
134
+ createElementVNode("div", _hoisted_2, [
135
+ createElementVNode("div", _hoisted_3, [
136
+ createVNode(_component_el_input, {
137
+ "prefix-icon": unref(Search),
138
+ modelValue: filterText.value,
139
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => filterText.value = $event),
140
+ modelModifiers: { lazy: true },
141
+ clearable: "",
142
+ placeholder: __props.placeholder
143
+ }, null, 8, ["prefix-icon", "modelValue", "placeholder"])
144
+ ]),
145
+ createElementVNode("div", _hoisted_4, [
146
+ !props.checkStrictly && state.isShowCheckbox ? (openBlock(), createBlock(_component_el_checkbox, {
147
+ key: 0,
148
+ modelValue: state.strictly,
149
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => state.strictly = $event),
150
+ label: "\u8054\u52A8",
151
+ style: { "margin-left": "8px" },
152
+ border: ""
153
+ }, null, 8, ["modelValue"])) : createCommentVNode("v-if", true),
154
+ createVNode(_component_el_dropdown, { onCommand: handleCommand }, {
155
+ dropdown: withCtx(() => [
156
+ createVNode(_component_el_dropdown_menu, null, {
157
+ default: withCtx(() => [
158
+ createVNode(_component_el_dropdown_item, { command: "expandAll" }, {
159
+ default: withCtx(() => [..._cache[2] || (_cache[2] = [
160
+ createTextVNode(
161
+ "\u5168\u90E8\u5C55\u5F00",
162
+ -1
163
+ /* CACHED */
164
+ )
165
+ ])]),
166
+ _: 1
167
+ /* STABLE */
168
+ }),
169
+ createVNode(_component_el_dropdown_item, { command: "collapseAll" }, {
170
+ default: withCtx(() => [..._cache[3] || (_cache[3] = [
171
+ createTextVNode(
172
+ "\u5168\u90E8\u6298\u53E0",
173
+ -1
174
+ /* CACHED */
175
+ )
176
+ ])]),
177
+ _: 1
178
+ /* STABLE */
179
+ }),
180
+ createVNode(_component_el_dropdown_item, { command: "rootNode" }, {
181
+ default: withCtx(() => [..._cache[4] || (_cache[4] = [
182
+ createTextVNode(
183
+ "\u6839\u8282\u70B9",
184
+ -1
185
+ /* CACHED */
186
+ )
187
+ ])]),
188
+ _: 1
189
+ /* STABLE */
190
+ }),
191
+ createVNode(_component_el_dropdown_item, { command: "refresh" }, {
192
+ default: withCtx(() => [..._cache[5] || (_cache[5] = [
193
+ createTextVNode(
194
+ "\u5237\u65B0",
195
+ -1
196
+ /* CACHED */
197
+ )
198
+ ])]),
199
+ _: 1
200
+ /* STABLE */
201
+ })
202
+ ]),
203
+ _: 1
204
+ /* STABLE */
205
+ })
206
+ ]),
207
+ default: withCtx(() => [
208
+ createVNode(_component_el_button, { style: { "margin-left": "8px", "width": "34px" } }, {
209
+ default: withCtx(() => [
210
+ createVNode(_component_el_icon, { class: "el-icon--center" }, {
211
+ default: withCtx(() => [
212
+ createVNode(unref(MoreFilled))
213
+ ]),
214
+ _: 1
215
+ /* STABLE */
216
+ })
217
+ ]),
218
+ _: 1
219
+ /* STABLE */
220
+ })
221
+ ]),
222
+ _: 1
223
+ /* STABLE */
224
+ })
225
+ ])
226
+ ])
227
+ ])
228
+ ]),
229
+ default: withCtx(() => [
230
+ withDirectives((openBlock(), createElementBlock("div", _hoisted_5, [
231
+ createVNode(_component_el_scrollbar, null, {
232
+ default: withCtx(() => [
233
+ createVNode(_component_el_tree, {
234
+ ref_key: "treeRef",
235
+ ref: treeRef,
236
+ class: "filter-tree",
237
+ data: state.folderData,
238
+ "node-key": __props.nodeKey,
239
+ props: __props.defaultProps,
240
+ "filter-node-method": filterNode,
241
+ onNodeClick: nodeClick,
242
+ "show-checkbox": state.isShowCheckbox,
243
+ "default-expand-all": "",
244
+ "highlight-current": "",
245
+ "check-strictly": !state.strictly
246
+ }, {
247
+ default: withCtx(({ node }) => [
248
+ createCommentVNode(' <el-icon v-if="node.level < 4" size="16" style="margin-right: 3px; display: inline; vertical-align: middle"><ele-FolderOpened /></el-icon>\r\n <el-icon v-else size="16" style="margin-right: 3px; display: inline; vertical-align: middle"><ele-Folder /></el-icon> '),
249
+ createTextVNode(
250
+ " " + toDisplayString(node.label),
251
+ 1
252
+ /* TEXT */
253
+ )
254
+ ]),
255
+ _: 1
256
+ /* STABLE */
257
+ }, 8, ["data", "node-key", "props", "show-checkbox", "check-strictly"])
258
+ ]),
259
+ _: 1
260
+ /* STABLE */
261
+ })
262
+ ])), [
263
+ [_directive_loading, state.loading]
264
+ ])
265
+ ]),
266
+ _: 1
267
+ /* STABLE */
268
+ });
269
+ };
270
+ }
271
+ });
272
+
273
+ export { _sfc_main as default };
@@ -10,3 +10,4 @@ export { FForm } from './form/index.mjs';
10
10
  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
+ export { FModifyRecord } from './modifyRecord/index.mjs';
@@ -0,0 +1,6 @@
1
+ import './index.vue.mjs';
2
+ import _sfc_main from './index.vue2.mjs';
3
+
4
+ const FModifyRecord = _sfc_main;
5
+
6
+ export { FModifyRecord };
@@ -0,0 +1,5 @@
1
+ import _sfc_main from './index.vue2.mjs';
2
+
3
+
4
+
5
+ export { _sfc_main as default };