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
ba289245
Commit
ba289245
authored
Feb 06, 2018
by
胡小根
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
实现了三张表的demo
parent
85945f80
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
5 deletions
+17
-5
HmComplexTable.vue
src/views/haomo/components/tables/HmComplexTable.vue
+13
-2
index.vue
src/views/haomo/components/tables/index.vue
+4
-3
No files found.
src/views/haomo/components/tables/HmComplexTable.vue
View file @
ba289245
...
@@ -2,8 +2,8 @@
...
@@ -2,8 +2,8 @@
<div
class=
"app-container calendar-list-container"
>
<div
class=
"app-container calendar-list-container"
>
<!-- 过滤 -->
<!-- 过滤 -->
<div
class=
"filter-container"
>
<div
class=
"filter-container"
>
<el-button
class=
"filter-item"
type=
"primary"
v-waves
icon=
"el-icon-search"
@
click=
"handleFilter"
>
{{
$t
(
'table.search'
)
}}
</el-button>
<el-button
class=
"filter-item"
type=
"primary"
v-waves
icon=
"el-icon-search"
@
click=
"handleFilter"
>
搜索
</el-button>
<el-button
class=
"filter-item"
type=
"primary"
:loading=
"downloadLoading"
v-waves
icon=
"el-icon-download"
@
click=
"handleDownload"
>
{{
$t
(
'table.export'
)
}}
</el-button>
<el-button
class=
"filter-item"
type=
"primary"
:loading=
"downloadLoading"
v-waves
icon=
"el-icon-download"
@
click=
"handleDownload"
>
导出
</el-button>
</div>
</div>
<!-- end 过滤 -->
<!-- end 过滤 -->
...
@@ -37,6 +37,7 @@
...
@@ -37,6 +37,7 @@
import
_
from
'lodash'
import
_
from
'lodash'
import
request
from
'@/utils/request'
import
request
from
'@/utils/request'
import
waves
from
'@/directive/waves'
// 水波纹指令
import
waves
from
'@/directive/waves'
// 水波纹指令
import
{
parseTime
}
from
'@/utils'
export
default
{
export
default
{
name
:
'HmComplexTable'
,
name
:
'HmComplexTable'
,
...
@@ -171,12 +172,22 @@
...
@@ -171,12 +172,22 @@
handleDownload
()
{
handleDownload
()
{
this
.
downloadLoading
=
true
this
.
downloadLoading
=
true
import
(
'@/vendor/Export2Excel'
).
then
(
excel
=>
{
import
(
'@/vendor/Export2Excel'
).
then
(
excel
=>
{
// @TODO 修改下载excel的功能,请求所有的数据
const
tHeader
=
[
'timestamp'
,
'title'
,
'type'
,
'importance'
,
'status'
]
const
tHeader
=
[
'timestamp'
,
'title'
,
'type'
,
'importance'
,
'status'
]
const
filterVal
=
[
'timestamp'
,
'title'
,
'type'
,
'importance'
,
'status'
]
const
filterVal
=
[
'timestamp'
,
'title'
,
'type'
,
'importance'
,
'status'
]
const
data
=
this
.
formatJson
(
filterVal
,
this
.
list
)
const
data
=
this
.
formatJson
(
filterVal
,
this
.
list
)
excel
.
export_json_to_excel
(
tHeader
,
data
,
'table-list'
)
excel
.
export_json_to_excel
(
tHeader
,
data
,
'table-list'
)
this
.
downloadLoading
=
false
this
.
downloadLoading
=
false
})
})
},
formatJson
(
filterVal
,
jsonData
)
{
return
jsonData
.
map
(
v
=>
filterVal
.
map
(
j
=>
{
if
(
j
===
'timestamp'
)
{
return
parseTime
(
v
[
j
])
}
else
{
return
v
[
j
]
}
}))
}
}
}
}
}
}
...
...
src/views/haomo/components/tables/index.vue
View file @
ba289245
<
template
>
<
template
>
<div
class=
"app-container calendar-list-container"
>
<div
class=
"app-container calendar-list-container"
>
<hm-complex-table
:schema=
"schema"
>
<hm-complex-table
:schema=
"schema['HmUser']"
></hm-complex-table>
</hm-complex-table>
<hm-complex-table
:schema=
"schema['Department']"
></hm-complex-table>
<hm-complex-table
:schema=
"schema['Role']"
></hm-complex-table>
</div>
</div>
</
template
>
</
template
>
...
@@ -23,7 +24,7 @@
...
@@ -23,7 +24,7 @@
filters
:
{
filters
:
{
},
},
created
()
{
created
()
{
this
.
schema
=
schema
[
'HmUser'
]
this
.
schema
=
schema
},
},
methods
:
{}
methods
:
{}
}
}
...
...
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