pictures_edit.jsp 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  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. <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
  5. <%
  6. String path = request.getContextPath();
  7. String basePath = request.getScheme() + "://"
  8. + request.getServerName() + ":" + request.getServerPort()
  9. + path + "/";
  10. %>
  11. <!DOCTYPE html>
  12. <html lang="en">
  13. <head>
  14. <base href="<%=basePath%>">
  15. <!-- jsp文件头和头部 -->
  16. <%@ include file="../../system/index/top.jsp"%>
  17. </head>
  18. <body class="no-skin">
  19. <!-- /section:basics/navbar.layout -->
  20. <div class="main-container" id="main-container">
  21. <!-- /section:basics/sidebar -->
  22. <div class="main-content">
  23. <div class="main-content-inner">
  24. <div class="page-content">
  25. <div class="row">
  26. <div class="col-xs-12">
  27. <form action="pictures/${msg }.do" name="Form" id="Form" method="post" enctype="multipart/form-data">
  28. <input type="hidden" name="PICTURES_ID" id="PICTURES_ID" value="${pd.PICTURES_ID}"/>
  29. <div id="zhongxin" style="padding-top: 13px;">
  30. <table id="table_report" class="table table-striped table-bordered table-hover">
  31. <tr>
  32. <td style="width:50px;text-align: right;padding-top: 13px;">标题:</td>
  33. <td><input type="text" name="TITLE" id="TITLE" value="${pd.TITLE}" maxlength="32" style="width:99%;" placeholder="这里输入标题" title="标题"/></td>
  34. </tr>
  35. <tr>
  36. <td style="width:50px;text-align: right;padding-top: 13px;">图片:</td>
  37. <td>
  38. <c:if test="${pd == null || pd.PATH == '' || pd.PATH == null }">
  39. <input type="file" id="tp" name="tp" onchange="fileType(this)"/>
  40. </c:if>
  41. <c:if test="${pd != null && pd.PATH != '' && pd.PATH != null }">
  42. <a href="<%=basePath%>uploadFiles/uploadImgs/${pd.PATH}" target="_blank"><img src="<%=basePath%>uploadFiles/uploadImgs/${pd.PATH}" width="210"/></a>
  43. <input type="button" class="btn btn-mini btn-danger" value="删除" onclick="delP('${pd.PATH}','${pd.PICTURES_ID }');" />
  44. <input type="hidden" name="tpz" id="tpz" value="${pd.PATH }"/>
  45. </c:if>
  46. </td>
  47. </tr>
  48. <tr>
  49. <td style="width:50px;text-align: right;padding-top: 13px;">属于:</td>
  50. <td><input type="text" name="MASTER_ID" id="MASTER_ID" value="${pd.MASTER_ID}" maxlength="32" placeholder="这里输入属于" title="属于"/></td>
  51. </tr>
  52. <tr>
  53. <td style="width:50px;text-align: right;padding-top: 13px;">备注:</td>
  54. <td><input type="text" name="BZ" id="BZ" value="${pd.BZ}" maxlength="32" style="width:95%;" placeholder="这里输入备注" title="备注"/></td>
  55. </tr>
  56. <tr>
  57. <td style="text-align: center;" colspan="2">
  58. <a class="btn btn-mini btn-primary" onclick="save();">保存</a>
  59. <a class="btn btn-mini btn-danger" onclick="getTop(globalThis).Dialog.close();">取消</a>
  60. </td>
  61. </tr>
  62. </table>
  63. </div>
  64. <div id="zhongxin2" class="center" style="display:none"><br/><br/><br/><br/><br/><img src="static/images/jiazai.gif" /><br/><h4 class="lighter block green">提交中...</h4></div>
  65. </form>
  66. </div>
  67. <!-- /.col -->
  68. </div>
  69. <!-- /.row -->
  70. </div>
  71. <!-- /.page-content -->
  72. </div>
  73. </div>
  74. <!-- /.main-content -->
  75. </div>
  76. <!-- /.main-container -->
  77. <!-- basic scripts -->
  78. <!-- 页面底部js¨ -->
  79. <%@ include file="../../system/index/foot.jsp"%>
  80. <!-- ace scripts -->
  81. <script src="static/ace/js/ace/ace.js"></script>
  82. <!-- 上传控件 -->
  83. <script src="static/ace/js/ace/elements.fileinput.js"></script>
  84. <!--提示框-->
  85. <script type="text/javascript" src="static/js/jquery.tips.js"></script>
  86. <script type="text/javascript">
  87. $(getTop(globalThis).hangge());
  88. $(function() {
  89. //上传
  90. $('#tp').ace_file_input({
  91. no_file:'请选择图片 ...',
  92. btn_choose:'选择',
  93. btn_change:'更改',
  94. droppable:false,
  95. onchange:null,
  96. thumbnail:false, //| true | large
  97. whitelist:'gif|png|jpg|jpeg',
  98. //blacklist:'gif|png|jpg|jpeg'
  99. //onchange:''
  100. //
  101. });
  102. });
  103. //保存
  104. function save(){
  105. if($("#TITLE").val()==""){
  106. $("#TITLE").tips({
  107. side:3,
  108. msg:'请输入标题',
  109. bg:'#AE81FF',
  110. time:2
  111. });
  112. $("#TITLE").focus();
  113. return false;
  114. }
  115. if(typeof($("#tpz").val()) == "undefined"){
  116. if($("#tp").val()=="" || document.getElementById("tp").files[0] =='请选择图片'){
  117. $("#tp").tips({
  118. side:3,
  119. msg:'请选图片',
  120. bg:'#AE81FF',
  121. time:3
  122. });
  123. return false;
  124. }
  125. }
  126. if($("#MASTER_ID").val()==""){
  127. $("#MASTER_ID").tips({
  128. side:3,
  129. msg:'请输入属于',
  130. bg:'#AE81FF',
  131. time:2
  132. });
  133. $("#MASTER_ID").focus();
  134. return false;
  135. }
  136. if($("#BZ").val()==""){
  137. $("#BZ").tips({
  138. side:3,
  139. msg:'请输入备注',
  140. bg:'#AE81FF',
  141. time:2
  142. });
  143. $("#BZ").focus();
  144. return false;
  145. }
  146. $("#Form").submit();
  147. $("#zhongxin").hide();
  148. $("#zhongxin2").show();
  149. }
  150. //过滤类型
  151. function fileType(obj){
  152. var fileType=obj.value.substr(obj.value.lastIndexOf(".")).toLowerCase();//获得文件后缀名
  153. if(fileType != '.gif' && fileType != '.png' && fileType != '.jpg' && fileType != '.jpeg'){
  154. $("#tp").tips({
  155. side:3,
  156. msg:'请上传图片格式的文件',
  157. bg:'#AE81FF',
  158. time:3
  159. });
  160. $("#tp").val('');
  161. document.getElementById("tp").files[0] = '请选择图片';
  162. }
  163. }
  164. //删除图片
  165. function delP(PATH,PICTURES_ID){
  166. if(confirm("确定要删除图片?")){
  167. var url = "pictures/deltp.do?PATH="+PATH+"&PICTURES_ID="+PICTURES_ID+"&guid="+new Date().getTime();
  168. $.get(url,function(data){
  169. if(data=="success"){
  170. alert("删除成功!");
  171. document.location.reload();
  172. }
  173. });
  174. }
  175. }
  176. </script>
  177. </body>
  178. </html>