|
@@ -18,12 +18,12 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="p-base radius-base fill-blank scroll-auto m-l-base problem-list">
|
|
|
- <base-form size="small" :model="formModel" :items="formItems" :label-width="useVW(40)">
|
|
|
+ <base-form size="small" :model="formModel" :items="formItems" :label-width="useVW(60)">
|
|
|
<template #form-item-search>
|
|
|
<el-button type="primary" @click="onSearch">查询</el-button>
|
|
|
</template>
|
|
|
</base-form>
|
|
|
- <div class="flex items-center p-l-base">
|
|
|
+ <div class="flex items-center">
|
|
|
<span>考核卷</span>
|
|
|
<span>: 共{{ tableData.length }}</span>
|
|
|
</div>
|
|
@@ -38,43 +38,15 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <base-dialog
|
|
|
- v-model="previewModalVisible"
|
|
|
- title="试卷预览"
|
|
|
- :footer="false"
|
|
|
- :modal="false"
|
|
|
- draggable
|
|
|
- class="preview-dialog"
|
|
|
- >
|
|
|
- <div class="preview-content">
|
|
|
- <img :src="MockImg" alt="" />
|
|
|
- </div>
|
|
|
- </base-dialog>
|
|
|
- <base-dialog v-model="submitModalVisible" unless :width="useVW(260)" center>
|
|
|
- <div class="text-center">{{ currentRfPaper?.mainNumber }} {{ currentRfPaper?.mainName }}</div>
|
|
|
- <div class="fill-lighter p-t-base text-center">
|
|
|
- <div class="total-score-title">— 总分 —</div>
|
|
|
- <div class="m-t-extra-small">
|
|
|
- <span class="score-value">{{ totalScore || 15 }}</span>
|
|
|
- <span class="score-unit">分</span>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="text-center m-t-base confirm-text">确认提交?</div>
|
|
|
- <template #footer>
|
|
|
- <div class="flex items-center justify-between">
|
|
|
- <el-button class="confirm-button" type="primary" @click="onConfirmEditScore">是(Y)</el-button>
|
|
|
- <el-button class="confirm-button" plain @click="onCancelSubmit">否(N)</el-button>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </base-dialog>
|
|
|
- <scoring-panel
|
|
|
+ <image-preview v-model="previewModalVisible" :url="MockImg"></image-preview>
|
|
|
+ <scoring-panel-with-confirm
|
|
|
v-model:visible="editScoreVisible"
|
|
|
v-model:score="modelScore"
|
|
|
modal
|
|
|
:toggle-modal="false"
|
|
|
- :task="mockTask"
|
|
|
+ :main-number="mockTask.mainNumber"
|
|
|
@submit="onSubmit"
|
|
|
- ></scoring-panel>
|
|
|
+ ></scoring-panel-with-confirm>
|
|
|
<mark-history-list :id="currentViewHistory?.secretNumber" v-model="visibleHistory" type="secret"></mark-history-list>
|
|
|
</template>
|
|
|
|
|
@@ -82,7 +54,6 @@
|
|
|
/** 专家卷浏览-专家挑选卷 */
|
|
|
import { reactive, ref, computed, watch, nextTick } from 'vue'
|
|
|
import { ElButton } from 'element-plus'
|
|
|
-import { add } from '@/utils/common'
|
|
|
import { ROLE_OPTION } from '@/constants/dicts'
|
|
|
import { useSetImgBg } from '@/hooks/useSetImgBg'
|
|
|
import useFetch from '@/hooks/useFetch'
|
|
@@ -91,14 +62,15 @@ import useForm from '@/hooks/useForm'
|
|
|
import useOptions from '@/hooks/useOptions'
|
|
|
import useMarkHeader from '@/hooks/useMarkHeader'
|
|
|
import useMainStore from '@/store/main'
|
|
|
+import useTableCheck from '@/hooks/useTableCheck'
|
|
|
import MarkHeader from '@/components/shared/MarkHeader.vue'
|
|
|
import BaseForm from '@/components/element/BaseForm.vue'
|
|
|
import BaseTable from '@/components/element/BaseTable.vue'
|
|
|
import MarkHistoryList from '@/components/shared/MarkHistoryList.vue'
|
|
|
import RightButton from '@/components/shared/RightButton.vue'
|
|
|
-import BaseDialog from '@/components/element/BaseDialog.vue'
|
|
|
import SvgIcon from '@/components/common/SvgIcon.vue'
|
|
|
-import ScoringPanel from '@/components/shared/ScoringPanel.vue'
|
|
|
+import ScoringPanelWithConfirm from '@/components/shared/ScoringPanelWithConfirm.vue'
|
|
|
+import ImagePreview from '@/components/shared/ImagePreview.vue'
|
|
|
|
|
|
import MockImg from '@/assets/mock/SAMPA-1.jpg'
|
|
|
import type { SetImgBgOption } from '@/hooks/useSetImgBg'
|
|
@@ -110,38 +82,13 @@ type RowType = ExtractMultipleApiResponse<'getExpertPickList'> & { index: number
|
|
|
/** 给分板 */
|
|
|
const editScoreVisible = ref<boolean>(false)
|
|
|
|
|
|
-/** 提交确认 */
|
|
|
-const submitModalVisible = ref<boolean>(false)
|
|
|
-
|
|
|
/** 图片预览 */
|
|
|
const previewModalVisible = ref<boolean>(false)
|
|
|
|
|
|
const modelScore = ref<number[]>([])
|
|
|
|
|
|
-const totalScore = computed(() => {
|
|
|
- return add(...modelScore.value)
|
|
|
-})
|
|
|
-
|
|
|
-const mockTask = ref<ExtractApiResponse<'getMarkingTask'>>({
|
|
|
+const mockTask = ref<{ mainNumber: number }>({
|
|
|
mainNumber: 1,
|
|
|
- secretNumber: 'xxx',
|
|
|
- mainTitle: '第一大题',
|
|
|
- questionList: [
|
|
|
- {
|
|
|
- intervalScore: 0.5,
|
|
|
- subNumber: '1',
|
|
|
- totalScore: 8,
|
|
|
- },
|
|
|
- {
|
|
|
- intervalScore: 1,
|
|
|
- subNumber: '2',
|
|
|
- totalScore: 20,
|
|
|
- },
|
|
|
- ],
|
|
|
- subjectCode: 'C0001',
|
|
|
- taskId: 1,
|
|
|
- taskType: 'FORMAL',
|
|
|
- url: '',
|
|
|
})
|
|
|
|
|
|
const {
|
|
@@ -171,18 +118,6 @@ const imgOption = computed<SetImgBgOption>(() => {
|
|
|
|
|
|
const { drawing, dataUrl } = useSetImgBg(imgOption)
|
|
|
|
|
|
-/** 提交 */
|
|
|
-const onSubmit = () => {
|
|
|
- editScoreVisible.value = false
|
|
|
- submitModalVisible.value = true
|
|
|
-}
|
|
|
-
|
|
|
-/** 取消提交 */
|
|
|
-const onCancelSubmit = () => {
|
|
|
- editScoreVisible.value = true
|
|
|
- submitModalVisible.value = false
|
|
|
-}
|
|
|
-
|
|
|
/** 刷新 */
|
|
|
const onRefresh = () => {
|
|
|
onSearch()
|
|
@@ -190,7 +125,9 @@ const onRefresh = () => {
|
|
|
|
|
|
/** 删除 */
|
|
|
const onDelete = () => {
|
|
|
- console.log('删除')
|
|
|
+ if (currentExpertPaper.value) {
|
|
|
+ useFetch('deletePaper').fetch({ id: currentExpertPaper.value.id })
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/** 预览试卷 */
|
|
@@ -232,6 +169,15 @@ const formModel = reactive<ExtractApiParams<'getExpertPickList'>>({
|
|
|
pageSize: 9999999,
|
|
|
})
|
|
|
|
|
|
+watch(
|
|
|
+ () => formModel.paperType,
|
|
|
+ () => {
|
|
|
+ if (formModel.paperType !== 'FORCE') {
|
|
|
+ formModel.forceGroupNumber = void 0
|
|
|
+ }
|
|
|
+ }
|
|
|
+)
|
|
|
+
|
|
|
const mainStore = useMainStore()
|
|
|
|
|
|
const { mainQuestionList, dataModel, changeModelValue, onOptionInit } = useOptions(['question'], {
|
|
@@ -254,79 +200,82 @@ const { defineColumn, _ } = useForm()
|
|
|
|
|
|
const span10 = defineColumn(_, '', { span: 10 })
|
|
|
|
|
|
-const formItems = computed<EpFormItem[]>(() => [
|
|
|
- span10({
|
|
|
- rowKey: 'row-1',
|
|
|
- label: '大题',
|
|
|
- prop: 'mainNumber',
|
|
|
- slotType: 'select',
|
|
|
- slot: { options: mainQuestionList.value, onChange: changeModelValue('question') },
|
|
|
- }),
|
|
|
- span10({
|
|
|
- rowKey: 'row-1',
|
|
|
- label: '角色',
|
|
|
- prop: 'role',
|
|
|
- slotType: 'select',
|
|
|
- slot: { options: ROLE_OPTION },
|
|
|
- }),
|
|
|
- { rowKey: 'row-1', slotName: 'search', labelWidth: '10px', colProp: { span: 4 } },
|
|
|
- span10({
|
|
|
- rowKey: 'row-2',
|
|
|
- label: '组号',
|
|
|
- prop: 'forceGroupNumber',
|
|
|
- slotType: 'select',
|
|
|
- slot: {
|
|
|
- options: forceCheckGroup.value.map((d) => ({ value: d.forceGroupNumber, label: `第${d.forceGroupNumber}组` })),
|
|
|
- onChange: changeModelValue('question'),
|
|
|
- },
|
|
|
- }),
|
|
|
-])
|
|
|
-
|
|
|
-/** 强制考核卷 */
|
|
|
-const { fetch: getExpertPickList, result: rfSampleList } = useFetch('getExpertPickList')
|
|
|
-
|
|
|
-const tableRef = ref<InstanceType<typeof BaseTable>>()
|
|
|
+const formItems = computed<EpFormItem[]>(() => {
|
|
|
+ const items = [
|
|
|
+ span10({
|
|
|
+ rowKey: 'row-1',
|
|
|
+ label: '大题',
|
|
|
+ prop: 'mainNumber',
|
|
|
+ slotType: 'select',
|
|
|
+ slot: { options: mainQuestionList.value, onChange: changeModelValue('question') },
|
|
|
+ }),
|
|
|
+ span10({
|
|
|
+ rowKey: 'row-1',
|
|
|
+ label: '角色',
|
|
|
+ prop: 'role',
|
|
|
+ slotType: 'select',
|
|
|
+ slot: { options: ROLE_OPTION },
|
|
|
+ }),
|
|
|
+ { rowKey: 'row-1', slotName: 'search', labelWidth: '10px', colProp: { span: 4 } },
|
|
|
+ span10({
|
|
|
+ rowKey: 'row-2',
|
|
|
+ label: '试卷类型',
|
|
|
+ prop: 'paperType',
|
|
|
+ slotType: 'select',
|
|
|
+ slot: {
|
|
|
+ options: [
|
|
|
+ { label: 'RF卷', value: 'RF' },
|
|
|
+ { label: '强制考核卷', value: 'FORCE' },
|
|
|
+ { label: 'SAMPLE_A', value: 'SAMPLE_A' },
|
|
|
+ { label: 'SAMPLE_B', value: 'SAMPLE_B' },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ }),
|
|
|
+ ]
|
|
|
+
|
|
|
+ if (formModel.paperType === 'FORCE') {
|
|
|
+ items.push(
|
|
|
+ span10({
|
|
|
+ rowKey: 'row-2',
|
|
|
+ label: '组号',
|
|
|
+ prop: 'forceGroupNumber',
|
|
|
+ slotType: 'select',
|
|
|
+ slot: {
|
|
|
+ options: forceCheckGroup.value.map((d) => ({
|
|
|
+ value: d.forceGroupNumber,
|
|
|
+ label: `第${d.forceGroupNumber}组`,
|
|
|
+ })),
|
|
|
+ onChange: changeModelValue('question'),
|
|
|
+ },
|
|
|
+ })
|
|
|
+ )
|
|
|
+ }
|
|
|
+ return items
|
|
|
+})
|
|
|
+
|
|
|
+/** 专家挑选卷 */
|
|
|
|
|
|
const columns: EpTableColumn<RowType>[] = [
|
|
|
{ label: '序号', type: 'index' },
|
|
|
{ label: '密号', prop: 'secretNumber' },
|
|
|
- { label: '分数', prop: 'score' },
|
|
|
- { label: '档次', prop: 'scoreLevel' },
|
|
|
+ { label: '标准分', prop: 'score' },
|
|
|
{ label: '提交人', prop: 'createName' },
|
|
|
+ { label: '角色', prop: 'roleName' },
|
|
|
{ label: '提交时间', prop: 'createTime' },
|
|
|
]
|
|
|
|
|
|
-const tableData = computed<RowType[]>(() => {
|
|
|
- return rfSampleList?.value?.result?.map((d, index) => ({ ...d, index })) || []
|
|
|
-})
|
|
|
-
|
|
|
-const currentRfPaper = ref<RowType>()
|
|
|
-
|
|
|
-watch(tableData, () => {
|
|
|
- nextTick(() => {
|
|
|
- tableRef?.value?.tableRef?.setCurrentRow(tableData.value[0])
|
|
|
- })
|
|
|
-})
|
|
|
-
|
|
|
-const checkNext = () => {
|
|
|
- tableRef?.value?.tableRef?.setCurrentRow(
|
|
|
- tableData.value[((currentRfPaper.value?.index || 0) + 1) % tableData.value.length]
|
|
|
- )
|
|
|
-}
|
|
|
-
|
|
|
-const visibleHistory = ref<boolean>(false)
|
|
|
-const currentViewHistory = ref<RowType>()
|
|
|
+const { fetch: getExpertPickList, result: expertPaperList } = useFetch('getExpertPickList')
|
|
|
|
|
|
-/** 表格行双击 */
|
|
|
-const onDbClick = (row: RowType) => {
|
|
|
- currentViewHistory.value = row
|
|
|
- visibleHistory.value = true
|
|
|
-}
|
|
|
-
|
|
|
-/** 表格选中 */
|
|
|
-const onCurrentChange = (row: RowType) => {
|
|
|
- currentRfPaper.value = row
|
|
|
-}
|
|
|
+const {
|
|
|
+ tableRef,
|
|
|
+ tableData,
|
|
|
+ current: currentExpertPaper,
|
|
|
+ currentView: currentViewHistory,
|
|
|
+ next: checkNext,
|
|
|
+ visibleHistory,
|
|
|
+ onDbClick,
|
|
|
+ onCurrentChange,
|
|
|
+} = useTableCheck(expertPaperList)
|
|
|
|
|
|
const onSearch = async () => {
|
|
|
getExpertPickList(formModel)
|
|
@@ -336,9 +285,9 @@ const onSearch = async () => {
|
|
|
|
|
|
const { fetch: updateMarkScore } = useFetch('updateMarkScore')
|
|
|
|
|
|
-const onConfirmEditScore = () => {
|
|
|
- if (currentRfPaper.value) {
|
|
|
- updateMarkScore({ id: currentRfPaper.value.id, scores: modelScore.value })
|
|
|
+const onSubmit = () => {
|
|
|
+ if (currentExpertPaper.value) {
|
|
|
+ updateMarkScore({ id: currentExpertPaper.value.id, scores: modelScore.value })
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -371,17 +320,4 @@ onOptionInit(onSearch)
|
|
|
width: 580px;
|
|
|
}
|
|
|
}
|
|
|
-.preview-dialog {
|
|
|
- margin-left: 70%;
|
|
|
- .preview-content {
|
|
|
- width: 100%;
|
|
|
- max-width: 300px;
|
|
|
- max-height: 600px;
|
|
|
- img {
|
|
|
- width: 100%;
|
|
|
- height: 100%;
|
|
|
- object-fit: contain;
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
</style>
|