diff --git a/ui/autoMate/package-lock.json b/ui/autoMate/package-lock.json index 0368a97..a3827c2 100644 --- a/ui/autoMate/package-lock.json +++ b/ui/autoMate/package-lock.json @@ -16,6 +16,7 @@ "@types/mockjs": "^1.0.10", "antd": "^5.18.0", "better-sqlite3": "^11.0.0", + "dayjs": "^1.11.11", "electron-updater": "^6.1.7", "localforage": "^1.10.0", "match-sorter": "^6.3.4", @@ -4117,7 +4118,7 @@ }, "node_modules/dayjs": { "version": "1.11.11", - "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.11.tgz", + "resolved": "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.11.tgz", "integrity": "sha512-okzr3f11N6WuqYtZSvm+F776mB41wRZMhKP+hc34YdW+KmtYYK9iqvHSwo2k9FEH3fhGXvOPV6yz2IcSrfRUDg==" }, "node_modules/debug": { diff --git a/ui/autoMate/package.json b/ui/autoMate/package.json index a492c21..72f69e6 100644 --- a/ui/autoMate/package.json +++ b/ui/autoMate/package.json @@ -28,6 +28,7 @@ "@types/mockjs": "^1.0.10", "antd": "^5.18.0", "better-sqlite3": "^11.0.0", + "dayjs": "^1.11.11", "electron-updater": "^6.1.7", "localforage": "^1.10.0", "match-sorter": "^6.3.4", diff --git a/ui/autoMate/src/renderer/src/pages/Content/Content.tsx b/ui/autoMate/src/renderer/src/pages/Content/Content.tsx index abab1fe..f7e0095 100644 --- a/ui/autoMate/src/renderer/src/pages/Content/Content.tsx +++ b/ui/autoMate/src/renderer/src/pages/Content/Content.tsx @@ -1,6 +1,11 @@ import { useLoaderData } from "react-router-dom" - +import "./content.scss" export const Content = () => { const content = useLoaderData() as ContentType - return
{content.content}
+ return ( +
+

{content.title}

+
{content.content}
+
+ ) } \ No newline at end of file diff --git a/ui/autoMate/src/renderer/src/pages/Content/content.scss b/ui/autoMate/src/renderer/src/pages/Content/content.scss new file mode 100644 index 0000000..7632f33 --- /dev/null +++ b/ui/autoMate/src/renderer/src/pages/Content/content.scss @@ -0,0 +1,10 @@ +.content-page{ + @apply p-3; + h1{ + @apply text-base font-bold text-slate-600 opacity-95; + } + + .content{ + @apply text-sm text-slate-500 opacity-95 leading-relaxed; + } +} \ No newline at end of file diff --git a/ui/autoMate/src/renderer/src/pages/ContentList/content.scss b/ui/autoMate/src/renderer/src/pages/ContentList/contentList.scss similarity index 78% rename from ui/autoMate/src/renderer/src/pages/ContentList/content.scss rename to ui/autoMate/src/renderer/src/pages/ContentList/contentList.scss index 065c42d..ed649c9 100644 --- a/ui/autoMate/src/renderer/src/pages/ContentList/content.scss +++ b/ui/autoMate/src/renderer/src/pages/ContentList/contentList.scss @@ -1,4 +1,4 @@ -.content-page{ +.contentList-page{ @apply h-screen text-xs text-slate-700; display: grid; grid-template: "list content" auto / 150px auto; @@ -6,7 +6,7 @@ @apply bg-slate-50 border-r overflow-y-auto; grid-area: list; a { - @apply block truncate py-1 px-1 cursor-pointer; + @apply truncate py-1 px-1 cursor-pointer flex items-center gap-1 border-b mx-2; &.active{ // mx-1 外边距 @apply bg-blue-700 text-white mx-1 rounded-md; diff --git a/ui/autoMate/src/renderer/src/pages/ContentList/index.tsx b/ui/autoMate/src/renderer/src/pages/ContentList/index.tsx index 1cd700f..31a434c 100644 --- a/ui/autoMate/src/renderer/src/pages/ContentList/index.tsx +++ b/ui/autoMate/src/renderer/src/pages/ContentList/index.tsx @@ -1,6 +1,7 @@ import { NavLink, Outlet, useLoaderData, useNavigate } from "react-router-dom" -import "./content.scss" +import "./contentList.scss" import { useEffect } from "react" +import dayjs from "dayjs" export const ContentList = () => { const contentList = useLoaderData() as ContentType[] @@ -10,13 +11,16 @@ export const ContentList = () => { navigate(`/config/category/contentList/${contentList[0].category_id}/content/${contentList[0].id}`) } }, [contentList]) - return (
+ return (
{contentList.map(content => ( `${isActive ? "active" : ""}`}> {content.title} + className={({ isActive }) => `${isActive ? "active" : ""}`}> +
{content.title}
+
{dayjs(content.created_at).format("YYYY/MM/DD")}
+ ))}
diff --git a/ui/autoMate/types.d.ts b/ui/autoMate/types.d.ts index af8cfed..8f76e6a 100644 --- a/ui/autoMate/types.d.ts +++ b/ui/autoMate/types.d.ts @@ -11,5 +11,5 @@ type ContentType = { title: string content: string category_id: string - createdAt: string + created_at: string } \ No newline at end of file