浏览代码

修复 bug

魏熙美 6 年前
父节点
当前提交
7714ab2c7c
共有 17 个文件被更改,包括 1022 次插入22 次删除
  1. 3
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/controller/AnnouncementTelController.java
  2. 29
    2
      CODE/smart-community/property-api/src/main/java/com/community/huiju/controller/TpEquipmentController.java
  3. 21
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/dao/TpEquipmentMapper.java
  4. 18
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/service/ITpEquipmentService.java
  5. 24
    10
      CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/TpEquipmentServiceImpl.java
  6. 20
    1
      VUECODE/smart-property-manage/src/api/equipment.js
  7. 46
    8
      VUECODE/smart-property-manage/src/router/index.js
  8. 19
    1
      VUECODE/smart-property-manage/src/store/modules/equipment.js
  9. 89
    0
      VUECODE/smart-property-manage/src/views/systemResources/banner/index.vue
  10. 10
    0
      VUECODE/smart-property-manage/src/views/systemResources/homeIndex/index.html
  11. 111
    0
      VUECODE/smart-property-manage/src/views/systemResources/homeIndex/index.vue
  12. 59
    0
      VUECODE/smart-property-manage/src/views/systemResources/monitoring/add/index.vue
  13. 85
    0
      VUECODE/smart-property-manage/src/views/systemResources/monitoring/edi/index.vue
  14. 192
    0
      VUECODE/smart-property-manage/src/views/systemResources/monitoring/index.vue
  15. 65
    0
      VUECODE/smart-property-manage/src/views/systemResources/property/add/index.vue
  16. 85
    0
      VUECODE/smart-property-manage/src/views/systemResources/property/edi/index.vue
  17. 146
    0
      VUECODE/smart-property-manage/src/views/systemResources/property/index.vue

+ 3
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/controller/AnnouncementTelController.java 查看文件

