list-exact-intelligent.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <template>
  2. <el-form ref="queryRef" :model="queryParams" :rules="rules" label-width="68px" inline>
  3. <el-form-item label="批次" prop="batchId">
  4. <el-select v-model="queryParams.batchId" clearable @change="handleQuery" style="width: 172px">
  5. <el-option v-for="b in batchList" :label="b.name" :value="b.batchId"/>
  6. </el-select>
  7. </el-form-item>
  8. <el-form-item label="班级" prop="classId">
  9. <el-select v-model="queryParams.classId" clearable @change="handleQuery" style="width: 172px">
  10. <el-option v-for="c in classList" :label="c.className" :value="c.classId"/>
  11. </el-select>
  12. </el-form-item>
  13. <el-form-item>
  14. <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
  15. <el-button icon="Refresh" @click="resetQuery">重置</el-button>
  16. </el-form-item>
  17. </el-form>
  18. <Table :data="list" :columns="columns" :actions="actions" @get-list="getList" @action="handleAction" />
  19. <el-drawer v-model="drawer" title="班级详情" size="1000px">
  20. <class-detail v-if="drawer" :state="queryParams.state" exact-mode />
  21. </el-drawer>
  22. </template>
  23. <script setup name="ListExactIntelligent">
  24. import consts from "@/utils/consts.js";
  25. import {useProvidePaperBatchCondition} from "@/views/dz/papers/hooks/usePaperBatchCondition.js";
  26. import {useProvidePaperList} from "@/views/dz/papers/hooks/usePaperList.js";
  27. import Table from "@/components/Table/index.vue"
  28. import ClassDetail from "@/views/dz/papers/components/plugs/class-detail.vue";
  29. const options = {
  30. queryDefine: {
  31. batchId: '',
  32. classId: ''
  33. }
  34. }
  35. const columns = [
  36. {label: '组卷类型', prop: 'buildType'},
  37. {label: '班级', prop: 'className'},
  38. {label: '批次', prop: 'batchName'},
  39. {label: '班级人数', prop: 'total'},
  40. ...consts.config.exactColumns
  41. ]
  42. const actions = [
  43. {label: '查看详情', key: 'detail', permission: ['']}
  44. ]
  45. const type = consts.enums.buildType.ExactIntelligent
  46. const classList = ref([])
  47. const {batchList} = useProvidePaperBatchCondition(type)
  48. const {queryParams, rules, handleQuery, resetQuery, list, total, getList} = useProvidePaperList(options)
  49. const drawer = ref(false)
  50. const handleAction = function (action, row) {
  51. switch (action.key) {
  52. case "detail":
  53. drawer.value = true
  54. break;
  55. default:
  56. throw new Error(`Action key '${action.key}' not support.`)
  57. break
  58. }
  59. }
  60. </script>
  61. <style scoped>
  62. </style>