Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dsk-operate-sys-cscec
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fulixin
dsk-operate-sys-cscec
Commits
f7f29836
Commit
f7f29836
authored
Dec 29, 2023
by
tianhongyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug
parent
d9989d46
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
21 deletions
+39
-21
CustomFormDesign.vue
...ent/components/CustomForm/components/CustomFormDesign.vue
+35
-17
SubfieldModule.vue
...ement/components/CustomForm/components/SubfieldModule.vue
+4
-4
No files found.
dsk-operate-ui/src/views/consultingOrgManagement/components/CustomForm/components/CustomFormDesign.vue
View file @
f7f29836
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
<div
class=
"design-main fields-main"
>
<div
class=
"design-main fields-main"
>
<vuedraggable
:list=
"defaultComOptions"
:group=
"
{name: 'customComGroup', pull: 'clone', put: false}" class="design-draggable-fields"
<vuedraggable
:list=
"defaultComOptions"
:group=
"
{name: 'customComGroup', pull: 'clone', put: false}" class="design-draggable-fields"
draggable=".draggable-fields-item" ghostClass="subfield-origin-dragClass" :clone="targetComClone" :sort="false"
draggable=".draggable-fields-item" ghostClass="subfield-origin-dragClass" :clone="targetComClone" :sort="false"
:disabled="!subfieldModuleList.length" @end="
fieldsOnEnd
">
:disabled="!subfieldModuleList.length" @end="
endCheck
">
<transition-group
name=
"fade"
tag=
"div"
class=
"draggable-fields-list"
>
<transition-group
name=
"fade"
tag=
"div"
class=
"draggable-fields-list"
>
<div
class=
"draggable-fields-item"
:class=
"
{'has-no-subfield-module' : !subfieldModuleList.length}"
<div
class=
"draggable-fields-item"
:class=
"
{'has-no-subfield-module' : !subfieldModuleList.length}"
v-for="(item,index) of defaultComOptions" :key="index" @click="fieldsItemClick">
v-for="(item,index) of defaultComOptions" :key="index" @click="fieldsItemClick">
...
@@ -22,24 +22,23 @@
...
@@ -22,24 +22,23 @@
<div
class=
"custom-form-design-options"
>
<div
class=
"custom-form-design-options"
>
<div
class=
"design-header options-header"
>
表单配置
</div>
<div
class=
"design-header options-header"
>
表单配置
</div>
<div
class=
"design-main options-main"
>
<div
class=
"design-main options-main"
>
<el-form
class=
"custom-design-el-form"
ref=
"customDesignFormRef"
:model=
""
:rules=
"
{}" @submit.native.prevent>
<el-form
class=
"custom-design-el-form"
ref=
"customDesignFormRef"
:model=
"
{}
" :rules="{}" @submit.native.prevent>
<!-- 最外层dragg容器 拖动模块module .subfield-module-dragg-target-icon -->
<!-- 最外层dragg容器 拖动模块module .subfield-module-dragg-target-icon -->
<vuedraggable
:list=
"subfieldModuleList"
group=
"customSubfieldmodule"
class=
"subfield-module-container"
<vuedraggable
:list=
"subfieldModuleList"
group=
"customSubfieldmodule"
class=
"subfield-module-container"
draggable=
".subfield-module-item-container"
handle=
".subfield-module-dragg-target-icon"
:animation=
"340"
>
draggable=
".subfield-module-item-container"
handle=
".subfield-module-dragg-target-icon"
:animation=
"340"
>
<!-- 添加的分栏模块以及chidren模块 -->
<!-- 添加的分栏模块以及chidren模块 -->
<transition-group
name=
"fade"
tag=
"div"
class=
"subfield-module-list"
>
<transition-group
name=
"fade"
tag=
"div"
class=
"subfield-module-list"
>
<
div
class=
"subfield-module-draggable-list"
v-for=
"(item,index) of subfieldModuleList"
:key=
"item.uid"
>
<
!--
<div
class=
"subfield-module-draggable-list"
v-for=
"(item,index) of subfieldModuleList"
:key=
"item.uid"
>
--
>
<vuedraggable
draggable=
".subfield-item-container"
handle=
".subfield-module-item-dragg-target-icon"
tag=
"subfield-module
"
<vuedraggable
v-for=
"(item,index) of subfieldModuleList"
:key=
"item.uid"
draggable=
".subfield-item-container
"
:list=
"item.children"
group=
"customComGroup"
:component-data=
"createComponentData(item)"
:animation=
"340
"
handle=
".subfield-module-item-dragg-target-icon"
tag=
"subfield-module"
:list=
"item.children"
group=
"customComGroup
"
ghostClass=
"subfield-item-dragClass"
:sort=
"true
"
>
:component-data=
"createComponentData(item)"
:animation=
"340"
ghostClass=
"subfield-item-dragClass"
:sort=
"true"
@
end=
"endCheck
"
>
<subfield-item
v-for=
"(child,index) of item.children"
:key=
"child.uid"
:parentUid=
"item.uid"
:childModuleInfo=
"child"
<subfield-item
v-for=
"(child,index) of item.children"
:key=
"child.uid"
:parentUid=
"item.uid"
:childModuleInfo=
"child"
@
removeModuleItem=
"removeModuleItem"
></subfield-item>
@
removeModuleItem=
"removeModuleItem"
></subfield-item>
</vuedraggable>
</vuedraggable>
<
/div
>
<
!--
</div>
--
>
</transition-group>
</transition-group>
</vuedraggable>
</vuedraggable>
<!-- 添加分栏 -->
<!-- 添加分栏 -->
<div
class=
"add-field-bar"
@
click=
"addSubfieldModule"
>
<div
class=
"add-field-bar"
@
click=
"addSubfieldModule"
>
<img
src=
"@/assets/images/consultingAgencyManagement/customForm/icon_add@2x.png"
alt=
""
>
<img
src=
"@/assets/images/consultingAgencyManagement/customForm/icon_add@2x.png"
alt=
""
>
...
@@ -92,7 +91,9 @@ export default {
...
@@ -92,7 +91,9 @@ export default {
// 删除分栏提示
// 删除分栏提示
removeSubFiledModuleDialog
:
false
,
removeSubFiledModuleDialog
:
false
,
// 要删除的分栏信息
// 要删除的分栏信息
removeSubfieldModule
:
{
}
removeSubfieldModule
:
{
}
,
// 当前选中正在编辑的组件id
activeUid
:
""
}
;
}
;
}
,
}
,
//可访问data属性
//可访问data属性
...
@@ -107,21 +108,24 @@ export default {
...
@@ -107,21 +108,24 @@ export default {
methods
:
{
methods
:
{
// 克隆目标组件
// 克隆目标组件
targetComClone
(
v
)
{
targetComClone
(
v
)
{
console
.
log
(
"clone"
,
v
);
const
cloneTarget
=
JSON
.
parse
(
JSON
.
stringify
(
v
));
const
cloneTarget
=
JSON
.
parse
(
JSON
.
stringify
(
v
));
cloneTarget
.
uid
=
v4
();
cloneTarget
.
uid
=
v4
();
return
cloneTarget
;
return
cloneTarget
;
}
,
}
,
// 字段组件结束拖动
fieldsOnEnd
(
e
)
{
console
.
log
(
e
);
console
.
log
(
this
.
subfieldModuleList
);
}
,
// 字段组件点击事件
// 字段组件点击事件
fieldsItemClick
()
{
fieldsItemClick
()
{
if
(
!
this
.
subfieldModuleList
?.
length
)
{
if
(
!
this
.
subfieldModuleList
?.
length
)
{
this
.
$message
.
warning
(
"请先添加分栏"
);
this
.
$message
.
warning
(
"请先添加分栏"
);
}
}
}
,
}
,
endCheck
(
e
)
{
console
.
log
(
"成功"
,
e
);
}
,
subFieldItemActive
(
childItem
)
{
console
.
log
(
childItem
);
this
.
activeUid
=
childItem
.
uid
;
}
,
// 添加分栏
// 添加分栏
addSubfieldModule
()
{
addSubfieldModule
()
{
const
_temp
=
JSON
.
parse
(
JSON
.
stringify
(
subfieldModuleTemplate
));
const
_temp
=
JSON
.
parse
(
JSON
.
stringify
(
subfieldModuleTemplate
));
...
@@ -148,6 +152,7 @@ export default {
...
@@ -148,6 +152,7 @@ export default {
// 更新源数据标题
// 更新源数据标题
const
index
=
parentModule
?.
children
?.
findIndex
(
item
=>
item
.
uid
==
itemModule
.
uid
);
const
index
=
parentModule
?.
children
?.
findIndex
(
item
=>
item
.
uid
==
itemModule
.
uid
);
if
(
index
>
-
1
)
{
if
(
index
>
-
1
)
{
if
(
itemModule
.
uid
==
this
.
activeUid
)
this
.
activeUid
=
""
;
parentModule
?.
children
?.
splice
(
index
,
1
);
parentModule
?.
children
?.
splice
(
index
,
1
);
}
}
}
}
...
@@ -159,6 +164,7 @@ export default {
...
@@ -159,6 +164,7 @@ export default {
if
(
findModule
)
{
if
(
findModule
)
{
// 更新源数据标题
// 更新源数据标题
findModule
.
subfieldModuleName
=
module
.
subfieldModuleName
;
findModule
.
subfieldModuleName
=
module
.
subfieldModuleName
;
this
.
activeUid
=
""
;
}
}
}
,
}
,
removeDialogClose
()
{
removeDialogClose
()
{
...
@@ -197,6 +203,10 @@ export default {
...
@@ -197,6 +203,10 @@ export default {
font
-
size
:
14
px
;
font
-
size
:
14
px
;
font
-
weight
:
400
;
font
-
weight
:
400
;
.
subfield
-
item
-
container
{
background
:
rgba
(
0
,
129
,
255
,
0.3
);
}
&
>
img
{
&
>
img
{
width
:
16
px
;
width
:
16
px
;
height
:
16
px
;
height
:
16
px
;
...
@@ -322,6 +332,14 @@ export default {
...
@@ -322,6 +332,14 @@ export default {
.
custom
-
design
-
el
-
form
{
.
custom
-
design
-
el
-
form
{
width
:
100
%
;
width
:
100
%
;
height
:
100
%
;
height
:
100
%
;
/* .subfield-module-draggable-list {
margin-bottom: 12px;
width: 100%;
border: 1px solid #dcdfe6;
box-sizing: border-box;
border-radius: 4px;
}
*/
}
}
}
}
}
}
...
...
dsk-operate-ui/src/views/consultingOrgManagement/components/CustomForm/components/SubfieldModule.vue
View file @
f7f29836
...
@@ -4,7 +4,8 @@
...
@@ -4,7 +4,8 @@
<div
class=
"subfield-module-title"
>
<div
class=
"subfield-module-title"
>
<img
src=
"@/assets/images/consultingAgencyManagement/customForm/icon_drag@2x.png"
alt=
""
class=
"subfield-module-dragg-target-icon"
>
<img
src=
"@/assets/images/consultingAgencyManagement/customForm/icon_drag@2x.png"
alt=
""
class=
"subfield-module-dragg-target-icon"
>
<el-form-item
v-if=
"comModuleInfo.edit"
class=
"subfield-module-form-item"
:rules=
"comModuleInfo.subfieldModuleNameRules"
prop=
""
>
<el-form-item
v-if=
"comModuleInfo.edit"
class=
"subfield-module-form-item"
:rules=
"comModuleInfo.subfieldModuleNameRules"
prop=
""
>
<el-input
v-model=
"comModuleInfo.subfieldModuleName"
:placeholder=
"comModuleInfo.subfieldModulePlaceholder"
clearable
@
keyup
.
enter
.
native
.
stop=
"editOK"
></el-input>
<el-input
v-model=
"comModuleInfo.subfieldModuleName"
:placeholder=
"comModuleInfo.subfieldModulePlaceholder"
clearable
@
keyup
.
enter
.
native
.
stop=
"editOK"
></el-input>
</el-form-item>
</el-form-item>
<span
v-else
>
{{
comModuleInfo
.
defaultSubfieldModuleName
}}
</span>
<span
v-else
>
{{
comModuleInfo
.
defaultSubfieldModuleName
}}
</span>
</div>
</div>
...
@@ -18,9 +19,7 @@
...
@@ -18,9 +19,7 @@
<img
src=
"@/assets/images/consultingAgencyManagement/customForm/icon_delete@2x.png"
alt=
""
class=
"title-tool-delete"
@
click=
"removeModule"
>
<img
src=
"@/assets/images/consultingAgencyManagement/customForm/icon_delete@2x.png"
alt=
""
class=
"title-tool-delete"
@
click=
"removeModule"
>
</div>
</div>
</div>
</div>
<div
class=
"subfield-module-item-list"
>
<slot></slot>
<slot></slot>
</div>
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
...
@@ -79,6 +78,7 @@ export default {
...
@@ -79,6 +78,7 @@ export default {
border
:
1px
solid
#dcdfe6
;
border
:
1px
solid
#dcdfe6
;
box-sizing
:
border-box
;
box-sizing
:
border-box
;
border-radius
:
4px
;
border-radius
:
4px
;
overflow
:
hidden
;
.subfield-module-header
{
.subfield-module-header
{
display
:
flex
;
display
:
flex
;
...
...
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