📄 dict_add.jsp
字号:
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>jb-aptech毕业设计项目</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="<%=request.getContextPath()%>/html/css/style.css" rel="stylesheet" type="text/css">
<script src="<%=request.getContextPath()%>/html/script/common.js"></script>
<link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/html/css/css.css">
<script type="text/javascript" src="<%=request.getContextPath()%>/dwr/util.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/dwr/engine.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/dwr/interface/ajaxservice.js"></script>
<script>
function add(){
document.forms['dataForm'].action="<%=request.getContextPath()%>/basedate.do?method=doAdd";
document.forms['dataForm'].submit();
}
</script>
<STYLE type="text/css">
.divd {
overflow:auto;
width:150px;
height:160px;
SCROLLBAR-FACE-COLOR: #fcfcfc;
SCROLLBAR-HIGHLIGHT-COLOR: #6c6c90;
SCROLLBAR-SHADOW-COLOR: #fcfcfc;
SCROLLBAR-3DLIGHT-COLOR: #fcfcfc;
SCROLLBAR-ARROW-COLOR: #240024;
SCROLLBAR-TRACK-COLOR: #fcfcfc;
SCROLLBAR-DARKSHADOW-COLOR: #48486c;
SCROLLBAR-BASE-COLOR: #fcfcfc
}
.saa
{
overflow:auto;width:150px;height:160px;scrollbar-face-color: #f1f1f1;scrollbar-shadow-color: #ffffff;scrollbar-highlight-color:#ffffff;scrollbar-3dlight-color: #ffffffscrollbar-darkshadow-color: #ffffff; scrollbar-track-color:#ffffff; scrollbar-arrow-color: ffffff;background:#E8F7EB;border: 1px solid #CCCCCC;font-size:14px;cursor: default;
}
</STYLE>
<script language="javascript">
var intIndex=0;arrList = new Array();
function smanPromptList(arrList,objInputId)
{
this.style = "overflow:auto;width:150px;height:160px;scrollbar-face-color: #f1f1f1;scrollbar-shadow-color: #ffffff;scrollbar-highlight-color:#ffffff;scrollbar-3dlight-color: #ffffffscrollbar-darkshadow-color: #ffffff; scrollbar-track-color:#ffffff; scrollbar-arrow-color: ffffff;background:#E8F7EB;border: 1px solid #CCCCCC;font-size:14px;cursor: default;"
if (arrList.constructor!=Array)
{
alert('smanPromptList初始化失败:第一个参数非数组!');return ;}
window.onload =function()
{
var objouter=document.getElementById("__smanDisp") //显示的DIV对象
var objInput = document.getElementById(objInputId); //文本框对象
var selectedIndex=-1;
var intTmp; //循环用的:)
if (objInput==null)
{alert('smanPromptList初始化失败:没有找到"'+objInputId+'"文本框');return ;}
//文本框失去焦点
objInput.onblur=function()
{
objouter.style.display='none';
}
//文本框按键抬起
objInput.onkeyup=checkKeyCode;
//文本框得到焦点
objInput.onfocus=checkAndShow;
function checkKeyCode()
{
var ie = (document.all)? true:false
if (ie){
var keyCode=event.keyCode
if (keyCode==40||keyCode==38)
{ //下上
var isUp=false
if(keyCode==40)
isUp=true ;
chageSelection(isUp)
}
else if (keyCode==13)
{//回车
outSelection(selectedIndex);
}
else
{
checkAndShow() ;
}
}
else
{
checkAndShow() ;
}
divPosition() ;
}
function checkAndShow()
{
var strInput = objInput.value
if (strInput!=""&strInput.length%2==0)
{
//输入字符后触发事件调用业务层方法,主要修改地方
ajaxservice.searchAllBaseDataTypeName(strInput,result);
}else{
objouter.style.display='none';
}
function result(data){
//得到结果字符串后填充到arrList 操作完毕,其他代码不变。
arrList = data.split(",");
divPosition();
selectedIndex=-1;
objouter.innerHTML ="";
for (intTmp=0;intTmp<arrList.length;intTmp++)
{
for(i=0;i<arrList[intTmp].length;i++)
{
if (arrList[intTmp].substr(i, strInput.length).toUpperCase()==strInput.toUpperCase())
{
addOption(arrList[intTmp],strInput);
}
}
}
objouter.style.display='';
}
function addOption(value,keyw)
{
var v=value.replace(keyw,"<b><font color=red>"+keyw+"</font></b>");
objouter.innerHTML +="<div onmouseover=\"this.className='sman_selectedStyle'\" onmouseout=\"this.className=''\" onmousedown=\"document.getElementById('"+objInputId+"').value='" + value + "'\">" + v + "</div>"
}
}
function chageSelection(isUp)
{
if (objouter.style.display=='none')
{
objouter.style.display='';
}
else
{
if (isUp)
selectedIndex++
else
selectedIndex--
}
var maxIndex = objouter.children.length-1;
if (selectedIndex<0){selectedIndex=0}
if (selectedIndex>maxIndex) {selectedIndex=maxIndex}
for (intTmp=0;intTmp<=maxIndex;intTmp++)
{
if (intTmp==selectedIndex)
{
objouter.children[intTmp].className="sman_selectedStyle";
}
else
{
objouter.children[intTmp].className="";
}
}
}
function outSelection(Index)
{
objInput.value = objouter.children[Index].innerText;
objouter.style.display='none';
}
function divPosition()
{
objouter.style.top =getAbsoluteHeight(objInput)+getAbsoluteTop(objInput);
objouter.style.left =getAbsoluteLeft(objInput);
objouter.style.width=getAbsoluteWidth(objInput)
}
}
document.write("<div id='__smanDisp' style='position:absolute;display:none;" + this.style + "' onbulr> </div>");
document.write("<style>.sman_selectedStyle{background-Color:#102681;color:#FFFFFF}</style>");
function getAbsoluteHeight(ob)
{
return ob.offsetHeight
}
function getAbsoluteWidth(ob)
{
return ob.offsetWidth
}
function getAbsoluteLeft(ob)
{
var s_el=0;el=ob;while(el){s_el=s_el+el.offsetLeft;el=el.offsetParent;}; return s_el
}
function getAbsoluteTop(ob)
{
var s_el=0;el=ob;while(el)
{s_el=s_el+el.offsetTop ;el=el.offsetParent;}; return s_el
}
}
smanPromptList(arrList,"inputer")
</script>
</head>
<body>
<div class="page_title">数据字典管理 > 新建数据字典条目</div>
<div class="button_bar">
<button class="common_button" onclick="help('');">帮助</button>
<button class="common_button" onclick="back();">返回</button>
<button class="common_button" onclick="add();">保存</button>
</div>
<html:form action="basedate" styleId="dataForm" method="post">
<table class="query_form_table">
<tr>
<th>编号</th>
<td><input readonly /></td>
<th>类别</th>
<td><input type="text" name="basedata.baseTypeName" autocomplete="off" Id="inputer" />
<table border="0">
<tbody id="demo"></tbody>
</table>
<span class="red_star">*</span><br />(需要使用Ajax实现自动补全功能)</td>
</tr>
<tr>
<th>条目</th>
<td><html:text property="basedata.baseName"/><span class="red_star">*</span></td>
<th>值</th>
<td><html:text property="basedata.baseValue"/><span class="red_star">*</span></td>
</tr>
<tr>
<th>是否可编辑</th>
<td><html:checkbox property="basedata.flag" /></td>
<th> </th>
<td> </td>
</tr>
</table>
</html:form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -