|
@@ -11,7 +11,7 @@
|
11
|
11
|
</template>
|
12
|
12
|
</div>
|
13
|
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
|
15
|
</div>
|
16
|
16
|
</div>
|
17
|
17
|
</template>
|
|
@@ -32,7 +32,8 @@ export default {
|
32
|
32
|
registrationEndTime: '', // 报名活动结束时间
|
33
|
33
|
sort: 1, // 权重
|
34
|
34
|
status: '' // 状态 0 是已作废 1 是已发布 2 是草稿 3 是已修改
|
35
|
|
- }
|
|
35
|
+ },
|
|
36
|
+ isEdi: true // 默认显示修改按钮
|
36
|
37
|
}
|
37
|
38
|
},
|
38
|
39
|
mounted() {
|
|
@@ -43,13 +44,17 @@ export default {
|
43
|
44
|
this.ruleForm.id = this.$route.params.id
|
44
|
45
|
this.$store.dispatch('AnnouncementById', this.ruleForm).then((res) => {
|
45
|
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
|
},
|