任务:今日挑战区分累积型和去做型

This commit is contained in:
luying
2022-01-17 18:20:37 +08:00
parent 683dfeda81
commit 64b6d4706e
6 changed files with 194 additions and 101 deletions
+7 -1
View File
@@ -13,6 +13,8 @@ export interface DicTaskType {
readonly param: string;
// condition怎么填
readonly condition: string;
// 累积类型 1-累积型 2-去做型
readonly sumType: number;
}
const DicTaskTypeKeys: KeysEnum<DicTaskType> = {
@@ -20,15 +22,19 @@ const DicTaskTypeKeys: KeysEnum<DicTaskType> = {
name: true,
info: true,
param: true,
condition: true
condition: true,
sumType: true,
};
export const dicTaskTypeDesc = new Array<DicTaskType>();
export const taskDescByType = new Map<number, DicTaskType>();
export function loadTaskType() {
dicTaskTypeDesc.splice(0, dicTaskTypeDesc.length);
taskDescByType.clear();
let arr = readFileAndParse(FILENAME.DIC_TASK_TYPE);
arr.forEach(o => {
dicTaskTypeDesc.push(_.pick(o, Object.keys(DicTaskTypeKeys)));
taskDescByType.set(o.id, _.pick(o, Object.keys(DicTaskTypeKeys)));
});
arr = undefined;
}