From 2e68c7621db51a2bb58217e9460ad891c3366b42 Mon Sep 17 00:00:00 2001 From: Jimmy Liow Date: Tue, 30 Jul 2024 16:44:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=B7=E6=A0=BC=E8=AE=BE=E7=BD=AE=E3=80=81?= =?UTF-8?q?=E4=BA=BA=E7=AD=89=E5=A2=9E=E5=8A=A0=E9=BB=98=E8=AE=A4=E5=80=BC?= =?UTF-8?q?=EF=BC=8C=E4=BD=BF=E7=94=A8=E9=A2=9C=E8=89=B2=E8=A1=A8=E7=A4=BA?= =?UTF-8?q?=E5=BF=85=E5=A1=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../products/Detail/BatchImportPrice.jsx | 45 ++++++++++++++++--- 1 file changed, 38 insertions(+), 7 deletions(-) diff --git a/src/views/products/Detail/BatchImportPrice.jsx b/src/views/products/Detail/BatchImportPrice.jsx index ab56f58..3b7bdaa 100644 --- a/src/views/products/Detail/BatchImportPrice.jsx +++ b/src/views/products/Detail/BatchImportPrice.jsx @@ -2,7 +2,7 @@ import { useState } from 'react'; import { Button, Card, Checkbox, Table, Col, Flex, DatePicker, Typography, Form, Input, Row, Select, Space } from 'antd'; import dayjs from "dayjs"; import { useTranslation } from 'react-i18next'; -import { CloseOutlined, StarOutlined } from '@ant-design/icons'; +import { CloseOutlined, StarTwoTone, PlusOutlined } from '@ant-design/icons'; import { useDatePresets } from '@/hooks/useDatePresets'; const { Option } = Select; const { RangePicker } = DatePicker; @@ -268,6 +268,37 @@ const BatchImportPrice = ({ onBatchImportData }) => { ] } + const defaultPriceValue = { + "priceInput": { + "numberStart": 1, + "numberEnd": 2, + "audultPrice": 0, + "childrenPrice": 0 + } + } + + const defaultDefinitionValue = { + "useDate": [ + dayjs().add(1, 'year').subtract(2, "M").startOf("M"), dayjs().add(1, 'year').endOf("M") + ], + "unitName": "每人", + "currency": "CNY", + "weekend": [ + "5", + "6" + ], + "priceList": [ + { + "priceInput": { + "numberStart": 1, + "numberEnd": 2, + "audultPrice": 0, + "childrenPrice": 0 + } + }, + ] + } + return ( @@ -287,7 +318,7 @@ const BatchImportPrice = ({ onBatchImportData }) => { size="small" title={index==0?'旺季':index==1?'淡季':'其他'} key={field.key} - extra={index==0?null: { + extra={index==0?: { remove(field.name) }} />} > @@ -321,11 +352,11 @@ const BatchImportPrice = ({ onBatchImportData }) => { - {index==0?: priceOptList.remove(priceField.name)} />} + {index==0?: priceOptList.remove(priceField.name)} />} ))} - )} @@ -333,8 +364,8 @@ const BatchImportPrice = ({ onBatchImportData }) => { ))} - )}