dingxin 6 年前
父节点
当前提交
57dba05f15
共有 100 个文件被更改,包括 3939 次插入76 次删除
  1. 10
    16
      CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/ImageController.java
  2. 62
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/TaFaceController.java
  3. 1
    1
      CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/TicketController.java
  4. 59
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/VistorController.java
  5. 26
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TaFaceMapper.java
  6. 25
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TaVisitorLicenseMapper.java
  7. 27
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TaVisitorMapper.java
  8. 50
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TaFace.java
  9. 166
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TaVisitor.java
  10. 85
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TaVisitorLicense.java
  11. 24
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/TaFaceServicel.java
  12. 16
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/TaVistorServiceI.java
  13. 6
    1
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/SocialServiceImpl.java
  14. 148
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TaFaceServicelimpl.java
  15. 73
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TaVistorServiceImpl.java
  16. 4
    0
      CODE/smart-community/app-api/src/main/resources/bootstrap.yml
  17. 120
    0
      CODE/smart-community/app-api/src/main/resources/mapper/TaFaceMapper.xml
  18. 135
    0
      CODE/smart-community/app-api/src/main/resources/mapper/TaVisitorLicenseMapper.xml
  19. 319
    0
      CODE/smart-community/app-api/src/main/resources/mapper/TaVisitorMapper.xml
  20. 213
    0
      CODE/smart-community/community-common/src/main/java/com/community/commom/ailiyun/AESDecode.java
  21. 6
    3
      CODE/smart-community/community-common/src/main/java/com/community/commom/constant/Constant.java
  22. 二进制
      CODE/smart-community/community-common/target/classes/com/community/commom/ailiyun/AESDecode.class
  23. 二进制
      CODE/smart-community/community-common/target/classes/com/community/commom/constant/Constant.class
  24. 23
    7
      CODE/smart-community/operate-api/src/main/java/com/community/huiju/controller/BannerController.java
  25. 20
    6
      CODE/smart-community/operate-api/src/main/java/com/community/huiju/controller/CommunityController.java
  26. 21
    0
      CODE/smart-community/operate-api/src/main/java/com/community/huiju/controller/UserController.java
  27. 9
    0
      CODE/smart-community/operate-api/src/main/java/com/community/huiju/dao/ToSysRoleMapper.java
  28. 1
    1
      CODE/smart-community/operate-api/src/main/java/com/community/huiju/model/ToBanner.java
  29. 42
    0
      CODE/smart-community/operate-api/src/main/java/com/community/huiju/model/ToCommunities.java
  30. 2
    1
      CODE/smart-community/operate-api/src/main/java/com/community/huiju/service/CommunityServiceI.java
  31. 3
    1
      CODE/smart-community/operate-api/src/main/java/com/community/huiju/service/IToBannerService.java
  32. 18
    0
      CODE/smart-community/operate-api/src/main/java/com/community/huiju/service/IToSysRoleService.java
  33. 7
    0
      CODE/smart-community/operate-api/src/main/java/com/community/huiju/service/IToUserService.java
  34. 9
    3
      CODE/smart-community/operate-api/src/main/java/com/community/huiju/service/impl/CommunityServiceImpl.java
  35. 16
    5
      CODE/smart-community/operate-api/src/main/java/com/community/huiju/service/impl/ToBannerServiceImpl.java
  36. 24
    0
      CODE/smart-community/operate-api/src/main/java/com/community/huiju/service/impl/ToSysRoleServiceImpl.java
  37. 28
    0
      CODE/smart-community/operate-api/src/main/java/com/community/huiju/service/impl/ToUserServerImpl.java
  38. 5
    0
      CODE/smart-community/operate-api/src/main/java/com/community/huiju/vo/ToUserVO.java
  39. 4
    0
      CODE/smart-community/operate-api/src/main/resources/mapper/ToBannerMapper.xml
  40. 6
    2
      CODE/smart-community/operate-api/src/main/resources/mapper/ToCommunitiesMapper.xml
  41. 6
    0
      CODE/smart-community/operate-api/src/main/resources/mapper/ToSysRoleMapper.xml
  42. 2
    17
      CODE/smart-community/zuul/pom.xml
  43. 37
    3
      CODE/smart-community/zuul/src/main/java/com/community/huiju/ZuulApplication.java
  44. 46
    0
      CODE/smart-community/zuul/src/main/java/com/community/huiju/filter/DomainZuulPreFilter.java
  45. 2
    3
      CODE/smart-community/zuul/src/main/java/com/community/huiju/security/RestAuthenticationEntryPoint.java
  46. 12
    1
      CODE/smart-community/zuul/src/main/java/com/community/huiju/security/RestPreAuthenticateProvider.java
  47. 2
    2
      CODE/smart-community/zuul/src/main/java/com/community/huiju/security/RestPreAuthenticatedProcessingFilter.java
  48. 2
    1
      CODE/smart-community/zuul/src/main/resources/application.yml
  49. 1
    0
      CODE/smart-community/zuul/src/main/resources/bootstrap.yml
  50. 1
    1
      CODE/smart-community/zuul/src/main/resources/mapper/ToSysRoleMapper.xml
  51. 1
    1
      CODE/smart-community/zuul/src/main/resources/parametes.properties
  52. 12
    0
      VUECODE/smart-operate-manage/.babelrc
  53. 14
    0
      VUECODE/smart-operate-manage/.editorconfig
  54. 3
    0
      VUECODE/smart-operate-manage/.eslintignore
  55. 196
    0
      VUECODE/smart-operate-manage/.eslintrc.js
  56. 15
    0
      VUECODE/smart-operate-manage/.gitignore
  57. 10
    0
      VUECODE/smart-operate-manage/.postcssrc.js
  58. 5
    0
      VUECODE/smart-operate-manage/.travis.yml
  59. 21
    0
      VUECODE/smart-operate-manage/LICENSE
  60. 96
    0
      VUECODE/smart-operate-manage/README-zh.md
  61. 88
    0
      VUECODE/smart-operate-manage/README.md
  62. 45
    0
      VUECODE/smart-operate-manage/build/build.js
  63. 64
    0
      VUECODE/smart-operate-manage/build/check-versions.js
  64. 二进制
      VUECODE/smart-operate-manage/build/logo.png
  65. 108
    0
      VUECODE/smart-operate-manage/build/utils.js
  66. 5
    0
      VUECODE/smart-operate-manage/build/vue-loader.conf.js
  67. 107
    0
      VUECODE/smart-operate-manage/build/webpack.base.conf.js
  68. 95
    0
      VUECODE/smart-operate-manage/build/webpack.dev.conf.js
  69. 178
    0
      VUECODE/smart-operate-manage/build/webpack.prod.conf.js
  70. 8
    0
      VUECODE/smart-operate-manage/config/dev.env.js
  71. 87
    0
      VUECODE/smart-operate-manage/config/index.js
  72. 5
    0
      VUECODE/smart-operate-manage/config/prod.env.js
  73. 二进制
      VUECODE/smart-operate-manage/favicon.ico
  74. 12
    0
      VUECODE/smart-operate-manage/index.html
  75. 88
    0
      VUECODE/smart-operate-manage/package.json
  76. 11
    0
      VUECODE/smart-operate-manage/src/App.vue
  77. 37
    0
      VUECODE/smart-operate-manage/src/api/banner.js
  78. 25
    0
      VUECODE/smart-operate-manage/src/api/community.js
  79. 38
    0
      VUECODE/smart-operate-manage/src/api/login.js
  80. 9
    0
      VUECODE/smart-operate-manage/src/api/table.js
  81. 二进制
      VUECODE/smart-operate-manage/src/assets/404_images/404.png
  82. 二进制
      VUECODE/smart-operate-manage/src/assets/404_images/404_cloud.png
  83. 61
    0
      VUECODE/smart-operate-manage/src/components/Breadcrumb/index.vue
  84. 58
    0
      VUECODE/smart-operate-manage/src/components/Hamburger/index.vue
  85. 99
    0
      VUECODE/smart-operate-manage/src/components/Pagination/index.vue
  86. 43
    0
      VUECODE/smart-operate-manage/src/components/SvgIcon/index.vue
  87. 49
    0
      VUECODE/smart-operate-manage/src/directive/clipboard/clipboard.js
  88. 13
    0
      VUECODE/smart-operate-manage/src/directive/clipboard/index.js
  89. 77
    0
      VUECODE/smart-operate-manage/src/directive/el-dragDialog/drag.js
  90. 13
    0
      VUECODE/smart-operate-manage/src/directive/el-dragDialog/index.js
  91. 13
    0
      VUECODE/smart-operate-manage/src/directive/permission/index.js
  92. 23
    0
      VUECODE/smart-operate-manage/src/directive/permission/permission.js
  93. 91
    0
      VUECODE/smart-operate-manage/src/directive/sticky.js
  94. 13
    0
      VUECODE/smart-operate-manage/src/directive/waves/index.js
  95. 26
    0
      VUECODE/smart-operate-manage/src/directive/waves/waves.css
  96. 42
    0
      VUECODE/smart-operate-manage/src/directive/waves/waves.js
  97. 9
    0
      VUECODE/smart-operate-manage/src/icons/index.js
  98. 1
    0
      VUECODE/smart-operate-manage/src/icons/svg/example.svg
  99. 1
    0
      VUECODE/smart-operate-manage/src/icons/svg/eye.svg
  100. 0
    0
      VUECODE/smart-operate-manage/src/icons/svg/form.svg

+ 10
- 16
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/ImageController.java 查看文件

@@ -1,15 +1,9 @@
1 1
 package com.community.huiju.controller;
2 2
 
3 3
 import com.aliyun.oss.OSSClient;
4
-import io.swagger.annotations.Api;
5
-import io.swagger.annotations.ApiImplicitParam;
6
-import io.swagger.annotations.ApiImplicitParams;
7
-import io.swagger.annotations.ApiOperation;
4
+import io.swagger.annotations.*;
8 5
 import org.springframework.cloud.context.config.annotation.RefreshScope;
9
-import org.springframework.web.bind.annotation.RequestMapping;
10
-import org.springframework.web.bind.annotation.RequestMethod;
11
-import org.springframework.web.bind.annotation.RequestParam;
12
-import org.springframework.web.bind.annotation.RestController;
6
+import org.springframework.web.bind.annotation.*;
13 7
 import org.springframework.web.multipart.MultipartFile;
14 8
 
15 9
 import java.io.ByteArrayInputStream;
@@ -27,23 +21,23 @@ import java.util.Date;
27 21
 @Api(value = "图片操作API", description = "图片操作API")
