47 2 weeks ago
parent
commit
b5a12125f0
2 changed files with 22 additions and 19 deletions
  1. 4 2
      src/views/system/userDetail/student.vue
  2. 18 17
      src/views/system/userDetail/teacher.vue

+ 4 - 2
src/views/system/userDetail/student.vue

@@ -6,7 +6,7 @@
       v-loading="formLoading"
       :model="formData"
       :rules="formRules"
-      label-width="85px"
+      label-width="120px"
       class="custom-form"
     >
     <el-row >
@@ -30,7 +30,7 @@
       </el-col>
       <el-col :span="12">
         <el-form-item label="联系电话" prop="mobile">
-          <el-input v-model="formData.mobile" placeholder="" :disabled=isStudent />
+          <el-input v-model="formData.mobile" placeholder="请输入联系电话"/>
         </el-form-item>
       </el-col>
     </el-row>
@@ -80,6 +80,8 @@ const formData = ref({
   introduction:"",//简介PDF
 })
 const formRules = reactive<FormRules>({
+  mobile: [{ required: true, message: '联系电话不能为空', trigger: 'blur' }],
+  introduction: [{ required: true, message: '个人简历不能为空', trigger: 'blur' }],
 })
 const formRef = ref() // 表单 Ref
 const deptList = ref<Tree[]>([]) // 树形结构

+ 18 - 17
src/views/system/userDetail/teacher.vue

@@ -22,12 +22,14 @@
       </el-col>
     </el-row>
     <el-row>
-      <el-col :span="12">
-        <p style="font-weight: bold;">外聘导师</p>
+      <el-col :span="24" >
+        <el-form-item label="外聘导师" style="font-weight: 550;">
+          <p></p>
+        </el-form-item>
       </el-col>
       <el-col :span="24" >
         <el-form-item label="工作单位" prop="externalSupervisorWorkPlace">
-          <el-input v-model="formData.externalSupervisorWorkPlace" placeholder="填写区" :disabled="!isSupervisor"/>
+          <el-input v-model="formData.externalSupervisorWorkPlace" placeholder="请输入工作单位" :disabled="!isSupervisor"/>
         </el-form-item>
       </el-col>
     </el-row>
@@ -39,17 +41,18 @@
       </el-col>
     </el-row>
     <el-row  >
-      <el-col :span="12">
+      <el-col :span="24">
         <el-form-item label="研究方向" prop="major">
-          <el-input v-model="formData.major" placeholder="" :disabled="!isSupervisor" />
+          <el-input v-model="formData.major" placeholder="请输入研究方向" :disabled="!isSupervisor" />
         </el-form-item>
       </el-col>
     </el-row>
       <el-row >
-<!--        导师上传-->
+        <!--        导师上传-->
         <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 label="个人简历上传" prop="introduction">
+            <!-- <upload-file v-model="formData.introduction" /> -->
+            <Editor v-model="formData.introduction" ref="editorRef" class="full-width-editor"/>
           </el-form-item>
         </el-col>
         <!--        学院和学生下载-->
@@ -187,13 +190,8 @@ const isSupervisor = computed(() => userInfo.value.userType === '3');
 
 //下载PDF
 const handleDownload = () => {
-  // const link = document.createElement('a');
-  // link.href = url;
-  // link.setAttribute('download', filename);
-  // document.body.appendChild(link);
-  // link.click();
-  // document.body.removeChild(link);
-  window.open(formData.value.introduction, '_blank');
+  console.log(formData.value.introduction)
+  download.markdown(formData.value.introduction, '个人简历.pdf');
 };
 
 
@@ -227,7 +225,6 @@ onMounted(() => {
   border-radius: 8px;
   box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* 轻微阴影 */
 }
-
 .custom-form .custom-download-button {
   color: #4b7bec; /* 灰蓝色字体颜色 */
   border: 1px solid #4b7bec; /* 灰蓝色边框 */
@@ -248,5 +245,9 @@ onMounted(() => {
   background-color: skyblue; /* 点击时背景颜色 */
   border-color: #3a66b1; /* 点击时边框颜色 */
 }
-
+.full-width-editor {
+  width: 100%;
+  border: #e5e7ec;
+  border-radius: 4px;
+}
 </style>