refactor: edit baseUrl

This commit is contained in:
Net 2024-08-06 13:46:09 +07:00
parent ae0b4c3264
commit 2ab3cae057
3 changed files with 37 additions and 7 deletions

View file

@ -1,4 +1,6 @@
<script lang="ts" setup> <script lang="ts" setup>
import { baseUrl } from 'src/stores/utils';
defineProps<{ defineProps<{
inactive?: boolean; inactive?: boolean;
color?: 'none' | 'hq' | 'br'; color?: 'none' | 'hq' | 'br';
@ -22,8 +24,6 @@ defineProps<{
)[]; )[];
footer?: boolean; footer?: boolean;
}>(); }>();
const baseUrl = import.meta.env.VITE_API_BASE_URL;
</script> </script>
<template> <template>

View file

@ -17,7 +17,7 @@ import {
} from 'stores/branch/types'; } from 'stores/branch/types';
import { Status } from 'src/stores/types'; import { Status } from 'src/stores/types';
import useUtilsStore, { dialog } from 'src/stores/utils'; import useUtilsStore, { dialog, baseUrl } from 'src/stores/utils';
import AddButton from 'components/AddButton.vue'; import AddButton from 'components/AddButton.vue';
import TooltipComponent from 'components/TooltipComponent.vue'; import TooltipComponent from 'components/TooltipComponent.vue';
import StatCard from 'components/StatCardComponent.vue'; import StatCard from 'components/StatCardComponent.vue';
@ -1067,12 +1067,35 @@ watch(currentHq, () => {
margin-bottom: var(--size-2); margin-bottom: var(--size-2);
" "
> >
<div class="branch-card__icon"> <div class="">
<q-icon <q-img
:src="
baseUrl +
`/branch/${props.row.id}/branch-image`
"
style="
height: 3rem;
width: 3rem;
border-radius: 50%;
aspect-ratio: 1;
overflow: visible;
"
>
<template #error>
<div class="branch-card__icon">
<q-icon
size="sm"
name="mdi-office-building-outline"
/>
</div>
</template>
</q-img>
<!-- <q-icon
size="md" size="md"
style="scale: 0.8" style="scale: 0.8"
name="mdi-office-building-outline" name="mdi-office-building-outline"
/> /> -->
</div> </div>
</div> </div>
<div class="col"> <div class="col">
@ -1997,9 +2020,14 @@ watch(currentHq, () => {
.branch-card__icon { .branch-card__icon {
background-color: hsla(var(--_branch-card-bg) / 0.15); background-color: hsla(var(--_branch-card-bg) / 0.15);
border-radius: 50%; border-radius: 50%;
padding: var(--size-1); padding: var(--size-2);
position: relative; position: relative;
width: 3rem;
transform: rotate(45deg); transform: rotate(45deg);
aspect-ratio: 1;
display: flex;
align-items: center;
justify-content: center;
&::after { &::after {
content: ' '; content: ' ';

View file

@ -4,6 +4,8 @@ import { ComposerTranslation, useI18n } from 'vue-i18n';
import { defineStore } from 'pinia'; import { defineStore } from 'pinia';
import { Ref, ref } from 'vue'; import { Ref, ref } from 'vue';
export const baseUrl = import.meta.env.VITE_API_BASE_URL;
export function dialog(opts: { export function dialog(opts: {
title: string; title: string;
message: string; message: string;