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
HireTest
VueElementTemplate
Commits
1a55d85b
Commit
1a55d85b
authored
7 years ago
by
赵帅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
detail展示
parent
ba71e1a1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
49 deletions
+55
-49
HmComplexDetail.vue
src/views/haomo/components/details/HmComplexDetail.vue
+51
-48
index.vue
src/views/haomo/components/details/index.vue
+4
-1
No files found.
src/views/haomo/components/details/HmComplexDetail.vue
View file @
1a55d85b
...
@@ -3,39 +3,9 @@
...
@@ -3,39 +3,9 @@
<el-col
:span=
"6"
><div></div></el-col>
<el-col
:span=
"6"
><div></div></el-col>
<el-col
:span=
"12"
class=
"detail-content"
>
<el-col
:span=
"12"
class=
"detail-content"
>
<h2
class=
"title"
>
详情页面
</h2>
<h2
class=
"title"
>
详情页面
</h2>
<el-form
:model=
"detail"
ref=
"detail"
label-width=
"110px"
status-icon
style=
"width:80%;margin:0 auto"
>
<el-form
:data=
"detail"
label-width=
"110px"
status-icon
style=
"width:80%;margin:0 auto"
>
<el-form-item
label=
"姓名"
prop=
"name"
>
<el-form-item
v-for=
"column in showColumns"
:label=
"column.name"
>
<a
href=
"#"
>
{{
detail
.
name
}}
</a>
<div>
{{
detail
[
column
.
codeCamel
]
}}
</div>
</el-form-item>
<el-form-item
label=
"性别"
prop=
"gender"
>
<div>
{{
detail
.
gender
}}
</div>
</el-form-item>
<el-form-item
label=
"年龄"
prop=
"age"
>
<div>
{{
detail
.
age
}}
</div>
</el-form-item>
<el-form-item
label=
"出生日期"
prop=
"date"
>
<div>
{{
detail
.
date
}}
</div>
</el-form-item>
<el-form-item
label=
"照片"
prop=
"img"
>
<img
style=
"width: 50px;"
:src=
detail.img
alt=
"..."
>
</el-form-item>
<el-form-item
label=
"学历"
prop=
"education"
>
<div>
{{
detail
.
education
}}
</div>
</el-form-item>
<el-form-item
label=
"最常用的网站"
prop=
"website"
>
<a
:href=
"detail.website"
>
{{
detail
.
website
}}
</a>
</el-form-item>
<el-form-item
label=
"最喜欢的颜色"
prop=
"color"
class=
"color"
>
<input
type=
"color"
v-model=
"detail.color"
style=
"width:200px;height:36px;border:none;outline:0"
/>
</el-form-item>
<el-form-item
label=
"手机号"
prop=
"phone"
>
<div>
{{
detail
.
phone
}}
</div>
</el-form-item>
<el-form-item
label=
"邮箱"
prop=
"email"
>
<div>
{{
detail
.
email
}}
</div>
</el-form-item>
<el-form-item
label=
"住址"
prop=
"address"
>
<div>
{{
detail
.
address
}}
</div>
</el-form-item>
</el-form-item>
</el-form>
</el-form>
</el-col>
</el-col>
...
@@ -44,28 +14,34 @@
...
@@ -44,28 +14,34 @@
</
template
>
</
template
>
<
script
>
<
script
>
import
_
from
'lodash'
import
request
from
'@/utils/request'
export
default
{
export
default
{
name
:
'HmComplexDetail'
,
name
:
'HmComplexDetail'
,
// 继承其他组件
// 继承其他组件
extends
:
{},
extends
:
{},
// 使用其它组件
// 使用其它组件
components
:
{},
components
:
{},
props
:
{
/**
* 组件所使用的表定义schema。表定义schema,请使用 model2codejs 从pdm文件生成schema。
* 对于所有毫末科技的组件,必须传schema,以完成数据的交互
*/
schema
:
{
type
:
Object
,
required
:
true
},
userId
:
{
type
:
null
,
required
:
true
}
},
data
()
{
data
()
{
return
{
return
{
detail
:
{
list
:
null
,
name
:
'haomokeji'
,
detail
:
null
,
gender
:
'男'
,
showColumns
:
[]
// 要显示的列数据
age
:
'18'
,
password
:
'123456'
,
website
:
'https://www.baidu.com'
,
img
:
'https://gss0.bdstatic.com/94o3dSag_xI4khGkpoWK1HF6hhy/baike/c0%3Dbaike272%2C5%2C5%2C272%2C90/sign=936c94db60600c33e474d69a7b253a6a/5243fbf2b21193134871a87f6e380cd790238dcb.jpg'
,
date
:
'2018/02/06'
,
education
:
'本科'
,
color
:
'#ff0000'
,
phone
:
'18034935566'
,
email
:
'18034935566@gmail.com'
,
address
:
'北京市海淀区文思海辉大厦'
}
}
}
},
},
computed
:
{
computed
:
{
...
@@ -73,8 +49,35 @@
...
@@ -73,8 +49,35 @@
filters
:
{
filters
:
{
},
},
created
()
{
created
()
{
this
.
init
()
this
.
getList
()
},
},
methods
:
{}
methods
:
{
init
()
{
const
self
=
this
_
.
each
(
self
.
schema
[
'columns'
],
function
(
column
)
{
const
tmp
=
JSON
.
parse
(
JSON
.
stringify
(
column
))
self
.
showColumns
.
push
(
tmp
)
})
if
(
!
request
.
defaults
.
baseURL
)
{
request
.
defaults
.
baseURL
=
'/org/api'
}
console
.
log
(
request
.
defaults
)
},
getList
()
{
const
self
=
this
self
.
listLoading
=
true
const
params
=
{}
request
(
self
.
schema
.
modelUnderscorePlural
,
{
params
:
params
}).
then
(
resp
=>
{
self
.
list
=
resp
.
data
self
.
detail
=
self
.
list
[
0
]
console
.
log
(
self
.
list
)
})
}
}
}
}
</
script
>
</
script
>
<
style
scoped
>
<
style
scoped
>
...
...
This diff is collapsed.
Click to expand it.
src/views/haomo/components/details/index.vue
View file @
1a55d85b
<
template
>
<
template
>
<div>
<div>
<hm-complex-detail>
<hm-complex-detail
:schema=
"schema['HmUser']"
:userId=
"userId"
>
</hm-complex-detail>
</hm-complex-detail>
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
import
HmComplexDetail
from
'./HmComplexDetail.vue'
import
HmComplexDetail
from
'./HmComplexDetail.vue'
import
schema
from
'../../schemas/hm_org_schema'
export
default
{
export
default
{
name
:
'HmComplexDetail'
,
name
:
'HmComplexDetail'
,
...
@@ -24,6 +25,8 @@
...
@@ -24,6 +25,8 @@
filters
:
{
filters
:
{
},
},
created
()
{
created
()
{
this
.
schema
=
schema
this
.
userId
=
'0e26566e953449a7a7500c34be39fd26'
},
},
methods
:
{}
methods
:
{}
}
}
...
...
This diff is collapsed.
Click to expand it.
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