Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
monorepo
/
venus
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
1
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 4192f4a5
authored
Mar 25, 2026
by
yancanhua
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix: 自定义表单提交
1 parent
6c147933
Pipeline
#95
for
4192f4a5
failed
in 0 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
54 deletions
apps/web/venus-usedcar-quality/src/components.d.ts
apps/web/venus-usedcar-quality/src/components/CustomizeForm/Index.vue
apps/web/venus-usedcar-quality/src/components.d.ts
View file @
4192f4a
...
@@ -7,17 +7,17 @@ export {}
...
@@ -7,17 +7,17 @@ export {}
declare
module
'vue'
{
declare
module
'vue'
{
export
interface
GlobalComponents
{
export
interface
GlobalComponents
{
ButtonSelect
:
typeof
import
(
'./components/
C
ustomizeForm/buttonSelect.vue'
)[
'default'
]
ButtonSelect
:
typeof
import
(
'./components/
c
ustomizeForm/buttonSelect.vue'
)[
'default'
]
CustomizeUploadFile
:
typeof
import
(
'./components/
C
ustomizeForm/customizeUploadFile.vue'
)[
'default'
]
CustomizeUploadFile
:
typeof
import
(
'./components/
c
ustomizeForm/customizeUploadFile.vue'
)[
'default'
]
Index
:
typeof
import
(
'./components/
C
ustomizeForm/Index.vue'
)[
'default'
]
Index
:
typeof
import
(
'./components/
c
ustomizeForm/Index.vue'
)[
'default'
]
Layouts
:
typeof
import
(
'./layouts/index.vue'
)[
'default'
]
Layouts
:
typeof
import
(
'./layouts/index.vue'
)[
'default'
]
PageTitle
:
typeof
import
(
'./components/PageTitle.vue'
)[
'default'
]
PageTitle
:
typeof
import
(
'./components/PageTitle.vue'
)[
'default'
]
PageTop
:
typeof
import
(
'./components/PageTop.vue'
)[
'default'
]
PageTop
:
typeof
import
(
'./components/PageTop.vue'
)[
'default'
]
RadioSelect
:
typeof
import
(
'./components/
C
ustomizeForm/radioSelect.vue'
)[
'default'
]
RadioSelect
:
typeof
import
(
'./components/
c
ustomizeForm/radioSelect.vue'
)[
'default'
]
RouterLink
:
typeof
import
(
'vue-router'
)[
'RouterLink'
]
RouterLink
:
typeof
import
(
'vue-router'
)[
'RouterLink'
]
RouterView
:
typeof
import
(
'vue-router'
)[
'RouterView'
]
RouterView
:
typeof
import
(
'vue-router'
)[
'RouterView'
]
SelectDatePicker
:
typeof
import
(
'./components/
C
ustomizeForm/selectDatePicker.vue'
)[
'default'
]
SelectDatePicker
:
typeof
import
(
'./components/
c
ustomizeForm/selectDatePicker.vue'
)[
'default'
]
SelectDropdown
:
typeof
import
(
'./components/
C
ustomizeForm/selectDropdown.vue'
)[
'default'
]
SelectDropdown
:
typeof
import
(
'./components/
c
ustomizeForm/selectDropdown.vue'
)[
'default'
]
VanActionSheet
:
typeof
import
(
'vant/es'
)[
'ActionSheet'
]
VanActionSheet
:
typeof
import
(
'vant/es'
)[
'ActionSheet'
]
VanButton
:
typeof
import
(
'vant/es'
)[
'Button'
]
VanButton
:
typeof
import
(
'vant/es'
)[
'Button'
]
VanCheckbox
:
typeof
import
(
'vant/es'
)[
'Checkbox'
]
VanCheckbox
:
typeof
import
(
'vant/es'
)[
'Checkbox'
]
...
...
apps/web/venus-usedcar-quality/src/components/CustomizeForm/Index.vue
View file @
4192f4a
...
@@ -9,7 +9,6 @@ import buttonSelect from "@/components/customizeForm/buttonSelect.vue";
...
@@ -9,7 +9,6 @@ import buttonSelect from "@/components/customizeForm/buttonSelect.vue";
import
radioSelect
from
"@/components/customizeForm/radioSelect.vue"
;
import
radioSelect
from
"@/components/customizeForm/radioSelect.vue"
;
import
customizeUploadFile
from
"@/components/customizeForm/customizeUploadFile.vue"
;
import
customizeUploadFile
from
"@/components/customizeForm/customizeUploadFile.vue"
;
// 获取父组件传递数据
// 获取父组件传递数据
const
props
=
withDefaults
(
const
props
=
withDefaults
(
defineProps
<
{
defineProps
<
{
...
@@ -37,32 +36,34 @@ watch(() => props.leafNodes, (nodes) => {
...
@@ -37,32 +36,34 @@ watch(() => props.leafNodes, (nodes) => {
// 提交数据
// 提交数据
function
setSubmitData
()
{
function
setSubmitData
()
{
let
dataList
:
never
[]
=
[];
let
returnData
:
never
[]
=
[];
columnsList
.
value
.
forEach
((
item
:
any
)
=>
{
columnsList
.
value
.
forEach
((
item
:
any
)
=>
{
let
itemData
:
any
=
{}
;
let
dataList
:
never
[]
=
[]
;
const
inputList
=
[
'text_input'
,
'textarea_input'
,
'number_input'
,
'date_picker'
];
const
inputList
=
[
'text_input'
,
'textarea_input'
,
'number_input'
,
'date_picker'
];
const
dropdownList
=
[
'dropdown'
,
'radio_button_select'
];
const
dropdownList
=
[
'dropdown'
,
'radio_button_select'
];
if
(
inputList
.
includes
(
item
.
interactionType
))
{
if
(
inputList
.
includes
(
item
.
interactionType
)
&&
item
.
value
)
{
item
Data
=
{
const
push
Data
=
{
id
:
item
.
id
,
id
:
item
.
id
,
valueText
:
item
.
value
||
''
,
valueText
:
item
.
value
||
''
,
valueKey
:
item
.
value
||
''
,
valueKey
:
item
.
value
||
''
,
interactionType
:
item
.
interactionType
,
interactionType
:
item
.
interactionType
,
remark
:
item
.
remark
||
''
,
remark
:
item
.
remark
||
''
,
}
}
}
else
if
(
dropdownList
.
includes
(
item
.
interactionType
))
{
dataList
.
push
(
pushData
);
itemData
=
{
}
else
if
(
dropdownList
.
includes
(
item
.
interactionType
)
&&
item
.
valueKey
)
{
const
pushData
=
{
id
:
item
.
id
,
id
:
item
.
id
,
valueText
:
item
.
valueText
||
''
,
valueText
:
item
.
valueText
||
''
,
valueKey
:
item
.
valueKey
||
''
,
valueKey
:
item
.
valueKey
||
''
,
interactionType
:
item
.
interactionType
,
interactionType
:
item
.
interactionType
,
remark
:
item
.
remark
||
''
,
remark
:
item
.
remark
||
''
,
}
}
dataList
.
push
(
pushData
);
}
else
if
(
item
.
interactionType
==
'button_select'
)
{
}
else
if
(
item
.
interactionType
==
'button_select'
)
{
const
valueList
=
JSON
.
parse
(
item
.
value
||
'[]'
);
const
valueList
=
JSON
.
parse
(
item
.
value
||
'[]'
);
if
(
valueList
&&
valueList
.
length
>
0
)
{
if
(
valueList
&&
valueList
.
length
>
0
)
{
for
(
let
i
=
0
;
i
<
valueList
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
valueList
.
length
;
i
++
)
{
const
foritem
Data
=
{
const
push
Data
=
{
id
:
item
.
id
,
id
:
item
.
id
,
valueText
:
valueList
[
i
].
valueText
||
''
,
valueText
:
valueList
[
i
].
valueText
||
''
,
valueKey
:
valueList
[
i
].
valueKey
||
''
,
valueKey
:
valueList
[
i
].
valueKey
||
''
,
...
@@ -70,23 +71,14 @@ function setSubmitData() {
...
@@ -70,23 +71,14 @@ function setSubmitData() {
remark
:
item
.
remark
||
''
,
remark
:
item
.
remark
||
''
,
valueSeq
:
i
+
1
,
valueSeq
:
i
+
1
,
}
}
dataList
.
push
(
foritemData
);
dataList
.
push
(
pushData
);
}
}
else
{
itemData
=
{
id
:
item
.
id
,
valueText
:
item
.
valueText
||
''
,
valueKey
:
item
.
valueKey
||
''
,
interactionType
:
item
.
interactionType
,
remark
:
item
.
remark
||
''
,
}
}
dataList
.
push
(
itemData
);
}
}
}
else
if
(
item
.
interactionType
==
'image_upload'
||
item
.
interactionType
==
'video_upload'
)
{
}
else
if
(
item
.
interactionType
==
'image_upload'
||
item
.
interactionType
==
'video_upload'
)
{
const
valueList
=
JSON
.
parse
(
item
.
value
||
'[]'
);
const
valueList
=
JSON
.
parse
(
item
.
value
||
'[]'
);
if
(
valueList
&&
valueList
.
length
>
0
)
{
if
(
valueList
&&
valueList
.
length
>
0
)
{
for
(
let
i
=
0
;
i
<
valueList
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
valueList
.
length
;
i
++
)
{
const
foritem
Data
=
{
const
push
Data
=
{
id
:
item
.
id
,
id
:
item
.
id
,
valueText
:
valueList
[
i
]
||
''
,
valueText
:
valueList
[
i
]
||
''
,
valueKey
:
valueList
[
i
]
||
''
,
valueKey
:
valueList
[
i
]
||
''
,
...
@@ -94,38 +86,13 @@ function setSubmitData() {
...
@@ -94,38 +86,13 @@ function setSubmitData() {
remark
:
item
.
remark
||
''
,
remark
:
item
.
remark
||
''
,
valueSeq
:
i
+
1
,
valueSeq
:
i
+
1
,
}
}
dataList
.
push
(
foritemData
);
dataList
.
push
(
pushData
);
}
}
else
{
itemData
=
{
id
:
item
.
id
,
valueText
:
item
.
valueText
||
''
,
valueKey
:
item
.
valueKey
||
''
,
interactionType
:
item
.
interactionType
,
remark
:
item
.
remark
||
''
,
}
}
dataList
.
push
(
itemData
);
}
}
else
{
itemData
=
{
id
:
item
.
id
,
valueText
:
item
.
valueText
||
''
,
valueKey
:
item
.
valueKey
||
''
,
interactionType
:
item
.
interactionType
,
remark
:
item
.
remark
||
''
,
}
}
}
}
if
(
item
.
interactionType
!=
'button_select'
&&
item
.
interactionType
!=
'image_upload'
&&
item
.
interactionType
!=
'video_upload'
)
{
returnData
.
push
({
...
item
,
data
:
dataList
});
dataList
.
push
(
itemData
);
}
});
});
return
{
return
returnData
;
nodeId
:
columnsList
.
value
[
0
].
parentId
||
''
,
//节点 ID(inspection_node_version.nodeId,叶子节点)
nodeName
:
props
.
subTabLabel
,
//节点名称(快照)
resultStatus
:
resultStatus
.
value
?
3
:
1
,
//结果状态:1-正常,2-故障,3-无此结构
remark
:
''
,
//备注
data
:
dataList
,
};
}
}
async
function
validate
():
Promise
<
CustomizeFormValidateResult
>
{
async
function
validate
():
Promise
<
CustomizeFormValidateResult
>
{
...
@@ -172,7 +139,7 @@ defineExpose({
...
@@ -172,7 +139,7 @@ defineExpose({
<div>
<div>
<van-form
ref=
"customizeFormRef"
:model=
"form"
:rules=
"rules"
>
<van-form
ref=
"customizeFormRef"
:model=
"form"
:rules=
"rules"
>
<div
class=
"formTitle"
>
<div
class=
"formTitle"
>
<
div>
{{
subTabLabel
}}
</div
>
<
!--
<div>
{{
subTabLabel
}}
</div>
--
>
<div
v-if=
"allowNoStructure"
class=
"formRadio"
@
click=
"resultStatus = !resultStatus"
>
<div
v-if=
"allowNoStructure"
class=
"formRadio"
@
click=
"resultStatus = !resultStatus"
>
<van-icon
v-if=
"!resultStatus"
name=
"circle"
size=
"14"
color=
"#666666"
/>
<van-icon
v-if=
"!resultStatus"
name=
"circle"
size=
"14"
color=
"#666666"
/>
<van-icon
v-if=
"resultStatus"
name=
"checked"
size=
"14"
color=
"#185EFE"
/>
<van-icon
v-if=
"resultStatus"
name=
"checked"
size=
"14"
color=
"#185EFE"
/>
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment