wjx пре 5 месеци
родитељ
комит
6169f55530

+ 13 - 0
src/pages/launchSystemV3/material/cloudNew/const.ts

@@ -36,4 +36,17 @@ export const showFieldList = [
     { label: '创意关联数', value: 'material_data_day.adgroup_count', field: 'adgroup_count' },
     { label: '创意关联数', value: 'material_data_day.dynamic_creative_count', field: 'dynamic_creative_count' },
     { label: '备注', value: 'description', field: 'description' }
+]
+
+
+export const showField1List = [
+    { label: '创建时间', value: 'material.created_time', field: 'created_time' },
+    { label: '下单次数', value: 'material_data_day.order_pv', field: 'order_pv' },
+    { label: '下单成本', value: 'material_data_day.order_cost', field: 'order_cost' },
+    { label: '消耗', value: 'material_data_day.cost', field: 'cost' },
+    { label: '点击率', value: 'material_data_day.ctr', field: 'ctr' },
+    { label: '目标转化率', value: 'material_data_day.conversions_rate', field: 'conversions_rate' },
+    { label: '创意关联数', value: 'material_data_day.adgroup_count', field: 'adgroup_count' },
+    { label: '创意关联数', value: 'material_data_day.dynamic_creative_count', field: 'dynamic_creative_count' },
+    { label: '备注', value: 'description', field: 'description' }
 ]

+ 0 - 4
src/pages/launchSystemV3/material/cloudNew/selectCloudNew.tsx

@@ -358,10 +358,6 @@ const SelectCloudNew: React.FC<CLOUDNEW.SelectCloudNewProps> = ({ visible, defau
             defaultParams={defaultParams}
             checkedFolderList={checkedFolderList}
             setCheckedFolderList={setCheckedFolderList}
-            showField={showField}
-            setShowField={setShowField}
-            sortData={sortData}
-            setSortData={setSortData}
             accountCreateLogs={accountCreateLogs}
         />}
 

+ 11 - 8
src/pages/launchSystemV3/material/cloudNew/selectGroupCloudNew.tsx

@@ -8,10 +8,11 @@ import { formatBytes, formatSecondsToTime, groupBy } from "@/utils/utils"
 import SelectGroupSearch from "./selectGroupSearch"
 import './global.less'
 import '../../tencentAdPutIn/index.less'
-import { showFieldList } from "./const"
+import { showField1List } from "./const"
 import { EyeOutlined, SortAscendingOutlined } from "@ant-design/icons"
 import PlayVideo from "./playVideo"
 import Lazyimg from "react-lazyimg-component"
+import { useLocalStorageState } from "ahooks"
 
 const { Text, Paragraph } = Typography;
 
@@ -20,7 +21,7 @@ const { Text, Paragraph } = Typography;
  * @param param0 
  * @returns 
  */
-const SelectGroupCloudNew: React.FC<CLOUDNEW.SelectGroupCloudNewProps> = ({ num, defaultParams, checkedFolderList, setCheckedFolderList, sortData, setSortData, showField, setShowField, accountCreateLogs }) => {
+const SelectGroupCloudNew: React.FC<CLOUDNEW.SelectGroupCloudNewProps> = ({ num, defaultParams, checkedFolderList, setCheckedFolderList, accountCreateLogs }) => {
 
     /*****************************************/
     const { getAllUserAccount } = useModel('useLaunchAdq.useAdAuthorize')
@@ -33,6 +34,8 @@ const SelectGroupCloudNew: React.FC<CLOUDNEW.SelectGroupCloudNewProps> = ({ num,
     const [searchParams, setSearchParams] = useState<Partial<Omit<CLOUDNEW.GetPageRemoteImageDataListProps, 'materialType'>>>({})
     const [ownerAccountId, setOwnerAccountId] = useState<number>()
     const [previewData, setPreviewData] = useState<{ visible: boolean, url?: string }>({ visible: false })
+    const [sortData, setSortData] = useLocalStorageState<{ sortField: string | undefined, sortType: boolean }>('sort-data-group', { sortField: undefined, sortType: false });
+    const [showField, setShowField] = useLocalStorageState<string[]>('show-field-group', ['material.create_time', 'material_data_day.cost', 'material_data_day.ctr', 'material_data_day.conversions_rate', 'material_data_day.dynamic_creative_count']);
 
     const getPageRemoteImageDataList = useAjax((params) => getPageRemoteImageDataListApi(params))
     /*****************************************/
@@ -75,7 +78,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) { // && groupAccount?.['undefined']?.[0]?.isGroupMainAccount
+                    } else if (GrounpArray.length === 2 && groupAccount?.['undefined']?.length === 1 && groupAccount?.['undefined']?.[0]?.isGroupMainAccount) { // && groupAccount?.['undefined']?.[0]?.isGroupMainAccount
                         const undefinedAccount = groupAccount?.['undefined'][0].accountId
                         let authMainAccountId: any
                         Object.keys(groupAccount).forEach(key => {
@@ -168,7 +171,7 @@ const SelectGroupCloudNew: React.FC<CLOUDNEW.SelectGroupCloudNewProps> = ({ num,
                                     >全选</Checkbox>
                                     <span>已选 <span style={{ color: '#1890FF' }}>{checkedFolderList?.length || 0}</span>/{num} 个素材</span>
                                     {checkedFolderList.length > 0 && <a style={{ color: 'red' }} onClick={() => setCheckedFolderList([])}>清除所有</a>}
-                                    {sortData?.sortField && <Text>「排序-{showFieldList.find(item => item.value === sortData.sortField)?.label}-{sortData.sortType ? '正序' : '倒序'}」</Text>}
+                                    {sortData?.sortField && <Text>「排序-{showField1List.find(item => item.value === sortData.sortField)?.label}-{sortData.sortType ? '正序' : '倒序'}」</Text>}
                                 </div>
                                 <div className={style.left_bts}>
                                     <Popover
@@ -186,7 +189,7 @@ const SelectGroupCloudNew: React.FC<CLOUDNEW.SelectGroupCloudNewProps> = ({ num,
                                                             (option?.label as any)?.toLowerCase().indexOf(input.toLowerCase()) >= 0
                                                         }
                                                         mode="multiple"
-                                                        options={showFieldList}
+                                                        options={showField1List}
                                                         value={showField}
                                                         onChange={(value) => {
                                                             if (value.length > 6) {
@@ -211,7 +214,7 @@ const SelectGroupCloudNew: React.FC<CLOUDNEW.SelectGroupCloudNewProps> = ({ num,
                                                             filterOption={(input, option) =>
                                                                 (option?.label as any)?.toLowerCase().indexOf(input.toLowerCase()) >= 0
                                                             }
-                                                            options={showFieldList.filter(item => showField.includes(item.value) && item.value !== 'description')}
+                                                            options={showField1List.filter(item => showField.includes(item.value) && item.value !== 'description')}
                                                             value={sortData.sortField}
                                                             allowClear
                                                             onChange={(value) => {
@@ -283,8 +286,8 @@ const SelectGroupCloudNew: React.FC<CLOUDNEW.SelectGroupCloudNewProps> = ({ num,
                                                             <div style={{ padding: '0 10px 6px' }}>
                                                                 {showField.map(field => {
                                                                     switch (field) {
-                                                                        case 'material.create_time':
-                                                                            return <Paragraph key={field} style={{ fontSize: 12, marginBottom: 1 }}>创建时间:{item?.create_time}</Paragraph>
+                                                                        case 'material.created_time':
+                                                                            return <Paragraph key={field} style={{ fontSize: 12, marginBottom: 1 }}>创建时间:{item?.created_time}</Paragraph>
                                                                         case 'material_data_day.cost':
                                                                             return <Paragraph key={field} style={{ fontSize: 12, marginBottom: 1 }}>消耗:{(item?.cost === null || item?.cost === undefined) ? '--' : item?.cost}</Paragraph>
                                                                         case 'material_data_day.order_pv':

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

@@ -159,19 +159,6 @@ declare namespace CLOUDNEW {
         defaultParams: DefaultParams
         checkedFolderList: any[]
         setCheckedFolderList: React.Dispatch<React.SetStateAction<any[]>>
-        showField: string[]
-        setShowField: (value?: string[] | IFuncUpdater<string[]> | undefined) => void
-        sortData: {
-            sortField: string | undefined;
-            sortType: boolean;
-        }
-        setSortData: (value?: {
-            sortField: string | undefined;
-            sortType: boolean;
-        } | IFuncUpdater<{
-            sortField: string | undefined;
-            sortType: boolean;
-        }> | undefined) => void
         accountCreateLogs?: PULLIN.AccountCreateLogsProps[]
     }
     interface GetRemoteMaterialListProps {

+ 1 - 1
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) { // && groupAccount?.['undefined']?.[0]?.isGroupMainAccount
+            } 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 => {

+ 3 - 3
src/pages/user/login/index.tsx

@@ -266,7 +266,7 @@ const Login: React.FC<{}> = () => {
     }
   }
   // 倒计时
-  const timeOut = useCallback((num) => {
+  const timeOut = useCallback((num: number) => {
     let timer: any = null
     if (num > 0) {
       timer = setTimeout(() => {
@@ -342,8 +342,8 @@ const Login: React.FC<{}> = () => {
               </div> : <div className={`${styles.main}  ${isMobile ? '' : show ? '' : styles.login_hide}`}>
                 <h1>趣程广告投放管理</h1>
                 {<div className={styles.tabs}>
-                  <span onClick={() => { setTab(1) }} style={tab === 1 ? { color: localStorage.getItem('color') || '#24DB95' } : {}}>手机</span>
-                  {/* <span onClick={() => { setTab(2) }} style={tab === 2 ? { color: localStorage.getItem('color') || '#24DB95' } : {}}>钉钉</span> */}
+                  {/* <span onClick={() => { setTab(1) }} style={tab === 1 ? { color: localStorage.getItem('color') || '#24DB95' } : {}}>手机</span>
+                  <span onClick={() => { setTab(2) }} style={tab === 2 ? { color: localStorage.getItem('color') || '#24DB95' } : {}}>钉钉</span> */}
                 </div>}
 
                 {