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 604af1e..4332e48 100644
--- a/src/views/orders/components/MailBox.jsx
+++ b/src/views/orders/components/MailBox.jsx
@@ -11,7 +11,7 @@ const { RangePicker } = DatePicker
const PAGE_SIZE = 50 // 每页显示条数
-const MailBox = ({ mailboxDir, onMailItemClick, ...props }) => {
+const MailBox = ({ mailboxDir, onMailItemClick, onSelect, ...props }) => {
const DATE_RANGE_PRESETS = [
{
label: '本周',
@@ -39,8 +39,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,
@@ -103,6 +103,20 @@ const MailBox = ({ mailboxDir, onMailItemClick, ...props }) => {
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-gray-200' : ''}`}>
{hasAtta}
+ className='flex border border-solid border-t-0 border-x-0 border-gray-200 hover:bg-neutral-50 p-2'>
+
+ 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)
+ }
+ }>
{
@@ -169,7 +183,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([]);
+ }
+ }}
+ >
} />
@@ -239,6 +272,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}