Commit f68906ce by caoyanzhi

update: 添加删除弹窗计划的功能

parent 0ac10535
......@@ -27,7 +27,12 @@
<p class="title">
计划名称:{{ group.name }}<i>{{ formatDateTimeByType(group.beginTime, 'yyyy-MM-dd') + '至' + formatDateTimeByType(group.endTime, 'yyyy-MM-dd') }}</i>
</p>
<p class="btn" v-if="5 > group.popupList.length" @click="goForm(group, 'edit')">添加弹窗</p>
<div class="btn-group">
<el-button type="text" v-if="5 > group.popupList.length" @click="goForm(group, 'edit')">添加弹窗</el-button>
<dm-delete v-if="group.popupList.every(el => el.activeStatus != 2)" tips="是否删除此弹窗计划?" @confirm="delGroup(group)">
<el-button type="text">删除</el-button>
</dm-delete>
</div>
</div>
<el-table tooltipEffect="light" style="width: 100%" :data="group.popupList">
<el-table-column align="left" label="弹窗内容">
......@@ -65,7 +70,7 @@
<el-button type="text">停止</el-button>
</dm-delete>
<el-button v-if="scope.row.activeStatus === 1" type="text" @click="goForm(group, 'edit')">编辑</el-button>
<dm-delete v-if="scope.row.activeStatus === 1 || scope.row.activeStatus === 3" @confirm="removePop(scope.row)" tips="是否删除该条数据?">
<dm-delete v-if="scope.row.activeStatus === 1 || scope.row.activeStatus === 3" @confirm="removePop(scope.row)" tips="是否删除此弹窗?">
<el-button type="text">删除</el-button>
</dm-delete>
</template>
......@@ -77,7 +82,7 @@
</template>
<script>
import { popPlanList, removePopup, stopPopup } from '@/service/api/popApi.js';
import { popPlanList, removePopup, stopPopup, removePopupPlan } from '@/service/api/popApi.js';
import { formatDateTimeByType } from '@/utils/index.js';
import timeCounts from '@/components/timeCount/index.vue';
import tableMethods from '@/mixins/tableMethods.js';
......@@ -173,6 +178,14 @@ export default {
this.$router.push(`/pop/edit?id=${group.id}`);
}
},
delGroup(group) {
removePopupPlan({ popupPlanId: group.id }).then(res => {
if (res.errorCode == 0) {
this.$message.success('删除成功');
this.getTableList();
}
});
},
removePop(pop) {
removePopup({ popupId: pop.id }).then(res => {
this.$message.success('删除成功');
......@@ -257,12 +270,10 @@ export default {
line-height: 17px;
}
}
.btn {
box-sizing: border-box;
.btn-group {
padding-left: 10px;
width: 170px;
color: #409eff;
cursor: pointer;
box-sizing: border-box;
}
}
.dot {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment