|
@@ -3,6 +3,11 @@
|
|
|
<view class="logo">
|
|
|
<image src="/static/left/logo.png"></image>
|
|
|
</view>
|
|
|
+ <view class="station_box">
|
|
|
+ {{codeState || '-'}}
|
|
|
+ <image class="station_box_img" :src="cloud?`/static/left/link.png`:`/static/left/close.png`">
|
|
|
+ </image>
|
|
|
+ </view>
|
|
|
<view class="routList">
|
|
|
<view class="category" v-for="(item,index) in categoryList"
|
|
|
:class="item.name==$store.state.currentpage?'active':''" @click="getPage(item.name)">
|
|
@@ -12,10 +17,11 @@
|
|
|
<view>{{item.name}}</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
+
|
|
|
<view class="fiexd_footer">
|
|
|
<view class="left_footer">
|
|
|
<view class="box_click" @click="goTo">
|
|
|
-
|
|
|
+
|
|
|
</view>
|
|
|
<view class="left_footer_woring">
|
|
|
{{alarmNum}}
|
|
@@ -44,9 +50,9 @@
|
|
|
data() {
|
|
|
return {
|
|
|
currentPage: 0,
|
|
|
- popupType:'',
|
|
|
- popupMessage:'',
|
|
|
- userName:'',
|
|
|
+ popupType: '',
|
|
|
+ popupMessage: '',
|
|
|
+ userName: '',
|
|
|
categoryList: [{
|
|
|
name: '首页',
|
|
|
url: '/pages/index/index',
|
|
@@ -69,10 +75,28 @@
|
|
|
name: '基础数据',
|
|
|
url: '/pages/basic-data/index'
|
|
|
}],
|
|
|
- alarmNum:0,//消防告警数量
|
|
|
+ alarmNum: 0, //消防告警数量
|
|
|
+ cloud: 0, //云端
|
|
|
+ codeState: 0, //编号
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
+ //编号
|
|
|
+ getState() {
|
|
|
+ this.$http.getStationCode().then(res => {
|
|
|
+ if (res.code === 0) {
|
|
|
+ this.codeState = res.data
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //云端
|
|
|
+ cloudConnState() {
|
|
|
+ this.$http.getcloudConnState().then(res => {
|
|
|
+ if (res.code === 0) {
|
|
|
+ this.cloud = res.data
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
getPage(name) {
|
|
|
this.$store.commit("UPDATEPAGE", name);
|
|
|
this.$storage.setJson("pageName", name)
|
|
@@ -84,7 +108,7 @@
|
|
|
content: "",
|
|
|
success: function(res) {
|
|
|
if (res.confirm) {
|
|
|
- that.$storage.clear();//清除所有本地存储
|
|
|
+ that.$storage.clear(); //清除所有本地存储
|
|
|
uni.navigateTo({
|
|
|
url: "../../pages/login/index"
|
|
|
})
|
|
@@ -97,36 +121,36 @@
|
|
|
})
|
|
|
},
|
|
|
//根据用户id得到用户信息
|
|
|
- getuserinfo(){
|
|
|
+ getuserinfo() {
|
|
|
let userId = this.$storage.getJson("userId")
|
|
|
let token = this.$storage.getJson("token")
|
|
|
let data = {
|
|
|
- id:userId
|
|
|
+ id: userId
|
|
|
}
|
|
|
- this.$http.getInfo(data).then(res=>{
|
|
|
- if(res.code == 0){
|
|
|
+ this.$http.getInfo(data).then(res => {
|
|
|
+ if (res.code == 0) {
|
|
|
this.userName = res.data.userAccount
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
this.ExchangeMessage('error', res.msg)
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
})
|
|
|
},
|
|
|
//顶部公共消息提示
|
|
|
ExchangeMessage(type, message) {
|
|
|
this.popupType = type
|
|
|
- this.popupMessage = message?message:'后端接口404错误!'
|
|
|
+ this.popupMessage = message ? message : '后端接口404错误!'
|
|
|
this.$refs.Exchangepopup.open()
|
|
|
},
|
|
|
//跳转到消防告警列表
|
|
|
- goTo(){
|
|
|
+ goTo() {
|
|
|
this.getPage('故障告警')
|
|
|
- this.$storage.setJson('gotoname',1)//存本地用于判断显示的告警页面
|
|
|
+ this.$storage.setJson('gotoname', 1) //存本地用于判断显示的告警页面
|
|
|
},
|
|
|
//当天消防告警数量
|
|
|
- getnum(){
|
|
|
- this.$http.getToDayAlarm().then(res=>{
|
|
|
- if(res.code == 0){
|
|
|
+ getnum() {
|
|
|
+ this.$http.getToDayAlarm().then(res => {
|
|
|
+ if (res.code == 0) {
|
|
|
this.alarmNum = res.data.length
|
|
|
}
|
|
|
});
|
|
@@ -136,6 +160,8 @@
|
|
|
// this.getRoute()
|
|
|
this.getuserinfo()
|
|
|
this.getnum()
|
|
|
+ this.getState()
|
|
|
+ this.cloudConnState()
|
|
|
},
|
|
|
onShow() {
|
|
|
|
|
@@ -170,7 +196,7 @@
|
|
|
justify-content: space-between;
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
|
- margin-top: 42px;
|
|
|
+ margin-top: 20px;
|
|
|
|
|
|
.category {
|
|
|
width: 100%;
|
|
@@ -212,7 +238,8 @@
|
|
|
background-size: 100%;
|
|
|
padding-top: 53px;
|
|
|
position: relative;
|
|
|
- .box_click{
|
|
|
+
|
|
|
+ .box_click {
|
|
|
position: absolute;
|
|
|
// border: 1px solid red;
|
|
|
width: 60px;
|
|
@@ -220,6 +247,7 @@
|
|
|
top: 0px;
|
|
|
left: 50px;
|
|
|
}
|
|
|
+
|
|
|
.left_footer_woring {
|
|
|
position: absolute;
|
|
|
min-width: 20px;
|
|
@@ -267,4 +295,28 @@
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ .station_box {
|
|
|
+ width: 150px;
|
|
|
+ background: #1C263A;
|
|
|
+ border: 1px solid #26334C;
|
|
|
+ font-size: 16px;
|
|
|
+ font-weight: 500;
|
|
|
+ color: rgba(153, 174, 197, 0.65);
|
|
|
+ text-shadow: 0px 0px 4px rgba(39, 69, 201, 0.5);
|
|
|
+ border-radius: 4px;
|
|
|
+ height: 36px;
|
|
|
+ line-height: 36px;
|
|
|
+ margin-top: 10px;
|
|
|
+ position: relative;
|
|
|
+ padding-left: 10px;
|
|
|
+
|
|
|
+ .station_box_img {
|
|
|
+ position: absolute;
|
|
|
+ width: 20px;
|
|
|
+ height: 20px;
|
|
|
+ right: 10px;
|
|
|
+ top: 8px;
|
|
|
+ }
|
|
|
+ }
|
|
|
</style>
|