feat: 통합 세력 장수/암행부 페이지 (#213)

- ag-grid 기반
- 컬럼 사용자 정의 기능 제공
  - 컬럼 재정렬, 고정, 정렬 기능
  - 컬럼 상태 저장, 불러오기
  - 마지막 컬럼 재 사용
- 아이콘, 장수명 클릭 시 특수 기능 제공
  - 기본 세력 장수/암행부에서는 '감찰부'
- 추가 컬럼
  - 최근 전투
  - 전투 수
  - 승리 수
  - 살상률
- API/Nation/GeneralList 추가

Co-authored-by: hide_d <hided62@gmail.com>
Reviewed-on: https://storage.hided.net/gitea/devsam/core/pulls/213
This commit is contained in:
2022-04-08 02:28:58 +09:00
parent c96f6d9381
commit a95b26551c
32 changed files with 3137 additions and 381 deletions
+14 -2
View File
@@ -20,7 +20,7 @@ use function sammo\prepareDir;
class GetConst extends \sammo\BaseAPI
{
/** 반환하는 StaticValues 타입이 달라지면 +1 */
const CONST_API_VERSION = 1;
const CONST_API_VERSION = 2;
const CACHE_KEY = 'JSConst';
private ?string $cacheKey = null;
@@ -109,7 +109,7 @@ class GetConst extends \sammo\BaseAPI
public function tryCache(): ?APICacheResult
{
if (is_subclass_of('\\sammo\\VersionGit', '\\sammo\VersionGitDynamic')) {
return new APICacheResult(TimeUtil::secondsToDateTime($this->findLastModified(), true, true));
return new APICacheResult(TimeUtil::secondsToDateTime($this->findLastModified()??\time(), true, true));
}
return new APICacheResult(null, $this->getCacheKey());
@@ -258,6 +258,18 @@ class GetConst extends \sammo\BaseAPI
$iActionInfo[$mappedKey] = $actionInfo;
}
$crewtypeMap = [];
foreach(GameUnitConst::all() as $crewtypeObj){
$crewtypeMap[$crewtypeObj->id] = [
'value'=>(string)$crewtypeObj->id,
'name'=>$crewtypeObj->name,
'info'=>$crewtypeObj->getInfo(),
];
}
$iActionInfo['crewtype'] = $crewtypeMap;
return [
'gameConst' => get_class_vars('\sammo\GameConst'),
'gameUnitConst' => GameUnitConst::all(),