@@ -150,6 +150,9 @@ public class AnnouncementTelController extends BaseController {
150 150
 		announcementTelQueryWrapper.eq("community_id", userElement.getCommunityId());
151 151
 		AnnouncementTel telServiceOne = announcementTelService.getOne(announcementTelQueryWrapper);
152 152
 		if (null != telServiceOne && announcementTel.getTel().equals(telServiceOne.getTel()) && announcementTel.getId().equals(telServiceOne.getId())) {
153
+			announcementTel.setUpdateUser(userElement.getId());
154
+			announcementTel.setUpdateDate(LocalDateTime.now());
155
+			announcementTelService.updateById(announcementTel);
153 156
 			responseBean.addSuccess("修改物业端号码成功");
154 157
 			return responseBean;
155 158
 		}

+ 29
- 2
CODE/smart-community/property-api/src/main/java/com/community/huiju/controller/TpEquipmentController.java 查看文件

@@ -33,7 +33,7 @@ public class TpEquipmentController extends BaseController {
33 33
     @Autowired
34 34
     private ITpEquipmentService iTpEquipmentService;
35 35
 
36
-    @RequestMapping(value = "/equipment", method = RequestMethod.GET)
36
+    @RequestMapping(value = "/equipment/list", method = RequestMethod.GET)
37 37
     @ApiOperation(value = "根据类型查询设备表", notes = "根据类型查询设备表")
38 38
     @ApiImplicitParams({
39 39
         @ApiImplicitParam(paramType = "query", dataTypeClass = Integer.class, name = "type", value = "1 监控 2 访客机 3 可是对讲"),
@@ -61,7 +61,7 @@ public class TpEquipmentController extends BaseController {
61 61
     }
62 62
 
63 63
     @RequestMapping(value = "/equipment/{id}", method = RequestMethod.DELETE)
64
-    @ApiOperation(value = "删除设备", notes = "删除设备s")
64
+    @ApiOperation(value = "删除设备", notes = "删除设备")
65 65
     @ApiImplicitParams({
66 66
             @ApiImplicitParam(paramType = "path", dataTypeClass = Integer.class, name = "id", value = "设备id"),
67 67
             @ApiImplicitParam(paramType = "header", dataTypeClass = String.class, name = "X-Auth-Token", value = "token")
@@ -72,4 +72,31 @@ public class TpEquipmentController extends BaseController {
72 72
         return responseBean;
73 73
     }
74 74
 
75
+    @RequestMapping(value = "/equipment/delete", method = RequestMethod.DELETE)
76
+    @ApiOperation(value = "批量删除设备", notes = "批量删除设备")
77
+    @ApiImplicitParams({
78
+            @ApiImplicitParam(paramType = "body", dataTypeClass = Integer.class, name = "ids", value = "设备id"),
79
+            @ApiImplicitParam(paramType = "header", dataTypeClass = String.class, name = "X-Auth-Token", value = "token")
80
+    })
81
+    public ResponseBean deleteBachEquipmentById(@RequestBody List<Integer> ids, HttpSession session){
82
+        ResponseBean responseBean = new ResponseBean();
83
+        responseBean = iTpEquipmentService.deleteBachEquipmentById(ids);
84
+        return responseBean;
85
+    }
86
+
87
+
88
+    @RequestMapping(value = "/equipment/{id}", method = RequestMethod.GET)
89
+    @ApiOperation(value = "根据类型查询设备表", notes = "根据类型查询设备表")
90
+    @ApiImplicitParams({
91
+            @ApiImplicitParam(paramType = "query", dataTypeClass = Integer.class, name = "type", value = "1 监控 2 访客机 3 可是对讲"),
92
+            @ApiImplicitParam(paramType = "path", dataTypeClass = Integer.class, name = "id", value = "设备id"),
93
+            @ApiImplicitParam(paramType = "header", dataTypeClass = String.class, name = "X-Auth-Token", value = "token")
94
+    })
95
+    public ResponseBean getMonitoringById(@RequestParam("type") Integer type, @PathVariable("id") Integer id,HttpSession session) {
96
+        ResponseBean responseBean = new ResponseBean();
97
+        UserElement userElement = getUserElement(session);
98
+        responseBean = iTpEquipmentService.getMonitoringById(userElement, type, id);
99
+        return responseBean;
100
+    }
101
+
75 102
 }

+ 21
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/dao/TpEquipmentMapper.java 查看文件

@@ -39,4 +39,25 @@ public interface TpEquipmentMapper extends BaseMapper<TpEquipment> {
39 39
             "where tm.community_id = #{communityId} and tm.equipment_type = #{equipmentType}")
40 40
     List<TpEquipment> selectAllByCommunityAndEquipmentType(@Param("communityId") Integer communityId, @Param("equipmentType") Integer equipmentType);
41 41
 
42
+
43
+    /**
44
+     * 根据小区id 和 类型查询 和 设备id
45
+     * @param communityId
46
+     * @param equipmentType
47
+     * @return
48
+     */
49
+    @ResultType(TpEquipment.class)
50
+    @Select("select " +
51
+            "tm.*, " +
52
+            "(select configuration_value FROM tp_configuration WHERE id = tm.url_id) as url, " +
53
+            "(select configuration_value FROM tp_configuration WHERE id = tm.security_guard_tel_id) as securityGuardTel, " +
54
+            "(select configuration_value FROM tp_configuration WHERE id = tm.security_room_tel_id) as securityRoomTel, " +
55
+            "(select configuration_value FROM tp_configuration WHERE id = tm.address_id) as address, " +
56
+            "(select configuration_value FROM tp_configuration WHERE id = tm.uuid_id)as uuid " +
57
+            "FROM " +
58
+            "tp_equipment tm " +
59
+            "where tm.community_id = #{communityId} and tm.equipment_type = #{equipmentType} and tm.id = #{monitoringId}")
60
+    TpEquipment getMonitoringById(@Param("communityId") Integer communityId, @Param("equipmentType") Integer equipmentType, @Param("monitoringId") Integer monitoringId);
61
+
62
+
42 63
 }

+ 18
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/ITpEquipmentService.java 查看文件

@@ -5,6 +5,8 @@ import com.community.commom.mode.ResponseBean;
5 5
 import com.community.commom.session.UserElement;
6 6
 import com.community.huiju.model.TpEquipment;
7 7
 
8
+import java.util.List;
9
+
8 10
 /**
9 11
  * <p>
10 12
  * 设备表 服务类
@@ -37,4 +39,20 @@ public interface ITpEquipmentService extends IService<TpEquipment> {
37 39
      * @return
38 40
      */
39 41
     ResponseBean deleteEquipmentById(Integer equipmentId);
42
+
43
+    /**
44
+     * 根据设备id 查询
45
+     * @param userElement
46
+     * @param type
47
+     * @param id
48
+     * @return
49
+     */
50
+    ResponseBean getMonitoringById(UserElement userElement, Integer type, Integer id);
51
+
52
+    /**
53
+     * 批量删除
54
+     * @param ids
55
+     * @return
56
+     */
57
+    ResponseBean deleteBachEquipmentById(List<Integer> ids);
40 58
 }

+ 24
- 10
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/TpEquipmentServiceImpl.java 查看文件

@@ -57,10 +57,8 @@ public class TpEquipmentServiceImpl extends ServiceImpl<TpEquipmentMapper, TpEqu
57 57
         equipmentTreeQueryWrapper.eq("community_id", userElement.getCommunityId());
58 58
         TpEquipmentTree tpEquipmentTree = tpEquipmentTreeMapper.selectOne(equipmentTreeQueryWrapper);
59 59
 
60
-        List<TpEquipment> tpEquipments = JSONObject.parseArray(parameter, TpEquipment.class);
61
-        for (int i = 0; i < tpEquipments.size(); i++){
62
-            TpEquipment equipment = tpEquipments.get(i);
63
-            Integer id = equipment.getId();
60
+        TpEquipment equipment = JSONObject.parseObject(parameter, TpEquipment.class);
61
+        Integer id = equipment.getId();
64 62
             if (null == id) {
65 63
                 // 监控地址
66 64
                 String address = equipment.getAddress();
@@ -73,13 +71,13 @@ public class TpEquipmentServiceImpl extends ServiceImpl<TpEquipmentMapper, TpEqu
73 71
 
74 72
                 // 开始插入设备数据
75 73
                 // 地址
76
-                TpConfiguration tpConfigurationAddress = insertConfigguration(userElement.getCommunityId(), "监控地址" + i, address, userElement.getId());
74
+                TpConfiguration tpConfigurationAddress = insertConfigguration(userElement.getCommunityId(), "监控地址" , address, userElement.getId());
77 75
                 // 监控url
78
-                TpConfiguration tpConfigurationUrl = insertConfigguration(userElement.getCommunityId(), "监控" + i, url, userElement.getId());
76
+                TpConfiguration tpConfigurationUrl = insertConfigguration(userElement.getCommunityId(), "监控", url, userElement.getId());
79 77
                 // 保安人员号码
80
-                TpConfiguration tpConfigurationSecurityGuardTel = insertConfigguration(userElement.getCommunityId(), "保安电话" + i, securityGuardTel, userElement.getId());
78
+                TpConfiguration tpConfigurationSecurityGuardTel = insertConfigguration(userElement.getCommunityId(), "保安电话" , securityGuardTel, userElement.getId());
81 79
                 // 保安室号码
82
-                TpConfiguration tpConfigurationSecurityRoomTel = insertConfigguration(userElement.getCommunityId(), "安保室电话" + i, securityRoomTel, userElement.getId());
80
+                TpConfiguration tpConfigurationSecurityRoomTel = insertConfigguration(userElement.getCommunityId(), "安保室电话" , securityRoomTel, userElement.getId());
83 81
 
84 82
                 equipment.setAddressId(tpConfigurationAddress.getId());
85 83
                 equipment.setUrlId(tpConfigurationUrl.getId());
@@ -96,10 +94,10 @@ public class TpEquipmentServiceImpl extends ServiceImpl<TpEquipmentMapper, TpEqu
96 94
                 updateConfiguration(equipment.getAddress(), equipment.getAddressId());
97 95
                 updateConfiguration(equipment.getUrl(), equipment.getUrlId());
98 96
                 updateConfiguration(equipment.getSecurityGuardTel(), equipment.getSecurityGuardTelId());
99
-                updateConfiguration(equipment.getSecurityRoomTel(), equipment.getSecurityGuardTelId());
97
+                updateConfiguration(equipment.getSecurityRoomTel(), equipment.getSecurityRoomTelId());
100 98
                 tpEquipmentMapper.updateById(equipment);
101 99
             }
102
-        }
100
+
103 101
 
104 102
         responseBean.addSuccess("操作成功!");
105 103
         return responseBean;
@@ -147,4 +145,20 @@ public class TpEquipmentServiceImpl extends ServiceImpl<TpEquipmentMapper, TpEqu
147 145
         responseBean.addSuccess("操作成功!");
148 146
         return responseBean;
149 147
     }
148
+
149
+    @Override
150
+    public ResponseBean getMonitoringById(UserElement userElement, Integer type, Integer id) {
151
+        ResponseBean responseBean = new ResponseBean();
152
+        TpEquipment monitoring = tpEquipmentMapper.getMonitoringById(userElement.getCommunityId(), type, id);
153
+        responseBean.addSuccess(monitoring);
154
+        return responseBean;
155
+    }
156
+
157
+    @Override
158
+    public ResponseBean deleteBachEquipmentById(List<Integer> ids) {
159
+        ResponseBean responseBean = new ResponseBean();
160
+        this.removeByIds(ids);
161
+        responseBean.addSuccess("操作成功!");
162
+        return responseBean;
163
+    }
150 164
 }

+ 20
- 1
VUECODE/smart-property-manage/src/api/equipment.js 查看文件

@@ -3,7 +3,7 @@ import request from '@/utils/request'
3 3
 // 查询设备列表
4 4
 export function getAll(data) {
5 5
   return request({
6
-    url: '/equipment',
6
+    url: '/equipment/list',
7 7
     method: 'get',
8 8
     params: {
9 9
       type: data.type
@@ -28,3 +28,22 @@ export function deleteEquipment(id) {
28 28
   })
29 29
 }
30 30
 
31
+// 根据设备id查询
32
+export function getMonitoringById(data) {
33
+  return request({
34
+    url: '/equipment/' + data.id,
35
+    method: 'get',
36
+    params: {
37
+      type: data.type
38
+    }
39
+  })
40
+}
41
+
42
+// 批量删除设备
43
+export function deleteMonitoringBachByIds(data) {
44
+  return request({
45
+    url: '/equipment/delete',
46
+    method: 'delete',
47
+    data
48
+  })
49
+}

+ 46
- 8
VUECODE/smart-property-manage/src/router/index.js 查看文件

@@ -513,25 +513,63 @@ export const constantRouterMap = [
513 513
     alwaysShow: true,
514 514
     meta: { title: '系统资源', icon: 'zip' },
515 515
     children: [
516
+      // {
517
+      //   path: '/systemResources/app/index',
518
+      //   component: () => import('@/views/systemResources/app/index'),
519
+      //   name: 'app-index',
520
+      //   meta: { title: 'APP配置', icon: 'table' }
521
+      // },
522
+      {
523
+        path: '/systemResources/banner/index',
524
+        component: () => import('@/views/systemResources/banner/index'),
525
+        name: 'banner-index',
526
+        meta: { title: 'banner轮播', icon: 'table' }
527
+      },
528
+      {
529
+        path: '/systemResources/homeIndex/index',
530
+        component: () => import('@/views/systemResources/homeIndex/index'),
531
+        name: 'homeIndex-index',
532
+        meta: { title: '首页功能按钮', icon: 'table' }
533
+      },
534
+      {
535
+        path: '/systemResources/property/index',
536
+        component: () => import('@/views/systemResources/property/index'),
537
+        name: 'property-index',
538
+        meta: { title: '物业号码', icon: 'table' }
539
+      },
516 540
       {
517
-        path: '/systemResources/app/index',
518
-        component: () => import('@/views/systemResources/app/index'),
519
-        name: 'app-index',
520
-        meta: { title: 'APP配置', icon: 'table' }
541
+        path: '/systemResources/monitoring/index',
542
+        component: () => import('@/views/systemResources/monitoring/index'),
543
+        name: 'monitoring-index',
544
+        meta: { title: '公区监控', icon: 'table' }
521 545
       },
522 546
       {
523
-        path: '/systemResources/app/property/add/index',
524
-        component: () => import('@/views/systemResources/app/property/add/index'),
547
+        path: '/systemResources/property/add/index',
548
+        component: () => import('@/views/systemResources/property/add/index'),
525 549
         name: 'property-add-index',
526 550
         hidden: true,
527 551
         meta: { title: '添加物业号码', icon: 'table' }
528 552
       },
529 553
       {
530
-        path: '/systemResources/app/property/edi/index',
531
-        component: () => import('@/views/systemResources/app/property/edi/index'),
554
+        path: '/systemResources/property/edi/index',
555
+        component: () => import('@/views/systemResources/property/edi/index'),
532 556
         name: 'property-edi-index',
533 557
         hidden: true,
534 558
         meta: { title: '修改物业号码', icon: 'table' }
559
+      },
560
+      {
561
+        path: '/systemResources/monitoring/add/index',
562
+        component: () => import('@/views/systemResources/monitoring/add/index'),
563
+        name: 'monitoring-add-index',
564
+        hidden: true,
565
+        meta: { title: '添加监控设备', icon: 'table' }
566
+      },
567
+      {
568
+        path: '/systemResources/monitoring/edi/index',
569
+        component: () => import('@/views/systemResources/monitoring/edi/index'),
570
+        name: 'monitoring-edi-index',
571
+        hidden: true,
572
+        meta: { title: '修改监控设备', icon: 'table' }
535 573
       }
536 574
     ]
537 575
   }

+ 19
- 1
VUECODE/smart-property-manage/src/store/modules/equipment.js 查看文件

@@ -1,4 +1,4 @@
1
-import { getAll, equipmentMonitoring, deleteEquipment } from '@/api/equipment'
1
+import { getAll, equipmentMonitoring, deleteEquipment, getMonitoringById, deleteMonitoringBachByIds } from '@/api/equipment'
2 2
 
3 3
 const equipment = {
4 4
   state: {
@@ -34,6 +34,24 @@ const equipment = {
34 34
           reject(error)
35 35
         })
36 36
       })
37
+    },
38
+    GetMonitoringById({ commit }, data) { // 根据设备id 和 类型
39
+      return new Promise((resolve, reject) => {
40
+        getMonitoringById(data).then(response => {
41
+          resolve(response)
42
+        }).catch(error => {
43
+          reject(error)
44
+        })
45
+      })
46
+    },
47
+    DeleteMonitoringBachByIds({ commit }, data) { // 批量删除设备,id 集合
48
+      return new Promise((resolve, reject) => {
49
+        deleteMonitoringBachByIds(data).then(response => {
50
+          resolve(response)
51
+        }).catch(error => {
52
+          reject(error)
53
+        })
54
+      })
37 55
     }
38 56
   }
39 57
 }

+ 89
- 0
VUECODE/smart-property-manage/src/views/systemResources/banner/index.vue 查看文件

@@ -0,0 +1,89 @@
1
+<template>
2
+  <div id="root">
3
+    <div style="width: 1000px; margin-left: auto; margin-right: auto; margin-top: 20px;">
4
+      <span>APP端公告列表中,前多少个,显示在公告banner位?</span>
5
+      <el-input v-model="announcementBannerNum" min="1" max="10" type="number" placeholder="请输入数字" style="width: 150px;" @change="handleBannerChange"/>
6
+      <el-tooltip class="item" effect="dark" content="如果需要修改,请选择1~10之间的数字后保存!" placement="top-start">
7
+        <i class="el-icon-info"/>
8
+      </el-tooltip>
9
+      <el-button v-if="announcementBannerBool" type="primary" @click="carouselAnnouncementBanner">保存</el-button>
10
+    </div>
11
+    <div style="width: 1000px; margin-left: auto; margin-right: auto; margin-top: 20px;">
12
+      <span>APP端活动列表中,前多少个,显示在活动banner位?</span>
13
+      <el-input v-model="activityBannerNum" min="1" max="10" type="number" placeholder="请输入数字" style="width: 150px;" @change="handleActivityChange"/>
14
+      <el-tooltip class="item" effect="dark" content="如果需要修改,请选择1~10之间的数字后保存!" placement="top-start">
15
+        <i class="el-icon-info"/>
16
+      </el-tooltip>
17
+      <el-button v-if="activityBannerNumBool" type="primary" @click="carouselActivityBanner">保存</el-button>
18
+    </div>
19
+  </div>
20
+</template>
21
+
22
+<script>
23
+export default {
24
+  name: 'Banner',
25
+  data() {
26
+    return {
27
+      announcementBannerNum: 0, // banner数量
28
+      activityBannerNum: 0, // 活动banner数量
29
+      announcementBannerBool: false, // 是否显示公告的保存按钮
30
+      activityBannerNumBool: false // 是否显示活动的保存按钮
31
+    }
32
+  },
33
+  mounted() {
34
+    this.carouselGetBanner()
35
+  },
36
+  methods: {
37
+    handleBannerChange(value) {
38
+      console.log(value)
39
+      this.announcementBannerNum = value
40
+      this.announcementBannerBool = true
41
+    },
42
+    handleActivityChange(value) {
43
+      console.log(value)
44
+      this.activityBannerNum = value
45
+      this.activityBannerNumBool = true
46
+    },
47
+    carouselAnnouncementBanner() { // 修改公告的Banner数量
48
+      this.$store.dispatch('CarouselAnnouncementBanner', this.announcementBannerNum).then(res => {
49
+        const resCode = res.code
50
+        if (resCode === '1') {
51
+          this.$message.error(res.message)
52
+          return
53
+        }
54
+        this.$message.success(res.message)
55
+        this.announcementBannerBool = false
56
+      }).catch(() => {
57
+        console.log('error CarouselAnnouncementBanner')
58
+      })
59
+    },
60
+    carouselActivityBanner() { // 修改公告的Banner数量
61
+      this.$store.dispatch('CarouselActivityBanner', this.activityBannerNum).then(res => {
62
+        const resCode = res.code
63
+        if (resCode === '1') {
64
+          this.$message.error(res.message)
65
+          return
66
+        }
67
+        this.$message.success(res.message)
68
+        this.activityBannerNumBool = false
69
+      }).catch(() => {
70
+        console.log('error CarouselActivityBanner')
71
+      })
72
+    },
73
+    carouselGetBanner() { // 获取设置Banner的数量
74
+      this.$store.dispatch('CarouselGetBanner').then(res => {
75
+        const resData = res.data
76
+        this.activityBannerNum = resData.activity.carouselNum
77
+        this.announcementBannerNum = resData.announcement.carouselNum
78
+      }).catch(() => {
79
+        console.log('error CarouselGetBanner')
80
+      })
81
+    }
82
+  }
83
+
84
+}
85
+</script>
86
+
87
+<style scoped>
88
+
89
+</style>

