Browse Source

赛课活动——删除活动

XW 1 year ago
parent
commit
f70e541226

+ 24 - 2
TEAMModelOS/ClientApp/src/view/signupActivity/infoGoing.vue

@@ -12,8 +12,8 @@
                     </span>
                     {{ actInfo.name }}
                 </p>
-                <div class="btn-box">
-                    <Button type="warning" size="small">删除</Button>
+                <div class="btn-box" v-show="isArea || actInfo.scope === 'school'">
+                    <Button type="warning" size="small" @click="delAct()">删除</Button>
                 </div>
                 <!-- <div class="btn-box">
                     <Steps :current="2" size="small">
@@ -655,6 +655,28 @@ export default {
                 }
             })
         },
+        delAct() {
+            this.$Modal.confirm({
+                title: '确定删除本次活动吗?',
+                // content: `确定删除本次活动吗?`,
+                onOk: () => {
+                    let params = {
+                        grant_type: 'delete',
+                        activityId: this.actInfo.id,
+                        owner: this.actInfo.owner,
+                        scope: this.actInfo.scope,
+                    }
+                    this.$api.areaActivity.manageAct(params).then(res => {
+                        if(res.code === 201) {
+                            this.$Message.success('删除成功')
+                            this.$router.go(-1)
+                        } else if(res.code === 200) {
+                            this.$Message.warning('删除失败')
+                        }
+                    })
+                }
+            })
+        },
         deleteApplica(data, index, type) {
             console.log(data, index);
             if(type === 'join') {

+ 23 - 0
TEAMModelOS/ClientApp/src/view/signupActivity/infoReleased.vue

@@ -16,6 +16,7 @@
                     <template v-if="!actInfo.needConfirmed">
                         <Button type="success" size="small" @click="publishNow()">立即发布</Button>
                         <Button type="primary" size="small">修改</Button>
+                        <Button type="warning" size="small" @click="delAct()">删除</Button>
                     </template>
                     <template v-else>
                         <Button type="success" size="small" @click="confirmedJoin(1)">加入</Button>
@@ -290,6 +291,28 @@ export default {
                 }
             })
         },
+        delAct() {
+            this.$Modal.confirm({
+                title: '确定删除本次活动吗?',
+                // content: `确定删除本次活动吗?`,
+                onOk: () => {
+                    let params = {
+                        grant_type: 'delete',
+                        activityId: this.actInfo.id,
+                        owner: this.actInfo.owner,
+                        scope: this.actInfo.scope,
+                    }
+                    this.$api.areaActivity.manageAct(params).then(res => {
+                        if(res.code === 201) {
+                            this.$Message.success('删除成功')
+                            this.$router.go(-1)
+                        } else if(res.code === 200) {
+                            this.$Message.warning('删除失败')
+                        }
+                    })
+                }
+            })
+        },
         confirmedJoin(type) {
             this.$Modal.confirm({
                 // title: '删除专家',

+ 0 - 1
TEAMModelOS/ClientApp/src/view/signupActivity/processActivity.vue

@@ -101,7 +101,6 @@ export default {
                         sasData.sas = this.$store.state.user.schoolProfile.blob_sas
                     } */
                     this.activityList = res.activities.map(item => {
-                        console.log(item.sas);
                         item.startTime = this.$tools.formatTime(item.stime, 'yyyy-MM-dd')
                         item.endTime = this.$tools.formatTime(item.etime, 'yyyy-MM-dd')
                         item.poster = !item.poster ? require('@/assets/image/no-poster-cn1.png') : `${item.poster}?${item.sas}`