Browse Source

时段过程

master
blankk 2 years ago
parent
commit
7db7fd4c50
  1. 64
      src/views/statistic/river/river.vue

64
src/views/statistic/river/river.vue

@ -18,6 +18,7 @@ @@ -18,6 +18,7 @@
<el-date-picker
v-model="queryParams.startTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="选择开始时间"
class="w200"
>
@ -26,6 +27,7 @@ @@ -26,6 +27,7 @@
<el-form-item label="结束时间">
<el-date-picker
v-model="queryParams.endTime"
value-format="yyyy-MM-dd HH:mm:ss"
type="datetime"
placeholder="选择结束时间"
class="w200"
@ -33,12 +35,14 @@ @@ -33,12 +35,14 @@
</el-date-picker>
</el-form-item>
<el-form-item label="选择站点">
<el-input
v-model="queryParams.stnm"
placeholder="请输入站点名称"
clearable
@keyup.enter.native="handleQuery"
<el-select v-model="queryParams.stnmId" placeholder="请选择站点" clearable>
<el-option
v-for="dict in stationList"
:key="dict.id"
:label="dict.stnm"
:value="dict.id"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="submitForm">查询</el-button>
@ -104,16 +108,15 @@ export default { @@ -104,16 +108,15 @@ export default {
label: ''
}
],
stationList: [],
tableData: [
],
//
queryParams: {
dataType: '',
endTime: '2022-06-10 00:00:00',
startTime: '2022-06-08 00:00:00',
stnm: '鄞州公园',
dataType: '0'
endTime: '2022-07-02 00:00:00',
startTime: '2022-07-01 00:00:00',
stnmId: null,
dataType: '-1'
},
dataTypes:[
{label: '5分钟',value:'-1'},
@ -132,41 +135,54 @@ export default { @@ -132,41 +135,54 @@ export default {
created() {
},
mounted(){
this.getList();
this.$refs.chart.showChart([],[],this.chartYname,this.chartType,0,null,this.fixed);
this.submitForm();
//this.submitForm();
},
methods: {
/** 查询水尺-测站信息列表 */
async getList() {
let res = await this.$axiosGet('/system/info/list',this.queryParams);
if(res.code === 0){
this.stationList = res.data;
}
},
/** 提交按钮 */
submitForm() {
var params = {
endTime: '2022-06-10 00:00:00',
startTime: '2022-06-08 00:00:00',
}
if(this.queryParams.dataType == 0){
stnmId: this.queryParams.stnmId,
endTime: this.queryParams.endTime,
startTime: this.queryParams.startTime,
dataType: this.queryParams.dataType
}
if(this.queryParams.dataType == -1){
this.tableTime = params.startTime.substring(0,19) +" 至 "+ params.endTime.substring(0,19);
}else if(this.queryParams.dataType==0){
this.tableTime = params.startTime.substring(0,16) +" 至 "+ params.endTime.substring(0,16);
}else if(this.queryParams.dataType==1){
this.tableTime = params.startTime.substring(0,10) +" 至 "+ params.endTime.substring(0,10);
}else{
this.tableTime = params.startTime.substring(0,10) +" 至 "+ params.endTime.substring(0,10);
}
this.drawChart(params);
this.drawTable(params);
},
drawChart(params) {
let res = {"msg":"操作成功","code":0,"data":{"legend":["鄞州公园"],"series":[{"barMaxWidth":"20","data":[[1654617600000,1.29],[1654617600000,1.29],[1654621200000,1.29],[1654624800000,1.29],[1654628400000,1.29],[1654632000000,1.29],[1654635600000,1.29],[1654639200000,1.29],[1654642800000,1.29],[1654646400000,1.29],[1654650000000,1.28],[1654653600000,1.27],[1654657200000,1.26],[1654660800000,1.26],[1654664400000,1.26],[1654668000000,1.25],[1654671600000,1.24],[1654675200000,1.24],[1654678800000,1.24],[1654682400000,1.24],[1654686000000,1.24],[1654689600000,1.24],[1654692300000,1.23],[1654693200000,1.23],[1654696800000,1.23],[1654700400000,1.23],[1654704000000,1.24],[1654704000000,1.24],[1654707600000,1.24],[1654711200000,1.24],[1654714800000,1.24],[1654718400000,1.24],[1654722000000,1.24],[1654725600000,1.24],[1654729200000,1.24],[1654732800000,1.24],[1654736400000,1.24],[1654740000000,1.24],[1654743600000,1.24],[1654746600000,1.25],[1654747200000,1.24],[1654750800000,1.25],[1654754400000,1.25],[1654758000000,1.25],[1654761600000,1.25],[1654765200000,1.24],[1654768800000,1.25],[1654772400000,1.25],[1654776000000,1.25],[1654779600000,1.24],[1654783200000,1.24],[1654786800000,1.24],[1654790400000,1.24]],"name":"鄞州公园","smooth":false,"stnmId":219,"symbol":"none","type":"line"}]}};
async drawChart(params) {
console.log(params);
let res = await this.$axiosGet('/system/photoinfo/getChart',params);
if(res.code == 0){
this.$refs.chart.showChart(res.data.legend,res.data.series,this.unit,this.chartType,0,null,this.fixed);
}
},
drawTable(params) {
let res = {"msg":"操作成功","code":0,"data":[{"114":"鄞州公园","tm":"时间"},{"114":"1.36","tm":"2022-06-08 00:00:00"},{"114":"1.37","tm":"2022-06-08 01:00:00"},{"114":"1.37","tm":"2022-06-08 02:00:00"},{"114":"1.37","tm":"2022-06-08 03:00:00"},{"114":"1.37","tm":"2022-06-08 04:00:00"},{"114":"1.37","tm":"2022-06-08 05:00:00"},{"114":"1.37","tm":"2022-06-08 06:00:00"},{"114":"1.37","tm":"2022-06-08 07:00:00"},{"114":"1.37","tm":"2022-06-08 08:00:00"},{"114":"1.36","tm":"2022-06-08 09:00:00"},{"114":"1.37","tm":"2022-06-08 10:00:00"},{"114":"1.36","tm":"2022-06-08 11:00:00"},{"114":"1.37","tm":"2022-06-08 12:00:00"},{"114":"1.37","tm":"2022-06-08 13:00:00"},{"114":"1.37","tm":"2022-06-08 14:00:00"},{"114":"1.36","tm":"2022-06-08 15:00:00"},{"114":"1.35","tm":"2022-06-08 16:00:00"},{"114":"1.36","tm":"2022-06-08 17:00:00"},{"114":"1.37","tm":"2022-06-08 18:00:00"},{"114":"1.36","tm":"2022-06-08 19:00:00"},{"114":"1.37","tm":"2022-06-08 20:00:00"},{"114":"1.38","tm":"2022-06-08 21:00:00"},{"114":"1.36","tm":"2022-06-08 22:00:00"},{"114":"1.36","tm":"2022-06-08 23:00:00"},{"114":"1.37","tm":"2022-06-09 00:00:00"},{"114":"1.36","tm":"2022-06-09 01:00:00"},{"114":"1.35","tm":"2022-06-09 02:00:00"},{"114":"1.35","tm":"2022-06-09 03:00:00"},{"114":"1.35","tm":"2022-06-09 04:00:00"},{"114":"1.35","tm":"2022-06-09 05:00:00"},{"114":"1.36","tm":"2022-06-09 06:00:00"},{"114":"1.35","tm":"2022-06-09 07:00:00"},{"114":"1.35","tm":"2022-06-09 08:00:00"},{"114":"1.35","tm":"2022-06-09 09:00:00"},{"114":"1.37","tm":"2022-06-09 10:00:00"},{"114":"1.34","tm":"2022-06-09 11:00:00"},{"114":"1.35","tm":"2022-06-09 12:00:00"},{"114":"1.34","tm":"2022-06-09 13:00:00"},{"114":"1.34","tm":"2022-06-09 14:00:00"},{"114":"1.35","tm":"2022-06-09 15:00:00"},{"114":"1.37","tm":"2022-06-09 16:00:00"},{"114":"1.37","tm":"2022-06-09 17:00:00"},{"114":"1.38","tm":"2022-06-09 18:00:00"},{"114":"1.38","tm":"2022-06-09 19:00:00"},{"114":"1.38","tm":"2022-06-09 20:00:00"},{"114":"1.37","tm":"2022-06-09 21:00:00"},{"114":"1.37","tm":"2022-06-09 22:00:00"},{"114":"1.37","tm":"2022-06-09 23:00:00"},{"114":"1.37","tm":"2022-06-10 00:00:00"}]}; if(res.code == 0){
async drawTable(params) {
let res = await this.$axiosGet('/system/photoinfo/getTableData',params);
console.log(res);
// let res = {"msg":"","code":0,"data":[{"114":"1.36","tm":"2022-06-08 00:00:00"},{"114":"1.37","tm":"2022-06-08 01:00:00"},{"114":"1.37","tm":"2022-06-08 02:00:00"},{"114":"1.37","tm":"2022-06-08 03:00:00"},{"114":"1.37","tm":"2022-06-08 04:00:00"},{"114":"1.37","tm":"2022-06-08 05:00:00"},{"114":"1.37","tm":"2022-06-08 06:00:00"},{"114":"1.37","tm":"2022-06-08 07:00:00"},{"114":"1.37","tm":"2022-06-08 08:00:00"},{"114":"1.36","tm":"2022-06-08 09:00:00"},{"114":"1.37","tm":"2022-06-08 10:00:00"},{"114":"1.36","tm":"2022-06-08 11:00:00"},{"114":"1.37","tm":"2022-06-08 12:00:00"},{"114":"1.37","tm":"2022-06-08 13:00:00"},{"114":"1.37","tm":"2022-06-08 14:00:00"},{"114":"1.36","tm":"2022-06-08 15:00:00"},{"114":"1.35","tm":"2022-06-08 16:00:00"},{"114":"1.36","tm":"2022-06-08 17:00:00"},{"114":"1.37","tm":"2022-06-08 18:00:00"},{"114":"1.36","tm":"2022-06-08 19:00:00"},{"114":"1.37","tm":"2022-06-08 20:00:00"},{"114":"1.38","tm":"2022-06-08 21:00:00"},{"114":"1.36","tm":"2022-06-08 22:00:00"},{"114":"1.36","tm":"2022-06-08 23:00:00"},{"114":"1.37","tm":"2022-06-09 00:00:00"},{"114":"1.36","tm":"2022-06-09 01:00:00"},{"114":"1.35","tm":"2022-06-09 02:00:00"},{"114":"1.35","tm":"2022-06-09 03:00:00"},{"114":"1.35","tm":"2022-06-09 04:00:00"},{"114":"1.35","tm":"2022-06-09 05:00:00"},{"114":"1.36","tm":"2022-06-09 06:00:00"},{"114":"1.35","tm":"2022-06-09 07:00:00"},{"114":"1.35","tm":"2022-06-09 08:00:00"},{"114":"1.35","tm":"2022-06-09 09:00:00"},{"114":"1.37","tm":"2022-06-09 10:00:00"},{"114":"1.34","tm":"2022-06-09 11:00:00"},{"114":"1.35","tm":"2022-06-09 12:00:00"},{"114":"1.34","tm":"2022-06-09 13:00:00"},{"114":"1.34","tm":"2022-06-09 14:00:00"},{"114":"1.35","tm":"2022-06-09 15:00:00"},{"114":"1.37","tm":"2022-06-09 16:00:00"},{"114":"1.37","tm":"2022-06-09 17:00:00"},{"114":"1.38","tm":"2022-06-09 18:00:00"},{"114":"1.38","tm":"2022-06-09 19:00:00"},{"114":"1.38","tm":"2022-06-09 20:00:00"},{"114":"1.37","tm":"2022-06-09 21:00:00"},{"114":"1.37","tm":"2022-06-09 22:00:00"},{"114":"1.37","tm":"2022-06-09 23:00:00"},{"114":"1.37","tm":"2022-06-10 00:00:00"}]};
if(res.code == 0){
var c1 = res.data[0];
var tableColumn = [];
tableColumn.push({prop: 'tm', label: '时间'});
for(var k in c1) {
if(k != 'tm' && k != 'avg'){
console.log(c1[k])
tableColumn.push({prop: k, label: c1[k]});
}
}

Loading…
Cancel
Save