|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
<template>
|
|
|
<ElMenu class="menu" mode="horizontal" @select="handleSelect">
|
|
<ElMenu class="menu" mode="horizontal" @select="handleSelect">
|
|
|
- <ElMenuItem class="menu-logo" index="logo" disabled>
|
|
|
|
|
|
|
+ <ElMenuItem class="menu-logo" index="logo">
|
|
|
Devcloud
|
|
Devcloud
|
|
|
</ElMenuItem>
|
|
</ElMenuItem>
|
|
|
<ElSubmenu index="project">
|
|
<ElSubmenu index="project">
|
|
@@ -75,9 +75,10 @@ import { ElMessage } from 'element-plus';
|
|
|
import { useProjectList } from '@/composable/useProject';
|
|
import { useProjectList } from '@/composable/useProject';
|
|
|
import { useUser } from '@/composable/useUser';
|
|
import { useUser } from '@/composable/useUser';
|
|
|
import { defineComponent, ref, reactive } from 'vue';
|
|
import { defineComponent, ref, reactive } from 'vue';
|
|
|
-import { PortalAPI, ProjectAPI } from '@/api';
|
|
|
|
|
|
|
+import { ProjectAPI } from '@/api';
|
|
|
|
|
|
|
|
import { WorkspaceDispatcher } from '@/store/dispatchers';
|
|
import { WorkspaceDispatcher } from '@/store/dispatchers';
|
|
|
|
|
+import { useRouter } from 'vue-router';
|
|
|
|
|
|
|
|
export default defineComponent({
|
|
export default defineComponent({
|
|
|
name: 'Menu',
|
|
name: 'Menu',
|
|
@@ -85,6 +86,8 @@ export default defineComponent({
|
|
|
const { projectList, selectedProject, handleProjectChange } = useProjectList();
|
|
const { projectList, selectedProject, handleProjectChange } = useProjectList();
|
|
|
const { userInfo, userLoggedIn, userLogOut } = useUser();
|
|
const { userInfo, userLoggedIn, userLogOut } = useUser();
|
|
|
|
|
|
|
|
|
|
+ const router = useRouter();
|
|
|
|
|
+
|
|
|
const showProjectDrawer = ref(false);
|
|
const showProjectDrawer = ref(false);
|
|
|
const showInviteDrawer = ref(false);
|
|
const showInviteDrawer = ref(false);
|
|
|
|
|
|
|
@@ -114,20 +117,6 @@ export default defineComponent({
|
|
|
phone: '',
|
|
phone: '',
|
|
|
});
|
|
});
|
|
|
const inviteMember = async () => {
|
|
const inviteMember = async () => {
|
|
|
- let invitedUserId: number;
|
|
|
|
|
-
|
|
|
|
|
- const res = await PortalAPI.getUserIdByPhoneNumber(inviteProjectForm.phone) as unknown as {id: number};
|
|
|
|
|
-
|
|
|
|
|
- if (res) {
|
|
|
|
|
- invitedUserId = res.id;
|
|
|
|
|
- } else {
|
|
|
|
|
- ElMessage({
|
|
|
|
|
- type: 'error',
|
|
|
|
|
- message: '成员不存在,请再次确认手机号',
|
|
|
|
|
- });
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
if (!inviteProjectForm.projectId) {
|
|
if (!inviteProjectForm.projectId) {
|
|
|
ElMessage({
|
|
ElMessage({
|
|
|
type: 'error',
|
|
type: 'error',
|
|
@@ -138,7 +127,7 @@ export default defineComponent({
|
|
|
|
|
|
|
|
await ProjectAPI.addProjectMember({
|
|
await ProjectAPI.addProjectMember({
|
|
|
projectId: inviteProjectForm.projectId,
|
|
projectId: inviteProjectForm.projectId,
|
|
|
- userId: invitedUserId,
|
|
|
|
|
|
|
+ phone: inviteProjectForm.phone,
|
|
|
});
|
|
});
|
|
|
showInviteDrawer.value = false;
|
|
showInviteDrawer.value = false;
|
|
|
if (selectedProject.value.id !== -1) { WorkspaceDispatcher.changeProject(selectedProject.value.id); }
|
|
if (selectedProject.value.id !== -1) { WorkspaceDispatcher.changeProject(selectedProject.value.id); }
|
|
@@ -148,6 +137,7 @@ export default defineComponent({
|
|
|
const [type, id] = index.split('-');
|
|
const [type, id] = index.split('-');
|
|
|
switch (type) {
|
|
switch (type) {
|
|
|
case 'logo': {
|
|
case 'logo': {
|
|
|
|
|
+ router.push('/home');
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
case 'project': {
|
|
case 'project': {
|
|
@@ -171,7 +161,7 @@ export default defineComponent({
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const login = () => {
|
|
const login = () => {
|
|
|
- window.location = `http://${process.env.VUE_APP_PORTAL_HOST}/api/interaction?scope=openid&client_id=seec-seec&redirect_uri=${
|
|
|
|
|
|
|
+ window.location = `http://${process.env.VUE_APP_PORTAL_HOST}/interaction?scope=openid&client_id=seec-seec&redirect_uri=${
|
|
|
encodeURI(`http://${window.location.host}/`)
|
|
encodeURI(`http://${window.location.host}/`)
|
|
|
}` as unknown as Location;
|
|
}` as unknown as Location;
|
|
|
};
|
|
};
|