feat(wip): 세력장수에서 암행부, 랭크 값 모두 불러옴

This commit is contained in:
2022-04-07 03:03:38 +09:00
parent 09fb96d9b3
commit c104fbcf58
5 changed files with 207 additions and 117 deletions
+5 -19
View File
@@ -19,7 +19,7 @@
</template>
<script lang="ts"></script>
<script lang="ts" setup>
import type { GeneralListItem, GeneralListItemP2 } from "@/defs/API/Nation";
import type { GeneralListItem, GeneralListItemP2, GeneralListResponse } from "@/defs/API/Nation";
import { getIconPath } from "@/util/getIconPath";
import { inject, ref, watch, type PropType, type Ref, type StyleValue } from "vue";
import { AgGridVue } from "ag-grid-vue3";
@@ -52,20 +52,20 @@ const props = defineProps({
required: false,
default: "static",
},
env: {
type: Object as PropType<GeneralListResponse['env']>,
required: true,
}
});
const gameConstStore = unwrap(inject<Ref<GameConstStore>>("gameConstStore"));
const iActionInfo = gameConstStore.value.iActionInfo;
console.log(iActionInfo);
//debug
console.log(`list`, props.list);
watch(
() => props.list,
() => {
setTimeout(() => {
//debug
console.log(`list`, props.list);
gridApi.value?.redrawRows();
}, 0);
}
@@ -155,20 +155,6 @@ type GridCellInfo = {
target: keyof GeneralListItem;
};
function naiveCheClassNameFilter(value: string): string {
const text = value.split("_").pop() ?? "None";
if (text === "None") {
return "-";
}
return text;
}
function naiveCheClassNameFilterFromRow(key: keyof GeneralListItem) {
return (value: GenValueParams): string => {
return naiveCheClassNameFilter(value.data[key]?.toString() ?? "None");
};
}
function numberFormatter(value: GenValueParams): string {
return (value.value as number).toLocaleString();
}