forked from github/dataease
refactor: 仪表板未发布状态显示优化
This commit is contained in:
parent
d50bbe7904
commit
ff7495d5f2
@ -136,6 +136,10 @@ export default {
|
||||
type: String,
|
||||
required: false,
|
||||
default: 'NotProvided'
|
||||
},
|
||||
panelInfo: {
|
||||
type: Object,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@ -176,15 +180,14 @@ export default {
|
||||
},
|
||||
showUnpublishedArea() {
|
||||
// return this.panelInfo.status === 'unpublished'
|
||||
if (this.mainActiveName === 'PanelMain' && this.activeTab === 'PanelList') {
|
||||
if (this.panelInfo && this.panelInfo.showType === 'view') {
|
||||
return false
|
||||
} else if ((this.mainActiveName === 'PanelMain' && this.activeTab === 'PanelList') || this.showPosition.includes('multiplexing')) {
|
||||
return this.panelInfo.status === 'unpublished' && !hasDataPermission('manage', this.panelInfo.privileges)
|
||||
} else {
|
||||
return this.panelInfo.status === 'unpublished'
|
||||
}
|
||||
},
|
||||
panelInfo() {
|
||||
return this.$store.state.panel.panelInfo
|
||||
},
|
||||
showExportImgButton() {
|
||||
return this.showChartInfo.type && !this.showChartInfo.type.includes('table')
|
||||
},
|
||||
|
@ -5,6 +5,7 @@
|
||||
:component-data="componentData"
|
||||
:canvas-style-data="canvasStyleData"
|
||||
:back-screen-shot="backScreenShot"
|
||||
:panel-info="panelInfo"
|
||||
@mainHeightChange="mainHeightChange"
|
||||
/>
|
||||
</div>
|
||||
@ -36,6 +37,9 @@ export default {
|
||||
return { height: '100vh!important' }
|
||||
}
|
||||
},
|
||||
panelInfo() {
|
||||
return this.$store.state.panel.panelInfo
|
||||
},
|
||||
...mapState([
|
||||
'canvasStyleData',
|
||||
'componentData'
|
||||
|
@ -5,6 +5,7 @@
|
||||
v-if="fullscreen"
|
||||
:component-data="componentData"
|
||||
:canvas-style-data="canvasStyleData"
|
||||
:panel-info="panelInfo"
|
||||
:in-screen="!fullscreen"
|
||||
/>
|
||||
</fullscreen>
|
||||
@ -20,6 +21,9 @@ import { mapState } from 'vuex'
|
||||
export default {
|
||||
components: { Preview },
|
||||
computed: {
|
||||
panelInfo() {
|
||||
return this.$store.state.panel.panelInfo
|
||||
},
|
||||
...mapState([
|
||||
'canvasStyleData',
|
||||
'componentData'
|
||||
|
@ -4,6 +4,7 @@
|
||||
v-if="show"
|
||||
:component-data="componentData"
|
||||
:canvas-style-data="canvasStyleData"
|
||||
:panel-info="panelInfo"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
@ -33,7 +34,8 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
show: false
|
||||
show: false,
|
||||
panelInfo: {}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@ -51,12 +53,13 @@ export default {
|
||||
loadResource(this.resourceId).then(res => {
|
||||
this.show = false
|
||||
let loadingCount = 0
|
||||
this.$store.dispatch('panel/setPanelInfo', {
|
||||
this.panelInfo = {
|
||||
id: res.data.id,
|
||||
name: res.data.name,
|
||||
privileges: res.data.privileges,
|
||||
status: res.data.status
|
||||
})
|
||||
}
|
||||
this.$store.dispatch('panel/setPanelInfo', panelInfo)
|
||||
|
||||
panelInit(JSON.parse(res.data.panelData), JSON.parse(res.data.panelStyle))
|
||||
// 设置浏览器title为当前仪表板名称
|
||||
|
@ -11,6 +11,7 @@
|
||||
v-if="selectedPanel"
|
||||
:component-data="componentData"
|
||||
:canvas-style-data="canvasStyleData"
|
||||
:panel-info="panelInfo"
|
||||
:show-position="showPosition"
|
||||
/>
|
||||
<el-col v-else style="height: 100%;">
|
||||
@ -54,7 +55,8 @@ export default {
|
||||
msgPanelIds: null,
|
||||
componentData: [],
|
||||
canvasStyleData: {},
|
||||
selectedPanel: null
|
||||
selectedPanel: null,
|
||||
panelInfo: {}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@ -73,6 +75,13 @@ export default {
|
||||
_this.panelLoading = true
|
||||
findOne(params.showId).then(response => {
|
||||
_this.panelLoading = false
|
||||
this.panelInfo = {
|
||||
id: response.data.id,
|
||||
name: response.data.name,
|
||||
privileges: response.data.privileges,
|
||||
sourcePanelName: response.data.sourcePanelName,
|
||||
status: response.data.status
|
||||
}
|
||||
panelDataPrepare(JSON.parse(response.data.panelData), JSON.parse(response.data.panelStyle), function(rsp) {
|
||||
_this.componentData = rsp.componentData
|
||||
_this.canvasStyleData = rsp.componentStyle
|
||||
@ -94,6 +103,9 @@ export default {
|
||||
'viewId': params.showId,
|
||||
'id': componentId
|
||||
}
|
||||
this.panelInfo = {
|
||||
'showType': 'view'
|
||||
}
|
||||
_this.$nextTick(() => {
|
||||
_this.componentData.push(userView)
|
||||
_this.selectedPanel = params
|
||||
|
@ -97,6 +97,7 @@
|
||||
:active-tab="activeTab"
|
||||
:in-screen="!fullscreen"
|
||||
:show-type="'width'"
|
||||
:panel-info="panelInfo"
|
||||
:screen-shot="dataLoading"
|
||||
/>
|
||||
</fullscreen>
|
||||
|
Loading…
Reference in New Issue
Block a user