后台:添加查询taskType

This commit is contained in:
luying
2021-06-04 11:01:58 +08:00
parent 95621b827e
commit f77de8eb78
6 changed files with 55 additions and 2 deletions

View File

@@ -0,0 +1,34 @@
import { readFileAndParse } from '../util'
import { FILENAME, TASK_TYPE } from '../../consts'
type KeysEnum<T> = { [P in keyof Required<T>]: true };
const _ = require('lodash');
export interface DicTaskType {
readonly id: TASK_TYPE;
// 分类
readonly name: string;
// 描述
readonly info: string;
// taskParam怎么填
readonly param: string;
// condition怎么填
readonly condition: string;
}
const DicTaskTypeKeys: KeysEnum<DicTaskType> = {
id: true,
name: true,
info: true,
param: true,
condition: true
};
export const dicTaskTypeDesc = new Array<DicTaskType>();
export function loadTaskType() {
let arr = readFileAndParse(FILENAME.DIC_TASK_TYPE);
arr.forEach(o => {
dicTaskTypeDesc.push(_.pick(o, Object.keys(DicTaskTypeKeys)));
});
arr = undefined;
}