This commit is contained in:
2025-10-20 20:53:14 +08:00
parent e2e1e9e9e9
commit b5430eb8d0
7 changed files with 230 additions and 29 deletions

View File

@@ -1,6 +1,7 @@
import { useState } from "react";
import { useEffect, useState } from "react";
import { Base } from "./table/index";
import { markService } from "../modules/mark-service";
import { SigmaGraph } from "./graph/sigma/index";
const tabs = [
{
key: 'table',
@@ -22,15 +23,22 @@ const tabs = [
export const BaseApp = () => {
const [activeTab, setActiveTab] = useState('table');
const [dataSource, setDataSource] = useState<any[]>([]);
useEffect(() => {
getMarks();
}, []);
const getMarks = async () => {
const marks = await markService.getAllMarks();
setDataSource(marks);
}
const renderContent = () => {
switch (activeTab) {
case 'table':
return <Base />;
return <Base dataSource={dataSource} />;
case 'graph':
return (
<div className="flex items-center justify-center h-96 text-gray-500">
<div className="w-full h-96">
<SigmaGraph dataSource={dataSource} />
</div>
);
case 'world':