diff --git a/magic-boot-ui/.env.demo b/magic-boot-ui/.env.demo deleted file mode 100644 index 46d0046..0000000 --- a/magic-boot-ui/.env.demo +++ /dev/null @@ -1 +0,0 @@ -VITE_APP_BASE_API = 'http://localhost:8081/' diff --git a/magic-boot-ui/.env.development b/magic-boot-ui/.env.development deleted file mode 100644 index 46d0046..0000000 --- a/magic-boot-ui/.env.development +++ /dev/null @@ -1 +0,0 @@ -VITE_APP_BASE_API = 'http://localhost:8081/' diff --git a/magic-boot-ui/.env.production b/magic-boot-ui/.env.production deleted file mode 100644 index 46d0046..0000000 --- a/magic-boot-ui/.env.production +++ /dev/null @@ -1 +0,0 @@ -VITE_APP_BASE_API = 'http://localhost:8081/' diff --git a/magic-boot-ui/README.md b/magic-boot-ui/README.md deleted file mode 100644 index c0793a8..0000000 --- a/magic-boot-ui/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# Vue 3 + Vite - -This template should help get you started developing with Vue 3 in Vite. The template uses Vue 3 ` - - diff --git a/magic-boot-ui/package.json b/magic-boot-ui/package.json deleted file mode 100644 index 0dea371..0000000 --- a/magic-boot-ui/package.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "magic-boot-vite", - "private": true, - "version": "0.0.0", - "scripts": { - "dev": "vite", - "build": "vite build", - "preview": "vite preview", - "demo": "vite build --mode demo" - }, - "dependencies": { - "axios": "^0.24.0", - "element-plus": "^2.2.6", - "js-sha256": "^0.9.0", - "nprogress": "0.2.0", - "path-browserify": "^1.0.1", - "vue": "^3.2.25", - "vue-cropper": "^1.0.2", - "vue-router": "^4.0.0-0", - "vuedraggable": "^4.1.0", - "xlsx": "^0.18.3" - }, - "devDependencies": { - "@vitejs/plugin-vue": "^2.2.0", - "vite-plugin-svg-icons": "^1.1.0", - "sass": "^1.49.7", - "vite": "^2.8.0" - } -} diff --git a/magic-boot-ui/public/favicon.ico b/magic-boot-ui/public/favicon.ico deleted file mode 100644 index 57167be..0000000 Binary files a/magic-boot-ui/public/favicon.ico and /dev/null differ diff --git a/magic-boot-ui/src/App.vue b/magic-boot-ui/src/App.vue deleted file mode 100644 index 87ed26e..0000000 --- a/magic-boot-ui/src/App.vue +++ /dev/null @@ -1,3 +0,0 @@ - \ No newline at end of file diff --git a/magic-boot-ui/src/assets/css/common.css b/magic-boot-ui/src/assets/css/common.css deleted file mode 100644 index f78e207..0000000 --- a/magic-boot-ui/src/assets/css/common.css +++ /dev/null @@ -1,68 +0,0 @@ -@font-face { - font-family: PoetsenOne; - src: url(../fonts/PoetsenOne.woff2) format('woff2'); - font-weight: 100; - font-style: normal; -} -::-webkit-scrollbar { - width: 6px; - height: 6px; - overflow: auto -} - -::-webkit-scrollbar-thumb { - background-color: #e6e6e6; - min-height: 25px; - min-width: 25px; - border: 1px solid #e0e0e0; - border-radius: 99px -} - -::-webkit-scrollbar-track { - background-color: #f7f7f7; - border: 1px solid #efefef -} -body{ - --mb-main-color: #409EFF; - --mb-sidebar-width: 240px; - --mb-main-icon-color: #909399; - --mb-header-height: 60px; - --mb-avatar-text-size: 18px; - /*--mb-menu-item-height: 50px;*/ -} -.el-header{ - --el-header-height: var(--mb-header-height); -} -.el-avatar{ - --el-avatar-text-size: var(--mb-avatar-text-size); - --el-avatar-bg-color: var(--mb-main-color); - border: 1px solid white; -} -.el-dialog__body{ - padding: 5px 20px; -} -/*.el-sub-menu__title, .el-menu-item{*/ -/* height: var(--mb-menu-item-height) !important;*/ -/*}*/ -.app-container hr { - border: none; - height: 1px; - background: #F3F3F3; -} -.toolbar-container{ - margin-bottom: 10px -} -.toolbar-container > div, -.toolbar-container > button{ - margin-left: 12px; -} -.toolbar-container > div:nth-child(1), -.toolbar-container > button:nth-child(1){ - margin-left: 0px; -} -.clear{ - clear: both; -} -a{ - text-decoration: none; -} diff --git a/magic-boot-ui/src/assets/fonts/PoetsenOne.woff2 b/magic-boot-ui/src/assets/fonts/PoetsenOne.woff2 deleted file mode 100644 index 2e857b7..0000000 Binary files a/magic-boot-ui/src/assets/fonts/PoetsenOne.woff2 and /dev/null differ diff --git a/magic-boot-ui/src/assets/images/login-bg.svg b/magic-boot-ui/src/assets/images/login-bg.svg deleted file mode 100644 index f0e76b6..0000000 --- a/magic-boot-ui/src/assets/images/login-bg.svg +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/magic-boot-ui/src/assets/images/login-bg1.svg b/magic-boot-ui/src/assets/images/login-bg1.svg deleted file mode 100644 index 192651a..0000000 --- a/magic-boot-ui/src/assets/images/login-bg1.svg +++ /dev/null @@ -1,138 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/magic-boot-ui/src/assets/images/logo-magic-boot.png b/magic-boot-ui/src/assets/images/logo-magic-boot.png deleted file mode 100644 index 22e8d06..0000000 Binary files a/magic-boot-ui/src/assets/images/logo-magic-boot.png and /dev/null differ diff --git a/magic-boot-ui/src/compiler/sfc-compiler.js b/magic-boot-ui/src/compiler/sfc-compiler.js deleted file mode 100644 index 6896e2b..0000000 --- a/magic-boot-ui/src/compiler/sfc-compiler.js +++ /dev/null @@ -1,206 +0,0 @@ -import * as SFCCompiler from '@vue/compiler-sfc' - -const COMP_IDENTIFIER = `__sfc__` - -export function compileFile(filename, code, compiled) { - if (!code.trim()) { - compiled.errors = [] - return - } - - if (!filename.endsWith('.vue')) { - compiled.js = compiled.ssr = code - compiled.errors = [] - return - } - - const id = hashId(filename) - const { errors, descriptor } = SFCCompiler.parse(code, { - filename, - sourceMap: true - }) - // console.log(descriptor) - if (errors.length) { - compiled.errors = errors - return - } - - if ( - (descriptor.script && descriptor.script.lang) || - (descriptor.scriptSetup && descriptor.scriptSetup.lang) || - descriptor.styles.some((s) => s.lang) || - (descriptor.template && descriptor.template.lang) - ) { - compiled.errors = [ - 'lang="x" pre-processors are not supported in the in-browser playground.' - ] - return - } - - const hasScoped = descriptor.styles.some((s) => s.scoped) - let clientCode = '' - let ssrCode = '' - - const appendSharedCode = (code) => { - clientCode += code - ssrCode += code - } - - const clientScriptResult = doCompileScript(descriptor, id, false) - if (!clientScriptResult) { - return - } - const [clientScript, bindings] = clientScriptResult - clientCode += clientScript - - // script ssr only needs to be performed if using - - -` \ No newline at end of file diff --git a/magic-boot-ui/src/components/index.js b/magic-boot-ui/src/components/index.js deleted file mode 100644 index 7f12fa3..0000000 --- a/magic-boot-ui/src/components/index.js +++ /dev/null @@ -1,9 +0,0 @@ -import { defineAsyncComponent } from 'vue' - -const components = import.meta.glob('./**/*.vue') -export default function install (app) { - for (const [key, value] of Object.entries(components)) { - const name = key.substring(key.lastIndexOf('/') + 1, key.lastIndexOf('.')) - app.component(name, defineAsyncComponent(value)) - } -} diff --git a/magic-boot-ui/src/components/magic/basic/mb-button.vue b/magic-boot-ui/src/components/magic/basic/mb-button.vue deleted file mode 100644 index f9c5a0d..0000000 --- a/magic-boot-ui/src/components/magic/basic/mb-button.vue +++ /dev/null @@ -1,141 +0,0 @@ - - - diff --git a/magic-boot-ui/src/components/magic/basic/mb-editor-table.vue b/magic-boot-ui/src/components/magic/basic/mb-editor-table.vue deleted file mode 100644 index 8332fed..0000000 --- a/magic-boot-ui/src/components/magic/basic/mb-editor-table.vue +++ /dev/null @@ -1,106 +0,0 @@ - - - diff --git a/magic-boot-ui/src/components/magic/basic/mb-icon.vue b/magic-boot-ui/src/components/magic/basic/mb-icon.vue deleted file mode 100644 index 064946e..0000000 --- a/magic-boot-ui/src/components/magic/basic/mb-icon.vue +++ /dev/null @@ -1,26 +0,0 @@ - - - diff --git a/magic-boot-ui/src/components/magic/data/mb-pagination.vue b/magic-boot-ui/src/components/magic/data/mb-pagination.vue deleted file mode 100644 index 61330f7..0000000 --- a/magic-boot-ui/src/components/magic/data/mb-pagination.vue +++ /dev/null @@ -1,97 +0,0 @@ - - - - - diff --git a/magic-boot-ui/src/components/magic/data/mb-search.vue b/magic-boot-ui/src/components/magic/data/mb-search.vue deleted file mode 100644 index 32f68b6..0000000 --- a/magic-boot-ui/src/components/magic/data/mb-search.vue +++ /dev/null @@ -1,101 +0,0 @@ - - - - - diff --git a/magic-boot-ui/src/components/magic/data/mb-table-column.vue b/magic-boot-ui/src/components/magic/data/mb-table-column.vue deleted file mode 100644 index 146bbdc..0000000 --- a/magic-boot-ui/src/components/magic/data/mb-table-column.vue +++ /dev/null @@ -1,63 +0,0 @@ - - - diff --git a/magic-boot-ui/src/components/magic/data/mb-table.vue b/magic-boot-ui/src/components/magic/data/mb-table.vue deleted file mode 100644 index d477a1c..0000000 --- a/magic-boot-ui/src/components/magic/data/mb-table.vue +++ /dev/null @@ -1,300 +0,0 @@ - - - - - - - diff --git a/magic-boot-ui/src/components/magic/data/mb-tree.vue b/magic-boot-ui/src/components/magic/data/mb-tree.vue deleted file mode 100644 index 0badb69..0000000 --- a/magic-boot-ui/src/components/magic/data/mb-tree.vue +++ /dev/null @@ -1,153 +0,0 @@ - - - - diff --git a/magic-boot-ui/src/components/magic/data/mb-treeselect.vue b/magic-boot-ui/src/components/magic/data/mb-treeselect.vue deleted file mode 100644 index 7e73d7b..0000000 --- a/magic-boot-ui/src/components/magic/data/mb-treeselect.vue +++ /dev/null @@ -1,40 +0,0 @@ - - - diff --git a/magic-boot-ui/src/components/magic/feedback/mb-dialog.vue b/magic-boot-ui/src/components/magic/feedback/mb-dialog.vue deleted file mode 100644 index c8613a9..0000000 --- a/magic-boot-ui/src/components/magic/feedback/mb-dialog.vue +++ /dev/null @@ -1,141 +0,0 @@ - - - diff --git a/magic-boot-ui/src/components/magic/form/mb-checkbox-group.vue b/magic-boot-ui/src/components/magic/form/mb-checkbox-group.vue deleted file mode 100644 index a75f3d6..0000000 --- a/magic-boot-ui/src/components/magic/form/mb-checkbox-group.vue +++ /dev/null @@ -1,133 +0,0 @@ - - - diff --git a/magic-boot-ui/src/components/magic/form/mb-date.vue b/magic-boot-ui/src/components/magic/form/mb-date.vue deleted file mode 100644 index cf5672f..0000000 --- a/magic-boot-ui/src/components/magic/form/mb-date.vue +++ /dev/null @@ -1,48 +0,0 @@ - - - diff --git a/magic-boot-ui/src/components/magic/form/mb-input.vue b/magic-boot-ui/src/components/magic/form/mb-input.vue deleted file mode 100644 index 8e8e573..0000000 --- a/magic-boot-ui/src/components/magic/form/mb-input.vue +++ /dev/null @@ -1,23 +0,0 @@ - - - diff --git a/magic-boot-ui/src/components/magic/form/mb-inputrange.vue b/magic-boot-ui/src/components/magic/form/mb-inputrange.vue deleted file mode 100644 index 9264821..0000000 --- a/magic-boot-ui/src/components/magic/form/mb-inputrange.vue +++ /dev/null @@ -1,37 +0,0 @@ - - - - - diff --git a/magic-boot-ui/src/components/magic/form/mb-radio-group.vue b/magic-boot-ui/src/components/magic/form/mb-radio-group.vue deleted file mode 100644 index 77e8679..0000000 --- a/magic-boot-ui/src/components/magic/form/mb-radio-group.vue +++ /dev/null @@ -1,95 +0,0 @@ - - - diff --git a/magic-boot-ui/src/components/magic/form/mb-select.vue b/magic-boot-ui/src/components/magic/form/mb-select.vue deleted file mode 100644 index 93d8d40..0000000 --- a/magic-boot-ui/src/components/magic/form/mb-select.vue +++ /dev/null @@ -1,151 +0,0 @@ - - - diff --git a/magic-boot-ui/src/components/magic/form/mb-switch.vue b/magic-boot-ui/src/components/magic/form/mb-switch.vue deleted file mode 100644 index fec4ab7..0000000 --- a/magic-boot-ui/src/components/magic/form/mb-switch.vue +++ /dev/null @@ -1,69 +0,0 @@ - - - diff --git a/magic-boot-ui/src/components/magic/form/mb-upload-file.vue b/magic-boot-ui/src/components/magic/form/mb-upload-file.vue deleted file mode 100644 index 3d48df6..0000000 --- a/magic-boot-ui/src/components/magic/form/mb-upload-file.vue +++ /dev/null @@ -1,302 +0,0 @@ - - - - - diff --git a/magic-boot-ui/src/components/magic/form/mb-upload-image.vue b/magic-boot-ui/src/components/magic/form/mb-upload-image.vue deleted file mode 100644 index 3c94f16..0000000 --- a/magic-boot-ui/src/components/magic/form/mb-upload-image.vue +++ /dev/null @@ -1,429 +0,0 @@ - - - - - - - diff --git a/magic-boot-ui/src/components/magic/template/mb-form.vue b/magic-boot-ui/src/components/magic/template/mb-form.vue deleted file mode 100644 index f2dc6c1..0000000 --- a/magic-boot-ui/src/components/magic/template/mb-form.vue +++ /dev/null @@ -1,147 +0,0 @@ - - - diff --git a/magic-boot-ui/src/components/magic/template/mb-list.vue b/magic-boot-ui/src/components/magic/template/mb-list.vue deleted file mode 100644 index 30f21e3..0000000 --- a/magic-boot-ui/src/components/magic/template/mb-list.vue +++ /dev/null @@ -1,59 +0,0 @@ - - - diff --git a/magic-boot-ui/src/icons/component.svg b/magic-boot-ui/src/icons/component.svg deleted file mode 100644 index dd829bf..0000000 --- a/magic-boot-ui/src/icons/component.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/magic-boot-ui/src/icons/configure.svg b/magic-boot-ui/src/icons/configure.svg deleted file mode 100644 index b9b66a6..0000000 --- a/magic-boot-ui/src/icons/configure.svg +++ /dev/null @@ -1,2 +0,0 @@ - \ No newline at end of file diff --git a/magic-boot-ui/src/icons/database.svg b/magic-boot-ui/src/icons/database.svg deleted file mode 100644 index a8b8942..0000000 --- a/magic-boot-ui/src/icons/database.svg +++ /dev/null @@ -1,2 +0,0 @@ - \ No newline at end of file diff --git a/magic-boot-ui/src/icons/dict.svg b/magic-boot-ui/src/icons/dict.svg deleted file mode 100644 index a5bd659..0000000 --- a/magic-boot-ui/src/icons/dict.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/magic-boot-ui/src/icons/error.svg b/magic-boot-ui/src/icons/error.svg deleted file mode 100644 index e509005..0000000 --- a/magic-boot-ui/src/icons/error.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/magic-boot-ui/src/icons/examples.svg b/magic-boot-ui/src/icons/examples.svg deleted file mode 100644 index c30cc01..0000000 --- a/magic-boot-ui/src/icons/examples.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/magic-boot-ui/src/icons/eye-open.svg b/magic-boot-ui/src/icons/eye-open.svg deleted file mode 100644 index 88dcc98..0000000 --- a/magic-boot-ui/src/icons/eye-open.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/magic-boot-ui/src/icons/eye.svg b/magic-boot-ui/src/icons/eye.svg deleted file mode 100644 index 16ed2d8..0000000 --- a/magic-boot-ui/src/icons/eye.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/magic-boot-ui/src/icons/fullscreen.svg b/magic-boot-ui/src/icons/fullscreen.svg deleted file mode 100644 index 0e86b6f..0000000 --- a/magic-boot-ui/src/icons/fullscreen.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/magic-boot-ui/src/icons/home.svg b/magic-boot-ui/src/icons/home.svg deleted file mode 100644 index 57cbfc4..0000000 --- a/magic-boot-ui/src/icons/home.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/magic-boot-ui/src/icons/interface.svg b/magic-boot-ui/src/icons/interface.svg deleted file mode 100644 index 39fc373..0000000 --- a/magic-boot-ui/src/icons/interface.svg +++ /dev/null @@ -1,2 +0,0 @@ - \ No newline at end of file diff --git a/magic-boot-ui/src/icons/log.svg b/magic-boot-ui/src/icons/log.svg deleted file mode 100644 index a4bebdf..0000000 --- a/magic-boot-ui/src/icons/log.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/magic-boot-ui/src/icons/login-log.svg b/magic-boot-ui/src/icons/login-log.svg deleted file mode 100644 index ec896a9..0000000 --- a/magic-boot-ui/src/icons/login-log.svg +++ /dev/null @@ -1,2 +0,0 @@ - \ No newline at end of file diff --git a/magic-boot-ui/src/icons/menu.svg b/magic-boot-ui/src/icons/menu.svg deleted file mode 100644 index b687061..0000000 --- a/magic-boot-ui/src/icons/menu.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/magic-boot-ui/src/icons/monitor.svg b/magic-boot-ui/src/icons/monitor.svg deleted file mode 100644 index bea0547..0000000 --- a/magic-boot-ui/src/icons/monitor.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/magic-boot-ui/src/icons/office.svg b/magic-boot-ui/src/icons/office.svg deleted file mode 100644 index 21b749f..0000000 --- a/magic-boot-ui/src/icons/office.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/magic-boot-ui/src/icons/oper-log.svg b/magic-boot-ui/src/icons/oper-log.svg deleted file mode 100644 index 5a2db7c..0000000 --- a/magic-boot-ui/src/icons/oper-log.svg +++ /dev/null @@ -1,2 +0,0 @@ - \ No newline at end of file diff --git a/magic-boot-ui/src/icons/password.svg b/magic-boot-ui/src/icons/password.svg deleted file mode 100644 index e291d85..0000000 --- a/magic-boot-ui/src/icons/password.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/magic-boot-ui/src/icons/role.svg b/magic-boot-ui/src/icons/role.svg deleted file mode 100644 index 34cffeb..0000000 --- a/magic-boot-ui/src/icons/role.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/magic-boot-ui/src/icons/search.svg b/magic-boot-ui/src/icons/search.svg deleted file mode 100644 index 84233dd..0000000 --- a/magic-boot-ui/src/icons/search.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/magic-boot-ui/src/icons/settings.svg b/magic-boot-ui/src/icons/settings.svg deleted file mode 100644 index a8d3657..0000000 --- a/magic-boot-ui/src/icons/settings.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/magic-boot-ui/src/icons/user.svg b/magic-boot-ui/src/icons/user.svg deleted file mode 100644 index 0ba0716..0000000 --- a/magic-boot-ui/src/icons/user.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/magic-boot-ui/src/icons/verification-code.svg b/magic-boot-ui/src/icons/verification-code.svg deleted file mode 100644 index a105f8e..0000000 --- a/magic-boot-ui/src/icons/verification-code.svg +++ /dev/null @@ -1,2 +0,0 @@ - \ No newline at end of file diff --git a/magic-boot-ui/src/layout/empty.vue b/magic-boot-ui/src/layout/empty.vue deleted file mode 100644 index 36da3c3..0000000 --- a/magic-boot-ui/src/layout/empty.vue +++ /dev/null @@ -1,3 +0,0 @@ - diff --git a/magic-boot-ui/src/layout/layout.vue b/magic-boot-ui/src/layout/layout.vue deleted file mode 100644 index 02f3b80..0000000 --- a/magic-boot-ui/src/layout/layout.vue +++ /dev/null @@ -1,123 +0,0 @@ - - - - - diff --git a/magic-boot-ui/src/layout/none.vue b/magic-boot-ui/src/layout/none.vue deleted file mode 100644 index 2a46bd3..0000000 --- a/magic-boot-ui/src/layout/none.vue +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/magic-boot-ui/src/layout/sidebar/item.vue b/magic-boot-ui/src/layout/sidebar/item.vue deleted file mode 100644 index 0b74ddd..0000000 --- a/magic-boot-ui/src/layout/sidebar/item.vue +++ /dev/null @@ -1,17 +0,0 @@ - - - - - \ No newline at end of file diff --git a/magic-boot-ui/src/layout/sidebar/link.vue b/magic-boot-ui/src/layout/sidebar/link.vue deleted file mode 100644 index 2dc59f3..0000000 --- a/magic-boot-ui/src/layout/sidebar/link.vue +++ /dev/null @@ -1,17 +0,0 @@ - - - - diff --git a/magic-boot-ui/src/layout/sidebar/sidebar-item.vue b/magic-boot-ui/src/layout/sidebar/sidebar-item.vue deleted file mode 100644 index 7dcae50..0000000 --- a/magic-boot-ui/src/layout/sidebar/sidebar-item.vue +++ /dev/null @@ -1,93 +0,0 @@ - - - diff --git a/magic-boot-ui/src/layout/sidebar/sidebar.vue b/magic-boot-ui/src/layout/sidebar/sidebar.vue deleted file mode 100644 index 366cf6d..0000000 --- a/magic-boot-ui/src/layout/sidebar/sidebar.vue +++ /dev/null @@ -1,33 +0,0 @@ - - - - - \ No newline at end of file diff --git a/magic-boot-ui/src/layout/tabs.vue b/magic-boot-ui/src/layout/tabs.vue deleted file mode 100644 index 851e013..0000000 --- a/magic-boot-ui/src/layout/tabs.vue +++ /dev/null @@ -1,104 +0,0 @@ - - - diff --git a/magic-boot-ui/src/main.js b/magic-boot-ui/src/main.js deleted file mode 100644 index 078533c..0000000 --- a/magic-boot-ui/src/main.js +++ /dev/null @@ -1,55 +0,0 @@ -import {createApp} from 'vue' -const app = createApp(App) -import ElementPlus from 'element-plus' -import 'element-plus/dist/index.css' -import '@/assets/css/common.css' -import zhCn from 'element-plus/es/locale/lang/zh-cn' -import 'vite-plugin-svg-icons/register' -import App from './App.vue' -import router from './scripts/router' -import components from '@/components/index' -import globalProperties from './scripts/globalProperties' -import hasPermission from './scripts/hasPermission' -import { appComponent } from './scripts/dynamicComponent' -import '@/permission' -import global from '@/scripts/global.js' -import '@/scripts/magic-import' -app.use(globalProperties) - -var loadDynamicComponent = false -import { ElLoading } from 'element-plus' -document.title = global.title -router.beforeEach(async (to, from) => { - global.tabValue.value = to.path - if((to.name && global.visitedViews.length === 0 || global.visitedViews.every(it => it.path !== to.path)) && !to.path.startsWith('/redirect') && !to.path.startsWith('/login')){ - if(!loadDynamicComponent){ - loadDynamicComponent = true - const loading = ElLoading.service({ - lock: true, - background: 'rgba(255, 255, 255, 0)', - }) - await app.config.globalProperties.$post('/system/component/list').then((res) => { - res.data.forEach(it => { - global.dynamicComponentNames.push(it.name) - appComponent(app, it) - }) - loading.close() - }) - } - global.visitedViews.push(to) - } - global.visitedViews.forEach((it, i) => { - if(it.path == to.path){ - global.visitedViews[i] = to - } - }) - return true -}) -app.use(hasPermission) -app.use(components) -app.use(ElementPlus, { - // size: 'small', - locale: zhCn -}) -app.use(router) -app.mount('#app') diff --git a/magic-boot-ui/src/permission.js b/magic-boot-ui/src/permission.js deleted file mode 100644 index f7da8fc..0000000 --- a/magic-boot-ui/src/permission.js +++ /dev/null @@ -1,83 +0,0 @@ -import router from './scripts/router' -import { getUserInfo, removeToken } from './scripts/auth' -import { ElMessage } from 'element-plus' -import NProgress from 'nprogress' // progress bar -import 'nprogress/nprogress.css' // progress bar style -import { getToken } from '@/scripts/auth' // get token from cookie -import global from '@/scripts/global' -import common from '@/scripts/common' -import { generateRoutes, generateHiddenRoutes } from '@/scripts/routerPermission' - -NProgress.configure({ showSpinner: false }) // NProgress Configuration - -const whiteList = ['/login'] // no redirect whitelist -var loadInfo = false -router.beforeEach(async(to, from, next) => { - // start progress bar - NProgress.start() - - // determine whether the user has logged in - const hasToken = getToken() - - if (hasToken) { - if (to.path === '/login') { - // if is logged in, redirect to the home page - next({ path: '/' }) - NProgress.done() - } else { - // determine whether the user has obtained his permission roles through getInfo - if (loadInfo) { - next() - } else { - loadInfo = true - try { - // get user info - // note: roles must be a object array! such as: ['admin'] or ,['developer','editor'] - await getUserInfo() - await common.getDictData() - // await common.loadConfig() - // generate accessible routes map based on roles - await generateRoutes().then(accessRoutes => { - global.user.permissionRoutes.push(...accessRoutes) - accessRoutes.forEach(it => { - router.addRoute(it) - }) - }) - await generateHiddenRoutes().then(accessRoutes => { - accessRoutes.forEach(it => { - router.addRoute(it) - }) - }) - // dynamically add accessible routes - // hack method to ensure that addRoutes is complete - // set the replace: true, so the navigation will not leave a history record - next({ ...to, replace: true }) - } catch (error) { - console.log(error) - // remove token and go to login page to re-login - removeToken() - ElMessage.error(error.data || 'Has Error') - next(`/login`) - NProgress.done() - } - } - } - } else { - /* has no token*/ - - if (whiteList.indexOf(to.path) !== -1) { - // in the free login whitelist, go directly - next() - } else { - // other pages that do not have permission to access are redirected to the login page. - next(`/login`) - NProgress.done() - } - } -}) - -router.afterEach(() => { - // finish progress bar - NProgress.done() -}) - diff --git a/magic-boot-ui/src/scripts/auth.js b/magic-boot-ui/src/scripts/auth.js deleted file mode 100644 index b9f5e13..0000000 --- a/magic-boot-ui/src/scripts/auth.js +++ /dev/null @@ -1,70 +0,0 @@ -import global from './global' -import request from '@/scripts/request' -import { sha256 } from 'js-sha256' - -const TokenKey = 'magic_boot_token' - -export function getToken() { - return localStorage.getItem(TokenKey); -} - -export function setToken(token) { - localStorage.setItem(TokenKey, token); -} - -export function removeToken() { - localStorage.removeItem(TokenKey); - global.user = { - authorities: [], - info: {}, - permissionRoutes: [] - } -} - -export async function getUserInfo() { - await request({ - url: '/system/user/info', - method: 'get' - }).then(response => { - const { data } = response - if(data){ - var authorities_ = [] - for (var i = 0; i < data.authorities.length; i++) { - authorities_.push(data.authorities[i]) - } - global.user.authorities = authorities_ - global.user.info = data - } - }) -} - -export function login(data){ - return new Promise((resolve, reject) => { - request({ - url: '/system/security/login', - method: 'post', - data: { - username: data.username, - password: sha256(data.password), - code: data.code, - uuid: data.uuid - } - }).then(res => { - var token = res.data - setToken(token) - resolve(token) - }).catch((e) => { - reject(e) - }) - }) -} - -export function logout(){ - request({ - url: '/system/security/logout', - method: 'get' - }).then(() => { - removeToken() - location.reload() - }) -} diff --git a/magic-boot-ui/src/scripts/common.js b/magic-boot-ui/src/scripts/common.js deleted file mode 100644 index 4719d06..0000000 --- a/magic-boot-ui/src/scripts/common.js +++ /dev/null @@ -1,237 +0,0 @@ -import request from '@/scripts/request' -import { ElMessageBox, ElNotification } from 'element-plus' -import global from '@/scripts/global' -import { utils, writeFile } from 'xlsx' -import { getToken } from '@/scripts/auth' - -const common = {} - -let dictData = [] -common.getDictData = async function() { - await request({ - url: '/system/dict/items/all', - method: 'get' - }).then((response) => { - const { data } = response - dictData = data - }) -} - -common.getDictType = (type) => { - return dictData.filter(it => it.type === type) -} - -common.getDictLabel = (type, value) => { - value = (value || '') + '' - var values = [] - value.split(',').forEach(v => { - const list = dictData.filter(it => it.type === type && it.value === v + '') - values.push(list && list[0] && list[0].label || '') - }) - return values.join(',') -} - -common.handleDelete = (options) => { - const url = options.url - const id = options.id - ElMessageBox.confirm('此操作将永久删除该数据, 是否继续?', '提示', { - confirmButtonText: '确定', - cancelButtonText: '取消', - type: 'warning' - }).then(() => { - request({ - url: url, - method: 'delete', - params: { - id: id - } - }).then(() => { - ElNotification({ - title: '成功', - message: '删除成功', - type: 'success', - duration: 2000 - }) - options && options.done() - }) - }) -} - -const formatJson = (list, filterVal) => { - return list.map(v => filterVal.map(j => { - return v[j] - })) -} - -common.$get = (url, data) => request({ url, params: data }) -common.$delete = (url, data) => request({ url, method: 'delete', params: data }) -common.$post = (url, data) => request.post(url, data, { - headers: { - 'Content-Type': 'application/x-www-form-urlencoded' - }, - transformRequest: [data => data && Object.keys(data).map(it => encodeURIComponent(it) + '=' + encodeURIComponent(data[it] === null || data[it] === undefined ? '' : data[it])).join('&')] -}) -common.$postJson = (url, data) => request.post(url, JSON.stringify(data), { - headers: { - 'Content-Type': 'application/json' - } -}) - -common.renderWhere = (where) => { - var newWhere = {} - for(var key in where) { - if(where[key] instanceof Object){ - newWhere[key] = where[key].value - }else{ - newWhere[key] = where[key] - } - } - return newWhere -} - -// common.exportExcel = (options) => { -// var where = options.where || {} -// where = common.renderWhere(where) -// where.current = 1 -// where.size = 99999999 -// const url = options.url -// const headers = options.headers -// const columns = options.columns -// request({ -// url: url, -// method: 'post', -// params: where -// }).then(res => { -// import('@/vendor/Export2Excel').then(excel => { -// const data = formatJson(res.data, columns) -// excel.export_json_to_excel({ -// header: headers, -// data, -// filename: 'table-list' -// }) -// }) -// }) -// } - -common.handlerTreeData = (data, id, pid, sort, pidVal) => { - var treeData = [] - var addChildren = (it) => { - var children = data.filter(d => d[pid] === it[id]) - if (children && children.length > 0) { - children.sort((a, b) => { - return a[sort] - b[sort] - }) - it.children = children - children.forEach(chi => { - addChildren(chi) - }) - } - } - data.sort((a, b) => { - return a[sort] - b[sort] - }) - data.filter(it => it[pid] === pidVal).forEach(it => { - addChildren(it) - treeData.push(it) - }) - return treeData -} - -common.uuid = () => { - function S4() { - return (((1+Math.random())*0x10000)|0).toString(16).substring(1); - } - return (S4()+S4()+S4()+S4()+S4()+S4()+S4()+S4()); -} - -common.objAssign = (obj1, obj2, exclude) => { - exclude = exclude || '' - for (var o1 in obj1) { - for (var o2 in obj2) { - if (o1 === o2) { - if(exclude.indexOf(o1) == -1){ - obj1[o1] = obj2[o2] - } - } - } - } -} - -common.copyNew = (obj) => { - return JSON.parse(JSON.stringify(obj)) -} - -common.getParam = (data) => { - let url = '' - for (var k in data) { - const value = data[k] !== undefined ? data[k] : '' - url += `&${k}=${encodeURIComponent(value)}` - } - return url ? url.substring(1) : '' -} - -common.getUrl = (url, data) => { - url += (url.indexOf('?') < 0 ? '?' : '') + common.getParam(data) - return url -} - -common.downloadMore = (urls, filename) => { - var params = { - urls: encodeURI(urls), - filename: filename || '', - token: getToken() - } - var form = document.createElement("form"); - form.style.display = 'none'; - form.action = global.baseApi + '/system/file/download'; - form.method = 'post'; - document.body.appendChild(form); - for(var key in params){ - var input = document.createElement("input"); - input.type = 'hidden'; - input.name = key; - input.value = params[key]; - form.appendChild(input); - } - form.submit(); - form.remove(); -} - -common.download = (urls, filename) => { - location.href = common.downloadHref(urls, filename) -} - -common.downloadHref = (urls, filename) => { - return global.baseApi + `/system/file/download?urls=${encodeURI(urls)}&filename=${filename || ''}&token=${getToken()}` -} - -// common.loadConfig = async() => { -// await request({ -// url: '/system/config/list' -// }).then(res => { -// const { data } = res -// global.filePrefix = data.filePrefix -// }) -// } - -common.setDefaultValue = (obj, attr, value) => { - obj[attr] = obj[attr] === undefined ? value : obj[attr] -} - -common.isComma = (value) => { - return value.toString().indexOf(',') !== -1 -} - -common.exportExcel = (options) => { - options.suffix = options.suffix || 'xlsx' - const workBook = utils.json_to_sheet(options.data); - const wb = utils.book_new() - utils.book_append_sheet(wb, workBook, 'sheet1'); - writeFile(wb, `${options.fileName}.${options.suffix || 'xlsx'}`); -} - -common.objectAssign = (target, source) => { - return Object.assign({}, JSON.parse(JSON.stringify(target)), JSON.parse(JSON.stringify(source))) -} - -export default common diff --git a/magic-boot-ui/src/scripts/dynamicComponent.js b/magic-boot-ui/src/scripts/dynamicComponent.js deleted file mode 100644 index efff712..0000000 --- a/magic-boot-ui/src/scripts/dynamicComponent.js +++ /dev/null @@ -1,55 +0,0 @@ -import { babelParse } from '@vue/compiler-sfc' -import { compileFile } from '@/compiler/sfc-compiler.js' -import { ElLoading, ElMessage } from 'element-plus' - -export function appComponent(app, item){ - var compiled = {} - compileFile('TestCode.vue', item.code, compiled) - if(compiled.errors.length > 0){ - ElMessage({ - type: 'error', - duration: 0, - showClose: true, - message: ` - 组件“${item.name}”发生错误: - ${compiled.errors[0]} - ` - }) - throw compiled.errors[0] - }else{ - var code = compiled.js - var ast = babelParse(code, { - sourceType: 'module' - }) - var replaceCode = (node, subCode) => code.substring(0, node.start) + subCode + code.substring(node.end); - for(var i = ast.program.body.length - 1; i>=0; i--){ - var node = ast.program.body[i] - if(node.type === 'ImportDeclaration'){ - code = replaceCode(node, node.specifiers.map(it => `const ${it.local?.name || it.imported?.name || '*'} = ___magic__import__('${node.source.value}', '${it.imported?.name || '*'}');`).join('\r\n')); - } else if (node.type === 'ExportDefaultDeclaration'){ - code = replaceCode(node, `return ${node.declaration.name}`) - } - } - code = `(function(){ - ${code} - })()` - var componentStyle = document.createElement("style"); - componentStyle.innerHTML = compiled.css - document.head.appendChild(componentStyle); - app.component(item.name, eval(code)) - } -} -// -// const install = (app) => { -// const loading = ElLoading.service({ -// lock: true, -// background: 'rgba(255, 255, 255, 0)', -// }) -// app.config.globalProperties.$post('/system/component/list').then((res) => { -// res.data.forEach(it => { -// appComponent(app, it) -// }) -// loading.close() -// }) -// } -// export default install diff --git a/magic-boot-ui/src/scripts/gen/gen-mb-list.js b/magic-boot-ui/src/scripts/gen/gen-mb-list.js deleted file mode 100644 index 9284696..0000000 --- a/magic-boot-ui/src/scripts/gen/gen-mb-list.js +++ /dev/null @@ -1,158 +0,0 @@ -function gen(groupPath, data){ - var permissionPrefix = groupPath.replace(/^\//,'').replace(/\/\//, '/').replace(/\//g, ':') - var html = ` -` - return html -} -export default gen diff --git a/magic-boot-ui/src/scripts/global.js b/magic-boot-ui/src/scripts/global.js deleted file mode 100644 index 323e577..0000000 --- a/magic-boot-ui/src/scripts/global.js +++ /dev/null @@ -1,14 +0,0 @@ -import { reactive, ref } from 'vue' - -export default { - title: 'Magic Boot', - user: { - authorities: [], - info: {}, - permissionRoutes: [] - }, - baseApi: import.meta.env.VITE_APP_BASE_API, - visitedViews: reactive([]), - tabValue: ref(''), - dynamicComponentNames: [] -} diff --git a/magic-boot-ui/src/scripts/globalProperties.js b/magic-boot-ui/src/scripts/globalProperties.js deleted file mode 100644 index 6d3bcec..0000000 --- a/magic-boot-ui/src/scripts/globalProperties.js +++ /dev/null @@ -1,20 +0,0 @@ -import * as PlusIcons from '@element-plus/icons-vue' -import request from './request' -import global from './global' -import common from './common' -import treeTable from './treeTable' - -const install = (app) => { - app.config.globalProperties.$request = request - app.config.globalProperties.$post = common.$post - app.config.globalProperties.$postJson = common.$postJson - app.config.globalProperties.$get = common.$get - app.config.globalProperties.$delete = common.$delete - app.config.globalProperties.$global = global - app.config.globalProperties.$common = common - app.config.globalProperties.$treeTable = treeTable - for(var key in PlusIcons) { - app.component(`ElIcon${key}`, PlusIcons[key]) - } -} -export default install diff --git a/magic-boot-ui/src/scripts/hasPermission.js b/magic-boot-ui/src/scripts/hasPermission.js deleted file mode 100644 index 1741a50..0000000 --- a/magic-boot-ui/src/scripts/hasPermission.js +++ /dev/null @@ -1,17 +0,0 @@ - -const hasPermission = { - install(app) { - app.directive('permission', { - mounted(el, binding) { - if (binding.value) { - const permissionList = app.config.globalProperties.$global.user.authorities - if (permissionList && permissionList.length && !permissionList.includes(binding.value) && import.meta.env.MODE != 'demo') { - el.remove() - } - } - } - }) - } -} - -export default hasPermission diff --git a/magic-boot-ui/src/scripts/magic-import.js b/magic-boot-ui/src/scripts/magic-import.js deleted file mode 100644 index bdcf166..0000000 --- a/magic-boot-ui/src/scripts/magic-import.js +++ /dev/null @@ -1,14 +0,0 @@ -import * as vue from "vue"; -import ElementPlus from "element-plus"; - -const libs = { - vue, - 'element-plus': ElementPlus -} - -window.___magic__import__ = function(lib, name){ - if(Object.prototype.toString.call(libs[lib]) != '[object Module]' && name == '*'){ - return libs[lib] - } - return (libs[lib] || {})[name] -} diff --git a/magic-boot-ui/src/scripts/request.js b/magic-boot-ui/src/scripts/request.js deleted file mode 100644 index 1eb181e..0000000 --- a/magic-boot-ui/src/scripts/request.js +++ /dev/null @@ -1,117 +0,0 @@ -import axios from 'axios' -import { ElMessage, ElMessageBox } from 'element-plus' -import { logout, login } from '@/scripts/auth' -import { getToken } from '@/scripts/auth' -import global from '@/scripts/global' - -// create an axios instance -const service = axios.create({ - baseURL: import.meta.env.VITE_APP_BASE_API, // url = base url + request url - // withCredentials: true, // send cookies when cross-domain requests - timeout: 1000 * 60 // request timeout -}) - -// request interceptor -service.interceptors.request.use( - config => { - // do something before request is sent - - if (getToken()) { - // let each request carry token - // ['X-Token'] is a custom headers key - // please modify it according to the actual situation - config.headers['token'] = getToken() - } - return config - }, - error => { - // do something with request error - console.log(error) // for debug - return Promise.reject(error) - } -) - -var currentMessage -// response interceptor -service.interceptors.response.use( - /** - * If you want to get http information such as headers or status - * Please return response => response - */ - - /** - * Determine the request status by custom code - * Here is just an example - * You can also judge the status by HTTP Status Code - */ - response => { - if (response.config.url.indexOf('user/info') !== -1 && response.data.code === 402) { - logout() - } - return new Promise((reslove, reject) => { - const res = response.data - if (res.code !== 200) { - var duration = 5 - if (res.code === 402) { - duration = 1 - if(global.user.info.username){ - ElMessageBox.prompt(`当前账号:${global.user.info.username}凭证已过期,请输入密码重新登录`, '提示', { - confirmButtonText: '确定', - cancelButtonText: '退出', - inputType: 'password', - closeOnClickModal: false, - beforeClose: (action, instance, done) => { - if (action === 'confirm') { - login({ - username: global.user.info.username, - password: instance.inputValue - }).then((res) => { - if (res) { - done() - service(response.config).then(ret => reslove(ret)) - } - }) - } else if (action === 'cancel') { - logout() - } else { - done() - } - } - }) - } - } - if (res.code !== 402) { - if(currentMessage){ - currentMessage.close() - } - if(res.code == 403 && import.meta.env.MODE == 'demo'){ - res.message = '演示模式,不允许操作!' - } - currentMessage = ElMessage({ - message: res.message || 'Error', - type: 'error', - duration: duration * 1000, - showClose: true - }) - reject(res) - } - } else { - reslove(res) - } - }) - }, - error => { - // console.log('err' + error) // for debug - if(currentMessage){ - currentMessage.close() - } - currentMessage = ElMessage({ - message: error.message, - type: 'error', - duration: 5 * 1000 - }) - return Promise.reject(error) - } -) - -export default service diff --git a/magic-boot-ui/src/scripts/router.js b/magic-boot-ui/src/scripts/router.js deleted file mode 100644 index 2379166..0000000 --- a/magic-boot-ui/src/scripts/router.js +++ /dev/null @@ -1,66 +0,0 @@ -import { createRouter, createWebHashHistory } from 'vue-router' - -import Layout from '@/layout/layout.vue' - -const routes = [ - { - path: '/redirect', - component: Layout, - hidden: true, - children: [ - { - path: '/redirect/:path(.*)', - component: () => import('@/views/redirect/index') - } - ] - }, - - { - path: '/', - component: Layout, - redirect: '/home', - children: [ - { - path: '/home', - component: () => import('@/views/home.vue'), - meta: { title: '首页' } - } - ] - }, - - { - path: '/user-center', - redirect: '/system/user/user-center', - component: Layout, - hidden: true, - children: [{ - path: '/system/user/user-center', - component: () => import('@/views/system/user/user-center'), - meta: { title: '个人中心' } - }] - }, - - { - path: '/login', - component: () => import('@/views/login.vue'), - hidden: true - }, - // { - // path: '/404', - // name: '404', - // component: () => import('@/views/404.vue'), - // hidden: true - // }, - // { - // path: '/:pathMatch(.*)*', - // redirect: '/404', - // hidden: true - // } -] - -const router = createRouter({ - history: createWebHashHistory(), - routes -}) - -export default router diff --git a/magic-boot-ui/src/scripts/routerPermission.js b/magic-boot-ui/src/scripts/routerPermission.js deleted file mode 100644 index bc6c0fd..0000000 --- a/magic-boot-ui/src/scripts/routerPermission.js +++ /dev/null @@ -1,111 +0,0 @@ -import request from '@/scripts/request' -import common from '@/scripts/common' -import { sha256 } from 'js-sha256' - -const viewModules = import.meta.glob("../views/**/**.vue") -const layoutModules = import.meta.glob("../layout/**.vue") - -export const filterAsyncRouter = (routers, level) => { - level = level || 0 - const accessedRouters = routers.filter(router => { - if (router.isShow === 1) { - var setIframe = () => { - router.component = loadView(`/common/iframe`) - router.props = { url: router.url } - router.path = "/" + sha256(router.url) - } - if(router.url && router.url.startsWith('http')){ - if(router.openMode == '0'){ - setIframe() - } - } else if(router.url && router.url.startsWith('/') && router.url.indexOf('.htm') != -1) { - if(router.openMode == '0'){ - setIframe() - }else{ - router.path = location.href.substring(0, location.href.indexOf('/', location.href.indexOf('/', location.href.indexOf('/') + 1) + 1)) + router.path - } - } else if (router.componentName) { - router.component = loadView(`/common/show-component`) - router.props = { name: router.componentName } - } else if (router.component) { - const component = router.component - if (component === 'Layout') { - router.path = "/" + common.uuid() - router.component = level > 0 ? layoutModules[`../layout/none.vue`] : loadLayoutView(component) - } else { - router.path = router.path.startsWith('/') ? router.path : '/' + router.path - router.component = loadView(component) || layoutModules[`../layout/empty.vue`] - } - } - if (router.children && router.children.length) { - router.children = filterAsyncRouter(router.children, level + 1) - } - return true - } - return false - }) - return accessedRouters -} - -export const loadLayoutView = () => { - return layoutModules[`../layout/layout.vue`] -} - -export const loadView = (view) => { - view = view.substring(0, 1) === '/' ? view : '/' + view - return viewModules[`../views${view}.vue`] -} - -function loadComponent(router){ - var result = { - path: router.path, - meta: { - title: router.name, - keepAlive: router.keepAlive - } - } - if(router.componentName){ - result.component = loadView(`/common/show-component`) - result.props = { name: router.componentName } - }else if(router.path){ - result.component = loadView(router.path) || layoutModules[`../layout/empty.vue`] - } - return result -} - -export function loadHiddenRouter(routers){ - return routers.filter(router => { - router.path = router.path.startsWith('/') ? router.path : '/' + router.path - router.redirect = router.path - router.component = loadLayoutView() - router.hidden = true - router.children = [loadComponent(router)] - return true - }) -} - -export function generateRoutes(){ - return new Promise((resolve, reject) => { - request({ - url: '/system/menu/current/menus', - method: 'post' - }).then(response => { - const { data } = response - const asyncRouter = filterAsyncRouter(data) - resolve(asyncRouter) - }) - }) -} - -export function generateHiddenRoutes(){ - return new Promise((resolve, reject) => { - request({ - url: '/system/menu/current/hidden/menus', - method: 'post' - }).then(response => { - const { data } = response - const asyncRouter = loadHiddenRouter(data) - resolve(asyncRouter) - }) - }) -} diff --git a/magic-boot-ui/src/scripts/scroll-to.js b/magic-boot-ui/src/scripts/scroll-to.js deleted file mode 100644 index c5d8e04..0000000 --- a/magic-boot-ui/src/scripts/scroll-to.js +++ /dev/null @@ -1,58 +0,0 @@ -Math.easeInOutQuad = function(t, b, c, d) { - t /= d / 2 - if (t < 1) { - return c / 2 * t * t + b - } - t-- - return -c / 2 * (t * (t - 2) - 1) + b -} - -// requestAnimationFrame for Smart Animating http://goo.gl/sx5sts -var requestAnimFrame = (function() { - return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || function(callback) { window.setTimeout(callback, 1000 / 60) } -})() - -/** - * Because it's so fucking difficult to detect the scrolling element, just move them all - * @param {number} amount - */ -function move(amount) { - document.documentElement.scrollTop = amount - document.body.parentNode.scrollTop = amount - document.body.scrollTop = amount -} - -function position() { - return document.documentElement.scrollTop || document.body.parentNode.scrollTop || document.body.scrollTop -} - -/** - * @param {number} to - * @param {number} duration - * @param {Function} callback - */ -export function scrollTo(to, duration, callback) { - const start = position() - const change = to - start - const increment = 20 - let currentTime = 0 - duration = (typeof (duration) === 'undefined') ? 500 : duration - var animateScroll = function() { - // increment the time - currentTime += increment - // find the value with the quadratic in-out easing function - var val = Math.easeInOutQuad(currentTime, start, change, duration) - // move the document.body - move(val) - // do the animation unless its over - if (currentTime < duration) { - requestAnimFrame(animateScroll) - } else { - if (callback && typeof (callback) === 'function') { - // the animation is done so lets callback - callback() - } - } - } - animateScroll() -} diff --git a/magic-boot-ui/src/scripts/svg-icons.js b/magic-boot-ui/src/scripts/svg-icons.js deleted file mode 100644 index 574702e..0000000 --- a/magic-boot-ui/src/scripts/svg-icons.js +++ /dev/null @@ -1,6 +0,0 @@ -const svgs = import.meta.glob('../icons/*.svg') -const svgNames = [] -for (const [key, value] of Object.entries(svgs)) { - svgNames.push(key.substring(key.lastIndexOf('/') + 1, key.lastIndexOf('.'))) -} -export default svgNames \ No newline at end of file diff --git a/magic-boot-ui/src/scripts/treeTable.js b/magic-boot-ui/src/scripts/treeTable.js deleted file mode 100644 index 28e451b..0000000 --- a/magic-boot-ui/src/scripts/treeTable.js +++ /dev/null @@ -1,102 +0,0 @@ -import common from "@/scripts/common"; - -const treeTable = {} - -treeTable.isChildren = (children, id) => { - var result = false - for(var i in children) { - var chi = children[i] - if(chi.id == id){ - result = true - } - if(chi.children && children.length > 0){ - if(treeTable.isChildren(chi.children, id)){ - result = true - } - } - } - return result -} - -treeTable.queryChildren = (children, id) => { - var result = [] - for(var i in children){ - var chi = children[i] - if(chi.id == id){ - if(chi.children && chi.children.length > 0){ - result = chi.children - } - }else{ - var qc = treeTable.queryChildren(chi.children, id) - if(qc.length > 0){ - result = qc - } - } - } - return result -} - -treeTable.genTree = (children) => { - var treeData = [] - for(var i in children){ - var chi = {} - chi.label = children[i].name - chi.value = children[i].id - if(children[i].children && children[i].children.length > 0){ - chi.children = treeTable.genTree(children[i].children) - } - treeData.push(chi) - } - return treeData -} - -treeTable.deleteEmptyChildren = (children) => { - for(var i in children){ - var chi = children[i] - if(chi.children && chi.children.length == 0){ - delete chi.children - }else{ - treeTable.deleteEmptyChildren(chi.children) - } - } -} - -treeTable.recursionSearch = (fields, data, text, html) => { - html = html != undefined ? html : true - var searchData = [] - for(var i in data){ - var treeNode = data[i] - var children = treeNode.children - if(children && children.length > 0){ - var childrenSearch = treeTable.recursionSearch(fields, children, text, html) - treeNode.children = childrenSearch && childrenSearch.length > 0 ? childrenSearch : treeNode.children - treeTable.treeNodeReplace(fields, searchData, treeNode, text, childrenSearch, html) - }else{ - treeTable.treeNodeReplace(fields, searchData, treeNode, text, null, html) - } - } - return searchData -} - -treeTable.treeNodeReplace = (fields, searchData, treeNode, text, childrenSearch, html) => { - var exist = false - fields.forEach((f) => { - if(treeNode[f] && treeNode[f].indexOf(text) != -1){ - if(html){ - treeNode[f] = treeNode[f].replace(text, `${text}`) - } - exist = true - } - }) - if(exist || (childrenSearch && childrenSearch.length > 0)){ - searchData.push(treeNode) - } -} - -treeTable.clearFont = (data, fields) => { - fields.forEach(field => { - data[field] = data[field].replace(/(.*?)<\/font>/g,'$1') - }) -} - -export default treeTable diff --git a/magic-boot-ui/src/scripts/validate.js b/magic-boot-ui/src/scripts/validate.js deleted file mode 100644 index 6b3ac41..0000000 --- a/magic-boot-ui/src/scripts/validate.js +++ /dev/null @@ -1,87 +0,0 @@ -/** - * Created by PanJiaChen on 16/11/18. - */ - -/** - * @param {string} path - * @returns {Boolean} - */ -export function isExternal(path) { - return /^(https?:|mailto:|tel:)/.test(path) -} - -/** - * @param {string} str - * @returns {Boolean} - */ -export function validUsername(str) { - const valid_map = ['admin', 'editor'] - return valid_map.indexOf(str.trim()) >= 0 -} - -/** - * @param {string} url - * @returns {Boolean} - */ -export function validURL(url) { - const reg = /^(https?|ftp):\/\/([a-zA-Z0-9.-]+(:[a-zA-Z0-9.&%$-]+)*@)*((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(:[0-9]+)*(\/($|[a-zA-Z0-9.,?'\\+&%$#=~_-]+))*$/ - return reg.test(url) -} - -/** - * @param {string} str - * @returns {Boolean} - */ -export function validLowerCase(str) { - const reg = /^[a-z]+$/ - return reg.test(str) -} - -/** - * @param {string} str - * @returns {Boolean} - */ -export function validUpperCase(str) { - const reg = /^[A-Z]+$/ - return reg.test(str) -} - -/** - * @param {string} str - * @returns {Boolean} - */ -export function validAlphabets(str) { - const reg = /^[A-Za-z]+$/ - return reg.test(str) -} - -/** - * @param {string} email - * @returns {Boolean} - */ -export function validEmail(email) { - const reg = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/ - return reg.test(email) -} - -/** - * @param {string} str - * @returns {Boolean} - */ -export function isString(str) { - if (typeof str === 'string' || str instanceof String) { - return true - } - return false -} - -/** - * @param {Array} arg - * @returns {Boolean} - */ -export function isArray(arg) { - if (typeof Array.isArray === 'undefined') { - return Object.prototype.toString.call(arg) === '[object Array]' - } - return Array.isArray(arg) -} diff --git a/magic-boot-ui/src/views/404.vue b/magic-boot-ui/src/views/404.vue deleted file mode 100644 index cd90192..0000000 --- a/magic-boot-ui/src/views/404.vue +++ /dev/null @@ -1,3 +0,0 @@ - diff --git a/magic-boot-ui/src/views/common/iframe.vue b/magic-boot-ui/src/views/common/iframe.vue deleted file mode 100644 index 6ad513f..0000000 --- a/magic-boot-ui/src/views/common/iframe.vue +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - diff --git a/magic-boot-ui/src/views/common/show-component.vue b/magic-boot-ui/src/views/common/show-component.vue deleted file mode 100644 index fe54048..0000000 --- a/magic-boot-ui/src/views/common/show-component.vue +++ /dev/null @@ -1,12 +0,0 @@ - - - diff --git a/magic-boot-ui/src/views/examples/editor-table.vue b/magic-boot-ui/src/views/examples/editor-table.vue deleted file mode 100644 index dfcc05f..0000000 --- a/magic-boot-ui/src/views/examples/editor-table.vue +++ /dev/null @@ -1,177 +0,0 @@ - - - diff --git a/magic-boot-ui/src/views/examples/select-example.vue b/magic-boot-ui/src/views/examples/select-example.vue deleted file mode 100644 index 99cc7b1..0000000 --- a/magic-boot-ui/src/views/examples/select-example.vue +++ /dev/null @@ -1,24 +0,0 @@ - - - diff --git a/magic-boot-ui/src/views/examples/test-mb-form.vue b/magic-boot-ui/src/views/examples/test-mb-form.vue deleted file mode 100644 index c4d5258..0000000 --- a/magic-boot-ui/src/views/examples/test-mb-form.vue +++ /dev/null @@ -1,142 +0,0 @@ - - - diff --git a/magic-boot-ui/src/views/examples/test-mb-list.vue b/magic-boot-ui/src/views/examples/test-mb-list.vue deleted file mode 100644 index 4c347cd..0000000 --- a/magic-boot-ui/src/views/examples/test-mb-list.vue +++ /dev/null @@ -1,207 +0,0 @@ - - - diff --git a/magic-boot-ui/src/views/examples/three-linkage.vue b/magic-boot-ui/src/views/examples/three-linkage.vue deleted file mode 100644 index 46aa831..0000000 --- a/magic-boot-ui/src/views/examples/three-linkage.vue +++ /dev/null @@ -1,83 +0,0 @@ - - - - diff --git a/magic-boot-ui/src/views/examples/upload-file.vue b/magic-boot-ui/src/views/examples/upload-file.vue deleted file mode 100644 index 04ba4e9..0000000 --- a/magic-boot-ui/src/views/examples/upload-file.vue +++ /dev/null @@ -1,45 +0,0 @@ - - - diff --git a/magic-boot-ui/src/views/home.vue b/magic-boot-ui/src/views/home.vue deleted file mode 100644 index a0def82..0000000 --- a/magic-boot-ui/src/views/home.vue +++ /dev/null @@ -1,9 +0,0 @@ - - - - - diff --git a/magic-boot-ui/src/views/login.vue b/magic-boot-ui/src/views/login.vue deleted file mode 100644 index 90f8da3..0000000 --- a/magic-boot-ui/src/views/login.vue +++ /dev/null @@ -1,217 +0,0 @@ - - - - - diff --git a/magic-boot-ui/src/views/lowcode/code-gen-form.vue b/magic-boot-ui/src/views/lowcode/code-gen-form.vue deleted file mode 100644 index 1ab08fb..0000000 --- a/magic-boot-ui/src/views/lowcode/code-gen-form.vue +++ /dev/null @@ -1,416 +0,0 @@ - - - diff --git a/magic-boot-ui/src/views/lowcode/code-gen-list.vue b/magic-boot-ui/src/views/lowcode/code-gen-list.vue deleted file mode 100644 index ca5922e..0000000 --- a/magic-boot-ui/src/views/lowcode/code-gen-list.vue +++ /dev/null @@ -1,91 +0,0 @@ - - - diff --git a/magic-boot-ui/src/views/lowcode/magic-editor.vue b/magic-boot-ui/src/views/lowcode/magic-editor.vue deleted file mode 100644 index df96158..0000000 --- a/magic-boot-ui/src/views/lowcode/magic-editor.vue +++ /dev/null @@ -1,13 +0,0 @@ - - - diff --git a/magic-boot-ui/src/views/redirect/index.vue b/magic-boot-ui/src/views/redirect/index.vue deleted file mode 100644 index 32c057f..0000000 --- a/magic-boot-ui/src/views/redirect/index.vue +++ /dev/null @@ -1,10 +0,0 @@ - - diff --git a/magic-boot-ui/src/views/system/configure/configure-list.vue b/magic-boot-ui/src/views/system/configure/configure-list.vue deleted file mode 100644 index 8a73a67..0000000 --- a/magic-boot-ui/src/views/system/configure/configure-list.vue +++ /dev/null @@ -1,247 +0,0 @@ - - - diff --git a/magic-boot-ui/src/views/system/dict/dict-items.vue b/magic-boot-ui/src/views/system/dict/dict-items.vue deleted file mode 100644 index 870e54f..0000000 --- a/magic-boot-ui/src/views/system/dict/dict-items.vue +++ /dev/null @@ -1,235 +0,0 @@ - - - diff --git a/magic-boot-ui/src/views/system/dict/dict-list.vue b/magic-boot-ui/src/views/system/dict/dict-list.vue deleted file mode 100644 index 289a026..0000000 --- a/magic-boot-ui/src/views/system/dict/dict-list.vue +++ /dev/null @@ -1,216 +0,0 @@ - - - diff --git a/magic-boot-ui/src/views/system/menu/menu-form.vue b/magic-boot-ui/src/views/system/menu/menu-form.vue deleted file mode 100644 index f14d8eb..0000000 --- a/magic-boot-ui/src/views/system/menu/menu-form.vue +++ /dev/null @@ -1,274 +0,0 @@ - - - - - diff --git a/magic-boot-ui/src/views/system/menu/menu-icons.vue b/magic-boot-ui/src/views/system/menu/menu-icons.vue deleted file mode 100644 index 2575af7..0000000 --- a/magic-boot-ui/src/views/system/menu/menu-icons.vue +++ /dev/null @@ -1,63 +0,0 @@ - - - - - diff --git a/magic-boot-ui/src/views/system/menu/menu-list.vue b/magic-boot-ui/src/views/system/menu/menu-list.vue deleted file mode 100644 index 715ec70..0000000 --- a/magic-boot-ui/src/views/system/menu/menu-list.vue +++ /dev/null @@ -1,258 +0,0 @@ - - - diff --git a/magic-boot-ui/src/views/system/monitor/druid.vue b/magic-boot-ui/src/views/system/monitor/druid.vue deleted file mode 100644 index 8b6084b..0000000 --- a/magic-boot-ui/src/views/system/monitor/druid.vue +++ /dev/null @@ -1,3 +0,0 @@ - diff --git a/magic-boot-ui/src/views/system/monitor/login-log.vue b/magic-boot-ui/src/views/system/monitor/login-log.vue deleted file mode 100644 index 7af08f3..0000000 --- a/magic-boot-ui/src/views/system/monitor/login-log.vue +++ /dev/null @@ -1,69 +0,0 @@ - - - diff --git a/magic-boot-ui/src/views/system/monitor/online-user.vue b/magic-boot-ui/src/views/system/monitor/online-user.vue deleted file mode 100644 index c7a651a..0000000 --- a/magic-boot-ui/src/views/system/monitor/online-user.vue +++ /dev/null @@ -1,117 +0,0 @@ - - - diff --git a/magic-boot-ui/src/views/system/monitor/oper-log.vue b/magic-boot-ui/src/views/system/monitor/oper-log.vue deleted file mode 100644 index 418deb0..0000000 --- a/magic-boot-ui/src/views/system/monitor/oper-log.vue +++ /dev/null @@ -1,90 +0,0 @@ - - - diff --git a/magic-boot-ui/src/views/system/office/office-list.vue b/magic-boot-ui/src/views/system/office/office-list.vue deleted file mode 100644 index b419e13..0000000 --- a/magic-boot-ui/src/views/system/office/office-list.vue +++ /dev/null @@ -1,347 +0,0 @@ - - - - - diff --git a/magic-boot-ui/src/views/system/role/role-assign-permissions.vue b/magic-boot-ui/src/views/system/role/role-assign-permissions.vue deleted file mode 100644 index a00152a..0000000 --- a/magic-boot-ui/src/views/system/role/role-assign-permissions.vue +++ /dev/null @@ -1,41 +0,0 @@ - - - diff --git a/magic-boot-ui/src/views/system/role/role-list.vue b/magic-boot-ui/src/views/system/role/role-list.vue deleted file mode 100644 index 6751f90..0000000 --- a/magic-boot-ui/src/views/system/role/role-list.vue +++ /dev/null @@ -1,255 +0,0 @@ - - - diff --git a/magic-boot-ui/src/views/system/test/test-list.vue b/magic-boot-ui/src/views/system/test/test-list.vue deleted file mode 100644 index 9299a8f..0000000 --- a/magic-boot-ui/src/views/system/test/test-list.vue +++ /dev/null @@ -1,98 +0,0 @@ - - - diff --git a/magic-boot-ui/src/views/system/user/user-center.vue b/magic-boot-ui/src/views/system/user/user-center.vue deleted file mode 100644 index ff69536..0000000 --- a/magic-boot-ui/src/views/system/user/user-center.vue +++ /dev/null @@ -1,93 +0,0 @@ - - - diff --git a/magic-boot-ui/src/views/system/user/user-form.vue b/magic-boot-ui/src/views/system/user/user-form.vue deleted file mode 100644 index fb63bcd..0000000 --- a/magic-boot-ui/src/views/system/user/user-form.vue +++ /dev/null @@ -1,126 +0,0 @@ - - - diff --git a/magic-boot-ui/src/views/system/user/user-list.vue b/magic-boot-ui/src/views/system/user/user-list.vue deleted file mode 100644 index ce01b09..0000000 --- a/magic-boot-ui/src/views/system/user/user-list.vue +++ /dev/null @@ -1,262 +0,0 @@ - - - - - diff --git a/magic-boot-ui/vite.config.js b/magic-boot-ui/vite.config.js deleted file mode 100644 index a4ea1e2..0000000 --- a/magic-boot-ui/vite.config.js +++ /dev/null @@ -1,38 +0,0 @@ -import { defineConfig } from 'vite' -import vue from '@vitejs/plugin-vue' -import path from 'path' -import viteSvgIcons from 'vite-plugin-svg-icons' - -// https://vitejs.dev/config/ -export default defineConfig({ - base: './', - plugins: [ - vue(), - viteSvgIcons({ - iconDirs: [path.resolve(process.cwd(), 'src/icons')], - symbolId: 'mb-icon-[name]' - }) - ], - resolve: { - extensions: ['.vue', '.json', '.js'], - alias: { - '@': path.resolve(__dirname,'src') - } - }, - css: {//去除@charset UTF-8规则影响 - postcss: { - plugins: [ - { - postcssPlugin: 'internal:charset-removal', - AtRule: { - charset: (atRule) => { - if (atRule.name === 'charset') { - atRule.remove(); - } - } - } - } - ] - } - } -})