|
@@ -30,9 +30,9 @@
|
|
</el-upload>
|
|
</el-upload>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
- <template #form-item-progress>
|
|
|
|
|
|
+ <!-- <template #form-item-progress>
|
|
<el-progress v-show="showProgress" class="flex-1" :percentage="percentage" color="#00BA97" />
|
|
<el-progress v-show="showProgress" class="flex-1" :percentage="percentage" color="#00BA97" />
|
|
- </template>
|
|
|
|
|
|
+ </template> -->
|
|
<el-form-item class="m-t-base form-footer">
|
|
<el-form-item class="m-t-base form-footer">
|
|
<confirm-button
|
|
<confirm-button
|
|
ok-text="确定导入"
|
|
ok-text="确定导入"
|
|
@@ -51,7 +51,7 @@
|
|
<script setup lang="ts" name="DataMarking">
|
|
<script setup lang="ts" name="DataMarking">
|
|
/** 导入评卷数据 */
|
|
/** 导入评卷数据 */
|
|
import { computed, nextTick, reactive, ref, watch } from 'vue'
|
|
import { computed, nextTick, reactive, ref, watch } from 'vue'
|
|
-import { ElButton, ElInput, ElCard, ElFormItem, ElUpload, ElProgress } from 'element-plus'
|
|
|
|
|
|
+import { ElButton, ElInput, ElCard, ElFormItem, ElUpload, ElProgress, ElMessage } from 'element-plus'
|
|
import { useTimeoutFn } from '@vueuse/core'
|
|
import { useTimeoutFn } from '@vueuse/core'
|
|
import ConfirmButton from '@/components/common/ConfirmButton.vue'
|
|
import ConfirmButton from '@/components/common/ConfirmButton.vue'
|
|
import BaseForm from '@/components/element/BaseForm.vue'
|
|
import BaseForm from '@/components/element/BaseForm.vue'
|
|
@@ -64,19 +64,20 @@ import useVW from '@/hooks/useVW'
|
|
import type { FormGroup, EpFormItem, EpFormRules } from 'global-type'
|
|
import type { FormGroup, EpFormItem, EpFormRules } from 'global-type'
|
|
import type { ExtractApiParams } from '@/api/api'
|
|
import type { ExtractApiParams } from '@/api/api'
|
|
|
|
|
|
-const allowImport = ref<boolean>(false)
|
|
|
|
|
|
+// const allowImport = ref<boolean>(false)
|
|
|
|
+const allowImport = ref<boolean>(true)
|
|
|
|
|
|
-const { start, stop } = useTimeoutFn(checkImportStatus, 1000)
|
|
|
|
|
|
+// const { start, stop } = useTimeoutFn(checkImportStatus, 1000)
|
|
|
|
|
|
-const { fetch: getStudentImportStatus, result: importStatus } = useFetch('getStudentImportStatus')
|
|
|
|
|
|
+// const { fetch: getStudentImportStatus, result: importStatus } = useFetch('getStudentImportStatus')
|
|
|
|
|
|
-watch(importStatus, () => {
|
|
|
|
- allowImport.value = importStatus.value && !importStatus.value.importing
|
|
|
|
|
|
+// watch(importStatus, () => {
|
|
|
|
+// allowImport.value = importStatus.value && !importStatus.value.importing
|
|
|
|
|
|
- if (allowImport.value) {
|
|
|
|
- stop()
|
|
|
|
- }
|
|
|
|
-})
|
|
|
|
|
|
+// if (allowImport.value) {
|
|
|
|
+// stop()
|
|
|
|
+// }
|
|
|
|
+// })
|
|
|
|
|
|
const { subjectList, mainQuestionList, dataModel, changeModelValue } = useOptions(['subject', 'question'])
|
|
const { subjectList, mainQuestionList, dataModel, changeModelValue } = useOptions(['subject', 'question'])
|
|
|
|
|
|
@@ -84,14 +85,14 @@ const { fetch: getImportFilePath, result: filePath } = useFetch('getImportFilePa
|
|
|
|
|
|
const { fileList, upload, percentage, setPercentage, onExceed } = useUploadFile()
|
|
const { fileList, upload, percentage, setPercentage, onExceed } = useUploadFile()
|
|
|
|
|
|
-watch(
|
|
|
|
- () => importStatus.value?.progress,
|
|
|
|
- () => {
|
|
|
|
- if (importStatus.value?.progress) {
|
|
|
|
- setPercentage(importStatus.value.progress)
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-)
|
|
|
|
|
|
+// watch(
|
|
|
|
+// () => importStatus.value?.progress,
|
|
|
|
+// () => {
|
|
|
|
+// if (importStatus.value?.progress) {
|
|
|
|
+// setPercentage(importStatus.value.progress)
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+// )
|
|
|
|
|
|
const fileName = computed(() => fileList.value?.[0]?.name)
|
|
const fileName = computed(() => fileList.value?.[0]?.name)
|
|
|
|
|
|
@@ -215,13 +216,13 @@ const items = computed<EpFormItem[]>(() => {
|
|
})
|
|
})
|
|
|
|
|
|
function checkImportStatus() {
|
|
function checkImportStatus() {
|
|
- getStudentImportStatus().finally(() => {
|
|
|
|
- nextTick(() => {
|
|
|
|
- if (!allowImport.value) {
|
|
|
|
- start()
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- })
|
|
|
|
|
|
+ // getStudentImportStatus().finally(() => {
|
|
|
|
+ // nextTick(() => {
|
|
|
|
+ // if (!allowImport.value) {
|
|
|
|
+ // start()
|
|
|
|
+ // }
|
|
|
|
+ // })
|
|
|
|
+ // })
|
|
}
|
|
}
|
|
|
|
|
|
async function onSubmit() {
|
|
async function onSubmit() {
|
|
@@ -231,7 +232,8 @@ async function onSubmit() {
|
|
showProgress.value = true
|
|
showProgress.value = true
|
|
setPercentage(0)
|
|
setPercentage(0)
|
|
await importMarkingData(model)
|
|
await importMarkingData(model)
|
|
- checkImportStatus()
|
|
|
|
|
|
+ ElMessage.success(`导入成功,您可以稍后去“任务信息报告”页面进行查询`)
|
|
|
|
+ // checkImportStatus()
|
|
}
|
|
}
|
|
} catch (error) {
|
|
} catch (error) {
|
|
showProgress.value = false
|
|
showProgress.value = false
|
|
@@ -258,7 +260,7 @@ async function exportMarkTasks() {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-getStudentImportStatus()
|
|
|
|
|
|
+// getStudentImportStatus()
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss"></style>
|
|
<style scoped lang="scss"></style>
|