Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hls-easy-ui
Project
Project
Details
Activity
Releases
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
easyUI
hls-easy-ui
Commits
f6a621e7
Commit
f6a621e7
authored
Aug 09, 2024
by
王纵
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
低代码表单校验
parent
df2d5daa
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
27 deletions
+24
-27
DLov.vue
src/Dynamic/ConfigRenderComponent/DForm/FormItem/DLov.vue
+6
-13
DSelect.vue
src/Dynamic/ConfigRenderComponent/DForm/FormItem/DSelect.vue
+5
-3
index.vue
src/Dynamic/ConfigRenderComponent/DForm/index.vue
+13
-11
No files found.
src/Dynamic/ConfigRenderComponent/DForm/FormItem/DLov.vue
View file @
f6a621e7
...
...
@@ -2,7 +2,7 @@
* @Author: zong.wang01@hand-china.com
* @Date: 2024-08-01 09:55:12
* @LastEditors: zong.wang01@hand-china.com
* @LastEditTime: 2024-08-09
18:18:35
* @LastEditTime: 2024-08-09
22:36:54
* @Version: 1.0.0
* @Description: 动态渲染-Lov
* @Copyright: Copyright (c) 2021, Hand-RongJing
...
...
@@ -66,7 +66,7 @@
:key=
"item[lovConfig.valueField]"
>
<fragment
v-if=
"multiple"
>
<van-checkbox
shape=
"square"
v-model=
"item._selected"
@
click=
"selectData(item)"
>
<van-checkbox
shape=
"square"
v-model=
"item._selected"
>
<div
class=
"item-content"
>
<fragment
v-for=
"(td, index) in lovConfig.tableFields"
:key=
"td.dataIndex"
>
<span
v-if=
"index < 2"
>
{{item[td.dataIndex]}}
</span>
...
...
@@ -137,7 +137,7 @@ export default {
},
multiple
:
{
// 是否多选
type
:
Boolean
,
default
:
tru
e
,
default
:
fals
e
,
},
clearable
:
{
type
:
Boolean
,
...
...
@@ -206,17 +206,10 @@ export default {
}
}
},
onInput
(
val
)
{
this
.
$emit
(
'input'
,
val
);
},
selectData
(
val
)
{
if
(
!
this
.
multiple
)
{
this
.
currentValue
=
val
;
this
.
changeVisible
(
false
);
this
.
inputValue
(
this
.
currentValue
);
}
else
{
val
.
_selected
=
true
;
}
},
// 确定
confirm
()
{
...
...
src/Dynamic/ConfigRenderComponent/DForm/FormItem/DSelect.vue
View file @
f6a621e7
...
...
@@ -2,7 +2,7 @@
* @Author: zong.wang01@hand-china.com
* @Date: 2024-08-01 09:55:12
* @LastEditors: zong.wang01@hand-china.com
* @LastEditTime: 2024-08-09
18:20:44
* @LastEditTime: 2024-08-09
22:36:43
* @Version: 1.0.0
* @Description: 动态渲染-Select
* @Copyright: Copyright (c) 2021, Hand-RongJing
...
...
@@ -23,7 +23,7 @@
</van-cell>
-->
<van-field
v-model=
"
currentValue.meaning
"
v-model=
"
fieldValue
"
:disabled=
"disabled"
:required=
"required"
:rules=
"[
{ required, message: `请选择${label}` }]"
...
...
@@ -85,7 +85,7 @@ export default {
},
multiple
:
{
type
:
Boolean
,
default
:
tru
e
default
:
fals
e
},
help
:
{
type
:
String
,
...
...
@@ -114,6 +114,7 @@ export default {
},
data
()
{
return
{
fieldValue
:
''
,
// 该变量纯粹用来判断是否有选值,给form校验用
currentValue
:
this
.
multiple
?
[]
:
{
meaning
:
''
,
value
:
''
...
...
@@ -177,6 +178,7 @@ export default {
this
.
$set
(
this
.
options
[
index
],
'selected'
,
!
this
.
options
[
index
].
selected
);
},
inputValue
(
val
)
{
this
.
fieldValue
=
val
?
JSON
.
stringify
(
val
)
:
''
;
this
.
$emit
(
'input'
,
val
);
this
.
$emit
(
'change'
,
val
);
},
...
...
src/Dynamic/ConfigRenderComponent/DForm/index.vue
View file @
f6a621e7
...
...
@@ -2,7 +2,7 @@
* @Author: zong.wang01@hand-china.com
* @Date: 2024-07-29 10:51:56
* @LastEditors: zong.wang01@hand-china.com
* @LastEditTime: 2024-08-09
18:06:06
* @LastEditTime: 2024-08-09
22:40:43
* @Version: 1.0.0
* @Description: 表单渲染
* @Copyright: Copyright (c) 2021, Hand-RongJing
...
...
@@ -45,16 +45,6 @@
@
change=
"fieldChange"
/>
<d-url
v-if=
"field.validationTypeDisplay === 'UrlField'"
:label=
"field.description"
:help=
"field.help"
v-model=
"fieldsObj[field.columnName]"
:disabled=
"field.readOnly"
:required=
"field.required"
@
change=
"fieldChange"
/>
<d-select
v-if=
"field.validationTypeDisplay === 'Select'"
v-model=
"fieldsObj[field.columnName]"
...
...
@@ -64,6 +54,7 @@
:disabled=
"field.readOnly"
:required=
"field.required"
:clearable=
"field.clearFlag"
:multiple=
"field.multiple === 1"
@
change=
"fieldChange"
/>
...
...
@@ -78,6 +69,7 @@
:required=
"field.required"
:clearable=
"field.clearFlag"
:cascadesParams=
"getCascadesParams(field)"
:multiple=
"field.multiple === 1"
@
change=
"fieldChange"
/>
...
...
@@ -91,6 +83,16 @@
:required=
"field.required"
:clearable=
"field.clearFlag"
/>
<d-url
v-if=
"field.validationTypeDisplay === 'UrlField'"
:label=
"field.description"
:help=
"field.help"
v-model=
"fieldsObj[field.columnName]"
:disabled=
"field.readOnly"
:required=
"field.required"
@
change=
"fieldChange"
/>
</fragment>
</van-form>
</fragment>
...
...
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