@k3000/s1 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +2 -0
- package/RuoYi-Vue3/.env.development +8 -0
- package/RuoYi-Vue3/.env.production +11 -0
- package/RuoYi-Vue3/.env.staging +11 -0
- package/RuoYi-Vue3/.github/FUNDING.yml +1 -0
- package/RuoYi-Vue3/LICENSE +20 -0
- package/RuoYi-Vue3/README.md +109 -0
- package/RuoYi-Vue3/bin/build.bat +12 -0
- package/RuoYi-Vue3/bin/package.bat +12 -0
- package/RuoYi-Vue3/bin/run-web.bat +12 -0
- package/RuoYi-Vue3/html/ie.html +46 -0
- package/RuoYi-Vue3/index.html +215 -0
- package/RuoYi-Vue3/package.json +44 -0
- package/RuoYi-Vue3/public/favicon.ico +0 -0
- package/RuoYi-Vue3/src/App.vue +15 -0
- package/RuoYi-Vue3/src/api/login.js +60 -0
- package/RuoYi-Vue3/src/api/menu.js +9 -0
- package/RuoYi-Vue3/src/api/monitor/cache.js +57 -0
- package/RuoYi-Vue3/src/api/monitor/job.js +71 -0
- package/RuoYi-Vue3/src/api/monitor/jobLog.js +26 -0
- package/RuoYi-Vue3/src/api/monitor/logininfor.js +34 -0
- package/RuoYi-Vue3/src/api/monitor/online.js +18 -0
- package/RuoYi-Vue3/src/api/monitor/operlog.js +26 -0
- package/RuoYi-Vue3/src/api/monitor/server.js +9 -0
- package/RuoYi-Vue3/src/api/system/config.js +60 -0
- package/RuoYi-Vue3/src/api/system/dept.js +52 -0
- package/RuoYi-Vue3/src/api/system/dict/data.js +52 -0
- package/RuoYi-Vue3/src/api/system/dict/type.js +60 -0
- package/RuoYi-Vue3/src/api/system/menu.js +60 -0
- package/RuoYi-Vue3/src/api/system/notice.js +44 -0
- package/RuoYi-Vue3/src/api/system/post.js +44 -0
- package/RuoYi-Vue3/src/api/system/role.js +119 -0
- package/RuoYi-Vue3/src/api/system/user.js +136 -0
- package/RuoYi-Vue3/src/api/tool/gen.js +85 -0
- package/RuoYi-Vue3/src/assets/401_images/401.gif +0 -0
- package/RuoYi-Vue3/src/assets/404_images/404.png +0 -0
- package/RuoYi-Vue3/src/assets/404_images/404_cloud.png +0 -0
- package/RuoYi-Vue3/src/assets/icons/svg/404.svg +1 -0
- package/RuoYi-Vue3/src/assets/icons/svg/bug.svg +1 -0
- package/RuoYi-Vue3/src/assets/icons/svg/build.svg +1 -0
- package/RuoYi-Vue3/src/assets/icons/svg/button.svg +1 -0
- package/RuoYi-Vue3/src/assets/icons/svg/cascader.svg +1 -0
- package/RuoYi-Vue3/src/assets/icons/svg/chart.svg +1 -0
- package/RuoYi-Vue3/src/assets/icons/svg/checkbox.svg +1 -0
- package/RuoYi-Vue3/src/assets/icons/svg/clipboard.svg +1 -0
- package/RuoYi-Vue3/src/assets/icons/svg/code.svg +1 -0
- package/RuoYi-Vue3/src/assets/icons/svg/color.svg +1 -0
- package/RuoYi-Vue3/src/assets/icons/svg/component.svg +1 -0
- package/RuoYi-Vue3/src/assets/icons/svg/dashboard.svg +1 -0
- package/RuoYi-Vue3/src/assets/icons/svg/date-range.svg +1 -0
- package/RuoYi-Vue3/src/assets/icons/svg/date.svg +1 -0
- package/RuoYi-Vue3/src/assets/icons/svg/dict.svg +1 -0
- package/RuoYi-Vue3/src/assets/icons/svg/documentation.svg +1 -0
- package/RuoYi-Vue3/src/assets/icons/svg/download.svg +1 -0
- package/RuoYi-Vue3/src/assets/icons/svg/drag.svg +1 -0
- package/RuoYi-Vue3/src/assets/icons/svg/druid.svg +1 -0
- package/RuoYi-Vue3/src/assets/icons/svg/edit.svg +1 -0
- package/RuoYi-Vue3/src/assets/icons/svg/education.svg +1 -0
- package/RuoYi-Vue3/src/assets/icons/svg/email.svg +1 -0
- package/RuoYi-Vue3/src/assets/icons/svg/example.svg +1 -0
- package/RuoYi-Vue3/src/assets/icons/svg/excel.svg +1 -0
- package/RuoYi-Vue3/src/assets/icons/svg/exit-fullscreen.svg +1 -0
- package/RuoYi-Vue3/src/assets/icons/svg/eye-open.svg +1 -0
- package/RuoYi-Vue3/src/assets/icons/svg/eye.svg +1 -0
- package/RuoYi-Vue3/src/assets/icons/svg/form.svg +1 -0
- package/RuoYi-Vue3/src/assets/icons/svg/fullscreen.svg +1 -0
- package/RuoYi-Vue3/src/assets/icons/svg/github.svg +1 -0
- package/RuoYi-Vue3/src/assets/icons/svg/guide.svg +1 -0
- package/RuoYi-Vue3/src/assets/icons/svg/icon.svg +1 -0
- package/RuoYi-Vue3/src/assets/icons/svg/input.svg +1 -0
- package/RuoYi-Vue3/src/assets/icons/svg/international.svg +1 -0
- package/RuoYi-Vue3/src/assets/icons/svg/job.svg +1 -0
- package/RuoYi-Vue3/src/assets/icons/svg/language.svg +1 -0
- package/RuoYi-Vue3/src/assets/icons/svg/link.svg +1 -0
- package/RuoYi-Vue3/src/assets/icons/svg/list.svg +1 -0
- package/RuoYi-Vue3/src/assets/icons/svg/lock.svg +1 -0
- package/RuoYi-Vue3/src/assets/icons/svg/log.svg +1 -0
- package/RuoYi-Vue3/src/assets/icons/svg/logininfor.svg +1 -0
- package/RuoYi-Vue3/src/assets/icons/svg/message.svg +1 -0
- package/RuoYi-Vue3/src/assets/icons/svg/money.svg +1 -0
- package/RuoYi-Vue3/src/assets/icons/svg/monitor.svg +2 -0
- package/RuoYi-Vue3/src/assets/icons/svg/nested.svg +1 -0
- package/RuoYi-Vue3/src/assets/icons/svg/number.svg +1 -0
- package/RuoYi-Vue3/src/assets/icons/svg/online.svg +1 -0
- package/RuoYi-Vue3/src/assets/icons/svg/password.svg +1 -0
- package/RuoYi-Vue3/src/assets/icons/svg/pdf.svg +1 -0
- package/RuoYi-Vue3/src/assets/icons/svg/people.svg +1 -0
- package/RuoYi-Vue3/src/assets/icons/svg/peoples.svg +1 -0
- package/RuoYi-Vue3/src/assets/icons/svg/phone.svg +1 -0
- package/RuoYi-Vue3/src/assets/icons/svg/post.svg +1 -0
- package/RuoYi-Vue3/src/assets/icons/svg/qq.svg +1 -0
- package/RuoYi-Vue3/src/assets/icons/svg/question.svg +1 -0
- package/RuoYi-Vue3/src/assets/icons/svg/radio.svg +1 -0
- package/RuoYi-Vue3/src/assets/icons/svg/rate.svg +1 -0
- package/RuoYi-Vue3/src/assets/icons/svg/redis-list.svg +2 -0
- package/RuoYi-Vue3/src/assets/icons/svg/redis.svg +1 -0
- package/RuoYi-Vue3/src/assets/icons/svg/row.svg +1 -0
- package/RuoYi-Vue3/src/assets/icons/svg/search.svg +1 -0
- package/RuoYi-Vue3/src/assets/icons/svg/select.svg +1 -0
- package/RuoYi-Vue3/src/assets/icons/svg/server.svg +1 -0
- package/RuoYi-Vue3/src/assets/icons/svg/shopping.svg +1 -0
- package/RuoYi-Vue3/src/assets/icons/svg/size.svg +1 -0
- package/RuoYi-Vue3/src/assets/icons/svg/skill.svg +1 -0
- package/RuoYi-Vue3/src/assets/icons/svg/slider.svg +1 -0
- package/RuoYi-Vue3/src/assets/icons/svg/star.svg +1 -0
- package/RuoYi-Vue3/src/assets/icons/svg/swagger.svg +1 -0
- package/RuoYi-Vue3/src/assets/icons/svg/switch.svg +1 -0
- package/RuoYi-Vue3/src/assets/icons/svg/system.svg +2 -0
- package/RuoYi-Vue3/src/assets/icons/svg/tab.svg +1 -0
- package/RuoYi-Vue3/src/assets/icons/svg/table.svg +1 -0
- package/RuoYi-Vue3/src/assets/icons/svg/textarea.svg +1 -0
- package/RuoYi-Vue3/src/assets/icons/svg/theme.svg +1 -0
- package/RuoYi-Vue3/src/assets/icons/svg/time-range.svg +1 -0
- package/RuoYi-Vue3/src/assets/icons/svg/time.svg +1 -0
- package/RuoYi-Vue3/src/assets/icons/svg/tool.svg +1 -0
- package/RuoYi-Vue3/src/assets/icons/svg/tree-table.svg +1 -0
- package/RuoYi-Vue3/src/assets/icons/svg/tree.svg +1 -0
- package/RuoYi-Vue3/src/assets/icons/svg/upload.svg +1 -0
- package/RuoYi-Vue3/src/assets/icons/svg/user.svg +1 -0
- package/RuoYi-Vue3/src/assets/icons/svg/validCode.svg +1 -0
- package/RuoYi-Vue3/src/assets/icons/svg/wechat.svg +1 -0
- package/RuoYi-Vue3/src/assets/icons/svg/zip.svg +1 -0
- package/RuoYi-Vue3/src/assets/images/dark.svg +39 -0
- package/RuoYi-Vue3/src/assets/images/light.svg +39 -0
- package/RuoYi-Vue3/src/assets/images/login-background.jpg +0 -0
- package/RuoYi-Vue3/src/assets/images/pay.png +0 -0
- package/RuoYi-Vue3/src/assets/images/profile.jpg +0 -0
- package/RuoYi-Vue3/src/assets/logo/logo.png +0 -0
- package/RuoYi-Vue3/src/assets/styles/btn.scss +99 -0
- package/RuoYi-Vue3/src/assets/styles/element-ui.scss +96 -0
- package/RuoYi-Vue3/src/assets/styles/index.scss +184 -0
- package/RuoYi-Vue3/src/assets/styles/mixin.scss +66 -0
- package/RuoYi-Vue3/src/assets/styles/ruoyi.scss +281 -0
- package/RuoYi-Vue3/src/assets/styles/sidebar.scss +238 -0
- package/RuoYi-Vue3/src/assets/styles/transition.scss +49 -0
- package/RuoYi-Vue3/src/assets/styles/variables.module.scss +65 -0
- package/RuoYi-Vue3/src/components/Breadcrumb/index.vue +66 -0
- package/RuoYi-Vue3/src/components/Crontab/day.vue +174 -0
- package/RuoYi-Vue3/src/components/Crontab/hour.vue +133 -0
- package/RuoYi-Vue3/src/components/Crontab/index.vue +310 -0
- package/RuoYi-Vue3/src/components/Crontab/min.vue +126 -0
- package/RuoYi-Vue3/src/components/Crontab/month.vue +141 -0
- package/RuoYi-Vue3/src/components/Crontab/result.vue +540 -0
- package/RuoYi-Vue3/src/components/Crontab/second.vue +128 -0
- package/RuoYi-Vue3/src/components/Crontab/week.vue +197 -0
- package/RuoYi-Vue3/src/components/Crontab/year.vue +149 -0
- package/RuoYi-Vue3/src/components/DictTag/index.vue +82 -0
- package/RuoYi-Vue3/src/components/Editor/index.vue +251 -0
- package/RuoYi-Vue3/src/components/FileUpload/index.vue +207 -0
- package/RuoYi-Vue3/src/components/Hamburger/index.vue +41 -0
- package/RuoYi-Vue3/src/components/HeaderSearch/index.vue +187 -0
- package/RuoYi-Vue3/src/components/IconSelect/index.vue +111 -0
- package/RuoYi-Vue3/src/components/IconSelect/requireIcons.js +8 -0
- package/RuoYi-Vue3/src/components/ImagePreview/index.vue +92 -0
- package/RuoYi-Vue3/src/components/ImageUpload/index.vue +213 -0
- package/RuoYi-Vue3/src/components/Pagination/index.vue +105 -0
- package/RuoYi-Vue3/src/components/ParentView/index.vue +3 -0
- package/RuoYi-Vue3/src/components/RightToolbar/index.vue +134 -0
- package/RuoYi-Vue3/src/components/RuoYi/Doc/index.vue +13 -0
- package/RuoYi-Vue3/src/components/RuoYi/Git/index.vue +13 -0
- package/RuoYi-Vue3/src/components/Screenfull/index.vue +22 -0
- package/RuoYi-Vue3/src/components/SizeSelect/index.vue +45 -0
- package/RuoYi-Vue3/src/components/SvgIcon/index.vue +53 -0
- package/RuoYi-Vue3/src/components/SvgIcon/svgicon.js +10 -0
- package/RuoYi-Vue3/src/components/TopNav/index.vue +214 -0
- package/RuoYi-Vue3/src/components/TreeSelect/index.vue +156 -0
- package/RuoYi-Vue3/src/components/iFrame/index.vue +31 -0
- package/RuoYi-Vue3/src/directive/common/copyText.js +66 -0
- package/RuoYi-Vue3/src/directive/index.js +9 -0
- package/RuoYi-Vue3/src/directive/permission/hasPermi.js +28 -0
- package/RuoYi-Vue3/src/directive/permission/hasRole.js +28 -0
- package/RuoYi-Vue3/src/layout/components/AppMain.vue +68 -0
- package/RuoYi-Vue3/src/layout/components/IframeToggle/index.vue +25 -0
- package/RuoYi-Vue3/src/layout/components/InnerLink/index.vue +24 -0
- package/RuoYi-Vue3/src/layout/components/Navbar.vue +191 -0
- package/RuoYi-Vue3/src/layout/components/Settings/index.vue +209 -0
- package/RuoYi-Vue3/src/layout/components/Sidebar/Link.vue +40 -0
- package/RuoYi-Vue3/src/layout/components/Sidebar/Logo.vue +81 -0
- package/RuoYi-Vue3/src/layout/components/Sidebar/SidebarItem.vue +102 -0
- package/RuoYi-Vue3/src/layout/components/Sidebar/index.vue +54 -0
- package/RuoYi-Vue3/src/layout/components/TagsView/ScrollPane.vue +107 -0
- package/RuoYi-Vue3/src/layout/components/TagsView/index.vue +358 -0
- package/RuoYi-Vue3/src/layout/components/index.js +4 -0
- package/RuoYi-Vue3/src/layout/index.vue +114 -0
- package/RuoYi-Vue3/src/main.js +84 -0
- package/RuoYi-Vue3/src/permission.js +65 -0
- package/RuoYi-Vue3/src/plugins/auth.js +60 -0
- package/RuoYi-Vue3/src/plugins/cache.js +77 -0
- package/RuoYi-Vue3/src/plugins/download.js +79 -0
- package/RuoYi-Vue3/src/plugins/index.js +18 -0
- package/RuoYi-Vue3/src/plugins/modal.js +82 -0
- package/RuoYi-Vue3/src/plugins/tab.js +69 -0
- package/RuoYi-Vue3/src/router/index.js +175 -0
- package/RuoYi-Vue3/src/settings.js +47 -0
- package/RuoYi-Vue3/src/store/index.js +3 -0
- package/RuoYi-Vue3/src/store/modules/app.js +46 -0
- package/RuoYi-Vue3/src/store/modules/dict.js +57 -0
- package/RuoYi-Vue3/src/store/modules/permission.js +142 -0
- package/RuoYi-Vue3/src/store/modules/settings.js +38 -0
- package/RuoYi-Vue3/src/store/modules/tagsView.js +182 -0
- package/RuoYi-Vue3/src/store/modules/user.js +72 -0
- package/RuoYi-Vue3/src/utils/auth.js +15 -0
- package/RuoYi-Vue3/src/utils/dict.js +24 -0
- package/RuoYi-Vue3/src/utils/dynamicTitle.js +15 -0
- package/RuoYi-Vue3/src/utils/errorCode.js +6 -0
- package/RuoYi-Vue3/src/utils/index.js +390 -0
- package/RuoYi-Vue3/src/utils/jsencrypt.js +30 -0
- package/RuoYi-Vue3/src/utils/permission.js +51 -0
- package/RuoYi-Vue3/src/utils/request.js +152 -0
- package/RuoYi-Vue3/src/utils/ruoyi.js +246 -0
- package/RuoYi-Vue3/src/utils/scroll-to.js +58 -0
- package/RuoYi-Vue3/src/utils/theme.js +49 -0
- package/RuoYi-Vue3/src/utils/validate.js +93 -0
- package/RuoYi-Vue3/src/views/error/401.vue +82 -0
- package/RuoYi-Vue3/src/views/error/404.vue +227 -0
- package/RuoYi-Vue3/src/views/index.vue +1092 -0
- package/RuoYi-Vue3/src/views/login.vue +227 -0
- package/RuoYi-Vue3/src/views/monitor/cache/index.vue +132 -0
- package/RuoYi-Vue3/src/views/monitor/cache/list.vue +246 -0
- package/RuoYi-Vue3/src/views/monitor/druid/index.vue +13 -0
- package/RuoYi-Vue3/src/views/monitor/job/index.vue +501 -0
- package/RuoYi-Vue3/src/views/monitor/job/log.vue +283 -0
- package/RuoYi-Vue3/src/views/monitor/logininfor/index.vue +233 -0
- package/RuoYi-Vue3/src/views/monitor/online/index.vue +109 -0
- package/RuoYi-Vue3/src/views/monitor/operlog/index.vue +310 -0
- package/RuoYi-Vue3/src/views/monitor/server/index.vue +187 -0
- package/RuoYi-Vue3/src/views/redirect/index.vue +14 -0
- package/RuoYi-Vue3/src/views/register.vue +219 -0
- package/RuoYi-Vue3/src/views/system/config/index.vue +316 -0
- package/RuoYi-Vue3/src/views/system/dept/index.vue +283 -0
- package/RuoYi-Vue3/src/views/system/dict/data.vue +362 -0
- package/RuoYi-Vue3/src/views/system/dict/index.vue +323 -0
- package/RuoYi-Vue3/src/views/system/menu/index.vue +452 -0
- package/RuoYi-Vue3/src/views/system/notice/index.vue +292 -0
- package/RuoYi-Vue3/src/views/system/post/index.vue +287 -0
- package/RuoYi-Vue3/src/views/system/role/authUser.vue +179 -0
- package/RuoYi-Vue3/src/views/system/role/index.vue +584 -0
- package/RuoYi-Vue3/src/views/system/role/selectUser.vue +144 -0
- package/RuoYi-Vue3/src/views/system/user/authRole.vue +116 -0
- package/RuoYi-Vue3/src/views/system/user/index.vue +635 -0
- package/RuoYi-Vue3/src/views/system/user/profile/index.vue +87 -0
- package/RuoYi-Vue3/src/views/system/user/profile/resetPwd.vue +59 -0
- package/RuoYi-Vue3/src/views/system/user/profile/userAvatar.vue +180 -0
- package/RuoYi-Vue3/src/views/system/user/profile/userInfo.vue +67 -0
- package/RuoYi-Vue3/src/views/tool/build/index.vue +3 -0
- package/RuoYi-Vue3/src/views/tool/gen/basicInfoForm.vue +48 -0
- package/RuoYi-Vue3/src/views/tool/gen/createTable.vue +46 -0
- package/RuoYi-Vue3/src/views/tool/gen/editTable.vue +200 -0
- package/RuoYi-Vue3/src/views/tool/gen/genInfoForm.vue +306 -0
- package/RuoYi-Vue3/src/views/tool/gen/importTable.vue +126 -0
- package/RuoYi-Vue3/src/views/tool/gen/index.vue +310 -0
- package/RuoYi-Vue3/src/views/tool/swagger/index.vue +9 -0
- package/RuoYi-Vue3/vite/plugins/auto-import.js +12 -0
- package/RuoYi-Vue3/vite/plugins/compression.js +28 -0
- package/RuoYi-Vue3/vite/plugins/index.js +15 -0
- package/RuoYi-Vue3/vite/plugins/setup-extend.js +5 -0
- package/RuoYi-Vue3/vite/plugins/svg-icon.js +10 -0
- package/RuoYi-Vue3/vite.config.js +58 -0
- package/admin/README.MD +0 -0
- package/admin/base.mjs +447 -0
- package/admin/index.mjs +19 -0
- package/admin/monitor/job.mjs +24 -0
- package/admin/monitor/jobLog.mjs +8 -0
- package/admin/monitor/logininfor.mjs +23 -0
- package/admin/monitor/operlog.mjs +9 -0
- package/admin/monitor/server.mjs +54 -0
- package/admin/service.mjs +10 -0
- package/admin/system/component.mjs +16 -0
- package/admin/system/config.mjs +8 -0
- package/admin/system/dept.mjs +24 -0
- package/admin/system/dict.mjs +34 -0
- package/admin/system/login.mjs +119 -0
- package/admin/system/menu.mjs +33 -0
- package/admin/system/notice.mjs +8 -0
- package/admin/system/path.mjs +53 -0
- package/admin/system/post.mjs +8 -0
- package/admin/system/role.mjs +105 -0
- package/admin/system/user.mjs +93 -0
- package/admin/tool/gen.mjs +95 -0
- package/admin/tool/helper.mjs +1335 -0
- package/admin/tool/pm2.mjs +71 -0
- package/admin/tool/store.mjs +84 -0
- package/admin/tool/upload.mjs +112 -0
- package/app/README.MD +0 -0
- package/app/index.mjs +9 -0
- package/bin.mjs +211 -0
- package/build.mjs +25 -0
- package/common/README.MD +0 -0
- package/common/config.mjs +40 -0
- package/common/pm2.mjs +145 -0
- package/common/service.mjs +79 -0
- package/common/service0.mjs +468 -0
- package/common/tools.mjs +314 -0
- package/common/type.ts +498 -0
- package/file/README.MD +0 -0
- package/files/.env.production +11 -0
- package/files/gen.js +76 -0
- package/files/genImportTable.vue +120 -0
- package/files/genIndex.vue +309 -0
- package/files/genInfoForm.vue +302 -0
- package/files/login.vue +237 -0
- package/files/menu.js +68 -0
- package/files/menuIndex.vue +447 -0
- package/files/pm2.js +88 -0
- package/files/pm2Data.vue +335 -0
- package/files/pm2Index.vue +343 -0
- package/files/routerIndex.js +204 -0
- package/files/serverIndex.vue +215 -0
- package/files/store.js +96 -0
- package/files/storeData.vue +294 -0
- package/files/storeIndex.vue +245 -0
- package/files/upload.js +47 -0
- package/files/uploadIndex.vue +240 -0
- package/files/vite.config.js +58 -0
- package/index.mjs +28 -0
- package/jwt/README.MD +12 -0
- package/jwt/index.mjs +17 -0
- package/package.json +22 -0
- package/proxy/README.MD +0 -0
- package/proxy/index.mjs +16 -0
- package/static/README.MD +0 -0
- package/static/admin/assets/401-CYieuz9-.js +1 -0
- package/static/admin/assets/401-CYieuz9-.js.gz +0 -0
- package/static/admin/assets/401-DmT2Eyz6.css +1 -0
- package/static/admin/assets/401-HGF6Q5qM.gif +0 -0
- package/static/admin/assets/404-DFv5Zpvm.js +1 -0
- package/static/admin/assets/404-DFv5Zpvm.js.gz +0 -0
- package/static/admin/assets/404-Dy3nURRX.js +1 -0
- package/static/admin/assets/404-Dy3nURRX.js.gz +0 -0
- package/static/admin/assets/404-N4aRkdWY.png +0 -0
- package/static/admin/assets/404-uZCOR2Ze.css +1 -0
- package/static/admin/assets/404-uZCOR2Ze.css.gz +0 -0
- package/static/admin/assets/404_cloud-CPexjtDj.png +0 -0
- package/static/admin/assets/authRole-ma37t91O.js +1 -0
- package/static/admin/assets/authRole-ma37t91O.js.gz +0 -0
- package/static/admin/assets/authUser-C2Y6gkW3.js +1 -0
- package/static/admin/assets/authUser-C2Y6gkW3.js.gz +0 -0
- package/static/admin/assets/basicInfoForm-Cqv-g0Vq.js +1 -0
- package/static/admin/assets/basicInfoForm-Cqv-g0Vq.js.gz +0 -0
- package/static/admin/assets/bug-10dePVta.js +1 -0
- package/static/admin/assets/bug-10dePVta.js.gz +0 -0
- package/static/admin/assets/build-2jMyI6eP.js +1 -0
- package/static/admin/assets/build-2jMyI6eP.js.gz +0 -0
- package/static/admin/assets/button-BlSCM_GH.js +1 -0
- package/static/admin/assets/button-BlSCM_GH.js.gz +0 -0
- package/static/admin/assets/cache-CRGI5LFU.js +1 -0
- package/static/admin/assets/cascader-CXIOcY1C.js +1 -0
- package/static/admin/assets/cascader-CXIOcY1C.js.gz +0 -0
- package/static/admin/assets/chart-BsLMrzXU.js +1 -0
- package/static/admin/assets/checkbox-Bpiun3bf.js +1 -0
- package/static/admin/assets/checkbox-Bpiun3bf.js.gz +0 -0
- package/static/admin/assets/clipboard-DaV3cn7f.js +1 -0
- package/static/admin/assets/clipboard-DaV3cn7f.js.gz +0 -0
- package/static/admin/assets/code-DgJ8cT4a.js +1 -0
- package/static/admin/assets/color-y1Sshoou.js +1 -0
- package/static/admin/assets/color-y1Sshoou.js.gz +0 -0
- package/static/admin/assets/component-Djp9s69L.js +1 -0
- package/static/admin/assets/component-Djp9s69L.js.gz +0 -0
- package/static/admin/assets/createTable-CpixhIJI.js +1 -0
- package/static/admin/assets/createTable-CpixhIJI.js.gz +0 -0
- package/static/admin/assets/dashboard-Dy7qt_a2.js +1 -0
- package/static/admin/assets/dashboard-Dy7qt_a2.js.gz +0 -0
- package/static/admin/assets/data-B6ExfNCI.js +1 -0
- package/static/admin/assets/data-B6ExfNCI.js.gz +0 -0
- package/static/admin/assets/data-BNwnwlkO.js +34 -0
- package/static/admin/assets/data-BNwnwlkO.js.gz +0 -0
- package/static/admin/assets/data-C3FuPwta.css +1 -0
- package/static/admin/assets/data-DmSA0HcO.js +1 -0
- package/static/admin/assets/data-DmSA0HcO.js.gz +0 -0
- package/static/admin/assets/date-B1FSITvi.js +1 -0
- package/static/admin/assets/date-B1FSITvi.js.gz +0 -0
- package/static/admin/assets/date-range-B8MgYLb1.js +1 -0
- package/static/admin/assets/date-range-B8MgYLb1.js.gz +0 -0
- package/static/admin/assets/dict-Bi_GqSXR.js +1 -0
- package/static/admin/assets/dict-Bi_GqSXR.js.gz +0 -0
- package/static/admin/assets/documentation-uH9BvL5U.js +1 -0
- package/static/admin/assets/download-DeIzgQWH.js +1 -0
- package/static/admin/assets/download-DeIzgQWH.js.gz +0 -0
- package/static/admin/assets/drag-BG1_I1vT.js +1 -0
- package/static/admin/assets/druid-BybW_S_B.js +1 -0
- package/static/admin/assets/edit-D0DI9pAq.js +1 -0
- package/static/admin/assets/editTable-zr5bdAM7.js +1 -0
- package/static/admin/assets/editTable-zr5bdAM7.js.gz +0 -0
- package/static/admin/assets/education-47KsSYIl.js +1 -0
- package/static/admin/assets/email-Dig28Vt2.js +1 -0
- package/static/admin/assets/example-CnLLAFb9.js +1 -0
- package/static/admin/assets/excel-D3hj5F35.js +1 -0
- package/static/admin/assets/exit-fullscreen-dXhGKlQm.js +1 -0
- package/static/admin/assets/exit-fullscreen-dXhGKlQm.js.gz +0 -0
- package/static/admin/assets/eye-DqRz4sMZ.js +1 -0
- package/static/admin/assets/eye-DqRz4sMZ.js.gz +0 -0
- package/static/admin/assets/eye-open-BxlshWqB.js +1 -0
- package/static/admin/assets/eye-open-BxlshWqB.js.gz +0 -0
- package/static/admin/assets/form-BDTA_i-I.js +1 -0
- package/static/admin/assets/form-BDTA_i-I.js.gz +0 -0
- package/static/admin/assets/fullscreen-0JHt5yWX.js +1 -0
- package/static/admin/assets/gen-DLNrNhtb.js +1 -0
- package/static/admin/assets/genInfoForm-CMDsV5QX.js +1 -0
- package/static/admin/assets/genInfoForm-CMDsV5QX.js.gz +0 -0
- package/static/admin/assets/github-AJ0WQBa2.js +1 -0
- package/static/admin/assets/github-AJ0WQBa2.js.gz +0 -0
- package/static/admin/assets/guide-DZWUPi2j.js +1 -0
- package/static/admin/assets/icon-BtMv6Od8.js +1 -0
- package/static/admin/assets/icon-BtMv6Od8.js.gz +0 -0
- package/static/admin/assets/importTable-BsBsGfWB.js +1 -0
- package/static/admin/assets/importTable-BsBsGfWB.js.gz +0 -0
- package/static/admin/assets/index-1Gtzb1EG.css +1 -0
- package/static/admin/assets/index-1Gtzb1EG.css.gz +0 -0
- package/static/admin/assets/index-22TxXV_H.js +1 -0
- package/static/admin/assets/index-2PS_9Njt.js +1 -0
- package/static/admin/assets/index-2PS_9Njt.js.gz +0 -0
- package/static/admin/assets/index-2QWdVCKT.js +1 -0
- package/static/admin/assets/index-BH2yis6M.js +1 -0
- package/static/admin/assets/index-BYiWbDzj.js +137 -0
- package/static/admin/assets/index-BYiWbDzj.js.gz +0 -0
- package/static/admin/assets/index-BcoIBYYg.js +1 -0
- package/static/admin/assets/index-BcoIBYYg.js.gz +0 -0
- package/static/admin/assets/index-BdfyYxZX.css +1 -0
- package/static/admin/assets/index-BdfyYxZX.css.gz +0 -0
- package/static/admin/assets/index-BpFFXMK5.js +1 -0
- package/static/admin/assets/index-BpFFXMK5.js.gz +0 -0
- package/static/admin/assets/index-CKPU_AaL.js +1 -0
- package/static/admin/assets/index-CKPU_AaL.js.gz +0 -0
- package/static/admin/assets/index-CXsykB0X.js +1 -0
- package/static/admin/assets/index-CXsykB0X.js.gz +0 -0
- package/static/admin/assets/index-CfHRKVJR.js +1 -0
- package/static/admin/assets/index-CfHRKVJR.js.gz +0 -0
- package/static/admin/assets/index-ChrWcM7o.js +1 -0
- package/static/admin/assets/index-ChrWcM7o.js.gz +0 -0
- package/static/admin/assets/index-CyGqJLpz.css +1 -0
- package/static/admin/assets/index-Czuq8j-W.js +1 -0
- package/static/admin/assets/index-D5kEXJN3.js +1 -0
- package/static/admin/assets/index-D5kEXJN3.js.gz +0 -0
- package/static/admin/assets/index-D7sjRL--.js +1 -0
- package/static/admin/assets/index-D7sjRL--.js.gz +0 -0
- package/static/admin/assets/index-D9JRAPr4.js +1 -0
- package/static/admin/assets/index-D9JRAPr4.js.gz +0 -0
- package/static/admin/assets/index-DADWjT7Y.js +1 -0
- package/static/admin/assets/index-DADWjT7Y.js.gz +0 -0
- package/static/admin/assets/index-DUTtT4NU.js +1 -0
- package/static/admin/assets/index-DUTtT4NU.js.gz +0 -0
- package/static/admin/assets/index-DZR__uIb.js +1 -0
- package/static/admin/assets/index-DZR__uIb.js.gz +0 -0
- package/static/admin/assets/index-Da2r8G2b.js +1 -0
- package/static/admin/assets/index-Da2r8G2b.js.gz +0 -0
- package/static/admin/assets/index-DakybE_b.js +1 -0
- package/static/admin/assets/index-DakybE_b.js.gz +0 -0
- package/static/admin/assets/index-DdnU2rJ0.css +1 -0
- package/static/admin/assets/index-H21xXZr5.js +60 -0
- package/static/admin/assets/index-H21xXZr5.js.gz +0 -0
- package/static/admin/assets/index-PGDGQEbD.js +1 -0
- package/static/admin/assets/index-PGDGQEbD.js.gz +0 -0
- package/static/admin/assets/index-Rm6qYhrO.js +1 -0
- package/static/admin/assets/index-VG6ZkdYt.js +1 -0
- package/static/admin/assets/index-VG6ZkdYt.js.gz +0 -0
- package/static/admin/assets/index-YVnsjgTq.js +1 -0
- package/static/admin/assets/index-YVnsjgTq.js.gz +0 -0
- package/static/admin/assets/index-t3XJ47us.css +1 -0
- package/static/admin/assets/index-t3XJ47us.css.gz +0 -0
- package/static/admin/assets/index-xfai-fRy.js +1 -0
- package/static/admin/assets/index-xfai-fRy.js.gz +0 -0
- package/static/admin/assets/input-BJoPMnBW.js +1 -0
- package/static/admin/assets/international-CmzG1OHg.js +1 -0
- package/static/admin/assets/international-CmzG1OHg.js.gz +0 -0
- package/static/admin/assets/job-BcmuINx7.js +1 -0
- package/static/admin/assets/job-BcmuINx7.js.gz +0 -0
- package/static/admin/assets/job-COdMvNx2.js +1 -0
- package/static/admin/assets/language-CaW1LMEk.js +1 -0
- package/static/admin/assets/language-CaW1LMEk.js.gz +0 -0
- package/static/admin/assets/link-C93f4PgI.js +1 -0
- package/static/admin/assets/list-C7O8B4zW.js +1 -0
- package/static/admin/assets/list-C7O8B4zW.js.gz +0 -0
- package/static/admin/assets/list-DUaPnccL.js +1 -0
- package/static/admin/assets/list-DUaPnccL.js.gz +0 -0
- package/static/admin/assets/lock-Bexeb9hp.js +1 -0
- package/static/admin/assets/log-CF2F-nSs.js +1 -0
- package/static/admin/assets/log-CF2F-nSs.js.gz +0 -0
- package/static/admin/assets/log-g6qirYnf.js +1 -0
- package/static/admin/assets/log-g6qirYnf.js.gz +0 -0
- package/static/admin/assets/login-1ezV0PC1.css +1 -0
- package/static/admin/assets/login-1ezV0PC1.css.gz +0 -0
- package/static/admin/assets/login-BnkuYS6J.js +22 -0
- package/static/admin/assets/login-BnkuYS6J.js.gz +0 -0
- package/static/admin/assets/login-background-Yn3y1TP_.jpg +0 -0
- package/static/admin/assets/logininfor-Bm9ZYYR7.js +1 -0
- package/static/admin/assets/logininfor-Bm9ZYYR7.js.gz +0 -0
- package/static/admin/assets/logo-BjsPc2xl.png +0 -0
- package/static/admin/assets/menu-BIu3IsSF.js +1 -0
- package/static/admin/assets/message-UkR-VIBB.js +1 -0
- package/static/admin/assets/money-B1qqPuhn.js +1 -0
- package/static/admin/assets/monitor-gwnnVq4l.js +1 -0
- package/static/admin/assets/monitor-gwnnVq4l.js.gz +0 -0
- package/static/admin/assets/nested-B4d5u3hW.js +1 -0
- package/static/admin/assets/number-D4hB_nHC.js +1 -0
- package/static/admin/assets/number-D4hB_nHC.js.gz +0 -0
- package/static/admin/assets/online-C2ZP8pdY.js +1 -0
- package/static/admin/assets/online-C2ZP8pdY.js.gz +0 -0
- package/static/admin/assets/password-DfGvqQpB.js +1 -0
- package/static/admin/assets/password-DfGvqQpB.js.gz +0 -0
- package/static/admin/assets/pay-2ZbgPnxn.png +0 -0
- package/static/admin/assets/pdf-CD9mOGjJ.js +1 -0
- package/static/admin/assets/pdf-CD9mOGjJ.js.gz +0 -0
- package/static/admin/assets/people-CdGMHN63.js +1 -0
- package/static/admin/assets/people-CdGMHN63.js.gz +0 -0
- package/static/admin/assets/peoples-BRYsIqmI.js +1 -0
- package/static/admin/assets/phone-BpAUIz0g.js +1 -0
- package/static/admin/assets/phone-BpAUIz0g.js.gz +0 -0
- package/static/admin/assets/pm2-BkmkkE2A.js +1 -0
- package/static/admin/assets/post-DrLDyPY9.js +1 -0
- package/static/admin/assets/post-DrLDyPY9.js.gz +0 -0
- package/static/admin/assets/profile-DruvkrZU.jpg +0 -0
- package/static/admin/assets/qq-D8j4O83Y.js +1 -0
- package/static/admin/assets/qq-D8j4O83Y.js.gz +0 -0
- package/static/admin/assets/question-CvYWQbyW.js +1 -0
- package/static/admin/assets/question-CvYWQbyW.js.gz +0 -0
- package/static/admin/assets/radio-B0t9wPBQ.js +1 -0
- package/static/admin/assets/radio-B0t9wPBQ.js.gz +0 -0
- package/static/admin/assets/rate-CgnHQvKS.js +1 -0
- package/static/admin/assets/rate-CgnHQvKS.js.gz +0 -0
- package/static/admin/assets/redis-D4ECyT6a.js +1 -0
- package/static/admin/assets/redis-D4ECyT6a.js.gz +0 -0
- package/static/admin/assets/redis-list-BtKGPnqO.js +1 -0
- package/static/admin/assets/redis-list-BtKGPnqO.js.gz +0 -0
- package/static/admin/assets/register-B9RmZvjt.js +1 -0
- package/static/admin/assets/register-B9RmZvjt.js.gz +0 -0
- package/static/admin/assets/register-n3u7gqca.css +1 -0
- package/static/admin/assets/resetPwd-M0EIDnQk.js +1 -0
- package/static/admin/assets/resetPwd-M0EIDnQk.js.gz +0 -0
- package/static/admin/assets/role-XbHkNxnW.js +1 -0
- package/static/admin/assets/role-XbHkNxnW.js.gz +0 -0
- package/static/admin/assets/row-CRXKIHjm.js +1 -0
- package/static/admin/assets/row-CRXKIHjm.js.gz +0 -0
- package/static/admin/assets/search-CUfclCsR.js +1 -0
- package/static/admin/assets/select-DhuHHMxz.js +1 -0
- package/static/admin/assets/select-DhuHHMxz.js.gz +0 -0
- package/static/admin/assets/selectUser-DA_rE9J_.js +1 -0
- package/static/admin/assets/selectUser-DA_rE9J_.js.gz +0 -0
- package/static/admin/assets/server-unS7EyF7.js +1 -0
- package/static/admin/assets/shopping-CU1IRvxM.js +1 -0
- package/static/admin/assets/shopping-CU1IRvxM.js.gz +0 -0
- package/static/admin/assets/size-Cj9fB5Rp.js +1 -0
- package/static/admin/assets/skill-B8f_I4m_.js +1 -0
- package/static/admin/assets/skill-B8f_I4m_.js.gz +0 -0
- package/static/admin/assets/slider-BGfehM6X.js +1 -0
- package/static/admin/assets/star-kST8a72V.js +1 -0
- package/static/admin/assets/store-CX7IRN8X.js +1 -0
- package/static/admin/assets/swagger-BHGXZ2Jt.js +1 -0
- package/static/admin/assets/swagger-BHGXZ2Jt.js.gz +0 -0
- package/static/admin/assets/switch-CvaargRJ.js +1 -0
- package/static/admin/assets/system-DcNSH_Fq.js +1 -0
- package/static/admin/assets/system-DcNSH_Fq.js.gz +0 -0
- package/static/admin/assets/tab-nA3f0aBt.js +1 -0
- package/static/admin/assets/table-5PRh60AQ.js +1 -0
- package/static/admin/assets/test-CEJIIaDM.js +1 -0
- package/static/admin/assets/test-CEJIIaDM.js.gz +0 -0
- package/static/admin/assets/textarea-CJWXlgbJ.js +1 -0
- package/static/admin/assets/theme-CyGq941x.js +1 -0
- package/static/admin/assets/time-BVERp0sU.js +1 -0
- package/static/admin/assets/time-BVERp0sU.js.gz +0 -0
- package/static/admin/assets/time-range-D3dxgtLj.js +1 -0
- package/static/admin/assets/time-range-D3dxgtLj.js.gz +0 -0
- package/static/admin/assets/tool-D8kXk1l-.js +1 -0
- package/static/admin/assets/tool-D8kXk1l-.js.gz +0 -0
- package/static/admin/assets/tree-BCtS3oPD.js +1 -0
- package/static/admin/assets/tree-BCtS3oPD.js.gz +0 -0
- package/static/admin/assets/tree-table-CnOS99I9.js +1 -0
- package/static/admin/assets/tree-table-CnOS99I9.js.gz +0 -0
- package/static/admin/assets/type-BU7MsCG8.js +1 -0
- package/static/admin/assets/upload-BueI-Il1.js +1 -0
- package/static/admin/assets/upload-BueI-Il1.js.gz +0 -0
- package/static/admin/assets/user-DCGYGA9G.js +1 -0
- package/static/admin/assets/user-DCGYGA9G.js.gz +0 -0
- package/static/admin/assets/user-DqMuW5cU.js +1 -0
- package/static/admin/assets/userAvatar-BAmwMY1G.css +1 -0
- package/static/admin/assets/userAvatar-BAmwMY1G.css.gz +0 -0
- package/static/admin/assets/userAvatar-Bax34kaQ.js +7 -0
- package/static/admin/assets/userAvatar-Bax34kaQ.js.gz +0 -0
- package/static/admin/assets/userInfo-OvdBjEQX.js +1 -0
- package/static/admin/assets/userInfo-OvdBjEQX.js.gz +0 -0
- package/static/admin/assets/validCode-COB1iLxa.js +1 -0
- package/static/admin/assets/validCode-COB1iLxa.js.gz +0 -0
- package/static/admin/assets/wechat-lmQOcPZu.js +1 -0
- package/static/admin/assets/wechat-lmQOcPZu.js.gz +0 -0
- package/static/admin/assets/zip-DIOSZc69.js +1 -0
- package/static/admin/assets/zip-DIOSZc69.js.gz +0 -0
- package/static/admin/favicon.ico +0 -0
- package/static/admin/index.html +216 -0
- package/static/admin/index.html.gz +0 -0
- package/store1/README.MD +0 -0
- package/store1/generic.mjs +102 -0
- package/store1/index.mjs +30 -0
- package/store1/monitor.mjs +13 -0
- package/store1/role.mjs +137 -0
- package/store1/store/0/data +0 -0
- package/store1/store/0/index +0 -0
- package/store1/store/0/index.mjs +15 -0
- package/store1/store/1/buffer/464135 +1 -0
- package/store1/store/1/buffer/464587 +1 -0
- package/store1/store/1/data +0 -0
- package/store1/store/1/data-LAPTOP-S8G0S6EH +0 -0
- package/store1/store/1/index +0 -0
- package/store1/store/1/index-LAPTOP-S8G0S6EH +0 -0
- package/store1/store/1/index.mjs +4045 -0
- package/store1/store/1/type.ts +1492 -0
- package/store1/store/index.mjs +23 -0
- package/store1/store2/0/data +0 -0
- package/store1/store2/0/index +0 -0
- package/store1/store2/0/index.mjs +15 -0
- package/store1/store2/1/buffer/464135 +1 -0
- package/store1/store2/1/buffer/464587 +1 -0
- package/store1/store2/1/data +0 -0
- package/store1/store2/1/data-LAPTOP-S8G0S6EH +0 -0
- package/store1/store2/1/index +0 -0
- package/store1/store2/1/index-LAPTOP-S8G0S6EH +0 -0
- package/store1/store2/1/index.mjs +4045 -0
- package/store1/store2/1/type.ts +1492 -0
- package/store1/store2/index.mjs +23 -0
- package/store1/system.mjs +67 -0
- package/store1/tool.mjs +472 -0
- package/store1/user.mjs +228 -0
@@ -0,0 +1,1335 @@
|
|
1
|
+
export function hungarianToCamel(name, pascal) {
|
2
|
+
|
3
|
+
name = name.split('')
|
4
|
+
|
5
|
+
name = name.map((s, i) => {
|
6
|
+
|
7
|
+
if (s === '_' || s === '-') {
|
8
|
+
|
9
|
+
return ''
|
10
|
+
|
11
|
+
} else if (name[i - 1] === '_' || name[i - 1] === '-') {
|
12
|
+
|
13
|
+
return s.toUpperCase()
|
14
|
+
|
15
|
+
} else {
|
16
|
+
|
17
|
+
return s
|
18
|
+
}
|
19
|
+
})
|
20
|
+
|
21
|
+
if (pascal) {
|
22
|
+
|
23
|
+
name = name.join('')
|
24
|
+
|
25
|
+
return name[0].toUpperCase() + name.substring(1)
|
26
|
+
|
27
|
+
} else {
|
28
|
+
|
29
|
+
return name.join('')
|
30
|
+
}
|
31
|
+
}
|
32
|
+
|
33
|
+
const A = 'A'.charCodeAt(0), Z = 'Z'.charCodeAt(0)
|
34
|
+
|
35
|
+
export function camelToHungarian(name) {
|
36
|
+
|
37
|
+
name = name[0].toLowerCase() + name.substring(1)
|
38
|
+
|
39
|
+
return name.split('').map(c => {
|
40
|
+
|
41
|
+
const n = c.charCodeAt(0)
|
42
|
+
|
43
|
+
if (n >= A && n <= Z) {
|
44
|
+
|
45
|
+
return '_' + c.toLowerCase()
|
46
|
+
|
47
|
+
} else {
|
48
|
+
|
49
|
+
return c
|
50
|
+
}
|
51
|
+
|
52
|
+
}).join('')
|
53
|
+
}
|
54
|
+
|
55
|
+
export function objKeyHungarianToCamel(obj) {
|
56
|
+
|
57
|
+
if (Array.isArray(obj)) {
|
58
|
+
|
59
|
+
const result = []
|
60
|
+
|
61
|
+
for (let item of obj) {
|
62
|
+
|
63
|
+
result.push(objKeyHungarianToCamel(item))
|
64
|
+
}
|
65
|
+
|
66
|
+
return result
|
67
|
+
|
68
|
+
} else if (typeof obj === "object") {
|
69
|
+
|
70
|
+
if (obj instanceof Date) {
|
71
|
+
|
72
|
+
return obj
|
73
|
+
}
|
74
|
+
|
75
|
+
if (obj === null) {
|
76
|
+
|
77
|
+
return obj
|
78
|
+
}
|
79
|
+
|
80
|
+
const result = {}
|
81
|
+
|
82
|
+
for (let [key, value] of Object.entries(obj)) {
|
83
|
+
|
84
|
+
result[hungarianToCamel(key.toLowerCase())] = objKeyHungarianToCamel(value)
|
85
|
+
}
|
86
|
+
|
87
|
+
return result
|
88
|
+
|
89
|
+
} else {
|
90
|
+
|
91
|
+
return obj
|
92
|
+
}
|
93
|
+
}
|
94
|
+
|
95
|
+
export const columnTypeStr = ["char", "varchar", "nvarchar", "varchar2"]
|
96
|
+
|
97
|
+
export const columnTypeText = ["tinytext", "text", "mediumtext", "longtext"]
|
98
|
+
|
99
|
+
export const columnTypeTime = ["datetime", "time", "date", "timestamp"]
|
100
|
+
|
101
|
+
export const columnTypeNumber = ["tinyint", "smallint", "mediumint", "int", "number", "integer",
|
102
|
+
"bit", "bigint", "float", "double", "decimal"]
|
103
|
+
|
104
|
+
export const columnNameNotEdit = ["id", "create_by", "create_time", "del_flag"]
|
105
|
+
|
106
|
+
export const columnNameNotList = ["id", "create_by", "create_time", "del_flag", "update_by", "update_time"]
|
107
|
+
|
108
|
+
export const columnNameNotQuery = ["id", "create_by", "del_flag", "update_by", "update_time", "remark"]
|
109
|
+
|
110
|
+
export const typeChange = {
|
111
|
+
id: 'int',
|
112
|
+
uint: 'int',
|
113
|
+
int: 'int',
|
114
|
+
bigUint: 'bigint',
|
115
|
+
bigint: 'bigint',
|
116
|
+
byte: 'bit',
|
117
|
+
time: 'date',
|
118
|
+
float: 'float',
|
119
|
+
string: 'varchar2',
|
120
|
+
buffer: 'blob',
|
121
|
+
text: 'blob',
|
122
|
+
}
|
123
|
+
|
124
|
+
export function parseTime(obj) {
|
125
|
+
|
126
|
+
for (let [key, value] of Object.entries(obj)) {
|
127
|
+
|
128
|
+
if (key.endsWith('Time')) {
|
129
|
+
|
130
|
+
obj[key] = new Date(value)
|
131
|
+
}
|
132
|
+
}
|
133
|
+
|
134
|
+
return obj
|
135
|
+
}
|
136
|
+
|
137
|
+
export function getHtmlByType(type, name) {
|
138
|
+
|
139
|
+
if (name.endsWith('status')) {
|
140
|
+
|
141
|
+
return 'radio'
|
142
|
+
|
143
|
+
} else if (name.endsWith('type') || name.endsWith('sex')) {
|
144
|
+
|
145
|
+
return 'select'
|
146
|
+
|
147
|
+
} else if (name.endsWith('image')) {
|
148
|
+
|
149
|
+
return 'imageUpload'
|
150
|
+
|
151
|
+
} else if (name.endsWith('file')) {
|
152
|
+
|
153
|
+
return 'fileUpload'
|
154
|
+
|
155
|
+
} else if (name.endsWith('content')) {
|
156
|
+
|
157
|
+
return 'editor'
|
158
|
+
|
159
|
+
} else {
|
160
|
+
|
161
|
+
if (columnTypeText.includes(type)) {
|
162
|
+
|
163
|
+
return 'textarea'
|
164
|
+
|
165
|
+
} else if (columnTypeTime.includes(type)) {
|
166
|
+
|
167
|
+
return 'datetime'
|
168
|
+
|
169
|
+
} else {
|
170
|
+
|
171
|
+
return 'input'
|
172
|
+
}
|
173
|
+
}
|
174
|
+
}
|
175
|
+
|
176
|
+
/**
|
177
|
+
* @param {Object} obj
|
178
|
+
* @return {Object}
|
179
|
+
*/
|
180
|
+
export function o2l(obj) {
|
181
|
+
|
182
|
+
const result = {}
|
183
|
+
|
184
|
+
for (const [key, value] of Object.entries(obj)) {
|
185
|
+
|
186
|
+
result[key.toLowerCase()] = value
|
187
|
+
}
|
188
|
+
|
189
|
+
return result
|
190
|
+
}
|
191
|
+
|
192
|
+
function createQueryItem(column) {
|
193
|
+
|
194
|
+
if (column.htmlType === 'datetime') {
|
195
|
+
|
196
|
+
return `<el-date-picker clearable size="small"
|
197
|
+
v-model="queryParams.${hungarianToCamel(column.columnName)}"
|
198
|
+
type="date"
|
199
|
+
value-format="yyyy-MM-dd"
|
200
|
+
placeholder="请选择${column.columnComment || column.columnName}">
|
201
|
+
</el-date-picker>`
|
202
|
+
|
203
|
+
} else if (column.dictType) {
|
204
|
+
|
205
|
+
return `<el-select v-model="queryParams.${hungarianToCamel(column.columnName)}" placeholder="请选择${column.columnComment || column.columnName}" clearable size="small">
|
206
|
+
<el-option
|
207
|
+
v-for="dict in dict.type.${column.dictType}"
|
208
|
+
:key="dict.value"
|
209
|
+
:label="dict.label"
|
210
|
+
:value="dict.value"
|
211
|
+
/>
|
212
|
+
</el-select>`
|
213
|
+
|
214
|
+
} else {
|
215
|
+
|
216
|
+
return `<el-input
|
217
|
+
v-model="queryParams.${hungarianToCamel(column.columnName)}"
|
218
|
+
placeholder="请输入${column.columnComment || column.columnName}"
|
219
|
+
clearable
|
220
|
+
size="small"
|
221
|
+
@keyup.enter.native="handleQuery"
|
222
|
+
/>`
|
223
|
+
}
|
224
|
+
}
|
225
|
+
|
226
|
+
function createQueryItemVue3(column) {
|
227
|
+
|
228
|
+
if (column.htmlType === 'datetime') {
|
229
|
+
|
230
|
+
return `<el-date-picker clearable
|
231
|
+
v-model="queryParams.${hungarianToCamel(column.columnName)}"
|
232
|
+
type="date"
|
233
|
+
value-format="YYYY-MM-DD"
|
234
|
+
placeholder="请选择${column.columnComment || column.columnName}">
|
235
|
+
</el-date-picker>`
|
236
|
+
|
237
|
+
} else if (column.dictType) {
|
238
|
+
|
239
|
+
return `<el-select v-model="queryParams.${hungarianToCamel(column.columnName)}"
|
240
|
+
placeholder="请选择${column.columnComment || column.columnName}" clearable>
|
241
|
+
<el-option
|
242
|
+
v-for="dict in ${column.dictType}"
|
243
|
+
:key="dict.value"
|
244
|
+
:label="dict.label"
|
245
|
+
:value="dict.value"
|
246
|
+
/>
|
247
|
+
</el-select>`
|
248
|
+
|
249
|
+
} else {
|
250
|
+
|
251
|
+
return `<el-input
|
252
|
+
v-model="queryParams.${hungarianToCamel(column.columnName)}"
|
253
|
+
placeholder="请输入${column.columnComment || column.columnName}"
|
254
|
+
clearable
|
255
|
+
@keyup.enter="handleQuery"
|
256
|
+
/>`
|
257
|
+
}
|
258
|
+
}
|
259
|
+
|
260
|
+
function createListItem(column) {
|
261
|
+
|
262
|
+
if (column.htmlType === 'datetime') {
|
263
|
+
|
264
|
+
return `<el-table-column label="${column.columnComment || column.columnName}" align="center" prop="${hungarianToCamel(column.columnName)}" width="180">
|
265
|
+
<template slot-scope="scope">
|
266
|
+
<span>{{ parseTime(scope.row.${hungarianToCamel(column.columnName)}, '{y}-{m}-{d}') }}</span>
|
267
|
+
</template>
|
268
|
+
</el-table-column>`
|
269
|
+
|
270
|
+
} else if (column.dictType) {
|
271
|
+
|
272
|
+
if (column.htmlType === 'checkbox') {
|
273
|
+
|
274
|
+
return `<el-table-column label="${column.columnComment || column.columnName}" align="center" prop="${hungarianToCamel(column.columnName)}">
|
275
|
+
<template slot-scope="scope">
|
276
|
+
<dict-tag :options="dict.type.${column.dictType}" :value="scope.row.${hungarianToCamel(column.columnName)} ? scope.row.${hungarianToCamel(column.columnName)}.split(',') : []"/>
|
277
|
+
</template>
|
278
|
+
</el-table-column>`
|
279
|
+
|
280
|
+
} else {
|
281
|
+
|
282
|
+
return `<el-table-column label="${column.columnComment || column.columnName}" align="center" prop="${hungarianToCamel(column.columnName)}">
|
283
|
+
<template slot-scope="scope">
|
284
|
+
<dict-tag :options="dict.type.${column.dictType}" :value="scope.row.${hungarianToCamel(column.columnName)}"/>
|
285
|
+
</template>
|
286
|
+
</el-table-column>`
|
287
|
+
}
|
288
|
+
|
289
|
+
} else if (column.htmlType === 'imageUpload') {
|
290
|
+
|
291
|
+
return `<el-table-column label="${column.columnComment || column.columnName}" align="center" prop="${hungarianToCamel(column.columnName)}" width="100">
|
292
|
+
<template slot-scope="scope">
|
293
|
+
<image-preview :src="scope.row.${hungarianToCamel(column.columnName)}" :width="50" :height="50"/>
|
294
|
+
</template>
|
295
|
+
</el-table-column>`
|
296
|
+
|
297
|
+
} else {
|
298
|
+
|
299
|
+
return `<el-table-column label="${column.columnComment || column.columnName}" align="center" prop="${hungarianToCamel(column.columnName)}" />`
|
300
|
+
}
|
301
|
+
}
|
302
|
+
|
303
|
+
function createListItemVue3(column) {
|
304
|
+
|
305
|
+
if (column.htmlType === 'datetime') {
|
306
|
+
|
307
|
+
return `<el-table-column label="${column.columnComment || column.columnName}" align="center" prop="${hungarianToCamel(column.columnName)}">
|
308
|
+
<template #default="scope">
|
309
|
+
<span>{{ parseTime(scope.row.${hungarianToCamel(column.columnName)}, '{y}-{m}-{d}') }}</span>
|
310
|
+
</template>
|
311
|
+
</el-table-column>`
|
312
|
+
|
313
|
+
} else if (column.dictType) {
|
314
|
+
|
315
|
+
if (column.htmlType === 'checkbox') {
|
316
|
+
|
317
|
+
return `<el-table-column label="${column.columnComment || column.columnName}" align="center" prop="${hungarianToCamel(column.columnName)}">
|
318
|
+
<template #default="scope">
|
319
|
+
<dict-tag :options="${column.dictType}" :value="scope.row.${hungarianToCamel(column.columnName)} ? scope.row.${hungarianToCamel(column.columnName)}.split(',') : []"/>
|
320
|
+
</template>
|
321
|
+
</el-table-column>`
|
322
|
+
|
323
|
+
} else {
|
324
|
+
|
325
|
+
return `<el-table-column label="${column.columnComment || column.columnName}" align="center" prop="${hungarianToCamel(column.columnName)}">
|
326
|
+
<template #default="scope">
|
327
|
+
<dict-tag :options="${column.dictType}" :value="scope.row.${hungarianToCamel(column.columnName)}"/>
|
328
|
+
</template>
|
329
|
+
</el-table-column>`
|
330
|
+
}
|
331
|
+
|
332
|
+
} else if (column.htmlType === 'imageUpload') {
|
333
|
+
|
334
|
+
return `<el-table-column label="${column.columnComment || column.columnName}" align="center" prop="${hungarianToCamel(column.columnName)}" width="100">
|
335
|
+
<template #default="scope">
|
336
|
+
<image-preview :src="scope.row.${hungarianToCamel(column.columnName)}" :width="50" :height="50"/>
|
337
|
+
</template>
|
338
|
+
</el-table-column>`
|
339
|
+
|
340
|
+
} else {
|
341
|
+
|
342
|
+
return `<el-table-column label="${column.columnComment || column.columnName}" align="center" prop="${hungarianToCamel(column.columnName)}" />`
|
343
|
+
}
|
344
|
+
}
|
345
|
+
|
346
|
+
function createEditItem(column) {
|
347
|
+
|
348
|
+
const name = hungarianToCamel(column.columnName)
|
349
|
+
|
350
|
+
const open = `<el-form-item label="${column.columnComment || column.columnName}" prop="${name}">`
|
351
|
+
const close = '\n\t</el-form-item>'
|
352
|
+
let content = ''
|
353
|
+
|
354
|
+
switch (column.htmlType) {
|
355
|
+
|
356
|
+
case 'checkbox':
|
357
|
+
|
358
|
+
content = `<el-checkbox-group v-model="form.${name}">
|
359
|
+
<el-checkbox
|
360
|
+
v-for="dict in dict.type.${column.dictType}"
|
361
|
+
:key="dict.value"
|
362
|
+
:label="dict.value">
|
363
|
+
{{dict.label}}
|
364
|
+
</el-checkbox>
|
365
|
+
</el-checkbox-group>`
|
366
|
+
|
367
|
+
break
|
368
|
+
}
|
369
|
+
|
370
|
+
if (column.dictType) {
|
371
|
+
|
372
|
+
if (column.htmlType === 'checkbox') {
|
373
|
+
|
374
|
+
content = `<el-checkbox-group v-model="form.${name}">
|
375
|
+
<el-checkbox
|
376
|
+
v-for="dict in dict.type.${column.dictType}"
|
377
|
+
:key="dict.value"
|
378
|
+
:label="dict.value">
|
379
|
+
{{dict.label}}
|
380
|
+
</el-checkbox>
|
381
|
+
</el-checkbox-group>`
|
382
|
+
|
383
|
+
} else if (column.htmlType === 'radio') {
|
384
|
+
|
385
|
+
content = `<el-radio-group v-model="form.${name}">
|
386
|
+
<el-radio
|
387
|
+
v-for="dict in dict.type.${column.dictType}"
|
388
|
+
:key="dict.value"
|
389
|
+
:label="dict.value"
|
390
|
+
>{{dict.label}}</el-radio>
|
391
|
+
</el-radio-group>`
|
392
|
+
|
393
|
+
} else if (column.htmlType === 'select') {
|
394
|
+
|
395
|
+
content = `<el-select v-model="form.${name}" placeholder="请选择${column.columnComment || column.columnName}">
|
396
|
+
<el-option
|
397
|
+
v-for="dict in dict.type.${column.dictType}"
|
398
|
+
:key="dict.value"
|
399
|
+
:label="dict.label"
|
400
|
+
:value="dict.value"
|
401
|
+
></el-option>
|
402
|
+
</el-select>`
|
403
|
+
}
|
404
|
+
}
|
405
|
+
|
406
|
+
if (column.htmlType === 'datetime') {
|
407
|
+
|
408
|
+
content = `<el-date-picker clearable size="small"
|
409
|
+
v-model="form.${name}"
|
410
|
+
type="date"
|
411
|
+
value-format="yyyy-MM-dd"
|
412
|
+
placeholder="请选择${column.columnComment || column.columnName}">
|
413
|
+
</el-date-picker>`
|
414
|
+
|
415
|
+
} else if (column.htmlType === 'editor') {
|
416
|
+
|
417
|
+
content = `<editor v-model="form.${name}" :min-height="192"/>`
|
418
|
+
|
419
|
+
} else if (column.htmlType === 'textarea') {
|
420
|
+
|
421
|
+
content = `<el-input v-model="form.${name}" type="textarea" placeholder="请输入${column.columnComment || column.columnName}" />`
|
422
|
+
|
423
|
+
} else if (column.htmlType === 'imageUpload') {
|
424
|
+
|
425
|
+
content = `<image-upload v-model="form.${name}"/>`
|
426
|
+
|
427
|
+
} else if (column.htmlType === 'fileUpload') {
|
428
|
+
|
429
|
+
content = `<file-upload v-model="form.${name}"/>`
|
430
|
+
}
|
431
|
+
|
432
|
+
if (!content) {
|
433
|
+
|
434
|
+
content = `<el-input${columnTypeNumber.includes(column.columnType)
|
435
|
+
? ' type="number"' : ''} v-model="form.${name}" placeholder="请输入${column.columnComment || column.columnName}" />`
|
436
|
+
}
|
437
|
+
|
438
|
+
return open + '\n\t' + content + close
|
439
|
+
}
|
440
|
+
|
441
|
+
function createEditItemVue3(column) {
|
442
|
+
|
443
|
+
const name = hungarianToCamel(column.columnName)
|
444
|
+
|
445
|
+
const open = `<el-form-item label="${column.columnComment || column.columnName}" prop="${name}">`
|
446
|
+
const close = '\n\t</el-form-item>'
|
447
|
+
let content = ''
|
448
|
+
|
449
|
+
switch (column.htmlType) {
|
450
|
+
|
451
|
+
case 'checkbox':
|
452
|
+
|
453
|
+
content = `<el-checkbox-group v-model="form.${name}">
|
454
|
+
<el-checkbox
|
455
|
+
v-for="dict in ${column.dictType}"
|
456
|
+
:key="dict.value"
|
457
|
+
:label="dict.value">
|
458
|
+
{{dict.label}}
|
459
|
+
</el-checkbox>
|
460
|
+
</el-checkbox-group>`
|
461
|
+
|
462
|
+
break
|
463
|
+
}
|
464
|
+
|
465
|
+
if (column.dictType) {
|
466
|
+
|
467
|
+
if (column.htmlType === 'checkbox') {
|
468
|
+
|
469
|
+
content = `<el-checkbox-group v-model="form.${name}">
|
470
|
+
<el-checkbox
|
471
|
+
v-for="dict in ${column.dictType}"
|
472
|
+
:key="dict.value"
|
473
|
+
:label="dict.value">
|
474
|
+
{{dict.label}}
|
475
|
+
</el-checkbox>
|
476
|
+
</el-checkbox-group>`
|
477
|
+
|
478
|
+
} else if (column.htmlType === 'radio') {
|
479
|
+
|
480
|
+
content = `<el-radio-group v-model="form.${name}">
|
481
|
+
<el-radio
|
482
|
+
v-for="dict in ${column.dictType}"
|
483
|
+
:key="dict.value"
|
484
|
+
:label="dict.value"
|
485
|
+
>{{dict.label}}</el-radio>
|
486
|
+
</el-radio-group>`
|
487
|
+
|
488
|
+
} else if (column.htmlType === 'select') {
|
489
|
+
|
490
|
+
content = `<el-select v-model="form.${name}" placeholder="请选择${column.columnComment || column.columnName}">
|
491
|
+
<el-option
|
492
|
+
v-for="dict in ${column.dictType}"
|
493
|
+
:key="dict.value"
|
494
|
+
:label="dict.label"
|
495
|
+
:value="dict.value"
|
496
|
+
></el-option>
|
497
|
+
</el-select>`
|
498
|
+
}
|
499
|
+
}
|
500
|
+
|
501
|
+
if (column.htmlType === 'datetime') {
|
502
|
+
|
503
|
+
content = `<el-date-picker clearable size="small"
|
504
|
+
v-model="form.${name}"
|
505
|
+
type="date"
|
506
|
+
value-format="YYYY-MM-DD"
|
507
|
+
placeholder="请选择${column.columnComment || column.columnName}">
|
508
|
+
</el-date-picker>`
|
509
|
+
|
510
|
+
} else if (column.htmlType === 'editor') {
|
511
|
+
|
512
|
+
content = `<editor v-model="form.${name}" :min-height="192"/>`
|
513
|
+
|
514
|
+
} else if (column.htmlType === 'textarea') {
|
515
|
+
|
516
|
+
content = `<el-input v-model="form.${name}" type="textarea" placeholder="请输入${column.columnComment || column.columnName}" />`
|
517
|
+
|
518
|
+
} else if (column.htmlType === 'imageUpload') {
|
519
|
+
|
520
|
+
content = `<image-upload v-model="form.${name}"/>`
|
521
|
+
|
522
|
+
} else if (column.htmlType === 'fileUpload') {
|
523
|
+
|
524
|
+
content = `<file-upload v-model="form.${name}"/>`
|
525
|
+
}
|
526
|
+
|
527
|
+
if (!content) {
|
528
|
+
|
529
|
+
content = `<el-input${columnTypeNumber.includes(column.columnType)
|
530
|
+
? ' type="number"' : ''} v-model="form.${name}" placeholder="请输入${column.columnComment || column.columnName}" />`
|
531
|
+
}
|
532
|
+
|
533
|
+
return open + '\n\t' + content + close
|
534
|
+
}
|
535
|
+
|
536
|
+
function createMjsFile(table, targetName, columns, perms, route) {
|
537
|
+
|
538
|
+
const key = columns.find(col => col.isPk)?.columnName || 'id'
|
539
|
+
const tableName = hungarianToCamel(table.tableName)
|
540
|
+
const TableName = tableName[0].toUpperCase() + tableName.substring(1)
|
541
|
+
|
542
|
+
return `import {AdminAuthObj, NoActionHandle, NoActionParams} from "../base.mjs";
|
543
|
+
import {objKeyHungarianToCamel, parseTime} from "../tool/helper.mjs";
|
544
|
+
import {${tableName}} from "${targetName}"
|
545
|
+
|
546
|
+
const dateCols = [${columns.filter(column => column.columnType.includes('time'))
|
547
|
+
.map(column => `'${hungarianToCamel(column.columnName)}'`).join(', ')}]
|
548
|
+
|
549
|
+
export class ${TableName} extends AdminAuthObj {
|
550
|
+
|
551
|
+
route = '${table.route}'
|
552
|
+
|
553
|
+
GET(...arg) {
|
554
|
+
|
555
|
+
const id = this.call(...arg)
|
556
|
+
|
557
|
+
if (id === NoActionParams || !NoActionHandle.is(id)) return id
|
558
|
+
|
559
|
+
return ${tableName}.equal({${key}: id.valueOf()})
|
560
|
+
.then(([data]) => objKeyHungarianToCamel(data))
|
561
|
+
}
|
562
|
+
|
563
|
+
POST(data, extra) {
|
564
|
+
|
565
|
+
this.updateDateCol(dateCols)
|
566
|
+
|
567
|
+
return ${tableName}.post(data)
|
568
|
+
}
|
569
|
+
|
570
|
+
PUT(data, extra) {
|
571
|
+
|
572
|
+
this.updateDateCol(dateCols)
|
573
|
+
|
574
|
+
return ${tableName}.put(parseTime(data))
|
575
|
+
}
|
576
|
+
|
577
|
+
DELETE(_, {req, res}) {
|
578
|
+
|
579
|
+
return ${tableName}.delete(req.params.action)
|
580
|
+
}
|
581
|
+
|
582
|
+
list(data) {
|
583
|
+
|
584
|
+
return ${tableName}.get(req.query)
|
585
|
+
.then(rows => ({rows: objKeyHungarianToCamel(rows), total: rows.total}))
|
586
|
+
}
|
587
|
+
}`
|
588
|
+
}
|
589
|
+
|
590
|
+
function regexp(type) {
|
591
|
+
|
592
|
+
const index = type.indexOf('(')
|
593
|
+
|
594
|
+
if (index > 0) {
|
595
|
+
|
596
|
+
type = type.substring(0, index)
|
597
|
+
}
|
598
|
+
|
599
|
+
return columnTypeStr.includes(type) || columnTypeText.includes(type)
|
600
|
+
}
|
601
|
+
|
602
|
+
function createSqlMjsFile(table, columns) {
|
603
|
+
|
604
|
+
const key = columns.find(col => col.isPk)?.columnName || 'id'
|
605
|
+
const tableName = hungarianToCamel(table.tableName)
|
606
|
+
const TableName = tableName[0].toUpperCase() + tableName.substring(1)
|
607
|
+
|
608
|
+
return `import {AdminAuthSql, NoActionHandle, NoActionParams} from "../base.mjs";
|
609
|
+
import {query} from "../../mysql.mjs";
|
610
|
+
import {objKeyHungarianToCamel, camelToHungarian} from "../tool/helper.mjs";
|
611
|
+
|
612
|
+
const strCols = [${columns.filter(column => regexp(column.columnType))
|
613
|
+
.map(column => `'${hungarianToCamel(column.columnName)}'`).join(', ')}]
|
614
|
+
const dateCols = [${columns.filter(column => column.columnType.includes('time'))
|
615
|
+
.map(column => `'${hungarianToCamel(column.columnName)}'`).join(', ')}]
|
616
|
+
const otherCols = [${columns.filter(column => !column.columnType.includes('time') && !regexp(column.columnType))
|
617
|
+
.map(column => `'${hungarianToCamel(column.columnName)}'`).join(', ')}]
|
618
|
+
|
619
|
+
export class ${TableName} extends AdminAuthSql {
|
620
|
+
|
621
|
+
route = '${table.route}'
|
622
|
+
|
623
|
+
GET(...arg) {
|
624
|
+
|
625
|
+
const id = this.call(...arg)
|
626
|
+
|
627
|
+
if (id === NoActionParams || !NoActionHandle.is(id)) return id
|
628
|
+
|
629
|
+
return query(\`SELECT * FROM ${table.tableName} where ${key} = ?\`, id.valueOf())
|
630
|
+
.then(([data]) => objKeyHungarianToCamel(data))
|
631
|
+
}
|
632
|
+
|
633
|
+
POST(...arg) {
|
634
|
+
|
635
|
+
const id = this.call(...arg)
|
636
|
+
|
637
|
+
if (action !== NoActionParams && !NoActionHandle.is(action)) return id
|
638
|
+
|
639
|
+
const [keys, values] = this.filterEntries(strCols, dateCols, otherCols)
|
640
|
+
|
641
|
+
if (keys.length === 0) return Promise.reject('数据异常')
|
642
|
+
|
643
|
+
return query(\`INSERT INTO ${table.tableName} (\${keys.map(key => camelToHungarian(key)).join(',')}) VALUES (\${keys
|
644
|
+
.map(_ => '?').join(',')})\`, ...values)
|
645
|
+
}
|
646
|
+
|
647
|
+
PUT(...arg) {
|
648
|
+
|
649
|
+
const [keys, values] = this.filterEntries(strCols, dateCols, otherCols)
|
650
|
+
|
651
|
+
if (keys.length === 0) Promise.reject('数据异常')
|
652
|
+
|
653
|
+
return query(\`UPDATE ${table.tableName} SET \${keys.map(key => \` \${camelToHungarian(key)} = ?\`).join(', ')} WHERE ${key} = ?\`,
|
654
|
+
...values, data.${hungarianToCamel(key)})
|
655
|
+
}
|
656
|
+
|
657
|
+
DELETE(_, {req, res}) {
|
658
|
+
|
659
|
+
return query('DELETE FROM ${table.tableName} WHERE ${key} IN (?)', req.params.action.split(','))
|
660
|
+
}
|
661
|
+
|
662
|
+
list(data, {req, res}) {
|
663
|
+
|
664
|
+
const [whereStr, values] = this.toWhereArr(strCols, dateCols, otherCols)
|
665
|
+
|
666
|
+
return Promise.all([
|
667
|
+
query(\`SELECT * FROM ${table.tableName}\${whereStr} LIMIT ?,?\`, ...values,
|
668
|
+
(data.pageNum - 1) * data.pageSize, Number.parseInt(data.pageSize)),
|
669
|
+
query('SELECT COUNT(*) FROM ${table.tableName}' + whereStr, ...values),
|
670
|
+
])
|
671
|
+
.then(([rows, [result]]) => ({rows: objKeyHungarianToCamel(rows), total: result['COUNT(*)']}))
|
672
|
+
}
|
673
|
+
}`
|
674
|
+
}
|
675
|
+
|
676
|
+
function createOtherMjsFile(table, columns, perms, route) {
|
677
|
+
|
678
|
+
const tableName = hungarianToCamel(table.tableName)
|
679
|
+
|
680
|
+
const key = columns.find(col => col.isPk === '1')?.columnName || 'id'
|
681
|
+
|
682
|
+
return `import {AdminAuth} from "../base.mjs";
|
683
|
+
|
684
|
+
export class ${tableName} extends AdminAuth {
|
685
|
+
|
686
|
+
pk = '${key}'
|
687
|
+
set = '${tableName}'
|
688
|
+
route = '${table.route}'
|
689
|
+
}`
|
690
|
+
}
|
691
|
+
|
692
|
+
function createVueFile(columns, table, pk) {
|
693
|
+
|
694
|
+
const permission = table.permission
|
695
|
+
|
696
|
+
return `<template>
|
697
|
+
<div class="app-container">
|
698
|
+
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="200px">
|
699
|
+
${columns.filter(column => column.isQuery === '1' && !['imageUpload', 'fileUpload'].includes(column.htmlType)).map(
|
700
|
+
column => `<el-form-item label="${column.columnComment || column.columnName}" prop="${hungarianToCamel(column.columnName)}">
|
701
|
+
${createQueryItem(column)}
|
702
|
+
</el-form-item>`
|
703
|
+
).join('\n ')}
|
704
|
+
<el-form-item>
|
705
|
+
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
706
|
+
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
707
|
+
</el-form-item>
|
708
|
+
</el-form>
|
709
|
+
<el-row :gutter="10" class="mb8">
|
710
|
+
<el-col :span="1.5">
|
711
|
+
<el-button
|
712
|
+
type="primary"
|
713
|
+
plain
|
714
|
+
icon="el-icon-plus"
|
715
|
+
size="mini"
|
716
|
+
@click="handleAdd"
|
717
|
+
v-hasPermi="['${permission}:add']"
|
718
|
+
>新增</el-button>
|
719
|
+
</el-col>
|
720
|
+
<el-col :span="1.5">
|
721
|
+
<el-button
|
722
|
+
type="success"
|
723
|
+
plain
|
724
|
+
icon="el-icon-edit"
|
725
|
+
size="mini"
|
726
|
+
:disabled="single"
|
727
|
+
@click="handleUpdate"
|
728
|
+
v-hasPermi="['${permission}:edit']"
|
729
|
+
>修改</el-button>
|
730
|
+
</el-col>
|
731
|
+
<el-col :span="1.5">
|
732
|
+
<el-button
|
733
|
+
type="danger"
|
734
|
+
plain
|
735
|
+
icon="el-icon-delete"
|
736
|
+
size="mini"
|
737
|
+
:disabled="multiple"
|
738
|
+
@click="handleDelete"
|
739
|
+
v-hasPermi="['${permission}:remove']"
|
740
|
+
>删除</el-button>
|
741
|
+
</el-col>
|
742
|
+
<el-col :span="1.5">
|
743
|
+
<el-button
|
744
|
+
type="warning"
|
745
|
+
plain
|
746
|
+
icon="el-icon-download"
|
747
|
+
size="mini"
|
748
|
+
@click="handleExport"
|
749
|
+
v-hasPermi="['${permission}:export']"
|
750
|
+
>导出</el-button>
|
751
|
+
</el-col>
|
752
|
+
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
753
|
+
</el-row>
|
754
|
+
<el-table v-loading="loading" :data="${table.className}List" @selection-change="handleSelectionChange">
|
755
|
+
<el-table-column type="selection" width="55" align="center" />
|
756
|
+
${columns.filter(column => column.isList === '1').map(column => createListItem(column)).join('\n\t')}
|
757
|
+
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
758
|
+
<template slot-scope="scope">
|
759
|
+
<el-button
|
760
|
+
size="mini"
|
761
|
+
type="text"
|
762
|
+
icon="el-icon-view"
|
763
|
+
@click="handleView(scope.row,scope.index)"
|
764
|
+
v-hasPermi="['${permission}:query']"
|
765
|
+
>详细</el-button>
|
766
|
+
<el-button
|
767
|
+
size="mini"
|
768
|
+
type="text"
|
769
|
+
icon="el-icon-edit"
|
770
|
+
@click="handleUpdate(scope.row)"
|
771
|
+
v-hasPermi="['${permission}:edit']"
|
772
|
+
>修改</el-button>
|
773
|
+
<el-button
|
774
|
+
size="mini"
|
775
|
+
type="text"
|
776
|
+
icon="el-icon-delete"
|
777
|
+
@click="handleDelete(scope.row)"
|
778
|
+
v-hasPermi="['${permission}:remove']"
|
779
|
+
>删除</el-button>
|
780
|
+
</template>
|
781
|
+
</el-table-column>
|
782
|
+
</el-table>
|
783
|
+
<pagination
|
784
|
+
v-show="total > 0"
|
785
|
+
:total="total"
|
786
|
+
:page.sync="queryParams.pageNum"
|
787
|
+
:limit.sync="queryParams.pageSize"
|
788
|
+
@pagination="getList"
|
789
|
+
/>
|
790
|
+
<!-- 添加或修改${table.tableComment}对话框 -->
|
791
|
+
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body :close-on-click-modal="false">
|
792
|
+
<el-form ref="form" :disabled="title.endsWith('详情')" :model="form" :rules="rules" label-width="120px">
|
793
|
+
${columns.filter(column => column.isEdit === '1').map(column => createEditItem(column)).join('\n\t')}
|
794
|
+
</el-form>
|
795
|
+
<div slot="footer" class="dialog-footer">
|
796
|
+
<el-button type="primary" @click="submitForm">确 定</el-button>
|
797
|
+
<el-button @click="cancel">取 消</el-button>
|
798
|
+
</div>
|
799
|
+
</el-dialog>
|
800
|
+
</div>
|
801
|
+
</template>
|
802
|
+
|
803
|
+
<script>
|
804
|
+
import { list${table.functionName}, get${table.functionName}, add${table.functionName}, update${table.functionName}, del${table.functionName} } from "@/api/${table.moduleName}/${table.businessName}"
|
805
|
+
|
806
|
+
export default {
|
807
|
+
name: "${table.functionName}",
|
808
|
+
dicts: ${JSON.stringify(Array.from(new Set(columns.filter(column => column.dictType).map(column => column.dictType))))},
|
809
|
+
data() {
|
810
|
+
return {
|
811
|
+
// 遮罩层
|
812
|
+
loading: true,
|
813
|
+
// 选中数组
|
814
|
+
ids: [],
|
815
|
+
// 非单个禁用
|
816
|
+
single: true,
|
817
|
+
// 非多个禁用
|
818
|
+
multiple: true,
|
819
|
+
// 显示搜索条件
|
820
|
+
showSearch: true,
|
821
|
+
// 总条数
|
822
|
+
total: 0,
|
823
|
+
// ${table.tableComment}表格数据
|
824
|
+
${table.className}List: [],
|
825
|
+
// 弹出层标题
|
826
|
+
title: "",
|
827
|
+
// 是否显示弹出层
|
828
|
+
open: false,
|
829
|
+
// 查询参数
|
830
|
+
queryParams: {
|
831
|
+
pageNum: 1,
|
832
|
+
pageSize: 10,
|
833
|
+
${columns.filter(column => column.isQuery === '1').map(
|
834
|
+
column => `${hungarianToCamel(column.columnName)}: null`
|
835
|
+
).join(',\n\t')}
|
836
|
+
},
|
837
|
+
// 表单参数
|
838
|
+
form: {},
|
839
|
+
// 表单校验
|
840
|
+
rules: {
|
841
|
+
${columns.filter(column => column.isRequired === '1').map(
|
842
|
+
column => `${hungarianToCamel(column.columnName)}: [
|
843
|
+
{required: true, message: "${column.columnComment || column.columnName}不能为空", trigger: "blur"}
|
844
|
+
]`
|
845
|
+
).join(',\n\t')}
|
846
|
+
}
|
847
|
+
}
|
848
|
+
},
|
849
|
+
created() {
|
850
|
+
this.getList()
|
851
|
+
},
|
852
|
+
methods: {
|
853
|
+
/** 查询${table.tableComment}列表 */
|
854
|
+
getList() {
|
855
|
+
this.loading = true
|
856
|
+
list${table.functionName}(this.queryParams).then(response => {
|
857
|
+
this.${table.className}List = response.rows
|
858
|
+
this.total = response.total
|
859
|
+
this.loading = false
|
860
|
+
})
|
861
|
+
},
|
862
|
+
// 取消按钮
|
863
|
+
cancel() {
|
864
|
+
this.open = false
|
865
|
+
this.reset()
|
866
|
+
},
|
867
|
+
// 表单重置
|
868
|
+
reset() {
|
869
|
+
this.form = {
|
870
|
+
${columns.map(
|
871
|
+
column => `${hungarianToCamel(column.columnName)}: ${column.htmlType === 'checkbox'
|
872
|
+
? '[]' : column.htmlType === 'radio' ? '"0"' : null}`
|
873
|
+
).join(',\n\t')}
|
874
|
+
}
|
875
|
+
this.resetForm("form")
|
876
|
+
},
|
877
|
+
/** 搜索按钮操作 */
|
878
|
+
handleQuery() {
|
879
|
+
this.queryParams.pageNum = 1
|
880
|
+
this.getList()
|
881
|
+
},
|
882
|
+
/** 重置按钮操作 */
|
883
|
+
resetQuery() {
|
884
|
+
this.resetForm("queryForm")
|
885
|
+
this.handleQuery()
|
886
|
+
},
|
887
|
+
// 多选框选中数据
|
888
|
+
handleSelectionChange(selection) {
|
889
|
+
this.ids = selection.map(item => item.${pk})
|
890
|
+
this.single = selection.length !== 1
|
891
|
+
this.multiple = !selection.length
|
892
|
+
},
|
893
|
+
/** 详细按钮操作 */
|
894
|
+
handleView(row) {
|
895
|
+
const ${pk} = row.${pk} || this.ids
|
896
|
+
get${table.functionName}(${pk}).then(response => {
|
897
|
+
this.form = response.data
|
898
|
+
this.open = true
|
899
|
+
this.title = "${table.tableComment}详情"
|
900
|
+
})
|
901
|
+
},
|
902
|
+
/** 新增按钮操作 */
|
903
|
+
handleAdd() {
|
904
|
+
this.reset()
|
905
|
+
this.open = true
|
906
|
+
this.title = "添加${table.tableComment}"
|
907
|
+
},
|
908
|
+
/** 修改按钮操作 */
|
909
|
+
handleUpdate(row) {
|
910
|
+
this.reset()
|
911
|
+
const ${pk} = row.${pk} || this.ids
|
912
|
+
get${table.functionName}(${pk}).then(response => {
|
913
|
+
this.form = response.data
|
914
|
+
this.open = true
|
915
|
+
this.title = "修改${table.tableComment}"
|
916
|
+
})
|
917
|
+
},
|
918
|
+
/** 删除按钮操作 */
|
919
|
+
handleDelete(row) {
|
920
|
+
const ${pk}s = row.${pk} || this.ids
|
921
|
+
this.$modal.confirm('是否确认删除${table.tableComment}编号为"' + ${pk}s + '"的数据项?').then(function() {
|
922
|
+
return del${table.functionName}(${pk}s)
|
923
|
+
}).then(() => {
|
924
|
+
this.getList()
|
925
|
+
this.$modal.msgSuccess("删除成功")
|
926
|
+
}).catch(() => {})
|
927
|
+
},
|
928
|
+
/** 导出按钮操作 */
|
929
|
+
handleExport() {
|
930
|
+
this.download('${table.moduleName}/${table.businessName}/export', {
|
931
|
+
...this.queryParams
|
932
|
+
}, \`${table.className}\${new Date().getTime()}.xlsx\`)
|
933
|
+
},
|
934
|
+
/** 提交按钮 */
|
935
|
+
submitForm() {
|
936
|
+
this.$refs["form"].validate(valid => {
|
937
|
+
if (valid) {
|
938
|
+
${columns.filter(column => column.htmlType === 'checkbox').map(
|
939
|
+
column => `this.form.${hungarianToCamel(column.columnName)} = this.form.${hungarianToCamel(column.columnName)}.join(",")`
|
940
|
+
).join('\n\t')}
|
941
|
+
if (this.form.${pk} != null) {
|
942
|
+
update${table.functionName}(this.form).then(() => {
|
943
|
+
this.$modal.msgSuccess("修改成功")
|
944
|
+
this.open = false
|
945
|
+
this.getList()
|
946
|
+
})
|
947
|
+
} else {
|
948
|
+
add${table.functionName}(this.form).then(() => {
|
949
|
+
this.$modal.msgSuccess("新增成功")
|
950
|
+
this.open = false
|
951
|
+
this.getList()
|
952
|
+
})
|
953
|
+
}
|
954
|
+
}
|
955
|
+
})
|
956
|
+
},
|
957
|
+
}
|
958
|
+
}
|
959
|
+
</script>
|
960
|
+
`
|
961
|
+
}
|
962
|
+
|
963
|
+
function createVue3File(columns, table, pk) {
|
964
|
+
|
965
|
+
const permission = table.permission
|
966
|
+
|
967
|
+
const dict = Array.from(new Set(columns.filter(column => column.dictType).map(column => column.dictType)))
|
968
|
+
|
969
|
+
return `<template>
|
970
|
+
<div class="app-container">
|
971
|
+
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="200px">
|
972
|
+
${columns.filter(column => column.isQuery === '1' && !['imageUpload', 'fileUpload'].includes(column.htmlType)).map(
|
973
|
+
column => `<el-form-item label="${column.columnComment || column.columnName}" prop="${hungarianToCamel(column.columnName)}">
|
974
|
+
${createQueryItemVue3(column)}
|
975
|
+
</el-form-item>`
|
976
|
+
).join('\n ')}
|
977
|
+
<el-form-item>
|
978
|
+
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
979
|
+
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
980
|
+
</el-form-item>
|
981
|
+
</el-form>
|
982
|
+
<el-row :gutter="10" class="mb8">
|
983
|
+
<el-col :span="1.5">
|
984
|
+
<el-button
|
985
|
+
type="primary"
|
986
|
+
plain
|
987
|
+
icon="Plus"
|
988
|
+
@click="handleAdd"
|
989
|
+
v-hasPermi="['${permission}:add']"
|
990
|
+
>新增</el-button>
|
991
|
+
</el-col>
|
992
|
+
<el-col :span="1.5">
|
993
|
+
<el-button
|
994
|
+
type="success"
|
995
|
+
plain
|
996
|
+
icon="Edit"
|
997
|
+
:disabled="single"
|
998
|
+
@click="handleUpdate"
|
999
|
+
v-hasPermi="['${permission}:edit']"
|
1000
|
+
>修改</el-button>
|
1001
|
+
</el-col>
|
1002
|
+
<el-col :span="1.5">
|
1003
|
+
<el-button
|
1004
|
+
type="danger"
|
1005
|
+
plain
|
1006
|
+
icon="Delete"
|
1007
|
+
:disabled="multiple"
|
1008
|
+
@click="handleDelete"
|
1009
|
+
v-hasPermi="['${permission}:remove']"
|
1010
|
+
>删除</el-button>
|
1011
|
+
</el-col>
|
1012
|
+
<el-col :span="1.5">
|
1013
|
+
<el-button
|
1014
|
+
type="warning"
|
1015
|
+
plain
|
1016
|
+
icon="Download"
|
1017
|
+
@click="handleExport"
|
1018
|
+
v-hasPermi="['${permission}:export']"
|
1019
|
+
>导出</el-button>
|
1020
|
+
</el-col>
|
1021
|
+
<el-col :span="1.5">
|
1022
|
+
<el-button
|
1023
|
+
type="info"
|
1024
|
+
plain
|
1025
|
+
icon="Sort"
|
1026
|
+
@click="toggleExpandAll"
|
1027
|
+
>展开/折叠</el-button>
|
1028
|
+
</el-col>
|
1029
|
+
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
1030
|
+
</el-row>
|
1031
|
+
<el-table v-loading="loading" :data="${table.className}List" @selection-change="handleSelectionChange">
|
1032
|
+
<el-table-column type="selection" width="55" align="center" />
|
1033
|
+
${columns.filter(column => column.isList === '1').map(column => createListItemVue3(column)).join('\n\t')}
|
1034
|
+
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
1035
|
+
<template #default="scope">
|
1036
|
+
<el-button
|
1037
|
+
type="text"
|
1038
|
+
icon="View"
|
1039
|
+
@click="handleView(scope.row,scope.index)"
|
1040
|
+
v-hasPermi="['${permission}:query']"
|
1041
|
+
>详细</el-button>
|
1042
|
+
<el-button
|
1043
|
+
type="text"
|
1044
|
+
icon="Edit"
|
1045
|
+
@click="handleUpdate(scope.row)"
|
1046
|
+
v-hasPermi="['${permission}:edit']"
|
1047
|
+
>修改</el-button>
|
1048
|
+
<el-button
|
1049
|
+
type="text"
|
1050
|
+
icon="Delete"
|
1051
|
+
@click="handleDelete(scope.row)"
|
1052
|
+
v-hasPermi="['${permission}:remove']"
|
1053
|
+
>删除</el-button>
|
1054
|
+
</template>
|
1055
|
+
</el-table-column>
|
1056
|
+
</el-table>
|
1057
|
+
<pagination
|
1058
|
+
v-show="total > 0"
|
1059
|
+
:total="total"
|
1060
|
+
v-model:page="queryParams.pageNum"
|
1061
|
+
v-model:limit="queryParams.pageSize"
|
1062
|
+
@pagination="getList"
|
1063
|
+
/>
|
1064
|
+
<!-- 添加或修改${table.tableComment}对话框 -->
|
1065
|
+
<el-dialog :title="title" v-model="open" width="800px" append-to-body :close-on-click-modal="false">
|
1066
|
+
<el-form ref="formRef" :disabled="title.endsWith('详情')" :model="form" :rules="rules" label-width="120px">
|
1067
|
+
${columns.filter(column => column.isEdit === '1').map(column => createEditItemVue3(column)).join('\n\t')}
|
1068
|
+
</el-form>
|
1069
|
+
<template #footer>
|
1070
|
+
<div class="dialog-footer">
|
1071
|
+
<el-button type="primary" @click="submitForm">确 定</el-button>
|
1072
|
+
<el-button @click="cancel">取 消</el-button>
|
1073
|
+
</div>
|
1074
|
+
</template>
|
1075
|
+
</el-dialog>
|
1076
|
+
</div>
|
1077
|
+
</template>
|
1078
|
+
|
1079
|
+
<script setup name="${table.functionName}">
|
1080
|
+
import { list${table.functionName}, get${table.functionName}, add${table.functionName}, update${table.functionName}, del${table.functionName} } from "@/api/${table.moduleName}/${table.businessName}"
|
1081
|
+
|
1082
|
+
const { proxy } = getCurrentInstance();
|
1083
|
+
const { ${dict.join(', ')} } = proxy.useDict(${dict.map(d => `"${d}"`).join(', ')});
|
1084
|
+
|
1085
|
+
const ${table.className}List = ref([]);// ${table.tableComment}表格数据
|
1086
|
+
const open = ref(false);// 是否显示弹出层
|
1087
|
+
const loading = ref(true);// 遮罩层
|
1088
|
+
const showSearch = ref(true);// 显示搜索条件
|
1089
|
+
const ids = ref([]);// 选中数组
|
1090
|
+
const single = ref(true);// 非单个禁用
|
1091
|
+
const multiple = ref(true);// 非多个禁用
|
1092
|
+
const total = ref(0);// 总条数
|
1093
|
+
const title = ref("");// 弹出层标题
|
1094
|
+
|
1095
|
+
const data = reactive({
|
1096
|
+
form: {},// 表单参数
|
1097
|
+
queryParams: {// 查询参数
|
1098
|
+
pageNum: 1,
|
1099
|
+
pageSize: 10,
|
1100
|
+
${columns.filter(column => column.isQuery === '1').map(
|
1101
|
+
column => `${hungarianToCamel(column.columnName)}: null`
|
1102
|
+
).join(',\n\t')}
|
1103
|
+
},
|
1104
|
+
rules: {// 表单校验
|
1105
|
+
${columns.filter(column => column.isRequired === '1').map(
|
1106
|
+
column => `${hungarianToCamel(column.columnName)}: [
|
1107
|
+
{required: true, message: "${column.columnComment || column.columnName}不能为空", trigger: "blur"}
|
1108
|
+
]`
|
1109
|
+
).join(',\n\t')}
|
1110
|
+
}
|
1111
|
+
});
|
1112
|
+
|
1113
|
+
const { queryParams, form, rules } = toRefs(data);
|
1114
|
+
/** 查询${table.tableComment}列表 */
|
1115
|
+
function getList() {
|
1116
|
+
loading.value = true;
|
1117
|
+
list${table.functionName}(queryParams.value).then(response => {
|
1118
|
+
${table.className}List.value = response.rows;
|
1119
|
+
total.value = response.total;
|
1120
|
+
loading.value = false;
|
1121
|
+
});
|
1122
|
+
}
|
1123
|
+
/** 取消按钮 */
|
1124
|
+
function cancel() {
|
1125
|
+
open.value = false;
|
1126
|
+
reset();
|
1127
|
+
}
|
1128
|
+
/** 表单重置 */
|
1129
|
+
function reset() {
|
1130
|
+
form.value = {
|
1131
|
+
${columns.map(
|
1132
|
+
column => `${hungarianToCamel(column.columnName)}: ${column.htmlType === 'checkbox'
|
1133
|
+
? '[]' : column.htmlType === 'radio' ? '"0"' : null}`).join(',\n\t')}
|
1134
|
+
};
|
1135
|
+
proxy.resetForm("formRef");
|
1136
|
+
}
|
1137
|
+
/** 搜索按钮操作 */
|
1138
|
+
function handleQuery() {
|
1139
|
+
queryParams.value.pageNum = 1;
|
1140
|
+
getList();
|
1141
|
+
}
|
1142
|
+
/** 重置按钮操作 */
|
1143
|
+
function resetQuery() {
|
1144
|
+
proxy.resetForm("queryRef");
|
1145
|
+
handleQuery();
|
1146
|
+
}
|
1147
|
+
/** 详细按钮操作 */
|
1148
|
+
function handleSelectionChange(selection) {
|
1149
|
+
ids.value = selection.map(item => item.${pk});
|
1150
|
+
single.value = selection.length != 1;
|
1151
|
+
multiple.value = !selection.length;
|
1152
|
+
}
|
1153
|
+
/** 任务详细信息 */
|
1154
|
+
function handleView(row) {
|
1155
|
+
const ${pk} = row.${pk} || ids.value;
|
1156
|
+
get${table.functionName}(${pk}).then(response => {
|
1157
|
+
form.value = response.data;
|
1158
|
+
open.value = true;
|
1159
|
+
title.value = "${table.tableComment}详情";
|
1160
|
+
});
|
1161
|
+
}
|
1162
|
+
/** 新增按钮操作 */
|
1163
|
+
function handleAdd() {
|
1164
|
+
reset();
|
1165
|
+
open.value = true;
|
1166
|
+
title.value = "添加${table.tableComment}";
|
1167
|
+
}
|
1168
|
+
/** 修改按钮操作 */
|
1169
|
+
function handleUpdate(row) {
|
1170
|
+
reset();
|
1171
|
+
const ${pk} = row.${pk} || ids.value;
|
1172
|
+
get${table.functionName}(${pk}).then(response => {
|
1173
|
+
form.value = response.data;
|
1174
|
+
open.value = true;
|
1175
|
+
title.value = "修改${table.tableComment}";
|
1176
|
+
});
|
1177
|
+
}
|
1178
|
+
/** 删除按钮操作 */
|
1179
|
+
function handleDelete(row) {
|
1180
|
+
const ${pk}s = row.${pk} || ids.value;
|
1181
|
+
proxy.$modal.confirm('是否确认删除${table.tableComment}编号为"' + ${pk}s + '"的数据项?').then(function () {
|
1182
|
+
return del${table.functionName}(${pk}s);
|
1183
|
+
}).then(() => {
|
1184
|
+
getList();
|
1185
|
+
proxy.$modal.msgSuccess("删除成功");
|
1186
|
+
}).catch(() => {});
|
1187
|
+
}
|
1188
|
+
/** 导出按钮操作 */
|
1189
|
+
function handleExport() {
|
1190
|
+
proxy.download('${table.moduleName}/${table.businessName}/export', {
|
1191
|
+
...queryParams.value,
|
1192
|
+
}, \`${table.className}\${new Date().getTime()}.xlsx\`);
|
1193
|
+
}
|
1194
|
+
/** 提交按钮 */
|
1195
|
+
function submitForm() {
|
1196
|
+
proxy.$refs["formRef"].validate(valid => {
|
1197
|
+
if (valid) {
|
1198
|
+
${columns.filter(column => column.htmlType === 'checkbox').map(
|
1199
|
+
column => `form.value.${hungarianToCamel(column.columnName)} = form.value.${hungarianToCamel(column.columnName)}.join(",")`
|
1200
|
+
).join('\n\t')}
|
1201
|
+
if (form.value.${pk} != undefined) {
|
1202
|
+
update${table.functionName}(form.value).then(response => {
|
1203
|
+
proxy.$modal.msgSuccess("修改成功");
|
1204
|
+
open.value = false;
|
1205
|
+
getList();
|
1206
|
+
});
|
1207
|
+
} else {
|
1208
|
+
add${table.functionName}(form.value).then(response => {
|
1209
|
+
proxy.$modal.msgSuccess("新增成功");
|
1210
|
+
open.value = false;
|
1211
|
+
getList();
|
1212
|
+
});
|
1213
|
+
}
|
1214
|
+
}
|
1215
|
+
});
|
1216
|
+
}
|
1217
|
+
|
1218
|
+
getList();
|
1219
|
+
</script>
|
1220
|
+
`
|
1221
|
+
}
|
1222
|
+
|
1223
|
+
function createApiFile(table, pk) {
|
1224
|
+
|
1225
|
+
return `import request from '@/utils/request'
|
1226
|
+
|
1227
|
+
// 查询${table.tableComment}列表
|
1228
|
+
export function list${table.functionName}(query) {
|
1229
|
+
return request({
|
1230
|
+
url: '/${table.moduleName}/${table.businessName}/list',
|
1231
|
+
method: 'get',
|
1232
|
+
params: query
|
1233
|
+
})
|
1234
|
+
}
|
1235
|
+
|
1236
|
+
// 查询${table.tableComment}详细
|
1237
|
+
export function get${table.functionName}(${pk}) {
|
1238
|
+
return request({
|
1239
|
+
url: '/${table.moduleName}/${table.businessName}/' + ${pk},
|
1240
|
+
method: 'get'
|
1241
|
+
})
|
1242
|
+
}
|
1243
|
+
|
1244
|
+
// 新增${table.tableComment}
|
1245
|
+
export function add${table.functionName}(data) {
|
1246
|
+
return request({
|
1247
|
+
url: '/${table.moduleName}/${table.businessName}',
|
1248
|
+
method: 'post',
|
1249
|
+
data: data
|
1250
|
+
})
|
1251
|
+
}
|
1252
|
+
|
1253
|
+
// 修改${table.tableComment}
|
1254
|
+
export function update${table.functionName}(data) {
|
1255
|
+
return request({
|
1256
|
+
url: '/${table.moduleName}/${table.businessName}',
|
1257
|
+
method: 'put',
|
1258
|
+
data: data
|
1259
|
+
})
|
1260
|
+
}
|
1261
|
+
|
1262
|
+
// 删除${table.tableComment}
|
1263
|
+
export function del${table.functionName}(${pk}) {
|
1264
|
+
return request({
|
1265
|
+
url: '/${table.moduleName}/${table.businessName}/' + ${pk},
|
1266
|
+
method: 'delete'
|
1267
|
+
})
|
1268
|
+
}
|
1269
|
+
`
|
1270
|
+
}
|
1271
|
+
|
1272
|
+
export function generator(table, columns, targetName) {
|
1273
|
+
|
1274
|
+
// console.log(table.tplWebType)
|
1275
|
+
|
1276
|
+
table = {...table}
|
1277
|
+
|
1278
|
+
table.className = table.className || hungarianToCamel(table.tableName)
|
1279
|
+
table.packageName = table.packageName || (table.tableName.startsWith('sys') ? 'system' : 'business')
|
1280
|
+
table.moduleName = table.moduleName || (table.tableName.startsWith('sys') ? 'system' : 'business')
|
1281
|
+
table.businessName = table.businessName || table.tableName
|
1282
|
+
table.functionName = table.functionName || hungarianToCamel(table.tableName)
|
1283
|
+
|
1284
|
+
table.permission = table.businessName.replace(/[_-]/g, ':')
|
1285
|
+
|
1286
|
+
if (!table.permission.includes(':')) {
|
1287
|
+
|
1288
|
+
table.permission = `${table.tableName.startsWith('sys') ? 'system' : 'business'}:${table.permission}`
|
1289
|
+
}
|
1290
|
+
|
1291
|
+
table.route = '/' + camelToHungarian(table.tableName).replace(/_/g, '/')
|
1292
|
+
|
1293
|
+
if (table.route.startsWith('/sys/')) {
|
1294
|
+
|
1295
|
+
table.route = '/system' + table.route.substring(4)
|
1296
|
+
}
|
1297
|
+
|
1298
|
+
table.businessName = table.businessName.replace(/[_-]/g, '/')
|
1299
|
+
|
1300
|
+
if (table.businessName.startsWith('sys/')) {
|
1301
|
+
|
1302
|
+
table.businessName = table.businessName.substring(4)
|
1303
|
+
}
|
1304
|
+
|
1305
|
+
if (table.businessName.startsWith('system/')) {
|
1306
|
+
|
1307
|
+
table.businessName = table.businessName.substring(7)
|
1308
|
+
}
|
1309
|
+
|
1310
|
+
table.functionName = table.functionName[0].toUpperCase() + table.functionName.substring(1)
|
1311
|
+
|
1312
|
+
let pk = columns.find(column => column.isPk === '1')
|
1313
|
+
|
1314
|
+
if (pk) {
|
1315
|
+
|
1316
|
+
pk = hungarianToCamel(pk.columnName)
|
1317
|
+
|
1318
|
+
} else {
|
1319
|
+
|
1320
|
+
pk = 'id'
|
1321
|
+
}
|
1322
|
+
|
1323
|
+
// console.log(table.functionName, pk)
|
1324
|
+
|
1325
|
+
return {
|
1326
|
+
[`vm/nodejs/${table.packageName}/${table.className}.mjs.vm`]: table.tplCategory === 'sql' ?
|
1327
|
+
createSqlMjsFile(table, columns) : table.tplCategory === 'obj' ?
|
1328
|
+
createMjsFile(table, targetName, columns) :
|
1329
|
+
createOtherMjsFile(table, columns),
|
1330
|
+
[`vm/vue/${table.moduleName}/${table.businessName}/index.vue.vm`]: table.tplWebType === 'element-plus' ?
|
1331
|
+
createVue3File(columns, table, pk) :
|
1332
|
+
createVueFile(columns, table, pk),
|
1333
|
+
[`vm/js/${table.moduleName}/${table.businessName}.js.vm`]: createApiFile(table, pk),
|
1334
|
+
}
|
1335
|
+
}
|