Browse Source

设备管理

fanghuisheng 2 years ago
parent
commit
c255915f30
1 changed files with 26 additions and 32 deletions
  1. 26 32
      src/pages/business/mhxf/deviceManage/index.vue

+ 26 - 32
src/pages/business/mhxf/deviceManage/index.vue

@@ -8,7 +8,7 @@
       <uni-swipe-action-item style="background-color: #ffffff">
         <view class="content1">
           <view style="padding: 10px">
-            <u-input style="border-radius: 50px" v-model="dataInput"  @blur="blur" 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>
@@ -47,7 +47,7 @@
               </template>
 
               <view class="u-collapse-content">
-               <!-- <view style="display: flex; flex-wrap: wrap; margin-left: 5%">
+                <!-- <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>
@@ -56,7 +56,7 @@
                 <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.portName }}:</span>
-                    <span >{{ ch.portData }}</span>
+                    <span>{{ ch.portData }}</span>
                   </view>
                 </view>
               </view>
@@ -114,17 +114,15 @@ const bottomMed = ref("");
 const leftMed = ref("");
 const rightMed = ref("");
 
-
 /**
  * @tabs点击事件
  */
 function tabsClick(e) {
   current.value = e.index;
   // alert(current.value)
-  dataInput.value = ''
+  dataInput.value = "";
 }
 
-
 /**
  * @当按下去的时候
  */
@@ -194,41 +192,37 @@ function leftscroll(dista) {
     current.value = 0;
   }
 }
-	function blur(e) {
-		if(dataInput.value ){
-			classifySearch({systemType:5,deviceCode:dataInput.value})
-		}
-	}
+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
-	
-	
+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:''})
+    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:''})
+    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:''})
+    classifySearch({ systemType: 2, deviceCode: dataInput.value, pageNum: "", pageSize: "" });
   }
 });
 
@@ -253,7 +247,7 @@ onNavigationBarButtonTap((e) => {
 });
 
 onLoad((options) => {
-	// classifySearch({systemType:5,deviceCode:dataInput.value})
+  // classifySearch({systemType:5,deviceCode:dataInput.value})
 });
 
 onReady(() => {});