Merge branch 'material-ui' of http://14.103.246.124:16000/bonus/bonus-ui into material-ui

This commit is contained in:
hongchao 2025-09-08 18:03:31 +08:00
commit 05be348f58
1 changed files with 37 additions and 8 deletions

View File

@ -204,14 +204,11 @@
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
<div class="el-upload__tip text-center" slot="tip">
<span>仅允许导入xlsxlsx格式文件</span>
<a
:href="uploadUrlTemp"
download="机具检验标识信息导入模板"
class="text-button primary-lease"
style="color: #409eff; text-decoration: none; font-size: 14px;"
>
模板下载
</a>
<span class="download-template-link" @click="downloadTemplate">
<i class="el-icon-download" v-if="!downloadLoading"></i>
<i class="el-icon-loading" v-else style="color: #1890FF"></i>
{{ downloadLoading ? '下载中...' : '下载模板' }}
</span>
</div>
</el-upload>
<div slot="footer" class="dialog-footer">
@ -262,6 +259,8 @@ export default {
sex: undefined,
teamId: undefined
},
//
downloadLoading: false,
uploadUrlTemp:null,
//
upload: {
@ -561,6 +560,20 @@ export default {
this.deviceModelOptions = [];
this.resetForm("form");
},
/** 下载模板方法 */
async downloadTemplate() {
this.downloadLoading = true;
try {
// 使
await this.download("/material/wsMaInfo/downLoad", {}, "机具检验标识信息导入模板.xlsx");
this.$message.success("模板下载成功");
} catch (error) {
console.error("模板下载失败:", error);
this.$message.error("模板下载失败,请稍后重试");
} finally {
this.downloadLoading = false;
}
},
//
handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true;
@ -581,6 +594,22 @@ export default {
}
</script>
<style lang="scss" scoped>
.download-template-link {
color: #409EFF;
cursor: pointer;
margin-left: 10px;
display: inline-flex;
align-items: center;
&:hover {
color: #66b1ff;
text-decoration: underline;
}
i {
margin-right: 4px;
}
}
.app-container {
padding: 20px;
}