mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-07-15 14:04:41 +08:00
routine update
This commit is contained in:
parent
ff0d85310c
commit
ddc311b38e
@ -176,20 +176,10 @@ var editDlg = function () {
|
||||
|
||||
//删除
|
||||
function del() {
|
||||
var selected = list.getSelectedProperties("Id");
|
||||
if (selected == null) return;
|
||||
|
||||
$.post('/CategoryManager/Delete',
|
||||
{ ids: selected },
|
||||
function (data) {
|
||||
if (data.Status) {
|
||||
list.del("Id", "/CategoryManager/Delete", function () {
|
||||
list.reload();
|
||||
ztree.reload();
|
||||
}
|
||||
else {
|
||||
layer.msg(data.Message);
|
||||
}
|
||||
}, "json");
|
||||
});
|
||||
}
|
||||
|
||||
//自定义的编辑按钮
|
||||
|
@ -150,20 +150,11 @@ var editDlg = function () {
|
||||
|
||||
//删除
|
||||
function del() {
|
||||
var selected = list.getSelectedProperties("Id");
|
||||
if (selected == null) return;
|
||||
|
||||
$.post('/CommonApplies/Delete',
|
||||
{ ids: selected },
|
||||
function (data) {
|
||||
if (data.Status) {
|
||||
list.del("Id", "/CommonApplies/Delete", function () {
|
||||
list.reload();
|
||||
ztree.reload();
|
||||
}
|
||||
else {
|
||||
layer.msg(data.Message);
|
||||
}
|
||||
}, "json");
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
//自定义的编辑按钮
|
||||
|
@ -12,32 +12,33 @@
|
||||
// <summary>maingrid基类</summary>
|
||||
// ***********************************************************************
|
||||
|
||||
function Grid() { }
|
||||
function Grid() {}
|
||||
|
||||
Grid.prototype.selectObjs = function () {
|
||||
var ids = this.maingrid.jqGrid('getGridParam', 'selarrrow');
|
||||
Grid.prototype.selectObjs = function() {
|
||||
var ids = this.maingrid.jqGrid("getGridParam", "selarrrow");
|
||||
if (ids.length == 0) {
|
||||
return null;
|
||||
}
|
||||
var ret = new Array();
|
||||
var maingrid = this.maingrid;
|
||||
$(ids).each(function () {
|
||||
var obj = maingrid.jqGrid('getRowData', this);
|
||||
$(ids)
|
||||
.each(function() {
|
||||
var obj = maingrid.jqGrid("getRowData", this);
|
||||
ret.push(obj);
|
||||
});
|
||||
return ret;
|
||||
};
|
||||
|
||||
//选择多行对象
|
||||
Grid.prototype.getSelectedMany = function () {
|
||||
Grid.prototype.getSelectedMany = function() {
|
||||
return this.selectObjs();
|
||||
};
|
||||
|
||||
//选择单行对象
|
||||
Grid.prototype.getSelectedObj = function () {
|
||||
var row = this.maingrid.jqGrid('getGridParam', 'selrow');
|
||||
Grid.prototype.getSelectedObj = function() {
|
||||
var row = this.maingrid.jqGrid("getGridParam", "selrow");
|
||||
if (row) {
|
||||
var ret = this.maingrid.jqGrid('getRowData', row);
|
||||
var ret = this.maingrid.jqGrid("getRowData", row);
|
||||
return ret;
|
||||
} else {
|
||||
return null;
|
||||
@ -45,11 +46,33 @@ Grid.prototype.getSelectedObj = function () {
|
||||
};
|
||||
|
||||
//返回选择多行的属性JSON,默认选择id属性,如果选择其他属性,可重写
|
||||
Grid.prototype.getSelectedProperties = function (propName) {
|
||||
Grid.prototype.getSelectedProperties = function(propName) {
|
||||
var selected = this.selectObjs();
|
||||
var result = new Array();
|
||||
if (selected != null) {
|
||||
result = selected.map(function (elem) { return elem[propName]; });
|
||||
result = selected.map(function(elem) { return elem[propName]; });
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
//删除操作,服务端的接收必须是post且参数为string[] ids
|
||||
Grid.prototype.del = function(idname, url, callback) {
|
||||
var selected = this.getSelectedProperties(idname);
|
||||
if (selected == null) return;
|
||||
|
||||
var lid = layer.confirm("确定要删除所选?",
|
||||
null,
|
||||
function() {
|
||||
layer.close(lid);
|
||||
$.post(url,
|
||||
{ ids: selected },
|
||||
function(data) {
|
||||
if (data.Status) {
|
||||
callback();
|
||||
} else {
|
||||
layer.msg(data.Message);
|
||||
}
|
||||
},
|
||||
"json");
|
||||
});
|
||||
};
|
@ -160,19 +160,12 @@ var editDlg = function () {
|
||||
|
||||
//删除
|
||||
function del() {
|
||||
list.del("Id", "/ModuleElementManager/Del", function () {
|
||||
list.reload();
|
||||
});
|
||||
|
||||
var selected = list.getSelectedProperties("Id");
|
||||
if (selected == null) return;
|
||||
|
||||
$.post('/ModuleElementManager/Del',
|
||||
{ ids: selected },
|
||||
function (data) {
|
||||
if (data.Status) {
|
||||
list.reload();
|
||||
}
|
||||
else {
|
||||
layer.msg(data.Message);
|
||||
}
|
||||
}, "json");
|
||||
}
|
||||
|
||||
//自定义的编辑按钮
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
//左边导航
|
||||
var ztree = function () {
|
||||
var url = '/ModuleManager/LoadModuleWithRoot';
|
||||
var url = '/ModuleManager/LoadModule';
|
||||
var setting = {
|
||||
view: { selectedMulti: false },
|
||||
data: {
|
||||
@ -123,7 +123,7 @@ var vm = new Vue({
|
||||
});
|
||||
|
||||
//上级机构选择框
|
||||
var parent = new ParentTree("/moduleManager/LoadForTree", "ParentName", "ParentId");
|
||||
var parent = new ParentTree("/moduleManager/LoadModule", "ParentName", "ParentId");
|
||||
|
||||
//添加(编辑)对话框
|
||||
var editDlg = function () {
|
||||
@ -169,19 +169,11 @@ var editDlg = function () {
|
||||
|
||||
//删除
|
||||
function del() {
|
||||
var selected = list.getSelectedProperties("Id");
|
||||
if (selected == null) return;
|
||||
|
||||
$.post('/moduleManager/Delete',
|
||||
{ ids: selected }, function (data) {
|
||||
if (data.Status) {
|
||||
list.del("Id", "/moduleManager/Delete", function () {
|
||||
list.reload();
|
||||
ztree.reload();
|
||||
}
|
||||
else {
|
||||
$(this).alertmsg('warn', data.Message);
|
||||
}
|
||||
}, "json");
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
//自定义的编辑按钮
|
||||
|
@ -165,19 +165,10 @@ var editDlg = function () {
|
||||
|
||||
//删除
|
||||
function del() {
|
||||
var selected = list.getSelectedProperties("Id");
|
||||
if (selected == null) return;
|
||||
|
||||
$.post('/OrgManager/DelOrg',
|
||||
{ ids: selected }, function (data) {
|
||||
if (data.Status) {
|
||||
list.del("Id", "/OrgManager/DelOrg", function () {
|
||||
list.reload();
|
||||
ztree.reload();
|
||||
}
|
||||
else {
|
||||
layer.msg(data.Message);
|
||||
}
|
||||
}, "json");
|
||||
});
|
||||
}
|
||||
|
||||
//自定义的编辑按钮
|
||||
|
@ -163,19 +163,10 @@ var editDlg = function () {
|
||||
|
||||
//删除
|
||||
function del() {
|
||||
var selected = list.getSelectedProperties("Id");
|
||||
if (selected == null) return;
|
||||
|
||||
$.post('/ResourceManager/Delete',
|
||||
{ ids: selected }, function (data) {
|
||||
if (data.Status) {
|
||||
list.del("Id", "/ResourceManager/Delete", function () {
|
||||
list.reload();
|
||||
ztree.reload();
|
||||
}
|
||||
else {
|
||||
$(this).alertmsg('warn', data.Message);
|
||||
}
|
||||
}, "json");
|
||||
});
|
||||
}
|
||||
|
||||
//自定义的编辑按钮
|
||||
|
@ -155,20 +155,10 @@ var editDlg = function () {
|
||||
|
||||
//删除
|
||||
function del() {
|
||||
var selected = list.getSelectedProperties("Id");
|
||||
if (selected == null) return;
|
||||
|
||||
$.post('/RoleManager/Delete',
|
||||
{ ids: selected },
|
||||
function (data) {
|
||||
if (data.Status) {
|
||||
list.del("Id", "/RoleManager/Delete",function() {
|
||||
list.reload();
|
||||
ztree.reload();
|
||||
}
|
||||
else {
|
||||
layer.msg(data.Message);
|
||||
}
|
||||
}, "json");
|
||||
});
|
||||
}
|
||||
|
||||
//自定义的编辑按钮
|
||||
|
@ -163,20 +163,10 @@ var editDlg = function () {
|
||||
|
||||
//删除
|
||||
function del() {
|
||||
var selected = list.getSelectedProperties("Id");
|
||||
if (selected == null) return;
|
||||
|
||||
$.post('/StockManager/Delete',
|
||||
{ ids: selected },
|
||||
function (data) {
|
||||
if (data.Status) {
|
||||
list.del("Id", "/StockManager/Delete", function () {
|
||||
list.reload();
|
||||
ztree.reload();
|
||||
}
|
||||
else {
|
||||
layer.msg(data.Message);
|
||||
}
|
||||
}, "json");
|
||||
});
|
||||
}
|
||||
|
||||
//自定义的编辑按钮
|
||||
|
@ -166,20 +166,10 @@ var editDlg = function () {
|
||||
|
||||
//删除
|
||||
function del() {
|
||||
var selected = list.getSelectedProperties("Id");
|
||||
if (selected == null) return;
|
||||
|
||||
$.post('/UserManager/Delete',
|
||||
{ ids: selected },
|
||||
function (data) {
|
||||
if (data.Status) {
|
||||
list.del("Id", "/UserManager/Delete", function () {
|
||||
list.reload();
|
||||
ztree.reload();
|
||||
}
|
||||
else {
|
||||
layer.msg(data.Message);
|
||||
}
|
||||
}, "json");
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
@ -52,19 +52,9 @@ var vm = new Vue({
|
||||
|
||||
//删除
|
||||
function del() {
|
||||
var selected = list.getSelectedProperties("Code");
|
||||
if (selected == null) return;
|
||||
|
||||
$.post('/WorkflowSchemas/Del',
|
||||
{ codes: selected },
|
||||
function (data) {
|
||||
if (data.Status) {
|
||||
list.del("Code", "/WorkflowSchemas/Del", function () {
|
||||
list.reload();
|
||||
}
|
||||
else {
|
||||
layer.msg(data.Message);
|
||||
}
|
||||
}, "json");
|
||||
});
|
||||
}
|
||||
|
||||
//自定义的编辑按钮
|
||||
|
@ -109,15 +109,6 @@ namespace OpenAuth.Mvc.Controllers
|
||||
return JsonHelper.Instance.Serialize(_app.Load(orgId, page, rows));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 直接加载所有的模块
|
||||
/// </summary>
|
||||
public string LoadForTree()
|
||||
{
|
||||
var orgs = AuthUtil.GetCurrentUser().ModuleWithChildren;
|
||||
return JsonHelper.Instance.Serialize(orgs);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 加载用户模块
|
||||
/// </summary>
|
||||
@ -140,7 +131,7 @@ namespace OpenAuth.Mvc.Controllers
|
||||
return JsonHelper.Instance.Serialize(orgs);
|
||||
}
|
||||
|
||||
public string LoadModuleWithRoot()
|
||||
public string LoadModule()
|
||||
{
|
||||
var orgs = AuthUtil.GetCurrentUser().Modules.MapToList<ModuleView>();
|
||||
return JsonHelper.Instance.Serialize(orgs);
|
||||
|
@ -24,11 +24,11 @@ namespace OpenAuth.Mvc.Controllers
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public string Del(string[] codes)
|
||||
public string Del(string[] ids)
|
||||
{
|
||||
try
|
||||
{
|
||||
_app.Del(codes);
|
||||
_app.Del(ids);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
@ -6,7 +6,7 @@
|
||||
<ul class="breadcrumb">
|
||||
<li>
|
||||
<i class="ace-icon fa fa-home home-icon"></i>
|
||||
<a href="#">资源管理</a>
|
||||
<a href="#">模块管理</a>
|
||||
</li>
|
||||
<li class="active">列表</li>
|
||||
</ul><!-- /.breadcrumb -->
|
||||
|
@ -7,7 +7,7 @@
|
||||
<ul class="breadcrumb">
|
||||
<li>
|
||||
<i class="ace-icon fa fa-home home-icon"></i>
|
||||
<a href="#">机构管理</a>
|
||||
<a href="#">角色管理</a>
|
||||
</li>
|
||||
<li class="active">列表</li>
|
||||
</ul><!-- /.breadcrumb -->
|
||||
|
@ -7,7 +7,7 @@
|
||||
<ul class="breadcrumb">
|
||||
<li>
|
||||
<i class="ace-icon fa fa-home home-icon"></i>
|
||||
<a href="#">分类管理</a>
|
||||
<a href="#">进出库管理</a>
|
||||
</li>
|
||||
<li class="active">列表</li>
|
||||
</ul><!-- /.breadcrumb -->
|
||||
|
@ -7,7 +7,7 @@
|
||||
<ul class="breadcrumb">
|
||||
<li>
|
||||
<i class="ace-icon fa fa-home home-icon"></i>
|
||||
<a href="#">机构管理</a>
|
||||
<a href="#">用户管理</a>
|
||||
</li>
|
||||
<li class="active">列表</li>
|
||||
</ul><!-- /.breadcrumb -->
|
||||
|
@ -7,7 +7,7 @@
|
||||
<ul class="breadcrumb">
|
||||
<li>
|
||||
<i class="ace-icon fa fa-home home-icon"></i>
|
||||
<a href="#">分类管理</a>
|
||||
<a href="#">流程设计</a>
|
||||
</li>
|
||||
<li class="active">列表</li>
|
||||
</ul><!-- /.breadcrumb -->
|
||||
|
Loading…
Reference in New Issue
Block a user