wjx 5 miesięcy temu
rodzic
commit
5029b9d4a5

+ 3 - 2
src/pages/launchSystemNew/account/game/tableConfig.tsx

@@ -28,7 +28,7 @@ export function columnsMp(
             dataIndex: 'id',
             key: 'id',
             align: 'center',
-            width: 55,
+            width: 75,
             fixed: 'left'
         },
         {
@@ -64,7 +64,8 @@ export function columnsMp(
             dataIndex: 'adUnitAccountId',
             key: 'adUnitAccountId',
             align: 'center',
-            width: 75,
+            width: 90,
+            ellipsis: true,
             render: (a: any) => {
                 return <span>{a || '--'}</span>
             }

+ 3 - 2
src/pages/launchSystemNew/account/novel/tableConfig.tsx

@@ -26,7 +26,7 @@ export function columnsMp(
             dataIndex: 'id',
             key: 'id',
             align: 'center',
-            width: 55,
+            width: 75,
             fixed: 'left'
         },
         {
@@ -62,7 +62,8 @@ export function columnsMp(
             dataIndex: 'adUnitAccountId',
             key: 'adUnitAccountId',
             align: 'center',
-            width: 75,
+            width: 90,
+            ellipsis: true,
             render: (a: any) => {
                 return <span>{a || '--'}</span>
             }

+ 8 - 0
src/pages/launchSystemV3/components/PageModal/MiniProgramPage.tsx

@@ -92,6 +92,14 @@ const MiniProgramPage: React.FC<Props> = (props) => {
                     </Tooltip>
                 </Space>
             </Button>}
+            <Button
+                type="link"
+                danger
+                disabled={!data?.some(item => item.pageList?.length)}
+                onClick={() => {
+                    setData(data => data.map(item => ({ ...item, pageList: [] })))
+                }}
+            >全部清空</Button>
         </Space>}
         open={visible}
         onCancel={() => { onClose && onClose() }}

+ 1 - 1
src/pages/launchSystemV3/components/PageModal/indexOfficial.tsx

@@ -295,7 +295,7 @@ const PageOfficialModal: React.FC<Props> = (props) => {
                      */
                     rowSelection={{
                         type: ([910].includes(creativeTemplateId) || deliveryMode === "DELIVERY_MODE_COMPONENT") ? 'checkbox' : 'radio',
-                        getCheckboxProps: (record) => {
+                        getCheckboxProps: (record: any) => {
                             let { disableCode } = record
                             if (disableCode !== 0) {
                                 return {

+ 0 - 1
src/pages/launchSystemV3/components/PageModal/tableConfig.tsx

@@ -69,7 +69,6 @@ let columns = (type?: 1 | 2 | 3): TableProps<any>['columns'] => {
                 key: 'appletId',
                 width: 180,
                 ellipsis: true,
-                fixed: 'left',
                 render: (a) => {
                     return <span style={{ fontSize: "12px" }}>{a}</span>
                 }

+ 3 - 1
src/pages/launchSystemV3/material/cloudNew/selectGroupCloudNew.tsx

@@ -75,7 +75,7 @@ const SelectGroupCloudNew: React.FC<CLOUDNEW.SelectGroupCloudNewProps> = ({ num,
                     })
                     if (GrounpArray.length === 1 && !groupAccount['undefined']) {
                         setOwnerAccountId(GrounpArray?.[0]?.[0]?.authMainAccountId || GrounpArray?.[0]?.[0]?.accountId)
-                    } else if (GrounpArray.length === 2 && groupAccount?.['undefined']?.length === 1) {
+                    } else if (GrounpArray.length === 2 && groupAccount?.['undefined']?.length === 1 && groupAccount?.['undefined']?.[0]?.isGroupMainAccount) {
                         const undefinedAccount = groupAccount?.['undefined'][0].accountId
                         let authMainAccountId: any
                         Object.keys(groupAccount).forEach(key => {
@@ -88,6 +88,8 @@ const SelectGroupCloudNew: React.FC<CLOUDNEW.SelectGroupCloudNewProps> = ({ num,
                         } else {
                             setOwnerAccountId(-1)
                         }
+                    } else if (groupAccount?.['undefined']?.length === 1 && groupAccount?.['undefined']?.[0]?.isGroupMainAccount) {
+                        setOwnerAccountId(groupAccount?.['undefined']?.[0]?.accountId)
                     } else {
                         setOwnerAccountId(-1)
                     }

+ 16 - 2
src/pages/launchSystemV3/material/cloudNew/selectGroupSearch.tsx

@@ -27,7 +27,7 @@ const SelectGroupSearch: React.FC<Props> = ({ onSearch }) => {
         let params: any = []
         Object.keys(values).forEach(key => {
             let value = values[key]
-            if (['accountIds', 'adgroupIds', 'dynamicCreativeIds', 'tencentMaterialId'].includes(key) && value) {
+            if (['accountIds', 'adgroupIds', 'dynamicCreativeIds', 'tencentMaterialId', 'descriptionList'].includes(key) && value) {
                 let value1 = value.replace(/[,,\s]/g, ',')
                 params[key] = value1.split(',').filter((a: any) => a)
             } else if ('uploadTime' === key && value?.length === 2) {
@@ -59,6 +59,9 @@ const SelectGroupSearch: React.FC<Props> = ({ onSearch }) => {
                 <Col><Form.Item name={'description'}>
                     <Input style={{ width: 190 }} allowClear placeholder="请输入备注关键词" />
                 </Form.Item></Col>
+                <Col><Form.Item name={'descriptionList'}>
+                    <Input.TextArea rows={1} style={{ width: 190 }} allowClear placeholder="备注(精准匹配)(多个,,空格换行)" />
+                </Form.Item></Col>
                 <Col><Form.Item name={'sysUserIds'}>
                     <Select
                         placeholder="投手"
@@ -93,11 +96,22 @@ const SelectGroupSearch: React.FC<Props> = ({ onSearch }) => {
                         filterOption={(input, option) =>
                             ((option?.label ?? '') as any).toLowerCase().includes(input.toLowerCase())
                         }
-                        style={{ minWidth: 120 }}
+                        style={{ width: 100 }}
                         allowClear
                         options={[{ label: '未使用', value: 0 }, { label: '无消耗', value: 1 }, { label: '有消耗', value: 2 }]}
                     />
                 </Form.Item></Col>
+                <Col><Form.Item name={'fileFormat'}>
+                    <Select
+                        placeholder="版式(横板竖版)"
+                        filterOption={(input, option) =>
+                            ((option?.label ?? '') as any).toLowerCase().includes(input.toLowerCase())
+                        }
+                        style={{ width: 100 }}
+                        allowClear
+                        options={[{ label: '横板', value: 1 }, { label: '竖版', value: 2 }, { label: '方图', value: 3 }]}
+                    />
+                </Form.Item></Col>
                 <Col><Form.Item name={'uploadTime'}>
                     <DatePicker.RangePicker style={{ width: 260 }} placeholder={['上传时间开始', '上传时间结束']} />
                 </Form.Item></Col>

+ 1 - 0
src/pages/launchSystemV3/material/typings.d.ts

@@ -99,6 +99,7 @@ declare namespace CLOUDNEW {
         uploadTimeMax?: string
         useStatus?: number            // 使用情况(0未使用 1无消耗 2有消耗)
         fileSize?: number
+        fileFormat?: '1' | '2'   // 文件版式 1横版(宽大于高)  2竖版(高大于宽) 3方图(高等于宽)")
     }
     interface AddMaterialProps {
         designerId?: number,    // 设计师

+ 43 - 4
src/pages/launchSystemV3/tencenTasset/miniProgramWechat/index.tsx

@@ -1,12 +1,13 @@
 import { useAjax } from "@/Hook/useAjax";
-import { delWechatAppletApi, getWechatAppletAllApi, getWechatAppletApi, getWechatAppletDetailApi } from "@/services/adqV3/global";
-import { PlusOutlined, SearchOutlined } from "@ant-design/icons";
-import { Button, Card, Divider, Input, message, Select, Table, Typography } from "antd";
+import { delWechatAppletApi, downloadTemplateApi, getWechatAppletAllApi, getWechatAppletApi, getWechatAppletDetailApi, importExcelApi } from "@/services/adqV3/global";
+import { CloudDownloadOutlined, CloudUploadOutlined, PlusOutlined, SearchOutlined } from "@ant-design/icons";
+import { Button, Card, Divider, Input, message, Select, Table, Typography, Upload } from "antd";
 import React, { useEffect, useState } from "react"
 import '../../tencentAdPutIn/index.less'
 import Modify from "./modify";
 import columns from "./tableConfig";
-const { Text, Link, Paragraph } = Typography;
+import { downloadFile1, formatDate } from "@/utils/downloadFile";
+const { Text, Paragraph } = Typography;
 
 /**
  * 微信小程序
@@ -19,9 +20,12 @@ const MiniProgramWechat: React.FC = () => {
     const [queryFormNew, setQueryFormNew] = useState<{ pageNum: number, pageSize: number, appletName?: string, appletIdList?: string[] }>({ pageNum: 1, pageSize: 20 })
     const [visible, setVisible] = useState<boolean>(false)
     const [initialValues, setInitialValues] = useState<any>({})
+    const [downLoading, setDownLoading] = useState<boolean>(false)
+    const [btnUploadLoding, setBtnUploadLoding] = useState<boolean>(false)//按钮loding
 
     const getWechatApplet = useAjax((params) => getWechatAppletApi(params))
     const delWechatApplet = useAjax((params) => delWechatAppletApi(params))
+    const importExcel = useAjax((params) => importExcelApi(params))
     /**********************************/
 
     useEffect(() => {
@@ -63,6 +67,41 @@ const MiniProgramWechat: React.FC = () => {
             />
             <Button type="primary" icon={<SearchOutlined />} onClick={() => setQueryFormNew({ ...queryForm })}>搜索</Button>
             <Button type="primary" icon={<PlusOutlined />} onClick={() => { setVisible(true) }}>新增小程序</Button>
+            <Button
+                icon={<CloudDownloadOutlined />}
+                loading={downLoading}
+                onClick={() => {
+                    setDownLoading(true)
+                    downloadTemplateApi().then(res => {
+                        setDownLoading(false)
+                        downloadFile1(res, 'octet-stream', formatDate(new Date()) + ".xlsx")
+                    }).catch(() => setDownLoading(false))
+                }}
+            >下载模板</Button>
+            <Upload
+                accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel"
+                action=""
+                listType="text"
+                onChange={() => { }}
+                multiple={true}
+                showUploadList={false}
+                customRequest={(options) => {
+                    setBtnUploadLoding(true)
+                    let formData = new FormData();
+                    formData.append("file", options.file);
+                    importExcel.run(formData).then(res => {
+                        setBtnUploadLoding(false)
+                        if (res) {
+                            message.success('导入成功')
+                            getWechatApplet.refresh()
+                        }
+                    }).catch(() => {
+                        setBtnUploadLoding(false)
+                    })
+                }}
+            >
+                <Button type="primary" ghost loading={btnUploadLoding} icon={<CloudUploadOutlined />} onClick={() => { }}>上传Excel</Button>
+            </Upload>
         </div>}
     >
 

+ 3 - 2
src/pages/launchSystemV3/tencentAdPutIn/create/SelectAccount/index.tsx

@@ -58,7 +58,7 @@ const SelectAccount: React.FC<Props> = ({ putInType, accountCreateLogs, setAccou
             })
             if (GrounpArray.length === 1 && !groupAccount['undefined']) {
                 return { authMainAccountId: GrounpArray?.[0]?.[0]?.authMainAccountId || GrounpArray?.[0]?.[0]?.accountId, isSelectRemote: true }
-            } else if (GrounpArray.length === 2 && groupAccount?.['undefined']?.length === 1) {
+            } else if (GrounpArray.length === 2 && groupAccount?.['undefined']?.length === 1 && groupAccount?.['undefined']?.[0]?.isGroupMainAccount) {
                 const undefinedAccount = groupAccount?.['undefined'][0].accountId
                 let authMainAccountId: any
                 Object.keys(groupAccount).forEach(key => {
@@ -71,6 +71,8 @@ const SelectAccount: React.FC<Props> = ({ putInType, accountCreateLogs, setAccou
                 } else {
                     return { authMainAccountId: -1, isSelectRemote: false }
                 }
+            }  else if (groupAccount?.['undefined']?.length === 1 && groupAccount?.['undefined']?.[0]?.isGroupMainAccount) {
+                return { authMainAccountId: groupAccount?.['undefined']?.[0]?.accountId, isSelectRemote: true }
             } else {
                 return { authMainAccountId: -1, isSelectRemote: false }
             }
@@ -454,7 +456,6 @@ const SelectAccount: React.FC<Props> = ({ putInType, accountCreateLogs, setAccou
 
                             if (isY && authMainAccountId) {
                                 // 2.有的话判断 判断账户是否为一组
-                                console.log('authMainAccountId---->', authMainAccountId, getauthMainAccountData(selectedRows))
                                 const authMainData = getauthMainAccountData(selectedRows)
                                 if (authMainData.isSelectRemote && authMainData.authMainAccountId === authMainAccountId) {
                                     handleOk(false)

+ 22 - 0
src/services/adqV3/global.ts

@@ -490,6 +490,28 @@ export async function delWechatAppletApi(id: number) {
     })
 }
 
+/**
+ * 下载小程序上传模板
+ * @returns 
+ */
+export async function downloadTemplateApi() {
+    return request(api + `/adq/v3/wechatApplet/downloadTemplate`, {
+        method: 'POST',
+        responseType: 'blob'
+    })
+}
+
+/**
+ * 上传
+ * @returns 
+ */
+export async function importExcelApi(data: any) {
+    return request(api + `/adq/v3/wechatApplet/importExcel`, {
+        method: 'POST',
+        data
+    })
+}
+
 /**
  * 修改微信小程序
  * @param data