@fmdeui/fmui 1.0.75 → 1.0.76

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
@@ -11,6 +11,7 @@ import { FLayout } from './packages/components/fm-layout/index.mjs';
11
11
  import { FSettings } from './packages/components/fm-settings/index.mjs';
12
12
  import { FModifyRecord } from './packages/components/modifyRecord/index.mjs';
13
13
  import { FmTree } from './packages/components/fmtree/index.mjs';
14
+ import { FmCascader } from './packages/components/fmcascader/index.mjs';
14
15
 
15
16
  const plugins = [
16
17
  FButton,
@@ -25,7 +26,8 @@ const plugins = [
25
26
  FLayout,
26
27
  FSettings,
27
28
  FModifyRecord,
28
- FmTree
29
+ FmTree,
30
+ FmCascader
29
31
  ];
30
32
 
31
33
  export { plugins as default };
@@ -0,0 +1,114 @@
1
+ import { DefineComponent, ExtractPropTypes, PropType, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
2
+ export declare const FmCascader: DefineComponent<ExtractPropTypes<{
3
+ orgData: {
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
+ cascaderProps: {
21
+ type: ObjectConstructor;
22
+ default: () => {
23
+ emitPath: boolean;
24
+ value: string;
25
+ label: string;
26
+ expandTrigger: string;
27
+ };
28
+ };
29
+ placeholder: {
30
+ type: StringConstructor;
31
+ default: string;
32
+ };
33
+ vId: {
34
+ type: StringConstructor;
35
+ default: string;
36
+ };
37
+ vCmpId: {
38
+ type: StringConstructor;
39
+ default: string;
40
+ };
41
+ vDetId: {
42
+ type: StringConstructor;
43
+ default: string;
44
+ };
45
+ vGroupId: {
46
+ type: StringConstructor;
47
+ default: string;
48
+ };
49
+ modelValue: {
50
+ type: PropType<any>;
51
+ };
52
+ }>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
53
+ "update:modelValue": (value: any) => any;
54
+ }, string, PublicProps, Readonly< ExtractPropTypes<{
55
+ orgData: {
56
+ type: {
57
+ (arrayLength: number): any[];
58
+ (...items: any[]): any[];
59
+ new (arrayLength: number): any[];
60
+ new (...items: any[]): any[];
61
+ isArray(arg: any): arg is any[];
62
+ readonly prototype: any[];
63
+ from<T>(arrayLike: ArrayLike<T>): T[];
64
+ from<T, U>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
65
+ from<T>(iterable: Iterable<T> | ArrayLike<T>): T[];
66
+ from<T, U>(iterable: Iterable<T> | ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
67
+ of<T>(...items: T[]): T[];
68
+ readonly [Symbol.species]: ArrayConstructor;
69
+ };
70
+ default: () => never[];
71
+ };
72
+ cascaderProps: {
73
+ type: ObjectConstructor;
74
+ default: () => {
75
+ emitPath: boolean;
76
+ value: string;
77
+ label: string;
78
+ expandTrigger: string;
79
+ };
80
+ };
81
+ placeholder: {
82
+ type: StringConstructor;
83
+ default: string;
84
+ };
85
+ vId: {
86
+ type: StringConstructor;
87
+ default: string;
88
+ };
89
+ vCmpId: {
90
+ type: StringConstructor;
91
+ default: string;
92
+ };
93
+ vDetId: {
94
+ type: StringConstructor;
95
+ default: string;
96
+ };
97
+ vGroupId: {
98
+ type: StringConstructor;
99
+ default: string;
100
+ };
101
+ modelValue: {
102
+ type: PropType<any>;
103
+ };
104
+ }>> & Readonly<{
105
+ "onUpdate:modelValue"?: ((value: any) => any) | undefined;
106
+ }>, {
107
+ placeholder: string;
108
+ orgData: any[];
109
+ cascaderProps: Record<string, any>;
110
+ vId: string;
111
+ vCmpId: string;
112
+ vDetId: string;
113
+ vGroupId: string;
114
+ }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
@@ -0,0 +1,115 @@
1
+ import { DefineComponent, ExtractPropTypes, PropType, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
2
+ declare const _default: DefineComponent<ExtractPropTypes<{
3
+ orgData: {
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
+ cascaderProps: {
21
+ type: ObjectConstructor;
22
+ default: () => {
23
+ emitPath: boolean;
24
+ value: string;
25
+ label: string;
26
+ expandTrigger: string;
27
+ };
28
+ };
29
+ placeholder: {
30
+ type: StringConstructor;
31
+ default: string;
32
+ };
33
+ vId: {
34
+ type: StringConstructor;
35
+ default: string;
36
+ };
37
+ vCmpId: {
38
+ type: StringConstructor;
39
+ default: string;
40
+ };
41
+ vDetId: {
42
+ type: StringConstructor;
43
+ default: string;
44
+ };
45
+ vGroupId: {
46
+ type: StringConstructor;
47
+ default: string;
48
+ };
49
+ modelValue: {
50
+ type: PropType<any>;
51
+ };
52
+ }>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
53
+ "update:modelValue": (value: any) => any;
54
+ }, string, PublicProps, Readonly< ExtractPropTypes<{
55
+ orgData: {
56
+ type: {
57
+ (arrayLength: number): any[];
58
+ (...items: any[]): any[];
59
+ new (arrayLength: number): any[];
60
+ new (...items: any[]): any[];
61
+ isArray(arg: any): arg is any[];
62
+ readonly prototype: any[];
63
+ from<T>(arrayLike: ArrayLike<T>): T[];
64
+ from<T, U>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
65
+ from<T>(iterable: Iterable<T> | ArrayLike<T>): T[];
66
+ from<T, U>(iterable: Iterable<T> | ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
67
+ of<T>(...items: T[]): T[];
68
+ readonly [Symbol.species]: ArrayConstructor;
69
+ };
70
+ default: () => never[];
71
+ };
72
+ cascaderProps: {
73
+ type: ObjectConstructor;
74
+ default: () => {
75
+ emitPath: boolean;
76
+ value: string;
77
+ label: string;
78
+ expandTrigger: string;
79
+ };
80
+ };
81
+ placeholder: {
82
+ type: StringConstructor;
83
+ default: string;
84
+ };
85
+ vId: {
86
+ type: StringConstructor;
87
+ default: string;
88
+ };
89
+ vCmpId: {
90
+ type: StringConstructor;
91
+ default: string;
92
+ };
93
+ vDetId: {
94
+ type: StringConstructor;
95
+ default: string;
96
+ };
97
+ vGroupId: {
98
+ type: StringConstructor;
99
+ default: string;
100
+ };
101
+ modelValue: {
102
+ type: PropType<any>;
103
+ };
104
+ }>> & Readonly<{
105
+ "onUpdate:modelValue"?: ((value: any) => any) | undefined;
106
+ }>, {
107
+ placeholder: string;
108
+ orgData: any[];
109
+ cascaderProps: Record<string, any>;
110
+ vId: string;
111
+ vCmpId: string;
112
+ vDetId: string;
113
+ vGroupId: string;
114
+ }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
115
+ export default _default;
@@ -0,0 +1,6 @@
1
+ import './index.vue.mjs';
2
+ import _sfc_main from './index.vue2.mjs';
3
+
4
+ const FmCascader = _sfc_main;
5
+
6
+ export { FmCascader };
@@ -0,0 +1,5 @@
1
+ import _sfc_main from './index.vue2.mjs';
2
+
3
+
4
+
5
+ export { _sfc_main as default };
@@ -0,0 +1,126 @@
1
+ import { defineComponent, useModel, resolveComponent, openBlock, createBlock, withCtx, createElementVNode, toDisplayString, createElementBlock, createCommentVNode, mergeModels } from 'vue';
2
+
3
+ const _hoisted_1 = { key: 0 };
4
+ var _sfc_main = /* @__PURE__ */ defineComponent({
5
+ ...{
6
+ name: "FmCascader"
7
+ },
8
+ __name: "index",
9
+ props: /* @__PURE__ */ mergeModels({
10
+ orgData: {
11
+ type: Array,
12
+ default: () => []
13
+ },
14
+ cascaderProps: {
15
+ type: Object,
16
+ default: () => ({ emitPath: false, value: "id", label: "name", expandTrigger: "hover" })
17
+ },
18
+ placeholder: {
19
+ type: String,
20
+ default: "\u8BF7\u9009\u62E9\u7236\u8282"
21
+ },
22
+ vId: {
23
+ type: String,
24
+ default: "opOrgId"
25
+ },
26
+ vCmpId: {
27
+ type: String,
28
+ default: "opCmpId"
29
+ },
30
+ vDetId: {
31
+ type: String,
32
+ default: "opDetId"
33
+ },
34
+ vGroupId: {
35
+ type: String,
36
+ default: "opGroupId"
37
+ }
38
+ }, {
39
+ "modelValue": {},
40
+ "modelModifiers": {}
41
+ }),
42
+ emits: ["update:modelValue"],
43
+ setup(__props) {
44
+ const modeValue = useModel(__props, "modelValue");
45
+ const props = __props;
46
+ const handelchangeOrg = (val) => {
47
+ modeValue.value[props.vId] = val;
48
+ const node = findNode(val);
49
+ if (node) {
50
+ if (node.pid == 0) {
51
+ if (Object.prototype.hasOwnProperty.call(modeValue.value, props.vCmpId))
52
+ modeValue.value[props.vCmpId] = node.id;
53
+ if (Object.prototype.hasOwnProperty.call(modeValue.value, props.vDetId))
54
+ modeValue.value[props.vDetId] = 0;
55
+ if (Object.prototype.hasOwnProperty.call(modeValue.value, props.vGroupId))
56
+ modeValue.value[props.vGroupId] = 0;
57
+ } else if (node.level == 2) {
58
+ if (Object.prototype.hasOwnProperty.call(modeValue.value, props.vDetId))
59
+ modeValue.value[props.vDetId] = node.id;
60
+ if (Object.prototype.hasOwnProperty.call(modeValue.value, props.vCmpId))
61
+ modeValue.value[props.vCmpId] = node.pid;
62
+ if (Object.prototype.hasOwnProperty.call(modeValue.value, props.vGroupId))
63
+ modeValue.value[props.vGroupId] = 0;
64
+ } else if (node.level == 3) {
65
+ if (Object.prototype.hasOwnProperty.call(modeValue.value, props.vGroupId))
66
+ modeValue.value[props.vGroupId] = node.id;
67
+ if (Object.prototype.hasOwnProperty.call(modeValue.value, props.vDetId))
68
+ modeValue.value[props.vDetId] = node.pid;
69
+ let top = findNode(node.pid);
70
+ if (top) {
71
+ if (Object.prototype.hasOwnProperty.call(modeValue.value, props.vCmpId))
72
+ modeValue.value[props.vCmpId] = top.id;
73
+ }
74
+ }
75
+ }
76
+ };
77
+ const findNode = (id) => {
78
+ const search = (nodes) => {
79
+ var _a;
80
+ for (const node of nodes) {
81
+ if (node.id === id) return node;
82
+ if ((_a = node.children) == null ? void 0 : _a.length) {
83
+ const found = search(node.children);
84
+ if (found) return found;
85
+ }
86
+ }
87
+ return null;
88
+ };
89
+ return search(props.orgData || []);
90
+ };
91
+ return (_ctx, _cache) => {
92
+ const _component_el_cascader = resolveComponent("el-cascader");
93
+ return openBlock(), createBlock(_component_el_cascader, {
94
+ options: props.orgData,
95
+ props: __props.cascaderProps,
96
+ placeholder: __props.placeholder,
97
+ filterable: "",
98
+ class: "w100",
99
+ modelValue: modeValue.value[__props.vId],
100
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => modeValue.value[__props.vId] = $event),
101
+ onChange: handelchangeOrg
102
+ }, {
103
+ default: withCtx(({ node, data }) => [
104
+ createElementVNode(
105
+ "span",
106
+ null,
107
+ toDisplayString(node.label),
108
+ 1
109
+ /* TEXT */
110
+ ),
111
+ !node.isLeaf ? (openBlock(), createElementBlock(
112
+ "span",
113
+ _hoisted_1,
114
+ " (" + toDisplayString(data.children.length) + ") ",
115
+ 1
116
+ /* TEXT */
117
+ )) : createCommentVNode("v-if", true)
118
+ ]),
119
+ _: 1
120
+ /* STABLE */
121
+ }, 8, ["options", "props", "placeholder", "modelValue"]);
122
+ };
123
+ }
124
+ });
125
+
126
+ export { _sfc_main as default };