Merge pull request #1923 from dataease/pr@dev@feat_panel-flag

fix: 模板导入失败问题
This commit is contained in:
王嘉豪 2022-03-16 21:11:37 +08:00 committed by GitHub
commit c43ccee18c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 2 deletions

View File

@ -4,7 +4,8 @@ export function save(data) {
return request({
url: '/template/save',
data: data,
method: 'post'
method: 'post',
loading: true
})
}
export function templateDelete(id) {

View File

@ -146,13 +146,17 @@ export default {
return false
}
this.editPanel.panelInfo['newFrom'] = this.inputType
this.loading = true
panelSave(this.editPanel.panelInfo).then(response => {
this.$message({
message: this.$t('commons.save_success'),
type: 'success',
showClose: true
})
this.loading = false
this.$emit('closeEditPanelDialog', response.data)
}).catch(() => {
this.loading = false
})
},
handleFileChange(e) {

View File

@ -1,5 +1,5 @@
<template>
<el-row>
<el-row v-loading="$store.getters.loadingMap[$store.getters.currentPath]">
<el-row style="margin-top: 5px">
<el-col :span="4">{{ $t('commons.name') }}</el-col>
<el-col :span="16">
@ -44,6 +44,7 @@ export default {
name: '',
templateStyle: null,
templateData: null,
dynamicData: null,
snapshot: ''
}
}
@ -118,6 +119,7 @@ export default {
this.templateInfo.templateStyle = this.importTemplateInfo.panelStyle
this.templateInfo.templateData = this.importTemplateInfo.panelData
this.templateInfo.snapshot = this.importTemplateInfo.snapshot
this.templateInfo.dynamicData = this.importTemplateInfo.dynamicData
this.templateInfo.nodeType = 'template'
}
reader.readAsText(file)