mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-07-16 07:59:54 +08:00
优化界面编辑
This commit is contained in:
parent
5fc7dd3466
commit
42f4ed9d7b
@ -25,6 +25,11 @@ namespace OpenAuth.Mvc.Controllers
|
||||
return View();
|
||||
}
|
||||
|
||||
public ActionResult LookupParent()
|
||||
{
|
||||
return View();
|
||||
}
|
||||
|
||||
|
||||
public string LoadOrg()
|
||||
{
|
||||
|
@ -610,6 +610,9 @@
|
||||
<ItemGroup>
|
||||
<Content Include="Views\Home\Main.cshtml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Views\OrgManager\LookupParent.cshtml" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup>
|
||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
|
||||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
||||
|
@ -1,11 +1,10 @@
|
||||
<div class="bjui-pageContent">
|
||||
<div class="clearfix">
|
||||
<div style="float: left; width: 220px; height: 240px; overflow: auto;" class="table table-bordered">
|
||||
<div style="float: left; width: 220px; overflow: auto;" class="table table-bordered">
|
||||
<ul id="orgTree" class="ztree"></ul>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="ztree-detail" style="margin-left: 225px; width: auto;">
|
||||
<div id="ztree-detail" style="margin-left: 225px; width: auto;height: auto">
|
||||
<table id="test-datagrid-array" data-width="100%" data-height="100%" class="table table-bordered"></table>
|
||||
</div>
|
||||
</div>
|
||||
@ -22,19 +21,43 @@
|
||||
gridTitle: '机构列表显示',
|
||||
showToolbar: true,
|
||||
toolbarItem: 'add, edit, refresh, |, del',
|
||||
//toolbarCustom: '<button class=" btn-green" data-icon="plus" type="button">添加</button>' +
|
||||
// '<button class=" btn-green" onclick="editOrg()" data-icon="pencil" type="button">编辑</button>',
|
||||
columns: [
|
||||
{
|
||||
name: 'Id',
|
||||
hide: true
|
||||
label:'Id',
|
||||
hide: true,
|
||||
edit:false
|
||||
},
|
||||
{
|
||||
name: 'CascadeId',
|
||||
label: '唯一标识',
|
||||
edit:false
|
||||
},
|
||||
{
|
||||
name: 'Name',
|
||||
width: '150',
|
||||
label: '机构名称'
|
||||
},
|
||||
{
|
||||
name: 'ParentName',
|
||||
label: '上级机构',
|
||||
type: 'lookup',
|
||||
attrs: { 'data-url': 'OrgManager/LookupParent' }
|
||||
},
|
||||
{
|
||||
name: 'Status',
|
||||
label: '禁用',
|
||||
type: 'boolean',
|
||||
align: 'center',
|
||||
render: function (value) {
|
||||
return (value && String(value) == 'true') ?
|
||||
'<span style="color:red;">是</span>' : '否'
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'CreateTime',
|
||||
width: '120',
|
||||
label: '登记日期'
|
||||
}
|
||||
],
|
||||
@ -116,5 +139,12 @@
|
||||
}
|
||||
return selected;
|
||||
}
|
||||
|
||||
//自定义的编辑按钮
|
||||
function editOrg() {
|
||||
var selected = getSelected();
|
||||
if (selected == null) return;
|
||||
|
||||
}
|
||||
//@@ sourceURL=orgIndex.js
|
||||
</script>
|
60
OpenAuth.Mvc/Views/OrgManager/LookupParent.cshtml
Normal file
60
OpenAuth.Mvc/Views/OrgManager/LookupParent.cshtml
Normal file
@ -0,0 +1,60 @@
|
||||
@model dynamic
|
||||
|
||||
@{
|
||||
ViewBag.Title = "title";
|
||||
Layout = null;
|
||||
}
|
||||
<div class="bjui-pageContent">
|
||||
<div style="float: left; width: 100%; height: 240px; overflow: auto;" class="table table-bordered">
|
||||
<ul id="lookupTree" class="ztree"></ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bjui-pageFooter">
|
||||
<ul>
|
||||
<li>
|
||||
<a href="javascript:;" id="btnSelected" data-toggle="lookupback"
|
||||
data-args="{nationid:'A001', nation:'CN'}"
|
||||
class="btn btn-blue" title="选择本项" data-icon="check">选择</a>
|
||||
</li>
|
||||
<li><button type="button" class="btn-close" data-icon="close">关闭</button></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function () {
|
||||
Init();
|
||||
});
|
||||
function Init() {
|
||||
var setting = {
|
||||
view: {
|
||||
selectedMulti: false
|
||||
},
|
||||
data: {
|
||||
key: {
|
||||
name: 'Name',
|
||||
title: 'Name'
|
||||
},
|
||||
simpleData: {
|
||||
enable: true,
|
||||
idKey: 'Id',
|
||||
pIdKey: 'ParentId',
|
||||
rootPId: 'null'
|
||||
}
|
||||
},
|
||||
callback: {
|
||||
onClick: zTreeOnClick
|
||||
}
|
||||
};
|
||||
$.getJSON('OrgManager/LoadOrg', function (json) {
|
||||
var zTreeObj = $.fn.zTree.init($('#lookupTree'), setting, json);
|
||||
zTreeObj.expandAll(true);
|
||||
});
|
||||
}
|
||||
|
||||
function zTreeOnClick(event, treeId, treeNode) {
|
||||
var selected = "{ParentName:'" + treeNode.Name + "', ParentId:" + treeNode.Id + "}";
|
||||
$("#btnSelected").attr("data-args",selected);
|
||||
}
|
||||
|
||||
//@@ sourceURL=lookupParent.js
|
||||
</script>
|
Loading…
Reference in New Issue
Block a user