Browse Source

设备管理/信息管理

ming 2 years ago
parent
commit
74d9dabe90

+ 1 - 1
src/manifest.json

@@ -1,6 +1,6 @@
 {
     "name" : "智慧消防",
-    "appid" : "__UNI__36DE3A0",
+    "appid" : "__UNI__D9E08B3",
     "description" : "智慧消防",
     "versionName" : "2.0",
     "versionCode" : 2,

+ 70 - 248
src/pages/business/mhxf/deviceManage/index.vue

@@ -8,45 +8,55 @@
       <uni-swipe-action-item style="background-color: #ffffff">
         <view class="content1">
           <view style="padding: 10px">
-            <u-input style="border-radius: 50px" v-model="dataInput" prefixIcon="search" prefixIconStyle="color: #0c7bf9" placeholder="请输入设备编号"> </u-input>
+            <u-input style="border-radius: 50px" v-model="dataInput"  @blur="blur" prefixIcon="search" prefixIconStyle="color: #0c7bf9" placeholder="请输入设备编号"> </u-input>
           </view>
+		  
+		  <view style="text-align: center; padding: 10px" v-if="!dataRes">暂无数据...</view>
 
-          <u-collapse @change="change" @close="close" @open="open" accordion>
+          <u-collapse @change="change" @close="close" @open="open" accordion v-else>
             <u-collapse-item class="uCollapseItem" v-for="da in dataList" :key="da">
               <template v-slot:title>
                 <view style="display: flex">
-                  <u-image style="margin: auto 10px auto 0" :showLoading="true" src="@/static/images/deviceManage/1.png" width="40px" height="40px"></u-image>
+					<view class="cu-avatar lg" style="margin: 0 10px auto 0;background-color:rgba(0,0,0,0);">
+						<image class="image-bg" style=" width:80rpx;height:80rpx" src="@/static/images/deviceManage/1.png" ></image>
+					</view>     
                   <view style="width: 100%">
                     <view style="display: flex; color: #000000">
-                      <view>设备编号:{{ da.number }}</view>
-                      <view v-if="da.type == 1" style="margin-left: 20px; font-size: 12px; background-color: #12c100; color: #ffffff; padding: 0 5px; border-radius: 20px; line-height: 20px">
-                        线
+                      <view>设备编号:{{ da.deviceCode }}</view>
+                      <view v-if="da.deviceStatus == 0" style="margin-left: 20px; font-size: 12px; background-color: #aeaeae; color: #ffffff; padding: 0 5px; border-radius: 20px; line-height: 20px">
+                        线
                       </view>
-                      <view v-else style="margin-left: 20px; font-size: 12px; background-color: #aeaeae; color: #ffffff; padding: 0 5px; border-radius: 20px; line-height: 20px"> 离线 </view>
+					  <view v-else-if="da.deviceStatus == 1" style="margin-left: 20px; font-size: 12px; background-color: #12c100; color: #ffffff; padding: 0 5px; border-radius: 20px; line-height: 20px">
+					    正常
+					  </view>
+					  <view v-else-if="da.deviceStatus == 2" style="margin-left: 20px; font-size: 12px; background-color: #FF1313; color: #ffffff; padding: 0 5px; border-radius: 20px; line-height: 20px">
+					    故障
+					  </view>
+                      <view v-else style="margin-left: 20px; font-size: 12px; background-color: #0D88F0; color: #ffffff; padding: 0 5px; border-radius: 20px; line-height: 20px"> 告警 </view>
                     </view>
                     <view style="display: flex; font-size: 14px; color: #666666; margin: 10px 0">
-                      <view style="width: 50%; word-break: break-all">设备点位:{{ da.point }}</view>
-                      <view style="width: 50%; word-break: break-all; padding-left: 10px">所属单位:{{ da.company }}</view>
+                      <view style="width: 50%; word-break: break-all">监测对象:{{ da.installAddress }}</view>
+                      <view style="width: 50%; word-break: break-all; padding-left: 10px">所属单位:{{ da.companyName }}</view>
                     </view>
                     <view style="display: flex; font-size: 14px; color: #666666">
-                      <view style="width: 50%; word-break: break-all">负责人:{{ da.director }}</view>
-                      <view style="width: 50%; word-break: break-all; padding-left: 10px">联系电话:{{ da.phone }}</view>
+                      <view style="width: 50%; word-break: break-all">负责人:{{ da.linkPerson }}</view>
+                      <view style="width: 50%; word-break: break-all; padding-left: 10px">联系电话:{{ da.linkPhone }}</view>
                     </view>
                   </view>
                 </view>
               </template>
 
               <view class="u-collapse-content">
-                <view style="display: flex; flex-wrap: wrap; margin-left: 5%">
-                  <view style="width: 50%; height: 30px; line-height: 30px" v-for="ch in da.children" :key="ch">
+               <!-- <view style="display: flex; flex-wrap: wrap; margin-left: 5%">
+                  <view style="width: 50%; height: 30px; line-height: 30px" v-for="ch in da.dataList" :key="ch">
                     <span>{{ ch.label }}:</span>
                     <span :style="ch.value === '正常' ? 'color:#12C100' : 'color:#FF0101'">{{ ch.value }}</span>
                   </view>
-                </view>
+                </view> -->
                 <view style="display: flex; flex-wrap: wrap; margin-left: 5%">
-                  <view style="width: 50%; height: 30px; line-height: 30px" v-for="ch in da.children1" :key="ch">
-                    <span>{{ ch.label }}:</span>
-                    <span>{{ ch.value }}</span>
+                  <view style="width: 50%; height: 30px; line-height: 30px" v-for="ch in da.dataList" :key="ch">
+                    <span>{{ ch.portName }}:</span>
+                    <span >{{ ch.portData }}</span>
                   </view>
                 </view>
               </view>
@@ -67,245 +77,20 @@ const myRequest = inject("$myRequest"); //全局接口请求
 const settingsStore = useXunJianStore(); //全局变量值Store
 
 const dataInput = ref("");
+
+const dataRes = ref(0);
+const systemTypeNo=ref(5)
 const dataList = ref([
-  {
-    number: "XXXXXXXXX",
-    point: "XXXX",
-    company: "XXXX",
-    director: "XXXX",
-    phone: "XXXX",
-    type: 1,
-    children: [
-      {
-        label: "供电过压状态",
-        value: "正常",
-      },
-      {
-        label: "供电低压状态",
-        value: "正常",
-      },
-      {
-        label: "供电过流状态",
-        value: "正常",
-      },
-      {
-        label: "漏电报警状态",
-        value: "异常",
-      },
-      {
-        label: "A相线缆高温状态",
-        value: "正常",
-      },
-      {
-        label: "B相线缆高温状态",
-        value: "正常",
-      },
-      {
-        label: "C相线缆高温状态",
-        value: "正常",
-      },
-    ],
-    children1: [
-      {
-        label: "A相电压",
-        value: "227.500",
-      },
-      {
-        label: "B相电压",
-        value: "227.500",
-      },
-      {
-        label: "C相电压",
-        value: "227.500",
-      },
-      {
-        label: "A相电流",
-        value: "7.500",
-      },
-      {
-        label: "B相电流",
-        value: "7.500",
-      },
-      {
-        label: "C相电流",
-        value: "7.500",
-      },
-      {
-        label: "A相温度",
-        value: "13.300",
-      },
-      {
-        label: "B相温度",
-        value: "13.300",
-      },
-      {
-        label: "C相温度",
-        value: "13.300",
-      },
-    ],
-  },
-  {
-    number: "XXXXXXXXX",
-    point: "XXXX",
-    company: "XXXX",
-    director: "XXXX",
-    phone: "XXXX",
-    type: 0,
-    children: [
-      {
-        label: "供电过压状态",
-        value: "正常",
-      },
-      {
-        label: "供电低压状态",
-        value: "正常",
-      },
-      {
-        label: "供电过流状态",
-        value: "正常",
-      },
-      {
-        label: "漏电报警状态",
-        value: "异常",
-      },
-      {
-        label: "A相线缆高温状态",
-        value: "正常",
-      },
-      {
-        label: "B相线缆高温状态",
-        value: "正常",
-      },
-      {
-        label: "C相线缆高温状态",
-        value: "正常",
-      },
-    ],
-    children1: [
-      {
-        label: "A相电压",
-        value: "227.500",
-      },
-      {
-        label: "B相电压",
-        value: "227.500",
-      },
-      {
-        label: "C相电压",
-        value: "227.500",
-      },
-      {
-        label: "A相电流",
-        value: "7.500",
-      },
-      {
-        label: "B相电流",
-        value: "7.500",
-      },
-      {
-        label: "C相电流",
-        value: "7.500",
-      },
-      {
-        label: "A相温度",
-        value: "13.300",
-      },
-      {
-        label: "B相温度",
-        value: "13.300",
-      },
-      {
-        label: "C相温度",
-        value: "13.300",
-      },
-    ],
-  },
-  {
-    number: "XXXXXXXXX",
-    point: "XXXX",
-    company: "XXXX",
-    director: "XXXX",
-    phone: "XXXX",
-    type: 1,
-    children: [
-      {
-        label: "供电过压状态",
-        value: "正常",
-      },
-      {
-        label: "供电低压状态",
-        value: "正常",
-      },
-      {
-        label: "供电过流状态",
-        value: "正常",
-      },
-      {
-        label: "漏电报警状态",
-        value: "异常",
-      },
-      {
-        label: "A相线缆高温状态",
-        value: "正常",
-      },
-      {
-        label: "B相线缆高温状态",
-        value: "正常",
-      },
-      {
-        label: "C相线缆高温状态",
-        value: "正常",
-      },
-    ],
-    children1: [
-      {
-        label: "A相电压",
-        value: "227.500",
-      },
-      {
-        label: "B相电压",
-        value: "227.500",
-      },
-      {
-        label: "C相电压",
-        value: "227.500",
-      },
-      {
-        label: "A相电流",
-        value: "7.500",
-      },
-      {
-        label: "B相电流",
-        value: "7.500",
-      },
-      {
-        label: "C相电流",
-        value: "7.500",
-      },
-      {
-        label: "A相温度",
-        value: "13.300",
-      },
-      {
-        label: "B相温度",
-        value: "13.300",
-      },
-      {
-        label: "C相温度",
-        value: "13.300",
-      },
-    ],
-  },
 ]); //设备管理数据存储
 
 const current = ref(0);
 const list = ref([
   {
-    id: 1,
+    id: 5,
     name: "电气火灾",
   },
   {
-    id: 2,
+    id: 4,
     name: "烟感",
   },
   {
@@ -329,13 +114,17 @@ const bottomMed = ref("");
 const leftMed = ref("");
 const rightMed = ref("");
 
+
 /**
  * @tabs点击事件
  */
 function tabsClick(e) {
   current.value = e.index;
+  // alert(current.value)
+  dataInput.value = ''
 }
 
+
 /**
  * @当按下去的时候
  */
@@ -405,14 +194,41 @@ function leftscroll(dista) {
     current.value = 0;
   }
 }
+	function blur(e) {
+		if(dataInput.value ){
+			classifySearch({systemType:5,deviceCode:dataInput.value})
+		}
+	}
+
+//分类信息查询 start
+	async function classifySearch(params) {
+		// classifyData.value = []
+	
+		const res = await myRequest({
+			url: '/service-fire/dataRt/dataRtList',
+			data: params
+		})
+		console.log('------')
+		console.log(res.data.data.records)
+		
+		dataList.value=res.data.data.records
+	
+		
+	}
+	// end
+	
+	
 
 watchEffect(() => {
   if (current.value == 0) {
     console.log(current.value);
+	classifySearch({systemType:5,deviceCode:dataInput.value,pageNum:'',pageSize:''})
   } else if (current.value == 1) {
     console.log(current.value);
+	classifySearch({systemType:1,deviceCode:dataInput.value,pageNum:'',pageSize:''})
   } else if (current.value == 2) {
     console.log(current.value);
+	classifySearch({systemType:2,deviceCode:dataInput.value,pageNum:'',pageSize:''})
   }
 });
 
@@ -436,7 +252,9 @@ onNavigationBarButtonTap((e) => {
   }
 });
 
-onLoad((options) => {});
+onLoad((options) => {
+	// classifySearch({systemType:5,deviceCode:dataInput.value})
+});
 
 onReady(() => {});
 
@@ -444,6 +262,9 @@ onMounted(() => {});
 </script>
 
 <style lang="scss">
+	body {
+	  background: #fff;
+	}
 .is-selected {
   color: #1989fa;
 }
@@ -485,4 +306,5 @@ uni-page-refresh,
   background-color: #ffffff;
   height: 100%;
 }
+	
 </style>

+ 4 - 13
src/pages/business/mhxf/informationSelect/index.vue

@@ -6,19 +6,6 @@
   <view class="informationSelect" @touchstart="fingerstart" @touchend="fingerend">
     <uni-swipe-action>
       <uni-swipe-action-item style="background-color: #ffffff; padding: 10px">
-        <!-- 警情查询 -->
-        <view class="content1">
-          <u-input style="border-radius: 50px; margin-bottom: 10px"  @blur="blur" v-model="dataInput" prefixIcon="search" prefixIconStyle="color: #0c7bf9" placeholder="请输入案件编号"> </u-input>
-         <u-row v-for="po in policeData" :key="po" style="height: 36px; line-height: 36px">
-            <u-col span="4">
-              <view style="text-align: right; padding: 0px 5px 0px 0px">{{ po.title }}</view>
-            </u-col>
-            <u-col span="8">
-              <view style="text-align: left; padding: 0px 0px 0px 5px">{{ po.value }}</view>
-            </u-col>
-          </u-row>
-        </view> 
-
         <!-- 各类查询 start -->
         <view class="content1">
           <u-input style="border-radius: 50px; margin-bottom: 10px" @blur="blur" v-model="dataInput" prefixIcon="search" prefixIconStyle="color: #0c7bf9" :placeholder="placeholderText"> </u-input>
@@ -272,6 +259,7 @@ async function classifySearch(URL, params) {
   const res = await myRequest({
     url: URL,
     data: params,
+	showLoading: true
   });
 
   if (res.data.status == "SUCCESS") {
@@ -602,6 +590,9 @@ onMounted(() => {});
 </script>
 
 <style lang="scss">
+	body {
+	  background: #fff;
+	}
 .is-selected {
   color: #1989fa;
 }

+ 2 - 2
src/utils/api.js

@@ -1,5 +1,5 @@
-// const BASE_URL = "http://172.16.120.165:13200/prod-api"; //本地请求地址
-const BASE_URL = 'http://gateway.usky.cn:8099/prod-api'//线上请求地址
+const BASE_URL = "http://172.16.120.165:13200/prod-api"; //本地请求地址
+// const BASE_URL = 'http://mobile.usky.cn:8099/prod-api'//线上请求地址
 const websiteUrl = "https://qhome.usky.cn";
 
 // 同时发送异步代码的次数,防止一次点击中有多次请求,用于处理