Merge remote-tracking branch 'origin/dev' into pet

liujun-2024-06-13-一公司人员定位新需求^2
water_xu 2024-06-25 14:24:22 +08:00
commit 3c368c2b3b
9 changed files with 396 additions and 19 deletions

View File

@ -1,12 +0,0 @@
<script>
export default {
}
</script>
<template>
<router-view/>
</template>
<style scoped>
</style>

View File

@ -0,0 +1,383 @@
<template>
<div class="app-container">
<el-form label-width="100px">
<el-row>
<el-col :span="8">
<el-form-item label="时间">
<el-date-picker
v-model="dateTimeRange"
type="datetimerange"
value-format="yyyy-MM-dd HH:mm:ss"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label-width="10px">
<el-button v-waves type="primary" icon="el-icon-search" @click="showAllHistory">
搜索
</el-button>
<el-button v-waves type="success" icon="el-icon-refresh" @click="goKeyReset">
重置
</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div id="echarts1" style="height: 300px;width: 100%;"></div>
<div id="echarts2" style="height: 300px;width: 100%;"></div>
<div id="echarts3" style="height: 300px;width: 100%;"></div>
<el-table
v-loading="listLoading"
ref="multipleTable"
:data="varList"
:row-key="getRowKey"
:header-cell-style="{
'font-weight': 'bold',
'color': '#000'
}"
tooltip-effect="dark"
border
fit
highlight-current-row
>
<el-table-column
:reserve-selection="true"
type="selection"
width="55"
align="center"/>
<el-table-column type="index" label="序号" width="50" align="center" />
<el-table-column prop="OPERATTIME" label="上报时间" />
<el-table-column prop="WINDSPEED" label="风速" />
<el-table-column prop="WINDDIRECTION" label="风向" />
<el-table-column prop="TEMPERATURE" label="温度" />
</el-table>
<div class="page-btn-group" style="margin-bottom: 50px;">
<pagination :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="showHistory" />
</div>
<div class="ui-foot">
<el-button plain type="info" @click="goBack"> </el-button>
</div>
</div>
</template>
<script>
import Pagination from '@/components/Pagination' // el-pagination
import { requestFN } from '@/utils/request'
import waves from '@/directive/waves'
import * as echarts from 'echarts';
let echarts1 = null;
let echarts2 = null;
let echarts3 = null;
export default {
components: { Pagination },
directives: { waves },
data() {
return {
msg: 'add',
config: config,
listLoading: false,
listQuery: {
page: 1,
limit: 10
},
total: 0,
KEYWORDS: '',
dateTimeRange: [],
dates: [],
varList: [],
temperature:[],
winddirection:[],
windspeed:[],
form: {
METEOROLOGICAL_ID: '',
EQUIPMENTNAME: '', //
EQUIPMENTTYPE: '',
PLATFORMMETEOROLOGICAL_ID: '',
LATITUDE: '',
LONGITUDE: '',
TYPE: 1
},
}
},
mounted() {
this.showHistory()
// this.initCharts()
},
methods: {
getRowKey(row) {
return row.METEOROLOGICALINFO_ID
},
initCharts1(temperature, winddirection, windspeed){
// let base = +new Date(1988, 9, 3);
// let oneDay = 24 * 3600 * 1000;
// let data = [[base, Math.random() * 300]];
// for (let i = 1; i < 20000; i++) {
// let now = new Date((base += oneDay));
// data.push([+now, Math.round((Math.random() - 0.5) * 20 + data[i - 1][1])]);
// }
console.log(temperature)
echarts1 = echarts.init(document.querySelector('#echarts1'))
const option = {
tooltip: {
trigger: 'axis',
position: function (pt) {
return [pt[0], '10%'];
}
},
title: {
left: 'center',
text: '气象设备数据图 - 温度'
},
xAxis: {
type: 'category',
boundaryGap: false,
minInterval: 1,
maxInterval: 3600 * 24 * 1000
},
yAxis: {
type: 'value',
boundaryGap: [0, '80%']
},
dataZoom: [
{
type: 'inside',
start: 0,
end: 20
},
{
start: 0,
end: 20
}
],
series: [
{
name: '温度',
type: 'line',
smooth: true,
symbol: 'none',
areaStyle: {color: "#42b983"},
data: temperature
}
]
}
echarts1.setOption(option)
},
initCharts2(temperature, winddirection, windspeed){
console.log(winddirection)
echarts2 = echarts.init(document.querySelector('#echarts2'))
const option = {
tooltip: {
trigger: 'axis',
position: function (pt) {
return [pt[0], '10%'];
}
},
title: {
left: 'center',
text: '气象设备数据图 - 风向'
},
xAxis: {
type: 'category',
boundaryGap: false,
minInterval: 1,
maxInterval: 3600 * 24 * 1000
},
yAxis: {
type: 'value',
boundaryGap: [0, '80%']
},
dataZoom: [
{
type: 'inside',
start: 0,
end: 20
},
{
start: 0,
end: 20
}
],
series: [
{
name: '风向',
type: 'line',
smooth: true,
symbol: 'none',
areaStyle: {color: "#6a87dc"},
data: winddirection
}
]
}
echarts2.setOption(option)
},
initCharts3(temperature, winddirection, windspeed){
console.log(windspeed)
echarts3 = echarts.init(document.querySelector('#echarts3'))
const option = {
tooltip: {
trigger: 'axis',
position: function (pt) {
return [pt[0], '10%'];
}
},
title: {
left: 'center',
text: '气象设备数据图 - 风速'
},
xAxis: {
type: 'category',
boundaryGap: false,
minInterval: 1,
maxInterval: 3600 * 24 * 1000
},
yAxis: {
type: 'value',
boundaryGap: [0, '80%']
},
dataZoom: [
{
type: 'inside',
start: 0,
end: 20
},
{
start: 0,
end: 20
}
],
series: [
{
name: '风速',
type: 'line',
smooth: true,
symbol: 'none',
areaStyle: {color: "#f033a0"},
data: windspeed
},
]
}
echarts3.setOption(option)
},
//
showHistory(){
this.listLoading = true
requestFN(
'/meteorologicalinfo/list?showCount=' + this.listQuery.limit + '&currentPage=' + this.listQuery.page,
{
CODE: this.$parent.CODE
}
).then((data) => {
this.listLoading = false
this.varList = data.varList
this.temperature = []
this.winddirection = []
this.windspeed = []
for (let i = 0 ; i < this.varList.length ; i ++){
this.temperature.push([this.varList[i].OPERATTIME, this.varList[i].TEMPERATURE])
this.winddirection.push([this.varList[i].OPERATTIME, this.varList[i].WINDDIRECTION])
this.windspeed.push([this.varList[i].OPERATTIME, this.varList[i].WINDSPEED])
}
this.initCharts1(this.temperature, this.winddirection, this.windspeed)
this.initCharts2(this.temperature, this.winddirection, this.windspeed)
this.initCharts3(this.temperature, this.winddirection, this.windspeed)
this.total = data.page.totalResult
}).catch((e) => {
this.listLoading = false
})
},
showAllHistory(){
if (!this.dateTimeRange){
this.showHistory()
return
}
this.listLoading = true
requestFN(
'/meteorologicalinfo/listAll',
{
CODE: this.$parent.CODE,
START: this.dateTimeRange[0],
END: this.dateTimeRange[1]
}
).then(async (data) => {
this.listLoading = false
// data.varList
this.temperature = []
this.winddirection = []
this.windspeed = []
for (let i = 0 ; i < data.varList.length ; i ++){
this.temperature.push([data.varList[i].AGGREGATE_TIME, data.varList[i].AVG_TEMPERATURE])
this.winddirection.push([data.varList[i].AGGREGATE_TIME, data.varList[i].AVG_WINDDIRECTION])
this.windspeed.push([data.varList[i].AGGREGATE_TIME, data.varList[i].AVG_WINDSPEED])
}
this.initCharts1(this.temperature, this.winddirection, this.windspeed)
this.initCharts2(this.temperature, this.winddirection, this.windspeed)
this.initCharts3(this.temperature, this.winddirection, this.windspeed)
// this.total = data.page.totalResult
}).catch((e) => {
this.listLoading = false
})
},
dateToTimestamp(dateString) {
var date = new Date(dateString);
//
return Math.round(date.getTime() / 1000);
},
goKeyReset() {
this.dateTimeRange = []
this.showHistory()
},
resetForm() {
this.form = {
METEOROLOGICAL_ID: '',
TYPE: '1',
EQUIPMENTNAME: '', //
EQUIPMENTTYPE: '',
PLATFORMMETEOROLOGICAL_ID: '',
LATITUDE: '',
LONGITUDE: ''
}
},
goBack() {
this.$parent.activeName = 'meteorologicalList'
this.$parent.CODE = ''
}
}
}
</script>
<style>
.hide .el-upload--picture-card {
display: none;
}
#map{
width: 1000px;
height: 500px;
}
</style>

