feat: 修改图表
This commit is contained in:
parent
e8d28126ad
commit
0dd7648593
|
|
@ -42,8 +42,10 @@
|
||||||
></el-button>
|
></el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-header>
|
</el-header>
|
||||||
<el-container>
|
|
||||||
<el-main class="nopadding">
|
<el-main class="nopadding">
|
||||||
|
<el-container>
|
||||||
|
<el-aside style="width: 50%; float: right;">
|
||||||
|
<!-- 折线图组件 -->
|
||||||
<scTable
|
<scTable
|
||||||
ref="table"
|
ref="table"
|
||||||
:apiObj="apiObj"
|
:apiObj="apiObj"
|
||||||
|
|
@ -95,12 +97,12 @@
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</scTable>
|
</scTable>
|
||||||
</el-main>
|
|
||||||
<el-aside style="width: 50%; float: right;">
|
|
||||||
<!-- 折线图组件 -->
|
|
||||||
<scEcharts :option="chartOption" height="400px" />
|
|
||||||
</el-aside>
|
</el-aside>
|
||||||
|
<el-main>
|
||||||
|
<scEcharts :option="chartOption" height="400px" />
|
||||||
|
</el-main>
|
||||||
</el-container>
|
</el-container>
|
||||||
|
</el-main>
|
||||||
</el-container>
|
</el-container>
|
||||||
<el-dialog title="校正" v-model="visible">
|
<el-dialog title="校正" v-model="visible">
|
||||||
<el-main style="padding: 0 20px 20px 20px">
|
<el-main style="padding: 0 20px 20px 20px">
|
||||||
|
|
@ -167,7 +169,7 @@ export default {
|
||||||
end_time: null
|
end_time: null
|
||||||
},
|
},
|
||||||
chartOption: {
|
chartOption: {
|
||||||
color: ["#80FFA5", "#00DDFF", "#37A2FF", "#FF0087", "#FFBF00"],
|
color: ["#191970"],
|
||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: "axis",
|
trigger: "axis",
|
||||||
axisPointer: {
|
axisPointer: {
|
||||||
|
|
@ -232,14 +234,13 @@ export default {
|
||||||
|
|
||||||
option.series = [
|
option.series = [
|
||||||
{
|
{
|
||||||
name: '总生产',
|
name: tableData[0].mpoint_name,
|
||||||
type: 'line', // 折线图类型
|
type: 'line', // 折线图类型
|
||||||
data: tableData.map((item) => parseFloat(item.val)), // 将字符串转为数字
|
data: tableData.map((item) => parseFloat(item.val)), // 将字符串转为数字
|
||||||
smooth: true, // 平滑曲线
|
smooth: true, // 平滑曲线
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
option.legend.data = ['总生产'];
|
option.legend.data = [tableData[0].mpoint_name];
|
||||||
|
|
||||||
// 更新图表选项
|
// 更新图表选项
|
||||||
that.chartOption = option;
|
that.chartOption = option;
|
||||||
},
|
},
|
||||||
|
|
@ -254,7 +255,6 @@ export default {
|
||||||
},
|
},
|
||||||
handle_add() {},
|
handle_add() {},
|
||||||
handleQuery() {
|
handleQuery() {
|
||||||
console.log(this.query)
|
|
||||||
if (this.timeRange) {
|
if (this.timeRange) {
|
||||||
this.query.start_time = this.timeRange[0]
|
this.query.start_time = this.timeRange[0]
|
||||||
this.query.end_time = this.timeRange[1]
|
this.query.end_time = this.timeRange[1]
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue