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 749e2052
authored
Mar 27, 2026
by
yancanhua
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
feat: 自定义表单修改
1 parent
19b58247
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
12 deletions
apps/web/venus-usedcar-quality/src/components/CustomizeForm/Index.vue
apps/web/venus-usedcar-quality/src/components/CustomizeForm/Index.vue
View file @
749e205
...
@@ -16,7 +16,7 @@ import selectDropdown from "@/components/CustomizeForm/selectDropdown.vue";
...
@@ -16,7 +16,7 @@ import selectDropdown from "@/components/CustomizeForm/selectDropdown.vue";
// 获取父组件传递数据
// 获取父组件传递数据
const
props
=
withDefaults
(
const
props
=
withDefaults
(
defineProps
<
{
defineProps
<
{
allowNoStructure
?:
boolean
;
bigModuleLabel
?:
string
;
bigModuleLabel
?:
string
;
leafNodes
?:
InspectionNode
[];
leafNodes
?:
InspectionNode
[];
subTabLabel
?:
string
;
subTabLabel
?:
string
;
...
@@ -26,7 +26,6 @@ const props = withDefaults(
...
@@ -26,7 +26,6 @@ const props = withDefaults(
leafNodes
:
()
=>
[],
leafNodes
:
()
=>
[],
bigModuleLabel
:
""
,
bigModuleLabel
:
""
,
subTabLabel
:
""
,
subTabLabel
:
""
,
allowNoStructure
:
false
,
templateDefaultData
:
null
,
templateDefaultData
:
null
,
});
});
...
@@ -42,6 +41,9 @@ const resultStatus = ref(false);
...
@@ -42,6 +41,9 @@ const resultStatus = ref(false);
const
form
=
ref
({});
const
form
=
ref
({});
const
rules
=
ref
({});
const
rules
=
ref
({});
//是否支持"无此结构":0-否,1-是
const
allowNoStructure
=
ref
(
false
);
// 加载中
// 加载中
const
pageLoading
=
ref
(
false
);
const
pageLoading
=
ref
(
false
);
...
@@ -51,8 +53,9 @@ watch(() => props.leafNodes, (nodes) => {
...
@@ -51,8 +53,9 @@ watch(() => props.leafNodes, (nodes) => {
...
item
,
...
item
,
value
:
getValueText
(
item
),
value
:
getValueText
(
item
),
}))
as
InspectionColumnRow
[];
}))
as
InspectionColumnRow
[];
console
.
log
(
"watchLeafNodes"
,
columnsList
.
value
);
if
(
columnsList
.
value
&&
columnsList
.
value
.
length
)
{
allowNoStructure
.
value
=
columnsList
?.
value
?.[
0
]?.
allowNoStructure
==
1
;
}
setTimeout
(()
=>
{
setTimeout
(()
=>
{
pageLoading
.
value
=
false
;
pageLoading
.
value
=
false
;
},
1200
);
},
1200
);
...
@@ -266,12 +269,13 @@ defineExpose({
...
@@ -266,12 +269,13 @@ defineExpose({
<
template
>
<
template
>
<div>
<div>
<van-overlay
:show=
"pageLoading"
z-index=
"2000"
>
<van-overlay
:show=
"pageLoading"
z-index=
"2000"
>
<div
class=
"loadingBox"
>
<div
class=
"loadingBox"
>
<van-loading
color=
"#1989fa"
size=
"24px"
vertical
>
加载中...
</van-loading>
<van-loading
color=
"#1989fa"
size=
"24px"
vertical
>
加载中...
</van-loading>
</div>
</div>
</van-overlay>
</van-overlay>
<div
v-if=
"!pageLoading"
>
<div
v-if=
"!pageLoading"
>
<van-form
ref=
"customizeFormRef"
:model=
"form"
:rules=
"rules"
>
<van-form
ref=
"customizeFormRef"
:model=
"form"
:rules=
"rules"
>
<div
v-if=
"allowNoStructure"
class=
"formTitle"
>
<div
v-if=
"allowNoStructure"
class=
"formTitle"
>
<div
@
click=
"resultStatus = !resultStatus"
>
<div
@
click=
"resultStatus = !resultStatus"
>
...
@@ -290,16 +294,16 @@ defineExpose({
...
@@ -290,16 +294,16 @@ defineExpose({
<div
v-if=
"item.interactionType == 'text_input'"
>
<div
v-if=
"item.interactionType == 'text_input'"
>
<van-field
v-model=
"item.value"
clearable
:label=
"item.nodeName"
<van-field
v-model=
"item.value"
clearable
:label=
"item.nodeName"
:maxlength=
"getValidationRules(item).maxLength || 120"
:placeholder=
"item.placeholder"
:maxlength=
"getValidationRules(item).maxLength || 120"
:placeholder=
"item.placeholder"
:required=
"item.required === 1"
:disabled=
"item.editPermission == '0'"
:required=
"item.required === 1"
:disabled=
"item.editPermission == '0'"
input-align=
"right"
input-align=
"right"
label-width=
"120px"
/>
label-width=
"120px"
/>
</div>
</div>
<!-- 长文本输入框 -->
<!-- 长文本输入框 -->
<div
v-if=
"item.interactionType == 'textarea_input'"
>
<div
v-if=
"item.interactionType == 'textarea_input'"
>
<van-field
v-model=
"item.value"
autosize
clearable
:label=
"item.nodeName"
<van-field
v-model=
"item.value"
autosize
clearable
:label=
"item.nodeName"
:maxlength=
"getValidationRules(item).maxLength || 120"
:placeholder=
"item.placeholder"
:maxlength=
"getValidationRules(item).maxLength || 120"
:placeholder=
"item.placeholder"
:required=
"item.required === 1"
rows=
"2"
show-word-limit
type=
"textarea"
:required=
"item.required === 1"
rows=
"2"
show-word-limit
type=
"textarea"
input-align=
"right"
input-align=
"right"
label-width=
"120px"
/>
label-width=
"120px"
/>
</div>
</div>
<!-- 数字输入框 -->
<!-- 数字输入框 -->
...
@@ -310,7 +314,7 @@ defineExpose({
...
@@ -310,7 +314,7 @@ defineExpose({
:min=
"getValidationRules(item).min || 0"
:placeholder=
"item.placeholder"
:min=
"getValidationRules(item).min || 0"
:placeholder=
"item.placeholder"
:required=
"item.required === 1"
step=
"0.01"
type=
"number"
:required=
"item.required === 1"
step=
"0.01"
type=
"number"
@
input=
"(e) =>
{ item.value = parseFloat(item.value)?.toFixed(getValidationRules(item).decimalDigits || 2) || '' }"
@
input=
"(e) =>
{ item.value = parseFloat(item.value)?.toFixed(getValidationRules(item).decimalDigits || 2) || '' }"
input-align="right" label-width="120px"
>
input-align="right" label-width="120px">
<template
v-if=
"item.suffix"
#
right-icon
>
<template
v-if=
"item.suffix"
#
right-icon
>
<span>
{{
item
.
suffix
}}
</span>
<span>
{{
item
.
suffix
}}
</span>
</
template
>
</
template
>
...
@@ -347,7 +351,7 @@ defineExpose({
...
@@ -347,7 +351,7 @@ defineExpose({
<!-- image_upload_and_button_select -->
<!-- image_upload_and_button_select -->
<div
v-if=
"item.interactionType == 'image_upload_and_button_select'"
>
<div
v-if=
"item.interactionType == 'image_upload_and_button_select'"
>
<buttonSelect
:item=
"item"
:value=
"item.value"
@
update=
"item.value = $event"
/>
<buttonSelect
:item=
"item"
:value=
"item.value"
@
update=
"item.value = $event"
/>
<buttonSelectAndImageUpload
:item=
"item"
@
update=
"item.uploadValue = $event"
/>
<buttonSelectAndImageUpload
:item=
"item"
@
update=
"item.uploadValue = $event"
/>
</div>
</div>
</div>
</div>
...
@@ -361,7 +365,7 @@ defineExpose({
...
@@ -361,7 +365,7 @@ defineExpose({
float
:
left
;
float
:
left
;
display
:
flex
;
display
:
flex
;
width
:
100%
;
width
:
100%
;
padding
:
16px
12px
;
padding
:
0
12px
;
background
:
#fff
;
background
:
#fff
;
}
}
...
...
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