visual_show.jsp
上传用户:jhtang88
上传日期:2014-01-27
资源大小:28528k
文件大小:4k
源码类别:

Jsp/Servlet

开发平台:

Java

  1. <%@ page contentType="text/html; charset=utf-8" %>
  2. <%@ page import="cn.js.fan.util.*"%>
  3. <%@ page import="java.util.*"%>
  4. <%@ page import="cn.js.fan.web.*"%>
  5. <%@ page import="com.redmoon.oa.visual.*"%>
  6. <%@ page import="com.redmoon.oa.flow.*"%>
  7. <link href="common.css" rel="stylesheet" type="text/css">
  8. <jsp:useBean id="privilege" scope="page" class="com.redmoon.oa.pvg.Privilege"/>
  9. <%
  10. String priv="read";
  11. if (!privilege.isUserPrivValid(request,priv))
  12. {
  13. // out.println(cn.js.fan.web.SkinUtil.makeErrMsg(request, cn.js.fan.web.SkinUtil.LoadString(request, "pvg_invalid")));
  14. // return;
  15. }
  16. String myname = privilege.getUser( request );
  17. String op = ParamUtil.get(request, "op");
  18. String formCode = ParamUtil.get(request, "formCode");
  19. if (formCode.equals("")) {
  20. out.print(SkinUtil.makeErrMsg(request, "编码不能为空!"));
  21. return;
  22. }
  23. int id = ParamUtil.getInt(request, "id");
  24. FormMgr fm = new FormMgr();
  25. FormDb fd = fm.getFormDb(formCode);
  26. com.redmoon.oa.visual.FormDAOMgr fdm = new com.redmoon.oa.visual.FormDAOMgr(fd);
  27. if (op.equals("saveformvalue")) {
  28. boolean re = false;
  29. try {
  30. re = fdm.update(application, request);
  31. }
  32. catch (ErrMsgException e) {
  33. out.print(StrUtil.Alert(e.getMessage()));
  34. }
  35. if (re)
  36. out.print(StrUtil.Alert_Redirect("保存成功!", "visual_edit.jsp?id=" + id + "&formCode=" + StrUtil.UrlEncode(formCode)));
  37. }
  38. if (op.equals("delAttach")) {
  39. int attachId = ParamUtil.getInt(request, "attachId");
  40. com.redmoon.oa.visual.Attachment att = new com.redmoon.oa.visual.Attachment(attachId);
  41. att.del();
  42. }
  43. %>
  44. <title>智能设计-添加内容</title>
  45. <script src="<%=Global.getRootPath()%>/inc/flow_dispose_js.jsp"></script>
  46. <script>
  47. function setradio(myitem,v)
  48. {
  49.      var radioboxs = document.all.item(myitem);
  50.      if (radioboxs!=null)
  51.      {
  52.        for (i=0; i<radioboxs.length; i++)
  53.           {
  54.             if (radioboxs[i].type=="radio")
  55.               {
  56.                  if (radioboxs[i].value==v)
  57.   radioboxs[i].checked = true;
  58.               }
  59.           }
  60.      }
  61. }
  62. </script>
  63. <br />
  64. <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
  65.   <tr>
  66.     <td align="left"><table width="100%">
  67.       <form name="flowForm" id="flowForm">
  68.         <tr>
  69.           <td>
  70.   <%
  71. com.redmoon.oa.visual.Render rd = new com.redmoon.oa.visual.Render(request, id, fd);
  72. out.print(rd.report());
  73.   %>
  74.   </td>
  75.         </tr>
  76.       </form>
  77.     </table></td>
  78.   </tr>
  79.   <tr>
  80.     <td align="left"></td>
  81.   </tr>
  82.   <tr>
  83.     <td align="left"><%
  84. com.redmoon.oa.visual.FormDAO fdao = fdm.getFormDAO(id);
  85. Iterator ir = fdao.getAttachments().iterator();
  86.   while (ir.hasNext()) {
  87.    com.redmoon.oa.visual.Attachment am = (com.redmoon.oa.visual.Attachment) ir.next(); %>
  88.         <table width="85%"  border="0" cellpadding="0" cellspacing="0">
  89.           <tr>
  90.             <td width="5%" height="31" align="right"><img src="<%=Global.getRootPath()%>/images/attach.gif" /></td>
  91.             <td>&nbsp; <a target="_blank" href="<%=Global.getRootPath()%>/visual_getfile.jsp?attachId=<%=am.getId()%>"><%=am.getName()%></a>&nbsp;&nbsp;<a href="?op=delAttach&amp;id=<%=id%>&amp;formCode=<%=StrUtil.UrlEncode(formCode)%>&amp;attachId=<%=am.getId()%>"></a><br />
  92.             </td>
  93.           </tr>
  94.         </table>
  95.       <%}
  96.   %></td>
  97.   </tr>
  98.   <tr>
  99.     <td height="30" align="center"><input name="id" value="<%=id%>" type="hidden" />
  100.       &nbsp;&nbsp;
  101.       <input name="Submit" type="button" class="button1" onclick="showFormReport()" value="查看表单"/></td>
  102.   </tr>
  103. </table>
  104. <script>
  105. function showFormReport() {
  106. var preWin=window.open('preview','','left=0,top=0,width=550,height=400,resizable=1,scrollbars=1, status=1, toolbar=1, menubar=1');
  107. preWin.document.open();
  108. preWin.document.write("<style>TD{ TABLE-LAYOUT: fixed; FONT-SIZE: 12px; WORD-BREAK: break-all; FONT-FAMILY:}</style>" + formDiv.innerHTML);
  109. preWin.document.close();
  110. preWin.document.title="表单";
  111. preWin.document.charset="UTF-8";
  112. }
  113. </script>