From 0f9e9cd2d945fe1983a3ced6a335ca1223c0d7e2 Mon Sep 17 00:00:00 2001 From: cool Date: Sat, 13 Jan 2024 16:28:45 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=BC=E5=AE=B9Mysql=E3=80=81PostgreSQL?= =?UTF-8?q?=E3=80=81Sqlite=E4=B8=89=E7=A7=8D=E6=95=B0=E6=8D=AE=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 24 +- package.json | 48 +- src/config/config.default.ts | 7 + src/config/config.local.ts | 6 +- src/configuration.ts | 5 + src/modules/base/controller/admin/sys/role.ts | 4 +- src/modules/base/db.json | 103 +++ src/modules/base/entity/sys/department.ts | 2 +- src/modules/base/entity/sys/log.ts | 2 +- src/modules/base/entity/sys/menu.ts | 3 +- src/modules/base/entity/sys/param.ts | 1 - .../base/entity/sys/role_department.ts | 4 +- src/modules/base/entity/sys/role_menu.ts | 4 +- src/modules/base/entity/sys/user.ts | 4 +- src/modules/base/entity/sys/user_role.ts | 4 +- src/modules/base/event/menu.ts | 33 +- src/modules/base/init.sql | 686 ------------------ src/modules/base/menu.json | 554 ++++++++++++++ src/modules/base/service/sys/department.ts | 31 +- src/modules/base/service/sys/menu.ts | 64 +- src/modules/base/service/sys/role.ts | 6 +- src/modules/base/service/sys/user.ts | 32 +- src/modules/cloud/entity/func/log.ts | 2 +- src/modules/cloud/init.sql | 17 - src/modules/cloud/menu.json | 245 +++++++ src/modules/cloud/service/db.ts | 8 +- src/modules/demo/entity/goods.ts | 8 +- src/modules/demo/service/goods.ts | 8 + src/modules/dict/db.json | 88 +++ src/modules/dict/init.sql | 50 -- src/modules/dict/menu.json | 124 ++++ src/modules/dict/service/info.ts | 14 +- src/modules/iot/entity/device.ts | 2 +- src/modules/iot/entity/message.ts | 2 +- src/modules/iot/menu.json | 100 +++ src/modules/recycle/entity/data.ts | 2 +- src/modules/recycle/init.sql | 3 - src/modules/recycle/menu.json | 64 ++ src/modules/recycle/service/data.ts | 4 +- src/modules/space/entity/info.ts | 2 +- src/modules/space/entity/type.ts | 2 +- src/modules/space/menu.json | 14 + src/modules/task/db.json | 40 + src/modules/task/entity/info.ts | 6 +- src/modules/task/entity/log.ts | 4 +- src/modules/task/init.sql | 17 - src/modules/task/menu.json | 40 + src/modules/task/service/info.ts | 9 +- src/modules/user/menu.json | 100 +++ 49 files changed, 1681 insertions(+), 921 deletions(-) create mode 100644 src/modules/base/db.json delete mode 100644 src/modules/base/init.sql create mode 100644 src/modules/base/menu.json delete mode 100644 src/modules/cloud/init.sql create mode 100644 src/modules/cloud/menu.json create mode 100644 src/modules/dict/db.json delete mode 100644 src/modules/dict/init.sql create mode 100644 src/modules/dict/menu.json create mode 100644 src/modules/iot/menu.json delete mode 100644 src/modules/recycle/init.sql create mode 100644 src/modules/recycle/menu.json create mode 100644 src/modules/space/menu.json create mode 100644 src/modules/task/db.json delete mode 100644 src/modules/task/init.sql create mode 100644 src/modules/task/menu.json create mode 100644 src/modules/user/menu.json diff --git a/README.md b/README.md index 2e5b013..bd33b79 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@

cool-admin(midway版)一个很酷的后台权限管理系统,开源免费,模块化、插件化、极速开发CRUD,方便快速构建迭代后台管理系统,支持serverless、docker、普通服务器等多种方式部署 -到 文档 进一步了解 +到 官网 进一步了解。

GitHub license GitHub tag @@ -12,17 +12,26 @@ ## 技术栈 -- 后端:**`node.js` `midway.js` `koa.js` `mysql` `typescript`** +- 后端:**`node.js` `midway.js` `koa.js` `typescript`** - 前端:**`vue.js` `element-plus` `jsx` `pinia` `vue-router`** +- 数据库:**`mysql` `postgresql` `sqlite`** 如果你是前端,后端的这些技术选型对你是特别友好的,前端开发者可以较快速地上手。 如果你是后端,Typescript 的语法又跟 java、php 等特别类似,一切看起来也是那么得熟悉。 +如果你想使用java版本后端,请移步[cool-admin-java](https://cool-js.com/admin/java/introduce.html) + +#### 官网 + +[https://cool-js.com](https://cool-js.com) + ## 演示 [AI极速编码](https://www.bilibili.com/video/BV1K84y137z1) +Admin Home + [https://show.cool-admin.com](https://show.cool-admin.com) - 账户:admin @@ -30,9 +39,6 @@ Admin Home -#### 文档 - -[https://cool-js.com](https://cool-js.com) #### 项目前端 @@ -46,9 +52,12 @@ #### 修改数据库配置,配置文件位于`src/config/config.local.ts` -数据库为 mysql(`>=5.7版本`),建议 8.0,node 版本(`>=16.x`),建议 18.x,首次启动会自动初始化并导入数据 +以Mysql为例,其他数据库请参考[数据库配置文档](https://cool-js.com/admin/node/quick.html#%E6%95%B0%E6%8D%AE%E5%BA%93%E9%85%8D%E7%BD%AE) + +Mysql(`>=5.7版本`),建议 8.0,node 版本(`>=16.x`),建议 18.x,首次启动会自动初始化并导入数据 ```ts +// mysql,驱动已经内置,无需安装 typeorm: { dataSource: { default: { @@ -72,7 +81,6 @@ typeorm: { }, }, ``` - #### 安装依赖并运行 ```bash @@ -81,7 +89,7 @@ $ npm run dev $ open http://localhost:8001/ ``` -注: `npm i`如果安装失败可以尝试使用[cnpm](https://developer.aliyun.com/mirror/NPM?from=tnpm),或者切换您的镜像源 +注: `npm i`如果安装失败可以尝试使用[cnpm](https://developer.aliyun.com/mirror/NPM?from=tnpm),或者切换您的镜像源,推荐使用[pnpm](https://pnpm.io/) ## CURD(快速增删改查) diff --git a/package.json b/package.json index 8b7a867..1251f75 100644 --- a/package.json +++ b/package.json @@ -6,50 +6,50 @@ "dependencies": { "@cool-midway/cache-manager-fs-hash": "^7.0.0", "@cool-midway/cloud": "^7.0.0", - "@cool-midway/core": "^7.0.2", - "@cool-midway/file": "^7.0.0", + "@cool-midway/core": "^7.1.0", + "@cool-midway/file": "^7.0.5", "@cool-midway/iot": "^7.0.0", "@cool-midway/pay": "^7.0.0", "@cool-midway/rpc": "^7.0.0", - "@cool-midway/sms": "^7.0.0", + "@cool-midway/sms": "^7.0.1", "@cool-midway/task": "^7.0.0", - "@midwayjs/bootstrap": "^3.12.3", - "@midwayjs/cache": "^3.12.3", - "@midwayjs/core": "^3.12.3", - "@midwayjs/cross-domain": "^3.12.3", - "@midwayjs/decorator": "^3.12.3", - "@midwayjs/info": "^3.12.3", - "@midwayjs/koa": "^3.12.3", - "@midwayjs/logger": "^2.18.0", - "@midwayjs/static-file": "^3.12.3", + "@midwayjs/bootstrap": "^3.13.7", + "@midwayjs/cache": "^3.13.9", + "@midwayjs/core": "^3.13.7", + "@midwayjs/cross-domain": "^3.13.9", + "@midwayjs/decorator": "^3.13.7", + "@midwayjs/info": "^3.13.9", + "@midwayjs/koa": "^3.13.9", + "@midwayjs/logger": "^3.2.0", + "@midwayjs/static-file": "^3.13.9", "@midwayjs/task": "^3.6.0", - "@midwayjs/typeorm": "^3.12.3", - "@midwayjs/validate": "^3.12.3", - "@midwayjs/view-ejs": "^3.12.3", - "axios": "^1.5.0", + "@midwayjs/typeorm": "^3.13.9", + "@midwayjs/validate": "^3.13.9", + "@midwayjs/view-ejs": "^3.13.9", + "axios": "^1.6.5", "ipip-ipdb": "^0.6.0", "jsonwebtoken": "^9.0.2", "lodash": "^4.17.21", "md5": "^2.3.0", "mini-svg-data-uri": "^1.4.4", - "moment": "^2.29.4", - "mysql2": "^3.6.1", + "moment": "^2.30.1", + "mysql2": "^3.7.0", "svg-captcha": "^1.4.0", - "svg2png-wasm": "^1.4.0", - "typeorm": "^0.3.17", + "svg2png-wasm": "^1.4.1", + "typeorm": "^0.3.19", "uuid": "^9.0.1" }, "devDependencies": { "@midwayjs/cli": "^2.1.1", - "@midwayjs/mock": "^3.12.3", - "@types/jest": "^29.5.4", - "@types/koa": "^2.13.8", + "@midwayjs/mock": "^3.13.9", + "@types/jest": "^29.5.11", + "@types/koa": "^2.14.0", "@types/node": "20", "cross-env": "^7.0.3", "jest": "^29.7.0", "mwts": "^1.3.0", "ts-jest": "^29.1.1", - "typescript": "~5.2.2" + "typescript": "~5.3.3" }, "engines": { "node": ">=12.0.0" diff --git a/src/config/config.default.ts b/src/config/config.default.ts index 44a9e2c..a37f6be 100644 --- a/src/config/config.default.ts +++ b/src/config/config.default.ts @@ -38,5 +38,12 @@ export default { // 本地上传 文件地址前缀 domain: 'http://127.0.0.1:8001', }, + // crud配置 + crud: { + // 插入模式,save不会校验字段(允许传入不存在的字段),insert会校验字段 + upsert: 'save', + // 软删除 + softDelete: true, + }, } as CoolConfig, } as MidwayConfig; diff --git a/src/config/config.local.ts b/src/config/config.local.ts index 31021b6..1c8e879 100644 --- a/src/config/config.local.ts +++ b/src/config/config.local.ts @@ -1,5 +1,6 @@ import { CoolConfig } from '@cool-midway/core'; import { MidwayConfig } from '@midwayjs/core'; +// import * as path from 'path'; /** * 本地开发 npm run dev 读取的配置文件 @@ -34,10 +35,5 @@ export default { initDB: true, // 是否自动导入模块菜单 initMenu: true, - // crud配置 - crud: { - // 软删除 - softDelete: true, - }, } as CoolConfig, } as MidwayConfig; diff --git a/src/configuration.ts b/src/configuration.ts index c18bc38..077cb91 100644 --- a/src/configuration.ts +++ b/src/configuration.ts @@ -13,6 +13,8 @@ import * as cloud from '@cool-midway/cloud'; import * as file from '@cool-midway/file'; import * as sms from '@cool-midway/sms'; import { ILogger } from '@midwayjs/logger'; +import { Repository } from 'typeorm'; +import { BaseSysRoleMenuEntity } from './modules/base/entity/sys/role_menu'; // import * as swagger from '@midwayjs/swagger'; // import * as rpc from '@cool-midway/rpc'; // import * as task from '@cool-midway/task'; @@ -70,5 +72,8 @@ export class ContainerLifeCycle { @Config('module') config; + @orm.InjectEntityModel(BaseSysRoleMenuEntity) + baseSysRoleMenuEntity: Repository; + async onReady() {} } diff --git a/src/modules/base/controller/admin/sys/role.ts b/src/modules/base/controller/admin/sys/role.ts index dd0d793..210dbe6 100644 --- a/src/modules/base/controller/admin/sys/role.ts +++ b/src/modules/base/controller/admin/sys/role.ts @@ -19,7 +19,7 @@ import { BaseSysRoleService } from '../../../service/sys/role'; }; }, pageQueryOp: { - keyWordLikeFields: ['name', 'label'], + keyWordLikeFields: ['a.name', 'a.label'], where: async (ctx: Context) => { const { userId, roleIds, username } = ctx.admin; return [ @@ -27,7 +27,7 @@ import { BaseSysRoleService } from '../../../service/sys/role'; ['label != :label', { label: 'admin' }], // 如果不是超管,只能看到自己新建的或者自己有的角色 [ - '(userId=:userId or id in (:roleIds))', + '(userId=:userId or id in (:...roleIds))', { userId, roleIds }, username !== 'admin', ], diff --git a/src/modules/base/db.json b/src/modules/base/db.json new file mode 100644 index 0000000..81ffd6f --- /dev/null +++ b/src/modules/base/db.json @@ -0,0 +1,103 @@ +{ + "base_sys_param": [ + { + "keyName": "rich", + "name": "富文本参数", + "data": "

这是一个富文本

xxx

xxxxxxxxxx


