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({ return request({
url: '/template/save', url: '/template/save',
data: data, data: data,
method: 'post' method: 'post',
loading: true
}) })
} }
export function templateDelete(id) { export function templateDelete(id) {

View File

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

View File

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