|
@@ -5,7 +5,7 @@
|
|
|
:title="t('routes.archive.patchArchiveE57')"
|
|
:title="t('routes.archive.patchArchiveE57')"
|
|
|
:showCancelBtn="false"
|
|
:showCancelBtn="false"
|
|
|
:centered="true"
|
|
:centered="true"
|
|
|
- :okText="t('common.okText')"
|
|
|
|
|
|
|
+ :okText="loading ? `${t('component.upload.uploading')} ${complete}%` : t('common.okText')"
|
|
|
:confirmLoading="loading"
|
|
:confirmLoading="loading"
|
|
|
@ok="handleSubmit"
|
|
@ok="handleSubmit"
|
|
|
@cancel="handleCancel"
|
|
@cancel="handleCancel"
|
|
@@ -85,7 +85,7 @@
|
|
|
setup(_, { emit }) {
|
|
setup(_, { emit }) {
|
|
|
const { t } = useI18n();
|
|
const { t } = useI18n();
|
|
|
const { createMessage } = useMessage();
|
|
const { createMessage } = useMessage();
|
|
|
-
|
|
|
|
|
|
|
+ const complete = ref(0);
|
|
|
const downloadInfo = reactive<Recordable>({});
|
|
const downloadInfo = reactive<Recordable>({});
|
|
|
|
|
|
|
|
const [registerForm] = useForm({
|
|
const [registerForm] = useForm({
|
|
@@ -106,6 +106,10 @@
|
|
|
|
|
|
|
|
function onDataReceive() {}
|
|
function onDataReceive() {}
|
|
|
|
|
|
|
|
|
|
+ function onUploadProgress(progressEvent: ProgressEvent) {
|
|
|
|
|
+ const completes = ((progressEvent.loaded / progressEvent.total) * 100) | 0;
|
|
|
|
|
+ complete.value = completes;
|
|
|
|
|
+ }
|
|
|
const handleSubmit = async () => {
|
|
const handleSubmit = async () => {
|
|
|
if (!fileList.value?.length)
|
|
if (!fileList.value?.length)
|
|
|
return createMessage.error(t('layout.e57.e57upload') + t('layout.e57.e57name'));
|
|
return createMessage.error(t('layout.e57.e57upload') + t('layout.e57.e57name'));
|
|
@@ -121,6 +125,7 @@
|
|
|
isObj: Number(isObjCheck.value),
|
|
isObj: Number(isObjCheck.value),
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
|
|
|
+ onUploadProgress,
|
|
|
);
|
|
);
|
|
|
loading.value = false;
|
|
loading.value = false;
|
|
|
closeModal();
|
|
closeModal();
|
|
@@ -167,6 +172,7 @@
|
|
|
fileList,
|
|
fileList,
|
|
|
handleRemove,
|
|
handleRemove,
|
|
|
loading,
|
|
loading,
|
|
|
|
|
+ complete,
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
});
|
|
});
|