Skip to content

Let's use AI to Earn!

feat(数据统计): 顶部筛选完成

gaoSir3443558b848c
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 43b13b81..9d961b30 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,16 +4,14 @@
<option name="autoReloadType" value="NONE" />
</component>
<component name="ChangeListManager">
- <list default="true" id="8ce961ad-7c9e-494c-bc53-9ecde4358af8" name="更改" comment="feat: 创建数据统计页面">
- <change afterPath="$PROJECT_DIR$/src/app/[lng]/dataStatistics/components/DataStatisticsHeader/dataStatisticsHeader.module.scss" afterDir="false" />
- <change afterPath="$PROJECT_DIR$/src/app/[lng]/dataStatistics/components/DataStatisticsHeader/index.tsx" afterDir="false" />
- <change afterPath="$PROJECT_DIR$/src/app/[lng]/dataStatistics/dataStatistics.module.scss" afterDir="false" />
- <change afterPath="$PROJECT_DIR$/src/app/i18n/locales/en/dataStatistics.json" afterDir="false" />
- <change afterPath="$PROJECT_DIR$/src/app/i18n/locales/zh-CN/dataStatistics.json" afterDir="false" />
+ <list default="true" id="8ce961ad-7c9e-494c-bc53-9ecde4358af8" name="更改" comment="feat: 创建数据统计header">
+ <change afterPath="$PROJECT_DIR$/src/app/[lng]/dataStatistics/svgs/accountCount.svg" afterDir="false" />
+ <change afterPath="$PROJECT_DIR$/src/app/[lng]/dataStatistics/useDataStatistics.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/@types/resources.d.ts" beforeDir="false" afterPath="$PROJECT_DIR$/@types/resources.d.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/app/[lng]/dataStatistics/DataStatisticsCore.tsx" beforeDir="false" afterPath="$PROJECT_DIR$/src/app/[lng]/dataStatistics/DataStatisticsCore.tsx" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/src/app/[lng]/dataStatistics/page.tsx" beforeDir="false" afterPath="$PROJECT_DIR$/src/app/[lng]/dataStatistics/page.tsx" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/src/app/[lng]/dataStatistics/components/DataStatisticsHeader/dataStatisticsHeader.module.scss" beforeDir="false" afterPath="$PROJECT_DIR$/src/app/[lng]/dataStatistics/components/DataStatisticsHeader/dataStatisticsHeader.module.scss" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/src/app/[lng]/dataStatistics/components/DataStatisticsHeader/index.tsx" beforeDir="false" afterPath="$PROJECT_DIR$/src/app/[lng]/dataStatistics/components/DataStatisticsHeader/index.tsx" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/src/components/notification/NotificationPanel.tsx" beforeDir="false" afterPath="$PROJECT_DIR$/src/components/notification/NotificationPanel.tsx" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -127,6 +125,7 @@
<recent name="E:\project-dev\web\艺咖\aitoearn-web\src\app\i18n\locales\zh-CN" />
</key>
<key name="MoveFile.RECENT_KEYS">
+ <recent name="E:\project-dev\web\艺咖\aitoearn-web\src\app\[lng]\dataStatistics\svgs" />
<recent name="E:\project-dev\web\艺咖\aitoearn-web\src\app\[lng]\dataStatistics\components\DataStatisticsHeader" />
<recent name="E:\project-dev\web\艺咖\aitoearn-web\src\components" />
<recent name="E:\project-dev\web\艺咖\aitoearn-web\src\api\plat" />
@@ -210,7 +209,7 @@
<workItem from="1757646405605" duration="66000" />
<workItem from="1757646484870" duration="466000" />
<workItem from="1757647784882" duration="2426000" />
- <workItem from="1757656251307" duration="2730000" />
+ <workItem from="1757656251307" duration="7708000" />
</task>
<task id="LOCAL-00001" summary="feat(CalendarTiming): 优化发布记录列表展示&#10;- 调整日历记录项的样式和布局&#10;- 优化 RecordCore组件,添加平台图标和时间显示&#10;- 修改 CalendarTimingItem 组件,移除不必要的 Fragment&#10;-调整 index.tsx 中的日期格式化逻辑">
<option name="closed" value="true" />
@@ -572,7 +571,15 @@
<option name="project" value="LOCAL" />
<updated>1757653916005</updated>
</task>
- <option name="localTasksCounter" value="46" />
+ <task id="LOCAL-00046" summary="feat: 创建数据统计header">
+ <option name="closed" value="true" />
+ <created>1757661071307</created>
+ <option name="number" value="00046" />
+ <option name="presentableId" value="LOCAL-00046" />
+ <option name="project" value="LOCAL" />
+ <updated>1757661071307</updated>
+ </task>
+ <option name="localTasksCounter" value="47" />
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
@@ -642,7 +649,6 @@
<option name="CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT" value="false" />
<option name="CHECK_NEW_TODO" value="false" />
<option name="ADD_EXTERNAL_FILES_SILENTLY" value="true" />
- <MESSAGE value="feat(发布):1. b站添加是否转载、选择分区参数。 2. 发布记录展示时间修复,将后端返回的时间转为当前时区给用户展示。 3. b站添加强制拦截,分区、转载不选择会强制拦截用户。" />
<MESSAGE value="fix(日历):修复了单元格没有预期时间但是发布记录还是不会填满单元格的问题。" />
<MESSAGE value="fix(发布弹框): 修复右侧预览不正常隐藏的问题" />
<MESSAGE value="feat(发布弹框): 立即发布接入API" />
@@ -667,6 +673,7 @@
<MESSAGE value="feat: 选择代理" />
<MESSAGE value="fix: 修复因为 @svgr/webpack 受到的影响" />
<MESSAGE value="feat: 创建数据统计页面" />
- <option name="LAST_COMMIT_MESSAGE" value="feat: 创建数据统计页面" />
+ <MESSAGE value="feat: 创建数据统计header" />
+ <option name="LAST_COMMIT_MESSAGE" value="feat: 创建数据统计header" />
</component>
</project>
\ No newline at end of file
diff --git a/src/app/[lng]/dataStatistics/DataStatisticsCore.tsx b/src/app/[lng]/dataStatistics/DataStatisticsCore.tsx
index 8e95c817..a0d767d5 100644
--- a/src/app/[lng]/dataStatistics/DataStatisticsCore.tsx
+++ b/src/app/[lng]/dataStatistics/DataStatisticsCore.tsx
@@ -2,8 +2,29 @@
import styles from "./dataStatistics.module.scss";
import DataStatisticsHeader from "@/app/[lng]/dataStatistics/components/DataStatisticsHeader";
+import { useDataStatisticsStore } from "@/app/[lng]/dataStatistics/useDataStatistics";
+import { useShallow } from "zustand/react/shallow";
+import { useEffect } from "react";
+import { useAccountStore } from "@/store/account";
export const DataStatisticsCore = () => {
+ const { setChoosedGroupIds } = useDataStatisticsStore(
+ useShallow((state) => ({
+ setChoosedGroupIds: state.setChoosedGroupIds,
+ })),
+ );
+ const { accountGroupList } = useAccountStore(
+ useShallow((state) => ({
+ accountGroupList: state.accountGroupList,
+ })),
+ );
+
+ useEffect(() => {
+ if (accountGroupList.length > 0) {
+ setChoosedGroupIds(accountGroupList.map((group) => group.id));
+ }
+ }, [setChoosedGroupIds, accountGroupList]);
+
return (
<div className={styles.dataStatistics}>
<DataStatisticsHeader />
diff --git a/src/app/[lng]/dataStatistics/components/DataStatisticsHeader/dataStatisticsHeader.module.scss b/src/app/[lng]/dataStatistics/components/DataStatisticsHeader/dataStatisticsHeader.module.scss
index 4bcb38db..a4769f10 100644
--- a/src/app/[lng]/dataStatistics/components/DataStatisticsHeader/dataStatisticsHeader.module.scss
+++ b/src/app/[lng]/dataStatistics/components/DataStatisticsHeader/dataStatisticsHeader.module.scss
@@ -1,3 +1,27 @@
.dataStatisticsHeader {
+ //display: flex;
+ //height: 100px;
+ padding: 15px;
+ :global {
+ .dataStatisticsHeader-top {
+ display: flex;
+ justify-content: space-between;
+ &-options {
+ display: flex;
+
+ .ant-select {
+ margin-right: 20px;
+ }
+ }
+ }
+
+ .dataStatisticsHeader-accounts {
+
+ }
+
+ .dataStatisticsHeader-accountCount {
+
+ }
+ }
}
\ No newline at end of file
diff --git a/src/app/[lng]/dataStatistics/components/DataStatisticsHeader/index.tsx b/src/app/[lng]/dataStatistics/components/DataStatisticsHeader/index.tsx
index fadb2a69..91ddea1c 100644
--- a/src/app/[lng]/dataStatistics/components/DataStatisticsHeader/index.tsx
+++ b/src/app/[lng]/dataStatistics/components/DataStatisticsHeader/index.tsx
@@ -1,5 +1,11 @@
import { ForwardedRef, forwardRef, memo } from "react";
import styles from "./dataStatisticsHeader.module.scss";
+import AccountCount from "../../svgs/accountCount.svg";
+import { Swiper, SwiperSlide } from "swiper/react";
+import { useAccountStore } from "@/store/account";
+import { useShallow } from "zustand/react/shallow";
+import { Input, Select } from "antd";
+import { useDataStatisticsStore } from "@/app/[lng]/dataStatistics/useDataStatistics";
export interface IDataStatisticsHeaderRef {}
@@ -11,7 +17,55 @@ const DataStatisticsHeader = memo(
{}: IDataStatisticsHeaderProps,
ref: ForwardedRef<IDataStatisticsHeaderRef>,
) => {
- return <div className={styles.dataStatisticsHeader}></div>;
+ const { accountList, accountGroupList } = useAccountStore(
+ useShallow((state) => ({
+ accountList: state.accountList,
+ accountGroupList: state.accountGroupList,
+ })),
+ );
+ const { choosedGroupIds, setChoosedGroupIds } = useDataStatisticsStore(
+ useShallow((state) => ({
+ setChoosedGroupIds: state.setChoosedGroupIds,
+ choosedGroupIds: state.choosedGroupIds,
+ })),
+ );
+
+ return (
+ <div className={styles.dataStatisticsHeader}>
+ <div className="dataStatisticsHeader-top">
+ <h2>账号数据</h2>
+ <div className="dataStatisticsHeader-top-options">
+ <Select
+ mode="multiple"
+ value={choosedGroupIds}
+ style={{ width: "220px" }}
+ options={accountGroupList}
+ fieldNames={{ value: "id", label: "name" }}
+ placeholder="选择空间"
+ maxTagCount={1}
+ onChange={(value) => {
+ setChoosedGroupIds(value);
+ }}
+ />
+ <Input.Search style={{ width: '300px' }} placeholder="请输入账号名称" />
+ </div>
+ </div>
+
+ <div className="dataStatisticsHeader-accounts">
+ <div className="dataStatisticsHeader-accountCount">
+ <div className="dataStatisticsHeader-accountCount-title">
+ <AccountCount />
+ 累计账号数
+ </div>
+ <div className="dataStatisticsHeader-accountCount-number">4</div>
+ </div>
+
+ <Swiper>
+ <SwiperSlide></SwiperSlide>
+ </Swiper>
+ </div>
+ </div>
+ );
},
),
);
diff --git a/src/app/[lng]/dataStatistics/svgs/accountCount.svg b/src/app/[lng]/dataStatistics/svgs/accountCount.svg
new file mode 100644
index 00000000..9ac17d20
--- /dev/null
+++ b/src/app/[lng]/dataStatistics/svgs/accountCount.svg
@@ -0,0 +1 @@
+<svg width='18' height='18' viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'><g id='Group 4096'><rect id='Rectangle 165' width='18' height='18' rx='4' fill='#FF7800' fill-opacity='0.1'/><path id='Union' fill-rule='evenodd' clip-rule='evenodd' d='M4.91678 13.1861C4.91678 10.1054 6.67109 9.03566 8.21145 8.69336C7.82636 8.47942 7.48405 8.13712 7.3129 7.62366C6.67108 6.4256 7.14175 4.88524 8.25424 4.24342C9.36672 3.6016 10.8215 4.02948 11.3778 5.27033C11.9768 6.51118 11.5489 8.05154 10.3508 8.69336C11.8912 9.03566 13.6455 10.1481 13.6455 13.1861C13.6455 13.9991 12.6614 13.9991 9.28115 13.9991C5.94369 13.9991 4.91678 13.9991 4.91678 13.1861ZM11.5917 8.3504C11.4633 8.43597 11.5061 8.60712 11.6344 8.64991C12.9609 9.035 14.3301 10.0619 14.544 12.3725C14.544 12.458 14.6296 12.5008 14.7152 12.5008C15.2714 12.4152 15.4854 12.2441 15.4854 11.9018C15.4854 9.67682 14.3301 8.6927 13.1748 8.3504C13.0464 8.30761 13.0464 8.13646 13.132 8.05088C13.9022 7.45185 14.1161 6.38216 13.6883 5.48361C13.3887 4.84179 12.7897 4.49949 12.1907 4.41391C12.0623 4.41391 11.9767 4.54228 12.0623 4.67064C12.1051 4.75622 12.1479 4.83109 12.1907 4.90597C12.2335 4.98085 12.2763 5.05573 12.319 5.14131C12.8325 6.25379 12.533 7.623 11.5917 8.3504ZM7.05614 8.3504C7.1845 8.43597 7.14172 8.60712 7.01335 8.64991C5.72972 9.035 4.3605 10.0619 4.10378 12.3725C4.10378 12.458 4.0182 12.5008 3.93263 12.5008C3.37638 12.4152 3.16244 12.2441 3.16244 11.9018C3.16244 9.67682 4.31772 8.6927 5.47299 8.3504C5.60135 8.30761 5.60135 8.13646 5.51578 8.05088C4.74559 7.45185 4.53166 6.38216 4.95953 5.48361C5.25905 4.84179 5.85808 4.4567 6.45711 4.41391C6.58547 4.41391 6.67105 4.54228 6.58547 4.67064C6.54269 4.75622 6.4999 4.83109 6.45711 4.90597C6.41432 4.98085 6.37153 5.05573 6.32875 5.14131C5.81529 6.25379 6.11481 7.623 7.05614 8.3504Z' fill='#FF7800'/></g></svg>
\ No newline at end of file
diff --git a/src/app/[lng]/dataStatistics/useDataStatistics.ts b/src/app/[lng]/dataStatistics/useDataStatistics.ts
new file mode 100644
index 00000000..c981d1d3
--- /dev/null
+++ b/src/app/[lng]/dataStatistics/useDataStatistics.ts
@@ -0,0 +1,31 @@
+import { create } from "zustand/index";
+import { combine } from "zustand/middleware";
+
+export interface IDataStatisticsStore {
+ // 当前选择的账户组IDs
+ choosedGroupIds: string[];
+}
+
+const state: IDataStatisticsStore = {
+ choosedGroupIds: [],
+};
+
+export const useDataStatisticsStore = create(
+ combine(
+ {
+ ...state,
+ },
+ (set, get) => {
+ const methods = {
+ // 设置选择账户组IDs
+ setChoosedGroupIds(choosedGroupIds: string[]) {
+ set({
+ choosedGroupIds,
+ });
+ },
+ };
+
+ return methods;
+ },
+ ),
+);
diff --git a/src/components/notification/NotificationPanel.tsx b/src/components/notification/NotificationPanel.tsx
index 459ce42a..0ee09c90 100644
--- a/src/components/notification/NotificationPanel.tsx
+++ b/src/components/notification/NotificationPanel.tsx
@@ -1177,7 +1177,7 @@ const NotificationPanel: React.FC<NotificationPanelProps> = ({ visible, onClose
]}
width={previewMedia?.type === 'video' ? 800 : 600}
zIndex={3000}
- destroyOnClose={true}
+ destroyOnHidden={true}
styles={{
body: {
padding: '24px',