Commit 3e8ed2e3 authored by liuyuping's avatar liuyuping

'2021-11-16'

parent 82032d57
...@@ -10,6 +10,29 @@ export function environment(data) { ...@@ -10,6 +10,29 @@ export function environment(data) {
}); });
} }
// 获取所有设备标志
export function findAllDeviceId(companyCode) {
return request5({
url: "api/environment/findAllDeviceId",
method: "get",
params: {
companyCode
}
})
}
// 获取监测数据趋势
export function analyzeTrend(companyCode, deviceId) {
return request5({
url: 'api/environment/analyzeTrend',
method: "get",
params: {
companyCode,
deviceId
}
})
}
// 降雨量 // 降雨量
export function jiangYuLiang(data) { export function jiangYuLiang(data) {
return request5({ return request5({
...@@ -119,3 +142,159 @@ export function wkkAlarm(data) { ...@@ -119,3 +142,159 @@ export function wkkAlarm(data) {
params: data params: data
}); });
} }
// 降雨量 -- 获取指定企业所有监测站
export function getAllSensorNamesINJYL(companyCode) {
return request5({
url: "api/wkkJiangYuLiang/getAllSensorNames",
method: "get",
params: {
companyCode
}
})
}
// 降雨量 -- 分析监测数据趋势
export function analyzeTrendINJYL(companyCode, sensorName) {
return request5({
url: "api/wkkJiangYuLiang/analyzeTrend",
method: "get",
params: {
companyCode,
sensorName
}
})
}
// 浸润线 -- 获取企业所有监测站
export function getAllSensorNamesINJRX(companyCode) {
return request5({
url: "api/wkkJinRunXian/getAllSensorNames",
method: "get",
params: {
companyCode
}
})
}
// 浸润线 -- 分析监测数据趋势
export function analyzeTrendINJRX(companyCode, sensorName) {
return request5({
url: "api/wkkJinRunXian/analyzeTrend",
method: "get",
params: {
companyCode,
sensorName
}
})
}
// 库水位 -- 获取企业所有监测站
export function getAllSensorNamesINKSW(companyCode) {
return request5({
url: "api/wkkKuShuiWei/getAllSensorNames",
method: "get",
params: {
companyCode
}
})
}
// 库水位 -- 分析监测数据趋势
export function analyzeTrendINKSW(companyCode, sensorName) {
return request5({
url: "api/wkkKuShuiWei/analyzeTrend",
method: "get",
params: {
companyCode,
sensorName
}
})
}
// 干滩 -- 获取企业所有监测站
export function getAllSeonsorNamesINGT(companyCode) {
return request5({
url: "api/wkkGanTan/getAllSensorNames",
method: "get",
params: {
companyCode
}
})
}
// 干滩 -- 分析监测数据趋势
export function analyzeTrendINGT(companyCode, sensorName) {
return request5({
url: "api/wkkGanTan/analyzeTrend",
method: "get",
params: {
companyCode,
sensorName
}
})
}
// 表面位移 -- 获取企业所有监测站
export function getAllSensorNamesINBMWY(companyCode) {
return request5({
url: "api/wkkBiaoMianWeiYi/getAllSensorNames",
method: "get",
params: {
companyCode
}
})
}
// 表面位移 -- 分析监测数据趋势
export function analyzeTrendINBMWY(companyCode, sensorName) {
return request5({
url: "api/wkkBiaoMianWeiYi/analyzeTrend",
method: "get",
params: {
companyCode,
sensorName
}
})
}
// 内部位移沉降 -- 获取指定企业所有检测站
export function getAllSensorNamesINNBWYCJ(companyCode) {
return request5({
url: "api/wkkNeiBuWeiYiChenJiang/getAllSensorNames",
method: "get",
params: {
companyCode
}
})
}
// 内部位移沉降 -- 分析监测数据趋势
export function analyzeTrendINNBWYCJ(companyCode, sensorName) {
return request5({
url: "api/wkkNeiBuWeiYiChenJiang/analyzeTrend",
method: "get",
params: {
companyCode,
sensorName
}
})
}
// 内部位移倾斜 -- 获取指定企业所有监测站
export function getAllSensorNamesINNBWYQX(companyCode) {
return request5({
url: "api/neiBuWeiYiQingXie/getAllSensorNames",
method: "get",
params: {
companyCode
}
})
}
// 内部位移倾斜 -- 分析监测数据趋势
export function analyzeTrendINNBWYQX(companyCode, sensorName) {
return request5({
url: "api/neiBuWeiYiQingXie/analyzeTrend",
method: "get",
params: {
companyCode,
sensorName
}
})
}
\ No newline at end of file
...@@ -17,14 +17,15 @@ ...@@ -17,14 +17,15 @@
<div class="tools-wrapper"> <div class="tools-wrapper">
<div class="device-wrapper"> <div class="device-wrapper">
<span>设备标识:&nbsp;&nbsp;</span> <span>设备标识:&nbsp;&nbsp;</span>
<el-select> <el-select v-model="curSelectDeviceId" placeholder="请选择设备" @change="changeDevice">
<el-option label="400中段风速" value="400中段风速"></el-option> <el-option
<el-option label="2 5 0 进风巷 风速" value="2 5 0 进风巷 风速"></el-option> v-for="item in deviceIds"
<el-option label="3 0 0 进风巷 风速" value="3 0 0 进风巷 风速"></el-option> :key="item"
<el-option label="7 1线温度" value="7 1线温度"></el-option> :label="item"
<el-option label="71二氧化碳" value="71二氧化碳"></el-option> :value="item"
></el-option>
</el-select> </el-select>
<el-button type="success" size="medium">查询</el-button> <el-button type="success" size="medium" @click="queryCore">查询</el-button>
</div> </div>
<div class="switch-wrapper"> <div class="switch-wrapper">
<el-button type="primary" size="medium" @click.stop="clickToSwitchTable">切换</el-button> <el-button type="primary" size="medium" @click.stop="clickToSwitchTable">切换</el-button>
...@@ -57,7 +58,7 @@ ...@@ -57,7 +58,7 @@
<script> <script>
import { timeParse, randNum, getValueUnit } from '@/utils' import { timeParse, randNum, getValueUnit } from '@/utils'
import { environment } from '@/api/weikuangku' import { environment, findAllDeviceId, analyzeTrend } from '@/api/weikuangku'
export default { export default {
data() { data() {
return { return {
...@@ -72,11 +73,12 @@ export default { ...@@ -72,11 +73,12 @@ export default {
itemUnit:getValueUnit(), itemUnit:getValueUnit(),
// 设备标识 // 设备标识
deviceIds: [], deviceIds: [],
// 当前选中的设备
curSelectDeviceId: '',
// 切换 // 切换
switchTable: true switchTable: true
} }
}, },
methods: { methods: {
core() { core() {
const compony_info = this.$store.state.compony_info const compony_info = this.$store.state.compony_info
...@@ -85,9 +87,10 @@ export default { ...@@ -85,9 +87,10 @@ export default {
page: this.page, page: this.page,
size: 10, size: 10,
sort: 'id,desc', sort: 'id,desc',
deviceId: this.curSelectDeviceId,
companycode: compony_info.companycode, companycode: compony_info.companycode,
}).then(res => { }).then(res => {
this.tableData = res.content this.tableData = [...res.content]
this.total = res.totalElements this.total = res.totalElements
}) })
...@@ -118,25 +121,32 @@ export default { ...@@ -118,25 +121,32 @@ export default {
}, },
clickToSwitchTable() { clickToSwitchTable() {
// 切换图标 if (!this.curSelectDeviceId ) {
this.$message.error("请选择设备")
return
}
this.switchTable = !this.switchTable this.switchTable = !this.switchTable
analyzeTrend(this.$store.state.compony_info.companycode, this.curSelectDeviceId).then(res => {
console.log(res, 'res , analyzeTrend')
const xData = res.map(item => item.acquisitionDate)
const yData = res.map(item => item.value)
// 切换图标
if (this.switchTable === false) { if (this.switchTable === false) {
this.$nextTick(() => { this.$nextTick(() => {
// 画图表 // 画图表
console.log(echarts, '有echarts吗')
const mychart = echarts.init(document.getElementById('enterStatistics')) const mychart = echarts.init(document.getElementById('enterStatistics'))
mychart.clear() mychart.clear()
const option = { const option = {
xAxis: { xAxis: {
type: 'category', type: 'category',
data: ['19:17', '20:20', '20:40', '21:30', '21:45', '21:50', '21:55', '22:00', '22:11'] data: xData
}, },
yAxis: { yAxis: {
type: 'value' type: 'value'
}, },
series: [ series: [
{ {
data: [150, 230, 224, 118, 110, 55, 280, 360, 780], data: yData,
type: 'line' type: 'line'
} }
] ]
...@@ -144,6 +154,46 @@ export default { ...@@ -144,6 +154,46 @@ export default {
mychart.setOption(option) mychart.setOption(option)
}) })
} }
})
},
changeDevice() {
if (this.switchTable === false) {
analyzeTrend(this.$store.state.compony_info.companycode, this.curSelectDeviceId).then(res => {
console.log(res, 'res , analyzeTrend')
const xData = res.map(item => item.acquisitionDate)
const yData = res.map(item => item.value)
// 切换图标
if (this.switchTable === false) {
this.$nextTick(() => {
// 画图表
const mychart = echarts.init(document.getElementById('enterStatistics'))
mychart.clear()
const option = {
xAxis: {
type: 'category',
data: xData
},
yAxis: {
type: 'value'
},
series: [
{
data: yData,
type: 'line'
}
]
}
mychart.setOption(option)
})
}
})
}
},
queryCore() {
this.core()
} }
}, },
...@@ -157,6 +207,15 @@ export default { ...@@ -157,6 +207,15 @@ export default {
is_show_huan_jing_jian_ce_table() { is_show_huan_jing_jian_ce_table() {
this.core() this.core()
}, },
dialogVisible(newVal, oldVal) {
if (newVal === true) {
findAllDeviceId(this.$store.state.compony_info.companycode).then(res => {
this.deviceIds = [...res]
})
}
}
}, },
} }
</script> </script>
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment