Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibzdst
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibzdst
提交
df1c3172
提交
df1c3172
编写于
12月 08, 2020
作者:
ibizdev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ibiz4j 发布系统代码 [ibz-dst,应用]
上级
e1b431c6
变更
11
隐藏空白字符变更
内嵌
并排
正在显示
11 个修改的文件
包含
163 行增加
和
6 行删除
+163
-6
rule-item_en_US.ts
...b/src/locale/lanres/entities/rule-item/rule-item_en_US.ts
+3
-0
rule-item_zh_CN.ts
...b/src/locale/lanres/entities/rule-item/rule-item_zh_CN.ts
+3
-0
rule-items.ts
app_web/src/mock/entity/rule-items/rule-items.ts
+38
-0
rule-item-service-base.ts
app_web/src/service/rule-item/rule-item-service-base.ts
+14
-0
main-form-base.vue
app_web/src/widgets/rule-item/main-form/main-form-base.vue
+49
-4
RuleItemExService.java
...cn/ibizlab/core/extensions/service/RuleItemExService.java
+35
-0
IRuleItemService.java
...n/java/cn/ibizlab/core/rule/service/IRuleItemService.java
+1
-0
RuleItemServiceImpl.java
...n/ibizlab/core/rule/service/impl/RuleItemServiceImpl.java
+7
-0
h2_table.xml
ibzdst-core/src/main/resources/liquibase/h2_table.xml
+1
-1
systemResource.json
...st-core/src/main/resources/permission/systemResource.json
+1
-1
RuleItemResource.java
...i/src/main/java/cn/ibizlab/api/rest/RuleItemResource.java
+11
-0
未找到文件。
app_web/src/locale/lanres/entities/rule-item/rule-item_en_US.ts
浏览文件 @
df1c3172
...
...
@@ -40,6 +40,9 @@ export default {
},
main_form
:
{
details
:
{
tabpage1
:
"规则设置"
,
tabpage2
:
"属性集合"
,
tabpanel1
:
""
,
group1
:
"规则基本信息"
,
formpage1
:
"基本信息"
,
srfupdatedate
:
"更新时间"
,
...
...
app_web/src/locale/lanres/entities/rule-item/rule-item_zh_CN.ts
浏览文件 @
df1c3172
...
...
@@ -39,6 +39,9 @@ export default {
},
main_form
:
{
details
:
{
tabpage1
:
"规则设置"
,
tabpage2
:
"属性集合"
,
tabpanel1
:
""
,
group1
:
"规则基本信息"
,
formpage1
:
"基本信息"
,
srfupdatedate
:
"更新时间"
,
...
...
app_web/src/mock/entity/rule-items/rule-items.ts
浏览文件 @
df1c3172
...
...
@@ -233,6 +233,44 @@ mock.onPost(new RegExp(/^\/ruleitems\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).rep
return
[
status
,
data
];
});
// Modelchange
mock
.
onPost
(
new
RegExp
(
/^
\/
ruleitems
\/?([
a-zA-Z0-9
\-\;]{0,35})\/
modelchange$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:ruleitem 方法: Modelchange"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'rule_id'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
ruleitems
\/([
a-zA-Z0-9
\-\;]{1,35})\/
modelchange$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.rule_id, tempValue.rule_id));
let
data
=
JSON
.
parse
(
config
.
data
);
mockDatas
.
forEach
((
item
)
=>
{
if
(
item
[
'rule_id'
]
==
tempValue
[
'rule_id'
]
){
for
(
let
value
in
data
){
if
(
item
.
hasOwnProperty
(
value
)){
item
[
value
]
=
data
[
value
];
}
}
}
})
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
data
);
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
data
];
});
// Save
mock
.
onPost
(
new
RegExp
(
/^
\/
ruleitems
\/?([
a-zA-Z0-9
\-\;]{0,35})\/
save$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:ruleitem 方法: Save"
);
...
...
app_web/src/service/rule-item/rule-item-service-base.ts
浏览文件 @
df1c3172
...
...
@@ -153,6 +153,20 @@ export default class RuleItemServiceBase extends EntityService {
return
res
;
}
/**
* Modelchange接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof RuleItemServiceBase
*/
public
async
Modelchange
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
res
:
any
=
Http
.
getInstance
().
post
(
`/ruleitems/
${
context
.
ruleitem
}
/modelchange`
,
data
,
isloading
);
return
res
;
}
/**
* Save接口方法
*
...
...
app_web/src/widgets/rule-item/main-form/main-form-base.vue
浏览文件 @
df1c3172
...
...
@@ -62,7 +62,7 @@
</i-col>
<i-col
v-show=
"detailsModel.rulegroup.visible"
:style=
"
{}" :sm="{ span: 24, offset: 0 }" :md="{ span: 24, offset: 0 }" :lg="{ span: 24, offset: 0 }" :xl="{ span: 24, offset: 0 }">
<app-form-item
name=
'rulegroup'
:itemRules=
"this.rules().rulegroup"
class=
''
:caption=
"$t('entities.ruleitem.main_form.details.rulegroup')"
uiStyle=
"DEFAULT"
:labelWidth=
"
130"
:isShowCaption=
"true"
:error=
"detailsModel.rulegroup.error"
:isEmptyCaption=
"false"
labelPos=
"TOP
"
>
<app-form-item
name=
'rulegroup'
:itemRules=
"this.rules().rulegroup"
class=
''
:caption=
"$t('entities.ruleitem.main_form.details.rulegroup')"
uiStyle=
"DEFAULT"
:labelWidth=
"
0"
:isShowCaption=
"false"
:error=
"detailsModel.rulegroup.error"
:isEmptyCaption=
"false"
labelPos=
"NONE
"
>
<app-checkbox-list
v-model=
"data.rulegroup"
...
...
@@ -83,15 +83,44 @@
</app-form-item>
</i-col>
<i-col
v-show=
"detailsModel.cfg.visible"
:style=
"
{}" :sm="{ span: 24, offset: 0 }" :md="{ span: 24, offset: 0 }" :lg="{ span: 24, offset: 0 }" :xl="{ span: 24, offset: 0 }">
<i-col
v-show=
"detailsModel.tabpanel1.visible"
:style=
"
{}" :sm="{ span: 24, offset: 0 }" :md="{ span: 24, offset: 0 }" :lg="{ span: 24, offset: 0 }" :xl="{ span: 24, offset: 0 }">
<tabs
:animated=
"false"
name=
'tabpanel1'
v-show=
"detailsModel.tabpanel1.visible"
class=
''
:value=
"detailsModel.tabpanel1.activiedPage"
@
on-click=
"detailsModel.tabpanel1.clickPage($event)"
>
<tab-pane
v-show=
"detailsModel.tabpage1.visible"
name=
'tabpage1'
:index=
"0"
tab=
'tabpanel1'
class=
''
:label=
"(h) =>
{
return h('span',{
class:'caption'
},[
$t('entities.ruleitem.main_form.details.tabpage1')
])
}">
<i-col
v-show=
"detailsModel.cfg.visible"
:style=
"
{}" :sm="{ span: 24, offset: 0 }" :md="{ span: 24, offset: 0 }" :lg="{ span: 24, offset: 0 }" :xl="{ span: 24, offset: 0 }">
<app-form-json-logic
v-model=
"data.cfg"
:formState=
"formState"
:data=
"data"
:disabled=
"detailsModel.cfg.disabled"
></app-form-json-logic>
</i-col>
<i-col
v-show=
"detailsModel.fieldset.visible"
:style=
"
{}" :sm="{ span: 24, offset: 0 }" :md="{ span: 24, offset: 0 }" :lg="{ span: 24, offset: 0 }" :xl="{ span: 24, offset: 0 }">
</tab-pane>
<tab-pane
v-show=
"detailsModel.tabpage2.visible"
name=
'tabpage2'
:index=
"1"
tab=
'tabpanel1'
class=
''
:label=
"(h) =>
{
return h('span',{
class:'caption'
},[
$t('entities.ruleitem.main_form.details.tabpage2')
])
}">
<i-col
v-show=
"detailsModel.fieldset.visible"
:style=
"
{}" :sm="{ span: 24, offset: 0 }" :md="{ span: 24, offset: 0 }" :lg="{ span: 24, offset: 0 }" :xl="{ span: 24, offset: 0 }">
<app-form-json-field-set
v-model=
"data.fieldset"
:formState=
"formState"
:data=
"data"
:disabled=
"detailsModel.fieldset.disabled"
></app-form-json-field-set>
</i-col>
</tab-pane>
</tabs>
</i-col>
<i-col
v-show=
"detailsModel.cond.visible"
:style=
"
{}" :sm="{ span: 24, offset: 0 }" :md="{ span: 24, offset: 0 }" :lg="{ span: 24, offset: 0 }" :xl="{ span: 24, offset: 0 }">
<app-form-item
name=
'cond'
:itemRules=
"this.rules().cond"
class=
''
:caption=
"$t('entities.ruleitem.main_form.details.cond')"
uiStyle=
"DEFAULT"
:labelWidth=
"130"
:isShowCaption=
"true"
:error=
"detailsModel.cond.error"
:isEmptyCaption=
"false"
labelPos=
"TOP"
>
...
...
@@ -762,6 +791,12 @@ export default class MainBase extends Vue implements ControlInterface {
* @memberof MainBase
*/
public
detailsModel
:
any
=
{
tabpage1
:
new
FormTabPageModel
({
caption
:
'规则设置'
,
detailType
:
'TABPAGE'
,
name
:
'tabpage1'
,
visible
:
true
,
isShowCaption
:
true
,
form
:
this
,
isControlledContent
:
false
})
,
tabpage2
:
new
FormTabPageModel
({
caption
:
'属性集合'
,
detailType
:
'TABPAGE'
,
name
:
'tabpage2'
,
visible
:
true
,
isShowCaption
:
true
,
form
:
this
,
isControlledContent
:
false
})
,
tabpanel1
:
new
FormTabPanelModel
({
caption
:
''
,
detailType
:
'TABPANEL'
,
name
:
'tabpanel1'
,
visible
:
true
,
isShowCaption
:
false
,
form
:
this
,
isControlledContent
:
false
,
tabPages
:
[{
name
:
'tabpage1'
,
index
:
0
,
visible
:
true
},
{
name
:
'tabpage2'
,
index
:
1
,
visible
:
true
}]
})
,
group1
:
new
FormGroupPanelModel
({
caption
:
'规则基本信息'
,
detailType
:
'GROUPPANEL'
,
name
:
'group1'
,
visible
:
true
,
isShowCaption
:
false
,
form
:
this
,
isControlledContent
:
false
,
uiActionGroup
:
{
caption
:
''
,
langbase
:
'entities.ruleitem.main_form'
,
extractMode
:
'ITEM'
,
details
:
[]
},
isManageContainer
:
false
,
showMoreModeItems
:
[]
})
,
formpage1
:
new
FormPageModel
({
caption
:
'基本信息'
,
detailType
:
'FORMPAGE'
,
name
:
'formpage1'
,
visible
:
true
,
isShowCaption
:
true
,
form
:
this
,
isControlledContent
:
false
})
...
...
@@ -788,7 +823,7 @@ export default class MainBase extends Vue implements ControlInterface {
,
businesscat
:
new
FormItemModel
({
caption
:
'业务类别'
,
detailType
:
'FORMITEM'
,
name
:
'businesscat'
,
visible
:
true
,
isShowCaption
:
true
,
form
:
this
,
isControlledContent
:
false
,
required
:
false
,
disabled
:
false
,
enableCond
:
3
})
,
rulegroup
:
new
FormItemModel
({
caption
:
'规则分组'
,
detailType
:
'FORMITEM'
,
name
:
'rulegroup'
,
visible
:
true
,
isShowCaption
:
tru
e
,
form
:
this
,
isControlledContent
:
false
,
required
:
false
,
disabled
:
false
,
enableCond
:
3
})
rulegroup
:
new
FormItemModel
({
caption
:
'规则分组'
,
detailType
:
'FORMITEM'
,
name
:
'rulegroup'
,
visible
:
true
,
isShowCaption
:
fals
e
,
form
:
this
,
isControlledContent
:
false
,
required
:
false
,
disabled
:
false
,
enableCond
:
3
})
,
cfg
:
new
FormItemModel
({
caption
:
'配置'
,
detailType
:
'FORMITEM'
,
name
:
'cfg'
,
visible
:
true
,
isShowCaption
:
true
,
form
:
this
,
isControlledContent
:
false
,
required
:
false
,
disabled
:
false
,
enableCond
:
3
})
,
...
...
@@ -1154,6 +1189,16 @@ export default class MainBase extends Vue implements ControlInterface {
if
(
Object
.
is
(
name
,
'modelname'
)){
const
details
:
string
[]
=
[];
if
(
await
this
.
checkItem
(
'modelname'
)){
this
.
updateFormItems
(
'Modelchange'
,
this
.
data
,
details
,
true
);
}
}
}
/**
...
...
ibzdst-core/src/main/java/cn/ibizlab/core/extensions/service/RuleItemExService.java
0 → 100644
浏览文件 @
df1c3172
package
cn
.
ibizlab
.
core
.
extensions
.
service
;
import
cn.ibizlab.core.rule.service.impl.RuleItemServiceImpl
;
import
lombok.extern.slf4j.Slf4j
;
import
cn.ibizlab.core.rule.domain.RuleItem
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.context.annotation.Primary
;
import
java.util.*
;
/**
* 实体[规则] 自定义服务对象
*/
@Slf4j
@Primary
@Service
(
"RuleItemExService"
)
public
class
RuleItemExService
extends
RuleItemServiceImpl
{
@Override
protected
Class
currentModelClass
()
{
return
com
.
baomidou
.
mybatisplus
.
core
.
toolkit
.
ReflectionKit
.
getSuperClassGenericType
(
this
.
getClass
().
getSuperclass
(),
1
);
}
/**
* [Modelchange:modelchange] 行为扩展
* @param et
* @return
*/
@Override
@Transactional
public
RuleItem
modelchange
(
RuleItem
et
)
{
return
super
.
modelchange
(
et
);
}
}
ibzdst-core/src/main/java/cn/ibizlab/core/rule/service/IRuleItemService.java
浏览文件 @
df1c3172
...
...
@@ -34,6 +34,7 @@ public interface IRuleItemService extends IService<RuleItem> {
RuleItem
get
(
String
key
);
RuleItem
getDraft
(
RuleItem
et
);
boolean
checkKey
(
RuleItem
et
);
RuleItem
modelchange
(
RuleItem
et
);
boolean
save
(
RuleItem
et
);
void
saveBatch
(
List
<
RuleItem
>
list
);
Page
<
RuleItem
>
searchDefault
(
RuleItemSearchContext
context
);
...
...
ibzdst-core/src/main/java/cn/ibizlab/core/rule/service/impl/RuleItemServiceImpl.java
浏览文件 @
df1c3172
...
...
@@ -129,6 +129,13 @@ public class RuleItemServiceImpl extends ServiceImpl<RuleItemMapper, RuleItem> i
public
boolean
checkKey
(
RuleItem
et
)
{
return
(!
ObjectUtils
.
isEmpty
(
et
.
getRuleId
()))
&&
(!
Objects
.
isNull
(
this
.
getById
(
et
.
getRuleId
())));
}
@Override
@Transactional
public
RuleItem
modelchange
(
RuleItem
et
)
{
//自定义代码
return
et
;
}
@Override
@Transactional
public
boolean
save
(
RuleItem
et
)
{
...
...
ibzdst-core/src/main/resources/liquibase/h2_table.xml
浏览文件 @
df1c3172
...
...
@@ -420,7 +420,7 @@
<!--输出实体[RU_ITEM]数据结构 -->
<changeSet
author=
"a_A_5d9d78509"
id=
"tab-ru_item-5
1
-16"
>
<changeSet
author=
"a_A_5d9d78509"
id=
"tab-ru_item-5
4
-16"
>
<createTable
tableName=
"IBZRULE"
>
<column
name=
"RULEID"
remarks=
""
type=
"VARCHAR(100)"
>
<constraints
primaryKey=
"true"
primaryKeyName=
"PK_RU_ITEM_RULEID"
/>
...
...
ibzdst-core/src/main/resources/permission/systemResource.json
浏览文件 @
df1c3172
...
...
@@ -152,7 +152,7 @@
"delogicname"
:
"规则"
,
"sysmoudle"
:{
"id"
:
"RULE"
,
"name"
:
"rule"
},
"dedataset"
:[{
"id"
:
"Default"
,
"name"
:
"数据集"
}],
"deaction"
:[{
"id"
:
"Create"
,
"name"
:
"Create"
,
"type"
:
"BUILTIN"
},{
"id"
:
"Update"
,
"name"
:
"Update"
,
"type"
:
"BUILTIN"
},{
"id"
:
"Remove"
,
"name"
:
"Remove"
,
"type"
:
"BUILTIN"
},{
"id"
:
"Get"
,
"name"
:
"Get"
,
"type"
:
"BUILTIN"
},{
"id"
:
"GetDraft"
,
"name"
:
"GetDraft"
,
"type"
:
"BUILTIN"
},{
"id"
:
"CheckKey"
,
"name"
:
"CheckKey"
,
"type"
:
"BUILTIN"
},{
"id"
:
"Save"
,
"name"
:
"Save"
,
"type"
:
"BUILTIN"
}],
"deaction"
:[{
"id"
:
"Create"
,
"name"
:
"Create"
,
"type"
:
"BUILTIN"
},{
"id"
:
"Update"
,
"name"
:
"Update"
,
"type"
:
"BUILTIN"
},{
"id"
:
"Remove"
,
"name"
:
"Remove"
,
"type"
:
"BUILTIN"
},{
"id"
:
"Get"
,
"name"
:
"Get"
,
"type"
:
"BUILTIN"
},{
"id"
:
"GetDraft"
,
"name"
:
"GetDraft"
,
"type"
:
"BUILTIN"
},{
"id"
:
"CheckKey"
,
"name"
:
"CheckKey"
,
"type"
:
"BUILTIN"
},{
"id"
:
"
Modelchange"
,
"name"
:
"modelchange"
,
"type"
:
"USERCUSTOM"
},{
"id"
:
"
Save"
,
"name"
:
"Save"
,
"type"
:
"BUILTIN"
}],
"datascope"
:[{
"id"
:
"all"
,
"name"
:
"全部数据"
}]
}
],
...
...
ibzdst-provider/ibzdst-provider-api/src/main/java/cn/ibizlab/api/rest/RuleItemResource.java
浏览文件 @
df1c3172
...
...
@@ -121,6 +121,17 @@ public class RuleItemResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
ruleitemService
.
checkKey
(
ruleitemMapping
.
toDomain
(
ruleitemdto
)));
}
@PreAuthorize
(
"hasAnyAuthority('ROLE_SUPERADMIN','ibzdst-RuleItem-Modelchange-all')"
)
@ApiOperation
(
value
=
"modelchange"
,
tags
=
{
"规则"
},
notes
=
"modelchange"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ruleitems/{ruleitem_id}/modelchange"
)
public
ResponseEntity
<
RuleItemDTO
>
modelchange
(
@PathVariable
(
"ruleitem_id"
)
String
ruleitem_id
,
@RequestBody
RuleItemDTO
ruleitemdto
)
{
RuleItem
domain
=
ruleitemMapping
.
toDomain
(
ruleitemdto
);
domain
.
setRuleId
(
ruleitem_id
);
domain
=
ruleitemService
.
modelchange
(
domain
);
ruleitemdto
=
ruleitemMapping
.
toDto
(
domain
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
ruleitemdto
);
}
@PreAuthorize
(
"hasAnyAuthority('ROLE_SUPERADMIN','ibzdst-RuleItem-Save-all')"
)
@ApiOperation
(
value
=
"保存规则"
,
tags
=
{
"规则"
},
notes
=
"保存规则"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ruleitems/save"
)
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录