weiximei 6 yıl önce
ebeveyn
işleme
cf56298030

+ 5
- 1
VUECODE/smart-property-manage/src/views/social/activity/info/index.vue Dosyayı Görüntüle

@@ -20,7 +20,7 @@
20 20
     </div>
21 21
     <span>报名截止时间:{{ formatDate(ruleForm.registrationEndTime) }}</span>
22 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 24
     </div>
25 25
   </div>
26 26
 </template>
@@ -44,6 +44,7 @@ export default {
44 44
         sort: 1, // 权重
45 45
         status: '' // 状态 0 是已作废 1 是已发布   2 是草稿 3 是已修改
46 46
       },
47
+      isEdi: true, // 显示修改按钮
47 48
       innerW: 0 // 进度条
48 49
     }
49 50
   },
@@ -62,6 +63,9 @@ export default {
62 63
           console.log(this.$refs.innerDiv.style.width)
63 64
           console.log(this.innerW)
64 65
         }
66
+        if (this.ruleForm.status === '0') {
67
+          this.isEdi = false
68
+        }
65 69
       })
66 70
     },
67 71
     formatDate(val) {

+ 5
- 5
VUECODE/smart-property-manage/src/views/social/announcement/add.vue Dosyayı Görüntüle

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

+ 13
- 8
VUECODE/smart-property-manage/src/views/social/announcement/details.vue Dosyayı Görüntüle

@@ -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
     },