Browse Source

登录页面问题修改

bobo04052021@163.com 2 months ago
parent
commit
578ef7b064

+ 103 - 83
pages/device/index.vue

@@ -1,34 +1,53 @@
 <template>
   <view>
-	  <!-- 建议放在外层 -->
-	  <u-navbar
-		title="设备中心" 
-		:bgImage="backPic"
-		 :bgStatusImage="backPic0" 
-		@leftClick="devicemenuShow"
-		:safeAreaInsetTop="true"
-	  >
-		<view class="u-nav-slot" slot="left">
-		  <u-icon name="list" size="20"> </u-icon>
-		</view>
-	  </u-navbar>
-	  
-	  <view v-if="menushow" class="menupage">
-		<DeviceMenu @menuClick="menuClick"></DeviceMenu>
-	  </view>
-	<u-tabs class="devic-box-tab" :current="PageCur" :list="tabList" @click="NavChange"></u-tabs>
-	<view class="">
-		<home cur="home" :showColum="showColum" v-if="PageCur == '0' && !menushow" :key="0" :deviceType="deviceType" @setMenushow="setMenushow"></home>
-		<history
-		  :key="1"
-		  cur="history"
-		  :showColum="showColum"
-		  :deviceType="deviceType"
-		  v-if="PageCur == '1' && !menushow"
-		  @setMenushow="setMenushow"
-		></history>
-		<operation :key="2" :showColum="showColum" :deviceType="deviceType" cur="operation" v-if="PageCur == '2' && !menushow" @setMenushow="setMenushow"></operation>
-	</view>
+    <!-- 建议放在外层 -->
+    <u-navbar
+      title="设备中心"
+      :bgImage="backPic"
+      :bgStatusImage="backPic0"
+      @leftClick="devicemenuShow"
+      :safeAreaInsetTop="true"
+    >
+      <view class="u-nav-slot" slot="left">
+        <u-icon name="list" size="20"> </u-icon>
+      </view>
+    </u-navbar>
+
+    <view v-if="menushow" class="menupage">
+      <DeviceMenu @menuClick="menuClick"></DeviceMenu>
+    </view>
+    <u-tabs
+      class="devic-box-tab"
+      :current="PageCur"
+      :list="tabList"
+      @click="NavChange"
+    ></u-tabs>
+    <view class="">
+      <home
+        cur="home"
+        :showColum="showColum"
+        v-if="PageCur == '0' && !menushow"
+        :key="0"
+        :deviceType="deviceType"
+        @setMenushow="setMenushow"
+      ></home>
+      <history
+        :key="1"
+        cur="history"
+        :showColum="showColum"
+        :deviceType="deviceType"
+        v-if="PageCur == '1' && !menushow"
+        @setMenushow="setMenushow"
+      ></history>
+      <operation
+        :key="2"
+        :showColum="showColum"
+        :deviceType="deviceType"
+        cur="operation"
+        v-if="PageCur == '2' && !menushow"
+        @setMenushow="setMenushow"
+      ></operation>
+    </view>
   </view>
 </template>
 
