list-exact-intelligent.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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="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="classId" clearable @change="handleQuery" style="width: 172px">
  10. <el-option v-for="c in classList" :label="c.name" :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" :data="drawerObj" 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 columns = [
  30. {label: '组卷类型', prop: 'buildTypeName'},
  31. {label: '班级', prop: 'className'},
  32. {label: '批次', prop: 'batchName'},
  33. {label: '班级人数', prop: 'total'},
  34. ...consts.config.exactColumns
  35. ]
  36. const actions = [
  37. {label: '查看详情', key: 'detail', permission: ['']}
  38. ]
  39. const drawer = ref(false)
  40. const drawerObj = ref(null)
  41. const type = consts.enums.buildType.ExactIntelligent
  42. const {batchList, batchId} = useProvidePaperBatchCondition(type)
  43. const classId = ref('')
  44. const queryParams = computed(() => ({buildType: type, batchId: toValue(batchId), classId: toValue(classId)}))
  45. const {rules, handleQuery, resetQuery, list, total, getList, classList} = useProvidePaperList(queryParams)
  46. const handleAction = function (action, row) {
  47. switch (action.key) {
  48. case "detail":
  49. drawer.value = true
  50. drawerObj.value = row
  51. break;
  52. default:
  53. throw new Error(`Action key '${action.key}' not support.`)
  54. break
  55. }
  56. }
  57. </script>
  58. <style scoped>
  59. </style>