Commit f389e2b7 authored by zhanglw's avatar zhanglw

2023-11-2 zjb需求-接口联调 实时报警 历史报警

parent 47ceb393
...@@ -3,6 +3,11 @@ import store from './store' ...@@ -3,6 +3,11 @@ import store from './store'
// #ifndef VUE3 // #ifndef VUE3
import Vue from 'vue' import Vue from 'vue'
// const BASEURL = 'http://117.34.103.191:8086' // 生产环境url
const BASEURL = 'http://192.168.3.23:8086' // 研发环境url
Vue.prototype.$BASEURL = BASEURL
Vue.config.productionTip = false Vue.config.productionTip = false
Vue.prototype.$store = store Vue.prototype.$store = store
Vue.prototype.$adpid = "1111111111" Vue.prototype.$adpid = "1111111111"
......
...@@ -4,14 +4,14 @@ ...@@ -4,14 +4,14 @@
<uni-search-bar v-model="query.name" class="uni-mt-10 margin0" radius="5" placeholder="输入设备名查询" clearButton="auto" <uni-search-bar v-model="query.name" class="uni-mt-10 margin0" radius="5" placeholder="输入设备名查询" clearButton="auto"
cancelButton="none" @confirm="loadData" /> cancelButton="none" @confirm="loadData" />
</view> </view>
<uni-card v-for="(item,index) in dataList" :title="item.name" :key='index' :isFull="true" <uni-card v-for="(item,index) in dataList" :title="item.deviceName" :key='index' :isFull="true"
:sub-title="'检测项:'+item.type" :extra="'检测值:'+item.value" :thumbnail="iconList[2]"> :sub-title="'检测项:'+item.item" :extra="'检测值:'+item.data" :thumbnail="iconList[2]">
<uni-row class="demo-uni-row"> <uni-row class="demo-uni-row">
<uni-col :span="8"> <uni-col :span="8">
<view class="demo-uni-col">状态:{{item.status}}</view> <view class="demo-uni-col">状态:{{item.flg}}</view>
</uni-col> </uni-col>
<uni-col :span="16"> <uni-col :span="16">
<view class="demo-uni-col" style="font-size: 16upx;text-align: right;">解除时间:{{item.time}}</view> <view class="demo-uni-col" style="font-size: 16upx;text-align: right;">解除时间:{{item.jcTime}}</view>
</uni-col> </uni-col>
</uni-row> </uni-row>
</uni-card> </uni-card>
...@@ -32,11 +32,13 @@ ...@@ -32,11 +32,13 @@
query: { query: {
name: '' name: ''
}, },
page: 0,
pageSize: 10,
devInfo: { devInfo: {
onNum: 26, onNum: 26,
offNum: 13, offNum: 13,
}, },
dataList: [{ dataList: [/* {
name: '气象站7号', name: '气象站7号',
type: '温度', type: '温度',
value: '39.7℃', value: '39.7℃',
...@@ -72,7 +74,7 @@ ...@@ -72,7 +74,7 @@
value: '39.7℃', value: '39.7℃',
status: '解除', status: '解除',
time: '2023-10-18 10:03:58' time: '2023-10-18 10:03:58'
}] } */]
} }
}, },
onReady() { onReady() {
...@@ -81,6 +83,10 @@ ...@@ -81,6 +83,10 @@
onShow() { onShow() {
this.loadData() this.loadData()
}, },
onReachBottom() {
this.pageSize += 10
this.loadData()
},
methods: { methods: {
loadData() { loadData() {
this.userInfo = JSON.parse(uni.getStorageSync('userInfo')) this.userInfo = JSON.parse(uni.getStorageSync('userInfo'))
...@@ -88,6 +94,26 @@ ...@@ -88,6 +94,26 @@
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: `历史报警-${this.currProInfo.text}` title: `历史报警-${this.currProInfo.text}`
}); });
uni.request({
url: `${this.$BASEURL}/api/historyAlarm/loadHistoryAlarmByProId`,
method: "get",
header: {
'Accept':'application/json, text/plain, */*',
'Authorization':'Bearer '+this.userInfo.token
},
data: {
page: this.page,
pageSize: this.pageSize,
proId: this.currProInfo.value,
deviceName: this.query.name||''
}
}).then(result => {
let [error, res] = result
if (res.data && res.data.code==200) {
this.dataList = res.data.data.dataList
}
})
}, },
} }
} }
......
...@@ -4,11 +4,11 @@ ...@@ -4,11 +4,11 @@
<uni-search-bar v-model="query.name" class="uni-mt-10 margin0" radius="5" placeholder="输入设备名查询" clearButton="auto" <uni-search-bar v-model="query.name" class="uni-mt-10 margin0" radius="5" placeholder="输入设备名查询" clearButton="auto"
cancelButton="none" @confirm="loadData" /> cancelButton="none" @confirm="loadData" />
</view> </view>
<uni-card v-for="(item,index) in dataList" :title="item.name" :key='index' :isFull="true" <uni-card v-for="(item,index) in dataList" :title="item.deviceName" :key='index' :isFull="true"
:sub-title="'检测项:'+item.type" :extra="'检测值:'+item.value" :thumbnail="iconList[2]"> :sub-title="'检测项:'+item.item" :extra="'检测值:'+item.data" :thumbnail="iconList[2]">
<uni-row class="demo-uni-row"> <uni-row class="demo-uni-row">
<uni-col :span="16"> <uni-col :span="16">
<view class="demo-uni-col">状态:{{item.status}}</view> <view class="demo-uni-col">状态:{{item.flg}}</view>
</uni-col> </uni-col>
<uni-col :span="8"> <uni-col :span="8">
<view class="demo-uni-col"> <view class="demo-uni-col">
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
export default { export default {
data() { data() {
return { return {
baseUrl: "http://192.168.3.23:8086", baseUrl: "http://117.34.103.191:8086",
userInfo: {}, userInfo: {},
currProInfo: {}, currProInfo: {},
iconList: [online, offline, wendu], iconList: [online, offline, wendu],
...@@ -43,11 +43,13 @@ ...@@ -43,11 +43,13 @@
query: { query: {
name: '' name: ''
}, },
page: 0,
pageSize: 10,
devInfo: { devInfo: {
onNum: 26, onNum: 26,
offNum: 13, offNum: 13,
}, },
dataList: [{ dataList: [/* {
name: '气象站7号', name: '气象站7号',
type: '温度', type: '温度',
value: '39.7℃', value: '39.7℃',
...@@ -83,7 +85,7 @@ ...@@ -83,7 +85,7 @@
value: '39.7℃', value: '39.7℃',
status: '报警', status: '报警',
time: '2023-10-18 10:03:58' time: '2023-10-18 10:03:58'
}] } */]
} }
}, },
onReady() { onReady() {
...@@ -99,6 +101,26 @@ ...@@ -99,6 +101,26 @@
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: `实时报警-${this.currProInfo.text}` title: `实时报警-${this.currProInfo.text}`
}); });
uni.request({
url: `${this.$BASEURL}/api/nowAlarm/loadNowAlarmByProId`,
method: "get",
header: {
'Accept':'application/json, text/plain, */*',
'Authorization':'Bearer '+this.userInfo.token
},
data: {
page: this.page,
pageSize: this.pageSize,
proId: this.currProInfo.value,
deviceName: this.query.name||''
}
}).then(result => {
let [error, res] = result
if (res.data && res.data.code==200) {
this.dataList = res.data.data.dataList
}
})
}, },
dialogClose() { dialogClose() {
this.msgType = 'error', this.msgType = 'error',
...@@ -112,7 +134,11 @@ ...@@ -112,7 +134,11 @@
}, },
removeAlarm(item) { removeAlarm(item) {
this.$refs.alertDialog.open() this.$refs.alertDialog.open()
} },
onReachBottom() {
this.pageSize += 10
this.loadData()
},
} }
} }
</script> </script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment