Browse Source

Merge branch 'master' of http://182.92.126.35:3000/msx/Vent-App

lxh 2 months ago
parent
commit
afcc03bc04

+ 26 - 12
api/api.js

@@ -17,19 +17,33 @@ const apiService = {
   /**
    * 单点登录
    */
-  validateCasLogin(params) {
-	  var index = 0;
-	  var url = "/sys/cas/client/validateLogin";
-	  for(var w in params){
-		  if(index == 0)
-		  url = url+"?"+w+"="+params[w];
-		  else
-		  url = url+"&"+w+"="+params[w];
-		  index++;
-	  }
-    return http.get(url);
-  },
+  // validateCasLogin(params) {
+	 //  var index = 0;
+	 //  var url = "/sys/cas/client/validateLogin";
+	 //  for(var w in params){
+		//   if(index == 0)
+		//   url = url+"?"+w+"="+params[w];
+		//   else
+		//   url = url+"&"+w+"="+params[w];
+		//   index++;
+	 //  }
+  //   return http.get(url);
+  // },
 
+  validateCasLogin(to,params) {
+	  var url = to+"/sys/cas/client/validateLogin"+params;
+	  // var index = 0;
+	  // var url = "/sys/cas/client/validateLogin";
+	  // for(var w in params){
+		 //  if(index == 0)
+		 //  url = url+"?"+w+"="+params[w];
+		 //  else
+		 //  url = url+"&"+w+"="+params[w];
+		 //  index++;
+	  // }
+	  console.log("validateCasLogin url============"+url)
+    return http.get(url,{});
+  },
   /**
    * 手机号码登录
    */

+ 4 - 0
main.js

@@ -37,6 +37,10 @@ import history from "./pages/history/history.vue";
 Vue.component("history", history);
 import warndata from "./pages/warndata/warndata.vue";
 Vue.component("warndata", warndata);
+import detail from "./pages/warndata/components/device-detail.vue";
+Vue.component("detail", detail);
+import user from "./pages/user/people.vue";
+Vue.component("user", user);
 import filecenter from "./pages/filecenter/filecenter.vue";
 Vue.component("filecenter", filecenter);
 import gasreport from "./pages/gasreport/gasreport.vue";

+ 16 - 8
pages.json

@@ -130,6 +130,10 @@
       "style": {}
     },
     {
+      "path": "pages/user/user",
+      "style": {}
+    },
+    {
       "path": "pages/camera/camera",
       "style": {}
     },
@@ -159,7 +163,10 @@
     },
     {
       "path": "pages/history/history",
-      "style": {}
+      "style": {
+        "enablePillDownRefresh": true,
+        "onReachBottomDistance": 10
+      }
     },
     {
       "path": "pages/filecenter/filecenter",
@@ -167,7 +174,9 @@
     },
     {
       "path": "pages/operation/operation",
-      "style": {}
+      "style": {
+        "enablePillDownRefresh": true
+      }
     },
     {
       "path": "pages/warndata/warndata",
@@ -192,11 +201,10 @@
       "path": "pages/home/detail/fanlocalAnimate/fanlocalAnimate2"
     },
     {
-    	"path" : "pages/webview/webview",
-    	"style" : 
-    	{
-    		"navigationBarTitleText" : ""
-    	}
+      "path": "pages/webview/webview",
+      "style": {
+        "navigationBarTitleText": ""
+      }
     }
   ],
   "globalStyle": {
@@ -209,7 +217,7 @@
     "navigationBarTitleText": "JEECG BOOT",
     "navigationStyle": "custom",
     "navigationBarTextStyle": "white",
-	"pageOrientation": "auto" // 屏幕自动切换
+    "pageOrientation": "auto" // 屏幕自动切换
   },
   "usingComponts": true,
   "condition": {

+ 8 - 3
pages/filecenter/filecenter.vue

@@ -1,7 +1,9 @@
 <template name="filecenter">
+  <view >
+    <u-navbar title="文件中心" :bgStatusImage="backPic0" :bgImage="backPic" :safeAreaInsetTop="true" leftIcon=""> </u-navbar>
   <view class="container">
-    <u-navbar title="文件中心" :safeAreaInsetTop="true" leftIcon=""> </u-navbar>
     <view class="main">
+      <view class="u-page">
       <u-subsection
         :list="sectionList"
         mode="subsection"
@@ -205,6 +207,8 @@
         :duration="1000"
       ></u-notify>
     </view>
+    </view>
+    </view>
   </view>
 </template>
 
@@ -217,6 +221,8 @@ export default {
   watch: {},
   data() {
     return {
+      backPic0: "url(/static/topnavbar0.png)",
+      backPic: "url(../../static/topnavbar.png)",
       sectionList: [
         { name: "全部", code: 0 },
         { name: "待审批", code: 1 },
@@ -543,10 +549,9 @@ button {
 }
 .main {
   /* margin-top: 100rpx; */
-  margin-top: 80px;
+  /* margin-top: 80px; */
   display: flex;
   flex-direction: column;
-  margin-top: 80px; /* 内容区域顶部留出导航栏的高度 */
 }
 
 .itemback {

+ 209 - 158
pages/history/history.vue

@@ -1,7 +1,7 @@
 <template>
   <view class="container">
     <!-- 建议放在外层 -->
-<!--    <u-navbar
+    <!--    <u-navbar
       title="历史数据"
       @leftClick="devicemenuShow"
       :safeAreaInsetTop="true"
@@ -11,44 +11,43 @@
       </view>
     </u-navbar> -->
     <!-- 侧边栏 -->
-<!--    <view v-show="menushow" class="menupage">
+    <view v-show="menushow" class="menupage">
       <DeviceMenu @menuClick="menuClick"></DeviceMenu>
-    </view> -->
+    </view>
 
     <!-- 历史数据列表页 -->
     <view v-if="!menushow" class="main">
       <view class="u-page">
         <div class="flcard">
           <div class="btns">
-            <u-button
-              type="primary"
-              shape="circle"
-              :text="StartTime ? StartTime : '起始时间'"
-              @click="dataShow = true"
-            ></u-button>
-            <u-button
-              type="primary"
-              shape="circle"
-              :text="EndTime ? EndTime : '结束时间'"
-              @click="dataShow1 = true"
-            ></u-button>
+            <uni-datetime-picker
+              :show="dataShow"
+              mode="datetime"
+              @cancel="dataShow = false"
+              @confirm="selectStartTime"
+              v-model="dataTime"
+            ></uni-datetime-picker>
+            <uni-datetime-picker
+              :show="dataShow1"
+              mode="datetime"
+              @cancel="dataShow1 = false"
+              @confirm="selectEndTime"
+              v-model="dataTime"
+            ></uni-datetime-picker>
           </div>
           <div class="btns" style="margin-top: 10px">
             <u-button
               type="primary"
-              shape="circle"
               :text="deviceName ? deviceName : '选择设备'"
               @click="deviceShow = true"
             ></u-button>
             <u-button
               type="primary"
-              shape="circle"
               :text="lable ? lable : '间隔时间'"
               @click="show = true"
             ></u-button>
             <u-button
               type="primary"
-              shape="circle"
               text="查询"
               @click="checkHistory"
             ></u-button>
@@ -68,119 +67,96 @@
             keyName="label"
             @confirm="selectSkipTime"
           ></u-picker>
-          <u-datetime-picker
-            :show="dataShow"
-            mode="datetime"
-            @cancel="dataShow = false"
-            @confirm="selectStartTime"
-            v-model="dataTime"
-          ></u-datetime-picker>
-          <u-datetime-picker
-            :show="dataShow1"
-            mode="datetime"
-            @cancel="dataShow1 = false"
-            @confirm="selectEndTime"
-            v-model="dataTime"
-          ></u-datetime-picker>
         </div>
-        <u-list>
-          <u-list-item
-            class="itemback"
-            v-for="(item, index) in historyData"
-            :key="index"
-          >
-            <u-row gutter="5" customStyle="margin-bottom: 10px">
-              <u-col span="24">
-                <u--text :text="item.ginstallpos"></u--text>
-              </u-col>
-            </u-row>
-            <u-row gutter="5" customStyle="margin-bottom: 10px">
-              <u-col span="2" style="margin-right: 15rpx">
-                <div v-if="item.netStatus == 0" class="error-tag1">
-                  <image
-                    src="/static/model/connectFalse.svg"
-                    alt=""
-                    class="icon-style"
-                  />
-                  <span style="float: right">断开</span>
-                </div>
-                <div v-else class="success-tag">
-                  <image
-                    src="/static/model/connectTrue.svg"
-                    alt=""
-                    class="icon-style"
-                  />
-                  <span style="float: right">连接</span>
-                </div>
-              </u-col>
-              <u-col span="2">
-                <div v-if="item.readData[warnFlag] == 0" class="success-tag">
-                  <image
-                    src="/static/model/alarmTrue.svg"
-                    alt=""
-                    class="icon-style"
-                  />
-                  <span style="float: right">{{ item.readData[warndes] }}</span>
-                </div>
-                <div v-else class="error-tag">
-                  <image
-                    src="/static/model/alarmFalse.svg"
-                    alt=""
-                    class="icon-style"
-                  />
-                  <span style="float: right">{{ item.readData[warndes] }}</span>
-                </div>
-              </u-col>
-              <u-col span="3"> </u-col>
-              <u-col span="5">
-                <u--text class="timetext" :text="item.ttime"></u--text>
-              </u-col>
-            </u-row>
-            <view v-if="colums[TabCur + '_monitor'] != null">
-              <view
-                class="datacard"
-                v-for="(showitem, index) in colums[TabCur + '_monitor']"
-                :key="index"
-                v-show="showitem.appShow == 1"
-              >
-                <view class="content">
-                  <view>
-                    <view
-                      v-if="
-                        showitem.datatype == 1 &&
-                        item.readData[showitem.monitorcode] !== null &&
-                        item.readData[showitem.monitorcode] !== undefined
-                      "
-                      class="demo-layout bg-purple-light"
-                      style="margin-top: 10rpx; color: #3787fe"
-                      >{{ item[showitem.monitorcode] }}</view
-                    >
-                    <view
-                      v-else-if="
-                        showitem.datatype == 2 &&
-                        item.readData[showitem.monitorcode] !== null &&
-                        item.readData[showitem.monitorcode] !== undefined
-                      "
-                      class="demo-layout bg-purple-light"
-                      style="color: #3787fe"
-                      >{{ item.readData[showitem.monitorcode] }}</view
-                    >
-                    <view
-                      v-else
-                      class="demo-layout bg-purple-light"
-                      style="color: #3787fe"
-                      >--</view
-                    >
-                    <view
-                      class="demo-layout bg-purple-light"
-                      style="margin-top: 10px; color: #677799"
-                      >{{ showitem.des }}</view
-                    >
+        <u-list
+          :class="{ emptyhistory: historyData.length === 0 }"
+          class="historycontainer"
+        >
+          <template v-if="historyData.length > 0">
+            <u-list-item
+              class="itemback"
+              v-for="(item, index) in historyData"
+              :key="index"
+            >
+              <u-row gutter="5" customStyle="margin-bottom: 10px">
+                <u-col span="24">
+                  <u--text :text="item.ginstallpos"></u--text>
+                </u-col>
+              </u-row>
+              <u-row gutter="5" customStyle="margin-bottom: 10px">
+                <u-col span="2" style="margin-right: 15rpx">
+                  <div v-if="item.netStatus == 0" class="error-tag1">
+                    <image
+                      src="/static/model/connectFalse.svg"
+                      alt=""
+                      class="icon-style"
+                    />
+                    <span style="float: right">断开</span>
+                  </div>
+                  <div v-else class="success-tag">
+                    <image
+                      src="/static/model/connectTrue.svg"
+                      alt=""
+                      class="icon-style"
+                    />
+                    <span style="float: right">连接</span>
+                  </div>
+                </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>
+                </u-col>
+              </u-row>
+              <view v-if="colums[TabCur + '_monitor'] != null">
+                <view
+                  class="datacard"
+                  v-for="(showitem, index) in colums[TabCur + '_monitor']"
+                  :key="index"
+                  v-show="showitem.appShow == 1"
+                >
+                  <view class="content">
+                    <view>
+                      <view
+                        v-if="
+                          showitem.datatype == 1 &&
+                          item.readData[showitem.monitorcode] !== null &&
+                          item.readData[showitem.monitorcode] !== undefined
+                        "
+                        class="demo-layout bg-purple-light"
+                        style="margin-top: 10rpx; color: #3787fe"
+                        >{{ item[showitem.monitorcode] }}</view
+                      >
+                      <view
+                        v-else-if="
+                          showitem.datatype == 2 &&
+                          item.readData[showitem.monitorcode] !== null &&
+                          item.readData[showitem.monitorcode] !== undefined
+                        "
+                        class="demo-layout bg-purple-light"
+                        style="color: #3787fe"
+                        >{{ item.readData[showitem.monitorcode] }}</view
+                      >
+                      <view
+                        v-else
+                        class="demo-layout bg-purple-light"
+                        style="color: #3787fe"
+                        >--</view
+                      >
+                      <view
+                        class="demo-layout bg-purple-light"
+                        style="margin-top: 10px; color: #677799"
+                        >{{ showitem.des }}</view
+                      >
+                    </view>
                   </view>
                 </view>
               </view>
-            </view>
-          </u-list-item>
+            </u-list-item>
+          </template>
+          <template v-else>
+            <div class="empty-message">数据为空</div>
+          </template>
         </u-list>
       </view>
     </view>
@@ -190,6 +166,8 @@
 <script>
 import api from "@/api/api";
 import dayjs from "dayjs";
+import DeviceMenu from "../../pages/device/devicemenu/devicemenu";
+import uniDatetimePicker from "../../uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.vue";
 export default {
   data() {
     return {
@@ -247,48 +225,52 @@ export default {
         ],
       ],
       deviceID: "", //设备ID
-      // deviceType: "", //设备类型
+      //deviceType: "", //设备类型
       skip: 8, //时间间隔
       dataTime: dayjs().format("YYYY-MM-DD HH:mm:ss"),
       historyData: [], //历史数据
+      loading: false, // 是否正在加载数据
+      hasMoreData: true, // 是否还有更多数据可以加载
+      pageNo: 1, // 当前页码(用于请求数据时分页)
     };
   },
-
-  props: ["showColum", 'deviceType'],
+  components: {
+    DeviceMenu,
+    uniDatetimePicker,
+  },
+  props: ["showColum", "deviceType"],
   watch: {
     showColum(data) {
       this.colums = data;
     },
-  	deviceType: {
-  		async handler (data) {
-  			if(data){
-  				this.TabCur = data;
-  				this.curlist = this.deviceList[this.TabCur];
-  				
-  				if (this.curlist == null) {
-  							this.curlist = [];
-  				}
-  				// 选择设备分类,重新获取数据
-  				await this.loadData(this.TabCur);
-  				this.$emit('setMenushow', {
-  				  								menushow: false
-  				});
-  			}
-  		  
-  		  
-  		},
-  		immediate: true
-  	}
+    deviceType: {
+      async handler(data) {
+        if (data) {
+          this.TabCur = data;
+          console.log(this.TabCur, "设备");
+          this.curlist = this.deviceList[this.TabCur];
+          if (this.curlist == null) {
+            this.curlist = [];
+          }
+          // 选择设备分类,重新获取数据
+          await this.loadData(this.TabCur);
+          this.$emit("setMenushow", {
+            menushow: false,
+          });
+        }
+      },
+      immediate: true,
+    },
   },
   created() {
     this.colums = this.showColum;
-    const startTime =new Date().getTime() - 3600 * 1000 * 24 * 30;
+    const startTime = new Date().getTime() - 3600 * 1000 * 24 * 30;
     const endTime = new Date();
     this.StartTime = dayjs(startTime).format("YYYY-MM-DD HH:mm:ss");
     this.EndTime = dayjs(endTime).format("YYYY-MM-DD HH:mm:ss");
   },
   mounted() {
-	  this.TabCur = this.deviceType;
+    // this.TabCur = this.deviceType;
   },
   methods: {
     loadData(type) {
@@ -354,21 +336,21 @@ export default {
     },
     //查询历史数据 getDeviceHistory
     checkHistory() {
-		debugger
+      // debugger;
       const params = {
         ttime_begin: this.StartTime,
         ttime_end: this.EndTime,
         gdeviceid: this.deviceID,
         skip: this.skip,
-        pageNo: 1,
-        pageSize: 20,
+        pageNo: this.pageNo,
+        pageSize: 10,
         strtype: this.TabCur,
       };
       new Promise((resolve, reject) => {
         api
           .getDeviceHistory(params)
           .then((response) => {
-		debugger
+            debugger;
             if (response.data.code == 200) {
               this.historyData = response.data.result.datalist.records;
               this.historyData.forEach((item) => {
@@ -388,6 +370,27 @@ export default {
                   item.readData.midGateOpen = "关闭";
                 }
               });
+              this.pageNo = response.data.result.datalist.current;
+              // if (infolist.length == 0 && this.pageNo == 1) {
+              //   // console.log('首次加载没数据');
+              //   this.noData = false;
+              //   this.historyData = [];
+              // } else if (infolist.length < 3 && this.pageNo == 1) {
+              //   // console.log('首次加载有数据,但少于4条');
+              //   this.noData = true;
+              //   this.historyData = infolist;
+              // } else if (infolist.length !== 0 && this.pageNo == 1) {
+              //   // console.log('首次加载有数据');
+              //   this.noData = false;
+              //   this.historyData = infolist;
+              // } else if (infolist.length !== 0 && this.pageNo > 1) {
+              //   // console.log('上拉加载更多数据');
+              //   this.noData = false;
+              //   this.historyData = this.historyData.concat(infolist);
+              // } else if (infolist.length == 0 && this.pageNo > 1) {
+              //   // console.log('上拉加载没有更多数据了');
+              //   this.noData = true;
+              // }
             } else {
               resolve(response);
             }
@@ -397,12 +400,34 @@ export default {
           });
       });
     },
+    async loadMoreData() {
+      if (this.loading || !this.hasMoreData) return;
+      this.loading = true;
+      try {
+        // 如果新数据为空,则表示没有更多数据了
+        if (this.historyData.length === 0) {
+          this.hasMoreData = false;
+        } else {
+          // 将新数据追加到数据列表中
+          this.historyData = [...this.historyData, ...newData];
+          // 更新页码以便下次加载下一页数据
+          this.pageNo += 1;
+        }
+      } catch (error) {
+        // 处理请求错误
+        console.error("加载数据失败:", error);
+      } finally {
+        // 无论请求成功还是失败,都要将加载状态设置为false
+        this.loading = false;
+      }
+    },
     devicemenuShow(e) {
-		this.menushow = !this.menushow;
-		console.log( this.menushow,'dainjichengg成都多大事');
+      this.menushow = !this.menushow;
+      console.log(this.menushow, "dainjichengg成都多大事");
     },
     menuClick(id) {
       this.TabCur = id;
+      console.log(this.TabCur);
       // 显示该分类的数据
       this.curlist = this.deviceList[this.TabCur];
       if (this.curlist == null) {
@@ -416,10 +441,27 @@ export default {
   destroyed() {
     // 停止定时器
   },
+  onReachBottom() {
+    // uni-app提供的页面滚动到底部钩子函数
+    console.log("上拉加载更多数据");
+    this.loadMoreData();
+  },
 };
 </script>
 
 <style>
+.emptyhistory {
+  background: url("/static/empty.png") no-repeat;
+  background-size: 100% 50%;
+}
+.empty-message {
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  font-size: 16px;
+  line-height: 80vh;
+  color: #333;
+}
 .main {
   /* margin-top: 100rpx; */
   display: flex;
@@ -435,6 +477,15 @@ export default {
 .btns {
   display: flex;
 }
+.btns > * {
+  margin-right: 10px; /* 根据需要调整间距大小 */
+}
+
+/* 去除最后一个按钮的右边距 */
+.btns > *:last-child {
+  margin-right: 0;
+}
+
 .flcard {
   padding: 20rpx;
   background-color: #ffffff;

+ 92 - 44
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">
+    <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>
@@ -11,37 +16,31 @@
         <div class="button-grid flcard" v-if="this.TabCur == 'gate'">
           <u-button
             type="primary"
-            shape="circle"
             text="打开前门"
             @click="showPasswordDialog('frontGateOpen_S')"
           ></u-button>
           <u-button
             type="primary"
-            shape="circle"
             text="关闭前门"
             @click="showPasswordDialog('frontGateClose_S')"
           ></u-button>
           <u-button
             type="primary"
-            shape="circle"
             text="打开后门"
             @click="showPasswordDialog('rearGateOpen_S')"
           ></u-button>
           <u-button
             type="primary"
-            shape="circle"
             text="关闭后门"
             @click="showPasswordDialog('rearGateClose_S')"
           ></u-button>
           <u-button
             type="primary"
-            shape="circle"
             text="打开前后门"
             @click="showPasswordDialog('sameTimeOpen')"
           ></u-button>
           <u-button
             type="primary"
-            shape="circle"
             text="关闭前后门"
             @click="showPasswordDialog('sameTimeClose')"
           ></u-button>
@@ -52,7 +51,6 @@
         >
           <u-button
             type="primary"
-            shape="circle"
             text="设定面积"
             @click="showPasswordDialog('frontSetValue')"
           ></u-button>
@@ -63,13 +61,11 @@
         >
           <u-button
             type="primary"
-            shape="circle"
             text="设定前窗面积"
             @click="showPasswordDialog('frontSetValue')"
           ></u-button>
           <u-button
             type="primary"
-            shape="circle"
             text="设定后窗面积"
             @click="showPasswordDialog('rearSetValue')"
           ></u-button>
@@ -102,6 +98,19 @@
             :height="height"
           ></fanlocalAnimate>
         </div>
+        <div class="flcard" v-if="this.TabCur == 'fanmain'">
+          <fanmainAnimate
+            ref="fanpage"
+            style="width: 100%; min-width: 550px; height: calc(68vh - 220px)"
+            :door1="door1"
+            :topdoor1="topdoor1"
+            :fundoor1="fundoor1"
+            :door2="door2"
+            :topdoor2="topdoor2"
+            :fundoor2="fundoor2"
+            :nowfengji="qidongfengji"
+          ></fanmainAnimate>
+        </div>
         <div
           class="flcard"
           v-if="this.TabCur == 'window' && this.nwindownum == 1"
@@ -227,35 +236,49 @@
         </div>
       </view>
     </view>
-    <view class="passwordPopup">
-      <u-popup
-        :show="show"
-        mode="bottom"
-        :round="14"
-        :safeAreaInsetBottom="false"
-      >
-        <view style="margin-top: 15px" v-if="this.TabCur == 'window'"
-          >风窗面积:</view
-        >
-        <u-input
-          style="margin-top: 15px"
-          v-model="windowArea"
-          v-if="this.TabCur == 'window'"
-        ></u-input>
-        <view style="margin-top: 15px">请输入密码:</view>
-        <u-input
-          style="margin-top: 15px"
-          v-model="password"
-          type="password"
-        ></u-input>
-        <view class="btns">
-          <u-button type="primary" shape="circle" @click="confirmPassword()"
-            >确认</u-button
+    <u-popup :show="show" mode="bottom" :safeAreaInsetBottom="false">
+      <div class="containers">
+        <view class="passWordName">
+          <view
+            class="title"
+            style="margin-top: 15px"
+            v-if="this.TabCur == 'window'"
+            >风窗面积</view
           >
-          <u-button shape="circle" @click="cancelPassword()">取消</u-button>
+          <u-input
+            class="passArea"
+            style="margin-top: 15px; border-color: #2a94ff"
+            v-model="windowArea"
+            type="text"
+            v-if="this.TabCur == 'window'"
+          ></u-input>
         </view>
-      </u-popup>
-    </view>
+        <view class="passWordInput">
+          <view style="margin-top: 15px" class="title">输入密码</view>
+          <u-input
+            style="margin-top: 15px; border-color: #2a94ff"
+            v-model="password"
+            type="password"
+          ></u-input
+        ></view>
+      </div>
+      <view class="btns">
+        <u-button
+          style="margin: 20px"
+          type="primary"
+          @click="confirmPassword()"
+          color="linear-gradient(to right, rgb(53, 138, 254), rgb(38, 171, 244))"
+          >确认</u-button
+        >
+        <u-button
+          style="margin: 20px"
+          type="primary"
+          :plain="true"
+          @click="cancelPassword()"
+          >取消</u-button
+        >
+      </view>
+    </u-popup>
   </view>
 </template>
 
@@ -266,6 +289,7 @@ import doorAnimate from "../doorAnimate/doorAnimate.vue";
 import windowAnimate from "../windowAnimate/windowAnimate.vue";
 import windrectAnimate from "../windrectAnimate/windrectAnimate.vue";
 import fanlocalAnimate from "../fanlocalAnimate/fanlocalAnimate2.vue";
+import fanmainAnimate from "../fanmainAnimate/fanmainAnimate.vue";
 export default {
   data() {
     return {
@@ -276,7 +300,8 @@ export default {
       deviceid: "", //初始化设备id
       TabCur: "",
       checked: [],
-      backPic: "url(../../../../static/topnavbar.png)",
+      backPic0: "url(/static/topnavbar0.png)",
+      backPic: "url(/static/topnavbar.png)",
       frontAngle: "", //风窗打开角度
       nwindownum: "", //风窗道数
       ndoorcount: "", //风门道数
@@ -316,7 +341,13 @@ export default {
     this.TabCur = query.type;
     this.ndoorcount = 2;
   },
-  components: { doorAnimate, windowAnimate, windrectAnimate, fanlocalAnimate },
+  components: {
+    doorAnimate,
+    windowAnimate,
+    windrectAnimate,
+    fanlocalAnimate,
+    fanmainAnimate,
+  },
   created() {
     this.getShowList(this.TabCur);
     this.getDeviceInfo(this.itemId);
@@ -491,10 +522,6 @@ export default {
 </script>
 
 <style lang="scss" scoped>
-passwordPopup {
-  height: 300rpx;
-  background-color: #fff;
-}
 .top-nav {
   background-image: url(../../../../static/topnavbar.png);
   background-size: cover; /* 背景图片大小适应 */
@@ -688,6 +715,27 @@ div.window_new_5 {
 }
 .btns {
   display: flex;
-  margin-top: 15px;
+}
+.containers {
+  background-color: #fff;
+}
+.passWordName {
+  margin: 20px;
+  display: flex;
+  flex-direction: row;
+  justify-content: space-around;
+}
+.title {
+  margin-right: 20px;
+  line-height: 40px;
+}
+.passWordInput {
+  margin: 20px;
+  display: flex;
+  flex-direction: row;
+  justify-content: space-around;
+}
+.passArea {
+  border-color: red;
 }
 </style>

+ 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>
 

+ 38 - 15
pages/home/home.vue

@@ -161,6 +161,7 @@ export default {
       curlist: [],
       deviceList: {},
       colums: {},
+      typeList: [], //详情页展示数据
     };
   },
   props: ["showColum", "deviceType"],
@@ -262,22 +263,44 @@ export default {
     devicemenuShow(e) {
       this.menushow = !this.menushow;
     },
-    // menuClick(id) {
-    //   this.TabCur = id;
-    //   // 显示该分类的数据
-    //   this.curlist = this.deviceList[this.TabCur];
-
-    //   if (this.curlist == null) {
-    //     this.curlist = [];
-    //   }
-    //   // 选择设备分类,重新获取数据
-    //   this.loadData(this.TabCur);
-    //   this.menushow = false;
-    // },
+    //获取app展示字段数据
+    getShowList(type) {
+      const params = {
+        devicekind: type,
+        pagetype: "detail",
+        pageNo: 1,
+        pageSize: 100,
+      };
+      return new Promise((resolve, reject) => {
+        api
+          .getShowColumList(params)
+          .then((response) => {
+            if (response.data.code == 200) {
+              this.typeList = response.data.result.records;
+              resolve(response);
+            } else {
+              resolve(response);
+            }
+          })
+          .catch((error) => {
+            reject(error);
+          });
+      });
+    },
     openNewPage(params) {
-      this.$destroy();
-      uni.navigateTo({
-        url: `/pages/home/detail/autodoor/autodoor?id=${params.deviceID}&name=${params.strinstallpos}&type=${this.TabCur}`,
+      const reqData = {
+        id: params.deviceID,
+        name: params.strinstallpos,
+        type: this.TabCur,
+      };
+      const reqparams = uni.$u.queryParams(reqData);
+      this.getShowList(this.TabCur).then(() => {
+        if (this.typeList.length > 0) {
+          this.$destroy();
+          uni.navigateTo({
+            url: `/pages/home/detail/autodoor/autodoor${reqparams}`,
+          });
+        }
       });
     },
   },

+ 136 - 28
pages/index/index.vue

@@ -1,33 +1,70 @@
 <template>
   <view class="app-container">
-    <view v-if="iframeloading" class="loadding-box" :style="{
-      height: wvHeight + 'px',
-      width: wvWidth + 'px',
-      marginTop: wvTop + 'px',
-      border: 'none'
-    }">
-      <u-loading-icon></u-loading-icon>
+    <view
+      v-if="iframeloading"
+      class="loadding-box"
+      :style="{
+        height: wvHeight + 'px',
+        width: wvWidth + 'px',
+        marginTop: wvTop + 'px',
+        border: 'none',
+      }"
+    >
+      <!-- <u-loading-icon></u-loading-icon> -->
     </view>
-    <iframe v-if="PageCur == 'tun2D'" ref="iframe" src="http://182.92.126.35:8098/" @load="viewLoad" :style="{
-      height: wvHeight + 'px',
-      width: wvWidth + 'px',
-      marginTop: wvTop + 'px',
-      border: 'none',
-      background: '#000',
-    }"></iframe>
-    <Device v-if="PageCur == 'device'" :style="{ marginTop: wvTop + 20 + 'px' }"></Device>
+    <iframe
+      v-if="PageCur == 'tun2D'"
+      ref="iframe"
+      src="http://182.92.126.35:8098/"
+      @load="viewLoad"
+      :style="{
+        height: wvHeight + 'px',
+        width: wvWidth + 'px',
+        marginTop: wvTop + 'px',
+        border: 'none',
+        background: '#000',
+      }"
+    ></iframe>
+    <Device
+      v-if="PageCur == 'device'"
+      :style="{ marginTop: wvTop + 20 + 'px' }"
+    ></Device>
     <filecenter :cur="PageCur" v-if="PageCur == 'filecenter'"></filecenter>
     <warndata v-if="PageCur == 'warndata'" :cur="PageCur"></warndata>
     <gasreport :cur="PageCur" v-if="PageCur == 'gasreport'"></gasreport>
-    <u-tabbar :value="PageCur" @change="NavChange" :fixed="true" :placeholder="true" :safeAreaInsetBottom="true">
-      <u-tabbar-item v-for="(item, index) in permission " :key="index" :text="item.name" :name="item.component"
-        :icon="index = 0 ? 'list-dot' : index == 1 ? 'calendar' : index == 2 ? 'plus-circle' : index == 3 ? 'file-text' : index == 4 ? 'bell' : 'list-dot'"></u-tabbar-item>
-      <!-- <u-tabbar-item
+    <user :cur="PageCur" v-if="PageCur == 'user'"></user>
+    <u-tabbar
+      :value="PageCur"
+      @change="NavChange"
+      :fixed="true"
+      :placeholder="true"
+      :safeAreaInsetBottom="true"
+    >
+      <u-tabbar-item
+        v-for="(item, index) in permission"
+        :key="index"
+        :text="item.meta.title"
+        :name="item.component"
+        :icon="
+          (index = 0
+            ? 'list-dot'
+            : index == 1
+            ? 'calendar'
+            : index == 2
+            ? 'plus-circle'
+            : index == 3
+            ? 'file-text'
+            : index == 4
+            ? 'bell'
+            : 'list-dot')
+        "
+      ></u-tabbar-item>
+      <!--  <u-tabbar-item
         text="通风系统图"
         name="tun2D"
         icon="list-dot"
-      ></u-tabbar-item>
-      <u-tabbar-item
+      ></u-tabbar-item> -->
+      <!-- <u-tabbar-item
         text="设备中心"
         name="device"
         icon="calendar"
@@ -47,6 +84,7 @@
         name="gasreport"
         icon="bell"
       ></u-tabbar-item> -->
+      <u-tabbar-item text="我的" name="user" icon="bell"></u-tabbar-item>
     </u-tabbar>
   </view>
 </template>
@@ -71,8 +109,78 @@ export default {
   },
   computed: {
     permission: function () {
-      return uni.getStorageSync('menuPermission')
-    }
+      var data = uni.getStorageSync("menuPermission");
+      console.log(JSON.stringify(data));
+      if (data == null || data == "" || data.length == 0) {
+        data = [
+          {
+            redirect: null,
+            path: "/device",
+            ver: null,
+            component: "device",
+            route: "1",
+            meta: {
+              keepAlive: false,
+              des: null,
+              internalOrExternal: false,
+              componentName: "device",
+              title: "设备中心",
+            },
+            name: "device",
+            id: "1862300062379954178",
+          },
+          {
+            redirect: null,
+            path: "/warndata",
+            ver: null,
+            component: "warndata",
+            route: "1",
+            meta: {
+              keepAlive: false,
+              des: null,
+              internalOrExternal: false,
+              componentName: "warndata",
+              title: "预警分析",
+            },
+            name: "warndata",
+            id: "1862301272310829057",
+          },
+          {
+            redirect: null,
+            path: "/filecenter",
+            ver: null,
+            component: "filecenter",
+            route: "1",
+            meta: {
+              keepAlive: false,
+              des: null,
+              internalOrExternal: false,
+              componentName: "filecenter",
+              title: "文件共享中心",
+            },
+            name: "filecenter",
+            id: "1862301712700166146",
+          },
+          {
+            redirect: null,
+            path: "/gasreport",
+            ver: null,
+            component: "gasreport",
+            route: "1",
+            meta: {
+              keepAlive: false,
+              des: null,
+              internalOrExternal: false,
+              componentName: "gasreport",
+              title: "瓦斯上报",
+            },
+            name: "gasreport",
+            id: "1862302433877184513",
+          },
+        ];
+      }
+      return data;
+    },
   },
   watch: {
     permission: {
@@ -80,12 +188,12 @@ export default {
         this.PageCur = newV[0].component
       },
       immediate: true,
-    }
+    },
   },
   onLoad() {
     this.changeWV();
   },
-  mounted() { },
+  mounted() {},
   onShow() {
     // this.changeWV()
   },
@@ -123,9 +231,9 @@ export default {
           _this.wvHeight = _this.isLandScape
             ? sysinfo.windowHeight - sysinfo.statusBarHeight - 20
             : sysinfo.windowHeight -
-            sysinfo.statusBarHeight -
-            sysinfo.statusBarHeight -
-            38;
+              sysinfo.statusBarHeight -
+              sysinfo.statusBarHeight -
+              38;
           _this.wvWidth = _this.isLandScape
             ? sysinfo.windowWidth
             : sysinfo.windowWidth;

+ 17 - 29
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,7 +131,7 @@ export default {
               // console.log('当前是APP环境');
               this.saveClientId();
             } else {
-              this.getPermissionList()
+              this.getPermissionList();
             }
             // #ifdef APP-PLUS
 
@@ -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() {
@@ -299,10 +298,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;
@@ -320,29 +321,16 @@ export default {
   text-align: center;
 }
 
-<<<<<<< HEAD .input-placeholder,
-.zai-input {
-  color: #94afce;
-}
 
-=======.zai-title2 {
-  margin-top: 20upx;
-  font-size: 28upx;
-  color: #000000;
-  text-align: center;
-}
+
+
 
 .input-placeholder,
 .zai-input {
   color: #94afce;
 }
 
->>>>>>>f9a901e3f950200c21f1645c7cafe558c314d958 .zai-label {
-  padding: 60upx 0;
-  text-align: center;
-  font-size: 30upx;
-  color: #a7b6d0;
-}
+
 
 .zai-btn {
   background: #ff65a3;

+ 42 - 43
pages/operation/operation.vue

@@ -4,18 +4,20 @@
       <view class="u-page">
         <div class="flcard">
           <div class="btns">
-            <u-button
-              type="primary"
-              shape="circle"
-              :text="StartTime ? StartTime : '起始时间'"
-              @click="dataShow = true"
-            ></u-button>
-            <u-button
-              type="primary"
-              shape="circle"
-              :text="EndTime ? EndTime : '结束时间'"
-              @click="dataShow1 = true"
-            ></u-button>
+            <uni-datetime-picker
+              :show="dataShow"
+              mode="datetime"
+              @cancel="dataShow = false"
+              @confirm="selectStartTime"
+              v-model="dataTime"
+            ></uni-datetime-picker>
+            <uni-datetime-picker
+              :show="dataShow1"
+              mode="datetime"
+              @cancel="dataShow1 = false"
+              @confirm="selectEndTime"
+              v-model="dataTime"
+            ></uni-datetime-picker>
             <u-icon
               size="30"
               color="#3c9cff"
@@ -23,20 +25,6 @@
               @click="checkHistoryData"
             ></u-icon>
           </div>
-          <u-datetime-picker
-            :show="dataShow"
-            mode="datetime"
-            @cancel="dataShow = false"
-            @confirm="selectStartTime"
-            v-model="dataTime"
-          ></u-datetime-picker>
-          <u-datetime-picker
-            :show="dataShow1"
-            mode="datetime"
-            @cancel="dataShow1 = false"
-            @confirm="selectEndTime"
-            v-model="dataTime"
-          ></u-datetime-picker>
         </div>
         <u-list>
           <u-list-item
@@ -90,6 +78,7 @@
 <script>
 import api from "@/api/api";
 import dayjs from "dayjs";
+import uniDatetimePicker from "../../uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.vue";
 export default {
   data() {
     return {
@@ -104,37 +93,38 @@ export default {
       historyData: [],
     };
   },
+  components: {
+    uniDatetimePicker,
+  },
 
-  props: ["showColum", 'deviceType'],
+  props: ["showColum", "deviceType"],
   watch: {
     showColum(data) {
       this.colums = data;
     },
-  	deviceType: {
-  		handler (data) {
-  			if(data){
-  				this.TabCur = data;
-  				// 选择设备分类,重新获取数据
-  				this.$emit('setMenushow', {
-					menushow: false
-  				});
-  			}
-  		  
-  		  
-  		},
-  		immediate: true
-  	}
+    deviceType: {
+      handler(data) {
+        if (data) {
+          this.TabCur = data;
+          // 选择设备分类,重新获取数据
+          this.$emit("setMenushow", {
+            menushow: false,
+          });
+        }
+      },
+      immediate: true,
+    },
   },
   created() {
     this.colums = this.showColum;
-    const startTime =new Date().getTime() - 3600 * 1000 * 24 * 30;
+    const startTime = new Date().getTime() - 3600 * 1000 * 24 * 30;
     const endTime = new Date();
     this.StartTime = dayjs(startTime).format("YYYY-MM-DD HH:mm:ss");
     this.EndTime = dayjs(endTime).format("YYYY-MM-DD HH:mm:ss");
     this.checkHistoryData();
   },
   mounted() {
-	  this.TabCur = this.deviceType;
+    this.TabCur = this.deviceType;
   },
   methods: {
     //选择起始时间
@@ -202,6 +192,15 @@ export default {
 .btns {
   display: flex;
 }
+.btns > * {
+  margin-right: 5px; /* 根据需要调整间距大小 */
+}
+
+/* 去除最后一个按钮的右边距 */
+.btns > *:last-child {
+  margin-right: 0;
+}
+
 .flcard {
   padding: 20rpx;
   background-color: #ffffff;

+ 5 - 5
pages/user/people.vue

@@ -19,7 +19,7 @@
 		  </view>
 		  <!-- 列表list-->
 		  <view class="cu-list menu card-menu margin-top-xl margin-bottom-xl shadow-lg radius">
-		    <view class="cu-item arrow animation-slide-bottom" :style="[{animationDelay: '0.1s'}]">
+		   <!-- <view class="cu-item arrow animation-slide-bottom" :style="[{animationDelay: '0.1s'}]">
 		      <view class="content" >
 		        <text class="cuIcon-favorfill text-yellow"></text>
 		        <text class="text-grey">收藏</text>
@@ -30,19 +30,19 @@
 		        <text class="cuIcon-redpacket_fill text-red"></text>
 		        <text class="text-grey">红包</text>
 		      </view>
-		    </view>
+		    </view> -->
 			<view class="cu-item arrow animation-slide-bottom" :style="[{animationDelay: '0.3s'}]" @tap="scan">
 			  <view class="content">
 			    <text class="cuIcon-scan text-red"></text>
 			    <text class="text-grey">扫码</text>
 			  </view>
 			</view>
-			<navigator class="cu-item arrow animation-slide-bottom" :style="[{animationDelay: '0.4s'}]" url="/pages/user/location" hover-class="none">
+			<!-- <navigator class="cu-item arrow animation-slide-bottom" :style="[{animationDelay: '0.4s'}]" url="/pages/user/location" hover-class="none">
 				<view class="content" >
 				    <text class="cuIcon-location text-cyan"></text>
 					<text class="text-grey">定位</text>
 				</view>
-			</navigator>
+			</navigator> -->
 			<navigator class="cu-item arrow animation-slide-bottom" url="/pages/user/userdetail" :style="[{animationDelay: '0.6s'}]">
 			     <view class="content">
 				    <text class="cuIcon-settingsfill text-cyan"></text>
@@ -151,7 +151,7 @@
 <style>
 .UCenter-bg {
 	/* #ifdef MP-WEIXIN */
-	background-image: url('https://static.jeecg.com/upload/test/blue_1595818030310.png');
+	background-image: url('/static/topnavbar.png');
 	/* #endif */
 	/* #ifndef MP-WEIXIN */
 	background-image: url('/static/blue.png');

+ 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%;
     }
 

+ 117 - 73
pages/warndata/warndata.vue

@@ -1,28 +1,32 @@
 <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">
           <view class="icon-vent">
             <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>
         <view class="typeBar">
           <text class="text-style">通风监测预警</text>
-          <u-icon @click="toggleIsShow1" name="arrow-down"></u-icon>
+          <u-icon @click="toggleIsShow1" name="arrow-down-fill"></u-icon>
         </view>
       </view>
-      <view class="flcard" v-show="isShow1">
+      <view class="flcard" @click="getDetail('vent')" v-show="isShow1">
         <view class="datacard demo-layout bg-purple-light">
           <view style="margin-top: 10rpx">
             <text class="text-style1">{{ windData.zongjinfeng }}</text>
@@ -46,27 +50,33 @@
         <view class="typeBar">
           <view class="icon-vent">
             <text class="text-style">火灾监测预警</text>
-            <u-icon name="eye" @click="getDetail('fire')"></u-icon>
           </view>
-          <u-icon @click="toggleIsShow2" name="arrow-up"></u-icon>
+          <u-icon @click="toggleIsShow2" name="arrow-up-fill"></u-icon>
         </view>
       </view>
       <view class="flcard" v-else>
         <view class="typeBar">
           <text class="text-style">火灾监测预警</text>
-          <u-icon @click="toggleIsShow2" name="arrow-down"></u-icon>
+          <u-icon @click="toggleIsShow2" name="arrow-down-fill"></u-icon>
         </view>
       </view>
-      <view class="flcard" v-show="isShow2">
+      <view class="flcard" v-show="isShow2" @click="getDetail('fire')">
         <view class="firecontainer">
           <view class="title">
             <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 +87,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>
@@ -90,25 +107,28 @@
         <view class="typeBar">
           <view class="icon-vent">
             <text class="text-style">粉尘监测预警</text>
-            <u-icon name="eye" @click="getDetail('dust')"></u-icon>
           </view>
-          <u-icon @click="toggleIsShow3" name="arrow-up"></u-icon>
+          <u-icon @click="toggleIsShow3" name="arrow-up-fill"></u-icon>
         </view>
       </view>
       <view class="flcard" v-else>
         <view class="typeBar">
           <text class="text-style">粉尘监测预警</text>
-          <u-icon @click="toggleIsShow3" name="arrow-down"></u-icon>
+          <u-icon @click="toggleIsShow3" name="arrow-down-fill"></u-icon>
         </view>
       </view>
-      <view class="flcard" v-show="isShow3">
+      <view class="flcard" v-show="isShow3" @click="getDetail('dust')">
         <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>
@@ -118,23 +138,24 @@
         <view class="typeBar">
           <view class="icon-vent">
             <text class="text-style">瓦斯监测预警</text>
-            <u-icon name="eye" @click="getDetail('gas')"></u-icon>
           </view>
-          <u-icon @click="toggleIsShow4" name="arrow-up"></u-icon>
+          <u-icon @click="toggleIsShow4" name="arrow-up-fill"></u-icon>
         </view>
       </view>
       <view class="flcard" v-else>
         <view class="typeBar">
           <text class="text-style">瓦斯监测预警</text>
-          <u-icon @click="toggleIsShow4" name="arrow-down"></u-icon>
+          <u-icon @click="toggleIsShow4" name="arrow-down-fill"></u-icon>
         </view>
       </view>
-      <view class="flcard" v-show="isShow4">
+      <view class="flcard" v-show="isShow4" @click="getDetail('gas')">
         <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 class="gascard" v-for="(item, index) in gasDevice" :key="index">
             <view style="margin-top: 20rpx">
               <text class="text-style1">{{ item.gasNumber }}</text>
               <view style="margin: 10rpx">{{ item.systemname }}</view>
@@ -143,7 +164,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">
@@ -159,21 +182,28 @@
         <view class="typeBar">
           <view class="icon-vent">
             <text class="text-style">设备监测预警</text>
-            <u-icon name="eye" @click="getDetail('device')"></u-icon>
           </view>
-          <u-icon @click="toggleIsShow5" name="arrow-up"></u-icon>
+          <u-icon @click="toggleIsShow5" name="arrow-up-fill"></u-icon>
         </view>
       </view>
       <view class="flcard" v-else>
         <view class="typeBar">
           <text class="text-style">设备监测预警</text>
-          <u-icon @click="toggleIsShow5" name="arrow-down"></u-icon>
+          <u-icon @click="toggleIsShow5" name="arrow-down-fill"></u-icon>
         </view>
       </view>
-      <view class="flcard demo-layout bg-purple-light" v-show="isShow5">
+      <view
+        class="flcard demo-layout bg-purple-light"
+        v-show="isShow5"
+        @click="getDetail('device')"
+      >
         <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 +220,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,8 +283,14 @@ export default {
   mounted() {
     this.getWranInfo();
   },
+  components: {
+    ventDetail,
+    deviceDetail,
+    fireDetail,
+    dustDetail,
+    gasDetail,
+  },
   methods: {
-  
     //获取预警信息
     getWranInfo() {
       new Promise((resolve, reject) => {
@@ -283,31 +319,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;
       }
     },
@@ -373,10 +409,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 {
@@ -386,10 +424,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 {
@@ -412,10 +452,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;
 }
 
@@ -482,10 +524,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 {

+ 203 - 54
pages/webview/webview.vue

@@ -1,71 +1,220 @@
 <!-- /pages/webview/webview.vue -->
 <template>
-  <web-view :src="src" @message="onMessage"></web-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 {
-      src: ''
+      timer: "",
+      src: "",
     };
   },
-  methods:{
-	  onMessage(event) {
-	                  uni.showModal({
-	                      content: JSON.stringify(event.detail),
-	                      showCancel: false
-	                  });
-	              },
-	  // onMessage(e) {
-	  //     // 通过 e.detail.data 可以获取到网页发送过来的数据
-	  //     // 如果要监听URL变化,可以在这里处理
-	  //     console.log('网页发送的数据:', e.detail.data);
-	  //   }
+  methods: {
+    onLoaded() {
+      this.$tip.toast("onLoaded");
+      // 在webview加载完成后,注入JavaScript代码
+      this.$refs.webview.evalJs(`
+	        (function() {
+	          // 监听URL变化事件
+	          window.addEventListener('hashchange', function() {
+	            // 将URL变化通过postMessage传递给uniapp
+	            window.postMessage(JSON.stringify({
+	              type: 'urlChange',
+	              url: window.location.href
+	            }));
+	          });
+	
+	          // 监听popstate事件(用于处理浏览器历史记录的变化)
+	          window.addEventListener('popstate', function() {
+	            window.postMessage(JSON.stringify({
+	              type: 'urlChange',
+	              url: window.location.href
+	            }));
+	          });
+	
+	          // 初始化时发送一次当前URL
+	          window.postMessage(JSON.stringify({
+	            type: 'initUrl',
+	            url: window.location.href
+	          }));
+	        })();
+	      `);
+
+      // 监听来自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;
+      }
+    },
+
+    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",
+            // });
+          });
+      });
+    },
+
+    //获取权限菜单
+    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();
+        });
+    },
   },
-  watch:{
-	  src(value){
-		if(value.indexOf("ticket") !=-1) {	   
-		     this.$destroy();
-            var tourl = configService.apiUrl;
-			 try {
-			 	new Promise((resolve, reject) => {
-			 		api
-			 			.validateCasLogin({
-			 				ticket: value.substring(value.indexOf("ticket")+7,value.length),
-			 				service: tourl,
-			 			})
-			 			.then((response) => {
-			 				if (response.data.code == 200) {
-			 					uni.setStorageSync(ACCESS_TOKEN, response.data.result.token);
-			 				} else {
-			 					reject(response);
-			 				}
-							
-							uni.navigateTo({
-							  url: "/pages/home/home",
-							});
-			 			})
-			 			.catch((error) => {
-			 				console.log("catch===>response", response);
-			 				reject(error);
-			 			});
-			 	});
-			 
-			 } catch (e) {
-			 }
-		}
-	  }
+  onShow() {
+    this.startListening();
+  },
+  onHide() {
+    this.stopListening();
+  },
+  watch: {},
+  onUnload() {
+    plus.runtime.quit();
   },
   onLoad(option) {
     // 获取传递过来的url参数
-	let optionurl = option.url;
-	if(option.url.indexOf("ticket") !=-1){
-			console.log("option.url======"+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);
-	}
-  }
+  },
 };
-</script>
+</script>
+<style scoped>
+.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


BIN
static/empty.png


BIN
static/mainfan/door-new-1.png


BIN
static/mainfan/fengji-left.png


BIN
static/mainfan/fengji-right2.png


BIN
static/mainfan/fun-door-new-1.png


BIN
static/mainfan/fun-door-new-2.png


BIN
static/mainfan/main_ventilate_new.png


BIN
static/mainfan/page-back.png


BIN
static/mainfan/topwindow-new-2.png


BIN
static/topnavbar.png


+ 8 - 0
uni_modules/uview-ui/components/u-navbar/props.js

@@ -50,6 +50,14 @@ export default {
 			type: String,
 			default: uni.$u.props.navbar.bgColor
 		},
+		bgImage: {
+			type: String,
+			default: uni.$u.props.navbar.bgImage
+		},
+		bgStatusImage: {
+			type: String,
+			default: uni.$u.props.navbar.bgStatusImage
+		},
 		// 标题的宽度
 		titleWidth: {
 			type: [String, Number],

+ 4 - 0
uni_modules/uview-ui/components/u-navbar/u-navbar.vue

@@ -11,6 +11,7 @@
 			<u-status-bar
 				v-if="safeAreaInsetTop"
 				:bgColor="bgColor"
+				:bgStatusImage="bgStatusImage"
 			></u-status-bar>
 			<view
 				class="u-navbar__content"
@@ -18,7 +19,9 @@
 				:style="{
 					height: $u.addUnit(height),
 					backgroundColor: bgColor,
+					backgroundImage: bgImage
 				}"
+		        style="background-size: 100% 100%;"
 			>
 				<view
 					class="u-navbar__content__left"
@@ -88,6 +91,7 @@
 	 * @property {String}			rightIcon			右边返回图标的名称,只能为uView自带的图标
 	 * @property {String}			title				导航栏标题,如设置为空字符,将会隐藏标题占位区域
 	 * @property {String}			bgColor				导航栏背景设置 (默认 '#ffffff' )
+	 * @property {String}			bgImage				导航栏背景
 	 * @property {String | Number}	titleWidth			导航栏标题的最大宽度,内容超出会以省略号隐藏 (默认 '400rpx' )
 	 * @property {String | Number}	height				导航栏高度(不包括状态栏高度在内,内部自动加上)(默认 '44px' )
 	 * @property {String | Number}	leftIconSize		左侧返回图标的大小(默认 20px )

+ 5 - 1
uni_modules/uview-ui/components/u-status-bar/props.js

@@ -3,6 +3,10 @@ export default {
         bgColor: {
             type: String,
             default: uni.$u.props.statusBar.bgColor
-        }
+        },
+		bgStatusImage: {
+            type: String,
+            default: uni.$u.props.statusBar.c
+        },
     }
 }

+ 2 - 0
uni_modules/uview-ui/components/u-status-bar/u-status-bar.vue

@@ -1,6 +1,7 @@
 <template>
 	<view
 	    :style="[style]"
+		style="background-size: 100% 100%;"
 	    class="u-status-bar"
 	>
 		<slot />
@@ -30,6 +31,7 @@
 				// 状态栏高度,由于某些安卓和微信开发工具无法识别css的顶部状态栏变量,所以使用js获取的方式
 				style.height = uni.$u.addUnit(uni.$u.sys().statusBarHeight, 'px')
 				style.backgroundColor = this.bgColor
+				style.backgroundImage = this.bgStatusImage
 				return uni.$u.deepMerge(style, uni.$u.addStyle(this.customStyle))
 			}
 		},