You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
75 lines
3.1 KiB
HTML
75 lines
3.1 KiB
HTML
<!--#
|
|
/* 公共的课程下拉框组件。
|
|
查询已经授权的课程
|
|
|
|
条件:
|
|
name 标签的name值;
|
|
id 标签的ID值;
|
|
filterName 过滤的分类名称,多个逗号隔开;只支持【应用课程类】、【理论课程类】、【考证课程类】
|
|
*/
|
|
var newId = !isEmpty(id) ? id : ('select_id_' + name + '_' + @cn.hutool.core.util.RandomUtil.randomString(10));
|
|
-->
|
|
<select name="${name!''}" id="${newId ! ''}" lay-verify="" lay-search lay-filter="select_courseInfoIds">
|
|
<option value="">请选择</option>
|
|
</select>
|
|
|
|
<script type="text/javascript">
|
|
// 根据当前登录用户,获取授权的课程信息
|
|
// 该接口暂定有1小时的缓存
|
|
var currentAuthCourseInfoDetails =
|
|
Common.getAjax('/jlw/universitiesCollegesJurisdictionCurriculumResources/getAuthDetailsByCacheUser.json').data;
|
|
|
|
// 应用课程类
|
|
var applicationCourseList = currentAuthCourseInfoDetails.applicationCourseList || [];
|
|
// 理论课程类
|
|
var theoryCourseList = currentAuthCourseInfoDetails.theoryCourseList || [];
|
|
// 考证课程类
|
|
var textualResearchCourseList = currentAuthCourseInfoDetails.textualResearchCourseList || [];
|
|
|
|
/**
|
|
* 分组模板:
|
|
* <select name="quiz">
|
|
* <option value="">请选择</option>
|
|
* <optgroup label="城市记忆">
|
|
* <option value="你工作的第一个城市">你工作的第一个城市?</option>
|
|
* </optgroup>
|
|
* <optgroup label="学生时代">
|
|
* <option value="你的工号">你的工号?</option>
|
|
* <option value="你最喜欢的老师">你最喜欢的老师?</option>
|
|
* </optgroup>
|
|
* </select>
|
|
*/
|
|
|
|
var ele = $('#${newId}');
|
|
|
|
var filterNames = '${filterName!""}';
|
|
|
|
if (filterNames.indexOf('应用课程类') >= 0 || filterNames === "") {
|
|
ele.append('<optgroup label="应用课程类">');
|
|
for (let currentAuthCourseInfoDetail of applicationCourseList) {
|
|
ele.append(
|
|
'<option value="'+ (currentAuthCourseInfoDetail.courseInfoId || '-1') +'">'+ (currentAuthCourseInfoDetail.courseInfoName || '未查询到数据') +'</option>')
|
|
}
|
|
ele.append('</optgroup>');
|
|
}
|
|
|
|
if (filterNames.indexOf('理论课程类') >= 0 || filterNames === "") {
|
|
ele.append('<optgroup label="应用课程类">');
|
|
for (let currentAuthCourseInfoDetail of theoryCourseList) {
|
|
ele.append(
|
|
'<option value="'+ (currentAuthCourseInfoDetail.courseInfoId || '-1') +'">'+ (currentAuthCourseInfoDetail.courseInfoName || '未查询到数据') +'</option>')
|
|
}
|
|
ele.append('</optgroup>');
|
|
}
|
|
|
|
if (filterNames.indexOf('考证课程类') >= 0 || filterNames === "") {
|
|
ele.append('<optgroup label="考证课程类">');
|
|
for (let currentAuthCourseInfoDetail of textualResearchCourseList) {
|
|
ele.append(
|
|
'<option value="'+ (currentAuthCourseInfoDetail.courseInfoId || '-1') +'">'+ (currentAuthCourseInfoDetail.courseInfoName || '未查询到数据') +'</option>')
|
|
}
|
|
ele.append('</optgroup>');
|
|
}
|
|
|
|
</script>
|