Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion apps/web/src/common/pages/CostReportDetailPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,6 @@ const fetchReportData = async () => {
const fetchAnalyzeData = async (_groupBy: string[], fieldGroup?: string[]):Promise<AnalyzeResponse<CostReportDataAnalyzeResult>|undefined> => {
try {
return await SpaceConnector.clientV2.costAnalysis.costReportData.analyze<CostReportDataAnalyzeParameters, AnalyzeResponse<CostReportDataAnalyzeResult>>({
is_confirmed: true,
query: {
group_by: _groupBy,
fields: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {

import dayjs from 'dayjs';

import { makeDistinctValueHandler } from '@cloudforet/core-lib/component-util/query-search';
import { makeDistinctValueHandler, makeReferenceValueHandler } from '@cloudforet/core-lib/component-util/query-search';
import { setApiQueryWithToolboxOptions } from '@cloudforet/core-lib/component-util/toolbox';
import type { ConsoleFilter } from '@cloudforet/core-lib/query/type';
import { ApiQueryHelper } from '@cloudforet/core-lib/space-connector/helper';
Expand All @@ -20,6 +20,8 @@ import { i18n } from '@/translations';
import { useAppContextStore } from '@/store/app-context/app-context-store';
import { CURRENCY_SYMBOL } from '@/store/display/constant';
import type { Currency } from '@/store/display/type';
import { useAllReferenceStore } from '@/store/reference/all-reference-store';
import type { WorkspaceReferenceMap } from '@/store/reference/workspace-reference-store';

import { copyAnyData } from '@/lib/helper/copy-helper';
import { currencyMoneyFormatter } from '@/lib/helper/currency-helper';
Expand All @@ -33,10 +35,14 @@ import CostReportResendModal from '@/services/cost-explorer/components/CostRepor
import { useCostReportPageStore } from '@/services/cost-explorer/stores/cost-report-page-store';


const allReferenceStore = useAllReferenceStore();
const costReportPageStore = useCostReportPageStore();
const costReportPageState = costReportPageStore.state;
const appContextStore = useAppContextStore();

const isAdminMode = computed<boolean>(() => appContextStore.getters.isAdminMode);
const workspaces = computed<WorkspaceReferenceMap>(() => allReferenceStore.getters.workspace);

const state = reactive({
currency: computed(() => costReportPageState.costReportConfig?.currency || 'KRW' as Currency),
periodMenuItems: computed<MenuItem[]>(() => {
Expand All @@ -63,7 +69,7 @@ const tableState = reactive({
field: [
{ label: 'Issue Date', name: 'issue_date' },
{ label: 'Report Number', name: 'report_number' },
{ label: 'Workspace', name: 'workspace_name' },
...(isAdminMode.value ? [{ label: 'Workspace', name: 'workspace_id' }] : []),
{ label: 'Cost', name: 'cost', textAlign: 'right' },
{ label: ' ', name: 'extra' },
],
Expand All @@ -73,16 +79,16 @@ const tableState = reactive({
items: [
{ name: 'issue_date', label: 'Issue Date' },
{ name: 'report_number', label: 'Report Number' },
{ name: 'workspace_name', label: 'Workspace' },
{ name: 'workspace_id', label: 'Workspace' },
],
}] as KeyItemSet[],
valueHandlerMap: {
issue_date: makeDistinctValueHandler('cost_analysis.CostReport', 'issue_date', 'string', [{ k: 'status', v: 'SUCCESS', o: 'eq' }]),
report_number: makeDistinctValueHandler('cost_analysis.CostReport', 'report_number', 'string', [{ k: 'status', v: 'SUCCESS', o: 'eq' }]),
workspace_name: makeDistinctValueHandler('cost_analysis.CostReport', 'workspace_name', 'string', [{ k: 'status', v: 'SUCCESS', o: 'eq' }]),
workspace_id: makeReferenceValueHandler('identity.Workspace'),
},
});
const isAdminMode = computed<boolean>(() => appContextStore.getters.isAdminMode);



const costReportListApiQueryHelper = new ApiQueryHelper()
Expand Down Expand Up @@ -251,6 +257,9 @@ watch(() => costReportPageState.activeTab, (activeTab) => {
</template>
</p-heading-layout>
</template>
<template #col-workspace_id-format="{value}">
{{ workspaces[value]?.name || value }}
</template>
<template #col-issue_date-format="{value}">
<div class="date-text">
{{ value }}
Expand Down
Loading