|
|
|
@ -1,15 +1,20 @@
|
|
|
|
|
import { createContext, useEffect, useMemo, useState } from 'react'
|
|
|
|
|
import { Flex, Button, Tooltip, List, Form, Row, Col, Dropdown, Input, Checkbox, DatePicker, Switch, Breadcrumb, Skeleton } from 'antd'
|
|
|
|
|
import { App, Flex, Button, Tooltip, List, Form, Row, Col, Dropdown, Input, Checkbox, DatePicker, Switch, Breadcrumb, Skeleton } from 'antd'
|
|
|
|
|
import useConversationStore from '@/stores/ConversationStore'
|
|
|
|
|
import { emailTemplates, openPopup, useEmailTemplate } from '@/hooks/useEmail';
|
|
|
|
|
import { POPUP_FEATURES } from '@/config';
|
|
|
|
|
import { isEmpty } from '@/utils/commons';
|
|
|
|
|
|
|
|
|
|
const NewEmailButton = ({ ...props }) => {
|
|
|
|
|
const { notification } = App.useApp();
|
|
|
|
|
const [mailboxActiveNode, setMailboxActiveNode] = useConversationStore((state) => [state.mailboxActiveNode, state.setMailboxActiveNode])
|
|
|
|
|
|
|
|
|
|
const COLI_SN = useMemo(() => mailboxActiveNode?.COLI_SN || 0, [mailboxActiveNode.COLI_SN])
|
|
|
|
|
const handleTemplateDropdown = ({ key, domEvent }) => {
|
|
|
|
|
console.log(key)
|
|
|
|
|
if (isEmpty(COLI_SN)) {
|
|
|
|
|
notification.warning({ message: '请选择到订单目录', placement: 'top' })
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
openPopup(`/email/new/0/${COLI_SN}/${key}`, `new-0-${COLI_SN}-${key}`, POPUP_FEATURES)
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|