", + "dataType": 1, + "remark": null + }, + { + "keyName": "json", + "name": "JSON参数", + "data": "{\n \"code\": 111233\n}", + "dataType": 0, + "remark": null + }, + { + "keyName": "file", + "name": "文件", + "data": "", + "dataType": 2, + "remark": null + }, + { + "keyName": "text", + "name": "测试", + "data": "这是一段字符串", + "dataType": 0, + "remark": null + } + ], + "base_sys_conf": [ + { + "cKey": "logKeep", + "cValue": "31" + }, + { + "cKey": "recycleKeep", + "cValue": "31" + } + ], + "base_sys_department": [ + { + "id": 1, + "name": "COOL", + "parentId": null, + "orderNum": 0 + }, + { + "id": 11, + "name": "开发", + "parentId": 12, + "orderNum": 2 + }, + { + "id": 12, + "name": "测试", + "parentId": 1, + "orderNum": 1 + }, + { + "id": 13, + "name": "游客", + "parentId": 1, + "orderNum": 3 + } + ], + "base_sys_role": [ + { + "id": 1, + "userId": "1", + "name": "超管", + "label": "admin", + "remark": "最高权限的角色", + "relevance": 1, + "menuIdList": "null", + "departmentIdList": "null" + } + ], + "base_sys_user": [ + { + "id": 1, + "departmentId": 1, + "name": "超级管理员", + "username": "admin", + "password": "e10adc3949ba59abbe56e057f20f883e", + "passwordV": 7, + "nickName": "管理员", + "headImg": "https://cool-js.com/admin/headimg.jpg", + "phone": "18000000000", + "email": "team@cool-js.com", + "status": 1, + "remark": "拥有最高权限的用户", + "socketId": null + } + ], + "base_sys_user_role": [ + { + "userId": 1, + "roleId": 1 + } + ] +} \ No newline at end of file diff --git a/src/modules/base/entity/sys/department.ts b/src/modules/base/entity/sys/department.ts index b2c2186..f340ecc 100644 --- a/src/modules/base/entity/sys/department.ts +++ b/src/modules/base/entity/sys/department.ts @@ -9,7 +9,7 @@ export class BaseSysDepartmentEntity extends BaseEntity { @Column({ comment: '部门名称' }) name: string; - @Column({ comment: '上级部门ID', type: 'bigint', nullable: true }) + @Column({ comment: '上级部门ID', nullable: true }) parentId: number; @Column({ comment: '排序', default: 0 }) diff --git a/src/modules/base/entity/sys/log.ts b/src/modules/base/entity/sys/log.ts index 437c6e7..2ed30a6 100644 --- a/src/modules/base/entity/sys/log.ts +++ b/src/modules/base/entity/sys/log.ts @@ -7,7 +7,7 @@ import { Column, Index, Entity } from 'typeorm'; @Entity('base_sys_log') export class BaseSysLogEntity extends BaseEntity { @Index() - @Column({ comment: '用户ID', nullable: true, type: 'bigint' }) + @Column({ comment: '用户ID', nullable: true }) userId: number; @Index() diff --git a/src/modules/base/entity/sys/menu.ts b/src/modules/base/entity/sys/menu.ts index 3055162..da44549 100644 --- a/src/modules/base/entity/sys/menu.ts +++ b/src/modules/base/entity/sys/menu.ts @@ -6,7 +6,7 @@ import { Column, Entity } from 'typeorm'; */ @Entity('base_sys_menu') export class BaseSysMenuEntity extends BaseEntity { - @Column({ comment: '父菜单ID', type: 'bigint', nullable: true }) + @Column({ comment: '父菜单ID', nullable: true }) parentId: number; @Column({ comment: '菜单名称' }) @@ -21,7 +21,6 @@ export class BaseSysMenuEntity extends BaseEntity { @Column({ comment: '类型 0-目录 1-菜单 2-按钮', default: 0, - type: 'tinyint', }) type: number; diff --git a/src/modules/base/entity/sys/param.ts b/src/modules/base/entity/sys/param.ts index 6167dfa..f147f89 100644 --- a/src/modules/base/entity/sys/param.ts +++ b/src/modules/base/entity/sys/param.ts @@ -19,7 +19,6 @@ export class BaseSysParamEntity extends BaseEntity { @Column({ comment: '数据类型 0-字符串 1-富文本 2-文件 ', default: 0, - type: 'tinyint', }) dataType: number; diff --git a/src/modules/base/entity/sys/role_department.ts b/src/modules/base/entity/sys/role_department.ts index 39afa99..e0a52a8 100644 --- a/src/modules/base/entity/sys/role_department.ts +++ b/src/modules/base/entity/sys/role_department.ts @@ -6,9 +6,9 @@ import { Column, Entity } from 'typeorm'; */ @Entity('base_sys_role_department') export class BaseSysRoleDepartmentEntity extends BaseEntity { - @Column({ comment: '角色ID', type: 'bigint' }) + @Column({ comment: '角色ID' }) roleId: number; - @Column({ comment: '部门ID', type: 'bigint' }) + @Column({ comment: '部门ID' }) departmentId: number; } diff --git a/src/modules/base/entity/sys/role_menu.ts b/src/modules/base/entity/sys/role_menu.ts index d608177..667e312 100644 --- a/src/modules/base/entity/sys/role_menu.ts +++ b/src/modules/base/entity/sys/role_menu.ts @@ -6,9 +6,9 @@ import { Column, Entity } from 'typeorm'; */ @Entity('base_sys_role_menu') export class BaseSysRoleMenuEntity extends BaseEntity { - @Column({ comment: '角色ID', type: 'bigint' }) + @Column({ comment: '角色ID' }) roleId: number; - @Column({ comment: '菜单ID', type: 'bigint' }) + @Column({ comment: '菜单ID' }) menuId: number; } diff --git a/src/modules/base/entity/sys/user.ts b/src/modules/base/entity/sys/user.ts index db384cc..a97e7c9 100644 --- a/src/modules/base/entity/sys/user.ts +++ b/src/modules/base/entity/sys/user.ts @@ -7,7 +7,7 @@ import { Column, Index, Entity } from 'typeorm'; @Entity('base_sys_user') export class BaseSysUserEntity extends BaseEntity { @Index() - @Column({ comment: '部门ID', type: 'bigint', nullable: true }) + @Column({ comment: '部门ID', nullable: true }) departmentId: number; @Column({ comment: '姓名', nullable: true }) @@ -42,7 +42,7 @@ export class BaseSysUserEntity extends BaseEntity { @Column({ comment: '备注', nullable: true }) remark: string; - @Column({ comment: '状态 0:禁用 1:启用', default: 1, type: 'tinyint' }) + @Column({ comment: '状态 0-禁用 1-启用', default: 1 }) status: number; // 部门名称 departmentName: string; diff --git a/src/modules/base/entity/sys/user_role.ts b/src/modules/base/entity/sys/user_role.ts index e2e63ae..c15f00c 100644 --- a/src/modules/base/entity/sys/user_role.ts +++ b/src/modules/base/entity/sys/user_role.ts @@ -6,9 +6,9 @@ import { Column, Entity } from 'typeorm'; */ @Entity('base_sys_user_role') export class BaseSysUserRoleEntity extends BaseEntity { - @Column({ comment: '用户ID', type: 'bigint' }) + @Column({ comment: '用户ID' }) userId: number; - @Column({ comment: '角色ID', type: 'bigint' }) + @Column({ comment: '角色ID' }) roleId: number; } diff --git a/src/modules/base/event/menu.ts b/src/modules/base/event/menu.ts index bb3a19e..edcbaf1 100644 --- a/src/modules/base/event/menu.ts +++ b/src/modules/base/event/menu.ts @@ -1,25 +1,36 @@ import { CoolEvent, Event } from '@cool-midway/core'; import { BaseSysMenuService } from '../service/sys/menu'; -import { ILogger, Inject, Logger } from '@midwayjs/core'; +import { + App, + ILogger, + IMidwayApplication, + Inject, + Logger, +} from '@midwayjs/core'; /** * 导入菜单 */ @CoolEvent() export class BaseMenuEvent { - @Inject() - baseSysMenuService: BaseSysMenuService; - @Logger() coreLogger: ILogger; + @Inject() + baseSysMenuService: BaseSysMenuService; + + @App() + app: IMidwayApplication; + @Event('onMenuImport') - async onMenuImport(module, data) { - await this.baseSysMenuService.import(data); - this.coreLogger.info( - '\x1B[36m [cool:module:base] midwayjs cool module base import [' + - module + - '] module menu success \x1B[0m' - ); + async onMenuImport(datas) { + for (const module in datas) { + await this.baseSysMenuService.import(datas[module]); + this.coreLogger.info( + '\x1B[36m [cool:module:base] midwayjs cool module base import [' + + module + + '] module menu success \x1B[0m' + ); + } } } diff --git a/src/modules/base/init.sql b/src/modules/base/init.sql deleted file mode 100644 index 5d95a4e..0000000 --- a/src/modules/base/init.sql +++ /dev/null @@ -1,686 +0,0 @@ - --- ---------------------------- --- Table structure for base_sys_conf --- ---------------------------- -DROP TABLE IF EXISTS `base_sys_conf`; -CREATE TABLE `base_sys_conf` ( - `id` int NOT NULL AUTO_INCREMENT COMMENT 'ID', - `createTime` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) COMMENT '创建时间', - `updateTime` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6) COMMENT '更新时间', - `cKey` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '配置键', - `cValue` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '配置值', - PRIMARY KEY (`id`) USING BTREE, - UNIQUE KEY `IDX_9be195d27767b4485417869c3a` (`cKey`) USING BTREE, - KEY `IDX_905208f206a3ff9fd513421971` (`createTime`) USING BTREE, - KEY `IDX_4c6f27f6ecefe51a5a196a047a` (`updateTime`) USING BTREE -) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; - --- ---------------------------- --- Records of base_sys_conf --- ---------------------------- -BEGIN; -INSERT INTO `base_sys_conf` VALUES (1, '2021-02-25 14:23:26.810981', '2021-02-25 14:23:26.810981', 'logKeep', '31'); -COMMIT; - --- ---------------------------- --- Table structure for base_sys_department --- ---------------------------- -DROP TABLE IF EXISTS `base_sys_department`; -CREATE TABLE `base_sys_department` ( - `id` int NOT NULL AUTO_INCREMENT COMMENT 'ID', - `createTime` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) COMMENT '创建时间', - `updateTime` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6) COMMENT '更新时间', - `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '部门名称', - `parentId` bigint DEFAULT NULL COMMENT '上级部门ID', - `orderNum` int NOT NULL DEFAULT '0' COMMENT '排序', - PRIMARY KEY (`id`) USING BTREE, - KEY `IDX_be4c53cd671384fa588ca9470a` (`createTime`) USING BTREE, - KEY `IDX_ca1473a793961ec55bc0c8d268` (`updateTime`) USING BTREE -) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; - --- ---------------------------- --- Records of base_sys_department --- ---------------------------- -BEGIN; -INSERT INTO `base_sys_department` VALUES (1, '2021-02-24 21:17:11.971397', '2023-03-07 00:39:53.000000', 'COOL', NULL, 0); -INSERT INTO `base_sys_department` VALUES (11, '2021-02-26 14:17:06.690613', '2023-03-07 00:39:53.000000', '开发', 12, 2); -INSERT INTO `base_sys_department` VALUES (12, '2021-02-26 14:17:11.576369', '2023-03-07 00:39:53.000000', '测试', 1, 1); -INSERT INTO `base_sys_department` VALUES (13, '2021-02-26 14:28:59.685177', '2023-03-07 00:39:53.000000', '游客', 1, 3); -COMMIT; - --- ---------------------------- --- Table structure for base_sys_log --- ---------------------------- -DROP TABLE IF EXISTS `base_sys_log`; -CREATE TABLE `base_sys_log` ( - `id` int NOT NULL AUTO_INCREMENT COMMENT 'ID', - `createTime` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) COMMENT '创建时间', - `updateTime` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6) COMMENT '更新时间', - `userId` bigint DEFAULT NULL COMMENT '用户ID', - `ipAddr` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'ip地址', - `params` json DEFAULT NULL COMMENT '参数', - `action` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '行为', - `ip` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'ip', - PRIMARY KEY (`id`) USING BTREE, - KEY `IDX_51a2caeb5713efdfcb343a8772` (`userId`) USING BTREE, - KEY `IDX_a03a27f75cf8d502b3060823e1` (`ipAddr`) USING BTREE, - KEY `IDX_c9382b76219a1011f7b8e7bcd1` (`createTime`) USING BTREE, - KEY `IDX_bfd44e885b470da43bcc39aaa7` (`updateTime`) USING BTREE, - KEY `IDX_938f886fb40e163db174b7f6c3` (`action`) USING BTREE, - KEY `IDX_24e18767659f8c7142580893f2` (`ip`) USING BTREE -) ENGINE=InnoDB AUTO_INCREMENT=96 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; - --- ---------------------------- --- Table structure for base_sys_menu --- ---------------------------- -DROP TABLE IF EXISTS `base_sys_menu`; -CREATE TABLE `base_sys_menu` ( - `id` int NOT NULL AUTO_INCREMENT COMMENT 'ID', - `createTime` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) COMMENT '创建时间', - `updateTime` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6) COMMENT '更新时间', - `parentId` bigint DEFAULT NULL COMMENT '父菜单ID', - `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '菜单名称', - `router` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '菜单地址', - `perms` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '权限标识', - `type` tinyint NOT NULL DEFAULT '0' COMMENT '类型 0-目录 1-菜单 2-按钮', - `icon` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '图标', - `orderNum` int NOT NULL DEFAULT '0' COMMENT '排序', - `viewPath` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '视图地址', - `keepAlive` tinyint NOT NULL DEFAULT '1' COMMENT '路由缓存', - `isShow` tinyint NOT NULL DEFAULT '1' COMMENT '是否显示', - PRIMARY KEY (`id`) USING BTREE, - KEY `IDX_05e3d6a56604771a6da47ebf8e` (`createTime`) USING BTREE, - KEY `IDX_d5203f18daaf7c3fe0ab34497f` (`updateTime`) USING BTREE -) ENGINE=InnoDB AUTO_INCREMENT=453 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; - --- ---------------------------- --- Records of base_sys_menu --- ---------------------------- -BEGIN; -INSERT INTO `base_sys_menu` VALUES (2, '2019-09-11 11:14:47.000000', '2023-09-11 14:53:40.149000', NULL, '系统管理', '/sys', NULL, 0, 'icon-system', 2, NULL, 1, 1); -INSERT INTO `base_sys_menu` VALUES (8, '1900-01-20 23:19:57.000000', '2023-09-13 18:12:57.980000', 27, '菜单列表', '/sys/menu', NULL, 1, 'icon-menu', 2, 'modules/base/views/menu/index.vue', 1, 1); -INSERT INTO `base_sys_menu` VALUES (10, '1900-01-20 00:19:27.325000', '1900-01-20 00:19:27.325000', 8, '新增', NULL, 'base:sys:menu:add', 2, NULL, 1, NULL, 0, 1); -INSERT INTO `base_sys_menu` VALUES (11, '1900-01-20 00:19:51.101000', '1900-01-20 00:19:51.101000', 8, '删除', NULL, 'base:sys:menu:delete', 2, NULL, 2, NULL, 0, 1); -INSERT INTO `base_sys_menu` VALUES (13, '1900-01-20 00:20:19.341000', '1900-01-20 00:20:19.341000', 8, '查询', NULL, 'base:sys:menu:page,base:sys:menu:list,base:sys:menu:info', 2, NULL, 4, NULL, 0, 1); -INSERT INTO `base_sys_menu` VALUES (22, '2019-09-12 00:34:01.000000', '2023-02-17 16:14:37.299000', 27, '角色列表', '/sys/role', NULL, 1, 'icon-dept', 3, 'cool/modules/base/views/role.vue', 1, 1); -INSERT INTO `base_sys_menu` VALUES (23, '1900-01-20 00:34:23.459000', '1900-01-20 00:34:23.459000', 22, '新增', NULL, 'base:sys:role:add', 2, NULL, 1, NULL, 0, 1); -INSERT INTO `base_sys_menu` VALUES (24, '1900-01-20 00:34:40.523000', '1900-01-20 00:34:40.523000', 22, '删除', NULL, 'base:sys:role:delete', 2, NULL, 2, NULL, 0, 1); -INSERT INTO `base_sys_menu` VALUES (25, '1900-01-20 00:34:53.306000', '1900-01-20 00:34:53.306000', 22, '修改', NULL, 'base:sys:role:update', 2, NULL, 3, NULL, 0, 1); -INSERT INTO `base_sys_menu` VALUES (26, '1900-01-20 00:35:05.024000', '1900-01-20 00:35:05.024000', 22, '查询', NULL, 'base:sys:role:page,base:sys:role:list,base:sys:role:info', 2, NULL, 4, NULL, 0, 1); -INSERT INTO `base_sys_menu` VALUES (27, '2019-09-12 15:52:44.000000', '2023-09-11 14:52:08.845000', 2, '权限管理', NULL, NULL, 0, 'icon-auth', 1, NULL, 0, 1); -INSERT INTO `base_sys_menu` VALUES (29, '2019-09-12 17:35:51.000000', '2021-03-08 23:01:39.000000', 105, '请求日志', '/sys/log', NULL, 1, 'icon-log', 1, 'cool/modules/base/views/log.vue', 1, 1); -INSERT INTO `base_sys_menu` VALUES (30, '2019-09-12 17:37:03.000000', '2021-03-03 10:16:26.000000', 29, '权限', NULL, 'base:sys:log:page,base:sys:log:clear,base:sys:log:getKeep,base:sys:log:setKeep', 2, NULL, 1, NULL, 0, 1); -INSERT INTO `base_sys_menu` VALUES (47, '2019-11-08 09:35:08.000000', '2023-09-20 18:28:26.532000', NULL, '框架教程', '/tutorial', NULL, 0, 'icon-task', 98, NULL, 1, 1); -INSERT INTO `base_sys_menu` VALUES (48, '2019-11-08 09:35:53.000000', '2021-03-03 11:03:21.000000', 47, '文档', '/tutorial/doc', NULL, 1, 'icon-log', 0, 'https://admin.cool-js.com', 1, 1); -INSERT INTO `base_sys_menu` VALUES (59, '2019-11-18 16:50:27.000000', '2019-11-18 16:50:27.000000', 97, '部门列表', NULL, 'base:sys:department:list', 2, NULL, 0, NULL, 1, 1); -INSERT INTO `base_sys_menu` VALUES (60, '2019-11-18 16:50:45.000000', '2019-11-18 16:50:45.000000', 97, '新增部门', NULL, 'base:sys:department:add', 2, NULL, 0, NULL, 1, 1); -INSERT INTO `base_sys_menu` VALUES (61, '2019-11-18 16:50:59.000000', '2019-11-18 16:50:59.000000', 97, '更新部门', NULL, 'base:sys:department:update', 2, NULL, 0, NULL, 1, 1); -INSERT INTO `base_sys_menu` VALUES (62, '2019-11-18 16:51:13.000000', '2019-11-18 16:51:13.000000', 97, '删除部门', NULL, 'base:sys:department:delete', 2, NULL, 0, NULL, 1, 1); -INSERT INTO `base_sys_menu` VALUES (63, '2019-11-18 17:49:35.000000', '2019-11-18 17:49:35.000000', 97, '部门排序', NULL, 'base:sys:department:order', 2, NULL, 0, NULL, 1, 1); -INSERT INTO `base_sys_menu` VALUES (65, '2019-11-18 23:59:21.000000', '2019-11-18 23:59:21.000000', 97, '用户转移', NULL, 'base:sys:user:move', 2, NULL, 0, NULL, 1, 1); -INSERT INTO `base_sys_menu` VALUES (78, '2019-12-10 13:27:56.000000', '2023-02-17 16:05:06.071000', 2, '参数配置', NULL, NULL, 0, 'icon-params', 3, NULL, 1, 1); -INSERT INTO `base_sys_menu` VALUES (79, '1900-01-20 13:29:33.000000', '2021-03-08 23:01:48.000000', 78, '参数列表', '/sys/param', NULL, 1, 'icon-menu', 0, 'cool/modules/base/views/param.vue', 1, 1); -INSERT INTO `base_sys_menu` VALUES (80, '1900-01-20 13:29:50.146000', '1900-01-20 13:29:50.146000', 79, '新增', NULL, 'base:sys:param:add', 2, NULL, 0, NULL, 1, 1); -INSERT INTO `base_sys_menu` VALUES (81, '1900-01-20 13:30:10.030000', '1900-01-20 13:30:10.030000', 79, '修改', NULL, 'base:sys:param:info,base:sys:param:update', 2, NULL, 0, NULL, 1, 1); -INSERT INTO `base_sys_menu` VALUES (82, '1900-01-20 13:30:25.791000', '1900-01-20 13:30:25.791000', 79, '删除', NULL, 'base:sys:param:delete', 2, NULL, 0, NULL, 1, 1); -INSERT INTO `base_sys_menu` VALUES (83, '1900-01-20 13:30:40.469000', '1900-01-20 13:30:40.469000', 79, '查看', NULL, 'base:sys:param:page,base:sys:param:list,base:sys:param:info', 2, NULL, 0, NULL, 1, 1); -INSERT INTO `base_sys_menu` VALUES (84, '2020-07-25 16:21:30.000000', '2023-09-28 16:36:33.673000', NULL, '通用', NULL, NULL, 0, 'icon-radioboxfill', 99, NULL, 1, 0); -INSERT INTO `base_sys_menu` VALUES (85, '2020-07-25 16:22:14.000000', '2021-03-03 10:36:00.000000', 84, '图片上传', NULL, 'space:info:page,space:info:list,space:info:info,space:info:add,space:info:delete,space:info:update,space:type:page,space:type:list,space:type:info,space:type:add,space:type:delete,space:type:update', 2, NULL, 1, NULL, 1, 1); -INSERT INTO `base_sys_menu` VALUES (97, '1900-01-20 14:14:02.000000', '2023-02-28 15:51:30.854000', 27, '用户列表', '/sys/user', NULL, 1, 'icon-user', 0, 'modules/base/views/user/index.vue', 1, 1); -INSERT INTO `base_sys_menu` VALUES (98, '1900-01-20 14:14:13.528000', '1900-01-20 14:14:13.528000', 97, '新增', NULL, 'base:sys:user:add', 2, NULL, 0, NULL, 1, 1); -INSERT INTO `base_sys_menu` VALUES (99, '1900-01-20 14:14:22.823000', '1900-01-20 14:14:22.823000', 97, '删除', NULL, 'base:sys:user:delete', 2, NULL, 0, NULL, 1, 1); -INSERT INTO `base_sys_menu` VALUES (100, '1900-01-20 14:14:33.973000', '1900-01-20 14:14:33.973000', 97, '修改', NULL, 'base:sys:user:delete,base:sys:user:update', 2, NULL, 0, NULL, 1, 1); -INSERT INTO `base_sys_menu` VALUES (101, '2021-01-12 14:14:51.000000', '2021-01-12 14:14:51.000000', 97, '查询', NULL, 'base:sys:user:page,base:sys:user:list,base:sys:user:info', 2, NULL, 0, NULL, 1, 1); -INSERT INTO `base_sys_menu` VALUES (105, '2021-01-21 10:42:55.000000', '2023-02-17 16:05:19.312000', 2, '监控管理', NULL, NULL, 0, 'icon-monitor', 9, NULL, 1, 1); -INSERT INTO `base_sys_menu` VALUES (117, '2021-03-05 10:58:25.000000', '2023-09-20 17:20:02.224000', NULL, '任务管理', NULL, NULL, 0, 'icon-activity', 97, NULL, 1, 1); -INSERT INTO `base_sys_menu` VALUES (118, '2021-03-05 10:59:42.000000', '2023-02-14 14:05:48.454000', 117, '任务列表', '/task/list', NULL, 1, 'icon-menu', 0, 'modules/task/views/list.vue', 1, 1); -INSERT INTO `base_sys_menu` VALUES (119, '2021-03-05 11:00:00.000000', '2021-03-05 11:00:00.000000', 118, '权限', NULL, 'task:info:page,task:info:list,task:info:info,task:info:add,task:info:delete,task:info:update,task:info:stop,task:info:start,task:info:once,task:info:log', 2, NULL, 0, NULL, 1, 1); -INSERT INTO `base_sys_menu` VALUES (197, '2022-07-05 16:05:27.403000', '2023-09-11 14:50:59.077000', NULL, '字典管理', NULL, NULL, 0, 'icon-dict', 3, NULL, 1, 1); -INSERT INTO `base_sys_menu` VALUES (198, '2022-07-05 16:08:50.307000', '2023-09-11 12:28:11.350000', 197, '字典列表', '/dict/list', NULL, 1, 'icon-menu', 1, 'modules/dict/views/list.vue', 1, 1); -INSERT INTO `base_sys_menu` VALUES (199, '2022-07-05 16:08:50.748162', '2022-07-05 16:08:50.748162', 198, '删除', NULL, 'dict:info:delete', 2, NULL, 0, NULL, 1, 1); -INSERT INTO `base_sys_menu` VALUES (200, '2022-07-05 16:08:50.800623', '2022-07-05 16:08:50.800623', 198, '修改', NULL, 'dict:info:update,dict:info:info', 2, NULL, 0, NULL, 1, 1); -INSERT INTO `base_sys_menu` VALUES (201, '2022-07-05 16:08:50.859141', '2022-07-05 16:08:50.859141', 198, '获得字典数据', NULL, 'dict:info:data', 2, NULL, 0, NULL, 1, 1); -INSERT INTO `base_sys_menu` VALUES (202, '2022-07-05 16:08:50.916874', '2022-07-05 16:08:50.916874', 198, '单个信息', NULL, 'dict:info:info', 2, NULL, 0, NULL, 1, 1); -INSERT INTO `base_sys_menu` VALUES (203, '2022-07-05 16:08:50.972783', '2022-07-05 16:08:50.972783', 198, '列表查询', NULL, 'dict:info:list', 2, NULL, 0, NULL, 1, 1); -INSERT INTO `base_sys_menu` VALUES (204, '2022-07-05 16:08:51.030928', '2022-07-05 16:08:51.030928', 198, '分页查询', NULL, 'dict:info:page', 2, NULL, 0, NULL, 1, 1); -INSERT INTO `base_sys_menu` VALUES (205, '2022-07-05 16:08:51.087883', '2022-07-05 16:08:51.087883', 198, '新增', NULL, 'dict:info:add', 2, NULL, 0, NULL, 1, 1); -INSERT INTO `base_sys_menu` VALUES (206, '2022-07-06 10:41:26.503000', '2022-07-06 10:41:37.000000', 198, '组权限', NULL, 'dict:type:list,dict:type:update,dict:type:delete,dict:type:add', 2, NULL, 0, NULL, 1, 1); -INSERT INTO `base_sys_menu` VALUES (228, '2023-02-13 14:57:10.974000', '2023-09-11 14:58:58.839000', NULL, '数据管理', NULL, NULL, 0, 'icon-data', 3, NULL, 1, 1); -INSERT INTO `base_sys_menu` VALUES (229, '2023-02-13 14:57:47.855000', '2023-02-17 16:04:57.051000', 228, '数据回收站', '/recycle/data', NULL, 1, 'icon-delete', 1, 'modules/recycle/views/data.vue', 1, 1); -INSERT INTO `base_sys_menu` VALUES (230, '2023-02-13 14:57:48.293292', '2023-02-13 14:57:48.293292', 229, '恢复数据', NULL, 'recycle:data:restore', 2, NULL, 0, NULL, 1, 1); -INSERT INTO `base_sys_menu` VALUES (231, '2023-02-13 14:57:48.293292', '2023-02-13 14:57:48.293292', 229, '单个信息', NULL, 'recycle:data:info', 2, NULL, 0, NULL, 1, 1); -INSERT INTO `base_sys_menu` VALUES (232, '2023-02-13 14:57:48.293292', '2023-02-13 14:57:48.293292', 229, '分页查询', NULL, 'recycle:data:page', 2, NULL, 0, NULL, 1, 1); -INSERT INTO `base_sys_menu` VALUES (233, '2023-02-13 19:29:49.240000', '2023-09-20 17:19:56.797000', NULL, '物联管理', NULL, NULL, 0, 'icon-iot', 4, NULL, 1, 1); -INSERT INTO `base_sys_menu` VALUES (234, '2023-02-13 19:31:31.890000', '2023-09-20 17:19:58.437000', 233, 'MQTT', '/iot/device', NULL, 1, 'icon-device', 1, 'modules/iot/views/device.vue', 1, 1); -INSERT INTO `base_sys_menu` VALUES (235, '2023-02-13 19:32:58.637593', '2023-02-13 19:32:58.637593', 234, '删除', NULL, 'iot:device:delete', 2, NULL, 0, NULL, 1, 1); -INSERT INTO `base_sys_menu` VALUES (236, '2023-02-13 19:32:58.637593', '2023-02-13 19:32:58.637593', 234, '单个信息', NULL, 'iot:device:info', 2, NULL, 0, NULL, 1, 1); -INSERT INTO `base_sys_menu` VALUES (237, '2023-02-13 19:32:58.637593', '2023-02-13 19:32:58.637593', 234, '列表查询', NULL, 'iot:device:list', 2, NULL, 0, NULL, 1, 1); -INSERT INTO `base_sys_menu` VALUES (238, '2023-02-13 19:32:58.637593', '2023-02-13 19:32:58.637593', 234, '分页查询', NULL, 'iot:device:page', 2, NULL, 0, NULL, 1, 1); -INSERT INTO `base_sys_menu` VALUES (239, '2023-02-15 11:21:16.610000', '2023-09-14 15:11:33.154000', NULL, '文件管理', '/upload/list', NULL, 1, 'icon-log', 97, 'modules/upload/views/list.vue', 1, 1); -INSERT INTO `base_sys_menu` VALUES (240, '2023-02-15 14:34:46.552000', '2023-09-20 17:19:59.718000', NULL, '函数开发', NULL, NULL, 0, 'icon-fx', 6, NULL, 1, 1); -INSERT INTO `base_sys_menu` VALUES (241, '2023-02-15 14:35:31.765000', '2023-02-17 16:04:36.963000', 240, '云数据库', '/cloud/db', NULL, 1, 'icon-db', 1, 'modules/cloud/views/db.vue', 1, 1); -INSERT INTO `base_sys_menu` VALUES (242, '2023-02-15 14:33:24.192728', '2023-02-15 14:33:24.192728', 241, '初始化Entity', NULL, 'cloud:db:initEntity', 2, NULL, 0, NULL, 1, 1); -INSERT INTO `base_sys_menu` VALUES (243, '2023-02-15 14:33:24.192728', '2023-02-15 14:33:24.192728', 241, '删除', NULL, 'cloud:db:delete', 2, NULL, 0, NULL, 1, 1); -INSERT INTO `base_sys_menu` VALUES (244, '2023-02-15 14:33:24.192728', '2023-02-15 14:33:24.192728', 241, '修改', NULL, 'cloud:db:update,cloud:db:info', 2, NULL, 0, NULL, 1, 1); -INSERT INTO `base_sys_menu` VALUES (245, '2023-02-15 14:33:24.192728', '2023-02-15 14:33:24.192728', 241, '数据操作测试', NULL, 'cloud:db:data', 2, NULL, 0, NULL, 1, 1); -INSERT INTO `base_sys_menu` VALUES (246, '2023-02-15 14:33:24.192728', '2023-02-15 14:33:24.192728', 241, '单个信息', NULL, 'cloud:db:info', 2, NULL, 0, NULL, 1, 1); -INSERT INTO `base_sys_menu` VALUES (247, '2023-02-15 14:33:24.192728', '2023-02-15 14:33:24.192728', 241, '列表查询', NULL, 'cloud:db:list', 2, NULL, 0, NULL, 1, 1); -INSERT INTO `base_sys_menu` VALUES (248, '2023-02-15 14:33:24.192728', '2023-02-15 14:33:24.192728', 241, '分页查询', NULL, 'cloud:db:page', 2, NULL, 0, NULL, 1, 1); -INSERT INTO `base_sys_menu` VALUES (249, '2023-02-15 14:33:24.192728', '2023-02-15 14:33:24.192728', 241, '新增', NULL, 'cloud:db:add', 2, NULL, 0, NULL, 1, 1); -INSERT INTO `base_sys_menu` VALUES (250, '2023-02-15 15:17:10.524000', '2023-02-15 15:17:10.524000', 240, '云函数', '/cloud/func/info', NULL, 1, 'icon-menu', 2, 'modules/cloud/views/func/info.vue', 1, 1); -INSERT INTO `base_sys_menu` VALUES (251, '2023-02-15 15:15:02.900934', '2023-02-28 16:08:47.978000', 250, '调用云函数', NULL, 'cloud:func:info:invoke', 2, NULL, 98, NULL, 1, 1); -INSERT INTO `base_sys_menu` VALUES (252, '2023-02-15 15:15:02.900934', '2023-02-15 15:15:02.900934', 250, '删除', NULL, 'cloud:func:info:delete', 2, NULL, 0, NULL, 1, 1); -INSERT INTO `base_sys_menu` VALUES (253, '2023-02-15 15:15:02.900934', '2023-02-15 15:15:02.900934', 250, '修改', NULL, 'cloud:func:info:update,cloud:func:info:info', 2, NULL, 0, NULL, 1, 1); -INSERT INTO `base_sys_menu` VALUES (254, '2023-02-15 15:15:02.900934', '2023-02-15 15:15:02.900934', 250, '单个信息', NULL, 'cloud:func:info:info', 2, NULL, 0, NULL, 1, 1); -INSERT INTO `base_sys_menu` VALUES (255, '2023-02-15 15:15:02.900934', '2023-02-15 15:15:02.900934', 250, '列表查询', NULL, 'cloud:func:info:list', 2, NULL, 0, NULL, 1, 1); -INSERT INTO `base_sys_menu` VALUES (256, '2023-02-15 15:15:02.900934', '2023-02-15 15:15:02.900934', 250, '分页查询', NULL, 'cloud:func:info:page', 2, NULL, 0, NULL, 1, 1); -INSERT INTO `base_sys_menu` VALUES (257, '2023-02-15 15:15:02.900934', '2023-02-15 15:15:02.900934', 250, '新增', NULL, 'cloud:func:info:add', 2, NULL, 0, NULL, 1, 1); -INSERT INTO `base_sys_menu` VALUES (259, '2023-02-17 15:25:20.762000', '2023-02-17 15:25:20.762000', 234, '修改', NULL, 'iot:device:info,iot:device:update', 2, NULL, 0, NULL, 1, 1); -INSERT INTO `base_sys_menu` VALUES (260, '2023-02-17 16:26:55.842000', '2023-09-20 17:20:00.932000', NULL, '页面设计', '/design/page', NULL, 1, 'icon-design', 7, 'modules/design/views/page.vue', 1, 1); -INSERT INTO `base_sys_menu` VALUES (261, '2023-02-20 00:12:20.783000', '2023-02-20 00:12:20.783000', 234, '新增', NULL, 'iot:device:add', 2, NULL, 0, NULL, 1, 1); -INSERT INTO `base_sys_menu` VALUES (262, '2023-02-20 00:32:45.656000', '2023-02-28 16:08:42.999000', 250, '云函数开发', NULL, 'cloud:func:info:info,cloud:func:info:update,cloud:func:info:invoke', 2, NULL, 99, NULL, 1, 1); -INSERT INTO `base_sys_menu` VALUES (263, '2023-02-20 00:33:17.789000', '2023-02-20 00:33:17.789000', 250, '查看日志', NULL, 'cloud:func:log:page', 2, NULL, 0, NULL, 1, 1); -INSERT INTO `base_sys_menu` VALUES (446, '2023-03-06 22:50:24.125000', '2023-03-06 22:50:24.125000', 8, '参数', '/test/aa', NULL, 1, 'icon-goods', 0, 'modules/base/views/info.vue', 1, 1); -INSERT INTO `base_sys_menu` VALUES (447, '2023-03-07 10:26:51.746000', '2023-09-14 16:03:49.682000', NULL, '工作台', NULL, NULL, 0, 'icon-workbench', 1, NULL, 1, 1); -INSERT INTO `base_sys_menu` VALUES (448, '2023-03-07 10:27:21.084000', '2023-03-07 10:27:21.084000', 447, '组件预览', '/demo', NULL, 1, 'icon-favor', 1, 'modules/demo/views/demo.vue', 1, 1); -INSERT INTO `base_sys_menu` VALUES (450, '2023-03-07 10:28:17.692000', '2023-09-11 12:29:43.381000', 447, 'crud 示例', '/demo/crud', NULL, 1, 'icon-favor', 1, 'modules/demo/views/crud.vue', 1, 1); -INSERT INTO `base_sys_menu` VALUES (451, '2023-03-07 10:28:44.322000', '2023-08-16 11:41:58.220000', 447, '编辑器', '/demo/editor', NULL, 1, 'icon-favor', 4, 'modules/demo/views/editor.vue', 1, 1); -INSERT INTO `base_sys_menu` VALUES (452, '2023-03-07 10:29:06.344000', '2023-08-16 11:41:31.982000', 447, '文件上传', '/demo/upload', NULL, 1, 'icon-favor', 3, 'modules/demo/views/upload.vue', 1, 1); -INSERT INTO `base_sys_menu` VALUES (453, '2023-03-15 10:38:43.677000', '2023-03-15 10:38:43.677000', 8, '编辑', NULL, 'base:sys:menu:info,base:sys:menu:update', 2, NULL, 0, NULL, 1, 1); -INSERT INTO `base_sys_menu` VALUES (454, '2023-04-16 21:59:16.442000', '2023-09-11 14:53:47.144000', NULL, '用户管理', NULL, NULL, 0, 'icon-user', 8, NULL, 1, 1); -INSERT INTO `base_sys_menu` VALUES (455, '2023-04-16 21:59:58.296000', '2023-09-11 14:53:46.635000', 454, '用户列表', '/user/list', NULL, 1, 'icon-menu', 1, 'modules/user/views/list.vue', 1, 1); -INSERT INTO `base_sys_menu` VALUES (456, '2023-04-16 21:59:58.525729', '2023-04-16 21:59:58.525729', 455, '删除', NULL, 'user:info:delete', 2, NULL, 0, NULL, 1, 1); -INSERT INTO `base_sys_menu` VALUES (457, '2023-04-16 21:59:58.525729', '2023-04-16 21:59:58.525729', 455, '修改', NULL, 'user:info:update,user:info:info', 2, NULL, 0, NULL, 1, 1); -INSERT INTO `base_sys_menu` VALUES (458, '2023-04-16 21:59:58.525729', '2023-04-16 21:59:58.525729', 455, '单个信息', NULL, 'user:info:info', 2, NULL, 0, NULL, 1, 1); -INSERT INTO `base_sys_menu` VALUES (459, '2023-04-16 21:59:58.525729', '2023-04-16 21:59:58.525729', 455, '列表查询', NULL, 'user:info:list', 2, NULL, 0, NULL, 1, 1); -INSERT INTO `base_sys_menu` VALUES (460, '2023-04-16 21:59:58.525729', '2023-04-16 21:59:58.525729', 455, '分页查询', NULL, 'user:info:page', 2, NULL, 0, NULL, 1, 1); -INSERT INTO `base_sys_menu` VALUES (461, '2023-04-16 21:59:58.525729', '2023-04-16 21:59:58.525729', 455, '新增', NULL, 'user:info:add', 2, NULL, 0, NULL, 1, 1); -INSERT INTO `base_sys_menu` VALUES (562, '2023-09-14 10:21:48.069773', '2023-09-20 18:28:24.604000', NULL, '首页', '/', NULL, 1, NULL, 0, 'modules/demo/views/home/index.vue', 1, 0); -INSERT INTO `base_sys_menu` VALUES (624, '2023-09-28 16:36:11.345000', '2023-09-28 17:02:04.791000', 47, '插件市场', '/tutorial/plugin', NULL, 1, 'icon-app', 1, 'https://cool-js.com/plugin/list.html', 1, 1); -COMMIT; - --- ---------------------------- --- Table structure for base_sys_param --- ---------------------------- -DROP TABLE IF EXISTS `base_sys_param`; -CREATE TABLE `base_sys_param` ( - `id` int NOT NULL AUTO_INCREMENT COMMENT 'ID', - `createTime` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) COMMENT '创建时间', - `updateTime` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6) COMMENT '更新时间', - `keyName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '键', - `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '名称', - `data` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '数据', - `dataType` tinyint NOT NULL DEFAULT 0 COMMENT '数据类型 0-字符串 1-富文本 2-文件 ', - `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', - PRIMARY KEY (`id`) USING BTREE, - UNIQUE INDEX `IDX_cf19b5e52d8c71caa9c4534454`(`keyName` ASC) USING BTREE, - INDEX `IDX_7bcb57371b481d8e2d66ddeaea`(`createTime` ASC) USING BTREE, - INDEX `IDX_479122e3bf464112f7a7253dac`(`updateTime` ASC) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 9 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of base_sys_param --- ---------------------------- -INSERT INTO `base_sys_param` VALUES (1, '2021-02-26 13:53:05.000000', '2023-05-31 10:43:23.312000', 'rich', '富文本参数', '

这是一个富文本

xxx

xxxxxxxxxx


', 1, NULL); -INSERT INTO `base_sys_param` VALUES (2, '2021-02-26 13:53:18.000000', '2023-05-30 18:46:28.282000', 'json', 'JSON参数', '{\n \"code\": 111233\n}', 0, NULL); -INSERT INTO `base_sys_param` VALUES (6, '2023-05-30 18:48:25.371000', '2023-05-31 10:44:25.612000', 'file', '文件', '', 2, NULL); -INSERT INTO `base_sys_param` VALUES (8, '2023-05-31 10:07:53.295000', '2023-05-31 10:46:27.960000', 'text', '测试', '这是一段字符串', 0, NULL); - --- ---------------------------- --- Table structure for base_sys_role --- ---------------------------- -DROP TABLE IF EXISTS `base_sys_role`; -CREATE TABLE `base_sys_role` ( - `id` int NOT NULL AUTO_INCREMENT COMMENT 'ID', - `createTime` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) COMMENT '创建时间', - `updateTime` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6) COMMENT '更新时间', - `userId` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '用户ID', - `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '名称', - `label` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '角色标签', - `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '备注', - `relevance` int NOT NULL DEFAULT '1' COMMENT '数据权限是否关联上下级', - `menuIdList` json NOT NULL COMMENT '菜单权限', - `departmentIdList` json NOT NULL COMMENT '部门权限', - PRIMARY KEY (`id`) USING BTREE, - UNIQUE KEY `IDX_469d49a5998170e9550cf113da` (`name`) USING BTREE, - UNIQUE KEY `IDX_f3f24fbbccf00192b076e549a7` (`label`) USING BTREE, - KEY `IDX_6f01184441dec49207b41bfd92` (`createTime`) USING BTREE, - KEY `IDX_d64ca209f3fc52128d9b20e97b` (`updateTime`) USING BTREE -) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; - --- ---------------------------- --- Records of base_sys_role --- ---------------------------- -BEGIN; -INSERT INTO `base_sys_role` VALUES (1, '2021-02-24 21:18:39.682358', '2021-02-24 21:18:39.682358', '1', '超管', 'admin', '最高权限的角色', 1, 'null', 'null'); -INSERT INTO `base_sys_role` VALUES (10, '2021-02-26 14:15:38.000000', '2021-02-26 14:15:38.000000', '1', '系统管理员', 'admin-sys', NULL, 1, 'null', 'null'); -INSERT INTO `base_sys_role` VALUES (11, '2021-02-26 14:16:49.044744', '2021-02-26 14:16:49.044744', '1', '游客', 'visitor', NULL, 0, 'null', 'null'); -INSERT INTO `base_sys_role` VALUES (12, '2021-02-26 14:26:51.000000', '2021-02-26 14:32:35.000000', '1', '开发', 'dev', NULL, 0, 'null', 'null'); -INSERT INTO `base_sys_role` VALUES (13, '2021-02-26 14:27:58.000000', '2023-02-20 11:01:16.995000', '1', '测试', 'test', NULL, 0, 'null', 'null'); -COMMIT; - --- ---------------------------- --- Table structure for base_sys_role_department --- ---------------------------- -DROP TABLE IF EXISTS `base_sys_role_department`; -CREATE TABLE `base_sys_role_department` ( - `id` int NOT NULL AUTO_INCREMENT COMMENT 'ID', - `createTime` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) COMMENT '创建时间', - `updateTime` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6) COMMENT '更新时间', - `roleId` bigint NOT NULL COMMENT '角色ID', - `departmentId` bigint NOT NULL COMMENT '部门ID', - PRIMARY KEY (`id`) USING BTREE, - KEY `IDX_e881a66f7cce83ba431cf20194` (`createTime`) USING BTREE, - KEY `IDX_cbf48031efee5d0de262965e53` (`updateTime`) USING BTREE -) ENGINE=InnoDB AUTO_INCREMENT=29 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; - --- ---------------------------- --- Records of base_sys_role_department --- ---------------------------- -BEGIN; -INSERT INTO `base_sys_role_department` VALUES (1, '2021-02-26 12:00:23.787939', '2021-02-26 12:00:23.787939', 8, 4); -INSERT INTO `base_sys_role_department` VALUES (2, '2021-02-26 12:01:11.525205', '2021-02-26 12:01:11.525205', 9, 1); -INSERT INTO `base_sys_role_department` VALUES (3, '2021-02-26 12:01:11.624266', '2021-02-26 12:01:11.624266', 9, 4); -INSERT INTO `base_sys_role_department` VALUES (4, '2021-02-26 12:01:11.721894', '2021-02-26 12:01:11.721894', 9, 5); -INSERT INTO `base_sys_role_department` VALUES (5, '2021-02-26 12:01:11.823342', '2021-02-26 12:01:11.823342', 9, 8); -INSERT INTO `base_sys_role_department` VALUES (6, '2021-02-26 12:01:11.922873', '2021-02-26 12:01:11.922873', 9, 9); -INSERT INTO `base_sys_role_department` VALUES (23, '2021-02-26 14:32:40.354669', '2021-02-26 14:32:40.354669', 12, 11); -INSERT INTO `base_sys_role_department` VALUES (25, '2021-02-26 14:32:59.726608', '2021-02-26 14:32:59.726608', 10, 1); -INSERT INTO `base_sys_role_department` VALUES (28, '2023-02-20 11:01:23.152883', '2023-02-20 11:01:23.152883', 13, 12); -COMMIT; - --- ---------------------------- --- Table structure for base_sys_role_menu --- ---------------------------- -DROP TABLE IF EXISTS `base_sys_role_menu`; -CREATE TABLE `base_sys_role_menu` ( - `id` int NOT NULL AUTO_INCREMENT COMMENT 'ID', - `createTime` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) COMMENT '创建时间', - `updateTime` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6) COMMENT '更新时间', - `roleId` bigint NOT NULL COMMENT '角色ID', - `menuId` bigint NOT NULL COMMENT '菜单ID', - PRIMARY KEY (`id`) USING BTREE, - KEY `IDX_3641f81d4201c524a57ce2aa54` (`createTime`) USING BTREE, - KEY `IDX_f860298298b26e7a697be36e5b` (`updateTime`) USING BTREE -) ENGINE=InnoDB AUTO_INCREMENT=571 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; - --- ---------------------------- --- Records of base_sys_role_menu --- ---------------------------- -BEGIN; -INSERT INTO `base_sys_role_menu` VALUES (1, '2021-02-26 12:00:18.240154', '2021-02-26 12:00:18.240154', 8, 1); -INSERT INTO `base_sys_role_menu` VALUES (2, '2021-02-26 12:00:18.342131', '2021-02-26 12:00:18.342131', 8, 96); -INSERT INTO `base_sys_role_menu` VALUES (3, '2021-02-26 12:00:18.444143', '2021-02-26 12:00:18.444143', 8, 45); -INSERT INTO `base_sys_role_menu` VALUES (4, '2021-02-26 12:00:18.545490', '2021-02-26 12:00:18.545490', 8, 43); -INSERT INTO `base_sys_role_menu` VALUES (5, '2021-02-26 12:00:18.649626', '2021-02-26 12:00:18.649626', 8, 49); -INSERT INTO `base_sys_role_menu` VALUES (6, '2021-02-26 12:00:18.752369', '2021-02-26 12:00:18.752369', 8, 86); -INSERT INTO `base_sys_role_menu` VALUES (7, '2021-02-26 12:00:18.856023', '2021-02-26 12:00:18.856023', 8, 2); -INSERT INTO `base_sys_role_menu` VALUES (8, '2021-02-26 12:00:18.956131', '2021-02-26 12:00:18.956131', 8, 27); -INSERT INTO `base_sys_role_menu` VALUES (9, '2021-02-26 12:00:19.071490', '2021-02-26 12:00:19.071490', 8, 97); -INSERT INTO `base_sys_role_menu` VALUES (10, '2021-02-26 12:00:19.171745', '2021-02-26 12:00:19.171745', 8, 59); -INSERT INTO `base_sys_role_menu` VALUES (11, '2021-02-26 12:00:19.274495', '2021-02-26 12:00:19.274495', 8, 60); -INSERT INTO `base_sys_role_menu` VALUES (12, '2021-02-26 12:00:19.374610', '2021-02-26 12:00:19.374610', 8, 61); -INSERT INTO `base_sys_role_menu` VALUES (13, '2021-02-26 12:00:19.474750', '2021-02-26 12:00:19.474750', 8, 62); -INSERT INTO `base_sys_role_menu` VALUES (14, '2021-02-26 12:00:19.573369', '2021-02-26 12:00:19.573369', 8, 63); -INSERT INTO `base_sys_role_menu` VALUES (15, '2021-02-26 12:00:19.674242', '2021-02-26 12:00:19.674242', 8, 65); -INSERT INTO `base_sys_role_menu` VALUES (16, '2021-02-26 12:00:19.772886', '2021-02-26 12:00:19.772886', 8, 98); -INSERT INTO `base_sys_role_menu` VALUES (17, '2021-02-26 12:00:19.874134', '2021-02-26 12:00:19.874134', 8, 99); -INSERT INTO `base_sys_role_menu` VALUES (18, '2021-02-26 12:00:19.972728', '2021-02-26 12:00:19.972728', 8, 100); -INSERT INTO `base_sys_role_menu` VALUES (19, '2021-02-26 12:00:20.085877', '2021-02-26 12:00:20.085877', 8, 101); -INSERT INTO `base_sys_role_menu` VALUES (20, '2021-02-26 12:00:20.192887', '2021-02-26 12:00:20.192887', 8, 8); -INSERT INTO `base_sys_role_menu` VALUES (21, '2021-02-26 12:00:20.293747', '2021-02-26 12:00:20.293747', 8, 10); -INSERT INTO `base_sys_role_menu` VALUES (22, '2021-02-26 12:00:20.393491', '2021-02-26 12:00:20.393491', 8, 11); -INSERT INTO `base_sys_role_menu` VALUES (23, '2021-02-26 12:00:20.495110', '2021-02-26 12:00:20.495110', 8, 12); -INSERT INTO `base_sys_role_menu` VALUES (24, '2021-02-26 12:00:20.594083', '2021-02-26 12:00:20.594083', 8, 13); -INSERT INTO `base_sys_role_menu` VALUES (25, '2021-02-26 12:00:20.695727', '2021-02-26 12:00:20.695727', 8, 22); -INSERT INTO `base_sys_role_menu` VALUES (26, '2021-02-26 12:00:20.794729', '2021-02-26 12:00:20.794729', 8, 23); -INSERT INTO `base_sys_role_menu` VALUES (27, '2021-02-26 12:00:20.895601', '2021-02-26 12:00:20.895601', 8, 24); -INSERT INTO `base_sys_role_menu` VALUES (28, '2021-02-26 12:00:20.994972', '2021-02-26 12:00:20.994972', 8, 25); -INSERT INTO `base_sys_role_menu` VALUES (29, '2021-02-26 12:00:21.110384', '2021-02-26 12:00:21.110384', 8, 26); -INSERT INTO `base_sys_role_menu` VALUES (30, '2021-02-26 12:00:21.210970', '2021-02-26 12:00:21.210970', 8, 69); -INSERT INTO `base_sys_role_menu` VALUES (31, '2021-02-26 12:00:21.311852', '2021-02-26 12:00:21.311852', 8, 70); -INSERT INTO `base_sys_role_menu` VALUES (32, '2021-02-26 12:00:21.411591', '2021-02-26 12:00:21.411591', 8, 71); -INSERT INTO `base_sys_role_menu` VALUES (33, '2021-02-26 12:00:21.513584', '2021-02-26 12:00:21.513584', 8, 72); -INSERT INTO `base_sys_role_menu` VALUES (34, '2021-02-26 12:00:21.612212', '2021-02-26 12:00:21.612212', 8, 73); -INSERT INTO `base_sys_role_menu` VALUES (35, '2021-02-26 12:00:21.712720', '2021-02-26 12:00:21.712720', 8, 74); -INSERT INTO `base_sys_role_menu` VALUES (36, '2021-02-26 12:00:21.812839', '2021-02-26 12:00:21.812839', 8, 75); -INSERT INTO `base_sys_role_menu` VALUES (37, '2021-02-26 12:00:21.913321', '2021-02-26 12:00:21.913321', 8, 76); -INSERT INTO `base_sys_role_menu` VALUES (38, '2021-02-26 12:00:22.013970', '2021-02-26 12:00:22.013970', 8, 77); -INSERT INTO `base_sys_role_menu` VALUES (39, '2021-02-26 12:00:22.144879', '2021-02-26 12:00:22.144879', 8, 78); -INSERT INTO `base_sys_role_menu` VALUES (40, '2021-02-26 12:00:22.246707', '2021-02-26 12:00:22.246707', 8, 79); -INSERT INTO `base_sys_role_menu` VALUES (41, '2021-02-26 12:00:22.347579', '2021-02-26 12:00:22.347579', 8, 80); -INSERT INTO `base_sys_role_menu` VALUES (42, '2021-02-26 12:00:22.446947', '2021-02-26 12:00:22.446947', 8, 81); -INSERT INTO `base_sys_role_menu` VALUES (43, '2021-02-26 12:00:22.547082', '2021-02-26 12:00:22.547082', 8, 82); -INSERT INTO `base_sys_role_menu` VALUES (44, '2021-02-26 12:00:22.647197', '2021-02-26 12:00:22.647197', 8, 83); -INSERT INTO `base_sys_role_menu` VALUES (45, '2021-02-26 12:00:22.748089', '2021-02-26 12:00:22.748089', 8, 105); -INSERT INTO `base_sys_role_menu` VALUES (46, '2021-02-26 12:00:22.847814', '2021-02-26 12:00:22.847814', 8, 102); -INSERT INTO `base_sys_role_menu` VALUES (47, '2021-02-26 12:00:22.949071', '2021-02-26 12:00:22.949071', 8, 103); -INSERT INTO `base_sys_role_menu` VALUES (48, '2021-02-26 12:00:23.047353', '2021-02-26 12:00:23.047353', 8, 29); -INSERT INTO `base_sys_role_menu` VALUES (49, '2021-02-26 12:00:23.147826', '2021-02-26 12:00:23.147826', 8, 30); -INSERT INTO `base_sys_role_menu` VALUES (50, '2021-02-26 12:00:23.246800', '2021-02-26 12:00:23.246800', 8, 47); -INSERT INTO `base_sys_role_menu` VALUES (51, '2021-02-26 12:00:23.349541', '2021-02-26 12:00:23.349541', 8, 48); -INSERT INTO `base_sys_role_menu` VALUES (52, '2021-02-26 12:00:23.463177', '2021-02-26 12:00:23.463177', 8, 84); -INSERT INTO `base_sys_role_menu` VALUES (53, '2021-02-26 12:00:23.564096', '2021-02-26 12:00:23.564096', 8, 90); -INSERT INTO `base_sys_role_menu` VALUES (54, '2021-02-26 12:00:23.663815', '2021-02-26 12:00:23.663815', 8, 85); -INSERT INTO `base_sys_role_menu` VALUES (55, '2021-02-26 12:01:05.971978', '2021-02-26 12:01:05.971978', 9, 1); -INSERT INTO `base_sys_role_menu` VALUES (56, '2021-02-26 12:01:06.085568', '2021-02-26 12:01:06.085568', 9, 96); -INSERT INTO `base_sys_role_menu` VALUES (57, '2021-02-26 12:01:06.198271', '2021-02-26 12:01:06.198271', 9, 45); -INSERT INTO `base_sys_role_menu` VALUES (58, '2021-02-26 12:01:06.309736', '2021-02-26 12:01:06.309736', 9, 43); -INSERT INTO `base_sys_role_menu` VALUES (59, '2021-02-26 12:01:06.410785', '2021-02-26 12:01:06.410785', 9, 49); -INSERT INTO `base_sys_role_menu` VALUES (60, '2021-02-26 12:01:06.510712', '2021-02-26 12:01:06.510712', 9, 86); -INSERT INTO `base_sys_role_menu` VALUES (61, '2021-02-26 12:01:06.612457', '2021-02-26 12:01:06.612457', 9, 2); -INSERT INTO `base_sys_role_menu` VALUES (62, '2021-02-26 12:01:06.710397', '2021-02-26 12:01:06.710397', 9, 27); -INSERT INTO `base_sys_role_menu` VALUES (63, '2021-02-26 12:01:06.809104', '2021-02-26 12:01:06.809104', 9, 97); -INSERT INTO `base_sys_role_menu` VALUES (64, '2021-02-26 12:01:06.907088', '2021-02-26 12:01:06.907088', 9, 59); -INSERT INTO `base_sys_role_menu` VALUES (65, '2021-02-26 12:01:07.009988', '2021-02-26 12:01:07.009988', 9, 60); -INSERT INTO `base_sys_role_menu` VALUES (66, '2021-02-26 12:01:07.122372', '2021-02-26 12:01:07.122372', 9, 61); -INSERT INTO `base_sys_role_menu` VALUES (67, '2021-02-26 12:01:07.223694', '2021-02-26 12:01:07.223694', 9, 62); -INSERT INTO `base_sys_role_menu` VALUES (68, '2021-02-26 12:01:07.325022', '2021-02-26 12:01:07.325022', 9, 63); -INSERT INTO `base_sys_role_menu` VALUES (69, '2021-02-26 12:01:07.425209', '2021-02-26 12:01:07.425209', 9, 65); -INSERT INTO `base_sys_role_menu` VALUES (70, '2021-02-26 12:01:07.522081', '2021-02-26 12:01:07.522081', 9, 98); -INSERT INTO `base_sys_role_menu` VALUES (71, '2021-02-26 12:01:07.622775', '2021-02-26 12:01:07.622775', 9, 99); -INSERT INTO `base_sys_role_menu` VALUES (72, '2021-02-26 12:01:07.721181', '2021-02-26 12:01:07.721181', 9, 100); -INSERT INTO `base_sys_role_menu` VALUES (73, '2021-02-26 12:01:07.819589', '2021-02-26 12:01:07.819589', 9, 101); -INSERT INTO `base_sys_role_menu` VALUES (74, '2021-02-26 12:01:07.920497', '2021-02-26 12:01:07.920497', 9, 8); -INSERT INTO `base_sys_role_menu` VALUES (75, '2021-02-26 12:01:08.018875', '2021-02-26 12:01:08.018875', 9, 10); -INSERT INTO `base_sys_role_menu` VALUES (76, '2021-02-26 12:01:08.135192', '2021-02-26 12:01:08.135192', 9, 11); -INSERT INTO `base_sys_role_menu` VALUES (77, '2021-02-26 12:01:08.246405', '2021-02-26 12:01:08.246405', 9, 12); -INSERT INTO `base_sys_role_menu` VALUES (78, '2021-02-26 12:01:08.346661', '2021-02-26 12:01:08.346661', 9, 13); -INSERT INTO `base_sys_role_menu` VALUES (79, '2021-02-26 12:01:08.448436', '2021-02-26 12:01:08.448436', 9, 22); -INSERT INTO `base_sys_role_menu` VALUES (80, '2021-02-26 12:01:08.547496', '2021-02-26 12:01:08.547496', 9, 23); -INSERT INTO `base_sys_role_menu` VALUES (81, '2021-02-26 12:01:08.648457', '2021-02-26 12:01:08.648457', 9, 24); -INSERT INTO `base_sys_role_menu` VALUES (82, '2021-02-26 12:01:08.750564', '2021-02-26 12:01:08.750564', 9, 25); -INSERT INTO `base_sys_role_menu` VALUES (83, '2021-02-26 12:01:08.851783', '2021-02-26 12:01:08.851783', 9, 26); -INSERT INTO `base_sys_role_menu` VALUES (84, '2021-02-26 12:01:08.950898', '2021-02-26 12:01:08.950898', 9, 69); -INSERT INTO `base_sys_role_menu` VALUES (85, '2021-02-26 12:01:09.061982', '2021-02-26 12:01:09.061982', 9, 70); -INSERT INTO `base_sys_role_menu` VALUES (86, '2021-02-26 12:01:09.165258', '2021-02-26 12:01:09.165258', 9, 71); -INSERT INTO `base_sys_role_menu` VALUES (87, '2021-02-26 12:01:09.266177', '2021-02-26 12:01:09.266177', 9, 72); -INSERT INTO `base_sys_role_menu` VALUES (88, '2021-02-26 12:01:09.366427', '2021-02-26 12:01:09.366427', 9, 73); -INSERT INTO `base_sys_role_menu` VALUES (89, '2021-02-26 12:01:09.467877', '2021-02-26 12:01:09.467877', 9, 74); -INSERT INTO `base_sys_role_menu` VALUES (90, '2021-02-26 12:01:09.568526', '2021-02-26 12:01:09.568526', 9, 75); -INSERT INTO `base_sys_role_menu` VALUES (91, '2021-02-26 12:01:09.668052', '2021-02-26 12:01:09.668052', 9, 76); -INSERT INTO `base_sys_role_menu` VALUES (92, '2021-02-26 12:01:09.766367', '2021-02-26 12:01:09.766367', 9, 77); -INSERT INTO `base_sys_role_menu` VALUES (93, '2021-02-26 12:01:09.866170', '2021-02-26 12:01:09.866170', 9, 78); -INSERT INTO `base_sys_role_menu` VALUES (94, '2021-02-26 12:01:09.963037', '2021-02-26 12:01:09.963037', 9, 79); -INSERT INTO `base_sys_role_menu` VALUES (95, '2021-02-26 12:01:10.082046', '2021-02-26 12:01:10.082046', 9, 80); -INSERT INTO `base_sys_role_menu` VALUES (96, '2021-02-26 12:01:10.185024', '2021-02-26 12:01:10.185024', 9, 81); -INSERT INTO `base_sys_role_menu` VALUES (97, '2021-02-26 12:01:10.283787', '2021-02-26 12:01:10.283787', 9, 82); -INSERT INTO `base_sys_role_menu` VALUES (98, '2021-02-26 12:01:10.382883', '2021-02-26 12:01:10.382883', 9, 83); -INSERT INTO `base_sys_role_menu` VALUES (99, '2021-02-26 12:01:10.481150', '2021-02-26 12:01:10.481150', 9, 105); -INSERT INTO `base_sys_role_menu` VALUES (100, '2021-02-26 12:01:10.579579', '2021-02-26 12:01:10.579579', 9, 102); -INSERT INTO `base_sys_role_menu` VALUES (101, '2021-02-26 12:01:10.679489', '2021-02-26 12:01:10.679489', 9, 103); -INSERT INTO `base_sys_role_menu` VALUES (102, '2021-02-26 12:01:10.777496', '2021-02-26 12:01:10.777496', 9, 29); -INSERT INTO `base_sys_role_menu` VALUES (103, '2021-02-26 12:01:10.878292', '2021-02-26 12:01:10.878292', 9, 30); -INSERT INTO `base_sys_role_menu` VALUES (104, '2021-02-26 12:01:10.977354', '2021-02-26 12:01:10.977354', 9, 47); -INSERT INTO `base_sys_role_menu` VALUES (105, '2021-02-26 12:01:11.097786', '2021-02-26 12:01:11.097786', 9, 48); -INSERT INTO `base_sys_role_menu` VALUES (106, '2021-02-26 12:01:11.201390', '2021-02-26 12:01:11.201390', 9, 84); -INSERT INTO `base_sys_role_menu` VALUES (107, '2021-02-26 12:01:11.302120', '2021-02-26 12:01:11.302120', 9, 90); -INSERT INTO `base_sys_role_menu` VALUES (108, '2021-02-26 12:01:11.402751', '2021-02-26 12:01:11.402751', 9, 85); -INSERT INTO `base_sys_role_menu` VALUES (161, '2021-02-26 14:16:49.162546', '2021-02-26 14:16:49.162546', 11, 1); -INSERT INTO `base_sys_role_menu` VALUES (162, '2021-02-26 14:16:49.257677', '2021-02-26 14:16:49.257677', 11, 96); -INSERT INTO `base_sys_role_menu` VALUES (163, '2021-02-26 14:16:49.356225', '2021-02-26 14:16:49.356225', 11, 45); -INSERT INTO `base_sys_role_menu` VALUES (164, '2021-02-26 14:16:49.450708', '2021-02-26 14:16:49.450708', 11, 43); -INSERT INTO `base_sys_role_menu` VALUES (165, '2021-02-26 14:16:49.543794', '2021-02-26 14:16:49.543794', 11, 49); -INSERT INTO `base_sys_role_menu` VALUES (166, '2021-02-26 14:16:49.636496', '2021-02-26 14:16:49.636496', 11, 86); -INSERT INTO `base_sys_role_menu` VALUES (167, '2021-02-26 14:16:49.728634', '2021-02-26 14:16:49.728634', 11, 47); -INSERT INTO `base_sys_role_menu` VALUES (168, '2021-02-26 14:16:49.824754', '2021-02-26 14:16:49.824754', 11, 48); -INSERT INTO `base_sys_role_menu` VALUES (169, '2021-02-26 14:16:49.919329', '2021-02-26 14:16:49.919329', 11, 85); -INSERT INTO `base_sys_role_menu` VALUES (170, '2021-02-26 14:16:50.015239', '2021-02-26 14:16:50.015239', 11, 84); -INSERT INTO `base_sys_role_menu` VALUES (290, '2021-02-26 14:32:35.143867', '2021-02-26 14:32:35.143867', 12, 1); -INSERT INTO `base_sys_role_menu` VALUES (291, '2021-02-26 14:32:35.239965', '2021-02-26 14:32:35.239965', 12, 96); -INSERT INTO `base_sys_role_menu` VALUES (292, '2021-02-26 14:32:35.336398', '2021-02-26 14:32:35.336398', 12, 45); -INSERT INTO `base_sys_role_menu` VALUES (293, '2021-02-26 14:32:35.435180', '2021-02-26 14:32:35.435180', 12, 43); -INSERT INTO `base_sys_role_menu` VALUES (294, '2021-02-26 14:32:35.528631', '2021-02-26 14:32:35.528631', 12, 49); -INSERT INTO `base_sys_role_menu` VALUES (295, '2021-02-26 14:32:35.623123', '2021-02-26 14:32:35.623123', 12, 86); -INSERT INTO `base_sys_role_menu` VALUES (296, '2021-02-26 14:32:35.718831', '2021-02-26 14:32:35.718831', 12, 2); -INSERT INTO `base_sys_role_menu` VALUES (297, '2021-02-26 14:32:35.812975', '2021-02-26 14:32:35.812975', 12, 27); -INSERT INTO `base_sys_role_menu` VALUES (298, '2021-02-26 14:32:35.904487', '2021-02-26 14:32:35.904487', 12, 97); -INSERT INTO `base_sys_role_menu` VALUES (299, '2021-02-26 14:32:35.998773', '2021-02-26 14:32:35.998773', 12, 59); -INSERT INTO `base_sys_role_menu` VALUES (300, '2021-02-26 14:32:36.107749', '2021-02-26 14:32:36.107749', 12, 60); -INSERT INTO `base_sys_role_menu` VALUES (301, '2021-02-26 14:32:36.213069', '2021-02-26 14:32:36.213069', 12, 61); -INSERT INTO `base_sys_role_menu` VALUES (302, '2021-02-26 14:32:36.308985', '2021-02-26 14:32:36.308985', 12, 62); -INSERT INTO `base_sys_role_menu` VALUES (303, '2021-02-26 14:32:36.404237', '2021-02-26 14:32:36.404237', 12, 63); -INSERT INTO `base_sys_role_menu` VALUES (304, '2021-02-26 14:32:36.499569', '2021-02-26 14:32:36.499569', 12, 65); -INSERT INTO `base_sys_role_menu` VALUES (305, '2021-02-26 14:32:36.593710', '2021-02-26 14:32:36.593710', 12, 98); -INSERT INTO `base_sys_role_menu` VALUES (306, '2021-02-26 14:32:36.685988', '2021-02-26 14:32:36.685988', 12, 99); -INSERT INTO `base_sys_role_menu` VALUES (307, '2021-02-26 14:32:36.778733', '2021-02-26 14:32:36.778733', 12, 100); -INSERT INTO `base_sys_role_menu` VALUES (308, '2021-02-26 14:32:36.874715', '2021-02-26 14:32:36.874715', 12, 101); -INSERT INTO `base_sys_role_menu` VALUES (309, '2021-02-26 14:32:36.973153', '2021-02-26 14:32:36.973153', 12, 8); -INSERT INTO `base_sys_role_menu` VALUES (310, '2021-02-26 14:32:37.082734', '2021-02-26 14:32:37.082734', 12, 10); -INSERT INTO `base_sys_role_menu` VALUES (311, '2021-02-26 14:32:37.176859', '2021-02-26 14:32:37.176859', 12, 11); -INSERT INTO `base_sys_role_menu` VALUES (312, '2021-02-26 14:32:37.271440', '2021-02-26 14:32:37.271440', 12, 12); -INSERT INTO `base_sys_role_menu` VALUES (313, '2021-02-26 14:32:37.365206', '2021-02-26 14:32:37.365206', 12, 13); -INSERT INTO `base_sys_role_menu` VALUES (314, '2021-02-26 14:32:37.457092', '2021-02-26 14:32:37.457092', 12, 22); -INSERT INTO `base_sys_role_menu` VALUES (315, '2021-02-26 14:32:37.549860', '2021-02-26 14:32:37.549860', 12, 23); -INSERT INTO `base_sys_role_menu` VALUES (316, '2021-02-26 14:32:37.645684', '2021-02-26 14:32:37.645684', 12, 24); -INSERT INTO `base_sys_role_menu` VALUES (317, '2021-02-26 14:32:37.743370', '2021-02-26 14:32:37.743370', 12, 25); -INSERT INTO `base_sys_role_menu` VALUES (318, '2021-02-26 14:32:37.837218', '2021-02-26 14:32:37.837218', 12, 26); -INSERT INTO `base_sys_role_menu` VALUES (319, '2021-02-26 14:32:37.930953', '2021-02-26 14:32:37.930953', 12, 69); -INSERT INTO `base_sys_role_menu` VALUES (320, '2021-02-26 14:32:38.031191', '2021-02-26 14:32:38.031191', 12, 70); -INSERT INTO `base_sys_role_menu` VALUES (321, '2021-02-26 14:32:38.130839', '2021-02-26 14:32:38.130839', 12, 71); -INSERT INTO `base_sys_role_menu` VALUES (322, '2021-02-26 14:32:38.229359', '2021-02-26 14:32:38.229359', 12, 72); -INSERT INTO `base_sys_role_menu` VALUES (323, '2021-02-26 14:32:38.323868', '2021-02-26 14:32:38.323868', 12, 73); -INSERT INTO `base_sys_role_menu` VALUES (324, '2021-02-26 14:32:38.415194', '2021-02-26 14:32:38.415194', 12, 74); -INSERT INTO `base_sys_role_menu` VALUES (325, '2021-02-26 14:32:38.505597', '2021-02-26 14:32:38.505597', 12, 75); -INSERT INTO `base_sys_role_menu` VALUES (326, '2021-02-26 14:32:38.600426', '2021-02-26 14:32:38.600426', 12, 76); -INSERT INTO `base_sys_role_menu` VALUES (327, '2021-02-26 14:32:38.698676', '2021-02-26 14:32:38.698676', 12, 77); -INSERT INTO `base_sys_role_menu` VALUES (328, '2021-02-26 14:32:38.793832', '2021-02-26 14:32:38.793832', 12, 78); -INSERT INTO `base_sys_role_menu` VALUES (329, '2021-02-26 14:32:38.889203', '2021-02-26 14:32:38.889203', 12, 79); -INSERT INTO `base_sys_role_menu` VALUES (330, '2021-02-26 14:32:38.985851', '2021-02-26 14:32:38.985851', 12, 80); -INSERT INTO `base_sys_role_menu` VALUES (331, '2021-02-26 14:32:39.092110', '2021-02-26 14:32:39.092110', 12, 81); -INSERT INTO `base_sys_role_menu` VALUES (332, '2021-02-26 14:32:39.188945', '2021-02-26 14:32:39.188945', 12, 82); -INSERT INTO `base_sys_role_menu` VALUES (333, '2021-02-26 14:32:39.280043', '2021-02-26 14:32:39.280043', 12, 83); -INSERT INTO `base_sys_role_menu` VALUES (334, '2021-02-26 14:32:39.374899', '2021-02-26 14:32:39.374899', 12, 105); -INSERT INTO `base_sys_role_menu` VALUES (335, '2021-02-26 14:32:39.473563', '2021-02-26 14:32:39.473563', 12, 102); -INSERT INTO `base_sys_role_menu` VALUES (336, '2021-02-26 14:32:39.570921', '2021-02-26 14:32:39.570921', 12, 103); -INSERT INTO `base_sys_role_menu` VALUES (337, '2021-02-26 14:32:39.665052', '2021-02-26 14:32:39.665052', 12, 29); -INSERT INTO `base_sys_role_menu` VALUES (338, '2021-02-26 14:32:39.760189', '2021-02-26 14:32:39.760189', 12, 30); -INSERT INTO `base_sys_role_menu` VALUES (339, '2021-02-26 14:32:39.852856', '2021-02-26 14:32:39.852856', 12, 47); -INSERT INTO `base_sys_role_menu` VALUES (340, '2021-02-26 14:32:39.944180', '2021-02-26 14:32:39.944180', 12, 48); -INSERT INTO `base_sys_role_menu` VALUES (341, '2021-02-26 14:32:40.038086', '2021-02-26 14:32:40.038086', 12, 84); -INSERT INTO `base_sys_role_menu` VALUES (342, '2021-02-26 14:32:40.135874', '2021-02-26 14:32:40.135874', 12, 90); -INSERT INTO `base_sys_role_menu` VALUES (343, '2021-02-26 14:32:40.234015', '2021-02-26 14:32:40.234015', 12, 85); -INSERT INTO `base_sys_role_menu` VALUES (355, '2021-02-26 14:32:54.538822', '2021-02-26 14:32:54.538822', 10, 1); -INSERT INTO `base_sys_role_menu` VALUES (356, '2021-02-26 14:32:54.634784', '2021-02-26 14:32:54.634784', 10, 96); -INSERT INTO `base_sys_role_menu` VALUES (357, '2021-02-26 14:32:54.732878', '2021-02-26 14:32:54.732878', 10, 45); -INSERT INTO `base_sys_role_menu` VALUES (358, '2021-02-26 14:32:54.826023', '2021-02-26 14:32:54.826023', 10, 43); -INSERT INTO `base_sys_role_menu` VALUES (359, '2021-02-26 14:32:54.920173', '2021-02-26 14:32:54.920173', 10, 49); -INSERT INTO `base_sys_role_menu` VALUES (360, '2021-02-26 14:32:55.019141', '2021-02-26 14:32:55.019141', 10, 86); -INSERT INTO `base_sys_role_menu` VALUES (361, '2021-02-26 14:32:55.119438', '2021-02-26 14:32:55.119438', 10, 2); -INSERT INTO `base_sys_role_menu` VALUES (362, '2021-02-26 14:32:55.211471', '2021-02-26 14:32:55.211471', 10, 27); -INSERT INTO `base_sys_role_menu` VALUES (363, '2021-02-26 14:32:55.304855', '2021-02-26 14:32:55.304855', 10, 97); -INSERT INTO `base_sys_role_menu` VALUES (364, '2021-02-26 14:32:55.397939', '2021-02-26 14:32:55.397939', 10, 59); -INSERT INTO `base_sys_role_menu` VALUES (365, '2021-02-26 14:32:55.491674', '2021-02-26 14:32:55.491674', 10, 60); -INSERT INTO `base_sys_role_menu` VALUES (366, '2021-02-26 14:32:55.584051', '2021-02-26 14:32:55.584051', 10, 61); -INSERT INTO `base_sys_role_menu` VALUES (367, '2021-02-26 14:32:55.676449', '2021-02-26 14:32:55.676449', 10, 62); -INSERT INTO `base_sys_role_menu` VALUES (368, '2021-02-26 14:32:55.774524', '2021-02-26 14:32:55.774524', 10, 63); -INSERT INTO `base_sys_role_menu` VALUES (369, '2021-02-26 14:32:55.871634', '2021-02-26 14:32:55.871634', 10, 65); -INSERT INTO `base_sys_role_menu` VALUES (370, '2021-02-26 14:32:55.964611', '2021-02-26 14:32:55.964611', 10, 98); -INSERT INTO `base_sys_role_menu` VALUES (371, '2021-02-26 14:32:56.074043', '2021-02-26 14:32:56.074043', 10, 99); -INSERT INTO `base_sys_role_menu` VALUES (372, '2021-02-26 14:32:56.169316', '2021-02-26 14:32:56.169316', 10, 100); -INSERT INTO `base_sys_role_menu` VALUES (373, '2021-02-26 14:32:56.263408', '2021-02-26 14:32:56.263408', 10, 101); -INSERT INTO `base_sys_role_menu` VALUES (374, '2021-02-26 14:32:56.356537', '2021-02-26 14:32:56.356537', 10, 8); -INSERT INTO `base_sys_role_menu` VALUES (375, '2021-02-26 14:32:56.448195', '2021-02-26 14:32:56.448195', 10, 10); -INSERT INTO `base_sys_role_menu` VALUES (376, '2021-02-26 14:32:56.544394', '2021-02-26 14:32:56.544394', 10, 11); -INSERT INTO `base_sys_role_menu` VALUES (377, '2021-02-26 14:32:56.641515', '2021-02-26 14:32:56.641515', 10, 12); -INSERT INTO `base_sys_role_menu` VALUES (378, '2021-02-26 14:32:56.735242', '2021-02-26 14:32:56.735242', 10, 13); -INSERT INTO `base_sys_role_menu` VALUES (379, '2021-02-26 14:32:56.828811', '2021-02-26 14:32:56.828811', 10, 22); -INSERT INTO `base_sys_role_menu` VALUES (380, '2021-02-26 14:32:56.922664', '2021-02-26 14:32:56.922664', 10, 23); -INSERT INTO `base_sys_role_menu` VALUES (381, '2021-02-26 14:32:57.016873', '2021-02-26 14:32:57.016873', 10, 24); -INSERT INTO `base_sys_role_menu` VALUES (382, '2021-02-26 14:32:57.123800', '2021-02-26 14:32:57.123800', 10, 25); -INSERT INTO `base_sys_role_menu` VALUES (383, '2021-02-26 14:32:57.223306', '2021-02-26 14:32:57.223306', 10, 26); -INSERT INTO `base_sys_role_menu` VALUES (384, '2021-02-26 14:32:57.328482', '2021-02-26 14:32:57.328482', 10, 69); -INSERT INTO `base_sys_role_menu` VALUES (385, '2021-02-26 14:32:57.430006', '2021-02-26 14:32:57.430006', 10, 70); -INSERT INTO `base_sys_role_menu` VALUES (386, '2021-02-26 14:32:57.521664', '2021-02-26 14:32:57.521664', 10, 71); -INSERT INTO `base_sys_role_menu` VALUES (387, '2021-02-26 14:32:57.612399', '2021-02-26 14:32:57.612399', 10, 72); -INSERT INTO `base_sys_role_menu` VALUES (388, '2021-02-26 14:32:57.705553', '2021-02-26 14:32:57.705553', 10, 73); -INSERT INTO `base_sys_role_menu` VALUES (389, '2021-02-26 14:32:57.799288', '2021-02-26 14:32:57.799288', 10, 74); -INSERT INTO `base_sys_role_menu` VALUES (390, '2021-02-26 14:32:57.893894', '2021-02-26 14:32:57.893894', 10, 75); -INSERT INTO `base_sys_role_menu` VALUES (391, '2021-02-26 14:32:57.988856', '2021-02-26 14:32:57.988856', 10, 76); -INSERT INTO `base_sys_role_menu` VALUES (392, '2021-02-26 14:32:58.090250', '2021-02-26 14:32:58.090250', 10, 77); -INSERT INTO `base_sys_role_menu` VALUES (393, '2021-02-26 14:32:58.196616', '2021-02-26 14:32:58.196616', 10, 78); -INSERT INTO `base_sys_role_menu` VALUES (394, '2021-02-26 14:32:58.288151', '2021-02-26 14:32:58.288151', 10, 79); -INSERT INTO `base_sys_role_menu` VALUES (395, '2021-02-26 14:32:58.378493', '2021-02-26 14:32:58.378493', 10, 80); -INSERT INTO `base_sys_role_menu` VALUES (396, '2021-02-26 14:32:58.471283', '2021-02-26 14:32:58.471283', 10, 81); -INSERT INTO `base_sys_role_menu` VALUES (397, '2021-02-26 14:32:58.564666', '2021-02-26 14:32:58.564666', 10, 82); -INSERT INTO `base_sys_role_menu` VALUES (398, '2021-02-26 14:32:58.658511', '2021-02-26 14:32:58.658511', 10, 83); -INSERT INTO `base_sys_role_menu` VALUES (399, '2021-02-26 14:32:58.752713', '2021-02-26 14:32:58.752713', 10, 105); -INSERT INTO `base_sys_role_menu` VALUES (400, '2021-02-26 14:32:58.849472', '2021-02-26 14:32:58.849472', 10, 102); -INSERT INTO `base_sys_role_menu` VALUES (401, '2021-02-26 14:32:58.948387', '2021-02-26 14:32:58.948387', 10, 103); -INSERT INTO `base_sys_role_menu` VALUES (402, '2021-02-26 14:32:59.042410', '2021-02-26 14:32:59.042410', 10, 29); -INSERT INTO `base_sys_role_menu` VALUES (403, '2021-02-26 14:32:59.132594', '2021-02-26 14:32:59.132594', 10, 30); -INSERT INTO `base_sys_role_menu` VALUES (404, '2021-02-26 14:32:59.226150', '2021-02-26 14:32:59.226150', 10, 47); -INSERT INTO `base_sys_role_menu` VALUES (405, '2021-02-26 14:32:59.319494', '2021-02-26 14:32:59.319494', 10, 48); -INSERT INTO `base_sys_role_menu` VALUES (406, '2021-02-26 14:32:59.413370', '2021-02-26 14:32:59.413370', 10, 84); -INSERT INTO `base_sys_role_menu` VALUES (407, '2021-02-26 14:32:59.507584', '2021-02-26 14:32:59.507584', 10, 90); -INSERT INTO `base_sys_role_menu` VALUES (408, '2021-02-26 14:32:59.604332', '2021-02-26 14:32:59.604332', 10, 85); -INSERT INTO `base_sys_role_menu` VALUES (517, '2023-02-20 11:01:17.272678', '2023-02-20 11:01:17.272678', 13, 1); -INSERT INTO `base_sys_role_menu` VALUES (518, '2023-02-20 11:01:17.384384', '2023-02-20 11:01:17.384384', 13, 96); -INSERT INTO `base_sys_role_menu` VALUES (519, '2023-02-20 11:01:17.509665', '2023-02-20 11:01:17.509665', 13, 45); -INSERT INTO `base_sys_role_menu` VALUES (520, '2023-02-20 11:01:17.613195', '2023-02-20 11:01:17.613195', 13, 43); -INSERT INTO `base_sys_role_menu` VALUES (521, '2023-02-20 11:01:17.717865', '2023-02-20 11:01:17.717865', 13, 49); -INSERT INTO `base_sys_role_menu` VALUES (522, '2023-02-20 11:01:17.821450', '2023-02-20 11:01:17.821450', 13, 86); -INSERT INTO `base_sys_role_menu` VALUES (523, '2023-02-20 11:01:17.928597', '2023-02-20 11:01:17.928597', 13, 2); -INSERT INTO `base_sys_role_menu` VALUES (524, '2023-02-20 11:01:18.042256', '2023-02-20 11:01:18.042256', 13, 27); -INSERT INTO `base_sys_role_menu` VALUES (525, '2023-02-20 11:01:18.152961', '2023-02-20 11:01:18.152961', 13, 97); -INSERT INTO `base_sys_role_menu` VALUES (526, '2023-02-20 11:01:18.264862', '2023-02-20 11:01:18.264862', 13, 59); -INSERT INTO `base_sys_role_menu` VALUES (527, '2023-02-20 11:01:18.375556', '2023-02-20 11:01:18.375556', 13, 60); -INSERT INTO `base_sys_role_menu` VALUES (528, '2023-02-20 11:01:18.486312', '2023-02-20 11:01:18.486312', 13, 61); -INSERT INTO `base_sys_role_menu` VALUES (529, '2023-02-20 11:01:18.604764', '2023-02-20 11:01:18.604764', 13, 62); -INSERT INTO `base_sys_role_menu` VALUES (530, '2023-02-20 11:01:18.708506', '2023-02-20 11:01:18.708506', 13, 63); -INSERT INTO `base_sys_role_menu` VALUES (531, '2023-02-20 11:01:18.810557', '2023-02-20 11:01:18.810557', 13, 65); -INSERT INTO `base_sys_role_menu` VALUES (532, '2023-02-20 11:01:18.912572', '2023-02-20 11:01:18.912572', 13, 98); -INSERT INTO `base_sys_role_menu` VALUES (533, '2023-02-20 11:01:19.012174', '2023-02-20 11:01:19.012174', 13, 99); -INSERT INTO `base_sys_role_menu` VALUES (534, '2023-02-20 11:01:19.111748', '2023-02-20 11:01:19.111748', 13, 100); -INSERT INTO `base_sys_role_menu` VALUES (535, '2023-02-20 11:01:19.210923', '2023-02-20 11:01:19.210923', 13, 101); -INSERT INTO `base_sys_role_menu` VALUES (536, '2023-02-20 11:01:19.314189', '2023-02-20 11:01:19.314189', 13, 8); -INSERT INTO `base_sys_role_menu` VALUES (537, '2023-02-20 11:01:19.428883', '2023-02-20 11:01:19.428883', 13, 10); -INSERT INTO `base_sys_role_menu` VALUES (538, '2023-02-20 11:01:19.552934', '2023-02-20 11:01:19.552934', 13, 11); -INSERT INTO `base_sys_role_menu` VALUES (539, '2023-02-20 11:01:19.663284', '2023-02-20 11:01:19.663284', 13, 12); -INSERT INTO `base_sys_role_menu` VALUES (540, '2023-02-20 11:01:19.771651', '2023-02-20 11:01:19.771651', 13, 13); -INSERT INTO `base_sys_role_menu` VALUES (541, '2023-02-20 11:01:19.879238', '2023-02-20 11:01:19.879238', 13, 22); -INSERT INTO `base_sys_role_menu` VALUES (542, '2023-02-20 11:01:19.987001', '2023-02-20 11:01:19.987001', 13, 23); -INSERT INTO `base_sys_role_menu` VALUES (543, '2023-02-20 11:01:20.095790', '2023-02-20 11:01:20.095790', 13, 24); -INSERT INTO `base_sys_role_menu` VALUES (544, '2023-02-20 11:01:20.201315', '2023-02-20 11:01:20.201315', 13, 25); -INSERT INTO `base_sys_role_menu` VALUES (545, '2023-02-20 11:01:20.308299', '2023-02-20 11:01:20.308299', 13, 26); -INSERT INTO `base_sys_role_menu` VALUES (546, '2023-02-20 11:01:20.414844', '2023-02-20 11:01:20.414844', 13, 69); -INSERT INTO `base_sys_role_menu` VALUES (547, '2023-02-20 11:01:20.528804', '2023-02-20 11:01:20.528804', 13, 70); -INSERT INTO `base_sys_role_menu` VALUES (548, '2023-02-20 11:01:20.635504', '2023-02-20 11:01:20.635504', 13, 71); -INSERT INTO `base_sys_role_menu` VALUES (549, '2023-02-20 11:01:20.749819', '2023-02-20 11:01:20.749819', 13, 72); -INSERT INTO `base_sys_role_menu` VALUES (550, '2023-02-20 11:01:20.864884', '2023-02-20 11:01:20.864884', 13, 73); -INSERT INTO `base_sys_role_menu` VALUES (551, '2023-02-20 11:01:20.970192', '2023-02-20 11:01:20.970192', 13, 74); -INSERT INTO `base_sys_role_menu` VALUES (552, '2023-02-20 11:01:21.074434', '2023-02-20 11:01:21.074434', 13, 75); -INSERT INTO `base_sys_role_menu` VALUES (553, '2023-02-20 11:01:21.179895', '2023-02-20 11:01:21.179895', 13, 76); -INSERT INTO `base_sys_role_menu` VALUES (554, '2023-02-20 11:01:21.286653', '2023-02-20 11:01:21.286653', 13, 77); -INSERT INTO `base_sys_role_menu` VALUES (555, '2023-02-20 11:01:21.389230', '2023-02-20 11:01:21.389230', 13, 78); -INSERT INTO `base_sys_role_menu` VALUES (556, '2023-02-20 11:01:21.498122', '2023-02-20 11:01:21.498122', 13, 79); -INSERT INTO `base_sys_role_menu` VALUES (557, '2023-02-20 11:01:21.608182', '2023-02-20 11:01:21.608182', 13, 80); -INSERT INTO `base_sys_role_menu` VALUES (558, '2023-02-20 11:01:21.716534', '2023-02-20 11:01:21.716534', 13, 81); -INSERT INTO `base_sys_role_menu` VALUES (559, '2023-02-20 11:01:21.821921', '2023-02-20 11:01:21.821921', 13, 82); -INSERT INTO `base_sys_role_menu` VALUES (560, '2023-02-20 11:01:21.924088', '2023-02-20 11:01:21.924088', 13, 83); -INSERT INTO `base_sys_role_menu` VALUES (561, '2023-02-20 11:01:22.027509', '2023-02-20 11:01:22.027509', 13, 105); -INSERT INTO `base_sys_role_menu` VALUES (562, '2023-02-20 11:01:22.138587', '2023-02-20 11:01:22.138587', 13, 102); -INSERT INTO `base_sys_role_menu` VALUES (563, '2023-02-20 11:01:22.248197', '2023-02-20 11:01:22.248197', 13, 103); -INSERT INTO `base_sys_role_menu` VALUES (564, '2023-02-20 11:01:22.348024', '2023-02-20 11:01:22.348024', 13, 29); -INSERT INTO `base_sys_role_menu` VALUES (565, '2023-02-20 11:01:22.450315', '2023-02-20 11:01:22.450315', 13, 30); -INSERT INTO `base_sys_role_menu` VALUES (566, '2023-02-20 11:01:22.561988', '2023-02-20 11:01:22.561988', 13, 47); -INSERT INTO `base_sys_role_menu` VALUES (567, '2023-02-20 11:01:22.672138', '2023-02-20 11:01:22.672138', 13, 48); -INSERT INTO `base_sys_role_menu` VALUES (568, '2023-02-20 11:01:22.791173', '2023-02-20 11:01:22.791173', 13, 84); -INSERT INTO `base_sys_role_menu` VALUES (569, '2023-02-20 11:01:22.898018', '2023-02-20 11:01:22.898018', 13, 90); -INSERT INTO `base_sys_role_menu` VALUES (570, '2023-02-20 11:01:23.008575', '2023-02-20 11:01:23.008575', 13, 85); -COMMIT; - --- ---------------------------- --- Table structure for base_sys_user --- ---------------------------- -DROP TABLE IF EXISTS `base_sys_user`; -CREATE TABLE `base_sys_user` ( - `id` int NOT NULL AUTO_INCREMENT COMMENT 'ID', - `createTime` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) COMMENT '创建时间', - `updateTime` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6) COMMENT '更新时间', - `departmentId` bigint DEFAULT NULL COMMENT '部门ID', - `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '姓名', - `username` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '用户名', - `password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '密码', - `passwordV` int NOT NULL DEFAULT '1' COMMENT '密码版本, 作用是改完密码,让原来的token失效', - `nickName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '昵称', - `headImg` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '头像', - `phone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '手机', - `email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '邮箱', - `status` tinyint NOT NULL DEFAULT '1' COMMENT '状态 0:禁用 1:启用', - `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '备注', - `socketId` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'socketId', - PRIMARY KEY (`id`) USING BTREE, - UNIQUE KEY `IDX_469ad55973f5b98930f6ad627b` (`username`) USING BTREE, - KEY `IDX_0cf944da378d70a94f5fefd803` (`departmentId`) USING BTREE, - KEY `IDX_9ec6d7ac6337eafb070e4881a8` (`phone`) USING BTREE, - KEY `IDX_ca8611d15a63d52aa4e292e46a` (`createTime`) USING BTREE, - KEY `IDX_a0f2f19cee18445998ece93ddd` (`updateTime`) USING BTREE -) ENGINE=InnoDB AUTO_INCREMENT=32 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; - --- ---------------------------- --- Records of base_sys_user --- ---------------------------- -BEGIN; -INSERT INTO `base_sys_user` VALUES (1, '2021-02-24 21:16:41.525157', '2023-03-08 15:11:51.000000', 1, '超级管理员', 'admin', 'e10adc3949ba59abbe56e057f20f883e', 7, '管理员', 'https://cool-js.com/admin/headimg.jpg', '18000000000', 'team@cool-js.com', 1, '拥有最高权限的用户', NULL); -INSERT INTO `base_sys_user` VALUES (24, '2021-02-26 14:17:38.000000', '2023-03-06 20:18:58.000000', 1, '小白', 'xiaobai', 'e10adc3949ba59abbe56e057f20f883e', 1, '小白', 'https://cool-js.com/admin/headimg.jpg', NULL, NULL, 1, NULL, NULL); -INSERT INTO `base_sys_user` VALUES (25, '2021-02-26 14:28:25.000000', '2023-03-06 20:18:53.000000', 1, '小黑', 'xiaohei', 'e10adc3949ba59abbe56e057f20f883e', 1, '小黑', 'https://cool-js.com/admin/headimg.jpg', NULL, NULL, 1, NULL, NULL); -INSERT INTO `base_sys_user` VALUES (26, '2021-02-26 14:28:49.000000', '2023-03-06 20:18:48.000000', 1, '小绿', 'xiaolv', 'e10adc3949ba59abbe56e057f20f883e', 1, '小绿', 'https://cool-js.com/admin/headimg.jpg', NULL, NULL, 1, NULL, NULL); -INSERT INTO `base_sys_user` VALUES (27, '2021-02-26 14:29:23.000000', '2023-03-07 13:15:00.000000', 1, '小青', 'xiaoqin', 'e10adc3949ba59abbe56e057f20f883e', 1, '小青', 'https://cool-js.com/admin/headimg.jpg', NULL, NULL, 1, NULL, NULL); -INSERT INTO `base_sys_user` VALUES (28, '2021-02-26 14:29:52.000000', '2023-03-06 19:57:46.000000', 1, '神仙都没用', 'icssoa', 'e10adc3949ba59abbe56e057f20f883e', 1, '神仙都没用', 'https://cool-js.com/admin/headimg.jpg', NULL, NULL, 1, NULL, NULL); -COMMIT; - --- ---------------------------- --- Table structure for base_sys_user_role --- ---------------------------- -DROP TABLE IF EXISTS `base_sys_user_role`; -CREATE TABLE `base_sys_user_role` ( - `id` int NOT NULL AUTO_INCREMENT COMMENT 'ID', - `createTime` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) COMMENT '创建时间', - `updateTime` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6) COMMENT '更新时间', - `userId` bigint NOT NULL COMMENT '用户ID', - `roleId` bigint NOT NULL COMMENT '角色ID', - PRIMARY KEY (`id`) USING BTREE, - KEY `IDX_fa9555e03e42fce748c9046b1c` (`createTime`) USING BTREE, - KEY `IDX_3e36c0d2b1a4c659c6b4fc64b3` (`updateTime`) USING BTREE -) ENGINE=InnoDB AUTO_INCREMENT=55 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; - --- ---------------------------- --- Records of base_sys_user_role --- ---------------------------- -BEGIN; -INSERT INTO `base_sys_user_role` VALUES (1, '2021-02-24 22:03:11.665805', '2021-02-24 22:03:11.665805', 1, 1); -INSERT INTO `base_sys_user_role` VALUES (2, '2021-02-25 11:03:55.325988', '2021-02-25 11:03:55.325988', 2, 1); -INSERT INTO `base_sys_user_role` VALUES (3, '2021-02-25 14:30:57.295150', '2021-02-25 14:30:57.295150', 3, 1); -INSERT INTO `base_sys_user_role` VALUES (4, '2021-02-25 14:39:32.975014', '2021-02-25 14:39:32.975014', 4, 1); -INSERT INTO `base_sys_user_role` VALUES (5, '2021-02-25 14:40:56.812948', '2021-02-25 14:40:56.812948', 5, 1); -INSERT INTO `base_sys_user_role` VALUES (6, '2021-02-25 14:44:08.436555', '2021-02-25 14:44:08.436555', 6, 1); -INSERT INTO `base_sys_user_role` VALUES (7, '2021-02-25 14:46:17.409232', '2021-02-25 14:46:17.409232', 7, 1); -INSERT INTO `base_sys_user_role` VALUES (8, '2021-02-25 14:47:47.211749', '2021-02-25 14:47:47.211749', 8, 1); -INSERT INTO `base_sys_user_role` VALUES (9, '2021-02-25 14:48:11.734024', '2021-02-25 14:48:11.734024', 9, 1); -INSERT INTO `base_sys_user_role` VALUES (10, '2021-02-25 14:50:48.288616', '2021-02-25 14:50:48.288616', 10, 1); -INSERT INTO `base_sys_user_role` VALUES (11, '2021-02-25 14:51:32.123884', '2021-02-25 14:51:32.123884', 11, 1); -INSERT INTO `base_sys_user_role` VALUES (12, '2021-02-25 15:46:26.356943', '2021-02-25 15:46:26.356943', 12, 1); -INSERT INTO `base_sys_user_role` VALUES (13, '2021-02-25 15:56:43.475155', '2021-02-25 15:56:43.475155', 13, 1); -INSERT INTO `base_sys_user_role` VALUES (14, '2021-02-25 16:03:14.417784', '2021-02-25 16:03:14.417784', 14, 1); -INSERT INTO `base_sys_user_role` VALUES (16, '2021-02-25 16:22:11.200152', '2021-02-25 16:22:11.200152', 16, 1); -INSERT INTO `base_sys_user_role` VALUES (17, '2021-02-25 17:44:37.635550', '2021-02-25 17:44:37.635550', 15, 1); -INSERT INTO `base_sys_user_role` VALUES (19, '2021-02-25 17:51:00.554812', '2021-02-25 17:51:00.554812', 18, 1); -INSERT INTO `base_sys_user_role` VALUES (21, '2021-02-25 17:54:41.375113', '2021-02-25 17:54:41.375113', 17, 1); -INSERT INTO `base_sys_user_role` VALUES (22, '2021-02-25 17:55:49.385301', '2021-02-25 17:55:49.385301', 20, 1); -INSERT INTO `base_sys_user_role` VALUES (24, '2021-02-25 17:58:35.452363', '2021-02-25 17:58:35.452363', 22, 1); -INSERT INTO `base_sys_user_role` VALUES (27, '2021-02-25 21:25:55.005236', '2021-02-25 21:25:55.005236', 19, 1); -INSERT INTO `base_sys_user_role` VALUES (28, '2021-02-26 13:50:05.633242', '2021-02-26 13:50:05.633242', 21, 8); -INSERT INTO `base_sys_user_role` VALUES (29, '2021-02-26 13:50:17.836990', '2021-02-26 13:50:17.836990', 23, 8); -INSERT INTO `base_sys_user_role` VALUES (45, '2023-02-16 19:11:10.029945', '2023-02-16 19:11:10.029945', 29, 10); -INSERT INTO `base_sys_user_role` VALUES (46, '2023-03-06 19:57:46.215729', '2023-03-06 19:57:46.215729', 28, 12); -INSERT INTO `base_sys_user_role` VALUES (47, '2023-03-06 19:57:46.228651', '2023-03-06 19:57:46.228651', 28, 10); -INSERT INTO `base_sys_user_role` VALUES (49, '2023-03-06 20:18:48.992031', '2023-03-06 20:18:48.992031', 26, 13); -INSERT INTO `base_sys_user_role` VALUES (50, '2023-03-06 20:18:53.818567', '2023-03-06 20:18:53.818567', 25, 13); -INSERT INTO `base_sys_user_role` VALUES (51, '2023-03-06 20:18:58.691102', '2023-03-06 20:18:58.691102', 24, 12); -INSERT INTO `base_sys_user_role` VALUES (52, '2023-03-06 20:28:45.169085', '2023-03-06 20:28:45.169085', 30, 11); -INSERT INTO `base_sys_user_role` VALUES (53, '2023-03-07 11:39:57.672383', '2023-03-07 11:39:57.672383', 31, 10); -INSERT INTO `base_sys_user_role` VALUES (54, '2023-03-07 13:15:00.326613', '2023-03-07 13:15:00.326613', 27, 11); -COMMIT; - -SET FOREIGN_KEY_CHECKS = 1; diff --git a/src/modules/base/menu.json b/src/modules/base/menu.json new file mode 100644 index 0000000..edb23bf --- /dev/null +++ b/src/modules/base/menu.json @@ -0,0 +1,554 @@ +[ + { + "name": "系统管理", + "router": "/sys", + "perms": null, + "type": 0, + "icon": "icon-system", + "orderNum": 2, + "viewPath": null, + "keepAlive": true, + "isShow": true, + "childMenus": [ + { + "name": "权限管理", + "router": null, + "perms": null, + "type": 0, + "icon": "icon-auth", + "orderNum": 1, + "viewPath": null, + "keepAlive": false, + "isShow": true, + "childMenus": [ + { + "name": "菜单列表", + "router": "/sys/menu", + "perms": null, + "type": 1, + "icon": "icon-menu", + "orderNum": 2, + "viewPath": "modules/base/views/menu/index.vue", + "keepAlive": true, + "isShow": true, + "childMenus": [ + { + "name": "新增", + "router": null, + "perms": "base:sys:menu:add", + "type": 2, + "icon": null, + "orderNum": 1, + "viewPath": null, + "keepAlive": false, + "isShow": true, + "childMenus": [] + }, + { + "name": "删除", + "router": null, + "perms": "base:sys:menu:delete", + "type": 2, + "icon": null, + "orderNum": 2, + "viewPath": null, + "keepAlive": false, + "isShow": true, + "childMenus": [] + }, + { + "name": "查询", + "router": null, + "perms": "base:sys:menu:page,base:sys:menu:list,base:sys:menu:info", + "type": 2, + "icon": null, + "orderNum": 4, + "viewPath": null, + "keepAlive": false, + "isShow": true, + "childMenus": [] + }, + { + "name": "参数", + "router": "/test/aa", + "perms": null, + "type": 1, + "icon": "icon-goods", + "orderNum": 0, + "viewPath": "modules/base/views/info.vue", + "keepAlive": true, + "isShow": true, + "childMenus": [] + }, + { + "name": "编辑", + "router": null, + "perms": "base:sys:menu:info,base:sys:menu:update", + "type": 2, + "icon": null, + "orderNum": 0, + "viewPath": null, + "keepAlive": true, + "isShow": true, + "childMenus": [] + } + ] + }, + { + "name": "角色列表", + "router": "/sys/role", + "perms": null, + "type": 1, + "icon": "icon-dept", + "orderNum": 3, + "viewPath": "cool/modules/base/views/role.vue", + "keepAlive": true, + "isShow": true, + "childMenus": [ + { + "name": "新增", + "router": null, + "perms": "base:sys:role:add", + "type": 2, + "icon": null, + "orderNum": 1, + "viewPath": null, + "keepAlive": false, + "isShow": true, + "childMenus": [] + }, + { + "name": "删除", + "router": null, + "perms": "base:sys:role:delete", + "type": 2, + "icon": null, + "orderNum": 2, + "viewPath": null, + "keepAlive": false, + "isShow": true, + "childMenus": [] + }, + { + "name": "修改", + "router": null, + "perms": "base:sys:role:update", + "type": 2, + "icon": null, + "orderNum": 3, + "viewPath": null, + "keepAlive": false, + "isShow": true, + "childMenus": [] + }, + { + "name": "查询", + "router": null, + "perms": "base:sys:role:page,base:sys:role:list,base:sys:role:info", + "type": 2, + "icon": null, + "orderNum": 4, + "viewPath": null, + "keepAlive": false, + "isShow": true, + "childMenus": [] + } + ] + }, + { + "name": "用户列表", + "router": "/sys/user", + "perms": null, + "type": 1, + "icon": "icon-user", + "orderNum": 0, + "viewPath": "modules/base/views/user/index.vue", + "keepAlive": true, + "isShow": true, + "childMenus": [ + { + "name": "部门列表", + "router": null, + "perms": "base:sys:department:list", + "type": 2, + "icon": null, + "orderNum": 0, + "viewPath": null, + "keepAlive": true, + "isShow": true, + "childMenus": [] + }, + { + "name": "新增部门", + "router": null, + "perms": "base:sys:department:add", + "type": 2, + "icon": null, + "orderNum": 0, + "viewPath": null, + "keepAlive": true, + "isShow": true, + "childMenus": [] + }, + { + "name": "更新部门", + "router": null, + "perms": "base:sys:department:update", + "type": 2, + "icon": null, + "orderNum": 0, + "viewPath": null, + "keepAlive": true, + "isShow": true, + "childMenus": [] + }, + { + "name": "删除部门", + "router": null, + "perms": "base:sys:department:delete", + "type": 2, + "icon": null, + "orderNum": 0, + "viewPath": null, + "keepAlive": true, + "isShow": true, + "childMenus": [] + }, + { + "name": "部门排序", + "router": null, + "perms": "base:sys:department:order", + "type": 2, + "icon": null, + "orderNum": 0, + "viewPath": null, + "keepAlive": true, + "isShow": true, + "childMenus": [] + }, + { + "name": "用户转移", + "router": null, + "perms": "base:sys:user:move", + "type": 2, + "icon": null, + "orderNum": 0, + "viewPath": null, + "keepAlive": true, + "isShow": true, + "childMenus": [] + }, + { + "name": "新增", + "router": null, + "perms": "base:sys:user:add", + "type": 2, + "icon": null, + "orderNum": 0, + "viewPath": null, + "keepAlive": true, + "isShow": true, + "childMenus": [] + }, + { + "name": "删除", + "router": null, + "perms": "base:sys:user:delete", + "type": 2, + "icon": null, + "orderNum": 0, + "viewPath": null, + "keepAlive": true, + "isShow": true, + "childMenus": [] + }, + { + "name": "修改", + "router": null, + "perms": "base:sys:user:delete,base:sys:user:update", + "type": 2, + "icon": null, + "orderNum": 0, + "viewPath": null, + "keepAlive": true, + "isShow": true, + "childMenus": [] + }, + { + "name": "查询", + "router": null, + "perms": "base:sys:user:page,base:sys:user:list,base:sys:user:info", + "type": 2, + "icon": null, + "orderNum": 0, + "viewPath": null, + "keepAlive": true, + "isShow": true, + "childMenus": [] + } + ] + } + ] + }, + { + "name": "参数配置", + "router": null, + "perms": null, + "type": 0, + "icon": "icon-params", + "orderNum": 3, + "viewPath": null, + "keepAlive": true, + "isShow": true, + "childMenus": [ + { + "name": "参数列表", + "router": "/sys/param", + "perms": null, + "type": 1, + "icon": "icon-menu", + "orderNum": 0, + "viewPath": "cool/modules/base/views/param.vue", + "keepAlive": true, + "isShow": true, + "childMenus": [ + { + "name": "新增", + "router": null, + "perms": "base:sys:param:add", + "type": 2, + "icon": null, + "orderNum": 0, + "viewPath": null, + "keepAlive": true, + "isShow": true, + "childMenus": [] + }, + { + "name": "修改", + "router": null, + "perms": "base:sys:param:info,base:sys:param:update", + "type": 2, + "icon": null, + "orderNum": 0, + "viewPath": null, + "keepAlive": true, + "isShow": true, + "childMenus": [] + }, + { + "name": "删除", + "router": null, + "perms": "base:sys:param:delete", + "type": 2, + "icon": null, + "orderNum": 0, + "viewPath": null, + "keepAlive": true, + "isShow": true, + "childMenus": [] + }, + { + "name": "查看", + "router": null, + "perms": "base:sys:param:page,base:sys:param:list,base:sys:param:info", + "type": 2, + "icon": null, + "orderNum": 0, + "viewPath": null, + "keepAlive": true, + "isShow": true, + "childMenus": [] + } + ] + } + ] + }, + { + "name": "监控管理", + "router": null, + "perms": null, + "type": 0, + "icon": "icon-monitor", + "orderNum": 9, + "viewPath": null, + "keepAlive": true, + "isShow": true, + "childMenus": [ + { + "name": "请求日志", + "router": "/sys/log", + "perms": null, + "type": 1, + "icon": "icon-log", + "orderNum": 1, + "viewPath": "cool/modules/base/views/log.vue", + "keepAlive": true, + "isShow": true, + "childMenus": [ + { + "name": "权限", + "router": null, + "perms": "base:sys:log:page,base:sys:log:clear,base:sys:log:getKeep,base:sys:log:setKeep", + "type": 2, + "icon": null, + "orderNum": 1, + "viewPath": null, + "keepAlive": false, + "isShow": true, + "childMenus": [] + } + ] + } + ] + } + ] + }, + { + "name": "框架教程", + "router": "/tutorial", + "perms": null, + "type": 0, + "icon": "icon-task", + "orderNum": 98, + "viewPath": null, + "keepAlive": true, + "isShow": true, + "childMenus": [ + { + "name": "文档", + "router": "/tutorial/doc", + "perms": null, + "type": 1, + "icon": "icon-log", + "orderNum": 0, + "viewPath": "https://admin.cool-js.com", + "keepAlive": true, + "isShow": true, + "childMenus": [] + }, + { + "name": "插件市场", + "router": "/tutorial/plugin", + "perms": null, + "type": 1, + "icon": "icon-app", + "orderNum": 1, + "viewPath": "https://cool-js.com/plugin/list.html", + "keepAlive": true, + "isShow": true, + "childMenus": [] + } + ] + }, + { + "name": "通用", + "router": null, + "perms": null, + "type": 0, + "icon": "icon-radioboxfill", + "orderNum": 99, + "viewPath": null, + "keepAlive": true, + "isShow": false, + "childMenus": [ + { + "name": "图片上传", + "router": null, + "perms": "space:info:page,space:info:list,space:info:info,space:info:add,space:info:delete,space:info:update,space:type:page,space:type:list,space:type:info,space:type:add,space:type:delete,space:type:update", + "type": 2, + "icon": null, + "orderNum": 1, + "viewPath": null, + "keepAlive": true, + "isShow": true, + "childMenus": [] + } + ] + }, + { + "name": "页面设计", + "router": "/design/page", + "perms": null, + "type": 1, + "icon": "icon-design", + "orderNum": 7, + "viewPath": "modules/design/views/page.vue", + "keepAlive": true, + "isShow": true, + "childMenus": [] + }, + { + "name": "工作台", + "router": null, + "perms": null, + "type": 0, + "icon": "icon-workbench", + "orderNum": 1, + "viewPath": null, + "keepAlive": true, + "isShow": true, + "childMenus": [ + { + "name": "组件预览", + "router": "/demo", + "perms": null, + "type": 1, + "icon": "icon-favor", + "orderNum": 1, + "viewPath": "modules/demo/views/demo.vue", + "keepAlive": true, + "isShow": true, + "childMenus": [] + }, + { + "name": "crud 示例", + "router": "/demo/crud", + "perms": null, + "type": 1, + "icon": "icon-favor", + "orderNum": 1, + "viewPath": "modules/demo/views/crud.vue", + "keepAlive": true, + "isShow": true, + "childMenus": [] + }, + { + "name": "编辑器", + "router": "/demo/editor", + "perms": null, + "type": 1, + "icon": "icon-favor", + "orderNum": 4, + "viewPath": "modules/demo/views/editor.vue", + "keepAlive": true, + "isShow": true, + "childMenus": [] + }, + { + "name": "文件上传", + "router": "/demo/upload", + "perms": null, + "type": 1, + "icon": "icon-favor", + "orderNum": 3, + "viewPath": "modules/demo/views/upload.vue", + "keepAlive": true, + "isShow": true, + "childMenus": [] + } + ] + }, + { + "name": "首页", + "router": "/", + "perms": null, + "type": 1, + "icon": null, + "orderNum": 0, + "viewPath": "modules/demo/views/home/index.vue", + "keepAlive": true, + "isShow": false, + "childMenus": [] + } +] \ No newline at end of file diff --git a/src/modules/base/service/sys/department.ts b/src/modules/base/service/sys/department.ts index 512cbfb..714e882 100644 --- a/src/modules/base/service/sys/department.ts +++ b/src/modules/base/service/sys/department.ts @@ -1,11 +1,12 @@ import { Inject, Provide } from '@midwayjs/decorator'; import { BaseService } from '@cool-midway/core'; import { InjectEntityModel } from '@midwayjs/typeorm'; -import { Repository } from 'typeorm'; +import { In, Repository } from 'typeorm'; import { BaseSysDepartmentEntity } from '../../entity/sys/department'; import * as _ from 'lodash'; import { BaseSysRoleDepartmentEntity } from '../../entity/sys/role_department'; import { BaseSysPermsService } from './perms'; +import { BaseSysUserEntity } from '../../entity/sys/user'; /** * 描述 @@ -15,6 +16,9 @@ export class BaseSysDepartmentService extends BaseService { @InjectEntityModel(BaseSysDepartmentEntity) baseSysDepartmentEntity: Repository; + @InjectEntityModel(BaseSysUserEntity) + baseSysUserEntity: Repository; + @InjectEntityModel(BaseSysRoleDepartmentEntity) baseSysRoleDepartmentEntity: Repository; @@ -34,12 +38,12 @@ export class BaseSysDepartmentService extends BaseService { ); // 过滤部门权限 - const find = this.baseSysDepartmentEntity.createQueryBuilder(); + const find = this.baseSysDepartmentEntity.createQueryBuilder('a'); if (this.ctx.admin.username !== 'admin') - find.andWhere('id in (:ids)', { + find.andWhere('a.id in (:...ids)', { ids: !_.isEmpty(permsDepartmentArr) ? permsDepartmentArr : [null], }); - find.addOrderBy('orderNum', 'ASC'); + find.addOrderBy('a.orderNum', 'ASC'); const departments: BaseSysDepartmentEntity[] = await find.getMany(); if (!_.isEmpty(departments)) { @@ -72,8 +76,8 @@ export class BaseSysDepartmentService extends BaseService { }); } const result = await this.baseSysRoleDepartmentEntity - .createQueryBuilder() - .where('roleId in (:roleIds)', { roleIds }) + .createQueryBuilder('a') + .where('a.roleId in (:...roleIds)', { roleIds }) .getMany(); if (!_.isEmpty(result)) { return _.uniq( @@ -103,19 +107,16 @@ export class BaseSysDepartmentService extends BaseService { const { deleteUser } = this.ctx.request.body; await super.delete(ids); if (deleteUser) { - await this.nativeQuery( - 'delete from base_sys_user where departmentId in (?)', - [ids] - ); + await this.baseSysUserEntity.delete({ departmentId: In(ids) }); } else { const topDepartment = await this.baseSysDepartmentEntity - .createQueryBuilder() - .where('parentId is null') + .createQueryBuilder('a') + .where('a.parentId is null') .getOne(); if (topDepartment) { - await this.nativeQuery( - 'update base_sys_user a set a.departmentId = ? where a.departmentId in (?)', - [topDepartment.id, ids] + await this.baseSysUserEntity.update( + { departmentId: In(ids) }, + { departmentId: topDepartment.id } ); } } diff --git a/src/modules/base/service/sys/menu.ts b/src/modules/base/service/sys/menu.ts index ba77046..c1d1d36 100644 --- a/src/modules/base/service/sys/menu.ts +++ b/src/modules/base/service/sys/menu.ts @@ -12,6 +12,8 @@ import { TempDataSource } from './data'; import * as ts from 'typescript'; import * as fs from 'fs'; import * as pathUtil from 'path'; +import { BaseSysRoleMenuEntity } from '../../entity/sys/role_menu'; +import { BaseSysUserRoleEntity } from '../../entity/sys/user_role'; /** * 菜单 @@ -25,6 +27,9 @@ export class BaseSysMenuService extends BaseService { @InjectEntityModel(BaseSysMenuEntity) baseSysMenuEntity: Repository; + @InjectEntityModel(BaseSysRoleMenuEntity) + baseSysRoleMenuEntity: Repository; + @Inject() baseSysPermsService: BaseSysPermsService; @@ -43,7 +48,7 @@ export class BaseSysMenuService extends BaseService { this.ctx.admin.username === 'admin' ); if (!_.isEmpty(menus)) { - menus.forEach(e => { + menus.forEach((e: any) => { const parentMenu = menus.filter(m => { e.parentId = parseInt(e.parentId); if (e.parentId == m.id) { @@ -75,16 +80,17 @@ export class BaseSysMenuService extends BaseService { async getPerms(roleIds) { let perms = []; if (!_.isEmpty(roleIds)) { - const result = await this.nativeQuery( - `SELECT a.perms FROM base_sys_menu a ${this.setSql( - !roleIds.includes('1'), - 'JOIN base_sys_role_menu b on a.id = b.menuId AND b.roleId in (?)', - [roleIds] - )} - where 1=1 and a.perms is not NULL - `, - [roleIds] - ); + const find = await this.baseSysMenuEntity.createQueryBuilder('a'); + if (!roleIds.includes(1)) { + find.innerJoinAndSelect( + BaseSysRoleMenuEntity, + 'b', + 'a.id = b.menuId AND b.roleId in (:...roleIds)', + { roleIds } + ); + } + find.where('a.perms is not NULL'); + const result = await find.getMany(); if (result) { result.forEach(d => { if (d.perms) { @@ -106,19 +112,18 @@ export class BaseSysMenuService extends BaseService { * @param isAdmin 是否是超管 */ async getMenus(roleIds, isAdmin) { - return await this.nativeQuery(` - SELECT - a.* - FROM - base_sys_menu a - ${this.setSql( - !isAdmin, - 'JOIN base_sys_role_menu b on a.id = b.menuId AND b.roleId in (?)', - [roleIds] - )} - GROUP BY a.id - ORDER BY - orderNum ASC`); + const find = this.baseSysMenuEntity.createQueryBuilder('a'); + if (!isAdmin) { + find.innerJoinAndSelect( + BaseSysRoleMenuEntity, + 'b', + 'a.id = b.menuId AND b.roleId in (:...roleIds)', + { roleIds } + ); + } + find.orderBy('a.orderNum', 'ASC'); + find.groupBy('a.id'); + return await find.getMany(); } /** @@ -162,15 +167,16 @@ export class BaseSysMenuService extends BaseService { * @param menuId */ async refreshPerms(menuId) { - const users = await this.nativeQuery( - 'select b.userId from base_sys_role_menu a left join base_sys_user_role b on a.roleId = b.roleId where a.menuId = ? group by b.userId', - [menuId] - ); + const find = this.baseSysRoleMenuEntity.createQueryBuilder('a'); + find.leftJoinAndSelect(BaseSysUserRoleEntity, 'b', 'a.roleId = b.roleId'); + find.where('a.menuId = :menuId', { menuId: menuId }); + find.select('b.userId', 'userId'); + const users = await find.getRawMany(); // 刷新admin权限 await this.baseSysPermsService.refreshPerms(1); if (!_.isEmpty(users)) { // 刷新其他权限 - for (const user of users) { + for (const user of _.uniqBy(users, 'userId')) { await this.baseSysPermsService.refreshPerms(user.userId); } } diff --git a/src/modules/base/service/sys/role.ts b/src/modules/base/service/sys/role.ts index 70bee87..e013b52 100644 --- a/src/modules/base/service/sys/role.ts +++ b/src/modules/base/service/sys/role.ts @@ -118,13 +118,13 @@ export class BaseSysRoleService extends BaseService { async list() { return this.baseSysRoleEntity - .createQueryBuilder() + .createQueryBuilder('a') .where( new Brackets(qb => { - qb.where('id !=:id', { id: 1 }); // 超级管理员的角色不展示 + qb.where('a.id !=:id', { id: 1 }); // 超级管理员的角色不展示 // 如果不是超管,只能看到自己新建的或者自己有的角色 if (this.ctx.admin.username !== 'admin') { - qb.andWhere('(userId=:userId or id in (:roleId))', { + qb.andWhere('(a.userId=:userId or a.id in (:...roleId))', { userId: this.ctx.admin.userId, roleId: this.ctx.admin.roleIds, }); diff --git a/src/modules/base/service/sys/user.ts b/src/modules/base/service/sys/user.ts index 4b07645..5f9dd82 100644 --- a/src/modules/base/service/sys/user.ts +++ b/src/modules/base/service/sys/user.ts @@ -45,13 +45,10 @@ export class BaseSysUserService extends BaseService { const sql = ` SELECT a.id,a.name,a.nickName,a.headImg,a.email,a.remark,a.status,a.createTime,a.updateTime,a.username,a.phone,a.departmentId, - GROUP_CONCAT(c.name) AS roleName, - d.name as departmentName + b.name as "departmentName" FROM base_sys_user a - LEFT JOIN base_sys_user_role b ON a.id = b.userId - LEFT JOIN base_sys_role c ON b.roleId = c.id - LEFT JOIN base_sys_department d on a.departmentId = d.id + LEFT JOIN base_sys_department b on a.departmentId = b.id WHERE 1 = 1 ${this.setSql( !_.isEmpty(departmentIds), @@ -68,10 +65,23 @@ export class BaseSysUserService extends BaseService { this.ctx.admin.username !== 'admin', 'and a.departmentId in (?)', [!_.isEmpty(permsDepartmentArr) ? permsDepartmentArr : [null]] - )} - GROUP BY a.id - `; - return this.sqlRenderPage(sql, query); + )} `; + const result = await this.sqlRenderPage(sql, query); + // 匹配角色 + if (!_.isEmpty(result.list)) { + const userIds = result.list.map(e => e.id); + const roles = await this.nativeQuery( + 'SELECT b.name, a.userId FROM base_sys_user_role a LEFT JOIN base_sys_role b ON a.roleId = b.id WHERE a.userId in (?) ', + [userIds] + ); + result.list.forEach(e => { + e['roleName'] = roles + .filter(role => role.userId == e.id) + .map(role => role.name) + .join(','); + }); + } + return result; } /** @@ -81,10 +91,10 @@ export class BaseSysUserService extends BaseService { */ async move(departmentId, userIds) { await this.baseSysUserEntity - .createQueryBuilder() + .createQueryBuilder('a') .update() .set({ departmentId }) - .where('id in (:userIds)', { userIds }) + .where('a.id in (:...userIds)', { userIds }) .execute(); } diff --git a/src/modules/cloud/entity/func/log.ts b/src/modules/cloud/entity/func/log.ts index eddb736..9b5ab9e 100644 --- a/src/modules/cloud/entity/func/log.ts +++ b/src/modules/cloud/entity/func/log.ts @@ -17,7 +17,7 @@ export class CloudFuncLogEntity extends BaseEntity { @Column({ comment: '结果', type: 'json', nullable: true }) result: string; - @Column({ comment: '类型 0-失败 1-成功', default: 1, type: 'tinyint' }) + @Column({ comment: '类型 0-失败 1-成功', default: 1 }) type: number; @Column({ comment: '异常信息', nullable: true, type: 'text' }) diff --git a/src/modules/cloud/init.sql b/src/modules/cloud/init.sql deleted file mode 100644 index 8a6354a..0000000 --- a/src/modules/cloud/init.sql +++ /dev/null @@ -1,17 +0,0 @@ - --- ---------------------------- --- Records of cloud_db --- ---------------------------- -BEGIN; -INSERT INTO `cloud_db` VALUES (13, '2023-02-16 19:25:21.995000', '2023-02-23 12:00:43.621000', '用户', NULL, 'import { BaseEntity } from \'@cool-midway/core\';\nimport { Column, Entity } from \'typeorm\';\n\n/**\n * 描述\n */\n@Entity(\'user\')\nexport class UserEntity extends BaseEntity {\n @Column({ comment: \'姓名\' })\n name: string;\n @Column({ comment: \'年龄\' })\n age: string;\n}', 'UserEntity', 'func_user', 1); -COMMIT; - - --- ---------------------------- --- Records of cloud_func_info --- ---------------------------- -BEGIN; -INSERT INTO `cloud_func_info` VALUES (1, '2023-02-15 15:29:00.010000', '2023-03-07 04:14:27.212000', '测试', 'ddd', 'import { CloudCrud } from \'@cool-midway/cloud\';\n\n/**\n * 描述\n */\nexport class User extends CloudCrud {\n async main() {\n this.setCurdOption({\n entity: \'TestUserEntity\',\n api: [\"add\", \"page\"]\n });\n }\n}', 1); -INSERT INTO `cloud_func_info` VALUES (2, '2023-02-16 01:21:20.485000', '2023-03-07 04:14:26.372000', '用户1', NULL, 'import { CloudCrud } from \'@cool-midway/cloud\';\n\n/**\n * 描述\n */\nexport class Xxx extends CloudCrud {\n async main() {\n this.setCurdOption({\n entity: \'UserEntity\',\n api: [\'add\', \'delete\', \'update\', \'info\', \'list\', \'page\']\n });\n }\n}\n', 0); -COMMIT; - diff --git a/src/modules/cloud/menu.json b/src/modules/cloud/menu.json new file mode 100644 index 0000000..135ac13 --- /dev/null +++ b/src/modules/cloud/menu.json @@ -0,0 +1,245 @@ +[ + { + "name": "函数开发", + "router": null, + "perms": null, + "type": 0, + "icon": "icon-fx", + "orderNum": 6, + "viewPath": null, + "keepAlive": true, + "isShow": true, + "childMenus": [ + { + "name": "云数据库", + "router": "/cloud/db", + "perms": null, + "type": 1, + "icon": "icon-db", + "orderNum": 1, + "viewPath": "modules/cloud/views/db.vue", + "keepAlive": true, + "isShow": true, + "childMenus": [ + { + "name": "初始化Entity", + "router": null, + "perms": "cloud:db:initEntity", + "type": 2, + "icon": null, + "orderNum": 0, + "viewPath": null, + "keepAlive": true, + "isShow": true, + "childMenus": [] + }, + { + "name": "删除", + "router": null, + "perms": "cloud:db:delete", + "type": 2, + "icon": null, + "orderNum": 0, + "viewPath": null, + "keepAlive": true, + "isShow": true, + "childMenus": [] + }, + { + "name": "修改", + "router": null, + "perms": "cloud:db:update,cloud:db:info", + "type": 2, + "icon": null, + "orderNum": 0, + "viewPath": null, + "keepAlive": true, + "isShow": true, + "childMenus": [] + }, + { + "name": "数据操作测试", + "router": null, + "perms": "cloud:db:data", + "type": 2, + "icon": null, + "orderNum": 0, + "viewPath": null, + "keepAlive": true, + "isShow": true, + "childMenus": [] + }, + { + "name": "单个信息", + "router": null, + "perms": "cloud:db:info", + "type": 2, + "icon": null, + "orderNum": 0, + "viewPath": null, + "keepAlive": true, + "isShow": true, + "childMenus": [] + }, + { + "name": "列表查询", + "router": null, + "perms": "cloud:db:list", + "type": 2, + "icon": null, + "orderNum": 0, + "viewPath": null, + "keepAlive": true, + "isShow": true, + "childMenus": [] + }, + { + "name": "分页查询", + "router": null, + "perms": "cloud:db:page", + "type": 2, + "icon": null, + "orderNum": 0, + "viewPath": null, + "keepAlive": true, + "isShow": true, + "childMenus": [] + }, + { + "name": "新增", + "router": null, + "perms": "cloud:db:add", + "type": 2, + "icon": null, + "orderNum": 0, + "viewPath": null, + "keepAlive": true, + "isShow": true, + "childMenus": [] + } + ] + }, + { + "name": "云函数", + "router": "/cloud/func/info", + "perms": null, + "type": 1, + "icon": "icon-menu", + "orderNum": 2, + "viewPath": "modules/cloud/views/func/info.vue", + "keepAlive": true, + "isShow": true, + "childMenus": [ + { + "name": "调用云函数", + "router": null, + "perms": "cloud:func:info:invoke", + "type": 2, + "icon": null, + "orderNum": 98, + "viewPath": null, + "keepAlive": true, + "isShow": true, + "childMenus": [] + }, + { + "name": "删除", + "router": null, + "perms": "cloud:func:info:delete", + "type": 2, + "icon": null, + "orderNum": 0, + "viewPath": null, + "keepAlive": true, + "isShow": true, + "childMenus": [] + }, + { + "name": "修改", + "router": null, + "perms": "cloud:func:info:update,cloud:func:info:info", + "type": 2, + "icon": null, + "orderNum": 0, + "viewPath": null, + "keepAlive": true, + "isShow": true, + "childMenus": [] + }, + { + "name": "单个信息", + "router": null, + "perms": "cloud:func:info:info", + "type": 2, + "icon": null, + "orderNum": 0, + "viewPath": null, + "keepAlive": true, + "isShow": true, + "childMenus": [] + }, + { + "name": "列表查询", + "router": null, + "perms": "cloud:func:info:list", + "type": 2, + "icon": null, + "orderNum": 0, + "viewPath": null, + "keepAlive": true, + "isShow": true, + "childMenus": [] + }, + { + "name": "分页查询", + "router": null, + "perms": "cloud:func:info:page", + "type": 2, + "icon": null, + "orderNum": 0, + "viewPath": null, + "keepAlive": true, + "isShow": true, + "childMenus": [] + }, + { + "name": "新增", + "router": null, + "perms": "cloud:func:info:add", + "type": 2, + "icon": null, + "orderNum": 0, + "viewPath": null, + "keepAlive": true, + "isShow": true, + "childMenus": [] + }, + { + "name": "云函数开发", + "router": null, + "perms": "cloud:func:info:info,cloud:func:info:update,cloud:func:info:invoke", + "type": 2, + "icon": null, + "orderNum": 99, + "viewPath": null, + "keepAlive": true, + "isShow": true, + "childMenus": [] + }, + { + "name": "查看日志", + "router": null, + "perms": "cloud:func:log:page", + "type": 2, + "icon": null, + "orderNum": 0, + "viewPath": null, + "keepAlive": true, + "isShow": true, + "childMenus": [] + } + ] + } + ] + } +] \ No newline at end of file diff --git a/src/modules/cloud/service/db.ts b/src/modules/cloud/service/db.ts index fb73088..02e2d14 100644 --- a/src/modules/cloud/service/db.ts +++ b/src/modules/cloud/service/db.ts @@ -22,6 +22,9 @@ export class CloudDBService extends BaseService { @Config('cool') coolConfig: CoolConfig; + @Config('typeorm.dataSource.default.type') + ormType: string; + /** * 数据 * @param id @@ -47,10 +50,10 @@ export class CloudDBService extends BaseService { if (method == 'page') { const { page = 1, size = this.coolConfig.crud.pageSize } = params; const find = repository - .createQueryBuilder() + .createQueryBuilder('a') .offset((page - 1) * size) .limit(size) - .orderBy('createTime', 'DESC'); + .orderBy('a.createTime', 'DESC'); return { list: await find.getMany(), pagination: { @@ -122,6 +125,7 @@ export class CloudDBService extends BaseService { * 初始化 */ async initEntity() { + if (this.ormType != 'mysql') return; const tables = await this.cloudDBEntity.findBy({ status: 1 }); const tableNames = []; for (const table of tables) { diff --git a/src/modules/demo/entity/goods.ts b/src/modules/demo/entity/goods.ts index 4667633..ebb9f5c 100644 --- a/src/modules/demo/entity/goods.ts +++ b/src/modules/demo/entity/goods.ts @@ -1,5 +1,5 @@ import { BaseEntity } from '@cool-midway/core'; -import { Column, Entity, Index } from 'typeorm'; +import { BeforeRemove, Column, Entity, Index } from 'typeorm'; /** * 商品模块-商品信息 @@ -29,4 +29,10 @@ export class DemoGoodsEntity extends BaseEntity { @Column({ comment: '库存', default: 0 }) stock: number; + + @BeforeRemove() + async beforeRemove() { + // await this.service.beforeRemove(this); + console.log('数据被删除11'); + } } diff --git a/src/modules/demo/service/goods.ts b/src/modules/demo/service/goods.ts index ce82a11..d6a494c 100644 --- a/src/modules/demo/service/goods.ts +++ b/src/modules/demo/service/goods.ts @@ -16,6 +16,14 @@ export class DemoGoodsService extends BaseService { * 执行sql分页 */ async sqlPage(query) { + await this.demoGoodsEntity.save({ + id: 11, + title: '11', + price: 11, + description: '11', + mainImage: '11', + }); + await this.demoGoodsEntity.delete({ id: 11 }); return this.sqlRenderPage( 'select * from demo_goods ORDER BY id ASC', query, diff --git a/src/modules/dict/db.json b/src/modules/dict/db.json new file mode 100644 index 0000000..31c79a2 --- /dev/null +++ b/src/modules/dict/db.json @@ -0,0 +1,88 @@ +{ + "dict_info": [ + { + "id": 21, + "typeId": 19, + "name": "COOL", + "orderNum": 1, + "remark": null, + "parentId": null, + "value": "cool" + }, + { + "id": 22, + "typeId": 19, + "name": "闪酷", + "orderNum": 2, + "remark": null, + "parentId": null, + "value": "https://show.cool-admin.com/api/public/uploads/20230308/c731b0cba84046268b10edbbcf36f948_315c243a448e1369fa145c5ea3f020da.gif" + }, + { + "id": 23, + "typeId": 20, + "name": "法师", + "orderNum": 1, + "remark": null, + "parentId": null, + "value": "4" + }, + { + "id": 24, + "typeId": 20, + "name": "战士", + "orderNum": 2, + "remark": null, + "parentId": null, + "value": "3" + }, + { + "id": 25, + "typeId": 20, + "name": "坦克", + "orderNum": 3, + "remark": null, + "parentId": null, + "value": "2" + }, + { + "id": 26, + "typeId": 20, + "name": "刺客", + "orderNum": 4, + "remark": null, + "parentId": null, + "value": "1" + }, + { + "id": 27, + "typeId": 20, + "name": "射手", + "orderNum": 5, + "remark": null, + "parentId": null, + "value": "0" + }, + { + "id": 30, + "typeId": 20, + "name": "幻影刺客", + "orderNum": 1, + "remark": null, + "parentId": 26, + "value": "5" + } + ], + "dict_type": [ + { + "id": 19, + "name": "品牌", + "key": "brand" + }, + { + "id": 20, + "name": "职业", + "key": "occupation" + } + ] +} \ No newline at end of file diff --git a/src/modules/dict/init.sql b/src/modules/dict/init.sql deleted file mode 100644 index fc250fa..0000000 --- a/src/modules/dict/init.sql +++ /dev/null @@ -1,50 +0,0 @@ -DROP TABLE IF EXISTS `dict_info`; -CREATE TABLE `dict_info` ( - `id` int NOT NULL AUTO_INCREMENT COMMENT 'ID', - `createTime` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) COMMENT '创建时间', - `updateTime` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6) COMMENT '更新时间', - `typeId` int NOT NULL COMMENT '类型ID', - `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '名称', - `orderNum` int NOT NULL DEFAULT 0 COMMENT '排序', - `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', - `parentId` int NULL DEFAULT NULL COMMENT '父ID', - `value` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '值', - PRIMARY KEY (`id`) USING BTREE, - INDEX `IDX_5c311a4af30de1181a5d7a7cc2`(`createTime` ASC) USING BTREE, - INDEX `IDX_10362a62adbf120821fff209d8`(`updateTime` ASC) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 31 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic; --- ---------------------------- --- Records of dict_info --- ---------------------------- -BEGIN; -INSERT INTO `dict_info` VALUES (21, '2023-03-06 11:40:51.312000', '2023-09-07 19:53:42.964000', 19, 'COOL', 1, NULL, NULL, 'cool'); -INSERT INTO `dict_info` VALUES (22, '2023-03-06 11:40:59.000000', '2023-09-08 17:20:00.448000', 19, '闪酷', 2, NULL, NULL, 'https://show.cool-admin.com/api/public/uploads/20230308/c731b0cba84046268b10edbbcf36f948_315c243a448e1369fa145c5ea3f020da.gif'); -INSERT INTO `dict_info` VALUES (23, '2023-03-06 11:41:20.581000', '2023-09-08 19:15:18.679000', 20, '法师', 1, NULL, NULL, '4'); -INSERT INTO `dict_info` VALUES (24, '2023-03-06 11:41:25.740000', '2023-09-08 19:15:15.840000', 20, '战士', 2, NULL, NULL, '3'); -INSERT INTO `dict_info` VALUES (25, '2023-03-06 11:41:31.297000', '2023-09-08 19:15:09.179000', 20, '坦克', 3, NULL, NULL, '2'); -INSERT INTO `dict_info` VALUES (26, '2023-03-06 11:41:35.987000', '2023-09-08 19:15:05.012000', 20, '刺客', 4, NULL, NULL, '1'); -INSERT INTO `dict_info` VALUES (27, '2023-03-06 11:41:41.430000', '2023-09-08 19:15:01.419000', 20, '射手', 5, NULL, NULL, '0'); -INSERT INTO `dict_info` VALUES (30, '2023-09-09 21:28:43.349000', '2023-09-09 21:28:43.349000', 20, '幻影刺客', 1, NULL, 26, '5'); -COMMIT; - - -DROP TABLE IF EXISTS `dict_type`; -CREATE TABLE `dict_type` ( - `id` int NOT NULL AUTO_INCREMENT COMMENT 'ID', - `createTime` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) COMMENT '创建时间', - `updateTime` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6) COMMENT '更新时间', - `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '名称', - `key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '标识', - PRIMARY KEY (`id`) USING BTREE, - INDEX `IDX_69734e5c2d29cc2139d5078f2c`(`createTime` ASC) USING BTREE, - INDEX `IDX_6cccb2e33846cd354e8dc0e0ef`(`updateTime` ASC) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 21 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic; --- ---------------------------- --- Records of dict_type --- ---------------------------- -BEGIN; -INSERT INTO `dict_type` VALUES (19, '2023-03-06 11:40:45.295000', '2023-03-06 11:40:45.295000', '品牌', 'brand'); -INSERT INTO `dict_type` VALUES (20, '2023-03-06 11:41:13.227000', '2023-03-06 11:41:13.227000', '职业', 'occupation'); -COMMIT; - -SET FOREIGN_KEY_CHECKS = 1; diff --git a/src/modules/dict/menu.json b/src/modules/dict/menu.json new file mode 100644 index 0000000..dd1cc35 --- /dev/null +++ b/src/modules/dict/menu.json @@ -0,0 +1,124 @@ +[ + { + "name": "字典管理", + "router": null, + "perms": null, + "type": 0, + "icon": "icon-dict", + "orderNum": 3, + "viewPath": null, + "keepAlive": true, + "isShow": true, + "childMenus": [ + { + "name": "字典列表", + "router": "/dict/list", + "perms": null, + "type": 1, + "icon": "icon-menu", + "orderNum": 1, + "viewPath": "modules/dict/views/list.vue", + "keepAlive": true, + "isShow": true, + "childMenus": [ + { + "name": "删除", + "router": null, + "perms": "dict:info:delete", + "type": 2, + "icon": null, + "orderNum": 0, + "viewPath": null, + "keepAlive": true, + "isShow": true, + "childMenus": [] + }, + { + "name": "修改", + "router": null, + "perms": "dict:info:update,dict:info:info", + "type": 2, + "icon": null, + "orderNum": 0, + "viewPath": null, + "keepAlive": true, + "isShow": true, + "childMenus": [] + }, + { + "name": "获得字典数据", + "router": null, + "perms": "dict:info:data", + "type": 2, + "icon": null, + "orderNum": 0, + "viewPath": null, + "keepAlive": true, + "isShow": true, + "childMenus": [] + }, + { + "name": "单个信息", + "router": null, + "perms": "dict:info:info", + "type": 2, + "icon": null, + "orderNum": 0, + "viewPath": null, + "keepAlive": true, + "isShow": true, + "childMenus": [] + }, + { + "name": "列表查询", + "router": null, + "perms": "dict:info:list", + "type": 2, + "icon": null, + "orderNum": 0, + "viewPath": null, + "keepAlive": true, + "isShow": true, + "childMenus": [] + }, + { + "name": "分页查询", + "router": null, + "perms": "dict:info:page", + "type": 2, + "icon": null, + "orderNum": 0, + "viewPath": null, + "keepAlive": true, + "isShow": true, + "childMenus": [] + }, + { + "name": "新增", + "router": null, + "perms": "dict:info:add", + "type": 2, + "icon": null, + "orderNum": 0, + "viewPath": null, + "keepAlive": true, + "isShow": true, + "childMenus": [] + }, + { + "name": "组权限", + "router": null, + "perms": "dict:type:list,dict:type:update,dict:type:delete,dict:type:add", + "type": 2, + "icon": null, + "orderNum": 0, + "viewPath": null, + "keepAlive": true, + "isShow": true, + "childMenus": [] + } + ] + } + ] + } +] \ No newline at end of file diff --git a/src/modules/dict/service/info.ts b/src/modules/dict/service/info.ts index 01d00d0..f350c7e 100644 --- a/src/modules/dict/service/info.ts +++ b/src/modules/dict/service/info.ts @@ -1,6 +1,6 @@ import { DictTypeEntity } from './../entity/type'; import { DictInfoEntity } from './../entity/info'; -import { Provide } from '@midwayjs/decorator'; +import { Config, Provide } from '@midwayjs/decorator'; import { BaseService } from '@cool-midway/core'; import { InjectEntityModel } from '@midwayjs/typeorm'; import { Repository, In } from 'typeorm'; @@ -17,17 +17,19 @@ export class DictInfoService extends BaseService { @InjectEntityModel(DictTypeEntity) dictTypeEntity: Repository; + @Config('typeorm.dataSource.default.type') + ormType: string; + /** * 获得字典数据 * @param types */ async data(types: string[]) { const result = {}; - const find = await this.dictTypeEntity.createQueryBuilder(); + let typeData = await this.dictTypeEntity.find(); if (!_.isEmpty(types)) { - find.where('`key` in(:key)', { key: types }); + typeData = await this.dictTypeEntity.findBy({ key: In(types) }); } - const typeData = await find.getMany(); if (_.isEmpty(typeData)) { return {}; } @@ -41,12 +43,12 @@ export class DictInfoService extends BaseService { 'a.orderNum', 'a.value', ]) - .where('typeId in(:typeIds)', { + .where('a.typeId in(:...typeIds)', { typeIds: typeData.map(e => { return e.id; }), }) - .orderBy('orderNum', 'ASC') + .orderBy('a.orderNum', 'ASC') .addOrderBy('a.createTime', 'ASC') .getMany(); for (const item of typeData) { diff --git a/src/modules/iot/entity/device.ts b/src/modules/iot/entity/device.ts index 9f5ea8a..10b95ba 100644 --- a/src/modules/iot/entity/device.ts +++ b/src/modules/iot/entity/device.ts @@ -17,7 +17,7 @@ export class IotDeviceEntity extends BaseEntity { uniqueId: string; @Index() - @Column({ comment: '状态 0-离线 1-在线', type: 'tinyint', default: 0 }) + @Column({ comment: '状态 0-离线 1-在线', default: 0 }) status: number; @Column({ comment: '客户端ID', nullable: true }) diff --git a/src/modules/iot/entity/message.ts b/src/modules/iot/entity/message.ts index 5e4643d..388d169 100644 --- a/src/modules/iot/entity/message.ts +++ b/src/modules/iot/entity/message.ts @@ -14,6 +14,6 @@ export class IotMessageEntity extends BaseEntity { data: string; @Index() - @Column({ comment: '类型 0-推送 1-接收', type: 'tinyint', default: 1 }) + @Column({ comment: '类型 0-推送 1-接收', default: 1 }) type: number; } diff --git a/src/modules/iot/menu.json b/src/modules/iot/menu.json new file mode 100644 index 0000000..a172443 --- /dev/null +++ b/src/modules/iot/menu.json @@ -0,0 +1,100 @@ +[ + { + "name": "物联管理", + "router": null, + "perms": null, + "type": 0, + "icon": "icon-iot", + "orderNum": 4, + "viewPath": null, + "keepAlive": true, + "isShow": true, + "childMenus": [ + { + "name": "MQTT", + "router": "/iot/device", + "perms": null, + "type": 1, + "icon": "icon-device", + "orderNum": 1, + "viewPath": "modules/iot/views/device.vue", + "keepAlive": true, + "isShow": true, + "childMenus": [ + { + "name": "删除", + "router": null, + "perms": "iot:device:delete", + "type": 2, + "icon": null, + "orderNum": 0, + "viewPath": null, + "keepAlive": true, + "isShow": true, + "childMenus": [] + }, + { + "name": "单个信息", + "router": null, + "perms": "iot:device:info", + "type": 2, + "icon": null, + "orderNum": 0, + "viewPath": null, + "keepAlive": true, + "isShow": true, + "childMenus": [] + }, + { + "name": "列表查询", + "router": null, + "perms": "iot:device:list", + "type": 2, + "icon": null, + "orderNum": 0, + "viewPath": null, + "keepAlive": true, + "isShow": true, + "childMenus": [] + }, + { + "name": "分页查询", + "router": null, + "perms": "iot:device:page", + "type": 2, + "icon": null, + "orderNum": 0, + "viewPath": null, + "keepAlive": true, + "isShow": true, + "childMenus": [] + }, + { + "name": "修改", + "router": null, + "perms": "iot:device:info,iot:device:update", + "type": 2, + "icon": null, + "orderNum": 0, + "viewPath": null, + "keepAlive": true, + "isShow": true, + "childMenus": [] + }, + { + "name": "新增", + "router": null, + "perms": "iot:device:add", + "type": 2, + "icon": null, + "orderNum": 0, + "viewPath": null, + "keepAlive": true, + "isShow": true, + "childMenus": [] + } + ] + } + ] + } +] \ No newline at end of file diff --git a/src/modules/recycle/entity/data.ts b/src/modules/recycle/entity/data.ts index e100488..e150f43 100644 --- a/src/modules/recycle/entity/data.ts +++ b/src/modules/recycle/entity/data.ts @@ -16,7 +16,7 @@ export class RecycleDataEntity extends BaseEntity { @Index() @Column({ comment: '操作人', nullable: true }) - userId: string; + userId: number; @Column({ comment: '被删除的数据', type: 'json' }) data: object[]; diff --git a/src/modules/recycle/init.sql b/src/modules/recycle/init.sql deleted file mode 100644 index 6cf45ae..0000000 --- a/src/modules/recycle/init.sql +++ /dev/null @@ -1,3 +0,0 @@ -BEGIN; -INSERT INTO `base_sys_conf` VALUES (2, '2021-02-25 14:23:26.810981', '2021-02-25 14:23:26.810981', 'recycleKeep', '31'); -COMMIT; \ No newline at end of file diff --git a/src/modules/recycle/menu.json b/src/modules/recycle/menu.json new file mode 100644 index 0000000..031d25d --- /dev/null +++ b/src/modules/recycle/menu.json @@ -0,0 +1,64 @@ +[ + { + "name": "数据管理", + "router": null, + "perms": null, + "type": 0, + "icon": "icon-data", + "orderNum": 3, + "viewPath": null, + "keepAlive": true, + "isShow": true, + "childMenus": [ + { + "name": "数据回收站", + "router": "/recycle/data", + "perms": null, + "type": 1, + "icon": "icon-delete", + "orderNum": 1, + "viewPath": "modules/recycle/views/data.vue", + "keepAlive": true, + "isShow": true, + "childMenus": [ + { + "name": "恢复数据", + "router": null, + "perms": "recycle:data:restore", + "type": 2, + "icon": null, + "orderNum": 0, + "viewPath": null, + "keepAlive": true, + "isShow": true, + "childMenus": [] + }, + { + "name": "单个信息", + "router": null, + "perms": "recycle:data:info", + "type": 2, + "icon": null, + "orderNum": 0, + "viewPath": null, + "keepAlive": true, + "isShow": true, + "childMenus": [] + }, + { + "name": "分页查询", + "router": null, + "perms": "recycle:data:page", + "type": 2, + "icon": null, + "orderNum": 0, + "viewPath": null, + "keepAlive": true, + "isShow": true, + "childMenus": [] + } + ] + } + ] + } +] \ No newline at end of file diff --git a/src/modules/recycle/service/data.ts b/src/modules/recycle/service/data.ts index 2484246..a5ce7b0 100644 --- a/src/modules/recycle/service/data.ts +++ b/src/modules/recycle/service/data.ts @@ -78,9 +78,9 @@ export class RecycleDataService extends BaseService { .add(-keepDay, 'days') .format('YYYY-MM-DD')} 00:00:00`; await this.recycleDataEntity - .createQueryBuilder() + .createQueryBuilder('a') .delete() - .where('createTime < :createTime', { createTime: beforeDate }) + .where('a.createTime < :createTime', { createTime: beforeDate }) .execute(); } else { await this.recycleDataEntity.clear(); diff --git a/src/modules/space/entity/info.ts b/src/modules/space/entity/info.ts index a8d80b8..3c2d4fc 100644 --- a/src/modules/space/entity/info.ts +++ b/src/modules/space/entity/info.ts @@ -12,7 +12,7 @@ export class SpaceInfoEntity extends BaseEntity { @Column({ comment: '类型' }) type: string; - @Column({ comment: '分类ID', type: 'bigint', nullable: true }) + @Column({ comment: '分类ID', nullable: true }) classifyId: number; @Index() diff --git a/src/modules/space/entity/type.ts b/src/modules/space/entity/type.ts index b554954..15c4308 100644 --- a/src/modules/space/entity/type.ts +++ b/src/modules/space/entity/type.ts @@ -9,6 +9,6 @@ export class SpaceTypeEntity extends BaseEntity { @Column({ comment: '类别名称' }) name: string; - @Column({ comment: '父分类ID', type: 'tinyint', nullable: true }) + @Column({ comment: '父分类ID', nullable: true }) parentId: number; } diff --git a/src/modules/space/menu.json b/src/modules/space/menu.json new file mode 100644 index 0000000..73e2e7f --- /dev/null +++ b/src/modules/space/menu.json @@ -0,0 +1,14 @@ +[ + { + "name": "文件管理", + "router": "/upload/list", + "perms": null, + "type": 1, + "icon": "icon-log", + "orderNum": 97, + "viewPath": "modules/upload/views/list.vue", + "keepAlive": true, + "isShow": true, + "childMenus": [] + } +] \ No newline at end of file diff --git a/src/modules/task/db.json b/src/modules/task/db.json new file mode 100644 index 0000000..681ecbc --- /dev/null +++ b/src/modules/task/db.json @@ -0,0 +1,40 @@ +{ + "task_info": [ + { + "id": 1, + "jobId": null, + "repeatConf": "{\"count\":1,\"type\":1,\"limit\":5,\"name\":\"每秒执行,总共5次\",\"taskType\":1,\"every\":1000,\"service\":\"taskDemoService.test()\",\"status\":1,\"id\":1,\"createTime\":\"2021-03-10 14:25:13\",\"updateTime\":\"2021-03-10 14:25:13\",\"jobId\":1}", + "name": "每秒执行,总共5次", + "cron": null, + "limit": 5, + "every": 1000, + "remark": null, + "status": 0, + "startDate": null, + "endDate": null, + "data": null, + "service": "taskDemoService.test()", + "type": 1, + "nextRunTime": "2021-3-10 14:25:18", + "taskType": 1 + }, + { + "id": 2, + "jobId": null, + "repeatConf": "{\"count\":1,\"id\":2,\"createTime\":\"2021-03-10 14:25:53\",\"updateTime\":\"2021-03-10 14:25:55\",\"name\":\"cron任务,5秒执行一次\",\"cron\":\"0/5 * * * * ? \",\"status\":1,\"service\":\"taskDemoService.test()\",\"type\":1,\"nextRunTime\":\"2021-03-10 14:26:00\",\"taskType\":0,\"jobId\":2}", + "name": "cron任务,5秒执行一次", + "cron": "0/5 * * * * ? ", + "limit": null, + "every": null, + "remark": null, + "status": 0, + "startDate": null, + "endDate": null, + "data": null, + "service": "taskDemoService.test()", + "type": 1, + "nextRunTime": null, + "taskType": 0 + } + ] +} \ No newline at end of file diff --git a/src/modules/task/entity/info.ts b/src/modules/task/entity/info.ts index e7ddcd8..0393e24 100644 --- a/src/modules/task/entity/info.ts +++ b/src/modules/task/entity/info.ts @@ -30,7 +30,7 @@ export class TaskInfoEntity extends BaseEntity { @Column({ comment: '备注', nullable: true }) remark: string; - @Column({ comment: '状态 0:停止 1:运行', default: 1, type: 'tinyint' }) + @Column({ comment: '状态 0-停止 1-运行', default: 1 }) status: number; @Column({ comment: '开始时间', nullable: true }) @@ -45,12 +45,12 @@ export class TaskInfoEntity extends BaseEntity { @Column({ comment: '执行的service实例ID', nullable: true }) service: string; - @Column({ comment: '状态 0:系统 1:用户', default: 0, type: 'tinyint' }) + @Column({ comment: '状态 0-系统 1-用户', default: 0 }) type: number; @Column({ comment: '下一次执行时间', nullable: true }) nextRunTime: Date; - @Column({ comment: '状态 0:cron 1:时间间隔', default: 0, type: 'tinyint' }) + @Column({ comment: '状态 0-cron 1-时间间隔', default: 0 }) taskType: number; } diff --git a/src/modules/task/entity/log.ts b/src/modules/task/entity/log.ts index 1d0caf5..2f9030a 100644 --- a/src/modules/task/entity/log.ts +++ b/src/modules/task/entity/log.ts @@ -7,10 +7,10 @@ import { Column, Index, Entity } from 'typeorm'; @Entity('task_log') export class TaskLogEntity extends BaseEntity { @Index() - @Column({ comment: '任务ID', nullable: true, type: 'bigint' }) + @Column({ comment: '任务ID', nullable: true }) taskId: number; - @Column({ comment: '状态 0-失败 1-成功', default: 0, type: 'tinyint' }) + @Column({ comment: '状态 0-失败 1-成功', default: 0 }) status: number; @Column({ comment: '详情描述', nullable: true, type: 'text' }) diff --git a/src/modules/task/init.sql b/src/modules/task/init.sql deleted file mode 100644 index 4417665..0000000 --- a/src/modules/task/init.sql +++ /dev/null @@ -1,17 +0,0 @@ -BEGIN; -INSERT INTO `task_info` VALUES (1, '2021-03-10 14:25:13.381172', '2021-03-10 14:25:19.011000', NULL, '{\"count\":1,\"type\":1,\"limit\":5,\"name\":\"每秒执行,总共5次\",\"taskType\":1,\"every\":1000,\"service\":\"taskDemoService.test()\",\"status\":1,\"id\":1,\"createTime\":\"2021-03-10 14:25:13\",\"updateTime\":\"2021-03-10 14:25:13\",\"jobId\":1}', '每秒执行,总共5次', NULL, 5, 1000, NULL, 0, NULL, NULL, NULL, 'taskDemoService.test()', 1, '2021-03-10 14:25:18', 1); -INSERT INTO `task_info` VALUES (2, '2021-03-10 14:25:53.000000', '2021-03-10 14:26:18.209202', NULL, '{\"count\":1,\"id\":2,\"createTime\":\"2021-03-10 14:25:53\",\"updateTime\":\"2021-03-10 14:25:55\",\"name\":\"cron任务,5秒执行一次\",\"cron\":\"0/5 * * * * ? \",\"status\":1,\"service\":\"taskDemoService.test()\",\"type\":1,\"nextRunTime\":\"2021-03-10 14:26:00\",\"taskType\":0,\"jobId\":2}', 'cron任务,5秒执行一次', '0/5 * * * * ? ', NULL, NULL, NULL, 0, NULL, NULL, NULL, 'taskDemoService.test()', 1, NULL, 0); -COMMIT; - -BEGIN; -INSERT INTO `task_log` VALUES (1, '2021-03-10 14:25:14.020930', '2021-03-10 14:25:14.020930', 1, 1, '\"任务执行成功\"'); -INSERT INTO `task_log` VALUES (2, '2021-03-10 14:25:15.012030', '2021-03-10 14:25:15.012030', 1, 1, '\"任务执行成功\"'); -INSERT INTO `task_log` VALUES (3, '2021-03-10 14:25:16.011443', '2021-03-10 14:25:16.011443', 1, 1, '\"任务执行成功\"'); -INSERT INTO `task_log` VALUES (4, '2021-03-10 14:25:17.009939', '2021-03-10 14:25:17.009939', 1, 1, '\"任务执行成功\"'); -INSERT INTO `task_log` VALUES (5, '2021-03-10 14:25:18.010410', '2021-03-10 14:25:18.010410', 1, 1, '\"任务执行成功\"'); -INSERT INTO `task_log` VALUES (6, '2021-03-10 14:25:55.012816', '2021-03-10 14:25:55.012816', 2, 1, ''); -INSERT INTO `task_log` VALUES (7, '2021-03-10 14:26:00.011880', '2021-03-10 14:26:00.011880', 2, 1, ''); -INSERT INTO `task_log` VALUES (8, '2021-03-10 14:26:05.016832', '2021-03-10 14:26:05.016832', 2, 1, '\"任务执行成功\"'); -INSERT INTO `task_log` VALUES (9, '2021-03-10 14:26:10.011763', '2021-03-10 14:26:10.011763', 2, 1, '\"任务执行成功\"'); -INSERT INTO `task_log` VALUES (10, '2021-03-10 14:26:15.010246', '2021-03-10 14:26:15.010246', 2, 1, '\"任务执行成功\"'); -COMMIT; \ No newline at end of file diff --git a/src/modules/task/menu.json b/src/modules/task/menu.json new file mode 100644 index 0000000..8de8962 --- /dev/null +++ b/src/modules/task/menu.json @@ -0,0 +1,40 @@ +[ + { + "name": "任务管理", + "router": null, + "perms": null, + "type": 0, + "icon": "icon-activity", + "orderNum": 97, + "viewPath": null, + "keepAlive": true, + "isShow": true, + "childMenus": [ + { + "name": "任务列表", + "router": "/task/list", + "perms": null, + "type": 1, + "icon": "icon-menu", + "orderNum": 0, + "viewPath": "modules/task/views/list.vue", + "keepAlive": true, + "isShow": true, + "childMenus": [ + { + "name": "权限", + "router": null, + "perms": "task:info:page,task:info:list,task:info:info,task:info:add,task:info:delete,task:info:update,task:info:stop,task:info:start,task:info:once,task:info:log", + "type": 2, + "icon": null, + "orderNum": 0, + "viewPath": null, + "keepAlive": true, + "isShow": true, + "childMenus": [] + } + ] + } + ] + } +] \ No newline at end of file diff --git a/src/modules/task/service/info.ts b/src/modules/task/service/info.ts index 3f1cd00..3d46ba2 100644 --- a/src/modules/task/service/info.ts +++ b/src/modules/task/service/info.ts @@ -205,7 +205,7 @@ export class TaskInfoService extends BaseService { ` SELECT a.*, - b.NAME AS taskName + b.name AS taskName FROM task_log a JOIN task_info b ON a.taskId = b.id @@ -281,10 +281,9 @@ export class TaskInfoService extends BaseService { * @param jobId */ async updateNextRunTime(jobId) { - await this.nativeQuery( - 'update task_info a set a.nextRunTime = ? where a.id = ?', - [await this.getNextRunTime(jobId), jobId] - ); + await this.taskInfoEntity.update(jobId, { + nextRunTime: await this.getNextRunTime(jobId), + }); } /** diff --git a/src/modules/user/menu.json b/src/modules/user/menu.json new file mode 100644 index 0000000..4031c91 --- /dev/null +++ b/src/modules/user/menu.json @@ -0,0 +1,100 @@ +[ + { + "name": "用户管理", + "router": null, + "perms": null, + "type": 0, + "icon": "icon-user", + "orderNum": 8, + "viewPath": null, + "keepAlive": true, + "isShow": true, + "childMenus": [ + { + "name": "用户列表", + "router": "/user/list", + "perms": null, + "type": 1, + "icon": "icon-menu", + "orderNum": 1, + "viewPath": "modules/user/views/list.vue", + "keepAlive": true, + "isShow": true, + "childMenus": [ + { + "name": "删除", + "router": null, + "perms": "user:info:delete", + "type": 2, + "icon": null, + "orderNum": 0, + "viewPath": null, + "keepAlive": true, + "isShow": true, + "childMenus": [] + }, + { + "name": "修改", + "router": null, + "perms": "user:info:update,user:info:info", + "type": 2, + "icon": null, + "orderNum": 0, + "viewPath": null, + "keepAlive": true, + "isShow": true, + "childMenus": [] + }, + { + "name": "单个信息", + "router": null, + "perms": "user:info:info", + "type": 2, + "icon": null, + "orderNum": 0, + "viewPath": null, + "keepAlive": true, + "isShow": true, + "childMenus": [] + }, + { + "name": "列表查询", + "router": null, + "perms": "user:info:list", + "type": 2, + "icon": null, + "orderNum": 0, + "viewPath": null, + "keepAlive": true, + "isShow": true, + "childMenus": [] + }, + { + "name": "分页查询", + "router": null, + "perms": "user:info:page", + "type": 2, + "icon": null, + "orderNum": 0, + "viewPath": null, + "keepAlive": true, + "isShow": true, + "childMenus": [] + }, + { + "name": "新增", + "router": null, + "perms": "user:info:add", + "type": 2, + "icon": null, + "orderNum": 0, + "viewPath": null, + "keepAlive": true, + "isShow": true, + "childMenus": [] + } + ] + } + ] + } +] \ No newline at end of file