Răsfoiți Sursa

refactor(views): 优化表单标签和表格列显示

- 简化表单标签文字
- 移除多余的ID列显示
- 调整按钮样式和操作列宽度
- 添加调试日志
- 统一问卷管理界面文字描述
tanshanming 6 luni în urmă
părinte
comite
1c52d0625e

+ 1 - 0
src/views/exm/examinationManagement/StatisticAnalysis.vue

@@ -111,6 +111,7 @@
 	// 初始化单个饼图
 	const initPieChart = (item) => {
 		const chartDom = document.getElementById(`chart-${item.questionId}`)
+		console.log('chartDom==', chartDom)
 		if (!chartDom) return
 
 		const myChart = echarts.init(chartDom)

+ 7 - 7
src/views/exm/examinationManagement/index.vue

@@ -24,35 +24,35 @@
 			bordered
 			style="margin-top: 16px"
 		>
-			<a-table-column title="Id" dataIndex="id" key="id" width="100" />
+			<!-- <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">
+			<a-table-column title="考试状态" dataIndex="examStatus" key="examStatus">
 				<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">
+			<a-table-column title="开始时间" dataIndex="startTime" key="startTime">
 				<template #default="{ record }">
 					{{ formatDateTime(record.startTime) }}
 				</template>
 			</a-table-column>
-			<a-table-column title="结束时间" dataIndex="endTime" key="endTime" width="160">
+			<a-table-column title="结束时间" dataIndex="endTime" key="endTime">
 				<template #default="{ record }">
 					{{ formatDateTime(record.endTime) }}
 				</template>
 			</a-table-column>
-			<a-table-column title="创建时间" dataIndex="createTime" key="createTime" width="160">
+			<a-table-column title="创建时间" dataIndex="createTime" key="createTime">
 				<template #default="{ record }">
 					{{ formatDateTime(record.createTime) }}
 				</template>
 			</a-table-column>
-			<a-table-column title="操作" key="action" align="center" width="160">
+			<a-table-column title="操作" key="action" align="center" :width="220">
 				<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>
-					<a-button size="small" type="primary" style="margin-left: 8px" @click="statistic(record)">统计分析</a-button>
+					<a-button size="small" style="margin-left: 8px" @click="statistic(record)">统计分析</a-button>
 				</template>
 			</a-table-column>
 		</a-table>

+ 2 - 2
src/views/exm/exampaper/form.vue

@@ -22,7 +22,7 @@
 					</a-select-option>
 				</a-select>
 			</a-form-item> -->
-			<a-form-item label="试卷类型" name="paperType" :rules="rules.paperType">
+			<a-form-item label="类型" name="paperType" :rules="rules.paperType">
 				<a-select v-model:value="form.paperType" placeholder="请选择试卷类型" @change="handPaperTypeChange">
 					<a-select-option v-for="item in paperTypeEnum" :key="item.key" :value="item.key">
 						{{ item.value }}
@@ -37,7 +37,7 @@
 					:placeholder="['开始日期', '结束日期']"
 				/>
 			</a-form-item>
-			<a-form-item label="试卷名称" name="name" :rules="rules.name">
+			<a-form-item label="名称" name="name" :rules="rules.name">
 				<a-input v-model:value="form.name" placeholder="请输入试卷名称" />
 			</a-form-item>
 			<template v-for="(titleItem, index) in form.titleItems" :key="index">

+ 12 - 10
src/views/exm/exampaper/index.vue

@@ -2,8 +2,11 @@
 	<div class="app-container">
 		<!-- 查询表单 -->
 		<a-form :model="queryParam" layout="inline" class="search-form">
-			<a-form-item label="题目ID:">
+			<!-- <a-form-item label="题目ID:">
 				<a-input v-model:value="queryParam.id" placeholder="请输入题目ID" allow-clear />
+			</a-form-item> -->
+			<a-form-item label="试卷名称:">
+				<a-input v-model:value="queryParam.name" placeholder="请输入试卷名称" allow-clear />
 			</a-form-item>
 			<a-form-item label="试卷类型:">
 				<a-select
@@ -57,9 +60,7 @@
 			<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>
+					<a-button size="small" danger @click="deletePaper(record)" style="margin-left: 8px"> 删除 </a-button>
 				</template>
 			</template>
 		</a-table>
@@ -107,6 +108,7 @@
 	const queryParam = reactive({
 		id: null,
 		paperType: null,
+		name: null,
 		// level: null,
 		// subjectId: null,
 		current: 1,
@@ -143,12 +145,12 @@
 
 	// 表格列配置
 	const columns = [
-		{
-			title: 'Id',
-			dataIndex: 'id',
-			key: 'id',
-			width: 90
-		},
+		// {
+		// 	title: 'Id',
+		// 	dataIndex: 'id',
+		// 	key: 'id',
+		// 	width: 90
+		// },
 		// {
 		// 	title: '学科',
 		// 	dataIndex: 'subjectId',

+ 6 - 3
src/views/exm/question/index.vue

@@ -1,9 +1,9 @@
 <template>
 	<div class="app-container">
 		<a-form :model="queryParam" layout="inline" @submit.prevent>
-			<a-form-item label="题目ID:">
+			<!-- <a-form-item label="题目ID:">
 				<a-input v-model:value="queryParam.id" allow-clear />
-			</a-form-item>
+			</a-form-item> -->
 			<a-form-item label="题目内容:">
 				<a-input v-model:value="queryParam.content" allow-clear />
 			</a-form-item>
@@ -35,7 +35,7 @@
 				</a-select>
 			</a-form-item>
 			<a-form-item label="题型:">
-				<a-select v-model:value="queryParam.questionType" allow-clear style="width: 100px">
+				<a-select v-model:value="queryParam.questionType" placeholder="题型" allow-clear style="width: 100px">
 					<a-select-option v-for="item in questionTypeEnum" :key="item.key" :value="item.key">{{
 						item.value
 					}}</a-select-option>
@@ -354,6 +354,9 @@
 	.link-left {
 		margin-left: 8px;
 	}
+	:deep(.ant-form-inline .ant-form-item) {
+		margin-bottom: 10px;
+	}
 </style>
 <style>
 	.ant-modal div[aria-hidden='true'] {

+ 10 - 10
src/views/exm/questionnaireManagement/index.vue

@@ -24,35 +24,35 @@
 			bordered
 			style="margin-top: 16px"
 		>
-			<a-table-column title="Id" dataIndex="id" key="id" width="100" />
+			<!-- <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">
+			<a-table-column title="问卷状态" dataIndex="examStatus" key="examStatus">
 				<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">
+			<a-table-column title="开始时间" dataIndex="startTime" key="startTime">
 				<template #default="{ record }">
 					{{ formatDateTime(record.startTime) }}
 				</template>
 			</a-table-column>
-			<a-table-column title="结束时间" dataIndex="endTime" key="endTime" width="160">
+			<a-table-column title="结束时间" dataIndex="endTime" key="endTime">
 				<template #default="{ record }">
 					{{ formatDateTime(record.endTime) }}
 				</template>
 			</a-table-column>
-			<a-table-column title="创建时间" dataIndex="createTime" key="createTime" width="160">
+			<a-table-column title="创建时间" dataIndex="createTime" key="createTime">
 				<template #default="{ record }">
 					{{ formatDateTime(record.createTime) }}
 				</template>
 			</a-table-column>
-			<a-table-column title="操作" key="action" align="center" width="160">
+			<a-table-column title="操作" key="action" align="center" :width="220">
 				<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>
-					<a-button size="small" type="primary" style="margin-left: 8px" @click="statistic(record)">统计分析</a-button>
+					<a-button size="small" style="margin-left: 8px" @click="statistic(record)">答案统计</a-button>
 				</template>
 			</a-table-column>
 		</a-table>
@@ -160,7 +160,7 @@
 
 	const editTask = (record) => {
 		drawerVisible.value = true
-		drawerTitle.value = '编辑考试'
+		drawerTitle.value = '编辑问卷'
 		editId.value = record.id
 	}
 
@@ -183,7 +183,7 @@
 	}
 	const createTask = () => {
 		drawerVisible.value = true
-		drawerTitle.value = '创建考试'
+		drawerTitle.value = '创建问卷'
 		editId.value = null
 	}
 	const onEditSuccess = () => {
@@ -200,7 +200,7 @@
 	}
 	const statistic = async (record) => {
 		statisticVisible.value = true
-		statisticTitle.value = '统计分析'
+		statisticTitle.value = '答案统计'
 		console.log('paperName=', record)
 		statisticExamName.value = record.examName
 		statisticPaperId.value = record.paperId