From cd6db3d4911be4f0e601e2f036f2d74f18126435 Mon Sep 17 00:00:00 2001 From: Soybean Date: Mon, 8 Nov 2021 05:13:48 +0800 Subject: [PATCH] =?UTF-8?q?refactor(projects):=20=E5=8E=BB=E9=99=A4vicons?= =?UTF-8?q?=EF=BC=8C=E7=BB=9F=E4=B8=80=E4=BD=BF=E7=94=A8iconify=E5=9B=BE?= =?UTF-8?q?=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build/plugins/iconify.ts | 7 - doc/iconify使用文档.md | 24 ++++ package.json | 8 -- pnpm-lock.yaml | 64 --------- .../common/SystemLogo/components/SvgLogo.vue | 2 +- src/interface/common.ts | 3 +- .../components/GlobalBreadcrumb.vue | 27 +++- .../GlobalHeader/components/UserAvatar.vue | 9 +- .../components/common/ContextMenu.vue | 13 +- src/router/modules/about.ts | 3 +- src/router/modules/component.ts | 3 +- src/router/modules/dashboard.ts | 3 +- src/router/modules/document.ts | 3 +- src/router/modules/exception.ts | 3 +- src/router/modules/multiMenu.ts | 3 +- src/settings/theme.json | 2 +- src/settings/theme.ts | 2 +- src/utils/common/icon.ts | 25 ++-- src/utils/router/menus.ts | 7 +- .../analysis/components/DataCard/index.vue | 17 +-- .../components/WorkbenchHeader/index.vue | 6 +- .../components/ShortcutsCard.vue | 32 +++++ .../components/TechnologyCard.vue | 32 +++++ .../WorkbenchMain/components/index.ts | 4 + .../components/WorkbenchMain/index.vue | 132 ++++++++++++++++-- windi.config.ts | 1 + 26 files changed, 290 insertions(+), 145 deletions(-) create mode 100644 doc/iconify使用文档.md create mode 100644 src/views/dashboard/workbench/components/WorkbenchMain/components/ShortcutsCard.vue create mode 100644 src/views/dashboard/workbench/components/WorkbenchMain/components/TechnologyCard.vue create mode 100644 src/views/dashboard/workbench/components/WorkbenchMain/components/index.ts diff --git a/build/plugins/iconify.ts b/build/plugins/iconify.ts index 1636f5a8..5f985df5 100644 --- a/build/plugins/iconify.ts +++ b/build/plugins/iconify.ts @@ -8,10 +8,3 @@ export default [ }), Icons() ]; - -/** - * iconify用法(安装对应的vscode智能提示的插件: Iconify IntelliSense) - * 找图标:网址 https://icones.js.org/ 或者 vscode安装 icones插件 - * 确定图标名字:找到图标后复制名字 如:mdi:ab-testing 组件为: - * 样式:同html标签一样直接应用style属性或者class属性; 通过设置color和font-size属性设置对应的颜色和大小 - */ diff --git a/doc/iconify使用文档.md b/doc/iconify使用文档.md new file mode 100644 index 00000000..144e412e --- /dev/null +++ b/doc/iconify使用文档.md @@ -0,0 +1,24 @@ +iconify用法 + +一、静态用法:直接用图标的组件名称 +1.安装vscode智能提示的插件: Iconify IntelliSense +2.找图标:网址 https://icones.js.org/ 或者 vscode安装 icones插件 +3.确定图标名字:找到图标后复制名字 如:'mdi:emoticon' 组件为: +4.设置样式:同html标签一样直接应用style属性或者class属性; 通过设置color和font-size属性设置对应的颜色和大小 + +二、多个图标动态渲染 +1.确定图标名字,如:'mdi:emoticon' +2.引入Icon组件: +import { Icon } from '@iconify/vue'; +3.动态渲染 +ps:Icon组件属性 https://docs.iconify.design/icon-components/vue/ + +三、结合naiveUI组件动态渲染 +1.确定图标名字,如:'mdi:emoticon' +2.引入vue的h函数: +import { h } from 'vue'; +3.引入Icon组件 +import { Icon } from '@iconify/vue'; +4.动态渲染 +() => h(Icon, { icon: 'mdi:emoticon', style: { color: '#f00', fontSize: '16px' } }) +ps:@/uitls已封装好了函数:iconifyRender diff --git a/package.json b/package.json index d1f39f9b..7e590115 100644 --- a/package.json +++ b/package.json @@ -41,14 +41,6 @@ "@types/qs": "^6.9.7", "@typescript-eslint/eslint-plugin": "^5.3.0", "@typescript-eslint/parser": "^5.3.0", - "@vicons/antd": "^0.11.0", - "@vicons/carbon": "^0.11.0", - "@vicons/fa": "^0.11.0", - "@vicons/fluent": "^0.11.0", - "@vicons/ionicons4": "^0.11.0", - "@vicons/ionicons5": "^0.11.0", - "@vicons/material": "^0.11.0", - "@vicons/tabler": "^0.11.0", "@vitejs/plugin-vue": "^1.9.4", "@vue/compiler-sfc": "^3.2.21", "@vue/eslint-config-prettier": "^6.0.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8f8f4f46..114a34e5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -11,14 +11,6 @@ specifiers: '@types/qs': ^6.9.7 '@typescript-eslint/eslint-plugin': ^5.3.0 '@typescript-eslint/parser': ^5.3.0 - '@vicons/antd': ^0.11.0 - '@vicons/carbon': ^0.11.0 - '@vicons/fa': ^0.11.0 - '@vicons/fluent': ^0.11.0 - '@vicons/ionicons4': ^0.11.0 - '@vicons/ionicons5': ^0.11.0 - '@vicons/material': ^0.11.0 - '@vicons/tabler': ^0.11.0 '@vitejs/plugin-vue': ^1.9.4 '@vue/compiler-sfc': ^3.2.21 '@vue/eslint-config-prettier': ^6.0.0 @@ -85,14 +77,6 @@ devDependencies: '@types/qs': registry.nlark.com/@types/qs/6.9.7 '@typescript-eslint/eslint-plugin': registry.npmmirror.com/@typescript-eslint/eslint-plugin/5.3.0_f8873316f48f7781ccc3e081fc76e214 '@typescript-eslint/parser': registry.npmmirror.com/@typescript-eslint/parser/5.3.0_eslint@8.1.0+typescript@4.4.4 - '@vicons/antd': registry.nlark.com/@vicons/antd/0.11.0 - '@vicons/carbon': registry.nlark.com/@vicons/carbon/0.11.0 - '@vicons/fa': registry.nlark.com/@vicons/fa/0.11.0 - '@vicons/fluent': registry.nlark.com/@vicons/fluent/0.11.0 - '@vicons/ionicons4': registry.nlark.com/@vicons/ionicons4/0.11.0 - '@vicons/ionicons5': registry.nlark.com/@vicons/ionicons5/0.11.0 - '@vicons/material': registry.nlark.com/@vicons/material/0.11.0 - '@vicons/tabler': registry.nlark.com/@vicons/tabler/0.11.0 '@vitejs/plugin-vue': registry.npmmirror.com/@vitejs/plugin-vue/1.9.4_vite@2.5.10 '@vue/compiler-sfc': registry.npmmirror.com/@vue/compiler-sfc/3.2.21 '@vue/eslint-config-prettier': 6.0.0_91df2dbc49a694d3127d896fd063ef53 @@ -902,54 +886,6 @@ packages: name: '@types/yargs-parser' version: 20.2.1 - registry.nlark.com/@vicons/antd/0.11.0: - resolution: {integrity: sha1-PSiVLQKK7XEtymHLgdvbEUVMVUI=, registry: http://registry.npm.taobao.org/, tarball: https://registry.nlark.com/@vicons/antd/download/@vicons/antd-0.11.0.tgz} - name: '@vicons/antd' - version: 0.11.0 - dev: true - - registry.nlark.com/@vicons/carbon/0.11.0: - resolution: {integrity: sha1-UQ4B6IOnOx1DQ6PrHRAUFEZGOr4=, registry: http://registry.npm.taobao.org/, tarball: https://registry.nlark.com/@vicons/carbon/download/@vicons/carbon-0.11.0.tgz} - name: '@vicons/carbon' - version: 0.11.0 - dev: true - - registry.nlark.com/@vicons/fa/0.11.0: - resolution: {integrity: sha1-3GeAslt5Q3NOfHXXTfL0RDsFcq4=, registry: http://registry.npm.taobao.org/, tarball: https://registry.nlark.com/@vicons/fa/download/@vicons/fa-0.11.0.tgz} - name: '@vicons/fa' - version: 0.11.0 - dev: true - - registry.nlark.com/@vicons/fluent/0.11.0: - resolution: {integrity: sha1-hPPNolVTnLlvRcicFgHiiS15gm8=, registry: http://registry.npm.taobao.org/, tarball: https://registry.nlark.com/@vicons/fluent/download/@vicons/fluent-0.11.0.tgz} - name: '@vicons/fluent' - version: 0.11.0 - dev: true - - registry.nlark.com/@vicons/ionicons4/0.11.0: - resolution: {integrity: sha1-pg9erWYdRz8XEDrQBRzoKtdxu+Y=, registry: http://registry.npm.taobao.org/, tarball: https://registry.nlark.com/@vicons/ionicons4/download/@vicons/ionicons4-0.11.0.tgz} - name: '@vicons/ionicons4' - version: 0.11.0 - dev: true - - registry.nlark.com/@vicons/ionicons5/0.11.0: - resolution: {integrity: sha1-VBhb+lcqCd9wCU2xlU8ov78TY+0=, registry: http://registry.npm.taobao.org/, tarball: https://registry.nlark.com/@vicons/ionicons5/download/@vicons/ionicons5-0.11.0.tgz} - name: '@vicons/ionicons5' - version: 0.11.0 - dev: true - - registry.nlark.com/@vicons/material/0.11.0: - resolution: {integrity: sha1-LCCRIfP/akZFD0loOX32wwCN+NE=, registry: http://registry.npm.taobao.org/, tarball: https://registry.nlark.com/@vicons/material/download/@vicons/material-0.11.0.tgz} - name: '@vicons/material' - version: 0.11.0 - dev: true - - registry.nlark.com/@vicons/tabler/0.11.0: - resolution: {integrity: sha1-nrBXnADKowQMLBz55cDHa6EgT7M=, registry: http://registry.npm.taobao.org/, tarball: https://registry.nlark.com/@vicons/tabler/download/@vicons/tabler-0.11.0.tgz} - name: '@vicons/tabler' - version: 0.11.0 - dev: true - registry.nlark.com/JSONStream/1.3.5: resolution: {integrity: sha1-MgjB8I06TZkmGrZPkjArwV4RHKA=, registry: http://registry.npm.taobao.org/, tarball: https://registry.nlark.com/JSONStream/download/JSONStream-1.3.5.tgz} name: JSONStream diff --git a/src/components/common/SystemLogo/components/SvgLogo.vue b/src/components/common/SystemLogo/components/SvgLogo.vue index 91b04fa9..e0115a23 100644 --- a/src/components/common/SystemLogo/components/SvgLogo.vue +++ b/src/components/common/SystemLogo/components/SvgLogo.vue @@ -3,7 +3,7 @@ - {{ breadcrumb.label }} + + + {{ breadcrumb.label }} + - {{ breadcrumb.label }} + @@ -14,10 +28,12 @@ diff --git a/src/views/dashboard/workbench/components/WorkbenchHeader/index.vue b/src/views/dashboard/workbench/components/WorkbenchHeader/index.vue index d72e7ee6..5fcb5290 100644 --- a/src/views/dashboard/workbench/components/WorkbenchHeader/index.vue +++ b/src/views/dashboard/workbench/components/WorkbenchHeader/index.vue @@ -3,13 +3,13 @@
-
+

