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.
854 lines
34 KiB
854 lines
34 KiB
<!DOCTYPE html>
|
|
<!-- saved from url=(0093)http://39.104.70.32:8090/political/examine/examine_paper/%E9%97%AE%E5%8D%B7%E7%AE%A1%E7%90%86 -->
|
|
<html><head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
|
<title></title>
|
|
<!--head基础meta配置-->
|
|
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1">
|
|
<meta http-equiv="X-UA-Compatible" content="IE=8,IE=9,IE=10">
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
|
<meta http-equiv="Access-Control-Allow-Origin" content="*">
|
|
<meta http-equiv="Cache-Control" content="no-store">
|
|
<meta http-equiv="Pragma" content="no-cache">
|
|
<meta http-equiv="Expires" content="0">
|
|
<script type="text/javascript">var ctx = "http://39.104.70.32:8090/political";</script><!--layui-->
|
|
<link rel="stylesheet" href="layui/css/layui.css" media="all" />
|
|
<script type="text/javascript" src="layui/layui.js"></script>
|
|
<script src="layui/layui.plus.js" type="text/javascript"></script>
|
|
<!--jquery1.8.3-->
|
|
<script src="js/jquery-1.8.3.min.js" type="text/javascript"></script>
|
|
<link href="css/zTreeStyle.css" rel="stylesheet" type="text/css">
|
|
<script src="js/jquery.ztree.core.js" type="text/javascript"></script>
|
|
<script src="js/jquery.ztree.excheck.js" type="text/javascript"></script><!--工具类js引用-->
|
|
<script type="text/javascript">
|
|
var layerload = {
|
|
_index: -40342,
|
|
on: function () {
|
|
_index = layer.load();
|
|
},
|
|
off: function () {
|
|
layer.close(_index);
|
|
}
|
|
};
|
|
//修改tree图标yeah
|
|
var menuIconOpt = function (treeId) {
|
|
if (1 == '0') {
|
|
var treeObj = $.fn.zTree.getZTreeObj(treeId);
|
|
var nodes = treeObj.getNodesByFilter(function (node) { return node.level == 0 });
|
|
for (var i = 0; i < nodes.length; i++) {
|
|
nodes[i].icon = ctx + "/style/images/tree/tree_m0.png";
|
|
treeObj.updateNode(nodes[i]);
|
|
}
|
|
nodes = treeObj.getNodesByFilter(function (node) { return node.level == 1 });
|
|
for (var i = 0; i < nodes.length; i++) {
|
|
nodes[i].icon = ctx + "/style/images/tree/tree_m1.png";
|
|
treeObj.updateNode(nodes[i]);
|
|
}
|
|
nodes = treeObj.getNodesByFilter(function (node) { return node.level == 2 });
|
|
for (var i = 0; i < nodes.length; i++) {
|
|
nodes[i].icon = ctx + "/style/images/tree/tree_m2.png";
|
|
treeObj.updateNode(nodes[i]);
|
|
}
|
|
}
|
|
|
|
/* for(var i = 0;i < nodes.length;i++){
|
|
nodes[i].icon = ctx+"/style/cls1/img/smiley_sleep.png";
|
|
treeObj.updateNode(nodes[i]);
|
|
}
|
|
nodes = treeObj.getNodesByFilter(function(node){return node.level == 1});
|
|
for(var i = 0;i < nodes.length;i++){
|
|
nodes[i].icon = ctx+"/style/cls1/img/smiley_sleep.png";
|
|
treeObj.updateNode(nodes[i]);
|
|
}
|
|
nodes = treeObj.getNodesByFilter(function(node){return node.level == 2});
|
|
for(var i = 0;i < nodes.length;i++){
|
|
nodes[i].icon = ctx+"/style/cls1/img/smiley_sleep.png";
|
|
treeObj.updateNode(nodes[i]);
|
|
} */
|
|
|
|
}
|
|
</script><!--head_custom-->
|
|
<link href="css/style_work.css" type="text/css" rel="stylesheet">
|
|
<link href="css/all.css" type="text/css" rel="stylesheet">
|
|
<link href="css/css.css" type="text/css" rel="stylesheet">
|
|
<link href="css/globle.css" type="text/css" rel="stylesheet">
|
|
<link href="css/icon.css" type="text/css" rel="stylesheet">
|
|
<style>
|
|
._td_class {
|
|
font-size: 16px;
|
|
text-align: center;
|
|
height: 50px;
|
|
line-height: 50px;
|
|
vertical-align: middle;
|
|
/*text-align:left;*/
|
|
padding-left: 10px;
|
|
}
|
|
|
|
.page_win form {
|
|
margin: 0
|
|
}
|
|
|
|
.layui-form-radio {
|
|
margin: 0;
|
|
padding: 0;
|
|
}
|
|
|
|
.trClass {
|
|
height: 50px;
|
|
text-align: center;
|
|
border: solid 1px #bce8f1;
|
|
vertical-align: middle;
|
|
}
|
|
|
|
.tdClass {
|
|
text-align: center;
|
|
border: solid 1px #bce8f1;
|
|
vertical-align: middle;
|
|
}
|
|
|
|
._trClass {
|
|
border: solid 1px #bce8f1;
|
|
vertical-align: middle;
|
|
}
|
|
|
|
._tdClass {
|
|
padding: 10px;
|
|
font-size: 16px;
|
|
border: solid 1px #bce8f1;
|
|
vertical-align: middle;
|
|
}
|
|
|
|
.layui-table, .layui-table-view {
|
|
margin: 0;
|
|
}
|
|
|
|
.layui-form-select {
|
|
width: 317px;
|
|
}
|
|
|
|
.examine-question, .examine-question-view {
|
|
text-align: left;
|
|
border-top: 1px solid #ccc;
|
|
padding: 10px 54px;
|
|
margin-bottom: 0px;
|
|
}
|
|
|
|
.examine-question input, .examine-question-view input {
|
|
border: 0;
|
|
width: 60%;
|
|
height: 30px;
|
|
}
|
|
|
|
.checkList {
|
|
margin: 10px 0;
|
|
}
|
|
|
|
.examine-question input:focus, .examine-question input:hover {
|
|
border: 1px solid #ccc;
|
|
}
|
|
|
|
.layui-form-checkbox i {
|
|
border: 1px solid #d2d2d2;
|
|
}
|
|
|
|
.checkList input {
|
|
width: 30%;
|
|
}
|
|
|
|
.layui-icon-add-circle:hover:before, .layui-icon-reduce-circle:hover:before {
|
|
color: #1E9FFF;
|
|
}
|
|
|
|
.layui-icon-add-circle {
|
|
margin-right: 5px;
|
|
}
|
|
</style>
|
|
</head>
|
|
|
|
<body class="layui-layout-body" style="border: 1px solid #0c6f89;
|
|
background: rgba(12, 70, 100, 0.8);
|
|
padding: 20px;
|
|
box-sizing: border-box;
|
|
">
|
|
<div class="layui-layout layui-layout-admin">
|
|
<!-- 内容主体区域 -->
|
|
<div class="layui-body" style="top:0;">
|
|
<div class="page_content" style=" width: 100%;
|
|
overflow-y: hidden;
|
|
margin: 0;
|
|
padding: 20px;
|
|
">
|
|
<div style=" background:none;">
|
|
<div class="page_tools" style="background:none;">
|
|
<div class="layui-inline" style="width:80px;">
|
|
问卷名称:
|
|
</div>
|
|
<div class="layui-inline" style="width:150px;">
|
|
<input id="examine_paper_examName" class="layui-input" type="text" style="font-size:16px;cursor:pointer;letter-spacing:1px;">
|
|
</div>
|
|
<button id="examine_paper_cxBtn" class="layui-btn layui-btn-normal"><i class="layui-icon"></i>查询</button>
|
|
<button id="examine_paper_czBtn" class="layui-btn"><i class="layui-icon"></i>重置</button>
|
|
<button id="examine_paper_tjBtn" class="layui-btn layui-btn-warm"><i class="layui-icon"></i>添加</button>
|
|
</div>
|
|
<div id="div_table">
|
|
<table id="examine_paper_dataTable" lay-filter="examine_paper_dataTable_filter" lay-size="sm" width="100%">
|
|
</table><div class="layui-form layui-border-box layui-table-view" lay-filter="LAY-table-1" lay-id="examine_paper_dataTable" style=" height:851.5px;">
|
|
<div class="layui-table-box"><div class="layui-table-header"><table cellspacing="0" cellpadding="0" border="0" class="layui-table"><thead><tr><th data-field="examName" data-key="1-0-0" data-unresize="true" class=""><div class="layui-table-cell laytable-cell-1-0-0"><span>问卷名称</span></div></th><th data-field="publishTime" data-key="1-0-1" data-unresize="true" class=""><div class="layui-table-cell laytable-cell-1-0-1"><span>发布时间</span></div></th><th data-field="endTime" data-key="1-0-2" data-unresize="true" class=""><div class="layui-table-cell laytable-cell-1-0-2"><span>结束时间</span></div></th><th data-field="3" data-key="1-0-3" data-unresize="true" class=" layui-table-col-special"><div class="layui-table-cell laytable-cell-1-0-3" align="center"><span>操作 </span></div></th></tr></thead></table></div><div class="layui-table-body layui-table-main" style="height: 769.5px;"><table cellspacing="0" cellpadding="0" border="0" class="layui-table"><tbody></tbody></table><div class="layui-none">暂无数据</div></div></div><div class="layui-table-page layui-hide"><div id="layui-table-page1"></div></div>
|
|
<style>
|
|
.laytable-cell-1-0-0 {
|
|
width: 300px;
|
|
}
|
|
|
|
.laytable-cell-1-0-1 {
|
|
width: 200px;
|
|
}
|
|
|
|
.laytable-cell-1-0-2 {
|
|
width: 200px;
|
|
}
|
|
|
|
.laytable-cell-1-0-3 {
|
|
}
|
|
</style>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 添加试卷配置的页面 -->
|
|
<div id="examine_paper_addWin" class="page_win page_win_hide" style="padding: 10px; display: none;">
|
|
<form id="examine_paper_addForm" lay-filter="examine_paper_addForm_filter" class="layui-form">
|
|
<input type="hidden" value="shzxfzd" name="usersUid" id="usersUidAdd">
|
|
<input type="hidden" value="fbbb44bb458c4336a84e009df74c8598" name="orgId" id="orgIdAdd">
|
|
<input type="hidden" value="1" name="status" id="examine_paper_status">
|
|
<table width="950px">
|
|
<tbody>
|
|
<tr>
|
|
<td width="10%" class="_td_class"><span style="color:red">*</span>问卷名称</td>
|
|
<td width="35%" class="_td_class">
|
|
<input id="examNameAdd" name="examName" lay-verify="required" class="layui-input" type="text" style="width:98%;font-size:16px;cursor:pointer;letter-spacing:1px;" autocomplete="off">
|
|
</td>
|
|
<td width="10%" class="_td_class"><span style="color:red">*</span>结束时间</td>
|
|
<td width="35%" class="_td_class">
|
|
<input id="endTime" name="endTime" lay-verify="required" class="layui-input" type="text" placeholder="请选择结束时间" autocomplete="off" style="width:98%;font-size:16px;cursor:pointer;letter-spacing:1px;" lay-key="2">
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<div style="height:50px;">
|
|
<div style="text-align:center;margin-top:20px;width:100px;height:40px;line-height:40px;border:1px solid #bce8f1;border-bottom:0px;float:left;">
|
|
<span>题目配置</span>
|
|
</div>
|
|
<div style="text-align:center;margin-top:20px;width:100px;height:40px;line-height:40px;border-bottom:0px;float:left;">
|
|
<button type="button" class="layui-btn layui-btn-normal" style="height: 90%;" id="examineRadio">单选</button>
|
|
</div>
|
|
<div style="text-align:center;margin-top:20px;width:100px;height:40px;line-height:40px;border-bottom:0px;float:left;">
|
|
<button type="button" class="layui-btn layui-btn-normal" style="height: 90%;" id="examineCheckbox">多选</button>
|
|
</div>
|
|
<div style="text-align:center;margin-top:20px;width:100px;height:40px;line-height:40px;border-bottom:0px;float:left;">
|
|
<button type="button" class="layui-btn layui-btn-normal" style="height: 90%;" id="examineBlank">填空</button>
|
|
</div>
|
|
<div style="margin-left:100px;height:1px;width:980px;border-top:1px solid #bce8f1;float:left;">
|
|
</div>
|
|
</div>
|
|
<!-- 问卷内容 -->
|
|
<div class="layui-row" style="margin-top: 30px;">
|
|
<ul style="border-bottom: 1px solid #ccc;" id="examine_cont">
|
|
</ul>
|
|
</div>
|
|
<button lay-submit="" lay-filter="examine_paper_addForm_filter" class="layui-btn layui-hide">确定</button>
|
|
</form>
|
|
</div>
|
|
|
|
<!-- 查看试卷配置的页面 -->
|
|
<div id="examine_paper_showWin" class="page_win page_win_hide" style="padding:10px;">
|
|
<form id="examine_paper_showForm" lay-filter="examine_paper_showForm_filter" class="layui-form">
|
|
<input type="hidden" value="shzxfzd" name="usersUid">
|
|
<input type="hidden" value="fbbb44bb458c4336a84e009df74c8598" name="orgId">
|
|
<input type="hidden" value="1" name="status">
|
|
<table width="950px">
|
|
<tbody>
|
|
<tr>
|
|
<td width="10%" class="_td_class"><span style="color:red">*</span>问卷名称</td>
|
|
<td width="35%" class="_td_class">
|
|
<input name="examName" readonly="readonly" class="layui-input" type="text" style="width:98%;font-size:16px;cursor:pointer;letter-spacing:1px;" autocomplete="off">
|
|
</td>
|
|
<td width="10%" class="_td_class"><span style="color:red">*</span>结束时间</td>
|
|
<td width="35%" class="_td_class">
|
|
<input name="endTime" readonly="readonly" class="layui-input" type="text" style="width:98%;font-size:16px;cursor:pointer;letter-spacing:1px;">
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<!-- 问卷内容 -->
|
|
<div class="layui-row" style="margin-top: 30px;">
|
|
<ul style="border-bottom: 1px solid #ccc;" id="examine_cont_view">
|
|
</ul>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
|
|
<!-- 查看统计分析的页面 -->
|
|
<div id="examine_paper_countWin" class="page_win page_win_hide" style="padding:10px;">
|
|
|
|
</div>
|
|
<!-- 查看统计分析填空结果的页面 -->
|
|
<div id="examine_paper_blankWin" class="page_win page_win_hide" style="padding:10px;">
|
|
<table id="examine_blank_dataTable" lay-filter="examine_blank_dataTable_filter" lay-size="sm" width="100%">
|
|
</table>
|
|
</div>
|
|
<script src="js/echarts.min.js"></script>
|
|
<script type="text/javascript">
|
|
var questionTypeList = new Array();
|
|
layuiplus.on_w_1(function () {
|
|
layuiplus.init(1);
|
|
|
|
//日期input
|
|
ldate.render({
|
|
elem: "#startTime",
|
|
type: "datetime"
|
|
});
|
|
ldate.render({
|
|
elem: "#endTime",
|
|
type: "datetime"
|
|
});
|
|
|
|
//列表开始
|
|
var examine_paper_dataTable = table.render({
|
|
elem: "#examine_paper_dataTable",
|
|
url: "http://39.104.70.32:8090/political/examine/examine_paper/list",
|
|
where: {
|
|
orgId: "fbbb44bb458c4336a84e009df74c8598"
|
|
},
|
|
method: "get",
|
|
cols: [[
|
|
{ field: "examName", title: "问卷名称", unresize: true, width: 300 },
|
|
{
|
|
field: "publishTime", title: "发布时间", unresize: true, width: 200, templet: function (d) {
|
|
var _time = d.publishTime.replace(",", " - ");
|
|
return _time;
|
|
}
|
|
},
|
|
{
|
|
field: "endTime", title: "结束时间", unresize: true, width: 200, templet: function (d) {
|
|
var _time = d.endTime.replace(",", " - ");
|
|
return _time;
|
|
}
|
|
},
|
|
{
|
|
title: "操作 ", unresize: true, align: "center", templet: function (d) {
|
|
var opt = "<a class=\"layui-btn layui-btn-xs\" lay-event=\"opt_show\" style='background-color: transparent;'><img src='http://39.104.70.32:8090/political/style/images/edit.png' title='查看'></a> ";
|
|
opt += "<a class=\"layui-btn layui-btn-xs\" lay-event=\"opt_show_count\" style='background-color: transparent;'><img src='http://39.104.70.32:8090/political/style/images/tongji.png' title='统计分析' style='width: 20px;height: 20px;'></a> ";
|
|
opt += "<a class=\"layui-btn layui-btn-danger layui-btn-xs\" lay-event=\"opt_delete\" style='background-color: transparent;'><img src='http://39.104.70.32:8090/political/style/images/del.png' title='删除'></a> "
|
|
return opt;
|
|
}
|
|
},
|
|
]],
|
|
height: $(document).height() - $('#examine_paper_dataTable').offset().top - 20,
|
|
text: { none: "暂无数据" },
|
|
page: {
|
|
layout: ["prev", "page", "next", "skip", "count", "limit"],
|
|
limits: [10],
|
|
theme: '#1E9FFF'
|
|
}
|
|
});
|
|
|
|
//查询按钮
|
|
$("#examine_paper_cxBtn").bind("click", function () {
|
|
examine_paper_dataTable.reload({
|
|
where: {
|
|
examName: $("#examine_paper_examName").val(),
|
|
orgId: "fbbb44bb458c4336a84e009df74c8598"
|
|
},
|
|
page: {
|
|
curr: 1
|
|
}
|
|
});
|
|
});
|
|
|
|
//重置按钮
|
|
$("#examine_paper_czBtn").bind("click", function () {
|
|
$("#examine_paper_examName").val("");
|
|
$("#type_select").val("");
|
|
examine_paper_dataTable.reload({
|
|
where: {
|
|
examName: "",
|
|
orgId: "fbbb44bb458c4336a84e009df74c8598"
|
|
}
|
|
});
|
|
});
|
|
|
|
//单选添加
|
|
$("#examineRadio").bind("click", function () {
|
|
var html = "";
|
|
html = "<li class=\"layui-form-item examine-question\">"
|
|
+ "<label style=\"font-size: 18px;font-weight: normal\">单选: <input name=\"questionName\" input-type=\"1\" value=\"\" required lay-verify=\"required\" placeholder=\"请输入题目\" autocomplete=\"off\"/></label><i class=\"layui-icon layui-icon-reduce-circle question-div\" style=\"font-size: 25px; color: #929292;\"></i>"
|
|
+ "<div class=\"checkList\">"
|
|
+ "<div><input type=\"radio\"/><input name=\"questionOption\" value=\"\" required lay-verify=\"required\" placeholder=\"请输入选项\" autocomplete=\"off\"/><i class=\"layui-icon layui-icon-add-circle radio-input-i\" style=\"font-size: 25px; color: #929292;\"></i><i class=\"layui-icon layui-icon-reduce-circle input-option-i\" style=\"font-size: 25px; color: #929292;\"></i><br></div>"
|
|
+ "<div><input type=\"radio\"/><input name=\"questionOption\" value=\"\" required lay-verify=\"required\" placeholder=\"请输入选项\" autocomplete=\"off\"/><i class=\"layui-icon layui-icon-add-circle radio-input-i\" style=\"font-size: 25px; color: #929292;\"></i><i class=\"layui-icon layui-icon-reduce-circle input-option-i\" style=\"font-size: 25px; color: #929292;\"></i><br></div>"
|
|
+ "</div>"
|
|
+ "</li>";
|
|
$("#examine_cont").append(html);
|
|
layui.use('form', function () {
|
|
var form = layui.form;
|
|
form.render();
|
|
});
|
|
});
|
|
//多选添加
|
|
$("#examineCheckbox").bind("click", function () {
|
|
var html = "";
|
|
html = "<li class=\"layui-form-item examine-question\">"
|
|
+ "<label style=\"font-size: 18px;font-weight: normal\">多选: <input name=\"questionName\" input-type=\"2\" value=\"\" required lay-verify=\"required\" placeholder=\"请输入题目\" autocomplete=\"off\"/></label><i class=\"layui-icon layui-icon-reduce-circle question-div\" style=\"font-size: 25px; color: #929292;\"></i>"
|
|
+ "<div class=\"checkList\">"
|
|
+ "<div><input type=\"checkbox\"/><input name=\"questionOption\" value=\"\" required lay-verify=\"required\" placeholder=\"请输入选项\" autocomplete=\"off\"/><i class=\"layui-icon layui-icon-add-circle checkbox-input-i\" style=\"font-size: 25px; color: #929292;\"></i><i class=\"layui-icon layui-icon-reduce-circle input-option-i\" style=\"font-size: 25px; color: #929292;\"></i><br></div>"
|
|
+ "<div><input type=\"checkbox\"/><input name=\"questionOption\" value=\"\" required lay-verify=\"required\" placeholder=\"请输入选项\" autocomplete=\"off\"/><i class=\"layui-icon layui-icon-add-circle checkbox-input-i\" style=\"font-size: 25px; color: #929292;\"></i><i class=\"layui-icon layui-icon-reduce-circle input-option-i\" style=\"font-size: 25px; color: #929292;\"></i><br></div>"
|
|
+ "</div>"
|
|
+ "</li>";
|
|
$("#examine_cont").append(html);
|
|
layui.use('form', function () {
|
|
var form = layui.form;
|
|
form.render();
|
|
});
|
|
});
|
|
//填空添加
|
|
$("#examineBlank").bind("click", function () {
|
|
var html = "";
|
|
html = "<li class=\"layui-form-item examine-question\">"
|
|
+ "<label style=\"font-size: 18px;font-weight: normal\">填空: <input name=\"questionName\" input-type=\"3\" value=\"\" required lay-verify=\"required\" placeholder=\"请输入题目\" autocomplete=\"off\"/></label><i class=\"layui-icon layui-icon-reduce-circle question-div\" style=\"font-size: 25px; color: #929292;\"></i>"
|
|
+ "<div class=\"checkList\">"
|
|
+ "<input type=\"text\" name=\"title\" placeholder=\"\" autocomplete=\"off\" class=\"layui-input\" style=\"border:1px solid #ccc\">"
|
|
+ "</div>"
|
|
+ "</li>";
|
|
$("#examine_cont").append(html);
|
|
layui.use('form', function () {
|
|
var form = layui.form;
|
|
form.render();
|
|
});
|
|
});
|
|
|
|
//单选选项添加
|
|
$(document).on("click", ".radio-input-i", function () {
|
|
$(this).parent().parent().append("<div><input type=\"radio\"/><input name=\"questionOption\" value=\"\" required lay-verify=\"required\" placeholder=\"请输入选项\" autocomplete=\"off\"/><i class=\"layui-icon layui-icon-add-circle radio-input-i\" style=\"font-size: 25px; color: #929292;\"></i><i class=\"layui-icon layui-icon-reduce-circle input-option-i\" style=\"font-size: 25px; color: #929292;\"></i><br></div>");
|
|
layui.use('form', function () {
|
|
var form = layui.form;
|
|
form.render();
|
|
});
|
|
});
|
|
|
|
//多选选项添加
|
|
$(document).on("click", ".checkbox-input-i", function () {
|
|
$(this).parent().parent().append("<div><input type=\"checkbox\"/><input name=\"questionOption\" value=\"\" required lay-verify=\"required\" placeholder=\"请输入选项\" autocomplete=\"off\"/><i class=\"layui-icon layui-icon-add-circle checkbox-input-i\" style=\"font-size: 25px; color: #929292;\"></i><i class=\"layui-icon layui-icon-reduce-circle input-option-i\" style=\"font-size: 25px; color: #929292;\"></i><br></div>");
|
|
layui.use('form', function () {
|
|
var form = layui.form;
|
|
form.render();
|
|
});
|
|
});
|
|
|
|
//选项删除
|
|
$(document).on("click", ".input-option-i", function () {
|
|
var optionNum = $(this).parent().parent().children().length;
|
|
if (optionNum > 1) {
|
|
$(this).parent().remove();
|
|
} else {
|
|
layer.msg("请至少保留一个选项");
|
|
}
|
|
});
|
|
|
|
//题目删除
|
|
$(document).on("click", ".question-div", function () {
|
|
$(this).parent().remove();
|
|
});
|
|
//添加按钮
|
|
var addWin;
|
|
$("#examine_paper_tjBtn").bind("click", function () {
|
|
addWin = layer.open({
|
|
id: "examine_paper_addWin_id",
|
|
title: "添加问卷",
|
|
type: 1,
|
|
content: $("#examine_paper_addWin"),
|
|
area: ["1200px", "90%"],
|
|
closeBtn: 1,
|
|
btn: ["发布"],
|
|
yes: function () {
|
|
$("#examine_paper_addForm").find("button[lay-filter=examine_paper_addForm_filter]").click();
|
|
},
|
|
end: function () {
|
|
$("#examine_paper_addForm")[0].reset();
|
|
$("#examine_paper_conf").html("");
|
|
questionTypeList = new Array();
|
|
}
|
|
});
|
|
});
|
|
//添加提交
|
|
form.on("submit(examine_paper_addForm_filter)", function (formData) {
|
|
var questionNum = $("#examine_cont").children().length;//获取li的个数
|
|
if (questionNum <= 0) {
|
|
layer.msg("请添加问卷题目", { time: 2000 });
|
|
return false;
|
|
}
|
|
var list_map = new Array();
|
|
for (var i = 0; i < questionNum; i++) {
|
|
var questionName = $("#examine_cont").children().eq(i).find('input[name="questionName"]').val();
|
|
var type = $("#examine_cont").children().eq(i).find('input[name="questionName"]').attr("input-type");
|
|
var option = "";
|
|
if (type != 3) {
|
|
var optionNum = $("#examine_cont").children().eq(i).children().eq(2).children().length;//获取checkList下div的个数
|
|
for (var j = 0; j < optionNum; j++) {
|
|
if (j == (optionNum - 1)) {
|
|
option += $("#examine_cont").children().eq(i).children().eq(2).children().eq(j).find('input[name="questionOption"]').val();
|
|
} else {
|
|
option += $("#examine_cont").children().eq(i).children().eq(2).children().eq(j).find('input[name="questionOption"]').val() + "###########";
|
|
}
|
|
}
|
|
}
|
|
list_map.push({ questionName: questionName, questionOption: option, type: type });
|
|
}
|
|
layerload.on();
|
|
$.ajax({
|
|
type: "post",
|
|
url: "http://39.104.70.32:8090/political/examine/examine_paper/add",
|
|
data: {
|
|
"questionList": JSON.stringify(list_map),
|
|
"usersUid": $("#usersUidAdd").val(),
|
|
"orgId": $("#orgIdAdd").val(),
|
|
"examName": $("#examNameAdd").val(),
|
|
"endTime": $("#endTime").val(),
|
|
"status": $("#examine_paper_status").val(),
|
|
},
|
|
dataType: "json",
|
|
success: function (data) {
|
|
if (data.status == true) {
|
|
layer.close(addWin);
|
|
layer.msg("操作成功", { time: 2000 });
|
|
examine_paper_dataTable.reload({
|
|
where: {
|
|
examName: $("#examine_paper_examName").val(),
|
|
orgId: "fbbb44bb458c4336a84e009df74c8598"
|
|
}
|
|
});
|
|
layerload.off();
|
|
}
|
|
}
|
|
});
|
|
return false;//不停止就会提交两次 没找到原因
|
|
});
|
|
|
|
//自定义验证规则
|
|
form.verify({
|
|
otherReq: function (value, item) {
|
|
var $ = layui.$;
|
|
var verifyName = $(item).attr('name')
|
|
, verifyType = $(item).attr('type')
|
|
, formElem = $(item).parents('.layui-form')//获取当前所在的form元素,如果存在的话
|
|
, verifyElem = formElem.find('input[name=' + verifyName + ']')//获取需要校验的元素
|
|
, isTrue = verifyElem.is(':checked')//是否命中校验
|
|
, focusElem = verifyElem.next().find('i.layui-icon');//焦点元素
|
|
if (!isTrue || !value) {
|
|
//定位焦点
|
|
focusElem.css(verifyType == 'radio' ? { "color": "#FF5722" } : { "border-color": "#FF5722" });
|
|
//对非输入框设置焦点
|
|
focusElem.first().attr("tabIndex", "1").css("outline", "0").blur(function () {
|
|
focusElem.css(verifyType == 'radio' ? { "color": "" } : { "border-color": "" });
|
|
}).focus();
|
|
return '必填项不能为空';
|
|
}
|
|
}
|
|
});
|
|
|
|
//数据表格examine_paper_dataTable每行数据操作监听
|
|
table.on("tool(examine_paper_dataTable_filter)", function (row) {//row.data row.event
|
|
if (row.event == "opt_show") {
|
|
examine_paper_showWin = layer.open({
|
|
id: "examine_paper_showWin_id",
|
|
type: 1,
|
|
shade: 0.3,
|
|
area: ["1000px", "600px"],
|
|
resize: false,
|
|
content: $("#examine_paper_showWin"),
|
|
title: "详情",
|
|
btn: ["关闭"],
|
|
yes: function (index, layero) {
|
|
layer.close(index);
|
|
$("#examine_paper_showForm")[0].reset();
|
|
$("#examine_cont_view").html("");
|
|
},
|
|
end: function () {
|
|
$("#examine_paper_showForm")[0].reset();
|
|
$("#examine_cont_view").html("");
|
|
},
|
|
success: function () {
|
|
$.ajax({
|
|
type: "get",
|
|
url: "http://39.104.70.32:8090/political/examine/examine_paper/get",
|
|
data: { id: row.data.id },
|
|
dataType: "json",
|
|
success: function (data) {
|
|
var _data = data.examinePaper;
|
|
form.val("examine_paper_showForm_filter", {
|
|
examName: _data.examName,
|
|
endTime: _data.endTime
|
|
});
|
|
var list = data.list;
|
|
var html = ""
|
|
for (var i = 0; i < list.length; i++) {
|
|
if (list[i].type == "1") {//单选
|
|
var option = list[i].questionOption.split("###########");
|
|
var optionHtml = "";
|
|
for (var j = 0; j < option.length; j++) {
|
|
optionHtml += "<input type=\"radio\" value=\"" + option[j] + "\" name=\"radio" + i + "\" title=\"" + option[j] + "\"/><br>";
|
|
}
|
|
html += "<li class=\"layui-form-item examine-question-view\">"
|
|
+ "<label style=\"font-size: 18px;font-weight: normal\">" + list[i].sort + ". <input name=\"questionName\" value=\"" + list[i].questionName + "\" readonly/></label>"
|
|
+ "<div class=\"checkList\">"
|
|
+ optionHtml
|
|
+ "</div>"
|
|
+ "</li>";
|
|
}
|
|
if (list[i].type == "2") {//多选
|
|
var option = list[i].questionOption.split("###########");
|
|
var optionHtml = "";
|
|
for (var j = 0; j < option.length; j++) {
|
|
optionHtml += "<input type=\"checkbox\" lay-skin=\"primary\" title=\"" + option[j] + "\" value=\"" + option[j] + "\"/><br>";
|
|
}
|
|
html += "<li class=\"layui-form-item examine-question-view\">"
|
|
+ "<label style=\"font-size: 18px;font-weight: normal\">" + list[i].sort + ". <input name=\"questionName\" value=\"" + list[i].questionName + "\" readonly/></label>"
|
|
+ "<div class=\"checkList\">"
|
|
+ optionHtml
|
|
+ "</div>"
|
|
+ "</li>";
|
|
}
|
|
if (list[i].type == "3") {//填空
|
|
html += "<li class=\"layui-form-item examine-question-view\">"
|
|
+ "<label style=\"font-size: 18px;font-weight: normal\">" + list[i].sort + ". <input name=\"questionName\" value=\"" + list[i].questionName + "\" readonly/></label>"
|
|
+ "<div class=\"checkList\">"
|
|
+ "<input type=\"text\" name=\"title\" placeholder=\"\" autocomplete=\"off\" class=\"layui-input\" style=\"border:1px solid #ccc\">"
|
|
+ "</div>"
|
|
+ "</li>"
|
|
}
|
|
}
|
|
$("#examine_cont_view").html(html);
|
|
layui.use('form', function () {
|
|
var form = layui.form;
|
|
form.render();
|
|
});
|
|
}
|
|
});
|
|
}
|
|
});
|
|
}
|
|
if (row.event == "opt_delete") {
|
|
layer.confirm("删除当前问卷。<br/>如果继续请点击“确定”,否则点击“取消”<br/>是否继续?", { title: "提示" }, function (index) {
|
|
$.ajax({
|
|
type: "get",
|
|
url: "http://39.104.70.32:8090/political/examine/examine_paper/delete",
|
|
data: { id: row.data.id },
|
|
dataType: "json",
|
|
success: function (data) {
|
|
examine_paper_dataTable.reload({
|
|
where: {
|
|
examName: $("#examine_paper_typeName").val(),
|
|
orgId: "fbbb44bb458c4336a84e009df74c8598"
|
|
}
|
|
});
|
|
layer.close(index);
|
|
layer.msg("操作成功", { time: 2000 });
|
|
}
|
|
});
|
|
});
|
|
}
|
|
if (row.event == "opt_show_count") {
|
|
var examine_paper_countWin = layer.open({
|
|
id: "examine_paper_countWin_id",
|
|
type: 1,
|
|
shade: 0.3,
|
|
area: ["100%", "100%"],
|
|
resize: false,
|
|
content: $("#examine_paper_countWin"),
|
|
title: "详情",
|
|
btn: ["关闭"],
|
|
yes: function (index, layero) {
|
|
$("#examine_paper_countWin").html("");
|
|
layer.close(index);
|
|
},
|
|
end: function () {
|
|
$("#examine_paper_countWin").html("");
|
|
},
|
|
success: function () {
|
|
$.ajax({
|
|
type: "get",
|
|
url: "http://39.104.70.32:8090/political/examine/examine_paper/getCount",
|
|
data: { id: row.data.id },
|
|
dataType: "json",
|
|
success: function (data) {
|
|
var _html = "<h2 style=\"width: 90%;height:50px;border-bottom:1px solid #ccc;\">当前填写人数为:" + data.resultListCount + "</h2>";
|
|
$("#examine_paper_countWin").append(_html);
|
|
var countList = data.countList;
|
|
for (var i = 0; i < countList.length; i++) {
|
|
console.log(countList[i])
|
|
if (countList[i].type == "3") {//问答
|
|
var html = "<div id=\"" + countList[i].questionId + "\" style=\"width: 90%;height:100px;border-bottom:1px solid #ccc;font-size:18px;font-weight:bold;color:#333333;text-indent: 6px;\">" + (i + 1) + "." + countList[i].questionName + "(填空)<a href=\"javascript:void(0)\" onclick=\"toViewBlank('" + countList[i].questionId + "')\"><div style=\"font-size:16px;margin: 20px 0;\">点击查看结果</div></a></div>";
|
|
$("#examine_paper_countWin").append(html);
|
|
} else if (countList[i].type == "1") {//单选
|
|
var html = "<div id=\"" + countList[i].questionId + "\" style=\"width: 90%;height:300px;border-bottom:1px solid #ccc;\"></div>";
|
|
$("#examine_paper_countWin").append(html);
|
|
countView(countList[i].questionId, (i + 1) + "." + countList[i].questionName + "(单选)", countList[i].value, countList[i].dataName, countList[i].dataValue);
|
|
} else {//多选
|
|
var html = "<div id=\"" + countList[i].questionId + "\" style=\"width: 90%;height:300px;border-bottom:1px solid #ccc;\"></div>";
|
|
$("#examine_paper_countWin").append(html);
|
|
countView(countList[i].questionId, (i + 1) + "." + countList[i].questionName + "(多选)", countList[i].value, countList[i].dataName, countList[i].dataValue);
|
|
}
|
|
}
|
|
}
|
|
});
|
|
}
|
|
})
|
|
}
|
|
});
|
|
window.toViewBlank = function (id) {
|
|
var examine_paper_blankWin = layer.open({
|
|
id: "examine_paper_blankWin_id",
|
|
type: 1,
|
|
shade: 0.3,
|
|
area: ["50%", "100%"],
|
|
resize: false,
|
|
content: $("#examine_paper_blankWin"),
|
|
title: "结果详情",
|
|
btn: ["关闭"],
|
|
yes: function (index, layero) {
|
|
layer.close(index);
|
|
},
|
|
end: function () {
|
|
},
|
|
success: function () {
|
|
//列表开始
|
|
var examine_paper_dataTable = table.render({
|
|
elem: "#examine_blank_dataTable",
|
|
url: "http://39.104.70.32:8090/political/examine/examine_paper/list_blank",
|
|
where: {
|
|
id: id
|
|
},
|
|
method: "get",
|
|
cols: [[
|
|
{ field: "questionAnswer", title: "结果", unresize: true },
|
|
]],
|
|
height: $(document).height() - $('#examine_blank_dataTable').offset().top - 20,
|
|
text: { none: "暂无数据" },
|
|
});
|
|
}
|
|
})
|
|
}
|
|
});
|
|
function countView(id, title, value, dataName, dataValue) {
|
|
|
|
// 基于准备好的dom,初始化echarts实例
|
|
var myChart = echarts.init(document.getElementById(id));
|
|
// 指定图表的配置项和数据
|
|
/*var option = {
|
|
title: {
|
|
text: title,
|
|
left: "left",
|
|
textStyle: {
|
|
fontSize: 20,
|
|
//color: "rgba(116, 10, 10, 1)",
|
|
fontWeight: "bolder"
|
|
}
|
|
},
|
|
tooltip: {},
|
|
legend: {
|
|
left: '8%',
|
|
top: '10%'
|
|
},
|
|
//右上角的功能小按钮
|
|
toolbox: {
|
|
show: true,
|
|
feature: {
|
|
dataView: { readOnly: false },
|
|
magicType: { type: ['line', 'bar'] },
|
|
restore: {},
|
|
saveAsImage: {}
|
|
}
|
|
},
|
|
xAxis: {
|
|
type: 'category',
|
|
name: '选项',
|
|
nameTextStyle: {
|
|
fontSize: 15
|
|
}
|
|
},
|
|
yAxis: {
|
|
type: 'value',
|
|
name: '数量',
|
|
nameTextStyle: {
|
|
fontSize: 15
|
|
}
|
|
},
|
|
grid: {
|
|
left: '50%',
|
|
top: '15%'
|
|
},
|
|
//系列数据从 dataset 中取
|
|
dataset: {
|
|
source: JSON.parse(value)
|
|
},
|
|
series: [{
|
|
type: 'pie',
|
|
center: ['25%', '50%'],
|
|
radius: '50%',
|
|
// 数据从 dataset 中取,encode 中的数值是 dataset.source 的维度 index (即第几列)
|
|
encode: { itemName: 0, value: 1 }
|
|
},
|
|
{
|
|
type: 'bar',
|
|
encode: { x: 0, y: 1 }
|
|
}]
|
|
};*/
|
|
option = {
|
|
title: {
|
|
text: title
|
|
},
|
|
tooltip: {},
|
|
legend: {
|
|
data: ['数量']
|
|
},
|
|
grid: [
|
|
{ x: '7%', y: '7%', top: '15%', width: '38%', height: '38%' },
|
|
],
|
|
color: ['#37a2da', '#32c5e9', '#9fe6b8', '#ffdb5c', '#ff9f7f', '#fb7293', '#e7bcf3', '#8378ea'],
|
|
xAxis: [
|
|
{
|
|
gridIndex: 0,
|
|
data: JSON.parse(dataName)
|
|
}
|
|
],
|
|
yAxis: [
|
|
{
|
|
gridIndex: 0
|
|
}
|
|
],
|
|
series: [
|
|
{
|
|
name: '数量',
|
|
type: 'bar',
|
|
data: JSON.parse(dataValue)
|
|
},
|
|
{
|
|
type: 'pie',
|
|
data: JSON.parse(value),
|
|
radius: '40%',
|
|
center: ['75%', '30%']
|
|
}
|
|
]
|
|
};
|
|
// 使用刚指定的配置项和数据显示图表
|
|
myChart.setOption(option);
|
|
}
|
|
</script>
|
|
|
|
<div class="layui-layer-move" style="cursor: move; display: none;"></div>
|
|
<link rel="stylesheet" href="../../css/right-list.css" media="all" />
|
|
<link rel="stylesheet" href="../../css/bulletframebg.css" media="all" />
|
|
</body>
|
|
</html>
|