Parcourir la source

paper records

abpcoder il y a 2 semaines
Parent
commit
5a19726287

+ 11 - 0
back-ui/src/api/dz/papers.js

@@ -174,6 +174,17 @@ export function publishPapers(data) {
 }
 }
 
 
 export function getPaperList(query) {
 export function getPaperList(query) {
+    // TODO: remove test code
+    return Promise.resolve({
+        code: 200,
+        total: 4,
+        rows: [
+            {id: 1, name: '试卷名称', classId: 1, className: '2501班', total: 50, unexact: 10, exact: 40, unsend: 10, send: 20, unfinish: 5, finish: 15},
+            {id: 2, name: '试卷名称', classId: 2, className: '2502班', total: 50, unexact: 10, exact: 40, unsend: 10, send: 20, unfinish: 5, finish: 15},
+            {id: 3, name: '试卷名称', classId: 3, className: '2503班', total: 50, unexact: 10, exact: 40, unsend: 10, send: 20, unfinish: 5, finish: 15},
+            {id: 4, name: '试卷名称', classId: 4, className: '2504班', total: 50, unexact: 10, exact: 40, unsend: 10, send: 20, unfinish: 5, finish: 15},
+        ]
+    })
     return request({
     return request({
         url: '/learn/teaching/papers',
         url: '/learn/teaching/papers',
         method: 'get',
         method: 'get',

+ 1 - 1
back-ui/src/utils/consts.js

@@ -16,7 +16,7 @@ export default {
     config: {
     config: {
         exactColumns: [
         exactColumns: [
             {label: '组卷已完成', prop: 'send'},
             {label: '组卷已完成', prop: 'send'},
-            {label: '组卷未完成', props: 'unfinish'},
+            {label: '组卷未完成', prop: 'unfinish'},
             {label: '定向未组卷', prop: 'unsend'},
             {label: '定向未组卷', prop: 'unsend'},
             {label: '未定向未组卷', prop: 'unexact'},
             {label: '未定向未组卷', prop: 'unexact'},
         ],
         ],

+ 10 - 0
back-ui/src/views/dz/papers/components/list-exact-hand.vue

@@ -0,0 +1,10 @@
+<template>
+
+</template>
+
+<script setup name="ListExactHand">
+</script>
+
+<style scoped>
+
+</style>

+ 75 - 0
back-ui/src/views/dz/papers/components/list-exact-intelligent.vue

@@ -0,0 +1,75 @@
+<template>
+    <el-form ref="queryRef" :model="queryParams" :rules="rules" label-width="68px" inline>
+        <el-form-item label="试卷名称" prop="name">
+            <el-input v-model="queryParams.name" clearable @keydown.enter="handleQuery" @clear="handleQuery"
+                      style="width: 172px"/>
+        </el-form-item>
+        <el-form-item label="批次" prop="batchId">
+            <el-select v-model="queryParams.batchId" clearable @change="handleQuery" style="width: 172px">
+                <el-option v-for="b in batchList" :label="b.name" :value="b.batchId"/>
+            </el-select>
+        </el-form-item>
+        <el-form-item label="发送状态" prop="state">
+            <el-select v-model="queryParams.state" clearable @change="handleQuery" style="width: 172px">
+                <el-option v-for="s in stateList" :label="s" :value="s"/>
+            </el-select>
+        </el-form-item>
+        <el-form-item>
+            <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
+            <el-button icon="Refresh" @click="resetQuery">重置</el-button>
+        </el-form-item>
+    </el-form>
+    <Table :data="list" :columns="columns" :actions="actions" @get-list="getList" @action="handleAction" />
+    <el-drawer v-model="drawer" title="班级详情" size="50%">
+        <class-detail v-if="drawer" :state="queryParams.state" />
+    </el-drawer>
+</template>
+
+<script setup name="ListExactIntelligent">
+
+import consts from "@/utils/consts.js";
+import {useProvidePaperBatchCondition} from "@/views/dz/papers/hooks/usePaperBatchCondition.js";
+import {useProvidePaperList} from "@/views/dz/papers/hooks/usePaperList.js";
+import Table from "@/components/Table/index.vue"
+import ClassDetail from "@/views/dz/papers/components/plugs/class-detail.vue";
+
+const options = {
+    queryDefine: {
+        name: '',
+        batchId: '',
+        state: ''
+    }
+}
+const columns = [
+    {label: '组卷类型', prop: 'buildType'},
+    {label: '班级', prop: 'className'},
+    {label: '批次', prop: 'batchName'},
+    {label: '班级人数', prop: 'total'},
+    ...consts.config.exactColumns,
+    {label: '试卷名称', prop: 'name'}
+]
+const actions = [
+    {label: '查看详情', key: 'detail', permission: ['']}
+]
+
+const type = consts.enums.buildType.ExactIntelligent
+const stateList = consts.config.exactColumns.map(c => c.label)
+const {batchList} = useProvidePaperBatchCondition(type)
+const {queryParams, rules, handleQuery, resetQuery, list, total, getList} = useProvidePaperList(options)
+const drawer = ref(false)
+
+const handleAction = function (action, row) {
+    switch (action.key) {
+        case "detail":
+            drawer.value = true
+            break;
+        default:
+            throw new Error(`Action key '${action.key}' not support.`)
+            break
+    }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 10 - 0
back-ui/src/views/dz/papers/components/list-full-hand.vue

@@ -0,0 +1,10 @@
+<template>
+
+</template>
+
+<script setup name="ListFullHand">
+</script>
+
+<style scoped>
+
+</style>

+ 10 - 0
back-ui/src/views/dz/papers/components/list-full-intelligent.vue

@@ -0,0 +1,10 @@
+<template>
+
+</template>
+
+<script setup name="ListFullIntelligent">
+</script>
+
+<style scoped>
+
+</style>

+ 162 - 0
back-ui/src/views/dz/papers/components/plugs/class-detail.vue

@@ -0,0 +1,162 @@
+<template>
+    <el-form :model="queryParams" :rules="rules" label-width="68px" inline>
+        <el-form-item label="发送状态" v-model="queryParams.state">
+            <el-select v-model="queryParams.state" clearable @change="handleQuery" style="width: 172px">
+                <el-option v-for="s in stateList" :label="s" :value="s" />
+            </el-select>
+        </el-form-item>
+        <el-form-item>
+            <el-button type="primary" @click="handleQuery">查询</el-button>
+        </el-form-item>
+    </el-form>
+    <Table :data="list" :columns="columns" :actions="actions" @action="handleAction"/>
+    <el-dialog v-model="dialog" title="做题情况" show-close>
+        <student-detail v-if="dialog" :id="1" />
+    </el-dialog>
+</template>
+
+<script setup name="ClassDetail">
+import consts from "@/utils/consts.js";
+import Table from "@/components/Table/index.vue";
+import StudentDetail from "@/views/dz/papers/components/plugs/student-detail.vue";
+
+const props = defineProps({
+    paperId: [String, Number],
+    state: String,
+    exactMode: Boolean
+})
+
+const list = ref([])
+const queryParams = ref({
+    paperId: '',
+    state: ''
+})
+const stateList = computed(() => props.exactMode
+    ? consts.config.exactColumns.map(c => c.label)
+    : consts.config.fullColumns.map(c => c.label))
+const rules = {}
+const dialog = ref(false)
+
+const columns = [
+    {label: '姓名', prop: 'studentName'},
+    {label: '班级', prop: 'className'},
+    {label: '考试批次', prop: 'batchName'},
+    {label: '发送情况', prop: 'state'},
+    {label: '得分率', prop: 'rate'},
+    {label: '手机号', prop: 'rate'}
+]
+const actions = [
+    {key: 'rate', label: '详情', permission: ['']}
+]
+
+const getList = async function() {
+    list.value = [{
+        id: 1,
+        studentId: 1,
+        studentName: '张三',
+        mobile: '13933445566',
+        batchId: 1,
+        batchName: '第一批',
+        state: '',
+        rate: '80%',
+    },{
+        studentId: 1,
+        studentName: '张三',
+        mobile: '13933445566',
+        batchId: 1,
+        batchName: '第一批',
+        state: '',
+        rate: '80%',
+    },{
+        studentId: 1,
+        studentName: '张三',
+        mobile: '13933445566',
+        batchId: 1,
+        batchName: '第一批',
+        state: '',
+        rate: '80%',
+    },{
+        studentId: 1,
+        studentName: '张三',
+        mobile: '13933445566',
+        batchId: 1,
+        batchName: '第一批',
+        state: '',
+        rate: '80%',
+    },{
+        studentId: 1,
+        studentName: '张三',
+        mobile: '13933445566',
+        batchId: 1,
+        batchName: '第一批',
+        state: '',
+        rate: '80%',
+    },{
+        studentId: 1,
+        studentName: '张三',
+        mobile: '13933445566',
+        batchId: 1,
+        batchName: '第一批',
+        state: '',
+        rate: '80%',
+    },{
+        studentId: 1,
+        studentName: '张三',
+        mobile: '13933445566',
+        batchId: 1,
+        batchName: '第一批',
+        state: '',
+        rate: '80%',
+    },{
+        studentId: 1,
+        studentName: '张三',
+        mobile: '13933445566',
+        batchId: 1,
+        batchName: '第一批',
+        state: '',
+        rate: '80%',
+    },{
+        studentId: 1,
+        studentName: '张三',
+        mobile: '13933445566',
+        batchId: 1,
+        batchName: '第一批',
+        state: '',
+        rate: '80%',
+    },{
+        studentId: 1,
+        studentName: '张三',
+        mobile: '13933445566',
+        batchId: 1,
+        batchName: '第一批',
+        state: '',
+        rate: '80%',
+    },]
+}
+
+const handleQuery = async function () {
+    await getList()
+}
+
+const handleAction = function (action, row) {
+    switch (action.key) {
+        case "rate":
+            dialog.value = true
+            break
+        default:
+            throw new Error(`Action type '${action.key}' not support.`)
+            break
+    }
+}
+
+onMounted(async () => {
+    queryParams.value.paperId = props.paperId
+    queryParams.value.state = props.state
+
+    await getList()
+})
+</script>
+
+<style scoped>
+
+</style>

+ 3 - 7
back-ui/src/views/dz/papers/components/plugs/class-statistic-table.vue

@@ -6,6 +6,7 @@
 <script setup name="ClassStatisticTable">
 <script setup name="ClassStatisticTable">
 import {useInjectPaperClassStatisticCondition} from "@/views/dz/papers/hooks/usePaperClassStatisticCondition.js";
 import {useInjectPaperClassStatisticCondition} from "@/views/dz/papers/hooks/usePaperClassStatisticCondition.js";
 import Table from '@/components/Table/index.vue';
 import Table from '@/components/Table/index.vue';
+import consts from "@/utils/consts.js";
 
 
 const props = defineProps({
 const props = defineProps({
     exactMode: Boolean
     exactMode: Boolean
@@ -20,16 +21,11 @@ const multiple = ref(true);
 const columns = props.exactMode ? [
 const columns = props.exactMode ? [
     {label: '班级名称', prop: 'className'},
     {label: '班级名称', prop: 'className'},
     {label: '总人数', prop: 'total'},
     {label: '总人数', prop: 'total'},
-    {label: '组卷已完成', prop: 'send'},
-    {label: '组卷未完成', prop: 'unfinish'},
-    {label: '定向未组卷', prop: 'unsend'},
-    {label: '未定向未组卷', prop: 'unexact'},
+    ...consts.config.exactColumns
 ] : [
 ] : [
     {label: '班级名称', prop: 'className'},
     {label: '班级名称', prop: 'className'},
     {label: '总人数', prop: 'total'},
     {label: '总人数', prop: 'total'},
-    {label: '组卷已完成', prop: 'send'},
-    {label: '组卷未完成', prop: 'unfinish'},
-    {label: '未组卷', prop: 'unsend'},
+    ...consts.config.fullColumns
 ]
 ]
 
 
 function handleSelectionChange(selection) {
 function handleSelectionChange(selection) {

+ 49 - 0
back-ui/src/views/dz/papers/components/plugs/student-detail.vue

@@ -0,0 +1,49 @@
+<template>
+    <el-text type="primary" tag="b">基础信息</el-text>
+    <el-descriptions border :column="4" class="mb-5 mt-2">
+        <el-descriptions-item label="组卷类型">{{detail.buildType}}</el-descriptions-item>
+        <el-descriptions-item label="批次">{{detail.batchName}}</el-descriptions-item>
+        <el-descriptions-item label="科目">{{detail.subjectName}}</el-descriptions-item>
+        <el-descriptions-item label="班级">{{detail.className}}</el-descriptions-item>
+        <el-descriptions-item label="姓名">{{detail.studentName}}</el-descriptions-item>
+        <el-descriptions-item label="总分">{{detail.total}}</el-descriptions-item>
+        <el-descriptions-item label="得分">{{detail.score}}</el-descriptions-item>
+        <el-descriptions-item label="得分率">{{detail.rate}}</el-descriptions-item>
+    </el-descriptions>
+    <el-text type="primary" tag="b">知识点明细</el-text>
+    <Table :data="detail.knowledges" :columns="columns" style="width: 90%; margin-top: 5px"/>
+</template>
+
+<script setup name="StudentDetail">
+import Table from '@/components/Table/index.vue';
+
+const detail = ref({
+    buildType: '定向智能',
+    batchId: 1,
+    batchName: '第一批',
+    subjectName: '职测',
+    studentName: '张三',
+    className: '2501班',
+    total: 300,
+    score: 240,
+    rate: '80%',
+    knowledges: [
+        {id: 1, name: '知识点一', num: 5, correct: 4, rate: '80%'},
+        {id: 2, name: '知识点二', num: 8, correct: 3, rate: '38%'},
+        {id: 3, name: '知识点三', num: 10, correct: 8, rate: '80%'},
+        {id: 4, name: '知识点四', num: 2, correct: 2, rate: '100%'},
+        {id: 5, name: '知识点五', num: 2, correct: 1, rate: '50%'},
+    ]
+})
+
+const columns = [
+    {label: '知识点', prop: 'name'},
+    {label: '题量', prop: 'num'},
+    {label: '正确数', prop: 'correct'},
+    {label: '正确率', prop: 'rate'}
+]
+</script>
+
+<style scoped>
+
+</style>

+ 106 - 0
back-ui/src/views/dz/papers/hooks/usePaperList.js

@@ -0,0 +1,106 @@
+import {useInjectGlobalLoading} from "@/views/hooks/useGlobalLoading.js";
+import {injectLocal, provideLocal} from "@vueuse/core";
+import {getPaperList} from "@/api/dz/papers.js";
+
+const key = Symbol('PaperList')
+
+const defaultOptions = {
+    queryDefine: {},
+    formDefine: {},
+    ruleDefine: {},
+    exportPath: '',
+    downloadPath: '',
+    queryRef: 'queryRef',
+    formRef: 'formRef',
+    rowKey: 'id'
+}
+export const useProvidePaperList = function (opts = defaultOptions) {
+    const options = {...defaultOptions, ...opts}
+    const {proxy} = getCurrentInstance()
+    const {loading} = useInjectGlobalLoading()
+
+    const list = ref([])
+    const open = ref(false)
+    const showSearch = ref(true)
+    const ids = ref([])
+    const single = ref(true)
+    const multiple = ref(true)
+    const total = ref(0)
+
+    const data = reactive({
+        form: {...options.formDefine},
+        queryParams: {
+            pageNum: 1,
+            pageSize: 10,
+            ...options.queryDefine
+        },
+        rules: {...options.ruleDefine}
+    })
+
+    const {queryParams, form, rules} = toRefs(data)
+
+    // 取消按钮
+    function cancel() {
+        open.value = false
+        reset()
+    }
+
+    // 表单重置
+    function reset() {
+        form.value = {
+            ...options.formDefine
+        }
+        proxy.resetForm(options.formRef)
+    }
+
+    /** 搜索按钮操作 */
+    function handleQuery() {
+        queryParams.value.pageNum = 1
+        getList()
+    }
+
+    /** 重置按钮操作 */
+    function resetQuery() {
+        proxy.resetForm(options.queryRef)
+        handleQuery()
+    }
+
+    // 多选框选中数据
+    function handleSelectionChange(selection) {
+        ids.value = selection.map(item => item[options.rowKey])
+        single.value = selection.length != 1
+        multiple.value = !selection.length
+    }
+
+    const handleDownload = function (paper) {
+        // TODO: 还不确定抽象方式,稍后再做
+        proxy.download(options.downloadPath, {
+            paperId: paper.id
+        }, `${paper.paperName}_${new Date().getTime()}.xlsx`)
+    }
+
+    function getList() {
+        loading.value = true
+
+        getPaperList(queryParams.value).then(response => {
+            list.value = response.rows
+            total.value = response.total
+            loading.value = false
+        })
+    }
+
+    onMounted(() => getList())
+
+    const payload = {
+        queryParams, form, rules,
+        open, showSearch, ids, single, multiple,
+        total, list,
+        handleQuery, resetQuery, handleSelectionChange, reset, cancel, getList
+    }
+    provideLocal(key, payload)
+    return payload
+}
+
+export const useInjectPaperList = function () {
+    return injectLocal(key)
+}

+ 253 - 0
back-ui/src/views/dz/papers/list-bak.vue

@@ -0,0 +1,253 @@
+<template>
+    <div class="app-container">
+        <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
+            <el-form-item label="试卷名称" prop="name">
+                <el-input v-model="queryParams.name" placeholder="请输入试卷名称" clearable @keyup.enter="handleQuery"/>
+            </el-form-item>
+            <el-form-item label="组卷类型" prop="buildType">
+                <el-select v-model="queryParams.buildType" clearable placeholder="请选择组卷类型" style="width: 170px;">
+                    <!--        TODO: 组卷类型        -->
+                </el-select>
+            </el-form-item>
+            <el-form-item label="试卷批次" prop="batchId">
+                <el-select v-model="queryParams.batchId" clearable placeholder="请选择批次" style="width: 170px;">
+                    <el-option v-for="b in batchList" :label="b.name" :value="b.batchId"/>
+                </el-select>
+            </el-form-item>
+            <el-form-item label="考生类型" prop="examType">
+                <el-select v-model="queryParams.examType" placeholder="请选择考生类型" clearable style="width: 170px;">
+                    <el-option v-for="dict in exam_type" :key="dict.value" :label="dict.label" :value="dict.value"/>
+                </el-select>
+            </el-form-item>
+            <el-form-item label="发送情况" prop="state">
+                <el-select v-model="queryParams.state" placeholder="请选择考生类型" clearable style="width: 170px;">
+                    <!--         TODO: 发送情况           -->
+                </el-select>
+            </el-form-item>
+            <el-form-item label="科目" prop="subjectId">
+                <el-select v-model="queryParams.subjectId" clearable placeholder="请选择科目" style="width: 170px;">
+                    <el-option v-for="s in subjectList" :label="s.subjectName" :value="s.subjectId"/>
+                </el-select>
+            </el-form-item>
+            <el-form-item>
+                <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
+                <el-button icon="Refresh" @click="resetQuery">重置</el-button>
+            </el-form-item>
+        </el-form>
+
+        <el-row :gutter="10" class="mb8">
+            <!--            <el-col :span="1.5">-->
+            <!--                <el-button-->
+            <!--                    type="primary"-->
+            <!--                    plain-->
+            <!--                    icon="Plus"-->
+            <!--                    @click="handleAdd"-->
+            <!--                    v-hasPermi="['dz:subject:add']"-->
+            <!--                >新增</el-button>-->
+            <!--            </el-col>-->
+            <!--            <el-col :span="1.5">-->
+            <!--                <el-button-->
+            <!--                    type="success"-->
+            <!--                    plain-->
+            <!--                    icon="Edit"-->
+            <!--                    :disabled="single"-->
+            <!--                    @click="handleUpdate"-->
+            <!--                    v-hasPermi="['dz:subject:edit']"-->
+            <!--                >修改</el-button>-->
+            <!--            </el-col>-->
+            <!--            <el-col :span="1.5">-->
+            <!--                <el-button-->
+            <!--                    type="danger"-->
+            <!--                    plain-->
+            <!--                    icon="Delete"-->
+            <!--                    :disabled="multiple"-->
+            <!--                    @click="handleDelete"-->
+            <!--                    v-hasPermi="['dz:subject:remove']"-->
+            <!--                >删除</el-button>-->
+            <!--            </el-col>-->
+            <!--            <el-col :span="1.5">-->
+            <!--                <el-button-->
+            <!--                    type="warning"-->
+            <!--                    plain-->
+            <!--                    icon="Download"-->
+            <!--                    @click="handleExport"-->
+            <!--                    v-hasPermi="['dz:subject:export']"-->
+            <!--                >导出</el-button>-->
+            <!--            </el-col>-->
+            <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
+        </el-row>
+
+        <el-table v-loading="loading" :data="paperList" @selection-change="handleSelectionChange">
+            <el-table-column type="selection" width="55" align="center"/>
+            <el-table-column label="试卷ID" align="center" prop="id" width="80"/>
+            <el-table-column label="试卷名称" align="center" prop="paperName"/>
+            <el-table-column label="科目" align="center" prop="subjectName"/>
+            <el-table-column label="试卷批次" align="center" prop="batchName"/>
+            <el-table-column label="组卷类型" align="center" prop="buildType"/>
+            <el-table-column label="状态" align="center" prop="state"/>
+            <el-table-column label="创建人" align="center" prop="createBy"/>
+            <el-table-column label="试卷分类" align="center" prop="paperType"/>
+            <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+                <template #default="scope">
+                    <el-button link type="primary" icon="Edit" @click="handleEdit(scope.row)"
+                               v-hasPermi="['dz:paper:edit']">编辑
+                    </el-button>
+                    <el-button link type="primary" icon="Download" @click="handleDownload(scope.row)"
+                               v-hasPermi="['dz:paper:download']">下载
+                    </el-button>
+                    <el-button link type="primary" icon="Finished" @click="handlePublish(scope.row)"
+                               v-hasPermi="['dz:paper:download']">发布试卷
+                    </el-button>
+                </template>
+            </el-table-column>
+        </el-table>
+
+        <pagination v-show="total>0" :total="total" v-model:page="queryParams.pageNum"
+                    v-model:limit="queryParams.pageSize" @pagination="getList"/>
+
+        <!-- 添加或修改科目对话框 -->
+        <el-dialog :title="publishDialogTitle" v-model="openPublish" width="500px" append-to-body>
+            <paper-publish :paper="openPaper" />
+            <template #footer>
+                <div class="dialog-footer">
+                    <el-button type="primary" @click="handlePublishConfirm">确 定</el-button>
+                    <el-button @click="cancel">取 消</el-button>
+                </div>
+            </template>
+        </el-dialog>
+    </div>
+</template>
+
+<script setup name="PaperList">
+
+import {getPaperBatches, getPaperList, getPaperSubjects} from "@/api/dz/papers.js";
+// import PaperPublish from "@/views/dz/papers/components/paper-publish.vue";
+
+const {proxy} = getCurrentInstance()
+const {exam_type} = proxy.useDict('build_type', 'exam_type')
+
+const paperList = ref([])
+const open = ref(false)
+const loading = ref(false)
+const showSearch = ref(true)
+const ids = ref([])
+const single = ref(true)
+const multiple = ref(true)
+const total = ref(0)
+
+const subjectList = ref([])
+const batchList = ref([])
+const subjectMap = computed(() => {
+    const obj = {}
+    subjectList.value.forEach(s => obj[s.subjectId] = s.subjectName)
+    return obj
+})
+const batchMap = computed(() => {
+    const obj = {}
+    batchList.value.forEach(b => obj[b.batchId] = b.name)
+    return obj
+})
+
+const openPublish = ref(false)
+const openPaper = ref(null)
+const publishDialogTitle = computed(() => `发布试卷:${openPaper?.paperName}`)
+
+const data = reactive({
+    form: {},
+    queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        name: null,
+        buildType: null,
+        batchId: null,
+        subjectId: null,
+        state: null
+    },
+    rules: {}
+})
+
+const {queryParams, form, rules} = toRefs(data)
+
+function getList() {
+    loading.value = true
+
+    getPaperList(queryParams.value).then(response => {
+        response.rows.forEach(p => {
+            p.subjectName = subjectMap.value[p.subjectId] || ''
+            p.batchName = batchMap.value[p.batchId] || ''
+        })
+        paperList.value = response.rows
+        total.value = response.total
+        loading.value = false
+    })
+}
+
+// 取消按钮
+function cancel() {
+    open.value = false
+    reset()
+}
+
+// 表单重置
+function reset() {
+    form.value = {
+        subjectId: null,
+        subjectName: null,
+        pinyin: null,
+        sort: null,
+        locations: null,
+        examTypes: null
+    }
+    proxy.resetForm("subjectRef")
+}
+
+/** 搜索按钮操作 */
+function handleQuery() {
+    queryParams.value.pageNum = 1
+    getList()
+}
+
+/** 重置按钮操作 */
+function resetQuery() {
+    proxy.resetForm("queryRef")
+    handleQuery()
+}
+
+// 多选框选中数据
+function handleSelectionChange(selection) {
+    ids.value = selection.map(item => item.subjectId)
+    single.value = selection.length != 1
+    multiple.value = !selection.length
+}
+
+// operations
+const handleEdit = function (paper) {
+
+}
+
+const handleDownload = function (paper) {
+    proxy.download('/learn/paper/export', {
+        paperId: paper.id
+    }, `${paper.paperName}_${new Date().getTime()}.xlsx`)
+}
+
+const handlePublish = function (paper) {
+    openPublish.value = true
+    openPaper.value = paper
+}
+
+const handlePublishConfirm = function () {
+    openPublish.value = false
+}
+
+// hooks
+onMounted(async () => {
+    const resSubject = await getPaperSubjects()
+    subjectList.value = resSubject.data
+    const resBatch = await getPaperBatches()
+    batchList.value = resBatch.data
+    getList()
+})
+</script>
+
+<style lang="scss" scoped></style>

+ 41 - 243
back-ui/src/views/dz/papers/list.vue

@@ -1,252 +1,50 @@
 <template>
 <template>
-    <div class="app-container">
-        <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
-            <el-form-item label="试卷名称" prop="name">
-                <el-input v-model="queryParams.name" placeholder="请输入试卷名称" clearable @keyup.enter="handleQuery"/>
-            </el-form-item>
-            <el-form-item label="组卷类型" prop="buildType">
-                <el-select v-model="queryParams.buildType" clearable placeholder="请选择组卷类型" style="width: 170px;">
-                    <!--        TODO: 组卷类型        -->
-                </el-select>
-            </el-form-item>
-            <el-form-item label="试卷批次" prop="batchId">
-                <el-select v-model="queryParams.batchId" clearable placeholder="请选择批次" style="width: 170px;">
-                    <el-option v-for="b in batchList" :label="b.name" :value="b.batchId"/>
-                </el-select>
-            </el-form-item>
-            <el-form-item label="考生类型" prop="examType">
-                <el-select v-model="queryParams.examType" placeholder="请选择考生类型" clearable style="width: 170px;">
-                    <el-option v-for="dict in exam_type" :key="dict.value" :label="dict.label" :value="dict.value"/>
-                </el-select>
-            </el-form-item>
-            <el-form-item label="发送情况" prop="state">
-                <el-select v-model="queryParams.state" placeholder="请选择考生类型" clearable style="width: 170px;">
-                    <!--         TODO: 发送情况           -->
-                </el-select>
-            </el-form-item>
-            <el-form-item label="科目" prop="subjectId">
-                <el-select v-model="queryParams.subjectId" clearable placeholder="请选择科目" style="width: 170px;">
-                    <el-option v-for="s in subjectList" :label="s.subjectName" :value="s.subjectId"/>
-                </el-select>
-            </el-form-item>
-            <el-form-item>
-                <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
-                <el-button icon="Refresh" @click="resetQuery">重置</el-button>
-            </el-form-item>
-        </el-form>
-
-        <el-row :gutter="10" class="mb8">
-            <!--            <el-col :span="1.5">-->
-            <!--                <el-button-->
-            <!--                    type="primary"-->
-            <!--                    plain-->
-            <!--                    icon="Plus"-->
-            <!--                    @click="handleAdd"-->
-            <!--                    v-hasPermi="['dz:subject:add']"-->
-            <!--                >新增</el-button>-->
-            <!--            </el-col>-->
-            <!--            <el-col :span="1.5">-->
-            <!--                <el-button-->
-            <!--                    type="success"-->
-            <!--                    plain-->
-            <!--                    icon="Edit"-->
-            <!--                    :disabled="single"-->
-            <!--                    @click="handleUpdate"-->
-            <!--                    v-hasPermi="['dz:subject:edit']"-->
-            <!--                >修改</el-button>-->
-            <!--            </el-col>-->
-            <!--            <el-col :span="1.5">-->
-            <!--                <el-button-->
-            <!--                    type="danger"-->
-            <!--                    plain-->
-            <!--                    icon="Delete"-->
-            <!--                    :disabled="multiple"-->
-            <!--                    @click="handleDelete"-->
-            <!--                    v-hasPermi="['dz:subject:remove']"-->
-            <!--                >删除</el-button>-->
-            <!--            </el-col>-->
-            <!--            <el-col :span="1.5">-->
-            <!--                <el-button-->
-            <!--                    type="warning"-->
-            <!--                    plain-->
-            <!--                    icon="Download"-->
-            <!--                    @click="handleExport"-->
-            <!--                    v-hasPermi="['dz:subject:export']"-->
-            <!--                >导出</el-button>-->
-            <!--            </el-col>-->
-            <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
-        </el-row>
-
-        <el-table v-loading="loading" :data="paperList" @selection-change="handleSelectionChange">
-            <el-table-column type="selection" width="55" align="center"/>
-            <el-table-column label="试卷ID" align="center" prop="id" width="80"/>
-            <el-table-column label="试卷名称" align="center" prop="paperName"/>
-            <el-table-column label="科目" align="center" prop="subjectName"/>
-            <el-table-column label="试卷批次" align="center" prop="batchName"/>
-            <el-table-column label="组卷类型" align="center" prop="buildType"/>
-            <el-table-column label="状态" align="center" prop="state"/>
-            <el-table-column label="创建人" align="center" prop="createBy"/>
-            <el-table-column label="试卷分类" align="center" prop="paperType"/>
-            <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
-                <template #default="scope">
-                    <el-button link type="primary" icon="Edit" @click="handleEdit(scope.row)"
-                               v-hasPermi="['dz:paper:edit']">编辑
-                    </el-button>
-                    <el-button link type="primary" icon="Download" @click="handleDownload(scope.row)"
-                               v-hasPermi="['dz:paper:download']">下载
-                    </el-button>
-                    <el-button link type="primary" icon="Finished" @click="handlePublish(scope.row)"
-                               v-hasPermi="['dz:paper:download']">发布试卷
-                    </el-button>
-                </template>
-            </el-table-column>
-        </el-table>
-
-        <pagination v-show="total>0" :total="total" v-model:page="queryParams.pageNum"
-                    v-model:limit="queryParams.pageSize" @pagination="getList"/>
-
-        <!-- 添加或修改科目对话框 -->
-        <el-dialog :title="publishDialogTitle" v-model="openPublish" width="500px" append-to-body>
-            <paper-publish :paper="openPaper" />
-            <template #footer>
-                <div class="dialog-footer">
-                    <el-button type="primary" @click="handlePublishConfirm">确 定</el-button>
-                    <el-button @click="cancel">取 消</el-button>
-                </div>
-            </template>
-        </el-dialog>
+    <div class="app-container" v-loading="loading">
+        <el-tabs v-model="currentTab">
+            <el-tab-pane v-for="t in tabs" :label="t.label" :name="t.name">
+                <component :is="t.page" v-if="t.visited"/>
+            </el-tab-pane>
+        </el-tabs>
     </div>
     </div>
 </template>
 </template>
 
 
 <script setup name="PaperList">
 <script setup name="PaperList">
 
 
-import {getPaperBatches, getPaperList, getPaperSubjects} from "@/api/dz/papers.js";
-// import PaperPublish from "@/views/dz/papers/components/paper-publish.vue";
-
-const {proxy} = getCurrentInstance()
-const {exam_type} = proxy.useDict('build_type', 'exam_type')
-
-const paperList = ref([])
-const open = ref(false)
-const loading = ref(false)
-const showSearch = ref(true)
-const ids = ref([])
-const single = ref(true)
-const multiple = ref(true)
-const total = ref(0)
-
-const subjectList = ref([])
-const batchList = ref([])
-const subjectMap = computed(() => {
-    const obj = {}
-    subjectList.value.forEach(s => obj[s.subjectId] = s.subjectName)
-    return obj
-})
-const batchMap = computed(() => {
-    const obj = {}
-    batchList.value.forEach(b => obj[b.batchId] = b.name)
-    return obj
-})
-
-const openPublish = ref(false)
-const openPaper = ref(null)
-const publishDialogTitle = computed(() => `发布试卷:${openPaper?.paperName}`)
-
-const data = reactive({
-    form: {},
-    queryParams: {
-        pageNum: 1,
-        pageSize: 10,
-        name: null,
-        buildType: null,
-        batchId: null,
-        subjectId: null,
-        state: null
-    },
-    rules: {}
-})
-
-const {queryParams, form, rules} = toRefs(data)
-
-function getList() {
-    loading.value = true
-
-    getPaperList(queryParams.value).then(response => {
-        response.rows.forEach(p => {
-            p.subjectName = subjectMap.value[p.subjectId] || ''
-            p.batchName = batchMap.value[p.batchId] || ''
-        })
-        paperList.value = response.rows
-        total.value = response.total
-        loading.value = false
-    })
-}
-
-// 取消按钮
-function cancel() {
-    open.value = false
-    reset()
-}
-
-// 表单重置
-function reset() {
-    form.value = {
-        subjectId: null,
-        subjectName: null,
-        pinyin: null,
-        sort: null,
-        locations: null,
-        examTypes: null
-    }
-    proxy.resetForm("subjectRef")
-}
-
-/** 搜索按钮操作 */
-function handleQuery() {
-    queryParams.value.pageNum = 1
-    getList()
-}
-
-/** 重置按钮操作 */
-function resetQuery() {
-    proxy.resetForm("queryRef")
-    handleQuery()
-}
-
-// 多选框选中数据
-function handleSelectionChange(selection) {
-    ids.value = selection.map(item => item.subjectId)
-    single.value = selection.length != 1
-    multiple.value = !selection.length
-}
-
-// operations
-const handleEdit = function (paper) {
-
-}
-
-const handleDownload = function (paper) {
-    proxy.download('/learn/paper/export', {
-        paperId: paper.id
-    }, `${paper.paperName}_${new Date().getTime()}.xlsx`)
-}
-
-const handlePublish = function (paper) {
-    openPublish.value = true
-    openPaper.value = paper
-}
-
-const handlePublishConfirm = function () {
-    openPublish.value = false
-}
-
-// hooks
-onMounted(async () => {
-    const resSubject = await getPaperSubjects()
-    subjectList.value = resSubject.data
-    const resBatch = await getPaperBatches()
-    batchList.value = resBatch.data
-    getList()
+import {useProvideGlobalLoading} from "@/views/hooks/useGlobalLoading.js";
+import ListExactIntelligent from "@/views/dz/papers/components/list-exact-intelligent.vue";
+import ListFullIntelligent from "@/views/dz/papers/components/list-full-intelligent.vue";
+import ListExactHand from "@/views/dz/papers/components/list-exact-hand.vue";
+import ListFullHand from "@/views/dz/papers/components/list-full-hand.vue";
+
+const {loading} = useProvideGlobalLoading()
+
+const tabs = ref([{
+    name: 'ExactIntelligent',
+    label: '定向智能',
+    page: markRaw(ListExactIntelligent) ,
+    visited: true
+}, {
+    name: 'FullIntelligent',
+    label: '全量智能',
+    page: markRaw(ListFullIntelligent),
+    visited: false
+}, {
+    name: 'ExactHand',
+    label: '定向手动',
+    page: markRaw(ListExactHand),
+    visited: false
+}, {
+    name: 'FullHand',
+    label: '全量手动',
+    page: markRaw(ListFullHand),
+    visited: false
+}])
+const currentTab = ref('ExactIntelligent')
+
+watch(currentTab, tabName => {
+    // 通过visited=true 延迟渲染
+    const tab = tabs.value.find(t => t.name == tabName)
+    if (tab) tab.visited = true
 })
 })
 </script>
 </script>