Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibizlab-generator
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibizlab-generator
提交
9aef90da
提交
9aef90da
编写于
2月 16, 2022
作者:
Mosher
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update:更新
上级
6065e79b
变更
17
显示空白字符变更
内嵌
并排
正在显示
17 个修改的文件
包含
301 行增加
和
141 行删除
+301
-141
delogic.hbs
...in/resources/templ/r7/@macro/front-end/common/delogic.hbs
+22
-0
form-action-model.hbs
...macro/front-end/widgets/form-detail/form-action-model.hbs
+10
-10
form-button.hbs
...l/r7/@macro/front-end/widgets/form-detail/form-button.hbs
+3
-1
form-details-model.hbs
...acro/front-end/widgets/form-detail/form-details-model.hbs
+5
-24
form-group-panel.hbs
...@macro/front-end/widgets/form-detail/form-group-panel.hbs
+4
-0
form-item.hbs
...mpl/r7/@macro/front-end/widgets/form-detail/form-item.hbs
+8
-0
form-tabpanel.hbs
...r7/@macro/front-end/widgets/form-detail/form-tabpanel.hbs
+1
-1
app-form-button.vue
...r7/app_{{apps}}/src/components/common/app-form-button.vue
+18
-4
app-form-item.vue
...l/r7/app_{{apps}}/src/components/common/app-form-item.vue
+15
-5
app-span.vue
...templ/r7/app_{{apps}}/src/components/editors/app-span.vue
+10
-3
form-control-state.ts
...c/core/modules/widgets/form-control/form-control-state.ts
+15
-8
form-control.ts
...s}}/src/core/modules/widgets/form-control/form-control.ts
+94
-47
grid-control.ts
...s}}/src/core/modules/widgets/grid-control/grid-control.ts
+11
-11
md-control-state.ts
...}/src/core/modules/widgets/md-control/md-control-state.ts
+2
-2
control-vo-base.ts
...p_{{apps}}/src/core/runtime/control-vo/control-vo-base.ts
+20
-3
{{ctrls@FORM}}-form-state.ts.hbs
...es}}/{{ctrls@FORM}}-form/{{ctrls@FORM}}-form-state.ts.hbs
+61
-20
{{ctrls@GRID}}-grid-state.ts.hbs
...es}}/{{ctrls@GRID}}-grid/{{ctrls@GRID}}-grid-state.ts.hbs
+2
-2
未找到文件。
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/front-end/common/delogic.hbs
0 → 100644
浏览文件 @
9aef90da
{
name: '
{{
logic
.
name
}}
',
logicType: '
{{
logic
.
logicType
}}
',
logicCat: '
{{
logic
.
logicCat
}}
',
{{#
eq
logic
.
logicType
'GROUP'
}}
notMode:
{{
logic
.
notMode
}}
,
groupOP: '
{{
logic
.
groupOP
}}
',
relatedDetailNames: [
{{#
each
logic
.
relatedDetailNames
as
|
name
|
}}
"
{{
name
}}
"
{{#
unless
@last
}}
,
{{/
unless
}}{{/
each
}}
],
{{#if
logic
.
psDEFDLogics
}}
childLogics: [
{{#
each
logic
.
psDEFDLogics
as
|
childLogic
|
}}
{{>
@macro
/
front-end
/
common
/
delogic
.
hbs
logic
=
childLogic
}}
{{/
each
}}
]
{{/if}}
{{/
eq
}}
{{#
eq
logic
.
logicType
'SINGLE'
}}
condOP: "
{{
logic
.
condOP
}}
",
dEFDName: "
{{
lowerCase
logic
.
dEFDName
}}
",
value: "
{{
logic
.
value
}}
"
{{/
eq
}}
},
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/front-end/widgets/form-detail/form-action-model.hbs
浏览文件 @
9aef90da
{{#
each
item
.
psDEFormDetails
as
|
tempD
etail
|
}}
{{#if
(
and
(
eq
tempDetail
.
detailType
"BUTTON"
)
tempD
etail
.
psUIAction
)
}}
{{#
tempD
etail
.
psUIAction
}}
{{#
each
item
.
psDEFormDetails
as
|
d
etail
|
}}
{{#if
(
and
(
eq
detail
.
detailType
"BUTTON"
)
d
etail
.
psUIAction
)
}}
{{#
d
etail
.
psUIAction
}}
'
{{
uIActionTag
}}
': { disabled: false, visible: true, noPrivDisplayMode: "
{{
noPrivDisplayMode
}}
", dataAccessAction: '
{{
dataAccessAction
}}
', actionTarget: '
{{
actionTarget
}}
' },
{{/
tempD
etail
.
psUIAction
}}
{{/
d
etail
.
psUIAction
}}
{{/if}}
{{#if
(
and
(
eq
tempDetail
.
detailType
"GROUPPANEL"
)
tempDetail
.
psSUIActionGroup
tempDetail
.
psS
UIActionGroup
.
psUIActionGroupDetails
)
}}
{{#
each
tempDetail
.
psS
UIActionGroup
.
psUIActionGroupDetails
as
|
detail
|
}}
{{#if
(
and
(
eq
detail
.
detailType
"GROUPPANEL"
)
detail
.
psUIActionGroup
detail
.
ps
UIActionGroup
.
psUIActionGroupDetails
)
}}
{{#
each
detail
.
ps
UIActionGroup
.
psUIActionGroupDetails
as
|
detail
|
}}
{{#
detail
.
psUIAction
}}
'
{{
uIActionTag
}}
': { disabled: false, visible: true, noPrivDisplayMode: "
{{
noPrivDisplayMode
}}
", dataAccessAction: '
{{
dataAccessAction
}}
', actionTarget: '
{{
actionTarget
}}
' },
{{/
detail
.
psUIAction
}}
{{/
each
}}
{{/if}}
{{#if
tempD
etail
.
psDEFormDetails
}}
{{>
@macro
/
front-end
/
widgets
/
form-detail
/
form-action-model
.
hbs
item
=
tempD
etail
}}
{{#if
d
etail
.
psDEFormDetails
}}
{{>
@macro
/
front-end
/
widgets
/
form-detail
/
form-action-model
.
hbs
item
=
d
etail
}}
{{/if}}
{{/
each
}}
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/front-end/widgets/form-detail/form-button.hbs
浏览文件 @
9aef90da
...
...
@@ -21,4 +21,6 @@
{{#if
item
.
caption
}}
caption=
"
{{
item
.
caption
}}
"
{{/if}}
:uIAction=
"state.detailsModel.
{{
item
.
codeName
}}
.uIAction"
@
action=
"onComponentEvent"
/>
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/front-end/widgets/form-detail/form-details-model.hbs
浏览文件 @
9aef90da
...
...
@@ -24,7 +24,7 @@
scriptCode: `
{{
item
.
psDEFormItemUpdate
.
scriptCode
}}
`,
{{else}}
showBusyIndicator: "
{{
item
.
psDEFormItemUpdate
.
showBusyIndicator
}}
",
{{!-- appDEMethod: "{{item.psDEFormItemUpdate.psAppDEMethod.codeName}}", --}}
appDEMethod: "
{{
item
.
psDEFormItemUpdate
.
psAppDEMethod
.
codeName
}}
",
updateDetails: [
{{#
each
item
.
psDEFormItemUpdate
.
psDEFIUpdateDetails
as
|
updateDetails
|
}}
"
{{
updateDetails
.
name
}}
",
...
...
@@ -33,14 +33,6 @@
{{/if}}
},
{{/if}}
{{#if
item
.
createDVT
}}
createDVT: "
{{
item
.
createDVT
}}
",
createDV: "
{{
item
.
createDV
}}
",
{{/if}}
{{#if
item
.
updateDVT
}}
updateDVT: "
{{
item
.
updateDVT
}}
",
updateDV: "
{{
item
.
updateDV
}}
",
{{/if}}
{{#if
item
.
resetItemName
}}
resetItemName: '
{{
item
.
resetItemName
}}
',
{{/if}}
...
...
@@ -49,7 +41,8 @@
{{/if}}
{{/if}}
{{#if
(
and
(
eq
item
.
detailType
"BUTTON"
)
item
.
psUIAction
)
}}
uIActionTag: '
{{
item
.
psUIAction
.
uIActionTag
}}
',
{{!-- TODO 补充显示图标和文字模式 --}}
uIAction: { caption: '
{{
item
.
psUIAction
.
caption
}}
', uIActionMode: "
{{
item
.
psUIAction
.
uIActionMode
}}
", disabled: false, visible: true, uIActionTag: '
{{
detail
.
psUIAction
.
uIActionTag
}}
', showCaption:
{{
item
.
showCaption
}}
,
{{#if
item
.
psUIAction
.
psSysImage
}}{{#if
item
.
psUIAction
.
psSysImage
.
imagePath
}}
imgPath: "
{{
item
.
psUIAction
.
psSysImage
.
imagePath
}}
",
{{/if}}{{#if
item
.
psUIAction
.
psSysImage
.
cssClass
}}
iconClass: "
{{
item
.
psUIAction
.
psSysImage
.
cssClass
}}
",
{{/if}}{{/if}}
},
{{/if}}
{{#if
(
and
(
eq
item
.
detailType
"GROUPPANEL"
)
item
.
psUIActionGroup
)
}}
uIActionGroup: {
...
...
@@ -57,7 +50,7 @@
caption: '
{{
item
.
psUIActionGroup
.
name
}}
',
details: [
{{#
each
item
.
psUIActionGroup
.
psUIActionGroupDetails
as
|
detail
|
}}
{ caption: '
{{
detail
.
psUIAction
.
caption
}}
'
, disabled: false, visible: true, uIActionTag: '
{{
detail
.
psUIAction
.
uIActionTag
}}
', showCaption:
{{
detail
.
showCaption
}}
, showIcon:
{{
detail
.
showIcon
}}
,
{{#if
detail
.
psUIAction
.
psSysImage
}}{{#if
detail
.
psUIAction
.
psSysImage
.
imagePath
}}
imgPath: "
{{
detail
.
psUIAction
.
psSysImage
.
imagePath
}}
",
{{/if}}{{#if
detail
.
psUIAction
.
psSysImage
.
cssClass
}}
iconClass: "
{{
detail
.
psUIAction
.
psSysImage
.
cssClass
}}
",
{{/if}}{{/if}}
},
{ caption: '
{{
detail
.
psUIAction
.
caption
}}
', uIActionMode: "
{{
detail
.
psUIAction
.
uIActionMode
}}
"
, disabled: false, visible: true, uIActionTag: '
{{
detail
.
psUIAction
.
uIActionTag
}}
', showCaption:
{{
detail
.
showCaption
}}
, showIcon:
{{
detail
.
showIcon
}}
,
{{#if
detail
.
psUIAction
.
psSysImage
}}{{#if
detail
.
psUIAction
.
psSysImage
.
imagePath
}}
imgPath: "
{{
detail
.
psUIAction
.
psSysImage
.
imagePath
}}
",
{{/if}}{{#if
detail
.
psUIAction
.
psSysImage
.
cssClass
}}
iconClass: "
{{
detail
.
psUIAction
.
psSysImage
.
cssClass
}}
",
{{/if}}{{/if}}
},
{{/
each
}}
],
},
...
...
@@ -65,19 +58,7 @@
{{#if
item
.
psDEFDGroupLogics
}}
groupLogics: [
{{#
each
item
.
psDEFDGroupLogics
as
|
groupLogic
|
}}
{
name: '
{{
groupLogic
.
name
}}
',
groupOP: '
{{
groupLogic
.
groupOP
}}
',
relatedDetailNames: '
{{
groupLogic
.
relatedDetailNames
}}
',
logicCat: '
{{
groupLogic
.
logicCat
}}
',
logicType: '
{{
groupLogic
.
logicType
}}
',
notMode:
{{
groupLogic
.
notMode
}}
,
logics: [
{{#
each
groupLogic
.
psDEFDLogics
as
|
logic
|
}}
{condOP: '
{{
logic
.
condOP
}}
',dEFDName: '
{{
logic
.
dEFDName
}}
',logicType: '
{{
logic
.
logicType
}}
',name: '
{{
logic
.
name
}}
',value:'
{{
logic
.
value
}}
'},
{{/
each
}}
],
},
{{>
@macro
/
front-end
/
common
/
delogic
.
hbs
logic
=
groupLogic
}}
{{/
each
}}
],
{{/if}}
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/front-end/widgets/form-detail/form-group-panel.hbs
浏览文件 @
9aef90da
<AppFormGroup
name=
"
{{
item
.
codeName
}}
"
{{#if
item
.
captionItemName
}}
:title=
"state.data.
{{
lowerCase
item
.
captionItemName
}}
"
{{else}}
title=
"
{{
item
.
caption
}}
"
{{/if}}
:visible=
"state.detailsModel.
{{
item
.
codeName
}}
.visible"
:layoutOpts=
"
{{>
@macro
/
front-end
/
common
/
layoutPos
.
hbs
layout
=
item
.
psLayout
layoutPos
=
item
.
psLayoutPos
}}
"
{{#if
item
.
psSysCss
}}
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/front-end/widgets/form-detail/form-item.hbs
浏览文件 @
9aef90da
{{#
neq
item
.
psEditor
.
editorType
"HIDDEN"
}}
<AppFormItem
name=
"
{{
item
.
codeName
}}
"
{{#if
item
.
captionItemName
}}
:label=
"state.data.
{{
lowerCase
item
.
captionItemName
}}
"
{{else}}
label=
"
{{
item
.
caption
}}
"
{{/if}}
{{#if
item
.
labelPos
}}
labelPos=
"
{{
item
.
labelPos
}}
"
{{/if}}
:labelWidth=
"
{{
item
.
labelWidth
}}
"
:showLabel=
"
{{
item
.
showCaption
}}
"
:rules=
"state.rules.
{{
item
.
codeName
}}
"
:required=
"state.detailsModel.
{{
item
.
codeName
}}
.required"
:visible=
"state.detailsModel.
{{
item
.
codeName
}}
.visible"
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/front-end/widgets/form-detail/form-tabpanel.hbs
浏览文件 @
9aef90da
...
...
@@ -2,7 +2,7 @@
name=
"
{{
item
.
codeName
}}
"
:visible=
"state.detailsModel.
{{
item
.
codeName
}}
.visible"
:layoutOpts=
"
{{>
@macro
/
front-end
/
common
/
layoutPos
.
hbs
layout
=
item
.
psLayout
layoutPos
=
item
.
psLayoutPos
}}
"
name=
{{
item
.
name
}}
>
>
{{#
each
item
.
psDEFormPages
as
|
formPage
|
}}
{{>
@macro
/
front-end
/
widgets
/
form-detail
/
include-form
.
hbs
type
=
formPage
.
detailType
item
=
formPage
}}
{{/
each
}}
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/components/common/app-form-button.vue
浏览文件 @
9aef90da
<
script
setup
lang=
"ts"
>
import
{
IActionParam
,
ILayoutOpts
,
IParam
}
from
"@core"
;
import
{
IActionParam
,
ILayoutOpts
,
deepCopy
}
from
"@core"
;
interface
FormButtonProps
{
name
:
string
;
...
...
@@ -9,22 +9,36 @@ interface FormButtonProps{
imgPath
?:
string
;
showCaption
?:
boolean
;
labelCssName
?:
string
;
caption
:
string
caption
:
string
,
uIAction
:
any
;
}
const
props
=
withDefaults
(
defineProps
<
FormButtonProps
>
(),
{
visible
:
true
,
showCaption
:
true
,
});
interface
FormButtonEmits
{
(
name
:
'action'
,
event
:
IActionParam
):
void
}
const
emit
=
defineEmits
<
FormButtonEmits
>
();
// 点击
const
click
=
(
event
:
MouseEvent
)
=>
{
const
data
=
deepCopy
(
props
.
uIAction
);
Object
.
assign
(
data
,
{
event
:
event
});
emit
(
'action'
,
{
tag
:
name
,
action
:
'formButtonAction'
,
data
:
data
});
}
</
script
>
<
template
>
<AppCol
:visible=
"visible"
noRoot
:layoutOpts=
"layoutOpts"
class=
"app-form
B
utton"
>
<AppCol
:visible=
"visible"
noRoot
:layoutOpts=
"layoutOpts"
class=
"app-form
-b
utton"
>
<template
#
default=
"
{slotStyle, slotClass}">
<a-button
:class=
"slotClass"
:style=
"slotStyle"
type=
"primary"
>
type=
"primary"
@
click=
"click"
>
<AppIconText
:class=
"labelCssName"
:iconClass=
"iconClass"
:imgPath=
"imagePath"
:text=
"showCaption ? caption : '' "
/>
</a-button>
</
template
>
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/components/common/app-form-item.vue
浏览文件 @
9aef90da
<
script
setup
lang=
"ts"
>
import
{
Ref
,
ref
}
from
'vue'
;
import
{
IActionParam
,
ILayoutOpts
}
from
'@core'
;
interface
FormGroupProps
{
...
...
@@ -9,6 +10,7 @@ interface FormGroupProps {
required
?:
boolean
;
visible
?:
boolean
;
labelWidth
?:
number
;
labelPos
?:
string
|
'LEFT'
|
'TOP'
|
'RIGHT'
|
'BOTTOM'
|
'NONE'
;
rules
?:
any
;
error
?:
string
;
labelClass
?:
string
;
...
...
@@ -19,21 +21,29 @@ interface FormGroupEmit {
const
props
=
withDefaults
(
defineProps
<
FormGroupProps
>
(),
{
required
:
false
,
visible
:
true
,
showLabel
:
true
showLabel
:
true
,
labelPos
:
'LEFT'
});
const
emit
=
defineEmits
<
FormGroupEmit
>
();
onBeforeMount
(()
=>
{
watch
(
()
=>
props
.
required
,
(
newVal
:
boolean
,
oldVal
:
boolean
)
=>
{
initRules
();
}
)
initRules
();
});
let
itemRules
:
any
=
[]
;
const
itemRules
:
Ref
<
any
[]
>
=
ref
([])
;
const
initRules
=
()
=>
{
itemRules
.
value
.
splice
(
0
,
itemRules
.
value
.
length
);
if
(
props
.
rules
)
{
itemRules
.
push
(...
props
.
rules
);
itemRules
.
value
.
push
(...
props
.
rules
);
}
if
(
props
.
required
)
{
itemRules
.
push
({
itemRules
.
value
.
push
({
trigger
:
[
'change'
,
'blur'
],
required
:
props
.
required
,
message
:
props
.
label
+
'必须填写'
,
...
...
@@ -56,7 +66,7 @@ const initRules = () => {
:labelCol=
"
{ style: { width: `${labelWidth}px` } }"
:validateStatus="error ? 'error' : 'validating'"
>
<template
#
label
v-if=
"showLabel"
>
<template
#
label
v-if=
"showLabel
&& labelPos !== 'NONE'
"
>
<label
:class=
"labelClass"
>
<div
class=
"label-title"
>
{{
label
}}
</div>
</label>
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/components/editors/app-span.vue
浏览文件 @
9aef90da
...
...
@@ -97,7 +97,8 @@ const { handleEditorNavParams, loadCodeListData } = new EditorBase();
const
{
navContext
,
navViewParam
}
=
handleEditorNavParams
(
props
);
let
text
:
Ref
<
string
>
=
ref
(
""
);
let
textFormat
:
Ref
<
string
>
=
ref
(
""
);
onBeforeMount
(()
=>
{
// 初始化值
const
initText
=
()
=>
{
if
(
props
.
codeListTag
)
{
loadCodeListData
(
props
.
codeListTag
as
string
,
...
...
@@ -110,11 +111,11 @@ onBeforeMount(() => {
if
(
item
)
{
text
.
value
=
item
.
label
;
}
else
{
text
.
value
=
props
.
value
;
text
.
value
=
props
.
value
as
string
;
}
});
}
else
{
text
.
value
=
props
.
value
;
text
.
value
=
props
.
value
as
string
;
}
if
(
props
.
valueFormat
)
{
textFormat
.
value
=
props
.
valueFormat
;
...
...
@@ -128,6 +129,12 @@ onBeforeMount(() => {
}
else
if
(
Object
.
is
(
props
.
dataType
,
"NUMBER"
))
{
textFormat
.
value
=
`#
${
props
.
unitName
}
`
;
}
}
onBeforeMount
(()
=>
{
// 监听值变化
watch
(()
=>
props
.
value
,
(
newVal
:
any
,
oldVal
:
any
)
=>
{
if
(
newVal
!==
oldVal
)
initText
();
});
initText
();
});
</
script
>
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/widgets/form-control/form-control-state.ts
浏览文件 @
9aef90da
import
{
IParam
,
MainControlState
}
from
'@core'
;
import
{
ControlVOBase
,
IParam
,
MainControlState
}
from
'@core'
;
/**
* @description 表单部件状态
...
...
@@ -9,25 +9,25 @@ import { IParam, MainControlState } from '@core';
export
interface
FormControlState
extends
MainControlState
{
/**
* @description
表单数据对象
* @type {IParam}
* @description
新建默认值集合
* @type {IParam
[]
}
* @memberof FormControlState
*/
data
:
IParam
;
createDefaultItems
:
IParam
[]
;
/**
* @description 表单
成员模型
* @description 表单
数据对象
* @type {IParam}
* @memberof FormControlState
*/
d
etailsModel
:
IParam
;
d
ata
:
ControlVOBase
;
/**
* @description 表单
界面行为
模型
* @description 表单
成员
模型
* @type {IParam}
* @memberof FormControlState
*/
action
Model
:
IParam
;
details
Model
:
IParam
;
/**
* @description 值规则
...
...
@@ -42,4 +42,11 @@ export interface FormControlState extends MainControlState {
* @memberof FormControlState
*/
enableAutoSave
:
boolean
;
/**
* @description 更新默认值集合
* @type {IParam[]}
* @memberof FormControlState
*/
updateDefaultItems
:
IParam
[];
}
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/widgets/form-control/form-control.ts
浏览文件 @
9aef90da
...
...
@@ -43,15 +43,15 @@ export class FormControl extends MainControl {
* @memberof FormControl
*/
public
verifyGroupLogic
(
data
:
IParam
,
logic
:
IParam
)
{
if
(
logic
.
logicType
==
'GROUP'
&&
logic
.
l
ogics
?.
length
>
0
)
{
if
(
logic
.
logicType
==
'GROUP'
&&
logic
.
childL
ogics
?.
length
>
0
)
{
let
result
:
boolean
=
true
;
if
(
logic
.
groupOP
==
'AND'
)
{
const
falseItem
=
logic
.
l
ogics
.
find
((
childLogic
:
IParam
)
=>
{
const
falseItem
=
logic
.
childL
ogics
.
find
((
childLogic
:
IParam
)
=>
{
return
!
this
.
verifyGroupLogic
(
data
,
childLogic
);
});
result
=
falseItem
?
false
:
true
;
}
else
if
(
logic
.
groupOP
==
'OR'
)
{
const
trueItem
=
logic
.
l
ogics
.
find
((
childLogic
:
IParam
)
=>
{
const
trueItem
=
logic
.
childL
ogics
.
find
((
childLogic
:
IParam
)
=>
{
return
this
.
verifyGroupLogic
(
data
,
childLogic
);
});
result
=
trueItem
?
true
:
false
;
...
...
@@ -77,6 +77,10 @@ export class FormControl extends MainControl {
public
handleFormDataChange
(
name
:
string
,
value
:
any
)
{
const
{
enableAutoSave
}
=
this
.
state
;
const
{
data
}
=
toRefs
(
this
.
state
);
// 无标识或数据未变化不触发后续逻辑
if
(
!
name
||
Object
.
is
(
value
,
data
.
value
[
name
]))
{
return
;
}
data
.
value
[
name
]
=
value
;
this
.
resetFormData
(
name
);
this
.
formItemUpdate
(
name
);
...
...
@@ -110,24 +114,26 @@ export class FormControl extends MainControl {
*/
public
async
formItemUpdate
(
name
:
string
)
{
const
{
detailsModel
,
context
,
viewParams
,
controlService
}
=
this
.
state
;
const
{
data
}
=
toRefs
(
this
.
state
);
if
(
detailsModel
[
name
]
&&
detailsModel
[
name
].
formItemUpdate
)
{
const
formItemUpdate
=
detailsModel
[
name
].
formItemUpdate
;
if
(
formItemUpdate
.
customCode
)
{
if
(
formItemUpdate
.
scriptCode
)
{
const
{
data
:
_data
}
=
toRefs
(
this
.
state
);
let
data
:
any
=
_data
.
value
;
eval
(
formItemUpdate
.
scriptCode
);
}
}
else
{
const
arg
=
Object
.
assign
(
deepCopy
(
viewParams
),
data
.
value
);
const
{
data
}
=
toRefs
(
this
.
state
);
const
arg
=
Object
.
assign
(
deepCopy
(
viewParams
),
data
.
value
.
getDo
());
const
tempContext
=
deepCopy
(
context
);
const
response
=
await
controlService
.
frontLogic
(
tempContext
,
{
viewParams
:
arg
}
,
arg
,
{
action
:
formItemUpdate
.
appDEMethod
,
isLoading
:
formItemUpdate
.
showBusyIndicator
},
);
if
(
response
.
status
&&
response
.
status
==
200
)
{
formItemUpdate
.
updateDetails
?.
forEach
((
detailsName
:
string
)
=>
{
if
(
data
.
value
.
has
OwnPropert
y
(
detailsName
))
{
if
(
data
.
value
.
has
Ke
y
(
detailsName
))
{
data
.
value
[
detailsName
]
=
response
.
data
[
detailsName
];
}
});
...
...
@@ -209,7 +215,7 @@ export class FormControl extends MainControl {
switch
(
item
.
enableCond
)
{
case
0
:
// 不启用
item
.
disabled
=
fals
e
;
item
.
disabled
=
tru
e
;
break
;
case
1
:
// 新建
...
...
@@ -221,7 +227,7 @@ export class FormControl extends MainControl {
break
;
case
3
:
// 启用
item
.
disabled
=
tru
e
;
item
.
disabled
=
fals
e
;
break
;
default
:
break
;
...
...
@@ -247,7 +253,7 @@ export class FormControl extends MainControl {
item
.
isPower
=
tempModel
[
item
.
uIActionTag
].
dataActionResult
===
1
?
true
:
false
;
}
else
if
(
Object
.
is
(
item
.
detailType
,
'GROUPPANEL'
)
&&
item
.
uIActionGroup
?.
details
?.
length
>
0
)
{
// 更新分组面板界面行为组的权限状态值
item
.
u
i
ActionGroup
.
details
.
forEach
((
actionDetail
:
any
)
=>
{
item
.
u
I
ActionGroup
.
details
.
forEach
((
actionDetail
:
any
)
=>
{
actionDetail
.
visible
=
tempModel
[
actionDetail
.
uIActionTag
].
visible
;
actionDetail
.
disabled
=
tempModel
[
actionDetail
.
uIActionTag
].
disabled
;
});
...
...
@@ -276,85 +282,87 @@ export class FormControl extends MainControl {
* @memberof FormControl
*/
public
setCreateDefault
()
{
const
{
detailsModel
,
context
,
viewParams
,
controlService
}
=
this
.
state
;
const
{
createDefaultItems
,
context
,
viewParams
,
controlService
}
=
this
.
state
;
const
{
data
}
=
toRefs
(
this
.
state
);
Object
.
values
(
detailsModel
).
forEach
((
detail
:
IParam
)
=>
{
if
(
Object
.
is
(
detail
.
detailType
,
'FORMITEM'
))
{
if
((
detail
.
createDV
||
detail
.
createDVT
)
&&
data
.
value
.
hasOwnProperty
(
detail
.
codeName
))
{
switch
(
detail
.
createDVT
)
{
if
(
createDefaultItems
&&
createDefaultItems
.
length
)
{
createDefaultItems
.
forEach
((
item
:
IParam
)
=>
{
const
{
createDV
,
createDVT
,
property
,
dataType
,
valueFormat
}
=
item
;
if
((
createDV
||
createDVT
)
&&
data
.
value
.
hasKey
(
property
))
{
switch
(
createDVT
)
{
case
'CONTEXT'
:
data
.
value
[
detail
.
codeName
]
=
viewParams
[
detail
.
createDV
];
data
.
value
[
property
]
=
viewParams
[
createDV
];
break
;
case
'SESSION'
:
data
.
value
[
detail
.
codeName
]
=
context
[
detail
.
createDV
];
data
.
value
[
property
]
=
context
[
createDV
];
break
;
case
'APPDATA'
:
data
.
value
[
detail
.
codeName
]
=
context
[
detail
.
createDV
];
data
.
value
[
property
]
=
context
[
createDV
];
break
;
case
'OPERATORNAME'
:
data
.
value
[
detail
.
codeName
]
=
context
[
'srfusername'
];
data
.
value
[
property
]
=
context
[
'srfusername'
];
break
;
case
'OPERATOR'
:
data
.
value
[
detail
.
codeName
]
=
context
[
'srfuserid'
];
data
.
value
[
property
]
=
context
[
'srfuserid'
];
break
;
case
'CURTIME'
:
data
.
value
[
detail
.
codeName
]
=
dateFormat
(
new
Date
(),
detail
.
valueFormat
);
data
.
value
[
property
]
=
dateFormat
(
new
Date
(),
valueFormat
);
break
;
case
'PARAM'
:
data
.
value
[
detail
.
codeName
]
=
controlService
.
getRemoteCopyData
()?.[
detail
.
codeName
]
||
null
;
data
.
value
[
property
]
=
controlService
.
getRemoteCopyData
()?.[
property
]
||
null
;
break
;
default
:
data
.
value
[
detail
.
codeName
]
=
DataTypes
.
isNumber
(
detail
.
dataType
)
?
Number
(
detail
?.
createDV
)
:
detail
?.
createDV
;
data
.
value
[
property
]
=
DataTypes
.
isNumber
(
dataType
)
?
Number
(
createDV
)
:
createDV
;
break
;
}
}
}
});
}
}
/**
* @description 设置更新默认值
* @memberof FormControl
*/
public
setUpdateDefault
()
{
const
{
detailsModel
,
context
,
viewParams
,
controlService
}
=
this
.
state
;
const
{
updateDefaultItems
,
context
,
viewParams
,
controlService
}
=
this
.
state
;
const
{
data
}
=
toRefs
(
this
.
state
);
Object
.
values
(
detailsModel
).
forEach
((
detail
:
IParam
)
=>
{
if
(
Object
.
is
(
detail
.
detailType
,
'FORMITEM'
))
{
if
((
detail
.
updateDV
||
detail
.
updateDVT
)
&&
data
.
value
.
hasOwnProperty
(
detail
.
codeName
))
{
switch
(
detail
.
updateDVT
)
{
if
(
updateDefaultItems
&&
updateDefaultItems
.
length
)
{
updateDefaultItems
.
forEach
((
item
:
IParam
)
=>
{
const
{
updateDV
,
updateDVT
,
property
,
dataType
,
valueFormat
}
=
item
;
if
((
updateDV
||
updateDVT
)
&&
data
.
value
.
hasKey
(
property
))
{
switch
(
updateDVT
)
{
case
'CONTEXT'
:
data
.
value
[
detail
.
codeName
]
=
viewParams
[
detail
.
updateDV
];
data
.
value
[
property
]
=
viewParams
[
updateDV
];
break
;
case
'SESSION'
:
data
.
value
[
detail
.
codeName
]
=
context
[
detail
.
updateDV
];
data
.
value
[
property
]
=
context
[
updateDV
];
break
;
case
'APPDATA'
:
data
.
value
[
detail
.
codeName
]
=
context
[
detail
.
updateDV
];
data
.
value
[
property
]
=
context
[
updateDV
];
break
;
case
'OPERATORNAME'
:
data
.
value
[
detail
.
codeName
]
=
context
[
'srfusername'
];
data
.
value
[
property
]
=
context
[
'srfusername'
];
break
;
case
'OPERATOR'
:
data
.
value
[
detail
.
codeName
]
=
context
[
'srfuserid'
];
data
.
value
[
property
]
=
context
[
'srfuserid'
];
break
;
case
'CURTIME'
:
data
.
value
[
detail
.
codeName
]
=
dateFormat
(
new
Date
(),
detail
.
valueFormat
);
data
.
value
[
property
]
=
dateFormat
(
new
Date
(),
valueFormat
);
break
;
case
'PARAM'
:
data
.
value
[
detail
.
codeName
]
=
controlService
.
getRemoteCopyData
()?.[
detail
.
codeName
]
||
null
;
data
.
value
[
property
]
=
controlService
.
getRemoteCopyData
()?.[
property
]
||
null
;
break
;
default
:
data
.
value
[
detail
.
codeName
]
=
DataTypes
.
isNumber
(
detail
.
dataType
)
?
Number
(
detail
.
updateDV
)
:
detail
.
updateDV
;
data
.
value
[
property
]
=
DataTypes
.
isNumber
(
dataType
)
?
Number
(
updateDV
)
:
updateDV
;
break
;
}
}
})
}
});
}
/**
...
...
@@ -726,6 +734,9 @@ export class FormControl extends MainControl {
case
'formGroupAction'
:
this
.
handleFormGroupAction
(
tag
,
data
);
break
;
case
'formButtonAction'
:
this
.
handleFormButtonAction
(
tag
,
data
);
break
;
default
:
break
;
}
...
...
@@ -733,12 +744,48 @@ export class FormControl extends MainControl {
/**
* @description 处理表单分组行为
* @param {string} tag
* @protected
* @param {string} 标识
* @param {*} data 数据
* @memberof FormControl
*/
protected
handleFormGroupAction
(
tag
:
string
,
data
:
any
)
{
this
.
handleUIAction
(
data
);
}
/**
* @description 处理表单按钮界面行为
* @protected
* @param {string} tag 按钮标识
* @param {*} data 数据
* @memberof FormControl
*/
protected
handleFormButtonAction
(
tag
:
string
,
data
:
any
)
{
this
.
handleUIAction
(
data
);
}
/**
* @description 处理界面行为
* @private
* @param {*} data
* @return {*}
* @memberof FormControl
*/
public
handleFormGroupAction
(
tag
:
string
,
data
:
any
)
{
console
.
log
(
tag
,
data
);
private
handleUIAction
(
data
:
any
)
{
if
(
!
data
)
{
console
.
warn
(
"工具栏执行参数不足"
);
return
;
}
// 准备参数
const
inputParam
=
{
context
:
this
.
state
.
context
,
viewParams
:
this
.
state
.
viewParams
,
data
:
this
.
getData
(),
event
:
data
.
event
,
actionEnvironment
:
this
};
// 执行行为
App
.
getAppActionService
().
execute
(
data
,
inputParam
);
}
/**
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/widgets/grid-control/grid-control.ts
浏览文件 @
9aef90da
...
...
@@ -509,7 +509,7 @@ export class GridControl extends MDControl {
const
{
groupField
}
=
gridGroup
;
let
autoGroup
:
string
[]
=
[];
items
.
value
.
forEach
((
item
:
IParam
)
=>
{
if
(
item
.
has
OwnPropert
y
(
groupField
))
{
if
(
item
.
has
Ke
y
(
groupField
))
{
autoGroup
.
push
(
item
[
groupField
]);
}
})
...
...
@@ -652,13 +652,13 @@ export class GridControl extends MDControl {
* @memberof GridControl
*/
protected
setCreateDefault
(
row
:
IParam
=
{}):
void
{
const
{
createDefaultItems
,
viewParams
,
context
,
items
}
=
this
.
state
;
const
{
createDefaultItems
,
viewParams
,
context
}
=
this
.
state
;
if
(
createDefaultItems
.
length
===
0
)
{
return
;
}
createDefaultItems
.
forEach
((
item
:
IParam
)
=>
{
const
{
createDVT
,
createDV
,
property
,
valueFormat
,
field
Type
}
=
item
;
if
(
createDVT
&&
(
row
.
hasOwnProperty
(
property
)
||
property
in
row
))
{
const
{
createDVT
,
createDV
,
property
,
valueFormat
,
data
Type
}
=
item
;
if
(
createDVT
&&
row
.
hasKey
(
property
))
{
switch
(
createDVT
)
{
case
"CONTEXT"
:
if
(
createDV
)
{
...
...
@@ -686,8 +686,8 @@ export class GridControl extends MDControl {
}
break
;
}
}
else
if
(
createDV
&&
(
row
.
hasOwnProperty
(
property
)
||
property
in
row
))
{
row
[
property
]
=
fieldType
&&
DataTypes
.
isNumber
(
field
Type
)
?
Number
(
createDV
)
:
createDV
;
}
else
if
(
createDV
&&
row
.
hasKey
(
property
))
{
row
[
property
]
=
dataType
&&
DataTypes
.
isNumber
(
data
Type
)
?
Number
(
createDV
)
:
createDV
;
}
});
}
...
...
@@ -700,14 +700,14 @@ export class GridControl extends MDControl {
* @memberof GridControl
*/
protected
setUpdateDefault
():
void
{
const
{
updateDefaultItems
,
viewParams
,
context
,
items
,
controlService
}
=
this
.
state
;
const
{
updateDefaultItems
,
viewParams
,
context
,
items
}
=
this
.
state
;
if
(
updateDefaultItems
.
length
===
0
||
items
.
length
===
0
)
{
return
;
}
const
setDefault
=
(
row
:
IParam
=
{})
=>
{
updateDefaultItems
.
forEach
((
item
:
IParam
)
=>
{
const
{
updateDV
,
updateDVT
,
property
,
valueFormat
,
field
Type
}
=
item
;
if
(
updateDVT
&&
(
row
.
hasOwnProperty
(
property
)
||
property
in
row
))
{
const
{
updateDV
,
updateDVT
,
property
,
valueFormat
,
data
Type
}
=
item
;
if
(
updateDVT
&&
row
.
hasKey
(
property
))
{
switch
(
updateDVT
)
{
case
"CONTEXT"
:
if
(
updateDV
)
{
...
...
@@ -735,8 +735,8 @@ export class GridControl extends MDControl {
}
break
;
}
}
else
if
(
updateDV
&&
row
.
has
OwnPropert
y
(
property
))
{
row
[
property
]
=
fieldType
&&
DataTypes
.
isNumber
(
field
Type
)
?
Number
(
updateDV
)
:
updateDV
;
}
else
if
(
updateDV
&&
row
.
has
Ke
y
(
property
))
{
row
[
property
]
=
dataType
&&
DataTypes
.
isNumber
(
data
Type
)
?
Number
(
updateDV
)
:
updateDV
;
}
});
}
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/widgets/md-control/md-control-state.ts
浏览文件 @
9aef90da
import
{
IParam
,
MainControlState
}
from
'@core'
;
import
{
ControlVOBase
,
IParam
,
MainControlState
}
from
'@core'
;
/**
* @description 多数据部件状态
...
...
@@ -20,7 +20,7 @@ export interface MDControlState extends MainControlState {
* @type {IParam[]}
* @memberof MDControlState
*/
items
:
IParam
[];
items
:
ControlVOBase
[];
/**
* @description 是否多选
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/runtime/control-vo/control-vo-base.ts
浏览文件 @
9aef90da
import
{
deepCopy
}
from
'@core'
;
import
{
deepCopy
,
IParam
}
from
'@core'
;
export
class
ControlVOBase
{
/**
* 后台数据对象
*
@description
后台数据对象
* @protected
* @type {*}
* @memberof ControlVOBase
*/
protected
$DO
:
any
=
{};
/**
* 自有属性名称集合
* @description 自有属性名称集合
* @type {string[]}
* @memberof ControlVOBase
*/
public
$ownKeys
:
string
[]
=
[];
...
...
@@ -91,6 +95,19 @@ export class ControlVOBase {
return
{};
}
/**
* @description 是否含有属性
* @param {string} key 属性名
* @return {*} {boolean}
* @memberof ControlVOBase
*/
public
hasKey
(
key
:
string
):
boolean
{
if
(
this
.
hasOwnProperty
(
key
)
||
key
in
this
)
{
return
true
;
}
return
false
;
}
/**
* 用后台数据重置数据对象
* @param data 后台数据
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/widgets/{{appEntities}}/{{ctrls@FORM}}-form/{{ctrls@FORM}}-form-state.ts.hbs
浏览文件 @
9aef90da
...
...
@@ -51,15 +51,56 @@ export const ctrlState = {
controlName: '
{{
ctrl
.
name
}}
',
controlService: new EditFormService
<ControlVO>
(ControlVO, new
{{
pascalCase
ctrl
.
psAppDataEntity
.
codeName
}}
Service() ),
data: new ControlVO({}),
{{#
each
ctrl
.
psAppDataEntity
.
allPSAppDEFields
as
|
appDEField
|
}}
{{#if
appDEField
.
keyField
}}
appDeKeyFieldName: '
{{
appDEField
.
codeName
}}
',
appEntityCodeName: '
{{
ctrl
.
appEntity
.
codeName
}}
',
appDeCodeName:'
{{
ctrl
.
appEntity
.
codeName
}}
',
appDeLogicName: '
{{
ctrl
.
appEntity
.
logicName
}}
',
appDeKeyFieldName: '
{{#if
ctrl
.
appEntity
.
keyPSAppDEField
}}{{
ctrl
.
appEntity
.
keyPSAppDEField
.
codeName
}}{{/if}}
',
appDeMajorFieldName: '
{{#if
ctrl
.
appEntity
.
majorPSAppDEField
}}{{
ctrl
.
appEntity
.
majorPSAppDEField
.
codeName
}}{{/if}}
',
enableAutoSave:
{{
ctrl
.
enableAutoSave
}}
,
// 新建默认值
createDefaultItems: [
{{#
each
ctrl
.
psDEFormItems
as
|
formItem
|
}}
{{#
formItem
}}
{{#if
(
or
createDV
createDVT
)
}}
{
createDV: "
{{
createDV
}}
",
createDVT: "
{{
createDVT
}}
",
property: "
{{
lowerCase
id
}}
",
{{#if
(
and
psEditor
psEditor
.
dateTimeFormat
)
}}
valueFormat: "
{{
editItem
.
psEditor
.
dateTimeFormat
}}
",
{{else
if
psAppDEField
}}
valueFormat: "
{{
psAppDEField
.
valueFormat
}}
",
{{/if}}
{{#if
psAppDEField
}}
dataType: "
{{
psAppDEField
.
stdDataType
}}
"
{{/if}}
{{#if
appDEField
.
majorField
}}
appDeMajorFieldName: '
{{
appDEField
.
codeName
}}
',
}
{{#
unless
@last
}}
,
{{/
unless
}}
{{/if}}
{{/
formItem
}}
{{/
each
}}
enableAutoSave:
{{
ctrl
.
enableAutoSave
}}
,
],
// 更新默认值
updateDefaultItems: [
{{#
each
ctrl
.
psDEFormItems
as
|
formItem
|
}}
{{#
formItem
}}
{{#if
(
or
updateDV
updateDVT
)
}}
{
updateDV: "
{{
updateDV
}}
",
updateDVT: "
{{
updateDVT
}}
",
property: "
{{
lowerCase
id
}}
",
{{#if
(
and
psEditor
psEditor
.
dateTimeFormat
)
}}
valueFormat: "
{{
editItem
.
psEditor
.
dateTimeFormat
}}
",
{{else
if
psAppDEField
}}
valueFormat: "
{{
psAppDEField
.
valueFormat
}}
",
{{/if}}
{{#if
psAppDEField
}}
dataType: "
{{
psAppDEField
.
stdDataType
}}
"
{{/if}}
}
{{#
unless
@last
}}
,
{{/
unless
}}
{{/if}}
{{/
formItem
}}
{{/
each
}}
],
detailsModel: {
{{#if
ctrl
.
psDEFormPages
}}
{{#
each
ctrl
.
psDEFormPages
as
|
FormPage
|
}}
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/widgets/{{appEntities}}/{{ctrls@GRID}}-grid/{{ctrls@GRID}}-grid-state.ts.hbs
浏览文件 @
9aef90da
...
...
@@ -48,7 +48,7 @@ export const ctrlState = {
valueFormat: "
{{
editItem
.
psAppDEField
.
valueFormat
}}
",
{{/if}}
{{#if
editItem
.
psAppDEField
}}
field
Type: "
{{
editItem
.
psAppDEField
.
stdDataType
}}
"
data
Type: "
{{
editItem
.
psAppDEField
.
stdDataType
}}
"
{{/if}}
}
{{#
unless
@last
}}
,
{{/
unless
}}
{{/if}}
...
...
@@ -180,7 +180,7 @@ export const ctrlState = {
valueFormat: "
{{
editItem
.
psAppDEField
.
valueFormat
}}
",
{{/if}}
{{#if
editItem
.
psAppDEField
}}
field
Type: "
{{
editItem
.
psAppDEField
.
stdDataType
}}
"
data
Type: "
{{
editItem
.
psAppDEField
.
stdDataType
}}
"
{{/if}}
}
{{#
unless
@last
}}
,
{{/
unless
}}
{{/if}}
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录