|
@@ -4,7 +4,8 @@ import { ref } from 'vue';
|
|
|
import request, { download } from '~/utils/request';
|
|
|
|
|
|
|
|
|
-const props = defineProps<{ url: string }>()
|
|
|
+const props = defineProps<{ url: string, importKey: string }>()
|
|
|
+console.log(props)
|
|
|
const emits = defineEmits(["success"])
|
|
|
const loading = ref(false)
|
|
|
const percentage = ref(0)
|
|
@@ -13,7 +14,7 @@ const handleTableRowBtns_import = ({ file }: { file: File }) => {
|
|
|
loading.value = true
|
|
|
return request({
|
|
|
$type: 'import',
|
|
|
- url: `${props.url}/import`,
|
|
|
+ url: props.importKey ? `${props.url}/import?${props.importKey}` : `${props.url}/import`,
|
|
|
data: { file },
|
|
|
onUploadProgress(progressEvent: { loaded: number, total: number }) {
|
|
|
percentage.value = ~~(progressEvent.loaded / progressEvent.total * 100 | 0)
|