refactor(仪表板): 导出应用增加存在模板视图提示
This commit is contained in:
parent
8d474630e5
commit
e6293fe1dc
@ -46,5 +46,4 @@ public class ChartViewDTO extends ChartViewWithBLOBs {
|
||||
private long totalItems;
|
||||
private int datasetMode;
|
||||
private String datasourceType;
|
||||
private Boolean aggregate;
|
||||
}
|
||||
|
||||
@ -85,6 +85,7 @@ export function panelInit(componentData, componentStyle) {
|
||||
}
|
||||
|
||||
export function panelDataPrepare(componentData, componentStyle, callback) {
|
||||
store.commit('initPanelViewDetailsInfo')
|
||||
// style初始化
|
||||
componentStyle.autoSizeAdaptor = (componentStyle.autoSizeAdaptor === undefined ? true : componentStyle.autoSizeAdaptor)
|
||||
componentStyle.refreshTime = (componentStyle.refreshTime || 5)
|
||||
|
||||
@ -2060,6 +2060,7 @@ export default {
|
||||
back_parent: 'Back to previous'
|
||||
},
|
||||
panel: {
|
||||
app_export_tips: 'In the current dashboard, [{0}] belongs to a template view and cannot be exported. Please set up the dataset first!',
|
||||
required_tips: 'Cannot be empty!',
|
||||
filter_no_select: 'Filter components do not need to be selected',
|
||||
first_item: 'First item',
|
||||
|
||||
@ -2052,6 +2052,7 @@ export default {
|
||||
back_parent: '返回上一級'
|
||||
},
|
||||
panel: {
|
||||
app_export_tips: '當前儀表板中[{0}]屬於模板視圖,無法導出,請先設置數據集!',
|
||||
required_tips: '必填項不能爲空!',
|
||||
filter_no_select: '過濾組件無需選擇',
|
||||
first_item: '首項',
|
||||
|
||||
@ -2055,6 +2055,7 @@ export default {
|
||||
back_parent: '返回上一级'
|
||||
},
|
||||
panel: {
|
||||
app_export_tips: '当前仪表板中[{0}]属于模版视图,无法导出,请先设置数据集!',
|
||||
required_tips: '必填项不能为空!',
|
||||
filter_no_select: '过滤组件无需选择',
|
||||
first_item: '首项',
|
||||
|
||||
@ -841,6 +841,9 @@ const data = {
|
||||
customAttr: {}
|
||||
}
|
||||
},
|
||||
initPanelViewDetailsInfo(state) {
|
||||
state.panelViewDetailsInfo = {}
|
||||
},
|
||||
initCanvas(state) {
|
||||
this.commit('initCanvasBase')
|
||||
state.isInEditor = true
|
||||
|
||||
@ -649,14 +649,29 @@ export default {
|
||||
}
|
||||
},
|
||||
downLoadToAppPre() {
|
||||
this.$refs.appExportForm.init({
|
||||
appName: this.$store.state.panel.panelInfo.name,
|
||||
icon: null,
|
||||
version: '1.0',
|
||||
creator: this.$store.getters.user.nickName,
|
||||
required: '1.16.0',
|
||||
description: null
|
||||
const result = this.checkTemplate()
|
||||
if (result && result.length > 0) {
|
||||
this.$message({ message: this.$t('panel.app_export_tips', [result]), type: 'warning', showClose: true })
|
||||
} else {
|
||||
this.$refs.appExportForm.init({
|
||||
appName: this.$store.state.panel.panelInfo.name,
|
||||
icon: null,
|
||||
version: '1.0',
|
||||
creator: this.$store.getters.user.nickName,
|
||||
required: '1.16.0',
|
||||
description: null
|
||||
})
|
||||
}
|
||||
},
|
||||
checkTemplate() {
|
||||
let templateViewNames = ','
|
||||
Object.keys(this.panelViewDetailsInfo).forEach(key => {
|
||||
const viewInfo = JSON.parse(this.panelViewDetailsInfo[key])
|
||||
if (viewInfo.dataFrom === 'template') {
|
||||
templateViewNames = templateViewNames + viewInfo.title + ','
|
||||
}
|
||||
})
|
||||
return templateViewNames.slice(1)
|
||||
},
|
||||
downLoadToApp(appAttachInfo) {
|
||||
this.dataLoading = true
|
||||
|
||||
Loading…
Reference in New Issue
Block a user