Browse Source

feat: [模板管理] 导入页面增加下载模板标题参数

lkf
memorylkf 1 month ago
parent
commit
72a4d57a4a
1 changed files with 14 additions and 0 deletions
  1. +14
    -0
      src/views/business/comps/template/dialog/ImportExcelDialog.vue

+ 14
- 0
src/views/business/comps/template/dialog/ImportExcelDialog.vue View File

@ -3,6 +3,9 @@
<!-- 导入excel模板 --> <!-- 导入excel模板 -->
<el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :title="title" :visible.sync="open" <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :title="title" :visible.sync="open"
width="400px" @close="close" append-to-body> width="400px" @close="close" append-to-body>
<el-button style="margin-bottom:10px" v-if="downloadArr && downloadArr.length>0" type="primary" @click="downloadExcelTemplate">{{$t('template.common.downloadTemplate') }}</el-button>
<el-upload ref="upload" :limit="1" accept=".xlsx, .xls" :disabled="upload.isUploading" action="" <el-upload ref="upload" :limit="1" accept=".xlsx, .xls" :disabled="upload.isUploading" action=""
:on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :auto-upload="false" drag> :on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :auto-upload="false" drag>
<i class="el-icon-upload"></i> <i class="el-icon-upload"></i>
@ -24,6 +27,14 @@ import * as XLSX from 'xlsx'
export default { export default {
name: "ImportEccelDialog", name: "ImportEccelDialog",
components: {}, components: {},
props:{
downloadArr:{
type:Array,
default(){
return []
}
}
},
data() { data() {
return { return {
title: this.$t('form.modify'), title: this.$t('form.modify'),
@ -91,6 +102,9 @@ export default {
reader.readAsArrayBuffer(file[0].raw); reader.readAsArrayBuffer(file[0].raw);
}, },
downloadExcelTemplate() {
this.$emit('downloadExcelTemplate',this.downloadArr)
},
} }
} }

Loading…
Cancel
Save