ソースを参照

Merge branch '2.0.0' of http://git.ycjcjy.com/fuxingfan/smartCommunity into 2.0.0

魏熙美 6 年 前
コミット
030ccda5b1
共有23 個のファイルを変更した1007 個の追加333 個の削除を含む
  1. 1
    1
      CODE/smart-community/property-api/src/main/java/com/community/huiju/controller/ActivityController.java
  2. 19
    21
      CODE/smart-community/property-api/src/main/java/com/community/huiju/controller/TransactionController.java
  3. 4
    2
      CODE/smart-community/property-api/src/main/java/com/community/huiju/dao/TpTransactionMapper.java
  4. 18
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/dao/TransactionLikeMapper.java
  5. 16
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/dao/TransactionReportMapper.java
  6. 22
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/model/TpTransaction.java
  7. 57
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/model/TransactionLike.java
  8. 46
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/model/TransactionReport.java
  9. 5
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/model/User.java
  10. 10
    1
      CODE/smart-community/property-api/src/main/java/com/community/huiju/service/ITransactionService.java
  11. 171
    60
      CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/BuildingTreeServiceImpl.java
  12. 21
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/TpActivityServiceImpl.java
  13. 77
    8
      CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/TransactionServiceImpl.java
  14. 14
    2
      CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/UserServiceImpl.java
  15. 31
    23
      CODE/smart-community/property-api/src/main/resources/mapper/TpTransactionMapper.xml
  16. 5
    0
      CODE/smart-community/property-api/src/main/resources/mapper/TransactionLikeMapper.xml
  17. 5
    0
      CODE/smart-community/property-api/src/main/resources/mapper/TransactionReportMapper.xml
  18. 1
    0
      VUECODE/smart-property-manage/src/api/activity.js
  19. 30
    0
      VUECODE/smart-property-manage/src/api/transaction.js
  20. 7
    0
      VUECODE/smart-property-manage/src/router/index.js
  21. 19
    1
      VUECODE/smart-property-manage/src/store/modules/transaction.js
  22. 237
    214
      VUECODE/smart-property-manage/src/views/social/transaction/index.vue
  23. 191
    0
      VUECODE/smart-property-manage/src/views/social/transaction/transactionAdd.vue

+ 1
- 1
CODE/smart-community/property-api/src/main/java/com/community/huiju/controller/ActivityController.java ファイルの表示

@@ -74,7 +74,7 @@ public class ActivityController extends BaseController {
74 74
             @ApiImplicitParam(paramType = "header", dataTypeClass = String.class, name = "Login-Type", value = "值为 web"),
75 75
             @ApiImplicitParam(paramType = "body", dataTypeClass = String.class, name = "parameter", value = "id活动编号;activityTitle活动标题;" +
76 76
                     "activityCarouselImg轮播图;activityContent活动详情;contentImg活动内容配图;signUpMax活动人数上限;" +
77
-                    "registrationEndTime报名活动结束时间;sort权重;status状态 0 是已作废 1 是已发布   2 是草稿")
77
+                    "registrationEndTime报名活动结束时间;sort权重;status状态 0 是已作废 1 是已发布   2 是草稿,radio:1是需要二维码,2是不需要")
78 78
     })
79 79
     @RequestMapping(value = "/activity/update", method = RequestMethod.PUT)