@@ -36,28 +55,28 @@
 import api from "@/api/api";
 import DeviceMenu from "./devicemenu/devicemenu.vue";
 export default {
-	components: {
-	  DeviceMenu,
-	},
+  components: {
+    DeviceMenu,
+  },
   data() {
     return {
       backPic0: "url(/static/topnavbar0.png)",
       backPic: "url(/static/topnavbar.png)",
       PageCur: "0",
-	  showColum: {},
-	  menushow: false,
-	  deviceType:'',
-	  tabList: [
-		  {
-			name: '设备监测'
-		  },
-		  {
-			name: '历史数据'
-		  },
-		  {
-			name: '操作记录'
-		  },
-	  ],
+      showColum: {},
+      menushow: false,
+      deviceType: "gate",
+      tabList: [
+        {
+          name: "设备监测",
+        },
+        {
+          name: "历史数据",
+        },
+        {
+          name: "操作记录",
+        },
+      ],
     };
   },
   created() {
@@ -69,47 +88,48 @@ export default {
   methods: {
     NavChange: function (item) {
       this.PageCur = item.index;
-	  this.menushow = false
+      this.menushow = false;
+    },
+    devicemenuShow(e) {
+      this.menushow = !this.menushow;
+    },
+    menuClick(id) {
+      // debugger
+      // this.TabCur = id;
+      this.deviceType = id;
+      console.log(this.deviceType, "设备类型");
+      this.menushow = false;
+    },
+    getShowColum() {
+      new Promise((resolve, reject) => {
+        api
+          .getShowColum({})
+          .then((response) => {
+            if (response.data.code == 200) {
+              var showlist = response.data.result;
+              this.$store.commit("SET_SHOWCOLUM", showlist);
+              this.showColum = showlist;
+            } else {
+              resolve(response);
+            }
+          })
+          .catch((error) => {
+            console.log("catch===>response", response);
+            reject(error);
+          });
+      });
+    },
+    setMenushow(params) {
+      if (params) {
+        this.menushow = params.menushow;
+      }
     },
-	devicemenuShow(e) {
-	  this.menushow = !this.menushow;
-	},
-	menuClick(id) {
-		debugger
-	  // this.TabCur = id;
-	  this.deviceType = id;
-	  this.menushow = false;
-	},
-	getShowColum() {
-	  new Promise((resolve, reject) => {
-	    api
-	      .getShowColum({})
-	      .then((response) => {
-	        if (response.data.code == 200) {
-	          var showlist = response.data.result;
-	          this.$store.commit("SET_SHOWCOLUM", showlist);
-	          this.showColum = showlist;
-	        } else {
-	          resolve(response);
-	        }
-	      })
-	      .catch((error) => {
-	        console.log("catch===>response", response);
-	        reject(error);
-	      });
-	  });
-	},
-	setMenushow(params) {
-		if(params){
-			this.menushow = params.menushow
-		}
-	}
   },
 };
 </script>
 
 <style lang="scss" scoped>
-	.devic-box-tab{
-		// margin-top: 50px;
-	}
+.devic-box-tab {
+  // margin-top: 50px;
+}
 </style>

+ 5 - 7
pages/history/history.vue

@@ -113,9 +113,7 @@
                   <span style="float: right">连接</span>
                 </div>
               </u-col>
-              <u-col span="2">
-              
-              </u-col>
+              <u-col span="2"> </u-col>
               <u-col span="3"> </u-col>
               <u-col span="5">
                 <u--text class="timetext" :text="item.ttime"></u--text>
@@ -235,7 +233,7 @@ export default {
         ],
       ],
       deviceID: "", //设备ID
-      // deviceType: "", //设备类型
+      //deviceType: "", //设备类型
       skip: 8, //时间间隔
       dataTime: dayjs().format("YYYY-MM-DD HH:mm:ss"),
       historyData: [], //历史数据
@@ -256,8 +254,8 @@ export default {
       async handler(data) {
         if (data) {
           this.TabCur = data;
+          console.log(this.TabCur, "设备");
           this.curlist = this.deviceList[this.TabCur];
-
           if (this.curlist == null) {
             this.curlist = [];
           }
@@ -279,7 +277,7 @@ export default {
     this.EndTime = dayjs(endTime).format("YYYY-MM-DD HH:mm:ss");
   },
   mounted() {
-    this.TabCur = this.deviceType;
+    // this.TabCur = this.deviceType;
   },
   methods: {
     loadData(type) {
@@ -345,7 +343,7 @@ export default {
     },
     //查询历史数据 getDeviceHistory
     checkHistory() {
-      debugger;
+      // debugger;
       const params = {
         ttime_begin: this.StartTime,
         ttime_end: this.EndTime,

+ 7 - 1
pages/home/detail/autodoor/autodoor.vue

@@ -1,7 +1,12 @@
 <template>
   <view style="overflow: auto; height: 100%">
     <!-- 建议放在外层 -->
-    <u-navbar :title="name" @leftClick="backPage" :bgImage="backPic" :bgStatusImage="backPic0">
+    <u-navbar
+      :title="name"
+      @leftClick="backPage"
+      :bgImage="backPic"
+      :bgStatusImage="backPic0"
+    >
       <view class="u-nav-slot" slot="left">
         <u-icon name="arrow-left" size="20"> </u-icon>
       </view>
@@ -228,6 +233,7 @@
       </view>
     </view>
     <view class="passwordPopup">
+      <u-modal :show="show" :title="title" :content="content"></u-modal>
       <u-popup
         :show="show"
         mode="bottom"

+ 34 - 9
pages/home/detail/doorAnimate/doorAnimate.vue

@@ -29,7 +29,7 @@
           ></div>
         </div>
         <div>
-         <!-- <video
+          <!-- <video
             v-if="item.type == 'flv'"
             :id="'cameraElement' + item.id"
             muted
@@ -95,6 +95,7 @@
           ></div>
         </div>
         <div>
+          <!-- <view class="video-js flex" ref="video"> </view> -->
         </div>
       </div>
       <div style="" v-show="doorcount == 3">
@@ -177,7 +178,7 @@
           ></div>
         </div>
         <div>
-         <!-- <video
+          <!-- <video
             v-if="item.type == 'flv'"
             :id="'cameraElement' + item.id"
             muted
@@ -295,7 +296,7 @@
           ></div>
         </div>
         <div>
-         <!-- <video
+          <!-- <video
             v-if="item.type == 'flv'"
             :id="'cameraElement' + item.id"
             muted
@@ -312,10 +313,14 @@
 </template>
 
 <script>
+// import FlvJs from 'flv.js';
 export default {
   data() {
     return {
       height: "200px",
+      videoDeviceId: "",
+      flvPlayer: "",
+      VideoDeviceUrl: "",
     };
   },
   props: [
@@ -327,9 +332,31 @@ export default {
     "cameralist",
   ],
   methods: {
-    initData(val) {
-		
-    },
+    initData(val) {},
+    // videoPush: function () {
+    //   var video = document.createElement("video");
+    //   video.id = "video";
+    //   video.style = "width: 100%;";
+    //   video.controls = true;
+    //   this.flvPlayer = flvjs.createPlayer({
+    //     type: "flv",
+    //     isLive: true,
+    //     url: this.VideoDeviceUrl,
+    //   });
+    //   this.flvPlayer.attachMediaElement(video);
+    //   this.flvPlayer.load();
+    //   this.flvPlayer.play();
+    //   this.$refs.video.$el.appendChild(video);
+    // },
+
+    // //注销视频
+    // flv_destroy() {
+    //   this.flvPlayer.pause();
+    //   this.flvPlayer.unload();
+    //   this.flvPlayer.detachMediaElement();
+    //   this.flvPlayer.destroy();
+    //   this.flvPlayer = null;
+    // },
   },
   watch: {
     doorcount(val) {
@@ -350,9 +377,7 @@ export default {
       this.initData(val);
     },
   },
-  onUnload() {
-    
-  },
+  onUnload() {},
 };
 </script>
 

+ 1 - 1
pages/index/index.vue

@@ -52,7 +52,7 @@
         text="我的"
         name="user"
         icon="bell"
-      ></u-tabbar-item> -->
+      ></u-tabbar-item>
     </u-tabbar>
   </view>
 </template>

+ 16 - 16
pages/login/login.vue

@@ -2,8 +2,7 @@
     <view class="zai-box">
       <scroll-view scroll-y class="page">
         <view class="text-center" :style="[{ animation: 'show ' + 0.4 + 's 1' }]">
-          <image src="/static/desk-img/144.png" mode='aspectFit' class="zai-logo "></image>
-          <view class="zai-title text-shadow ">登 录</view>
+          <image src="/static/desk-img/logo.png" mode='aspectFit' class="zai-logo "></image>
         </view>
         <view class="text-center" :style="[{ animation: 'show ' + 0.4 + 's 1' }]">
           <!-- <u-link  class="zai-title2 text-shadow " href="http://localhost:8080?ticket=234" >切换单点登录</u-link> -->
@@ -52,6 +51,7 @@
 import { ACCESS_TOKEN, USER_NAME, USER_INFO } from "@/common/util/constants";
 import { mapActions } from "vuex";
 import configService from "@/common/service/config.service.js";
+import FlvJs from "flv.js";
 import api from "@/api/api";
 export default {
   data() {
@@ -104,10 +104,9 @@ export default {
   methods: {
     ...mapActions(["mLogin", "PhoneLogin", "ThirdLogin"]),
 
-
     // 判断是否在APP环境中
     isApp() {
-      return typeof plus !== 'undefined';
+      return typeof plus !== "undefined";
     },
 
     onLogin: function () {
@@ -132,10 +131,10 @@ export default {
               // console.log('当前是APP环境');
               this.saveClientId();
             } else {
-              this.getPermissionList()
+              this.getPermissionList();
             }
             // #ifdef APP-PLUS
-            
+
             // #endif
             // #ifndef APP-PLUS
             // #endif
@@ -158,12 +157,12 @@ export default {
         api
           .getPermission({})
           .then((response) => {
-            console.log(response, '权限菜单----------------')
+            console.log(response, "权限菜单----------------");
             if (response.statusCode == 200) {
-              let data = response.data.result.menuApp
-              let dataBtn = response.data.result.appauth
-              uni.setStorageSync('menuPermission', data);
-              uni.setStorageSync('btnPermission', dataBtn);
+              let data = response.data.result.menuApp;
+              let dataBtn = response.data.result.appauth;
+              uni.setStorageSync("menuPermission", data);
+              uni.setStorageSync("btnPermission", dataBtn);
               this.$tip.success("登录成功!");
               uni.navigateTo({
                 url: "/pages/index/index",
@@ -186,7 +185,7 @@ export default {
         .then((res) => {
           console.log("res::saveClientId>", res);
           //获取权限菜单
-          this.getPermissionList()
+          this.getPermissionList();
         });
     },
     changePassword() {
@@ -274,8 +273,7 @@ export default {
       var tourl = configService.apiUrl;
       tourl = tourl.replace(9999, 8092);
       var rastourl =
-        "https://id.shendong.com.cn/default" +
-        "/login?service=" +tourl;
+        "https://id.shendong.com.cn/default" + "/login?service=" + tourl;
       console.log("===========" + rastourl);
       this.openBrowser(rastourl);
       // window.location.href='/pages/index/index?ticket=123'
@@ -299,10 +297,12 @@ export default {
 
 <style>
 .login-paddingtop {
-  padding-top: 100upx;
+  padding-top: 300upx;
 }
-
 .zai-box {
+	height: 100vh;
+	background-image: url(/static/desk-img/loginBg.png);
+	background-size: cover;
   padding: 0 20upx;
   padding-top: 100upx;
   position: relative;

+ 98 - 74
pages/warndata/components/gas-detail.vue

@@ -1,19 +1,32 @@
 <template>
   <view class="gas-detail">
-    <u-tabs class="devic-box-tab" :current="PageCur" :list="tabList" @click="NavChange"></u-tabs>
+    <u-tabs
+      class="devic-box-tab"
+      :current="PageCur"
+      :list="tabList"
+      @click="NavChange"
+    ></u-tabs>
     <view class="gas-content" v-if="PageCur == 0">
       <view class="search-area">
         <view class="search-l">
-
           <view class="search-item" @click="getChangeJcd">
             <text class="search-label">监测点:</text>
-            <u--input inputAlign="center" v-model="searchText" placeholder="请选择监测点" suffixIcon="arrow-right"
-              suffixIconStyle="color: #909399"></u--input>
-            <u-action-sheet :show="showJcd" :actions="selectList" title="请选择监测点" @close="showJcd = false"
-              @select="selectChangeJcd">
+            <u--input
+              inputAlign="center"
+              v-model="searchText"
+              placeholder="请选择监测点"
+              suffixIcon="arrow-right"
+              suffixIconStyle="color: #909399"
+            ></u--input>
+            <u-action-sheet
+              :show="showJcd"
+              :actions="selectList"
+              title="请选择监测点"
+              @close="showJcd = false"
+              @select="selectChangeJcd"
+            >
             </u-action-sheet>
           </view>
-
         </view>
         <view class="search-r">
           <!-- <image src="/static/model/alarmTrue.svg" alt="" class="icon-style" /> -->
@@ -23,9 +36,13 @@
       </view>
       <view class="top-area">
         <view class="top-title">
-          <view style="font-weight: bold;">瓦斯抽采泵信息</view>
+          <view style="font-weight: bold">瓦斯抽采泵信息</view>
         </view>
-        <view class="top-content" v-for="(item, index) in topContentList" :key="index">
+        <view
+          class="top-content"
+          v-for="(item, index) in topContentList"
+          :key="index"
+        >
           <view class="content-title">{{ item.strinstallpos }}</view>
           <view class="content-item-box">
             <view class="content-item">
@@ -35,46 +52,54 @@
               </view>
               <view class="item-c"></view>
               <view class="item-r">
-                <view class="item-value">{{ item.readData.coVal || '--' }}</view>
+                <view class="item-value">{{
+                  item.readData.coVal || "--"
+                }}</view>
                 <view class="item-label">输入管道内一氧化碳(ppm)</view>
               </view>
             </view>
             <view class="content-item">
               <view class="item-l">
-                <view class="item-value">{{ item.readData.gas1 || '--' }}</view>
+                <view class="item-value">{{ item.readData.gas1 || "--" }}</view>
                 <view class="item-label">管路出口处瓦斯</view>
               </view>
               <view class="item-c"></view>
               <view class="item-r">
-                <view class="item-value">{{ item.readData.gas2 || '--' }}</view>
+                <view class="item-value">{{ item.readData.gas2 || "--" }}</view>
                 <view class="item-label">泵站内瓦斯</view>
               </view>
             </view>
             <view class="content-item">
               <view class="item-l">
-                <view class="item-value">{{ item.readData.gas3 || '--' }}</view>
+                <view class="item-value">{{ item.readData.gas3 || "--" }}</view>
                 <view class="item-label">输入管道内瓦斯</view>
               </view>
               <view class="item-c"></view>
               <view class="item-r">
-                <view class="item-value">{{ item.readData.gas4 || '--' }}</view>
+                <view class="item-value">{{ item.readData.gas4 || "--" }}</view>
                 <view class="item-label">管道输出瓦斯</view>
               </view>
             </view>
             <view class="content-item">
               <view class="item-l">
-                <view class="item-value">{{ item.readData.mixedTraffic || '--' }}</view>
+                <view class="item-value">{{
+                  item.readData.mixedTraffic || "--"
+                }}</view>
                 <view class="item-label">输入管道内工混流量</view>
               </view>
               <view class="item-c"></view>
               <view class="item-r">
-                <view class="item-value">{{ item.readData.standardTraffic || '--' }}</view>
+                <view class="item-value">{{
+                  item.readData.standardTraffic || "--"
+                }}</view>
                 <view class="item-label">输入管道内标况流量</view>
               </view>
             </view>
             <view class="content-item">
               <view class="item-l">
-                <view class="item-value">{{ item.readData.totalGasDrainage || '--' }}</view>
+                <view class="item-value">{{
+                  item.readData.totalGasDrainage || "--"
+                }}</view>
                 <view class="item-label">瓦斯抽放量</view>
               </view>
               <view class="item-c"></view>
@@ -84,15 +109,18 @@
               </view>
             </view>
           </view>
-
         </view>
       </view>
       <view class="bot-area">
         <view class="top-title">
-          <view style="font-weight: bold;">安全监测点信息</view>
+          <view style="font-weight: bold">安全监测点信息</view>
         </view>
-        <view class="top-content" v-for="(item, index) in botContentList" :key="index">
-          <view class="content-title">{{ item.strinstallpos || '--' }}</view>
+        <view
+          class="top-content"
+          v-for="(item, index) in botContentList"
+          :key="index"
+        >
+          <view class="content-title">{{ item.strinstallpos || "--" }}</view>
           <view class="content-item-box">
             <view class="content-item">
               <view class="item-l">
@@ -101,70 +129,59 @@
               </view>
               <view class="item-c"></view>
               <view class="item-r">
-                <view class="item-value">{{ item.readData.gasC || '--' }}</view>
+                <view class="item-value">{{ item.readData.gasC || "--" }}</view>
                 <view class="item-label">甲烷</view>
               </view>
             </view>
             <view class="content-item">
               <view class="item-l">
-                <view class="item-value">{{ item.warnFlag || '--' }}</view>
+                <view class="item-value">{{ item.warnFlag || "--" }}</view>
                 <view class="item-label">测点状态</view>
               </view>
               <view class="item-c"></view>
               <view class="item-r">
-                <view class="item-value">{{ item.readTime || '--' }}</view>
+                <view class="item-value">{{ item.readTime || "--" }}</view>
                 <view class="item-label">数据时间</view>
               </view>
             </view>
-
           </view>
-
         </view>
       </view>
-
     </view>
-
-
   </view>
 </template>
 
 <script>
 import api from "@/api/api";
-import moment from 'moment'
+import moment from "moment";
 export default {
-  name: 'gasDetail',
+  name: "gasDetail",
   props: {},
   watch: {},
   data() {
     return {
       timeRan: Number(new Date()),
-      timer: '',
+      timer: "",
       PageCur: "0",
-      tabList: [
-        { name: '预警监测' },
-        { name: '预警指标' },
-      ],
+      tabList: [{ name: "预警监测" }, { name: "预警指标" }],
       // isShowSelect: true,
       showJcd: false,
-      searchText: '',
+      searchText: "",
       selectList: [],
       topContentList: [],
       botContentList: [],
-
     };
   },
   beforeDestroy() {
-    this.timer = null
-    clearTimeout(this.timer)
+    this.timer = null;
+    clearTimeout(this.timer);
   },
   mounted() {
-    this.getTabList()
+    this.getTabList();
   },
   methods: {
-
-
     NavChange: function (item) {
-      clearTimeout(this.timer)
+      clearTimeout(this.timer);
       this.PageCur = item.index;
       if (this.PageCur == 0) {
         this.getMonitor(this.selectList[this.PageCur].deviceID, true);
@@ -172,19 +189,18 @@ export default {
     },
 
     getChangeJcd() {
-      this.showJcd = true
-
+      this.showJcd = true;
     },
     selectChangeJcd(e) {
-      clearTimeout(this.timer)
-      this.searchText = e.name
+      clearTimeout(this.timer);
+      this.searchText = e.name;
       this.getMonitor(e.deviceID, true);
     },
     getMonitor(deviceID, flag) {
-      let than = this
+      let than = this;
       than.timer = setTimeout(
         async () => {
-          await than.getSysWarnList(deviceID, 'gas');
+          await than.getSysWarnList(deviceID, "gas");
           if (than.timer) {
             than.timer = null;
           }
@@ -197,19 +213,19 @@ export default {
     getTabList() {
       new Promise((resolve, reject) => {
         api
-          .sysTypeWarn({ type: 'gas' })
+          .sysTypeWarn({ type: "gas" })
           .then((response) => {
             if (response.data.code == 200 && response.data.result.length != 0) {
-              let result = response.data.result
-              this.selectList = result.map((el) => {//lxh
+              let result = response.data.result;
+              this.selectList = result.map((el) => {
+                //lxh
                 return {
                   name: el.systemname,
                   deviceID: el.id,
                 };
               });
-              this.searchText = this.selectList[0].name
+              this.searchText = this.selectList[0].name;
               this.getMonitor(this.selectList[0].deviceID, true);
-
             } else {
               reject(response);
             }
@@ -227,9 +243,9 @@ export default {
           .sysWarn({ sysid: id, type: type })
           .then((response) => {
             if (response.data.code == 200) {
-              let data = response.data.result
-              this.topContentList = data.pump
-              this.botContentList = data.gas
+              let data = response.data.result;
+              this.topContentList = data.pump;
+              this.botContentList = data.gas;
             } else {
               reject(response);
             }
@@ -255,7 +271,7 @@ export default {
   }
 
   .gas-content {
-    height: 704px;
+    height: 100%;
     box-sizing: border-box;
     overflow-y: auto;
 
@@ -266,7 +282,7 @@ export default {
       justify-content: center;
       align-items: center;
       box-sizing: border-box;
-      background-color: #FFF;
+      background-color: #fff;
       margin-bottom: 2px;
 
       .search-l {
@@ -281,11 +297,9 @@ export default {
           align-items: center;
 
           .search-label {
-
             text-align: right;
           }
         }
-
       }
 
       .search-r {
@@ -307,14 +321,13 @@ export default {
           font-weight: bold;
           color: #0eb4fc;
         }
-
       }
     }
 
     .top-area {
       width: 100%;
       padding: 0px 10px;
-      background-color: #FFF;
+      background-color: #fff;
       margin-bottom: 2px;
       box-sizing: border-box;
     }
@@ -322,7 +335,7 @@ export default {
     .bot-area {
       width: 100%;
       padding: 0px 10px;
-      background-color: #FFF;
+      background-color: #fff;
       margin-bottom: 2px;
       box-sizing: border-box;
     }
@@ -341,7 +354,7 @@ export default {
         line-height: 26px;
         padding: 0px 20px;
         font-size: 12px;
-        background: url('/static/warndata/title.png') no-repeat;
+        background: url("/static/warndata/title.png") no-repeat;
         background-size: 100% 100%;
       }
 
@@ -353,7 +366,12 @@ export default {
           display: flex;
           justify-content: space-between;
           align-items: center;
-          background: linear-gradient(to right, rgba(55, 135, 254, 0.08), rgba(4, 184, 255, 0.08), rgba(60, 161, 237, 0.08));
+          background: linear-gradient(
+            to right,
+            rgba(55, 135, 254, 0.08),
+            rgba(4, 184, 255, 0.08),
+            rgba(60, 161, 237, 0.08)
+          );
           border-radius: 10px;
           margin-bottom: 5px;
 
@@ -370,7 +388,13 @@ export default {
             width: 4px;
             height: 70%;
             border-left: 2px solid;
-            border-image: linear-gradient(to bottom, transparent, rgba(140, 203, 254, 1), transparent) 1 1 1;
+            border-image: linear-gradient(
+                to bottom,
+                transparent,
+                rgba(140, 203, 254, 1),
+                transparent
+              )
+              1 1 1;
           }
 
           .item-r {
@@ -402,7 +426,7 @@ export default {
       width: 100%;
       padding: 10px;
       box-sizing: border-box;
-      background-color: #FFF;
+      background-color: #fff;
       margin-bottom: 2px;
     }
 
@@ -410,7 +434,7 @@ export default {
       width: 100%;
       padding: 10px 40px;
       box-sizing: border-box;
-      background-color: #FFF;
+      background-color: #fff;
       margin-bottom: 2px;
     }
 
@@ -418,7 +442,7 @@ export default {
       width: 100%;
       padding: 10px;
       box-sizing: border-box;
-      background-color: #FFF;
+      background-color: #fff;
       margin-bottom: 2px;
     }
 
@@ -427,7 +451,7 @@ export default {
       width: 100%;
       padding: 8px 10px;
       box-sizing: border-box;
-      background-color: #FFF;
+      background-color: #fff;
 
       // margin-bottom: 2px;
       .u-button {
@@ -441,7 +465,7 @@ export default {
       padding: 0px 20px;
       margin-bottom: 10px;
       font-size: 12px;
-      background: url('/static/warndata/title.png') no-repeat;
+      background: url("/static/warndata/title.png") no-repeat;
       background-size: 100% 100%;
     }
 
@@ -475,7 +499,7 @@ export default {
       line-height: 26px;
       padding-left: 20px;
       font-size: 12px;
-      background: url('/static/warndata/title.png') no-repeat;
+      background: url("/static/warndata/title.png") no-repeat;
       background-size: 100% 100%;
     }
 

+ 97 - 59
pages/warndata/warndata.vue

@@ -1,11 +1,16 @@
 <template>
   <view class="container">
-    <u-navbar :title="titleName" :safeAreaInsetTop="true" left-icon="" @leftClick="menuShow">
+    <u-navbar
+      :title="titleName"
+      :safeAreaInsetTop="true"
+      left-icon=""
+      @leftClick="menuShow"
+    >
       <view class="u-nav-slot" slot="left" v-if="!isShowDetail">
-        <u-icon name="list" size="20"> </u-icon>
+        <u-icon name="arrow-left" size="20"> </u-icon>
       </view>
     </u-navbar>
- 
+
     <view class="main" v-if="isShowDetail">
       <view class="flcard" v-if="isShow1">
         <view class="typeBar">
@@ -13,7 +18,7 @@
             <text class="text-style">通风监测预警</text>
             <u-icon name="eye" @click="getDetail('vent')"></u-icon>
           </view>
-          <u-icon @click="toggleIsShow1" name="arrow-up"></u-icon>
+          <u-icon @click="toggleIsShow1" name="arrow-up-fill"></u-icon>
         </view>
       </view>
       <view class="flcard" v-else>
@@ -63,10 +68,17 @@
             <span class="firetext">内因火灾</span>
           </view>
           <view class="firecard fire-style">
-            <view v-for="(item, index) in internalInfo" :key="index" class="fire-item"
-              v-if="item && Object.keys(item).length > 0">
+            <view
+              v-for="(item, index) in internalInfo"
+              :key="index"
+              class="fire-item"
+              v-if="item && Object.keys(item).length > 0"
+            >
               <view style="margin-top: 20rpx">
-                <text :class="item.Maxlevel > 0 ? 'red-text-style' : 'text-style1'">{{ item.value }}</text>
+                <text
+                  :class="item.Maxlevel > 0 ? 'red-text-style' : 'text-style1'"
+                  >{{ item.value }}</text
+                >
                 <view style="margin-top: 10rpx">{{ item.name }}</view>
               </view>
             </view>
@@ -77,9 +89,16 @@
             <span class="firetext">外因火灾</span>
           </view>
           <view class="firecard fire-style">
-            <view v-for="(item, index) in externalInfo" :key="index" class="fire-item">
+            <view
+              v-for="(item, index) in externalInfo"
+              :key="index"
+              class="fire-item"
+            >
               <view style="margin-top: 20rpx">
-                <text :class="item.Maxlevel > 0 ? 'red-text-style' : 'text-style1'">{{ item.value }}</text>
+                <text
+                  :class="item.Maxlevel > 0 ? 'red-text-style' : 'text-style1'"
+                  >{{ item.value }}</text
+                >
                 <view style="margin-top: 10rpx">{{ item.name }}</view>
               </view>
             </view>
@@ -105,10 +124,14 @@
         <view class="firecard fire-style">
           <view v-for="(value, key) in dustData" :key="key" class="fire-item">
             <view style="margin-top: 20rpx">
-              <image src="/static/warndata/alarm.svg" class="icon-style"
-                :style="{ backgroundColor: key === 'alarm' ? 'red' : key }"></image>
+              <image
+                src="/static/warndata/alarm.svg"
+                class="icon-style"
+                :style="{ backgroundColor: key === 'alarm' ? 'red' : key }"
+              ></image>
               <span style="margin-top: 10rpx">
-                {{ dustMap[key] }} :{{ value }}</span>
+                {{ dustMap[key] }} :{{ value }}</span
+              >
             </view>
           </view>
         </view>
@@ -132,7 +155,9 @@
       <view class="flcard" v-show="isShow4">
         <view class="firecontainer">
           <view class="title">
-            <span class="firetext" v-if="gasDevice.length > 0">安全监测系统监测点</span>
+            <span class="firetext" v-if="gasDevice.length > 0"
+              >安全监测系统监测点</span
+            >
           </view>
           <view class="gascard" v-for="(item, index) in gasDevice">
             <view style="margin-top: 20rpx">
@@ -143,7 +168,9 @@
         </view>
         <view class="firecontainer">
           <view class="title">
-            <span class="firetext" v-if="gasDevice.length > 0">瓦斯抽采系统监测点</span>
+            <span class="firetext" v-if="gasDevice.length > 0"
+              >瓦斯抽采系统监测点</span
+            >
           </view>
           <view class="gascontainer">
             <view class="gascard" v-for="(item, index) in gasDevice">
@@ -172,8 +199,12 @@
       </view>
       <view class="flcard demo-layout bg-purple-light" v-show="isShow5">
         <view class="deviceCard">
-          <view class="item-container" v-for="(item, index) in devicekindData" :key="index"
-            :style="{ backgroundImage: itemBackground(item) }">
+          <view
+            class="item-container"
+            v-for="(item, index) in devicekindData"
+            :key="index"
+            :style="{ backgroundImage: itemBackground(item) }"
+          >
             <view class="item">
               <text style="margin-right: 10px">{{ item.name }}</text>
               <text>{{ item.status }}</text>
@@ -190,20 +221,20 @@
 
 <script>
 import api from "@/api/api";
-import ventDetail from './components/vent-detail.vue'
-import deviceDetail from './components/device-detail.vue'
-import fireDetail from './components/fire-detail.vue'
-import dustDetail from './components/dust-detail.vue'
-import gasDetail from './components/gas-detail.vue'
+import ventDetail from "./components/vent-detail.vue";
+import deviceDetail from "./components/device-detail.vue";
+import fireDetail from "./components/fire-detail.vue";
+import dustDetail from "./components/dust-detail.vue";
+import gasDetail from "./components/gas-detail.vue";
 
 export default {
   props: {},
   watch: {},
   data() {
     return {
-      titleName:'预警分析',
+      titleName: "预警分析",
       isShowDetail: true,
-      detailComponent: '',
+      detailComponent: "",
       windData: {},
       devicekindData: [],
       fireData: [],
@@ -253,15 +284,14 @@ export default {
   mounted() {
     this.getWranInfo();
   },
-  components:{
-	  ventDetail,
-	  deviceDetail,
-	  fireDetail,
-	  dustDetail,
-	  gasDetail
+  components: {
+    ventDetail,
+    deviceDetail,
+    fireDetail,
+    dustDetail,
+    gasDetail,
   },
   methods: {
-  
     //获取预警信息
     getWranInfo() {
       new Promise((resolve, reject) => {
@@ -290,31 +320,31 @@ export default {
     },
     //返回监测首页
     menuShow() {
-      this.isShowDetail = true
+      this.isShowDetail = true;
     },
     //跳转监测详情
     getDetail(data) {
-      this.isShowDetail = false
+      this.isShowDetail = false;
       switch (data) {
-        case 'vent':
-          this.titleName='通风监测预警'
-          this.detailComponent = ventDetail
+        case "vent":
+          this.titleName = "通风监测预警";
+          this.detailComponent = ventDetail;
           break;
-        case 'device':
-           this.titleName='设备监测预警'
-          this.detailComponent = deviceDetail
+        case "device":
+          this.titleName = "设备监测预警";
+          this.detailComponent = deviceDetail;
           break;
-        case 'fire':
-           this.titleName='火灾监测预警'
-          this.detailComponent = fireDetail
+        case "fire":
+          this.titleName = "火灾监测预警";
+          this.detailComponent = fireDetail;
           break;
-        case 'dust':
-           this.titleName='粉尘监测预警'
-          this.detailComponent = dustDetail
+        case "dust":
+          this.titleName = "粉尘监测预警";
+          this.detailComponent = dustDetail;
           break;
-        case 'gas':
-           this.titleName='瓦斯监测预警'
-          this.detailComponent = gasDetail
+        case "gas":
+          this.titleName = "瓦斯监测预警";
+          this.detailComponent = gasDetail;
           break;
       }
     },
@@ -380,10 +410,12 @@ export default {
   text-align: center;
   border-radius: 10px;
   background: url(/static/model/windM3.png),
-    linear-gradient(to right,
+    linear-gradient(
+      to right,
       rgba(55, 135, 254, 0.08),
       rgba(4, 184, 255, 0.08),
-      rgba(60, 161, 237, 0.08));
+      rgba(60, 161, 237, 0.08)
+    );
 }
 
 .datacard1 {
@@ -393,10 +425,12 @@ export default {
   height: 200rpx;
   text-align: center;
   border-radius: 10px;
-  background: linear-gradient(to right,
-      rgba(55, 135, 254, 0.08),
-      rgba(4, 184, 255, 0.08),
-      rgba(60, 161, 237, 0.08));
+  background: linear-gradient(
+    to right,
+    rgba(55, 135, 254, 0.08),
+    rgba(4, 184, 255, 0.08),
+    rgba(60, 161, 237, 0.08)
+  );
 }
 
 .title {
@@ -419,10 +453,12 @@ export default {
   text-align: center;
   border-radius: 10px;
   margin-top: 10px;
-  background: linear-gradient(to right,
-      rgba(55, 135, 254, 0.08),
-      rgba(4, 184, 255, 0.08),
-      rgba(60, 161, 237, 0.08));
+  background: linear-gradient(
+    to right,
+    rgba(55, 135, 254, 0.08),
+    rgba(4, 184, 255, 0.08),
+    rgba(60, 161, 237, 0.08)
+  );
   background-repeat: repeat;
 }
 
@@ -489,10 +525,12 @@ export default {
   border-radius: 10px;
   margin: 10px;
   background: url(/static/warndata/work.png),
-    linear-gradient(to right,
+    linear-gradient(
+      to right,
       rgba(55, 135, 254, 0.08),
       rgba(4, 184, 255, 0.08),
-      rgba(60, 161, 237, 0.08));
+      rgba(60, 161, 237, 0.08)
+    );
 }
 
 .icon-style {

+ 181 - 178
pages/webview/webview.vue

@@ -1,31 +1,35 @@
 <!-- /pages/webview/webview.vue -->
 <template>
-	<view>
-		<web-view style="height:calc(100% - 30px);margin-top:30px" :src="src" ref="webview"></web-view>
-		<view class="zai-title text-shadow " style="position: fixed;top:5px;z-index:3">返回</view>
-	</view>
+  <view>
+    <web-view
+      style="height: calc(100% - 30px); margin-top: 30px"
+      :src="src"
+      ref="webview"
+    ></web-view>
+    <view
+      class="zai-title text-shadow"
+      style="position: fixed; top: 5px; z-index: 3"
+      >返回</view
+    >
+  </view>
 </template>
 
 <script>
-	import configService from "@/common/service/config.service.js";
-	import {
-		ACCESS_TOKEN,
-		USER_NAME,
-		USER_INFO
-	} from "@/common/util/constants";
-	import api from "@/api/api";
-	export default {
-		data() {
-			return {
-				timer: '',
-				src: ''
-			};
-		},
-		methods: {
-			onLoaded() {
-				this.$tip.toast("onLoaded");
-				// 在webview加载完成后,注入JavaScript代码
-				this.$refs.webview.evalJs(`
+import configService from "@/common/service/config.service.js";
+import { ACCESS_TOKEN, USER_NAME, USER_INFO } from "@/common/util/constants";
+import api from "@/api/api";
+export default {
+  data() {
+    return {
+      timer: "",
+      src: "",
+    };
+  },
+  methods: {
+    onLoaded() {
+      this.$tip.toast("onLoaded");
+      // 在webview加载完成后,注入JavaScript代码
+      this.$refs.webview.evalJs(`
 	        (function() {
 	          // 监听URL变化事件
 	          window.addEventListener('hashchange', function() {
@@ -52,166 +56,165 @@
 	        })();
 	      `);
 
-				// 监听来自webview的消息
-				window.addEventListener('message', (event) => {
-					const data = JSON.parse(event.data);
-					if (data.type === 'urlChange') {
-						console.log('Webview URL changed:', data.url);
-						// 在这里处理URL变化逻辑
-					} else if (data.type === 'initUrl') {
-						console.log('Initial Webview URL:', data.url);
-						// 处理初始化时的URL
-					}
-				});
-			},
-			startListening() {
-				this.timer = setInterval(() => {
-					var pages = getCurrentPages();
-					var page = pages[pages.length - 1];
-					var currentWebview = page.$getAppWebview();
-					var urls = currentWebview.children()[0].getURL();
-					console.log("=======当前地址======", urls);
+      // 监听来自webview的消息
+      window.addEventListener("message", (event) => {
+        const data = JSON.parse(event.data);
+        if (data.type === "urlChange") {
+          console.log("Webview URL changed:", data.url);
+          // 在这里处理URL变化逻辑
+        } else if (data.type === "initUrl") {
+          console.log("Initial Webview URL:", data.url);
+          // 处理初始化时的URL
+        }
+      });
+    },
+    startListening() {
+      this.timer = setInterval(() => {
+        var pages = getCurrentPages();
+        var page = pages[pages.length - 1];
+        var currentWebview = page.$getAppWebview();
+        var urls = currentWebview.children()[0].getURL();
+        console.log("=======当前地址======", urls);
 
-					console.log(
-						'WebView加载新页面------------------------------------------------------------------------' +
-						this.src);
-					if (urls.indexOf("ticket") != -1) {
-						this.stopListening();
-						var tourl = urls;
-						tourl = tourl.substring(tourl.indexOf("ticket") + 7, tourl.length)
-						var pos = tourl.indexOf("&");
-						if (pos != -1)
-							tourl = tourl.substring(0, pos)
-						// uni.navigateTo({
-						//   url: "/pages/login/login",
-						// });
-						this.loginCas(tourl)
-					}
-				}, 1000); // 间隔3秒检查一次
-			},
-			stopListening() {
-				if (this.timer) {
-					clearInterval(this.timer);
-					this.timer = null;
-				}
-			},
+        console.log(
+          "WebView加载新页面------------------------------------------------------------------------" +
+            this.src
+        );
+        if (urls.indexOf("ticket") != -1) {
+          this.stopListening();
+          var tourl = urls;
+          tourl = tourl.substring(tourl.indexOf("ticket") + 7, tourl.length);
+          var pos = tourl.indexOf("&");
+          if (pos != -1) tourl = tourl.substring(0, pos);
+          uni.navigateTo({
+            url: "/pages/login/login",
+          });
+          this.loginCas(tourl);
+        }
+      }, 1000); // 间隔3秒检查一次
+    },
+    stopListening() {
+      if (this.timer) {
+        clearInterval(this.timer);
+        this.timer = null;
+      }
+    },
 
-			loginCas(value) {
-				var than = this
-				var ser = this.src;
-				new Promise((resolve, reject) => {
-					api
-						.validateCasLogin('', "?ticket=" + value + "&service=" + ser)
-						.then((response) => {
-							debugger
-							// console.log("response===>response", JSON.stringify(response));
-							// if (response.data.code == 200) {
-							// 	uni.setStorageSync(ACCESS_TOKEN, response.data.result.token);
-							// } else {
-							// }
-							const result = response.data.result
-							const userInfo = result.userInfo
-							uni.setStorageSync(ACCESS_TOKEN, result.token);
-							uni.setStorageSync(USER_INFO, userInfo);
-							console.log("userInfo=" + userInfo)
-							this.$store.commit('SET_TOKEN', result.token)
-							console.log("result.token=" + result.token)
-							this.$store.commit('SET_DICT', result.sysAllDictItems)
-							this.$store.commit('SET_AVATAR', userInfo.avatar)
-							this.$store.commit('SET_NAME', {
-								username: userInfo.username,
-								realname: userInfo.realname
-							})
+    loginCas(value) {
+      var than = this;
+      var ser = this.src;
+      new Promise((resolve, reject) => {
+        api
+          .validateCasLogin("", "?ticket=" + value + "&service=" + ser)
+          .then((response) => {
+            debugger;
+            // console.log("response===>response", JSON.stringify(response));
+            // if (response.data.code == 200) {
+            // 	uni.setStorageSync(ACCESS_TOKEN, response.data.result.token);
+            // } else {
+            // }
+            const result = response.data.result;
+            const userInfo = result.userInfo;
+            uni.setStorageSync(ACCESS_TOKEN, result.token);
+            uni.setStorageSync(USER_INFO, userInfo);
+            console.log("userInfo=" + userInfo);
+            this.$store.commit("SET_TOKEN", result.token);
+            console.log("result.token=" + result.token);
+            this.$store.commit("SET_DICT", result.sysAllDictItems);
+            this.$store.commit("SET_AVATAR", userInfo.avatar);
+            this.$store.commit("SET_NAME", {
+              username: userInfo.username,
+              realname: userInfo.realname,
+            });
 
-							console.log("getPermissionList-----------")
-							than.getPermissionList()
-						})
-						.catch((error) => {
-							debugger
-							// console.log("catch===>response", error);
-							// uni.navigateTo({
-							//   url: "/pages/home/home",
-							// });
-						});
-				});
+            console.log("getPermissionList-----------");
+            than.getPermissionList();
+          })
+          .catch((error) => {
+            debugger;
+            // console.log("catch===>response", error);
+            // uni.navigateTo({
+            //   url: "/pages/home/home",
+            // });
+          });
+      });
+    },
 
-			},
+    //获取权限菜单
+    getPermissionList() {
+      console.log("getPermissionList=========================");
+      new Promise((resolve, reject) => {
+        api
+          .getPermission({})
+          .then((response) => {
+            console.log(response, "权限菜单----------------");
+            if (response.statusCode == 200) {
+              let data = response.data.result.menuApp;
+              let dataBtn = response.data.result.appauth;
+              uni.setStorageSync("menuPermission", data);
+              uni.setStorageSync("btnPermission", dataBtn);
+              this.$tip.success("登录成功!");
+              uni.navigateTo({
+                url: "/pages/index/index",
+              });
+            } else {
+              reject(response);
+            }
+          })
+          .catch((error) => {
+            console.log("catch===>response", response);
+            reject(error);
+          });
+      });
+    },
+    saveClientId() {
+      console.log("saveClientId=========================");
+      var info = plus.push.getClientInfo();
+      var cid = info.clientid;
+      this.$http
+        .get("/sys/user/saveClientId", {
+          params: {
+            clientId: cid,
+          },
+        })
+        .then((res) => {
+          console.log("res::saveClientId>", res);
+          //获取权限菜单
+          this.getPermissionList();
+        });
+    },
+  },
+  onShow() {
+    this.startListening();
+  },
+  onHide() {
+    this.stopListening();
+  },
+  watch: {},
+  onUnload() {
+    plus.runtime.quit();
+  },
+  onLoad(option) {
+    // 获取传递过来的url参数
+    let optionurl = option.url;
+    console.log("onLoad  当前URL:", option.url);
+    // setTimeout(()=>{
 
-			//获取权限菜单
-			getPermissionList() {
-				console.log("getPermissionList=========================")
-				new Promise((resolve, reject) => {
-					api
-						.getPermission({})
-						.then((response) => {
-							console.log(response, '权限菜单----------------')
-							if (response.statusCode == 200) {
-								let data = response.data.result.menuApp
-								let dataBtn = response.data.result.appauth
-								uni.setStorageSync('menuPermission', data);
-								uni.setStorageSync('btnPermission', dataBtn);
-								this.$tip.success("登录成功!");
-								uni.navigateTo({
-									url: "/pages/index/index",
-								});
-							} else {
-								reject(response);
-							}
-						})
-						.catch((error) => {
-							console.log("catch===>response", response);
-							reject(error);
-						});
-				});
-			},
-			saveClientId() {
-				console.log("saveClientId=========================")
-				var info = plus.push.getClientInfo();
-				var cid = info.clientid;
-				this.$http
-					.get("/sys/user/saveClientId", {
-						params: {
-							clientId: cid
-						}
-					})
-					.then((res) => {
-						console.log("res::saveClientId>", res);
-						//获取权限菜单
-						this.getPermissionList()
-					});
-			},
-		},
-		onShow() {
-			this.startListening();
-		},
-		onHide() {
-			this.stopListening();
-		},
-		watch: {},
-		onUnload() {
-			plus.runtime.quit();
-		},
-		onLoad(option) {
-			// 获取传递过来的url参数
-			let optionurl = option.url;
-			console.log('onLoad  当前URL:', option.url);
-			// setTimeout(()=>{
-
-			// 	console.log('onLoad  setNavigationBarTitle', option.url);
-			// uni.setNavigationBarTitle({
-			//         title: '单点登录'
-			//       });
-			// },2000)
-			console.log("option.url======" + option.url)
-			this.src = decodeURIComponent(optionurl);
-		}
-	};
+    // 	console.log('onLoad  setNavigationBarTitle', option.url);
+    // uni.setNavigationBarTitle({
+    //         title: '单点登录'
+    //       });
+    // },2000)
+    console.log("option.url======" + option.url);
+    this.src = decodeURIComponent(optionurl);
+  },
+};
 </script>
 <style scoped>
-	.zai-title {
-		margin-top: 20upx;
-		font-size: 58upx;
-		color: #000000;
-		text-align: center;
-	}
+.zai-title {
+  margin-top: 20upx;
+  font-size: 58upx;
+  color: #000000;
+  text-align: center;
+}
 </style>

BIN
static/desk-img/loginBg.png


BIN
static/desk-img/logo.png