修改bug

This commit is contained in:
2025-08-25 20:01:33 +08:00
parent 874c04e497
commit 91b7f38f8c
9 changed files with 765 additions and 416 deletions

View File

@ -42,6 +42,9 @@
<el-button type="warning" plain icon="Upload">导入</el-button>
</file-upload>
</el-col>
<el-col :span="1.5">
<el-button type="success" plain icon="Download" @click="exportFile">导出模版</el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
</template>
@ -607,6 +610,24 @@ const getVolumeFileList = async (type) => {
fileList.value = res.rows;
}
};
const exportFile = () => {
// 导出模版文件
try {
// 创建a标签
const link = document.createElement('a');
// 设置PDF文件路径 - 相对于public目录
link.href = '/catalog.xlsx';
// 设置下载后的文件名
link.download = '设计出图计划导入模版.xlsx';
// 触发点击
document.body.appendChild(link);
link.click();
// 清理
document.body.removeChild(link);
} catch (error) {
alert('下载失败,请重试');
}
};
// 切换
const handleClick = (val) => {
getVolumeFileList(val.props.name);