.
This commit is contained in:
parent
b7bb7a4ef2
commit
9287a5f6c0
@ -10,7 +10,7 @@
|
||||
:change:mapType="leaflet.switchLayerEmitHandler" :centerPoint="mapObj.centerPoint"
|
||||
:change:centerPoint="leaflet.centerPointEmitHandler" :landMap="mapObj.landMap"
|
||||
:change:landMap="leaflet.drawEmitHandler" :davice="mapObj.davice" :change:davice="leaflet.markerEmitHandler"
|
||||
:updateMarker="mapObj.updateMarker" :change:updateMarker="leaflet.updateMarkerEmitHandler">
|
||||
:updateMarker="mapObj.updateMarker" :change:updateMarker="leaflet.updateMarkerEmitHandler"
|
||||
</view>
|
||||
|
||||
<!-- 工具 -->
|
||||
@ -23,6 +23,9 @@
|
||||
<view @click="mapToCenterPoint">
|
||||
<i class="iconfont icon-dingwei"></i>
|
||||
</view>
|
||||
<view @click="navigation">
|
||||
<i class="iconfont icon-luxian"></i>
|
||||
</view>
|
||||
</view>
|
||||
<view class="tdt">
|
||||
<image src="../static/images/map/logo.png"></image>GS(2024)0568号 - 甲测资字1100471
|
||||
@ -125,7 +128,7 @@
|
||||
</view>
|
||||
<view class="control" v-if="dc.dataObj[pop.item.dataKey]">
|
||||
<u-row v-if="pop.item.device.deviceTypeKey == 'station'">
|
||||
基站
|
||||
<image :src="valveImg.jz" mode="widthFix" />
|
||||
</u-row>
|
||||
<u-row v-else-if="pop.item.device.deviceTypeKey == 'valve'">
|
||||
<u-col span="3">
|
||||
@ -381,56 +384,58 @@
|
||||
未知的设备
|
||||
</u-row>
|
||||
</view>
|
||||
<view class="expand5" @click="pop.showbox = !pop.showbox">
|
||||
<view class="icon">
|
||||
<view class="iconfont icon-jt-b"></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="box" :class="[pop.showbox ? 'show':'hide']">
|
||||
<view class="card">
|
||||
<view class="title fixed">
|
||||
<view class="text" style="min-width: 25px;">
|
||||
水压趋势(kPa)
|
||||
</view>
|
||||
<view>更多<span class="iconfont icon-you"></span></view>
|
||||
</view>
|
||||
<view class="tip">设备仅采集已打开的出水口水压</view>
|
||||
<view class="pressure">
|
||||
<view>①口</view>
|
||||
<view>
|
||||
<view>放图表</view>
|
||||
<span>近2小时暂无水压变化</span>
|
||||
</view>
|
||||
</view>
|
||||
<view class="pressure">
|
||||
<view>①口</view>
|
||||
<view>
|
||||
<view>放图表</view>
|
||||
</view>
|
||||
<view v-if="pop.item.type != 'jz'">
|
||||
<view class="expand5" @click="pop.showbox = !pop.showbox">
|
||||
<view class="icon">
|
||||
<view class="iconfont icon-jt-b"></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="card" style="overflow: hidden;">
|
||||
<view class="title fixed">
|
||||
<view class="text" style="min-width: 25px;">
|
||||
最近操作
|
||||
<view class="box" :class="[pop.showbox ? 'show':'hide']">
|
||||
<view class="card">
|
||||
<view class="title fixed">
|
||||
<view class="text" style="min-width: 25px;">
|
||||
水压趋势(kPa)
|
||||
</view>
|
||||
<view>更多<span class="iconfont icon-you"></span></view>
|
||||
</view>
|
||||
<view @click="operationLog(pop.item)">
|
||||
更多<span class="iconfont icon-you"></span>
|
||||
</view>
|
||||
</view>
|
||||
<view class="text-list" v-if="dc.dataObj[pop.item.dataKey]"
|
||||
v-for="item in dc.dataObj[pop.item.dataKey].latestOperation">
|
||||
<view>
|
||||
<view class="tip">设备仅采集已打开的出水口水压</view>
|
||||
<view class="pressure">
|
||||
<view>①口</view>
|
||||
<view>
|
||||
{{`${item.valveOutletNo}口,${item.operContent}`}}
|
||||
</view>
|
||||
<view class="font-green">
|
||||
{{item.operResult ? '【成功】' : '【失败】'}}
|
||||
<view>放图表</view>
|
||||
<span>近2小时暂无水压变化</span>
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<view>操作人:{{item.userName}}</view>
|
||||
<view>{{formatData(item.time)}}</view>
|
||||
<view class="pressure">
|
||||
<view>①口</view>
|
||||
<view>
|
||||
<view>放图表</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="card" style="overflow: hidden;">
|
||||
<view class="title fixed">
|
||||
<view class="text" style="min-width: 25px;">
|
||||
最近操作
|
||||
</view>
|
||||
<view @click="operationLog(pop.item)">
|
||||
更多<span class="iconfont icon-you"></span>
|
||||
</view>
|
||||
</view>
|
||||
<view class="text-list" v-if="dc.dataObj[pop.item.dataKey]"
|
||||
v-for="item in dc.dataObj[pop.item.dataKey].latestOperation">
|
||||
<view>
|
||||
<view>
|
||||
{{`${item.valveOutletNo}口,${item.operContent}`}}
|
||||
</view>
|
||||
<view class="font-green">
|
||||
{{item.operResult ? '【成功】' : '【失败】'}}
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<view>操作人:{{item.userName}}</view>
|
||||
<view>{{formatData(item.time)}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -450,6 +455,8 @@
|
||||
<custom-index-mp ref="mpRef" />
|
||||
</template>
|
||||
<script>
|
||||
import config from '@/config.js'
|
||||
const appInfo = config.appInfo;
|
||||
import store from "@/store"
|
||||
import {
|
||||
timestampFormat
|
||||
@ -461,6 +468,14 @@
|
||||
import {
|
||||
getOtherDevice
|
||||
} from "@/api/system/controlOtherInterface"
|
||||
// 引入插件包
|
||||
import {
|
||||
requestPermissions
|
||||
} from "@/js_sdk/yu-app-permission/yu-app-permission.js"
|
||||
// 前往设置页面 兼容安卓以及IOS
|
||||
import {
|
||||
goSetting
|
||||
} from "@/js_sdk/yu-app-permission/yu-app-permission.js"
|
||||
|
||||
export default {
|
||||
data() {
|
||||
@ -683,6 +698,40 @@
|
||||
//去中心点
|
||||
mapToCenterPoint() {
|
||||
this.mapObj.centerPoint++;
|
||||
},
|
||||
//导航
|
||||
navigation() {
|
||||
this.$showConfirm(`导航至"${this.title}"?`).then(res => {
|
||||
if (res.confirm) {
|
||||
const centerPoint = JSON.parse(this.mapObj.landMap.centerPoint);
|
||||
const lat = centerPoint[1]
|
||||
const lng = centerPoint[0]
|
||||
let url = '';
|
||||
const appName = appInfo.name; // 替换为你的应用名
|
||||
const name = this.title; // 名称
|
||||
// 高德地图
|
||||
if (uni.getSystemInfoSync().platform === 'android') { // Android 平台
|
||||
url =
|
||||
`androidamap://route/plan/?sourceApplication=${appName}&sid=BGVIS1&did=BGVIS2&dlat=${lat}&dlon=${lng}&dname=${encodeURIComponent(name)}&mode=driving`;
|
||||
// `androidamap://route/plan/?sourceApplication=${appName}&sid=BGVIS1&did=BGVIS2&dlat=${lat}&dlon=${lng}&mode=driving`;
|
||||
} else if (uni.getSystemInfoSync().platform === 'ios') { // iOS 平台
|
||||
url = `iosamap://path?sourceApplication=${appName}&mldl=${lat},${lng}`;
|
||||
}
|
||||
|
||||
// // 百度地图 mode:driving:驾车模式。walking:步行模式。transit:公交模式。
|
||||
// url = `baidumap://map/direction?destination=latlng:${lat},${lng}|name:${encodeURIComponent(name)}&mode=driving`;
|
||||
// 尝试打开地图
|
||||
plus.runtime.openURL(url, function(err) {
|
||||
uni.showToast({
|
||||
title: '未安装应用',
|
||||
icon: 'none'
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
toNavigation() {
|
||||
|
||||
},
|
||||
//设备状态更新
|
||||
mapUpdateMarker(e) {
|
||||
@ -720,55 +769,64 @@
|
||||
break;
|
||||
case 'sfj':
|
||||
case 'sb':
|
||||
uni.showLoading()
|
||||
getHeadDevice(e.device.deviceId).then((res) => {
|
||||
uni.hideLoading()
|
||||
if (res.data.deviceTypeId === 4) {
|
||||
if (res.data.controlMode == 1) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/head/fertilizerapplicator/detail?item=${JSON.stringify(res.data)}`,
|
||||
});
|
||||
} else if (item.controlMode == 2) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/head/fertilizerapplicator/detailkl?item=${JSON.stringify(res.data)}`,
|
||||
});
|
||||
} else {}
|
||||
} else if (res.data.deviceTypeId === 5) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/head/headdevice/detail?item=${JSON.stringify(res.data)}`,
|
||||
this.$showConfirm("确定打开首部设备?").then(res => {
|
||||
if (res.confirm) {
|
||||
uni.showLoading()
|
||||
getHeadDevice(e.device.deviceId).then((res) => {
|
||||
uni.hideLoading()
|
||||
if (res.data.deviceTypeId === 4) {
|
||||
if (res.data.controlMode == 1) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/head/fertilizerapplicator/detail?item=${JSON.stringify(res.data)}`,
|
||||
});
|
||||
} else if (item.controlMode == 2) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/head/fertilizerapplicator/detailkl?item=${JSON.stringify(res.data)}`,
|
||||
});
|
||||
} else {}
|
||||
} else if (res.data.deviceTypeId === 5) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/head/headdevice/detail?item=${JSON.stringify(res.data)}`,
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
break;
|
||||
case 'qxz':
|
||||
case 'bc':
|
||||
case 'bz':
|
||||
case 'sxt':
|
||||
case 'scd':
|
||||
uni.showLoading()
|
||||
getOtherDevice(e.device.deviceId).then((res) => {
|
||||
uni.hideLoading()
|
||||
let url = null;
|
||||
if (res.data.deviceTypeId === 6) {
|
||||
url =
|
||||
`/pages/fourmonitor/weatherstation?item=${encodeURIComponent(JSON.stringify(res.data))}`;
|
||||
} else if (res.data.deviceTypeId === 7) {
|
||||
url =
|
||||
`/pages/fourmonitor/pest?item=${encodeURIComponent(JSON.stringify(res.data))}`;
|
||||
} else if (res.data.deviceTypeId === 8) {
|
||||
url =
|
||||
`/pages/fourmonitor/spore?item=${encodeURIComponent(JSON.stringify(res.data))}`;
|
||||
} else if (res.data.deviceTypeId === 9) {
|
||||
if (!res.data.ezopenUrl1 || !res.data.ezopenUrl2) {
|
||||
this.$toast("获取播放地址失败!")
|
||||
return;
|
||||
}
|
||||
url =
|
||||
`/pages/fourmonitor/camera?item=${encodeURIComponent(JSON.stringify(res.data))}`;
|
||||
} else if (res.data.deviceTypeId === 10) {}
|
||||
if (url) {
|
||||
uni.navigateTo({
|
||||
url: url,
|
||||
this.$showConfirm("确定打开农情设备?").then(res => {
|
||||
if (res.confirm) {
|
||||
uni.showLoading()
|
||||
getOtherDevice(e.device.deviceId).then((res) => {
|
||||
uni.hideLoading()
|
||||
let url = null;
|
||||
if (res.data.deviceTypeId === 6) {
|
||||
url =
|
||||
`/pages/fourmonitor/weatherstation?item=${encodeURIComponent(JSON.stringify(res.data))}`;
|
||||
} else if (res.data.deviceTypeId === 7) {
|
||||
url =
|
||||
`/pages/fourmonitor/pest?item=${encodeURIComponent(JSON.stringify(res.data))}`;
|
||||
} else if (res.data.deviceTypeId === 8) {
|
||||
url =
|
||||
`/pages/fourmonitor/spore?item=${encodeURIComponent(JSON.stringify(res.data))}`;
|
||||
} else if (res.data.deviceTypeId === 9) {
|
||||
if (!res.data.ezopenUrl1 || !res.data.ezopenUrl2) {
|
||||
this.$toast("获取播放地址失败!")
|
||||
return;
|
||||
}
|
||||
url =
|
||||
`/pages/fourmonitor/camera?item=${encodeURIComponent(JSON.stringify(res.data))}`;
|
||||
} else if (res.data.deviceTypeId === 10) {}
|
||||
if (url) {
|
||||
uni.navigateTo({
|
||||
url: url,
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user