ปรับ จัดการข้อมูลหลัก
This commit is contained in:
parent
44f43d2f6f
commit
925c06c9fc
3 changed files with 29 additions and 26 deletions
|
|
@ -585,12 +585,13 @@ const fetchData = async (load: boolean = false) => {
|
|||
secondItem: RequestItemsHistoryObject
|
||||
) => firstItem.level - secondItem.level
|
||||
);
|
||||
const data = rows.value;
|
||||
let option: DataOption[] = [];
|
||||
data.map((r: RequestItemsHistoryObject) => {
|
||||
option.push({ id: r.id.toString(), name: r.name.toString() });
|
||||
});
|
||||
insigniaTypeOption.value = option;
|
||||
// const data = rows.value;
|
||||
// let option: DataOption[] = [];
|
||||
// data.map((r: RequestItemsHistoryObject) => {
|
||||
// option.push({ id: r.id.toString(), name: r.name.toString() });
|
||||
// });
|
||||
// insigniaTypeOption.value = option;
|
||||
fetchinsigniaType();
|
||||
updateData.value = true;
|
||||
// rows.value.splice(0);
|
||||
// showLoader();
|
||||
|
|
@ -635,26 +636,26 @@ const fetchData = async (load: boolean = false) => {
|
|||
/**
|
||||
* รายการลำดับเครื่องราชฯ
|
||||
*/
|
||||
// const fetchinsigniaType = async () => {
|
||||
// showLoader();
|
||||
// await http
|
||||
// .get(config.API.insigniaType)
|
||||
// .then((res) => {
|
||||
// const data = res.data.result;
|
||||
// let option: DataOption[] = [];
|
||||
// data.map((r: RequestItemsHistoryObject) => {
|
||||
// option.push({ id: r.id.toString(), name: r.name.toString() });
|
||||
// });
|
||||
// insigniaTypeOption.value = option;
|
||||
// })
|
||||
// .catch((e) => {
|
||||
// messageError($q, e);
|
||||
// })
|
||||
// .finally(() => {
|
||||
// updateData.value = false;
|
||||
// hideLoader();
|
||||
// });
|
||||
// };
|
||||
const fetchinsigniaType = async () => {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.insigniaType)
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
let option: DataOption[] = [];
|
||||
data.map((r: RequestItemsHistoryObject) => {
|
||||
option.push({ id: r.id.toString(), name: r.name.toString() });
|
||||
});
|
||||
insigniaTypeOption.value = option;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
updateData.value = false;
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* ฟังชั้นดูข้อมูลประวัติแก้ไขข้อมูลทั้งหมด
|
||||
|
|
|
|||
|
|
@ -366,6 +366,7 @@ const fetchData = async (load: boolean = false) => {
|
|||
const result = await getInsigniaType(false, load);
|
||||
version.value = result.version; //ตัวแปรที่บอกว่าข้อมูลเผยแพร่ไปหรือยัง published=เผยแพร่แล้ว draft=ยังไม่เผยแพร่
|
||||
idVersion.value = result.idversion; //เลข id ใน mongodb
|
||||
|
||||
rows.value = result.data;
|
||||
updateData.value = false;
|
||||
// rows.value.splice(0);
|
||||
|
|
|
|||
|
|
@ -831,6 +831,7 @@ export const useManageDataStore = defineStore("manage", () => {
|
|||
JSON.stringify(dataInsigniaType.value.data) ==
|
||||
JSON.stringify(draftInsigniaType.value.data)
|
||||
) {
|
||||
draftInsigniaType.value && await fetchInsigniaType(false, selector);
|
||||
return draftInsigniaType.value;
|
||||
} else {
|
||||
await fetchInsigniaType(false, selector);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue