chore: cleanup

This commit is contained in:
Methapon2001 2024-04-19 14:22:23 +07:00
parent cec7db9388
commit 550ded4f63
6 changed files with 12 additions and 24 deletions

View file

@ -1,11 +1,9 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref } from 'vue';
const telephoneNo = defineModel<string>('telephoneNo'); const telephoneNo = defineModel<string>('telephoneNo');
const contact = defineModel<string>('contact'); const contact = defineModel<string>('contact');
const email = defineModel<string>('email'); const email = defineModel<string>('email');
const contactName = defineModel<string>('contactName'); const contactName = defineModel<string>('contactName');
const operatingHours = defineModel<string>('operatingHours'); // const operatingHours = defineModel<string>('operatingHours');
const lineId = defineModel<string>('lineId'); const lineId = defineModel<string>('lineId');
defineProps<{ defineProps<{

View file

@ -1,6 +1,4 @@
<script setup lang="ts"> <script setup lang="ts">
import { Icon } from '@iconify/vue';
const image = defineModel<string | null>('image'); const image = defineModel<string | null>('image');
defineProps<{ defineProps<{

View file

@ -3,7 +3,6 @@ import useUserStore from 'src/stores/user';
import { UserAttachmentDelete } from 'src/stores/user/types'; import { UserAttachmentDelete } from 'src/stores/user/types';
import { dialog } from 'src/stores/utils'; import { dialog } from 'src/stores/utils';
import { dateFormat } from 'src/utils/datetime'; import { dateFormat } from 'src/utils/datetime';
import { watch } from 'vue';
const userStore = useUserStore(); const userStore = useUserStore();

View file

@ -1,5 +1,4 @@
<script setup lang="ts"> <script setup lang="ts">
import { storeToRefs } from 'pinia';
import useUserStore from 'src/stores/user'; import useUserStore from 'src/stores/user';
const userStore = useUserStore(); const userStore = useUserStore();

View file

@ -1,5 +1,5 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, watch } from 'vue'; import { ref } from 'vue';
defineProps<{ defineProps<{
title: string; title: string;
@ -25,15 +25,6 @@ function reset() {
myForm.value.resetValidation(); myForm.value.resetValidation();
} }
} }
// watch(
// () => window.screen.width,
// (v) => {
// console.log(v);
// drawerWidth.value = v;
// },
// );
</script> </script>
<template> <template>
<q-drawer <q-drawer

View file

@ -349,7 +349,6 @@ function triggerDelete(id: string) {
async function onSubmit() { async function onSubmit() {
if (formType.value === 'edit') { if (formType.value === 'edit') {
if (modalDrawer.value) { if (modalDrawer.value) {
const { status, ...payload } = formData.value;
dialog({ dialog({
color: 'primary', color: 'primary',
icon: 'mdi-pencil-outline', icon: 'mdi-pencil-outline',
@ -358,11 +357,11 @@ async function onSubmit() {
persistent: true, persistent: true,
message: 'คุณต้องการแก้ไขข้อมูล ใช่หรือไม่', message: 'คุณต้องการแก้ไขข้อมูล ใช่หรือไม่',
action: async () => { action: async () => {
const { status, ...payload } = formData.value;
await branchStore.editById( await branchStore.editById(
codeHq.value.id, codeHq.value.id,
{ {
...payload, ...formData.value,
status: undefined,
}, },
profileFile.value, profileFile.value,
profileFileImg.value, profileFileImg.value,
@ -373,12 +372,11 @@ async function onSubmit() {
cancel: () => {}, cancel: () => {},
}); });
} else { } else {
const { status, ...payload } = formData.value;
await branchStore.editById( await branchStore.editById(
codeHq.value.id, codeHq.value.id,
{ {
...payload, ...formData.value,
status: undefined,
}, },
profileFile.value, profileFile.value,
profileFileImg.value, profileFileImg.value,
@ -463,7 +461,12 @@ watch(locale, () => {
<StatCard :branch="stats" :dark="$q.dark.isActive" /> <StatCard :branch="stats" :dark="$q.dark.isActive" />
</AppBox> </AppBox>
<AppBox class="column" no-padding bordered style="min-height: 70vh"> <AppBox
class="column"
:no-padding="!!branchData.total"
bordered
style="min-height: 70vh"
>
<template v-if="!branchData.total"> <template v-if="!branchData.total">
<TooltipComponent <TooltipComponent
class="self-end" class="self-end"