@@ -42,6 +42,19 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||||
#endregion | #endregion | ||||
#region 获取数据 | #region 获取数据 | ||||
/// <summary> | |||||
/// 获取树形数据 | |||||
/// </summary> | |||||
/// <param name="parentId">父级id</param> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
[AjaxOnly] | |||||
public ActionResult GetTree(string parentId) | |||||
{ | |||||
var data = cdDeptIBLL.GetTree(parentId); | |||||
return JsonResult(data); | |||||
} | |||||
/// <summary> | /// <summary> | ||||
/// 获取页面显示列表数据 | /// 获取页面显示列表数据 | ||||
@@ -2,9 +2,18 @@ | |||||
ViewBag.Title = "开课计划"; | ViewBag.Title = "开课计划"; | ||||
Layout = "~/Views/Shared/_Index.cshtml"; | Layout = "~/Views/Shared/_Index.cshtml"; | ||||
} | } | ||||
<div class="lr-layout "> | |||||
<div class="lr-layout lr-layout-left-center" id="lr_layout"> | |||||
<div class="lr-layout-left"> | |||||
<div class="lr-layout-wrap"> | |||||
<div class="lr-layout-title lrlt ">学校信息</div> | |||||
<div id="cddeptTree" class="lr-layout-body"></div> | |||||
</div> | |||||
</div> | |||||
<div class="lr-layout-center"> | <div class="lr-layout-center"> | ||||
<div class="lr-layout-wrap lr-layout-wrap-notitle "> | |||||
<div class="lr-layout-wrap"> | |||||
<div class="lr-layout-title"> | |||||
<span id="titleinfo" class="lrlt">未选择学校</span> - <span class="lrlt">专业信息</span> | |||||
</div> | |||||
<div class="lr-layout-tool"> | <div class="lr-layout-tool"> | ||||
<div class="lr-layout-tool-left"> | <div class="lr-layout-tool-left"> | ||||
<div class="lr-layout-tool-item"> | <div class="lr-layout-tool-item"> | ||||
@@ -14,6 +23,10 @@ | |||||
<div class="lr-form-item-title">学校</div> | <div class="lr-form-item-title">学校</div> | ||||
<div id="F_SchoolId"></div> | <div id="F_SchoolId"></div> | ||||
</div> | </div> | ||||
<div class="col-xs-12 lr-form-item"> | |||||
<div class="lr-form-item-title">专业</div> | |||||
<div id="MajorNo"></div> | |||||
</div> | |||||
<div class="col-xs-6 lr-form-item"> | <div class="col-xs-6 lr-form-item"> | ||||
<div class="lr-form-item-title">学年</div> | <div class="lr-form-item-title">学年</div> | ||||
<div id="AcademicYearNo"></div> | <div id="AcademicYearNo"></div> | ||||
@@ -22,14 +35,10 @@ | |||||
<div class="lr-form-item-title">学期</div> | <div class="lr-form-item-title">学期</div> | ||||
<div id="Semester"></div> | <div id="Semester"></div> | ||||
</div> | </div> | ||||
<div class="col-xs-6 lr-form-item"> | |||||
<div class="lr-form-item-title">系部</div> | |||||
<div id="DeptNo"></div> | |||||
</div> | |||||
<div class="col-xs-6 lr-form-item"> | |||||
<div class="lr-form-item-title">专业</div> | |||||
<div id="MajorNo"></div> | |||||
</div> | |||||
@*<div class="col-xs-6 lr-form-item"> | |||||
<div class="lr-form-item-title">系部</div> | |||||
<div id="DeptNo"></div> | |||||
</div>*@ | |||||
<div class="col-xs-12 lr-form-item"> | <div class="col-xs-12 lr-form-item"> | ||||
<div class="lr-form-item-title">年级</div> | <div class="lr-form-item-title">年级</div> | ||||
<div id="Grade"></div> | <div id="Grade"></div> | ||||
@@ -7,8 +7,10 @@ | |||||
var refreshGirdData; | var refreshGirdData; | ||||
var bootstrap = function ($, learun) { | var bootstrap = function ($, learun) { | ||||
"use strict"; | "use strict"; | ||||
var cddeptname = ''; | |||||
var page = { | var page = { | ||||
init: function () { | init: function () { | ||||
page.inittree(); | |||||
page.initGird(); | page.initGird(); | ||||
page.bind(); | page.bind(); | ||||
}, | }, | ||||
@@ -33,39 +35,40 @@ var bootstrap = function ($, learun) { | |||||
text: 'text' | text: 'text' | ||||
}); | }); | ||||
$('#Semester').lrDataItemSelect({ code: 'Semester' }); | $('#Semester').lrDataItemSelect({ code: 'Semester' }); | ||||
$('#DeptNo').lrselect({ | |||||
url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo', | |||||
value: 'deptno', | |||||
text: 'deptname', | |||||
maxHeight: 200, | |||||
select: function (item) { | |||||
var NDeptNo = $("#DeptNo").lrselectGet(); | |||||
if (NDeptNo != null && NDeptNo != "" && NDeptNo != undefined) { | |||||
$('#MajorNo').lrselectRefresh({ | |||||
url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo', | |||||
param: { strWhere: " 1=1 and CheckMark=1 and deptno in (" + NDeptNo + ")" }, | |||||
value: "majorno", | |||||
text: "majorname", | |||||
maxHeight: 200 | |||||
}); | |||||
} else { | |||||
$('#MajorNo').lrselectRefresh({ | |||||
url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo', | |||||
param: { strWhere: " 1=1 and CheckMark=1 and deptno ='' " }, | |||||
value: "majorno", | |||||
text: "majorname", | |||||
maxHeight: 200 | |||||
}); | |||||
} | |||||
} | |||||
}) | |||||
//$('#DeptNo').lrselect({ | |||||
// url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo', | |||||
// value: 'deptno', | |||||
// text: 'deptname', | |||||
// maxHeight: 200, | |||||
// select: function(item) { | |||||
// var NDeptNo = $("#DeptNo").lrselectGet(); | |||||
// if (NDeptNo != null && NDeptNo != "" && NDeptNo != undefined) { | |||||
// $('#MajorNo').lrselectRefresh({ | |||||
// url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo', | |||||
// param: { strWhere: " 1=1 and CheckMark=1 and deptno in (" + NDeptNo + ")" }, | |||||
// value: "majorno", | |||||
// text: "majorname", | |||||
// maxHeight: 200 | |||||
// }); | |||||
// } else { | |||||
// $('#MajorNo').lrselectRefresh({ | |||||
// url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo', | |||||
// param: { strWhere: " 1=1 and CheckMark=1 and deptno ='' " }, | |||||
// value: "majorno", | |||||
// text: "majorname", | |||||
// maxHeight: 200 | |||||
// }); | |||||
// } | |||||
// } | |||||
//}); | |||||
$("#MajorNo").lrselect(); | $("#MajorNo").lrselect(); | ||||
$('#LessonNo').lrselect({ | $('#LessonNo').lrselect({ | ||||
placeholder: "请选择课程", | placeholder: "请选择课程", | ||||
allowSearch: true, | allowSearch: true, | ||||
url: top.$.rootUrl + '/EducationalAdministration/StuScore/GetLessonNoDataOfAllWithNo', | url: top.$.rootUrl + '/EducationalAdministration/StuScore/GetLessonNoDataOfAllWithNo', | ||||
value: 'value', | value: 'value', | ||||
text: 'text' | |||||
text: 'text', | |||||
maxHeight: 200 | |||||
}); | }); | ||||
// 刷新 | // 刷新 | ||||
$('#lr_refresh').on('click', function () { | $('#lr_refresh').on('click', function () { | ||||
@@ -114,6 +117,37 @@ var bootstrap = function ($, learun) { | |||||
} | } | ||||
}); | }); | ||||
}, | }, | ||||
inittree: function () { | |||||
$('#cddeptTree').lrtree({ | |||||
url: top.$.rootUrl + '/EducationalAdministration/CdDept/GetTree', | |||||
param: { parentId: '0' }, | |||||
nodeClick: page.treeNodeClick | |||||
}); | |||||
//$('#cddeptTree').lrtreeSet('setValue', '53298b7a-404c-4337-aa7f-80b2a4ca6681'); | |||||
}, | |||||
treeNodeClick: function (item) { | |||||
cddeptname = item.id; | |||||
$('#titleinfo').text(item.text); | |||||
page.search(); | |||||
var NDeptNo = item.id; | |||||
if (NDeptNo != null && NDeptNo != "" && NDeptNo != undefined) { | |||||
$('#MajorNo').lrselectRefresh({ | |||||
url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo', | |||||
param: { strWhere: " 1=1 and CheckMark=1 and deptno in (" + NDeptNo + ")" }, | |||||
value: "majorno", | |||||
text: "majorname", | |||||
maxHeight: 200 | |||||
}); | |||||
} else { | |||||
$('#MajorNo').lrselectRefresh({ | |||||
url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo', | |||||
param: { strWhere: " 1=1 and CheckMark=1 and deptno ='' " }, | |||||
value: "majorno", | |||||
text: "majorname", | |||||
maxHeight: 200 | |||||
}); | |||||
} | |||||
}, | |||||
// 初始化列表 | // 初始化列表 | ||||
initGird: function () { | initGird: function () { | ||||
$('#gridtable').lrAuthorizeJfGrid({ | $('#gridtable').lrAuthorizeJfGrid({ | ||||
@@ -204,6 +238,7 @@ var bootstrap = function ($, learun) { | |||||
}, | }, | ||||
search: function (param) { | search: function (param) { | ||||
param = param || {}; | param = param || {}; | ||||
param.DeptNo = cddeptname; | |||||
$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); | $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); | ||||
} | } | ||||
}; | }; | ||||
@@ -23,7 +23,7 @@ | |||||
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\..\</SolutionDir> | <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\..\</SolutionDir> | ||||
<RestorePackages>true</RestorePackages> | <RestorePackages>true</RestorePackages> | ||||
<UseGlobalApplicationHostFile /> | <UseGlobalApplicationHostFile /> | ||||
<Use64BitIISExpress /> | |||||
<Use64BitIISExpress>false</Use64BitIISExpress> | |||||
<SccProjectName> | <SccProjectName> | ||||
</SccProjectName> | </SccProjectName> | ||||
<SccLocalPath> | <SccLocalPath> | ||||
@@ -319,6 +319,7 @@ | |||||
<Compile Include="Areas\EducationalAdministration\Controllers\ArrangeLessonTermAttemperController.cs" /> | <Compile Include="Areas\EducationalAdministration\Controllers\ArrangeLessonTermAttemperController.cs" /> | ||||
<Compile Include="Areas\EducationalAdministration\Controllers\CertificateManageController.cs" /> | <Compile Include="Areas\EducationalAdministration\Controllers\CertificateManageController.cs" /> | ||||
<Compile Include="Areas\EducationalAdministration\Controllers\CertificateResultController.cs" /> | <Compile Include="Areas\EducationalAdministration\Controllers\CertificateResultController.cs" /> | ||||
<Compile Include="Areas\EducationalAdministration\Controllers\ClassPlanController.cs" /> | |||||
<Compile Include="Areas\EducationalAdministration\Controllers\DispatchController.cs" /> | <Compile Include="Areas\EducationalAdministration\Controllers\DispatchController.cs" /> | ||||
<Compile Include="Areas\EducationalAdministration\Controllers\EvaCodeOfContuctController.cs" /> | <Compile Include="Areas\EducationalAdministration\Controllers\EvaCodeOfContuctController.cs" /> | ||||
<Compile Include="Areas\EducationalAdministration\Controllers\EvaDormitoryInteriorController.cs" /> | <Compile Include="Areas\EducationalAdministration\Controllers\EvaDormitoryInteriorController.cs" /> | ||||
@@ -936,6 +937,8 @@ | |||||
<Content Include="Areas\EducationalAdministration\Views\CertificateResult\Form.js" /> | <Content Include="Areas\EducationalAdministration\Views\CertificateResult\Form.js" /> | ||||
<Content Include="Areas\EducationalAdministration\Views\CertificateResult\Index.js" /> | <Content Include="Areas\EducationalAdministration\Views\CertificateResult\Index.js" /> | ||||
<Content Include="Areas\EducationalAdministration\Views\ClassInfo\FormType.js" /> | <Content Include="Areas\EducationalAdministration\Views\ClassInfo\FormType.js" /> | ||||
<Content Include="Areas\EducationalAdministration\Views\ClassPlan\Form.js" /> | |||||
<Content Include="Areas\EducationalAdministration\Views\ClassPlan\Index.js" /> | |||||
<Content Include="Areas\EducationalAdministration\Views\Dispatch\Form.js" /> | <Content Include="Areas\EducationalAdministration\Views\Dispatch\Form.js" /> | ||||
<Content Include="Areas\EducationalAdministration\Views\Dispatch\FormView.js" /> | <Content Include="Areas\EducationalAdministration\Views\Dispatch\FormView.js" /> | ||||
<Content Include="Areas\EducationalAdministration\Views\Dispatch\Index.js" /> | <Content Include="Areas\EducationalAdministration\Views\Dispatch\Index.js" /> | ||||
@@ -7404,6 +7407,8 @@ | |||||
<Content Include="Areas\EducationalAdministration\Views\Dispatch\SelectForm.cshtml" /> | <Content Include="Areas\EducationalAdministration\Views\Dispatch\SelectForm.cshtml" /> | ||||
<Content Include="Areas\LR_SystemModule\Views\Log\FormDAM.cshtml" /> | <Content Include="Areas\LR_SystemModule\Views\Log\FormDAM.cshtml" /> | ||||
<Content Include="Areas\LR_SystemModule\Views\Log\IndexDAM.cshtml" /> | <Content Include="Areas\LR_SystemModule\Views\Log\IndexDAM.cshtml" /> | ||||
<Content Include="Areas\EducationalAdministration\Views\ClassPlan\Form.cshtml" /> | |||||
<Content Include="Areas\EducationalAdministration\Views\ClassPlan\Index.cshtml" /> | |||||
<None Include="Properties\PublishProfiles\FolderProfile.pubxml" /> | <None Include="Properties\PublishProfiles\FolderProfile.pubxml" /> | ||||
<Content Include="Views\Login\Default-beifen.cshtml" /> | <Content Include="Views\Login\Default-beifen.cshtml" /> | ||||
<None Include="Properties\PublishProfiles\FolderProfile1.pubxml" /> | <None Include="Properties\PublishProfiles\FolderProfile1.pubxml" /> | ||||
@@ -7521,11 +7526,11 @@ | |||||
<VisualStudio> | <VisualStudio> | ||||
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}"> | <FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}"> | ||||
<WebProjectProperties> | <WebProjectProperties> | ||||
<UseIIS>False</UseIIS> | |||||
<AutoAssignPort>True</AutoAssignPort> | |||||
<DevelopmentServerPort>20472</DevelopmentServerPort> | |||||
<DevelopmentServerVPath>/</DevelopmentServerVPath> | |||||
<IISUrl>http://localhost:20873/</IISUrl> | |||||
<UseIIS>False</UseIIS> | |||||
<AutoAssignPort>True</AutoAssignPort> | |||||
<DevelopmentServerPort>20472</DevelopmentServerPort> | |||||
<DevelopmentServerVPath>/</DevelopmentServerVPath> | |||||
<IISUrl>http://localhost:20873/</IISUrl> | |||||
<NTLMAuthentication>False</NTLMAuthentication> | <NTLMAuthentication>False</NTLMAuthentication> | ||||
<UseCustomServer>False</UseCustomServer> | <UseCustomServer>False</UseCustomServer> | ||||
<CustomServerUrl> | <CustomServerUrl> | ||||
@@ -26,98 +26,113 @@ | |||||
var $frameMain = $('#lr_frame_main'); | var $frameMain = $('#lr_frame_main'); | ||||
if (iframeIdList[module.F_ModuleId] == undefined || iframeIdList[module.F_ModuleId] == null) { | if (iframeIdList[module.F_ModuleId] == undefined || iframeIdList[module.F_ModuleId] == null) { | ||||
// 隐藏之前的tab和窗口 | |||||
if (learun.frameTab.iframeId != '') { | |||||
$tabsUl.find('#lr_tab_' + learun.frameTab.iframeId).removeClass('active'); | |||||
$frameMain.find('#lr_iframe_' + learun.frameTab.iframeId).removeClass('active'); | |||||
iframeIdList[learun.frameTab.iframeId] = 0; | |||||
} | |||||
var parentId = learun.frameTab.iframeId; | |||||
learun.frameTab.iframeId = module.F_ModuleId; | |||||
iframeIdList[learun.frameTab.iframeId] = 1; | |||||
// 打开一个功能模块tab_iframe页面 | |||||
var $tabItem = $('<li class="lr-frame-tabItem active" id="lr_tab_' + module.F_ModuleId + '" parent-id="' + parentId + '" ><span>' + module.F_FullName + '</span></li>'); | |||||
// 翻译 | |||||
learun.language.get(module.F_FullName, function (text) { | |||||
$tabItem.find('span').text(text); | |||||
if (!notAllowClosed) { | |||||
$tabItem.append('<span class="reomve" title="关闭窗口"></span>'); | |||||
if (module.F_UrlAddress != null && module.F_UrlAddress != "" && module.F_UrlAddress != undefined) { | |||||
// 隐藏之前的tab和窗口 | |||||
if (learun.frameTab.iframeId != '') { | |||||
$tabsUl.find('#lr_tab_' + learun.frameTab.iframeId).removeClass('active'); | |||||
$frameMain.find('#lr_iframe_' + learun.frameTab.iframeId).removeClass('active'); | |||||
iframeIdList[learun.frameTab.iframeId] = 0; | |||||
} | } | ||||
}); | |||||
var parentId = learun.frameTab.iframeId; | |||||
learun.frameTab.iframeId = module.F_ModuleId; | |||||
iframeIdList[learun.frameTab.iframeId] = 1; | |||||
// 打开一个功能模块tab_iframe页面 | |||||
var $tabItem = $('<li class="lr-frame-tabItem active" id="lr_tab_' + | |||||
module.F_ModuleId + | |||||
'" parent-id="' + | |||||
parentId + | |||||
'" ><span>' + | |||||
module.F_FullName + | |||||
'</span></li>'); | |||||
// 翻译 | |||||
learun.language.get(module.F_FullName, | |||||
function (text) { | |||||
$tabItem.find('span').text(text); | |||||
if (!notAllowClosed) { | |||||
$tabItem.append('<span class="reomve" title="关闭窗口"></span>'); | |||||
} | |||||
}); | |||||
var $iframe = $('<iframe class="lr-frame-iframe active" id="lr_iframe_' + module.F_ModuleId + '" frameborder="0" src="' + $.rootUrl + module.F_UrlAddress + '"></iframe>'); | |||||
$tabsUl.append($tabItem); | |||||
$frameMain.append($iframe); | |||||
var w = 0; | |||||
var width = $tabsUl.children().each(function () { | |||||
w += $(this).outerWidth(); | |||||
}); | |||||
$tabsUl.css({ 'width': w }); | |||||
$tabsUl.parent().css({ 'width': w }); | |||||
var $iframe = $('<iframe class="lr-frame-iframe active" id="lr_iframe_' + | |||||
module.F_ModuleId + | |||||
'" frameborder="0" src="' + | |||||
$.rootUrl + | |||||
module.F_UrlAddress + | |||||
'"></iframe>'); | |||||
$tabsUl.append($tabItem); | |||||
$frameMain.append($iframe); | |||||
var w = 0; | |||||
var width = $tabsUl.children().each(function () { | |||||
w += $(this).outerWidth(); | |||||
}); | |||||
$tabsUl.css({ 'width': w }); | |||||
$tabsUl.parent().css({ 'width': w }); | |||||
$(".lr-frame-tabs-wrap").lrscrollSet('moveRight'); | |||||
$(".lr-frame-tabs-wrap").lrscrollSet('moveRight'); | |||||
//绑定一个点击事件 | |||||
$tabItem.on('click', function () { | |||||
var id = $(this).attr('id').replace('lr_tab_', ''); | |||||
learun.frameTab.focus(id); | |||||
}); | |||||
$tabItem.find('.reomve').on('click', function () { | |||||
var id = $(this).parent().attr('id').replace('lr_tab_', ''); | |||||
learun.frameTab.close(id); | |||||
return false; | |||||
}); | |||||
if (!!learun.frameTab.opencallback) { | |||||
learun.frameTab.opencallback(); | |||||
} | |||||
if (!notAllowClosed) { | |||||
var loginInfo = learun.clientdata.get(['userinfo']); | |||||
var account = ''; | |||||
if (loginInfo) { | |||||
account = loginInfo.account; | |||||
//绑定一个点击事件 | |||||
$tabItem.on('click', | |||||
function () { | |||||
var id = $(this).attr('id').replace('lr_tab_', ''); | |||||
learun.frameTab.focus(id); | |||||
}); | |||||
$tabItem.find('.reomve').on('click', | |||||
function () { | |||||
var id = $(this).parent().attr('id').replace('lr_tab_', ''); | |||||
learun.frameTab.close(id); | |||||
return false; | |||||
}); | |||||
if (!!learun.frameTab.opencallback) { | |||||
learun.frameTab.opencallback(); | |||||
} | } | ||||
if (!notAllowClosed) { | |||||
var loginInfo = learun.clientdata.get(['userinfo']); | |||||
var account = ''; | |||||
if (loginInfo) { | |||||
account = loginInfo.account; | |||||
} | |||||
$.ajax({ | |||||
url: top.$.rootUrl + "/Home/VisitModule", | |||||
headers: { account: account }, | |||||
data: { moduleName: module.F_FullName, moduleUrl: module.F_UrlAddress }, | |||||
type: "post", | |||||
dataType: "json", | |||||
success: function (res) { | |||||
if (res.code == learun.httpCode.nologin) { | |||||
var _topUrl = top.$.rootUrl + '/Login/Index'; | |||||
switch (res.info) { | |||||
case 'nologin': | |||||
break; | |||||
case 'noip': | |||||
_topUrl += '?error=ip'; | |||||
break; | |||||
case 'notime': | |||||
_topUrl += '?error=time'; | |||||
break; | |||||
case 'other': | |||||
_topUrl += '?error=other'; | |||||
break; | |||||
$.ajax({ | |||||
url: top.$.rootUrl + "/Home/VisitModule", | |||||
headers: { account: account }, | |||||
data: { moduleName: module.F_FullName, moduleUrl: module.F_UrlAddress }, | |||||
type: "post", | |||||
dataType: "json", | |||||
success: function (res) { | |||||
if (res.code == learun.httpCode.nologin) { | |||||
var _topUrl = top.$.rootUrl + '/Login/Index'; | |||||
switch (res.info) { | |||||
case 'nologin': | |||||
break; | |||||
case 'noip': | |||||
_topUrl += '?error=ip'; | |||||
break; | |||||
case 'notime': | |||||
_topUrl += '?error=time'; | |||||
break; | |||||
case 'other': | |||||
_topUrl += '?error=other'; | |||||
break; | |||||
} | |||||
top.window.location.href = _topUrl; | |||||
return; | |||||
} | } | ||||
top.window.location.href = _topUrl; | |||||
return; | |||||
}, | |||||
error: function (XMLHttpRequest, textStatus, errorThrown) { | |||||
top.window.location.href = top.$.rootUrl + '/Login/Index'; | |||||
}, | |||||
beforeSend: function () { | |||||
}, | |||||
complete: function () { | |||||
} | } | ||||
}, | |||||
error: function (XMLHttpRequest, textStatus, errorThrown) { | |||||
top.window.location.href = top.$.rootUrl + '/Login/Index'; | |||||
}, | |||||
beforeSend: function () { | |||||
}, | |||||
complete: function () { | |||||
} | |||||
}); | |||||
}); | |||||
} | |||||
} | } | ||||
} | } | ||||
else { | else { | ||||
@@ -184,7 +199,7 @@ | |||||
} | } | ||||
} | } | ||||
// 获取当前窗口 | // 获取当前窗口 | ||||
,currentIframe: function () { | |||||
, currentIframe: function () { | |||||
var ifameId = 'lr_iframe_' + learun.frameTab.iframeId; | var ifameId = 'lr_iframe_' + learun.frameTab.iframeId; | ||||
if (top.frames[ifameId].contentWindow != undefined) { | if (top.frames[ifameId].contentWindow != undefined) { | ||||
return top.frames[ifameId].contentWindow; | return top.frames[ifameId].contentWindow; | ||||
@@ -193,8 +208,8 @@ | |||||
return top.frames[ifameId]; | return top.frames[ifameId]; | ||||
} | } | ||||
} | } | ||||
,parentIframe: function () { | |||||
var ifameId = 'lr_iframe_' + top.$('#lr_tab_'+learun.frameTab.iframeId).attr('parent-id'); | |||||
, parentIframe: function () { | |||||
var ifameId = 'lr_iframe_' + top.$('#lr_tab_' + learun.frameTab.iframeId).attr('parent-id'); | |||||
if (top.frames[ifameId].contentWindow != undefined) { | if (top.frames[ifameId].contentWindow != undefined) { | ||||
return top.frames[ifameId].contentWindow; | return top.frames[ifameId].contentWindow; | ||||
} | } | ||||
@@ -202,7 +217,7 @@ | |||||
return top.frames[ifameId]; | return top.frames[ifameId]; | ||||
} | } | ||||
} | } | ||||
, wfFormIframe: function () { | |||||
, wfFormIframe: function () { | |||||
var currentIframe = learun.frameTab.currentIframe(); | var currentIframe = learun.frameTab.currentIframe(); | ||||
var iframeId = currentIframe.$('#form_list_iframes .form-list-iframe.active').attr('id'); | var iframeId = currentIframe.$('#form_list_iframes .form-list-iframe.active').attr('id'); | ||||
return learun.iframe(iframeId, currentIframe.frames); | return learun.iframe(iframeId, currentIframe.frames); | ||||
@@ -210,8 +225,8 @@ | |||||
, closeByParam: function (name, value) { | , closeByParam: function (name, value) { | ||||
$('#lr_frame_tabs_ul li').each(function () { | $('#lr_frame_tabs_ul li').each(function () { | ||||
var id = $(this).attr('id').replace('lr_tab_', ''); | var id = $(this).attr('id').replace('lr_tab_', ''); | ||||
var frameObj = top.frames[ 'lr_iframe_' + id]; | |||||
var frameObj = top.frames['lr_iframe_' + id]; | |||||
if (frameObj.contentWindow != undefined) { | if (frameObj.contentWindow != undefined) { | ||||
frameObj = frameObj.contentWindow; | frameObj = frameObj.contentWindow; | ||||
} | } | ||||
@@ -2,6 +2,8 @@ | |||||
using System; | using System; | ||||
using System.Data; | using System.Data; | ||||
using System.Collections.Generic; | using System.Collections.Generic; | ||||
using Learun.Cache.Base; | |||||
using Learun.Cache.Factory; | |||||
namespace Learun.Application.TwoDevelopment.EducationalAdministration | namespace Learun.Application.TwoDevelopment.EducationalAdministration | ||||
{ | { | ||||
@@ -16,6 +18,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
{ | { | ||||
private CdDeptService cdDeptService = new CdDeptService(); | private CdDeptService cdDeptService = new CdDeptService(); | ||||
#region 缓存定义 | |||||
private ICache cache = CacheFactory.CaChe(); | |||||
private string cacheKey = "Learun_adms_cddept"; | |||||
#endregion | |||||
#region 获取数据 | #region 获取数据 | ||||
/// <summary> | /// <summary> | ||||
@@ -201,5 +208,72 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
#endregion | #endregion | ||||
#region 扩展数据 | |||||
/// <summary> | |||||
/// 获取列表数据 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
public List<CdDeptEntity> GetList() | |||||
{ | |||||
try | |||||
{ | |||||
List<CdDeptEntity> list = cache.Read<List<CdDeptEntity>>(cacheKey); | |||||
if (list == null) | |||||
{ | |||||
list = (List<CdDeptEntity>)cdDeptService.GetList(); | |||||
cache.Write<List<CdDeptEntity>>(cacheKey, list, CacheId.company); | |||||
} | |||||
return list; | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowBusinessException(ex); | |||||
} | |||||
} | |||||
} | |||||
public List<TreeModel> GetTree(string parentId) | |||||
{ | |||||
try | |||||
{ | |||||
List<CdDeptEntity> list = GetList(); | |||||
List<TreeModel> treeList = new List<TreeModel>(); | |||||
foreach (var item in list) | |||||
{ | |||||
TreeModel node = new TreeModel | |||||
{ | |||||
id = item.DeptNo, | |||||
text = item.DeptName, | |||||
value = item.DeptNo, | |||||
showcheck = false, | |||||
checkstate = 0, | |||||
isexpand = true, | |||||
parentId = item.DeptId | |||||
}; | |||||
treeList.Add(node); | |||||
} | |||||
return treeList.ToTree(); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowBusinessException(ex); | |||||
} | |||||
} | |||||
} | |||||
#endregion | |||||
} | } | ||||
} | } |
@@ -55,5 +55,20 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
IEnumerable<CdDeptEntity> GetListBySchoolId(string schoolId); | IEnumerable<CdDeptEntity> GetListBySchoolId(string schoolId); | ||||
IEnumerable<CdDeptEntity> GetAllList(); | IEnumerable<CdDeptEntity> GetAllList(); | ||||
#region 扩展数据 | |||||
/// <summary> | |||||
/// 获取树形数据 | |||||
/// </summary> | |||||
/// <param name="parentId">父级id</param> | |||||
/// <returns></returns> | |||||
List<TreeModel> GetTree(string parentId); | |||||
/// <summary> | |||||
/// 获取列表数据 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
List<CdDeptEntity> GetList(); | |||||
#endregion | |||||
} | } | ||||
} | } |
@@ -250,5 +250,36 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
} | } | ||||
} | } | ||||
} | } | ||||
#region 扩展数据 | |||||
/// <summary> | |||||
/// 获取公司列表信息(全部) | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
public IEnumerable<CdDeptEntity> GetList() | |||||
{ | |||||
try | |||||
{ | |||||
var strSql = new StringBuilder(); | |||||
strSql.Append("SELECT "); | |||||
strSql.Append(" * "); | |||||
strSql.Append(" FROM CdDept t WHERE 1=1 order by t.deptSort "); | |||||
return this.BaseRepository("CollegeMIS").FindList<CdDeptEntity>(strSql.ToString()); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowServiceException(ex); | |||||
} | |||||
} | |||||
} | |||||
#endregion | |||||
} | } | ||||
} | } |