2 次代碼提交 5c9986a69f ... c47cf0003c

作者 SHA1 備註 提交日期
  haodingding c47cf0003c Merge branch 'master' of http://app.tjzhxx.cn:3001/yyky/yyky_web 1 年之前
  haodingding a7185ad76e 09-20 bug修改 1 年之前
共有 3 個文件被更改,包括 74 次插入55 次删除
  1. 61 50
      src/views/system/device/index.vue
  2. 11 4
      src/views/system/manage/index.vue
  3. 2 1
      src/views/system/profile/index.vue

+ 61 - 50
src/views/system/device/index.vue

@@ -731,13 +731,13 @@ export default {
       // 表单校验
       rules: {
         factory: [
-          {required: true, message: '请选择厂商', trigger: 'change'}
+          { required: true, message: '请选择厂商', trigger: 'change' }
         ],
         deviceModel: [
-          {required: true, message: '请选择设备型号', trigger: 'change'}
+          { required: true, message: '请选择设备型号', trigger: 'change' }
         ],
         grantType: [
-          {required: true, message: '请选择发放方式', trigger: 'change'}
+          { required: true, message: '请选择发放方式', trigger: 'change' }
         ]
       },
       menuInfo: [],
@@ -891,19 +891,19 @@ export default {
           obj.command = 'keybrd'
           obj.param = { is_open: 0 }
           await axios({
-          method: 'POST',
-          url: 'http://43.138.30.29:4200/index.php/api/shouhuan/createcommand',
-          headers: {
-            Authorization: getToken(),
-          },
-          data: obj,
-        }).then(res => {
-          if (res.data && res.data.code == 200) {
-            success += 1
-          } else {
-            this.$modal.msgError(`${item.name}设置失败`)
-          }
-        })
+            method: 'POST',
+            url: 'http://43.138.30.29:4200/index.php/api/shouhuan/createcommand',
+            headers: {
+              Authorization: getToken(),
+            },
+            data: obj,
+          }).then(res => {
+            if (res.data && res.data.code == 200) {
+              success += 1
+            } else {
+              this.$modal.msgError(`${item.name}设置失败`)
+            }
+          })
         }))
         if (success == this.items.length) {
           this.$modal.msgSuccess('关闭成功')
@@ -920,22 +920,22 @@ export default {
           obj.command = 'keybrd'
           obj.param = { is_open: 1 }
           await axios({
-          method: 'POST',
-          url: 'http://43.138.30.29:4200/index.php/api/shouhuan/createcommand',
-          headers: {
-            Authorization: getToken(),
-          },
-          data: obj,
-        }).then(res => {
-          if (res.data && res.data.code == 200) {
-            success += 1
-          } else {
-            this.$modal.msgError(`${item.name}设置失败`)
-          }
-        })
+            method: 'POST',
+            url: 'http://43.138.30.29:4200/index.php/api/shouhuan/createcommand',
+            headers: {
+              Authorization: getToken(),
+            },
+            data: obj,
+          }).then(res => {
+            if (res.data && res.data.code == 200) {
+              success += 1
+            } else {
+              this.$modal.msgError(`${item.name}设置失败`)
+            }
+          })
         }))
         if (success == this.items.length) {
-          this.$modal.msgSuccess('关闭成功')
+          this.$modal.msgSuccess('打开成功')
         }
       }
     },
@@ -1181,7 +1181,8 @@ export default {
         this.$modal.closeLoading()
         this.$refs.fileUpload.handleRemove(file);
       } else {
-        this.modal.msgSuccess("导入成功");
+        this.$modal.msgSuccess("导入成功");
+        this.$modal.closeLoading()
         this.openToUpload = false
         this.resetQuery()
       }
