Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
solo-1
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
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
Administrator
solo-1
Commits
cd9aad92
Commit
cd9aad92
authored
Apr 01, 2017
by
Van
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🚧
#12256
parent
62d7a0c7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
68 deletions
+17
-68
src/main/webapp/js/admin/admin.js
src/main/webapp/js/admin/admin.js
+1
-1
src/main/webapp/js/admin/categoryList.js
src/main/webapp/js/admin/categoryList.js
+16
-67
No files found.
src/main/webapp/js/admin/admin.js
View file @
cd9aad92
...
...
@@ -17,7 +17,7 @@
* @description index for admin
*
* @author <a href="http://vanessa.b3log.org">Liyuan Li</a>
* @version 1.
0.3.2, Sep 2, 2013
* @version 1.
1.3.2, Mar 31, 2017
*/
var
Admin
=
function
()
{
this
.
register
=
{};
...
...
src/main/webapp/js/admin/categoryList.js
View file @
cd9aad92
...
...
@@ -28,10 +28,6 @@ admin.categoryList = {
pageCount
:
1
,
currentPage
:
1
},
categoryInfo
:
{
'
oId
'
:
""
,
"
categoryRole
"
:
""
},
/*
* 初始化 table, pagination
*/
...
...
@@ -125,7 +121,7 @@ admin.categoryList = {
categoryData
[
i
].
expendRow
=
"
<a href='javascript:void(0)' onclick=
\"
admin.categoryList.get('
"
+
categories
[
i
].
oId
+
"
')
\"
>
"
+
Label
.
updateLabel
+
"
</a>
\
<a href='javascript:void(0)' onclick=
\"
admin.categoryList.del('
"
+
categories
[
i
].
oId
+
"
', '
"
+
categories
[
i
].
category
Nam
e
+
"
')
\"
>
"
+
Label
.
removeLabel
+
"
</a>
"
;
categories
[
i
].
category
Titl
e
+
"
')
\"
>
"
+
Label
.
removeLabel
+
"
</a>
"
;
that
.
tablePagination
.
updateTablePagination
(
categoryData
,
pageNum
,
result
.
pagination
);
...
...
@@ -182,10 +178,10 @@ admin.categoryList = {
}
},
/*
* 获取
用户
* 获取
单个分类
* @id 用户 id
*/
get
:
function
(
id
,
categoryRole
)
{
get
:
function
(
id
)
{
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
);
$
(
"
#tipMsg
"
).
text
(
""
);
$
(
"
#categoryUpdate
"
).
dialog
(
"
open
"
);
...
...
@@ -201,43 +197,29 @@ admin.categoryList = {
return
;
}
var
$categoryEmailUpdate
=
$
(
"
#categoryEmailUpdate
"
);
$
(
"
#categoryNameUpdate
"
).
val
(
result
.
category
.
categoryName
).
data
(
"
categoryInfo
"
,
{
'
oId
'
:
id
,
"
categoryRole
"
:
categoryRole
});
$categoryEmailUpdate
.
val
(
result
.
category
.
categoryEmail
);
if
(
"
adminRole
"
===
categoryRole
)
{
$categoryEmailUpdate
.
attr
(
"
disabled
"
,
"
disabled
"
);
}
else
{
$categoryEmailUpdate
.
removeAttr
(
"
disabled
"
);
}
$
(
"
#categoryURLUpdate
"
).
val
(
result
.
category
.
categoryURL
);
$
(
"
#categoryPasswordUpdate
"
).
val
(
result
.
category
.
categoryPassword
);
$
(
"
#categoryAvatarUpdate
"
).
val
(
result
.
category
.
categoryAvatar
);
$
(
"
#categoryNameUpdate
"
).
val
(
result
.
category
.
categoryTitle
).
data
(
"
oId
"
,
id
);
$
(
"
#categoryURIUpdate
"
).
val
(
result
.
category
.
categoryURI
);
$
(
"
#categoryDescUpdate
"
).
val
(
result
.
category
.
categoryDesc
);
$
(
"
#categoryTagsUpdate
"
).
val
(
result
.
category
.
categoryTags
);
$
(
"
#loadMsg
"
).
text
(
""
);
}
});
},
/*
* 更新
用户
* 更新
分类
*/
update
:
function
()
{
if
(
this
.
validate
(
"
Update
"
))
{
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
);
$
(
"
#tipMsg
"
).
text
(
""
);
var
categoryInfo
=
$
(
"
#categoryNameUpdate
"
).
data
(
"
categoryInfo
"
);
var
requestJSONObject
=
{
"
categoryName
"
:
$
(
"
#categoryNameUpdate
"
).
val
(),
"
oId
"
:
categoryInfo
.
oId
,
"
categoryEmail
"
:
$
(
"
#categoryEmailUpdate
"
).
val
(),
"
categoryURL
"
:
$
(
"
#categoryURLUpdate
"
).
val
(),
"
categoryRole
"
:
categoryInfo
.
categoryRole
,
"
categoryPassword
"
:
$
(
"
#categoryPasswordUpdate
"
).
val
(),
"
categoryAvatar
"
:
$
(
"
#categoryAvatarUpdate
"
).
val
()
"
categoryTitle
"
:
$
(
"
#categoryNameUpdate
"
).
val
(),
"
oId
"
:
$
(
"
#categoryNameUpdate
"
).
data
(
"
oId
"
),
"
categoryTags
"
:
$
(
"
#categoryTagsUpdate
"
).
val
(),
"
categoryURI
"
:
$
(
"
#categoryURIUpdate
"
).
val
(),
"
categoryDesc
"
:
$
(
"
#categoryDescUpdate
"
).
val
()
};
$
.
ajax
({
...
...
@@ -261,9 +243,9 @@ admin.categoryList = {
}
},
/*
* 删除
用户
* @id
用户
id
* @categoryName
用户
名称
* 删除
分类
* @id
分类
id
* @categoryName
分类
名称
*/
del
:
function
(
id
,
categoryName
)
{
var
isDelete
=
confirm
(
Label
.
confirmRemoveLabel
+
Label
.
categoryLabel
+
'
"
'
+
categoryName
+
'
"?
'
);
...
...
@@ -299,39 +281,6 @@ admin.categoryList = {
});
}
},
/**
* 修改角色
* @param id
*/
changeRole
:
function
(
id
)
{
$
(
"
#tipMsg
"
).
text
(
""
);
$
.
ajax
({
url
:
latkeConfig
.
servePath
+
"
/console/changeRole/
"
+
id
,
type
:
"
GET
"
,
cache
:
false
,
success
:
function
(
result
,
textStatus
)
{
$
(
"
#tipMsg
"
).
text
(
result
.
msg
);
if
(
!
result
.
sc
)
{
$
(
"
#loadMsg
"
).
text
(
""
);
return
;
}
var
pageNum
=
admin
.
categoryList
.
pageInfo
.
currentPage
;
if
(
admin
.
categoryList
.
pageInfo
.
currentCount
===
1
&&
admin
.
categoryList
.
pageInfo
.
pageCount
!==
1
&&
admin
.
categoryList
.
pageInfo
.
currentPage
===
admin
.
categoryList
.
pageInfo
.
pageCount
)
{
admin
.
categoryList
.
pageInfo
.
pageCount
--
;
pageNum
=
admin
.
categoryList
.
pageInfo
.
pageCount
;
}
var
hashList
=
window
.
location
.
hash
.
split
(
"
/
"
);
if
(
pageNum
!==
parseInt
(
hashList
[
hashList
.
length
-
1
]))
{
admin
.
setHashByPage
(
pageNum
);
}
admin
.
categoryList
.
getList
(
pageNum
);
$
(
"
#loadMsg
"
).
text
(
""
);
}
});
},
/*
* 验证字段
* @status 更新或者添加时进行验证
...
...
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