Przeglądaj źródła

最新 考试部分代码

于添 7 miesięcy temu
rodzic
commit
37bd69acfe

+ 2 - 6
src/views/exm/examinationManagement/form.vue

@@ -1,7 +1,5 @@
 <template>
-		<div style="width: 71%; margin-left: 10%">
-			<div style="height: 20px"></div>
-		</div>
+	<div class="app-container">
 		<a-form
 			:model="form"
 			ref="formRef"
@@ -66,7 +64,6 @@
 			</a-form-item>
 		</a-form>
 
-
 		<a-modal
 			v-model:visible="paperPage.showDialog"
 			width="70%"
@@ -117,6 +114,7 @@
 				style="margin-top: 16px; text-align: right"
 			/>
 		</a-modal>
+	</div>
 </template>
 
 <script setup>
@@ -128,8 +126,6 @@
 	import resourceAuditApi from '@/api/resourceAudit.js'
 
 	import dayjs from 'dayjs'
-	import Header from "@/views/portal/components/Header.vue";
-	import ResourceList from "@/views/courseCenter/components/ResourceList.vue";
 	const emit = defineEmits(['success'])
 	const props = defineProps({
 		id: {

+ 79 - 83
src/views/exm/examinationManagement/index.vue

@@ -1,96 +1,92 @@
 <template>
-			<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 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>
 </template>
 
 <script setup>
-	import { ref, reactive, onMounted } from 'vue'
+	import { ref, reactive, onMounted, computed } from 'vue'
 	import { message, Modal } from 'ant-design-vue'
 	import examManagerApi from '@/api/exam/paper/examManager.js'
 	import TaskEdit from './form.vue'
 	import { useExamStore } from '@/store/exam.js'
 	import { storeToRefs } from 'pinia'
 	import { parseTime } from '@/utils/exam'
-	import Header from "@/views/portal/components/Header.vue";
-	import QueryView from "@/views/classManagement/components/QueryView.vue";
-	import {PlusOutlined} from "@ant-design/icons-vue";
-	import Footer from "@/views/portal/components/Footer.vue";
-	import ListView from "@/views/classManagement/components/ListView.vue";
 	const examStore = useExamStore()
 	const { levelEnum, enumFormat } = storeToRefs(examStore)
 	const drawerVisible = ref(false)

+ 87 - 90
src/views/exm/exampaper/index.vue

@@ -1,95 +1,95 @@
 <template>
-			<div style="height: 20px"></div>
-			<!-- 查询表单 -->
-			<a-form :model="queryParam" layout="inline" class="search-form">
-				<a-form-item label="题目ID:">
-					<a-input v-model:value="queryParam.id" placeholder="请输入题目ID" allow-clear />
-				</a-form-item>
-				<a-form-item label="试卷类型:">
-					<a-select
-						v-model:value="queryParam.paperType"
-						placeholder="请选择试卷类型"
-						@change="paperTypeChange"
-						allow-clear
-						style="width: 120px"
-					>
-						<a-select-option v-for="item in paperTypeEnum" :key="item.key" :value="item.key">
-							{{ item.value }}
-						</a-select-option>
-					</a-select>
-				</a-form-item>
-				<!-- <a-form-item label="年级:">
-					<a-select
-						v-model:value="queryParam.level"
-						placeholder="请选择年级"
-						@change="levelChange"
-						allow-clear
-						style="width: 120px"
-					>
-						<a-select-option v-for="item in levelEnum" :key="item.key" :value="item.key">
-							{{ item.value }}
-						</a-select-option>
-					</a-select>
-				</a-form-item>
-				<a-form-item label="学科:">
-					<a-select v-model:value="queryParam.subjectId" placeholder="请选择学科" allow-clear style="width: 200px">
-						<a-select-option v-for="item in subjectFilter" :key="item.id" :value="item.id">
-							{{ item.name }} ( {{ item.levelName }} )
-						</a-select-option>
-					</a-select>
-				</a-form-item> -->
-				<a-form-item>
-					<a-button type="primary" @click="submitForm">查询</a-button>
-					<a-button type="primary" @click="openDrawer('add')" style="margin-left: 8px">添加</a-button>
-				</a-form-item>
-			</a-form>
+	<div class="app-container">
+		<!-- 查询表单 -->
+		<a-form :model="queryParam" layout="inline" class="search-form">
+			<a-form-item label="题目ID:">
+				<a-input v-model:value="queryParam.id" placeholder="请输入题目ID" allow-clear />
+			</a-form-item>
+			<a-form-item label="试卷类型:">
+				<a-select
+					v-model:value="queryParam.paperType"
+					placeholder="请选择试卷类型"
+					@change="paperTypeChange"
+					allow-clear
+					style="width: 120px"
+				>
+					<a-select-option v-for="item in paperTypeEnum" :key="item.key" :value="item.key">
+						{{ item.value }}
+					</a-select-option>
+				</a-select>
+			</a-form-item>
+			<!-- <a-form-item label="年级:">
+				<a-select
+					v-model:value="queryParam.level"
+					placeholder="请选择年级"
+					@change="levelChange"
+					allow-clear
+					style="width: 120px"
+				>
+					<a-select-option v-for="item in levelEnum" :key="item.key" :value="item.key">
+						{{ item.value }}
+					</a-select-option>
+				</a-select>
+			</a-form-item>
+			<a-form-item label="学科:">
+				<a-select v-model:value="queryParam.subjectId" placeholder="请选择学科" allow-clear style="width: 200px">
+					<a-select-option v-for="item in subjectFilter" :key="item.id" :value="item.id">
+						{{ item.name }} ( {{ item.levelName }} )
+					</a-select-option>
+				</a-select>
+			</a-form-item> -->
+			<a-form-item>
+				<a-button type="primary" @click="submitForm">查询</a-button>
+				<a-button type="primary" @click="openDrawer('add')" style="margin-left: 8px">添加</a-button>
+			</a-form-item>
+		</a-form>
 
-			<div style="height: 20px"></div>
-			<!-- 数据表格 -->
-			<a-table
-				:loading="listLoading"
-				:data-source="tableData"
-				:columns="columns"
-				:pagination="false"
-				row-key="id"
-				class="data-table"
-				:locale="{ emptyText: '暂无数据' }"
-			>
-				<template #bodyCell="{ column, record }">
-					<template v-if="column.key === 'action'">
-						<a-button size="small" @click="openDrawer('edit', record.id)">编辑</a-button>
-						<a-button size="small" type="primary" danger @click="deletePaper(record)" style="margin-left: 8px">
-							删除
-						</a-button>
-					</template>
+		<!-- 数据表格 -->
+		<a-table
+			:loading="listLoading"
+			:data-source="tableData"
+			:columns="columns"
+			:pagination="false"
+			row-key="id"
+			class="data-table"
+			:locale="{ emptyText: '暂无数据' }"
+		>
+			<template #bodyCell="{ column, record }">
+				<template v-if="column.key === 'action'">
+					<a-button size="small" @click="openDrawer('edit', record.id)">编辑</a-button>
+					<a-button size="small" type="primary" danger @click="deletePaper(record)" style="margin-left: 8px">
+						删除
+					</a-button>
 				</template>
-			</a-table>
+			</template>
+		</a-table>
 
-			<!-- 分页 -->
-			<a-pagination
-				v-if="total > 0"
-				:current="queryParam.pageIndex"
-				:page-size="queryParam.pageSize"
-				:total="total"
-				:show-size-changer="true"
-				:show-quick-jumper="true"
-				:show-total="(total, range) => `第 ${range[0]}-${range[1]} 条/共 ${total} 条`"
-				@change="handlePageChange"
-				@show-size-change="handlePageSizeChange"
-				class="pagination"
-			/>
+		<!-- 分页 -->
+		<a-pagination
+			v-if="total > 0"
+			:current="queryParam.pageIndex"
+			:page-size="queryParam.pageSize"
+			:total="total"
+			:show-size-changer="true"
+			:show-quick-jumper="true"
+			:show-total="(total, range) => `第 ${range[0]}-${range[1]} 条/共 ${total} 条`"
+			@change="handlePageChange"
+			@show-size-change="handlePageSizeChange"
+			class="pagination"
+		/>
 
-			<!-- 编辑/添加 抽屉 -->
-			<a-drawer
-				:visible="drawerVisible"
-				:title="drawerTitle"
-				placement="right"
-				width="900"
-				@close="closeDrawer"
-				destroyOnClose
-			>
-				<FormEdit v-if="drawerVisible" :id="editId" @success="onEditSuccess" />
-			</a-drawer>
+		<!-- 编辑/添加 抽屉 -->
+		<a-drawer
+			:visible="drawerVisible"
+			:title="drawerTitle"
+			placement="right"
+			width="900"
+			@close="closeDrawer"
+			destroyOnClose
+		>
+			<FormEdit v-if="drawerVisible" :id="editId" @success="onEditSuccess" />
+		</a-drawer>
+	</div>
 </template>
 
 <script setup>
@@ -99,9 +99,6 @@
 	import examPaperApi from '@/api/exam/paper/examPaperApi'
 	import FormEdit from './form.vue'
 	import { parseTime } from '@/utils/exam'
-	import Header from "@/views/portal/components/Header.vue";
-	import ResourceList from "@/views/courseCenter/components/ResourceList.vue";
-	import Footer from "@/views/portal/components/Footer.vue";
 
 	const examStore = useExamStore()
 	const paperTypeEnum = computed(() => examStore.paperTypeEnum)

+ 78 - 83
src/views/exm/questionnaireManagement/index.vue

@@ -1,82 +1,82 @@
 <template>
-			<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 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>
 </template>
 
 <script setup>
@@ -87,11 +87,6 @@
 	import { useExamStore } from '@/store/exam.js'
 	import { storeToRefs } from 'pinia'
 	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 { levelEnum, enumFormat } = storeToRefs(examStore)
 	const drawerVisible = ref(false)