feat(wip): 권한으로 볼 수 없는 항목을 명확히

This commit is contained in:
2022-04-08 01:11:45 +09:00
parent 660c88975c
commit 3b887598da
3 changed files with 27 additions and 9 deletions
+25 -7
View File
@@ -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);