|
@@ -8,8 +8,8 @@
|
|
|
})"><SvgIcon name="czr_arrow" :rotate="180" size="12" :active="true"/>文档列表</div>
|
|
|
<div class="bm-main-box mt-[1.25rem]">
|
|
|
<div class="flex gap-[1rem]">
|
|
|
- <CzrButton :type="state.uploadType == UploadTypeEnum.Text ? 'primary' : 'normal'" title="文本文件" @click="state.uploadType = UploadTypeEnum.Text, state.step = 1"/>
|
|
|
- <CzrButton :type="state.uploadType == UploadTypeEnum.QA ? 'primary' : 'normal'" title="QA问答" @click="state.uploadType = UploadTypeEnum.QA, state.step = 1"/>
|
|
|
+ <CzrButton :type="state.uploadType == UploadTypeEnum.Text ? 'primary' : 'normal'" title="文本文件" @click="state.uploadType = UploadTypeEnum.Text, state.step = 1, state.uploadFiles.clear()"/>
|
|
|
+ <CzrButton :type="state.uploadType == UploadTypeEnum.QA ? 'primary' : 'normal'" title="QA问答" @click="state.uploadType = UploadTypeEnum.QA, state.step = 1, state.uploadFiles.clear()"/>
|
|
|
</div>
|
|
|
<div class="mt-[1.75rem] flex justify-center items-center gap-[1rem]">
|
|
|
<template v-for="(item, index) in (state.uploadType == UploadTypeEnum.Text ? TextSteps : QASteps)">
|
|
@@ -68,7 +68,7 @@
|
|
|
</template>
|
|
|
<template v-else>
|
|
|
<template v-if="file.success">
|
|
|
- <SvgIcon name="success" color="#1CC78D"/>
|
|
|
+ <SvgIcon name="success" color="var(--czr-success-color)"/>
|
|
|
</template>
|
|
|
<template v-else>
|
|
|
{{file.process}}%
|
|
@@ -84,6 +84,12 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
</div>
|
|
|
+ <div class="mt-[1rem] w-full flex justify-end" v-if="state.uploadFiles.size > 0">
|
|
|
+ <CzrButton type="primary" title="下一步" @click="onNextOne"></CzrButton>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <template v-if="state.uploadType === UploadTypeEnum.Text && state.step === 2">
|
|
|
+
|
|
|
</template>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -95,7 +101,9 @@ import {useRoute, useRouter} from "vue-router";
|
|
|
import {ElMessage} from "element-plus";
|
|
|
import {axUpload} from "@/api/modules/global/upload";
|
|
|
import {v4} from "uuid";
|
|
|
+import {useDialogStore} from "@/stores";
|
|
|
|
|
|
+const DialogStore = useDialogStore()
|
|
|
const route = useRoute();
|
|
|
const router = useRouter();
|
|
|
const emits = defineEmits([])
|
|
@@ -110,6 +118,7 @@ const state: any = reactive({
|
|
|
uploadType: UploadTypeEnum.Text,
|
|
|
step: 1,
|
|
|
uploadFiles: new Map(),
|
|
|
+ uploadFileList: []
|
|
|
})
|
|
|
const UploadConfig = {
|
|
|
limit: 2,
|
|
@@ -171,6 +180,27 @@ const handleHttpRequest = (options) => {
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
+const onNextOne = () => {
|
|
|
+ state.uploadFileList = Array.from(state.uploadFiles.values()).filter((v: any) => v.success)
|
|
|
+ if (state.uploadFileList.length === 0) {
|
|
|
+ DialogStore.confirm({
|
|
|
+ title: '上传确认',
|
|
|
+ content: '未发现上传成功的文件,请稍后!',
|
|
|
+ onSubmit: () => {}
|
|
|
+ })
|
|
|
+ } else if (state.uploadFileList.length !== state.uploadFiles.size) {
|
|
|
+ DialogStore.confirm({
|
|
|
+ width: '32rem',
|
|
|
+ title: '上传确认',
|
|
|
+ content: `仍有 <span style="color: var(--czr-error-color)">${state.uploadFiles.size - state.uploadFileList.length}</span> 个文件未上传成功,请确认是否跳转到下一步!`,
|
|
|
+ onSubmit: () => {
|
|
|
+ state.step = 2
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ state.step = 2
|
|
|
+ }
|
|
|
+}
|
|
|
onMounted(() => {
|
|
|
initDetail()
|
|
|
})
|