|
@@ -5,7 +5,6 @@ import { App, Button, Card, Empty, Input, Popconfirm, Select, Space, Spin, Table
|
|
import MassSending from './components/massSending';
|
|
import MassSending from './components/massSending';
|
|
import { useAjax } from '@/Hook/useAjax';
|
|
import { useAjax } from '@/Hook/useAjax';
|
|
import { MediaContentProps, welcomeMsgJobTypeApi } from '@/pages/weComTask/API/weMaterial/weMaterial';
|
|
import { MediaContentProps, welcomeMsgJobTypeApi } from '@/pages/weComTask/API/weMaterial/weMaterial';
|
|
-import { getAllBookApi, getBookPlatInfoAllApi } from '@/pages/weComTask/API/global';
|
|
|
|
import SelectCorpUser from '../../corpUserManage/selectCorpUser';
|
|
import SelectCorpUser from '../../corpUserManage/selectCorpUser';
|
|
import { SearchOutlined, PlusOutlined, RedoOutlined, SaveOutlined, CheckOutlined } from '@ant-design/icons';
|
|
import { SearchOutlined, PlusOutlined, RedoOutlined, SaveOutlined, CheckOutlined } from '@ant-design/icons';
|
|
import { getGroupData, getHighGroupData, getUserInDataData } from './const';
|
|
import { getGroupData, getHighGroupData, getUserInDataData } from './const';
|
|
@@ -17,6 +16,7 @@ import SelectExternalAccount from '@/pages/weComTask/components/selectExternalAc
|
|
import Welcome from './components/welcome';
|
|
import Welcome from './components/welcome';
|
|
import UserInherit from './components/userInherit';
|
|
import UserInherit from './components/userInherit';
|
|
import HighMassSending from './components/highMassSending';
|
|
import HighMassSending from './components/highMassSending';
|
|
|
|
+import { toJS } from 'mobx';
|
|
|
|
|
|
export const DispatchTaskCreate = React.createContext<TASK_CREATE.DispatchTaskCreate | null>(null);
|
|
export const DispatchTaskCreate = React.createContext<TASK_CREATE.DispatchTaskCreate | null>(null);
|
|
/**
|
|
/**
|
|
@@ -24,25 +24,22 @@ export const DispatchTaskCreate = React.createContext<TASK_CREATE.DispatchTaskCr
|
|
* @param props
|
|
* @param props
|
|
* @returns
|
|
* @returns
|
|
*/
|
|
*/
|
|
-const Create: React.FC<any> = (props: { weGlobaStore: any }) => {
|
|
|
|
|
|
+const Create: React.FC<{ weComTaskStore: { data: { bookList: TASK_CREATE.BookListProps[], bookPlatForm: TASK_CREATE.BookPlatFormProps[] } } }> = ({ weComTaskStore }) => {
|
|
|
|
|
|
/***********************************************/
|
|
/***********************************************/
|
|
const navigate = useNavigate();
|
|
const navigate = useNavigate();
|
|
|
|
+ const { bookList, bookPlatForm } = toJS(weComTaskStore.data)
|
|
|
|
|
|
const [settings, setSettings] = useState<TASK_CREATE.SettingsProps>();
|
|
const [settings, setSettings] = useState<TASK_CREATE.SettingsProps>();
|
|
|
|
|
|
console.log(settings)
|
|
console.log(settings)
|
|
const { message, modal } = App.useApp()
|
|
const { message, modal } = App.useApp()
|
|
- const [bookPlatForm, setBookPlatForm] = useState<{ platformName: string, id: number, platformKey: string }[]>([])
|
|
|
|
- const [bookList, setBookList] = useState<{ id: number, bookName: string, platformId: number }[]>([])
|
|
|
|
const [msgJobTypeList, setMsgJobTypeList] = useState<{ value: string, label: string }[]>([])
|
|
const [msgJobTypeList, setMsgJobTypeList] = useState<{ value: string, label: string }[]>([])
|
|
const [previewData, setPreviewData] = useState<TASK_CREATE.previewDataProps>({})
|
|
const [previewData, setPreviewData] = useState<TASK_CREATE.previewDataProps>({})
|
|
const [subVisible, setSubVisible] = useState<boolean>(false) // 选择设置名称弹窗控制
|
|
const [subVisible, setSubVisible] = useState<boolean>(false) // 选择设置名称弹窗控制
|
|
const [eaVisible, setEaVisible] = useState<boolean>(false)
|
|
const [eaVisible, setEaVisible] = useState<boolean>(false)
|
|
|
|
|
|
- const getAllBook = useAjax(() => getAllBookApi()) //书
|
|
|
|
const welcomeMsgJobType = useAjax(() => welcomeMsgJobTypeApi())//获取欢迎语类型
|
|
const welcomeMsgJobType = useAjax(() => welcomeMsgJobTypeApi())//获取欢迎语类型
|
|
- const getBookPlatInfoAll = useAjax(() => getBookPlatInfoAllApi()) //书城
|
|
|
|
|
|
|
|
const addTask = useAjax((params) => addTaskApi(params))
|
|
const addTask = useAjax((params) => addTaskApi(params))
|
|
/***********************************************/
|
|
/***********************************************/
|
|
@@ -55,14 +52,6 @@ const Create: React.FC<any> = (props: { weGlobaStore: any }) => {
|
|
}, [])
|
|
}, [])
|
|
|
|
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
- getBookPlatInfoAll.run().then((res) => {
|
|
|
|
- if (res?.data) setBookPlatForm(res.data)
|
|
|
|
- })
|
|
|
|
- getAllBook.run().then(res => {
|
|
|
|
- if (res?.data) {
|
|
|
|
- setBookList(res.data)
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
welcomeMsgJobType.run().then(res => {
|
|
welcomeMsgJobType.run().then(res => {
|
|
if (res?.data) {
|
|
if (res?.data) {
|
|
setMsgJobTypeList(Object.keys(res.data).map(key => ({ value: key, label: res.data[key] })))
|
|
setMsgJobTypeList(Object.keys(res.data).map(key => ({ value: key, label: res.data[key] })))
|