|
@@ -1,11 +1,12 @@
|
|
|
import { useAjax } from "@/Hook/useAjax"
|
|
|
import { delCopyWritingApi, getCopyWritingListApi } from "@/services/adqV3/global"
|
|
|
import { PlusOutlined, SearchOutlined } from "@ant-design/icons"
|
|
|
-import { Button, Input, message, Modal, Space, Table } from "antd"
|
|
|
+import { Button, Input, message, Modal, Select, Space, Table } from "antd"
|
|
|
import React, { useEffect, useState } from "react"
|
|
|
import ModifyCopyWriting from "./modifyCopyWriting"
|
|
|
import columns from "./tableConfig"
|
|
|
import '../../tencentAdPutIn/index.less'
|
|
|
+import { getErpUserAll } from "@/services/launchAdq/adq"
|
|
|
|
|
|
interface Props {
|
|
|
onChange?: (value: string[]) => void
|
|
@@ -16,16 +17,21 @@ const SelectCopyWriting: React.FC<Props> = ({ onChange, onClick }) => {
|
|
|
|
|
|
/**********************************/
|
|
|
const [visible, setVisible] = useState<boolean>(false)
|
|
|
- const [queryForm, setQueryForm] = useState<{ category?: string, content?: string, pageNum: number, pageSize: number }>({ pageNum: 1, pageSize: 20 })
|
|
|
- const [queryFormNew, setQueryFormNew] = useState<{ category?: string, content?: string, pageNum: number, pageSize: number }>({ pageNum: 1, pageSize: 20 })
|
|
|
+ const [queryForm, setQueryForm] = useState<{ category?: string, content?: string, createBy?: number, pageNum: number, pageSize: number }>({ pageNum: 1, pageSize: 20 })
|
|
|
+ const [queryFormNew, setQueryFormNew] = useState<{ category?: string, content?: string, createBy?: number, pageNum: number, pageSize: number }>({ pageNum: 1, pageSize: 20 })
|
|
|
const [initialValues, setInitialValues] = useState<any>()
|
|
|
const [mvisible, setMVisible] = useState<boolean>(false)
|
|
|
const [selectedRows, setSelectedRows] = useState<any[]>([])
|
|
|
|
|
|
const getCopyWritingList = useAjax((params) => getCopyWritingListApi(params))
|
|
|
const delCopyWriting = useAjax((params) => delCopyWritingApi(params))
|
|
|
+ const allOfMember = useAjax(() => getErpUserAll())
|
|
|
/**********************************/
|
|
|
|
|
|
+ useEffect(() => {
|
|
|
+ allOfMember.run()
|
|
|
+ }, [])
|
|
|
+
|
|
|
useEffect(() => {
|
|
|
if (visible)
|
|
|
getCopyWritingList.run(queryFormNew)
|
|
@@ -73,6 +79,20 @@ const SelectCopyWriting: React.FC<Props> = ({ onChange, onClick }) => {
|
|
|
>
|
|
|
<Space style={{ width: '100%' }} direction="vertical">
|
|
|
<Space>
|
|
|
+ <Select
|
|
|
+ showSearch
|
|
|
+ placeholder="请选择创建人"
|
|
|
+ onChange={(e) => setQueryForm({ ...queryForm, createBy: e, pageNum: 1 })}
|
|
|
+ filterOption={(input, option) =>
|
|
|
+ (option?.label as any)?.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
|
|
+ }
|
|
|
+ allowClear
|
|
|
+ style={{ width: 140 }}
|
|
|
+ options={allOfMember?.data?.map((item: { userId: any; nickname: string }) => ({
|
|
|
+ value: item.userId,
|
|
|
+ label: item.nickname,
|
|
|
+ }))}
|
|
|
+ />
|
|
|
<Input style={{ width: 200 }} placeholder="文案分类" value={queryForm?.category} allowClear onChange={(e) => setQueryForm({ ...queryForm, category: e.target.value, pageNum: 1 })} />
|
|
|
<Input style={{ width: 200 }} placeholder="关键字" value={queryForm?.content} allowClear onChange={(e) => setQueryForm({ ...queryForm, content: e.target.value, pageNum: 1 })} />
|
|
|
|