|
@@ -8,42 +8,68 @@
|
|
|
</el-card> -->
|
|
|
<div>
|
|
|
<div class="flex mb-3">
|
|
|
- <el-card class="workspace-info w-1/3">
|
|
|
+ <el-card class="workspace-info w-full" style="padding-bottom: 40px;">
|
|
|
<template #header>
|
|
|
<div class="card-header">
|
|
|
<span>工作间信息</span>
|
|
|
</div>
|
|
|
</template>
|
|
|
<ul class="user-info">
|
|
|
- <li class="info-item">
|
|
|
- <Icon class="mr-5px" icon="ep:user" />
|
|
|
- <span class="info-label">负责人名称:</span>
|
|
|
- <span class="pull-right">{{ userInfo.user?.map(user => user.nickname).join(', ') }}</span>
|
|
|
- </li>
|
|
|
- <li class="info-item">
|
|
|
- <Icon class="mr-5px" icon="fontisto:email" />
|
|
|
- <span class="info-label">邮箱:</span>
|
|
|
- <span class="pull-right">{{ userInfo.email }}</span>
|
|
|
- </li>
|
|
|
- <li class="info-item">
|
|
|
- <Icon class="mr-5px" icon="ep:phone" />
|
|
|
- <span class="info-label">联系电话:</span>
|
|
|
- <span class="pull-right">{{ userInfo.phone }}</span>
|
|
|
- </li>
|
|
|
- <li class="info-item">
|
|
|
- <Icon class="mr-5px" icon="fontisto:email" />
|
|
|
- <span class="info-label">导师人数:</span>
|
|
|
- <span class="pull-right">{{ userInfo.supervisorNum }}</span>
|
|
|
- </li>
|
|
|
- <li class="info-item">
|
|
|
- <Icon class="mr-5px" icon="ep:user" />
|
|
|
- <span class="info-label">学生人数:</span>
|
|
|
- <span class="pull-right">{{ userInfo.studentNum }}</span>
|
|
|
- </li>
|
|
|
+ <div class="info-row">
|
|
|
+ <li class="info-item">
|
|
|
+ <Icon class="mr-5px" icon="ep:user" />
|
|
|
+ <span class="info-label">工作间名称:</span>
|
|
|
+ <span class="pull-right">{{ userInfo.name }}</span>
|
|
|
+ </li>
|
|
|
+ <li class="info-item">
|
|
|
+ <Icon class="mr-5px" icon="ep:phone" />
|
|
|
+ <span class="info-label">联系电话:</span>
|
|
|
+ <span class="pull-right">{{ userInfo.phone }}</span>
|
|
|
+ </li>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="info-row">
|
|
|
+ <li class="info-item">
|
|
|
+ <Icon class="mr-5px" icon="fontisto:email" />
|
|
|
+ <span class="info-label">邮箱:</span>
|
|
|
+ <span class="pull-right">{{ userInfo.email }}</span>
|
|
|
+ </li>
|
|
|
+ <li class="info-item">
|
|
|
+ <Icon class="mr-5px" icon="ep:location" />
|
|
|
+ <span class="info-label">工作间地址:</span>
|
|
|
+ <span class="pull-right">{{ userInfo.address }}</span>
|
|
|
+ </li>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="info-row">
|
|
|
+ <li class="info-item">
|
|
|
+ <Icon class="mr-5px" icon="fontisto:email" />
|
|
|
+ <span class="info-label">导师人数:</span>
|
|
|
+ <span class="pull-right">{{ userInfo.supervisorNum }}</span>
|
|
|
+ </li>
|
|
|
+ <li class="info-item">
|
|
|
+ <Icon class="mr-5px" icon="ep:user" />
|
|
|
+ <span class="info-label">学生人数:</span>
|
|
|
+ <span class="pull-right">{{ userInfo.studentNum }}</span>
|
|
|
+ </li>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- <div>
|
|
|
+ <li class="info-item">
|
|
|
+ <Icon class="mr-5px" icon="ep:user" />
|
|
|
+ <span class="info-label">工作间简介:</span>
|
|
|
+ <span class="pull-right">{{ userInfo.description }}</span>
|
|
|
+ </li>
|
|
|
+ </div> -->
|
|
|
</ul>
|
|
|
+ <div class="info-description">
|
|
|
+ <!-- <Icon class="mr-5px" icon="ep:location" /> -->
|
|
|
+ <div class="div-label" style="margin-left: 20px;">简介:</div>
|
|
|
+ <div class="description-content">{{ cleanedDescription }}</div>
|
|
|
+ </div>
|
|
|
</el-card>
|
|
|
|
|
|
- <el-card class="workspace-info ml-3 w-2/3">
|
|
|
+ <!-- <el-card class="workspace-info ml-3 w-2/3">
|
|
|
<template #header>
|
|
|
<div class="card-header">
|
|
|
<span>{{ userInfo.name }}</span>
|
|
@@ -69,7 +95,7 @@
|
|
|
<el-button type="primary" @click="toggleEditMode">{{ isEditMode ? '保存' : '修改' }}</el-button>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
- </el-card>
|
|
|
+ </el-card> -->
|
|
|
</div>
|
|
|
<div class="flex flex-col">
|
|
|
<el-card class="teacher-info w-full">
|
|
@@ -167,21 +193,22 @@ export default defineComponent({
|
|
|
// name: users.user[0].nickname // 提取 nickname
|
|
|
};
|
|
|
|
|
|
-// //获取工作间下的导师
|
|
|
-// const users = ref()
|
|
|
-// const getDeptsupervisor= async (id) => {
|
|
|
-// try {
|
|
|
-// const response = await UserApi.getDeptsupervisor(id)
|
|
|
-// users.value = response
|
|
|
-// } catch (error) {
|
|
|
-// console.error('Error fetching user data:', error)
|
|
|
-// }
|
|
|
-// }
|
|
|
-
|
|
|
-// //传supervisorId给form.leaderUserId
|
|
|
-// const handleSupervisorChange = (values) => {
|
|
|
-// form.leaderUserId = values; // values 是选择的用户ID数组
|
|
|
-// }
|
|
|
+ //获取工作间下的导师
|
|
|
+ const users = ref()
|
|
|
+ const getDeptsupervisor = async (id) => {
|
|
|
+ try {
|
|
|
+ const response = await UserApi.getDeptsupervisor(id.value)
|
|
|
+ users.value = response
|
|
|
+ console.log('工作间下导师信息:', users.value);
|
|
|
+ } catch (error) {
|
|
|
+ console.error('Error fetching user data:', error)
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //传supervisorId给form.leaderUserId
|
|
|
+ const handleSupervisorChange = (values) => {
|
|
|
+ form.leaderUserId = values; // values 是选择的用户ID数组
|
|
|
+ }
|
|
|
|
|
|
const isEditMode = ref(false);
|
|
|
|
|
@@ -194,6 +221,11 @@ const toggleEditMode = () => {
|
|
|
isEditMode.value = !isEditMode.value;
|
|
|
};
|
|
|
|
|
|
+ // 创建一个 computed 属性来处理并去掉 <p> 标签
|
|
|
+ const cleanedDescription = computed(() => {
|
|
|
+ return userInfo.value.description ? userInfo.value.description.replace(/<\/?p[^>]*>/g, '') : '';
|
|
|
+ });
|
|
|
+
|
|
|
// 表单提交
|
|
|
const submit = async () => {
|
|
|
try {
|
|
@@ -231,7 +263,9 @@ const toggleEditMode = () => {
|
|
|
if (id.value) {
|
|
|
await fetchUserInfo(id.value); // 传入获取到的 ID
|
|
|
}
|
|
|
- // getDeptsupervisor(id);
|
|
|
+ // const response = await UserApi.getDeptsupervisor(id.value)
|
|
|
+ // users.value = response
|
|
|
+ getDeptsupervisor(id);
|
|
|
});
|
|
|
|
|
|
return {
|
|
@@ -244,9 +278,10 @@ const toggleEditMode = () => {
|
|
|
init,
|
|
|
rules,
|
|
|
formRef,
|
|
|
- // users,
|
|
|
- // handleSupervisorChange,
|
|
|
- // getDeptsupervisor,
|
|
|
+ users,
|
|
|
+ handleSupervisorChange,
|
|
|
+ getDeptsupervisor,
|
|
|
+ cleanedDescription
|
|
|
};
|
|
|
}
|
|
|
});
|
|
@@ -270,9 +305,10 @@ const toggleEditMode = () => {
|
|
|
}
|
|
|
|
|
|
.user-info {
|
|
|
+ margin-top: 10px;
|
|
|
+
|
|
|
margin-left: 5%;
|
|
|
margin-right: 5%;
|
|
|
- margin-top: 60px;
|
|
|
padding-right: 0;
|
|
|
padding-left: 0;
|
|
|
border-right: 0;
|
|
@@ -281,15 +317,59 @@ const toggleEditMode = () => {
|
|
|
list-style: none;
|
|
|
}
|
|
|
|
|
|
+.info-row {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between; /* 保持并排显示 */
|
|
|
+ align-items: center; /* 垂直居中对齐 */
|
|
|
+ margin-bottom: 20px; /* 增加行之间的间距 */
|
|
|
+}
|
|
|
+
|
|
|
.info-item {
|
|
|
- margin-bottom: 10px;
|
|
|
- padding: 11px 0;
|
|
|
- margin-bottom: -1px;
|
|
|
- font-size: 13px;
|
|
|
- border-top: 1px solid #e7eaec;
|
|
|
+ flex: 1; /* 每个信息项占据相同的空间 */
|
|
|
+ padding: 11px 0; /* 内部上下填充 */
|
|
|
+ margin-right: 50px; /* 每个信息项之间的右边距 */
|
|
|
+}
|
|
|
+
|
|
|
+/* 仅为每个信息项添加底部边框 */
|
|
|
+.info-item:first-child {
|
|
|
border-bottom: 1px solid #e7eaec;
|
|
|
}
|
|
|
|
|
|
+.info-item:last-child {
|
|
|
+ border-bottom: 1px solid #e7eaec;
|
|
|
+}
|
|
|
+
|
|
|
+.info-description {
|
|
|
+ margin-top: 30px; /* 与上面的信息分隔 */
|
|
|
+ margin-left: 5%; /* 左侧与上面列表保持一致 */
|
|
|
+ margin-right: 5%; /* 右侧与上面列表保持一致 */
|
|
|
+ /* display: flex; */
|
|
|
+ align-items: center; /* 确保标题与描述对齐 */
|
|
|
+ align-items: flex-start;
|
|
|
+}
|
|
|
+
|
|
|
+.info-label {
|
|
|
+ font-weight: bold; /* 加粗标题 */
|
|
|
+ margin-right: 10px; /* 标题与内容之间的间距 */
|
|
|
+}
|
|
|
+
|
|
|
+.div-label {
|
|
|
+ font-weight: bold; /* 加粗标题 */
|
|
|
+ display: block;
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+.description-content {
|
|
|
+ white-space: pre-wrap; /* 保持换行 */
|
|
|
+ overflow-wrap: break-word; /* 自动断行 */
|
|
|
+ margin-right: 5%;
|
|
|
+ font-size: 13px; /* 根据需要设置字体大小 */
|
|
|
+ margin-top: 20px; /* 内容与标题之间不需要额外间距 */
|
|
|
+ letter-spacing: 3px;
|
|
|
+ text-indent: 2em;
|
|
|
+ line-height: 2;
|
|
|
+}
|
|
|
+
|
|
|
.pull-right {
|
|
|
float: right !important;
|
|
|
}
|