This commit is contained in:
Viet An
2026-05-21 09:45:01 +07:00
parent a52c33706a
commit 8f95fee8a7
18 changed files with 70 additions and 45 deletions

View File

@@ -1,5 +1,6 @@
<script setup>
const { $empty, $insertapi } = useNuxtApp();
const emit = defineEmits(["modalevent"]);
const isLoading = ref(false);
const body = ref({
@@ -10,7 +11,8 @@ const body = ref({
async function submit() {
isLoading.value = true;
await $insertapi("Battery", body.value);
const newRow = await $insertapi("Battery", body.value);
emit("modalevent", { name: "dataevent", data: newRow });
isLoading.value = false;
}
</script>

View File

@@ -1,5 +1,6 @@
<script setup>
const { $empty, $insertapi } = useNuxtApp();
const emit = defineEmits(["modalevent"]);
const isLoading = ref(false);
const body = ref({
@@ -10,7 +11,8 @@ const body = ref({
async function submit() {
isLoading.value = true;
await $insertapi("CPU", body.value);
const newRow = await $insertapi("CPU", body.value);
emit("modalevent", { name: "dataevent", data: newRow });
isLoading.value = false;
}
</script>

View File

@@ -1,5 +1,6 @@
<script setup>
const { $empty, $insertapi } = useNuxtApp();
const emit = defineEmits(["modalevent"]);
const isLoading = ref(false);
const body = ref({
@@ -10,7 +11,8 @@ const body = ref({
async function submit() {
isLoading.value = true;
await $insertapi("Camera_System", body.value);
const newRow = await $insertapi("Camera_System", body.value);
emit("modalevent", { name: "dataevent", data: newRow });
isLoading.value = false;
}
</script>

View File

@@ -1,5 +1,6 @@
<script setup>
const { $empty, $insertapi } = useNuxtApp();
const emit = defineEmits(["modalevent"]);
const isLoading = ref(false);
const body = ref({
@@ -10,7 +11,8 @@ const body = ref({
async function submit() {
isLoading.value = true;
await $insertapi("Charging_Technology", body.value);
const newRow = await $insertapi("Charging_Technology", body.value);
emit("modalevent", { name: "dataevent", data: newRow });
isLoading.value = false;
}
</script>

View File

@@ -1,5 +1,6 @@
<script setup>
const { $empty, $insertapi } = useNuxtApp();
const emit = defineEmits(["modalevent"]);
const isLoading = ref(false);
const body = ref({
@@ -10,7 +11,8 @@ const body = ref({
async function submit() {
isLoading.value = true;
await $insertapi("Color", body.value);
const newRow = await $insertapi("Color", body.value);
emit("modalevent", { name: "dataevent", data: newRow });
isLoading.value = false;
}
</script>

View File

@@ -1,5 +1,6 @@
<script setup>
const { $empty, $insertapi } = useNuxtApp();
const emit = defineEmits(["modalevent"]);
const isLoading = ref(false);
const body = ref({
@@ -10,7 +11,8 @@ const body = ref({
async function submit() {
isLoading.value = true;
await $insertapi("Design", body.value);
const newRow = await $insertapi("Design", body.value);
emit("modalevent", { name: "dataevent", data: newRow });
isLoading.value = false;
}
</script>

View File

@@ -1,5 +1,6 @@
<script setup>
const { $empty, $insertapi } = useNuxtApp();
const emit = defineEmits(["modalevent"]);
const isLoading = ref(false);
const body = ref({
@@ -9,7 +10,8 @@ const body = ref({
async function submit() {
isLoading.value = true;
await $insertapi("External_Storage", body.value);
const newRow = await $insertapi("External_Storage", body.value);
emit("modalevent", { name: "dataevent", data: newRow });
isLoading.value = false;
}
</script>

View File

@@ -1,5 +1,6 @@
<script setup>
const { $empty, $insertapi } = useNuxtApp();
const emit = defineEmits(["modalevent"]);
const isLoading = ref(false);
const body = ref({
@@ -9,7 +10,8 @@ const body = ref({
async function submit() {
isLoading.value = true;
await $insertapi("GPU", body.value);
const newRow = await $insertapi("GPU", body.value);
emit("modalevent", { name: "dataevent", data: newRow });
isLoading.value = false;
}
</script>

View File

@@ -1,5 +1,6 @@
<script setup>
const { $empty, $insertapi } = useNuxtApp();
const emit = defineEmits(["modalevent"]);
const isLoading = ref(false);
const body = ref({
@@ -9,7 +10,8 @@ const body = ref({
async function submit() {
isLoading.value = true;
await $insertapi("IP_Rating", body.value);
const newRow = await $insertapi("IP_Rating", body.value);
emit("modalevent", { name: "dataevent", data: newRow });
isLoading.value = false;
}
</script>

View File

@@ -2,6 +2,7 @@
import InputNumber from "@/components/common/InputNumber.vue";
const { $empty, $insertapi } = useNuxtApp();
const emit = defineEmits(["modalevent"]);
const isLoading = ref(false);
const body = ref({
@@ -11,7 +12,8 @@ const body = ref({
async function submit() {
isLoading.value = true;
await $insertapi("Internal_Storage", body.value);
const newRow = await $insertapi("Internal_Storage", body.value);
emit("modalevent", { name: "dataevent", data: newRow });
isLoading.value = false;
}
</script>

View File

@@ -1,5 +1,6 @@
<script setup>
const { $empty, $insertapi } = useNuxtApp();
const emit = defineEmits(["modalevent"]);
const isLoading = ref(false);
const body = ref({
@@ -9,7 +10,8 @@ const body = ref({
async function submit() {
isLoading.value = true;
await $insertapi("Manufacturer", body.value);
const newRow = await $insertapi("Manufacturer", body.value);
emit("modalevent", { name: "dataevent", data: newRow });
isLoading.value = false;
}
</script>

View File

@@ -1,5 +1,6 @@
<script setup>
const { $empty, $insertapi } = useNuxtApp();
const emit = defineEmits(["modalevent"]);
const isLoading = ref(false);
const body = ref({
@@ -9,7 +10,8 @@ const body = ref({
async function submit() {
isLoading.value = true;
await $insertapi("Network_Technology", body.value);
const newRow = await $insertapi("Network_Technology", body.value);
emit("modalevent", { name: "dataevent", data: newRow });
isLoading.value = false;
}
</script>

View File

@@ -1,5 +1,6 @@
<script setup>
const { $empty, $insertapi } = useNuxtApp();
const emit = defineEmits(["modalevent"]);
const isLoading = ref(false);
const body = ref({
@@ -10,7 +11,9 @@ const body = ref({
async function submit() {
isLoading.value = true;
await $insertapi("OS", body.value);
const newRow = await $insertapi("OS", body.value);
emit("modalevent", { name: "dataevent", data: newRow });
isLoading.value = false;
}
</script>

View File

@@ -2,6 +2,7 @@
import InputNumber from "@/components/common/InputNumber.vue";
const { $empty, $insertapi } = useNuxtApp();
const emit = defineEmits(["modalevent"]);
const isLoading = ref(false);
const body = ref({
@@ -11,7 +12,8 @@ const body = ref({
async function submit() {
isLoading.value = true;
await $insertapi("RAM", body.value);
const newRow = await $insertapi("RAM", body.value);
emit("modalevent", { name: "dataevent", data: newRow });
isLoading.value = false;
}
</script>

View File

@@ -2,6 +2,7 @@
import InputNumber from "@/components/common/InputNumber.vue";
const { $empty, $insertapi } = useNuxtApp();
const emit = defineEmits(["modalevent"]);
const isLoading = ref(false);
const body = ref({
@@ -12,7 +13,8 @@ const body = ref({
async function submit() {
isLoading.value = true;
await $insertapi("SIM", body.value);
const newRow = await $insertapi("SIM", body.value);
emit("modalevent", { name: "dataevent", data: newRow });
isLoading.value = false;
}
</script>

View File

@@ -1,5 +1,6 @@
<script setup>
const { $empty, $insertapi } = useNuxtApp();
const emit = defineEmits(["modalevent"]);
const isLoading = ref(false);
const body = ref({
@@ -15,7 +16,8 @@ const body = ref({
async function submit() {
isLoading.value = true;
await $insertapi("Screen", body.value);
const newRow = await $insertapi("Screen", body.value);
emit("modalevent", { name: "dataevent", data: newRow });
isLoading.value = false;
}
</script>