Browse Source

release: update `3.9.0`

i18n
xiaoxian521 2 years ago
parent
commit
12a003a430
  1. 14
      build/optimize.ts
  2. 4
      locales/en.yaml
  3. 4
      locales/zh-CN.yaml
  4. 4
      mock/asyncRoutes.ts
  5. 2
      package.json
  6. 2
      public/serverConfig.json
  7. 10
      src/components/ReIcon/src/hooks.ts
  8. 72
      src/components/ReIcon/src/iconifyIconOffline.ts
  9. 11
      src/layout/components/navbar.vue
  10. 3
      src/layout/components/notice/index.vue
  11. 3
      src/layout/components/panel/index.vue
  12. 6
      src/layout/components/search/components/SearchFooter.vue
  13. 3
      src/layout/components/search/components/SearchModal.vue
  14. 3
      src/layout/components/search/components/SearchResult.vue
  15. 4
      src/layout/components/search/index.vue
  16. 9
      src/layout/components/setting/index.vue
  17. 11
      src/layout/components/sidebar/horizontal.vue
  18. 4
      src/layout/components/sidebar/leftCollapse.vue
  19. 11
      src/layout/components/sidebar/mixNav.vue
  20. 18
      src/layout/components/sidebar/sidebarItem.vue
  21. 5
      src/layout/components/sidebar/topCollapse.vue
  22. 26
      src/layout/components/tag/index.vue
  23. 24
      src/layout/hooks/useTag.ts
  24. 1
      src/layout/index.vue
  25. 9
      src/layout/types.ts
  26. 1
      src/main.ts
  27. 5
      src/plugins/echarts/index.ts
  28. 3
      src/router/modules/error.ts
  29. 3
      src/router/modules/home.ts
  30. 3
      src/router/modules/remaining.ts
  31. 8
      src/style/reset.scss
  32. 4
      src/utils/http/index.ts
  33. 11
      src/views/login/index.vue
  34. 5
      types/global.d.ts
  35. 4
      vite.config.ts

14
build/optimize.ts

