|
@@ -12,47 +12,63 @@
|
|
|
<el-row>
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="姓名" prop="nickname" >
|
|
|
- <el-input v-model="formData.nickname" placeholder="自动链接" :disabled="isStudent" />
|
|
|
+ <el-input v-model="formData.nickname" placeholder="自动链接" :disabled="!isSupervisor" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="职称" prop="title">
|
|
|
- <el-input v-model="formData.title" placeholder="" :disabled="isStudent"/>
|
|
|
+ <el-input v-model="formData.title" placeholder="" :disabled="!isSupervisor"/>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<el-row>
|
|
|
<el-col :span="24" >
|
|
|
<el-form-item label="外聘导师工作单位" prop="externalSupervisorWorkPlace">
|
|
|
- <el-input v-model="formData.externalSupervisorWorkPlace" placeholder="填写区" :disabled="isStudent"/>
|
|
|
+ <el-input v-model="formData.externalSupervisorWorkPlace" placeholder="填写区" :disabled="!isSupervisor"/>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<el-row >
|
|
|
<el-col :span="24">
|
|
|
<el-form-item label="合作的校内导师" prop="supervisor">
|
|
|
- <el-input v-model="formData.supervisor" placeholder="自动链接" :disabled="isStudent"/>
|
|
|
+ <el-input v-model="formData.supervisor" placeholder="自动链接" :disabled="!isSupervisor"/>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<el-row >
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="研究方向" prop="major">
|
|
|
- <el-input v-model="formData.major" placeholder="" :disabled="isStudent" />
|
|
|
+ <el-input v-model="formData.major" placeholder="" :disabled="!isSupervisor" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<el-row >
|
|
|
- <el-col :span="24">
|
|
|
+<!-- 导师上传-->
|
|
|
+ <el-col :span="24" v-if="userInfo.userType==='3'&&formType==='update'">
|
|
|
<el-form-item label="个人简历上传(PDF)" prop="introduction">
|
|
|
<upload-file v-model="formData.introduction" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
+ <!-- 学院和学生下载-->
|
|
|
+ <el-col :span="24" v-if="userInfo.userType==='4'||userInfo.userType==='1'&&formType==='detail'">
|
|
|
+ <el-form-item label="导师简历下载(PDF)" prop="introduction">
|
|
|
+ <el-button
|
|
|
+ v-if="formData.introduction"
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-download"
|
|
|
+ @click="handleDownload"
|
|
|
+ class="custom-download-button"
|
|
|
+ >
|
|
|
+ 下载导师简历
|
|
|
+ </el-button>
|
|
|
+ <span v-else>暂无文件</span>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
</el-row>
|
|
|
<el-row >
|
|
|
<el-col :span="24">
|
|
|
<el-form-item label="对研究生毕业时学术成果的要求" prop="studentAchievementRequirement">
|
|
|
- <el-input type="textarea" v-model="formData.studentAchievementRequirement" placeholder="未填写时,默认为按学校及学院发表学术成果的要求执行" :disabled="isStudent" />
|
|
|
+ <el-input type="textarea" v-model="formData.studentAchievementRequirement" placeholder="未填写时,默认为按学校及学院发表学术成果的要求执行" :disabled="!isSupervisor" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
@@ -71,13 +87,12 @@ import * as UserApi from '@/api/system/user'
|
|
|
import { FormRules } from 'element-plus'
|
|
|
import { getUserProfile, ProfileVO } from '@/api/system/user/profile'
|
|
|
import {selectionBookVO,selectionBookApi} from '@/api/system/studentSelectSupervisorRecord/selectionBook'
|
|
|
+import download from '@/utils/download'
|
|
|
|
|
|
defineOptions({ name: 'teacherRequireForm' })
|
|
|
|
|
|
const { t } = useI18n() // 国际化
|
|
|
const message = useMessage() // 消息弹窗
|
|
|
-const userTypeSt = ref('1')
|
|
|
-const userTypeT = ref('3')
|
|
|
|
|
|
const dialogVisible = ref(false) // 弹窗的是否展示
|
|
|
const dialogTitle = ref('') // 弹窗的标题
|
|
@@ -107,7 +122,7 @@ const getUserInfo = async () => {
|
|
|
const users = await getUserProfile()
|
|
|
userInfo.value = users
|
|
|
}
|
|
|
-const isStudent = computed(() => userInfo.value.userType === "1");
|
|
|
+// const isStudent = computed(() => userInfo.value.userType === "1");
|
|
|
|
|
|
const open = async (type:string,supervisorId: number) => {
|
|
|
dialogVisible.value = true
|
|
@@ -123,6 +138,7 @@ const isStudent = computed(() => userInfo.value.userType === "1");
|
|
|
...user,
|
|
|
supervisorId: supervisorId, // 确保 supervisorId 也被设置
|
|
|
}
|
|
|
+ console.log(formData.value)
|
|
|
} finally {
|
|
|
formLoading.value = false
|
|
|
}
|
|
@@ -163,6 +179,16 @@ const submitForm = async () => {
|
|
|
formLoading.value = false
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+const isSupervisor = computed(() => userInfo.value.userType === '3');
|
|
|
+
|
|
|
+//下载PDF
|
|
|
+const handleDownload = () => {
|
|
|
+ console.log(formData.value.introduction)
|
|
|
+ download.markdown(formData.value.introduction, '个人简历.pdf');
|
|
|
+};
|
|
|
+
|
|
|
+
|
|
|
/** 重置表单 */
|
|
|
const resetForm = () => {
|
|
|
formData.value = {
|
|
@@ -193,34 +219,26 @@ onMounted(() => {
|
|
|
border-radius: 8px;
|
|
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* 轻微阴影 */
|
|
|
}
|
|
|
-.custom-form .el-form-item {
|
|
|
- margin-bottom: 20px;
|
|
|
-}
|
|
|
-.custom-form .el-input,
|
|
|
-.custom-form .el-textarea {
|
|
|
- width: 100%;
|
|
|
- border-color: #d9d9d9; /* 输入框边框颜色 */
|
|
|
-}
|
|
|
-.custom-form .el-form-item__label {
|
|
|
- color: #333; /* 标签文字颜色 */
|
|
|
-}
|
|
|
-.custom-form .el-input__inner,
|
|
|
-.custom-form .el-textarea__inner {
|
|
|
- background-color: #fff; /* 输入框背景颜色 */
|
|
|
- color: #333; /* 输入框文字颜色 */
|
|
|
-}
|
|
|
-.custom-form .el-button {
|
|
|
- background-color: #6a1b9a; /* 按钮背景颜色 */
|
|
|
- border-color: #6a1b9a;
|
|
|
- color: #fff; /* 按钮文字颜色 */
|
|
|
+
|
|
|
+.custom-form .custom-download-button {
|
|
|
+ color: #4b7bec; /* 灰蓝色字体颜色 */
|
|
|
+ border: 1px solid #4b7bec; /* 灰蓝色边框 */
|
|
|
+ background-color: transparent; /* 透明背景 */
|
|
|
+ padding: 10px 20px; /* 按钮内边距 */
|
|
|
+ border-radius: 4px; /* 圆角边框 */
|
|
|
+ font-size: 16px; /* 字体大小 */
|
|
|
+ transition: all 0.3s ease; /* 平滑过渡效果 */
|
|
|
+ outline: none; /* 去除点击时的轮廓 */
|
|
|
}
|
|
|
-.custom-form .el-button--primary {
|
|
|
- background-color: #4a148c; /* 主要按钮背景颜色 */
|
|
|
- border-color: #4a148c;
|
|
|
+.custom-form .custom-download-button:hover,
|
|
|
+.custom-form .custom-download-button:focus {
|
|
|
+ color: #fff; /* 悬浮时字体颜色 */
|
|
|
+ background-color: #4b7bec; /* 悬浮时背景颜色 */
|
|
|
+ border-color: #4b7bec; /* 悬浮时边框颜色 */
|
|
|
}
|
|
|
-.custom-form .el-button:hover,
|
|
|
-.custom-form .el-button--primary:hover {
|
|
|
- background-color: #5a0073; /* 按钮悬浮背景颜色 */
|
|
|
- border-color: #5a0073;
|
|
|
+.custom-form .custom-download-button:active {
|
|
|
+ background-color: skyblue; /* 点击时背景颜色 */
|
|
|
+ border-color: #3a66b1; /* 点击时边框颜色 */
|
|
|
}
|
|
|
+
|
|
|
</style>
|