后台:添加查询taskType
This commit is contained in:
34
shared/pubUtils/dictionary/DicTaskType.ts
Normal file
34
shared/pubUtils/dictionary/DicTaskType.ts
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user