|
|
@@ -369,13 +369,136 @@
|
|
369
|
369
|
</el-table>
|
|
370
|
370
|
</div>
|
|
371
|
371
|
</el-tab-pane>
|
|
|
372
|
+ <el-tab-pane :label="$t('reportforms.GridReport')" name="国网报表" v-if="BUTTONS.stategrid">
|
|
|
373
|
+ <div class="tabdiv">
|
|
|
374
|
+ <div class="tabpanesite">
|
|
|
375
|
+ <div class="tabpane">
|
|
|
376
|
+ <div class="tabpane_1">{{ $t("reportforms.selectsite") }}:</div>
|
|
|
377
|
+ <el-select
|
|
|
378
|
+ v-model="stategridSite"
|
|
|
379
|
+ :placeholder="$t('reportforms.selectsite')"
|
|
|
380
|
+ size="large"
|
|
|
381
|
+ style="width: 240px"
|
|
|
382
|
+ @change="postemsDevice"
|
|
|
383
|
+ >
|
|
|
384
|
+ <el-option v-for="item in cities" :key="item.id" :label="item.stationName" :value="item.id" />
|
|
|
385
|
+ </el-select>
|
|
|
386
|
+        
|
|
|
387
|
+ <div>{{ $t("reportforms.timeframe") }}:</div>
|
|
|
388
|
+ <div class="tabpane1">
|
|
|
389
|
+ <!-- year -->
|
|
|
390
|
+ <el-date-picker
|
|
|
391
|
+ v-if="timetype != 'year'"
|
|
|
392
|
+ v-model="StateGrid"
|
|
|
393
|
+ :type="timetype"
|
|
|
394
|
+ :shortcuts="shortcuts"
|
|
|
395
|
+ :format="format"
|
|
|
396
|
+ :value-format="format"
|
|
|
397
|
+ start-placeholder="开始时间"
|
|
|
398
|
+ end-placeholder="结束时间"
|
|
|
399
|
+ size="large"
|
|
|
400
|
+ :disabled-date="pickerOptions"
|
|
|
401
|
+ />
|
|
|
402
|
+ <el-date-picker
|
|
|
403
|
+ v-if="timetype == 'year'"
|
|
|
404
|
+ v-model="StateGrid"
|
|
|
405
|
+ type="yearrange"
|
|
|
406
|
+ :format="format"
|
|
|
407
|
+ :value-format="format"
|
|
|
408
|
+ :shortcuts="shortcuts"
|
|
|
409
|
+ start-placeholder="开始时间"
|
|
|
410
|
+ end-placeholder="结束时间"
|
|
|
411
|
+ size="large"
|
|
|
412
|
+ :disabled-date="pickerOptions"
|
|
|
413
|
+ />
|
|
|
414
|
+ <!-- <YearPicker
|
|
|
415
|
+ v-if="timetype == 'year'"
|
|
|
416
|
+ style="width: 300px"
|
|
|
417
|
+ ref="statisticPicker"
|
|
|
418
|
+ :label-width="50"
|
|
|
419
|
+ :shortcuts="shortcuts"
|
|
|
420
|
+ :init-year="dateValue"
|
|
|
421
|
+ :start-year1="timepicker[0]"
|
|
|
422
|
+ :end-year2="timepicker[1]"
|
|
|
423
|
+ @update-time-range="updateStatisticYear"
|
|
|
424
|
+ /> -->
|
|
|
425
|
+ <el-select
|
|
|
426
|
+ v-model="StateGriddate"
|
|
|
427
|
+ placeholder="选择日期"
|
|
|
428
|
+ size="large"
|
|
|
429
|
+ style="width: 80px"
|
|
|
430
|
+ @change="StateGridchange"
|
|
|
431
|
+ >
|
|
|
432
|
+ <el-option v-for="item in daymonthyear" :key="item.value" :label="item.label" :value="item.value" />
|
|
|
433
|
+ </el-select>
|
|
|
434
|
+ </div>
|
|
|
435
|
+   
|
|
|
436
|
+ <el-button type="primary" size="large" color="#0052d9" @click="gatstategridSummary">{{
|
|
|
437
|
+ $t("reportforms.Query")
|
|
|
438
|
+ }}</el-button>
|
|
|
439
|
+ <el-button size="large" @click="onstategridreset">{{ $t("reportforms.Reset") }}</el-button>
|
|
|
440
|
+ </div>
|
|
|
441
|
+
|
|
|
442
|
+ <div class="exportright" v-if="BUTTONS.export">
|
|
|
443
|
+ <el-dropdown trigger="click" :hide-on-click="false" @visible-change="onclose">
|
|
|
444
|
+ <el-button size="large" type="primary" plain>{{ $t("reportforms.export") }}</el-button>
|
|
|
445
|
+ <template #dropdown>
|
|
|
446
|
+ <el-dropdown-menu v-for="(item, index) in columnList" :key="index">
|
|
|
447
|
+ <el-dropdown-item>
|
|
|
448
|
+ <el-checkbox @change="oncheck" v-model="item.ifcolumn" :label="item.label" size="large" />
|
|
|
449
|
+ <template v-if="item.children">
|
|
|
450
|
+ <template v-for="(items, i) in item.children" :key="i">
|
|
|
451
|
+ <el-checkbox @change="onchildren" v-model="items.ifcolumn" :label="items.label" size="large" />
|
|
|
452
|
+ </template>
|
|
|
453
|
+ </template>
|
|
|
454
|
+ </el-dropdown-item>
|
|
|
455
|
+ </el-dropdown-menu>
|
|
|
456
|
+ <div class="dropdown">
|
|
|
457
|
+ <el-button @click="onexportstategrid" type="primary" plain>{{ $t("reportforms.export") }}</el-button>
|
|
|
458
|
+ </div>
|
|
|
459
|
+ </template>
|
|
|
460
|
+ </el-dropdown>
|
|
|
461
|
+ </div>
|
|
|
462
|
+ </div>
|
|
|
463
|
+   
|
|
|
464
|
+ <el-table :data="GridReportdata.list" style="width: 100%" align="center" :show-overflow-tooltip="true">
|
|
|
465
|
+ <!-- <el-table-column type="selection" width="55" /> -->
|
|
|
466
|
+ <template v-for="(item, index) in columnList" :key="index">
|
|
|
467
|
+ <el-table-column v-if="item.ifcolumn" :label="item.label" :prop="item.prop" align="center">
|
|
|
468
|
+ <template v-if="item.children">
|
|
|
469
|
+ <template v-for="(items, i) in item.children" :key="i">
|
|
|
470
|
+ <el-table-column v-if="items.ifcolumn" :label="items.label" :prop="items.prop" align="center">
|
|
|
471
|
+ </el-table-column>
|
|
|
472
|
+ </template>
|
|
|
473
|
+ </template>
|
|
|
474
|
+ </el-table-column>
|
|
|
475
|
+ </template>
|
|
|
476
|
+ <!-- <el-table-column prop="stationName" label="站点名称" width="150" align="center" />
|
|
|
477
|
+ <el-table-column label="充电量(kWh)" align="center">
|
|
|
478
|
+ <el-table-column prop="chargeSharp" label="尖" align="center" />
|
|
|
479
|
+ <el-table-column prop="chargePeak" label="峰" align="center" />
|
|
|
480
|
+ <el-table-column prop="chargeShoulder" label="平" align="center" />
|
|
|
481
|
+ <el-table-column prop="chargeValley" label="谷" align="center" />
|
|
|
482
|
+ <el-table-column prop="chargeTotal" label="总" align="center" />
|
|
|
483
|
+ </el-table-column>
|
|
|
484
|
+ <el-table-column label="放电量(kWh)" align="center">
|
|
|
485
|
+ <el-table-column prop="dischargeSharp" label="尖" align="center" />
|
|
|
486
|
+ <el-table-column prop="dischargePeak" label="峰" align="center" />
|
|
|
487
|
+ <el-table-column prop="dischargeShoulder" label="平" align="center" />
|
|
|
488
|
+ <el-table-column prop="dischargeValley" label="谷" align="center" />
|
|
|
489
|
+ <el-table-column prop="dischargeTotal" label="总" align="center" />
|
|
|
490
|
+ </el-table-column>
|
|
|
491
|
+ <el-table-column prop="overallEfficiency" label="综合效率(%)" width="150" align="center" /> -->
|
|
|
492
|
+ </el-table>
|
|
|
493
|
+ </div>
|
|
|
494
|
+ </el-tab-pane>
|
|
372
|
495
|
</el-tabs>
|
|
373
|
496
|
</el-card>
|
|
374
|
497
|
</div>
|
|
375
|
498
|
</template>
|
|
376
|
499
|
<!--
|
|
377
|
|
-
|
|
378
|
|
- -->
|
|
|
500
|
+
|
|
|
501
|
+-->
|
|
379
|
502
|
<script setup lang="ts">
|
|
380
|
503
|
import { onMounted, Ref, ref } from "vue";
|
|
381
|
504
|
import {
|
|
|
@@ -396,7 +519,13 @@ import {
|
|
396
|
519
|
betweenbiaoExcel,
|
|
397
|
520
|
betweenyearMonthExcel,
|
|
398
|
521
|
betweenyearExcel,
|
|
399
|
|
- selectemssytemNameURL
|
|
|
522
|
+ selectemssytemNameURL,
|
|
|
523
|
+ stategriddayURL,
|
|
|
524
|
+ stategridmonthURL,
|
|
|
525
|
+ stategridyearURL,
|
|
|
526
|
+ selectstartegridbetweenexcelday,
|
|
|
527
|
+ summaryearmonthEXcelURL,
|
|
|
528
|
+ summaryearEXcel
|
|
400
|
529
|
} from "@/api/home/Multisite";
|
|
401
|
530
|
import { useAuthButtons } from "@/hooks/useAuthButtons";
|
|
402
|
531
|
const { BUTTONS } = useAuthButtons();
|
|
|
@@ -559,12 +688,17 @@ const singlecolumnList = ref([
|
|
559
|
688
|
const currentDate = ref();
|
|
560
|
689
|
const activeName = ref("站点汇总");
|
|
561
|
690
|
const timepicker: Ref<any> = ref([]);
|
|
|
691
|
+const StateGrid: Ref<any> = ref([]); // 国网报表
|
|
562
|
692
|
//year daterange
|
|
563
|
693
|
const timetype: Ref<any> = ref("daterange");
|
|
564
|
694
|
const handleClick = async (val: any) => {
|
|
565
|
695
|
if (val.props.name == "站点汇总") {
|
|
566
|
696
|
getdaymonthyear(1);
|
|
567
|
697
|
gatSummary();
|
|
|
698
|
+ } else if (val.props.name == "国网报表") {
|
|
|
699
|
+ await poststationstationName();
|
|
|
700
|
+ await StateGridchange(1);
|
|
|
701
|
+ await gatstategridSummary();
|
|
568
|
702
|
} else {
|
|
569
|
703
|
await poststationstationName();
|
|
570
|
704
|
await onreportforms(2);
|
|
|
@@ -584,6 +718,7 @@ const pickerOptions = (time: { getTime: (arg0: Date) => number }) => {
|
|
584
|
718
|
// 选择日期
|
|
585
|
719
|
|
|
586
|
720
|
const daymonthyearvalue = ref(1);
|
|
|
721
|
+const StateGriddate = ref(1); // 国网报表
|
|
587
|
722
|
const daymonthyear = ref([
|
|
588
|
723
|
{
|
|
589
|
724
|
value: 1,
|
|
|
@@ -737,6 +872,115 @@ const getdaymonthyear = async (value: any) => {
|
|
737
|
872
|
// getreportpoweryear();
|
|
738
|
873
|
}
|
|
739
|
874
|
};
|
|
|
875
|
+const StateGridchange = async (value: any) => {
|
|
|
876
|
+ StateGriddate.value = value;
|
|
|
877
|
+ if (value == 1) {
|
|
|
878
|
+ timetype.value = "daterange";
|
|
|
879
|
+ format.value = "YYYY-MM-DD";
|
|
|
880
|
+ shortcuts.value = [
|
|
|
881
|
+ {
|
|
|
882
|
+ text: "过去7天",
|
|
|
883
|
+ value: () => {
|
|
|
884
|
+ const end = new Date();
|
|
|
885
|
+ const start = new Date();
|
|
|
886
|
+ start.setDate(start.getDate() - 7);
|
|
|
887
|
+ return [start, end];
|
|
|
888
|
+ }
|
|
|
889
|
+ },
|
|
|
890
|
+ {
|
|
|
891
|
+ text: "过去1个月",
|
|
|
892
|
+ value: () => {
|
|
|
893
|
+ const end = new Date();
|
|
|
894
|
+ const start = new Date();
|
|
|
895
|
+ start.setMonth(start.getMonth() - 1);
|
|
|
896
|
+ return [start, end];
|
|
|
897
|
+ }
|
|
|
898
|
+ },
|
|
|
899
|
+ {
|
|
|
900
|
+ text: "过去3个月",
|
|
|
901
|
+ value: () => {
|
|
|
902
|
+ const end = new Date();
|
|
|
903
|
+ const start = new Date();
|
|
|
904
|
+ start.setMonth(start.getMonth() - 3);
|
|
|
905
|
+ return [start, end];
|
|
|
906
|
+ }
|
|
|
907
|
+ }
|
|
|
908
|
+ ];
|
|
|
909
|
+ const today = new Date();
|
|
|
910
|
+ const currentDate = today.toISOString().split("T")[0];
|
|
|
911
|
+ StateGrid.value = [currentDate, currentDate];
|
|
|
912
|
+ // getreportpowerday();
|
|
|
913
|
+ } else if (value == 2) {
|
|
|
914
|
+ const today = new Date();
|
|
|
915
|
+ const currentDate = today.toISOString().split("T")[0];
|
|
|
916
|
+ const currentYearMonth = currentDate.slice(0, 7);
|
|
|
917
|
+
|
|
|
918
|
+ StateGrid.value = [currentYearMonth, currentYearMonth];
|
|
|
919
|
+ // getreportpoweryearMonth();
|
|
|
920
|
+ timetype.value = "monthrange";
|
|
|
921
|
+ format.value = "YYYY-MM";
|
|
|
922
|
+
|
|
|
923
|
+ shortcuts.value = [
|
|
|
924
|
+ {
|
|
|
925
|
+ text: "本月",
|
|
|
926
|
+ value: () => {
|
|
|
927
|
+ return [new Date(), new Date()];
|
|
|
928
|
+ }
|
|
|
929
|
+ },
|
|
|
930
|
+ {
|
|
|
931
|
+ text: "过去6个月",
|
|
|
932
|
+ value: () => {
|
|
|
933
|
+ const end = new Date();
|
|
|
934
|
+ const start = new Date();
|
|
|
935
|
+ start.setMonth(start.getMonth() - 6);
|
|
|
936
|
+ return [start, end];
|
|
|
937
|
+ }
|
|
|
938
|
+ },
|
|
|
939
|
+ {
|
|
|
940
|
+ text: "今年",
|
|
|
941
|
+ value: () => {
|
|
|
942
|
+ const end = new Date();
|
|
|
943
|
+ const start = new Date(new Date().getFullYear(), 0);
|
|
|
944
|
+ return [start, end];
|
|
|
945
|
+ }
|
|
|
946
|
+ }
|
|
|
947
|
+ ];
|
|
|
948
|
+ } else {
|
|
|
949
|
+ const today = new Date();
|
|
|
950
|
+ const currentDate = today.toISOString().split("T")[0];
|
|
|
951
|
+ // 获取去年同月的日期
|
|
|
952
|
+ StateGrid.value = [currentDate.substring(0, 4), currentDate.substring(0, 4)];
|
|
|
953
|
+ console.log(StateGrid.value);
|
|
|
954
|
+ timetype.value = "yearrange";
|
|
|
955
|
+ format.value = "YYYY";
|
|
|
956
|
+
|
|
|
957
|
+ shortcuts.value = [
|
|
|
958
|
+ {
|
|
|
959
|
+ text: "今年",
|
|
|
960
|
+ value: () => {
|
|
|
961
|
+ return [new Date(), new Date()];
|
|
|
962
|
+ }
|
|
|
963
|
+ },
|
|
|
964
|
+ {
|
|
|
965
|
+ text: "过去1年",
|
|
|
966
|
+ value: () => {
|
|
|
967
|
+ const end = new Date();
|
|
|
968
|
+ const start = new Date(new Date().setFullYear(new Date().getFullYear() - 1));
|
|
|
969
|
+ return [start, end];
|
|
|
970
|
+ }
|
|
|
971
|
+ },
|
|
|
972
|
+ {
|
|
|
973
|
+ text: "过去2年",
|
|
|
974
|
+ value: () => {
|
|
|
975
|
+ const start = new Date();
|
|
|
976
|
+ const end = new Date(new Date().setFullYear(new Date().getFullYear() - 2));
|
|
|
977
|
+ return [start, end];
|
|
|
978
|
+ }
|
|
|
979
|
+ }
|
|
|
980
|
+ ];
|
|
|
981
|
+ // getreportpoweryear();
|
|
|
982
|
+ }
|
|
|
983
|
+};
|
|
740
|
984
|
// 查询
|
|
741
|
985
|
const gatSummary = () => {
|
|
742
|
986
|
// getdaymonthyear(daymonthyearvalue.value);
|
|
|
@@ -748,10 +992,24 @@ const gatSummary = () => {
|
|
748
|
992
|
getreportpoweryear();
|
|
749
|
993
|
}
|
|
750
|
994
|
};
|
|
|
995
|
+// 国网查询
|
|
|
996
|
+const gatstategridSummary = () => {
|
|
|
997
|
+ if (StateGriddate.value == 1) {
|
|
|
998
|
+ getstategriddayURL();
|
|
|
999
|
+ } else if (StateGriddate.value == 2) {
|
|
|
1000
|
+ getstategridmonthURL();
|
|
|
1001
|
+ } else if (StateGriddate.value == 3) {
|
|
|
1002
|
+ getstategridyearURL();
|
|
|
1003
|
+ }
|
|
|
1004
|
+};
|
|
751
|
1005
|
// 重置
|
|
752
|
1006
|
const onreset = () => {
|
|
753
|
1007
|
getdaymonthyear(1);
|
|
754
|
1008
|
};
|
|
|
1009
|
+// 重置
|
|
|
1010
|
+const onstategridreset = () => {
|
|
|
1011
|
+ StateGridchange(1);
|
|
|
1012
|
+};
|
|
755
|
1013
|
const onclose = (val: boolean) => {
|
|
756
|
1014
|
console.log(val);
|
|
757
|
1015
|
setTimeout(() => {
|
|
|
@@ -949,6 +1207,83 @@ const downloadxlsx = (item: string, data: other.Data) => {
|
|
949
|
1207
|
console.error("下载文件时出错:", error);
|
|
950
|
1208
|
});
|
|
951
|
1209
|
};
|
|
|
1210
|
+// 国网导出
|
|
|
1211
|
+const onexportstategrid = async () => {
|
|
|
1212
|
+ let obj: string[] = []; // 假设 prop 是 string 类型,如果不是,请根据实际类型修改
|
|
|
1213
|
+
|
|
|
1214
|
+ if (columnList.value) {
|
|
|
1215
|
+ for (const column of columnList.value) {
|
|
|
1216
|
+ if (column?.ifcolumn) {
|
|
|
1217
|
+ if (column.prop) {
|
|
|
1218
|
+ obj.push(column.prop);
|
|
|
1219
|
+ }
|
|
|
1220
|
+ if (column.children) {
|
|
|
1221
|
+ for (const child of column.children) {
|
|
|
1222
|
+ if (child?.ifcolumn && child.prop) {
|
|
|
1223
|
+ obj.push(child.prop);
|
|
|
1224
|
+ }
|
|
|
1225
|
+ }
|
|
|
1226
|
+ }
|
|
|
1227
|
+ }
|
|
|
1228
|
+ }
|
|
|
1229
|
+ }
|
|
|
1230
|
+ const jsonString = obj.join(",");
|
|
|
1231
|
+
|
|
|
1232
|
+ if (StateGriddate.value == 1) {
|
|
|
1233
|
+ let obj = {
|
|
|
1234
|
+ excel: jsonString,
|
|
|
1235
|
+ startDate: StateGrid.value[0],
|
|
|
1236
|
+ endDate: StateGrid.value[1]
|
|
|
1237
|
+ };
|
|
|
1238
|
+ const { data } = await selectstartegridbetweenexcelday(obj, stategridSite.value);
|
|
|
1239
|
+ getdownloadxlsx(StateGrid.value[0], data);
|
|
|
1240
|
+ } else if (StateGriddate.value == 2) {
|
|
|
1241
|
+ let obj = {
|
|
|
1242
|
+ excel: jsonString,
|
|
|
1243
|
+
|
|
|
1244
|
+ startYearMonth: StateGrid.value[0],
|
|
|
1245
|
+ endYearMonth: StateGrid.value[1]
|
|
|
1246
|
+ };
|
|
|
1247
|
+ const { data } = await summaryearmonthEXcelURL(obj, stategridSite.value);
|
|
|
1248
|
+ getdownloadxlsx(StateGrid.value[0], data);
|
|
|
1249
|
+ } else if (StateGriddate.value == 3) {
|
|
|
1250
|
+ let obj = {
|
|
|
1251
|
+ excel: jsonString,
|
|
|
1252
|
+ startYear: StateGrid.value[0],
|
|
|
1253
|
+ endYear: StateGrid.value[1]
|
|
|
1254
|
+ };
|
|
|
1255
|
+ const { data } = await summaryearEXcel(obj, stategridSite.value);
|
|
|
1256
|
+ getdownloadxlsx(StateGrid.value[0] + "-" + StateGrid.value[1], data);
|
|
|
1257
|
+ }
|
|
|
1258
|
+};
|
|
|
1259
|
+const getdownloadxlsx = (item: string, data: other.Data) => {
|
|
|
1260
|
+ let fileUrl = `download/${data.msg}`;
|
|
|
1261
|
+ const date = new Date();
|
|
|
1262
|
+ const hours = formatTime(date.getHours());
|
|
|
1263
|
+ const minutes = formatTime(date.getMinutes());
|
|
|
1264
|
+ const seconds = formatTime(date.getSeconds());
|
|
|
1265
|
+ let fileName = `${item} ${hours}:${minutes}:${seconds}国网电量报表.xlsx`;
|
|
|
1266
|
+ fetch(fileUrl)
|
|
|
1267
|
+ .then(response => response.blob())
|
|
|
1268
|
+ .then(blob => {
|
|
|
1269
|
+ // 创建一个临时的URL对象
|
|
|
1270
|
+ const url = URL.createObjectURL(blob);
|
|
|
1271
|
+ // 创建一个隐藏的<a>标签,并设置其href属性为临时URL
|
|
|
1272
|
+ const a = document.createElement("a");
|
|
|
1273
|
+ a.href = url;
|
|
|
1274
|
+ a.download = fileName; // 设置下载的文件名
|
|
|
1275
|
+ a.style.display = "none";
|
|
|
1276
|
+ // 将<a>标签添加到文档中,并模拟点击下载
|
|
|
1277
|
+ document.body.appendChild(a);
|
|
|
1278
|
+ a.click();
|
|
|
1279
|
+ // 下载完成后,移除<a>标签和临时URL对象
|
|
|
1280
|
+ document.body.removeChild(a);
|
|
|
1281
|
+ URL.revokeObjectURL(url);
|
|
|
1282
|
+ })
|
|
|
1283
|
+ .catch(error => {
|
|
|
1284
|
+ console.error("下载文件时出错:", error);
|
|
|
1285
|
+ });
|
|
|
1286
|
+};
|
|
952
|
1287
|
const formatTime = (time: number) => {
|
|
953
|
1288
|
return time < 10 ? `0${time}` : time; // 如果时间小于 10,在前面加上 0
|
|
954
|
1289
|
};
|
|
|
@@ -1002,6 +1337,45 @@ const getreportpoweryear = async () => {
|
|
1002
|
1337
|
data.list.push(data.total);
|
|
1003
|
1338
|
tableData.value = data;
|
|
1004
|
1339
|
};
|
|
|
1340
|
+// 国网表格
|
|
|
1341
|
+const GridReportdata = ref();
|
|
|
1342
|
+// 日
|
|
|
1343
|
+const getstategriddayURL = async () => {
|
|
|
1344
|
+ let obj = {
|
|
|
1345
|
+ startDate: StateGrid.value[0],
|
|
|
1346
|
+ endDate: StateGrid.value[1]
|
|
|
1347
|
+ };
|
|
|
1348
|
+ const { data } = await stategriddayURL(obj, stategridSite.value);
|
|
|
1349
|
+ data.total.stationName = "总计";
|
|
|
1350
|
+
|
|
|
1351
|
+ data.list.push(data.total);
|
|
|
1352
|
+ GridReportdata.value = data;
|
|
|
1353
|
+};
|
|
|
1354
|
+// 月份
|
|
|
1355
|
+const getstategridmonthURL = async () => {
|
|
|
1356
|
+ let obj = {
|
|
|
1357
|
+ startYearMonth: StateGrid.value[0],
|
|
|
1358
|
+ endYearMonth: StateGrid.value[1]
|
|
|
1359
|
+ };
|
|
|
1360
|
+ const { data } = await stategridmonthURL(obj, stategridSite.value);
|
|
|
1361
|
+ data.total.stationName = "总计";
|
|
|
1362
|
+
|
|
|
1363
|
+ data.list.push(data.total);
|
|
|
1364
|
+ GridReportdata.value = data;
|
|
|
1365
|
+};
|
|
|
1366
|
+// 年份
|
|
|
1367
|
+const getstategridyearURL = async () => {
|
|
|
1368
|
+ let obj = {
|
|
|
1369
|
+ startYear: StateGrid.value[0],
|
|
|
1370
|
+ endYear: StateGrid.value[1]
|
|
|
1371
|
+ };
|
|
|
1372
|
+ const { data } = await stategridyearURL(obj, stategridSite.value);
|
|
|
1373
|
+ data.total.stationName = "总计";
|
|
|
1374
|
+
|
|
|
1375
|
+ data.list.push(data.total);
|
|
|
1376
|
+ GridReportdata.value = data;
|
|
|
1377
|
+};
|
|
|
1378
|
+
|
|
1005
|
1379
|
const reportformsindex = ref(2);
|
|
1006
|
1380
|
const pickertype: Ref<any> = ref("date");
|
|
1007
|
1381
|
|
|
|
@@ -1147,11 +1521,14 @@ const onchart = (val: any) => {
|
|
1147
|
1521
|
};
|
|
1148
|
1522
|
// 选择站点
|
|
1149
|
1523
|
const Singlevalue = ref("");
|
|
|
1524
|
+const stategridSite = ref("");
|
|
|
1525
|
+
|
|
1150
|
1526
|
const cities: Ref<Station.todo[]> = ref([]);
|
|
1151
|
1527
|
|
|
1152
|
1528
|
const poststationstationName = async () => {
|
|
1153
|
1529
|
const { data } = await stationstationName({});
|
|
1154
|
1530
|
Singlevalue.value = data[0].id;
|
|
|
1531
|
+ stategridSite.value = data[0].id;
|
|
1155
|
1532
|
cities.value = data;
|
|
1156
|
1533
|
return;
|
|
1157
|
1534
|
getemsSystemsingleStation();
|