@@ -1478,8 +1479,8 @@ export default {
     // 切换围栏按钮
     switchFenceType(e) {
       if (this.fence) {
-          this.map.remove(this.fence)
-          this.fence = null
+        this.map.remove(this.fence)
+        this.fence = null
       }
       if (this.fenceEditor) {
         this.fenceEditor.close()
@@ -1759,28 +1760,37 @@ export default {
           'AMap.Geolocation',
           'AMap.CircleEditor',
           'AMap.RectangleEditor',
-          'AMap.PolygonEditor'], () => {
+          'AMap.PolygonEditor',
+          'AMap.CitySearch'], () => {
             this.map.addControl(new AMap.ToolBar({
               position: 'RT'
             }))
             this.map.addControl(new AMap.Scale())
-            var geolocation = new AMap.Geolocation({
-              enableHighAccuracy: true, // 是否使用高精度定位,默认:true
-              timeout: 10000, // 设置定位超时时间,默认:无穷大
-              offset: [10, 20],  // 定位按钮的停靠位置的偏移量
-              zoomToAccuracy: true,  //  定位成功后调整地图视野范围使定位位置及精度范围视野内可见,默认:false
-              position: 'RB' //  定位按钮的排放位置,  RB表示右下
-            })
+            // var geolocation = new AMap.Geolocation({
+            //   enableHighAccuracy: true, // 是否使用高精度定位,默认:true
+            //   timeout: 10000, // 设置定位超时时间,默认:无穷大
+            //   offset: [10, 20],  // 定位按钮的停靠位置的偏移量
+            //   zoomToAccuracy: true,  //  定位成功后调整地图视野范围使定位位置及精度范围视野内可见,默认:false
+            //   position: 'RB' //  定位按钮的排放位置,  RB表示右下
+            // })
 
-            geolocation.getCurrentPosition((status, result) => {
-              if (status == 'complete') {
-                this.$modal.msgSuccess('定位成功')
-                this.map.setCenter([result.position.lng, result.position.lat])
-              } else {
-                this.$modal.msgError('获取定位失败')
+            // geolocation.getCurrentPosition((status, result) => {
+            //   if (status == 'complete') {
+            //     this.$modal.msgSuccess('定位成功')
+            //     this.map.setCenter([result.position.lng, result.position.lat])
+            //   } else {
+            //     this.$modal.msgError('获取定位失败')
+            //   }
+            //   this.getFence()
+            // });
+            let citySearch = new AMap.CitySearch()
+            citySearch.getLocalCity((status, result) => {
+              if (status === 'complete' && result.info === 'OK') {
+                console.log(result);
+                let bounds = result.bounds;
+                this.map.setBounds(bounds);
               }
-              this.getFence()
-            });
+            })
           })
       })
     },
@@ -1800,7 +1810,7 @@ export default {
       this.loading = true;
       listProfile(this.userForm).then(response => {
         response.rows.map(item => {
-          item.sex = item.gender == 0 ? '男':item.gender == 1?'女': ''
+          item.sex = item.gender == 0 ? '男' : item.gender == 1 ? '女' : ''
         })
         this.userList = response.rows;
         this.userTotal = response.total;
@@ -1945,6 +1955,7 @@ export default {
         this.deviceList = response.rows;
         this.deviceList.map(item => {
           if (item.deviceModel || item.deviceModel == 0) {
+            console.log(item.deviceModel);
             item.deviceType = this.deviceModel[item.deviceModel].dictLabel
           }
           if (item.grantType || item.grantType == 0) {

+ 11 - 4
src/views/system/manage/index.vue

@@ -536,7 +536,6 @@ export default {
       ],
       date: [],
       checked: [],
-      center: [117.66275, 39.03068],
       map: null,
       openToUpload: false,
       scopeRelease: [],
@@ -584,7 +583,8 @@ export default {
         this.$modal.closeLoading()
         this.$refs.fileUpload.handleRemove(file);
       } else {
-        this.modal.msgSuccess("导入成功");
+        this.$modal.msgSuccess("导入成功");
+        this.$modal.closeLoading()
         this.openToUpload = false
         this.resetQuery()
       }
@@ -612,6 +612,9 @@ export default {
       let { data: selectInfo } = await this.getDicts('sys_business_nature')
       this.selectInfo = selectInfo
       let { data: scopeRelease } = await this.getDicts('sys_release_scope')
+      scopeRelease.map(item => {
+        item.dictValue = Number(item.dictValue)
+      })
       this.scopeRelease = scopeRelease
       let { data: settleTime } = await this.getDicts('sys_settle_time')
       settleTime.map(item => {
@@ -708,7 +711,6 @@ export default {
       this.open = true;
       this.title = "添加服务商管理";
     },
-    /** 修改按钮操作 */
     handleSee(row) {
       // this.reset();
       const id = row.id || this.ids
@@ -737,7 +739,12 @@ export default {
       this.reset();
       const id = row.id || this.ids
       getManage(id).then(response => {
-        response.data.checked = JSON.parse(response.data.releaseScope)
+        if (response.data.releaseScope) {
+          response.data.checked = JSON.parse(response.data.releaseScope)
+        } else {
+          response.data.checked = []
+        }
+        response.data.date = [response.data.begintime, response.data.endtime]
         this.form = response.data;
         this.open = true;
         this.title = "修改服务商管理";

+ 2 - 1
src/views/system/profile/index.vue

@@ -1036,7 +1036,8 @@ export default {
         this.$modal.closeLoading()
         this.$refs.fileUpload.handleRemove(file);
       } else {
-        this.modal.msgSuccess("导入成功");
+        this.$modal.msgSuccess("导入成功");
+        this.$modal.closeLoading()
         this.openToUpload = false
         this.resetQuery()
       }