diff --git a/src/components/OrderProfile.jsx b/src/components/OrderProfile.jsx
index dc150fd..54a719f 100644
--- a/src/components/OrderProfile.jsx
+++ b/src/components/OrderProfile.jsx
@@ -101,7 +101,7 @@ const OrderProfile = ({ coliSN, ...props }) => {
- 已下计划
+ 已做计划
diff --git a/src/views/orders/components/MailBox.jsx b/src/views/orders/components/MailBox.jsx
index 814630a..f01e0ee 100644
--- a/src/views/orders/components/MailBox.jsx
+++ b/src/views/orders/components/MailBox.jsx
@@ -12,7 +12,7 @@ const { RangePicker } = DatePicker
const PAGE_SIZE = 50 // 每页显示条数
-const MailBox = ({ mailboxDir, onMailItemClick, ...props }) => {
+const MailBox = ({ mailboxDir, onMailItemClick, onSelect, ...props }) => {
const DATE_RANGE_PRESETS = [
{
label: '本周',
@@ -40,8 +40,8 @@ const MailBox = ({ mailboxDir, onMailItemClick, ...props }) => {
},
]
const [form] = Form.useForm()
-
- const { mailList, loading, error, refresh } = useEmailList(mailboxDir);
+ const [selectedItems, setSelectedItems] = useState([])
+ const { mailList, loading, error, refresh } = useEmailList(mailboxDir)
const [pagination, setPagination] = useState({
current: 1,
@@ -101,10 +101,21 @@ const MailBox = ({ mailboxDir, onMailItemClick, ...props }) => {
const hasAtta = item.MAI_Attachment !== 0 ? : null
return (
-
- {hasAtta}
-
+ className={`flex border border-solid border-t-0 border-x-0 border-gray-200 hover:bg-neutral-50 active:bg-gray-200 p-2 ${props.currentActiveMailItem === item.key ? 'bg-neutral-100' : ''}`}>
+
+ i.MAI_SN === item.MAI_SN)}
+ onClick={e => {
+ console.info(item, 'checked: ' + e.target.checked)
+ const isChecked = e.target.checked;
+ const updatedSelection = isChecked
+ ? [...selectedItems, item]
+ : selectedItems.filter((item) => item.MAI_SN !== item.MAI_SN)
+ setSelectedItems(updatedSelection)
+ console.info('selectedItems: ', updatedSelection)
+ }
+ }>
+
{
console.info('item: ', item)
@@ -114,6 +125,7 @@ const MailBox = ({ mailboxDir, onMailItemClick, ...props }) => {
{orderNumber}
{item.MAI_Subject}
+ {hasAtta}
{countryName + item.SenderReceiver + ' ' + item.SRDate}
@@ -128,7 +140,26 @@ const MailBox = ({ mailboxDir, onMailItemClick, ...props }) => {
-
+ 0 &&
+ selectedItems.length < pagination.pagedList.length
+ }
+ checked={pagination.pagedList.every((item) =>
+ selectedItems.some((selected) => selected.MAI_SN === item.MAI_SN)
+ )}
+ onChange={(e) => {
+ const isChecked = e.target.checked;
+ if (isChecked) {
+ setSelectedItems((prev) => [
+ ...prev,
+ ...pagination.pagedList,
+ ]);
+ } else {
+ setSelectedItems([]);
+ }
+ }}
+ >
} />
@@ -198,6 +229,7 @@ const MailBox = ({ mailboxDir, onMailItemClick, ...props }) => {
})}
/>
+ 已选: {selectedItems.length} 项;
{(pagination.current - 1) * PAGE_SIZE + 1}-{Math.min(pagination.current * PAGE_SIZE, pagination.total)} of {pagination.total}