fix: 차이점 채움
This commit is contained in:
@@ -9,11 +9,11 @@ use sammo\Validator;
|
|||||||
use function sammo\checkLimit;
|
use function sammo\checkLimit;
|
||||||
use function sammo\checkSecretPermission;
|
use function sammo\checkSecretPermission;
|
||||||
use function sammo\getBattleDetailLogMore;
|
use function sammo\getBattleDetailLogMore;
|
||||||
|
use function sammo\getBattleDetailLogRecent;
|
||||||
use function sammo\getBattleResultMore;
|
use function sammo\getBattleResultMore;
|
||||||
use function sammo\getBattleResultRecent;
|
use function sammo\getBattleResultRecent;
|
||||||
use function sammo\getGeneralActionLogMore;
|
use function sammo\getGeneralActionLogMore;
|
||||||
use function sammo\getGeneralActionLogRecent;
|
use function sammo\getGeneralActionLogRecent;
|
||||||
use function sammo\getGeneralHistoryLogAll;
|
|
||||||
use function sammo\getGeneralHistoryLogWithLogID;
|
use function sammo\getGeneralHistoryLogWithLogID;
|
||||||
|
|
||||||
class GetGeneralLog extends \sammo\BaseAPI
|
class GetGeneralLog extends \sammo\BaseAPI
|
||||||
@@ -157,7 +157,7 @@ class GetGeneralLog extends \sammo\BaseAPI
|
|||||||
'reqType' => $reqType,
|
'reqType' => $reqType,
|
||||||
'generalID' => $targetGeneralID,
|
'generalID' => $targetGeneralID,
|
||||||
'log' => $reqTo === null
|
'log' => $reqTo === null
|
||||||
? getBattleResultRecent($targetGeneralID, 30)
|
? getBattleDetailLogRecent($targetGeneralID, 30)
|
||||||
: getBattleDetailLogMore($targetGeneralID, $reqTo, 30)
|
: getBattleDetailLogMore($targetGeneralID, $reqTo, 30)
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,11 @@
|
|||||||
<div class="row gx-0">
|
<div class="row gx-0">
|
||||||
<div class="col-4">
|
<div class="col-4">
|
||||||
<BFormSelect v-model="orderBy">
|
<BFormSelect v-model="orderBy">
|
||||||
<BFormSelectOption v-for="[orderKey, [orderName, ]] of Object.entries(textMap)" :key="orderKey" :value="orderKey">
|
<BFormSelectOption
|
||||||
|
v-for="[orderKey, [orderName]] of Object.entries(textMap)"
|
||||||
|
:key="orderKey"
|
||||||
|
:value="orderKey"
|
||||||
|
>
|
||||||
{{ orderName }}
|
{{ orderName }}
|
||||||
</BFormSelectOption>
|
</BFormSelectOption>
|
||||||
</BFormSelect>
|
</BFormSelect>
|
||||||
@@ -17,7 +21,9 @@
|
|||||||
:style="{
|
:style="{
|
||||||
color: getNpcColor(general.npc),
|
color: getNpcColor(general.npc),
|
||||||
}"
|
}"
|
||||||
>{{ general.name }}({{ general.turntime.slice(-5) }}){{ textMap[orderBy][3](general) }}</span
|
>{{ general.officerLevel > 5 ? `*${general.name}*` : general.name }}({{ general.turntime.slice(-5) }}){{
|
||||||
|
textMap[orderBy][3](general)
|
||||||
|
}}</span
|
||||||
>
|
>
|
||||||
</BFormSelectOption>
|
</BFormSelectOption>
|
||||||
</BFormSelect>
|
</BFormSelect>
|
||||||
@@ -82,10 +88,15 @@ const toasts = unwrap(useToast());
|
|||||||
|
|
||||||
const generalList = ref(new Map<number, GeneralListItemP1>());
|
const generalList = ref(new Map<number, GeneralListItemP1>());
|
||||||
const textMap = {
|
const textMap = {
|
||||||
recent_war: ["최근 전투", (gen: GeneralListItemP1) => gen.recent_war, false, (gen: GeneralListItemP1) => `[${gen.recent_war.slice(-5)}]`],
|
recent_war: [
|
||||||
|
"최근 전투",
|
||||||
|
(gen: GeneralListItemP1) => gen.recent_war,
|
||||||
|
false,
|
||||||
|
(gen: GeneralListItemP1) => `[${gen.recent_war.slice(-5)}]`,
|
||||||
|
],
|
||||||
warnum: ["전투 횟수", (gen: GeneralListItemP1) => gen.warnum, false, (gen: GeneralListItemP1) => `[${gen.warnum}회]`],
|
warnum: ["전투 횟수", (gen: GeneralListItemP1) => gen.warnum, false, (gen: GeneralListItemP1) => `[${gen.warnum}회]`],
|
||||||
turntime: ["최근 턴", (gen: GeneralListItemP1) => gen.turntime, false, (gen: GeneralListItemP1) => ''],
|
turntime: ["최근 턴", (gen: GeneralListItemP1) => gen.turntime, false, (gen: GeneralListItemP1) => ""],
|
||||||
name: ["이름", (gen: GeneralListItemP1) => `${gen.npc} ${gen.name}`, false, (gen: GeneralListItemP1) => ''],
|
name: ["이름", (gen: GeneralListItemP1) => `${gen.npc} ${gen.name}`, false, (gen: GeneralListItemP1) => ""],
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
const orderedGeneralList = ref<GeneralListItemP1[]>([]);
|
const orderedGeneralList = ref<GeneralListItemP1[]>([]);
|
||||||
@@ -102,10 +113,10 @@ const targetGeneralLogs = ref<GeneralLogs>();
|
|||||||
const nationInfo = ref<NationStaticItem>();
|
const nationInfo = ref<NationStaticItem>();
|
||||||
|
|
||||||
watch([generalList, targetGeneralID], async ([generalList, targetGeneralID]) => {
|
watch([generalList, targetGeneralID], async ([generalList, targetGeneralID]) => {
|
||||||
if (targetGeneralID === undefined){
|
if (targetGeneralID === undefined) {
|
||||||
targetGeneral.value = undefined;
|
targetGeneral.value = undefined;
|
||||||
return;
|
return;
|
||||||
};
|
}
|
||||||
targetGeneral.value = generalList.get(targetGeneralID);
|
targetGeneral.value = generalList.get(targetGeneralID);
|
||||||
|
|
||||||
const logs: GeneralLogs = {
|
const logs: GeneralLogs = {
|
||||||
@@ -149,13 +160,13 @@ watch([generalList, targetGeneralID], async ([generalList, targetGeneralID]) =>
|
|||||||
watch([generalList, orderBy], ([generalList, orderBy], [, oldOrderBy]) => {
|
watch([generalList, orderBy], ([generalList, orderBy], [, oldOrderBy]) => {
|
||||||
console.log(generalList);
|
console.log(generalList);
|
||||||
const list = Array.from(generalList.values());
|
const list = Array.from(generalList.values());
|
||||||
if(orderBy != oldOrderBy){
|
if (orderBy != oldOrderBy) {
|
||||||
targetGeneralID.value = undefined;
|
targetGeneralID.value = undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
const idSet = new Set<number>(list.map((gen) => gen.no));
|
const idSet = new Set<number>(list.map((gen) => gen.no));
|
||||||
list.sort((a, b) => {
|
list.sort((a, b) => {
|
||||||
const [, getter, isAsc, ] = textMap[orderBy];
|
const [, getter, isAsc] = textMap[orderBy];
|
||||||
const aVal = getter(a);
|
const aVal = getter(a);
|
||||||
const bVal = getter(b);
|
const bVal = getter(b);
|
||||||
if (aVal === bVal) return 0;
|
if (aVal === bVal) return 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user