Skip to content

Let's use AI to Earn!

feat(数据统计): 数据明细完成

gaoSir4f088bc4ae24
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index b6b451c5..16ec35ea 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,11 +4,20 @@
<option name="autoReloadType" value="NONE" />
</component>
<component name="ChangeListManager">
- <list default="true" id="8ce961ad-7c9e-494c-bc53-9ecde4358af8" name="更改" comment="feat(数据统计): 1. 找不到空间的账号更改为默认账号的ID。 2. 完善swiper。 3. 添加过滤后的账号">
+ <list default="true" id="8ce961ad-7c9e-494c-bc53-9ecde4358af8" name="更改" comment="feat(数据统计): 顶部账号完成">
+ <change afterPath="$PROJECT_DIR$/src/app/[lng]/dataStatistics/components/DataStatisticsDetails/dataStatisticsDetails.module.scss" afterDir="false" />
+ <change afterPath="$PROJECT_DIR$/src/app/[lng]/dataStatistics/components/DataStatisticsDetails/index.tsx" afterDir="false" />
+ <change afterPath="$PROJECT_DIR$/src/app/[lng]/dataStatistics/svgs/collectCount.svg" afterDir="false" />
+ <change afterPath="$PROJECT_DIR$/src/app/[lng]/dataStatistics/svgs/fansCount.svg" afterDir="false" />
+ <change afterPath="$PROJECT_DIR$/src/app/[lng]/dataStatistics/svgs/forwardCount.svg" afterDir="false" />
+ <change afterPath="$PROJECT_DIR$/src/app/[lng]/dataStatistics/useDataStatistics.tsx" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" 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/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/AvatarPlat/avatarPlat.module.scss" beforeDir="false" afterPath="$PROJECT_DIR$/src/components/AvatarPlat/avatarPlat.module.scss" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/src/app/[lng]/dataStatistics/dataStatistics.module.scss" beforeDir="false" afterPath="$PROJECT_DIR$/src/app/[lng]/dataStatistics/dataStatistics.module.scss" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/src/app/[lng]/dataStatistics/useDataStatistics.ts" beforeDir="false" />
+ <change beforePath="$PROJECT_DIR$/src/app/styles/mixin.scss" beforeDir="false" afterPath="$PROJECT_DIR$/src/app/styles/mixin.scss" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -206,7 +215,7 @@
<workItem from="1757646405605" duration="66000" />
<workItem from="1757646484870" duration="466000" />
<workItem from="1757647784882" duration="2426000" />
- <workItem from="1757656251307" duration="14862000" />
+ <workItem from="1757656251307" duration="21340000" />
</task>
<task id="LOCAL-00001" summary="feat(CalendarTiming): 优化发布记录列表展示&#10;- 调整日历记录项的样式和布局&#10;- 优化 RecordCore组件,添加平台图标和时间显示&#10;- 修改 CalendarTimingItem 组件,移除不必要的 Fragment&#10;-调整 index.tsx 中的日期格式化逻辑">
<option name="closed" value="true" />
@@ -592,7 +601,15 @@
<option name="project" value="LOCAL" />
<updated>1757674748578</updated>
</task>
- <option name="localTasksCounter" value="49" />
+ <task id="LOCAL-00049" summary="feat(数据统计): 顶部账号完成">
+ <option name="closed" value="true" />
+ <created>1757676377923</created>
+ <option name="number" value="00049" />
+ <option name="presentableId" value="LOCAL-00049" />
+ <option name="project" value="LOCAL" />
+ <updated>1757676377923</updated>
+ </task>
+ <option name="localTasksCounter" value="50" />
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
@@ -662,7 +679,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(发布弹框): 立即发布接入API" />
<MESSAGE value="fix(日历): 删除最佳时间" />
<MESSAGE value="chore: 测试静态站点" />
<MESSAGE value="选择用户弹框恢复" />
@@ -687,6 +703,7 @@
<MESSAGE value="feat: 创建数据统计header" />
<MESSAGE value="feat(数据统计): 顶部筛选完成" />
<MESSAGE value="feat(数据统计): 1. 找不到空间的账号更改为默认账号的ID。 2. 完善swiper。 3. 添加过滤后的账号" />
- <option name="LAST_COMMIT_MESSAGE" value="feat(数据统计): 1. 找不到空间的账号更改为默认账号的ID。 2. 完善swiper。 3. 添加过滤后的账号" />
+ <MESSAGE value="feat(数据统计): 顶部账号完成" />
+ <option name="LAST_COMMIT_MESSAGE" value="feat(数据统计): 顶部账号完成" />
</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 8d44ee32..70b911dc 100644
--- a/src/app/[lng]/dataStatistics/DataStatisticsCore.tsx
+++ b/src/app/[lng]/dataStatistics/DataStatisticsCore.tsx
@@ -6,14 +6,16 @@ import { useDataStatisticsStore } from "@/app/[lng]/dataStatistics/useDataStatis
import { useShallow } from "zustand/react/shallow";
import { useEffect } from "react";
import { useAccountStore } from "@/store/account";
+import DataStatisticsDetails from "@/app/[lng]/dataStatistics/components/DataStatisticsDetails";
export const DataStatisticsCore = () => {
- const { setChoosedGroupIds, setFilteredAccountList, choosedGroupIds } =
+ const { setChoosedGroupIds, setFilteredAccountList, choosedGroupIds, init } =
useDataStatisticsStore(
useShallow((state) => ({
setChoosedGroupIds: state.setChoosedGroupIds,
setFilteredAccountList: state.setFilteredAccountList,
choosedGroupIds: state.choosedGroupIds,
+ init: state.init,
})),
);
const { accountGroupList, accountList } = useAccountStore(
@@ -23,6 +25,10 @@ export const DataStatisticsCore = () => {
})),
);
+ useEffect(() => {
+ init();
+ }, []);
+
useEffect(() => {
if (accountGroupList.length > 0) {
setChoosedGroupIds(accountGroupList.map((group) => group.id));
@@ -41,6 +47,7 @@ export const DataStatisticsCore = () => {
return (
<div className={styles.dataStatistics}>
<DataStatisticsHeader />
+ <DataStatisticsDetails />
</div>
);
};
diff --git a/src/app/[lng]/dataStatistics/components/DataStatisticsDetails/dataStatisticsDetails.module.scss b/src/app/[lng]/dataStatistics/components/DataStatisticsDetails/dataStatisticsDetails.module.scss
new file mode 100644
index 00000000..122f561c
--- /dev/null
+++ b/src/app/[lng]/dataStatistics/components/DataStatisticsDetails/dataStatisticsDetails.module.scss
@@ -0,0 +1,71 @@
+.dataStatisticsDetails {
+ :global {
+ h3 {
+ margin: 30px 0;
+ position: relative;
+ padding-left: 20px;
+ &:after {
+ content: "";
+ display: block;
+ position: absolute;
+ top: 53%;
+ transform: translateY(-50%);
+ left: 0;
+ width: 2px;
+ height: 60%;
+ background: var(--colorPrimary5);
+ }
+ }
+
+ .dataStatisticsDetails-content {
+ display: flex;
+ gap: 15px;
+ &-item {
+ background: rgb(247, 250, 250);
+ flex: 1;
+ border-radius: 8px;
+ box-sizing: border-box;
+ padding: 15px;
+ height: 105px;
+ border: 1px solid transparent;
+ cursor: pointer;
+ &-title {
+ margin-bottom: 5px;
+ }
+ &-count {
+ font-size: var(--fs-lg);
+ }
+ &-yesterday {
+ margin-top: 5px;
+ background: rgb(237, 242, 242);
+ display: inline-block;
+ border-radius: 30px;
+ padding: 2px 8px;
+ font-size: var(--fs-xs);
+ b {
+ margin-left: 5px;
+ }
+ }
+ &-icon {
+ display: inline-block;
+ margin-right: 10px;
+ svg, {
+ font-size: 18px;
+ fill: var(--colorPrimary5);
+ }
+ }
+ &:hover {
+ opacity: 0.7;
+ }
+ &--active {
+ background: #fff;
+ border: 1px solid var(--colorPrimary5);
+ .dataStatisticsDetails-content-item-title {
+ color: var(--colorPrimary5);
+ }
+ @include triangle-indicator(12px, #fff, var(--colorPrimary5), 1px);
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/app/[lng]/dataStatistics/components/DataStatisticsDetails/index.tsx b/src/app/[lng]/dataStatistics/components/DataStatisticsDetails/index.tsx
new file mode 100644
index 00000000..81a3ce39
--- /dev/null
+++ b/src/app/[lng]/dataStatistics/components/DataStatisticsDetails/index.tsx
@@ -0,0 +1,65 @@
+import { ForwardedRef, forwardRef, memo } from "react";
+import styles from "./dataStatisticsDetails.module.scss";
+import { useDataStatisticsStore } from "@/app/[lng]/dataStatistics/useDataStatistics";
+import { useShallow } from "zustand/react/shallow";
+import Icon from "@ant-design/icons";
+
+export interface IDataStatisticsDetailsRef {}
+
+export interface IDataStatisticsDetailsProps {}
+
+const DataStatisticsDetails = memo(
+ forwardRef(
+ (
+ {}: IDataStatisticsDetailsProps,
+ ref: ForwardedRef<IDataStatisticsDetailsRef>,
+ ) => {
+ const { currentDetailType, dataDetails, setCurrentDetailType } =
+ useDataStatisticsStore(
+ useShallow((state) => ({
+ dataDetails: state.dataDetails,
+ currentDetailType: state.currentDetailType,
+ setCurrentDetailType: state.setCurrentDetailType,
+ })),
+ );
+
+ return (
+ <div className={styles.dataStatisticsDetails}>
+ <h3>数据明细</h3>
+
+ <div className="dataStatisticsDetails-content">
+ {dataDetails.map((detail) => (
+ <div
+ key={detail.value}
+ className={`dataStatisticsDetails-content-item ${
+ currentDetailType === detail.value
+ ? "dataStatisticsDetails-content-item--active"
+ : ""
+ }`}
+ onClick={() => {
+ setCurrentDetailType(detail.value);
+ }}
+ >
+ <p className="dataStatisticsDetails-content-item-title">
+ <span className="dataStatisticsDetails-content-item-icon">
+ <Icon component={detail.icon} />
+ </span>
+ {detail.title}
+ </p>
+ <p className="dataStatisticsDetails-content-item-count">
+ {detail.total}
+ </p>
+ <p className="dataStatisticsDetails-content-item-yesterday">
+ 昨日新增
+ <b>{detail.yesterday}</b>
+ </p>
+ </div>
+ ))}
+ </div>
+ </div>
+ );
+ },
+ ),
+);
+
+export default DataStatisticsDetails;
diff --git a/src/app/[lng]/dataStatistics/components/DataStatisticsHeader/dataStatisticsHeader.module.scss b/src/app/[lng]/dataStatistics/components/DataStatisticsHeader/dataStatisticsHeader.module.scss
index f3c912d5..820e5995 100644
--- a/src/app/[lng]/dataStatistics/components/DataStatisticsHeader/dataStatisticsHeader.module.scss
+++ b/src/app/[lng]/dataStatistics/components/DataStatisticsHeader/dataStatisticsHeader.module.scss
@@ -1,7 +1,4 @@
.dataStatisticsHeader {
- //display: flex;
- //height: 100px;
- padding: 15px;
:global {
.dataStatisticsHeader-top {
display: flex;
diff --git a/src/app/[lng]/dataStatistics/components/DataStatisticsHeader/index.tsx b/src/app/[lng]/dataStatistics/components/DataStatisticsHeader/index.tsx
index b2faae1a..1301f536 100644
--- a/src/app/[lng]/dataStatistics/components/DataStatisticsHeader/index.tsx
+++ b/src/app/[lng]/dataStatistics/components/DataStatisticsHeader/index.tsx
@@ -4,7 +4,7 @@ import AccountCount from "../../svgs/accountCount.svg";
import { Swiper, SwiperSlide } from "swiper/react";
import { useAccountStore } from "@/store/account";
import { useShallow } from "zustand/react/shallow";
-import { Button, Input, Select, Tag, Tooltip } from "antd";
+import { Button, Input, Select, Skeleton, Tag, Tooltip } from "antd";
import { useDataStatisticsStore } from "@/app/[lng]/dataStatistics/useDataStatistics";
import {
CheckCircleOutlined,
@@ -83,36 +83,42 @@ const DataStatisticsHeader = memo(
<div className="dataStatisticsHeader-accounts-swiper">
<Button className="swiper-prev" icon={<LeftOutlined />} />
- <Swiper
- modules={[Navigation]}
- slidesPerView={4}
- slidesPerGroup={4}
- navigation={{
- prevEl: ".swiper-prev",
- nextEl: ".swiper-next",
- }}
- >
- {filteredAccountList.map((account) => {
- return (
- <SwiperSlide key={account.id}>
- <div className="accounts-swiper-item">
- <div className="accounts-swiper-item-info">
- <AvatarPlat account={account} size="large" />
- <Tooltip title={account.nickname}>
- <div className="accounts-swiper-item-info-name">
- {account.nickname}
- </div>
- </Tooltip>
- </div>
- <div className="accounts-swiper-item-fans">
- 粉丝数 <span>{account.fansCount}</span>
+ {accountGroupList.length === 0 ? (
+ <Skeleton active />
+ ) : (
+ <Swiper
+ modules={[Navigation]}
+ slidesPerView={4}
+ slidesPerGroup={4}
+ navigation={{
+ prevEl: ".swiper-prev",
+ nextEl: ".swiper-next",
+ }}
+ >
+ {filteredAccountList.map((account) => {
+ return (
+ <SwiperSlide key={account.id}>
+ <div className="accounts-swiper-item">
+ <div className="accounts-swiper-item-info">
+ <AvatarPlat account={account} size="large" />
+ <Tooltip title={account.nickname}>
+ <div className="accounts-swiper-item-info-name">
+ {account.nickname}
+ </div>
+ </Tooltip>
+ </div>
+
+ <div className="accounts-swiper-item-fans">
+ 粉丝数 <span>{account.fansCount}</span>
+ </div>
</div>
- </div>
- </SwiperSlide>
- );
- })}
- </Swiper>
+ </SwiperSlide>
+ );
+ })}
+ </Swiper>
+ )}
+
<Button className="swiper-next" icon={<RightOutlined />} />
</div>
</div>
diff --git a/src/app/[lng]/dataStatistics/dataStatistics.module.scss b/src/app/[lng]/dataStatistics/dataStatistics.module.scss
index 5911873f..efc7582a 100644
--- a/src/app/[lng]/dataStatistics/dataStatistics.module.scss
+++ b/src/app/[lng]/dataStatistics/dataStatistics.module.scss
@@ -1,3 +1,3 @@
.dataStatistics {
-
+ padding: 20px;
}
\ No newline at end of file
diff --git a/src/app/[lng]/dataStatistics/svgs/collectCount.svg b/src/app/[lng]/dataStatistics/svgs/collectCount.svg
new file mode 100644
index 00000000..96b75f29
--- /dev/null
+++ b/src/app/[lng]/dataStatistics/svgs/collectCount.svg
@@ -0,0 +1 @@
+<svg width='24' height='24' viewBox='0 0 12 12' fill='none' xmlns='http://www.w3.org/2000/svg'><g id='Frame 3984'><path id='Vector' d='M3.41383 10C3.21949 10 3.02515 9.94231 2.86026 9.82115C2.5658 9.61346 2.42447 9.26154 2.48336 8.91539L2.84259 6.85C2.84848 6.82692 2.8367 6.79808 2.81903 6.78654L1.28787 5.32692C1.02875 5.07885 0.934523 4.71538 1.04642 4.375C1.15831 4.03462 1.45276 3.79231 1.812 3.74039L3.92618 3.44038C3.94974 3.43462 3.9733 3.42308 3.98507 3.4L4.93322 1.51923C5.09223 1.20192 5.42202 1 5.78125 1C6.14637 1 6.47027 1.19615 6.62928 1.51923L7.57742 3.4C7.5892 3.42308 7.61276 3.43462 7.63632 3.44038L9.7505 3.74039C10.1097 3.79231 10.4042 4.03462 10.5161 4.375C10.628 4.71538 10.5338 5.07885 10.2746 5.32692L8.74347 6.78654C8.7258 6.80385 8.71991 6.82692 8.71991 6.85L9.07914 8.91539C9.13803 9.26731 8.9967 9.61346 8.70224 9.82115C8.40779 10.0288 8.025 10.0577 7.70698 9.89038L5.81658 8.91539C5.79303 8.90385 5.76947 8.90385 5.74591 8.91539L3.85552 9.89038C3.71418 9.96538 3.56695 10 3.41383 10Z' fill='#a66ae4'/></g></svg>
\ No newline at end of file
diff --git a/src/app/[lng]/dataStatistics/svgs/fansCount.svg b/src/app/[lng]/dataStatistics/svgs/fansCount.svg
new file mode 100644
index 00000000..2ca82343
--- /dev/null
+++ b/src/app/[lng]/dataStatistics/svgs/fansCount.svg
@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1757680278444" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5392" xmlns:xlink="http://www.w3.org/1999/xlink" width="300" height="300"><path d="M778.24 931.84c-71.68 23.893333-184.32 27.306667-307.2 27.306667-235.52 0-416.426667-27.306667-416.426667-98.986667 0-133.12 122.88-249.173333 300.373334-286.72-102.4-47.786667-160.426667-163.84-136.533334-276.48C242.346667 184.32 341.333333 102.4 453.973333 102.4c112.64 0 208.213333 78.506667 235.52 191.146667 23.893333 112.64-27.306667 228.693333-129.706666 276.48 27.306667 6.826667 54.613333 13.653333 81.92 23.893333-27.306667 23.893333-40.96 58.026667-40.96 95.573333-3.413333 122.88 112.64 197.973333 177.493333 242.346667z m-27.306667-334.506667c27.306667 0 51.2 13.653333 68.266667 34.133334 17.066667-20.48 40.96-34.133333 68.266667-34.133334 51.2 0 92.16 40.96 92.16 95.573334 0 105.813333-116.053333 163.84-153.6 197.973333l-3.413334 3.413333-6.826666-6.826666c-37.546667-34.133333-153.6-88.746667-153.6-197.973334 0-51.2 40.96-92.16 88.746666-92.16z" p-id="5393"></path></svg>
\ No newline at end of file
diff --git a/src/app/[lng]/dataStatistics/svgs/forwardCount.svg b/src/app/[lng]/dataStatistics/svgs/forwardCount.svg
new file mode 100644
index 00000000..8833c830
--- /dev/null
+++ b/src/app/[lng]/dataStatistics/svgs/forwardCount.svg
@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1757680365284" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7235" xmlns:xlink="http://www.w3.org/1999/xlink" width="300" height="300"><path d="M625.792 302.912V64L1024 482.112l-398.208 418.176V655.36C341.312 655.36 142.208 750.912 0 960c56.896-298.688 227.584-597.312 625.792-657.088z" p-id="7236"></path></svg>
\ No newline at end of file
diff --git a/src/app/[lng]/dataStatistics/useDataStatistics.ts b/src/app/[lng]/dataStatistics/useDataStatistics.ts
deleted file mode 100644
index fd6e0556..00000000
--- a/src/app/[lng]/dataStatistics/useDataStatistics.ts
+++ /dev/null
@@ -1,41 +0,0 @@
-import { create } from "zustand/index";
-import { combine } from "zustand/middleware";
-import { SocialAccount } from "@/api/types/account.type";
-
-export interface IDataStatisticsStore {
- // 当前选择的账户组IDs
- choosedGroupIds: string[];
- // 过滤之后的账户
- filteredAccountList: SocialAccount[];
-}
-
-const state: IDataStatisticsStore = {
- choosedGroupIds: [],
- filteredAccountList: [],
-};
-
-export const useDataStatisticsStore = create(
- combine(
- {
- ...state,
- },
- (set, get) => {
- const methods = {
- // 设置选择账户组IDs
- setChoosedGroupIds(choosedGroupIds: string[]) {
- set({
- choosedGroupIds,
- });
- },
- // 设置过滤之后的账户
- setFilteredAccountList(filteredAccountList: SocialAccount[]) {
- set({
- filteredAccountList,
- });
- },
- };
-
- return methods;
- },
- ),
-);
diff --git a/src/app/[lng]/dataStatistics/useDataStatistics.tsx b/src/app/[lng]/dataStatistics/useDataStatistics.tsx
new file mode 100644
index 00000000..50f29255
--- /dev/null
+++ b/src/app/[lng]/dataStatistics/useDataStatistics.tsx
@@ -0,0 +1,119 @@
+import { create } from "zustand/index";
+import { combine } from "zustand/middleware";
+import { SocialAccount } from "@/api/types/account.type";
+import FansCount from "./svgs/fansCount.svg";
+import CollectCount from "./svgs/collectCount.svg";
+import ForwardCount from "./svgs/forwardCount.svg";
+import {
+ HeartFilled,
+ VideoCameraFilled,
+ MessageFilled,
+} from "@ant-design/icons";
+
+export interface IDataStatisticsStore {
+ // 当前选择的账户组IDs
+ choosedGroupIds: string[];
+ // 过滤之后的账户
+ filteredAccountList: SocialAccount[];
+ // 数据明细
+ dataDetails: {
+ title: string;
+ value: string;
+ icon: any;
+ // 总数
+ total: number;
+ // 昨日数
+ yesterday: number;
+ }[];
+ // 当前选择的明细类型
+ currentDetailType: string;
+}
+
+const state: IDataStatisticsStore = {
+ choosedGroupIds: [],
+ filteredAccountList: [],
+ dataDetails: [
+ {
+ title: "涨粉数",
+ value: "fansCount",
+ icon: FansCount,
+ total: 0,
+ yesterday: 0,
+ },
+ {
+ title: "播放数",
+ value: "readCount",
+ icon: VideoCameraFilled,
+ total: 0,
+ yesterday: 0,
+ },
+ {
+ title: "评论数",
+ value: "commentCount",
+ icon: MessageFilled,
+ total: 0,
+ yesterday: 0,
+ },
+ {
+ title: "点赞数",
+ value: "likeCount",
+ icon: HeartFilled,
+ total: 0,
+ yesterday: 0,
+ },
+ {
+ title: "收藏数",
+ value: "collectCount",
+ icon: CollectCount,
+ total: 0,
+ yesterday: 0,
+ },
+ {
+ title: "分享数",
+ value: "forwardCount",
+ icon: ForwardCount,
+ total: 0,
+ yesterday: 0,
+ },
+ ],
+ currentDetailType: "",
+};
+
+export const useDataStatisticsStore = create(
+ combine(
+ {
+ ...state,
+ },
+ (set, get) => {
+ const methods = {
+ init() {
+ set({
+ currentDetailType: get().dataDetails[0].value,
+ });
+ },
+
+ // 设置 currentDetailType
+ setCurrentDetailType(currentDetailType: string) {
+ set({
+ currentDetailType,
+ });
+ },
+
+ // 设置选择账户组IDs
+ setChoosedGroupIds(choosedGroupIds: string[]) {
+ set({
+ choosedGroupIds,
+ });
+ },
+ // 设置过滤之后的账户
+ setFilteredAccountList(filteredAccountList: SocialAccount[]) {
+ set({
+ filteredAccountList,
+ });
+ },
+ };
+
+ return methods;
+ },
+ ),
+);
diff --git a/src/app/styles/mixin.scss b/src/app/styles/mixin.scss
index 7d613f41..e7b9d1f5 100644
--- a/src/app/styles/mixin.scss
+++ b/src/app/styles/mixin.scss
@@ -49,4 +49,29 @@
-webkit-box-orient: vertical;
-webkit-line-clamp: $line;
overflow: hidden;
+}
+
+@mixin triangle-indicator($size: 12px, $color: #fff, $active-color: var(--colorPrimary5), $border-width: 1px) {
+ position: relative;
+
+ &:after,
+ &:before {
+ content: '';
+ position: absolute;
+ bottom: 0;
+ left: 50%;
+ transform: translate(-50%, 100%);
+ border: $size solid $color;
+ border-bottom: none;
+ border-right-color: transparent;
+ border-left-color: transparent;
+ }
+ &:before {
+ bottom: $border-width;
+ z-index: 2;
+ }
+ &:after {
+ border-top-color: $active-color;
+ bottom: 0;
+ }
}
\ No newline at end of file