refactor: move value to constant

This commit is contained in:
Thanaphon Frappet 2024-10-01 11:36:17 +07:00
parent 0fd01f6a34
commit 9aee87776f
2 changed files with 32 additions and 19 deletions

View file

@ -60,6 +60,7 @@ import {
formMenuIconEmployee,
uploadFileListEmployee,
columnsAttachment,
dialogCreateCustomerItem,
} from './constant';
import { useCustomerForm, useEmployeeForm } from './form';
import { storeToRefs } from 'pinia';
@ -72,11 +73,6 @@ import useOptionStore from 'stores/options';
import { DialogContainer, DialogHeader } from 'components/dialog';
import KebabAction from 'src/components/shared/KebabAction.vue';
const currentSelectedMenu = ref<{ label: string; value: string }>({
label: '',
value: '',
});
const { t, locale } = useI18n();
const $q = useQuasar();
const route = useRoute();
@ -208,20 +204,6 @@ const maxPageEmployee = ref<number>(1);
const pageSize = ref<number>(30);
const dialogCustomerImageUpload = ref<InstanceType<typeof ImageUploadDialog>>();
const dialogEmployeeImageUpload = ref<InstanceType<typeof ImageUploadDialog>>();
const dialogCreateCustomerItem = [
{
icon: 'mdi:office-building',
text: 'customer.employerLegalEntity',
iconColor: '--purple-10',
color: 'var(--purple-8-hsl)',
},
{
icon: 'heroicons:user-solid',
text: 'customer.employerNaturalPerson',
iconColor: '--green-11',
color: 'var(--green-9-hsl)',
},
];
// image
const refreshImageState = ref(false);
@ -3848,6 +3830,7 @@ const emptyCreateDialog = ref(false);
{{ $t(`general.uploadFile`) }}
</div>
</div>
<UploadFileGroup
v-model:current-id="currentFromDataEmployee.id"
v-model="currentFromDataEmployee.file"

View file

@ -1,5 +1,35 @@
import { QTableProps } from 'quasar';
export const dialogCreateCustomerItem = [
{
icon: 'mdi:office-building',
text: 'customer.employerLegalEntity',
iconColor: '--purple-10',
color: 'var(--purple-8-hsl)',
},
{
icon: 'heroicons:user-solid',
text: 'customer.employerNaturalPerson',
iconColor: '--green-11',
color: 'var(--green-9-hsl)',
},
];
export const formMenuIcon = <
{ icon: string; color: string; bgColor: string }[]
>[
{
icon: 'mdi-office-building-outline',
color: 'hsl(var(--info-bg))',
bgColor: 'var(--surface-1)',
},
{
icon: 'mdi-briefcase-outline',
color: 'hsl(var(--info-bg))',
bgColor: 'var(--surface-1)',
},
];
export const countryCode = [
{
label: 'thai',