Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibzou
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibzou
提交
babfc16f
提交
babfc16f
编写于
5月 26, 2020
作者:
ibizdev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
lab_qyk 发布系统代码
上级
91ef056f
变更
18
展开全部
隐藏空白字符变更
内嵌
并排
正在显示
18 个修改的文件
包含
559 行增加
和
240 行删除
+559
-240
package.json
app_web/package.json
+2
-0
ibiz-group-picker.vue
...eb/src/components/ibiz-group-picker/ibiz-group-picker.vue
+25
-6
ibiz-group-select.vue
...eb/src/components/ibiz-group-select/ibiz-group-select.vue
+14
-3
util.d.ts
app_web/src/utils/types/util.d.ts
+11
-0
util.ts
app_web/src/utils/util/util.ts
+20
-0
edit-grid-grid-base.vue
...gets/ibzdepartment/edit-grid-grid/edit-grid-grid-base.vue
+97
-58
main-form-base.vue
...eb/src/widgets/ibzdepartment/main-form/main-form-base.vue
+3
-2
main-grid-base.vue
...eb/src/widgets/ibzdepartment/main-grid/main-grid-base.vue
+58
-14
main-grid-base.vue
...b/src/widgets/ibzdept-member/main-grid/main-grid-base.vue
+65
-21
edit-grid-grid-base.vue
...idgets/ibzemployee/edit-grid-grid/edit-grid-grid-base.vue
+110
-71
main-grid-base.vue
app_web/src/widgets/ibzemployee/main-grid/main-grid-base.vue
+60
-16
main-grid-base.vue
.../src/widgets/ibzorganization/main-grid/main-grid-base.vue
+57
-13
h2_table.xml
ibzou-core/src/main/resources/liquibase/h2_table.xml
+3
-3
IBZDepartmentResource.java
.../main/java/cn/ibizlab/api/rest/IBZDepartmentResource.java
+4
-6
IBZDeptMemberResource.java
.../main/java/cn/ibizlab/api/rest/IBZDeptMemberResource.java
+1
-3
IBZEmployeeResource.java
...rc/main/java/cn/ibizlab/api/rest/IBZEmployeeResource.java
+4
-6
IBZOrganizationResource.java
...ain/java/cn/ibizlab/api/rest/IBZOrganizationResource.java
+4
-6
AuthPermissionEvaluator.java
...ava/cn/ibizlab/util/security/AuthPermissionEvaluator.java
+21
-12
未找到文件。
app_web/package.json
浏览文件 @
babfc16f
...
...
@@ -18,6 +18,8 @@
"@fullcalendar/list"
:
"^4.4.0"
,
"@fullcalendar/timegrid"
:
"^4.4.0"
,
"@fullcalendar/vue"
:
"^4.4.0"
,
"vuedraggable"
:
"^2.23.2"
,
"async-validator"
:
"^3.3.0"
,
"axios"
:
"^0.19.1"
,
"core-js"
:
"^3.4.4"
,
"echarts"
:
"^4.6.0"
,
...
...
app_web/src/components/ibiz-group-picker/ibiz-group-picker.vue
浏览文件 @
babfc16f
...
...
@@ -47,6 +47,22 @@ export default class IBizGroupPicker extends Vue {
*/
protected
multiple
:
boolean
=
false
;
/**
* 加载树url
*
* @type {*}
* @memberof IBizGroupPicker
*/
protected
treeurl
:
any
;
/**
* 加载人员url
*
* @type {*}
* @memberof IBizGroupPicker
*/
protected
url
:
any
;
/**
* 树数据集
*
...
...
@@ -110,10 +126,9 @@ export default class IBizGroupPicker extends Vue {
* @memberof IBizGroupPicker
*/
get
showTree
()
{
if
(
this
.
viewParam
.
hasfilter
&&
Object
.
is
(
this
.
viewData
.
srforgid
,
this
.
viewParam
.
filtervalue
)
)
{
return
fals
e
;
if
(
this
.
viewParam
)
{
return
this
.
viewParam
.
showtre
e
;
}
return
true
;
}
/**
...
...
@@ -129,6 +144,8 @@ export default class IBizGroupPicker extends Vue {
this
.
viewData
=
JSON
.
parse
(
this
.
viewdata
);
this
.
viewParam
=
JSON
.
parse
(
this
.
viewparam
);
this
.
multiple
=
this
.
viewParam
.
multiple
;
this
.
treeurl
=
this
.
viewParam
.
treeurl
;
this
.
url
=
this
.
viewParam
.
url
;
if
(
this
.
viewParam
.
selects
)
{
this
.
viewParam
.
selects
.
forEach
((
select
:
any
)
=>
{
this
.
selects
.
push
(
select
);
...
...
@@ -159,8 +176,9 @@ export default class IBizGroupPicker extends Vue {
* @memberof IBizGroupPicker
*/
public
loadTree
()
{
let
orgid
=
this
.
viewParam
.
filtervalue
?
this
.
viewParam
.
filtervalue
:
"alls"
;
let
get
=
Http
.
getInstance
().
get
(
`/ibzorganizations/
${
orgid
}
/suborg/ibzdepartments/picker`
,
true
);
let
orgid
=
this
.
viewParam
.
filtervalue
;
let
tempTreeUrl
:
string
=
this
.
treeurl
.
replace
(
'${orgid}'
,
orgid
);
let
get
=
Http
.
getInstance
().
get
(
tempTreeUrl
,
true
);
get
.
then
((
response
:
any
)
=>
{
if
(
response
.
status
===
200
)
{
this
.
treeItems
=
response
.
data
;
...
...
@@ -177,7 +195,8 @@ export default class IBizGroupPicker extends Vue {
* @memberof IBizGroupPicker
*/
public
loadGroupData
(
key
:
string
)
{
let
get
=
Http
.
getInstance
().
get
(
`/ibzorganizations/
${
key
}
/ibzemployees/picker`
,
true
);
let
tempUrl
=
this
.
url
.
replace
(
'${selected-orgid}'
,
key
);
let
get
=
Http
.
getInstance
().
get
(
tempUrl
,
true
);
get
.
then
((
response
:
any
)
=>
{
if
(
response
.
status
===
200
)
{
this
.
cardItems
=
response
.
data
;
...
...
app_web/src/components/ibiz-group-select/ibiz-group-select.vue
浏览文件 @
babfc16f
...
...
@@ -32,13 +32,21 @@ export default class IBizGroupSelect extends Vue {
*/
@
Prop
()
name
!
:
string
;
/**
* 树加载地址
*
* @type {*}
* @memberof IBizGroupSelect
*/
@
Prop
()
treeurl
?:
boolean
;
/**
* 数据接口地址
*
* @type {*}
* @memberof IBizGroupSelect
*/
@
Prop
()
url
?
:
string
;
@
Prop
()
url
!
:
string
;
/**
* 多选
...
...
@@ -175,10 +183,14 @@ export default class IBizGroupSelect extends Vue {
}
else
{
filtervalue
=
context
.
srforgid
;
}
}
else
{
filtervalue
=
context
.
srforgid
;
}
const
param
:
any
=
{};
Object
.
assign
(
param
,
{
hasfilter
:
this
.
filter
?
true
:
false
,
showtree
:
this
.
treeurl
?
true
:
false
,
url
:
this
.
url
,
treeurl
:
this
.
treeurl
,
filtervalue
:
filtervalue
,
multiple
:
this
.
multiple
,
selects
:
this
.
selects
...
...
@@ -199,7 +211,6 @@ export default class IBizGroupSelect extends Vue {
* @memberof IBizGroupSelect
*/
public
openViewClose
(
result
:
any
)
{
console
.
log
(
result
)
this
.
selects
=
[];
if
(
result
.
datas
&&
result
.
datas
.
length
>
0
)
{
this
.
selects
=
result
.
datas
...
...
app_web/src/utils/types/util.d.ts
浏览文件 @
babfc16f
...
...
@@ -138,6 +138,17 @@ export declare interface Util {
* @memberof Util
*/
dateFormat
(
date
:
any
,
fmt
?:
string
):
string
/**
* 表单项校验
*
* @param property 表单项属性名
* @param data 表单数据
* @param rules 表单值规则
* @returns {Promise}
* @memberof Util
*/
validateItem
(
property
:
string
,
data
:
any
,
rules
:
any
):
Promise
<
any
>
}
declare
module
"vue/types/vue"
{
...
...
app_web/src/utils/util/util.ts
浏览文件 @
babfc16f
import
qs
from
'qs'
;
import
{
Route
}
from
'vue-router'
;
import
Schema
from
"async-validator"
;
/**
* 平台工具类
...
...
@@ -362,4 +363,23 @@ export class Util {
return
FirstOBJ
;
}
/**
* 表单项校验
*
* @param property 表单项属性名
* @param data 表单数据
* @param rules 表单值规则
* @returns {Promise}
* @memberof Util
*/
public
static
validateItem
(
property
:
string
,
data
:
any
,
rules
:
any
)
{
// 1.获取数值和规则
const
value
=
data
[
property
];
const
rule
=
rules
[
property
];
// 2.创建校验规则
const
schema
=
new
Schema
({
[
property
]:
rule
})
// 校验返回Promise
return
schema
.
validate
({
[
property
]:
value
})
}
}
\ No newline at end of file
app_web/src/widgets/ibzdepartment/edit-grid-grid/edit-grid-grid-base.vue
浏览文件 @
babfc16f
此差异已折叠。
点击以展开。
app_web/src/widgets/ibzdepartment/main-form/main-form-base.vue
浏览文件 @
babfc16f
...
...
@@ -49,8 +49,9 @@
<app-form-item
name=
'leadername'
:itemRules=
"this.rules.leadername"
class=
''
:caption=
"$t('entities.ibzdepartment.main_form.details.leadername')"
uiStyle=
"DEFAULT"
:labelWidth=
"130"
:isShowCaption=
"true"
:error=
"detailsModel.leadername.error"
:isEmptyCaption=
"false"
labelPos=
"LEFT"
>
<ibiz-group-select
name=
"leadername"
:showtree=
"true"
url=
"/ibzorganizations/$
{orgid}/ibzemployees/picker"
:value=
'data.leadername'
valueitem=
"leaderid"
url=
"/ibzorganizations/$
{selected-orgid}/ibzemployees/picker"
treeurl="/ibzorganizations/${orgid}/suborg/picker"
:multiple="true"
filter="srforgid"
...
...
app_web/src/widgets/ibzdepartment/main-grid/main-grid-base.vue
浏览文件 @
babfc16f
<
template
>
<div
class=
'grid'
style=
"height:100%;"
>
<el-table
v-if=
"isDisplay === true"
<i-form>
<el-table
v-if=
"isDisplay === true"
:default-sort=
"
{ prop: minorSortPSDEF, order: Object.is(minorSortDir, 'ASC') ? 'ascending' : Object.is(minorSortDir, 'DESC') ? 'descending' : '' }"
@sort-change="onSortChange($event)"
:border="isDragendCol"
...
...
@@ -28,7 +29,7 @@
{{
$t
(
'entities.ibzdepartment.main_grid.columns.deptid'
)
}}
</span>
</
template
>
<
template
v-slot=
"{row,column}"
>
<
template
v-slot=
"{row,column
,$index
}"
>
<span>
{{
row
.
deptid
}}
</span>
</
template
>
</el-table-column>
...
...
@@ -40,7 +41,7 @@
{{
$t
(
'entities.ibzdepartment.main_grid.columns.deptcode'
)
}}
</span>
</
template
>
<
template
v-slot=
"{row,column}"
>
<
template
v-slot=
"{row,column
,$index
}"
>
<span>
{{
row
.
deptcode
}}
</span>
</
template
>
</el-table-column>
...
...
@@ -52,7 +53,7 @@
{{
$t
(
'entities.ibzdepartment.main_grid.columns.deptname'
)
}}
</span>
</
template
>
<
template
v-slot=
"{row,column}"
>
<
template
v-slot=
"{row,column
,$index
}"
>
<span>
{{
row
.
deptname
}}
</span>
</
template
>
</el-table-column>
...
...
@@ -64,7 +65,7 @@
{{
$t
(
'entities.ibzdepartment.main_grid.columns.shortname'
)
}}
</span>
</
template
>
<
template
v-slot=
"{row,column}"
>
<
template
v-slot=
"{row,column
,$index
}"
>
<span>
{{
row
.
shortname
}}
</span>
</
template
>
</el-table-column>
...
...
@@ -76,7 +77,7 @@
{{
$t
(
'entities.ibzdepartment.main_grid.columns.deptlevel'
)
}}
</span>
</
template
>
<
template
v-slot=
"{row,column}"
>
<
template
v-slot=
"{row,column
,$index
}"
>
<span>
{{
row
.
deptlevel
}}
</span>
</
template
>
</el-table-column>
...
...
@@ -88,7 +89,7 @@
{{
$t
(
'entities.ibzdepartment.main_grid.columns.bcode'
)
}}
</span>
</
template
>
<
template
v-slot=
"{row,column}"
>
<
template
v-slot=
"{row,column
,$index
}"
>
<span>
{{
row
.
bcode
}}
</span>
</
template
>
</el-table-column>
...
...
@@ -100,7 +101,7 @@
{{
$t
(
'entities.ibzdepartment.main_grid.columns.showorder'
)
}}
</span>
</
template
>
<
template
v-slot=
"{row,column}"
>
<
template
v-slot=
"{row,column
,$index
}"
>
<span>
{{
row
.
showorder
}}
</span>
</
template
>
</el-table-column>
...
...
@@ -112,7 +113,7 @@
{{
$t
(
'entities.ibzdepartment.main_grid.columns.createdate'
)
}}
</span>
</
template
>
<
template
v-slot=
"{row,column}"
>
<
template
v-slot=
"{row,column
,$index
}"
>
<app-format-data
format=
"YYYY-MM-DD hh:mm:ss"
:data=
"row.createdate"
></app-format-data>
</
template
>
</el-table-column>
...
...
@@ -124,7 +125,7 @@
{{
$t
(
'entities.ibzdepartment.main_grid.columns.updatedate'
)
}}
</span>
</
template
>
<
template
v-slot=
"{row,column}"
>
<
template
v-slot=
"{row,column
,$index
}"
>
<app-format-data
format=
"YYYY-MM-DD hh:mm:ss"
:data=
"row.updatedate"
></app-format-data>
</
template
>
</el-table-column>
...
...
@@ -133,6 +134,7 @@
<el-table-column></el-table-column>
</
template
>
</el-table>
</i-form>
<row
class=
'grid-pagination'
v-show=
"items.length > 0"
>
<page
class=
'pull-right'
@
on-change=
"pageOnChange($event)"
@
on-page-size-change=
"onPageSizeChange($event)"
...
...
@@ -180,6 +182,7 @@ import IBZDepartmentService from '@/service/ibzdepartment/ibzdepartment-service'
import
MainService
from
'./main-grid-service'
;
import
CodeListService
from
"@service/app/codelist-service"
;
import
{
FormItemModel
}
from
'@/model/form-detail'
;
@
Component
({
...
...
@@ -669,6 +672,26 @@ export default class MainBase extends Vue implements ControlInterface {
},
]
/**
* 表格模型集合
*
* @type {*}
* @memberof Main
*/
public
gridItemsModel
:
any
[]
=
[];
/**
* 获取表格行模型
*
* @type {*}
* @memberof Main
*/
public
getGridRowModel
(){
return
{
srfkey
:
new
FormItemModel
(),
}
}
/**
* 属性值规则
*
...
...
@@ -682,6 +705,23 @@ export default class MainBase extends Vue implements ControlInterface {
],
}
/**
* 表格行编辑项校验
*
* @param {string} property 属性名
* @param {*} data 行数据
* @param {number} rowIndex 行索引
*
* @memberof Main
*/
public
validtor
(
property
:
string
,
data
:
any
,
rowIndex
:
number
){
this
.
$util
.
validateItem
(
property
,
data
,
this
.
rules
).
then
(()
=>
{
this
.
gridItemsModel
[
rowIndex
][
property
].
setError
(
null
);
}).
catch
(({
errors
,
fields
})
=>
{
this
.
gridItemsModel
[
rowIndex
][
property
].
setError
(
errors
[
0
].
message
);
});
}
/**
* 表格数据加载
*
...
...
@@ -724,8 +764,10 @@ export default class MainBase extends Vue implements ControlInterface {
const
data
:
any
=
response
.
data
;
this
.
totalrow
=
response
.
total
;
this
.
items
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
// 清空selections
// 清空selections
,gridItemsModel
this
.
selections
=
[];
this
.
gridItemsModel
=
[];
this
.
items
.
forEach
(()
=>
{
this
.
gridItemsModel
.
push
(
this
.
getGridRowModel
())});
this
.
$emit
(
'load'
,
this
.
items
);
// 设置默认选中
let
_this
=
this
;
...
...
@@ -774,6 +816,7 @@ export default class MainBase extends Vue implements ControlInterface {
this
.
items
.
some
((
val
:
any
,
num
:
number
)
=>
{
if
(
JSON
.
stringify
(
val
)
==
JSON
.
stringify
(
record
)){
this
.
items
.
splice
(
num
,
1
);
this
.
gridItemsModel
.
splice
(
num
,
1
);
return
true
;
}
});
...
...
@@ -823,9 +866,10 @@ export default class MainBase extends Vue implements ControlInterface {
//删除items中已删除的项
console
.
log
(
this
.
items
);
_datas
.
forEach
((
data
:
any
)
=>
{
this
.
items
.
some
((
item
:
any
,
index
:
number
)
=>
{
if
(
Object
.
is
(
item
.
srfkey
,
data
.
srfkey
)){
this
.
items
.
splice
(
index
,
1
);
this
.
items
.
some
((
item
:
any
,
index
:
number
)
=>
{
if
(
Object
.
is
(
item
.
srfkey
,
data
.
srfkey
)){
this
.
items
.
splice
(
index
,
1
);
this
.
gridItemsModel
.
splice
(
index
,
1
);
return
true
;
}
});
...
...
app_web/src/widgets/ibzdept-member/main-grid/main-grid-base.vue
浏览文件 @
babfc16f
<
template
>
<div
class=
'grid'
style=
"height:100%;"
>
<el-table
v-if=
"isDisplay === true"
<i-form>
<el-table
v-if=
"isDisplay === true"
:default-sort=
"
{ prop: minorSortPSDEF, order: Object.is(minorSortDir, 'ASC') ? 'ascending' : Object.is(minorSortDir, 'DESC') ? 'descending' : '' }"
@sort-change="onSortChange($event)"
:border="isDragendCol"
...
...
@@ -28,13 +29,11 @@
{{
$t
(
'entities.ibzdeptmember.main_grid.columns.deptname'
)
}}
</span>
</
template
>
<
template
v-slot=
"{row,column}"
>
<
template
v-slot=
"{row,column
,$index
}"
>
<template
v-if=
"actualIsOpenEdit"
>
<i-form
style=
"height:100%;"
:model=
"row"
>
<app-form-item
:name=
"column.property"
:itemRules=
"rules[column.property]"
>
<dropdown-list
v-model=
"row[column.property]"
:disabled=
"row.srfuf === 1 ? (3 & 2) !== 2 : (3 & 1) !== 1"
placeholder=
'请选择...'
style=
""
@
change=
"($event)=>
{gridEditItemChange(row, column.property, $event)}">
</dropdown-list>
</app-form-item>
</i-form>
<app-form-item
:error=
"gridItemsModel[$index][column.property].error"
>
<dropdown-list
v-model=
"row[column.property]"
:disabled=
"row.srfuf === 1 ? (3 & 2) !== 2 : (3 & 1) !== 1"
placeholder=
'请选择...'
style=
""
@
change=
"($event)=>
{gridEditItemChange(row, column.property, $event, $index)}">
</dropdown-list>
</app-form-item>
</
template
>
<
template
v-if=
"!actualIsOpenEdit"
>
<app-span
name=
'deptname'
editorType=
"DROPDOWNLIST"
:value=
"row.deptname"
></app-span>
...
...
@@ -49,7 +48,7 @@
{{
$t
(
'entities.ibzdeptmember.main_grid.columns.personname'
)
}}
</span>
</
template
>
<
template
v-slot=
"{row,column}"
>
<
template
v-slot=
"{row,column
,$index
}"
>
<span>
{{
row
.
personname
}}
</span>
</
template
>
</el-table-column>
...
...
@@ -61,21 +60,19 @@
{{
$t
(
'entities.ibzdeptmember.main_grid.columns.deptid'
)
}}
</span>
</
template
>
<
template
v-slot=
"{row,column}"
>
<
template
v-slot=
"{row,column
,$index
}"
>
<template
v-if=
"actualIsOpenEdit"
>
<i-form
style=
"height:100%;"
:model=
"row"
>
<app-form-item
:name=
"column.property"
:itemRules=
"rules[column.property]"
>
<input-box
<app-form-item
:error=
"gridItemsModel[$index][column.property].error"
>
<input-box
:disabled=
"row.srfuf === 1 ? (3 & 2) !== 2 : (3 & 1) !== 1"
v-model=
"row[column.property]"
style=
""
type=
"text"
@
change=
"($event)=>
{gridEditItemChange(row, column.property, $event)}">
@
change=
"($event)=>
{gridEditItemChange(row, column.property, $event
, $index
)}">
</input-box>
</app-form-item>
</i-form>
</app-form-item>
</
template
>
<
template
v-if=
"!actualIsOpenEdit"
>
<app-span
name=
'deptid'
editorType=
"HIDDEN"
:value=
"row.deptid"
></app-span>
...
...
@@ -87,6 +84,7 @@
<el-table-column></el-table-column>
</
template
>
</el-table>
</i-form>
<row
class=
'grid-pagination'
v-show=
"items.length > 0"
>
<page
class=
'pull-right'
@
on-change=
"pageOnChange($event)"
@
on-page-size-change=
"onPageSizeChange($event)"
...
...
@@ -134,6 +132,7 @@ import IBZDeptMemberService from '@/service/ibzdept-member/ibzdept-member-servic
import
MainService
from
'./main-grid-service'
;
import
CodeListService
from
"@service/app/codelist-service"
;
import
{
FormItemModel
}
from
'@/model/form-detail'
;
@
Component
({
...
...
@@ -581,6 +580,28 @@ export default class MainBase extends Vue implements ControlInterface {
},
]
/**
* 表格模型集合
*
* @type {*}
* @memberof Main
*/
public
gridItemsModel
:
any
[]
=
[];
/**
* 获取表格行模型
*
* @type {*}
* @memberof Main
*/
public
getGridRowModel
(){
return
{
deptid
:
new
FormItemModel
(),
deptname
:
new
FormItemModel
(),
srfkey
:
new
FormItemModel
(),
}
}
/**
* 属性值规则
*
...
...
@@ -602,6 +623,23 @@ export default class MainBase extends Vue implements ControlInterface {
],
}
/**
* 表格行编辑项校验
*
* @param {string} property 属性名
* @param {*} data 行数据
* @param {number} rowIndex 行索引
*
* @memberof Main
*/
public
validtor
(
property
:
string
,
data
:
any
,
rowIndex
:
number
){
this
.
$util
.
validateItem
(
property
,
data
,
this
.
rules
).
then
(()
=>
{
this
.
gridItemsModel
[
rowIndex
][
property
].
setError
(
null
);
}).
catch
(({
errors
,
fields
})
=>
{
this
.
gridItemsModel
[
rowIndex
][
property
].
setError
(
errors
[
0
].
message
);
});
}
/**
* 表格数据加载
*
...
...
@@ -644,8 +682,10 @@ export default class MainBase extends Vue implements ControlInterface {
const
data
:
any
=
response
.
data
;
this
.
totalrow
=
response
.
total
;
this
.
items
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
// 清空selections
// 清空selections
,gridItemsModel
this
.
selections
=
[];
this
.
gridItemsModel
=
[];
this
.
items
.
forEach
(()
=>
{
this
.
gridItemsModel
.
push
(
this
.
getGridRowModel
())});
this
.
$emit
(
'load'
,
this
.
items
);
// 设置默认选中
let
_this
=
this
;
...
...
@@ -694,6 +734,7 @@ export default class MainBase extends Vue implements ControlInterface {
this
.
items
.
some
((
val
:
any
,
num
:
number
)
=>
{
if
(
JSON
.
stringify
(
val
)
==
JSON
.
stringify
(
record
)){
this
.
items
.
splice
(
num
,
1
);
this
.
gridItemsModel
.
splice
(
num
,
1
);
return
true
;
}
});
...
...
@@ -743,9 +784,10 @@ export default class MainBase extends Vue implements ControlInterface {
//删除items中已删除的项
console
.
log
(
this
.
items
);
_datas
.
forEach
((
data
:
any
)
=>
{
this
.
items
.
some
((
item
:
any
,
index
:
number
)
=>
{
if
(
Object
.
is
(
item
.
srfkey
,
data
.
srfkey
)){
this
.
items
.
splice
(
index
,
1
);
this
.
items
.
some
((
item
:
any
,
index
:
number
)
=>
{
if
(
Object
.
is
(
item
.
srfkey
,
data
.
srfkey
)){
this
.
items
.
splice
(
index
,
1
);
this
.
gridItemsModel
.
splice
(
index
,
1
);
return
true
;
}
});
...
...
@@ -1370,6 +1412,7 @@ export default class MainBase extends Vue implements ControlInterface {
const
data
=
response
.
data
;
data
.
rowDataState
=
"create"
;
_this
.
items
.
push
(
data
);
_this
.
gridItemsModel
.
push
(
_this
.
getGridRowModel
());
}).
catch
((
response
:
any
)
=>
{
if
(
response
&&
response
.
status
===
401
)
{
return
;
...
...
@@ -1389,7 +1432,7 @@ export default class MainBase extends Vue implements ControlInterface {
* @returns {void}
* @memberof Main
*/
public
onGridItemValueChange
(
row
:
any
,
$event
:
{
name
:
string
,
value
:
any
}):
void
{
public
onGridItemValueChange
(
row
:
any
,
$event
:
{
name
:
string
,
value
:
any
}
,
rowIndex
:
number
):
void
{
if
(
!
$event
)
{
return
;
}
...
...
@@ -1410,8 +1453,9 @@ export default class MainBase extends Vue implements ControlInterface {
* @returns {void}
* @memberof Main
*/
public
gridEditItemChange
(
row
:
any
,
property
:
string
,
value
:
any
){
public
gridEditItemChange
(
row
:
any
,
property
:
string
,
value
:
any
,
rowIndex
:
number
){
row
.
rowDataState
=
row
.
rowDataState
?
row
.
rowDataState
:
"update"
;
this
.
validtor
(
property
,
row
,
rowIndex
);
}
/**
...
...
app_web/src/widgets/ibzemployee/edit-grid-grid/edit-grid-grid-base.vue
浏览文件 @
babfc16f
此差异已折叠。
点击以展开。
app_web/src/widgets/ibzemployee/main-grid/main-grid-base.vue
浏览文件 @
babfc16f
<
template
>
<div
class=
'grid'
style=
"height:100%;"
>
<el-table
v-if=
"isDisplay === true"
<i-form>
<el-table
v-if=
"isDisplay === true"
:default-sort=
"
{ prop: minorSortPSDEF, order: Object.is(minorSortDir, 'ASC') ? 'ascending' : Object.is(minorSortDir, 'DESC') ? 'descending' : '' }"
@sort-change="onSortChange($event)"
:border="isDragendCol"
...
...
@@ -28,7 +29,7 @@
{{
$t
(
'entities.ibzemployee.main_grid.columns.usercode'
)
}}
</span>
</
template
>
<
template
v-slot=
"{row,column}"
>
<
template
v-slot=
"{row,column
,$index
}"
>
<span>
{{
row
.
usercode
}}
</span>
</
template
>
</el-table-column>
...
...
@@ -40,7 +41,7 @@
{{
$t
(
'entities.ibzemployee.main_grid.columns.personname'
)
}}
</span>
</
template
>
<
template
v-slot=
"{row,column}"
>
<
template
v-slot=
"{row,column
,$index
}"
>
<span>
{{
row
.
personname
}}
</span>
</
template
>
</el-table-column>
...
...
@@ -52,7 +53,7 @@
{{
$t
(
'entities.ibzemployee.main_grid.columns.loginname'
)
}}
</span>
</
template
>
<
template
v-slot=
"{row,column}"
>
<
template
v-slot=
"{row,column
,$index
}"
>
<span>
{{
row
.
loginname
}}
</span>
</
template
>
</el-table-column>
...
...
@@ -64,7 +65,7 @@
{{
$t
(
'entities.ibzemployee.main_grid.columns.orgcode'
)
}}
</span>
</
template
>
<
template
v-slot=
"{row,column}"
>
<
template
v-slot=
"{row,column
,$index
}"
>
<span>
{{
row
.
orgcode
}}
</span>
</
template
>
</el-table-column>
...
...
@@ -76,7 +77,7 @@
{{
$t
(
'entities.ibzemployee.main_grid.columns.orgname'
)
}}
</span>
</
template
>
<
template
v-slot=
"{row,column}"
>
<
template
v-slot=
"{row,column
,$index
}"
>
<span>
{{
row
.
orgname
}}
</span>
</
template
>
</el-table-column>
...
...
@@ -88,7 +89,7 @@
{{
$t
(
'entities.ibzemployee.main_grid.columns.mdeptcode'
)
}}
</span>
</
template
>
<
template
v-slot=
"{row,column}"
>
<
template
v-slot=
"{row,column
,$index
}"
>
<span>
{{
row
.
mdeptcode
}}
</span>
</
template
>
</el-table-column>
...
...
@@ -100,7 +101,7 @@
{{
$t
(
'entities.ibzemployee.main_grid.columns.mdeptname'
)
}}
</span>
</
template
>
<
template
v-slot=
"{row,column}"
>
<
template
v-slot=
"{row,column
,$index
}"
>
<span>
{{
row
.
mdeptname
}}
</span>
</
template
>
</el-table-column>
...
...
@@ -112,7 +113,7 @@
{{
$t
(
'entities.ibzemployee.main_grid.columns.sex'
)
}}
</span>
</
template
>
<
template
v-slot=
"{row,column}"
>
<
template
v-slot=
"{row,column
,$index
}"
>
<template
>
<codelist
:value=
"row.sex"
tag=
'CLIBZSex'
codelistType=
'STATIC'
></codelist>
</
template
>
...
...
@@ -126,7 +127,7 @@
{{
$t
(
'entities.ibzemployee.main_grid.columns.phone'
)
}}
</span>
</
template
>
<
template
v-slot=
"{row,column}"
>
<
template
v-slot=
"{row,column
,$index
}"
>
<span>
{{
row
.
phone
}}
</span>
</
template
>
</el-table-column>
...
...
@@ -138,7 +139,7 @@
{{
$t
(
'entities.ibzemployee.main_grid.columns.ipaddr'
)
}}
</span>
</
template
>
<
template
v-slot=
"{row,column}"
>
<
template
v-slot=
"{row,column
,$index
}"
>
<span>
{{
row
.
ipaddr
}}
</span>
</
template
>
</el-table-column>
...
...
@@ -150,7 +151,7 @@
{{
$t
(
'entities.ibzemployee.main_grid.columns.showorder'
)
}}
</span>
</
template
>
<
template
v-slot=
"{row,column}"
>
<
template
v-slot=
"{row,column
,$index
}"
>
<span>
{{
row
.
showorder
}}
</span>
</
template
>
</el-table-column>
...
...
@@ -159,6 +160,7 @@
<el-table-column></el-table-column>
</
template
>
</el-table>
</i-form>
<row
class=
'grid-pagination'
v-show=
"items.length > 0"
>
<page
class=
'pull-right'
@
on-change=
"pageOnChange($event)"
@
on-page-size-change=
"onPageSizeChange($event)"
...
...
@@ -206,6 +208,7 @@ import IBZEmployeeService from '@/service/ibzemployee/ibzemployee-service';
import
MainService
from
'./main-grid-service'
;
import
CodeListService
from
"@service/app/codelist-service"
;
import
{
FormItemModel
}
from
'@/model/form-detail'
;
@
Component
({
...
...
@@ -695,6 +698,26 @@ export default class MainBase extends Vue implements ControlInterface {
},
]
/**
* 表格模型集合
*
* @type {*}
* @memberof Main
*/
public
gridItemsModel
:
any
[]
=
[];
/**
* 获取表格行模型
*
* @type {*}
* @memberof Main
*/
public
getGridRowModel
(){
return
{
srfkey
:
new
FormItemModel
(),
}
}
/**
* 属性值规则
*
...
...
@@ -708,6 +731,23 @@ export default class MainBase extends Vue implements ControlInterface {
],
}
/**
* 表格行编辑项校验
*
* @param {string} property 属性名
* @param {*} data 行数据
* @param {number} rowIndex 行索引
*
* @memberof Main
*/
public
validtor
(
property
:
string
,
data
:
any
,
rowIndex
:
number
){
this
.
$util
.
validateItem
(
property
,
data
,
this
.
rules
).
then
(()
=>
{
this
.
gridItemsModel
[
rowIndex
][
property
].
setError
(
null
);
}).
catch
(({
errors
,
fields
})
=>
{
this
.
gridItemsModel
[
rowIndex
][
property
].
setError
(
errors
[
0
].
message
);
});
}
/**
* 表格数据加载
*
...
...
@@ -750,8 +790,10 @@ export default class MainBase extends Vue implements ControlInterface {
const
data
:
any
=
response
.
data
;
this
.
totalrow
=
response
.
total
;
this
.
items
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
// 清空selections
// 清空selections
,gridItemsModel
this
.
selections
=
[];
this
.
gridItemsModel
=
[];
this
.
items
.
forEach
(()
=>
{
this
.
gridItemsModel
.
push
(
this
.
getGridRowModel
())});
this
.
$emit
(
'load'
,
this
.
items
);
// 设置默认选中
let
_this
=
this
;
...
...
@@ -800,6 +842,7 @@ export default class MainBase extends Vue implements ControlInterface {
this
.
items
.
some
((
val
:
any
,
num
:
number
)
=>
{
if
(
JSON
.
stringify
(
val
)
==
JSON
.
stringify
(
record
)){
this
.
items
.
splice
(
num
,
1
);
this
.
gridItemsModel
.
splice
(
num
,
1
);
return
true
;
}
});
...
...
@@ -849,9 +892,10 @@ export default class MainBase extends Vue implements ControlInterface {
//删除items中已删除的项
console
.
log
(
this
.
items
);
_datas
.
forEach
((
data
:
any
)
=>
{
this
.
items
.
some
((
item
:
any
,
index
:
number
)
=>
{
if
(
Object
.
is
(
item
.
srfkey
,
data
.
srfkey
)){
this
.
items
.
splice
(
index
,
1
);
this
.
items
.
some
((
item
:
any
,
index
:
number
)
=>
{
if
(
Object
.
is
(
item
.
srfkey
,
data
.
srfkey
)){
this
.
items
.
splice
(
index
,
1
);
this
.
gridItemsModel
.
splice
(
index
,
1
);
return
true
;
}
});
...
...
app_web/src/widgets/ibzorganization/main-grid/main-grid-base.vue
浏览文件 @
babfc16f
<
template
>
<div
class=
'grid'
style=
"height:100%;"
>
<el-table
v-if=
"isDisplay === true"
<i-form>
<el-table
v-if=
"isDisplay === true"
:default-sort=
"
{ prop: minorSortPSDEF, order: Object.is(minorSortDir, 'ASC') ? 'ascending' : Object.is(minorSortDir, 'DESC') ? 'descending' : '' }"
@sort-change="onSortChange($event)"
:border="isDragendCol"
...
...
@@ -28,7 +29,7 @@
{{
$t
(
'entities.ibzorganization.main_grid.columns.orgid'
)
}}
</span>
</
template
>
<
template
v-slot=
"{row,column}"
>
<
template
v-slot=
"{row,column
,$index
}"
>
<span>
{{
row
.
orgid
}}
</span>
</
template
>
</el-table-column>
...
...
@@ -40,7 +41,7 @@
{{
$t
(
'entities.ibzorganization.main_grid.columns.orgcode'
)
}}
</span>
</
template
>
<
template
v-slot=
"{row,column}"
>
<
template
v-slot=
"{row,column
,$index
}"
>
<span>
{{
row
.
orgcode
}}
</span>
</
template
>
</el-table-column>
...
...
@@ -52,7 +53,7 @@
{{
$t
(
'entities.ibzorganization.main_grid.columns.orgname'
)
}}
</span>
</
template
>
<
template
v-slot=
"{row,column}"
>
<
template
v-slot=
"{row,column
,$index
}"
>
<span>
{{
row
.
orgname
}}
</span>
</
template
>
</el-table-column>
...
...
@@ -64,7 +65,7 @@
{{
$t
(
'entities.ibzorganization.main_grid.columns.orglevel'
)
}}
</span>
</
template
>
<
template
v-slot=
"{row,column}"
>
<
template
v-slot=
"{row,column
,$index
}"
>
<span>
{{
row
.
orglevel
}}
</span>
</
template
>
</el-table-column>
...
...
@@ -76,7 +77,7 @@
{{
$t
(
'entities.ibzorganization.main_grid.columns.shortname'
)
}}
</span>
</
template
>
<
template
v-slot=
"{row,column}"
>
<
template
v-slot=
"{row,column
,$index
}"
>
<span>
{{
row
.
shortname
}}
</span>
</
template
>
</el-table-column>
...
...
@@ -88,7 +89,7 @@
{{
$t
(
'entities.ibzorganization.main_grid.columns.showorder'
)
}}
</span>
</
template
>
<
template
v-slot=
"{row,column}"
>
<
template
v-slot=
"{row,column
,$index
}"
>
<span>
{{
row
.
showorder
}}
</span>
</
template
>
</el-table-column>
...
...
@@ -100,7 +101,7 @@
{{
$t
(
'entities.ibzorganization.main_grid.columns.createdate'
)
}}
</span>
</
template
>
<
template
v-slot=
"{row,column}"
>
<
template
v-slot=
"{row,column
,$index
}"
>
<app-format-data
format=
"YYYY-MM-DD hh:mm:ss"
:data=
"row.createdate"
></app-format-data>
</
template
>
</el-table-column>
...
...
@@ -112,7 +113,7 @@
{{
$t
(
'entities.ibzorganization.main_grid.columns.updatedate'
)
}}
</span>
</
template
>
<
template
v-slot=
"{row,column}"
>
<
template
v-slot=
"{row,column
,$index
}"
>
<app-format-data
format=
"YYYY-MM-DD hh:mm:ss"
:data=
"row.updatedate"
></app-format-data>
</
template
>
</el-table-column>
...
...
@@ -121,6 +122,7 @@
<el-table-column></el-table-column>
</
template
>
</el-table>
</i-form>
<row
class=
'grid-pagination'
v-show=
"items.length > 0"
>
<page
class=
'pull-right'
@
on-change=
"pageOnChange($event)"
@
on-page-size-change=
"onPageSizeChange($event)"
...
...
@@ -168,6 +170,7 @@ import IBZOrganizationService from '@/service/ibzorganization/ibzorganization-se
import
MainService
from
'./main-grid-service'
;
import
CodeListService
from
"@service/app/codelist-service"
;
import
{
FormItemModel
}
from
'@/model/form-detail'
;
@
Component
({
...
...
@@ -650,6 +653,26 @@ export default class MainBase extends Vue implements ControlInterface {
},
]
/**
* 表格模型集合
*
* @type {*}
* @memberof Main
*/
public
gridItemsModel
:
any
[]
=
[];
/**
* 获取表格行模型
*
* @type {*}
* @memberof Main
*/
public
getGridRowModel
(){
return
{
srfkey
:
new
FormItemModel
(),
}
}
/**
* 属性值规则
*
...
...
@@ -663,6 +686,23 @@ export default class MainBase extends Vue implements ControlInterface {
],
}
/**
* 表格行编辑项校验
*
* @param {string} property 属性名
* @param {*} data 行数据
* @param {number} rowIndex 行索引
*
* @memberof Main
*/
public
validtor
(
property
:
string
,
data
:
any
,
rowIndex
:
number
){
this
.
$util
.
validateItem
(
property
,
data
,
this
.
rules
).
then
(()
=>
{
this
.
gridItemsModel
[
rowIndex
][
property
].
setError
(
null
);
}).
catch
(({
errors
,
fields
})
=>
{
this
.
gridItemsModel
[
rowIndex
][
property
].
setError
(
errors
[
0
].
message
);
});
}
/**
* 表格数据加载
*
...
...
@@ -705,8 +745,10 @@ export default class MainBase extends Vue implements ControlInterface {
const
data
:
any
=
response
.
data
;
this
.
totalrow
=
response
.
total
;
this
.
items
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
// 清空selections
// 清空selections
,gridItemsModel
this
.
selections
=
[];
this
.
gridItemsModel
=
[];
this
.
items
.
forEach
(()
=>
{
this
.
gridItemsModel
.
push
(
this
.
getGridRowModel
())});
this
.
$emit
(
'load'
,
this
.
items
);
// 设置默认选中
let
_this
=
this
;
...
...
@@ -755,6 +797,7 @@ export default class MainBase extends Vue implements ControlInterface {
this
.
items
.
some
((
val
:
any
,
num
:
number
)
=>
{
if
(
JSON
.
stringify
(
val
)
==
JSON
.
stringify
(
record
)){
this
.
items
.
splice
(
num
,
1
);
this
.
gridItemsModel
.
splice
(
num
,
1
);
return
true
;
}
});
...
...
@@ -804,9 +847,10 @@ export default class MainBase extends Vue implements ControlInterface {
//删除items中已删除的项
console
.
log
(
this
.
items
);
_datas
.
forEach
((
data
:
any
)
=>
{
this
.
items
.
some
((
item
:
any
,
index
:
number
)
=>
{
if
(
Object
.
is
(
item
.
srfkey
,
data
.
srfkey
)){
this
.
items
.
splice
(
index
,
1
);
this
.
items
.
some
((
item
:
any
,
index
:
number
)
=>
{
if
(
Object
.
is
(
item
.
srfkey
,
data
.
srfkey
)){
this
.
items
.
splice
(
index
,
1
);
this
.
gridItemsModel
.
splice
(
index
,
1
);
return
true
;
}
});
...
...
ibzou-core/src/main/resources/liquibase/h2_table.xml
浏览文件 @
babfc16f
...
...
@@ -126,7 +126,7 @@
<!--输出实体[IBZDEPT]数据结构 -->
<changeSet
author=
"a_A_5d9d78509"
id=
"tab-ibzdept-65
7
-4"
>
<changeSet
author=
"a_A_5d9d78509"
id=
"tab-ibzdept-65
9
-4"
>
<createTable
tableName=
"IBZDEPT"
>
<column
name=
"DEPTID"
remarks=
""
type=
"VARCHAR(100)"
>
<constraints
primaryKey=
"true"
primaryKeyName=
"PK_IBZDEPT_DEPTID"
/>
...
...
@@ -179,10 +179,10 @@
<addForeignKeyConstraint
baseColumnNames=
"USERID"
baseTableName=
"IBZDEPTMEMBER"
constraintName=
"DER1N_IBZDEPTMEMBER_IBZEMP_USE"
deferrable=
"false"
initiallyDeferred=
"false"
onDelete=
"RESTRICT"
onUpdate=
"RESTRICT"
referencedColumnNames=
"USERID"
referencedTableName=
"IBZEMP"
validate=
"true"
/>
</changeSet>
<!--输出实体[IBZDEPT]外键关系 -->
<changeSet
author=
"a_A_5d9d78509"
id=
"fk-ibzdept-65
7
-10"
>
<changeSet
author=
"a_A_5d9d78509"
id=
"fk-ibzdept-65
9
-10"
>
<addForeignKeyConstraint
baseColumnNames=
"PDEPTID"
baseTableName=
"IBZDEPT"
constraintName=
"DER1N_IBZDEPT_IBZDEPT_PDEPTID"
deferrable=
"false"
initiallyDeferred=
"false"
onDelete=
"RESTRICT"
onUpdate=
"RESTRICT"
referencedColumnNames=
"DEPTID"
referencedTableName=
"IBZDEPT"
validate=
"true"
/>
</changeSet>
<changeSet
author=
"a_A_5d9d78509"
id=
"fk-ibzdept-65
7
-11"
>
<changeSet
author=
"a_A_5d9d78509"
id=
"fk-ibzdept-65
9
-11"
>
<addForeignKeyConstraint
baseColumnNames=
"ORGID"
baseTableName=
"IBZDEPT"
constraintName=
"DER1N_IBZDEPT_IBZORG_ORGID"
deferrable=
"false"
initiallyDeferred=
"false"
onDelete=
"RESTRICT"
onUpdate=
"RESTRICT"
referencedColumnNames=
"ORGID"
referencedTableName=
"IBZORG"
validate=
"true"
/>
</changeSet>
...
...
ibzou-provider/ibzou-provider-api/src/main/java/cn/ibizlab/api/rest/IBZDepartmentResource.java
浏览文件 @
babfc16f
...
...
@@ -40,15 +40,13 @@ import cn.ibizlab.core.ou.filter.IBZDepartmentSearchContext;
public
class
IBZDepartmentResource
{
@Autowired
p
rivate
IIBZDepartmentService
ibzdepartmentService
;
p
ublic
IIBZDepartmentService
ibzdepartmentService
;
@Autowired
@Lazy
public
IBZDepartmentMapping
ibzdepartmentMapping
;
public
IBZDepartmentDTO
permissionDTO
=
new
IBZDepartmentDTO
();
//@PreAuthorize("hasPermission(this.ibzdepartmentMapping.toDomain(#ibzdepartmentdtos),'ibzou-IBZDepartment-Create')")
@PreAuthorize
(
"hasPermission(this.ibzdepartmentMapping.toDomain(#ibzdepartmentdto),'ibzou-IBZDepartment-Create')"
)
@ApiOperation
(
value
=
"Create"
,
tags
=
{
"IBZDepartment"
},
notes
=
"Create"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzdepartments"
)
@Transactional
...
...
@@ -103,7 +101,7 @@ public class IBZDepartmentResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
ibzdepartmentMapping
.
toDto
(
ibzdepartmentService
.
getDraft
(
new
IBZDepartment
())));
}
//
@PreAuthorize("hasPermission(this.ibzdepartmentService.get(#ibzdepartment_id),'ibzou-IBZDepartment-Remove')")
@PreAuthorize
(
"hasPermission(this.ibzdepartmentService.get(#ibzdepartment_id),'ibzou-IBZDepartment-Remove')"
)
@ApiOperation
(
value
=
"Remove"
,
tags
=
{
"IBZDepartment"
},
notes
=
"Remove"
)
@RequestMapping
(
method
=
RequestMethod
.
DELETE
,
value
=
"/ibzdepartments/{ibzdepartment_id}"
)
@Transactional
...
...
@@ -119,7 +117,7 @@ public class IBZDepartmentResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
//
@PreAuthorize("hasPermission(this.ibzdepartmentService.get(#ibzdepartment_id),'ibzou-IBZDepartment-Update')")
@PreAuthorize
(
"hasPermission(this.ibzdepartmentService.get(#ibzdepartment_id),'ibzou-IBZDepartment-Update')"
)
@ApiOperation
(
value
=
"Update"
,
tags
=
{
"IBZDepartment"
},
notes
=
"Update"
)
@RequestMapping
(
method
=
RequestMethod
.
PUT
,
value
=
"/ibzdepartments/{ibzdepartment_id}"
)
@Transactional
...
...
ibzou-provider/ibzou-provider-api/src/main/java/cn/ibizlab/api/rest/IBZDeptMemberResource.java
浏览文件 @
babfc16f
...
...
@@ -40,14 +40,12 @@ import cn.ibizlab.core.ou.filter.IBZDeptMemberSearchContext;
public
class
IBZDeptMemberResource
{
@Autowired
p
rivate
IIBZDeptMemberService
ibzdeptmemberService
;
p
ublic
IIBZDeptMemberService
ibzdeptmemberService
;
@Autowired
@Lazy
public
IBZDeptMemberMapping
ibzdeptmemberMapping
;
public
IBZDeptMemberDTO
permissionDTO
=
new
IBZDeptMemberDTO
();
@PreAuthorize
(
"hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZDeptMember-Update-all')"
)
@ApiOperation
(
value
=
"Update"
,
tags
=
{
"IBZDeptMember"
},
notes
=
"Update"
)
@RequestMapping
(
method
=
RequestMethod
.
PUT
,
value
=
"/ibzdeptmembers/{ibzdeptmember_id}"
)
...
...
ibzou-provider/ibzou-provider-api/src/main/java/cn/ibizlab/api/rest/IBZEmployeeResource.java
浏览文件 @
babfc16f
...
...
@@ -40,15 +40,13 @@ import cn.ibizlab.core.ou.filter.IBZEmployeeSearchContext;
public
class
IBZEmployeeResource
{
@Autowired
p
rivate
IIBZEmployeeService
ibzemployeeService
;
p
ublic
IIBZEmployeeService
ibzemployeeService
;
@Autowired
@Lazy
public
IBZEmployeeMapping
ibzemployeeMapping
;
public
IBZEmployeeDTO
permissionDTO
=
new
IBZEmployeeDTO
();
//@PreAuthorize("hasPermission(this.ibzemployeeService.get(#ibzemployee_id),'ibzou-IBZEmployee-Remove')")
@PreAuthorize
(
"hasPermission(this.ibzemployeeService.get(#ibzemployee_id),'ibzou-IBZEmployee-Remove')"
)
@ApiOperation
(
value
=
"Remove"
,
tags
=
{
"IBZEmployee"
},
notes
=
"Remove"
)
@RequestMapping
(
method
=
RequestMethod
.
DELETE
,
value
=
"/ibzemployees/{ibzemployee_id}"
)
@Transactional
...
...
@@ -76,7 +74,7 @@ public class IBZEmployeeResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
ibzemployeedto
);
}
//@PreAuthorize("hasPermission(this.ibzemployeeMapping.toDomain(#ibzemployeedtos
),'ibzou-IBZEmployee-Create')")
@PreAuthorize
(
"hasPermission(this.ibzemployeeMapping.toDomain(#ibzemployeedto
),'ibzou-IBZEmployee-Create')"
)
@ApiOperation
(
value
=
"Create"
,
tags
=
{
"IBZEmployee"
},
notes
=
"Create"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzemployees"
)
@Transactional
...
...
@@ -101,7 +99,7 @@ public class IBZEmployeeResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
ibzemployeeService
.
checkKey
(
ibzemployeeMapping
.
toDomain
(
ibzemployeedto
)));
}
//
@PreAuthorize("hasPermission(this.ibzemployeeService.get(#ibzemployee_id),'ibzou-IBZEmployee-Update')")
@PreAuthorize
(
"hasPermission(this.ibzemployeeService.get(#ibzemployee_id),'ibzou-IBZEmployee-Update')"
)
@ApiOperation
(
value
=
"Update"
,
tags
=
{
"IBZEmployee"
},
notes
=
"Update"
)
@RequestMapping
(
method
=
RequestMethod
.
PUT
,
value
=
"/ibzemployees/{ibzemployee_id}"
)
@Transactional
...
...
ibzou-provider/ibzou-provider-api/src/main/java/cn/ibizlab/api/rest/IBZOrganizationResource.java
浏览文件 @
babfc16f
...
...
@@ -40,21 +40,19 @@ import cn.ibizlab.core.ou.filter.IBZOrganizationSearchContext;
public
class
IBZOrganizationResource
{
@Autowired
p
rivate
IIBZOrganizationService
ibzorganizationService
;
p
ublic
IIBZOrganizationService
ibzorganizationService
;
@Autowired
@Lazy
public
IBZOrganizationMapping
ibzorganizationMapping
;
public
IBZOrganizationDTO
permissionDTO
=
new
IBZOrganizationDTO
();
@ApiOperation
(
value
=
"CheckKey"
,
tags
=
{
"IBZOrganization"
},
notes
=
"CheckKey"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzorganizations/checkkey"
)
public
ResponseEntity
<
Boolean
>
checkKey
(
@RequestBody
IBZOrganizationDTO
ibzorganizationdto
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
ibzorganizationService
.
checkKey
(
ibzorganizationMapping
.
toDomain
(
ibzorganizationdto
)));
}
//
@PreAuthorize("hasPermission(this.ibzorganizationService.get(#ibzorganization_id),'ibzou-IBZOrganization-Update')")
@PreAuthorize
(
"hasPermission(this.ibzorganizationService.get(#ibzorganization_id),'ibzou-IBZOrganization-Update')"
)
@ApiOperation
(
value
=
"Update"
,
tags
=
{
"IBZOrganization"
},
notes
=
"Update"
)
@RequestMapping
(
method
=
RequestMethod
.
PUT
,
value
=
"/ibzorganizations/{ibzorganization_id}"
)
@Transactional
...
...
@@ -74,7 +72,7 @@ public class IBZOrganizationResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
//@PreAuthorize("hasPermission(this.ibzorganizationMapping.toDomain(#ibzorganizationdtos
),'ibzou-IBZOrganization-Create')")
@PreAuthorize
(
"hasPermission(this.ibzorganizationMapping.toDomain(#ibzorganizationdto
),'ibzou-IBZOrganization-Create')"
)
@ApiOperation
(
value
=
"Create"
,
tags
=
{
"IBZOrganization"
},
notes
=
"Create"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzorganizations"
)
@Transactional
...
...
@@ -108,7 +106,7 @@ public class IBZOrganizationResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
//
@PreAuthorize("hasPermission(this.ibzorganizationService.get(#ibzorganization_id),'ibzou-IBZOrganization-Remove')")
@PreAuthorize
(
"hasPermission(this.ibzorganizationService.get(#ibzorganization_id),'ibzou-IBZOrganization-Remove')"
)
@ApiOperation
(
value
=
"Remove"
,
tags
=
{
"IBZOrganization"
},
notes
=
"Remove"
)
@RequestMapping
(
method
=
RequestMethod
.
DELETE
,
value
=
"/ibzorganizations/{ibzorganization_id}"
)
@Transactional
...
...
ibzou-util/src/main/java/cn/ibizlab/util/security/AuthPermissionEvaluator.java
浏览文件 @
babfc16f
...
...
@@ -50,7 +50,7 @@ public class AuthPermissionEvaluator implements PermissionEvaluator {
if
(
entity
instanceof
ArrayList
){
List
<
EntityBase
>
entities
=
(
List
<
EntityBase
>)
entity
;
for
(
EntityBase
entityBase:
entities
){
boolean
result
=
actionValid
(
entityBase
,
entityDataRange
);
boolean
result
=
actionValid
(
entityBase
,
strAction
,
entityDataRange
);
if
(!
result
){
return
false
;
}
...
...
@@ -58,7 +58,7 @@ public class AuthPermissionEvaluator implements PermissionEvaluator {
}
else
{
EntityBase
entityBase
=
(
EntityBase
)
entity
;
return
actionValid
(
entityBase
,
entityDataRange
);
return
actionValid
(
entityBase
,
strAction
,
entityDataRange
);
}
return
true
;
}
...
...
@@ -109,7 +109,7 @@ public class AuthPermissionEvaluator implements PermissionEvaluator {
* @param entityDataRange
* @return
*/
private
boolean
actionValid
(
EntityBase
entity
,
Set
<
String
>
entityDataRange
){
private
boolean
actionValid
(
EntityBase
entity
,
S
tring
action
,
S
et
<
String
>
entityDataRange
){
Map
<
String
,
String
>
permissionField
=
getPermissionField
(
entity
);
//获取组织、部门预置属性
String
orgField
=
permissionField
.
get
(
"orgfield"
);
...
...
@@ -150,17 +150,26 @@ public class AuthPermissionEvaluator implements PermissionEvaluator {
}
}
if
(!
ObjectUtils
.
isEmpty
(
orgFieldValue
)
&&
!
userOrg
.
contains
(
orgFieldValue
)){
return
false
;
}
if
(!
ObjectUtils
.
isEmpty
(
orgDeptFieldValue
)
&&
!
userOrgDept
.
contains
(
orgDeptFieldValue
)){
return
false
;
}
if
(!
ObjectUtils
.
isEmpty
(
crateManFieldValue
)
&&
!
crateManFieldValue
.
equals
(
authenticationUser
.
getUserid
())){
return
false
;
if
(
action
.
endsWith
(
"Create"
)){
if
(!
ObjectUtils
.
isEmpty
(
orgFieldValue
)
&&
!
userOrg
.
contains
(
orgFieldValue
))
return
false
;
if
(!
ObjectUtils
.
isEmpty
(
orgDeptFieldValue
)
&&
!
userOrgDept
.
contains
(
orgDeptFieldValue
))
return
false
;
if
(!
ObjectUtils
.
isEmpty
(
crateManFieldValue
)
&&
!
crateManFieldValue
.
equals
(
authenticationUser
.
getUserid
()))
return
false
;
return
true
;
}
else
{
if
(!
ObjectUtils
.
isEmpty
(
orgFieldValue
)
&&
userOrg
.
contains
(
orgFieldValue
))
return
true
;
if
(!
ObjectUtils
.
isEmpty
(
orgDeptFieldValue
)
&&
userOrgDept
.
contains
(
orgDeptFieldValue
))
return
true
;
if
(!
ObjectUtils
.
isEmpty
(
crateManFieldValue
)
&&
crateManFieldValue
.
equals
(
authenticationUser
.
getUserid
()))
return
true
;
return
true
;
return
false
;
}
}
/**
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录