cool_calc.aspx
上传用户:simon2hong
上传日期:2021-11-18
资源大小:16746k
文件大小:2k
源码类别:

OA系统

开发平台:

C#

  1. <%@ Page Language="C#" %>
  2. <%@ OutputCache Duration="300" VaryByParam="None" %>
  3. <html>
  4. <head>
  5. <title>计算控件设定</title>
  6. <script>
  7. function my_submit()
  8. {
  9.   if(ITEM_NAME.value=="")
  10.   {
  11.      alert("控件名称不能为空");
  12.      return;
  13.   }
  14.   else if(ITEM_VALUE.value=="")
  15.   {
  16.      alert("计算公式不能为空");
  17.      return;
  18.   }
  19.   if(edit_flag==0)
  20.   {
  21.      var parent_window = parent.dialogArguments;
  22.      control_html="<input type=text  title=""+ITEM_NAME.value.replace(""","&quot;")+"" class="CALC" value=""+ITEM_VALUE.value+"" style="font-size:"+ITEM_SIZE.value+"">";
  23.      parent_window.EDIT_HTML.insertHtml(control_html);
  24.   }
  25.   else
  26.   {
  27.      oSelection = dialogArguments.document.selection.createRange();
  28.      sRangeType = dialogArguments.document.selection.type;
  29.      if (sRangeType == "Control")
  30.      {
  31.     oSelection(0).title = ITEM_NAME.value;
  32.     oSelection(0).value = ITEM_VALUE.value;
  33.     oSelection(0).style.fontSize = ITEM_SIZE.value;
  34.       }
  35.   }
  36.   window.close();
  37. }
  38. //-- 获取控件属性 --
  39. var edit_flag=0;
  40. function LoadDo()
  41. {
  42.   oSelection = dialogArguments.document.selection.createRange();
  43.   sRangeType = dialogArguments.document.selection.type;
  44.   
  45.   if (sRangeType == "Control") 
  46.   {
  47.    edit_flag=1;
  48.    ITEM_NAME.value = oSelection(0).title;
  49.    ITEM_VALUE.value = oSelection(0).value;
  50.    ITEM_SIZE.value = oSelection(0).style.fontSize.replace("px","");
  51.   }
  52.   ITEM_NAME.focus();
  53. }
  54. </script>
  55. </head>
  56. <body topmargin="0" onload="LoadDo();">
  57. <table border="0" cellspacing="1" width="100%" class="small" bgcolor="#ffffff" cellpadding="3" align="center">
  58.   <tr class="TableContent">
  59.       <td nowrap>控件名称:
  60.       </td>
  61.       <td nowrap>
  62.        <Input name="ITEM_NAME" type="text" class="SmallInput" size="20">
  63.       </td>
  64.   </tr>
  65.   <tr class="TableContent">
  66.       <td nowrap>计算公式:
  67.       </td>
  68.       <td nowrap>
  69.        <textarea name="ITEM_VALUE" class="SmallInput" cols="26" rows="3"></textarea>
  70.       </td>
  71.   </tr>
  72.   <tr class="TableContent">
  73.       <td nowrap>字体大小:
  74.       </td>
  75.       <td nowrap>
  76.        <Input name="ITEM_SIZE" type="text" class="SmallInput" size="20" title="可选,默认13像素">
  77.       </td>
  78.   </tr>
  79.   <tr>
  80.       <td class="TableControl" colspan="2" align="center">
  81.         <input type="submit" onclick="my_submit();" value="确 定" class="SmallButton">
  82.       </td>
  83.   </tr>
  84. </table>
  85. </body>
  86. </html>