| | |
| | | :auto-upload="false" |
| | | ref="uploadRef" |
| | | @change="onChange" |
| | | :show-retry-button="false" |
| | | multiple |
| | | :limit="1" |
| | | /> |
| | |
| | | style=" |
| | | width: 100%; |
| | | margin-top: 10px; |
| | | display: flex; |
| | | justify-content: space-between; |
| | | text-align: right; |
| | | " |
| | | class="upload-wrap" |
| | | > |
| | | <div> |
| | | <span>解析方法: </span> |
| | | <a-radio-group |
| | | v-model="parser_id" |
| | | style="width: 400px" |
| | | @change="parserChange" |
| | | > |
| | | <a-popover v-for="item in filterData" :key="item.value"> |
| | | <a-radio :value="item.value" style="margin-right: 10px">{{ |
| | | item.name |
| | | }}</a-radio> |
| | | |
| | | <template #content> |
| | | <p>{{ item.parser_config_str }}</p> |
| | | </template> |
| | | </a-popover> |
| | | </a-radio-group> |
| | | </div> |
| | | <a-select |
| | | :style="{ width: '100px', margin: '0 10px' }" |
| | | :default-value="['通用', '多模态']" |
| | | v-model="parser_configs" |
| | | multiple |
| | | size="small" |
| | | > |
| | | <a-option v-for="item in parser_ids" :key="item.value">{{ |
| | | item.name |
| | | }}</a-option> |
| | | </a-select> |
| | | <p class="config-text">更多配置</p> |
| | | <a-button |
| | | :loading="onFileSelectedLoading" |
| | | @click="upDataFile" |
| | | type="primary" |
| | | size="mini" |
| | | style="border-radius: 24px" |
| | | style="border-radius: 24px;" |
| | | > |
| | | <span style="font-size: 12px"> 上传 </span> |
| | | </a-button> |
| | |
| | | getParseMethodsListApi, |
| | | getSessionDetailsApi, |
| | | uploadWithoutKb, |
| | | uploadAndParse, |
| | | } from '@/api/session'; |
| | | uploadAndParse, upload_and_parse, getDocumentStatus |
| | | } from "@/api/session"; |
| | | |
| | | const visible = ref(false); |
| | | const loading = ref(false); |
| | |
| | | ]); |
| | | const parser_idsArr = ref([]); |
| | | const uploadList = ref([]); |
| | | const props = defineProps(['sessionId']); |
| | | const props = defineProps(['sessionId','hide']); |
| | | const emit = defineEmits(['selectFileCallback']); |
| | | const uploadRef = ref(); |
| | | const files = ref([]); |
| | |
| | | }); |
| | | return type; |
| | | }; |
| | | |
| | | let status_timer; |
| | | const upDataFile = async () => { |
| | | if (!activeSessionId.value) { |
| | | //新建会话 |
| | |
| | | } |
| | | } |
| | | console.log(formData, 'formData'); |
| | | // uploadAndParse(formData).then((res) => { |
| | | // debugger; |
| | | // onFileSelectedLoading.value = false; |
| | | // if (res.code == 200) { |
| | | // cancel(); |
| | | // // uploaditemList.value = []; |
| | | // emit('selectFileCallback', uploaditemList.value); |
| | | // Message.success('上传成功'); |
| | | // } else { |
| | | // Message.error('上传失败'); |
| | | // } |
| | | // }); |
| | | uploadWithoutKb(formData).then((res) => { |
| | | upload_and_parse(formData).then((res) => { |
| | | onFileSelectedLoading.value = false; |
| | | if (res.code == 200) { |
| | | if (res.code == 0) { |
| | | //上传成功 |
| | | Message.success("上传成功"); |
| | | cancel(); |
| | | // uploaditemList.value = []; |
| | | emit('selectFileCallback', uploaditemList.value); |
| | | Message.success('上传成功'); |
| | | emit("selectFileCallback", uploaditemList.value,activeSessionId.value); |
| | | } else { |
| | | Message.error('上传失败'); |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | |
| | | const checkStatus = async (doc_ids) => { |
| | | let res = await getDocumentStatus(doc_ids); |
| | | if (res.code == 200 && res.data.status == "success") { |
| | | //上传成功 |
| | | Message.success("上传成功"); |
| | | cancel(); |
| | | emit("selectFileCallback", uploaditemList.value); |
| | | if (status_timer) { |
| | | clearTimeout(status_timer!); |
| | | } |
| | | } |
| | | }; |
| | | |
| | | const cancel = () => { |
| | |
| | | }); |
| | | onMounted(() => {}); |
| | | |
| | | //监控多个属性变化 |
| | | watch( |
| | | () => props.sessionId, |
| | | (value, oldValue) => { |
| | | activeSessionId.value = value; |
| | | () => [props.sessionId, props.hide], |
| | | ([in_sessionId, in_hide]) => { |
| | | if (visible.value != in_hide) { |
| | | visible.value = false; |
| | | } |
| | | if (activeSessionId.value != in_sessionId) { |
| | | activeSessionId.value = in_sessionId; |
| | | } |
| | | } |
| | | ); |
| | | |
| | | |
| | | </script> |
| | | <style> |
| | | .upload-wrap .arco-select-view-inner { |