Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
普蓝开源社区
盘古开发框架
提交
72ab2bb8
盘古开发框架
项目概览
普蓝开源社区
/
盘古开发框架
通知
25
Star
3
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
1
Wiki
分析
仓库
DevOps
项目成员
Pages
盘古开发框架
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
1
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
72ab2bb8
编写于
9月 09, 2022
作者:
X
xiongchun
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
代码优化
上级
0e029c6c
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
241 addition
and
128 deletion
+241
-128
pangu-admin/pangu-admin-backend/pangu-admin-system/pangu-admin-system-api/src/main/java/com/pulanit/pangu/admin/system/api/param/RoleIn.java
...java/com/pulanit/pangu/admin/system/api/param/RoleIn.java
+2
-6
pangu-admin/pangu-admin-backend/pangu-admin-system/pangu-admin-system-api/src/main/java/com/pulanit/pangu/admin/system/api/service/RoleService.java
...m/pulanit/pangu/admin/system/api/service/RoleService.java
+1
-2
pangu-admin/pangu-admin-backend/pangu-admin-system/pangu-admin-system-api/src/main/java/com/pulanit/pangu/admin/system/api/service/UserService.java
...m/pulanit/pangu/admin/system/api/service/UserService.java
+2
-2
pangu-admin/pangu-admin-backend/pangu-admin-system/pangu-admin-system-app/src/main/java/com/pulanit/pangu/admin/system/service/RoleServiceImpl.java
...m/pulanit/pangu/admin/system/service/RoleServiceImpl.java
+18
-8
pangu-admin/pangu-admin-backend/pangu-admin-system/pangu-admin-system-app/src/main/java/com/pulanit/pangu/admin/system/service/UserServiceImpl.java
...m/pulanit/pangu/admin/system/service/UserServiceImpl.java
+2
-2
pangu-admin/pangu-admin-backend/pangu-admin-web/src/main/java/com/pulanit/pangu/admin/web/system/RoleController.java
...va/com/pulanit/pangu/admin/web/system/RoleController.java
+67
-12
pangu-admin/pangu-admin-frontend/src/views/setting/role/index.vue
...min/pangu-admin-frontend/src/views/setting/role/index.vue
+16
-10
pangu-admin/pangu-admin-frontend/src/views/setting/role/save.vue
...dmin/pangu-admin-frontend/src/views/setting/role/save.vue
+104
-81
pangu-common/src/main/java/com/gitee/pulanos/pangu/framework/common/model/Page.java
.../com/gitee/pulanos/pangu/framework/common/model/Page.java
+0
-1
pangu-common/src/main/java/com/gitee/pulanos/pangu/framework/common/model/PageResult.java
...itee/pulanos/pangu/framework/common/model/PageResult.java
+0
-4
pangu-common/src/main/java/com/gitee/pulanos/pangu/framework/common/utils/PagingUtil.java
...itee/pulanos/pangu/framework/common/utils/PagingUtil.java
+29
-0
未找到文件。
pangu-admin/pangu-admin-backend/pangu-admin-system/pangu-admin-system-api/src/main/java/com/pulanit/pangu/admin/system/api/param/RoleIn.java
浏览文件 @
72ab2bb8
package
com.pulanit.pangu.admin.system.api.param
;
import
com.gitee.pulanos.pangu.framework.common.model.
My
Page
;
import
com.gitee.pulanos.pangu.framework.common.model.Page
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
import
java.io.Serializable
;
/**
* 角色查询入参
* @author xiongchun
*/
@Data
@Accessors
(
chain
=
true
)
public
class
RoleIn
extends
MyPage
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
public
class
RoleIn
extends
Page
{
/**
* 角色名称
...
...
pangu-admin/pangu-admin-backend/pangu-admin-system/pangu-admin-system-api/src/main/java/com/pulanit/pangu/admin/system/api/service/RoleService.java
浏览文件 @
72ab2bb8
package
com.pulanit.pangu.admin.system.api.service
;
import
com.gitee.pulanos.pangu.framework.common.model.MyPage
;
import
com.gitee.pulanos.pangu.framework.common.model.PageResult
;
import
com.pulanit.pangu.admin.system.api.entity.RoleEntity
;
import
com.pulanit.pangu.admin.system.api.param.RoleIn
;
...
...
@@ -19,7 +18,7 @@ public interface RoleService {
* @param roleIn
* @return
*/
MyPage
<
RoleEntity
>
list
(
RoleIn
roleIn
);
PageResult
<
RoleEntity
>
list
(
RoleIn
roleIn
);
/**
* 新增
...
...
pangu-admin/pangu-admin-backend/pangu-admin-system/pangu-admin-system-api/src/main/java/com/pulanit/pangu/admin/system/api/service/UserService.java
浏览文件 @
72ab2bb8
package
com.pulanit.pangu.admin.system.api.service
;
import
com.gitee.pulanos.pangu.framework.common.model.
MyPage
;
import
com.gitee.pulanos.pangu.framework.common.model.
PageResult
;
import
com.pulanit.pangu.admin.system.api.entity.UserEntity
;
import
com.pulanit.pangu.admin.system.api.param.LoginIn
;
import
com.pulanit.pangu.admin.system.api.param.LoginOut
;
...
...
@@ -21,7 +21,7 @@ public interface UserService {
* @param userIn
* @return
*/
MyPage
<
UserEntity
>
list
(
UserIn
userIn
);
PageResult
<
UserEntity
>
list
(
UserIn
userIn
);
/**
* 新增
...
...
pangu-admin/pangu-admin-backend/pangu-admin-system/pangu-admin-system-app/src/main/java/com/pulanit/pangu/admin/system/service/RoleServiceImpl.java
浏览文件 @
72ab2bb8
package
com.pulanit.pangu.admin.system.service
;
import
com.gitee.pulanos.pangu.framework.common.model.MyPage
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.gitee.pulanos.pangu.framework.common.model.PageResult
;
import
com.gitee.pulanos.pangu.framework.common.utils.PagingUtil
;
import
com.pulanit.pangu.admin.system.api.entity.RoleEntity
;
import
com.pulanit.pangu.admin.system.api.param.RoleIn
;
import
com.pulanit.pangu.admin.system.api.service.RoleService
;
...
...
@@ -19,28 +25,32 @@ public class RoleServiceImpl implements RoleService {
private
RoleMapper
roleMapper
;
@Override
public
MyPage
<
RoleEntity
>
list
(
RoleIn
roleIn
)
{
return
null
;
public
PageResult
<
RoleEntity
>
list
(
RoleIn
roleIn
)
{
Page
<
RoleEntity
>
page
=
PagingUtil
.
createPage
(
roleIn
);
LambdaQueryWrapper
<
RoleEntity
>
lambdaQueryWrapper
=
Wrappers
.
lambdaQuery
();
lambdaQueryWrapper
.
like
(
ObjectUtil
.
isNotEmpty
(
roleIn
.
getName
()),
RoleEntity:
:
getName
,
roleIn
.
getName
());
roleMapper
.
selectPage
(
page
,
lambdaQueryWrapper
);
return
PagingUtil
.
getPageResult
(
page
);
}
@Override
public
void
add
(
RoleEntity
roleEntity
)
{
roleEntity
.
setGmtCreated
(
DateUtil
.
date
());
roleMapper
.
insert
(
roleEntity
);
}
@Override
public
void
update
(
RoleEntity
roleEntity
)
{
roleEntity
.
setGmtModified
(
DateUtil
.
date
());
}
@Override
public
void
delete
(
Long
id
)
{
roleMapper
.
deleteById
(
id
);
}
@Override
public
void
batchDelete
(
List
<
Long
>
ids
)
{
roleMapper
.
deleteBatchIds
(
ids
);
}
}
pangu-admin/pangu-admin-backend/pangu-admin-system/pangu-admin-system-app/src/main/java/com/pulanit/pangu/admin/system/service/UserServiceImpl.java
浏览文件 @
72ab2bb8
...
...
@@ -18,7 +18,7 @@
package
com.pulanit.pangu.admin.system.service
;
import
cn.hutool.core.lang.UUID
;
import
com.gitee.pulanos.pangu.framework.common.model.
MyPage
;
import
com.gitee.pulanos.pangu.framework.common.model.
PageResult
;
import
com.pulanit.pangu.admin.system.api.dto.UserDto
;
import
com.pulanit.pangu.admin.system.api.entity.UserEntity
;
import
com.pulanit.pangu.admin.system.api.param.LoginIn
;
...
...
@@ -46,7 +46,7 @@ public class UserServiceImpl implements UserService {
}
@Override
public
MyPage
<
UserEntity
>
list
(
UserIn
userIn
)
{
public
PageResult
<
UserEntity
>
list
(
UserIn
userIn
)
{
return
null
;
}
...
...
pangu-admin/pangu-admin-backend/pangu-admin-web/src/main/java/com/pulanit/pangu/admin/web/system/RoleController.java
浏览文件 @
72ab2bb8
package
com.pulanit.pangu.admin.web.system
;
import
cn.hutool.core.io.resource.ResourceUtil
;
import
cn.hutool.core.util.CharsetUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
cn.hutool.core.lang.Assert
;
import
com.gitee.pulanos.pangu.framework.common.model.PageResult
;
import
com.gitee.pulanos.pangu.framework.common.model.Result
;
import
com.pulanit.pangu.admin.system.api.entity.RoleEntity
;
import
com.pulanit.pangu.admin.system.api.param.RoleIn
;
import
com.pulanit.pangu.admin.system.api.service.RoleService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.apache.dubbo.config.annotation.Reference
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
/**
* 角色
...
...
@@ -22,15 +22,70 @@ import org.springframework.web.bind.annotation.RestController;
@RequestMapping
(
"/api/system/role"
)
public
class
RoleController
{
@Reference
(
version
=
"1.0.0"
,
group
=
"pangu-admin-system-app"
)
private
RoleService
roleService
;
/**
* 获取角色
* @return
*/
@GetMapping
(
"/list"
)
public
Result
<
JSONObject
>
list
()
{
String
roles
=
ResourceUtil
.
readStr
(
"json/role.json"
,
CharsetUtil
.
CHARSET_UTF_8
);
JSONObject
jsonObject
=
JSON
.
parseObject
(
roles
);
return
Result
.
success
(
jsonObject
);
public
Result
<
PageResult
<
RoleEntity
>>
list
(
RoleIn
roleIn
)
{
PageResult
<
RoleEntity
>
pageResult
=
roleService
.
list
(
roleIn
);
return
Result
.
success
(
pageResult
);
}
/**
* 新增
*
* @param roleEntity
* @return
*/
@PostMapping
(
"/add"
)
public
Result
<
Void
>
add
(
@RequestBody
RoleEntity
roleEntity
)
{
roleService
.
add
(
roleEntity
);
return
Result
.
success
();
}
/**
* 修改
*
* @param roleEntity
* @return
*/
@PostMapping
(
"/update"
)
public
Result
<
Void
>
update
(
@RequestBody
RoleEntity
roleEntity
)
{
Assert
.
notNull
(
roleEntity
.
getId
(),
"部门 ID 不能为空"
);
roleService
.
update
(
roleEntity
);
return
Result
.
success
();
}
/**
* 删除
*
* @param id
* @return
*/
@PostMapping
(
"/delete"
)
public
Result
<
Void
>
delete
(
@RequestParam
Long
id
)
{
Assert
.
notNull
(
id
,
"角色 ID 不能为空"
);
roleService
.
delete
(
id
);
return
Result
.
success
();
}
/**
* 批量删除
*
* @param ids
* @return
*/
@PostMapping
(
"/batchDelete"
)
public
Result
<
Void
>
batchDelete
(
@RequestParam
List
<
Long
>
ids
)
{
Assert
.
notEmpty
(
ids
,
"角色 ID 不能为空"
);
roleService
.
batchDelete
(
ids
);
return
Result
.
success
();
}
}
pangu-admin/pangu-admin-frontend/src/views/setting/role/index.vue
浏览文件 @
72ab2bb8
...
...
@@ -8,7 +8,7 @@
</div>
<div
class=
"right-panel"
>
<div
class=
"right-panel-search"
>
<el-input
v-model=
"search.
keyword
"
placeholder=
"角色名称"
clearable
></el-input>
<el-input
v-model=
"search.
name
"
placeholder=
"角色名称"
clearable
></el-input>
<el-button
type=
"primary"
icon=
"el-icon-search"
@
click=
"upsearch"
></el-button>
</div>
</div>
...
...
@@ -17,20 +17,26 @@
<scTable
ref=
"table"
:apiObj=
"apiObj"
row-key=
"id"
@
selection-change=
"selectionChange"
stripe
>
<el-table-column
type=
"selection"
width=
"50"
></el-table-column>
<el-table-column
label=
"#"
type=
"index"
width=
"50"
></el-table-column>
<el-table-column
label=
"角色名称"
prop=
"label"
width=
"150"
></el-table-column>
<el-table-column
label=
"别名"
prop=
"alias"
width=
"200"
></el-table-column>
<el-table-column
label=
"排序"
prop=
"sort"
width=
"80"
></el-table-column>
<el-table-column
label=
"状态"
prop=
"status"
width=
"80"
>
<el-table-column
label=
"角色名称"
prop=
"name"
width=
"150"
></el-table-column>
<el-table-column
label=
"角色标识"
prop=
"key"
width=
"200"
></el-table-column>
<el-table-column
label=
"角色状态"
prop=
"status"
width=
"150"
>
<template
#default
="
scope
"
>
<el-switch
v-model=
"scope.row.status"
@
change=
"changeSwitch($event, scope.row)"
:loading=
"scope.row.$switch_status"
active-value=
"1"
inactive-value=
"0"
></el-switch>
<el-tag
v-if=
"scope.row.status==1"
type=
"success"
>
启用
</el-tag>
<el-tag
v-if=
"scope.row.status==9"
type=
"danger"
>
停用
</el-tag>
</
template
>
</el-table-column>
<el-table-column
label=
"创建时间"
prop=
"date"
width=
"180"
></el-table-column>
<el-table-column
label=
"备注"
prop=
"remark"
min-width=
"150"
></el-table-column>
<el-table-column
label=
"角色类型"
prop=
"type"
width=
"150"
>
<
template
#default=
"scope"
>
<el-tag
v-if=
"scope.row.type==1"
type=
"info"
>
缺省
</el-tag>
</
template
>
</el-table-column>
<el-table-column
label=
"扩展码"
prop=
"bizCode"
width=
"150"
></el-table-column>
<el-table-column
label=
"创建时间"
prop=
"gmtCreated"
width=
"180"
></el-table-column>
<el-table-column
label=
"备注"
prop=
"remark"
width=
"200"
></el-table-column>
<el-table-column
label=
"操作"
fixed=
"right"
align=
"right"
width=
"170"
>
<
template
#default=
"scope"
>
<el-button-group>
<
el-button
text
type=
"primary"
size=
"small"
@
click=
"table_show(scope.row, scope.$index)"
>
查看
</el-button
>
<
!--
<el-button
text
type=
"primary"
size=
"small"
@
click=
"table_show(scope.row, scope.$index)"
>
查看
</el-button>
--
>
<el-button
text
type=
"primary"
size=
"small"
@
click=
"table_edit(scope.row, scope.$index)"
>
编辑
</el-button>
<el-popconfirm
title=
"确定删除吗?"
@
confirm=
"table_del(scope.row, scope.$index)"
>
<template
#reference
>
...
...
@@ -70,7 +76,7 @@
apiObj
:
this
.
$API
.
system
.
role
.
list
,
selection
:
[],
search
:
{
keyword
:
null
name
:
null
}
}
},
...
...
pangu-admin/pangu-admin-frontend/src/views/setting/role/save.vue
浏览文件 @
72ab2bb8
<
template
>
<el-dialog
:title=
"titleMap[mode]"
v-model=
"visible"
:width=
"500"
destroy-on-close
@
closed=
"$emit('closed')"
>
<el-form
:model=
"form"
:rules=
"rules"
:disabled=
"mode=='show'"
ref=
"dialogForm"
label-width=
"100px"
label-position=
"left"
>
<el-form-item
label=
"角色名称"
prop=
"label"
>
<el-input
v-model=
"form.label"
clearable
></el-input>
<el-form
:model=
"form"
:rules=
"rules"
:disabled=
"mode == 'show'"
ref=
"dialogForm"
label-width=
"100px"
label-position=
"left"
>
<el-form-item
label=
"角色名称"
prop=
"name"
>
<el-input
v-model=
"form.name"
clearable
></el-input>
</el-form-item>
<el-form-item
label=
"角色
别名"
prop=
"alias
"
>
<el-input
v-model=
"form.
alias
"
clearable
></el-input>
<el-form-item
label=
"角色
标识"
prop=
"key
"
>
<el-input
v-model=
"form.
key
"
clearable
></el-input>
</el-form-item>
<el-form-item
label=
"排序"
prop=
"sort"
>
<el-input-number
v-model=
"form.sort"
controls-position=
"right"
:min=
"1"
style=
"width: 100%;"
></el-input-number>
<el-form-item
label=
"角色类型"
prop=
"type"
>
<el-select
v-model=
"form.type"
class=
"m-2"
placeholder=
"Select"
style=
"width: 100%;"
>
<el-option
v-for=
"item in typeItems"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
/>
</el-select>
</el-form-item>
<el-form-item
label=
"是否有效"
prop=
"status"
>
<el-switch
v-model=
"form.status"
active-value=
"1"
inactive-value=
"0"
></el-switch>
<el-form-item
label=
"角色状态"
prop=
"status"
>
<el-select
v-model=
"form.status"
class=
"m-2"
placeholder=
"Select"
style=
"width: 100%;"
>
<el-option
v-for=
"item in statusItems"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
/>
</el-select>
</el-form-item>
<el-form-item
label=
"扩展码"
prop=
"bizCode"
>
<el-input
v-model=
"form.bizCode"
placeholder=
"请输入业务扩展码"
clearable
></el-input>
</el-form-item>
<el-form-item
label=
"备注"
prop=
"remark"
>
<el-input
v-model=
"form.remark"
clearable
type=
"textarea"
></el-input>
</el-form-item>
</el-form>
<template
#footer
>
<el-button
@
click=
"visible
=false"
>
取 消
</el-button>
<el-button
v-if=
"mode
!=
'show'"
type=
"primary"
:loading=
"isSaveing"
@
click=
"submit()"
>
保 存
</el-button>
<el-button
@
click=
"visible
= false"
>
取 消
</el-button>
<el-button
v-if=
"mode
!=
'show'"
type=
"primary"
:loading=
"isSaveing"
@
click=
"submit()"
>
保 存
</el-button>
</
template
>
</el-dialog>
</template>
<
script
>
export
default
{
emits
:
[
'
success
'
,
'
closed
'
],
data
()
{
return
{
mode
:
"
add
"
,
titleMap
:
{
add
:
'
新增
'
,
edit
:
'
编辑
'
,
show
:
'
查看
'
},
visible
:
false
,
isSaveing
:
false
,
//表单数据
form
:
{
id
:
""
,
label
:
""
,
alias
:
""
,
sort
:
1
,
status
:
1
,
remark
:
""
},
//验证规则
rules
:
{
sort
:
[
{
required
:
true
,
message
:
'
请输入排序
'
,
trigger
:
'
change
'
}
],
label
:
[
{
required
:
true
,
message
:
'
请输入角色名称
'
}
],
alias
:
[
{
required
:
true
,
message
:
'
请输入角色别名
'
}
]
}
}
},
mounted
()
{
export
default
{
emits
:
[
'
success
'
,
'
closed
'
],
data
()
{
return
{
mode
:
"
add
"
,
titleMap
:
{
add
:
'
新增角色
'
,
edit
:
'
编辑角色
'
,
show
:
'
查看角色
'
},
visible
:
false
,
isSaveing
:
false
,
//表单数据
form
:
{
id
:
""
,
name
:
""
,
key
:
""
,
status
:
'
1
'
,
type
:
'
1
'
,
bizCode
:
""
,
remark
:
""
},
//验证规则
rules
:
{
status
:
[
{
required
:
true
,
message
:
'
角色状态不能为空
'
}
],
type
:
[
{
required
:
true
,
message
:
'
角色类型不能为空
'
}
],
name
:
[
{
required
:
true
,
message
:
'
角色名称不能为空
'
}
],
key
:
[
{
required
:
true
,
message
:
'
角色标识不能为空
'
}
]
},
typeItems
:
[{
value
:
'
1
'
,
label
:
'
缺省
'
,
}],
statusItems
:
[{
value
:
'
1
'
,
label
:
'
启用
'
,
},{
value
:
'
9
'
,
label
:
'
停用
'
,
}],
}
},
mounted
()
{
},
methods
:
{
//显示
open
(
mode
=
'
add
'
)
{
this
.
mode
=
mode
;
this
.
visible
=
true
;
return
this
},
methods
:
{
//显示
open
(
mode
=
'
add
'
){
this
.
mode
=
mode
;
this
.
visible
=
true
;
return
this
},
//表单提交方法
submit
(){
this
.
$refs
.
dialogForm
.
validate
(
async
(
valid
)
=>
{
if
(
valid
)
{
this
.
isSaveing
=
true
;
var
res
=
await
this
.
$API
.
demo
.
post
.
post
(
this
.
form
);
this
.
isSaveing
=
false
;
if
(
res
.
code
==
200
){
this
.
$emit
(
'
success
'
,
this
.
form
,
this
.
mode
)
this
.
visible
=
false
;
this
.
$message
.
success
(
"
操作成功
"
)
}
else
{
this
.
$alert
(
res
.
message
,
"
提示
"
,
{
type
:
'
error
'
})
}
//表单提交方法
submit
()
{
this
.
$refs
.
dialogForm
.
validate
(
async
(
valid
)
=>
{
if
(
valid
)
{
this
.
isSaveing
=
true
;
var
res
=
await
this
.
$API
.
demo
.
post
.
post
(
this
.
form
);
this
.
isSaveing
=
false
;
if
(
res
.
code
==
200
)
{
this
.
$emit
(
'
success
'
,
this
.
form
,
this
.
mode
)
this
.
visible
=
false
;
this
.
$message
.
success
(
"
操作成功
"
)
}
else
{
this
.
$alert
(
res
.
message
,
"
提示
"
,
{
type
:
'
error
'
})
}
})
},
//表单注入数据
setData
(
data
){
this
.
form
.
id
=
data
.
id
this
.
form
.
label
=
data
.
label
this
.
form
.
alias
=
data
.
alias
this
.
form
.
sort
=
data
.
sort
this
.
form
.
status
=
data
.
status
this
.
form
.
remark
=
data
.
remark
}
})
},
//表单注入数据
setData
(
data
)
{
this
.
form
.
id
=
data
.
id
this
.
form
.
label
=
data
.
label
this
.
form
.
alias
=
data
.
alias
this
.
form
.
sort
=
data
.
sort
this
.
form
.
status
=
data
.
status
this
.
form
.
remark
=
data
.
remark
//可以和上面一样单个注入,也可以像下面一样直接合并进去
//Object.assign(this.form, data)
}
//可以和上面一样单个注入,也可以像下面一样直接合并进去
//Object.assign(this.form, data)
}
}
}
</
script
>
<
style
>
...
...
pangu-common/src/main/java/com/gitee/pulanos/pangu/framework/common/model/Page.java
浏览文件 @
72ab2bb8
...
...
@@ -22,5 +22,4 @@ public class Page implements Serializable {
private
long
pageSize
;
}
pangu-common/src/main/java/com/gitee/pulanos/pangu/framework/common/model/PageResult.java
浏览文件 @
72ab2bb8
...
...
@@ -33,8 +33,4 @@ public class PageResult<T> implements Serializable {
private
Map
<
String
,
String
>
summary
=
Collections
.
EMPTY_MAP
;
public
static
<
T
>
PageResult
<
T
>
of
(
Page
<
T
>
page
)
{
return
new
PageResult
<
T
>().
setPage
(
page
.
getCurrent
()).
setPageSize
(
page
.
getSize
()).
setTotal
(
page
.
getTotal
()).
setRows
(
page
.
getRecords
());
}
}
pangu-common/src/main/java/com/gitee/pulanos/pangu/framework/common/utils/PagingUtil.java
0 → 100644
浏览文件 @
72ab2bb8
package
com.gitee.pulanos.pangu.framework.common.utils
;
import
cn.hutool.core.util.ReflectUtil
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.gitee.pulanos.pangu.framework.common.model.PageResult
;
/**
* Paging Utils
*
* @author xiongchun
* @since 4.1.0
*/
public
class
PagingUtil
{
public
static
Page
createPage
(
long
page
,
long
pageSize
){
return
new
Page
(
page
,
pageSize
);
}
public
static
Page
createPage
(
Object
obj
){
long
page
=
Long
.
valueOf
(
ReflectUtil
.
getFieldValue
(
obj
,
"page"
).
toString
());
long
pageSize
=
Long
.
valueOf
(
ReflectUtil
.
getFieldValue
(
obj
,
"pageSize"
).
toString
());
return
createPage
(
page
,
pageSize
);
}
public
static
PageResult
getPageResult
(
Page
page
)
{
return
new
PageResult
().
setPage
(
page
.
getCurrent
()).
setPageSize
(
page
.
getSize
()).
setTotal
(
page
.
getTotal
()).
setRows
(
page
.
getRecords
());
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录