Browse Source

feat:统计分析和整编成果

master
waibao2 6 days ago
parent
commit
bed1631fa0
  1. 56
      src/components/ChartsBarLine/index.vue
  2. 3
      src/components/ESelectSingle/index.vue
  3. 36
      src/components/ETree/index.vue
  4. 43
      src/components/HistoryYOY/index.vue
  5. 110
      src/components/TimeCount/index.vue
  6. 8
      src/components/TimeProcess/index.vue
  7. 31
      src/components/YearEigenvalue/index.vue
  8. 744
      src/components/ZhengBian/index-qt.vue
  9. 800
      src/components/ZhengBian/index-yy.vue
  10. 131
      src/components/ZhengBian/index.vue
  11. 74
      src/config/stationConfig.js
  12. 1
      src/views/basic/sectionArea/index.vue
  13. 6
      src/views/basic/zbOpen/index.vue
  14. 36
      src/views/data/history/index.vue
  15. 156
      src/views/report/dzm/index.vue
  16. 162
      src/views/report/gzynjsldzb/index.vue
  17. 163
      src/views/report/gzynlldzb/index.vue
  18. 170
      src/views/report/gzynswdzb/index.vue
  19. 154
      src/views/report/gzyntidedzb/index.vue
  20. 133
      src/views/report/jslsmzflylb/index.vue
  21. 95
      src/views/report/reportll/index.vue
  22. 10
      src/views/report/reportrain/index.vue
  23. 2
      src/views/report/reporttide/index.vue
  24. 36
      src/views/report/reportwater/index.vue
  25. 187
      src/views/report/swpeak/index.vue
  26. 188
      src/views/report/swpeakmin/index.vue
  27. 163
      src/views/report/swswzylb/index.vue
  28. 404
      src/views/report/tide1/index.vue
  29. 6
      src/views/report/tide2/index.vue
  30. 7
      src/views/report/tide3/index.vue
  31. 16
      src/views/report/waterZl/index.vue
  32. 378
      src/views/report/zrll/index.vue
  33. 4
      src/views/report/zrsw/index.vue
  34. 8
      src/views/report/zrtide/index.vue
  35. 4
      src/views/statistic/qflow/qflow.vue
  36. 2
      src/views/statistic/qflow/qflowls.vue
  37. 4
      src/views/statistic/qflow/qflowsd.vue
  38. 7
      src/views/statistic/qflow/qflowtzz.vue
  39. 11
      src/views/statistic/river/river.vue
  40. 86
      src/views/statistic/river/river_main.vue
  41. 10
      src/views/statistic/river/riverls.vue
  42. 10
      src/views/statistic/river/riversd.vue
  43. 307
      src/views/statistic/river/rivertzz copy.vue
  44. 11
      src/views/statistic/river/rivertzz.vue
  45. 2
      src/views/statistic/rsvr/rsvrls.vue
  46. 2
      src/views/statistic/rsvr/rsvrsd.vue
  47. 4
      src/views/statistic/rsvr/rsvrtzz copy.vue
  48. 4
      src/views/statistic/rsvr/rsvrtzz.vue
  49. 4
      src/views/statistic/rsvr/sdrsvr.vue
  50. 11
      src/views/statistic/tide/tide.vue
  51. 86
      src/views/statistic/tide/tide_main.vue
  52. 10
      src/views/statistic/tide/tidels.vue
  53. 10
      src/views/statistic/tide/tidesd.vue
  54. 307
      src/views/statistic/tide/tidetzz copy.vue
  55. 11
      src/views/statistic/tide/tidetzz.vue
  56. 10
      src/views/zhengbian/qflow/index.vue
  57. 9
      src/views/zhengbian/river/index.vue
  58. 10
      src/views/zhengbian/tide/index.vue

56
src/components/ChartsBarLine/index.vue

@ -36,8 +36,8 @@ @@ -36,8 +36,8 @@
type: Object,
default: () => {
return {
left: '15%',
right: '15%',
left: '60',
right: '60',
bottom: "16%",
top: "16%",
containLabel: true,
@ -251,7 +251,7 @@ @@ -251,7 +251,7 @@
yAxis: [
{ // -
type: 'value',
name: '雨量 (mm)',
name: '雨量 (mm)',
inverse: true,
nameLocation: 'start',
axisLabel: { color: '#1075FD' },
@ -267,31 +267,31 @@ @@ -267,31 +267,31 @@
splitLine: getSplitLine(1),
},
],
dataZoom: [
{
type: 'inside', //
xAxisIndex: [0], // x
start: 0,
end: 100
},
{
type: 'slider', //
xAxisIndex: [0],
start: 0,
end: 100,
bottom: 50, //
height: 30, //
fillerColor: 'rgba(167,183,204,0.4)', //
borderColor: '#ddd',
textStyle: {
color: '#999'
},
handleSize: '100%', //
handleStyle: {
color: '#a7b7cc'
}
}
],
// dataZoom: [
// {
// type: 'inside', //
// xAxisIndex: [0], // x
// start: 0,
// end: 100
// },
// {
// type: 'slider', //
// xAxisIndex: [0],
// start: 0,
// end: 100,
// bottom: 50, //
// height: 30, //
// fillerColor: 'rgba(167,183,204,0.4)', //
// borderColor: '#ddd',
// textStyle: {
// color: '#999'
// },
// handleSize: '100%', //
// handleStyle: {
// color: '#a7b7cc'
// }
// }
// ],
series: series,
};

3
src/components/ESelectSingle/index.vue

@ -53,7 +53,8 @@ @@ -53,7 +53,8 @@
const getSingleStation = async () => {
emit('loadingChange', true);
try {
let res = await proxy.axiosGet(props.requestPrefix, { 'type': proxy.stationType, isState: '0' });
// let res = await proxy.axiosGet(props.requestPrefix, { 'type': proxy.stationType, isState: '0' });
let res = await proxy.axiosGet(props.requestPrefix, { 'type': proxy.stationType });
if (props.type == 'radio') {
options.value = res.data;

36
src/components/ETree/index.vue

@ -33,7 +33,14 @@ @@ -33,7 +33,14 @@
]
)
},
requestPrefix: {
type: String,
default: "/basic/stype/getTreeStationType/"
},
isAreaRain: {
type: Boolean,
default: false
}
})
// emit
@ -41,7 +48,7 @@ @@ -41,7 +48,7 @@
//
const dataType = ref(0) //
let url = '/basic/stype/getTreeStationType/' // URL
let url = props.requestPrefix // URL
const treeRef = ref()
const filterText = ref('')
@ -108,29 +115,34 @@ @@ -108,29 +115,34 @@
const getTreeStation = async () => {
treeLoading.value = true;
emit('loadingChange', true);
let requestUrl = props.isAreaRain ? url : (url + proxy.stationType);
try {
let res = await proxy.axiosGet(url + proxy.stationType);
let res = await proxy.axiosGet(requestUrl);
if (res.code == 0) {
treeData.value = res.data
defaultCheckedKeys.value = res.defaultOption || res.checkedList
defaultExpandedKeys.value = res.exList
await nextTick()
treeData.value = res.data;
defaultCheckedKeys.value = res.defaultOption || res.checkedList;
defaultExpandedKeys.value = res.exList || []; // 使
defaultExpandedKeys.value.unshift(treeData.value[0].id);
await nextTick(); // DOM
if (treeRef.value) {
treeRef.value.setExpandedKeys(defaultExpandedKeys.value)
treeRef.value.setExpandedKeys(defaultExpandedKeys.value);
}
emit('stationChange', defaultCheckedKeys.value)
emit('stationChange', defaultCheckedKeys.value);
}
} catch (error) {
console.error('获取树形数据失败:', error);
} finally {
emit('loadingChange', false);
treeLoading.value = false;
}
}
};
onMounted(() => {
getTreeStation()
})
defineExpose({
getTreeStation
})
</script>
<style scoped>

43
src/components/HistoryYOY/index.vue

@ -51,6 +51,8 @@ @@ -51,6 +51,8 @@
</el-table-column>
<el-table-column v-if="stationType != 'D' && stationType != 'E'" prop="nvalue" label="当前水位" :align="alignment">
</el-table-column>
<el-table-column v-if="stationType=='C'" prop="swValue" label="当前库容" :align="alignment">
</el-table-column>
<el-table-column v-if="stationType == 'E'" prop="nvalue" label="当前流量" :align="alignment">
</el-table-column>
<el-table-column v-if="stationType == 'D'" prop="value" label="平均潮位" :align="alignment">
@ -188,12 +190,23 @@ @@ -188,12 +190,23 @@
let data = res.data.list
let { avg, max, min, list } = res.data
tableData.value = data;
if (data && data.length > 0) {
stnm.value = `${data[0].stnm}${queryParams.startTime} ~ ${queryParams.endTime}${tablename.value}`
}
console.log(avg[0], avg[1], avg[2], avg[3])
// swValue
let swValues = list.filter(item => item.swValue !== undefined && item.swValue !== '').map(item => parseFloat(item.swValue));
let avgSwValue = swValues.length > 0 ? swValues.reduce((a, b) => a + b, 0) / swValues.length : "";
let maxSwItem = list.reduce((max, item) => {
if (item.swValue === undefined || item.swValue === '') return max;
let value = parseFloat(item.swValue);
return !max || value > parseFloat(max.swValue) ? item : max;
}, null);
let minSwItem = list.reduce((min, item) => {
if (item.swValue === undefined || item.swValue === '') return min;
let value = parseFloat(item.swValue);
return !min || value < parseFloat(min.swValue) ? item : min;
}, null);
tableData.value.push({
year: "平均",
swValue: parseInt(avgSwValue),
nvalue: (avg[0] == 0 ? "" : avg[0]),
value: (avg[1] == 0 ? "" : avg[1]),
maxvalue: (avg[2] == 0 ? "" : avg[2]),
@ -201,6 +214,7 @@ @@ -201,6 +214,7 @@
});
tableData.value.push({
year: "最高",
swValue: maxSwItem ? maxSwItem.swValue : "",
nvalue: (typeof (max[0].nvalue) == "undefined" ? "" : max[0].nvalue),
value: (typeof (max[1].value) == "undefined" ? "" : max[1].value),
maxvalue: (typeof (max[3].maxvalue) == "undefined" ? "" : max[3].maxvalue),
@ -208,6 +222,7 @@ @@ -208,6 +222,7 @@
});
tableData.value.push({
year: "时间",
swValue: maxSwItem ? maxSwItem.year : "",
nvalue: (typeof (max[0].year) == "undefined" ? "" : max[0].year),
value: (typeof (max[1].year) == "undefined" ? "" : max[1].year),
maxvalue: (proxy.parseTime(typeof (max[3].maxtm)) == "undefined" ? "" : proxy.parseTime(max[3].maxtm)),
@ -215,6 +230,7 @@ @@ -215,6 +230,7 @@
});
tableData.value.push({
year: "最低",
swValue: minSwItem ? minSwItem.swValue : "",
nvalue: (typeof (min[0].nvalue) == "undefined" ? "" : min[0].nvalue),
value: (typeof (min[1].value) == "undefined" ? "" : min[1].value),
maxvalue: (typeof (min[2].maxvalue) == "undefined" ? "" : min[2].maxvalue),
@ -222,6 +238,7 @@ @@ -222,6 +238,7 @@
});
tableData.value.push({
year: "时间",
swValue: minSwItem ? minSwItem.year : "",
nvalue: (typeof (min[0].year) == "undefined" ? "" : min[0].year),
value: (typeof (min[1].year) == "undefined" ? "" : min[1].year),
maxvalue: (proxy.parseTime(typeof (min[2].maxtm)) == "undefined" ? "" : proxy.parseTime(min[2].maxtm)),
@ -280,6 +297,7 @@ @@ -280,6 +297,7 @@
const firstLeafNode = findFirstLeafNode(treeSelectOptions.value);
if (firstLeafNode) {
queryParams.stnmId = firstLeafNode.stnmId;
stnm.value = `${firstLeafNode.name}${queryParams.startTime} ~ ${queryParams.endTime}${tablename.value}`;
nextTick(() => {
getList()
})
@ -320,11 +338,20 @@ @@ -320,11 +338,20 @@
const arraySpanMethod = ({ row, column, rowIndex, columnIndex }) => {
if (dataCount.value > 4) {
if (rowIndex > dataCount.value - 6) {
if (columnIndex === 3 || columnIndex === 5) {
return [1, 2];
} else if (columnIndex === 4 || columnIndex === 6) {
return [0, 0];
if (props.stationType == 'C') {
if (columnIndex === 4 || columnIndex === 6) {
return [1, 2];
} else if (columnIndex === 5 || columnIndex === 7) {
return [0, 0];
}
} else {
if (columnIndex === 3 || columnIndex === 5) {
return [1, 2];
} else if (columnIndex === 4 || columnIndex === 6) {
return [0, 0];
}
}
}
}
}

110
src/components/TimeCount/index.vue

@ -21,32 +21,83 @@ @@ -21,32 +21,83 @@
</pane>
<pane :size="100 - firstSize" style="height: 100%;">
<div class="main-table-header">
<div class="table-title">{{tableTitle}}</div>
<div class="table-title">{{tableHeaderName}}</div>
</div>
<div v-if="stationType == 'B'||stationType == 'C'" style="height: 100%;">
<el-table v-table-height v-loading="loading" :data="tableData" border>
<el-table-column v-if="rsvrsdFlag" prop="typename" label="类型" :align="alignment">
</el-table-column>
<el-table-column v-if="!rsvrsdFlag" prop="area" label="区域" :align="alignment">
</el-table-column>
<el-table-column prop="stnm" label="站名" :align="alignment" width="200">
</el-table-column>
<el-table-column prop="minvalue" label="当前水位" :align="alignment">
</el-table-column>
<el-table-column prop="value" label="平均水位" :align="alignment"></el-table-column>
<el-table-column label="最高水位" :align="alignment">
<el-table-column prop="maxvalue" label="水位" :align="alignment" width="80">
</el-table-column>
<el-table-column label="时间" :align="alignment" width="180" prop="maxtm"></el-table-column>
</el-table-column>
<el-table-column label="最低水位" :align="alignment">
<el-table-column prop="minvalue" label="水位" :align="alignment" width="80">
</el-table-column>
<el-table-column label="时间" :align="alignment" width="180" prop="mintm"></el-table-column>
</el-table-column>
<el-table-column label="高水持续时间(小时)" prop="cjjswtm" :align="alignment" v-if="stationType == 'C'">
</el-table-column>
<el-table-column label="高水持续时间(小时)" :align="alignment" v-if="stationType == 'B'">
<el-table-column prop="cbzswtm" label="超保证水位" :align="alignment" width="100">
</el-table-column>
<el-table-column prop="cjjswtm" label="超警戒水位" :align="alignment" width="100"></el-table-column>
</el-table-column>
<el-table-column prop="bzsw" label="保证水位" :align="alignment" v-if="stationType == 'B'"></el-table-column>
<el-table-column prop="jjsw" label="汛限水位" :align="alignment" ></el-table-column>
<el-table-column prop="lsmaxvalue" label="历史最高" :align="alignment">
</el-table-column>
</el-table>
</div>
<!-- 潮位 -->
<div v-if='stationType == "D"' style="height: 100%;">
<el-table v-table-height v-loading="loading" :data="tableData" border>
<el-table-column prop="stnm" label="站名" :align="alignment" width="200"></el-table-column>
<el-table-column prop="value" label="平均潮位" :align="alignment"></el-table-column>
<el-table-column label="最高水位" :align="alignment">
<el-table-column prop="maxvalue" label="潮位" :align="alignment" >
</el-table-column>
<el-table-column label="时间" :align="alignment" width="180" prop="maxtm"></el-table-column>
</el-table-column>
<el-table-column label="最低水位" :align="alignment">
<el-table-column prop="minvalue" label="潮位" :align="alignment" >
</el-table-column>
<el-table-column label="时间" :align="alignment" width="180" prop="mintm"></el-table-column>
</el-table-column>
<el-table-column prop="lsmaxvalue" label="历史最高" :align="alignment">
</el-table-column>
</el-table>
</div>
<!-- 流量 -->
<div v-if='stationType == "E"' style="height: 100%;">
<el-table v-table-height v-loading="loading" :data="tableData" border>
<el-table-column prop="stnm" label="站名" :align="alignment" width="200">
</el-table-column>
<el-table-column prop="value" label="平均流量" :align="alignment"></el-table-column>
<el-table-column label="最高流量" :align="alignment">
<el-table-column prop="maxvalue" label="流量" :align="alignment" >
</el-table-column>
<el-table-column label="时间" :align="alignment" width="180" prop="maxtm"></el-table-column>
</el-table-column>
<el-table-column label="最低流量" :align="alignment">
<el-table-column prop="minvalue" label="流量" :align="alignment" >
</el-table-column>
<el-table-column label="时间" :align="alignment" width="180" prop="mintm"></el-table-column>
</el-table-column>
<el-table-column prop="lsmaxvalue" label="历史最高" :align="alignment">
</el-table-column>
</el-table>
</div>
<el-table v-table-height v-loading="loading" :data="tableData" border>
<el-table-column v-if="rsvrsdFlag" prop="typename" label="类型" :align="alignment">
</el-table-column>
<el-table-column v-if="!rsvrsdFlag" prop="area" label="区域" :align="alignment">
</el-table-column>
<el-table-column prop="stnm" label="站名" :align="alignment" width="200">
</el-table-column>
<el-table-column prop="minvalue" label="当前水位" :align="alignment">
</el-table-column>
<el-table-column prop="value" label="平均水位" :align="alignment">
</el-table-column>
<el-table-column label="最高水位" :align="alignment">
<el-table-column prop="maxvalue" label="水位" :align="alignment" width="80">
</el-table-column>
<el-table-column label="时间" :align="alignment" width="180" prop="maxtm"></el-table-column>
</el-table-column>
<el-table-column label="最低水位" :align="alignment">
<el-table-column prop="minvalue" label="水位" :align="alignment" width="80">
</el-table-column>
<el-table-column label="时间" :align="alignment" width="180" prop="mintm"></el-table-column>
</el-table-column>
<el-table-column prop="lsmaxvalue" label="历史最高" :align="alignment">
</el-table-column>
</el-table>
</pane>
</splitpanes>
@ -71,6 +122,10 @@ @@ -71,6 +122,10 @@
requestPrefix: {
type: String,
default: ""
},
tableHeaderName: {
type: String,
default: '水位时段统计(m)'
}
})
const {
@ -87,7 +142,7 @@ @@ -87,7 +142,7 @@
case 'D':
return 'tide';
case 'E':
return 'q_qflow';
return 'qflow';
}
});
const alignment = 'center'
@ -133,8 +188,7 @@ @@ -133,8 +188,7 @@
(startTime && dayjs(time).isBefore(startTime));
};
const tableTitle = '水位时段统计(m)'
// stationType
// stationType
const rsvrsdFlag = computed(() => {
return props.stationType == 'C'
})

8
src/components/TimeProcess/index.vue

