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
658abf66
Commit
658abf66
authored
7 years ago
by
Pan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refine: add parseTime timestamp demo
parent
4940dd40
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
index.vue
src/views/excel/index.vue
+9
-2
No files found.
src/views/excel/index.vue
View file @
658abf66
...
@@ -25,7 +25,7 @@
...
@@ -25,7 +25,7 @@
<el-table-column
align=
"center"
prop=
"created_at"
label=
"发布时间"
width=
"220"
>
<el-table-column
align=
"center"
prop=
"created_at"
label=
"发布时间"
width=
"220"
>
<
template
scope=
"scope"
>
<
template
scope=
"scope"
>
<i
class=
"el-icon-time"
></i>
<i
class=
"el-icon-time"
></i>
<span>
{{
scope
.
row
.
display_time
}}
</span>
<span>
{{
scope
.
row
.
timestamp
|
parseTime
(
'{y
}
-{m
}
-{d
}
{h
}
:{i
}
'
)
}}
<
/span
>
<
/template
>
<
/template
>
<
/el-table-column
>
<
/el-table-column
>
<
/el-table
>
<
/el-table
>
...
@@ -34,6 +34,7 @@
...
@@ -34,6 +34,7 @@
<
script
>
<
script
>
import
{
fetchList
}
from
'@/api/article'
import
{
fetchList
}
from
'@/api/article'
import
{
parseTime
}
from
'utils'
export
default
{
export
default
{
data
()
{
data
()
{
...
@@ -67,7 +68,13 @@ export default {
...
@@ -67,7 +68,13 @@ export default {
}
)
}
)
}
,
}
,
formatJson
(
filterVal
,
jsonData
)
{
formatJson
(
filterVal
,
jsonData
)
{
return
jsonData
.
map
(
v
=>
filterVal
.
map
(
j
=>
v
[
j
]))
return
jsonData
.
map
(
v
=>
filterVal
.
map
(
j
=>
{
if
(
j
===
'timestamp'
)
{
return
parseTime
(
v
[
j
])
}
else
{
return
v
[
j
]
}
}
))
}
}
}
}
}
}
...
...
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