แก้ไข noteส่งไม่ไป,แสดงผลคอลัมน์
This commit is contained in:
parent
c8a9e61625
commit
64573c492f
3 changed files with 7 additions and 9 deletions
|
|
@ -181,7 +181,6 @@ async function fetchData(id: string) {
|
||||||
}
|
}
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
fetchData(id.value);
|
fetchData(id.value);
|
||||||
console.log(id.value);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
async function onSubmit() {
|
async function onSubmit() {
|
||||||
|
|
@ -207,7 +206,7 @@ async function addData() {
|
||||||
name: name.value,
|
name: name.value,
|
||||||
isActive: isActive.value,
|
isActive: isActive.value,
|
||||||
shortName: shortName.value,
|
shortName: shortName.value,
|
||||||
note: note.value == "" ? "-" : "",
|
note: note.value == "" ? "-" : note.value,
|
||||||
insigniaTypeId: id.value,
|
insigniaTypeId: id.value,
|
||||||
});
|
});
|
||||||
fetchData(id.value);
|
fetchData(id.value);
|
||||||
|
|
@ -218,7 +217,7 @@ async function editData(idData: string) {
|
||||||
name: name.value,
|
name: name.value,
|
||||||
isActive: isActive.value,
|
isActive: isActive.value,
|
||||||
shortName: shortName.value,
|
shortName: shortName.value,
|
||||||
note: note.value == "" ? "-" : "",
|
note: note.value == "" ? "-" : note.value,
|
||||||
insigniaTypeId: id.value,
|
insigniaTypeId: id.value,
|
||||||
});
|
});
|
||||||
fetchData(id.value);
|
fetchData(id.value);
|
||||||
|
|
@ -232,10 +231,6 @@ async function deleteData(idData: string) {
|
||||||
import { defineEmits } from "vue";
|
import { defineEmits } from "vue";
|
||||||
|
|
||||||
const emit = defineEmits(["nameType"]);
|
const emit = defineEmits(["nameType"]);
|
||||||
|
|
||||||
const nameType = () => {
|
|
||||||
emit("nameType", insigniaTypeId.value);
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ interface DataResponse {
|
||||||
lastUpdateFullName: String;
|
lastUpdateFullName: String;
|
||||||
lastUpdatedAt: Date;
|
lastUpdatedAt: Date;
|
||||||
name: string;
|
name: string;
|
||||||
|
level: Number;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface DataRow {
|
interface DataRow {
|
||||||
|
|
|
||||||
|
|
@ -10,15 +10,17 @@ const { date2Thai } = useCounterMixin();
|
||||||
|
|
||||||
export const useInsigniaDataStore = defineStore("insigniaData", () => {
|
export const useInsigniaDataStore = defineStore("insigniaData", () => {
|
||||||
const row = ref<DataRow[]>();
|
const row = ref<DataRow[]>();
|
||||||
const name1 = ref<string>("");
|
|
||||||
function fetchData(data: DataResponse[], insigniaType?: string) {
|
function fetchData(data: DataResponse[], insigniaType?: string) {
|
||||||
|
data.forEach((row, index) => {
|
||||||
|
row.level = index + 1;
|
||||||
|
});
|
||||||
const list = data.map((e) => ({
|
const list = data.map((e) => ({
|
||||||
...e,
|
...e,
|
||||||
insigniaType: insigniaType,
|
insigniaType: insigniaType,
|
||||||
createdAt: e.createdAt ? date2Thai(e.createdAt) : "",
|
createdAt: e.createdAt ? date2Thai(e.createdAt) : "",
|
||||||
lastUpdatedAt: e.lastUpdatedAt ? date2Thai(e.lastUpdatedAt) : "",
|
lastUpdatedAt: e.lastUpdatedAt ? date2Thai(e.lastUpdatedAt) : "",
|
||||||
}));
|
}));
|
||||||
console.log("test");
|
list;
|
||||||
row.value = list;
|
row.value = list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue