Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
way-view-form
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
刘子康
way-view-form
Commits
e49206c3
Commit
e49206c3
authored
Jun 12, 2023
by
刘子康
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新支持slot,暂不支持穿梭框;增加测试案例
parent
f352f3c3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
67 additions
and
54 deletions
+67
-54
index.vue
src/components/index.vue
+14
-9
form2.vue
src/demo/form2.vue
+52
-41
form5.vue
src/demo/form5.vue
+1
-4
No files found.
src/components/index.vue
View file @
e49206c3
...
@@ -505,7 +505,7 @@ export default {
...
@@ -505,7 +505,7 @@ export default {
...
this
.
generatorDefaultEvents
(
item
),
...
this
.
generatorDefaultEvents
(
item
),
...
item
.
componentsEvents
...
item
.
componentsEvents
},
},
}
}
,
item
.
slot
?
[
this
.
$slots
.
default
,
item
.
slot
(
h
)]
:
this
.
$slots
.
default
)
)
},
},
/**
/**
...
@@ -812,9 +812,11 @@ export default {
...
@@ -812,9 +812,11 @@ export default {
.ivu-cascader {
.ivu-cascader {
line-height: inherit;
line-height: inherit;
}
}
.ivu-input-number {
.ivu-input-number {
width: 100% !important;
width: 100% !important;
}
}
// 项目下的fix样式
// 项目下的fix样式
// .ivu-input-number-input-wrap {
// .ivu-input-number-input-wrap {
// height: 25px !important;
// height: 25px !important;
...
@@ -889,17 +891,20 @@ export default {
...
@@ -889,17 +891,20 @@ export default {
display: none !important;
display: none !important;
}
}
}
}
.ivu-form-label-top{
.ivu-form-item-label{
.ivu-form-label-top {
text-align: left!important;
.ivu-form-item-label {
text-align: left !important;
}
}
.ivu-form-item-content{
margin-left: 0!important;
.ivu-form-item-content {
margin-left: 0 !important;
}
}
}
}
.ivu-form-label-right{
.ivu-form-item-label{
.ivu-form-label-right {
text-align: right!important;
.ivu-form-item-label {
text-align: right !important;
}
}
}
}
...
...
src/demo/form2.vue
View file @
e49206c3
...
@@ -46,8 +46,7 @@
...
@@ -46,8 +46,7 @@
<
script
>
<
script
>
import
LabelItem
from
'./label-item.vue'
import
LabelItem
from
'./label-item.vue'
let
data1
=
[]
let
targetKeys1
=
[]
export
default
{
export
default
{
name
:
'page-Form'
,
name
:
'page-Form'
,
components
:
{
components
:
{
...
@@ -315,19 +314,57 @@ export default {
...
@@ -315,19 +314,57 @@ export default {
},
},
},
},
{
{
name
:
'
Transfer
'
,
name
:
'
Rate
'
,
required
:
true
,
required
:
true
,
type
:
'Transfer'
,
type
:
'Rate'
,
key
:
'Transfer'
,
key
:
'Rate'
},
{
name
:
'Upload'
,
type
:
'Upload'
,
key
:
'Upload'
,
componentsProps
:
{
componentsProps
:
{
data
:
data1
,
data
:
{},
renderFormat
:
this
.
render1
,
action
:
'https://jsonplaceholder.typicode.com/posts/'
,
targetKeys
:
targetKeys1
'list-type'
:
'picture-card'
,
'on-success'
:
(
res
,
file
,
fileList
)
=>
{
console
.
log
(
res
,
file
,
fileList
)
},
'on-preview'
:
(
file
)
=>
{
console
.
log
(
file
)
},
'on-remove'
:
(
file
,
fileList
)
=>
{
console
.
log
(
file
,
fileList
)
},
'on-progress'
:
(
e
,
file
,
fileList
)
=>
{
console
.
log
(
e
,
file
,
fileList
)
},
'on-change'
:
(
file
,
fileList
)
=>
{
console
.
log
(
file
,
fileList
)
},
},
componentEvents
:
{
'on-error'
:
(
file
,
fileList
)
=>
{
'on-change'
:
this
.
handleChange1
console
.
log
(
file
,
fileList
)
},
},
slot
:
(
h
)
=>
{
return
h
(
'Button'
,
{
icon
:
'ios-cloud-upload-outline'
},
'点击上传'
)
}
}
},
},
{
name
:
'ColorPicker'
,
required
:
true
,
type
:
'ColorPicker'
,
key
:
'ColorPicker'
},
{
name
:
'Slider'
,
required
:
true
,
type
:
'Slider'
,
key
:
'Slider'
,
requiredType
:
'number'
},
],
],
actionProps
:
{
actionProps
:
{
submit
:
{
submit
:
{
...
@@ -345,16 +382,14 @@ export default {
...
@@ -345,16 +382,14 @@ export default {
text
:
'重置'
text
:
'重置'
},
},
},
},
// 测试数据
data1
:
this
.
getMockData
(),
targetKeys1
:
this
.
getTargetKeys
()
};
};
},
},
beforeMount
()
{
beforeMount
()
{
console
.
log
(
this
.
getTargetKeys
())
},
},
created
()
{
created
()
{
console
.
log
()
},
},
mounted
()
{
mounted
()
{
...
@@ -385,32 +420,8 @@ export default {
...
@@ -385,32 +420,8 @@ export default {
},
},
]
]
},
},
getMockData
()
{
let
mockData
=
[];
for
(
let
i
=
1
;
i
<=
20
;
i
++
)
{
mockData
.
push
({
key
:
i
.
toString
(),
label
:
'Content '
+
i
,
description
:
'The desc of content '
+
i
,
disabled
:
Math
.
random
()
*
3
<
1
});
}
return
mockData
;
},
getTargetKeys
()
{
return
this
.
getMockData
()
.
filter
(()
=>
Math
.
random
()
*
2
>
1
)
.
map
(
item
=>
item
.
key
);
},
render1
(
item
)
{
return
item
.
label
;
},
handleChange1
(
newTargetKeys
,
direction
,
moveKeys
)
{
console
.
log
(
newTargetKeys
);
console
.
log
(
direction
);
console
.
log
(
moveKeys
);
this
.
targetKeys1
=
newTargetKeys
;
}
},
},
watch
:
{
watch
:
{
...
...
src/demo/form5.vue
View file @
e49206c3
...
@@ -67,10 +67,7 @@ export default {
...
@@ -67,10 +67,7 @@ export default {
},
},
originData
:
[
originData
:
[
{
type
:
'Title'
,
name
:
'查询条件'
,
},
{
{
type
:
'Row'
,
type
:
'Row'
,
...
...
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