forked from github/dataease
fix: 新建仪表板时,来回切换新建仪表板和复用仪表板再保存报错问题
This commit is contained in:
parent
ff6baf8a93
commit
8926ecbebc
@ -35,11 +35,12 @@
|
||||
import { panelSave } from '@/api/panel/panel'
|
||||
import { showTemplateList } from '@/api/system/template'
|
||||
import TemplateAllList from './TemplateAllList'
|
||||
import { deepCopy } from '@/components/canvas/utils/utils'
|
||||
|
||||
export default {
|
||||
components: { TemplateAllList },
|
||||
props: {
|
||||
editPanel: {
|
||||
editPanelOut: {
|
||||
type: Object,
|
||||
required: true
|
||||
}
|
||||
@ -55,7 +56,8 @@ export default {
|
||||
templateList: [],
|
||||
importTemplateInfo: {
|
||||
snapshot: ''
|
||||
}
|
||||
},
|
||||
editPanel: null
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@ -70,14 +72,20 @@ export default {
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
inputType() {
|
||||
this.editPanel.panelInfo.name = null
|
||||
this.editPanel.panelInfo.panelStyle = null
|
||||
this.editPanel.panelInfo.panelData = null
|
||||
this.importTemplateInfo.snapshot = null
|
||||
inputType(newVal) {
|
||||
debugger
|
||||
if (newVal === 'self') {
|
||||
this.editPanel = deepCopy(this.editPanelOut)
|
||||
} else {
|
||||
this.editPanel.panelInfo.name = null
|
||||
this.editPanel.panelInfo.panelStyle = null
|
||||
this.editPanel.panelInfo.panelData = null
|
||||
this.importTemplateInfo.snapshot = null
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.editPanel = deepCopy(this.editPanelOut)
|
||||
// this.getTree()
|
||||
},
|
||||
mounted() {
|
||||
|
@ -164,7 +164,7 @@
|
||||
</el-dialog>
|
||||
<!--新建仪表板dialog-->
|
||||
<el-dialog v-dialogDrag :title="panelDialogTitle" :visible.sync="editPanel.visible" :show-close="true" width="600px">
|
||||
<edit-panel v-if="editPanel.visible" :edit-panel="editPanel" @closeEditPanelDialog="closeEditPanelDialog" @newPanelSave="newPanelSave" />
|
||||
<edit-panel v-if="editPanel.visible" :edit-panel-out="editPanel" @closeEditPanelDialog="closeEditPanelDialog" @newPanelSave="newPanelSave" />
|
||||
</el-dialog>
|
||||
</el-col>
|
||||
</el-col>
|
||||
|
Loading…
Reference in New Issue
Block a user