View File

@ -39,11 +39,11 @@
<span v-else></span>
</template>
</el-table-column>
<el-table-column label="操作" align="left" width="300">
<el-table-column label="操作" align="left" width="400">
<template slot-scope="{row}">
<!-- <el-button type="success" icon="el-icon-caret-right" size="mini" @click="showVideo(row)"></el-button>-->
<el-button type="info" icon="el-icon-location-information" size="mini" @click="handleMap(row)"></el-button>
<!-- <el-button v-show="!row.PLATFORMMETEOROLOGICAL_ID" type="warning" icon="el-icon-caret-right" size="mini" @click="showVideoBack(row.EQUIPMENTTYPE)"></el-button>-->
<el-button type="success" icon="el-icon-caret-right" size="mini" @click="showHistory(row.CODE)"></el-button>
<!-- <el-button v-show="row.PLATFORMMETEOROLOGICAL_ID" type="warning" size="mini" @click="getRTSP(row)">rtsp</el-button>-->
<el-button v-show="edit" type="primary" icon="el-icon-edit" size="mini" @click="handleEdit(row.METEOROLOGICAL_ID)"></el-button>
<el-button v-show="del" type="danger" icon="el-icon-delete" plain @click="handleDelete(row.METEOROLOGICAL_ID)"></el-button>
@ -367,7 +367,11 @@ export default {
this.EQUIPMENTTYPE = path.replace('play.html', 'playback.html')
this.dialogVideoBack = true
},
//
showHistory(id){
this.$parent.CODE = id
this.$parent.activeName = 'meteorologicalHistory'
},
showAll() {
const _selectData = this.$refs.multipleTable.selection
if (_selectData == null || _selectData.length == 0) {

View File

@ -7,16 +7,19 @@
<script>
import List from './components/list'
import meteorologicalList from './components/meteorological-list'
import meteorologicalHistory from './components/meteorological-history'
export default {
components: {
List: List,
meteorologicalList: meteorologicalList
meteorologicalList: meteorologicalList,
meteorologicalHistory: meteorologicalHistory,
},
data() {
return {
activeName: 'List',
CORPINFO_ID: ''
CORPINFO_ID: '',
CODE: ''
}
}
}

View File

@ -49,12 +49,11 @@
@cell-mouse-enter="enterSelectionRows"
@cell-mouse-leave="leaveSelectionRows">
<el-table-column
v-if="false"
:reserve-selection="true"
type="selection"
width="55"
align="center"/>
<el-table-column type="expand">
<el-table-column v-if="false" type="expand">
<template slot-scope="props">
<el-form label-position="left" inline>
<el-row :gutter="20">