routine update

This commit is contained in:
yubao 2018-03-13 00:38:14 +08:00
parent d718c77759
commit 8c7364ce0b
37 changed files with 3310 additions and 1442 deletions

View File

@ -179,6 +179,32 @@
<Content Include="images\login\logo.png" />
<Content Include="images\login\right_hand.png" />
<Content Include="images\login\tou.png" />
<Content Include="js\flow-ui\flow.css" />
<Content Include="js\flow-ui\flow.js" />
<Content Include="js\flow-ui\img\1.png" />
<Content Include="js\flow-ui\img\10.png" />
<Content Include="js\flow-ui\img\11.png" />
<Content Include="js\flow-ui\img\2.png" />
<Content Include="js\flow-ui\img\3.png" />
<Content Include="js\flow-ui\img\4.png" />
<Content Include="js\flow-ui\img\5.png" />
<Content Include="js\flow-ui\img\6.png" />
<Content Include="js\flow-ui\img\7.png" />
<Content Include="js\flow-ui\img\9.png" />
<Content Include="js\flow-ui\img\gooflow_bg.png" />
<Content Include="js\flow-ui\img\gooflow_blank.gif" />
<Content Include="js\flow-ui\img\gooflow_blank2.gif" />
<Content Include="js\flow-ui\img\gooflow_blank3.gif" />
<Content Include="js\flow-ui\img\gooflow_btn_bg.png" />
<Content Include="js\flow-ui\img\gooflow_bullet.png" />
<Content Include="js\flow-ui\img\gooflow_icon.png" />
<Content Include="js\flow-ui\img\gooflow_icon2.png" />
<Content Include="js\flow-ui\img\GooFlow_line_oper.png" />
<Content Include="js\flow-ui\img\gooflow_tip.png" />
<Content Include="js\flow-ui\img\ui_close.png" />
<Content Include="js\flow-ui\img\wallbg.png" />
<Content Include="js\utils\flowlayout.js" />
<Content Include="js\utils\ui.js" />
<Content Include="userJs\categories.js" />
<Content Include="userJs\assign.js" />
<Content Include="js\openauth.js" />

View File

@ -1,66 +0,0 @@
@{
ViewBag.Title = "Index";
Page.BodyStyle = "style='overflow:hidden;'";
}
<form method="post">
<div class="toolbar" style="margin-top:0; border-top:none 0;">
<a href="#" onclick="openFlow(); return false;">
<span style="background:url(@Url.Content("~/images/ico/folder_classic.png")) no-repeat left center;">打开</span>
</a>
<a href="#" onclick="addFlow(); return false;">
<span style="background:url(@Url.Content("~/images/ico/folder_classic_add.png")) no-repeat left center;">新建</span>
</a>
<a href="#" onclick="flowAttrSetting(); return false;">
<span style="background:url(@Url.Content("~/images/ico/hammer_screwdriver.png")) no-repeat left center;">属性</span>
</a>
<span class="toolbarsplit">&nbsp;</span>
<a href="#" onclick="addStep(); return false;">
<span style="background:url(@Url.Content("~/images/ico/shape_aling_left.png")) no-repeat left center;">新步骤</span>
</a>
<!--
<a href="#" onclick="addSubFlow(); return false;">
<span style="background:url(@Url.Content("~/images/ico/shape_aling_center.png")) no-repeat left center;">子流程</span>
</a>
-->
<a href="#" onclick="addConn(); return false;">
<span style="background:url(@Url.Content("~/images/ico/vector.png")) no-repeat left center;">连线</span>
</a>
<!--a href="#" onclick="copyStep(); return false;">
<span style="background:url(/images/ico/ui_saccordion.png) no-repeat left center;">复制</span>
</a-->
<a href="#" onclick="removeObj(); return false;" title="删除当前选定对象">
<span style="background:url(@Url.Content("~/images/ico/cross.png")) no-repeat left center;">删除</span>
</a>
<span class="toolbarsplit">&nbsp;</span>
<a href="#" onclick="saveFlow('save'); return false;">
<span style="background:url(@Url.Content("~/images/ico/save.gif")) no-repeat left center;">保存</span>
</a>
<a href="#" onclick="saveAs(); return false;">
<span style="background:url(@Url.Content("~/images/ico/saveas.gif")) no-repeat left center;">另存为</span>
</a>
<span class="toolbarsplit">&nbsp;</span>
<a href="#" onclick="saveFlow('install'); return false;">
<span style="background:url(@Url.Content("~/images/ico/folder_classic_up.png")) no-repeat left center;">安装</span>
</a>
<a href="#" onclick="saveFlow('uninstall'); return false;">
<span style="background:url(@Url.Content("~/images/ico/folder_classic_down.png")) no-repeat left center;">卸载</span>
</a>
<a href="#" onclick="saveFlow('delete'); return false;" title="删除流程">
<span style="background:url(@Url.Content("~/images/ico/folder_classic_stuffed_remove.png")) no-repeat left center;">删除</span>
</a>
</div>
<div id="flowdiv" style="margin:0; padding:0;"></div>
<script src="~/Scripts/FlowDesinger/draw-min.js" type="text/javascript"></script>
<script src="~/Scripts/FlowDesinger/workflow.js" type="text/javascript"></script>
<script type="text/javascript">
var appid = '@Request.QueryString["appid"]';
var iframeid = '@Request.QueryString["tabid"]';
var dialog = top.mainDialog;
</script>
</form>

View File

@ -1,158 +0,0 @@
layui.config({
base: "/js/"
}).use(['form','vue', 'ztree', 'layer', 'jquery','queryString'], function () {
var //layer = (parent == undefined || parent.layer === undefined )? layui.layer : parent.layer,
layer = layui.layer,
$ = layui.jquery;
var id = $.getUrlParam("id"); //待分配的id
var type = $.getUrlParam("type"); //待分配的类型
var menuType = $.getUrlParam("menuType"); //待分配菜单的类型
//菜单列表
var menucon = {}; //table的参数如搜索key点击tree的id
//菜单树状列表等lay table没问题了可以换成table
var menutree = function () {
var url = '/ModuleManager/LoadMenus';
var menuTree;
var setting = {
view: { selectedMulti: true },
check: {
enable: true,
chkStyle: "checkbox",
chkboxType: { "Y": "", "N": "" } //去掉勾选时级联
},
data: {
key: {
name: 'Name',
title: 'Name'
},
simpleData: {
enable: true,
idKey: 'Id',
pIdKey: 'ParentId',
rootPId: 'null'
}
},
callback: {
onClick: function (event, treeId, treeNode) {
//
},
onCheck: function (event, treeId, treeNode) {
var url = "/RelevanceManager/Assign";
if (!treeNode.checked) {
url = "/RelevanceManager/UnAssign";
}
$.post(url, { type: menuType, firstId: id, secIds: [treeNode.Id] }
, function (data) {
layer.msg(data.Message);
}
, "json");
}
}
};
var load = function (options) {
if (options != undefined) {
$.extend(menucon, options);
}
$.getJSON(url, menucon, function (json) {
menuTree = $.fn.zTree.init($("#menutree"), setting);
menuTree.addNodes(null, json.data);
//如果该用户已经分配菜单了,则设置相应的状态
var url = "/ModuleManager/LoadMenusForUser";
if (type.indexOf("Role") != -1) {
url = "/ModuleManager/LoadMenusForRole";
}
$.getJSON(url,
{
firstId: id
, moduleId: options.moduleId
}
, function (data) {
$.each(data,
function (i) {
var that = this;
var node = menuTree.getNodeByParam("Id", that.Id, null);
menuTree.checkNode(node, true, false);
});
});
menuTree.expandAll(true);
});
};
return {
load: load
}
}();
//模块列表
var ztree = function () {
var url = '/UserSession/QueryModuleList';
var zTreeObj;
var setting = {
view: { selectedMulti: true },
check: {
enable: true,
chkStyle: "checkbox",
chkboxType: { "Y": "", "N": "" } //去掉勾选时级联
},
data: {
key: {
name: 'Name',
title: 'Name'
},
simpleData: {
enable: true,
idKey: 'Id',
pIdKey: 'ParentId',
rootPId: 'null'
}
},
callback: {
onClick: function (event, treeId, treeNode) {
menutree.load({ moduleId: treeNode.Id });
},
onCheck: function (event, treeId, treeNode) {
var url = "/RelevanceManager/Assign";
if (!treeNode.checked) {
url = "/RelevanceManager/UnAssign";
}
$.post(url, { type: type, firstId: id, secIds: [treeNode.Id] }
, function (data) {
layer.msg(data.Message);
}
, "json");
}
}
};
var load = function () {
$.getJSON(url, function (json) {
zTreeObj = $.fn.zTree.init($("#tree"), setting);
zTreeObj.addNodes(null, json);
//如果该用户已经分配模块了,则设置相应的状态
var url = "/ModuleManager/LoadForUser";
if (type.indexOf("Role") != -1) {
url = "/ModuleManager/LoadForRole";
}
$.getJSON(url, { firstId: id }
, function (data) {
$.each(data,
function(i) {
var that = this;
var node = zTreeObj.getNodeByParam("Id", that.Id, null);
zTreeObj.checkNode(node, true, false);
});
});
$("#menutree").html("点击左边的模块开始分配菜单");
// menutree.load({ moduleId: json[0].Id });
zTreeObj.expandAll(true);
});
};
load();
return {
reload: load
}
}();
//监听页面主按钮操作 end
})

View File

@ -1,154 +0,0 @@
layui.config({
base: "/js/"
}).use(['form','vue', 'ztree', 'layer', 'jquery', 'table','droptree','openauth'], function () {
var form = layui.form,
//layer = (parent == undefined || parent.layer === undefined )? layui.layer : parent.layer,
layer = layui.layer,
$ = layui.jquery;
var table = layui.table;
var openauth = layui.openauth;
layui.droptree("/Categories/AllTypes", "#TypeName", "#TypeId", false);
//主列表加载,可反复调用进行刷新
var config= {}; //table的参数如搜索key点击tree的id
var mainList = function (options) {
if (options != undefined) {
$.extend(config, options);
}
table.reload('mainList', {
url: '/Categories/All',
where: config
});
}
//左边树状机构列表
var ztree = function () {
var url = '/Categories/AllTypes';
var zTreeObj;
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) {
mainList({ typeId: treeNode.Id });
}
}
};
var load = function () {
$.getJSON(url, function (json) {
zTreeObj = $.fn.zTree.init($("#tree"), setting);
zTreeObj.addNodes(null, json);
mainList({ typeId: "" });
zTreeObj.expandAll(true);
});
};
load();
return {
reload: load
}
}();
//添加(编辑)对话框
var editDlg = function() {
var vm = new Vue({
el: "#formEdit"
});
var update = false; //是否为更新
var show = function (data) {
var title = update ? "编辑信息" : "添加";
layer.open({
title: title,
area: ["500px", "400px"],
type: 1,
content: $('#divEdit'),
success: function() {
vm.$set('$data', data);
},
end: mainList
});
var url = "/Categories/Add";
if (update) {
url = "/Categories/Update"; //暂时和添加一个地址
}
//提交数据
form.on('submit(formSubmit)',
function(data) {
$.post(url,
data.field,
function(data) {
layer.msg(data.Message);
},
"json");
return false;
});
}
return {
add: function() { //弹出添加
update = false;
show({
Id: ''
});
},
update: function(data) { //弹出编辑框
update = true;
show(data);
}
};
}();
//监听表格内部按钮
table.on('tool(list)', function (obj) {
var data = obj.data;
if (obj.event === 'detail') { //查看
layer.msg('ID' + data.Id + ' 的查看操作');
}
});
//监听页面主按钮操作
var active = {
btnDel: function () { //批量删除
var checkStatus = table.checkStatus('mainList')
, data = checkStatus.data;
openauth.del("/Categories/Delete",
data.map(function (e) { return e.Id; }),
mainList);
}
, btnAdd: function () { //添加
editDlg.add();
}
, btnEdit: function () { //编辑
var checkStatus = table.checkStatus('mainList')
, data = checkStatus.data;
if (data.length != 1) {
layer.msg("请选择编辑的行,且同时只能编辑一行");
return;
}
editDlg.update(data[0]);
}
, search: function () { //搜索
mainList({ key: $('#key').val() });
}
, btnRefresh: function() {
mainList();
}
};
$('.toolList .layui-btn').on('click', function () {
var type = $(this).data('type');
active[type] ? active[type].call(this) : '';
});
//监听页面主按钮操作 end
})

