47 1 週間 前
コミット
81000738fe

+ 14 - 5
src/views/system/studentSelectSupervisorRecord/record.vue

@@ -199,6 +199,7 @@
 
 <script setup lang="ts">
 import { ref } from 'vue'
+import axios from 'axios';
 import { dateFormatter } from '@/utils/formatTime'
 import download from '@/utils/download'
 import { supervisorSelectionSettingApi, supervisorSelectionSettingVO } from '@/api/system/supervisorSelectionSetting'
@@ -287,7 +288,7 @@ const onRowSelectChange = (selected) => {
   selectedRows.value = selected; // 直接将选中的行数组赋值给 selectedRows
   // console.log('选中的行:', selectedRows.value);
 }
-// 处理选择变化的事件
+
 watch(selectedRows, (newSelection) => {
   console.log('选中的行数据:', newSelection);
 });
@@ -306,10 +307,18 @@ const ibj = ref({
     }
   ]
 });
-const tempDocxPath = ref('/templates/template.docx');
-const exportWordTemplate = () => {
-  const fileName = '导出文档.docx'; // 导出文件的名称
-  exportDocx(tempDocxPath.value, ibj.value, fileName);
+const exportWordTemplate = async () => {
+  const fileName = '导出文档.docx';
+  try {
+    const response = await axios.get('/templates/templete.docx', {
+      responseType: 'blob' // 确保以 blob 形式获取文件
+    });
+    
+    // 使用你之前的 exportDocx 方法处理文件
+    exportDocx(URL.createObjectURL(response.data), ibj.value, fileName);
+  } catch (error) {
+    console.error('导出文档失败:', error);
+  }
 };
 // const exportWordTemplate = async () => {
 //   if (selectedRows.value.length === 0) {

+ 1 - 1
src/views/system/studentSelf/SForm.vue

@@ -41,7 +41,7 @@
       </el-row>
       <el-row>
         <el-col :span="12">
-          <el-form-item label="用户类型" prop="major">
+          <el-form-item label="专业" prop="major">
             <el-select v-model="formData.major" placeholder="请选择专业">
              <el-option
                 v-for="option in majors"