@ -32,13 +32,13 @@ @@ -32,13 +32,13 @@
</pane>
<pane size="50" class="mr10">
<div class="main-table-header">
<div class="table-title">{{tableTitle}}</div>
<div class="table-title">{{tableHeaderName}}</div>
<div class="table-time mb5">
<div>
<span>时间: </span><span id="title1">{{ tableTime}}</span>
</div>
<div>
<span>单位: </span><span id="title2">mm</span>
<span>单位: </span><span id="title2">m</span>
</div>
</div>
</div>
@ -70,9 +70,9 @@ @@ -70,9 +70,9 @@
type: String,
default: 'A'
},
tableTitle: {
tableHeaderName: {
type: String,
default: '表格标题'
default: '时段过程'
},
requestPrefix: {
type: String,

31
src/components/YearEigenvalue/index.vue

@ -13,8 +13,8 @@ @@ -13,8 +13,8 @@
<el-button type="primary" icon="Search" @click="handleQuery">查询</el-button>
</el-form-item>
<br />
<el-form-item label="报表排列方式(按站点)">
<el-radio-group v-model="direction" @change="getList">
<el-form-item label="报表排列方式(按站点)" style="margin-bottom: 0;">
<el-radio-group v-model="direction" @change="getList" class="pt10">
<el-radio label="zx">纵向</el-radio>
<el-radio label="hx">横向</el-radio>
</el-radio-group>
@ -27,10 +27,10 @@ @@ -27,10 +27,10 @@
</pane>
<pane :size="100 - firstSize">
<div class="main-table-header">
<div class="table-title">{{tableTitle}}</div>
<div class="table-title">{{tableHeaderName}}</div>
</div>
<el-table v-if="direction=='zx'" v-loading="loading" ref="myTable" :data="tableData" v-table-height="{bottom:90}" border :span-method="arraySpanMethod">
<el-table-column prop="station" label="站点" :align="alignment" ></el-table-column>
<el-table-column prop="station" label="站点" :align="alignment"></el-table-column>
<el-table-column prop="type" label="" :align="alignment"></el-table-column>
<el-table-column :align="alignment" :prop="item.prop" :label="item.label" v-for="(item, index) in tableColumns.filter(col => col.prop !== 'station' && col.prop !== 'type')" :key="index"></el-table-column>
</el-table>
@ -77,12 +77,16 @@ @@ -77,12 +77,16 @@
type: String,
default: ""
},
tableHeaderName: {
type: String,
default: "年特征值表"
}
})
const { proxy } = getCurrentInstance()
const alignment = 'center'
let direction = ref('zx')
const eTreeRef = ref(null)
const tableTitle = '水位年特征值表(m)'
let stnmIdsList = []
//
const handleStationChange = (stnmIds) => {
@ -130,6 +134,16 @@ @@ -130,6 +134,16 @@
loading.value = false
}
}
const typeName = computed(() => {
switch (props.stationType) {
case 'D':
return '潮位';
case 'E':
return '流量';
default:
return '水位';
}
});
// getZXTableData
const getZXTableData = (res) => {
let { year, list, name } = res.data;
@ -161,7 +175,7 @@ @@ -161,7 +175,7 @@
//
const row1 = {
station: name[index],
type: "平均水位"
type: `平均${typeName.value}`
};
year.forEach((y, yIndex) => {
@ -171,7 +185,7 @@ @@ -171,7 +185,7 @@
//
const row2 = {
station: name[index],
type: "最高水位"
type: `最高${typeName.value}`
};
year.forEach((y, yIndex) => {
@ -192,7 +206,7 @@ @@ -192,7 +206,7 @@
//
const row4 = {
station: name[index],
type: "最低水位"
type: `最低${typeName.value}`
};
year.forEach((y, yIndex) => {
@ -220,6 +234,7 @@ @@ -220,6 +234,7 @@
// tableData
tableData.value = processedData;
}
const getHXTableData = (res) => {
const { year, list, name, } = res.data;

744
src/components/ZhengBian/index-qt.vue

@ -0,0 +1,744 @@ @@ -0,0 +1,744 @@
<template>
<div class="app-container app-container-bg">
<el-card class="first-card" ref='firstCard' shadow="always">
<el-form :model="queryParams" ref="queryForm" :inline="true" @submit.native.prevent>
<el-form-item label="站点">
<ESelectSingle ref="eSelectSingle" :type="'multiple'" :stationType="stationType" :defaultProps="defaultProps" :requestPrefix="requestPrefix" @stationChange="handleStationChange" @loadingChange="handleStationLoading" />
<!-- <el-cascader v-model="defaultOption" placeholder="请选择站点" :options="selectOptions" style="width: 250px;" filterable clearable @change='changeCascader'></el-cascader> -->
</el-form-item>
<el-form-item label="开始时间">
<el-date-picker v-model="queryParams.startTime" type="datetime" value-format="YYYY-MM-DD HH:mm:ss" format="YYYY-MM-DD HH:mm:ss" placeholder="选择开始时间" :disabled-date="disabledStartDate">
</el-date-picker>
</el-form-item>
<el-form-item label="结束时间">
<el-date-picker v-model="queryParams.endTime" type="datetime" value-format="YYYY-MM-DD HH:mm:ss" placeholder="选择结束时间" :disabled-date="disabledEndDate">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-checkbox v-model="queryParams.xindao" @change='handleQuery' :true-label="1" :false-label="0">遥测数据</el-checkbox>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">查询</el-button>
<el-switch class="ml20" v-model="staticType" @change='changeStaticType' size="large" inline-prompt style="--el-switch-on-color: #13ce66; --el-switch-off-color: #1890FF" active-text="逐日显示" active-value="1" inactive-value="0" inactive-text="逐时显示" />
</el-form-item>
<el-form-item v-if="staticType==1">
<div style="font-size: 12px;color:#ccc">
逐日天表统计的是当日早八点到次日早八点
</div>
</el-form-item>
<br />
<el-form-item label="对比站点">
<el-select-v2 collapse-tags multiple filterable clearable v-model="compareStation" @change="changeCompareStnmIds" :options="stationOptions" :props="defaultProps" placeholder="请选择对比测站名称" style="width: 360px" />
</el-form-item>
<el-form-item>
<el-button type="primary" @click="compareQuery" icon="Search">对比查询</el-button>
<el-button type="success" plain icon="Edit" @click="updateData">数据修改</el-button>
</el-form-item>
</el-form>
</el-card>
<splitpanes v-loading="fullscreenLoading" element-loading-text="正在加载页面......" :horizontal="device === 'mobile'" class="el-card-p card-shadow carder-border mt10 pad10 default-theme container-box" :push-other-panes="false">
<pane :size="firstSize" :min-size="SPLITPANES_CONFIG.MIN_SIZE" max-size="40" ref="firstPane" class="mr10">
<el-collapse v-model="activeName" accordion @change="handleChangeCollapse">
<el-collapse-item title="预处理数据" name="1">
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="warning" plain icon="Download" @click="yclExport">导出 </el-button>
</el-col>
<el-col :span="1.5">
<el-button type="success" plain icon="RefreshRight" @click="yclUpdate"> 整编 </el-button>
</el-col>
</el-row>
<div class="pad5" style="font-size: 12px;color:#ccc">点击数值行修改数据</div>
<vxe-grid ref="gridRef1" v-bind="gridOptions1"></vxe-grid>
</el-collapse-item>
<el-collapse-item :title="stationType==='A'?'小时数据':'摘录数据'" name="2">
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="warning" plain icon="Download" @click="hourExport">导出 </el-button>
</el-col>
</el-row>
<vxe-grid v-bind="gridOptions2"></vxe-grid>
</el-collapse-item>
<el-collapse-item title="遥测数据" name="3">
<vxe-grid v-bind="gridOptions3"></vxe-grid>
</el-collapse-item>
</el-collapse>
</pane>
<pane :size="100 - firstSize">
<div v-table-height='{bottom:0}' style="width:100%;">
<TimeBarChart v-if="stationType !== 'A' && staticType == '1'" v-loading="echartsLoading" :timeType="timeType" :legendData='legendData' :xAxisData="xAxisData" :seriesData="seriesData" :textTitle="textTitle" :unit="unit" :baseOptionData='baseOptionData' :key="`${staticType}-${props.stationType}`" :fixed="fixed" />
<DataZoomChart v-else v-loading="echartsLoading" :timeType="timeType" :legendData='legendData' :xAxisData="xAxisData" :seriesData="seriesData" :textTitle="textTitle" :unit="unit" :echartType="echartType" :key="`${staticType}-${props.stationType}`" />
</div>
</pane>
</splitpanes>
<!-- :rules="rules" -->
<el-dialog class="custom-dialog" title="数据修改" v-model="open" width="500px" append-to-body>
<el-form ref="formRef" :model="form" label-width="150">
<el-form-item label="修改方式" prop="updateType">
<el-select v-model="form.updateType" placeholder="请选择修改方式">
<el-option v-for="dict in update_type_options" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
</el-select>
</el-form-item>
<el-form-item label="开始时间" prop="startTime" v-if="form.updateType!='2'&&form.updateType!=null">
<el-date-picker v-model="form.startTime" type="datetime" placeholder="选择开始时间" value-format="YYYY-MM-DD HH:mm:ss" format="YYYY-MM-DD HH:mm:ss">
</el-date-picker>
</el-form-item>
<el-form-item label="结束时间" prop="endTime" v-if="form.updateType!='2'&&form.updateType!=null">
<el-date-picker v-model="form.endTime" type="datetime" placeholder="选择结束时间" value-format="YYYY-MM-DD HH:mm:ss" format="YYYY-MM-DD HH:mm:ss">
</el-date-picker>
</el-form-item>
<el-form-item label="替换值" prop="value1" v-if="form.updateType=='1'">
<el-input v-model="form.value1" placeholder="请输入替换值" style="width:220px" />
</el-form-item>
<div style="width:80%;margin: 0 auto;" v-if="form.updateType=='2'">
<el-upload class="upload-demo" drag :headers="headers" :action='uploadUrl' :on-success="handleFileSuccess" accept=".xls, .xlsx" multiple>
<el-icon class="el-icon--upload"><upload-filled /></el-icon>
<div class="el-upload__text">
将文件拖到此处<em>点击上传</em>
</div>
<template #tip>
<div class="el-upload__tip ">
模板就是预处理数据表格导出的文件
</div>
</template>
</el-upload>
</div>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="submitForm(formRef)" v-loading='btnLoading'> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script setup>
import dayjs from 'dayjs';
import {
Splitpanes,
Pane
} from 'splitpanes'
import 'splitpanes/dist/splitpanes.css'
import DataZoomChart from '@/components/ChartsDataZoom/index.vue'
import TimeBarChart from '@/components/ChartsTimeLine/index.vue'
import ESelectSingle from '@/components/ESelectSingle/index.vue'
import { getToken } from "@/utils/auth";
import useAppStore from '@/store/modules/app'
const device = computed(() => useAppStore().device);
const props = defineProps({
stationType: {
type: String,
default: 'A'
},
requestPrefix: {
type: String,
default: '/ycraindata'
},
fixed: {
type: Number,
default: 1
}
})
const {
proxy
} = getCurrentInstance()
// const { update_type_options } = proxy.useDict("update_type_options")
// update_type_options
const update_type_options = computed(() => {
let options = [
{
value: '0',
label: '对比站点替换'
},
{
value: '1',
label: '手动替换'
},
{
value: '2',
label: 'excel导入'
},
{
value: '3',
label: '副设备数据替换'
},
{
value: '5',
label: '重新整编'
}
];
// requestPrefix '/ycraindata' 线
if (props.requestPrefix !== '/ycraindata') {
options.splice(4, 0, {
value: '4',
label: '直线插补'
});
}
return options;
});
const textTitle = computed(() => {
switch (props.stationType) {
case 'A':
return '雨量过程线';
case 'B':
return '水位过程线';
case 'C':
return '水位过程线';
case 'D':
return '潮位过程线';
case 'E':
return '流量过程线';
}
});
const unit = computed(() => {
switch (props.stationType) {
case 'A':
return 'mm';
case 'B':
return 'm';
case 'C':
return 'm';
case 'D':
return 'm';
case 'E':
return 'm³/s';
}
});
const echartType = computed(() => {
switch (props.stationType) {
case 'A':
return 'bar';
case 'B':
return 'line';
case 'C':
return 'line';
case 'D':
return 'line';
case 'E':
return 'line';
}
});
const defaultProps = {
label: 'name',
value: 'stnmId',
}
const staticType = ref('0')
const queryParams = reactive({
startTime: dayjs().subtract(7, 'day').format('YYYY-MM-DD 08:00:00'),
endTime: dayjs().format('YYYY-MM-DD 08:00:00'),
xindao: 1,
stnm: null,
stnmId: null,
stnmIds: null,
dataType: staticType.value,
chartType: echartType.value
});
const timeType = computed(() => {
return staticType.value == '0' ? 'hour' : "day"
})
// 15
const disabledStartDate = (time) => {
const endTime = queryParams.endTime ? dayjs(queryParams.endTime) : null;
const maxStartTime = endTime ? endTime.subtract(15, 'day') : null;
return dayjs(time).isAfter(dayjs()) || //
(endTime && dayjs(time).isAfter(endTime)) // 15
};
// 15
const disabledEndDate = (time) => {
const startTime = queryParams.startTime ? dayjs(queryParams.startTime) : null;
const maxEndTime = startTime ? startTime.add(15, 'day') : null;
return dayjs(time).isAfter(dayjs()) || //
(startTime && dayjs(time).isBefore(startTime)) || //
(startTime && dayjs(time).isAfter(maxEndTime)); // 15
};
//
const selectOptions = ref([]);
const selectOptions2 = ref([]);
const defaultOption = ref([])
const defaultOption2 = ref([])
const fullscreenLoading = ref(false)
let requestPrefix = '/basic/stype/getNewTreeStationType/'
const eSelectSingle = ref(null)
const handleStationLoading = (loadingState) => {
fullscreenLoading.value = loadingState;
}
const stationOptions = ref([])
let uploadUrl = ref(null)
// :stnmId:ID,options:options,stnm:
const handleStationChange = async (stnmId, options, stnm) => {
queryParams.stnmId = stnmId
queryParams.stnm = stnm
queryParams.stnmIds = stnmId
const data = options.filter(item => item.stnmId != stnmId)
// const data = options
stationOptions.value = data
if (stnmId == undefined) {
proxy.$modal.msgWarning("请选择站点后查询");
return
} else {
uploadUrl = `${import.meta.env.VUE_APP_BASE_API}${props.requestPrefix}/updatedatabyexcel?stnmId=${queryParams.stnmId}&stationType=${props.stationType}&ycMethod=2`
try {
await Promise.all([
drawTable1(),
drawTable2(),
drawTable3(),
getEchartsData()
]);
} catch (error) {
console.error('请求执行出错:', error);
}
}
}
const getSingleStation = async () => {
fullscreenLoading.value = true
// /basic/stype/getTreeStation2New/
// /basic/stype/getTreeStation/
// /basic/stype/getNewTreeStationType/
try {
let url = '/basic/stype/getTreeStation/'
let res = await proxy.axiosGet(url + props.stationType);
if (res.code === 0) {
selectOptions.value = res.data;
defaultOption.value = res.defaultOption
queryParams.stnmId = defaultOption.value.length > 0 ? parseInt(defaultOption.value[2]) : null
queryParams.stnmIds = queryParams.stnmId
await Promise.all([
drawTable1(),
drawTable2(),
drawTable3(),
getEchartsData()
]);
}
} catch (error) {
console.error('请求执行出错:', error);
} finally {
fullscreenLoading.value = false
}
}
//
const changeCascader = (val) => {
defaultOption.value = val
queryParams.stnmId = defaultOption.value.length > 0 ? parseInt(defaultOption.value[2]) : null
queryParams.stnmIds = queryParams.stnmId
handleQuery()
}
const firstSize = ref(proxy.SPLITPANES_CONFIG.DEFAULT_SIZE)
const activeName = ref('1')
const tableData1 = ref([])
const tableData2 = ref([])
const tableData3 = ref([])
//
const handleChangeCollapse = (val) => { }
//
const baseGridOptions = {
border: true,
loading: false,
showOverflow: false,
height: 500,
columnConfig: {
resizable: true
},
virtualYConfig: {
enabled: true,
gt: 0
},
rowStyle({ rowIndex, row }) {
if (row.status == '30' || row.status == '31') {
return {
color: '#f00'
}
}
},
}
// script setup watch vxe-grid edit-closed
const handleCellValueChange = ({ row, column }) => {
if (column.field === 'value') {
const index = yclUpdateTime.value.indexOf(row.tm);
if (index > -1) {
//
yclUpdateValue.value[index] = row.value;
} else {
//
yclUpdateTime.value.push(row.tm);
yclUpdateValue.value.push(row.value);
}
}
};
//
const gridOptions1 = reactive({
...baseGridOptions,
editConfig: {
trigger: 'click',
mode: 'row'
},
columns: [{
title: '时间',
field: 'tm',
width: 160,
align: "center"
},
{
title: '数值',
field: 'value',
align: "center",
editRender: { name: 'VxeNumberInput', props: { type: 'float', digits: props.fixed, min: 0 } }
}
],
data: [],
onEditClosed: handleCellValueChange
})
//
const drawTable1 = async () => {
gridOptions1.loading = true
try {
let url = props.requestPrefix + '/originaldata'
let res = await proxy.axiosPost2(url, queryParams);
if (res.code === 0) {
let data = res.data;
data.forEach(item => {
item.value = item.value.toFixed(props.fixed)
});
gridOptions1.data = data
}
} catch (error) {
} finally {
gridOptions1.loading = false
}
}
// /
const gridOptions2 = reactive({
...baseGridOptions,
columns: [{
title: '时间',
field: 'tm',
width: 160,
align: "center"
},
{
title: '数值',
field: 'value',
align: "center"
}
],
data: []
})
//
const drawTable2 = async () => {
gridOptions2.loading = true
try {
let url = props.requestPrefix + '/countdata'
let res = await proxy.axiosPost2(url, queryParams);
if (res.code === 0) {
let data = res.data;
gridOptions2.data = data
}
gridOptions2.loading = false
} catch (error) {
gridOptions2.loading = false
}
}
//
const gridOptions3 = reactive({
...baseGridOptions,
columns: [],
data: []
})
//
const drawTable3 = async () => {
gridOptions3.loading = true
try {
let url = props.requestPrefix + '/xindaodaydata'
let res = await proxy.axiosPost2(url, queryParams);
if (res.code === 0) {
let data = res.data;
let header = data[0];
let tableColumn = []
tableColumn.push({
field: 'tm',
title: '时间',
width: 160,
align: "center"
});
for (let k in header) {
if (k != 'tm' && k != 'avg') {
tableColumn.push({
field: k,
title: k,
// width: 100,
align: "center"
});
}
}
gridOptions3.columns = tableColumn;
gridOptions3.data = data
}
gridOptions3.loading = false
} catch (error) {
gridOptions3.loading = false
}
}
// echarts
const legendData = ref([])
const xAxisData = ref([])
const seriesData = ref([])
const baseOptionData = ref([])
const echartsLoading = ref(false)
const getEchartsData = async () => {
legendData.value = []
seriesData.value = []
baseOptionData.value = []
xAxisData.value = []
echartsLoading.value = true
let baseUrl = '/chartdata'
if (staticType.value == '1' && props.stationType != 'A') {
baseUrl = "/chartdatabyday";
}
try {
let url = props.requestPrefix + baseUrl
let res = await proxy.axiosPost2(url, queryParams);
if (res.code === 0) {
legendData.value = res.data.legend
if (props.stationType !== 'A' && staticType.value == '1') {
seriesData.value = res.data.data
baseOptionData.value = res.data.baseOptionData
xAxisData.value = ['08:00', '09:00', '10:00', '11:00', '12:00', '13:00', '14:00', '15:00', '16:00', '17:00', '18:00', '19:00', '20:00', '21:00', '22:00', '23:00', '00:00', '01:00', '02:00', '03:00', '04:00', '05:00', '06:00', '07:00', '08:00']
console.log(props.stationType, staticType.value,)
console.log('seriesData.value', seriesData.value)
console.log('baseOptionData.value', baseOptionData.value)
console.log('xAxisData.value', xAxisData.value)
} else {
// seriesdata
if (res.data.series && res.data.series.length > 0) {
// seriesdata
xAxisData.value = res.data.series[0].data.map(item => {
// item
if (typeof item === 'object' && item !== null) {
// tm, time, or the first element
const timeValue = item.tm || item.time || item[0];
return dayjs(timeValue).format('YYYY-MM-DD HH:mm');
} else {
// item
return dayjs(item).format('YYYY-MM-DD HH:mm');
}
});
}
seriesData.value = res.data.series
}
}
} catch (error) {
console.log(error)
} finally {
echartsLoading.value = false
}
};
watch(staticType.value, (newVal, oldVal) => {
if (oldVal !== undefined) { //
// dataType
queryParams.dataType = newVal
//
getEchartsData()
}
})
//
const yclExport = () => {
let url = `${props.requestPrefix}/exportoriginaldata?stnmId=${queryParams.stnmId}&startTime=${queryParams.startTime}&endTime=${queryParams.endTime}`
proxy.download(url, {}, `${queryParams.stnm}${textTitle.value}原始数据.xls`);
}
let yclUpdateTime = ref([])
let yclUpdateValue = ref([])
//
const yclUpdate = async () => {
if (yclUpdateTime.value.length == 0) {
proxy.$modal.msg("请修改后再进行整编");
return;
}
let url = props.requestPrefix + "/updateycldata";
let params = queryParams;
params.times = yclUpdateTime.value.join(",");
params.values = yclUpdateValue.value.join(",");
fullscreenLoading.value = true;
try {
let res = await proxy.axiosPost2(url, params);
if (res.code == 0) {
proxy.$modal.msgSuccess("执行成功");
yclUpdateTime.value = [];
yclUpdateValue.value = [];
handleQuery()
}
} catch (error) {
} finally {
fullscreenLoading.value = false;
}
}
//
const hourExport = () => {
let exName = staticType.value == 0 ? "摘录数据(时).xls" : "摘录数据(日).xls"
let url = `${props.requestPrefix}/exportcountdata?stnmId=${queryParams.stnmId}&startTime=${queryParams.startTime}&endTime=${queryParams.endTime}`
proxy.download(url, {}, `${queryParams.stnm}${textTitle.value}${exName}`);
}
//
const handleQuery = async () => {
try {
await Promise.all([
drawTable1(),
drawTable2(),
drawTable3(),
getEchartsData()
]);
} catch (error) {
console.error('请求执行出错:', error);
}
}
// /
const changeStaticType = (val) => {
staticType.value = val
queryParams.dataType = val
handleQuery()
}
//
let compareStation = ref([])
const changeCompareStnmIds = (val) => {
compareStation.value = val
let list = [queryParams.stnmId, ...val];
let str = list.join(',')
queryParams.stnmIds = str
}
//
const compareQuery = () => {
handleQuery()
}
let open = ref(false)
const form = reactive({
updateType: null,
startTime: dayjs().subtract(7, 'day').format('YYYY-MM-DD 08:00:00'),
endTime: dayjs().format('YYYY-MM-DD 08:00:00'),
});
//
const updateData = () => {
open.value = true
}
/**************************************************** 数据修改弹窗 ******************************************************/
let formRef = ref(null)
//
const cancel = () => {
open.value = false;
reset();
}
const reset = () => {
Object.assign(form, {});
proxy.resetForm("formRef");
}
let upDateUrl = `${import.meta.env.VUE_APP_BASE_API}${props.requestPrefix}/updatedatabyexcel?stnmId=${queryParams.stnmId}&stationType=${props.stationType}&ycMethod=2`
let headers = reactive({
Authorization: "Bearer " + getToken()
})
/** 文件上传成功处理 */
const handleFileSuccess = (response, file, fileList) => {
open.value = false;
proxy.$refs["uploadRef"].handleRemove(file);
proxy.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
};
/** 提交按钮 */
const submitForm = async (formEl) => {
if (!formEl) return
await formEl.validate(async (valid, fields) => {
if (valid) {
try {
let params = {
stnmId: queryParams.stnmId,
startTime: form.startTime,
endTime: form.endTime,
ycMethod: form.updateType,
}
if (form.updateType == 0) {
let url = props.requestPrefix + "/updatedatabyother";
if (compareStation.value.length == 0) {
proxy.$modal.msg("请选择1个对比站点进行替换");
} else {
params.compareStnmId = compareStation.value[0]
dataModification(url, params)
}
} else if (form.updateType == 1) {
let url = props.requestPrefix + "/updatedatabyone";
params.value = form.value1
dataModification(url, params)
} else if (form.updateType == 2) {
} else if (form.updateType == 3) {
let url = props.requestPrefix + "/updatebysecond";
dataModification(url, params)
} else if (form.updateType == 4) {
let url = props.requestPrefix + "/updatebycb";
dataModification(url, params)
} else if (form.updateType == 5) {
let url = props.requestPrefix + "/recal";
dataModification(url, params)
}
} catch (error) { }
}
})
}
const dataModification = async (url, params) => {
let res = await proxy.axiosPost2(url, params);
if (res.code == 0) {
proxy.$modal.msgSuccess("执行成功");
open.value = false
handleQuery()
}
}
onMounted(() => {
// getSingleStation();
})
</script>
<style lang="scss" scoped>
:deep(.el-collapse) {
border-top: none !important;
}
:deep(.el-collapse-item__content) {
padding-bottom: 0 !important;
}
</style>

800
src/components/ZhengBian/index-yy.vue

@ -0,0 +1,800 @@ @@ -0,0 +1,800 @@
<template>
<div class="app-container app-container-bg">
<el-card class="first-card" ref='firstCard' shadow="always">
<el-form :model="queryParams" ref="queryForm" :inline="true" @submit.native.prevent>
<!-- 目前只有余姚站才有测站类型区分 -->
<el-form-item label="测站类型" v-if='showStationTypeSelector'>
<el-select v-model="queryParams.isState" placeholder="请选择测站类型" style="width:160px" @change="changeIsState">
<el-option v-for="item in mainTypes" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="站点">
<el-tree-select filterable :props="{ value: 'stnmId', label: 'name' }" v-model="queryParams.stnmId" style="width: 240px" :data="treeSelectOptions" node-key="id" />
</el-form-item>
<el-form-item label="开始时间">
<el-date-picker v-model="queryParams.startTime" type="datetime" value-format="YYYY-MM-DD HH:mm:ss" format="YYYY-MM-DD HH:mm:ss" placeholder="选择开始时间" :disabled-date="disabledStartDate">
</el-date-picker>
</el-form-item>
<el-form-item label="结束时间">
<el-date-picker v-model="queryParams.endTime" type="datetime" value-format="YYYY-MM-DD HH:mm:ss" placeholder="选择结束时间" :disabled-date="disabledEndDate">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-checkbox v-model="queryParams.xindao" @change='handleQuery' :true-label="1" :false-label="0">遥测数据</el-checkbox>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">查询</el-button>
<el-switch class="ml20" v-model="staticType" @change='changeStaticType' size="large" inline-prompt style="--el-switch-on-color: #13ce66; --el-switch-off-color: #1890FF" active-text="逐日显示" active-value="1" inactive-value="0" inactive-text="逐时显示" />
</el-form-item>
<el-form-item v-if="staticType==1">
<div style="font-size: 12px;color:#ccc">
逐日天表统计的是当日早八点到次日早八点
</div>
</el-form-item>
<br />
<el-form-item label="对比站点">
<el-tree-select filterable multiple show-checkbox collapse-tags :props="{ value: 'id', label: 'name' }" @change="changeCompareStnmIds" v-model="compareStation" style="width: 240px" :data="compareTreeSelectOptions" node-key="id" placeholder="请选择对比测站名称" />
<!-- <el-select-v2 collapse-tags multiple filterable clearable v-model="compareStation" @change="changeCompareStnmIds" :options="stationOptions" :props="defaultProps" placeholder="请选择对比测站名称" style="width: 360px" /> -->
</el-form-item>
<el-form-item>
<el-button type="primary" @click="compareQuery" icon="Search">对比查询</el-button>
<el-button type="success" plain icon="Edit" @click="updateData">数据修改</el-button>
</el-form-item>
</el-form>
</el-card>
<splitpanes v-loading="fullscreenLoading" element-loading-text="正在加载页面......" :horizontal="device === 'mobile'" class="el-card-p card-shadow carder-border mt10 pad10 default-theme container-box" :push-other-panes="false">
<pane :size="firstSize" :min-size="SPLITPANES_CONFIG.MIN_SIZE" max-size="40" ref="firstPane" class="mr10">
<el-collapse v-model="activeName" accordion @change="handleChangeCollapse">
<el-collapse-item title="预处理数据" name="1">
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="warning" plain icon="Download" @click="yclExport">导出 </el-button>
</el-col>
<el-col :span="1.5">
<el-button type="success" plain icon="RefreshRight" @click="yclUpdate"> 整编 </el-button>
</el-col>
</el-row>
<div class="pad5" style="font-size: 12px;color:#ccc">点击数值行修改数据</div>
<vxe-grid ref="gridRef1" v-bind="gridOptions1"></vxe-grid>
</el-collapse-item>
<el-collapse-item :title="stationType==='A'?'小时数据':'摘录数据'" name="2">
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="warning" plain icon="Download" @click="hourExport">导出 </el-button>
</el-col>
</el-row>
<vxe-grid v-bind="gridOptions2"></vxe-grid>
</el-collapse-item>
<el-collapse-item title="遥测数据" name="3">
<vxe-grid v-bind="gridOptions3"></vxe-grid>
</el-collapse-item>
</el-collapse>
</pane>
<pane :size="100 - firstSize">
<div v-table-height='{bottom:0}' style="width:100%;">
<TimeBarChart v-if="stationType !== 'A' && staticType == '1'" v-loading="echartsLoading" :timeType="timeType" :legendData='legendData' :xAxisData="xAxisData" :seriesData="seriesData" :textTitle="textTitle" :unit="unit" :baseOptionData='baseOptionData' :key="`${staticType}-${props.stationType}`" :fixed="fixed" />
<DataZoomChart v-else v-loading="echartsLoading" :timeType="timeType" :legendData='legendData' :xAxisData="xAxisData" :seriesData="seriesData" :textTitle="textTitle" :unit="unit" :echartType="echartType" :key="`${staticType}-${props.stationType}`" />
</div>
</pane>
</splitpanes>
<!-- :rules="rules" -->
<el-dialog class="custom-dialog" title="数据修改" v-model="open" width="500px" append-to-body>
<el-form ref="formRef" :model="form" label-width="150">
<el-form-item label="修改方式" prop="updateType">
<el-select v-model="form.updateType" placeholder="请选择修改方式">
<el-option v-for="dict in update_type_options" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
</el-select>
</el-form-item>
<el-form-item label="开始时间" prop="startTime" v-if="form.updateType!='2'&&form.updateType!=null">
<el-date-picker v-model="form.startTime" type="datetime" placeholder="选择开始时间" value-format="YYYY-MM-DD HH:mm:ss" format="YYYY-MM-DD HH:mm:ss">
</el-date-picker>
</el-form-item>
<el-form-item label="结束时间" prop="endTime" v-if="form.updateType!='2'&&form.updateType!=null">
<el-date-picker v-model="form.endTime" type="datetime" placeholder="选择结束时间" value-format="YYYY-MM-DD HH:mm:ss" format="YYYY-MM-DD HH:mm:ss">
</el-date-picker>
</el-form-item>
<el-form-item label="替换值" prop="value1" v-if="form.updateType=='1'">
<el-input v-model="form.value1" placeholder="请输入替换值" style="width:220px" />
</el-form-item>
<div style="width:80%;margin: 0 auto;" v-if="form.updateType=='2'">
<el-upload class="upload-demo" drag :headers="headers" :action='uploadUrl' :on-success="handleFileSuccess" accept=".xls, .xlsx" multiple>
<el-icon class="el-icon--upload"><upload-filled /></el-icon>
<div class="el-upload__text">
将文件拖到此处<em>点击上传</em>
</div>
<template #tip>
<div class="el-upload__tip ">
模板就是预处理数据表格导出的文件
</div>
</template>
</el-upload>
</div>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="submitForm(formRef)" v-loading='btnLoading'> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script setup>
import dayjs from 'dayjs';
import {
Splitpanes,
Pane
} from 'splitpanes'
import 'splitpanes/dist/splitpanes.css'
import DataZoomChart from '@/components/ChartsDataZoom/index.vue'
import TimeBarChart from '@/components/ChartsTimeLine/index.vue'
import ESelectSingle from '@/components/ESelectSingle/index.vue'
import { getToken } from "@/utils/auth";
import useAppStore from '@/store/modules/app'
import { getStationConfig } from '@/config/stationConfig'
const device = computed(() => useAppStore().device);
const props = defineProps({
stationType: {
type: String,
default: 'A'
},
requestPrefix: {
type: String,
default: '/ycraindata'
},
fixed: {
type: Number,
default: 1
}
})
const {
proxy
} = getCurrentInstance()
// const { update_type_options } = proxy.useDict("update_type_options")
// update_type_options
const update_type_options = computed(() => {
let options = [
{
value: '0',
label: '对比站点替换'
},
{
value: '1',
label: '手动替换'
},
{
value: '2',
label: 'excel导入'
},
{
value: '3',
label: '副设备数据替换'
},
{
value: '5',
label: '重新整编'
}
];
// requestPrefix '/ycraindata' 线
if (props.requestPrefix !== '/ycraindata') {
options.splice(4, 0, {
value: '4',
label: '直线插补'
});
}
return options;
});
const textTitle = computed(() => {
switch (props.stationType) {
case 'A':
return '雨量过程线';
case 'B':
return '水位过程线';
case 'C':
return '水位过程线';
case 'D':
return '潮位过程线';
case 'E':
return '流量过程线';
}
});
const unit = computed(() => {
switch (props.stationType) {
case 'A':
return 'mm';
case 'B':
return 'm';
case 'C':
return 'm';
case 'D':
return 'm';
case 'E':
return 'm³/s';
}
});
const echartType = computed(() => {
switch (props.stationType) {
case 'A':
return 'bar';
case 'B':
return 'line';
case 'C':
return 'line';
case 'D':
return 'line';
case 'E':
return 'line';
}
});
//
const currentStationConfig = computed(() => {
return getStationConfig(import.meta.env.VITE_APP_BASE_API);
});
//
const showStationTypeSelector = computed(() => {
return currentStationConfig.value.showStationType;
});
//
const mainTypes = computed(() => {
return currentStationConfig.value.stationTypes;
});
const defaultProps = {
label: 'name',
value: 'stnmId',
}
const staticType = ref('0')
const queryParams = reactive({
startTime: dayjs().subtract(7, 'day').format('YYYY-MM-DD 08:00:00'),
endTime: dayjs().format('YYYY-MM-DD 08:00:00'),
isState: '0', //
xindao: 1,
stnm: null,
stnmId: null,
stnmIds: null,
dataType: staticType.value,
chartType: echartType.value
});
const timeType = computed(() => {
return staticType.value == '0' ? 'hour' : "day"
})
// 15
const disabledStartDate = (time) => {
const endTime = queryParams.endTime ? dayjs(queryParams.endTime) : null;
const maxStartTime = endTime ? endTime.subtract(15, 'day') : null;
return dayjs(time).isAfter(dayjs()) || //
(endTime && dayjs(time).isAfter(endTime)) // 15
};
// 15
const disabledEndDate = (time) => {
const startTime = queryParams.startTime ? dayjs(queryParams.startTime) : null;
const maxEndTime = startTime ? startTime.add(15, 'day') : null;
return dayjs(time).isAfter(dayjs()) || //
(startTime && dayjs(time).isBefore(startTime)) || //
(startTime && dayjs(time).isAfter(maxEndTime)); // 15
};
//
const selectOptions = ref([]);
const selectOptions2 = ref([]);
const defaultOption = ref([])
const defaultOption2 = ref([])
const fullscreenLoading = ref(false)
let requestPrefix = '/basic/stype/getNewTreeStationType/'
const eSelectSingle = ref(null)
const handleStationLoading = (loadingState) => {
fullscreenLoading.value = loadingState;
}
const stationOptions = ref([])
let uploadUrl = ref(null)
// :stnmId:ID,options:options,stnm:
const handleStationChange = async (stnmId, options, stnm) => {
queryParams.stnmId = stnmId
queryParams.stnm = stnm
queryParams.stnmIds = stnmId
const data = options.filter(item => item.stnmId != stnmId)
// const data = options
stationOptions.value = data
if (stnmId == undefined) {
proxy.$modal.msgWarning("请选择站点后查询");
return
} else {
uploadUrl = `${import.meta.env.VUE_APP_BASE_API}${props.requestPrefix}/updatedatabyexcel?stnmId=${queryParams.stnmId}&stationType=${props.stationType}&ycMethod=2`
try {
await Promise.all([
drawTable1(),
drawTable2(),
drawTable3(),
getEchartsData()
]);
} catch (error) {
console.error('请求执行出错:', error);
}
}
}
//
const changeIsState = (val) => {
queryParams.isState = val
getTreeStation()
}
const treeSelectOptions = ref([])
const getTreeStation = async () => {
fullscreenLoading.value = true;
try {
let res = await proxy.axiosGet('basic/stype/getNewTreeStationType/', { 'type': proxy.stationType, 'isState': queryParams.isState });
if (res.code == 0) {
treeSelectOptions.value = res.data
// stnmId
if (treeSelectOptions.value.length > 0) {
const firstLeafNode = findFirstLeafNode(treeSelectOptions.value);
if (firstLeafNode) {
queryParams.stnmId = firstLeafNode.stnmId;
queryParams.stnmIds = queryParams.stnmId;
await Promise.all([
drawTable1(),
drawTable2(),
drawTable3(),
getEchartsData()
]);
}
}
}
} catch (error) {
} finally {
fullscreenLoading.value = false
}
}
//
const findFirstLeafNode = (nodes) => {
for (let node of nodes) {
//
if (node.children && node.children.length > 0) {
const leaf = findFirstLeafNode(node.children);
if (leaf) {
return leaf;
}
}
//
else if (node.stnmId) {
return node;
}
}
return null;
}
//
const compareTreeSelectOptions = ref([])
const getCompareTreeStation = async () => {
try {
let res = await proxy.axiosGet('/basic/stype/getTreeStation/' + proxy.stationType);
if (res.code == 0) {
compareTreeSelectOptions.value = res.data
}
} catch (error) {
}
}
const firstSize = ref(proxy.SPLITPANES_CONFIG.DEFAULT_SIZE)
const activeName = ref('1')
const tableData1 = ref([])
const tableData2 = ref([])
const tableData3 = ref([])
//
const handleChangeCollapse = (val) => { }
//
const baseGridOptions = {
border: true,
loading: false,
showOverflow: false,
height: 500,
columnConfig: {
resizable: true
},
virtualYConfig: {
enabled: true,
gt: 0
},
rowStyle({ rowIndex, row }) {
if (row.status == '30' || row.status == '31') {
return {
color: '#f00'
}
}
},
}
// script setup watch vxe-grid edit-closed
const handleCellValueChange = ({ row, column }) => {
if (column.field === 'value') {
const index = yclUpdateTime.value.indexOf(row.tm);
if (index > -1) {
//
yclUpdateValue.value[index] = row.value;
} else {
//
yclUpdateTime.value.push(row.tm);
yclUpdateValue.value.push(row.value);
}
}
};
//
const gridOptions1 = reactive({
...baseGridOptions,
editConfig: {
trigger: 'click',
mode: 'row'
},
columns: [{
title: '时间',
field: 'tm',
width: 160,
align: "center"
},
{
title: '数值',
field: 'value',
align: "center",
editRender: { name: 'VxeNumberInput', props: { type: 'float', digits: props.fixed, min: 0 } }
}
],
data: [],
onEditClosed: handleCellValueChange
})
//
const drawTable1 = async () => {
gridOptions1.loading = true
try {
let url = props.requestPrefix + '/originaldata'
let res = await proxy.axiosPost2(url, queryParams);
if (res.code === 0) {
let data = res.data;
// for (var i = 0; i < data.length; i++) {
// data[i].value = data[i].value.toFixed(props.fixed)
// }
gridOptions1.data = data
// selectOptions.value = res.data;
}
} catch (error) {
} finally {
gridOptions1.loading = false
}
}
// /
const gridOptions2 = reactive({
...baseGridOptions,
columns: [{
title: '时间',
field: 'tm',
width: 160,
align: "center"
},
{
title: '数值',
field: 'value',
align: "center"
}
],
data: []
})
//
const drawTable2 = async () => {
gridOptions2.loading = true
try {
let url = props.requestPrefix + '/countdata'
let res = await proxy.axiosPost2(url, queryParams);
if (res.code === 0) {
let data = res.data;
gridOptions2.data = data
}
gridOptions2.loading = false
} catch (error) {
gridOptions2.loading = false
}
}
//
const gridOptions3 = reactive({
...baseGridOptions,
columns: [],
data: []
})
//
const drawTable3 = async () => {
gridOptions3.loading = true
try {
let url = props.requestPrefix + '/xindaodaydata'
let res = await proxy.axiosPost2(url, queryParams);
if (res.code === 0) {
let data = res.data;
let header = data[0];
let tableColumn = []
tableColumn.push({
field: 'tm',
title: '时间',
width: 160,
align: "center"
});
for (let k in header) {
if (k != 'tm' && k != 'avg') {
tableColumn.push({
field: k,
title: k,
// width: 100,
align: "center"
});
}
}
gridOptions3.columns = tableColumn;
gridOptions3.data = data
}
gridOptions3.loading = false
} catch (error) {
gridOptions3.loading = false
}
}
// echarts
const legendData = ref([])
const xAxisData = ref([])
const seriesData = ref([])
const baseOptionData = ref([])
const echartsLoading = ref(false)
const getEchartsData = async () => {
legendData.value = []
seriesData.value = []
baseOptionData.value = []
xAxisData.value = []
echartsLoading.value = true
let baseUrl = '/chartdata'
if (staticType.value == '1' && props.stationType != 'A') {
baseUrl = "/chartdatabyday";
}
try {
let url = props.requestPrefix + baseUrl
let res = await proxy.axiosPost2(url, queryParams);
if (res.code === 0) {
legendData.value = res.data.legend
if (props.stationType !== 'A' && staticType.value == '1') {
seriesData.value = res.data.data
baseOptionData.value = res.data.baseOptionData
xAxisData.value = ['08:00', '09:00', '10:00', '11:00', '12:00', '13:00', '14:00', '15:00', '16:00', '17:00', '18:00', '19:00', '20:00', '21:00', '22:00', '23:00', '00:00', '01:00', '02:00', '03:00', '04:00', '05:00', '06:00', '07:00', '08:00']
console.log(props.stationType, staticType.value,)
console.log('seriesData.value', seriesData.value)
console.log('baseOptionData.value', baseOptionData.value)
console.log('xAxisData.value', xAxisData.value)
} else {
// seriesdata
if (res.data.series && res.data.series.length > 0) {
// seriesdata
xAxisData.value = res.data.series[0].data.map(item => {
// item
if (typeof item === 'object' && item !== null) {
// tm, time, or the first element
const timeValue = item.tm || item.time || item[0];
return dayjs(timeValue).format('YYYY-MM-DD HH:mm');
} else {
// item
return dayjs(item).format('YYYY-MM-DD HH:mm');
}
});
}
seriesData.value = res.data.series
}
}
} catch (error) {
console.log(error)
} finally {
echartsLoading.value = false
}
};
watch(staticType.value, (newVal, oldVal) => {
if (oldVal !== undefined) { //
// dataType
queryParams.dataType = newVal
//
getEchartsData()
}
})
//
const yclExport = () => {
let url = `${props.requestPrefix}/exportoriginaldata?stnmId=${queryParams.stnmId}&startTime=${queryParams.startTime}&endTime=${queryParams.endTime}`
proxy.download(url, {}, `${queryParams.stnm}${textTitle.value}原始数据.xls`);
}
let yclUpdateTime = ref([])
let yclUpdateValue = ref([])
//
const yclUpdate = async () => {
if (yclUpdateTime.value.length == 0) {
proxy.$modal.msg("请修改后再进行整编");
return;
}
let url = props.requestPrefix + "/updateycldata";
let params = queryParams;
params.times = yclUpdateTime.value.join(",");
params.values = yclUpdateValue.value.join(",");
fullscreenLoading.value = true;
try {
let res = await proxy.axiosPost2(url, params);
if (res.code == 0) {
proxy.$modal.msgSuccess("执行成功");
yclUpdateTime.value = [];
yclUpdateValue.value = [];
handleQuery()
}
} catch (error) {
} finally {
fullscreenLoading.value = false;
}
}
//
const hourExport = () => {
let exName = staticType.value == 0 ? "摘录数据(时).xls" : "摘录数据(日).xls"
let url = `${props.requestPrefix}/exportcountdata?stnmId=${queryParams.stnmId}&startTime=${queryParams.startTime}&endTime=${queryParams.endTime}`
proxy.download(url, {}, `${queryParams.stnm}${textTitle.value}${exName}`);
}
//
const handleQuery = async () => {
try {
await Promise.all([
drawTable1(),
drawTable2(),
drawTable3(),
getEchartsData()
]);
} catch (error) {
console.error('请求执行出错:', error);
}
}
// /
const changeStaticType = (val) => {
staticType.value = val
queryParams.dataType = val
handleQuery()
}
//
let compareStation = ref()
const changeCompareStnmIds = (val) => {
console.log(val, '======val')
// compareStation.value = val
// let list = [queryParams.stnmId, ...val];
// let str = list.join(',')
// queryParams.stnmIds = str
}
//
const compareQuery = () => {
handleQuery()
}
let open = ref(false)
const form = reactive({
updateType: null,
startTime: dayjs().subtract(7, 'day').format('YYYY-MM-DD 08:00:00'),
endTime: dayjs().format('YYYY-MM-DD 08:00:00'),
});
//
const updateData = () => {
open.value = true
}
/**************************************************** 数据修改弹窗 ******************************************************/
let formRef = ref(null)
//
const cancel = () => {
open.value = false;
reset();
}
const reset = () => {
Object.assign(form, {});
proxy.resetForm("formRef");
}
let upDateUrl = `${import.meta.env.VUE_APP_BASE_API}${props.requestPrefix}/updatedatabyexcel?stnmId=${queryParams.stnmId}&stationType=${props.stationType}&ycMethod=2`
let headers = reactive({
Authorization: "Bearer " + getToken()
})
/** 文件上传成功处理 */
const handleFileSuccess = (response, file, fileList) => {
open.value = false;
proxy.$refs["uploadRef"].handleRemove(file);
proxy.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
};
/** 提交按钮 */
const submitForm = async (formEl) => {
if (!formEl) return
await formEl.validate(async (valid, fields) => {
if (valid) {
try {
let params = {
stnmId: queryParams.stnmId,
startTime: form.startTime,
endTime: form.endTime,
ycMethod: form.updateType,
}
if (form.updateType == 0) {
let url = props.requestPrefix + "/updatedatabyother";
if (compareStation.value.length == 0) {
proxy.$modal.msg("请选择1个对比站点进行替换");
} else {
params.compareStnmId = compareStation.value[0]
dataModification(url, params)
}
} else if (form.updateType == 1) {
let url = props.requestPrefix + "/updatedatabyone";
params.value = form.value1
dataModification(url, params)
} else if (form.updateType == 2) {
} else if (form.updateType == 3) {
let url = props.requestPrefix + "/updatebysecond";
dataModification(url, params)
} else if (form.updateType == 4) {
let url = props.requestPrefix + "/updatebycb";
dataModification(url, params)
} else if (form.updateType == 5) {
let url = props.requestPrefix + "/recal";
dataModification(url, params)
}
} catch (error) { }
}
})
}
const dataModification = async (url, params) => {
let res = await proxy.axiosPost2(url, params);
if (res.code == 0) {
proxy.$modal.msgSuccess("执行成功");
open.value = false
handleQuery()
}
}
onMounted(() => {
getTreeStation()
getCompareTreeStation()
})
</script>
<style lang="scss" scoped>
:deep(.el-collapse) {
border-top: none !important;
}
:deep(.el-collapse-item__content) {
padding-bottom: 0 !important;
}
</style>

131
src/components/ZhengBian/index.vue

@ -2,9 +2,15 @@ @@ -2,9 +2,15 @@
<div class="app-container app-container-bg">
<el-card class="first-card" ref='firstCard' shadow="always">
<el-form :model="queryParams" ref="queryForm" :inline="true" @submit.native.prevent>
<!-- 目前只有余姚站才有测站类型区分 -->
<el-form-item label="测站类型" v-if='showStationTypeSelector'>
<el-select v-model="queryParams.isState" placeholder="请选择测站类型" style="width:160px" @change="changeIsState">
<el-option v-for="item in mainTypes" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="站点">
<ESelectSingle ref="eSelectSingle" :type="'multiple'" :stationType="stationType" :defaultProps="defaultProps" :requestPrefix="requestPrefix" @stationChange="handleStationChange" @loadingChange="handleStationLoading" />
<!-- <el-cascader v-model="defaultOption" placeholder="请选择站点" :options="selectOptions" style="width: 250px;" filterable clearable @change='changeCascader'></el-cascader> -->
<el-tree-select filterable :props="{ value: 'stnmId', label: 'name' }" v-model="queryParams.stnmId" style="width: 240px" :data="treeSelectOptions" node-key="id" />
</el-form-item>
<el-form-item label="开始时间">
<el-date-picker v-model="queryParams.startTime" type="datetime" value-format="YYYY-MM-DD HH:mm:ss" format="YYYY-MM-DD HH:mm:ss" placeholder="选择开始时间" :disabled-date="disabledStartDate">
@ -30,7 +36,8 @@ @@ -30,7 +36,8 @@
<br />
<el-form-item label="对比站点">
<el-select-v2 collapse-tags multiple filterable clearable v-model="compareStation" @change="changeCompareStnmIds" :options="stationOptions" :props="defaultProps" placeholder="请选择对比测站名称" style="width: 360px" />
<el-tree-select filterable multiple show-checkbox collapse-tags :props="{ value: 'id', label: 'name' }" @change="changeCompareStnmIds" v-model="compareStation" style="width: 240px" :data="compareTreeSelectOptions" node-key="id" placeholder="请选择对比测站名称" />
<!-- <el-select-v2 collapse-tags multiple filterable clearable v-model="compareStation" @change="changeCompareStnmIds" :options="stationOptions" :props="defaultProps" placeholder="请选择对比测站名称" style="width: 360px" /> -->
</el-form-item>
<el-form-item>
<el-button type="primary" @click="compareQuery" icon="Search">对比查询</el-button>
@ -68,7 +75,7 @@ @@ -68,7 +75,7 @@
</pane>
<pane :size="100 - firstSize">
<div v-table-height='{bottom:0}' style="width:100%;">
<TimeBarChart v-if="stationType !== 'A' && staticType == '1'" v-loading="echartsLoading" :timeType="timeType" :legendData='legendData' :xAxisData="xAxisData" :seriesData="seriesData" :textTitle="textTitle" :unit="unit" :baseOptionData='baseOptionData' :key="`${staticType}-${props.stationType}`" :fixed="fixed"/>
<TimeBarChart v-if="stationType !== 'A' && staticType == '1'" v-loading="echartsLoading" :timeType="timeType" :legendData='legendData' :xAxisData="xAxisData" :seriesData="seriesData" :textTitle="textTitle" :unit="unit" :baseOptionData='baseOptionData' :key="`${staticType}-${props.stationType}`" :fixed="fixed" />
<DataZoomChart v-else v-loading="echartsLoading" :timeType="timeType" :legendData='legendData' :xAxisData="xAxisData" :seriesData="seriesData" :textTitle="textTitle" :unit="unit" :echartType="echartType" :key="`${staticType}-${props.stationType}`" />
</div>
</pane>
@ -127,6 +134,7 @@ @@ -127,6 +134,7 @@
import ESelectSingle from '@/components/ESelectSingle/index.vue'
import { getToken } from "@/utils/auth";
import useAppStore from '@/store/modules/app'
import { getStationConfig } from '@/config/stationConfig'
const device = computed(() => useAppStore().device);
const props = defineProps({
@ -224,6 +232,21 @@ @@ -224,6 +232,21 @@
return 'line';
}
});
//
const currentStationConfig = computed(() => {
return getStationConfig(import.meta.env.VITE_APP_BASE_API);
});
//
const showStationTypeSelector = computed(() => {
return currentStationConfig.value.showStationType;
});
//
const mainTypes = computed(() => {
return currentStationConfig.value.stationTypes;
});
const defaultProps = {
label: 'name',
value: 'stnmId',
@ -233,6 +256,7 @@ @@ -233,6 +256,7 @@
const queryParams = reactive({
startTime: dayjs().subtract(7, 'day').format('YYYY-MM-DD 08:00:00'),
endTime: dayjs().format('YYYY-MM-DD 08:00:00'),
isState: '0', //
xindao: 1,
stnm: null,
stnmId: null,
@ -308,42 +332,71 @@ @@ -308,42 +332,71 @@
}
}
const getSingleStation = async () => {
fullscreenLoading.value = true
// /basic/stype/getTreeStation2New/
// /basic/stype/getTreeStation/
// /basic/stype/getNewTreeStationType/
try {
let url = '/basic/stype/getTreeStation/'
let res = await proxy.axiosGet(url + props.stationType);
if (res.code === 0) {
selectOptions.value = res.data;
defaultOption.value = res.defaultOption
queryParams.stnmId = defaultOption.value.length > 0 ? parseInt(defaultOption.value[2]) : null
queryParams.stnmIds = queryParams.stnmId
await Promise.all([
drawTable1(),
drawTable2(),
drawTable3(),
getEchartsData()
]);
//
const changeIsState = (val) => {
queryParams.isState = val
getTreeStation()
}
const treeSelectOptions = ref([])
const getTreeStation = async () => {
fullscreenLoading.value = true;
try {
let res = await proxy.axiosGet('basic/stype/getNewTreeStationType/', { 'type': proxy.stationType, 'isState': queryParams.isState });
if (res.code == 0) {
treeSelectOptions.value = res.data
// stnmId
if (treeSelectOptions.value.length > 0) {
const firstLeafNode = findFirstLeafNode(treeSelectOptions.value);
if (firstLeafNode) {
queryParams.stnmId = firstLeafNode.stnmId;
queryParams.stnmIds = queryParams.stnmId;
await Promise.all([
drawTable1(),
drawTable2(),
drawTable3(),
getEchartsData()
]);
}
}
}
} catch (error) {
console.error('请求执行出错:', error);
} finally {
fullscreenLoading.value = false
}
}
//
const changeCascader = (val) => {
defaultOption.value = val
queryParams.stnmId = defaultOption.value.length > 0 ? parseInt(defaultOption.value[2]) : null
queryParams.stnmIds = queryParams.stnmId
handleQuery()
//
const findFirstLeafNode = (nodes) => {
for (let node of nodes) {
//
if (node.children && node.children.length > 0) {
const leaf = findFirstLeafNode(node.children);
if (leaf) {
return leaf;
}
}
//
else if (node.stnmId) {
return node;
}
}
return null;
}
//
const compareTreeSelectOptions = ref([])
const getCompareTreeStation = async () => {
try {
let res = await proxy.axiosGet('/basic/stype/getTreeStation/' + proxy.stationType);
if (res.code == 0) {
compareTreeSelectOptions.value = res.data
}
} catch (error) {
}
}
const firstSize = ref(proxy.SPLITPANES_CONFIG.DEFAULT_SIZE)
@ -636,13 +689,14 @@ @@ -636,13 +689,14 @@
handleQuery()
}
//
let compareStation = ref([])
let compareStation = ref()
const changeCompareStnmIds = (val) => {
compareStation.value = val
console.log(val, '======val')
// compareStation.value = val
let list = [queryParams.stnmId, ...val];
let str = list.join(',')
queryParams.stnmIds = str
// let list = [queryParams.stnmId, ...val];
// let str = list.join(',')
// queryParams.stnmIds = str
}
//
@ -731,7 +785,8 @@ @@ -731,7 +785,8 @@
}
onMounted(() => {
// getSingleStation();
getTreeStation()
getCompareTreeStation()
})
</script>
<style lang="scss" scoped>

74
src/config/stationConfig.js

@ -0,0 +1,74 @@ @@ -0,0 +1,74 @@
// src/config/stationConfig.js
export const STATION_CONFIGS = {
// 余姚配置
yuyao: {
showStationType: true,// 是否显示站点类型(在线整编模块)
stationTypes: [ // 站点类型列表
{ label: '国家站', value: '1' },
{ label: '遥测站', value: '0' }
],
showDeviceStcd: true,// 是否显示设备编码(遥测数据-设备数据)
},
// 建德配置
jiande: {
showStationType: false,
stationTypes: [],
showDeviceStcd: true,// 是否显示设备编码(遥测数据-设备数据)
},
// 青田配置
qingtian: {
showStationType: false,
stationTypes: [],
showDeviceStcd: true,// 是否显示设备编码(遥测数据-设备数据)
},
// 赣县配置
ganxian: {
showStationType: false,
stationTypes: [],
showDeviceStcd: true,// 是否显示设备编码(遥测数据-设备数据)
}
};
/**
* 根据API地址获取站点配置
* @param {string} apiUrl - API基础地址
* @returns {Object} 站点配置
*/
export function getStationConfig(apiUrl) {
const identifier = getStationIdentifier(apiUrl);
return STATION_CONFIGS[identifier] || {
showStationType: false,
stationTypes: [],
features: ['basicComparison']
};
}
/**
* 根据API地址获取站点标识
* @param {string} apiUrl - API基础地址
* @returns {string} 站点标识
*/
export function getStationIdentifier(apiUrl) {
const url = apiUrl || import.meta.env.VUE_APP_BASE_API || '';
if (url.includes('yyzb')) {
return 'yuyao';
} else if (url.includes('165')) {
return 'jiande';
} else if (url.includes('165')) {
return 'qingtian';
} else if (url.includes('216')) {
return 'ganxian';
}
// 默认返回主机名作为标识
try {
const urlObj = new URL(url);
return urlObj.hostname.replace(/\./g, '_');
} catch {
return 'default';
}
}

1
src/views/basic/sectionArea/index.vue

@ -80,7 +80,6 @@ @@ -80,7 +80,6 @@
</template>
<script setup>
import * as echarts from "echarts";
import * as XLSX from 'xlsx';
import { ref, reactive, onMounted, nextTick, getCurrentInstance } from 'vue'
import { getToken } from "@/utils/auth";

6
src/views/basic/zbOpen/index.vue

@ -2,8 +2,8 @@ @@ -2,8 +2,8 @@
<div class="app-container app-container-bg">
<el-card class="first-card" ref='firstCard' shadow="always">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" @submit.native.prevent>
<el-form-item label="测站" prop="stnm">
<el-input v-model="queryParams.stnm" placeholder="请输入测站" clearable @keyup.enter.native="handleQuery" />
<el-form-item label="测站名称" prop="stnm">
<el-input v-model="queryParams.stnm" placeholder="请输入测站名称" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
@ -35,8 +35,6 @@ @@ -35,8 +35,6 @@
</div>
</template>
<script setup>
import * as echarts from "echarts";
import * as XLSX from 'xlsx';
import { ref, reactive, onMounted, nextTick, getCurrentInstance } from 'vue'
import { getToken } from "@/utils/auth";

36
src/views/data/history/index.vue

@ -14,6 +14,12 @@ @@ -14,6 +14,12 @@
</el-option>
</el-select>
</el-form-item>
<el-form-item label="设备编号" prop="stcd" v-if="showDeviceStcd">
<el-select v-model="queryParams.stcd" style="width: 160px;" placeholder="请选择设备编号">
<el-option v-for="item in stcdList" :key="item" :label="item" :value="item">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="时间范围">
<el-date-picker @change="changeDateTime" :clearable="false" v-model="dateTime" type="datetimerange" format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" popper-class="date-clear">
</el-date-picker>
@ -46,7 +52,8 @@ @@ -46,7 +52,8 @@
</template>
<script setup>
import { reactive } from 'vue'
import { getStationConfig } from '@/config/stationConfig'
import { reactive, ref, onMounted } from 'vue'
import dayjs from 'dayjs'
import BarChart from '@/components/ChartsBar/index.vue'
const { proxy } = getCurrentInstance()
@ -70,6 +77,7 @@ @@ -70,6 +77,7 @@
let propety = ref('0')
//
const stationList = ref([])
const propChange = async (val) => {
if (val === undefined || val === null) {
val = '0' //
@ -83,12 +91,26 @@ @@ -83,12 +91,26 @@
let data = res.data
stationList.value = data;
queryParams.stnmId = data[0].stnmId
getStcdList()
getEchartsData()
}
} catch (error) {
}
}
//
const stcdList = ref([])
const getStcdList = async () => {
try {
let res = await proxy.axiosGet('/basic/stcd/getList', queryParams);
if (res.code == 0) {
let data = res.data
stcdList.value = data;
}
} catch (error) {
}
}
const unitList = [{
label: "雨量(mm)",
value: "A"
@ -188,8 +210,18 @@ @@ -188,8 +210,18 @@
queryParams.endTime = val[1]
dateTime.value = val
}
onMounted(() => {
//
const currentStationConfig = computed(() => {
return getStationConfig(import.meta.env.VITE_APP_BASE_API);
});
//
const showDeviceStcd = computed(() => {
return currentStationConfig.value.showDeviceStcd;
});
onMounted(() => {
propChange('0')
})
const propsList = ref([

156
src/views/report/dzm/index.vue

@ -118,16 +118,14 @@ @@ -118,16 +118,14 @@
</div>
<div class="mode2">
<el-table ref="table1" :data="tableData" height="500" stripe style="width: 100%" @row-click="rowClick">
<el-table-column prop="index" label="序" align="center" width="60">
<template slot-scope="scope">
{{ (scope.$index+1)}}
</template>
<el-table-column type="index" label="序" :align="alignment" width="60">
</el-table-column>
<!-- <el-table-column prop="cityName" align="center" label="所属地区" sortable>-->
<!-- <el-table-column prop="cityName" :align="alignment" label="所属地区" sortable>-->
<!-- </el-table-column>-->
<el-table-column prop="stnm" align="center" label="站名" sortable>
<el-table-column prop="stnm" :align="alignment" label="站名" sortable>
</el-table-column>
<el-table-column prop="value" align="center" label="雨量" sortable>
<el-table-column prop="value" :align="alignment" label="雨量" sortable>
<!-- <template slot-scope="scope">-->
<!-- <span v-if="!scope.row.value">-</span>-->
<!-- <span v-if="scope.row.value">{{scope.row.value.toFixed(1)}}</span>-->
@ -140,6 +138,7 @@ @@ -140,6 +138,7 @@
</template>
<script setup>
import { ElMessageBox } from 'element-plus'
import { ref, reactive, watch, onMounted, onUnmounted, toRaw } from 'vue';
import dayjs from 'dayjs'
import { Tile, Image } from 'ol/layer';
@ -183,6 +182,7 @@ @@ -183,6 +182,7 @@
dataType: false,
times: [new Date(new Date().getTime() - 30 * 24 * 60 * 60000), new Date()],
})
let alignment = 'center'
let deptId = ref('330281')
let rightShow = ref(false)
let citys = ref([])
@ -284,6 +284,8 @@ @@ -284,6 +284,8 @@
let schemePointData = ref(null)
let schemePointLayer = ref(null)
let schemeVectorSource = ref(null)
let stationVectorSource = ref(null)
let divisionCode = ref(null)
let userId = ref(null)
let isCardVisible = ref(true)
let schemeRuleForm = reactive({
@ -347,7 +349,7 @@ @@ -347,7 +349,7 @@
value: '',
properties: 'schemePoint'
});
let iconSrc = legend2;
let iconSrc = yqLegend2;
feature.setStyle(
new Style({
image: new Icon({
@ -566,7 +568,7 @@ @@ -566,7 +568,7 @@
}
const getTableData = async () => {
try {
const res = await $axiosPost('/report/queryStationRainData', getParams())
const res = await proxy.axiosPost('/report/queryStationRainData', getParams())
if (res.code == 0) {
tableData.value = res.data;
}
@ -677,7 +679,7 @@ @@ -677,7 +679,7 @@
params.divisionCode = '330281'
}
// params.userId = userId.value
params.userId = 108
params.userId = 1
try {
const res = await proxy.axiosPost('/tools/getPointScheme', params)
if (res.code == 0) {
@ -921,7 +923,7 @@ @@ -921,7 +923,7 @@
if (type == 'add') {
params.schemeId = null;
}
const res = await $axiosPost('/tools/getStationPointData', params)
const res = await proxy.axiosPost('/tools/getStationPointData', params)
if (res.code == 0) {
stationPointData.value = res.data;
}
@ -1062,6 +1064,7 @@ @@ -1062,6 +1064,7 @@
}
})
let params = getSchemeChoosedPoint()
console.log(params, 'params')
if (schemeRuleForm.type === 'add') {
await addScheme(params);
} else {
@ -1077,15 +1080,15 @@ @@ -1077,15 +1080,15 @@
}
const getSchemeChoosedPoint = () => {
if (queryParams.areaId) {
divisionCode = queryParams.areaId;
divisionCode.value = queryParams.areaId;
} else {
divisionCode = '330281';
divisionCode.value = '330281';
}
if (stationVectorSource.value) {
let choosedDataList = [];
let newScheme = {
id: null,
divisionCode: divisionCode,
divisionCode: divisionCode.value,
userId: userId.value,
schemeName: schemeRuleForm.schemeName
};
@ -1107,7 +1110,7 @@ @@ -1107,7 +1110,7 @@
const addScheme = async (data) => {
try {
const res = await $axiosPost('/tools/addPointScheme', data);
const res = await proxy.axiosPost('/tools/addPointScheme', data);
} catch (error) {
console.log('add scheme error: ', error);
}
@ -1115,7 +1118,7 @@ @@ -1115,7 +1118,7 @@
const modifyScheme = async (data) => {
try {
const res = await $axiosPost('/tools/modifyPointScheme', data);
const res = await proxy.axiosPost('/tools/modifyPointScheme', data);
} catch (error) {
console.log('add scheme error: ', error);
}
@ -1217,7 +1220,20 @@ @@ -1217,7 +1220,20 @@
krigingAlpha: 5,
canvasAlpha: 0.75,
};
const gridFeatureCollection = function (grid, xlim, ylim) {
let i, j, x, y, z;
let n = grid.length;
let m = grid[0].length;
let pointArray = [];
for (i = 0; i < n; i++)
for (j = 0; j < m; j++) {
x = (i) * grid.width + grid.xlim[0];
y = (j) * grid.width + grid.ylim[0];
z = grid[i][j]
pointArray.push(point([x, y], { value: z }));
}
return pointArray;
}
//
const drawKriging = (extent) => {
//
@ -1260,25 +1276,12 @@ @@ -1260,25 +1276,12 @@
source: dzmVectorSource.value,
opacity: 0.9,
style: (feature) => {
let value = feature.get('value');
if (value && typeof value === 'string') {
let parts = value.split('-');
if (parts.length > 1) {
let index = imgInterval.value.indexOf(parseFloat(parts[1])) - 1;
if (index >= 0 && index < imgColors.value.length) {
return new Style({
fill: new Fill({
color: imgColors.value[index]
}),
});
}
}
}
return new Style({
let style = new Style({
fill: new Fill({
color: 'rgba(0, 0, 0, 0.5)'
color: imgColors[imgInterval.indexOf(parseFloat(feature.get('value').split('-')[1])) - 1]
}),
});
})
return style;
}
});
dzmVectorLayer.value.set('name', 'dzmVectorLayer');
@ -1291,59 +1294,28 @@ @@ -1291,59 +1294,28 @@
style: (feature) => {
let zoom = olMap ? olMap.getView().getZoom() : 10;
let size = Math.min(Math.round(Math.pow(1.8, zoom - 7)) + 10, 30);
let value = feature.get('value');
let colorIndex = 0;
if (value && typeof value === 'string') {
let numValue = parseFloat(value);
if (!isNaN(numValue)) {
colorIndex = imgInterval.value.indexOf(numValue) - 1;
}
}
let color = (colorIndex >= 0 && colorIndex < imgColors.value.length)
? imgColors.value[colorIndex]
: '#000000';
let fontStyle = 'bold ' + size + 'px Calibri,sans-serif';
let textStyle = new Text({
text: value ? value.toString() : '',
text: feature.get('value').toString(),
font: fontStyle,
fill: new Fill({ color: color }),
fill: new Fill({ color: imgColors[imgInterval.indexOf(parseFloat(feature.get('value'))) - 1] }),
offsetX: 0,
offsetY: 0,
});
return new Style({
stroke: new Stroke({
color: color,
width: 3
}),
let style = new Style({
stroke: new Stroke(
{
color: imgColors[imgInterval.indexOf(parseFloat(feature.get('value'))) - 1],
width: 3
}),
text: textStyle
});
})
return style;
}
});
dzxVectorLayer.value.set('name', 'dzxVectorLayer');
const gridFeatureCollection = function (grid, xlim, ylim) {
let i, j, x, y, z;
let n = grid.length;
let m = grid[0].length;
let pointArray = [];
for (i = 0; i < n; i++)
for (j = 0; j < m; j++) {
if (grid[i][j] !== undefined && grid[i][j] !== null) {
x = (i) * grid.width + grid.xlim[0];
y = (j) * grid.width + grid.ylim[0];
z = grid[i][j];
pointArray.push(point([x, y], { value: z }));
}
}
return pointArray;
};
let fc = gridFeatureCollection(grid,
[extent[0], extent[2]], [extent[1], extent[3]]);
let fc = gridFeatureCollection(grid, [extent[0], extent[2]], [extent[1], extent[3]]);
//
if (fc.length === 0) {
@ -1352,31 +1324,33 @@ @@ -1352,31 +1324,33 @@
let collection = featureCollection(fc);
let _isobands = isobands(collection, imgInterval.value, { zProperty: "value" });
let _isobands = isobands(collection, imgInterval, { zProperty: "value" });
function sortArea(a, b) {
return area(b) - area(a);
}
if (_isobands.features) {
_isobands.features.sort(sortArea);
}
_isobands.features.sort(sortArea);
let boundaries = flatten(boundaryData.value);
_isobands = flatten(_isobands);
console.log(_isobands, '_isobands_isobands_isobands_isobands_isobands_isobands_isobands')
let clippedIsobands = [];
let idCounter = 998;
console.log(_isobands.features, boundaries.features, '---------------')
if (_isobands.features && boundaries.features) {
_isobands.features.forEach(function (layer1) {
boundaries.features.forEach(function (layer2) {
console.log(layer1, layer2, '==========================')
let intersection = null;
try {
intersection = intersect(layer1, layer2);
console.log(intersection, '111111111111')
} catch (e) {
console.log('eeeeeeeeeeeeeeeeeeeeeeeee', e)
try {
layer1 = buffer(layer1, 5);
layer1 = buffer(layer1, 0.1);
intersection = intersect(layer1, layer2);
console.log(intersection, '222222222222')
} catch (e2) {
console.warn('无法计算交集:', e2);
return;
@ -1392,19 +1366,20 @@ @@ -1392,19 +1366,20 @@
}
clippedIsobands = featureCollection(clippedIsobands);
console.log(clippedIsobands, 'clippedIsobands')
let clippedIsobandsFeatures = new GeoJSON().readFeatures(clippedIsobands, {
featureProjection: 'EPSG:4326'
});
console.log(clippedIsobandsFeatures, 'clippedIsobandsFeatures')
dzmVectorSource.value.addFeatures(clippedIsobandsFeatures);
if (olMap) {
olMap.addLayer(dzmVectorLayer.value);
}
let _isolines = isolines(collection, imgInterval.value, { zProperty: "value" });
console.log(olMap, 'olMap')
let _isolines = isolines(collection, imgInterval, { zProperty: "value" });
console.log(_isolines, '_isolines')
function clipCoordinatesWithinPolygon(feature, polygonFeature) {
function isPointInPolygon(p) {
const pointFeature = point(p);
@ -1446,6 +1421,7 @@ @@ -1446,6 +1421,7 @@
"value": feature.properties ? feature.properties.value : '',
}
};
console.log(dzxNewFeature, 'dzxNewFeature')
return dzxNewFeature;
}
@ -1458,6 +1434,7 @@ @@ -1458,6 +1434,7 @@
}
});
}
console.log(dzxNewFeatureList, 'dzxNewFeatureList')
let dzxNewFeatureCollection = featureCollection(dzxNewFeatureList);
dzxVectorSource.value.addFeatures(
@ -1476,6 +1453,7 @@ @@ -1476,6 +1453,7 @@
};
try {
console.log(boundaryExtent.value, 'boundaryExtent.value')
drawKriging(boundaryExtent.value);
loading.value = false;
} catch (error) {
@ -1598,7 +1576,7 @@ @@ -1598,7 +1576,7 @@
image: new Circle({
radius: size,
fill: new Fill({
color: imgColors.value[imgInterval.value.indexOf(findNearestBreak(imgInterval.value, item.value)) - 1]
color: imgColors[imgInterval.value.indexOf(findNearestBreak(imgInterval.value, item.value)) - 1]
}),
stroke: new Stroke({
color: 'rgba(255,255,255,0.85)',

162
src/views/report/gzynjsldzb/index.vue

@ -0,0 +1,162 @@ @@ -0,0 +1,162 @@
<!-- 各站月年降水量对照表<template> -->
<template>
<div class="app-container app-container-bg">
<el-card class="first-card" ref='firstCard' shadow="always">
<el-form :model="queryParams" ref="queryForm" :inline="true" @submit.native.prevent>
<el-form-item label="年份">
<el-date-picker v-model="queryParams.year" type="year" value-format="YYYY" placeholder="选择年" :clearable="false">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
<el-button type="warning" icon="Download" @click="handleExport">下载</el-button>
</el-form-item>
</el-form>
</el-card>
<splitpanes :horizontal="device === 'mobile'" class="el-card-p card-shadow carder-border mt10 pad10 default-theme container-box" :push-other-panes="false">
<pane :size="firstSize" :min-size="SPLITPANES_CONFIG.MIN_SIZE" :max-size="SPLITPANES_CONFIG.MAX_SIZE" ref="firstPane" class="mr10">
<e-tree ref="eTreeRef" :stationType="stationType" @stationChange="handleStationChange" @loadingChange="handleStationLoading"></e-tree>
</pane>
<pane :size="100 - firstSize" class="pad10" style="height:100%">
<div class="main-table-header">
<div class="table-title">{{tableTitle}}</div>
<div class="table-time mb5">
<div>
<span>年份: </span><span id="title1">{{ queryParams.year}}</span>
</div>
</div>
</div>
<el-table class="report-table" v-table-height="{bottom:100}" v-loading="loading" border :data="tableData" style="width: 100%;" :fit="true" :flexible="true">
<el-table-column fixed label="序号" :align="alignment" type="index">
</el-table-column>
<el-table-column fixed prop="c1" label="河名" width="100" :align="alignment">
</el-table-column>
<el-table-column fixed prop="c2" label="站名" width="100" :align="alignment">
</el-table-column>
<el-table-column label="月 降 水 量 (mm)" :align="alignment">
<el-table-column prop="c3" label="一月" :align="alignment">
</el-table-column>
<el-table-column prop="c4" label="二月" :align="alignment">
</el-table-column>
<el-table-column prop="c5" label="三月" :align="alignment">
</el-table-column>
<el-table-column prop="c6" label="四月" :align="alignment">
</el-table-column>
<el-table-column prop="c7" label="五月" :align="alignment">
</el-table-column>
<el-table-column prop="c8" label="六月" :align="alignment">
</el-table-column>
<el-table-column prop="c9" label="七月" :align="alignment">
</el-table-column>
<el-table-column prop="c10" label="八月" :align="alignment">
</el-table-column>
<el-table-column prop="c11" label="九月" :align="alignment">
</el-table-column>
<el-table-column prop="c12" label="十月" :align="alignment">
</el-table-column>
<el-table-column prop="c13" label="十一月" :align="alignment">
</el-table-column>
<el-table-column prop="c14" label="十二月" :align="alignment">
</el-table-column>
</el-table-column>
<el-table-column prop="c15" label="年降水量(mm)" :align="alignment">
</el-table-column>
<el-table-column prop="c16" label="年降水日数" :align="alignment">
</el-table-column>
<el-table-column label="一日最大" :align="alignment">
<el-table-column prop="c17" :align="alignment">
<template #header>
<div>降水量</div>
<div>(mm)</div>
</template>
</el-table-column>
<el-table-column label="出现日期" :align="alignment">
<el-table-column prop="c18" label="月" :align="alignment">
</el-table-column>
<el-table-column prop="c19" label="日" :align="alignment">
</el-table-column>
</el-table-column>
</el-table-column>
<el-table-column label="1-12月" :align="alignment">
<el-table-column prop="c20" :align="alignment">
<template #header>
<div>降水量</div>
<div>(mm)</div>
</template>
</el-table-column>
<el-table-column prop="c21" label="降水日数" :align="alignment">
</el-table-column>
</el-table-column>
</el-table>
</pane>
</splitpanes>
</div>
</template>
<script setup>
import dayjs from 'dayjs';
import { Splitpanes, Pane } from 'splitpanes'
import 'splitpanes/dist/splitpanes.css'
import ETree from '@/components/ETree/index.vue'
import { ref, reactive, onMounted, computed } from 'vue';
import useAppStore from '@/store/modules/app'
const device = computed(() => useAppStore().device);
const props = defineProps({
tableTitle: {
type: String,
default: '各站月年降水量对照表'
},
})
const { proxy } = getCurrentInstance()
const alignment = 'center'
const firstSize = ref(proxy.SPLITPANES_CONFIG.DEFAULT_SIZE)
const stationType = 'A'
const eTreeRef = ref(null)
let stnmIdsList = []
const handleStationLoading = (loadingState) => {
loading.value = loadingState;
}
//
const handleStationChange = (stnmIds) => {
stnmIdsList = stnmIds
queryParams.stnmIds = stnmIds.join(',')
if (stnmIdsList.length == 0) {
proxy.$modal.msgWarning("请选择站点后查询");
return
} else if (stnmIdsList.length > 50) {
proxy.$modal.msg("站点最多可选择50个");
return
} else {
getList()
}
}
const loading = ref(false);
const tableData = ref([]);
const queryParams = reactive({
year: dayjs(new Date()).format('YYYY'),
stnmIds: '',
});
const getList = async () => {
loading.value = true;
try {
const res = await proxy.axiosGet('/report/gzynjsldzbdata', queryParams)
if (res.code == 0) {
tableData.value = res.data
}
loading.value = false
} catch (error) {
loading.value = false
}
}
//
const handleQuery = () => {
getList()
}
</script>
<style lang="scss" scoped>
/* :deep(.report-table td.el-table__cell){
border-bottom: none !important;
} */
</style>

163
src/views/report/gzynlldzb/index.vue

@ -0,0 +1,163 @@ @@ -0,0 +1,163 @@
<template>
<div class="app-container app-container-bg">
<el-card class="first-card" ref='firstCard' shadow="always">
<el-form :model="queryParams" ref="queryForm" :inline="true" @submit.native.prevent>
<el-form-item label="年份">
<el-date-picker v-model="queryParams.year" type="year" value-format="YYYY" placeholder="选择年" :clearable="false">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
<el-button type="warning" icon="Download" @click="handleExport">下载</el-button>
</el-form-item>
</el-form>
</el-card>
<splitpanes :horizontal="device === 'mobile'" class="el-card-p card-shadow carder-border mt10 pad10 default-theme container-box" :push-other-panes="false">
<pane :size="firstSize" :min-size="SPLITPANES_CONFIG.MIN_SIZE" :max-size="SPLITPANES_CONFIG.MAX_SIZE" ref="firstPane" class="mr10">
<e-tree ref="eTreeRef" :stationType="stationType" @stationChange="handleStationChange" @loadingChange="handleStationLoading"></e-tree>
</pane>
<pane :size="100 - firstSize" class="pad10">
<div class="main-table-header">
<div class="table-title">{{tableTitle}}</div>
<div class="table-time mb5">
<div>
<span>年份: </span><span id="title1">{{ queryParams.year }}</span>
</div>
</div>
</div>
<el-table class="report-table" v-table-height="{bottom:100}" v-loading="loading" border :data="tableData" style="width: 100%;">
<el-table-column fixed label="序号" prop="c0" :align="alignment">
</el-table-column>
<el-table-column fixed prop="c1" label="河名" width="120" :align="alignment">
</el-table-column>
<el-table-column fixed prop="c2" label="站名" width="120" :align="alignment">
</el-table-column>
<el-table-column fixed prop="c3" label="集水面积(k㎡)" :align="alignment">
</el-table-column>
<el-table-column label="月 平 均 流 量 (m³/s)" :align="alignment">
<el-table-column prop="c4" label="一月" :align="alignment">
</el-table-column>
<el-table-column prop="c5" label="二月" :align="alignment">
</el-table-column>
<el-table-column prop="c6" label="三月" :align="alignment">
</el-table-column>
<el-table-column prop="c7" label="四月" :align="alignment">
</el-table-column>
<el-table-column prop="c8" label="五月" :align="alignment">
</el-table-column>
<el-table-column prop="c9" label="六月" :align="alignment">
</el-table-column>
<el-table-column prop="c10" label="七月" :align="alignment">
</el-table-column>
<el-table-column prop="c11" label="八月" :align="alignment">
</el-table-column>
<el-table-column prop="c12" label="九月" :align="alignment">
</el-table-column>
<el-table-column prop="c13" label="十月" :align="alignment">
</el-table-column>
<el-table-column prop="c14" label="十一月" :align="alignment">
</el-table-column>
<el-table-column prop="c15" label="十二月" :align="alignment">
</el-table-column>
</el-table-column>
<el-table-column prop="c16" label="年平均流量(m³/s)" width="100" :align="alignment">
</el-table-column>
<el-table-column prop="c17" :align="alignment">
<template slot="header" slot-scope="scope">
年径流量(10<sup>8</sup>)
</template>
</el-table-column>
<el-table-column prop="c18" label="年径流深度(mm)" width="100" :align="alignment">
</el-table-column>
<el-table-column prop="c19" :align="alignment">
<template slot="header" slot-scope="scope">
年径流模数(10<sup>-3</sup>/(s·))
</template>
</el-table-column>
<el-table-column prop="c20" label="年最大流量(m³/s)" width="100" :align="alignment">
</el-table-column>
<el-table-column label="发生日期" :align="alignment">
<el-table-column prop="c21" label="月" :align="alignment">
</el-table-column>
<el-table-column prop="c22" label="日" :align="alignment">
</el-table-column>
</el-table-column>
<el-table-column prop="c23" label="年最小流量(m³/s)" width="100" :align="alignment">
</el-table-column>
<el-table-column label="发生日期" :align="alignment">
<el-table-column prop="c24" label="月" :align="alignment">
</el-table-column>
<el-table-column prop="c25" label="日" :align="alignment">
</el-table-column>
</el-table-column>
</el-table>
</pane>
</splitpanes>
</div>
</template>
<script setup>
import dayjs from 'dayjs';
import { Splitpanes, Pane } from 'splitpanes'
import 'splitpanes/dist/splitpanes.css'
import ETree from '@/components/ETree/index.vue'
import { ref, reactive, onMounted } from 'vue';
import useAppStore from '@/store/modules/app'
const device = computed(() => useAppStore().device);
const props = defineProps({
tableTitle: {
type: String,
default: '表格标题'
},
})
const { proxy } = getCurrentInstance()
const alignment = 'center'
const firstSize = ref(proxy.SPLITPANES_CONFIG.DEFAULT_SIZE)
const stationType = 'E'
const eTreeRef = ref(null)
let stnmIdsList = []
const handleStationLoading = (loadingState) => {
loading.value = loadingState;
}
//
const handleStationChange = (stnmIds) => {
stnmIdsList = stnmIds
queryParams.stnmIds = stnmIds.join(',')
if (stnmIdsList.length == 0) {
proxy.$modal.msgWarning("请选择站点后查询");
return
} else if (stnmIdsList.length > 50) {
proxy.$modal.msg("站点最多可选择50个");
return
} else {
getList()
}
}
const loading = ref(false);
const tableData = ref([]);
const queryParams = reactive({
year: dayjs(new Date()).format('YYYY'),
stnmIds: '',
});
const getList = async () => {
loading.value = true;
try {
const res = await proxy.axiosGet('/report/gzynlldzbdata', queryParams)
if (res.code == 0) {
tableData.value = res.data
}
loading.value = false
} catch (error) {
loading.value = false
}
}
//
const handleQuery = () => {
getList()
}
//
const handleExport = () => { }
</script>

170
src/views/report/gzynswdzb/index.vue

@ -0,0 +1,170 @@ @@ -0,0 +1,170 @@
<template>
<div class="app-container app-container-bg">
<el-card class="first-card" ref='firstCard' shadow="always">
<el-form :model="queryParams" ref="queryForm" :inline="true" @submit.native.prevent>
<el-form-item label="类型">
<el-select v-model="stationType" placeholder="请选择类型" class="w150" @change="changeStationType">
<el-option label="水库" value="C"></el-option>
<el-option label="河道" value="B"></el-option>
</el-select>
</el-form-item>
<el-form-item label="年份">
<el-date-picker v-model="queryParams.year" type="year" value-format="YYYY" placeholder="选择年" :clearable="false">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
<el-button type="warning" icon="Download" @click="handleExport">下载</el-button>
</el-form-item>
</el-form>
</el-card>
<splitpanes :horizontal="device === 'mobile'" class="el-card-p card-shadow carder-border mt10 pad10 default-theme container-box" :push-other-panes="false">
<pane :size="firstSize" :min-size="SPLITPANES_CONFIG.MIN_SIZE" :max-size="SPLITPANES_CONFIG.MAX_SIZE" ref="firstPane" class="mr10">
<e-tree ref="eTreeRef" :stationType="stationType" @stationChange="handleStationChange"></e-tree>
</pane>
<pane :size="100 - firstSize" class="pad10">
<div class="main-table-header">
<div class="table-title">{{tableTitle}}</div>
<div class="table-time mb5">
<div>
<span>年份: </span><span id="title1">{{ queryParams.year }}</span>
</div>
</div>
</div>
<el-table class="report-table" v-table-height="{bottom:100}" v-loading="loading" :data="tableData" style="width: 100%;">
<el-table-column fixed label="序号" prop="c0" :align="alignment">
</el-table-column>
<el-table-column fixed prop="c1" label="河名" :align="alignment">
</el-table-column>
<el-table-column fixed prop="c2" label="站名" width="120" :align="alignment">
</el-table-column>
<el-table-column label="月 平 均 水 位 (mm)" :align="alignment">
<el-table-column prop="c3" label="一月" :align="alignment">
</el-table-column>
<el-table-column prop="c4" label="二月" :align="alignment">
</el-table-column>
<el-table-column prop="c5" label="三月" :align="alignment">
</el-table-column>
<el-table-column prop="c6" label="四月" :align="alignment">
</el-table-column>
<el-table-column prop="c7" label="五月" :align="alignment">
</el-table-column>
<el-table-column prop="c8" label="六月" :align="alignment">
</el-table-column>
<el-table-column prop="c9" label="七月" :align="alignment">
</el-table-column>
<el-table-column prop="c10" label="八月" :align="alignment">
</el-table-column>
<el-table-column prop="c11" label="九月" :align="alignment">
</el-table-column>
<el-table-column prop="c12" label="十月" :align="alignment">
</el-table-column>
<el-table-column prop="c13" label="十一月" :align="alignment">
</el-table-column>
<el-table-column prop="c14" label="十二月" :align="alignment">
</el-table-column>
</el-table-column>
<el-table-column prop="c15" label="年平均水位(m)" :align="alignment">
</el-table-column>
<el-table-column prop="c16" label="年最高水位(m)" :align="alignment">
</el-table-column>
<el-table-column label="发生日期" :align="alignment">
<el-table-column prop="c17" label="月" :align="alignment">
</el-table-column>
<el-table-column prop="c18" label="日" :align="alignment">
</el-table-column>
</el-table-column>
<el-table-column prop="c19" label="年最低水位(m)" :align="alignment">
</el-table-column>
<el-table-column label="发生日期" :align="alignment">
<el-table-column prop="c20" label="月" :align="alignment">
</el-table-column>
<el-table-column prop="c21" label="日" :align="alignment">
</el-table-column>
</el-table-column>
<el-table-column prop="c22" label="冻结基面与绝对基面高差(m)" :align="alignment">
</el-table-column>
<el-table-column prop="c23" label="绝对或假定基面名称" :align="alignment">
</el-table-column>
<el-table-column prop="c24" label="附注" :align="alignment">
</el-table-column>
</el-table>
</pane>
</splitpanes>
</div>
</template>
<script setup>
import dayjs from 'dayjs';
import { Splitpanes, Pane } from 'splitpanes'
import 'splitpanes/dist/splitpanes.css'
import ETree from '@/components/ETree/index.vue'
import { ref, reactive, onMounted } from 'vue';
import useAppStore from '@/store/modules/app'
const device = computed(() => useAppStore().device);
const props = defineProps({
tableTitle: {
type: String,
default: '表格标题'
},
})
const { proxy } = getCurrentInstance()
const alignment = 'center'
const firstSize = ref(proxy.SPLITPANES_CONFIG.DEFAULT_SIZE)
const stationType = ref('C')
let stnmIdsList = []
//
const handleStationChange = (stnmIds) => {
stnmIdsList = stnmIds
queryParams.stnmIds = stnmIds.join(',')
if (stnmIdsList.length == 0) {
proxy.$modal.msgWarning("请选择站点后查询");
return
} else if (stnmIdsList.length > 50) {
proxy.$modal.msg("站点最多可选择50个");
return
} else {
loading.value = true;
getList()
}
}
const loading = ref(false);
const tableData = ref([]);
const queryParams = reactive({
year: dayjs(new Date()).format('YYYY'),
stnmIds: '',
});
const getList = async () => {
loading.value = true;
try {
const res = await proxy.axiosGet('/report/gzynswdzbdata', queryParams)
if (res.code == 0) {
tableData.value = res.data
}
loading.value = false
} catch (error) {
loading.value = false
}
}
//
const handleQuery = () => {
getList()
}
//
const eTreeRef = ref(null)
const changeStationType = (val) => {
stationType.value = val
nextTick(() => {
if (eTreeRef.value) {
eTreeRef.value.getTreeStation();
}
})
}
//
const handleExport = () => { }
</script>

154
src/views/report/gzyntidedzb/index.vue

@ -0,0 +1,154 @@ @@ -0,0 +1,154 @@
<template>
<div class="app-container app-container-bg">
<el-card class="first-card" ref='firstCard' shadow="always">
<el-form :model="queryParams" ref="queryForm" :inline="true" @submit.native.prevent>
<el-form-item label="年份">
<el-date-picker v-model="queryParams.year" type="year" value-format="YYYY" placeholder="选择年" :clearable="false">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
<el-button type="warning" icon="Download" @click="handleExport">下载</el-button>
</el-form-item>
</el-form>
</el-card>
<splitpanes :horizontal="device === 'mobile'" class="el-card-p card-shadow carder-border mt10 pad10 default-theme container-box" :push-other-panes="false">
<pane :size="firstSize" :min-size="SPLITPANES_CONFIG.MIN_SIZE" :max-size="SPLITPANES_CONFIG.MAX_SIZE" ref="firstPane" class="mr10">
<e-tree ref="eTreeRef" :stationType="stationType" @stationChange="handleStationChange"></e-tree>
</pane>
<pane :size="100 - firstSize" class="pad10">
<div class="main-table-header">
<div class="table-title">{{tableTitle}}</div>
<div class="table-time mb5">
<div>
<span>年份: </span><span id="title1">{{ queryParams.year }}</span>
</div>
</div>
</div>
<el-table class="report-table" v-table-height="{bottom:100}" v-loading="loading" :data="tableData" style="width: 100%;">
<el-table-column fixed label="序号" prop="c0" :align="alignment">
</el-table-column>
<el-table-column fixed prop="c1" label="河名" width="120" :align="alignment">
</el-table-column>
<el-table-column fixed prop="c2" label="站名" width="120" :align="alignment">
</el-table-column>
<el-table-column label="月 平 均 潮 位 (mm)" :align="alignment">
<el-table-column prop="c3" label="一月" :align="alignment">
</el-table-column>
<el-table-column prop="c4" label="二月" :align="alignment">
</el-table-column>
<el-table-column prop="c5" label="三月" :align="alignment">
</el-table-column>
<el-table-column prop="c6" label="四月" :align="alignment">
</el-table-column>
<el-table-column prop="c7" label="五月" :align="alignment">
</el-table-column>
<el-table-column prop="c8" label="六月" :align="alignment">
</el-table-column>
<el-table-column prop="c9" label="七月" :align="alignment">
</el-table-column>
<el-table-column prop="c10" label="八月" :align="alignment">
</el-table-column>
<el-table-column prop="c11" label="九月" :align="alignment">
</el-table-column>
<el-table-column prop="c12" label="十月" :align="alignment">
</el-table-column>
<el-table-column prop="c13" label="十一月" :align="alignment">
</el-table-column>
<el-table-column prop="c14" label="十二月" :align="alignment">
</el-table-column>
</el-table-column>
<el-table-column prop="c15" label="年平均潮位(m)" :align="alignment">
</el-table-column>
<el-table-column prop="c16" label="年最高潮位(m)" :align="alignment">
</el-table-column>
<el-table-column label="发生日期" :align="alignment">
<el-table-column prop="c17" label="月" :align="alignment">
</el-table-column>
<el-table-column prop="c18" label="日" :align="alignment">
</el-table-column>
</el-table-column>
<el-table-column prop="c19" label="年最低潮位(m)" :align="alignment">
</el-table-column>
<el-table-column label="发生日期" :align="alignment">
<el-table-column prop="c20" label="月" :align="alignment">
</el-table-column>
<el-table-column prop="c21" label="日" :align="alignment">
</el-table-column>
</el-table-column>
<el-table-column prop="c22" label="冻结基面与绝对基面高差(m)" :align="alignment">
</el-table-column>
<el-table-column prop="c23" label="绝对或假定基面名称" :align="alignment">
</el-table-column>
<el-table-column prop="c24" label="附注" :align="alignment">
</el-table-column>
</el-table>
</pane>
</splitpanes>
</div>
</template>
<script setup>
import dayjs from 'dayjs';
import { Splitpanes, Pane } from 'splitpanes'
import 'splitpanes/dist/splitpanes.css'
import ETree from '@/components/ETree/index.vue'
import { ref, reactive, onMounted } from 'vue';
import useAppStore from '@/store/modules/app'
const device = computed(() => useAppStore().device);
const props = defineProps({
tableTitle: {
type: String,
default: '表格标题'
},
})
const { proxy } = getCurrentInstance()
const alignment = 'center'
const firstSize = ref(proxy.SPLITPANES_CONFIG.DEFAULT_SIZE)
const stationType = 'D'
const eTreeRef = ref(null)
let stnmIdsList = []
//
const handleStationChange = (stnmIds) => {
stnmIdsList = stnmIds
queryParams.stnmIds = stnmIds.join(',')
if (stnmIdsList.length == 0) {
proxy.$modal.msgWarning("请选择站点后查询");
return
} else if (stnmIdsList.length > 50) {
proxy.$modal.msg("站点最多可选择50个");
return
} else {
loading.value = true;
getList()
}
}
const loading = ref(false);
const tableData = ref([]);
const queryParams = reactive({
year: dayjs(new Date()).format('YYYY'),
stnmIds: '',
});
const getList = async () => {
loading.value = true;
try {
const res = await proxy.axiosGet('/report/gzyntidedzbdata', queryParams)
if (res.code == 0) {
tableData.value = res.data
}
loading.value = false
} catch (error) {
loading.value = false
}
}
//
const handleQuery = () => {
getList()
}
//
const handleExport = () => { }
</script>

133
src/views/report/jslsmzflylb/index.vue

@ -0,0 +1,133 @@ @@ -0,0 +1,133 @@
<template>
<div class="app-container app-container-bg">
<el-card class="first-card" ref='firstCard' shadow="always">
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="warning" icon="Download" @click="handleExport">下载</el-button>
</el-col>
</el-row>
</el-card>
<div class="el-card-p card-shadow carder-border mt10 pad10 ">
<div class="main-table-header">
<div class="table-title">{{tableTitle}}</div>
<div class="table-time mb5">
<div>
<span>年份: </span><span id="title1">{{ dayjs(new Date()).format('YYYY') }}</span>
</div>
</div>
</div>
<el-table class="report-table" v-table-height="{bottom:100}" v-loading="loading" border :data="tableData" style="width: 100%;" ref="tableRef" @scroll="handleScroll">
<el-table-column label="站次" :align="alignment" type="index">
</el-table-column>
<el-table-column prop="c1" label="测站编码" width="180" :align="alignment">
</el-table-column>
<el-table-column prop="c2" label="水系" :align="alignment">
</el-table-column>
<el-table-column prop="c3" label="河名" :align="alignment">
</el-table-column>
<el-table-column prop="c4" label="站名" :align="alignment">
</el-table-column>
<el-table-column prop="c5" label="站别" :align="alignment">
</el-table-column>
<el-table-column prop="c6" label="观测场地点" width="180" :align="alignment">
</el-table-column>
<el-table-column label="坐标" :align="alignment">
<el-table-column label="东经" :align="alignment">
<el-table-column prop="c7" width="100" label="度分" :align="alignment">
</el-table-column>
</el-table-column>
<el-table-column label="北纬" :align="alignment">
<el-table-column prop="c8" label="度分" width="100" :align="alignment">
</el-table-column>
</el-table-column>
</el-table-column>
<el-table-column label="设立日期" :align="alignment">
<el-table-column prop="c9" label="年" :align="alignment">
</el-table-column>
<el-table-column prop="c10" label="月" :align="alignment">
</el-table-column>
</el-table-column>
<el-table-column label="测雨仪器" :align="alignment">
<el-table-column prop="c11" label="绝对高程" :align="alignment">
</el-table-column>
<el-table-column prop="c12" label="器口离地面高度" :align="alignment">
</el-table-column>
<el-table-column prop="c13" label="型式" :align="alignment">
</el-table-column>
</el-table-column>
<el-table-column label="资料项目" :align="alignment">
<el-table-column prop="c14" label="降水量" :align="alignment">
</el-table-column>
<el-table-column prop="c15" label="水面蒸发" :align="alignment">
</el-table-column>
</el-table-column>
<el-table-column prop="c16" label="领导机关" :align="alignment">
</el-table-column>
</el-table>
</div>
</div>
</template>
<script setup>
import dayjs from 'dayjs';
import { ref, reactive, onMounted, onBeforeUnmount, nextTick } from 'vue';
const props = defineProps({
tableTitle: {
type: String,
default: '降水量、水面蒸发量站一览表'
},
})
const { proxy } = getCurrentInstance()
const alignment = 'center'
const loading = ref(false);
const tableData = ref([]);
const queryParams = reactive({
page: 1,
limit: 20
});
//
const getList = async () => {
if (!hasMore.value || loading.value) return; //
loading.value = true;
try {
const res = await proxy.axiosGet('/ycraindata/getAreaStationByType/A', queryParams)
if (res.code == 0) {
//
if (queryParams.page === 1) {
tableData.value = res.data;
} else {
tableData.value = [...tableData.value, ...res.data];
}
//
if (res.data.length < queryParams.limit) {
hasMore.value = false;
}
}
loading.value = false;
} catch (error) {
loading.value = false;
}
}
const tableRef = ref(null);
const hasMore = ref(true); //
//
const handleScroll = () => {
};
//
onMounted(() => {
getList();
});
//
const handleExport = () => { }
</script>

95
src/views/report/reportll/index.vue

@ -0,0 +1,95 @@ @@ -0,0 +1,95 @@
<template>
<div class="report-rain">
<div class="tjfx-menu">
<el-select v-model="menu" placeholder="请选择">
<el-option v-for="dict in tjfxMenus" :key="dict.value" :label="dict.label" :value="dict.value" />
</el-select>
</div>
<!-- 添加加载状态和错误提示 -->
<div v-if="componentError" class="error-message">
<el-empty description="组件加载失败,请刷新页面重试" />
</div>
<component v-else :is="currentComponent" :tableTitle="tableTitle"></component>
</div>
</template>
<script setup>
import { ref, computed, defineAsyncComponent } from 'vue'
//
const tjfxMenus = [
{
value: '1',
label: '月年平均流量对照表'
},
{
value: '2',
label: '逐日平均流量表'
},
{
value: '3',
label: '实测大断面成果表'
},
{
value: '4',
label: '实测流量成果表'
},
// {
// value: '5',
// label: ''
// }
]
//
const menu = ref(tjfxMenus.length > 0 ? tjfxMenus[0].value : '')
//
const componentMap = {
'1': defineAsyncComponent(() => import('@/views/report/gzynlldzb/index.vue')),
'2': defineAsyncComponent(() => import('@/views/report/zrll/index.vue')),
'3': defineAsyncComponent(() => import('@/views/report/scddm/index.vue')),
'4': defineAsyncComponent(() => import('@/views/report/scllcgb/index.vue')),
'5': defineAsyncComponent(() => import('@/views/report/pjhsl/index.vue')),
}
//
const componentError = ref(false)
onErrorCaptured((error) => {
componentError.value = true
return true
})
//
const currentComponent = computed(() => {
return componentMap[menu.value]
})
// tjfxMenus name
const tableTitle = computed(() => {
const currentItem = tjfxMenus.find(item => item.value === menu.value);
return currentItem ? currentItem.label : '';
})
</script>
<style lang="scss">
.tjfx-menu {
position: absolute;
right: 25px;
top: 30px;
z-index: 999999;
.el-input__wrapper {
background: #10163A;
}
.el-input__inner {
background: #10163A;
color: #fff;
border-color: #10163A;
}
.el-select .el-input .el-select__caret {
color: #fff !important;
}
}
</style>

10
src/views/report/reportrain/index.vue

@ -9,7 +9,7 @@ @@ -9,7 +9,7 @@
<div v-if="componentError" class="error-message">
<el-empty description="组件加载失败,请刷新页面重试" />
</div>
<component :is="currentComponent" :tableTitle="tableTitle"></component>
<component v-else :is="currentComponent" :tableTitle="tableTitle"></component>
</div>
</template>
@ -23,10 +23,10 @@ @@ -23,10 +23,10 @@
value: '1',
label: '降水量、水面蒸发量站一览表'
},
// {
// value: '2',
// label: ''
// },
{
value: '2',
label: '各站月年降水量对照表'
},
{
value: '3',
label: '逐日降水量表'

2
src/views/report/reporttide/index.vue

@ -7,7 +7,7 @@ @@ -7,7 +7,7 @@
</div>
<!-- 添加加载状态和错误提示 -->
<div v-if="componentError" class="error-message">
组件加载失败请刷新页面重试
<el-empty description="组件加载失败,请刷新页面重试" />
</div>
<component v-else :is="currentComponent" :tableTitle="tableTitle"></component>
</div>

36
src/views/report/reportwater/index.vue

@ -7,9 +7,9 @@ @@ -7,9 +7,9 @@
</div>
<!-- 添加加载状态和错误提示 -->
<div v-if="componentError" class="error-message">
组件加载失败请刷新页面重试
<el-empty description="组件加载失败,请刷新页面重试" />
</div>
<component :is="currentComponent" :tableTitle="tableTitle"></component>
<component v-else :is="currentComponent" :tableTitle="tableTitle"></component>
</div>
</template>
@ -19,26 +19,26 @@ @@ -19,26 +19,26 @@
//
const tjfxMenus = [
// {
// value: '1',
// label: ''
// },
// {
// value: '2',
// label: ''
// },
{
value: '1',
label: '水位、水文站一览表'
},
{
value: '2',
label: '各站月年平均水位对照表'
},
{
value: '3',
label: '逐日平均水位表'
},
// {
// value: '4',
// label: ''
// },
// {
// value: '5',
// label: ''
// },
{
value: '4',
label: '月最高水位及出现日期'
},
{
value: '5',
label: '月最低水位及出现日期'
},
{
value: '6',
label: '洪水水位摘录表'

187
src/views/report/swpeak/index.vue

@ -0,0 +1,187 @@ @@ -0,0 +1,187 @@
<template>
<div class="app-container app-container-bg">
<el-card class="first-card" ref='firstCard' shadow="always">
<el-form :model="queryParams" ref="queryForm" :inline="true" @submit.native.prevent>
<el-form-item label="类型">
<el-select v-model="stationType" placeholder="请选择类型" class="w150" @change="changeStationType">
<el-option label="水库" value="C"></el-option>
<el-option label="河道" value="B"></el-option>
</el-select>
</el-form-item>
<el-form-item label="年份">
<el-date-picker v-model="queryParams.year" type="year" value-format="YYYY" placeholder="选择年" :clearable="false">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
<el-button type="warning" icon="Download" @click="handleExport">下载</el-button>
</el-form-item>
</el-form>
</el-card>
<splitpanes :horizontal="device === 'mobile'" class="el-card-p card-shadow carder-border mt10 pad10 default-theme container-box" :push-other-panes="false">
<pane :size="firstSize" :min-size="SPLITPANES_CONFIG.MIN_SIZE" :max-size="SPLITPANES_CONFIG.MAX_SIZE" ref="firstPane" class="mr10">
<e-tree ref="eTreeRef" :stationType="stationType" @stationChange="handleStationChange"></e-tree>
</pane>
<pane :size="100 - firstSize" class="pad10">
<div class="main-table-header">
<div class="table-title">{{tableTitle}}</div>
<div class="table-time mb5">
<div>
<span>年份: </span><span id="title1">{{ queryParams.year }}</span>
</div>
</div>
</div>
<el-table class="report-table" v-table-height="{bottom:100}" v-loading="loading" :data="tableData" style="width: 100%;">
<el-table-column fixed prop="stnm" label="站名" width="150" :align="alignment">
</el-table-column>
<el-table-column label="一月" :align="alignment">
<el-table-column prop="data1" label="最高" :align="alignment">
</el-table-column>
<el-table-column prop="data2" label="日期" :align="alignment">
</el-table-column>
</el-table-column>
<el-table-column label="二月" :align="alignment">
<el-table-column prop="data3" label="最高" :align="alignment">
</el-table-column>
<el-table-column prop="data4" label="日期" :align="alignment">
</el-table-column>
</el-table-column>
<el-table-column label="三月" :align="alignment">
<el-table-column prop="data5" label="最高" :align="alignment">
</el-table-column>
<el-table-column prop="data6" label="日期" :align="alignment">
</el-table-column>
</el-table-column>
<el-table-column label="四月" :align="alignment">
<el-table-column prop="data7" label="最高" :align="alignment">
</el-table-column>
<el-table-column prop="data8" label="日期" :align="alignment">
</el-table-column>
</el-table-column> <el-table-column label="" :align="alignment">
<el-table-column prop="data9" label="最高" :align="alignment">
</el-table-column>
<el-table-column prop="data10" label="日期" :align="alignment">
</el-table-column>
</el-table-column> <el-table-column label="" :align="alignment">
<el-table-column prop="data11" label="最高" :align="alignment">
</el-table-column>
<el-table-column prop="data12" label="日期" :align="alignment">
</el-table-column>
</el-table-column>
<el-table-column label="七月" :align="alignment">
<el-table-column prop="data13" label="最高" :align="alignment">
</el-table-column>
<el-table-column prop="data14" label="日期" :align="alignment">
</el-table-column>
</el-table-column>
<el-table-column label="八月" :align="alignment">
<el-table-column prop="data15" label="最高" :align="alignment">
</el-table-column>
<el-table-column prop="data16" label="日期" :align="alignment">
</el-table-column>
</el-table-column>
<el-table-column label="九月" :align="alignment">
<el-table-column prop="data17" label="最高" :align="alignment">
</el-table-column>
<el-table-column prop="data18" label="日期" :align="alignment">
</el-table-column>
</el-table-column>
<el-table-column label="十月" :align="alignment">
<el-table-column prop="data19" label="最高" :align="alignment">
</el-table-column>
<el-table-column prop="data20" label="日期" :align="alignment">
</el-table-column>
</el-table-column>
<el-table-column label="十一月" :align="alignment">
<el-table-column prop="data21" label="最高" :align="alignment">
</el-table-column>
<el-table-column prop="data22" label="日期" :align="alignment">
</el-table-column>
</el-table-column>
<el-table-column label="十二月" :align="alignment">
<el-table-column prop="data23" label="最高" :align="alignment">
</el-table-column>
<el-table-column prop="data24" label="日期" :align="alignment">
</el-table-column>
</el-table-column>
</el-table>
</pane>
</splitpanes>
</div>
</template>
<script setup>
import dayjs from 'dayjs';
import { Splitpanes, Pane } from 'splitpanes'
import 'splitpanes/dist/splitpanes.css'
import ETree from '@/components/ETree/index.vue'
import { ref, reactive, onMounted } from 'vue';
import useAppStore from '@/store/modules/app'
const device = computed(() => useAppStore().device);
const props = defineProps({
tableTitle: {
type: String,
default: '月最高水位及出现日期'
},
})
const { proxy } = getCurrentInstance()
const alignment = 'center'
const firstSize = ref(proxy.SPLITPANES_CONFIG.DEFAULT_SIZE)
const stationType = ref('C')
let stnmIdsList = []
//
const handleStationChange = (stnmIds) => {
stnmIdsList = stnmIds
queryParams.stnmIds = stnmIds.join(',')
if (stnmIdsList.length == 0) {
proxy.$modal.msgWarning("请选择站点后查询");
return
} else if (stnmIdsList.length > 50) {
proxy.$modal.msg("站点最多可选择50个");
return
} else {
loading.value = true;
getList()
}
}
const loading = ref(false);
const tableData = ref([]);
const queryParams = reactive({
year: dayjs(new Date()).format('YYYY'),
stnmIds: '',
peakType:0
});
const getList = async () => {
loading.value = true;
try {
const res = await proxy.axiosGet('/report/swpeakdata', queryParams)
if (res.code == 0) {
tableData.value = res.data
}
loading.value = false
} catch (error) {
loading.value = false
}
}
//
const handleQuery = () => {
getList()
}
//
const eTreeRef = ref(null)
const changeStationType = (val) => {
stationType.value = val
nextTick(() => {
if (eTreeRef.value) {
eTreeRef.value.getTreeStation();
}
})
}
//
const handleExport = () => { }
</script>

188
src/views/report/swpeakmin/index.vue

@ -0,0 +1,188 @@ @@ -0,0 +1,188 @@
<template>
<div class="app-container app-container-bg">
<el-card class="first-card" ref='firstCard' shadow="always">
<el-form :model="queryParams" ref="queryForm" :inline="true" @submit.native.prevent>
<el-form-item label="类型">
<el-select v-model="stationType" placeholder="请选择类型" class="w150" @change="changeStationType">
<el-option label="水库" value="C"></el-option>
<el-option label="河道" value="B"></el-option>
</el-select>
</el-form-item>
<el-form-item label="年份">
<el-date-picker v-model="queryParams.year" type="year" value-format="YYYY" placeholder="选择年" :clearable="false">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
<el-button type="warning" icon="Download" @click="handleExport">下载</el-button>
</el-form-item>
</el-form>
</el-card>
<splitpanes :horizontal="device === 'mobile'" class="el-card-p card-shadow carder-border mt10 pad10 default-theme container-box" :push-other-panes="false">
<pane :size="firstSize" :min-size="SPLITPANES_CONFIG.MIN_SIZE" :max-size="SPLITPANES_CONFIG.MAX_SIZE" ref="firstPane" class="mr10">
<e-tree ref="eTreeRef" :stationType="stationType" @stationChange="handleStationChange"></e-tree>
</pane>
<pane :size="100 - firstSize" class="pad10">
<div class="main-table-header">
<div class="table-title">{{tableTitle}}</div>
<div class="table-time mb5">
<div>
<span>年份: </span><span id="title1">{{ queryParams.year }}</span>
</div>
</div>
</div>
<el-table class="report-table" v-table-height="{bottom:100}" v-loading="loading" :data="tableData" style="width: 100%;">
<el-table-column fixed prop="stnm" label="站名" width="150" :align="alignment">
</el-table-column>
<el-table-column label="一月" :align="alignment">
<el-table-column prop="data1" label="最低" :align="alignment">
</el-table-column>
<el-table-column prop="data2" label="日期" :align="alignment">
</el-table-column>
</el-table-column>
<el-table-column label="二月" :align="alignment">
<el-table-column prop="data3" label="最低" :align="alignment">
</el-table-column>
<el-table-column prop="data4" label="日期" :align="alignment">
</el-table-column>
</el-table-column>
<el-table-column label="三月" :align="alignment">
<el-table-column prop="data5" label="最低" :align="alignment">
</el-table-column>
<el-table-column prop="data6" label="日期" :align="alignment">
</el-table-column>
</el-table-column>
<el-table-column label="四月" :align="alignment">
<el-table-column prop="data7" label="最低" :align="alignment">
</el-table-column>
<el-table-column prop="data8" label="日期" :align="alignment">
</el-table-column>
</el-table-column> <el-table-column label="" :align="alignment">
<el-table-column prop="data9" label="最低" :align="alignment">
</el-table-column>
<el-table-column prop="data10" label="日期" :align="alignment">
</el-table-column>
</el-table-column> <el-table-column label="" :align="alignment">
<el-table-column prop="data11" label="最低" :align="alignment">
</el-table-column>
<el-table-column prop="data12" label="日期" :align="alignment">
</el-table-column>
</el-table-column>
<el-table-column label="七月" :align="alignment">
<el-table-column prop="data13" label="最低" :align="alignment">
</el-table-column>
<el-table-column prop="data14" label="日期" :align="alignment">
</el-table-column>
</el-table-column>
<el-table-column label="八月" :align="alignment">
<el-table-column prop="data15" label="最低" :align="alignment">
</el-table-column>
<el-table-column prop="data16" label="日期" :align="alignment">
</el-table-column>
</el-table-column>
<el-table-column label="九月" :align="alignment">
<el-table-column prop="data17" label="最低" :align="alignment">
</el-table-column>
<el-table-column prop="data18" label="日期" :align="alignment">
</el-table-column>
</el-table-column>
<el-table-column label="十月" :align="alignment">
<el-table-column prop="data19" label="最低" :align="alignment">
</el-table-column>
<el-table-column prop="data20" label="日期" :align="alignment">
</el-table-column>
</el-table-column>
<el-table-column label="十一月" :align="alignment">
<el-table-column prop="data21" label="最低" :align="alignment">
</el-table-column>
<el-table-column prop="data22" label="日期" :align="alignment">
</el-table-column>
</el-table-column>
<el-table-column label="十二月" :align="alignment">
<el-table-column prop="data23" label="最低" :align="alignment">
</el-table-column>
<el-table-column prop="data24" label="日期" :align="alignment">
</el-table-column>
</el-table-column>
</el-table>
</pane>
</splitpanes>
</div>
</template>
<script setup>
import dayjs from 'dayjs';
import { Splitpanes, Pane } from 'splitpanes'
import 'splitpanes/dist/splitpanes.css'
import ETree from '@/components/ETree/index.vue'
import { ref, reactive, onMounted } from 'vue';
import useAppStore from '@/store/modules/app'
const device = computed(() => useAppStore().device);
const props = defineProps({
tableTitle: {
type: String,
default: '月最低水位及出现日期'
},
})
const { proxy } = getCurrentInstance()
const alignment = 'center'
const firstSize = ref(proxy.SPLITPANES_CONFIG.DEFAULT_SIZE)
const stationType = ref('C')
let stnmIdsList = []
//
const handleStationChange = (stnmIds) => {
stnmIdsList = stnmIds
queryParams.stnmIds = stnmIds.join(',')
if (stnmIdsList.length == 0) {
proxy.$modal.msgWarning("请选择站点后查询");
return
} else if (stnmIdsList.length > 50) {
proxy.$modal.msg("站点最多可选择50个");
return
} else {
loading.value = true;
getList()
}
}
const loading = ref(false);
const tableData = ref([]);
const queryParams = reactive({
year: dayjs(new Date()).format('YYYY'),
stnmIds: '',
peakType: 1
});
const getList = async () => {
loading.value = true;
try {
const res = await proxy.axiosGet('/report/swpeakdata', queryParams)
if (res.code == 0) {
tableData.value = res.data
}
loading.value = false
} catch (error) {
loading.value = false
}
}
//
const handleQuery = () => {
getList()
}
//
const eTreeRef = ref(null)
const changeStationType = (val) => {
stationType.value = val
nextTick(() => {
if (eTreeRef.value) {
eTreeRef.value.getTreeStation();
}
})
}
//
const handleExport = () => { }
</script>

163
src/views/report/swswzylb/index.vue

@ -0,0 +1,163 @@ @@ -0,0 +1,163 @@
<template>
<div class="app-container app-container-bg">
<el-card class="first-card" ref='firstCard' shadow="always">
<el-form :model="queryParams" ref="queryForm" :inline="true" @submit.native.prevent>
<el-form-item label="类型">
<el-select v-model="stationType" placeholder="请选择类型" class="w150" @change="changeStationType">
<el-option label="水库" value="C"></el-option>
<el-option label="河道" value="B"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
<el-button type="warning" icon="Download" @click="handleExport">下载</el-button>
</el-form-item>
</el-form>
</el-card>
<splitpanes :horizontal="device === 'mobile'" class="el-card-p card-shadow carder-border mt10 pad10 default-theme container-box" :push-other-panes="false">
<pane :size="firstSize" :min-size="SPLITPANES_CONFIG.MIN_SIZE" :max-size="SPLITPANES_CONFIG.MAX_SIZE" ref="firstPane" class="mr10">
<e-tree ref="eTreeRef" :stationType="stationType" @stationChange="handleStationChange"></e-tree>
</pane>
<pane :size="100 - firstSize" class="pad10">
<div class="main-table-header">
<div class="table-title">{{tableTitle}}</div>
<div class="table-time mb5">
<div>
<span>年份: </span><span id="title1">{{ dayjs(new Date()).format('YYYY') }}</span>
</div>
</div>
</div>
<el-table class="report-table" v-table-height="{bottom:100}" v-loading="loading" :data="tableData" style="width: 100%;">
<el-table-column label="站次" :align="alignment" type="index" :index="indexMethod">
</el-table-column>
<el-table-column prop="c1" label="测站编码" width="120" :align="alignment">
</el-table-column>
<el-table-column prop="c2" label="水系" width="120" :align="alignment">
</el-table-column>
<el-table-column prop="c3" label="河名" :align="alignment">
</el-table-column>
<el-table-column prop="c4" label="流入何处" :align="alignment">
</el-table-column>
<el-table-column prop="c5" label="站名" width="120" :align="alignment">
</el-table-column>
<el-table-column prop="c6" label="站别" :align="alignment">
</el-table-column>
<el-table-column prop="c7" label="断面地点" :align="alignment">
</el-table-column>
<el-table-column label="坐标" :align="alignment">
<el-table-column label="东经" :align="alignment">
<el-table-column prop="c8" width="100" label="度分" :align="alignment">
</el-table-column>
</el-table-column>
<el-table-column label="北纬" :align="alignment">
<el-table-column prop="c9" label="度分" width="100" :align="alignment">
</el-table-column>
</el-table-column>
</el-table-column>
<el-table-column prop="c10" label="至河口距离(km)" :align="alignment">
</el-table-column>
<el-table-column prop="c11" label="集水面积(k㎡)" :align="alignment">
</el-table-column>
<el-table-column label="设立日 期" :align="alignment">
<el-table-column prop="c12" label="年" :align="alignment">
</el-table-column>
<el-table-column prop="c13" label="月" :align="alignment">
</el-table-column>
</el-table-column>
<el-table-column prop="c14" label="冻结基面与绝对基面高差(m)" :align="alignment">
</el-table-column>
<el-table-column prop="c15" label="绝对或假定基面名称" :align="alignment">
</el-table-column>
<el-table-column label="项目资料" :align="alignment">
<el-table-column prop="c16" label="水位" :align="alignment">
</el-table-column>
<el-table-column prop="c17" label="流量" :align="alignment">
</el-table-column>
<el-table-column prop="c18" label="含沙量" :align="alignment">
</el-table-column>
<el-table-column prop="19" label="颗粒级配" :align="alignment">
</el-table-column>
<el-table-column prop="c20" label="水文冰凌" :align="alignment">
</el-table-column>
</el-table-column>
<el-table-column prop="c21" label="领导机关" :align="alignment">
</el-table-column>
</el-table>
</pane>
</splitpanes>
</div>
</template>
<script setup>
import dayjs from 'dayjs';
import { Splitpanes, Pane } from 'splitpanes'
import 'splitpanes/dist/splitpanes.css'
import ETree from '@/components/ETree/index.vue'
import { ref, reactive, onMounted } from 'vue';
import useAppStore from '@/store/modules/app'
const device = computed(() => useAppStore().device);
const props = defineProps({
tableTitle: {
type: String,
default: '表格标题'
},
})
const { proxy } = getCurrentInstance()
const alignment = 'center'
const firstSize = ref(proxy.SPLITPANES_CONFIG.DEFAULT_SIZE)
const stationType = ref('C')
let stnmIdsList = []
//
const handleStationChange = (stnmIds) => {
stnmIdsList = stnmIds
queryParams.stnmIds = stnmIds.join(',')
if (stnmIdsList.length == 0) {
proxy.$modal.msgWarning("请选择站点后查询");
return
} else if (stnmIdsList.length > 50) {
proxy.$modal.msg("站点最多可选择50个");
return
} else {
loading.value = true;
getList()
}
}
const loading = ref(false);
const tableData = ref([]);
const queryParams = reactive({
stnmIds: '',
});
const getList = async () => {
loading.value = true;
try {
const res = await proxy.axiosGet('/report/swswzylbdata', queryParams)
if (res.code == 0) {
tableData.value = res.data
}
loading.value = false
} catch (error) {
loading.value = false
}
}
//
const handleQuery = () => {
getList()
}
//
const eTreeRef = ref(null)
const changeStationType = (val) => {
stationType.value = val
nextTick(() => {
if (eTreeRef.value) {
eTreeRef.value.getTreeStation();
}
})
}
//
const handleExport = () => { }
</script>

404
src/views/report/tide1/index.vue

@ -0,0 +1,404 @@ @@ -0,0 +1,404 @@
<template>
<div class="app-container app-container-bg">
<el-card class="first-card" ref='firstCard' shadow="always">
<el-form :model="queryParams" ref="queryForm" :inline="true" @submit.native.prevent>
<el-form-item label="选择站点">
<!-- <singleStation ref="singleStationRef" :stationType="stationType" @stationChange="handleStationChange" @loadingChange="handleStationLoading" /> -->
<ESelectSingle ref="eSelectSingle" :stationType="stationType" @stationChange="handleStationChange" @loadingChange="handleStationLoading" />
</el-form-item>
<el-form-item label="年份">
<el-date-picker v-model="queryParams.year" type="year" value-format="YYYY" placeholder="选择年" :clearable="false">
</el-date-picker>
</el-form-item>
<el-form-item label="时段">
<el-select v-model="queryParams.month" placeholder="请选择时段" clearable class="w150">
<el-option v-for="dict in monthList" :key="dict.month" :label="dict.monthName" :value="dict.month" />
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
<el-button type="warning" icon="Download" @click="handleExport">下载</el-button>
</el-form-item>
</el-form>
</el-card>
<div class="el-card-p card-shadow carder-border mt10 pad10 scroll-bar" style="max-width: 100%; overflow-x: hidden;padding-top:0" v-loading="loading">
<div class="main-table-header " style="width: 1200px;margin:0 auto">
<div class="table-title">{{tableTitle}}</div>
<div class="table-time mb5">
<div>
<span>年份: </span><span id="title1">{{queryParams.year }}</span>
</div>
<div>
<span>测站编码: </span><span id="title2">{{queryParams.stnmId}}</span>
</div>
<div>
<span>{{title}} </span><span id="title3" class="pl10">m= 85基准基准基面以上米数</span>
</div>
</div>
<div v-if="tableData.length!==0" style="border:1px solid #000;text-align: center;border-bottom:none;padding:10px 0;">{{queryParams.month}}</div>
</div>
<div v-if="tableData.length>0">
<div style="width:1200px;margin:0 auto;display: flex;" class="table-box">
<template v-for="(itemTableData,index) in tableData" :key="index">
<el-table class="report-table top-table" :data="itemTableData" :cell-class-name="tableCellClassName">
<el-table-column v-for="(item, idx) in columnData" :key="idx" :label="item.label" :align="item.align" :prop="item.prop" :width="item.width">
</el-table-column>
</el-table>
</template>
</div>
<el-table class="report-table bottom-table" :data="countData" style="width: 1200px;margin:0 auto;border-top:none !important" :span-method="arraySpanMethod2">
<el-table-column v-for="(item, idx) in columnData2" :key="idx" :label="item.label" :align="item.align" :prop="item.prop" :width="item.width">
</el-table-column>
</el-table>
</div>
<el-empty v-else description="暂无数据" />
</div>
</div>
</template>
<script setup>
import dayjs from 'dayjs';
import singleStation from '@/components/SingleStation/index.vue'
import ESelectSingle from '@/components/ESelectSingle/index.vue'
import { ref, reactive, onMounted } from 'vue';
const props = defineProps({
tableTitle: {
type: String,
default: '逐潮高低潮位表'
},
})
const { proxy } = getCurrentInstance()
const stationType = 'D'
const singleStationRef = ref(null)
const handleStationLoading = (loadingState) => {
loading.value = loadingState;
}
//
const handleStationChange = (stnmId) => {
queryParams.stnmId = stnmId
if (stnmId == undefined) {
proxy.$modal.msgWarning("请选择站点后查询");
return
} else {
getList()
}
}
const loading = ref(false);
const tableData = ref([]);
const countData = ref([]);
const queryParams = reactive({
year: dayjs(new Date()).format('YYYY'),
month: '01'
});
const title = ref('')
const getList = async () => {
loading.value = true;
try {
const res = await proxy.axiosGet('/report/getTide1ReportData', queryParams)
if (res.code == 0) {
title.value = res.rTitle
let data = res.data
//
const maxLength = Math.max(...data.map(item => item.length));
data = data.map(list => {
//
while (list.length < maxLength) {
list.push({
date: null,
flag: '',
value: '',
mint: '',
differ: '',
duration: ''
});
}
let previousDate = null;
return list.map((item, index) => {
item.flag = item.flag == '1' ? '高' : item.flag == '0' ? '低' : ''
if (index == 0) {
item.differ = null
item.duration = null
}
//
if (item.date === previousDate) {
item.date = null;
} else {
previousDate = item.date;
}
return item
});
});
tableData.value = data
let countList = res.countData.map(item => {
item.yue = '月统计'
return item
})
//
countList.push({
'yue': '附注',
name: ''
})
countData.value = countList
}
} catch (error) {
} finally {
loading.value = false
}
}
//
const changeStationType = (val) => {
queryParams.stationType = val
queryParams.type = val == 'B' ? 1 : 0
}
//
const handleQuery = () => {
getList()
}
//
const resetQuery = () => { }
//
const handleExport = () => { }
onMounted(() => { })
const columnData = ref([
{ label: '日期', prop: 'date', align: "center", width: '66' },
{ label: '潮别', prop: 'flag', align: "center", width: '69' },
{ label: '潮位', prop: 'value', align: "center", width: '66' },
{ label: '时分', prop: 'mint', align: "center", width: '66' },
{ label: '潮差', prop: 'differ', align: "center", width: '66' },
{ label: '历时', prop: 'duration', align: "center", width: '66' },
])
const columnData2 = ref([
{ label: '', prop: 'yue', align: "center", width: '66' },
{ label: '项目', prop: 'name', align: "center", width: '135' },
{ label: '最高\n(大)', prop: 'max', align: "center", width: '132' },
{ label: '日', prop: 'maxDate', align: "center", width: '66' },
{ label: '时分', prop: 'maxMint', align: "center", width: '66.98' },
{ label: '夏历\n月-日', prop: 'maxNdate', align: "center", width: '135' },
{ label: '最低\n(小)', prop: 'min', align: "center", width: '132' },
{ label: '日', prop: 'minDate', align: "center", width: '67' },
{ label: '时分', prop: 'minMint', align: "center", width: '67' },
{ label: '夏历\n月-日', prop: 'minNdate', align: "center", width: '135' },
{ label: '平均', prop: 'avg', align: "center", width: '66' },
{ label: '月总数', prop: 'sum', align: "center", width: '66' },
{ label: '次数', prop: 'count', align: "center", width: '66' },
])
//
const tableCellClassName = ({ row, column }) => {
if (column && column.property === 'flag') {
if (row.flag === '高') return 'flag-high-right'
if (row.flag === '低') return 'flag-low-left'
}
return ''
}
const arraySpanMethod = ({ row, column, rowIndex, columnIndex }) => {
let rowList = [31, 32, 33, 34, 35, 36, 37, 38]
//
if (!rowList.includes(rowIndex)) {
if (columnIndex === 0) {
//
return [1, 2];
} else if (columnIndex === 1) {
//
return [0, 0];
}
}
//
if (rowIndex >= 31 && rowIndex <= 35) {
if (columnIndex === 0) {
return rowIndex === 31 ? [5, 1] : [0, 0];
}
if (columnIndex === 1) return [1, 1];
}
//
if (rowIndex >= 36 && rowIndex <= 38) {
if (columnIndex === 0) {
return rowIndex === 36 ? [3, 2] : [0, 0];
}
if (columnIndex === 1) return [0, 0];
if (rowIndex == 36) {
if (columnIndex === 2) {
return [1, 1];
} else if (columnIndex === 3) {
return [1, 3];
} else if (columnIndex === 4) {
return [1, 1];
} else if (columnIndex === 5) {
return [1, 3];
} else if (columnIndex === 6) {
return [1, 1];
} else if (columnIndex === 7) {
return [1, 3];
} else {
return [0, 0];
}
}
}
//
if (rowIndex === tableData.value.length - 1) {
if (columnIndex === 1) {
return [1, 2];
} else if (columnIndex === 2) {
return [1, 12];
} else {
return [0, 0];
}
}
//
return [1, 1];
}
const arraySpanMethod2 = ({ row, column, rowIndex, columnIndex }) => {
// ""
let yueRowsStartIndex = -1;
let yueRowsEndIndex = -1;
for (let i = 0; i < countData.value.length; i++) {
if (countData.value[i].yue === '月统计') {
if (yueRowsStartIndex === -1) {
yueRowsStartIndex = i;
}
yueRowsEndIndex = i;
}
}
// ""
if (yueRowsStartIndex !== -1 && rowIndex >= yueRowsStartIndex &&
rowIndex <= yueRowsEndIndex && yueRowsEndIndex > yueRowsStartIndex) {
if (columnIndex === 0) {
if (rowIndex === yueRowsStartIndex) {
// ""
return [yueRowsEndIndex - yueRowsStartIndex + 1, 1];
} else {
//
return [0, 0];
}
}
}
// ""
if (row.yue === '附注') {
if (columnIndex === 0) {
// 13
return [1, 1];
} else if (columnIndex === 1) {
return [1, 12];
} else {
//
return [0, 0];
}
}
//
return [1, 1];
}
const monthList = [
{ month: "01", monthName: "1月" },
{ month: "02", monthName: "2月" },
{ month: "03", monthName: "3月" },
{ month: "04", monthName: "4月" },
{ month: "05", monthName: "5月" },
{ month: "06", monthName: "6月" },
{ month: "07", monthName: "7月" },
{ month: "08", monthName: "8月" },
{ month: "09", monthName: "9月" },
{ month: "10", monthName: "10月" },
{ month: "11", monthName: "11月" },
{ month: "12", monthName: "12月" },
]
</script>
<style scoped lang='scss'>
/* 潮别列根据高/低动态对齐 */
:deep(.flag-high-right) .cell {
text-align: right !important;
}
:deep(.flag-low-left) .cell {
text-align: left !important;
}
/* 为潮差和历时列的首尾行添加上移的下边框 */
.top-table :deep(.el-table__body tbody tr td:nth-child(5)),
.top-table :deep(.el-table__body tbody tr td:nth-child(5)),
.top-table :deep(.el-table__body tbody tr td:nth-child(6)),
.top-table :deep(.el-table__body tbody tr td:nth-child(6)) {
position: relative;
height: 20px !important;
line-height: 20px !important;
padding: 0 !important;
vertical-align: middle;
/* 隐藏原生边框 */
border-bottom: none !important;
.cell {
transform: translateY(-10px);
display: inline-block;
width: 100%;
text-align: center;
}
/* 添加伪元素模拟上移的边框 */
&::before {
content: '';
position: absolute;
bottom: 20px;
/* 边框上移 24px */
left: 0;
right: 0;
border-bottom: 1px solid #000;
pointer-events: none;
}
}
.top-table :deep(.el-table__body tbody tr:not(:first-child):not(:last-child) td:nth-child(5)),
.top-table :deep(.el-table__body tbody tr:not(:first-child):not(:last-child) td:nth-child(6)) {
height: 40px !important;
line-height: 40px !important;
padding: 0 !important;
}
.top-table :deep(.el-table__body tbody tr td:nth-child(4)) {
height: 40px !important;
line-height: 40px !important;
padding: 0 !important;
}
.table-box .top-table {
border-right: none !important;
}
.table-box .top-table:not(:first-child) {
border-left: none !important;
}
.bottom-table :deep(.cell) {
font-weight: 400 !important;
}
.bottom-table :deep(.el-table__body tbody tr td:last-child),
.bottom-table :deep(.el-table__header thead tr th:last-child) {
border-right: none !important;
}
.bottom-table :deep(.el-table__header tr th:first-child) {
border-bottom: none !important;
}
</style>

6
src/views/report/tide2/index.vue

@ -3,7 +3,8 @@ @@ -3,7 +3,8 @@
<el-card class="first-card" ref='firstCard' shadow="always">
<el-form :model="queryParams" ref="queryForm" :inline="true" @submit.native.prevent>
<el-form-item label="选择站点">
<singleStation ref="singleStationRef" :stationType="stationType" @stationChange="handleStationChange" />
<!-- <singleStation ref="singleStationRef" :stationType="stationType" @stationChange="handleStationChange" /> -->
<ESelectSingle ref="eSelectSingle" :stationType="stationType" @stationChange="handleStationChange" @loadingChange="handleStationLoading" />
</el-form-item>
<el-form-item label="年份">
<el-date-picker v-model="queryParams.year" type="year" value-format="YYYY" placeholder="选择年" :clearable="false">
@ -43,12 +44,13 @@ @@ -43,12 +44,13 @@
<script setup>
import dayjs from 'dayjs';
import singleStation from '@/components/SingleStation/index.vue'
import ESelectSingle from '@/components/ESelectSingle/index.vue'
import { ref, reactive, onMounted } from 'vue';
const props = defineProps({
tableTitle: {
type: String,
default: '表格标题'
default: '潮位月年统计表'
},
})

7
src/views/report/tide3/index.vue

@ -2,9 +2,9 @@ @@ -2,9 +2,9 @@
<div class="app-container app-container-bg">
<el-card class="first-card" ref='firstCard' shadow="always">
<el-form :model="queryParams" ref="queryForm" :inline="true" @submit.native.prevent>
<el-form-item label="选择站点">
<singleStation ref="singleStationRef" :stationType="stationType" @stationChange="handleStationChange" />
<!-- <singleStation ref="singleStationRef" :stationType="stationType" @stationChange="handleStationChange" /> -->
<ESelectSingle ref="eSelectSingle" :stationType="stationType" @stationChange="handleStationChange" @loadingChange="handleStationLoading" />
</el-form-item>
<el-form-item label="年份">
<el-date-picker v-model="queryParams.year" type="year" value-format="YYYY" placeholder="选择年" :clearable="false">
@ -95,12 +95,13 @@ @@ -95,12 +95,13 @@
<script setup>
import dayjs from 'dayjs';
import singleStation from '@/components/SingleStation/index.vue'
import ESelectSingle from '@/components/ESelectSingle/index.vue'
import { ref, reactive, onMounted } from 'vue';
const props = defineProps({
tableTitle: {
type: String,
default: '表格标题'
default: '潮位观测月报表'
},
})

16
src/views/report/waterZl/index.vue

@ -16,15 +16,15 @@ @@ -16,15 +16,15 @@
</el-form>
</el-card>
<div class="el-card-p card-shadow carder-border mt10 pad10" style="max-width: 100%; overflow-x: hidden;padding-top:0" v-loading="loading">
<div class="main-table-header sticky-header">
<div class="el-card-p card-shadow carder-border mt10 pad10 " style="max-width: 100%; overflow-x: hidden;padding-top:0" v-loading="loading">
<div class="main-table-header">
<div class="table-title">
<span class="pr10" v-if="selectStnm!==''">{{selectStnm}}</span>
<span>{{tableTitle}}</span>
</div>
</div>
<el-empty v-if="total==0" description="暂无数据" />
<div v-for="(item,index) in tableData" :key="index" class="mb50 main-table-header">
<div v-for="(item,index) in tableData" :key="index" class="mb50 main-table-header" style="width: 70%;margin:0 auto">
<div class="table-time mb5">
<div>
<span>年份: </span><span id="title1">{{queryParams.year }}</span>
@ -36,7 +36,7 @@ @@ -36,7 +36,7 @@
<span>{{total}} </span><span id="title3" class="pl10">{{index+1}}</span>
</div>
</div>
<div style="height:100%;display: flex;">
<div style="height:100%;display: flex; ">
<template v-for="(info,idx) in item.slice(0,5)" :key="idx">
<el-table class="report-table merge-header no-border-table" :data="info" style="width: 100%;" :table-layout="tableLayout">
<el-table-column label="日期" :align="alignment">
@ -68,11 +68,8 @@ @@ -68,11 +68,8 @@
</el-table>
</template>
</div>
</div>
</div>
</div>
</template>
<script setup>
@ -83,14 +80,14 @@ @@ -83,14 +80,14 @@
const props = defineProps({
tableTitle: {
type: String,
default: '表格标题'
default: '洪水水位摘录表'
},
})
const { proxy } = getCurrentInstance()
const alignment = 'center'
const stationType = 'C'
const stationType = 'B'
const tableLayout = ref('fixed')
const singleStationRef = ref(null)
const selectStnm = ref('')
@ -118,6 +115,7 @@ @@ -118,6 +115,7 @@
let total = ref(0)
const getList = async () => {
loading.value = true
try {
const res = await proxy.axiosGet('/report/getWaterZlData', queryParams)
if (res.code == 0) {

378
src/views/report/zrll/index.vue

@ -0,0 +1,378 @@ @@ -0,0 +1,378 @@
<template>
<div class="app-container app-container-bg">
<el-card class="first-card" ref='firstCard' shadow="always">
<el-form :model="queryParams" ref="queryForm" :inline="true" @submit.native.prevent>
<el-form-item label="选择站点">
<!-- <singleStation ref="singleStationRef" :stationType="stationType" @stationChange="handleStationChange" /> -->
<ESelectSingle ref="eSelectSingle" :station-type="stationType" @stationChange="handleStationChange" @loadingChange="handleStationLoading" />
</el-form-item>
<el-form-item label="年份">
<el-date-picker v-model="queryParams.year" type="year" value-format="YYYY" placeholder="选择年" :clearable="false">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
<el-button type="warning" icon="Download" @click="handleExport">下载</el-button>
</el-form-item>
</el-form>
</el-card>
<div class="el-card-p card-shadow carder-border mt10 pad10 scroll-bar" style="max-width: 100%; overflow-x: hidden;">
<div class="main-table-header" style="width: 70%;margin:0 auto">
<div class="table-title">{{tableTitle}}</div>
<div class="table-time mb5">
<div>
<span>年份: </span><span id="title1">{{queryParams.year }}</span>
</div>
<div>
<span>测站编码: </span><span id="title2">{{queryParams.stnmId}}</span>
</div>
<div>
<span>流量 </span><span id="title3">(/s)</span>
</div>
<div>
<span>积水面积 </span><span id="title4"> {{waterArea}}(k)</span>
</div>
</div>
</div>
<el-table class="report-table merge-header" v-loading="loading" :data="tableData" style="width: 70%;margin:0 auto" :table-layout="tableLayout" :span-method="arraySpanMethod">
<el-table-column prop="value" :align="alignment">
<el-table-column prop="date" width="40" :align="alignment" />
<el-table-column prop="yueTotal" width="90" :align="alignment" />
<template #header>
<div class="diagonal-header">
<svg class="diagonal-line" viewBox="0 0 100 100" preserveAspectRatio="none">
<line x1="0" y1="0" x2="100" y2="100" stroke="#000" stroke-width="1" />
</svg>
<div class="header-month">月份</div>
<div class="header-date">日期</div>
</div>
</template>
</el-table-column>
<el-table-column v-for="(item, index) in columnData" :key="index" :label="item.label" :align="alignment" :prop="item.prop">
</el-table-column>
</el-table>
</div>
</div>
</template>
<script setup>
import dayjs from 'dayjs';
import singleStation from '@/components/SingleStation/index.vue'
import ESelectSingle from '@/components/ESelectSingle/index.vue'
import { ref, reactive, onMounted } from 'vue';
const props = defineProps({
tableTitle: {
type: String,
default: '表格标题'
},
})
const { proxy } = getCurrentInstance()
const alignment = 'center'
const stationType = 'E'
const tableLayout = ref('fixed')
const singleStationRef = ref(null)
//
const handleStationChange = (stnmId) => {
queryParams.stnmId = stnmId
if (stnmId == undefined) {
proxy.$modal.msgWarning("请选择站点后查询");
return
} else {
loading.value = true;
getList()
}
}
const loading = ref(false);
const tableData = ref([]);
const queryParams = reactive({
year: dayjs(new Date()).format('YYYY'),
});
const waterArea = ref('')
const getList = async () => {
loading.value = true;
try {
const res = await proxy.axiosGet('/report/zrlldata', queryParams)
if (res.code == 0) {
waterArea.value = res.data.waterArea
// let data = res.data
let data = []
// 1~31
for (let i = 1; i <= 31; i++) {
let j = i - 1
data.push({
date: i,
yueTotal: '',
Jan: res.data.dayCountData[0][j] || '/',
Feb: res.data.dayCountData[1][j] || '/',
Mar: res.data.dayCountData[2][j] || '/',
Apr: res.data.dayCountData[3][j] || '/',
May: res.data.dayCountData[4][j] || '/',
Jun: res.data.dayCountData[5][j] || '/',
Jul: res.data.dayCountData[6][j] || '/',
Aug: res.data.dayCountData[7][j] || '/',
Sep: res.data.dayCountData[8][j] || '/',
Oct: res.data.dayCountData[9][j] || '/',
Nov: res.data.dayCountData[10][j] || '/',
Dec: res.data.dayCountData[11][j] || '/'
})
}
let yueList = ['平均', '最大', '日期', '最小', '日期']
for (let i = 0; i < 5; i++) {
data.push(
{
yueTotal: yueList[i],
date: "月统计",
Jan: i == 0 ? res.data.avgList[0] : i == 1 ? res.data.maxList[0] : i == 2 ? res.data.maxDayList[0] : i == 3 ? res.data.minList[0] : i == 4 ? res.data.minDayList[0] : '/',
Feb: i == 0 ? res.data.avgList[1] : i == 1 ? res.data.maxList[1] : i == 2 ? res.data.maxDayList[1] : i == 3 ? res.data.minList[1] : i == 4 ? res.data.minDayList[1] : '/',
Mar: i == 0 ? res.data.avgList[2] : i == 1 ? res.data.maxList[2] : i == 2 ? res.data.maxDayList[2] : i == 3 ? res.data.minList[2] : i == 4 ? res.data.minDayList[2] : '/',
Apr: i == 0 ? res.data.avgList[3] : i == 1 ? res.data.maxList[3] : i == 2 ? res.data.maxDayList[3] : i == 3 ? res.data.minList[3] : i == 4 ? res.data.minDayList[3] : '/',
May: i == 0 ? res.data.avgList[4] : i == 1 ? res.data.maxList[4] : i == 2 ? res.data.maxDayList[4] : i == 3 ? res.data.minList[4] : i == 4 ? res.data.minDayList[4] : '/',
Jun: i == 0 ? res.data.avgList[5] : i == 1 ? res.data.maxList[5] : i == 2 ? res.data.maxDayList[5] : i == 3 ? res.data.minList[5] : i == 4 ? res.data.minDayList[5] : '/',
Jul: i == 0 ? res.data.avgList[6] : i == 1 ? res.data.maxList[6] : i == 2 ? res.data.maxDayList[6] : i == 3 ? res.data.minList[6] : i == 4 ? res.data.minDayList[6] : '/',
Aug: i == 0 ? res.data.avgList[7] : i == 1 ? res.data.maxList[7] : i == 2 ? res.data.maxDayList[7] : i == 3 ? res.data.minList[7] : i == 4 ? res.data.minDayList[7] : '/',
Sep: i == 0 ? res.data.avgList[8] : i == 1 ? res.data.maxList[8] : i == 2 ? res.data.maxDayList[8] : i == 3 ? res.data.minList[8] : i == 4 ? res.data.minDayList[8] : '/',
Oct: i == 0 ? res.data.avgList[9] : i == 1 ? res.data.maxList[9] : i == 2 ? res.data.maxDayList[9] : i == 3 ? res.data.minList[9] : i == 4 ? res.data.minDayList[9] : '/',
Nov: i == 0 ? res.data.avgList[10] : i == 1 ? res.data.maxList[10] : i == 2 ? res.data.maxDayList[10] : i == 3 ? res.data.minList[10] : i == 4 ? res.data.minDayList[10] : '/',
Dec: i == 0 ? res.data.avgList[11] : i == 1 ? res.data.maxList[11] : i == 2 ? res.data.maxDayList[11] : i == 3 ? res.data.minList[11] : i == 4 ? res.data.minDayList[11] : '/'
}
)
}
let yearMaxValue = res.data.yearMax?.replace(/&nbsp;/g, ' ').trim();
let yearMinValue = res.data.yearMin?.replace(/&nbsp;/g, ' ').trim();
let yearAvgValue = res.data.yearAvg?.replace(/&nbsp;/g, ' ').trim();
let nianList = ['最大流量', '径流量']
for (let i = 0; i < 2; i++) {
data.push(
{
date: "年统计",
yueTotal: '',
Jan: nianList[i],
Feb: i == 0 ? yearMaxValue : i == 1 ? `${res.data.yearJing} 10⁸m³` : '/',
Mar: i == 0 ? '最小流量' : i == 1 ? '径流模数' : '/',
Apr: i == 0 ? yearMinValue : i == 1 ? `${res.data.yearMod} 10⁻³m³/(s·m³)` : '/',
May: i == 0 ? '平均流量' : i == 1 ? '径流深度' : i == 2 ? '' : '/',
Jun: i == 0 ? yearAvgValue : i == 1 ? `${res.data.yearDepth} mm` : '/',
}
)
}
//
data.push({
date: '洪量 10⁸m³',
Jan: '最大1日',
Feb: res.data.ll_1.split(',')[0],
Mar: '3日',
Apr: res.data.ll_3.split(',')[0],
May: '7日',
Jun: res.data.ll_7.split(',')[0],
Jul: '15日',
Aug: res.data.ll_15.split(',')[0],
Sep: '30日',
Oct: res.data.ll_30.split(',')[0],
Nov: '60日',
Dec: res.data.ll_60.split(',')[0],
})
//
data.push({
date: '洪亮日期',
Jan: res.data.ll_1.split(',')[1],
Feb: res.data.ll_3.split(',')[1],
Mar: res.data.ll_7.split(',')[1],
Apr: res.data.ll_15.split(',')[1],
May: res.data.ll_30.split(',')[1],
Jun: res.data.ll_60.split(',')[1],
})
//
data.push({
date: '附录',
Jan: res.data.fuzhu
})
tableData.value = data
}
loading.value = false
} catch (error) {
loading.value = false
}
}
//
const handleQuery = () => {
getList()
}
//
const handleExport = () => { }
onMounted(() => { })
const columnData = ref([
{ label: '一月', prop: 'Jan' },
{ label: '二月', prop: 'Feb' },
{ label: '三月', prop: 'Mar' },
{ label: '四月', prop: 'Apr' },
{ label: '五月', prop: 'May' },
{ label: '六月', prop: 'Jun' },
{ label: '七月', prop: 'Jul' },
{ label: '八月', prop: 'Aug' },
{ label: '九月', prop: 'Sep' },
{ label: '十月', prop: 'Oct' },
{ label: '十一月', prop: 'Nov' },
{ label: '十二月', prop: 'Dec' }
])
const arraySpanMethod = ({ row, column, rowIndex, columnIndex }) => {
let rowList = [31, 32, 33, 34, 35, 36, 37,]
//
if (!rowList.includes(rowIndex)) {
if (columnIndex === 0) {
//
return [1, 2];
} else if (columnIndex === 1) {
//
return [0, 0];
}
}
//
if (rowIndex >= 31 && rowIndex <= 35) {
if (columnIndex === 0) {
return rowIndex === 31 ? [5, 1] : [0, 0];
}
if (columnIndex === 1) return [1, 1];
}
//
if (rowIndex >= 36 && rowIndex <= 37) {
if (columnIndex === 0) {
return rowIndex === 36 ? [2, 2] : [0, 0];
}
if (columnIndex === 1) return [0, 0];
// if (rowIndex == 36) {
if (columnIndex === 2) {
return [1, 1];
} else if (columnIndex === 3) {
return [1, 3];
} else if (columnIndex === 4) {
return [1, 1];
} else if (columnIndex === 5) {
return [1, 3];
} else if (columnIndex === 6) {
return [1, 1];
} else if (columnIndex === 7) {
return [1, 3];
} else {
return [0, 0];
}
// }
}
if (rowIndex === tableData.value.length - 2) {
if (columnIndex === 2) {
return [1, 2];
} else if (columnIndex === 3) {
return [1, 2];
} else if (columnIndex === 4) {
return [1, 2];
} else if (columnIndex === 5) {
return [1, 2];
} else if (columnIndex === 6) {
return [1, 2];
} else if (columnIndex === 7) {
return [1, 2];
} else {
return [0, 0];
}
}
//
if (rowIndex === tableData.value.length - 1) {
if (columnIndex === 1) {
return [1, 2];
} else if (columnIndex === 2) {
return [1, 12];
} else {
return [0, 0];
}
}
//
return [1, 1];
}
</script>
<style scoped lang='scss'>
/* 斜线表头容器 */
.diagonal-header {
position: relative;
width: 100%;
height: 100%;
min-height: 60px;
/* 确保有足够空间 */
}
/* SVG 斜线 */
.diagonal-line {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
pointer-events: none;
/* 防止遮挡点击事件 */
}
/* 月份/日期文本样式 */
.header-month,
.header-date {
position: absolute;
font-size: 12px;
line-height: 1;
z-index: 1;
}
/* 右上角月份 */
.header-month {
top: 10%;
right: 10%;
text-align: right;
}
/* 左下角日期 */
.header-date {
bottom: 10%;
left: 10%;
text-align: left;
}
/* 表头单元格高度调整 */
:deep(.el-table__header th) {
padding: 0;
height: 60px;
/* 增加高度保证斜线效果 */
}
:deep(.el-table__header th.el-table__cell>.cell) {
padding: 0 !important;
}
/* 隐藏子列的表头行 */
.merge-header :deep(.el-table__header tr:nth-child(2)) {
display: none;
}
/* 隐藏前31行的下边框 */
:deep(.el-table__body tr:nth-child(-n+30) td),
:deep(.el-table__body tr:nth-child(32) td),
:deep(.el-table__body tr:nth-child(33) td),
:deep(.el-table__body tr:nth-child(34) td),
:deep(.el-table__body tr:nth-child(35) td) {
border-bottom: none !important;
}
:deep(.el-table__body tr:nth-child(32) td:nth-child(1)) {
border-bottom: 1px solid #000 !important;
}
</style>

4
src/views/report/zrsw/index.vue

@ -22,7 +22,7 @@ @@ -22,7 +22,7 @@
</el-form>
</el-card>
<div class="el-card-p card-shadow carder-border mt10 pad10 " style="max-width: 100%; overflow-x: hidden;">
<div class="el-card-p card-shadow carder-border mt10 pad10 scroll-bar " style="max-width: 100%; overflow-x: hidden;">
<div class="main-table-header" style="width: 70%;margin:0 auto">
<div class="table-title">{{tableTitle}}</div>
<div class="table-time mb5">
@ -37,7 +37,7 @@ @@ -37,7 +37,7 @@
</div>
</div>
</div>
<el-table class="report-table merge-header" v-table-height="{bottom:130}" v-loading="loading" :data="tableData" style="width: 70%;margin:0 auto" :table-layout="tableLayout" :span-method="arraySpanMethod">
<el-table class="report-table merge-header" v-loading="loading" :data="tableData" style="width: 70%;margin:0 auto" :table-layout="tableLayout" :span-method="arraySpanMethod">
<el-table-column prop="value" :align="alignment">
<el-table-column prop="date" width="40" :align="alignment" />
<el-table-column prop="yueTotal" width="40" :align="alignment" />

8
src/views/report/zrtide/index.vue

@ -3,7 +3,8 @@ @@ -3,7 +3,8 @@
<el-card class="first-card" ref='firstCard' shadow="always">
<el-form :model="queryParams" ref="queryForm" :inline="true" @submit.native.prevent>
<el-form-item label="选择站点">
<singleStation ref="singleStationRef" :stationType="stationType" @stationChange="handleStationChange" />
<!-- <singleStation ref="singleStationRef" :stationType="stationType" @stationChange="handleStationChange" /> -->
<ESelectSingle ref="eSelectSingle" :stationType="stationType" @stationChange="handleStationChange" @loadingChange="handleStationLoading" />
</el-form-item>
<el-form-item label="年份">
<el-date-picker v-model="queryParams.year" type="year" value-format="YYYY" placeholder="选择年" :clearable="false">
@ -31,7 +32,7 @@ @@ -31,7 +32,7 @@
</div>
</div>
</div>
<el-table class="report-table merge-header" v-loading="loading" :data="tableData" style="width: 70%;margin:0 auto" :table-layout="tableLayout" :span-method="arraySpanMethod">
<el-table class="report-table merge-header" v-loading="loading" :data="tableData" style="width: 70%;margin:0 auto" :table-layout="tableLayout" :span-method="arraySpanMethod">
<el-table-column prop="value" :align="alignment">
<el-table-column prop="date" width="40" :align="alignment" />
<el-table-column prop="yueTotal" width="90" :align="alignment" />
@ -56,12 +57,13 @@ @@ -56,12 +57,13 @@
<script setup>
import dayjs from 'dayjs';
import singleStation from '@/components/SingleStation/index.vue'
import ESelectSingle from '@/components/ESelectSingle/index.vue'
import { ref, reactive, onMounted } from 'vue';
const props = defineProps({
tableTitle: {
type: String,
default: '表格标题'
default: '逐日平均潮位表'
},
})

4
src/views/statistic/qflow/qflow.vue

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
<template>
<time-process :stationType="stationType" :fixed="fixed" :requestPrefix="requestPrefix" :requestPrefixTable="requestPrefixTable" :tableTitle="title"></time-process>
<time-process :stationType="stationType" :fixed="fixed" :requestPrefix="requestPrefix" :requestPrefixTable="requestPrefixTable" :tableHeaderName="title"></time-process>
</template>
<script setup>
import TimeProcess from '@/components/TimeProcess/index.vue'
@ -7,5 +7,5 @@ @@ -7,5 +7,5 @@
const fixed = ref(1)
const requestPrefix = ref('/ycqflowdata/chartdata')
const requestPrefixTable = ref('/ycqflowdata/gettabledataopen')
const title = '流量时段过程'
let title = '流量时段过程'
</script>

2
src/views/statistic/qflow/qflowls.vue

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
<template>
<history-yoy :stationType="stationType" :fixed="fixed" :requestPrefix="requestPrefix" :tableTitle="title"></history-yoy>
<history-yoy :stationType="stationType" :fixed="fixed" :requestPrefix="requestPrefix" :tableHeaderName="title"></history-yoy>
</template>
<script setup>
import HistoryYoy from '@/components/HistoryYOY/index.vue'

4
src/views/statistic/qflow/qflowsd.vue

@ -1,10 +1,10 @@ @@ -1,10 +1,10 @@
<template>
<time-count :stationType="stationType" :fixed="fixed" :requestPrefix="requestPrefix" :tableTitle="title"></time-count>
<time-count :stationType="stationType" :fixed="fixed" :requestPrefix="requestPrefix" :tableHeaderName="title"></time-count>
</template>
<script setup>
import TimeCount from '@/components/TimeCount/index.vue'
const stationType = ref('E')
const fixed = ref(1)
const requestPrefix = ref('sddata')
const title = '流量时段统计(m³/s)'
let title = '流量时段统计(m³/s)'
</script>

7
src/views/statistic/qflow/qflowtzz.vue

@ -1,11 +1,12 @@ @@ -1,11 +1,12 @@
<template>
<year-eigenvalue :stationType="stationType" :fixed="fixed" :requestPrefix="requestPrefix" :tableTitle="title" :tableName="tableName"></year-eigenvalue>
<year-eigenvalue :stationType="stationType" :fixed="fixed" :requestPrefix="requestPrefix" :tableHeaderName="tableTitle" :tableName="tableName"></year-eigenvalue>
</template>
<script setup>
import { ref } from 'vue'
import YearEigenvalue from '@/components/YearEigenvalue/index.vue'
const stationType = ref('E')
const fixed = ref(1)
const requestPrefix = ref('tzzdatahistory')
let title = '流量年特征值表'
let tableName=ref('arch_char_q_qflow')
let tableTitle = ref('流量年特征值表')
let tableName = ref('arch_char_q_qflow')
</script>

11
src/views/statistic/river/river.vue

@ -0,0 +1,11 @@ @@ -0,0 +1,11 @@
<template>
<time-process :stationType="stationType" :fixed="fixed" :requestPrefix="requestPrefix" :requestPrefixTable="requestPrefixTable" :tableHeaderName="title"></time-process>
</template>
<script setup>
import TimeProcess from '@/components/TimeProcess/index.vue'
const stationType = ref('B')
const fixed = ref(1)
const requestPrefix = ref('/ycriverdata/chartdata')
const requestPrefixTable = ref('/ycriverdata/gettabledataopen')
const title = '河道水位时段过程'
</script>

86
src/views/statistic/river/river_main.vue

@ -0,0 +1,86 @@ @@ -0,0 +1,86 @@
<template>
<div class="report-rain">
<div class="tjfx-menu">
<el-select v-model="menu" placeholder="请选择">
<el-option v-for="dict in tjfxMenus" :key="dict.value" :label="dict.label" :value="dict.value" />
</el-select>
</div>
<!-- 添加加载状态和错误提示 -->
<el-empty v-if="componentError" class="error-message" description="组件加载失败,请刷新页面重试" />
<component :is="currentComponent" :tableTitle="tableTitle"></component>
</div>
</template>
<script setup>
import { ref, computed, defineAsyncComponent } from 'vue'
//
const tjfxMenus = [
{
value: '1',
label: '时段过程'
},
{
value: '2',
label: '年特征值'
}, {
value: '3',
label: '时段统计'
}, {
value: '4',
label: '历史同期对比'
}
]
//
const menu = ref(tjfxMenus.length > 0 ? tjfxMenus[0].value : '')
//
const componentMap = {
'1': defineAsyncComponent(() => import('@/views/statistic/river/river.vue')),
'2': defineAsyncComponent(() => import('@/views/statistic/river/rivertzz.vue')),
'3': defineAsyncComponent(() => import('@/views/statistic/river/riversd.vue')),
'4': defineAsyncComponent(() => import('@/views/statistic/river/riverls.vue'))
}
//
const componentError = ref(false)
onErrorCaptured((error) => {
componentError.value = true
return true
})
//
const currentComponent = computed(() => {
return componentMap[menu.value]
})
// tjfxMenus name
const tableTitle = computed(() => {
const currentItem = tjfxMenus.find(item => item.value === menu.value);
return currentItem ? currentItem.label : '';
})
</script>
<style lang="scss">
.tjfx-menu {
position: absolute;
right: 25px;
top: 30px;
z-index: 999999;
.el-input__wrapper {
background: #10163A;
}
.el-input__inner {
background: #10163A;
color: #fff;
border-color: #10163A;
}
.el-select .el-input .el-select__caret {
color: #fff !important;
}
}
</style>

10
src/views/statistic/river/riverls.vue

@ -0,0 +1,10 @@ @@ -0,0 +1,10 @@
<template>
<history-yoy :stationType="stationType" :fixed="fixed" :requestPrefix="requestPrefix" :tableHeaderName="title"></history-yoy>
</template>
<script setup>
import HistoryYoy from '@/components/HistoryYOY/index.vue'
const stationType = ref('B')
const fixed = ref(1)
const requestPrefix = ref('history')
const title = '河道水位历史同期对比'
</script>

10
src/views/statistic/river/riversd.vue

@ -0,0 +1,10 @@ @@ -0,0 +1,10 @@
<template>
<time-count :stationType="stationType" :fixed="fixed" :requestPrefix="requestPrefix" :tableHeaderName="title"></time-count>
</template>
<script setup>
import TimeCount from '@/components/TimeCount/index.vue'
const stationType = ref('B')
const fixed = ref(1)
const requestPrefix = ref('sddata')
const title = '河道水位时段统计(m)'
</script>

307
src/views/statistic/river/rivertzz copy.vue

@ -0,0 +1,307 @@ @@ -0,0 +1,307 @@
<template>
<div class="app-container app-container-bg">
<el-card class="first-card" ref='firstCard' shadow="always">
<el-form :model="queryParams" ref="queryForm" :inline="true" @submit.native.prevent>
<el-form-item label="开始时间">
<el-date-picker v-model="queryParams.startTime" type="datetime" value-format="MM-DD" format="YYYY-MM-DD HH:mm:ss" placeholder="选择开始时间" :disabled-date="disabledStartDate">
</el-date-picker>
</el-form-item>
<el-form-item label="结束时间">
<el-date-picker v-model="queryParams.endTime" type="datetime" value-format="MM-DD" format="YYYY-MM-DD HH:mm:ss" placeholder="选择结束时间" :disabled-date="disabledEndDate">
</el-date-picker>
</el-form-item>
<el-form-item label="年份区间">
<el-date-picker class="picker-year" style="width:120px" v-model="yearstart" type="year" value-format="YYYY" placeholder="选择开始年">
</el-date-picker>
<span class="pr10 pl10"> - </span>
<el-date-picker class="picker-year" style="width:120px" v-model="yearend" type="year" value-format="YYYY" placeholder="选择结束年">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">查询</el-button>
</el-form-item>
<br />
<el-form-item label="报表排列方式(按站点)" style="margin-bottom: 0;">
<el-radio-group v-model="direction" @change="getList" class="pt10">
<el-radio label="zx">纵向</el-radio>
<el-radio label="hx">横向</el-radio>
</el-radio-group>
</el-form-item>
</el-form>
</el-card>
<splitpanes :horizontal="device === 'mobile'" class="el-card-p card-shadow carder-border mt10 pad10 default-theme container-box" :push-other-panes="false">
<pane :size="firstSize" :min-size="SPLITPANES_CONFIG.MIN_SIZE" :max-size="SPLITPANES_CONFIG.MAX_SIZE" ref="firstPane" class="mr10">
<e-tree ref="eTreeRef" :stationType="stationType" @stationChange="handleStationChange" @loadingChange="handleStationLoading"></e-tree>
</pane>
<pane :size="100 - firstSize" style="height: 100%;">
<div class="main-table-header">
<div class="table-title">{{tableTitle}}</div>
</div>
<el-table v-table-height v-loading="loading" :data="tableData" border :span-method="arraySpanMethod">
<el-table-column :align="alignment" v-for="column in tableColumns" :key="column.prop" :prop="column.prop" :label="column.label" :min-width="column.width || 120">
</el-table-column>
</el-table>
</pane>
</splitpanes>
</div>
</template>
<script setup>
import dayjs from 'dayjs';
import {
Splitpanes,
Pane
} from 'splitpanes'
import 'splitpanes/dist/splitpanes.css'
import ETree from '@/components/ETree/index.vue'
import useAppStore from '@/store/modules/app'
const device = computed(() => useAppStore().device);
const props = defineProps({
})
const {
proxy
} = getCurrentInstance()
const { update_type_options } = proxy.useDict("update_type_options")
const stationType = 'A'
const alignment = 'center'
const firstSize = ref(proxy.SPLITPANES_CONFIG.DEFAULT_SIZE)
const direction = ref('zx')
const eTreeRef = ref(null)
let stnmIdsList = []
const handleStationLoading = (loadingState) => {
loading.value = loadingState;
}
//
const handleStationChange = (stnmIds) => {
stnmIdsList = stnmIds
queryParams.stnmIds = stnmIds.join(',')
if (stnmIdsList.length == 0) {
proxy.$modal.msgWarning("请选择站点后查询");
return
} else if (stnmIdsList.length > 50) {
proxy.$modal.msg("站点最多可选择50个");
return
} else {
getList()
}
}
const yearstart = ref(dayjs().subtract(1, 'year').format('YYYY'))
const yearend = ref(dayjs().format('YYYY'))
const queryParams = reactive({
startTime: dayjs().subtract(7, 'day').format('MM-DD'),
endTime: dayjs().format('MM-DD'),
years: `${yearstart.value}-${yearend.value}`,
stnmIds: '',
});
//
const disabledStartDate = (time) => {
const endTime = queryParams.endTime ? dayjs(queryParams.endTime) : null;
return dayjs(time).isAfter(dayjs()) ||
(endTime && dayjs(time).isAfter(endTime));
};
//
const disabledEndDate = (time) => {
const startTime = queryParams.startTime ? dayjs(queryParams.startTime) : null;
return dayjs(time).isAfter(dayjs()) ||
(startTime && dayjs(time).isBefore(startTime));
};
const tableTitle = computed(() => {
const startFormatted = dayjs(queryParams.startTime, 'MM-DD').format('MM月DD日');
const endFormatted = dayjs(queryParams.endTime, 'MM-DD').format('MM月DD日');
return `${startFormatted}~${endFormatted}历史同期降水量表(mm)`;
});
const tableColumns = ref([])
const tableData = ref([])
const loading = ref(false)
// getList
const getList = async () => {
loading.value = true;
try {
let res = await proxy.axiosPost2('/report/rainhistorycount', queryParams)
if (res.code == 0) {
if (direction.value == 'zx') {
getZXTableData(res)
} else {
getHXTableData(res)
}
}
} catch (error) {
tableColumns.value = [];
tableData.value = [];
} finally {
loading.value = false
}
}
const getZXTableData = (res) => {
let { year, list, name, max, min } = res.data;
let columns = [
{
prop: "station",
label: "站点"
},
{
prop: "type",
label: ""
}
]
//
year.forEach(item => {
columns.push({
prop: item,
label: item
});
});
tableColumns.value = columns
// -
const processedData = [];
list.forEach((item, index) => {
// ""
const row1 = {
station: name[index],
type: "平均水位"
};
year.forEach(y => {
row1[y] = item[0].value ? item[0].value.toFixed(1) : '-';
});
// const row2 = {
// station: name[index],
// type: ""
// };
// year.forEach(y => {
// row2[y] = item[0].value ? item[0].value.toFixed(1) : '-';
// });
// const row3 = {
// station: name[index],
// type: ""
// };
// year.forEach(y => {
// row3[y] = item[0].tm ? item[0].tm : '-';
// });
// const row4 = {
// station: name[index],
// type: ""
// };
// year.forEach(y => {
// row4[y] = item[0].value ? item[0].value.toFixed(1) : '-';
// });
// const row5 = {
// station: name[index],
// type: ""
// };
// year.forEach(y => {
// row5[y] = item[0].tm ? item[0].tm : '-';
// });
processedData.push(row1);
// processedData.push(row2);
// processedData.push(row3);
// processedData.push(row4);
// processedData.push(row5);
});
console.log(processedData, 'processedData')
tableData.value = processedData;
}
const getHXTableData = (res) => {
const { year, list, name, max, min } = res.data;
if (!year || !list || !name || !max || !min) {
console.error('数据缺失:', { year, list, name, max, min });
tableData.value = [];
return;
}
const columns = name.map(stationName => ({
prop: stationName,
label: stationName
}));
tableColumns.value = columns;
console.log(columns, 'tableColumns')
const processedData = [];
//
year.forEach(y => {
const row = { time: y };
name.forEach((stationName, idx) => {
const stationIndex = name.indexOf(stationName);
const stationList = list[stationIndex];
if (!stationList || stationList.length === 0) {
row[stationName] = { rain: '-', tm: '-' };
return;
}
const valueItem = stationList[0]; //
row['rain' + idx] = valueItem.value ? valueItem.value.toFixed(1) : '-'
row['tm' + idx] = valueItem.tm ? valueItem.tm.slice(5) : '-'
});
processedData.push(row);
});
//
processedData.push({
time: '最大值',
...name.reduce((acc, stationName, index) => {
acc['rain' + index] = max[index]?.value ? max[index]?.value.toFixed(1) : '-';
acc['tm' + index] = max[index]?.tm ? max[index].tm : '-';
return acc;
}, {})
});
//
processedData.push({
time: '最小值',
...name.reduce((acc, stationName, index) => {
acc['rain' + index] = min[index]?.value ? min[index]?.value.toFixed(1) : '-';
acc['tm' + index] = min[index]?.tm ? min[index].tm : '-';
return acc;
}, {})
});
tableData.value = processedData;
};
//
const handleQuery = async () => {
getList()
}
//
const arraySpanMethod = ({ row, column, rowIndex, columnIndex }) => {
//
const columnCount = tableColumns.value.length;
// /
if (columnIndex === columnCount - 1 || columnIndex === columnCount - 2) {
return [1, 1];
}
//
if (columnIndex === 0) {
//
if (rowIndex % 2 === 0) {
//
return [2, 1];
} else {
//
return [0, 0];
}
}
//
if (rowIndex % 2 === 0) {
//
return [2, 1];
} else {
//
return [0, 0];
}
}
</script>
<style lang="scss" scoped>
</style>

11
src/views/statistic/river/rivertzz.vue

@ -0,0 +1,11 @@ @@ -0,0 +1,11 @@
<template>
<year-eigenvalue :stationType="stationType" :fixed="fixed" :requestPrefix="requestPrefix" :tableHeaderName="title" :tableName="tableName"></year-eigenvalue>
</template>
<script setup>
import YearEigenvalue from '@/components/YearEigenvalue/index.vue'
const stationType = ref('B')
const fixed = ref(1)
const requestPrefix = ref('tzzdatahistory')
let title = '河道水位年特征值表(m)'
let tableName=ref('arch_char_river')
</script>

2
src/views/statistic/rsvr/rsvrls.vue

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
<template>
<history-yoy :stationType="stationType" :fixed="fixed" :requestPrefix="requestPrefix" :tableTitle="title"></history-yoy>
<history-yoy :stationType="stationType" :fixed="fixed" :requestPrefix="requestPrefix" :tableHeaderName="title"></history-yoy>
</template>
<script setup>
import HistoryYoy from '@/components/HistoryYOY/index.vue'

2
src/views/statistic/rsvr/rsvrsd.vue

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
<template>
<time-count :stationType="stationType" :fixed="fixed" :requestPrefix="requestPrefix" :tableTitle="title"></time-count>
<time-count :stationType="stationType" :fixed="fixed" :requestPrefix="requestPrefix" :tableHeaderName="title"></time-count>
</template>
<script setup>
import TimeCount from '@/components/TimeCount/index.vue'

4
src/views/statistic/rsvr/rsvrtzz copy.vue

@ -21,8 +21,8 @@ @@ -21,8 +21,8 @@
<el-button type="primary" icon="Search" @click="handleQuery">查询</el-button>
</el-form-item>
<br />
<el-form-item label="报表排列方式(按站点)">
<el-radio-group v-model="direction" @change="getList">
<el-form-item label="报表排列方式(按站点)" style="margin-bottom: 0;">
<el-radio-group v-model="direction" @change="getList" class="pt10">
<el-radio label="zx">纵向</el-radio>
<el-radio label="hx">横向</el-radio>
</el-radio-group>

4
src/views/statistic/rsvr/rsvrtzz.vue

@ -1,11 +1,11 @@ @@ -1,11 +1,11 @@
<template>
<year-eigenvalue :stationType="stationType" :fixed="fixed" :requestPrefix="requestPrefix" :tableTitle="title" :tableName="tableName"></year-eigenvalue>
<year-eigenvalue :stationType="stationType" :fixed="fixed" :requestPrefix="requestPrefix" :tableHeaderName="title" :tableName="tableName"></year-eigenvalue>
</template>
<script setup>
import YearEigenvalue from '@/components/YearEigenvalue/index.vue'
const stationType = ref('C')
const fixed = ref(1)
const requestPrefix = ref('tzzdatahistory')
let title = '水位年特征值表(m)'
let title = '水库水位年特征值表(m)'
let tableName=ref('arch_char_rsvr')
</script>

4
src/views/statistic/rsvr/sdrsvr.vue

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
<template>
<time-process :stationType="stationType" :fixed="fixed" :requestPrefix="requestPrefix" :requestPrefixTable="requestPrefixTable" :tableTitle="title"></time-process>
<time-process :stationType="stationType" :fixed="fixed" :requestPrefix="requestPrefix" :requestPrefixTable="requestPrefixTable" :tableHeaderName="title"></time-process>
</template>
<script setup>
import TimeProcess from '@/components/TimeProcess/index.vue'
@ -7,5 +7,5 @@ @@ -7,5 +7,5 @@
const fixed = ref(1)
const requestPrefix = ref('/ycrsvrdata/chartdata')
const requestPrefixTable = ref('/ycrsvrdata/gettabledataopen')
const title = '水位时段过程'
const title = '水库水位时段过程'
</script>

11
src/views/statistic/tide/tide.vue

@ -0,0 +1,11 @@ @@ -0,0 +1,11 @@
<template>
<time-process :stationType="stationType" :fixed="fixed" :requestPrefix="requestPrefix" :requestPrefixTable="requestPrefixTable" :tableHeaderName="title"></time-process>
</template>
<script setup>
import TimeProcess from '@/components/TimeProcess/index.vue'
const stationType = ref('D')
const fixed = ref(1)
const requestPrefix = ref('/yctidedata/chartdata')
const requestPrefixTable = ref('/yctidedata/gettabledataopen')
const title = '潮位时段过程'
</script>

86
src/views/statistic/tide/tide_main.vue

@ -0,0 +1,86 @@ @@ -0,0 +1,86 @@
<template>
<div class="report-rain">
<div class="tjfx-menu">
<el-select v-model="menu" placeholder="请选择">
<el-option v-for="dict in tjfxMenus" :key="dict.value" :label="dict.label" :value="dict.value" />
</el-select>
</div>
<!-- 添加加载状态和错误提示 -->
<el-empty v-if="componentError" class="error-message" description="组件加载失败,请刷新页面重试" />
<component :is="currentComponent" :tableTitle="tableTitle"></component>
</div>
</template>
<script setup>
import { ref, computed, defineAsyncComponent } from 'vue'
//
const tjfxMenus = [
{
value: '1',
label: '时段过程'
},
{
value: '2',
label: '年特征值'
}, {
value: '3',
label: '时段统计'
}, {
value: '4',
label: '历史同期对比'
}
]
//
const menu = ref(tjfxMenus.length > 0 ? tjfxMenus[0].value : '')
//
const componentMap = {
'1': defineAsyncComponent(() => import('@/views/statistic/tide/tide.vue')),
'2': defineAsyncComponent(() => import('@/views/statistic/tide/tidetzz.vue')),
'3': defineAsyncComponent(() => import('@/views/statistic/tide/tidesd.vue')),
'4': defineAsyncComponent(() => import('@/views/statistic/tide/tidels.vue'))
}
//
const componentError = ref(false)
onErrorCaptured((error) => {
componentError.value = true
return true
})
//
const currentComponent = computed(() => {
return componentMap[menu.value]
})
// tjfxMenus name
const tableTitle = computed(() => {
const currentItem = tjfxMenus.find(item => item.value === menu.value);
return currentItem ? currentItem.label : '';
})
</script>
<style lang="scss">
.tjfx-menu {
position: absolute;
right: 25px;
top: 30px;
z-index: 999999;
.el-input__wrapper {
background: #10163A;
}
.el-input__inner {
background: #10163A;
color: #fff;
border-color: #10163A;
}
.el-select .el-input .el-select__caret {
color: #fff !important;
}
}
</style>

10
src/views/statistic/tide/tidels.vue

@ -0,0 +1,10 @@ @@ -0,0 +1,10 @@
<template>
<history-yoy :stationType="stationType" :fixed="fixed" :requestPrefix="requestPrefix" :tableHeaderName="title"></history-yoy>
</template>
<script setup>
import HistoryYoy from '@/components/HistoryYOY/index.vue'
const stationType = ref('D')
const fixed = ref(1)
const requestPrefix = ref('history')
const title = '潮位历史同期对比'
</script>

10
src/views/statistic/tide/tidesd.vue

@ -0,0 +1,10 @@ @@ -0,0 +1,10 @@
<template>
<time-count :stationType="stationType" :fixed="fixed" :requestPrefix="requestPrefix" :tableHeaderName="title"></time-count>
</template>
<script setup>
import TimeCount from '@/components/TimeCount/index.vue'
const stationType = ref('D')
const fixed = ref(1)
const requestPrefix = ref('sddata')
const title = '潮位时段统计(m)'
</script>

307
src/views/statistic/tide/tidetzz copy.vue

@ -0,0 +1,307 @@ @@ -0,0 +1,307 @@
<template>
<div class="app-container app-container-bg">
<el-card class="first-card" ref='firstCard' shadow="always">
<el-form :model="queryParams" ref="queryForm" :inline="true" @submit.native.prevent>
<el-form-item label="开始时间">
<el-date-picker v-model="queryParams.startTime" type="datetime" value-format="MM-DD" format="YYYY-MM-DD HH:mm:ss" placeholder="选择开始时间" :disabled-date="disabledStartDate">
</el-date-picker>
</el-form-item>
<el-form-item label="结束时间">
<el-date-picker v-model="queryParams.endTime" type="datetime" value-format="MM-DD" format="YYYY-MM-DD HH:mm:ss" placeholder="选择结束时间" :disabled-date="disabledEndDate">
</el-date-picker>
</el-form-item>
<el-form-item label="年份区间">
<el-date-picker class="picker-year" style="width:120px" v-model="yearstart" type="year" value-format="YYYY" placeholder="选择开始年">
</el-date-picker>
<span class="pr10 pl10"> - </span>
<el-date-picker class="picker-year" style="width:120px" v-model="yearend" type="year" value-format="YYYY" placeholder="选择结束年">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">查询</el-button>
</el-form-item>
<br />
<el-form-item label="报表排列方式(按站点)" style="margin-bottom: 0;">
<el-radio-group v-model="direction" @change="getList" class="pt10">
<el-radio label="zx">纵向</el-radio>
<el-radio label="hx">横向</el-radio>
</el-radio-group>
</el-form-item>
</el-form>
</el-card>
<splitpanes :horizontal="device === 'mobile'" class="el-card-p card-shadow carder-border mt10 pad10 default-theme container-box" :push-other-panes="false">
<pane :size="firstSize" :min-size="SPLITPANES_CONFIG.MIN_SIZE" :max-size="SPLITPANES_CONFIG.MAX_SIZE" ref="firstPane" class="mr10">
<e-tree ref="eTreeRef" :stationType="stationType" @stationChange="handleStationChange" @loadingChange="handleStationLoading"></e-tree>
</pane>
<pane :size="100 - firstSize" style="height: 100%;">
<div class="main-table-header">
<div class="table-title">{{tableTitle}}</div>
</div>
<el-table v-table-height v-loading="loading" :data="tableData" border :span-method="arraySpanMethod">
<el-table-column :align="alignment" v-for="column in tableColumns" :key="column.prop" :prop="column.prop" :label="column.label" :min-width="column.width || 120">
</el-table-column>
</el-table>
</pane>
</splitpanes>
</div>
</template>
<script setup>
import dayjs from 'dayjs';
import {
Splitpanes,
Pane
} from 'splitpanes'
import 'splitpanes/dist/splitpanes.css'
import ETree from '@/components/ETree/index.vue'
import useAppStore from '@/store/modules/app'
const device = computed(() => useAppStore().device);
const props = defineProps({
})
const {
proxy
} = getCurrentInstance()
const { update_type_options } = proxy.useDict("update_type_options")
const stationType = 'A'
const alignment = 'center'
const firstSize = ref(proxy.SPLITPANES_CONFIG.DEFAULT_SIZE)
const direction = ref('zx')
const eTreeRef = ref(null)
let stnmIdsList = []
const handleStationLoading = (loadingState) => {
loading.value = loadingState;
}
//
const handleStationChange = (stnmIds) => {
stnmIdsList = stnmIds
queryParams.stnmIds = stnmIds.join(',')
if (stnmIdsList.length == 0) {
proxy.$modal.msgWarning("请选择站点后查询");
return
} else if (stnmIdsList.length > 50) {
proxy.$modal.msg("站点最多可选择50个");
return
} else {
getList()
}
}
const yearstart = ref(dayjs().subtract(1, 'year').format('YYYY'))
const yearend = ref(dayjs().format('YYYY'))
const queryParams = reactive({
startTime: dayjs().subtract(7, 'day').format('MM-DD'),
endTime: dayjs().format('MM-DD'),
years: `${yearstart.value}-${yearend.value}`,
stnmIds: '',
});
//
const disabledStartDate = (time) => {
const endTime = queryParams.endTime ? dayjs(queryParams.endTime) : null;
return dayjs(time).isAfter(dayjs()) ||
(endTime && dayjs(time).isAfter(endTime));
};
//
const disabledEndDate = (time) => {
const startTime = queryParams.startTime ? dayjs(queryParams.startTime) : null;
return dayjs(time).isAfter(dayjs()) ||
(startTime && dayjs(time).isBefore(startTime));
};
const tableTitle = computed(() => {
const startFormatted = dayjs(queryParams.startTime, 'MM-DD').format('MM月DD日');
const endFormatted = dayjs(queryParams.endTime, 'MM-DD').format('MM月DD日');
return `${startFormatted}~${endFormatted}历史同期降水量表(mm)`;
});
const tableColumns = ref([])
const tableData = ref([])
const loading = ref(false)
// getList
const getList = async () => {
loading.value = true;
try {
let res = await proxy.axiosPost2('/report/rainhistorycount', queryParams)
if (res.code == 0) {
if (direction.value == 'zx') {
getZXTableData(res)
} else {
getHXTableData(res)
}
}
} catch (error) {
tableColumns.value = [];
tableData.value = [];
} finally {
loading.value = false
}
}
const getZXTableData = (res) => {
let { year, list, name, max, min } = res.data;
let columns = [
{
prop: "station",
label: "站点"
},
{
prop: "type",
label: ""
}
]
//
year.forEach(item => {
columns.push({
prop: item,
label: item
});
});
tableColumns.value = columns
// -
const processedData = [];
list.forEach((item, index) => {
// ""
const row1 = {
station: name[index],
type: "平均水位"
};
year.forEach(y => {
row1[y] = item[0].value ? item[0].value.toFixed(1) : '-';
});
// const row2 = {
// station: name[index],
// type: ""
// };
// year.forEach(y => {
// row2[y] = item[0].value ? item[0].value.toFixed(1) : '-';
// });
// const row3 = {
// station: name[index],
// type: ""
// };
// year.forEach(y => {
// row3[y] = item[0].tm ? item[0].tm : '-';
// });
// const row4 = {
// station: name[index],
// type: ""
// };
// year.forEach(y => {
// row4[y] = item[0].value ? item[0].value.toFixed(1) : '-';
// });
// const row5 = {
// station: name[index],
// type: ""
// };
// year.forEach(y => {
// row5[y] = item[0].tm ? item[0].tm : '-';
// });
processedData.push(row1);
// processedData.push(row2);
// processedData.push(row3);
// processedData.push(row4);
// processedData.push(row5);
});
console.log(processedData, 'processedData')
tableData.value = processedData;
}
const getHXTableData = (res) => {
const { year, list, name, max, min } = res.data;
if (!year || !list || !name || !max || !min) {
console.error('数据缺失:', { year, list, name, max, min });
tableData.value = [];
return;
}
const columns = name.map(stationName => ({
prop: stationName,
label: stationName
}));
tableColumns.value = columns;
console.log(columns, 'tableColumns')
const processedData = [];
//
year.forEach(y => {
const row = { time: y };
name.forEach((stationName, idx) => {
const stationIndex = name.indexOf(stationName);
const stationList = list[stationIndex];
if (!stationList || stationList.length === 0) {
row[stationName] = { rain: '-', tm: '-' };
return;
}
const valueItem = stationList[0]; //
row['rain' + idx] = valueItem.value ? valueItem.value.toFixed(1) : '-'
row['tm' + idx] = valueItem.tm ? valueItem.tm.slice(5) : '-'
});
processedData.push(row);
});
//
processedData.push({
time: '最大值',
...name.reduce((acc, stationName, index) => {
acc['rain' + index] = max[index]?.value ? max[index]?.value.toFixed(1) : '-';
acc['tm' + index] = max[index]?.tm ? max[index].tm : '-';
return acc;
}, {})
});
//
processedData.push({
time: '最小值',
...name.reduce((acc, stationName, index) => {
acc['rain' + index] = min[index]?.value ? min[index]?.value.toFixed(1) : '-';
acc['tm' + index] = min[index]?.tm ? min[index].tm : '-';
return acc;
}, {})
});
tableData.value = processedData;
};
//
const handleQuery = async () => {
getList()
}
//
const arraySpanMethod = ({ row, column, rowIndex, columnIndex }) => {
//
const columnCount = tableColumns.value.length;
// /
if (columnIndex === columnCount - 1 || columnIndex === columnCount - 2) {
return [1, 1];
}
//
if (columnIndex === 0) {
//
if (rowIndex % 2 === 0) {
//
return [2, 1];
} else {
//
return [0, 0];
}
}
//
if (rowIndex % 2 === 0) {
//
return [2, 1];
} else {
//
return [0, 0];
}
}
</script>
<style lang="scss" scoped>
</style>

11
src/views/statistic/tide/tidetzz.vue

@ -0,0 +1,11 @@ @@ -0,0 +1,11 @@
<template>
<year-eigenvalue :stationType="stationType" :fixed="fixed" :requestPrefix="requestPrefix" :tableHeaderName="title" :tableName="tableName"></year-eigenvalue>
</template>
<script setup>
import YearEigenvalue from '@/components/YearEigenvalue/index.vue'
const stationType = ref('D')
const fixed = ref(1)
const requestPrefix = ref('tzzdatahistory')
let title = '潮位年特征值表'
let tableName=ref('arch_char_tide')
</script>

10
src/views/zhengbian/qflow/index.vue

@ -0,0 +1,10 @@ @@ -0,0 +1,10 @@
<template>
<zheng-bian :stationType="stationType" :fixed="fixed" :requestPrefix="requestPrefix"></zheng-bian>
</template>
<script setup>
import ZhengBian from '@/components/ZhengBian/index.vue'
const stationType = ref('E')
const fixed = ref(2)
const requestPrefix = ref('/ycqflowdata')
</script>

9
src/views/zhengbian/river/index.vue

@ -0,0 +1,9 @@ @@ -0,0 +1,9 @@
<template>
<zheng-bian :stationType="stationType" :fixed="fixed" :requestPrefix="requestPrefix"></zheng-bian>
</template>
<script setup>
import ZhengBian from '@/components/ZhengBian/index.vue'
const stationType = ref('B')
const fixed = ref(2)
const requestPrefix = ref('/ycriverdata')
</script>

10
src/views/zhengbian/tide/index.vue

@ -0,0 +1,10 @@ @@ -0,0 +1,10 @@
<template>
<zheng-bian :stationType="stationType" :fixed="fixed" :requestPrefix="requestPrefix"></zheng-bian>
</template>
<script setup>
import ZhengBian from '@/components/ZhengBian/index.vue'
const stationType = ref('D')
const fixed = ref(2)
const requestPrefix = ref('/yctidedata')
</script>
Loading…
Cancel
Save