ปรับวินัย

This commit is contained in:
setthawutttty 2024-01-10 18:01:19 +07:00
parent 4f0584c415
commit 141a8aa435
6 changed files with 53 additions and 103 deletions

View file

@ -81,22 +81,22 @@ const dateMonth = ref<DataDateMonthObject>({
});
/** function เรียกข่อมูล calendar*/
function getRandomColor() {
return (
"hsl(" +
360 * Math.random() +
"," +
(25 + 70 * Math.random()) +
"%," +
(85 + 10 * Math.random()) +
"%)"
);
}
// function getRandomColor() {
// return (
// "hsl(" +
// 360 * Math.random() +
// "," +
// (25 + 70 * Math.random()) +
// "%," +
// (85 + 10 * Math.random()) +
// "%)"
// );
// }
async function fetchCalendar() {
showLoader();
const defaultColor = "#E3FDDA";
const gradientColors = generateGradientColors(props.lists.length);
const defaultColor = "#e3fdda";
const gradientColors = '#f7d0dd'
const events = await props.lists.map(
(e: ExtendHistoryObject, index: number) => ({
@ -107,7 +107,7 @@ async function fetchCalendar() {
allDay: false,
color:
props.lists.length > 1 && index > 0
? gradientColors[index]
? gradientColors
: defaultColor,
})
);
@ -123,13 +123,13 @@ async function fetchCalendar() {
}, 1000);
}
function generateGradientColors(length: number) {
const colors = [];
for (let i = 0; i < length; i++) {
colors.push(getRandomColor());
}
return colors;
}
// function generateGradientColors(length: number) {
// const colors = [];
// for (let i = 0; i < length; i++) {
// colors.push(getRandomColor());
// }
// return colors;
// }
/**
* function convert เดอนป

View file

@ -410,12 +410,13 @@ function confirmDeleteRelevant(id: string) {
.delete(config.API.investigateRelevantFileDelete(formData.id, id))
.then((res) => {
success($q, `ลบไฟล์สำเร็จ`);
props.getData();
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
props.getData();
});
}
@ -437,12 +438,13 @@ function confirmDelete(id: string) {
.delete(config.API.investigateFileDelete(formData.id, id))
.then((res) => {
success($q, `ลบไฟล์สำเร็จ`);
props.getData();
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
props.getData();
});
}
async function addPerson(data: any) {
@ -611,12 +613,13 @@ async function saveDuty(id: string, duty: string, resolution: string) {
.then((res: any) => {
success($q, "บันทึกสำเร็จ");
closeEditDirector();
props.getData?.();
})
.catch((e) => {
messageError($q, e);
})
.finally(async () => {
props.getData?.();
hideLoader();
});
}