+ 10
- 0
VUECODE/smart-property-manage/src/views/systemResources/homeIndex/index.html 查看文件

@@ -0,0 +1,10 @@
1
+<!DOCTYPE html>
2
+<html lang="en">
3
+<head>
4
+    <meta charset="UTF-8">
5
+    <title>$Title$</title>
6
+</head>
7
+<body>
8
+$END$
9
+</body>
10
+</html>

+ 111
- 0
VUECODE/smart-property-manage/src/views/systemResources/homeIndex/index.vue 查看文件

@@ -0,0 +1,111 @@
1
+<template>
2
+  <div id="root">
3
+    <el-table
4
+      :data="indexData"
5
+      border
6
+      style="width: 100%">
7
+      <el-table-column
8
+        prop="id"
9
+        align="center"
10
+        label="序号"
11
+        width="180"/>
12
+      <el-table-column
13
+        prop="menuName"
14
+        align="center"
15
+        label="按钮名"
16
+        width="180"/>
17
+      <el-table-column
18
+        prop="menuUrl"
19
+        align="center"
20
+        label="图标">
21
+        <template slot-scope="scope">
22
+          <img :src="scope.row.imgUrl" width="50" height="50">
23
+        </template>
24
+      </el-table-column>
25
+      <el-table-column
26
+        prop="explain"
27
+        align="center"
28
+        label="说明"/>
29
+      <el-table-column
30
+        prop="address"
31
+        align="center"
32
+        width="150"
33
+        label="启用">
34
+        <template slot-scope="scope">
35
+          <el-button v-if="scope.row.status === '1'" type="primary" @click="menuEnable(scope.row.id)">启用</el-button>
36
+          <el-button v-if="scope.row.status === '0'" type="danger" @click="menuDisable(scope.row.id)">停用</el-button>
37
+        </template>
38
+      </el-table-column>
39
+      <el-table-column
40
+        prop="address"
41
+        align="center"
42
+        width="150"
43
+        label="配置">
44
+        <template slot-scope="scope">
45
+          <el-button type="primary">配置</el-button>
46
+        </template>
47
+      </el-table-column>
48
+    </el-table>
49
+  </div>
50
+</template>
51
+
52
+<script>
53
+export default {
54
+  name: 'HomeIndex',
55
+  data() {
56
+    return {
57
+      indexData: [] // APP端菜单列表数据
58
+    }
59
+  },
60
+  mounted() {
61
+    this.getMenuList()
62
+  },
63
+  methods: {
64
+    getMenuList() { // 获取菜单列表
65
+      this.$store.dispatch('GetMenuList').then(res => {
66
+        this.indexData = res.data
67
+      }).catch(() => {
68
+        console.log('error GetMenuList')
69
+      })
70
+    },
71
+    handleSelectionChange(val) {
72
+      console.log(val)
73
+      this.ids = []
74
+      val.map((item, index) => {
75
+        this.ids.push(item.id)
76
+      })
77
+      console.log(this.ids)
78
+    },
79
+    menuEnable(id) { // 启用菜单
80
+      this.$store.dispatch('MenuEnable', id).then(res => {
81
+        const resCode = res.code
82
+        if (resCode === '1') {
83
+          this.$message.error(res.message)
84
+          return
85
+        }
86
+        this.$message.success(res.message)
87
+        this.getMenuList()
88
+      }).catch(() => {
89
+        console.log('error MenuEnable')
90
+      })
91
+    },
92
+    menuDisable(id) { // 停用菜单
93
+      this.$store.dispatch('MenuDisable', id).then(res => {
94
+        const resCode = res.code
95
+        if (resCode === '1') {
96
+          this.$message.error(res.message)
97
+          return
98
+        }
99
+        this.$message.success(res.message)
100
+        this.getMenuList()
101
+      }).catch(() => {
102
+        console.log('error MenuDisable')
103
+      })
104
+    }
105
+  }
106
+}
107
+</script>
108
+
109
+<style scoped>
110
+
111
+</style>

