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.

138 lines
5.5 KiB

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<title>模板生成工具</title>
<link href="component/pear/css/pear.css" rel="stylesheet">
<link rel="stylesheet" href="admin/css/other/console2.css" />
</head>
<body class="pear-container">
<div class="layui-row layui-col-space10">
<div class="layui-card">
<div class="layui-card-header">上传学校提供的数据文件</div>
<div class="layui-card-body layui-row layui-col-space10">
<div class="layui-col-md12">
<button type="button" class="pear-btn pear-btn-success" id="test3"><i class="layui-icon"></i>上传文件
</button>
</div>
</div>
</div>
<div class="layui-card" id="cz" style="display: none;">
<div class="layui-card-header">操作</div>
<div class="layui-card-body layui-row layui-col-space10">
<div class="layui-col-md12">
<div class="pear-btn-group">
<button id="scjssj" class="pear-btn pear-btn-success" round>生成教师数据</button>
<button id="scxssj" class="pear-btn pear-btn-success" round>生成学生数据</button>
<button id="scxszysj" class="pear-btn pear-btn-success" round>生成学生志愿数据</button>
</div>
</div>
</div>
</div>
<div class="layui-card">
<div class="layui-card-header">日志</div>
<div class="layui-card-body">
<ul class="pear-card-status"
style="height:500px;overflow-y:auto;border: 1px solid #eee;border-radius:4px;padding-left: 20px;">
</ul>
</div>
</div>
</div>
<script src="component/layui/layui.js"></script>
<script src="component/pear/pear.js"></script>
<script>
layui.use(['form', 'element', 'upload', 'loading'], function () {
var form = layui.form
, element = layui.element
, upload = layui.upload
, loading = layui.loading
, $ = layui.jquery;
$.ajax({
url: "/FengHuang/xgk/getButtonShow",
type: "get",
dataType: "json",
success: function (res) {
if (res.success) {
if (res.show) {
$("#cz").attr("style", "display: block;");
} else {
$("#cz").attr("style", "display: none;");
}
} else {
layer.msg("网络错误!");
}
}
})
upload.render({
elem: '#test3'
, url: '/FengHuang/xgk/uploadFile'
, accept: 'file'
, before: function (obj) {
loading.Load(3, "");
}
, done: function (res) {
loading.loadRemove();
layer.msg(res.message);
let _index = 1;
let _html = ""
$.each(res, function (index, value) {
let n = value.indexOf(String(_index));
if (index === 0) {
_html = _html + "<li>";
_html = _html + "<p><b>" + value + "</b></p>";
_index++;
} else if (n != -1) {
_html = _html + "</li>";
_html = _html + "<li>";
_html = _html + "<p><b>" + value + "</b></p>";
_index++;
} else {
if (value === '通过') {
_html = _html + "<span style='color: #36B368;'>" + value + "</span><br>";
} else {
console.log(value.indexOf("创建系统中不存在的课程"));
if (value.indexOf("创建系统中不存在的课程") != -1) {
_html = _html + "<span style='color: #2D8CF0;'>" + value + "</span><br>";
} else {
_html = _html + "<span style='color: red;'>" + value + "</span><br>";
}
}
}
});
_html = _html + "</li>";
$("ul").html(_html);
$("#cz").attr("style", "display: block;");
}
});
$("#scjssj").click(function () {
window.location = '/FengHuang/xgk/getTeacherXls'
});
$("#scxssj").click(function () {
window.location = '/FengHuang/xgk/getStudentXls'
});
$("#sckcjhsj").click(function () {
window.location = '/FengHuang/xgk/getKcjhXls'
});
$("#scxszysj").click(function () {
window.location = '/FengHuang/xgk/getXk'
});
});
</script>
</body>
</html>