aa
This commit is contained in:
parent
a1e8dae4c8
commit
7dc749ddde
|
@ -6,7 +6,7 @@
|
|||
<view class="mapbox">
|
||||
<map class="map" id="map" ref="map" :scale="zoomSize" :latitude="latitude" :longitude="longitude"
|
||||
:show-location='true' :markers="covers"> </map>
|
||||
<view class="fxmask">
|
||||
<view class="fxmask" v-if="dtflag">
|
||||
未找到位置信息
|
||||
</view>
|
||||
<!-- <view class="btn" @click="showwl = true">
|
||||
|
@ -67,10 +67,10 @@
|
|||
</view>
|
||||
</view>
|
||||
<view class="setbox">
|
||||
<view class="setcard">
|
||||
<view class="setcard" @click="btnyj">
|
||||
<view class="top">
|
||||
<view class="left">
|
||||
预警设置
|
||||
预警记录
|
||||
</view>
|
||||
<view class="right iconfont icon-xiangyou1">
|
||||
|
||||
|
@ -378,7 +378,8 @@
|
|||
},
|
||||
daytime:'',
|
||||
covers: [],
|
||||
}
|
||||
dtflag:false
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
this.beehiveId = option.beehiveId
|
||||
|
@ -413,6 +414,11 @@
|
|||
this.getchartData6()
|
||||
},
|
||||
methods: {
|
||||
btnyj(){
|
||||
uni.navigateTo({
|
||||
url:'/page_Beehive/Beehive_woring?apiaryId=' + this.beehiveId + '&tit=' + '蜂箱预警记录'
|
||||
})
|
||||
},
|
||||
btnedit(){
|
||||
this.menuflag = false
|
||||
uni.navigateTo({
|
||||
|
@ -635,7 +641,9 @@
|
|||
if(res.data.lat == 0 && res.data.lng == 0){
|
||||
console.log('未找到位置信息');
|
||||
this.zoomSize = 5
|
||||
this.dtflag = true
|
||||
}else{
|
||||
this.dtflag = false
|
||||
this.covers.push({
|
||||
id: parseFloat(res.data.beehiveId),
|
||||
latitude: res.data.lat,
|
||||
|
|
|
@ -154,9 +154,7 @@
|
|||
{
|
||||
title: '换位置',
|
||||
type: 7
|
||||
},
|
||||
|
||||
],
|
||||
}],
|
||||
textValue: '',
|
||||
currentCount: 0,
|
||||
showxy: false,
|
||||
|
|
|
@ -5,18 +5,18 @@
|
|||
</u-navbar>
|
||||
<view class="top">
|
||||
<view class="top_left">
|
||||
福鼎蜂场
|
||||
{{apiaryName}}
|
||||
</view>
|
||||
<view class="top_right">
|
||||
其他蜂场 <view class="iconfont icon-xiangyou1" style="font-size: 40rpx;">
|
||||
|
||||
<view class="top_right" @click="showmiyuan = true">
|
||||
{{yjtxt}} <view class="iconfont icon-xiangyou1" style="font-size: 40rpx;">
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cont_box">
|
||||
<view class="left">
|
||||
<view class="left_cont_box" v-for="(item, index) in tabs" :key="index" @click="changeTag(index)"
|
||||
:class="currentIndex === index ? 'act4' : ''">
|
||||
<view class="left_cont_box" v-for="(item, index) in tabs" :key="index"
|
||||
@click="changeTag(index,item.type)" :class="currentIndex === index ? 'act4' : ''">
|
||||
<view class="left_cont" :class="[
|
||||
index=== currentIndex? 'act1' : '',
|
||||
index + 1 === currentIndex? 'act2' : '',
|
||||
|
@ -26,49 +26,83 @@
|
|||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="right">
|
||||
<view class="right_cont">
|
||||
<scroll-view class="right" v-if="wuflag" scroll-y="true" @scrolltolower="loadMore">
|
||||
<view class="right_cont" v-for="(item,index) in rzlist" :key="index">
|
||||
<view class="right_cont_top">
|
||||
<view class="cont_left">
|
||||
|
||||
<image src="https://api.ccttiot.com/smartmeter/img/static/uKzdmSTqoFrM6nlxTLGr" mode=""></image>
|
||||
<view class="txt">
|
||||
4%
|
||||
<image src="https://api.ccttiot.com/smartmeter/img/static/uKzdmSTqoFrM6nlxTLGr" mode="">
|
||||
</image>
|
||||
<view class="txt" v-if="item.type == 1">
|
||||
{{item.realValue}}°C
|
||||
</view>
|
||||
<view class="txt" v-if="item.type == 2">
|
||||
{{item.realValue}}%
|
||||
</view>
|
||||
<view class="txt" v-if="item.type == 3">
|
||||
{{item.realValue}}g
|
||||
</view>
|
||||
<view class="txt" v-if="item.type == 4">
|
||||
{{item.realValue}}%
|
||||
</view>
|
||||
<view class="txt" v-if="item.type == 5">
|
||||
{{item.realValue}}只
|
||||
</view>
|
||||
<view class="txt" v-if="item.type == 6">
|
||||
{{item.realValue}}
|
||||
</view>
|
||||
<view class="txt" v-if="item.type == 7">
|
||||
{{item.realValue}}Km
|
||||
</view>
|
||||
<view class="txt" v-if="item.type == 8">
|
||||
异常
|
||||
</view>
|
||||
</view>
|
||||
<view class="cont_right">
|
||||
<!-- <view class="btn1">
|
||||
<view class="btn1" @click="btnzdl(item.recordId)" v-if="item.status == 1">
|
||||
知道了
|
||||
</view> -->
|
||||
<view class="btn2">
|
||||
</view>
|
||||
<view class="btn2" v-else>
|
||||
已读
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
</view>
|
||||
<view class="cont">
|
||||
<image src="https://api.ccttiot.com/smartmeter/img/static/uelHshjG1nuq3RacsYEY" mode=""></image>
|
||||
<view class="txt1">
|
||||
福鼎蜂场-001
|
||||
<view class="txt1" v-if="title == '蜂箱预警记录'">
|
||||
{{item.apiaryName}}
|
||||
</view>
|
||||
<view class="txt1" v-else>
|
||||
{{item.beehiveName}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="cont">
|
||||
|
||||
<view class="txt2">
|
||||
温度过低
|
||||
{{item.msg}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="cont" style="margin-top: 26rpx;">
|
||||
<view class="">
|
||||
|
||||
|
||||
</view>
|
||||
<view class="txt3">
|
||||
2024-05-15 15:23:56
|
||||
{{item.createTime}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</scroll-view>
|
||||
|
||||
<view class="no_cont" v-else>
|
||||
<view class="img">
|
||||
<image src="https://api.ccttiot.com/smartmeter/img/static/uUZ3MF84e3bKgwAei8Rz" mode=""></image>
|
||||
</view>
|
||||
<view class="txt">
|
||||
当前暂无预警记录...
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<u-select v-model="showmiyuan" :list="fclist" title='选择蜂场' @confirm="confirmmy"></u-select>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
@ -79,90 +113,254 @@
|
|||
bgc: {
|
||||
backgroundColor: " #F4FAF8",
|
||||
},
|
||||
title: "蜂箱预警",
|
||||
showmiyuan: false,
|
||||
title: "蜂箱预警记录",
|
||||
currentIndex: 0,
|
||||
imglist: [],
|
||||
token: '',
|
||||
sn:'',
|
||||
upurl:'',
|
||||
wuflag: false,
|
||||
yjtxt:'',
|
||||
tabs: [{
|
||||
title: '京东超市',
|
||||
title: '全部',
|
||||
type: null
|
||||
},
|
||||
{
|
||||
title: '男装',
|
||||
title: '温度',
|
||||
type: 1
|
||||
},
|
||||
{
|
||||
title: '奢侈品',
|
||||
title: '湿度',
|
||||
type: 2
|
||||
},
|
||||
{
|
||||
title: '女装',
|
||||
title: '重量',
|
||||
type: 3
|
||||
},
|
||||
{
|
||||
title: '鞋靴',
|
||||
title: '电量',
|
||||
type: 4
|
||||
},
|
||||
{
|
||||
title: '内衣饰品',
|
||||
imageSrc: ''
|
||||
title: '进出量',
|
||||
type: 5
|
||||
},
|
||||
{
|
||||
title: '箱包',
|
||||
imageSrc: ''
|
||||
},
|
||||
{
|
||||
title: '美妆护肤',
|
||||
imageSrc: ''
|
||||
},
|
||||
|
||||
title: '声音',
|
||||
type: 6
|
||||
}, {
|
||||
title: '电子围栏',
|
||||
type: 7
|
||||
}, {
|
||||
title: '定位异常',
|
||||
type: 8
|
||||
}
|
||||
],
|
||||
textValue: '',
|
||||
currentCount: 0,
|
||||
showxy: false,
|
||||
apiaryId: '',
|
||||
beehiveId: '',
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
rzlist: [],
|
||||
fclist: [],
|
||||
apiaryName: '',
|
||||
type: null,
|
||||
total: 0,
|
||||
imglist: []
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
onLoad(option) {
|
||||
|
||||
this.apiaryId = option.apiaryId
|
||||
this.title = option.tit
|
||||
},
|
||||
onShow() {
|
||||
this.pageNum = 1
|
||||
this.rzlist = []
|
||||
if (this.title == '蜂箱预警记录') {
|
||||
this.yjtxt = '该蜂场其他蜂箱'
|
||||
this.getfx()
|
||||
this.getyuj()
|
||||
} else {
|
||||
this.yjtxt = '其他蜂场'
|
||||
this.getfc()
|
||||
this.getyuj()
|
||||
}
|
||||
|
||||
},
|
||||
methods: {
|
||||
changeTag(idx){
|
||||
this.currentIndex=idx
|
||||
|
||||
loadMore() {
|
||||
if (this.rzlist.length < this.total) {
|
||||
this.getyuj()
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '没有更多预警记录了',
|
||||
icon: 'none',
|
||||
duration: 1000
|
||||
})
|
||||
}
|
||||
},
|
||||
btn() {
|
||||
let _this = this
|
||||
let math = 'static/' + _this.$u.guid(20)
|
||||
uni.chooseImage({
|
||||
count: 9,
|
||||
type: 'all',
|
||||
success(res) {
|
||||
// tempFilePath可以作为img标签的src属性显示图片
|
||||
const tempFilePaths = res.tempFiles
|
||||
// let tempFilePaths = chooseImageRes.tempFilePaths;
|
||||
// console.log(tempFilePaths)
|
||||
// tempFilePaths.forEach(item=>{
|
||||
// // 上传图片到七牛云
|
||||
|
||||
// })
|
||||
wx.uploadFile({
|
||||
url: 'https://up-z2.qiniup.com',
|
||||
name: 'file',
|
||||
filePath: tempFilePaths[0].path,
|
||||
formData: {
|
||||
token: _this.token, //后端返回的token
|
||||
key: 'smartmeter/img/' + math
|
||||
},
|
||||
success: function(res) {
|
||||
console.log(res,'resres');
|
||||
let str = JSON.parse(res.data)
|
||||
console.log(str.key)
|
||||
_this.userImgs = _this.upurl +'/'+ str.key
|
||||
console.log(_this.userImgs)
|
||||
_this.imglist.push(_this.userImgs)
|
||||
confirmmy(e) {
|
||||
this.rzlist = []
|
||||
this.pageNum = 1
|
||||
this.apiaryId = e[0].value
|
||||
this.apiaryName = e[0].label
|
||||
this.getyuj()
|
||||
},
|
||||
// 点击处理预警
|
||||
btnzdl(recordId) {
|
||||
this.$u.put(`/farm/record/warn/${recordId}/read`).then(res => {
|
||||
if (res.code == 200) {
|
||||
uni.showToast({
|
||||
title: '处理成功',
|
||||
icon: 'success',
|
||||
duration: 1000
|
||||
})
|
||||
this.rzlist.forEach(item => {
|
||||
if (item.recordId == recordId) {
|
||||
item.status = 2
|
||||
}
|
||||
});
|
||||
})
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none',
|
||||
duration: 1000
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
|
||||
// 请求蜂箱
|
||||
getfx() {
|
||||
this.$u.get(`/farm/beehive/listAll`).then(res => {
|
||||
if (res.code == 200) {
|
||||
if (res.data.length >= 1) {
|
||||
res.data.forEach(item => {
|
||||
if (item.beehiveId == this.apiaryId) {
|
||||
this.apiaryName = item.name
|
||||
}
|
||||
})
|
||||
this.fclist = res.data.map(item => ({
|
||||
value: item.beehiveId,
|
||||
label: item.name
|
||||
}))
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
// 请求蜂场
|
||||
getfc() {
|
||||
this.$u.get(`/farm/apiary/listAll`).then(res => {
|
||||
if (res.code == 200) {
|
||||
if (res.data.length >= 1) {
|
||||
res.data.forEach(item => {
|
||||
if (item.apiaryId == this.apiaryId) {
|
||||
this.apiaryName = item.name
|
||||
}
|
||||
})
|
||||
this.fclist = res.data.map(item => ({
|
||||
value: item.apiaryId,
|
||||
label: item.name
|
||||
}))
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
// 请求预警
|
||||
getyuj() {
|
||||
if (this.title == '蜂箱预警记录') {
|
||||
let queryParams = {
|
||||
pageNum: this.pageNum,
|
||||
pageSize: this.pageSize,
|
||||
beehiveId: this.apiaryId,
|
||||
type: this.type
|
||||
};
|
||||
if (this.type == null) {
|
||||
delete queryParams.type;
|
||||
}
|
||||
let queryString = Object.keys(queryParams).filter(key => queryParams[key] != null).map(key =>
|
||||
`${encodeURIComponent(key)}=${encodeURIComponent(queryParams[key])}`).join('&')
|
||||
this.$u.get(`/farm/record/warn/list?${queryString}`).then(res => {
|
||||
if (res.code == 200) {
|
||||
this.total = res.total
|
||||
if (res.total < 1) {
|
||||
this.wuflag = false
|
||||
} else {
|
||||
this.pageNum++
|
||||
this.wuflag = true
|
||||
if (this.type == null) {
|
||||
this.rzlist = [...this.rzlist, ...res.rows.map(row => ({
|
||||
...row,
|
||||
}))]
|
||||
} else {
|
||||
let existingBeehiveIds = new Set(this.rzlist.filter(row => row.type == this
|
||||
.type).map(row => row.id));
|
||||
let filteredAndDeduplicatedNewRows = res.rows.filter(row => row.type == this
|
||||
.type).filter(row => !existingBeehiveIds.has(row.id)).map(row => ({
|
||||
...row,
|
||||
}));
|
||||
this.rzlist = [...this.rzlist.filter(row => row.type == this.type), ...
|
||||
filteredAndDeduplicatedNewRows
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
} else {
|
||||
let queryParams = {
|
||||
pageNum: this.pageNum,
|
||||
pageSize: this.pageSize,
|
||||
apiaryId: this.apiaryId,
|
||||
type: this.type
|
||||
};
|
||||
if (this.type == null) {
|
||||
delete queryParams.type;
|
||||
}
|
||||
let queryString = Object.keys(queryParams).filter(key => queryParams[key] != null).map(key =>
|
||||
`${encodeURIComponent(key)}=${encodeURIComponent(queryParams[key])}`).join('&')
|
||||
this.$u.get(`/farm/record/warn/list?${queryString}`).then(res => {
|
||||
if (res.code == 200) {
|
||||
this.total = res.total
|
||||
if (res.total < 1) {
|
||||
this.wuflag = false
|
||||
} else {
|
||||
this.pageNum++
|
||||
this.wuflag = true
|
||||
if (this.type == null) {
|
||||
this.rzlist = [...this.rzlist, ...res.rows.map(row => ({
|
||||
...row,
|
||||
}))]
|
||||
} else {
|
||||
let existingBeehiveIds = new Set(this.rzlist.filter(row => row.type == this
|
||||
.type).map(row => row.id));
|
||||
let filteredAndDeduplicatedNewRows = res.rows.filter(row => row.type == this
|
||||
.type).filter(row => !existingBeehiveIds.has(row.id)).map(row => ({
|
||||
...row,
|
||||
}));
|
||||
this.rzlist = [...this.rzlist.filter(row => row.type == this.type), ...
|
||||
filteredAndDeduplicatedNewRows
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
changeTag(idx, type) {
|
||||
if (idx == 0) {
|
||||
this.rzlist = []
|
||||
}
|
||||
this.pageNum = 1
|
||||
this.type = type
|
||||
this.currentIndex = idx
|
||||
this.getyuj()
|
||||
},
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
@ -172,10 +370,207 @@
|
|||
background-color: #F4FAF8;
|
||||
}
|
||||
|
||||
.addtj {
|
||||
width: 100%;
|
||||
height: 200rpx;
|
||||
// background-color: #FFCC25;
|
||||
// background-color: #fff;
|
||||
text-align: center;
|
||||
line-height: 90rpx;
|
||||
position: fixed;
|
||||
left: 220rpx;
|
||||
bottom: 0;
|
||||
font-size: 36rpx;
|
||||
padding-left: 80rpx;
|
||||
padding-top: 30rpx;
|
||||
box-sizing: border-box;
|
||||
|
||||
view {
|
||||
width: 336rpx;
|
||||
height: 88rpx;
|
||||
background-color: #FFCC25;
|
||||
text-align: center;
|
||||
line-height: 88rpx;
|
||||
color: #fff;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.page {
|
||||
// position: relative;
|
||||
width: 750rpx;
|
||||
.top{
|
||||
|
||||
.no_cont {
|
||||
margin: 152rpx auto 0;
|
||||
width: 432rpx;
|
||||
|
||||
.img {
|
||||
image {
|
||||
width: 432rpx;
|
||||
height: 432rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.txt {
|
||||
margin-top: 50rpx;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
font-weight: 500;
|
||||
font-size: 32rpx;
|
||||
color: #808080;
|
||||
}
|
||||
}
|
||||
|
||||
.set_log_box {
|
||||
padding: 50rpx 56rpx;
|
||||
|
||||
.btn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
position: fixed;
|
||||
left: 58rpx;
|
||||
bottom: 68rpx;
|
||||
width: 638rpx;
|
||||
height: 88rpx;
|
||||
background: #FFCC25;
|
||||
border-radius: 20rpx 20rpx 20rpx 20rpx;
|
||||
font-weight: 500;
|
||||
font-size: 32rpx;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.xy {
|
||||
margin-top: 46rpx;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-wrap: nowrap;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
.yuans {
|
||||
margin-top: 2rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 34rpx;
|
||||
height: 34rpx;
|
||||
border-radius: 50%;
|
||||
border: #808080 solid 2rpx;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 50%;
|
||||
}
|
||||
}
|
||||
|
||||
.txt {
|
||||
margin-left: 10rpx;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #808080;
|
||||
|
||||
span {
|
||||
color: #3D3D3D;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.input-container {
|
||||
position: relative;
|
||||
width: 612rpx;
|
||||
height: 172rpx;
|
||||
background: #FFFFFF;
|
||||
box-shadow: 0rpx 16rpx 40rpx 0rpx rgba(42, 130, 228, 0.1);
|
||||
border-radius: 20rpx;
|
||||
margin-top: 40rpx;
|
||||
overflow: hidden;
|
||||
padding-right: 38rpx;
|
||||
box-sizing: border-box;
|
||||
border: 2rpx solid #C7C7C7;
|
||||
}
|
||||
|
||||
.placeholder {
|
||||
position: absolute;
|
||||
top: 18rpx;
|
||||
left: 38rpx;
|
||||
color: #999;
|
||||
/* placeholder颜色 */
|
||||
pointer-events: none;
|
||||
/* 确保点击事件可以穿透到textarea上 */
|
||||
}
|
||||
|
||||
.custom-textarea {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
/* 设置一个合适高度 */
|
||||
padding-top: 18rpx;
|
||||
/* 为placeholder留出空间 */
|
||||
padding-left: 38rpx;
|
||||
box-sizing: border-box;
|
||||
border: 1px solid #ccc;
|
||||
}
|
||||
|
||||
.word-count {
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
bottom: 10px;
|
||||
font-size: 12px;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.icon {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
margin-top: 40rpx;
|
||||
|
||||
.imgbox {
|
||||
width: 33%;
|
||||
|
||||
image {
|
||||
width: 222rpx;
|
||||
height: 222rpx;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.tit {
|
||||
font-weight: 600;
|
||||
font-size: 36rpx;
|
||||
color: #3D3D3D;
|
||||
}
|
||||
|
||||
.set_type_box {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
|
||||
// margin-top: 26rpx;
|
||||
.type_li {
|
||||
margin-top: 26rpx;
|
||||
margin-right: 18rpx;
|
||||
padding: 12rpx 50rpx;
|
||||
background: #FFF5D6;
|
||||
border-radius: 12rpx 12rpx 12rpx 12rpx;
|
||||
border: 2rpx solid #FFC107;
|
||||
font-weight: 500;
|
||||
font-size: 32rpx;
|
||||
color: #3D3D3D;
|
||||
}
|
||||
|
||||
.act1 {
|
||||
background: #FFC107;
|
||||
border-radius: 12rpx 12rpx 12rpx 12rpx;
|
||||
border: 2rpx solid #FFC107;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.top {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
|
@ -184,14 +579,16 @@
|
|||
width: 658rpx;
|
||||
height: 106rpx;
|
||||
background: #FFFFFF;
|
||||
box-shadow: 0rpx 0rpx 8rpx 0rpx rgba(0,0,0,0.15);
|
||||
box-shadow: 0rpx 0rpx 8rpx 0rpx rgba(0, 0, 0, 0.15);
|
||||
border-radius: 20rpx 20rpx 20rpx 20rpx;
|
||||
.top_left{
|
||||
|
||||
.top_left {
|
||||
font-weight: 600;
|
||||
font-size: 36rpx;
|
||||
color: #3D3D3D;
|
||||
}
|
||||
.top_right{
|
||||
|
||||
.top_right {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: nowrap;
|
||||
|
@ -200,6 +597,7 @@
|
|||
color: #808080;
|
||||
}
|
||||
}
|
||||
|
||||
.cont_box {
|
||||
margin-top: 26rpx;
|
||||
display: flex;
|
||||
|
@ -207,18 +605,19 @@
|
|||
|
||||
.left {
|
||||
margin-left: 48rpx;
|
||||
width: 216rpx;
|
||||
width: 200rpx;
|
||||
|
||||
.left_cont_box {
|
||||
width: 216rpx;
|
||||
width: 200rpx;
|
||||
height: 100rpx;
|
||||
background: #fff;
|
||||
|
||||
.left_cont {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 216rpx;
|
||||
// justify-content: center;
|
||||
padding-left: 30rpx;
|
||||
width: 200rpx;
|
||||
height: 100rpx;
|
||||
font-weight: 600;
|
||||
font-size: 36rpx;
|
||||
|
@ -227,7 +626,7 @@
|
|||
|
||||
// border-radius: 0rpx 40rpx 40rpx 0rpx;
|
||||
// border: 1rpx solid #fff;
|
||||
|
||||
|
||||
}
|
||||
|
||||
.act1 {
|
||||
|
@ -251,70 +650,86 @@
|
|||
}
|
||||
|
||||
}
|
||||
.right{
|
||||
|
||||
.right {
|
||||
padding: 16rpx;
|
||||
margin-left: -10rpx;
|
||||
width: 100%;
|
||||
height: 100vn;
|
||||
height: 92vh;
|
||||
background: #fff;
|
||||
.right_cont{
|
||||
overflow: scroll;
|
||||
padding-bottom: 200rpx;
|
||||
box-sizing: border-box;
|
||||
|
||||
.right_cont {
|
||||
margin-top: 20rpx;
|
||||
padding: 20rpx 26rpx;
|
||||
width: 462rpx;
|
||||
height: 242rpx;
|
||||
height: 260rpx;
|
||||
background: #F6F6F6;
|
||||
border-radius: 20rpx 20rpx 20rpx 20rpx;
|
||||
.cont{
|
||||
|
||||
.cont {
|
||||
margin-top: 10rpx;
|
||||
display: flex;
|
||||
flex-wrap: nowrap;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
padding-left: 80rpx;
|
||||
image{
|
||||
width: 18rpx;
|
||||
|
||||
image {
|
||||
width: 22rpx;
|
||||
height: 22rpx;
|
||||
}
|
||||
.txt1{
|
||||
|
||||
.txt1 {
|
||||
margin-left: 8rpx;
|
||||
font-weight: 400;
|
||||
font-size: 26rpx;
|
||||
color: #4D4D4D;
|
||||
}
|
||||
.txt2{
|
||||
|
||||
.txt2 {
|
||||
font-weight: 600;
|
||||
font-size: 28rpx;
|
||||
color: #3D3D3D;
|
||||
}
|
||||
.txt3{
|
||||
|
||||
.txt3 {
|
||||
margin-left: auto;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #808080;
|
||||
}
|
||||
}
|
||||
.right_cont_top{
|
||||
|
||||
.right_cont_top {
|
||||
display: flex;
|
||||
flex-wrap: nowrap;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
.cont_left{
|
||||
|
||||
.cont_left {
|
||||
display: flex;
|
||||
flex-wrap: nowrap;
|
||||
align-items: center;
|
||||
image{
|
||||
|
||||
image {
|
||||
width: 50rpx;
|
||||
height: 50rpx;
|
||||
}
|
||||
.txt{
|
||||
|
||||
.txt {
|
||||
margin-left: 34rpx;
|
||||
font-weight: 600;
|
||||
font-size: 36rpx;
|
||||
color: #3D3D3D;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
.cont_right{
|
||||
.btn1{
|
||||
|
||||
.cont_right {
|
||||
.btn1 {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
@ -326,7 +741,8 @@
|
|||
font-size: 28rpx;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
.btn2{
|
||||
|
||||
.btn2 {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
@ -341,6 +757,7 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
// border-radius: 40rpx 0 0 40rpx;
|
||||
// box-shadow: 0rpx 0rpx 8rpx 0rpx rgba(0, 0, 0, 0.15);
|
||||
}
|
||||
|
|
|
@ -39,10 +39,10 @@
|
|||
<view class="cont_img" style="margin-top: 15rpx;" @click="btnpage">
|
||||
<image src="https://api.ccttiot.com/smartmeter/img/static/urhdebIu3K8vqRb8leoH" mode=""></image>
|
||||
</view>
|
||||
<view class="cont_img" style="margin-top: 15rpx;">
|
||||
<view class="cont_img" style="margin-top: 15rpx;" @click="btnyj">
|
||||
<image src="https://api.ccttiot.com/smartmeter/img/static/uTcBaMpmiZwS63GPCMBZ" mode=""></image>
|
||||
<view class="tip">
|
||||
1
|
||||
{{apiaryobj.unReadWarnCount == undefined ? 0 : apiaryobj.unReadWarnCount}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="cont_img" style="margin-top: 25rpx;" @click="btncaozuo">
|
||||
|
@ -87,7 +87,7 @@
|
|||
<image src="https://api.ccttiot.com/smartmeter/img/static/ukN0K37DEPQQxFJ03Qi9" mode=""></image>
|
||||
</view>
|
||||
</view>
|
||||
<view class="setcard">
|
||||
<view class="setcard" @click="btnpageyj">
|
||||
<view class="top">
|
||||
<view class="left">
|
||||
预警设置
|
||||
|
@ -218,13 +218,26 @@
|
|||
|
||||
},
|
||||
methods: {
|
||||
// 跳转预警设置
|
||||
btnpageyj(){
|
||||
uni.navigateTo({
|
||||
url:'/pages/Apiary/early_Set ?apiaryId=' + this.apiaryId
|
||||
})
|
||||
},
|
||||
// 跳转预警记录
|
||||
btnyj(){
|
||||
uni.navigateTo({
|
||||
url:'/page_Beehive/Beehive_woring?apiaryId=' + this.apiaryId + '&tit=' + '蜂场预警记录'
|
||||
})
|
||||
},
|
||||
|
||||
// 请求指定蜂场蜂箱
|
||||
getMyLocation() {
|
||||
uni.getLocation({
|
||||
type: 'wgs84',
|
||||
success: (res) => {
|
||||
this.latitude = Number(res.latitude.toFixed(5)) - 0.004
|
||||
this.longitude = Number(res.longitude.toFixed(5)) + 0.004
|
||||
// this.latitude = Number(res.latitude.toFixed(5)) - 0.004
|
||||
// this.longitude = Number(res.longitude.toFixed(5)) + 0.004
|
||||
this.$u.get(`/farm/beehive/listByApiary/${this.apiaryId}`).then(
|
||||
res => {
|
||||
if (res.code == 200) {
|
||||
|
@ -322,6 +335,7 @@
|
|||
height: 30,
|
||||
iconPath: 'https://api.ccttiot.com/smartmeter/img/static/uYrX2QTRLdVVDTB3E5cp',
|
||||
})
|
||||
this.polygons[0].points = []
|
||||
let centerLat = res.data.lat
|
||||
let centerLon = res.data.lng
|
||||
let radius = res.data.radius
|
||||
|
|
|
@ -7,67 +7,87 @@
|
|||
|
||||
<view class="tit">
|
||||
蜂箱温度预警
|
||||
<u-switch v-model="checked"></u-switch>
|
||||
<u-switch v-model="form.enableTemperature" active-color="#FFC107"></u-switch>
|
||||
</view>
|
||||
<view class="iptbox" >
|
||||
<input type="text" class="ips" v-model="form.address" placeholder="请选择蜂场具体位置" placeholder-class="my-placeholder"
|
||||
<view class="iptbox" @click="btnfx(1)">
|
||||
<input type="text" class="ips" v-model="form.address" :placeholder="'低于' + form.minTemperature + '℃或高于' + form.maxTemperature + '℃时'" placeholder-class="my-placeholder"
|
||||
disabled />
|
||||
<image src="https://api.ccttiot.com/smartmeter/img/static/ugAdKZm5ZHZ4to1cDsNI" mode=""></image>
|
||||
</view>
|
||||
<view class="tit">
|
||||
蜂箱湿度预警
|
||||
<u-switch v-model="checked"></u-switch>
|
||||
<u-switch v-model="form.enableHumidity" active-color="#FFC107"></u-switch>
|
||||
</view>
|
||||
<view class="iptbox" >
|
||||
<input type="text" class="ips" v-model="form.address" placeholder="请选择蜂场具体位置" placeholder-class="my-placeholder"
|
||||
<view class="iptbox" @click="btnfx(2)">
|
||||
<input type="text" class="ips" v-model="form.address" :placeholder="'低于' + form.minHumidity + '℃或高于' + form.maxHumidity + '℃时'" placeholder-class="my-placeholder"
|
||||
disabled />
|
||||
<image src="https://api.ccttiot.com/smartmeter/img/static/ugAdKZm5ZHZ4to1cDsNI" mode=""></image>
|
||||
</view>
|
||||
<view class="tit">
|
||||
蜂箱重量预警
|
||||
<u-switch v-model="checked"></u-switch>
|
||||
<u-switch v-model="form.enableWeight" active-color="#FFC107"></u-switch>
|
||||
</view>
|
||||
<view class="iptbox" >
|
||||
<input type="text" class="ips" v-model="form.address" placeholder="请选择蜂场具体位置" placeholder-class="my-placeholder"
|
||||
<view class="iptbox" @click="btnfx(3)">
|
||||
<input type="text" class="ips" v-model="form.address" :placeholder="'低于' + form.minWeight + 'g或高于' + form.maxWeight + 'g时'" placeholder-class="my-placeholder"
|
||||
disabled />
|
||||
<image src="https://api.ccttiot.com/smartmeter/img/static/ugAdKZm5ZHZ4to1cDsNI" mode=""></image>
|
||||
</view>
|
||||
<view class="tit">
|
||||
蜂箱进出量预警
|
||||
<u-switch v-model="checked"></u-switch>
|
||||
<u-switch v-model="form.enableIo" active-color="#FFC107"></u-switch>
|
||||
</view>
|
||||
<view class="iptbox" >
|
||||
<input type="text" class="ips" v-model="form.address" placeholder="请选择蜂场具体位置" placeholder-class="my-placeholder"
|
||||
<view class="iptbox" @click="btnfx(4)">
|
||||
<input type="text" class="ips" v-model="form.address" :placeholder="'低于' + form.minIo + '只或高于' + form.maxIo + '只时'" placeholder-class="my-placeholder"
|
||||
disabled />
|
||||
<image src="https://api.ccttiot.com/smartmeter/img/static/ugAdKZm5ZHZ4to1cDsNI" mode=""></image>
|
||||
</view>
|
||||
<view class="tit">
|
||||
蜂箱电量预警
|
||||
<u-switch v-model="checked"></u-switch>
|
||||
<u-switch v-model="form.enablePower" active-color="#FFC107"></u-switch>
|
||||
</view>
|
||||
<view class="iptbox" >
|
||||
<input type="text" class="ips" v-model="form.address" placeholder="请选择蜂场具体位置" placeholder-class="my-placeholder"
|
||||
<view class="iptbox" @click="btnfx(5)">
|
||||
<input type="text" class="ips" v-model="form.address" :placeholder="'低于' + form.minPower + '%时'" placeholder-class="my-placeholder"
|
||||
disabled />
|
||||
<image src="https://api.ccttiot.com/smartmeter/img/static/ugAdKZm5ZHZ4to1cDsNI" mode=""></image>
|
||||
</view>
|
||||
<view class="tit">
|
||||
蜂箱频率预警
|
||||
<u-switch v-model="checked"></u-switch>
|
||||
<u-switch v-model="form.enableHz" active-color="#FFC107"></u-switch>
|
||||
</view>
|
||||
<view class="iptbox" >
|
||||
<input type="text" class="ips" v-model="form.address" placeholder="请选择蜂场具体位置" placeholder-class="my-placeholder"
|
||||
<view class="iptbox" @click="btnfx(6)">
|
||||
<input type="text" class="ips" v-model="form.address" :placeholder="'低于' + form.minHz + '或高于' + form.maxHz + '时'" placeholder-class="my-placeholder"
|
||||
disabled />
|
||||
<image src="https://api.ccttiot.com/smartmeter/img/static/ugAdKZm5ZHZ4to1cDsNI" mode=""></image>
|
||||
</view>
|
||||
<view class="tit">
|
||||
电子围栏范围预警
|
||||
<u-switch v-model="checked"></u-switch>
|
||||
<u-switch v-model="form.enableFence" active-color="#FFC107"></u-switch>
|
||||
</view>
|
||||
<view class="iptbox" >
|
||||
<input type="text" class="ips" v-model="form.address" placeholder="请选择蜂场具体位置" placeholder-class="my-placeholder"
|
||||
<view class="iptbox" @click="btnfx(7)">
|
||||
<input type="text" class="ips" v-model="form.address" :placeholder="'低于' + form.minFence + 'Km时'" placeholder-class="my-placeholder"
|
||||
disabled />
|
||||
<image src="https://api.ccttiot.com/smartmeter/img/static/ugAdKZm5ZHZ4to1cDsNI" mode=""></image>
|
||||
</view>
|
||||
|
||||
<!-- 弹窗 -->
|
||||
<view class="tanc" v-if="maskflag">
|
||||
<image src="https://api.ccttiot.com/smartmeter/img/static/uvvzP7sIDIFpA8ErtRaL" mode=""></image>
|
||||
<view class="top">
|
||||
蜂箱{{fxtxt}}预警范围
|
||||
</view>
|
||||
<view class="shuzhi">
|
||||
低于<input type="text" v-model="di"/> {{danwei}}或高于 <input type="text" v-model="gao"/> {{danwei}}时
|
||||
</view>
|
||||
<view class="anniu">
|
||||
<view class="qux" @click="btnqx">
|
||||
取消
|
||||
</view>
|
||||
<view class="qd" @click="btnqd">
|
||||
确定
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="mask" v-if="maskflag"></view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
@ -79,19 +99,79 @@
|
|||
bgc: {
|
||||
backgroundColor: " #F4FAF8",
|
||||
},
|
||||
title: "添加视频监控",
|
||||
checked:false
|
||||
|
||||
title: "预警设置",
|
||||
apiaryId:'',
|
||||
fxtxt:'',
|
||||
danwei:'',
|
||||
di:'',
|
||||
gao:'',
|
||||
form:{
|
||||
enableTemperature:false,
|
||||
enableHumidity:false,
|
||||
enableWeight:false,
|
||||
enableIo:false,
|
||||
enablePower:false,
|
||||
enableHz:false,
|
||||
enableFence:false,
|
||||
minTemperature:'',
|
||||
maxTemperature:'',
|
||||
minHumidity:'',
|
||||
maxHumidity:'',
|
||||
minWeight:'',
|
||||
maxWeight:'',
|
||||
minIo:'',
|
||||
maxIo:'',
|
||||
minPower:'',
|
||||
minHz:'',
|
||||
maxHz:'',
|
||||
minFence:'',
|
||||
},
|
||||
maskflag:false
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
|
||||
onLoad(option) {
|
||||
this.apiaryId = option.apiaryId
|
||||
this.getlist()
|
||||
},
|
||||
onShow() {
|
||||
|
||||
|
||||
},
|
||||
methods: {
|
||||
|
||||
btnqx(){
|
||||
this.maskflag = false
|
||||
},
|
||||
btnfx(num){
|
||||
this.maskflag = true
|
||||
if(num == 1){
|
||||
this.danwei = '℃'
|
||||
this.fxtxt = '温度'
|
||||
}else if(num == 2){
|
||||
this.danwei = '℃'
|
||||
this.fxtxt = '湿度'
|
||||
}else if(num == 5){
|
||||
this.danwei = '℃'
|
||||
this.fxtxt = '电量'
|
||||
} else if(num == 3){
|
||||
this.danwei = 'g'
|
||||
this.fxtxt = '重量'
|
||||
}else if(num == 4){
|
||||
this.danwei = '只'
|
||||
this.fxtxt = '进出量'
|
||||
}else if(num == 6){
|
||||
this.danwei = ''
|
||||
this.fxtxt = '频率'
|
||||
}else if(num == 7){
|
||||
this.danwei = 'Km'
|
||||
this.fxtxt = '范围'
|
||||
}
|
||||
},
|
||||
getlist(){
|
||||
this.$u.get(`/farm/warnSetting/apiary/${this.apiaryId}`).then(res => {
|
||||
if(res.code == 200){
|
||||
this.form = res.data
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
@ -105,6 +185,87 @@
|
|||
// position: relative;
|
||||
padding-bottom: 200rpx;
|
||||
width: 750rpx;
|
||||
.mask{
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 97;
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
background: rgba(61,61,61,0.2);
|
||||
}
|
||||
.tanc{
|
||||
width: 594rpx;
|
||||
height: 420rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 30rpx 30rpx 30rpx 30rpx;
|
||||
position: fixed;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
top: 506rpx;
|
||||
z-index: 98;
|
||||
.anniu{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 0 44rpx;
|
||||
box-sizing: border-box;
|
||||
margin-top: 64rpx;
|
||||
width: 100%;
|
||||
.qux{
|
||||
width: 234rpx;
|
||||
height: 80rpx;
|
||||
border-radius: 40rpx 40rpx 40rpx 40rpx;
|
||||
border: 2rpx solid #FFC107;
|
||||
font-size: 36rpx;
|
||||
color: #FFC107;
|
||||
text-align: center;
|
||||
line-height: 80rpx;
|
||||
}
|
||||
.qd{
|
||||
width: 234rpx;
|
||||
height: 80rpx;
|
||||
background: #FFC107;
|
||||
border-radius: 40rpx 40rpx 40rpx 40rpx;
|
||||
font-size: 36rpx;
|
||||
color: #FFFFFF;
|
||||
text-align: center;
|
||||
line-height: 80rpx;
|
||||
}
|
||||
}
|
||||
.shuzhi{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 0 60rpx;
|
||||
margin-top: 50rpx;
|
||||
box-sizing: border-box;
|
||||
input{
|
||||
width: 96rpx;
|
||||
height: 76rpx;
|
||||
border-radius: 10rpx 10rpx 10rpx 10rpx;
|
||||
border: 2rpx solid #808080;
|
||||
padding-left: 30rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
}
|
||||
.top{
|
||||
font-weight: 600;
|
||||
font-size: 36rpx;
|
||||
color: #3D3D3D;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
padding-top: 40rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
image{
|
||||
width: 198rpx;
|
||||
height: 172rpx;
|
||||
position: absolute;
|
||||
top: 12rpx;
|
||||
right: 20rpx;
|
||||
opacity: .5;
|
||||
}
|
||||
}
|
||||
.tit {
|
||||
margin-right: 49rpx;
|
||||
display: flex;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
title-size='36' :title-bold='true' height='45' id="navbar">
|
||||
</u-navbar>
|
||||
<map class="map" id="map" ref="map" :scale="zoomSize" :latitude="latitude" :longitude="longitude"
|
||||
:show-location='true' :markers="covers" @markertap="handleMarkerClick"></map>
|
||||
:show-location='true' :markers="covers"></map>
|
||||
|
||||
<view class="fxtongji">
|
||||
<view class="one">
|
||||
|
@ -63,10 +63,6 @@
|
|||
}
|
||||
},
|
||||
methods: {
|
||||
// 点击地图图标
|
||||
handleMarkerClick(e) {
|
||||
console.log(e.markerId);
|
||||
},
|
||||
|
||||
getMyLocations() {
|
||||
uni.getLocation({
|
||||
|
@ -82,7 +78,7 @@
|
|||
this.listmaps = res.data
|
||||
res.data.forEach(item => {
|
||||
this.covers.push({
|
||||
id: parseFloat(item.beehiveId),
|
||||
markerId:parseFloat(item.beehiveId),
|
||||
latitude: item.lat,
|
||||
longitude: item.lng,
|
||||
width: 25,
|
||||
|
@ -141,7 +137,7 @@
|
|||
this.listmap = res.data
|
||||
res.data.forEach(item => {
|
||||
this.covers.push({
|
||||
id: parseFloat(item.apiaryId),
|
||||
markerId:parseFloat(item.apiaryId),
|
||||
latitude: item.lat,
|
||||
longitude: item.lng,
|
||||
width: 25,
|
||||
|
|
Loading…
Reference in New Issue
Block a user