View File

@ -0,0 +1,77 @@
v\:group,v\:rect,v\:imagedata,v\:oval,v\:line,v\:polyline,v\:stroke,v\:textbox{display:inline-block;background:transparent}
.GooFlow{margin:0px;background:#F7F7F7;border-right:#ccc 0px solid;font: 12px Arial, Helvetica, sans-serif;-moz-user-select:none;-webkit-user-select:none;float:left;}
.GooFlow_head{clear:both;height:22px;padding:1px;display:none;}
.GooFlow_tool{float:left;margin:0px 1px;overflow:hidden;clear:left;border-radius:3px;margin-top:2px;margin-left:3px;}
.GooFlow_tool_div{overflow:hidden;border-radius:2px;width:54px;}
.GooFlow_tool span{height:0px;overflow:hidden;border-bottom:#ccc 1px solid;border-top:#FFFFFF 1px solid;margin:1px;clear:both;display:block;}
.GooFlow_tool_btn{display:block;border:0px;height:50px;width:50px;cursor:default;margin:1px;margin-top:2px;margin-bottom:2px; outline :none;border:#F7F7F7 1px solid;border-radius:8px}
.GooFlow_tool_btn b{cursor:pointer;}
.GooFlow_tool_btn:hover{border:#8E9DA6 1px solid;opacity: 0.8;}
.GooFlow_tool_btndown{display:block;border:0px;height:50px;width:50px;cursor:default;margin:1px;margin-top:2px;margin-bottom:2px; outline :none;border:#ccc 1px solid;background:#fff;border-radius:8px}
.GooFlow_tool_btndown b{cursor:pointer;}
.GooFlow_work{float:right;margin:0px;border-left:#ccc 1px solid;position:relative;overflow:scroll}
.GooFlow_work .GooFlow_work_inner{background-image:url(img/wallbg.png) ;position:relative;overflow:hidden}
.GooFlow_work .GooFlow_work_group{cursor:default;position:absolute;overflow:hidden;top:0px;left:0px}
.GooFlow_area{position:absolute;}
.GooFlow_area .lock{cursor:default;}
.GooFlow_area .bg{cursor:move;filter:Alpha(Opacity=30);-moz-opacity:0.3;opacity: 0.3;border-radius:10px;}
.GooFlow_work .lock .bg{cursor:default;}
.GooFlow_area label{cursor:text;top:1px;left:1px;position:absolute;display:block;font-size:12px;text-indent:18px;height:18px;line-height:18px}
.GooFlow_work .lock label{cursor:default;}
.GooFlow_area b{display:block;height:18px;width:18px;top:0px;left:0px;position:absolute;cursor:pointer}
.GooFlow_work .area_red .bg{border:1px solid red;background-color:#EB4F2D}
.GooFlow_work .area_red label{color:red;background:url(img/gooflow_bullet.png) no-repeat 1px 1px}
.GooFlow_work .area_yellow .bg{border:1px solid #CD925A;background-color:#F5B93D}
.GooFlow_work .area_yellow label{color:#FFBA1D;background:url(img/gooflow_bullet.png) no-repeat 1px -16px}
.GooFlow_work .area_blue .bg{border:1px solid #347BB1;background-color:#43A4EE}
.GooFlow_work .area_blue label{color:#347BB1;background:url(img/gooflow_bullet.png) no-repeat 1px -33px}
.GooFlow_work .area_green .bg{border:1px solid green;background-color:#7FBA2E}
.GooFlow_work .area_green label{color:green;background:url(img/gooflow_bullet.png) no-repeat 1px -50px}
.GooFlow_work svg{display:block;position:absolute}
.GooFlow_work v\:group{position:relative;display:block}
.GooFlow_work v\:group v\:line{overflow:visible}
.GooFlow_work v\:group v\:polyline{overflow:visible}
.GooFlow_work v\:group div{cursor:text;position:absolute;overflow:visible;display:inline;float:left;white-space: nowrap}
.GooFlow_work .draw{color:#ff3300}
.GooFlow_item{
position:absolute;background:#A1DCEB;border:#A1DCEB solid 1px;
border-radius:3px;background-color:#C1DCFC;box-shadow:1px 1px 2px rgba(99,99,99,2);
}
.GooFlow table{padding:1px;border-radius:2px}
.GooFlow td{ vertical-align:middle;text-align:center;padding:0px;cursor:default;word-wrap:break-word;word-break:break-all}
.GooFlow .ico{width:18px;cursor:move}
.GooFlow i{display:block;width:18px;height:18px;overflow:hidden}
.GooFlow b{display:block;width:48px;height:48px;overflow:hidden;}
.GooFlow .item_startround{background:#5CCB41;width:52px;height:52px;border:#5e8800 solid 1px;overflow:visible}
.GooFlow .item_startround table{border:0px;padding:2px;width:50px;height:50px;}
.GooFlow .item_startround .span{font-weight: bold;color:#fff; display:block;text-align:center;position:absolute;top:18px;left:-14px;width:80px;overflow:visible;text-align:center;padding:0px;cursor:default;word-wrap: break-word;word-break:break-all}
.GooFlow .item_endround{background:#DE2922;width:52px;height:52px;border:#BE0E0E solid 1px;overflow:visible}
.GooFlow .item_endround table{border:0px;padding:2px;width:50px;height:50px;}
.GooFlow .item_endround .span{font-weight: bold;color:#fff; display:block;text-align:center;position:absolute;top:18px;left:-15px;width:80px;overflow:visible;text-align:center;padding:0px;cursor:default;word-wrap: break-word;word-break:break-all}
.GooFlow .gentlenode{background:#DC5E2B;color:#FFFFFF;}
.GooFlow div .rs_right{display:none;overflow:hidden;position:absolute;right:-1px;top:-1px;height:100%;width:6px;cursor:w-resize}
.GooFlow div .rs_bottom{display:none;overflow:hidden;position:absolute;left:-1px;bottom:-1px;width:100%;height:6px;cursor:n-resize}
.GooFlow div .rs_rb{position:absolute;right:-1px;bottom:-1px;width:9px;height:9px;overflow:hidden;cursor:nw-resize;background:url(img/gooflow_tip.png) no-repeat 0px -8px;}
.GooFlow div .rs_close{z-index:10;position:absolute;right:-12px;top:-12px;width:24px;height:24px;overflow:hidden;cursor:pointer;background:url(img/ui_close.png) no-repeat 0px 0px}
.GooFlow .rs_ghost{position:absolute;display:none;overflow:hidden;border:#8EA4C1 1px dashed;background:#F2F2F2;filter:Alpha(Opacity=60);-moz-opacity:0.6;opacity: 0.6;z-index:10;border-radius:10px;}
.GooFlow .item_focus{border:#4A5B79 1px solid;box-shadow:2px 2px 19px #444;opacity:0.9;cursor:pointer;}
.GooFlow .item_mark{border:#ff3300 1px solid}
.GooFlow .item_mark td{cursor:crosshair}
.GooFlow textarea{position:absolute;border:#4A5B79 1px solid;display:none;font-size:12px;overflow-y:visible;width:100px;z-index:10001}
.GooFlow .GooFlow_line_oper{height:15px;background-color:#D8E8FC;border:#ccc 1px solid;position:absolute;z-index:10000;}
.GooFlow .GooFlow_line_move{filter:Alpha(Opacity=50);-moz-opacity:0.5;opacity:0.5;overflow:hidden;position:absolute;z-index:9999;background:url(0) no-repeat}
.GooFlow .GooFlow_line_oper b{display:inline-block;width:15px;height:15px;margin-left:2px;cursor:pointer}
.GooFlow .b_l1{background:url(img/GooFlow_line_oper.png) no-repeat 1px 1px}
.GooFlow .b_l2{background:url(img/GooFlow_line_oper.png) no-repeat 1px -14px}
.GooFlow .b_l3{background:url(img/GooFlow_line_oper.png) no-repeat 1px -29px}
.GooFlow .b_x{background:url(img/GooFlow_line_oper.png) no-repeat 1px -44px;margin-left:10px}
.GooFlow .ico_cursor{background:url(img/10.png) no-repeat 0px 0px}
.GooFlow .ico_direct{background:url(img/9.png) no-repeat 0px 0px}
.GooFlow .ico_startround{background:url(img/2.png) no-repeat 0px 0px}
.GooFlow .ico_endround{background:url(img/7.png) no-repeat 0px 0px}
.GooFlow .ico_stepnode{background:url(img/4.png) no-repeat 0px 0px}
.GooFlow .ico_shuntnode{background:url(img/5.png) no-repeat 0px 0px}
.GooFlow .ico_confluencenode{background:url(img/3.png) no-repeat 0px 0px}
.GooFlow .ico_group{background:url(img/11.png) no-repeat 0px 0px}

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 652 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 249 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 336 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 218 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

@ -1,119 +0,0 @@
layui.config({
base: "/js/"
}).use(['form','vue', 'ztree', 'layer', 'jquery', 'table','droptree','openauth'], function () {
var form = layui.form,
//layer = (parent == undefined || parent.layer === undefined )? layui.layer : parent.layer,
layer = layui.layer,
$ = layui.jquery;
var table = layui.table;
var openauth = layui.openauth;
layui.droptree("/UserSession/GetOrgs", "#Organizations", "#OrganizationIds");
//主列表加载,可反复调用进行刷新
var config= {}; //table的参数如搜索key点击tree的id
var mainList = function (options) {
if (options != undefined) {
$.extend(config, options);
}
table.reload('mainList', {
url: '/Forms/Load',
where: config
});
}
mainList();
//添加(编辑)对话框
var editDlg = function() {
var vm = new Vue({
el: "#formEdit"
});
var update = false; //是否为更新
var show = function (data) {
var title = update ? "编辑信息" : "添加";
layer.open({
title: title,
area: ["500px", "400px"],
type: 1,
content: $('#divEdit'),
success: function() {
vm.$set('$data', data);
},
end: mainList
});
var url = "/Forms/Add";
if (update) {
url = "/Forms/Update";
}
//提交数据
form.on('submit(formSubmit)',
function(data) {
$.post(url,
data.field,
function(data) {
layer.msg(data.Message);
},
"json");
return false;
});
}
return {
add: function() { //弹出添加
update = false;
show({
Id: ''
});
},
update: function(data) { //弹出编辑框
update = true;
show(data);
}
};
}();
//监听表格内部按钮
table.on('tool(list)', function (obj) {
var data = obj.data;
if (obj.event === 'detail') { //查看
layer.msg('ID' + data.Id + ' 的查看操作');
}
});
//监听页面主按钮操作
var active = {
btnDel: function () { //批量删除
var checkStatus = table.checkStatus('mainList')
, data = checkStatus.data;
openauth.del("/Forms/Delete",
data.map(function (e) { return e.Id; }),
mainList);
}
, btnAdd: function () { //添加
editDlg.add();
}
, btnEdit: function () { //编辑
var checkStatus = table.checkStatus('mainList')
, data = checkStatus.data;
if (data.length != 1) {
layer.msg("请选择编辑的行,且同时只能编辑一行");
return;
}
editDlg.update(data[0]);
}
, search: function () { //搜索
mainList({ key: $('#key').val() });
}
, btnRefresh: function() {
mainList();
}
};
$('.toolList .layui-btn').on('click', function () {
var type = $(this).data('type');
active[type] ? active[type].call(this) : '';
});
//监听页面主按钮操作 end
})

View File

@ -1,92 +0,0 @@
layui.config({
base: "/js/"
}).use(['form', 'layer'], function () {
var form = layui.form,
layer = parent.layer === undefined ? layui.layer : parent.layer,
$ = layui.jquery;
// Cloud Float...
var $main = $cloud = mainwidth = null;
var offset1 = 450;
var offset2 = 0;
var offsetbg = 0;
$(document).ready(
function () {
$main = $("#mainBody");
$body = $("body");
$cloud1 = $("#cloud1");
$cloud2 = $("#cloud2");
mainwidth = $main.outerWidth();
}
);
setInterval(function flutter() {
if (offset1 >= mainwidth) {
offset1 = -580;
}
if (offset2 >= mainwidth) {
offset2 = -580;
}
offset1 += 1.1;
offset2 += 1;
$cloud1.css("background-position", offset1 + "px 100px")
$cloud2.css("background-position", offset2 + "px 460px")
}, 70);
setInterval(function bg() {
if (offsetbg >= mainwidth) {
offsetbg = -580;
}
offsetbg += 0.9;
$body.css("background-position", -offsetbg + "px 0")
}, 90);
$(function () {
//得到焦点
$("#password").focus(function () {
$("#left_hand").animate({
left: "150",
top: " -38"
}, {
step: function () {
if (parseInt($("#left_hand").css("left")) > 140) {
$("#left_hand").attr("class", "left_hand");
}
}
}, 2000);
$("#right_hand").animate({
right: "-64",
top: "-38px"
}, {
step: function () {
if (parseInt($("#right_hand").css("right")) > -70) {
$("#right_hand").attr("class", "right_hand");
}
}
}, 2000);
});
//失去焦点
$("#password").blur(function () {
$("#left_hand").attr("class", "initial_left_hand");
$("#left_hand").attr("style", "left:100px;top:-12px;");
$("#right_hand").attr("class", "initial_right_hand");
$("#right_hand").attr("style", "right:-112px;top:-12px");
});
$('.loginbox').css({ 'position': 'absolute', 'left': ($(window).width() - 692) / 2 });
$(window).resize(function () {
$('.loginbox').css({ 'position': 'absolute', 'left': ($(window).width() - 692) / 2 });
})
});
//登录按钮事件
form.on("submit(login)", function (data) {
window.location.href = "/Login/LoginByDev";
return false;
})
})

View File

@ -1,89 +0,0 @@
layui.config({
base : "/js/"
}).use(['form','element','layer','jquery'],function(){
var form = layui.form,
layer = parent.layer === undefined ? layui.layer : parent.layer,
element = layui.element,
$ = layui.jquery;
$(".panel a").on("click",function(){
window.parent.addTab($(this));
})
//动态获取文章总数和待审核文章数量,最新文章
$.get("/json/newsList.json",
function(data){
var waitNews = [];
$(".allNews span").text(data.length); //文章总数
for(var i=0;i<data.length;i++){
var newsStr = data[i];
if(newsStr["newsStatus"] == "待审核"){
waitNews.push(newsStr);
}
}
$(".waitNews span").text(waitNews.length); //待审核文章
}
)
//图片总数
$.get("/json/images.json",
function(data){
$(".imgAll span").text(data.length);
}
)
//用户数
$.getJSON("/UserManager/Load?limit=1&page=1",
function(data){
$(".userAll span").text(data.count);
}
)
//新消息
$.get("/json/message.json",
function(data){
$(".newMessage span").text(data.length);
}
)
//数字格式化
$(".panel span").each(function(){
$(this).html($(this).text()>9999 ? ($(this).text()/10000).toFixed(2) + "<em>万</em>" : $(this).text());
})
//系统基本参数
if(window.sessionStorage.getItem("systemParameter")){
var systemParameter = JSON.parse(window.sessionStorage.getItem("systemParameter"));
fillParameter(systemParameter);
}else{
$.ajax({
url : "/json/systemParameter.json",
type : "get",
dataType : "json",
success : function(data){
fillParameter(data);
}
})
}
//填充数据方法
function fillParameter(data){
//判断字段数据是否存在
function nullData(data){
if(data == '' || data == "undefined"){
return "未定义";
}else{
return data;
}
}
$(".version").text(nullData(data.version)); //当前版本
$(".author").text(nullData(data.author)); //开发作者
$(".homePage").text(nullData(data.homePage)); //网站首页
$(".server").text(nullData(data.server)); //服务器环境
$(".dataBase").text(nullData(data.dataBase)); //数据库版本
$(".maxUpload").text(nullData(data.maxUpload)); //最大上传限制
$(".userRights").text(nullData(data.userRights));//当前用户权限
}
})

View File

@ -1,249 +0,0 @@
layui.config({
base: "/js/"
}).use(['form','vue', 'ztree', 'layer', 'jquery', 'table','droptree','openauth'], function () {
var form = layui.form,
//layer = (parent == undefined || parent.layer === undefined )? layui.layer : parent.layer,
layer = layui.layer,
$ = layui.jquery;
var table = layui.table;
var openauth = layui.openauth;
layui.droptree("/UserSession/QueryModuleList", "#ParentName", "#ParentId", false);
//主列表加载,可反复调用进行刷新
var config= {}; //table的参数如搜索key点击tree的id
var mainList = function (options) {
if (options != undefined) {
$.extend(config, options);
}
table.reload('mainList', {
url: '/UserSession/GetModules',
where: config
});
}
//菜单列表
var menucon = {}; //table的参数如搜索key点击tree的id
var menuList = function (options) {
if (options != undefined) {
$.extend(menucon, options);
}
table.reload('menuList', {
url: '/ModuleManager/LoadMenus',
where: menucon
});
}
//左边树状机构列表
var ztree = function () {
var url = '/UserSession/QueryModuleList';
var zTreeObj;
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) {
mainList({ pId: treeNode.Id });
}
}
};
var load = function () {
$.getJSON(url, function (json) {
zTreeObj = $.fn.zTree.init($("#tree"), setting);
var newNode = { Name: "根节点", Id: null, ParentId: "" };
json.push(newNode);
zTreeObj.addNodes(null, json);
mainList({ pId: "" });
zTreeObj.expandAll(true);
});
};
load();
return {
reload: load
}
}();
//添加(编辑)模块对话框
var editDlg = function() {
var vm = new Vue({
el: "#formEdit"
});
var update = false; //是否为更新
var show = function (data) {
var title = update ? "编辑信息" : "添加";
layer.open({
title: title,
area: ["500px", "400px"],
type: 1,
content: $('#divEdit'),
success: function() {
vm.$set('$data', data);
},
end: mainList
});
var url = "/moduleManager/Add";
if (update) {
url = "/moduleManager/Update";
}
//提交数据
form.on('submit(formSubmit)',
function(data) {
$.post(url,
data.field,
function(data) {
layer.msg(data.Message);
},
"json");
return false;
});
}
return {
add: function() { //弹出添加
update = false;
show({
Id: "",
SortNo:1
});
},
update: function(data) { //弹出编辑框
update = true;
show(data);
}
};
}();
//添加菜单对话框
var meditDlg = function () {
var vm = new Vue({
el: "#mfromEdit"
});
var update = false; //是否为更新
var show = function (data) {
var title = update ? "编辑信息" : "添加";
layer.open({
title: title,
area: ["500px", "400px"],
type: 1,
content: $('#divMenuEdit'),
success: function () {
vm.$set('$data', data);
},
end: menuList
});
var url = "/moduleManager/AddMenu";
if (update) {
url = "/moduleManager/UpdateMenu";
}
//提交数据
form.on('submit(mformSubmit)',
function (data) {
$.post(url,
data.field,
function (data) {
layer.msg(data.Message);
},
"json");
return false;
});
}
return {
add: function (moduleId) { //弹出添加
update = false;
show({
Id: "",
ModuleId:moduleId,
SortNo: 1
});
},
update: function (data) { //弹出编辑框
update = true;
show(data);
}
};
}();
//监听模块表格内部按钮
table.on('tool(list)', function (obj) {
var data = obj.data;
if (obj.event === 'detail') { //查看
//layer.msg('ID' + data.Id + ' 的查看操作');
menuList({moduleId:data.Id});
}
});
//监听菜单表格内部按钮
table.on('tool(menulist)', function (obj) {
var data = obj.data;
if (obj.event === 'del') { //删除菜单
openauth.del("/moduleManager/delMenu",
data.Id,menuList);
}
});
//监听页面主按钮操作
var active = {
btnDel: function () { //批量删除
var checkStatus = table.checkStatus('mainList')
, data = checkStatus.data;
openauth.del("/moduleManager/Delete",
data.map(function (e) { return e.Id; }),
mainList);
}
, btnAdd: function () { //添加模块
editDlg.add();
}
, btnAddMenu: function () { //添加菜单
var checkStatus = table.checkStatus('mainList')
, data = checkStatus.data;
if (data.length != 1) {
layer.msg("请选择一个要添加菜单的模块");
return;
}
meditDlg.add(data[0].Id);
}
, btnEdit: function () { //编辑
var checkStatus = table.checkStatus('mainList')
, data = checkStatus.data;
if (data.length != 1) {
layer.msg("请选择编辑的行,且同时只能编辑一行");
return;
}
editDlg.update(data[0]);
}
, search: function () { //搜索
mainList({ key: $('#key').val() });
}
, btnRefresh: function() {
mainList();
}
, btnAccessModule: function () {
var index = layer.open({
title: "为用户分配模块",
type: 2,
content: "newsAdd.html",
success: function(layero, index) {
}
});
}
};
$('.toolList .layui-btn').on('click', function () {
var type = $(this).data('type');
active[type] ? active[type].call(this) : '';
});
//监听页面主按钮操作 end
})

View File

@ -1,167 +0,0 @@
layui.config({
base: "/js/"
}).use(['form','vue', 'ztree', 'layer', 'jquery', 'table','droptree','openauth'], function () {
var form = layui.form,
//layer = (parent == undefined || parent.layer === undefined )? layui.layer : parent.layer,
layer = layui.layer,
$ = layui.jquery;
var table = layui.table;
var openauth = layui.openauth;
layui.droptree("/UserSession/GetOrgs", "#ParentName", "#ParentId", false);
//主列表加载,可反复调用进行刷新
var config= {}; //table的参数如搜索key点击tree的id
var mainList = function (options) {
if (options != undefined) {
$.extend(config, options);
}
table.reload('mainList', {
url: '/UserSession/GetSubOrgs',
where: config
});
}
//左边树状机构列表
var ztree = function () {
var url = '/UserSession/GetOrgs';
var zTreeObj;
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) {
mainList({ orgId: treeNode.Id });
}
}
};
var load = function () {
$.getJSON(url, function (json) {
zTreeObj = $.fn.zTree.init($("#tree"), setting);
var newNode = { Name: "根节点", Id: null, ParentId: "" };
json.push(newNode);
zTreeObj.addNodes(null, json);
mainList({ orgId: "" });
zTreeObj.expandAll(true);
});
};
load();
return {
reload: load
}
}();
//添加(编辑)对话框
var editDlg = function() {
var vm = new Vue({
el: "#formEdit"
});
var update = false; //是否为更新
var show = function (data) {
var title = update ? "编辑信息" : "添加";
layer.open({
title: title,
area: ["500px", "400px"],
type: 1,
content: $('#divEdit'),
success: function() {
vm.$set('$data', data);
},
end: mainList
});
var url = "/OrgManager/Add";
if (update) {
url = "/OrgManager/Update"; //暂时和添加一个地址
}
//提交数据
form.on('submit(formSubmit)',
function(data) {
$.post(url,
data.field,
function(data) {
layer.msg(data.Message);
},
"json");
return false;
});
}
return {
add: function() { //弹出添加
update = false;
show({
Id: '',
SortNo:1
});
},
update: function(data) { //弹出编辑框
update = true;
show(data);
}
};
}();
//监听表格内部按钮
table.on('tool(list)', function (obj) {
var data = obj.data;
if (obj.event === 'detail') { //查看
layer.msg('ID' + data.Id + ' 的查看操作');
}
});
//监听页面主按钮操作
var active = {
btnDel: function () { //批量删除
var checkStatus = table.checkStatus('mainList')
, data = checkStatus.data;
openauth.del("/OrgManager/Delete",
data.map(function (e) { return e.Id; }),
mainList);
}
, btnAdd: function () { //添加
editDlg.add();
}
, btnEdit: function () { //编辑
var checkStatus = table.checkStatus('mainList')
, data = checkStatus.data;
if (data.length != 1) {
layer.msg("请选择编辑的行,且同时只能编辑一行");
return;
}
editDlg.update(data[0]);
}
, search: function () { //搜索
mainList({ key: $('#key').val() });
}
, btnRefresh: function() {
mainList();
}
, btnAccessModule: function () {
var index = layer.open({
title: "为用户分配模块",
type: 2,
content: "newsAdd.html",
success: function(layero, index) {
}
});
}
};
$('.toolList .layui-btn').on('click', function () {
var type = $(this).data('type');
active[type] ? active[type].call(this) : '';
});
//监听页面主按钮操作 end
})

View File

@ -1,174 +0,0 @@
layui.config({
base: "/js/"
}).use(['form','vue', 'ztree', 'layer', 'jquery', 'table','droptree','openauth'], function () {
var form = layui.form,
//layer = (parent == undefined || parent.layer === undefined )? layui.layer : parent.layer,
layer = layui.layer,
$ = layui.jquery;
var table = layui.table;
var openauth = layui.openauth;
layui.droptree("/UserSession/GetOrgs", "#Organizations", "#OrganizationIds");
//主列表加载,可反复调用进行刷新
var config= {}; //table的参数如搜索key点击tree的id
var mainList = function (options) {
if (options != undefined) {
$.extend(config, options);
}
table.reload('mainList', {
url: '/RoleManager/Load',
where: config
});
}
//左边树状机构列表
var ztree = function () {
var url = '/UserSession/GetOrgs';
var zTreeObj;
var setting = {
view: { selectedMulti: false },
data: {
key: {
name: 'Name',
title: 'Name'
},
simpleData: {
enable: true,
idKey: 'Id',
pIdKey: 'ParentId',
rootPId: ""
}
},
callback: {
onClick: function (event, treeId, treeNode) {
mainList({ orgId: treeNode.Id });
}
}
};
var load = function () {
$.getJSON(url, function (json) {
zTreeObj = $.fn.zTree.init($("#tree"), setting);
var newNode = { Name: "根节点", Id: null,ParentId:"" };
json.push(newNode);
zTreeObj.addNodes(null, json);
mainList({ orgId: "" });
zTreeObj.expandAll(true);
});
};
load();
return {
reload: load
}
}();
//添加(编辑)对话框
var editDlg = function() {
var vm = new Vue({
el: "#formEdit"
});
var update = false; //是否为更新
var show = function (data) {
var title = update ? "编辑信息" : "添加";
layer.open({
title: title,
area: ["500px", "400px"],
type: 1,
content: $('#divEdit'),
success: function() {
vm.$set('$data', data);
},
end: mainList
});
var url = "/RoleManager/Add";
if (update) {
url = "/RoleManager/Update";
}
//提交数据
form.on('submit(formSubmit)',
function(data) {
$.post(url,
data.field,
function(data) {
layer.msg(data.Message);
},
"json");
return false;
});
}
return {
add: function() { //弹出添加
update = false;
show({
Id: ''
});
},
update: function(data) { //弹出编辑框
update = true;
show(data);
}
};
}();
//监听表格内部按钮
table.on('tool(list)', function (obj) {
var data = obj.data;
if (obj.event === 'detail') { //查看
layer.msg('ID' + data.Id + ' 的查看操作');
}
});
//监听页面主按钮操作
var active = {
btnDel: function () { //批量删除
var checkStatus = table.checkStatus('mainList')
, data = checkStatus.data;
openauth.del("/RoleManager/Delete",
data.map(function (e) { return e.Id; }),
mainList);
}
, btnAdd: function () { //添加
editDlg.add();
}
, btnEdit: function () { //编辑
var checkStatus = table.checkStatus('mainList')
, data = checkStatus.data;
if (data.length != 1) {
layer.msg("请选择编辑的行,且同时只能编辑一行");
return;
}
editDlg.update(data[0]);
}
, search: function () { //搜索
mainList({ key: $('#key').val() });
}
, btnRefresh: function() {
mainList();
}
, btnAccessModule: function () {
var checkStatus = table.checkStatus('mainList')
, data = checkStatus.data;
if (data.length != 1) {
layer.msg("请选择要分配的角色");
return;
}
var index = layer.open({
title: "为用角色配模块",
type: 2,
area: ['450px', '400px'],
content: "/ModuleManager/Assign?type=RoleModule&menuType=RoleElement&id=" + data[0].Id,
success: function (layero, index) {
}
});
}
};
$('.toolList .layui-btn').on('click', function () {
var type = $(this).data('type');
active[type] ? active[type].call(this) : '';
});
//监听页面主按钮操作 end
})

View File

@ -1,174 +0,0 @@
layui.config({
base: "/js/"
}).use(['form','vue', 'ztree', 'layer', 'jquery', 'table','droptree','openauth'], function () {
var form = layui.form,
//layer = (parent == undefined || parent.layer === undefined )? layui.layer : parent.layer,
layer = layui.layer,
$ = layui.jquery;
var table = layui.table;
var openauth = layui.openauth;
layui.droptree("/UserSession/GetOrgs", "#Organizations", "#OrganizationIds");
//主列表加载,可反复调用进行刷新
var config= {}; //table的参数如搜索key点击tree的id
var mainList = function (options) {
if (options != undefined) {
$.extend(config, options);
}
table.reload('mainList', {
url: '/UserManager/Load',
where: config
});
}
//左边树状机构列表
var ztree = function () {
var url = '/UserSession/GetOrgs';
var zTreeObj;
var setting = {
view: { selectedMulti: false },
data: {
key: {
name: 'Name',
title: 'Name'
},
simpleData: {
enable: true,
idKey: 'Id',
pIdKey: 'ParentId',
rootPId: ""
}
},
callback: {
onClick: function (event, treeId, treeNode) {
mainList({ orgId: treeNode.Id });
}
}
};
var load = function () {
$.getJSON(url, function (json) {
zTreeObj = $.fn.zTree.init($("#tree"), setting);
var newNode = { Name: "根节点", Id: null,ParentId:"" };
json.push(newNode);
zTreeObj.addNodes(null, json);
mainList({ orgId: "" });
zTreeObj.expandAll(true);
});
};
load();
return {
reload: load
}
}();
//添加(编辑)对话框
var editDlg = function() {
var vm = new Vue({
el: "#formEdit"
});
var update = false; //是否为更新
var show = function (data) {
var title = update ? "编辑信息" : "添加";
layer.open({
title: title,
area: ["500px", "400px"],
type: 1,
content: $('#divEdit'),
success: function() {
vm.$set('$data', data);
},
end: mainList
});
var url = "/UserManager/AddOrUpdate";
if (update) {
url = "/UserManager/AddOrUpdate"; //暂时和添加一个地址
}
//提交数据
form.on('submit(formSubmit)',
function(data) {
$.post(url,
data.field,
function(data) {
layer.msg(data.Message);
},
"json");
return false;
});
}
return {
add: function() { //弹出添加
update = false;
show({
Id: ''
});
},
update: function(data) { //弹出编辑框
update = true;
show(data);
}
};
}();
//监听表格内部按钮
table.on('tool(list)', function (obj) {
var data = obj.data;
if (obj.event === 'detail') { //查看
layer.msg('ID' + data.Id + ' 的查看操作');
}
});
//监听页面主按钮操作
var active = {
btnDel: function () { //批量删除
var checkStatus = table.checkStatus('mainList')
, data = checkStatus.data;
openauth.del("/UserManager/Delete",
data.map(function (e) { return e.Id; }),
mainList);
}
, btnAdd: function () { //添加
editDlg.add();
}
, btnEdit: function () { //编辑
var checkStatus = table.checkStatus('mainList')
, data = checkStatus.data;
if (data.length != 1) {
layer.msg("请选择编辑的行,且同时只能编辑一行");
return;
}
editDlg.update(data[0]);
}
, search: function () { //搜索
mainList({ key: $('#key').val() });
}
, btnRefresh: function() {
mainList();
}
, btnAccessModule: function () {
var checkStatus = table.checkStatus('mainList')
, data = checkStatus.data;
if (data.length != 1) {
layer.msg("请选择要分配的用户");
return;
}
var index = layer.open({
title: "为用户分配模块",
type: 2,
area: ['450px', '400px'],
content: "/ModuleManager/Assign?type=UserModule&menuType=UserElement&id=" + data[0].Id,
success: function(layero, index) {
}
});
}
};
$('.toolList .layui-btn').on('click', function () {
var type = $(this).data('type');
active[type] ? active[type].call(this) : '';
});
//监听页面主按钮操作 end
})

View File

@ -0,0 +1,373 @@
//初始化设计流程器
$.fn.flowdesign = function (options) {
var $frmpreview = $(this);
if (!$frmpreview.attr('id')) {
return false;
}
var FlowPanel;
$frmpreview.html("");
var defaults = {
flowcontent: "",
frmtype: 0,//自定义表单0,系统表单1
frmData: "",
width: $(window).width(),
height: $(window).height() + 2,
OpenNode: function () { return false},
OpenLine: function () { return false },
NodeRemarks: {
cursor: "选择指针",
direct: "步骤连线",
startround: "开始节点",
endround: "结束节点",
stepnode: "普通节点",
shuntnode: "分流节点",
confluencenode: "合流节点",
group: "区域规划"
},
haveTool:true,
toolBtns: ["startround", "endround", "stepnode", "shuntnode", "confluencenode"],
isprocessing: false,
nodeData: null,
activityId: "",
preview:0
};
var options = $.extend(defaults, options);
FlowPanel = $.createGooFlow($(this), {
width: options.width,
height: options.height,
haveHead: true,
headBtns: ["undo", "redo"],
haveTool: options.haveTool,
toolBtns: options.toolBtns,
haveGroup: true,
useOperStack: true
});
FlowPanel.setNodeRemarks(options.NodeRemarks);
FlowPanel.loadData(options.flowcontent);
OpenNode = options.OpenNode;
OpenLine = options.OpenLine;
//导出数据扩展方法
//所有节点必须有进出线段
//必须有开始结束节点(且只能为一个)
//分流合流节点必须成对出现
//分流合流节点必须一一对应且中间必须有且只能有一个普通节点
//分流节点与合流节点之前的审核节点必须有且只能有一条出去和进来节点
FlowPanel.exportDataEx = function () {
var _data = FlowPanel.exportData();
var _fromlines = {}, _tolines = {}, _nodes = {}, _fnodes = [], _hnodes = [], _startroundFlag = 0, _endroundFlag = 0;
for (var i in _data.lines)
{
if (_fromlines[_data.lines[i].from] == undefined)
{
_fromlines[_data.lines[i].from] = [];
}
_fromlines[_data.lines[i].from].push(_data.lines[i].to);
if (_tolines[_data.lines[i].to] == undefined) {
_tolines[_data.lines[i].to] = [];
}
_tolines[_data.lines[i].to].push(_data.lines[i].from);
}
for (var j in _data.nodes)
{
var _node = _data.nodes[j];
var _flag = false;
switch (_node.type)
{
case "startround":
_startroundFlag++;
if (_fromlines[_node.id] == undefined) {
dialogTop("开始节点无法流转到下一个节点", "error");
return -1;
}
break;
case "endround":
_endroundFlag++;
if ( _tolines[_node.id] == undefined) {
dialogTop("无法流转到结束节点", "error");
return -1;
}
break;
case "stepnode":
_flag = true;
break;
case "shuntnode":
_flag = true;
_fnodes.push(_node.id);
break;
case "confluencenode":
_hnodes.push(_node.id);
_flag = true;
break;
default:
dialogTop("节点数据异常,请重新登录下系统!", "error");
return -1;
break;
}
if (_flag)
{
if (_tolines[_node.id] == undefined) {
labellingRedNode(_node.id);
dialogTop("标注红色的节点没有【进来】的连接线段", "error");
return -1;
}
if (_fromlines[_node.id] == undefined) {
labellingRedNode(_node.id);
dialogTop("标注红色的节点没有【出去】的连接线段", "error");
return -1;
}
}
_nodes[_node.id] = _node;
}
if (_startroundFlag == 0) {
dialogTop("必须有开始节点", "error");
return -1;
}
if (_endroundFlag == 0)
{
dialogTop("必须有结束节点", "error");
return -1;
}
if (_fnodes.length != _hnodes.length)
{
dialogTop("分流节点必须等于合流节点", "error");
return -1;
}
for (var a in _fnodes) {
var aNondeid = _fnodes[a];
if (_fromlines[aNondeid].length == 1) {
labellingRedNode(aNondeid);
dialogTop("标注红色的分流节点不允许只有一条【出去】的线段", "error");
return -1;
}
var _hhnodeid = {};
for (var b in _fromlines[aNondeid])
{
btoNode = _fromlines[aNondeid][b];
if (_nodes[btoNode].type == "stepnode") {
var _nextLine = _fromlines[_nodes[btoNode].id];
var _nextNode = _nodes[_nextLine[0]];
if (_nextNode.type != "confluencenode") {
labellingRedNode(_nodes[btoNode].id);
dialogTop("标注红色的普通节点下一个节点必须是合流节点", "error");
return -1;
}
else {
_hhnodeid[_nextLine[0]] = 0;
if (_hhnodeid.length > 1) {
labellingRedNode(aNondeid);
dialogTop("标注红色的分流节点与之对应的合流节点只能有一个", "error");
return -1;
}
if (_tolines[_nextLine[0]].length != _fromlines[aNondeid].length) {
labellingRedNode(_nextLine[0]);
dialogTop("标注红色的合流节点与之对应的分流节点只能有一个", "error");
return -1;
}
}
if (_nextLine.length > 1) {
labellingRedNode(_nodes[btoNode].id);
dialogTop("标注红色的节点只能有一条出去的线条【分流合流之间】", "error");
return -1;
}
else if (_tolines[_nodes[btoNode].id],length > 1) {
labellingRedNode(_nodes[btoNode].id);
dialogTop("标注红色的节点只能有一条进来的线条【分流合流之间】", "error");
return -1;
}
}
else {
labellingRedNode(aNondeid);
dialogTop("标注红色的分流节点必须经过一个普通节点到合流节点", "error");
return -1;
}
}
}
return _data;
}
FlowPanel.SetNodeEx = function (id,data) {
FlowPanel.setName(id, data.NodeName, "node", data);
}
FlowPanel.SetLineEx = function (id, data) {
FlowPanel.setName(id, data.LineName, "line", data);
}
if (options.isprocessing)//如果是显示进程状态
{
var tipHtml = '<div style="position:absolute;left:10px;margin-top: 10px;padding:10px;border-radius:5px;background:rgba(0,0,0,0.05);z-index:1000;display:inline-block;">';
tipHtml += '<div style="display: inline-block;"><i style="padding-right:5px;color:#5cb85c;" class="fa fa-flag"></i><span>已处理</span></div>';
tipHtml += '<div style="display: inline-block;margin-left: 10px;"><i style="padding-right:5px;color:#5bc0de;" class="fa fa-flag"></i><span>正在处理</span></div>';
tipHtml += '<div style="display: inline-block;margin-left: 10px;"><i style="padding-right:5px;color:#d9534f;" class="fa fa-flag"></i><span>不通过</span></div>';
tipHtml += '<div style="display: inline-block;margin-left: 10px;"><i style="padding-right:5px;color:#f0ad4e;" class="fa fa-flag"></i><span>驳回</span></div>';
tipHtml += '<div style="display: inline-block;margin-left: 10px;"><i style="padding-right:5px;color:#999;" class="fa fa-flag"></i><span>未处理</span></div></div>';
$frmpreview.find('.GooFlow_work .GooFlow_work_inner').css('background-image', 'none');
$frmpreview.find('td').css('color', '#fff');
$frmpreview.css('background', '#fff');
$frmpreview.find('.ico').remove();
$frmpreview.find('.GooFlow_item').css('border', '0px');
$frmpreview.append(tipHtml);
$.each(options.nodeData, function (i, item) {
$frmpreview.find("#" + item.id).css("background", "#999");
if (item.type == "startround") {
$frmpreview.find("#" + item.id).css("background", "#5cb85c");
}
else {
if (item.id == options.activityId) {
$frmpreview.find("#" + item.id).css("background", "#5bc0de");//正在处理
}
if (item.setInfo != undefined && item.setInfo.Taged != undefined) {
if (item.setInfo.Taged == -1) {
$frmpreview.find("#" + item.id).css("background", "#d9534f");//不通过
}
else if (item.setInfo.Taged == 1) {
$frmpreview.find("#" + item.id).css("background", "#5cb85c");//通过
}
else {
$frmpreview.find("#" + item.id).css("background", "#f0ad4e");//驳回
}
}
}
if (item.setInfo != undefined && item.setInfo.Taged != undefined)
{
var _one = clientuserData[item.setInfo.UserId];
var _row = '<div style="text-align:left">';
var tagname = { "-1": "不通过", "1": "通过", "0": "驳回" };
_row += "<p>处理人:" + (_one == undefined ? item.setInfo.UserId : _one.RealName) + "</p>";
_row += "<p>结果:" + tagname[item.setInfo.Taged] + "</p>";
_row += "<p>处理时间:" + item.setInfo.TagedTime + "</p>";
_row += "<p>备注:" + item.setInfo.description + "</p></div>";
$frmpreview.find('#' + item.id).attr('data-toggle', 'tooltip');
$frmpreview.find('#' + item.id).attr('data-placement', 'bottom');
$frmpreview.find('#' + item.id).attr('title', _row);
}
});
$('[data-toggle="tooltip"]').tooltip({"html":true});
}
if (options.preview == 1)
{
preview();
}
//预览
function preview() {
var _frmitems = {};
for (var i in options.frmData) {
var _frmitem = options.frmData[i];
_frmitems[_frmitem.control_field] = _frmitem.control_label;
}
var DataBaseLinkData = {};
var _NodeRejectType = { "0": "前一步", "1": "第一步", "2": "某一步", "3": "用户指定", "4": "不处理" };
var _NodeIsOver = { "0": "不允许", "1": "允许" };
var _NodeDesignate = { "NodeDesignateType1": "所有成员", "NodeDesignateType2": "指定成员", "NodeDesignateType3": "发起者领导", "NodeDesignateType4": "前一步骤领导", "NodeDesignateType5": "发起者部门领导", "NodeDesignateType6": "发起者公司领导" };
var _NodeConfluenceType = { "0": "所有步骤通过", "1": "一个步骤通过即可", "2": "按百分比计算" };
$.each(options.flowcontent.nodes, function (i, item) {
if (item.setInfo != undefined) {
var _popoverhtml = "";
_popoverhtml += '<div class="flow-portal-panel-title"><i class="fa fa-navicon"></i>&nbsp;&nbsp;基本信息</div>';
_popoverhtml += '<ul>';
_popoverhtml += '<li>节点标识:' + item.setInfo.NodeCode + '</li>';
_popoverhtml += '<li>驳回类型:' + _NodeRejectType[item.setInfo.NodeRejectType] + '</li>';
_popoverhtml += '<li>终止流程:' + _NodeIsOver[item.setInfo.NodeIsOver] + '</li>';
if (item.setInfo.Description != "") { _popoverhtml += '<li>备注:' + item.setInfo.Description + '</li>'; }
if (item.setInfo.NodeConfluenceType != "") {
_popoverhtml += '<li>会签策略:' + _NodeConfluenceType[item.setInfo.NodeConfluenceType] + '</li>';
if (item.setInfo.NodeConfluenceType == 2) {
_popoverhtml += '<li>会签比例:' + item.setInfo.NodeConfluenceRate + '</li>';
}
}
if (item.setInfo.NodeDataBase != "") {
_popoverhtml += '<li>绑定数据库:' + DataBaseLinkData[item.setInfo.NodeDataBase] + '</li>';
}
if (item.setInfo.NodeTable != "") {
_popoverhtml += '<li>绑定表名:' + item.setInfo.NodeTable + '</li>';
}
if (item.setInfo.NodePram != "") {
_popoverhtml += '<li>绑定字段:' + item.setInfo.NodePram + '</li>';
}
_popoverhtml += '</ul>';
_popoverhtml += '<div class="flow-portal-panel-title"><i class="fa fa-navicon"></i>&nbsp;&nbsp;审核者</div>';
_popoverhtml += '<ul>';
_popoverhtml += '<li>类型:' + _NodeDesignate[item.setInfo.NodeDesignate] + '</li>';
if (item.setInfo.NodeDesignateData != undefined) {
var _rowstr = "";
for (var i in item.setInfo.NodeDesignateData.role) {
var _postitem = item.setInfo.NodeDesignateData.role[i];
var _one = top.clientroleData[_postitem];
_rowstr += ' <span class="label label-success">' + (_one == undefined ? _postitem : _one.FullName) + '</span>';
if (i == item.setInfo.NodeDesignateData.role.length - 1) {
_popoverhtml += '<li>角色:' + _rowstr + '</li>';
}
}
_rowstr = "";
for (var i in item.setInfo.NodeDesignateData.user) {
var _postitem = item.setInfo.NodeDesignateData.user[i];
var _one = clientuserData[_postitem];
_rowstr += ' <span class="label label-danger">' + (_one == undefined ? _postitem : _one.RealName) + '</span>';
if (i == item.setInfo.NodeDesignateData.user.length - 1) {
_popoverhtml += '<li>用户:' + _rowstr + '</li>';
}
}
}
_popoverhtml += '</ul>';
var _row = "";
for (var i in item.setInfo.frmPermissionInfo) {
var _item = item.setInfo.frmPermissionInfo[i];
var _downtext = "";
if (_item.down) {
_downtext = ' | 可下载';
}
else if (_item.down != undefined) {
_downtext = ' | 不可下载';
}
_row += '<li>' + _frmitems[_item.fieldid] + ': ' + (_item.look ? '可查看' : '不可查看') + _downtext + '</li>';
if (i == item.setInfo.frmPermissionInfo.length - 1) {
_popoverhtml += '<div class="flow-portal-panel-title"><i class="fa fa-navicon"></i>&nbsp;&nbsp;权限分配</div>';
_popoverhtml += '<ul>';
_popoverhtml += _row;
_popoverhtml += '</ul>';
}
}
if (item.setInfo.NodeDataBaseToSQL != "" || item.setInfo.NodeSQL != "") {
_popoverhtml += '<div class="flow-portal-panel-title"><i class="fa fa-navicon"></i>&nbsp;&nbsp;执行SQL</div>';
_popoverhtml += '<ul>';
_popoverhtml += '<li>数据库:' + DataBaseLinkData[item.setInfo.NodeDataBaseToSQL] + '</li>';
_popoverhtml += '<li>SQL语句:' + item.setInfo.NodeSQL + '</li>';
_popoverhtml += '</ul>';
}
$frmpreview.find('#' + item.id).attr('title', item.name);
$frmpreview.find('#' + item.id).attr('data-toggle', 'popover');
$frmpreview.find('#' + item.id).attr('data-placement', 'bottom');
$frmpreview.find('#' + item.id).attr('data-content', _popoverhtml);
}
else {
$frmpreview.find('#' + item.id).attr('title', item.name);
$frmpreview.find('#' + item.id).attr('data-toggle', 'popover');
$frmpreview.find('#' + item.id).attr('data-placement', 'bottom');
$frmpreview.find('#' + item.id).attr('data-content', "该节点未被设置");
}
});
$frmpreview.find('.GooFlow_item').popover({ html: true });
}
function labellingRedNode(id)
{
$frmpreview.find('.flow-labellingnode-red').removeClass('flow-labellingnode-red');
$frmpreview.find('#' + id).addClass('flow-labellingnode-red');
}
return FlowPanel;
}

925
OpenAuth.Mvc/js/utils/ui.js Normal file
View File

@ -0,0 +1,925 @@
$(function () {
$(".ui-filter-text").click(function () {
if ($(this).next('.ui-filter-list').is(":hidden")) {
$(this).css('border-bottom-color', '#fff');
$(".ui-filter-list").slideDown(10);
$(this).addClass("active")
} else {
$(this).css('border-bottom-color', '#ccc');
$(".ui-filter-list").slideUp(10);
$(this).removeClass("active")
}
});
$(".profile-nav li").click(function () {
$(".profile-nav li").removeClass("active");
$(".profile-nav li").removeClass("hover");
$(this).addClass("active")
}).hover(function () {
if (!$(this).hasClass("active")) {
$(this).addClass("hover")
}
}, function () {
$(this).removeClass("hover")
})
})
Loading = function (bool, text) {
layui.use('layer', function () {
var layer = layui.layer;
if (bool) {
layer.load(1);
} else {
layer.closeAll('loading');
}
});
}
$.fn.ComboBox = function (options) {
//options参数description,height,width,allowSearch,url,param,data
var $select = $(this);
if (!$select.attr('id')) {
return false;
}
if (options) {
if ($select.find('.ui-select-text').length == 0) {
var $select_html = "";
$select_html += "<div class=\"ui-select-text\" style='color:#999;'>" + options.description + "</div>";
$select_html += "<div class=\"ui-select-option\">";
$select_html += "<div class=\"ui-select-option-content\" style=\"max-height: " + options.height + "\">" + $select.html() + "</div>";
if (options.allowSearch) {
$select_html += "<div class=\"ui-select-option-search\"><input type=\"text\" class=\"form-control\" placeholder=\"搜索关键字\" /><span class=\"input-query\" title=\"Search\"><i class=\"fa fa-search\"></i></span></div>";
}
$select_html += "</div>";
$select.html('');
$select.append($select_html);
}
}
var $option_html = $($("<p>").append($select.find('.ui-select-option').clone()).html());
$option_html.attr('id', $select.attr('id') + '-option');
$select.find('.ui-select-option').remove();
if ($option_html.length > 0) {
$('body').find('#' + $select.attr('id') + '-option').remove();
}
$('body').prepend($option_html);
var $option = $("#" + $select.attr('id') + "-option");
if (options.url != undefined) {
$option.find('.ui-select-option-content').html('');
$.ajax({
url: options.url,
data: options.param,
type: "GET",
dataType: "json",
async: false,
success: function (data) {
options.data = data;
var json = data;
loadComboBoxView(json);
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
dialogMsg(errorThrown, -1);
}
});
}
else if (options.data != undefined) {
var json = options.data;
loadComboBoxView(json);
}
else {
$option.find('li').css('padding', "0 5px");
$option.find('li').click(function (e) {
var data_text = $(this).text();
var data_value = $(this).attr('data-value');
$select.attr("data-value", data_value).attr("data-text", data_text);
$select.find('.ui-select-text').html(data_text).css('color', '#000');
$option.slideUp(150);
$select.trigger("change");
e.stopPropagation();
}).hover(function (e) {
if (!$(this).hasClass('liactive')) {
$(this).toggleClass('on');
}
e.stopPropagation();
});
}
function loadComboBoxView(json, searchValue, m) {
if (json.length > 0) {
var $_html = $('<ul></ul>');
if (options.description) {
$_html.append('<li data-value="">' + options.description + '</li>');
}
$.each(json, function (i) {
var row = json[i];
var title = row[options.title];
if (title == undefined) {
title = "";
}
if (searchValue != undefined) {
if (row[m.text].indexOf(searchValue) != -1) {
$_html.append('<li data-value="' + row[options.id] + '" title="' + title + '">' + row[options.text] + '</li>');
}
}
else {
$_html.append('<li data-value="' + row[options.id] + '" title="' + title + '">' + row[options.text] + '</li>');
}
});
$option.find('.ui-select-option-content').html($_html);
$option.find('li').css('padding', "0 5px");
$option.find('li').click(function (e) {
var data_text = $(this).text();
var data_value = $(this).attr('data-value');
$select.attr("data-value", data_value).attr("data-text", data_text);
$select.find('.ui-select-text').html(data_text).css('color', '#000');
$option.slideUp(150);
$select.trigger("change");
e.stopPropagation();
}).hover(function (e) {
if (!$(this).hasClass('liactive')) {
$(this).toggleClass('on');
}
e.stopPropagation();
});
}
}
//操作搜索事件
if (options.allowSearch) {
$option.find('.ui-select-option-search').find('input').bind("keypress", function (e) {
if (event.keyCode == "13") {
var value = $(this).val();
loadComboBoxView($(this)[0].options.data, value, $(this)[0].options);
}
}).focus(function () {
$(this).select();
})[0]["options"] = options;
}
$select.unbind('click');
$select.bind("click", function (e) {
if ($select.attr('readonly') == 'readonly' || $select.attr('disabled') == 'disabled') {
return false;
}
$(this).addClass('ui-select-focus');
if ($option.is(":hidden")) {
$select.find('.ui-select-option').hide();
$('.ui-select-option').hide();
var left = $select.offset().left;
var top = $select.offset().top + 29;
var width = $select.width();
if (options.width) {
width = options.width;
}
if (($option.height() + top) < $(window).height()) {
$option.slideDown(150).css({ top: top, left: left, width: width });
} else {
var _top = (top - $option.height() - 32)
$option.show().css({ top: _top, left: left, width: width });
$option.attr('data-show', true);
}
$option.css('border-top', '1px solid #ccc');
$option.find('li').removeClass('liactive');
$option.find('[data-value=' + $select.attr('data-value') + ']').addClass('liactive');
$option.find('.ui-select-option-search').find('input').select();
} else {
if ($option.attr('data-show')) {
$option.hide();
} else {
$option.slideUp(150);
}
}
e.stopPropagation();
});
$(document).click(function (e) {
var e = e ? e : window.event;
var tar = e.srcElement || e.target;
if (!$(tar).hasClass('form-control')) {
if ($option.attr('data-show')) {
$option.hide();
} else {
$option.slideUp(150);
}
$select.removeClass('ui-select-focus');
e.stopPropagation();
}
});
return $select;
}
$.fn.ComboBoxSetValue = function (value) {
if ($.isNullOrEmpty(value)) {
return;
}
var $select = $(this);
var $option = $("#" + $select.attr('id') + "-option");
$select.attr('data-value', value);
var data_text = $option.find('ul').find('[data-value=' + value + ']').html();
if (data_text) {
$select.attr('data-text', data_text);
$select.find('.ui-select-text').html(data_text).css('color', '#000');
$option.find('ul').find('[data-value=' + value + ']').addClass('liactive')
}
return $select;
}
$.fn.ComboBoxTree = function (options) {
//options参数description,height,allowSearch,appendTo,click,url,param,method,icon
var $select = $(this);
if (!$select.attr('id')) {
return false;
}
if ($select.find('.ui-select-text').length == 0) {
var $select_html = "";
$select_html += "<div class=\"ui-select-text\" style='color:#999;'>" + options.description + "</div>";
$select_html += "<div class=\"ui-select-option\">";
$select_html += "<div class=\"ui-select-option-content\" style=\"max-height: " + options.height + "\"></div>";
if (options.allowSearch) {
$select_html += "<div class=\"ui-select-option-search\"><input type=\"text\" class=\"form-control\" placeholder=\"搜索关键字\" /><span class=\"input-query\" title=\"Search\"><i class=\"fa fa-search\" title=\"按回车查询\"></i></span></div>";
}
$select_html += "</div>";
$select.append($select_html);
}
var $option_html = $($("<p>").append($select.find('.ui-select-option').clone()).html());
$option_html.attr('id', $select.attr('id') + '-option');
$select.find('.ui-select-option').remove();
if (options.appendTo) {
$(options.appendTo).prepend($option_html);
} else {
$('body').prepend($option_html);
}
var $option = $("#" + $select.attr('id') + "-option");
var $option_content = $("#" + $select.attr('id') + "-option").find('.ui-select-option-content');
loadtreeview(options.url);
function loadtreeview(url) {
$option_content.treeview({
onnodeclick: function (item) {
$select.attr("data-value", item.id).attr("data-text", item.text);
$select.find('.ui-select-text').html(item.text).css('color', '#000');
$select.trigger("change");
if (options.click) {
options.click(item);
}
},
height: options.height,
url: url,
param: options.param,
method: options.method,
description: options.description
});
}
if (options.allowSearch) {
$option.find('.ui-select-option-search').find('input').attr('data-url', options.url);
$option.find('.ui-select-option-search').find('input').bind("keypress", function (e) {
if (event.keyCode == "13") {
var value = $(this).val();
var url = changeUrlParam($option.find('.ui-select-option-search').find('input').attr('data-url'), "keyword", escape(value));
loadtreeview(url);
}
}).focus(function () {
$(this).select();
});
}
if (options.icon) {
$option.find('i').remove();
$option.find('img').remove();
}
$select.find('.ui-select-text').unbind('click');
$select.find('.ui-select-text').bind("click", function (e) {
if ($select.attr('readonly') == 'readonly' || $select.attr('disabled') == 'disabled') {
return false;
}
$(this).parent().addClass('ui-select-focus');
if ($option.is(":hidden")) {
$select.find('.ui-select-option').hide();
$('.ui-select-option').hide();
var left = $select.offset().left;
var top = $select.offset().top + 29;
var width = $select.width();
if (options.width) {
width = options.width;
}
if (($option.height() + top) < $(window).height()) {
$option.slideDown(150).css({ top: top, left: left, width: width });
} else {
var _top = (top - $option.height() - 32);
$option.show().css({ top: _top, left: left, width: width });
$option.attr('data-show', true);
}
$option.css('border-top', '1px solid #ccc');
if (options.appendTo) {
$option.css("position", "inherit")
}
$option.find('.ui-select-option-search').find('input').select();
} else {
if ($option.attr('data-show')) {
$option.hide();
} else {
$option.slideUp(150);
}
}
e.stopPropagation();
});
$select.find('li div').click(function (e) {
var e = e ? e : window.event;
var tar = e.srcElement || e.target;
if (!$(tar).hasClass('bbit-tree-ec-icon')) {
$option.slideUp(150);
e.stopPropagation();
}
});
$(document).click(function (e) {
var e = e ? e : window.event;
var tar = e.srcElement || e.target;
if (!$(tar).hasClass('bbit-tree-ec-icon') && !$(tar).hasClass('form-control')) {
if ($option.attr('data-show')) {
$option.hide();
} else {
$option.slideUp(150);
}
$select.removeClass('ui-select-focus');
e.stopPropagation();
}
});
return $select;
}
$.fn.ComboBoxTreeSetValue = function (value) {
if (value == "") {
return;
}
var $select = $(this);
var $option = $("#" + $select.attr('id') + "-option");
$select.attr('data-value', value);
var data_text = $option.find('ul').find('[data-value=' + value + ']').html();
if (data_text) {
$select.attr('data-text', data_text);
$select.find('.ui-select-text').html(data_text).css('color', '#000');
$option.find('ul').find('[data-value=' + value + ']').parent().parent().addClass('bbit-tree-selected');
}
return $select;
}
$.fn.GetWebControls = function (keyValue) {
var reVal = "";
$(this).find('input,select,textarea,.ui-select').each(function (r) {
var id = $(this).attr('id');
var type = $(this).attr('type');
switch (type) {
case "checkbox":
if ($("#" + id).is(":checked")) {
reVal += '"' + id + '"' + ':' + '"1",'
} else {
reVal += '"' + id + '"' + ':' + '"0",'
}
break;
case "select":
var value = $("#" + id).attr('data-value');
if (value == "") {
value = "&nbsp;";
}
reVal += '"' + id + '"' + ':' + '"' + $.trim(value) + '",'
break;
case "selectTree":
var value = $("#" + id).attr('data-value');
if (value == "") {
value = "&nbsp;";
}
reVal += '"' + id + '"' + ':' + '"' + $.trim(value) + '",'
break;
default:
var value = $("#" + id).val();
if (value == "") {
value = "&nbsp;";
}
reVal += '"' + id + '"' + ':' + '"' + $.trim(value) + '",'
break;
}
});
reVal = reVal.substr(0, reVal.length - 1);
if (!keyValue) {
reVal = reVal.replace(/&nbsp;/g, '');
}
reVal = reVal.replace(/\\/g, '\\\\');
reVal = reVal.replace(/\n/g, '\\n');
var postdata = jQuery.parseJSON('{' + reVal + '}');
//阻止伪造请求
//if ($('[name=__RequestVerificationToken]').length > 0) {
// postdata["__RequestVerificationToken"] = $('[name=__RequestVerificationToken]').val();
//}
return postdata;
};
$.fn.SetWebControls = function (data) {
var $id = $(this)
for (var key in data) {
var id = $id.find('#' + key);
if (id.attr('id')) {
var type = id.attr('type');
if (id.hasClass("input-datepicker")) {
type = "datepicker";
}
var value = $.trim(data[key]).replace(/&nbsp;/g, '');
switch (type) {
case "checkbox":
if (value == 1) {
id.attr("checked", 'checked');
} else {
id.removeAttr("checked");
}
break;
case "select":
id.ComboBoxSetValue(value);
break;
case "selectTree":
id.ComboBoxTreeSetValue(value);
break;
case "datepicker":
id.val(formatDate(value, 'yyyy-MM-dd'));
break;
default:
id.val(value);
break;
}
}
}
}
$.fn.Contextmenu = function () {
var element = $(this);
var oMenu = $('.contextmenu');
$(document).click(function () {
oMenu.hide();
});
$(document).mousedown(function (e) {
if (3 == e.which) {
oMenu.hide();
}
})
var aUl = oMenu.find("ul");
var aLi = oMenu.find("li");
var showTimer = hideTimer = null;
var i = 0;
var maxWidth = maxHeight = 0;
var aDoc = [document.documentElement.offsetWidth, document.documentElement.offsetHeight];
oMenu.hide();
for (i = 0; i < aLi.length; i++) {
//为含有子菜单的li加上箭头
aLi[i].getElementsByTagName("ul")[0] && (aLi[i].className = "sub");
//鼠标移入
aLi[i].onmouseover = function () {
var oThis = this;
var oUl = oThis.getElementsByTagName("ul");
//鼠标移入样式
oThis.className += " active";
//显示子菜单
if (oUl[0]) {
clearTimeout(hideTimer);
showTimer = setTimeout(function () {
for (i = 0; i < oThis.parentNode.children.length; i++) {
oThis.parentNode.children[i].getElementsByTagName("ul")[0] &&
(oThis.parentNode.children[i].getElementsByTagName("ul")[0].style.display = "none");
}
oUl[0].style.display = "block";
oUl[0].style.top = oThis.offsetTop + "px";
oUl[0].style.left = oThis.offsetWidth + "px";
//最大显示范围
maxWidth = aDoc[0] - oUl[0].offsetWidth;
maxHeight = aDoc[1] - oUl[0].offsetHeight;
//防止溢出
maxWidth < getOffset.left(oUl[0]) && (oUl[0].style.left = -oUl[0].clientWidth + "px");
maxHeight < getOffset.top(oUl[0]) && (oUl[0].style.top = -oUl[0].clientHeight + oThis.offsetTop + oThis.clientHeight + "px")
}, 300);
}
};
//鼠标移出
aLi[i].onmouseout = function () {
var oThis = this;
var oUl = oThis.getElementsByTagName("ul");
//鼠标移出样式
oThis.className = oThis.className.replace(/\s?active/, "");
clearTimeout(showTimer);
hideTimer = setTimeout(function () {
for (i = 0; i < oThis.parentNode.children.length; i++) {
oThis.parentNode.children[i].getElementsByTagName("ul")[0] &&
(oThis.parentNode.children[i].getElementsByTagName("ul")[0].style.display = "none");
}
}, 300);
};
}
//自定义右键菜单
$(element).bind("contextmenu", function () {
var event = event || window.event;
oMenu.show();
oMenu.css('top', event.clientY + "px");
oMenu.css('left', event.clientX + "px");
//最大显示范围
maxWidth = aDoc[0] - oMenu.width();
maxHeight = aDoc[1] - oMenu.height();
//防止菜单溢出
if (oMenu.offset().top > maxHeight) {
oMenu.css('top', maxHeight + "px");
}
if (oMenu.offset().left > maxWidth) {
oMenu.css('left', maxWidth + "px");
}
return false;
}).bind("click", function () {
oMenu.hide();
});
}
$.fn.panginationEx = function (options) {
var $pager = $(this);
if (!$pager.attr('id')) {
return false;
}
var defaults = {
firstBtnText: '首页',
lastBtnText: '尾页',
prevBtnText: '上一页',
nextBtnText: '下一页',
showInfo: true,
showJump: true,
jumpBtnText: '跳转',
showPageSizes: true,
infoFormat: '{start} ~ {end}条,共{total}条',
sortname: '',
url: "",
success: null,
beforeSend: null,
complete: null
};
var options = $.extend(defaults, options);
var params = $.extend({ sidx: options.sortname, sord: "asc" }, options.params);
options.remote = {
url: options.url, //请求地址
params: params, //自定义请求参数
beforeSend: function (XMLHttpRequest) {
if (options.beforeSend != null) {
options.beforeSend(XMLHttpRequest);
}
},
success: function (result, pageIndex) {
//回调函数
//result 为 请求返回的数据,呈现数据
if (options.success != null) {
options.success(result.rows, pageIndex);
}
},
complete: function (XMLHttpRequest, textStatu) {
if (options.complete != null) {
options.complete(XMLHttpRequest, textStatu);
}
//...
},
pageIndexName: 'page', //请求参数当前页数索引从0开始
pageSizeName: 'rows', //请求参数,每页数量
totalName: 'records' //指定返回数据的总数据量的字段名
}
$pager.page(options);
}
$.fn.LeftListShowOfemail = function (options) {
var $list = $(this);
if (!$list.attr('id')) {
return false;
}
$list.append('<ul style="padding-top: 10px;"></ul>');
var defaults = {
id: "id",
name: "text",
img: "fa fa-file-o",
};
var options = $.extend(defaults, options);
$list.height(options.height);
$.ajax({
url: options.url,
data: options.param,
type: "GET",
dataType: "json",
async: false,
success: function (data) {
$.each(data, function (i, item) {
var $_li = $('<li class="" data-value="' + item[options.id] + '" data-text="' + item[options.name] + '" ><i class="' + options.img + '" style="vertical-align: middle; margin-top: -2px; margin-right: 8px; font-size: 14px; color: #666666; opacity: 0.9;"></i>' + item[options.name] + '</li>');
if (i == 0) {
$_li.addClass("active");
}
$list.find('ul').append($_li);
});
$list.find('li').click(function () {
var key = $(this).attr('data-value');
var value = $(this).attr('data-text');
$list.find('li').removeClass('active');
$(this).addClass('active');
options.onnodeclick({ id: key, name: value });
});
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
dialogMsg(errorThrown, -1);
}
});
}
dialogTop = function (content, type) {
layer.msg(content);
}
dialogOpen = function (options) {
Loading(true);
var defaults = {
id: null,
title: '系统窗口',
width: "100px",
height: "100px",
url: '',
shade: 0.3,
btn: ['确认', '关闭'],
callBack: null
};
var options = $.extend(defaults, options);
var _url = options.url;
var _width = top.$.windowWidth() > parseInt(options.width.replace('px', '')) ? options.width : top.$.windowWidth() + 'px';
var _height = top.$.windowHeight() > parseInt(options.height.replace('px', '')) ? options.height : top.$.windowHeight() + 'px';
layer.open({
id: options.id,
type: 2,
shade: options.shade,
title: options.title,
fix: false,
area: [_width, _height],
content: top.contentPath + _url,
btn: options.btn,
yes: function () {
options.callBack(options.id)
}, cancel: function () {
if (options.cancel != undefined)
{
options.cancel();
}
return true;
}
});
}
dialogContent = function (options) {
var defaults = {
id: null,
title: '系统窗口',
width: "100px",
height: "100px",
content: '',
btn: ['确认', '关闭'],
callBack: null
};
var options = $.extend(defaults, options);
layer.open({
id: options.id,
type: 1,
title: options.title,
fix: false,
area: [options.width, options.height],
content: options.content,
btn: options.btn,
yes: function () {
options.callBack(options.id)
}
});
}
dialogAlert = function (content, type) {
if (type == -1) {
type = 2;
}
layer.alert(content, {
icon: type,
title: "提示"
});
}
dialogConfirm = function (content, callBack) {
layer.confirm(content, {
icon: 7,
title: "提示",
btn: ['确认', '取消'],
}, function () {
callBack(true);
}, function () {
callBack(false)
});
}
dialogMsg = function (content, type) {
if (type == -1) {
type = 2;
}
layer.msg(content, { icon: type, time: 4000, shift: 5 });
}
reload = function () {
location.reload();
return false;
}
newGuid = function () {
var guid = "";
for (var i = 1; i <= 32; i++) {
var n = Math.floor(Math.random() * 16.0).toString(16);
guid += n;
if ((i == 8) || (i == 12) || (i == 16) || (i == 20)) guid += "-";
}
return guid;
}
formatDate = function (v, format) {
if (!v) return "";
var d = v;
if (typeof v === 'string') {
if (v.indexOf("/Date(") > -1)
d = new Date(parseInt(v.replace("/Date(", "").replace(")/", ""), 10));
else
d = new Date(Date.parse(v.replace(/-/g, "/").replace("T", " ").split(".")[0]));//.split(".")[0] 用来处理出现毫秒的情况,截取掉.xxx否则会出错
}
var o = {
"M+": d.getMonth() + 1, //month
"d+": d.getDate(), //day
"h+": d.getHours(), //hour
"m+": d.getMinutes(), //minute
"s+": d.getSeconds(), //second
"q+": Math.floor((d.getMonth() + 3) / 3), //quarter
"S": d.getMilliseconds() //millisecond
};
if (/(y+)/.test(format)) {
format = format.replace(RegExp.$1, (d.getFullYear() + "").substr(4 - RegExp.$1.length));
}
for (var k in o) {
if (new RegExp("(" + k + ")").test(format)) {
format = format.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k] : ("00" + o[k]).substr(("" + o[k]).length));
}
}
return format;
};
toDecimal = function (num) {
if (num == null) {
num = "0";
}
num = num.toString().replace(/\$|\,/g, '');
if (isNaN(num))
num = "0";
sign = (num == (num = Math.abs(num)));
num = Math.floor(num * 100 + 0.50000000001);
cents = num % 100;
num = Math.floor(num / 100).toString();
if (cents < 10)
cents = "0" + cents;
for (var i = 0; i < Math.floor((num.length - (1 + i)) / 3) ; i++)
num = num.substring(0, num.length - (4 * i + 3)) + '' +
num.substring(num.length - (4 * i + 3));
return (((sign) ? '' : '-') + num + '.' + cents);
}
Date.prototype.DateAdd = function (strInterval, Number) {
//y年 q季度 m月 d日 w周 h小时 n分钟 s秒 ms毫秒
var dtTmp = this;
switch (strInterval) {
case 's': return new Date(Date.parse(dtTmp) + (1000 * Number));
case 'n': return new Date(Date.parse(dtTmp) + (60000 * Number));
case 'h': return new Date(Date.parse(dtTmp) + (3600000 * Number));
case 'd': return new Date(Date.parse(dtTmp) + (86400000 * Number));
case 'w': return new Date(Date.parse(dtTmp) + ((86400000 * 7) * Number));
case 'q': return new Date(dtTmp.getFullYear(), (dtTmp.getMonth()) + Number * 3, dtTmp.getDate(), dtTmp.getHours(), dtTmp.getMinutes(), dtTmp.getSeconds());
case 'm': return new Date(dtTmp.getFullYear(), (dtTmp.getMonth()) + Number, dtTmp.getDate(), dtTmp.getHours(), dtTmp.getMinutes(), dtTmp.getSeconds());
case 'y': return new Date((dtTmp.getFullYear() + Number), dtTmp.getMonth(), dtTmp.getDate(), dtTmp.getHours(), dtTmp.getMinutes(), dtTmp.getSeconds());
}
}
request = function (keyValue) {
var search = location.search.slice(1);
var arr = search.split("&");
for (var i = 0; i < arr.length; i++) {
var ar = arr[i].split("=");
if (ar[0] == keyValue) {
if (unescape(ar[1]) == 'undefined') {
return "";
} else {
return unescape(ar[1]);
}
}
}
return "";
}
changeUrlParam = function (url, key, value) {
var newUrl = "";
var reg = new RegExp("(^|)" + key + "=([^&]*)(|$)");
var tmp = key + "=" + value;
if (url.match(reg) != null) {
newUrl = url.replace(eval(reg), tmp);
} else {
if (url.match("[\?]")) {
newUrl = url + "&" + tmp;
}
else {
newUrl = url + "?" + tmp;
}
}
return newUrl;
}
$.isbrowsername = function () {
var userAgent = navigator.userAgent; //取得浏览器的userAgent字符串
var isOpera = userAgent.indexOf("Opera") > -1;
if (isOpera) {
return "Opera"
}; //判断是否Opera浏览器
if (userAgent.indexOf("Firefox") > -1) {
return "FF";
} //判断是否Firefox浏览器
if (userAgent.indexOf("Chrome") > -1) {
if (window.navigator.webkitPersistentStorage.toString().indexOf('DeprecatedStorageQuota') > -1) {
return "Chrome";
} else {
return "360";
}
}//判断是否Chrome浏览器//360浏览器
if (userAgent.indexOf("Safari") > -1) {
return "Safari";
} //判断是否Safari浏览器
if (userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1 && !isOpera) {
return "IE";
}; //判断是否IE浏览器
}
$.download = function (url, data, method) {
if (url && data) {
data = typeof data == 'string' ? data : jQuery.param(data);
var inputs = '';
$.each(data.split('&'), function () {
var pair = this.split('=');
inputs += '<input type="hidden" name="' + pair[0] + '" value="' + pair[1] + '" />';
});
$('<form action="' + url + '" method="' + (method || 'post') + '">' + inputs + '</form>').appendTo('body').submit().remove();
};
};
$.standTabchange = function (object, forid) {
$(".standtabactived").removeClass("standtabactived");
$(object).addClass("standtabactived");
$('.standtab-pane').css('display', 'none');
$('#' + forid).css('display', 'block');
}
$.isNullOrEmpty = function (obj) {
if ((typeof (obj) == "string" && obj == "") || obj == null || obj == undefined) {
return true;
}
else {
return false;
}
}
$.arrayClone = function (data) {
return $.map(data, function (obj) {
return $.extend(true, {}, obj);
});
}
$.windowWidth = function () {
return $(window).width();
}
$.windowHeight = function () {
return $(window).height();
}
IsNumber = function (obj) {
$("#" + obj).bind("contextmenu", function () {
return false;
});
$("#" + obj).css('ime-mode', 'disabled');
$("#" + obj).keypress(function (e) {
if (e.which != 8 && e.which != 0 && (e.which < 48 || e.which > 57)) {
return false;
}
});
}
IsMoney = function (obj) {
$("#" + obj).bind("contextmenu", function () {
return false;
});
$("#" + obj).css('ime-mode', 'disabled');
$("#" + obj).bind("keydown", function (e) {
var key = window.event ? e.keyCode : e.which;
if (isFullStop(key)) {
return $(this).val().indexOf('.') < 0;
}
return (isSpecialKey(key)) || ((isNumber(key) && !e.shiftKey));
});
function isNumber(key) {
return key >= 48 && key <= 57
}
function isSpecialKey(key) {
return key == 8 || key == 46 || (key >= 37 && key <= 40) || key == 35 || key == 36 || key == 9 || key == 13
}
function isFullStop(key) {
return key == 190 || key == 110;
}
}
checkedArray = function (id) {
var isOK = true;
if (id == undefined || id == "" || id == 'null' || id == 'undefined') {
isOK = false;
dialogMsg('您没有选中任何项,请您选中后再操作。', 0);
}
return isOK;
}
checkedRow = function (id) {
var isOK = true;
if (id == undefined || id == "" || id == 'null' || id == 'undefined') {
isOK = false;
dialogMsg('您没有选中任何数据项,请选中后再操作!', 0);
} else if (id.split(",").length > 1) {
isOK = false;
dialogMsg('很抱歉,一次只能选择一条记录!', 0);
}
return isOK;
}