update AIChart, customer followup, media selector
This commit is contained in:
@@ -71,7 +71,7 @@
|
||||
</t-form-item>
|
||||
<t-form-item label-width="0">
|
||||
<div class="photo">
|
||||
<photo-scroller
|
||||
<media-selector
|
||||
v-model="photoList"
|
||||
v-model:photo-items="photoItemList"
|
||||
:edit-mode="true"
|
||||
@@ -80,8 +80,10 @@
|
||||
:show-viewer-actions="!isCustomerBound"
|
||||
:add-actions="photoAddActions"
|
||||
:loading="isPhotoUploading"
|
||||
@add-photo="openPhotoPicker('PHOTO')"
|
||||
@add-point-card="openPhotoPicker('POINT_CARD')"
|
||||
@add="openPhotoPicker('OTHER')"
|
||||
@capture-photo="capturePhoto"
|
||||
@capture-video="captureVideo"
|
||||
@add-point-card="capturePointCard"
|
||||
@add-other="openPhotoPicker('OTHER')"
|
||||
/>
|
||||
<div class="tips orange" v-if="!hasCustomerDeletePermission">当前账户权限编辑客户需要上传照片和积分卡</div>
|
||||
@@ -176,7 +178,23 @@
|
||||
ref="photoInputRef"
|
||||
class="file-input"
|
||||
type="file"
|
||||
accept="*/*"
|
||||
@change="handlePhotoSelected"
|
||||
>
|
||||
<input
|
||||
ref="photoCameraInputRef"
|
||||
class="file-input"
|
||||
type="file"
|
||||
accept="image/*"
|
||||
capture="environment"
|
||||
@change="handlePhotoSelected"
|
||||
>
|
||||
<input
|
||||
ref="videoInputRef"
|
||||
class="file-input"
|
||||
type="file"
|
||||
accept="video/*"
|
||||
capture="environment"
|
||||
@change="handlePhotoSelected"
|
||||
>
|
||||
<customer-selector
|
||||
@@ -213,7 +231,7 @@ import BodyAreaSelector from "@/components/BodyAreaSelector.vue";
|
||||
import CodeScanner from "@/components/CodeScanner.vue";
|
||||
import CustomerProfileCard from "@/components/CustomerProfileCard.vue";
|
||||
import CustomerSelector from "@/components/CustomerSelector.vue";
|
||||
import PhotoScroller from "@/components/PhotoScroller.vue";
|
||||
import MediaSelector from "@/components/mediaSelector/MediaSelector.vue";
|
||||
import TagSelector from "@/components/TagSelector.vue";
|
||||
import CustomerTagCard from "@/pages/customer/component/CustomerTagCard.vue";
|
||||
import { useCurrentStoreStore } from "@/store/currentStoreStore";
|
||||
@@ -442,6 +460,30 @@ function openPhotoPicker(target: CustomerAttachmentType): void {
|
||||
photoInputRef.value?.click();
|
||||
}
|
||||
|
||||
function capturePhoto(): void {
|
||||
if (isCustomerBound.value) {
|
||||
return;
|
||||
}
|
||||
photoPickerTarget.value = "PHOTO";
|
||||
photoCameraInputRef.value?.click();
|
||||
}
|
||||
|
||||
function capturePointCard(): void {
|
||||
if (isCustomerBound.value) {
|
||||
return;
|
||||
}
|
||||
photoPickerTarget.value = "POINT_CARD";
|
||||
photoCameraInputRef.value?.click();
|
||||
}
|
||||
|
||||
function captureVideo(): void {
|
||||
if (isCustomerBound.value) {
|
||||
return;
|
||||
}
|
||||
photoPickerTarget.value = "OTHER";
|
||||
videoInputRef.value?.click();
|
||||
}
|
||||
|
||||
watch(isCustomerBound, (value) => {
|
||||
navBarStore.setRightDisabled(value);
|
||||
if (!value) {
|
||||
@@ -485,6 +527,7 @@ async function loadDetail() {
|
||||
.map(item => ({
|
||||
attachment: item,
|
||||
attachType: normalizeAttachmentType(item.attachType),
|
||||
mimeType: item.mimeType,
|
||||
previewUrl: getAttachmentReadURL(item.id || ""),
|
||||
url: getAttachmentReadURL(item.id || "", 90)
|
||||
}));
|
||||
@@ -531,24 +574,14 @@ watch(() => formData.birthdate, (value) => {
|
||||
// ---------- 照片 ----------
|
||||
|
||||
const photoInputRef = ref<HTMLInputElement>();
|
||||
const photoCameraInputRef = ref<HTMLInputElement>();
|
||||
const videoInputRef = ref<HTMLInputElement>();
|
||||
const photoAddActions = [
|
||||
{
|
||||
icon: "user-avatar",
|
||||
text: "拍照片",
|
||||
emit: "add-photo",
|
||||
theme: "primary"
|
||||
},
|
||||
{
|
||||
icon: "cardmembership",
|
||||
text: "拍积分卡",
|
||||
emit: "add-point-card",
|
||||
theme: "primary"
|
||||
},
|
||||
{
|
||||
icon: "file-attachment",
|
||||
text: "其他文件",
|
||||
emit: "add-other",
|
||||
theme: "default"
|
||||
}
|
||||
] as const;
|
||||
const photoPickerTarget = ref<CustomerAttachmentType>("PHOTO");
|
||||
@@ -602,6 +635,7 @@ async function handlePhotoSelected(event: Event): Promise<void> {
|
||||
if (tempFile?.id) {
|
||||
photoItemList.value.push({
|
||||
attachType: photoPickerTarget.value,
|
||||
mimeType: file.type,
|
||||
tempFileId: tempFile.id,
|
||||
url: AttachmentAPI.getTempReadURL(tempFile.id)
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user