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 fea3fb4d
authored
Mar 25, 2026
by
yancanhua
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix: 自定义组件开发
1 parent
0dc21e98
Pipeline
#102
for
fea3fb4d
failed
in 0 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
10 deletions
apps/web/venus-usedcar-quality/src/components.d.ts
apps/web/venus-usedcar-quality/src/components/CustomizeForm/buttonSelect.vue
apps/web/venus-usedcar-quality/src/components/CustomizeForm/selectDatePicker.vue
apps/web/venus-usedcar-quality/src/components.d.ts
View file @
fea3fb4
...
...
@@ -7,17 +7,17 @@ export {}
declare
module
'vue'
{
export
interface
GlobalComponents
{
ButtonSelect
:
typeof
import
(
'./components/
C
ustomizeForm/buttonSelect.vue'
)[
'default'
]
CustomizeUploadFile
:
typeof
import
(
'./components/
C
ustomizeForm/customizeUploadFile.vue'
)[
'default'
]
Index
:
typeof
import
(
'./components/
C
ustomizeForm/Index.vue'
)[
'default'
]
ButtonSelect
:
typeof
import
(
'./components/
c
ustomizeForm/buttonSelect.vue'
)[
'default'
]
CustomizeUploadFile
:
typeof
import
(
'./components/
c
ustomizeForm/customizeUploadFile.vue'
)[
'default'
]
Index
:
typeof
import
(
'./components/
c
ustomizeForm/Index.vue'
)[
'default'
]
Layouts
:
typeof
import
(
'./layouts/index.vue'
)[
'default'
]
PageTitle
:
typeof
import
(
'./components/PageTitle.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'
]
RouterView
:
typeof
import
(
'vue-router'
)[
'RouterView'
]
SelectDatePicker
:
typeof
import
(
'./components/
C
ustomizeForm/selectDatePicker.vue'
)[
'default'
]
SelectDropdown
:
typeof
import
(
'./components/
C
ustomizeForm/selectDropdown.vue'
)[
'default'
]
SelectDatePicker
:
typeof
import
(
'./components/
c
ustomizeForm/selectDatePicker.vue'
)[
'default'
]
SelectDropdown
:
typeof
import
(
'./components/
c
ustomizeForm/selectDropdown.vue'
)[
'default'
]
VanActionSheet
:
typeof
import
(
'vant/es'
)[
'ActionSheet'
]
VanButton
:
typeof
import
(
'vant/es'
)[
'Button'
]
VanCheckbox
:
typeof
import
(
'vant/es'
)[
'Checkbox'
]
...
...
apps/web/venus-usedcar-quality/src/components/CustomizeForm/buttonSelect.vue
View file @
fea3fb4
...
...
@@ -10,6 +10,27 @@ const props = defineProps({
const
emit
=
defineEmits
([
"update"
]);
const
pickerValue
=
ref
([]);
//页面加载时初始化数据
onMounted
(()
=>
{
initData
();
});
// 初始化数据
function
initData
()
{
if
(
props
?.
item
?.
inspectionResultVO
)
{
const
inspectionValueList
=
props
?.
item
?.
inspectionResultVO
?.
inspectionValueList
||
[];
if
(
inspectionValueList
&&
inspectionValueList
.
length
>
0
&&
inspectionValueList
[
0
].
valueKey
)
{
for
(
let
i
=
0
;
i
<
inspectionValueList
.
length
;
i
++
)
{
if
(
inspectionValueList
[
i
].
valueKey
)
{
pickerValue
.
value
.
push
(
inspectionValueList
[
i
].
valueKey
);
}
}
setupdate
();
}
}
}
// 计算属性
const
columnsList
=
computed
(()
=>
{
const
optionsList
=
JSON
.
parse
(
props
.
item
.
options
||
'[]'
).
map
(
item
=>
{
...
...
@@ -29,6 +50,10 @@ function handleBut(item: { value: string }) {
}
else
{
pickerValue
.
value
.
push
(
item
.
value
);
}
setupdate
();
}
function
setupdate
()
{
const
valueList
=
(
pickerValue
.
value
||
[]).
map
(
item
=>
{
const
object
=
(
columnsList
.
value
||
[]).
find
(
finditem
=>
finditem
.
value
==
item
)
||
{};
return
{
...
...
apps/web/venus-usedcar-quality/src/components/CustomizeForm/selectDatePicker.vue
View file @
fea3fb4
...
...
@@ -8,12 +8,26 @@ const props = defineProps({
},
});
const
columnsType
=
ref
([
'year'
,
'month'
]);
const
columnsType
=
ref
([
'year'
,
'month'
,
'day'
]);
const
emit
=
defineEmits
([
"update"
]);
const
showPicker
=
ref
(
false
);
const
pickerValue
=
ref
([]);
//页面加载时初始化数据
onMounted
(()
=>
{
initData
();
});
// 初始化数据
function
initData
()
{
const
validationRules
=
JSON
.
parse
(
props
.
item
.
validationRules
||
'{}'
);
if
(
validationRules
.
datePattern
&&
validationRules
.
datePattern
==
'YYYY-MM'
)
{
columnsType
.
value
=
[
'year'
,
'month'
];
}
else
{
columnsType
.
value
=
[
'year'
,
'month'
,
'day'
];
}
}
function
handleShowPicker
()
{
showPicker
.
value
=
true
;
if
(
!
props
.
item
.
value
)
{
...
...
@@ -39,8 +53,8 @@ function onConfirm() {
<van-field
v-model=
"item.value"
clearable
is-link
:label=
"item.nodeName"
name=
"datePicker"
:placeholder=
"item.placeholder"
readonly
:required=
"item.required === 1"
@
click=
"handleShowPicker"
/>
<van-popup
v-model:show=
"showPicker"
destroy-on-close
position=
"bottom"
>
<van-date-picker
v-model=
"pickerValue"
:title=
"item.nodeName"
:columns-type=
"columnsType"
@
cancel=
"showPicker = false"
@
confirm=
"onConfirm"
/>
<van-date-picker
v-model=
"pickerValue"
:title=
"item.nodeName"
:columns-type=
"columnsType"
@
c
ancel=
"showPicker = false"
@
c
onfirm=
"onConfirm"
/>
</van-popup>
</div>
</
template
>
...
...
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