chore: install prettier
This commit is contained in:
@@ -14,8 +14,16 @@
|
||||
{{ v.name }}
|
||||
</div>
|
||||
</template>
|
||||
<div class="field is-grouped is-grouped-multiline" v-else>
|
||||
<div class="control" v-for="(v, i) in tabs" :key="i" @click="changeTab(v)">
|
||||
<div
|
||||
class="field is-grouped is-grouped-multiline"
|
||||
v-else
|
||||
>
|
||||
<div
|
||||
class="control"
|
||||
v-for="(v, i) in tabs"
|
||||
:key="i"
|
||||
@click="changeTab(v)"
|
||||
>
|
||||
<div style="width: 110px">
|
||||
<div :class="`py-3 px-3 ${getStyle(v)}`">{{ v.name }}</div>
|
||||
</div>
|
||||
@@ -31,17 +39,25 @@
|
||||
<template v-if="record">
|
||||
<ImageGallery
|
||||
v-if="tab === 'image'"
|
||||
v-bind="{ row: record, pagename, api: 'peoplefile', show: ['delete'] }"
|
||||
v-bind="{
|
||||
row: record,
|
||||
pagename,
|
||||
api: 'peoplefile',
|
||||
show: ['delete'],
|
||||
}"
|
||||
@update="update"
|
||||
></ImageGallery>
|
||||
</template>
|
||||
<PeopleView v-bind="{ row: record, pagename }" v-if="tab === 'summary'" />
|
||||
<PeopleView
|
||||
v-bind="{ row: record, pagename }"
|
||||
v-if="tab === 'summary'"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import PeopleInfo from "~/components/people/PeopleInfo";
|
||||
const { $dialog } = useNuxtApp()
|
||||
const { $dialog } = useNuxtApp();
|
||||
const props = defineProps({
|
||||
pagename: String,
|
||||
row: Object,
|
||||
@@ -64,19 +80,15 @@ function getStyle(v) {
|
||||
}
|
||||
function changeTab(v) {
|
||||
if (tab.value === v.code) return;
|
||||
if (!record.value)
|
||||
return $dialog(
|
||||
"Vui lòng <b>lưu dữ liệu</b> trước khi chuyển sang mục tiếp theo",
|
||||
"Thông báo"
|
||||
);
|
||||
if (!record.value) return $dialog("Vui lòng <b>lưu dữ liệu</b> trước khi chuyển sang mục tiếp theo", "Thông báo");
|
||||
|
||||
tab.value = v.code;
|
||||
}
|
||||
function update(v) {
|
||||
record.value = {
|
||||
...v,
|
||||
label: `${v.code} / ${v.fullname} / ${v.phone || ""}`
|
||||
}
|
||||
label: `${v.code} / ${v.fullname} / ${v.phone || ""}`,
|
||||
};
|
||||
|
||||
emit("modalevent", { name: "dataevent", data: record.value });
|
||||
if (!props.row) emit("close");
|
||||
|
||||
Reference in New Issue
Block a user