wjx 1 рік тому
батько
коміт
f30f98b043

+ 2 - 2
src/models/useLaunchAdq/useBdMedia.ts

@@ -209,8 +209,8 @@ function useBdMediaPup() {
                                     if (!obj?.title) {
                                         obj.title = data.file.name
                                     }
-                                    if (obj.title.match(RegExp(/^[^\\<\\>\\&'\\\"\\x08\\x09\\x0A\\x0D\\\\]+$/))) {
-                                        obj.title = obj.title.replace(RegExp(/^[^\\<\\>\\&'\\\"\\x08\\x09\\x0A\\x0D\\\\]+$/), '')
+                                    if (obj.title.match(RegExp(/[<>&\\'"/\x08\x09\x0A\x0D\x7F]/g))) {
+                                        obj.title = obj.title.replace(RegExp(/[<>&\\'"/\x08\x09\x0A\x0D\x7F]/g), '')
                                     }
                                     obj.title = obj.title.replace(/\.(jpg|jpeg|gif|png)$/i, '')
                                     add.run(obj).then((res) => {

+ 2 - 2
src/models/useLaunchAdq/useBdMediaPup.ts

@@ -289,8 +289,8 @@ function useBdMediaPup() {
                       if (!obj?.title) {
                         obj.title = data.file.name
                       }
-                      if (obj.title.match(RegExp(/^[^\\<\\>\\&'\\\"\\x08\\x09\\x0A\\x0D\\\\]+$/))) {
-                        obj.title = obj.title.replace(RegExp(/^[^\\<\\>\\&'\\\"\\x08\\x09\\x0A\\x0D\\\\]+$/), '')
+                      if (obj.title.match(RegExp(/[<>&\\'"/\x08\x09\x0A\x0D\x7F]/g))) {
+                        obj.title = obj.title.replace(RegExp(/[<>&\\'"/\x08\x09\x0A\x0D\x7F]/g), '')
                       }
                       obj.title = obj.title.replace(/\.(jpg|jpeg|gif|png)$/i, '')
                       add.run(obj).then((res) => {

+ 44 - 16
src/pages/launchSystemNew/adq/ad/index.tsx

@@ -1,12 +1,12 @@
 
 import { useAjax } from '@/Hook/useAjax'
 import { AdStatusEnum, PromotedObjectType } from '@/services/launchAdq/enum'
-import { Col, Row, Input, Select, message, Space, Button, Popconfirm, Switch, notification, Modal, Tooltip, Checkbox } from 'antd'
+import { Col, Row, Input, Select, message, Space, Button, Popconfirm, Switch, notification, Modal, Tooltip, Checkbox, Dropdown, Menu } from 'antd'
 import React, { useEffect, useCallback, useState } from 'react'
 import TableData from '../../components/TableData'
 import tableConfig from './tableConfig'
 import { putAdqAdgroupsSync, getAdqAdgroupsList, delListAdqAdgroupsApi, newEditAdqAdgroupsDataApi, editAdqAdgroupsDataApi, putAdqAdgroupsSyncBatch, putModifyCustomAudienceApi } from '@/services/launchAdq/adq'
-import { CopyOutlined, DeleteOutlined, FieldTimeOutlined, PauseCircleOutlined, PlayCircleOutlined, SyncOutlined, TransactionOutlined } from '@ant-design/icons'
+import { CopyOutlined, DeleteOutlined, DownOutlined, FieldTimeOutlined, PauseCircleOutlined, PlayCircleOutlined, QuestionCircleOutlined, SyncOutlined, TransactionOutlined } from '@ant-design/icons'
 import UpdateAd from './updateAd'
 import Copy from './copy'
 import PlanDetail from '@/pages/adMonitor/adMonitorList/components/planDetail'
@@ -448,25 +448,53 @@ const Ad: React.FC<Props> = (props) => {
                         <Switch checkedChildren="普通" unCheckedChildren="ROI" checked={model} onChange={(checked) => { setModel(checked); setSelectedRows([]) }} style={model ? {} : { background: '#67c23a' }} />
                     </Col>
                     {model ? <>
-                        <Col><Button type='primary' style={{ background: '#1890ff' }} icon={<FieldTimeOutlined />} disabled={selectedRows.length === 0} onClick={editScheduling}>修改排期出价名称</Button></Col>
                         <Col><Button type='primary' style={{ background: '#1890ff' }} icon={<CopyOutlined />} disabled={selectedRows.length === 0} onClick={copyHandle}>复制</Button></Col>
                         <Col><Button type='primary' style={{ background: '#67c23a', borderColor: '#67c23a' }} loading={editAdqAdgroupsData.loading} icon={<PlayCircleOutlined />} disabled={selectedRows.length === 0} onClick={() => adStatus('play')}>启动</Button></Col>
                         <Col><Button type='primary' style={{ background: '#e6a23c', borderColor: '#e6a23c' }} loading={editAdqAdgroupsData.loading} icon={<PauseCircleOutlined />} disabled={selectedRows.length === 0} onClick={() => adStatus('suspend')}>暂停</Button></Col>
-                        <Col><Tooltip title="2023/4/20 16:20:00刷新页面后平台创建的广告可修改,或者其它平台使用定向包创建广告可用">
-                            <Button type='primary' loading={putModifyCustomAudience.loading} disabled={selectedRows.length > 0 ? !selectedRows.every((item: { accountId: number }) => item.accountId === selectedRows[0].accountId) : true} onClick={() => setRqb()}>修改人群包</Button>
-                        </Tooltip></Col>
-                        <Col><Button type='primary' style={{ background: '#00bcd4', borderColor: '#00bcd4' }} loading={putAdqAdgroupsSyncBatchApi.loading} icon={<SyncOutlined />} disabled={selectedRows.length === 0} onClick={syncAd}>同步广告</Button></Col>
                         <Col><SetEarlyWarning selectedRows={selectedRows} onChange={() => listAjax.refresh()} /></Col>
                         <Col>
-                            <Popconfirm
-                                title="确定删除?"
-                                onConfirm={() => deleteHandle(1)}
-                                okText="是"
-                                cancelText="否"
-                                disabled={selectedRows.length === 0}
-                            >
-                                <Button danger type='primary' loading={delListAdqAdgroups.loading} icon={<DeleteOutlined />} disabled={selectedRows.length === 0}>删除</Button>
-                            </Popconfirm>
+                            <Dropdown overlay={<Menu items={[
+                                {
+                                    key: '1',
+                                    disabled: selectedRows.length === 0,
+                                    label: <Button type="link" size='small' style={{ padding: 0 }} icon={<FieldTimeOutlined />} disabled={selectedRows.length === 0} onClick={editScheduling}>修改排期出价名称</Button>,
+                                },
+                                {
+                                    key: '2',
+                                    disabled: selectedRows.length > 0 ? !selectedRows.every((item: { accountId: number }) => item.accountId === selectedRows[0].accountId) : true,
+                                    label: <Button type="link" size='small' style={{ padding: 0 }} loading={putModifyCustomAudience.loading} disabled={selectedRows.length > 0 ? !selectedRows.every((item: { accountId: number }) => item.accountId === selectedRows[0].accountId) : true} onClick={() => setRqb()}>
+                                        修改人群包
+                                        <Tooltip title="2023/4/20 16:20:00刷新页面后平台创建的广告可修改,或者其它平台使用定向包创建广告可用">
+                                            <QuestionCircleOutlined />
+                                        </Tooltip>
+                                    </Button>,
+                                },
+                                {
+                                    key: '3',
+                                    disabled: selectedRows.length === 0,
+                                    label: <Button type="link" size='small' style={{ padding: 0 }} loading={putAdqAdgroupsSyncBatchApi.loading} icon={<SyncOutlined />} disabled={selectedRows.length === 0} onClick={syncAd}>同步广告</Button>,
+                                },
+                                {
+                                    key: '4',
+                                    disabled: selectedRows.length === 0,
+                                    label: <Popconfirm
+                                        title="确定删除?"
+                                        onConfirm={() => deleteHandle(1)}
+                                        okText="是"
+                                        cancelText="否"
+                                        disabled={selectedRows.length === 0}
+                                    >
+                                        <Button danger type="link" size='small' style={{ padding: 0 }} loading={delListAdqAdgroups.loading} icon={<DeleteOutlined />} disabled={selectedRows.length === 0}>删除</Button>
+                                    </Popconfirm>,
+                                },
+                            ]} />}>
+                                <a onClick={(e) => e.preventDefault()}>
+                                    <Space>
+                                        更多
+                                        <DownOutlined />
+                                    </Space>
+                                </a>
+                            </Dropdown>
                         </Col>
                     </> : <Col><Button type='primary' icon={<TransactionOutlined />} disabled={selectedRows.length === 0} onClick={editDeepConversion}>修改深度优化ROI</Button></Col>}
                     <Col>

+ 10 - 6
src/pages/launchSystemNew/adq/ad/inputUpdate.tsx

@@ -28,7 +28,7 @@ const InputUpdate: React.FC<Props> = ({ title, dataIndex, record, handleSave, is
     const save = async () => {
         try {
             const values = await form.validateFields();
-            if (values?.adgroupName !== (record as any)?.adgroupName) {
+            if (values?.[dataIndex] !== (record as any)?.[dataIndex]) {
                 handleSave({ ...record, ...values });
             }
             toggleEdit();
@@ -45,13 +45,17 @@ const InputUpdate: React.FC<Props> = ({ title, dataIndex, record, handleSave, is
             {
                 required: isNum, message: `大于0,并且填写数字`, validator(rule, value, callback) {
                     let regPos = /^[0-9]+.?[0-9]*/; //判断是否是数字。
-                    if (!regPos.test(value)) {
-                        return Promise.reject()
-                    }
-                    if (value >= 0) {
+                    if (!isNum) {
                         return Promise.resolve()
                     } else {
-                        return Promise.reject()
+                        if (!regPos.test(value)) {
+                            return Promise.reject()
+                        }
+                        if (value >= 0) {
+                            return Promise.resolve()
+                        } else {
+                            return Promise.reject()
+                        }
                     }
                 },
             }

+ 1 - 1
src/pages/launchSystemNew/adq/ad/tableConfig.tsx

@@ -194,7 +194,7 @@ function tableConfig(
             align: 'center',
             width: 70,
             render: (a: string, b: any) => {
-                return <InputUpdate title={a} dataIndex={'dailyBudget'} record={b} handleSave={handleSaveDaily} />
+                return <InputUpdate title={a} isNum={true} dataIndex={'dailyBudget'} record={b} handleSave={handleSaveDaily} />
             }
         },
         {