+ 59
- 0
VUECODE/smart-property-manage/src/views/systemResources/monitoring/add/index.vue 查看文件

@@ -0,0 +1,59 @@
1
+<template>
2
+  <div id="root">
3
+    <el-form ref="monitoringForm" :model="formInfo" label-width="120px" style="margin-top: 20px; width: 500px; margin-left: auto; margin-right: auto;">
4
+      <div style="margin: 20px 15px 10px 15px;">
5
+        <el-form-item label="视频流地址">
6
+          <el-input v-model="formInfo.url" :disabled="false" name="name"/>
7
+        </el-form-item>
8
+        <el-form-item label="地址">
9
+          <el-input v-model="formInfo.address" :disabled="false" name="address"/>
10
+        </el-form-item>
11
+        <el-form-item label="安保人员电话">
12
+          <el-input v-model="formInfo.securityGuardTel" :disabled="false" name="phone"/>
13
+        </el-form-item>
14
+        <el-form-item label="保安室电话">
15
+          <el-input v-model="formInfo.securityRoomTel" :disabled="false" name="phone-2"/>
16
+        </el-form-item>
17
+      </div>
18
+      <el-form-item>
19
+        <el-button type="primary" @click="monitoringSubmit" >提交</el-button>
20
+      </el-form-item>
21
+    </el-form>
22
+  </div>
23
+</template>
24
+
25
+<script>
26
+export default {
27
+  name: 'MonitoringAdd',
28
+  data() {
29
+    return {
30
+      formInfo: {
31
+        url: '',
32
+        address: '',
33
+        securityGuardTel: '',
34
+        securityRoomTel: ''
35
+      },
36
+      equipment: [] // 监控设备
37
+    }
38
+  },
39
+  methods: {
40
+    monitoringSubmit() { // 监控提交
41
+      console.log('monitoringForm : ', this.formInfo)
42
+      this.$store.dispatch('EquipmentMonitoring', this.formInfo).then((res) => {
43
+        if (res.code === '0') {
44
+          this.$message.success(res.message)
45
+          // 监控
46
+          // this.equipmentGetAll()
47
+          this.$router.go(-1)
48
+        }
49
+      }).catch(() => {
50
+        console.log('EquipmentMonitoring error')
51
+      })
52
+    }
53
+  }
54
+}
55
+</script>
56
+
57
+<style scoped>
58
+
59
+</style>

+ 85
- 0
VUECODE/smart-property-manage/src/views/systemResources/monitoring/edi/index.vue 查看文件

@@ -0,0 +1,85 @@
1
+<template>
2
+  <div id="root">
3
+    <el-form ref="monitoringForm" :model="formInfo" label-width="120px" style="margin-top: 20px; width: 500px; margin-left: auto; margin-right: auto;">
4
+      <div style="margin: 20px 15px 10px 15px;">
5
+        <el-form-item label="视频流地址">
6
+          <el-input v-model="formInfo.url" :disabled="false" name="name"/>
7
+        </el-form-item>
8
+        <el-form-item label="地址">
9
+          <el-input v-model="formInfo.address" :disabled="false" name="address"/>
10
+        </el-form-item>
11
+        <el-form-item label="安保人员电话">
12
+          <el-input v-model="formInfo.securityGuardTel" :disabled="false" name="phone"/>
13
+        </el-form-item>
14
+        <el-form-item label="保安室电话">
15
+          <el-input v-model="formInfo.securityRoomTel" :disabled="false" name="phone-2"/>
16
+        </el-form-item>
17
+      </div>
18
+      <el-form-item>
19
+        <el-button type="primary" @click="monitoringSubmit" >提交</el-button>
20
+      </el-form-item>
21
+    </el-form>
22
+  </div>
23
+</template>
24
+
25
+<script>
26
+export default {
27
+  name: 'MonitoringAdd',
28
+  data() {
29
+    return {
30
+      formInfo: {
31
+        address: '',
32
+        addressId: '',
33
+        communityId: '',
34
+        createTime: '',
35
+        createUser: '',
36
+        equipmentTreeId: '',
37
+        equipmentType: '',
38
+        id: '',
39
+        securityGuardTel: '',
40
+        securityGuardTelId: '',
41
+        securityRoomTel: '',
42
+        securityRoomTelId: '',
43
+        updateTime: '',
44
+        updateUser: '',
45
+        url: '',
46
+        urlId: '',
47
+        uuid: '',
48
+        uuidId: ''
49
+      }
50
+    }
51
+  },
52
+  mounted() {
53
+    this.formInfo.id = this.$route.query.id
54
+    this.getMonitoringById()
55
+  },
56
+  methods: {
57
+    monitoringSubmit() { // 监控提交
58
+      console.log('monitoringForm : ', this.formInfo)
59
+      this.$store.dispatch('EquipmentMonitoring', this.formInfo).then((res) => {
60
+        if (res.code === '0') {
61
+          this.$message.success(res.message)
62
+          // 监控
63
+          // this.equipmentGetAll()
64
+          this.$router.go(-1)
65
+        }
66
+      }).catch(() => {
67
+        console.log('EquipmentMonitoring error')
68
+      })
69
+    },
70
+    getMonitoringById() { // 查询设备
71
+      const dataQuery = { id: this.formInfo.id, type: 1 }
72
+      this.$store.dispatch('GetMonitoringById', dataQuery).then((res) => {
73
+        if (res.code === '0') {
74
+          // 监控
75
+          this.formInfo = res.data
76
+        }
77
+      })
78
+    }
79
+  }
80
+}
81
+</script>
82
+
83
+<style scoped>
84
+
85
+</style>

+ 192
- 0
VUECODE/smart-property-manage/src/views/systemResources/monitoring/index.vue 查看文件

@@ -0,0 +1,192 @@
1
+<template>
2
+  <div id="root">
3
+    <div style="margin: 20px 15px 10px 15px;">
4
+      <el-button type="primary" @click="addMonitoring">添加</el-button>
5
+      <el-button type="warning" @click="ediMonitoring">修改</el-button>
6
+      <el-button type="danger" @click="deleteMonitoring">删除</el-button>
7
+    </div>
8
+    <!--<div style="display: flex; justify-content: center; flex-wrap: wrap; ">-->
9
+    <!--<el-form v-for="(item, index) in equipmentList" ref="monitoringForm" label-width="120px" style="margin-top: 20px;">-->
10
+    <!--<div style="padding: 10px 20px 0;border-radius: 8px;margin: 20px 15px 10px 15px;border: 1px solid #eee;box-shadow: 4px 4px 10px #dadada;">-->
11
+    <!--<el-form-item label="编号">-->
12
+    <!--&lt;!&ndash; item.id &ndash;&gt;-->
13
+    <!--<span>{{ index }}</span>-->
14
+    <!--</el-form-item>-->
15
+    <!--<el-form-item label="视频流地址">-->
16
+    <!--<el-input v-model="item.url" :disabled="false" name="name"/>-->
17
+    <!--</el-form-item>-->
18
+    <!--<el-form-item label="地址">-->
19
+    <!--<el-input v-model="item.address" :disabled="false" name="address"/>-->
20
+    <!--</el-form-item>-->
21
+    <!--<el-form-item label="安保人员电话">-->
22
+    <!--<el-input v-model="item.securityGuardTel" :disabled="false" name="phone"/>-->
23
+    <!--</el-form-item>-->
24
+    <!--<el-form-item label="保安室电话">-->
25
+    <!--<el-input v-model="item.securityRoomTel" :disabled="false" name="phone-2"/>-->
26
+    <!--</el-form-item>-->
27
+    <!--</div>-->
28
+    <!--<el-form-item>-->
29
+    <!--<el-button type="info" @click="monitoringRemover(item.id, index)" >删除</el-button>-->
30
+    <!--</el-form-item>-->
31
+    <!--</el-form>-->
32
+    <!--</div>-->
33
+    <el-table
34
+      :data="equipmentList"
35
+      border
36
+      style="width: 100%"
37
+      @selection-change="handleSelectionChange">
38
+      <el-table-column
39
+        type="selection"
40
+        width="55"/>
41
+      <el-table-column
42
+        prop="id"
43
+        label="编号"
44
+        align="center"
45
+        width="50"/>
46
+      <el-table-column
47
+        prop="url"
48
+        label="视频流地址"
49
+        align="center"
50
+        width="600"/>
51
+      <el-table-column
52
+        prop="address"
53
+        align="center"
54
+        label="地址"/>
55
+      <el-table-column
56
+        prop="securityGuardTel"
57
+        align="center"
58
+        label="安保人员电话"/>
59
+      <el-table-column
60
+        prop="securityRoomTel"
61
+        align="center"
62
+        label="保安室电话"/>
63
+    </el-table>
64
+  </div>
65
+</template>
66
+
67
+<script>
68
+export default {
69
+  name: 'Monitoring',
70
+  data() {
71
+    return {
72
+      monitoring: { // 监控数据
73
+
74
+      },
75
+      ids: [],
76
+      equipmentList: [] // 处理过后的监控数据
77
+    }
78
+  },
79
+  mounted() {
80
+    this.equipmentGetAll()
81
+  },
82
+  methods: {
83
+    handleSelectionChange(val) {
84
+      this.ids = []
85
+      val.map((item, index) => {
86
+        this.ids.push(item.id)
87
+      })
88
+    },
89
+    equipmentGetAll() { // 监控配置
90
+      const eqData = { type: 1 }
91
+      this.$store.dispatch('EquipmentGetAll', eqData).then((res) => {
92
+        this.equipmentList = res.data
93
+      }).catch(() => {
94
+        console.log('EquipmentGetAll error')
95
+      })
96
+    },
97
+    addMonitoring() { // 添加一个公区监控配置
98
+      // this.equipmentList.push({
99
+      //   'address': '',
100
+      //   'addressId': '',
101
+      //   'communityId': '',
102
+      //   'createTime': '',
103
+      //   'createUser': '',
104
+      //   'equipmentTreeId': '',
105
+      //   'equipmentType': '',
106
+      //   'id': '',
107
+      //   'securityGuardTel': '',
108
+      //   'securityGuardTelId': '',
109
+      //   'securityRoomTel': '',
110
+      //   'securityRoomTelId': '',
111
+      //   'updateTime': '',
112
+      //   'updateUser': '',
113
+      //   'url': '',
114
+      //   'urlId': '',
115
+      //   'uuid': '',
116
+      //   'uuidId': ''
117
+      // })
118
+      this.$router.push({ name: 'monitoring-add-index' })
119
+    },
120
+    monitoringSubmit() { // 监控提交
121
+      console.log('monitoringForm : ', this.equipmentList)
122
+      this.$store.dispatch('EquipmentMonitoring', this.equipmentList).then((res) => {
123
+        if (res.code === '0') {
124
+          this.$message.success(res.message)
125
+          // 监控
126
+          this.equipmentGetAll()
127
+        }
128
+      }).catch(() => {
129
+        console.log('EquipmentMonitoring error')
130
+      })
131
+    },
132
+    monitoringRemover(id, equipmentIndex) { // 监控删除
133
+      // console.log('monitoringForm : ', this.equipmentList, '  下坐标:', equipmentIndex)
134
+      const tempEquipmentList = []
135
+      this.equipmentList.map((item, index) => {
136
+        // 排除需要删除的下坐标的数据
137
+        if (index !== equipmentIndex) {
138
+          tempEquipmentList.push(item)
139
+        }
140
+      })
141
+      this.equipmentList = tempEquipmentList
142
+
143
+      if (id !== '') {
144
+        this.$store.dispatch('DeleteEquipment', id).then(res => {
145
+          const resCode = res.code
146
+          if (resCode === '1') {
147
+            this.$message.error(res.message)
148
+            return
149
+          }
150
+          this.getMenuList()
151
+        }).catch(() => {
152
+          console.log('DeleteEquipment error!')
153
+        })
154
+      }
155
+    },
156
+    ediMonitoring() {
157
+      if (this.ids.length === 0) {
158
+        this.$message.error('请至少选择一行!')
159
+        return
160
+      }
161
+      if (this.ids.length > 1) {
162
+        this.$message.error('只能操作一行!')
163
+        return
164
+      }
165
+      this.$router.push({ name: 'monitoring-edi-index', query: { id: this.ids[0] }})
166
+    },
167
+    deleteMonitoring() {
168
+      if (this.ids.length === 0) {
169
+        this.$message.error('请至少选择一行!')
170
+        return
171
+      }
172
+      this.$store.dispatch('DeleteMonitoringBachByIds', this.ids).then((res) => {
173
+        const resCode = res.code
174
+        if (resCode === '1') {
175
+          this.$message.error(res.message)
176
+          return
177
+        }
178
+        this.$message.success(res.message)
179
+        this.equipmentGetAll()
180
+      }).catch(() => {
181
+        console.log('DeleteMonitoringBachByIds error!')
182
+      })
183
+    }
184
+  }
185
+}
186
+</script>
187
+
188
+<style scoped>
189
+#root {
190
+  margin-top: 20px;
191
+}
192
+</style>

+ 65
- 0
VUECODE/smart-property-manage/src/views/systemResources/property/add/index.vue 查看文件

@@ -0,0 +1,65 @@
1
+<template>
2
+  <div id="root">
3
+    <el-form :model="formInline" label-width="80px" class="form-class">
4
+      <el-form-item label="名称">
5
+        <el-input v-model="formInline.name"/>
6
+      </el-form-item>
7
+      <el-form-item label="号码">
8
+        <el-input v-model="formInline.tel"/>
9
+      </el-form-item>
10
+      <el-form-item label="备注">
11
+        <el-input v-model="formInline.remark"/>
12
+      </el-form-item>
13
+      <div class="button-class">
14
+        <el-button type="info" @click="exit">取消</el-button>
15
+        <el-button type="primary" @click="add">保存</el-button>
16
+      </div>
17
+    </el-form>
18
+  </div>
19
+</template>
20
+
21
+<script>
22
+export default {
23
+  name: 'Index',
24
+  data() {
25
+    return {
26
+      formInline: {
27
+        name: '',
28
+        tel: '',
29
+        remark: ''
30
+      }
31
+    }
32
+  },
33
+  methods: {
34
+    add() {
35
+      this.$store.dispatch('TelAdd', this.formInline).then(res => {
36
+        const resCode = res.code
37
+        if (resCode === '1') {
38
+          this.$message.error(res.message)
39
+          return
40
+        }
41
+        this.$message.success(res.message)
42
+        this.$router.go(-1)
43
+      }).catch(() => {
44
+        console.log('error TelAdd')
45
+      })
46
+    },
47
+    exit() {
48
+      this.$router.go(-1)
49
+    }
50
+  }
51
+}
52
+</script>
53
+
54
+<style scoped>
55
+.form-class {
56
+  width: 400px;
57
+  margin-right: auto;
58
+  margin-left: auto;
59
+  margin-top: 20px;
60
+}
61
+.button-class {
62
+  display: flex;
63
+  justify-content: center;
64
+}
65
+</style>

+ 85
- 0
VUECODE/smart-property-manage/src/views/systemResources/property/edi/index.vue 查看文件

@@ -0,0 +1,85 @@
1
+<template>
2
+  <div id="root">
3
+    <el-form :model="formInline" label-width="80px" class="form-class">
4
+      <el-form-item label="名称">
5
+        <el-input v-model="formInline.name"/>
6
+      </el-form-item>
7
+      <el-form-item label="号码">
8
+        <el-input v-model="formInline.tel"/>
9
+      </el-form-item>
10
+      <el-form-item label="备注">
11
+        <el-input v-model="formInline.remark"/>
12
+      </el-form-item>
13
+      <div class="button-class">
14
+        <el-button type="info" @click="exit">取消</el-button>
15
+        <el-button type="primary" @click="updateTels">保存</el-button>
16
+      </div>
17
+    </el-form>
18
+  </div>
19
+</template>
20
+
21
+<script>
22
+export default {
23
+  name: 'Index',
24
+  data() {
25
+    return {
26
+      formInline: {
27
+        id: '',
28
+        name: '',
29
+        tel: '',
30
+        remark: ''
31
+      }
32
+    }
33
+  },
34
+  mounted() {
35
+    this.formInline.id = this.$route.query.id
36
+    this.getTelsById()
37
+  },
38
+  methods: {
39
+    updateTels() {
40
+      this.$store.dispatch('TelUpdate', this.formInline).then(res => {
41
+        const resCode = res.code
42
+        if (resCode === '1') {
43
+          this.$message.error(res.message)
44
+          return
45
+        }
46
+        this.$message.success(res.message)
47
+        this.$router.go(-1)
48
+      }).catch(() => {
49
+        console.log('error TelUpdate')
50
+      })
51
+    },
52
+    exit() {
53
+      this.$router.go(-1)
54
+    },
55
+    getTelsById() { // 根据详情查询物业号码
56
+      this.$store.dispatch('GetTelById', this.formInline.id).then(res => {
57
+        const resCode = res.code
58
+        if (resCode === '1') {
59
+          this.$message.error(res.message)
60
+          return
61
+        }
62
+        const resData = res.data
63
+        this.formInline.name = resData.name
64
+        this.formInline.tel = resData.tel
65
+        this.formInline.remark = resData.remark
66
+      }).catch(() => {
67
+        console.log('error ')
68
+      })
69
+    }
70
+  }
71
+}
72
+</script>
73
+
74
+<style scoped>
75
+.form-class {
76
+  width: 400px;
77
+  margin-right: auto;
78
+  margin-left: auto;
79
+  margin-top: 20px;
80
+}
81
+.button-class {
82
+  display: flex;
83
+  justify-content: center;
84
+}
85
+</style>

