@@ -267,8 +271,63 @@ const AgencyPreview = ({ params, ...props }) => {
// dataIndex: [formatGroupSize(...col), 'adult_cost'],
key: col[0],
children: [
- { title: '成人', dataIndex: [formatGroupSize(...col), 'adult_cost'], key: 'adult_cost', width: '4rem' },
- { title: '儿童', dataIndex: [formatGroupSize(...col), 'child_cost'], key: 'child_cost', width: '4rem' },
+ {
+ title: '成人',
+ dataIndex: [formatGroupSize(...col), 'adult_cost'],
+ key: 'adult_cost',
+ width: '4rem',
+ onCell: (r, ) => {
+ const text = r[formatGroupSize(...col)]?.adult_cost
+ const _warning = r.info?.isCityRow !== true
+ && text
+ && r[formatGroupSize(...col)]?.unit_id !== '1';
+ // && r[formatGroupSize(...col)]?.unit_id !== r.unit_id;
+
+ return { className: _warning ? 'bg-yellow-100' : '' };
+ },
+ render: (text, r) => {
+ const _warning = r.info?.isCityRow !== true && text
+ && r[formatGroupSize(...col)]?.unit_id !== '1';
+ // && r[formatGroupSize(...col)]?.unit_id !== r.unit_id;
+
+ return {
+ children: (
+ <>
+ {text}
+ {_warning ? ` /${r[formatGroupSize(...col)].unit_name}` : ''}
+ >
+ ),
+ };
+ },
+ },
+ {
+ title: '儿童',
+ dataIndex: [formatGroupSize(...col), 'child_cost'],
+ key: 'child_cost',
+ width: '4rem',
+ onCell: (r, ) => {
+ const text = r[formatGroupSize(...col)]?.child_cost
+ const _warning = r.info?.isCityRow !== true
+ && text
+ && r[formatGroupSize(...col)]?.unit_id !== '1';
+ // && r[formatGroupSize(...col)]?.unit_id !== r.unit_id;
+
+ return { className: _warning ? 'bg-yellow-100' : '' };
+ },
+ render: (text, r) => {
+ const _warning = r.info?.isCityRow !== true && text
+ && r[formatGroupSize(...col)]?.unit_id !== '1';
+ // && r[formatGroupSize(...col)]?.unit_id !== r.unit_id;
+ return {
+ children: (
+ <>
+ {text}
+ {_warning ? ` /${r[formatGroupSize(...col)].unit_name}` : ''}
+ >
+ ),
+ };
+ },
+ },
],
})),
]}
@@ -338,10 +397,68 @@ const AgencyPreview = ({ params, ...props }) => {
title: formatGroupSize(...col),
// dataIndex: [formatGroupSize(...col), 'adult_cost'],
key: col[0],
+ // children1: [
+ // { title: '成人', dataIndex: [formatGroupSize(...col), 'adult_cost'], key: 'adult_cost' },
+ // { title: '儿童', dataIndex: [formatGroupSize(...col), 'child_cost'], key: 'child_cost' },
+ // ],
children: [
- { title: '成人', dataIndex: [formatGroupSize(...col), 'adult_cost'], key: 'adult_cost' },
- { title: '儿童', dataIndex: [formatGroupSize(...col), 'child_cost'], key: 'child_cost' },
- ],
+ {
+ title: '成人',
+ dataIndex: [formatGroupSize(...col), 'adult_cost'],
+ key: 'adult_cost',
+ width: '4rem',
+ onCell: (r, ) => {
+ const text = r[formatGroupSize(...col)]?.adult_cost
+ const _warning = r.info?.isCityRow !== true
+ && text
+ && r[formatGroupSize(...col)]?.unit_id !== '1';
+ // && r[formatGroupSize(...col)]?.unit_id !== r.unit_id;
+
+ return { className: _warning ? 'bg-yellow-100' : '' };
+ },
+ render: (text, r) => {
+ const _warning = r.info?.isCityRow !== true && text
+ && r[formatGroupSize(...col)]?.unit_id !== '1';
+ // && r[formatGroupSize(...col)]?.unit_id !== r.unit_id;
+ return {
+ children: (
+ <>
+ {text}
+ {_warning ? ` /${r[formatGroupSize(...col)].unit_name}` : ''}
+ >
+ ),
+ };
+ },
+ },
+ {
+ title: '儿童',
+ dataIndex: [formatGroupSize(...col), 'child_cost'],
+ key: 'child_cost',
+ width: '4rem',
+ onCell: (r, ) => {
+ const text = r[formatGroupSize(...col)]?.child_cost
+ const _warning = r.info?.isCityRow !== true
+ && text
+ && r[formatGroupSize(...col)]?.unit_id !== '1';
+ // && r[formatGroupSize(...col)]?.unit_id !== r.unit_id;
+
+ return { className: _warning ? 'bg-yellow-100' : '' };
+ },
+ render: (text, r) => {
+ const _warning = r.info?.isCityRow !== true && text
+ && r[formatGroupSize(...col)]?.unit_id !== '1';
+ // && r[formatGroupSize(...col)]?.unit_id !== r.unit_id;
+ return {
+ children: (
+ <>
+ {text}
+ {_warning ? ` /${r[formatGroupSize(...col)].unit_name}` : ''}
+ >
+ ),
+ };
+ },
+ },
+ ]
})),
]}
dataSource={data}
@@ -400,7 +517,7 @@ const AgencyPreview = ({ params, ...props }) => {
{(SS || []).length === 1 ? (
- {SS[0].adult_cost}
+ {SS[0].adult_cost}{SS[0].unit_id !== '1' ? ` /${SS[0].unit_name}` : ''}
) : (
(SS || []).map((ele, qi) => (
@@ -409,7 +526,7 @@ const AgencyPreview = ({ params, ...props }) => {
{formatGroupSize(ele.group_size_min, ele.group_size_max, true)}, {ele.unit_name}
-
{ele.adult_cost}
+
{ele.adult_cost}
))
@@ -426,7 +543,7 @@ const AgencyPreview = ({ params, ...props }) => {