|
@@ -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':
|