80 80
     public ResponseBean updateActivity(@RequestBody String parameter, HttpSession session) {

+ 19
- 21
CODE/smart-community/property-api/src/main/java/com/community/huiju/controller/TransactionController.java ファイルの表示

@@ -40,29 +40,15 @@ public class TransactionController extends BaseController {
40 40
 	
41 41
 	@ApiOperation(value = "根据搜索条件获取二手租赁列表", notes = "根据搜索条件获取二手租赁列表")
42 42
 	@ApiImplicitParams({
43
-			@ApiImplicitParam(paramType = "query", dataType = "Integer", name = "transactionId", value = "帖子编号"),
44
-			@ApiImplicitParam(paramType = "query", dataType = "String", name = "transactionTitle", value = "帖子标题(模糊查询)"),
45
-			@ApiImplicitParam(paramType = "query", dataType = "String", name = "status", value = "发布状态"),
46
-			@ApiImplicitParam(paramType = "query", dataType = "String", name = "isReported", value = "是否被举报"),
47
-			@ApiImplicitParam(paramType = "query", dataType = "integer", name = "pageNum", value = "分页第几页"),
48
-			@ApiImplicitParam(paramType = "query", dataType = "integer", name = "pageSize", value = "分页每页长度")
43
+			@ApiImplicitParam(paramType = "body",dataType = "String",name = "parameter",value = "id:话题编号,transactionTitle:标题" +
44
+					"userName:发布人,status:状态,pageNum:总数,pageSize当前页"
45
+					)
49 46
 	})
50
-	@RequestMapping(value = "/transactions",method = RequestMethod.GET)
51
-	public ResponseBean getList(@RequestParam(value = "transactionId", required = false) Integer transactionId,
52
-	                            @RequestParam(value = "transactionTitle", required = false) String transactionTitle,
53
-	                            @RequestParam(value = "status", required = false) String status,
54
-	                            @RequestParam(value = "isReported", required = false) String isReported,
55
-	                            @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
56
-	                            @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize, HttpSession session){
57
-		ResponseBean responseBean = new ResponseBean();
47
+	@ApiImplicitParam(paramType = "header", dataTypeClass = String.class, name = "X-Auth-Token", value = "token")
48
+	@RequestMapping(value = "/transactions",method = RequestMethod.POST)
49
+	public ResponseBean getList(@RequestBody String parameter, HttpSession session){
58 50
 		UserElement userElement = getUserElement(session);
59
-		TpTransaction tpTransaction = new TpTransaction();
60
-		tpTransaction.setId(transactionId);
61
-		tpTransaction.setTransactionTitle(transactionTitle);
62
-		tpTransaction.setStatus(status);
63
-		tpTransaction.setIsReported(isReported);
64
-		tpTransaction.setCommunityId(userElement.getCommunityId());
65
-		responseBean = transactionService.getTransactionList(tpTransaction,pageNum,pageSize);
51
+		ResponseBean responseBean = transactionService.getTransactionList(parameter,userElement.getCommunityId() );
66 52
 		return responseBean;
67 53
 	}
68 54
 	
@@ -93,4 +79,16 @@ public class TransactionController extends BaseController {
93 79
 		responseBean = transactionService.updateTransactionById(id,userElement.getId());
94 80
 		return responseBean;
95 81
 	}
82
+
83
+	@ApiOperation(value = "添加二手租赁",nickname ="添加二手租赁")
84
+	@ApiImplicitParams({
85
+			@ApiImplicitParam(paramType = "body", dataType = "String", name = "paramets", value ="transactionTitle:话题标题," +
86
+					"type:0 代表 二手(卖二手物品)  1 是代表 求购 (买二手物品) 2 是代表 租赁(租二手物品)3其他话题,contentImg:图片,sort:权重值,status:'0 是已作废 1 是已发布  2 是草稿 ")})
87
+	@ApiImplicitParam(paramType = "header", dataTypeClass = String.class, name = "X-Auth-Token", value = "token")
88
+	@RequestMapping(value="/transactions/add",method = RequestMethod.POST)
89
+	public ResponseBean transactionsAdd(@RequestBody String paramets, HttpSession session){
90
+		UserElement userElement = getUserElement(session);
91
+		ResponseBean  addAnnouncement= transactionService.transactionsAdd(paramets,userElement.getCommunityId(),userElement.getId());
92
+		return addAnnouncement;
93
+	}
96 94
 }

+ 4
- 2
CODE/smart-community/property-api/src/main/java/com/community/huiju/dao/TpTransactionMapper.java ファイルの表示

@@ -2,6 +2,8 @@ package com.community.huiju.dao;
2 2
 
3 3
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4 4
 import com.baomidou.mybatisplus.core.metadata.IPage;
5
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
+import com.community.huiju.model.TpTicket;
5 7
 import com.community.huiju.model.TpTransaction;
6 8
 import org.apache.ibatis.annotations.Param;
7 9
 
@@ -16,6 +18,6 @@ import java.util.List;
16 18
  * @since 2018-12-29
17 19
  */
18 20
 public interface TpTransactionMapper extends BaseMapper<TpTransaction> {
19
-	
20
-	List<TpTransaction> selectListByParams(IPage page,@Param("tpTransaction") TpTransaction tpTransaction);
21
+
22
+	List<TpTransaction> selectListByParams(Page page, @Param("transactionTitle") String transactionTitle,@Param("userName") String userName, @Param("id")Integer id, @Param("status")Integer status,@Param("communityId") Integer communityId);
21 23
 }

+ 18
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/dao/TransactionLikeMapper.java ファイルの表示

@@ -0,0 +1,18 @@
1
+package com.community.huiju.dao;
2
+
3
+import com.community.huiju.model.TransactionLike;
4
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5
+import org.apache.ibatis.annotations.Mapper;
6
+
7
+/**
8
+ * <p>
9
+ * 二手租赁喜好表 Mapper 接口
10
+ * </p>
11
+ *
12
+ * @author jobob
13
+ * @since 2019-04-08
14
+ */
15
+@Mapper
16
+public interface TransactionLikeMapper extends BaseMapper<TransactionLike> {
17
+
18
+}

+ 16
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/dao/TransactionReportMapper.java ファイルの表示

@@ -0,0 +1,16 @@
1
+package com.community.huiju.dao;
2
+
3
+import com.community.huiju.model.TransactionReport;
4
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5
+
6
+/**
7
+ * <p>
8
+ * 二手交易举报表 Mapper 接口
9
+ * </p>
10
+ *
11
+ * @author jobob
12
+ * @since 2019-04-08
13
+ */
14
+public interface TransactionReportMapper extends BaseMapper<TransactionReport> {
15
+
16
+}

+ 22
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/model/TpTransaction.java ファイルの表示

@@ -93,5 +93,27 @@ public class TpTransaction implements Serializable {
93 93
     @TableField(exist = false)
94 94
     private String userName;
95 95
 
96
+    /**
97
+     * 喜欢的总数
98
+     */
99
+    @TableField(exist = false)
100
+   private Integer transactionLikeSum;
101
+
102
+    /**
103
+     * 不喜欢的总数
104
+     */
105
+    @TableField(exist = false)
106
+    private Integer transactionNoLikeSum;
96 107
 
108
+    /**
109
+     *帖子回复总数
110
+     */
111
+    @TableField(exist = false)
112
+    private Integer replySum;
113
+
114
+    /**
115
+     *帖子举报总数
116
+     */
117
+    @TableField(exist = false)
118
+    private Integer reportSum;
97 119
 }

+ 57
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/model/TransactionLike.java ファイルの表示

@@ -0,0 +1,57 @@
1
+package com.community.huiju.model;
2
+
3
+import com.baomidou.mybatisplus.annotation.TableName;
4
+import java.time.LocalDateTime;
5
+import java.io.Serializable;
6
+import lombok.Data;
7
+import lombok.EqualsAndHashCode;
8
+import lombok.experimental.Accessors;
9
+
10
+/**
11
+ * <p>
12
+ * 二手租赁喜好表
13
+ * </p>
14
+ *
15
+ * @author jobob
16
+ * @since 2019-04-08
17
+ */
18
+@Data
19
+@EqualsAndHashCode(callSuper = false)
20
+@Accessors(chain = true)
21
+@TableName("tp_transaction_like")
22
+public class TransactionLike implements Serializable {
23
+
24
+    private static final long serialVersionUID = 1L;
25
+
26
+    /**
27
+     * 小区ID
28
+     */
29
+    private Integer communityId;
30
+
31
+    /**
32
+     * 住户端App用户ID
33
+     */
34
+    private Integer taUserId;
35
+
36
+    /**
37
+     * 交易帖子ID
38
+     */
39
+    private Integer transactionId;
40
+
41
+    /**
42
+     * 1是喜欢 2是不喜欢
43
+     */
44
+    private String likeStatus;
45
+
46
+    /**
47
+     * 创建时间
48
+     */
49
+    private LocalDateTime createDate;
50
+
51
+    /**
52
+     * 更新时间
53
+     */
54
+    private LocalDateTime updateDate;
55
+
56
+
57
+}

+ 46
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/model/TransactionReport.java ファイルの表示

@@ -0,0 +1,46 @@
1
+package com.community.huiju.model;
2
+
3
+import com.baomidou.mybatisplus.annotation.TableName;
4
+import java.io.Serializable;
5
+import lombok.Data;
6
+import lombok.EqualsAndHashCode;
7
+import lombok.experimental.Accessors;
8
+
9
+/**
10
+ * <p>
11
+ * 二手交易举报表
12
+ * </p>
13
+ *
14
+ * @author jobob
15
+ * @since 2019-04-08
16
+ */
17
+@Data
18
+@EqualsAndHashCode(callSuper = false)
19
+@Accessors(chain = true)
20
+@TableName("tp_transaction_report")
21
+public class TransactionReport implements Serializable {
22
+
23
+    private static final long serialVersionUID = 1L;
24
+
25
+    /**
26
+     * 小区id
27
+     */
28
+    private Integer communityId;
29
+
30
+    /**
31
+     * 二手交易id
32
+     */
33
+    private Integer transactionId;
34
+
35
+    /**
36
+     * 举报原因id 对应 sys_report_reason 表
37
+     */
38
+    private String reportReasonId;
39
+
40
+    /**
41
+     * app用户端的举报者
42
+     */
43
+    private Integer reporterId;
44
+
45
+
46
+}

+ 5
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/model/User.java ファイルの表示

@@ -90,4 +90,9 @@ public class User implements Serializable {
90 90
      */
91 91
     private LocalDateTime updateDate;
92 92
 
93
+    /**
94
+     * 在物业端app人员信息
95
+     */
96
+    private Integer taUserId;
97
+
93 98
 }

+ 10
- 1
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/ITransactionService.java ファイルの表示

@@ -15,7 +15,7 @@ import com.community.huiju.model.TpTransaction;
15 15
  */
16 16
 public interface ITransactionService extends IService<TpTransaction> {
17 17
 	
18
-	ResponseBean getTransactionList(TpTransaction tpTransaction, Integer pageNum, Integer pageSize);
18
+	ResponseBean getTransactionList(String parameter,Integer communityId);
19 19
 	
20 20
 	/**
21 21
 	 * 获取交易信息详情
@@ -30,4 +30,13 @@ public interface ITransactionService extends IService<TpTransaction> {
30 30
 	 * @return
31 31
 	 */
32 32
 	ResponseBean updateTransactionById(Integer id,Integer userId);
33
+
34
+	/**
35
+	 * 添加二手话题
36
+	 * @param paramets
37
+	 * @param communityId
38
+	 * @param id
39
+	 * @return
40
+	 */
41
+    ResponseBean transactionsAdd(String paramets, Integer communityId, Integer id);
33 42
 }

+ 171
- 60
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/BuildingTreeServiceImpl.java ファイルの表示

@@ -7,18 +7,10 @@ import com.community.commom.constant.Constant;
7 7
 import com.community.commom.mode.ResponseBean;
8 8
 import com.community.commom.session.UserElement;
9 9
 import com.community.commom.utils.AccountValidatorUtil;
10
-import com.community.huiju.dao.TpBuildingMapper;
11
-import com.community.huiju.dao.TpBuildingOwnerInfoMapper;
12
-import com.community.huiju.dao.TpLevelMapper;
13
-import com.community.huiju.dao.TpPhaseMapper;
14
-import com.community.huiju.dao.TpUnitMapper;
15
-import com.community.huiju.model.TaUser;
16
-import com.community.huiju.model.TpBuilding;
17
-import com.community.huiju.model.TpBuildingOwnerInfo;
18
-import com.community.huiju.model.TpLevel;
19
-import com.community.huiju.model.TpPhase;
20
-import com.community.huiju.model.TpUnit;
10
+import com.community.huiju.dao.*;
11
+import com.community.huiju.model.*;
21 12
 import com.community.huiju.service.BuildingTreeServiceI;
13
+import jdk.nashorn.internal.ir.IfNode;
22 14
 import org.apache.ibatis.annotations.Mapper;
23 15
 import org.apache.poi.hssf.usermodel.HSSFWorkbook;
24 16
 import org.apache.poi.ss.usermodel.Row;
@@ -60,6 +52,8 @@ public class BuildingTreeServiceImpl implements BuildingTreeServiceI {
60 52
 	
61 53
 	@Autowired
62 54
 	private TpBuildingOwnerInfoMapper tpBuildingOwnerInfoMapper;
55
+	@Autowired
56
+	private TaUserVerifyMapper taUserVerifyMapper;
63 57
 	
64 58
 	/**
65 59
 	 * 获取整个小区的基础数据
@@ -357,12 +351,13 @@ public class BuildingTreeServiceImpl implements BuildingTreeServiceI {
357 351
 			tpBuildingOwnerInfoMapper.insert(tpBuildingOwnerInfo);
358 352
 		}
359 353
 		responseBean.addSuccess("成功");
360
-		return null;
354
+		return responseBean;
361 355
 	}
362 356
 
363 357
 	@Override
364 358
 	public ResponseBean deleteNode(String parameter, Integer communityId) {
365 359
 		ResponseBean responseBean= new ResponseBean();
360
+		//注意刪除当前节点,根据type判断当前节点的位置,删除时先删除当前节点的最小节点。
366 361
 		JSONObject  object= JSONObject.parseObject(parameter);
367 362
 		//当前节点id
368 363
 		Integer id= object.getInteger("id");
@@ -370,13 +365,12 @@ public class BuildingTreeServiceImpl implements BuildingTreeServiceI {
370 365
 		String type= object.getString("type");
371 366
 		//当前输入的节点内容
372 367
 		String nodeNumber= object.getString("nodeNumber");
373
-		if(type.equals("end")){
368
+
369
+		//审核是否通过
370
+		InfoPass(type,id);
371
+		if (type.equals("end")) {
374 372
 			tpBuildingOwnerInfoMapper.deleteById(id);
375 373
 		}
376
-
377
-
378
-
379
-
380 374
 		//删除楼层
381 375
 		if(type.equals("roomNo")){
382 376
 			TpLevel tpLevel= tpLevelMapper.selectById(id);
@@ -388,7 +382,6 @@ public class BuildingTreeServiceImpl implements BuildingTreeServiceI {
388 382
 			Info.eq("level_id", tpLevel.getId());
389 383
 			tpBuildingOwnerInfoMapper.delete(Info);
390 384
 			tpLevelMapper.deleteById(id);
391
-			//删除楼层下面所有的房间
392 385
 		}
393 386
 
394 387
 		//删除单元
@@ -400,15 +393,20 @@ public class BuildingTreeServiceImpl implements BuildingTreeServiceI {
400 393
 			tpLevel.eq("community_id", tpUnit.getCommunityId());
401 394
 			tpLevel.eq("building_id", tpUnit.getBuildingId());
402 395
 			tpLevel.eq("unit_id", tpUnit.getId());
403
-			tpLevel.eq("name", nodeNumber);
404 396
 			//删除单元-楼层-下的房间
405
-			//查询房间号
397
+			//查询楼层ID
398
+			Integer tpLevelID=null;
399
+
400
+			TpLevel levelevel = tpLevelMapper.selectOne(tpLevel);
406 401
 			QueryWrapper<TpBuildingOwnerInfo> Info = new QueryWrapper<>();
407 402
 			Info.eq("community_id", tpUnit.getCommunityId());
408 403
 			Info.eq("phase_id", tpUnit.getPhaseId());
409 404
 			Info.eq("building_id",tpUnit.getBuildingId());
410 405
 			Info.eq("unit_id", tpUnit.getId());
411
-//			Info.eq("level_id", tpLevelToo.getId());
406
+			if (null!=levelevel) {
407
+				Info.eq("level_id", levelevel.getId());
408
+			}
409
+
412 410
 			//先删除所有房间
413 411
 			tpBuildingOwnerInfoMapper.delete(Info);
414 412
 			//再删除所有楼层
@@ -418,59 +416,94 @@ public class BuildingTreeServiceImpl implements BuildingTreeServiceI {
418 416
 
419 417
 		}
420 418
 		//删除楼栋
421
-		if (type.equals("building")){
419
+		if (type.equals("unit")){
422 420
 			TpBuilding tpBuilding= tpBuildingMapper.selectById(id);
423 421
 			//删除单元-楼层-房间
424 422
 			QueryWrapper<TpUnit> tpUnit = new QueryWrapper<>();
425 423
 			tpUnit.eq("community_id", tpBuilding.getCommunityId());
426 424
 			tpUnit.eq("phase_id", tpBuilding.getPhaseId());
427
-			tpUnit.eq("building_id",tpBuilding.getId());
428
-			tpUnit.eq("unit_id", tpBuilding.getId());
429
-			tpUnit.eq("level_id", tpBuilding.getId());
430
-			//根据楼层
431
-			TpUnit unit= tpUnitMapper.selectById(id);
432
-			QueryWrapper<TpLevel> tpLevel = new QueryWrapper<>();
433
-			tpLevel.eq("phase_id", unit.getPhaseId());
434
-			tpLevel.eq("community_id", unit.getCommunityId());
435
-			tpLevel.eq("building_id", unit.getBuildingId());
436
-			tpLevel.eq("unit_id", unit.getId());
437
-			tpLevel.eq("name", nodeNumber);
425
+			tpUnit.eq("building_id", tpBuilding.getId());
438 426
 
439
-			//删除单元-楼层-下的房间
440
-			TpLevel tpLevelToo= tpLevelMapper.selectById(id);
441
-			QueryWrapper<TpBuildingOwnerInfo> Info = new QueryWrapper<>();
442
-			Info.eq("community_id", tpLevelToo.getCommunityId());
443
-			Info.eq("phase_id", tpLevelToo.getPhaseId());
444
-			Info.eq("building_id",tpLevelToo.getBuildingId());
445
-			Info.eq("unit_id", tpLevelToo.getUnitId());
446
-			Info.eq("level_id", tpLevelToo.getId());
447
-			//先删除所有房间
448
-			tpBuildingOwnerInfoMapper.delete(Info);
427
+			//先查询楼层
428
+			TpUnit unit= tpUnitMapper.selectOne(tpUnit);
429
+			QueryWrapper<TpLevel> tpLevel = new QueryWrapper<>();
430
+			if (null!=unit) {
431
+				tpLevel.eq("phase_id", unit.getPhaseId());
432
+				tpLevel.eq("community_id", unit.getCommunityId());
433
+				tpLevel.eq("building_id", unit.getBuildingId());
434
+				tpLevel.eq("unit_id", unit.getId());
435
+			}
436
+			//查询房间
437
+			List<TpLevel> levelList= tpLevelMapper.selectList(tpLevel);
438
+			QueryWrapper<TpBuildingOwnerInfo> tpBuildingOwnerInfo = new QueryWrapper<>();
439
+			if (null!=levelList) {
440
+				for (TpLevel level:levelList) {
441
+					tpBuildingOwnerInfo.eq("phase_id", level.getPhaseId());
442
+					tpBuildingOwnerInfo.eq("community_id", level.getCommunityId());
443
+					tpBuildingOwnerInfo.eq("building_id", level.getBuildingId());
444
+					tpBuildingOwnerInfo.eq("unit_id", level.getUnitId());
445
+					tpBuildingOwnerInfo.eq("level_id", level.getId());
446
+					//先删除所有房间
447
+					tpBuildingOwnerInfoMapper.delete(tpBuildingOwnerInfo);
448
+				}
449
+			}
449 450
 			//再删除所有楼层
450 451
 			tpLevelMapper.delete(tpLevel);
451 452
 			//删除此单元
452
-			tpUnitMapper.deleteById(id);
453
-
454
-
455
-
453
+			tpUnitMapper.delete(tpUnit);
454
+			//判断是否为单
455
+			tpBuildingMapper.deleteById(id);
456
+		}
456 457
 
458
+		if (type.equals("building")){
459
+			TpPhase phase= tpPhaseMapper.selectById(id);
457 460
 
461
+			TpBuilding tpBuilding= tpBuildingMapper.selectById(phase.getId());
462
+			//删除单元-楼层-房间
463
+			QueryWrapper<TpUnit> tpUnit = new QueryWrapper<>();
464
+			if (null!=tpBuilding) {
465
+				tpUnit.eq("community_id", tpBuilding.getCommunityId());
466
+				tpUnit.eq("phase_id", tpBuilding.getPhaseId());
467
+				tpUnit.eq("building_id", tpBuilding.getId());
468
+			}
469
+			//先查询楼层
470
+			List<TpUnit> unitList= tpUnitMapper.selectList(tpUnit);
471
+			QueryWrapper<TpLevel> tpLevel = new QueryWrapper<>();
472
+			if (null!=unitList) {
473
+				for (TpUnit unit:unitList) {
474
+					tpLevel.eq("phase_id", unit.getPhaseId());
475
+					tpLevel.eq("community_id", unit.getCommunityId());
476
+					tpLevel.eq("building_id", unit.getBuildingId());
477
+					tpLevel.eq("unit_id", unit.getId());
458 478
 
459
-			//判断是否为单
479
+					//查询房间
480
+					TpLevel level= tpLevelMapper.selectOne(tpLevel);
481
+					if (null!=level) {
482
+						QueryWrapper<TpBuildingOwnerInfo> tpBuildingOwnerInfo = new QueryWrapper<>();
483
+						tpBuildingOwnerInfo.eq("phase_id", level.getPhaseId());
484
+						tpBuildingOwnerInfo.eq("community_id", level.getCommunityId());
485
+						tpBuildingOwnerInfo.eq("building_id", level.getBuildingId());
486
+						tpBuildingOwnerInfo.eq("unit_id", level.getUnitId());
487
+						tpBuildingOwnerInfo.eq("level_id", level.getId());
488
+						//先删除所有房间
489
+						tpBuildingOwnerInfoMapper.delete(tpBuildingOwnerInfo);
490
+				}
491
+					//再删除所有楼层
492
+					tpLevelMapper.delete(tpLevel);
493
+			 }
494
+			}
495
+			//删除此单元
460 496
 			tpUnitMapper.delete(tpUnit);
497
+			//删除栋
498
+			QueryWrapper<TpBuilding> building= new QueryWrapper<>();
499
+			tpLevel.eq("phase_id", phase.getId());
500
+			tpLevel.eq("community_id", phase.getCommunityId());
501
+			tpBuildingMapper.delete(building);
502
+			//删除整个期
503
+			tpPhaseMapper.deleteById(id);
461 504
 		}
462
-
463
-//		if(type.equals("building")){
464
-//
465
-//			QueryWrapper<TpBuilding> tpBuilding = new QueryWrapper<>();
466
-//			tpBuilding.eq("phase_id", tpPhase.getId());
467
-//			tpBuilding.eq("community_id", tpPhase.getCommunityId());
468
-//			tpBuilding.eq("phase_id", tpPhase.getId());
469
-//			tpBuilding.eq("name", nodeNumber);
470
-//			tpBuildingMapper.delete(tpBuilding);
471
-//		}
472
-
473
-		return null;
505
+		responseBean.addSuccess("成功");
506
+		return responseBean;
474 507
 	}
475 508
 
476 509
 	private void saveBuildingTreeData(Integer communityId, List<TpBuildingOwnerInfo> list) {
@@ -562,4 +595,82 @@ public class BuildingTreeServiceImpl implements BuildingTreeServiceI {
562 595
 			}
563 596
 		}
564 597
 	}
598
+	//删除当前节点判断是否有审核通过的
599
+	private ResponseBean InfoPass(String type,Integer id ) {
600
+		ResponseBean responseBean = new ResponseBean();
601
+		if (type.equals("end")) {
602
+			//判断书否有已审核人员
603
+			TpBuildingOwnerInfo info = tpBuildingOwnerInfoMapper.selectById(id);
604
+			QueryWrapper<TaUserVerify> taUserVerify = new QueryWrapper<>();
605
+			taUserVerify.eq("community_id", info.getCommunityId())
606
+					.eq("phase_id", info.getPhaseId())
607
+					.eq("building_id", info.getBuildingId())
608
+					.eq("unit_id", info.getUnitId())
609
+					.eq("level_id", info.getLevelId())
610
+					.eq("room_no_id", id)
611
+					.eq("verify_status", 1);
612
+			List<TaUserVerify> taUserVerifyList = taUserVerifyMapper.selectList(taUserVerify);
613
+			if (null != taUserVerifyList) {
614
+				responseBean.addError("不可删除审核已通过人员");
615
+				return responseBean;
616
+			}
617
+		}
618
+		if (type.equals("roomNo")) {
619
+			TpLevel tpLevel = tpLevelMapper.selectById(id);
620
+			QueryWrapper<TaUserVerify> taUserVerify = new QueryWrapper<>();
621
+			taUserVerify.eq("community_id", tpLevel.getCommunityId())
622
+					.eq("phase_id", tpLevel.getPhaseId())
623
+					.eq("building_id", tpLevel.getBuildingId())
624
+					.eq("unit_id", tpLevel.getUnitId())
625
+					.eq("level_id", tpLevel.getId())
626
+					.eq("verify_status", 1);
627
+			List<TaUserVerify> taUserVerifyList = taUserVerifyMapper.selectList(taUserVerify);
628
+			if (null != taUserVerifyList) {
629
+				responseBean.addError("不可删除审核已通过人员");
630
+				return responseBean;
631
+			}
632
+		}
633
+		if (type.equals("level")) {
634
+			TpUnit tpUnit = tpUnitMapper.selectById(id);
635
+			QueryWrapper<TaUserVerify> taUserVerify = new QueryWrapper<>();
636
+			taUserVerify.eq("community_id", tpUnit.getCommunityId())
637
+					.eq("phase_id", tpUnit.getPhaseId())
638
+					.eq("building_id", tpUnit.getBuildingId())
639
+					.eq("verify_status", 1);
640
+			List<TaUserVerify> taUserVerifyList = taUserVerifyMapper.selectList(taUserVerify);
641
+			if (null != taUserVerifyList) {
642
+				responseBean.addError("不可删除审核已通过人员");
643
+				return responseBean;
644
+			}
645
+		}
646
+		if (type.equals("unit")) {
647
+			//判断书否有已审核人员
648
+			TpBuilding tpBuilding = tpBuildingMapper.selectById(id);
649
+			QueryWrapper<TaUserVerify> taUserVerify = new QueryWrapper<>();
650
+			taUserVerify.eq("community_id", tpBuilding.getCommunityId())
651
+					.eq("phase_id", tpBuilding.getPhaseId())
652
+					.eq("building_id", tpBuilding.getId())
653
+					.eq("verify_status", 1);
654
+			List<TaUserVerify> taUserVerifyList = taUserVerifyMapper.selectList(taUserVerify);
655
+			if (null != taUserVerifyList) {
656
+				responseBean.addError("不可删除审核已通过人员");
657
+
658
+				return responseBean;
659
+			}
660
+		}
661
+		if (type.equals("building")) {
662
+			TpPhase phase = tpPhaseMapper.selectById(id);
663
+			QueryWrapper<TaUserVerify> taUserVerify = new QueryWrapper<>();
664
+			taUserVerify.eq("community_id", phase.getCommunityId())
665
+					.eq("phase_id", phase.getId())
666
+					.eq("verify_status", 1);
667
+			List<TaUserVerify> taUserVerifyList = taUserVerifyMapper.selectList(taUserVerify);
668
+			if (null != taUserVerifyList) {
669
+				responseBean.addError("不可删除审核已通过人员");
670
+				return responseBean;
671
+			}
672
+		}
673
+		responseBean.addError("成功");
674
+		return responseBean;
675
+	}
565 676
 }

+ 21
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/TpActivityServiceImpl.java ファイルの表示

@@ -285,6 +285,8 @@ public class TpActivityServiceImpl extends ServiceImpl<TpActivityMapper, TpActiv
285 285
         // 活动配图
286 286
         JSONArray jsonArray = jsonObject.getJSONArray("contentImg");
287 287
         String [] contentImgArray = jsonArray.toArray(new String[]{});
288
+        //是否需要签到二维码1:需要2不需要
289
+        int radio= jsonObject.getIntValue("radio");
288 290
 
289 291
         TpActivity selectTpActivity = tpActivityMapper.selectById(tpActivity.getId());
290 292
         if (null == selectTpActivity) {
@@ -334,6 +336,25 @@ public class TpActivityServiceImpl extends ServiceImpl<TpActivityMapper, TpActiv
334 336
          queryWrapper.eq("type", "activity");
335 337
          tdImagesMapper.delete(queryWrapper);
336 338
 
339
+        if (radio==1){
340
+            try {
341
+                InputStream inputStream= QRCode.encode(tpActivity.getId()+"");
342
+                String codeUrl= imageServiceI.getImageUrl(inputStream);
343
+                TdImages tdImages= new TdImages();
344
+                tdImages.setImageUrl(codeUrl);
345
+                tdImages.setUuid(tpActivity.getId());
346
+                tdImages.setType(Constant.ACTIVITY);
347
+                tdImages.setCreateUser(userElement.getId());
348
+                tdImages.setCreateTime(LocalDateTime.now());
349
+                tdImagesMapper.insert(tdImages);
350
+            } catch (WriterException e) {
351
+                e.printStackTrace();
352
+            } catch (IOException e) {
353
+                e.printStackTrace();
354
+            }
355
+
356
+        }
357
+
337 358
 
338 359
         // 插入图片
339 360
         insertImg(contentImgArray, userElement, tpActivity);

+ 77
- 8
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/TransactionServiceImpl.java ファイルの表示

@@ -1,5 +1,6 @@
1 1
 package com.community.huiju.service.impl;
2 2
 
3
+import com.alibaba.fastjson.JSONArray;
3 4
 import com.alibaba.fastjson.JSONObject;
4 5
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
5 6
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -9,9 +10,9 @@ import com.community.commom.mode.ResponseBean;
9 10
 import com.community.commom.session.UserElement;
10 11
 import com.community.huiju.dao.TdImagesMapper;
11 12
 import com.community.huiju.dao.TpTransactionMapper;
12
-import com.community.huiju.model.TdImages;
13
-import com.community.huiju.model.TpBuildingOwnerInfo;
14
-import com.community.huiju.model.TpTransaction;
13
+import com.community.huiju.dao.TransactionLikeMapper;
14
+import com.community.huiju.dao.TransactionReportMapper;
15
+import com.community.huiju.model.*;
15 16
 import com.community.huiju.service.ITransactionService;
16 17
 import com.google.common.collect.Maps;
17 18
 import org.springframework.beans.factory.annotation.Autowired;
@@ -40,16 +41,51 @@ public class TransactionServiceImpl extends ServiceImpl<TpTransactionMapper, TpT
40 41
 	
41 42
 	@Autowired
42 43
 	private TdImagesMapper tdImagesMapper;
43
-	
44
+
45
+	@Autowired
46
+	private TransactionLikeMapper transactionLikeMapper;
47
+
48
+	@Autowired
49
+	private TransactionReportMapper transactionReportMapper;
50
+
51
+
44 52
 	@Override
45
-	public ResponseBean getTransactionList(TpTransaction tpTransaction, Integer pageNum, Integer pageSize) {
53
+	public ResponseBean getTransactionList(String parameter,Integer communityId) {
46 54
 		ResponseBean responseBean = new ResponseBean();
47
-		Page page = new Page(pageNum,pageSize);
55
+		JSONObject object= JSONObject.parseObject(parameter);
56
+		String transactionTitle = object.getString("transactionTitle");
57
+		String userName = object.getString("userName");
58
+		Integer id = object.getInteger("id");
59
+		Integer status = object.getInteger("status");
60
+		Integer pageNum = object.getInteger("pageNum");
61
+		Integer pageSize = object.getInteger("pageSize");
62
+		Page<TpTicket> page = new Page<>();
63
+		page.setSize(pageSize == null ? 10 : pageSize);
64
+		page.setCurrent(pageNum == null ? 1 : pageNum);
48 65
 		// 分页查询
49
-		List<TpTransaction> list = tpTransactionMapper.selectListByParams(page,tpTransaction);
66
+		List<TpTransaction> list = tpTransactionMapper.selectListByParams(page,transactionTitle,userName,id,status,communityId);
67
+
68
+		list = list.stream().map( e-> {
69
+
70
+			QueryWrapper<TransactionLike> transactionLike= new QueryWrapper<>();
71
+			transactionLike.eq("transaction_id",e.getId());
72
+			transactionLike.eq("like_status",2);
73
+			//不喜欢的总数
74
+			 Integer transactionLikeCount= transactionLikeMapper.selectCount(transactionLike);
75
+			e.setTransactionNoLikeSum(transactionLikeCount);
76
+
77
+			QueryWrapper<TransactionReport> TransactionReport= new QueryWrapper<>();
78
+			TransactionReport.eq("transaction_id",e.getId());
79
+			Integer TransactionReportCount= transactionReportMapper.selectCount(TransactionReport);
80
+			e.setReportSum(TransactionReportCount);
81
+
82
+			return e;
83
+		}).collect(Collectors.toList());
50 84
 		Map<String, Object> map = Maps.newHashMap();
51 85
 		map.put("list",list);
52 86
 		map.put("total",page.getTotal());
87
+		map.put("pageNum", page.getCurrent());
88
+		map.put("pageSize", page.getSize());
53 89
 		responseBean.addSuccess(map);
54 90
 		return responseBean;
55 91
 	}
@@ -68,7 +104,7 @@ public class TransactionServiceImpl extends ServiceImpl<TpTransactionMapper, TpT
68 104
 		queryWrapper.eq("uuid", id);
69 105
 		queryWrapper.eq("type", "transaction");
70 106
 		List<TdImages> imagesList = tdImagesMapper.selectList(queryWrapper);
71
-		// 转换, 只保留 imageUrl 字段
107
+		// 转换, 只保留 imageUrl 字段·
72 108
 		List<String> stringList = imagesList.stream().map(e->new String(e.getImageUrl())).collect(Collectors.toList());
73 109
 		Map<String,Object> map = Maps.newHashMap();
74 110
 		map.put("tpTransaction",tpTransaction);
@@ -99,4 +135,37 @@ public class TransactionServiceImpl extends ServiceImpl<TpTransactionMapper, TpT
99 135
 		responseBean.addError("作废出错");
100 136
 		return responseBean;
101 137
 	}
138
+
139
+	@Override
140
+	public ResponseBean transactionsAdd(String paramets, Integer communityId, Integer id) {
141
+		ResponseBean response = new ResponseBean();
142
+		JSONObject jsonobject = JSONObject.parseObject(paramets);
143
+		TpTransaction tpTransaction = JSONObject.parseObject(paramets, TpTransaction.class);
144
+		tpTransaction.setCommunityId(communityId);
145
+		tpTransaction.setTaUserId(null);
146
+		tpTransaction.setCreateDate(LocalDateTime.now());
147
+		tpTransaction.setCreateUser(id);
148
+		tpTransaction.setViewCount(0);
149
+		JSONArray contentImg = jsonobject.getJSONArray("contentImg");
150
+		String[] contentImgArray = contentImg.toArray(new String[]{});
151
+		if (tpTransaction.getTransactionTitle() == null) {
152
+			response.addError("标题不能为空");
153
+			return response;
154
+		}
155
+		if (null == tpTransaction.getTransactionContent() && null == contentImg) {
156
+			response.addError("内容和图片必须填一个");
157
+			return response;
158
+		}
159
+		for (String img : contentImgArray) {
160
+			TdImages tdImages = new TdImages();
161
+			tdImages.setImageUrl(img);
162
+			tdImages.setType("transaction");
163
+			tdImages.setUuid(tpTransaction.getId());
164
+			tdImages.setCreateTime(LocalDateTime.now());
165
+			tdImages.setCreateUser(id);
166
+			tdImagesMapper.insert(tdImages);
167
+		}
168
+		return response;
169
+
170
+	}
102 171
 }

+ 14
- 2
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/UserServiceImpl.java ファイルの表示

@@ -59,6 +59,9 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
59 59
     @Autowired
60 60
     private  SysUserRoleMapper sysUserRoleMapper;
61 61
 
62
+    @Autowired
63
+    private  TaUserMapper taUserMapper;
64
+
62 65
 
63 66
     @Override
64 67
     public ResponseBean login(String phone, Integer communityId, String code) {
@@ -245,11 +248,20 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
245 248
         JSONArray List = object.getJSONArray("menuArray");
246 249
         Integer[] roleIdArray = List.toArray(new Integer[]{});
247 250
         String remark = object.getString("remark");
248
-
251
+       //时维护ta_user(发帖需要)
252
+        TaUser  taUser= new TaUser();
253
+        taUser.setLoginName(loginName)
254
+                .setCreateUser(userID)
255
+                .setCreateDate(LocalDateTime.now())
256
+                .setUserName(userName)
257
+                .setStatus("1");
258
+        taUserMapper.insert(taUser);
259
+        user.setTaUserId(taUser.getId());
249 260
         user.setUserName(userName);
250 261
         user.setLoginName(loginName);
251 262
         user.setRemark(remark);
252
-        user.setStatus("1");;
263
+        user.setStatus("1");
264
+
253 265
         user.setCreateUser(userID);
254 266
         user.setCreateDate(LocalDateTime.now());
255 267
         user.setCommunityId(communityId);

+ 31
- 23
CODE/smart-community/property-api/src/main/resources/mapper/TpTransactionMapper.xml ファイルの表示

@@ -3,34 +3,42 @@
3 3
 <mapper namespace="com.community.huiju.dao.TpTransactionMapper">
4 4
     <select id="selectListByParams" resultType="com.community.huiju.model.TpTransaction">
5 5
         SELECT
6
-            t.id,
7
-            t.community_id AS communityId,
8
-            t.transaction_title AS transactionTitle,
9
-            t.view_count AS viewCount,
10
-            t.`status`,
11
-            t.type,
12
-            t.is_reported AS isReported,
13
-            t.create_date AS createDate,
14
-            u.user_name AS userName
6
+        t.id,
7
+        t.community_id AS communityId,
8
+        t.transaction_title AS transactionTitle,
9
+        t.view_count AS viewCount,
10
+        t.`status`,
11
+        t.type,
12
+        t.create_user,
13
+        t.is_reported AS isReported,
14
+        t.create_date AS createDate,
15
+        ta.user_name AS userName,
16
+        COUNT(li.transaction_id) AS  transactionLikeSum,
17
+        COUNT(re.transaction_id) AS replySum
15 18
         FROM
16
-            tp_transaction t
17
-            LEFT JOIN ta_user u ON t.ta_user_id = u.id
18
-            AND u.community_id = #{tpTransaction.communityId}
19
-        WHERE
20
-            1 = 1
21
-            AND t.community_id = #{tpTransaction.communityId}
22
-        <if test="tpTransaction.id != null and tpTransaction.id != '' or tpTransaction.id ==0">
23
-            and t.id like concat('%',#{tpTransaction.id},'%')
19
+        tp_transaction t
20
+        LEFT JOIN ta_user ta ON  t.create_user = ta.id
21
+        LEFT JOIN ta_visitor v ON ta.id = v.ta_user_id
22
+        LEFT JOIN tp_transaction_like li ON t.id = li.transaction_id AND li.like_status=1
23
+        LEFT JOIN tp_transaction_reply re ON t.id = re.transaction_id
24
+        WHERE t.community_id =#{communityId}
25
+        <if test="id != null and id != '' or id ==0">
26
+            and t.id like concat('%',#{id},'%')
24 27
         </if>
25
-        <if test="tpTransaction.transactionTitle != null and tpTransaction.transactionTitle != ''">
26
-            and t.transaction_title like concat('%',#{tpTransaction.transactionTitle,jdbcType=VARCHAR},'%')
28
+        <if test="transactionTitle != null and transactionTitle != ''">
29
+            and t.transaction_title like concat('%',#{transactionTitle,jdbcType=VARCHAR},'%')
27 30
         </if>
28
-        <if test="tpTransaction.status != null and tpTransaction.status != ''">
29
-            and t.status = #{tpTransaction.status}
31
+        <if test="status != null and status != '' and status != '-1' ">
32
+            and t.status = #{status}
30 33
         </if>
31
-        <if test="tpTransaction.isReported != null and tpTransaction.isReported != ''">
32
-            and t.is_reported = #{tpTransaction.isReported}
34
+        <if test="status != null and status != '' and status = '-1' ">
35
+            and  t.type in(0,1,2)
33 36
         </if>
37
+        <if test="userName != null and userName != ''">
38
+            and ta.user_name like concat('%',#{userName,jdbcType=VARCHAR},'%')
39
+        </if>
40
+        GROUP BY
41
+        t.id
34 42
         ORDER BY t.create_date desc
35 43
     </select>
36 44
 </mapper>

+ 5
- 0
CODE/smart-community/property-api/src/main/resources/mapper/TransactionLikeMapper.xml ファイルの表示

@@ -0,0 +1,5 @@
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.TransactionLikeMapper">
4
+
5
+</mapper>

+ 5
- 0
CODE/smart-community/property-api/src/main/resources/mapper/TransactionReportMapper.xml ファイルの表示

@@ -0,0 +1,5 @@
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.mapper.TransactionReportMapper">
4
+
5
+</mapper>

+ 1
- 0
VUECODE/smart-property-manage/src/api/activity.js ファイルの表示

@@ -39,6 +39,7 @@ export function updateActivity(data) {
39 39
     url: '/activity/update',
40 40
     method: 'put',
41 41
     data: {
42
+      radio: data.radio,
42 43
       id: data.id,
43 44
       activityTitle: data.activityTitle,
44 45
       activityCarouselImg: data.activityCarouselImg, // 轮播图

+ 30
- 0
VUECODE/smart-property-manage/src/api/transaction.js ファイルの表示

@@ -23,3 +23,33 @@ export function updateTransactionById(id) {
23 23
     method: 'post'
24 24
   })
25 25
 }
26
+
27
+export function transactionsList(data) {
28
+  return request({
29
+    url: '/transactions',
30
+    method: 'post',
31
+    data: {
32
+      transactionTitle: data.transactionTitle,
33
+      id: data.id,
34
+      userName: data.userName,
35
+      status: data.status,
36
+      pageNum: data.pageNum,
37
+      pageSize: data.pageSize
38
+    }
39
+  })
40
+}
41
+
42
+export function transactionsAdd(data) {
43
+  return request({
44
+    url: '/transactions/add',
45
+    method: 'post',
46
+    data: {
47
+      transactionTitle: data.transactionTitle,
48
+      id: data.id,
49
+      userName: data.userName,
50
+      status: data.status,
51
+      contentImg: data.contentImg,
52
+      announcementContent: data.announcementContent
53
+    }
54
+  })
55
+}

+ 7
- 0
VUECODE/smart-property-manage/src/router/index.js ファイルの表示

@@ -117,6 +117,13 @@ export const constantRouterMap = [
117 117
         name: 'transaction-import',
118 118
         meta: { title: '二手等管理', icon: 'table' }
119 119
       },
120
+      {
121
+        path: '/transaction/transaction',
122
+        component: () => import('@/views/social/transaction/transactionAdd'),
123
+        name: 'transaction-add',
124
+        hidden: true,
125
+        meta: { title: '添加二手求购', icon: 'table' }
126
+      },
120 127
       {
121 128
         path: '/transaction/info',
122 129
         component: () => import('@/views/social/transaction/info/transactionInfo'),

+ 19
- 1
VUECODE/smart-property-manage/src/store/modules/transaction.js ファイルの表示

@@ -1,4 +1,4 @@
1
-import { fetchList, transactionById, updateTransactionById } from '@/api/transaction'
1
+import { fetchList, transactionById, updateTransactionById, transactionsList, transactionsAdd} from '@/api/transaction'
2 2
 
3 3
 const transaction = {
4 4
   namespaced: true,
@@ -47,6 +47,24 @@ const transaction = {
47 47
           reject(error)
48 48
         })
49 49
       })
50
+    },
51
+    TransactionsList({ commit }, data) {
52
+      return new Promise((resolve, reject) => {
53
+        transactionsList(data).then(response => {
54
+          resolve(response)
55
+        }).catch(error => {
56
+          reject(error)
57
+        })
58
+      })
59
+    },
60
+    TransactionsAdd({ commit }, data) {
61
+      return new Promise((resolve, reject) => {
62
+        transactionsAdd(data).then(response => {
63
+          resolve(response)
64
+        }).catch(error => {
65
+          reject(error)
66
+        })
67
+      })
50 68
     }
51 69
   }
52 70
 }

+ 237
- 214
VUECODE/smart-property-manage/src/views/social/transaction/index.vue ファイルの表示

@@ -1,261 +1,284 @@
1
+
1 2
 <template>
2
-  <div class="app-container">
3
-    <div class="filter-container">
4
-      <el-input v-model="listQuery.transactionId" placeholder="帖子编号" style="width: 200px;" class="filter-item" @keyup.enter.native="handleFilter"/>
5
-      <el-input v-model="listQuery.transactionTitle" placeholder="帖子标题" style="width: 200px;" class="filter-item" @keyup.enter.native="handleFilter"/>
6
-      <el-select v-model="listQuery.status" placeholder="发布状态" style="width: 130px" class="filter-item">
7
-        <el-option label="已发布" value="1"/>
8
-        <el-option label="已作废" value="0"/>
9
-      </el-select>
10
-      <el-select v-model="listQuery.isReported" placeholder="是否被举报" class="filter-item" style="width: 130px">
11
-        <el-option label="无举报" value="0"/>
12
-        <el-option label="被举报" value="1"/>
13
-      </el-select>
14
-      <el-button v-waves class="filter-item" type="info" @click="clearListQuery">清空</el-button>
15
-      <el-button v-waves class="filter-item" type="primary" @click="handleFilter">查询</el-button>
3
+  <div class="root">
4
+    <el-form :inline="true" :model="listQuery" class="form-listQuery">
5
+      <el-form-item class="filter-item" label="话题编号">
6
+        <el-input v-model.trim="listQuery.id" onkeyup="this.value=this.value.replace(/\D/g,'')" placeholder="话题编号" />
7
+      </el-form-item>
8
+      <el-form-item class="filter-item" label="话题标题" >
9
+        <el-input v-model.trim="listQuery.transactionTitle" placeholder="话题标题" />
10
+      </el-form-item>
11
+      <el-form-item class="filter-item" label="话题发布人" >
12
+        <el-input v-model.trim="listQuery.userName" placeholder="话题发布人" />
13
+      </el-form-item>
14
+      <el-form-item class="filter-item" label="话题类型" >
15
+        <el-select v-model="listQuery.status" placeholder="请选择">
16
+         <el-option label="选择状态" value="" />
17
+         <el-option label="议事大厅" value="0"/>
18
+         <el-option label="友令互助" value="1"/>
19
+         <!-- -1包括,二手,租赁,求购 -->
20
+         <el-option label="二手租赁" value="-1"/>
21
+         <el-option label="其他" value="3"/>
22
+        </el-select>
23
+      </el-form-item>
24
+      <el-form-item>
25
+        <el-button type="info" class="filter-item" @click="handleFilter">清空</el-button>
26
+        <el-button type="primary" @click="search">查询</el-button>
27
+      </el-form-item>
28
+    </el-form>
29
+    <div class="button">
30
+      <el-button type="primary" @click="add">添加</el-button>
31
+      <el-button type="warning" @click="edit">修改</el-button>
32
+      <el-button type="danger" @click="deleteAnnouncement">作废</el-button>
16 33
     </div>
17
-
18 34
     <el-table
19 35
       v-loading="listLoading"
20
-      :key="tableKey"
21
-      :data="transactionList"
36
+      ref="multipleTable"
37
+      :data="transactionsList"
22 38
       border
23
-      fit
24
-      highlight-current-row
39
+      tooltip-effect="dark"
25 40
       style="width: 100%; margin-top: 20px;"
26
-      @sort-change="sortChange">
27
-      <el-table-column label="编号" align="center">
28
-        <template slot-scope="scope">
29
-          <span>{{ scope.row.id }}</span>
30
-        </template>
31
-      </el-table-column>
32
-      <el-table-column label="类型" align="center">
33
-        <template slot-scope="scope">
34
-          <span v-if="scope.row.type === '0'">二手</span>
35
-          <span v-if="scope.row.type === '1'">求购</span>
36
-          <span v-if="scope.row.type === '2'">租赁</span>
37
-        </template>
38
-      </el-table-column>
39
-      <el-table-column label="标题" align="center">
40
-        <template slot-scope="scope">
41
-          <span @click="handleLook(scope.row.id)" style="color: #409EFF;cursor: pointer">{{ scope.row.transactionTitle }}</span>
42
-        </template>
43
-      </el-table-column>
44
-      <el-table-column label="查看人数" align="center">
45
-        <template slot-scope="scope">
46
-          <span>{{ scope.row.viewCount }}</span>
47
-        </template>
48
-      </el-table-column>
49
-      <el-table-column label="发布人" align="center">
50
-        <template slot-scope="scope">
51
-          <span>{{ scope.row.userName }}</span>
52
-        </template>
53
-      </el-table-column>
54
-      <el-table-column label="发布时间" align="center">
55
-        <template slot-scope="scope">
56
-          <span>{{ formatDate(scope.row.createDate) }}</span>
57
-        </template>
58
-      </el-table-column>
59
-      <el-table-column label="发布状态" align="center">
60
-        <template slot-scope="scope">
61
-          <span v-if="scope.row.status === '0'">已作废</span>
62
-          <span v-if="scope.row.status === '1'">已发布</span>
63
-        </template>
64
-      </el-table-column>
65
-      <el-table-column label="举报状态" align="center">
66
-        <template slot-scope="scope">
67
-          <span>{{ scope.row.isReported === '1' ? "被举报" : "无举报" }}</span>
68
-        </template>
69
-      </el-table-column>
70
-    </el-table>
71
-
72
-    <!-- <pagination v-show="total>0" :total="total" :current-page.sync="listQuery.pageNum" :limit.sync="listQuery.pageSize" :page-sizes="[5, 10, 20, 30]" @pagination="getList" /> -->
73
-    <el-pagination
74
-      :total="total"
75
-      :current-page="listQuery.pageNum"
76
-      :page-sizes="[5, 10, 20, 30]"
77
-      :page-size="listQuery.pageSize"
78
-      layout="total, sizes, prev, pager, next, jumper"
79
-      @size-change="handleSizeChange"
80
-      @current-change="handleCurrentChange"/>
41
+      @selection-change="handleSelectionChange">
42
+      <el-table-column
43
+        type="selection"
44
+        width="55"/>
45
+      <el-table-column prop="id" label="话题编号" align="center"/>
46
+       <el-table-column prop="type" label="话题类型" align="center"/>
47
+      <el-table-column prop="transactionTitle" label="话题标题" align="center"/>
48
+      <el-table-column prop="userName" label="发布人" align="center"/>
49
+      <el-table-column prop="createDate" label="发布时间" align="center"><template slot-scope="scope">{{ formatDate(scope.row.createDate) }}</template></el-table-column>
81 50
 
51
+      <el-table-column prop="viewCount" label="查看人数" align="center"/>
52
+      <el-table-column prop="transactionLikeSum" label="点赞数" align="center"/>
53
+      <el-table-column prop="transactionNoLikeSum" label="点衰数" align="center"/>
54
+      <el-table-column prop="replySum" label="回复数" align="center"/>
55
+      <el-table-column prop="reportSum" label="举报数量" align="center"/>
56
+    </el-table>
57
+    <div class="block">
58
+      <el-pagination
59
+        :current-page.sync="listQuery.pageNum"
60
+        :page-sizes="[10, 20, 50, 100]"
61
+        :page-size.sync="listQuery.pageSize"
62
+        :total="total"
63
+        layout="total, sizes, prev, pager, next, jumper"
64
+        @size-change="handleSizeChange"
65
+        @current-change="handleCurrentChange"/>
66
+    </div>
82 67
   </div>
83 68
 </template>
84 69
 
85 70
 <script>
86
-import { mapState, mapActions, mapMutations } from 'vuex'
87
-import waves from '@/directive/waves' // Waves directive
88
-import { parseTime } from '@/utils'
71
+import { mapActions } from 'vuex'
89 72
 
90 73
 export default {
91
-  computed: {
92
-    ...mapState('transaction', {
93
-      transactionList: s => s.transactionList,
94
-      total: s => s.total
95
-    })
96
-  },
97
-  directives: { waves },
98 74
   data() {
99
-    var _self = this
100 75
     return {
101
-      events: {
102
-        click: (e) => {
103
-          // _self.postData.Coordinate = e.lnglat.lat + ',' + e.lnglat.lng
104
-          _self.detail.longitude = e.lnglat.lng
105
-          _self.detail.latitude = e.lnglat.lat
106
-        }
107
-      },
108
-      markers: [],
109
-      searchOption: {
110
-        city: '南京',
111
-        citylimit: false
112
-      },
113
-      listLoading: true,
114 76
       listQuery: {
77
+        communityId: '',
78
+				createDate:'',
79
+				createUser:'',
80
+				id:'',
81
+				isReported:'',
82
+				status:'',
83
+				taUserId:'',
84
+				transactionContent:'',
85
+				transactionTitle:'',
86
+				type:'',
87
+				updateDate:'',
88
+				updateUser:'',
89
+				userName:'',
90
+        viewCount:'',
115 91
         pageNum: 1,
116
-        pageSize: 20,
117
-        transactionId: undefined,
118
-        transactionTitle: undefined,
119
-        status: undefined,
120
-        isReported: undefined
92
+        pageSize: 10
121 93
       },
122
-      tableKey: 0,
123
-      downloadLoading: false
94
+      total: 0, // 数据总数
95
+      transactionsList: [],
96
+      deleteIds: [], // 选择的id集合
97
+      listLoading: true // 加载圈
124 98
     }
125 99
   },
126
-  created() {
127
-    this.getList()
100
+  mounted() {
101
+    // 获取数据
102
+    this.dataQuery()
128 103
   },
129 104
   methods: {
130
-    ...mapMutations('transaction', {
131
-    }),
132
-    ...mapActions('transaction', [
133
-      'FetchTransactionList'
105
+    ...mapActions('listAnnouncement', [
106
+      'BserPassCertification'
134 107
     ]),
135
-    setCurrent(item) {
136
-      this.setDetail({ ...item })
108
+    handleSizeChange(val) {
109
+      console.log(`每页 ${val} 条`)
110
+      this.listQuery.pageSize = val
111
+      this.dataQuery()
112
+    },
113
+    handleCurrentChange(val) {
114
+      console.log(`当前页: ${val}`)
115
+      this.listQuery.pageNum = val
116
+      this.dataQuery()
117
+    },
118
+    padDate(value) {
119
+      value = value < 10 ? '0' + value : value
120
+      return value
137 121
     },
138
-    getList() {
122
+    getStatus(row) { // 获取状态
123
+      let statusName = ''
124
+
125
+      // 判断状态
126
+      switch (row.status) {
127
+        case '0':
128
+          statusName = '已作废'
129
+          break
130
+        case '1':
131
+          statusName = '已发布'
132
+          break
133
+        case '2':
134
+          statusName = '草稿'
135
+          break
136
+      }
137
+
138
+      // 如果修改时间和创建时间不一致, 就显示已修改
139
+      if (row.status === '1' && (row.updateDate > row.createDate)) {
140
+        statusName = '已修改'
141
+      }
142
+
143
+      return statusName
144
+    },
145
+    dataQuery() { // 查询数据
146
+    
147
+    console.log('this.listQuery.transactionTitle',this.listQuery.transactionTitle)
139 148
       this.listLoading = true
140
-      this.FetchTransactionList(this.listQuery).then(() => {
149
+      this.$store.dispatch('transaction/TransactionsList', this.listQuery).then((res) => {
150
+        const resData = res.data
151
+        this.transactionsList = resData.list
152
+        this.listQuery.pageNum = resData.pageNum
153
+        this.listQuery.pageSize = resData.pageSize
154
+        this.total = resData.total
141 155
         this.listLoading = false
142 156
       }).catch(() => {
143
-        this.loading = false
144
-        console.log('get list error')
157
+        this.listLoading = false
158
+        console.log('error TransactionsList')
145 159
       })
146 160
     },
147
-    clearListQuery() {
161
+    handleSelectionChange(data) {
162
+      // 设置为 空
163
+      this.deleteIds = []
164
+      for (let i = 0; i < data.length; i++) {
165
+        this.deleteIds.push(data[i].id)
166
+      }
167
+    },
168
+	  search() {
148 169
       this.listQuery.pageNum = 1
149
-      this.listQuery.pageSize = 20
150
-      this.listQuery.transactionId = undefined
151
-      this.listQuery.transactionTitle = undefined
152
-      this.listQuery.status = undefined
153
-      this.listQuery.isReported = undefined
154
-      this.getList()
170
+      this.dataQuery()
155 171
     },
156 172
     handleFilter() {
157 173
       this.listQuery.pageNum = 1
158
-      this.getList()
174
+      this.listQuery.pageSize = 10
175
+      this.listQuery.ownerName =''
176
+      this.listQuery.id=''
177
+      this.listQuery.status=''
178
+      this.listQuery.userName=''
179
+      this.dataQuery()
159 180
     },
160
-    handleModifyStatus(row, status) {
161
-      this.$message({
162
-        message: '操作成功',
163
-        type: 'success'
164
-      })
165
-      row.status = status
181
+    // 添加公告
182
+    add() {
183
+      this.$router.push({ name: 'transaction-add' })
166 184
     },
167
-    sortChange(data) {
168
-      const { prop, order } = data
169
-      if (prop === 'id') {
170
-        this.sortByID(order)
185
+    edit(){// 编辑公告
186
+      const ids = this.deleteIds
187
+      if (ids.length > 1) {
188
+        this.$message.error('只能选择一行数据进行修改!')
189
+        return
171 190
       }
172
-    },
173
-    handleSizeChange(val) {
174
-      // console.log(`每页 ${val} 条`);
175
-      this.listQuery.pageSize = val
176
-      this.getList()
177
-    },
178
-    handleCurrentChange(val) {
179
-      // console.log(`当前页: ${val}`);
180
-      this.listQuery.pageNum = val
181
-      this.getList()
182
-    },
183
-    sortByID(order) {
184
-      if (order === 'ascending') {
185
-        this.listQuery.sort = '+id'
186
-      } else {
187
-        this.listQuery.sort = '-id'
191
+      if (ids < 1) {
192
+        this.$message.error('请选择一行数据进行修改!')
193
+        return
188 194
       }
189
-      this.handleFilter()
190
-    },
191
-    handleUpdate(row) {
192
-      this.setCurrent(row)
193
-      this.dialogStatus = 'update'
194
-      this.dialogFormVisible = true
195
-      this.$nextTick(() => {
196
-        this.$refs['dataForm'].clearValidate()
197
-      })
198
-      this.getEditCityList()
199
-      this.getEditDistrictList()
200
-    },
201
-    handleLook(id) {
202
-      this.$router.push({ name: 'transaction-info', params: { id: id }})
203
-    },
204
-    handleCreate() {
205
-      this.resetDetail()
206
-      this.dialogStatus = 'create'
207
-      this.dialogFormVisible = true
208
-      this.$nextTick(() => {
209
-        this.$refs['dataForm'].clearValidate()
210
-      })
211
-    },
212
-    handleDelete(row) {
213
-      this.$notify({
214
-        title: '成功',
215
-        message: '删除成功',
216
-        type: 'success',
217
-        duration: 2000
218
-      })
219
-      const index = this.list.indexOf(row)
220
-      this.list.splice(index, 1)
195
+       let ide= this.deleteIds[0]
196
+       this.listQuery.id = ide
197
+      this.$store.dispatch('AnnouncementById', this.listQuery).then((res) => {
198
+        const resData = res.data
199
+        const announcement = resData.tpAnnouncement
200
+        const imgList = resData.studentList
201
+        this.listQuery = announcement
202
+        this.listQuery.announcementTitle = ''
203
+        console.log("1",this.listQuery.status)
204
+        if(this.listQuery.status == 0){
205
+          this.$message.error('已作废不可以修改')
206
+          return
207
+        }
208
+       this.$router.push({ name: 'announcement-edit', params: { id: ids[0] }})
209
+      }) 
210
+      },
211
+    deleteAnnouncement(){
212
+       let ide= this.deleteIds[0]
213
+       this.listQuery.id = ide 
214
+      this.$store.dispatch('AnnouncementById', this.listQuery).then((res) => {
215
+        const resData = res.data
216
+        const announcement = resData.tpAnnouncement
217
+        const imgList = resData.studentList
218
+        this.listQuery.status= announcement.status
219
+        console.log("1",this.listQuery.status)
220
+        if(this.listQuery.status == 0){
221
+          this.$message.error('已作废不可以作废')
222
+          return
223
+        }
224
+        this.deleteId()     
225
+      })    
221 226
     },
222
-    handleDownload() {
223
-      this.downloadLoading = true
224
-      import('@/vendor/Export2Excel').then(excel => {
225
-        const tHeader = ['timestamp', 'title', 'type', 'importance', 'status']
226
-        const filterVal = ['timestamp', 'title', 'type', 'importance', 'status']
227
-        const data = this.formatJson(filterVal, this.list)
228
-        excel.export_json_to_excel({
229
-          header: tHeader,
230
-          data,
231
-          filename: 'table-list'
232
-        })
233
-        this.downloadLoading = false
227
+
228
+    deleteId(){
229
+       const ids = this.deleteIds
230
+      this.listLoading = true
231
+      console.log(ids)
232
+      this.$store.dispatch('DeleteAnnouncement', ids).then((res) => {
233
+        this.listLoading = false
234
+        this.listQuery.announcementTitle = ''
235
+        this.dataQuery()
236
+      }).catch(() => {
237
+        this.listLoading = false
238
+        console.log('error DeleteAnnouncement')
234 239
       })
235 240
     },
236
-    padDate(value) {
237
-      value = value < 10 ? '0' + value : value
238
-      return value
241
+
242
+
243
+    clickTitle(id) {
244
+      this.$router.push({ name: 'contentParticulars-details', query: { id: id }})
239 245
     },
240 246
     formatDate(val) {
247
+      if (val === null) {
248
+        return ''
249
+      }
241 250
       var value = new Date(val)
242 251
       var year = value.getFullYear()
243
-      var month = this.padDate(value.getMonth() + 1)
244
-      var day = this.padDate(value.getDate())
245
-      var hour = this.padDate(value.getHours())
246
-      var minutes = this.padDate(value.getMinutes())
247
-      var seconds = this.padDate(value.getSeconds())
248
-      return year + '-' + month + '-' + day + ' ' + hour + ':' + minutes + ':' + seconds
249
-    },
250
-    formatJson(filterVal, jsonData) {
251
-      return jsonData.map(v => filterVal.map(j => {
252
-        if (j === 'timestamp') {
253
-          return parseTime(v[j])
254
-        } else {
255
-          return v[j]
256
-        }
257
-      }))
258
-    },
252
+      var month = value.getMonth() + 1
253
+      var day = value.getDate()
254
+      return year + '-' + month + '-' + day
255
+    }
259 256
   }
260 257
 }
261 258
 </script>
259
+
260
+<style scoped>
261
+.root{
262
+  display: flex;
263
+  flex-flow: column;
264
+}
265
+.form-listQuery{
266
+  margin-top: 20px;
267
+  margin-left: 30px;
268
+}
269
+.operation{
270
+  display: flex;
271
+  justify-content: space-between;
272
+  margin-left: 20px;
273
+  margin-right: 20px;
274
+}
275
+.block{
276
+  display: flex;
277
+  justify-content: flex-end;
278
+  margin-top: 10px;
279
+}
280
+.button {
281
+  margin-left: 20px;
282
+}
283
+</style>
284
+

+ 191
- 0
VUECODE/smart-property-manage/src/views/social/transaction/transactionAdd.vue ファイルの表示

@@ -0,0 +1,191 @@
1
+<template>
2
+  <div id="root">
3
+    <el-form ref="ruleForm" :model="ruleForm" :rules="rules" label-position="top" label-width="150px" class="ruleForm">
4
+
5
+    <el-form-item class="filter-item" label="话题类型" >
6
+        <el-select v-model="ruleForm.status" placeholder="请选择">
7
+         <el-option label="选择状态" value="" />
8
+         <el-option label="议事大厅" value="0"/>
9
+         <el-option label="友令互助" value="1"/>
10
+         <!-- -1包括,二手,租赁,求购 -->
11
+         <el-option label="二手租赁" value="-1"/>
12
+         <el-option label="其他" value="3"/>
13
+        </el-select>
14
+      </el-form-item>
15
+      <el-form-item label="话题标题" prop="transactionTitle">
16
+        <el-input v-model="ruleForm.transactionTitle" placeholder="20字以内"/>
17
+      </el-form-item>
18
+      <el-form-item label="话题详细描述">
19
+        <el-input v-model="ruleForm.announcementContent" :rows="10" type="textarea" placeholder="内容,规则,时间等"/>
20
+      </el-form-item>
21
+      <el-form-item label="话题配图">
22
+        <el-upload
23
+          :on-preview="handlePictureCardPreview"
24
+          :on-remove="handleRemove"
25
+          :on-success="handleSuccessContentImg"
26
+          name="uploadFiles"
27
+          action="http://106.14.20.193:8086/property-api/uploadimage"
28
+          list-type="picture-card">
29
+          <i class="el-icon-plus"/>
30
+        </el-upload>
31
+        <el-dialog :visible.sync="dialogVisible">
32
+          <img :src="dialogImageUrl" width="100%" alt="">
33
+        </el-dialog>
34
+      </el-form-item>
35
+      <el-form-item label="权重值" prop="sort">
36
+        <el-input-number v-model="ruleForm.sort" label="权重值" @change="sortHandleChange"/>
37
+      </el-form-item>
38
+      <el-form-item>
39
+        <el-button @click="resetForm('ruleForm','2')">存为草稿</el-button>
40
+        <el-button type="primary" @click="submitForm('ruleForm','1')">发布</el-button>
41
+      </el-form-item>
42
+    </el-form>
43
+  </div>
44
+</template>
45
+
46
+<script>
47
+export default {
48
+  name: 'Index',
49
+  data() {
50
+    return {
51
+      ruleForm: {
52
+        sort: '',
53
+        communityId: '',
54
+        createDate:'',
55
+        createUser:'',
56
+        id:'',
57
+        isReported:'',
58
+        status:'',
59
+        taUserId:'',
60
+        transactionContent:'',
61
+        transactionTitle:'',
62
+        type:'',
63
+        updateDate:'',
64
+        updateUser:'',
65
+        userName:'',
66
+        viewCount:'',
67
+        announcementCarouselImg: '', // 轮播图
68
+        announcementContent: '', // 内容详细
69
+        contentImg: [], // 内容配图
70
+        sort: 1, // 权重
71
+        status: '' // 状态 0 是已作废 1 是已发布   2 是草稿 3 是已修改
72
+      },
73
+      imageUrl: '', // 轮播图预览
74
+      dialogVisible: false, // 活动配图, 默认不显示 (以单张为单位)
75
+      dialogImageUrl: '', // 活动配图, 图片链接 (以单张为单位)
76
+      rules: {
77
+        announcementTitle: [
78
+          { required: true, message: '请输入公告名称', trigger: 'blur' },
79
+          { min: 1, max: 20, message: '长度在 15 个字符以内', trigger: 'blur' }
80
+        ],
81
+        announcementContent: [
82
+          { required: true, message: '公告详细描述', trigger: 'blur' }
83
+        ],
84
+        sort: [
85
+          { required: true, message: '请输入权重值', trigger: 'change' }
86
+        ]
87
+      }
88
+    }
89
+  },
90
+  methods: {
91
+    submitForm(formName, status) {
92
+      console.log(status)
93
+      // 加载框
94
+    //   const loading = this.$loading({
95
+    //     lock: true,
96
+    //     text: 'Loading',
97
+    //     spinner: 'el-icon-loading',
98
+    //     background: 'rgba(0, 0, 0, 0.7)'
99
+    //   })
100
+      this.$refs[formName].validate((valid) => {
101
+        if (valid) {
102
+          if (this.ruleForm.announcementContent.length <= 0 && this.ruleForm.contentImg.length <= 0) {
103
+            this.$message.error('公告内容描述 和 公告配图至少要存在一个!')
104
+            return
105
+          }
106
+          this.ruleForm.status = status // 发布状态
107
+          this.$store.dispatch('transaction/TransactionsAdd', this.ruleForm).then((res) => {
108
+            if (res.code === '0') {
109
+              this.$message({
110
+                message: res.message,
111
+                type: 'success'
112
+              })
113
+              this.$router.push({ name: 'announcement-index' })
114
+              loading.close()
115
+              return
116
+            }
117
+            this.$message.error(res.message)
118
+            loading.close()
119
+          }).catch(() => {
120
+            console.log('error AddActivity')
121
+          })
122
+        } else {
123
+          console.log('error submit!!')
124
+          loading.close()
125
+          return false
126
+        }
127
+      })
128
+      // 关闭加载框
129
+      loading.close()
130
+    },
131
+    resetForm(formName, status) {
132
+      console.log(status)
133
+      this.submitForm(formName, status)
134
+    },
135
+    handleRemove(file, fileList) { // 活动配图移除时
136
+      this.ruleForm.contentImg = []
137
+      for (let i = 0; i < fileList.length; i++) {
138
+        this.ruleForm.contentImg.push(fileList[i].response.data[0])
139
+      }
140
+      console.log(file, fileList)
141
+    },
142
+    handlePictureCardPreview(file) { // 点击活动配图文件列表中已上传的文件时的钩子
143
+      this.dialogImageUrl = file.url
144
+      this.dialogVisible = true
145
+    },
146
+    handleSuccessContentImg(response, file, fileList) { // 活动配图上传成功时回调
147
+      const resImg = response.data[0]
148
+      this.ruleForm.contentImg.push(resImg)
149
+    },
150
+    sortHandleChange(value) { // 权重值
151
+      this.ruleForm.sort = value
152
+      console.log(value)
153
+    }
154
+  }
155
+}
156
+</script>
157
+
158
+<style scoped>
159
+#root {
160
+  display: flex;
161
+}
162
+.ruleForm {
163
+  width: 800px;
164
+  margin-left: auto;
165
+  margin-right: auto;
166
+  margin-top: 50px;
167
+}
168
+.avatar-uploader .el-upload {
169
+  border: 1px dashed #d9d9d9;
170
+  border-radius: 6px;
171
+  cursor: pointer;
172
+  position: relative;
173
+  overflow: hidden;
174
+}
175
+.avatar-uploader .el-upload:hover {
176
+  border-color: #409EFF;
177
+}
178
+.avatar-uploader-icon {
179
+  font-size: 28px;
180
+  color: #8c939d;
181
+  width: 178px;
182
+  height: 178px;
183
+  line-height: 178px;
184
+  text-align: center;
185
+}
186
+.avatar {
187
+  width: 178px;
188
+  height: 178px;
189
+  display: block;
190
+}
191
+</style>