⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 structure_tree.js

📁 实现了基本的oa功能:个人日志。。。
💻 JS
📖 第 1 页 / 共 4 页
字号:
    }

    if( isCEO ){//panhe modified this function on 2.29.2004(覆盖即可)

    var clickHandle = "javascript:CEOviewEmployees(" + oid +");";
    var curImage = document.createElement("<img id='" + idItem + "' onclick='" + clickHandle + "' alt='" + CEOMessage + "' src='" +contextPath+ "/images/begro.gif' width='16' height='16' border='0' style='cursor:hand;' >");
    curCell.appendChild( curImage );
    curImage.viewNode = aDiv;
    aDiv.editImage = curImage;

    }

    //create the second col
    curCell = curRow.insertCell();
    curCell.width = "50%";
    curCell.height = "25";
    curCell.noWrap = true;
    curCell.innerText = this.name;

    //create the third col
    curCell = curRow.insertCell();
    curCell.width = "49%";
    curCell.height = "25";
    curCell.noWrap = true;
    if( this.chiefJobOid=="-1" ){
        curCell.innerText = noJobMessage
    }else{
        //modify by lily
        if(this.managerName == "")
            curCell.innerText = this.chiefJobName;
        else
            curCell.innerText = this.chiefJobName + "(" + this.managerName + ")";
    }

    return aDiv;
}



function NodeCreateViewNodeV(oid){
    var idUnitItem = "unititem" + oid;
    var idItem = "item" + oid;

    var aDiv = document.createElement("<div ondragstart='doDragStart(this);' ondrag='doDrag(this);' ondragend='doDragEnd(this);' ondragenter='doDragEnter(this);' ondragover='doDragOver(this);' ondragleave='doDragLeave(this);' ondrop='doDrop(this);' onmousedown='doMouseDown(this);' onmousemove='doMouseMove(this);' onmouseup='doMouseUp(this);'  id='" + idUnitItem + "' class='orgunitchartitemcell'>");
    aDiv.treeNode = this;
    this.viewNode = aDiv;

    //create the Whole table
    var wholeTable = document.createElement("<table width='100%' border='0' cellspacing='0' cellpadding='0' style='PADDING-RIGHT: 2px; PADDING-LEFT: 2px' >");
    aDiv.appendChild(wholeTable);
    var curRow = wholeTable.insertRow();

       //create the first col of whole table.
       var curCell = curRow.insertCell();
       curCell.className = "subtableheader";
       curCell.noWrap = true;

          //create the subtable of first col
          var subTable = document.createElement( "<table width='1' border='0' cellspacing='0' cellpadding='0'>" );
          curCell.appendChild(subTable);


          curRow = subTable.insertRow();
          curRow.align="center";
          curCell = curRow.insertCell();
          curCell.height = "16";
          var clickHandle = "doEditNode(this.viewNode," + "this" + ");";
          var curImage = document.createElement("<img id='" + idItem + "' onmouseover='" +clickHandle+ "' src='" +contextPath+ "/images/edit.gif' width='16' height='16' border='0' style='cursor:hand;' >");
          curCell.appendChild( curImage );
          curImage.viewNode = aDiv;
          aDiv.editImage = curImage;

          curRow = subTable.insertRow();
          curRow.align="center";
          curCell = curRow.insertCell();
          curCell.height = "16"
          clickHandle = 'assignJob(this.viewNode.treeNode.oid);';
          curImage = document.createElement("<img onclick='" +clickHandle + "' src='" +contextPath+ "/images/userbro.gif' width='16' height='16' border='0' style='cursor:hand;' >");
          curImage.alt = assignJobAltLabel;
          curCell.appendChild( curImage );
          curImage.viewNode = aDiv;
          aDiv.assignJobImage = curImage;

          /*curRow = subTable.insertRow();
          curRow.align="center";
          curCell = curRow.insertCell();
          curCell.height = "16"
          clickHandle = 'viewChiefJob(this.viewNode);';
          curImage = document.createElement("<img onclick='" +clickHandle + "' src='" +contextPath+ "/images/beser.gif' width='16' height='16' border='0' style='cursor:hand;' >");
          curImage.alt = viewEmployeeAltLabel;
          curCell.appendChild( curImage );
          curImage.viewNode = aDiv;
          aDiv.chiefJobImage = curImage;*/


       //create the second col of whole table
       curCell = wholeTable.rows[0].insertCell();
       curCell.className = "subalterbar";
       curCell.noWrap = true;

          //create subtable of second col
          subTable = document.createElement( "<table width='100' border='0' cellspacing='0' cellpadding='2'>" );
          curCell.appendChild(subTable);

          if( !isCompact ){
             curRow = subTable.insertRow();
             curCell = curRow.insertCell();
             curCell.width = "1%";
             curCell.align = "right";
             curCell.noWrap = true;
             curCell.innerText = codeKeyValue;
             curCell = curRow.insertCell();
             curCell.width = "100%";
             curCell.noWrap = true;
             curCell.innerText = this.code;
          }

          curRow = subTable.insertRow();
          if( !isCompact ){
             curCell = curRow.insertCell();
             curCell.width = "1%";
             curCell.align = "right";
             curCell.vAlign = "top";
             curCell.noWrap = true;
             curCell.innerText = nameKeyValue;
          }
          curCell = curRow.insertCell();
          curCell.width = "100%";
          curCell.noWrap = true;
          curCell.innerText = this.name;

          if( !isCompact ){
             curRow = subTable.insertRow();
             curCell = curRow.insertCell();
             curCell.width = "1%";
             curCell.align = "right";
             curCell.vAlign = "top";
             curCell.noWrap = true;
             curCell.innerText = typeKeyValue;
             curCell = curRow.insertCell();
             curCell.width = "100%";
             curCell.noWrap = true;
             curCell.innerText = getUnitTypeLabel(this.type);
          }

          //create subtable of second col
	  subTable = document.createElement( "<table width='100' border='0' cellspacing='0' cellpadding='2'>" );
          wholeTable.rows[0].cells[1].appendChild(subTable);
          aDiv.chiefJobTable = subTable;

          curRow = subTable.insertRow();
          curCell = curRow.insertCell();
          curCell.width = "100%";
          curCell.align = "left";
          curCell.vAlign = "center";
          curCell.noWrap = true;
          if( this.chiefJobOid=="-1" ){
             curCell.innerText = noJobMessage
          }else{
             //modify by lily
            if(this.managerName == "")
                curCell.innerText = this.chiefJobName;
            else
                curCell.innerText = this.chiefJobName + "(" + this.managerName + ")";
          }


       //create the third col of whole table
       curCell = wholeTable.rows[0].insertCell();
       curCell.noWrap = true;
       curCell.align = "center";
       curCell.vAlign = "center";
       curCell.className = "subalterbar";
       if( this.subnode!=null && this.subnode.length>0 ){
          if( this.open )
             curImage = document.createElement("<img onclick='doOpen(this.viewNode);' src='" +contextPath+ "/images/expand.gif' width='18' height='18' style='cursor=hand;' >");
          else
             curImage = document.createElement("<img onclick='doOpen(this.viewNode);' src='" +contextPath+ "/images/shrink.gif' width='18' height='18' style='cursor=hand;' >");
          curImage.viewNode = aDiv;
          aDiv.openImage = curImage;
          curCell.appendChild(curImage);
       }else{
          curCell.width="18";
       }

    return aDiv;
}


