/* - ¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì ¾à¼ÓSET¼ø¼­º¯°æ ( SPMMB00800_¾à¼ÓSET¼ø¼­º¯°æ.xrw - JScript ) - ¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì */ var g_prevmouserow = 0; /** * @desc : ¾à¼ÓSET¼ø¼­º¯°æ ÃʱâÈ­ * @ * @param : * @return : * @author : ¿ÀÁöÈÆ 2007. 10. 30 * @--------------------------------------------------- */ function fInitialize_SPMMB00800(){ var openerparam = opener.javascript.getParameter("SPMMB00800_param"); var param = openerparam.split("¢Ë"); var setkindcd = param[0]; var setclscd = param[1]; var settypecd = param[2]; var procflag = param[3]; var deptcd = param[4]; var deptnm = param[5]; var ioflag = param[6]; var indx = param[7]; fReqSetTreeView(setkindcd, setclscd, settypecd, procflag, deptcd, deptnm, ioflag); trv_prmsprcpsetlist.select(indx); trv_prmsprcpsetlist.expand(indx, true); trv_prmsprcpsetlist.rebuild(); } /** * @desc : ¾à¼ÓSET ó¹æ/Áø´Ü/¼ö¼ú/ÇÁ·ÎÅäÄÝ Á¶È¸ * @ * @param : setkindcd - SETÁ¾·ùÄÚµå(°³ÀÎP/ºÎ¼­D) * : setclscd - SETºÐ·ùÄÚµå(ÀÇ»çD) * : settypecd - SETºÐ·ùÄÚµå(ó¹æP/Áø´ÜD/¼ö¼úO/ÇÁ·ÎÅäÄÝC) * : procflag - 󸮱¸ºÐ(ºÎ¼­SET:D) * : deptcd - ºÎ¼­ÄÚµå * : deptnm - ºÎ¼­¸í * : ioflag - ¿Ü·¡/ÀÔ¿ø±¸ºÐ * @return : * @authur : ¿ÀÁöÈÆ 2007. 6. 27 * @--------------------------------------------------- */ function fReqSetTreeView(setkindcd, setclscd, settypecd, procflag, deptcd, deptnm, ioflag){ model.removeNodeset("/root/send/reqdata"); model.makeValue("/root/send/reqdata/setkindcd", setkindcd); //°³ÀÎ, ºÎ¼­ model.makeValue("/root/send/reqdata/setclscd" , setclscd); //ÀÇ»ç model.makeValue("/root/send/reqdata/settypecd", settypecd); //ó¹æ, Áø´Ü, ¼ö¼ú, ÇÁ·ÎÅäÄÝ model.makeValue("/root/send/reqdata/procflag" , procflag); //󸮱¸ºÐ(ºÎ¼­SET Á¶È¸½Ã ¼³Á¤) model.makeValue("/root/send/reqdata/deptcd" , deptcd); //ºÎ¼­ÄÚµå(ºÎ¼­SET Á¶È¸½Ã ¼³Á¤) model.makeValue("/root/send/reqdata/deptnm" , deptnm); //ºÎ¼­¸í (ºÎ¼­SET Á¶È¸½Ã ¼³Á¤) if(settypecd == "D"||settypecd == "O"){ //Áø´Ü, ¼ö¼úÀÎ °æ¿ìNÀ¸·Î ó¸® var ioflag = "N"; } model.makeValue("/root/send/reqdata/ioflag" , ioflag); //¿Ü·¡ÀÔ¿ø±¸ºÐ if(submit("TRMMB00601")){ trv_prmsprcpsetlist.rebuild(); } } /** * @desc : Mouse Drag OverÁß ¼±ÅÃÇÑ treeview itemÀÇ »ö±ò º¯°æ * @ * @param : * @return : * @author : ¿ÀÁöÈÆ 2007. 10. 30 * @--------------------------------------------------- */ function fDragOverColorChng(){ if(trv_prmsprcpsetlist.mouseRow != g_prevmouserow){ trv_prmsprcpsetlist.item(g_prevmouserow).attribute("background-color")="#ffffff"; trv_prmsprcpsetlist.item(trv_prmsprcpsetlist.mouseRow).attribute("background-color")="#ccffff"; g_prevmouserow = trv_prmsprcpsetlist.mouseRow; } } /** * @desc : Mouse Drop½Ã treeview itemÀÇ ¼ø¼­ º¯°æ * @ * @param : * @return : * @author : ¿ÀÁöÈÆ 2007. 10. 30 * @--------------------------------------------------- */ function fDropTrvItem(){ //¼±ÅÃµÈ ¾ÆÀÌÅÛ var srcindx = trv_prmsprcpsetlist.selectedIndex; var srcval = trv_prmsprcpsetlist.item(srcindx).value; //µå·Ó À§Ä¡ÀÇ ¾ÆÀÌÅÛ var trgtindx = trv_prmsprcpsetlist.mouseRow; var trgtval = trv_prmsprcpsetlist.item(trgtindx).value; if(trgtval == 1){ messageBox("¼±ÅÃµÈ Æú´õ·Î À̵¿", "E001"); return; } var treeItemNodeSet = trv_prmsprcpsetlist.itemset.attribute("nodeset"); var srcparentindx = getParentItemIndex(srcindx , treeItemNodeSet); var trgtparentindx = getParentItemIndex(trgtindx, treeItemNodeSet); if(trv_prmsprcpsetlist.item(srcparentindx).value == trv_prmsprcpsetlist.item(trgtparentindx).value){ var srcLastChildItemIndex = getLastChildItemIndex(srcindx , treeItemNodeSet); var trgLastChildItemIndex = getLastChildItemIndex(trgtindx, treeItemNodeSet); var srcNodeList = instance1.selectNodes(treeItemNodeSet + "[position() >= " + (srcindx + 1)+ " and position() <=" + (srcLastChildItemIndex + 1) + "]"); var srcNode, trgNode, newNode; var itemtParentNode = instance1.selectSingleNode(treeItemNodeSet).parentNode; var cloneSrcNode; if(srcindx < trgtindx) { trgNode = instance1.selectSingleNode(treeItemNodeSet + "[" + ( trgLastChildItemIndex + 1) + "]"); while(srcNode = srcNodeList.nextNode()) { cloneSrcNode = srcNode.cloneNode(true); newNode = itemtParentNode.insertAfter(cloneSrcNode, trgNode); trgNode = newNode; itemtParentNode.removeChild(srcNode); } }else if(srcindx > trgtindx) { trgNode = instance1.selectSingleNode(treeItemNodeSet + "[" + ( trgtindx + 1) + "]"); while(srcNode = srcNodeList.nextNode()) { cloneSrcNode = srcNode.cloneNode(true); newNode = itemtParentNode.insertBefore(cloneSrcNode, trgNode); itemtParentNode.removeChild(srcNode); } } trv_prmsprcpsetlist.rebuild(); }else{ messageBox("¼±ÅÃµÈ Æú´õ·Î À̵¿", "E001"); } } /** * @desc : ÇöÀç item indexÀÇ ºÎ¸ð item index¸¦ return * @ * @param : * @return : * @author : ±è±â¿ë 2007. 1. 10 * @--------------------------------------------------- */ function getParentItemIndex(itemIndex, treeItemNodeSet) { var curDepthValue = model.getValue(treeItemNodeSet + "[" + (itemIndex + 1) + "]/levl"); var parentDepthValue = curDepthValue - 1; do { itemIndex--; curDepthValue = model.getValue(treeItemNodeSet + "[" + (itemIndex + 1) + "]/levl"); } while(curDepthValue != parentDepthValue) return itemIndex; } /** * @desc : ÇöÀç ¾ÆÀÌÅÛ À妽ºÀÇ ÀÚ½Ä ¾ÆÀÌÅÛÁß ¸¶Áö¸· ¾ÆÀÌÅÛ À妽º¸¦ ¹Ýȯ * @ * @param : * @return : * @author : ±è±â¿ë 2007. 1. 10 * @--------------------------------------------------- */ function getLastChildItemIndex(itemIndex, treeItemNodeSet) { var curDepthValue = model.getValue(treeItemNodeSet + "[" + (itemIndex + 1) + "]/levl"); var childDepthValue = model.getValue(treeItemNodeSet + "[" + (itemIndex + 2) + "]/levl"); while(curDepthValue < childDepthValue) { itemIndex++; childDepthValue = model.getValue(treeItemNodeSet + "[" + (itemIndex + 2) + "]/levl"); } return itemIndex; } /** * @desc : tree nodeset ¼ø¼­ ¼³Á¤ * @ * @param : * @return : * @author : ¿ÀÁöÈÆ 2007. 10. 31 * @--------------------------------------------------- */ function fUpdtRefSeq(){ var indx = trv_prmsprcpsetlist.selectedIndex; var treeItemNodeset = trv_prmsprcpsetlist.itemset.attribute("nodeset"); var totcnt = getNodeSetCnt(treeItemNodeset); for(var i = 2; i <= totcnt; i++){ model.setValue(treeItemNodeset + "[" + i + "]/setrefseq", i); } var savedata = getNodeListCSV(instance1.selectNodes(treeItemNodeset)); model.removeNodeset("/root/send/savedata"); model.makeValue("/root/send/savedata", savedata); if(submit("TXMMB00801")){ } //trv_prmsprcpsetlist.select(indx); //trv_prmsprcpsetlist.expand(indx, true); //trv_prmsprcpsetlist.rebuild(); } /** * @desc : tree nodeset ¼ø¼­ ¼³Á¤ * @ * @param : * @return : * @author : ¿ÀÁöÈÆ 2007. 10. 31 * @--------------------------------------------------- */ function fClkBtnClose(){ var indx = trv_prmsprcpsetlist.selectedIndex; opener.javascript.setParameter("SPMMB00800_rtnparam", indx); window.close(); }