早安,{{ auth.userInfo.userName }}, 今天又是充满活力的一天!

今日多云转晴,20℃ - 25℃!

- - + +
diff --git a/src/views/dashboard/workbench/components/WorkbenchMain/components/ShortcutsCard.vue b/src/views/dashboard/workbench/components/WorkbenchMain/components/ShortcutsCard.vue new file mode 100644 index 00000000..cfbd19cf --- /dev/null +++ b/src/views/dashboard/workbench/components/WorkbenchMain/components/ShortcutsCard.vue @@ -0,0 +1,32 @@ + + + + diff --git a/src/views/dashboard/workbench/components/WorkbenchMain/components/TechnologyCard.vue b/src/views/dashboard/workbench/components/WorkbenchMain/components/TechnologyCard.vue new file mode 100644 index 00000000..97858546 --- /dev/null +++ b/src/views/dashboard/workbench/components/WorkbenchMain/components/TechnologyCard.vue @@ -0,0 +1,32 @@ + + + + diff --git a/src/views/dashboard/workbench/components/WorkbenchMain/components/index.ts b/src/views/dashboard/workbench/components/WorkbenchMain/components/index.ts new file mode 100644 index 00000000..e84b2621 --- /dev/null +++ b/src/views/dashboard/workbench/components/WorkbenchMain/components/index.ts @@ -0,0 +1,4 @@ +import TechnologyCard from './TechnologyCard.vue'; +import ShortcutsCard from './ShortcutsCard.vue'; + +export { TechnologyCard, ShortcutsCard }; diff --git a/src/views/dashboard/workbench/components/WorkbenchMain/index.vue b/src/views/dashboard/workbench/components/WorkbenchMain/index.vue index a94ca62e..bbedbf34 100644 --- a/src/views/dashboard/workbench/components/WorkbenchMain/index.vue +++ b/src/views/dashboard/workbench/components/WorkbenchMain/index.vue @@ -1,29 +1,145 @@ diff --git a/windi.config.ts b/windi.config.ts index f4fc7b3d..4bf61412 100644 --- a/windi.config.ts +++ b/windi.config.ts @@ -15,6 +15,7 @@ export default defineConfig({ 'wh-full': 'w-full h-full', 'center-layout': 'w-1280px mx-auto px-15px', 'flex-center': 'flex justify-center items-center', + 'flex-col-center': 'flex flex-col justify-center items-center', 'flex-x-center': 'flex justify-center', 'flex-y-center': 'flex items-center', 'inline-flex-center': 'inline-flex justify-center items-center',