所属雨水分区:
@@ -115,23 +141,24 @@
const chartInfo2 = ref({
refresh: 1,
- // DataName: "",
- XAxis: [],
- typeName: '小时降雨量(mm)',
- typeName2: '水深(m)',
- YAxis: [],
- YAxis2: [],
+ DataName: "",
+ XAxis: ["1:00", "3:00", "5:00", "7:00", "9:00", "11:00", "13:00", "15:00", "17:00"],
+ typeName: "降雨量",
+ YAxis: [0, 1, 6, 3, 4],
loading: false,
- marklineJYL: [],
- marklineSS: [],
+ yAxisarr: [],
+ marklinearr: [],
});
-let isEchart = ref(false);
+
let loadingEchart = ref(false);
+const showecharts = ref(false);
function getDataEchart() {
+ showecharts.value = false;
loadingEchart.value = true;
let params = {
stType: props.Getproperties.stType,
stCode: props.Getproperties.stCode,
+ dataCode: props.Getproperties.dataCode,
// start:'2024-09-01 12:12:12',
// end:'2024-12-01 12:12:12',
// dataCode:'reservoir_info',
@@ -140,126 +167,32 @@
start: Timers.value[0],
end: Timers.value[1],
};
- console.log('params', params);
- getEchart(params).then(
- res => {
- isEchart.value = true;
+ console.log("params", params);
- let res1 = {
- code: 200,
- msg: '操作成功',
- data: {
- datas: [
- {
- dataKey: 'z',
- dataName: '黄海水位',
- unit: '(m)',
- datas: ['0', '0', '1', '0', '2', '0.5', '0', '0', '0', '0.2'],
- cordonLineList: [
- {
- id: '1856620587907244131',
- cordonId: '1856647503229968394',
- lineName: '正常蓄水位',
- lineValue: '1.3',
- lineType: '2',
- lineColor: 'rgba(0, 255, 68, 1)',
- systemDefault: '0',
- code: 'normal_water_level',
- stConfig: 'z',
- calcType: '2',
- relateRainSiteSt: '4201110002',
- },
- {
- id: '1856620587932409132',
- cordonId: '1856647503229968394',
- lineName: '设计洪水位',
- lineValue: '1.8',
- lineType: '1',
- lineColor: 'rgba(221, 255, 0, 1)',
- systemDefault: '0',
- code: 'design_flood_level',
- stConfig: 'z',
- calcType: '2',
- relateRainSiteSt: '4201110002',
- },
- {
- id: '1856620587936604135',
- cordonId: '1856647503229968394',
- lineName: '校核洪水位',
- lineValue: '1.98',
- lineType: '1',
- lineColor: 'rgba(255, 191, 0, 1)',
- systemDefault: '0',
- code: 'verify_flood_level',
- stConfig: 'z',
- calcType: '2',
- relateRainSiteSt: '4201110002',
- },
- {
- id: '1856620587936604134',
- cordonId: '1856647503229968394',
- lineName: '坝顶高程',
- lineValue: '2.8',
- lineType: '1',
- lineColor: 'rgba(255, 81, 0, 1)',
- systemDefault: '0',
- code: 'dam_hight',
- stConfig: 'z',
- calcType: '2',
- relateRainSiteSt: '4201110002',
- },
- ],
- },
- {
- dataKey: 'pn05',
- dataName: '降雨量',
- unit: 'mm',
- datas: ['10', '5', '11', '2', '2', '20', '15', '0', '0', '0.2'],
- cordonLineList: [],
- },
- ],
- times: [
- '1732291200000',
- '1732291200000',
- '1732291800000',
- '1732292100000',
- '1732292400000',
- '1732292700000',
- '1732293000000',
- '1732293300000',
- '1732293600000',
- '1732293900000',
- ],
- },
- };
- console.log('监测分析统计res', res);
+ getEchart(params).then(
+ (res) => {
+ showecharts.value = true;
loadingEchart.value = false;
- if (res && res.code == 200) {
- let data = res.data;
- let pn05Arr = data.datas.find(item => item.dataKey == 'pn05') || []; //降雨
- let zArr = data.datas.find(item => item.dataKey == 'z') || []; //水深
- if (pn05Arr) {
- chartInfo2.value.YAxis = pn05Arr.datas;
- chartInfo2.value.marklineJYL = pn05Arr.cordonLineList;
- }
- if (zArr) {
- chartInfo2.value.YAxis2 = zArr.datas;
- chartInfo2.value.marklineSS = zArr.cordonLineList;
- }
+ console.log(res.data);
+ chartInfo2.value.XAxis = res.data.times;
+ chartInfo2.value.yAxisarr = res.data.datas;
- chartInfo2.value.XAxis = data.times;
- // console.log('chartInfo2123', chartInfo2.value);
- chartInfo2.value.refresh = Math.random();
- }
+ res.data.datas.map((item) => {
+ chartInfo2.value.marklinearr.push(...item.cordonLineList);
+ });
+
+ console.log("chartInfo2.value.marklinearr", chartInfo2.value.marklinearr);
+
+ chartInfo2.value.refresh = Math.random();
},
- error => {
+ (error) => {
loadingEchart.value = false;
}
);
}
onMounted(() => {
- // getDataEchart()
+ getDataEchart()
gitDataFun();
});