Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
fill-system
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
廖旭伟
fill-system
Commits
d2cf80b1
Commit
d2cf80b1
authored
Nov 22, 2024
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加级联
parent
536ee4b3
Pipeline
#2852
canceled with stages
Changes
7
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
119 additions
and
35 deletions
+119
-35
fill-manager/src/main/java/com/mortals/xhx/common/code/ComponentEnum.java
.../main/java/com/mortals/xhx/common/code/ComponentEnum.java
+4
-1
fill-manager/src/main/java/com/mortals/xhx/common/formdesign/DesignComponent.java
...va/com/mortals/xhx/common/formdesign/DesignComponent.java
+2
-0
fill-manager/src/main/java/com/mortals/xhx/common/formdesign/ListItem.java
...main/java/com/mortals/xhx/common/formdesign/ListItem.java
+1
-1
fill-manager/src/main/java/com/mortals/xhx/common/formdesign/component/DesignCascadeComponent.java
...x/common/formdesign/component/DesignCascadeComponent.java
+95
-0
fill-manager/src/main/java/com/mortals/xhx/common/pdu/gen/ChildrenItem.java
...ain/java/com/mortals/xhx/common/pdu/gen/ChildrenItem.java
+1
-1
fill-manager/src/main/java/com/mortals/xhx/common/pdu/gen/Props.java
...r/src/main/java/com/mortals/xhx/common/pdu/gen/Props.java
+0
-29
fill-manager/src/main/java/com/mortals/xhx/module/matter/service/impl/MatterDatumServiceImpl.java
...hx/module/matter/service/impl/MatterDatumServiceImpl.java
+16
-3
No files found.
fill-manager/src/main/java/com/mortals/xhx/common/code/ComponentEnum.java
View file @
d2cf80b1
...
...
@@ -19,7 +19,10 @@ public enum ComponentEnum {
AREA
(
"area"
,
"区域选择栏"
),
IMAGE
(
"@image"
,
"图片选择"
),
LIST
(
"list"
,
"横向单列表"
),
DYNAMIC_TABLE
(
"dt"
,
"动态表格"
),;
DYNAMIC_TABLE
(
"dt"
,
"动态表格"
),
CASCADE
(
"csd"
,
"级联选择"
),
;
private
String
value
;
private
String
desc
;
...
...
fill-manager/src/main/java/com/mortals/xhx/common/formdesign/DesignComponent.java
View file @
d2cf80b1
...
...
@@ -40,6 +40,8 @@ public abstract class DesignComponent {
return
new
DesignListComponent
(
type
);
}
else
if
(
type
.
equals
(
ComponentEnum
.
DYNAMIC_TABLE
.
getValue
()))
{
return
new
DesignDynamicTableComponent
(
type
);
}
else
if
(
type
.
equals
(
ComponentEnum
.
CASCADE
.
getValue
()))
{
return
new
DesignCascadeComponent
(
type
);
}
// else if (type.equals(ComponentEnum.AREA.getValue())) {
// return new AreaComponent(type);
...
...
fill-manager/src/main/java/com/mortals/xhx/common/formdesign/ListItem.java
View file @
d2cf80b1
...
...
@@ -232,7 +232,7 @@ public class ListItem{
private
String
placeholder
;
@JSONField
(
name
=
"china-area-data"
)
private
Boolean
chinaAreaData
;
private
String
chinaAreaData
;
@JSONField
(
name
=
"color-format"
)
private
String
colorFormat
;
...
...
fill-manager/src/main/java/com/mortals/xhx/common/formdesign/component/DesignCascadeComponent.java
0 → 100644
View file @
d2cf80b1
package
com.mortals.xhx.common.formdesign.component
;
import
com.mortals.xhx.common.code.ComponentEnum
;
import
com.mortals.xhx.common.formdesign.*
;
import
com.mortals.xhx.common.pdu.gen.component.ComponentCons
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* 级联选择组件
*
* @author: zxfei
* @date: 2024/11/22 9:24
*/
public
class
DesignCascadeComponent
extends
DesignComponent
{
public
DesignCascadeComponent
(
String
type
)
{
super
(
type
);
}
@Override
public
ListItem
buildDefaultComponent
(
ComponentCons
cons
)
{
ListItem
columnsItem
=
new
ListItem
();
columnsItem
.
setId
(
cons
.
getVal
());
columnsItem
.
set_id
(
cons
.
getVal
());
columnsItem
.
setCompType
(
"cascader"
);
columnsItem
.
setEle
(
"el-cascader"
);
columnsItem
.
setCompName
(
"级联选择"
);
columnsItem
.
setCompIcon
(
"cascader"
);
columnsItem
.
setViewType
(
"component"
);
columnsItem
.
setType
(
"textarea"
);
columnsItem
.
setConfig
(
true
);
columnsItem
.
setShowLabel
(
true
);
columnsItem
.
setLabel
(
cons
.
getLabel
());
columnsItem
.
setLabelWidth
(
120
);
columnsItem
.
setPlaceholder
(
"请选择"
+
cons
.
getLabel
());
columnsItem
.
setRequired
(
false
);
columnsItem
.
setGutter
(
15
);
columnsItem
.
setSpan
(
24
);
columnsItem
.
setSize
(
"medium"
);
columnsItem
.
setDisabled
(
false
);
columnsItem
.
setDataType
(
"static"
);
columnsItem
.
setChinaAreaData
(
""
);
//Props 设置
Props
props
=
new
Props
();
props
.
setClearable
(
false
);
props
.
setSeparator
(
"/"
);
props
.
setShowAllLevels
(
false
);
props
.
setFilterable
(
false
);
Props
propsChild
=
new
Props
();
propsChild
.
setExpandTrigger
(
"click"
);
propsChild
.
setMultiple
(
false
);
propsChild
.
setCheckStrictly
(
false
);
propsChild
.
setLabel
(
"lable"
);
propsChild
.
setValue
(
"value"
);
propsChild
.
setChildren
(
"children"
);
props
.
setProps
(
props
);
columnsItem
.
setProps
(
props
);
//设置options
List
<
OptionsItem
>
options
=
new
ArrayList
<>();
OptionsItem
optionsItem
=
new
OptionsItem
();
optionsItem
.
setValue
(
"zhinan"
);
optionsItem
.
setLabel
(
"指南"
);
List
<
ChildrenItem
>
children
=
new
ArrayList
<>();
ChildrenItem
child
=
new
ChildrenItem
();
child
.
setValue
(
"shejiyuanze"
);
child
.
setLabel
(
"设计原则"
);
children
.
add
(
child
);
optionsItem
.
setChildren
(
children
);
List
<
ChildrenItem
>
children1
=
new
ArrayList
<>();
ChildrenItem
child1
=
new
ChildrenItem
();
child1
.
setValue
(
"yizhi"
);
child1
.
setLabel
(
"一致"
);
children1
.
add
(
child1
);
child
.
setChildren
(
children1
);
columnsItem
.
setOptions
(
options
);
//设置默认值
columnsItem
.
setLayout
(
"colItem"
);
columnsItem
.
setValue
(
new
ArrayList
<>());
return
columnsItem
;
}
@Override
public
String
getType
()
{
return
ComponentEnum
.
TEXTAREA
.
getValue
();
}
}
fill-manager/src/main/java/com/mortals/xhx/common/pdu/gen/ChildrenItem.java
View file @
d2cf80b1
...
...
@@ -10,7 +10,7 @@ import lombok.Data;
* @date: 2021/10/15 10:26
*/
@Data
public
class
ChildrenItem
{
public
class
ChildrenItem
{
@JSONField
(
name
=
"id"
)
private
Integer
id
;
...
...
fill-manager/src/main/java/com/mortals/xhx/common/pdu/gen/Props.java
deleted
100644 → 0
View file @
536ee4b3
package
com.mortals.xhx.common.pdu.gen
;
import
com.alibaba.fastjson.annotation.JSONField
;
import
lombok.Data
;
/**
* 配置
*
* @author: zxfei
* @date: 2021/10/15 10:27
*/
@Data
public
class
Props
{
@JSONField
(
name
=
"props"
)
private
Props
props
;
@JSONField
(
name
=
"children"
)
private
String
children
;
@JSONField
(
name
=
"multiple"
)
private
Boolean
multiple
;
@JSONField
(
name
=
"label"
)
private
String
label
;
@JSONField
(
name
=
"value"
)
private
String
value
;
}
\ No newline at end of file
fill-manager/src/main/java/com/mortals/xhx/module/matter/service/impl/MatterDatumServiceImpl.java
View file @
d2cf80b1
...
...
@@ -48,6 +48,7 @@ import com.mortals.xhx.module.matter.service.MatterService;
import
com.mortals.xhx.module.pubdatum.model.PubdatumEntity
;
import
com.mortals.xhx.module.pubdatum.model.PubdatumQuery
;
import
com.mortals.xhx.module.pubdatum.service.PubdatumService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.io.FilenameUtils
;
import
org.apache.http.entity.ContentType
;
...
...
@@ -77,6 +78,7 @@ import java.util.stream.Collectors;
* @date 2022-09-27
*/
@Service
(
"matterDatumService"
)
@Slf4j
public
class
MatterDatumServiceImpl
extends
AbstractCRUDServiceImpl
<
MatterDatumDao
,
MatterDatumEntity
,
Long
>
implements
MatterDatumService
{
@Value
(
"${upload.path}"
)
...
...
@@ -371,7 +373,7 @@ public class MatterDatumServiceImpl extends AbstractCRUDServiceImpl<MatterDatumD
}
}
//构建填充复选框值
if
(
entry
.
getKey
().
indexOf
(
"ck_"
)
!=
-
1
&&
entry
.
getKey
().
indexOf
(
"<"
)
!=
-
1
)
{
if
(
entry
.
getKey
().
indexOf
(
ComponentEnum
.
CHECKBOX
.
getValue
()
)
!=
-
1
&&
entry
.
getKey
().
indexOf
(
"<"
)
!=
-
1
)
{
//获取复选框选项,并渲染值
String
ckStr
=
StringUtils
.
substringBetween
(
entry
.
getKey
(),
"<"
,
">"
);
//获取所有选项
...
...
@@ -396,17 +398,28 @@ public class MatterDatumServiceImpl extends AbstractCRUDServiceImpl<MatterDatumD
}
//TODO 单选
//绑定动态表单
if
(
entry
.
getKey
().
indexOf
(
"dt_"
)
!=
-
1
)
{
if
(
entry
.
getKey
().
indexOf
(
ComponentEnum
.
DYNAMIC_TABLE
.
getValue
()
)
!=
-
1
)
{
builder
.
bind
(
entry
.
getKey
(),
new
MultipleRowTableRenderPolicy
());
}
//绑定转换list list_1_身份证
if
(
entry
.
getKey
().
indexOf
(
"list_"
)
!=
-
1
)
{
if
(
entry
.
getKey
().
indexOf
(
ComponentEnum
.
LIST
.
getValue
()
)
!=
-
1
)
{
String
value
=
entry
.
getValue
().
toString
();
SplitIter
splitIter
=
new
SplitIter
(
value
,
new
LengthFinder
(
1
),
-
1
,
false
);
List
<
String
>
valueList
=
splitIter
.
toList
(
true
);
builder
.
bind
(
entry
.
getKey
(),
new
LoopSingleRowTableRenderPolicy
());
data
.
put
(
entry
.
getKey
(),
valueList
);
}
//TODO cascade 级联
if
(
entry
.
getKey
().
indexOf
(
ComponentEnum
.
CASCADE
.
getValue
())
!=
-
1
)
{
List
<
String
>
value
=
(
ArrayList
)
entry
.
getValue
();
log
.
info
(
"级联数据:{}"
,
JSON
.
toJSONString
(
value
));
entry
.
setValue
(
value
.
stream
().
collect
(
Collectors
.
joining
(
""
)));
}
});
if
(
addMap
.
size
()
>
0
)
{
data
.
putAll
(
addMap
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment