修改bug
This commit is contained in:
@ -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);
|
||||
|
Reference in New Issue
Block a user