后台:活动类型表

This commit is contained in:
luying
2021-06-17 17:19:51 +08:00
parent 703a128811
commit 46595fcbed
10 changed files with 194 additions and 21 deletions

View File

@@ -84,6 +84,7 @@ import { dicRecruit, loadRecruit } from './dictionary/DicRecruit';
import { loadRMB, dicRMB } from './dictionary/DicRMB';
import { dicActivityType, loadActivityType } from './dictionary/DicActivityType';
import { dicTaskTypeDesc, loadTaskType } from './dictionary/DicTaskType';
import { dicServerName, dicServerGroupName, loadServerName } from "./dictionary/DicServerName";
export const gameData = {
blurprtCompose: dicBlueprtCompose,
@@ -204,7 +205,9 @@ export const gameData = {
recruit: dicRecruit,
rmb: dicRMB,
activityType: dicActivityType,
taskTypeDesc: dicTaskTypeDesc
taskTypeDesc: dicTaskTypeDesc,
serverNames: dicServerName,
serverGroupNames: dicServerGroupName,
};
// 在此提供一些原先在gamedata中提供的方法以便更方便获取gameData数据
@@ -668,6 +671,36 @@ function getHeroTransPiece() {
gameData.heroTransPiece = newMap
}
// 根据groupId获得当前大区名
export function getServerGroupName(groupId: number) {
let name = gameData.serverGroupNames.get(groupId);
if(!name) {
let maxId = 0;
gameData.serverGroupNames.forEach((gname, id) => {
if(id > maxId) {
maxId = id;
name = gname;
}
})
}
return name;
}
// 根据服务器id获得当前大区名
export function getServerName(id: number) {
let name = gameData.serverNames.get(id);
if(!name) {
let maxId = 0;
gameData.serverNames.forEach((sname, id) => {
if(id > maxId) {
maxId = id;
name = sname;
}
})
}
return name;
}
// 初始加载
function initDatas() {
parseDicParam();
@@ -765,6 +798,7 @@ function loadDatas() {
loadRMB();
loadActivityType();
loadTaskType();
loadServerName();
}
// 重载dicParam