weiximei 6 yıl önce
ebeveyn
işleme
801b029cea

+ 2
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/model/TpTransaction.java Dosyayı Görüntüle

@@ -1,5 +1,6 @@
1 1
 package com.community.huiju.model;
2 2
 
3
+import com.baomidou.mybatisplus.annotation.TableField;
3 4
 import com.baomidou.mybatisplus.annotation.TableName;
4 5
 import lombok.Data;
5 6
 import lombok.EqualsAndHashCode;
@@ -89,6 +90,7 @@ public class TpTransaction implements Serializable {
89 90
     /**
90 91
      * 创建人
91 92
      */
93
+    @TableField(exist = false)
92 94
     private String userName;
93 95
 
94 96
 

+ 5
- 2
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/TransactionServiceImpl.java Dosyayı Görüntüle

@@ -19,6 +19,7 @@ import org.springframework.stereotype.Service;
19 19
 
20 20
 import java.util.List;
21 21
 import java.util.Map;
22
+import java.util.stream.Collectors;
22 23
 
23 24
 /**
24 25
  * <p>
@@ -63,10 +64,12 @@ public class TransactionServiceImpl extends ServiceImpl<TpTransactionMapper, TpT
63 64
 		QueryWrapper<TdImages> queryWrapper = new QueryWrapper<>();
64 65
 		queryWrapper.eq("uuid", id);
65 66
 		queryWrapper.eq("type", "transaction");
66
-		List<TdImages> list = tdImagesMapper.selectList(queryWrapper);
67
+		List<TdImages> imagesList = tdImagesMapper.selectList(queryWrapper);
68
+		// 转换, 只保留 imageUrl 字段
69
+		List<String> stringList = imagesList.stream().map(e->new String(e.getImageUrl())).collect(Collectors.toList());
67 70
 		Map<String,Object> map = Maps.newHashMap();
68 71
 		map.put("tpTransaction",tpTransaction);
69
-		map.put("list",list);
72
+		map.put("list",stringList);
70 73
 		responseBean.addSuccess(map);
71 74
 		return responseBean;
72 75
 	}

+ 2
- 2
VUECODE/smart-property-manage/src/store/modules/transaction.js Dosyayı Görüntüle

@@ -30,9 +30,9 @@ const transaction = {
30 30
         })
31 31
       })
32 32
     },
33
-    TransactionById({ commit, state }, data) { // 查询二手租赁详情
33
+    TransactionById({ commit, state }, id) { // 查询二手租赁详情
34 34
       return new Promise((resolve, reject) => {
35
-        transactionById(data).then(response => {
35
+        transactionById(id).then(response => {
36 36
           resolve(response)
37 37
         }).catch(error => {
38 38
           reject(error)

+ 17
- 17
VUECODE/smart-property-manage/src/views/social/transaction/info/transactionInfo.vue Dosyayı Görüntüle

@@ -1,9 +1,8 @@
1 1
 <template>
2 2
   <div id="root">
3
-    <span class="activityTile">{{ ruleForm.activityTitle }}</span>
4
-    <img :src="ruleForm.activityCarouselImg" width="700" height="500">
3
+    <span class="activityTile">{{ ruleForm.transactionTitle }}</span>
5 4
     <div class="activityContext">
6
-      {{ ruleForm.activityContent }}
5
+      {{ ruleForm.transactionContent }}
7 6
     </div>
8 7
     <div class="activityContextImg">
9 8
       <img v-for="item in ruleForm.contentImg" :src="item" width="700" height="500" >
@@ -12,21 +11,17 @@
12 11
 </template>
13 12
 
14 13
 <script>
14
+import { mapState, mapActions, mapMutations } from 'vuex'
15
+
15 16
 export default {
16 17
   data() {
17 18
     return {
18 19
       asOfdate: '2018/10/10 23:59:59',
19 20
       ruleForm: {
20 21
         id: '',
21
-        activityTitle: '',
22
-        activityCarouselImg: '', // 轮播图
23
-        activityContent: '', // 活动内容详细
24
-        contentImg: [], // 活动内容配图
25
-        signUpCount: '', // 报名人数统计
26
-        signUpMax: '', //  活动人数上限
27
-        registrationEndTime: '', // 报名活动结束时间
28
-        sort: 1, // 权重
29
-        status: '' // 状态 0 是已作废 1 是已发布   2 是草稿 3 是已修改
22
+        transactionTitle: '',
23
+        transactionContent: '', // 交易内容详细
24
+        contentImg: [] // 活动内容配图
30 25
       }
31 26
     }
32 27
   },
@@ -34,12 +29,17 @@ export default {
34 29
     this.getById(this.$route.params.id)
35 30
   },
36 31
   methods: {
32
+    ...mapActions('transaction', [
33
+      'TransactionById'
34
+    ]),
37 35
     getById(id) { // 根据ID获取活动信息
38
-      alert(id)
39
-      this.$store.dispatch('TransactionById', id).then((res) => {
40
-        const resData = res.data
41
-        this.ruleForm = resData.info
42
-        this.ruleForm.contentImg = resData.contentImg
36
+      this.TransactionById(id).then((res) => {
37
+        const resData = res.data.tpTransaction
38
+        this.ruleForm.transactionTitle = resData.transactionTitle
39
+        this.ruleForm.transactionContent = resData.transactionContent
40
+        this.ruleForm.contentImg = res.data.list
41
+      }).catch(() => {
42
+        console.log('get list error')
43 43
       })
44 44
     }
45 45
   }