feat():修正水资源调度图表y轴的最小值

qzc-dev
李神峰 2025-10-22 11:19:39 +08:00
parent dc6c9f5ef2
commit 3a0402d7aa
7 changed files with 10 additions and 11 deletions

View File

@ -7,7 +7,7 @@ const Tabledata = ({tableData}) => {
const columns = [ const columns = [
{ title: '序号', key: '', dataIndex: '', align: 'center',width:'40px',render:(a,b,c)=>c+1}, { title: '序号', key: '', dataIndex: '', align: 'center',width:'40px',render:(a,b,c)=>c+1},
{ title: '数据时间', key: 'createTime', dataIndex: 'createTime', align: 'center',width:'200px',render: (rec) => <span>{rec ?? "-"}</span> }, { title: '数据时间', key: 'createTime', dataIndex: 'createTime', align: 'center',width:'200px',render: (rec) => <span>{rec ?? "-"}</span> },
{ title: '湿度', key: 'val', dataIndex: 'val', align: 'center',render: (rec) => <span>{getVal(rec)}</span> }, { title: '湿度(%RH)', key: 'val', dataIndex: 'val', align: 'center',render: (rec) => <span>{getVal(rec)}</span> },
]; ];
const getVal = (v)=>{ const getVal = (v)=>{

View File

@ -3,7 +3,6 @@ import { useMemo } from 'react';
import echarts from 'echarts/lib/echarts'; import echarts from 'echarts/lib/echarts';
export default function DrpOption(data, num) { export default function DrpOption(data, num) {
console.log("num",num);
const minL = Math.floor(Math.min(...data?.map(s => s.q))); const minL = Math.floor(Math.min(...data?.map(s => s.q)));
const maxL = Math.ceil(Math.max(...data?.map(s => s.q))); const maxL = Math.ceil(Math.max(...data?.map(s => s.q)));
const minS = Math.floor(Math.min(...data?.map(s => s.v))); const minS = Math.floor(Math.min(...data?.map(s => s.v)));
@ -116,7 +115,7 @@ export default function DrpOption(data, num) {
axisTick: { axisTick: {
show: false, show: false,
}, },
min: minS - 1, min: minS,
max: maxS max: maxS
} }
], ],

View File

@ -51,7 +51,7 @@ const Page = () => {
<div className="home_gongshui_item_text" style={{display:'flex',flexDirection:'column'}}> <div className="home_gongshui_item_text" style={{display:'flex',flexDirection:'column'}}>
<div style={{display:'flex'}}> <div style={{display:'flex'}}>
<div className="lf">实时流量: </div> <div className="lf">实时流量: </div>
<div className="rf">{data1.q}</div> <div className="rf">{data1.q}/s</div>
</div> </div>
<div style={{marginBottom:'10px', display:'flex'}}> <div style={{marginBottom:'10px', display:'flex'}}>
{/* <div className="lf2" style={{color:'#70B603'}}></div> {/* <div className="lf2" style={{color:'#70B603'}}></div>
@ -64,7 +64,7 @@ const Page = () => {
</div> </div>
<div className="home_gongshui_item_text"> <div className="home_gongshui_item_text">
<div className="lf">今日水量: </div> <div className="lf">今日水量: </div>
<div className="rf">{data1.v}</div> <div className="rf">{data1.v}</div>
</div> </div>
</div> </div>
<div className="home_gongshui_item"> <div className="home_gongshui_item">
@ -75,7 +75,7 @@ const Page = () => {
<div className="home_gongshui_item_text" style={{display:'flex',flexDirection:'column'}}> <div className="home_gongshui_item_text" style={{display:'flex',flexDirection:'column'}}>
<div style={{display:'flex'}}> <div style={{display:'flex'}}>
<div className="lf">实时流量: </div> <div className="lf">实时流量: </div>
<div className="rf">{data2.q}</div> <div className="rf">{data2.q}/s</div>
</div> </div>
<div style={{marginBottom:'10px', display:'flex'}}> <div style={{marginBottom:'10px', display:'flex'}}>
{/* <div className="lf2" style={{color:'#70B603'}}></div> {/* <div className="lf2" style={{color:'#70B603'}}></div>
@ -88,7 +88,7 @@ const Page = () => {
</div> </div>
<div className="home_gongshui_item_text"> <div className="home_gongshui_item_text">
<div className="lf">今日水量: </div> <div className="lf">今日水量: </div>
<div className="rf">{data2.v}</div> <div className="rf">{data2.v}</div>
</div> </div>
</div> </div>
</div> </div>

View File

@ -10,7 +10,7 @@ const Page = () => {
const [ tableData, setTableData ] = useState([])//在线 const [ tableData, setTableData ] = useState([])//在线
const columns = [ const columns = [
{ title: '站点', key: 'stnm', dataIndex: 'stnm',align: "center",width:80, ellipsis: true, }, { title: '站点', key: 'stnm', dataIndex: 'stnm',align: "center",width:80, ellipsis: true, },
{ title: '湿度', key: 'val', dataIndex: 'val',align: "center",width:80, ellipsis: true,render:(v)=>typeof v ==='number'?v.toFixed(2):'' }, { title: '湿度(%RH)', key: 'val', dataIndex: 'val',align: "center",width:80, ellipsis: true,render:(v)=>typeof v ==='number'?v.toFixed(2):'' },
{ title: '监测时间', key: 'tm', dataIndex: 'tm',align: "center",width: 150, ellipsis: true }, { title: '监测时间', key: 'tm', dataIndex: 'tm',align: "center",width: 150, ellipsis: true },
]; ];

View File

@ -100,7 +100,7 @@ export default function drpOption (data) {
type: 'value', type: 'value',
// gridIndex:0, // gridIndex:0,
position: 'left', position: 'left',
// name: '水位(m)', name: '供水量(万m³)',
splitLine: { splitLine: {
show: true, show: true,
lineStyle: { lineStyle: {

View File

@ -67,7 +67,7 @@ return{
}, },
labelLine: { labelLine: {
normal: { normal: {
length: 80, length: 60,
// length2: 120, // length2: 120,
lineStyle: { lineStyle: {
color: "#e6e6e6", color: "#e6e6e6",

View File

@ -17,7 +17,7 @@ export default function Sjcx({ data }) {
const columns = [ const columns = [
{ title: '序号', key: '', dataIndex: '', align: 'center',width:'80px',render:(a,b,c)=>c+1}, { title: '序号', key: '', dataIndex: '', align: 'center',width:'80px',render:(a,b,c)=>c+1},
{ title: '数据时间', key: 'createTime', dataIndex: 'createTime', align: 'center',width:'200px',render: (rec) => <span>{rec ?? "-"}</span> }, { title: '数据时间', key: 'createTime', dataIndex: 'createTime', align: 'center',width:'200px',render: (rec) => <span>{rec ?? "-"}</span> },
{ title: '湿度', key: 'val', dataIndex: 'val', align: 'center',render: (rec) => <span>{rec ?? "-"}</span> }, { title: '湿度(%RH)', key: 'val', dataIndex: 'val', align: 'center',render: (rec) => <span>{rec ?? "-"}</span> },
]; ];