update registration event editor

This commit is contained in:
Timi
2026-08-02 00:20:13 +08:00
parent 11c48bf00c
commit 35dff786b1
10 changed files with 376 additions and 215 deletions
+15 -8
View File
@@ -46,6 +46,7 @@
<photo-field
v-model="formModel.photoURL"
alt-text="客户照片"
:loading="photoUploading"
:preview="false"
@add="selectPhoto"
@clear="resetPhotoState"
@@ -177,6 +178,7 @@ const selectorVisible = ref(false);
const referrerCustomerId = ref("");
const photoInputRef = ref<HTMLInputElement>();
const photoTempFileId = ref("");
const photoUploading = ref(false);
const scannerVisible = ref(false);
const scannerTarget = ref<ScanTarget>("code");
const scanStatus = ref("点击扫码开始识别。");
@@ -321,15 +323,20 @@ async function handlePhotoSelected(event: Event): Promise<void> {
if (!file) {
return;
}
const compressedFile = await compressUploadImage(file);
const [tempFile] = await AttachmentAPI.uploadTemp(compressedFile);
if (!tempFile?.id) {
showToast("客户照片上传失败", "warning");
return;
photoUploading.value = true;
try {
const compressedFile = await compressUploadImage(file);
const [tempFile] = await AttachmentAPI.uploadTemp(compressedFile);
if (!tempFile?.id) {
showToast("客户照片上传失败", "warning");
return;
}
photoTempFileId.value = tempFile.id;
formModel.photoURL = AttachmentAPI.getTempReadURL(tempFile.id);
} finally {
photoUploading.value = false;
input.value = "";
}
photoTempFileId.value = tempFile.id;
formModel.photoURL = AttachmentAPI.getTempReadURL(tempFile.id);
input.value = "";
}
// ---------- 介绍人 ----------