|
@@ -1,13 +1,14 @@
|
|
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, getCorpMailListApi, putCorpSysUserApi } from "../../API/corpUserAssign"
|
|
|
|
|
|
+import { CorpMailListProps, 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 { TableMailConfig } from "./tableConfig"
|
|
|
|
|
|
+import { TableChangeLogConfig, TableMailConfig } from "./tableConfig"
|
|
import { getUserAllListApi } from "@/pages/login/API"
|
|
import { getUserAllListApi } from "@/pages/login/API"
|
|
import dayjs from "dayjs"
|
|
import dayjs from "dayjs"
|
|
import OperZs from "./operZs"
|
|
import OperZs from "./operZs"
|
|
|
|
+import AssignAccount from "./assignAccount"
|
|
|
|
|
|
interface Props {
|
|
interface Props {
|
|
defindConfig: {
|
|
defindConfig: {
|
|
@@ -24,6 +25,9 @@ const MailList: React.FC<Props> = ({ defindConfig, visible, onClose, onChange })
|
|
const [queryForm, setQueryForm] = useState<CorpMailListProps>({ pageNum: 1, pageSize: 20 })
|
|
const [queryForm, setQueryForm] = useState<CorpMailListProps>({ pageNum: 1, pageSize: 20 })
|
|
const [editSelectedRow, setEditSelectedRow] = useState<any[]>([])
|
|
const [editSelectedRow, setEditSelectedRow] = useState<any[]>([])
|
|
const [open, setOpen] = useState<boolean>(false)
|
|
const [open, setOpen] = useState<boolean>(false)
|
|
|
|
+ const [accountOpen, setAccountOpen] = useState<any>(null)//公众号指派弹窗
|
|
|
|
+ const [changeLog, setChangeLog] = useState<any>(null)//公众号变更记录弹窗
|
|
|
|
+ const [logData,setLogData] = useState<any[]>([])//变更记录数据
|
|
const [params, setParams] = useState<any[]>([])
|
|
const [params, setParams] = useState<any[]>([])
|
|
const [form] = Form.useForm()
|
|
const [form] = Form.useForm()
|
|
const { message } = App.useApp()
|
|
const { message } = App.useApp()
|
|
@@ -32,6 +36,7 @@ const MailList: React.FC<Props> = ({ defindConfig, visible, onClose, onChange })
|
|
const getCorpMailList = useAjax((params) => getCorpMailListApi(params))
|
|
const getCorpMailList = useAjax((params) => getCorpMailListApi(params))
|
|
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))
|
|
/**************************************/
|
|
/**************************************/
|
|
|
|
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
@@ -41,7 +46,13 @@ const MailList: React.FC<Props> = ({ defindConfig, visible, onClose, onChange })
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
getList()
|
|
getList()
|
|
}, [queryForm, defindConfig.corpId])
|
|
}, [queryForm, defindConfig.corpId])
|
|
-
|
|
|
|
|
|
+ useEffect(() => {
|
|
|
|
+ if (changeLog) {
|
|
|
|
+ getChangeLog.run({ corpId: changeLog.corpId, corpUserId: changeLog.corpUserId }).then(res=>{
|
|
|
|
+ setLogData(res.data)
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ }, [changeLog])
|
|
const getList = () => {
|
|
const getList = () => {
|
|
getCorpMailList.run({ ...queryForm, corpId: defindConfig.corpId })
|
|
getCorpMailList.run({ ...queryForm, corpId: defindConfig.corpId })
|
|
}
|
|
}
|
|
@@ -72,15 +83,15 @@ const MailList: React.FC<Props> = ({ defindConfig, visible, onClose, onChange })
|
|
setOpen(false)
|
|
setOpen(false)
|
|
})
|
|
})
|
|
}
|
|
}
|
|
-
|
|
|
|
return <>
|
|
return <>
|
|
- <Drawer title={`${defindConfig.title} 企微通讯录`} width={1000} placement="right" onClose={onClose} open={visible}>
|
|
|
|
|
|
+ <Drawer title={`${defindConfig.title} 企微通讯录`} width={1300} placement="right" onClose={onClose} open={visible}>
|
|
<SearchBox
|
|
<SearchBox
|
|
bodyPadding={`16px 0 12px`}
|
|
bodyPadding={`16px 0 12px`}
|
|
buttons={<Space>
|
|
buttons={<Space>
|
|
<Button type="primary" onClick={() => getList()} loading={getCorpMailList.loading} icon={<SearchOutlined />}>搜索</Button>
|
|
<Button type="primary" onClick={() => getList()} loading={getCorpMailList.loading} icon={<SearchOutlined />}>搜索</Button>
|
|
<Button type="primary" disabled={editSelectedRow.length === 0} onClick={() => handle(editSelectedRow)} loading={getCorpMailList.loading} icon={<SwapOutlined />}>批量指派</Button>
|
|
<Button type="primary" disabled={editSelectedRow.length === 0} onClick={() => handle(editSelectedRow)} loading={getCorpMailList.loading} icon={<SwapOutlined />}>批量指派</Button>
|
|
<Button type="primary" disabled={editSelectedRow.length === 0} onClick={() => handle(editSelectedRow, 'zs')} loading={getCorpMailList.loading} icon={<SwapOutlined />}>批量指派运营助手</Button>
|
|
<Button type="primary" disabled={editSelectedRow.length === 0} onClick={() => handle(editSelectedRow, 'zs')} loading={getCorpMailList.loading} icon={<SwapOutlined />}>批量指派运营助手</Button>
|
|
|
|
+ <Button type="primary" disabled={editSelectedRow.length === 0} onClick={() => setAccountOpen({})} loading={getCorpMailList.loading} icon={<SwapOutlined />}>批量指派公众号</Button>
|
|
</Space>}
|
|
</Space>}
|
|
>
|
|
>
|
|
<>
|
|
<>
|
|
@@ -91,8 +102,8 @@ const MailList: React.FC<Props> = ({ defindConfig, visible, onClose, onChange })
|
|
<Table
|
|
<Table
|
|
style={{ marginBottom: 1 }}
|
|
style={{ marginBottom: 1 }}
|
|
dataSource={getCorpMailList.data?.data?.records}
|
|
dataSource={getCorpMailList.data?.data?.records}
|
|
- columns={TableMailConfig(handle)}
|
|
|
|
- scroll={{ x: 1000 }}
|
|
|
|
|
|
+ columns={TableMailConfig(handle, setAccountOpen, setChangeLog)}
|
|
|
|
+ scroll={{ x: 1300 }}
|
|
rowKey={(s: { corpUserId: any; }) => {
|
|
rowKey={(s: { corpUserId: any; }) => {
|
|
return s.corpUserId
|
|
return s.corpUserId
|
|
}}
|
|
}}
|
|
@@ -199,6 +210,40 @@ const MailList: React.FC<Props> = ({ defindConfig, visible, onClose, onChange })
|
|
setOperData({ visible: false, data: [] })
|
|
setOperData({ visible: false, data: [] })
|
|
}}
|
|
}}
|
|
/>}
|
|
/>}
|
|
|
|
+ {/* 批量指派公众号 */}
|
|
|
|
+ {
|
|
|
|
+ !!accountOpen && <AssignAccount
|
|
|
|
+ visible={accountOpen}
|
|
|
|
+ editSelectedRow={editSelectedRow}
|
|
|
|
+ onClose={() => {
|
|
|
|
+ setAccountOpen(null)
|
|
|
|
+ }}
|
|
|
|
+ onChange={() => {
|
|
|
|
+ getCorpMailList.refresh()
|
|
|
|
+ setEditSelectedRow([])
|
|
|
|
+ }}
|
|
|
|
+ corpId={defindConfig.corpId}
|
|
|
|
+ />
|
|
|
|
+ }
|
|
|
|
+ {/* 变更记录 */}
|
|
|
|
+ {
|
|
|
|
+ logData?.length > 0 && <Modal
|
|
|
|
+ open={!!changeLog}
|
|
|
|
+ onCancel={() => {
|
|
|
|
+ setChangeLog(null)
|
|
|
|
+ setLogData([])
|
|
|
|
+ }}
|
|
|
|
+ footer={null}
|
|
|
|
+ title={'变更记录'}
|
|
|
|
+ >
|
|
|
|
+ <Table
|
|
|
|
+ columns={TableChangeLogConfig()}
|
|
|
|
+ dataSource={logData}
|
|
|
|
+ pagination={false}
|
|
|
|
+ rowKey={'id'}
|
|
|
|
+ />
|
|
|
|
+ </Modal>
|
|
|
|
+ }
|
|
</>
|
|
</>
|
|
}
|
|
}
|
|
|
|
|