@ -4,7 +4,7 @@
* include里vite 使 node_modules/.vite
* 使 src/main.ts include vite node_modules/.vite
*/
export const include = [
const include = [
"qs",
"mitt",
"dayjs",
@ -24,3 +24,15 @@ export const include = [
"responsive-storage",
"element-resize-detector"
];
/**
*
* `@iconify-icons/` `exclude` 使
*/
const exclude = [
"@iconify-icons/ep",
"@iconify-icons/ri",
"@pureadmin/theme/dist/browser-utils"
];
export { include, exclude };

4
locales/en.yaml

@ -18,8 +18,8 @@ buttons:
hscloseRightTabs: Close RightTabs
hscloseOtherTabs: Close OtherTabs
hscloseAllTabs: Close AllTabs
hswholeFullScreen: Whole FullScreen
hswholeExitFullScreen: Whole ExitFullScreen
hswholeFullScreen: FullScreen
hswholeExitFullScreen: ExitFull
hscontentFullScreen: Content FullScreen
hscontentExitFullScreen: Content ExitFullScreen
menus:

4
locales/zh-CN.yaml

@ -18,8 +18,8 @@ buttons:
hscloseRightTabs: 关闭右侧标签页
hscloseOtherTabs: 关闭其他标签页
hscloseAllTabs: 关闭全部标签页
hswholeFullScreen: 整体页面全屏
hswholeExitFullScreen: 整体页面退出全屏
hswholeFullScreen: 全屏
hswholeExitFullScreen: 退出全屏
hscontentFullScreen: 内容区全屏
hscontentExitFullScreen: 内容区退出全屏
menus:

4
mock/asyncRoutes.ts

@ -1,6 +1,8 @@
// 模拟后端动态生成路由
import { MockMethod } from "vite-plugin-mock";
import Lollipop from "@iconify-icons/ep/lollipop";
/**
* roles "admin""common"
* admin
@ -11,7 +13,7 @@ const permissionRouter = {
path: "/permission",
meta: {
title: "menus.permission",
icon: "lollipop",
icon: Lollipop,
rank: 10
},
children: [

2
package.json

@ -1,6 +1,6 @@
{
"name": "pure-admin-thin",
"version": "3.8.7",
"version": "3.9.0",
"private": true,
"scripts": {
"dev": "NODE_OPTIONS=--max-old-space-size=4096 vite",

2
public/serverConfig.json

@ -1,5 +1,5 @@
{
"Version": "3.8.7",
"Version": "3.9.0",
"Title": "PureAdmin",
"FixedHeader": true,
"HiddenSideBar": false,

10
src/components/ReIcon/src/hooks.ts

@ -34,6 +34,16 @@ export function useRenderIcon(icon: any, attrs?: iconType): Component {
} else if (typeof icon === "function" || typeof icon?.render === "function") {
// svg
return icon;
} else if (typeof icon === "object") {
return defineComponent({
name: "OfflineIcon",
render() {
return h(IconifyIconOffline, {
icon: icon,
...attrs
});
}
});
} else {
// 通过是否存在 : 符号来判断是在线还是本地图标,存在即是在线图标,反之
return defineComponent({

72
src/components/ReIcon/src/iconifyIconOffline.ts

@ -1,88 +1,22 @@
import { h, defineComponent } from "vue";
import { Icon as IconifyIcon, addIcon } from "@iconify/vue/dist/offline";
// element-plus icon
import Check from "@iconify-icons/ep/check";
import HomeFilled from "@iconify-icons/ep/home-filled";
import Lollipop from "@iconify-icons/ep/lollipop";
import RefreshRight from "@iconify-icons/ep/refresh-right";
import Close from "@iconify-icons/ep/close";
import CloseBold from "@iconify-icons/ep/close-bold";
import Bell from "@iconify-icons/ep/bell";
import Search from "@iconify-icons/ep/search";
import EpArrowDown from "@iconify-icons/ep/arrow-down";
import ArrowUp from "@iconify-icons/ep/arrow-up";
import ArrowRight from "@iconify-icons/ep/arrow-right";
import ArrowLeft from "@iconify-icons/ep/arrow-left";
addIcon("check", Check);
addIcon("home-filled", HomeFilled);
addIcon("lollipop", Lollipop);
addIcon("refresh-right", RefreshRight);
addIcon("close", Close);
addIcon("close-bold", CloseBold);
addIcon("bell", Bell);
addIcon("search", Search);
addIcon("ep-arrow-down", EpArrowDown);
addIcon("ep-arrow-up", ArrowUp);
addIcon("ep-arrow-right", ArrowRight);
addIcon("ep-arrow-left", ArrowLeft);
// remixicon
import ArrowRightSLine from "@iconify-icons/ri/arrow-right-s-line";
import ArrowLeftSLine from "@iconify-icons/ri/arrow-left-s-line";
import LogoutCircleRLine from "@iconify-icons/ri/logout-circle-r-line";
import InformationLine from "@iconify-icons/ri/information-line";
import ArrowUpLine from "@iconify-icons/ri/arrow-up-line";
import ArrowDownLine from "@iconify-icons/ri/arrow-down-line";
import Bookmark2Line from "@iconify-icons/ri/bookmark-2-line";
import User from "@iconify-icons/ri/user-3-fill";
import Lock from "@iconify-icons/ri/lock-fill";
import MenuUnfold from "@iconify-icons/ri/menu-unfold-fill";
import MenuFold from "@iconify-icons/ri/menu-fold-fill";
import Setting from "@iconify-icons/ri/settings-3-line";
import ArrowDown from "@iconify-icons/ri/arrow-down-s-line";
import CloseLeftTags from "@iconify-icons/ri/text-direction-r";
import CloseRightTags from "@iconify-icons/ri/text-direction-l";
import CloseOtherTags from "@iconify-icons/ri/text-spacing";
import CloseAllTags from "@iconify-icons/ri/subtract-line";
import Fullscreen from "@iconify-icons/ri/fullscreen-fill";
import ExitFullscreen from "@iconify-icons/ri/fullscreen-exit-fill";
addIcon("arrow-right-s-line", ArrowRightSLine);
addIcon("arrow-left-s-line", ArrowLeftSLine);
addIcon("logout-circle-r-line", LogoutCircleRLine);
addIcon("information-line", InformationLine);
addIcon("arrow-up-line", ArrowUpLine);
addIcon("arrow-down-line", ArrowDownLine);
addIcon("bookmark-2-line", Bookmark2Line);
addIcon("user", User);
addIcon("lock", Lock);
addIcon("menu-unfold", MenuUnfold);
addIcon("menu-fold", MenuFold);
addIcon("setting", Setting);
addIcon("arrow-down", ArrowDown);
addIcon("close-left-tags", CloseLeftTags);
addIcon("close-right-tags", CloseRightTags);
addIcon("close-other-tags", CloseOtherTags);
addIcon("close-all-tags", CloseAllTags);
addIcon("fullscreen", Fullscreen);
addIcon("exit-fullscreen", ExitFullscreen);
// Iconify Icon在Vue里本地使用(用于内网环境)https://docs.iconify.design/icon-components/vue/offline.html
export default defineComponent({
name: "IconifyIconOffline",
components: { IconifyIcon },
props: {
icon: {
type: String,
default: ""
default: null
}
},
render() {
if (typeof this.icon === "object") addIcon(this.icon, this.icon);
const attrs = this.$attrs;
return h(
IconifyIcon,
{
icon: `${this.icon}`,
icon: this.icon,
style: attrs?.style
? Object.assign(attrs.style, { outline: "none" })
: { outline: "none" },

11
src/layout/components/navbar.vue

@ -7,6 +7,9 @@ import Breadcrumb from "./sidebar/breadCrumb.vue";
import topCollapse from "./sidebar/topCollapse.vue";
import { useTranslationLang } from "../hooks/useTranslationLang";
import globalization from "@/assets/svg/globalization.svg?component";
import LogoutCircleRLine from "@iconify-icons/ri/logout-circle-r-line";
import Setting from "@iconify-icons/ri/settings-3-line";
import Check from "@iconify-icons/ep/check";
const {
layout,
@ -62,7 +65,7 @@ const { t, locale, translationCh, translationEn } = useTranslationLang();
<IconifyIconOffline
class="check-zh"
v-show="locale === 'zh'"
icon="check"
:icon="Check"
/>
简体中文
</el-dropdown-item>
@ -72,7 +75,7 @@ const { t, locale, translationCh, translationEn } = useTranslationLang();
@click="translationEn"
>
<span class="check-en" v-show="locale === 'en'">
<IconifyIconOffline icon="check" />
<IconifyIconOffline :icon="Check" />
</span>
English
</el-dropdown-item>
@ -92,7 +95,7 @@ const { t, locale, translationCh, translationEn } = useTranslationLang();
<el-dropdown-menu class="logout">
<el-dropdown-item @click="logout">
<IconifyIconOffline
icon="logout-circle-r-line"
:icon="LogoutCircleRLine"
style="margin: 5px"
/>
{{ t("buttons.hsLoginOut") }}
@ -105,7 +108,7 @@ const { t, locale, translationCh, translationEn } = useTranslationLang();
:title="t('buttons.hssystemSet')"
@click="onPanel"
>
<IconifyIconOffline icon="setting" />
<IconifyIconOffline :icon="Setting" />
</span>
</div>
</div>

3
src/layout/components/notice/index.vue

@ -2,6 +2,7 @@
import { ref } from "vue";
import { noticesData } from "./data";
import NoticeList from "./noticeList.vue";
import Bell from "@iconify-icons/ep/bell";
const noticesNum = ref(0);
const notices = ref(noticesData);
@ -15,7 +16,7 @@ notices.value.map(v => (noticesNum.value += v.list.length));
<span class="dropdown-badge navbar-bg-hover select-none">
<el-badge :value="noticesNum" :max="99">
<span class="header-notice-icon">
<IconifyIconOffline icon="bell" />
<IconifyIconOffline :icon="Bell" />
</span>
</el-badge>
</span>

3
src/layout/components/panel/index.vue

@ -2,6 +2,7 @@
import { ref } from "vue";
import { onClickOutside } from "@vueuse/core";
import { emitter } from "@/utils/mitt";
import Close from "@iconify-icons/ep/close";
const show = ref<Boolean>(false);
const target = ref(null);
@ -25,7 +26,7 @@ emitter.on("openPanel", () => {
<span title="关闭配置">
<IconifyIconOffline
class="dark:text-white"
icon="close"
:icon="Close"
@click="show = !show"
/>
</span>

6
src/layout/components/search/components/SearchFooter.vue

@ -5,8 +5,8 @@
确认
</span>
<span class="search-footer-item">
<IconifyIconOffline icon="arrow-up-line" class="icon" />
<IconifyIconOffline icon="arrow-down-line" class="icon" />
<IconifyIconOffline :icon="ArrowUpLine" class="icon" />
<IconifyIconOffline :icon="ArrowDownLine" class="icon" />
切换
</span>
<span class="search-footer-item">
@ -17,6 +17,8 @@
</template>
<script setup lang="ts">
import ArrowUpLine from "@iconify-icons/ri/arrow-up-line";
import ArrowDownLine from "@iconify-icons/ri/arrow-down-line";
import mdiKeyboardEsc from "@/assets/svg/keyboard_esc.svg?component";
import enterOutlined from "@/assets/svg/enter_outlined.svg?component";
</script>

3
src/layout/components/search/components/SearchModal.vue

@ -9,6 +9,7 @@ import { transformI18n } from "@/plugins/i18n";
import { useDebounceFn, onKeyStroke } from "@vueuse/core";
import { ref, watch, computed, nextTick, shallowRef } from "vue";
import { usePermissionStoreHook } from "@/store/modules/permission";
import Search from "@iconify-icons/ep/search";
interface Props {
/** 弹窗显隐 */
@ -148,7 +149,7 @@ onKeyStroke("ArrowDown", handleDown);
>
<template #prefix>
<span class="el-input__icon">
<IconifyIconOffline icon="search" />
<IconifyIconOffline :icon="Search" />
</span>
</template>
</el-input>

3
src/layout/components/search/components/SearchResult.vue

@ -4,6 +4,7 @@ import { useI18n } from "vue-i18n";
import { useEpThemeStoreHook } from "@/store/modules/epTheme";
import { useRenderIcon } from "@/components/ReIcon/src/hooks";
import enterOutlined from "@/assets/svg/enter_outlined.svg?component";
import Bookmark2Line from "@iconify-icons/ri/bookmark-2-line";
const { t } = useI18n();
@ -67,7 +68,7 @@ function handleTo() {
@click="handleTo"
@mouseenter="handleMouse(item)"
>
<component :is="useRenderIcon(item.meta?.icon ?? 'bookmark-2-line')" />
<component :is="useRenderIcon(item.meta?.icon ?? Bookmark2Line)" />
<span class="result-item-title">{{ t(item.meta?.title) }}</span>
<enterOutlined />
</div>

4
src/layout/components/search/index.vue

@ -1,6 +1,8 @@
<script setup lang="ts">
import { SearchModal } from "./components";
import { useBoolean } from "../../hooks/useBoolean";
import Search from "@iconify-icons/ep/search";
const { bool: show, toggle } = useBoolean();
function handleSearch() {
toggle();
@ -12,7 +14,7 @@ function handleSearch() {
class="search-container w-[40px] h-[48px] flex-c cursor-pointer navbar-bg-hover"
@click="handleSearch"
>
<IconifyIconOffline icon="search" />
<IconifyIconOffline :icon="Search" />
</div>
<SearchModal v-model:value="show" />
</template>

9
src/layout/components/setting/index.vue

@ -30,6 +30,8 @@ import { toggleTheme } from "@pureadmin/theme/dist/browser-utils";
import dayIcon from "@/assets/svg/day.svg?component";
import darkIcon from "@/assets/svg/dark.svg?component";
import Check from "@iconify-icons/ep/check";
import Logout from "@iconify-icons/ri/logout-circle-r-line";
const router = useRouter();
const { device } = useNav();
@ -42,7 +44,6 @@ const verticalRef = ref();
const horizontalRef = ref();
const {
body,
dataTheme,
layoutTheme,
themeColors,
@ -165,8 +166,6 @@ function setFalse(Doms): any {
}
watch($storage, ({ layout }) => {
/* 设置wangeditorV5主题色 */
body.style.setProperty("--w-e-toolbar-active-color", layout["epThemeColor"]);
switch (layout["layout"]) {
case "vertical":
toggleClass(true, isSelect, unref(verticalRef));
@ -302,7 +301,7 @@ nextTick(() => {
:size="17"
:color="getThemeColor(item.themeColor)"
>
<IconifyIconOffline icon="check" />
<IconifyIconOffline :icon="Check" />
</el-icon>
</li>
</ul>
@ -383,7 +382,7 @@ nextTick(() => {
@click="onReset"
>
<IconifyIconOffline
icon="fa-sign-out"
:icon="Logout"
width="15"
height="15"
style="margin-right: 4px"

11
src/layout/components/sidebar/horizontal.vue

@ -7,6 +7,9 @@ import { useNav } from "@/layout/hooks/useNav";
import { useTranslationLang } from "../../hooks/useTranslationLang";
import { usePermissionStoreHook } from "@/store/modules/permission";
import globalization from "@/assets/svg/globalization.svg?component";
import LogoutCircleRLine from "@iconify-icons/ri/logout-circle-r-line";
import Setting from "@iconify-icons/ri/settings-3-line";
import Check from "@iconify-icons/ep/check";
const menuRef = ref();
@ -76,7 +79,7 @@ watch(
@click="translationCh"
>
<span class="check-zh" v-show="locale === 'zh'">
<IconifyIconOffline icon="check" />
<IconifyIconOffline :icon="Check" />
</span>
简体中文
</el-dropdown-item>
@ -86,7 +89,7 @@ watch(
@click="translationEn"
>
<span class="check-en" v-show="locale === 'en'">
<IconifyIconOffline icon="check" />
<IconifyIconOffline :icon="Check" />
</span>
English
</el-dropdown-item>
@ -106,7 +109,7 @@ watch(
<el-dropdown-menu class="logout">
<el-dropdown-item @click="logout">
<IconifyIconOffline
icon="logout-circle-r-line"
:icon="LogoutCircleRLine"
style="margin: 5px"
/>
{{ t("buttons.hsLoginOut") }}
@ -119,7 +122,7 @@ watch(
:title="t('buttons.hssystemSet')"
@click="onPanel"
>
<IconifyIconOffline icon="setting" />
<IconifyIconOffline :icon="Setting" />
</span>
</div>
</div>

4
src/layout/components/sidebar/leftCollapse.vue

@ -1,5 +1,7 @@
<script setup lang="ts">
import { useDark } from "@pureadmin/utils";
import MenuFold from "@iconify-icons/ri/menu-fold-fill";
import MenuUnfold from "@iconify-icons/ri/menu-unfold-fill";
interface Props {
isActive: boolean;
@ -27,7 +29,7 @@ const toggleClick = () => {
:content="props.isActive ? '点击折叠' : '点击展开'"
>
<IconifyIconOffline
:icon="props.isActive ? 'menu-fold' : 'menu-unfold'"
:icon="props.isActive ? MenuFold : MenuUnfold"
class="cursor-pointer inline-block align-middle text-primary hover:text-primary dark:hover:!text-white w-[16px] h-[16px] ml-4 mb-1"
@click="toggleClick"
/>

11
src/layout/components/sidebar/mixNav.vue

@ -9,6 +9,9 @@ import { getParentPaths, findRouteByPath } from "@/router/utils";
import { useTranslationLang } from "../../hooks/useTranslationLang";
import { usePermissionStoreHook } from "@/store/modules/permission";
import globalization from "@/assets/svg/globalization.svg?component";
import LogoutCircleRLine from "@iconify-icons/ri/logout-circle-r-line";
import Setting from "@iconify-icons/ri/settings-3-line";
import Check from "@iconify-icons/ep/check";
const menuRef = ref();
const defaultActive = ref(null);
@ -108,7 +111,7 @@ watch(
@click="translationCh"
>
<span class="check-zh" v-show="locale === 'zh'">
<IconifyIconOffline icon="check" />
<IconifyIconOffline :icon="Check" />
</span>
简体中文
</el-dropdown-item>
@ -118,7 +121,7 @@ watch(
@click="translationEn"
>
<span class="check-en" v-show="locale === 'en'">
<IconifyIconOffline icon="check" />
<IconifyIconOffline :icon="Check" />
</span>
English
</el-dropdown-item>
@ -138,7 +141,7 @@ watch(
<el-dropdown-menu class="logout">
<el-dropdown-item @click="logout">
<IconifyIconOffline
icon="logout-circle-r-line"
:icon="LogoutCircleRLine"
style="margin: 5px"
/>
{{ t("buttons.hsLoginOut") }}
@ -151,7 +154,7 @@ watch(
:title="t('buttons.hssystemSet')"
@click="onPanel"
>
<IconifyIconOffline icon="setting" />
<IconifyIconOffline :icon="Setting" />
</span>
</div>
</div>

18
src/layout/components/sidebar/sidebarItem.vue

@ -7,6 +7,11 @@ import { transformI18n } from "@/plugins/i18n";
import { useRenderIcon } from "@/components/ReIcon/src/hooks";
import { ref, toRaw, PropType, nextTick, computed, CSSProperties } from "vue";
import ArrowUp from "@iconify-icons/ep/arrow-up";
import EpArrowDown from "@iconify-icons/ep/arrow-down";
import ArrowLeft from "@iconify-icons/ep/arrow-left";
import ArrowRight from "@iconify-icons/ep/arrow-right";
const { layout, isCollapse } = useNav();
const props = defineProps({
@ -78,7 +83,13 @@ const getSpanStyle = computed(() => {
});
const expandCloseIcon = computed(() => {
return getConfig()?.MenuArrowIconNoTransition ? "expand-close-icon" : "";
if (!getConfig()?.MenuArrowIconNoTransition) return "";
return {
"expand-close-icon": useRenderIcon(EpArrowDown),
"expand-open-icon": useRenderIcon(ArrowUp),
"collapse-close-icon": useRenderIcon(ArrowRight),
"collapse-open-icon": useRenderIcon(ArrowLeft)
};
});
const onlyOneChild: childrenType = ref(null);
@ -220,11 +231,8 @@ function resolvePath(routePath) {
<el-sub-menu
v-else
ref="subMenu"
v-bind="expandCloseIcon"
:index="resolvePath(props.item.path)"
v-bind:[expandCloseIcon]="useRenderIcon('ep-arrow-down')"
:expand-open-icon="useRenderIcon('ep-arrow-up')"
:collapse-close-icon="useRenderIcon('ep-arrow-right')"
:collapse-open-icon="useRenderIcon('ep-arrow-left')"
>
<template #title>
<div v-if="toRaw(props.item.meta.icon)" class="sub-menu-icon">

5
src/layout/components/sidebar/topCollapse.vue

@ -1,4 +1,7 @@
<script setup lang="ts">
import MenuFold from "@iconify-icons/ri/menu-fold-fill";
import MenuUnfold from "@iconify-icons/ri/menu-unfold-fill";
interface Props {
isActive: boolean;
}
@ -23,7 +26,7 @@ const toggleClick = () => {
@click="toggleClick"
>
<IconifyIconOffline
:icon="props.isActive ? 'menu-fold' : 'menu-unfold'"
:icon="props.isActive ? MenuFold : MenuUnfold"
class="inline-block align-middle hover:text-primary dark:hover:!text-white"
/>
</div>

26
src/layout/components/tag/index.vue

@ -11,6 +11,13 @@ import { handleAliveRoute, delAliveRoutes } from "@/router/utils";
import { useMultiTagsStoreHook } from "@/store/modules/multiTags";
import { useResizeObserver, useDebounceFn, useFullscreen } from "@vueuse/core";
import ExitFullscreen from "@iconify-icons/ri/fullscreen-exit-fill";
import Fullscreen from "@iconify-icons/ri/fullscreen-fill";
import ArrowDown from "@iconify-icons/ri/arrow-down-s-line";
import ArrowRightSLine from "@iconify-icons/ri/arrow-right-s-line";
import ArrowLeftSLine from "@iconify-icons/ri/arrow-left-s-line";
import CloseBold from "@iconify-icons/ep/close-bold";
const {
route,
router,
@ -284,10 +291,10 @@ function onClickDrop(key, item, selectRoute?: RouteConfigs) {
toggle();
setTimeout(() => {
if (isFullscreen.value) {
tagsViews[6].icon = "exit-fullscreen";
tagsViews[6].icon = ExitFullscreen;
tagsViews[6].text = $t("buttons.hswholeExitFullScreen");
} else {
tagsViews[6].icon = "fullscreen";
tagsViews[6].icon = Fullscreen;
tagsViews[6].text = $t("buttons.hswholeFullScreen");
}
}, 100);
@ -297,10 +304,10 @@ function onClickDrop(key, item, selectRoute?: RouteConfigs) {
onContentFullScreen();
setTimeout(() => {
if (pureSetting.hiddenSideBar) {
tagsViews[7].icon = "exit-fullscreen";
tagsViews[7].icon = ExitFullscreen;
tagsViews[7].text = $t("buttons.hscontentExitFullScreen");
} else {
tagsViews[7].icon = "fullscreen";
tagsViews[7].icon = Fullscreen;
tagsViews[7].text = $t("buttons.hscontentFullScreen");
}
}, 100);
@ -496,7 +503,7 @@ onMounted(() => {
<template>
<div ref="containerDom" class="tags-view" v-if="!showTags">
<span v-show="isShowArrow" class="arrow-left">
<IconifyIconOffline icon="arrow-left-s-line" @click="handleScroll(200)" />
<IconifyIconOffline :icon="ArrowLeftSLine" @click="handleScroll(200)" />
</span>
<div ref="scrollbarDom" class="scroll-container">
<div class="tab select-none" ref="tabDom" :style="getTabStyle">
@ -530,7 +537,7 @@ onMounted(() => {
class="el-icon-close"
@click.stop="deleteMenu(item)"
>
<IconifyIconOffline icon="close-bold" />
<IconifyIconOffline :icon="CloseBold" />
</span>
<div
:ref="'schedule' + index"
@ -541,10 +548,7 @@ onMounted(() => {
</div>
</div>
<span v-show="isShowArrow" class="arrow-right">
<IconifyIconOffline
icon="arrow-right-s-line"
@click="handleScroll(-200)"
/>
<IconifyIconOffline :icon="ArrowRightSLine" @click="handleScroll(-200)" />
</span>
<!-- 右键菜单按钮 -->
<transition name="el-zoom-in-top">
@ -573,7 +577,7 @@ onMounted(() => {
@command="handleCommand"
>
<span class="arrow-down">
<IconifyIconOffline icon="arrow-down" class="dark:text-white" />
<IconifyIconOffline :icon="ArrowDown" class="dark:text-white" />
</span>
<template #dropdown>
<el-dropdown-menu>

24
src/layout/hooks/useTag.ts

@ -17,6 +17,14 @@ import { useSettingStoreHook } from "@/store/modules/settings";
import { useMultiTagsStoreHook } from "@/store/modules/multiTags";
import { storageLocal, toggleClass, hasClass } from "@pureadmin/utils";
import Fullscreen from "@iconify-icons/ri/fullscreen-fill";
import CloseAllTags from "@iconify-icons/ri/subtract-line";
import CloseOtherTags from "@iconify-icons/ri/text-spacing";
import CloseRightTags from "@iconify-icons/ri/text-direction-l";
import CloseLeftTags from "@iconify-icons/ri/text-direction-r";
import RefreshRight from "@iconify-icons/ep/refresh-right";
import Close from "@iconify-icons/ep/close";
export function useTags() {
const route = useRoute();
const router = useRouter();
@ -47,56 +55,56 @@ export function useTags() {
const tagsViews = reactive<Array<tagsViewsType>>([
{
icon: "refresh-right",
icon: RefreshRight,
text: $t("buttons.hsreload"),
divided: false,
disabled: false,
show: true
},
{
icon: "close",
icon: Close,
text: $t("buttons.hscloseCurrentTab"),
divided: false,
disabled: multiTags.value.length > 1 ? false : true,
show: true
},
{
icon: "close-left-tags",
icon: CloseLeftTags,
text: $t("buttons.hscloseLeftTabs"),
divided: true,
disabled: multiTags.value.length > 1 ? false : true,
show: true
},
{
icon: "close-right-tags",
icon: CloseRightTags,
text: $t("buttons.hscloseRightTabs"),
divided: false,
disabled: multiTags.value.length > 1 ? false : true,
show: true
},
{
icon: "close-other-tags",
icon: CloseOtherTags,
text: $t("buttons.hscloseOtherTabs"),
divided: true,
disabled: multiTags.value.length > 2 ? false : true,
show: true
},
{
icon: "close-all-tags",
icon: CloseAllTags,
text: $t("buttons.hscloseAllTabs"),
divided: false,
disabled: multiTags.value.length > 1 ? false : true,
show: true
},
{
icon: "fullscreen",
icon: Fullscreen,
text: $t("buttons.hswholeFullScreen"),
divided: true,
disabled: false,
show: true
},
{
icon: "fullscreen",
icon: Fullscreen,
text: $t("buttons.hscontentFullScreen"),
divided: false,
disabled: false,

1
src/layout/index.vue

@ -1,4 +1,5 @@
<script setup lang="ts">
import "animate.css";
import { setType } from "./types";
import { emitter } from "@/utils/mitt";
import { useLayout } from "./hooks/useLayout";

9
src/layout/types.ts

@ -1,17 +1,20 @@
import type { IconifyIcon } from "@iconify/vue";
import HomeFilled from "@iconify-icons/ep/home-filled";
export const routerArrays: Array<RouteConfigs> = [
{
path: "/welcome",
parentPath: "/",
meta: {
title: "menus.hshome",
icon: "home-filled"
icon: HomeFilled
}
}
];
export type routeMetaType = {
title?: string;
icon?: string;
icon?: string | IconifyIcon;
showLink?: boolean;
savedPosition?: boolean;
auths?: Array<string>;
@ -32,7 +35,7 @@ export type multiTagsType = {
};
export type tagsViewsType = {
icon: string;
icon: string | IconifyIcon;
text: string;
divided: boolean;
disabled: boolean;

1
src/main.ts

@ -13,7 +13,6 @@ import { injectResponsiveStorage } from "@/utils/responsive";
// import Table from "@pureadmin/table";
// import PureDescriptions from "@pureadmin/descriptions";
import "animate.css";
// 引入重置样式
import "./style/reset.scss";
// 导入公共样式

5
src/plugins/echarts/index.ts

@ -1,6 +1,6 @@
import type { App } from "vue";
import * as echarts from "echarts/core";
import { SVGRenderer } from "echarts/renderers";
import { CanvasRenderer } from "echarts/renderers";
import { PieChart, BarChart, LineChart } from "echarts/charts";
import {
GridComponent,
@ -19,7 +19,7 @@ use([
PieChart,
BarChart,
LineChart,
SVGRenderer,
CanvasRenderer,
GridComponent,
TitleComponent,
LegendComponent,
@ -33,6 +33,7 @@ use([
/**
* @description echarts
* @see {@link https://echarts.apache.org/handbook/zh/basics/import#%E6%8C%89%E9%9C%80%E5%BC%95%E5%85%A5-echarts-%E5%9B%BE%E8%A1%A8%E5%92%8C%E7%BB%84%E4%BB%B6}
* @see `$echarts` `globalProperties` https://pure-admin-utils.netlify.app/hooks/useEcharts/useEcharts.html 使用
*/
export function useEcharts(app: App) {
app.config.globalProperties.$echarts = echarts;

3
src/router/modules/error.ts

@ -1,10 +1,11 @@
import { $t } from "@/plugins/i18n";
import InformationLine from "@iconify-icons/ri/information-line";
export default {
path: "/error",
redirect: "/error/403",
meta: {
icon: "information-line",
icon: InformationLine,
title: $t("menus.hsabnormal"),
rank: 9
},

3
src/router/modules/home.ts

@ -1,5 +1,6 @@
import { $t } from "@/plugins/i18n";
const Layout = () => import("@/layout/index.vue");
import HomeFilled from "@iconify-icons/ep/home-filled";
export default {
path: "/",
@ -7,7 +8,7 @@ export default {
component: Layout,
redirect: "/welcome",
meta: {
icon: "home-filled",
icon: HomeFilled,
title: $t("menus.hshome"),
rank: 0
},

3
src/router/modules/remaining.ts

@ -1,5 +1,6 @@
import { $t } from "@/plugins/i18n";
const Layout = () => import("@/layout/index.vue");
import HomeFilled from "@iconify-icons/ep/home-filled";
export default [
{
@ -16,7 +17,7 @@ export default [
path: "/redirect",
component: Layout,
meta: {
icon: "home-filled",
icon: HomeFilled,
title: $t("menus.hshome"),
showLink: false,
rank: 102

8
src/style/reset.scss

@ -111,7 +111,6 @@ button,
[type="button"],
[type="reset"],
[type="submit"] {
-webkit-appearance: button;
background-image: none;
}
@ -133,16 +132,10 @@ progress {
}
[type="search"] {
-webkit-appearance: textfield;
outline-offset: -2px;
}
::-webkit-search-decoration {
-webkit-appearance: none;
}
::-webkit-file-upload-button {
-webkit-appearance: button;
font: inherit;
}
@ -211,7 +204,6 @@ iframe,
embed,
object {
display: block;
vertical-align: middle;
}
img,

4
src/utils/http/index.ts

@ -175,7 +175,7 @@ class PureHttp {
/** 单独抽离的post工具函数 */
public post<T, P>(
url: string,
params?: T,
params?: AxiosRequestConfig<T>,
config?: PureHttpRequestConfig
): Promise<P> {
return this.request<P>("post", url, params, config);
@ -184,7 +184,7 @@ class PureHttp {
/** 单独抽离的get工具函数 */
public get<T, P>(
url: string,
params?: T,
params?: AxiosRequestConfig<T>,
config?: PureHttpRequestConfig
): Promise<P> {
return this.request<P>("get", url, params, config);

11
src/views/login/index.vue

@ -19,6 +19,9 @@ import { useDataThemeChange } from "@/layout/hooks/useDataThemeChange";
import dayIcon from "@/assets/svg/day.svg?component";
import darkIcon from "@/assets/svg/dark.svg?component";
import globalization from "@/assets/svg/globalization.svg?component";
import Lock from "@iconify-icons/ri/lock-fill";
import Check from "@iconify-icons/ep/check";
import User from "@iconify-icons/ri/user-3-fill";
defineOptions({
name: "Login"
@ -107,7 +110,7 @@ onBeforeUnmount(() => {
<IconifyIconOffline
class="check-zh"
v-show="locale === 'zh'"
icon="check"
:icon="Check"
/>
简体中文
</el-dropdown-item>
@ -117,7 +120,7 @@ onBeforeUnmount(() => {
@click="translationEn"
>
<span class="check-en" v-show="locale === 'en'">
<IconifyIconOffline icon="check" />
<IconifyIconOffline :icon="Check" />
</span>
English
</el-dropdown-item>
@ -157,7 +160,7 @@ onBeforeUnmount(() => {
clearable
v-model="ruleForm.username"
:placeholder="t('login.username')"
:prefix-icon="useRenderIcon('user')"
:prefix-icon="useRenderIcon(User)"
/>
</el-form-item>
</Motion>
@ -169,7 +172,7 @@ onBeforeUnmount(() => {
show-password
v-model="ruleForm.password"
:placeholder="t('login.password')"
:prefix-icon="useRenderIcon('lock')"
:prefix-icon="useRenderIcon(Lock)"
/>
</el-form-item>
</Motion>

5
types/global.d.ts

@ -5,6 +5,7 @@ import type {
ComponentPublicInstance
} from "vue";
import type { ECharts } from "echarts";
import type { IconifyIcon } from "@iconify/vue";
import type { ResponsiveStorage } from "./index";
import type { TableColumns } from "@pureadmin/table";
import { type RouteComponent, type RouteLocationNormalized } from "vue-router";
@ -189,7 +190,7 @@ declare global {
/** 菜单名称(兼容国际化、非国际化,如何用国际化的写法就必须在根目录的`locales`文件夹下对应添加) `必填` */
title: string;
/** 菜单图标 `可选` */
icon?: string | FunctionalComponent;
icon?: string | FunctionalComponent | IconifyIcon;
/** 菜单名称右侧的额外图标,支持`fontawesome`、`iconfont`、`element-plus-icon` `可选` */
extraIcon?: {
svg?: boolean;
@ -247,7 +248,7 @@ declare global {
/** 菜单名称(兼容国际化、非国际化,如何用国际化的写法就必须在根目录的`locales`文件夹下对应添加)`必填` */
title: string;
/** 菜单图标 `可选` */
icon?: string | FunctionalComponent;
icon?: string | FunctionalComponent | IconifyIcon;
/** 是否在菜单中显示(默认`true`)`可选` */
showLink?: boolean;
/** 菜单升序排序,值越高排的越后(只针对顶级路由)`可选` */

4
vite.config.ts

@ -2,8 +2,8 @@ import dayjs from "dayjs";
import { resolve } from "path";
import pkg from "./package.json";
import { warpperEnv } from "./build";
import { include } from "./build/optimize";
import { getPluginsList } from "./build/plugins";
import { include, exclude } from "./build/optimize";
import { UserConfigExport, ConfigEnv, loadEnv } from "vite";
/** 当前执行node命令时文件夹的地址(工作目录) */
@ -49,7 +49,7 @@ export default ({ command, mode }: ConfigEnv): UserConfigExport => {
// https://cn.vitejs.dev/config/dep-optimization-options.html#dep-optimization-options
optimizeDeps: {
include,
exclude: ["@pureadmin/theme/dist/browser-utils"]
exclude
},
build: {
sourcemap: false,

Loading…
Cancel
Save