Commit 4eaaba23 authored by 王玉鑫's avatar 王玉鑫

feat: 详情页建设周期格式化修正

parent 58de4fb5
......@@ -45,6 +45,7 @@ export interface Info {
isFile?: boolean;
/** 文件名 */
fileName?: string;
format?: (value: any) => string;
}
export type Infos = Info[][] | [];
withDefaults(
......@@ -57,8 +58,8 @@ withDefaults(
);
const handleValue = (col: Info) => {
const { value, unit = '' } = col;
return haveValue(value) ? formatNumber(value) + unit : '--';
const { value, unit = '', format = formatNumber } = col;
return haveValue(value) ? format(value) + unit : '--';
};
const getValueClass = (col: Info, line: Info[]) => {
......
import type { Infos } from '@/components/detail/DetailInfo.vue';
import { computed, type ComputedRef } from 'vue';
import { identity } from 'lodash-es';
export interface JoinRequiredParams {
[index: string]: any;
......@@ -81,6 +82,7 @@ export function useJoinRequired<T extends JoinRequiredParams>(
name: '建设周期',
value: buildingPeriod,
unit: '月',
format: identity,
},
{
name: '能评要求',
......
......@@ -137,6 +137,7 @@ import { useJump } from '@/composable/useJump.ts';
import { RouteName } from '@/router/router.ts';
import { useIndustryBase } from '@/composable/useIndustryBase.ts';
import { handleNoAuth } from '@/utils/tools.ts';
import { identity } from 'lodash-es';
const { detail, initDetail } = useDetail<MyParkDevelopDetailResp>(RequestUrl.myParkDevelopDetail);
const { router } = useJump();
......@@ -271,6 +272,7 @@ const joinRequired = computed(() => {
name: '建设周期',
value: buildingPeriod,
unit: '月',
format: identity,
},
{
name: '能评要求',
......
......@@ -139,6 +139,7 @@ import { useJump } from '@/composable/useJump.ts';
import { RouteName } from '@/router/router.ts';
import { useIndustryBase } from '@/composable/useIndustryBase.ts';
import { handleNoAuth } from '@/utils/tools.ts';
import { identity } from 'lodash-es';
const { detail, initDetail } = useDetail<MyParkIndustrialDetailResp>(
RequestUrl.myParkIndustrialDetail,
......@@ -296,6 +297,7 @@ const joinRequired = computed(() => {
name: '建设周期',
value: buildingPeriod,
unit: '月',
format: identity,
},
{
name: '其他入驻要求',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment