Browse Source

自定义导出loading

shibei_master
13176889840 3 years ago
parent
commit
ec1827be3b
  1. 2
      src/views/components/checkBox.vue
  2. 5
      src/views/modules/base/diyInfo.vue

2
src/views/components/checkBox.vue

@ -35,7 +35,7 @@ export default {
boxList: [], boxList: [],
checkAll: false, checkAll: false,
checkedList: [], checkedList: [],
isIndeterminate: true, isIndeterminate: false,
pid: '', pid: '',
} }
}, },

5
src/views/modules/base/diyInfo.vue

@ -87,7 +87,7 @@
<el-checkbox v-model="form.isSaveTemp">保存为常用模板</el-checkbox> <el-checkbox v-model="form.isSaveTemp">保存为常用模板</el-checkbox>
</div> </div>
</div> </div>
<el-button class="diy-button--delete" @click="handleExport">导出</el-button> <el-button class="diy-button--delete" :loading="exportLoading" @click="handleExport">导出</el-button>
</div> </div>
<el-dialog :visible.sync="diyDialog" <el-dialog :visible.sync="diyDialog"
:close-on-click-modal="false" :close-on-click-modal="false"
@ -146,6 +146,7 @@ export default {
}, },
data() { data() {
return { return {
exportLoading: false,
activeCollapse: ['1'], activeCollapse: ['1'],
activeName: 'first', activeName: 'first',
info: {}, info: {},
@ -272,6 +273,7 @@ export default {
handleExport() { handleExport() {
if (this.rightList.length === 0) return this.$message.error('请选择导出信息') if (this.rightList.length === 0) return this.$message.error('请选择导出信息')
if (this.form.isSaveTemp && !this.form.name) return this.$message.error('请输入模板名称') if (this.form.isSaveTemp && !this.form.name) return this.$message.error('请输入模板名称')
this.exportLoading = true
this.exportTemplate() this.exportTemplate()
}, },
@ -324,6 +326,7 @@ export default {
this.$message.success('导出成功') this.$message.success('导出成功')
this.$emit('close') this.$emit('close')
} else this.$message.error('下载失败') } else this.$message.error('下载失败')
this.exportLoading = false
}) })
.catch(err => { .catch(err => {
console.log('err', err) console.log('err', err)

Loading…
Cancel
Save