SPZUM01300_사용자별바로가기.xrw 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445
  1. <?xml version="1.0" encoding="EUC-KR"?>
  2. <?xml-stylesheet href="../../../com/commonweb/css/common.css" type="text/css" ?>
  3. <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">
  4. <xhtml:head>
  5. <xhtml:title>바로가기등록</xhtml:title>
  6. <model id="model1">
  7. <instance id="instance1">
  8. <root xmlns="">
  9. <send>
  10. <shortcutlist/>
  11. <icontype>D</icontype>
  12. </send>
  13. <main>
  14. <shortcutlist>
  15. <rows>
  16. <menugrupnm/>
  17. <menuitemnm/>
  18. <icontype/>
  19. <icontext/>
  20. <iconcd/>
  21. <menugrupcd/>
  22. <menuauthcd/>
  23. <menuitemcd/>
  24. <colorcd/>
  25. <seq/>
  26. </rows>
  27. </shortcutlist>
  28. <menugruplist>
  29. <items>
  30. <menugrupcd/>
  31. <menugrupnm/>
  32. <menuauthcd/>
  33. </items>
  34. </menugruplist>
  35. </main>
  36. <init>
  37. <Z0014list/>
  38. <Z0012list/>
  39. <iconlist>
  40. <rows>
  41. <checkyn/>
  42. <iconnm/>
  43. <iconcd/>
  44. <iconurl/>
  45. </rows>
  46. </iconlist>
  47. <colorlist>
  48. <rows>
  49. <checkyn/>
  50. <colornm/>
  51. <colorcd/>
  52. </rows>
  53. </colorlist>
  54. </init>
  55. <temp>
  56. <shortcutlist/>
  57. </temp>
  58. </root>
  59. </instance>
  60. <bind id="bind1" ref="/root/main/shortcutlist/icontext" readonly="../icontype = 'I'"/>
  61. <submission id="TRZBC00101"/>
  62. <submission id="TRZUM01502" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" resultref="/root/init/iconlist"/>
  63. <submission id="TRZUM01301" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" resultref="/root/main/shortcutlist"/>
  64. <submission id="TRZUM01302" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" resultref="/root/main/menugruplist"/>
  65. <submission id="TXZUM01301" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" resultref="/root/temp"/>
  66. <script type="javascript" ev:event="xforms-model-construct-done">
  67. <![CDATA[
  68. //공통코드
  69. zbcfGetCodeList( new Array("Z0014"), new Array("/root/init/Z0014list") );
  70. zbcfGetCodeList( new Array("Z0012"), new Array("/root/init/Z0012list") );
  71. //아이콘리스트
  72. submit("TRZUM01502", false);
  73. //메뉴그룹리스트
  74. submit("TRZUM01302", false);
  75. /*
  76. 메뉴그룹 리스트 조회결과는 메뉴그룹이름, 아이디, 권한코드 등 다양한 정보를 가져오지만,
  77. 메뉴그룹명 콤보에는 메뉴그룹이름과 메뉴그룹 아이디만 가지고 있어서 동일한 메뉴그룹 아이디에 대한 표현이 원할하지 않다.
  78. 따라서 메뉴그룹명 콤보의 value 에는 메뉴그룹아이디+메뉴권한그룹아이디를 조합해서 unique 하게 생성한다.
  79. */
  80. var nodes = instance1.selectNodes("/root/main/menugruplist/items");
  81. if (nodes == null) {
  82. alert("menugrup combo is null.");
  83. return;
  84. }
  85. for (var i = 0, len = nodes.length; i < len; i++) {
  86. var node = nodes.item(i);
  87. node.selectSingleNode("menugrupid").value = node.selectSingleNode("menugrupcd").value + "|" + node.selectSingleNode("menuauthcd").value;
  88. }
  89. submit("TRZUM01301");
  90. ]]>
  91. </script>
  92. <script type="javascript" ev:event="xforms-ready">
  93. <![CDATA[
  94. fSetGridBackImage(grd_shortcutlist, 4);
  95. fSetGridBackImage(grd_iconlist, 1);
  96. fSetColorList();
  97. for(i = 1 ; i<= grd_shortcutlist.rows ; i++){
  98. var colorCd = model.getValue("/root/main/shortcutlist/rows["+i+"]/colorcd");
  99. if (colorCd == ""){
  100. return;
  101. }
  102. grd_shortcutlist.cellStyle("color", i, grd_shortcutlist.colRef("icontext")) = colorCd;
  103. }
  104. ]]>
  105. </script>
  106. </model>
  107. <script type="javascript" src="../../../com/commonweb/js/common.js"/>
  108. <script type="javascript" src="../../../com/basiccodeweb/js/ZBC001.js"/>
  109. <script type="javascript" src="../../../com/commonweb/js/tfHelper.js"/>
  110. <script type="javascript" src="../../../com/commonweb/js/stringHelper.js"/>
  111. <script type="javascript">
  112. <![CDATA[
  113. function fSetGridBackImage(gridObj, imgCell){
  114. gridObj.dataHeight = 30;
  115. var gridNode = gridObj.nodeset;
  116. for( var i = gridObj.fixedRows ; i < gridObj.Rows ; i++ ) {
  117. var iconurl = "../../../com/hismainweb/images/" + model.getValue(gridNode+"["+i+"]/iconcd") + ".gif";
  118. gridObj.cellStyle("background-image", i, imgCell) = iconurl;
  119. gridObj.cellStyle("background-position", i, imgCell) = "center";
  120. }
  121. }
  122. function fAddShortcutMenu(){
  123. grd_shortcutlist.addRow();
  124. var row = grd_shortcutlist.row;
  125. model.setValue("/root/main/shortcutlist/rows["+row+"]/seq", grd_shortcutlist.rows+1);
  126. model.setValue("/root/main/shortcutlist/rows["+row+"]/menugrupnm", cmb_menugrup.label);
  127. model.setValue("/root/main/shortcutlist/rows["+row+"]/menuitemnm", trv_menuitemlist.label);
  128. model.setValue("/root/main/shortcutlist/rows["+row+"]/menugrupcd", cmb_menugrup.value);
  129. model.setValue("/root/main/shortcutlist/rows["+row+"]/menuauthcd", model.getValue("/root/send/menuauthcd"));
  130. model.setValue("/root/main/shortcutlist/rows["+row+"]/menuitemcd", trv_menuitemlist.value);
  131. grd_shortcutlist.col = 3;
  132. grd_shortcutlist.dispatch("onentercell");
  133. fSetGridAddStatus(row);
  134. }
  135. //순서변경에 따른 Status 변경
  136. function fSetGridAddStatus(i){
  137. for(i; i < grd_shortcutlist.rows; i ++){
  138. grd_shortcutlist.addStatus(i, "update");
  139. model.setValue("/root/main/shortcutlist/rows["+i+"]/seq", i);
  140. }
  141. }
  142. //icontype에 따라 아이콘처리
  143. function fSetBackImageIconType(row){
  144. var icontype = model.getValue("/root/main/shortcutlist/rows["+row+"]/icontype");
  145. if(icontype == "T"){
  146. model.setValue("/root/main/shortcutlist/rows["+row+"]/iconcd", "IDZUM10000");
  147. grd_shortcutlist.cellStyle("background-image", row, 4) = "../../../com/hismainweb/images/IDZUM10000.gif";
  148. grd_shortcutlist.cellStyle("background-position", row, 4) = "center";
  149. }else{
  150. var iconcd = model.getValue("/root/main/shortcutlist/rows["+row+"]/iconcd");
  151. var iconurl = model.getValue("/root/init/iconlist/rows[iconcd='"+iconcd+"']/iconurl");
  152. grd_shortcutlist.cellStyle("background-image", row, 4) = "../../../"+iconurl;
  153. grd_shortcutlist.cellStyle("background-position", row, 4) = "center";
  154. }
  155. }
  156. function fSetColorList(){
  157. var nodes = instance1.selectNodes("/root/init/Z0012list/Z0012");
  158. for ( i = 1; i <= nodes.length ; i++){
  159. model.makeValue("/root/init/colorlist/rows["+ i +"]/colorcd",model.getValue("/root/init/Z0012list/Z0012["+ i +"]/cdid"));
  160. grd_colorlist.refresh();
  161. var colorCd = model.getValue("/root/init/colorlist/rows["+ i +"]/colorcd");
  162. grd_colorlist.cellstyle("background-color", i, grd_colorlist.colRef("colornm")) = colorCd;
  163. }
  164. //grd_colorlist.refresh();
  165. }
  166. ]]>
  167. </script>
  168. </xhtml:head>
  169. <xhtml:body pagewidth="701" pageheight="825" style="margin-left:8; margin-top:0; margin-right:8; margin-bottom:0; ">
  170. <group id="grp_biz" scroll="auto" style="left:0px; top:0px; width:685px; height:798px; ">
  171. <caption id="caption1" class="tit_2" style="left:5px; top:10px; width:100px; height:14px; ">바로가기 등록</caption>
  172. <line id="line1" class="line_1" style="x1:0px; y1:25px; x2:685px; y2:25px; "/>
  173. <caption id="caption2" class="cell_1" style="left:0px; top:30px; width:75px; height:20px; ">메뉴그룹명</caption>
  174. <select1 id="cmb_menugrup" ref="/root/send/menugrupcd" appearance="minimal" style="left:78px; top:30px; width:135px; height:19px; ">
  175. <choices>
  176. <itemset nodeset="/root/main/menugruplist/items">
  177. <label ref="menugrupnm"/>
  178. <value ref="menugrupcd"/>
  179. </itemset>
  180. </choices>
  181. <script type="javascript" ev:event="xforms-select">
  182. <![CDATA[
  183. //메뉴그룹에 해당하는 메뉴리스트 조회
  184. var idx = (cmb_menugrup.selectedindex)+1;
  185. var menugrupid = model.getValue("/root/main/menugruplist/items[" + idx + "]/menugrupid");
  186. //model.setValue("/root/send/menuauthcd", model.getValue("/root/main/menugruplist/items["+idx+"]/menuauthcd"));
  187. //alert(menugrupid.split("|")[0] + "\n" + menugrupid.split("|")[1]);
  188. model.makeValue("/root/send/menugrupcd", menugrupid.split("|")[0]);
  189. model.makeValue("/root/send/menuauthcd", menugrupid.split("|")[1]);
  190. model.refresh();
  191. model.removeNodeset("/root/properties/menuitemlist/items");
  192. submit("TRZUM01401");
  193. ]]>
  194. </script>
  195. </select1>
  196. <line id="line2" class="line_2" style="x1:0px; y1:50px; x2:215px; y2:50px; "/>
  197. <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; ">
  198. <col ref="menugrupnm"/>
  199. <col ref="menuitemnm"/>
  200. <col class="text_center" ref="icontype" type="combo">
  201. <choices>
  202. <itemset nodeset="/root/init/Z0014list/Z0014">
  203. <label ref="cdnm"/>
  204. <value ref="cdid"/>
  205. </itemset>
  206. </choices>
  207. </col>
  208. <col imemode="hangul" ref="icontext" type="input" style="text-align:center; "/>
  209. <col ref="iconcd" visibility="hidden"/>
  210. <col ref="menugrupcd" visibility="hidden" style="left:430px; top:23px; width:30px; height:23px; "/>
  211. <col ref="menuauthcd" visibility="hidden"/>
  212. <col ref="menuitemcd" visibility="hidden"/>
  213. <col ref="colorcd" visibility="hidden"/>
  214. <col ref="seq" visibility="hidden"/>
  215. <script type="javascript" ev:event="xforms-select">
  216. <![CDATA[
  217. if( grd_shortcutlist.col == 3 ){
  218. //표시형태 선택시 처리
  219. var icontype = model.getValue("/root/main/shortcutlist/rows["+grd_shortcutlist.row+"]/icontype");
  220. if(icontype == "I"){
  221. grd_iconlist.visible = true;
  222. grd_colorlist.visible = false;
  223. model.setFocus("grd_iconlist");
  224. }else{
  225. // model.setValue("/root/init/colorlist/rows/colornm", "red");
  226. // model.setValue("/root/init/colorlist/rows/colorcd", "red");
  227. grd_colorlist.visible = true;
  228. grd_iconlist.visible = false;
  229. grd_shortcutlist.col = 4;
  230. grd_shortcutlist.dispatch("onentercell");
  231. grd_shortcutlist.editCell();
  232. }
  233. }
  234. ]]>
  235. </script>
  236. <script type="javascript" ev:event="onendedit">
  237. <![CDATA[
  238. //iconText 입력시
  239. if( grd_shortcutlist.col == 4 ){
  240. var row = grd_shortcutlist.row;
  241. var iconText = model.getValue("/root/main/shortcutlist/rows[" + row + "]/icontext");
  242. if (iconText.getByteLength() > 8) {
  243. messageBox("한글, 영문을 합해 총 8글자를 초과", "E001");
  244. grd_shortcutlist.editCell();
  245. return;
  246. }
  247. fSetBackImageIconType(row);
  248. }
  249. ]]>
  250. </script>
  251. </datagrid>
  252. <button id="btn_grddel" class="btn2_letter2" style="left:643px; top:5px; width:42px; height:19px; ">
  253. <caption>삭제</caption>
  254. <script type="javascript" ev:event="DOMActivate">
  255. <![CDATA[
  256. var row = grd_shortcutlist.row;
  257. grd_shortcutlist.deleteRow(row);
  258. ]]>
  259. </script>
  260. </button>
  261. <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; ">
  262. <col ref="checkyn" type="radio"/>
  263. <col ref="iconnm"/>
  264. <col ref="iconcd" visibility="hidden"/>
  265. <col ref="iconurl" visibility="hidden"/>
  266. <script type="javascript" ev:event="xforms-select">
  267. <![CDATA[
  268. if( grd_iconlist.col == 0){
  269. var row = grd_shortcutlist.row;
  270. var iconcd = model.getValue("/root/init/iconlist/rows[" +grd_iconlist.row+"]/iconcd");
  271. //선택이미지 저장
  272. model.setValue("/root/main/shortcutlist/rows["+row+"]/icontext", "");
  273. model.setValue("/root/main/shortcutlist/rows["+row+"]/iconcd", iconcd);
  274. //선택이미지 보이기
  275. fSetBackImageIconType(row);
  276. grd_iconlist.visible = false;
  277. model.refresh();
  278. }
  279. ]]>
  280. </script>
  281. </datagrid>
  282. <button id="btn_copy" class="btn2_letter2" style="left:553px; top:5px; width:42px; height:19px; ">
  283. <caption>복사</caption>
  284. <script type="javascript" ev:event="DOMActivate">
  285. <![CDATA[
  286. var row = grd_shortcutlist.row;
  287. if(grd_shortcutlist.rowStatus(row) == 0){
  288. model.makeNode("/root/temp/shortcutlist/rows");
  289. model.copyNode("/root/temp/shortcutlist/rows","/root/main/shortcutlist/rows["+row+"]");
  290. grd_shortcutlist.deleteRow(row);
  291. }else{
  292. messageBox("새로운 행은 복사","E001");
  293. }
  294. ]]>
  295. </script>
  296. </button>
  297. <button id="btn_insert" class="btn2_letter2" style="left:598px; top:5px; width:42px; height:19px; ">
  298. <caption>삽입</caption>
  299. <script type="javascript" ev:event="DOMActivate">
  300. <![CDATA[
  301. var node = instance1.selectSingleNode("/root/temp/shortcutlist/rows");
  302. if (node != null){
  303. grd_shortcutlist.insertRow(grd_shortcutlist.row);
  304. var row = grd_shortcutlist.row;
  305. model.copyNode("/root/main/shortcutlist/rows["+ row +"]", "/root/temp/shortcutlist/rows");
  306. model.setValue("/root/main/shortcutlist/rows["+ row +"]/seq", row);
  307. fSetBackImageIconType(row);
  308. fSetGridAddStatus(row);
  309. model.removeNodeset("/root/temp/shortcutlist/rows");
  310. model.refresh();
  311. }else{
  312. messageBox("복사한 행이 없으므로 삽입","E001");
  313. }
  314. ]]>
  315. </script>
  316. </button>
  317. <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; ">
  318. <col ref="checkyn" type="radio"/>
  319. <col ref="colornm" type="output"/>
  320. <col ref="colorcd" visibility="hidden"/>
  321. <script type="javascript" ev:event="xforms-select">
  322. <![CDATA[
  323. if( grd_colorlist.col == 0){
  324. var row = grd_shortcutlist.row;
  325. var colorCd = model.getValue("/root/init/colorlist/rows[" +grd_colorlist.row+"]/colorcd");
  326. grd_shortcutlist.cellStyle("color", row, grd_shortcutlist.colRef("icontext")) = colorCd
  327. model.setValue("/root/main/shortcutlist/rows["+row+"]/colorcd", colorCd);
  328. grd_shortcutlist.addStatus(row, "update");
  329. grd_colorlist.visible = false;
  330. grd_colorlist.focusColor
  331. model.refresh();
  332. }
  333. ]]>
  334. </script>
  335. </datagrid>
  336. <import id="import1" overflow="hidden" instancetype="merge" src="../../../com/hismainweb/xrw/SSZUM01400_메뉴리스트.xrw" style="left:0px; top:54px; width:215px; height:744px; "/>
  337. </group>
  338. <group id="group1" scroll="auto" style="left:0px; top:798px; width:685px; height:27px; ">
  339. <button id="btn_confirm" class="btn4_letter2" navindex="2" style="left:570px; top:5px; width:56px; height:22px; ">
  340. <caption>저장</caption>
  341. <script type="javascript" ev:event="DOMActivate">
  342. <![CDATA[
  343. var updtdata = getGridUpdateData(grd_shortcutlist);
  344. if (updtdata == "") {
  345. messageBox("변경된 데이터가","I004");
  346. return;
  347. }
  348. for( i = grd_shortcutlist.fixedRows; i < grd_shortcutlist.rows ; i++ ) {
  349. var status = grd_shortcutlist.rowStatus(i);
  350. if(status != 0){
  351. var iconType = grd_shortcutlist.valueMatrix(i,3);
  352. var iconText = grd_shortcutlist.valueMatrix(i,4);
  353. var iconCd = grd_shortcutlist.valueMatrix(i,5);
  354. var colorCd = grd_shortcutlist.valueMatrix(i,9);
  355. if(iconType == ""){
  356. messageBox("표시형태를","C002");
  357. grd_shortcutlist.row = i;
  358. grd_shortcutlist.col = 3;
  359. grd_shortcutlist.dispatch("onentercell");
  360. return;
  361. }
  362. if(iconType == "T" && iconText == "" ){
  363. messageBox("표시할 텍스트를","C001");
  364. grd_shortcutlist.row = i;
  365. grd_shortcutlist.col = 4;
  366. grd_shortcutlist.dispatch("onentercell");
  367. grd_shortcutlist.editCell();
  368. return;
  369. }
  370. if(iconType == "T" && colorCd== "" ){
  371. model.setValue("/root/main/shortcutlist/rows["+ i +"]/colorcd", "black");
  372. }
  373. if(iconType == "I" && iconCd == "" ){
  374. messageBox("표시할 아이콘을","C002");
  375. grd_shortcutlist.row = i;
  376. grd_shortcutlist.col = 4;
  377. grd_iconlist.visible = true;
  378. model.setFocus("grd_iconlist");
  379. return;
  380. }
  381. if(iconType == "I" && iconCd == "IDZUM10000" ){
  382. messageBox("표시할 아이콘을","C002");
  383. model.setValue("/root/main/shortcutlist/rows["+i+"]/iconcd","");
  384. model.setValue("/root/main/shortcutlist/rows["+i+"]/icontext","");
  385. grd_shortcutlist.cellStyle("background-image", i, 4) = "";
  386. grd_shortcutlist.row = i;
  387. grd_shortcutlist.col = 4;
  388. grd_iconlist.visible = true;
  389. model.setFocus("grd_iconlist");
  390. model.refresh();
  391. return;
  392. }
  393. }
  394. }
  395. // alert("grid update data = " + grd_shortcutlist.getUpdateData());
  396. model.setValue("/root/send/shortcutlist", updtdata);
  397. if ( submit("TXZUM01301") ) {
  398. grd_shortcutlist.clearStatus(); // submit() 성공하면 그리드의 i,u,d 상태 제거
  399. }
  400. ]]>
  401. </script>
  402. </button>
  403. <button id="btn_cancel" class="btn4_letter2" navindex="3" style="left:629px; top:5px; width:56px; height:22px; ">
  404. <caption>닫기</caption>
  405. <script type="javascript" ev:event="DOMActivate">
  406. <![CDATA[
  407. window.htmlwindow.getShortcutMenuItem();
  408. window.close();
  409. ]]>
  410. </script>
  411. </button>
  412. <line id="line32" class="line_6" style="x1:0px; y1:0px; x2:685px; y2:0px; "/>
  413. </group>
  414. </xhtml:body>
  415. </xhtml:html>