Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibizlab-generator
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibizlab-generator
提交
f1c2bb55
提交
f1c2bb55
编写于
2月 17, 2022
作者:
Mosher
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update:更新表单
1、标签位置支持 2、样式调整 3、表单分组标题栏关闭模式支持
上级
792791c5
变更
4
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
87 行增加
和
30 行删除
+87
-30
form-item.hbs
...mpl/r7/@macro/front-end/widgets/form-detail/form-item.hbs
+23
-23
app-form-group.vue
.../r7/app_{{apps}}/src/components/common/app-form-group.vue
+33
-5
app-form-item.vue
...l/r7/app_{{apps}}/src/components/common/app-form-item.vue
+22
-0
app-input.vue
...empl/r7/app_{{apps}}/src/components/editors/app-input.vue
+9
-2
未找到文件。
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/front-end/widgets/form-detail/form-item.hbs
浏览文件 @
f1c2bb55
{{#
neq
item
.
psEditor
.
editorType
"HIDDEN"
}}
{{#
neq
item
.
psEditor
.
editorType
"HIDDEN"
}}
<AppFormItem
<AppFormItem
name=
"
{{
item
.
codeName
}}
"
name=
"
{{
item
.
codeName
}}
"
{{#if
item
.
captionItemName
}}
{{#if
item
.
captionItemName
}}
:label=
"state.data.
{{
lowerCase
item
.
captionItemName
}}
"
:label=
"state.data.
{{
lowerCase
item
.
captionItemName
}}
"
{{else}}
{{else}}
label=
"
{{
item
.
caption
}}
"
label=
"
{{
item
.
caption
}}
"
{{/if}}
{{/if}}
{{#if
item
.
labelPos
}}
{{#if
item
.
labelPos
}}
labelPos=
"
{{
item
.
labelPos
}}
"
labelPos=
"
{{
item
.
labelPos
}}
"
{{/if}}
{{/if}}
:labelWidth=
"
{{
item
.
labelWidth
}}
"
:labelWidth=
"
{{
item
.
labelWidth
}}
"
:showLabel=
"
{{
item
.
showCaption
}}
"
:showLabel=
"
{{
item
.
showCaption
}}
"
:rules=
"state.rules.
{{
item
.
codeName
}}
"
:rules=
"state.rules.
{{
item
.
codeName
}}
"
:required=
"state.detailsModel.
{{
item
.
codeName
}}
.required"
:required=
"state.detailsModel.
{{
item
.
codeName
}}
.required"
:visible=
"state.detailsModel.
{{
item
.
codeName
}}
.visible"
:visible=
"state.detailsModel.
{{
item
.
codeName
}}
.visible"
:layoutOpts=
"
{{>
@macro
/
front-end
/
common
/
layoutPos
.
hbs
layout
=
item
.
psLayout
layoutPos
=
item
.
psLayoutPos
}}
"
:layoutOpts=
"
{{>
@macro
/
front-end
/
common
/
layoutPos
.
hbs
layout
=
item
.
psLayout
layoutPos
=
item
.
psLayoutPos
}}
"
{{#if
item
.
psSysCss
}}
{{#if
item
.
psSysCss
}}
class=
"
{{
item
.
psSysCss
.
cssName
}}
"
class=
"
{{
item
.
psSysCss
.
cssName
}}
"
{{/if}}
{{/if}}
{{#if
item
.
labelPSSysCss
}}
{{#if
item
.
labelPSSysCss
}}
labelClass=
"
{{
item
.
labelPSSysCss
.
cssName
}}
"
labelClass=
"
{{
item
.
labelPSSysCss
.
cssName
}}
"
{{/if}}
{{/if}}
{{#if
(
or
item
.
width
item
.
height
)
}}
{{#if
(
or
item
.
width
item
.
height
)
}}
style=
"
{{#if
item
.
width
}}
width:
{{
item
.
width
}}
px;
{{/if}}{{#if
item
.
height
}}
height:
{{
item
.
height
}}
px;
{{/if}}
"
style=
"
{{#if
item
.
width
}}
width:
{{
item
.
width
}}
px;
{{/if}}{{#if
item
.
height
}}
height:
{{
item
.
height
}}
px;
{{/if}}
"
{{/if}}
{{/if}}
>
>
{{#if
item
.
psEditor
}}
{{#if
item
.
psEditor
}}
<div
class=
"form-editor-container"
style=
"
{{#if
item
.
editorWidth
}}
width:
{{
item
.
editorWidth
}}
px;
{{/if}}{{#if
item
.
editorHeight
}}
height:
{{
item
.
editorHeight
}}
px
{{/if}}
"
>
<div
class=
"form-editor-container"
style=
"
{{#if
item
.
psEditor
.
editorWidth
}}
width:
{{
item
.
psEditor
.
editorWidth
}}
px;
{{/if}}{{#if
item
.
psEditor
.
editorHeight
}}
height:
{{
item
.
psEditor
.
editorHeight
}}
px
{{/if}}
"
>
{{>
@macro
/
front-end
/
editors
/
include-editor
.
hbs
type
=
item
.
psEditor
.
editorType
item
=
item
ctrlType
=
"form"
}}
{{>
@macro
/
front-end
/
editors
/
include-editor
.
hbs
type
=
item
.
psEditor
.
editorType
item
=
item
ctrlType
=
"form"
}}
</div>
</div>
{{/if}}
{{/if}}
</AppFormItem>
</AppFormItem>
{{/
neq
}}
{{/
neq
}}
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/components/common/app-form-group.vue
浏览文件 @
f1c2bb55
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
Ref
,
ref
}
from
"vue"
;
import
{
IActionParam
,
ILayoutOpts
,
IParam
}
from
"@core"
;
import
{
IActionParam
,
ILayoutOpts
,
IParam
}
from
"@core"
;
interface
FormGroupProps
{
interface
FormGroupProps
{
...
@@ -9,7 +10,7 @@ interface FormGroupProps {
...
@@ -9,7 +10,7 @@ interface FormGroupProps {
iconClass
?:
string
;
iconClass
?:
string
;
titleClass
?:
string
;
titleClass
?:
string
;
infoGroupMode
?:
boolean
;
infoGroupMode
?:
boolean
;
titleBarCloseMode
?:
number
;
titleBarCloseMode
?:
number
|
0
|
1
|
2
;
showCaption
?:
boolean
;
showCaption
?:
boolean
;
visible
?:
boolean
;
visible
?:
boolean
;
uIActionGroup
?:
IParam
;
uIActionGroup
?:
IParam
;
...
@@ -27,13 +28,21 @@ const emit = defineEmits<FormGroupEmit>();
...
@@ -27,13 +28,21 @@ const emit = defineEmits<FormGroupEmit>();
const
handleGroupAction
=
(
action
:
IParam
)
=>
{
const
handleGroupAction
=
(
action
:
IParam
)
=>
{
emit
(
'componentEvent'
,
{
tag
:
props
.
name
,
action
:
'formGroupAction'
,
data
:
action
});
emit
(
'componentEvent'
,
{
tag
:
props
.
name
,
action
:
'formGroupAction'
,
data
:
action
});
}
}
// 显示内容区
const
showContent
:
Ref
<
boolean
>
=
ref
(
props
.
titleBarCloseMode
===
2
?
false
:
true
);
const
handleMenuGroupAction
=
(
$event
:
IParam
)
=>
{
const
handleMenuGroupAction
=
(
$event
:
IParam
)
=>
{
if
(
props
.
uIActionGroup
&&
props
.
uIActionGroup
.
details
?.
length
>
0
)
{
if
(
props
.
uIActionGroup
&&
props
.
uIActionGroup
.
details
?.
length
>
0
)
{
const
details
=
props
.
uIActionGroup
.
details
;
const
details
=
props
.
uIActionGroup
.
details
;
const
detail
=
details
.
find
((
action
:
IParam
)
=>
Object
.
is
(
action
.
uIActionTag
,
$event
.
key
));
const
detail
=
details
.
find
((
action
:
IParam
)
=>
Object
.
is
(
action
.
uIActionTag
,
$event
.
key
));
emit
(
'componentEvent'
,
{
tag
:
props
.
name
,
action
:
'formGroupAction'
,
data
:
detail
});
emit
(
'componentEvent'
,
{
tag
:
props
.
name
,
action
:
'formGroupAction'
,
data
:
detail
});
}
}
}
}
// 处理内容显示状态变化
const
handleContentShowStatusChange
=
(
event
:
MouseEvent
)
=>
{
event
.
stopPropagation
();
showContent
.
value
=
!
showContent
.
value
;
}
</
script
>
</
script
>
<
template
>
<
template
>
...
@@ -46,6 +55,11 @@ const handleMenuGroupAction = ($event: IParam) => {
...
@@ -46,6 +55,11 @@ const handleMenuGroupAction = ($event: IParam) => {
<template
#
default=
"
{ slotClass, slotStyle }">
<template
#
default=
"
{ slotClass, slotStyle }">
<a-card
:class=
"slotClass"
:style=
"slotStyle"
:headStyle=
"titleClass"
:bordered=
"false"
>
<a-card
:class=
"slotClass"
:style=
"slotStyle"
:headStyle=
"titleClass"
:bordered=
"false"
>
<template
v-if=
"showCaption"
#
title
>
<template
v-if=
"showCaption"
#
title
>
<template
v-if=
"titleBarCloseMode === 1 || titleBarCloseMode === 2"
>
<span
:class=
"['fa', 'show-content-icon', showContent ? 'fa-chevron-circle-up' : 'fa-chevron-circle-down']"
@
click=
"handleContentShowStatusChange"
></span>
</
template
>
<p
class=
"app-form-group-title"
>
<p
class=
"app-form-group-title"
>
<AppIconText
:iconClass=
"iconClass"
:imgPath=
"imgPath"
:text=
"title"
/>
<AppIconText
:iconClass=
"iconClass"
:imgPath=
"imgPath"
:text=
"title"
/>
</p>
</p>
...
@@ -93,7 +107,7 @@ const handleMenuGroupAction = ($event: IParam) => {
...
@@ -93,7 +107,7 @@ const handleMenuGroupAction = ($event: IParam) => {
</
template
>
</
template
>
</template>
</template>
</template>
</template>
<AppRow
:layoutOpts=
"layoutOpts"
>
<AppRow
v-if=
"showContent"
:layoutOpts=
"layoutOpts"
>
<slot></slot>
<slot></slot>
</AppRow>
</AppRow>
</a-card>
</a-card>
...
@@ -105,13 +119,27 @@ const handleMenuGroupAction = ($event: IParam) => {
...
@@ -105,13 +119,27 @@ const handleMenuGroupAction = ($event: IParam) => {
.app-form-group
{
.app-form-group
{
.ant-card-head
{
.ant-card-head
{
text-align
:
left
;
text-align
:
left
;
max-height
:
60px
;
height
:
38px
;
min-height
:
38px
;
.ant-card-head-title
,
.ant-card-extra
{
padding
:
6px
0
;
}
.app-form-group-title
{
.app-form-group-title
{
margin
:
0px
;
margin
:
0px
;
}
}
}
}
.ant-card-body
{
.ant-card-body
{
height
:
calc
(
100%
-
60px
);
height
:
calc
(
100%
-
38px
);
padding-top
:
6px
;
}
}
.show-content-icon
{
position
:
absolute
;
top
:
0
;
transform
:
translateY
(
60%
);
&
+
.app-form-group-title
{
padding-left
:
16px
;
}
}
}
}
</
style
>
</
style
>
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/components/common/app-form-item.vue
浏览文件 @
f1c2bb55
...
@@ -78,4 +78,26 @@ const initRules = () => {
...
@@ -78,4 +78,26 @@ const initRules = () => {
</template>
</template>
<
style
lang=
"scss"
>
<
style
lang=
"scss"
>
// 上方标签
.app-form-item.label-top
{
flex-direction
:
column
;
}
// 下方标签
.app-form-item.label-bottom
{
flex-direction
:
column-reverse
;
}
.app-form-item.label-right
{
flex-direction
:
row-reverse
;
}
// 标题在下方时调整错误提示位置
.ant-form-item-has-error.label-bottom
{
.ant-form-item-control
{
position
:
relative
;
}
.ant-form-item-explain-error
{
position
:
absolute
;
right
:
0
;
top
:
100%
;
}
}
</
style
>
</
style
>
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/components/editors/app-input.vue
浏览文件 @
f1c2bb55
...
@@ -92,7 +92,6 @@ const onChange = ($event: any) => {
...
@@ -92,7 +92,6 @@ const onChange = ($event: any) => {
@
blur=
"onChange"
@
blur=
"onChange"
:placeholder=
"placeholder"
/>
:placeholder=
"placeholder"
/>
<a-textarea
<a-textarea
showCount
v-else-if=
"Object.is('textarea', type)"
v-else-if=
"Object.is('textarea', type)"
v-model:value=
"value"
v-model:value=
"value"
:disabled=
"disabled"
:disabled=
"disabled"
...
@@ -109,4 +108,12 @@ const onChange = ($event: any) => {
...
@@ -109,4 +108,12 @@ const onChange = ($event: any) => {
@
blur=
"onChange"
@
blur=
"onChange"
:placeholder=
"showMaxLength && maxLength ? `最大内容长度为$
{maxLength}` : placeholder" />
:placeholder=
"showMaxLength && maxLength ? `最大内容长度为$
{maxLength}` : placeholder" />
</div>
</div>
</
template
>
</
template
>
\ No newline at end of file
<
style
scoped
>
.app-editor-container
,
.app-editor-container
.ant-input
{
width
:
100%
;
height
:
100%
;
}
</
style
>
\ No newline at end of file
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录