28 22
 public class ImageController {
29 23
 
30
-    private static String imgName = System.currentTimeMillis() + ".png";
31
-    private static String endpoint = "http://oss-cn-beijing.aliyuncs.com";
32
-    private static String accessKeyId = "LTAIkc75dpkJw8Lb";
33
-    private static String accessKeySecret = "v4bvXCaix6vSDTCFfwSAdqV53iFEQw";
34
-    private static String bucketName = "yc-smart-community";
24
+    private static String endpoint = "http://oss-cn-hangzhou.aliyuncs.com";
25
+    private static String accessKeyId = "LTAIiG6xeHbVzTXC";
26
+    private static String accessKeySecret = "YUci8oBtm5WzobH6SP2eyZUbjCBKBo";
27
+    private static String bucketName = "imgurlspace";
35 28
 
36 29
     @ApiOperation(value = "图片上传以及获取url", notes = "图片上传以及获取url")
37
-    @ApiImplicitParams({@ApiImplicitParam(paramType = "form",dataType = "file",name = "uploadFile",value = "图片")})
38
-    @RequestMapping(value = "/getUrl", method = RequestMethod.POST)
39
-    public static String uploadImgAndGetUrl(@RequestParam("file") MultipartFile uploadFile) throws Exception {
30
+    @PostMapping(value = "/getUrl", consumes = "multipart/*", headers = "content-type=multipart/form-data")
31
+    public String uploadImgAndGetUrl(@ApiParam(value = "file" ,required = true) MultipartFile uploadFile) throws Exception {
40 32
 
33
+        String imgName = System.currentTimeMillis() + ".png";
41 34
         // 创建OSSClient实例
42 35
         OSSClient ossClient = new OSSClient(endpoint, accessKeyId, accessKeySecret);
43 36
         // 上传
44 37
         long time = System.currentTimeMillis();
45 38
 
46 39
         ossClient.putObject(bucketName, imgName, new ByteArrayInputStream(uploadFile.getBytes()));
40
+
47 41
         // 关闭client
48 42
         ossClient.shutdown();
49 43
         Date expiration = new Date(time + 3600 * 1000 * 24 * 365 * 10);

+ 62
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/TaFaceController.java 查看文件

@@ -0,0 +1,62 @@
1
+package com.community.huiju.controller;
2
+import com.community.commom.constant.Constant;
3
+import com.community.commom.mode.ResponseBean;
4
+import com.community.commom.session.UserElement;
5
+import com.community.huiju.model.TaAgreement;
6
+import com.community.huiju.model.TaFace;
7
+import com.community.huiju.service.TaFaceServicel;
8
+import io.swagger.annotations.Api;
9
+import io.swagger.annotations.ApiImplicitParam;
10
+import io.swagger.annotations.ApiImplicitParams;
11
+import io.swagger.annotations.ApiOperation;
12
+import org.springframework.beans.factory.annotation.Autowired;
13
+import org.springframework.cloud.context.config.annotation.RefreshScope;
14
+import org.springframework.web.bind.annotation.RequestMapping;
15
+import org.springframework.web.bind.annotation.RequestMethod;
16
+import org.springframework.web.bind.annotation.RequestParam;
17
+import org.springframework.web.bind.annotation.RestController;
18
+
19
+import javax.servlet.http.HttpSession;
20
+
21
+@RestController
22
+@RefreshScope
23
+@RequestMapping("/")
24
+@Api(value = "人脸相关API", description = "人脸相关API")
25
+public class TaFaceController {
26
+    @Autowired
27
+    private TaFaceServicel faceServicel;
28
+
29
+    @ApiOperation(value = "添加人脸图片", notes = "添加人脸图片")
30
+    @ApiImplicitParams({
31
+            @ApiImplicitParam(paramType = "query",dataType = "Integer",name = "communityId",value = "小区id"),
32
+            @ApiImplicitParam(paramType = "query",dataType = "String",name = "faceImg",value = "上传的图片"),
33
+            @ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token")
34
+    })
35
+    @RequestMapping(value = "/addFace",method = RequestMethod.POST)
36
+    public Object getTaFace(HttpSession session,@RequestParam Integer communityId,
37
+                                @RequestParam String faceImg){
38
+        ResponseBean responseBean = new ResponseBean();
39
+        UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
40
+        Integer userId = userElement.getId();
41
+        responseBean = faceServicel.addFace(communityId,faceImg,userId);
42
+        return responseBean;
43
+    }
44
+
45
+    @ApiOperation(value = "修改人脸图片", notes = "修改人脸图片")
46
+    @ApiImplicitParams({
47
+            @ApiImplicitParam(paramType = "query",dataType = "Integer",name = "communityId",value = "小区id"),
48
+            @ApiImplicitParam(paramType = "query",dataType = "String",name = "faceImg",value = "上传的图片"),
49
+            @ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token")
50
+    })
51
+    @RequestMapping(value = "/upDateFace",method = RequestMethod.PUT)
52
+    public Object upDateTaFace(HttpSession session,@RequestParam Integer communityId,
53
+                                @RequestParam String faceImg
54
+                               ){
55
+        ResponseBean responseBean = new ResponseBean();
56
+        UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
57
+        Integer userId = userElement.getId();
58
+         responseBean = faceServicel.upDateFace(communityId,faceImg,userId);
59
+        return responseBean;
60
+    }
61
+
62
+}

+ 1
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/TicketController.java 查看文件

@@ -105,7 +105,7 @@ public class TicketController {
105 105
 
106 106
     @ApiOperation(value = "回复 报修/投诉/联系单 追问接口", notes = "回复 报修/投诉/联系单 追问接口")
107 107
     @ApiImplicitParams({@ApiImplicitParam(paramType = "path", dataType = "integer", name = "communityId", value = "小区Id"),
108
-            @ApiImplicitParam(name = "tpTicketRecordComment", value = "回复记录参数", paramType = "body"),
108
+            @ApiImplicitParam(name = "tpTicketRecordComment", value = "回复记录参数(ticketId:工单id,content:回复时间,ticketRecordCommentId:需要回复的id)", paramType = "body"),
109 109
             @ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token")})
110 110
     @RequestMapping(value = "/ticket/reply/{communityId}", method = RequestMethod.POST)
111 111
     public ResponseBean updateTicketsReply(@PathVariable(value = "communityId") Integer communityId, @RequestBody TpTicketRecordComment tpTicketRecordComment, HttpSession session){

+ 59
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/VistorController.java 查看文件

@@ -0,0 +1,59 @@
1
+package com.community.huiju.controller;
2
+
3
+import com.community.commom.constant.Constant;
4
+import com.community.commom.mode.ResponseBean;
5
+import com.community.commom.session.UserElement;
6
+import com.community.huiju.model.TaVisitor;
7
+import com.community.huiju.service.TaVistorServiceI;
8
+import io.swagger.annotations.Api;
9
+import io.swagger.annotations.ApiImplicitParam;
10
+import io.swagger.annotations.ApiImplicitParams;
11
+import io.swagger.annotations.ApiOperation;
12
+import org.springframework.beans.factory.annotation.Autowired;
13
+import org.springframework.cloud.context.config.annotation.RefreshScope;
14
+import org.springframework.web.bind.annotation.*;
15
+
16
+import javax.servlet.http.HttpSession;
17
+import java.util.List;
18
+
19
+/**
20
+ * @author weichaochao
21
+ * @Title: VistorController
22
+ * @Description: 访客相关API
23
+ * @date 2018/11/1
24
+ */
25
+@RestController
26
+@RefreshScope
27
+@RequestMapping("/")
28
+@Api(value = "访客相关的API", description = "访客相关的API")
29
+public class VistorController {
30
+
31
+    @Autowired
32
+    private TaVistorServiceI vistorServiceI;
33
+
34
+    @RequestMapping(value = "/vistorDetail/{communityId}", method = RequestMethod.POST)
35
+    @ApiOperation(value = "获取访客信息", notes = "获取访客信息")
36
+    @ApiImplicitParams({@ApiImplicitParam(name = "taVisitor", value = "访客", required = true, dataType = "TaVisitor"),
37
+            @ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token"),
38
+            @ApiImplicitParam(paramType = "path", dataType = "integer", name = "communityId", value = "小区Id")})
39
+    public ResponseBean findVistorDetail(@PathVariable("communityId")Integer communityId, @RequestBody TaVisitor taVisitor, HttpSession session) {
40
+        ResponseBean responseBean = new ResponseBean();
41
+        UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
42
+        Integer userId = userElement.getId();
43
+        vistorServiceI.insertTaVistor(taVisitor, communityId, userId);
44
+        return  responseBean;
45
+    }
46
+
47
+    @RequestMapping(value = "/invateVistorHis/{communityId}", method = RequestMethod.GET)
48
+    @ApiOperation(value = "邀请历史", notes = "邀请历史")
49
+    @ApiImplicitParams({@ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token"),
50
+            @ApiImplicitParam(paramType = "path", dataType = "integer", name = "communityId", value = "小区Id")})
51
+    public ResponseBean invateHis(@PathVariable("communityId")Integer communityId, HttpSession session) {
52
+        ResponseBean responseBean = new ResponseBean();
53
+        UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
54
+        Integer userId = userElement.getId();
55
+        List<TaVisitor> taVisitors = vistorServiceI.invateHis(communityId, userId);
56
+        responseBean.addSuccess(taVisitors);
57
+        return  responseBean;
58
+    }
59
+}

+ 26
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TaFaceMapper.java 查看文件

@@ -0,0 +1,26 @@
1
+package com.community.huiju.dao;
2
+
3
+import com.community.huiju.model.TaFace;
4
+import com.community.huiju.model.TpTicket;
5
+import org.apache.ibatis.annotations.Mapper;
6
+import org.apache.ibatis.annotations.Param;
7
+
8
+@Mapper
9
+public interface TaFaceMapper{
10
+    int deleteByPrimaryKey(Integer id);
11
+
12
+    int insert(TaFace record);
13
+
14
+    int insertSelective(TaFace record);
15
+
16
+    int selectByPrimaryKey(Integer id);
17
+
18
+    void updateByPrimaryKeySelective(TaFace record);
19
+
20
+    /**
21
+     * 查看当前用户信息
22
+     * @param userid
23
+     * @return
24
+     */
25
+    TaFace getByUserId(@Param("userid") Integer userid);
26
+}

+ 25
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TaVisitorLicenseMapper.java 查看文件

@@ -0,0 +1,25 @@
1
+package com.community.huiju.dao;
2
+
3
+import com.community.huiju.model.TaVisitorLicense;
4
+import org.apache.ibatis.annotations.Mapper;
5
+
6
+import java.util.List;
7
+
8
+@Mapper
9
+public interface TaVisitorLicenseMapper {
10
+    int deleteByPrimaryKey(Integer id);
11
+
12
+    int insert(TaVisitorLicense record);
13
+
14
+    int insertSelective(TaVisitorLicense record);
15
+
16
+    TaVisitorLicense selectByPrimaryKey(Integer id);
17
+
18
+    int updateByPrimaryKeySelective(TaVisitorLicense record);
19
+
20
+    int updateByPrimaryKey(TaVisitorLicense record);
21
+
22
+    void insertTaVistorLicense(TaVisitorLicense taVisitorLicense);
23
+
24
+    List<Integer> findTaVistorLicenseById(Integer id);
25
+}

+ 27
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TaVisitorMapper.java 查看文件

@@ -0,0 +1,27 @@
1
+package com.community.huiju.dao;
2
+
3
+import com.community.huiju.model.TaVisitor;
4
+import org.apache.ibatis.annotations.Mapper;
5
+import org.apache.ibatis.annotations.Param;
6
+
7
+import java.util.List;
8
+
9
+@Mapper
10
+public interface TaVisitorMapper {
11
+    int deleteByPrimaryKey(Integer id);
12
+
13
+    int insert(TaVisitor record);
14
+
15
+    int insertSelective(TaVisitor record);
16
+
17
+    TaVisitor selectByPrimaryKey(Integer id);
18
+
19
+    int updateByPrimaryKeySelective(TaVisitor record);
20
+
21
+    int updateByPrimaryKey(TaVisitor record);
22
+
23
+    void insertVistorAndLicense();
24
+
25
+    List<TaVisitor> findAllVistors(@Param("communityId") Integer communityId, @Param("userId") Integer userId);
26
+
27
+}

+ 50
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TaFace.java 查看文件

@@ -0,0 +1,50 @@
1
+package com.community.huiju.model;
2
+
3
+import lombok.AllArgsConstructor;
4
+import lombok.Data;
5
+import lombok.NoArgsConstructor;
6
+
7
+import java.util.Date;
8
+
9
+@Data
10
+@AllArgsConstructor
11
+@NoArgsConstructor
12
+public class TaFace {
13
+
14
+    private Integer id;
15
+
16
+    /**
17
+     * 小区ID
18
+     */
19
+    private Integer communityId;
20
+
21
+    /**
22
+     * 用户ID
23
+     */
24
+    private Integer taUserId;
25
+
26
+    /**
27
+     *图片
28
+     */
29
+    private  String faceImg;
30
+
31
+    /**
32
+     * 创建人
33
+     */
34
+    private  Integer createUser;
35
+
36
+    /**
37
+     * 更新人
38
+     */
39
+    private  Integer updateUser;
40
+
41
+    /**
42
+     * 创建时间
43
+     */
44
+    private  Date createDate;
45
+
46
+    /**
47
+     * 更新时间
48
+     */
49
+    private  Date updateDate;
50
+}

+ 166
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TaVisitor.java 查看文件

@@ -0,0 +1,166 @@
1
+package com.community.huiju.model;
2
+
3
+import java.util.Date;
4
+import java.util.List;
5
+
6
+public class TaVisitor {
7
+    private Integer id;
8
+
9
+    private Integer communityId;
10
+
11
+    private String visitorName;
12
+
13
+    private String visitorTel;
14
+
15
+    private String visitorNum;
16
+
17
+    private Date visitorStatrtTime;
18
+
19
+    private Integer visitorEndTime;
20
+
21
+    private String drivingStatus;
22
+
23
+    private String payEntity;
24
+
25
+    private String visitorCode;
26
+
27
+    private Integer taUserId;
28
+
29
+    private Integer createUser;
30
+
31
+    private Date createDate;
32
+
33
+    private Integer updateUser;
34
+
35
+    private Date updateDate;
36
+
37
+    private List<Integer> carLicense;
38
+
39
+    public Integer getId() {
40
+        return id;
41
+    }
42
+
43
+    public void setId(Integer id) {
44
+        this.id = id;
45
+    }
46
+
47
+    public Integer getCommunityId() {
48
+        return communityId;
49
+    }
50
+
51
+    public void setCommunityId(Integer communityId) {
52
+        this.communityId = communityId;
53
+    }
54
+
55
+    public String getVisitorName() {
56
+        return visitorName;
57
+    }
58
+
59
+    public void setVisitorName(String visitorName) {
60
+        this.visitorName = visitorName == null ? null : visitorName.trim();
61
+    }
62
+
63
+    public String getVisitorTel() {
64
+        return visitorTel;
65
+    }
66
+
67
+    public void setVisitorTel(String visitorTel) {
68
+        this.visitorTel = visitorTel == null ? null : visitorTel.trim();
69
+    }
70
+
71
+    public String getVisitorNum() {
72
+        return visitorNum;
73
+    }
74
+
75
+    public void setVisitorNum(String visitorNum) {
76
+        this.visitorNum = visitorNum == null ? null : visitorNum.trim();
77
+    }
78
+
79
+    public Date getVisitorStatrtTime() {
80
+        return visitorStatrtTime;
81
+    }
82
+
83
+    public void setVisitorStatrtTime(Date visitorStatrtTime) {
84
+        this.visitorStatrtTime = visitorStatrtTime;
85
+    }
86
+
87
+    public Integer getVisitorEndTime() {
88
+        return visitorEndTime;
89
+    }
90
+
91
+    public void setVisitorEndTime(Integer visitorEndTime) {
92
+        this.visitorEndTime = visitorEndTime;
93
+    }
94
+
95
+    public String getDrivingStatus() {
96
+        return drivingStatus;
97
+    }
98
+
99
+    public void setDrivingStatus(String drivingStatus) {
100
+        this.drivingStatus = drivingStatus == null ? null : drivingStatus.trim();
101
+    }
102
+
103
+    public String getPayEntity() {
104
+        return payEntity;
105
+    }
106
+
107
+    public void setPayEntity(String payEntity) {
108
+        this.payEntity = payEntity == null ? null : payEntity.trim();
109
+    }
110
+
111
+    public String getVisitorCode() {
112
+        return visitorCode;
113
+    }
114
+
115
+    public void setVisitorCode(String visitorCode) {
116
+        this.visitorCode = visitorCode == null ? null : visitorCode.trim();
117
+    }
118
+
119
+    public Integer getTaUserId() {
120
+        return taUserId;
121
+    }
122
+
123
+    public void setTaUserId(Integer taUserId) {
124
+        this.taUserId = taUserId;
125
+    }
126
+
127
+    public Integer getCreateUser() {
128
+        return createUser;
129
+    }
130
+
131
+    public void setCreateUser(Integer createUser) {
132
+        this.createUser = createUser;
133
+    }
134
+
135
+    public Date getCreateDate() {
136
+        return createDate;
137
+    }
138
+
139
+    public void setCreateDate(Date createDate) {
140
+        this.createDate = createDate;
141
+    }
142
+
143
+    public Integer getUpdateUser() {
144
+        return updateUser;
145
+    }
146
+
147
+    public void setUpdateUser(Integer updateUser) {
148
+        this.updateUser = updateUser;
149
+    }
150
+
151
+    public Date getUpdateDate() {
152
+        return updateDate;
153
+    }
154
+
155
+    public void setUpdateDate(Date updateDate) {
156
+        this.updateDate = updateDate;
157
+    }
158
+
159
+    public List<Integer> getCarLicense() {
160
+        return carLicense;
161
+    }
162
+
163
+    public void setCarLicense(List<Integer> carLicense) {
164
+        this.carLicense = carLicense;
165
+    }
166
+}

+ 85
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TaVisitorLicense.java 查看文件

@@ -0,0 +1,85 @@
1
+package com.community.huiju.model;
2
+
3
+import java.util.Date;
4
+
5
+public class TaVisitorLicense {
6
+    private Integer id;
7
+
8
+    private Integer communityId;
9
+
10
+    private Integer visitorId;
11
+
12
+    private String license;
13
+
14
+    private Integer createUser;
15
+
16
+    private Date createDate;
17
+
18
+    private Integer updateUser;
19
+
20
+    private Date updateDate;
21
+
22
+    public Integer getId() {
23
+        return id;
24
+    }
25
+
26
+    public void setId(Integer id) {
27
+        this.id = id;
28
+    }
29
+
30
+    public Integer getCommunityId() {
31
+        return communityId;
32
+    }
33
+
34
+    public void setCommunityId(Integer communityId) {
35
+        this.communityId = communityId;
36
+    }
37
+
38
+    public Integer getVisitorId() {
39
+        return visitorId;
40
+    }
41
+
42
+    public void setVisitorId(Integer visitorId) {
43
+        this.visitorId = visitorId;
44
+    }
45
+
46
+    public String getLicense() {
47
+        return license;
48
+    }
49
+
50
+    public void setLicense(String license) {
51
+        this.license = license == null ? null : license.trim();
52
+    }
53
+
54
+    public Integer getCreateUser() {
55
+        return createUser;
56
+    }
57
+
58
+    public void setCreateUser(Integer createUser) {
59
+        this.createUser = createUser;
60
+    }
61
+
62
+    public Date getCreateDate() {
63
+        return createDate;
64
+    }
65
+
66
+    public void setCreateDate(Date createDate) {
67
+        this.createDate = createDate;
68
+    }
69
+
70
+    public Integer getUpdateUser() {
71
+        return updateUser;
72
+    }
73
+
74
+    public void setUpdateUser(Integer updateUser) {
75
+        this.updateUser = updateUser;
76
+    }
77
+
78
+    public Date getUpdateDate() {
79
+        return updateDate;
80
+    }
81
+
82
+    public void setUpdateDate(Date updateDate) {
83
+        this.updateDate = updateDate;
84
+    }
85
+}

+ 24
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/TaFaceServicel.java 查看文件

@@ -0,0 +1,24 @@
1
+package com.community.huiju.service;
2
+
3
+
4
+import com.community.commom.mode.ResponseBean;
5
+
6
+public interface TaFaceServicel {
7
+    /**
8
+     * 添加人脸
9
+     * @param communityId
10
+     * @param faceImg
11
+     * @param userId
12
+     * @return
13
+     */
14
+    ResponseBean addFace(Integer communityId, String faceImg, Integer userId);
15
+
16
+    /**
17
+     * 更新当前人脸
18
+     * @param communityId
19
+     * @param faceImg
20
+     * @param userId
21
+     * @return
22
+     */
23
+    ResponseBean upDateFace(Integer communityId, String faceImg, Integer userId);
24
+}

+ 16
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/TaVistorServiceI.java 查看文件

@@ -0,0 +1,16 @@
1
+package com.community.huiju.service;
2
+
3
+import com.community.huiju.model.TaVisitor;
4
+
5
+import java.util.List;
6
+
7
+/**
8
+ * @author weichaochao
9
+ * @Title: TaVistorServiceI
10
+ * @Description: 访客相关service
11
+ * @date 2018/11/1
12
+ */
13
+public interface TaVistorServiceI {
14
+    void insertTaVistor(TaVisitor taVisitor, Integer communityId, Integer userId);
15
+    List<TaVisitor> invateHis(Integer communityId, Integer userId);
16
+}

+ 6
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/SocialServiceImpl.java 查看文件

@@ -200,7 +200,12 @@ public class SocialServiceImpl implements SocialServiceI {
200 200
             return responseBean;
201 201
         }
202 202
 
203
-        if (Constant.EFFECTIVE.equals(taUser.getStatus()) && (Constant.RELATION.equals(sysRole.getRoleName()) || Constant.TENANT.equals(sysRole.getRoleName()) || Constant.OWNER.equals(sysRole.getRoleName()))){
203
+        if (Constant.EFFECTIVE.equals(taUser.getVerifyStatus())
204
+                && Constant.EFFECTIVE.equals(taUser.getStatus())
205
+                && (Constant.RELATION.equals(sysRole.getRoleName())
206
+                || Constant.TENANT.equals(sysRole.getRoleName())
207
+                || Constant.OWNER.equals(sysRole.getRoleName()))){
208
+
204 209
             return insertActivitySignUp(tpActivity, communityId, userId);
205 210
         }
206 211
         responseBean.addError("9995", "无法确认您的身份,请联系物业");

+ 148
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TaFaceServicelimpl.java 查看文件

@@ -0,0 +1,148 @@
1
+package com.community.huiju.service.impl;
2
+
3
+import com.alibaba.fastjson.JSONObject;
4
+import com.community.commom.ailiyun.AESDecode;
5
+import com.community.commom.constant.Constant;
6
+import com.community.commom.mode.ResponseBean;
7
+import com.community.huiju.dao.TaFaceMapper;
8
+import com.community.huiju.dao.TaSysRoleMapper;
9
+import com.community.huiju.dao.TaUserMapper;
10
+import com.community.huiju.model.TaFace;
11
+import com.community.huiju.model.TaSysRole;
12
+import com.community.huiju.model.TaUser;
13
+import com.community.huiju.service.TaFaceServicel;
14
+import org.springframework.beans.factory.annotation.Autowired;
15
+import org.springframework.stereotype.Service;
16
+
17
+import java.util.Date;
18
+
19
+@Service
20
+public class TaFaceServicelimpl implements TaFaceServicel {
21
+
22
+
23
+    @Autowired
24
+    private TaFaceMapper taFaceMapper;
25
+
26
+    @Autowired
27
+    private TaUserMapper taUserMapper;
28
+
29
+    @Autowired
30
+    private TaSysRoleMapper taSysRoleMapper;
31
+
32
+    @Override
33
+    public ResponseBean addFace(Integer communityId, String faceImg, Integer userid) {
34
+        ResponseBean response = new ResponseBean();
35
+        TaFace taFace = new TaFace();
36
+        taFace.setCommunityId(communityId);
37
+        taFace.setTaUserId(userid);
38
+        taFace.setCreateUser(userid);
39
+        taFace.setUpdateUser(userid);
40
+        taFace.setCreateDate(new Date());
41
+        taFace.setUpdateDate(new Date());
42
+        //已登陆,身份未知,状态未知
43
+
44
+
45
+        //判断身份是否为业主且状态为已停用
46
+        TaSysRole sysRole = taSysRoleMapper.findRoleByUserId(userid);
47
+        TaUser taUser = taUserMapper.selectByPrimaryKey(userid);
48
+        if (Constant.INVALID.equals(taUser.getStatus())
49
+                && Constant.OWNER.equals(sysRole.getRoleName())) {
50
+
51
+            response.addError("9996", "您的身份已停用,请联系物业");
52
+            return response;
53
+        }
54
+
55
+        //身份为家属租客,状态为已停用
56
+        if (Constant.INVALID.equals(taUser.getStatus())
57
+                && (Constant.RELATION.equals(sysRole.getRoleName())) || Constant.TENANT.equals(sysRole.getRoleName())) {
58
+
59
+            response.addError("9996", "您的身份已停用,请联系物业");
60
+            return response;
61
+        }
62
+
63
+        //查询当前用户是否有人脸记录
64
+        TaFace User = taFaceMapper.getByUserId(userid);
65
+        if (null == User) {   //为业主,已认证
66
+            boolean isA=true;
67
+            if (Constant.OWNER.equals(sysRole.getRoleName()) && "1".equals(taUser.getVerifyStatus())) {
68
+                ResponseBean responseBean = new ResponseBean();
69
+                boolean resps=checKout(faceImg,taFace,isA,null);
70
+                if (resps==true) {
71
+                    responseBean.addSuccess("图片录入成功");
72
+                }else {
73
+                    responseBean.addError("7771","请录入正确的图片");
74
+                }
75
+                return responseBean;
76
+            }
77
+            //家属或者租客
78
+            if (Constant.RELATION.equals(sysRole.getRoleName()) || Constant.TENANT.equals(sysRole.getDescription()) && "1".equals(taUser.getVerifyStatus())) {
79
+                ResponseBean responseBeans = new ResponseBean();
80
+                boolean resps=checKout(faceImg,taFace,isA,null);
81
+                if (resps==true) {
82
+                    responseBeans.addSuccess("图片录入成功");
83
+                }else {
84
+                    responseBeans.addError("7771","请录入正确的图片");
85
+                }
86
+                return responseBeans;
87
+            }
88
+        } else {
89
+            //为业主,已认证
90
+            if (Constant.OWNER.equals(sysRole.getRoleName()) && "1".equals(taUser.getVerifyStatus())) {
91
+                response.addError("8885", "您的信息已存在");
92
+                return response;
93
+            }
94
+            //家属或者租客
95
+            if (Constant.RELATION.equals(sysRole.getRoleName()) || Constant.TENANT.equals(sysRole.getDescription()) && "1".equals(taUser.getVerifyStatus())) {
96
+                response.addError("8885", "您的信息已存在");
97
+                return response;
98
+            }
99
+        }
100
+        response.addError("9995", "无法确认您的身份,请联系物业");
101
+        return response;
102
+
103
+
104
+    }
105
+
106
+    @Override
107
+    public ResponseBean upDateFace(Integer communityId, String faceImg, Integer userId) {
108
+        boolean isA=false;
109
+        ResponseBean responseBean = new ResponseBean();
110
+        TaFace taFace = new TaFace();
111
+        taFace.setCommunityId(communityId);
112
+        taFace.setTaUserId(userId);
113
+        taFace.setUpdateUser(userId);
114
+        taFace.setUpdateDate(new Date());
115
+        boolean ck=checKout(faceImg,taFace,isA,userId);
116
+        if (ck == true) {
117
+            responseBean.addSuccess("修改成功");
118
+        }else {
119
+            responseBean.addError("7771","请录入正确图片");
120
+        }
121
+        return responseBean;
122
+    }
123
+
124
+    //人脸录入验证
125
+    public boolean checKout(String faceImg, TaFace taFace, boolean isA,Integer user) {
126
+        AESDecode aesd = new AESDecode();
127
+                String body = "{\"type\": \"0\", \"image_url\":\"" + faceImg + "\"}";
128
+        try {
129
+             ResponseBean responseBean = aesd.send(body);
130
+            JSONObject jsonObject = JSONObject.parseObject(responseBean.getMessage());
131
+            Integer type = (Integer) jsonObject.get("errno");
132
+            Integer faceNum= (Integer) jsonObject.get("face_num");
133
+            if (0==type && null!=faceNum && 1==faceNum && isA==true) {
134
+                taFace.setFaceImg(faceImg);
135
+                taFaceMapper.insertSelective(taFace);
136
+                return true;
137
+            }else if (0==type && null!=faceNum && 1==faceNum && isA==false){
138
+                taFace.setFaceImg(faceImg);
139
+                taFaceMapper.updateByPrimaryKeySelective(taFace);
140
+                return true;
141
+            }
142
+
143
+        } catch (Exception e) {
144
+            e.printStackTrace();
145
+        }
146
+        return false;
147
+    }
148
+}

+ 73
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TaVistorServiceImpl.java 查看文件

@@ -0,0 +1,73 @@
1
+package com.community.huiju.service.impl;
2
+
3
+import com.community.commom.constant.Constant;
4
+import com.community.huiju.dao.TaVisitorLicenseMapper;
5
+import com.community.huiju.dao.TaVisitorMapper;
6
+import com.community.huiju.model.TaVisitor;
7
+import com.community.huiju.model.TaVisitorLicense;
8
+import com.community.huiju.service.TaVistorServiceI;
9
+import org.springframework.beans.factory.annotation.Autowired;
10
+import org.springframework.stereotype.Service;
11
+
12
+import java.util.Date;
13
+import java.util.List;
14
+
15
+/**
16
+ * @author weichaochao
17
+ * @Title: TaVistorServiceImpl
18
+ * @Description: 访客实现类
19
+ * @date 2018/11/1
20
+ */
21
+@Service("TaVistorServiceImpl")
22
+public class TaVistorServiceImpl implements TaVistorServiceI {
23
+
24
+    @Autowired
25
+    private TaVisitorMapper taVisitorMapper;
26
+
27
+    @Autowired
28
+    private TaVisitorLicenseMapper taVisitorLicenseMapper;
29
+
30
+    @Override
31
+    public void insertTaVistor(TaVisitor taVisitor, Integer communityId, Integer userId) {
32
+
33
+        //todo 推送到海康然后返回给我们一个vistor_code,暂未提供
34
+
35
+        taVisitor.setTaUserId(userId);
36
+        taVisitor.setUpdateUser(userId);
37
+        taVisitor.setCreateUser(userId);
38
+        taVisitor.setCreateDate(new Date());
39
+        taVisitor.setUpdateDate(new Date());
40
+
41
+        if (Constant.EFFECTIVE.equals(taVisitor.getDrivingStatus())){
42
+            taVisitorMapper.insertSelective(taVisitor);
43
+
44
+            for (Integer taCarLicense : taVisitor.getCarLicense()){
45
+                TaVisitorLicense taVisitorLicense = new TaVisitorLicense();
46
+                taVisitorLicense.setCommunityId(communityId);
47
+                taVisitorLicense.setVisitorId(taVisitor.getId());
48
+                taVisitorLicense.setLicense(taCarLicense.toString());
49
+                taVisitorLicense.setCreateUser(userId);
50
+                taVisitorLicense.setCreateDate(new Date());
51
+                taVisitorLicense.setUpdateUser(userId);
52
+                taVisitorLicense.setUpdateDate(new Date());
53
+                taVisitorLicenseMapper.insertSelective(taVisitorLicense);
54
+            }
55
+        } else{
56
+            taVisitorMapper.insertSelective(taVisitor);
57
+        }
58
+
59
+
60
+    }
61
+
62
+    @Override
63
+    public List<TaVisitor> invateHis(Integer communityId, Integer userId) {
64
+        List<TaVisitor> taVisitors = taVisitorMapper.findAllVistors(communityId, userId);
65
+        for (TaVisitor taVisitor : taVisitors){
66
+            if (Constant.EFFECTIVE.equals(taVisitor.getDrivingStatus())){
67
+                List<Integer> taVisitorLicenses = taVisitorLicenseMapper.findTaVistorLicenseById(taVisitor.getId());
68
+                taVisitor.setCarLicense(taVisitorLicenses);
69
+            }
70
+        }
71
+        return taVisitors;
72
+    }
73
+}

+ 4
- 0
CODE/smart-community/app-api/src/main/resources/bootstrap.yml 查看文件

@@ -13,6 +13,10 @@ spring:
13 13
         serviceId: config-server
14 14
   session:
15 15
     store-type: jdbc
16
+  servlet:
17
+    multipart:
18
+      max-file-size: 10MB
19
+      max-request-size: 50MB
16 20
 eureka:
17 21
   client:
18 22
     service-url:

+ 120
- 0
CODE/smart-community/app-api/src/main/resources/mapper/TaFaceMapper.xml 查看文件

@@ -0,0 +1,120 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3
+<mapper namespace="com.community.huiju.dao.TaFaceMapper" >
4
+    <resultMap id="BaseResultMap" type="com.community.huiju.model.TaFace" >
5
+        <id column="id" property="id" jdbcType="INTEGER" />
6
+        <result column="community_id" property="communityId" jdbcType="INTEGER" />
7
+        <result column="ta_user_id" property="taUserId" jdbcType="INTEGER" />
8
+        <result column="face_img" property="faceImg" jdbcType="VARCHAR" />
9
+        <result column="create_user" property="createUser" jdbcType="INTEGER" />
10
+        <result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
11
+        <result column="update_user" property="updateUser" jdbcType="INTEGER" />
12
+        <result column="update_date" property="updateDate" jdbcType="TIMESTAMP" />
13
+    </resultMap>
14
+    <sql id="Base_Column_List" >
15
+        id, community_id,ta_user_id,face_img,create_user, create_date, update_user,
16
+        update_date
17
+    </sql>
18
+    <select id="selectByPrimaryKey" resultMap="BaseResultMap">
19
+        select
20
+        <include refid="Base_Column_List" />
21
+        from ta_face
22
+        where id = #{id,jdbcType=INTEGER}
23
+    </select>
24
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
25
+        delete from ta_face
26
+        where id = #{id,jdbcType=INTEGER}
27
+    </delete>
28
+    <insert id="insert" parameterType="com.community.huiju.model.TaFace" >
29
+        insert into ta_face (id, community_id, ta_user_id,face_img, create_user, create_date,
30
+        update_user, update_date)
31
+        values (#{id,jdbcType=INTEGER}, #{communityId,jdbcType=INTEGER},#{taUserId,jdbcType=INTEGER},#{faceImg,jdbcType=VARCHAR},#{createUser,jdbcType=INTEGER}, #{createDate,jdbcType=TIMESTAMP},
32
+        #{updateUser,jdbcType=INTEGER}, #{updateDate,jdbcType=TIMESTAMP})
33
+    </insert>
34
+    <insert id="insertSelective"  parameterType="com.community.huiju.model.TaFace" >
35
+        insert into ta_face
36
+        <trim prefix="(" suffix=")" suffixOverrides="," >
37
+            <if test="id != null" >
38
+                id,
39
+            </if>
40
+            <if test="communityId != null" >
41
+                community_id,
42
+            </if>
43
+            <if test="taUserId != null" >
44
+                ta_user_id,
45
+            </if>
46
+            <if test="faceImg != null" >
47
+                face_img,
48
+            </if>
49
+            <if test="createUser != null" >
50
+                create_user,
51
+            </if>
52
+            <if test="createDate != null" >
53
+                create_date,
54
+            </if>
55
+            <if test="updateUser != null" >
56
+                update_user,
57
+            </if>
58
+            <if test="updateDate != null" >
59
+                update_date,
60
+            </if>
61
+        </trim>
62
+        <trim prefix="values (" suffix=")" suffixOverrides="," >
63
+            <if test="id != null" >
64
+                #{id,jdbcType=INTEGER},
65
+            </if>
66
+            <if test="communityId != null" >
67
+                #{communityId,jdbcType=INTEGER},
68
+            </if>
69
+            <if test="taUserId != null" >
70
+                #{taUserId,jdbcType=INTEGER},
71
+            </if>
72
+            <if test="faceImg != null" >
73
+                #{faceImg,jdbcType=VARCHAR},
74
+            </if>
75
+            <if test="createUser != null" >
76
+                #{createUser,jdbcType=INTEGER},
77
+            </if>
78
+            <if test="createDate != null" >
79
+                #{createDate,jdbcType=TIMESTAMP},
80
+            </if>
81
+            <if test="updateUser != null" >
82
+                #{updateUser,jdbcType=INTEGER},
83
+            </if>
84
+            <if test="updateDate != null" >
85
+                #{updateDate,jdbcType=TIMESTAMP},
86
+            </if>
87
+        </trim>
88
+    </insert>
89
+    <update id="updateByPrimaryKeySelective" parameterType="com.community.huiju.model.TaFace">
90
+        update ta_face
91
+        <set >
92
+            <if test="communityId != null" >
93
+                community_id = #{communityId,jdbcType=INTEGER},
94
+            </if>
95
+            <if test="faceImg != null" >
96
+                face_img = #{faceImg,jdbcType=VARCHAR},
97
+            </if>
98
+            <if test="createUser != null" >
99
+                create_user = #{createUser,jdbcType=INTEGER},
100
+            </if>
101
+            <if test="createDate != null" >
102
+                create_date = #{createDate,jdbcType=TIMESTAMP},
103
+            </if>
104
+            <if test="updateUser != null" >
105
+                update_user = #{updateUser,jdbcType=INTEGER},
106
+            </if>
107
+            <if test="updateDate != null" >
108
+                update_date = #{updateDate,jdbcType=TIMESTAMP},
109
+            </if>
110
+        </set>
111
+        where ta_user_id = #{taUserId,jdbcType=INTEGER}
112
+    </update>
113
+
114
+    <select id="getByUserId" resultMap="BaseResultMap" parameterType="java.lang.Integer">
115
+        select
116
+        <include refid="Base_Column_List" />
117
+        from ta_face
118
+        where ta_user_id = #{userid,jdbcType=INTEGER}
119
+    </select>
120
+</mapper>

+ 135
- 0
CODE/smart-community/app-api/src/main/resources/mapper/TaVisitorLicenseMapper.xml 查看文件

@@ -0,0 +1,135 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3
+<mapper namespace="com.community.huiju.dao.TaVisitorLicenseMapper" >
4
+  <resultMap id="BaseResultMap" type="com.community.huiju.model.TaVisitorLicense" >
5
+    <id column="id" property="id" jdbcType="INTEGER" />
6
+    <result column="community_id" property="communityId" jdbcType="INTEGER" />
7
+    <result column="visitor_id" property="visitorId" jdbcType="INTEGER" />
8
+    <result column="license" property="license" jdbcType="VARCHAR" />
9
+    <result column="create_user" property="createUser" jdbcType="INTEGER" />
10
+    <result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
11
+    <result column="update_user" property="updateUser" jdbcType="INTEGER" />
12
+    <result column="update_date" property="updateDate" jdbcType="TIMESTAMP" />
13
+  </resultMap>
14
+  <sql id="Base_Column_List" >
15
+    id, community_id, visitor_id, license, create_user, create_date, update_user, update_date
16
+  </sql>
17
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
18
+    select 
19
+    <include refid="Base_Column_List" />
20
+    from ta_visitor_license
21
+    where id = #{id,jdbcType=INTEGER}
22
+  </select>
23
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
24
+    delete from ta_visitor_license
25
+    where id = #{id,jdbcType=INTEGER}
26
+  </delete>
27
+  <insert id="insert" parameterType="com.community.huiju.model.TaVisitorLicense" >
28
+    insert into ta_visitor_license (id, community_id, visitor_id, 
29
+      license, create_user, create_date, 
30
+      update_user, update_date)
31
+    values (#{id,jdbcType=INTEGER}, #{communityId,jdbcType=INTEGER}, #{visitorId,jdbcType=INTEGER}, 
32
+      #{license,jdbcType=VARCHAR}, #{createUser,jdbcType=INTEGER}, #{createDate,jdbcType=TIMESTAMP}, 
33
+      #{updateUser,jdbcType=INTEGER}, #{updateDate,jdbcType=TIMESTAMP})
34
+  </insert>
35
+  <insert id="insertSelective" parameterType="com.community.huiju.model.TaVisitorLicense" >
36
+    insert into ta_visitor_license
37
+    <trim prefix="(" suffix=")" suffixOverrides="," >
38
+      <if test="id != null" >
39
+        id,
40
+      </if>
41
+      <if test="communityId != null" >
42
+        community_id,
43
+      </if>
44
+      <if test="visitorId != null" >
45
+        visitor_id,
46
+      </if>
47
+      <if test="license != null" >
48
+        license,
49
+      </if>
50
+      <if test="createUser != null" >
51
+        create_user,
52
+      </if>
53
+      <if test="createDate != null" >
54
+        create_date,
55
+      </if>
56
+      <if test="updateUser != null" >
57
+        update_user,
58
+      </if>
59
+      <if test="updateDate != null" >
60
+        update_date,
61
+      </if>
62
+    </trim>
63
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
64
+      <if test="id != null" >
65
+        #{id,jdbcType=INTEGER},
66
+      </if>
67
+      <if test="communityId != null" >
68
+        #{communityId,jdbcType=INTEGER},
69
+      </if>
70
+      <if test="visitorId != null" >
71
+        #{visitorId,jdbcType=INTEGER},
72
+      </if>
73
+      <if test="license != null" >
74
+        #{license,jdbcType=VARCHAR},
75
+      </if>
76
+      <if test="createUser != null" >
77
+        #{createUser,jdbcType=INTEGER},
78
+      </if>
79
+      <if test="createDate != null" >
80
+        #{createDate,jdbcType=TIMESTAMP},
81
+      </if>
82
+      <if test="updateUser != null" >
83
+        #{updateUser,jdbcType=INTEGER},
84
+      </if>
85
+      <if test="updateDate != null" >
86
+        #{updateDate,jdbcType=TIMESTAMP},
87
+      </if>
88
+    </trim>
89
+  </insert>
90
+  <update id="updateByPrimaryKeySelective" parameterType="com.community.huiju.model.TaVisitorLicense" >
91
+    update ta_visitor_license
92
+    <set >
93
+      <if test="communityId != null" >
94
+        community_id = #{communityId,jdbcType=INTEGER},
95
+      </if>
96
+      <if test="visitorId != null" >
97
+        visitor_id = #{visitorId,jdbcType=INTEGER},
98
+      </if>
99
+      <if test="license != null" >
100
+        license = #{license,jdbcType=VARCHAR},
101
+      </if>
102
+      <if test="createUser != null" >
103
+        create_user = #{createUser,jdbcType=INTEGER},
104
+      </if>
105
+      <if test="createDate != null" >
106
+        create_date = #{createDate,jdbcType=TIMESTAMP},
107
+      </if>
108
+      <if test="updateUser != null" >
109
+        update_user = #{updateUser,jdbcType=INTEGER},
110
+      </if>
111
+      <if test="updateDate != null" >
112
+        update_date = #{updateDate,jdbcType=TIMESTAMP},
113
+      </if>
114
+    </set>
115
+    where id = #{id,jdbcType=INTEGER}
116
+  </update>
117
+  <update id="updateByPrimaryKey" parameterType="com.community.huiju.model.TaVisitorLicense" >
118
+    update ta_visitor_license
119
+    set community_id = #{communityId,jdbcType=INTEGER},
120
+      visitor_id = #{visitorId,jdbcType=INTEGER},
121
+      license = #{license,jdbcType=VARCHAR},
122
+      create_user = #{createUser,jdbcType=INTEGER},
123
+      create_date = #{createDate,jdbcType=TIMESTAMP},
124
+      update_user = #{updateUser,jdbcType=INTEGER},
125
+      update_date = #{updateDate,jdbcType=TIMESTAMP}
126
+    where id = #{id,jdbcType=INTEGER}
127
+  </update>
128
+
129
+  <select id="findTaVistorLicenseById" resultType="java.lang.Integer" parameterType="java.lang.Integer" >
130
+    select
131
+      license
132
+    from ta_visitor_license
133
+    where visitor_id = #{id,jdbcType=INTEGER}
134
+  </select>
135
+</mapper>

+ 319
- 0
CODE/smart-community/app-api/src/main/resources/mapper/TaVisitorMapper.xml 查看文件

@@ -0,0 +1,319 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3
+<mapper namespace="com.community.huiju.dao.TaVisitorMapper" >
4
+  <resultMap id="BaseResultMap" type="com.community.huiju.model.TaVisitor" >
5
+    <id column="id" property="id" jdbcType="INTEGER" />
6
+    <result column="community_id" property="communityId" jdbcType="INTEGER" />
7
+    <result column="visitor_name" property="visitorName" jdbcType="VARCHAR" />
8
+    <result column="visitor_tel" property="visitorTel" jdbcType="VARCHAR" />
9
+    <result column="visitor_num" property="visitorNum" jdbcType="VARCHAR" />
10
+    <result column="visitor_statrt_time" property="visitorStatrtTime" jdbcType="TIMESTAMP" />
11
+    <result column="visitor_end_time" property="visitorEndTime" jdbcType="INTEGER" />
12
+    <result column="driving_status" property="drivingStatus" jdbcType="CHAR" />
13
+    <result column="pay_entity" property="payEntity" jdbcType="VARCHAR" />
14
+    <result column="visitor_code" property="visitorCode" jdbcType="VARCHAR" />
15
+    <result column="ta_user_id" property="taUserId" jdbcType="INTEGER" />
16
+    <result column="create_user" property="createUser" jdbcType="INTEGER" />
17
+    <result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
18
+    <result column="update_user" property="updateUser" jdbcType="INTEGER" />
19
+    <result column="update_darte" property="updateDate" jdbcType="TIMESTAMP" />
20
+  </resultMap>
21
+  <sql id="Base_Column_List" >
22
+    id, community_id, visitor_name, visitor_tel, visitor_num, visitor_statrt_time, visitor_end_time, 
23
+    driving_status, pay_entity, visitor_code, ta_user_id, create_user, create_date, update_user, 
24
+    update_darte
25
+  </sql>
26
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
27
+    select 
28
+    <include refid="Base_Column_List" />
29
+    from ta_visitor
30
+    where id = #{id,jdbcType=INTEGER}
31
+  </select>
32
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
33
+    delete from ta_visitor
34
+    where id = #{id,jdbcType=INTEGER}
35
+  </delete>
36
+  <insert id="insert" parameterType="com.community.huiju.model.TaVisitor" >
37
+    insert into ta_visitor (id, community_id, visitor_name, 
38
+      visitor_tel, visitor_num, visitor_statrt_time, 
39
+      visitor_end_time, driving_status, pay_entity, 
40
+      visitor_code, ta_user_id, create_user, 
41
+      create_date, update_user, update_darte
42
+      )
43
+    values (#{id,jdbcType=INTEGER}, #{communityId,jdbcType=INTEGER}, #{visitorName,jdbcType=VARCHAR}, 
44
+      #{visitorTel,jdbcType=VARCHAR}, #{visitorNum,jdbcType=VARCHAR}, #{visitorStatrtTime,jdbcType=TIMESTAMP}, 
45
+      #{visitorEndTime,jdbcType=INTEGER}, #{drivingStatus,jdbcType=CHAR}, #{payEntity,jdbcType=VARCHAR}, 
46
+      #{visitorCode,jdbcType=VARCHAR}, #{taUserId,jdbcType=INTEGER}, #{createUser,jdbcType=INTEGER}, 
47
+      #{createDate,jdbcType=TIMESTAMP}, #{updateUser,jdbcType=INTEGER}, #{updateDate,jdbcType=TIMESTAMP}
48
+      )
49
+  </insert>
50
+  <insert id="insertSelective" parameterType="com.community.huiju.model.TaVisitor" useGeneratedKeys="true" keyProperty="id" keyColumn="id">
51
+    insert into ta_visitor
52
+    <trim prefix="(" suffix=")" suffixOverrides="," >
53
+      <if test="id != null" >
54
+        id,
55
+      </if>
56
+      <if test="communityId != null" >
57
+        community_id,
58
+      </if>
59
+      <if test="visitorName != null" >
60
+        visitor_name,
61
+      </if>
62
+      <if test="visitorTel != null" >
63
+        visitor_tel,
64
+      </if>
65
+      <if test="visitorNum != null" >
66
+        visitor_num,
67
+      </if>
68
+      <if test="visitorStatrtTime != null" >
69
+        visitor_statrt_time,
70
+      </if>
71
+      <if test="visitorEndTime != null" >
72
+        visitor_end_time,
73
+      </if>
74
+      <if test="drivingStatus != null" >
75
+        driving_status,
76
+      </if>
77
+      <if test="payEntity != null" >
78
+        pay_entity,
79
+      </if>
80
+      <if test="visitorCode != null" >
81
+        visitor_code,
82
+      </if>
83
+      <if test="taUserId != null" >
84
+        ta_user_id,
85
+      </if>
86
+      <if test="createUser != null" >
87
+        create_user,
88
+      </if>
89
+      <if test="createDate != null" >
90
+        create_date,
91
+      </if>
92
+      <if test="updateUser != null" >
93
+        update_user,
94
+      </if>
95
+      <if test="updateDate != null" >
96
+        update_darte,
97
+      </if>
98
+    </trim>
99
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
100
+      <if test="id != null" >
101
+        #{id,jdbcType=INTEGER},
102
+      </if>
103
+      <if test="communityId != null" >
104
+        #{communityId,jdbcType=INTEGER},
105
+      </if>
106
+      <if test="visitorName != null" >
107
+        #{visitorName,jdbcType=VARCHAR},
108
+      </if>
109
+      <if test="visitorTel != null" >
110
+        #{visitorTel,jdbcType=VARCHAR},
111
+      </if>
112
+      <if test="visitorNum != null" >
113
+        #{visitorNum,jdbcType=VARCHAR},
114
+      </if>
115
+      <if test="visitorStatrtTime != null" >
116
+        #{visitorStatrtTime,jdbcType=TIMESTAMP},
117
+      </if>
118
+      <if test="visitorEndTime != null" >
119
+        #{visitorEndTime,jdbcType=INTEGER},
120
+      </if>
121
+      <if test="drivingStatus != null" >
122
+        #{drivingStatus,jdbcType=CHAR},
123
+      </if>
124
+      <if test="payEntity != null" >
125
+        #{payEntity,jdbcType=VARCHAR},
126
+      </if>
127
+      <if test="visitorCode != null" >
128
+        #{visitorCode,jdbcType=VARCHAR},
129
+      </if>
130
+      <if test="taUserId != null" >
131
+        #{taUserId,jdbcType=INTEGER},
132
+      </if>
133
+      <if test="createUser != null" >
134
+        #{createUser,jdbcType=INTEGER},
135
+      </if>
136
+      <if test="createDate != null" >
137
+        #{createDate,jdbcType=TIMESTAMP},
138
+      </if>
139
+      <if test="updateUser != null" >
140
+        #{updateUser,jdbcType=INTEGER},
141
+      </if>
142
+      <if test="updateDate != null" >
143
+        #{updateDate,jdbcType=TIMESTAMP},
144
+      </if>
145
+    </trim>
146
+  </insert>
147
+  <update id="updateByPrimaryKeySelective" parameterType="com.community.huiju.model.TaVisitor" >
148
+    update ta_visitor
149
+    <set >
150
+      <if test="communityId != null" >
151
+        community_id = #{communityId,jdbcType=INTEGER},
152
+      </if>
153
+      <if test="visitorName != null" >
154
+        visitor_name = #{visitorName,jdbcType=VARCHAR},
155
+      </if>
156
+      <if test="visitorTel != null" >
157
+        visitor_tel = #{visitorTel,jdbcType=VARCHAR},
158
+      </if>
159
+      <if test="visitorNum != null" >
160
+        visitor_num = #{visitorNum,jdbcType=VARCHAR},
161
+      </if>
162
+      <if test="visitorStatrtTime != null" >
163
+        visitor_statrt_time = #{visitorStatrtTime,jdbcType=TIMESTAMP},
164
+      </if>
165
+      <if test="visitorEndTime != null" >
166
+        visitor_end_time = #{visitorEndTime,jdbcType=INTEGER},
167
+      </if>
168
+      <if test="drivingStatus != null" >
169
+        driving_status = #{drivingStatus,jdbcType=CHAR},
170
+      </if>
171
+      <if test="payEntity != null" >
172
+        pay_entity = #{payEntity,jdbcType=VARCHAR},
173
+      </if>
174
+      <if test="visitorCode != null" >
175
+        visitor_code = #{visitorCode,jdbcType=VARCHAR},
176
+      </if>
177
+      <if test="taUserId != null" >
178
+        ta_user_id = #{taUserId,jdbcType=INTEGER},
179
+      </if>
180
+      <if test="createUser != null" >
181
+        create_user = #{createUser,jdbcType=INTEGER},
182
+      </if>
183
+      <if test="createDate != null" >
184
+        create_date = #{createDate,jdbcType=TIMESTAMP},
185
+      </if>
186
+      <if test="updateUser != null" >
187
+        update_user = #{updateUser,jdbcType=INTEGER},
188
+      </if>
189
+      <if test="updateDate != null" >
190
+        update_darte = #{updateDate,jdbcType=TIMESTAMP},
191
+      </if>
192
+    </set>
193
+    where id = #{id,jdbcType=INTEGER}
194
+  </update>
195
+  <update id="updateByPrimaryKey" parameterType="com.community.huiju.model.TaVisitor" >
196
+    update ta_visitor
197
+    set community_id = #{communityId,jdbcType=INTEGER},
198
+      visitor_name = #{visitorName,jdbcType=VARCHAR},
199
+      visitor_tel = #{visitorTel,jdbcType=VARCHAR},
200
+      visitor_num = #{visitorNum,jdbcType=VARCHAR},
201
+      visitor_statrt_time = #{visitorStatrtTime,jdbcType=TIMESTAMP},
202
+      visitor_end_time = #{visitorEndTime,jdbcType=INTEGER},
203
+      driving_status = #{drivingStatus,jdbcType=CHAR},
204
+      pay_entity = #{payEntity,jdbcType=VARCHAR},
205
+      visitor_code = #{visitorCode,jdbcType=VARCHAR},
206
+      ta_user_id = #{taUserId,jdbcType=INTEGER},
207
+      create_user = #{createUser,jdbcType=INTEGER},
208
+      create_date = #{createDate,jdbcType=TIMESTAMP},
209
+      update_user = #{updateUser,jdbcType=INTEGER},
210
+      update_darte = #{updateDate,jdbcType=TIMESTAMP}
211
+    where id = #{id,jdbcType=INTEGER}
212
+  </update>
213
+
214
+  <insert id="insertVistorAndLicense" parameterType="com.community.huiju.model.TaVisitor" >
215
+    insert into ta_visitor
216
+    <trim prefix="(" suffix=")" suffixOverrides="," >
217
+      <if test="id != null" >
218
+        id,
219
+      </if>
220
+      <if test="communityId != null" >
221
+        community_id,
222
+      </if>
223
+      <if test="visitorName != null" >
224
+        visitor_name,
225
+      </if>
226
+      <if test="visitorTel != null" >
227
+        visitor_tel,
228
+      </if>
229
+      <if test="visitorNum != null" >
230
+        visitor_num,
231
+      </if>
232
+      <if test="visitorStatrtTime != null" >
233
+        visitor_statrt_time,
234
+      </if>
235
+      <if test="visitorEndTime != null" >
236
+        visitor_end_time,
237
+      </if>
238
+      <if test="drivingStatus != null" >
239
+        driving_status,
240
+      </if>
241
+      <if test="payEntity != null" >
242
+        pay_entity,
243
+      </if>
244
+      <if test="visitorCode != null" >
245
+        visitor_code,
246
+      </if>
247
+      <if test="taUserId != null" >
248
+        ta_user_id,
249
+      </if>
250
+      <if test="createUser != null" >
251
+        create_user,
252
+      </if>
253
+      <if test="createDate != null" >
254
+        create_date,
255
+      </if>
256
+      <if test="updateUser != null" >
257
+        update_user,
258
+      </if>
259
+      <if test="updateDate != null" >
260
+        update_darte,
261
+      </if>
262
+    </trim>
263
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
264
+      <if test="id != null" >
265
+        #{id,jdbcType=INTEGER},
266
+      </if>
267
+      <if test="communityId != null" >
268
+        #{communityId,jdbcType=INTEGER},
269
+      </if>
270
+      <if test="visitorName != null" >
271
+        #{visitorName,jdbcType=VARCHAR},
272
+      </if>
273
+      <if test="visitorTel != null" >
274
+        #{visitorTel,jdbcType=VARCHAR},
275
+      </if>
276
+      <if test="visitorNum != null" >
277
+        #{visitorNum,jdbcType=VARCHAR},
278
+      </if>
279
+      <if test="visitorStatrtTime != null" >
280
+        #{visitorStatrtTime,jdbcType=TIMESTAMP},
281
+      </if>
282
+      <if test="visitorEndTime != null" >
283
+        #{visitorEndTime,jdbcType=INTEGER},
284
+      </if>
285
+      <if test="drivingStatus != null" >
286
+        #{drivingStatus,jdbcType=CHAR},
287
+      </if>
288
+      <if test="payEntity != null" >
289
+        #{payEntity,jdbcType=VARCHAR},
290
+      </if>
291
+      <if test="visitorCode != null" >
292
+        #{visitorCode,jdbcType=VARCHAR},
293
+      </if>
294
+      <if test="taUserId != null" >
295
+        #{taUserId,jdbcType=INTEGER},
296
+      </if>
297
+      <if test="createUser != null" >
298
+        #{createUser,jdbcType=INTEGER},
299
+      </if>
300
+      <if test="createDate != null" >
301
+        #{createDate,jdbcType=TIMESTAMP},
302
+      </if>
303
+      <if test="updateUser != null" >
304
+        #{updateUser,jdbcType=INTEGER},
305
+      </if>
306
+      <if test="updateDate != null" >
307
+        #{updateDate,jdbcType=TIMESTAMP},
308
+      </if>
309
+    </trim>
310
+  </insert>
311
+
312
+  <select id="findAllVistors" resultMap="BaseResultMap">
313
+    select
314
+    <include refid="Base_Column_List" />
315
+    from ta_visitor
316
+    where community_id = #{communityId,jdbcType=INTEGER}
317
+    and ta_user_id = #{userId,jdbcType=INTEGER}
318
+  </select>
319
+</mapper>

+ 213
- 0
CODE/smart-community/community-common/src/main/java/com/community/commom/ailiyun/AESDecode.java 查看文件

@@ -0,0 +1,213 @@
1
+package com.community.commom.ailiyun;
2
+import com.community.commom.mode.ResponseBean;
3
+import sun.misc.BASE64Encoder;
4
+import java.net.HttpURLConnection;
5
+import java.security.MessageDigest;
6
+import java.io.BufferedReader;
7
+import java.io.IOException;
8
+import java.io.InputStreamReader;
9
+import java.io.PrintWriter;
10
+import java.net.URL;
11
+import java.net.URLConnection;
12
+import java.text.SimpleDateFormat;
13
+import java.util.Date;
14
+import java.util.Locale;
15
+import javax.crypto.spec.SecretKeySpec;
16
+
17
+import javax.crypto.Mac;
18
+
19
+@SuppressWarnings("restriction")
20
+public class AESDecode {
21
+    /*
22
+     * 计算MD5+BASE64
23
+     */
24
+    public static String MD5Base64(String s) {
25
+        if (s == null)
26
+            return null;
27
+        String encodeStr = "";
28
+        byte[] utfBytes = s.getBytes();
29
+        MessageDigest mdTemp;
30
+        try {
31
+            mdTemp = MessageDigest.getInstance("MD5");
32
+            mdTemp.update(utfBytes);
33
+            byte[] md5Bytes = mdTemp.digest();
34
+            BASE64Encoder b64Encoder = new BASE64Encoder();
35
+            encodeStr = b64Encoder.encode(md5Bytes);
36
+        } catch (Exception e) {
37
+            throw new Error("Failed to generate MD5 : " + e.getMessage());
38
+        }
39
+        return encodeStr;
40
+    }
41
+
42
+    /*
43
+     * 计算 HMAC-SHA1
44
+     */
45
+    public static String HMACSha1(String data, String key) {
46
+        String result;
47
+        try {
48
+            SecretKeySpec signingKey = new SecretKeySpec(key.getBytes(), "HmacSHA1");
49
+            Mac mac = Mac.getInstance("HmacSHA1");
50
+            mac.init(signingKey);
51
+            byte[] rawHmac = mac.doFinal(data.getBytes());
52
+            result = (new BASE64Encoder()).encode(rawHmac);
53
+        } catch (Exception e) {
54
+            throw new Error("Failed to generate HMAC : " + e.getMessage());
55
+        }
56
+        return result;
57
+    }
58
+
59
+    /*
60
+     * 等同于javaScript中的 new Date().toUTCString();
61
+     */
62
+    public static String toGMTString(Date date) {
63
+        SimpleDateFormat df = new SimpleDateFormat("E, dd MMM yyyy HH:mm:ss z", Locale.UK);
64
+        df.setTimeZone(new java.util.SimpleTimeZone(0, "GMT"));
65
+        return df.format(date);
66
+    }
67
+
68
+    /*
69
+     * 发送POST请求
70
+     */
71
+    public static String sendPost(String url, String body, String ak_id, String ak_secret) throws Exception {
72
+        PrintWriter out = null;
73
+        BufferedReader in = null;
74
+        String result = "";
75
+        int statusCode = 200;
76
+        try {
77
+            URL realUrl = new URL(url);
78
+            /*
79
+             * http header 参数
80
+             */
81
+            String method = "POST";
82
+            String accept = "application/json";
83
+            String content_type = "application/json";
84
+            String path = realUrl.getFile();
85
+            String date = toGMTString(new Date());
86
+            // 1.对body做MD5+BASE64加密
87
+            String bodyMd5 = MD5Base64(body);
88
+            String stringToSign = method + "\n" + accept + "\n" + bodyMd5 + "\n" + content_type + "\n" + date + "\n"
89
+                    + path;
90
+            // 2.计算 HMAC-SHA1
91
+            String signature = HMACSha1(stringToSign, ak_secret);
92
+            // 3.得到 authorization header
93
+            String authHeader = "Dataplus " + ak_id + ":" + signature;
94
+            // 打开和URL之间的连接
95
+            URLConnection conn = realUrl.openConnection();
96
+            // 设置通用的请求属性
97
+            conn.setRequestProperty("accept", accept);
98
+            conn.setRequestProperty("content-type", content_type);
99
+            conn.setRequestProperty("date", date);
100
+            conn.setRequestProperty("Authorization", authHeader);
101
+            // 发送POST请求必须设置如下两行
102
+            conn.setDoOutput(true);
103
+            conn.setDoInput(true);
104
+            // 获取URLConnection对象对应的输出流
105
+            out = new PrintWriter(conn.getOutputStream());
106
+            // 发送请求参数
107
+            out.print(body);
108
+            // flush输出流的缓冲
109
+            out.flush();
110
+            // 定义BufferedReader输入流来读取URL的响应
111
+            statusCode = ((HttpURLConnection) conn).getResponseCode();
112
+            if (statusCode != 200) {
113
+                in = new BufferedReader(new InputStreamReader(((HttpURLConnection) conn).getErrorStream()));
114
+            } else {
115
+                in = new BufferedReader(new InputStreamReader(conn.getInputStream()));
116
+            }
117
+            String line;
118
+            while ((line = in.readLine()) != null) {
119
+                result += line;
120
+            }
121
+        } catch (Exception e) {
122
+            e.printStackTrace();
123
+        } finally {
124
+            try {
125
+                if (out != null) {
126
+                    out.close();
127
+                }
128
+                if (in != null) {
129
+                    in.close();
130
+                }
131
+            } catch (IOException ex) {
132
+                ex.printStackTrace();
133
+            }
134
+        }
135
+        if (statusCode != 200) {
136
+            throw new IOException("\nHttp StatusCode: " + statusCode + "\nErrorMessage: " + result);
137
+        }
138
+        return result;
139
+    }
140
+
141
+    /*
142
+     * GET请求
143
+     */
144
+    public static String sendGet(String url, String ak_id, String ak_secret) throws Exception {
145
+        String result = "";
146
+        BufferedReader in = null;
147
+        int statusCode = 200;
148
+        try {
149
+            URL realUrl = new URL(url);
150
+            /*
151
+             * http header 参数
152
+             */
153
+            String method = "GET";
154
+            String accept = "application/json";
155
+            String content_type = "application/json";
156
+            String path = realUrl.getFile();
157
+            String date = toGMTString(new Date());
158
+            // 1.对body做MD5+BASE64加密
159
+            // String bodyMd5 = MD5Base64(body);
160
+            String stringToSign = method + "\n" + accept + "\n" + "" + "\n" + content_type + "\n" + date + "\n" + path;
161
+            // 2.计算 HMAC-SHA1
162
+            String signature = HMACSha1(stringToSign, ak_secret);
163
+            // 3.得到 authorization header
164
+            String authHeader = "Dataplus " + ak_id + ":" + signature;
165
+            // 打开和URL之间的连接
166
+            URLConnection connection = realUrl.openConnection();
167
+            // 设置通用的请求属性
168
+            connection.setRequestProperty("accept", accept);
169
+            connection.setRequestProperty("content-type", content_type);
170
+            connection.setRequestProperty("date", date);
171
+            connection.setRequestProperty("Authorization", authHeader);
172
+            connection.setRequestProperty("Connection", "keep-alive");
173
+            // 建立实际的连接
174
+            connection.connect();
175
+            // 定义 BufferedReader输入流来读取URL的响应
176
+            statusCode = ((HttpURLConnection) connection).getResponseCode();
177
+            if (statusCode != 200) {
178
+                in = new BufferedReader(new InputStreamReader(((HttpURLConnection) connection).getErrorStream()));
179
+            } else {
180
+                in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
181
+            }
182
+            String line;
183
+            while ((line = in.readLine()) != null) {
184
+                result += line;
185
+            }
186
+        } catch (Exception e) {
187
+            e.printStackTrace();
188
+        } finally {
189
+            try {
190
+                if (in != null) {
191
+                    in.close();
192
+                }
193
+            } catch (Exception e) {
194
+                e.printStackTrace();
195
+            }
196
+        }
197
+        if (statusCode != 200) {
198
+            throw new IOException("\nHttp StatusCode: " + statusCode + "\nErrorMessage: " + result);
199
+        }
200
+        return result;
201
+    }
202
+
203
+    //直接请求
204
+    public ResponseBean send(String body) throws Exception {
205
+        ResponseBean responseBean = new ResponseBean();
206
+        String AccessKeyId = "LTAIkc75dpkJw8Lb"; //用户ak
207
+        String AccessKeySecret = "v4bvXCaix6vSDTCFfwSAdqV53iFEQw";
208
+        String url = "https://dtplus-cn-shanghai.data.aliyuncs.com/face/detect";
209
+        String sd = sendPost(url, body, AccessKeyId, AccessKeySecret);
210
+        responseBean.addSuccess(sd);
211
+        return responseBean;
212
+    }
213
+}

+ 6
- 3
CODE/smart-community/community-common/src/main/java/com/community/commom/constant/Constant.java 查看文件

@@ -16,7 +16,10 @@ public class Constant {
16 16
     public static final String WEB_USER_SESSION = "webUser";
17 17
 
18 18
     /** 不需要权限的URL身份 **/
19
-    public static final String ROLE_NONE = "ROLE_NONEUSER";
19
+    public static final String ROLE_NONEUSER = "ROLE_NONEUSER";
20
+
21
+    /** 校验出现问题后的默认身份 **/
22
+    public static final String ROLE_NONE = "ROLE_NONE";
20 23
 
21 24
     /** app登陆类型 **/
22 25
     public static final String APP_LOGIN_TYPE = "app";
@@ -60,10 +63,10 @@ public class Constant {
60 63
     /** banner类型公告**/
61 64
     public static final String BANNER = "banner";
62 65
 
63
-    /**有效状态**/
66
+    /**有效状态,开车**/
64 67
     public static final String EFFECTIVE = "1";
65 68
 
66
-    /**无效状态**/
69
+    /**无效状态,不开车**/
67 70
     public static final String INVALID = "0";
68 71
 
69 72
     /**业主角色**/

二进制
CODE/smart-community/community-common/target/classes/com/community/commom/ailiyun/AESDecode.class 查看文件


二进制
CODE/smart-community/community-common/target/classes/com/community/commom/constant/Constant.class 查看文件


+ 23
- 7
CODE/smart-community/operate-api/src/main/java/com/community/huiju/controller/BannerController.java 查看文件

@@ -17,6 +17,9 @@ import org.springframework.web.bind.annotation.*;
17 17
 import javax.servlet.http.HttpSession;
18 18
 import javax.validation.Valid;
19 19
 
20
+/**
21
+ * @author weiximei
22
+ */
20 23
 @RestController
21 24
 @RefreshScope
22 25
 @RequestMapping("/")
@@ -28,10 +31,10 @@ public class BannerController {
28 31
 
29 32
     @ApiOperation(value = "添加Banner",notes = "添加Banner")
30 33
     @ApiImplicitParams({
31
-            @ApiImplicitParam(paramType = "body",dataType = "ToBanner",name = "banner",value = "bannerTitle(标题)," +
34
+            @ApiImplicitParam(paramType = "body",dataType = "ToBanner",name = "banner",value = "title(标题)," +
32 35
                     "sort(权重),bannerCover(图片),bannerPosition(Banner位),communityId(小区)," +
33 36
                     "effTime(生效时间),expTime(失效时间),bannerType(Banner类型),externalLink(Banner的URL)," +
34
-                    "bannerContent(Banner内容)"),
37
+                    ",bannerTitle(内容标题),bannerContent(Banner内容)"),
35 38
             @ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token"),
36 39
     })
37 40
     @RequestMapping(value = "/banner",method = RequestMethod.POST)
@@ -76,16 +79,29 @@ public class BannerController {
76 79
 
77 80
     @ApiOperation(value = "根据条件查询Banner",notes = "根据条件查询Banner")
78 81
     @ApiImplicitParams({
79
-            @ApiImplicitParam(paramType = "body",dataType = "String",name = "parameter",value = "bannerTitle(标题)," +
80
-                    ",bannerPosition(Banner位),bannerDescription(跳转概述)"),
82
+            @ApiImplicitParam(paramType = "query",dataType = "String",name = "bannerTitle",value = "bannerTitle(标题)"),
83
+            @ApiImplicitParam(paramType = "query",dataType = "Integer",name = "bannerPosition",value = "bannerPosition(Banner位)"),
84
+            @ApiImplicitParam(paramType = "query",dataType = "String",name = "bannerDescription",value = "bannerDescription(跳转概述)"),
85
+            @ApiImplicitParam(paramType = "query",dataType = "String",name = "communityId",value = "communityId(小区)"),
86
+            @ApiImplicitParam(paramType = "query", dataType = "Integer", name = "pageNum", value = "分页第几页"),
87
+            @ApiImplicitParam(paramType = "query", dataType = "Integer", name = "pageSize", value = "分页每页长度")
81 88
     })
82 89
     @RequestMapping(value = "/banner/list",method = RequestMethod.GET)
83
-    public ResponseBean getBanner(@RequestBody String parameter){
90
+    public ResponseBean getBanner(@RequestParam(value = "bannerTitle", required = false) String bannerTitle,
91
+                                  @RequestParam(value = "bannerPosition", required = false) Integer bannerPosition,
92
+                                  @RequestParam(value = "bannerDescription", required = false) String bannerDescription,
93
+                                  @RequestParam(value = "communityId", required = false) Integer communityId,
94
+                                  @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
95
+                                  @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize){
84 96
 
85
-        ToBanner banner = JSONObject.parseObject(parameter,ToBanner.class);
86 97
 
87 98
         ResponseBean response = new ResponseBean();
88
-        response = iToBannerService.getBanner(banner);
99
+        ToBanner banner = new ToBanner();
100
+        banner.setBannerTitle(bannerTitle);
101
+        banner.setBannerPosition(bannerPosition);
102
+        banner.setBannerDescription(bannerDescription);
103
+        banner.setCommunityId(communityId);
104
+        response = iToBannerService.getBanner(banner,pageNum,pageSize);
89 105
         return response;
90 106
     }
91 107
 

+ 20
- 6
CODE/smart-community/operate-api/src/main/java/com/community/huiju/controller/CommunityController.java 查看文件

@@ -17,6 +17,7 @@ import org.springframework.web.bind.annotation.RequestParam;
17 17
 import org.springframework.web.bind.annotation.RestController;
18 18
 
19 19
 import java.util.List;
20
+import java.util.Map;
20 21
 
21 22
 /**
22 23
  * @author FXF
@@ -33,18 +34,31 @@ public class CommunityController {
33 34
 	
34 35
 	@ApiOperation(value = "根据搜索条件获取小区列表", notes = "根据搜索条件获取小区列表")
35 36
 	@ApiImplicitParams({
36
-			@ApiImplicitParam(paramType = "body", name = "toCommunities", dataType = "String",value =
37
-					"id:社区编号,communityName:社区名称(模糊查询), provinceId:省份id,cityId:城市id,districtId:区县id"),
37
+			@ApiImplicitParam(paramType = "query", dataType = "Integer", name = "communityId", value = "社区编号"),
38
+			@ApiImplicitParam(paramType = "query", dataType = "String", name = "communityName", value = "社区名称(模糊查询)"),
39
+			@ApiImplicitParam(paramType = "query", dataType = "integer", name = "provinceId", value = "省份id"),
40
+			@ApiImplicitParam(paramType = "query", dataType = "integer", name = "cityId", value = "城市id"),
41
+			@ApiImplicitParam(paramType = "query", dataType = "integer", name = "districtId", value = "区县id"),
38 42
 			@ApiImplicitParam(paramType = "query", dataType = "integer", name = "pageNum", value = "分页第几页"),
39 43
 			@ApiImplicitParam(paramType = "query", dataType = "integer", name = "pageSize", value = "分页每页长度")
40 44
 	})
41
-	@RequestMapping(value = "/communitys",method = RequestMethod.POST)
42
-	public ResponseBean getCommunitys(@RequestBody ToCommunities toCommunities,
45
+	@RequestMapping(value = "/communitys",method = RequestMethod.GET)
46
+	public ResponseBean getCommunitys(@RequestParam(value = "communityId", required = false) Integer communityId,
47
+	                                  @RequestParam(value = "communityName", required = false) String communityName,
48
+	                                  @RequestParam(value = "provinceId", required = false) Integer provinceId,
49
+	                                  @RequestParam(value = "cityId", required = false) Integer cityId,
50
+	                                  @RequestParam(value = "districtId", required = false) Integer districtId,
43 51
 	                                  @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
44 52
 	                                  @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize){
45 53
 		ResponseBean responseBean = new ResponseBean();
46
-		List<ToCommunities> communitiesList = communityService.getCommunitys(toCommunities,pageNum,pageSize);
47
-		responseBean.addSuccess(communitiesList);
54
+		ToCommunities toCommunities = new ToCommunities();
55
+		toCommunities.setId(communityId);
56
+		toCommunities.setCommunityName(communityName);
57
+		toCommunities.setProvinceId(provinceId);
58
+		toCommunities.setCityId(cityId);
59
+		toCommunities.setDistrictId(districtId);
60
+		Map<String,Object> map = communityService.getCommunitys(toCommunities,pageNum,pageSize);
61
+		responseBean.addSuccess(map);
48 62
 		return responseBean;
49 63
 	}
50 64
 	

+ 21
- 0
CODE/smart-community/operate-api/src/main/java/com/community/huiju/controller/UserController.java 查看文件

@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
4 4
 import com.community.commom.constant.Constant;
5 5
 import com.community.commom.mode.ResponseBean;
6 6
 import com.community.commom.session.UserElement;
7
+import com.community.huiju.model.ToUser;
7 8
 import com.community.huiju.service.IToUserService;
8 9
 import com.community.huiju.vo.ToUserVO;
9 10
 import io.swagger.annotations.Api;
@@ -56,4 +57,24 @@ public class UserController {
56 57
     }
57 58
 
58 59
 
60
+    @ApiOperation(value = "获取用户信息",nickname = "获取用户信息")
61
+    @ApiImplicitParams({
62
+            @ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token"),
63
+    })
64
+    @RequestMapping(value = "/user/info",method = RequestMethod.GET)
65
+    public ResponseBean getInfo(HttpSession session) {
66
+        ResponseBean response = new ResponseBean();
67
+
68
+        UserElement userElement = (UserElement) session.getAttribute(Constant.WEB_USER_SESSION);
69
+        if (null == userElement) {
70
+            response.addError("请登录!");
71
+            return response;
72
+        }
73
+
74
+        response = iToUserService.getInfo(userElement.getId());
75
+
76
+        return response;
77
+    }
78
+
79
+
59 80
 }

+ 9
- 0
CODE/smart-community/operate-api/src/main/java/com/community/huiju/dao/ToSysRoleMapper.java 查看文件

@@ -3,6 +3,8 @@ package com.community.huiju.dao;
3 3
 import com.community.huiju.model.ToSysRole;
4 4
 import org.apache.ibatis.annotations.Mapper;
5 5
 
6
+import java.util.List;
7
+
6 8
 @Mapper
7 9
 public interface ToSysRoleMapper {
8 10
     int deleteByPrimaryKey(Integer id);
@@ -16,4 +18,11 @@ public interface ToSysRoleMapper {
16 18
     int updateByPrimaryKeySelective(ToSysRole record);
17 19
 
18 20
     int updateByPrimaryKey(ToSysRole record);
21
+
22
+    /**
23
+     * 根据用户ID查询所有角色
24
+     * @param userId
25
+     * @return
26
+     */
27
+    List<ToSysRole> selectRoleByUserId(Integer userId);
19 28
 }

+ 1
- 1
CODE/smart-community/operate-api/src/main/java/com/community/huiju/model/ToBanner.java 查看文件

@@ -8,6 +8,7 @@ import java.util.Date;
8 8
 public class ToBanner {
9 9
     private Integer id;
10 10
 
11
+    @NotBlank(message = "标题不能为空!")
11 12
     private String title;
12 13
 
13 14
     @Min(value = 0,message = "小区不能为空!")
@@ -33,7 +34,6 @@ public class ToBanner {
33 34
     @NotBlank(message = "跳转的URL不能为空!")
34 35
     private String externalLink;
35 36
 
36
-    @NotBlank(message = "banner标题不能为空!")
37 37
     private String bannerTitle;
38 38
 
39 39
     private Integer createUser;

+ 42
- 0
CODE/smart-community/operate-api/src/main/java/com/community/huiju/model/ToCommunities.java 查看文件

@@ -1,5 +1,7 @@
1 1
 package com.community.huiju.model;
2 2
 
3
+import java.util.Date;
4
+
3 5
 public class ToCommunities {
4 6
     private Integer id;
5 7
 
@@ -20,6 +22,14 @@ public class ToCommunities {
20 22
     private String userName;
21 23
     
22 24
     private String loginName;
25
+    
26
+    private Integer createUser;
27
+    
28
+    private Date createDate;
29
+    
30
+    private Integer updateUser;
31
+    
32
+    private Date updateDate;
23 33
 
24 34
     public Integer getId() {
25 35
         return id;
@@ -100,4 +110,36 @@ public class ToCommunities {
100 110
     public void setLoginName(String loginName) {
101 111
         this.loginName = loginName;
102 112
     }
113
+    
114
+    public Integer getCreateUser() {
115
+        return createUser;
116
+    }
117
+    
118
+    public void setCreateUser(Integer createUser) {
119
+        this.createUser = createUser;
120
+    }
121
+    
122
+    public Date getCreateDate() {
123
+        return createDate;
124
+    }
125
+    
126
+    public void setCreateDate(Date createDate) {
127
+        this.createDate = createDate;
128
+    }
129
+    
130
+    public Integer getUpdateUser() {
131
+        return updateUser;
132
+    }
133
+    
134
+    public void setUpdateUser(Integer updateUser) {
135
+        this.updateUser = updateUser;
136
+    }
137
+    
138
+    public Date getUpdateDate() {
139
+        return updateDate;
140
+    }
141
+    
142
+    public void setUpdateDate(Date updateDate) {
143
+        this.updateDate = updateDate;
144
+    }
103 145
 }

+ 2
- 1
CODE/smart-community/operate-api/src/main/java/com/community/huiju/service/CommunityServiceI.java 查看文件

@@ -3,6 +3,7 @@ package com.community.huiju.service;
3 3
 import com.community.huiju.model.ToCommunities;
4 4
 
5 5
 import java.util.List;
6
+import java.util.Map;
6 7
 
7 8
 public interface CommunityServiceI {
8 9
 	
@@ -13,7 +14,7 @@ public interface CommunityServiceI {
13 14
 	 * @param pageSize
14 15
 	 * @return
15 16
 	 */
16
-	List<ToCommunities> getCommunitys(ToCommunities toCommunities, Integer pageNum, Integer pageSize);
17
+	Map<String,Object> getCommunitys(ToCommunities toCommunities, Integer pageNum, Integer pageSize);
17 18
 	
18 19
 	/**
19 20
 	 * 添加新的小区

+ 3
- 1
CODE/smart-community/operate-api/src/main/java/com/community/huiju/service/IToBannerService.java 查看文件

@@ -41,8 +41,10 @@ public interface IToBannerService {
41 41
      *
42 42
      *
43 43
      * @param banner
44
+     * @param pageNum
45
+     * @param pageSize
44 46
      * @return
45 47
      */
46
-    ResponseBean getBanner(ToBanner banner);
48
+    ResponseBean getBanner(ToBanner banner, Integer pageNum, Integer pageSize);
47 49
 
48 50
 }

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

@@ -0,0 +1,18 @@
1
+package com.community.huiju.service;
2
+
3
+import com.community.huiju.model.ToSysRole;
4
+
5
+import java.util.List;
6
+
7
+/**
8
+ * 角色 业务
9
+ * @author weiximei
10
+ */
11
+public interface IToSysRoleService {
12
+    /**
13
+     * 根据用户ID查询所有角色
14
+     * @param userId
15
+     * @return
16
+     */
17
+    List<ToSysRole> selectRoleByUserId(Integer userId);
18
+}

+ 7
- 0
CODE/smart-community/operate-api/src/main/java/com/community/huiju/service/IToUserService.java 查看文件

@@ -16,4 +16,11 @@ public interface IToUserService {
16 16
      */
17 17
     ResponseBean login(String loginName,String code);
18 18
 
19
+    /**
20
+     * 获取用户信息
21
+     * @param userId
22
+     * @return
23
+     */
24
+    ResponseBean getInfo(Integer userId);
25
+
19 26
 }

+ 9
- 3
CODE/smart-community/operate-api/src/main/java/com/community/huiju/service/impl/CommunityServiceImpl.java 查看文件

@@ -8,13 +8,16 @@ import com.community.huiju.model.ToCommunities;
8 8
 import com.community.huiju.model.TpUser;
9 9
 import com.community.huiju.model.TpUserCommunity;
10 10
 import com.community.huiju.service.CommunityServiceI;
11
+import com.github.pagehelper.Page;
11 12
 import com.github.pagehelper.PageHelper;
12 13
 import org.springframework.beans.factory.annotation.Autowired;
13 14
 import org.springframework.stereotype.Service;
14 15
 import org.springframework.transaction.annotation.Transactional;
15 16
 
16 17
 import java.util.Date;
18
+import java.util.HashMap;
17 19
 import java.util.List;
20
+import java.util.Map;
18 21
 
19 22
 /**
20 23
  * @author FXF
@@ -41,12 +44,15 @@ public class CommunityServiceImpl implements CommunityServiceI {
41 44
 	 * @return
42 45
 	 */
43 46
 	@Override
44
-	public List<ToCommunities> getCommunitys(ToCommunities toCommunities, Integer pageNum, Integer pageSize) {
47
+	public Map<String,Object> getCommunitys(ToCommunities toCommunities, Integer pageNum, Integer pageSize) {
45 48
 		//使用分页插件
46
-		PageHelper.startPage(pageNum, pageSize);
49
+		Page page = PageHelper.startPage(pageNum, pageSize);
47 50
 		//获取数据
48 51
 		List<ToCommunities> list = toCommunitiesMapper.selectByCommunityName(toCommunities);
49
-		return list;
52
+		Map<String,Object> map = new HashMap<>();
53
+		map.put("items",list);
54
+		map.put("total",page.getTotal());
55
+		return map;
50 56
 	}
51 57
 	
52 58
 	@Override

+ 16
- 5
CODE/smart-community/operate-api/src/main/java/com/community/huiju/service/impl/ToBannerServiceImpl.java 查看文件

@@ -12,6 +12,9 @@ import com.community.huiju.model.ToCommunities;
12 12
 import com.community.huiju.model.ToUser;
13 13
 import com.community.huiju.service.IToBannerService;
14 14
 import com.community.huiju.vo.ToBannerVO;
15
+import com.github.pagehelper.Page;
16
+import com.github.pagehelper.PageHelper;
17
+import com.google.common.collect.Maps;
15 18
 import org.apache.commons.lang.StringUtils;
16 19
 import org.springframework.beans.BeanUtils;
17 20
 import org.springframework.beans.factory.annotation.Autowired;
@@ -19,6 +22,7 @@ import org.springframework.stereotype.Service;
19 22
 
20 23
 import java.util.Date;
21 24
 import java.util.List;
25
+import java.util.Map;
22 26
 import java.util.stream.Collectors;
23 27
 
24 28
 /**
@@ -44,7 +48,7 @@ public class ToBannerServiceImpl implements IToBannerService {
44 48
     public ResponseBean addBanner(ToBanner banner,Integer currentUserId) {
45 49
 
46 50
         ResponseBean response = new ResponseBean();
47
-        if (!Constant.BANNER_TYPE_ARTICLE.equals(banner.getBannerType())) {
51
+        if (Constant.BANNER_TYPE_ARTICLE.equals(banner.getBannerType())) {
48 52
             if (StringUtils.isBlank(banner.getBannerContent())) {
49 53
                 response.addError("Banner内容不能为空");
50 54
                 return response;
@@ -129,11 +133,13 @@ public class ToBannerServiceImpl implements IToBannerService {
129 133
     }
130 134
 
131 135
     @Override
132
-    public ResponseBean getBanner(ToBanner banner) {
136
+    public ResponseBean getBanner(ToBanner banner,Integer pageNum, Integer pageSize) {
133 137
 
134 138
         ResponseBean response = new ResponseBean();
135 139
 
140
+        Page<ToBanner> page = PageHelper.startPage(pageNum,pageSize);
136 141
         List<ToBanner> bannerList = toBannerMapper.selectBanner(banner);
142
+
137 143
         List<ToBannerVO> bannerVOList = bannerList.stream().map(e->{
138 144
             ToBannerVO toBannerVO = new ToBannerVO();
139 145
             BeanUtils.copyProperties(e,toBannerVO);
@@ -141,8 +147,10 @@ public class ToBannerServiceImpl implements IToBannerService {
141 147
             ToCommunities toCommunities = toCommunitiesMapper.selectByPrimaryKey(e.getCommunityId());
142 148
             toBannerVO.setCommunityName(toCommunities.getCommunityName());
143 149
 
144
-            SysDictionary sysDictionary = sysDictionaryMapper.selectByPrimaryKey(e.getBannerPosition());
145
-            toBannerVO.setBannerPositionName(sysDictionary.getName());
150
+            // TODO banner位置名称
151
+            //SysDictionary sysDictionary = sysDictionaryMapper.selectByPrimaryKey(e.getBannerPosition());
152
+            //toBannerVO.setBannerPositionName(sysDictionary.getName());
153
+            toBannerVO.setBannerPositionName("首页banner");
146 154
 
147 155
             ToUser toUser = toUserMapper.selectByPrimaryKey(e.getUpdateUser());
148 156
             toBannerVO.setUpdateUserName(toUser.getUserName());
@@ -151,7 +159,10 @@ public class ToBannerServiceImpl implements IToBannerService {
151 159
 
152 160
         }).collect(Collectors.toList());
153 161
 
154
-        response.addSuccess(bannerVOList);
162
+        Map<String,Object> map = Maps.newHashMap();
163
+        map.put("item",bannerVOList);
164
+        map.put("total",page.getTotal());
165
+        response.addSuccess(map);
155 166
 
156 167
         return response;
157 168
     }

+ 24
- 0
CODE/smart-community/operate-api/src/main/java/com/community/huiju/service/impl/ToSysRoleServiceImpl.java 查看文件

@@ -0,0 +1,24 @@
1
+package com.community.huiju.service.impl;
2
+
3
+import com.community.huiju.dao.ToSysRoleMapper;
4
+import com.community.huiju.model.ToSysRole;
5
+import com.community.huiju.service.IToSysRoleService;
6
+import lombok.extern.slf4j.Slf4j;
7
+import org.springframework.beans.factory.annotation.Autowired;
8
+import org.springframework.stereotype.Service;
9
+
10
+import java.util.List;
11
+
12
+@Service("iToSysRoleService")
13
+@Slf4j
14
+public class ToSysRoleServiceImpl implements IToSysRoleService {
15
+
16
+    @Autowired
17
+    private ToSysRoleMapper toSysRoleMapper;
18
+
19
+    @Override
20
+    public List<ToSysRole> selectRoleByUserId(Integer userId) {
21
+
22
+        return toSysRoleMapper.selectRoleByUserId(userId);
23
+    }
24
+}

+ 28
- 0
CODE/smart-community/operate-api/src/main/java/com/community/huiju/service/impl/ToUserServerImpl.java 查看文件

@@ -3,7 +3,9 @@ package com.community.huiju.service.impl;
3 3
 import com.community.commom.mode.ResponseBean;
4 4
 import com.community.commom.utils.AccountValidatorUtil;
5 5
 import com.community.huiju.common.code.cache.AppkeyCache;
6
+import com.community.huiju.dao.ToSysRoleMapper;
6 7
 import com.community.huiju.dao.ToUserMapper;
8
+import com.community.huiju.model.ToSysRole;
7 9
 import com.community.huiju.model.ToUser;
8 10
 import com.community.huiju.service.IToUserService;
9 11
 import com.community.huiju.vo.ToUserVO;
@@ -13,6 +15,8 @@ import org.springframework.beans.BeanUtils;
13 15
 import org.springframework.beans.factory.annotation.Autowired;
14 16
 import org.springframework.stereotype.Service;
15 17
 
18
+import java.util.List;
19
+
16 20
 @Service("iToUserServer")
17 21
 @Slf4j
18 22
 public class ToUserServerImpl implements IToUserService {
@@ -20,6 +24,9 @@ public class ToUserServerImpl implements IToUserService {
20 24
     @Autowired
21 25
     private ToUserMapper toUserMapper;
22 26
 
27
+    @Autowired
28
+    private ToSysRoleMapper toSysRoleMapper;
29
+
23 30
     @Override
24 31
     public ResponseBean login(String loginName, String code) {
25 32
 
@@ -52,4 +59,25 @@ public class ToUserServerImpl implements IToUserService {
52 59
         response.addSuccess(userVO);
53 60
         return response;
54 61
     }
62
+
63
+
64
+    @Override
65
+    public ResponseBean getInfo(Integer userId) {
66
+        ResponseBean response = new ResponseBean();
67
+        ToUser toUser = toUserMapper.selectByPrimaryKey(userId);
68
+        if (toUser == null) {
69
+            response.addError("用户不存在!");
70
+            return response;
71
+        }
72
+
73
+        ToUserVO toUserVO = new ToUserVO();
74
+        BeanUtils.copyProperties(toUser,toUserVO);
75
+
76
+        List<ToSysRole> sysRoleList = toSysRoleMapper.selectRoleByUserId(userId);
77
+        toUserVO.setRoles(sysRoleList);
78
+
79
+        response.addSuccess(toUserVO);
80
+
81
+        return response;
82
+    }
55 83
 }

+ 5
- 0
CODE/smart-community/operate-api/src/main/java/com/community/huiju/vo/ToUserVO.java 查看文件

@@ -1,10 +1,12 @@
1 1
 package com.community.huiju.vo;
2 2
 
3
+import com.community.huiju.model.ToSysRole;
3 4
 import lombok.AllArgsConstructor;
4 5
 import lombok.Data;
5 6
 import lombok.NoArgsConstructor;
6 7
 
7 8
 import java.util.Date;
9
+import java.util.List;
8 10
 
9 11
 /**
10 12
  * @author weiximei
@@ -49,4 +51,7 @@ public class ToUserVO {
49 51
     /** 用户token **/
50 52
     private String token;
51 53
 
54
+    /** 角色 **/
55
+    private List<ToSysRole> roles;
56
+
52 57
 }

+ 4
- 0
CODE/smart-community/operate-api/src/main/resources/mapper/ToBannerMapper.xml 查看文件

@@ -275,6 +275,10 @@
275 275
       <if test="bannerPosition != null">
276 276
        and banner_position = #{bannerPosition,jdbcType=INTEGER}
277 277
       </if>
278
+      <if test="communityId != null">
279
+       and community_id = #{communityId,jdbcType=INTEGER}
280
+      </if>
278 281
     </trim>
282
+    order by create_user DESC
279 283
   </select>
280 284
 </mapper>

+ 6
- 2
CODE/smart-community/operate-api/src/main/resources/mapper/ToCommunitiesMapper.xml 查看文件

@@ -12,10 +12,14 @@
12 12
     <result column="latitude" property="latitude" jdbcType="VARCHAR" />
13 13
     <result column="user_name" property="userName" jdbcType="VARCHAR" />
14 14
     <result column="login_name" property="loginName" jdbcType="VARCHAR" />
15
+    <result column="create_user" property="createUser" jdbcType="INTEGER" />
16
+    <result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
17
+    <result column="update_user" property="updateUser" jdbcType="INTEGER" />
18
+    <result column="update_date" property="updateDate" jdbcType="TIMESTAMP" />
15 19
   </resultMap>
16 20
   <sql id="Base_Column_List" >
17
-    id, community_name, community_alias, province_id, city_id, district_id, longitude, 
18
-    latitude,user_name,login_name
21
+    id, community_name, community_alias, province_id, city_id, district_id, longitude,
22
+    latitude,user_name,login_name,create_user,create_date,update_user,update_date
19 23
   </sql>
20 24
   <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
21 25
     select 

+ 6
- 0
CODE/smart-community/operate-api/src/main/resources/mapper/ToSysRoleMapper.xml 查看文件

@@ -125,4 +125,10 @@
125 125
       update_date = #{updateDate,jdbcType=TIMESTAMP}
126 126
     where id = #{id,jdbcType=INTEGER}
127 127
   </update>
128
+
129
+  <select id="selectRoleByUserId" parameterType="java.lang.Integer" resultMap="BaseResultMap">
130
+    select
131
+    role.*
132
+     from to_sys_user_role ur left join to_sys_role role on ur.role_id = role.id where ur.user_id=#{userId}
133
+  </select>
128 134
 </mapper>

+ 2
- 17
CODE/smart-community/zuul/pom.xml 查看文件

@@ -112,24 +112,9 @@
112 112
             <version>${commons.logging.version}</version>
113 113
         </dependency>
114 114
 
115
-		<!-- https://mvnrepository.com/artifact/org.springframework.security/spring-security-core -->
116 115
 		<dependency>
117
-			<groupId>org.springframework.security</groupId>
118
-			<artifactId>spring-security-core</artifactId>
119
-			<version>${spring-security.version}</version>
120
-		</dependency>
121
-		<!-- https://mvnrepository.com/artifact/org.springframework.security/spring-security-web -->
122
-		<dependency>
123
-			<groupId>org.springframework.security</groupId>
124
-			<artifactId>spring-security-web</artifactId>
125
-			<version>${spring-security.version}</version>
126
-		</dependency>
127
-
128
-		<!-- https://mvnrepository.com/artifact/org.springframework.security/spring-security-config -->
129
-		<dependency>
130
-			<groupId>org.springframework.security</groupId>
131
-			<artifactId>spring-security-config</artifactId>
132
-			<version>${spring-security.version}</version>
116
+			<groupId>org.springframework.boot</groupId>
117
+			<artifactId>spring-boot-starter-security</artifactId>
133 118
 		</dependency>
134 119
 
135 120
 		<!-- https://mvnrepository.com/artifact/com.alibaba/fastjson -->

+ 37
- 3
CODE/smart-community/zuul/src/main/java/com/community/huiju/ZuulApplication.java 查看文件

@@ -2,19 +2,53 @@ package com.community.huiju;
2 2
 
3 3
 import com.didispace.swagger.butler.EnableSwaggerButler;
4 4
 import org.springframework.boot.SpringApplication;
5
+import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
5 6
 import org.springframework.cloud.client.SpringCloudApplication;
6 7
 import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
7 8
 import org.springframework.cloud.netflix.zuul.EnableZuulProxy;
9
+import org.springframework.context.annotation.Bean;
8 10
 import org.springframework.context.annotation.PropertySource;
11
+import org.springframework.web.cors.CorsConfiguration;
12
+import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
13
+import org.springframework.web.filter.CorsFilter;
9 14
 
10 15
 @EnableZuulProxy
11 16
 @EnableDiscoveryClient
12 17
 @SpringCloudApplication
13 18
 @EnableSwaggerButler
19
+@EnableAutoConfiguration(exclude = {
20
+        org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration.class
21
+})
14 22
 @PropertySource(value = "classpath:parametes.properties")
15 23
 public class ZuulApplication {
16 24
 
17
-	public static void main(String[] args) {
18
-		SpringApplication.run(ZuulApplication.class, args);
19
-	}
25
+    public static void main(String[] args) {
26
+        SpringApplication.run(ZuulApplication.class, args);
27
+    }
28
+
29
+    /**
30
+     *      *
31
+     *      * attention:简单跨域就是GET,HEAD和POST请求,但是POST请求的"Content-Type"只能是application/x-www-form-urlencoded, multipart/form-data 或 text/plain
32
+     *      * 反之,就是非简单跨域,此跨域有一个预检机制,说直白点,就是会发两次请求,一次OPTIONS请求,一次真正的请求
33
+     *     
34
+     */
35
+    @Bean
36
+    public CorsFilter corsFilter() {
37
+        final UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
38
+        final CorsConfiguration config = new CorsConfiguration();
39
+        config.setAllowCredentials(true); // 允许cookies跨域
40
+        config.addAllowedOrigin("*");// #允许向该服务器提交请求的URI,*表示全部允许,在SpringMVC中,如果设成*,会自动转成当前请求头中的Origin
41
+        config.addAllowedHeader("*");// #允许访问的头信息,*表示全部
42
+        config.setMaxAge(18000L);// 预检请求的缓存时间(秒),即在这个时间段里,对于相同的跨域请求不会再预检了
43
+        config.addAllowedMethod("OPTIONS");// 允许提交请求的方法,*表示全部允许
44
+        config.addAllowedMethod("HEAD");
45
+        config.addAllowedMethod("GET");// 允许Get的请求方法
46
+        config.addAllowedMethod("PUT");
47
+        config.addAllowedMethod("POST");
48
+        config.addAllowedMethod("DELETE");
49
+        config.addAllowedMethod("PATCH");
50
+        source.registerCorsConfiguration("/**", config);
51
+        return new CorsFilter(source);
52
+    }
53
+
20 54
 }

+ 46
- 0
CODE/smart-community/zuul/src/main/java/com/community/huiju/filter/DomainZuulPreFilter.java 查看文件

@@ -0,0 +1,46 @@
1
+package com.community.huiju.filter;
2
+
3
+import com.netflix.zuul.ZuulFilter;
4
+import com.netflix.zuul.context.RequestContext;
5
+import com.netflix.zuul.exception.ZuulException;
6
+import org.springframework.http.MediaType;
7
+import org.springframework.stereotype.Component;
8
+
9
+import javax.servlet.http.HttpServletResponse;
10
+
11
+/**
12
+ * 跨域
13
+ * @author weiximei
14
+ */
15
+@Component
16
+public class DomainZuulPreFilter extends ZuulFilter {
17
+
18
+    @Override
19
+    public String filterType() {
20
+        return "post";
21
+    }
22
+
23
+    @Override
24
+    public int filterOrder() {
25
+        return 0;
26
+    }
27
+
28
+    @Override
29
+    public boolean shouldFilter() {
30
+        return true;
31
+    }
32
+
33
+    @Override
34
+    public Object run() throws ZuulException {
35
+
36
+        RequestContext ctx = RequestContext.getCurrentContext();
37
+        HttpServletResponse response = ctx.getResponse();
38
+        response.setHeader("Access-Control-Allow-Origin", "*");
39
+        response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE, HEADER");
40
+        response.setHeader("Access-Control-Max-Age", "3600");
41
+        response.setHeader("Access-Control-Allow-Headers", "X-Requested-With, user-token, Content-Type, Accept, version, type, platform");
42
+        response.setContentType(MediaType.APPLICATION_JSON_UTF8_VALUE);
43
+
44
+        return null;
45
+    }
46
+}

+ 2
- 3
CODE/smart-community/zuul/src/main/java/com/community/huiju/security/RestAuthenticationEntryPoint.java 查看文件

@@ -35,10 +35,9 @@ public class RestAuthenticationEntryPoint implements AuthenticationEntryPoint {
35 35
             }else if (Status.RESPONSE_STATUS_803.getValue().equals(headerError)) {
36 36
                 result.addError(Status.RESPONSE_STATUS_803.getValue(),Status.RESPONSE_STATUS_803.getComment());
37 37
             }
38
+        } else {
39
+            result.addError(Status.RESPONSE_STATUS_888.getValue(),Status.RESPONSE_STATUS_888.getComment());
38 40
         }
39
-//        else {
40
-//            result.addError(Status.RESPONSE_STATUS_888.getValue(),Status.RESPONSE_STATUS_888.getComment());
41
-//        }
42 41
 
43 42
         try {
44 43
             //设置跨域请求 请求结果json刷到响应里

+ 12
- 1
CODE/smart-community/zuul/src/main/java/com/community/huiju/security/RestPreAuthenticateProvider.java 查看文件

@@ -1,11 +1,16 @@
1 1
 package com.community.huiju.security;
2 2
 
3
+import com.community.commom.constant.Constant;
3 4
 import com.community.huiju.exception.WisdomSecurityException;
4 5
 import org.springframework.security.authentication.AuthenticationProvider;
5 6
 import org.springframework.security.core.Authentication;
6 7
 import org.springframework.security.core.AuthenticationException;
8
+import org.springframework.security.core.GrantedAuthority;
7 9
 import org.springframework.security.web.authentication.preauth.PreAuthenticatedAuthenticationToken;
8 10
 
11
+import java.util.Collection;
12
+import java.util.List;
13
+
9 14
 /**
10 15
  * 授权过程
11 16
  *
@@ -18,7 +23,13 @@ public class RestPreAuthenticateProvider implements AuthenticationProvider {
18 23
 
19 24
 
20 25
         TokenAuthrentication tokenAuthrentication = (TokenAuthrentication) authentication.getPrincipal();
21
-        if (null != tokenAuthrentication.getAuthorities() && tokenAuthrentication.getAuthorities().size() > 0) {
26
+        Collection<GrantedAuthority> grantedAuthorityList = tokenAuthrentication.getAuthorities();
27
+        if (null != grantedAuthorityList && grantedAuthorityList.size() > 0) {
28
+             boolean isNone= grantedAuthorityList.stream().anyMatch(e->e.getAuthority().equals(Constant.ROLE_NONE));
29
+             if (isNone) {
30
+                 tokenAuthrentication.setAuthenticated(false);
31
+                 return tokenAuthrentication;
32
+             }
22 33
             tokenAuthrentication.setAuthenticated(true);
23 34
             return tokenAuthrentication;
24 35
         }

+ 2
- 2
CODE/smart-community/zuul/src/main/java/com/community/huiju/security/RestPreAuthenticatedProcessingFilter.java 查看文件

@@ -57,7 +57,7 @@ public class RestPreAuthenticatedProcessingFilter extends AbstractPreAuthenticat
57 57
         // 不需要的拦截请求处理
58 58
         if (isNoneSecurity(request.getRequestURI().toString()) || "OPTIONS".equals(request.getMethod())){
59 59
             GrantedAuthority[] authorities = new GrantedAuthority[1];
60
-            GrantedAuthority roleNone = new SimpleGrantedAuthority(Constant.ROLE_NONE);
60
+            GrantedAuthority roleNone = new SimpleGrantedAuthority(Constant.ROLE_NONEUSER);
61 61
             authorities[0]=roleNone;
62 62
             grantedAuthorityList.add(authorities[0]);
63 63
             return new TokenAuthrentication(grantedAuthorityList);
@@ -89,7 +89,7 @@ public class RestPreAuthenticatedProcessingFilter extends AbstractPreAuthenticat
89 89
         }else {
90 90
             // 校验有问题后, 需要给个角色, 让流程继续下去
91 91
             GrantedAuthority[] authorities = new GrantedAuthority[1];
92
-            GrantedAuthority roleNone = new SimpleGrantedAuthority("ROLE_NONE");
92
+            GrantedAuthority roleNone = new SimpleGrantedAuthority(Constant.ROLE_NONE);
93 93
             authorities[0]=roleNone;
94 94
             grantedAuthorityList.add(authorities[0]);
95 95
         }

+ 2
- 1
CODE/smart-community/zuul/src/main/resources/application.yml 查看文件

@@ -3,5 +3,6 @@ management:
3 3
     web:
4 4
       exposure:
5 5
         include: refresh,health,info
6
-
6
+  security:
7
+    enabled: false
7 8
 

+ 1
- 0
CODE/smart-community/zuul/src/main/resources/bootstrap.yml 查看文件

@@ -28,6 +28,7 @@ zuul:
28 28
   host:
29 29
     connect-timeout-millis: 200000
30 30
 
31
+
31 32
 ## Mybatis
32 33
 mybatis:
33 34
   typeAliasesPackage: com.community.huiju.model

+ 1
- 1
CODE/smart-community/zuul/src/main/resources/mapper/ToSysRoleMapper.xml 查看文件

@@ -129,7 +129,7 @@
129 129
   <select id="selectRoleByUserId" parameterType="java.lang.Integer" resultMap="BaseResultMap">
130 130
     select
131 131
     role.*
132
-     from to_sys_user_role ur left join ta_sys_role role on ur.role_id = role.id where ur.user_id=#{userId}
132
+     from to_sys_user_role ur left join to_sys_role role on ur.role_id = role.id where ur.user_id=#{userId}
133 133
   </select>
134 134
 
135 135
 </mapper>

+ 1
- 1
CODE/smart-community/zuul/src/main/resources/parametes.properties 查看文件

@@ -1,2 +1,2 @@
1
-security.noneSercurityPath=/**/user/login/**,/**/user/register/**,/**/code/sendCode/**,/**/authentication/require/**
1
+security.noneSercurityPath=/**/user/login/**,/**/user/register/**,/**/code/sendCode/**,/**/authentication/require/**,/**/operate-api/**
2 2
 security.appSercurityPath=OWNER=/**/tickets/**,TENANT=/**/app-api/**,RELATION=/**/app-api/**

+ 12
- 0
VUECODE/smart-operate-manage/.babelrc 查看文件

@@ -0,0 +1,12 @@
1
+{
2
+  "presets": [
3
+    ["env", {
4
+      "modules": false,
5
+      "targets": {
6
+        "browsers": ["> 1%", "last 2 versions", "not ie <= 8"]
7
+      }
8
+    }],
9
+    "stage-2"
10
+  ],
11
+  "plugins":["transform-vue-jsx", "transform-runtime"]
12
+}

+ 14
- 0
VUECODE/smart-operate-manage/.editorconfig 查看文件

@@ -0,0 +1,14 @@
1
+# http://editorconfig.org
2
+root = true
3
+
4
+[*]
5
+charset = utf-8
6
+indent_style = space
7
+indent_size = 2
8
+end_of_line = lf
9
+insert_final_newline = true
10
+trim_trailing_whitespace = true
11
+
12
+[*.md]
13
+insert_final_newline = false
14
+trim_trailing_whitespace = false

+ 3
- 0
VUECODE/smart-operate-manage/.eslintignore 查看文件

@@ -0,0 +1,3 @@
1
+build/*.js
2
+config/*.js
3
+src/assets

+ 196
- 0
VUECODE/smart-operate-manage/.eslintrc.js 查看文件

@@ -0,0 +1,196 @@
1
+module.exports = {
2
+  root: true,
3
+  parserOptions: {
4
+    parser: 'babel-eslint',
5
+    sourceType: 'module'
6
+  },
7
+  env: {
8
+    browser: true,
9
+    node: true,
10
+    es6: true,
11
+  },
12
+  extends: ['plugin:vue/recommended', 'eslint:recommended'],
13
+
14
+  // add your custom rules here
15
+  //it is base on https://github.com/vuejs/eslint-config-vue
16
+  rules: {
17
+    "vue/max-attributes-per-line": [2, {
18
+      "singleline": 10,
19
+      "multiline": {
20
+        "max": 1,
21
+        "allowFirstLine": false
22
+      }
23
+    }],
24
+    "vue/name-property-casing": ["error", "PascalCase"],
25
+    'accessor-pairs': 2,
26
+    'arrow-spacing': [2, {
27
+      'before': true,
28
+      'after': true
29
+    }],
30
+    'block-spacing': [2, 'always'],
31
+    'brace-style': [2, '1tbs', {
32
+      'allowSingleLine': true
33
+    }],
34
+    'camelcase': [0, {
35
+      'properties': 'always'
36
+    }],
37
+    'comma-dangle': [2, 'never'],
38
+    'comma-spacing': [2, {
39
+      'before': false,
40
+      'after': true
41
+    }],
42
+    'comma-style': [2, 'last'],
43
+    'constructor-super': 2,
44
+    'curly': [2, 'multi-line'],
45
+    'dot-location': [2, 'property'],
46
+    'eol-last': 2,
47
+    'eqeqeq': [2, 'allow-null'],
48
+    'generator-star-spacing': [2, {
49
+      'before': true,
50
+      'after': true
51
+    }],
52
+    'handle-callback-err': [2, '^(err|error)$'],
53
+    'indent': [2, 2, {
54
+      'SwitchCase': 1
55
+    }],
56
+    'jsx-quotes': [2, 'prefer-single'],
57
+    'key-spacing': [2, {
58
+      'beforeColon': false,
59
+      'afterColon': true
60
+    }],
61
+    'keyword-spacing': [2, {
62
+      'before': true,
63
+      'after': true
64
+    }],
65
+    'new-cap': [2, {
66
+      'newIsCap': true,
67
+      'capIsNew': false
68
+    }],
69
+    'new-parens': 2,
70
+    'no-array-constructor': 2,
71
+    'no-caller': 2,
72
+    'no-console': 'off',
73
+    'no-class-assign': 2,
74
+    'no-cond-assign': 2,
75
+    'no-const-assign': 2,
76
+    'no-control-regex': 2,
77
+    'no-delete-var': 2,
78
+    'no-dupe-args': 2,
79
+    'no-dupe-class-members': 2,
80
+    'no-dupe-keys': 2,
81
+    'no-duplicate-case': 2,
82
+    'no-empty-character-class': 2,
83
+    'no-empty-pattern': 2,
84
+    'no-eval': 2,
85
+    'no-ex-assign': 2,
86
+    'no-extend-native': 2,
87
+    'no-extra-bind': 2,
88
+    'no-extra-boolean-cast': 2,
89
+    'no-extra-parens': [2, 'functions'],
90
+    'no-fallthrough': 2,
91
+    'no-floating-decimal': 2,
92
+    'no-func-assign': 2,
93
+    'no-implied-eval': 2,
94
+    'no-inner-declarations': [2, 'functions'],
95
+    'no-invalid-regexp': 2,
96
+    'no-irregular-whitespace': 2,
97
+    'no-iterator': 2,
98
+    'no-label-var': 2,
99
+    'no-labels': [2, {
100
+      'allowLoop': false,
101
+      'allowSwitch': false
102
+    }],
103
+    'no-lone-blocks': 2,
104
+    'no-mixed-spaces-and-tabs': 2,
105
+    'no-multi-spaces': 2,
106
+    'no-multi-str': 2,
107
+    'no-multiple-empty-lines': [2, {
108
+      'max': 1
109
+    }],
110
+    'no-native-reassign': 2,
111
+    'no-negated-in-lhs': 2,
112
+    'no-new-object': 2,
113
+    'no-new-require': 2,
114
+    'no-new-symbol': 2,
115
+    'no-new-wrappers': 2,
116
+    'no-obj-calls': 2,
117
+    'no-octal': 2,
118
+    'no-octal-escape': 2,
119
+    'no-path-concat': 2,
120
+    'no-proto': 2,
121
+    'no-redeclare': 2,
122
+    'no-regex-spaces': 2,
123
+    'no-return-assign': [2, 'except-parens'],
124
+    'no-self-assign': 2,
125
+    'no-self-compare': 2,
126
+    'no-sequences': 2,
127
+    'no-shadow-restricted-names': 2,
128
+    'no-spaced-func': 2,
129
+    'no-sparse-arrays': 2,
130
+    'no-this-before-super': 2,
131
+    'no-throw-literal': 2,
132
+    'no-trailing-spaces': 2,
133
+    'no-undef': 2,
134
+    'no-undef-init': 2,
135
+    'no-unexpected-multiline': 2,
136
+    'no-unmodified-loop-condition': 2,
137
+    'no-unneeded-ternary': [2, {
138
+      'defaultAssignment': false
139
+    }],
140
+    'no-unreachable': 2,
141
+    'no-unsafe-finally': 2,
142
+    'no-unused-vars': [2, {
143
+      'vars': 'all',
144
+      'args': 'none'
145
+    }],
146
+    'no-useless-call': 2,
147
+    'no-useless-computed-key': 2,
148
+    'no-useless-constructor': 2,
149
+    'no-useless-escape': 0,
150
+    'no-whitespace-before-property': 2,
151
+    'no-with': 2,
152
+    'one-var': [2, {
153
+      'initialized': 'never'
154
+    }],
155
+    'operator-linebreak': [2, 'after', {
156
+      'overrides': {
157
+        '?': 'before',
158
+        ':': 'before'
159
+      }
160
+    }],
161
+    'padded-blocks': [2, 'never'],
162
+    'quotes': [2, 'single', {
163
+      'avoidEscape': true,
164
+      'allowTemplateLiterals': true
165
+    }],
166
+    'semi': [2, 'never'],
167
+    'semi-spacing': [2, {
168
+      'before': false,
169
+      'after': true
170
+    }],
171
+    'space-before-blocks': [2, 'always'],
172
+    'space-before-function-paren': [2, 'never'],
173
+    'space-in-parens': [2, 'never'],
174
+    'space-infix-ops': 2,
175
+    'space-unary-ops': [2, {
176
+      'words': true,
177
+      'nonwords': false
178
+    }],
179
+    'spaced-comment': [2, 'always', {
180
+      'markers': ['global', 'globals', 'eslint', 'eslint-disable', '*package', '!', ',']
181
+    }],
182
+    'template-curly-spacing': [2, 'never'],
183
+    'use-isnan': 2,
184
+    'valid-typeof': 2,
185
+    'wrap-iife': [2, 'any'],
186
+    'yield-star-spacing': [2, 'both'],
187
+    'yoda': [2, 'never'],
188
+    'prefer-const': 2,
189
+    'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
190
+    'object-curly-spacing': [2, 'always', {
191
+      objectsInObjects: false
192
+    }],
193
+    'array-bracket-spacing': [2, 'never']
194
+  }
195
+}
196
+

+ 15
- 0
VUECODE/smart-operate-manage/.gitignore 查看文件

@@ -0,0 +1,15 @@
1
+.DS_Store
2
+node_modules/
3
+dist/
4
+npm-debug.log*
5
+yarn-debug.log*
6
+yarn-error.log*
7
+package-lock.json
8
+
9
+# Editor directories and files
10
+.idea
11
+.vscode
12
+*.suo
13
+*.ntvs*
14
+*.njsproj
15
+*.sln

+ 10
- 0
VUECODE/smart-operate-manage/.postcssrc.js 查看文件

@@ -0,0 +1,10 @@
1
+// https://github.com/michael-ciniawsky/postcss-load-config
2
+
3
+module.exports = {
4
+  "plugins": {
5
+    "postcss-import": {},
6
+    "postcss-url": {},
7
+    // to edit target browsers: use "browserslist" field in package.json
8
+    "autoprefixer": {}
9
+  }
10
+}

+ 5
- 0
VUECODE/smart-operate-manage/.travis.yml 查看文件

@@ -0,0 +1,5 @@
1
+language: node_js
2
+node_js: stable
3
+script: npm run test
4
+notifications:
5
+  email: false

+ 21
- 0
VUECODE/smart-operate-manage/LICENSE 查看文件

@@ -0,0 +1,21 @@
1
+MIT License
2
+
3
+Copyright (c) 2017-present PanJiaChen
4
+
5
+Permission is hereby granted, free of charge, to any person obtaining a copy
6
+of this software and associated documentation files (the "Software"), to deal
7
+in the Software without restriction, including without limitation the rights
8
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+copies of the Software, and to permit persons to whom the Software is
10
+furnished to do so, subject to the following conditions:
11
+
12
+The above copyright notice and this permission notice shall be included in all
13
+copies or substantial portions of the Software.
14
+
15
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+SOFTWARE.

+ 96
- 0
VUECODE/smart-operate-manage/README-zh.md 查看文件

@@ -0,0 +1,96 @@
1
+# vue-admin-template
2
+
3
+> 这是一个 极简的 vue admin 管理后台 它只包含了 Element UI & axios & iconfont & permission control & lint,这些搭建后台必要的东西。
4
+
5
+[线上地址](http://panjiachen.github.io/vue-admin-template)
6
+
7
+[国内访问](https://panjiachen.gitee.io/vue-admin-template)
8
+
9
+## Extra
10
+
11
+如果你想要根据用户角色来动态生成侧边栏和 router,你可以使用改分支[permission-control](https://github.com/PanJiaChen/vue-admin-template/tree/permission-control)
12
+
13
+本项目基于`webpack4`开发,若还想使用`webpack3`开发,请使用该分支[webpack3](https://github.com/PanJiaChen/vue-admin-template/tree/webpack3)
14
+
15
+如果你想使用基于 vue + typescript 的管理后台, 可以看看这个项目: [vue-typescript-admin-template](https://github.com/Armour/vue-typescript-admin-template) (鸣谢: [@Armour](https://github.com/Armour))
16
+
17
+## 相关项目
18
+
19
+[vue-element-admin](https://github.com/PanJiaChen/vue-element-admin)
20
+
21
+[electron-vue-admin](https://github.com/PanJiaChen/electron-vue-admin)
22
+
23
+[vue-typescript-admin-template](https://github.com/Armour/vue-typescript-admin-template)
24
+
25
+写了一个系列的教程配套文章,如何从零构建后一个完整的后台项目:
26
+
27
+- [手摸手,带你用 vue 撸后台 系列一(基础篇)](https://juejin.im/post/59097cd7a22b9d0065fb61d2)
28
+- [手摸手,带你用 vue 撸后台 系列二(登录权限篇)](https://juejin.im/post/591aa14f570c35006961acac)
29
+- [手摸手,带你用 vue 撸后台 系列三 (实战篇)](https://juejin.im/post/593121aa0ce4630057f70d35)
30
+- [手摸手,带你用 vue 撸后台 系列四(vueAdmin 一个极简的后台基础模板,专门针对本项目的文章,算作是一篇文档)](https://juejin.im/post/595b4d776fb9a06bbe7dba56)
31
+- [手摸手,带你封装一个 vue component](https://segmentfault.com/a/1190000009090836)
32
+
33
+## Build Setup
34
+
35
+```bash
36
+# Clone project
37
+git clone https://github.com/PanJiaChen/vue-admin-template.git
38
+
39
+# Install dependencies
40
+npm install
41
+
42
+# 建议不要用cnpm  安装有各种诡异的bug 可以通过如下操作解决npm速度慢的问题
43
+npm install --registry=https://registry.npm.taobao.org
44
+
45
+# Serve with hot reload at localhost:9528
46
+npm run dev
47
+
48
+# Build for production with minification
49
+npm run build
50
+
51
+# Build for production and view the bundle analyzer report
52
+npm run build --report
53
+```
54
+
55
+## Demo
56
+
57
+![demo](https://github.com/PanJiaChen/PanJiaChen.github.io/blob/master/images/demo.gif)
58
+
59
+### Element-Ui 使用 cdn 教程
60
+
61
+首先找到 `index.html` ([根目录下](https://github.com/PanJiaChen/vue-admin-template/blob/element-ui-cdn/index.html))
62
+
63
+引入 Element 的 css 和 js ,并且引入 vue 。因为 Element-Ui 是依赖 vue 的,所以必须在它之前引入 vue 。
64
+
65
+之后找到 [webpack.base.conf.js](https://github.com/PanJiaChen/vue-admin-template/blob/element-ui-cdn/build/webpack.base.conf.js) 加入 `externals` 让 webpack 不打包 vue 和 element
66
+
67
+```
68
+externals: {
69
+  vue: 'Vue',
70
+  'element-ui':'ELEMENT'
71
+}
72
+```
73
+
74
+之后还有一个小细节是如果你用了全局对象方式引入 vue,就不需要 手动 `Vue.use(Vuex)` ,它会自动挂载,具体见 [issue](https://github.com/vuejs/vuex/issues/731)
75
+
76
+最终你可以使用 `npm run build --report` 查看效果
77
+如图:
78
+![demo](https://panjiachen.github.io/images/element-cdn.png)
79
+
80
+**[具体代码](https://github.com/PanJiaChen/vue-admin-template/commit/746aff560932704ae821f82f10b8b2a9681d5177)**
81
+
82
+**[对应分支](https://github.com/PanJiaChen/vue-admin-template/tree/element-ui-cdn)**
83
+
84
+## Browsers support
85
+
86
+Modern browsers and Internet Explorer 10+.
87
+
88
+| [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png" alt="IE / Edge" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>IE / Edge | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png" alt="Firefox" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Firefox | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png" alt="Chrome" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Chrome | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/safari/safari_48x48.png" alt="Safari" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Safari |
89
+| --------- | --------- | --------- | --------- |
90
+| IE10, IE11, Edge| last 2 versions| last 2 versions| last 2 versions
91
+
92
+## License
93
+
94
+[MIT](https://github.com/PanJiaChen/vue-admin-template/blob/master/LICENSE) license.
95
+
96
+Copyright (c) 2017-present PanJiaChen

+ 88
- 0
VUECODE/smart-operate-manage/README.md 查看文件

@@ -0,0 +1,88 @@
1
+# vue-admin-template
2
+
3
+> A minimal vue admin template with Element UI & axios & iconfont & permission control & lint
4
+
5
+**Live demo:** http://panjiachen.github.io/vue-admin-template
6
+
7
+[中文文档](https://github.com/PanJiaChen/vue-admin-template/blob/master/README-zh.md)
8
+
9
+## Build Setup
10
+
11
+```bash
12
+# Clone project
13
+git clone https://github.com/PanJiaChen/vue-admin-template.git
14
+
15
+# Install dependencies
16
+npm install
17
+
18
+# Serve with hot reload at localhost:9528
19
+npm run dev
20
+
21
+# Build for production with minification
22
+npm run build
23
+
24
+# Build for production and view the bundle analyzer report
25
+npm run build --report
26
+```
27
+
28
+## Demo
29
+
30
+![demo](https://github.com/PanJiaChen/PanJiaChen.github.io/blob/master/images/demo.gif)
31
+
32
+## Extra
33
+
34
+If you want router permission && generate menu by user roles , you can use this branch [permission-control](https://github.com/PanJiaChen/vue-admin-template/tree/permission-control)
35
+
36
+This project is based on `webpack4` development. If you want to use `webpack3` development, please use this branch [webpack3](https://github.com/PanJiaChen/vue-admin-template/tree/webpack3)
37
+
38
+For `typescript` version, you can use [vue-typescript-admin-template](https://github.com/Armour/vue-typescript-admin-template) (Credits: [@Armour](https://github.com/Armour))
39
+
40
+## Related Project
41
+
42
+[vue-element-admin](https://github.com/PanJiaChen/vue-element-admin)
43
+
44
+[electron-vue-admin](https://github.com/PanJiaChen/electron-vue-admin)
45
+
46
+[vue-typescript-admin-template](https://github.com/Armour/vue-typescript-admin-template)
47
+
48
+### Element-Ui using cdn tutorial
49
+
50
+First find `index.html`([root directory](https://github.com/PanJiaChen/vue-admin-template/blob/element-ui-cdn/index.html))
51
+
52
+Import css and js of `Element`, and then import vue. Because `Element` is vue-dependent, vue must be import before it.
53
+
54
+Then find [webpack.base.conf.js](https://github.com/PanJiaChen/vue-admin-template/blob/element-ui-cdn/build/webpack.base.conf.js)
55
+Add `externals` to make webpack not package vue and element.
56
+
57
+```
58
+externals: {
59
+  vue: 'Vue',
60
+  'element-ui':'ELEMENT'
61
+}
62
+```
63
+
64
+Finally there is a small detail to pay attention to that if you import vue in global, you don't need to manually `Vue.use(Vuex)`, it will be automatically mounted, see
65
+[issue](https://github.com/vuejs/vuex/issues/731)
66
+
67
+And you can use `npm run build --report` to see the effect
68
+
69
+Pictured:
70
+![demo](https://panjiachen.github.io/images/element-cdn.png)
71
+
72
+**[Detailed code](https://github.com/PanJiaChen/vue-admin-template/commit/746aff560932704ae821f82f10b8b2a9681d5177)**
73
+
74
+**[Branch](https://github.com/PanJiaChen/vue-admin-template/tree/element-ui-cdn)**
75
+
76
+## Browsers support
77
+
78
+Modern browsers and Internet Explorer 10+.
79
+
80
+| [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png" alt="IE / Edge" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>IE / Edge | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png" alt="Firefox" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Firefox | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png" alt="Chrome" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Chrome | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/safari/safari_48x48.png" alt="Safari" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Safari |
81
+| --------- | --------- | --------- | --------- |
82
+| IE10, IE11, Edge| last 2 versions| last 2 versions| last 2 versions
83
+
84
+## License
85
+
86
+[MIT](https://github.com/PanJiaChen/vue-admin-template/blob/master/LICENSE) license.
87
+
88
+Copyright (c) 2017-present PanJiaChen

+ 45
- 0
VUECODE/smart-operate-manage/build/build.js 查看文件

@@ -0,0 +1,45 @@
1
+'use strict'
2
+require('./check-versions')()
3
+
4
+process.env.NODE_ENV = 'production'
5
+
6
+const ora = require('ora')
7
+const rm = require('rimraf')
8
+const path = require('path')
9
+const chalk = require('chalk')
10
+const webpack = require('webpack')
11
+const config = require('../config')
12
+const webpackConfig = require('./webpack.prod.conf')
13
+
14
+const spinner = ora('building for production...')
15
+spinner.start()
16
+
17
+rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
18
+  if (err) throw err
19
+  webpack(webpackConfig, (err, stats) => {
20
+    spinner.stop()
21
+    if (err) throw err
22
+    process.stdout.write(
23
+      stats.toString({
24
+        colors: true,
25
+        modules: false,
26
+        children: false,
27
+        chunks: false,
28
+        chunkModules: false
29
+      }) + '\n\n'
30
+    )
31
+
32
+    if (stats.hasErrors()) {
33
+      console.log(chalk.red('  Build failed with errors.\n'))
34
+      process.exit(1)
35
+    }
36
+
37
+    console.log(chalk.cyan('  Build complete.\n'))
38
+    console.log(
39
+      chalk.yellow(
40
+        '  Tip: built files are meant to be served over an HTTP server.\n' +
41
+          "  Opening index.html over file:// won't work.\n"
42
+      )
43
+    )
44
+  })
45
+})

+ 64
- 0
VUECODE/smart-operate-manage/build/check-versions.js 查看文件

@@ -0,0 +1,64 @@
1
+'use strict'
2
+const chalk = require('chalk')
3
+const semver = require('semver')
4
+const packageConfig = require('../package.json')
5
+const shell = require('shelljs')
6
+
7
+function exec(cmd) {
8
+  return require('child_process')
9
+    .execSync(cmd)
10
+    .toString()
11
+    .trim()
12
+}
13
+
14
+const versionRequirements = [
15
+  {
16
+    name: 'node',
17
+    currentVersion: semver.clean(process.version),
18
+    versionRequirement: packageConfig.engines.node
19
+  }
20
+]
21
+
22
+if (shell.which('npm')) {
23
+  versionRequirements.push({
24
+    name: 'npm',
25
+    currentVersion: exec('npm --version'),
26
+    versionRequirement: packageConfig.engines.npm
27
+  })
28
+}
29
+
30
+module.exports = function() {
31
+  const warnings = []
32
+
33
+  for (let i = 0; i < versionRequirements.length; i++) {
34
+    const mod = versionRequirements[i]
35
+
36
+    if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) {
37
+      warnings.push(
38
+        mod.name +
39
+          ': ' +
40
+          chalk.red(mod.currentVersion) +
41
+          ' should be ' +
42
+          chalk.green(mod.versionRequirement)
43
+      )
44
+    }
45
+  }
46
+
47
+  if (warnings.length) {
48
+    console.log('')
49
+    console.log(
50
+      chalk.yellow(
51
+        'To use this template, you must update following to modules:'
52
+      )
53
+    )
54
+    console.log()
55
+
56
+    for (let i = 0; i < warnings.length; i++) {
57
+      const warning = warnings[i]
58
+      console.log('  ' + warning)
59
+    }
60
+
61
+    console.log()
62
+    process.exit(1)
63
+  }
64
+}

二进制
VUECODE/smart-operate-manage/build/logo.png 查看文件


+ 108
- 0
VUECODE/smart-operate-manage/build/utils.js 查看文件

@@ -0,0 +1,108 @@
1
+'use strict'
2
+const path = require('path')
3
+const config = require('../config')
4
+const MiniCssExtractPlugin = require('mini-css-extract-plugin')
5
+const packageConfig = require('../package.json')
6
+
7
+exports.assetsPath = function(_path) {
8
+  const assetsSubDirectory =
9
+    process.env.NODE_ENV === 'production'
10
+      ? config.build.assetsSubDirectory
11
+      : config.dev.assetsSubDirectory
12
+
13
+  return path.posix.join(assetsSubDirectory, _path)
14
+}
15
+
16
+exports.cssLoaders = function(options) {
17
+  options = options || {}
18
+
19
+  const cssLoader = {
20
+    loader: 'css-loader',
21
+    options: {
22
+      sourceMap: options.sourceMap
23
+    }
24
+  }
25
+
26
+  const postcssLoader = {
27
+    loader: 'postcss-loader',
28
+    options: {
29
+      sourceMap: options.sourceMap
30
+    }
31
+  }
32
+
33
+  // generate loader string to be used with extract text plugin
34
+  function generateLoaders(loader, loaderOptions) {
35
+    const loaders = []
36
+
37
+    // Extract CSS when that option is specified
38
+    // (which is the case during production build)
39
+    if (options.extract) {
40
+      loaders.push(MiniCssExtractPlugin.loader)
41
+    } else {
42
+      loaders.push('vue-style-loader')
43
+    }
44
+
45
+    loaders.push(cssLoader)
46
+
47
+    if (options.usePostCSS) {
48
+      loaders.push(postcssLoader)
49
+    }
50
+
51
+    if (loader) {
52
+      loaders.push({
53
+        loader: loader + '-loader',
54
+        options: Object.assign({}, loaderOptions, {
55
+          sourceMap: options.sourceMap
56
+        })
57
+      })
58
+    }
59
+
60
+    return loaders
61
+  }
62
+  // https://vue-loader.vuejs.org/en/configurations/extract-css.html
63
+  return {
64
+    css: generateLoaders(),
65
+    postcss: generateLoaders(),
66
+    less: generateLoaders('less'),
67
+    sass: generateLoaders('sass', {
68
+      indentedSyntax: true
69
+    }),
70
+    scss: generateLoaders('sass'),
71
+    stylus: generateLoaders('stylus'),
72
+    styl: generateLoaders('stylus')
73
+  }
74
+}
75
+
76
+// Generate loaders for standalone style files (outside of .vue)
77
+exports.styleLoaders = function(options) {
78
+  const output = []
79
+  const loaders = exports.cssLoaders(options)
80
+
81
+  for (const extension in loaders) {
82
+    const loader = loaders[extension]
83
+    output.push({
84
+      test: new RegExp('\\.' + extension + '$'),
85
+      use: loader
86
+    })
87
+  }
88
+
89
+  return output
90
+}
91
+
92
+exports.createNotifierCallback = () => {
93
+  const notifier = require('node-notifier')
94
+
95
+  return (severity, errors) => {
96
+    if (severity !== 'error') return
97
+
98
+    const error = errors[0]
99
+    const filename = error.file && error.file.split('!').pop()
100
+
101
+    notifier.notify({
102
+      title: packageConfig.name,
103
+      message: severity + ': ' + error.name,
104
+      subtitle: filename || '',
105
+      icon: path.join(__dirname, 'logo.png')
106
+    })
107
+  }
108
+}

+ 5
- 0
VUECODE/smart-operate-manage/build/vue-loader.conf.js 查看文件

@@ -0,0 +1,5 @@
1
+'use strict'
2
+
3
+module.exports = {
4
+  //You can set the vue-loader configuration by yourself.
5
+}

+ 107
- 0
VUECODE/smart-operate-manage/build/webpack.base.conf.js 查看文件

@@ -0,0 +1,107 @@
1
+'use strict'
2
+const path = require('path')
3
+const utils = require('./utils')
4
+const config = require('../config')
5
+const { VueLoaderPlugin } = require('vue-loader')
6
+const vueLoaderConfig = require('./vue-loader.conf')
7
+
8
+function resolve(dir) {
9
+  return path.join(__dirname, '..', dir)
10
+}
11
+
12
+const createLintingRule = () => ({
13
+  test: /\.(js|vue)$/,
14
+  loader: 'eslint-loader',
15
+  enforce: 'pre',
16
+  include: [resolve('src'), resolve('test')],
17
+  options: {
18
+    formatter: require('eslint-friendly-formatter'),
19
+    emitWarning: !config.dev.showEslintErrorsInOverlay
20
+  }
21
+})
22
+
23
+module.exports = {
24
+  context: path.resolve(__dirname, '../'),
25
+  entry: {
26
+    app: './src/main.js'
27
+  },
28
+  output: {
29
+    path: config.build.assetsRoot,
30
+    filename: '[name].js',
31
+    publicPath:
32
+      process.env.NODE_ENV === 'production'
33
+        ? config.build.assetsPublicPath
34
+        : config.dev.assetsPublicPath
35
+  },
36
+  resolve: {
37
+    extensions: ['.js', '.vue', '.json'],
38
+    alias: {
39
+      '@': resolve('src')
40
+    }
41
+  },
42
+  module: {
43
+    rules: [
44
+      ...(config.dev.useEslint ? [createLintingRule()] : []),
45
+      {
46
+        test: /\.vue$/,
47
+        loader: 'vue-loader',
48
+        options: vueLoaderConfig
49
+      },
50
+      {
51
+        test: /\.js$/,
52
+        loader: 'babel-loader',
53
+        include: [
54
+          resolve('src'),
55
+          resolve('test'),
56
+          resolve('node_modules/webpack-dev-server/client')
57
+        ]
58
+      },
59
+      {
60
+        test: /\.svg$/,
61
+        loader: 'svg-sprite-loader',
62
+        include: [resolve('src/icons')],
63
+        options: {
64
+          symbolId: 'icon-[name]'
65
+        }
66
+      },
67
+      {
68
+        test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
69
+        loader: 'url-loader',
70
+        exclude: [resolve('src/icons')],
71
+        options: {
72
+          limit: 10000,
73
+          name: utils.assetsPath('img/[name].[hash:7].[ext]')
74
+        }
75
+      },
76
+      {
77
+        test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/,
78
+        loader: 'url-loader',
79
+        options: {
80
+          limit: 10000,
81
+          name: utils.assetsPath('media/[name].[hash:7].[ext]')
82
+        }
83
+      },
84
+      {
85
+        test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
86
+        loader: 'url-loader',
87
+        options: {
88
+          limit: 10000,
89
+          name: utils.assetsPath('fonts/[name].[hash:7].[ext]')
90
+        }
91
+      }
92
+    ]
93
+  },
94
+  plugins: [new VueLoaderPlugin()],
95
+  node: {
96
+    // prevent webpack from injecting useless setImmediate polyfill because Vue
97
+    // source contains it (although only uses it if it's native).
98
+    setImmediate: false,
99
+    // prevent webpack from injecting mocks to Node native modules
100
+    // that does not make sense for the client
101
+    dgram: 'empty',
102
+    fs: 'empty',
103
+    net: 'empty',
104
+    tls: 'empty',
105
+    child_process: 'empty'
106
+  }
107
+}

+ 95
- 0
VUECODE/smart-operate-manage/build/webpack.dev.conf.js 查看文件

@@ -0,0 +1,95 @@
1
+'use strict'
2
+const path = require('path')
3
+const utils = require('./utils')
4
+const webpack = require('webpack')
5
+const config = require('../config')
6
+const merge = require('webpack-merge')
7
+const baseWebpackConfig = require('./webpack.base.conf')
8
+const HtmlWebpackPlugin = require('html-webpack-plugin')
9
+const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin')
10
+const portfinder = require('portfinder')
11
+
12
+function resolve(dir) {
13
+  return path.join(__dirname, '..', dir)
14
+}
15
+
16
+const HOST = process.env.HOST
17
+const PORT = process.env.PORT && Number(process.env.PORT)
18
+
19
+const devWebpackConfig = merge(baseWebpackConfig, {
20
+  mode: 'development',
21
+  module: {
22
+    rules: utils.styleLoaders({
23
+      sourceMap: config.dev.cssSourceMap,
24
+      usePostCSS: true
25
+    })
26
+  },
27
+  // cheap-module-eval-source-map is faster for development
28
+  devtool: config.dev.devtool,
29
+
30
+  // these devServer options should be customized in /config/index.js
31
+  devServer: {
32
+    clientLogLevel: 'warning',
33
+    historyApiFallback: true,
34
+    hot: true,
35
+    compress: true,
36
+    host: HOST || config.dev.host,
37
+    port: PORT || config.dev.port,
38
+    open: config.dev.autoOpenBrowser,
39
+    overlay: config.dev.errorOverlay
40
+      ? { warnings: false, errors: true }
41
+      : false,
42
+    publicPath: config.dev.assetsPublicPath,
43
+    proxy: config.dev.proxyTable,
44
+    quiet: true, // necessary for FriendlyErrorsPlugin
45
+    watchOptions: {
46
+      poll: config.dev.poll
47
+    }
48
+  },
49
+  plugins: [
50
+    new webpack.DefinePlugin({
51
+      'process.env': require('../config/dev.env')
52
+    }),
53
+    new webpack.HotModuleReplacementPlugin(),
54
+    // https://github.com/ampedandwired/html-webpack-plugin
55
+    new HtmlWebpackPlugin({
56
+      filename: 'index.html',
57
+      template: 'index.html',
58
+      inject: true,
59
+      favicon: resolve('favicon.ico'),
60
+      title: 'vue-admin-template'
61
+    })
62
+  ]
63
+})
64
+
65
+module.exports = new Promise((resolve, reject) => {
66
+  portfinder.basePort = process.env.PORT || config.dev.port
67
+  portfinder.getPort((err, port) => {
68
+    if (err) {
69
+      reject(err)
70
+    } else {
71
+      // publish the new Port, necessary for e2e tests
72
+      process.env.PORT = port
73
+      // add port to devServer config
74
+      devWebpackConfig.devServer.port = port
75
+
76
+      // Add FriendlyErrorsPlugin
77
+      devWebpackConfig.plugins.push(
78
+        new FriendlyErrorsPlugin({
79
+          compilationSuccessInfo: {
80
+            messages: [
81
+              `Your application is running here: http://${
82
+                devWebpackConfig.devServer.host
83
+              }:${port}`
84
+            ]
85
+          },
86
+          onErrors: config.dev.notifyOnErrors
87
+            ? utils.createNotifierCallback()
88
+            : undefined
89
+        })
90
+      )
91
+
92
+      resolve(devWebpackConfig)
93
+    }
94
+  })
95
+})

+ 178
- 0
VUECODE/smart-operate-manage/build/webpack.prod.conf.js 查看文件

@@ -0,0 +1,178 @@
1
+'use strict'
2
+const path = require('path')
3
+const utils = require('./utils')
4
+const webpack = require('webpack')
5
+const config = require('../config')
6
+const merge = require('webpack-merge')
7
+const baseWebpackConfig = require('./webpack.base.conf')
8
+const CopyWebpackPlugin = require('copy-webpack-plugin')
9
+const HtmlWebpackPlugin = require('html-webpack-plugin')
10
+const ScriptExtHtmlWebpackPlugin = require('script-ext-html-webpack-plugin')
11
+const MiniCssExtractPlugin = require('mini-css-extract-plugin')
12
+const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin')
13
+const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
14
+
15
+function resolve(dir) {
16
+  return path.join(__dirname, '..', dir)
17
+}
18
+
19
+const env = require('../config/prod.env')
20
+
21
+// For NamedChunksPlugin
22
+const seen = new Set()
23
+const nameLength = 4
24
+
25
+const webpackConfig = merge(baseWebpackConfig, {
26
+  mode: 'production',
27
+  module: {
28
+    rules: utils.styleLoaders({
29
+      sourceMap: config.build.productionSourceMap,
30
+      extract: true,
31
+      usePostCSS: true
32
+    })
33
+  },
34
+  devtool: config.build.productionSourceMap ? config.build.devtool : false,
35
+  output: {
36
+    path: config.build.assetsRoot,
37
+    filename: utils.assetsPath('js/[name].[chunkhash:8].js'),
38
+    chunkFilename: utils.assetsPath('js/[name].[chunkhash:8].js')
39
+  },
40
+  plugins: [
41
+    // http://vuejs.github.io/vue-loader/en/workflow/production.html
42
+    new webpack.DefinePlugin({
43
+      'process.env': env
44
+    }),
45
+    // extract css into its own file
46
+    new MiniCssExtractPlugin({
47
+      filename: utils.assetsPath('css/[name].[contenthash:8].css'),
48
+      chunkFilename: utils.assetsPath('css/[name].[contenthash:8].css')
49
+    }),
50
+    // generate dist index.html with correct asset hash for caching.
51
+    // you can customize output by editing /index.html
52
+    // see https://github.com/ampedandwired/html-webpack-plugin
53
+    new HtmlWebpackPlugin({
54
+      filename: config.build.index,
55
+      template: 'index.html',
56
+      inject: true,
57
+      favicon: resolve('favicon.ico'),
58
+      title: 'vue-admin-template',
59
+      minify: {
60
+        removeComments: true,
61
+        collapseWhitespace: true,
62
+        removeAttributeQuotes: true
63
+        // more options:
64
+        // https://github.com/kangax/html-minifier#options-quick-reference
65
+      }
66
+      // default sort mode uses toposort which cannot handle cyclic deps
67
+      // in certain cases, and in webpack 4, chunk order in HTML doesn't
68
+      // matter anyway
69
+    }),
70
+    new ScriptExtHtmlWebpackPlugin({
71
+      //`runtime` must same as runtimeChunk name. default is `runtime`
72
+      inline: /runtime\..*\.js$/
73
+    }),
74
+    // keep chunk.id stable when chunk has no name
75
+    new webpack.NamedChunksPlugin(chunk => {
76
+      if (chunk.name) {
77
+        return chunk.name
78
+      }
79
+      const modules = Array.from(chunk.modulesIterable)
80
+      if (modules.length > 1) {
81
+        const hash = require('hash-sum')
82
+        const joinedHash = hash(modules.map(m => m.id).join('_'))
83
+        let len = nameLength
84
+        while (seen.has(joinedHash.substr(0, len))) len++
85
+        seen.add(joinedHash.substr(0, len))
86
+        return `chunk-${joinedHash.substr(0, len)}`
87
+      } else {
88
+        return modules[0].id
89
+      }
90
+    }),
91
+    // keep module.id stable when vender modules does not change
92
+    new webpack.HashedModuleIdsPlugin(),
93
+    // copy custom static assets
94
+    new CopyWebpackPlugin([
95
+      {
96
+        from: path.resolve(__dirname, '../static'),
97
+        to: config.build.assetsSubDirectory,
98
+        ignore: ['.*']
99
+      }
100
+    ])
101
+  ],
102
+  optimization: {
103
+    splitChunks: {
104
+      chunks: 'all',
105
+      cacheGroups: {
106
+        libs: {
107
+          name: 'chunk-libs',
108
+          test: /[\\/]node_modules[\\/]/,
109
+          priority: 10,
110
+          chunks: 'initial' // 只打包初始时依赖的第三方
111
+        },
112
+        elementUI: {
113
+          name: 'chunk-elementUI', // 单独将 elementUI 拆包
114
+          priority: 20, // 权重要大于 libs 和 app 不然会被打包进 libs 或者 app
115
+          test: /[\\/]node_modules[\\/]element-ui[\\/]/
116
+        }
117
+      }
118
+    },
119
+    runtimeChunk: 'single',
120
+    minimizer: [
121
+      new UglifyJsPlugin({
122
+        uglifyOptions: {
123
+          mangle: {
124
+            safari10: true
125
+          }
126
+        },
127
+        sourceMap: config.build.productionSourceMap,
128
+        cache: true,
129
+        parallel: true
130
+      }),
131
+      // Compress extracted CSS. We are using this plugin so that possible
132
+      // duplicated CSS from different components can be deduped.
133
+      new OptimizeCSSAssetsPlugin()
134
+    ]
135
+  }
136
+})
137
+
138
+if (config.build.productionGzip) {
139
+  const CompressionWebpackPlugin = require('compression-webpack-plugin')
140
+
141
+  webpackConfig.plugins.push(
142
+    new CompressionWebpackPlugin({
143
+      asset: '[path].gz[query]',
144
+      algorithm: 'gzip',
145
+      test: new RegExp(
146
+        '\\.(' + config.build.productionGzipExtensions.join('|') + ')$'
147
+      ),
148
+      threshold: 10240,
149
+      minRatio: 0.8
150
+    })
151
+  )
152
+}
153
+
154
+if (config.build.generateAnalyzerReport || config.build.bundleAnalyzerReport) {
155
+  const BundleAnalyzerPlugin = require('webpack-bundle-analyzer')
156
+    .BundleAnalyzerPlugin
157
+
158
+  if (config.build.bundleAnalyzerReport) {
159
+    webpackConfig.plugins.push(
160
+      new BundleAnalyzerPlugin({
161
+        analyzerPort: 8080,
162
+        generateStatsFile: false
163
+      })
164
+    )
165
+  }
166
+
167
+  if (config.build.generateAnalyzerReport) {
168
+    webpackConfig.plugins.push(
169
+      new BundleAnalyzerPlugin({
170
+        analyzerMode: 'static',
171
+        reportFilename: 'bundle-report.html',
172
+        openAnalyzer: false
173
+      })
174
+    )
175
+  }
176
+}
177
+
178
+module.exports = webpackConfig

+ 8
- 0
VUECODE/smart-operate-manage/config/dev.env.js 查看文件

@@ -0,0 +1,8 @@
1
+'use strict'
2
+const merge = require('webpack-merge')
3
+const prodEnv = require('./prod.env')
4
+
5
+module.exports = merge(prodEnv, {
6
+  NODE_ENV: '"development"',
7
+  BASE_API: '"http://localhost:8085/operate-api"',
8
+})

+ 87
- 0
VUECODE/smart-operate-manage/config/index.js 查看文件

@@ -0,0 +1,87 @@
1
+'use strict'
2
+// Template version: 1.2.6
3
+// see http://vuejs-templates.github.io/webpack for documentation.
4
+
5
+const path = require('path')
6
+
7
+module.exports = {
8
+  dev: {
9
+    // Paths
10
+    assetsSubDirectory: 'static',
11
+    assetsPublicPath: '/',
12
+    proxyTable: {
13
+    },
14
+
15
+    // Various Dev Server settings
16
+    host: 'localhost', // can be overwritten by process.env.HOST
17
+    port: 9528, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
18
+    autoOpenBrowser: true,
19
+    errorOverlay: true,
20
+    notifyOnErrors: false,
21
+    poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-
22
+
23
+    // Use Eslint Loader?
24
+    // If true, your code will be linted during bundling and
25
+    // linting errors and warnings will be shown in the console.
26
+    useEslint: true,
27
+    // If true, eslint errors and warnings will also be shown in the error overlay
28
+    // in the browser.
29
+    showEslintErrorsInOverlay: false,
30
+
31
+    /**
32
+     * Source Maps
33
+     */
34
+
35
+    // https://webpack.js.org/configuration/devtool/#development
36
+    devtool: 'cheap-source-map',
37
+
38
+    // CSS Sourcemaps off by default because relative paths are "buggy"
39
+    // with this option, according to the CSS-Loader README
40
+    // (https://github.com/webpack/css-loader#sourcemaps)
41
+    // In our experience, they generally work as expected,
42
+    // just be aware of this issue when enabling this option.
43
+    cssSourceMap: false
44
+  },
45
+
46
+  build: {
47
+    // Template for index.html
48
+    index: path.resolve(__dirname, '../dist/index.html'),
49
+
50
+    // Paths
51
+    assetsRoot: path.resolve(__dirname, '../dist'),
52
+    assetsSubDirectory: 'static',
53
+
54
+    /**
55
+     * You can set by youself according to actual condition
56
+     * You will need to set this if you plan to deploy your site under a sub path,
57
+     * for example GitHub pages. If you plan to deploy your site to https://foo.github.io/bar/,
58
+     * then assetsPublicPath should be set to "/bar/".
59
+     * In most cases please use '/' !!!
60
+     */
61
+    assetsPublicPath: '/',
62
+
63
+    /**
64
+     * Source Maps
65
+     */
66
+
67
+    productionSourceMap: false,
68
+    // https://webpack.js.org/configuration/devtool/#production
69
+    devtool: 'source-map',
70
+
71
+    // Gzip off by default as many popular static hosts such as
72
+    // Surge or Netlify already gzip all static assets for you.
73
+    // Before setting to `true`, make sure to:
74
+    // npm install --save-dev compression-webpack-plugin
75
+    productionGzip: false,
76
+    productionGzipExtensions: ['js', 'css'],
77
+
78
+    // Run the build command with an extra argument to
79
+    // View the bundle analyzer report after build finishes:
80
+    // `npm run build --report`
81
+    // Set to `true` or `false` to always turn it on or off
82
+    bundleAnalyzerReport: process.env.npm_config_report || false,
83
+
84
+    // `npm run build:prod --generate_report`
85
+    generateAnalyzerReport: process.env.npm_config_generate_report || false
86
+  }
87
+}

+ 5
- 0
VUECODE/smart-operate-manage/config/prod.env.js 查看文件

@@ -0,0 +1,5 @@
1
+'use strict'
2
+module.exports = {
3
+  NODE_ENV: '"production"',
4
+  BASE_API: '"https://easy-mock.com/mock/5950a2419adc231f356a6636/vue-admin"',
5
+}

二进制
VUECODE/smart-operate-manage/favicon.ico 查看文件


+ 12
- 0
VUECODE/smart-operate-manage/index.html 查看文件

@@ -0,0 +1,12 @@
1
+<!DOCTYPE html>
2
+<html>
3
+  <head>
4
+    <meta charset="utf-8">
5
+    <meta name="viewport" content="width=device-width,initial-scale=1.0">
6
+    <title>vue-admin-template</title>
7
+  </head>
8
+  <body>
9
+    <div id="app"></div>
10
+    <!-- built files will be auto injected -->
11
+  </body>
12
+</html>

+ 88
- 0
VUECODE/smart-operate-manage/package.json 查看文件

@@ -0,0 +1,88 @@
1
+{
2
+  "name": "vue-admin-template",
3
+  "version": "3.8.0",
4
+  "license": "MIT",
5
+  "description": "A vue admin template with Element UI & axios & iconfont & permission control & lint",
6
+  "author": "Pan <panfree23@gmail.com>",
7
+  "scripts": {
8
+    "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
9
+    "start": "npm run dev",
10
+    "build": "node build/build.js",
11
+    "build:report": "npm_config_report=true npm run build",
12
+    "lint": "eslint --ext .js,.vue src",
13
+    "test": "npm run lint",
14
+    "svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml"
15
+  },
16
+  "dependencies": {
17
+    "axios": "0.18.0",
18
+    "element-ui": "2.4.6",
19
+    "file-saver": "^2.0.0-rc.4",
20
+    "js-cookie": "2.2.0",
21
+    "normalize.css": "7.0.0",
22
+    "nprogress": "0.2.0",
23
+    "vue": "2.5.17",
24
+    "vue-router": "3.0.1",
25
+    "vuex": "3.0.1",
26
+    "xlsx": "^0.14.0"
27
+  },
28
+  "devDependencies": {
29
+    "autoprefixer": "8.5.0",
30
+    "babel-core": "6.26.0",
31
+    "babel-eslint": "8.2.6",
32
+    "babel-helper-vue-jsx-merge-props": "2.0.3",
33
+    "babel-loader": "7.1.5",
34
+    "babel-plugin-syntax-jsx": "6.18.0",
35
+    "babel-plugin-transform-runtime": "6.23.0",
36
+    "babel-plugin-transform-vue-jsx": "3.7.0",
37
+    "babel-preset-env": "1.7.0",
38
+    "babel-preset-stage-2": "6.24.1",
39
+    "chalk": "2.4.1",
40
+    "copy-webpack-plugin": "4.5.2",
41
+    "css-loader": "1.0.0",
42
+    "eslint": "4.19.1",
43
+    "eslint-friendly-formatter": "4.0.1",
44
+    "eslint-loader": "2.0.0",
45
+    "eslint-plugin-vue": "4.7.1",
46
+    "eventsource-polyfill": "0.9.6",
47
+    "file-loader": "1.1.11",
48
+    "friendly-errors-webpack-plugin": "1.7.0",
49
+    "html-webpack-plugin": "4.0.0-alpha",
50
+    "mini-css-extract-plugin": "0.4.1",
51
+    "node-notifier": "5.2.1",
52
+    "node-sass": "^4.7.2",
53
+    "optimize-css-assets-webpack-plugin": "5.0.0",
54
+    "ora": "3.0.0",
55
+    "path-to-regexp": "2.4.0",
56
+    "portfinder": "1.0.16",
57
+    "postcss-import": "12.0.0",
58
+    "postcss-loader": "2.1.6",
59
+    "postcss-url": "7.3.2",
60
+    "rimraf": "2.6.2",
61
+    "sass-loader": "7.0.3",
62
+    "script-ext-html-webpack-plugin": "2.0.1",
63
+    "script-loader": "^0.7.2",
64
+    "semver": "5.5.0",
65
+    "shelljs": "0.8.2",
66
+    "svg-sprite-loader": "3.8.0",
67
+    "svgo": "1.0.5",
68
+    "uglifyjs-webpack-plugin": "1.2.7",
69
+    "url-loader": "1.0.1",
70
+    "vue-loader": "15.3.0",
71
+    "vue-style-loader": "4.1.2",
72
+    "vue-template-compiler": "2.5.17",
73
+    "webpack": "4.16.5",
74
+    "webpack-bundle-analyzer": "2.13.1",
75
+    "webpack-cli": "3.1.0",
76
+    "webpack-dev-server": "3.1.5",
77
+    "webpack-merge": "4.1.4"
78
+  },
79
+  "engines": {
80
+    "node": ">= 6.0.0",
81
+    "npm": ">= 3.0.0"
82
+  },
83
+  "browserslist": [
84
+    "> 1%",
85
+    "last 2 versions",
86
+    "not ie <= 8"
87
+  ]
88
+}

+ 11
- 0
VUECODE/smart-operate-manage/src/App.vue 查看文件

@@ -0,0 +1,11 @@
1
+<template>
2
+  <div id="app">
3
+    <router-view/>
4
+  </div>
5
+</template>
6
+
7
+<script>
8
+export default {
9
+  name: 'App'
10
+}
11
+</script>

+ 37
- 0
VUECODE/smart-operate-manage/src/api/banner.js 查看文件

@@ -0,0 +1,37 @@
1
+import request from '@/utils/request'
2
+
3
+export function getBanner(banner) {
4
+  return request({
5
+    url: '/banner/list',
6
+    method: 'get',
7
+    params: banner
8
+  })
9
+}
10
+
11
+export function addBanner(banner) {
12
+  return request({
13
+    url: '/banner',
14
+    method: 'post',
15
+    data: banner
16
+  })
17
+}
18
+
19
+export function updateArticle(...banner) {
20
+  return request({
21
+    url: '/banner/list',
22
+    method: 'get',
23
+    params: {
24
+      ...banner
25
+    }
26
+  })
27
+}
28
+
29
+export function fetchPv(...banner) {
30
+  return request({
31
+    url: '/banner/list',
32
+    method: 'get',
33
+    params: {
34
+      ...banner
35
+    }
36
+  })
37
+}

+ 25
- 0
VUECODE/smart-operate-manage/src/api/community.js 查看文件

@@ -0,0 +1,25 @@
1
+import request from '@/utils/request'
2
+
3
+export function fetchList(query) {
4
+  return request({
5
+    url: '/communitys',
6
+    method: 'get',
7
+    params: query
8
+  })
9
+}
10
+
11
+export function createCommunity(data) {
12
+  return request({
13
+    url: '/community/add',
14
+    method: 'post',
15
+    data
16
+  })
17
+}
18
+
19
+export function updateCommunity(data) {
20
+  return request({
21
+    url: '/community/update',
22
+    method: 'post',
23
+    data
24
+  })
25
+}

+ 38
- 0
VUECODE/smart-operate-manage/src/api/login.js 查看文件

@@ -0,0 +1,38 @@
1
+import request from '@/utils/request'
2
+
3
+export function login(username, password) {
4
+  const config = {
5
+    url: '/user/login',
6
+    method: 'post',
7
+    data: {
8
+      'loginName': username,
9
+      'code': password
10
+    }
11
+  }
12
+
13
+  return request(config)
14
+}
15
+
16
+export function getInfo() {
17
+  return request({
18
+    url: '/user/info',
19
+    method: 'get'
20
+    // params: { token }
21
+  })
22
+}
23
+
24
+export function logout() {
25
+  return request({
26
+    url: '/user/logout',
27
+    method: 'post'
28
+  })
29
+}
30
+
31
+// 发送验证码
32
+export function sendCode(phone) {
33
+  return request({
34
+    url: '/code/sendCode',
35
+    method: 'post',
36
+    params: { phone }
37
+  })
38
+}

+ 9
- 0
VUECODE/smart-operate-manage/src/api/table.js 查看文件

@@ -0,0 +1,9 @@
1
+import request from '@/utils/request'
2
+
3
+export function getList(params) {
4
+  return request({
5
+    url: '/banner/list',
6
+    method: 'get',
7
+    params
8
+  })
9
+}

二进制
VUECODE/smart-operate-manage/src/assets/404_images/404.png 查看文件


二进制
VUECODE/smart-operate-manage/src/assets/404_images/404_cloud.png 查看文件


+ 61
- 0
VUECODE/smart-operate-manage/src/components/Breadcrumb/index.vue 查看文件

@@ -0,0 +1,61 @@
1
+<template>
2
+  <el-breadcrumb class="app-breadcrumb" separator="/">
3
+    <transition-group name="breadcrumb">
4
+      <el-breadcrumb-item v-for="(item,index) in levelList" v-if="item.meta.title" :key="item.path">
5
+        <span v-if="item.redirect==='noredirect'||index==levelList.length-1" class="no-redirect">{{ item.meta.title }}</span>
6
+        <router-link v-else :to="item.redirect||item.path">{{ item.meta.title }}</router-link>
7
+      </el-breadcrumb-item>
8
+    </transition-group>
9
+  </el-breadcrumb>
10
+</template>
11
+
12
+<script>
13
+import pathToRegexp from 'path-to-regexp'
14
+
15
+export default {
16
+  data() {
17
+    return {
18
+      levelList: null
19
+    }
20
+  },
21
+  watch: {
22
+    $route() {
23
+      this.getBreadcrumb()
24
+    }
25
+  },
26
+  created() {
27
+    this.getBreadcrumb()
28
+  },
29
+  methods: {
30
+    getBreadcrumb() {
31
+      const { params } = this.$route
32
+      let matched = this.$route.matched.filter(item => {
33
+        if (item.name) {
34
+          // To solve this problem https://github.com/PanJiaChen/vue-element-admin/issues/561
35
+          var toPath = pathToRegexp.compile(item.path)
36
+          item.path = toPath(params)
37
+          return true
38
+        }
39
+      })
40
+      const first = matched[0]
41
+      if (first && first.name !== 'dashboard') {
42
+        matched = [{ path: '/dashboard', meta: { title: 'Dashboard' }}].concat(matched)
43
+      }
44
+      this.levelList = matched
45
+    }
46
+  }
47
+}
48
+</script>
49
+
50
+<style rel="stylesheet/scss" lang="scss" scoped>
51
+  .app-breadcrumb.el-breadcrumb {
52
+    display: inline-block;
53
+    font-size: 14px;
54
+    line-height: 50px;
55
+    margin-left: 10px;
56
+    .no-redirect {
57
+      color: #97a8be;
58
+      cursor: text;
59
+    }
60
+  }
61
+</style>

+ 58
- 0
VUECODE/smart-operate-manage/src/components/Hamburger/index.vue 查看文件

@@ -0,0 +1,58 @@
1
+<template>
2
+  <div>
3
+    <svg
4
+      :class="{'is-active':isActive}"
5
+      t="1492500959545"
6
+      class="hamburger"
7
+      style=""
8
+      viewBox="0 0 1024 1024"
9
+      version="1.1"
10
+      xmlns="http://www.w3.org/2000/svg"
11
+      p-id="1691"
12
+      xmlns:xlink="http://www.w3.org/1999/xlink"
13
+      width="64"
14
+      height="64"
15
+      @click="toggleClick">
16
+      <path
17
+        d="M966.8023 568.849776 57.196677 568.849776c-31.397081 0-56.850799-25.452695-56.850799-56.850799l0 0c0-31.397081 25.452695-56.849776 56.850799-56.849776l909.605623 0c31.397081 0 56.849776 25.452695 56.849776 56.849776l0 0C1023.653099 543.397081 998.200404 568.849776 966.8023 568.849776z"
18
+        p-id="1692" />
19
+      <path
20
+        d="M966.8023 881.527125 57.196677 881.527125c-31.397081 0-56.850799-25.452695-56.850799-56.849776l0 0c0-31.397081 25.452695-56.849776 56.850799-56.849776l909.605623 0c31.397081 0 56.849776 25.452695 56.849776 56.849776l0 0C1023.653099 856.07443 998.200404 881.527125 966.8023 881.527125z"
21
+        p-id="1693" />
22
+      <path
23
+        d="M966.8023 256.17345 57.196677 256.17345c-31.397081 0-56.850799-25.452695-56.850799-56.849776l0 0c0-31.397081 25.452695-56.850799 56.850799-56.850799l909.605623 0c31.397081 0 56.849776 25.452695 56.849776 56.850799l0 0C1023.653099 230.720755 998.200404 256.17345 966.8023 256.17345z"
24
+        p-id="1694" />
25
+    </svg>
26
+  </div>
27
+</template>
28
+
29
+<script>
30
+export default {
31
+  name: 'Hamburger',
32
+  props: {
33
+    isActive: {
34
+      type: Boolean,
35
+      default: false
36
+    },
37
+    toggleClick: {
38
+      type: Function,
39
+      default: null
40
+    }
41
+  }
42
+}
43
+</script>
44
+
45
+<style scoped>
46
+.hamburger {
47
+	display: inline-block;
48
+	cursor: pointer;
49
+	width: 20px;
50
+	height: 20px;
51
+	transform: rotate(90deg);
52
+	transition: .38s;
53
+	transform-origin: 50% 50%;
54
+}
55
+.hamburger.is-active {
56
+	transform: rotate(0deg);
57
+}
58
+</style>

+ 99
- 0
VUECODE/smart-operate-manage/src/components/Pagination/index.vue 查看文件

@@ -0,0 +1,99 @@
1
+<template>
2
+  <div :class="{'hidden':hidden}" class="pagination-container">
3
+    <el-pagination
4
+      :background="background"
5
+      :current-page.sync="currentPage"
6
+      :page-size.sync="pageSize"
7
+      :layout="layout"
8
+      :total="total"
9
+      v-bind="$attrs"
10
+      @size-change="handleSizeChange"
11
+      @current-change="handleCurrentChange"/>
12
+  </div>
13
+</template>
14
+
15
+<script>
16
+import { scrollTo } from '@/utils/scrollTo'
17
+
18
+export default {
19
+  name: 'Pagination',
20
+  props: {
21
+    total: {
22
+      required: true,
23
+      type: Number
24
+    },
25
+    page: {
26
+      type: Number,
27
+      default: 1
28
+    },
29
+    limit: {
30
+      type: Number,
31
+      default: 20
32
+    },
33
+    pageSizes: {
34
+      type: Array,
35
+      default() {
36
+        return [10, 20, 30, 50]
37
+      }
38
+    },
39
+    layout: {
40
+      type: String,
41
+      default: 'total, sizes, prev, pager, next, jumper'
42
+    },
43
+    background: {
44
+      type: Boolean,
45
+      default: true
46
+    },
47
+    autoScroll: {
48
+      type: Boolean,
49
+      default: true
50
+    },
51
+    hidden: {
52
+      type: Boolean,
53
+      default: false
54
+    }
55
+  },
56
+  computed: {
57
+    currentPage: {
58
+      get() {
59
+        return this.page
60
+      },
61
+      set(val) {
62
+        this.$emit('update:page', val)
63
+      }
64
+    },
65
+    pageSize: {
66
+      get() {
67
+        return this.limit
68
+      },
69
+      set(val) {
70
+        this.$emit('update:limit', val)
71
+      }
72
+    }
73
+  },
74
+  methods: {
75
+    handleSizeChange(val) {
76
+      this.$emit('pagination', { page: this.currentPage, limit: val })
77
+      if (this.autoScroll) {
78
+        scrollTo(0, 800)
79
+      }
80
+    },
81
+    handleCurrentChange(val) {
82
+      this.$emit('pagination', { page: val, limit: this.pageSize })
83
+      if (this.autoScroll) {
84
+        scrollTo(0, 800)
85
+      }
86
+    }
87
+  }
88
+}
89
+</script>
90
+
91
+<style scoped>
92
+.pagination-container {
93
+  background: #fff;
94
+  padding: 32px 16px;
95
+}
96
+.pagination-container.hidden {
97
+  display: none;
98
+}
99
+</style>

+ 43
- 0
VUECODE/smart-operate-manage/src/components/SvgIcon/index.vue 查看文件

@@ -0,0 +1,43 @@
1
+<template>
2
+  <svg :class="svgClass" aria-hidden="true">
3
+    <use :xlink:href="iconName"/>
4
+  </svg>
5
+</template>
6
+
7
+<script>
8
+export default {
9
+  name: 'SvgIcon',
10
+  props: {
11
+    iconClass: {
12
+      type: String,
13
+      required: true
14
+    },
15
+    className: {
16
+      type: String,
17
+      default: ''
18
+    }
19
+  },
20
+  computed: {
21
+    iconName() {
22
+      return `#icon-${this.iconClass}`
23
+    },
24
+    svgClass() {
25
+      if (this.className) {
26
+        return 'svg-icon ' + this.className
27
+      } else {
28
+        return 'svg-icon'
29
+      }
30
+    }
31
+  }
32
+}
33
+</script>
34
+
35
+<style scoped>
36
+.svg-icon {
37
+  width: 1em;
38
+  height: 1em;
39
+  vertical-align: -0.15em;
40
+  fill: currentColor;
41
+  overflow: hidden;
42
+}
43
+</style>

+ 49
- 0
VUECODE/smart-operate-manage/src/directive/clipboard/clipboard.js 查看文件

@@ -0,0 +1,49 @@
1
+// Inspired by https://github.com/Inndy/vue-clipboard2
2
+const Clipboard = require('clipboard')
3
+if (!Clipboard) {
4
+  throw new Error('you should npm install `clipboard` --save at first ')
5
+}
6
+
7
+export default {
8
+  bind(el, binding) {
9
+    if (binding.arg === 'success') {
10
+      el._v_clipboard_success = binding.value
11
+    } else if (binding.arg === 'error') {
12
+      el._v_clipboard_error = binding.value
13
+    } else {
14
+      const clipboard = new Clipboard(el, {
15
+        text() { return binding.value },
16
+        action() { return binding.arg === 'cut' ? 'cut' : 'copy' }
17
+      })
18
+      clipboard.on('success', e => {
19
+        const callback = el._v_clipboard_success
20
+        callback && callback(e) // eslint-disable-line
21
+      })
22
+      clipboard.on('error', e => {
23
+        const callback = el._v_clipboard_error
24
+        callback && callback(e) // eslint-disable-line
25
+      })
26
+      el._v_clipboard = clipboard
27
+    }
28
+  },
29
+  update(el, binding) {
30
+    if (binding.arg === 'success') {
31
+      el._v_clipboard_success = binding.value
32
+    } else if (binding.arg === 'error') {
33
+      el._v_clipboard_error = binding.value
34
+    } else {
35
+      el._v_clipboard.text = function() { return binding.value }
36
+      el._v_clipboard.action = function() { return binding.arg === 'cut' ? 'cut' : 'copy' }
37
+    }
38
+  },
39
+  unbind(el, binding) {
40
+    if (binding.arg === 'success') {
41
+      delete el._v_clipboard_success
42
+    } else if (binding.arg === 'error') {
43
+      delete el._v_clipboard_error
44
+    } else {
45
+      el._v_clipboard.destroy()
46
+      delete el._v_clipboard
47
+    }
48
+  }
49
+}

+ 13
- 0
VUECODE/smart-operate-manage/src/directive/clipboard/index.js 查看文件

@@ -0,0 +1,13 @@
1
+import Clipboard from './clipboard'
2
+
3
+const install = function(Vue) {
4
+  Vue.directive('Clipboard', Clipboard)
5
+}
6
+
7
+if (window.Vue) {
8
+  window.clipboard = Clipboard
9
+  Vue.use(install); // eslint-disable-line
10
+}
11
+
12
+Clipboard.install = install
13
+export default Clipboard

+ 77
- 0
VUECODE/smart-operate-manage/src/directive/el-dragDialog/drag.js 查看文件

@@ -0,0 +1,77 @@
1
+export default{
2
+  bind(el, binding, vnode) {
3
+    const dialogHeaderEl = el.querySelector('.el-dialog__header')
4
+    const dragDom = el.querySelector('.el-dialog')
5
+    dialogHeaderEl.style.cssText += ';cursor:move;'
6
+    dragDom.style.cssText += ';top:0px;'
7
+
8
+    // 获取原有属性 ie dom元素.currentStyle 火狐谷歌 window.getComputedStyle(dom元素, null);
9
+    const getStyle = (function() {
10
+      if (window.document.currentStyle) {
11
+        return (dom, attr) => dom.currentStyle[attr]
12
+      } else {
13
+        return (dom, attr) => getComputedStyle(dom, false)[attr]
14
+      }
15
+    })()
16
+
17
+    dialogHeaderEl.onmousedown = (e) => {
18
+      // 鼠标按下,计算当前元素距离可视区的距离
19
+      const disX = e.clientX - dialogHeaderEl.offsetLeft
20
+      const disY = e.clientY - dialogHeaderEl.offsetTop
21
+
22
+      const dragDomWidth = dragDom.offsetWidth
23
+      const dragDomHeight = dragDom.offsetHeight
24
+
25
+      const screenWidth = document.body.clientWidth
26
+      const screenHeight = document.body.clientHeight
27
+
28
+      const minDragDomLeft = dragDom.offsetLeft
29
+      const maxDragDomLeft = screenWidth - dragDom.offsetLeft - dragDomWidth
30
+
31
+      const minDragDomTop = dragDom.offsetTop
32
+      const maxDragDomTop = screenHeight - dragDom.offsetTop - dragDomHeight
33
+
34
+      // 获取到的值带px 正则匹配替换
35
+      let styL = getStyle(dragDom, 'left')
36
+      let styT = getStyle(dragDom, 'top')
37
+
38
+      if (styL.includes('%')) {
39
+        styL = +document.body.clientWidth * (+styL.replace(/\%/g, '') / 100)
40
+        styT = +document.body.clientHeight * (+styT.replace(/\%/g, '') / 100)
41
+      } else {
42
+        styL = +styL.replace(/\px/g, '')
43
+        styT = +styT.replace(/\px/g, '')
44
+      }
45
+
46
+      document.onmousemove = function(e) {
47
+        // 通过事件委托,计算移动的距离
48
+        let left = e.clientX - disX
49
+        let top = e.clientY - disY
50
+
51
+        // 边界处理
52
+        if (-(left) > minDragDomLeft) {
53
+          left = -minDragDomLeft
54
+        } else if (left > maxDragDomLeft) {
55
+          left = maxDragDomLeft
56
+        }
57
+
58
+        if (-(top) > minDragDomTop) {
59
+          top = -minDragDomTop
60
+        } else if (top > maxDragDomTop) {
61
+          top = maxDragDomTop
62
+        }
63
+
64
+        // 移动当前元素
65
+        dragDom.style.cssText += `;left:${left + styL}px;top:${top + styT}px;`
66
+
67
+        // emit onDrag event
68
+        vnode.child.$emit('dragDialog')
69
+      }
70
+
71
+      document.onmouseup = function(e) {
72
+        document.onmousemove = null
73
+        document.onmouseup = null
74
+      }
75
+    }
76
+  }
77
+}

+ 13
- 0
VUECODE/smart-operate-manage/src/directive/el-dragDialog/index.js 查看文件

@@ -0,0 +1,13 @@
1
+import drag from './drag'
2
+
3
+const install = function(Vue) {
4
+  Vue.directive('el-drag-dialog', drag)
5
+}
6
+
7
+if (window.Vue) {
8
+  window['el-drag-dialog'] = drag
9
+  Vue.use(install); // eslint-disable-line
10
+}
11
+
12
+drag.install = install
13
+export default drag

+ 13
- 0
VUECODE/smart-operate-manage/src/directive/permission/index.js 查看文件

@@ -0,0 +1,13 @@
1
+import permission from './permission'
2
+
3
+const install = function(Vue) {
4
+  Vue.directive('permission', permission)
5
+}
6
+
7
+if (window.Vue) {
8
+  window['permission'] = permission
9
+  Vue.use(install); // eslint-disable-line
10
+}
11
+
12
+permission.install = install
13
+export default permission

+ 23
- 0
VUECODE/smart-operate-manage/src/directive/permission/permission.js 查看文件

@@ -0,0 +1,23 @@
1
+
2
+import store from '@/store'
3
+
4
+export default{
5
+  inserted(el, binding, vnode) {
6
+    const { value } = binding
7
+    const roles = store.getters && store.getters.roles
8
+
9
+    if (value && value instanceof Array && value.length > 0) {
10
+      const permissionRoles = value
11
+
12
+      const hasPermission = roles.some(role => {
13
+        return permissionRoles.includes(role)
14
+      })
15
+
16
+      if (!hasPermission) {
17
+        el.parentNode && el.parentNode.removeChild(el)
18
+      }
19
+    } else {
20
+      throw new Error(`need roles! Like v-permission="['admin','editor']"`)
21
+    }
22
+  }
23
+}

+ 91
- 0
VUECODE/smart-operate-manage/src/directive/sticky.js 查看文件

@@ -0,0 +1,91 @@
1
+const vueSticky = {}
2
+let listenAction
3
+vueSticky.install = Vue => {
4
+  Vue.directive('sticky', {
5
+    inserted(el, binding) {
6
+      const params = binding.value || {}
7
+      const stickyTop = params.stickyTop || 0
8
+      const zIndex = params.zIndex || 1000
9
+      const elStyle = el.style
10
+
11
+      elStyle.position = '-webkit-sticky'
12
+      elStyle.position = 'sticky'
13
+      // if the browser support css sticky(Currently Safari, Firefox and Chrome Canary)
14
+      // if (~elStyle.position.indexOf('sticky')) {
15
+      //     elStyle.top = `${stickyTop}px`;
16
+      //     elStyle.zIndex = zIndex;
17
+      //     return
18
+      // }
19
+      const elHeight = el.getBoundingClientRect().height
20
+      const elWidth = el.getBoundingClientRect().width
21
+      elStyle.cssText = `top: ${stickyTop}px; z-index: ${zIndex}`
22
+
23
+      const parentElm = el.parentNode || document.documentElement
24
+      const placeholder = document.createElement('div')
25
+      placeholder.style.display = 'none'
26
+      placeholder.style.width = `${elWidth}px`
27
+      placeholder.style.height = `${elHeight}px`
28
+      parentElm.insertBefore(placeholder, el)
29
+
30
+      let active = false
31
+
32
+      const getScroll = (target, top) => {
33
+        const prop = top ? 'pageYOffset' : 'pageXOffset'
34
+        const method = top ? 'scrollTop' : 'scrollLeft'
35
+        let ret = target[prop]
36
+        if (typeof ret !== 'number') {
37
+          ret = window.document.documentElement[method]
38
+        }
39
+        return ret
40
+      }
41
+
42
+      const sticky = () => {
43
+        if (active) {
44
+          return
45
+        }
46
+        if (!elStyle.height) {
47
+          elStyle.height = `${el.offsetHeight}px`
48
+        }
49
+
50
+        elStyle.position = 'fixed'
51
+        elStyle.width = `${elWidth}px`
52
+        placeholder.style.display = 'inline-block'
53
+        active = true
54
+      }
55
+
56
+      const reset = () => {
57
+        if (!active) {
58
+          return
59
+        }
60
+
61
+        elStyle.position = ''
62
+        placeholder.style.display = 'none'
63
+        active = false
64
+      }
65
+
66
+      const check = () => {
67
+        const scrollTop = getScroll(window, true)
68
+        const offsetTop = el.getBoundingClientRect().top
69
+        if (offsetTop < stickyTop) {
70
+          sticky()
71
+        } else {
72
+          if (scrollTop < elHeight + stickyTop) {
73
+            reset()
74
+          }
75
+        }
76
+      }
77
+      listenAction = () => {
78
+        check()
79
+      }
80
+
81
+      window.addEventListener('scroll', listenAction)
82
+    },
83
+
84
+    unbind() {
85
+      window.removeEventListener('scroll', listenAction)
86
+    }
87
+  })
88
+}
89
+
90
+export default vueSticky
91
+

+ 13
- 0
VUECODE/smart-operate-manage/src/directive/waves/index.js 查看文件

@@ -0,0 +1,13 @@
1
+import waves from './waves'
2
+
3
+const install = function(Vue) {
4
+  Vue.directive('waves', waves)
5
+}
6
+
7
+if (window.Vue) {
8
+  window.waves = waves
9
+  Vue.use(install); // eslint-disable-line
10
+}
11
+
12
+waves.install = install
13
+export default waves

+ 26
- 0
VUECODE/smart-operate-manage/src/directive/waves/waves.css 查看文件

@@ -0,0 +1,26 @@
1
+.waves-ripple {
2
+    position: absolute;
3
+    border-radius: 100%;
4
+    background-color: rgba(0, 0, 0, 0.15);
5
+    background-clip: padding-box;
6
+    pointer-events: none;
7
+    -webkit-user-select: none;
8
+    -moz-user-select: none;
9
+    -ms-user-select: none;
10
+    user-select: none;
11
+    -webkit-transform: scale(0);
12
+    -ms-transform: scale(0);
13
+    transform: scale(0);
14
+    opacity: 1;
15
+}
16
+
17
+.waves-ripple.z-active {
18
+    opacity: 0;
19
+    -webkit-transform: scale(2);
20
+    -ms-transform: scale(2);
21
+    transform: scale(2);
22
+    -webkit-transition: opacity 1.2s ease-out, -webkit-transform 0.6s ease-out;
23
+    transition: opacity 1.2s ease-out, -webkit-transform 0.6s ease-out;
24
+    transition: opacity 1.2s ease-out, transform 0.6s ease-out;
25
+    transition: opacity 1.2s ease-out, transform 0.6s ease-out, -webkit-transform 0.6s ease-out;
26
+}

+ 42
- 0
VUECODE/smart-operate-manage/src/directive/waves/waves.js 查看文件

@@ -0,0 +1,42 @@
1
+import './waves.css'
2
+
3
+export default{
4
+  bind(el, binding) {
5
+    el.addEventListener('click', e => {
6
+      const customOpts = Object.assign({}, binding.value)
7
+      const opts = Object.assign({
8
+        ele: el, // 波纹作用元素
9
+        type: 'hit', // hit 点击位置扩散 center中心点扩展
10
+        color: 'rgba(0, 0, 0, 0.15)' // 波纹颜色
11
+      }, customOpts)
12
+      const target = opts.ele
13
+      if (target) {
14
+        target.style.position = 'relative'
15
+        target.style.overflow = 'hidden'
16
+        const rect = target.getBoundingClientRect()
17
+        let ripple = target.querySelector('.waves-ripple')
18
+        if (!ripple) {
19
+          ripple = document.createElement('span')
20
+          ripple.className = 'waves-ripple'
21
+          ripple.style.height = ripple.style.width = Math.max(rect.width, rect.height) + 'px'
22
+          target.appendChild(ripple)
23
+        } else {
24
+          ripple.className = 'waves-ripple'
25
+        }
26
+        switch (opts.type) {
27
+          case 'center':
28
+            ripple.style.top = (rect.height / 2 - ripple.offsetHeight / 2) + 'px'
29
+            ripple.style.left = (rect.width / 2 - ripple.offsetWidth / 2) + 'px'
30
+            break
31
+          default:
32
+            ripple.style.top = (e.pageY - rect.top - ripple.offsetHeight / 2 - document.documentElement.scrollTop || document.body.scrollTop) + 'px'
33
+            ripple.style.left = (e.pageX - rect.left - ripple.offsetWidth / 2 - document.documentElement.scrollLeft || document.body.scrollLeft) + 'px'
34
+        }
35
+        ripple.style.backgroundColor = opts.color
36
+        ripple.className = 'waves-ripple z-active'
37
+        return false
38
+      }
39
+    }, false)
40
+  }
41
+}
42
+

+ 9
- 0
VUECODE/smart-operate-manage/src/icons/index.js 查看文件

@@ -0,0 +1,9 @@
1
+import Vue from 'vue'
2
+import SvgIcon from '@/components/SvgIcon' // svg组件
3
+
4
+// register globally
5
+Vue.component('svg-icon', SvgIcon)
6
+
7
+const requireAll = requireContext => requireContext.keys().map(requireContext)
8
+const req = require.context('./svg', false, /\.svg$/)
9
+requireAll(req)

+ 1
- 0
VUECODE/smart-operate-manage/src/icons/svg/example.svg 查看文件

@@ -0,0 +1 @@
1
+<svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M96.258 57.462h31.421C124.794 27.323 100.426 2.956 70.287.07v31.422a32.856 32.856 0 0 1 25.971 25.97zm-38.796-25.97V.07C27.323 2.956 2.956 27.323.07 57.462h31.422a32.856 32.856 0 0 1 25.97-25.97zm12.825 64.766v31.421c30.46-2.885 54.507-27.253 57.713-57.712H96.579c-2.886 13.466-13.146 23.726-26.292 26.291zM31.492 70.287H.07c2.886 30.46 27.253 54.507 57.713 57.713V96.579c-13.466-2.886-23.726-13.146-26.291-26.292z"/></svg>

+ 1
- 0
VUECODE/smart-operate-manage/src/icons/svg/eye.svg 查看文件

@@ -0,0 +1 @@
1
+<svg width="128" height="64" xmlns="http://www.w3.org/2000/svg"><path d="M127.072 7.994c1.37-2.208.914-5.152-.914-6.87-2.056-1.717-4.797-1.226-6.396.982-.229.245-25.586 32.382-55.74 32.382-29.24 0-55.74-32.382-55.968-32.627-1.6-1.963-4.57-2.208-6.397-.49C-.17 3.086-.399 6.275 1.2 8.238c.457.736 5.94 7.36 14.62 14.72L4.17 35.96c-1.828 1.963-1.6 5.152.228 6.87.457.98 1.6 1.471 2.742 1.471s2.284-.49 3.198-1.472l12.564-13.983c5.94 4.416 13.021 8.587 20.788 11.53l-4.797 17.418c-.685 2.699.686 5.397 3.198 6.133h1.37c2.057 0 3.884-1.472 4.341-3.68L52.6 42.83c3.655.736 7.538 1.227 11.422 1.227 3.883 0 7.767-.49 11.422-1.227l4.797 17.173c.457 2.208 2.513 3.68 4.34 3.68.457 0 .914 0 1.143-.246 2.513-.736 3.883-3.434 3.198-6.133l-4.797-17.172c7.767-2.944 14.848-7.114 20.788-11.53l12.336 13.738c.913.981 2.056 1.472 3.198 1.472s2.284-.49 3.198-1.472c1.828-1.963 1.828-4.906.228-6.87l-11.65-13.001c9.366-7.36 14.849-14.474 14.849-14.474z"/></svg>

+ 0
- 0
VUECODE/smart-operate-manage/src/icons/svg/form.svg 查看文件


部分文件因为文件数量过多而无法显示