wr: store code 조회 위치 변경
This commit is contained in:
@@ -21,12 +21,12 @@ const codeMApping = {
|
||||
WR002: "rswtBdstType",
|
||||
WR003: "rainFcltCd",
|
||||
WR004: "bdstGrntchClass",
|
||||
WR005: "rswtPrscCdMthdCd", // 아직 디 못바꿈
|
||||
WR006: "orgwtKndCd", //작업 완ㅛ
|
||||
WR007: "ruseMngMtd", // 작업완료
|
||||
WR008: "rusePrcsMthdCd", //w작업완료
|
||||
WR009: "erctUswtrPrcsMeth", //w작업완료
|
||||
WR010: "ruseFcltSpot", // inout은 yn 만 사용해야 함으로 해당 코드는 사용안함.
|
||||
WR005: "rswtPrscCdMthdCd",
|
||||
WR006: "orgwtKndCd",
|
||||
WR007: "ruseMngMtd",
|
||||
WR008: "rusePrcsMthdCd",
|
||||
WR009: "erctUswtrPrcsMeth",
|
||||
WR010: "ruseFcltSpot",
|
||||
WR011: "pplQulity",
|
||||
WR012: "pplLenght",
|
||||
WR013: "bdstFilterYn", // 사용 불가 yn만 사용해야함으로 해당코드 사용 안함
|
||||
@@ -312,6 +312,7 @@ export type comCodeActions = {
|
||||
returnCodeText: (val: string, codeName: string) => string;
|
||||
returnTextCode: (text: string, codeName: string) => string;
|
||||
getCommonCodesByKeys: (keys: string[]) => Promise<void>;
|
||||
initCommonCodes: () => Promise<void>;
|
||||
};
|
||||
|
||||
export const codeActionExport: (set: any, get:any) => comCodeActions = (set: any, get:any) => {
|
||||
@@ -368,5 +369,23 @@ export const codeActionExport: (set: any, get:any) => comCodeActions = (set: any
|
||||
const found = codeList.find((item) => item.text === text);
|
||||
return found ? found.val : text;
|
||||
},
|
||||
initCommonCodes: async () => {
|
||||
if (get().code.isInit) return;
|
||||
|
||||
await getSggCd(set);
|
||||
await getCityCd(set);
|
||||
await getRegionCd(set);
|
||||
await getMiddleRegionCd(set);
|
||||
await getUnitWaterShedCd(set);
|
||||
await getEnvPartCd(set);
|
||||
await getCommonUpCd(set);
|
||||
|
||||
set((state) => ({
|
||||
code: {
|
||||
...state.code,
|
||||
isInit: true,
|
||||
},
|
||||
}));
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user