Skip to content

Let's use AI to Earn!

feat: 账户选择添加按平台筛选

gaoSira38c390ba486
diff --git a/src/var.css b/src/var.css
index 941256be..2c845c37 100644
--- a/src/var.css
+++ b/src/var.css
@@ -30,4 +30,4 @@
--errerColor: red;
/* 成功色 */
--successColor: #52c41a;
-}
\ No newline at end of file
+}
diff --git a/src/views/publish/children/videoPage/components/VideoPubSetModal/VideoPubSetModal.tsx b/src/views/publish/children/videoPage/components/VideoPubSetModal/VideoPubSetModal.tsx
index 3393f261..1ea3b910 100644
--- a/src/views/publish/children/videoPage/components/VideoPubSetModal/VideoPubSetModal.tsx
+++ b/src/views/publish/children/videoPage/components/VideoPubSetModal/VideoPubSetModal.tsx
@@ -11,7 +11,6 @@ import {
Alert,
Avatar,
Button,
- Input,
message,
Modal,
notification,
@@ -178,6 +177,7 @@ const VideoPubSetModal = memo(
setLoading(false);
message.error('网络繁忙,请稍后重试!');
};
+ // 创建一级记录
const recordRes = await icpCreatePubRecord({
title: '/',
desc: '/',
@@ -192,6 +192,7 @@ const VideoPubSetModal = memo(
for (const vData of videoListChoose) {
const account = vData.account!;
const video = vData.video!;
+ // 创建二级记录
await icpCreateVideoPubRecord({
...vData.pubParams,
type: account.type,
@@ -211,7 +212,6 @@ const VideoPubSetModal = memo(
setLoading(false);
close();
setPubProgressModuleOpen(false);
- // clear();
// 成功数据
const successList = okRes.filter((v) => v.code === 1);
@@ -224,7 +224,7 @@ const VideoPubSetModal = memo(
条,失败 {okRes.length - successList.length} 条
</>
),
- duration: 20000,
+ duration: 10000,
btn: (
<Space>
<Button
diff --git a/src/views/publish/children/videoPage/page.tsx b/src/views/publish/children/videoPage/page.tsx
index 249c0f26..46e379a8 100644
--- a/src/views/publish/children/videoPage/page.tsx
+++ b/src/views/publish/children/videoPage/page.tsx
@@ -1,16 +1,17 @@
-import styles from './video.module.scss';
-import VideoChoose from '@/components/Choose/VideoChoose';
-import { useEffect, useRef, useState } from 'react';
-import { Button, Popconfirm, Spin, Tooltip } from 'antd';
-import { PlusOutlined, DeleteOutlined } from '@ant-design/icons';
-import ChooseAccountModule from '@/views/publish/components/ChooseAccountModule/ChooseAccountModule';
-import NoChoosePage from '@/views/publish/children/videoPage/components/NoChoosePage';
-import { useVideoPageStore } from '@/views/publish/children/videoPage/useVideoPageStore';
-import { useShallow } from 'zustand/react/shallow';
-import { PubType } from '@@/publish/PublishEnum';
-import VideoChooseItem from '@/views/publish/children/videoPage/components/VideoChooseItem';
-import CommonPubSetting from '@/views/publish/children/videoPage/components/CommonPubSetting';
-import VideoPubSetModal from '@/views/publish/children/videoPage/components/VideoPubSetModal/VideoPubSetModal';
+import styles from "./video.module.scss";
+import VideoChoose from "@/components/Choose/VideoChoose";
+import { useEffect, useRef, useState } from "react";
+import { Button, Popconfirm, Spin, Tooltip } from "antd";
+import { DeleteOutlined, PlusOutlined } from "@ant-design/icons";
+import ChooseAccountModule from "@/views/publish/components/ChooseAccountModule/ChooseAccountModule";
+import NoChoosePage from "@/views/publish/children/videoPage/components/NoChoosePage";
+import { useVideoPageStore } from "@/views/publish/children/videoPage/useVideoPageStore";
+import { useShallow } from "zustand/react/shallow";
+import { PubType } from "@@/publish/PublishEnum";
+import VideoChooseItem from "@/views/publish/children/videoPage/components/VideoChooseItem";
+import CommonPubSetting from "@/views/publish/children/videoPage/components/CommonPubSetting";
+import VideoPubSetModal from "@/views/publish/children/videoPage/components/VideoPubSetModal/VideoPubSetModal";
+import { AccountType } from "../../../../../commont/AccountEnum";
export enum AccountChooseType {
// 多选
diff --git a/src/views/publish/components/ChooseAccountModule/ChooseAccountModule.tsx b/src/views/publish/components/ChooseAccountModule/ChooseAccountModule.tsx
index 1ca36715..57893ff0 100644
--- a/src/views/publish/components/ChooseAccountModule/ChooseAccountModule.tsx
+++ b/src/views/publish/components/ChooseAccountModule/ChooseAccountModule.tsx
@@ -12,6 +12,7 @@ import { PubType } from '../../../../../commont/publish/PublishEnum';
import PlatChoose, {
IPlatChooseRef,
} from '@/views/publish/components/ChooseAccountModule/components/PlatChoose';
+import { AccountType } from '../../../../../commont/AccountEnum';
export interface IChooseAccountModuleRef {}
@@ -28,12 +29,15 @@ export interface IChooseAccountModuleProps {
onPlatChange?: (accounts: AccountInfo[], account: AccountInfo) => void;
// 按平台 是否禁用全选,true=禁用,false=不禁用,默认为false
disableAllSelect?: boolean;
+ // 可选择的平台,默认为全部
+ allowPlatSet?: Set<AccountType>;
}
const ChooseAccountModule = memo(
forwardRef(
(
{
+ allowPlatSet,
open,
onClose,
pubType,
@@ -87,6 +91,7 @@ const ChooseAccountModule = memo(
label: '按平台选择',
children: (
<PlatChoose
+ allowPlatSet={allowPlatSet}
choosedAccounts={choosedAccounts}
disableAllSelect={disableAllSelect || false}
ref={platChooseRef}
diff --git a/src/views/publish/components/ChooseAccountModule/chooseAccountModule.module.scss b/src/views/publish/components/ChooseAccountModule/chooseAccountModule.module.scss
index d8fb0520..bddb46d8 100644
--- a/src/views/publish/components/ChooseAccountModule/chooseAccountModule.module.scss
+++ b/src/views/publish/components/ChooseAccountModule/chooseAccountModule.module.scss
@@ -3,13 +3,15 @@
:global {
.platChoose-platSelect {
+ padding-right: 20px;
.ant-checkbox-wrapper {
margin-bottom: 5px;
white-space: nowrap;
}
.ant-segmented {
- margin-right: 20px;
+ width: 100%;
+ box-sizing: border-box;
.ant-segmented-item {
margin-bottom: 5px;
padding: 3px 60px 3px 0;
diff --git a/src/views/publish/components/ChooseAccountModule/components/PlatChoose.tsx b/src/views/publish/components/ChooseAccountModule/components/PlatChoose.tsx
index 9fc59d01..b612f8ce 100644
--- a/src/views/publish/components/ChooseAccountModule/components/PlatChoose.tsx
+++ b/src/views/publish/components/ChooseAccountModule/components/PlatChoose.tsx
@@ -42,6 +42,8 @@ export interface IPlatChooseProps {
choosedAccounts?: AccountInfo[];
// 按平台 是否禁用多选,true=禁用,false=不禁用
disableAllSelect: boolean;
+ // 可选择的平台,默认为全部
+ allowPlatSet?: Set<AccountType>;
}
const PlatChoose = memo(
@@ -52,6 +54,7 @@ const PlatChoose = memo(
onChange,
choosedAccounts,
disableAllSelect,
+ allowPlatSet,
}: IPlatChooseProps,
ref: ForwardedRef<IPlatChooseRef>,
) => {
@@ -233,7 +236,10 @@ const PlatChoose = memo(
),
};
})
- .filter((v) => v !== undefined)}
+ .filter((v) => v !== undefined)
+ .filter((v) =>
+ allowPlatSet ? allowPlatSet.has(v.value) : true,
+ )}
onChange={setActivePlat}
/>
</ConfigProvider>