Compare commits

...

3 Commits

Author SHA1 Message Date
Lei OT 106a06e03b 2.3.10 2 weeks ago
Lei OT 0ab72e43eb perf: 人等的显示 2 weeks ago
LiaoYijun 15d30b0154 2.3.9 2 months ago

@ -1,7 +1,7 @@
{ {
"name": "global-highlights-hub", "name": "global-highlights-hub",
"private": true, "private": true,
"version": "2.3.8", "version": "2.3.10",
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",

@ -210,6 +210,13 @@ export const PackageTypes = [
]; ];
export const formatGroupSize = (min, max, suffix = false) => { export const formatGroupSize = (min, max, suffix = false) => {
const minSize = min === 0 ? 1 : min;
// const rangeStr = max === min ? `${minSize}` : `${minSize}-${max}`;
const rangeStr = `${minSize}-${max}`;
return max === 1000 ? minSize <= 1 ? '不分人等' : `${minSize}人以上` : (`${rangeStr}`+(suffix ? '人' : ''));
};
export const formatGroupSizeRender = (min, max, suffix = false) => {
const minSize = min === 0 ? 1 : min; const minSize = min === 0 ? 1 : min;
const rangeStr = max === min ? `${minSize}` : `${minSize}-${max}`; const rangeStr = max === min ? `${minSize}` : `${minSize}-${max}`;
return max === 1000 ? minSize <= 1 ? '不分人等' : `${minSize}人以上` : (`${rangeStr}`+(suffix ? '人' : '')); return max === 1000 ? minSize <= 1 ? '不分人等' : `${minSize}人以上` : (`${rangeStr}`+(suffix ? '人' : ''));

@ -30,7 +30,7 @@ import dayjs from "dayjs";
import useProductsStore from "@/stores/Products/Index"; import useProductsStore from "@/stores/Products/Index";
import useAuthStore from '@/stores/Auth' import useAuthStore from '@/stores/Auth'
import PriceCompactInput from "@/views/products/Detail/PriceCompactInput"; import PriceCompactInput from "@/views/products/Detail/PriceCompactInput";
import { formatGroupSize } from "@/hooks/useProductsSets"; import { formatGroupSize, formatGroupSizeRender } from "@/hooks/useProductsSets";
const { RangePicker } = DatePicker; const { RangePicker } = DatePicker;
@ -259,7 +259,7 @@ const ProductInfoQuotation = ({ editable, ...props }) => {
dataIndex: "group_size", dataIndex: "group_size",
width: "6rem", width: "6rem",
render: (_, record) => render: (_, record) =>
formatGroupSize(record.group_size_min, record.group_size_max), formatGroupSizeRender(record.group_size_min, record.group_size_max),
}, },
{ {

@ -3,7 +3,7 @@ import { useParams, Link } from 'react-router-dom';
import { Button, Drawer, Card, Table } from 'antd'; import { Button, Drawer, Card, Table } from 'antd';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import useProductsStore, { getAgencyAllExtrasAction } from '@/stores/Products/Index'; import useProductsStore, { getAgencyAllExtrasAction } from '@/stores/Products/Index';
import { useProductsTypes, formatGroupSize, useProductsTypesMapVal } from '@/hooks/useProductsSets'; import { useProductsTypes, formatGroupSize, useProductsTypesMapVal, formatGroupSizeRender } from '@/hooks/useProductsSets';
import { chunkBy, splitTable_6, splitTable_7, splitTable_8, splitTable_B, splitTable_D, splitTable_J, splitTable_Q, splitTable_R } from '@/hooks/useProductsQuotationFormat'; import { chunkBy, splitTable_6, splitTable_7, splitTable_8, splitTable_B, splitTable_D, splitTable_J, splitTable_Q, splitTable_R } from '@/hooks/useProductsQuotationFormat';
import { groupBy, isNotEmpty } from '@haina/utils-commons'; import { groupBy, isNotEmpty } from '@haina/utils-commons';
import useAuthStore from '@/stores/Auth'; import useAuthStore from '@/stores/Auth';
@ -259,7 +259,7 @@ const AgencyPreview = ({ params, ...props }) => {
), ),
}, },
...cols.map((col) => ({ ...cols.map((col) => ({
title: formatGroupSize(...col), title: formatGroupSizeRender(...col),
// dataIndex: [formatGroupSize(...col), 'adult_cost'], // dataIndex: [formatGroupSize(...col), 'adult_cost'],
key: col[0], key: col[0],
children: [ children: [
@ -378,7 +378,7 @@ const AgencyPreview = ({ params, ...props }) => {
), ),
}, },
...cols.map((col) => ({ ...cols.map((col) => ({
title: formatGroupSize(...col), title: formatGroupSizeRender(...col),
// dataIndex: [formatGroupSize(...col), 'adult_cost'], // dataIndex: [formatGroupSize(...col), 'adult_cost'],
key: col[0], key: col[0],
children: [ children: [
@ -502,7 +502,7 @@ const AgencyPreview = ({ params, ...props }) => {
), ),
}, },
...cols.map((col) => ({ ...cols.map((col) => ({
title: formatGroupSize(...col), title: formatGroupSizeRender(...col),
// dataIndex: [formatGroupSize(...col), 'adult_cost'], // dataIndex: [formatGroupSize(...col), 'adult_cost'],
key: col[0], key: col[0],
// children1: [ // children1: [
@ -965,7 +965,7 @@ const AgencyPreview = ({ params, ...props }) => {
), ),
}, },
...cols.map((col) => ({ ...cols.map((col) => ({
title: formatGroupSize(...col), title: formatGroupSizeRender(...col),
// dataIndex: [formatGroupSize(...col), 'adult_cost'], // dataIndex: [formatGroupSize(...col), 'adult_cost'],
key: col[0], key: col[0],
children: [ children: [
@ -1100,7 +1100,7 @@ const AgencyPreview = ({ params, ...props }) => {
), ),
}, },
...cols.map((col) => ({ ...cols.map((col) => ({
title: formatGroupSize(...col), title: formatGroupSizeRender(...col),
// dataIndex: [formatGroupSize(...col), 'adult_cost'], // dataIndex: [formatGroupSize(...col), 'adult_cost'],
key: col[0], key: col[0],
children: [ children: [

Loading…
Cancel
Save