|
@@ -1,5 +1,12 @@
|
|
|
<template>
|
|
|
<div class="p-base">
|
|
|
+ <div class="fill-blank radius-base p-t-base">
|
|
|
+ <base-form :items="items" :model="model" :label-width="'80px'" size="small">
|
|
|
+ <template #form-item-button>
|
|
|
+ <el-button type="primary" @click="onSearch">查询</el-button>
|
|
|
+ </template>
|
|
|
+ </base-form>
|
|
|
+ </div>
|
|
|
<div class="fill-blank radius-base p-base chart-info">
|
|
|
<vue-e-charts v-loading="loading" class="full" :option="totalChartsOption" autoresize></vue-e-charts>
|
|
|
</div>
|
|
@@ -19,25 +26,83 @@
|
|
|
|
|
|
<script setup lang="ts" name="SubjectProgress">
|
|
|
/** 科目进度 */
|
|
|
-import { reactive, ref, computed } from 'vue'
|
|
|
+import { reactive, ref, computed, watch } from 'vue'
|
|
|
import { minus } from '@/utils/common'
|
|
|
import useFetch from '@/hooks/useFetch'
|
|
|
import useMainStore from '@/store/main'
|
|
|
import VueECharts from 'vue-echarts'
|
|
|
import BaseTable from '@/components/element/BaseTable.vue'
|
|
|
+import BaseForm from '@/components/element/BaseForm.vue'
|
|
|
+import useForm from '@/hooks/useForm'
|
|
|
+import useOptions from '@/hooks/useOptions'
|
|
|
+import { ElButton } from 'element-plus'
|
|
|
|
|
|
import type { EChartsOption } from 'echarts'
|
|
|
import type { ExtractApiResponse } from '@/api/api'
|
|
|
import type { EpTableColumn, InstanceTable } from 'global-type'
|
|
|
|
|
|
type SubjectProgress = ExtractArrayValue<ExtractApiResponse<'subjectProgressEnd'>>
|
|
|
+const {
|
|
|
+ subjectList,
|
|
|
+ mainQuestionList,
|
|
|
+ groupListWithAll,
|
|
|
+ onOptionInit,
|
|
|
+ dataModel,
|
|
|
+ changeModelValue,
|
|
|
+ isExpert,
|
|
|
+ isLeader,
|
|
|
+} = useOptions(['subject', 'question', 'group'])
|
|
|
+const model = reactive<any>({
|
|
|
+ // markingGroupNumber: dataModel.group,
|
|
|
+ // questionMainNumber: dataModel.question,
|
|
|
+ subjectCode: dataModel.subject || '',
|
|
|
+})
|
|
|
+watch(dataModel, () => {
|
|
|
+ model.subjectCode = dataModel.subject || ''
|
|
|
+ // model.questionMainNumber = dataModel.question
|
|
|
+ // model.markingGroupNumber = dataModel.group
|
|
|
+})
|
|
|
+
|
|
|
+const { defineColumn, _ } = useForm()
|
|
|
+
|
|
|
+const OneRow = defineColumn(_, 'row-1', { span: 6 })
|
|
|
+const btnRow = defineColumn(_, 'row-1', { span: 2 })
|
|
|
+
|
|
|
+const items = computed<any>(() => [
|
|
|
+ OneRow({
|
|
|
+ label: '科目',
|
|
|
+ prop: 'subjectCode',
|
|
|
+ slotType: 'select',
|
|
|
+ labelWidth: '46px',
|
|
|
+ slot: { options: subjectList.value, onChange: changeModelValue('subject'), disabled: !isExpert.value },
|
|
|
+ }),
|
|
|
+ // OneRow({
|
|
|
+ // label: '大题',
|
|
|
+ // prop: 'questionMainNumber',
|
|
|
+ // slotType: 'select',
|
|
|
+ // labelWidth: '60px',
|
|
|
+ // slot: {
|
|
|
+ // options: mainQuestionList.value,
|
|
|
+ // onChange: changeModelValue('question'),
|
|
|
+ // disabled: !isExpert.value && !isLeader.value,
|
|
|
+ // },
|
|
|
+ // }),
|
|
|
+
|
|
|
+ btnRow({
|
|
|
+ slotName: 'button',
|
|
|
+ labelWidth: '20px',
|
|
|
+ }),
|
|
|
+])
|
|
|
|
|
|
const mainStore = useMainStore()
|
|
|
|
|
|
const { fetch: subjectProgressEnd, result: subjectProgressEndList, loading } = useFetch('subjectProgressEnd')
|
|
|
|
|
|
-subjectProgressEnd({ subjectCode: mainStore.myUserInfo?.subjectCode || '' })
|
|
|
-
|
|
|
+// subjectProgressEnd({ subjectCode: mainStore.myUserInfo?.subjectCode || '' })
|
|
|
+const onSearch = () => {
|
|
|
+ subjectProgressEnd({ subjectCode: model.subjectCode })
|
|
|
+}
|
|
|
+onOptionInit(onSearch)
|
|
|
const getMainName = (row?: SubjectProgress) => {
|
|
|
const { questionMainName: name, questionMainNumber: number } = row || {}
|
|
|
return [number, name].filter(Boolean).join('-')
|