|
@@ -23,26 +23,26 @@
|
|
<el-option label="初中" value="初中" />
|
|
<el-option label="初中" value="初中" />
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="选做科目">
|
|
|
|
|
|
+ <el-form-item label="专业类型">
|
|
<el-select
|
|
<el-select
|
|
- v-model="searchModel.optional"
|
|
|
|
- placeholder="不限"
|
|
|
|
|
|
+ v-model="searchModel.category"
|
|
|
|
+ placeholder="请选择"
|
|
clearable
|
|
clearable
|
|
style="width: 120px"
|
|
style="width: 120px"
|
|
>
|
|
>
|
|
- <el-option label="是" :value="true" />
|
|
|
|
- <el-option label="否" :value="false" />
|
|
|
|
|
|
+ <el-option label="理科" value="理科" />
|
|
|
|
+ <el-option label="文科" value="文科" />
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="专业类型">
|
|
|
|
|
|
+ <el-form-item label="选做科目">
|
|
<el-select
|
|
<el-select
|
|
- v-model="searchModel.majorType"
|
|
|
|
- placeholder="请选择"
|
|
|
|
|
|
+ v-model="searchModel.selective"
|
|
|
|
+ placeholder="不限"
|
|
clearable
|
|
clearable
|
|
style="width: 120px"
|
|
style="width: 120px"
|
|
>
|
|
>
|
|
- <el-option label="理科" value="理科" />
|
|
|
|
- <el-option label="文科" value="文科" />
|
|
|
|
|
|
+ <el-option label="是" :value="true" />
|
|
|
|
+ <el-option label="否" :value="false" />
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="状态">
|
|
<el-form-item label="状态">
|
|
@@ -99,8 +99,8 @@
|
|
</el-button>
|
|
</el-button>
|
|
<template #dropdown>
|
|
<template #dropdown>
|
|
<el-dropdown-menu>
|
|
<el-dropdown-menu>
|
|
- <el-dropdown-item command="fhy">客观题</el-dropdown-item>
|
|
|
|
- <el-dropdown-item command="fhy">主观题</el-dropdown-item>
|
|
|
|
|
|
+ <el-dropdown-item command="objective">客观题</el-dropdown-item>
|
|
|
|
+ <el-dropdown-item command="subjective">主观题</el-dropdown-item>
|
|
</el-dropdown-menu>
|
|
</el-dropdown-menu>
|
|
</template>
|
|
</template>
|
|
</el-dropdown>
|
|
</el-dropdown>
|
|
@@ -132,10 +132,10 @@
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column prop="level" label="层次" />
|
|
<el-table-column prop="level" label="层次" />
|
|
- <el-table-column prop="majorType" label="专业类型" />
|
|
|
|
- <el-table-column prop="optional" label="选做科目">
|
|
|
|
|
|
+ <el-table-column prop="category" label="专业类型" />
|
|
|
|
+ <el-table-column prop="selective" label="选做科目">
|
|
<template #default="{ row }">
|
|
<template #default="{ row }">
|
|
- {{ row.optional ? '是' : '否' }}
|
|
|
|
|
|
+ {{ row.selective ? '是' : '否' }}
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column prop="paperUrl" label="试卷">
|
|
<el-table-column prop="paperUrl" label="试卷">
|
|
@@ -165,10 +165,10 @@
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column prop="paperType" label="试卷类型" />
|
|
<el-table-column prop="paperType" label="试卷类型" />
|
|
- <el-table-column prop="cardFormatType" label="卡格式" />
|
|
|
|
- <el-table-column prop="objectiveTotalScore" label="客观总分" />
|
|
|
|
- <el-table-column prop="subjectiveTotalScore" label="主观总分" />
|
|
|
|
- <el-table-column prop="paperTotalScore" label="试卷总分" />
|
|
|
|
|
|
+ <el-table-column prop="cardType" label="卡格式" />
|
|
|
|
+ <el-table-column prop="objectiveScore" label="客观总分" />
|
|
|
|
+ <el-table-column prop="subjectiveScore" label="主观总分" />
|
|
|
|
+ <el-table-column prop="totalScore" label="试卷总分" />
|
|
<el-table-column prop="status" label="状态">
|
|
<el-table-column prop="status" label="状态">
|
|
<template #default="{ row }">
|
|
<template #default="{ row }">
|
|
<el-tag :type="row.status === '正常' ? 'success' : 'danger'">
|
|
<el-tag :type="row.status === '正常' ? 'success' : 'danger'">
|
|
@@ -223,6 +223,7 @@
|
|
ref="importDialogRef"
|
|
ref="importDialogRef"
|
|
:title="importConfig?.title"
|
|
:title="importConfig?.title"
|
|
:upload-url="importConfig?.url"
|
|
:upload-url="importConfig?.url"
|
|
|
|
+ :upload-data="uploadData"
|
|
:format="importConfig?.format"
|
|
:format="importConfig?.format"
|
|
:download-handle="downloadTemplate"
|
|
:download-handle="downloadTemplate"
|
|
:download-filename="importConfig?.donloadFilename"
|
|
:download-filename="importConfig?.donloadFilename"
|
|
@@ -246,7 +247,7 @@
|
|
} from '@/api/types/subject';
|
|
} from '@/api/types/subject';
|
|
import useTable from '@/hooks/table';
|
|
import useTable from '@/hooks/table';
|
|
import useLoading from '@/hooks/loading';
|
|
import useLoading from '@/hooks/loading';
|
|
- import { useAppStore } from '@/store';
|
|
|
|
|
|
+ import { downloadExport } from '@/utils/download-export';
|
|
|
|
|
|
import SubjectSettingDialog from './components/SubjectSettingDialog.vue';
|
|
import SubjectSettingDialog from './components/SubjectSettingDialog.vue';
|
|
|
|
|
|
@@ -255,13 +256,12 @@
|
|
});
|
|
});
|
|
|
|
|
|
const router = useRouter();
|
|
const router = useRouter();
|
|
- const appStore = useAppStore();
|
|
|
|
|
|
|
|
const searchModel = reactive<SubjectListFilter>({
|
|
const searchModel = reactive<SubjectListFilter>({
|
|
- subject: null,
|
|
|
|
|
|
+ code: null,
|
|
level: '',
|
|
level: '',
|
|
- majorType: '',
|
|
|
|
- optional: undefined,
|
|
|
|
|
|
+ category: '',
|
|
|
|
+ selective: undefined,
|
|
status: '',
|
|
status: '',
|
|
totalScore: undefined,
|
|
totalScore: undefined,
|
|
});
|
|
});
|
|
@@ -318,10 +318,8 @@
|
|
|
|
|
|
// 获取科目总分统计数据
|
|
// 获取科目总分统计数据
|
|
const getStatData = async () => {
|
|
const getStatData = async () => {
|
|
- if (!appStore.curExam?.id) return;
|
|
|
|
try {
|
|
try {
|
|
- // 这里需要传入实际的examId,暂时使用1作为示例
|
|
|
|
- const data = await getSubjectTotalScoreStatList(appStore.curExam.id);
|
|
|
|
|
|
+ const data = await getSubjectTotalScoreStatList();
|
|
updateChart(data);
|
|
updateChart(data);
|
|
} catch (error) {
|
|
} catch (error) {
|
|
console.error('获取统计数据失败:', error);
|
|
console.error('获取统计数据失败:', error);
|
|
@@ -336,7 +334,7 @@
|
|
const onEditPaperStruct = (row: SubjectItem) => {
|
|
const onEditPaperStruct = (row: SubjectItem) => {
|
|
router.push({
|
|
router.push({
|
|
name: 'PaperStructEdit',
|
|
name: 'PaperStructEdit',
|
|
- params: { subjectId: row.id },
|
|
|
|
|
|
+ params: { subjectCode: row.id },
|
|
});
|
|
});
|
|
};
|
|
};
|
|
|
|
|
|
@@ -345,7 +343,7 @@
|
|
const onAnalysis = async (row: SubjectItem | undefined) => {
|
|
const onAnalysis = async (row: SubjectItem | undefined) => {
|
|
try {
|
|
try {
|
|
setLoading(true);
|
|
setLoading(true);
|
|
- await subjectAnalysis(appStore.curExam.id, row?.id);
|
|
|
|
|
|
+ await subjectAnalysis(row?.code);
|
|
} catch (error) {
|
|
} catch (error) {
|
|
console.error('分析失败:', error);
|
|
console.error('分析失败:', error);
|
|
} finally {
|
|
} finally {
|
|
@@ -356,7 +354,7 @@
|
|
const onObjectiveMark = async () => {
|
|
const onObjectiveMark = async () => {
|
|
try {
|
|
try {
|
|
setLoading(true);
|
|
setLoading(true);
|
|
- await subjectObjectiveMarkScore(appStore.curExam.id);
|
|
|
|
|
|
+ await subjectObjectiveMarkScore();
|
|
} catch (error) {
|
|
} catch (error) {
|
|
console.error('分析失败:', error);
|
|
console.error('分析失败:', error);
|
|
} finally {
|
|
} finally {
|
|
@@ -367,13 +365,15 @@
|
|
const onSetOptional = (row: SubjectItem) => {
|
|
const onSetOptional = (row: SubjectItem) => {
|
|
router.push({
|
|
router.push({
|
|
name: 'OptionalRuleEdit',
|
|
name: 'OptionalRuleEdit',
|
|
- params: { subjectId: row.id },
|
|
|
|
|
|
+ params: { subjectCode: row.id },
|
|
});
|
|
});
|
|
};
|
|
};
|
|
|
|
|
|
// 导出
|
|
// 导出
|
|
const onExportCommand = (command: string) => {
|
|
const onExportCommand = (command: string) => {
|
|
- console.log('导出命令:', command);
|
|
|
|
|
|
+ downloadExport('exportSubjectMainObjective', {
|
|
|
|
+ objective: command === 'objective',
|
|
|
|
+ });
|
|
};
|
|
};
|
|
|
|
|
|
// 导入
|
|
// 导入
|
|
@@ -381,28 +381,28 @@
|
|
{
|
|
{
|
|
code: 'objective',
|
|
code: 'objective',
|
|
title: '客观题',
|
|
title: '客观题',
|
|
- url: '/api/admin/subject/import/kgt',
|
|
|
|
|
|
+ url: '/api/admin/subject/import',
|
|
format: ['xls', 'xlsx'],
|
|
format: ['xls', 'xlsx'],
|
|
donloadFilename: '客观题导入模板.xlsx',
|
|
donloadFilename: '客观题导入模板.xlsx',
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- code: 'zgtjg',
|
|
|
|
- title: 'subjectivewStruct',
|
|
|
|
- url: '/api/admin/subject/import/zgtjg',
|
|
|
|
|
|
+ code: 'subjective',
|
|
|
|
+ title: '主观题结构',
|
|
|
|
+ url: '/api/admin/subject/import',
|
|
format: ['xls', 'xlsx'],
|
|
format: ['xls', 'xlsx'],
|
|
donloadFilename: '主观题结构导入模板.xlsx',
|
|
donloadFilename: '主观题结构导入模板.xlsx',
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- code: 'subjectivewGroup',
|
|
|
|
|
|
+ code: 'subjectiveGroup',
|
|
title: '主观题分组',
|
|
title: '主观题分组',
|
|
- url: '/api/admin/subject/import/zgtfhy',
|
|
|
|
|
|
+ url: '/api/admin/subject/importGroup',
|
|
format: ['xls', 'xlsx'],
|
|
format: ['xls', 'xlsx'],
|
|
donloadFilename: '主观题分组导入模板.xlsx',
|
|
donloadFilename: '主观题分组导入模板.xlsx',
|
|
},
|
|
},
|
|
{
|
|
{
|
|
code: 'package',
|
|
code: 'package',
|
|
title: '数据包',
|
|
title: '数据包',
|
|
- url: '/api/admin/subject/import/sjb',
|
|
|
|
|
|
+ url: '/api/admin/subject/importData',
|
|
format: ['zip'],
|
|
format: ['zip'],
|
|
donloadFilename: undefined,
|
|
donloadFilename: undefined,
|
|
},
|
|
},
|
|
@@ -411,22 +411,39 @@
|
|
const importData = reactive({
|
|
const importData = reactive({
|
|
importType: 'objective',
|
|
importType: 'objective',
|
|
});
|
|
});
|
|
|
|
+ const uploadData = computed(() => {
|
|
|
|
+ if (importData.importType === 'objective') {
|
|
|
|
+ return { objective: true };
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (importData.importType === 'subjective') {
|
|
|
|
+ return { objective: false };
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return undefined;
|
|
|
|
+ });
|
|
const importConfig = computed(() => {
|
|
const importConfig = computed(() => {
|
|
return impoartConfigList.value.find(
|
|
return impoartConfigList.value.find(
|
|
(item) => item.code === importData.importType
|
|
(item) => item.code === importData.importType
|
|
);
|
|
);
|
|
});
|
|
});
|
|
const onImportCommand = (command: string) => {
|
|
const onImportCommand = (command: string) => {
|
|
- console.log('导入命令:', command);
|
|
|
|
importData.importType = command;
|
|
importData.importType = command;
|
|
importDialogRef.value?.open();
|
|
importDialogRef.value?.open();
|
|
};
|
|
};
|
|
async function downloadTemplate() {
|
|
async function downloadTemplate() {
|
|
- // const res = await downloadByApi(() => agentTemplate()).catch((e) => {
|
|
|
|
- // Message.error(e || '下载失败,请重新尝试!');
|
|
|
|
- // });
|
|
|
|
- // if (!res) return;
|
|
|
|
- // Message.success('下载成功!');
|
|
|
|
|
|
+ if (importData.importType === 'objective') {
|
|
|
|
+ downloadExport('downloadSubjectObjectiveImportTemplate', {
|
|
|
|
+ objective: true,
|
|
|
|
+ });
|
|
|
|
+ } else if (
|
|
|
|
+ importData.importType === 'subjective' ||
|
|
|
|
+ importData.importType === 'subjectiveGroup'
|
|
|
|
+ ) {
|
|
|
|
+ downloadExport('downloadSubjectiveImportTemplate', {
|
|
|
|
+ objective: false,
|
|
|
|
+ });
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|