Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
zhu
dataease
Commits
a211b8b7
Unverified
提交
a211b8b7
authored
8月 10, 2021
作者:
fit2cloud-chenyw
提交者:
GitHub
8月 10, 2021
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #572 from dataease/pr@dev@feat_add_xpack_api
feat: 增加xpack插件内api
上级
671b6f6c
80548698
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
33 个修改的文件
包含
279 行增加
和
663 行删除
+279
-663
CurrentUserDto.java
...rc/main/java/io/dataease/auth/api/dto/CurrentUserDto.java
+3
-0
SysUserEntity.java
.../src/main/java/io/dataease/auth/entity/SysUserEntity.java
+11
-0
SysMsgChannel.java
.../src/main/java/io/dataease/base/domain/SysMsgChannel.java
+5
-0
SysMsgSetting.java
.../src/main/java/io/dataease/base/domain/SysMsgSetting.java
+7
-0
SysMsgType.java
...end/src/main/java/io/dataease/base/domain/SysMsgType.java
+8
-0
SysUser.java
backend/src/main/java/io/dataease/base/domain/SysUser.java
+18
-0
LicStatusCondition.java
...ava/io/dataease/commons/condition/LicStatusCondition.java
+28
-0
Knife4jConfiguration.java
...rc/main/java/io/dataease/config/Knife4jConfiguration.java
+12
-5
SysDeptController.java
...in/java/io/dataease/controller/sys/SysDeptController.java
+7
-8
SysRoleController.java
...in/java/io/dataease/controller/sys/SysRoleController.java
+8
-7
SysUserController.java
...in/java/io/dataease/controller/sys/SysUserController.java
+15
-3
BaseGridRequest.java
...java/io/dataease/controller/sys/base/BaseGridRequest.java
+3
-0
ConditionEntity.java
...java/io/dataease/controller/sys/base/ConditionEntity.java
+4
-0
BatchSettingRequest.java
.../dataease/controller/sys/request/BatchSettingRequest.java
+4
-3
MsgRequest.java
...n/java/io/dataease/controller/sys/request/MsgRequest.java
+4
-0
MsgSettingRequest.java
...io/dataease/controller/sys/request/MsgSettingRequest.java
+3
-0
SysUserCreateRequest.java
...dataease/controller/sys/request/SysUserCreateRequest.java
+3
-0
SysUserPwdRequest.java
...io/dataease/controller/sys/request/SysUserPwdRequest.java
+5
-0
SysUserStateRequest.java
.../dataease/controller/sys/request/SysUserStateRequest.java
+3
-0
SettingTreeNode.java
.../io/dataease/controller/sys/response/SettingTreeNode.java
+4
-0
PluginCommonServer.java
...n/java/io/dataease/plugins/server/PluginCommonServer.java
+3
-0
XDeptServer.java
...src/main/java/io/dataease/plugins/server/XDeptServer.java
+14
-1
XRoleServer.java
...src/main/java/io/dataease/plugins/server/XRoleServer.java
+9
-0
SysRoleService.java
...src/main/java/io/dataease/service/sys/SysRoleService.java
+14
-14
dept.js
frontend/src/api/system/dept.js
+22
-22
role.js
frontend/src/api/system/role.js
+50
-50
user.js
frontend/src/api/system/user.js
+9
-1
form.vue
frontend/src/views/system/dept/form.vue
+0
-161
index.vue
frontend/src/views/system/dept/index.vue
+0
-0
form.vue
frontend/src/views/system/role/form.vue
+0
-104
index.vue
frontend/src/views/system/role/index.vue
+0
-276
form.vue
frontend/src/views/system/user/form.vue
+1
-6
index.vue
frontend/src/views/system/user/index.vue
+2
-2
没有找到文件。
backend/src/main/java/io/dataease/auth/api/dto/CurrentUserDto.java
浏览文件 @
a211b8b7
package
io
.
dataease
.
auth
.
api
.
dto
;
import
io.dataease.auth.entity.SysUserEntity
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
...
...
@@ -11,7 +12,9 @@ import java.util.List;
@NoArgsConstructor
public
class
CurrentUserDto
extends
SysUserEntity
implements
Serializable
{
@ApiModelProperty
(
"角色集合"
)
private
List
<
CurrentRoleDto
>
roles
;
@ApiModelProperty
(
"权限集合"
)
private
List
<
String
>
permissions
;
}
backend/src/main/java/io/dataease/auth/entity/SysUserEntity.java
浏览文件 @
a211b8b7
package
io
.
dataease
.
auth
.
entity
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
...
...
@@ -8,23 +9,33 @@ import java.io.Serializable;
public
class
SysUserEntity
implements
Serializable
{
@ApiModelProperty
(
hidden
=
true
)
private
Long
userId
;
@ApiModelProperty
(
"账号"
)
private
String
username
;
@ApiModelProperty
(
"姓名"
)
private
String
nickName
;
@ApiModelProperty
(
"组织ID"
)
private
Long
deptId
;
@ApiModelProperty
(
hidden
=
true
)
private
String
password
;
@ApiModelProperty
(
"状态"
)
private
Integer
enabled
;
@ApiModelProperty
(
"邮箱"
)
private
String
email
;
@ApiModelProperty
(
"电话"
)
private
String
phone
;
@ApiModelProperty
(
hidden
=
true
)
private
String
language
;
@ApiModelProperty
(
hidden
=
true
)
private
Boolean
isAdmin
;
}
backend/src/main/java/io/dataease/base/domain/SysMsgChannel.java
浏览文件 @
a211b8b7
package
io
.
dataease
.
base
.
domain
;
import
java.io.Serializable
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@Data
public
class
SysMsgChannel
implements
Serializable
{
@ApiModelProperty
(
"消息渠道ID"
)
private
Long
msgChannelId
;
@ApiModelProperty
(
"消息渠道名称"
)
private
String
channelName
;
private
static
final
long
serialVersionUID
=
1L
;
...
...
backend/src/main/java/io/dataease/base/domain/SysMsgSetting.java
浏览文件 @
a211b8b7
package
io
.
dataease
.
base
.
domain
;
import
java.io.Serializable
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@Data
public
class
SysMsgSetting
implements
Serializable
{
@ApiModelProperty
(
hidden
=
true
)
private
Long
msgSettingId
;
@ApiModelProperty
(
"订阅用户ID"
)
private
Long
userId
;
@ApiModelProperty
(
"订阅类型ID"
)
private
Long
typeId
;
@ApiModelProperty
(
"订阅渠道ID"
)
private
Long
channelId
;
@ApiModelProperty
(
"订阅状态ID"
)
private
Boolean
enable
;
private
static
final
long
serialVersionUID
=
1L
;
...
...
backend/src/main/java/io/dataease/base/domain/SysMsgType.java
浏览文件 @
a211b8b7
package
io
.
dataease
.
base
.
domain
;
import
java.io.Serializable
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@Data
public
class
SysMsgType
implements
Serializable
{
@ApiModelProperty
(
"消息类型ID"
)
private
Long
msgTypeId
;
@ApiModelProperty
(
"上级类型ID"
)
private
Long
pid
;
@ApiModelProperty
(
"消息类型名称"
)
private
String
typeName
;
@ApiModelProperty
(
hidden
=
true
)
private
String
router
;
@ApiModelProperty
(
hidden
=
true
)
private
String
callback
;
private
static
final
long
serialVersionUID
=
1L
;
...
...
backend/src/main/java/io/dataease/base/domain/SysUser.java
浏览文件 @
a211b8b7
package
io
.
dataease
.
base
.
domain
;
import
java.io.Serializable
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@Data
public
class
SysUser
implements
Serializable
{
@ApiModelProperty
(
value
=
"用户ID"
,
allowEmptyValue
=
false
,
position
=
0
)
private
Long
userId
;
@ApiModelProperty
(
value
=
"组织ID"
,
allowEmptyValue
=
false
,
position
=
7
)
private
Long
deptId
;
@ApiModelProperty
(
value
=
"账号"
,
required
=
true
)
private
String
username
;
@ApiModelProperty
(
value
=
"姓名"
,
required
=
true
,
position
=
2
)
private
String
nickName
;
@ApiModelProperty
(
value
=
"性别"
,
allowableValues
=
"男,女"
,
allowEmptyValue
=
true
,
position
=
5
)
private
String
gender
;
@ApiModelProperty
(
value
=
"电话"
,
allowEmptyValue
=
true
,
position
=
1
)
private
String
phone
;
@ApiModelProperty
(
value
=
"邮箱"
,
required
=
true
,
position
=
3
)
private
String
email
;
@ApiModelProperty
(
value
=
"密码"
,
required
=
true
,
position
=
4
)
private
String
password
;
@ApiModelProperty
(
hidden
=
true
)
private
Boolean
isAdmin
;
@ApiModelProperty
(
value
=
"状态"
,
allowableValues
=
"1,0"
,
required
=
true
,
position
=
6
)
private
Long
enabled
;
@ApiModelProperty
(
hidden
=
true
)
private
String
createBy
;
@ApiModelProperty
(
hidden
=
true
)
private
String
updateBy
;
@ApiModelProperty
(
hidden
=
true
)
private
Long
pwdResetTime
;
@ApiModelProperty
(
hidden
=
true
)
private
Long
createTime
;
@ApiModelProperty
(
hidden
=
true
)
private
Long
updateTime
;
@ApiModelProperty
(
hidden
=
true
)
private
String
language
;
private
static
final
long
serialVersionUID
=
1L
;
...
...
backend/src/main/java/io/dataease/commons/condition/LicStatusCondition.java
0 → 100644
浏览文件 @
a211b8b7
package
io
.
dataease
.
commons
.
condition
;
import
io.dataease.commons.license.DefaultLicenseService
;
import
io.dataease.commons.license.F2CLicenseResponse
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.springframework.context.annotation.Condition
;
import
org.springframework.context.annotation.ConditionContext
;
import
org.springframework.core.type.AnnotatedTypeMetadata
;
public
class
LicStatusCondition
implements
Condition
{
@Override
public
boolean
matches
(
ConditionContext
conditionContext
,
AnnotatedTypeMetadata
annotatedTypeMetadata
)
{
// BeanDefinitionRegistry registry = conditionContext.getRegistry();
DefaultLicenseService
defaultLicenseService
=
conditionContext
.
getBeanFactory
().
getBean
(
DefaultLicenseService
.
class
);
/*if (null == defaultLicenseService) {
registry.registerBeanDefinition();
}*/
if
(
ObjectUtils
.
isNotEmpty
(
defaultLicenseService
))
{
F2CLicenseResponse
f2CLicenseResponse
=
defaultLicenseService
.
validateLicense
();
return
F2CLicenseResponse
.
Status
.
valid
==
f2CLicenseResponse
.
getStatus
();
}
return
false
;
}
}
backend/src/main/java/io/dataease/config/Knife4jConfiguration.java
浏览文件 @
a211b8b7
package
io
.
dataease
.
config
;
import
cn.hutool.core.collection.CollectionUtil
;
import
com.github.xiaoymin.knife4j.spring.extension.OpenApiExtensionResolver
;
import
io.dataease.commons.condition.LicStatusCondition
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Import
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.context.annotation.*
;
import
springfox.bean.validators.configuration.BeanValidatorPluginsConfiguration
;
import
springfox.documentation.builders.*
;
import
springfox.documentation.oas.annotations.EnableOpenApi
;
...
...
@@ -15,6 +12,8 @@ import springfox.documentation.service.*;
import
springfox.documentation.spi.DocumentationType
;
import
springfox.documentation.spi.service.contexts.SecurityContext
;
import
springfox.documentation.spring.web.plugins.Docket
;
import
javax.annotation.Resource
;
import
java.util.ArrayList
;
import
java.util.List
;
...
...
@@ -29,6 +28,7 @@ public class Knife4jConfiguration {
private
String
version
;
@Autowired
public
Knife4jConfiguration
(
OpenApiExtensionResolver
openApiExtensionResolver
)
{
this
.
openApiExtensionResolver
=
openApiExtensionResolver
;
...
...
@@ -64,6 +64,13 @@ public class Knife4jConfiguration {
return
defaultApi
(
"系统管理"
,
"io.dataease.controller.sys"
);
}
@Bean
(
value
=
"pluginsApi"
)
/*@DependsOn(value = "licStatusCondition")*/
@Conditional
(
LicStatusCondition
.
class
)
public
Docket
pluginsApi
()
{
return
defaultApi
(
"插件管理"
,
"io.dataease.plugins.server"
);
}
private
ApiInfo
apiInfo
(){
return
new
ApiInfoBuilder
()
...
...
backend/src/main/java/io/dataease/controller/sys/SysDeptController.java
浏览文件 @
a211b8b7
...
...
@@ -4,14 +4,14 @@ import io.dataease.base.domain.SysDept;
import
io.dataease.commons.utils.BeanUtils
;
import
io.dataease.controller.ResultHolder
;
import
io.dataease.controller.sys.base.BaseGridRequest
;
import
io.dataease.controller.sys.request.DeptCreateRequest
;
/*
import io.dataease.controller.sys.request.DeptCreateRequest;
import io.dataease.controller.sys.request.DeptDeleteRequest;
import
io.dataease.controller.sys.request.DeptStatusRequest
;
import io.dataease.controller.sys.request.DeptStatusRequest;
*/
import
io.dataease.controller.sys.response.DeptNodeResponse
;
import
io.dataease.controller.sys.response.DeptTreeNode
;
import
io.dataease.service.sys.DeptService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
/*import io.swagger.annotations.ApiOperation;*/
import
lombok.RequiredArgsConstructor
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
...
...
@@ -46,7 +46,6 @@ public class SysDeptController extends ResultHolder {
@PostMapping
(
"/search"
)
public
List
<
DeptNodeResponse
>
search
(
@RequestBody
BaseGridRequest
request
){
List
<
SysDept
>
nodes
=
deptService
.
nodesTreeByCondition
(
request
);
//List<SysDept> nodes = deptService.nodesByPid(pid);
List
<
DeptNodeResponse
>
nodeResponses
=
nodes
.
stream
().
map
(
node
->
{
DeptNodeResponse
deptNodeResponse
=
BeanUtils
.
copyBean
(
new
DeptNodeResponse
(),
node
);
deptNodeResponse
.
setHasChildren
(
node
.
getSubCount
()
>
0
);
...
...
@@ -57,14 +56,14 @@ public class SysDeptController extends ResultHolder {
return
nodeResponses
;
}
@ApiOperation
(
"查询部门"
)
/*
@ApiOperation("查询部门")
@PostMapping("/root")
public ResultHolder rootData(){
List<SysDept> root = deptService.nodesByPid(null);
return success(root);
}
}
*/
@ApiOperation
(
"新增部门"
)
/*
@ApiOperation("新增部门")
@PostMapping("/create")
public void create(@RequestBody DeptCreateRequest dept){
deptService.add(dept);
...
...
@@ -84,7 +83,7 @@ public class SysDeptController extends ResultHolder {
@PostMapping("/updateStatus")
public void updateStatus(@RequestBody DeptStatusRequest request){
deptService.updateStatus(request);
}
}
*/
@PostMapping
(
"/nodesByDeptId/{deptId}"
)
public
List
<
DeptTreeNode
>
nodesByDeptId
(
@PathVariable
(
"deptId"
)
Long
deptId
){
...
...
backend/src/main/java/io/dataease/controller/sys/SysRoleController.java
浏览文件 @
a211b8b7
package
io
.
dataease
.
controller
.
sys
;
import
com.github.pagehelper.Page
;
/*
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import io.dataease.base.domain.SysRole;
import io.dataease.commons.utils.PageUtils;
import io.dataease.commons.utils.Pager;
import io.dataease.controller.sys.base.BaseGridRequest;
import
io.dataease.controller.sys.request.RoleMenusRequest
;
import io.dataease.controller.sys.request.RoleMenusRequest;
*/
import
io.dataease.controller.sys.response.RoleUserItem
;
import
io.dataease.service.sys.SysRoleService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
/*import io.swagger.annotations.ApiOperation;*/
import
lombok.RequiredArgsConstructor
;
import
org.springframework.web.bind.annotation.*
;
import
springfox.documentation.annotations.ApiIgnore
;
import
javax.annotation.Resource
;
import
java.util.List
;
@ApiIgnore
/*
@ApiIgnore
@RestController
@RequiredArgsConstructor
@Api(tags = "系统:角色管理")
@RequestMapping("/api/role")
public
class
SysRoleController
{
public class SysRoleController {
*/
/*
@Resource
private SysRoleService sysRoleService;
...
...
@@ -74,4 +74,5 @@ public class SysRoleController {
public List<RoleUserItem> all(){
return sysRoleService.allRoles();
}
}
*/
/*}*/
backend/src/main/java/io/dataease/controller/sys/SysUserController.java
浏览文件 @
a211b8b7
...
...
@@ -12,7 +12,9 @@ import io.dataease.controller.sys.base.BaseGridRequest;
import
io.dataease.controller.sys.request.SysUserCreateRequest
;
import
io.dataease.controller.sys.request.SysUserPwdRequest
;
import
io.dataease.controller.sys.request.SysUserStateRequest
;
import
io.dataease.controller.sys.response.RoleUserItem
;
import
io.dataease.controller.sys.response.SysUserGridResponse
;
import
io.dataease.service.sys.SysRoleService
;
import
io.dataease.service.sys.SysUserService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
...
...
@@ -32,6 +34,9 @@ public class SysUserController {
@Resource
private
SysUserService
sysUserService
;
@Resource
private
SysRoleService
sysRoleService
;
@ApiOperation
(
"查询用户"
)
@PostMapping
(
"/userGrid/{goPage}/{pageSize}"
)
public
Pager
<
List
<
SysUserGridResponse
>>
userGrid
(
@PathVariable
int
goPage
,
@PathVariable
int
pageSize
,
@RequestBody
BaseGridRequest
request
)
{
...
...
@@ -68,26 +73,27 @@ public class SysUserController {
sysUserService
.
updateStatus
(
request
);
}
@ApiOperation
(
"
用户更新
密码"
)
@ApiOperation
(
"
更新当前用户
密码"
)
@PostMapping
(
"/updatePwd"
)
public
void
updatePwd
(
@RequestBody
SysUserPwdRequest
request
){
sysUserService
.
updatePwd
(
request
);
}
@ApiOperation
(
"
管理员更新
密码"
)
@ApiOperation
(
"
更新指定用户
密码"
)
@PostMapping
(
"/adminUpdatePwd"
)
public
void
adminUpdatePwd
(
@RequestBody
SysUserPwdRequest
request
){
sysUserService
.
adminUpdatePwd
(
request
);
}
@ApiOperation
(
"
个人
信息"
)
@ApiOperation
(
"
当前用户
信息"
)
@PostMapping
(
"/personInfo"
)
public
CurrentUserDto
personInfo
()
{
CurrentUserDto
user
=
AuthUtils
.
getUser
();
return
user
;
}
@ApiIgnore
@ApiOperation
(
"更新个人信息"
)
@PostMapping
(
"/updatePersonInfo"
)
public
void
updatePersonInfo
(
@RequestBody
SysUserCreateRequest
request
){
...
...
@@ -104,4 +110,10 @@ public class SysUserController {
}
});
}
@ApiOperation
(
"查询所有角色"
)
@PostMapping
(
"/all"
)
public
List
<
RoleUserItem
>
all
(){
return
sysRoleService
.
allRoles
();
}
}
backend/src/main/java/io/dataease/controller/sys/base/BaseGridRequest.java
浏览文件 @
a211b8b7
package
io
.
dataease
.
controller
.
sys
.
base
;
import
io.dataease.base.mapper.ext.query.GridExample
;
import
io.swagger.annotations.ApiModelProperty
;
import
org.apache.commons.collections.CollectionUtils
;
import
java.io.Serializable
;
...
...
@@ -9,6 +10,7 @@ import java.util.List;
public
class
BaseGridRequest
implements
Serializable
{
@ApiModelProperty
(
"查询条件"
)
private
List
<
ConditionEntity
>
conditions
;
public
List
<
ConditionEntity
>
getConditions
()
{
...
...
@@ -27,6 +29,7 @@ public class BaseGridRequest implements Serializable {
this
.
orders
=
orders
;
}
@ApiModelProperty
(
"排序描述"
)
private
List
<
String
>
orders
;
public
GridExample
convertExample
(){
...
...
backend/src/main/java/io/dataease/controller/sys/base/ConditionEntity.java
浏览文件 @
a211b8b7
package
io
.
dataease
.
controller
.
sys
.
base
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
...
...
@@ -7,10 +8,13 @@ import java.io.Serializable;
@Data
public
class
ConditionEntity
implements
Serializable
{
@ApiModelProperty
(
value
=
"字段"
)
private
String
field
;
@ApiModelProperty
(
value
=
"操作符"
)
private
String
operator
;
@ApiModelProperty
(
value
=
"字段值"
)
private
Object
value
;
}
backend/src/main/java/io/dataease/controller/sys/request/BatchSettingRequest.java
浏览文件 @
a211b8b7
package
io
.
dataease
.
controller
.
sys
.
request
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
...
...
@@ -7,10 +8,10 @@ import java.util.List;
@Data
public
class
BatchSettingRequest
implements
Serializable
{
@ApiModelProperty
(
"消息类型ID集合"
)
private
List
<
Long
>
typeIds
;
@ApiModelProperty
(
"消息类型ID"
)
private
Long
channelId
;
@ApiModelProperty
(
"订阅状态"
)
private
Boolean
enable
;
}
backend/src/main/java/io/dataease/controller/sys/request/MsgRequest.java
浏览文件 @
a211b8b7
package
io
.
dataease
.
controller
.
sys
.
request
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
...
...
@@ -10,9 +11,12 @@ public class MsgRequest implements Serializable {
private
static
final
long
serialVersionUID
=
1920091635946508658L
;
@ApiModelProperty
(
"消息类型ID"
)
private
Long
type
;
@ApiModelProperty
(
"是否订阅"
)
private
Boolean
status
;
@ApiModelProperty
(
"排序描述"
)
private
List
<
String
>
orders
;
}
backend/src/main/java/io/dataease/controller/sys/request/MsgSettingRequest.java
浏览文件 @
a211b8b7
package
io
.
dataease
.
controller
.
sys
.
request
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
...
...
@@ -8,7 +9,9 @@ import java.io.Serializable;
@Data
public
class
MsgSettingRequest
implements
Serializable
{
@ApiModelProperty
(
"消息类型ID"
)
private
Long
typeId
;
@ApiModelProperty
(
"消息渠道ID"
)
private
Long
channelId
;
}
backend/src/main/java/io/dataease/controller/sys/request/SysUserCreateRequest.java
浏览文件 @
a211b8b7
package
io
.
dataease
.
controller
.
sys
.
request
;
import
io.dataease.base.domain.SysUser
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.ArrayList
;
import
java.util.List
;
@Data
public
class
SysUserCreateRequest
extends
SysUser
{
@ApiModelProperty
(
value
=
"角色ID集合"
,
required
=
true
,
position
=
7
)
private
List
<
Long
>
roleIds
;
}
backend/src/main/java/io/dataease/controller/sys/request/SysUserPwdRequest.java
浏览文件 @
a211b8b7
package
io
.
dataease
.
controller
.
sys
.
request
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
...
...
@@ -8,9 +9,13 @@ import java.io.Serializable;
@Data
public
class
SysUserPwdRequest
implements
Serializable
{
@ApiModelProperty
(
value
=
"用户ID"
,
required
=
true
)
private
Long
userId
;
@ApiModelProperty
(
value
=
"旧密码(密文)"
,
required
=
true
)
private
String
password
;
@ApiModelProperty
(
hidden
=
true
)
private
String
repeatPassword
;
@ApiModelProperty
(
value
=
"新密码(明文)"
,
required
=
true
)
private
String
newPassword
;
...
...
backend/src/main/java/io/dataease/controller/sys/request/SysUserStateRequest.java
浏览文件 @
a211b8b7
package
io
.
dataease
.
controller
.
sys
.
request
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
...
...
@@ -7,7 +8,9 @@ import java.io.Serializable;
@Data
public
class
SysUserStateRequest
implements
Serializable
{
@ApiModelProperty
(
value
=
"用户ID"
,
required
=
true
)
private
Long
userId
;
@ApiModelProperty
(
value
=
"状态"
,
required
=
true
,
allowableValues
=
"1,0"
)
private
Long
enabled
;
}
backend/src/main/java/io/dataease/controller/sys/response/SettingTreeNode.java
浏览文件 @
a211b8b7
package
io
.
dataease
.
controller
.
sys
.
response
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
...
...
@@ -11,9 +12,12 @@ public class SettingTreeNode implements Serializable {
private
static
final
long
serialVersionUID
=
-
2416283978185545199L
;
@ApiModelProperty
(
"消息类型ID"
)
private
Long
id
;
@ApiModelProperty
(
"消息类型名称"
)
private
String
name
;
@ApiModelProperty
(
"子节点"
)
private
List
<
SettingTreeNode
>
children
;
}
backend/src/main/java/io/dataease/plugins/server/PluginCommonServer.java
浏览文件 @
a211b8b7
...
...
@@ -8,6 +8,8 @@ import org.springframework.web.bind.annotation.GetMapping;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
springfox.documentation.annotations.ApiIgnore
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.BufferedInputStream
;
import
java.io.IOException
;
...
...
@@ -17,6 +19,7 @@ import java.util.List;
import
java.util.Map
;
import
java.util.concurrent.atomic.AtomicReference
;
@ApiIgnore
@RestController
@RequestMapping
(
"/api/pluginCommon"
)
public
class
PluginCommonServer
{
...
...
backend/src/main/java/io/dataease/plugins/server/XDeptServer.java
浏览文件 @
a211b8b7
...
...
@@ -11,14 +11,19 @@ import io.dataease.plugins.xpack.dept.dto.request.XpackMoveDept;
import
io.dataease.plugins.xpack.dept.dto.response.XpackDeptTreeNode
;
import
io.dataease.plugins.xpack.dept.dto.response.XpackSysDept
;
import
io.dataease.plugins.xpack.dept.service.DeptXpackService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.web.bind.annotation.*
;
import
springfox.documentation.annotations.ApiIgnore
;
import
java.util.List
;
import
java.util.stream.Collectors
;
@Api
(
tags
=
"xpack:部门管理"
)
@RequestMapping
(
"/plugin/dept"
)
@RestController
public
class
XDeptServer
{
@ApiOperation
(
"查询子节点"
)
@PostMapping
(
"/childNodes/{pid}"
)
public
List
<
DeptNodeResponse
>
childNodes
(
@PathVariable
(
"pid"
)
Long
pid
){
DeptXpackService
deptService
=
SpringContextUtil
.
getBean
(
DeptXpackService
.
class
);
...
...
@@ -33,6 +38,7 @@ public class XDeptServer {
return
nodeResponses
;
}
@ApiOperation
(
"搜索组织树"
)
@PostMapping
(
"/search"
)
public
List
<
DeptNodeResponse
>
search
(
@RequestBody
XpackGridRequest
request
){
DeptXpackService
deptService
=
SpringContextUtil
.
getBean
(
DeptXpackService
.
class
);
...
...
@@ -47,6 +53,7 @@ public class XDeptServer {
return
nodeResponses
;
}
@ApiIgnore
@PostMapping
(
"/root"
)
public
List
<
XpackSysDept
>
rootData
(){
DeptXpackService
deptService
=
SpringContextUtil
.
getBean
(
DeptXpackService
.
class
);
...
...
@@ -54,18 +61,21 @@ public class XDeptServer {
return
nodes
;
}
@ApiOperation
(
"创建"
)
@PostMapping
(
"/create"
)
public
int
create
(
@RequestBody
XpackCreateDept
dept
){
DeptXpackService
deptService
=
SpringContextUtil
.
getBean
(
DeptXpackService
.
class
);
return
deptService
.
add
(
dept
);
}
@ApiOperation
(
"删除"
)
@PostMapping
(
"/delete"
)
public
void
delete
(
@RequestBody
List
<
XpackDeleteDept
>
requests
){
DeptXpackService
deptService
=
SpringContextUtil
.
getBean
(
DeptXpackService
.
class
);
deptService
.
batchDelete
(
requests
);
}
@ApiOperation
(
"更新"
)
@PostMapping
(
"/update"
)
public
int
update
(
@RequestBody
XpackCreateDept
dept
){
DeptXpackService
deptService
=
SpringContextUtil
.
getBean
(
DeptXpackService
.
class
);
...
...
@@ -73,12 +83,15 @@ public class XDeptServer {
}
@ApiIgnore
@ApiOperation
(
"删除"
)
@PostMapping
(
"/nodesByDeptId/{deptId}"
)
public
List
<
XpackDeptTreeNode
>
nodesByDeptId
(
@PathVariable
(
"deptId"
)
Long
deptId
){
DeptXpackService
deptService
=
SpringContextUtil
.
getBean
(
DeptXpackService
.
class
);
return
deptService
.
searchTree
(
deptId
);
}
@ApiOperation
(
"移动"
)
@PostMapping
(
"/move"
)
public
void
move
(
@RequestBody
XpackMoveDept
xpackMoveDept
){
DeptXpackService
deptService
=
SpringContextUtil
.
getBean
(
DeptXpackService
.
class
);
...
...
backend/src/main/java/io/dataease/plugins/server/XRoleServer.java
浏览文件 @
a211b8b7
...
...
@@ -10,14 +10,19 @@ import io.dataease.plugins.config.SpringContextUtil;
import
io.dataease.plugins.xpack.role.dto.response.XpackRoleDto
;
import
io.dataease.plugins.xpack.role.dto.response.XpackRoleItemDto
;
import
io.dataease.plugins.xpack.role.service.RoleXpackService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.web.bind.annotation.*
;
import
springfox.documentation.annotations.ApiIgnore
;
import
java.util.List
;
@Api
(
tags
=
"xpack:角色管理"
)
@RequestMapping
(
"/plugin/role"
)
@RestController
public
class
XRoleServer
{
@ApiOperation
(
"新增角色"
)
@PostMapping
(
"/create"
)
public
void
create
(
@RequestBody
XpackRoleDto
role
){
RoleXpackService
roleXpackService
=
SpringContextUtil
.
getBean
(
RoleXpackService
.
class
);
...
...
@@ -25,6 +30,7 @@ public class XRoleServer {
}
@ApiOperation
(
"删除角色"
)
@PostMapping
(
"/delete/{roleId}"
)
public
void
delete
(
@PathVariable
(
"roleId"
)
Long
roleId
){
RoleXpackService
roleXpackService
=
SpringContextUtil
.
getBean
(
RoleXpackService
.
class
);
...
...
@@ -32,12 +38,14 @@ public class XRoleServer {
}
@ApiOperation
(
"更新角色"
)
@PostMapping
(
"/update"
)
public
void
update
(
@RequestBody
XpackRoleDto
role
){
RoleXpackService
roleXpackService
=
SpringContextUtil
.
getBean
(
RoleXpackService
.
class
);
roleXpackService
.
update
(
role
);
}
@ApiOperation
(
"分页查询"
)
@PostMapping
(
"/roleGrid/{goPage}/{pageSize}"
)
public
Pager
<
List
<
XpackRoleDto
>>
roleGrid
(
@PathVariable
int
goPage
,
@PathVariable
int
pageSize
,
@RequestBody
XpackGridRequest
request
)
{
RoleXpackService
roleXpackService
=
SpringContextUtil
.
getBean
(
RoleXpackService
.
class
);
...
...
@@ -46,6 +54,7 @@ public class XRoleServer {
return
listPager
;
}
@ApiIgnore
@PostMapping
(
"/all"
)
public
List
<
XpackRoleItemDto
>
all
()
{
RoleXpackService
roleXpackService
=
SpringContextUtil
.
getBean
(
RoleXpackService
.
class
);
...
...
backend/src/main/java/io/dataease/service/sys/SysRoleService.java
浏览文件 @
a211b8b7
package
io
.
dataease
.
service
.
sys
;
import
io.dataease.base.domain.SysRole
;
/*
import io.dataease.base.domain.SysRole;
import io.dataease.base.domain.SysUsersRolesExample;
import io.dataease.base.mapper.SysRoleMapper;
import
io.dataease.base.mapper.SysUsersRolesMapper
;
import io.dataease.base.mapper.SysUsersRolesMapper;
*/
import
io.dataease.base.mapper.ext.ExtSysRoleMapper
;
import
io.dataease.controller.sys.base.BaseGridRequest
;
import
io.dataease.controller.sys.request.RoleMenusRequest
;
/*
import io.dataease.controller.sys.base.BaseGridRequest;
import io.dataease.controller.sys.request.RoleMenusRequest;
*/
import
io.dataease.controller.sys.response.RoleUserItem
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
/*import org.springframework.transaction.annotation.Transactional;*/
import
javax.annotation.Resource
;
import
java.util.HashMap
;
/*import java.util.HashMap;*/
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
/*
import java.util.Map;
import java.util.stream.Collectors;
*/
@Service
public
class
SysRoleService
{
@Resource
private
SysRoleMapper
mapper
;
/*
@Resource
private SysRoleMapper mapper;
*/
@Resource
private
ExtSysRoleMapper
extSysRoleMapper
;
@Resource
private
SysUsersRolesMapper
sysUsersRolesMapper
;
/*
@Resource
private SysUsersRolesMapper sysUsersRolesMapper;
*/
public
int
add
(
SysRole
role
){
/*
public int add(SysRole role){
Long now = System.currentTimeMillis();
role.setCreateTime(now);
role.setUpdateTime(now);
...
...
@@ -77,7 +77,7 @@ public class SysRoleService {
return map;
}).collect(Collectors.toList());
return extSysRoleMapper.batchInsertRoleMenu(maps);
}
}
*/
public
List
<
RoleUserItem
>
allRoles
(){
return
extSysRoleMapper
.
queryAll
();
...
...
frontend/src/api/system/dept.js
浏览文件 @
a211b8b7
...
...
@@ -17,29 +17,29 @@ export function loadTable(data) {
})
}
export
function
addDept
(
data
)
{
return
request
({
url
:
'/api/dept/create'
,
method
:
'post'
,
data
})
}
//
export function addDept(data) {
//
return request({
//
url: '/api/dept/create',
//
method: 'post',
//
data
//
})
//
}
export
function
delDept
(
ids
)
{
return
request
({
url
:
'/api/dept/delete'
,
method
:
'post'
,
data
:
ids
})
}
//
export function delDept(ids) {
//
return request({
//
url: '/api/dept/delete',
//
method: 'post',
//
data: ids
//
})
//
}
export
function
editDept
(
data
)
{
return
request
({
url
:
'/api/dept/update'
,
method
:
'post'
,
data
})
}
//
export function editDept(data) {
//
return request({
//
url: '/api/dept/update',
//
method: 'post',
//
data
//
})
//
}
export
function
treeByDeptId
(
deptId
)
{
return
request
({
...
...
@@ -48,4 +48,4 @@ export function treeByDeptId(deptId) {
})
}
export
default
{
addDept
,
delDept
,
editDept
,
getDeptTree
,
loadTable
,
treeByDeptId
}
//
export default { addDept, delDept, editDept, getDeptTree, loadTable, treeByDeptId }
frontend/src/api/system/role.js
浏览文件 @
a211b8b7
import
request
from
'@/utils/request'
//
import request from '@/utils/request'
export
function
allRoles
()
{
return
request
({
url
:
'/api/role
/all'
,
method
:
'post'
,
loading
:
true
})
}
//
export function allRoles() {
//
return request({
// url: '/api/user
/all',
//
method: 'post',
//
loading: true
//
})
//
}
export
function
roleGrid
(
pageIndex
,
pageSize
,
data
)
{
return
request
({
url
:
'/api/role/roleGrid/'
+
pageIndex
+
'/'
+
pageSize
,
method
:
'post'
,
data
,
loading
:
true
})
}
//
export function roleGrid(pageIndex, pageSize, data) {
//
return request({
//
url: '/api/role/roleGrid/' + pageIndex + '/' + pageSize,
//
method: 'post',
//
data,
//
loading: true
//
})
//
}
export
function
delRole
(
pid
)
{
return
request
({
url
:
'/api/role/delete/'
+
pid
,
method
:
'post'
})
}
//
export function delRole(pid) {
//
return request({
//
url: '/api/role/delete/' + pid,
//
method: 'post'
//
})
//
}
export
function
addRole
(
data
)
{
return
request
({
url
:
'/api/role/create'
,
method
:
'post'
,
data
})
}
//
export function addRole(data) {
//
return request({
//
url: '/api/role/create',
//
method: 'post',
//
data
//
})
//
}
export
function
editRole
(
data
)
{
return
request
({
url
:
'/api/role/update'
,
method
:
'post'
,
data
})
}
//
export function editRole(data) {
//
return request({
//
url: '/api/role/update',
//
method: 'post',
//
data
//
})
//
}
export
function
addRoleMenus
(
data
)
{
return
request
({
url
:
'/api/role/saveRolesMenus'
,
method
:
'post'
,
data
})
}
//
export function addRoleMenus(data) {
//
return request({
//
url: '/api/role/saveRolesMenus',
//
method: 'post',
//
data
//
})
//
}
export
function
menuIds
(
roleId
)
{
return
request
({
url
:
'/api/role/menuIds/'
+
roleId
,
method
:
'post'
})
}
export
default
{
addRole
,
editRole
,
delRole
,
roleGrid
,
allRoles
,
addRoleMenus
,
menuIds
}
//
export function menuIds(roleId) {
//
return request({
//
url: '/api/role/menuIds/' + roleId,
//
method: 'post'
//
})
//
}
//
export default { addRole, editRole, delRole, roleGrid, allRoles, addRoleMenus, menuIds }
frontend/src/api/system/user.js
浏览文件 @
a211b8b7
...
...
@@ -81,4 +81,12 @@ export const updatePersonPwd = (data) => {
})
}
export
default
{
editPassword
,
delUser
,
editUser
,
addUser
,
userLists
,
editStatus
,
persionInfo
,
updatePerson
,
updatePersonPwd
}
export
const
allRoles
=
()
=>
{
return
request
({
url
:
'/api/user/all'
,
method
:
'post'
,
loading
:
true
})
}
export
default
{
editPassword
,
delUser
,
editUser
,
addUser
,
userLists
,
editStatus
,
persionInfo
,
updatePerson
,
updatePersonPwd
,
allRoles
}
frontend/src/views/system/dept/form.vue
deleted
100644 → 0
浏览文件 @
671b6f6c
<
template
>
<layout-content
:header=
"formType=='add' ? $t('organization.create') : $t('organization.modify')"
back-name=
"system-dept"
style=
"height: 100%;"
>
<el-form
ref=
"deptForm"
:model=
"form"
:rules=
"rule"
size=
"small"
label-width=
"auto"
label-position=
"right"
>
<el-form-item
:label=
"$t('organization.name')"
prop=
"name"
>
<el-input
v-model=
"form.name"
/>
</el-form-item>
<el-form-item
:label=
"$t('organization.sort')"
prop=
"deptSort"
>
<el-input-number
v-model
.
number=
"form.deptSort"
:min=
"0"
:max=
"999"
controls-position=
"right"
/>
</el-form-item>
<el-form-item
:label=
"$t('organization.top_org')"
prop=
"top"
>
<el-radio-group
v-model=
"form.top"
@
change=
"topChange"
>
<el-radio
:label=
"true"
>
{{
$t
(
'commons.yes'
)
}}
</el-radio>
<el-radio
:label=
"false"
>
{{
$t
(
'commons.no'
)
}}
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item
v-if=
"!form.top"
:label=
"$t('organization.parent_org')"
prop=
"pid"
>
<treeselect
v-model=
"form.pid"
:auto-load-root-options=
"false"
:load-options=
"loadDepts"
:options=
"depts"
:placeholder=
"$t('organization.select_parent_org')"
/>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
@
click=
"save"
>
{{
$t
(
'commons.save'
)
}}
</el-button>
<el-button
@
click=
"reset"
>
{{
$t
(
'commons.reset'
)
}}
</el-button>
</el-form-item>
</el-form>
</layout-content>
</
template
>
<
script
>
import
LayoutContent
from
'@/components/business/LayoutContent'
import
{
getDeptTree
,
treeByDeptId
,
addDept
,
editDept
}
from
'@/api/system/dept'
export
default
{
components
:
{
LayoutContent
},
data
()
{
return
{
defaultForm
:
{
deptId
:
null
,
top
:
true
,
pid
:
null
},
maps
:
new
Map
(),
form
:
{},
rule
:
{
name
:
[
{
required
:
true
,
message
:
this
.
$t
(
'organization.input_name'
),
trigger
:
'blur'
},
{
min
:
2
,
max
:
25
,
message
:
this
.
$t
(
'commons.input_limit'
,
[
2
,
25
]),
trigger
:
'blur'
}
],
description
:
[
{
max
:
50
,
message
:
this
.
$t
(
'commons.input_limit'
,
[
0
,
50
]),
trigger
:
'blur'
}
]
},
depts
:
null
,
formType
:
'add'
}
},
created
()
{
if
(
this
.
$router
.
currentRoute
.
params
&&
this
.
$router
.
currentRoute
.
params
.
deptId
)
{
const
row
=
this
.
$router
.
currentRoute
.
params
this
.
edit
(
row
)
}
else
{
this
.
create
()
}
},
methods
:
{
create
()
{
this
.
formType
=
'add'
this
.
form
=
Object
.
assign
({},
this
.
defaultForm
)
},
edit
(
row
)
{
this
.
formType
=
'modify'
this
.
form
=
Object
.
assign
({},
row
)
this
.
initDeptTree
()
},
initDeptTree
()
{
treeByDeptId
(
this
.
form
.
pid
||
0
).
then
(
res
=>
{
const
results
=
res
.
data
.
map
(
node
=>
{
if
(
node
.
hasChildren
&&
!
node
.
children
)
{
node
.
children
=
null
}
return
node
})
this
.
depts
=
results
})
},
// 获取弹窗内部门数据
loadDepts
({
action
,
parentNode
,
callback
})
{
if
(
action
===
'LOAD_ROOT_OPTIONS'
&&
!
this
.
form
.
pid
)
{
const
_self
=
this
treeByDeptId
(
0
).
then
(
res
=>
{
const
results
=
res
.
data
.
map
(
node
=>
{
if
(
node
.
hasChildren
&&
!
node
.
children
)
{
node
.
children
=
null
}
return
node
})
_self
.
depts
=
results
callback
()
})
}
if
(
action
===
'LOAD_CHILDREN_OPTIONS'
)
{
const
_self
=
this
getDeptTree
(
parentNode
.
id
).
then
(
res
=>
{
parentNode
.
children
=
res
.
data
.
map
(
function
(
obj
)
{
return
_self
.
normalizer
(
obj
)
})
callback
()
})
}
},
normalizer
(
node
)
{
if
(
node
.
hasChildren
)
{
node
.
children
=
null
}
return
{
id
:
node
.
deptId
,
label
:
node
.
name
,
children
:
node
.
children
}
},
topChange
(
value
)
{
if
(
!
value
)
{
this
.
form
.
pid
=
null
this
.
depts
=
null
}
},
reset
()
{
this
.
$refs
.
deptForm
.
resetFields
()
},
save
()
{
this
.
$refs
.
deptForm
.
validate
(
valid
=>
{
if
(
valid
)
{
const
method
=
this
.
formType
===
'add'
?
addDept
:
editDept
method
(
this
.
form
).
then
(
res
=>
{
this
.
$success
(
this
.
$t
(
'commons.save_success'
))
this
.
backToList
()
})
}
else
{
return
false
}
})
},
backToList
()
{
this
.
$router
.
push
({
name
:
'system-dept'
})
}
}
}
</
script
>
frontend/src/views/system/dept/index.vue
deleted
100644 → 0
浏览文件 @
671b6f6c
差异被折叠。
点击展开。
frontend/src/views/system/role/form.vue
deleted
100644 → 0
浏览文件 @
671b6f6c
<
template
>
<layout-content
:header=
"formType=='add' ? $t('role.add') : $t('role.modify')"
back-name=
"system-role"
>
<el-form
ref=
"roleForm"
:model=
"form"
:rules=
"rule"
size=
"small"
label-width=
"auto"
label-position=
"right"
>
<el-form-item
:label=
"$t('commons.name')"
prop=
"name"
>
<el-input
v-model=
"form.name"
/>
</el-form-item>
<el-form-item
:label=
"$t('commons.description')"
prop=
"description"
>
<el-input
v-model=
"form.description"
type=
"textarea"
/>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
@
click=
"save"
>
{{
$t
(
'commons.save'
)
}}
</el-button>
<el-button
@
click=
"reset"
>
{{
$t
(
'commons.reset'
)
}}
</el-button>
</el-form-item>
</el-form>
</layout-content>
</
template
>
<
script
>
import
LayoutContent
from
'@/components/business/LayoutContent'
import
{
addRole
,
editRole
,
allRoles
}
from
'@/api/system/role'
export
default
{
components
:
{
LayoutContent
},
data
()
{
return
{
formType
:
'add'
,
form
:
{},
rule
:
{
name
:
[
{
required
:
true
,
trigger
:
'blur'
,
validator
:
this
.
roleValidator
}
],
description
:
[{
max
:
50
,
message
:
this
.
$t
(
'commons.char_can_not_more_50'
),
trigger
:
'blur'
}]
},
roles
:
[],
originName
:
null
}
},
created
()
{
if
(
this
.
$router
.
currentRoute
.
params
&&
this
.
$router
.
currentRoute
.
params
.
roleId
)
{
const
row
=
this
.
$router
.
currentRoute
.
params
this
.
edit
(
row
)
}
else
{
this
.
create
()
}
this
.
queryAllRoles
()
},
methods
:
{
create
()
{
this
.
formType
=
'add'
},
edit
(
row
)
{
this
.
formType
=
'modify'
this
.
form
=
Object
.
assign
({},
row
)
this
.
originName
=
row
.
name
},
reset
()
{
this
.
$refs
.
roleForm
.
resetFields
()
},
save
()
{
this
.
$refs
.
roleForm
.
validate
(
valid
=>
{
if
(
valid
)
{
const
method
=
this
.
formType
===
'add'
?
addRole
:
editRole
method
(
this
.
form
).
then
(
res
=>
{
this
.
$success
(
this
.
$t
(
'commons.save_success'
))
this
.
backToList
()
})
}
else
{
return
false
}
})
},
queryAllRoles
()
{
allRoles
().
then
(
res
=>
{
this
.
roles
=
res
.
data
})
},
nameRepeat
(
value
)
{
if
(
!
this
.
roles
||
this
.
roles
.
length
===
0
)
{
return
false
}
// 编辑场景 不能 因为名称重复而报错
if
(
this
.
formType
===
'modify'
&&
this
.
originName
===
value
)
{
return
false
}
return
this
.
roles
.
some
(
role
=>
role
.
name
===
value
)
},
roleValidator
(
rule
,
value
,
callback
)
{
if
(
!
value
||
value
.
length
===
0
)
{
callback
(
new
Error
(
'请输入名称'
))
}
else
if
(
this
.
nameRepeat
(
value
))
{
callback
(
new
Error
(
'角色名称已存在'
))
}
else
{
callback
()
}
},
backToList
()
{
this
.
$router
.
push
({
name
:
'system-role'
})
}
}
}
</
script
>
frontend/src/views/system/role/index.vue
deleted
100644 → 0
浏览文件 @
671b6f6c
<
template
>
<layout-content
v-loading=
"$store.getters.loadingMap[$store.getters.currentPath]"
>
<!--
<div
v-loading=
"result.loading"
style=
"height: 100%"
>
-->
<el-container
style=
"width: 100%; height: 100%;"
>
<el-aside
width=
"70%"
>
<complex-table
highlight-current-row
:data=
"tableData"
:columns=
"columns"
:search-config=
"searchConfig"
:pagination-config=
"paginationConfig"
@
search=
"search"
@
row-click=
"rowClick"
>
<template
#
toolbar
>
<el-button
v-permission=
"['role:add']"
icon=
"el-icon-circle-plus-outline"
@
click=
"create"
>
{{
$t
(
'role.add'
)
}}
</el-button>
</
template
>
<el-table-column
prop=
"name"
:label=
"$t('commons.name')"
/>
<el-table-column
:show-overflow-tooltip=
"true"
prop=
"description"
:label=
"$t('commons.description')"
/>
<el-table-column
:show-overflow-tooltip=
"true"
prop=
"createTime"
:label=
"$t('commons.create_time')"
>
<
template
v-slot:default=
"scope"
>
<span>
{{
scope
.
row
.
createTime
|
timestampFormatDate
}}
</span>
</
template
>
</el-table-column>
<fu-table-operations
:buttons=
"buttons"
:label=
"$t('commons.operating')"
fix
/>
</complex-table>
</el-aside>
<el-main
style=
"padding: 8px 20px;"
>
<el-tabs
v-model=
"activeName"
@
tab-click=
"handleClick"
>
<el-tab-pane
:label=
"$t('role.menu_authorization')"
name=
"first"
>
<el-tree
ref=
"menu"
lazy
:data=
"menus"
:default-checked-keys=
"menuIds"
:load=
"getMenuDatas"
:props=
"defaultProps"
check-strictly
show-checkbox
node-key=
"id"
@
check=
"menuChange"
/>
</el-tab-pane>
<el-tab-pane
:label=
"$t('role.data_authorization')"
name=
"second"
>
玩命开发中...
</el-tab-pane>
</el-tabs>
</el-main>
</el-container>
<el-dialog
:close-on-click-modal=
"false"
:title=
"formType=='add' ? $t('role.add') : $t('role.modify')"
:visible
.
sync=
"dialogVisible"
width=
"580px"
:destroy-on-close=
"true"
@
closed=
"closeFunc"
>
<el-form
ref=
"roleForm"
inline
:model=
"form"
:rules=
"rule"
size=
"small"
label-width=
"80px"
>
<el-form-item
label=
"角色名称"
prop=
"name"
>
<el-input
v-model=
"form.name"
style=
"width: 380px;"
/>
</el-form-item>
<!-- <el-form-item label="角色代码" prop="code">
<el-input v-model="form.code" style="width: 380px;" />
</el-form-item> -->
<el-form-item
label=
"描述信息"
prop=
"description"
>
<el-input
v-model=
"form.description"
style=
"width: 380px;"
rows=
"5"
type=
"textarea"
/>
</el-form-item>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
type=
"text"
@
click=
"dialogVisible = false"
>
{{ $t('commons.cancel') }}
</el-button>
<el-button
type=
"primary"
@
click=
"saveRole('roleForm')"
>
{{ $t('commons.confirm') }}
</el-button>
</div>
</el-dialog>
</layout-content>
</template>
<
script
>
import
LayoutContent
from
'@/components/business/LayoutContent'
import
ComplexTable
from
'@/components/business/complex-table'
import
{
formatCondition
,
formatQuickCondition
}
from
'@/utils/index'
import
{
addRole
,
editRole
,
delRole
,
roleGrid
,
addRoleMenus
,
menuIds
}
from
'@/api/system/role'
import
{
getMenusTree
,
getChild
}
from
'@/api/system/menu'
export
default
{
name
:
'Role'
,
components
:
{
LayoutContent
,
ComplexTable
},
data
()
{
return
{
tableData
:
[],
menus
:
[],
menuIds
:
[],
defaultProps
:
{
children
:
'children'
,
label
:
'label'
,
isLeaf
:
'isLeaf'
},
activeName
:
'first'
,
dialogVisible
:
false
,
formType
:
'add'
,
form
:
{},
rule
:
{
name
:
[
{
required
:
true
,
message
:
this
.
$t
(
'role.pls_input_name'
),
trigger
:
'blur'
}
],
code
:
[{
required
:
true
,
message
:
'请输入代码'
,
trigger
:
'blur'
}]
},
currentRow
:
null
,
permission
:
{
add
:
[
'role:add'
],
edit
:
[
'role:edit'
],
del
:
[
'role:del'
]
},
header
:
''
,
columns
:
[],
buttons
:
[
{
label
:
this
.
$t
(
'commons.edit'
),
icon
:
'el-icon-edit'
,
type
:
'primary'
,
click
:
this
.
edit
,
disabled
:
this
.
btnDisabled
},
{
label
:
this
.
$t
(
'commons.delete'
),
icon
:
'el-icon-delete'
,
type
:
'danger'
,
click
:
this
.
handleDelete
,
disabled
:
this
.
btnDisabled
}
],
searchConfig
:
{
useQuickSearch
:
true
,
quickPlaceholder
:
this
.
$t
(
'role.search_by_name'
),
components
:
[
{
field
:
'name'
,
label
:
this
.
$t
(
'role.role_name'
),
component
:
'FuComplexInput'
}
]
},
paginationConfig
:
{
currentPage
:
1
,
pageSize
:
10
,
total
:
0
}
}
},
watch
:
{
currentRow
:
'currentRowChange'
},
mounted
()
{
this
.
search
()
},
methods
:
{
handleClick
(
tab
,
event
)
{
// console.log(tab, event)
},
create
()
{
this
.
$router
.
push
({
name
:
'system-role-form'
})
},
search
(
condition
)
{
condition
=
formatQuickCondition
(
condition
,
'name'
)
const
temp
=
formatCondition
(
condition
)
const
param
=
temp
||
{}
roleGrid
(
this
.
paginationConfig
.
currentPage
,
this
.
paginationConfig
.
pageSize
,
param
).
then
(
response
=>
{
const
data
=
response
.
data
this
.
paginationConfig
.
total
=
data
.
itemCount
this
.
tableData
=
data
.
listObject
})
},
edit
(
row
)
{
this
.
$router
.
push
({
name
:
'system-role-form'
,
params
:
row
})
},
saveRole
(
roleForm
)
{
this
.
$refs
[
roleForm
].
validate
(
valid
=>
{
if
(
valid
)
{
const
method
=
this
.
formType
===
'add'
?
addRole
:
editRole
method
(
this
.
form
).
then
(
res
=>
{
this
.
$success
(
this
.
$t
(
'commons.save_success'
))
this
.
search
()
this
.
dialogVisible
=
false
})
}
else
{
return
false
}
})
},
closeFunc
()
{
this
.
dialogVisible
=
false
},
getMenuDatas
(
node
,
resolve
)
{
const
pid
=
node
.
data
.
id
?
node
.
data
.
id
:
'0'
getMenusTree
(
pid
).
then
(
res
=>
{
const
datas
=
res
.
data
const
nodes
=
datas
.
map
(
data
=>
this
.
formatNode
(
data
))
resolve
&&
resolve
(
nodes
)
})
},
formatNode
(
node
)
{
const
result
=
{
id
:
node
.
menuId
,
label
:
node
.
title
,
isLeaf
:
!
node
.
hasChildren
,
children
:
node
.
children
}
return
result
},
menuChange
(
menu
)
{
getChild
(
menu
.
id
).
then
(
res
=>
{
const
childIds
=
res
.
data
if
(
this
.
menuIds
.
indexOf
(
menu
.
id
)
!==
-
1
)
{
for
(
let
i
=
0
;
i
<
childIds
.
length
;
i
++
)
{
const
index
=
this
.
menuIds
.
indexOf
(
childIds
[
i
])
if
(
index
!==
-
1
)
{
this
.
menuIds
.
splice
(
index
,
1
)
}
}
}
else
{
for
(
let
i
=
0
;
i
<
childIds
.
length
;
i
++
)
{
const
index
=
this
.
menuIds
.
indexOf
(
childIds
[
i
])
if
(
index
===
-
1
)
{
this
.
menuIds
.
push
(
childIds
[
i
])
}
}
}
this
.
$refs
.
menu
.
setCheckedKeys
(
this
.
menuIds
)
this
.
saveMenus
()
})
},
saveMenus
()
{
if
(
!
this
.
currentRow
)
{
return
}
const
param
=
{
roleId
:
this
.
currentRow
.
roleId
,
menuIds
:
this
.
menuIds
}
addRoleMenus
(
param
).
then
(
res
=>
{
this
.
search
()
})
},
rowClick
(
row
,
column
,
event
)
{
menuIds
(
row
.
roleId
).
then
(
res
=>
{
const
menuIds
=
res
.
data
row
.
menuIds
=
menuIds
this
.
currentRow
=
row
})
},
currentRowChange
(
newVal
,
oldVal
)
{
if
(
newVal
===
oldVal
)
{
return
}
if
(
!
newVal
)
{
this
.
menuIds
=
[]
return
}
this
.
menuIds
=
newVal
.
menuIds
this
.
$refs
.
menu
.
setCheckedKeys
(
this
.
menuIds
)
},
handleDelete
(
row
)
{
this
.
$confirm
(
this
.
$t
(
'role.confirm_delete'
)
+
': '
+
row
.
name
+
'?'
,
this
.
$t
(
'role.tips'
),
{
confirmButtonText
:
this
.
$t
(
'commons.confirm'
),
cancelButtonText
:
this
.
$t
(
'commons.cancel'
),
type
:
'warning'
}).
then
(()
=>
{
delRole
(
row
.
roleId
).
then
(
res
=>
{
this
.
$success
(
this
.
$t
(
'commons.delete_success'
))
this
.
search
()
})
}).
catch
(()
=>
{
})
},
btnDisabled
(
row
)
{
return
!
row
.
updateTime
}
}
}
</
script
>
<
style
scoped
>
</
style
>
frontend/src/views/system/user/form.vue
浏览文件 @
a211b8b7
...
...
@@ -72,16 +72,11 @@
<
script
>
import
LayoutContent
from
'@/components/business/LayoutContent'
// import Treeselect from '@riophae/vue-treeselect'
// import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import
{
PHONE_REGEX
}
from
'@/utils/validate'
// import { LOAD_CHILDREN_OPTIONS, LOAD_ROOT_OPTIONS } from '@riophae/vue-treeselect'
import
{
getDeptTree
,
treeByDeptId
}
from
'@/api/system/dept'
import
{
allRoles
}
from
'@/api/system/role'
import
{
addUser
,
editUser
}
from
'@/api/system/user'
import
{
addUser
,
editUser
,
allRoles
}
from
'@/api/system/user'
export
default
{
// components: { LayoutContent, Treeselect },
components
:
{
LayoutContent
},
data
()
{
return
{
...
...
frontend/src/views/system/user/index.vue
浏览文件 @
a211b8b7
...
...
@@ -169,8 +169,8 @@ import { LOAD_CHILDREN_OPTIONS, LOAD_ROOT_OPTIONS } from '@riophae/vue-treeselec
import
Treeselect
from
'@riophae/vue-treeselect'
import
'@riophae/vue-treeselect/dist/vue-treeselect.css'
import
{
userLists
,
addUser
,
editUser
,
delUser
,
editPassword
,
editStatus
}
from
'@/api/system/user'
import
{
allRoles
}
from
'@/api/system/role'
import
{
userLists
,
addUser
,
editUser
,
delUser
,
editPassword
,
editStatus
,
allRoles
}
from
'@/api/system/user'
//
import { allRoles } from '@/api/system/role'
import
{
getDeptTree
,
treeByDeptId
}
from
'@/api/system/dept'
export
default
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论