@fmdeui/fmui 1.0.75 → 1.0.77

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,116 @@
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
+ change: (...args: any[]) => void;
54
+ "update:modelValue": (value: any) => void;
55
+ }, string, PublicProps, Readonly< ExtractPropTypes<{
56
+ orgData: {
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
+ cascaderProps: {
74
+ type: ObjectConstructor;
75
+ default: () => {
76
+ emitPath: boolean;
77
+ value: string;
78
+ label: string;
79
+ expandTrigger: string;
80
+ };
81
+ };
82
+ placeholder: {
83
+ type: StringConstructor;
84
+ default: string;
85
+ };
86
+ vId: {
87
+ type: StringConstructor;
88
+ default: string;
89
+ };
90
+ vCmpId: {
91
+ type: StringConstructor;
92
+ default: string;
93
+ };
94
+ vDetId: {
95
+ type: StringConstructor;
96
+ default: string;
97
+ };
98
+ vGroupId: {
99
+ type: StringConstructor;
100
+ default: string;
101
+ };
102
+ modelValue: {
103
+ type: PropType<any>;
104
+ };
105
+ }>> & Readonly<{
106
+ onChange?: ((...args: any[]) => any) | undefined;
107
+ "onUpdate:modelValue"?: ((value: any) => any) | undefined;
108
+ }>, {
109
+ placeholder: string;
110
+ orgData: any[];
111
+ cascaderProps: Record<string, any>;
112
+ vId: string;
113
+ vCmpId: string;
114
+ vDetId: string;
115
+ vGroupId: string;
116
+ }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
@@ -0,0 +1,117 @@
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
+ change: (...args: any[]) => void;
54
+ "update:modelValue": (value: any) => void;
55
+ }, string, PublicProps, Readonly< ExtractPropTypes<{
56
+ orgData: {
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
+ cascaderProps: {
74
+ type: ObjectConstructor;
75
+ default: () => {
76
+ emitPath: boolean;
77
+ value: string;
78
+ label: string;
79
+ expandTrigger: string;
80
+ };
81
+ };
82
+ placeholder: {
83
+ type: StringConstructor;
84
+ default: string;
85
+ };
86
+ vId: {
87
+ type: StringConstructor;
88
+ default: string;
89
+ };
90
+ vCmpId: {
91
+ type: StringConstructor;
92
+ default: string;
93
+ };
94
+ vDetId: {
95
+ type: StringConstructor;
96
+ default: string;
97
+ };
98
+ vGroupId: {
99
+ type: StringConstructor;
100
+ default: string;
101
+ };
102
+ modelValue: {
103
+ type: PropType<any>;
104
+ };
105
+ }>> & Readonly<{
106
+ onChange?: ((...args: any[]) => any) | undefined;
107
+ "onUpdate:modelValue"?: ((value: any) => any) | undefined;
108
+ }>, {
109
+ placeholder: string;
110
+ orgData: any[];
111
+ cascaderProps: Record<string, any>;
112
+ vId: string;
113
+ vCmpId: string;
114
+ vDetId: string;
115
+ vGroupId: string;
116
+ }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
117
+ export default _default;
@@ -67,6 +67,21 @@ export declare const orgId: () => number;
67
67
  * @returns 获取组织名称
68
68
  */
69
69
  export declare const orgName: () => string;
70
+ /**
71
+ * 公司id
72
+ * @returns 公司id
73
+ */
74
+ export declare const cmpId: () => number;
75
+ /**
76
+ * 部门id
77
+ * @returns 部门id
78
+ */
79
+ export declare const depId: () => number;
80
+ /**
81
+ * 组id
82
+ * @returns 组id
83
+ */
84
+ export declare const groupId: () => number;
70
85
  /**
71
86
  * 获取职位id
72
87
  * @returns 获取职位id.
package/es/index.mjs CHANGED
@@ -20,6 +20,7 @@ export { auth, authAll, auths, hAuth, hAuthAll, hAuths } from './packages/hooks/
20
20
  export { base64ToFile, blobToFile, dataURLtoBlob, fileToBase64, urlToBase64 } from './packages/utils/base64Conver.mjs';
21
21
  export { buildLocaleContext, buildTranslator, translate, useLocale } from './packages/hooks/useLocale.mjs';
22
22
  export { clone, isObjectValueEqual, judgementSameArr, removeDuplicate } from './packages/utils/arrayOperation.mjs';
23
+ export { cmpId, depId, groupId, hasPrivilege, hasRoleCode, isAdmin, isMember, isNormalUser, isSupperAdmin, isTenantAdmin, orgId, orgName, posId, posName, roles, tenantId, userAccount, userEmail, userFriendName, userId, userName, userPhone } from './packages/hooks/useInfo.mjs';
23
24
  export { destroyIdleTimeout, initIdleTimeout, updateIdleTimeout } from './packages/hooks/idleTimeout.mjs';
24
25
  export { downloadByBase64, downloadByData, downloadByOnlineUrl, downloadByUrl, downloadStreamFile, getFileName, openWindow } from './packages/utils/download.mjs';
25
26
  export { default as en } from './packages/locale/lang/en.mjs';
@@ -31,7 +32,6 @@ export { gcj02ToBd09, wgs84ToBd09, wgs84ToGcj02 } from './packages/utils/gpsConv
31
32
  export { getFileUrl, showFileUrl } from './packages/utils/uploadfileurl.mjs';
32
33
  export { getlimit } from './packages/hooks/limitsFunction.mjs';
33
34
  export { getpower, powerAuthDel } from './packages/hooks/powerFunction.mjs';
34
- export { hasPrivilege, hasRoleCode, isAdmin, isMember, isNormalUser, isSupperAdmin, isTenantAdmin, orgId, orgName, posId, posName, roles, tenantId, userAccount, userEmail, userFriendName, userId, userName, userPhone } from './packages/hooks/useInfo.mjs';
35
35
  export { judgementIdCard, verifiyNumberInteger, verifyAccount, verifyAndSpace, verifyCarNum, verifyCnAndSpace, verifyEmail, verifyEnAndSpace, verifyFullName, verifyIPAddress, verifyIdCard, verifyNumberCnUppercase, verifyNumberComma, verifyNumberIntegerAndFloat, verifyNumberPercentage, verifyNumberPercentageFloat, verifyPassword, verifyPasswordPowerful, verifyPasswordStrength, verifyPhone, verifyPostalCode, verifyTelPhone, verifyTextColor, verifyUrl } from './packages/utils/toolsValidate.mjs';
36
36
  export { loadSysInfo, updateFavicon } from './packages/hooks/sysInfo.mjs';
37
37
  export { default as pinia } from './packages/stores/inpinia.mjs';
@@ -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,128 @@
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: /* @__PURE__ */ mergeModels(["change"], ["update:modelValue"]),
43
+ setup(__props, { emit: __emit }) {
44
+ const modeValue = useModel(__props, "modelValue");
45
+ const emit = __emit;
46
+ const props = __props;
47
+ const handelchangeOrg = (val) => {
48
+ modeValue.value[props.vId] = val;
49
+ const node = findNode(val);
50
+ if (node) {
51
+ if (node.pid == 0) {
52
+ if (Object.prototype.hasOwnProperty.call(modeValue.value, props.vCmpId))
53
+ modeValue.value[props.vCmpId] = node.id;
54
+ if (Object.prototype.hasOwnProperty.call(modeValue.value, props.vDetId))
55
+ modeValue.value[props.vDetId] = 0;
56
+ if (Object.prototype.hasOwnProperty.call(modeValue.value, props.vGroupId))
57
+ modeValue.value[props.vGroupId] = 0;
58
+ } else if (node.level == 2) {
59
+ if (Object.prototype.hasOwnProperty.call(modeValue.value, props.vDetId))
60
+ modeValue.value[props.vDetId] = node.id;
61
+ if (Object.prototype.hasOwnProperty.call(modeValue.value, props.vCmpId))
62
+ modeValue.value[props.vCmpId] = node.pid;
63
+ if (Object.prototype.hasOwnProperty.call(modeValue.value, props.vGroupId))
64
+ modeValue.value[props.vGroupId] = 0;
65
+ } else if (node.level == 3) {
66
+ if (Object.prototype.hasOwnProperty.call(modeValue.value, props.vGroupId))
67
+ modeValue.value[props.vGroupId] = node.id;
68
+ if (Object.prototype.hasOwnProperty.call(modeValue.value, props.vDetId))
69
+ modeValue.value[props.vDetId] = node.pid;
70
+ let top = findNode(node.pid);
71
+ if (top) {
72
+ if (Object.prototype.hasOwnProperty.call(modeValue.value, props.vCmpId))
73
+ modeValue.value[props.vCmpId] = top.id;
74
+ }
75
+ }
76
+ }
77
+ emit("change", node);
78
+ };
79
+ const findNode = (id) => {
80
+ const search = (nodes) => {
81
+ var _a;
82
+ for (const node of nodes) {
83
+ if (node.id === id) return node;
84
+ if ((_a = node.children) == null ? void 0 : _a.length) {
85
+ const found = search(node.children);
86
+ if (found) return found;
87
+ }
88
+ }
89
+ return null;
90
+ };
91
+ return search(props.orgData || []);
92
+ };
93
+ return (_ctx, _cache) => {
94
+ const _component_el_cascader = resolveComponent("el-cascader");
95
+ return openBlock(), createBlock(_component_el_cascader, {
96
+ options: props.orgData,
97
+ props: __props.cascaderProps,
98
+ placeholder: __props.placeholder,
99
+ filterable: "",
100
+ class: "w100",
101
+ modelValue: modeValue.value[__props.vId],
102
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => modeValue.value[__props.vId] = $event),
103
+ onChange: handelchangeOrg
104
+ }, {
105
+ default: withCtx(({ node, data }) => [
106
+ createElementVNode(
107
+ "span",
108
+ null,
109
+ toDisplayString(node.label),
110
+ 1
111
+ /* TEXT */
112
+ ),
113
+ !node.isLeaf ? (openBlock(), createElementBlock(
114
+ "span",
115
+ _hoisted_1,
116
+ " (" + toDisplayString(data.children.length) + ") ",
117
+ 1
118
+ /* TEXT */
119
+ )) : createCommentVNode("v-if", true)
120
+ ]),
121
+ _: 1
122
+ /* STABLE */
123
+ }, 8, ["options", "props", "placeholder", "modelValue"]);
124
+ };
125
+ }
126
+ });
127
+
128
+ export { _sfc_main as default };
@@ -3,7 +3,7 @@ export { auth, authAll, auths, hAuth, hAuthAll, hAuths } from './authFunction.mj
3
3
  export { getpower, powerAuthDel } from './powerFunction.mjs';
4
4
  export { useVxeTable } from './useVxeTableOptionsHook.mjs';
5
5
  export { loadSysInfo, updateFavicon } from './sysInfo.mjs';
6
- export { hasPrivilege, hasRoleCode, isAdmin, isMember, isNormalUser, isSupperAdmin, isTenantAdmin, orgId, orgName, posId, posName, roles, tenantId, userAccount, userEmail, userFriendName, userId, userName, userPhone } from './useInfo.mjs';
6
+ export { cmpId, depId, groupId, hasPrivilege, hasRoleCode, isAdmin, isMember, isNormalUser, isSupperAdmin, isTenantAdmin, orgId, orgName, posId, posName, roles, tenantId, userAccount, userEmail, userFriendName, userId, userName, userPhone } from './useInfo.mjs';
7
7
  export { useDateTimeShortCust } from './dateTimeShortCust.mjs';
8
8
  export { destroyIdleTimeout, initIdleTimeout, updateIdleTimeout } from './idleTimeout.mjs';
9
9
  export { provideFormEvents, useFormEvents } from './composables/useDialogEvents.mjs';
@@ -59,6 +59,18 @@ const orgName = () => {
59
59
  var _a;
60
60
  return (_a = _getUserInfo()) == null ? void 0 : _a.orgName;
61
61
  };
62
+ const cmpId = () => {
63
+ var _a;
64
+ return (_a = _getUserInfo()) == null ? void 0 : _a.cmpId;
65
+ };
66
+ const depId = () => {
67
+ var _a;
68
+ return (_a = _getUserInfo()) == null ? void 0 : _a.depId;
69
+ };
70
+ const groupId = () => {
71
+ var _a;
72
+ return (_a = _getUserInfo()) == null ? void 0 : _a.groupId;
73
+ };
62
74
  const posId = () => {
63
75
  var _a;
64
76
  return (_a = _getUserInfo()) == null ? void 0 : _a.posId;
@@ -80,4 +92,4 @@ const hasPrivilege = (privilege) => {
80
92
  return (_a = _getUserInfo()) == null ? void 0 : _a.authApiList.includes(privilege);
81
93
  };
82
94
 
83
- export { hasPrivilege, hasRoleCode, isAdmin, isMember, isNormalUser, isSupperAdmin, isTenantAdmin, orgId, orgName, posId, posName, roles, tenantId, userAccount, userEmail, userFriendName, userId, userName, userPhone };
95
+ export { cmpId, depId, groupId, hasPrivilege, hasRoleCode, isAdmin, isMember, isNormalUser, isSupperAdmin, isTenantAdmin, orgId, orgName, posId, posName, roles, tenantId, userAccount, userEmail, userFriendName, userId, userName, userPhone };