📄 wordbook.js
字号:
function deleteWord(id,fatherid,sessionID){
if(confirm('确认要删除吗?')){
link('wordbookAction.do?method=deletewordbook&wordid='+id+'&fatherid='+fatherid+'&sessionID='+sessionID);
}
}
function wordSetEnabled(id,enabled,fatherid,sessionID){
switch(enabled){
case '0':
if(confirm('字典启用后不能被删除,确认要启用吗?')){
var url = "wordbookAction.do?method=wordSetEnabled&wordid="+id+'&fatherid='+fatherid+"&state=1&sessionID="+sessionID;
link(url);
}
break;
case '1':
if(confirm('确认要禁用该字典吗?')){
var url = "wordbookAction.do?method=wordSetEnabled&wordid="+id+'&fatherid='+fatherid+"&state=2&sessionID="+sessionID;
link(url);
}
break;
case '2':
if(confirm('确认要恢复该字典吗?')){
var url = "wordbookAction.do?method=wordSetEnabled&wordid="+id+'&fatherid='+fatherid+"&state=1&sessionID="+sessionID;
link(url);
}
break;
}
}
/**
*
*字典添加保存
*Songzou
*/
function checkWord1(){
if(checkEmpty('nodename','请填写字典内容!'))return;
if(checkEmpty('fatherid','请选择字典类型!'))return;
if(confirm('确定要提交麽?')){
postForm('wordForm');
}
}
/**
*
*
*/
function wordeditSave(){
if(checkEmpty('nodename','请填写字典内容!'))return;
if(checkEmpty('fatherid','请选择字典类型!'))return;
if(confirm('确定要提交麽?')){
postForm('wordForm');
}
}
/**
*
*字典排序保存
*Songzou
*/
function wordOrderSave(){
if(confirm('确定要提交麽?')){
postForm('wordOrder');
}
}
/**
* 字典添加启用
*
* songzou
*/
function statecheck(num){
var state = getObject('ischeck');
switch(num){
case 0:
if(state.checked){
state.checked = false;
if(confirm('字典启用后不能被删除,确认要启用吗?')){
state.checked = true;
getObject('state').value="1";
return ;
}
}
getObject('state').value="0";
return ;
case 1:
if(state.checked){
getObject('state').value="2";
return ;
}
getObject('state').value="1";
return ;
case 2:
if(state.checked){
getObject('state').value="1";
return ;
}
getObject('state').value="2";
return ;
}
}
var downObject;
var orderStart;
var objHR;
var moveIndex=0;
function orderDown(){
if(window.event.button != 1)return;
var order = getObject("orderTable");
var objEvent=window.event.srcElement;
if (order.contains(objEvent)){
if(objEvent.parentElement.rowIndex==0) return;
downObject=objEvent.parentElement;
downObject.style.cursor="move";
downObject.style.backgroundColor="oldlace";
orderStart=true;
objHR=document.createElement("HR");
objHR.style.position = "absolute";
objHR.style.width="700px";
objHR.style.height="4px"
objHR.color="#316AC5";
objHR.style.display="none";
objHR.style.left="16px";
document.body.appendChild(objHR);
}
}
function orderMove(){
if(window.event.button != 1)return;
var order = getObject("orderTable");
var objEvent=window.event.srcElement;
if (order.contains(objEvent)){
if(!orderStart) return;
if(objEvent.parentElement.rowIndex==0) return;
var moveObject = objEvent.parentElement;
moveIndex = moveObject.rowIndex;
moveObject.style.cursor="move";
if(moveObject.rowIndex>downObject.rowIndex){
objHR.style.display="block";
objHR.style.top=moveObject.offsetTop+order.offsetTop+moveObject.offsetHeight-2;
}
if(moveObject.rowIndex<downObject.rowIndex){
objHR.style.display="block";
objHR.style.top=moveObject.offsetTop+order.offsetTop-2;
}
if(moveObject.rowIndex==downObject.rowIndex){
objHR.style.display="none";
}
}
}
function orderUp(){
if(window.event.button != 1)return;
var order = getObject("orderTable");
if(orderStart){
if(moveIndex!=downObject.rowIndex&&moveIndex>0){
order.moveRow(downObject.rowIndex, moveIndex);
for(var i=1;i<order.rows.length;i++){
var row = order.rows[i];
row.style.cursor="default";
row.cells[0].children[0].value = i;
row.cells[4].innerText=i;
}
}
order.rows[0].style.cursor="default";
downObject.style.backgroundColor="white";
if (objHR!=null) document.body.removeChild(objHR);
downObject.style.cursor="default";
}
objHR = null;
orderStart=false;
downObject=null;
moveIndex = 0;
}
function cancelSelect() {
with (window.event) {
cancelBubble = true ;
returnValue = false ;
}
return false ;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -