Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tl_estate
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
hujun
tl_estate
Commits
b19e14e1
Commit
b19e14e1
authored
Nov 01, 2018
by
agping
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
设置 站点
parent
32f1d79b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
123 additions
and
1 deletion
+123
-1
index.html
application/index/view/auth/index.html
+28
-1
auth.js
public/resource/js/auth.js
+94
-0
auth_template_tpl.html
public/resource/template/auth_template_tpl.html
+1
-0
No files found.
application/index/view/auth/index.html
View file @
b19e14e1
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
<div
class=
""
>
<div
class=
""
>
<div
class=
"panel panel-default"
>
<div
class=
"panel panel-default"
>
<div
class=
"panel-heading breadcrumb"
>
<div
class=
"panel-heading breadcrumb"
>
<li><a
href=
"#"
>
角色管理
</a></li>
<li><a
href=
"#"
>
角色管理
666
</a></li>
<li
class=
"active"
>
添加角色
</li>
<li
class=
"active"
>
添加角色
</li>
<div
class=
"pull-right"
>
<div
class=
"pull-right"
>
<ul
class=
"bread_btn"
>
<ul
class=
"bread_btn"
>
...
@@ -134,3 +134,30 @@
...
@@ -134,3 +134,30 @@
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal -->
</div>
<!-- /.modal -->
</div>
</div>
<!--站点设置-->
<div
class=
"modal fade"
id=
"modal-site"
tabindex=
"-1"
role=
"dialog"
aria-labelledby=
"myModalLabel"
aria-hidden=
"true"
>
<div
class=
"modal-dialog"
>
<div
class=
"modal-content"
>
<div
class=
"modal-header"
>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
aria-hidden=
"true"
>
×
</button>
<h4
class=
"modal-title"
>
站点设置
</h4>
</div>
<div
class=
"modal-body"
>
<div
class=
"col-sm-9 shangpu_tags_area_edit ld-Marheight"
>
</div>
</div>
<div
class=
"modal-footer"
>
<button
type=
"button"
class=
"btn btn-default"
data-dismiss=
"modal"
>
关闭
</button>
<button
type=
"button"
class=
"btn btn-primary save-site"
data-dismiss=
"modal"
>
保存
</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal -->
</div>
public/resource/js/auth.js
View file @
b19e14e1
...
@@ -2,6 +2,7 @@ define (['doT', 'text!temp/auth_template_tpl.html', 'css!style/home.css','pagina
...
@@ -2,6 +2,7 @@ define (['doT', 'text!temp/auth_template_tpl.html', 'css!style/home.css','pagina
auth
=
{
auth
=
{
pageNo
:
1
,
/*第几页*/
pageNo
:
1
,
/*第几页*/
pageSize
:
10
,
/*每页显示多少条*/
pageSize
:
10
,
/*每页显示多少条*/
siteId
:
''
,
/* 标识 站点id*/
init
:
function
()
{
init
:
function
()
{
//初始化dot
//初始化dot
$
(
"body"
).
append
(
template
);
$
(
"body"
).
append
(
template
);
...
@@ -27,6 +28,13 @@ define (['doT', 'text!temp/auth_template_tpl.html', 'css!style/home.css','pagina
...
@@ -27,6 +28,13 @@ define (['doT', 'text!temp/auth_template_tpl.html', 'css!style/home.css','pagina
$
(
document
).
delegate
(
".submit_power"
,
"click"
,
function
()
{
//点击提交权限
$
(
document
).
delegate
(
".submit_power"
,
"click"
,
function
()
{
//点击提交权限
auth
.
Submit_power
();
auth
.
Submit_power
();
});
});
$
(
document
).
delegate
(
".site"
,
"click"
,
function
()
{
//点击设置站点
auth
.
id
=
$
(
this
).
attr
(
"data-id"
);
auth
.
getSiteTagsEdit
();
});
$
(
document
).
delegate
(
".save-site"
,
"click"
,
function
()
{
//点击设置站点
auth
.
saveSite
();
});
$
(
document
).
delegate
(
".is_show"
,
"click"
,
function
()
{
//点击禁用
$
(
document
).
delegate
(
".is_show"
,
"click"
,
function
()
{
//点击禁用
if
(
!
confirm
(
'是否继续?'
))
{
if
(
!
confirm
(
'是否继续?'
))
{
return
;
return
;
...
@@ -64,6 +72,92 @@ define (['doT', 'text!temp/auth_template_tpl.html', 'css!style/home.css','pagina
...
@@ -64,6 +72,92 @@ define (['doT', 'text!temp/auth_template_tpl.html', 'css!style/home.css','pagina
});
});
},
},
//获取站点 标签 (编辑)
getSiteTagsEdit
:
function
()
{
$
(
'.shangpu_tags_area_edit '
).
html
(
''
);
$
.
ajax
({
type
:
'GET'
,
url
:
'/index/getSiteList'
,
data
:
{},
timeout
:
30000
,
dataType
:
'json'
,
beforeSend
:
function
()
{},
success
:
function
(
_data
)
{
if
(
typeof
_data
===
'object'
)
{
if
(
_data
[
'code'
]
==
'200'
)
{
var
_htmlTemp
=
''
;
$
.
each
(
_data
.
data
.
list
,
function
(
i
,
item
)
{
_htmlTemp
+=
'<label class="checkbox-inline"><input type="checkbox" class="roomTagEdit" id="" value="{0}" data-id="{1}" name="shangpu_tags[]">{0}</label>'
.
stringFormatObj
({
'0'
:
item
.
city
,
'1'
:
item
.
id
});
});
$
(
'.shangpu_tags_area_edit'
).
append
(
_htmlTemp
);
auth
.
Caozuo
();
}
else
{
alert
(
_data
[
'msg'
]);
}
}
else
{
alert
(
'数据错误'
);
};
},
error
:
function
()
{
alert
(
'enter error'
);
},
complete
:
function
(
xhr
,
textStatus
)
{
if
(
textStatus
===
'timeout'
)
{
//处理超时的逻辑
alert
(
'请求超时,请重试'
);
};
}
});
},
Caozuo
:
function
(){
//获取站点 信息
$
.
ajax
({
'type'
:
'GET'
,
'url'
:
'/index/setSite'
,
data
:
{
"group_id"
:
auth
.
id
},
dataType
:
"json"
,
success
:
function
(
data
){
if
(
data
.
data
)
{
if
(
data
.
data
.
length
){
auth
.
siteId
=
data
.
data
[
0
][
'id'
];
}
//获取 站点城市(编辑)
data
.
data
.
length
&&
$
.
each
(
$
(
'.roomTagEdit'
),
function
(
i
,
item
)
{
~
data
.
data
[
0
][
'site_id'
].
indexOf
(
item
.
getAttribute
(
'data-id'
))
&&
(
item
.
checked
=
'checked'
);
});
}
else
{
alert
(
'获取失败!'
);
}
}
});
},
saveSite
:
function
(){
//保存站点 信息
var
_siteTagArr
=
[];
$
.
each
(
$
(
'.roomTagEdit'
),
function
(
i
,
item
)
{
item
.
checked
&&
_siteTagArr
.
push
(
item
.
getAttribute
(
'data-id'
));
});
$
.
ajax
({
'type'
:
'POST'
,
'url'
:
'/index/setSite'
,
data
:
{
"group_id"
:
auth
.
id
,
"site_id_string"
:
_siteTagArr
.
join
(
','
),
"id"
:
auth
.
siteId
},
dataType
:
"json"
,
success
:
function
(
data
){
if
(
data
.
data
)
{
alert
(
data
.
msg
)
}
else
{
alert
(
'获取失败!'
);
}
}
});
},
Edit
:
function
(){
//获取
Edit
:
function
(){
//获取
$
.
ajax
({
$
.
ajax
({
'type'
:
'GET'
,
'type'
:
'GET'
,
...
...
public/resource/template/auth_template_tpl.html
View file @
b19e14e1
...
@@ -19,6 +19,7 @@
...
@@ -19,6 +19,7 @@
[
%
}
else
{
%
]
[
%
}
else
{
%
]
<
a
class
=
"btn1 btn-default"
data
-
toggle
=
"modal"
data
-
id
=
'[%= it[item]["id"] %]'
>
离职
<
/a
>
<
a
class
=
"btn1 btn-default"
data
-
toggle
=
"modal"
data
-
id
=
'[%= it[item]["id"] %]'
>
离职
<
/a
>
[
%
}
%
]
[
%
}
%
]
<
a
class
=
"btn btn-info btn-xs site"
href
=
"#modal-site"
data
-
toggle
=
"modal"
data
-
id
=
'[%= it[item]["id"] %]'
>
站点设置
<
/a
>
<
/td
>
<
/td
>
<
/tr
>
<
/tr
>
[
%
}
%
]
[
%
}
%
]
...
...
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