Browse Source

Merge remote-tracking branch 'origin/20230223_pad_vue_new_branch' into 20230223_pad_vue_new_branch

yq1 1 week ago
parent
commit
12497502da
2 changed files with 35 additions and 35 deletions
  1. 1 1
      build/cdn.json
  2. 34 34
      src/pages/main/DetailsPage.vue

+ 1 - 1
build/cdn.json View File

@@ -1,3 +1,3 @@
1 1
 {
2
-  "version": "2999.999.13759"
2
+  "version": "2999.999.13753"
3 3
 }

+ 34 - 34
src/pages/main/DetailsPage.vue View File

@@ -456,6 +456,13 @@ export default {
456 456
     this.websocketSend(unObj)
457 457
   },
458 458
   methods: {
459
+    compare (property) {
460
+        return function (a, b) {
461
+          var value1 = a[property]
462
+          var value2 = b[property]
463
+          return value1 - value2
464
+        }
465
+     },
459 466
     down (event) {
460 467
       this.flags = true
461 468
       var touch
@@ -808,9 +815,7 @@ export default {
808 815
         }
809 816
        
810 817
         this.newPatient = []
811
-        this.newPatient = cityNameList.sort(function (a, b) {
812
-            return a.sort > b.sort
813
-         })
818
+        this.newPatient = cityNameList.sort(this.compare('sort'))
814 819
 
815 820
 
816 821
 
@@ -951,9 +956,7 @@ export default {
951 956
         }
952 957
        
953 958
         this.myPatientsOne = []
954
-        this.myPatientsOne = zoneArr.sort(function (a, b) {
955
-            return a.sort > b.sort
956
-         })
959
+        this.myPatientsOne = zoneArr.sort(this.compare('sort'))
957 960
 
958 961
        
959 962
 
@@ -1043,10 +1046,8 @@ export default {
1043 1046
         }
1044 1047
        
1045 1048
         this.myPatientsOne = []
1046
-        this.myPatientsOne = zoneArr.sort(function (a, b) {
1047
-            return a.sort > b.sort
1048
-         })
1049
-
1049
+        this.myPatientsOne = zoneArr.sort(this.compare('sort'))
1050
+        console.log("我的病人hhhhhhhhhhhhhhhhhhhh",this.myPatientsOne)
1050 1051
       
1051 1052
 
1052 1053
         let cityNameList = []
@@ -1115,9 +1116,7 @@ export default {
1115 1116
               }
1116 1117
             
1117 1118
               this.myPatientsOne = []
1118
-              this.myPatientsOne = zoneArr.sort(function (a, b) {
1119
-                  return a.sort > b.sort
1120
-              })
1119
+              this.myPatientsOne = zoneArr.sort(this.compare('sort'))
1121 1120
 
1122 1121
             this.searchArr = zoneArr
1123 1122
 
@@ -1178,11 +1177,9 @@ export default {
1178 1177
               }
1179 1178
             
1180 1179
               this.myPatientsOne = []
1181
-              this.myPatientsOne = zoneArr.sort(function (a, b) {
1182
-                  return a.sort > b.sort
1183
-              })
1184
-
1180
+              this.myPatientsOne = zoneArr.sort(this.compare('sort'))
1185 1181
 
1182
+             this.searchArr = zoneArr
1186 1183
 
1187 1184
             // console.log('arr', arr)
1188 1185
             let cityNameList = []
@@ -1235,6 +1232,8 @@ export default {
1235 1232
     },
1236 1233
     onSearch (val) {
1237 1234
       console.log(val)
1235
+      console.log("active=-----------------",this.active)
1236
+      console.log("searchArr",this.searchArr)
1238 1237
       if (this.active == 0) {
1239 1238
         let arr = []
1240 1239
         this.searchArr.map(item => {
@@ -1247,18 +1246,19 @@ export default {
1247 1246
           cityNameList.push(arr[p])
1248 1247
         }
1249 1248
 
1249
+        console.log("cityNameList",cityNameList)
1250
+
1250 1251
           // //解决溪康排序问题  我的病人列表
1251 1252
           if(cityNameList!=null && cityNameList.length>0){
1252
-                for(let i=0;i<cityNameList.length;i++){
1253
-                  cityNameList[i].sort = 0
1254
-                  cityNameList[i].sort = cityNameList[i].device_number.sort 
1255
-                }
1253
+              for(let i=0;i<cityNameList.length;i++){
1254
+                cityNameList[i].sort = 0
1255
+                cityNameList[i].sort = cityNameList[i].device_number.sort 
1256 1256
               }
1257
+          }
1257 1258
             
1258
-              this.myPatientsOne = []
1259
-              this.myPatientsOne = cityNameList.sort(function (a, b) {
1260
-                  return a.sort > b.sort
1261
-         })
1259
+          this.myPatientsOne = []
1260
+          this.myPatientsOne = cityNameList.sort(this.compare('sort'))
1261
+          console.log("myPatientsOne----------------",this.myPatientsOne)
1262 1262
 
1263 1263
 
1264 1264
         let firstName = {}
@@ -1281,6 +1281,8 @@ export default {
1281 1281
           this.mypatients = newObj
1282 1282
         })
1283 1283
       } else if (this.active == 1) {
1284
+
1285
+        console.log("allSearchArr------------------",this.allSearchArr)
1284 1286
         let arr = []
1285 1287
         this.allSearchArr.map(item => {
1286 1288
           if (item.patient.name.indexOf(val) != -1) {
@@ -1295,16 +1297,14 @@ export default {
1295 1297
 
1296 1298
        // //解决溪康排序问题  我的病人列表
1297 1299
        if(cityNameList!=null && cityNameList.length>0){
1298
-                for(let i=0;i<cityNameList.length;i++){
1299
-                  cityNameList[i].sort = 0
1300
-                  cityNameList[i].sort = cityNameList[i].device_number.sort 
1301
-                }
1302
-              }
1300
+          for(let i=0;i<cityNameList.length;i++){
1301
+             cityNameList[i].sort = 0
1302
+             cityNameList[i].sort = cityNameList[i].device_number.sort 
1303
+           }
1304
+         }
1303 1305
             
1304
-              this.myPatientsOne = []
1305
-              this.myPatientsOne = cityNameList.sort(function (a, b) {
1306
-                  return a.sort > b.sort
1307
-         })
1306
+        this.newPatient = []
1307
+        this.newPatient = cityNameList.sort(this.compare('sort'))
1308 1308
 
1309 1309
 
1310 1310
         let firstName = {}