mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-09-20 10:37:55 +08:00
调整文件结构,为全面优化javascript代码做准备
This commit is contained in:
@@ -10,168 +10,8 @@
|
||||
</div>
|
||||
|
||||
<div id="detail" style="margin-left: 225px;">
|
||||
<table id="maingrid" class="table table-hover table-striped table-top"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var selectedId = 0;
|
||||
$(document).ready(function () {
|
||||
initZtree();
|
||||
loadDataGrid();
|
||||
});
|
||||
//加载数据到datagrid
|
||||
function loadDataGrid() {
|
||||
//b-jui的datagrid需要重新处理HTML
|
||||
$('#detail').empty()
|
||||
.append('<table id="maingrid" class="table table-hover table-striped table-top"></table>');
|
||||
|
||||
$('#maingrid').datagrid({
|
||||
showToolbar: false,
|
||||
filterThead: false,
|
||||
target: $(this),
|
||||
columns: [
|
||||
{
|
||||
name: 'Id',
|
||||
label: '功能模块流水号',
|
||||
hide: true
|
||||
},
|
||||
{
|
||||
name: 'CascadeId',
|
||||
label: '节点语义ID',
|
||||
width: 80
|
||||
},
|
||||
{
|
||||
name: 'Name',
|
||||
label: '功能模块名称',
|
||||
width: 80
|
||||
},
|
||||
{
|
||||
name: 'Url',
|
||||
label: '主页面URL',
|
||||
width: 80
|
||||
},
|
||||
|
||||
{
|
||||
name: 'ParentId',
|
||||
label: '父节点流水号',
|
||||
hide:true
|
||||
},
|
||||
|
||||
{
|
||||
name: 'IconName',
|
||||
width: 80,
|
||||
label: '节点图标文件名称'
|
||||
},
|
||||
{
|
||||
name: 'Status',
|
||||
width: 80,
|
||||
label: '当前状态'
|
||||
},
|
||||
{
|
||||
name: 'ParentName',
|
||||
width: 80,
|
||||
label: '父节点名称'
|
||||
},
|
||||
{
|
||||
name: 'Vector',
|
||||
width: 80,
|
||||
label: '矢量图标'
|
||||
},
|
||||
{
|
||||
name: 'SortNo',
|
||||
width: 80,
|
||||
label: '排序号'
|
||||
},
|
||||
],
|
||||
dataUrl: '/ModuleManager/Load?orgId=' + selectedId,
|
||||
fullGrid: true,
|
||||
showLinenumber: true,
|
||||
showCheckboxcol: true,
|
||||
paging: true,
|
||||
filterMult: false,
|
||||
showTfoot: false,
|
||||
height: '100%'
|
||||
});
|
||||
}
|
||||
|
||||
function zTreeOnClick(event, treeId, treeNode) {
|
||||
selectedId = treeNode.Id;
|
||||
loadDataGrid();
|
||||
}
|
||||
|
||||
function initZtree() {
|
||||
var setting = {
|
||||
view: {selectedMulti: false},
|
||||
data: {
|
||||
key: {
|
||||
name: 'Name',
|
||||
title: 'Name'
|
||||
},
|
||||
simpleData: {
|
||||
enable: true,
|
||||
idKey: 'Id',
|
||||
pIdKey: 'ParentId',
|
||||
rootPId: 'null'
|
||||
}
|
||||
},
|
||||
callback: {onClick: zTreeOnClick}
|
||||
};
|
||||
$.getJSON('/ModuleManager/LoadModuleWithRoot', function (json) {
|
||||
var zTreeObj = $.fn.zTree.init($('#maintree'), setting, json);
|
||||
zTreeObj.expandAll(true);
|
||||
});
|
||||
}
|
||||
|
||||
//删除
|
||||
function delModule() {
|
||||
var selected = getSelected('#maingrid',2);
|
||||
if (selected == null) return;
|
||||
|
||||
$.getJSON('/ModuleManager/Delete?Id=' + selected, function (data) {
|
||||
if (data.statusCode == "200")
|
||||
loadDataGrid();
|
||||
else {
|
||||
$(this).alertmsg('warn', data.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//自定义的编辑按钮
|
||||
function editModule() {
|
||||
var selected = getSelected('#maingrid',2);
|
||||
if (selected == null) return;
|
||||
|
||||
$(this).dialog({
|
||||
id: 'editDialog',
|
||||
url: '/ModuleManager/Add?id=' + selected,
|
||||
title: '编辑',
|
||||
onClose:function() {
|
||||
refreshModuleGrid();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
//为模块分配按钮
|
||||
function assignButton() {
|
||||
var selected = getSelected('#maingrid',2);
|
||||
if (selected == null) return;
|
||||
|
||||
$(this).dialog({
|
||||
id: 'editDialog',
|
||||
width: 1000,
|
||||
height: 500,
|
||||
mask:true,
|
||||
url: '/ModuleElementManager/Index?id=' + selected,
|
||||
title: '为模块分配按钮'
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function refreshModuleGrid() {
|
||||
$('#maingrid').datagrid('refresh');
|
||||
// loadDataGrid();
|
||||
}
|
||||
</script>
|
||||
<script src="~/BllScripts/modulemanager.js"></script>
|
||||
|
Reference in New Issue
Block a user