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
033868ed
Commit
033868ed
authored
Feb 05, 2018
by
胡小根
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
coding
parent
0b60ba74
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
46 deletions
+9
-46
dev.env.js
config/dev.env.js
+1
-1
HmComplexTable.vue
src/views/haomo/components/tables/HmComplexTable.vue
+8
-45
No files found.
config/dev.env.js
View file @
033868ed
module
.
exports
=
{
module
.
exports
=
{
NODE_ENV
:
'"development"'
,
NODE_ENV
:
'"development"'
,
ENV_CONFIG
:
'"dev"'
,
ENV_CONFIG
:
'"dev"'
,
BASE_API
:
'"https://api
-dev
"'
BASE_API
:
'"https://api
.haomo-studio.com
"'
}
}
src/views/haomo/components/tables/HmComplexTable.vue
View file @
033868ed
...
@@ -142,7 +142,7 @@
...
@@ -142,7 +142,7 @@
<
/template
>
<
/template
>
<
script
>
<
script
>
import
{
fetchList
,
fetchPv
,
createArticle
,
updateArticle
}
from
'@/api/article
'
import
request
from
'@/utils/request
'
import
waves
from
'@/directive/waves'
// 水波纹指令
import
waves
from
'@/directive/waves'
// 水波纹指令
import
{
parseTime
}
from
'@/utils'
import
{
parseTime
}
from
'@/utils'
...
@@ -209,6 +209,7 @@
...
@@ -209,6 +209,7 @@
* 表格的选项,包括:page_size。完整的示例为:
* 表格的选项,包括:page_size。完整的示例为:
* {
* {
* "page_size": 10, // 默认为10条数据/页
* "page_size": 10, // 默认为10条数据/页
* "showExport": false, // 默认为不显示导出按钮
*
}
*
}
*/
*/
options
:
{
options
:
{
...
@@ -281,11 +282,12 @@
...
@@ -281,11 +282,12 @@
}
,
}
,
methods
:
{
methods
:
{
getList
()
{
getList
()
{
this
.
listLoading
=
true
const
self
=
this
fetchList
(
this
.
listQuery
).
then
(
response
=>
{
self
.
listLoading
=
true
this
.
list
=
response
.
data
.
items
request
(
self
.
schema
).
then
(
resp
=>
{
this
.
total
=
response
.
data
.
total
self
.
list
=
resp
.
data
.
data
this
.
listLoading
=
false
self
.
total
=
resp
.
data
.
total
self
.
listLoading
=
false
}
)
}
)
}
,
}
,
handleFilter
()
{
handleFilter
()
{
...
@@ -353,30 +355,6 @@
...
@@ -353,30 +355,6 @@
this
.
$refs
[
'dataForm'
].
clearValidate
()
this
.
$refs
[
'dataForm'
].
clearValidate
()
}
)
}
)
}
,
}
,
updateData
()
{
this
.
$refs
[
'dataForm'
].
validate
((
valid
)
=>
{
if
(
valid
)
{
const
tempData
=
Object
.
assign
({
}
,
this
.
temp
)
tempData
.
timestamp
=
+
new
Date
(
tempData
.
timestamp
)
// change Thu Nov 30 2017 16:41:05 GMT+0800 (CST) to 1512031311464
updateArticle
(
tempData
).
then
(()
=>
{
for
(
const
v
of
this
.
list
)
{
if
(
v
.
id
===
this
.
temp
.
id
)
{
const
index
=
this
.
list
.
indexOf
(
v
)
this
.
list
.
splice
(
index
,
1
,
this
.
temp
)
break
}
}
this
.
dialogFormVisible
=
false
this
.
$notify
({
title
:
'成功'
,
message
:
'更新成功'
,
type
:
'success'
,
duration
:
2000
}
)
}
)
}
}
)
}
,
handleDelete
(
row
)
{
handleDelete
(
row
)
{
this
.
$notify
({
this
.
$notify
({
title
:
'成功'
,
title
:
'成功'
,
...
@@ -387,12 +365,6 @@
...
@@ -387,12 +365,6 @@
const
index
=
this
.
list
.
indexOf
(
row
)
const
index
=
this
.
list
.
indexOf
(
row
)
this
.
list
.
splice
(
index
,
1
)
this
.
list
.
splice
(
index
,
1
)
}
,
}
,
handleFetchPv
(
pv
)
{
fetchPv
(
pv
).
then
(
response
=>
{
this
.
pvData
=
response
.
data
.
pvData
this
.
dialogPvVisible
=
true
}
)
}
,
handleDownload
()
{
handleDownload
()
{
this
.
downloadLoading
=
true
this
.
downloadLoading
=
true
import
(
'@/vendor/Export2Excel'
).
then
(
excel
=>
{
import
(
'@/vendor/Export2Excel'
).
then
(
excel
=>
{
...
@@ -402,15 +374,6 @@
...
@@ -402,15 +374,6 @@
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
]
}
}
))
}
}
}
}
}
}
...
...
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