修改样式

This commit is contained in:
yangjun 2025-10-29 11:10:34 +08:00
parent 391f70825f
commit cfb9f0ab6c
1 changed files with 24 additions and 60 deletions

View File

@ -136,7 +136,7 @@
<div class="header-left"> <div class="header-left">
<img src="./dashboard/dp_icon4.png" alt="icon" /> <img src="./dashboard/dp_icon4.png" alt="icon" />
<span class="header-left-text">乡镇压力供压回压</span> <span class="header-left-text">乡镇压力供压回压</span>
<span class="header-left-text" style="margin-left: 130px;">单位MPa</span> <span class="header-left-text" style="margin-left: 90px;">单位MPa</span>
</div> </div>
</div> </div>
<div class=" area-body"></div> <div class=" area-body"></div>
@ -619,16 +619,16 @@ function updateChartCounty() {
if (!chartCounty) return; if (!chartCounty) return;
const names = countyList.value.map(i => i.raw?.view028 ?? '未知'); const names = countyList.value.map(i => i.raw?.view028 ?? '未知');
const values = countyList.value.map(i => (i.raw?.view035 ? Number(i.raw.view035) : 0)); const values1 = countyList.value.map(i => (i.raw?.view035 ? Number(i.raw.view035) : 0));
const values2 = countyList.value.map(i => (i.raw?.view036 ? Number(i.raw.view036) : 0)); const values2 = countyList.value.map(i => (i.raw?.view036 ? Number(i.raw.view036) : 0));
const maxVal = values.length ? Math.max(...values, ...values2) * 1.15 : 100; const maxVal = values1.length ? Math.max(...values1) : 100;
chartCounty.setOption({ chartCounty.setOption({
grid: { grid: {
left: 10, left: 10,
right: 120, // right: 120, //
bottom: 14, bottom: 8,
top: 28, top: 18,
containLabel: true containLabel: true
}, },
tooltip: { tooltip: {
@ -664,8 +664,8 @@ function updateChartCounty() {
axisLabel: { axisLabel: {
color: jbztys.value, color: jbztys.value,
interval: 0, interval: 0,
fontSize: 16, // fontSize: 12, //
margin: 2 // margin: 0 //
}, },
axisTick: { show: false }, axisTick: { show: false },
axisLine: { show: false } axisLine: { show: false }
@ -691,9 +691,9 @@ function updateChartCounty() {
// - // -
{ {
type: 'bar', type: 'bar',
barWidth: 10, // barWidth: 8, //
barGap: '60%', // barGap: '30%', //
data: values.map((val, index) => ({ data: values1.map((val, index) => ({
value: val, value: val,
itemStyle: { itemStyle: {
color: { color: {
@ -712,8 +712,8 @@ function updateChartCounty() {
// - // -
{ {
type: 'bar', type: 'bar',
barWidth: 10, // barWidth: 8, //
barGap: '60%', // barGap: '30%', //
data: values2.map((val, index) => ({ data: values2.map((val, index) => ({
value: val, value: val,
itemStyle: { itemStyle: {
@ -730,14 +730,14 @@ function updateChartCounty() {
z: 3 z: 3
}, },
// // //
{ {
type: 'pictorialBar', type: 'pictorialBar',
symbol: `image://${lqImg}`, symbol: `image://${lqImg}`,
symbolSize: [25, 25], // symbolSize: [25, 25], //
symbolOffset: [13, -7], // symbolOffset: [11, -4], //
symbolPosition: 'end', symbolPosition: 'end',
data: values, data: values1,
z: 4, z: 4,
silent: true silent: true
}, },
@ -747,7 +747,7 @@ function updateChartCounty() {
type: 'pictorialBar', type: 'pictorialBar',
symbol: `image://${lqImg}`, symbol: `image://${lqImg}`,
symbolSize: [25, 25], // symbolSize: [25, 25], //
symbolOffset: [13, 9], // symbolOffset: [13, 6], //
symbolPosition: 'end', symbolPosition: 'end',
data: values2, data: values2,
z: 5, z: 5,
@ -758,20 +758,23 @@ function updateChartCounty() {
{ {
type: 'bar', type: 'bar',
barWidth: 8, barWidth: 8,
data: values.map(() => maxVal), data: values1.map(() => maxVal.toFixed(1)),
itemStyle: { color: 'transparent' }, itemStyle: { color: 'transparent' },
label: { label: {
show: true, show: true,
position: 'right', position: 'right',
distance: 40, distance: 40,
fontSize: 18, // fontSize: 16, //
offset: [-20, -20], // offset: [-20, -20], //
align: 'left', align: 'left',
color: '#ffffff', color: '#ffffff',
formatter: (params) => { formatter: (params) => {
const value = values[params.dataIndex]; console.log("🚀 ~ updateChartCounty ~ params:", params)
const value1 = values1[params.dataIndex];
console.log("🚀 ~ updateChartCounty ~ value1:", value1)
const value2 = values2[params.dataIndex]; const value2 = values2[params.dataIndex];
return `{icon|} ${value.toFixed(1)} - ${value2.toFixed(2)}`; // console.log("🚀 ~ updateChartCounty ~ value2:", value2)
return `{icon|} ${value1.toFixed(1)} - ${value2.toFixed(1)}`; //
}, },
rich: { rich: {
icon: { icon: {
@ -784,55 +787,16 @@ function updateChartCounty() {
} }
} }
}, },
z: 7, z: 6,
silent: true silent: true
}, },
// -
// {
// type: 'bar',
// barWidth: 8,
// data: values2.map(() => maxVal),
// itemStyle: { color: 'transparent' },
// label: {
// show: true,
// position: 'right',
// distance: 40, //
// fontSize: 12, //
// offset: [0, -20], //
// align: 'left',
// color: '#ffffff',
// formatter: (params) => {
// const value = values2[params.dataIndex];
// return `{icon2|} ${value.toFixed(1)}`; //
// },
// rich: {
// icon2: {
// width: 12,
// height: 12,
// align: 'center',
// backgroundColor: {
// image: ljt
// }
// }
// }
// },
// z: 7,
// silent: true
// }
], ],
}, true); }, true);
// //
chartCounty.off('click'); chartCounty.off('click');
chartCounty.on('click', function(params) { chartCounty.on('click', function(params) {
if (params.seriesIndex === 1 || params.seriesIndex === 2) {
const clickedName = params.name;
const gsValue = values[params.dataIndex];
const hsValue = values2[params.dataIndex];
//
}
}); });
} }
// area-7 // area-7