优化代码

This commit is contained in:
曹磊 2025-10-31 17:05:54 +08:00
parent cfb9f0ab6c
commit a6e3db4d8b
11 changed files with 202 additions and 178 deletions

View File

@ -276,7 +276,7 @@ function createAxios(opt?: Partial<CreateAxiosOptions>) {
// authenticationScheme: 'Bearer', // authenticationScheme: 'Bearer',
authenticationScheme: '', authenticationScheme: '',
//接口超时设置 //接口超时设置
timeout: 10 * 1000, timeout: 60 * 1000,
// 基础接口地址 // 基础接口地址
// baseURL: globSetting.apiUrl, // baseURL: globSetting.apiUrl,
headers: { 'Content-Type': ContentTypeEnum.JSON }, headers: { 'Content-Type': ContentTypeEnum.JSON },

View File

@ -33,13 +33,13 @@
<a-row :gutter="20" class="third-row"> <a-row :gutter="20" class="third-row">
<a-col :xs="24" :md="12"> <a-col :xs="24" :md="12">
<a-card bordered class="mini-card"> <a-card bordered class="mini-card">
<div class="mini-title">乡镇瞬时热量实时</div> <div class="mini-title">乡镇累积热量GJ</div>
<div ref="countyPowerChartRef" class="chart-medium"></div> <div ref="countyPowerChartRef" class="chart-medium"></div>
</a-card> </a-card>
</a-col> </a-col>
<a-col :xs="24" :md="12"> <a-col :xs="24" :md="12">
<a-card bordered class="mini-card" style="margin-left: 8px;"> <a-card bordered class="mini-card" style="margin-left: 8px;">
<div class="mini-title">乡镇瞬时流量实时</div> <div class="mini-title">乡镇累积流量</div>
<div ref="countyFlowChartRef" class="chart-medium"></div> <div ref="countyFlowChartRef" class="chart-medium"></div>
</a-card> </a-card>
</a-col> </a-col>
@ -95,7 +95,7 @@ function sortByTime(arr: any[]) {
} }
function splitByRegion(data: any[]) { function splitByRegion(data: any[]) {
const city = data.filter(d => String(d.regionType).includes('城区')); const city = data.filter(d => String(d.regionType).includes('城区'));
const county = data.filter(d => String(d.regionType).includes('乡镇')); let county = data.filter(d => String(d.regionType).includes('乡镇'));
return { city: sortByTime(city), county: sortByTime(county) }; return { city: sortByTime(city), county: sortByTime(county) };
} }
function buildXAxis(records: any[], key = 'view028') { function buildXAxis(records: any[], key = 'view028') {
@ -142,25 +142,25 @@ function prepareOptions(records: any[]) {
color: ['#D64545', '#12A0A6'] color: ['#D64545', '#12A0A6']
}; };
const powerY = county.map((r: any) => safeNum(r.view041)); const powerY = county.map((r: any) => safeNum(r.view044));
countyPowerOption = { countyPowerOption = {
title: { text: '', left: 'center', top: 8 }, title: { text: '', left: 'center', top: 8 },
tooltip: { trigger: 'axis' }, tooltip: { trigger: 'axis' },
grid: { left: '6%', right: '6%', bottom: 60, top: 50, containLabel: true }, grid: { left: '6%', right: '6%', bottom: 60, top: 50, containLabel: true },
xAxis: { type: 'category', data: countyX, axisLabel: { rotate: 20 } }, xAxis: { type: 'category', data: countyX, axisLabel: { rotate: 20 } },
yAxis: { type: 'value', name: '瞬时热量' }, yAxis: { type: 'value', name: '累积热量' },
series: [{ name: '瞬时热量', type: 'line', data: powerY, smooth: false, areaStyle: {}, showSymbol: false, lineStyle: { type: 'solid' } }], series: [{ name: '累积热量', type: 'line', data: powerY, smooth: false, areaStyle: {}, showSymbol: false, lineStyle: { type: 'solid' } }],
color: ['#E89B3B'] color: ['#E89B3B']
}; };
const flowY = county.map((r: any) => safeNum(r.view037)); const flowY = county.map((r: any) => safeNum(r.view040));
countyFlowOption = { countyFlowOption = {
title: { text: '', left: 'center', top: 8 }, title: { text: '', left: 'center', top: 8 },
tooltip: { trigger: 'axis' }, tooltip: { trigger: 'axis' },
grid: { left: '6%', right: '6%', bottom: 60, top: 50, containLabel: true }, grid: { left: '6%', right: '6%', bottom: 60, top: 50, containLabel: true },
xAxis: { type: 'category', data: countyX, axisLabel: { rotate: 20 } }, xAxis: { type: 'category', data: countyX, axisLabel: { rotate: 20 } },
yAxis: { type: 'value', name: '瞬时流量' }, yAxis: { type: 'value', name: '累积流量' },
series: [{ name: '瞬时流量', type: 'line', data: flowY, smooth: false, showSymbol: false, lineStyle: { type: 'solid' } }], series: [{ name: '累积流量', type: 'line', data: flowY, smooth: false, showSymbol: false, lineStyle: { type: 'solid' } }],
color: ['#7C55FF'] color: ['#7C55FF']
}; };
} }

