123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435 |
- <%@ page pageEncoding="UTF-8"%>
- <%@ page contentType="text/html; charset=UTF-8" language="java" %>
- <%@ page language="java"
- import="java.util.ArrayList,
- com.sysmodel.XFormFactory,
- com.sysmodel.XFormModel,
- com.sysmodel.collectmodel.xmlmodel.able.FormCollection,
- com.sysmodel.XFormModelImpl,
- com.sysmodel.collectmodel.xmlmodel.able.*,
- com.sysmodel.collectmodel.xmlmodel.impl.*"%>
- <%
- String pageid = request.getParameter("pagid") == null ? "" : request.getParameter("pagid");
- if(pageid.equals("")) return;
- String sessionReload = request.getParameter("sessionReload") == null ? "false" : request.getParameter("sessionReload");
- FormCollection FormCollectionClone = null;
- if(session.getAttribute("FormCollect"+pageid) == null || sessionReload.equals("true")){
- if(!pageid.equals("")){
- FormCollection FormCollection0bj = XFormFactory.getXFormModel().getFormCollection(pageid);
-
- FormCollectionClone = (FormCollection)FormCollection0bj.clone();
- session.setAttribute("FormCollect"+pageid,FormCollection0bj.clone());
- } else{
- return;
- }
- } else {
- FormCollectionClone = (FormCollection)session.getAttribute("FormCollect"+pageid);
- }
- %>
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
- <html>
- <HEAD>
- <script type="text/javascript">
- function openDesiner(ulr,width,height){
- window.open(ulr+"?pageid=<%=pageid%>",'',"'width="+width+",height="+height+"'");
- }
- </script>
- <TITLE></TITLE>
- <META http-equiv="Content-Type" content="text/html; charset=GB2312">
- <link rel="stylesheet" href="../../../styles/css.css" type="text/css">
- <LINK rel="stylesheet" href="../../../styles/sortabletable.css" type="text/css">
- <link rel="stylesheet" href="../../../styles/contextMenu.css" type="text/css"></link>
- <script language="JavaScript" src="../../../scripts/pagetree.jsp" type="text/JavaScript"></script>
- <script type="text/javascript" src="../../../scripts/contextMenu.js"></script>
- <script type="text/javascript" src="../../../scripts/calendar/calendar.js"></script>
- <link rel="stylesheet" href="../../../scripts/calendar/calendar-blue.css" type="text/css"></link>
- <script type="text/javascript" src="../../../scripts/calendar/calendar-zh.js"></script>
- <script type="text/javascript" src="../../../scripts/dojo/dojo/dojo.js"
- djConfig="isDebug: false, parseOnLoad: true"></script>
- <script type="text/javascript">
- dojo.require("dijit.form.Form");
- dojo.require("dijit.form.FilteringSelect");
- dojo.require("dijit.form.ValidationTextBox");
- dojo.require("dijit.form.NumberSpinner");
- dojo.require("dijit.form.Slider");
- dojo.require("dijit.form.FilteringSelect");
- dojo.require("dijit.form.Textarea");
- dojo.require("dijit.form.CheckBox");
- dojo.require("dijit.form.Button");
- dojo.require("dijit.Tooltip");
- </script>
- <style type="text/css">
- @import "../../../scripts/dojo/dojo/resources/dojo.css";
- @import "../../../scripts/dojo/dijit/themes/tundra/tundra.css";
- @import "../../../scripts/dojo/dijit/themes/tundra/tundra_rtl.css";
- @import "../../../scripts/dojo/dijit/tests/css/dijitTests.css";
- .buttonbox {
- margin:15px 0px;
- margin-top:15px;
- clear:both;
- }
- </style>
-
- <script type="text/javascript">
- var selectTdObj;
- function makeMenu(){
- var myMenu, item;
- myMenu = new contextMenu();
- item = new contextItem("修改", "../../../images/button/edit.gif", "editObj();", "menu");
- myMenu.addItem(item);
- item = new contextItem("删除", "../../../images/button/delete.gif", "deleteObj();", "menu");
- myMenu.addItem(item);
- item = new contextItem("", "", "", "separator");
- myMenu.addItem(item);
- item = new contextItem("刷新", "../../../images/button/refresh.gif", "window.location.reload();", "menu");
- myMenu.addItem(item);
- myMenu.show(this.document);
- delete item;
- delete myMenu;
- }
- function reloadConfig(){
- if(confirm("确定要恢复原来的配置吗?")){
- location.href="designExc.jsp?pageid=<%=pageid%>&doaction=reload";
- }}
- function saveConfig(){
- if(confirm("确定要发布应用吗?")){
- location.href="designExc.jsp?pageid=<%=pageid%>&doaction=save";
- }
- }
- function deleteObj(){
- alert("确定要删除吗?");
- var type = selectTdObj.type;
- if(type=="ReportField"){
- location.href="designExc.jsp?pageid=<%=pageid%>&deltype=" + type+"&fieldname="+selectTdObj.fieldname;
- }
- }
-
- function editObj(){
- var controltype = selectTdObj.controltype;
- var fieldname = selectTdObj.fieldname;
- var url = "pageid=<%=pageid%>&name="+fieldname;
-
- if(controltype == 'date'){
- window.open("../design/date.jsp?"+url,'',"'width=400,height=500'");
- }else if(controltype == 'textarea'){
- window.open("../design/textarea.jsp?"+url,'',"'width=400,height=500'");
- }else if(controltype == 'text'){
- window.open("../design/text.jsp?"+url,'',"'width=400,height=500'");
- }else if(controltype == 'select'){
- window.open("../design/select.jsp?"+url,'',"'width=400,height=500'");
- }else if(controltype == 'radio'){
- window.open("../design/radio.jsp?"+url,'',"'width=400,height=500'");
- }else if(controltype == 'tree'){
- window.open("../design/tree.jsp?"+url,'',"'width=400,height=500'");
- }else if(controltype == 'checkbox'){
- window.open("../design/checkBox.jsp?"+url,'',"'width=400,height=500'");
- }else if(controltype == 'button'){
- var buttontype = selectTdObj.buttontype;
- var buttonvalue = selectTdObj.buttonvalue;
- window.open("../design/butoon.jsp?pageid=<%=pageid%>&buttontype="+buttontype+"&buttonvalue="+buttonvalue,'',"'width=400,height=500'");
- }
- }
- makeMenu();
- document.onclick = hideMenu;
- </script>
- </HEAD>
- <body class="tundra" oncontextmenu="if(!event.ctrlKey){return false} else {return true}">
- <form action="">
- <div style="position: absolute; width:10%; height:80%;top:10px; left:12px; border: 1px solid #999999; overflow:auto;" id="layer1">
- <table align="center">
- <tr>
- <td width="20">
- <img id="tsave" src="../../../images/tool/save.gif" onclick="saveConfig();"></img>
- <span dojoType="dijit.Tooltip" connectId="tsave">发布到客户端</span>
- </td>
- <td width="20">
- <img id="tundo" src="../../../images/tool/undo.gif" onclick="reloadConfig();"></img>
- <span dojoType="dijit.Tooltip" connectId="tundo">撤销到系统在用的设计</span>
- </td>
- </tr>
- <tr>
- <td>
- <img id="htmltab" onclick="openDesiner('../design/tableAtt.jsp','400','500');" src="../../../images/tool/htmltab.gif"></img>
- <span dojoType="dijit.Tooltip" connectId="htmltab" >采集表单属性</span>
- </td>
- <td></td>
- </tr>
- <tr><td colspan="2"> </td></tr>
- <tr>
- <td>
- <img id="select" src="../../../images/tool/select.gif" onclick="openDesiner('../design/select.jsp','400','500');"></img>
- <span dojoType="dijit.Tooltip" connectId="select">定义选择输入构件</span>
- </td>
- <td></td>
- </tr>
- <tr>
- <td>
- <img id="checkbox" src="../../../images/tool/checkbox.gif" onclick="openDesiner('../design/checkBox.jsp','400','500');"></img>
- <span dojoType="dijit.Tooltip" connectId="checkbox">定义多选输入构件</span>
- </td>
- <td></td>
- </tr>
- <tr>
- <td>
- <img id="radio" src="../../../images/tool/radio.gif" onclick="openDesiner('../design/radio.jsp','400','500');"></img>
- <span dojoType="dijit.Tooltip" connectId="radio">定义单选输入构件</span>
- </td>
- <td></td>
- </tr>
- <tr>
- <td>
- <img id="date" src="../../../images/tool/date.gif" onclick="openDesiner('../design/date.jsp','400','500');"></img>
- <span dojoType="dijit.Tooltip" connectId="date">定义日期输入构件</span>
- </td>
- <td></td>
- </tr>
- <tr>
- <td>
- <img id="text" src="../../../images/tool/text.gif" onclick="openDesiner('../design/text.jsp','400','500');"></img>
- <span dojoType="dijit.Tooltip" connectId="text">定义文本框输入构件</span>
- </td>
- <td></td>
- </tr>
- <tr>
- <td>
- <img id="tree1" src="../../../images/tool/tree.gif" onclick="openDesiner('../design/tree.jsp','400','500');"></img>
- <span dojoType="dijit.Tooltip" connectId="tree1">定义树形输入构件</span>
- </td>
- <td></td>
- </tr>
- <tr>
- <td>
- <img id="textarea" src="../../../images/tool/textarea.gif" onclick="openDesiner('../design/textarea.jsp','400','500');"></img>
- <span dojoType="dijit.Tooltip" connectId="textarea">定义文本域输入构件</span>
- </td>
- <td></td>
- </tr>
- <tr>
- <td>
- <img id="sortReport" src="../../../images/tool/sort.gif" onclick="openDesiner('../design/outSort.jsp','400','500');"></img>
- <span dojoType="dijit.Tooltip" connectId="sortReport">排序输入构件</span>
- </td>
- <td></td>
- </tr>
- <tr><td colspan="2"> </td></tr>
- <tr>
- <td>
- <img id="button" src="../../../images/tool/button.gif" onclick="openDesiner('../design/butoon.jsp','400','500');"></img>
- <span dojoType="dijit.Tooltip" connectId="button">定义表单按钮</span>
- </td>
- <td></td>
- </tr>
- <tr>
- <td>
- <img id="sortbutton" src="../../../images/tool/sort.gif" onclick="openDesiner('../design/buttonSort.jsp','400','500');"></img>
- <span dojoType="dijit.Tooltip" connectId="sortbutton">排序按钮</span>
- </td>
- <td></td>
- </tr>
- </table>
- </div>
- <div style="position: absolute; width:90%; height:auto; top:10; left:100; border: 1px solid #999999; overflow:auto;" align="center" id="layer1">
- <br>
- <div id=total>
- <div class="whiteborder">
- <div class="titback">
- <div class="floatleft"><img src="../../../images/index/arrow1.gif" width="20" height="24" /></div>
- <div class="dropshadow"><%
- if(FormCollectionClone.getPageHead() != null)
- out.print(FormCollectionClone.getPageHead().getPageTitle());
- %></div>
- <div class="clear"></div>
- </div>
- </div>
- <div class="report">
- <%
- PageBodyImpl PageBody =(PageBodyImpl)FormCollectionClone.getPageBody();
- XFormModel XFormModel = XFormFactory.getXFormModel();
- String width = PageBody.getWidth();
- String height = PageBody.getHeight();
- String labelWidth = PageBody.getLabelWidth();
- String controlWidth = PageBody.getControlWidth();
- String labelAlign = PageBody.getLabelAlign();
- String controlAlign =PageBody.getControlAlign();
- ArrayList<ReportFieldImpl> alReportFields = PageBody.getAllReportFields();
- ArrayList<HiddenFieldImpl> alHiddenFields = PageBody.getAlHiddenFields();
- int columnCount = PageBody.getColumnCount();
- StringBuffer sb = new StringBuffer();
- for (int i = 0; i < alHiddenFields.size(); i++) {
- HiddenField field = (HiddenField) alHiddenFields.get(i);
- sb.append(field.getHiddenInput(request)).append("\n");
- }
-
- sb.append("<table align=\"center\" border=\"0\" cellpadding=\"1\" cellspacing=\"1\" width=\"");
- sb.append(width + "\"");
- String css = XFormModel.getCSSValue("ReportTableCss");
- if (!css.equals(""))
- sb.append(" class=\"" + css + "\"");
- if (!height.equals(""))
- sb.append(" height=\"" + height + "\"");
- sb.append(">");
- boolean nextLine = true;
- int currentCount = 0;
- String FontTextCss = XFormModel.getCSSValue("FontTextCss");
- FontTextCss = FontTextCss.equals("")? "":" class=\"" + FontTextCss + "\"";
- short[] widthFlag = new short[columnCount * 2];
- String htmlLabelWidth = labelWidth.equals("") ? "" : " width=\"" + labelWidth+ "\"";
- String htmControlWidth = controlWidth.equals("") ? "" : " width=\""+ controlWidth + "\"";
- String htmlLabelAlign = labelAlign.equals("") ? "" : " align=\"" + labelAlign+ "\"";
- String htmControlAlign = controlAlign.equals("") ? "" : " align=\""+ controlAlign + "\"";
- String LineCssA = XFormModel.getCSSValue("LineCssA");
- String LineCssB = XFormModel.getCSSValue("LineCssB");
- LineCssA = LineCssA.equals("") ? "" : " class=\"" + LineCssA + "\"";
- LineCssB = LineCssB.equals("") ? "" : " class=\"" + LineCssB + "\"";
- boolean currentLineCss = true;
-
- for (int i = 0; i < alReportFields.size(); i++) {
-
-
- ReportField field = (ReportField) alReportFields.get(i);
- String scospan = field.getColspan();
- scospan = scospan.equals("") ? "1" : scospan;
- int iColspan = Integer.parseInt(scospan);
-
- int result = currentCount + iColspan;
- if (result > columnCount) {
- int tdCount = columnCount - currentCount;
- for (int j = 0; j < tdCount; j++) {
- int index = currentCount + j;
- if (widthFlag[index] == 0) {
- widthFlag[index] = 1;
- widthFlag[index + 1] = 1;
- sb.append("<td").append(htmlLabelWidth + "></td>");
- sb.append("<td").append(htmControlWidth+ "></td>");
- } else {
- sb.append("<td></td>").append("<td></td>");
- }
- }
- sb.append("</tr>");
- nextLine = true;
- currentCount = 0;
- }
- if (nextLine) {
-
- if (currentLineCss)
- sb.append("<tr").append(LineCssA + ">");
- else
- sb.append("<tr").append(LineCssB + ">");
- nextLine = false;
- currentLineCss = !currentLineCss;
- }
- if (field.getName().equals("")) {
-
- int colspan = iColspan * 2;
- sb.append("<td colspan=\"").append(colspan + "\"");
- sb.append(" onMouseUp=\"rightUp(this);\" onmouseover=\"tdchangeStyle(this, 'on');\" ");
- sb.append(" onmouseout=\"tdchangeStyle(this, 'out');\"");
- sb.append(">");
- String DivCss = XFormModel.getCSSValue("DivCss");
- DivCss = DivCss.equals("")? "":" class=\"" + DivCss + "\"";
- sb.append("<div").append(DivCss);
- sb.append(">" + field.getLabel()).append("</div></td>");
- } else {
-
- sb.append("<td"+htmlLabelAlign);
- if (widthFlag[currentCount] == 0) {
- widthFlag[currentCount] = 1;
- sb.append(htmlLabelWidth);
- }
- sb.append(" type=\"ReportField\"");
- sb.append(" fieldname=\""+field.getName()+"\"");
- sb.append(" controltype=\""+field.getControlType()+"\"");
- sb.append(" onMouseUp=\"rightUp(this);\" onmouseover=\"tdchangeStyle(this, 'on');\" ");
- sb.append(" onmouseout=\"tdchangeStyle(this, 'out');\"");
- sb.append(">");
- sb.append("<font").append(FontTextCss).append(">" + field.getLabel()).append("</font>");
- if(field.getValidate().isNeed()) sb.append(" <span class=\"redcolor\">*</span>");
- sb.append("</td>");
- sb.append("<td"+htmControlAlign);
- if (iColspan > 1) {
- int colspan = iColspan * 2 - 1;
- sb.append(" colspan=\"").append(colspan + "\"");
- } else {
- if (widthFlag[currentCount + 1] == 0) {
- widthFlag[currentCount + 1] = 1;
- sb.append(htmControlWidth);
- }
- }
- sb.append(" nowrap>");
- sb.append(field.getControl().produceHtml(field.getName(), "", "",field.getValidate()));
- sb.append("</td>");
- }
- if (result == columnCount) {
- sb.append("</tr>");
- nextLine = true;
- currentCount = 0;
- } else
- currentCount += iColspan;
- }
- if (currentCount > 0) {
- int tdCount = columnCount - currentCount;
- for (int j = 0; j < tdCount; j++) {
- int index = currentCount + j;
- if (widthFlag[index] == 0) {
- widthFlag[index] = 1;
- widthFlag[index + 1] = 1;
- sb.append("<td").append(htmlLabelWidth + "></td>");
- sb.append("<td").append(htmControlWidth+ "></td>");
- } else {
- sb.append("<td></td>").append("<td></td>");
- }
- }
- sb.append("</tr>");
- }
- sb.append("</table>");
- out.print(sb.toString());
- %>
- <%
- PageRootImpl PageRoot = (PageRootImpl)FormCollectionClone.getPageRoot();
- %>
- <div class="buttonbox" align="<%=PageRoot.getAlign()%>">
- <%
-
- sb = new StringBuffer();
- ArrayList alAction = PageRoot.getAllActions();
- if(PageRoot.isImage()){
- for (int i = 0; i < alAction.size(); i++) {
- Action action = (Action)alAction.get(i);
- sb.append("<img border=\"0\" src=\"").append(action.getValue()+"\" ");
- sb.append(" type=\"button\" controltype=\"button\"");
- sb.append(" isimage=\""+ PageRoot.isImage() +"\"");
- sb.append(" buttontype=\""+action.getType()+"\"");
- sb.append(" buttonvalue=\""+action.getValue()+"\"");
- sb.append(" onMouseUp=\"rightUp(this);\" onmouseover=\"imgbtchangeStyle(this, 'on');\" ");
- sb.append(" onmouseout=\"imgbtchangeStyle(this, 'out');\"");
- sb.append("\">").append(action.appendSpace());
- }
- }else{
- for (int i = 0; i < alAction.size(); i++) {
- Action action = (Action)alAction.get(i);
- String buttonValue = action.getValue();
- String dojoType = XFormModelImpl.getInstance().getJsFunctionByCode(action.getDojoType());
- sb.append("<input type=\"button\" dojoType=\""+dojoType+"\" controltype=\"button\" value=\"").append(buttonValue+"\"");
- sb.append(" isimage=\""+ PageRoot.isImage() +"\"");
- sb.append(" buttontype=\""+action.getType()+"\"");
- sb.append(" buttonvalue=\""+action.getValue()+"\"");
- sb.append(" onMouseUp=\"rightUp(this);\" onmouseover=\"inputbtchangeStyle(this, 'on');\" ");
- sb.append(" onmouseout=\"inputbtchangeStyle(this, 'out');\"");
- sb.append(" class=\"button\" >").append(action.appendSpace());
- action = null;
- }
- out.print(sb.toString());
- }
- %>
- </div>
- </div>
- </div>
- <br>
- </div>
- </form>
- </body>
- </html>
|