Commit 7d0e40df authored by agping's avatar agping

规则管理

parent 4a172131
...@@ -2,6 +2,7 @@ define (['doT', 'text!temp/auth_rule_index_template_tpl.html', 'css!style/home.c ...@@ -2,6 +2,7 @@ define (['doT', 'text!temp/auth_rule_index_template_tpl.html', 'css!style/home.c
authRule={ authRule={
pageNo:1, pageNo:1,
pageSize:15, pageSize:15,
isAdd:0,//默认编辑
init:function () { init:function () {
//初始化dot //初始化dot
$("body").append(template); $("body").append(template);
...@@ -14,6 +15,7 @@ authRule={ ...@@ -14,6 +15,7 @@ authRule={
}); });
$ (document).delegate (".edit", "click", function () {//点击编辑 $ (document).delegate (".edit", "click", function () {//点击编辑
authRule.house_id = $ (this).attr ("data-id"); authRule.house_id = $ (this).attr ("data-id");
authRule.isAdd = 0;//编辑
authRule.Edid_add(function(){ authRule.Edid_add(function(){
authRule.Edit(); authRule.Edit();
}); });
...@@ -25,6 +27,7 @@ authRule={ ...@@ -25,6 +27,7 @@ authRule={
$ (document).delegate (".edit_add", "click", function () {//新增 $ (document).delegate (".edit_add", "click", function () {//新增
document.getElementById("form-horizontal").reset(); document.getElementById("form-horizontal").reset();
authRule.Edid_add(); authRule.Edid_add();
authRule.isAdd = 1;//新增
}); });
$ (document).delegate (".is_show", "click", function () {//点击禁用 $ (document).delegate (".is_show", "click", function () {//点击禁用
if (!confirm('是否继续?')) { if (!confirm('是否继续?')) {
...@@ -102,8 +105,13 @@ authRule={ ...@@ -102,8 +105,13 @@ authRule={
}, },
Submit_edit:function(){//提交编辑的信息 Submit_edit:function(){//提交编辑的信息
var par={} var par={};
par.id= authRule.house_id;
if(authRule.isAdd == 1){
}else{
par.id= authRule.house_id;
}
par.title= $("input[name = title]").val(); par.title= $("input[name = title]").val();
par.name= $("input[name = name]").val(); par.name= $("input[name = name]").val();
par.sort= $("input[name = sort]").val(); par.sort= $("input[name = sort]").val();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment