@7365admin1/layer-common 1.11.44 → 1.11.45
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/CHANGELOG.md +6 -0
- package/components/ClientMain.vue +719 -299
- package/components/DashboardMain.vue +2041 -117
- package/components/DocumentManagement.vue +351 -53
- package/components/InvitationClientForm.vue +23 -10
- package/components/TableV3.vue +179 -0
- package/composables/useOrg.ts +9 -1
- package/composables/useOrganizationSwitcher.ts +11 -0
- package/composables/useUser.ts +36 -30
- package/package.json +1 -1
package/composables/useOrg.ts
CHANGED
|
@@ -171,7 +171,14 @@ export default function useOrg() {
|
|
|
171
171
|
) as TOrg;
|
|
172
172
|
});
|
|
173
173
|
}
|
|
174
|
-
|
|
174
|
+
function getOrgsByEmail(email = "") {
|
|
175
|
+
return useNuxtApp().$api<TOrg[]>(
|
|
176
|
+
`/api/organizations/orgs/${email}`,
|
|
177
|
+
{
|
|
178
|
+
method: "GET",
|
|
179
|
+
}
|
|
180
|
+
);
|
|
181
|
+
}
|
|
175
182
|
|
|
176
183
|
return {
|
|
177
184
|
org,
|
|
@@ -189,5 +196,6 @@ export default function useOrg() {
|
|
|
189
196
|
add,
|
|
190
197
|
addOnboardingOrg,
|
|
191
198
|
updateOrg,
|
|
199
|
+
getOrgsByEmail
|
|
192
200
|
};
|
|
193
201
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export default function useOrganizationSwitcher() {
|
|
2
|
+
const selectedOrg = useState<any | null>('selected-org', () => null)
|
|
3
|
+
const selectedApp = useState<string>('selected-app', () => '')
|
|
4
|
+
|
|
5
|
+
function setOrganization({ org, app }: { org: any; app: string }) {
|
|
6
|
+
selectedOrg.value = org
|
|
7
|
+
selectedApp.value = app || org?.nature || ''
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
return { selectedOrg, selectedApp, setOrganization }
|
|
11
|
+
}
|
package/composables/useUser.ts
CHANGED
|
@@ -14,36 +14,36 @@ export default function useUser() {
|
|
|
14
14
|
});
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
function inviteUserClient({
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}: {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
} = {}) {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
17
|
+
function inviteUserClient({
|
|
18
|
+
email = '',
|
|
19
|
+
app = [],
|
|
20
|
+
role = '',
|
|
21
|
+
name = '',
|
|
22
|
+
org = '',
|
|
23
|
+
site = '',
|
|
24
|
+
siteName = ''
|
|
25
|
+
}: {
|
|
26
|
+
email?: string
|
|
27
|
+
app?: string[]
|
|
28
|
+
role?: string
|
|
29
|
+
name?: string
|
|
30
|
+
org?: string
|
|
31
|
+
site?: string
|
|
32
|
+
siteName?: string
|
|
33
|
+
} = {}) {
|
|
34
|
+
return useNuxtApp().$api<Record<string, any>>('/api/auth/invite/user', {
|
|
35
|
+
method: 'POST',
|
|
36
|
+
body: {
|
|
37
|
+
email,
|
|
38
|
+
app,
|
|
39
|
+
role,
|
|
40
|
+
name,
|
|
41
|
+
org,
|
|
42
|
+
...(site && { siteId: site }),
|
|
43
|
+
...(siteName && { siteName })
|
|
44
|
+
}
|
|
45
|
+
})
|
|
46
|
+
}
|
|
47
47
|
|
|
48
48
|
function inviteMemberClient({
|
|
49
49
|
email = "",
|
|
@@ -168,6 +168,11 @@ function inviteUserClient({
|
|
|
168
168
|
method: "GET"
|
|
169
169
|
});
|
|
170
170
|
}
|
|
171
|
+
function getUserByEmailV2(email = "") {
|
|
172
|
+
return useNuxtApp().$api<Record<string, any>>(`/api/users/user/${email}`, {
|
|
173
|
+
method: "GET"
|
|
174
|
+
});
|
|
175
|
+
}
|
|
171
176
|
|
|
172
177
|
return {
|
|
173
178
|
inviteUser,
|
|
@@ -183,6 +188,7 @@ function inviteUserClient({
|
|
|
183
188
|
getById,
|
|
184
189
|
createUserByVerification,
|
|
185
190
|
getUserByEmail,
|
|
191
|
+
getUserByEmailV2,
|
|
186
192
|
inviteUserClient,
|
|
187
193
|
inviteMemberClient
|
|
188
194
|
};
|