fix: 仪表盘样式设置 回显不准确问题
This commit is contained in:
parent
85a7b1fdbe
commit
76162f1461
@ -2,10 +2,10 @@
|
|||||||
<div v-loading="requestStatus==='waiting'" class="rect-shape">
|
<div v-loading="requestStatus==='waiting'" class="rect-shape">
|
||||||
<div v-if="requestStatus==='error'" class="chart-error-class">
|
<div v-if="requestStatus==='error'" class="chart-error-class">
|
||||||
<div style="font-size: 12px; color: #9ea6b2;height: 100%;display: flex;align-items: center;justify-content: center;">
|
<div style="font-size: 12px; color: #9ea6b2;height: 100%;display: flex;align-items: center;justify-content: center;">
|
||||||
<span v-if="message.response.data.message">{{ message.response.data.message }}<span>,{{ $t('chart.chart_show_error') }}
|
{{ message }},{{ $t('chart.chart_show_error') }}
|
||||||
<br>
|
<br>
|
||||||
{{ $t('chart.chart_error_tips') }}
|
{{ $t('chart.chart_error_tips') }}
|
||||||
</span></span></div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<chart-component v-if="requestStatus==='success'&&chart.type && !chart.type.includes('table') && !chart.type.includes('text')" :ref="element.propValue.id" class="chart-class" :chart="chart" />
|
<chart-component v-if="requestStatus==='success'&&chart.type && !chart.type.includes('table') && !chart.type.includes('text')" :ref="element.propValue.id" class="chart-class" :chart="chart" />
|
||||||
<table-normal v-if="requestStatus==='success'&&chart.type && chart.type.includes('table')" :ref="element.propValue.id" :chart="chart" class="table-class" />
|
<table-normal v-if="requestStatus==='success'&&chart.type && chart.type.includes('table')" :ref="element.propValue.id" :chart="chart" class="table-class" />
|
||||||
@ -180,7 +180,11 @@ export default {
|
|||||||
return true
|
return true
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
this.requestStatus = 'error'
|
this.requestStatus = 'error'
|
||||||
|
if (err && err.response && err.response.data) {
|
||||||
|
this.message = err.response.data.message
|
||||||
|
} else {
|
||||||
this.message = err
|
this.message = err
|
||||||
|
}
|
||||||
return true
|
return true
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@ -42,6 +42,18 @@ export default {
|
|||||||
watch: {
|
watch: {
|
||||||
'chart': {
|
'chart': {
|
||||||
handler: function() {
|
handler: function() {
|
||||||
|
this.init()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.init()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
changeBackgroundStyle() {
|
||||||
|
this.$emit('onChangeBackgroundForm', this.colorForm)
|
||||||
|
},
|
||||||
|
init() {
|
||||||
const chart = JSON.parse(JSON.stringify(this.chart))
|
const chart = JSON.parse(JSON.stringify(this.chart))
|
||||||
if (chart.customStyle) {
|
if (chart.customStyle) {
|
||||||
let customStyle = null
|
let customStyle = null
|
||||||
@ -56,14 +68,6 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
changeBackgroundStyle() {
|
|
||||||
this.$emit('onChangeBackgroundForm', this.colorForm)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@ -126,6 +126,25 @@ export default {
|
|||||||
watch: {
|
watch: {
|
||||||
'chart': {
|
'chart': {
|
||||||
handler: function() {
|
handler: function() {
|
||||||
|
this.init()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.init()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
changeColorCase() {
|
||||||
|
const that = this
|
||||||
|
const items = this.colorCases.filter(ele => {
|
||||||
|
return ele.value === that.colorForm.value
|
||||||
|
})
|
||||||
|
const val = JSON.parse(JSON.stringify(this.colorForm))
|
||||||
|
val.value = items[0].value
|
||||||
|
val.colors = items[0].colors
|
||||||
|
this.$emit('onColorChange', val)
|
||||||
|
},
|
||||||
|
init() {
|
||||||
const chart = JSON.parse(JSON.stringify(this.chart))
|
const chart = JSON.parse(JSON.stringify(this.chart))
|
||||||
if (chart.customAttr) {
|
if (chart.customAttr) {
|
||||||
let customAttr = null
|
let customAttr = null
|
||||||
@ -140,21 +159,6 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
changeColorCase() {
|
|
||||||
const that = this
|
|
||||||
const items = this.colorCases.filter(ele => {
|
|
||||||
return ele.value === that.colorForm.value
|
|
||||||
})
|
|
||||||
const val = JSON.parse(JSON.stringify(this.colorForm))
|
|
||||||
val.value = items[0].value
|
|
||||||
val.colors = items[0].colors
|
|
||||||
this.$emit('onColorChange', val)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@ -17,7 +17,7 @@
|
|||||||
<el-collapse-item :title="$t('chart.module_style')" name="component">
|
<el-collapse-item :title="$t('chart.module_style')" name="component">
|
||||||
<el-row style="background-color: #f7f8fa; margin: 5px">
|
<el-row style="background-color: #f7f8fa; margin: 5px">
|
||||||
<!-- <title-selector class="attr-selector" :chart="chart" @onTextChange="onTextChange" />-->
|
<!-- <title-selector class="attr-selector" :chart="chart" @onTextChange="onTextChange" />-->
|
||||||
<background-color-selector class="attr-selector" :chart="chart" @onChangeBackgroundForm="onChangeBackgroundForm" />
|
<background-color-selector v-if="chart" class="attr-selector" :chart="chart" @onChangeBackgroundForm="onChangeBackgroundForm" />
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-collapse-item>
|
</el-collapse-item>
|
||||||
<el-collapse-item :title="$t('chart.shape_attr')" name="graphical">
|
<el-collapse-item :title="$t('chart.shape_attr')" name="graphical">
|
||||||
@ -27,7 +27,7 @@
|
|||||||
</el-collapse-item>
|
</el-collapse-item>
|
||||||
<el-collapse-item :title="$t('panel.table')" name="table">
|
<el-collapse-item :title="$t('panel.table')" name="table">
|
||||||
<el-row style="background-color: #f7f8fa; margin: 5px">
|
<el-row style="background-color: #f7f8fa; margin: 5px">
|
||||||
<color-selector v-if="tableChartShow" index="10002" :source-type="'panelTable'" class="attr-selector" :chart="tableChart" @onColorChange="onTableColorChange" />
|
<color-selector index="10002" :source-type="'panelTable'" class="attr-selector" :chart="tableChart" @onColorChange="onTableColorChange" />
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-collapse-item>
|
</el-collapse-item>
|
||||||
</el-collapse>
|
</el-collapse>
|
||||||
@ -58,7 +58,7 @@ export default {
|
|||||||
return {
|
return {
|
||||||
panelInfo: this.$store.state.panel.panelInfo,
|
panelInfo: this.$store.state.panel.panelInfo,
|
||||||
activeNames: ['panel'],
|
activeNames: ['panel'],
|
||||||
chart: {},
|
chart: null,
|
||||||
tableChart: null,
|
tableChart: null,
|
||||||
collapseShow: true,
|
collapseShow: true,
|
||||||
tableChartShow: true
|
tableChartShow: true
|
||||||
@ -76,9 +76,9 @@ export default {
|
|||||||
this.collapseShow = false
|
this.collapseShow = false
|
||||||
this.$nextTick(() => (this.collapseShow = true))
|
this.$nextTick(() => (this.collapseShow = true))
|
||||||
})
|
})
|
||||||
this.init()
|
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
this.init()
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user