diff --git a/build/vite/plugin/index.ts b/build/vite/plugin/index.ts index 2da4059..9b17151 100644 --- a/build/vite/plugin/index.ts +++ b/build/vite/plugin/index.ts @@ -10,6 +10,7 @@ import { configHtmlPlugin } from './html' import { configCompressPlugin } from './compress' import { configVisualizerConfig } from './visualizer' import { configSvgIconsPlugin } from './svgSprite' +import { iconifySafelist } from '../../../src/assets/iconify/safelist' export function createVitePlugins(viteEnv: ViteEnv, isBuild: boolean) { const { VITE_BUILD_COMPRESS, VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE } = viteEnv @@ -35,7 +36,10 @@ export function createVitePlugins(viteEnv: ViteEnv, isBuild: boolean) { vitePlugins.push(configSvgIconsPlugin(isBuild)) // vite-plugin-purge-icons - vitePlugins.push(purgeIcons()) + vitePlugins.push(purgeIcons({ + iconSource: 'local', + included: iconifySafelist, + })) // rollup-plugin-visualizer vitePlugins.push(configVisualizerConfig()) diff --git a/src/assets/iconify/safelist.ts b/src/assets/iconify/safelist.ts new file mode 100644 index 0000000..e424410 --- /dev/null +++ b/src/assets/iconify/safelist.ts @@ -0,0 +1,41 @@ +export const iconifySafelist: string[] = [ + 'ant-design:account-book-twotone', + 'ant-design:aliyun-outlined', + 'ant-design:android-filled', + 'ant-design:appstore-filled', + 'ant-design:appstore-outlined', + 'ant-design:bar-chart-outlined', + 'ant-design:bell-outlined', + 'ant-design:bug-filled', + 'ant-design:carry-out-filled', + 'ant-design:carry-out-outlined', + 'ant-design:carry-out-twotone', + 'ant-design:control-filled', + 'ant-design:experiment-outlined', + 'ant-design:field-binary-outlined', + 'ant-design:file-pdf-twotone', + 'ant-design:fund-outlined', + 'ant-design:home-filled', + 'ant-design:info-circle-filled', + 'ant-design:insert-row-left-outlined', + 'ant-design:layout-filled', + 'ant-design:radius-bottomleft-outlined', + 'ant-design:verified-outlined', + 'ant-design:windows-outlined', + 'ant-design:yuque-filled', + 'ep:avatar', + 'ep:chat-dot-round', + 'ep:collection', + 'ep:connection', + 'ep:document-copy', + 'ep:menu', + 'ep:message', + 'ep:position', + 'ep:promotion', + 'ep:takeaway-box', + 'ep:tools', + 'ep:user', + 'fa:address-card', + 'fa:edit', + 'fa:stack-exchange', +] diff --git a/src/components/Icon/src/Icon.vue b/src/components/Icon/src/Icon.vue index b650884..6bbd134 100644 --- a/src/components/Icon/src/Icon.vue +++ b/src/components/Icon/src/Icon.vue @@ -47,14 +47,14 @@ async function update() { if (svg) { el.textContent = '' el.appendChild(svg) + return } - else { - const span = document.createElement('span') - span.className = 'iconify-missing' - span.title = icon - el.textContent = '' - el.appendChild(span) - } + + const span = document.createElement('span') + span.className = 'iconify-missing' + span.title = icon + el.textContent = '' + el.appendChild(span) } const getWrapStyle = computed((): CSSProperties => { diff --git a/src/views/model/list/ModelCard.vue b/src/views/model/list/ModelCard.vue index e886eef..29ce180 100644 --- a/src/views/model/list/ModelCard.vue +++ b/src/views/model/list/ModelCard.vue @@ -37,7 +37,7 @@ const modelCardList = ref>([]) const lastQuery = ref(null) const colors = ['#8dc63f', '#dbb09e'] const statusStr = ['未下装', '已下装'] -const statusIcons = ['material-symbols:lock-open', 'material-symbols:lock'] +const statusIcons = ['ant-design:unlock-outlined', 'ant-design:lock-outlined'] function buildQuery(value: any): ModelQueryParams { return { @@ -134,7 +134,7 @@ function goCreateModel() { {{ item.creator || '未知' }} - + {{ item.createTime || '--' }} diff --git a/src/views/system/notify/my/index.vue b/src/views/system/notify/my/index.vue index f6a29d0..aa25de3 100644 --- a/src/views/system/notify/my/index.vue +++ b/src/views/system/notify/my/index.vue @@ -91,10 +91,10 @@ function handleInfo(record: any) {