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