//show organization unit by char model
function NodeCreateViewNodeH(oid){
    var idUnitItem = "unititem" + oid;
    var idItem = "item" + oid;

    var aDiv = document.createElement("<div ondragstart='doDragStart(this);' ondrag='doDrag(this);' ondragend='doDragEnd(this);' ondragenter='doDragEnter(this);' ondragover='doDragOver(this);' ondragleave='doDragLeave(this);' ondrop='doDrop(this);' onmousedown='doMouseDown(this);' onmousemove='doMouseMove(this);' onmouseup='doMouseUp(this);'  id='" + idUnitItem + "' class='orgunitchartitemcell'>");
    aDiv.treeNode = this;
    this.viewNode = aDiv;

    //create the Whole table
    var wholeTable = document.createElement("<table width='100' height='100%' border='0' cellpadding='0' cellspacing='0'>");
    aDiv.appendChild(wholeTable);

       //create the first Row of whole table.
       var curRow = wholeTable.insertRow();
       var curCell = curRow.insertCell();
       curCell.className = "subtableheader";
       curCell.align = "right";

          //create the subtable of first row
          var subTable = document.createElement( "<table style='padding-left:2px;padding-right:2px;' width='100' border='0' cellspacing='0' cellpadding='0'>" );
          curCell.appendChild(subTable);
          curRow = subTable.insertRow();
          curRow.align="center";
      if(isEHR){
          curCell = curRow.insertCell();
          curCell.width = "33%"
          var clickHandle = "doEditNode(this.viewNode," + "this" + ");";
          var curImage = document.createElement("<img id='" + idItem + "' onmouseover='" +clickHandle+ "' src='" +contextPath+ "/images/edit.gif' width='16' height='16' border='0' style='cursor:hand;' >");
          curCell.appendChild( curImage );
          curImage.viewNode = aDiv;
          aDiv.editImage = curImage;

          curCell = curRow.insertCell();
          curCell.width = "33%"
          /*  modify by lily 2003-12-31
          if( !isHistoryChart ){
              clickHandle = 'assignJob(this.viewNode.treeNode.oid);';
              curImage = document.createElement("<img onclick='" +clickHandle + "' src='" +contextPath+ "/images/userbro.gif' width='16' height='16' border='0' style='cursor:hand;' >");
              curImage.alt = assignJobAltLabel;
          }else{
              clickHandle = 'viewEditUnit(this.viewNode.treeNode.oid,this.viewNode.treeNode.historyOid);' ;
              curImage = document.createElement("<img onclick='" +clickHandle + "' src='" +contextPath+ "/images/component.gif' width='16' height='16' border='0' style='cursor:hand;' >");
              curImage.alt = viewOrgUnitAltLabel;
          }
          curCell.appendChild( curImage );
          curImage.viewNode = aDiv;
          aDiv.assignJobImage = curImage;
          */

          curCell = curRow.insertCell();
          curCell.width = "33%"
          if( !isHistoryChart )
            clickHandle = 'viewEmployees(this.viewNode.treeNode.oid);';
          else
            clickHandle = 'viewEmployees(this.viewNode.treeNode.oid,this.viewNode.treeNode.historyOid);';
          curImage = document.createElement("<img onclick='" +clickHandle + "' src='" +contextPath+ "/images/begro.gif' width='16' height='16' border='0' style='cursor:hand;' >");
          curImage.alt = viewEmployeeAltLabel;
          curCell.appendChild( curImage );
          curImage.viewNode = aDiv;
          aDiv.viewEmployeesImage = curImage;
       }


       //create the second row of whole table
       curRow = wholeTable.insertRow();
       curCell = curRow.insertCell();
       curCell.className = "subalterbar";

          //create subtable of second row
          subTable = document.createElement( "<table style='padding-left:2px;padding-right:2px;' width='100' border='0' cellspacing='0' cellpadding='2'>" );
          curCell.appendChild(subTable);

          if( !isCompact ){
             curRow = subTable.insertRow();
             curCell = curRow.insertCell();
             curCell.width = "1%";
             curCell.align = "right";
             curCell.noWrap = true;
             curCell.innerText = codeKeyValue;
             curCell = curRow.insertCell();
             curCell.width = "100%";
             curCell.noWrap = false;
             curCell.innerText = this.code;
          }

          curRow = subTable.insertRow();
          if( !isCompact ){
             curCell = curRow.insertCell();
             curCell.width = "1%";
             curCell.align = "right";
             curCell.vAlign = "top";
             curCell.noWrap = true;
             curCell.innerText = nameKeyValue;
          }
          curCell = curRow.insertCell();
          curCell.width = "100%";
          curCell.noWrap = false;
          curCell.innerText = this.name;

          if( !isCompact ){
             curRow = subTable.insertRow();
             curCell = curRow.insertCell();
             curCell.width = "1%";
             curCell.align = "right";
             curCell.vAlign = "top";
             curCell.noWrap = true;
             curCell.innerText = typeKeyValue;
             curCell = curRow.insertCell();
             curCell.width = "49%";
             curCell.noWrap = false;
             curCell.innerText = getUnitTypeLabel(this.type);
          }


       //create the third row of whole table
       curRow = wholeTable.insertRow();
       curCell = curRow.insertCell();
       curCell.className = "subalterbar";

          //create subtable of third row
	  subTable = document.createElement( "<table style='padding-left:2px;padding-right:2px;' width='100' border='0' cellspacing='0' cellpadding='2'>" );
          curCell.appendChild(subTable);
          aDiv.chiefJobTable = subTable;

          curRow = subTable.insertRow();
          curCell = curRow.insertCell();
          curCell.width = "100%";
          curCell.align = "left";
          curCell.vAlign = "center";
          curCell.noWrap = false;
          if( this.chiefJobOid=="-1" ){
             curCell.innerText = noJobMessage
          }else{
             //modify by lily
            if(this.managerName == "")
                curCell.innerText = this.chiefJobName;
            else
                curCell.innerText = this.chiefJobName + "(" + this.managerName + ")";
          }

          /* delete by lily 2003-12-31

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -