|
@@ -1,7 +1,7 @@
|
|
import { useAjax } from "@/Hook/useAjax"
|
|
import { useAjax } from "@/Hook/useAjax"
|
|
import { App, Button, DatePicker, Drawer, Form, Input, Modal, Select, Space, Table, Tag } from "antd"
|
|
import { App, Button, DatePicker, Drawer, Form, Input, Modal, Select, Space, Table, Tag } from "antd"
|
|
import React, { useEffect, useState } from "react"
|
|
import React, { useEffect, useState } from "react"
|
|
-import { CorpMailListProps, getChangeLogApi, getCorpMailListApi, putCorpSysUserApi } from "../../API/corpUserAssign"
|
|
|
|
|
|
+import { CorpMailListProps, getBindMpListApi, getChangeLogApi, getCorpMailListApi, putCorpSysUserApi } from "../../API/corpUserAssign"
|
|
import SearchBox from "../../components/searchBox"
|
|
import SearchBox from "../../components/searchBox"
|
|
import { SearchOutlined, SwapOutlined } from '@ant-design/icons';
|
|
import { SearchOutlined, SwapOutlined } from '@ant-design/icons';
|
|
import { TableChangeLogConfig, TableMailConfig } from "./tableConfig"
|
|
import { TableChangeLogConfig, TableMailConfig } from "./tableConfig"
|
|
@@ -27,8 +27,9 @@ const MailList: React.FC<Props> = ({ defindConfig, visible, onClose, onChange })
|
|
const [open, setOpen] = useState<boolean>(false)
|
|
const [open, setOpen] = useState<boolean>(false)
|
|
const [accountOpen, setAccountOpen] = useState<any>(null)//公众号指派弹窗
|
|
const [accountOpen, setAccountOpen] = useState<any>(null)//公众号指派弹窗
|
|
const [changeLog, setChangeLog] = useState<any>(null)//公众号变更记录弹窗
|
|
const [changeLog, setChangeLog] = useState<any>(null)//公众号变更记录弹窗
|
|
- const [logData,setLogData] = useState<any[]>([])//变更记录数据
|
|
|
|
|
|
+ const [logData, setLogData] = useState<any[]>([])//变更记录数据
|
|
const [params, setParams] = useState<any[]>([])
|
|
const [params, setParams] = useState<any[]>([])
|
|
|
|
+ const [mpList, setMplist] = useState<{ label: string, value: number }[]>([])//已入库公众号列表
|
|
const [form] = Form.useForm()
|
|
const [form] = Form.useForm()
|
|
const { message } = App.useApp()
|
|
const { message } = App.useApp()
|
|
const [operData, setOperData] = useState<{ visible: boolean, data: any[] }>({ visible: false, data: [] })
|
|
const [operData, setOperData] = useState<{ visible: boolean, data: any[] }>({ visible: false, data: [] })
|
|
@@ -37,10 +38,14 @@ const MailList: React.FC<Props> = ({ defindConfig, visible, onClose, onChange })
|
|
const putCorpSysUser = useAjax((params) => putCorpSysUserApi(params))
|
|
const putCorpSysUser = useAjax((params) => putCorpSysUserApi(params))
|
|
const getUserAllList = useAjax(() => getUserAllListApi())
|
|
const getUserAllList = useAjax(() => getUserAllListApi())
|
|
const getChangeLog = useAjax((params) => getChangeLogApi(params))
|
|
const getChangeLog = useAjax((params) => getChangeLogApi(params))
|
|
|
|
+ const getBindMpList = useAjax(() => getBindMpListApi())
|
|
/**************************************/
|
|
/**************************************/
|
|
|
|
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
getUserAllList.run()
|
|
getUserAllList.run()
|
|
|
|
+ getBindMpList.run().then(res => {
|
|
|
|
+ setMplist(res?.data?.map((item: any) => ({ label: item.name, value: item.id })))
|
|
|
|
+ })
|
|
}, [])
|
|
}, [])
|
|
|
|
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
@@ -48,7 +53,7 @@ const MailList: React.FC<Props> = ({ defindConfig, visible, onClose, onChange })
|
|
}, [queryForm, defindConfig.corpId])
|
|
}, [queryForm, defindConfig.corpId])
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
if (changeLog) {
|
|
if (changeLog) {
|
|
- getChangeLog.run({ corpId: changeLog.corpId, corpUserId: changeLog.corpUserId }).then(res=>{
|
|
|
|
|
|
+ getChangeLog.run({ corpId: changeLog.corpId, corpUserId: changeLog.corpUserId }).then(res => {
|
|
setLogData(res.data)
|
|
setLogData(res.data)
|
|
})
|
|
})
|
|
}
|
|
}
|
|
@@ -96,6 +101,46 @@ const MailList: React.FC<Props> = ({ defindConfig, visible, onClose, onChange })
|
|
>
|
|
>
|
|
<>
|
|
<>
|
|
<Input onChange={(e) => setQueryForm({ ...queryForm, name: e.target.value, pageNum: 1 })} value={queryForm?.name} placeholder="企微号名称" allowClear />
|
|
<Input onChange={(e) => setQueryForm({ ...queryForm, name: e.target.value, pageNum: 1 })} value={queryForm?.name} placeholder="企微号名称" allowClear />
|
|
|
|
+ <Select
|
|
|
|
+ value={queryForm?.mpAccountId}
|
|
|
|
+ onChange={(e) => setQueryForm({ ...queryForm, mpAccountId: e })}
|
|
|
|
+ showSearch
|
|
|
|
+ style={{ width: 110 }}
|
|
|
|
+ placeholder="公众号"
|
|
|
|
+ filterOption={(input, option) =>
|
|
|
|
+ ((option?.label ?? '') as string).toLowerCase().includes(input.toLowerCase())
|
|
|
|
+ }
|
|
|
|
+ allowClear
|
|
|
|
+ options={mpList}
|
|
|
|
+ />
|
|
|
|
+ <Select
|
|
|
|
+ value={queryForm?.operUserIds}
|
|
|
|
+ onChange={(e) => setQueryForm({ ...queryForm, operUserIds: e })}
|
|
|
|
+ mode="multiple"
|
|
|
|
+ showSearch
|
|
|
|
+ style={{ minWidth: 110 }}
|
|
|
|
+ allowClear
|
|
|
|
+ placeholder="选择运营"
|
|
|
|
+ filterOption={(input, option) =>
|
|
|
|
+ (option?.children as any)?.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
|
|
|
+ }
|
|
|
|
+ >
|
|
|
|
+ {getUserAllList?.data?.data?.map((item: any) => <Select.Option value={item.userId} key={item.userId}>{item.nickname}</Select.Option>)}
|
|
|
|
+ </Select>
|
|
|
|
+ <Select
|
|
|
|
+ value={queryForm?.putUserIds}
|
|
|
|
+ onChange={(e) => setQueryForm({ ...queryForm, putUserIds: e })}
|
|
|
|
+ mode="multiple"
|
|
|
|
+ showSearch
|
|
|
|
+ style={{ minWidth: 110 }}
|
|
|
|
+ allowClear
|
|
|
|
+ placeholder="选择投手"
|
|
|
|
+ filterOption={(input, option) =>
|
|
|
|
+ (option?.children as any)?.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
|
|
|
+ }
|
|
|
|
+ >
|
|
|
|
+ {getUserAllList?.data?.data?.map((item: any) => <Select.Option value={item.userId} key={item.userId}>{item.nickname}</Select.Option>)}
|
|
|
|
+ </Select>
|
|
</>
|
|
</>
|
|
</SearchBox>
|
|
</SearchBox>
|
|
|
|
|
|
@@ -227,7 +272,7 @@ const MailList: React.FC<Props> = ({ defindConfig, visible, onClose, onChange })
|
|
}
|
|
}
|
|
{/* 变更记录 */}
|
|
{/* 变更记录 */}
|
|
{
|
|
{
|
|
- logData?.length > 0 && <Modal
|
|
|
|
|
|
+ logData?.length > 0 && <Modal
|
|
open={!!changeLog}
|
|
open={!!changeLog}
|
|
onCancel={() => {
|
|
onCancel={() => {
|
|
setChangeLog(null)
|
|
setChangeLog(null)
|