feat(wip): 권한으로 볼 수 없는 항목을 명확히
This commit is contained in:
@@ -37,7 +37,13 @@
|
||||
:checked="col.isVisible()"
|
||||
@change.stop="toggleColumn(colID, col)"
|
||||
/>
|
||||
<label class="form-check-label" :for="`column-type-${colID}`">
|
||||
<label
|
||||
class="form-check-label"
|
||||
:for="`column-type-${colID}`"
|
||||
:style="{
|
||||
textDecoration: validColumns.has(colID) ? undefined : 'line-through',
|
||||
}"
|
||||
>
|
||||
{{ col.getColDef().headerName }}
|
||||
</label>
|
||||
</div></BDropdownItem
|
||||
@@ -132,9 +138,18 @@ const props = defineProps({
|
||||
const suppressColumnMoveAnimation = ref(true);
|
||||
const gameConstStore = unwrap(inject<Ref<GameConstStore>>("gameConstStore"));
|
||||
|
||||
const validColumns = ref(new Set<string>());
|
||||
|
||||
watch(
|
||||
() => props.list,
|
||||
() => {
|
||||
(newValue) => {
|
||||
const newValidColumns = new Set<string>(['icon']);
|
||||
if (newValue.length > 0) {
|
||||
for (const key of Object.keys(newValue[0])) {
|
||||
newValidColumns.add(key);
|
||||
}
|
||||
validColumns.value = newValidColumns;
|
||||
}
|
||||
setTimeout(() => {
|
||||
gridApi.value?.redrawRows();
|
||||
}, 0);
|
||||
@@ -384,7 +399,7 @@ function numberFormatter(unit?: string) {
|
||||
if (unit) {
|
||||
return (value: GenValueParams): string => {
|
||||
if (value.value == null) {
|
||||
return "-";
|
||||
return "?";
|
||||
}
|
||||
const valueText = (value.value as number).toLocaleString();
|
||||
return `${valueText} ${unit}`;
|
||||
@@ -647,7 +662,7 @@ const columnRawDefs = ref<Partial<Record<headerType, GenColDef | GenColGroupDef>
|
||||
field: "city",
|
||||
valueGetter: ({ data }) => {
|
||||
if (!data.st2) {
|
||||
return "-";
|
||||
return "?";
|
||||
}
|
||||
return gameConstStore.value.cityConst[data.city].name;
|
||||
},
|
||||
@@ -656,7 +671,7 @@ const columnRawDefs = ref<Partial<Record<headerType, GenColDef | GenColGroupDef>
|
||||
width: 60,
|
||||
filterValueGetter: ({ data }) => {
|
||||
if (!data.st2) {
|
||||
return "-";
|
||||
return "";
|
||||
}
|
||||
return convertSearch초성(gameConstStore.value.cityConst[data.city].name);
|
||||
},
|
||||
@@ -666,6 +681,9 @@ const columnRawDefs = ref<Partial<Record<headerType, GenColDef | GenColGroupDef>
|
||||
headerName: "부대",
|
||||
field: "troop",
|
||||
valueGetter: ({ data }: GenValueGetterParams) => {
|
||||
if(!data.st2){
|
||||
return '?';
|
||||
}
|
||||
const troopInfo = extractTroopInfo(data);
|
||||
if (troopInfo === undefined) {
|
||||
return "-";
|
||||
@@ -740,7 +758,7 @@ const columnRawDefs = ref<Partial<Record<headerType, GenColDef | GenColGroupDef>
|
||||
filter: true,
|
||||
filterValueGetter: ({ data }) => {
|
||||
if (!data.st2) {
|
||||
return "-";
|
||||
return "?";
|
||||
}
|
||||
const name = gameConstStore.value.iActionInfo.crewtype[data.crewtype].name;
|
||||
return convertSearch초성(name);
|
||||
@@ -933,7 +951,7 @@ const columnRawDefs = ref<Partial<Record<headerType, GenColDef | GenColGroupDef>
|
||||
width: 60,
|
||||
valueFormatter: ({ value, data }) => {
|
||||
if (!data.st2) {
|
||||
return "-";
|
||||
return "?";
|
||||
}
|
||||
const turntime = value as string;
|
||||
return turntime.substring(14, 19);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div>
|
||||
<div v-for="(rowValue, rowIdx) in props.params.cells" :key="rowIdx" class="row gx-1 m-0 cell-sp">
|
||||
<template v-for="colValue of rowValue" :key="colValue.target">
|
||||
<div v-if="params.data[colValue.target] == null">-</div>
|
||||
<div v-if="params.data[colValue.target] == null">?</div>
|
||||
<div
|
||||
v-else-if="colValue.iActionMap"
|
||||
v-b-tooltip.hover
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<span v-if="props.params.value == null">-</span>
|
||||
<span v-if="props.params.value == null">?</span>
|
||||
<span v-else-if="params.iActionMap" v-b-tooltip.hover :title="params.iActionMap[props.params.value].info ?? ''">{{
|
||||
params.iActionMap[props.params.value].name
|
||||
}}</span>
|
||||
|
||||
Reference in New Issue
Block a user