/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) * Copyright (c) 2013-2018 北京泉江科技有限公司 * 创建人:超级管理员 * 日 期:2019-01-24 17:03 * 描 述:课程信息管理 */ var acceptClick; var keyValue = request('keyValue'); var bootstrap = function ($, learun) { "use strict"; var ue; var page = { init: function () { $('.lr-form-wrap').lrscroll(); page.bind(); page.initData(); }, bind: function () { $('#F_SchoolId').lrDataSourceSelect({ code: 'company', value: 'f_companyid', text: 'f_fullname', select: function (item) { if (!!item) { $('#TeachDeptNo').lrselectRefresh({ url: "/CdDept/GetListBySchoolId", param: { F_SchoolId: item.f_companyid }, value: 'DeptNo', text: 'DeptName' }); } else { $('#TeachDeptNo').lrselectRefresh({ url: "", data: [] }); } } }); $('#TeachDeptNo').lrselect({ value: 'deptno', text: 'deptname' }); $('#TeachMajorNo').lrDataSourceSelect({ code: 'CdMajorInfo', value: 'majorno', text: 'majorname' }); $('#LessonTypeId').lrDataSourceSelect({ code: 'CdLessonType', value: 'ltid', text: 'lessontypename', select: function (item) { if (item != null && item != undefined) { if (item.lessontypename.indexOf('公共') != -1) { $("#TeachMajorNo").removeAttr("isvalid"); $("#TeachMajorNo").removeAttr("NotNull"); } else { $("#TeachMajorNo").attr("isvalid", "yes"); $("#TeachMajorNo").attr("checkexpession", "NotNull"); } } } }); $('#HaveBeforeLesson').lrDataItemSelect({ code: 'YesOrNoBit' }); $('#BeforeLesson').lrDataSourceSelect({ code: 'LessonInfo', value: 'lessonno', text: 'lessonname' }); $('#WhoStudy').lrDataSourceSelect({ code: 'LessonInfo', value: 'lessonno', text: 'lessonname' }); $('#LessonSortNo').lrDataSourceSelect({ code: 'CdLessonSort', value: 'lessonsortno', text: 'lessonsortname' }); $('#LessonSortDetailNo').lrDataSourceSelect({ code: 'CdLessonSortDetail', value: 'lessonsortdetailno', text: 'lessonsortdetailname' }); //内容编辑器 ue = UE.getEditor('editor'); }, initData: function () { if (!!keyValue) { $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/LessonInfo/GetFormData?keyValue=' + keyValue, function (data) { for (var id in data) { if (!!data[id].length && data[id].length > 0) { $('#' + id).jfGridSet('refreshdata', data[id]); } else { $('[data-table="' + id + '"]').lrSetFormData(data[id]); } ue.ready(function () { ue.setContent(data[id].Introduction); }); } }); } } }; // 保存数据 acceptClick = function (callBack) { if (!$('body').lrValidform()) { return false; } var postData = $('body').lrGetFormData(); postData["Introduction"] = ue.getContent(null, null, true); var postDatas = { strEntity: JSON.stringify(postData) }; $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/LessonInfo/SaveForm?keyValue=' + keyValue, postDatas, function (res) { // 保存成功后才回调 if (!!callBack) { callBack(); } }); }; page.init(); }