|
@@ -10,6 +10,11 @@
|
|
|
:items="items"
|
|
|
:rules="rules"
|
|
|
>
|
|
|
+ <template #form-item-address>
|
|
|
+ <span class="flex items-center">
|
|
|
+ {{ filePath }}
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
<template #form-item-import>
|
|
|
<div class="flex items-center">
|
|
|
<el-input v-model="fileName" disabled placeholder="导入文件"></el-input>
|
|
@@ -56,6 +61,8 @@ import useVW from '@/hooks/useVW'
|
|
|
import type { FormGroup, EpFormItem, EpFormRules } from 'global-type'
|
|
|
import type { ExtractApiParams } from 'api-type'
|
|
|
|
|
|
+const { fetch: getImportFilePath, result: filePath } = useFetch('getImportFilePath')
|
|
|
+
|
|
|
const { fileList, upload, percentage, setPercentage, onExceed, onUploadProgress } = useUploadFile()
|
|
|
|
|
|
const fileName = computed(() => fileList.value?.[0]?.name)
|
|
@@ -76,6 +83,17 @@ const model = reactive<ExtractApiParams<'importMarkingData'>>({
|
|
|
subjectCode: '',
|
|
|
})
|
|
|
|
|
|
+watch([() => model.subjectCode, () => model.mainNumber], () => {
|
|
|
+ /** 获取导入文件路径 */
|
|
|
+ model.subjectCode &&
|
|
|
+ model.mainNumber &&
|
|
|
+ getImportFilePath({
|
|
|
+ filePathType: 'SLICE',
|
|
|
+ subjectCode: model.subjectCode,
|
|
|
+ mainNumber: model.mainNumber,
|
|
|
+ })
|
|
|
+})
|
|
|
+
|
|
|
watch(
|
|
|
fileList,
|
|
|
() => {
|
|
@@ -94,8 +112,8 @@ const rules: EpFormRules = {
|
|
|
|
|
|
const groups: FormGroup[] = [
|
|
|
{ groupTitle: '选择大题', rowKeys: ['row-1'] },
|
|
|
- { groupTitle: '任务设置', rowKeys: ['row-2', 'row-3'] },
|
|
|
- { groupTitle: '选择文件', rowKeys: ['row-4'] },
|
|
|
+ { groupTitle: '任务设置', rowKeys: ['row-2', 'row-3', 'row-4'] },
|
|
|
+ { groupTitle: '选择文件', rowKeys: ['row-5'] },
|
|
|
]
|
|
|
|
|
|
const span6 = defineColumn(_, '', { span: 6 })
|
|
@@ -133,12 +151,18 @@ const items = computed<EpFormItem[]>(() => {
|
|
|
}),
|
|
|
span6({
|
|
|
rowKey: 'row-4',
|
|
|
+ label: '图片路径',
|
|
|
+ slotName: 'address',
|
|
|
+ itemDescription: { description: '试卷图片请按路径存放' },
|
|
|
+ }),
|
|
|
+ span6({
|
|
|
+ rowKey: 'row-5',
|
|
|
label: '导入文件',
|
|
|
prop: 'file',
|
|
|
slotName: 'import',
|
|
|
}),
|
|
|
span6({
|
|
|
- rowKey: 'row-5',
|
|
|
+ rowKey: 'row-6',
|
|
|
slotName: 'progress',
|
|
|
}),
|
|
|
]
|