mirror of
https://github.com/pure-admin/vue-pure-admin.git
synced 2025-11-03 13:44:47 +08:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f13faf0788 | ||
|
|
8e2b174e09 | ||
|
|
b5839d6398 | ||
|
|
b14f41c8d7 | ||
|
|
9ab3fd19ef | ||
|
|
fa5c97ffa4 | ||
|
|
b4a566b2bf |
@@ -1,3 +1,20 @@
|
|||||||
|
# 3.9.3 (2022-12-04)
|
||||||
|
|
||||||
|
### 🎫 Feat
|
||||||
|
|
||||||
|
- Add `@pureadmin/table` pagination and loading animation example
|
||||||
|
|
||||||
|
### 🐞 Bug fixes
|
||||||
|
|
||||||
|
- Fixed the problem that the refresh page would be blank due to changes in dynamic routes stored in local storage after enabling `CachingAsyncRoutes`
|
||||||
|
- Fixed `Tooltip` displayed abnormally after the menu is collapsed
|
||||||
|
|
||||||
|
### 🍏 Perf
|
||||||
|
|
||||||
|
- Expand the use of local icons, the first launch of the full version reduces `13` requests again
|
||||||
|
- When the menu loading is slow, add `loading` animation to optimize user experience
|
||||||
|
- Theme initialization is placed in `onBeforeMount` to avoid flashing of the initialization page
|
||||||
|
|
||||||
# 3.9.2 (2022-12-03)
|
# 3.9.2 (2022-12-03)
|
||||||
|
|
||||||
### 🍏 Perf
|
### 🍏 Perf
|
||||||
|
|||||||
17
CHANGELOG.md
17
CHANGELOG.md
@@ -1,3 +1,20 @@
|
|||||||
|
# 3.9.3 (2022-12-04)
|
||||||
|
|
||||||
|
### 🎫 Feat
|
||||||
|
|
||||||
|
- Add `@pureadmin/table` pagination and loading animation example
|
||||||
|
|
||||||
|
### 🐞 Bug fixes
|
||||||
|
|
||||||
|
- Fixed the problem that the refresh page would be blank due to changes in dynamic routes stored in local storage after enabling `CachingAsyncRoutes`
|
||||||
|
- Fixed `Tooltip` displayed abnormally after the menu is collapsed
|
||||||
|
|
||||||
|
### 🍏 Perf
|
||||||
|
|
||||||
|
- Expand the use of local icons, the first launch of the full version reduces `13` requests again
|
||||||
|
- When the menu loading is slow, add `loading` animation to optimize user experience
|
||||||
|
- Theme initialization is placed in `onBeforeMount` to avoid flashing of the initialization page
|
||||||
|
|
||||||
# 3.9.2 (2022-12-03)
|
# 3.9.2 (2022-12-03)
|
||||||
|
|
||||||
### 🍏 Perf
|
### 🍏 Perf
|
||||||
|
|||||||
@@ -1,3 +1,20 @@
|
|||||||
|
# 3.9.3 (2022-12-04)
|
||||||
|
|
||||||
|
### 🎫 Feat
|
||||||
|
|
||||||
|
- 添加 `@pureadmin/table` 分页和加载动画示例
|
||||||
|
|
||||||
|
### 🐞 Bug fixes
|
||||||
|
|
||||||
|
- 修复开启 `CachingAsyncRoutes` 后,存入本地存储的动态路由改变造成刷新页面空白的问题
|
||||||
|
- 修复菜单折叠后 `Tooltip` 显示异常
|
||||||
|
|
||||||
|
### 🍏 Perf
|
||||||
|
|
||||||
|
- 扩展本地图标使用方式,完整版首启动再次减少 `13` 个请求
|
||||||
|
- 当菜单加载慢时,添加 `loading` 动画,优化用户体验
|
||||||
|
- 主题初始化放在 `onBeforeMount` 里,避免初始化页面闪烁
|
||||||
|
|
||||||
# 3.9.2 (2022-12-03)
|
# 3.9.2 (2022-12-03)
|
||||||
|
|
||||||
### 🍏 Perf
|
### 🍏 Perf
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ menus:
|
|||||||
hsInfiniteScroll: 表格无限滚动
|
hsInfiniteScroll: 表格无限滚动
|
||||||
hsdanmaku: 弹幕组件
|
hsdanmaku: 弹幕组件
|
||||||
hsPureTableBase: 基础用法(23个示例)
|
hsPureTableBase: 基础用法(23个示例)
|
||||||
hsPureTableHigh: 高级用法(8个示例)
|
hsPureTableHigh: 高级用法(9个示例)
|
||||||
hsTree: 大数据树业务组件
|
hsTree: 大数据树业务组件
|
||||||
hsMenuoverflow: 目录超出显示 Tooltip 文字提示
|
hsMenuoverflow: 目录超出显示 Tooltip 文字提示
|
||||||
hsChildMenuoverflow: 菜单超出显示 Tooltip 文字提示
|
hsChildMenuoverflow: 菜单超出显示 Tooltip 文字提示
|
||||||
|
|||||||
@@ -2,14 +2,6 @@
|
|||||||
import { MockMethod } from "vite-plugin-mock";
|
import { MockMethod } from "vite-plugin-mock";
|
||||||
import { system, permission, frame, tabs } from "@/router/enums";
|
import { system, permission, frame, tabs } from "@/router/enums";
|
||||||
|
|
||||||
import FlUser from "@iconify-icons/ri/admin-line";
|
|
||||||
import Role from "@iconify-icons/ri/admin-fill";
|
|
||||||
import Dict from "@iconify-icons/ri/git-repository-line";
|
|
||||||
import Setting from "@iconify-icons/ri/settings-3-line";
|
|
||||||
import Dept from "@iconify-icons/ri/git-branch-line";
|
|
||||||
import Lollipop from "@iconify-icons/ep/lollipop";
|
|
||||||
import Monitor from "@iconify-icons/ep/monitor";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* roles:页面级别权限,这里模拟二种 "admin"、"common"
|
* roles:页面级别权限,这里模拟二种 "admin"、"common"
|
||||||
* admin:管理员角色
|
* admin:管理员角色
|
||||||
@@ -19,7 +11,7 @@ import Monitor from "@iconify-icons/ep/monitor";
|
|||||||
const systemRouter = {
|
const systemRouter = {
|
||||||
path: "/system",
|
path: "/system",
|
||||||
meta: {
|
meta: {
|
||||||
icon: Setting,
|
icon: "setting",
|
||||||
title: "menus.hssysManagement",
|
title: "menus.hssysManagement",
|
||||||
rank: system
|
rank: system
|
||||||
},
|
},
|
||||||
@@ -28,7 +20,7 @@ const systemRouter = {
|
|||||||
path: "/system/user/index",
|
path: "/system/user/index",
|
||||||
name: "User",
|
name: "User",
|
||||||
meta: {
|
meta: {
|
||||||
icon: FlUser,
|
icon: "flUser",
|
||||||
title: "menus.hsUser",
|
title: "menus.hsUser",
|
||||||
roles: ["admin"]
|
roles: ["admin"]
|
||||||
}
|
}
|
||||||
@@ -37,7 +29,7 @@ const systemRouter = {
|
|||||||
path: "/system/role/index",
|
path: "/system/role/index",
|
||||||
name: "Role",
|
name: "Role",
|
||||||
meta: {
|
meta: {
|
||||||
icon: Role,
|
icon: "role",
|
||||||
title: "menus.hsRole",
|
title: "menus.hsRole",
|
||||||
roles: ["admin"]
|
roles: ["admin"]
|
||||||
}
|
}
|
||||||
@@ -46,7 +38,7 @@ const systemRouter = {
|
|||||||
path: "/system/dept/index",
|
path: "/system/dept/index",
|
||||||
name: "Dept",
|
name: "Dept",
|
||||||
meta: {
|
meta: {
|
||||||
icon: Dept,
|
icon: "dept",
|
||||||
title: "menus.hsDept",
|
title: "menus.hsDept",
|
||||||
roles: ["admin"]
|
roles: ["admin"]
|
||||||
}
|
}
|
||||||
@@ -56,7 +48,7 @@ const systemRouter = {
|
|||||||
component: "/system/dict/index",
|
component: "/system/dict/index",
|
||||||
name: "Dict",
|
name: "Dict",
|
||||||
meta: {
|
meta: {
|
||||||
icon: Dict,
|
icon: "dict",
|
||||||
title: "menus.hsDict",
|
title: "menus.hsDict",
|
||||||
keepAlive: true,
|
keepAlive: true,
|
||||||
roles: ["admin"]
|
roles: ["admin"]
|
||||||
@@ -69,7 +61,7 @@ const permissionRouter = {
|
|||||||
path: "/permission",
|
path: "/permission",
|
||||||
meta: {
|
meta: {
|
||||||
title: "menus.permission",
|
title: "menus.permission",
|
||||||
icon: Lollipop,
|
icon: "lollipop",
|
||||||
rank: permission
|
rank: permission
|
||||||
},
|
},
|
||||||
children: [
|
children: [
|
||||||
@@ -96,7 +88,7 @@ const permissionRouter = {
|
|||||||
const frameRouter = {
|
const frameRouter = {
|
||||||
path: "/iframe",
|
path: "/iframe",
|
||||||
meta: {
|
meta: {
|
||||||
icon: Monitor,
|
icon: "monitor",
|
||||||
title: "menus.hsExternalPage",
|
title: "menus.hsExternalPage",
|
||||||
rank: frame
|
rank: frame
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "vue-pure-admin",
|
"name": "vue-pure-admin",
|
||||||
"version": "3.9.2",
|
"version": "3.9.3",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "NODE_OPTIONS=--max-old-space-size=4096 vite",
|
"dev": "NODE_OPTIONS=--max-old-space-size=4096 vite",
|
||||||
@@ -35,8 +35,8 @@
|
|||||||
"@logicflow/core": "^1.1.30",
|
"@logicflow/core": "^1.1.30",
|
||||||
"@logicflow/extension": "^1.1.30",
|
"@logicflow/extension": "^1.1.30",
|
||||||
"@pureadmin/descriptions": "^1.1.0",
|
"@pureadmin/descriptions": "^1.1.0",
|
||||||
"@pureadmin/table": "^1.8.2",
|
"@pureadmin/table": "^1.8.3",
|
||||||
"@pureadmin/utils": "^1.7.2",
|
"@pureadmin/utils": "^1.7.4",
|
||||||
"@vueuse/core": "^9.6.0",
|
"@vueuse/core": "^9.6.0",
|
||||||
"@vueuse/motion": "2.0.0-beta.12",
|
"@vueuse/motion": "2.0.0-beta.12",
|
||||||
"@wangeditor/editor": "^5.1.21",
|
"@wangeditor/editor": "^5.1.21",
|
||||||
|
|||||||
6138
pnpm-lock.yaml
generated
6138
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"Version": "3.9.2",
|
"Version": "3.9.3",
|
||||||
"Title": "PureAdmin",
|
"Title": "PureAdmin",
|
||||||
"FixedHeader": true,
|
"FixedHeader": true,
|
||||||
"HiddenSideBar": false,
|
"HiddenSideBar": false,
|
||||||
|
|||||||
51
src/components/ReIcon/src/offlineIcon.ts
Normal file
51
src/components/ReIcon/src/offlineIcon.ts
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
import { addIcon } from "@iconify/vue/dist/offline";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 这里存放本地图标,在 src/layout/index.vue 文件中加载,避免在首启动加载
|
||||||
|
*/
|
||||||
|
|
||||||
|
// 本地菜单图标,后端在路由的icon中返回对应的图标字符串并且前端在此处使用addIcon添加即可渲染菜单图标
|
||||||
|
import UbuntuFill from "@iconify-icons/ri/ubuntu-fill";
|
||||||
|
import Menu from "@iconify-icons/ep/menu";
|
||||||
|
import Edit from "@iconify-icons/ep/edit";
|
||||||
|
import InformationLine from "@iconify-icons/ri/information-line";
|
||||||
|
import SetUp from "@iconify-icons/ep/set-up";
|
||||||
|
import TerminalWindowLine from "@iconify-icons/ri/terminal-window-line";
|
||||||
|
import Guide from "@iconify-icons/ep/guide";
|
||||||
|
import HomeFilled from "@iconify-icons/ep/home-filled";
|
||||||
|
import Card from "@iconify-icons/ri/bank-card-line";
|
||||||
|
import ListCheck from "@iconify-icons/ri/list-check";
|
||||||
|
import Histogram from "@iconify-icons/ep/histogram";
|
||||||
|
import Ppt from "@iconify-icons/ri/file-ppt-2-line";
|
||||||
|
import CheckboxCircleLine from "@iconify-icons/ri/checkbox-circle-line";
|
||||||
|
import FlUser from "@iconify-icons/ri/admin-line";
|
||||||
|
import Role from "@iconify-icons/ri/admin-fill";
|
||||||
|
import Dict from "@iconify-icons/ri/git-repository-line";
|
||||||
|
import Setting from "@iconify-icons/ri/settings-3-line";
|
||||||
|
import Dept from "@iconify-icons/ri/git-branch-line";
|
||||||
|
import Lollipop from "@iconify-icons/ep/lollipop";
|
||||||
|
import Monitor from "@iconify-icons/ep/monitor";
|
||||||
|
addIcon("ubuntuFill", UbuntuFill);
|
||||||
|
addIcon("menu", Menu);
|
||||||
|
addIcon("edit", Edit);
|
||||||
|
addIcon("informationLine", InformationLine);
|
||||||
|
addIcon("setUp", SetUp);
|
||||||
|
addIcon("terminalWindowLine", TerminalWindowLine);
|
||||||
|
addIcon("guide", Guide);
|
||||||
|
addIcon("homeFilled", HomeFilled);
|
||||||
|
addIcon("card", Card);
|
||||||
|
addIcon("listCheck", ListCheck);
|
||||||
|
addIcon("histogram", Histogram);
|
||||||
|
addIcon("ppt", Ppt);
|
||||||
|
addIcon("checkboxCircleLine", CheckboxCircleLine);
|
||||||
|
addIcon("flUser", FlUser);
|
||||||
|
addIcon("role", Role);
|
||||||
|
addIcon("dict", Dict);
|
||||||
|
addIcon("setting", Setting);
|
||||||
|
addIcon("dept", Dept);
|
||||||
|
addIcon("lollipop", Lollipop);
|
||||||
|
addIcon("monitor", Monitor);
|
||||||
|
|
||||||
|
// 非菜单图标
|
||||||
|
import RefreshRight from "@iconify-icons/ep/refresh-right";
|
||||||
|
addIcon("refreshRight", RefreshRight);
|
||||||
@@ -13,7 +13,6 @@ import { isString } from "@pureadmin/utils";
|
|||||||
import { propTypes } from "@/utils/propTypes";
|
import { propTypes } from "@/utils/propTypes";
|
||||||
import { IconifyIconOffline } from "../../ReIcon";
|
import { IconifyIconOffline } from "../../ReIcon";
|
||||||
import QRCode, { QRCodeRenderersOptions } from "qrcode";
|
import QRCode, { QRCodeRenderersOptions } from "qrcode";
|
||||||
import RefreshRight from "@iconify-icons/ep/refresh-right";
|
|
||||||
|
|
||||||
interface QrcodeLogo {
|
interface QrcodeLogo {
|
||||||
src?: string;
|
src?: string;
|
||||||
@@ -248,7 +247,7 @@ export default defineComponent({
|
|||||||
<div class="absolute top-[50%] left-[50%] font-bold">
|
<div class="absolute top-[50%] left-[50%] font-bold">
|
||||||
<IconifyIconOffline
|
<IconifyIconOffline
|
||||||
class="cursor-pointer"
|
class="cursor-pointer"
|
||||||
icon={RefreshRight}
|
icon="refreshRight"
|
||||||
width="30"
|
width="30"
|
||||||
color="var(--el-color-primary)"
|
color="var(--el-color-primary)"
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import { IconifyIconOffline } from "../../ReIcon";
|
|||||||
import Expand from "@iconify-icons/mdi/arrow-expand-down";
|
import Expand from "@iconify-icons/mdi/arrow-expand-down";
|
||||||
import ArrowCollapse from "@iconify-icons/mdi/arrow-collapse-vertical";
|
import ArrowCollapse from "@iconify-icons/mdi/arrow-collapse-vertical";
|
||||||
import Setting from "@iconify-icons/ri/settings-3-line";
|
import Setting from "@iconify-icons/ri/settings-3-line";
|
||||||
import RefreshRight from "@iconify-icons/ep/refresh-right";
|
|
||||||
|
|
||||||
export const loadingSvg = `
|
export const loadingSvg = `
|
||||||
<path class="path" d="
|
<path class="path" d="
|
||||||
@@ -153,7 +152,7 @@ export default defineComponent({
|
|||||||
<el-tooltip effect="dark" content="刷新" placement="top">
|
<el-tooltip effect="dark" content="刷新" placement="top">
|
||||||
<IconifyIconOffline
|
<IconifyIconOffline
|
||||||
class="cursor-pointer"
|
class="cursor-pointer"
|
||||||
icon={RefreshRight}
|
icon="refreshRight"
|
||||||
width="16"
|
width="16"
|
||||||
color="text_color_regular"
|
color="text_color_regular"
|
||||||
onClick={() => emit("refresh")}
|
onClick={() => emit("refresh")}
|
||||||
|
|||||||
@@ -1,4 +1,13 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import {
|
||||||
|
ref,
|
||||||
|
unref,
|
||||||
|
watch,
|
||||||
|
reactive,
|
||||||
|
computed,
|
||||||
|
nextTick,
|
||||||
|
onBeforeMount
|
||||||
|
} from "vue";
|
||||||
import {
|
import {
|
||||||
useDark,
|
useDark,
|
||||||
debounce,
|
debounce,
|
||||||
@@ -17,7 +26,6 @@ import { useNav } from "@/layout/hooks/useNav";
|
|||||||
import { useAppStoreHook } from "@/store/modules/app";
|
import { useAppStoreHook } from "@/store/modules/app";
|
||||||
import { toggleTheme } from "@pureadmin/theme/dist/browser-utils";
|
import { toggleTheme } from "@pureadmin/theme/dist/browser-utils";
|
||||||
import { useMultiTagsStoreHook } from "@/store/modules/multiTags";
|
import { useMultiTagsStoreHook } from "@/store/modules/multiTags";
|
||||||
import { ref, unref, watch, reactive, computed, nextTick } from "vue";
|
|
||||||
import { useDataThemeChange } from "@/layout/hooks/useDataThemeChange";
|
import { useDataThemeChange } from "@/layout/hooks/useDataThemeChange";
|
||||||
|
|
||||||
import dayIcon from "@/assets/svg/day.svg?component";
|
import dayIcon from "@/assets/svg/day.svg?component";
|
||||||
@@ -189,16 +197,6 @@ function setLayoutModel(layout: string) {
|
|||||||
useAppStoreHook().setLayout(layout);
|
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 }) => {
|
watch($storage, ({ layout }) => {
|
||||||
switch (layout["layout"]) {
|
switch (layout["layout"]) {
|
||||||
case "vertical":
|
case "vertical":
|
||||||
@@ -218,6 +216,18 @@ watch($storage, ({ layout }) => {
|
|||||||
break;
|
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>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|||||||
@@ -41,7 +41,10 @@ watch(
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="horizontal-header">
|
<div
|
||||||
|
v-loading="usePermissionStoreHook().wholeMenus.length === 0"
|
||||||
|
class="horizontal-header"
|
||||||
|
>
|
||||||
<div class="horizontal-header-left" @click="backHome">
|
<div class="horizontal-header-left" @click="backHome">
|
||||||
<FontIcon icon="team-iconlogo" svg style="width: 35px; height: 35px" />
|
<FontIcon icon="team-iconlogo" svg style="width: 35px; height: 35px" />
|
||||||
<h4>{{ title }}</h4>
|
<h4>{{ title }}</h4>
|
||||||
@@ -129,6 +132,10 @@ watch(
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
:deep(.el-loading-mask) {
|
||||||
|
opacity: 0.45;
|
||||||
|
}
|
||||||
|
|
||||||
.translation {
|
.translation {
|
||||||
::v-deep(.el-dropdown-menu__item) {
|
::v-deep(.el-dropdown-menu__item) {
|
||||||
padding: 5px 40px;
|
padding: 5px 40px;
|
||||||
|
|||||||
@@ -58,7 +58,11 @@ watch(
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<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
|
<el-menu
|
||||||
router
|
router
|
||||||
ref="menuRef"
|
ref="menuRef"
|
||||||
@@ -161,6 +165,10 @@ watch(
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
:deep(.el-loading-mask) {
|
||||||
|
opacity: 0.45;
|
||||||
|
}
|
||||||
|
|
||||||
.translation {
|
.translation {
|
||||||
::v-deep(.el-dropdown-menu__item) {
|
::v-deep(.el-dropdown-menu__item) {
|
||||||
padding: 5px 40px;
|
padding: 5px 40px;
|
||||||
|
|||||||
@@ -203,7 +203,7 @@ function resolvePath(routePath) {
|
|||||||
placement="top"
|
placement="top"
|
||||||
:effect="tooltipEffect"
|
:effect="tooltipEffect"
|
||||||
:offset="-10"
|
:offset="-10"
|
||||||
:disabled="!isCollapse && !onlyOneChild.showTooltip"
|
:disabled="!onlyOneChild.showTooltip"
|
||||||
>
|
>
|
||||||
<template #content>
|
<template #content>
|
||||||
{{ transformI18n(onlyOneChild.meta.title) }}
|
{{ transformI18n(onlyOneChild.meta.title) }}
|
||||||
|
|||||||
@@ -59,7 +59,10 @@ watch(
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<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" />
|
<Logo v-if="showLogo" :collapse="isCollapse" />
|
||||||
<el-scrollbar
|
<el-scrollbar
|
||||||
wrap-class="scrollbar-wrapper"
|
wrap-class="scrollbar-wrapper"
|
||||||
@@ -91,3 +94,9 @@ watch(
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
:deep(.el-loading-mask) {
|
||||||
|
opacity: 0.45;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import "animate.css";
|
import "animate.css";
|
||||||
|
// 引入 src/components/ReIcon/src/offlineIcon.ts 文件中所有使用addIcon添加过的本地图标
|
||||||
|
import "@/components/ReIcon/src/offlineIcon";
|
||||||
// vxe-table的所有icon不支持component模式,间接依赖了font-awesome
|
// vxe-table的所有icon不支持component模式,间接依赖了font-awesome
|
||||||
import "font-awesome/css/font-awesome.min.css";
|
import "font-awesome/css/font-awesome.min.css";
|
||||||
import { setType } from "./types";
|
import { setType } from "./types";
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import type { IconifyIcon } from "@iconify/vue";
|
import type { IconifyIcon } from "@iconify/vue";
|
||||||
import HomeFilled from "@iconify-icons/ep/home-filled";
|
|
||||||
|
|
||||||
export const routerArrays: Array<RouteConfigs> = [
|
export const routerArrays: Array<RouteConfigs> = [
|
||||||
{
|
{
|
||||||
@@ -7,7 +6,7 @@ export const routerArrays: Array<RouteConfigs> = [
|
|||||||
parentPath: "/",
|
parentPath: "/",
|
||||||
meta: {
|
meta: {
|
||||||
title: "menus.hshome",
|
title: "menus.hshome",
|
||||||
icon: HomeFilled
|
icon: "homeFilled"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -1,12 +1,11 @@
|
|||||||
import { $t } from "@/plugins/i18n";
|
import { $t } from "@/plugins/i18n";
|
||||||
import { able } from "@/router/enums";
|
import { able } from "@/router/enums";
|
||||||
import UbuntuFill from "@iconify-icons/ri/ubuntu-fill";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
path: "/able",
|
path: "/able",
|
||||||
redirect: "/able/watermark",
|
redirect: "/able/watermark",
|
||||||
meta: {
|
meta: {
|
||||||
icon: UbuntuFill,
|
icon: "ubuntuFill",
|
||||||
title: $t("menus.hsAble"),
|
title: $t("menus.hsAble"),
|
||||||
rank: able
|
rank: able
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,12 +1,11 @@
|
|||||||
import { $t } from "@/plugins/i18n";
|
import { $t } from "@/plugins/i18n";
|
||||||
import { components } from "@/router/enums";
|
import { components } from "@/router/enums";
|
||||||
import Menu from "@iconify-icons/ep/menu";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
path: "/components",
|
path: "/components",
|
||||||
redirect: "/components/video",
|
redirect: "/components/video",
|
||||||
meta: {
|
meta: {
|
||||||
icon: Menu,
|
icon: "menu",
|
||||||
title: $t("menus.hscomponents"),
|
title: $t("menus.hscomponents"),
|
||||||
rank: components
|
rank: components
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,12 +1,11 @@
|
|||||||
import { $t } from "@/plugins/i18n";
|
import { $t } from "@/plugins/i18n";
|
||||||
import { editor } from "@/router/enums";
|
import { editor } from "@/router/enums";
|
||||||
import Edit from "@iconify-icons/ep/edit";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
path: "/editor",
|
path: "/editor",
|
||||||
redirect: "/editor/index",
|
redirect: "/editor/index",
|
||||||
meta: {
|
meta: {
|
||||||
icon: Edit,
|
icon: "edit",
|
||||||
title: $t("menus.hseditor"),
|
title: $t("menus.hseditor"),
|
||||||
rank: editor
|
rank: editor
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,12 +1,11 @@
|
|||||||
import { $t } from "@/plugins/i18n";
|
import { $t } from "@/plugins/i18n";
|
||||||
import { error } from "@/router/enums";
|
import { error } from "@/router/enums";
|
||||||
import InformationLine from "@iconify-icons/ri/information-line";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
path: "/error",
|
path: "/error",
|
||||||
redirect: "/error/403",
|
redirect: "/error/403",
|
||||||
meta: {
|
meta: {
|
||||||
icon: InformationLine,
|
icon: "informationLine",
|
||||||
title: $t("menus.hsabnormal"),
|
title: $t("menus.hsabnormal"),
|
||||||
rank: error
|
rank: error
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,12 +1,11 @@
|
|||||||
import { $t } from "@/plugins/i18n";
|
import { $t } from "@/plugins/i18n";
|
||||||
import { flowchart } from "@/router/enums";
|
import { flowchart } from "@/router/enums";
|
||||||
import SetUp from "@iconify-icons/ep/set-up";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
path: "/flowChart",
|
path: "/flowChart",
|
||||||
redirect: "/flowChart/index",
|
redirect: "/flowChart/index",
|
||||||
meta: {
|
meta: {
|
||||||
icon: SetUp,
|
icon: "setUp",
|
||||||
title: $t("menus.hsflowChart"),
|
title: $t("menus.hsflowChart"),
|
||||||
rank: flowchart
|
rank: flowchart
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -2,13 +2,11 @@ import { $t } from "@/plugins/i18n";
|
|||||||
import { formdesign } from "@/router/enums";
|
import { formdesign } from "@/router/enums";
|
||||||
const IFrame = () => import("@/layout/frameView.vue");
|
const IFrame = () => import("@/layout/frameView.vue");
|
||||||
|
|
||||||
import TerminalWindowLine from "@iconify-icons/ri/terminal-window-line";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
path: "/formDesign",
|
path: "/formDesign",
|
||||||
redirect: "/formDesign/index",
|
redirect: "/formDesign/index",
|
||||||
meta: {
|
meta: {
|
||||||
icon: TerminalWindowLine,
|
icon: "terminalWindowLine",
|
||||||
title: $t("menus.hsFormDesign"),
|
title: $t("menus.hsFormDesign"),
|
||||||
rank: formdesign
|
rank: formdesign
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,12 +1,11 @@
|
|||||||
import { $t } from "@/plugins/i18n";
|
import { $t } from "@/plugins/i18n";
|
||||||
import { guide } from "@/router/enums";
|
import { guide } from "@/router/enums";
|
||||||
import Guide from "@iconify-icons/ep/guide";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
path: "/guide",
|
path: "/guide",
|
||||||
redirect: "/guide/index",
|
redirect: "/guide/index",
|
||||||
meta: {
|
meta: {
|
||||||
icon: Guide,
|
icon: "guide",
|
||||||
title: $t("menus.hsguide"),
|
title: $t("menus.hsguide"),
|
||||||
rank: guide
|
rank: guide
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import { $t } from "@/plugins/i18n";
|
import { $t } from "@/plugins/i18n";
|
||||||
import { home } from "@/router/enums";
|
import { home } from "@/router/enums";
|
||||||
const Layout = () => import("@/layout/index.vue");
|
const Layout = () => import("@/layout/index.vue");
|
||||||
import HomeFilled from "@iconify-icons/ep/home-filled";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
path: "/",
|
path: "/",
|
||||||
@@ -9,7 +8,7 @@ export default {
|
|||||||
component: Layout,
|
component: Layout,
|
||||||
redirect: "/welcome",
|
redirect: "/welcome",
|
||||||
meta: {
|
meta: {
|
||||||
icon: HomeFilled,
|
icon: "homeFilled",
|
||||||
title: $t("menus.hshome"),
|
title: $t("menus.hshome"),
|
||||||
rank: home
|
rank: home
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,13 +1,11 @@
|
|||||||
import { $t } from "@/plugins/i18n";
|
import { $t } from "@/plugins/i18n";
|
||||||
import { list } from "@/router/enums";
|
import { list } from "@/router/enums";
|
||||||
import ListCheck from "@iconify-icons/ri/list-check";
|
|
||||||
import Card from "@iconify-icons/ri/bank-card-line";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
path: "/list",
|
path: "/list",
|
||||||
redirect: "/list/card",
|
redirect: "/list/card",
|
||||||
meta: {
|
meta: {
|
||||||
icon: ListCheck,
|
icon: "listCheck",
|
||||||
title: $t("menus.hsList"),
|
title: $t("menus.hsList"),
|
||||||
rank: list
|
rank: list
|
||||||
},
|
},
|
||||||
@@ -17,7 +15,7 @@ export default {
|
|||||||
name: "ListCard",
|
name: "ListCard",
|
||||||
component: () => import("@/views/list/card/index.vue"),
|
component: () => import("@/views/list/card/index.vue"),
|
||||||
meta: {
|
meta: {
|
||||||
icon: Card,
|
icon: "card",
|
||||||
title: $t("menus.hsListCard"),
|
title: $t("menus.hsListCard"),
|
||||||
showParent: true
|
showParent: true
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,12 @@
|
|||||||
import { $t } from "@/plugins/i18n";
|
import { $t } from "@/plugins/i18n";
|
||||||
import { nested } from "@/router/enums";
|
import { nested } from "@/router/enums";
|
||||||
import Histogram from "@iconify-icons/ep/histogram";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
path: "/nested",
|
path: "/nested",
|
||||||
redirect: "/nested/menu1/menu1-1",
|
redirect: "/nested/menu1/menu1-1",
|
||||||
meta: {
|
meta: {
|
||||||
title: $t("menus.hsmenus"),
|
title: $t("menus.hsmenus"),
|
||||||
icon: Histogram,
|
icon: "histogram",
|
||||||
rank: nested
|
rank: nested
|
||||||
},
|
},
|
||||||
children: [
|
children: [
|
||||||
|
|||||||
@@ -1,12 +1,11 @@
|
|||||||
import { ppt } from "@/router/enums";
|
import { ppt } from "@/router/enums";
|
||||||
const IFrame = () => import("@/layout/frameView.vue");
|
const IFrame = () => import("@/layout/frameView.vue");
|
||||||
import Ppt from "@iconify-icons/ri/file-ppt-2-line";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
path: "/ppt",
|
path: "/ppt",
|
||||||
redirect: "/ppt/index",
|
redirect: "/ppt/index",
|
||||||
meta: {
|
meta: {
|
||||||
icon: Ppt,
|
icon: "ppt",
|
||||||
title: "PPT",
|
title: "PPT",
|
||||||
rank: ppt
|
rank: ppt
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import { $t } from "@/plugins/i18n";
|
import { $t } from "@/plugins/i18n";
|
||||||
const Layout = () => import("@/layout/index.vue");
|
const Layout = () => import("@/layout/index.vue");
|
||||||
import HomeFilled from "@iconify-icons/ep/home-filled";
|
|
||||||
|
|
||||||
export default [
|
export default [
|
||||||
{
|
{
|
||||||
@@ -17,7 +16,7 @@ export default [
|
|||||||
path: "/redirect",
|
path: "/redirect",
|
||||||
component: Layout,
|
component: Layout,
|
||||||
meta: {
|
meta: {
|
||||||
icon: HomeFilled,
|
icon: "homeFilled",
|
||||||
title: $t("menus.hshome"),
|
title: $t("menus.hshome"),
|
||||||
showLink: false,
|
showLink: false,
|
||||||
rank: 102
|
rank: 102
|
||||||
|
|||||||
@@ -1,12 +1,11 @@
|
|||||||
import { $t } from "@/plugins/i18n";
|
import { $t } from "@/plugins/i18n";
|
||||||
import { result } from "@/router/enums";
|
import { result } from "@/router/enums";
|
||||||
import CheckboxCircleLine from "@iconify-icons/ri/checkbox-circle-line";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
path: "/result",
|
path: "/result",
|
||||||
redirect: "/result/success",
|
redirect: "/result/success",
|
||||||
meta: {
|
meta: {
|
||||||
icon: CheckboxCircleLine,
|
icon: "checkboxCircleLine",
|
||||||
title: $t("menus.hsResult"),
|
title: $t("menus.hsResult"),
|
||||||
rank: result
|
rank: result
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -198,7 +198,7 @@ function initRouter() {
|
|||||||
} else {
|
} else {
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
getAsyncRoutes().then(({ data }) => {
|
getAsyncRoutes().then(({ data }) => {
|
||||||
handleAsyncRoutes(data);
|
handleAsyncRoutes(cloneDeep(data));
|
||||||
storageSession.setItem(key, data);
|
storageSession.setItem(key, data);
|
||||||
resolve(router);
|
resolve(router);
|
||||||
});
|
});
|
||||||
@@ -207,7 +207,7 @@ function initRouter() {
|
|||||||
} else {
|
} else {
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
getAsyncRoutes().then(({ data }) => {
|
getAsyncRoutes().then(({ data }) => {
|
||||||
handleAsyncRoutes(data);
|
handleAsyncRoutes(cloneDeep(data));
|
||||||
resolve(router);
|
resolve(router);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import Page from "./page/index.vue";
|
||||||
import RowDrag from "./drag/row/index.vue";
|
import RowDrag from "./drag/row/index.vue";
|
||||||
import ColumnDrag from "./drag/column/index.vue";
|
import ColumnDrag from "./drag/column/index.vue";
|
||||||
import Contextmenu from "./contextmenu/index.vue";
|
import Contextmenu from "./contextmenu/index.vue";
|
||||||
@@ -11,6 +12,12 @@ const rendContent = (val: string) =>
|
|||||||
`代码位置:src/views/pure-table/high/${val}/index.vue`;
|
`代码位置:src/views/pure-table/high/${val}/index.vue`;
|
||||||
|
|
||||||
export const list = [
|
export const list = [
|
||||||
|
{
|
||||||
|
key: "page",
|
||||||
|
content: rendContent("page"),
|
||||||
|
title: "分页、加载动画",
|
||||||
|
component: Page
|
||||||
|
},
|
||||||
{
|
{
|
||||||
key: "rowDrag",
|
key: "rowDrag",
|
||||||
content: rendContent("drag/row"),
|
content: rendContent("drag/row"),
|
||||||
|
|||||||
91
src/views/pure-table/high/page/columns.tsx
Normal file
91
src/views/pure-table/high/page/columns.tsx
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
import { tableData } from "../data";
|
||||||
|
import { clone, delay } from "@pureadmin/utils";
|
||||||
|
import { ref, onMounted, reactive, watchEffect } from "vue";
|
||||||
|
import type { PaginationProps, LoadingConfig, Align } from "@pureadmin/table";
|
||||||
|
|
||||||
|
export function useColumns() {
|
||||||
|
const dataList = ref([]);
|
||||||
|
const loading = ref(true);
|
||||||
|
const paginationAlign = ref("right");
|
||||||
|
const columns: TableColumnList = [
|
||||||
|
{
|
||||||
|
label: "日期",
|
||||||
|
prop: "date"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "姓名",
|
||||||
|
prop: "name"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "地址",
|
||||||
|
prop: "address"
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
/** 分页配置 */
|
||||||
|
const pagination = reactive<PaginationProps>({
|
||||||
|
pageSize: 10,
|
||||||
|
currentPage: 1,
|
||||||
|
pageSizes: [10, 15, 20],
|
||||||
|
total: 0,
|
||||||
|
align: "right",
|
||||||
|
background: true
|
||||||
|
});
|
||||||
|
|
||||||
|
/** 加载动画配置 */
|
||||||
|
const loadingConfig = reactive<LoadingConfig>({
|
||||||
|
text: "正在加载第一页...",
|
||||||
|
viewBox: "-10, -10, 50, 50",
|
||||||
|
spinner: `
|
||||||
|
<path class="path" d="
|
||||||
|
M 30 15
|
||||||
|
L 28 17
|
||||||
|
M 25.61 25.61
|
||||||
|
A 15 15, 0, 0, 1, 15 30
|
||||||
|
A 15 15, 0, 1, 1, 27.99 7.5
|
||||||
|
L 15 15
|
||||||
|
" style="stroke-width: 4px; fill: rgba(0, 0, 0, 0)"/>
|
||||||
|
`
|
||||||
|
// svg: "",
|
||||||
|
// background: rgba()
|
||||||
|
});
|
||||||
|
|
||||||
|
function onSizeChange(val) {
|
||||||
|
console.log("onSizeChange", val);
|
||||||
|
}
|
||||||
|
|
||||||
|
function onCurrentChange(val) {
|
||||||
|
loadingConfig.text = `正在加载第${val}页...`;
|
||||||
|
loading.value = true;
|
||||||
|
delay(600).then(() => {
|
||||||
|
loading.value = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
watchEffect(() => {
|
||||||
|
pagination.align = paginationAlign.value as Align;
|
||||||
|
});
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
delay(600).then(() => {
|
||||||
|
const newList = [];
|
||||||
|
Array.from({ length: 6 }).forEach(() => {
|
||||||
|
newList.push(clone(tableData, true));
|
||||||
|
});
|
||||||
|
dataList.value = newList.flat(Infinity);
|
||||||
|
pagination.total = dataList.value.length;
|
||||||
|
loading.value = false;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
return {
|
||||||
|
loading,
|
||||||
|
columns,
|
||||||
|
dataList,
|
||||||
|
pagination,
|
||||||
|
loadingConfig,
|
||||||
|
paginationAlign,
|
||||||
|
onSizeChange,
|
||||||
|
onCurrentChange
|
||||||
|
};
|
||||||
|
}
|
||||||
46
src/views/pure-table/high/page/index.vue
Normal file
46
src/views/pure-table/high/page/index.vue
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { useColumns } from "./columns";
|
||||||
|
|
||||||
|
const {
|
||||||
|
loading,
|
||||||
|
columns,
|
||||||
|
dataList,
|
||||||
|
pagination,
|
||||||
|
loadingConfig,
|
||||||
|
paginationAlign,
|
||||||
|
onSizeChange,
|
||||||
|
onCurrentChange
|
||||||
|
} = useColumns();
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<el-space class="float-right mb-2">
|
||||||
|
<p>分页的对齐方式:</p>
|
||||||
|
<el-radio-group v-model="paginationAlign">
|
||||||
|
<el-radio-button label="right">right</el-radio-button>
|
||||||
|
<el-radio-button label="center">center</el-radio-button>
|
||||||
|
<el-radio-button label="left">left</el-radio-button>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-space>
|
||||||
|
<pure-table
|
||||||
|
border
|
||||||
|
row-key="id"
|
||||||
|
alignWhole="center"
|
||||||
|
showOverflowTooltip
|
||||||
|
:loading="loading"
|
||||||
|
:loading-config="loadingConfig"
|
||||||
|
:height="440"
|
||||||
|
:data="
|
||||||
|
dataList.slice(
|
||||||
|
(pagination.currentPage - 1) * pagination.pageSize,
|
||||||
|
pagination.currentPage * pagination.pageSize
|
||||||
|
)
|
||||||
|
"
|
||||||
|
:columns="columns"
|
||||||
|
:pagination="pagination"
|
||||||
|
@size-change="onSizeChange"
|
||||||
|
@current-change="onCurrentChange"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
Reference in New Issue
Block a user