From 44c541126af79002465f1d8c4e98298b9cb2eabc Mon Sep 17 00:00:00 2001 From: xiaoxian521 <1923740402@qq.com> Date: Thu, 11 Jan 2024 22:42:19 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E4=BC=98=E5=8C=96=E6=BC=94=E7=A4=BA?= =?UTF-8?q?=E7=A4=BA=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- locales/en.yaml | 18 +- locales/zh-CN.yaml | 18 +- mock/asyncRoutes.ts | 147 +++++---- src/components/ReIcon/src/offlineIcon.ts | 4 + src/router/enums.ts | 46 ++- src/router/modules/able.ts | 12 +- src/router/modules/components.ts | 6 +- src/router/modules/puredoc.ts | 24 -- src/router/modules/pureutils.ts | 24 -- src/router/modules/table.ts | 3 +- src/views/able/cascader.vue | 2 +- src/views/able/debounce.vue | 4 +- src/views/able/infinite-scroll.vue | 37 +-- src/views/able/line-tree.vue | 8 +- src/views/able/sensitive.vue | 2 +- src/views/able/swiper.vue | 20 +- src/views/able/virtual-list/horizontal.vue | 2 + src/views/able/virtual-list/index.vue | 2 +- src/views/able/virtual-list/vertical.vue | 1 + src/views/able/watermark.vue | 301 ++++++++++-------- src/views/components/contextmenu/basic.vue | 2 +- .../components/contextmenu/menuDynamic.vue | 2 +- .../components/contextmenu/menuGroup.vue | 2 +- .../components/seamless-scroll/index.vue | 2 +- src/views/components/selector/index.vue | 12 +- src/views/permission/button/index.vue | 103 +++--- src/views/permission/page/index.vue | 8 +- src/views/pure-table/high.vue | 2 +- src/views/pure-table/index.vue | 15 +- src/views/tabs/index.vue | 2 +- 30 files changed, 409 insertions(+), 422 deletions(-) delete mode 100644 src/router/modules/puredoc.ts delete mode 100644 src/router/modules/pureutils.ts diff --git a/locales/en.yaml b/locales/en.yaml index f4c8abcd1..bc1bbe45c 100644 --- a/locales/en.yaml +++ b/locales/en.yaml @@ -76,14 +76,16 @@ menus: hsPrint: Print hsDownload: Download hsExternalPage: External Page - hsPureDocument: Pure Doc(Embedded) - externalLink: Pure Doc(External) - hsEpDocument: Element Plus Doc(Embedded) - hsVueDocument: Vue3 Doc(Embedded) - hsViteDocument: Vite Doc(Embedded) - hsPiniaDocument: Pinia Doc(Embedded) - hsRouterDocument: Vue Router Doc(Embedded) - hsTailwindcssDocument: Tailwindcss Doc(Embedded) + hsExternalDoc: Docs External + hsEmbeddedDoc: Docs Embedded + externalLink: Vue-Pure-Admin + pureutilsLink: Pure-Admin-Utils + hsEpDocument: Element-Plus + hsTailwindcssDocument: Tailwindcss + hsVueDocument: Vue3 + hsViteDocument: Vite + hsPiniaDocument: Pinia + hsRouterDocument: Vue-Router hsAbout: About hsResult: Result Page hsSuccess: Success Page diff --git a/locales/zh-CN.yaml b/locales/zh-CN.yaml index 27f836063..21364443e 100644 --- a/locales/zh-CN.yaml +++ b/locales/zh-CN.yaml @@ -76,14 +76,16 @@ menus: hsPrint: 打印 hsDownload: 下载 hsExternalPage: 外部页面 - hsPureDocument: 平台文档(内嵌) - externalLink: 平台文档(外链) - hsEpDocument: Element Plus 文档(内嵌) - hsVueDocument: Vue3 文档(内嵌) - hsViteDocument: Vite 文档(内嵌) - hsPiniaDocument: Pinia 文档(内嵌) - hsRouterDocument: Vue Router 文档(内嵌) - hsTailwindcssDocument: Tailwindcss 文档(内嵌) + hsExternalDoc: 文档外链 + hsEmbeddedDoc: 文档内嵌 + externalLink: vue-pure-admin + pureutilsLink: pure-admin-utils + hsEpDocument: element-plus + hsTailwindcssDocument: tailwindcss + hsVueDocument: vue3 + hsViteDocument: vite + hsPiniaDocument: pinia + hsRouterDocument: vue-router hsAbout: 关于 hsResult: 结果页面 hsSuccess: 成功页面 diff --git a/mock/asyncRoutes.ts b/mock/asyncRoutes.ts index f4edccfc6..f78376664 100644 --- a/mock/asyncRoutes.ts +++ b/mock/asyncRoutes.ts @@ -83,75 +83,90 @@ const frameRouter = { }, children: [ { - path: "/iframe/pure", - name: "FramePure", + path: "/iframe/external", meta: { - title: "menus.hsPureDocument", - frameSrc: "https://yiming_chang.gitee.io/pure-admin-doc", - roles: ["admin", "common"] - } + title: "menus.hsExternalDoc" + }, + children: [ + { + path: "/external", + name: "https://yiming_chang.gitee.io/pure-admin-doc", + meta: { + title: "menus.externalLink", + roles: ["admin", "common"] + } + }, + { + path: "/pureutilsLink", + name: "https://pure-admin-utils.netlify.app/", + meta: { + title: "menus.pureutilsLink", + roles: ["admin", "common"] + } + } + ] }, { - path: "/external", - name: "https://yiming_chang.gitee.io/pure-admin-doc", + path: "/iframe/embedded", meta: { - title: "menus.externalLink", - roles: ["admin", "common"] - } - }, - { - path: "/iframe/ep", - name: "FrameEp", - meta: { - title: "menus.hsEpDocument", - frameSrc: "https://element-plus.org/zh-CN/", - roles: ["admin", "common"] - } - }, - { - path: "/iframe/vue3", - name: "FrameVue", - meta: { - title: "menus.hsVueDocument", - frameSrc: "https://cn.vuejs.org/", - roles: ["admin", "common"] - } - }, - { - path: "/iframe/vite", - name: "FrameVite", - meta: { - title: "menus.hsViteDocument", - frameSrc: "https://cn.vitejs.dev/", - roles: ["admin", "common"] - } - }, - { - path: "/iframe/pinia", - name: "FramePinia", - meta: { - title: "menus.hsPiniaDocument", - frameSrc: "https://pinia.vuejs.org/zh/index.html", - roles: ["admin", "common"] - } - }, - { - path: "/iframe/vue-router", - name: "FrameRouter", - meta: { - title: "menus.hsRouterDocument", - frameSrc: "https://router.vuejs.org/zh/", - roles: ["admin", "common"] - } - }, - { - path: "/iframe/tailwindcss", - name: "FrameTailwindcss", - meta: { - title: "menus.hsTailwindcssDocument", - frameSrc: "https://tailwindcss.com/docs/installation", - roles: ["admin", "common"] - } + title: "menus.hsEmbeddedDoc" + }, + children: [ + { + path: "/iframe/ep", + name: "FrameEp", + meta: { + title: "menus.hsEpDocument", + frameSrc: "https://element-plus.org/zh-CN/", + roles: ["admin", "common"] + } + }, + { + path: "/iframe/tailwindcss", + name: "FrameTailwindcss", + meta: { + title: "menus.hsTailwindcssDocument", + frameSrc: "https://tailwindcss.com/docs/installation", + roles: ["admin", "common"] + } + }, + { + path: "/iframe/vue3", + name: "FrameVue", + meta: { + title: "menus.hsVueDocument", + frameSrc: "https://cn.vuejs.org/", + roles: ["admin", "common"] + } + }, + { + path: "/iframe/vite", + name: "FrameVite", + meta: { + title: "menus.hsViteDocument", + frameSrc: "https://cn.vitejs.dev/", + roles: ["admin", "common"] + } + }, + { + path: "/iframe/pinia", + name: "FramePinia", + meta: { + title: "menus.hsPiniaDocument", + frameSrc: "https://pinia.vuejs.org/zh/index.html", + roles: ["admin", "common"] + } + }, + { + path: "/iframe/vue-router", + name: "FrameRouter", + meta: { + title: "menus.hsRouterDocument", + frameSrc: "https://router.vuejs.org/zh/", + roles: ["admin", "common"] + } + } + ] } ] }; @@ -159,7 +174,7 @@ const frameRouter = { const tabsRouter = { path: "/tabs", meta: { - icon: "IF-pure-iconfont-tabs", + icon: "tag", title: "menus.hstabs", rank: tabs }, diff --git a/src/components/ReIcon/src/offlineIcon.ts b/src/components/ReIcon/src/offlineIcon.ts index c74220df5..be3b5c571 100644 --- a/src/components/ReIcon/src/offlineIcon.ts +++ b/src/components/ReIcon/src/offlineIcon.ts @@ -25,6 +25,8 @@ import Dept from "@iconify-icons/ri/git-branch-line"; import Search from "@iconify-icons/ri/search-line"; import Lollipop from "@iconify-icons/ep/lollipop"; import Monitor from "@iconify-icons/ep/monitor"; +import Tag from "@iconify-icons/ri/bookmark-2-line"; +import Table from "@iconify-icons/ri/table-line"; addIcon("ubuntuFill", UbuntuFill); addIcon("menu", Menu); addIcon("edit", Edit); @@ -45,3 +47,5 @@ addIcon("dept", Dept); addIcon("search", Search); addIcon("lollipop", Lollipop); addIcon("monitor", Monitor); +addIcon("tag", Tag); +addIcon("table", Table); diff --git a/src/router/enums.ts b/src/router/enums.ts index 1598773c4..25b32bfb3 100644 --- a/src/router/enums.ts +++ b/src/router/enums.ts @@ -1,34 +1,30 @@ // 完整版菜单比较多,将 rank 抽离出来,在此方便维护 const home = 0, // 平台规定只有 home 路由的 rank 才能为 0 ,所以后端在返回 rank 的时候需要从 1 开始哦 - doc = 1, - utils = 2, + able = 1, + components = 2, table = 3, - components = 4, - able = 5, - frame = 6, - nested = 7, - result = 8, - error = 9, - list = 10, - permission = 11, - system = 12, - tabs = 13, - formdesign = 14, - flowchart = 15, - ppt = 16, - editor = 17, - guide = 18, - menuoverflow = 19, - about = 20; + frame = 4, + nested = 5, + result = 6, + error = 7, + list = 8, + permission = 9, + system = 10, + tabs = 11, + formdesign = 12, + flowchart = 13, + ppt = 14, + editor = 15, + guide = 16, + about = 17, + menuoverflow = 18; export { home, - doc, - utils, - table, - components, able, + components, + table, frame, nested, result, @@ -42,6 +38,6 @@ export { ppt, editor, guide, - menuoverflow, - about + about, + menuoverflow }; diff --git a/src/router/modules/able.ts b/src/router/modules/able.ts index dc6f36786..5d8ff4052 100644 --- a/src/router/modules/able.ts +++ b/src/router/modules/able.ts @@ -15,8 +15,7 @@ export default { name: "VideoFrame", component: () => import("@/views/able/video-frame/index.vue"), meta: { - title: $t("menus.hsVideoFrame"), - extraIcon: "IF-pure-iconfont-new svg" + title: $t("menus.hsVideoFrame") } }, { @@ -24,8 +23,7 @@ export default { name: "Wavesurfer", component: () => import("@/views/able/wavesurfer/index.vue"), meta: { - title: $t("menus.hsWavesurfer"), - extraIcon: "IF-pure-iconfont-new svg" + title: $t("menus.hsWavesurfer") } }, { @@ -169,8 +167,7 @@ export default { name: "Sensitive", component: () => import("@/views/able/sensitive.vue"), meta: { - title: $t("menus.hsSensitive"), - extraIcon: "IF-pure-iconfont-new svg" + title: $t("menus.hsSensitive") } }, { @@ -178,8 +175,7 @@ export default { name: "Pinyin", component: () => import("@/views/able/pinyin.vue"), meta: { - title: $t("menus.hsPinyin"), - extraIcon: "IF-pure-iconfont-new svg" + title: $t("menus.hsPinyin") } } ] diff --git a/src/router/modules/components.ts b/src/router/modules/components.ts index ac158cbf5..96e1de5fa 100644 --- a/src/router/modules/components.ts +++ b/src/router/modules/components.ts @@ -45,8 +45,7 @@ export default { name: "Waterfall", component: () => import("@/views/components/waterfall/index.vue"), meta: { - title: $t("menus.hswaterfall"), - extraIcon: "IF-pure-iconfont-new svg" + title: $t("menus.hswaterfall") } }, { @@ -110,8 +109,7 @@ export default { name: "AnimateCss", component: () => import("@/views/components/animatecss/index.vue"), meta: { - title: $t("menus.hsanimatecss"), - extraIcon: "IF-pure-iconfont-new svg" + title: $t("menus.hsanimatecss") } }, { diff --git a/src/router/modules/puredoc.ts b/src/router/modules/puredoc.ts deleted file mode 100644 index aa478e007..000000000 --- a/src/router/modules/puredoc.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { doc } from "@/router/enums"; -import hot from "@/assets/svg/hot.svg?component"; -const IFrame = () => import("@/layout/frameView.vue"); - -export default { - path: "/pure-admin-doc", - redirect: "/pure-admin-doc/index", - meta: { - icon: hot, - title: "pure-admin-doc", - rank: doc - }, - children: [ - { - path: "/pure-admin-doc/index", - name: "FrameDoc", - component: IFrame, - meta: { - title: "pure-admin-doc", - frameSrc: "https://yiming_chang.gitee.io/pure-admin-doc/" - } - } - ] -} satisfies RouteConfigsTable; diff --git a/src/router/modules/pureutils.ts b/src/router/modules/pureutils.ts deleted file mode 100644 index 8d9b7b1a4..000000000 --- a/src/router/modules/pureutils.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { utils } from "@/router/enums"; -import hot from "@/assets/svg/hot.svg?component"; -const IFrame = () => import("@/layout/frameView.vue"); - -export default { - path: "/pure-admin-utils", - redirect: "/pure-admin-utils/index", - meta: { - icon: hot, - title: "pure-admin-utils", - rank: utils - }, - children: [ - { - path: "/pure-admin-utils/index", - name: "FrameUtils", - component: IFrame, - meta: { - title: "pure-admin-utils", - frameSrc: "https://pure-admin-utils.netlify.app/" - } - } - ] -} satisfies RouteConfigsTable; diff --git a/src/router/modules/table.ts b/src/router/modules/table.ts index 8f4f807e3..9ea81a7cd 100644 --- a/src/router/modules/table.ts +++ b/src/router/modules/table.ts @@ -1,12 +1,11 @@ import { $t } from "@/plugins/i18n"; import { table } from "@/router/enums"; -import hot from "@/assets/svg/hot.svg?component"; export default { path: "/pure-table", redirect: "/pure-table/index", meta: { - icon: hot, + icon: "table", title: "pure-admin-table", rank: table }, diff --git a/src/views/able/cascader.vue b/src/views/able/cascader.vue index 4527a2b12..03ace6b95 100644 --- a/src/views/able/cascader.vue +++ b/src/views/able/cascader.vue @@ -25,7 +25,7 @@ const handleChange = value => { -
-

- loaded page(total: {{ total }}): {{ page }}, - disabled: - -

- - - - - - -
+

{{ isBottom ? "已加载全部页" : `加载到第 ${page} 页` }}

+ + + + + + diff --git a/src/views/able/line-tree.vue b/src/views/able/line-tree.vue index aa25f07fb..44569a0d5 100644 --- a/src/views/able/line-tree.vue +++ b/src/views/able/line-tree.vue @@ -35,9 +35,7 @@ const dataProps = {
-
{{ item.label }}
+
{{ item.label }}
Slide{{ i }}
diff --git a/src/views/able/virtual-list/horizontal.vue b/src/views/able/virtual-list/horizontal.vue index 341e58dab..531536fc3 100644 --- a/src/views/able/virtual-list/horizontal.vue +++ b/src/views/able/virtual-list/horizontal.vue @@ -67,11 +67,13 @@ const filteredItems = computed(() => { .dynamic-scroller-demo { display: flex; flex-direction: column; + height: 140px; overflow: hidden; } .scroller { flex: auto 1 1; + border: 1px solid var(--el-border-color); } .notice { diff --git a/src/views/able/virtual-list/index.vue b/src/views/able/virtual-list/index.vue index 30a0956f2..0fe2a4aea 100644 --- a/src/views/able/virtual-list/index.vue +++ b/src/views/able/virtual-list/index.vue @@ -12,7 +12,7 @@ defineOptions({ diff --git a/src/views/components/contextmenu/basic.vue b/src/views/components/contextmenu/basic.vue index faa038768..7c451c51d 100644 --- a/src/views/components/contextmenu/basic.vue +++ b/src/views/components/contextmenu/basic.vue @@ -1,6 +1,6 @@