后台:添加查询taskType
This commit is contained in:
@@ -437,7 +437,8 @@ export const FILENAME = {
|
||||
DIC_GIFT_PACKAGE: 'dic_zyz_giftPackage',
|
||||
DIC_RECRUIT: 'dic_zyz_recruit',
|
||||
DIC_RMB: 'dic_zyz_rmb',
|
||||
DIC_ACTIVITY_TYPE: 'dic_zyz_activityType'
|
||||
DIC_ACTIVITY_TYPE: 'dic_zyz_activityType',
|
||||
DIC_TASK_TYPE: 'dic_zyz_taskType'
|
||||
}
|
||||
|
||||
export const WAR_RELATE_TABLES = [
|
||||
|
||||
@@ -83,6 +83,7 @@ import { dicGiftPackage, loadGiftPackage } from "./dictionary/DicGiftPackage";
|
||||
import { dicRecruit, loadRecruit } from './dictionary/DicRecruit';
|
||||
import { loadRMB, dicRMB } from './dictionary/DicRMB';
|
||||
import { dicActivityType, loadActivityType } from './dictionary/DicActivityType';
|
||||
import { dicTaskTypeDesc, loadTaskType } from './dictionary/DicTaskType';
|
||||
|
||||
export const gameData = {
|
||||
blurprtCompose: dicBlueprtCompose,
|
||||
@@ -202,7 +203,8 @@ export const gameData = {
|
||||
comBtlLvRange: new Map<number, Array<number>>(),
|
||||
recruit: dicRecruit,
|
||||
rmb: dicRMB,
|
||||
activityType: dicActivityType
|
||||
activityType: dicActivityType,
|
||||
taskTypeDesc: dicTaskTypeDesc
|
||||
};
|
||||
|
||||
// 在此提供一些原先在gamedata中提供的方法,以便更方便获取gameData数据
|
||||
@@ -762,6 +764,7 @@ function loadDatas() {
|
||||
loadRecruit();
|
||||
loadRMB();
|
||||
loadActivityType();
|
||||
loadTaskType();
|
||||
}
|
||||
|
||||
// 重载dicParam
|
||||
|
||||
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