refactor: 重构关于页面,整体更紧致,关键信息更突出

This commit is contained in:
xiaoxian521 2024-01-14 11:00:35 +08:00
parent 8b51731b58
commit 3873699370
9 changed files with 156 additions and 61 deletions

View File

@ -3,7 +3,13 @@ import { readdir, stat } from "node:fs";
import { fileURLToPath } from "node:url"; import { fileURLToPath } from "node:url";
import { dirname, resolve } from "node:path"; import { dirname, resolve } from "node:path";
import { sum, formatBytes } from "@pureadmin/utils"; import { sum, formatBytes } from "@pureadmin/utils";
import { dependencies, devDependencies, name, version } from "../package.json"; import {
name,
version,
engines,
dependencies,
devDependencies
} from "../package.json";
/** 启动`node`进程时所在工作目录的绝对路径 */ /** 启动`node`进程时所在工作目录的绝对路径 */
const root: string = process.cwd(); const root: string = process.cwd();
@ -35,9 +41,9 @@ const alias: Record<string, string> = {
"@build": pathResolve() "@build": pathResolve()
}; };
/** 平台的名称、版本、依赖、最后构建时间 */ /** 平台的名称、版本、运行所需的`node`和`pnpm`版本、依赖、最后构建时间的类型提示 */
const __APP_INFO__ = { const __APP_INFO__ = {
pkg: { name, version, dependencies, devDependencies }, pkg: { name, version, engines, dependencies, devDependencies },
lastBuildTime: dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss") lastBuildTime: dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss")
}; };

View File

@ -27,6 +27,7 @@ import Lollipop from "@iconify-icons/ep/lollipop";
import Monitor from "@iconify-icons/ep/monitor"; import Monitor from "@iconify-icons/ep/monitor";
import Tag from "@iconify-icons/ri/bookmark-2-line"; import Tag from "@iconify-icons/ri/bookmark-2-line";
import Table from "@iconify-icons/ri/table-line"; import Table from "@iconify-icons/ri/table-line";
import Info from "@iconify-icons/ri/file-info-line";
addIcon("ubuntuFill", UbuntuFill); addIcon("ubuntuFill", UbuntuFill);
addIcon("menu", Menu); addIcon("menu", Menu);
addIcon("edit", Edit); addIcon("edit", Edit);
@ -49,3 +50,4 @@ addIcon("lollipop", Lollipop);
addIcon("monitor", Monitor); addIcon("monitor", Monitor);
addIcon("tag", Tag); addIcon("tag", Tag);
addIcon("table", Table); addIcon("table", Table);
addIcon("info", Info);

View File

@ -12,12 +12,12 @@ const home = 0, // 平台规定只有 home 路由的 rank 才能为 0 ,所以
permission = 9, permission = 9,
system = 10, system = 10,
tabs = 11, tabs = 11,
formdesign = 12, about = 12,
flowchart = 13, formdesign = 13,
ppt = 14, flowchart = 14,
editor = 15, ppt = 15,
guide = 16, editor = 16,
about = 17, guide = 17,
menuoverflow = 18; menuoverflow = 18;
export { export {
@ -33,11 +33,11 @@ export {
permission, permission,
system, system,
tabs, tabs,
about,
formdesign, formdesign,
flowchart, flowchart,
ppt, ppt,
editor, editor,
guide, guide,
about,
menuoverflow menuoverflow
}; };

View File

@ -5,6 +5,7 @@ export default {
path: "/about", path: "/about",
redirect: "/about/index", redirect: "/about/index",
meta: { meta: {
icon: "info",
title: $t("menus.hsAbout"), title: $t("menus.hsAbout"),
rank: about rank: about
}, },

View File

@ -18,7 +18,7 @@ export default {
meta: { meta: {
title: $t("menus.hsFormDesign"), title: $t("menus.hsFormDesign"),
frameSrc: frameSrc:
"https://haixin-fang.github.io/starfish-vue3-lowcode/playground/index.html#/" "https://haixin-fang.github.io/vue-form-design/playground/index.html"
} }
} }
] ]

View File

