| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258 |
- <%@ page language="java" contentType="text/html;charset=GBK"
- pageEncoding="GBK"%>
- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=GBK">
- <title>动作设置</title>
- <link href="main.css" rel="stylesheet" type="text/css"></link>
- <link href="${pageContext.request.contextPath }/liger/lib/ligerUI/skins/${sessionScope.css}/css/ligerui-all.css" rel="stylesheet" type="text/css" />
- <script src="${pageContext.request.contextPath }/liger/lib/jquery/jquery-1.3.2.min.js" type="text/javascript"></script>
- <script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/ligerui.all.js" type="text/javascript"></script>
- <script type="text/javascript" src="/shares/js/yw/bpm/form/formFormula.js"></script>
- <script type="text/javascript" src="/shares/js/constant.js"></script>
- <script type="text/javascript" src="/shares/js/common.js"></script>
- <script type="text/javascript" src="/shares/js/yw/bpm/oa.js"></script>
- <script type="text/javascript" src="/shares/js/yw/bpm/promptDefine.js"></script>
- <script type="text/javascript">
- //0:无结尾,1:表单元素结尾,2:数字结尾,3:特殊符号结尾,4:运算符号结尾
- var eletime = parseInt("${requestScope.eletime}");
- $(document).ready(function() {
- var type = "${requestScope.formFormula.type.value }";
- if(type != null){
- $("#type").val(type);
- }
- });
- String.prototype.endWith=function(str){
- if(str==null||str==""||this.length==0||str.length>this.length)
- return false;
- if(this.substring(this.length-str.length)==str)
- return true;
- else
- return false;
- return true;
- };
- function getValue(bid){
- var str = document.getElementById(bid).value;
- var formulaTextShow = document.getElementById("formulaTextShow").value;
- if(eletime == 0 || eletime == 2 || eletime == 1 ){
- formulaTextShow = formulaTextShow + str;
- document.getElementById("formulaTextShow").value = formulaTextShow;
- eletime = 4;
- }else if(eletime == 3){
- if(formulaTextShow.endWith(")")){
- formulaTextShow = formulaTextShow + str;
- document.getElementById("formulaTextShow").value = formulaTextShow;
- eletime = 4;
- }else{
- addError("请用运算符号连接!");
- }
- }else if(eletime == 4){
- addError("请用其它元素连接!");
- }
- }
- function getNumValue(bid){
- var str = document.getElementById(bid).value;
- var formulaTextShow = document.getElementById("formulaTextShow").value;
- if(eletime == 0 || eletime == 2 || eletime == 4 ){
- formulaTextShow = formulaTextShow + str;
- document.getElementById("formulaTextShow").value = formulaTextShow;
- eletime = 2;
- }else if(eletime == 3){
- if(formulaTextShow.endWith(")")){
- addError("请用其它元素连接!");
- }else{
- formulaTextShow = formulaTextShow + str;
- document.getElementById("formulaTextShow").value = formulaTextShow;
- eletime = 2;
- }
- }else if(eletime == 1){
- addError("请用运算符号连接!");
- }
- }
- function getTsValue(bid){
- var str = document.getElementById(bid).value;
- var formulaTextShow = document.getElementById("formulaTextShow").value;
- if(eletime == 0 || eletime == 4){
- if(str == ")" || str == "."){
- addError("请用运算符号连接!");
- }else{
- formulaTextShow = formulaTextShow + str;
- document.getElementById("formulaTextShow").value = formulaTextShow;
- eletime = 3;
- }
- }else if(eletime == 1){
- if(str == "(" || str == "."){
- addError("请用运算符号连接!");
- }else{
- formulaTextShow = formulaTextShow + str;
- document.getElementById("formulaTextShow").value = formulaTextShow;
- eletime = 3;
- }
- }else if(eletime == 2){
- if(str == "("){
- addError("请用运算符号连接!");
- }else{
- formulaTextShow = formulaTextShow + str;
- document.getElementById("formulaTextShow").value = formulaTextShow;
- eletime = 3;
- }
- }else if(eletime == 3){
- addError("请用运算符号连接!");
- }
- }
- function clearFormulaText(){
- document.getElementById("formulaTextShow").value = "";
- eletime = 0;
- }
- function getElementValue(bid){
- var str = document.getElementById(bid).value;
- var formulaTextShow = document.getElementById("formulaTextShow").value;
- if(eletime == 0 || eletime == 4 ){
- formulaTextShow = formulaTextShow + str;
- document.getElementById("formulaTextShow").value = formulaTextShow;
- eletime = 1;
- }else if(eletime == 3){
- if(formulaTextShow.endWith("(")){
- formulaTextShow = formulaTextShow + str;
- document.getElementById("formulaTextShow").value = formulaTextShow;
- eletime = 4;
- }else{
- addError("请用运算符号连接!");
- }
- }else{
- addError("请用运算符号连接!");
- }
- }
- </script>
- </head>
- <body >
- <%@ include file="/include/message.jsp"%>
- <form action="FormFormulaAction.do" method="post" id="theForm" name="theForm" onsubmit="return checkForm();">
- <div id="title" class="form-button" style="width : 100%;">
- <input type="button" onclick="save()" class="l-button" value="保存" />
- <input onclick="closeTabUseInOA();" type="button" value="关闭" class="l-button">
- </div>
- <div class="container-layout">
- <div class="forum-container">
- <center>
- <table class="l-table-edit line">
- <tr>
- <th colspan="2">动作设置</th>
- </tr>
- <tr>
- <td class="l-table-edit-text" width="15%" >动作名称<FONT COLOR="red">*</FONT>:
- </td>
- <td class="l-table-edit-td" >
- <input type="text" id="formulaName"
- name="formulaName" value="${requestScope.formFormula.formulaName}" />
- </td>
- </tr>
- <tr>
- <td class="l-table-edit-text" width="15%" >动作 <FONT COLOR="red">*</FONT>:
- </td>
- <td class="l-table-edit-td" >
- <textarea name="formulaTextShow" id="formulaTextShow" cols="80" rows="5" readonly="readonly" >${requestScope.formFormula.formulaText }</textarea>
- <input type="hidden" id="formulaText" name="formulaText" value="${requestScope.formFormula.formulaText }">
- <input type="button" class="l-button" value="验证动作" onclick="checkFormula();" />
- <input type="button" class="l-button" value="清空" onclick="clearFormulaText();" />
- </td>
- </tr>
- <tr>
- <td class="l-table-edit-text" width="15%" >备注:
- </td>
- <td class="l-table-edit-td" >
- <textarea name="remark" id="remark" cols="80" rows="5">${requestScope.formFormula.remark }</textarea>
- </td>
- </tr>
- <tr>
- <td class="l-table-edit-text" width="15%" >动作类型 :
- </td>
- <td class="l-table-edit-td" >
- <select name="type" id="type">
- <c:forEach items="${requestScope.bddzs }" var="bddz">
- <option value="${bddz.value }">${bddz.dataName }</option>
- </c:forEach>
- </select>
- </td>
- </tr>
- <tr>
- <td class="l-table-edit-text">运算符号:
- </td>
- <td class="l-table-edit-td">
- <input type="button" name="jia" id="jia" class="l-button" value="+" onclick="getValue(this.getAttribute('id'));" />
- <input type="button" name="jian" id="jian" class="l-button" value="-" onclick="getValue(this.getAttribute('id'));" />
- <input type="button" name="chen" id="chen" class="l-button" value="*" onclick="getValue(this.getAttribute('id'));" />
- <input type="button" name="chu" id="chu" class="l-button" value="/" onclick="getValue(this.getAttribute('id'));" />
- <%-- <input type="button" name="baifen" id="baifen" class="l-button" value="%" onclick="getValue(this.getAttribute('id'));" /> --%>
- </td>
- </tr>
- <tr>
- <td class="l-table-edit-text">特殊运算符号:
- </td>
- <td class="l-table-edit-td">
- <input type="button" name="zkh" id="zkh" class="l-button" value="(" onclick="getTsValue(this.getAttribute('id'));" />
- <input type="button" name="ykh" id="ykh" class="l-button" value=")" onclick="getTsValue(this.getAttribute('id'));" />
- <input type="button" name="dian" id="dian" class="l-button" value="." onclick="getTsValue(this.getAttribute('id'));" />
-
- </td>
- </tr>
- <tr>
- <td class="l-table-edit-text">运算数字:
- </td>
- <td class="l-table-edit-td">
- <input type="button" name="0" id="0" class="l-button" value="0" onclick="getNumValue(this.getAttribute('id'));" />
- <input type="button" name="1" id="1" class="l-button" value="1" onclick="getNumValue(this.getAttribute('id'));" />
- <input type="button" name="2" id="2" class="l-button" value="2" onclick="getNumValue(this.getAttribute('id'));" />
- <input type="button" name="3" id="3" class="l-button" value="3" onclick="getNumValue(this.getAttribute('id'));" />
- <input type="button" name="4" id="4" class="l-button" value="4" onclick="getNumValue(this.getAttribute('id'));" />
- <input type="button" name="5" id="5" class="l-button" value="5" onclick="getNumValue(this.getAttribute('id'));" />
- <input type="button" name="6" id="6" class="l-button" value="6" onclick="getNumValue(this.getAttribute('id'));" />
- <input type="button" name="7" id="7" class="l-button" value="7" onclick="getNumValue(this.getAttribute('id'));" />
- <input type="button" name="8" id="8" class="l-button" value="8" onclick="getNumValue(this.getAttribute('id'));" />
- <input type="button" name="9" id="9" class="l-button" value="9" onclick="getNumValue(this.getAttribute('id'));" />
- </td>
- </tr>
- <%--
- <tr>
- <td class="l-table-edit-text">已有动作选择:
- </td>
- <td class="l-table-edit-td">
-
- <select name="fuhao" id="fuhao" style="width:50px">
- <option value="+">+</option>
- <option value="-">-</option>
- <option value="*">*</option>
- <option value="/">/</option>
- <option value="%">%</option>
- <option value="(">(</option>
- <option value=")">)</option>
- </select>
- </td>
- </tr>
- --%>
- <tr>
- <td class="l-table-edit-text">表单元素(数值型):
- </td>
- <td class="l-table-edit-td">
-
- <c:forEach items="${requestScope.elementList }" var="element">
- <input type="button" name="${element.elementId}" id="${element.elementId}" class="l-button" style="width:200px" value="${element.elementCode}" onclick="getElementValue(this.getAttribute('id'));" />
- </c:forEach>
- </td>
- </tr>
-
- </table>
- <input type="hidden" id="formulaId" name="formulaId" value="${requestScope.formFormula.formulaId }">
- <input type="hidden" id="formId" name="formId" value="${requestScope.formFormula.formId }">
- <input type="hidden" id="task" name="task" value="edit">
- <input type="hidden" id="tabid" name="tabid" value="${param.tabid }">
- </center>
- </div>
- </div>
- </form>
- </body>
- </html>
|