mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-12-26 22:25:39 +08:00
check bugs
This commit is contained in:
@@ -1,42 +0,0 @@
|
|||||||
// ***********************************************************************
|
|
||||||
// Assembly : OpenAuth.Mvc
|
|
||||||
// Author : yubaolee
|
|
||||||
// Created : 04-16-2016
|
|
||||||
//
|
|
||||||
// Last Modified By : yubaolee
|
|
||||||
// Last Modified On : 04-16-2016
|
|
||||||
// ***********************************************************************
|
|
||||||
// <copyright file="userRes.js" company="www.cnblogs.com/yubaolee">
|
|
||||||
// 版权所有(C) 2015
|
|
||||||
// </copyright>
|
|
||||||
// <summary>分配组织</summary>
|
|
||||||
// ***********************************************************************
|
|
||||||
layui.use(['layer', 'form'], function () {
|
|
||||||
var form = layui.form();
|
|
||||||
|
|
||||||
form.on('checkbox', function (data) {
|
|
||||||
if (data.elem.checked)
|
|
||||||
{
|
|
||||||
$.post('/RelevanceManager/Assign', {
|
|
||||||
type: $("#moduleType").val(),
|
|
||||||
firstId: $('#firstId').val(),
|
|
||||||
secIds: data.value
|
|
||||||
}, function (json) {
|
|
||||||
json = $.parseJSON(json);
|
|
||||||
|
|
||||||
});
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$.post('/RelevanceManager/UnAssign', {
|
|
||||||
type: $("#moduleType").val(),
|
|
||||||
firstId: $('#firstId').val(),
|
|
||||||
secIds: data.value
|
|
||||||
}, function (json) {
|
|
||||||
json = $.parseJSON(json);
|
|
||||||
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
@@ -1,114 +0,0 @@
|
|||||||
// ***********************************************************************
|
|
||||||
// Assembly : OpenAuth.Mvc
|
|
||||||
// Author : yubaolee
|
|
||||||
// Created : 04-19-2016
|
|
||||||
//
|
|
||||||
// Last Modified By : yubaolee
|
|
||||||
// Last Modified On : 05-26-2016
|
|
||||||
// Contact : www.cnblogs.com/yubaolee
|
|
||||||
// File: assignModuleElement.js
|
|
||||||
//Description: 分配模块菜单(按钮)
|
|
||||||
// ***********************************************************************
|
|
||||||
|
|
||||||
function renderLayui() {
|
|
||||||
layui.use(['layer', 'form'], function () {
|
|
||||||
var form = layui.form();
|
|
||||||
|
|
||||||
form.on('checkbox', function (data) {
|
|
||||||
if (data.elem.checked) {
|
|
||||||
$.post('/RelevanceManager/Assign', {
|
|
||||||
type: $("#moduleType").val(),
|
|
||||||
firstId: $('#firstId').val(),
|
|
||||||
secIds: data.value
|
|
||||||
}, function (json) {
|
|
||||||
json = $.parseJSON(json);
|
|
||||||
|
|
||||||
});
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$.post('/RelevanceManager/UnAssign', {
|
|
||||||
type: $("#moduleType").val(),
|
|
||||||
firstId: $('#firstId').val(),
|
|
||||||
secIds: data.value
|
|
||||||
}, function (json) {
|
|
||||||
json = $.parseJSON(json);
|
|
||||||
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
form.render();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
var list = function () {
|
|
||||||
var selectedId = '00000000-0000-0000-0000-000000000000'; //选中的ID
|
|
||||||
var url = '/ModuleElementManager/LoadWithAccess?firstId=' + $("#firstId").val() + "&key=" + $("#moduleType").val() + "&tId=";
|
|
||||||
return {
|
|
||||||
reload: function (id) {
|
|
||||||
if (id != undefined) selectedId = id;
|
|
||||||
$.getJSON(url + selectedId,
|
|
||||||
function (data) {
|
|
||||||
var str = '';
|
|
||||||
if (data.length > 0) {
|
|
||||||
$.each(data,
|
|
||||||
function () {
|
|
||||||
str += "<input type=\"checkbox\" name=\"\" value=\""+this.Id+"\" title=\"" + this.Name + "\"";
|
|
||||||
if (this.Checked) {
|
|
||||||
str += " checked ";
|
|
||||||
}
|
|
||||||
str += ">\r\n";
|
|
||||||
});
|
|
||||||
}
|
|
||||||
$("#moduleElements").html(str);
|
|
||||||
renderLayui();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}();
|
|
||||||
//左边导航
|
|
||||||
var ztree = function() {
|
|
||||||
var url;
|
|
||||||
var type = $("#moduleType");
|
|
||||||
if (type.val() == "UserElement") {
|
|
||||||
url = '/ModuleManager/LoadForUser';
|
|
||||||
} else {
|
|
||||||
url = '/ModuleManager/LoadForRole';
|
|
||||||
}
|
|
||||||
|
|
||||||
var setting = {
|
|
||||||
view: { selectedMulti: false },
|
|
||||||
data: {
|
|
||||||
key: {
|
|
||||||
name: 'Name',
|
|
||||||
title: 'Name'
|
|
||||||
},
|
|
||||||
simpleData: {
|
|
||||||
enable: true,
|
|
||||||
idKey: 'Id',
|
|
||||||
pIdKey: 'ParentId',
|
|
||||||
rootPId: 'null'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
callback: {
|
|
||||||
onClick: function(event, treeId, treeNode) {
|
|
||||||
list.reload(treeNode.Id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
var load = function() {
|
|
||||||
$.getJSON(url,
|
|
||||||
{ firstId: $("#firstId").val() },
|
|
||||||
function(json) {
|
|
||||||
var zTreeObj = $.fn.zTree.init($("#orgtree"), setting, json);
|
|
||||||
list.reload();
|
|
||||||
zTreeObj.expandAll(true);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
load();
|
|
||||||
|
|
||||||
return {
|
|
||||||
reload: load
|
|
||||||
}
|
|
||||||
}();
|
|
||||||
|
|
||||||
@@ -1,109 +0,0 @@
|
|||||||
// ***********************************************************************
|
|
||||||
// Assembly : OpenAuth.Mvc
|
|
||||||
// Author : yubaolee
|
|
||||||
// Created : 04-16-2016
|
|
||||||
//
|
|
||||||
// Last Modified By : yubaolee
|
|
||||||
// Last Modified On : 04-16-2016
|
|
||||||
// ***********************************************************************
|
|
||||||
// <copyright file="userRes.js" company="www.cnblogs.com/yubaolee">
|
|
||||||
// 版权所有(C) 2015
|
|
||||||
// </copyright>
|
|
||||||
// <summary>分配资源模块处理</summary>
|
|
||||||
// ***********************************************************************
|
|
||||||
|
|
||||||
function renderLayui() {
|
|
||||||
layui.use(['layer', 'form'], function () {
|
|
||||||
var form = layui.form();
|
|
||||||
|
|
||||||
form.on('checkbox', function (data) {
|
|
||||||
if (data.elem.checked) {
|
|
||||||
$.post('/RelevanceManager/Assign', {
|
|
||||||
type: $("#moduleType").val(),
|
|
||||||
firstId: $('#firstId').val(),
|
|
||||||
secIds: data.value
|
|
||||||
}, function (json) {
|
|
||||||
json = $.parseJSON(json);
|
|
||||||
|
|
||||||
});
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$.post('/RelevanceManager/UnAssign', {
|
|
||||||
type: $("#moduleType").val(),
|
|
||||||
firstId: $('#firstId').val(),
|
|
||||||
secIds: data.value
|
|
||||||
}, function (json) {
|
|
||||||
json = $.parseJSON(json);
|
|
||||||
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
form.render();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
var list = function () {
|
|
||||||
var selectedId = '00000000-0000-0000-0000-000000000000'; //选中的ID
|
|
||||||
var url = '/ResourceManager/LoadWithAccess?firstId=' + $("#firstId").val() + "&key=" + $("#moduleType").val() + "&cId=";
|
|
||||||
return {
|
|
||||||
reload: function (id) {
|
|
||||||
if (id != undefined) selectedId = id;
|
|
||||||
$.getJSON(url + selectedId,
|
|
||||||
function (data) {
|
|
||||||
var str = '';
|
|
||||||
if (data.length > 0) {
|
|
||||||
$.each(data,
|
|
||||||
function () {
|
|
||||||
str += "<input type=\"checkbox\" name=\"\" value=\"" + this.Id + "\" title=\"" + this.Name + "\"";
|
|
||||||
if (this.Checked) {
|
|
||||||
str += " checked ";
|
|
||||||
}
|
|
||||||
str += ">\r\n";
|
|
||||||
});
|
|
||||||
}
|
|
||||||
$("#resources").html(str);
|
|
||||||
renderLayui();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}();
|
|
||||||
//左边导航
|
|
||||||
var ztree = function () {
|
|
||||||
var url = "/CategoryManager/LoadForTree";
|
|
||||||
|
|
||||||
var setting = {
|
|
||||||
view: { selectedMulti: false },
|
|
||||||
data: {
|
|
||||||
key: {
|
|
||||||
name: 'Name',
|
|
||||||
title: 'Name'
|
|
||||||
},
|
|
||||||
simpleData: {
|
|
||||||
enable: true,
|
|
||||||
idKey: 'Id',
|
|
||||||
pIdKey: 'ParentId',
|
|
||||||
rootPId: 'null'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
callback: {
|
|
||||||
onClick: function (event, treeId, treeNode) {
|
|
||||||
list.reload(treeNode.Id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
var load = function () {
|
|
||||||
$.getJSON(url,
|
|
||||||
function (json) {
|
|
||||||
var zTreeObj = $.fn.zTree.init($("#orgtree"), setting, json);
|
|
||||||
list.reload();
|
|
||||||
zTreeObj.expandAll(true);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
load();
|
|
||||||
|
|
||||||
return {
|
|
||||||
reload: load
|
|
||||||
}
|
|
||||||
}();
|
|
||||||
|
|
||||||
@@ -1,200 +0,0 @@
|
|||||||
// ***********************************************************************
|
|
||||||
// Assembly : OpenAuth.Mvc
|
|
||||||
// Author : yubaolee
|
|
||||||
// Created : 04-13-2016
|
|
||||||
//
|
|
||||||
// Last Modified By : yubaolee
|
|
||||||
// Last Modified On : 04-14-2016
|
|
||||||
// Contact me : www.cnblogs.com/yubaolee
|
|
||||||
// ***********************************************************************
|
|
||||||
// File: categoryManager.js
|
|
||||||
// <summary>分类管理</summary>
|
|
||||||
// ***********************************************************************
|
|
||||||
|
|
||||||
$(function () {
|
|
||||||
$("#ParentName").on("click", function () {
|
|
||||||
parent.reload();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
//左边导航
|
|
||||||
var ztree = function () {
|
|
||||||
var url = '/CategoryManager/LoadForTree';
|
|
||||||
var setting = {
|
|
||||||
view: { selectedMulti: false },
|
|
||||||
data: {
|
|
||||||
key: {
|
|
||||||
name: 'Name',
|
|
||||||
title: 'Name'
|
|
||||||
},
|
|
||||||
simpleData: {
|
|
||||||
enable: true,
|
|
||||||
idKey: 'Id',
|
|
||||||
pIdKey: 'ParentId',
|
|
||||||
rootPId: 'null'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
callback: {
|
|
||||||
onClick: function (event, treeId, treeNode) {
|
|
||||||
list.reload(treeNode.Id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
var load = function () {
|
|
||||||
$.getJSON(url, function (json) {
|
|
||||||
var zTreeObj = $.fn.zTree.init($("#orgtree"), setting, json);
|
|
||||||
list.reload();
|
|
||||||
zTreeObj.expandAll(true);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
load();
|
|
||||||
|
|
||||||
return {
|
|
||||||
reload: load
|
|
||||||
}
|
|
||||||
}();
|
|
||||||
|
|
||||||
//grid列表模块
|
|
||||||
function MainGrid() {
|
|
||||||
var url = '/CategoryManager/Load?parentId=';
|
|
||||||
var selectedId = '00000000-0000-0000-0000-000000000000'; //ztree选中的模块
|
|
||||||
this.maingrid = $('#maingrid')
|
|
||||||
.jqGrid({
|
|
||||||
colModel: [
|
|
||||||
{
|
|
||||||
name: 'Id',
|
|
||||||
index: 'Id',
|
|
||||||
hidden: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
index: 'CascadeId',
|
|
||||||
name: 'CascadeId',
|
|
||||||
label: '节点语义ID'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
index: 'Name',
|
|
||||||
name: 'Name',
|
|
||||||
label: '分类名称'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
index: 'ParentName',
|
|
||||||
name: 'ParentName',
|
|
||||||
label: '上级分类'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
index: 'ParentId',
|
|
||||||
name: 'ParentId',
|
|
||||||
hidden: true
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
index: 'SortNo',
|
|
||||||
name: 'SortNo',
|
|
||||||
label: '排序号'
|
|
||||||
|
|
||||||
}
|
|
||||||
],
|
|
||||||
url: url + selectedId,
|
|
||||||
datatype: "json",
|
|
||||||
|
|
||||||
viewrecords: true,
|
|
||||||
rowNum: 18,
|
|
||||||
pager: "#grid-pager",
|
|
||||||
altRows: true,
|
|
||||||
height: 'auto',
|
|
||||||
multiselect: true,
|
|
||||||
multiboxonly: true,
|
|
||||||
|
|
||||||
loadComplete: function () {
|
|
||||||
var table = this;
|
|
||||||
setTimeout(function () {
|
|
||||||
updatePagerIcons(table);
|
|
||||||
},
|
|
||||||
0);
|
|
||||||
}
|
|
||||||
}).jqGrid('navGrid', "#grid-pager", {
|
|
||||||
edit: false, add: false, del: false, refresh: false, search: false
|
|
||||||
});
|
|
||||||
|
|
||||||
this.reload = function (id) {
|
|
||||||
if (id != undefined) selectedId = id;
|
|
||||||
this.maingrid.jqGrid("setGridParam", { url: url + selectedId })
|
|
||||||
.trigger("reloadGrid", [{ page: 1 }]); //重载JQGrid
|
|
||||||
|
|
||||||
};
|
|
||||||
};
|
|
||||||
MainGrid.prototype = new Grid();
|
|
||||||
var list = new MainGrid();
|
|
||||||
var vm = new Vue({
|
|
||||||
el: '#editDlg'
|
|
||||||
});
|
|
||||||
|
|
||||||
//上级机构选择框
|
|
||||||
var parent = new ParentTree("/CategoryManager/LoadForTree","ParentName","ParentId");
|
|
||||||
|
|
||||||
//添加(编辑)对话框
|
|
||||||
var editDlg = function () {
|
|
||||||
var update = false;
|
|
||||||
var show = function () {
|
|
||||||
layer.open({
|
|
||||||
type: 1,
|
|
||||||
skin: 'layui-layer-rim', //加上边框
|
|
||||||
title: "分类管理", //不显示标题
|
|
||||||
area: ['400px', '300px'], //宽高
|
|
||||||
content: $('#editDlg'), //捕获的元素
|
|
||||||
btn: ['保存', '关闭'],
|
|
||||||
yes: function (index, layero) {
|
|
||||||
$.post("/CategoryManager/Add", vm.$data, function (data) {
|
|
||||||
layer.msg(data.Message);
|
|
||||||
if (data.Status) {
|
|
||||||
list.reload();
|
|
||||||
ztree.reload();
|
|
||||||
}
|
|
||||||
}, "json");
|
|
||||||
},
|
|
||||||
cancel: function (index) {
|
|
||||||
layer.close(index);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return {
|
|
||||||
add: function () { //弹出添加
|
|
||||||
update = false;
|
|
||||||
show();
|
|
||||||
vm.$set('$data', {
|
|
||||||
Id: '00000000-0000-0000-0000-000000000000',
|
|
||||||
SortNo: 0
|
|
||||||
});
|
|
||||||
},
|
|
||||||
update: function (ret) { //弹出编辑框
|
|
||||||
update = true;
|
|
||||||
show();
|
|
||||||
vm.$set('$data', ret);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}();
|
|
||||||
|
|
||||||
//删除
|
|
||||||
function del() {
|
|
||||||
list.del("Id", "/CategoryManager/Delete", function () {
|
|
||||||
list.reload();
|
|
||||||
ztree.reload();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
//自定义的编辑按钮
|
|
||||||
function edit() {
|
|
||||||
var selected = list.getSelectedObj();
|
|
||||||
if (selected == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
editDlg.update(selected);
|
|
||||||
}
|
|
||||||
|
|
||||||
function add() {
|
|
||||||
editDlg.add();
|
|
||||||
}
|
|
||||||
|
|
||||||
function refresh() {
|
|
||||||
list.reload();
|
|
||||||
}
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
$(function() {
|
|
||||||
$.getclientdata();
|
|
||||||
});
|
|
||||||
|
|
||||||
var clientuserData = [];
|
|
||||||
$.getclientdata = function () {
|
|
||||||
$.ajax({
|
|
||||||
url: "/UserManager/GetAccessedUsers",
|
|
||||||
type: "get",
|
|
||||||
dataType: "json",
|
|
||||||
async: false,
|
|
||||||
success: function (data) {
|
|
||||||
clientuserData = data;
|
|
||||||
},
|
|
||||||
error: function (XMLHttpRequest, textStatus, errorThrown) {
|
|
||||||
console.log("加载可访问的用户列表失败!");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
@@ -1,142 +0,0 @@
|
|||||||
//grid列表模块
|
|
||||||
function MainGrid() {
|
|
||||||
var url = '/FlowDesign/Load';
|
|
||||||
this.maingrid = $('#maingrid')
|
|
||||||
.jqGrid({
|
|
||||||
colModel: [
|
|
||||||
{ label: '主键', name: 'Id', hidden: true },
|
|
||||||
{ label: '流程编号', name: 'SchemeCode', index: 'SchemeCode', width: 100, align: 'left' },
|
|
||||||
{ label: '流程名称', name: 'SchemeName', index: 'SchemeName', width: 150, align: 'left' },
|
|
||||||
|
|
||||||
{ label: '模板版本', name: 'SchemeVersion', index: 'SchemeVersion', width: 180, align: 'left' },
|
|
||||||
{ label: '状态Id', name: 'EnabledMark', index: 'EnabledMark', hidden: true },
|
|
||||||
{
|
|
||||||
label: "状态", name: "EnabledMarklabel", index: "EnabledMarklabel", width: 50, align: "center",
|
|
||||||
formatter: function (cellvalue, options, rowObject) {
|
|
||||||
if (rowObject.enabledmark == 1) {
|
|
||||||
return '<span class=\"label label-success\">启用</span>';
|
|
||||||
} else if (rowObject.enabledmark == 0) {
|
|
||||||
return '<span class=\"label label-danger\">停用</span>';
|
|
||||||
} else {
|
|
||||||
return '<span class=\"label label-info\">草稿</span>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
{ label: "最近编辑用户", name: "ModifyUserName", index: "ModifyUserName", width: 90, align: "left" },
|
|
||||||
{label: "最近编辑时间", name: "ModifyDate", index: "ModifyDate", width: 150, align: "left"},
|
|
||||||
|
|
||||||
{ label: "备注", name: "Description", index: "Description", width: 200, align: "left" }
|
|
||||||
|
|
||||||
],
|
|
||||||
url: url,
|
|
||||||
datatype: "json",
|
|
||||||
|
|
||||||
viewrecords: true,
|
|
||||||
rowNum: 18,
|
|
||||||
pager: "#grid-pager",
|
|
||||||
altRows: true,
|
|
||||||
height: 'auto',
|
|
||||||
multiselect: true,
|
|
||||||
multiboxonly: true,
|
|
||||||
|
|
||||||
loadComplete: function () {
|
|
||||||
var table = this;
|
|
||||||
setTimeout(function () {
|
|
||||||
updatePagerIcons(table);
|
|
||||||
},
|
|
||||||
0);
|
|
||||||
}
|
|
||||||
}).jqGrid('navGrid', "#grid-pager", {
|
|
||||||
edit: false, add: false, del: false, refresh: false, search: false
|
|
||||||
});
|
|
||||||
|
|
||||||
this.reload = function (id) {
|
|
||||||
this.maingrid.jqGrid("setGridParam", { url: url })
|
|
||||||
.trigger("reloadGrid", [{ page: 1 }]); //重载JQGrid
|
|
||||||
|
|
||||||
};
|
|
||||||
};
|
|
||||||
MainGrid.prototype = new Grid();
|
|
||||||
var list = new MainGrid();
|
|
||||||
|
|
||||||
//删除
|
|
||||||
function del() {
|
|
||||||
list.del("Id", "/FlowManage/FlowDesign/RemoveForm", function () {
|
|
||||||
list.reload();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
//自定义的编辑按钮
|
|
||||||
function edit() {
|
|
||||||
var selected = list.getSelectedObj();
|
|
||||||
if (selected == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
layer.open({
|
|
||||||
type: 2,
|
|
||||||
title:selected.Code,
|
|
||||||
skin: 'layui-layer-rim', //加上边框
|
|
||||||
area: ['1200px', '700px'], //宽高
|
|
||||||
maxmin: true, //开启最大化最小化按钮
|
|
||||||
content: '/FlowManage/FlowDesign/FlowSchemeBuider?keyValue=' + selected.Id,
|
|
||||||
end: function () {
|
|
||||||
list.reload();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
//创建流程模版
|
|
||||||
function add() {
|
|
||||||
layer.open({
|
|
||||||
type: 2,
|
|
||||||
skin: 'layui-layer-rim', //加上边框
|
|
||||||
area: ['1200px', '700px'], //宽高
|
|
||||||
maxmin: true, //开启最大化最小化按钮
|
|
||||||
content: '/FlowManage/FlowDesign/FlowSchemeBuider',
|
|
||||||
end: function() {
|
|
||||||
list.reload();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
//预览
|
|
||||||
function preview() {
|
|
||||||
var selected = list.getSelectedObj();
|
|
||||||
if (selected == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
layer.open({
|
|
||||||
type: 2,
|
|
||||||
skin: 'layui-layer-rim', //加上边框
|
|
||||||
area: ['1200px', '700px'], //宽高
|
|
||||||
maxmin: true, //开启最大化最小化按钮
|
|
||||||
content: '/FlowManage/FlowDesign/PreviewIndex?keyValue=' + selected.Id + "&schemeVersion=" + selected.SchemeVersion,
|
|
||||||
end: function () {
|
|
||||||
list.reload();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//创建新实例
|
|
||||||
function addInstance() {
|
|
||||||
var selected = list.getSelectedObj();
|
|
||||||
if (selected == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
layer.open({
|
|
||||||
type: 2,
|
|
||||||
skin: 'layui-layer-rim', //加上边框
|
|
||||||
area: ['1200px', '700px'], //宽高
|
|
||||||
maxmin: true, //开启最大化最小化按钮
|
|
||||||
content: '/FlowManage/FlowInstances/FlowProcessNewForm?keyValue=' + selected.Id,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,203 +0,0 @@
|
|||||||
//左边分类导航树
|
|
||||||
var ztree = function () {
|
|
||||||
var nodes = [
|
|
||||||
{
|
|
||||||
name: "流程处理",
|
|
||||||
children: [
|
|
||||||
{ name: "我的申请", value: "me" },
|
|
||||||
{ name: "待办事项", value: "inbox" },
|
|
||||||
{ name: "已办事项", value: "outbox" }
|
|
||||||
],
|
|
||||||
value: "me"
|
|
||||||
}
|
|
||||||
];
|
|
||||||
var setting = {
|
|
||||||
view: { selectedMulti: false },
|
|
||||||
callback: {
|
|
||||||
onClick: function (event, treeId, treeNode) {
|
|
||||||
list.reload(treeNode.value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
var zTreeObj = $.fn.zTree.init($("#orgtree"), setting, nodes);
|
|
||||||
zTreeObj.expandAll(true);
|
|
||||||
}();
|
|
||||||
|
|
||||||
var selectScheme = function (val) {
|
|
||||||
$("#WorkflowName").empty();
|
|
||||||
$.getJSON("/workflowschemas/Load",
|
|
||||||
function (data) {
|
|
||||||
$.each(data.rows,
|
|
||||||
function (i, n) {
|
|
||||||
$("#WorkflowName").append("<option value='" + this.Code + "' v-bind:value='" + this.Code + "'>" + this.Code + "</option>");
|
|
||||||
});
|
|
||||||
|
|
||||||
if (val != undefined) {
|
|
||||||
$("#WorkflowName").val(val);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
//grid列表模块
|
|
||||||
function MainGrid() {
|
|
||||||
var url = "/FlowInstances/Load?type=";
|
|
||||||
var selectedId = "me"; //ztree选中的模块
|
|
||||||
this.maingrid = $("#maingrid")
|
|
||||||
.jqGrid({
|
|
||||||
colModel: [
|
|
||||||
{
|
|
||||||
name: "Id",
|
|
||||||
index: "Id",
|
|
||||||
hidden: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "ProcessSchemeId",
|
|
||||||
index: "ProcessSchemeId",
|
|
||||||
hidden: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "ActivityId",
|
|
||||||
index: "ActivityId",
|
|
||||||
hidden: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "CreateUserId",
|
|
||||||
index: "CreateUserId",
|
|
||||||
hidden: true
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
index: "Code",
|
|
||||||
name: "Code",
|
|
||||||
label: "流程编号"
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
index: "CustomName",
|
|
||||||
name: "CustomName",
|
|
||||||
label: "申请标题"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "CreateUserName",
|
|
||||||
index: "CreateUserName",
|
|
||||||
label: "申请人"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
index: "ActivityName",
|
|
||||||
name: "ActivityName",
|
|
||||||
label: "当前节点"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
index: "CreateDate",
|
|
||||||
name: "CreateDate",
|
|
||||||
label: "创建时间"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
url: url + selectedId,
|
|
||||||
datatype: "json",
|
|
||||||
|
|
||||||
viewrecords: true,
|
|
||||||
rowNum: 18,
|
|
||||||
pager: "#grid-pager",
|
|
||||||
altRows: true,
|
|
||||||
height: "auto",
|
|
||||||
multiselect: true,
|
|
||||||
multiboxonly: true,
|
|
||||||
|
|
||||||
loadComplete: function () {
|
|
||||||
var table = this;
|
|
||||||
setTimeout(function () {
|
|
||||||
updatePagerIcons(table);
|
|
||||||
},
|
|
||||||
0);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.jqGrid("navGrid",
|
|
||||||
"#grid-pager",
|
|
||||||
{
|
|
||||||
edit: false,
|
|
||||||
add: false,
|
|
||||||
del: false,
|
|
||||||
refresh: false,
|
|
||||||
search: false
|
|
||||||
});
|
|
||||||
|
|
||||||
this.reload = function (id) {
|
|
||||||
if (id != undefined) selectedId = id;
|
|
||||||
this.maingrid.jqGrid("setGridParam", { url: url + selectedId })
|
|
||||||
.trigger("reloadGrid", [{ page: 1 }]); //重载JQGrid
|
|
||||||
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
MainGrid.prototype = new Grid();
|
|
||||||
var list = new MainGrid();
|
|
||||||
|
|
||||||
|
|
||||||
//删除
|
|
||||||
function del() {
|
|
||||||
list.del("Id",
|
|
||||||
"/FlowInstances/Delete",
|
|
||||||
function () {
|
|
||||||
list.reload();
|
|
||||||
ztree.reload();
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//进度详情
|
|
||||||
function detail() {
|
|
||||||
var selected = list.getSelectedObj();
|
|
||||||
if (selected == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
layer.open({
|
|
||||||
type: 2,
|
|
||||||
title: selected.Name,
|
|
||||||
skin: "layui-layer-rim", //加上边框
|
|
||||||
area: ["800px", "600px"], //宽高
|
|
||||||
content: "/FlowManage/FlowInstances/ProcessLookForm?processSchemeId=" + selected.ProcessSchemeId + "&activityId=" + selected.ActivityId,
|
|
||||||
maxmin: true, //开启最大化最小化按钮
|
|
||||||
end: function () {
|
|
||||||
list.reload();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
//审核
|
|
||||||
function verificationForm() {
|
|
||||||
var selected = list.getSelectedObj();
|
|
||||||
if (selected == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
layer.open({
|
|
||||||
type: 2,
|
|
||||||
title: selected.Name,
|
|
||||||
skin: "layui-layer-rim", //加上边框
|
|
||||||
area: ["1200px", "700px"], //宽高
|
|
||||||
content: "/FlowManage/FlowInstances/VerificationForm?processSchemeId="
|
|
||||||
+ selected.ProcessSchemeId + "&activityId="
|
|
||||||
+ selected.ActivityId + "&processInstanceId="
|
|
||||||
+ selected.Id + "&createuserid="
|
|
||||||
+ selected.CreateUserId + "&createusername=" + selected.CreateUserName + "&description="
|
|
||||||
+ selected.Description,
|
|
||||||
maxmin: true, //开启最大化最小化按钮
|
|
||||||
end: function () {
|
|
||||||
list.reload();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function add() {
|
|
||||||
layer.msg('请在流程设计列表中发起流程!');
|
|
||||||
}
|
|
||||||
|
|
||||||
function refresh() {
|
|
||||||
list.reload();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,122 +0,0 @@
|
|||||||
//grid列表模块
|
|
||||||
function MainGrid() {
|
|
||||||
var url = '/FormDesign/Load';
|
|
||||||
this.maingrid = $('#maingrid')
|
|
||||||
.jqGrid({
|
|
||||||
colModel: [
|
|
||||||
{ label: '主键', name: 'Id', hidden: true },
|
|
||||||
{ label: '表单编号', name: 'FrmCode', index: 'FrmCode', width: 100, align: 'left' },
|
|
||||||
{ label: '表单名称', name: 'FrmName', index: 'FrmName', width: 150, align: 'left' },
|
|
||||||
|
|
||||||
{ label: '状态', name: 'EnabledMark', index: 'EnabledMark', hidden: true },
|
|
||||||
{
|
|
||||||
label: "状态", name: "EnabledMarklabel", index: "EnabledMarklabel", width: 50, align: "center",
|
|
||||||
formatter: function (cellvalue, options, rowObject) {
|
|
||||||
if (rowObject.enabledmark == 0) {
|
|
||||||
return '<span class=\"label label-danger\">停用</span>';
|
|
||||||
} else {
|
|
||||||
return '<span class=\"label label-success\">启用</span>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
{ label: "最近编辑用户", name: "ModifyUserName", index: "ModifyUserName", width: 90, align: "left" },
|
|
||||||
{label: "最近编辑时间", name: "ModifyDate", index: "ModifyDate", width: 150, align: "left"},
|
|
||||||
|
|
||||||
{ label: "备注", name: "Description", index: "Description", width: 200, align: "left" }
|
|
||||||
|
|
||||||
],
|
|
||||||
url: url,
|
|
||||||
datatype: "json",
|
|
||||||
|
|
||||||
viewrecords: true,
|
|
||||||
rowNum: 18,
|
|
||||||
pager: "#grid-pager",
|
|
||||||
altRows: true,
|
|
||||||
height: 'auto',
|
|
||||||
multiselect: true,
|
|
||||||
multiboxonly: true,
|
|
||||||
|
|
||||||
loadComplete: function () {
|
|
||||||
var table = this;
|
|
||||||
setTimeout(function () {
|
|
||||||
updatePagerIcons(table);
|
|
||||||
},
|
|
||||||
0);
|
|
||||||
}
|
|
||||||
}).jqGrid('navGrid', "#grid-pager", {
|
|
||||||
edit: false, add: false, del: false, refresh: false, search: false
|
|
||||||
});
|
|
||||||
|
|
||||||
this.reload = function (id) {
|
|
||||||
this.maingrid.jqGrid("setGridParam", { url: url })
|
|
||||||
.trigger("reloadGrid", [{ page: 1 }]); //重载JQGrid
|
|
||||||
|
|
||||||
};
|
|
||||||
};
|
|
||||||
MainGrid.prototype = new Grid();
|
|
||||||
var list = new MainGrid();
|
|
||||||
|
|
||||||
//删除
|
|
||||||
function del() {
|
|
||||||
list.del("Id", "/FlowManage/FormDesign/RemoveForm", function () {
|
|
||||||
list.reload();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
//自定义的编辑按钮
|
|
||||||
function edit() {
|
|
||||||
var selected = list.getSelectedObj();
|
|
||||||
if (selected == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
layer.open({
|
|
||||||
type: 2,
|
|
||||||
title:selected.Code,
|
|
||||||
skin: 'layui-layer-rim', //加上边框
|
|
||||||
area: ['1000px', '700px'], //宽高
|
|
||||||
maxmin: true, //开启最大化最小化按钮
|
|
||||||
content: '/FlowManage/FormDesign/FrmBuider?keyValue=' + selected.Id,
|
|
||||||
end: function () {
|
|
||||||
list.reload();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
//创建表单模版
|
|
||||||
function add() {
|
|
||||||
layer.open({
|
|
||||||
type: 2,
|
|
||||||
skin: 'layui-layer-rim', //加上边框
|
|
||||||
area: ['1000px', '700px'], //宽高
|
|
||||||
maxmin: true, //开启最大化最小化按钮
|
|
||||||
content: '/FlowManage/FormDesign/FrmBuider',
|
|
||||||
end: function() {
|
|
||||||
list.reload();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
//预览
|
|
||||||
function preview() {
|
|
||||||
var selected = list.getSelectedObj();
|
|
||||||
if (selected == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
layer.open({
|
|
||||||
type: 2,
|
|
||||||
title:'表单预览',
|
|
||||||
skin: 'layui-layer-rim', //加上边框
|
|
||||||
area: ['1000px', '700px'], //宽高
|
|
||||||
maxmin: true, //开启最大化最小化按钮
|
|
||||||
content: '/FlowManage/FormDesign/FormPreview?keyValue=' + selected.Id + "&FrmVersion=" + selected.FrmVersion,
|
|
||||||
end: function () {
|
|
||||||
list.reload();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
layui.use(["form"],
|
|
||||||
function() {
|
|
||||||
var form = layui.form(), layer = layui.layer;
|
|
||||||
|
|
||||||
//监听提交
|
|
||||||
form.on("submit(*)",
|
|
||||||
function(data) {
|
|
||||||
$.post(
|
|
||||||
"/login/index",
|
|
||||||
data.field,
|
|
||||||
function(data) {
|
|
||||||
var result = JSON.parse(data);
|
|
||||||
if (result.Status) {
|
|
||||||
location.href = result.Result;
|
|
||||||
} else {
|
|
||||||
layer.msg(result.Message);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
});
|
|
||||||
@@ -1,186 +0,0 @@
|
|||||||
// ***********************************************************************
|
|
||||||
// Assembly : OpenAuth.Mvc
|
|
||||||
// Author : yubaolee
|
|
||||||
// Created : 04-07-2016
|
|
||||||
//
|
|
||||||
// Last Modified By : yubaolee
|
|
||||||
// Last Modified On : 04-07-2016
|
|
||||||
// ***********************************************************************
|
|
||||||
// <copyright file="moduleElementMan.js" company="www.cnblogs.com/yubaolee">
|
|
||||||
// 模块按钮管理
|
|
||||||
// </copyright>
|
|
||||||
// <summary></summary>
|
|
||||||
// ***********************************************************************
|
|
||||||
|
|
||||||
var moduleId = $("#selectedModuleId").val(); //外部传递的moduleId
|
|
||||||
|
|
||||||
$(function () {
|
|
||||||
$('#btnAddElement').on('click', function () { //添加菜单
|
|
||||||
add();
|
|
||||||
});
|
|
||||||
|
|
||||||
$('#btnEditElement').on('click', function () { //编辑菜单
|
|
||||||
edit();
|
|
||||||
});
|
|
||||||
|
|
||||||
$('#btnDelElement').on('click', function () { //删除菜单
|
|
||||||
del();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
//grid列表模块
|
|
||||||
function MainGrid() {
|
|
||||||
var url = '/ModuleElementManager/Get?moduleId=';
|
|
||||||
this.maingrid = $('#maingrid')
|
|
||||||
.jqGrid({
|
|
||||||
colModel: [
|
|
||||||
{
|
|
||||||
name: 'Id',
|
|
||||||
index: 'Id',
|
|
||||||
hidden: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
index: 'Name',
|
|
||||||
name: 'Name',
|
|
||||||
label: '名称'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
index: 'DomId',
|
|
||||||
name: 'DomId',
|
|
||||||
label: 'DOM ID'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
index: 'Icon',
|
|
||||||
name: 'Icon',
|
|
||||||
label:'图标'
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
index: 'Remark',
|
|
||||||
name: 'Remark',
|
|
||||||
label: '描述'
|
|
||||||
|
|
||||||
},
|
|
||||||
{
|
|
||||||
index: 'Class',
|
|
||||||
name: 'Class',
|
|
||||||
label: '样式'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
index: 'Script',
|
|
||||||
name: 'Script',
|
|
||||||
label: '脚本'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
index: 'Sort',
|
|
||||||
name: 'Sort',
|
|
||||||
label: '排序'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
index: 'ModuleId',
|
|
||||||
name: 'ModuleId',
|
|
||||||
hidden:true
|
|
||||||
}
|
|
||||||
],
|
|
||||||
url: url + moduleId,
|
|
||||||
datatype: "json",
|
|
||||||
|
|
||||||
viewrecords: true,
|
|
||||||
rowNum: 18,
|
|
||||||
pager: "#grid-pager",
|
|
||||||
altRows: true,
|
|
||||||
height: 'auto',
|
|
||||||
multiselect: true,
|
|
||||||
multiboxonly: true,
|
|
||||||
|
|
||||||
loadComplete: function () {
|
|
||||||
var table = this;
|
|
||||||
setTimeout(function () {
|
|
||||||
updatePagerIcons(table);
|
|
||||||
},
|
|
||||||
0);
|
|
||||||
}
|
|
||||||
}).jqGrid('navGrid', "#grid-pager", {
|
|
||||||
edit: false, add: false, del: false, refresh: false, search: false
|
|
||||||
});
|
|
||||||
|
|
||||||
this.reload = function () {
|
|
||||||
this.maingrid.jqGrid("setGridParam", { url: url + moduleId })
|
|
||||||
.trigger("reloadGrid", [{ page: 1 }]); //重载JQGrid
|
|
||||||
|
|
||||||
};
|
|
||||||
};
|
|
||||||
MainGrid.prototype = new Grid();
|
|
||||||
var list = new MainGrid();
|
|
||||||
var vm = new Vue({
|
|
||||||
el: '#editDlg'
|
|
||||||
});
|
|
||||||
|
|
||||||
//添加(编辑)对话框
|
|
||||||
var editDlg = function () {
|
|
||||||
var update = false;
|
|
||||||
var show = function () {
|
|
||||||
layer.open({
|
|
||||||
type: 1,
|
|
||||||
skin: 'layui-layer-rim', //加上边框
|
|
||||||
title: "用户管理", //不显示标题
|
|
||||||
area: ['400px', '300px'], //宽高
|
|
||||||
content: $('#editDlg'), //捕获的元素
|
|
||||||
btn: ['保存', '关闭'],
|
|
||||||
yes: function (index, layero) {
|
|
||||||
$.post("/ModuleElementManager/AddOrEditButton", vm.$data, function (data) {
|
|
||||||
layer.msg(data.Message);
|
|
||||||
if (data.Status) {
|
|
||||||
list.reload();
|
|
||||||
}
|
|
||||||
}, "json");
|
|
||||||
},
|
|
||||||
cancel: function (index) {
|
|
||||||
layer.close(index);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return {
|
|
||||||
add: function () { //弹出添加
|
|
||||||
update = false;
|
|
||||||
show();
|
|
||||||
vm.$set('$data', {
|
|
||||||
Id: '00000000-0000-0000-0000-000000000000',
|
|
||||||
Sort: 1,
|
|
||||||
ModuleId:moduleId
|
|
||||||
});
|
|
||||||
},
|
|
||||||
update: function (ret) { //弹出编辑框
|
|
||||||
update = true;
|
|
||||||
show();
|
|
||||||
vm.$set('$data', ret);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}();
|
|
||||||
|
|
||||||
//删除
|
|
||||||
function del() {
|
|
||||||
list.del("Id", "/ModuleElementManager/Del", function () {
|
|
||||||
list.reload();
|
|
||||||
});
|
|
||||||
|
|
||||||
var selected = list.getSelectedProperties("Id");
|
|
||||||
if (selected == null) return;
|
|
||||||
}
|
|
||||||
|
|
||||||
//自定义的编辑按钮
|
|
||||||
function edit() {
|
|
||||||
var selected = list.getSelectedObj();
|
|
||||||
if (selected == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
editDlg.update(selected);
|
|
||||||
}
|
|
||||||
|
|
||||||
function add() {
|
|
||||||
editDlg.add();
|
|
||||||
}
|
|
||||||
|
|
||||||
function refresh() {
|
|
||||||
list.reload();
|
|
||||||
}
|
|
||||||
@@ -1,52 +0,0 @@
|
|||||||
|
|
||||||
var wfdesigner = undefined;
|
|
||||||
|
|
||||||
function wfdesignerRedraw() {
|
|
||||||
var data;
|
|
||||||
|
|
||||||
if (wfdesigner != undefined) {
|
|
||||||
data = wfdesigner.data;
|
|
||||||
wfdesigner.destroy();
|
|
||||||
}
|
|
||||||
var processid = $("#processId").val();
|
|
||||||
var schemecode = $("#schemeCode").val();
|
|
||||||
|
|
||||||
wfdesigner = new WorkflowDesigner({
|
|
||||||
name: 'simpledesigner',
|
|
||||||
apiurl: '/Designer/API',
|
|
||||||
renderTo: 'wfdesigner',
|
|
||||||
imagefolder: '/images/',
|
|
||||||
graphwidth: 850,
|
|
||||||
graphheight: 450
|
|
||||||
});
|
|
||||||
|
|
||||||
if (data == undefined) {
|
|
||||||
var p = { schemecode: schemecode, processid: processid, readonly: true };
|
|
||||||
if (wfdesigner.exists(p))
|
|
||||||
wfdesigner.load(p);
|
|
||||||
else
|
|
||||||
wfdesigner.create();
|
|
||||||
} else {
|
|
||||||
wfdesigner.data = data;
|
|
||||||
wfdesigner.render();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
wfdesignerRedraw();
|
|
||||||
|
|
||||||
$(function () {
|
|
||||||
$(".workflowcmd")
|
|
||||||
.on("click", function () { //执行命令
|
|
||||||
$.post("/FlowInstances/ExeCmd?id=" +$("#processId").val() +"&cmd=" +$(this).val() ,
|
|
||||||
function (data) {
|
|
||||||
if (data.Status) {
|
|
||||||
location.reload();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
alert(data.Message);
|
|
||||||
}
|
|
||||||
},'json');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,44 +0,0 @@
|
|||||||
// ***********************************************************************
|
|
||||||
// Assembly : OpenAuth.Mvc
|
|
||||||
// Author : yubaolee
|
|
||||||
// Created : 09-04-2016
|
|
||||||
//
|
|
||||||
// Last Modified By : yubaolee
|
|
||||||
// Last Modified On : 09-04-2016
|
|
||||||
// ***********************************************************************
|
|
||||||
// <copyright file="queryString.js" company="www.cnblogs.com/yubaolee">
|
|
||||||
// 版权所有(C) 2015
|
|
||||||
// </copyright>
|
|
||||||
// <summary>解析URL中的参数</summary>
|
|
||||||
// ***********************************************************************
|
|
||||||
|
|
||||||
var QueryString = function () {
|
|
||||||
// This function is anonymous, is executed immediately and
|
|
||||||
// the return value is assigned to QueryString!
|
|
||||||
var query_string = {};
|
|
||||||
var query = window.location.search.substring(1);
|
|
||||||
var vars = query.split("&");
|
|
||||||
for (var i = 0; i < vars.length; i++) {
|
|
||||||
var pair = vars[i].split("=");
|
|
||||||
// If first entry with this name
|
|
||||||
if (typeof query_string[pair[0]] === "undefined") {
|
|
||||||
query_string[pair[0]] = pair[1];
|
|
||||||
// If second entry with this name
|
|
||||||
} else if (typeof query_string[pair[0]] === "string") {
|
|
||||||
var arr = [query_string[pair[0]], pair[1]];
|
|
||||||
query_string[pair[0]] = arr;
|
|
||||||
// If third or later entry with this name
|
|
||||||
} else {
|
|
||||||
query_string[pair[0]].push(pair[1]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return query_string;
|
|
||||||
}();
|
|
||||||
|
|
||||||
(function ($) {
|
|
||||||
$.getUrlParam = function (name) {
|
|
||||||
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
|
|
||||||
var r = window.location.search.substr(1).match(reg);
|
|
||||||
if (r != null) return unescape(r[2]); return null;
|
|
||||||
}
|
|
||||||
})(jQuery);
|
|
||||||
@@ -1,189 +0,0 @@
|
|||||||
$(function () {
|
|
||||||
$("#CategoryName").on("click", function () {
|
|
||||||
parent.reload();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
//左边导航
|
|
||||||
var ztree = function () {
|
|
||||||
var url = '/CategoryManager/LoadForTree';
|
|
||||||
var setting = {
|
|
||||||
view: { selectedMulti: false },
|
|
||||||
data: {
|
|
||||||
key: {
|
|
||||||
name: 'Name',
|
|
||||||
title: 'Name'
|
|
||||||
},
|
|
||||||
simpleData: {
|
|
||||||
enable: true,
|
|
||||||
idKey: 'Id',
|
|
||||||
pIdKey: 'ParentId',
|
|
||||||
rootPId: 'null'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
callback: {
|
|
||||||
onClick: function (event, treeId, treeNode) {
|
|
||||||
list.reload(treeNode.Id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
var load = function () {
|
|
||||||
$.getJSON(url, function (json) {
|
|
||||||
var zTreeObj = $.fn.zTree.init($("#orgtree"), setting, json);
|
|
||||||
list.reload();
|
|
||||||
zTreeObj.expandAll(true);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
load();
|
|
||||||
|
|
||||||
return {
|
|
||||||
reload: load
|
|
||||||
}
|
|
||||||
}();
|
|
||||||
|
|
||||||
//grid列表模块
|
|
||||||
function MainGrid() {
|
|
||||||
var url = '/ResourceManager/Load?categoryId=';
|
|
||||||
var selectedId = '00000000-0000-0000-0000-000000000000'; //ztree选中的模块
|
|
||||||
this.maingrid = $('#maingrid')
|
|
||||||
.jqGrid({
|
|
||||||
colModel: [
|
|
||||||
{
|
|
||||||
name: 'Id',
|
|
||||||
index: 'Id',
|
|
||||||
hidden: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
index: 'Key',
|
|
||||||
name: 'Key',
|
|
||||||
label: '资源标识'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
index: 'Name',
|
|
||||||
name: 'Name',
|
|
||||||
label: '分类名称'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
index: 'CategoryName',
|
|
||||||
name: 'CategoryName',
|
|
||||||
label: '所属分类'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
index: 'CategoryId',
|
|
||||||
name: 'CategoryId',
|
|
||||||
hidden: true
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
index: 'SortNo',
|
|
||||||
name: 'SortNo',
|
|
||||||
label: '排序号'
|
|
||||||
|
|
||||||
}
|
|
||||||
],
|
|
||||||
url: url + selectedId,
|
|
||||||
datatype: "json",
|
|
||||||
|
|
||||||
viewrecords: true,
|
|
||||||
rowNum: 18,
|
|
||||||
pager: "#grid-pager",
|
|
||||||
altRows: true,
|
|
||||||
height: 'auto',
|
|
||||||
multiselect: true,
|
|
||||||
multiboxonly: true,
|
|
||||||
|
|
||||||
loadComplete: function () {
|
|
||||||
var table = this;
|
|
||||||
setTimeout(function () {
|
|
||||||
updatePagerIcons(table);
|
|
||||||
},
|
|
||||||
0);
|
|
||||||
}
|
|
||||||
}).jqGrid('navGrid', "#grid-pager", {
|
|
||||||
edit: false, add: false, del: false, refresh: false, search: false
|
|
||||||
});
|
|
||||||
|
|
||||||
this.reload = function (id) {
|
|
||||||
if (id != undefined) selectedId = id;
|
|
||||||
this.maingrid.jqGrid("setGridParam", { url: url + selectedId })
|
|
||||||
.trigger("reloadGrid", [{ page: 1 }]); //重载JQGrid
|
|
||||||
|
|
||||||
};
|
|
||||||
};
|
|
||||||
MainGrid.prototype = new Grid();
|
|
||||||
var list = new MainGrid();
|
|
||||||
var vm = new Vue({
|
|
||||||
el: '#editDlg'
|
|
||||||
});
|
|
||||||
|
|
||||||
//上级机构选择框
|
|
||||||
var parent = new ParentTree("/CategoryManager/LoadForTree", "CategoryName", "CategoryId");
|
|
||||||
|
|
||||||
//添加(编辑)对话框
|
|
||||||
var editDlg = function () {
|
|
||||||
var update = false;
|
|
||||||
var show = function () {
|
|
||||||
layer.open({
|
|
||||||
type: 1,
|
|
||||||
skin: 'layui-layer-rim', //加上边框
|
|
||||||
title: "用户管理", //不显示标题
|
|
||||||
area: ['400px', '300px'], //宽高
|
|
||||||
content: $('#editDlg'), //捕获的元素
|
|
||||||
btn: ['保存', '关闭'],
|
|
||||||
yes: function (index, layero) {
|
|
||||||
$.post("/ResourceManager/Add", vm.$data, function (data) {
|
|
||||||
layer.msg(data.Message);
|
|
||||||
if (data.Status) {
|
|
||||||
list.reload();
|
|
||||||
ztree.reload();
|
|
||||||
}
|
|
||||||
}, "json");
|
|
||||||
},
|
|
||||||
cancel: function (index) {
|
|
||||||
layer.close(index);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return {
|
|
||||||
add: function () { //弹出添加
|
|
||||||
update = false;
|
|
||||||
show();
|
|
||||||
vm.$set('$data', {
|
|
||||||
Id: '00000000-0000-0000-0000-000000000000',
|
|
||||||
SortNo: 0
|
|
||||||
});
|
|
||||||
},
|
|
||||||
update: function (ret) { //弹出编辑框
|
|
||||||
update = true;
|
|
||||||
show();
|
|
||||||
vm.$set('$data', ret);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}();
|
|
||||||
|
|
||||||
//删除
|
|
||||||
function del() {
|
|
||||||
list.del("Id", "/ResourceManager/Delete", function () {
|
|
||||||
list.reload();
|
|
||||||
ztree.reload();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
//自定义的编辑按钮
|
|
||||||
function edit() {
|
|
||||||
var selected = list.getSelectedObj();
|
|
||||||
if (selected == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
editDlg.update(selected);
|
|
||||||
}
|
|
||||||
|
|
||||||
function add() {
|
|
||||||
editDlg.add();
|
|
||||||
}
|
|
||||||
|
|
||||||
function refresh() {
|
|
||||||
list.reload();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,221 +0,0 @@
|
|||||||
$(function () {
|
|
||||||
$("#Organizations").on("click", function () {
|
|
||||||
parent.reload();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
//左边导航
|
|
||||||
var ztree = function () {
|
|
||||||
var url = '/UserSession/GetOrgs';
|
|
||||||
var setting = {
|
|
||||||
view: { selectedMulti: false },
|
|
||||||
data: {
|
|
||||||
key: {
|
|
||||||
name: 'Name',
|
|
||||||
title: 'Name'
|
|
||||||
},
|
|
||||||
simpleData: {
|
|
||||||
enable: true,
|
|
||||||
idKey: 'Id',
|
|
||||||
pIdKey: 'ParentId',
|
|
||||||
rootPId: 'null'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
callback: {
|
|
||||||
onClick: function (event, treeId, treeNode) {
|
|
||||||
list.reload(treeNode.Id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
var load = function () {
|
|
||||||
$.getJSON(url, function (json) {
|
|
||||||
var zTreeObj = $.fn.zTree.init($("#orgtree"), setting, json);
|
|
||||||
list.reload();
|
|
||||||
zTreeObj.expandAll(true);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
load();
|
|
||||||
|
|
||||||
return {
|
|
||||||
reload: load
|
|
||||||
}
|
|
||||||
}();
|
|
||||||
|
|
||||||
//grid列表模块
|
|
||||||
function MainGrid() {
|
|
||||||
var url = '/RoleManager/Load?orgId=';
|
|
||||||
var selectedId = '00000000-0000-0000-0000-000000000000'; //ztree选中的模块
|
|
||||||
this.maingrid = $('#maingrid')
|
|
||||||
.jqGrid({
|
|
||||||
colModel: [
|
|
||||||
{
|
|
||||||
name: 'Id',
|
|
||||||
index: 'Id',
|
|
||||||
hidden: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
index: 'Name',
|
|
||||||
name: 'Name',
|
|
||||||
label: '姓名'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
index: 'OrganizationIds',
|
|
||||||
name: 'OrganizationIds',
|
|
||||||
hidden: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
index: 'Organizations',
|
|
||||||
name: 'Organizations',
|
|
||||||
label: '所属机构'
|
|
||||||
|
|
||||||
}
|
|
||||||
],
|
|
||||||
url: url + selectedId,
|
|
||||||
datatype: "json",
|
|
||||||
|
|
||||||
viewrecords: true,
|
|
||||||
rowNum: 18,
|
|
||||||
pager: "#grid-pager",
|
|
||||||
altRows: true,
|
|
||||||
height: 'auto',
|
|
||||||
multiselect: true,
|
|
||||||
multiboxonly: true,
|
|
||||||
|
|
||||||
loadComplete: function () {
|
|
||||||
var table = this;
|
|
||||||
setTimeout(function () {
|
|
||||||
updatePagerIcons(table);
|
|
||||||
},
|
|
||||||
0);
|
|
||||||
}
|
|
||||||
}).jqGrid('navGrid', "#grid-pager", {
|
|
||||||
edit: false, add: false, del: false, refresh: false, search: false
|
|
||||||
});
|
|
||||||
|
|
||||||
this.reload = function (id) {
|
|
||||||
if (id != undefined) selectedId = id;
|
|
||||||
this.maingrid.jqGrid("setGridParam", { url: url + selectedId })
|
|
||||||
.trigger("reloadGrid", [{ page: 1 }]); //重载JQGrid
|
|
||||||
|
|
||||||
};
|
|
||||||
};
|
|
||||||
MainGrid.prototype = new Grid();
|
|
||||||
var list = new MainGrid();
|
|
||||||
var vm = new Vue({
|
|
||||||
el: '#editDlg'
|
|
||||||
});
|
|
||||||
|
|
||||||
//上级机构选择框
|
|
||||||
var parent = new ParentTreeMultiple("/UserSession/GetOrgs", "Organizations", "OrganizationIds");
|
|
||||||
|
|
||||||
//添加(编辑)对话框
|
|
||||||
var editDlg = function () {
|
|
||||||
var update = false;
|
|
||||||
var show = function () {
|
|
||||||
layer.open({
|
|
||||||
type: 1,
|
|
||||||
skin: 'layui-layer-rim', //加上边框
|
|
||||||
title: "角色管理", //不显示标题
|
|
||||||
area: ['400px', '300px'], //宽高
|
|
||||||
content: $('#editDlg'), //捕获的元素
|
|
||||||
btn: ['保存', '关闭'],
|
|
||||||
yes: function (index, layero) {
|
|
||||||
$.post("/RoleManager/Add", vm.$data, function (data) {
|
|
||||||
layer.msg(data.Message);
|
|
||||||
if (data.Status) {
|
|
||||||
list.reload();
|
|
||||||
ztree.reload();
|
|
||||||
}
|
|
||||||
}, "json");
|
|
||||||
},
|
|
||||||
cancel: function (index) {
|
|
||||||
layer.close(index);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return {
|
|
||||||
add: function () { //弹出添加
|
|
||||||
update = false;
|
|
||||||
show();
|
|
||||||
vm.$set('$data',
|
|
||||||
{
|
|
||||||
Id: '00000000-0000-0000-0000-000000000000',
|
|
||||||
Sex: 0
|
|
||||||
});
|
|
||||||
},
|
|
||||||
update: function (ret) { //弹出编辑框
|
|
||||||
update = true;
|
|
||||||
show();
|
|
||||||
vm.$set('$data', ret);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//删除
|
|
||||||
function del() {
|
|
||||||
list.del("Id", "/RoleManager/Delete",function() {
|
|
||||||
list.reload();
|
|
||||||
ztree.reload();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
//自定义的编辑按钮
|
|
||||||
function edit() {
|
|
||||||
var selected = list.getSelectedObj();
|
|
||||||
if (selected == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
editDlg.update(selected);
|
|
||||||
}
|
|
||||||
|
|
||||||
function add() {
|
|
||||||
editDlg.add();
|
|
||||||
}
|
|
||||||
|
|
||||||
function refresh() {
|
|
||||||
list.reload();
|
|
||||||
}
|
|
||||||
|
|
||||||
//为角色分配模块
|
|
||||||
function assignRoleModule(obj) {
|
|
||||||
|
|
||||||
var selected = list.getSelectedObj();
|
|
||||||
if (selected == null) return;
|
|
||||||
|
|
||||||
layer.open({
|
|
||||||
type: 2,
|
|
||||||
skin: 'layui-layer-rim', //加上边框
|
|
||||||
area: ['410px', '390px'], //宽高
|
|
||||||
content: '/ModuleManager/Assign?key=RoleModule&firstId=' + selected.Id
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
//为角色分配资源
|
|
||||||
function openRoleReourceAccess(obj) {
|
|
||||||
var selected = list.getSelectedObj();
|
|
||||||
if (selected == null) return;
|
|
||||||
|
|
||||||
layer.open({
|
|
||||||
type: 2,
|
|
||||||
skin: 'layui-layer-rim', //加上边框
|
|
||||||
area: ['600px', '300px'], //宽高
|
|
||||||
content: '/ResourceManager/AssignRes?key=RoleResource&firstId=' + selected.Id
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
//为角色分配菜单
|
|
||||||
function assignRoleElement(obj) {
|
|
||||||
var selected = list.getSelectedObj();
|
|
||||||
if (selected == null) return;
|
|
||||||
|
|
||||||
layer.open({
|
|
||||||
type: 2,
|
|
||||||
skin: 'layui-layer-rim', //加上边框
|
|
||||||
area: ['600px', '300px'], //宽高
|
|
||||||
content: '/ModuleElementManager/AssignModuleElement?key=RoleElement&firstId=' + selected.Id
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,189 +0,0 @@
|
|||||||
$(function () {
|
|
||||||
$("#ParentName").on("click", function () {
|
|
||||||
parent.reload();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
//左边导航
|
|
||||||
var ztree = function () {
|
|
||||||
var url = '/UserSession/GetOrgs';
|
|
||||||
var setting = {
|
|
||||||
view: { selectedMulti: false },
|
|
||||||
data: {
|
|
||||||
key: {
|
|
||||||
name: 'Name',
|
|
||||||
title: 'Name'
|
|
||||||
},
|
|
||||||
simpleData: {
|
|
||||||
enable: true,
|
|
||||||
idKey: 'Id',
|
|
||||||
pIdKey: 'ParentId',
|
|
||||||
rootPId: 'null'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
callback: {
|
|
||||||
onClick: function (event, treeId, treeNode) {
|
|
||||||
list.reload(treeNode.Id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
var load = function () {
|
|
||||||
$.getJSON(url, function (json) {
|
|
||||||
var zTreeObj = $.fn.zTree.init($("#orgtree"), setting, json);
|
|
||||||
list.reload();
|
|
||||||
zTreeObj.expandAll(true);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
load();
|
|
||||||
|
|
||||||
return {
|
|
||||||
reload: load
|
|
||||||
}
|
|
||||||
}();
|
|
||||||
|
|
||||||
//grid列表模块
|
|
||||||
function MainGrid() {
|
|
||||||
var url = '/StockManager/Load?parentId=';
|
|
||||||
var selectedId = '00000000-0000-0000-0000-000000000000'; //ztree选中的模块
|
|
||||||
this.maingrid = $('#maingrid')
|
|
||||||
.jqGrid({
|
|
||||||
colModel: [
|
|
||||||
{
|
|
||||||
name: 'Id',
|
|
||||||
index: 'Id',
|
|
||||||
hidden: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
index: 'Name',
|
|
||||||
name: 'Name',
|
|
||||||
label: '产品名称'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
index: 'Viewable',
|
|
||||||
name: 'Viewable',
|
|
||||||
label: '可见范围'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
index: 'OrgId',
|
|
||||||
name: 'OrgId',
|
|
||||||
hidden: true
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
index: 'Number',
|
|
||||||
name: 'Number',
|
|
||||||
label: '数量'
|
|
||||||
|
|
||||||
},
|
|
||||||
{
|
|
||||||
index: 'ParentName',
|
|
||||||
name: 'ParentName',
|
|
||||||
label: '所属机构'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
url: url + selectedId,
|
|
||||||
datatype: "json",
|
|
||||||
|
|
||||||
viewrecords: true,
|
|
||||||
rowNum: 18,
|
|
||||||
pager: "#grid-pager",
|
|
||||||
altRows: true,
|
|
||||||
height: 'auto',
|
|
||||||
multiselect: true,
|
|
||||||
multiboxonly: true,
|
|
||||||
|
|
||||||
loadComplete: function () {
|
|
||||||
var table = this;
|
|
||||||
setTimeout(function () {
|
|
||||||
updatePagerIcons(table);
|
|
||||||
},
|
|
||||||
0);
|
|
||||||
}
|
|
||||||
}).jqGrid('navGrid', "#grid-pager", {
|
|
||||||
edit: false, add: false, del: false, refresh: false, search: false
|
|
||||||
});
|
|
||||||
|
|
||||||
this.reload = function (id) {
|
|
||||||
if (id != undefined) selectedId = id;
|
|
||||||
this.maingrid.jqGrid("setGridParam", { url: url + selectedId })
|
|
||||||
.trigger("reloadGrid", [{ page: 1 }]); //重载JQGrid
|
|
||||||
|
|
||||||
};
|
|
||||||
};
|
|
||||||
MainGrid.prototype = new Grid();
|
|
||||||
var list = new MainGrid();
|
|
||||||
var vm = new Vue({
|
|
||||||
el: '#editDlg'
|
|
||||||
});
|
|
||||||
|
|
||||||
//上级机构选择框
|
|
||||||
var parent = new ParentTree("/UserSession/GetOrgs", "ParentName", "OrgId");
|
|
||||||
|
|
||||||
//添加(编辑)对话框
|
|
||||||
var editDlg = function () {
|
|
||||||
var update = false;
|
|
||||||
var show = function () {
|
|
||||||
layer.open({
|
|
||||||
type: 1,
|
|
||||||
skin: 'layui-layer-rim', //加上边框
|
|
||||||
title: "进出库管理", //不显示标题
|
|
||||||
area: ['400px', '300px'], //宽高
|
|
||||||
content: $('#editDlg'), //捕获的元素
|
|
||||||
btn: ['保存', '关闭'],
|
|
||||||
yes: function (index, layero) {
|
|
||||||
$.post("/StockManager/Add", vm.$data, function (data) {
|
|
||||||
layer.msg(data.Message);
|
|
||||||
if (data.Status) {
|
|
||||||
list.reload();
|
|
||||||
ztree.reload();
|
|
||||||
}
|
|
||||||
}, "json");
|
|
||||||
},
|
|
||||||
cancel: function (index) {
|
|
||||||
layer.close(index);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return {
|
|
||||||
add: function () { //弹出添加
|
|
||||||
update = false;
|
|
||||||
show();
|
|
||||||
vm.$set('$data', {
|
|
||||||
Id: '00000000-0000-0000-0000-000000000000',
|
|
||||||
Number: 1
|
|
||||||
});
|
|
||||||
},
|
|
||||||
update: function (ret) { //弹出编辑框
|
|
||||||
update = true;
|
|
||||||
show();
|
|
||||||
vm.$set('$data', ret);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}();
|
|
||||||
|
|
||||||
//删除
|
|
||||||
function del() {
|
|
||||||
list.del("Id", "/StockManager/Delete", function () {
|
|
||||||
list.reload();
|
|
||||||
ztree.reload();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
//自定义的编辑按钮
|
|
||||||
function edit() {
|
|
||||||
var selected = list.getSelectedObj();
|
|
||||||
if (selected == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
editDlg.update(selected);
|
|
||||||
}
|
|
||||||
|
|
||||||
function add() {
|
|
||||||
editDlg.add();
|
|
||||||
}
|
|
||||||
|
|
||||||
function refresh() {
|
|
||||||
list.reload();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,109 +0,0 @@
|
|||||||
// ***********************************************************************
|
|
||||||
// Assembly : OpenAuth.Mvc
|
|
||||||
// Author : yubaolee
|
|
||||||
// Created : 04-13-2016
|
|
||||||
//
|
|
||||||
// Last Modified By : yubaolee
|
|
||||||
// Last Modified On : 04-13-2016
|
|
||||||
// ***********************************************************************
|
|
||||||
// <copyright file="userRoleManager.js" company="www.cnblogs.com/yubaolee">
|
|
||||||
// 版权所有(C) 2015
|
|
||||||
// </copyright>
|
|
||||||
// <summary>用户分配角色模块</summary>
|
|
||||||
// ***********************************************************************
|
|
||||||
function renderLayui() {
|
|
||||||
layui.use(['layer', 'form'], function () {
|
|
||||||
var form = layui.form();
|
|
||||||
|
|
||||||
form.on('checkbox', function (data) {
|
|
||||||
if (data.elem.checked) {
|
|
||||||
$.post('/RelevanceManager/Assign', {
|
|
||||||
type: $("#moduleType").val(),
|
|
||||||
firstId: $('#firstId').val(),
|
|
||||||
secIds: data.value
|
|
||||||
}, function (json) {
|
|
||||||
json = $.parseJSON(json);
|
|
||||||
|
|
||||||
});
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$.post('/RelevanceManager/UnAssign', {
|
|
||||||
type: $("#moduleType").val(),
|
|
||||||
firstId: $('#firstId').val(),
|
|
||||||
secIds: data.value
|
|
||||||
}, function (json) {
|
|
||||||
json = $.parseJSON(json);
|
|
||||||
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
form.render();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
var list = function () {
|
|
||||||
var selectedId = '00000000-0000-0000-0000-000000000000'; //选中的ID
|
|
||||||
var url = '/RoleManager/LoadForOrgAndUser?userId=' + $("#firstId").val()
|
|
||||||
+ "&key=" + $("#moduleType").val() + "&orgId=";
|
|
||||||
return {
|
|
||||||
reload: function (id) {
|
|
||||||
if (id != undefined) selectedId = id;
|
|
||||||
$.getJSON(url + selectedId,
|
|
||||||
function (data) {
|
|
||||||
var str = '';
|
|
||||||
if (data.length > 0) {
|
|
||||||
$.each(data,
|
|
||||||
function () {
|
|
||||||
str += "<input type=\"checkbox\" name=\"\" value=\"" + this.Id + "\" title=\"" + this.Name + "\"";
|
|
||||||
if (this.Checked) {
|
|
||||||
str += " checked ";
|
|
||||||
}
|
|
||||||
str += ">\r\n";
|
|
||||||
});
|
|
||||||
}
|
|
||||||
$("#roles").html(str);
|
|
||||||
renderLayui();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}();
|
|
||||||
//左边导航
|
|
||||||
var ztree = function () {
|
|
||||||
var url = "/UserSession/GetOrgs";
|
|
||||||
|
|
||||||
var setting = {
|
|
||||||
view: { selectedMulti: false },
|
|
||||||
data: {
|
|
||||||
key: {
|
|
||||||
name: 'Name',
|
|
||||||
title: 'Name'
|
|
||||||
},
|
|
||||||
simpleData: {
|
|
||||||
enable: true,
|
|
||||||
idKey: 'Id',
|
|
||||||
pIdKey: 'ParentId',
|
|
||||||
rootPId: 'null'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
callback: {
|
|
||||||
onClick: function (event, treeId, treeNode) {
|
|
||||||
list.reload(treeNode.Id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
var load = function () {
|
|
||||||
$.getJSON(url,
|
|
||||||
function (json) {
|
|
||||||
var zTreeObj = $.fn.zTree.init($("#orgtree"), setting, json);
|
|
||||||
list.reload();
|
|
||||||
zTreeObj.expandAll(true);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
load();
|
|
||||||
|
|
||||||
return {
|
|
||||||
reload: load
|
|
||||||
}
|
|
||||||
}();
|
|
||||||
|
|
||||||
@@ -1,243 +0,0 @@
|
|||||||
$(function () {
|
|
||||||
$("#Organizations").on("click", function () {
|
|
||||||
parent.reload();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
//左边导航
|
|
||||||
var ztree = function () {
|
|
||||||
var url = '/UserSession/GetOrgs';
|
|
||||||
var setting = {
|
|
||||||
view: { selectedMulti: false },
|
|
||||||
data: {
|
|
||||||
key: {
|
|
||||||
name: 'Name',
|
|
||||||
title: 'Name'
|
|
||||||
},
|
|
||||||
simpleData: {
|
|
||||||
enable: true,
|
|
||||||
idKey: 'Id',
|
|
||||||
pIdKey: 'ParentId',
|
|
||||||
rootPId: 'null'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
callback: {
|
|
||||||
onClick: function (event, treeId, treeNode) {
|
|
||||||
list.reload(treeNode.Id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
var load = function () {
|
|
||||||
$.getJSON(url, function (json) {
|
|
||||||
var zTreeObj = $.fn.zTree.init($("#orgtree"), setting, json);
|
|
||||||
list.reload();
|
|
||||||
zTreeObj.expandAll(true);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
load();
|
|
||||||
|
|
||||||
return {
|
|
||||||
reload: load
|
|
||||||
}
|
|
||||||
}();
|
|
||||||
|
|
||||||
//grid列表模块
|
|
||||||
function MainGrid() {
|
|
||||||
var url = '/UserManager/Load?orgId=';
|
|
||||||
var selectedId = '00000000-0000-0000-0000-000000000000'; //ztree选中的模块
|
|
||||||
this.maingrid = $('#maingrid')
|
|
||||||
.jqGrid({
|
|
||||||
colModel: [
|
|
||||||
{
|
|
||||||
name: 'Id',
|
|
||||||
index: 'Id',
|
|
||||||
hidden: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
index: 'Name',
|
|
||||||
name: 'Name',
|
|
||||||
label: '姓名'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
index: 'Account',
|
|
||||||
name: 'Account',
|
|
||||||
label: '账号'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
index: 'Sex',
|
|
||||||
name: 'Sex',
|
|
||||||
label: '性别'
|
|
||||||
|
|
||||||
},
|
|
||||||
{
|
|
||||||
index: 'OrganizationIds',
|
|
||||||
name: 'OrganizationIds',
|
|
||||||
hidden:true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
index: 'Organizations',
|
|
||||||
name: 'Organizations',
|
|
||||||
label: '所属机构'
|
|
||||||
|
|
||||||
}
|
|
||||||
],
|
|
||||||
url: url + selectedId,
|
|
||||||
datatype: "json",
|
|
||||||
|
|
||||||
viewrecords: true,
|
|
||||||
rowNum: 18,
|
|
||||||
pager: "#grid-pager",
|
|
||||||
altRows: true,
|
|
||||||
height: 'auto',
|
|
||||||
multiselect: true,
|
|
||||||
multiboxonly: true,
|
|
||||||
|
|
||||||
loadComplete: function () {
|
|
||||||
var table = this;
|
|
||||||
setTimeout(function () {
|
|
||||||
updatePagerIcons(table);
|
|
||||||
},
|
|
||||||
0);
|
|
||||||
}
|
|
||||||
}).jqGrid('navGrid', "#grid-pager", {
|
|
||||||
edit: false, add: false, del: false, refresh: false, search: false
|
|
||||||
});
|
|
||||||
|
|
||||||
this.reload = function (id) {
|
|
||||||
if (id != undefined) selectedId = id;
|
|
||||||
this.maingrid.jqGrid("setGridParam", { url: url + selectedId })
|
|
||||||
.trigger("reloadGrid", [{ page: 1 }]); //重载JQGrid
|
|
||||||
|
|
||||||
};
|
|
||||||
};
|
|
||||||
MainGrid.prototype = new Grid();
|
|
||||||
var list = new MainGrid();
|
|
||||||
var vm = new Vue({
|
|
||||||
el: '#editDlg'
|
|
||||||
});
|
|
||||||
|
|
||||||
//上级机构选择框
|
|
||||||
var parent = new ParentTreeMultiple("/UserSession/GetOrgs","Organizations","OrganizationIds");
|
|
||||||
|
|
||||||
//添加(编辑)对话框
|
|
||||||
var editDlg = function () {
|
|
||||||
var update = false;
|
|
||||||
var show = function () {
|
|
||||||
layer.open({
|
|
||||||
type: 1,
|
|
||||||
skin: 'layui-layer-rim', //加上边框
|
|
||||||
title: "用户管理", //不显示标题
|
|
||||||
area: ['400px', '300px'], //宽高
|
|
||||||
content: $('#editDlg'), //捕获的元素
|
|
||||||
btn: ['保存', '关闭'],
|
|
||||||
yes: function (index, layero) {
|
|
||||||
$.post("/UserManager/Add", vm.$data, function (data) {
|
|
||||||
layer.msg(data.Message);
|
|
||||||
if (data.Status) {
|
|
||||||
list.reload();
|
|
||||||
ztree.reload();
|
|
||||||
}
|
|
||||||
}, "json");
|
|
||||||
},
|
|
||||||
cancel: function (index) {
|
|
||||||
layer.close(index);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return {
|
|
||||||
add: function () { //弹出添加
|
|
||||||
update = false;
|
|
||||||
show();
|
|
||||||
vm.$set('$data',
|
|
||||||
{
|
|
||||||
Id:'00000000-0000-0000-0000-000000000000',
|
|
||||||
Sex:0
|
|
||||||
});
|
|
||||||
},
|
|
||||||
update: function (ret) { //弹出编辑框
|
|
||||||
update = true;
|
|
||||||
show();
|
|
||||||
vm.$set('$data', ret);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//删除
|
|
||||||
function del() {
|
|
||||||
list.del("Id", "/UserManager/Delete", function () {
|
|
||||||
list.reload();
|
|
||||||
ztree.reload();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//自定义的编辑按钮
|
|
||||||
function edit() {
|
|
||||||
var selected = list.getSelectedObj();
|
|
||||||
if (selected == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
editDlg.update(selected);
|
|
||||||
}
|
|
||||||
|
|
||||||
function add() {
|
|
||||||
editDlg.add();
|
|
||||||
}
|
|
||||||
|
|
||||||
function refresh() {
|
|
||||||
list.reload();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//用户模块授权按钮
|
|
||||||
function openUserModuleAccess(obj) {
|
|
||||||
var selected = list.getSelectedObj();
|
|
||||||
if (selected == null) return;
|
|
||||||
layer.open({
|
|
||||||
type: 2,
|
|
||||||
skin: 'layui-layer-rim', //加上边框
|
|
||||||
area: ['410px', '390px'], //宽高
|
|
||||||
content: '/ModuleManager/Assign?key=UserModule&firstId=' + selected.Id
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
//用户角色授权
|
|
||||||
function openUserRoleAccess(obj) {
|
|
||||||
var selected = list.getSelectedObj();
|
|
||||||
if (selected == null) return;
|
|
||||||
|
|
||||||
layer.open({
|
|
||||||
type: 2,
|
|
||||||
skin: 'layui-layer-rim', //加上边框
|
|
||||||
area: ['600px', '300px'], //宽高
|
|
||||||
content: '/RoleManager/LookupMulti?key=UserRole&firstId=' + selected.Id
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
//为用户分配资源
|
|
||||||
function openUserReourceAccess(obj) {
|
|
||||||
var selected = list.getSelectedObj();
|
|
||||||
if (selected == null) return;
|
|
||||||
|
|
||||||
layer.open({
|
|
||||||
type: 2,
|
|
||||||
skin: 'layui-layer-rim', //加上边框
|
|
||||||
area: ['600px', '300px'], //宽高
|
|
||||||
content: '/ResourceManager/AssignRes?key=UserResource&firstId=' + selected.Id
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
//分配菜单
|
|
||||||
function openAssignUserElement(obj) {
|
|
||||||
var selected = list.getSelectedObj();
|
|
||||||
if (selected == null) return;
|
|
||||||
|
|
||||||
layer.open({
|
|
||||||
type: 2,
|
|
||||||
skin: 'layui-layer-rim', //加上边框
|
|
||||||
area: ['600px', '300px'], //宽高
|
|
||||||
content: '/ModuleElementManager/AssignModuleElement?key=UserElement&firstId=' + selected.Id
|
|
||||||
});
|
|
||||||
}
|
|
||||||
@@ -165,26 +165,9 @@
|
|||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Content Include="BllScripts\assignModule.js" />
|
|
||||||
<Content Include="BllScripts\assignModuleElement.js" />
|
|
||||||
<Content Include="BllScripts\categoryManager.js" />
|
|
||||||
<Content Include="BllScripts\formDesign.js" />
|
|
||||||
<Content Include="BllScripts\login.js" />
|
|
||||||
<Content Include="js\categories.js" />
|
<Content Include="js\categories.js" />
|
||||||
<Content Include="js\openauth.js" />
|
<Content Include="js\openauth.js" />
|
||||||
<Content Include="js\droptree.js" />
|
<Content Include="js\droptree.js" />
|
||||||
<Content Include="BllScripts\processDetail.js" />
|
|
||||||
<Content Include="BllScripts\moduleElementMan.js" />
|
|
||||||
<Content Include="BllScripts\queryString.js" />
|
|
||||||
<Content Include="BllScripts\resourceManager.js" />
|
|
||||||
<Content Include="BllScripts\roleManager.js" />
|
|
||||||
<Content Include="BllScripts\flowInstance.js" />
|
|
||||||
<Content Include="BllScripts\flowDesign.js" />
|
|
||||||
<Content Include="BllScripts\stockManager.js" />
|
|
||||||
<Content Include="BllScripts\usermanager.js" />
|
|
||||||
<Content Include="BllScripts\assignRes.js" />
|
|
||||||
<Content Include="BllScripts\userRoleManager.js" />
|
|
||||||
<Content Include="BllScripts\clientData.js" />
|
|
||||||
<Content Include="css\images.css" />
|
<Content Include="css\images.css" />
|
||||||
<Content Include="css\login.css" />
|
<Content Include="css\login.css" />
|
||||||
<Content Include="css\main.css" />
|
<Content Include="css\main.css" />
|
||||||
|
|||||||
@@ -61,8 +61,8 @@
|
|||||||
<div class="layui-form-item">
|
<div class="layui-form-item">
|
||||||
<label class="layui-form-label">所属部门</label>
|
<label class="layui-form-label">所属部门</label>
|
||||||
<div class="layui-input-block">
|
<div class="layui-input-block">
|
||||||
<input id="ParentName" name="ParentName" v-model="ParentName" required lay-verify="required" class="layui-input" />
|
<input id="ParentName" name="ParentName" v-model="ParentName" class="layui-input" />
|
||||||
<input id="ParentId" name="ParentId" v-model="ParentId" required lay-verify="required" type="hidden" />
|
<input id="ParentId" name="ParentId" v-model="ParentId" type="hidden" />
|
||||||
<div id="menuContent" class="menuContent" style="display: none;">
|
<div id="menuContent" class="menuContent" style="display: none;">
|
||||||
<ul id="org" class="ztree"></ul>
|
<ul id="org" class="ztree"></ul>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ layui.define(['jquery', 'layer'], function (exports) {
|
|||||||
layer.confirm('真的删除么', function (index) {
|
layer.confirm('真的删除么', function (index) {
|
||||||
$.post(url, { ids: dataids },
|
$.post(url, { ids: dataids },
|
||||||
function (data) {
|
function (data) {
|
||||||
if (data.Status) {
|
if (data.Code == 200) {
|
||||||
if (callback != undefined) callback();
|
if (callback != undefined) callback();
|
||||||
} else {
|
} else {
|
||||||
layer.msg(data.Message);
|
layer.msg(data.Message);
|
||||||
|
|||||||
@@ -75,9 +75,9 @@ layui.config({
|
|||||||
},
|
},
|
||||||
end: mainList
|
end: mainList
|
||||||
});
|
});
|
||||||
var url = "/OrgManager/AddOrUpdate";
|
var url = "/OrgManager/Add";
|
||||||
if (update) {
|
if (update) {
|
||||||
url = "/OrgManager/AddOrUpdate"; //暂时和添加一个地址
|
url = "/OrgManager/Update"; //暂时和添加一个地址
|
||||||
}
|
}
|
||||||
//提交数据
|
//提交数据
|
||||||
form.on('submit(formSubmit)',
|
form.on('submit(formSubmit)',
|
||||||
@@ -95,7 +95,8 @@ layui.config({
|
|||||||
add: function() { //弹出添加
|
add: function() { //弹出添加
|
||||||
update = false;
|
update = false;
|
||||||
show({
|
show({
|
||||||
Id: ''
|
Id: '',
|
||||||
|
SortNo:1
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
update: function(data) { //弹出编辑框
|
update: function(data) { //弹出编辑框
|
||||||
|
|||||||
Reference in New Issue
Block a user