feat: 导入时后端校验未通过 也会关闭loading, 更新模板可选是否隐藏

pull/100/head
Raymond38324 2023-06-08 02:34:11 +00:00 committed by Gitee
parent 9e99a9b696
commit 78ee9127a0
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 14 additions and 3 deletions

View File

@ -3,7 +3,7 @@
<el-button size="small" type="success" icon="el-icon-upload" @click="handleImport">
<slot>导入</slot>
</el-button>
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body destroy-on-close>
<div v-loading="loading">
<el-upload
ref="upload"
@ -25,8 +25,11 @@
<div slot="tip" class="el-upload__tip" style="color:red">提示仅允许导入xlsxlsx格式文件</div>
</el-upload>
<div>
<el-button type="warning" style="font-size:14px;margin-top: 20px" @click="importTemplate"></el-button>
<el-button type="warning" style="font-size:14px;margin-top: 20px" @click="updateTemplate"></el-button>
<el-button type="warning" style="font-size:14px;margin-top: 20px" @click="importTemplate">
</el-button>
<el-button type="warning" style="font-size:14px;margin-top: 20px" @click="updateTemplate" v-if="showUpdate">
批量更新模板
</el-button>
</div>
</div>
<div slot="footer" class="dialog-footer">
@ -75,6 +78,12 @@ export default {
default () {
return []
}
},
showUpdate: {
type: Boolean,
default () {
return true
}
}
},
data () {
@ -131,6 +140,8 @@ export default {
that.refreshView()
}
})
}).finally(() => {
that.loading = false
})
},
//