| | |
| | | </el-table-column> |
| | | <el-table-column label="操作" align="center" class-name="small-padding fixed-width" v-if="userTpye == 0 || userTpye == 6"> |
| | | <template #default="scope"> |
| | | <el-button v-if="scope.row.filePath" link type="primary" @click="downloadFile(scope.row)" >下载</el-button> |
| | | <el-button link type="primary" @click="openDialog('edit',scope.row)">编辑</el-button> |
| | | <el-button link type="danger" @click="handleDelete(scope.row)">删除</el-button> |
| | | </template> |
| | |
| | | import {renderAsync} from "docx-preview"; |
| | | import {get} from "@vueuse/core"; |
| | | import {delReview, getReviewPage} from "@/api/selfProblems/projectReview"; |
| | | import axios from "axios"; |
| | | import {getToken} from "@/utils/auth"; |
| | | const userStore = useUserStore() |
| | | const { proxy } = getCurrentInstance(); |
| | | const loading = ref(false); |
| | |
| | | } |
| | | |
| | | } |
| | | const downloadFile = (e)=>{ |
| | | axios.get(import.meta.env.VITE_APP_BASE_API + '/' +e.filePath,{headers:{'Content-Type': 'application/json','Authorization': `${getToken()}`},responseType: 'blob'}).then(res=>{ |
| | | if (res) { |
| | | const link = document.createElement('a') |
| | | let blob = new Blob([res.data],{type: res.data.type}) |
| | | link.style.display = "none"; |
| | | link.href = URL.createObjectURL(blob); // 创建URL |
| | | link.setAttribute("download", e.fileName); |
| | | document.body.appendChild(link); |
| | | link.click(); |
| | | document.body.removeChild(link); |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '文件读取失败' |
| | | }); |
| | | } |
| | | }) |
| | | } |
| | | const changeCom = () => { |
| | | getProjectList() |
| | | } |