fix submit button position

This commit is contained in:
Timi
2026-08-20 17:06:16 +08:00
parent a67ca759e4
commit e1fc007a67
5 changed files with 107 additions and 62 deletions
+16 -12
View File
@@ -167,9 +167,6 @@
multiple
@change="handleRecordPhotoSelected"
>
<t-button theme="primary" class="save" :disabled="!canSubmit" :loading="isSaving" @click="submitRecord">
<span v-text="saveButtonText" />
</t-button>
</div>
<t-popup v-model="registeredAtPickerVisible" placement="bottom">
<t-date-time-picker
@@ -197,6 +194,7 @@ import CustomerProfileCard from "@/components/CustomerProfileCard.vue";
import CustomerSelector from "@/components/CustomerSelector.vue";
import PhotoScroller from "@/components/PhotoScroller.vue";
import EventSelector from "@/components/EventSelector.vue";
import { useNavBarStore } from "@/store/navBarStore";
import { useSettingStore } from "@/store/settingStore";
import type { Customer } from "@/types/Customer";
import type { EventItem } from "@/types/EventItem";
@@ -216,6 +214,7 @@ const router = useRouter();
const route = useRoute();
const settingStore = useSettingStore();
const userStore = useUserStore();
const navBarStore = useNavBarStore();
type EditablePhoto = {
attachment?: Partial<Attachment>;
@@ -590,9 +589,10 @@ const note = ref("");
const isSaving = ref(false);
const editingRecord = ref<EventRecord>();
const canSubmit = computed(() => selectedCustomerList.value.some(item => !!item.id) && 0 < selectedEventIdList.value.length);
async function submitRecord(): Promise<void> {
if (isSaving.value) {
return;
}
if (!validateForm()) {
return;
}
@@ -731,6 +731,17 @@ async function loadRecordForEdit(): Promise<void> {
onMounted(loadPageData);
onMounted(() => {
navBarStore.clearRight();
if (userStore.hasPermissions(pageAccess.value)) {
navBarStore.setRightText(saveButtonText.value, "var(--td-brand-color)", submitRecord);
}
});
onUnmounted(() => {
navBarStore.clearRight();
});
watch(selectedEventIdList, async () => {
await loadSourceValueRule();
}, { deep: true });
@@ -833,13 +844,6 @@ watch(customerCode, async (value) => {
border-radius: 1rem;
}
.save {
left: 1rem;
right: 1rem;
bottom: calc(.75rem + env(safe-area-inset-bottom, 0));
position: fixed;
}
.file-input {
display: none;
}