From b0fdfa16c1409285097c73747fed9e2d44a966d2 Mon Sep 17 00:00:00 2001 From: lishenfeng Date: Mon, 24 Nov 2025 16:26:40 +0800 Subject: [PATCH] =?UTF-8?q?feat():=E7=BB=99=E6=B8=97=E5=8E=8B=E7=AE=A1?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=AE=A1=E5=8F=A3=E9=AB=98=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- manifest.json | 2 +- pages/aqjc/jrxOptions.js | 206 ++++++++++++++++++++++++++++++++------- pages/aqjc/pieMonth.js | 40 ++++++++ 3 files changed, 211 insertions(+), 37 deletions(-) create mode 100644 pages/aqjc/pieMonth.js diff --git a/manifest.json b/manifest.json index 204a807..6b2ef77 100644 --- a/manifest.json +++ b/manifest.json @@ -2,7 +2,7 @@ "name" : "檀树岗水库", "appid" : "__UNI__33ED56F", "description" : "", - "versionName" : "1.0.3", + "versionName" : "1.0.4", "versionCode" : 1, "transformPx" : false, "app-plus" : { diff --git a/pages/aqjc/jrxOptions.js b/pages/aqjc/jrxOptions.js index bff9de8..7692169 100644 --- a/pages/aqjc/jrxOptions.js +++ b/pages/aqjc/jrxOptions.js @@ -4,6 +4,7 @@ import imageUrl130 from './dataUrl1/zb130'; import imageUrl250 from './dataUrl1/zb250'; import imageUrl370 from './dataUrl1/zb370'; import imageUrl010 from './dataUrl1/fb010'; +import pieMonth from "./pieMonth"; export default function jrxOptions(data = {}, type = "1", typeName = '1') { @@ -62,39 +63,131 @@ export default function jrxOptions(data = {}, type = "1", typeName = '1') { : [] // gz1、gz2、gz3、gz4分别为渗压管 - const gz1 = data[alltype[0]] ? - type == "3" ? [[typeName =='6' ?57:52, typeName =='5' ?90.50:81.85], [typeName =='6' ?57:52, data[alltype[0]]]] : - type == "2" ? [[typeName =='3' ?50:55, typeName =='3' ?84.41:83.78], [typeName =='3' ?50:55, data[alltype[0]]]] : - type == "1" ? [[typeName =='1' ?49:57, typeName =='1' ?80.11:78.64], [typeName =='1' ?49:57, data[alltype[0]]]] : - [[62, typeName =='7'?109.08:108.77], [62, data[alltype[0]]]] - : []; + // const gz1 = data[alltype[0]] ? + // type == "3" ? [[typeName =='5' ?52:57, typeName =='5' ?90.50:81.85], [typeName =='5' ?52:57, data[alltype[0]]]] : + // type == "2" ? [[typeName =='3' ?50:55, typeName =='3' ?84.41:83.78], [typeName =='3' ?50:55, data[alltype[0]]]] : + // type == "1" ? [[typeName =='1' ?49:57, typeName =='1' ?80.11:78.64], [typeName =='1' ?49:57, data[alltype[0]]]] : + // [[62, typeName =='7'?109.08:108.77], [62, data[alltype[0]]]] + // : []; - const gz2 = data[alltype[1]] ? - type == "3" ? [[typeName =='6' ?71:57, typeName =='5' ?90.94:84.85], [typeName =='6' ?71:57, data[alltype[1]]]] : - type == "2" ? [[typeName =='3' ?55:68, typeName =='3' ?84.04:81.05], [typeName =='3' ?55:68, data[alltype[1]]]] : - type == "1" ? [[typeName =='1' ?57:67, typeName =='1' ?78.61:82.75], [typeName =='1' ?57:67, data[alltype[1]]]] : - [[72, typeName =='7'?109.32:109.36], [72, data[alltype[1]]]] : - []; + // const gz2 = data[alltype[1]] ? + // type == "3" ? [[typeName =='5' ?57:71, typeName =='5' ?90.94:84.85], [typeName =='5' ?57:71, data[alltype[1]]]] : + // type == "2" ? [[typeName =='3' ?55:68, typeName =='3' ?84.04:81.05], [typeName =='3' ?55:68, data[alltype[1]]]] : + // type == "1" ? [[typeName =='1' ?57:67, typeName =='1' ?78.61:82.75], [typeName =='1' ?57:67, data[alltype[1]]]] : + // [[72, typeName =='7'?109.32:109.36], [72, data[alltype[1]]]] : + // []; - const gz3 = data[alltype[2]] ? - type == "3" ? [[71, 92.65], [71, data[alltype[2]]]] : - type == "2" ? [[68, 83.93], [68, data[alltype[2]]]] : - type == "1" ? [[67, 81.38], [67, data[alltype[2]]]] : - [[87, typeName =='7'?109.01:108.87], [87, data[alltype[2]]]] : []; + // const gz3 = data[alltype[2]] ? + // type == "3" ? [[71, 92.65], [71, data[alltype[2]]]] : + // type == "2" ? [[68, 83.93], [68, data[alltype[2]]]] : + // type == "1" ? [[67, 81.38], [67, data[alltype[2]]]] : + // [[87, typeName =='7'?109.01:108.87], [87, data[alltype[2]]]] : []; - const gz4 = data[alltype[3]] ? - type == "3" ? [] : - type == "2" ? [[91,79.57], [91, data[alltype[3]]]] : - type == "1" ? [[89, 79.09], [89, data[alltype[3]]]] : - [[85, 166], [85, data[alltype[3]]]] : []; + // const gz4 = data[alltype[3]] ? + // type == "3" ? [] : + // type == "2" ? [[91,79.57], [91, data[alltype[3]]]] : + // type == "1" ? [[89, 79.09], [89, data[alltype[3]]]] : + // [[85, 166], [85, data[alltype[3]]]] : []; + + // 心墙中心两点(插入到连线中) + const xCenter = type === "3" ? 54 : (type === "2" ? 52.5: (type === "1" ? 53 : 60)); + // 简化规则:typeName 为 2/4/6 → 渗压管都在右侧;FB0+010/FB0+030(typeName 为 7/8)不绘制心墙连线 + const rightSideOnly = ['2', '4', '6'].includes(typeName); + const skipCenterLine = ['7', '8'].includes(typeName); + + // 左/右管取值(右侧优先 alltype[0],无则 alltype[1]) + const leftSyg = rightSideOnly ? undefined : data[alltype[0]]; + const rightSyg = rightSideOnly ? (data[alltype[0]] ?? data[alltype[1]]) : data[alltype[1]]; + + let midPts = []; + if (!skipCenterLine && data?.rz) { + if (leftSyg !== undefined && leftSyg !== null) { + const A = leftSyg - 1; + const B = (rightSyg !== undefined && rightSyg !== null) ? (rightSyg + 0.5) : undefined; + if (B !== undefined) { + if (A > B) { + midPts = [[xCenter, A], [xCenter, B]]; + } else { + midPts = [[xCenter, leftSyg], [xCenter, rightSyg]]; + } + } + } else if (rightSyg !== undefined && rightSyg !== null) { + // 左边无渗压管:第一个点为(X, 水位-1),第二个点为(X, 右管+0.5) + midPts = [[xCenter, data.rz - 1], [xCenter, rightSyg + 0.5]]; + } + } + // 管底高程 + const baseY1 = type == "3" ? (typeName =='5' ?90.50:81.85) + : type == "2" ? (typeName =='3' ?84.41:83.78) + : type == "1" ? (typeName =='1' ?80.11:78.64) + : (typeName =='7'?109.08:108.77); + + const baseY2 = type == "3" ? (typeName =='5' ?90.94:84.85) + : type == "2" ? (typeName =='3' ?84.04:81.05) + : type == "1" ? (typeName =='1' ?78.61:82.75) + : (typeName =='7'?109.32:109.36); + + const baseY3 = type == "3" ? 92.65 + : type == "2" ? 83.93 + : type == "1" ? 81.38 + : (typeName =='7'?109.01:108.87); + + const baseY4 = type == "3" ? null + : type == "2" ? 79.57 + : type == "1" ? 79.09 + : 166; + + + // 各管的 X(取你原来的 X) + const x1 = type == "3" ? (typeName =='5' ?52:57) + : type == "2" ? (typeName =='3' ? 50:55) + : type == "1" ? (typeName =='1' ?49:57) + : 60; + + const x2 = type == "3" ? (typeName =='5' ?57:71) + : type == "2" ? (typeName =='3' ?55:68) + : type == "1" ? (typeName =='1' ?57:69) + : 74; + + const x3 = type == "3" ? 71 + : type == "2" ? 68 + : type == "1" ? 69 + : 87; + + const x4 = type == "3" ? null + : type == "2" ? 91 + : type == "1" ? 92 + : 85; + + + // 管口高程(可能为空) + const mouth1 = pieMonth[alltype[0]]; + const mouth2 = pieMonth[alltype[1]]; + const mouth3 = pieMonth[alltype[2]]; + const mouth4 = pieMonth[alltype[3]]; + + // 蓝色段:从“管口(若有)/管底”到 UPD 值 + const gz1 = data[alltype[0]] ? [[x1, baseY1], [x1, data[alltype[0]]]] : []; + const gz2 = data[alltype[1]] ? [[x2, baseY2], [x2, data[alltype[1]]]] : []; + const gz3 = data[alltype[2]] ? [[x3, baseY3], [x3, data[alltype[2]]]] : []; + const gz4 = data[alltype[3]] && x4 !== null ? [[x4, baseY4], [x4, data[alltype[3]]]] : []; + + // 灰色段:从“管底”到“管口”(仅当 mouth 存在) + const gk1 = (mouth1 !== null && mouth1 !== undefined) ? [[x1, baseY1], [x1, mouth1]] : []; + const gk2 = (mouth2 !== null && mouth2 !== undefined) ? [[x2, baseY2], [x2, mouth2]] : []; + const gk3 = (mouth3 !== null && mouth3 !== undefined) ? [[x3, baseY3], [x3, mouth3]] : []; + const gk4 = (mouth4 !== null && mouth4 !== undefined && x4 !== null) ? [[x4, baseY4], [x4, mouth4]] : []; + // 将渗压管连起来的线 const line = data?.rz ? type == "3" ? [ [xValue, data?.rz], - [typeName =='6' ?57:52, data[alltype[0]]], + ...(rightSideOnly ? midPts : []), + [typeName == '6' ? 57 : 52, data[alltype[0]]], + ...(!rightSideOnly ? midPts : []), [typeName =='6' ?71:57, data[alltype[1]]], [71, data[alltype[2]]], @@ -102,23 +195,29 @@ export default function jrxOptions(data = {}, type = "1", typeName = '1') { type == "2" ? [ [xValue, data?.rz], - [typeName =='3' ?50:55, data[alltype[0]]], - [typeName =='3' ?55:68, data[alltype[1]]], + ...(rightSideOnly ? midPts : []), + [typeName == '3' ? 50 : 55, data[alltype[0]]], + ...(!rightSideOnly ? midPts : []), + [typeName =='3' ?55:69, data[alltype[1]]], [68, data[alltype[2]]], [91, data[alltype[3]]] ] : type == "1" ? [ [xValue, data?.rz], - [typeName =='1' ?49:57, data[alltype[0]]], - [typeName =='1' ?57:67, data[alltype[1]]], - [67, data[alltype[2]]], - [89, data[alltype[3]]] + ...(rightSideOnly ? midPts : []), + [typeName == '1' ? 49 : 57, data[alltype[0]]], + ...(!rightSideOnly ? midPts : []), + [typeName =='1' ?57:69, data[alltype[1]]], + [68, data[alltype[2]]], + [92, data[alltype[3]]] ] : [ [xValue, data?.rz], - [62, data[alltype[0]]], - [72, data[alltype[1]]], + ...(rightSideOnly ? midPts : []), + [60, data[alltype[0]]], + ...(!rightSideOnly ? midPts : []), + [74, data[alltype[1]]], [87, data[alltype[2]]], [85, data[alltype[3]]] ] @@ -255,7 +354,6 @@ export default function jrxOptions(data = {}, type = "1", typeName = '1') { color: 'rgba(0, 128, 255, 0.3)' // 设置区域填充颜色 }, data:[...rz, ...rz1] - }, { @@ -300,7 +398,43 @@ export default function jrxOptions(data = {}, type = "1", typeName = '1') { color: '#5487FF' }, data:rz1 - }, + }, + { + type: 'line', + symbol: 'none', + symbolSize: 10, + z: 1, + itemStyle: { color: 'rgba(154, 160, 166,.4)' }, + lineStyle: { color: 'rgba(154, 160, 166,.4)', width: 6 }, + data: gk1 + }, + { + type: 'line', + symbol: 'none', + symbolSize: 10, + z: 1, + itemStyle: { color: 'rgba(154, 160, 166,.4)' }, + lineStyle: { color: 'rgba(154, 160, 166,.4)', width: 6 }, + data: gk2 + }, + { + type: 'line', + symbol: 'none', + symbolSize: 10, + z: 1, + itemStyle: { color: 'rgba(154, 160, 166,.4)' }, + lineStyle: { color: 'rgba(154, 160, 166,.4)', width: 6 }, + data: gk3 + }, + { + type: 'line', + symbol: 'none', + symbolSize: 10, + z: 1, + itemStyle: { color: 'rgba(154, 160, 166,.4)' }, + lineStyle: { color: 'rgba(154, 160, 166,.4)', width: 6 }, + data: gk4 + }, // 管位 { type: 'line', @@ -364,15 +498,15 @@ export default function jrxOptions(data = {}, type = "1", typeName = '1') { symbol: 'none', symbolSize: 10, z: 1, - smooth: 0.6, // 设置平滑度 - smoothMonotone: 'x', // 保持 x 方向的单调性 + // smooth: 0.6, // 设置平滑度 + // smoothMonotone: 'x', // 保持 x 方向的单调性 itemStyle: { color: '#5487FF' }, lineStyle: { color: '#5487FF', width: 2, - curveness: 0.5 // 增加曲线程度 + // curveness: 0.5 // 增加曲线程度 }, data: filteredArray }, diff --git a/pages/aqjc/pieMonth.js b/pages/aqjc/pieMonth.js new file mode 100644 index 0000000..a8bf59b --- /dev/null +++ b/pages/aqjc/pieMonth.js @@ -0,0 +1,40 @@ +export default { + // ZB0+130 + UPD1: 113.66, + UPD4: 113.66, + UPD7: 105.07, + UPD16: 89.54, + + // ZB0+132 + UPD10: 113.66, + UPD13: 105.18, + + // ZB0+250 + UPD2: 113.98, + UPD5: 114.53, + UPD8: 104.45, + UPD17: 91.33, + + // ZB0+252 + UPD11: 114.36, + UPD14: 104.49, + + // ZB0+370 + UPD3: 114.12, + UPD6: 114.34, + UPD12: 104.52, + + // ZB0+372 + UPD9: 114.28, + UPD15: 105.16, + + // FB0+010 + UPD24: 114.32, + UPD26: 114.54, + UPD28: 112.28, + + // FB0+030 + UPD25: 114.32, + UPD27: 114.58, + UPD29: 112.28, +}; \ No newline at end of file