fix filter competency by new condition
This commit is contained in:
parent
6164ff1e93
commit
4ae28e9470
1 changed files with 26 additions and 12 deletions
|
|
@ -293,9 +293,13 @@ function onLevel(num: number, list: any) {
|
|||
}
|
||||
|
||||
watch(
|
||||
() => store.dataEvaluation.posTypeName, // ตรวจจับค่า posTypeName
|
||||
() => [store.dataEvaluation.posTypeName, store.dataEvaluation.posExecutiveName, store.dataEvaluation.position, store.dataEvaluation.posLevelName], // ตรวจจับค่า posTypeName และ posExecutiveName
|
||||
(newValue) => {
|
||||
if (!newValue) return; // ถ้ายังไม่มีค่า ไม่ต้องทำอะไร
|
||||
const posTypeName = newValue[0];
|
||||
const posExecutiveName = newValue[1];
|
||||
const position = newValue[2];
|
||||
const posLevelName = newValue[3];
|
||||
|
||||
const competencyTypeList = [
|
||||
{
|
||||
|
|
@ -321,17 +325,27 @@ watch(
|
|||
];
|
||||
|
||||
competencyType.value =
|
||||
newValue === "อำนวยการ" || newValue === "บริหาร"
|
||||
? competencyTypeList.filter(
|
||||
(x: DataOptions) =>
|
||||
x.id === "HEAD" ||
|
||||
x.id === "EXECUTIVE" ||
|
||||
x.id === "INSPECTOR" ||
|
||||
x.id === "DIRECTOR"
|
||||
)
|
||||
: competencyTypeList.filter(
|
||||
(x: DataOptions) => x.id === "HEAD" || x.id === "GROUP"
|
||||
);
|
||||
position === "ผู้ตรวจราชการกรุงเทพมหานคร" || position === "ผู้ตรวจราชการ"
|
||||
? competencyTypeList.filter(
|
||||
(x: DataOptions) => x.id === "HEAD" || x.id === "INSPECTOR"
|
||||
)
|
||||
: posExecutiveName === "ผู้อำนวยการเขต"
|
||||
? competencyTypeList.filter(
|
||||
(x: DataOptions) => x.id === "HEAD" || x.id === "DIRECTOR"
|
||||
)
|
||||
: posTypeName === "อำนวยการ" ||
|
||||
posTypeName === "บริหาร" ||
|
||||
(posTypeName === "ทั่วไป" &&
|
||||
posLevelName === "อาวุโส" &&
|
||||
posExecutiveName != null) ||
|
||||
(posTypeName === "วิชาการ" &&
|
||||
posExecutiveName != null)
|
||||
? competencyTypeList.filter(
|
||||
(x: DataOptions) => x.id === "HEAD" || x.id === "EXECUTIVE"
|
||||
)
|
||||
: competencyTypeList.filter(
|
||||
(x: DataOptions) => x.id === "HEAD" || x.id === "GROUP"
|
||||
);
|
||||
|
||||
for (let index = 0; index < competencyType.value.length; index++) {
|
||||
const element = competencyType.value[index];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue