diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/CdDeptController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/CdDeptController.cs index 66f6f7c25..707ffd038 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/CdDeptController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/CdDeptController.cs @@ -42,6 +42,19 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers #endregion #region 获取数据 + /// + /// 获取树形数据 + /// + /// 父级id + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetTree(string parentId) + { + var data = cdDeptIBLL.GetTree(parentId); + return JsonResult(data); + } + /// /// 获取页面显示列表数据 diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlan/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlan/Index.cshtml index a2de08dec..ccbafef49 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlan/Index.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlan/Index.cshtml @@ -2,9 +2,18 @@ ViewBag.Title = "开课计划"; Layout = "~/Views/Shared/_Index.cshtml"; } -
+
+
+
+
学校信息
+
+
+
-
+
+
+ 未选择学校 - 专业信息 +
@@ -14,6 +23,10 @@
学校
+
+
专业
+
+
学年
@@ -22,14 +35,10 @@
学期
-
-
系部
-
-
-
-
专业
-
-
+ @*
+
系部
+
+
*@
年级
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlan/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlan/Index.js index c6ffa3037..1def00728 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlan/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlan/Index.js @@ -7,8 +7,10 @@ var refreshGirdData; var bootstrap = function ($, learun) { "use strict"; + var cddeptname = ''; var page = { init: function () { + page.inittree(); page.initGird(); page.bind(); }, @@ -33,39 +35,40 @@ var bootstrap = function ($, learun) { text: 'text' }); $('#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(); $('#LessonNo').lrselect({ placeholder: "请选择课程", allowSearch: true, url: top.$.rootUrl + '/EducationalAdministration/StuScore/GetLessonNoDataOfAllWithNo', value: 'value', - text: 'text' + text: 'text', + maxHeight: 200 }); // 刷新 $('#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 () { $('#gridtable').lrAuthorizeJfGrid({ @@ -204,6 +238,7 @@ var bootstrap = function ($, learun) { }, search: function (param) { param = param || {}; + param.DeptNo = cddeptname; $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); } }; diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj b/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj index 74f2e04ed..ca870978b 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj @@ -23,7 +23,7 @@ ..\..\..\ true - + false @@ -319,6 +319,7 @@ + @@ -936,6 +937,8 @@ + + @@ -7404,6 +7407,8 @@ + + @@ -7521,11 +7526,11 @@ - False - True - 20472 - / - http://localhost:20873/ + False + True + 20472 + / + http://localhost:20873/ False False diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/script/lr-tabs.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/script/lr-tabs.js index 4fe480818..b7c60472c 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/script/lr-tabs.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/script/lr-tabs.js @@ -26,98 +26,113 @@ var $frameMain = $('#lr_frame_main'); 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 = $('
  • ' + module.F_FullName + '
  • '); - // 翻译 - learun.language.get(module.F_FullName, function (text) { - $tabItem.find('span').text(text); - if (!notAllowClosed) { - $tabItem.append(''); + 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 = $('
  • ' + + module.F_FullName + + '
  • '); + // 翻译 + learun.language.get(module.F_FullName, + function (text) { + $tabItem.find('span').text(text); + if (!notAllowClosed) { + $tabItem.append(''); + } + }); - - var $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 = $(''); + $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 { @@ -184,7 +199,7 @@ } } // 获取当前窗口 - ,currentIframe: function () { + , currentIframe: function () { var ifameId = 'lr_iframe_' + learun.frameTab.iframeId; if (top.frames[ifameId].contentWindow != undefined) { return top.frames[ifameId].contentWindow; @@ -193,8 +208,8 @@ 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) { return top.frames[ifameId].contentWindow; } @@ -202,7 +217,7 @@ return top.frames[ifameId]; } } - , wfFormIframe: function () { + , wfFormIframe: function () { var currentIframe = learun.frameTab.currentIframe(); var iframeId = currentIframe.$('#form_list_iframes .form-list-iframe.active').attr('id'); return learun.iframe(iframeId, currentIframe.frames); @@ -210,8 +225,8 @@ , closeByParam: function (name, value) { $('#lr_frame_tabs_ul li').each(function () { 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) { frameObj = frameObj.contentWindow; } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/CdDept/CdDeptBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/CdDept/CdDeptBLL.cs index c31f74746..172472005 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/CdDept/CdDeptBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/CdDept/CdDeptBLL.cs @@ -2,6 +2,8 @@ using System; using System.Data; using System.Collections.Generic; +using Learun.Cache.Base; +using Learun.Cache.Factory; namespace Learun.Application.TwoDevelopment.EducationalAdministration { @@ -16,6 +18,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { private CdDeptService cdDeptService = new CdDeptService(); + #region 缓存定义 + private ICache cache = CacheFactory.CaChe(); + private string cacheKey = "Learun_adms_cddept"; + + #endregion #region 获取数据 /// @@ -201,5 +208,72 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration #endregion + #region 扩展数据 + + /// + /// 获取列表数据 + /// + /// + public List GetList() + { + try + { + List list = cache.Read>(cacheKey); + if (list == null) + { + list = (List)cdDeptService.GetList(); + cache.Write>(cacheKey, list, CacheId.company); + } + return list; + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + public List GetTree(string parentId) + { + try + { + List list = GetList(); + List treeList = new List(); + 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 } } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/CdDept/CdDeptIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/CdDept/CdDeptIBLL.cs index 979da4bec..9b0ea2300 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/CdDept/CdDeptIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/CdDept/CdDeptIBLL.cs @@ -55,5 +55,20 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration IEnumerable GetListBySchoolId(string schoolId); IEnumerable GetAllList(); + + #region 扩展数据 + /// + /// 获取树形数据 + /// + /// 父级id + /// + List GetTree(string parentId); + + /// + /// 获取列表数据 + /// + /// + List GetList(); + #endregion } } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/CdDept/CdDeptService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/CdDept/CdDeptService.cs index 507cdd93a..88313bf9b 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/CdDept/CdDeptService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/CdDept/CdDeptService.cs @@ -250,5 +250,36 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } } + + + #region 扩展数据 + /// + /// 获取公司列表信息(全部) + /// + /// + public IEnumerable 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(strSql.ToString()); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + #endregion } }