refactor: 新建视图样式设置不再显示背景,改为仪表板组件样式设置

This commit is contained in:
wangjiahao 2022-03-30 10:14:45 +08:00
parent d504c96b2d
commit fa7d5ad350
4 changed files with 6 additions and 5 deletions

View File

@ -2,11 +2,11 @@ import request from '@/utils/request'
import store from '@/store' import store from '@/store'
import { queryPanelComponents } from '@/api/panel/panel' import { queryPanelComponents } from '@/api/panel/panel'
export function post(url, data) { export function post(url, data, loading = false) {
return request({ return request({
url: url, url: url,
method: 'post', method: 'post',
loading: false, loading: loading,
data data
}) })
} }

View File

@ -765,7 +765,6 @@ export default {
xAxis: DEFAULT_XAXIS_STYLE, xAxis: DEFAULT_XAXIS_STYLE,
yAxis: DEFAULT_YAXIS_STYLE, yAxis: DEFAULT_YAXIS_STYLE,
yAxisExt: DEFAULT_YAXIS_EXT_STYLE, yAxisExt: DEFAULT_YAXIS_EXT_STYLE,
background: DEFAULT_BACKGROUND_COLOR,
split: DEFAULT_SPLIT split: DEFAULT_SPLIT
}) })
view.senior = JSON.stringify({ view.senior = JSON.stringify({
@ -784,7 +783,7 @@ export default {
view.extBubble = JSON.stringify([]) view.extBubble = JSON.stringify([])
this.setChartDefaultOptions(view) this.setChartDefaultOptions(view)
const _this = this const _this = this
post('/chart/view/newOne/' + this.panelInfo.id, view).then(response => { post('/chart/view/newOne/' + this.panelInfo.id, view,true).then(response => {
this.closeCreateChart() this.closeCreateChart()
this.$store.dispatch('chart/setTableId', null) this.$store.dispatch('chart/setTableId', null)
this.$store.dispatch('chart/setTableId', this.table.id) this.$store.dispatch('chart/setTableId', this.table.id)

View File

@ -877,7 +877,7 @@
@onLegendChange="onLegendChange" @onLegendChange="onLegendChange"
/> />
</el-collapse-item> </el-collapse-item>
<el-collapse-item name="background" :title="$t('chart.background')"> <el-collapse-item v-if="chart.customStyle.background" name="background" :title="$t('chart.background')">
<background-color-selector <background-color-selector
:param="param" :param="param"
class="attr-selector" class="attr-selector"

View File

@ -1006,6 +1006,8 @@ export default {
component.y = 1 component.y = 1
} }
component.id = newComponentId component.id = newComponentId
//
component.commonBackground = deepCopy(COMMON_BACKGROUND)
this.$store.commit('addComponent', { component }) this.$store.commit('addComponent', { component })
this.$store.commit('recordSnapshot', 'newViewInfo') this.$store.commit('recordSnapshot', 'newViewInfo')
this.clearCurrentInfo() this.clearCurrentInfo()