View File

@ -127,13 +127,13 @@ export const jxcolumns: BasicColumn[] = [
title: '供水温度', title: '供水温度',
align: "center", align: "center",
width: 90, width: 90,
dataIndex: 'view005', dataIndex: 'view035',
}, },
{ {
title: '回水温度', title: '回水温度',
align: "center", align: "center",
width: 90, width: 90,
dataIndex: 'view006' dataIndex: 'view036'
}, },
{ {
title: '供水压力', title: '供水压力',

View File

@ -46,13 +46,13 @@
</a-col> </a-col>
<a-col :lg="5"> <a-col :lg="5">
<a-form-item label="开始时间"> <a-form-item label="开始时间">
<a-date-picker placeholder="请选择开始时间" v-model:value="queryParam.SDate" :disabledDate="startDisabledDate" <a-date-picker placeholder="请选择开始时间" v-model:value="queryParam.SDateStr" value-format="YYYY-MM-DD HH:mm:ss" :disabledDate="startDisabledDate"
@change="handleStartChange" show-time style="width: 100%" allow-clear /> @change="handleStartChange" show-time style="width: 100%" allow-clear />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :lg="5"> <a-col :lg="5">
<a-form-item label="结束时间"> <a-form-item label="结束时间">
<a-date-picker placeholder="请选择结束时间" v-model:value="queryParam.EDate" :disabledDate="endDisabledDate" <a-date-picker placeholder="请选择结束时间" v-model:value="queryParam.EDateStr" value-format="YYYY-MM-DD HH:mm:ss" :disabledDate="endDisabledDate"
@change="handleEndChange" show-time style="width: 100%" allow-clear /> @change="handleEndChange" show-time style="width: 100%" allow-clear />
</a-form-item> </a-form-item>
</a-col> </a-col>
@ -77,6 +77,7 @@ import {
heatsourcestationlist, heatsourcestationlist,
page page
} from './HeatanalysisHistory.api'; } from './HeatanalysisHistory.api';
import dayjs from "dayjs";
const queryParam = ref<any>({}); const queryParam = ref<any>({});
const toggleSearchStatus = ref<boolean>(false); const toggleSearchStatus = ref<boolean>(false);
@ -92,6 +93,7 @@ const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
clickToRowSelect: false, clickToRowSelect: false,
showActionColumn: false, showActionColumn: false,
showIndexColumn: false, showIndexColumn: false,
immediate: false,
tableSetting: { tableSetting: {
// //
redo: false, redo: false,
@ -136,23 +138,26 @@ function searchQuery() {
/** /**
* 重置 * 重置
*/ */
function searchReset() { async function searchReset() {
queryParam.value = {}; queryParam.value = {};
selectedRowKeys.value = []; selectedRowKeys.value = [];
getHeatsource(); await getHeatsource();
getHeatsourcestation(); await getHeatsourcestation();
let list = thermalcompany.value;
queryParam.value.view001 = list[0].id;
queryParam.value.SDateStr = dayjs().format('YYYY-MM-DD HH:mm:ss');
// //
reload(); reload();
} }
const thermalcompany = ref(); const thermalcompany = ref();
async function getThermalcompany() { async function getThermalcompany() {
thermalcompany.value = await companylist(); thermalcompany.value = await companylist({regionType: '城区'});
} }
const heatsource = ref(); const heatsource = ref();
async function getHeatsource() { async function getHeatsource() {
heatsource.value = await heatsourcelist(); heatsource.value = await heatsourcelist({regionType: '城区'});
} }
const heatsourcestation = ref(); const heatsourcestation = ref();
@ -175,57 +180,59 @@ function handleChange3(record) {
// //
function startDisabledDate(current) { function startDisabledDate(current) {
// //
if (!queryParam.value.EDate) return false; if (!queryParam.value.EDateStr) return false;
return !current.isSame(queryParam.value.EDate, 'month') || return !current.isSame(queryParam.value.EDateStr, 'month') ||
current.isAfter(queryParam.value.EDate, 'day'); current.isAfter(queryParam.value.EDateStr, 'day');
} }
// //
function endDisabledDate(current) { function endDisabledDate(current) {
// //
if (!queryParam.value.SDate) return true; if (!queryParam.value.SDateStr) return true;
return !current.isSame(queryParam.value.SDate, 'month') || return !current.isSame(queryParam.value.SDateStr, 'month') ||
current.isBefore(queryParam.value.SDate, 'day'); current.isBefore(queryParam.value.SDateStr, 'day');
} }
// //
function handleStartChange(momentObj) { function handleStartChange(momentObj) {
if (momentObj && queryParam.value.EDate && if (momentObj && queryParam.value.EDateStr &&
!momentObj.isSame(queryParam.value.EDate, 'month')) { !momentObj.isSame(queryParam.value.EDateStr, 'month')) {
queryParam.value.EDate = null; queryParam.value.EDateStr = null;
} }
} }
// //
function handleEndChange(momentObj) { function handleEndChange(momentObj) {
if (momentObj && queryParam.value.SDate && if (momentObj && queryParam.value.SDateStr &&
!momentObj.isSame(queryParam.value.SDate, 'month')) { !momentObj.isSame(queryParam.value.SDateStr, 'month')) {
queryParam.value.SDate = null; queryParam.value.SDateStr = null;
} }
} }
onMounted(() => { onMounted(async() => {
getThermalcompany(); await getThermalcompany();
getHeatsource(); await getHeatsource();
getHeatsourcestation(); await getHeatsourcestation();
let list = thermalcompany.value;
queryParam.value.view001 = list[0].id;
queryParam.value.SDateStr = dayjs().format('YYYY-MM-DD HH:mm:ss');
watch( watch(
() => queryParam.value.SDate, () => queryParam.value.SDateStr,
async (newVal) => { async (newVal) => {
if (newVal && queryParam.value.EDate && if (newVal && queryParam.value.EDateStr &&
(!newVal.isSame(queryParam.value.EDate, 'month') || newVal > queryParam.value.EDate)) { (!newVal.isSame(queryParam.value.EDateStr, 'month') || newVal > queryParam.value.EDateStr)) {
queryParam.value.EDate = null; queryParam.value.EDateStr = null;
} }
}, },
{ deep: true, immediate: true } { deep: true, immediate: true }
); );
// //
watch( watch(
() => queryParam.value.EDate, () => queryParam.value.EDateStr,
async (newVal) => { async (newVal) => {
if (newVal && queryParam.value.SDate && if (newVal && queryParam.value.SDateStr &&
(!newVal.isSame(queryParam.value.SDate, 'month') || newVal < queryParam.value.SDate)) { (!newVal.isSame(queryParam.value.SDateStr, 'month') || newVal < queryParam.value.SDateStr)) {
queryParam.value.SDate = null; queryParam.value.SDateStr = null;
} }
}, },
{ deep: true, immediate: true } { deep: true, immediate: true }

View File

@ -46,13 +46,13 @@
</a-col> </a-col>
<a-col :lg="5"> <a-col :lg="5">
<a-form-item label="开始时间"> <a-form-item label="开始时间">
<a-date-picker placeholder="请选择开始时间" v-model:value="queryParam.SDate" :disabledDate="startDisabledDate" <a-date-picker placeholder="请选择开始时间" v-model:value="queryParam.SDateStr" value-format="YYYY-MM-DD HH:mm:ss" :disabledDate="startDisabledDate"
@change="handleStartChange" show-time style="width: 100%" allow-clear /> @change="handleStartChange" show-time style="width: 100%" allow-clear />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :lg="5"> <a-col :lg="5">
<a-form-item label="结束时间"> <a-form-item label="结束时间">
<a-date-picker placeholder="请选择结束时间" v-model:value="queryParam.EDate" :disabledDate="endDisabledDate" <a-date-picker placeholder="请选择结束时间" v-model:value="queryParam.EDateStr" value-format="YYYY-MM-DD HH:mm:ss" :disabledDate="endDisabledDate"
@change="handleEndChange" show-time style="width: 100%" allow-clear /> @change="handleEndChange" show-time style="width: 100%" allow-clear />
</a-form-item> </a-form-item>
</a-col> </a-col>
@ -76,6 +76,7 @@ import {
heatsourcestationlist, heatsourcestationlist,
jxpage jxpage
} from './HeatanalysisHistory.api'; } from './HeatanalysisHistory.api';
import dayjs from 'dayjs';
const queryParam = ref<any>({}); const queryParam = ref<any>({});
const toggleSearchStatus = ref<boolean>(false); const toggleSearchStatus = ref<boolean>(false);
@ -91,6 +92,7 @@ const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
clickToRowSelect: false, clickToRowSelect: false,
showActionColumn: false, showActionColumn: false,
showIndexColumn: false, showIndexColumn: false,
immediate: false,
tableSetting: { tableSetting: {
// //
redo: false, redo: false,
@ -135,23 +137,26 @@ function searchQuery() {
/** /**
* 重置 * 重置
*/ */
function searchReset() { async function searchReset() {
queryParam.value = {}; queryParam.value = {};
selectedRowKeys.value = []; selectedRowKeys.value = [];
getHeatsource(); await getHeatsource();
getHeatsourcestation(); await getHeatsourcestation();
let list = thermalcompany.value;
queryParam.value.view001 = list[0].id;
queryParam.value.SDateStr = dayjs().format('YYYY-MM-DD HH:mm:ss');
// //
reload(); reload();
} }
const thermalcompany = ref(); const thermalcompany = ref();
async function getThermalcompany() { async function getThermalcompany() {
thermalcompany.value = await companylist(); thermalcompany.value = await companylist({regionType: '乡镇'});
} }
const heatsource = ref(); const heatsource = ref();
async function getHeatsource() { async function getHeatsource() {
heatsource.value = await heatsourcelist(); heatsource.value = await heatsourcelist({regionType: '乡镇'});
} }
const heatsourcestation = ref(); const heatsourcestation = ref();
@ -174,57 +179,59 @@ function handleChange3(record) {
// //
function startDisabledDate(current) { function startDisabledDate(current) {
// //
if (!queryParam.value.EDate) return false; if (!queryParam.value.EDateStr) return false;
return !current.isSame(queryParam.value.EDate, 'month') || return !current.isSame(queryParam.value.EDateStr, 'month') ||
current.isAfter(queryParam.value.EDate, 'day'); current.isAfter(queryParam.value.EDateStr, 'day');
} }
// //
function endDisabledDate(current) { function endDisabledDate(current) {
// //
if (!queryParam.value.SDate) return true; if (!queryParam.value.SDateStr) return true;
return !current.isSame(queryParam.value.SDate, 'month') || return !current.isSame(queryParam.value.SDateStr, 'month') ||
current.isBefore(queryParam.value.SDate, 'day'); current.isBefore(queryParam.value.SDateStr, 'day');
} }
// //
function handleStartChange(momentObj) { function handleStartChange(momentObj) {
if (momentObj && queryParam.value.EDate && if (momentObj && queryParam.value.EDateStr &&
!momentObj.isSame(queryParam.value.EDate, 'month')) { !momentObj.isSame(queryParam.value.EDateStr, 'month')) {
queryParam.value.EDate = null; queryParam.value.EDateStr = null;
} }
} }
// //
function handleEndChange(momentObj) { function handleEndChange(momentObj) {
if (momentObj && queryParam.value.SDate && if (momentObj && queryParam.value.SDateStr &&
!momentObj.isSame(queryParam.value.SDate, 'month')) { !momentObj.isSame(queryParam.value.SDateStr, 'month')) {
queryParam.value.SDate = null; queryParam.value.SDateStr = null;
} }
} }
onMounted(() => { onMounted(async() => {
getThermalcompany(); await getThermalcompany();
getHeatsource(); await getHeatsource();
getHeatsourcestation(); await getHeatsourcestation();
let list = thermalcompany.value;
queryParam.value.view001 = list[0].id;
queryParam.value.SDateStr = dayjs().format('YYYY-MM-DD HH:mm:ss');
watch( watch(
() => queryParam.value.SDate, () => queryParam.value.SDateStr,
async (newVal) => { async (newVal) => {
if (newVal && queryParam.value.EDate && if (newVal && queryParam.value.EDateStr &&
(!newVal.isSame(queryParam.value.EDate, 'month') || newVal > queryParam.value.EDate)) { (!newVal.isSame(queryParam.value.EDateStr, 'month') || newVal > queryParam.value.EDateStr)) {
queryParam.value.EDate = null; queryParam.value.EDateStr = null;
} }
}, },
{ deep: true, immediate: true } { deep: true, immediate: true }
); );
// //
watch( watch(
() => queryParam.value.EDate, () => queryParam.value.EDateStr,
async (newVal) => { async (newVal) => {
if (newVal && queryParam.value.SDate && if (newVal && queryParam.value.SDateStr &&
(!newVal.isSame(queryParam.value.SDate, 'month') || newVal < queryParam.value.SDate)) { (!newVal.isSame(queryParam.value.SDateStr, 'month') || newVal < queryParam.value.SDateStr)) {
queryParam.value.SDate = null; queryParam.value.SDateStr = null;
} }
}, },
{ deep: true, immediate: true } { deep: true, immediate: true }

View File

@ -9,8 +9,13 @@ enum Api {
companylist = '/heating/thermalcompany/list', companylist = '/heating/thermalcompany/list',
heatsourcelist = '/heating/heatsource/list', heatsourcelist = '/heating/heatsource/list',
heatsourcestationlist = '/heating/heatsourcestation/list', heatsourcestationlist = '/heating/heatsourcestation/list',
exportXls = '/heating/heatanalysis/exportYunweiXls',
} }
/**
* api
* @param params
*/
export const getExportUrl = Api.exportXls;
/** /**
* *
* @param params * @param params

View File

@ -122,13 +122,13 @@ export const columns: BasicColumn[] = [
title: '热量', title: '热量',
align:"center", align:"center",
width:120, width:120,
dataIndex: 'view041', dataIndex: 'view044',
}, },
{ {
title: '水流量', title: '水流量',
align:"center", align:"center",
width:120, width:120,
dataIndex: 'view037' dataIndex: 'view040'
}, },
]; ];

View File

@ -58,6 +58,7 @@
<a-col :lg="6"> <a-col :lg="6">
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button> <a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button>
<a-button preIcon="ant-design:sync-outlined" @click="searchReset" style="margin-left: 8px">重置</a-button> <a-button preIcon="ant-design:sync-outlined" @click="searchReset" style="margin-left: 8px">重置</a-button>
<a-button danger preIcon="ant-design:export-outlined" @click="onExportXls" style="margin-left: 8px">导出</a-button>
</a-col> </a-col>
</span> </span>
</a-col> </a-col>
@ -102,7 +103,7 @@ import { ref, reactive, onMounted } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table'; import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage'; import { useListPage } from '/@/hooks/system/useListPage';
import { columns } from './Heatanalysis.data'; import { columns } from './Heatanalysis.data';
import { list, companylist, heatsourcelist, heatsourcestationlist } from './Heatanalysis.api'; import { list, companylist, heatsourcelist, heatsourcestationlist, getExportUrl } from './Heatanalysis.api';
import HeatanalysisReamrksListModal from './components/HeatanalysisReamrksListModal.vue' import HeatanalysisReamrksListModal from './components/HeatanalysisReamrksListModal.vue'
import ChangeLevelModal from './components/ChangeLevelModal.vue' import ChangeLevelModal from './components/ChangeLevelModal.vue'
@ -139,6 +140,10 @@ const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
return Object.assign(params, queryParam.value); return Object.assign(params, queryParam.value);
}, },
}, },
exportConfig: {
name: '运维数据列表',
url: getExportUrl,
},
}); });
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext; const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
const labelCol = reactive({ const labelCol = reactive({
@ -244,7 +249,6 @@ onMounted(() => {
getHeatsourcestation(); getHeatsourcestation();
}); });
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>

View File

@ -1102,7 +1102,7 @@ function updateChartArea82() {
}, },
yAxis: { yAxis: {
type: 'value', type: 'value',
name: '焦耳', name: 'GJ',
nameLocation: 'end', nameLocation: 'end',
nameTextStyle: { nameTextStyle: {
color: '#ffffff', color: '#ffffff',
@ -1386,8 +1386,10 @@ async function loadData() {
}); });
cityList.value = cities; cityList.value = cities;
countyList.value = filterSongshanData(countys); // countyList.value = filterSongshanData(countys);
countyAddList.value = sumSongshanData(countys); countyList.value = countys;
// countyAddList.value = sumSongshanData(countys);
countyAddList.value = countys;
// //
const arr2 = (z_ && z_.data) ? z_.data : []; const arr2 = (z_ && z_.data) ? z_.data : [];
const cities2: { name: string; value: number; raw: any }[] = []; const cities2: { name: string; value: number; raw: any }[] = [];

View File

@ -70,10 +70,9 @@ function buildXAxis(records: any[], key = 'view028') {
/* ---- build options折线改为直线 smooth: false ---- */ /* ---- build options折线改为直线 smooth: false ---- */
function prepareOptions(records: any[]) { function prepareOptions(records: any[]) {
const { city } = splitByRegion(records); const { city } = splitByRegion(records);
const cityX = buildXAxis(city, 'datatime'); const cityX = buildXAxis(city, 'datatime');
const citySW = city.map((r: any) => safeNum(r.view005)); const citySW = city.map((r: any) => safeNum(r.view035));
const cityHW = city.map((r: any) => safeNum(r.view006)); const cityHW = city.map((r: any) => safeNum(r.view036));
cityOption = { cityOption = {
title: { text: '乡镇锅炉房历史供/回水温度', left: 'center', top: 10 }, title: { text: '乡镇锅炉房历史供/回水温度', left: 'center', top: 10 },
tooltip: { trigger: 'axis' }, tooltip: { trigger: 'axis' },

View File

@ -72,16 +72,16 @@ function prepareOptions(records: any[]) {
const { city } = splitByRegion(records); const { city } = splitByRegion(records);
const cityX = buildXAxis(city, 'datatime'); const cityX = buildXAxis(city, 'datatime');
const citySW = city.map((r: any) => safeNum(r.view037)); const citySW = city.map((r: any) => safeNum(r.view041));
cityOption = { cityOption = {
title: { text: '乡镇锅炉房历史热量', left: 'center', top: 10 }, title: { text: '乡镇锅炉房历史热量', left: 'center', top: 10 },
tooltip: { trigger: 'axis' }, tooltip: { trigger: 'axis' },
legend: { top: 36, left: 'center' }, legend: { top: 36, left: 'center' },
grid: { left: '6%', right: '4%', bottom: 70, top: 70, containLabel: true }, grid: { left: '6%', right: '4%', bottom: 70, top: 70, containLabel: true },
xAxis: { type: 'category', data: cityX, axisLabel: { rotate: 0,formatter: (val: string) => val.replace(' ', '\n') } }, xAxis: { type: 'category', data: cityX, axisLabel: { rotate: 0,formatter: (val: string) => val.replace(' ', '\n') } },
yAxis: { type: 'value', name: 'kw' }, yAxis: { type: 'value', name: 'kw' },
series: [ series: [
{ name: '热量', type: 'line', data: citySW, smooth: false, showSymbol: false, lineStyle: { type: 'solid' } }, { name: '热量', type: 'line', data: citySW, smooth: false, showSymbol: false, lineStyle: { type: 'solid' } },
], ],
color: ['#176AB3', '#2F9E8A'] // 线 color: ['#176AB3', '#2F9E8A'] // 线
}; };