dingxin 6 年前
父节点
当前提交
56cf4026e6

+ 30
- 8
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/MonitoringController.java 查看文件

8
 import io.swagger.annotations.ApiOperation;
8
 import io.swagger.annotations.ApiOperation;
9
 import org.springframework.beans.factory.annotation.Autowired;
9
 import org.springframework.beans.factory.annotation.Autowired;
10
 import org.springframework.cloud.context.config.annotation.RefreshScope;
10
 import org.springframework.cloud.context.config.annotation.RefreshScope;
11
-import org.springframework.web.bind.annotation.PathVariable;
12
-import org.springframework.web.bind.annotation.RequestMapping;
13
-import org.springframework.web.bind.annotation.RequestMethod;
14
-import org.springframework.web.bind.annotation.RestController;
11
+import org.springframework.web.bind.annotation.*;
15
 
12
 
16
 import javax.servlet.http.HttpSession;
13
 import javax.servlet.http.HttpSession;
17
 
14
 
30
 
27
 
31
     @ApiOperation(value = "获取监控列表数据",notes = "根据小区ID获取")
28
     @ApiOperation(value = "获取监控列表数据",notes = "根据小区ID获取")
32
     @ApiImplicitParams({
29
     @ApiImplicitParams({
33
-            @ApiImplicitParam(paramType = "path",dataType = "Integer",name = "communityId",value = "小区ID")
30
+            @ApiImplicitParam(paramType = "path",dataType = "Integer",name = "communityId",value = "小区ID"),
31
+            @ApiImplicitParam(paramType = "query",dataType = "Integer",name = "pageNo",value = "第几页"),
32
+            @ApiImplicitParam(paramType = "query",dataType = "Integer",name = "pageSize",value = "一页多少行")
34
     })
33
     })
35
-    @RequestMapping(value = "/monitoring/{communityId}",method = RequestMethod.POST)
36
-    public ResponseBean getList(@PathVariable("communityId") Integer communityId){
34
+    @RequestMapping(value = "/monitoring/{communityId}",method = RequestMethod.GET)
35
+    public ResponseBean getList(@PathVariable("communityId") Integer communityId,
36
+                                @RequestParam(value = "pageNo",defaultValue = "1") Integer pageNo,
37
+                                @RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize){
37
         ResponseBean response = new ResponseBean();
38
         ResponseBean response = new ResponseBean();
38
         if (!check(communityId)) {
39
         if (!check(communityId)) {
39
             response.addError("小区不存在");
40
             response.addError("小区不存在");
40
             return response;
41
             return response;
41
         }
42
         }
42
 
43
 
43
-        response = iMonitoringService.getByCommunityId(communityId);
44
+        response = iMonitoringService.getByCommunityId(communityId,pageNo,pageSize);
45
+        return response;
46
+    }
47
+
48
+
49
+    @ApiOperation(value = "获取监控列表token",notes = "根据小区ID获取")
50
+    @ApiImplicitParams({
51
+            @ApiImplicitParam(paramType = "path",dataType = "Integer",name = "communityId",value = "小区ID"),
52
+            @ApiImplicitParam(paramType = "query",dataType = "Integer",name = "pageNo",value = "第几页"),
53
+            @ApiImplicitParam(paramType = "query",dataType = "Integer",name = "pageSize",value = "一页多少行")
54
+    })
55
+    @RequestMapping(value = "/monitoring/token/{communityId}",method = RequestMethod.GET)
56
+    public ResponseBean getMonitoringToken(@PathVariable("communityId") Integer communityId,
57
+                                @RequestParam(value = "pageNo",defaultValue = "1") Integer pageNo,
58
+                                @RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize){
59
+        ResponseBean response = new ResponseBean();
60
+        if (!check(communityId)) {
61
+            response.addError("小区不存在");
62
+            return response;
63
+        }
64
+
65
+        response = iMonitoringService.getMonitoringToken(communityId,pageNo,pageSize);
44
         return response;
66
         return response;
45
     }
67
     }
46
 
68
 

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

