diff --git a/code/link56/link56-frontend-new/src/components/SvgIcon.vue b/code/link56/link56-frontend-new/src/components/SvgIcon.vue new file mode 100644 index 00000000..58fb2668 --- /dev/null +++ b/code/link56/link56-frontend-new/src/components/SvgIcon.vue @@ -0,0 +1,47 @@ + + + diff --git a/code/link56/link56-frontend-new/src/components/nav-menu/index.vue b/code/link56/link56-frontend-new/src/components/nav-menu/index.vue new file mode 100644 index 00000000..217e0ed6 --- /dev/null +++ b/code/link56/link56-frontend-new/src/components/nav-menu/index.vue @@ -0,0 +1,36 @@ + + + diff --git a/code/link56/link56-frontend-new/src/components/nav-menu/type.ts b/code/link56/link56-frontend-new/src/components/nav-menu/type.ts new file mode 100644 index 00000000..f73472c6 --- /dev/null +++ b/code/link56/link56-frontend-new/src/components/nav-menu/type.ts @@ -0,0 +1,6 @@ +export interface NavMenuItem { + label: string + index: string + icon?: string + children?: NavMenuItem [] +} diff --git a/code/link56/link56-frontend-new/src/router/index.ts b/code/link56/link56-frontend-new/src/router/index.ts index 3f8bfb16..be2e5a21 100644 --- a/code/link56/link56-frontend-new/src/router/index.ts +++ b/code/link56/link56-frontend-new/src/router/index.ts @@ -22,6 +22,16 @@ const router = createRouter({ path: '/company/detail', component: () => import('@/views/company/detail/index.vue'), }, + { + path: '/settings', + component: () => import('@/views/settings/index.vue'), + children: [ + { + path: '/settings/info/company', + component: () => import('@/views/settings/info/company.vue'), + }, + ], + }, ], }, { diff --git a/code/link56/link56-frontend-new/src/types/auto-import.d.ts b/code/link56/link56-frontend-new/src/types/auto-import.d.ts index d3635113..71a1926d 100644 --- a/code/link56/link56-frontend-new/src/types/auto-import.d.ts +++ b/code/link56/link56-frontend-new/src/types/auto-import.d.ts @@ -16,10 +16,20 @@ declare module 'vue' { HelloWorld: typeof import('./../components/HelloWorld.vue')['default'] ICarbonAccessibility: typeof import('~icons/carbon/accessibility')['default'] 'IFa7Solid:userShield': typeof import('~icons/fa7-solid/user-shield')['default'] + 'IHugeicons:building02': typeof import('~icons/hugeicons/building02')['default'] + 'IHugeicons:edit01': typeof import('~icons/hugeicons/edit01')['default'] + 'IHugeicons:edit04': typeof import('~icons/hugeicons/edit04')['default'] + 'IHugeicons:home03': typeof import('~icons/hugeicons/home03')['default'] + 'IHugeicons:materialAndTexture': typeof import('~icons/hugeicons/material-and-texture')['default'] + 'IHugeicons:setting07': typeof import('~icons/hugeicons/setting07')['default'] + 'IHugeicons:userSettings01': typeof import('~icons/hugeicons/user-settings01')['default'] + 'IIc:outlineSettings': typeof import('~icons/ic/outline-settings')['default'] 'IIc:twotoneHeadphones': typeof import('~icons/ic/twotone-headphones')['default'] 'IIconoir:infoCircleSolid': typeof import('~icons/iconoir/info-circle-solid')['default'] + 'IMajesticons:settingsCogLine': typeof import('~icons/majesticons/settings-cog-line')['default'] 'IMaterialSymbols:call': typeof import('~icons/material-symbols/call')['default'] 'IMaterialSymbols:chatBubbleOutline': typeof import('~icons/material-symbols/chat-bubble-outline')['default'] + 'IMaterialSymbols:databaseOutline': typeof import('~icons/material-symbols/database-outline')['default'] 'IMaterialSymbols:folderCopyOutline': typeof import('~icons/material-symbols/folder-copy-outline')['default'] 'IMaterialSymbols:fullscreen': typeof import('~icons/material-symbols/fullscreen')['default'] 'IMaterialSymbols:fullscreenExit': typeof import('~icons/material-symbols/fullscreen-exit')['default'] @@ -38,18 +48,25 @@ declare module 'vue' { 'IRi:information2Line': typeof import('~icons/ri/information2-line')['default'] 'IRi:informationFill': typeof import('~icons/ri/information-fill')['default'] 'IRi:message3Fill': typeof import('~icons/ri/message3-fill')['default'] + 'ISolar:buildings2Broken': typeof import('~icons/solar/buildings2-broken')['default'] 'ISolar:chatRoundBold': typeof import('~icons/solar/chat-round-bold')['default'] 'ISolar:chatRoundCallBroken': typeof import('~icons/solar/chat-round-call-broken')['default'] + 'ISolar:databaseBoldDuotone': typeof import('~icons/solar/database-bold-duotone')['default'] 'ISolar:eyeBroken': typeof import('~icons/solar/eye-broken')['default'] 'ISolar:eyeClosedBroken': typeof import('~icons/solar/eye-closed-broken')['default'] 'IStreamlineUltimate:informationCircleBold': typeof import('~icons/streamline-ultimate/information-circle-bold')['default'] 'ITdesign:notification': typeof import('~icons/tdesign/notification')['default'] 'ITdesign:search': typeof import('~icons/tdesign/search')['default'] + 'ITdesign:setting1': typeof import('~icons/tdesign/setting1')['default'] + Menu: typeof import('../components/nav-menu/index.vue')['default'] + MenuItem: typeof import('../components/nav-menu/index.vue')['default'] + NavMenu: typeof import('./../components/nav-menu/index.vue')['default'] Preview: typeof import('./../components/wang-editor/modules/preview.vue')['default'] QueryCompany: typeof import('./../components/QueryCompany.vue')['default'] RouterLink: typeof import('vue-router')['RouterLink'] RouterView: typeof import('vue-router')['RouterView'] SafeImage: typeof import('./../components/SafeImage.vue')['default'] + SvgIcon: typeof import('./../components/SvgIcon.vue')['default'] UploadProgress: typeof import('./../components/upload-progress/index.vue')['default'] WangEditor: typeof import('./../components/wang-editor/index.vue')['default'] } diff --git a/code/link56/link56-frontend-new/src/utils/icon.ts b/code/link56/link56-frontend-new/src/utils/icon.ts new file mode 100644 index 00000000..b567e670 --- /dev/null +++ b/code/link56/link56-frontend-new/src/utils/icon.ts @@ -0,0 +1,56 @@ +import { h } from 'vue' +import SvgIcon from '@/components/SvgIcon.vue' + +/** + * 图标渲染 + * - 用于vue的render函数 + */ +export function useIconRender() { + interface IconConfig { + /** + * 图标名称(iconify图标的名称) + * - 例如:mdi-account 或者 mdi:account + */ + icon?: string + /** 图标颜色 */ + color?: string + /** 图标大小 */ + fontSize?: number + } + + interface IconStyle { + color?: string + fontSize?: string + } + + /** + * 图标渲染 + * @param config + * @property icon - 图标名称(iconify图标的名称), 例如:mdi-account 或者 mdi:account + * @property localIcon - 本地svg图标文件名(assets/svg文件夹下) + * @property color - 图标颜色 + * @property fontSize - 图标大小 + */ + const iconRender = (config: IconConfig) => { + const { color, fontSize, icon } = config + + const style: IconStyle = {} + + if (color) { + style.color = color + } + if (fontSize) { + style.fontSize = `${fontSize}px` + } + + if (!icon) { + window.console.warn('没有传递图标名称,请确保给icon或localIcon传递有效值!') + } + + return () => h(SvgIcon, { icon, style }) + } + + return { + iconRender, + } +} diff --git a/code/link56/link56-frontend-new/src/views/company/detail/index.vue b/code/link56/link56-frontend-new/src/views/company/detail/index.vue index fdfc918f..ecd42c11 100644 --- a/code/link56/link56-frontend-new/src/views/company/detail/index.vue +++ b/code/link56/link56-frontend-new/src/views/company/detail/index.vue @@ -48,7 +48,7 @@ onMounted(() => { diff --git a/code/link56/link56-frontend-new/src/views/settings/info/company.vue b/code/link56/link56-frontend-new/src/views/settings/info/company.vue new file mode 100644 index 00000000..9a5c0243 --- /dev/null +++ b/code/link56/link56-frontend-new/src/views/settings/info/company.vue @@ -0,0 +1,163 @@ + + + + + diff --git a/code/link56/link56-frontend-new/vite.config.ts b/code/link56/link56-frontend-new/vite.config.ts index 6e0ec751..54e4c791 100644 --- a/code/link56/link56-frontend-new/vite.config.ts +++ b/code/link56/link56-frontend-new/vite.config.ts @@ -29,7 +29,11 @@ export default defineConfig((configEnv) => { }, plugins: [ vue(), - Icons(), + Icons({ + compiler: 'vue3', + scale: 1, + defaultClass: 'inline-block', + }), Components({ dts: 'src/types/auto-import.d.ts', resolvers: [IconsResolver()],