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.

68 lines
2.6 KiB
HTML

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<!--#
/* 公共的课程下拉框组件。
查询已经授权的课程
条件:
name 标签的name值
id 标签的ID值。
*/
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}');
ele.append('<optgroup label="应用课程类">');
for (let currentAuthCourseInfoDetail of applicationCourseList) {
ele.append(
'<option value="'+ (currentAuthCourseInfoDetail.courseInfoId || '-1') +'">'+ (currentAuthCourseInfoDetail.courseInfoName || '未查询到数据') +'</option>')
}
ele.append('</optgroup>');
ele.append('<optgroup label="理论课程类">');
for (let currentAuthCourseInfoDetail of theoryCourseList) {
ele.append(
'<option value="'+ (currentAuthCourseInfoDetail.courseInfoId || '-1') +'">'+ (currentAuthCourseInfoDetail.courseInfoName || '未查询到数据') +'</option>')
}
ele.append('</optgroup>');
ele.append('<optgroup label="考证课程类">');
for (let currentAuthCourseInfoDetail of textualResearchCourseList) {
ele.append(
'<option value="'+ (currentAuthCourseInfoDetail.courseInfoId || '-1') +'">'+ (currentAuthCourseInfoDetail.courseInfoName || '未查询到数据') +'</option>')
}
ele.append('</optgroup>');
</script>