You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

95 lines
3.8 KiB

<!DOCTYPE html>
<html lang="cn">
<head>
<title></title>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<link rel="stylesheet" href="../../component/other/css/font_2716841_5q133u7t0gp.css" />
<link rel="stylesheet" href="../../component/other/css/bootstrap.css">
<link rel="stylesheet" href="../../component/other/css/index.css" />
<link rel="stylesheet" href="../../component/pear/css/pear.css" />
</head>
<body>
<div class="modal fade in" id="ldgFormPreview" role="dialog" style="display: block;overflow-y:auto;"
aria-hidden="false">
<div class="modal-body">
<form class="LdgFormSubjectForm ldgRight">
</form>
</div>
</div>
<script src="../../component/other/js/jquery.min.js"></script>
<script src="../../component/other/js/bootstrap.min.js"></script>
<script src="../../component/other/js/index.js"></script>
<script src="../../component/other/js/preview.js"></script>
<script src="../../component/other/js/base64.js"></script>
<script src="../../component/layui/layui.js"></script>
<script src="../../component/pear/pear.js"></script>
<script>
$(function () {
let moduleId = GetQueryString("module_id");
let taskId = GetQueryString("task_id");
let orgCode = GetQueryString("org_code");
let showel = "#ldgFormPreview .modal-body form"
$(showel).empty()
if (!$(showel).hasClass("LdgFormSubjectForm")) {
$(showel).addClass("LdgFormSubjectForm");
}
$.ajax({
url: "/Mars/getModule",
data: { "module_id": moduleId },
type: 'GET',
success: function (result) {
if (result.success) {
ImportJson(result.data.module_body, showel);
}
}
});
$.ajax({
url: "/Mars/getTaskForSchool",
data: { "task_id": taskId, "org_code": orgCode },
type: "get",
dataType: "json",
success: function (res) {
$.each(res, function (key, value) {
if ($("[name='" + key + "']").attr("type") == "radio") {
$("[name='" + key + "'][value='" + value + "']").prop("checked", true)
}
else if ($("[name='" + key + "']").attr("type") == "checkbox") {
$("[name='" + key + "']").removeAttr("checked");
try {
$.each(JSON.parse(value), function (k, v) {
$("[name='" + key + "'][value='" + v + "']").prop("checked", true);
});
}
catch (err) {
$("[name='" + key + "'][value='" + value + "']").prop("checked", true);
}
} else {
$("[name='" + key + "']").val(value);
}
});
}
});
function GetQueryString(name, istop) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
var r = window.location.search.substr(1).match(reg);
if (typeof (istop) != "undefined") r = top.location.search.substr(1).match(reg);
if (r != null) return unescape(r[2]);
return null;
}
})
</script>
</body>
</html>