Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
Ygopro Arena Web
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
Ygopro Arena Web
Commits
dcd25071
Commit
dcd25071
authored
May 07, 2017
by
ganjingcun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
编辑历史
parent
4c3ba8ed
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
126 additions
and
14 deletions
+126
-14
src/components/Deck.vue
src/components/Deck.vue
+126
-14
No files found.
src/components/Deck.vue
View file @
dcd25071
<
template
>
<
template
>
<div
class=
"content"
>
<div
class=
"content"
>
<div
class=
"container"
>
<div
class=
"container"
>
<h4
style=
"text-align: center"
>
{{
title
}}
</h4>
<hr>
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"col-md-4"
id=
"profile"
>
<div
class=
"col-md-4"
id=
"profile"
>
<div
class=
"thumbnail"
>
<div
class=
"thumbnail"
>
...
@@ -18,17 +21,44 @@
...
@@ -18,17 +21,44 @@
<div
class=
"alert alert-success alert-dismissible"
role=
"alert"
v-if=
"!isNew"
>
<div
class=
"alert alert-success alert-dismissible"
role=
"alert"
v-if=
"!isNew"
>
<button
type=
"button"
class=
"close"
data-dismiss=
"alert"
aria-label=
"Close"
><span
aria-hidden=
"true"
>
×
</span></button>
您可以参与编辑此页面。
<button
type=
"button"
class=
"close"
data-dismiss=
"alert"
aria-label=
"Close"
><span
aria-hidden=
"true"
>
×
</span></button>
您可以参与编辑此页面。
<i
class=
"el-icon-edit"
@
click.prevent=
"dialogFormVisible = true"
>
编辑
</i>
<i
class=
"el-icon-edit
hand
"
@
click.prevent=
"dialogFormVisible = true"
>
编辑
</i>
</div>
</div>
<div
class=
"alert alert-success alert-dismissible"
role=
"alert"
v-if=
"isNew"
>
<div
class=
"alert alert-success alert-dismissible"
role=
"alert"
v-if=
"isNew"
>
<button
type=
"button"
class=
"close"
data-dismiss=
"alert"
aria-label=
"Close"
><span
aria-hidden=
"true"
>
×
</span></button>
此卡组还未有任何信息。您可以参与编辑此页面。
<button
type=
"button"
class=
"close"
data-dismiss=
"alert"
aria-label=
"Close"
><span
aria-hidden=
"true"
>
×
</span></button>
此卡组还未有任何信息。您可以参与编辑此页面。
<i
class=
"el-icon-edit"
@
click.prevent=
"dialogFormVisible = true"
>
编辑
</i>
<i
class=
"el-icon-edit hand"
@
click.prevent=
"dialogFormVisible = true"
>
编辑
</i>
</div>
<h4
class=
"color-blue"
><i
class=
"glyphicon glyphicon-list-alt"
></i>
编辑历史
</h4>
<!--
<div
class=
"panel panel-default"
>
<div
class=
"panel-heading"
>
<h3
class=
"panel-title"
>
编辑历史
</h3>
</div>
-->
<!--
<div
class=
"panel-body"
>
-->
<!--
<div
style=
"width:100%;overflow-x:auto;overflow-y:hidden;"
>
<table
id=
"rank"
class=
"table table-striped table-bordered table-hover example"
></table>
</div>
-->
<!--
<div
class=
"table-responsive"
style=
"width:100%;overflow-x:auto;overflow-y:hidden;"
>
<table
id=
"athletic_rank"
class=
"table table-striped table-bordered table-hover example"
:class=
"
{ scroll: isMobile }">
</table>
</div>
-->
<!--
</div>
-->
<!--
<div
class=
"table-responsive"
style=
"width:100%;overflow-x:auto;overflow-y:hidden;"
>
<table
id=
"rank"
class=
"table table-striped table-bordered table-hover example"
:class=
"
{ scroll: isMobile }" >
</table>
</div>
-->
<!--
</div>
-->
<div
class=
"table-responsive"
style=
"width:100%;overflow-x:auto;overflow-y:hidden;"
>
<table
id=
"athletic_rank"
class=
"table table-striped table-bordered table-hover example"
:class=
"
{ scroll: isMobile }">
</table>
</div>
</div>
<el-dialog
:title=
"username"
size=
"large"
v-model=
"dialogFormVisible"
>
<el-dialog
:title=
"username"
size=
"large"
v-model=
"dialogFormVisible"
>
<el-form
:model=
"form"
>
<el-form
:model=
"form"
>
<el-form-item
label=
"URL"
:label-width=
"formLabelWidth"
>
<el-form-item
label=
"标题"
:label-width=
"formLabelWidth"
>
<el-input
v-model=
"avatar_url_new"
auto-complete=
"off"
></el-input>
<el-input
v-model=
"title_new"
placeholder=
"请输入标题"
auto-complete=
"off"
></el-input>
</el-form-item>
<el-form-item
label=
"图片URL"
:label-width=
"formLabelWidth"
>
<el-input
v-model=
"avatar_url_new"
placeholder=
"请输入您希望展示的图片的地址"
auto-complete=
"off"
></el-input>
</el-form-item>
</el-form-item>
<!--
<el-form-item
label=
"类型"
:label-width=
"formLabelWidth"
>
<!--
<el-form-item
label=
"类型"
:label-width=
"formLabelWidth"
>
<el-select
v-model=
"form.region"
placeholder=
"请选择类型"
>
<el-select
v-model=
"form.region"
placeholder=
"请选择类型"
>
...
@@ -38,7 +68,7 @@
...
@@ -38,7 +68,7 @@
</el-form-item>
-->
</el-form-item>
-->
<el-form-item
label=
"描述"
:label-width=
"formLabelWidth"
>
<el-form-item
label=
"描述"
:label-width=
"formLabelWidth"
>
<el-input
type=
"textarea"
:autosize=
"
{ minRows: 2, maxRows: 6}" placeholder="请输入
内容
" v-model="form.desc_new">
<el-input
type=
"textarea"
:autosize=
"
{ minRows: 2, maxRows: 6}" placeholder="请输入
您对此卡组的描述
" v-model="form.desc_new">
</el-input>
</el-input>
</el-form-item>
</el-form-item>
...
@@ -62,6 +92,7 @@
...
@@ -62,6 +92,7 @@
import
API
from
'
../api
'
import
API
from
'
../api
'
import
{
mapGetters
}
from
'
vuex
'
import
{
mapGetters
}
from
'
vuex
'
import
moment
from
'
moment
'
import
moment
from
'
moment
'
import
tb_language
from
'
./tb_lang.js
'
var
rankTable
;
var
rankTable
;
var
rankTable2
;
var
rankTable2
;
...
@@ -69,7 +100,10 @@
...
@@ -69,7 +100,10 @@
export
default
{
export
default
{
data
()
{
data
()
{
return
{
return
{
isMobile
:
false
,
username
:
""
,
username
:
""
,
title
:
''
,
title_new
:
''
,
avatar_url
:
"
assets/img/unknow.jpeg
"
,
avatar_url
:
"
assets/img/unknow.jpeg
"
,
avatar_url_new
:
""
,
avatar_url_new
:
""
,
input3
:
'
asdasd
'
,
input3
:
'
asdasd
'
,
...
@@ -92,11 +126,29 @@
...
@@ -92,11 +126,29 @@
}
}
},
},
created
:
function
()
{
created
:
function
()
{
var
regex_match
=
/
(
nokia|iphone|android|motorola|^mot-|softbank|foma|docomo|kddi|up.browser|up.link|htc|dopod|blazer|netfront|helio|hosin|huawei|novarra|CoolPad|webos|techfaith|palmsource|blackberry|alcatel|amoi|ktouch|nexian|samsung|^sam-|s
[
cg
]
h|^lge|ericsson|philips|sagem|wellcom|bunjalloo|maui|symbian|smartphone|midp|wap|phone|windows ce|iemobile|^spice|^bird|^zte-|longcos|pantech|gionee|^sie-|portalmmm|jigs browser|hiptop|^benq|haier|^lct|operas*mobi|opera*mini|320x320|240x320|176x220
)
/i
;
var
u
=
navigator
.
userAgent
;
if
(
null
==
u
)
{
return
true
;
}
var
result
=
regex_match
.
exec
(
u
);
if
(
null
==
result
)
{
this
.
isMobile
=
false
;
}
else
{
this
.
isMobile
=
true
;
}
},
},
mounted
:
function
()
{
mounted
:
function
()
{
var
name
=
querystring
.
parse
(
location
.
search
.
slice
(
1
)).
name
var
queryObj
=
querystring
.
parse
(
location
.
search
.
slice
(
1
))
var
name
=
queryObj
.
name
var
version
=
queryObj
.
version
if
(
!
name
)
return
if
(
!
name
)
return
API
.
getDeckInfo
({
name
:
name
}).
then
((
res
)
=>
{
rankTable
=
this
.
renderRankTable
(
"
#athletic_rank
"
);
API
.
getDeckInfo
({
name
:
name
,
version
:
version
}).
then
((
res
)
=>
{
this
.
hasError
=
false
this
.
hasError
=
false
this
.
user_info
=
res
.
data
this
.
user_info
=
res
.
data
this
.
username
=
name
this
.
username
=
name
...
@@ -104,10 +156,20 @@
...
@@ -104,10 +156,20 @@
this
.
isNew
=
true
;
this
.
isNew
=
true
;
}
else
{
}
else
{
this
.
isNew
=
false
;
this
.
isNew
=
false
;
this
.
avatar_url
=
res
.
data
.
data
.
url
this
.
avatar_url_new
=
res
.
data
.
data
.
url
var
dataPbj
=
JSON
.
parse
(
res
.
data
.
data
.
content
)
this
.
form
.
desc
=
res
.
data
.
data
.
content
this
.
form
.
desc_new
=
res
.
data
.
data
.
content
this
.
title
=
dataPbj
.
title
this
.
title_new
=
dataPbj
.
title
this
.
avatar_url
=
dataPbj
.
url
this
.
avatar_url_new
=
dataPbj
.
url
this
.
form
.
desc
=
dataPbj
.
desc
this
.
form
.
desc_new
=
dataPbj
.
desc
if
(
rankTable
)
{
rankTable
.
destroy
();
}
rankTable
=
this
.
renderRankTable
(
"
#athletic_rank
"
,
res
.
data
.
history
)
}
}
},
(
res
)
=>
{
},
(
res
)
=>
{
this
.
hasError
=
true
this
.
hasError
=
true
...
@@ -121,40 +183,90 @@
...
@@ -121,40 +183,90 @@
}),
}),
},
},
methods
:
{
methods
:
{
cancelModify
:
function
(){
init
:
function
()
{
// var username = querystring.parse(location.hash.slice(11)).username
// this.searchText = username;
// this.searchByUsername(username)
},
cancelModify
:
function
()
{
this
.
dialogFormVisible
=
false
this
.
dialogFormVisible
=
false
},
},
submitModify
:
function
()
{
submitModify
:
function
()
{
var
param
=
{
var
param
=
{
user
:
this
.
user
.
username
,
user
:
this
.
user
.
username
,
name
:
this
.
username
,
name
:
this
.
username
,
title
:
this
.
title_new
,
desc
:
this
.
form
.
desc_new
,
desc
:
this
.
form
.
desc_new
,
url
:
this
.
avatar_url_new
,
url
:
this
.
avatar_url_new
,
isNew
:
this
.
isNew
isNew
:
this
.
isNew
}
}
API
.
saveDeck
(
param
).
then
((
res
)
=>
{
API
.
saveDeck
(
param
).
then
((
res
)
=>
{
console
.
log
(
res
.
data
)
this
.
dialogFormVisible
=
false
this
.
dialogFormVisible
=
false
this
.
isNew
=
false
this
.
isNew
=
false
this
.
form
.
desc
=
this
.
form
.
desc_new
this
.
form
.
desc
=
this
.
form
.
desc_new
this
.
avatar_url
=
this
.
avatar_url_new
this
.
avatar_url
=
this
.
avatar_url_new
this
.
title
=
this
.
title_new
this
.
$notify
({
this
.
$notify
({
title
:
'
操作成功
'
,
title
:
'
操作成功
'
,
message
:
'
感谢您的提交!
'
,
message
:
'
感谢您的提交!
'
,
type
:
'
success
'
type
:
'
success
'
})
})
},
(
res
)
=>
{
},
(
res
)
=>
{
this
.
hasError
=
true
this
.
hasError
=
true
console
.
log
(
res
)
console
.
log
(
res
)
});
});
},
},
renderRankTable
:
function
(
id
,
tableData
)
{
tableData
=
tableData
||
[];
var
lang
=
localStorage
.
getItem
(
'
lang
'
)
||
'
cn
'
;
var
processData
=
tableData
.
map
(
function
(
d
)
{
var
contentObj
=
JSON
.
parse
(
d
.
content
);
return
[
contentObj
.
author
,
contentObj
.
title
||
""
,
moment
(
d
.
start_time
).
format
(
'
YYYY-MM-DD HH:mm
'
),
d
];
});
var
table
=
$
(
id
).
DataTable
({
paging
:
false
,
searching
:
false
,
ordering
:
false
,
lengthChange
:
false
,
info
:
false
,
data
:
processData
,
columns
:
[
{
title
:
'
作者
'
},
{
title
:
'
标题
'
},
{
title
:
'
创建时间
'
},
{
title
:
'
操作
'
},
],
"
columnDefs
"
:
[
{
"
render
"
:
function
(
data
,
type
,
row
)
{
return
"
<a href='?name=
"
+
data
.
name
+
"
&version=
"
+
data
.
id
+
"
#/deck'><span class='label label-info'>查看此版本</span></a>
"
;
},
"
targets
"
:
3
},
],
"
language
"
:
lang
===
'
en
'
?
tb_language
.
en
:
tb_language
.
cn
});
return
table
;
},
},
},
}
}
</
script
>
</
script
>
<
style
scoped
>
<
style
scoped
>
.hand
{
cursor
:
pointer
}
</
style
>
</
style
>
\ No newline at end of file
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