From d4759feccaaaa4fc423e036b34e0f8ac7659f9cb Mon Sep 17 00:00:00 2001 From: icssoa <615206459@qq.com> Date: Mon, 1 Aug 2022 14:16:37 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3pages=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E4=B8=8D=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/cool/router/index.ts | 37 +++++++++---------- src/modules/base/layout/components/views.vue | 6 +-- .../base/views/components/dept/tree.vue | 4 +- src/modules/base/views/frame.vue | 2 +- src/modules/demo/pages/test.vue | 5 +++ 6 files changed, 30 insertions(+), 26 deletions(-) create mode 100644 src/modules/demo/pages/test.vue diff --git a/package.json b/package.json index 6a2c990..9cb161e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "front-next", - "version": "5.7.6", + "version": "5.7.7", "scripts": { "dev": "vite --host", "build": "vite build", diff --git a/src/cool/router/index.ts b/src/cool/router/index.ts index 42fa82d..9117168 100644 --- a/src/cool/router/index.ts +++ b/src/cool/router/index.ts @@ -55,28 +55,27 @@ router.append = function (data) { d.name = d.path.substring(1); } + if (!d.component) { + const url = d.viewPath; + + if (url) { + if (url.indexOf("http") == 0) { + if (d.meta) { + d.meta.iframeUrl = url; + } + + d.component = () => import(`/$/base/views/frame.vue`); + } else { + d.component = files["/src/" + url.replace("cool/", "")]; + } + } else { + d.redirect = "/404"; + } + } + if (e.isPage) { router.addRoute(d); } else { - if (!d.component) { - const url = d.viewPath; - - if (url) { - if (url.indexOf("http") == 0) { - if (d.meta) { - d.meta.iframeUrl = url; - } - - d.component = () => import(`/$/base/views/frame.vue`); - } else { - d.component = files["/src/" + url.replace("cool/", "")]; - } - } else { - d.redirect = "/404"; - } - } - - // @ts-ignore router.addRoute("index", d); } }); diff --git a/src/modules/base/layout/components/views.vue b/src/modules/base/layout/components/views.vue index f5a5d2f..083b9cf 100644 --- a/src/modules/base/layout/components/views.vue +++ b/src/modules/base/layout/components/views.vue @@ -1,9 +1,9 @@ diff --git a/src/modules/base/views/components/dept/tree.vue b/src/modules/base/views/components/dept/tree.vue index 81dbe98..487b86c 100644 --- a/src/modules/base/views/components/dept/tree.vue +++ b/src/modules/base/views/components/dept/tree.vue @@ -7,7 +7,7 @@
  • - +
  • @@ -77,7 +77,7 @@ import { useCool } from "/@/cool"; import { deepTree, revDeepTree } from "/@/cool/utils"; import { isArray } from "lodash"; import { ContextMenu, useForm } from "@cool-vue/crud"; -import { Refresh, Operation, MoreFilled } from "@element-plus/icons-vue"; +import { Refresh as RefreshIcon, Operation, MoreFilled } from "@element-plus/icons-vue"; import { useBase, checkPerm } from "/$/base"; const props = defineProps({ diff --git a/src/modules/base/views/frame.vue b/src/modules/base/views/frame.vue index ae7fdae..9fabb2a 100644 --- a/src/modules/base/views/frame.vue +++ b/src/modules/base/views/frame.vue @@ -4,7 +4,7 @@ -