|
@@ -33,7 +33,7 @@
|
|
|
<el-upload
|
|
|
ref="uploadRef"
|
|
|
v-model:file-list="fileList"
|
|
|
- :action="importUrl + '?updateSupport=' + updateSupport + '&groupName=' + formData.groupName + '&groupDescription=' + formData.groupDescription + '&groupDate=' + formData.groupDate"
|
|
|
+ :action="importUrl + '?updateSupport=' + updateSupport + '&groupName=' + formData.groupName + '&groupDescription=' + formData.groupDescription"
|
|
|
:auto-upload="false"
|
|
|
:disabled="formLoading"
|
|
|
:headers="uploadHeaders"
|
|
@@ -68,6 +68,7 @@
|
|
|
<script lang="ts" setup>
|
|
|
import { useUpload } from "@/components/UploadFile/src/useUpload";
|
|
|
import { getAccessToken } from "@/utils/auth";
|
|
|
+import {ref, reactive, defineExpose, defineEmits} from 'vue'
|
|
|
const importUrl =
|
|
|
import.meta.env.VITE_BASE_URL + import.meta.env.VITE_API_URL + '/photosmanage/photo-group/import-package'
|
|
|
defineOptions({ name: 'imageImportForm' })
|
|
@@ -84,7 +85,6 @@ const formData = ref({
|
|
|
groupName: undefined,
|
|
|
groupDate: undefined,
|
|
|
groupDescription: undefined,
|
|
|
-
|
|
|
uploadPhotos: undefined
|
|
|
})
|
|
|
const formRules = reactive({
|
|
@@ -103,7 +103,7 @@ defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
|
|
//const { httpRequest } = useUpload()
|
|
|
|
|
|
/** 图片上传成功 */
|
|
|
-
|
|
|
+const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
|
|
const submitFormSuccess = (response: any) => {
|
|
|
console.log('tj',response)
|
|
|
if (response.code !== 0) {
|
|
@@ -114,7 +114,7 @@ const submitFormSuccess = (response: any) => {
|
|
|
formLoading.value = false
|
|
|
dialogVisible.value = false
|
|
|
// 发送操作成功的事件
|
|
|
-
|
|
|
+ emit('success')
|
|
|
}
|
|
|
|
|
|
/** 上传错误提示 */
|
|
@@ -125,6 +125,7 @@ const submitFormError = (): void => {
|
|
|
const uploadHeaders = ref() // 上传 Header 头
|
|
|
|
|
|
/** 提交表单 */
|
|
|
+
|
|
|
const submitForm = async () => {
|
|
|
if (fileList.value.length == 0) {
|
|
|
message.error('请上传文件')
|
|
@@ -135,6 +136,8 @@ const submitForm = async () => {
|
|
|
}
|
|
|
formLoading.value = true
|
|
|
uploadRef.value!.submit()
|
|
|
+ // 发送操作成功的事件
|
|
|
+ emit('success')
|
|
|
}
|
|
|
|
|
|
/** 重置表单 */
|