Merge branch 'develop' into work
This commit is contained in:
commit
e1a25d437d
2 changed files with 37 additions and 24 deletions
|
|
@ -579,8 +579,21 @@ const fetchData = async (load: boolean = false) => {
|
|||
const result = await getInsignia(false, load);
|
||||
version.value = result.version; //ตัวแปรที่บอกว่าข้อมูลเผยแพร่ไปหรือยัง published=เผยแพร่แล้ว draft=ยังไม่เผยแพร่
|
||||
idVersion.value = result.idversion; //เลข id ใน mongodb
|
||||
rows.value = result.data;
|
||||
rows.value.sort(
|
||||
(
|
||||
firstItem: RequestItemsHistoryObject,
|
||||
secondItem: RequestItemsHistoryObject
|
||||
) => firstItem.level - secondItem.level
|
||||
);
|
||||
updateData.value = false;
|
||||
rows.value = result.data;
|
||||
const data = rows.value;
|
||||
let option: DataOption[] = [];
|
||||
data.map((r: RequestItemsHistoryObject) => {
|
||||
option.push({ id: r.id.toString(), name: r.name.toString() });
|
||||
});
|
||||
insigniaTypeOption.value = option;
|
||||
updateData.value = true;
|
||||
// rows.value.splice(0);
|
||||
// showLoader();
|
||||
// await http
|
||||
|
|
@ -624,26 +637,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();
|
||||
// });
|
||||
// };
|
||||
|
||||
/**
|
||||
* ฟังชั้นดูข้อมูลประวัติแก้ไขข้อมูลทั้งหมด
|
||||
|
|
@ -701,7 +714,7 @@ const clearPublishedData = async () => {
|
|||
})
|
||||
.finally(async () => {
|
||||
await fetchHistory();
|
||||
await fetchData();
|
||||
await fetchData(true);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -720,7 +733,7 @@ const publishedData = async () => {
|
|||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await fetchData();
|
||||
await fetchData(true);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -205,7 +205,7 @@ const { loaderPage } = dataStore;
|
|||
const mixin = useCounterMixin();
|
||||
const { success, dateText, messageError, showLoader, hideLoader } = mixin;
|
||||
const store = useManageDataStore();
|
||||
const { manageData, changeManageColumns, getGender, dataGenders } = store;
|
||||
const { manageData, changeManageColumns, getGender, dataGender } = store;
|
||||
const rows = ref<RequestItemsHistoryObject[]>([]); //list data table
|
||||
const rowsHistory = ref<RequestItemsHistoryObject[]>([]); //select data history
|
||||
const rawHistory = ref<RequestItemsHistoryObject[]>([]); //raw data history
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue