fix map field education display in excel
This commit is contained in:
parent
380881c78d
commit
1d0c06697d
1 changed files with 72 additions and 28 deletions
|
|
@ -604,17 +604,26 @@ async function onSearch() {
|
||||||
gender: item.gender ?? "-",
|
gender: item.gender ?? "-",
|
||||||
status: item.relationship ?? "-",
|
status: item.relationship ?? "-",
|
||||||
education:
|
education:
|
||||||
item.Educations.length > 0
|
item.Educations.length > 0 &&
|
||||||
? item.Educations.map((e: any) => e.degree)
|
item.Educations.filter((e: any) => e.degree != null)
|
||||||
: [],
|
? item.Educations.filter((e: any) => e.degree != null).map(
|
||||||
|
(e: any) => e.degree
|
||||||
|
)
|
||||||
|
: null,
|
||||||
educationLevel:
|
educationLevel:
|
||||||
item.Educations.length > 0
|
item.Educations.length > 0 &&
|
||||||
? item.Educations.map((e: any) => e.educationLevel)
|
item.Educations.filter((e: any) => e.educationLevel != null)
|
||||||
: [],
|
? item.Educations.filter((e: any) => e.educationLevel != null).map(
|
||||||
|
(e: any) => e.educationLevel
|
||||||
|
)
|
||||||
|
: null,
|
||||||
field:
|
field:
|
||||||
item.Educations.length > 0
|
item.Educations.length > 0 &&
|
||||||
? item.Educations.map((e: any) => e.field)
|
item.Educations.filter((e: any) => e.field != null)
|
||||||
: [],
|
? item.Educations.filter((e: any) => e.field != null).map(
|
||||||
|
(e: any) => e.field
|
||||||
|
)
|
||||||
|
: null,
|
||||||
|
|
||||||
dateAppoint: item.dateAppoint ?? "-",
|
dateAppoint: item.dateAppoint ?? "-",
|
||||||
age: item.age ?? "-",
|
age: item.age ?? "-",
|
||||||
|
|
@ -654,24 +663,55 @@ async function onSearch() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function exportToExcel() {
|
function exportToExcel() {
|
||||||
const newData = rows.value.map((e: any) => {
|
const newData =
|
||||||
const {
|
employeeClass.value === "officer"
|
||||||
profileId,
|
? rows.value.map((e: any) => {
|
||||||
empType,
|
const { profileId, empType, ...rest } = e;
|
||||||
positionArea,
|
return {
|
||||||
positionExecutive,
|
...rest,
|
||||||
posExecutiveDate,
|
dateAppoint: date2Thai(e.dateAppoint),
|
||||||
...rest
|
dateRetireLaw: date2Thai(e.dateRetireLaw),
|
||||||
} = e;
|
education:
|
||||||
return {
|
e.education && e.education.length > 0
|
||||||
...rest,
|
? e.education.map((e: string) => `${e}`).join(", ")
|
||||||
dateAppoint: date2Thai(e.dateAppoint),
|
: "-",
|
||||||
dateRetireLaw: date2Thai(e.dateRetireLaw),
|
educationLevel:
|
||||||
education: e.education.map((e: string) => `${e}`).join(", "),
|
e.educationLevel && e.educationLevel.length > 0
|
||||||
educationLevel: e.educationLevel.map((e: string) => `${e}`).join(", "),
|
? e.educationLevel.map((e: string) => `${e}`).join(", ")
|
||||||
field: e.field.map((e: string) => `${e}`).join(", "),
|
: "-",
|
||||||
};
|
field:
|
||||||
});
|
e.field && e.field.length > 0
|
||||||
|
? e.field.map((e: string) => `${e}`).join(", ")
|
||||||
|
: "-",
|
||||||
|
};
|
||||||
|
})
|
||||||
|
: rows.value.map((e: any) => {
|
||||||
|
const {
|
||||||
|
profileId,
|
||||||
|
empType,
|
||||||
|
positionArea,
|
||||||
|
positionExecutive,
|
||||||
|
posExecutiveDate,
|
||||||
|
...rest
|
||||||
|
} = e;
|
||||||
|
return {
|
||||||
|
...rest,
|
||||||
|
dateAppoint: date2Thai(e.dateAppoint),
|
||||||
|
dateRetireLaw: date2Thai(e.dateRetireLaw),
|
||||||
|
education:
|
||||||
|
e.education && e.education.length > 0
|
||||||
|
? e.education.map((e: string) => `${e}`).join(", ")
|
||||||
|
: "-",
|
||||||
|
educationLevel:
|
||||||
|
e.educationLevel && e.educationLevel.length > 0
|
||||||
|
? e.educationLevel.map((e: string) => `${e}`).join(", ")
|
||||||
|
: "-",
|
||||||
|
field:
|
||||||
|
e.field && e.field.length > 0
|
||||||
|
? e.field.map((e: string) => `${e}`).join(", ")
|
||||||
|
: "-",
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
const headers =
|
const headers =
|
||||||
employeeClass.value === "officer"
|
employeeClass.value === "officer"
|
||||||
|
|
@ -1558,7 +1598,7 @@ watch(
|
||||||
|
|
||||||
<div class="col-12"><q-separator /></div>
|
<div class="col-12"><q-separator /></div>
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<div class="">
|
<div>
|
||||||
<q-radio
|
<q-radio
|
||||||
v-model="typeTerm"
|
v-model="typeTerm"
|
||||||
val="position"
|
val="position"
|
||||||
|
|
@ -1570,6 +1610,8 @@ watch(
|
||||||
size="xs"
|
size="xs"
|
||||||
class="text-grey-8"
|
class="text-grey-8"
|
||||||
/>
|
/>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
<q-radio
|
<q-radio
|
||||||
v-model="typeTerm"
|
v-model="typeTerm"
|
||||||
val="level"
|
val="level"
|
||||||
|
|
@ -1577,6 +1619,8 @@ watch(
|
||||||
size="xs"
|
size="xs"
|
||||||
class="text-grey-8"
|
class="text-grey-8"
|
||||||
/>
|
/>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
<q-radio
|
<q-radio
|
||||||
v-if="employeeClass === 'officer'"
|
v-if="employeeClass === 'officer'"
|
||||||
v-model="typeTerm"
|
v-model="typeTerm"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue