首页概览引入底部组件

This commit is contained in:
禺狨
2023-03-20 15:38:11 +08:00
parent 099323ece1
commit 6baafcb579
3 changed files with 14 additions and 63 deletions

View File

@@ -1,40 +0,0 @@
import React, { useState, useEffect } from "react";
import ReactDOM from "react-dom/client";
import { Pie } from "@ant-design/plots";
const root = ReactDOM.createRoot(
document.getElementById("root") as HTMLElement
);
export const DemoPie = () => {
const data = [
{ type: "视频数", value: 27 },
{ type: "图片数", value: 25 },
];
const config = {
appendPadding: 10,
data,
angleField: "value",
colorField: "type",
radius: 1,
innerRadius: 0.6,
label: {
type: "inner",
offset: "-50%",
content: "{value}",
style: { textAlign: "center", fontSize: 14 },
},
interactions: [{ type: "element-selected" }, { type: "element-active" }],
statistic: {
content: {
style: {
whiteSpace: "pre-wrap",
overflow: "hidden",
textOverflow: "ellipsis",
},
content: "总资源数",
},
},
};
return <Pie {...config} />;
};
root.render(<DemoPie />);

View File

@@ -7,6 +7,7 @@ import icon from "../../assets/images/dashboard/icon-more.png";
import iconN1 from "../../assets/images/dashboard/icon-n1.png";
import iconN2 from "../../assets/images/dashboard/icon-n2.png";
import iconN3 from "../../assets/images/dashboard/icon-n3.png";
import { Footer } from "../../compenents/footer";
export const Dashboard: React.FC<any> = () => {
const navigate = useNavigate();
@@ -314,6 +315,7 @@ export const Dashboard: React.FC<any> = () => {
</div>
</div>
</Col>
<Footer></Footer>
</Row>
</>
);