Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
zhu
dataease
Commits
318ff159
提交
318ff159
authored
2月 23, 2021
作者:
fit2cloud-chenyw
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: 添加角色数据结构
上级
7bfb85a7
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
415 行增加
和
2 行删除
+415
-2
SysRole.java
backend/src/main/java/io/dataease/base/domain/SysRole.java
+24
-0
SysRoleExample.java
...src/main/java/io/dataease/base/domain/SysRoleExample.java
+0
-0
SysRoleMapper.java
.../src/main/java/io/dataease/base/mapper/SysRoleMapper.java
+31
-0
SysRoleMapper.xml
...d/src/main/java/io/dataease/base/mapper/SysRoleMapper.xml
+244
-0
V8__system.sql
backend/src/main/resources/db/migration/V8__system.sql
+16
-2
router.js
frontend/src/business/components/settings/router.js
+5
-0
role.vue
frontend/src/business/components/settings/sys/role.vue
+95
-0
没有找到文件。
backend/src/main/java/io/dataease/base/domain/SysRole.java
0 → 100644
浏览文件 @
318ff159
package
io
.
dataease
.
base
.
domain
;
import
java.io.Serializable
;
import
lombok.Data
;
@Data
public
class
SysRole
implements
Serializable
{
private
Long
roleId
;
private
String
name
;
private
String
description
;
private
String
createBy
;
private
String
updateBy
;
private
Long
createTime
;
private
Long
updateTime
;
private
static
final
long
serialVersionUID
=
1L
;
}
\ No newline at end of file
backend/src/main/java/io/dataease/base/domain/SysRoleExample.java
0 → 100644
浏览文件 @
318ff159
差异被折叠。
点击展开。
backend/src/main/java/io/dataease/base/mapper/SysRoleMapper.java
0 → 100644
浏览文件 @
318ff159
package
io
.
dataease
.
base
.
mapper
;
import
io.dataease.base.domain.SysRole
;
import
io.dataease.base.domain.SysRoleExample
;
import
java.util.List
;
import
org.apache.ibatis.annotations.Param
;
public
interface
SysRoleMapper
{
long
countByExample
(
SysRoleExample
example
);
int
deleteByExample
(
SysRoleExample
example
);
int
deleteByPrimaryKey
(
Long
roleId
);
int
insert
(
SysRole
record
);
int
insertSelective
(
SysRole
record
);
List
<
SysRole
>
selectByExample
(
SysRoleExample
example
);
SysRole
selectByPrimaryKey
(
Long
roleId
);
int
updateByExampleSelective
(
@Param
(
"record"
)
SysRole
record
,
@Param
(
"example"
)
SysRoleExample
example
);
int
updateByExample
(
@Param
(
"record"
)
SysRole
record
,
@Param
(
"example"
)
SysRoleExample
example
);
int
updateByPrimaryKeySelective
(
SysRole
record
);
int
updateByPrimaryKey
(
SysRole
record
);
}
\ No newline at end of file
backend/src/main/java/io/dataease/base/mapper/SysRoleMapper.xml
0 → 100644
浏览文件 @
318ff159
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"io.dataease.base.mapper.SysRoleMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"io.dataease.base.domain.SysRole"
>
<id
column=
"role_id"
jdbcType=
"BIGINT"
property=
"roleId"
/>
<result
column=
"name"
jdbcType=
"VARCHAR"
property=
"name"
/>
<result
column=
"description"
jdbcType=
"VARCHAR"
property=
"description"
/>
<result
column=
"create_by"
jdbcType=
"VARCHAR"
property=
"createBy"
/>
<result
column=
"update_by"
jdbcType=
"VARCHAR"
property=
"updateBy"
/>
<result
column=
"create_time"
jdbcType=
"BIGINT"
property=
"createTime"
/>
<result
column=
"update_time"
jdbcType=
"BIGINT"
property=
"updateTime"
/>
</resultMap>
<sql
id=
"Example_Where_Clause"
>
<where>
<foreach
collection=
"oredCriteria"
item=
"criteria"
separator=
"or"
>
<if
test=
"criteria.valid"
>
<trim
prefix=
"("
prefixOverrides=
"and"
suffix=
")"
>
<foreach
collection=
"criteria.criteria"
item=
"criterion"
>
<choose>
<when
test=
"criterion.noValue"
>
and ${criterion.condition}
</when>
<when
test=
"criterion.singleValue"
>
and ${criterion.condition} #{criterion.value}
</when>
<when
test=
"criterion.betweenValue"
>
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when
test=
"criterion.listValue"
>
and ${criterion.condition}
<foreach
close=
")"
collection=
"criterion.value"
item=
"listItem"
open=
"("
separator=
","
>
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql
id=
"Update_By_Example_Where_Clause"
>
<where>
<foreach
collection=
"example.oredCriteria"
item=
"criteria"
separator=
"or"
>
<if
test=
"criteria.valid"
>
<trim
prefix=
"("
prefixOverrides=
"and"
suffix=
")"
>
<foreach
collection=
"criteria.criteria"
item=
"criterion"
>
<choose>
<when
test=
"criterion.noValue"
>
and ${criterion.condition}
</when>
<when
test=
"criterion.singleValue"
>
and ${criterion.condition} #{criterion.value}
</when>
<when
test=
"criterion.betweenValue"
>
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when
test=
"criterion.listValue"
>
and ${criterion.condition}
<foreach
close=
")"
collection=
"criterion.value"
item=
"listItem"
open=
"("
separator=
","
>
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql
id=
"Base_Column_List"
>
role_id, `name`, description, create_by, update_by, create_time, update_time
</sql>
<select
id=
"selectByExample"
parameterType=
"io.dataease.base.domain.SysRoleExample"
resultMap=
"BaseResultMap"
>
select
<if
test=
"distinct"
>
distinct
</if>
<include
refid=
"Base_Column_List"
/>
from sys_role
<if
test=
"_parameter != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
<if
test=
"orderByClause != null"
>
order by ${orderByClause}
</if>
</select>
<select
id=
"selectByPrimaryKey"
parameterType=
"java.lang.Long"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from sys_role
where role_id = #{roleId,jdbcType=BIGINT}
</select>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.Long"
>
delete from sys_role
where role_id = #{roleId,jdbcType=BIGINT}
</delete>
<delete
id=
"deleteByExample"
parameterType=
"io.dataease.base.domain.SysRoleExample"
>
delete from sys_role
<if
test=
"_parameter != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
</delete>
<insert
id=
"insert"
parameterType=
"io.dataease.base.domain.SysRole"
>
insert into sys_role (role_id, `name`, description,
create_by, update_by, create_time,
update_time)
values (#{roleId,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR},
#{createBy,jdbcType=VARCHAR}, #{updateBy,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT},
#{updateTime,jdbcType=BIGINT})
</insert>
<insert
id=
"insertSelective"
parameterType=
"io.dataease.base.domain.SysRole"
>
insert into sys_role
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"roleId != null"
>
role_id,
</if>
<if
test=
"name != null"
>
`name`,
</if>
<if
test=
"description != null"
>
description,
</if>
<if
test=
"createBy != null"
>
create_by,
</if>
<if
test=
"updateBy != null"
>
update_by,
</if>
<if
test=
"createTime != null"
>
create_time,
</if>
<if
test=
"updateTime != null"
>
update_time,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"roleId != null"
>
#{roleId,jdbcType=BIGINT},
</if>
<if
test=
"name != null"
>
#{name,jdbcType=VARCHAR},
</if>
<if
test=
"description != null"
>
#{description,jdbcType=VARCHAR},
</if>
<if
test=
"createBy != null"
>
#{createBy,jdbcType=VARCHAR},
</if>
<if
test=
"updateBy != null"
>
#{updateBy,jdbcType=VARCHAR},
</if>
<if
test=
"createTime != null"
>
#{createTime,jdbcType=BIGINT},
</if>
<if
test=
"updateTime != null"
>
#{updateTime,jdbcType=BIGINT},
</if>
</trim>
</insert>
<select
id=
"countByExample"
parameterType=
"io.dataease.base.domain.SysRoleExample"
resultType=
"java.lang.Long"
>
select count(*) from sys_role
<if
test=
"_parameter != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
</select>
<update
id=
"updateByExampleSelective"
parameterType=
"map"
>
update sys_role
<set>
<if
test=
"record.roleId != null"
>
role_id = #{record.roleId,jdbcType=BIGINT},
</if>
<if
test=
"record.name != null"
>
`name` = #{record.name,jdbcType=VARCHAR},
</if>
<if
test=
"record.description != null"
>
description = #{record.description,jdbcType=VARCHAR},
</if>
<if
test=
"record.createBy != null"
>
create_by = #{record.createBy,jdbcType=VARCHAR},
</if>
<if
test=
"record.updateBy != null"
>
update_by = #{record.updateBy,jdbcType=VARCHAR},
</if>
<if
test=
"record.createTime != null"
>
create_time = #{record.createTime,jdbcType=BIGINT},
</if>
<if
test=
"record.updateTime != null"
>
update_time = #{record.updateTime,jdbcType=BIGINT},
</if>
</set>
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
</if>
</update>
<update
id=
"updateByExample"
parameterType=
"map"
>
update sys_role
set role_id = #{record.roleId,jdbcType=BIGINT},
`name` = #{record.name,jdbcType=VARCHAR},
description = #{record.description,jdbcType=VARCHAR},
create_by = #{record.createBy,jdbcType=VARCHAR},
update_by = #{record.updateBy,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT},
update_time = #{record.updateTime,jdbcType=BIGINT}
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
</if>
</update>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"io.dataease.base.domain.SysRole"
>
update sys_role
<set>
<if
test=
"name != null"
>
`name` = #{name,jdbcType=VARCHAR},
</if>
<if
test=
"description != null"
>
description = #{description,jdbcType=VARCHAR},
</if>
<if
test=
"createBy != null"
>
create_by = #{createBy,jdbcType=VARCHAR},
</if>
<if
test=
"updateBy != null"
>
update_by = #{updateBy,jdbcType=VARCHAR},
</if>
<if
test=
"createTime != null"
>
create_time = #{createTime,jdbcType=BIGINT},
</if>
<if
test=
"updateTime != null"
>
update_time = #{updateTime,jdbcType=BIGINT},
</if>
</set>
where role_id = #{roleId,jdbcType=BIGINT}
</update>
<update
id=
"updateByPrimaryKey"
parameterType=
"io.dataease.base.domain.SysRole"
>
update sys_role
set `name` = #{name,jdbcType=VARCHAR},
description = #{description,jdbcType=VARCHAR},
create_by = #{createBy,jdbcType=VARCHAR},
update_by = #{updateBy,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=BIGINT}
where role_id = #{roleId,jdbcType=BIGINT}
</update>
</mapper>
\ No newline at end of file
backend/src/main/resources/db/migration/V8__system.sql
浏览文件 @
318ff159
...
@@ -39,4 +39,18 @@ CREATE TABLE IF NOT EXISTS `sys_menu` (
...
@@ -39,4 +39,18 @@ CREATE TABLE IF NOT EXISTS `sys_menu` (
UNIQUE
KEY
`uniq_title`
(
`title`
),
UNIQUE
KEY
`uniq_title`
(
`title`
),
UNIQUE
KEY
`uniq_name`
(
`name`
),
UNIQUE
KEY
`uniq_name`
(
`name`
),
KEY
`inx_pid`
(
`pid`
)
KEY
`inx_pid`
(
`pid`
)
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
118
DEFAULT
CHARSET
=
utf8
ROW_FORMAT
=
COMPACT
COMMENT
=
'系统菜单'
;
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
118
DEFAULT
CHARSET
=
utf8
ROW_FORMAT
=
COMPACT
COMMENT
=
'系统菜单'
;
\ No newline at end of file
CREATE
TABLE
IF
NOT
EXISTS
`sys_role`
(
`role_id`
bigint
(
20
)
NOT
NULL
AUTO_INCREMENT
COMMENT
'ID'
,
`name`
varchar
(
255
)
NOT
NULL
COMMENT
'名称'
,
`description`
varchar
(
255
)
DEFAULT
NULL
COMMENT
'描述'
,
`create_by`
varchar
(
255
)
DEFAULT
NULL
COMMENT
'创建者'
,
`update_by`
varchar
(
255
)
DEFAULT
NULL
COMMENT
'更新者'
,
`create_time`
bigint
(
13
)
DEFAULT
NULL
COMMENT
'创建日期'
,
`update_time`
bigint
(
13
)
DEFAULT
NULL
COMMENT
'更新时间'
,
PRIMARY
KEY
(
`role_id`
)
USING
BTREE
,
UNIQUE
KEY
`uniq_name`
(
`name`
),
KEY
`role_name_index`
(
`name`
)
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
3
DEFAULT
CHARSET
=
utf8
ROW_FORMAT
=
COMPACT
COMMENT
=
'角色表'
;
\ No newline at end of file
frontend/src/business/components/settings/router.js
浏览文件 @
318ff159
...
@@ -27,6 +27,11 @@ export default {
...
@@ -27,6 +27,11 @@ export default {
component
:
()
=>
import
(
'@/business/components/settings/sys/menu'
),
component
:
()
=>
import
(
'@/business/components/settings/sys/menu'
),
meta
:
{
system
:
true
,
title
:
'commons.menu'
}
meta
:
{
system
:
true
,
title
:
'commons.menu'
}
},
},
{
path
:
'role'
,
component
:
()
=>
import
(
'@/business/components/settings/sys/role'
),
meta
:
{
system
:
true
,
title
:
'commons.role'
}
},
// {
// {
// path: 'systemworkspace',
// path: 'systemworkspace',
// component: () => import('@/business/components/settings/system/SystemWorkspace'),
// component: () => import('@/business/components/settings/system/SystemWorkspace'),
...
...
frontend/src/business/components/settings/sys/role.vue
0 → 100644
浏览文件 @
318ff159
<
template
>
<div
style=
"height: 100%"
v-loading=
"result.loading"
>
<el-container
style=
"width: 100%; height: 100%;border: 1px solid #eee"
>
<el-aside
width=
"30%"
style=
"border: 1px solid #eee"
>
<el-card
class=
"table-card"
>
<template
v-slot:header
>
<ms-table-header
:condition
.
sync=
"condition"
@
search=
"search"
@
create=
"create"
:create-tip=
"$t('user.create')"
:title=
"$t('commons.user')"
/>
</
template
>
<el-table
border
class=
"adjust-table"
:data=
"tableData"
style=
"width: 100%"
>
<el-table-column
prop=
"name"
label=
"名称"
/>
<el-table-column
:show-overflow-tooltip=
"true"
width=
"135px"
prop=
"createTime"
label=
"创建日期"
>
<
template
v-slot:default=
"scope"
>
<span>
{{
scope
.
row
.
createTime
|
timestampFormatDate
}}
</span>
</
template
>
</el-table-column>
<el-table-column
:label=
"$t('commons.operating')"
>
<
template
v-slot:default=
"scope"
>
<ms-table-operator
@
editClick=
"edit(scope.row)"
@
deleteClick=
"handleDelete(scope.row)"
/>
</
template
>
</el-table-column>
</el-table>
<ms-table-pagination
:change=
"search"
:current-page
.
sync=
"currentPage"
:page-size
.
sync=
"pageSize"
:total=
"total"
/>
</el-card>
</el-aside>
<el-main
style=
""
>
<el-tabs
v-model=
"activeName"
@
tab-click=
"handleClick"
>
<el-tab-pane
label=
"菜单飞配"
name=
"first"
>
菜单飞配
</el-tab-pane>
<el-tab-pane
label=
"数据分配"
name=
"second"
>
数据分配
</el-tab-pane>
</el-tabs>
</el-main>
</el-container>
</div>
</template>
<
script
>
import
MsCreateBox
from
"../CreateBox"
;
import
MsTablePagination
from
"../../common/pagination/TablePagination"
;
import
MsTableHeader
from
"../../common/components/MsTableHeader"
;
import
MsTableOperator
from
"../../common/components/MsTableOperator"
;
import
MsDialogFooter
from
"../../common/components/MsDialogFooter"
;
import
MsTableOperatorButton
from
"../../common/components/MsTableOperatorButton"
;
export
default
{
name
:
'role'
,
components
:
{
MsCreateBox
,
MsTablePagination
,
MsTableHeader
,
MsTableOperator
,
MsDialogFooter
,
MsTableOperatorButton
},
data
()
{
return
{
result
:
{},
queryPath
:
'/user/special/list'
,
deletePath
:
'/user/special/delete/'
,
createPath
:
'/user/special/add'
,
updatePath
:
'/user/special/update'
,
currentPage
:
1
,
pageSize
:
10
,
total
:
0
,
condition
:
{},
tableData
:
[],
activeName
:
'second'
};
},
methods
:
{
handleClick
(
tab
,
event
)
{
console
.
log
(
tab
,
event
);
},
search
(){
this
.
result
=
this
.
$post
(
this
.
queryPath
,
this
.
condition
,
response
=>
{
let
data
=
response
.
data
;
this
.
total
=
data
.
itemCount
;
this
.
tableData
=
data
.
listObject
;
})
},
edit
(
row
){
},
handleDelete
(
row
){
}
}
}
</
script
>
<
style
scoped
>
</
style
>
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论