fix,refac: 권한 부족의 경우 '-'을 잘 띄우도록

This commit is contained in:
2022-04-08 00:55:13 +09:00
parent 152fdf7143
commit 660c88975c
5 changed files with 46 additions and 37 deletions
+10 -6
View File
@@ -2,16 +2,22 @@
<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="colValue.iActionMap"
v-else-if="colValue.iActionMap"
v-b-tooltip.hover
class="col"
:title="colValue.iActionMap[params.data[colValue.target] as string ].info??''"
>
{{ colValue.iActionMap[params.data[colValue.target] as string ].name }}
</div>
<div v-else-if="colValue.converter" v-b-tooltip.hover class="col" :title="colValue.converter(params.data)[1] ?? ''">
{{colValue.converter(params.data)[0]}}
<div
v-else-if="colValue.converter"
v-b-tooltip.hover
class="col"
:title="colValue.converter(params.data)[1] ?? ''"
>
{{ colValue.converter(params.data)[0] }}
</div>
<div v-else v-b-tooltip.hover class="col" :title="colValue.info ?? ''">
{{params.data[colValue.target] as string}}
@@ -30,7 +36,7 @@ import type { CellClassParams } from "ag-grid-community";
export type GridCellInfo = {
iActionMap?: Record<string, GameIActionInfo>;
info?: string;
converter?: (value: GeneralListItemP2)=>[string, string?],
converter?: (value: GeneralListItemP2) => [string, string?];
target: keyof GeneralListItemP2;
};
</script>
@@ -40,8 +46,6 @@ interface GenCellClassParams extends CellClassParams {
data: GeneralListItemP2;
}
const props = defineProps({
params: {
type: Object as PropType<
@@ -1,5 +1,8 @@
<template>
<span v-if="params.iActionMap" v-b-tooltip.hover :title="params.iActionMap[props.params.value].info??''">{{ params.iActionMap[props.params.value].name }}</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>
<span v-else-if="params.info" v-b-tooltip.hover :title="params.info">{{ displayValue }}</span>
<span v-else>{{ displayValue }}</span>
</template>
@@ -15,7 +18,7 @@ const props = defineProps({
type: Object as PropType<
ValueFormatterParams & {
info?: string;
iActionMap?: Record<string, GameIActionInfo>
iActionMap?: Record<string, GameIActionInfo>;
}
>,
required: true,