23
      * @return
23
      * @return
24
      */
24
      */
25
     TaFace getByUserId(@Param("userid") Integer userid);
25
     TaFace getByUserId(@Param("userid") Integer userid);
26
+
26
 }
27
 }

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

45
     // 海康 卡片号
45
     // 海康 卡片号
46
     private String hkCardNo;
46
     private String hkCardNo;
47
 
47
 
48
+    // 人脸状态
49
+    private String faceStatus;
50
+
48
     public Integer getId() {
51
     public Integer getId() {
49
         return id;
52
         return id;
50
     }
53
     }
157
         this.verifyStatus = verifyStatus == null ? null : verifyStatus.trim();
160
         this.verifyStatus = verifyStatus == null ? null : verifyStatus.trim();
158
     }
161
     }
159
 
162
 
163
+    public String getFaceStatus() {
164
+        return faceStatus;
165
+    }
166
+
167
+    public void setFaceStatus(String faceStatus) {
168
+        this.faceStatus = faceStatus;
169
+    }
170
+
160
     public Integer getCreateUser() {
171
     public Integer getCreateUser() {
161
         return createUser;
172
         return createUser;
162
     }
173
     }

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

11
     /**
11
     /**
12
      * 根据小区ID查询 监控列表
12
      * 根据小区ID查询 监控列表
13
      * @param communityId
13
      * @param communityId
14
+     * @param pageNo
15
+     * @param pageSize
14
      * @return
16
      * @return
15
      */
17
      */
16
-    ResponseBean getByCommunityId(Integer communityId);
18
+    ResponseBean getByCommunityId(Integer communityId,Integer pageNo, Integer pageSize);
19
+
20
+    /**
21
+     * 生成 Token
22
+     * @param communityId
23
+     * @param pageNo
24
+     * @param pageSize
25
+     * @return
26
+     */
27
+    ResponseBean getMonitoringToken(Integer communityId, Integer pageNo, Integer pageSize);
17
 
28
 
18
 }
29
 }

+ 7
- 3
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/FaceServicelimpl.java 查看文件

80
             if (Constant.OWNER.equals(sysRole.getRoleName()) && "1".equals(taUser.getVerifyStatus())) {
80
             if (Constant.OWNER.equals(sysRole.getRoleName()) && "1".equals(taUser.getVerifyStatus())) {
81
                 ResponseBean resps = checKout(faceImg, taFace, isA, uploadFile, userid);
81
                 ResponseBean resps = checKout(faceImg, taFace, isA, uploadFile, userid);
82
                 if (resps.getCode().equals("0")) {
82
                 if (resps.getCode().equals("0")) {
83
+                    taUser.setFaceStatus("1");
84
+                    taUserMapper.updateByPrimaryKeySelective(taUser);
83
                     resps.addSuccess("图片录入成功");
85
                     resps.addSuccess("图片录入成功");
84
                 } else {
86
                 } else {
85
                     resps.addError(resps.getMessage());
87
                     resps.addError(resps.getMessage());
90
             if (Constant.RELATION.equals(sysRole.getRoleName()) || Constant.TENANT.equals(sysRole.getDescription()) && "1".equals(taUser.getVerifyStatus())) {
92
             if (Constant.RELATION.equals(sysRole.getRoleName()) || Constant.TENANT.equals(sysRole.getDescription()) && "1".equals(taUser.getVerifyStatus())) {
91
                 ResponseBean resps = checKout(faceImg, taFace, isA, uploadFile, userid);
93
                 ResponseBean resps = checKout(faceImg, taFace, isA, uploadFile, userid);
92
                 if (resps.getCode().equals("0")) {
94
                 if (resps.getCode().equals("0")) {
95
+                    taUser.setFaceStatus("1");
96
+                    taUserMapper.updateByPrimaryKeySelective(taUser);
93
                     resps.addSuccess("图片录入成功");
97
                     resps.addSuccess("图片录入成功");
94
                 } else {
98
                 } else {
95
                     resps.addError(resps.getMessage());
99
                     resps.addError(resps.getMessage());
180
     public ResponseBean getTaFaceByUserId(Integer userId) {
184
     public ResponseBean getTaFaceByUserId(Integer userId) {
181
         ResponseBean responseBean= new ResponseBean();
185
         ResponseBean responseBean= new ResponseBean();
182
         TaFace face = taFaceMapper.getByUserId(userId);
186
         TaFace face = taFaceMapper.getByUserId(userId);
183
-            if (null!= face){
187
+         if (null!= face){
184
             responseBean.addSuccess(face);
188
             responseBean.addSuccess(face);
185
             return responseBean;
189
             return responseBean;
186
         }
190
         }
187
-        responseBean.addError("当前用户暂无人脸图片");
188
-        return responseBean;
191
+            responseBean.addError("当前用户暂无人脸图片");
192
+            return responseBean;
189
 
193
 
190
     }
194
     }
191
 
195
 

+ 35
- 3
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/MonitoringServiceImpl.java 查看文件

1
 package com.community.huiju.service.impl;
1
 package com.community.huiju.service.impl;
2
+import com.alibaba.fastjson.JSON;
2
 import com.alibaba.fastjson.JSONObject;
3
 import com.alibaba.fastjson.JSONObject;
4
+import com.community.commom.hk.Digests;
5
+import com.community.commom.hk.HttpClientSSLUtils;
3
 import com.community.commom.mode.ResponseBean;
6
 import com.community.commom.mode.ResponseBean;
4
 import com.community.huiju.common.hk.HKConstant;
7
 import com.community.huiju.common.hk.HKConstant;
5
 import com.community.huiju.common.hk.HKOpenApi;
8
 import com.community.huiju.common.hk.HKOpenApi;
20
 public class MonitoringServiceImpl implements IMonitoringService {
23
 public class MonitoringServiceImpl implements IMonitoringService {
21
 
24
 
22
     @Override
25
     @Override
23
-    public ResponseBean getByCommunityId(Integer communityId) {
26
+    public ResponseBean getByCommunityId(Integer communityId,Integer pageNo, Integer pageSize) {
24
 
27
 
25
         // TODO 数据是假数据, 后期在更改. 需要根据小区查询 组织中心编号
28
         // TODO 数据是假数据, 后期在更改. 需要根据小区查询 组织中心编号
26
 
29
 
27
         ResponseBean response = new ResponseBean();
30
         ResponseBean response = new ResponseBean();
28
         Map<String,Object> parMap = Maps.newHashMap();
31
         Map<String,Object> parMap = Maps.newHashMap();
29
-        parMap.put("pageNo",1);
30
-        parMap.put("pageSize",100);
32
+        parMap.put("pageNo",pageNo);
33
+        parMap.put("pageSize",pageSize);
31
         parMap.put("opUserUuid",HKConstant.OP_USER_UUID);
34
         parMap.put("opUserUuid",HKConstant.OP_USER_UUID);
35
+        // 组织中心编号
32
         parMap.put("unitUuids","1048576");
36
         parMap.put("unitUuids","1048576");
33
 
37
 
34
         String result = HKOpenApi.getMonitoryPoint(parMap);
38
         String result = HKOpenApi.getMonitoryPoint(parMap);
37
 
41
 
38
         return response;
42
         return response;
39
     }
43
     }
44
+
45
+    @Override
46
+    public ResponseBean getMonitoringToken(Integer communityId, Integer pageNo, Integer pageSize) {
47
+
48
+        // TODO 数据是假数据, 后期在更改. 需要根据小区查询 组织中心编号
49
+
50
+        ResponseBean response = new ResponseBean();
51
+        Map<String,Object> parMap = Maps.newHashMap();
52
+        String url = HKConstant.OPENAPI_IP_PORT_HTTP + HKConstant.ITF_MONITORY_POINT;
53
+        //设置APPKEY
54
+        parMap.put("appkey", HKConstant.APPKEY);
55
+        //设置时间参数
56
+        parMap.put("time", System.currentTimeMillis());
57
+        parMap.put("pageNo",pageNo);
58
+        parMap.put("pageSize",pageSize);
59
+        // 这里可以设置其他操作用户 parMap.put("opUserUuid",map.get("opUserUuid") == null?HKConstant.OP_USER_UUID:map.get("opUserUuid"));
60
+        parMap.put("opUserUuid",HKConstant.OP_USER_UUID);
61
+        // 组织中心编号
62
+        parMap.put("unitUuids","1048576");
63
+        String params =  JSON.toJSONString(parMap);
64
+        String token = Digests.buildToken(url + "?" + params, params, HKConstant.SECRET);
65
+
66
+        Map<String, Object> map = Maps.newHashMap();
67
+        map.put("token",token);
68
+        response.addSuccess(map);
69
+
70
+        return response;
71
+    }
40
 }
72
 }

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

61
     @Autowired
61
     @Autowired
62
     private SysNationMapper sysNationMapper;
62
     private SysNationMapper sysNationMapper;
63
 
63
 
64
+    @Autowired
65
+    private TaFaceMapper taFaceMapper;
66
+
64
     @Transactional(rollbackFor = Exception.class)
67
     @Transactional(rollbackFor = Exception.class)
65
     @Override
68
     @Override
66
     public ResponseBean login(TaUser user) {
69
     public ResponseBean login(TaUser user) {
134
             taUserVO.setRole(taSysRole.getRoleName());
137
             taUserVO.setRole(taSysRole.getRoleName());
135
             // 人脸是否已录入
138
             // 人脸是否已录入
136
             // TODO 这里目前定死为已录入, 后期根据人脸业务做判断
139
             // TODO 这里目前定死为已录入, 后期根据人脸业务做判断
137
-            taUserVO.setFace("register");
140
+            // taUserVO.setFace("register");
141
+            if ("1".equals(currentUser.getFaceStatus())) {
142
+                taUserVO.setFace("register");
143
+            } else {
144
+                taUserVO.setFace("unregister");
145
+            }
138
 
146
 
139
             ToCommunities communities = toCommunitiesMapper.selectByPrimaryKey(currentUser.getCommunityId());
147
             ToCommunities communities = toCommunitiesMapper.selectByPrimaryKey(currentUser.getCommunityId());
140
             taUserVO.setCommunityName(communities.getCommunityName());
148
             taUserVO.setCommunityName(communities.getCommunityName());
180
         user.setRemark("这是系统自动注册!");
188
         user.setRemark("这是系统自动注册!");
181
         user.setCommunityId(3);
189
         user.setCommunityId(3);
182
         user.setVerifyStatus("1");
190
         user.setVerifyStatus("1");
191
+        user.setFaceStatus("0");
183
         //user.setLoginPassword(MD5Utils.encode(user.getLoginPassword()));
192
         //user.setLoginPassword(MD5Utils.encode(user.getLoginPassword()));
184
         taUserMapper.insertSelective(user);
193
         taUserMapper.insertSelective(user);
185
 
194
 

+ 26
- 14
CODE/smart-community/app-api/src/main/resources/mapper/TaUserMapper.xml 查看文件

20
     <result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
20
     <result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
21
     <result column="update_user" property="updateUser" jdbcType="INTEGER" />
21
     <result column="update_user" property="updateUser" jdbcType="INTEGER" />
22
     <result column="update_date" property="updateDate" jdbcType="TIMESTAMP" />
22
     <result column="update_date" property="updateDate" jdbcType="TIMESTAMP" />
23
-    <result column="hk_user_id" property="hkUserId" javaType="INTEGER" />
24
-    <result column="hk_card_no" property="hkCardNo" />
23
+    <result column="hk_user_id" property="hkUserId" jdbcType="INTEGER" />
24
+    <result column="hk_card_no" property="hkCardNo" jdbcType="VARCHAR" />
25
+    <result column="face_status" property="faceStatus" jdbcType="CHAR" />
25
   </resultMap>
26
   </resultMap>
26
   <sql id="Base_Column_List" >
27
   <sql id="Base_Column_List" >
27
-    id, community_id, building_owner_info_id, head_portrait, user_name, login_name, login_password, 
28
+    id, community_id, building_owner_info_id, head_portrait, user_name, login_name, login_password,
28
     email, gender, status, remark, parent_id, accept_agreement_status, verify_status,
29
     email, gender, status, remark, parent_id, accept_agreement_status, verify_status,
29
-    create_user, create_date, update_user, update_date,hk_user_id,hk_card_no
30
+    create_user, create_date, update_user, update_date, hk_user_id, hk_card_no, face_status
30
   </sql>
31
   </sql>
31
   <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
32
   <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
32
     select
33
     select
44
       login_password, email, gender,
45
       login_password, email, gender,
45
       status, remark, parent_id,
46
       status, remark, parent_id,
46
       accept_agreement_status, verify_status, create_user,
47
       accept_agreement_status, verify_status, create_user,
47
-      create_date, update_user, update_date, hk_user_id,hk_card_no
48
+      create_date, update_user, update_date,
49
+      hk_user_id, hk_card_no, face_status
48
       )
50
       )
49
     values (#{id,jdbcType=INTEGER}, #{communityId,jdbcType=INTEGER}, #{buildingOwnerInfoId,jdbcType=INTEGER},
51
     values (#{id,jdbcType=INTEGER}, #{communityId,jdbcType=INTEGER}, #{buildingOwnerInfoId,jdbcType=INTEGER},
50
       #{headPortrait,jdbcType=VARCHAR}, #{userName,jdbcType=VARCHAR}, #{loginName,jdbcType=VARCHAR},
52
       #{headPortrait,jdbcType=VARCHAR}, #{userName,jdbcType=VARCHAR}, #{loginName,jdbcType=VARCHAR},
52
       #{status,jdbcType=CHAR}, #{remark,jdbcType=VARCHAR}, #{parentId,jdbcType=INTEGER},
54
       #{status,jdbcType=CHAR}, #{remark,jdbcType=VARCHAR}, #{parentId,jdbcType=INTEGER},
53
       #{acceptAgreementStatus,jdbcType=CHAR}, #{verifyStatus,jdbcType=CHAR}, #{createUser,jdbcType=INTEGER},
55
       #{acceptAgreementStatus,jdbcType=CHAR}, #{verifyStatus,jdbcType=CHAR}, #{createUser,jdbcType=INTEGER},
54
       #{createDate,jdbcType=TIMESTAMP}, #{updateUser,jdbcType=INTEGER}, #{updateDate,jdbcType=TIMESTAMP},
56
       #{createDate,jdbcType=TIMESTAMP}, #{updateUser,jdbcType=INTEGER}, #{updateDate,jdbcType=TIMESTAMP},
55
-      #{hkUserId,jdbcType=INTEGER},#{hkCardNo,jdbcType=VARCHAR}
57
+      #{hkUserId,jdbcType=INTEGER}, #{hkCardNo,jdbcType=VARCHAR}, #{faceStatus,jdbcType=CHAR}
56
       )
58
       )
57
   </insert>
59
   </insert>
58
-  <insert id="insertSelective" useGeneratedKeys="true" keyProperty="id" parameterType="com.community.huiju.model.TaUser" >
60
+  <insert id="insertSelective" parameterType="com.community.huiju.model.TaUser" >
59
     insert into ta_user
61
     insert into ta_user
60
     <trim prefix="(" suffix=")" suffixOverrides="," >
62
     <trim prefix="(" suffix=")" suffixOverrides="," >
61
       <if test="id != null" >
63
       <if test="id != null" >
112
       <if test="updateDate != null" >
114
       <if test="updateDate != null" >
113
         update_date,
115
         update_date,
114
       </if>
116
       </if>
115
-      <if test="hkUserId != null">
117
+      <if test="hkUserId != null" >
116
         hk_user_id,
118
         hk_user_id,
117
       </if>
119
       </if>
118
-      <if test="hkCardNo != null">
120
+      <if test="hkCardNo != null" >
119
         hk_card_no,
121
         hk_card_no,
120
       </if>
122
       </if>
123
+      <if test="faceStatus != null" >
124
+        face_status,
125
+      </if>
121
     </trim>
126
     </trim>
122
     <trim prefix="values (" suffix=")" suffixOverrides="," >
127
     <trim prefix="values (" suffix=")" suffixOverrides="," >
123
       <if test="id != null" >
128
       <if test="id != null" >
174
       <if test="updateDate != null" >
179
       <if test="updateDate != null" >
175
         #{updateDate,jdbcType=TIMESTAMP},
180
         #{updateDate,jdbcType=TIMESTAMP},
176
       </if>
181
       </if>
177
-      <if test="hkUserId != null">
182
+      <if test="hkUserId != null" >
178
         #{hkUserId,jdbcType=INTEGER},
183
         #{hkUserId,jdbcType=INTEGER},
179
       </if>
184
       </if>
180
-      <if test="hkCardNo != null">
185
+      <if test="hkCardNo != null" >
181
         #{hkCardNo,jdbcType=VARCHAR},
186
         #{hkCardNo,jdbcType=VARCHAR},
182
       </if>
187
       </if>
188
+      <if test="faceStatus != null" >
189
+        #{faceStatus,jdbcType=CHAR},
190
+      </if>
183
     </trim>
191
     </trim>
184
   </insert>
192
   </insert>
185
   <update id="updateByPrimaryKeySelective" parameterType="com.community.huiju.model.TaUser" >
193
   <update id="updateByPrimaryKeySelective" parameterType="com.community.huiju.model.TaUser" >
236
       <if test="updateDate != null" >
244
       <if test="updateDate != null" >
237
         update_date = #{updateDate,jdbcType=TIMESTAMP},
245
         update_date = #{updateDate,jdbcType=TIMESTAMP},
238
       </if>
246
       </if>
239
-      <if test="hkUserId != null">
247
+      <if test="hkUserId != null" >
240
         hk_user_id = #{hkUserId,jdbcType=INTEGER},
248
         hk_user_id = #{hkUserId,jdbcType=INTEGER},
241
       </if>
249
       </if>
242
-      <if test="hkCardNo">
250
+      <if test="hkCardNo != null" >
243
         hk_card_no = #{hkCardNo,jdbcType=VARCHAR},
251
         hk_card_no = #{hkCardNo,jdbcType=VARCHAR},
244
       </if>
252
       </if>
253
+      <if test="faceStatus != null" >
254
+        face_status = #{faceStatus,jdbcType=CHAR},
255
+      </if>
245
     </set>
256
     </set>
246
     where id = #{id,jdbcType=INTEGER}
257
     where id = #{id,jdbcType=INTEGER}
247
   </update>
258
   </update>
265
       update_user = #{updateUser,jdbcType=INTEGER},
276
       update_user = #{updateUser,jdbcType=INTEGER},
266
       update_date = #{updateDate,jdbcType=TIMESTAMP},
277
       update_date = #{updateDate,jdbcType=TIMESTAMP},
267
       hk_user_id = #{hkUserId,jdbcType=INTEGER},
278
       hk_user_id = #{hkUserId,jdbcType=INTEGER},
268
-      hk_card_no = #{hkCardNo,jdbcType=VARCHAR}
279
+      hk_card_no = #{hkCardNo,jdbcType=VARCHAR},
280
+      face_status = #{faceStatus,jdbcType=CHAR}
269
     where id = #{id,jdbcType=INTEGER}
281
     where id = #{id,jdbcType=INTEGER}
270
   </update>
282
   </update>
271
 
283
 

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

26
 
26
 
27
 zuul:
27
 zuul:
28
   host:
28
   host:
29
-    connect-timeout-millis: 200000
29
+    connect-timeout-millis: 60000
30
+    socket-timeout-millis: 60000
31
+
32
+hystrix:
33
+  command:
34
+    default:
35
+      execution:
36
+        isolation:
37
+          thread:
38
+            timeoutInMilliseconds: 60000
30
 
39
 
31
 
40
 
32
 ## Mybatis
41
 ## Mybatis

+ 6
- 2
VUECODE/smart-operate-manage/src/views/banner/addBanner/index.vue 查看文件

112
       listLoading: true,
112
       listLoading: true,
113
       importanceOptions: [1, 2, 3],
113
       importanceOptions: [1, 2, 3],
114
       calendarTypeOptions,
114
       calendarTypeOptions,
115
+      listQuery: [], // 接收查询参数,在返回给首页
115
       addForm: {
116
       addForm: {
116
         title: '',
117
         title: '',
117
         sort: '1',
118
         sort: '1',
146
       communityList: s => s.list
147
       communityList: s => s.list
147
     })
148
     })
148
   },
149
   },
150
+  created() {
151
+    this.listQuery = this.$route.params.listQuery
152
+  },
149
   methods: {
153
   methods: {
150
     ...mapActions('community', [
154
     ...mapActions('community', [
151
       'FetchCommunityList',
155
       'FetchCommunityList',
169
     },
173
     },
170
     dialogForm(isVaule) {
174
     dialogForm(isVaule) {
171
       if (isVaule === '0') {
175
       if (isVaule === '0') {
172
-        this.$router.push({ name: 'banner-index' })
176
+        this.$router.push({ name: 'banner-index', params: { listQuery: this.listQuery }})
173
       } else {
177
       } else {
174
         this.createData()
178
         this.createData()
175
         // console.log('添加banner的数据: ', this.addForm)
179
         // console.log('添加banner的数据: ', this.addForm)
194
                 message: res.message,
198
                 message: res.message,
195
                 type: 'success'
199
                 type: 'success'
196
               })
200
               })
197
-              this.$router.push({ name: 'banner-index' })
201
+              this.$router.push({ name: 'banner-index', params: { listQuery: this.listQuery }})
198
             } else {
202
             } else {
199
               this.$notify({
203
               this.$notify({
200
                 title: '操作失败',
204
                 title: '操作失败',

+ 4
- 2
VUECODE/smart-operate-manage/src/views/banner/ediBanner/index.vue 查看文件

112
       listLoading: true,
112
       listLoading: true,
113
       importanceOptions: [1, 2, 3],
113
       importanceOptions: [1, 2, 3],
114
       calendarTypeOptions,
114
       calendarTypeOptions,
115
+      listQuery: [],
115
       form: {
116
       form: {
116
         title: '',
117
         title: '',
117
         sort: '1',
118
         sort: '1',
148
   },
149
   },
149
   created() {
150
   created() {
150
     this.getByBannerId(this.$route.params.id)
151
     this.getByBannerId(this.$route.params.id)
152
+    this.listQuery = this.$route.params.listQuery
151
   },
153
   },
152
   methods: {
154
   methods: {
153
     ...mapActions('community', [
155
     ...mapActions('community', [
172
     },
174
     },
173
     dialogForm(isVaule) {
175
     dialogForm(isVaule) {
174
       if (isVaule === '0') {
176
       if (isVaule === '0') {
175
-        this.$router.push({ name: 'banner-index' })
177
+        this.$router.push({ name: 'banner-index', params: { listQuery: this.listQuery }})
176
       } else {
178
       } else {
177
         this.updateData()
179
         this.updateData()
178
       }
180
       }
196
                 message: res.message,
198
                 message: res.message,
197
                 type: 'success'
199
                 type: 'success'
198
               })
200
               })
199
-              this.$router.push({ name: 'banner-index' })
201
+              this.$router.push({ name: 'banner-index', params: { listQuery: this.listQuery }})
200
             } else {
202
             } else {
201
               this.$notify({
203
               this.$notify({
202
                 title: '操作失败',
204
                 title: '操作失败',

+ 10
- 7
VUECODE/smart-operate-manage/src/views/banner/index.vue 查看文件

19
 
19
 
20
     <el-row style="margin-top: 20px; margin-bottom: 20px;">
20
     <el-row style="margin-top: 20px; margin-bottom: 20px;">
21
       <el-button type="primary" icon="el-icon-circle-plus" @click="dialogAddForm">添加</el-button>
21
       <el-button type="primary" icon="el-icon-circle-plus" @click="dialogAddForm">添加</el-button>
22
-      <el-button type="primary" icon="el-icon-edit">设置轮播数</el-button>
22
+      <!-- <el-button type="primary" icon="el-icon-edit">设置轮播数</el-button> -->
23
     </el-row>
23
     </el-row>
24
 
24
 
25
     <el-table
25
     <el-table
106
 // import { updateArticle, createBanner } from '@/api/banner' // getBanner
106
 // import { updateArticle, createBanner } from '@/api/banner' // getBanner
107
 import { mapState, mapActions } from 'vuex'
107
 import { mapState, mapActions } from 'vuex'
108
 import waves from '@/directive/waves' // Waves directive
108
 import waves from '@/directive/waves' // Waves directive
109
-import { parseTime } from '@/utils/index'
110
 import Pagination from '@/components/Pagination' // Secondary package based on el-pagination
109
 import Pagination from '@/components/Pagination' // Secondary package based on el-pagination
111
 const calendarTypeOptions = [
110
 const calendarTypeOptions = [
112
   { key: 'CN', display_name: 'China' },
111
   { key: 'CN', display_name: 'China' },
145
       listQuery: {
144
       listQuery: {
146
         pageNum: 1,
145
         pageNum: 1,
147
         pageSize: 5,
146
         pageSize: 5,
148
-        bannerTitle: undefined,
147
+        title: undefined,
149
         bannerPosition: undefined,
148
         bannerPosition: undefined,
150
         bannerDescription: undefined,
149
         bannerDescription: undefined,
151
         communityId: undefined
150
         communityId: undefined
169
       bannerPositionArr: [
168
       bannerPositionArr: [
170
         { id: 1, value: '首页banner' },
169
         { id: 1, value: '首页banner' },
171
         { id: 2, value: '服务banner' }
170
         { id: 2, value: '服务banner' }
172
-      ],
171
+      ]
173
     }
172
     }
174
   },
173
   },
175
   computed: {
174
   computed: {
178
     })
177
     })
179
   },
178
   },
180
   created() {
179
   created() {
180
+    const query = this.$route.params.listQuery
181
+    if (query !== undefined) {
182
+      this.listQuery = this.$route.params.listQuery
183
+    }
181
     this.getList()
184
     this.getList()
182
     this.getCommuniryList()
185
     this.getCommuniryList()
183
   },
186
   },
218
       })
221
       })
219
     },
222
     },
220
     dialogAddForm() {
223
     dialogAddForm() {
221
-      this.$router.push({ name: 'banner-add' })
224
+      this.$router.push({ name: 'banner-add', params: { listQuery: this.listQuery }})
222
     },
225
     },
223
     updateBanner(bannerId) {
226
     updateBanner(bannerId) {
224
-      this.$router.push({ name: 'banner-edi', params: { id: bannerId }})
227
+      this.$router.push({ name: 'banner-edi', params: { id: bannerId, listQuery: this.listQuery }})
225
     },
228
     },
226
     handleSizeChange(val) {
229
     handleSizeChange(val) {
227
       // console.log(`每页 ${val} 条`);
230
       // console.log(`每页 ${val} 条`);
270
     handleFilter() {
273
     handleFilter() {
271
       this.listQuery.pageNum = 1
274
       this.listQuery.pageNum = 1
272
       this.listQuery.pageSize = 5
275
       this.listQuery.pageSize = 5
273
-      this.listQuery.bannerTitle = undefined
276
+      this.listQuery.title = undefined
274
       this.listQuery.bannerPosition = undefined
277
       this.listQuery.bannerPosition = undefined
275
       this.listQuery.bannerDescription = undefined
278
       this.listQuery.bannerDescription = undefined
276
       this.listQuery.communityId = undefined
279
       this.listQuery.communityId = undefined