updateProblem.jsp 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. <%@ page language="java" contentType="text/html; charset=UTF-8"
  2. pageEncoding="UTF-8"%>
  3. <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
  4. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  5. <html>
  6. <head>
  7. <meta charset="utf-8">
  8. <meta name="renderer" content="webkit|ie-comp|ie-stand">
  9. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  10. <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,member-scalable=no" />
  11. <meta http-equiv="Cache-Control" content="no-siteapp" />
  12. <!--[if lt IE 9]>
  13. <script type="text/javascript" src="lib/html5.js"></script>
  14. <script type="text/javascript" src="lib/respond.min.js"></script>
  15. <script type="text/javascript" src="lib/PIE_IE678.js"></script>
  16. <![endif]-->
  17. <link href="${pageContext.request.contextPath }/common/admin/css/H-ui.min.css" rel="stylesheet" type="text/css" />
  18. <link href="${pageContext.request.contextPath }/common/admin/css/H-ui.admin.css" rel="stylesheet" type="text/css" />
  19. <link href="${pageContext.request.contextPath }/common/admin/lib/icheck/icheck.css" rel="stylesheet" type="text/css" />
  20. <link href="${pageContext.request.contextPath }/common/admin/lib/Hui-iconfont/1.0.1/iconfont.css" rel="stylesheet" type="text/css" />
  21. <link href="${pageContext.request.contextPath }/common/other/kingedit/themes/default/default.css" rel="stylesheet" type="text/css" />
  22. <!--[if IE 6]>
  23. <script type="text/javascript" src="http://lib.h-ui.net/DD_belatedPNG_0.0.8a-min.js" ></script>
  24. <script>DD_belatedPNG.fix('*');</script>
  25. <![endif]-->
  26. <title>修改题目</title>
  27. </head>
  28. <body>
  29. <nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 题目管理 <span class="c-gray en">&gt;</span> 修改题目 <a class="btn btn-success radius r mr-20" id="refreshId" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
  30. <div class="pd-20">
  31. <form action="" class="form form-horizontal" id="form-coupon-update">
  32. <div class="row cl">
  33. <label class="form-label col-2"><span class="c-red">*</span>题目名称:</label>
  34. <div class="formControls col-8">
  35. <input id="questionName" name="questionName" type="text" class="input-text" value="${questionnaireQuestionDto.questionName }" placeholder="">
  36. </div>
  37. </div>
  38. <div class="row cl">
  39. <label id="integralLabel" class="form-label col-2"><span class="c-red">*</span>题目状态:</label>
  40. <div id="integralDiv" class="formControls col-2">
  41. <span class="select-box">
  42. <select id="questionStatu" name="questionStatu" class="select">
  43. <option value="1" <c:if test="${questionnaireQuestionDto.questionStatu == 1}">selected</c:if>>正常使用</option>
  44. <option value="2" <c:if test="${questionnaireQuestionDto.questionStatu == 2}">selected</c:if>>停止使用</option>
  45. </select>
  46. </span>
  47. </div>
  48. </div>
  49. <div class="row cl">
  50. <label class="form-label col-2"><span class="c-red">*</span>商品简介:</label>
  51. <div id="integralDiv" class="formControls col-2">
  52. <textarea id="questionDesc" name="questionDesc" class="textarea-text" placeholder="" style="width:200px;height:60px;">${questionnaireQuestionDto.questionDesc }</textarea>
  53. </div>
  54. </div>
  55. <div class="row cl">
  56. <label class="form-label col-2"><span class="c-red">*</span>计分方式:</label>
  57. <div class="formControls col-2">
  58. <span class="select-box">
  59. <select id="questionCalculation" name="questionCalculation" class="select">
  60. <option value="1" <c:if test="${questionnaireQuestionDto.questionCalculation == 1}">selected</c:if>>累计分数</option>
  61. <option value="2" <c:if test="${questionnaireQuestionDto.questionCalculation == 2}">selected</c:if>>最高分数</option>
  62. </select>
  63. </span>
  64. </div>
  65. </div>
  66. <div class="row cl">
  67. <label class="form-label col-2"><span class="c-red">*</span>题目类型:</label>
  68. <div class="formControls col-2">
  69. <span class="select-box">
  70. <select id="questionType" name="questionType" class="select">
  71. <option value="1" <c:if test="${questionnaireQuestionDto.questionType == 1}">selected</c:if>>营养</option>
  72. <option value="2" <c:if test="${questionnaireQuestionDto.questionType == 2}">selected</c:if>>发育</option>
  73. <option value="3" <c:if test="${questionnaireQuestionDto.questionType == 3}">selected</c:if>>健康</option>
  74. </select>
  75. </span>
  76. </div>
  77. </div>
  78. <div class="row cl">
  79. <label class="form-label col-2"><span class="c-red">*</span>介绍图:</label>
  80. <div class="formControls col-2">
  81. <span class="select-box">
  82. <select id="questionPic" name="questionPic" class="select">
  83. <option value="1" <c:if test="${questionnaireQuestionDto.questionPic == 'q-1.jpg'}">selected</c:if>>图标一</option>
  84. <option value="2" <c:if test="${questionnaireQuestionDto.questionPic == 'q-2.jpg'}">selected</c:if>>图标二</option>
  85. <option value="3" <c:if test="${questionnaireQuestionDto.questionPic == 'q-3.jpg'}">selected</c:if>>图标三</option>
  86. <option value="4" <c:if test="${questionnaireQuestionDto.questionPic == 'q-4.jpg'}">selected</c:if>>图标四</option>
  87. <option value="5" <c:if test="${questionnaireQuestionDto.questionPic == 'q-5.jpg'}">selected</c:if>>图标五</option>
  88. <option value="6" <c:if test="${questionnaireQuestionDto.questionPic == 'q-6.jpg'}">selected</c:if>>图标六</option>
  89. <option value="7" <c:if test="${questionnaireQuestionDto.questionPic == 'q-7.jpg'}">selected</c:if>>图标七</option>
  90. <option value="8" <c:if test="${questionnaireQuestionDto.questionPic == 'q-8.jpg'}">selected</c:if>>图标八</option>
  91. <option value="9" <c:if test="${questionnaireQuestionDto.questionPic == 'q-9.jpg'}">selected</c:if>>图标九</option>
  92. <option value="10" <c:if test="${questionnaireQuestionDto.questionPic == 'q-10.jpg'}">selected</c:if>>图标十</option>
  93. <option value="11" <c:if test="${questionnaireQuestionDto.questionPic == 'q-11.jpg'}">selected</c:if>>图标十一</option>
  94. <option value="12" <c:if test="${questionnaireQuestionDto.questionPic == 'q-12.jpg'}">selected</c:if>>图标十二</option>
  95. </select>
  96. </span>
  97. </div>
  98. </div>
  99. <%-- <div id="introductionFigure" class="row cl">
  100. <label class="form-label col-2"><span class="c-red">*</span>介绍图:</label>
  101. <div class="col-10 ">
  102. <img alt="介绍图" src="${questionnaireQuestionDto.questionPic }" id="introduceImg" width="90" height="80">
  103. <input type="hidden" id="productIntroduceImg" name="questionPic" value="${questionnaireQuestionDto.questionPic }"/>
  104. <input type="button" id="insertfileIntroduce" value="选择文件" />
  105. </div>
  106. </div> --%>
  107. <div class="row cl">
  108. <div class="col-9 col-offset-3">
  109. <input type="hidden" name="questionId" value="${questionnaireQuestionDto.questionId }">
  110. <input type="hidden" name="questionCreateDate" value="${questionnaireQuestionDto.questionCreateDate }">
  111. <input class="btn btn-primary radius" onclick="return checkForm()" type="button" id="submitBtn" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
  112. </div>
  113. </div>
  114. </form>
  115. </div>
  116. </div>
  117. <script type="text/javascript" src="${pageContext.request.contextPath }/common/admin/lib/jquery/1.9.1/jquery.min.js"></script>
  118. <script type="text/javascript" src="${pageContext.request.contextPath }/common/admin/lib/icheck/jquery.icheck.min.js"></script>
  119. <script type="text/javascript" src="${pageContext.request.contextPath }/common/admin/lib/Validform/5.3.2/Validform.min.js"></script>
  120. <script type="text/javascript" src="${pageContext.request.contextPath }/common/admin/lib/layer/1.9.3/layer.js"></script>
  121. <script type="text/javascript" src="${pageContext.request.contextPath }/common/admin/js/tips.js"></script>
  122. <script type="text/javascript" src="${pageContext.request.contextPath }/common/admin/js/H-ui.js"></script>
  123. <script type="text/javascript" src="${pageContext.request.contextPath }/common/admin/lib/My97DatePicker/WdatePicker.js"></script>
  124. <script type="text/javascript" src="${pageContext.request.contextPath }/common/admin/js/H-ui.admin.js"></script>
  125. <script type="text/javascript" src="${pageContext.request.contextPath }/common/other/kingedit/kindeditor.js"></script>
  126. <script type="text/javascript" src="${pageContext.request.contextPath }/common/other/kingedit/lang/zh_CN.js"></script>
  127. <script type="text/javascript">
  128. $(function(){
  129. });
  130. //上传介绍图
  131. KindEditor.ready(function(K) {
  132. var editor = K.editor({
  133. fileManagerJson : '${pageContext.request.contextPath }/common/other/kingedit/jsp/file_manager_json.jsp',
  134. uploadJson : '${pageContext.request.contextPath }/common/other/kingedit/jsp/upload_json.jsp',
  135. allowFileManager : true
  136. });
  137. K('#insertfileIntroduce').click(function() {
  138. var imgid = $(this).attr("id");//获取当前ID
  139. editor.loadPlugin('image', function() {
  140. editor.plugin.imageDialog({
  141. showRemote : false,
  142. imageUrl : K('#productIntroduceImg').val(),
  143. clickFn : function(url, title, width, height, border, align) {
  144. K('#introduceImg').attr("src",url);
  145. K('#productIntroduceImg').val(url);
  146. editor.hideDialog();
  147. return false;
  148. }
  149. });
  150. });
  151. });
  152. });
  153. //修改题目
  154. function checkForm(){
  155. if(!commonTypeJdg('questionName',null,null,true)){
  156. layer.msg("题目名称不能为空",{icon: 2,time:2000});
  157. return false;
  158. }
  159. if(!commonTypeJdg('questionDesc',null,null,true)){
  160. layer.msg("题目简介不能为空",{icon: 2,time:2000});
  161. return false;
  162. }
  163. $.ajax({
  164. url: '${pageContext.request.contextPath }/admin/answer/updateQuestion',
  165. data:$('#form-coupon-update').serialize(),
  166. dataType:'json',//服务器返回json格式数据
  167. type:'post', //HTTP请求类型
  168. error:function(data){
  169. //alert("-----error:function----->>" + data);
  170. layer.msg("修改失败!",{icon: 5,time:2000});
  171. },
  172. success: function(data){
  173. layer.msg(data.status,{icon:1,time:2000},function(){
  174. parent.window.location.href = '${pageContext.request.contextPath }/admin/answer/getAllProblem';
  175. });
  176. }
  177. });
  178. }
  179. function reloadWindow() {
  180. window.location.reload();
  181. }
  182. //关闭隐藏div
  183. function closeDiv() {
  184. $("#userInfoList").hide();
  185. }
  186. </script>
  187. </body>
  188. </html>