提交 27fe16fd authored 作者: wangjiahao's avatar wangjiahao

refactor: 复用存量视图自动勾选

上级 fb894df6
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
</span> </span>
</div> </div>
<div v-if="positionCheck('multiplexing')" style="margin-right: -1px;width: 18px;z-index: 5"> <div v-if="positionCheck('multiplexing')" style="margin-right: -1px;width: 18px;z-index: 5">
<el-checkbox size="medium" @change="multiplexingCheck" /> <el-checkbox v-model="multiplexingCheckModel" size="medium" @change="multiplexingCheck" />
</div> </div>
</div> </div>
</template> </template>
...@@ -41,6 +41,7 @@ export default { ...@@ -41,6 +41,7 @@ export default {
}, },
data() { data() {
return { return {
multiplexingCheckModel: false,
componentType: null, componentType: null,
linkageActiveStatus: false, linkageActiveStatus: false,
editFilter: [ editFilter: [
...@@ -67,6 +68,10 @@ export default { ...@@ -67,6 +68,10 @@ export default {
]) ])
}, },
mounted() { mounted() {
if (this.showPosition === 'multiplexing-view') {
this.multiplexingCheckModel = true
this.multiplexingCheck(this.multiplexingCheckModel)
}
}, },
beforeDestroy() { beforeDestroy() {
}, },
...@@ -86,7 +91,7 @@ export default { ...@@ -86,7 +91,7 @@ export default {
this.$emit('showViewDetails') this.$emit('showViewDetails')
}, },
positionCheck(position) { positionCheck(position) {
return this.showPosition === position return this.showPosition.includes(position)
}, },
multiplexingCheck(val) { multiplexingCheck(val) {
if (val) { if (val) {
......
...@@ -233,7 +233,7 @@ export default { ...@@ -233,7 +233,7 @@ export default {
} }
}, },
editBarViewShowFlag() { editBarViewShowFlag() {
return (this.active && this.inTab && !this.mobileLayoutStatus) || this.showPosition === 'multiplexing' return (this.active && this.inTab && !this.mobileLayoutStatus) || this.showPosition.includes('multiplexing')
}, },
charViewShowFlag() { charViewShowFlag() {
return this.httpRequest.status && this.chart.type && !this.chart.type.includes('table') && !this.chart.type.includes('text') && this.chart.type !== 'label' && this.renderComponent() === 'echarts' return this.httpRequest.status && this.chart.type && !this.chart.type.includes('table') && !this.chart.type.includes('text') && this.chart.type !== 'label' && this.renderComponent() === 'echarts'
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
v-if="selectedPanel" v-if="selectedPanel"
:component-data="componentData" :component-data="componentData"
:canvas-style-data="canvasStyleData" :canvas-style-data="canvasStyleData"
:show-position="'multiplexing'" :show-position="showPosition"
/> />
<el-col v-else style="height: 100%;"> <el-col v-else style="height: 100%;">
<el-row style="height: 100%; background-color: var(--ContentBG);" class="custom-position"> <el-row style="height: 100%; background-color: var(--ContentBG);" class="custom-position">
...@@ -45,6 +45,7 @@ export default { ...@@ -45,6 +45,7 @@ export default {
}, },
data() { data() {
return { return {
showPosition: 'multiplexing',
activeName: 'PanelList', activeName: 'PanelList',
viewLoading: false, viewLoading: false,
panelLoading: false, panelLoading: false,
...@@ -60,21 +61,25 @@ export default { ...@@ -60,21 +61,25 @@ export default {
}, },
mounted() { mounted() {
this.$store.commit('initCurMultiplexingComponents')
}, },
methods: { methods: {
showDetails(params) { showDetails(params) {
this.$store.commit('initCurMultiplexingComponents')
const _this = this const _this = this
_this.selectedPanel = params _this.selectedPanel = params
if (params.showType === 'panel') { if (params.showType === 'panel') {
this.panelLoading = true _this.showPosition = 'multiplexing'
_this.panelLoading = true
findOne(params.showId).then(response => { findOne(params.showId).then(response => {
this.panelLoading = false _this.panelLoading = false
panelDataPrepare(JSON.parse(response.data.panelData), JSON.parse(response.data.panelStyle), function(rsp) { panelDataPrepare(JSON.parse(response.data.panelData), JSON.parse(response.data.panelStyle), function(rsp) {
_this.componentData = rsp.componentData _this.componentData = rsp.componentData
_this.canvasStyleData = rsp.componentStyle _this.canvasStyleData = rsp.componentStyle
}) })
}) })
} else if (params.showType === 'view') { } else if (params.showType === 'view') {
_this.showPosition = 'multiplexing-view'
_this.componentData = [] _this.componentData = []
const componentId = uuid.v1() const componentId = uuid.v1()
_this.canvasStyleData = deepCopy(DEFAULT_COMMON_CANVAS_STYLE_STRING) _this.canvasStyleData = deepCopy(DEFAULT_COMMON_CANVAS_STYLE_STRING)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论