|
@@ -1,82 +1,88 @@
|
|
|
<template>
|
|
<template>
|
|
|
- <div class="task-container">
|
|
|
|
|
- <a-form layout="inline" :model="queryParam">
|
|
|
|
|
- <a-form-item label="考试标题:">
|
|
|
|
|
- <a-input v-model:value="queryParam.examName" placeholder="请输入考试标题" style="min-width: 200px" allowClear />
|
|
|
|
|
- </a-form-item>
|
|
|
|
|
- <a-form-item label="考试状态:">
|
|
|
|
|
- <a-select style="min-width: 150px" v-model:value="queryParam.examStatus" allowClear placeholder="考试状态">
|
|
|
|
|
- <a-select-option :value="0">未开始</a-select-option>
|
|
|
|
|
- <a-select-option :value="1">已开始</a-select-option>
|
|
|
|
|
- <a-select-option :value="2">已结束</a-select-option>
|
|
|
|
|
- </a-select>
|
|
|
|
|
- </a-form-item>
|
|
|
|
|
- <a-form-item>
|
|
|
|
|
- <a-button type="primary" @click="submitForm">查询</a-button>
|
|
|
|
|
- <a-button style="margin-left: 20px" type="primary" @click="createTask">创建考试</a-button>
|
|
|
|
|
- </a-form-item>
|
|
|
|
|
- </a-form>
|
|
|
|
|
- <a-table
|
|
|
|
|
- :loading="listLoading"
|
|
|
|
|
- :data-source="tableData"
|
|
|
|
|
- :pagination="false"
|
|
|
|
|
- row-key="id"
|
|
|
|
|
- bordered
|
|
|
|
|
- style="margin-top: 16px"
|
|
|
|
|
- >
|
|
|
|
|
- <a-table-column title="Id" dataIndex="id" key="id" width="100" />
|
|
|
|
|
- <a-table-column title="考试标题" dataIndex="examName" key="examName" />
|
|
|
|
|
- <a-table-column title="考试状态" dataIndex="examStatus" key="examStatus" width="120">
|
|
|
|
|
- <template #default="{ record }">
|
|
|
|
|
- <a-tag :color="record.examStatus === 0 ? 'default' : record.examStatus === 1 ? 'processing' : 'success'">
|
|
|
|
|
- {{ record.examStatus === 0 ? '未开始' : record.examStatus === 1 ? '已开始' : '已结束' }}
|
|
|
|
|
- </a-tag>
|
|
|
|
|
- </template>
|
|
|
|
|
- </a-table-column>
|
|
|
|
|
- <a-table-column title="开始时间" dataIndex="startTime" key="startTime" width="160">
|
|
|
|
|
- <template #default="{ record }">
|
|
|
|
|
- {{ formatDateTime(record.startTime) }}
|
|
|
|
|
- </template>
|
|
|
|
|
- </a-table-column>
|
|
|
|
|
- <a-table-column title="结束时间" dataIndex="endTime" key="endTime" width="160">
|
|
|
|
|
- <template #default="{ record }">
|
|
|
|
|
- {{ formatDateTime(record.endTime) }}
|
|
|
|
|
- </template>
|
|
|
|
|
- </a-table-column>
|
|
|
|
|
- <a-table-column title="创建时间" dataIndex="createTime" key="createTime" width="160">
|
|
|
|
|
- <template #default="{ record }">
|
|
|
|
|
- {{ formatDateTime(record.createTime) }}
|
|
|
|
|
- </template>
|
|
|
|
|
- </a-table-column>
|
|
|
|
|
- <a-table-column title="操作" key="action" align="center" width="160">
|
|
|
|
|
- <template #default="{ record }">
|
|
|
|
|
- <a-button size="small" @click="editTask(record)">编辑</a-button>
|
|
|
|
|
- <a-button size="small" danger style="margin-left: 8px" @click="deleteTask(record)">删除</a-button>
|
|
|
|
|
- </template>
|
|
|
|
|
- </a-table-column>
|
|
|
|
|
- </a-table>
|
|
|
|
|
- <a-pagination
|
|
|
|
|
- v-show="total > 0"
|
|
|
|
|
- :total="total"
|
|
|
|
|
- :current="queryParam.pageIndex"
|
|
|
|
|
- :pageSize="queryParam.pageSize"
|
|
|
|
|
- @change="onPageChange"
|
|
|
|
|
- @showSizeChange="onPageSizeChange"
|
|
|
|
|
- :showSizeChanger="true"
|
|
|
|
|
- :pageSizeOptions="['10', '20', '50', '100']"
|
|
|
|
|
- style="margin-top: 16px; text-align: right"
|
|
|
|
|
- />
|
|
|
|
|
- <a-drawer
|
|
|
|
|
- :visible="drawerVisible"
|
|
|
|
|
- :title="drawerTitle"
|
|
|
|
|
- placement="right"
|
|
|
|
|
- width="900"
|
|
|
|
|
- @close="closeDrawer"
|
|
|
|
|
- destroyOnClose
|
|
|
|
|
- >
|
|
|
|
|
- <TaskEdit v-if="drawerVisible" :id="editId" @success="onEditSuccess" />
|
|
|
|
|
- </a-drawer>
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ <a-layout>
|
|
|
|
|
+ <Header @onChangeCurrent="onChangeCurrent" />
|
|
|
|
|
+ <div style="width: 71%; margin-left: 10%">
|
|
|
|
|
+ <div style="height: 20px"></div>
|
|
|
|
|
+ <a-form layout="inline" :model="queryParam">
|
|
|
|
|
+ <a-form-item label="考试标题:">
|
|
|
|
|
+ <a-input v-model:value="queryParam.examName" placeholder="请输入考试标题" style="min-width: 200px" allowClear />
|
|
|
|
|
+ </a-form-item>
|
|
|
|
|
+ <a-form-item label="考试状态:">
|
|
|
|
|
+ <a-select style="min-width: 150px" v-model:value="queryParam.examStatus" allowClear placeholder="考试状态">
|
|
|
|
|
+ <a-select-option :value="0">未开始</a-select-option>
|
|
|
|
|
+ <a-select-option :value="1">已开始</a-select-option>
|
|
|
|
|
+ <a-select-option :value="2">已结束</a-select-option>
|
|
|
|
|
+ </a-select>
|
|
|
|
|
+ </a-form-item>
|
|
|
|
|
+ <a-form-item>
|
|
|
|
|
+ <a-button type="primary" @click="submitForm">查询</a-button>
|
|
|
|
|
+ <a-button style="margin-left: 20px" type="primary" @click="createTask">创建考试</a-button>
|
|
|
|
|
+ </a-form-item>
|
|
|
|
|
+ </a-form>
|
|
|
|
|
+ <a-table
|
|
|
|
|
+ :loading="listLoading"
|
|
|
|
|
+ :data-source="tableData"
|
|
|
|
|
+ :pagination="false"
|
|
|
|
|
+ row-key="id"
|
|
|
|
|
+ bordered
|
|
|
|
|
+ style="margin-top: 16px"
|
|
|
|
|
+ >
|
|
|
|
|
+ <a-table-column title="Id" dataIndex="id" key="id" width="100" />
|
|
|
|
|
+ <a-table-column title="考试标题" dataIndex="examName" key="examName" />
|
|
|
|
|
+ <a-table-column title="考试状态" dataIndex="examStatus" key="examStatus" width="120">
|
|
|
|
|
+ <template #default="{ record }">
|
|
|
|
|
+ <a-tag :color="record.examStatus === 0 ? 'default' : record.examStatus === 1 ? 'processing' : 'success'">
|
|
|
|
|
+ {{ record.examStatus === 0 ? '未开始' : record.examStatus === 1 ? '已开始' : '已结束' }}
|
|
|
|
|
+ </a-tag>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </a-table-column>
|
|
|
|
|
+ <a-table-column title="开始时间" dataIndex="startTime" key="startTime" width="160">
|
|
|
|
|
+ <template #default="{ record }">
|
|
|
|
|
+ {{ formatDateTime(record.startTime) }}
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </a-table-column>
|
|
|
|
|
+ <a-table-column title="结束时间" dataIndex="endTime" key="endTime" width="160">
|
|
|
|
|
+ <template #default="{ record }">
|
|
|
|
|
+ {{ formatDateTime(record.endTime) }}
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </a-table-column>
|
|
|
|
|
+ <a-table-column title="创建时间" dataIndex="createTime" key="createTime" width="160">
|
|
|
|
|
+ <template #default="{ record }">
|
|
|
|
|
+ {{ formatDateTime(record.createTime) }}
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </a-table-column>
|
|
|
|
|
+ <a-table-column title="操作" key="action" align="center" width="160">
|
|
|
|
|
+ <template #default="{ record }">
|
|
|
|
|
+ <a-button size="small" @click="editTask(record)">编辑</a-button>
|
|
|
|
|
+ <a-button size="small" danger style="margin-left: 8px" @click="deleteTask(record)">删除</a-button>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </a-table-column>
|
|
|
|
|
+ </a-table>
|
|
|
|
|
+ <a-pagination
|
|
|
|
|
+ v-show="total > 0"
|
|
|
|
|
+ :total="total"
|
|
|
|
|
+ :current="queryParam.pageIndex"
|
|
|
|
|
+ :pageSize="queryParam.pageSize"
|
|
|
|
|
+ @change="onPageChange"
|
|
|
|
|
+ @showSizeChange="onPageSizeChange"
|
|
|
|
|
+ :showSizeChanger="true"
|
|
|
|
|
+ :pageSizeOptions="['10', '20', '50', '100']"
|
|
|
|
|
+ style="margin-top: 16px; text-align: right"
|
|
|
|
|
+ />
|
|
|
|
|
+ <a-drawer
|
|
|
|
|
+ :visible="drawerVisible"
|
|
|
|
|
+ :title="drawerTitle"
|
|
|
|
|
+ placement="right"
|
|
|
|
|
+ width="900"
|
|
|
|
|
+ @close="closeDrawer"
|
|
|
|
|
+ destroyOnClose
|
|
|
|
|
+ >
|
|
|
|
|
+ <TaskEdit v-if="drawerVisible" :id="editId" @success="onEditSuccess" />
|
|
|
|
|
+ </a-drawer>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </a-layout>
|
|
|
|
|
+ <Footer />
|
|
|
|
|
+
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
@@ -87,6 +93,11 @@
|
|
|
import { useExamStore } from '@/store/exam.js'
|
|
import { useExamStore } from '@/store/exam.js'
|
|
|
import { storeToRefs } from 'pinia'
|
|
import { storeToRefs } from 'pinia'
|
|
|
import { parseTime } from '@/utils/exam'
|
|
import { parseTime } from '@/utils/exam'
|
|
|
|
|
+ import Header from "@/views/portal/components/Header.vue";
|
|
|
|
|
+ import QueryView from "@/views/announcementManagement/components/QueryView.vue";
|
|
|
|
|
+ import {PlusOutlined} from "@ant-design/icons-vue";
|
|
|
|
|
+ import Footer from "@/views/portal/components/Footer.vue";
|
|
|
|
|
+ import ListView from "@/views/announcementManagement/components/ListView.vue";
|
|
|
const examStore = useExamStore()
|
|
const examStore = useExamStore()
|
|
|
const { levelEnum, enumFormat } = storeToRefs(examStore)
|
|
const { levelEnum, enumFormat } = storeToRefs(examStore)
|
|
|
const drawerVisible = ref(false)
|
|
const drawerVisible = ref(false)
|