mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-07-18 04:33:27 +08:00
优化界面编辑
This commit is contained in:
parent
5fc7dd3466
commit
42f4ed9d7b
@ -25,6 +25,11 @@ namespace OpenAuth.Mvc.Controllers
|
|||||||
return View();
|
return View();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ActionResult LookupParent()
|
||||||
|
{
|
||||||
|
return View();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public string LoadOrg()
|
public string LoadOrg()
|
||||||
{
|
{
|
||||||
|
@ -610,6 +610,9 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Content Include="Views\Home\Main.cshtml" />
|
<Content Include="Views\Home\Main.cshtml" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="Views\OrgManager\LookupParent.cshtml" />
|
||||||
|
</ItemGroup>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
|
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
|
||||||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
||||||
|
@ -1,11 +1,10 @@
|
|||||||
<div class="bjui-pageContent">
|
<div class="bjui-pageContent">
|
||||||
<div class="clearfix">
|
<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>
|
<ul id="orgTree" class="ztree"></ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div id="ztree-detail" style="margin-left: 225px; width: auto;height: auto">
|
||||||
<div id="ztree-detail" style="margin-left: 225px; width: auto;">
|
|
||||||
<table id="test-datagrid-array" data-width="100%" data-height="100%" class="table table-bordered"></table>
|
<table id="test-datagrid-array" data-width="100%" data-height="100%" class="table table-bordered"></table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -22,19 +21,43 @@
|
|||||||
gridTitle: '机构列表显示',
|
gridTitle: '机构列表显示',
|
||||||
showToolbar: true,
|
showToolbar: true,
|
||||||
toolbarItem: 'add, edit, refresh, |, del',
|
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: [
|
columns: [
|
||||||
{
|
{
|
||||||
name: 'Id',
|
name: 'Id',
|
||||||
hide: true
|
label:'Id',
|
||||||
|
hide: true,
|
||||||
|
edit:false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'CascadeId',
|
||||||
|
label: '唯一标识',
|
||||||
|
edit:false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Name',
|
name: 'Name',
|
||||||
width: '150',
|
|
||||||
label: '机构名称'
|
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',
|
name: 'CreateTime',
|
||||||
width: '120',
|
|
||||||
label: '登记日期'
|
label: '登记日期'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -116,5 +139,12 @@
|
|||||||
}
|
}
|
||||||
return selected;
|
return selected;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//自定义的编辑按钮
|
||||||
|
function editOrg() {
|
||||||
|
var selected = getSelected();
|
||||||
|
if (selected == null) return;
|
||||||
|
|
||||||
|
}
|
||||||
//@@ sourceURL=orgIndex.js
|
//@@ sourceURL=orgIndex.js
|
||||||
</script>
|
</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