create-meadminjs 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/cli.js +3 -0
- package/bin/index.js +3 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +97 -0
- package/dist/file-zuupOgeh.js +78 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +98 -0
- package/package.json +38 -0
- package/template/meadmin/.editorconfig +11 -0
- package/template/meadmin/.env +21 -0
- package/template/meadmin/.eslintrc.json +7 -0
- package/template/meadmin/.husky/pre-commit +4 -0
- package/template/meadmin/.mocharc.json +6 -0
- package/template/meadmin/.prettierignore +30 -0
- package/template/meadmin/.prettierrc.cjs +47 -0
- package/template/meadmin/.vscode/extensions.json +3 -0
- package/template/meadmin/.vscode/settings.json +28 -0
- package/template/meadmin/README.md +41 -0
- package/template/meadmin/bootstrap.js +2 -0
- package/template/meadmin/meadmin.sql +571 -0
- package/template/meadmin/nx.json +10 -0
- package/template/meadmin/packageTemplate.json +80 -0
- package/template/meadmin/pnpm-workspace.yaml +4 -0
- package/template/meadmin/public/admin/.gitkeep +0 -0
- package/template/meadmin/public/index/.gitkeep +0 -0
- package/template/meadmin/public/index/images/layout/bannerCode.jpg +0 -0
- package/template/meadmin/public/index/images/layout/bannerGift.jpg +0 -0
- package/template/meadmin/public/index/images/layout/bannerManage.jpg +0 -0
- package/template/meadmin/src/app/admin/controller/base.controller.ts +6 -0
- package/template/meadmin/src/app/admin/controller/example/demo.controller.ts +98 -0
- package/template/meadmin/src/app/admin/controller/file.controller.ts +105 -0
- package/template/meadmin/src/app/admin/controller/login.controller.ts +81 -0
- package/template/meadmin/src/app/admin/controller/system/admin.controller.ts +73 -0
- package/template/meadmin/src/app/admin/controller/system/menu.controller.ts +80 -0
- package/template/meadmin/src/app/admin/controller/system/role.controller.ts +81 -0
- package/template/meadmin/src/app/admin/controller/user.controller.ts +86 -0
- package/template/meadmin/src/app/admin/controller/userFile.controller.ts +84 -0
- package/template/meadmin/src/app/admin/dto/captchaResult.dto.ts +8 -0
- package/template/meadmin/src/app/admin/dto/example/demoCreate.dto.ts +9 -0
- package/template/meadmin/src/app/admin/dto/example/demoQuery.dto.ts +20 -0
- package/template/meadmin/src/app/admin/dto/example/demoUpdate.dto.ts +11 -0
- package/template/meadmin/src/app/admin/dto/fileCreate.dto.ts +9 -0
- package/template/meadmin/src/app/admin/dto/fileQuery.dto.ts +20 -0
- package/template/meadmin/src/app/admin/dto/fileUp.dto.ts +28 -0
- package/template/meadmin/src/app/admin/dto/fileUpdate.dto.ts +11 -0
- package/template/meadmin/src/app/admin/dto/loginCaptchaParam.dto.ts +9 -0
- package/template/meadmin/src/app/admin/dto/loginInfoResult.dto.ts +24 -0
- package/template/meadmin/src/app/admin/dto/loginParam.dto.ts +13 -0
- package/template/meadmin/src/app/admin/dto/loginResult.dto.ts +10 -0
- package/template/meadmin/src/app/admin/dto/system/adminCreate.dto.ts +14 -0
- package/template/meadmin/src/app/admin/dto/system/adminQuery.dto.ts +30 -0
- package/template/meadmin/src/app/admin/dto/system/adminUpdate.dto.ts +24 -0
- package/template/meadmin/src/app/admin/dto/system/menuCreate.dto.ts +11 -0
- package/template/meadmin/src/app/admin/dto/system/menuQuery.dto.ts +20 -0
- package/template/meadmin/src/app/admin/dto/system/menuTreeAllResult.dto.ts +9 -0
- package/template/meadmin/src/app/admin/dto/system/menuUpdate.dto.ts +8 -0
- package/template/meadmin/src/app/admin/dto/system/roleCreate.dto.ts +11 -0
- package/template/meadmin/src/app/admin/dto/system/roleQuery.dto.ts +20 -0
- package/template/meadmin/src/app/admin/dto/system/roleTreeAllResult.dto.ts +12 -0
- package/template/meadmin/src/app/admin/dto/system/roleUpdate.dto.ts +14 -0
- package/template/meadmin/src/app/admin/dto/userCreate.dto.ts +9 -0
- package/template/meadmin/src/app/admin/dto/userFileCreate.dto.ts +9 -0
- package/template/meadmin/src/app/admin/dto/userFileQuery.dto.ts +20 -0
- package/template/meadmin/src/app/admin/dto/userFileUp.dto.ts +28 -0
- package/template/meadmin/src/app/admin/dto/userFileUpdate.dto.ts +11 -0
- package/template/meadmin/src/app/admin/dto/userQuery.dto.ts +26 -0
- package/template/meadmin/src/app/admin/dto/userUpdate.dto.ts +11 -0
- package/template/meadmin/src/app/admin/middleware/admin.middleware.ts +41 -0
- package/template/meadmin/src/app/admin/service/example/demo.service.ts +260 -0
- package/template/meadmin/src/app/admin/service/file.service.ts +123 -0
- package/template/meadmin/src/app/admin/service/login.serveice.ts +209 -0
- package/template/meadmin/src/app/admin/service/system/admin.service.ts +206 -0
- package/template/meadmin/src/app/admin/service/system/menu.service.ts +133 -0
- package/template/meadmin/src/app/admin/service/system/role.service.ts +161 -0
- package/template/meadmin/src/app/admin/service/user.service.ts +205 -0
- package/template/meadmin/src/app/admin/service/userFile.service.ts +126 -0
- package/template/meadmin/src/app/home.controller.ts +19 -0
- package/template/meadmin/src/app/index/controller/base.controller.ts +6 -0
- package/template/meadmin/src/app/index/controller/file.controller.ts +116 -0
- package/template/meadmin/src/app/index/controller/index.controller.ts +70 -0
- package/template/meadmin/src/app/index/controller/login.controller.ts +81 -0
- package/template/meadmin/src/app/index/controller/user.controller.ts +43 -0
- package/template/meadmin/src/app/index/dto/captchaResult.dto.ts +8 -0
- package/template/meadmin/src/app/index/dto/fileCreate.dto.ts +9 -0
- package/template/meadmin/src/app/index/dto/fileQuery.dto.ts +20 -0
- package/template/meadmin/src/app/index/dto/fileUp.dto.ts +28 -0
- package/template/meadmin/src/app/index/dto/fileUpdate.dto.ts +11 -0
- package/template/meadmin/src/app/index/dto/loginCaptchaParam.dto.ts +9 -0
- package/template/meadmin/src/app/index/dto/loginParam.dto.ts +13 -0
- package/template/meadmin/src/app/index/dto/loginResult.dto.ts +10 -0
- package/template/meadmin/src/app/index/dto/userCreate.dto.ts +26 -0
- package/template/meadmin/src/app/index/dto/userUpdate.dto.ts +33 -0
- package/template/meadmin/src/app/index/middleware/index.middleware.ts +28 -0
- package/template/meadmin/src/app/index/service/file.service.ts +127 -0
- package/template/meadmin/src/app/index/service/login.serveice.ts +178 -0
- package/template/meadmin/src/app/index/service/user.service.ts +87 -0
- package/template/meadmin/src/config/config.default.ts +154 -0
- package/template/meadmin/src/config/config.unittest.ts +7 -0
- package/template/meadmin/src/config/database.ts +30 -0
- package/template/meadmin/src/configuration.ts +107 -0
- package/template/meadmin/src/controller/api.controller.ts +21 -0
- package/template/meadmin/src/decorators/admin/permission.ts +41 -0
- package/template/meadmin/src/decorators/index/permission.ts +37 -0
- package/template/meadmin/src/decorators/index.ts +61 -0
- package/template/meadmin/src/decorators/sequelize.ts +65 -0
- package/template/meadmin/src/decorators/swagger.ts +170 -0
- package/template/meadmin/src/decorators/transactions.ts +42 -0
- package/template/meadmin/src/dict/code.enum.ts +8 -0
- package/template/meadmin/src/dto/page.dto.ts +16 -0
- package/template/meadmin/src/entities/abstract/adminBase.entity.ts +35 -0
- package/template/meadmin/src/entities/abstract/adminTree.entity.ts +258 -0
- package/template/meadmin/src/entities/abstract/base.entity.ts +69 -0
- package/template/meadmin/src/entities/abstract/indexBase.entity.ts +39 -0
- package/template/meadmin/src/entities/exampleBook.entity.ts +22 -0
- package/template/meadmin/src/entities/exampleDemo.entity.ts +104 -0
- package/template/meadmin/src/entities/file.entity.ts +68 -0
- package/template/meadmin/src/entities/systemAdmin.entity.ts +164 -0
- package/template/meadmin/src/entities/systemMenu.entity.ts +161 -0
- package/template/meadmin/src/entities/systemRole.entity.ts +99 -0
- package/template/meadmin/src/entities/user.entity.ts +160 -0
- package/template/meadmin/src/entities/userFile.entity.ts +68 -0
- package/template/meadmin/src/fileManage/index.ts +12 -0
- package/template/meadmin/src/fileManage/storage/base.ts +6 -0
- package/template/meadmin/src/fileManage/storage/local.ts +93 -0
- package/template/meadmin/src/filter/badRequest.filter.ts +14 -0
- package/template/meadmin/src/filter/default.filter.ts +28 -0
- package/template/meadmin/src/filter/forbidden.filter.ts +15 -0
- package/template/meadmin/src/filter/index.ts +6 -0
- package/template/meadmin/src/filter/notfound.filter.ts +10 -0
- package/template/meadmin/src/filter/unauthorized.filter.ts +15 -0
- package/template/meadmin/src/filter/validate.filter.ts +23 -0
- package/template/meadmin/src/helper/dotenv.ts +13 -0
- package/template/meadmin/src/helper/dto.ts +195 -0
- package/template/meadmin/src/helper/snowflake.ts +50 -0
- package/template/meadmin/src/helper/utils.ts +57 -0
- package/template/meadmin/src/interface.ts +12 -0
- package/template/meadmin/src/locales/en.json +13 -0
- package/template/meadmin/src/logger.ts +24 -0
- package/template/meadmin/src/middleware/report.middleware.ts +23 -0
- package/template/meadmin/src/response/apiBase.res.ts +12 -0
- package/template/meadmin/src/response/apiError.res.ts +6 -0
- package/template/meadmin/src/response/apiPage.res.ts +19 -0
- package/template/meadmin/src/response/apiSuccess.res.ts +17 -0
- package/template/meadmin/src/ruleType/index.ts +3 -0
- package/template/meadmin/src/ruleType/string.ts +29 -0
- package/template/meadmin/src/service/dataSourceManager.service.ts +55 -0
- package/template/meadmin/src/service/response.service.ts +65 -0
- package/template/meadmin/src/types/decorator.ts +31 -0
- package/template/meadmin/src/types/entity.ts +209 -0
- package/template/meadmin/src/types/fileManage.ts +48 -0
- package/template/meadmin/src/types/koa.interface.ts +12 -0
- package/template/meadmin/src/types/uploadOptions.ts +7 -0
- package/template/meadmin/test/controller/api.test.ts +17 -0
- package/template/meadmin/test/controller/home.test.ts +18 -0
- package/template/meadmin/test/setup.ts +15 -0
- package/template/meadmin/test/tsconfig.json +19 -0
- package/template/meadmin/tsconfig.json +28 -0
- package/template/meadmin/types/mwtsc.d.ts +9 -0
- package/template/meadmin/uploadFile/admin/.gitkeep +0 -0
- package/template/meadmin/uploadFile/index/.gitkeep +0 -0
- package/template/meadmin/view/admin/.prettierignore +28 -0
- package/template/meadmin/view/admin/.prettierrc.cjs +4 -0
- package/template/meadmin/view/admin/cli/autoImport.ts +3 -0
- package/template/meadmin/view/admin/eslint.config.js +91 -0
- package/template/meadmin/view/admin/index.html +65 -0
- package/template/meadmin/view/admin/packageTemplate.json +123 -0
- package/template/meadmin/view/admin/plugins/autoComponents.ts +10 -0
- package/template/meadmin/view/admin/plugins/autoImport.ts +64 -0
- package/template/meadmin/view/admin/plugins/autoImportApi.ts +14 -0
- package/template/meadmin/view/admin/plugins/babel.ts +25 -0
- package/template/meadmin/view/admin/plugins/index.ts +107 -0
- package/template/meadmin/view/admin/plugins/svgLoader.ts +22 -0
- package/template/meadmin/view/admin/plugins/vueSetUpExtend.ts +5 -0
- package/template/meadmin/view/admin/public/favicon.ico +0 -0
- package/template/meadmin/view/admin/public/logo.png +0 -0
- package/template/meadmin/view/admin/public/logo.svg +1 -0
- package/template/meadmin/view/admin/src/App.vue +46 -0
- package/template/meadmin/view/admin/src/api/api.model.ts +11 -0
- package/template/meadmin/view/admin/src/api/example/demo.ts +189 -0
- package/template/meadmin/view/admin/src/api/file.ts +124 -0
- package/template/meadmin/view/admin/src/api/login.ts +55 -0
- package/template/meadmin/view/admin/src/api/system/admin.ts +111 -0
- package/template/meadmin/view/admin/src/api/system/menu.ts +125 -0
- package/template/meadmin/view/admin/src/api/system/role.ts +111 -0
- package/template/meadmin/view/admin/src/api/user.ts +106 -0
- package/template/meadmin/view/admin/src/api/userFile.ts +121 -0
- package/template/meadmin/view/admin/src/app.ts +13 -0
- package/template/meadmin/view/admin/src/assets/images/404.svg +339 -0
- package/template/meadmin/view/admin/src/assets/images/captcha.png +0 -0
- package/template/meadmin/view/admin/src/components/meButton.vue +39 -0
- package/template/meadmin/view/admin/src/components/meComponent.ts +73 -0
- package/template/meadmin/view/admin/src/components/meDarkSwitch.vue +36 -0
- package/template/meadmin/view/admin/src/components/meDialog/hooks/minMax.ts +163 -0
- package/template/meadmin/view/admin/src/components/meDialog/index.vue +86 -0
- package/template/meadmin/view/admin/src/components/meFilesView.vue +52 -0
- package/template/meadmin/view/admin/src/components/meKeepAlive/core/Suspense.ts +15 -0
- package/template/meadmin/view/admin/src/components/meKeepAlive/core/apiAsyncComponent.ts +3 -0
- package/template/meadmin/view/admin/src/components/meKeepAlive/core/component.ts +5 -0
- package/template/meadmin/view/admin/src/components/meKeepAlive/core/componentPublicInstance.ts +6 -0
- package/template/meadmin/view/admin/src/components/meKeepAlive/core/devtools.ts +43 -0
- package/template/meadmin/view/admin/src/components/meKeepAlive/core/errorHandling.ts +17 -0
- package/template/meadmin/view/admin/src/components/meKeepAlive/core/renderer.ts +103 -0
- package/template/meadmin/view/admin/src/components/meKeepAlive/core/shapeFlags.ts +13 -0
- package/template/meadmin/view/admin/src/components/meKeepAlive/core/vnode.ts +9 -0
- package/template/meadmin/view/admin/src/components/meKeepAlive/index.ts +347 -0
- package/template/meadmin/view/admin/src/components/meLocaleSelect.vue +34 -0
- package/template/meadmin/view/admin/src/components/meNumber.vue +74 -0
- package/template/meadmin/view/admin/src/components/meSearchForm.vue +175 -0
- package/template/meadmin/view/admin/src/components/meSearchMenu/index.vue +87 -0
- package/template/meadmin/view/admin/src/components/meSearchMenu/useSearchMenu.ts +87 -0
- package/template/meadmin/view/admin/src/components/meSelectFile/index.vue +87 -0
- package/template/meadmin/view/admin/src/components/meSelectFile/meSelectFile.ts +3 -0
- package/template/meadmin/view/admin/src/components/meSelectList.vue +80 -0
- package/template/meadmin/view/admin/src/components/meSelectUserFile/index.vue +96 -0
- package/template/meadmin/view/admin/src/components/meSelectUserFile/meSelectUserFile.ts +3 -0
- package/template/meadmin/view/admin/src/components/meSetting.vue +20 -0
- package/template/meadmin/view/admin/src/components/meSettingMenu.vue +152 -0
- package/template/meadmin/view/admin/src/components/meSizeSelect.vue +28 -0
- package/template/meadmin/view/admin/src/components/meUpload.vue +114 -0
- package/template/meadmin/view/admin/src/components/meUploadUserFile.vue +114 -0
- package/template/meadmin/view/admin/src/components/meVxeTable/components/pagination.vue +67 -0
- package/template/meadmin/view/admin/src/components/meVxeTable/directives/resize.ts +31 -0
- package/template/meadmin/view/admin/src/components/meVxeTable/index.vue +287 -0
- package/template/meadmin/view/admin/src/components/meVxeTable/install.ts +30 -0
- package/template/meadmin/view/admin/src/components/meVxeTable/util.ts +11 -0
- package/template/meadmin/view/admin/src/components/meWangEditor/index.vue +121 -0
- package/template/meadmin/view/admin/src/components/meWangEditor/meWangEditor.scss +24 -0
- package/template/meadmin/view/admin/src/components/page.vue +24 -0
- package/template/meadmin/view/admin/src/components/service/meImageViewer.ts +23 -0
- package/template/meadmin/view/admin/src/config/index.ts +11 -0
- package/template/meadmin/view/admin/src/config/locale.ts +245 -0
- package/template/meadmin/view/admin/src/config/login.ts +5 -0
- package/template/meadmin/view/admin/src/config/theme.ts +19 -0
- package/template/meadmin/view/admin/src/dict/configEnum.ts +5 -0
- package/template/meadmin/view/admin/src/dict/eventEnmu.ts +14 -0
- package/template/meadmin/view/admin/src/dict/menuModeEnum.ts +5 -0
- package/template/meadmin/view/admin/src/dict/pageEnum.ts +6 -0
- package/template/meadmin/view/admin/src/directives/clickOutside.ts +2 -0
- package/template/meadmin/view/admin/src/entry-client.ts +8 -0
- package/template/meadmin/view/admin/src/entry-server.ts +69 -0
- package/template/meadmin/view/admin/src/env.d.ts +6 -0
- package/template/meadmin/view/admin/src/event/index.ts +30 -0
- package/template/meadmin/view/admin/src/event/module.ts +1 -0
- package/template/meadmin/view/admin/src/event/modules/core.ts +27 -0
- package/template/meadmin/view/admin/src/hooks/actionModel.ts +54 -0
- package/template/meadmin/view/admin/src/hooks/core/computedProxy.ts +10 -0
- package/template/meadmin/view/admin/src/hooks/index.ts +24 -0
- package/template/meadmin/view/admin/src/icons/index.ts +52 -0
- package/template/meadmin/view/admin/src/icons/svg/dashboard.svg +5 -0
- package/template/meadmin/view/admin/src/icons/svg/moon.svg +5 -0
- package/template/meadmin/view/admin/src/icons/svg/size.svg +5 -0
- package/template/meadmin/view/admin/src/icons/svg/sunny.svg +5 -0
- package/template/meadmin/view/admin/src/icons/svg/translation.svg +5 -0
- package/template/meadmin/view/admin/src/layout/components/expand.vue +18 -0
- package/template/meadmin/view/admin/src/layout/components/header/components/tagBar/components/contextmenu.vue +180 -0
- package/template/meadmin/view/admin/src/layout/components/header/components/tagBar/index.vue +322 -0
- package/template/meadmin/view/admin/src/layout/components/header/components/topBar/components/left.vue +59 -0
- package/template/meadmin/view/admin/src/layout/components/header/components/topBar/components/right/components/messageBox.vue +82 -0
- package/template/meadmin/view/admin/src/layout/components/header/components/topBar/components/right/components/user.vue +53 -0
- package/template/meadmin/view/admin/src/layout/components/header/components/topBar/components/right/index.vue +44 -0
- package/template/meadmin/view/admin/src/layout/components/header/components/topBar/components/topMenu.vue +33 -0
- package/template/meadmin/view/admin/src/layout/components/header/components/topBar/index.vue +30 -0
- package/template/meadmin/view/admin/src/layout/components/header/index.vue +15 -0
- package/template/meadmin/view/admin/src/layout/components/menu/components/menuItem.vue +72 -0
- package/template/meadmin/view/admin/src/layout/components/menu/index.vue +147 -0
- package/template/meadmin/view/admin/src/layout/components/page.vue +33 -0
- package/template/meadmin/view/admin/src/layout/components/title.vue +21 -0
- package/template/meadmin/view/admin/src/layout/index.vue +104 -0
- package/template/meadmin/view/admin/src/locales/helper.ts +127 -0
- package/template/meadmin/view/admin/src/locales/hooks.ts +50 -0
- package/template/meadmin/view/admin/src/locales/i18n.ts +16 -0
- package/template/meadmin/view/admin/src/locales/lang/en/default.json +65 -0
- package/template/meadmin/view/admin/src/locales/lang/en/index.ts +7 -0
- package/template/meadmin/view/admin/src/locales/lang/en/meTable.json +7 -0
- package/template/meadmin/view/admin/src/locales/lang/en/meVxeTable.ts +11 -0
- package/template/meadmin/view/admin/src/locales/lang/en/menu.json +1 -0
- package/template/meadmin/view/admin/src/locales/lang/en/rule.json +12 -0
- package/template/meadmin/view/admin/src/locales/lang/zh-cn/default.json +6 -0
- package/template/meadmin/view/admin/src/locales/lang/zh-cn/index.ts +7 -0
- package/template/meadmin/view/admin/src/locales/lang/zh-cn/meVxeTable.ts +2 -0
- package/template/meadmin/view/admin/src/main.ts +21 -0
- package/template/meadmin/view/admin/src/router/constant.ts +2 -0
- package/template/meadmin/view/admin/src/router/guard/index.ts +52 -0
- package/template/meadmin/view/admin/src/router/index.ts +115 -0
- package/template/meadmin/view/admin/src/setElGlobel.ts +16 -0
- package/template/meadmin/view/admin/src/store/index.ts +8 -0
- package/template/meadmin/view/admin/src/store/modules/global.ts +66 -0
- package/template/meadmin/view/admin/src/store/modules/route.ts +69 -0
- package/template/meadmin/view/admin/src/store/modules/setting.ts +46 -0
- package/template/meadmin/view/admin/src/store/modules/user.ts +115 -0
- package/template/meadmin/view/admin/src/styles/element-plus.scss +40 -0
- package/template/meadmin/view/admin/src/styles/index.scss +122 -0
- package/template/meadmin/view/admin/src/styles/transition.scss +33 -0
- package/template/meadmin/view/admin/src/styles/variables.scss +5 -0
- package/template/meadmin/view/admin/src/utils/fileMd5Work.ts +109 -0
- package/template/meadmin/view/admin/src/utils/fileUpload.ts +154 -0
- package/template/meadmin/view/admin/src/utils/formatting.ts +62 -0
- package/template/meadmin/view/admin/src/utils/helper.ts +315 -0
- package/template/meadmin/view/admin/src/utils/loading.ts +63 -0
- package/template/meadmin/view/admin/src/utils/log.ts +8 -0
- package/template/meadmin/view/admin/src/utils/mitt.ts +152 -0
- package/template/meadmin/view/admin/src/utils/nProgress.ts +31 -0
- package/template/meadmin/view/admin/src/utils/permission.ts +76 -0
- package/template/meadmin/view/admin/src/utils/request.ts +152 -0
- package/template/meadmin/view/admin/src/utils/userFileUpload.ts +154 -0
- package/template/meadmin/view/admin/src/utils/validate.ts +17 -0
- package/template/meadmin/view/admin/src/views/404.vue +50 -0
- package/template/meadmin/view/admin/src/views/example/demo/components/addOrUp.vue +118 -0
- package/template/meadmin/view/admin/src/views/example/demo/components/info.vue +56 -0
- package/template/meadmin/view/admin/src/views/example/demo/dict.ts +8 -0
- package/template/meadmin/view/admin/src/views/example/demo/index.vue +126 -0
- package/template/meadmin/view/admin/src/views/example/demo/lang/dict.ts +8 -0
- package/template/meadmin/view/admin/src/views/example/demo/lang/en.json +14 -0
- package/template/meadmin/view/admin/src/views/file/components/add.vue +24 -0
- package/template/meadmin/view/admin/src/views/file/components/info.vue +51 -0
- package/template/meadmin/view/admin/src/views/file/components/up.vue +72 -0
- package/template/meadmin/view/admin/src/views/file/index.vue +132 -0
- package/template/meadmin/view/admin/src/views/file/lang/en.json +11 -0
- package/template/meadmin/view/admin/src/views/login/components/header.vue +20 -0
- package/template/meadmin/view/admin/src/views/login/index.vue +163 -0
- package/template/meadmin/view/admin/src/views/redirect.vue +12 -0
- package/template/meadmin/view/admin/src/views/system/admin/components/addOrUp.vue +111 -0
- package/template/meadmin/view/admin/src/views/system/admin/components/info.vue +75 -0
- package/template/meadmin/view/admin/src/views/system/admin/dict.ts +7 -0
- package/template/meadmin/view/admin/src/views/system/admin/index.vue +145 -0
- package/template/meadmin/view/admin/src/views/system/admin/lang/en.json +19 -0
- package/template/meadmin/view/admin/src/views/system/menuRole/components/menu/components/addOrUp.vue +145 -0
- package/template/meadmin/view/admin/src/views/system/menuRole/components/menu/components/info.vue +68 -0
- package/template/meadmin/view/admin/src/views/system/menuRole/components/menu/dict.ts +36 -0
- package/template/meadmin/view/admin/src/views/system/menuRole/components/menu/index.vue +162 -0
- package/template/meadmin/view/admin/src/views/system/menuRole/components/menu/lang/en.json +20 -0
- package/template/meadmin/view/admin/src/views/system/menuRole/components/role/components/addOrUp.vue +94 -0
- package/template/meadmin/view/admin/src/views/system/menuRole/components/role/components/info.vue +59 -0
- package/template/meadmin/view/admin/src/views/system/menuRole/components/role/dict.ts +7 -0
- package/template/meadmin/view/admin/src/views/system/menuRole/components/role/index.vue +153 -0
- package/template/meadmin/view/admin/src/views/system/menuRole/components/role/lang/en.json +14 -0
- package/template/meadmin/view/admin/src/views/system/menuRole/index.vue +59 -0
- package/template/meadmin/view/admin/src/views/user/components/addOrUp.vue +120 -0
- package/template/meadmin/view/admin/src/views/user/components/info.vue +56 -0
- package/template/meadmin/view/admin/src/views/user/dict.ts +7 -0
- package/template/meadmin/view/admin/src/views/user/file/components/add.vue +24 -0
- package/template/meadmin/view/admin/src/views/user/file/components/info.vue +54 -0
- package/template/meadmin/view/admin/src/views/user/file/components/up.vue +82 -0
- package/template/meadmin/view/admin/src/views/user/file/index.vue +148 -0
- package/template/meadmin/view/admin/src/views/user/file/lang/en.json +17 -0
- package/template/meadmin/view/admin/src/views/user/index.vue +145 -0
- package/template/meadmin/view/admin/src/views/user/lang/en.json +18 -0
- package/template/meadmin/view/admin/template/components.d.ts +9 -0
- package/template/meadmin/view/admin/template/directives.d.ts +6 -0
- package/template/meadmin/view/admin/template/meIconComponents.d.ts +6 -0
- package/template/meadmin/view/admin/tsconfig.json +33 -0
- package/template/meadmin/view/admin/tsconfig.node.json +17 -0
- package/template/meadmin/view/admin/types/api.d.ts +15 -0
- package/template/meadmin/view/admin/types/auto-imports.d.ts +302 -0
- package/template/meadmin/view/admin/types/global.d.ts +60 -0
- package/template/meadmin/view/admin/types/globalComponents.d.ts +13 -0
- package/template/meadmin/view/admin/types/melIconComponents.d.d.ts +9 -0
- package/template/meadmin/view/admin/types/vue-router.d.ts +39 -0
- package/template/meadmin/view/admin/types/vueCustomProperties .d.ts +6 -0
- package/template/meadmin/view/admin/types/vueExtendType.d.ts +43 -0
- package/template/meadmin/view/admin/vite.config.ts +110 -0
- package/template/meadmin/view/index/.prettierignore +28 -0
- package/template/meadmin/view/index/.prettierrc.cjs +4 -0
- package/template/meadmin/view/index/README.md +84 -0
- package/template/meadmin/view/index/cli/autoImport.ts +3 -0
- package/template/meadmin/view/index/eslint.config.js +91 -0
- package/template/meadmin/view/index/index.html +22 -0
- package/template/meadmin/view/index/packageTemplate.json +122 -0
- package/template/meadmin/view/index/plugins/autoComponents.ts +10 -0
- package/template/meadmin/view/index/plugins/autoImport.ts +64 -0
- package/template/meadmin/view/index/plugins/autoImportApi.ts +14 -0
- package/template/meadmin/view/index/plugins/babel.ts +25 -0
- package/template/meadmin/view/index/plugins/index.ts +103 -0
- package/template/meadmin/view/index/plugins/svgLoader.ts +22 -0
- package/template/meadmin/view/index/plugins/vueSetUpExtend.ts +5 -0
- package/template/meadmin/view/index/public/favicon.ico +0 -0
- package/template/meadmin/view/index/public/logo.png +0 -0
- package/template/meadmin/view/index/public/logo.svg +1 -0
- package/template/meadmin/view/index/src/App.vue +30 -0
- package/template/meadmin/view/index/src/api/api.model.ts +11 -0
- package/template/meadmin/view/index/src/api/file.ts +123 -0
- package/template/meadmin/view/index/src/api/index.ts +25 -0
- package/template/meadmin/view/index/src/api/login.ts +72 -0
- package/template/meadmin/view/index/src/api/user.ts +42 -0
- package/template/meadmin/view/index/src/app.ts +39 -0
- package/template/meadmin/view/index/src/assets/images/404.svg +339 -0
- package/template/meadmin/view/index/src/assets/images/avatar.jpg +0 -0
- package/template/meadmin/view/index/src/components/meButton.vue +34 -0
- package/template/meadmin/view/index/src/components/meDialog/hooks/minMax.ts +166 -0
- package/template/meadmin/view/index/src/components/meDialog/index.vue +86 -0
- package/template/meadmin/view/index/src/components/meNumber.vue +74 -0
- package/template/meadmin/view/index/src/components/meSelectFile/index.vue +92 -0
- package/template/meadmin/view/index/src/components/meSelectFile/meSelectFile.ts +3 -0
- package/template/meadmin/view/index/src/components/meUpAvatar.vue +166 -0
- package/template/meadmin/view/index/src/components/meUpload.vue +111 -0
- package/template/meadmin/view/index/src/components/meVxeTable/components/pagination.vue +67 -0
- package/template/meadmin/view/index/src/components/meVxeTable/directives/resize.ts +31 -0
- package/template/meadmin/view/index/src/components/meVxeTable/index.vue +286 -0
- package/template/meadmin/view/index/src/components/meVxeTable/install.ts +18 -0
- package/template/meadmin/view/index/src/components/meVxeTable/util.ts +11 -0
- package/template/meadmin/view/index/src/components/meWangEditor/index.vue +121 -0
- package/template/meadmin/view/index/src/components/meWangEditor/meWangEditor.scss +24 -0
- package/template/meadmin/view/index/src/components/service/meImageViewer.ts +23 -0
- package/template/meadmin/view/index/src/config/index.ts +2 -0
- package/template/meadmin/view/index/src/config/login.ts +5 -0
- package/template/meadmin/view/index/src/dict/eventEnmu.ts +13 -0
- package/template/meadmin/view/index/src/dict/pageEnum.ts +8 -0
- package/template/meadmin/view/index/src/directives/clickOutside.ts +2 -0
- package/template/meadmin/view/index/src/entry-client.ts +8 -0
- package/template/meadmin/view/index/src/entry-server.ts +83 -0
- package/template/meadmin/view/index/src/env.d.ts +6 -0
- package/template/meadmin/view/index/src/event/index.ts +23 -0
- package/template/meadmin/view/index/src/hooks/actionModel.ts +54 -0
- package/template/meadmin/view/index/src/hooks/core/computedProxy.ts +10 -0
- package/template/meadmin/view/index/src/hooks/index.ts +24 -0
- package/template/meadmin/view/index/src/icons/index.ts +52 -0
- package/template/meadmin/view/index/src/icons/svg/dashboard.svg +5 -0
- package/template/meadmin/view/index/src/icons/svg/moon.svg +5 -0
- package/template/meadmin/view/index/src/icons/svg/size.svg +5 -0
- package/template/meadmin/view/index/src/icons/svg/sunny.svg +5 -0
- package/template/meadmin/view/index/src/icons/svg/translation.svg +5 -0
- package/template/meadmin/view/index/src/layout/default/components/footer.vue +22 -0
- package/template/meadmin/view/index/src/layout/default/components/header/components/menuItem.vue +69 -0
- package/template/meadmin/view/index/src/layout/default/components/header/components/user.vue +55 -0
- package/template/meadmin/view/index/src/layout/default/components/header/index.vue +53 -0
- package/template/meadmin/view/index/src/layout/default/index.vue +63 -0
- package/template/meadmin/view/index/src/layout/default/layout.scss +1 -0
- package/template/meadmin/view/index/src/layout/default/page.vue +11 -0
- package/template/meadmin/view/index/src/layout/layoutRoute.vue +13 -0
- package/template/meadmin/view/index/src/main.ts +28 -0
- package/template/meadmin/view/index/src/router/guard/index.ts +53 -0
- package/template/meadmin/view/index/src/router/index.ts +73 -0
- package/template/meadmin/view/index/src/router/routes/001-index.ts +42 -0
- package/template/meadmin/view/index/src/router/routes/002-demo.ts +12 -0
- package/template/meadmin/view/index/src/router/routes/003-user.ts +27 -0
- package/template/meadmin/view/index/src/router/routes/demo/001-demo.ts +36 -0
- package/template/meadmin/view/index/src/setElGlobel.ts +7 -0
- package/template/meadmin/view/index/src/store/index.ts +11 -0
- package/template/meadmin/view/index/src/store/module.ts +5 -0
- package/template/meadmin/view/index/src/store/modules/global.ts +52 -0
- package/template/meadmin/view/index/src/store/modules/route.ts +20 -0
- package/template/meadmin/view/index/src/store/modules/user.ts +98 -0
- package/template/meadmin/view/index/src/styles/element-plus.scss +40 -0
- package/template/meadmin/view/index/src/styles/index.scss +122 -0
- package/template/meadmin/view/index/src/styles/transition.scss +33 -0
- package/template/meadmin/view/index/src/styles/variables.scss +6 -0
- package/template/meadmin/view/index/src/utils/cookies.ts +59 -0
- package/template/meadmin/view/index/src/utils/fileMd5Work.ts +109 -0
- package/template/meadmin/view/index/src/utils/fileUpload.ts +156 -0
- package/template/meadmin/view/index/src/utils/helper.ts +261 -0
- package/template/meadmin/view/index/src/utils/loading.ts +71 -0
- package/template/meadmin/view/index/src/utils/log.ts +8 -0
- package/template/meadmin/view/index/src/utils/mitt.ts +152 -0
- package/template/meadmin/view/index/src/utils/nProgress.ts +52 -0
- package/template/meadmin/view/index/src/utils/request.ts +182 -0
- package/template/meadmin/view/index/src/utils/server.ts +73 -0
- package/template/meadmin/view/index/src/utils/validate.ts +17 -0
- package/template/meadmin/view/index/src/views/404.vue +50 -0
- package/template/meadmin/view/index/src/views/index/index.vue +137 -0
- package/template/meadmin/view/index/src/views/login/components/login.vue +117 -0
- package/template/meadmin/view/index/src/views/login/components/register.vue +192 -0
- package/template/meadmin/view/index/src/views/login/index.vue +147 -0
- package/template/meadmin/view/index/src/views/promiseError.vue +48 -0
- package/template/meadmin/view/index/src/views/redirect.vue +9 -0
- package/template/meadmin/view/index/src/views/user/components/editPass.vue +83 -0
- package/template/meadmin/view/index/src/views/user/components/userInfo.vue +91 -0
- package/template/meadmin/view/index/src/views/user/index.vue +67 -0
- package/template/meadmin/view/index/template/components.d.ts +9 -0
- package/template/meadmin/view/index/template/directives.d.ts +6 -0
- package/template/meadmin/view/index/template/meIconComponents.d.ts +6 -0
- package/template/meadmin/view/index/tsconfig.json +33 -0
- package/template/meadmin/view/index/tsconfig.node.json +17 -0
- package/template/meadmin/view/index/types/api.d.ts +15 -0
- package/template/meadmin/view/index/types/auto-imports.d.ts +301 -0
- package/template/meadmin/view/index/types/components.d.ts +25 -0
- package/template/meadmin/view/index/types/directives.d.ts +7 -0
- package/template/meadmin/view/index/types/global.d.ts +51 -0
- package/template/meadmin/view/index/types/globalComponents.d.ts +14 -0
- package/template/meadmin/view/index/types/meIconComponents.d.ts +11 -0
- package/template/meadmin/view/index/types/vue-router.d.ts +17 -0
- package/template/meadmin/view/index/types/vueCustomProperties .d.ts +6 -0
- package/template/meadmin/view/index/types/vueExtendType.d.ts +43 -0
- package/template/meadmin/view/index/vite.config.ts +92 -0
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
import dayjs from 'dayjs';
|
|
2
|
+
import { clone, cloneDeep } from 'lodash-es';
|
|
3
|
+
import { VxeTableDefines } from 'vxe-table';
|
|
4
|
+
import { SearchTreeOptions, default as XEUtils } from 'xe-utils';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* 对象中的每个可便利元素按序执行一个由您提供的 reducer 函数,
|
|
8
|
+
* 每一次运行 reducer 会将先前元素的计算结果作为参数传入,
|
|
9
|
+
* 最后将其结果汇总为单个返回值。
|
|
10
|
+
* @param object 用户遍历的对象
|
|
11
|
+
* @param callbackfn “reducer” 函数,包含四个参数:
|
|
12
|
+
* previousValue:上一次调用 callbackFn 时的返回值。在第一次调用时,其值则为 initialValue。
|
|
13
|
+
* currentValue:数组中正在处理的元素。
|
|
14
|
+
* currentKey:数组中正在处理的元素的key。
|
|
15
|
+
* object:用于遍历的d对象。
|
|
16
|
+
* @param initialValue 作为第一次调用 callback 函数时参数 previousValue 的值
|
|
17
|
+
* @returns
|
|
18
|
+
*/
|
|
19
|
+
export function objectRreduce<T, P extends Record<string, any> = Record<string, any>>(
|
|
20
|
+
object: P,
|
|
21
|
+
callbackfn: (previousValue: T, currentValue: P[keyof P], currentKey: string, object: P) => T,
|
|
22
|
+
initialValue: T,
|
|
23
|
+
): T {
|
|
24
|
+
for (const i in object) {
|
|
25
|
+
if (Object.hasOwn(object, i)) {
|
|
26
|
+
initialValue = callbackfn(initialValue, object[i], i, object);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return initialValue;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* 合并对象的value(value必须为数组)
|
|
34
|
+
* @param object
|
|
35
|
+
* @returns
|
|
36
|
+
*/
|
|
37
|
+
export function concatObjectValue<T, P extends Record<string, T[]> = Record<string, T[]>>(object: P) {
|
|
38
|
+
return objectRreduce(
|
|
39
|
+
object,
|
|
40
|
+
(currentValue, previousValue) => {
|
|
41
|
+
return currentValue.concat(previousValue || []);
|
|
42
|
+
},
|
|
43
|
+
[] as T[],
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* 文件名转驼峰
|
|
49
|
+
* @param fileName
|
|
50
|
+
* @param nameTemplate
|
|
51
|
+
* @returns
|
|
52
|
+
*/
|
|
53
|
+
export const fileToHump = function (fileName: string): string {
|
|
54
|
+
const index = fileName.lastIndexOf('.');
|
|
55
|
+
if (index > 0) {
|
|
56
|
+
fileName = fileName.slice(0, index);
|
|
57
|
+
}
|
|
58
|
+
const fileNameArr = fileName.replace(/\\/g, '/').split('/');
|
|
59
|
+
if (fileNameArr[fileNameArr.length - 1] === 'index' || fileNameArr[fileNameArr.length - 1] === 'Index') {
|
|
60
|
+
fileNameArr.pop();
|
|
61
|
+
}
|
|
62
|
+
for (let i = 1, len = fileNameArr.length; i < len; i++) {
|
|
63
|
+
fileNameArr[i] = fileNameArr[i].slice(0, 1).toUpperCase() + fileNameArr[i].slice(1);
|
|
64
|
+
}
|
|
65
|
+
return fileNameArr.join('');
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* 混色
|
|
70
|
+
* @param color1 16进制颜色1
|
|
71
|
+
* @param color2 16进制颜色2
|
|
72
|
+
* @param opacity 透明度0-1
|
|
73
|
+
* @returns
|
|
74
|
+
*/
|
|
75
|
+
export const mixColor = function (color1: string, color2: string, opacity: number) {
|
|
76
|
+
let red1 = parseInt(color1.slice(1, 3), 16);
|
|
77
|
+
let green1 = parseInt(color1.slice(3, 5), 16);
|
|
78
|
+
let blue1 = parseInt(color1.slice(5, 7), 16);
|
|
79
|
+
if (opacity === 0) {
|
|
80
|
+
return [red1, green1, blue1].toString();
|
|
81
|
+
}
|
|
82
|
+
const red2 = parseInt(color2.slice(1, 3), 16);
|
|
83
|
+
const green2 = parseInt(color2.slice(3, 5), 16);
|
|
84
|
+
const blue2 = parseInt(color2.slice(5, 7), 16);
|
|
85
|
+
red1 += Math.round(opacity * (red2 - red1));
|
|
86
|
+
green1 += Math.round(opacity * (green2 - green1));
|
|
87
|
+
blue1 += Math.round(opacity * (blue2 - blue1));
|
|
88
|
+
return '#' + red1.toString(16) + green1.toString(16) + blue1.toString(16);
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* 获取灰阶值 越小颜色越深
|
|
93
|
+
* @param color
|
|
94
|
+
* @returns
|
|
95
|
+
*/
|
|
96
|
+
export const getColorLuma = function (color: string) {
|
|
97
|
+
const red = parseInt(color.slice(1, 3), 16);
|
|
98
|
+
const green = parseInt(color.slice(3, 5), 16);
|
|
99
|
+
const blue = parseInt(color.slice(5, 7), 16);
|
|
100
|
+
return red * 0.299 + green * 0.587 + blue * 0.114;
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* 树形结构搜索
|
|
105
|
+
*/
|
|
106
|
+
type TreeData<Key extends string[]> = {
|
|
107
|
+
[k in Key[number]]: string | number;
|
|
108
|
+
} & { [k: string]: any };
|
|
109
|
+
export const searchTreeTable = function <Key extends string[], T extends TreeData<Key>>(
|
|
110
|
+
searchText: number | string,
|
|
111
|
+
searchProps: Key,
|
|
112
|
+
data: T[],
|
|
113
|
+
options: SearchTreeOptions = { children: 'children' },
|
|
114
|
+
formatStr = (str: string, filterRE: RegExp) => str.replace(filterRE, (match) => `<span class="keyword-lighten">${match}</span>`),
|
|
115
|
+
) {
|
|
116
|
+
const search = XEUtils.toValueString(searchText).trim().toLowerCase();
|
|
117
|
+
if (search) {
|
|
118
|
+
const filterRE = new RegExp(search, 'gi');
|
|
119
|
+
const rest = XEUtils.searchTree(data, (item) => searchProps.some((key) => XEUtils.toValueString(item[key]).toLowerCase().indexOf(search) > -1), options);
|
|
120
|
+
XEUtils.eachTree(
|
|
121
|
+
rest,
|
|
122
|
+
(item) => {
|
|
123
|
+
searchProps.forEach((key: Key[number]) => {
|
|
124
|
+
item[key] = formatStr(XEUtils.toValueString(item[key]), filterRE) as T[Key[number]];
|
|
125
|
+
});
|
|
126
|
+
},
|
|
127
|
+
options,
|
|
128
|
+
);
|
|
129
|
+
return rest;
|
|
130
|
+
}
|
|
131
|
+
return cloneDeep(data);
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* 递归代理对象/数组,响应后触发update方法
|
|
136
|
+
* @param value
|
|
137
|
+
* @param update
|
|
138
|
+
* @returns
|
|
139
|
+
*/
|
|
140
|
+
export const proxyValue = <T extends Record<string | number, any> | any[]>(value: T, update: () => void): T => {
|
|
141
|
+
return new Proxy<T>(value, {
|
|
142
|
+
get: function (obj, prop) {
|
|
143
|
+
if (obj[prop as keyof T] && typeof obj[prop as keyof T] === 'object') {
|
|
144
|
+
return proxyValue(obj[prop as keyof T] as T, update);
|
|
145
|
+
}
|
|
146
|
+
return obj[prop as keyof T];
|
|
147
|
+
},
|
|
148
|
+
set: function (obj, prop, value) {
|
|
149
|
+
const oldV = obj[prop as keyof T];
|
|
150
|
+
obj[prop as keyof T] = value;
|
|
151
|
+
update();
|
|
152
|
+
setTimeout(() => (obj[prop as keyof T] = oldV));
|
|
153
|
+
return true;
|
|
154
|
+
},
|
|
155
|
+
});
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
export type TreeArrayItem<T, C extends string | number> = { [K in C]: TreeArrayItem<T, C>[] } & T;
|
|
159
|
+
/**
|
|
160
|
+
* 数组转为树结构
|
|
161
|
+
* @param arr
|
|
162
|
+
* @param key
|
|
163
|
+
* @param parentKey
|
|
164
|
+
* @param childrenKey
|
|
165
|
+
* @returns
|
|
166
|
+
*/
|
|
167
|
+
export const listToTree = <T extends Record<string, any>>(arr: T[], key: keyof T = 'id' as const, parentKey: keyof T = 'parentId' as const, childrenKey = 'children' as const) => {
|
|
168
|
+
const treeNode = new Map();
|
|
169
|
+
const newArr = clone(arr);
|
|
170
|
+
newArr.forEach((item) => {
|
|
171
|
+
(item as any)[childrenKey] = [];
|
|
172
|
+
treeNode.set(item[key], item);
|
|
173
|
+
});
|
|
174
|
+
const rootArr = [] as Array<TreeArrayItem<T, typeof childrenKey>>;
|
|
175
|
+
arr.forEach((item) => {
|
|
176
|
+
const parentNode = treeNode.get(item[parentKey]);
|
|
177
|
+
if (parentNode) {
|
|
178
|
+
parentNode[childrenKey].push(item);
|
|
179
|
+
} else {
|
|
180
|
+
rootArr.push(treeNode.get(item[key]));
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
return rootArr;
|
|
184
|
+
};
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* 状态转boolean
|
|
188
|
+
* @param status
|
|
189
|
+
* @returns
|
|
190
|
+
*/
|
|
191
|
+
export const statusToBoolean = (status?: 0 | 1 | '0' | '1') => {
|
|
192
|
+
if (status === undefined) {
|
|
193
|
+
return undefined;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
return status == '1';
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* 重置对象值,会改变原对象
|
|
201
|
+
* @param obj
|
|
202
|
+
* @param fromObj
|
|
203
|
+
* @returns
|
|
204
|
+
*/
|
|
205
|
+
export const resetObj = <T extends Record<any, any>>(obj: Record<any, any>, fromObj: T) => {
|
|
206
|
+
Object.keys(obj).forEach((key) => (obj[key] = undefined));
|
|
207
|
+
Object.assign(obj, fromObj);
|
|
208
|
+
return obj as T;
|
|
209
|
+
};
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* 递归去除数组/对象的空值值
|
|
213
|
+
* @param obj
|
|
214
|
+
* @returns
|
|
215
|
+
*/
|
|
216
|
+
export function clearEmptyParam<T extends Record<any, any> | any[]>(obj: T, emptyArr = [null, undefined]) {
|
|
217
|
+
if (Array.isArray(obj)) {
|
|
218
|
+
const newObj = [] as any[];
|
|
219
|
+
obj.forEach((item) => {
|
|
220
|
+
if (emptyArr.includes(item)) {
|
|
221
|
+
return;
|
|
222
|
+
} else if (Array.isArray(item)) {
|
|
223
|
+
newObj.push(clearEmptyParam(item));
|
|
224
|
+
} else if (typeof item === 'object') {
|
|
225
|
+
newObj.push(clearEmptyParam(item));
|
|
226
|
+
} else {
|
|
227
|
+
newObj.push(item);
|
|
228
|
+
}
|
|
229
|
+
});
|
|
230
|
+
return newObj;
|
|
231
|
+
} else {
|
|
232
|
+
const newObj = {} as Record<any, any>;
|
|
233
|
+
Object.keys(obj).forEach((key) => {
|
|
234
|
+
if (emptyArr.includes(obj[key])) {
|
|
235
|
+
return;
|
|
236
|
+
} else if (Array.isArray(obj[key])) {
|
|
237
|
+
newObj[key] = clearEmptyParam(obj[key]);
|
|
238
|
+
} else if (typeof obj[key] === 'object') {
|
|
239
|
+
newObj[key] = clearEmptyParam(obj[key]);
|
|
240
|
+
} else {
|
|
241
|
+
newObj[key] = obj[key];
|
|
242
|
+
}
|
|
243
|
+
});
|
|
244
|
+
return newObj;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
//格式化字符串数据执行
|
|
249
|
+
export function formatterStrExec<T = string | null | undefined>(str: T) {
|
|
250
|
+
return [undefined, null, ''].includes(str as any) ? '--' : str!;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
//格式化字典数据执行
|
|
254
|
+
export function formatterDictExec<D extends Record<string, { value: string | number; label: string }[]>, T = string | null | undefined>(dict: D, field: string, value: T) {
|
|
255
|
+
return formatterStrExec(dict[field]?.find((item) => item.value == value)?.label);
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
//格式化时间数据执行
|
|
259
|
+
export function formatterAtExec(str: string | null | undefined | Date, formatStr = 'YYYY-MM-DD HH:mm:ss') {
|
|
260
|
+
return str ? dayjs(str).format(formatStr) : formatterStrExec(str);
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
//格式化表格数据
|
|
264
|
+
export function formatterStr<T>({ cellValue }: { cellValue: T }) {
|
|
265
|
+
return formatterStrExec<T>(cellValue);
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
//格式化表格时间数据
|
|
269
|
+
export function formatterAt({ cellValue }: { cellValue: string | null | undefined | Date }, formatStr = 'YYYY-MM-DD HH:mm:ss') {
|
|
270
|
+
return cellValue ? dayjs(cellValue).format(formatStr) : formatterStr({ cellValue });
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
//格式化表格字典数据函数
|
|
274
|
+
export function createformatterDictFn<T>(dict: Record<string, { value: string | number; label: string }[]>) {
|
|
275
|
+
//因为ts类型判定不得不断言dict
|
|
276
|
+
return (data: { cellValue: any; column: VxeTableDefines.ColumnInfo<T> }) => {
|
|
277
|
+
return formatterDictExec(dict, data.column.field, data.cellValue);
|
|
278
|
+
};
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
//创建格式化vxe表格对象函数
|
|
282
|
+
export function formatterObjectFn(field: string | ((data: Record<string, any>) => string)) {
|
|
283
|
+
return (data: { cellValue: any }) => {
|
|
284
|
+
return data.cellValue ? formatterStrExec(typeof field === 'string' ? data.cellValue[field] : field(data.cellValue)) : formatterStrExec('');
|
|
285
|
+
};
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
//创建格式化对象函数
|
|
289
|
+
export function formatterObjectExecFn(field: string | ((data: Record<string, any>) => string)) {
|
|
290
|
+
return (data?: Record<string, any> | null) => {
|
|
291
|
+
return data ? formatterStrExec(typeof field === 'string' ? data?.[field] : field(data ?? {})) : formatterStrExec('');
|
|
292
|
+
};
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
//创建格式化数组函数
|
|
296
|
+
export function formatterArrFn(field?: string | ((data: Record<string, any>) => string), delimiter = '、') {
|
|
297
|
+
return (data: { cellValue: any }) => {
|
|
298
|
+
return data.cellValue.map((v: any) => (field ? formatterStrExec(typeof field === 'string' ? v[field] : field(v)) : v)).join(delimiter);
|
|
299
|
+
};
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
//创建格式化数组函数
|
|
303
|
+
export function formatterArrExecFn(field?: string | ((data: Record<string, any>) => string), delimiter = '、') {
|
|
304
|
+
return (data?: any[]) => {
|
|
305
|
+
return (data ?? []).map((v: any) => (field ? formatterStrExec(typeof field === 'string' ? v[field] : field(v)) : v)).join(delimiter);
|
|
306
|
+
};
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
//根据文件名判断是否是图片
|
|
310
|
+
export function isImage(filename?: string) {
|
|
311
|
+
if (!filename) return false;
|
|
312
|
+
const imageExtensions = ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp'];
|
|
313
|
+
const fileExtension = filename.split('.').pop()?.toLowerCase();
|
|
314
|
+
return fileExtension ? imageExtensions.includes(fileExtension) : false;
|
|
315
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { LoadingOptions } from 'element-plus';
|
|
2
|
+
import { throttle } from 'lodash-es';
|
|
3
|
+
const loadingInstance: Record<string, ReturnType<typeof ElLoading.service>> = {};
|
|
4
|
+
class Loading {
|
|
5
|
+
constructor(private execLoading: (options?: LoadingOptions) => void, private execClose: () => void) {
|
|
6
|
+
this.execLoading = execLoading;
|
|
7
|
+
this.execClose = execClose;
|
|
8
|
+
}
|
|
9
|
+
public number = 0;
|
|
10
|
+
public loading(options?: LoadingOptions, number = 1) {
|
|
11
|
+
this.number += number;
|
|
12
|
+
this.execLoading(options);
|
|
13
|
+
}
|
|
14
|
+
public throttleClose = throttle(
|
|
15
|
+
function (this: Loading) {
|
|
16
|
+
if (this.number <= 0) {
|
|
17
|
+
this.execClose();
|
|
18
|
+
this.number = 0;
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
220,
|
|
22
|
+
{ leading: false },
|
|
23
|
+
);
|
|
24
|
+
public close(number = 1) {
|
|
25
|
+
if (this.number > 0) {
|
|
26
|
+
this.number -= Math.min(this.number, number);
|
|
27
|
+
this.throttleClose();
|
|
28
|
+
} else {
|
|
29
|
+
this.forceClose();
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
public forceClose() {
|
|
33
|
+
this.number = 0;
|
|
34
|
+
this.execClose();
|
|
35
|
+
this.throttleClose.cancel();
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export const loadingObject = {
|
|
40
|
+
global: new Loading(
|
|
41
|
+
(options?: LoadingOptions) => (loadingInstance.global = ElLoading.service(options)),
|
|
42
|
+
() => loadingInstance.global?.close(),
|
|
43
|
+
),
|
|
44
|
+
layout: new Loading(
|
|
45
|
+
(options?: LoadingOptions) => (loadingInstance.layout = ElLoading.service(Object.assign({ target: '#me-main-scroll' }, options))),
|
|
46
|
+
() => loadingInstance.layout?.close(),
|
|
47
|
+
),
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export function loading(options?: LoadingOptions, number = 1, mode: keyof typeof loadingObject = 'global') {
|
|
51
|
+
const loading = loadingObject[mode];
|
|
52
|
+
loading.loading(options, number);
|
|
53
|
+
return loading;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export function closeLoading(force = false, number = 1, mode: keyof typeof loadingObject = 'global'): void {
|
|
57
|
+
const loading = loadingObject[mode];
|
|
58
|
+
if (force) {
|
|
59
|
+
loading.forceClose();
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
loading.close(number);
|
|
63
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
warn(message?: string, ...optionalParams: any[]) {
|
|
3
|
+
console.warn(`[meadmin warn]:${message}`, ...optionalParams);
|
|
4
|
+
},
|
|
5
|
+
error(message?: string, ...optionalParams: any[]) {
|
|
6
|
+
console.error(`[meadmin error]:${message}`, ...optionalParams);
|
|
7
|
+
},
|
|
8
|
+
};
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
// 根据开源项目mitt自定义更改
|
|
2
|
+
import EventEnum from '@/dict/eventEnmu';
|
|
3
|
+
import { onUnmounted } from 'vue';
|
|
4
|
+
type EventType = EventEnum;
|
|
5
|
+
|
|
6
|
+
// An event handler can take an optional event argument
|
|
7
|
+
// and should not return a value
|
|
8
|
+
export type Handler<T = unknown> = (event: T) => void | Promise<void>;
|
|
9
|
+
export type WildcardHandler<T = Record<string, unknown>> = (type: keyof T, event: T[keyof T]) => void | Promise<void>;
|
|
10
|
+
|
|
11
|
+
// An array of all currently registered event handlers for a type
|
|
12
|
+
export type EventHandlerList<T = unknown> = Array<Handler<T>>;
|
|
13
|
+
export type WildCardEventHandlerList<T = Record<string, unknown>> = Array<WildcardHandler<T>>;
|
|
14
|
+
|
|
15
|
+
// A map of event types and their corresponding event handlers.
|
|
16
|
+
export type EventHandlerMap<Events extends Record<EventType, unknown>> = Map<keyof Events | '*', EventHandlerList<Events[keyof Events]> | WildCardEventHandlerList<Events>>;
|
|
17
|
+
|
|
18
|
+
export interface Mitter<Events extends Record<EventType, unknown>> {
|
|
19
|
+
all: EventHandlerMap<Events>;
|
|
20
|
+
|
|
21
|
+
once: (<Key extends keyof Events>(type: Key, handler: Handler<Events[Key]>, needUnmounted?: boolean) => void) & ((type: '*', handler: WildcardHandler<Events>, needUnmounted?: boolean) => void);
|
|
22
|
+
|
|
23
|
+
on: (<Key extends keyof Events>(type: Key, handler: Handler<Events[Key]>, needUnmounted?: boolean) => void) & ((type: '*', handler: WildcardHandler<Events>, needUnmounted?: boolean) => void);
|
|
24
|
+
|
|
25
|
+
off: (<Key extends keyof Events>(type: Key, handler?: Handler<Events[Key]>) => void) & ((type: '*', handler: WildcardHandler<Events>) => void);
|
|
26
|
+
|
|
27
|
+
emit: (<Key extends keyof Events>(type: Key, event: Events[Key]) => any[]) & (<Key extends keyof Events>(type: undefined extends Events[Key] ? Key : never) => any[]);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Mitt: Tiny (~200b) functional event emitter / pubsub.
|
|
32
|
+
* @name Mitter
|
|
33
|
+
* @returns {Mitt}
|
|
34
|
+
*/
|
|
35
|
+
export default function mitter<Events extends Record<EventType, unknown>>(all?: EventHandlerMap<Events>, once?: Set<Handler<Events[keyof Events]> | WildcardHandler<Events>>) {
|
|
36
|
+
type GenericEventHandler = Handler<Events[keyof Events]> | WildcardHandler<Events>;
|
|
37
|
+
all = all ?? new Map();
|
|
38
|
+
once = once ?? new Set();
|
|
39
|
+
|
|
40
|
+
return {
|
|
41
|
+
/**
|
|
42
|
+
* A Map of event names to registered handler functions.
|
|
43
|
+
*/
|
|
44
|
+
all,
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Register an once event handler for the given type.
|
|
48
|
+
* @param {string|symbol} type Type of event to listen for, or `'*'` for all events
|
|
49
|
+
* @param {Function} handler Function to call in response to given event
|
|
50
|
+
* @param needUnmounted 是否需要在Unmounted时移除监听
|
|
51
|
+
* @memberOf mitt
|
|
52
|
+
*/
|
|
53
|
+
once<Key extends keyof Events>(type: Key, handler: GenericEventHandler, needUnmounted = false) {
|
|
54
|
+
const handlers: GenericEventHandler[] | undefined = all!.get(type);
|
|
55
|
+
if (handlers) {
|
|
56
|
+
handlers.push(handler);
|
|
57
|
+
} else {
|
|
58
|
+
all!.set(type, [handler] as EventHandlerList<Events[keyof Events]>);
|
|
59
|
+
once!.add(handler as Handler<Events[keyof Events]>);
|
|
60
|
+
}
|
|
61
|
+
needUnmounted &&
|
|
62
|
+
onUnmounted(() => {
|
|
63
|
+
this.off<Key>(type, handler as any);
|
|
64
|
+
});
|
|
65
|
+
},
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Register an event handler for the given type.
|
|
69
|
+
* @param {string|symbol} type Type of event to listen for, or `'*'` for all events
|
|
70
|
+
* @param {Function} handler Function to call in response to given event
|
|
71
|
+
* @param needUnmounted 是否需要在Unmounted时移除监听
|
|
72
|
+
* @memberOf mitt
|
|
73
|
+
*/
|
|
74
|
+
on<Key extends keyof Events>(type: Key, handler: GenericEventHandler, needUnmounted = false) {
|
|
75
|
+
const handlers: GenericEventHandler[] | undefined = all!.get(type);
|
|
76
|
+
if (handlers) {
|
|
77
|
+
handlers.push(handler);
|
|
78
|
+
} else {
|
|
79
|
+
all!.set(type, [handler] as EventHandlerList<Events[keyof Events]>);
|
|
80
|
+
}
|
|
81
|
+
needUnmounted &&
|
|
82
|
+
onUnmounted(() => {
|
|
83
|
+
this.off<Key>(type, handler as any);
|
|
84
|
+
});
|
|
85
|
+
},
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Remove an event handler for the given type.
|
|
89
|
+
* If `handler` is omitted, all handlers of the given type are removed.
|
|
90
|
+
* @param {string|symbol} type Type of event to unregister `handler` from (`'*'` to remove a wildcard handler)
|
|
91
|
+
* @param {Function} [handler] Handler function to remove
|
|
92
|
+
* @memberOf mitt
|
|
93
|
+
*/
|
|
94
|
+
off<Key extends keyof Events>(type: Key, handler?: GenericEventHandler) {
|
|
95
|
+
const handlers: GenericEventHandler[] | undefined = all!.get(type);
|
|
96
|
+
if (handlers) {
|
|
97
|
+
if (handler) {
|
|
98
|
+
handlers.splice(handlers.indexOf(handler) >>> 0, 1);
|
|
99
|
+
once!.delete(handler);
|
|
100
|
+
} else {
|
|
101
|
+
all!.set(type, []);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Invoke all handlers for the given type.(会顺序执行)
|
|
108
|
+
* If present, `'*'` handlers are invoked after type-matched handlers.
|
|
109
|
+
*
|
|
110
|
+
* Note: Manually firing '*' handlers is not supported.
|
|
111
|
+
*
|
|
112
|
+
* @param {string|symbol} type The event type to invoke
|
|
113
|
+
* @param {Any} [evt] Any value (object is recommended and powerful), passed to each handler
|
|
114
|
+
* @memberOf mitt
|
|
115
|
+
*/
|
|
116
|
+
emit<Key extends keyof Events>(type: Key, evt: Events[Key]) {
|
|
117
|
+
let handlers = all!.get(type);
|
|
118
|
+
const result = [];
|
|
119
|
+
if (handlers) {
|
|
120
|
+
handlers = (handlers as EventHandlerList<Events[keyof Events]>).slice();
|
|
121
|
+
for (const handler of handlers) {
|
|
122
|
+
const res = handler(evt);
|
|
123
|
+
if (res instanceof Promise) {
|
|
124
|
+
res.catch((error) => {
|
|
125
|
+
console.error(error);
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
result.push(res);
|
|
129
|
+
if (once!.has(handler)) {
|
|
130
|
+
this.off(type, handler);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
handlers = all!.get('*');
|
|
136
|
+
if (handlers) {
|
|
137
|
+
handlers = (handlers as WildCardEventHandlerList<Events>).slice();
|
|
138
|
+
for (const handler of handlers) {
|
|
139
|
+
const res = handler(type, evt);
|
|
140
|
+
if (res instanceof Promise) {
|
|
141
|
+
res.catch((error) => {
|
|
142
|
+
console.error(error);
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
result.push(res);
|
|
146
|
+
}
|
|
147
|
+
once!.clear();
|
|
148
|
+
}
|
|
149
|
+
return result;
|
|
150
|
+
},
|
|
151
|
+
} as Mitter<Events>;
|
|
152
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import nProgress from 'nprogress';
|
|
2
|
+
let number = 0;
|
|
3
|
+
export const done = (n = 1) => {
|
|
4
|
+
number -= n;
|
|
5
|
+
if (number <= 0) {
|
|
6
|
+
nProgress.done();
|
|
7
|
+
number = 0;
|
|
8
|
+
} else {
|
|
9
|
+
nProgress.set(number / (number + n));
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const start = (n = 1) => {
|
|
14
|
+
if (number <= 0) {
|
|
15
|
+
nProgress.start();
|
|
16
|
+
number = n;
|
|
17
|
+
} else {
|
|
18
|
+
number += n;
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export const set = (n: number) => {
|
|
23
|
+
if (number > 0) {
|
|
24
|
+
nProgress.set(n);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export const remove = () => {
|
|
29
|
+
number = 0;
|
|
30
|
+
nProgress.remove();
|
|
31
|
+
};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import EventEnum from '@/dict/eventEnmu';
|
|
2
|
+
import { mitter } from '@/event';
|
|
3
|
+
import { Layout, LayoutPage } from '@/router/constant';
|
|
4
|
+
import { useUserStore } from '@/store';
|
|
5
|
+
import Page404 from '@/views/404.vue';
|
|
6
|
+
import { DefineComponent } from 'vue';
|
|
7
|
+
import { RouteRecordRaw } from 'vue-router';
|
|
8
|
+
import log from './log';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* 用户是否具有权限
|
|
12
|
+
* @param rules
|
|
13
|
+
* @returns
|
|
14
|
+
*/
|
|
15
|
+
export function permission(rules?: string | string[]) {
|
|
16
|
+
if (!rules) {
|
|
17
|
+
return true;
|
|
18
|
+
}
|
|
19
|
+
if (typeof rules === 'string') {
|
|
20
|
+
rules = [rules];
|
|
21
|
+
}
|
|
22
|
+
return useUserStore().rules!.some((rule) => rule === '*' || rules!.includes(rule));
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export type DynamicViewsModules = Record<string, () => Promise<DefineComponent>>;
|
|
26
|
+
let dynamicViewsModules: DynamicViewsModules;
|
|
27
|
+
export function initDynamicViewsModules() {
|
|
28
|
+
if (!dynamicViewsModules) {
|
|
29
|
+
dynamicViewsModules = import.meta.glob('../views/**/*.{vue,tsx}') as Record<string, () => Promise<DefineComponent>>;
|
|
30
|
+
mitter.emit(EventEnum.INIT_DYNAMIC_VIEWS_MODULES, dynamicViewsModules);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
//动态转换组件
|
|
34
|
+
export function transitionComponent(component: string) {
|
|
35
|
+
if (component === 'Layout') {
|
|
36
|
+
return Layout;
|
|
37
|
+
}
|
|
38
|
+
if (component === 'LayoutPage') {
|
|
39
|
+
return LayoutPage;
|
|
40
|
+
}
|
|
41
|
+
const res = dynamicViewsModules['../views/' + component + '.vue'] || dynamicViewsModules['../views/' + component + '.tsx'];
|
|
42
|
+
if (res) {
|
|
43
|
+
return res;
|
|
44
|
+
} else {
|
|
45
|
+
log.warn('在src/views/下找不到`' + component + '.vue` 或 `' + component + '.tsx`, 请自行创建!');
|
|
46
|
+
return Page404;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* 过滤动态路由
|
|
52
|
+
* @param routes
|
|
53
|
+
* @param activeMenu
|
|
54
|
+
* @param noAuth 不需要校验
|
|
55
|
+
* @returns
|
|
56
|
+
*/
|
|
57
|
+
export function filterAsyncRoutes(routes: RouteRecordRaw[], activeMenu?: string, noAuth = false) {
|
|
58
|
+
const res: RouteRecordRaw[] = [];
|
|
59
|
+
routes.forEach((route) => {
|
|
60
|
+
const tmp = { ...route };
|
|
61
|
+
if (!route.meta || noAuth || permission(route.meta.rule)) {
|
|
62
|
+
if (route.meta?.hideMenu) {
|
|
63
|
+
if (typeof route.meta.activeMenu === 'undefined' && activeMenu) {
|
|
64
|
+
route.meta.activeMenu = activeMenu;
|
|
65
|
+
}
|
|
66
|
+
} else {
|
|
67
|
+
activeMenu = route.meta?.activeMenu ?? route.path;
|
|
68
|
+
}
|
|
69
|
+
if (tmp.children) {
|
|
70
|
+
tmp.children = filterAsyncRoutes(tmp.children, activeMenu, noAuth);
|
|
71
|
+
}
|
|
72
|
+
res.push(tmp);
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
return res;
|
|
76
|
+
}
|