123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445 |
- <?xml version="1.0" encoding="EUC-KR"?>
- <?xml-stylesheet href="../../../com/commonweb/css/common.css" type="text/css" ?>
- <xhtml:html xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2002/01/xforms" xmlns:ev="http://www.w3.org/2001/xml-events">
- <xhtml:head>
- <xhtml:title>바로가기등록</xhtml:title>
- <model id="model1">
- <instance id="instance1">
- <root xmlns="">
- <send>
- <shortcutlist/>
- <icontype>D</icontype>
- </send>
- <main>
- <shortcutlist>
- <rows>
- <menugrupnm/>
- <menuitemnm/>
- <icontype/>
- <icontext/>
- <iconcd/>
- <menugrupcd/>
- <menuauthcd/>
- <menuitemcd/>
- <colorcd/>
- <seq/>
- </rows>
- </shortcutlist>
- <menugruplist>
- <items>
- <menugrupcd/>
- <menugrupnm/>
- <menuauthcd/>
- </items>
- </menugruplist>
- </main>
- <init>
- <Z0014list/>
- <Z0012list/>
- <iconlist>
- <rows>
- <checkyn/>
- <iconnm/>
- <iconcd/>
- <iconurl/>
- </rows>
- </iconlist>
- <colorlist>
- <rows>
- <checkyn/>
- <colornm/>
- <colorcd/>
- </rows>
- </colorlist>
- </init>
- <temp>
- <shortcutlist/>
- </temp>
- </root>
- </instance>
- <bind id="bind1" ref="/root/main/shortcutlist/icontext" readonly="../icontype = 'I'"/>
- <submission id="TRZBC00101"/>
- <submission id="TRZUM01502" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" resultref="/root/init/iconlist"/>
- <submission id="TRZUM01301" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" resultref="/root/main/shortcutlist"/>
- <submission id="TRZUM01302" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" resultref="/root/main/menugruplist"/>
- <submission id="TXZUM01301" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" resultref="/root/temp"/>
- <script type="javascript" ev:event="xforms-model-construct-done">
- <![CDATA[
- //공통코드
- zbcfGetCodeList( new Array("Z0014"), new Array("/root/init/Z0014list") );
- zbcfGetCodeList( new Array("Z0012"), new Array("/root/init/Z0012list") );
- //아이콘리스트
- submit("TRZUM01502", false);
- //메뉴그룹리스트
- submit("TRZUM01302", false);
- /*
- 메뉴그룹 리스트 조회결과는 메뉴그룹이름, 아이디, 권한코드 등 다양한 정보를 가져오지만,
- 메뉴그룹명 콤보에는 메뉴그룹이름과 메뉴그룹 아이디만 가지고 있어서 동일한 메뉴그룹 아이디에 대한 표현이 원할하지 않다.
- 따라서 메뉴그룹명 콤보의 value 에는 메뉴그룹아이디+메뉴권한그룹아이디를 조합해서 unique 하게 생성한다.
- */
- var nodes = instance1.selectNodes("/root/main/menugruplist/items");
- if (nodes == null) {
- alert("menugrup combo is null.");
- return;
- }
-
- for (var i = 0, len = nodes.length; i < len; i++) {
- var node = nodes.item(i);
- node.selectSingleNode("menugrupid").value = node.selectSingleNode("menugrupcd").value + "|" + node.selectSingleNode("menuauthcd").value;
- }
-
- submit("TRZUM01301");
-
- ]]>
- </script>
- <script type="javascript" ev:event="xforms-ready">
- <![CDATA[
- fSetGridBackImage(grd_shortcutlist, 4);
- fSetGridBackImage(grd_iconlist, 1);
- fSetColorList();
-
- for(i = 1 ; i<= grd_shortcutlist.rows ; i++){
- var colorCd = model.getValue("/root/main/shortcutlist/rows["+i+"]/colorcd");
- if (colorCd == ""){
- return;
- }
- grd_shortcutlist.cellStyle("color", i, grd_shortcutlist.colRef("icontext")) = colorCd;
- }
- ]]>
- </script>
- </model>
- <script type="javascript" src="../../../com/commonweb/js/common.js"/>
- <script type="javascript" src="../../../com/basiccodeweb/js/ZBC001.js"/>
- <script type="javascript" src="../../../com/commonweb/js/tfHelper.js"/>
- <script type="javascript" src="../../../com/commonweb/js/stringHelper.js"/>
- <script type="javascript">
- <![CDATA[
- function fSetGridBackImage(gridObj, imgCell){
- gridObj.dataHeight = 30;
- var gridNode = gridObj.nodeset;
-
- for( var i = gridObj.fixedRows ; i < gridObj.Rows ; i++ ) {
- var iconurl = "../../../com/hismainweb/images/" + model.getValue(gridNode+"["+i+"]/iconcd") + ".gif";
- gridObj.cellStyle("background-image", i, imgCell) = iconurl;
- gridObj.cellStyle("background-position", i, imgCell) = "center";
- }
- }
-
- function fAddShortcutMenu(){
- grd_shortcutlist.addRow();
- var row = grd_shortcutlist.row;
- model.setValue("/root/main/shortcutlist/rows["+row+"]/seq", grd_shortcutlist.rows+1);
- model.setValue("/root/main/shortcutlist/rows["+row+"]/menugrupnm", cmb_menugrup.label);
- model.setValue("/root/main/shortcutlist/rows["+row+"]/menuitemnm", trv_menuitemlist.label);
- model.setValue("/root/main/shortcutlist/rows["+row+"]/menugrupcd", cmb_menugrup.value);
- model.setValue("/root/main/shortcutlist/rows["+row+"]/menuauthcd", model.getValue("/root/send/menuauthcd"));
- model.setValue("/root/main/shortcutlist/rows["+row+"]/menuitemcd", trv_menuitemlist.value);
- grd_shortcutlist.col = 3;
- grd_shortcutlist.dispatch("onentercell");
- fSetGridAddStatus(row);
- }
-
- //순서변경에 따른 Status 변경
- function fSetGridAddStatus(i){
- for(i; i < grd_shortcutlist.rows; i ++){
- grd_shortcutlist.addStatus(i, "update");
- model.setValue("/root/main/shortcutlist/rows["+i+"]/seq", i);
- }
- }
-
- //icontype에 따라 아이콘처리
- function fSetBackImageIconType(row){
- var icontype = model.getValue("/root/main/shortcutlist/rows["+row+"]/icontype");
- if(icontype == "T"){
- model.setValue("/root/main/shortcutlist/rows["+row+"]/iconcd", "IDZUM10000");
-
- grd_shortcutlist.cellStyle("background-image", row, 4) = "../../../com/hismainweb/images/IDZUM10000.gif";
- grd_shortcutlist.cellStyle("background-position", row, 4) = "center";
- }else{
- var iconcd = model.getValue("/root/main/shortcutlist/rows["+row+"]/iconcd");
- var iconurl = model.getValue("/root/init/iconlist/rows[iconcd='"+iconcd+"']/iconurl");
-
- grd_shortcutlist.cellStyle("background-image", row, 4) = "../../../"+iconurl;
- grd_shortcutlist.cellStyle("background-position", row, 4) = "center";
- }
- }
-
- function fSetColorList(){
- var nodes = instance1.selectNodes("/root/init/Z0012list/Z0012");
- for ( i = 1; i <= nodes.length ; i++){
- model.makeValue("/root/init/colorlist/rows["+ i +"]/colorcd",model.getValue("/root/init/Z0012list/Z0012["+ i +"]/cdid"));
-
- grd_colorlist.refresh();
-
- var colorCd = model.getValue("/root/init/colorlist/rows["+ i +"]/colorcd");
- grd_colorlist.cellstyle("background-color", i, grd_colorlist.colRef("colornm")) = colorCd;
- }
-
- //grd_colorlist.refresh();
- }
- ]]>
- </script>
- </xhtml:head>
- <xhtml:body pagewidth="701" pageheight="825" style="margin-left:8; margin-top:0; margin-right:8; margin-bottom:0; ">
- <group id="grp_biz" scroll="auto" style="left:0px; top:0px; width:685px; height:798px; ">
- <caption id="caption1" class="tit_2" style="left:5px; top:10px; width:100px; height:14px; ">바로가기 등록</caption>
- <line id="line1" class="line_1" style="x1:0px; y1:25px; x2:685px; y2:25px; "/>
- <caption id="caption2" class="cell_1" style="left:0px; top:30px; width:75px; height:20px; ">메뉴그룹명</caption>
- <select1 id="cmb_menugrup" ref="/root/send/menugrupcd" appearance="minimal" style="left:78px; top:30px; width:135px; height:19px; ">
- <choices>
- <itemset nodeset="/root/main/menugruplist/items">
- <label ref="menugrupnm"/>
- <value ref="menugrupcd"/>
- </itemset>
- </choices>
- <script type="javascript" ev:event="xforms-select">
- <![CDATA[
- //메뉴그룹에 해당하는 메뉴리스트 조회
- var idx = (cmb_menugrup.selectedindex)+1;
- var menugrupid = model.getValue("/root/main/menugruplist/items[" + idx + "]/menugrupid");
- //model.setValue("/root/send/menuauthcd", model.getValue("/root/main/menugruplist/items["+idx+"]/menuauthcd"));
- //alert(menugrupid.split("|")[0] + "\n" + menugrupid.split("|")[1]);
- model.makeValue("/root/send/menugrupcd", menugrupid.split("|")[0]);
- model.makeValue("/root/send/menuauthcd", menugrupid.split("|")[1]);
- model.refresh();
- model.removeNodeset("/root/properties/menuitemlist/items");
- submit("TRZUM01401");
- ]]>
- </script>
- </select1>
- <line id="line2" class="line_2" style="x1:0px; y1:50px; x2:215px; y2:50px; "/>
- <datagrid id="grd_shortcutlist" nodeset="/root/main/shortcutlist/rows" caption="메뉴그룹명^메뉴명^표시형태^^iconcd^menugrupcd^menuauthcd^menuitemcd^colorcd" colsep="^" colwidth="100, 110, 60, 40, 30, 92, 39, 97, 66, 100" dataheight="23" mergecellsfixedrows="bycolrec" rowheader="update" rowheight="23" rowsep="|" navindex="1" style="left:220px; top:30px; width:355px; height:745px; ">
- <col ref="menugrupnm"/>
- <col ref="menuitemnm"/>
- <col class="text_center" ref="icontype" type="combo">
- <choices>
- <itemset nodeset="/root/init/Z0014list/Z0014">
- <label ref="cdnm"/>
- <value ref="cdid"/>
- </itemset>
- </choices>
- </col>
- <col imemode="hangul" ref="icontext" type="input" style="text-align:center; "/>
- <col ref="iconcd" visibility="hidden"/>
- <col ref="menugrupcd" visibility="hidden" style="left:430px; top:23px; width:30px; height:23px; "/>
- <col ref="menuauthcd" visibility="hidden"/>
- <col ref="menuitemcd" visibility="hidden"/>
- <col ref="colorcd" visibility="hidden"/>
- <col ref="seq" visibility="hidden"/>
- <script type="javascript" ev:event="xforms-select">
- <![CDATA[
- if( grd_shortcutlist.col == 3 ){
- //표시형태 선택시 처리
- var icontype = model.getValue("/root/main/shortcutlist/rows["+grd_shortcutlist.row+"]/icontype");
- if(icontype == "I"){
- grd_iconlist.visible = true;
- grd_colorlist.visible = false;
- model.setFocus("grd_iconlist");
- }else{
- // model.setValue("/root/init/colorlist/rows/colornm", "red");
- // model.setValue("/root/init/colorlist/rows/colorcd", "red");
- grd_colorlist.visible = true;
- grd_iconlist.visible = false;
- grd_shortcutlist.col = 4;
- grd_shortcutlist.dispatch("onentercell");
- grd_shortcutlist.editCell();
- }
- }
- ]]>
- </script>
- <script type="javascript" ev:event="onendedit">
- <![CDATA[
- //iconText 입력시
- if( grd_shortcutlist.col == 4 ){
- var row = grd_shortcutlist.row;
- var iconText = model.getValue("/root/main/shortcutlist/rows[" + row + "]/icontext");
- if (iconText.getByteLength() > 8) {
- messageBox("한글, 영문을 합해 총 8글자를 초과", "E001");
- grd_shortcutlist.editCell();
- return;
- }
- fSetBackImageIconType(row);
- }
- ]]>
- </script>
- </datagrid>
- <button id="btn_grddel" class="btn2_letter2" style="left:643px; top:5px; width:42px; height:19px; ">
- <caption>삭제</caption>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- var row = grd_shortcutlist.row;
- grd_shortcutlist.deleteRow(row);
- ]]>
- </script>
- </button>
- <datagrid id="grd_iconlist" nodeset="/root/init/iconlist/rows" visibility="hidden" caption="선택^아이콘^iconcd^iconurl^iconurl" colsep="^" colwidth="40, 45, 50, 100" mergecellsfixedrows="bycolrec" rowsep="|" style="left:580px; top:30px; width:105px; height:745px; ">
- <col ref="checkyn" type="radio"/>
- <col ref="iconnm"/>
- <col ref="iconcd" visibility="hidden"/>
- <col ref="iconurl" visibility="hidden"/>
- <script type="javascript" ev:event="xforms-select">
- <![CDATA[
- if( grd_iconlist.col == 0){
- var row = grd_shortcutlist.row;
- var iconcd = model.getValue("/root/init/iconlist/rows[" +grd_iconlist.row+"]/iconcd");
-
- //선택이미지 저장
- model.setValue("/root/main/shortcutlist/rows["+row+"]/icontext", "");
- model.setValue("/root/main/shortcutlist/rows["+row+"]/iconcd", iconcd);
- //선택이미지 보이기
- fSetBackImageIconType(row);
-
- grd_iconlist.visible = false;
- model.refresh();
- }
- ]]>
- </script>
- </datagrid>
- <button id="btn_copy" class="btn2_letter2" style="left:553px; top:5px; width:42px; height:19px; ">
- <caption>복사</caption>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- var row = grd_shortcutlist.row;
- if(grd_shortcutlist.rowStatus(row) == 0){
- model.makeNode("/root/temp/shortcutlist/rows");
- model.copyNode("/root/temp/shortcutlist/rows","/root/main/shortcutlist/rows["+row+"]");
- grd_shortcutlist.deleteRow(row);
- }else{
- messageBox("새로운 행은 복사","E001");
- }
- ]]>
- </script>
- </button>
- <button id="btn_insert" class="btn2_letter2" style="left:598px; top:5px; width:42px; height:19px; ">
- <caption>삽입</caption>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- var node = instance1.selectSingleNode("/root/temp/shortcutlist/rows");
- if (node != null){
- grd_shortcutlist.insertRow(grd_shortcutlist.row);
- var row = grd_shortcutlist.row;
- model.copyNode("/root/main/shortcutlist/rows["+ row +"]", "/root/temp/shortcutlist/rows");
- model.setValue("/root/main/shortcutlist/rows["+ row +"]/seq", row);
-
- fSetBackImageIconType(row);
- fSetGridAddStatus(row);
- model.removeNodeset("/root/temp/shortcutlist/rows");
- model.refresh();
- }else{
- messageBox("복사한 행이 없으므로 삽입","E001");
- }
- ]]>
- </script>
- </button>
- <datagrid id="grd_colorlist" nodeset="/root/init/colorlist/rows" visibility="hidden" caption="선택^색상^cololrcd^iconurl" colsep="^" colwidth="40, 45, 50" focuscolor="transparent" mergecellsfixedrows="bycolrec" rowsep="|" style="left:580px; top:30px; width:105px; height:745px; ">
- <col ref="checkyn" type="radio"/>
- <col ref="colornm" type="output"/>
- <col ref="colorcd" visibility="hidden"/>
- <script type="javascript" ev:event="xforms-select">
- <![CDATA[
- if( grd_colorlist.col == 0){
- var row = grd_shortcutlist.row;
- var colorCd = model.getValue("/root/init/colorlist/rows[" +grd_colorlist.row+"]/colorcd");
-
- grd_shortcutlist.cellStyle("color", row, grd_shortcutlist.colRef("icontext")) = colorCd
- model.setValue("/root/main/shortcutlist/rows["+row+"]/colorcd", colorCd);
-
- grd_shortcutlist.addStatus(row, "update");
- grd_colorlist.visible = false;
- grd_colorlist.focusColor
-
- model.refresh();
- }
- ]]>
- </script>
- </datagrid>
- <import id="import1" overflow="hidden" instancetype="merge" src="../../../com/hismainweb/xrw/SSZUM01400_메뉴리스트.xrw" style="left:0px; top:54px; width:215px; height:744px; "/>
- </group>
- <group id="group1" scroll="auto" style="left:0px; top:798px; width:685px; height:27px; ">
- <button id="btn_confirm" class="btn4_letter2" navindex="2" style="left:570px; top:5px; width:56px; height:22px; ">
- <caption>저장</caption>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- var updtdata = getGridUpdateData(grd_shortcutlist);
- if (updtdata == "") {
- messageBox("변경된 데이터가","I004");
- return;
- }
-
- for( i = grd_shortcutlist.fixedRows; i < grd_shortcutlist.rows ; i++ ) {
- var status = grd_shortcutlist.rowStatus(i);
- if(status != 0){
- var iconType = grd_shortcutlist.valueMatrix(i,3);
- var iconText = grd_shortcutlist.valueMatrix(i,4);
- var iconCd = grd_shortcutlist.valueMatrix(i,5);
- var colorCd = grd_shortcutlist.valueMatrix(i,9);
-
- if(iconType == ""){
- messageBox("표시형태를","C002");
- grd_shortcutlist.row = i;
- grd_shortcutlist.col = 3;
- grd_shortcutlist.dispatch("onentercell");
- return;
- }
-
- if(iconType == "T" && iconText == "" ){
- messageBox("표시할 텍스트를","C001");
- grd_shortcutlist.row = i;
- grd_shortcutlist.col = 4;
- grd_shortcutlist.dispatch("onentercell");
- grd_shortcutlist.editCell();
- return;
- }
-
- if(iconType == "T" && colorCd== "" ){
- model.setValue("/root/main/shortcutlist/rows["+ i +"]/colorcd", "black");
- }
- if(iconType == "I" && iconCd == "" ){
- messageBox("표시할 아이콘을","C002");
- grd_shortcutlist.row = i;
- grd_shortcutlist.col = 4;
- grd_iconlist.visible = true;
- model.setFocus("grd_iconlist");
- return;
- }
- if(iconType == "I" && iconCd == "IDZUM10000" ){
- messageBox("표시할 아이콘을","C002");
- model.setValue("/root/main/shortcutlist/rows["+i+"]/iconcd","");
- model.setValue("/root/main/shortcutlist/rows["+i+"]/icontext","");
- grd_shortcutlist.cellStyle("background-image", i, 4) = "";
- grd_shortcutlist.row = i;
- grd_shortcutlist.col = 4;
- grd_iconlist.visible = true;
- model.setFocus("grd_iconlist");
- model.refresh();
- return;
- }
- }
- }
-
- // alert("grid update data = " + grd_shortcutlist.getUpdateData());
- model.setValue("/root/send/shortcutlist", updtdata);
- if ( submit("TXZUM01301") ) {
- grd_shortcutlist.clearStatus(); // submit() 성공하면 그리드의 i,u,d 상태 제거
- }
- ]]>
- </script>
- </button>
- <button id="btn_cancel" class="btn4_letter2" navindex="3" style="left:629px; top:5px; width:56px; height:22px; ">
- <caption>닫기</caption>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- window.htmlwindow.getShortcutMenuItem();
- window.close();
- ]]>
- </script>
- </button>
- <line id="line32" class="line_6" style="x1:0px; y1:0px; x2:685px; y2:0px; "/>
- </group>
- </xhtml:body>
- </xhtml:html>
|