Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
VueElementTemplate
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
JIRA
JIRA
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
黄瑜
VueElementTemplate
Commits
147bdb4d
Commit
147bdb4d
authored
Apr 11, 2018
by
王康
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
form
parent
01d5922d
Changes
2
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
144 additions
and
69 deletions
+144
-69
HmComplexForm.vue
src/views/haomo/components/forms/HmComplexForm.vue
+118
-48
index.vue
src/views/haomo/components/forms/index.vue
+26
-21
No files found.
src/views/haomo/components/forms/HmComplexForm.vue
View file @
147bdb4d
This diff is collapsed.
Click to expand it.
src/views/haomo/components/forms/index.vue
View file @
147bdb4d
...
...
@@ -5,8 +5,10 @@
:buttons=
"showUserButtons"
:layout=
"layout"
:tips=
"tips"
:funObject=
"funObject"
:refers=
"userRefers"
:foreignFormFields=
"foreignFormFields"
:re
fers=
"userRefer
s"
>
:re
lates=
"userRelate
s"
>
<!-- foreignFormFields 主查外的外表显示字段 和userRefers连用-->
<!-- :relates="userRelates" 中间表和间接关联表-->
<!-- :refers="userRefers" 主查外的外表和外键字段 和foreignFormFields;连用-->
...
...
@@ -31,11 +33,11 @@
// widgetType值 1:普通input 2:下拉框 (如果是下拉框 再传一个options表示下拉框选项)3:复选框 4:文本域 5:富文本 6:日期 7:单选框 8: 文件上传
showUserColumns
:
[
// 1普通input
{
name
:
'选择类型'
,
codeCamel
:
'type'
,
widgetType
:
1
,
disabled
:
tru
e
,
change
:
this
.
inputChange
,
{
name
:
'选择类型'
,
codeCamel
:
'type'
,
widgetType
:
1
,
disabled
:
fals
e
,
change
:
this
.
inputChange
// rule: { required: true, message: '用户名不能为空', trigger: 'blur' }
// hide: true
default
:
'默认值'
// default: '默认值',
},
// 5富文本
{
name
:
'电子邮件'
,
codeCamel
:
'email'
,
widgetType
:
5
,
disabled
:
false
,
...
...
@@ -69,11 +71,11 @@
{
name
:
'登陆id'
,
codeCamel
:
'loginid'
,
widgetType
:
7
,
options
:
[
{
label
:
1
,
value
:
'会员'
},
// 单选的value是选项文字,label是选中值
{
label
:
2
,
value
:
'访客'
}
{
label
:
2
,
value
:
'访客'
}
// 如果数据库中存的数据类型是number,label值写number如1,如果为string,label值写string ,如'1'
],
// default: 1
change
:
this
.
inputChange
},
// 8文件
{
name
:
'选择头像'
,
codeCamel
:
'avatar'
,
widgetType
:
8
,
url
:
'/api/upload'
,
change
:
this
.
uploadChange
}
// url是后台接口地址
// 8文件
change: this.uploadChange
{
name
:
'选择头像'
,
codeCamel
:
'avatar'
,
widgetType
:
8
,
url
:
'/api/upload'
}
// url是后台接口地址
],
// CcSubject示例
showUserColumns2
:
[
...
...
@@ -117,6 +119,9 @@
// { text: '预览2', method: this.method5 },
{
text
:
'取消'
,
type
:
3
,
method
:
this
.
method3
}
],
funObject
:
{
beforeRender
:
this
.
beforeRender
},
// showUserButtons: []
// 布局方式
layout
:
{
left
:
2
,
middle
:
20
,
right
:
2
},
...
...
@@ -183,14 +188,8 @@
console
.
log
(
125
,
object
)
return
object
// 将数据返回
},
method1
(
formModel
)
{
// console.log('method1', formModel)
// formModel.password = '1234'
// console.log('method1', formModel)
},
uploadChange
(
response
,
formModel
)
{
console
.
log
(
192
,
response
)
console
.
log
(
192
,
formModel
)
method1
()
{
console
.
log
(
'method1'
)
},
method2
()
{
console
.
log
(
'method2'
)
...
...
@@ -199,13 +198,19 @@
console
.
log
(
'method3'
)
},
method4
(
formModel
)
{
console
.
log
(
'method4'
,
formModel
)
formModel
.
password
=
123
console
.
log
(
'method4'
,
formModel
)
console
.
log
(
formModel
)
console
.
log
(
'method4'
)
},
method5
(
formModel
)
{
console
.
log
(
formModel
)
console
.
log
(
'method4'
)
},
beforeRender
(
data
,
formModel
)
{
// 数据处理
// do something...
// console.log(111, data)
// console.log(112, formModel)
return
formModel
}
}
}
...
...
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