+ 146
- 0
VUECODE/smart-property-manage/src/views/systemResources/property/index.vue 查看文件

@@ -0,0 +1,146 @@
1
+<template>
2
+  <div id="root">
3
+    <el-form :model="formInline" inline="true" class="form-inline">
4
+      <el-form-item label="名称">
5
+        <el-input v-model="formInline.name" placeholder="名称"/>
6
+      </el-form-item>
7
+      <el-form-item label="号码">
8
+        <el-input v-model="formInline.tel" placeholder="号码"/>
9
+      </el-form-item>
10
+      <el-form-item label="备注">
11
+        <el-input v-model="formInline.remark" placeholder="备注"/>
12
+      </el-form-item>
13
+      <el-form-item>
14
+        <el-button type="primary" @click="onSubmit">查询</el-button>
15
+      </el-form-item>
16
+    </el-form>
17
+    <div style="margin-left: 20px;">
18
+      <el-button type="primary" @click="add">添加</el-button>
19
+      <el-button type="warning" @click="edi">修改</el-button>
20
+      <el-button type="danger" @click="deleteIds">删除</el-button>
21
+    </div>
22
+    <el-table
23
+      ref="multipleTable"
24
+      :data="propertyList"
25
+      border
26
+      tooltip-effect="dark"
27
+      style="width: 100%; margin-top: 20px;"
28
+      @selection-change="handleSelectionChange">
29
+      <el-table-column
30
+        type="selection"
31
+        width="55"/>
32
+      <el-table-column
33
+        prop="name"
34
+        label="名称"/>
35
+      <el-table-column
36
+        prop="tel"
37
+        label="号码"/>
38
+      <el-table-column
39
+        prop="remark"
40
+        label="备注"/>
41
+      <el-table-column
42
+        prop="updateName"
43
+        label="编辑人"/>
44
+      <el-table-column
45
+        prop="updateDate"
46
+        label="编辑时间">
47
+        <template slot-scope="scope">{{ formatDate(scope.row.updateDate) }}</template>
48
+      </el-table-column>
49
+    </el-table>
50
+  </div>
51
+</template>
52
+
53
+<script>
54
+export default {
55
+  name: 'Property',
56
+  data() {
57
+    return {
58
+      formInline: {
59
+        name: '',
60
+        tel: '',
61
+        remark: '',
62
+        pageNum: 1,
63
+        pageSize: 100
64
+      },
65
+      ids: [], // id集合
66
+      propertyList: [] // 物业数据列表
67
+    }
68
+  },
69
+  mounted() {
70
+    this.getPropertyData()
71
+  },
72
+  methods: {
73
+    getPropertyData() { // 查询物业号码数据
74
+      this.$store.dispatch('GetTelsList', this.formInline).then(res => {
75
+        const resData = res.data
76
+        this.propertyList = resData.list
77
+      }).catch(() => {
78
+        console.log('error GetTelsList')
79
+      })
80
+    },
81
+    onSubmit() {
82
+      this.getPropertyData()
83
+    },
84
+    add() { // 跳转添加物业号码
85
+      this.$router.push({ name: 'property-add-index' })
86
+    },
87
+    edi() { // 修改页面
88
+      if (this.ids.length === 0) {
89
+        this.$message.error('请至少选择一项')
90
+        return
91
+      }
92
+      if (this.ids.length > 1) {
93
+        this.$message.error('只能选择一项进行操作')
94
+        return
95
+      }
96
+      this.$router.push({ name: 'property-edi-index', query: { id: this.ids[0] }})
97
+    },
98
+    deleteIds() { // 批量删除id
99
+      if (this.ids.length === 0) {
100
+        this.$message.error('请至少选择一个项')
101
+        return
102
+      }
103
+      this.$store.dispatch('TelDeleteProperty', this.ids).then(res => {
104
+        const resCode = res.code
105
+        if (resCode === '1') {
106
+          this.$message.error(res.message)
107
+          return
108
+        }
109
+        this.$message.success(res.message)
110
+        this.getPropertyData()
111
+      }).catch(() => {
112
+        console.log('error TelDelete')
113
+      })
114
+    },
115
+    handleSelectionChange(val) {
116
+      console.log(val)
117
+      this.ids = []
118
+      val.map((item, index) => {
119
+        this.ids.push(item.id)
120
+      })
121
+      console.log(this.ids)
122
+    },
123
+    formatDate(val) {
124
+      if (val === null) {
125
+        return ''
126
+      }
127
+      var value = new Date(val)
128
+      var year = value.getFullYear()
129
+      var month = value.getMonth() + 1
130
+      var day = value.getDate()
131
+      // var hour = value.getHours()
132
+      // var minutes = value.getMinutes()
133
+      // var seconds = value.getSeconds()
134
+      // return year + '-' + month + '-' + day + ' ' + hour + ':' + minutes + ':' + seconds
135
+      return year + '-' + month + '-' + day
136
+    }
137
+  }
138
+}
139
+</script>
140
+
141
+<style scoped>
142
+  .form-inline {
143
+    margin-left: 20px;
144
+    margin-top: 20px;
145
+  }
146
+</style>