|
|
@@ -37,25 +37,45 @@
|
|
|
<div class="flex1 ov-hd">
|
|
|
<vxe-table :loading="loading" border :data="dataList" min-height="0" max-height="100%">
|
|
|
<vxe-column title="序号" align="center" type="seq" width="60" />
|
|
|
- <vxe-column field="trainingName" title="会议名称" align="center" min-width="150" />
|
|
|
- <vxe-column field="trainingTime" title="培训时间" align="center" min-width="150">
|
|
|
+ <vxe-column field="trainingName" title="会议名称" :formatter="colNoData" />
|
|
|
+ <vxe-column field="trainingTime" min-width="200" title="培训时间">
|
|
|
<template #default="{ row }">{{ row.trainingStart }}~{{ row.trainingEnd }}</template>
|
|
|
</vxe-column>
|
|
|
- <vxe-column field="joinType" title="培训方式" align="center" min-width="120">
|
|
|
+ <vxe-column field="joinType" title="培训方式" width="80">
|
|
|
<template #default="{ row }">
|
|
|
{{ selectDictLabel(dm_training_join_type, row.joinType) }}
|
|
|
</template>
|
|
|
</vxe-column>
|
|
|
<!-- <vxe-column field="trainingLocation" title="培训地点" align="center" min-width="150" /> -->
|
|
|
- <vxe-column field="certFlag" title="是否颁发证书" align="center" min-width="150">
|
|
|
+ <vxe-column field="certFlag" title="是否颁发证书" width="80">
|
|
|
<template #default="{ row }">
|
|
|
{{ selectDictLabel(yes_no, row.certFlag) }}
|
|
|
</template>
|
|
|
</vxe-column>
|
|
|
-
|
|
|
- <vxe-column title="操作" width="250" align="center" fixed="right">
|
|
|
+ <vxe-column field="joinCount" title="报名人数" width="80" />
|
|
|
+ <vxe-column field="signCount" title="签到人数" width="80" />
|
|
|
+ <vxe-column field="certCount" title="领取证书人数" width="80" />
|
|
|
+ <vxe-column title="创建人" align="center" field="createByName" min-width="100" :formatter="colNoData" />
|
|
|
+ <vxe-column title="创建时间" align="center" field="createTime" min-width="100" :formatter="colNoData" />
|
|
|
+ <vxe-column field="certFlag" title="会议状态">
|
|
|
+ <template #default="{ row }">
|
|
|
+ <DictTag :options="dm_training_status" :value="row?.trainingStatus"></DictTag>
|
|
|
+ </template>
|
|
|
+ </vxe-column>
|
|
|
+ <vxe-column title="操作" width="300" fixed="right">
|
|
|
<template #default="{ row }">
|
|
|
- <el-button type="primary" @click="editRow(row)" text>编辑</el-button>
|
|
|
+ <el-button v-if="['3'].includes(row?.trainingStatus)" type="primary" text @click="trainingOn(row)">上架</el-button>
|
|
|
+ <span></span>
|
|
|
+ <el-button v-if="!['3'].includes(row?.trainingStatus)" type="danger" text @click="trainingOff(row)">下架</el-button>
|
|
|
+ <span></span>
|
|
|
+ <el-button v-if="['3'].includes(row?.trainingStatus)" type="primary" @click="editRow(row)" text>编辑</el-button>
|
|
|
+ <span></span>
|
|
|
+ <el-button v-if="!['3'].includes(row?.trainingStatus)" style="color: #0079fe;" text>分享</el-button>
|
|
|
+ <span></span>
|
|
|
+ <el-button v-if="['1', '0'].includes(row?.trainingStatus)" style="color: #0079fe;" text>签到二维码</el-button>
|
|
|
+ <span></span>
|
|
|
+ <el-button style="color: #0079fe;" text>详情</el-button>
|
|
|
+ <span></span>
|
|
|
<el-button text type="danger" @click="deleteRow(row)">删除</el-button>
|
|
|
</template>
|
|
|
</vxe-column>
|
|
|
@@ -68,12 +88,13 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup name="meeting" lang="ts">
|
|
|
-import { colNoData } from '@/utils/noData';
|
|
|
+import { colNoData, colNoUnm } from '@/utils/noData';
|
|
|
import { searchTabs } from '@/views/models';
|
|
|
-import { trainingList, queryTrainingCount, trainingDelete } from '@/api/training';
|
|
|
+import { trainingList, queryTrainingCount, trainingDelete, publishTraining, unpublishTraining } from '@/api/training';
|
|
|
+
|
|
|
const router = useRouter();
|
|
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
|
-const { dm_training_join_type, yes_no, dm_training_cert } = toRefs<any>(proxy?.useDict('dm_training_join_type', 'yes_no', 'dm_training_cert'));
|
|
|
+const { dm_training_join_type, yes_no, dm_training_cert, dm_training_status } = toRefs<any>(proxy?.useDict('dm_training_join_type', 'yes_no', 'dm_training_cert', 'dm_training_status'));
|
|
|
const loading = ref(true);
|
|
|
const showSearch = ref(true);
|
|
|
const total = ref(0);
|
|
|
@@ -109,7 +130,34 @@ const resetQuery = () => {
|
|
|
queryFormRef.value?.resetFields();
|
|
|
handleQuery();
|
|
|
};
|
|
|
-
|
|
|
+// 上架会议
|
|
|
+const trainingOn = async (row: any) => {
|
|
|
+ ElMessageBox.confirm(`确认要上架该会议吗?`, '上架提示', {
|
|
|
+ confirmButtonText: '确认',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(async () => {
|
|
|
+ const res = await publishTraining(row?.id);
|
|
|
+ if (res) {
|
|
|
+ ElMessage.success('上架成功');
|
|
|
+ getList();
|
|
|
+ }
|
|
|
+ });
|
|
|
+};
|
|
|
+// 下架会议
|
|
|
+const trainingOff = async (row: any) => {
|
|
|
+ ElMessageBox.confirm(`确认要下架该会议吗?`, '下架提示', {
|
|
|
+ confirmButtonText: '确认',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(async () => {
|
|
|
+ const res = await unpublishTraining(row?.id);
|
|
|
+ if (res) {
|
|
|
+ ElMessage.success('下架成功');
|
|
|
+ getList();
|
|
|
+ }
|
|
|
+ });
|
|
|
+};
|
|
|
/** 编辑会议 */
|
|
|
const editRow = (row) => {
|
|
|
router.push({ path: 'meeting-add', query: { id: row.id } });
|