Compare commits
3 Commits
| Author | SHA1 | Date |
|---|---|---|
|
|
e0f1ae8b5b | |
|
|
ceccf58955 | |
|
|
cdfecd905a |
|
|
@ -1,2 +1,24 @@
|
|||
/unpackage/
|
||||
/.idea/
|
||||
.DS_Store
|
||||
node_modules
|
||||
/dist
|
||||
|
||||
/unpackage
|
||||
|
||||
# local env files
|
||||
.env.local
|
||||
.env.*.local
|
||||
|
||||
# Log files
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
pnpm-debug.log*
|
||||
|
||||
# Editor directories and files
|
||||
.idea
|
||||
.vscode
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
||||
|
|
|
|||
12
App.vue
12
App.vue
|
|
@ -190,12 +190,20 @@
|
|||
|
||||
},
|
||||
onLoad() {
|
||||
console.log('App onLoad!')
|
||||
if(!uni.getStorageSync('third_session')){
|
||||
uni.reLaunch({
|
||||
url:'/packDetail/pages/login/login'
|
||||
})
|
||||
}else{
|
||||
uni.reLaunch({
|
||||
url:'/pages/index/index'
|
||||
})
|
||||
}
|
||||
},
|
||||
onShow: function() {
|
||||
},
|
||||
onHide: function() {
|
||||
console.log('App Hide1')
|
||||
console.log('App Hide')
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
51
api/api.js
51
api/api.js
|
|
@ -1,6 +1,5 @@
|
|||
import { http } from '@/common/service/service.js'
|
||||
import configService from '@/common/service/config.service.js';
|
||||
import indexData from "@/pages/index/indexData";
|
||||
const apiService = {
|
||||
|
||||
/**
|
||||
|
|
@ -38,55 +37,7 @@ const apiService = {
|
|||
}else{
|
||||
return configService.staticDomainURL + "/" + avatar;
|
||||
}
|
||||
},
|
||||
// 检查登录并执行:api.checkLogin(()=>{}, () => {});
|
||||
checkLogin(successCallback,failCallback){
|
||||
let that = this;
|
||||
if (uni.getStorageSync('userInfo') && uni.getStorageSync('third_session')) {
|
||||
if(successCallback){
|
||||
successCallback();
|
||||
}
|
||||
} else {
|
||||
uni.login({
|
||||
success: function(res) {
|
||||
let params = {}
|
||||
params.jsCode = res.code
|
||||
that.wxlogin(params).then(res => {
|
||||
that.loginCallback(res, successCallback, failCallback);
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
loginCallback(res, successCallback, failCallback){
|
||||
let that = this;
|
||||
if (res.data.code == 0) {
|
||||
let userInfo = res.data.data;
|
||||
if (!userInfo.id) {
|
||||
console.error('登录失败',userInfo)
|
||||
that.loginFail();
|
||||
if(failCallback){
|
||||
failCallback();
|
||||
}
|
||||
} else {
|
||||
console.warn('登录成功',userInfo)
|
||||
uni.setStorageSync('userInfo', userInfo);
|
||||
uni.setStorageSync('third_session', userInfo.thirdSession);
|
||||
if(successCallback){
|
||||
successCallback();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
that.loginFail();
|
||||
if(failCallback){
|
||||
failCallback();
|
||||
}
|
||||
}
|
||||
},
|
||||
loginFail () {
|
||||
uni.removeStorageSync('third_session')
|
||||
uni.removeStorageSync('userInfo');
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
export default apiService;
|
||||
|
|
|
|||
|
|
@ -22,12 +22,10 @@ let apiUrl = configService.apiUrl;
|
|||
|
||||
const http = new Request()
|
||||
http.setConfig((config) => { /* 设置全局配置 */
|
||||
config.baseUrl = apiUrl; /* 根域名不同 */
|
||||
config.baseUrl = apiUrl /* 根域名不同 */
|
||||
config.header = {
|
||||
...config.header
|
||||
};
|
||||
console.log(config)
|
||||
// config.headers['X-Access-Token'] = localStorage.getItem("token")
|
||||
}
|
||||
return config
|
||||
})
|
||||
|
||||
|
|
@ -47,8 +45,8 @@ http.interceptor.request((config, cancel) => { /* 请求之前拦截器 */
|
|||
// 'X-Access-Token':getTokenStorage()
|
||||
'app-id' : uni.getAccountInfoSync().miniProgram.appId,
|
||||
"client-type" : "MA",
|
||||
'third-session' : uni.getStorageSync('third_session')||'123',
|
||||
'X-Tenant-Id' : '1003'
|
||||
'third-session' : uni.getStorageSync('third_session'),
|
||||
'X-Tenant-Id' : '1001'
|
||||
}
|
||||
/*
|
||||
if (!token) { // 如果token不存在,调用cancel 会取消本次请求,但是该函数的catch() 仍会执行
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name" : "稷山县面源污染监测平台",
|
||||
"appid" : "__UNI__A58A5D7",
|
||||
"name" : "汾西小流域面源污染监测",
|
||||
"appid" : "__UNI__44A8AB0",
|
||||
"description" : "",
|
||||
"versionName" : "2.2.22",
|
||||
"versionCode" : 233,
|
||||
|
|
@ -84,7 +84,7 @@
|
|||
"quickapp" : {},
|
||||
/* 快应用特有相关 */
|
||||
"mp-weixin" : {
|
||||
"appid" : "wxca651c881cfb603f",
|
||||
"appid" : "wx54f76f700fe3a498",
|
||||
"setting" : {
|
||||
"urlCheck" : false,
|
||||
"es6" : true,
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@
|
|||
</view>
|
||||
<view class="jczb_bot">
|
||||
<view>
|
||||
<view class="jccontent" v-if="orientlist && orientlist.length != 0">
|
||||
<view class="jccontent" v-if="orientlist.length != 0">
|
||||
<view class="titles">
|
||||
重要污染物监测
|
||||
</view>
|
||||
|
|
@ -120,7 +120,7 @@
|
|||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="jccontent" v-if="livelist && livelist.length != 0">
|
||||
<view class="jccontent" v-if="livelist.length != 0">
|
||||
<view class="titles">
|
||||
重要污染物监测
|
||||
</view>
|
||||
|
|
@ -260,12 +260,14 @@
|
|||
},
|
||||
onLoad(options) {
|
||||
this.item = JSON.parse(decodeURIComponent(options.item));
|
||||
console.log("...........",this.item)
|
||||
uni.getSystemInfo({
|
||||
success: res => {
|
||||
var pxToRpxScale = 750 / res.windowWidth
|
||||
var ktxStatusHeight = res.statusBarHeight * pxToRpxScale
|
||||
var navigationHeight = 44 * pxToRpxScale
|
||||
this.height = res.windowHeight * pxToRpxScale//将px 转换rpx
|
||||
console.log(this.height,ktxStatusHeight,navigationHeight)
|
||||
this.scorllheight = this.height
|
||||
}
|
||||
});
|
||||
|
|
@ -304,7 +306,6 @@
|
|||
let items = item.deployCode.split('-')
|
||||
var obj = {
|
||||
url: "https://m.ilhzn.cn/#/pages/cameraView/ysyCamera",
|
||||
// url: "https://m.ilhzn.cn/#/pages/cameraView/cameraView",
|
||||
deployDes: item.deployDes + '-' + '',
|
||||
ysToken: this.token,
|
||||
deviceIotUrl: item.deviceUrl
|
||||
|
|
@ -326,6 +327,7 @@
|
|||
})
|
||||
},
|
||||
tosjdetail(item,index){
|
||||
console.log(item,'gegwg')
|
||||
uni.navigateTo({
|
||||
url:'/packDetail/pages/Site/sjdetail?item=' + encodeURIComponent(JSON.stringify(item)) + '&stationCode='+this.details.stationCode + '&stationName=' + this.details.stationName
|
||||
})
|
||||
|
|
|
|||
|
|
@ -8,8 +8,7 @@
|
|||
<view class="list_item" v-for="(item,index) in List" :key="index" @click="todetail(item,index)">
|
||||
<view class="list_item_top">
|
||||
<view class="list_item_left">
|
||||
<image v-if="item.stationType == 'livestock1'" src="../../static/zhandian_icon_xuqin.png" mode=""></image>
|
||||
<image v-else-if="item.stationType == 'watershed1'" src="../../static/zhandian_icon_xuqin.png" mode=""></image>
|
||||
<image v-if="item.stationType == 'livestock'" src="../../static/zhandian_icon_xuqin.png" mode=""></image>
|
||||
<image v-else src="../../static/zd.png" mode=""></image>
|
||||
<view class="item_right" v-if="item.stationName">
|
||||
<view class="right_top">
|
||||
|
|
@ -96,6 +95,7 @@
|
|||
var ktxStatusHeight = res.statusBarHeight * pxToRpxScale
|
||||
var navigationHeight = 44 * pxToRpxScale
|
||||
this.height = res.windowHeight * pxToRpxScale//将px 转换rpx
|
||||
console.log(this.height,ktxStatusHeight,navigationHeight)
|
||||
this.scorllheight = this.height
|
||||
}
|
||||
});
|
||||
|
|
@ -143,20 +143,27 @@
|
|||
this.List[i].survDataCount = (this.List[i].survDataCount /100000000).toFixed(1) + '亿'
|
||||
}
|
||||
}
|
||||
console.log(this.List,'35415')
|
||||
if(res.data.data.total != 0){
|
||||
this.allNum = Number(res.data.data.total)/Number(this.pageSize)+'';
|
||||
console.log(this.allNum,'总页数')
|
||||
if(this.allNum.indexOf('.') == -1) {
|
||||
this.allNum = this.allNum;
|
||||
console.log(this.allNum,'if')
|
||||
} else {
|
||||
this.allNum = parseInt(Number(this.allNum)+1);
|
||||
console.log(this.allNum,'else')
|
||||
}
|
||||
console.log(this.pageNo,this.allNum,'156156')
|
||||
if(this.pageNo == this.allNum) {
|
||||
this.isLastpage = true;
|
||||
this.loadStatus='nomore'
|
||||
console.log(this.isLastpage,'true','nomore')
|
||||
} else {
|
||||
this.isLastpage = false;
|
||||
// this.isLoadMore=true
|
||||
this.loadStatus = 'more'
|
||||
console.log(this.isLastpage,'false')
|
||||
}
|
||||
}else{
|
||||
this.isLastpage = true;
|
||||
|
|
@ -168,6 +175,7 @@
|
|||
})
|
||||
},
|
||||
lower() {
|
||||
console.log("最后一页了,取消下拉功能");
|
||||
// 最后一页了,取消下拉功能
|
||||
if (this.isLastpage) {
|
||||
return
|
||||
|
|
@ -177,6 +185,7 @@
|
|||
this.intervalId = setInterval(() => {
|
||||
num = num+1;
|
||||
},1000)
|
||||
console.log(this.intervalId,num)
|
||||
this.pageNo = this.pageNo + 1;
|
||||
let params = {}
|
||||
params.pageNo = this.pageNo
|
||||
|
|
@ -189,10 +198,12 @@
|
|||
if(this.pageNo == this.allNum) {
|
||||
this.isLastpage = true;
|
||||
this.loadStatus='nomore'
|
||||
console.log(this.isLastpage,'true')
|
||||
} else {
|
||||
this.isLastpage = false;
|
||||
// this.isLoadMore=true
|
||||
this.loadStatus = 'more'
|
||||
console.log(this.isLastpage,'false')
|
||||
}
|
||||
}else{
|
||||
this.isLastpage = true;
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
<template>
|
||||
<view class="container">
|
||||
<uni-nav-bar :fixed="true" left-icon="left" background-color="#0F6EFF" @clickLeft="back()" status-bar
|
||||
:title="details.name"/>
|
||||
<view class="contant" v-if="details.icon || details.name">
|
||||
:title="details.name" />
|
||||
<view class="contant">
|
||||
<view class="list_item">
|
||||
<view class="list_item_top">
|
||||
<view class="list_item_left">
|
||||
<image :src="baseUrl + '/' + details.icon" mode=""></image>
|
||||
<image :src="details.icon" mode=""></image>
|
||||
<view class="item_right">
|
||||
<view class="right_top" v-if="details.name">
|
||||
监测指标-{{details.name}}
|
||||
|
|
@ -64,14 +64,12 @@
|
|||
<script>
|
||||
import uniEcCanvas from '../../components/uni-ec-canvas/uni-ec-canvas.vue'
|
||||
import * as echarts from '../../components/uni-ec-canvas/echarts.js'
|
||||
import configService from "@/common/service/config.service";
|
||||
export default {
|
||||
components: {
|
||||
uniEcCanvas,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
baseUrl:configService.staticDomainURL,
|
||||
items: {},
|
||||
details: {},
|
||||
list: [],
|
||||
|
|
@ -132,6 +130,8 @@
|
|||
value: (Math.floor(Object.values(data[i])[k] * 100) / 100).toFixed(2),
|
||||
dataDateTime:data[i].dataDateTime
|
||||
})
|
||||
console.log(data[i].codelist, '数据')
|
||||
console.log(data, '数据全部')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -139,19 +139,26 @@
|
|||
}
|
||||
// this.list = data
|
||||
this.list = this.list.concat(data)
|
||||
// console.log(this.list, '数据all')
|
||||
if(res.data.data.total != 0){
|
||||
this.allNum = Number(res.data.data.total)/Number(this.pageSize)+'';
|
||||
console.log(this.allNum,'总页数')
|
||||
if(this.allNum.indexOf('.') == -1) {
|
||||
this.allNum = this.allNum;
|
||||
console.log(this.allNum,'if')
|
||||
} else {
|
||||
this.allNum = parseInt(Number(this.allNum)+1);
|
||||
console.log(this.allNum,'else')
|
||||
}
|
||||
console.log(this.pageNo,this.allNum,'156156')
|
||||
if(this.pageNo == this.allNum) {
|
||||
this.isLastpage = true;
|
||||
this.loadStatus='nomore'
|
||||
console.log(this.isLastpage,'true','nomore')
|
||||
} else {
|
||||
this.isLastpage = false;
|
||||
this.loadStatus = 'more'
|
||||
console.log(this.isLastpage,'false')
|
||||
}
|
||||
}else{
|
||||
this.isLastpage = true;
|
||||
|
|
@ -160,6 +167,7 @@
|
|||
})
|
||||
},
|
||||
lower() {
|
||||
console.log("最后一页了,取消下拉功能");
|
||||
// 最后一页了,取消下拉功能
|
||||
if (this.isLastpage) {
|
||||
return
|
||||
|
|
@ -169,6 +177,7 @@
|
|||
this.intervalId = setInterval(() => {
|
||||
num = num+1;
|
||||
},1000)
|
||||
console.log(this.intervalId,num)
|
||||
this.pageNo = this.pageNo + 1;
|
||||
let params = {}
|
||||
params.pollutionCode = this.details.code
|
||||
|
|
@ -190,6 +199,8 @@
|
|||
value: (Math.floor(Object.values(data[i])[k] * 100) / 100).toFixed(2),
|
||||
dataDateTime:data[i].dataDateTime
|
||||
})
|
||||
console.log(data[i].codelist, '数据')
|
||||
console.log(data, '数据全部')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -201,10 +212,12 @@
|
|||
if(this.pageNo == this.allNum) {
|
||||
this.isLastpage = true;
|
||||
this.loadStatus='nomore'
|
||||
console.log(this.isLastpage,'true')
|
||||
} else {
|
||||
this.isLastpage = false;
|
||||
// this.isLoadMore=true
|
||||
this.loadStatus = 'more'
|
||||
console.log(this.isLastpage,'false')
|
||||
}
|
||||
}else{
|
||||
this.isLastpage = true;
|
||||
|
|
|
|||
|
|
@ -43,8 +43,8 @@
|
|||
<!-- 年月日选择器 -->
|
||||
<view class="uni-form-item uni-column">
|
||||
<radio-group class="radio-group" @change="radioChange">
|
||||
<label class="radio-label" v-for="(item, index) in timList" :key="item.value" :class="{ 'checked': current === index }">
|
||||
<radio :value="item.value" :checked="index === current" class="radio-item" color="#0f6efe" />
|
||||
<label class="radio-label" v-for="(item, index) in timList" :key="item.value">
|
||||
<radio :value="item.value" :checked="index === current" class="radio-item" />
|
||||
<view class="radio-text">{{item.name}}</view>
|
||||
</label>
|
||||
</radio-group>
|
||||
|
|
@ -126,19 +126,16 @@
|
|||
height: 0,
|
||||
scorllheight: 0,
|
||||
zt: '',
|
||||
date: new Date().getFullYear().toString(),
|
||||
array: [], // 站点名称列表(用于趋势图下拉)
|
||||
index: 0,
|
||||
date: new Date().getFullYear(),
|
||||
array: [],
|
||||
index: 0, // 改为0,默认选择第一个
|
||||
index1: 0,
|
||||
array1: [], // 设备名称列表(用于预警下拉)
|
||||
arrays: [], // 站点列表(已废弃,保留兼容)
|
||||
array1: [],
|
||||
arrays: [],
|
||||
list: [],
|
||||
tabList: ['站点名称', '告警指标', '指标值', '告警时间'],
|
||||
pjlist: [],
|
||||
chartData: {
|
||||
categories: [],
|
||||
series: []
|
||||
},
|
||||
chartData: {},
|
||||
opts: {
|
||||
color: ["#1890FF","#91CB74","#FAC858","#EE6666","#73C0DE","#3CA272","#FC8452","#9A60B4","#ea7ccc"],
|
||||
padding: [15,10,0,15],
|
||||
|
|
@ -186,13 +183,14 @@
|
|||
total: 0,
|
||||
yearStr: null,
|
||||
stationName1: '',
|
||||
stationCode1: null, // 设备ID(用于预警列表)
|
||||
stationCode: '', // 站点编码(用于趋势图)
|
||||
arrays1: [], // 设备列表(已废弃,保留兼容)
|
||||
stationCode1: null,
|
||||
stationCode: '', // 趋势图站点编码
|
||||
arrays1: [],
|
||||
zxtdata: [],
|
||||
timList: [{
|
||||
value: 'yearMonth',
|
||||
name: '年'
|
||||
name: '年',
|
||||
checked: 'true'
|
||||
},
|
||||
{
|
||||
value: 'monthDays',
|
||||
|
|
@ -204,14 +202,11 @@
|
|||
},
|
||||
],
|
||||
current: 0,
|
||||
dateqs: new Date().getFullYear().toString(),
|
||||
dateqs: new Date().getFullYear().toString(), // 改为字符串
|
||||
datetwo: currentDate,
|
||||
riqinumber: 'yearMonth',
|
||||
startDate: '2000-01-01',
|
||||
endDate: '2030-12-31',
|
||||
// 新增:分离站点列表和设备列表
|
||||
stationList: [], // 站点列表 [{label: '站点名', value: '站点编码'}]
|
||||
deviceList: [] // 设备列表 [{label: '设备名', value: '设备ID'}]
|
||||
startDate: '', // 添加起始日期
|
||||
endDate: '', // 添加结束日期
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
|
|
@ -224,66 +219,88 @@
|
|||
this.scorllheight = this.height
|
||||
}
|
||||
});
|
||||
this.index = 0
|
||||
this.index1 = 0
|
||||
|
||||
// 设置日期范围
|
||||
const currentYear = new Date().getFullYear();
|
||||
this.startDate = `${currentYear - 10}-01-01`;
|
||||
this.endDate = `${currentYear + 10}-12-31`;
|
||||
|
||||
// 先获取评价数据
|
||||
this.getpj()
|
||||
// 获取站点列表(内部会调用趋势图)
|
||||
this.importWyw()
|
||||
// 获取预警设备列表
|
||||
this.getazsurvMulchRecord()
|
||||
// 获取预警列表
|
||||
this.getyjList()
|
||||
},
|
||||
methods: {
|
||||
// 格式化数字
|
||||
cutMoneyFiter(val) {
|
||||
if (!val && val !== 0) return 0
|
||||
return val
|
||||
},
|
||||
// 获取站点列表(用于趋势图)
|
||||
// 获取站点列表
|
||||
importWyw() {
|
||||
this.stationList = []
|
||||
this.array = []
|
||||
this.arrays = []
|
||||
this.arrays1 = [{
|
||||
label: '全部监测设备',
|
||||
value: ''
|
||||
}]
|
||||
this.$http.get('/applet/survStationInfo/list').then(res => {
|
||||
for (var i = 0; i < res.data.data.length; i++) {
|
||||
this.stationList.push({
|
||||
label: res.data.data[i].stationName,
|
||||
value: res.data.data[i].stationCode // 站点编码
|
||||
const dataList = res.data.data || []
|
||||
for (var i = 0; i < dataList.length; i++) {
|
||||
this.arrays.push({
|
||||
label: dataList[i].stationName,
|
||||
value: dataList[i].stationCode
|
||||
})
|
||||
this.array.push(res.data.data[i].stationName)
|
||||
this.arrays1.push({
|
||||
label: dataList[i].stationName,
|
||||
value: dataList[i].stationCode
|
||||
})
|
||||
this.array.push(dataList[i].stationName)
|
||||
}
|
||||
// 站点数据加载完成后,设置默认站点并获取趋势数据
|
||||
if (this.stationList.length > 0) {
|
||||
this.stationCode = this.stationList[0]?.value || ''
|
||||
// 延迟一点确保数据已渲染
|
||||
setTimeout(() => {
|
||||
this.qushicov()
|
||||
}, 300)
|
||||
// 设置默认第一个站点
|
||||
if (this.array.length > 0) {
|
||||
this.stationCode = this.arrays[0].value
|
||||
// 调用趋势图获取数据
|
||||
this.qushicov()
|
||||
} else {
|
||||
console.warn('没有获取到站点数据')
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log('获取站点列表失败', err)
|
||||
console.error('获取站点列表失败:', err)
|
||||
})
|
||||
},
|
||||
// 获取设备列表(用于预警)
|
||||
// 获取监测站点设备数据
|
||||
getazsurvMulchRecord() {
|
||||
this.deviceList = []
|
||||
this.arrays = []
|
||||
this.array1 = ['全部监测设备']
|
||||
this.arrays1 = [{
|
||||
label: '全部监测设备',
|
||||
value: ''
|
||||
}]
|
||||
this.$http.get('/applet/survDeviceDeploy/survDeviceList').then(res => {
|
||||
for (var i = 0; i < res.data.data.length; i++) {
|
||||
this.deviceList.push({
|
||||
label: res.data.data[i].fullDeviceName,
|
||||
value: res.data.data[i].id // 设备ID
|
||||
const dataList = res.data.data || []
|
||||
for (var i = 0; i < dataList.length; i++) {
|
||||
this.arrays.push({
|
||||
label: dataList[i].fullDeviceName,
|
||||
value: dataList[i].id
|
||||
})
|
||||
this.array1.push(res.data.data[i].fullDeviceName)
|
||||
this.arrays1.push({
|
||||
label: dataList[i].fullDeviceName,
|
||||
value: dataList[i].id
|
||||
})
|
||||
this.array1.push(dataList[i].fullDeviceName)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log('获取设备列表失败', err)
|
||||
console.error('获取设备列表失败:', err)
|
||||
})
|
||||
},
|
||||
// 获取预警列表
|
||||
getyjList() {
|
||||
let params = {}
|
||||
params.pageNo = this.pageNo
|
||||
params.pageSize = this.pageSize
|
||||
params.deployId = this.stationCode1 // 使用设备ID
|
||||
params.yearStr = this.yearStr
|
||||
let params = {
|
||||
pageNo: this.pageNo,
|
||||
pageSize: this.pageSize,
|
||||
deployId: this.stationCode1,
|
||||
yearStr: this.yearStr
|
||||
}
|
||||
uni.showLoading({
|
||||
title: '加载中'
|
||||
});
|
||||
|
|
@ -292,7 +309,7 @@
|
|||
params: params
|
||||
}).then(res => {
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data.records
|
||||
var data = res.data.data.records || []
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
data[i].times = data[i].alertTime.replace(" ", ":").replace(/\:/g, "-").split("-");
|
||||
data[i].nian = data[i].times[0];
|
||||
|
|
@ -305,19 +322,11 @@
|
|||
if (data[i].alertContent && data[i].alertContent.indexOf('监测数据名称:') != -1) {
|
||||
data[i].alertContent = data[i].alertContent.replace('监测数据名称:', '')
|
||||
}
|
||||
// 如果alertContent是字符串,转换为数组格式
|
||||
if (typeof data[i].alertContent === 'string') {
|
||||
data[i].alertContent = [{
|
||||
name: '告警',
|
||||
val: data[i].alertContent,
|
||||
unit: ''
|
||||
}]
|
||||
}
|
||||
}
|
||||
this.list = this.list.concat(data)
|
||||
this.total = res.data.data.total
|
||||
if (res.data.data.total != 0) {
|
||||
this.allNum = Number(res.data.data.total) / Number(this.pageSize) + '';
|
||||
this.total = res.data.data.total || 0
|
||||
if (this.total != 0) {
|
||||
this.allNum = Number(this.total) / Number(this.pageSize) + '';
|
||||
if (this.allNum.indexOf('.') == -1) {
|
||||
this.allNum = this.allNum;
|
||||
} else {
|
||||
|
|
@ -339,6 +348,7 @@
|
|||
this.isRefresher = false
|
||||
}).catch(err => {
|
||||
uni.hideLoading();
|
||||
console.error('获取预警列表失败:', err)
|
||||
})
|
||||
},
|
||||
// 分页加载
|
||||
|
|
@ -352,16 +362,17 @@
|
|||
num = num + 1;
|
||||
}, 1000)
|
||||
this.pageNo = this.pageNo + 1;
|
||||
let params = {}
|
||||
params.pageNo = this.pageNo
|
||||
params.pageSize = this.pageSize
|
||||
params.deployId = this.stationCode1 // 使用设备ID
|
||||
params.yearStr = this.yearStr
|
||||
let params = {
|
||||
pageNo: this.pageNo,
|
||||
pageSize: this.pageSize,
|
||||
deployId: this.stationCode1,
|
||||
yearStr: this.yearStr
|
||||
}
|
||||
this.$http.get('/applet/wxclient/alertRecord', {
|
||||
params: params
|
||||
}).then(res => {
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data.records
|
||||
var data = res.data.data.records || []
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
data[i].times = data[i].alertTime.replace(" ", ":").replace(/\:/g, "-").split("-");
|
||||
data[i].nian = data[i].times[0];
|
||||
|
|
@ -374,16 +385,9 @@
|
|||
if (data[i].alertContent && data[i].alertContent.indexOf('监测数据名称:') != -1) {
|
||||
data[i].alertContent = data[i].alertContent.replace('监测数据名称:', '')
|
||||
}
|
||||
if (typeof data[i].alertContent === 'string') {
|
||||
data[i].alertContent = [{
|
||||
name: '告警',
|
||||
val: data[i].alertContent,
|
||||
unit: ''
|
||||
}]
|
||||
}
|
||||
}
|
||||
this.list = this.list.concat(data)
|
||||
if (res.data.data.total != 0) {
|
||||
if (this.total != 0) {
|
||||
if (this.pageNo == this.allNum) {
|
||||
this.isLastpage = true;
|
||||
this.loadStatus = 'nomore'
|
||||
|
|
@ -397,13 +401,13 @@
|
|||
}
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log('加载更多预警失败', err)
|
||||
console.error('加载更多失败:', err)
|
||||
})
|
||||
},
|
||||
// 获取评价
|
||||
getpj() {
|
||||
this.$http.post('/applet/wxclient/displayInfo?infoType=' + 'effect_assess').then(res => {
|
||||
let data = res.data.data.effect_assess.detailList
|
||||
let data = res.data.data.effect_assess.detailList || []
|
||||
this.pjlist = data
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
if (data[i].detailCode == '综合评价') {
|
||||
|
|
@ -411,170 +415,147 @@
|
|||
}
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log('获取评价失败', err)
|
||||
console.error('获取评价数据失败:', err)
|
||||
})
|
||||
},
|
||||
// 选择年月日
|
||||
radioChange(e) {
|
||||
this.riqinumber = e.detail.value
|
||||
// 更新当前选中的索引
|
||||
this.timList.forEach((item, index) => {
|
||||
if (item.value === e.detail.value) {
|
||||
this.current = index
|
||||
}
|
||||
})
|
||||
// 根据选择的模式调整日期格式
|
||||
let currentDate = new Date()
|
||||
let year = currentDate.getFullYear()
|
||||
let month = String(currentDate.getMonth() + 1).padStart(2, '0')
|
||||
let day = String(currentDate.getDate()).padStart(2, '0')
|
||||
|
||||
if (this.riqinumber === 'yearMonth') {
|
||||
this.dateqs = String(year)
|
||||
} else if (this.riqinumber === 'monthDays') {
|
||||
this.dateqs = year + '-' + month
|
||||
} else {
|
||||
this.dateqs = year + '-' + month + '-' + day
|
||||
}
|
||||
this.current = this.timList.findIndex(item => item.value === e.detail.value)
|
||||
// 重新调用趋势图
|
||||
this.qushicov()
|
||||
},
|
||||
// 趋势时间选择
|
||||
// 趋势时间切换
|
||||
bindDateqsChange(e) {
|
||||
let selectedDate = e.detail.value
|
||||
if (this.riqinumber === 'yearMonth') {
|
||||
this.dateqs = selectedDate.slice(0, 4)
|
||||
} else if (this.riqinumber === 'monthDays') {
|
||||
this.dateqs = selectedDate.slice(0, 7)
|
||||
let selectedDate = e.detail.value;
|
||||
// 根据选择的维度格式化日期
|
||||
if (this.riqinumber === 'monthDays') {
|
||||
this.dateqs = selectedDate.slice(0, 7); // YYYY-MM
|
||||
} else if (this.riqinumber === 'yearMonth') {
|
||||
this.dateqs = selectedDate.slice(0, 4); // YYYY
|
||||
} else {
|
||||
this.dateqs = selectedDate
|
||||
this.dateqs = selectedDate; // YYYY-MM-DD
|
||||
}
|
||||
this.qushicov()
|
||||
// 重新获取趋势数据
|
||||
this.qushicov();
|
||||
},
|
||||
// 趋势接口
|
||||
qushicov() {
|
||||
// 如果没有站点编码,使用默认值或等待
|
||||
// 检查是否有站点编码
|
||||
if (!this.stationCode) {
|
||||
if (this.stationList.length > 0) {
|
||||
this.stationCode = this.stationList[0].value
|
||||
} else {
|
||||
// 如果站点还没加载完成,延迟重试
|
||||
setTimeout(() => {
|
||||
if (this.stationList.length > 0) {
|
||||
this.stationCode = this.stationList[0].value
|
||||
this.qushicov()
|
||||
}
|
||||
}, 500)
|
||||
return
|
||||
}
|
||||
console.warn('站点编码为空,无法获取趋势数据')
|
||||
return
|
||||
}
|
||||
|
||||
let data = {
|
||||
summrayMode: this.riqinumber,
|
||||
startTime: this.dateqs,
|
||||
stationCode: this.stationCode, // 使用站点编码
|
||||
stationCode: this.stationCode,
|
||||
}
|
||||
|
||||
uni.showLoading({
|
||||
title: '加载趋势数据...'
|
||||
});
|
||||
|
||||
this.$http.post('/applet/survDeviceDeploy/waterIntegrateStatistic', data).then(iem => {
|
||||
let lynum = iem.data.data
|
||||
|
||||
// 数据为空时显示空图表
|
||||
if (!lynum || !lynum.tableHead || !lynum.tableData2 || lynum.tableHead.length === 0) {
|
||||
this.chartData = {
|
||||
categories: [],
|
||||
series: []
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
setTimeout(() => {
|
||||
let categories = []
|
||||
let displayCategories = []
|
||||
let series = []
|
||||
let allValues = []
|
||||
let categories = [];
|
||||
let displayCategories = [];
|
||||
let series = [];
|
||||
let allValues = [];
|
||||
|
||||
// 处理X轴数据
|
||||
categories = lynum.tableIndex || []
|
||||
if (categories.length > 0) {
|
||||
const first = categories[0]
|
||||
const middle = categories[Math.floor(categories.length / 2)]
|
||||
const last = categories[categories.length - 1]
|
||||
if (lynum.tableHead && lynum.tableHead.length > 0) {
|
||||
categories = lynum.tableIndex || [];
|
||||
|
||||
displayCategories = categories.map((item, index) => {
|
||||
if (index === 0 || index === Math.floor(categories.length / 2) || index === categories.length - 1) {
|
||||
return item
|
||||
}
|
||||
return ''
|
||||
})
|
||||
}
|
||||
if (categories.length > 0) {
|
||||
const first = categories[0];
|
||||
const middle = categories[Math.floor(categories.length / 2)];
|
||||
const last = categories[categories.length - 1];
|
||||
|
||||
// 处理series数据
|
||||
lynum.tableHead.forEach((header, index) => {
|
||||
const seriesData = (lynum.tableData2 || []).map(row => {
|
||||
const value = row[index] === "0" ? 0 : parseFloat(row[index]) || 0
|
||||
allValues.push(value)
|
||||
return value
|
||||
})
|
||||
displayCategories = categories.map((item, index) => {
|
||||
if (index === 0 || index === Math.floor(categories.length / 2) || index === categories.length - 1) {
|
||||
return item;
|
||||
}
|
||||
return '';
|
||||
});
|
||||
}
|
||||
|
||||
series.push({
|
||||
name: header.eleDesc || header.name || '指标',
|
||||
data: seriesData
|
||||
})
|
||||
})
|
||||
lynum.tableHead.forEach((header, index) => {
|
||||
const seriesData = lynum.tableData2.map(row => {
|
||||
const value = row[index] === "0" ? 0 : parseFloat(row[index]) || 0;
|
||||
allValues.push(value);
|
||||
return value;
|
||||
});
|
||||
|
||||
// 动态计算Y轴范围
|
||||
if (allValues.length > 0) {
|
||||
const maxValue = Math.max(...allValues)
|
||||
const minValue = Math.min(...allValues)
|
||||
const padding = maxValue * 0.1 || 10
|
||||
const yAxisMax = maxValue + padding
|
||||
const yAxisMin = Math.max(0, minValue - padding)
|
||||
series.push({
|
||||
name: header.eleDesc || header,
|
||||
data: seriesData
|
||||
});
|
||||
});
|
||||
|
||||
this.opts = {
|
||||
...this.opts,
|
||||
yAxis: {
|
||||
gridType: "dash",
|
||||
dashLength: 2,
|
||||
data: [
|
||||
{
|
||||
min: yAxisMin,
|
||||
max: yAxisMax || 100
|
||||
}
|
||||
]
|
||||
}
|
||||
// 动态计算Y轴范围
|
||||
if (allValues.length > 0) {
|
||||
const maxValue = Math.max(...allValues);
|
||||
const minValue = Math.min(...allValues);
|
||||
const padding = maxValue * 0.1;
|
||||
const yAxisMax = maxValue + padding;
|
||||
const yAxisMin = Math.max(0, minValue - padding);
|
||||
|
||||
this.opts = {
|
||||
...this.opts,
|
||||
yAxis: {
|
||||
gridType: "dash",
|
||||
dashLength: 2,
|
||||
data: [
|
||||
{
|
||||
min: yAxisMin,
|
||||
max: yAxisMax
|
||||
}
|
||||
]
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
this.chartData = {
|
||||
let res = {
|
||||
categories: displayCategories,
|
||||
series: series
|
||||
}
|
||||
}, 300)
|
||||
};
|
||||
this.chartData = JSON.parse(JSON.stringify(res));
|
||||
uni.hideLoading();
|
||||
}, 500);
|
||||
}).catch(err => {
|
||||
this.chartData = {
|
||||
categories: [],
|
||||
series: []
|
||||
}
|
||||
uni.hideLoading();
|
||||
console.error('获取趋势数据失败:', err)
|
||||
// 显示错误提示
|
||||
uni.showToast({
|
||||
title: '获取趋势数据失败',
|
||||
icon: 'none'
|
||||
})
|
||||
})
|
||||
},
|
||||
// 折线图切换站点 - 使用 stationList
|
||||
// 折线图切换站点
|
||||
bindPickerChange: function(e) {
|
||||
this.index = e.detail.value
|
||||
let stationName = this.array[this.index]
|
||||
for (var i = 0; i < this.stationList.length; i++) {
|
||||
if (stationName == this.stationList[i].label) {
|
||||
this.stationCode = this.stationList[i].value // 使用 stationList 获取站点编码
|
||||
this.stationName = this.array[this.index]
|
||||
for (var i = 0; i < this.arrays.length; i++) {
|
||||
if (this.stationName == this.arrays[i].label) {
|
||||
this.stationCode = this.arrays[i].value
|
||||
break
|
||||
}
|
||||
}
|
||||
// 切换站点后重新获取趋势数据
|
||||
this.qushicov()
|
||||
},
|
||||
// 预警切换设备 - 使用 deviceList
|
||||
// 预警切换站点
|
||||
bindPickerChange1: function(e) {
|
||||
this.index1 = e.detail.value
|
||||
this.stationName1 = this.array1[this.index1]
|
||||
for (var i = 0; i < this.deviceList.length; i++) {
|
||||
if (this.stationName1 == this.deviceList[i].label) {
|
||||
this.stationCode1 = this.deviceList[i].value // 使用 deviceList 获取设备ID
|
||||
for (var i = 0; i < this.arrays.length; i++) {
|
||||
if (this.stationName1 == this.arrays1[i].label) {
|
||||
this.stationCode1 = this.arrays1[i].value
|
||||
break
|
||||
}
|
||||
}
|
||||
|
|
@ -596,6 +577,7 @@
|
|||
let year = date.getFullYear();
|
||||
let month = date.getMonth() + 1;
|
||||
let day = date.getDate();
|
||||
|
||||
if (type === 'start') {
|
||||
year = year - 10;
|
||||
} else if (type === 'end') {
|
||||
|
|
@ -604,6 +586,11 @@
|
|||
month = month > 9 ? month : '0' + month;
|
||||
day = day > 9 ? day : '0' + day;
|
||||
return `${year}-${month}-${day}`;
|
||||
},
|
||||
// 格式化数字(如果组件中有使用)
|
||||
cutMoneyFiter(val) {
|
||||
if (!val) return 0
|
||||
return val
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -986,7 +973,6 @@
|
|||
.pagebot {
|
||||
height: 100rpx;
|
||||
}
|
||||
|
||||
// 选择年月日
|
||||
.radio-group {
|
||||
display: flex;
|
||||
|
|
|
|||
|
|
@ -178,6 +178,7 @@
|
|||
text:res.data.data[i].itemText,
|
||||
value:res.data.data[i].itemValue
|
||||
})
|
||||
console.log(this.hobby)
|
||||
}
|
||||
})
|
||||
},
|
||||
|
|
@ -206,6 +207,7 @@
|
|||
text:res.data.data[i].itemText,
|
||||
value:res.data.data[i].itemValue
|
||||
})
|
||||
console.log(this.hobby3)
|
||||
}
|
||||
})
|
||||
},
|
||||
|
|
@ -215,14 +217,17 @@
|
|||
},
|
||||
// 选择养殖品种
|
||||
change1(e){
|
||||
console.log(e)
|
||||
this.details.breedVariety = e.detail.value
|
||||
},
|
||||
// 选择治污模式
|
||||
change2(e){
|
||||
console.log(e)
|
||||
this.details.controlMode = e.detail.value
|
||||
},
|
||||
// 选择利用模式
|
||||
change3(e){
|
||||
console.log(e)
|
||||
this.details.useMode = e.detail.value
|
||||
},
|
||||
// 提交
|
||||
|
|
|
|||
|
|
@ -119,6 +119,7 @@
|
|||
text:res.data.data[i].itemText,
|
||||
value:res.data.data[i].itemValue
|
||||
})
|
||||
console.log(this.hobby)
|
||||
}
|
||||
})
|
||||
},
|
||||
|
|
@ -154,6 +155,7 @@
|
|||
text:res.data.data[i].itemText,
|
||||
value:res.data.data[i].itemValue
|
||||
})
|
||||
console.log(this.hobby3)
|
||||
}
|
||||
for(var i=0;i<this.hobby3.length;i++){
|
||||
if(this.details.useMode){
|
||||
|
|
|
|||
|
|
@ -179,6 +179,7 @@
|
|||
text:res.data.data[i].itemText,
|
||||
value:res.data.data[i].itemValue
|
||||
})
|
||||
console.log(this.hobby)
|
||||
}
|
||||
})
|
||||
},
|
||||
|
|
@ -207,6 +208,7 @@
|
|||
text:res.data.data[i].itemText,
|
||||
value:res.data.data[i].itemValue
|
||||
})
|
||||
console.log(this.hobby3)
|
||||
}
|
||||
})
|
||||
},
|
||||
|
|
@ -216,14 +218,17 @@
|
|||
},
|
||||
// 选择养殖品种
|
||||
change1(e){
|
||||
console.log(e)
|
||||
this.details.breedVariety = e.detail.value
|
||||
},
|
||||
// 选择治污模式
|
||||
change2(e){
|
||||
console.log(e)
|
||||
this.details.controlMode = e.detail.value
|
||||
},
|
||||
// 选择利用模式
|
||||
change3(e){
|
||||
console.log(e)
|
||||
this.details.useMode = e.detail.value
|
||||
},
|
||||
// 提交
|
||||
|
|
|
|||
|
|
@ -129,6 +129,7 @@
|
|||
var ktxStatusHeight = res.statusBarHeight * pxToRpxScale
|
||||
var navigationHeight = 44 * pxToRpxScale
|
||||
this.height = res.windowHeight * pxToRpxScale//将px 转换rpx
|
||||
console.log(this.height,ktxStatusHeight,navigationHeight)
|
||||
this.scorllheight = this.height - 182
|
||||
}
|
||||
});
|
||||
|
|
@ -141,12 +142,14 @@
|
|||
var ktxStatusHeight = res.statusBarHeight * pxToRpxScale
|
||||
var navigationHeight = 44 * pxToRpxScale
|
||||
this.height = res.windowHeight * pxToRpxScale//将px 转换rpx
|
||||
console.log(this.height,ktxStatusHeight,navigationHeight)
|
||||
this.scorllheight = this.height - 182
|
||||
}
|
||||
});
|
||||
let pages = getCurrentPages();
|
||||
let currPage = pages[pages.length - 1]; //当前页面
|
||||
this.reload = currPage.data.reload
|
||||
console.log(this.reload,'Ge')
|
||||
if(this.reload){
|
||||
this.farmName = ''
|
||||
this.breedVariety = ''
|
||||
|
|
@ -172,6 +175,7 @@
|
|||
value:res.data.data[i].itemValue
|
||||
})
|
||||
this.array.push(res.data.data[i].itemText)
|
||||
console.log(this.array)
|
||||
}
|
||||
})
|
||||
},
|
||||
|
|
@ -206,18 +210,24 @@
|
|||
this.List = this.List.concat(data)
|
||||
if(res.data.data.total != 0){
|
||||
this.allNum = Number(res.data.data.total)/Number(this.pageSize)+'';
|
||||
console.log(this.allNum,'总页数')
|
||||
if(this.allNum.indexOf('.') == -1) {
|
||||
this.allNum = this.allNum;
|
||||
console.log(this.allNum,'if')
|
||||
} else {
|
||||
this.allNum = parseInt(Number(this.allNum)+1);
|
||||
console.log(this.allNum,'else')
|
||||
}
|
||||
console.log(this.pageNo,this.allNum,'156156')
|
||||
if(this.pageNo == this.allNum) {
|
||||
this.isLastpage = true;
|
||||
this.loadStatus='nomore'
|
||||
console.log(this.isLastpage,'true','nomore')
|
||||
} else {
|
||||
this.isLastpage = false;
|
||||
// this.isLoadMore=true
|
||||
this.loadStatus = 'more'
|
||||
console.log(this.isLastpage,'false')
|
||||
}
|
||||
}else{
|
||||
this.isLastpage = true;
|
||||
|
|
@ -230,6 +240,7 @@
|
|||
},
|
||||
// 分页加载
|
||||
lower() {
|
||||
console.log("最后一页了,取消下拉功能");
|
||||
// 最后一页了,取消下拉功能
|
||||
if (this.isLastpage) {
|
||||
return
|
||||
|
|
@ -239,6 +250,7 @@
|
|||
this.intervalId = setInterval(() => {
|
||||
num = num+1;
|
||||
},1000)
|
||||
console.log(this.intervalId,num)
|
||||
this.pageNo = this.pageNo + 1;
|
||||
let params = {}
|
||||
params.pageNo = this.pageNo
|
||||
|
|
@ -254,10 +266,12 @@
|
|||
if(this.pageNo == this.allNum) {
|
||||
this.isLastpage = true;
|
||||
this.loadStatus='nomore'
|
||||
console.log(this.isLastpage,'true')
|
||||
} else {
|
||||
this.isLastpage = false;
|
||||
// this.isLoadMore=true
|
||||
this.loadStatus = 'more'
|
||||
console.log(this.isLastpage,'false')
|
||||
}
|
||||
}else{
|
||||
this.isLastpage = true;
|
||||
|
|
@ -267,6 +281,7 @@
|
|||
})
|
||||
},
|
||||
bindPickerChange: function(e) {
|
||||
console.log('picker发送选择改变,携带值为', e.detail.value)
|
||||
this.index = e.detail.value
|
||||
this.breedVariety = this.arrays[this.index].value
|
||||
this.breedVariety1 = this.arrays[this.index].text
|
||||
|
|
@ -297,10 +312,12 @@
|
|||
},
|
||||
// 操作
|
||||
caozuo(item){
|
||||
console.log(item)
|
||||
var that = this
|
||||
uni.showActionSheet({
|
||||
itemList: ['编辑', '删除'],
|
||||
success: function (res) {
|
||||
console.log('选中了第' + (res.tapIndex + 1) + '个按钮');
|
||||
if((res.tapIndex + 1) == 1){
|
||||
uni.navigateTo({
|
||||
url:'/packDetail/pages/fwtz/edit?item='+ encodeURIComponent(JSON.stringify(item))
|
||||
|
|
@ -311,6 +328,8 @@
|
|||
content: '是否删除数据?',
|
||||
success: function (res) {
|
||||
if (res.confirm) {
|
||||
console.log('用户点击确定');
|
||||
console.log(item.id,1)
|
||||
that.$http.delete(that.deleteUrl+'?id='+item.id).then(res =>{
|
||||
if(res.data.code == 0){
|
||||
uni.showToast({
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@
|
|||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<text class="botmTetx">Copyright <text style="font-size: 30rpx;padding:0rpx 7rpx;"> © </text> 稷山县农业农村局</text>
|
||||
<text class="botmTetx">Copyright <text style="font-size: 30rpx;padding:0rpx 7rpx;"> © </text> 汾西县农业农村局</text>
|
||||
<!-- <view class="loginpage">
|
||||
<image class="bigimg" src="../../static/dls.jpg" mode=""></image>
|
||||
<view class="padding text-center margin-top">
|
||||
|
|
@ -80,7 +80,7 @@ export default {
|
|||
thirdLoginInfo: "",
|
||||
thirdLoginState: false,
|
||||
bindingPhoneModal: false,
|
||||
login: true,
|
||||
login: false,
|
||||
thirdUserUuid: '',
|
||||
url: {
|
||||
bindingThirdPhone: '/sys/thirdLogin/bindingThirdPhone'
|
||||
|
|
@ -100,20 +100,26 @@ export default {
|
|||
var that = this
|
||||
uni.login({
|
||||
success: function (res) {
|
||||
console.log(res.code)
|
||||
that.code = res.code
|
||||
let params = {}
|
||||
params.jsCode = that.code
|
||||
console.log(params, 152)
|
||||
api.wxlogin(params).then(res => {
|
||||
let userInfo = res.data.data;
|
||||
uni.setStorageSync('third_session', userInfo.thirdSession);
|
||||
// api.loginCallback(res, ()=>{
|
||||
// that.login = false
|
||||
// uni.reLaunch({
|
||||
// url: '/pages/index/index'
|
||||
// })
|
||||
// }, ()=>{
|
||||
// that.login = true
|
||||
// });
|
||||
console.log(res, 165)
|
||||
if (res.data.code == 0) {
|
||||
let userInfo = res.data.data;
|
||||
uni.setStorageSync('third_session', userInfo.thirdSession);
|
||||
console.log(that.login, '状态')
|
||||
if (userInfo.id) {
|
||||
that.login = false
|
||||
uni.reLaunch({
|
||||
url: '/pages/index/index'
|
||||
})
|
||||
} else if (!userInfo.id) {
|
||||
that.login = true
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
|
|
@ -144,6 +150,7 @@ export default {
|
|||
})
|
||||
},
|
||||
TypeInput(e) {
|
||||
console.log(e, 415)
|
||||
// 只能输入数字的验证;
|
||||
const inputType = /[\W]/g //想限制什么类型在这里换换正则就可以了
|
||||
this.$nextTick(function () {
|
||||
|
|
@ -151,6 +158,7 @@ export default {
|
|||
})
|
||||
},
|
||||
tologins() {
|
||||
console.log(this.userInfoLoginDTO.password, this.userInfoLoginDTO.userName, '密码用户')
|
||||
if (!this.userInfoLoginDTO.userName) {
|
||||
uni.showToast({
|
||||
title: '请输入账号',
|
||||
|
|
@ -168,21 +176,23 @@ export default {
|
|||
return
|
||||
}
|
||||
this.$http.post('/applet/userInfo/logins', this.userInfoLoginDTO).then(res => {
|
||||
api.loginCallback(res, ()=>{
|
||||
if (res.data.code == 0) {
|
||||
uni.setStorageSync('constant', res.data.data)
|
||||
uni.setStorageSync('password', this.userInfoLoginDTO.password)
|
||||
uni.setStorageSync('userName', this.userInfoLoginDTO.userName)
|
||||
uni.reLaunch({
|
||||
url: '/pages/index/index'
|
||||
})
|
||||
}, ()=>{
|
||||
} else {
|
||||
uni.removeStorageSync('constant')
|
||||
uni.showToast({
|
||||
title: res.data.msg,
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
})
|
||||
});
|
||||
// this.userInfoLoginDTO.password = ''
|
||||
// this.userInfoLoginDTO.userName = ''
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
@ -196,7 +206,7 @@ export default {
|
|||
left: 50%;
|
||||
transform: translate(-50%);
|
||||
color: #999;
|
||||
width: 66%;
|
||||
width: 52%;
|
||||
}
|
||||
.login-paddingtop {
|
||||
padding-top: 100upx;
|
||||
|
|
|
|||
|
|
@ -167,6 +167,7 @@
|
|||
var ktxStatusHeight = res.statusBarHeight * pxToRpxScale
|
||||
var navigationHeight = 44 * pxToRpxScale
|
||||
this.height = res.windowHeight * pxToRpxScale//将px 转换rpx
|
||||
console.log(this.height,ktxStatusHeight,navigationHeight)
|
||||
this.scorllheight = this.height - 120
|
||||
}
|
||||
});
|
||||
|
|
@ -198,17 +199,21 @@
|
|||
this.$set(item, 'checked', true)
|
||||
})
|
||||
this.checkList = this.alllist
|
||||
console.log(this.checkList,156)
|
||||
}
|
||||
|
||||
},
|
||||
checkSelectItem(e, item) {
|
||||
console.log(item,156)
|
||||
// 如果是取消选中,就把checked置为false,如果是选中,就给添加一个checked=true
|
||||
if (item.checked == true) {
|
||||
this.$set(item, 'checked', false)
|
||||
this.checkList = this.checkList.filter(items => (items.value !== item.value))
|
||||
console.log(this.checkList,'true')
|
||||
} else {
|
||||
this.$set(item, 'checked', true)
|
||||
this.checkList.push(item)
|
||||
console.log(this.checkList,'false')
|
||||
}
|
||||
// 过滤出数组中checked为true的项目,如果和原alllist长度相等,就全选显示
|
||||
let newArr = this.alllist.filter(item => (item.checked == true))
|
||||
|
|
@ -217,6 +222,7 @@
|
|||
} else {
|
||||
this.checkTrue = false;
|
||||
}
|
||||
console.log(this.checkList,41561456)
|
||||
},
|
||||
submit(){
|
||||
uni.navigateBack({
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<view class="container">
|
||||
<!-- 顶部选项卡 -->
|
||||
<!-- <view class="topScroll">
|
||||
<view class="topScroll">
|
||||
<scroll-view scroll-x="true" class="scroll">
|
||||
<view class="scroll-item" v-for="(item,index) in topItems" :key="index" @click="chooseClick(item,index)"
|
||||
:class="{'scroll-item2':isActive == index}">
|
||||
|
|
@ -10,7 +10,7 @@
|
|||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view> -->
|
||||
</view>
|
||||
|
||||
<!-- 监测站告警 -->
|
||||
<block v-if="isActive == 0">
|
||||
|
|
@ -135,13 +135,12 @@
|
|||
arrays: [],
|
||||
isRefresher: false, //下拉刷新状态
|
||||
reload: '',
|
||||
topItems: [
|
||||
// {
|
||||
// dictLabel: '监测站告警'
|
||||
// },
|
||||
// {
|
||||
// dictLabel: '异常趋势图'
|
||||
// }
|
||||
topItems: [{
|
||||
dictLabel: '监测站告警'
|
||||
},
|
||||
{
|
||||
dictLabel: '异常趋势图'
|
||||
}
|
||||
],
|
||||
value: 0,
|
||||
rangeList: [],
|
||||
|
|
@ -939,8 +938,8 @@
|
|||
.zwsj {
|
||||
height: calc(100vh - 100rpx);
|
||||
display: flex;
|
||||
// align-items: center;
|
||||
// justify-content: center;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.inzwsj {
|
||||
|
|
@ -948,8 +947,8 @@
|
|||
}
|
||||
|
||||
.zwsjimg {
|
||||
width: 100%;
|
||||
height: 240rpx;
|
||||
width: 200rpx;
|
||||
height: 200rpx;
|
||||
}
|
||||
|
||||
.zwsjtext {
|
||||
|
|
|
|||
|
|
@ -66,6 +66,7 @@
|
|||
var navigationHeight = 44 * pxToRpxScale
|
||||
this.height = res.windowHeight * pxToRpxScale//将px 转换rpx
|
||||
this.contentheight = this.height - ktxStatusHeight - navigationHeight - 150
|
||||
console.log(this.contentheight,123132)
|
||||
}
|
||||
});
|
||||
},
|
||||
|
|
@ -104,6 +105,7 @@
|
|||
});
|
||||
},
|
||||
radioChange(value){
|
||||
console.log(value)
|
||||
this.constant.sex = value.detail.value
|
||||
},
|
||||
submit() {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<view class="container">
|
||||
<uni-nav-bar :fixed="true" left-icon="left" background-color="#0F6EFF" @clickLeft="back()" status-bar :title="item.deployDes"/>
|
||||
<uni-nav-bar :fixed="true" left-icon="left" background-color="#0F6EFF" @clickLeft="back()" status-bar :title="item.stationName"/>
|
||||
<view class="liebiaos">
|
||||
<view class="list_item">
|
||||
<view class="list_item_top">
|
||||
|
|
@ -128,6 +128,7 @@
|
|||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
console.log(JSON.parse(decodeURIComponent(options.item)))
|
||||
this.item = JSON.parse(decodeURIComponent(options.item));
|
||||
},
|
||||
onShow() {
|
||||
|
|
|
|||
|
|
@ -85,6 +85,7 @@
|
|||
var ktxStatusHeight = res.statusBarHeight * pxToRpxScale
|
||||
var navigationHeight = 44 * pxToRpxScale
|
||||
this.height = res.windowHeight * pxToRpxScale//将px 转换rpx
|
||||
console.log(this.height,ktxStatusHeight,navigationHeight)
|
||||
this.scorllheight = this.height
|
||||
}
|
||||
});
|
||||
|
|
@ -101,22 +102,8 @@
|
|||
this.$http.get('/applet/survStationInfo/deviceList'),
|
||||
this.$http.get('/applet/survStationInfo/fdeviceList')
|
||||
]).then(([res1, res2]) => {
|
||||
const data1 = res1?.data?.data || [];
|
||||
|
||||
// 安全获取第二个接口的数据
|
||||
let data2 = [];
|
||||
if (res2?.data?.data && Array.isArray(res2.data.data) && res2.data.data.length > 0) {
|
||||
data2 = res2.data.data[0] || [];
|
||||
}
|
||||
|
||||
// data2 有数据才合并
|
||||
this.list = data2.length > 0 ? data1.concat(data2) : data1;
|
||||
|
||||
// 可选:打印日志方便调试
|
||||
if (data2.length === 0) {
|
||||
console.log('第二个接口无数据,跳过合并');
|
||||
}
|
||||
|
||||
// 合并两个数组
|
||||
this.list = res1.data.data.concat(res2.data.data);
|
||||
uni.hideLoading();
|
||||
}).catch(error => {
|
||||
console.error('请求失败:', error);
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
<image v-if="it[0].stationType == 'livestock'" src="../../static/zhandian_icon_xuqin.png" mode=""></image>
|
||||
<view class="item_right">
|
||||
<view class="right_top">
|
||||
{{it[0].stationName?it[0].stationName:'无设备信息'}}
|
||||
{{it[0].stationName}}
|
||||
</view>
|
||||
<view class="right_bot">
|
||||
<image src="../../static/shebei_icon_shebei.png" mode=""></image>
|
||||
|
|
@ -84,6 +84,7 @@
|
|||
var ktxStatusHeight = res.statusBarHeight * pxToRpxScale
|
||||
var navigationHeight = 44 * pxToRpxScale
|
||||
this.height = res.windowHeight * pxToRpxScale//将px 转换rpx
|
||||
console.log(this.height,ktxStatusHeight,navigationHeight)
|
||||
this.scorllheight = this.height
|
||||
}
|
||||
});
|
||||
|
|
@ -100,6 +101,7 @@
|
|||
})
|
||||
},
|
||||
todetail(item,index){
|
||||
console.log(item,12)
|
||||
uni.navigateTo({
|
||||
url:'/packDetail/pages/vidio/detail?item=' + encodeURIComponent(JSON.stringify(item))
|
||||
})
|
||||
|
|
|
|||
Binary file not shown.
|
Before Width: | Height: | Size: 67 KiB After Width: | Height: | Size: 58 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 58 KiB |
|
|
@ -23,7 +23,7 @@
|
|||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
<text class="botmTetx">Copyright <text style="font-size: 30rpx;padding:0rpx 7rpx;"> © </text> 稷山县农业农村局</text>
|
||||
<text class="botmTetx">Copyright <text style="font-size: 30rpx;padding:0rpx 7rpx;"> © </text> 汾西县农业农村局</text>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
|
@ -112,6 +112,6 @@
|
|||
left: 50%;
|
||||
transform: translate(-50%);
|
||||
color: #999;
|
||||
width: 60%;
|
||||
width: 52%;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bot_box" :class="{'single-item': item.depUrlArr && item.depUrlArr.length === 1}">
|
||||
<view class="bot_box">
|
||||
<view class="bot_left" v-for="(it,i) in item.depUrlArr" :key="i" @click="todetail(it,i,item)">
|
||||
<view class="botleft_bot">
|
||||
<view class="">
|
||||
|
|
@ -71,6 +71,7 @@
|
|||
var ktxStatusHeight = res.statusBarHeight * pxToRpxScale
|
||||
var navigationHeight = 44 * pxToRpxScale
|
||||
this.height = res.windowHeight * pxToRpxScale //将px 转换rpx
|
||||
console.log(this.height, ktxStatusHeight, navigationHeight)
|
||||
this.scorllheight = this.height
|
||||
}
|
||||
});
|
||||
|
|
@ -84,6 +85,7 @@
|
|||
var ktxStatusHeight = res.statusBarHeight * pxToRpxScale
|
||||
var navigationHeight = 44 * pxToRpxScale
|
||||
this.height = res.windowHeight * pxToRpxScale //将px 转换rpx
|
||||
console.log(this.height, ktxStatusHeight, navigationHeight)
|
||||
this.scorllheight = this.height
|
||||
}
|
||||
});
|
||||
|
|
@ -110,18 +112,24 @@
|
|||
this.List = this.List.concat(data)
|
||||
if (data.length != 0) {
|
||||
this.allNum = Number(data.length) / Number(this.pageSize) + '';
|
||||
console.log(this.allNum, '总页数')
|
||||
if (this.allNum.indexOf('.') == -1) {
|
||||
this.allNum = this.allNum;
|
||||
console.log(this.allNum, 'if')
|
||||
} else {
|
||||
this.allNum = parseInt(Number(this.allNum) + 1);
|
||||
console.log(this.allNum, 'else')
|
||||
}
|
||||
console.log(this.pageNo, this.allNum, '156156')
|
||||
if (this.pageNo == this.allNum) {
|
||||
this.isLastpage = true;
|
||||
this.loadStatus = 'nomore'
|
||||
console.log(this.isLastpage, 'true', 'nomore')
|
||||
} else {
|
||||
this.isLastpage = false;
|
||||
// this.isLoadMore=true
|
||||
this.loadStatus = 'more'
|
||||
console.log(this.isLastpage, 'false')
|
||||
}
|
||||
} else {
|
||||
this.isLastpage = true;
|
||||
|
|
@ -133,6 +141,7 @@
|
|||
})
|
||||
},
|
||||
lower() {
|
||||
console.log("最后一页了,取消下拉功能");
|
||||
// 最后一页了,取消下拉功能
|
||||
if (this.isLastpage) {
|
||||
return
|
||||
|
|
@ -142,6 +151,7 @@
|
|||
this.intervalId = setInterval(() => {
|
||||
num = num + 1;
|
||||
}, 1000)
|
||||
console.log(this.intervalId, num)
|
||||
this.pageNo = this.pageNo + 1;
|
||||
let params = {}
|
||||
params.pageNo = this.pageNo
|
||||
|
|
@ -156,10 +166,12 @@
|
|||
if (this.pageNo == this.allNum) {
|
||||
this.isLastpage = true;
|
||||
this.loadStatus = 'nomore'
|
||||
console.log(this.isLastpage, 'true')
|
||||
} else {
|
||||
this.isLastpage = false;
|
||||
// this.isLoadMore=true
|
||||
this.loadStatus = 'more'
|
||||
console.log(this.isLastpage, 'false')
|
||||
}
|
||||
} else {
|
||||
this.isLastpage = true;
|
||||
|
|
@ -222,7 +234,6 @@
|
|||
font-size: 28rpx;
|
||||
padding: 20rpx 0;
|
||||
color: #8b95ea;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
|
||||
.top_box {
|
||||
|
|
@ -242,21 +253,6 @@
|
|||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
/* 当只有一个子元素时的样式优化 */
|
||||
.bot_box.single-item {
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.bot_box.single-item .bot_left {
|
||||
width: 100%;
|
||||
height: 370rpx;
|
||||
}
|
||||
|
||||
.bot_box.single-item .bot_left .botleft_top {
|
||||
width: 100%;
|
||||
height: 300rpx;
|
||||
}
|
||||
|
||||
.bot_left {
|
||||
width: 48%;
|
||||
border: 4rpx solid #f0f0f0;
|
||||
|
|
|
|||
|
|
@ -2326,6 +2326,7 @@
|
|||
uni.sendSocketMessage({
|
||||
data: JSON.stringify(param)
|
||||
});
|
||||
console.log('websocket发送给服务端的消息:', param);
|
||||
socketTask.close({
|
||||
code: 1000,
|
||||
success: (res) => {
|
||||
|
|
@ -2336,6 +2337,7 @@
|
|||
|
||||
// push
|
||||
pusherStateChange: function (e) {
|
||||
console.log('>>> live-pusher onPushStateChange:', e.detail.code);
|
||||
const code = e.detail.code;
|
||||
let content = '';
|
||||
switch (code) {
|
||||
|
|
@ -2438,11 +2440,13 @@
|
|||
},
|
||||
|
||||
stopPush() {
|
||||
console.log('停止推流');
|
||||
this.pushVideoContext.stop();
|
||||
this.pushVideo=false
|
||||
},
|
||||
|
||||
startPush() {
|
||||
console.log('开始推流,推流地址为:', this.pushUrl);
|
||||
uni.showToast({
|
||||
title: '开始推流,推流地址为:'
|
||||
});
|
||||
|
|
@ -2454,6 +2458,7 @@
|
|||
},
|
||||
|
||||
error(e) {
|
||||
console.log('live-player', e);
|
||||
console.error('live-player error:', e.detail.errMsg);
|
||||
if (e.detail.errCode == 10001) {
|
||||
uni.showToast({
|
||||
|
|
|
|||
|
|
@ -34,13 +34,19 @@
|
|||
var player = null;
|
||||
export default {
|
||||
created() {
|
||||
console.log(1111111111111111111111)
|
||||
// this.initPlayer()
|
||||
},
|
||||
mounted() {
|
||||
console.log('mounted...');
|
||||
|
||||
if (typeof window.EZUIKit !== 'undefined') {
|
||||
|
||||
console.log('defined EZUIKit...');
|
||||
this.initPlayer();
|
||||
} else {
|
||||
|
||||
console.log('undefined EZUIKit...');
|
||||
// 动态引入较大类库避免影响页面展示
|
||||
const script = document.createElement('script')
|
||||
// view 层的页面运行在 www 根目录,其相对路径相对于 www 计算
|
||||
|
|
@ -56,6 +62,7 @@
|
|||
windowWidth,
|
||||
windowHeight
|
||||
} = uni.getSystemInfoSync();
|
||||
console.log('initPlayer...');
|
||||
return
|
||||
fetch('https://zy.sxzooh.com/zh-api/applet/ysyun/getYsToken')
|
||||
// .then(response => response.json())
|
||||
|
|
|
|||
|
|
@ -226,8 +226,10 @@ export default {
|
|||
},
|
||||
onLoad: function (options) {
|
||||
livePlayerContext = uni.createLivePlayerContext('livePlayer');
|
||||
console.log('获取参数', options);
|
||||
// 获取当前页面栈
|
||||
const currentPage = getCurrentPages();
|
||||
console.log(currentPage.nv_length);
|
||||
|
||||
// 获取url携带的参数
|
||||
const { accessToken, deviceSerial, channelNo, date, switch1Checked } = options;
|
||||
|
|
@ -236,6 +238,7 @@ export default {
|
|||
this.deviceSerial=deviceSerial,
|
||||
this.channelNo=channelNo,
|
||||
this.page=currentPage.nv_length
|
||||
console.log(date);
|
||||
// 通过分享今日指定日期
|
||||
if (date) {
|
||||
this.date=date,
|
||||
|
|
@ -258,8 +261,10 @@ export default {
|
|||
*/
|
||||
onShareAppMessage: function (res) {
|
||||
const { accessToken, deviceSerial, channelNo, date, switch1Checked } = this;
|
||||
console.log(switch1Checked);
|
||||
if (res.from === 'button') {
|
||||
// 来自页面内转发按钮
|
||||
console.log(res.target);
|
||||
this.panelStatus=0
|
||||
}
|
||||
return {
|
||||
|
|
@ -293,6 +298,7 @@ export default {
|
|||
|
||||
// 获取存储类型
|
||||
switch1Change: function (e) {
|
||||
console.log('当前存储类型', e.detail);
|
||||
if (e.detail.value == false) {
|
||||
this.switchText='云存储',
|
||||
this.switch1Checked=false,
|
||||
|
|
@ -321,8 +327,10 @@ export default {
|
|||
// 获取当前操作系统类型
|
||||
uni.getSystemInfo({
|
||||
success(res) {
|
||||
console.log('当前操作系统:', res.system);
|
||||
const sys = res.system;
|
||||
type = sys.split(' ');
|
||||
console.log(type);
|
||||
if (type[0] == 'iOS') {
|
||||
that.toDay=date.replace(/\-/g, '/')
|
||||
} else {
|
||||
|
|
@ -343,6 +351,7 @@ export default {
|
|||
// 获取时间轴
|
||||
getTimeLine: function () {
|
||||
const { recType, date, accessToken, deviceSerial, channelNo, timelineTimer, currentTimer } = this;
|
||||
console.log('获取到的accessToken, accessToken', accessToken);
|
||||
var that = this;
|
||||
let currentDate = null;
|
||||
let timestampCurrent = null;
|
||||
|
|
@ -372,6 +381,7 @@ export default {
|
|||
},
|
||||
|
||||
success: (res) => {
|
||||
console.log('获取播放时间片段', res.data);
|
||||
if (res.data.code == 200) {
|
||||
if (res.data.data != null) {
|
||||
var result = res.data.data;
|
||||
|
|
@ -398,6 +408,7 @@ export default {
|
|||
et: et
|
||||
});
|
||||
}
|
||||
console.log('availArr:', availArr);
|
||||
this.dateLine=availArr
|
||||
} else {
|
||||
this.dialogNodataTitle='暂无数据',
|
||||
|
|
@ -436,6 +447,7 @@ export default {
|
|||
let stTime = e.detail.stTime;
|
||||
let etTime = e.detail.etTime;
|
||||
const { type, date, accessToken, deviceSerial, channelNo, videoSrc } = this;
|
||||
console.log('当前播放时间', stTime, etTime);
|
||||
let startTime = null;
|
||||
let stopTime = null;
|
||||
startTime = date + ' ' + stTime;
|
||||
|
|
@ -469,6 +481,7 @@ export default {
|
|||
},
|
||||
|
||||
success: (res) => {
|
||||
console.log('获取到的播放地址:', res.data);
|
||||
if (res.data.code == '200' && res.data.data && res.data.data.url) {
|
||||
const playUrl = res.data.data.url;
|
||||
this.videoSrc=playUrl
|
||||
|
|
@ -476,6 +489,7 @@ export default {
|
|||
this.handleStop();
|
||||
// 开始播放
|
||||
this.handlePlay();
|
||||
console.log('当前播放地址:', this.videoSrc);
|
||||
} else if (res.data.code == '20007') {
|
||||
debugger;
|
||||
this.dialogTitle='获取播放地址失败',
|
||||
|
|
@ -505,6 +519,7 @@ export default {
|
|||
this.dialogTitle='获取播放地址失败',
|
||||
this.dialogContent=res.data.msg,
|
||||
this.dialogShow=true
|
||||
console.log('获取rtmp播放地址失败');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
@ -534,6 +549,7 @@ export default {
|
|||
_this.fullScreen=true
|
||||
}
|
||||
});
|
||||
console.log('开启全屏');
|
||||
},
|
||||
|
||||
unfullScreen() {
|
||||
|
|
@ -543,6 +559,7 @@ export default {
|
|||
_this.fullScreen=false
|
||||
}
|
||||
});
|
||||
console.log('开启全屏');
|
||||
},
|
||||
|
||||
ToggleObjectFit() {
|
||||
|
|
@ -559,6 +576,7 @@ export default {
|
|||
},
|
||||
|
||||
handlePlay(callback) {
|
||||
console.log('handelPlay', this.playVideo, this.isHD);
|
||||
this.checkNetWork();
|
||||
livePlayerContext.play({
|
||||
success: () => {
|
||||
|
|
@ -576,6 +594,7 @@ export default {
|
|||
title: '网络异常',
|
||||
icon: 'none'
|
||||
});
|
||||
console.log('开始播放失败');
|
||||
this.videoNetWorkError=true
|
||||
this.showVideoControls=false
|
||||
this.videoLoadingStatus=100
|
||||
|
|
@ -584,6 +603,7 @@ export default {
|
|||
},
|
||||
|
||||
handleStop(callback) {
|
||||
console.log('stop');
|
||||
const { list } = this;
|
||||
livePlayerContext.stop({
|
||||
success: () => {
|
||||
|
|
@ -602,6 +622,7 @@ export default {
|
|||
},
|
||||
|
||||
autoHideControl() {
|
||||
console.log('showHdSelect', this.showHDSelect);
|
||||
const _this = this;
|
||||
clearTimeout(this.autoHideTimer);
|
||||
this.autoHideTimer = setTimeout(() => {
|
||||
|
|
@ -619,6 +640,7 @@ export default {
|
|||
|
||||
handleHD(e) {
|
||||
var showHDSelect = this.showHDSelect;
|
||||
console.log('handleHD', showHDSelect);
|
||||
this.showHDSelect=!showHDSelect
|
||||
},
|
||||
|
||||
|
|
@ -636,6 +658,7 @@ export default {
|
|||
},
|
||||
|
||||
statechange(e) {
|
||||
console.log('live-player code:', e.detail.code, e.detail);
|
||||
const { code } = e.detail;
|
||||
let { videoLoadingStatus, list, panelStatus } = this;
|
||||
switch (code) {
|
||||
|
|
@ -703,6 +726,7 @@ export default {
|
|||
},
|
||||
|
||||
error(e) {
|
||||
console.log('live-player', e);
|
||||
console.error('live-player error:', e.detail.errMsg);
|
||||
if (e.detail.errCode == 10001) {
|
||||
uni.showToast({
|
||||
|
|
@ -714,6 +738,7 @@ export default {
|
|||
},
|
||||
|
||||
onVideoTap(e) {
|
||||
console.log('点击视频');
|
||||
const { deviceOffline, showVideoControls, panelStatus, videoNetWorkError } = this;
|
||||
if (deviceOffline || panelStatus === 4 || videoNetWorkError) {
|
||||
return false;
|
||||
|
|
@ -730,8 +755,10 @@ export default {
|
|||
screenShoot(e) {
|
||||
const { playVideo, videoLoadingStatus } = this;
|
||||
if (!playVideo || videoLoadingStatus != 100) {
|
||||
console.log('非播放状态下点击截图');
|
||||
return false;
|
||||
}
|
||||
console.log('开始截图');
|
||||
// livePlayerContext.snapshot('raw');
|
||||
let that = this;
|
||||
uni.getSetting({
|
||||
|
|
@ -759,10 +786,13 @@ export default {
|
|||
livePlayerContext
|
||||
.snapshot('raw')
|
||||
.then((data) => {
|
||||
console.log('data', data);
|
||||
if (data) {
|
||||
console.log(data);
|
||||
uni.saveImageToPhotosAlbum({
|
||||
filePath: data.tempImagePath,
|
||||
success(res) {
|
||||
console.log('保存成功', res);
|
||||
uni.showToast({
|
||||
title: '截图已保存至手机相册',
|
||||
icon: 'none'
|
||||
|
|
@ -820,6 +850,7 @@ export default {
|
|||
|
||||
// 时间选择器
|
||||
bindDateChange: function (e) {
|
||||
console.log('picker发送选择改变,携带值为', e.detail.value);
|
||||
this.date=e.detail.value
|
||||
this.getTimeLine();
|
||||
},
|
||||
|
|
|
|||
|
|
@ -167,6 +167,7 @@
|
|||
var ktxStatusHeight = res.statusBarHeight * pxToRpxScale
|
||||
var navigationHeight = 44 * pxToRpxScale
|
||||
this.height = res.windowHeight * pxToRpxScale//将px 转换rpx
|
||||
console.log(this.height,ktxStatusHeight,navigationHeight)
|
||||
this.scorllheight = this.height - 120
|
||||
}
|
||||
});
|
||||
|
|
@ -198,17 +199,21 @@
|
|||
this.$set(item, 'checked', true)
|
||||
})
|
||||
this.checkList = this.alllist
|
||||
console.log(this.checkList,156)
|
||||
}
|
||||
|
||||
},
|
||||
checkSelectItem(e, item) {
|
||||
console.log(item,156)
|
||||
// 如果是取消选中,就把checked置为false,如果是选中,就给添加一个checked=true
|
||||
if (item.checked == true) {
|
||||
this.$set(item, 'checked', false)
|
||||
this.checkList = this.checkList.filter(items => (items.value !== item.value))
|
||||
console.log(this.checkList,'true')
|
||||
} else {
|
||||
this.$set(item, 'checked', true)
|
||||
this.checkList.push(item)
|
||||
console.log(this.checkList,'false')
|
||||
}
|
||||
// 过滤出数组中checked为true的项目,如果和原alllist长度相等,就全选显示
|
||||
let newArr = this.alllist.filter(item => (item.checked == true))
|
||||
|
|
@ -217,6 +222,7 @@
|
|||
} else {
|
||||
this.checkTrue = false;
|
||||
}
|
||||
console.log(this.checkList,41561456)
|
||||
},
|
||||
submit(){
|
||||
uni.navigateBack({
|
||||
|
|
|
|||
14
pages.json
14
pages.json
|
|
@ -4,7 +4,7 @@
|
|||
{
|
||||
"path": "pages/index/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "稷山县小流域面源污染监测",
|
||||
"navigationBarTitleText": "汾西小流域面源污染监测",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
|
|
@ -156,7 +156,7 @@
|
|||
{
|
||||
"path": "pages/operations/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "运维记录",
|
||||
"navigationBarTitleText": "站点运维",
|
||||
"navigationStyle": "default",
|
||||
"navigationBarBackgroundColor":"#0F6EFF"
|
||||
}
|
||||
|
|
@ -164,7 +164,7 @@
|
|||
{
|
||||
"path": "pages/operations/detail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "运维记录详情",
|
||||
"navigationBarTitleText": "站点运维详情",
|
||||
"navigationStyle": "default",
|
||||
"navigationBarBackgroundColor":"#0F6EFF"
|
||||
}
|
||||
|
|
@ -172,7 +172,7 @@
|
|||
{
|
||||
"path": "pages/operations/add",
|
||||
"style": {
|
||||
"navigationBarTitleText": "新增运维记录",
|
||||
"navigationBarTitleText": "新增站点运维",
|
||||
"navigationStyle": "default",
|
||||
"navigationBarBackgroundColor":"#0F6EFF"
|
||||
}
|
||||
|
|
@ -180,7 +180,7 @@
|
|||
{
|
||||
"path": "pages/operations/edit",
|
||||
"style": {
|
||||
"navigationBarTitleText": "编辑运维记录",
|
||||
"navigationBarTitleText": "编辑站点运维",
|
||||
"navigationStyle": "default",
|
||||
"navigationBarBackgroundColor":"#0F6EFF"
|
||||
}
|
||||
|
|
@ -196,7 +196,7 @@
|
|||
{
|
||||
"path": "pages/analysis/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "监测数据统计分析",
|
||||
"navigationBarTitleText": "统计分析",
|
||||
"navigationStyle": "default",
|
||||
"navigationBarBackgroundColor":"#0F6EFF"
|
||||
}
|
||||
|
|
@ -212,7 +212,7 @@
|
|||
{
|
||||
"path": "pages/sjdyj/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "智能预警",
|
||||
"navigationBarTitleText": "预警信息",
|
||||
"navigationStyle": "default",
|
||||
"navigationBarBackgroundColor":"#0F6EFF"
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,449 +0,0 @@
|
|||
const indexData = {
|
||||
bigswiperList : [{
|
||||
"id": "1692474977070829569",
|
||||
"infoId": "1692474921957675010",
|
||||
"detailCode": "图1",
|
||||
"detailValue": "图",
|
||||
"detailValue2": "1",
|
||||
"propsValue1": null,
|
||||
"propsValue2": null,
|
||||
"detailPics": "temp/20230818174636_1692352452041.jpg",
|
||||
"detailExtPics": null,
|
||||
"detailNote": null,
|
||||
"isShow": "1",
|
||||
"sortNo": 1,
|
||||
"tenantId": null,
|
||||
"reVision": 0,
|
||||
"createdBy": "hjadmin",
|
||||
"createTime": "2023-08-18 17:54:14",
|
||||
"updatedBy": null,
|
||||
"isDel": 0,
|
||||
"updatedTime": null
|
||||
}, {
|
||||
"id": "1692475023417888770",
|
||||
"infoId": "1692474921957675010",
|
||||
"detailCode": "图2",
|
||||
"detailValue": "图",
|
||||
"detailValue2": "2",
|
||||
"propsValue1": null,
|
||||
"propsValue2": null,
|
||||
"detailPics": "temp/20230818174638_1692352462933.png",
|
||||
"detailExtPics": null,
|
||||
"detailNote": null,
|
||||
"isShow": "1",
|
||||
"sortNo": 1,
|
||||
"tenantId": null,
|
||||
"reVision": 0,
|
||||
"createdBy": "hjadmin",
|
||||
"createTime": "2023-08-18 17:54:25",
|
||||
"updatedBy": null,
|
||||
"isDel": 0,
|
||||
"updatedTime": null
|
||||
}],
|
||||
wrwlist : [{
|
||||
"unit": "℃",
|
||||
"code": "dataAirTemp",
|
||||
"color": "#22BB8A",
|
||||
"icon": "sys/icon/shebei_icon_qixiang.png",
|
||||
"description": "大气温度"
|
||||
}, {
|
||||
"unit": "%RH",
|
||||
"code": "dataAirWet",
|
||||
"color": "#EE701C",
|
||||
"icon": "sys/icon/zhandian_icon_kongqishidu.png",
|
||||
"description": "大气湿度"
|
||||
}, {
|
||||
"unit": "hPa",
|
||||
"code": "dataAirPress",
|
||||
"color": "#52AC2A",
|
||||
"icon": "sys/icon/zhandian_icon_daqiyali.png",
|
||||
"description": "大气压力"
|
||||
}, {
|
||||
"unit": "mm",
|
||||
"code": "dataRainFall",
|
||||
"color": "#2BADB9",
|
||||
"icon": "sys/icon/zhandian_icon_jiangyuliang.png",
|
||||
"description": "雨量"
|
||||
}, {
|
||||
"unit": "mm",
|
||||
"code": "dataRainTotal",
|
||||
"color": "#102B6A",
|
||||
"icon": "sys/icon/zhandian_icon_jiangyuliang.png",
|
||||
"description": "雨量累计"
|
||||
}, {
|
||||
"unit": "m/s",
|
||||
"code": "dataWindSpeed",
|
||||
"color": "#7CD6CF",
|
||||
"icon": "sys/icon/zhandian_icon_fengsu.png",
|
||||
"description": "风速"
|
||||
}, {
|
||||
"unit": "°",
|
||||
"code": "dataWindDirection",
|
||||
"color": "#26A3CC",
|
||||
"icon": "sys/icon/zhandian_icon_fengxiang.png",
|
||||
"description": "风向"
|
||||
}, {
|
||||
"unit": "MJ/m2",
|
||||
"code": "dataSunTotal",
|
||||
"color": "#6C48C7",
|
||||
"icon": "sys/icon/zhandian_icon_taiyangquanfushe.png",
|
||||
"description": "辐射累计"
|
||||
}, {
|
||||
"unit": "W/m2",
|
||||
"code": "dataSunFallout",
|
||||
"color": "#22BB8A",
|
||||
"icon": "sys/icon/zhandian_icon_taiyangquanfushe.png",
|
||||
"description": "太阳全辐射"
|
||||
}, {
|
||||
"unit": "%",
|
||||
"code": "dataSoilWet",
|
||||
"color": "#6495ED",
|
||||
"icon": "sys/icon/zhandian_icon_turangshidu.png",
|
||||
"description": "20CM土壤湿度"
|
||||
}, {
|
||||
"unit": "%",
|
||||
"code": "dataSoilWet2",
|
||||
"color": "#4169E1",
|
||||
"icon": "sys/icon/zhandian_icon_turangshidu.png",
|
||||
"description": "40CM土壤湿度"
|
||||
}, {
|
||||
"unit": "%",
|
||||
"code": "dataSoilWet3",
|
||||
"color": "#0000CD",
|
||||
"icon": "sys/icon/zhandian_icon_turangshidu.png",
|
||||
"description": "60CM土壤湿度"
|
||||
}, {
|
||||
"unit": "℃",
|
||||
"code": "dataSoilTemp",
|
||||
"color": "#C71585",
|
||||
"icon": "sys/icon/zhandian_icon_turangwendu.png",
|
||||
"description": "20CM土壤温度"
|
||||
}, {
|
||||
"unit": "℃",
|
||||
"code": "dataSoilTemp2",
|
||||
"color": "#FF1493",
|
||||
"icon": "sys/icon/zhandian_icon_turangwendu.png",
|
||||
"description": "40CM土壤温度"
|
||||
}, {
|
||||
"unit": "℃",
|
||||
"code": "dataSoilTemp3",
|
||||
"color": "#FF69B4",
|
||||
"icon": "sys/icon/zhandian_icon_turangwendu.png",
|
||||
"description": "60CM土壤温度"
|
||||
}, {
|
||||
"unit": "uS/cm",
|
||||
"code": "dataSoilDdl",
|
||||
"color": "#92D0D0",
|
||||
"icon": "sys/icon/zhandian_icon_ec.png",
|
||||
"description": "20CM电导率"
|
||||
}, {
|
||||
"unit": "uS/cm",
|
||||
"code": "dataSoilDdl2",
|
||||
"color": "#73A2A2",
|
||||
"icon": "sys/icon/zhandian_icon_ec.png",
|
||||
"description": "40CM电导率"
|
||||
}, {
|
||||
"unit": "uS/cm",
|
||||
"code": "dataSoilDdl3",
|
||||
"color": "#567777",
|
||||
"icon": "sys/icon/zhandian_icon_ec.png",
|
||||
"description": "60CM电导率"
|
||||
}, {
|
||||
"unit": "",
|
||||
"code": "dataSoilSalt",
|
||||
"color": "#4F5555",
|
||||
"icon": "sys/icon/zhandian_icon_ec.png",
|
||||
"description": "土壤盐分"
|
||||
}, {
|
||||
"unit": "%",
|
||||
"code": "dataSoilWetMark",
|
||||
"color": "#6495ED",
|
||||
"icon": "sys/icon/zhandian_icon_turangshidu.png",
|
||||
"description": "土壤湿度"
|
||||
}, {
|
||||
"unit": "℃",
|
||||
"code": "dataSoilMark",
|
||||
"color": "#C71585",
|
||||
"icon": "sys/icon/zhandian_icon_turangwendu.png",
|
||||
"description": "土壤温度"
|
||||
}, {
|
||||
"unit": "uS/cm",
|
||||
"code": "dataSoilDdlMark",
|
||||
"color": "#92D0D0",
|
||||
"icon": "sys/icon/zhandian_icon_ec.png",
|
||||
"description": "电导率"
|
||||
}, {
|
||||
"unit": "mg/L",
|
||||
"code": "dataWaterTp",
|
||||
"color": "#C8CC00",
|
||||
"icon": "sys/icon/shebei_icon_tp.png",
|
||||
"description": "总磷"
|
||||
}, {
|
||||
"unit": "mg/L",
|
||||
"code": "dataWaterTn",
|
||||
"color": "#009DB2",
|
||||
"icon": "sys/icon/shebei_icon_tn.png",
|
||||
"description": "总氮"
|
||||
}, {
|
||||
"unit": "mg/L",
|
||||
"code": "dataWaterNo",
|
||||
"color": "#72BAA7",
|
||||
"icon": "sys/icon/shebei_icon_no3n.png",
|
||||
"description": "硝态氮"
|
||||
}, {
|
||||
"unit": "mg/L",
|
||||
"code": "dataWaterNh",
|
||||
"color": "#225A1F",
|
||||
"icon": "sys/icon/shebei_icon_nh3n.png",
|
||||
"description": "氨氮"
|
||||
}, {
|
||||
"unit": "mg/L",
|
||||
"code": "dataWaterCod",
|
||||
"color": "#FDB933",
|
||||
"icon": "sys/icon/shebei_icon_cod.png",
|
||||
"description": "化学需氧量"
|
||||
}, {
|
||||
"unit": "mg/m³",
|
||||
"code": "dataOu",
|
||||
"color": "#f47a75",
|
||||
"icon": "sys/icon/zhandian_icon_ou.png",
|
||||
"description": "臭气浓度"
|
||||
}, {
|
||||
"unit": "mg/m³",
|
||||
"code": "dataNh3",
|
||||
"color": "#d05c7c",
|
||||
"icon": "sys/icon/zhandian_icon_nh3.png",
|
||||
"description": "氨气"
|
||||
}, {
|
||||
"unit": "mg/m³",
|
||||
"code": "dataH2s",
|
||||
"color": "#d05c9f",
|
||||
"icon": "sys/icon/zhandian_icon_h2s.png",
|
||||
"description": "硫化氢"
|
||||
}, {
|
||||
"unit": "mg/m³",
|
||||
"code": "dataTvoc",
|
||||
"color": "#f06464",
|
||||
"icon": "sys/icon/zhandian_icon_tvoc.png",
|
||||
"description": "总挥发性有机物"
|
||||
}, {
|
||||
"unit": "台",
|
||||
"code": "default",
|
||||
"color": "#DEAB8A",
|
||||
"icon": "",
|
||||
"description": "默认"
|
||||
}],
|
||||
|
||||
list : [{
|
||||
"name": "总氮",
|
||||
"unit": "mg/L",
|
||||
"value": "2.0000",
|
||||
"color": "#009DB2",
|
||||
"trend": null,
|
||||
"survItem": null,
|
||||
"dataDateTime": "2025-05-23 19:33:23",
|
||||
"stationName": "小流域监测站1#站",
|
||||
"stationCode": "S_1",
|
||||
"stationType": null,
|
||||
"dataCounts": 1045510
|
||||
}, {
|
||||
"name": "总磷",
|
||||
"unit": "mg/L",
|
||||
"value": "1.0061",
|
||||
"color": "#C8CC00",
|
||||
"trend": null,
|
||||
"survItem": null,
|
||||
"dataDateTime": "2025-05-23 19:33:23",
|
||||
"stationName": "小流域监测站1#站",
|
||||
"stationCode": "S_1",
|
||||
"stationType": null,
|
||||
"dataCounts": 1045510
|
||||
}, {
|
||||
"name": "硝态氮",
|
||||
"unit": "mg/L",
|
||||
"value": "5.2110",
|
||||
"color": "#72BAA7",
|
||||
"trend": null,
|
||||
"survItem": null,
|
||||
"dataDateTime": "2025-05-23 19:33:23",
|
||||
"stationName": "小流域监测站1#站",
|
||||
"stationCode": "S_1",
|
||||
"stationType": null,
|
||||
"dataCounts": 1045510
|
||||
}, {
|
||||
"name": "总氮",
|
||||
"unit": "mg/L",
|
||||
"value": "2.1114",
|
||||
"color": "#009DB2",
|
||||
"trend": null,
|
||||
"survItem": null,
|
||||
"dataDateTime": "2025-05-23 19:33:50",
|
||||
"stationName": "小流域监测站1#站",
|
||||
"stationCode": "S_2",
|
||||
"stationType": null,
|
||||
"dataCounts": 1045510
|
||||
}, {
|
||||
"name": "总磷",
|
||||
"unit": "mg/L",
|
||||
"value": "0.9864",
|
||||
"color": "#C8CC00",
|
||||
"trend": null,
|
||||
"survItem": null,
|
||||
"dataDateTime": "2025-05-23 19:33:50",
|
||||
"stationName": "小流域监测站1#站",
|
||||
"stationCode": "S_2",
|
||||
"stationType": null,
|
||||
"dataCounts": 1045510
|
||||
}, {
|
||||
"name": "硝态氮",
|
||||
"unit": "mg/L",
|
||||
"value": "1.2373",
|
||||
"color": "#72BAA7",
|
||||
"trend": null,
|
||||
"survItem": null,
|
||||
"dataDateTime": "2025-05-23 19:33:50",
|
||||
"stationName": "小流域监测站1#站",
|
||||
"stationCode": "S_2",
|
||||
"stationType": null,
|
||||
"dataCounts": 1045510
|
||||
}, {
|
||||
"name": "总氮",
|
||||
"unit": "mg/L",
|
||||
"value": "49.6451",
|
||||
"color": "#009DB2",
|
||||
"trend": null,
|
||||
"survItem": null,
|
||||
"dataDateTime": "2025-05-23 19:33:36",
|
||||
"stationName": "畜禽1号站",
|
||||
"stationCode": "S_3",
|
||||
"stationType": null,
|
||||
"dataCounts": 1045510
|
||||
}, {
|
||||
"name": "总磷",
|
||||
"unit": "mg/L",
|
||||
"value": "10.1785",
|
||||
"color": "#C8CC00",
|
||||
"trend": null,
|
||||
"survItem": null,
|
||||
"dataDateTime": "2025-05-23 19:33:36",
|
||||
"stationName": "畜禽1号站",
|
||||
"stationCode": "S_3",
|
||||
"stationType": null,
|
||||
"dataCounts": 1045510
|
||||
}, {
|
||||
"name": "氨氮",
|
||||
"unit": "mg/L",
|
||||
"value": "49.9502",
|
||||
"color": "#225A1F",
|
||||
"trend": null,
|
||||
"survItem": null,
|
||||
"dataDateTime": "2025-05-23 19:33:36",
|
||||
"stationName": "畜禽1号站",
|
||||
"stationCode": "S_3",
|
||||
"stationType": null,
|
||||
"dataCounts": 1045510
|
||||
}, {
|
||||
"name": "化学需氧量",
|
||||
"unit": "mg/L",
|
||||
"value": "501.5000",
|
||||
"color": "#FDB933",
|
||||
"trend": null,
|
||||
"survItem": null,
|
||||
"dataDateTime": "2025-05-23 19:33:36",
|
||||
"stationName": "畜禽1号站",
|
||||
"stationCode": "S_3",
|
||||
"stationType": null,
|
||||
"dataCounts": 1045510
|
||||
}, {
|
||||
"name": "总氮",
|
||||
"unit": "mg/L",
|
||||
"value": "50.6921",
|
||||
"color": "#009DB2",
|
||||
"trend": null,
|
||||
"survItem": null,
|
||||
"dataDateTime": "2025-05-23 19:00:00",
|
||||
"stationName": "畜禽2号站",
|
||||
"stationCode": "S_4",
|
||||
"stationType": null,
|
||||
"dataCounts": 1045510
|
||||
}, {
|
||||
"name": "总磷",
|
||||
"unit": "mg/L",
|
||||
"value": "0.2719",
|
||||
"color": "#C8CC00",
|
||||
"trend": null,
|
||||
"survItem": null,
|
||||
"dataDateTime": "2025-05-23 19:00:00",
|
||||
"stationName": "畜禽2号站",
|
||||
"stationCode": "S_4",
|
||||
"stationType": null,
|
||||
"dataCounts": 1045510
|
||||
}, {
|
||||
"name": "氨氮",
|
||||
"unit": "mg/L",
|
||||
"value": "48.9038",
|
||||
"color": "#225A1F",
|
||||
"trend": null,
|
||||
"survItem": null,
|
||||
"dataDateTime": "2025-05-23 19:00:00",
|
||||
"stationName": "畜禽2号站",
|
||||
"stationCode": "S_4",
|
||||
"stationType": null,
|
||||
"dataCounts": 1045510
|
||||
}, {
|
||||
"name": "化学需氧量",
|
||||
"unit": "mg/L",
|
||||
"value": "498.3486",
|
||||
"color": "#FDB933",
|
||||
"trend": null,
|
||||
"survItem": null,
|
||||
"dataDateTime": "2025-05-23 19:00:00",
|
||||
"stationName": "畜禽2号站",
|
||||
"stationCode": "S_4",
|
||||
"stationType": null,
|
||||
"dataCounts": 1045510
|
||||
}],
|
||||
menu: [
|
||||
{
|
||||
name: '监测站点',
|
||||
img: require('../../static/home_icon_jiance.png'),
|
||||
path: '/packDetail/pages/Site/index'
|
||||
}, {
|
||||
name: '智能预警',
|
||||
img: require('../../static/scd.png'),
|
||||
path: '/packDetail/pages/sjdyj/index'
|
||||
},
|
||||
{
|
||||
name: '视频监控',
|
||||
img: require('../../static/home_icon_shipin.png'),
|
||||
path: '/packDetail1/pages/device/index'
|
||||
},
|
||||
{
|
||||
name: '运维记录',
|
||||
img: require('../../static/home_icon_yunwei.png'),
|
||||
path: '/packDetail/pages/operations/index'
|
||||
},
|
||||
{
|
||||
name: '农业废弃物',
|
||||
img: require('../../static/home_icon_feiqiwu.png'),
|
||||
path: '/packDetail/pages/waste/index'
|
||||
},
|
||||
{
|
||||
name: '粪污台账',
|
||||
img: require('../../static/home_icon_fenwu.png'),
|
||||
path: '/packDetail/pages/fwtz/index'
|
||||
},
|
||||
{
|
||||
name: '设备管理',
|
||||
img: require('../../static/home_icon_shebei.png'),
|
||||
path: '/packDetail/pages/vidio/index'
|
||||
},
|
||||
{
|
||||
name: '统计分析',
|
||||
img: require('../../static/home_icon_shuju.png'),
|
||||
path: '/packDetail/pages/analysis/index'
|
||||
},
|
||||
]
|
||||
};
|
||||
|
||||
export default indexData;
|
||||
|
|
@ -0,0 +1,108 @@
|
|||
import { getApi } from "@/utils/common.js"
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
latitude: 29.519418, // 纬度
|
||||
longitude: 106.687094, // 经度
|
||||
allMarkers: [] // 标记点
|
||||
}
|
||||
},
|
||||
onReady() {
|
||||
// 1.页面准备好后,获取到map组件的执行上下文。注意:这里是取的map的id属性
|
||||
this.mapContext = uni.createMapContext("alarm_map", this);
|
||||
// 2.请求数据
|
||||
this.getallStations()
|
||||
},
|
||||
methods: {
|
||||
getallStations() {
|
||||
uni.showLoading()
|
||||
let obj = {
|
||||
id: id,
|
||||
stationQuery: query
|
||||
}
|
||||
getApi(obj).then(res => {
|
||||
uni.hideLoading();
|
||||
if (res.code == 0) {
|
||||
if (!Array.isArray(res.data) || res.data.length <= 0) return
|
||||
// 拿到请求数据后,把数据传给点聚合功能;
|
||||
this.setMarkersAndCluster(res.data) // 3、调用聚合功能
|
||||
}
|
||||
})
|
||||
},
|
||||
// 聚合功能
|
||||
setMarkersAndCluster(markerList) {
|
||||
// 1.组装数据之后,并赋值给地图上的marker
|
||||
this.allMarkers = Array.from(markerList).map((item, i) => {
|
||||
return {
|
||||
...item,
|
||||
width: 41,
|
||||
height: 41,
|
||||
iconPath: 'https://cdn.uviewui.com/uview/album/1.jpg',
|
||||
joinCluster: true, // 这个属性很重要,必须要
|
||||
callout: { // 自定义标记点上方的气泡窗口
|
||||
content: '***聚合1',
|
||||
display: 'ALWAYS', // 'BYCLICK':点击显示; 'ALWAYS':常显
|
||||
padding: 5,
|
||||
textAlign: 'center',
|
||||
color: '#C2874D',
|
||||
borderRadius: 4
|
||||
},
|
||||
label: { // 为标记点旁边增加标签
|
||||
content: '你好,marker',
|
||||
borderColor: '#ff0000',
|
||||
bgColor: '#ffffff'## 标题
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
// 2.初始化点聚合的配置,未调用时采用默认配置
|
||||
this.mapContext.initMarkerCluster({
|
||||
enableDefaultStyle: false, // 是否启用默认的聚合样式(是否用自定义图标)
|
||||
zoomOnClick: true,
|
||||
gridSize: 60,
|
||||
complete(res) {
|
||||
console.log('initMarkerCluster', res)
|
||||
}
|
||||
});
|
||||
|
||||
// 3.发生聚合时,给聚合点设置marker标签
|
||||
this.mapContext.on('markerClusterCreate', res => {
|
||||
const clusters = res.clusters // 新产生的聚合簇
|
||||
const zhou = clusters.map(item=> {
|
||||
const {
|
||||
center, // 聚合点的经纬度数组
|
||||
clusterId, // 聚合簇id
|
||||
markerIds // 已经聚合了的标记点id数组
|
||||
} = item
|
||||
|
||||
return {
|
||||
...center,
|
||||
width: 50,
|
||||
height: 50,
|
||||
clusterId, // 必须有
|
||||
iconPath: 'https://mapapi.qq.com/web/lbs/javascriptGL/demo/img/marker_blue.png',
|
||||
borderRadius: 8,
|
||||
joinCluster: true,
|
||||
label: { // 定制聚合点样式
|
||||
content: markerIds.length + '',
|
||||
fontSize: 14,
|
||||
width: 18,
|
||||
height: 18,
|
||||
color: '#ffffff',
|
||||
bgColor: '#C2874D',
|
||||
borderRadius: 6,
|
||||
textAlign: 'center',
|
||||
anchorX: 25,
|
||||
anchorY: -60,
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
// 4. 添加聚合簇标签
|
||||
this.mapContext.addMarkers({
|
||||
markers: zhou,
|
||||
clear: false, //是否先清空地图上所有的marker
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,457 @@
|
|||
<template>
|
||||
<view class="container">
|
||||
<map id="map" ref="map" style="width: 100%; height:2000rpx;" scale="13" :markers="markers" longitude="111.436625"
|
||||
latitude="36.771975" show-location @markertap="markertap" @callouttap="callouttap">
|
||||
</map>
|
||||
<view class="zdxq">
|
||||
<view class="zdxqitem" @click="switch2Change('团柏河')">
|
||||
<image src="../../static/zhandian_nongtian_dingwei.png" mode=""></image>
|
||||
<view class="textss">
|
||||
团柏河典型小流域监测站
|
||||
</view>
|
||||
<!-- <view class="crildon" :style="!issscd?'background:#00ff37':'background: #ccc;'"></view> -->
|
||||
</view>
|
||||
<view class="zdxqitem" @click="switch2Change('对竹河')">
|
||||
<image src="../../static/zhandian_xuqin_dingwei.png" mode=""></image>
|
||||
<view class="textss">
|
||||
对竹河典型小流域监测站
|
||||
</view>
|
||||
<!-- <view class="crildon" :style="!isssscd?'background:#00ff37':'background: #ccc;'"></view> -->
|
||||
</view>
|
||||
<view class="zdxqitem" @click="switch2Change('土壤')">
|
||||
<image src="../../static/iconsheturangzs.png" mode=""></image>
|
||||
<view class="textss">
|
||||
土壤监测
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import api from '@/api/api'
|
||||
import configService from '@/common/service/config.service.js';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
baseUrl:configService.staticDomainURL,
|
||||
markers: [],
|
||||
list: [],
|
||||
issscd: false, // 团柏河显示状态 (false表示显示)
|
||||
isssscd: false, // 对竹河显示状态 (false表示显示)
|
||||
stationInfo: [],
|
||||
cusLocation: [],
|
||||
stationlist: [],
|
||||
stationTwolist:[],
|
||||
mapCtx: null // 添加地图上下文
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
this.$nextTick(() => {
|
||||
this.getList()
|
||||
})
|
||||
},
|
||||
onReady() {
|
||||
// 在onReady中初始化地图上下文
|
||||
this.mapCtx = uni.createMapContext('map', this);
|
||||
},
|
||||
onShow() {
|
||||
if (!uni.getStorageSync('third_session')) {
|
||||
uni.reLaunch({
|
||||
url: '/packDetail/pages/login/login'
|
||||
})
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
this.markers = []
|
||||
this.list = []
|
||||
this.stationInfo = []
|
||||
this.cusLocation = []
|
||||
this.stationlist = []
|
||||
this.stationTwolist = []
|
||||
|
||||
uni.showLoading({
|
||||
title: '加载中'
|
||||
});
|
||||
|
||||
this.$http.get('/applet/survStationInfo/stationMap').then(res => {
|
||||
// 合并 stationInfo 和 deviceList
|
||||
const combinedList = [...res.data.data.stationInfo, ...res.data.data.deviceList];
|
||||
this.stationlist = combinedList;
|
||||
this.stationTwolist = [...res.data.data.stationInfo];
|
||||
|
||||
console.log("合并后的stationlist+++++", this.stationlist);
|
||||
|
||||
// 处理所有标记点
|
||||
this.stationlist.forEach((item, index) => {
|
||||
item.id = index;
|
||||
|
||||
// 统一字段名称,处理 deviceList 和 stationInfo 的字段差异
|
||||
const markerItem = {
|
||||
id: item.id,
|
||||
latitude: Number(item.latitude || item.stationLatitude),
|
||||
longitude: Number(item.longitude || item.stationLongitude),
|
||||
stationType: item.stationType || 'device', // deviceList 没有 stationType,默认为 'device'
|
||||
sortNo: item.sortNo || index,
|
||||
stationName: item.name || item.stationName,
|
||||
stationCode: item.ids || item.stationCode || item.id,
|
||||
// 添加分组信息
|
||||
groupName: item.groupName || '',
|
||||
// 设备类型
|
||||
deviceType: item.type || null
|
||||
};
|
||||
|
||||
this.list.push(markerItem);
|
||||
|
||||
// 分类处理
|
||||
if (item.stationType === 'cusLocaltion') {
|
||||
this.cusLocation.push(item);
|
||||
}
|
||||
if (item.stationType === 'orient' || item.stationType === 'livestock') {
|
||||
this.stationInfo.push(item);
|
||||
}
|
||||
});
|
||||
|
||||
this.issscd = false
|
||||
this.isssscd = false
|
||||
this.qiyeChange()
|
||||
this.list1query()
|
||||
this.addDeviceMarkers() // 添加设备标记
|
||||
|
||||
// 延迟执行以确保标记已经添加到地图
|
||||
setTimeout(() => {
|
||||
this.adjustMapToFitAllMarkers();
|
||||
}, 500);
|
||||
|
||||
uni.hideLoading();
|
||||
})
|
||||
},
|
||||
|
||||
// 添加设备标记
|
||||
addDeviceMarkers() {
|
||||
this.stationlist.forEach((item, index) => {
|
||||
// 如果是 deviceList 中的设备(有 type 字段但没有 stationType 字段)
|
||||
if (item.type && !item.stationType) {
|
||||
let iconPath = '';
|
||||
let width = 35;
|
||||
let height = 35;
|
||||
|
||||
// 根据设备类型设置不同的图标
|
||||
switch(item.type) {
|
||||
case 'soil':
|
||||
iconPath = this.baseUrl + '/icon/device/soil.png';
|
||||
width = 40;
|
||||
height = 40;
|
||||
break;
|
||||
case 'camera':
|
||||
iconPath = this.baseUrl + '/icon/device/cam.png';
|
||||
width = 45;
|
||||
height = 45;
|
||||
break;
|
||||
default:
|
||||
iconPath = this.baseUrl + '/icon/device/default.png';
|
||||
}
|
||||
|
||||
const markerItem = {
|
||||
id: item.id,
|
||||
iconPath: iconPath,
|
||||
latitude: Number(item.latitude),
|
||||
longitude: Number(item.longitude),
|
||||
width: width,
|
||||
height: height,
|
||||
customCallout: {
|
||||
anchorY: 0,
|
||||
anchorX: 0,
|
||||
display: 'ALWAYS'
|
||||
},
|
||||
stationType: 'device',
|
||||
stationName: item.name,
|
||||
stationCode: item.ids,
|
||||
deviceType: item.type,
|
||||
joinCluster: true
|
||||
};
|
||||
this.markers.push(markerItem);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 调整地图视野以包含所有标记点
|
||||
adjustMapToFitAllMarkers() {
|
||||
if (this.mapCtx && this.list.length > 0) {
|
||||
this.mapCtx.includePoints({
|
||||
points: this.list.map(item => ({
|
||||
latitude: item.latitude,
|
||||
longitude: item.longitude
|
||||
})),
|
||||
padding: [40, 40, 40, 40] // 上下左右的边距
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 调整地图视野到特定区域的标记点
|
||||
adjustMapToRegion(regionName) {
|
||||
let points = [];
|
||||
|
||||
if (regionName === '团柏河') {
|
||||
// 获取团柏河区域的所有标记点
|
||||
points = this.stationTwolist
|
||||
.filter(item => item.groupName === '团柏河')
|
||||
.map(item => ({
|
||||
latitude: Number(item.stationLatitude),
|
||||
longitude: Number(item.stationLongitude)
|
||||
}));
|
||||
} else if (regionName === '对竹河') {
|
||||
// 获取对竹河区域的所有标记点
|
||||
points = this.stationTwolist
|
||||
.filter(item => item.groupName === '对竹河')
|
||||
.map(item => ({
|
||||
latitude: Number(item.stationLatitude),
|
||||
longitude: Number(item.stationLongitude)
|
||||
}));
|
||||
}
|
||||
|
||||
if (points.length > 0 && this.mapCtx) {
|
||||
this.mapCtx.includePoints({
|
||||
points: points,
|
||||
padding: [60, 60, 60, 60] // 可以调整边距以获得更好的显示效果
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
markertap(e) {
|
||||
const index = e.detail.markerId
|
||||
const marker = this.markers.find(m => m.id === index);
|
||||
if (marker) {
|
||||
if (['orient', 'livestock'].includes(marker.stationType)) {
|
||||
uni.navigateTo({
|
||||
url: `/packDetail/pages/Site/detail?item=${encodeURIComponent(JSON.stringify(marker))}`
|
||||
})
|
||||
} else if (marker.stationType === 'device') {
|
||||
// 处理设备点击事件
|
||||
uni.showToast({
|
||||
title: `设备: ${marker.stationName}`,
|
||||
icon: 'none'
|
||||
});
|
||||
// 可以在这里添加设备详情页面的跳转逻辑
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
callouttap(e) {
|
||||
const index = e.detail.markerId
|
||||
const marker = this.markers.find(m => m.id === index);
|
||||
if (marker) {
|
||||
if (['orient', 'livestock'].includes(marker.stationType)) {
|
||||
uni.navigateTo({
|
||||
url: `/packDetail/pages/Site/detail?item=${encodeURIComponent(JSON.stringify(marker))}`
|
||||
})
|
||||
} else if (marker.stationType === 'device') {
|
||||
// 处理设备点击事件
|
||||
uni.showToast({
|
||||
title: `设备: ${marker.stationName}`,
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
qiyeChange() {
|
||||
for (let i = 0; i < this.cusLocation.length; i++) {
|
||||
const item = this.cusLocation[i];
|
||||
item.iconPath = '/static/qiyeIcon.png';
|
||||
item.latitude = Number(item.stationLatitude);
|
||||
item.longitude = Number(item.stationLongitude);
|
||||
item.width = 35;
|
||||
item.height = 52;
|
||||
|
||||
const markerItem = {
|
||||
id: item.id,
|
||||
iconPath: item.iconPath,
|
||||
latitude: item.latitude,
|
||||
longitude: item.longitude,
|
||||
width: item.width,
|
||||
height: item.height,
|
||||
customCallout: {
|
||||
anchorY: 0,
|
||||
anchorX: 0,
|
||||
display: 'ALWAYS'
|
||||
},
|
||||
stationType: item.stationType,
|
||||
stationName: item.stationName,
|
||||
stationCode: item.stationCode,
|
||||
joinCluster: true
|
||||
};
|
||||
this.markers.push(markerItem);
|
||||
}
|
||||
},
|
||||
|
||||
switch2Change(name) {
|
||||
if (name === "团柏河") {
|
||||
this.issscd = !this.issscd;
|
||||
} else {
|
||||
this.isssscd = !this.isssscd;
|
||||
}
|
||||
|
||||
// 根据当前状态调整地图视野
|
||||
if ((name === "团柏河" && !this.issscd) || (name === "对竹河" && !this.isssscd)) {
|
||||
// 如果是显示状态(绿色圆点),调整到指定区域
|
||||
setTimeout(() => {
|
||||
this.adjustMapToRegion(name);
|
||||
}, 300);
|
||||
} else {
|
||||
// 如果是隐藏状态(灰色圆点),调整到所有标记点
|
||||
setTimeout(() => {
|
||||
this.adjustMapToFitAllMarkers();
|
||||
}, 300);
|
||||
}
|
||||
},
|
||||
|
||||
list1query() {
|
||||
// 先清除所有orient类型的标记
|
||||
this.markers = this.markers.filter(item => item.stationType !== 'orient');
|
||||
|
||||
if (!this.issscd) {
|
||||
for (let i = 0; i < this.stationlist.length; i++) {
|
||||
const item = this.stationlist[i];
|
||||
if (item.stationType === 'orient') {
|
||||
item.iconPath = this.baseUrl +'/'+ item.stationIcon;
|
||||
item.latitude = Number(item.stationLatitude);
|
||||
item.longitude = Number(item.stationLongitude);
|
||||
item.width = 172;
|
||||
item.height = 148;
|
||||
|
||||
const markerItem = {
|
||||
id: item.id,
|
||||
iconPath: item.iconPath,
|
||||
latitude: item.latitude,
|
||||
longitude: item.longitude,
|
||||
width: item.width,
|
||||
height: item.height,
|
||||
customCallout: {
|
||||
anchorY: 0,
|
||||
anchorX: 0,
|
||||
display: 'ALWAYS'
|
||||
},
|
||||
stationType: item.stationType,
|
||||
stationName: item.stationName,
|
||||
stationCode: item.stationCode,
|
||||
joinCluster: true
|
||||
};
|
||||
this.markers.push(markerItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
/* 样式保持不变 */
|
||||
.bgimg {
|
||||
position: fixed;
|
||||
// z-index: -99;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.customCallout {
|
||||
width: 349rpx;
|
||||
height: 49rpx;
|
||||
color: #fff;
|
||||
font-size: 24rpx;
|
||||
text-shadow: 1rpx 2rpx 0rpx #0D1934;
|
||||
font-weight: bold;
|
||||
// background-image: url('@/static/zhandian_icon_nongtian_title.png');
|
||||
background-repeat: no-repeat;
|
||||
background-size: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.customCallout1 {
|
||||
width: 349rpx;
|
||||
height: 49rpx;
|
||||
color: #fff;
|
||||
font-size: 24rpx;
|
||||
text-shadow: 1rpx 2rpx 0rpx #0D1934;
|
||||
font-weight: bold;
|
||||
// background-image: url('@/static/zhandian_icon_xuqin_title.png');
|
||||
background-repeat: no-repeat;
|
||||
background-size: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.zdxq {
|
||||
position: fixed;
|
||||
left: 33rpx;
|
||||
bottom: 36rpx;
|
||||
}
|
||||
|
||||
.zdxqitem {
|
||||
padding: 8rpx 0 7rpx 17rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
font-size: 22rpx;
|
||||
font-family: Source Han Sans SC;
|
||||
font-weight: 500;
|
||||
color: #FFFFFF;
|
||||
text-shadow: 0rpx 1rpx 0rpx rgba(4, 49, 52, 0.55);
|
||||
width: 359rpx;
|
||||
background: rgba(0, 0, 0, 0.52);
|
||||
border: 1px solid #4B677C;
|
||||
border-radius: 6rpx;
|
||||
margin-bottom: 10rpx;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.crildon {
|
||||
width: 10rpx;
|
||||
height: 10rpx;
|
||||
border-radius: 50%;
|
||||
margin-right: 15rpx;
|
||||
}
|
||||
|
||||
.zdxqitem:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.zdxqitem image {
|
||||
width: 33rpx;
|
||||
height: 50rpx;
|
||||
margin-right: 15rpx;
|
||||
}
|
||||
|
||||
.zdxqitem:first-child image {
|
||||
width: 30rpx;
|
||||
height: 40rpx;
|
||||
margin-right: 15rpx;
|
||||
}
|
||||
|
||||
.textss {
|
||||
flex: 1;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.imgs {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: -9;
|
||||
}
|
||||
|
||||
.switchs {
|
||||
position: fixed;
|
||||
top: 36rpx;
|
||||
right: 40rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -1,60 +1,25 @@
|
|||
<template>
|
||||
<view class="container">
|
||||
<map id="map" ref="map" style="width: 100%; height: calc(100vh + 50rpx);" :scale="mapScale" :markers="markers"
|
||||
longitude="112.83100231396601" latitude="36.872032399813556" show-location show-compass show-scale
|
||||
@markertap="markertap">
|
||||
<map id="map" ref="map" style="width: 100%; height: calc(100vh + 50rpx);" scale="13" :markers="markers" longitude="111.436625"
|
||||
latitude="36.771975" show-location @markertap="markertap" @callouttap="callouttap">
|
||||
</map>
|
||||
<view class="zdxq">
|
||||
<view class="zdxqitem" @click="switch2Change('livestock')">
|
||||
<view class="zdxqitem" @click="switch2Change('团柏河')">
|
||||
<image src="../../static/zhandian_nongtian_dingwei.png" mode=""></image>
|
||||
<view class="textss">
|
||||
团柏河监测站
|
||||
</view>
|
||||
</view>
|
||||
<view class="zdxqitem" @click="switch2Change('对竹河')">
|
||||
<image src="../../static/zhandian_xuqin_dingwei.png" mode=""></image>
|
||||
<view class="textss">
|
||||
畜禽污染监测站
|
||||
对竹河监测站
|
||||
</view>
|
||||
</view>
|
||||
<view class="zdxqitem" @click="switch2Change('enterprise')">
|
||||
<image src="../../static/qiyebzIcon.png" mode="" style="width: 40rpx; height: 40rpx;"></image>
|
||||
<view class="zdxqitem" @click="switch2Change('土壤')">
|
||||
<image src="../../static/iconsheturangzs.png" mode=""></image>
|
||||
<view class="textss">
|
||||
企业点位
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 企业信息弹出框 -->
|
||||
<view class="enterprise-popup" v-if="showEnterprisePopup" @click="closePopup">
|
||||
<view class="popup-content" @click.stop>
|
||||
<view class="popup-header">
|
||||
<text class="popup-title">{{ currentEnterprise.entName || '企业信息' }}</text>
|
||||
<text class="popup-close" @click="closePopup">×</text>
|
||||
</view>
|
||||
<view class="popup-body">
|
||||
<view class="info-item">
|
||||
<text class="label">企业简称:</text>
|
||||
<text class="value">{{ currentEnterprise.entShortName || '-' }}</text>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<text class="label">负责人:</text>
|
||||
<text class="value">{{ currentEnterprise.entCharge || '-' }}</text>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<text class="label">统一信用代码:</text>
|
||||
<text class="value">{{ currentEnterprise.entCredit || '-' }}</text>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<text class="label">企业编号:</text>
|
||||
<text class="value">{{ currentEnterprise.entCode || '-' }}</text>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<text class="label">企业简介:</text>
|
||||
<text class="value">{{ currentEnterprise.entIntro || '暂无简介' }}</text>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<text class="label">联系电话:</text>
|
||||
<text class="value">{{ currentEnterprise.entPhone || '暂无' }}</text>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<text class="label">创建时间:</text>
|
||||
<text class="value">{{ currentEnterprise.createTime || '-' }}</text>
|
||||
</view>
|
||||
长期定位监测点
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -73,447 +38,399 @@
|
|||
latitude: 36.5,
|
||||
longitude: 111.7
|
||||
},
|
||||
mapScale: 13,
|
||||
scale: 14,
|
||||
markers: [],
|
||||
markersZIndex: 1,
|
||||
lastTap: '',
|
||||
stationList: [],
|
||||
cusLocationList: [],
|
||||
soilStationList: [],
|
||||
allStationList: [],
|
||||
stationTwoList: [],
|
||||
enterpriseList: [],
|
||||
mapCtx: null,
|
||||
showEnterprisePopup: false,
|
||||
currentEnterprise: {},
|
||||
currentMarkerId: null,
|
||||
maxMarkerId: 0,
|
||||
debugMode: true
|
||||
list: [],
|
||||
issscd: false, // 团柏河显示状态 (false表示显示)
|
||||
isssscd: false, // 对竹河显示状态 (false表示显示)
|
||||
isSoilShow: false, // 土壤显示状态 (false表示显示)
|
||||
stationInfo: [],
|
||||
cusLocation: [],
|
||||
stationlist: [],
|
||||
stationTwolist: [],
|
||||
mapCtx: null // 添加地图上下文
|
||||
};
|
||||
},
|
||||
onLoad() {},
|
||||
onLoad() {
|
||||
this.$nextTick(() => {
|
||||
this.getList()
|
||||
})
|
||||
},
|
||||
onReady() {
|
||||
// 在onReady中初始化地图上下文
|
||||
this.mapCtx = uni.createMapContext('map', this);
|
||||
},
|
||||
onShow() {
|
||||
api.checkLogin(() => {
|
||||
this.$nextTick(() => {
|
||||
this.getList()
|
||||
})
|
||||
}, () => {
|
||||
if(uni.getStorageSync('third_session')){
|
||||
uni.login({
|
||||
success: function (res) {
|
||||
this.code = res.code
|
||||
let params = {}
|
||||
params.jsCode = this.code
|
||||
api.wxlogin(params).then(res=>{
|
||||
if(res.data.code == 0){
|
||||
let userInfo = res.data.data;
|
||||
// uni.setStorageSync('third_session', userInfo.thirdSession);
|
||||
if(!userInfo.id){
|
||||
uni.reLaunch({
|
||||
url:'/packDetail/pages/login/login'
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
}else if(!uni.getStorageSync('third_session')){
|
||||
uni.reLaunch({
|
||||
url: '/packDetail/pages/login/login'
|
||||
url:'/packDetail/pages/login/login'
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
this.markers = []
|
||||
this.stationList = []
|
||||
this.cusLocationList = []
|
||||
this.soilStationList = []
|
||||
this.allStationList = []
|
||||
this.stationTwoList = []
|
||||
this.enterpriseList = []
|
||||
this.list = []
|
||||
this.stationInfo = []
|
||||
this.cusLocation = []
|
||||
this.stationlist = []
|
||||
this.stationTwolist = []
|
||||
|
||||
uni.showLoading({
|
||||
title: '加载中'
|
||||
});
|
||||
|
||||
// 获取监测站数据
|
||||
this.$http.get('/applet/survStationInfo/stationMap').then(res => {
|
||||
this.stationList = [...res.data.data.stationInfo];
|
||||
this.cusLocationList = [...res.data.data.cusLocation];
|
||||
this.soilStationList = [...res.data.data.deviceList];
|
||||
this.allStationList.push(...this.stationList);
|
||||
this.allStationList.push(...this.cusLocationList);
|
||||
this.allStationList.push(...this.soilStationList);
|
||||
this.allStationList.forEach((item, index) => {
|
||||
item.id = index + 1;
|
||||
// 合并 stationInfo 和 deviceList
|
||||
const combinedList = [...res.data.data.stationInfo, ...res.data.data.deviceList];
|
||||
this.stationlist = combinedList;
|
||||
this.stationTwolist = [...res.data.data.stationInfo];
|
||||
|
||||
console.log("合并后的stationlist+++++", this.stationlist);
|
||||
|
||||
// 处理所有标记点
|
||||
this.stationlist.forEach((item, index) => {
|
||||
item.id = index;
|
||||
|
||||
// 统一字段名称,处理 deviceList 和 stationInfo 的字段差异
|
||||
const markerItem = {
|
||||
id: item.id,
|
||||
latitude: Number(item.latitude || item.stationLatitude),
|
||||
longitude: Number(item.longitude || item.stationLongitude),
|
||||
stationType: item.stationType || 'device', // deviceList 没有 stationType,默认为 'device'
|
||||
sortNo: item.sortNo || index,
|
||||
stationName: item.name || item.stationName,
|
||||
stationCode: item.ids || item.stationCode || item.id,
|
||||
// 添加分组信息
|
||||
groupName: item.groupName || '',
|
||||
// 设备类型
|
||||
deviceType: item.type || null
|
||||
};
|
||||
|
||||
this.list.push(markerItem);
|
||||
|
||||
// 分类处理
|
||||
if (item.stationType === 'cusLocaltion') {
|
||||
this.cusLocation.push(item);
|
||||
}
|
||||
if (item.stationType === 'orient' || item.stationType === 'livestock') {
|
||||
this.stationInfo.push(item);
|
||||
}
|
||||
});
|
||||
|
||||
this.issscd = false
|
||||
this.isssscd = false
|
||||
this.isSoilShow = false
|
||||
this.qiyeChange()
|
||||
this.list1query()
|
||||
this.addDeviceMarkers() // 添加设备标记
|
||||
|
||||
this.maxMarkerId = this.allStationList.length + 1;
|
||||
|
||||
this.enterpriseRender();
|
||||
this.stationRender();
|
||||
this.monitorRender()
|
||||
// 延迟执行以确保标记已经添加到地图
|
||||
setTimeout(() => {
|
||||
this.adjustMapToFitAllMarkers();
|
||||
}, 500);
|
||||
|
||||
uni.hideLoading();
|
||||
}).catch(err => {
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
title: '数据加载失败',
|
||||
icon: 'none'
|
||||
});
|
||||
console.error('加载地图数据失败:', err);
|
||||
})
|
||||
|
||||
// 获取企业列表
|
||||
this.$http.get('/applet/wxclient/getEntList').then(res => {
|
||||
if (res.data.data && res.data.data.result) {
|
||||
this.enterpriseList = res.data.data.result;
|
||||
this.renderEnterpriseMarkers();
|
||||
// 数据加载完成后调整地图视野显示全部点位
|
||||
this.$nextTick(() => {
|
||||
this.ensureAllMarkersVisible();
|
||||
});
|
||||
}
|
||||
uni.hideLoading();
|
||||
}).catch(err => {
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
title: '企业数据加载失败',
|
||||
icon: 'none'
|
||||
});
|
||||
console.error('加载企业数据失败:', err);
|
||||
})
|
||||
},
|
||||
|
||||
renderEnterpriseMarkers() {
|
||||
if (!this.enterpriseList || this.enterpriseList.length === 0) {
|
||||
console.warn('企业列表为空');
|
||||
return;
|
||||
}
|
||||
// 添加设备标记
|
||||
addDeviceMarkers() {
|
||||
this.stationlist.forEach((item, index) => {
|
||||
// 如果是 deviceList 中的设备(有 type 字段但没有 stationType 字段)
|
||||
if (item.type && !item.stationType) {
|
||||
let iconPath = '';
|
||||
let width = 35;
|
||||
let height = 35;
|
||||
|
||||
this.enterpriseList.forEach((item, index) => {
|
||||
const lat = Number(item.entLat);
|
||||
const lng = Number(item.entLong);
|
||||
|
||||
if (isNaN(lat) || isNaN(lng) || lat === 0 || lng === 0) {
|
||||
console.warn('企业坐标无效:', item.entName, lat, lng);
|
||||
return;
|
||||
}
|
||||
|
||||
const markerId = ++this.maxMarkerId;
|
||||
|
||||
let iconPath = '/static/qiyeIcon.png';
|
||||
if (item.entMapIcon) {
|
||||
iconPath = this.baseUrl + '/' + item.entMapIcon;
|
||||
}
|
||||
|
||||
const markerItem = {
|
||||
id: markerId,
|
||||
iconPath: iconPath,
|
||||
latitude: lat,
|
||||
longitude: lng,
|
||||
width: 40,
|
||||
height: 50,
|
||||
stationType: 'enterprise',
|
||||
stationName: item.entName,
|
||||
entShortName: item.entShortName,
|
||||
entCharge: item.entCharge,
|
||||
entCredit: item.entCredit,
|
||||
entCode: item.entCode,
|
||||
entIntro: item.entIntro,
|
||||
entPhone: item.entPhone,
|
||||
createTime: item.createTime,
|
||||
entId: item.id,
|
||||
joinCluster: false,
|
||||
zIndex: this.markersZIndex++,
|
||||
enterpriseData: item,
|
||||
callout: {
|
||||
content: item.entName || '企业',
|
||||
color: '#FFFFFF',
|
||||
fontSize: 14,
|
||||
borderRadius: 10,
|
||||
bgColor: '#007AFF',
|
||||
padding: 8,
|
||||
display: 'ALWAYS'
|
||||
}
|
||||
};
|
||||
|
||||
this.markers.push(markerItem);
|
||||
});
|
||||
},
|
||||
|
||||
markertap(e) {
|
||||
const index = e.detail.markerId;
|
||||
const marker = this.markers.find(m => Number(m.id) === Number(index));
|
||||
|
||||
if (!marker) {
|
||||
console.warn('未找到对应的marker, ID:', index);
|
||||
return;
|
||||
}
|
||||
|
||||
if (marker.stationType === 'enterprise') {
|
||||
this.currentEnterprise = marker.enterpriseData || {
|
||||
entName: marker.stationName || '企业名称',
|
||||
entShortName: marker.entShortName || '',
|
||||
entCharge: marker.entCharge || '',
|
||||
entCredit: marker.entCredit || '',
|
||||
entCode: marker.entCode || '',
|
||||
entIntro: marker.entIntro || '暂无简介',
|
||||
entPhone: marker.entPhone || '暂无',
|
||||
createTime: marker.createTime || ''
|
||||
};
|
||||
|
||||
this.currentMarkerId = marker.id;
|
||||
this.showEnterprisePopup = true;
|
||||
return;
|
||||
}
|
||||
|
||||
// 监测站逻辑
|
||||
if (marker.stationType === 'livestock') {
|
||||
uni.navigateTo({
|
||||
url: `/packDetail/pages/Site/detail?item=${encodeURIComponent(JSON.stringify(marker))}`
|
||||
})
|
||||
} else if (marker.stationType === 'device') {
|
||||
uni.navigateTo({
|
||||
url: `/packDetail/pages/vidio/soilindex`
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
closePopup() {
|
||||
this.showEnterprisePopup = false;
|
||||
this.currentEnterprise = {};
|
||||
this.currentMarkerId = null;
|
||||
},
|
||||
|
||||
enterpriseRender() {
|
||||
for (let i = 0; i < this.cusLocationList.length; i++) {
|
||||
const item = this.cusLocationList[i];
|
||||
const lat = Number(item.stationLatitude);
|
||||
const lng = Number(item.stationLongitude);
|
||||
|
||||
if (isNaN(lat) || isNaN(lng) || lat === 0 || lng === 0) {
|
||||
console.warn('企业点位坐标无效:', item.stationName, lat, lng);
|
||||
continue;
|
||||
}
|
||||
|
||||
const markerItem = {
|
||||
id: ++this.maxMarkerId,
|
||||
iconPath: '/static/qiyeIcon.png',
|
||||
latitude: lat,
|
||||
longitude: lng,
|
||||
width: 35,
|
||||
height: 52,
|
||||
stationType: item.stationType,
|
||||
stationName: item.stationName,
|
||||
stationCode: item.stationCode,
|
||||
joinCluster: false,
|
||||
zIndex: this.markersZIndex,
|
||||
};
|
||||
this.markers.push(markerItem);
|
||||
}
|
||||
},
|
||||
|
||||
stationRender() {
|
||||
if (!this.issscd) {
|
||||
for (let i = 0; i < this.stationList.length; i++) {
|
||||
const item = this.stationList[i];
|
||||
const lat = Number(item.stationLatitude);
|
||||
const lng = Number(item.stationLongitude);
|
||||
|
||||
if (isNaN(lat) || isNaN(lng) || lat === 0 || lng === 0) {
|
||||
console.warn('站房点位坐标无效:', item.stationName, lat, lng);
|
||||
continue;
|
||||
// 根据设备类型设置不同的图标
|
||||
switch(item.type) {
|
||||
case 'soil':
|
||||
iconPath = this.baseUrl + '/icon/device/soil.png';
|
||||
width = 32;
|
||||
height = 47;
|
||||
break;
|
||||
case 'camera':
|
||||
iconPath = this.baseUrl + '/icon/device/cam.png';
|
||||
width = 45;
|
||||
height = 45;
|
||||
break;
|
||||
default:
|
||||
iconPath = this.baseUrl + '/icon/device/default.png';
|
||||
}
|
||||
|
||||
const markerItem = {
|
||||
id: ++this.maxMarkerId,
|
||||
iconPath: this.baseUrl + '/' + item.stationIcon,
|
||||
latitude: lat,
|
||||
longitude: lng,
|
||||
width: 239,
|
||||
height: 186,
|
||||
stationType: item.stationType,
|
||||
stationName: item.stationName,
|
||||
stationCode: item.stationCode,
|
||||
joinCluster: false,
|
||||
zIndex: this.markersZIndex,
|
||||
id: item.id,
|
||||
iconPath: iconPath,
|
||||
latitude: Number(item.latitude),
|
||||
longitude: Number(item.longitude),
|
||||
width: width,
|
||||
height: height,
|
||||
customCallout: {
|
||||
anchorY: 0,
|
||||
anchorX: 0,
|
||||
display: 'ALWAYS'
|
||||
},
|
||||
stationType: 'device',
|
||||
stationName: item.name,
|
||||
stationCode: item.ids,
|
||||
deviceType: item.type,
|
||||
joinCluster: false //点聚合
|
||||
};
|
||||
this.markers.push(markerItem);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
monitorRender() {
|
||||
this.soilStationList.forEach((item, index) => {
|
||||
const lat = Number(item.latitude);
|
||||
const lng = Number(item.longitude);
|
||||
|
||||
if (isNaN(lat) || isNaN(lng) || lat === 0 || lng === 0) {
|
||||
console.warn('监测点位坐标无效:', item.name, lat, lng);
|
||||
return;
|
||||
}
|
||||
|
||||
let iconPath = '';
|
||||
let width = 35;
|
||||
let height = 35;
|
||||
|
||||
switch (item.type) {
|
||||
case 'soil':
|
||||
iconPath = this.baseUrl + '/icon/device/soil.png';
|
||||
width = 32;
|
||||
height = 47;
|
||||
break;
|
||||
case 'camera':
|
||||
iconPath = this.baseUrl + '/icon/device/cam.png';
|
||||
width = 45;
|
||||
height = 45;
|
||||
break;
|
||||
default:
|
||||
iconPath = this.baseUrl + '/icon/device/default.png';
|
||||
}
|
||||
|
||||
const markerItem = {
|
||||
id: ++this.maxMarkerId,
|
||||
iconPath: iconPath,
|
||||
latitude: lat,
|
||||
longitude: lng,
|
||||
width: width,
|
||||
height: height,
|
||||
stationType: 'device',
|
||||
stationName: item.name,
|
||||
stationCode: item.ids,
|
||||
deviceType: item.type,
|
||||
joinCluster: false,
|
||||
zIndex: this.markersZIndex,
|
||||
};
|
||||
this.markers.push(markerItem);
|
||||
});
|
||||
},
|
||||
|
||||
ensureAllMarkersVisible() {
|
||||
if (!this.mapCtx) {
|
||||
this.mapCtx = uni.createMapContext('map', this);
|
||||
}
|
||||
|
||||
const validPoints = this.markers
|
||||
.filter(item => {
|
||||
const lat = Number(item.latitude);
|
||||
const lng = Number(item.longitude);
|
||||
return !isNaN(lat) && !isNaN(lng) && lat !== 0 && lng !== 0;
|
||||
})
|
||||
.map(item => ({
|
||||
latitude: Number(item.latitude),
|
||||
longitude: Number(item.longitude)
|
||||
}));
|
||||
|
||||
if (validPoints.length === 0) {
|
||||
if (this.center.latitude && this.center.longitude) {
|
||||
this.mapCtx.moveToLocation({
|
||||
latitude: this.center.latitude,
|
||||
longitude: this.center.longitude,
|
||||
scale: 10
|
||||
});
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
this.mapCtx.includePoints({
|
||||
points: validPoints,
|
||||
padding: [120, 120, 120, 120]
|
||||
});
|
||||
} catch (e) {
|
||||
console.error('调整地图视野异常:', e);
|
||||
this.fallbackAdjustMap(validPoints);
|
||||
}
|
||||
},
|
||||
|
||||
fallbackAdjustMap(validPoints) {
|
||||
if (!validPoints || validPoints.length === 0) return;
|
||||
|
||||
try {
|
||||
const lats = validPoints.map(p => p.latitude);
|
||||
const lngs = validPoints.map(p => p.longitude);
|
||||
|
||||
const minLat = Math.min(...lats);
|
||||
const maxLat = Math.max(...lats);
|
||||
const minLng = Math.min(...lngs);
|
||||
const maxLng = Math.max(...lngs);
|
||||
|
||||
const centerLat = (minLat + maxLat) / 2;
|
||||
const centerLng = (minLng + maxLng) / 2;
|
||||
|
||||
const latDiff = maxLat - minLat;
|
||||
const lngDiff = maxLng - minLng;
|
||||
const maxDiff = Math.max(latDiff, lngDiff);
|
||||
|
||||
let scale = 13;
|
||||
if (maxDiff > 2) scale = 6;
|
||||
else if (maxDiff > 1) scale = 8;
|
||||
else if (maxDiff > 0.5) scale = 10;
|
||||
else if (maxDiff > 0.2) scale = 11;
|
||||
else if (maxDiff > 0.1) scale = 12;
|
||||
else scale = 13;
|
||||
|
||||
this.mapCtx.moveToLocation({
|
||||
latitude: centerLat,
|
||||
longitude: centerLng,
|
||||
scale: scale
|
||||
});
|
||||
} catch (e) {
|
||||
console.error('备用方案失败:', e);
|
||||
}
|
||||
},
|
||||
|
||||
switch2Change(name) {
|
||||
let that = this;
|
||||
if (name === that.lastTap) {
|
||||
that.adjustMapToFitAllMarkers();
|
||||
that.lastTap = '';
|
||||
} else {
|
||||
that.adjustMapToRegion(name);
|
||||
that.lastTap = name;
|
||||
}
|
||||
},
|
||||
|
||||
// 调整地图视野以包含所有标记点(类似setFitView效果)
|
||||
adjustMapToFitAllMarkers() {
|
||||
if (this.mapCtx && this.markers.length > 0) {
|
||||
if (this.mapCtx && this.list.length > 0) {
|
||||
this.mapCtx.includePoints({
|
||||
points: this.markers.map(item => ({
|
||||
points: this.list.map(item => ({
|
||||
latitude: item.latitude,
|
||||
longitude: item.longitude
|
||||
})),
|
||||
padding: [60, 60, 60, 60]
|
||||
padding: [60, 60, 60, 60] // 上下左右的边距
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 调整地图视野到特定区域的标记点
|
||||
adjustMapToRegion(regionName) {
|
||||
let that = this;
|
||||
let points = [];
|
||||
let markers = [];
|
||||
|
||||
if (regionName === 'enterprise') {
|
||||
markers = this.markers.filter(item => item.stationType === 'enterprise');
|
||||
} else if (regionName === 'livestock') {
|
||||
markers = this.markers.filter(item => item.stationType === regionName);
|
||||
} else if (regionName === 'soil') {
|
||||
markers = this.markers.filter(item => item.type === 'soil' || item.deviceType === 'soil');
|
||||
}
|
||||
|
||||
if (markers.length > 0) {
|
||||
points = markers.map(item => {
|
||||
item.zIndex = (that.markersZIndex++);
|
||||
return {
|
||||
if (regionName === '团柏河') {
|
||||
// 获取团柏河区域的所有标记点
|
||||
points = this.stationTwolist
|
||||
.filter(item => item.groupName === '团柏河')
|
||||
.map(item => ({
|
||||
latitude: Number(item.stationLatitude),
|
||||
longitude: Number(item.stationLongitude)
|
||||
}));
|
||||
} else if (regionName === '对竹河') {
|
||||
// 获取对竹河区域的所有标记点
|
||||
points = this.stationTwolist
|
||||
.filter(item => item.groupName === '对竹河')
|
||||
.map(item => ({
|
||||
latitude: Number(item.stationLatitude),
|
||||
longitude: Number(item.stationLongitude)
|
||||
}));
|
||||
} else if (regionName === '土壤') {
|
||||
// 获取所有土壤设备标记点
|
||||
points = this.stationlist
|
||||
.filter(item => item.type === 'soil' || item.deviceType === 'soil')
|
||||
.map(item => ({
|
||||
latitude: Number(item.latitude || item.stationLatitude),
|
||||
longitude: Number(item.longitude || item.stationLongitude)
|
||||
}
|
||||
});
|
||||
}));
|
||||
}
|
||||
|
||||
if (points.length > 0 && this.mapCtx) {
|
||||
this.mapCtx.includePoints({
|
||||
points: points,
|
||||
padding: [80, 110, 80, 110]
|
||||
padding: [80, 110, 80, 110] // 增加边距以获得更好的显示效果
|
||||
});
|
||||
} else if (points.length === 0) {
|
||||
// 如果没有找到对应的标记点,显示提示
|
||||
uni.showToast({
|
||||
title: `未找到${regionName}相关的监测点`,
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 更精确的地图定位方法(类似高德地图的setFitView)
|
||||
preciseMapAdjustment(regionName) {
|
||||
if (!this.mapCtx) return;
|
||||
|
||||
// 根据不同区域设置不同的中心和缩放级别
|
||||
const regionConfigs = {
|
||||
'团柏河': {
|
||||
latitude: 36.5, // 实际中心纬度
|
||||
longitude: 111.7, // 实际中心经度
|
||||
scale: 14
|
||||
},
|
||||
'对竹河': {
|
||||
latitude: 36.4, // 实际中心纬度
|
||||
longitude: 111.6, // 实际中心经度
|
||||
scale: 14
|
||||
},
|
||||
'土壤': {
|
||||
latitude: 36.45, // 实际中心纬度
|
||||
longitude: 111.65, // 实际中心经度
|
||||
scale: 13
|
||||
}
|
||||
};
|
||||
|
||||
const config = regionConfigs[regionName];
|
||||
if (config) {
|
||||
this.mapCtx.moveToLocation({
|
||||
latitude: config.latitude,
|
||||
longitude: config.longitude,
|
||||
scale: config.scale
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
markertap(e) {
|
||||
const index = e.detail.markerId
|
||||
const marker = this.markers.find(m => m.id === index);
|
||||
if (marker) {
|
||||
if (['orient', 'livestock'].includes(marker.stationType)) {
|
||||
uni.navigateTo({
|
||||
url: `/packDetail/pages/Site/detail?item=${encodeURIComponent(JSON.stringify(marker))}`
|
||||
})
|
||||
} else if (marker.stationType === 'device') {
|
||||
uni.navigateTo({
|
||||
url: `/packDetail/pages/vidio/soilindex`
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
callouttap(e) {
|
||||
const index = e.detail.markerId
|
||||
const marker = this.markers.find(m => m.id === index);
|
||||
if (marker) {
|
||||
if (['orient', 'livestock'].includes(marker.stationType)) {
|
||||
uni.navigateTo({
|
||||
url: `/packDetail/pages/Site/detail?item=${encodeURIComponent(JSON.stringify(marker))}`
|
||||
})
|
||||
} else if (marker.stationType === 'device') {
|
||||
uni.showToast({
|
||||
title: `设备: ${marker.stationName}`,
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
qiyeChange() {
|
||||
for (let i = 0; i < this.cusLocation.length; i++) {
|
||||
const item = this.cusLocation[i];
|
||||
item.iconPath = '/static/qiyeIcon.png';
|
||||
item.latitude = Number(item.stationLatitude);
|
||||
item.longitude = Number(item.stationLongitude);
|
||||
item.width = 35;
|
||||
item.height = 52;
|
||||
|
||||
const markerItem = {
|
||||
id: item.id,
|
||||
iconPath: item.iconPath,
|
||||
latitude: item.latitude,
|
||||
longitude: item.longitude,
|
||||
width: item.width,
|
||||
height: item.height,
|
||||
customCallout: {
|
||||
anchorY: 0,
|
||||
anchorX: 0,
|
||||
display: 'ALWAYS'
|
||||
},
|
||||
stationType: item.stationType,
|
||||
stationName: item.stationName,
|
||||
stationCode: item.stationCode,
|
||||
joinCluster: false //点聚合
|
||||
};
|
||||
this.markers.push(markerItem);
|
||||
}
|
||||
},
|
||||
|
||||
switch2Change(name) {
|
||||
// 更新对应区域的状态
|
||||
const stateMap = {
|
||||
'团柏河': 'issscd',
|
||||
'对竹河': 'isssscd',
|
||||
'土壤': 'isSoilShow'
|
||||
};
|
||||
|
||||
if (stateMap[name]) {
|
||||
this[stateMap[name]] = !this[stateMap[name]];
|
||||
}
|
||||
|
||||
// 判断是否要聚焦到特定区域
|
||||
const shouldFocus = {
|
||||
'团柏河': !this.issscd,
|
||||
'对竹河': !this.isssscd,
|
||||
'土壤': !this.isSoilShow
|
||||
};
|
||||
|
||||
if (shouldFocus[name]) {
|
||||
// 聚焦到特定区域
|
||||
setTimeout(() => {
|
||||
this.adjustMapToRegion(name);
|
||||
// 或者使用更精确的方法:this.preciseMapAdjustment(name);
|
||||
}, 300);
|
||||
} else {
|
||||
// 恢复显示所有标记点
|
||||
setTimeout(() => {
|
||||
this.adjustMapToFitAllMarkers();
|
||||
}, 300);
|
||||
}
|
||||
},
|
||||
|
||||
list1query() {
|
||||
// 先清除所有orient类型的标记
|
||||
this.markers = this.markers.filter(item => item.stationType !== 'orient');
|
||||
|
||||
if (!this.issscd) {
|
||||
for (let i = 0; i < this.stationlist.length; i++) {
|
||||
const item = this.stationlist[i];
|
||||
if (item.stationType === 'orient') {
|
||||
item.iconPath = this.baseUrl +'/'+ item.stationIcon;
|
||||
item.latitude = Number(item.stationLatitude);
|
||||
item.longitude = Number(item.stationLongitude);
|
||||
item.width = 239;
|
||||
item.height = 186;
|
||||
const markerItem = {
|
||||
id: item.id,
|
||||
iconPath: item.iconPath,
|
||||
latitude: item.latitude,
|
||||
longitude: item.longitude,
|
||||
width: item.width,
|
||||
height: item.height,
|
||||
customCallout: {
|
||||
anchorY: 0,
|
||||
anchorX: 0,
|
||||
display: 'ALWAYS'
|
||||
},
|
||||
stationType: item.stationType,
|
||||
stationName: item.stationName,
|
||||
stationCode: item.stationCode,
|
||||
joinCluster: false //点聚合
|
||||
};
|
||||
this.markers.push(markerItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
/* 样式保持不变 */
|
||||
.bgimg {
|
||||
position: fixed;
|
||||
// z-index: -99;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
|
|
@ -527,6 +444,7 @@
|
|||
font-size: 24rpx;
|
||||
text-shadow: 1rpx 2rpx 0rpx #0D1934;
|
||||
font-weight: bold;
|
||||
// background-image: url('@/static/zhandian_icon_nongtian_title.png');
|
||||
background-repeat: no-repeat;
|
||||
background-size: 100%;
|
||||
display: flex;
|
||||
|
|
@ -541,6 +459,7 @@
|
|||
font-size: 24rpx;
|
||||
text-shadow: 1rpx 2rpx 0rpx #0D1934;
|
||||
font-weight: bold;
|
||||
// background-image: url('@/static/zhandian_icon_xuqin_title.png');
|
||||
background-repeat: no-repeat;
|
||||
background-size: 100%;
|
||||
display: flex;
|
||||
|
|
@ -614,90 +533,4 @@
|
|||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.enterprise-popup {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background: rgba(0, 0, 0, 0.6);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
z-index: 9999;
|
||||
}
|
||||
|
||||
.popup-content {
|
||||
width: 600rpx;
|
||||
max-height: 70vh;
|
||||
background: #FFFFFF;
|
||||
border-radius: 20rpx;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.popup-header {
|
||||
padding: 30rpx 30rpx 20rpx;
|
||||
border-bottom: 1px solid #eee;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.popup-title {
|
||||
font-size: 34rpx;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.popup-close {
|
||||
font-size: 48rpx;
|
||||
color: #999;
|
||||
padding: 0 10rpx;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.popup-body {
|
||||
padding: 20rpx 30rpx;
|
||||
overflow-y: auto;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.info-item {
|
||||
display: flex;
|
||||
padding: 12rpx 0;
|
||||
font-size: 28rpx;
|
||||
border-bottom: 1px solid #f5f5f5;
|
||||
}
|
||||
|
||||
.info-item .label {
|
||||
color: #666;
|
||||
width: 160rpx;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.info-item .value {
|
||||
color: #333;
|
||||
flex: 1;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.popup-footer {
|
||||
padding: 20rpx 30rpx 30rpx;
|
||||
border-top: 1px solid #eee;
|
||||
}
|
||||
|
||||
.btn-detail {
|
||||
width: 100%;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
background: #007AFF;
|
||||
color: #FFFFFF;
|
||||
font-size: 30rpx;
|
||||
border-radius: 40rpx;
|
||||
border: none;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -31,7 +31,7 @@
|
|||
<view class="boxitem_left">
|
||||
<image src="../../static/me_icon_shebei.png" mode=""></image>
|
||||
<view class="zl">
|
||||
运维记录
|
||||
站点运维
|
||||
</view>
|
||||
</view>
|
||||
<image src="../../static/me_icon_in.png" mode=""></image>
|
||||
|
|
@ -78,14 +78,31 @@
|
|||
});
|
||||
},
|
||||
onShow() {
|
||||
api.checkLogin(()=>{
|
||||
this.getuserInfo();
|
||||
}, () => {
|
||||
uni.reLaunch({
|
||||
url:'/packDetail/pages/login/login'
|
||||
})
|
||||
});
|
||||
|
||||
if(uni.getStorageSync('third_session')){
|
||||
uni.login({
|
||||
success: function (res) {
|
||||
this.code = res.code
|
||||
let params = {}
|
||||
params.jsCode = this.code
|
||||
api.wxlogin(params).then(res=>{
|
||||
if(res.data.code == 0){
|
||||
let userInfo = res.data.data;
|
||||
// uni.setStorageSync('third_session', userInfo.thirdSession);
|
||||
if(!userInfo.id){
|
||||
uni.reLaunch({
|
||||
url:'/packDetail/pages/login/login'
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
}else if(!uni.getStorageSync('third_session')){
|
||||
uni.reLaunch({
|
||||
url:'/packDetail/pages/login/login'
|
||||
})
|
||||
}
|
||||
this.getuserInfo()
|
||||
},
|
||||
methods: {
|
||||
getuserInfo(){
|
||||
|
|
|
|||
Binary file not shown.
|
Before Width: | Height: | Size: 1.9 KiB |
Loading…
Reference in New Issue