|
@@ -1,6 +1,6 @@
|
|
<template>
|
|
<template>
|
|
<view style="background:#f1f1f1;" class="padding-sm">
|
|
<view style="background:#f1f1f1;" class="padding-sm">
|
|
-
|
|
|
|
|
|
+
|
|
<!-- 下拉选择 -->
|
|
<!-- 下拉选择 -->
|
|
<view class="searchSelect shadow" v-if="flag">
|
|
<view class="searchSelect shadow" v-if="flag">
|
|
<view class="cu-bar search bg-white">
|
|
<view class="cu-bar search bg-white">
|
|
@@ -18,7 +18,7 @@
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<!-- 下拉选择 end -->
|
|
<!-- 下拉选择 end -->
|
|
-
|
|
|
|
|
|
+
|
|
<!-- <search-Select :flag="flag"></search-Select> -->
|
|
<!-- <search-Select :flag="flag"></search-Select> -->
|
|
|
|
|
|
<!-- 图表 -->
|
|
<!-- 图表 -->
|
|
@@ -37,12 +37,12 @@
|
|
<view v-if="Inv == 1">
|
|
<view v-if="Inv == 1">
|
|
<chart2 :bindData="staticData"></chart2>
|
|
<chart2 :bindData="staticData"></chart2>
|
|
</view>
|
|
</view>
|
|
- <view v-if="Inv == 2" class="chart3-box" >
|
|
|
|
|
|
+ <view v-if="Inv == 2" class="chart3-box">
|
|
<ul class="chart3-icon">
|
|
<ul class="chart3-icon">
|
|
<li @tap="goOfflineList()">
|
|
<li @tap="goOfflineList()">
|
|
<image src="../../static/chart3-1.png" style="width:64rpx;height:64rpx"></image>
|
|
<image src="../../static/chart3-1.png" style="width:64rpx;height:64rpx"></image>
|
|
</li>
|
|
</li>
|
|
- <li @tap="goFaultList()">
|
|
|
|
|
|
+ <li @tap="goFaultList()">
|
|
<image src="../../static/chart3-2.png" style="width:64rpx;height:64rpx"></image>
|
|
<image src="../../static/chart3-2.png" style="width:64rpx;height:64rpx"></image>
|
|
</li>
|
|
</li>
|
|
<li>
|
|
<li>
|
|
@@ -55,7 +55,7 @@
|
|
<image src="../../static/chart3-5.png" style="width:64rpx;height:64rpx"></image>
|
|
<image src="../../static/chart3-5.png" style="width:64rpx;height:64rpx"></image>
|
|
</li>
|
|
</li>
|
|
</ul>
|
|
</ul>
|
|
- <chart3 :bindData="staticData" >
|
|
|
|
|
|
+ <chart3 :bindData="staticData">
|
|
</chart3>
|
|
</chart3>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -83,12 +83,15 @@
|
|
import chart from './components/chart/chart.vue';
|
|
import chart from './components/chart/chart.vue';
|
|
import chart2 from './components/chart2/chart2.vue';
|
|
import chart2 from './components/chart2/chart2.vue';
|
|
import chart3 from './components/chart3/chart3.vue';
|
|
import chart3 from './components/chart3/chart3.vue';
|
|
-
|
|
|
|
|
|
+
|
|
import searchSelect from './components/searchSelect/searchSelect.vue';
|
|
import searchSelect from './components/searchSelect/searchSelect.vue';
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+
|
|
import json from '../../data/json.js';
|
|
import json from '../../data/json.js';
|
|
|
|
|
|
|
|
+ //引入js sdk的封装
|
|
|
|
+ import * as jwx from '../../util/jssdk.js'
|
|
|
|
+
|
|
export default {
|
|
export default {
|
|
components: {
|
|
components: {
|
|
chart,
|
|
chart,
|
|
@@ -104,14 +107,14 @@
|
|
cuIconList: json.cuIconList,
|
|
cuIconList: json.cuIconList,
|
|
Inv: 0,
|
|
Inv: 0,
|
|
|
|
|
|
-
|
|
|
|
|
|
+
|
|
flag: false,
|
|
flag: false,
|
|
searchList: [],
|
|
searchList: [],
|
|
searchList2: [],
|
|
searchList2: [],
|
|
|
|
|
|
searchInput: '',
|
|
searchInput: '',
|
|
- selectedCode:10012,
|
|
|
|
- getData:[]
|
|
|
|
|
|
+ selectedCode: 10012,
|
|
|
|
+ getData: []
|
|
|
|
|
|
};
|
|
};
|
|
},
|
|
},
|
|
@@ -119,40 +122,81 @@
|
|
// 自定义导航事件
|
|
// 自定义导航事件
|
|
onNavigationBarButtonTap(e) {
|
|
onNavigationBarButtonTap(e) {
|
|
if (e.float == 'right') {
|
|
if (e.float == 'right') {
|
|
- console.log("你点击了扫一扫")
|
|
|
|
|
|
+ console.log("你点击了扫一扫");
|
|
|
|
+ this.scanQRCode();
|
|
} else {
|
|
} else {
|
|
this.showTag()
|
|
this.showTag()
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
onLoad(option) {
|
|
onLoad(option) {
|
|
-
|
|
|
|
- var res=uni.getStorageSync('selectedCode');
|
|
|
|
- var res2=uni.getStorageSync('selectedName');
|
|
|
|
- if(res){
|
|
|
|
|
|
+
|
|
|
|
+ console.log('$websiteUrl')
|
|
|
|
+ console.log(this.$websiteUrl)
|
|
|
|
+ console.log(this.$BASE_URL)
|
|
|
|
+ // console.log(BASE_URL)
|
|
|
|
+ var res = uni.getStorageSync('selectedCode');
|
|
|
|
+ var res2 = uni.getStorageSync('selectedName');
|
|
|
|
+ if (res) {
|
|
uni.setNavigationBarTitle({
|
|
uni.setNavigationBarTitle({
|
|
title: res2
|
|
title: res2
|
|
});
|
|
});
|
|
}
|
|
}
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
// 数据渲染
|
|
// 数据渲染
|
|
this.getHomeData();
|
|
this.getHomeData();
|
|
-
|
|
|
|
|
|
+
|
|
|
|
|
|
// 图表切换渲染
|
|
// 图表切换渲染
|
|
this.hackReset = false;
|
|
this.hackReset = false;
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
this.hackReset = true;
|
|
this.hackReset = true;
|
|
})
|
|
})
|
|
-
|
|
|
|
|
|
+
|
|
this.getHandleData();
|
|
this.getHandleData();
|
|
this.getSearchList()
|
|
this.getSearchList()
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+
|
|
|
|
+ //新增
|
|
|
|
+ scanQRCode() {
|
|
|
|
+ // alert(1)
|
|
|
|
+ // 将this赋值给that
|
|
|
|
+ let that = this;
|
|
|
|
+ // 微信公众号获取位置
|
|
|
|
+ jwx.configWeiXin(jweixin => {
|
|
|
|
+ wx.scanQRCode({
|
|
|
|
+ needResult: 0, // 默认为0,扫描结果由微信处理,1则直接返回扫描结果,
|
|
|
|
+ scanType: ["qrCode", "barCode"], // 可以指定扫二维码还是一维码,默认二者都有
|
|
|
|
+ success: function(res) {
|
|
|
|
+ console.log('res')
|
|
|
|
+ console.log(res)
|
|
|
|
+ // that.longitude=res.longitude
|
|
|
|
+ // var result = res.resultStr; // 当needResult 为 1 时,扫码返回的结果
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ // jwx.configWeiXin(jweixin => {
|
|
|
|
+ // wx.getLocation({
|
|
|
|
+ // type: 'gcj02', // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02'
|
|
|
|
+ // success: function (res) {
|
|
|
|
+ // that.longitude=res.longitude
|
|
|
|
+ // that.latitude=res.latitude
|
|
|
|
+ // }
|
|
|
|
+ // });
|
|
|
|
+ // });
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
// 九宫格页面跳转
|
|
// 九宫格页面跳转
|
|
navItemClick(index) {
|
|
navItemClick(index) {
|
|
let url = "";
|
|
let url = "";
|
|
@@ -184,13 +228,13 @@
|
|
// case 8:
|
|
// case 8:
|
|
// url = "/pages/test/test"
|
|
// url = "/pages/test/test"
|
|
// break;
|
|
// break;
|
|
- case 9:
|
|
|
|
- url = "/pages/deviceManage/deviceManage"
|
|
|
|
- break;
|
|
|
|
- case 10:
|
|
|
|
- url = "/pages/accountManage/accountManage"
|
|
|
|
- break;
|
|
|
|
-
|
|
|
|
|
|
+ case 9:
|
|
|
|
+ url = "/pages/deviceManage/deviceManage"
|
|
|
|
+ break;
|
|
|
|
+ case 10:
|
|
|
|
+ url = "/pages/accountManage/accountManage"
|
|
|
|
+ break;
|
|
|
|
+
|
|
default:
|
|
default:
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
@@ -214,15 +258,15 @@
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
url: '/pages/deviceOffLine/deviceOffLine?type=离线',
|
|
url: '/pages/deviceOffLine/deviceOffLine?type=离线',
|
|
});
|
|
});
|
|
-
|
|
|
|
|
|
+
|
|
},
|
|
},
|
|
goFaultList() {
|
|
goFaultList() {
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
url: '/pages/deviceOffLine/deviceOffLine?type=故障',
|
|
url: '/pages/deviceOffLine/deviceOffLine?type=故障',
|
|
});
|
|
});
|
|
-
|
|
|
|
|
|
+
|
|
},
|
|
},
|
|
-
|
|
|
|
|
|
+
|
|
|
|
|
|
//站点下拉请求
|
|
//站点下拉请求
|
|
async getSearchList(param = {}) {
|
|
async getSearchList(param = {}) {
|
|
@@ -230,11 +274,11 @@
|
|
url: 'Index/getCompanyList',
|
|
url: 'Index/getCompanyList',
|
|
data: param
|
|
data: param
|
|
})
|
|
})
|
|
- this.getData=res.data.data
|
|
|
|
-
|
|
|
|
- if(!uni.getStorageSync('selectedCode')){
|
|
|
|
- uni.setStorageSync('selectedCode',this.getData[0].owner_code);
|
|
|
|
- uni.setStorageSync('selectedName',this.getData[0].owner_name);
|
|
|
|
|
|
+ this.getData = res.data.data
|
|
|
|
+
|
|
|
|
+ if (!uni.getStorageSync('selectedCode')) {
|
|
|
|
+ uni.setStorageSync('selectedCode', this.getData[0].owner_code);
|
|
|
|
+ uni.setStorageSync('selectedName', this.getData[0].owner_name);
|
|
}
|
|
}
|
|
res.data.data.forEach(item => {
|
|
res.data.data.forEach(item => {
|
|
this.searchList.push(item)
|
|
this.searchList.push(item)
|
|
@@ -242,21 +286,21 @@
|
|
});
|
|
});
|
|
console.log('this.searchList')
|
|
console.log('this.searchList')
|
|
console.log(this.searchList)
|
|
console.log(this.searchList)
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+
|
|
},
|
|
},
|
|
-
|
|
|
|
|
|
+
|
|
showTag() {
|
|
showTag() {
|
|
this.flag = !this.flag;
|
|
this.flag = !this.flag;
|
|
},
|
|
},
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+
|
|
// 下拉选择
|
|
// 下拉选择
|
|
clickSelectItem(item, index) {
|
|
clickSelectItem(item, index) {
|
|
- this.selectedCode=item.owner_code;
|
|
|
|
- uni.setStorageSync('selectedCode',item.owner_code);
|
|
|
|
- uni.setStorageSync('selectedName',item.owner_name);
|
|
|
|
- this.searchInput=item.owner_name;
|
|
|
|
|
|
+ this.selectedCode = item.owner_code;
|
|
|
|
+ uni.setStorageSync('selectedCode', item.owner_code);
|
|
|
|
+ uni.setStorageSync('selectedName', item.owner_name);
|
|
|
|
+ this.searchInput = item.owner_name;
|
|
uni.setNavigationBarTitle({
|
|
uni.setNavigationBarTitle({
|
|
title: this.searchInput
|
|
title: this.searchInput
|
|
});
|
|
});
|
|
@@ -267,7 +311,7 @@
|
|
this.searchList = newlist
|
|
this.searchList = newlist
|
|
},
|
|
},
|
|
|
|
|
|
-
|
|
|
|
|
|
+
|
|
InputFocus(e) {
|
|
InputFocus(e) {
|
|
this.InputBottom = e.detail.height
|
|
this.InputBottom = e.detail.height
|
|
},
|
|
},
|
|
@@ -279,7 +323,7 @@
|
|
that.navIdx = Inv;
|
|
that.navIdx = Inv;
|
|
|
|
|
|
},
|
|
},
|
|
-
|
|
|
|
|
|
+
|
|
//echarts图表请求
|
|
//echarts图表请求
|
|
async getHomeData(param = {}) {
|
|
async getHomeData(param = {}) {
|
|
const res = await this.$myRequest({
|
|
const res = await this.$myRequest({
|
|
@@ -288,8 +332,8 @@
|
|
})
|
|
})
|
|
// console.log('首页请求staticData')
|
|
// console.log('首页请求staticData')
|
|
// console.log(res.data.data[0])
|
|
// console.log(res.data.data[0])
|
|
- this.staticData=res.data.data[0]
|
|
|
|
-
|
|
|
|
|
|
+ this.staticData = res.data.data[0]
|
|
|
|
+
|
|
},
|
|
},
|
|
// 未处理告警请求
|
|
// 未处理告警请求
|
|
async getHandleData() {
|
|
async getHandleData() {
|
|
@@ -297,13 +341,13 @@
|
|
url: 'Index/getFunctionalModuleStatistics',
|
|
url: 'Index/getFunctionalModuleStatistics',
|
|
showLoading: true
|
|
showLoading: true
|
|
})
|
|
})
|
|
-
|
|
|
|
|
|
+
|
|
this.cuIconList[0].badge = res.data.data[0].comprehensive_alarm_count;
|
|
this.cuIconList[0].badge = res.data.data[0].comprehensive_alarm_count;
|
|
this.cuIconList[2].badge = res.data.data[0].fire_brigade_inspector_count
|
|
this.cuIconList[2].badge = res.data.data[0].fire_brigade_inspector_count
|
|
},
|
|
},
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
@@ -365,11 +409,11 @@
|
|
}
|
|
}
|
|
|
|
|
|
.chart3-icon {
|
|
.chart3-icon {
|
|
- width:90%;
|
|
|
|
|
|
+ width: 90%;
|
|
position: absolute;
|
|
position: absolute;
|
|
top: 60rpx;
|
|
top: 60rpx;
|
|
left: 30rpx;
|
|
left: 30rpx;
|
|
- z-index:1;
|
|
|
|
|
|
+ z-index: 1;
|
|
}
|
|
}
|
|
|
|
|
|
.chart3-icon li {
|
|
.chart3-icon li {
|