@ -1,67 +1,99 @@
export function useColumns() { export function useColumns() {
const { pkg, lastBuildTime } = __APP_INFO__; const { pkg, lastBuildTime } = __APP_INFO__;
const { version } = pkg; const { version, engines } = pkg;
const columns = [ const columns = [
{ {
label: "版本", label: "当前版本",
cellRenderer: () => { cellRenderer: () => {
return <el-tag size="small">{version}</el-tag>; return (
<el-tag size="large" class="!text-base">
{version}
</el-tag>
);
} }
}, },
{ {
label: "最后编译时间", label: "最后编译时间",
cellRenderer: () => {
return <el-tag size="small">{lastBuildTime}</el-tag>;
}
},
{
label: "文档地址",
cellRenderer: () => { cellRenderer: () => {
return ( return (
<a <el-tag size="large" class="!text-base">
href="https://yiming_chang.gitee.io/pure-admin-doc" {lastBuildTime}
target="_blank" </el-tag>
>
<span style="color: var(--el-color-primary)"></span>
</a>
); );
} }
}, },
{ {
label: "预览地址", label: "推荐 node 版本",
cellRenderer: () => { cellRenderer: () => {
return ( return (
<a <el-tag size="large" class="!text-base">
href="https://yiming_chang.gitee.io/vue-pure-admin" {engines.node}
target="_blank" </el-tag>
>
<span style="color: var(--el-color-primary)"></span>
</a>
); );
} }
}, },
{ {
label: "Github", label: "推荐 pnpm 版本",
cellRenderer: () => {
return (
<el-tag size="large" class="!text-base">
{engines.pnpm}
</el-tag>
);
}
},
{
label: "完整版代码地址",
className: "pure-version",
cellRenderer: () => { cellRenderer: () => {
return ( return (
<a <a
href="https://github.com/pure-admin/vue-pure-admin" href="https://github.com/pure-admin/vue-pure-admin"
target="_blank" target="_blank"
> >
<span style="color: var(--el-color-primary)">Github</span> <span style="color: var(--el-color-primary)"></span>
</a> </a>
); );
} }
}, },
{ {
label: "精简版", label: "精简版代码地址",
className: "pure-version",
cellRenderer: () => { cellRenderer: () => {
return ( return (
<a <a
href="https://github.com/pure-admin/pure-admin-thin" href="https://github.com/pure-admin/pure-admin-thin"
target="_blank" target="_blank"
> >
<span style="color: var(--el-color-primary)"></span> <span style="color: var(--el-color-primary)"></span>
</a>
);
}
},
{
label: "文档地址",
className: "pure-version",
cellRenderer: () => {
return (
<a
href="https://yiming_chang.gitee.io/pure-admin-doc"
target="_blank"
>
<span style="color: var(--el-color-primary)"></span>
</a>
);
}
},
{
label: "预览地址",
className: "pure-version",
cellRenderer: () => {
return (
<a
href="https://yiming_chang.gitee.io/vue-pure-admin"
target="_blank"
>
<span style="color: var(--el-color-primary)"></span>
</a> </a>
); );
} }

View File

@ -1,5 +1,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { computed } from "vue";
import { useColumns } from "./columns"; import { useColumns } from "./columns";
export interface schemaItem { export interface schemaItem {
field: string; field: string;
label: string; label: string;
@ -17,6 +19,36 @@ const devSchema: schemaItem[] = [];
const { columns } = useColumns(); const { columns } = useColumns();
const words = [
"@pureadmin/descriptions",
"@pureadmin/table",
"@pureadmin/utils",
"@vueuse/core",
"axios",
"dayjs",
"echarts",
"vue",
"element-plus",
"pinia",
"vue-i18n",
"vue-router",
"@iconify/vue",
"@vitejs/plugin-vue",
"@vitejs/plugin-vue-jsx",
"eslint",
"prettier",
"sass",
"stylelint",
"tailwindcss",
"typescript",
"vite",
"vue-tsc"
];
const getMainLabel = computed(
() => (label: string) => words.find(w => w === label) && "main-label"
);
Object.keys(dependencies).forEach(key => { Object.keys(dependencies).forEach(key => {
schema.push({ field: dependencies[key], label: key }); schema.push({ field: dependencies[key], label: key });
}); });
@ -29,24 +61,21 @@ Object.keys(devDependencies).forEach(key => {
<template> <template>
<div> <div>
<el-card class="mb-4 box-card" shadow="never"> <el-card class="mb-4 box-card" shadow="never">
<template #header> <span>
<div class="card-header"> vue-pure-admin 是一款开源免费且开箱即用的中后台管理系统模版完全采用
<span class="font-medium">关于</span> ECMAScript 模块ESM规范来编写和组织代码使用了最新的
</div> Vue3ViteElement-PlusTypeScriptPiniaTailwindcss
</template> 等主流技术开发
<span style="font-size: 15px">
Pure-Admin 是一个基于Vue3ViteTypeScriptElement-Plus
的中后台解决方案它可以帮助您快速搭建企业级中后台提供现成的开箱解决方案及丰富的示例原则上不收取任何费用及版权可以放心使用不过如需二次开源比如用此平台二次开发并开源请联系作者获取许可
</span> </span>
</el-card> </el-card>
<el-card class="m-4 box-card" shadow="never"> <el-card class="m-4 box-card" shadow="never">
<template #header> <template #header>
<div class="card-header"> <div class="card-header">
<span class="font-medium">项目信息</span> <span class="font-medium">平台信息</span>
</div> </div>
</template> </template>
<PureDescriptions :columns="columns" border :column="3" align="left" /> <PureDescriptions border :columns="columns" :column="4" />
</el-card> </el-card>
<el-card class="m-4 box-card" shadow="never"> <el-card class="m-4 box-card" shadow="never">
@ -55,19 +84,24 @@ Object.keys(devDependencies).forEach(key => {
<span class="font-medium">生产环境依赖</span> <span class="font-medium">生产环境依赖</span>
</div> </div>
</template> </template>
<el-descriptions border> <el-descriptions border size="small" :column="6">
<el-descriptions-item <el-descriptions-item
v-for="(item, index) in schema" v-for="(item, index) in schema"
:key="index" :key="index"
:label="item.label" :label="item.label"
label-align="left" :label-class-name="getMainLabel(item.label)"
align="left" class-name="pure-version"
label-align="right"
> >
<a <a
:href="'https://www.npmjs.com/package/' + item.label" :href="'https://www.npmjs.com/package/' + item.label"
target="_blank" target="_blank"
> >
<span style="color: var(--el-color-primary)">{{ item.field }}</span> <span
:class="getMainLabel(item.label)"
style="color: var(--el-color-primary)"
>{{ item.field }}</span
>
</a> </a>
</el-descriptions-item> </el-descriptions-item>
</el-descriptions> </el-descriptions>
@ -79,19 +113,24 @@ Object.keys(devDependencies).forEach(key => {
<span class="font-medium">开发环境依赖</span> <span class="font-medium">开发环境依赖</span>
</div> </div>
</template> </template>
<el-descriptions border> <el-descriptions border size="small" :column="5">
<el-descriptions-item <el-descriptions-item
v-for="(item, index) in devSchema" v-for="(item, index) in devSchema"
:key="index" :key="index"
:label="item.label" :label="item.label"
label-align="left" :label-class-name="getMainLabel(item.label)"
align="left" class-name="pure-version"
label-align="right"
> >
<a <a
:href="'https://www.npmjs.com/package/' + item.label" :href="'https://www.npmjs.com/package/' + item.label"
target="_blank" target="_blank"
> >
<span style="color: var(--el-color-primary)">{{ item.field }}</span> <span
:class="getMainLabel(item.label)"
style="color: var(--el-color-primary)"
>{{ item.field }}</span
>
</a> </a>
</el-descriptions-item> </el-descriptions-item>
</el-descriptions> </el-descriptions>
@ -100,6 +139,21 @@ Object.keys(devDependencies).forEach(key => {
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
:deep(.main-label) {
font-size: 16px !important;
color: var(--el-color-danger) !important;
}
:deep(.pure-version) {
font-size: 14px !important;
font-weight: 600 !important;
opacity: 0.6;
&:hover {
opacity: 1;
}
}
.main-content { .main-content {
margin: 0 !important; margin: 0 !important;
} }

View File

@ -5,14 +5,11 @@ import "@logicflow/extension/lib/style/index.css";
import LogicFlow from "@logicflow/core"; import LogicFlow from "@logicflow/core";
import { ref, unref, onMounted } from "vue"; import { ref, unref, onMounted } from "vue";
import { useRenderIcon } from "@/components/ReIcon/src/hooks";
import { BpmnNode } from "@/components/ReFlowChart/src/config"; import { BpmnNode } from "@/components/ReFlowChart/src/config";
import { Snapshot, BpmnElement, Menu } from "@logicflow/extension"; import { Snapshot, BpmnElement, Menu } from "@logicflow/extension";
import { Control, NodePanel, DataDialog } from "@/components/ReFlowChart"; import { Control, NodePanel, DataDialog } from "@/components/ReFlowChart";
import { toLogicflowData } from "@/components/ReFlowChart/src/adpterForTurbo"; import { toLogicflowData } from "@/components/ReFlowChart/src/adpterForTurbo";
import SetUp from "@iconify-icons/ep/set-up";
defineOptions({ defineOptions({
name: "FlowChart" name: "FlowChart"
}); });
@ -71,9 +68,8 @@ onMounted(() => {
<span class="font-medium"> <span class="font-medium">
流程图组件采用开源的 流程图组件采用开源的
<el-link <el-link
href="http://logic-flow.org/" href="https://site.logic-flow.cn/docs/#/zh/guide/start"
target="_blank" target="_blank"
:icon="useRenderIcon(SetUp)"
style="margin: 0 4px 5px; font-size: 16px" style="margin: 0 4px 5px; font-size: 16px"
> >
LogicFlow LogicFlow

6
types/global.d.ts vendored
View File

@ -6,12 +6,16 @@ import type { TableColumns } from "@pureadmin/table";
*/ */
declare global { declare global {
/** /**
* * `node``pnpm`
*/ */
const __APP_INFO__: { const __APP_INFO__: {
pkg: { pkg: {
name: string; name: string;
version: string; version: string;
engines: {
node: string;
pnpm: string;
};
dependencies: Recordable<string>; dependencies: Recordable<string>;
devDependencies: Recordable<string>; devDependencies: Recordable<string>;
}; };