|
@@ -87,7 +87,7 @@ const CreateAd: React.FC = () => {
|
|
|
// 设置地域
|
|
|
useEffect(() => {
|
|
|
tagsList_REGION.run({ type: 'REGION' }).then(res => {
|
|
|
- if (res) {
|
|
|
+ if (res && Array.isArray(res)) {
|
|
|
setGeoLocationList(() => (res as any[])?.reduce((prev: any, cur: { id: number }) => {
|
|
|
prev[cur.id] = cur
|
|
|
return prev
|
|
@@ -95,7 +95,7 @@ const CreateAd: React.FC = () => {
|
|
|
}
|
|
|
})
|
|
|
tagsList_MODEL.run({ type: 'DEVICE_BRAND_MODEL' }).then(res => {
|
|
|
- if (res) {
|
|
|
+ if (res && Array.isArray(res)) {
|
|
|
setModelList(() => (res as any[])?.reduce((prev: any, cur: { id: number }) => {
|
|
|
prev[cur.id] = cur
|
|
|
return prev
|
|
@@ -371,10 +371,10 @@ const CreateAd: React.FC = () => {
|
|
|
}
|
|
|
}, [queryForm, targetKey])
|
|
|
// 媒体组更新通知
|
|
|
- const usersChange=useCallback(()=>{
|
|
|
+ const usersChange = useCallback(() => {
|
|
|
let data = JSON.parse(localStorage.getItem('ADQUSERS' + userId) as any)
|
|
|
setUsersArr(data)
|
|
|
- },[])
|
|
|
+ }, [])
|
|
|
console.log('queryForm======>111', queryForm)
|
|
|
return <Space direction="vertical" style={{ width: '100%' }}>
|
|
|
<Card
|
|
@@ -396,13 +396,13 @@ const CreateAd: React.FC = () => {
|
|
|
return option!.children?.toString().toLowerCase().includes(input.toLowerCase())
|
|
|
}}
|
|
|
onChange={(e, option) => {
|
|
|
- console.log(e,option)
|
|
|
- let userArr:any[] = []
|
|
|
- e.forEach((key: any)=> {
|
|
|
- let obj = usesArr.find((item: { id: any })=>item.id === key)
|
|
|
- if(obj){
|
|
|
- userArr.push(obj['pitcher'])
|
|
|
- }
|
|
|
+ console.log(e, option)
|
|
|
+ let userArr: any[] = []
|
|
|
+ e.forEach((key: any) => {
|
|
|
+ let obj = usesArr.find((item: { id: any }) => item.id === key)
|
|
|
+ if (obj) {
|
|
|
+ userArr.push(obj['pitcher'])
|
|
|
+ }
|
|
|
})
|
|
|
userArr = [...new Set(userArr.flat())]
|
|
|
setAccountCreateLogs(userArr?.map((item: any) => ({ adAccountId: item?.split('_')[1], id: Number(item?.split('_')[0]) })))
|
|
@@ -422,9 +422,7 @@ const CreateAd: React.FC = () => {
|
|
|
bordered={false}
|
|
|
filterOption={(input: any, option: any) => {
|
|
|
return option!.children?.toString().toLowerCase().includes(input.toLowerCase())
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
+ }}
|
|
|
value={accountCreateLogs?.map((item: { id: number }) => item?.id)}
|
|
|
onChange={(e, option) => {
|
|
|
console.log(option)
|