活动状态

This commit is contained in:
helen 2024-12-27 15:30:50 +08:00
parent 4bd54e8fb1
commit 858c27502c

View File

@ -77,9 +77,8 @@
<el-table-column label="发布状态" align="center" prop="status" width="100px"> <el-table-column label="发布状态" align="center" prop="status" width="100px">
<template #default="scope"> <template #default="scope">
<el-tag v-if="scope.row.status == 0" type="info">未发布</el-tag> <el-tag v-if="scope.row.status == 0" type="info">未发布</el-tag>
<el-tag v-if="scope.row.status == 1" type="warning">草稿</el-tag> <el-tag v-if="scope.row.status == 1" type="success">审核中</el-tag>
<el-tag v-if="scope.row.status == 2" type="success">审核中</el-tag> <el-tag v-if="scope.row.status == 2" type="primary">已发布</el-tag>
<el-tag v-if="scope.row.status == 3" type="primary">已发布</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="发布人员" align="center" prop="publishName" /> <el-table-column label="发布人员" align="center" prop="publishName" />
@ -88,21 +87,21 @@
<template #default="scope"> <template #default="scope">
<div v-if="scope.row.userZombie == true"> <div v-if="scope.row.userZombie == true">
<el-button <el-button
v-if="scope.row.status == 0 || scope.row.status == 1" v-if="scope.row.status == 0"
v-hasPermi="['system:article:edit']" v-hasPermi="['system:article:edit']"
link link
type="primary" type="primary"
@click="handleUpdate(scope.row, 1)" @click="handleUpdate(scope.row, 1)"
>编辑</el-button >编辑</el-button
> >
<el-button v-if="scope.row.status == 0" v-hasPermi="['system:article:edit']" link type="primary" @click="saveupdate(scope.row, 1)" <el-button v-if="scope.row.status == 0" v-hasPermi="['system:article:edit']" link type="primary" @click="saveupdate(scope.row, 0)"
>发布</el-button >发布</el-button
> >
<el-button v-if="scope.row.status == 3" v-hasPermi="['system:article:edit']" link type="primary" @click="saveupdate(scope.row, 2)" <el-button v-if="scope.row.status == 2" v-hasPermi="['system:article:edit']" link type="primary" @click="saveupdate(scope.row, 2)"
>撤销发布</el-button >撤销发布</el-button
> >
<el-button <el-button
v-if="scope.row.status == 0 || scope.row.status == 1" v-if="scope.row.status == 0"
v-hasPermi="['system:article:remove']" v-hasPermi="['system:article:remove']"
link link
type="primary" type="primary"
@ -302,10 +301,9 @@ const publisherAddress = ref({});
const Mapvalue = ref({}); const Mapvalue = ref({});
const Mapvaluetwo = ref({}); const Mapvaluetwo = ref({});
const note_publish_list = ref([ const note_publish_list = ref([
{ label: '已发布', value: 3 }, { label: '已发布', value: 2 },
{ label: '审核中', value: 2 }, { label: '审核中', value: 1 },
{ label: '未发布', value: 0 }, { label: '未发布', value: 0 }
{ label: '草稿', value: 1 }
]); ]);
const activityFormRef = ref<ElFormInstance>(); const activityFormRef = ref<ElFormInstance>();
const getMapValue = (value: any) => { const getMapValue = (value: any) => {
@ -466,8 +464,8 @@ const saveupdate = async (row?: ActivityVO, type) => {
const res = await getActivity(_id); const res = await getActivity(_id);
const arr = await activityprocess({ activityId: _id }); const arr = await activityprocess({ activityId: _id });
Object.assign(form.value, res.data); Object.assign(form.value, res.data);
form.value.status = type == 1 ? 2 : 0; form.value.status = type == 0 ? 1 : 0;
const test = type == 1 ? '发布' : '撤销发布'; const test = type == 0 ? '发布' : '撤销发布';
const _ids = row?.activityName || ids.value; const _ids = row?.activityName || ids.value;
await proxy?.$modal.confirm('是否确认' + test + '活动名称 为' + _ids + '的数据项?').finally(() => (loading.value = false)); await proxy?.$modal.confirm('是否确认' + test + '活动名称 为' + _ids + '的数据项?').finally(() => (loading.value = false));
await updateActivity(form.value).finally(() => (buttonLoading.value = false)); await updateActivity(form.value).finally(() => (buttonLoading.value = false));