feat(): 添加白蚁图层

master
李神峰 2025-09-28 17:47:19 +08:00
parent f940b2f9f6
commit 5a4383dc9d
13 changed files with 681 additions and 9 deletions

View File

@ -9,7 +9,8 @@ import {
Vue.config.productionTip = false Vue.config.productionTip = false
uni.$http = $http uni.$http = $http
// $http.baseUrl = 'http://223.75.53.141:83' // $http.baseUrl = 'http://223.75.53.141:83'
$http.baseUrl = 'http://local.gunshiiot.com:18083' // $http.baseUrl = 'http://local.gunshiiot.com:18083'
$http.baseUrl = 'http://192.168.66.27:24105'
// 请求拦截器 // 请求拦截器
$http.beforeRequest = function (options) { $http.beforeRequest = function (options) {
if (options.url.indexOf('/doLogin') == -1) { if (options.url.indexOf('/doLogin') == -1) {

View File

@ -56,6 +56,12 @@
"style": { "style": {
"navigationBarTitleText": "" "navigationBarTitleText": ""
} }
},
{
"path": "pages/newAqjc/index",
"style": {
"navigationBarTitleText": ""
}
}, },
{ {
"path": "pages/homeIndex/index", "path": "pages/homeIndex/index",

View File

@ -1,11 +1,11 @@
<template> <template>
<view :style="{height:'100vh',overflow:'hidden',backgroundColor:'#fff'}"> <view :style="{height:'100vh',overflow:'hidden',backgroundColor:'#fff'}">
<u-status-bar></u-status-bar> <!-- <u-status-bar></u-status-bar>
<u-navbar title="安全监测" :autoBack="true" :titleStyle="{ <u-navbar title="安全监测" :autoBack="true" :titleStyle="{
fontSize:'18px' fontSize:'18px'
}" :height='44' :safeAreaInsetTop=true leftIconSize='20' leftIconColor='rgb(153, 153, 153)'> }" :height='44' :safeAreaInsetTop=true leftIconSize='20' leftIconColor='rgb(153, 153, 153)'>
</u-navbar> </u-navbar> -->
<picker @change="bindPickerChange" :range="array" range-key="profileName" style="margin-top:50px;padding: 0 10px;"> <picker @change="bindPickerChange" :range="array" range-key="profileName" style="margin-top:0px;padding: 0 10px;">
<view class="uni-input12"> <view class="uni-input12">
<view>{{profileName}}</view> <view>{{profileName}}</view>
<u-icon name="arrow-down-fill" color="#000" size="15"></u-icon> <u-icon name="arrow-down-fill" color="#000" size="15"></u-icon>

View File

@ -184,7 +184,7 @@ export default {
value: "安全监测", value: "安全监测",
key: 4, key: 4,
icon: "../../static/tabs/aqjc.png", icon: "../../static/tabs/aqjc.png",
url: "/pages/aqjc/index", url: "/pages/newAqjc/index",
}, },
{ {
value: "巡查任务", value: "巡查任务",

121
pages/newAqjc/byTable.vue Normal file
View File

@ -0,0 +1,121 @@
<template>
<div class="table_div">
<div class="table_cur">
<table style="width:100%;display:block">
<tr>
<th style="width: 40%;">
监测时间
</th>
<th style="width: 40%;">测点编号</th>
<th style="width: 20%;">有无白蚁</th>
</tr>
<!-- style="max-height: 480px; overflow-y: auto" -->
<div class="scroll-table">
<tr v-for="(item, index) in tableData" :key="index">
<td style="width: 40%;">{{item.obDate}}</td>
<td style="width: 40%;">{{item.mnNo}}</td>
<td style="width:20%;"><span :class="item.status === 1 ? 'has-ant' : 'no-ant'">{{ simpleData(item.status) }}</span></td>
</tr>
<div style="height:180px"></div>
</div>
</table>
</div>
</div>
</template>
<script>
import moment from "moment"
export default {
props:{
tableData:{
type:Array,
default:[],
}
},
methods: {
simpleData(status){
if(status === 1) {
return '有'
} else if(status === 0) {
return '无'
} else {
return ''
}
}
},
}
</script>
<style lang="scss" scoped>
.table_div {
height: 100%;
max-width: calc(100% - 0px);
// max-height: calc(80vh);
flex: 1;
padding-top: 0px;
// overflow-x: scroll;
}
/*table样式*/
.table_cur {
width: 100%;
empty-cells: show;
border-collapse: collapse;
font-size: 14px;
}
.scroll-table{
height: calc(100vh - 180px);
overflow-y: auto;
width:'100%'
}
.table_cur tr {
display: flex;
line-height: 75rpx;
}
.table_cur th {
height: 85rpx;
color: #3399ef;
background: #e1f3ff;
font-size: 14px;
// font-weight: bold;
padding: 0px 10px;
box-sizing: border-box;
white-space: nowrap;
text-align: center !important;
}
.table_cur td {
height: 65rpx;
// border-bottom: 1px solid #d8ddeb;
font-size: 14px;
color: #2f4056;
padding: 0 10px;
box-sizing: border-box;
white-space: nowrap;
text-align: center !important;
}
.has-ant {
display: inline-block;
width: 20px;
height: 20px;
line-height: 20px;
border-radius: 50%;
background-color: red;
color: white;
text-align: center;
font-size: 12px;
}
.no-ant {
display: inline-block;
width: 20px;
height: 20px;
line-height: 20px;
border-radius: 50%;
background-color: green;
color: white;
text-align: center;
font-size: 12px;
}
/*table样式 end*/
</style>

165
pages/newAqjc/index.vue Normal file
View File

@ -0,0 +1,165 @@
<template>
<view class="rain-detail-box">
<u-status-bar></u-status-bar>
<view class="nav-bar">
<u-icon name="arrow-left" color="#000" size="20" @click="backTo" style="margin-left:10px"></u-icon>
<view class="title">
安全监测
</view>
</view>
<view class="tab-bar">
<uni-swiper-dot :current="current" field="content" :dotsStyles="dotsStyles">
<swiper class="swiper-box" style="height: 30px;" @change="change">
<swiper-item>
<view style="display: flex;justify-content: space-between;">
<view class="jcsj" @click="activeOne = 0" :class="{ 'active': activeOne == 0 }">
位移监测
</view>
<!-- style="margin: 0 25px;" -->
<view class="tjsj" @click="activeOne = 1" :class="{ 'active': activeOne == 1 }" style="margin: 0 4%">
渗压监测
</view>
<!-- style="margin: 0 25px 0 0;" -->
<view class="zrtx" @click="activeOne = 2" :class="{ 'active': activeOne == 2 }">
渗流监测
</view>
<view class="txjc" @click="activeOne = 3" :class="{ 'active': activeOne == 3 }" style="margin-left:4%">
白蚁监测
</view>
</view>
</swiper-item>
</swiper>
</uni-swiper-dot>
</view>
<view class="rain-detail-content">
<SlTable :tableData="slData" v-if="activeOne == 2" />
<SyView v-else-if="activeOne == 1" />
<WyTable :tableData="zwyData" v-else-if="activeOne == 0" />
<ByTable :tableData="byData" v-else-if="activeOne == 3" />
</view>
</view>
</template>
<script>
import SlTable from "./slTable.vue"
import SyView from "../aqjc/index.vue"
import WyTable from "./zwyTable.vue"
import ByTable from "./byTable.vue"
export default {
data() {
return {
activeOne: 0,
current: 0,
slData: [],
zwyData: [],
byData:[],
dotsStyles: {
bottom: 0,
selectedBackgroundColor: "#d9001b"
}
}
},
components: {
SlTable,
SyView,
WyTable,
ByTable
},
methods: {
backTo() {
uni.navigateBack({ delta: 1 })
},
change(e) {
console.log(e.detail.current);
this.current = e.detail.current;
},
async getSlData() {
try {
const { data } = await uni.$http.get(
"/gunshiApp/tsg/osmoticPressR/list/value?type=2"
);
if (data.code == 200) {
this.slData = data.data;
}
} catch (error) {
uni.$showMsg();
}
},
async getZwyData() {
try {
const { data } = await uni.$http.get(
"/gunshiApp/tsg/osmoticShiftR/list/value"
);
if (data.code == 200) {
this.zwyData = data.data;
}
} catch (error) {
uni.$showMsg();
}
},
async getByData() {
try {
const { data } = await uni.$http.get(
`/gunshiApp/tsg/termite/survey/listNewData`
);
if (data.code == 200) {
this.byData = data.data;
}
} catch (error) {
uni.$showMsg();
}
},
},
mounted() {
this.getSlData();
this.getZwyData();
this.getByData();
},
}
</script>
<style lang="scss" scoped>
.rain-detail-box {
height: 100vh;
overflow: hidden;
position: relative;
.nav-bar {
display: flex;
justify-content: center;
align-items: center;
width: 100%;
height: 44px;
// margin-top: 30px;
// padding-top: 20px;
// padding-bottom: 10px;
border-bottom: 1px solid #dfdfdf;
// box-shadow: 0 5px 10px -8px #dfdfdf inset;
}
.title {
flex: 1;
text-align: center;
margin-right: 18px;
font-size: 18px;
}
.tab-bar {
// width: 100%;
display: flex;
justify-content: space-between;
padding: 5px 30px;
border-bottom: 1px solid #dfdfdf;
// overflow-x: auto;
}
.active {
color: #39a6ff;
}
.rain-detail-content {
padding: 10px;
}
}
</style>

94
pages/newAqjc/slTable.vue Normal file
View File

@ -0,0 +1,94 @@
<template>
<div class="table_div">
<div class="table_cur">
<table style="width:100%;display:block">
<tr>
<th style="width: 30%;">
监测点
</th>
<th style="width: 40%;">
监测时间
</th>
<th style="width: 30%;">渗流量(L/s)</th>
</tr>
<!-- style="max-height: 480px; overflow-y: auto" -->
<div class="scroll-table">
<tr v-for="(item, index) in tableData" :key="index">
<td style="width: 30%;">{{item.stationCode}}</td>
<td style="width: 40%;">{{simpleData(item.tm)}}</td>
<td style="width:30%;">{{ item.value }}</td>
</tr>
<div style="height:180px"></div>
</div>
</table>
</div>
</div>
</template>
<script>
import moment from "moment"
export default {
props:{
tableData:{
type:Array,
default:[],
}
},
methods: {
simpleData(tm){
return tm ? moment(tm).format("MM-DD HH:mm") :''
}
},
}
</script>
<style lang="scss" scoped>
.table_div {
height: 100%;
max-width: calc(100% - 0px);
// max-height: calc(80vh);
flex: 1;
padding-top: 0px;
// overflow-x: scroll;
}
/*table样式*/
.table_cur {
width: 100%;
empty-cells: show;
border-collapse: collapse;
font-size: 14px;
}
.scroll-table{
height: calc(55vh - 180px);
overflow-y: auto;
width:'100%'
}
.table_cur tr {
display: flex;
line-height: 75rpx;
}
.table_cur th {
height: 85rpx;
color: #3399ef;
background: #e1f3ff;
font-size: 14px;
// font-weight: bold;
padding: 0px 10px;
box-sizing: border-box;
white-space: nowrap;
text-align: center !important;
}
.table_cur td {
height: 65rpx;
// border-bottom: 1px solid #d8ddeb;
font-size: 14px;
color: #2f4056;
padding: 0 10px;
box-sizing: border-box;
white-space: nowrap;
text-align: center !important;
}
/*table样式 end*/
</style>

View File

@ -0,0 +1,98 @@
<template>
<div class="table_div">
<div class="table_cur">
<table style="width:100%;display:block">
<tr>
<th style="width: 20%;">
监测点
</th>
<th style="width: 20%;">
监测时间
</th>
<th style="width: 20%;">x方向(mm)</th>
<th style="width: 20%;">y方向(mm)</th>
<th style="width: 20%;">h方向(mm)</th>
</tr>
<!-- style="max-height: 480px; overflow-y: auto" -->
<div class="scroll-table">
<tr v-for="(item, index) in tableData" :key="index">
<td style="width: 20%; height: 30%;">{{item.cdnm}}</td>
<td style="width: 20%;">{{simpleData(item.tm)}}</td>
<td style="width:20%;">{{ item.de }}</td>
<td style="width:20%;">{{ item.dn }}</td>
<td style="width:20%;">{{ item.du }}</td>
</tr>
<div style="height:180px"></div>
</div>
</table>
</div>
</div>
</template>
<script>
import moment from "moment"
export default {
props:{
tableData:{
type:Array,
default:[],
}
},
methods: {
simpleData(tm){
if(!tm) return ''
return moment(tm).format("MM-DD HH:mm")
}
},
}
</script>
<style lang="scss" scoped>
.table_div {
height: 100%;
max-width: calc(100% - 0px);
// max-height: calc(80vh);
flex: 1;
padding-top: 0px;
// overflow-x: scroll;
}
/*table样式*/
.table_cur {
width: 100%;
empty-cells: show;
border-collapse: collapse;
font-size: 14px;
}
.scroll-table{
height: calc(100vh - 180px);
overflow-y: auto;
width:'100%'
}
.table_cur tr {
display: flex;
}
.table_cur th {
color: #3399ef;
background: #e1f3ff;
font-size: 14px;
padding: 0px 10px;
box-sizing: border-box;
white-space: wrap;
text-align: center !important;
display: flex;
align-items: center;
}
.table_cur td {
height: 75rpx;
// border-bottom: 1px solid #d8ddeb;
font-size: 14px;
color: #2f4056;
padding: 0 10px;
box-sizing: border-box;
white-space: wrap;
text-align: center !important;
}
/*table样式 end*/
</style>

121
pages/sjc/byTable.vue Normal file
View File

@ -0,0 +1,121 @@
<template>
<div class="table_div">
<div class="table_cur">
<table style="width:100%;display:block">
<tr>
<th style="width: 40%;">
监测时间
</th>
<th style="width: 40%;">测点编号</th>
<th style="width: 20%;">有无白蚁</th>
</tr>
<!-- style="max-height: 480px; overflow-y: auto" -->
<div class="scroll-table">
<tr v-for="(item, index) in tableData" :key="index">
<td style="width: 40%;">{{item.obDate}}</td>
<td style="width: 40%;">{{item.mnNo}}</td>
<td style="width:20%;"><span :class="item.status === 1 ? 'has-ant' : 'no-ant'">{{ simpleData(item.status) }}</span></td>
</tr>
<div style="height:180px"></div>
</div>
</table>
</div>
</div>
</template>
<script>
import moment from "moment"
export default {
props:{
tableData:{
type:Array,
default:[],
}
},
methods: {
simpleData(status){
if(status === 1) {
return '有'
} else if(status === 0) {
return '无'
} else {
return ''
}
}
},
}
</script>
<style lang="scss" scoped>
.table_div {
height: 100%;
max-width: calc(100% - 0px);
// max-height: calc(80vh);
flex: 1;
padding-top: 0px;
// overflow-x: scroll;
}
/*table样式*/
.table_cur {
width: 100%;
empty-cells: show;
border-collapse: collapse;
font-size: 14px;
}
.scroll-table{
height: calc(100vh - 180px);
overflow-y: auto;
width:'100%'
}
.table_cur tr {
display: flex;
line-height: 75rpx;
}
.table_cur th {
height: 85rpx;
color: #3399ef;
background: #e1f3ff;
font-size: 14px;
// font-weight: bold;
padding: 0px 10px;
box-sizing: border-box;
white-space: nowrap;
text-align: center !important;
}
.table_cur td {
height: 65rpx;
// border-bottom: 1px solid #d8ddeb;
font-size: 14px;
color: #2f4056;
padding: 0 10px;
box-sizing: border-box;
white-space: nowrap;
text-align: center !important;
}
.has-ant {
display: inline-block;
width: 20px;
height: 20px;
line-height: 20px;
border-radius: 50%;
background-color: red;
color: white;
text-align: center;
font-size: 12px;
}
.no-ant {
display: inline-block;
width: 20px;
height: 20px;
line-height: 20px;
border-radius: 50%;
background-color: green;
color: white;
text-align: center;
font-size: 12px;
}
/*table样式 end*/
</style>

View File

@ -42,6 +42,10 @@
:tableData="zwyData" :tableData="zwyData"
v-else-if="name == '灌溉发电洞变形监测'" v-else-if="name == '灌溉发电洞变形监测'"
></ZwyTable> ></ZwyTable>
<ByTable
:tableData="byData"
v-else-if="name == '白蚁监测'"
></ByTable>
</view> </view>
</view> </view>
</template> </template>
@ -49,11 +53,13 @@
import SlTable from "./slTable.vue"; import SlTable from "./slTable.vue";
import ZwyTable from "./zwyTable.vue"; import ZwyTable from "./zwyTable.vue";
import ZsyTable from "./zsyTable.vue"; import ZsyTable from "./zsyTable.vue";
import ByTable from "./byTable.vue";
export default { export default {
components: { components: {
SlTable, SlTable,
ZwyTable, ZwyTable,
ZsyTable, ZsyTable,
ByTable
}, },
data() { data() {
return { return {
@ -62,7 +68,9 @@ export default {
zsyData: [], // zsyData: [], //
sdData: [], // sdData: [], //
fbData: [], // fbData: [], //
byData:[],
name: "", name: "",
deviceId:""
}; };
}, },
methods: { methods: {
@ -97,6 +105,19 @@ export default {
uni.$showMsg(); uni.$showMsg();
} }
}, },
async getByData() {
try {
const { data } = await uni.$http.get(
`/gunshiApp/tsg/termite/survey/listNewData?deviceId=${this.deviceId}`
);
if (data.code == 200) {
this.byData = data.data;
}
} catch (error) {
uni.$showMsg();
}
},
async getZwyData() { async getZwyData() {
try { try {
const { data } = await uni.$http.get( const { data } = await uni.$http.get(
@ -171,9 +192,11 @@ export default {
this.getSlData(); this.getSlData();
this.getZwyData(); this.getZwyData();
this.getzsyData(); this.getzsyData();
this.getByData();
}, },
onLoad(options) { onLoad(options) {
this.name = options.name; this.name = options.name;
this.deviceId = options.deviceId || '';
}, },
}; };
</script> </script>

View File

@ -37,9 +37,9 @@
<view style="margin-top: 30px;"> <view style="margin-top: 30px;">
<text style="font-size: 16px;">监视对象</text> <text style="font-size: 16px;">监视对象</text>
<view style="display: flex;flex-direction: row; padding:10px;"> <view style="display: flex;flex-direction: row; padding:10px;flex-wrap:wrap">
<view v-for="item in watchObj" :key="item.id" <view v-for="item in watchObj" :key="item.id"
style="display: flex; align-items: center; margin-right: 10px;"> style="display: flex; align-items: center; margin-right: 5px; margin-top:5px">
<cover-image :src="item.showIcon" style="width: 50rpx;height: 50rpx;" <cover-image :src="item.showIcon" style="width: 50rpx;height: 50rpx;"
@click="toggleIcon(item)"></cover-image> @click="toggleIcon(item)"></cover-image>
<text :style="{color: item.textColor,fontSize:14}">{{item.name}}</text> <text :style="{color: item.textColor,fontSize:14}">{{item.name}}</text>
@ -114,6 +114,10 @@
1: '/static/tabs/zweiyi1.png', 1: '/static/tabs/zweiyi1.png',
2: "/static/tabs/zweiyi2.png" 2: "/static/tabs/zweiyi2.png"
}, },
"白蚁监测": {
1: '/static/tabs/baiyi1.png',
2: "/static/tabs/baiyi2.png"
},
} }
export default { export default {
data() { data() {
@ -261,7 +265,8 @@
map: null, map: null,
windowHeight: 0, windowHeight: 0,
windowHeight: 0, windowHeight: 0,
watchObj: [{ watchObj: [
{
icon1: "/static/tabs/shuiku1.png", icon1: "/static/tabs/shuiku1.png",
icon2: "/static/tabs/shuiku2.png", icon2: "/static/tabs/shuiku2.png",
name: "水库工程", name: "水库工程",
@ -287,7 +292,6 @@
showIcon: "/static/tabs/shuiyu2.png", showIcon: "/static/tabs/shuiyu2.png",
textColor: "#02a7f0", textColor: "#02a7f0",
isSelected3: true, isSelected3: true,
}, },
{ {
icon1: "/static/tabs/sxt1.png", icon1: "/static/tabs/sxt1.png",
@ -297,6 +301,15 @@
showIcon: "/static/tabs/sxt2.png", showIcon: "/static/tabs/sxt2.png",
textColor: "#02a7f0", textColor: "#02a7f0",
isSelected4: true, isSelected4: true,
},
{
icon1: "/static/tabs/baiyi1.png",
icon2: "/static/tabs/baiyi2.png",
name: "白蚁监测",
id: 5,
showIcon: "/static/tabs/baiyi2.png",
textColor: "#02a7f0",
isSelected5: true,
} }
] ]
} }
@ -359,6 +372,8 @@
url='/pages/skInfo/detail/index?value=2&key=2' url='/pages/skInfo/detail/index?value=2&key=2'
}else if(type == "副坝位移"){ }else if(type == "副坝位移"){
url=`/pages/sjc/index?name=副坝位移监测` url=`/pages/sjc/index?name=副坝位移监测`
}else if(type == "白蚁监测"){
url=`/pages/sjc/index?name=白蚁监测&deviceId=${data.id}`
} }
uni.navigateTo({url}) uni.navigateTo({url})
}, },
@ -483,6 +498,33 @@
uni.$showMsg(); uni.$showMsg();
} }
}, },
// 获取白蚁监测点
async getByList() {
try {
const {
data
} = await uni.$http.get("/gunshiApp/tsg/termite/survey/list/byDevice")
if (data.code == 200) {
const byList = data.data.map(item => ({
...item,
latitude: wgs84ToGcj02(item.lon,item.lat)[1],
longitude: wgs84ToGcj02(item.lon,item.lat)[0],
iconPath: '/static/tabs/baiyi1.png',
width: 15,
height: 15,
title: item.name,
pointType: "白蚁监测",
name: "白蚁监测",
// joinCluster:true
}))
console.log("byList",byList)
this.markers = [...this.markers, ...byList]
}
} catch (error) {
uni.$showMsg();
}
},
}, },
computed: { computed: {
marker() { marker() {
@ -496,6 +538,7 @@
mounted() { mounted() {
this.getVideoList(); this.getVideoList();
this.getRainList(); this.getRainList();
this.getByList();
} }
} }
</script> </script>

BIN
static/tabs/baiyi1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

BIN
static/tabs/baiyi2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB