| | |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="模板文件:" prop="filePath"> |
| | | <el-upload accept=".doc,.docx" :action="state.uploadUrl" :headers="state.header" method="post" :on-success="(res, uploadFile)=>handleAvatarSuccess(res, uploadFile)" :on-exceed="showTip" :limit='state.fileLimit' v-model:file-list="state.fileList" :before-upload="picSize" :on-remove="(file, uploadFiles)=>handleRemove(file, uploadFiles)" > |
| | | <el-upload accept=".doc,.docx,.pdf,.xlsx" :action="state.uploadUrl" :headers="state.header" method="post" :on-success="(res, uploadFile)=>handleAvatarSuccess(res, uploadFile)" :on-exceed="showTip" :limit='state.fileLimit' v-model:file-list="state.fileList" :before-upload="picSize" :on-remove="(file, uploadFiles)=>handleRemove(file, uploadFiles)" > |
| | | <el-button type="primary">点击上传</el-button> |
| | | <template #tip> |
| | | <div class="el-upload__tip">支持上传.doc、.docx格式文档,尺寸小于30M,最多可上传1份</div> |
| | | <div class="el-upload__tip">支持上传.doc、.docx、.pdf、.xlsx格式文档,尺寸小于30M,最多可上传1份</div> |
| | | </template> |
| | | </el-upload> |
| | | </el-form-item> |
| | |
| | | }) |
| | | const openFile = async(path)=>{ |
| | | const ext = path.split('.').pop().toLowerCase(); |
| | | if (ext === 'doc') { |
| | | ElMessageBox.confirm('暂不支持线上预览.doc文件,是否下载查看?', '提示', { confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning' }).then(() => { |
| | | if (ext === 'doc' || ext === 'xlsx') { |
| | | ElMessageBox.confirm('暂不支持线上预览.doc、.xlsx文件,是否下载查看?', '提示', { confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning' }).then(() => { |
| | | window.open(`${import.meta.env.VITE_APP_BASE_API}/${path}`, '_blank'); |
| | | }).catch(() => { |
| | | console.log('取消预览') |