Commit e1da9a8f authored by zhanglw's avatar zhanglw

样式问题 nvue改为vue 封装处理后无用注释代码清理

parent fc5d9169
...@@ -25,9 +25,6 @@ ...@@ -25,9 +25,6 @@
export default { export default {
data() { data() {
return { return {
// baseUrl: "http://192.168.3.23:8086",
// userInfo: {},
// currProInfo: {},
iconList: [online, offline, wendu], iconList: [online, offline, wendu],
query: { query: {
name: '' name: ''
...@@ -38,48 +35,9 @@ ...@@ -38,48 +35,9 @@
onNum: 26, onNum: 26,
offNum: 13, offNum: 13,
}, },
dataList: [/* { dataList: []
name: '气象站7号',
type: '温度',
value: '39.7℃',
status: '解除',
time: '2023-10-18 10:03:58'
}, {
name: '气象站7号',
type: '温度',
value: '39.7℃',
status: '解除',
time: '2023-10-18 10:03:58'
}, {
name: '气象站7号',
type: '温度',
value: '39.7℃',
status: '解除',
time: '2023-10-18 10:03:58'
}, {
name: '气象站7号',
type: '温度',
value: '39.7℃',
status: '解除',
time: '2023-10-18 10:03:58'
}, {
name: '气象站7号',
type: '温度',
value: '39.7℃',
status: '解除',
time: '2023-10-18 10:03:58'
}, {
name: '气象站7号',
type: '温度',
value: '39.7℃',
status: '解除',
time: '2023-10-18 10:03:58'
} */]
} }
}, },
// onReady() {
// this.loadData()
// },
onShow() { onShow() {
this.loadData() this.loadData()
}, },
...@@ -89,7 +47,6 @@ ...@@ -89,7 +47,6 @@
}, },
methods: { methods: {
loadData() { loadData() {
// this.userInfo = JSON.parse(uni.getStorageSync('userInfo'))
const currProInfo = JSON.parse(uni.getStorageSync('currProInfo')) const currProInfo = JSON.parse(uni.getStorageSync('currProInfo'))
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: `历史报警-${currProInfo.text}` title: `历史报警-${currProInfo.text}`
...@@ -108,25 +65,6 @@ ...@@ -108,25 +65,6 @@
this.dataList = res.data.dataList this.dataList = res.data.dataList
} }
}) })
// 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
// }
// })
}, },
} }
} }
......
...@@ -48,9 +48,6 @@ ...@@ -48,9 +48,6 @@
export default { export default {
data() { data() {
return { return {
// baseUrl: "http://117.34.103.191:8086",
// userInfo: {},
// currProInfo: {},
iconList: [online, offline], iconList: [online, offline],
incoDic: { incoDic: {
'光照': m1, '光照': m1,
...@@ -130,31 +127,10 @@ ...@@ -130,31 +127,10 @@
showpopup: true, showpopup: true,
cWidth: '', cWidth: '',
cHeight: '', //画布的宽高 cHeight: '', //画布的宽高
// data: {},
// data: {
// categories: ["01时", "02时", "03时", "04时", "05时", "06时", "07时", "08时", "09时", "10时", "11时", "12时"],
// series: [{
// name: "温度",
// data: [35, 8, 25, 37, 4, 20, 35, 8, 25, 37, 4, 20]
// }]
// }
} }
}, },
watch: { watch: {
// dateRange(val) {
// console.group('监听日期改变数据')
// console.log(val);
// if(val){
// this.loadData()
// }
// },
// chartDateRange() {
// _self.showLine("canvasLine", _self.data)
// }
}, },
// onReady() {
// // this.loadData()
// },
onShow() { onShow() {
this.dateRange = [this.getDate(Date.now()), this.getDate(Date.now())] this.dateRange = [this.getDate(Date.now()), this.getDate(Date.now())]
this.loadData() this.loadData()
...@@ -192,14 +168,14 @@ ...@@ -192,14 +168,14 @@
// this.getDate(new Date(this.dateRange[1])) // this.getDate(new Date(this.dateRange[1]))
// ] // ]
}, },
async loadData() { loadData() {
// this.userInfo = JSON.parse(uni.getStorageSync('userInfo')) // this.userInfo = JSON.parse(uni.getStorageSync('userInfo'))
const currProInfo = JSON.parse(uni.getStorageSync('currProInfo')) const currProInfo = JSON.parse(uni.getStorageSync('currProInfo'))
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: `历史数据-${currProInfo.text}` title: `历史数据-${currProInfo.text}`
}); });
const res = await this.$API.call({ this.$API.call({
url: '/api/historyData/loadHistoryDataByUserid', url: '/api/historyData/loadHistoryDataByUserid',
method: "GET", method: "GET",
data:{ data:{
...@@ -215,29 +191,6 @@ ...@@ -215,29 +191,6 @@
this.dataList = res.data.dataList this.dataList = res.data.dataList
} }
}) })
// uni.request({
// url: `${this.$BASEURL}/api/historyData/loadHistoryDataByUserid`,
// method: "get",
// header: {
// 'Accept':'application/json, text/plain, */*',
// 'Authorization':'Bearer '+this.userInfo.token
// },
// data: {
// page: this.page,
// pageSize: this.pageSize,
// proId: this.currProInfo.value,
// item: this.query.item,
// startTime: this.dateRange[0],
// endTime: this.dateRange[1],
// deviceName: this.query.name||''
// }
// }).then(result => {
// let [error, res] = result
// if (res.data && res.data.code==200) {
// this.dataList = res.data.data.dataList
// }
// })
}, },
getChartsData(item){ getChartsData(item){
this.initCharts() this.initCharts()
...@@ -253,25 +206,6 @@ ...@@ -253,25 +206,6 @@
this.showLine("canvasLine", res.data) this.showLine("canvasLine", res.data)
} }
}) })
// uni.request({
// url: `${this.$BASEURL}/api/historyData/historyDataTrendChart`,
// method: "get",
// header: {
// 'Accept':'application/json, text/plain, */*',
// 'Authorization':'Bearer '+this.userInfo.token
// },
// data: {
// deviceId: item.deviceId,
// time: item.time
// }
// }).then(result => {
// let [error, res] = result
// if (res.data && res.data.code==200) {
// this.data = res.data.data
// console.log(this.data)
// this.showLine("canvasLine", this.data)
// }
// })
}, },
showLine(canvasId, chartData) { showLine(canvasId, chartData) {
canvaLineIns = new uCharts({ //这些配置项的意思看这:https://www.kancloud.cn/qiun/ucharts/1172125 canvaLineIns = new uCharts({ //这些配置项的意思看这:https://www.kancloud.cn/qiun/ucharts/1172125
......
...@@ -18,13 +18,6 @@ ...@@ -18,13 +18,6 @@
</uni-row> </uni-row>
</uni-card> </uni-card>
<view v-if="!dataList.length" style="text-align:center;margin-top:55upx;color:#999;font-weight:bolder;">未查询的传感器数据</view> <view v-if="!dataList.length" style="text-align:center;margin-top:55upx;color:#999;font-weight:bolder;">未查询的传感器数据</view>
<!-- <uni-popup ref="message" type="message">
<uni-popup-message :type="msgType" :message="messageText" :duration="2000"></uni-popup-message>
</uni-popup> -->
<!-- <uni-popup ref="alertDialog" type="dialog">
<uni-popup-dialog type="info" cancelText="取消" confirmText="确定" content="您确定解除报警吗!" @confirm="dialogConfirm"
@close="dialogClose"></uni-popup-dialog>
</uni-popup> -->
</view> </view>
</template> </template>
<script> <script>
...@@ -35,11 +28,7 @@ ...@@ -35,11 +28,7 @@
export default { export default {
data() { data() {
return { return {
// userInfo: {},
// currProInfo: {},
iconList: [online, offline, wendu], iconList: [online, offline, wendu],
// msgType: 'success',
// messageText: '',
query: { query: {
name: '' name: ''
}, },
...@@ -58,7 +47,6 @@ ...@@ -58,7 +47,6 @@
}, },
methods: { methods: {
loadData() { loadData() {
// this.userInfo = JSON.parse(uni.getStorageSync('userInfo'))
const currProInfo = JSON.parse(uni.getStorageSync('currProInfo')) const currProInfo = JSON.parse(uni.getStorageSync('currProInfo'))
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: `实时报警-${currProInfo.text}` title: `实时报警-${currProInfo.text}`
...@@ -66,7 +54,6 @@ ...@@ -66,7 +54,6 @@
this.$API.call({ this.$API.call({
url: '/api/nowAlarm/loadNowAlarmByProId', url: '/api/nowAlarm/loadNowAlarmByProId',
method: "get",
data:{ data:{
page: this.page, page: this.page,
pageSize: this.pageSize, pageSize: this.pageSize,
...@@ -79,31 +66,7 @@ ...@@ -79,31 +66,7 @@
} }
} }
}) })
// 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() {
// this.msgType = 'error',
// this.messageText = `取消解除报警`
// this.$refs.message.open()
// },
async dialogConfirm() { async dialogConfirm() {
if(!this.removeWarnId){ if(!this.removeWarnId){
alert('请求参数不可为空') alert('请求参数不可为空')
...@@ -121,30 +84,6 @@ ...@@ -121,30 +84,6 @@
this.dataList.splice(removeIndex, 1) this.dataList.splice(removeIndex, 1)
} }
}) })
// uni.request({
// url: `${this.$BASEURL}/api/nowAlarm/releaseAlarm`,
// method: "PUT",
// header: {
// 'Accept':'application/json, text/plain, */*',
// 'Authorization':'Bearer '+this.userInfo.token
// },
// data: {
// warnMsgId: this.removeWarnId
// }
// }).then(result => {
// let [error, res] = result
// if (res.data && res.data.code==200) {
// this.msgType = 'success',
// this.messageText = `确认解除报警`
// this.$refs.message.open()
// // 删除本地数据
// const removeIndex = this.dataList.findIndex(item=>item.warnMsgId === this.removeWarnId)
// this.dataList.splice(removeIndex, 1)
// }else{
// this.$UTIL.resErrorDeal(res)
// }
// })
}, },
removeAlarm(item) { removeAlarm(item) {
this.removeWarnId = item.warnMsgId this.removeWarnId = item.warnMsgId
...@@ -155,7 +94,6 @@ ...@@ -155,7 +94,6 @@
} }
} }
}) })
// this.$refs.alertDialog.open()
}, },
onReachBottom() { onReachBottom() {
this.pageSize += 10 this.pageSize += 10
......
...@@ -56,9 +56,6 @@ ...@@ -56,9 +56,6 @@
export default { export default {
data() { data() {
return { return {
// baseUrl: "http://192.168.3.23:8086",
// userInfo: {},
// currProInfo: {},
iconList: [online, offline], iconList: [online, offline],
incoDic: { incoDic: {
'光照': m1, '光照': m1,
...@@ -87,9 +84,6 @@ ...@@ -87,9 +84,6 @@
dataList: [] dataList: []
} }
}, },
// onReady() {
// this.loadData()
// },
onShow() { onShow() {
this.loadData() this.loadData()
}, },
...@@ -99,7 +93,6 @@ ...@@ -99,7 +93,6 @@
}, },
methods: { methods: {
loadData() { loadData() {
// this.userInfo = JSON.parse(uni.getStorageSync('userInfo'))
const currProInfo = JSON.parse(uni.getStorageSync('currProInfo')) const currProInfo = JSON.parse(uni.getStorageSync('currProInfo'))
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: `实时监测-${currProInfo.text}` title: `实时监测-${currProInfo.text}`
...@@ -120,27 +113,6 @@ ...@@ -120,27 +113,6 @@
this.devInfo.onNum = data.onlineNumbers this.devInfo.onNum = data.onlineNumbers
} }
}) })
// uni.request({
// url: this.baseUrl + '/api/nowData/loadNowDataByUserid',
// method: "get",
// header: {
// 'Accept':'application/json, text/plain, */*',
// 'Authorization':'Bearer '+this.userInfo.token
// },
// data: {
// page: this.page,
// pageSize: this.pageSize,
// deviceName: this.query.name||'',
// proId: this.currProInfo.value
// }
// }).then(result => {
// let [error, res] = result
// if (res.data && res.data.code==200) {
// this.dataList = res.data.data.dataList
// this.devInfo.offNum = res.data.data.offlineNumbers
// this.devInfo.onNum = res.data.data.onlineNumbers
// }
// })
}, },
} }
} }
......
...@@ -26,9 +26,6 @@ ...@@ -26,9 +26,6 @@
proList: [] proList: []
} }
}, },
// onReady() {
// this.loadData()
// },
onShow() { onShow() {
this.loadData() this.loadData()
this.refresh() this.refresh()
......
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