Browse Source

修复 bug

weiximei 6 years ago
parent
commit
cf56298030

+ 5
- 1
VUECODE/smart-property-manage/src/views/social/activity/info/index.vue View File

20
     </div>
20
     </div>
21
     <span>报名截止时间:{{ formatDate(ruleForm.registrationEndTime) }}</span>
21
     <span>报名截止时间:{{ formatDate(ruleForm.registrationEndTime) }}</span>
22
     <div class="bom-button">
22
     <div class="bom-button">
23
-      <el-button type="primary" style="width: 100px;" @click="ediActivity">修改</el-button>
23
+      <el-button v-if="isEdi" type="primary" style="width: 100px;" @click="ediActivity">修改</el-button>
24
     </div>
24
     </div>
25
   </div>
25
   </div>
26
 </template>
26
 </template>
44
         sort: 1, // 权重
44
         sort: 1, // 权重
45
         status: '' // 状态 0 是已作废 1 是已发布   2 是草稿 3 是已修改
45
         status: '' // 状态 0 是已作废 1 是已发布   2 是草稿 3 是已修改
46
       },
46
       },
47
+      isEdi: true, // 显示修改按钮
47
       innerW: 0 // 进度条
48
       innerW: 0 // 进度条
48
     }
49
     }
49
   },
50
   },
62
           console.log(this.$refs.innerDiv.style.width)
63
           console.log(this.$refs.innerDiv.style.width)
63
           console.log(this.innerW)
64
           console.log(this.innerW)
64
         }
65
         }
66
+        if (this.ruleForm.status === '0') {
67
+          this.isEdi = false
68
+        }
65
       })
69
       })
66
     },
70
     },
67
     formatDate(val) {
71
     formatDate(val) {

+ 5
- 5
VUECODE/smart-property-manage/src/views/social/announcement/add.vue View File

75
     }
75
     }
76
   },
76
   },
77
   methods: {
77
   methods: {
78
-    submitForm(formName,status) {
78
+    submitForm(formName, status) {
79
       console.log(status)
79
       console.log(status)
80
       // 加载框
80
       // 加载框
81
       const loading = this.$loading({
81
       const loading = this.$loading({
88
         if (valid) {
88
         if (valid) {
89
           if (this.ruleForm.announcementContent.length <= 0 && this.ruleForm.contentImg.length <= 0) {
89
           if (this.ruleForm.announcementContent.length <= 0 && this.ruleForm.contentImg.length <= 0) {
90
             this.$message.error('公告内容描述 和 公告配图至少要存在一个!')
90
             this.$message.error('公告内容描述 和 公告配图至少要存在一个!')
91
-            return 
91
+            return
92
           }
92
           }
93
           this.ruleForm.status = status // 发布状态
93
           this.ruleForm.status = status // 发布状态
94
           this.$store.dispatch('AddAnnouncement', this.ruleForm).then((res) => {
94
           this.$store.dispatch('AddAnnouncement', this.ruleForm).then((res) => {
112
           return false
112
           return false
113
         }
113
         }
114
       })
114
       })
115
-       // 关闭加载框
115
+      // 关闭加载框
116
       loading.close()
116
       loading.close()
117
     },
117
     },
118
-    resetForm(formName,status) {
118
+    resetForm(formName, status) {
119
       console.log(status)
119
       console.log(status)
120
-      this.submitForm(formName,status)
120
+      this.submitForm(formName, status)
121
     },
121
     },
122
     handleAvatarSuccess(res, file) { // 轮播图上传回调
122
     handleAvatarSuccess(res, file) { // 轮播图上传回调
123
       this.ruleForm.announcementCarouselImg = res.data[0]
123
       this.ruleForm.announcementCarouselImg = res.data[0]

+ 13
- 8
VUECODE/smart-property-manage/src/views/social/announcement/details.vue View File

11
       </template>
11
       </template>
12
     </div>
12
     </div>
13
     <div class="bom-button">
13
     <div class="bom-button">
14
-      <el-button type="primary" style="width: 150px;" @click="edi">修改</el-button>
14
+      <el-button v-if="isEdi" type="primary" style="width: 150px;" @click="edi">修改</el-button>
15
     </div>
15
     </div>
16
   </div>
16
   </div>
17
 </template>
17
 </template>
32
         registrationEndTime: '', // 报名活动结束时间
32
         registrationEndTime: '', // 报名活动结束时间
33
         sort: 1, // 权重
33
         sort: 1, // 权重
34
         status: '' // 状态 0 是已作废 1 是已发布   2 是草稿 3 是已修改
34
         status: '' // 状态 0 是已作废 1 是已发布   2 是草稿 3 是已修改
35
-      }
35
+      },
36
+      isEdi: true // 默认显示修改按钮
36
     }
37
     }
37
   },
38
   },
38
   mounted() {
39
   mounted() {
43
       this.ruleForm.id = this.$route.params.id
44
       this.ruleForm.id = this.$route.params.id
44
       this.$store.dispatch('AnnouncementById', this.ruleForm).then((res) => {
45
       this.$store.dispatch('AnnouncementById', this.ruleForm).then((res) => {
45
         const resData = res.data
46
         const resData = res.data
46
-        this.ruleForm.announcementTitle = resData.tpAnnouncement.announcementTitle // 标题
47
-        this.ruleForm.announcementContent = resData.tpAnnouncement.announcementContent // 内容
48
-        this.ruleForm.announcementCarouselImg = resData.tpAnnouncement.announcementCarouselImg // 轮播图
49
-        this.sort = resData.tpAnnouncement.sort
47
+        const announcement = resData.tpAnnouncement
48
+        const imgList = resData.studentList
49
+        this.ruleForm = announcement
50
         // 多张图片进行遍历
50
         // 多张图片进行遍历
51
-        for (let i = 0; i < resData.studentList.length; i++) {
52
-          this.ruleForm.contentImg.push({ url: resData.studentList[i].imageUrl })
51
+        this.ruleForm.contentImg = []
52
+        for (let i = 0; i < imgList.length; i++) {
53
+          this.ruleForm.contentImg.push({ url: imgList[i].imageUrl })
54
+        }
55
+        console.log('详情', resData)
56
+        if (this.ruleForm.status === '0') {
57
+          this.isEdi = false
53
         }
58
         }
54
       })
59
       })
55
     },
60
     },