ย้ายไอคอน

This commit is contained in:
STW_TTTY\stwtt 2024-07-24 09:50:23 +07:00
parent 900d308f81
commit dfa66f3a98
28 changed files with 730 additions and 702 deletions

View file

@ -310,20 +310,16 @@ onMounted(() => {
>
<template v-slot:header="props">
<q-tr :props="props">
<q-th auto-width />
<q-th auto-width />
<q-th v-for="col in props.cols" :key="col.name" :props="props">
<span class="text-weight-medium">{{ col.label }}</span>
</q-th>
<q-th auto-width />
<q-th auto-width />
</q-tr>
</template>
<template v-slot:body="props">
<q-tr :props="props" class="cursor-pointer">
<q-td v-for="col in props.cols" :key="col.name" :props="props">
<div>
{{ col.value ? col.value : "-" }}
</div>
</q-td>
<q-td>
<q-btn
dense
@ -348,6 +344,12 @@ onMounted(() => {
<q-tooltip>ลบ</q-tooltip>
</q-btn>
</q-td>
<q-td v-for="col in props.cols" :key="col.name" :props="props">
<div>
{{ col.value ? col.value : "-" }}
</div>
</q-td>
</q-tr>
</template>
</d-table>

View file

@ -27,17 +27,79 @@ const route = useRoute();
const projectId = ref<string>(route.params.id.toLocaleString());
const $q = useQuasar();
const mixin = useCounterMixin();
const {
dialogRemove,
showLoader,
hideLoader,
messageError,
success,
dialogConfirm,
} = mixin;
const { showLoader, hideLoader, messageError, success, dialogConfirm } = mixin;
const plannedGoals = ref<ResPlannedGoals[]>([]);
const plannedPeoples = ref<ResPeople[]>([]);
const actualGoals = ref<ResActualGoals[]>([]);
const actualPeoples = ref<ResPeople[]>([]);
const groupTargetData: any = reactive({
targetData: [{}],
});
const isEdit = ref<boolean>(false);
const editId = ref<string>("");
const modalGroupTarget = ref<boolean>(false);
const newModalGroupTarget = ref<boolean>(false);
const modalRelate = ref<boolean>(false);
const isTarget = ref<string>("");
const posTypeOp = ref<DataOption[]>([]);
const posLevelOp = ref<DataOption[]>([]);
const posTypeMain = ref<ResGroup[]>([]);
const formGroupTarget = reactive<FormGroupTargetPlannedGoal>({
groupTarget: "",
groupTargetSub: "",
position: "",
posType: null,
posLevel: null,
type: null,
amount: null,
positions: [
{
position: "",
posTypeId: null,
posLevelId: null,
},
],
});
const formGroupRelate = reactive<FormGroupRelate>({
relate: "",
amount: null,
});
/** เพิ่ม object ให้ตัวแปร */
const addGroupTargetData = async () => {
formGroupTarget.positions.push({
position: "",
posTypeId: null,
posLevelId: null,
});
};
const peoplesOp = ref<DataOption[]>([
{ id: "OPERATOR", name: "เจ้าหน้าที่ดําเนินการ" },
{ id: "LECTURER", name: "วิทยากร" },
{ id: "OBSERVER", name: "ผู้สังเกตการณ์" },
]);
const groupOp = ref<DataOption[]>([
{ id: "OFFICER", name: "ข้าราชการกรุงเทพมหานคร" },
{ id: "PERSONNEL", name: "บุคลากรกรุงเทพมหานคร" },
{ id: "OUTSIDERS", name: "บุคคลภายนอก" },
]);
const groupSubOp = ref<DataOption[]>([
{ id: "OFFICER", name: "ข้าราชการกรุงเทพมหานครสามัญ" },
{ id: "TEACHER", name: "ข้าราชการครู" },
{ id: "EMPLOYEE", name: "กรุงเทพมหานคร(ลูกจ้างประจำ)" },
{ id: "EMPLOYEETEMP", name: "กรุงเทพมหานคร(ลูกจ้างชั่วคราว)" },
{ id: "EDUCATIONAL", name: "บุคลากรทางการศึกษากรุงเทพมหานคร" },
]);
const columnsPlannedGoals = ref<QTableProps["columns"]>([
{
name: "groupTarget",
@ -67,9 +129,7 @@ const columnsPlannedGoals = ref<QTableProps["columns"]>([
field: "posTypePlannedId",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
// format: (val) => convertTypeGoals(val),
},
{
name: "amount",
align: "left",
@ -147,72 +207,6 @@ const columnsRelated = ref<QTableProps["columns"]>([
},
]);
const plannedGoals = ref<ResPlannedGoals[]>([]);
const plannedPeoples = ref<ResPeople[]>([]);
const actualGoals = ref<ResActualGoals[]>([]);
const actualPeoples = ref<ResPeople[]>([]);
const peoplesOp = ref<DataOption[]>([
{ id: "OPERATOR", name: "เจ้าหน้าที่ดําเนินการ" },
{ id: "LECTURER", name: "วิทยากร" },
{ id: "OBSERVER", name: "ผู้สังเกตการณ์" },
]);
const groupOp = ref<DataOption[]>([
{ id: "OFFICER", name: "ข้าราชการกรุงเทพมหานคร" },
{ id: "PERSONNEL", name: "บุคลากรกรุงเทพมหานคร" },
{ id: "OUTSIDERS", name: "บุคคลภายนอก" },
]);
const groupSubOp = ref<DataOption[]>([
{ id: "OFFICER", name: "ข้าราชการกรุงเทพมหานครสามัญ" },
{ id: "TEACHER", name: "ข้าราชการครู" },
{ id: "EMPLOYEE", name: "กรุงเทพมหานคร(ลูกจ้างประจำ)" },
{ id: "EMPLOYEETEMP", name: "กรุงเทพมหานคร(ลูกจ้างชั่วคราว)" },
{ id: "EDUCATIONAL", name: "บุคลากรทางการศึกษากรุงเทพมหานคร" },
]);
const isEdit = ref<boolean>(false);
const editId = ref<string>("");
const modalGroupTarget = ref<boolean>(false);
const newModalGroupTarget = ref<boolean>(false);
const modalRelate = ref<boolean>(false);
const isTarget = ref<string>("");
const formGroupTarget = reactive<FormGroupTargetPlannedGoal>({
groupTarget: "",
groupTargetSub: "",
position: "",
posType: null,
posLevel: null,
type: null,
amount: null,
positions: [
{
position: "",
posTypeId: null,
posLevelId: null,
},
],
});
const formGroupRelate = reactive<FormGroupRelate>({
relate: "",
amount: null,
});
const posTypeOp = ref<DataOption[]>([]);
const posLevelOp = ref<DataOption[]>([]);
const posTypeMain = ref<ResGroup[]>([]);
/** เพิ่ม object ให้ตัวแปร */
const addGroupTargetData = async () => {
formGroupTarget.positions.push({
position: "",
posTypeId: null,
posLevelId: null,
});
};
/** function เรียกข้อมูลประเภทตำแหน่ง*/
function fetchType() {
if (posTypeMain.value.length === 0) {
@ -541,37 +535,14 @@ onMounted(() => {
>
<template v-slot:header="props">
<q-tr :props="props">
<q-th auto-width />
<q-th v-for="col in props.cols" :key="col.name" :props="props">
<span class="text-weight-medium">{{ col.label }}</span>
</q-th>
<q-th auto-width />
</q-tr>
</template>
<template v-slot:body="props">
<q-tr :props="props" class="cursor-pointer vertical-top">
<q-td v-for="col in props.cols" :key="col.name" :props="props">
<div v-if="col.name === 'posTypePlannedId'">
<div
v-if="props.row.groupTarget !== 'OUTSIDERS'"
v-for="row in props.row.position"
>
{{ `- ${row.position}`
}}{{
row.posType !== null || row.posLevel !== null
? ` (${row.posType ? row.posType : ""}${
row.posLevel ? " " + row.posLevel : ""
})`
: ""
}}
</div>
<div v-else>
{{ props.row.type ? props.row.type : "-" }}
</div>
</div>
<div v-else class="table_ellipsis">
{{ col.value ? col.value : "-" }}
</div>
</q-td>
<q-td>
<q-btn
v-if="store.projectStatus !== 'FINISH'"
@ -597,6 +568,29 @@ onMounted(() => {
<q-tooltip>แกไขขอม</q-tooltip></q-btn
>
</q-td>
<q-td v-for="col in props.cols" :key="col.name" :props="props">
<div v-if="col.name === 'posTypePlannedId'">
<div
v-if="props.row.groupTarget !== 'OUTSIDERS'"
v-for="row in props.row.position"
>
{{ `- ${row.position}`
}}{{
row.posType !== null || row.posLevel !== null
? ` (${row.posType ? row.posType : ""}${
row.posLevel ? " " + row.posLevel : ""
})`
: ""
}}
</div>
<div v-else>
{{ props.row.type ? props.row.type : "-" }}
</div>
</div>
<div v-else class="table_ellipsis">
{{ col.value ? col.value : "-" }}
</div>
</q-td>
</q-tr>
</template>
</d-table>
@ -617,19 +611,14 @@ onMounted(() => {
>
<template v-slot:header="props">
<q-tr :props="props">
<q-th auto-width />
<q-th v-for="col in props.cols" :key="col.name" :props="props">
<span class="text-weight-medium">{{ col.label }}</span>
</q-th>
<q-th auto-width />
</q-tr>
</template>
<template v-slot:body="props">
<q-tr :props="props" class="cursor-pointer">
<q-td v-for="col in props.cols" :key="col.name" :props="props">
<div class="table_ellipsis">
{{ col.value ? col.value : "-" }}
</div>
</q-td>
<q-td>
<q-btn
v-if="store.projectStatus !== 'FINISH'"
@ -652,6 +641,11 @@ onMounted(() => {
<q-tooltip>แกไขขอม</q-tooltip></q-btn
>
</q-td>
<q-td v-for="col in props.cols" :key="col.name" :props="props">
<div class="table_ellipsis">
{{ col.value ? col.value : "-" }}
</div>
</q-td>
</q-tr>
</template>
</d-table>