|
@@ -1,12 +1,5 @@
|
|
|
<template>
|
|
|
- <!-- <el-card class="workspace-info card-border mb-2">
|
|
|
- <div class="workspace-name">
|
|
|
- <div class="card-header">
|
|
|
- <span>{{ form.name }}</span>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </el-card> -->
|
|
|
- <div class="flex" v-loading="loading">
|
|
|
+ <div class="flex" v-loading="loading" v-show="user.value.dept">
|
|
|
<el-card class="workspace-info w-full" shadow="always" style="padding-bottom: 40px;">
|
|
|
<template #header>
|
|
|
<div class="card-header" style="display: flex; align-items: center; justify-content: space-between;">
|
|
@@ -88,7 +81,7 @@
|
|
|
@success="handleSuccess"
|
|
|
/>
|
|
|
</div>
|
|
|
- <div>
|
|
|
+ <div v-show="user.value.dept">
|
|
|
<div style="margin-top: 15px;">
|
|
|
<teacher :id="form.id" />
|
|
|
</div>
|
|
@@ -96,6 +89,9 @@
|
|
|
<student :id="form.id" />
|
|
|
</div>
|
|
|
</div>
|
|
|
+ <div v-show="!user.value.dept">
|
|
|
+ <el-empty description="暂无工作间" />
|
|
|
+ </div>
|
|
|
|
|
|
</template>
|
|
|
|
|
@@ -107,6 +103,7 @@ import { useI18n } from 'vue-i18n';
|
|
|
import { useMessage } from '@/hooks/web/useMessage';
|
|
|
import { updateDept, DeptVO, getUserDept } from '@/api/system/dept/index';
|
|
|
import * as UserApi from '@/api/system/user'
|
|
|
+import { getUserProfile, ProfileVO } from '@/api/system/user/profile';
|
|
|
import DeptForm from './DeptForm.vue';
|
|
|
import student from './student.vue';
|
|
|
import teacher from './teacher.vue';
|
|
@@ -118,6 +115,20 @@ export default defineComponent({
|
|
|
teacher,
|
|
|
},
|
|
|
setup() {
|
|
|
+ const user = ref({ dept: null });
|
|
|
+ // 获取登陆人员的信息
|
|
|
+ const getUser = async () => {
|
|
|
+ try {
|
|
|
+ loading.value = true;
|
|
|
+ const res = await getUserProfile();
|
|
|
+ user.value = res;
|
|
|
+ console.log('获取用户信息成功:', user.value);
|
|
|
+ } catch (error) {
|
|
|
+ console.error('获取用户信息失败:', error);
|
|
|
+ } finally {
|
|
|
+ loading.value = false;
|
|
|
+ }
|
|
|
+ };
|
|
|
const { t } = useI18n();
|
|
|
const message = useMessage();
|
|
|
const loading = ref(true) // 列表的加载中
|
|
@@ -284,6 +295,7 @@ const fetchImageUrls = async () => {
|
|
|
};
|
|
|
|
|
|
onMounted(async () => {
|
|
|
+ await getUser();
|
|
|
await init();
|
|
|
await fetchUserInfo();
|
|
|
// getSupervisor();
|
|
@@ -311,6 +323,15 @@ const fetchImageUrls = async () => {
|
|
|
extractedImageUrls,
|
|
|
|
|
|
};
|
|
|
+ },
|
|
|
+ data(){
|
|
|
+ return {
|
|
|
+ user: {
|
|
|
+ value: {
|
|
|
+ dept: null // 或任何你想要初始化的值
|
|
|
+ }
|
|
|
+ },
|
|
|
+ };
|
|
|
}
|
|
|
});
|
|
|
|