Browse Source

release: update `3.9.3`

i18n
xiaoxian521 2 years ago
parent
commit
1154c0b9f8
  1. 4
      mock/asyncRoutes.ts
  2. 6
      package.json
  3. 16
      pnpm-lock.yaml
  4. 2
      public/serverConfig.json
  5. 14
      src/components/ReIcon/src/offlineIcon.ts
  6. 32
      src/layout/components/setting/index.vue
  7. 8
      src/layout/components/sidebar/horizontal.vue
  8. 9
      src/layout/components/sidebar/mixNav.vue
  9. 2
      src/layout/components/sidebar/sidebarItem.vue
  10. 11
      src/layout/components/sidebar/vertical.vue
  11. 2
      src/layout/index.vue
  12. 3
      src/layout/types.ts
  13. 3
      src/router/modules/error.ts
  14. 3
      src/router/modules/home.ts
  15. 3
      src/router/modules/remaining.ts
  16. 4
      src/router/utils.ts

4
mock/asyncRoutes.ts

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

6
package.json

@ -1,6 +1,6 @@
{
"name": "pure-admin-thin",
"version": "3.9.2",
"version": "3.9.3",
"private": true,
"scripts": {
"dev": "NODE_OPTIONS=--max-old-space-size=4096 vite",
@ -31,8 +31,8 @@
"dependencies": {
"@ctrl/tinycolor": "^3.4.1",
"@pureadmin/descriptions": "^1.1.0",
"@pureadmin/table": "^1.8.2",
"@pureadmin/utils": "^1.7.2",
"@pureadmin/table": "^1.8.3",
"@pureadmin/utils": "^1.7.4",
"@vueuse/core": "^9.6.0",
"@vueuse/motion": "2.0.0-beta.12",
"animate.css": "^4.1.1",

16
pnpm-lock.yaml

@ -9,9 +9,9 @@ specifiers:
'@iconify/vue': ^4.0.0
'@intlify/vite-plugin-vue-i18n': ^6.0.3
'@pureadmin/descriptions': ^1.1.0
'@pureadmin/table': ^1.8.2
'@pureadmin/table': ^1.8.3
'@pureadmin/theme': ^2.4.0
'@pureadmin/utils': ^1.7.2
'@pureadmin/utils': ^1.7.4
'@types/element-resize-detector': 1.1.3
'@types/js-cookie': ^3.0.1
'@types/lodash': ^4.14.180
@ -95,8 +95,8 @@ specifiers:
dependencies:
'@ctrl/tinycolor': 3.4.1
'@pureadmin/descriptions': 1.1[email protected]
'@pureadmin/table': 1.8.2[email protected]
'@pureadmin/utils': 1.7.2_aotapuqn7htzdjltsyimavekky
'@pureadmin/table': 1.8.3[email protected]
'@pureadmin/utils': 1.7.4_aotapuqn7htzdjltsyimavekky
'@vueuse/core': 9.6[email protected]
'@vueuse/motion': 2.0.0-[email protected]
animate.css: 4.1.1
@ -920,8 +920,8 @@ packages:
vue: 3.2.45
dev: false
/@pureadmin/table/1.8.2[email protected]:
resolution: {integrity: sha512-FGh1aOfgQtX16pCnP+bxg49TetcZDhdykIue0m5d8NIj6zkvJP53JU+DkUpvqvKmUiMsvIwme6e17BLZMmMiOw==}
/@pureadmin/table/1.8.3[email protected]:
resolution: {integrity: sha512-M+I+CDu74s/ffNybbDg0rHhiMHTdkgVIaksfmmrEwjuLB2nEaz7R0tob2qC5rKE96U2Z246meDHBidyQNx2z9w==}
peerDependencies:
element-plus: ^2.0.0
dependencies:
@ -937,8 +937,8 @@ packages:
string-hash: 1.1.3
dev: true
/@pureadmin/utils/1.7.2_aotapuqn7htzdjltsyimavekky:
resolution: {integrity: sha512-L8tmogs9HCX6nuga1g79DcZr3KXNoWnIFcyP2z4zpmUmdBBAmMpXXz3Z+emI6HELmZu8DFx+v1MfKxccgsODRQ==}
/@pureadmin/utils/1.7.4_aotapuqn7htzdjltsyimavekky:
resolution: {integrity: sha512-uJNHcb2sO7R2avALf+v4TGyuZtJix0Wpw/kMb6eO4C003ZQImuGGi9WlxHaOlESrMyFHZ1AjWm5AqLwJLnpVlw==}
peerDependencies:
dayjs: '*'
echarts: '*'

2
public/serverConfig.json

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

14
src/components/ReIcon/src/offlineIcon.ts

@ -0,0 +1,14 @@
import { addIcon } from "@iconify/vue/dist/offline";
/**
* src/layout/index.vue
*/
// 本地菜单图标,后端在路由的icon中返回对应的图标字符串并且前端在此处使用addIcon添加即可渲染菜单图标
import HomeFilled from "@iconify-icons/ep/home-filled";
import InformationLine from "@iconify-icons/ri/information-line";
import Lollipop from "@iconify-icons/ep/lollipop";
addIcon("homeFilled", HomeFilled);
addIcon("informationLine", InformationLine);
addIcon("lollipop", Lollipop);

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

@ -1,5 +1,14 @@
<script setup lang="ts">
import {
ref,
unref,
watch,
reactive,
computed,
nextTick,
onBeforeMount
} from "vue";
import {
useDark,
debounce,
useGlobal,
@ -17,7 +26,6 @@ import { useNav } from "@/layout/hooks/useNav";
import { useAppStoreHook } from "@/store/modules/app";
import { toggleTheme } from "@pureadmin/theme/dist/browser-utils";
import { useMultiTagsStoreHook } from "@/store/modules/multiTags";
import { ref, unref, watch, reactive, computed, nextTick } from "vue";
import { useDataThemeChange } from "@/layout/hooks/useDataThemeChange";
import dayIcon from "@/assets/svg/day.svg?component";
@ -189,16 +197,6 @@ function setLayoutModel(layout: string) {
useAppStoreHook().setLayout(layout);
}
/* 初始化项目配置 */
nextTick(() => {
settings.greyVal &&
document.querySelector("html")?.setAttribute("class", "html-grey");
settings.weakVal &&
document.querySelector("html")?.setAttribute("class", "html-weakness");
settings.tabsVal && tagsChange();
dataThemeChange();
});
watch($storage, ({ layout }) => {
switch (layout["layout"]) {
case "vertical":
@ -218,6 +216,18 @@ watch($storage, ({ layout }) => {
break;
}
});
onBeforeMount(() => {
dataThemeChange();
/* 初始化项目配置 */
nextTick(() => {
settings.greyVal &&
document.querySelector("html")?.setAttribute("class", "html-grey");
settings.weakVal &&
document.querySelector("html")?.setAttribute("class", "html-weakness");
settings.tabsVal && tagsChange();
});
});
</script>
<template>

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

@ -41,7 +41,10 @@ watch(
</script>
<template>
<div class="horizontal-header">
<div
v-loading="usePermissionStoreHook().wholeMenus.length === 0"
class="horizontal-header"
>
<div class="horizontal-header-left" @click="backHome">
<FontIcon icon="team-iconlogo" svg style="width: 35px; height: 35px" />
<h4>{{ title }}</h4>
@ -129,6 +132,9 @@ watch(
</template>
<style lang="scss" scoped>
:deep(.el-loading-mask) {
opacity: 0.45;
}
.translation {
::v-deep(.el-dropdown-menu__item) {
padding: 5px 40px;

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

@ -58,7 +58,11 @@ watch(
</script>
<template>
<div v-if="device !== 'mobile'" class="horizontal-header">
<div
v-if="device !== 'mobile'"
class="horizontal-header"
v-loading="usePermissionStoreHook().wholeMenus.length === 0"
>
<el-menu
router
ref="menuRef"
@ -161,6 +165,9 @@ watch(
</template>
<style lang="scss" scoped>
:deep(.el-loading-mask) {
opacity: 0.45;
}
.translation {
::v-deep(.el-dropdown-menu__item) {
padding: 5px 40px;

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

@ -203,7 +203,7 @@ function resolvePath(routePath) {
placement="top"
:effect="tooltipEffect"
:offset="-10"
:disabled="!isCollapse && !onlyOneChild.showTooltip"
:disabled="!onlyOneChild.showTooltip"
>
<template #content>
{{ transformI18n(onlyOneChild.meta.title) }}

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

@ -59,7 +59,10 @@ watch(
</script>
<template>
<div :class="['sidebar-container', showLogo ? 'has-logo' : '']">
<div
v-loading="menuData.length === 0"
:class="['sidebar-container', showLogo ? 'has-logo' : '']"
>
<Logo v-if="showLogo" :collapse="isCollapse" />
<el-scrollbar
wrap-class="scrollbar-wrapper"
@ -91,3 +94,9 @@ watch(
/>
</div>
</template>
<style scoped>
:deep(.el-loading-mask) {
opacity: 0.45;
}
</style>

2
src/layout/index.vue

@ -1,5 +1,7 @@
<script setup lang="ts">
import "animate.css";
// src/components/ReIcon/src/offlineIcon.ts 使addIcon
import "@/components/ReIcon/src/offlineIcon";
// vxe-tableiconcomponentfont-awesome
// import "font-awesome/css/font-awesome.min.css";
import { setType } from "./types";

3
src/layout/types.ts

@ -1,5 +1,4 @@
import type { IconifyIcon } from "@iconify/vue";
import HomeFilled from "@iconify-icons/ep/home-filled";
export const routerArrays: Array<RouteConfigs> = [
{
@ -7,7 +6,7 @@ export const routerArrays: Array<RouteConfigs> = [
parentPath: "/",
meta: {
title: "menus.hshome",
icon: HomeFilled
icon: "homeFilled"
}
}
];

3
src/router/modules/error.ts

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

3
src/router/modules/home.ts

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

3
src/router/modules/remaining.ts

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

4
src/router/utils.ts

@ -198,7 +198,7 @@ function initRouter() {
} else {
return new Promise(resolve => {
getAsyncRoutes().then(({ data }) => {
handleAsyncRoutes(data);
handleAsyncRoutes(cloneDeep(data));
storageSession.setItem(key, data);
resolve(router);
});
@ -207,7 +207,7 @@ function initRouter() {
} else {
return new Promise(resolve => {
getAsyncRoutes().then(({ data }) => {
handleAsyncRoutes(data);
handleAsyncRoutes(cloneDeep(data));
resolve(router);
});
});

Loading…
Cancel
Save