From 3526d39e01b404e9301981cf4d4a40b54a1dc331 Mon Sep 17 00:00:00 2001 From: junjie Date: Thu, 29 Apr 2021 12:12:12 +0800 Subject: [PATCH 1/3] =?UTF-8?q?feat(=E6=95=B0=E6=8D=AE=E9=9B=86):=20?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=9B=86fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/dataset/DataSetTableService.java | 12 +++++-- frontend/src/views/chart/chart/chart.js | 36 +++++++++---------- frontend/src/views/dataset/add/AddExcel.vue | 35 ++++++++---------- frontend/src/views/dataset/add/AddSQL.vue | 24 ++++++++++--- .../src/views/dataset/data/TabDataPreview.vue | 2 +- 5 files changed, 63 insertions(+), 46 deletions(-) diff --git a/backend/src/main/java/io/dataease/service/dataset/DataSetTableService.java b/backend/src/main/java/io/dataease/service/dataset/DataSetTableService.java index 2941638e8e..d3d38f781b 100644 --- a/backend/src/main/java/io/dataease/service/dataset/DataSetTableService.java +++ b/backend/src/main/java/io/dataease/service/dataset/DataSetTableService.java @@ -81,7 +81,15 @@ public class DataSetTableService { saveTableField(datasetTable); } } else { - datasetTableMapper.updateByPrimaryKeySelective(datasetTable); + int update = datasetTableMapper.updateByPrimaryKeySelective(datasetTable); + // sql 更新 + if (update == 1) { + if (StringUtils.equalsIgnoreCase(datasetTable.getType(), "sql")) { + // 删除所有字段,重新抽象 + dataSetTableFieldsService.deleteByTableId(datasetTable.getId()); + saveTableField(datasetTable); + } + } } return datasetTable; } @@ -262,7 +270,7 @@ public class DataSetTableService { DatasourceRequest datasourceRequest = new DatasourceRequest(); datasourceRequest.setDatasource(ds); String sql = new Gson().fromJson(dataSetTableRequest.getInfo(), DataTableInfoDTO.class).getSql(); - datasourceRequest.setQuery(sql); + datasourceRequest.setQuery("SELECT * FROM (" + sql + ") AS tmp LIMIT 0,1000"); Map result = datasourceProvider.fetchResultAndField(datasourceRequest); List data = result.get("dataList"); List fields = result.get("fieldList"); diff --git a/frontend/src/views/chart/chart/chart.js b/frontend/src/views/chart/chart/chart.js index 6571d9ad5f..a9efd53629 100644 --- a/frontend/src/views/chart/chart/chart.js +++ b/frontend/src/views/chart/chart/chart.js @@ -88,9 +88,9 @@ export const BASE_BAR = { title: { text: '' }, - grid: { - containLabel: true - }, + // grid: { + // containLabel: true + // }, tooltip: {}, legend: { show: true, @@ -117,9 +117,9 @@ export const HORIZONTAL_BAR = { title: { text: '' }, - grid: { - containLabel: true - }, + // grid: { + // containLabel: true + // }, tooltip: {}, legend: { show: true, @@ -147,9 +147,9 @@ export const BASE_LINE = { title: { text: '' }, - grid: { - containLabel: true - }, + // grid: { + // containLabel: true + // }, tooltip: {}, legend: { show: true, @@ -178,9 +178,9 @@ export const BASE_PIE = { title: { text: '' }, - grid: { - containLabel: true - }, + // grid: { + // containLabel: true + // }, tooltip: {}, legend: { show: true, @@ -211,9 +211,9 @@ export const BASE_FUNNEL = { title: { text: '' }, - grid: { - containLabel: true - }, + // grid: { + // containLabel: true + // }, tooltip: { trigger: 'item' }, @@ -267,9 +267,9 @@ export const BASE_RADAR = { title: { text: '' }, - grid: { - containLabel: true - }, + // grid: { + // containLabel: true + // }, tooltip: {}, legend: { show: true, diff --git a/frontend/src/views/dataset/add/AddExcel.vue b/frontend/src/views/dataset/add/AddExcel.vue index 92b98aa8c7..50a2d6cfed 100644 --- a/frontend/src/views/dataset/add/AddExcel.vue +++ b/frontend/src/views/dataset/add/AddExcel.vue @@ -19,10 +19,10 @@ - + - + - +
{{ $t('dataset.data_preview') }} @@ -100,27 +100,13 @@ export default { } }, watch: { - // dataSource(val) { - // if (val) { - // post('/datasource/getTables', { id: val }).then(response => { - // this.tables = response.data - // this.tableData = JSON.parse(JSON.stringify(this.tables)) - // }) - // } - // }, - // searchTable(val) { - // if (val && val !== '') { - // this.tableData = JSON.parse(JSON.stringify(this.tables.filter(ele => { return ele.includes(val) }))) - // } else { - // this.tableData = JSON.parse(JSON.stringify(this.tables)) - // } - // } }, mounted() { // this.initDataSource() - }, - activated() { - // this.initDataSource() + window.onresize = () => { + this.calHeight() + } + this.calHeight() }, methods: { // initDataSource() { @@ -128,6 +114,13 @@ export default { // this.options = response.data // }) // }, + calHeight() { + const that = this + setTimeout(function() { + const currentHeight = document.documentElement.clientHeight + that.height = currentHeight - 56 - 30 - 26 - 25 - 35 - 10 - 37 - 20 - 10 + }, 10) + }, uploadSuccess(response, file, fileList) { // console.log(response) // console.log(file) diff --git a/frontend/src/views/dataset/add/AddSQL.vue b/frontend/src/views/dataset/add/AddSQL.vue index 4bb5811761..7d1414211a 100644 --- a/frontend/src/views/dataset/add/AddSQL.vue +++ b/frontend/src/views/dataset/add/AddSQL.vue @@ -76,6 +76,11 @@ />
+ + {{ $t('dataset.preview_show') }} + 1000 + {{ $t('dataset.preview_item') }} +
@@ -155,11 +160,9 @@ export default { }, mounted() { window.onresize = () => { - return (() => { - this.height = window.innerHeight / 2 - })() + this.calHeight() } - this.height = window.innerHeight / 2 + this.calHeight() this.initDataSource() this.$refs.myCm.codemirror.on('keypress', () => { this.$refs.myCm.codemirror.showHint() @@ -168,6 +171,13 @@ export default { this.initTableInfo() }, methods: { + calHeight() { + const that = this + setTimeout(function() { + const currentHeight = document.documentElement.clientHeight + that.height = currentHeight - 56 - 30 - 26 - 25 - 43 - 160 - 10 - 37 - 20 - 10 - 16 + }, 10) + }, initDataSource() { listDatasource().then(response => { this.options = response.data @@ -303,4 +313,10 @@ export default { span{ font-size: 14px; } + .span-number{ + color: #f18126; + } + .table-count{ + color: #606266; + } diff --git a/frontend/src/views/dataset/data/TabDataPreview.vue b/frontend/src/views/dataset/data/TabDataPreview.vue index d9cd02d34e..c07d22316c 100644 --- a/frontend/src/views/dataset/data/TabDataPreview.vue +++ b/frontend/src/views/dataset/data/TabDataPreview.vue @@ -160,7 +160,7 @@ export default { float: right; } span{ - font-size: 14px; + font-size: 12px; } .span-number{ color: #f18126; From 1285ba494ddc6e8a31819758f4f66c539f0092e3 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Thu, 29 Apr 2021 12:46:51 +0800 Subject: [PATCH 2/3] =?UTF-8?q?feat:=20=E7=B3=BB=E7=BB=9F=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E5=BC=B9=E6=A1=86=E6=94=B9=E4=B8=BA=E9=9A=90=E8=97=8F?= =?UTF-8?q?=E8=B7=AF=E7=94=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/sys/SysMenuController.java | 7 + .../controller/sys/response/MenuTreeNode.java | 26 +++ .../io/dataease/service/sys/MenuService.java | 31 +++ frontend/src/api/system/menu.js | 9 +- .../business/complex-table/index.vue | 4 + frontend/src/views/system/dept/form.vue | 173 ++++++++++++++++ frontend/src/views/system/dept/index.vue | 22 ++- frontend/src/views/system/menu/form.vue | 187 ++++++++++++++++++ frontend/src/views/system/menu/index.vue | 22 ++- frontend/src/views/system/role/form.vue | 80 ++++++++ frontend/src/views/system/role/index.vue | 18 +- frontend/src/views/system/user/form.vue | 3 +- 12 files changed, 558 insertions(+), 24 deletions(-) create mode 100644 backend/src/main/java/io/dataease/controller/sys/response/MenuTreeNode.java create mode 100644 frontend/src/views/system/dept/form.vue create mode 100644 frontend/src/views/system/menu/form.vue create mode 100644 frontend/src/views/system/role/form.vue diff --git a/backend/src/main/java/io/dataease/controller/sys/SysMenuController.java b/backend/src/main/java/io/dataease/controller/sys/SysMenuController.java index 19e7026fdf..517c83a130 100644 --- a/backend/src/main/java/io/dataease/controller/sys/SysMenuController.java +++ b/backend/src/main/java/io/dataease/controller/sys/SysMenuController.java @@ -7,6 +7,7 @@ import io.dataease.commons.utils.BeanUtils; import io.dataease.controller.sys.request.MenuCreateRequest; import io.dataease.controller.sys.request.MenuDeleteRequest; import io.dataease.controller.sys.response.MenuNodeResponse; +import io.dataease.controller.sys.response.MenuTreeNode; import io.dataease.service.sys.MenuService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -62,6 +63,12 @@ public class SysMenuController { sets.add(pid); return sets; } + @PostMapping("/nodesByMenuId/{menuId}") + public List nodesByMenuId(@PathVariable("menuId") Long menuId) { + return menuService.searchTree(menuId); + } + + } diff --git a/backend/src/main/java/io/dataease/controller/sys/response/MenuTreeNode.java b/backend/src/main/java/io/dataease/controller/sys/response/MenuTreeNode.java new file mode 100644 index 0000000000..56d708a369 --- /dev/null +++ b/backend/src/main/java/io/dataease/controller/sys/response/MenuTreeNode.java @@ -0,0 +1,26 @@ +package io.dataease.controller.sys.response; + +import com.fasterxml.jackson.annotation.JsonInclude; +import lombok.Data; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +@Data +@JsonInclude(JsonInclude.Include.NON_NULL) +public class MenuTreeNode implements Serializable { + + private Long id; + + private String label; + + private Boolean hasChildren; + + private List children; + + public List toList(){ + List lists = new ArrayList<>(); + lists.add(this); + return lists; + } +} diff --git a/backend/src/main/java/io/dataease/service/sys/MenuService.java b/backend/src/main/java/io/dataease/service/sys/MenuService.java index 8eb3fe2b1d..725fa7b390 100644 --- a/backend/src/main/java/io/dataease/service/sys/MenuService.java +++ b/backend/src/main/java/io/dataease/service/sys/MenuService.java @@ -1,5 +1,6 @@ package io.dataease.service.sys; +import io.dataease.base.domain.SysDept; import io.dataease.base.domain.SysMenu; import io.dataease.base.domain.SysMenuExample; import io.dataease.base.mapper.SysMenuMapper; @@ -7,8 +8,10 @@ import io.dataease.base.mapper.ext.ExtMenuMapper; import io.dataease.commons.utils.BeanUtils; import io.dataease.controller.sys.request.MenuCreateRequest; import io.dataease.controller.sys.request.MenuDeleteRequest; +import io.dataease.controller.sys.response.DeptTreeNode; import io.dataease.controller.sys.response.MenuNodeResponse; +import io.dataease.controller.sys.response.MenuTreeNode; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.ObjectUtils; import org.springframework.stereotype.Service; @@ -16,6 +19,7 @@ import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; import java.util.HashSet; import java.util.List; +import java.util.Optional; import java.util.Set; import java.util.stream.Collectors; @@ -121,6 +125,24 @@ public class MenuService { return responses; } + public List searchTree(Long menuId) { + List roots = nodesByPid(0L); + if (menuId == MENU_ROOT_PID) return roots.stream().map(this::format).collect(Collectors.toList()); + SysMenu sysMenu = sysMenuMapper.selectByPrimaryKey(menuId); + if (roots.stream().anyMatch(node -> node.getMenuId() == menuId)) return roots.stream().map(this::format).collect(Collectors.toList()); + SysMenu current = sysMenu; + MenuTreeNode currentNode = format(sysMenu); + while (current.getPid() != MENU_ROOT_PID){ + SysMenu parent = sysMenuMapper.selectByPrimaryKey(current.getPid()); //pid上有索引 所以效率不会太差 + MenuTreeNode parentNode = format(parent); + parentNode.setChildren(currentNode.toList()); + current = parent; + currentNode = parentNode; + } + MenuTreeNode targetRootNode = currentNode; + return roots.stream().map(node -> node.getMenuId() == targetRootNode.getId() ? targetRootNode : format(node)).collect(Collectors.toList()); + } + private Set getChilds(List lists, Set sets){ lists.forEach(menu -> { sets.add(menu); @@ -132,6 +154,15 @@ public class MenuService { return sets; } + private MenuTreeNode format(SysMenu sysMenu) { + MenuTreeNode menuTreeNode = new MenuTreeNode(); + menuTreeNode.setId(sysMenu.getMenuId()); + menuTreeNode.setLabel(sysMenu.getName()); + menuTreeNode.setHasChildren(false); + Optional.ofNullable(sysMenu.getMenuSort()).ifPresent(num -> menuTreeNode.setHasChildren(num > 0)); + return menuTreeNode; + } + public List convert(List menus){ return menus.stream().map(node -> { MenuNodeResponse menuNodeResponse = BeanUtils.copyBean(new MenuNodeResponse(), node); diff --git a/frontend/src/api/system/menu.js b/frontend/src/api/system/menu.js index a093687647..2aef84616e 100644 --- a/frontend/src/api/system/menu.js +++ b/frontend/src/api/system/menu.js @@ -46,4 +46,11 @@ export function editMenu(data) { }) } -export default { addMenu, editMenu, delMenu, getMenusTree, getChild } +export function treeByMenuId(menuId) { + return request({ + url: '/api/menu/nodesByMenuId/' + menuId, + method: 'post' + }) +} + +export default { addMenu, editMenu, delMenu, getMenusTree, getChild, treeByMenuId } diff --git a/frontend/src/components/business/complex-table/index.vue b/frontend/src/components/business/complex-table/index.vue index 9c625a4edb..684a9430dc 100644 --- a/frontend/src/components/business/complex-table/index.vue +++ b/frontend/src/components/business/complex-table/index.vue @@ -46,9 +46,13 @@ export default { type: Array, default: () => [] }, + // eslint-disable-next-line vue/require-default-prop localKey: String, // 如果需要记住选择的列,则这里添加一个唯一的Key + // eslint-disable-next-line vue/require-default-prop header: String, + // eslint-disable-next-line vue/require-default-prop searchConfig: Object, + // eslint-disable-next-line vue/require-default-prop paginationConfig: Object }, data() { diff --git a/frontend/src/views/system/dept/form.vue b/frontend/src/views/system/dept/form.vue new file mode 100644 index 0000000000..9d767d63ca --- /dev/null +++ b/frontend/src/views/system/dept/form.vue @@ -0,0 +1,173 @@ + + + diff --git a/frontend/src/views/system/dept/index.vue b/frontend/src/views/system/dept/index.vue index 19a3c8b8ce..a2c25378a8 100644 --- a/frontend/src/views/system/dept/index.vue +++ b/frontend/src/views/system/dept/index.vue @@ -203,17 +203,23 @@ export default { this.search() }, methods: { + // create() { + // this.form = Object.assign({}, this.defaultForm) + // this.dialogOrgAddVisible = true + // this.formType = 'add' + // }, + // edit(row) { + // this.dialogOrgAddVisible = true + // this.formType = 'modify' + // this.oldPid = row.pid + // this.form = Object.assign({}, row) + // this.treeByRow(row) + // }, create() { - this.form = Object.assign({}, this.defaultForm) - this.dialogOrgAddVisible = true - this.formType = 'add' + this.$router.push({ name: '组织表单' }) }, edit(row) { - this.dialogOrgAddVisible = true - this.formType = 'modify' - this.oldPid = row.pid - this.form = Object.assign({}, row) - this.treeByRow(row) + this.$router.push({ name: '组织表单', params: row }) }, treeByRow(row) { diff --git a/frontend/src/views/system/menu/form.vue b/frontend/src/views/system/menu/form.vue new file mode 100644 index 0000000000..d84b7529be --- /dev/null +++ b/frontend/src/views/system/menu/form.vue @@ -0,0 +1,187 @@ + + + diff --git a/frontend/src/views/system/menu/index.vue b/frontend/src/views/system/menu/index.vue index 1fb23fc3b1..b17ef69f7e 100644 --- a/frontend/src/views/system/menu/index.vue +++ b/frontend/src/views/system/menu/index.vue @@ -199,21 +199,27 @@ export default { this.initTableData() }, methods: { + // create() { + // this.form = Object.assign({}, this.defaultForm) + // this.dialogVisible = true + // this.formType = 'add' + // }, create() { - this.form = Object.assign({}, this.defaultForm) - this.dialogVisible = true - this.formType = 'add' + this.$router.push({ name: '菜单表单' }) }, search(condition) { console.log(condition) }, + // edit(row) { + // this.dialogVisible = true + // this.formType = 'modify' + // this.oldPid = row.pid + // this.form = Object.assign({}, row) + // this.treeByRow(row) + // }, edit(row) { - this.dialogVisible = true - this.formType = 'modify' - this.oldPid = row.pid - this.form = Object.assign({}, row) - this.treeByRow(row) + this.$router.push({ name: '菜单表单', params: row }) }, treeByRow(row) { diff --git a/frontend/src/views/system/role/form.vue b/frontend/src/views/system/role/form.vue new file mode 100644 index 0000000000..6ecc4551fb --- /dev/null +++ b/frontend/src/views/system/role/form.vue @@ -0,0 +1,80 @@ + + + diff --git a/frontend/src/views/system/role/index.vue b/frontend/src/views/system/role/index.vue index a80a4a55a5..93e2c40ca7 100644 --- a/frontend/src/views/system/role/index.vue +++ b/frontend/src/views/system/role/index.vue @@ -152,10 +152,13 @@ export default { handleClick(tab, event) { console.log(tab, event) }, + // create() { + // this.form = {} + // this.formType = 'add' + // this.dialogVisible = true + // }, create() { - this.form = {} - this.formType = 'add' - this.dialogVisible = true + this.$router.push({ name: '角色表单' }) }, search(condition) { const temp = formatCondition(condition) @@ -167,10 +170,13 @@ export default { }) }, + // edit(row) { + // this.formType = 'modify' + // this.dialogVisible = true + // this.form = Object.assign({}, row) + // }, edit(row) { - this.formType = 'modify' - this.dialogVisible = true - this.form = Object.assign({}, row) + this.$router.push({ name: '角色表单', params: row }) }, saveRole(roleForm) { diff --git a/frontend/src/views/system/user/form.vue b/frontend/src/views/system/user/form.vue index 520684236f..39c7fd9696 100644 --- a/frontend/src/views/system/user/form.vue +++ b/frontend/src/views/system/user/form.vue @@ -31,7 +31,7 @@ v-model="form.deptId" :options="depts" :load-options="loadDepts" - + :auto-load-root-options="false" placeholder="选择部门" /> @@ -182,6 +182,7 @@ export default { const results = res.data.map(node => { if (node.hasChildren && !node.children) { node.children = null + // delete node.children } return node }) From f35c4477a5ee358c1ff65e42dedb561a84a5f08c Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Thu, 29 Apr 2021 14:02:29 +0800 Subject: [PATCH 3/3] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=E9=9A=90?= =?UTF-8?q?=E8=97=8F=E8=B7=AF=E7=94=B1=E8=8F=9C=E5=8D=95=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/db/migration/V8__system.sql | 244 +++++++++++------- 1 file changed, 148 insertions(+), 96 deletions(-) diff --git a/backend/src/main/resources/db/migration/V8__system.sql b/backend/src/main/resources/db/migration/V8__system.sql index ecfb3a62e4..b47ade1e48 100644 --- a/backend/src/main/resources/db/migration/V8__system.sql +++ b/backend/src/main/resources/db/migration/V8__system.sql @@ -1,5 +1,7 @@ -DROP TABLE IF EXISTS `sys_dept` ; - +-- ---------------------------- +-- Table structure for sys_dept +-- ---------------------------- +DROP TABLE IF EXISTS `sys_dept`; CREATE TABLE `sys_dept` ( `dept_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID', `pid` bigint(20) DEFAULT NULL COMMENT '上级部门', @@ -16,16 +18,25 @@ CREATE TABLE `sys_dept` ( KEY `inx_enabled` (`enabled`) ) ENGINE=InnoDB AUTO_INCREMENT=26 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='部门'; -INSERT INTO `sys_dept` (`dept_id`, `pid`, `sub_count`, `name`, `dept_sort`, `enabled`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES ('18','0','1','上海飞致云','1',b'1',null,null,'1614048906358','1614048906358'); -INSERT INTO `sys_dept` (`dept_id`, `pid`, `sub_count`, `name`, `dept_sort`, `enabled`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES ('19','0','1','北京飞致云','2',b'1',null,null,'1614048918465','1614048918465'); -INSERT INTO `sys_dept` (`dept_id`, `pid`, `sub_count`, `name`, `dept_sort`, `enabled`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES ('20','18','1','营销部','1',b'1',null,null,'1614048946370','1614049006759'); -INSERT INTO `sys_dept` (`dept_id`, `pid`, `sub_count`, `name`, `dept_sort`, `enabled`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES ('21','19','0','综合部','3',b'1',null,null,'1614048963483','1615783363091'); -INSERT INTO `sys_dept` (`dept_id`, `pid`, `sub_count`, `name`, `dept_sort`, `enabled`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES ('25','20','0','售前组','1',b'1',null,null,'1615791706945','1615791706945'); +-- ---------------------------- +-- Records of sys_dept +-- ---------------------------- +BEGIN; +INSERT INTO `sys_dept` VALUES (18, 0, 1, '上海飞致云', 1, b'1', NULL, NULL, 1614048906358, 1614048906358); +INSERT INTO `sys_dept` VALUES (19, 0, 1, '北京飞致云', 2, b'1', NULL, NULL, 1614048918465, 1614048918465); +INSERT INTO `sys_dept` VALUES (20, 18, 1, '营销部', 1, b'1', NULL, NULL, 1614048946370, 1614049006759); +INSERT INTO `sys_dept` VALUES (21, 19, 0, '综合部', 3, b'1', NULL, NULL, 1614048963483, 1619667528267); +INSERT INTO `sys_dept` VALUES (25, 20, 0, '售前组', 1, b'1', NULL, NULL, 1615791706945, 1615791706945); +COMMIT; + +SET FOREIGN_KEY_CHECKS = 1; -DROP TABLE IF EXISTS `sys_menu` ; - +-- ---------------------------- +-- Table structure for sys_menu +-- ---------------------------- +DROP TABLE IF EXISTS `sys_menu`; CREATE TABLE `sys_menu` ( `menu_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID', `pid` bigint(20) DEFAULT NULL COMMENT '上级菜单ID', @@ -49,44 +60,55 @@ CREATE TABLE `sys_menu` ( UNIQUE KEY `uniq_title` (`title`), UNIQUE KEY `uniq_name` (`name`), KEY `inx_pid` (`pid`) -) ENGINE=InnoDB AUTO_INCREMENT=35 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='系统菜单'; +) ENGINE=InnoDB AUTO_INCREMENT=39 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='系统菜单'; -INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES ('1','0','3','0','系统管理','系统管理','Layout','5','system','/system',null,b'0',b'0','dir:sys',null,null,null,'1614916695777'); -INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES ('2','1','4','1','用户管理','用户管理','system/user/index','2','peoples','user',null,b'0',b'0','user:read',null,null,null,'1615786052463'); -INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES ('3','1','3','1','菜单管理','菜单管理','system/menu/index','2','menu','menu',null,b'0',b'0','menu:read',null,null,null,null); -INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES ('4','1','3','1','组织管理','组织管理','system/dept/index','3','dept','dept',null,b'0',b'0','dept:read',null,null,null,null); -INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES ('5','1','3','1','角色管理','角色管理','system/role/index','4','role','role',b'0',b'0',b'0','role:read',null,null,'1614683852133','1614683852133'); -INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES ('6','1','0','1','参数管理','参数管理','system/systemParamSettings/index','13','sys-tools','systemParamSettings',null,b'0',b'0','sysparam:read',null,null,null,'1615790294169'); -INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES ('7','0','1','0','数据集','数据管理','Layout','3','dataset','/dataset',null,b'0',b'0','dir:data',null,null,null,'1619081474697'); -INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES ('8','7','0','1','数据管理1','数据管理1','dataset/index','1','dataset','index',null,b'0',b'0','data:read',null,null,null,'1614916684821'); -INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES ('9','0','1','0','视图','视图管理','Layout','2','chart','/chart',null,b'0',b'0','dir:chart',null,null,null,'1619081462127'); -INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES ('10','9','0','1','视图1','视图1','chart/index','1','chart','index',null,b'0',b'0','chart:read',null,null,null,'1614915491036'); -INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES ('12','3','0','2','创建菜单',null,null,'999',null,null,b'0',b'0',b'0','menu:add',null,null,'1614924617327','1614924617327'); -INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES ('13','3','0','2','删除菜单',null,null,'999',null,null,b'0',b'0',b'0','menu:del',null,null,'1614924667808','1614924667808'); -INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES ('14','3','0','2','编辑菜单',null,null,'999',null,null,b'0',b'0',b'0','menu:edit',null,null,'1614930734224','1614936429773'); -INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES ('15','2','0','2','创建用户',null,null,'999',null,null,b'0',b'0',b'0','user:add',null,null,'1614930862373','1614930862373'); -INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES ('16','2','0','2','删除用户',null,null,'999',null,null,b'0',b'0',b'0','user:del',null,null,'1614930903502','1614930903502'); -INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES ('17','2','0','2','编辑用户',null,null,'999',null,null,b'0',b'0',b'0','user:edit',null,null,'1614930935529','1614930935529'); -INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES ('18','4','0','2','创建组织',null,null,'999',null,null,b'0',b'0',b'0','dept:add',null,null,'1614930976297','1614930976297'); -INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES ('19','4','0','2','删除组织',null,null,'999',null,null,b'0',b'0',b'0','dept:del',null,null,'1614930997130','1614930997130'); -INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES ('20','4','0','2','编辑组织',null,null,'999',null,null,b'0',b'0',b'0','dept:edit',null,null,'1614931022967','1614931022967'); -INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES ('21','5','0','2','创建角色',null,null,'999',null,null,b'0',b'0',b'0','role:add',null,null,'1614931069408','1614931069408'); -INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES ('22','5','0','2','删除角色',null,null,'999',null,null,b'0',b'0',b'0','role:del',null,null,'1614931097720','1614931097720'); -INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES ('23','5','0','2','编辑角色',null,null,'999',null,null,b'0',b'0',b'0','role:edit',null,null,'1614931124782','1614931124782'); -INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES ('24','34','0','2','创建连接',null,null,'997',null,null,b'0',b'0',b'0','datasource:add',null,null,'1614931168956','1615783705537'); -INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES ('25','34','0','2','删除连接',null,null,'999',null,null,b'0',b'0',b'0','datasource:del',null,null,'1614931205899','1614931205899'); -INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES ('26','34','0','2','编辑连接',null,null,'999',null,null,b'0',b'0',b'0','datasource:edit',null,null,'1614931234105','1614931234105'); -INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES ('27','34','0','2','校验连接',null,null,'999',null,null,b'0',b'0',b'0','datasource:validate',null,null,'1614931268578','1614931268578'); -INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES ('28','2','0','2','修改密码',null,null,'999',null,null,b'0',b'0',b'0','user:editPwd',null,null,'1615275128262','1615275128262'); -INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES ('29','0','1','0','仪表盘','仪表盘管理','Layout','1',null,'/panel',null,b'0',b'0','panel:read',null,null,null,'1619081454146'); -INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES ('30','29','0','1','仪表盘1','仪表盘','panel/index','1',null,'index',b'0',b'0',b'0','panel:read',null,null,null,'1619081449067'); -INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES ('33','0','1','0','数据源','数据源','Layout','4',null,'/datasource',b'0',b'0',b'0','dir:datasource',null,null,'1619083205537','1619083205537'); -INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES ('34','33','4','1','数据源1','数据源1','system/datasource/index','1',null,'index',b'0',b'0',b'0','datasource:read',null,null,null,null); +-- ---------------------------- +-- Records of sys_menu +-- ---------------------------- +BEGIN; +INSERT INTO `sys_menu` VALUES (1, 0, 3, 0, '系统管理', '系统管理', 'Layout', 5, 'system', '/system', NULL, b'0', b'0', 'dir:sys', NULL, NULL, NULL, 1614916695777); +INSERT INTO `sys_menu` VALUES (2, 1, 4, 1, '用户管理', '用户管理', 'system/user/index', 2, 'peoples', 'user', NULL, b'0', b'0', 'user:read', NULL, NULL, NULL, 1615786052463); +INSERT INTO `sys_menu` VALUES (3, 1, 3, 1, '菜单管理', '菜单管理', 'system/menu/index', 2, 'menu', 'menu', NULL, b'0', b'0', 'menu:read', NULL, NULL, NULL, NULL); +INSERT INTO `sys_menu` VALUES (4, 1, 3, 1, '组织管理', '组织管理', 'system/dept/index', 3, 'dept', 'dept', NULL, b'0', b'0', 'dept:read', NULL, NULL, NULL, NULL); +INSERT INTO `sys_menu` VALUES (5, 1, 3, 1, '角色管理', '角色管理', 'system/role/index', 4, 'role', 'role', b'0', b'0', b'0', 'role:read', NULL, NULL, 1614683852133, 1614683852133); +INSERT INTO `sys_menu` VALUES (6, 1, 0, 1, '参数管理', '参数管理', 'system/systemParamSettings/index', 13, 'sys-tools', 'systemParamSettings', NULL, b'0', b'0', 'sysparam:read', NULL, NULL, NULL, 1615790294169); +INSERT INTO `sys_menu` VALUES (7, 0, 1, 0, '数据集', '数据管理', 'Layout', 3, 'dataset', '/dataset', NULL, b'0', b'0', 'dir:data', NULL, NULL, NULL, 1619081474697); +INSERT INTO `sys_menu` VALUES (8, 7, 0, 1, '数据管理1', '数据管理1', 'dataset/index', 1, 'dataset', 'index', NULL, b'0', b'0', 'data:read', NULL, NULL, NULL, 1614916684821); +INSERT INTO `sys_menu` VALUES (9, 0, 1, 0, '视图', '视图管理', 'Layout', 2, 'chart', '/chart', NULL, b'0', b'0', 'dir:chart', NULL, NULL, NULL, 1619081462127); +INSERT INTO `sys_menu` VALUES (10, 9, 0, 1, '视图1', '视图1', 'chart/index', 1, 'chart', 'index', NULL, b'0', b'0', 'chart:read', NULL, NULL, NULL, 1614915491036); +INSERT INTO `sys_menu` VALUES (12, 3, 0, 2, '创建菜单', NULL, NULL, 999, NULL, NULL, b'0', b'0', b'0', 'menu:add', NULL, NULL, 1614924617327, 1614924617327); +INSERT INTO `sys_menu` VALUES (13, 3, 0, 2, '删除菜单', NULL, NULL, 999, NULL, NULL, b'0', b'0', b'0', 'menu:del', NULL, NULL, 1614924667808, 1614924667808); +INSERT INTO `sys_menu` VALUES (14, 3, 0, 2, '编辑菜单', NULL, NULL, 999, NULL, NULL, b'0', b'0', b'0', 'menu:edit', NULL, NULL, 1614930734224, 1614936429773); +INSERT INTO `sys_menu` VALUES (15, 2, 0, 2, '创建用户', NULL, NULL, 999, NULL, NULL, b'0', b'0', b'0', 'user:add', NULL, NULL, 1614930862373, 1614930862373); +INSERT INTO `sys_menu` VALUES (16, 2, 0, 2, '删除用户', NULL, NULL, 999, NULL, NULL, b'0', b'0', b'0', 'user:del', NULL, NULL, 1614930903502, 1614930903502); +INSERT INTO `sys_menu` VALUES (17, 2, 0, 2, '编辑用户', NULL, NULL, 999, NULL, NULL, b'0', b'0', b'0', 'user:edit', NULL, NULL, 1614930935529, 1614930935529); +INSERT INTO `sys_menu` VALUES (18, 4, 0, 2, '创建组织', NULL, NULL, 999, NULL, NULL, b'0', b'0', b'0', 'dept:add', NULL, NULL, 1614930976297, 1614930976297); +INSERT INTO `sys_menu` VALUES (19, 4, 0, 2, '删除组织', NULL, NULL, 999, NULL, NULL, b'0', b'0', b'0', 'dept:del', NULL, NULL, 1614930997130, 1614930997130); +INSERT INTO `sys_menu` VALUES (20, 4, 0, 2, '编辑组织', NULL, NULL, 999, NULL, NULL, b'0', b'0', b'0', 'dept:edit', NULL, NULL, 1614931022967, 1614931022967); +INSERT INTO `sys_menu` VALUES (21, 5, 0, 2, '创建角色', NULL, NULL, 999, NULL, NULL, b'0', b'0', b'0', 'role:add', NULL, NULL, 1614931069408, 1614931069408); +INSERT INTO `sys_menu` VALUES (22, 5, 0, 2, '删除角色', NULL, NULL, 999, NULL, NULL, b'0', b'0', b'0', 'role:del', NULL, NULL, 1614931097720, 1614931097720); +INSERT INTO `sys_menu` VALUES (23, 5, 0, 2, '编辑角色', NULL, NULL, 999, NULL, NULL, b'0', b'0', b'0', 'role:edit', NULL, NULL, 1614931124782, 1614931124782); +INSERT INTO `sys_menu` VALUES (24, 34, 0, 2, '创建连接', NULL, NULL, 997, NULL, NULL, b'0', b'0', b'0', 'datasource:add', NULL, NULL, 1614931168956, 1615783705537); +INSERT INTO `sys_menu` VALUES (25, 34, 0, 2, '删除连接', NULL, NULL, 999, NULL, NULL, b'0', b'0', b'0', 'datasource:del', NULL, NULL, 1614931205899, 1614931205899); +INSERT INTO `sys_menu` VALUES (26, 34, 0, 2, '编辑连接', NULL, NULL, 999, NULL, NULL, b'0', b'0', b'0', 'datasource:edit', NULL, NULL, 1614931234105, 1614931234105); +INSERT INTO `sys_menu` VALUES (27, 34, 0, 2, '校验连接', NULL, NULL, 999, NULL, NULL, b'0', b'0', b'0', 'datasource:validate', NULL, NULL, 1614931268578, 1614931268578); +INSERT INTO `sys_menu` VALUES (28, 2, 0, 2, '修改密码', NULL, NULL, 999, NULL, NULL, b'0', b'0', b'0', 'user:editPwd', NULL, NULL, 1615275128262, 1615275128262); +INSERT INTO `sys_menu` VALUES (29, 0, 1, 0, '仪表盘', '仪表盘管理', 'Layout', 1, NULL, '/panel', NULL, b'0', b'0', 'panel:read', NULL, NULL, NULL, 1619081454146); +INSERT INTO `sys_menu` VALUES (30, 29, 0, 1, '仪表盘1', '仪表盘', 'panel/index', 1, NULL, 'index', b'0', b'0', b'0', 'panel:read', NULL, NULL, NULL, 1619081449067); +INSERT INTO `sys_menu` VALUES (33, 0, 1, 0, '数据源', '数据源', 'Layout', 4, NULL, '/datasource', b'0', b'0', b'0', 'dir:datasource', NULL, NULL, 1619083205537, 1619083205537); +INSERT INTO `sys_menu` VALUES (34, 33, 4, 1, '数据源1', '数据源1', 'system/datasource/index', 1, NULL, 'index', b'0', b'0', b'0', 'datasource:read', NULL, NULL, NULL, NULL); +INSERT INTO `sys_menu` VALUES (35, 1, 0, 1, '用户表单', '用户表单', 'system/user/form', 10, 'peoples', 'user-form', b'0', b'0', b'1', NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sys_menu` VALUES (36, 1, 0, 1, '菜单表单', '菜单表单', 'system/menu/form', 11, 'menu', 'menu-form', b'0', b'0', b'1', NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sys_menu` VALUES (37, 1, 0, 1, '组织表单', '组织表单', 'system/dept/form', 12, 'dept', 'dept-form', b'0', b'0', b'1', NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sys_menu` VALUES (38, 1, 0, 1, '角色表单', '角色表单', 'system/role/form', 13, 'role', 'role-form', b'0', b'0', b'1', NULL, NULL, NULL, NULL, NULL); +COMMIT; +SET FOREIGN_KEY_CHECKS = 1; - -DROP TABLE IF EXISTS `sys_user` ; - +-- ---------------------------- +-- Table structure for sys_user +-- ---------------------------- +DROP TABLE IF EXISTS `sys_user`; CREATE TABLE `sys_user` ( `user_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID', `dept_id` bigint(20) DEFAULT NULL COMMENT '部门名称', @@ -110,15 +132,23 @@ CREATE TABLE `sys_user` ( UNIQUE KEY `uniq_email` (`email`), KEY `FK5rwmryny6jthaaxkogownknqp` (`dept_id`) USING BTREE, KEY `inx_enabled` (`enabled`) -) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='系统用户'; +) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='系统用户'; -INSERT INTO `sys_user` (`user_id`, `dept_id`, `username`, `nick_name`, `gender`, `phone`, `email`, `password`, `is_admin`, `enabled`, `create_by`, `update_by`, `pwd_reset_time`, `create_time`, `update_time`) VALUES ('4','0','admin','管理员','男',null,'admin@fit2cloud.com','e10adc3949ba59abbe56e057f20f883e',b'1','1',null,null,null,null,'1615184951534'); -INSERT INTO `sys_user` (`user_id`, `dept_id`, `username`, `nick_name`, `gender`, `phone`, `email`, `password`, `is_admin`, `enabled`, `create_by`, `update_by`, `pwd_reset_time`, `create_time`, `update_time`) VALUES ('19','25','demo','demo','男',null,'demo@fit2cloud.com','e10adc3949ba59abbe56e057f20f883e',b'0','1',null,null,null,'1619086036234','1619086036234'); +-- ---------------------------- +-- Records of sys_user +-- ---------------------------- +BEGIN; +INSERT INTO `sys_user` VALUES (4, 0, 'admin', '管理员', '男', NULL, 'admin@fit2cloud.com', 'e10adc3949ba59abbe56e057f20f883e', b'1', 1, NULL, NULL, NULL, NULL, 1615184951534); +INSERT INTO `sys_user` VALUES (19, 25, 'demo', 'demo', '男', NULL, 'demo@fit2cloud.com', 'e10adc3949ba59abbe56e057f20f883e', b'0', 0, NULL, NULL, NULL, 1619086036234, 1619086036234); +COMMIT; + +SET FOREIGN_KEY_CHECKS = 1; - -DROP TABLE IF EXISTS `sys_role` ; - +-- ---------------------------- +-- Table structure for sys_role +-- ---------------------------- +DROP TABLE IF EXISTS `sys_role`; CREATE TABLE `sys_role` ( `role_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID', `code` varchar(100) NOT NULL COMMENT '代码', @@ -131,15 +161,23 @@ CREATE TABLE `sys_role` ( PRIMARY KEY (`role_id`) USING BTREE, UNIQUE KEY `uniq_name` (`name`), KEY `role_name_index` (`name`) -) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='角色表'; +) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='角色表'; -INSERT INTO `sys_role` (`role_id`, `code`, `name`, `description`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES ('3','admin','管理员',null,null,null,null,null); -INSERT INTO `sys_role` (`role_id`, `code`, `name`, `description`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES ('4','emp','普通员工',null,null,null,null,null); +-- ---------------------------- +-- Records of sys_role +-- ---------------------------- +BEGIN; +INSERT INTO `sys_role` VALUES (3, 'admin', '管理员', NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sys_role` VALUES (4, 'emp', '普通员工', NULL, NULL, NULL, NULL, NULL); +COMMIT; + +SET FOREIGN_KEY_CHECKS = 1; - -DROP TABLE IF EXISTS `sys_roles_menus` ; - +-- ---------------------------- +-- Table structure for sys_roles_menus +-- ---------------------------- +DROP TABLE IF EXISTS `sys_roles_menus`; CREATE TABLE `sys_roles_menus` ( `menu_id` bigint(20) NOT NULL COMMENT '菜单ID', `role_id` bigint(20) NOT NULL COMMENT '角色ID', @@ -147,46 +185,54 @@ CREATE TABLE `sys_roles_menus` ( KEY `FKcngg2qadojhi3a651a5adkvbq` (`role_id`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='角色菜单关联'; -INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES ('1','3'); -INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES ('2','3'); -INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES ('3','3'); -INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES ('4','3'); -INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES ('5','3'); -INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES ('6','3'); -INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES ('7','3'); -INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES ('8','3'); -INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES ('9','3'); -INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES ('10','3'); -INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES ('11','3'); -INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES ('14','3'); -INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES ('15','3'); -INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES ('16','3'); -INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES ('17','3'); -INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES ('18','3'); -INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES ('19','3'); -INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES ('20','3'); -INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES ('21','3'); -INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES ('22','3'); -INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES ('23','3'); -INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES ('24','3'); -INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES ('25','3'); -INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES ('26','3'); -INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES ('27','3'); -INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES ('28','3'); -INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES ('29','3'); -INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES ('30','3'); -INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES ('31','3'); -INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES ('32','3'); -INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES ('33','3'); -INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES ('34','3'); -INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES ('101','3'); -INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES ('29','4'); -INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES ('30','4'); +-- ---------------------------- +-- Records of sys_roles_menus +-- ---------------------------- +BEGIN; +INSERT INTO `sys_roles_menus` VALUES (1, 3); +INSERT INTO `sys_roles_menus` VALUES (2, 3); +INSERT INTO `sys_roles_menus` VALUES (3, 3); +INSERT INTO `sys_roles_menus` VALUES (4, 3); +INSERT INTO `sys_roles_menus` VALUES (5, 3); +INSERT INTO `sys_roles_menus` VALUES (6, 3); +INSERT INTO `sys_roles_menus` VALUES (7, 3); +INSERT INTO `sys_roles_menus` VALUES (8, 3); +INSERT INTO `sys_roles_menus` VALUES (9, 3); +INSERT INTO `sys_roles_menus` VALUES (10, 3); +INSERT INTO `sys_roles_menus` VALUES (11, 3); +INSERT INTO `sys_roles_menus` VALUES (14, 3); +INSERT INTO `sys_roles_menus` VALUES (15, 3); +INSERT INTO `sys_roles_menus` VALUES (16, 3); +INSERT INTO `sys_roles_menus` VALUES (17, 3); +INSERT INTO `sys_roles_menus` VALUES (18, 3); +INSERT INTO `sys_roles_menus` VALUES (19, 3); +INSERT INTO `sys_roles_menus` VALUES (20, 3); +INSERT INTO `sys_roles_menus` VALUES (21, 3); +INSERT INTO `sys_roles_menus` VALUES (22, 3); +INSERT INTO `sys_roles_menus` VALUES (23, 3); +INSERT INTO `sys_roles_menus` VALUES (24, 3); +INSERT INTO `sys_roles_menus` VALUES (25, 3); +INSERT INTO `sys_roles_menus` VALUES (26, 3); +INSERT INTO `sys_roles_menus` VALUES (27, 3); +INSERT INTO `sys_roles_menus` VALUES (28, 3); +INSERT INTO `sys_roles_menus` VALUES (29, 3); +INSERT INTO `sys_roles_menus` VALUES (30, 3); +INSERT INTO `sys_roles_menus` VALUES (31, 3); +INSERT INTO `sys_roles_menus` VALUES (32, 3); +INSERT INTO `sys_roles_menus` VALUES (33, 3); +INSERT INTO `sys_roles_menus` VALUES (34, 3); +INSERT INTO `sys_roles_menus` VALUES (101, 3); +INSERT INTO `sys_roles_menus` VALUES (29, 4); +INSERT INTO `sys_roles_menus` VALUES (30, 4); +COMMIT; + +SET FOREIGN_KEY_CHECKS = 1; - -DROP TABLE IF EXISTS `sys_users_roles` ; - +-- ---------------------------- +-- Table structure for sys_users_roles +-- ---------------------------- +DROP TABLE IF EXISTS `sys_users_roles`; CREATE TABLE `sys_users_roles` ( `user_id` bigint(20) NOT NULL COMMENT '用户ID', `role_id` bigint(20) NOT NULL COMMENT '角色ID', @@ -194,6 +240,12 @@ CREATE TABLE `sys_users_roles` ( KEY `FKq4eq273l04bpu4efj0jd0jb98` (`role_id`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='用户角色关联'; -INSERT INTO `sys_users_roles` (`user_id`, `role_id`) VALUES ('4','3'); -INSERT INTO `sys_users_roles` (`user_id`, `role_id`) VALUES ('19','4'); +-- ---------------------------- +-- Records of sys_users_roles +-- ---------------------------- +BEGIN; +INSERT INTO `sys_users_roles` VALUES (4, 3); +INSERT INTO `sys_users_roles` VALUES (19, 4); +COMMIT; +SET FOREIGN_KEY_CHECKS = 1;