MMR02500.js 41 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408
  1. /*
  2. - ▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩
  3. 서식리스트 ( MMR02500_서식리스트.xrw - JScript )
  4. - Version :
  5. 1) : Ver.1.00.01
  6. - ▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩
  7. */
  8. var isAdmin = fUserAdmin();
  9. var refresh_u = 0;
  10. var refresh_d = 0;
  11. var refresh_a = 0;
  12. var sSETLIST = "/root/main/indxlist/item";
  13. var sSETLIST_HIDDEN = "/root/hidden/indxlist/item";
  14. var sMOUSE_CLK_STATUS; //마우스 클릭 좌우버튼 구분
  15. //var obj; //트리뷰 구분
  16. /**
  17. * @desc : 서식트리 마우스 팝업 처리
  18. * @id : trv_formlist
  19. * @event : onmousedown
  20. * @return : void
  21. * @authur : 박종훈
  22. */
  23. function fFormMouseRghtBtnPopup() {
  24. var selectedFormcd = trv_formlist.value;
  25. if(selectedFormcd != "" && selectedFormcd != null)
  26. {
  27. if(isAdmin == 1){
  28. setPopupMenu("trv_formlist", false, "/root/init/diagmsrghtssik/mouserght", "label", "func");
  29. } else if(isAdmin == 0){
  30. setPopupMenu("trv_formlist", false, "/root/init/diagmsrght/mouserght", "label", "func");
  31. }
  32. } else {
  33. initPopupMenu();
  34. }
  35. }
  36. /**
  37. * @desc : 기본서식설정
  38. * @id : trv_formlist
  39. * @event : onmousedown
  40. * @return : void
  41. * @authur : 박종훈
  42. */
  43. function fSetDefForm() {
  44. var selectedFormcd = trv_formlist.value;
  45. if(selectedFormcd != "" && selectedFormcd != null)
  46. {
  47. var formcd = selectedFormcd;
  48. var formbsetflag = "D";
  49. var formbsetdeptcd = "";
  50. if(isAdmin == 1){
  51. var formdeptcd = model.getValue("/root/main/formlist/item[formcd=" + formcd +"]/formdeptcd");
  52. formbsetdeptcd = formdeptcd.split(".")[0];
  53. }
  54. model.makeValue("/root/send/temp/formcd", formcd);
  55. model.makeValue("/root/send/temp/formbsetflag", formbsetflag);
  56. model.makeValue("/root/send/temp/formbsetdeptcd", formbsetdeptcd);
  57. submit("TXMMR02501");
  58. parent.window.javascript.fFavorRefresh(); // 즐겨찾기 refresh
  59. }
  60. }
  61. /**
  62. * @desc : 즐겨찾기추가
  63. * @id : trv_formlist
  64. * @event : onmousedown
  65. * @return : void
  66. * @authur : 박종훈
  67. */
  68. function fSetFavorForm() {
  69. var selectedFormcd = trv_formlist.value;
  70. if(selectedFormcd != "" && selectedFormcd != null)
  71. {
  72. var formcd = selectedFormcd;
  73. var formbsetflag = "F";
  74. var formbsetdeptcd = "";
  75. model.makeValue("/root/send/temp/formcd", formcd);
  76. model.makeValue("/root/send/temp/formbsetflag", formbsetflag);
  77. model.makeValue("/root/send/temp/formbsetdeptcd", formbsetdeptcd);
  78. submit("TXMMR02501");
  79. parent.window.javascript.fFavorRefresh(); // 즐겨찾기 refresh
  80. }
  81. }
  82. /**
  83. * @desc : 폼초기화
  84. * @
  85. * @param : flag (0:서식목록, 1:서식셋관리)
  86. * @return :
  87. * @---------------------------------------------------
  88. */
  89. function fFormInit(flag){
  90. // 폴더명칭 popup
  91. grup_saveas.visible = "false";
  92. // 부서코드 리스트 불러오기...
  93. reqGetDeptList("/root/send/reqdeptlist", "/root/init/deptlist", "", "012");
  94. model.makeValue("/root/init/deptlist/orddept/deptcd","ALL");
  95. model.makeValue("/root/init/deptlist/orddept/deptnm","전체");
  96. model.refresh();
  97. // admin 인가? 보여줄것만 보여준다..
  98. // 관리자 : 개인, 과, 전체 등록/수정/삭제 가능
  99. // 사용자 : 개인만 가능
  100. var result = fUserAdmin();
  101. if (result == true)
  102. {
  103. grup_srch1.visible = "true";
  104. grup_srch2.visible = "true";
  105. model.setValue("/root/send/cond/admin", "true");
  106. } else {
  107. grup_srch1.visible = "false";
  108. grup_srch2.visible = "false";
  109. model.setValue("/root/send/cond/admin", "false");
  110. }
  111. // 사용자정보 셋...
  112. model.setValue("/root/send/cond/userid", getUserId());
  113. model.setValue("/root/send/cond/usernm", getUserInfo("usernm"));
  114. model.setValue("/root/send/cond/deptcd", getUserInfo("dutplcecd"));
  115. model.setValue("/root/send/cond/mydeptcd", getUserInfo("dutplcecd"));
  116. model.setValue("/root/send/cond/jobkind", getUserInfo("jobkindcd"));
  117. model.toggle("case_dept");
  118. btn_dept.dispatch("DOMActivate");
  119. // 디폴트 트리뷰
  120. if (flag == 0 ) {
  121. // 서식목록일때만 과코드 부여해준다..
  122. model.setValue("/root/send/reqdata/deptcd", getUserInfo("dutplcecd"));
  123. // Switch (개인,과,전체,서식목록)
  124. sw_setflag.case_user.selected = "false";
  125. sw_setflag.case_dept.selected = "true";
  126. sw_setflag.case_all.selected = "false";
  127. sw_setflag.case_list.selected = "false";
  128. sw_setflag.refresh();
  129. // 과 목록 보여주자~
  130. fSetIndxListSelect("D");
  131. } else {
  132. // Switch (개인,과,전체,서식목록)
  133. sw_setflag.case_user.selected = "false";
  134. sw_setflag.case_dept.selected = "true";
  135. sw_setflag.case_all.selected = "false";
  136. sw_setflag.refresh();
  137. // 과 목록 보여주자~
  138. fSetIndxListSelect("D");
  139. }
  140. }
  141. /**
  142. * @desc : 버튼 클릭 (개인/과/전체)
  143. * @
  144. * @param :
  145. * @return :
  146. * @---------------------------------------------------
  147. */
  148. function fSetIndxListSelect(setflag){
  149. model.setValue("/root/send/cond/setflag", setflag);
  150. model.refresh();
  151. grup_saveas.visible = "false";
  152. // 개인
  153. if (setflag == "U") {
  154. btn_user.selected = "true";
  155. if (refresh_u == 0) {
  156. submit("TRMRF03102");
  157. model.removeNodeset("/root/main/indxlist_u/item");
  158. model.copyNode("/root/main/indxlist_u", "/root/main/indxlist");
  159. model.refresh();
  160. } else {
  161. copyNodeset("/root/main/indxlist/item", "/root/main/indxlist_u/item");
  162. model.refresh();
  163. }
  164. refresh_u = 1;
  165. // 첫번째 만 오픈하자!!
  166. trv_indxlist_u.expand(0, true);
  167. // 과
  168. } else if (setflag == "D") {
  169. btn_dept.selected = "true";
  170. if (refresh_d == 0) {
  171. submit("TRMRF03102");
  172. model.removeNodeset("/root/main/indxlist_d/item");
  173. model.copyNode("/root/main/indxlist_d", "/root/main/indxlist");
  174. model.refresh();
  175. } else {
  176. copyNodeset("/root/main/indxlist/item", "/root/main/indxlist_d/item");
  177. model.refresh();
  178. }
  179. refresh_d = 1;
  180. // 첫번째 만 오픈하자!!
  181. trv_indxlist_d.expand(0, true);
  182. // 공통
  183. } else if (setflag == "A") {
  184. btn_all.selected = "true";
  185. if (refresh_a == 0) {
  186. submit("TRMRF03102");
  187. model.removeNodeset("/root/main/indxlist_a/item");
  188. model.copyNode("/root/main/indxlist_a", "/root/main/indxlist");
  189. model.refresh();
  190. } else {
  191. copyNodeset("/root/main/indxlist/item", "/root/main/indxlist_a/item");
  192. model.refresh();
  193. }
  194. refresh_a = 1;
  195. // 첫번째 만 오픈하자!!
  196. trv_indxlist_a.expand(0, true);
  197. }
  198. }
  199. /**
  200. * @desc : 과 선택
  201. * @
  202. * @param :
  203. * @return :
  204. * @---------------------------------------------------
  205. */
  206. function fDeptCDSelect(){
  207. submit("TRMRF03102");
  208. model.removeNodeset("/root/main/indxlist_d/item");
  209. //model.copyNode("/root/main/indxlist_d", "/root/main/indxlist");
  210. copyNode(model, model, "/root/main/indxlist_d", "/root/main/indxlist");
  211. model.refresh();
  212. }
  213. /**
  214. * @desc : 사용자정보
  215. * @
  216. * @param :
  217. * @return :
  218. * @---------------------------------------------------
  219. */
  220. function fGetUserInfo(userid,usernm,deptcd , instcd)
  221. {
  222. model.setValue("/root/send/cond/userid", userid);
  223. model.setValue("/root/send/cond/usernm", usernm);
  224. model.setValue("/root/send/cond/deptcd", deptcd);
  225. ipt_saveas_userid.text = usernm;
  226. ipt_saveas_userid.refresh();
  227. submit("TRMRF03102");
  228. model.makeValue("/root/temp/instcd",instcd); //조회한 사용자 기관코드
  229. model.removeNodeset("/root/main/indxlist_u/item");
  230. //model.copyNode("/root/main/indxlist_u", "/root/main/indxlist");
  231. copyNode(model, model, "/root/main/indxlist_u", "/root/main/indxlist");
  232. model.refresh();
  233. }
  234. /*
  235. - ▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩
  236. */
  237. /**
  238. * @desc : 트리뷰 셋
  239. * @
  240. * @param :
  241. * @return :
  242. * @---------------------------------------------------
  243. */
  244. function fSetTreeView(){
  245. var setflag = model.getValue("/root/send/cond/setflag");
  246. var rtn = "";
  247. if (setflag == "U") {
  248. rtn = "trv_indxlist_u" + "|" + "/root/main/indxlist_u/item";
  249. }
  250. if (setflag == "D") {
  251. rtn = "trv_indxlist_d" + "|" + "/root/main/indxlist_d/item";
  252. }
  253. if (setflag == "A") {
  254. rtn = "trv_indxlist_a" + "|" + "/root/main/indxlist_a/item";
  255. }
  256. return rtn;
  257. }
  258. /**
  259. * @desc : 마우스 오른쪽 버튼 팝업창
  260. * @
  261. * @param :
  262. * @return :
  263. * @---------------------------------------------------
  264. * 1. 마우스 우클릭인가?
  265. * 2. 관리자인가? 사용자인가?
  266. * 3. 구분이 개인인가? 과인가? 전체인가?
  267. * 4. 폴더인가? 파일인가? 루트인가?
  268. */
  269. function fMouseRghtBtnPopup(){
  270. var rtn = fSetTreeView();
  271. rtn = rtn.split("|");
  272. var obj = document.controls(rtn[0]);
  273. var path = rtn[1];
  274. if(event.button == 3){
  275. if(obj.isCell(event.target) && obj.selectedIndex > -1) {
  276. var item = obj.item(obj.selectedIndex);
  277. var rowpos = item.index + 1;
  278. var depth = model.getValue(sSETLIST + "[" + rowpos + "]/depth");
  279. var item_length = obj.length;
  280. // 루트인가? (보여주는 부분으로..)
  281. if (depth == 0 && item_length > 1) {
  282. window.setPopupMenu(false); return;
  283. }
  284. // 관리자인가? 구분이 개인인가?
  285. var admin = model.getValue("/root/send/cond/admin");
  286. var setflag = model.getValue("/root/send/cond/setflag");
  287. if(setflag =="U"){ // 개인 indx
  288. sSETLIST = "/root/main/indxlist_u/item"
  289. }else if(setflag =="D"){ // 과 indx
  290. sSETLIST = "/root/main/indxlist_d/item"
  291. }
  292. if (admin == "true" || setflag == "U") {
  293. if(setflag == "A"){ //전체는 입력안됨
  294. return;
  295. }
  296. if (depth < 2) {
  297. window.setPopupMenu(true, "/root/temp/menu2/menu", "label", "func", false); return;
  298. }
  299. var linkflag = model.getValue(sSETLIST + "[" + rowpos + "]/linkflag");
  300. if (linkflag == "N") {
  301. // 폴더인경우, 새폴더/폴더수정/폴더삭제..
  302. window.setPopupMenu(true, "/root/temp/menu/menu", "label", "func", false); return;
  303. } else if (linkflag == "Y") {
  304. // 파일인경우, 파일삭제만..
  305. window.setPopupMenu(true, "/root/temp/menu1/menu", "label", "func", false); return;
  306. } else {
  307. window.setPopupMenu(false);
  308. }
  309. } else {
  310. window.setPopupMenu(false);
  311. }
  312. } else {
  313. window.setPopupMenu(false);
  314. }
  315. }else{
  316. window.setPopupMenu(false);
  317. }
  318. }
  319. /**
  320. * @desc : 새폴더 추가
  321. * @
  322. * @param :
  323. * @return :
  324. * @---------------------------------------------------
  325. */
  326. function fAddDiagSet(){
  327. var rtn = fSetTreeView();
  328. rtn = rtn.split("|");
  329. var obj = document.controls(rtn[0]);
  330. var path = rtn[1];
  331. var item = obj.item(obj.selectedIndex);
  332. var rowPos = item.index + 1;
  333. fSetDiagInfo(rowPos, "i");
  334. model.setValue(sSETLIST_HIDDEN + "/status", "i");
  335. model.setValue("/root/main/iptbox/indxnm", "");
  336. model.refresh();
  337. fShowWndIptBox();
  338. }
  339. /**
  340. * @desc : 폴더 삭제
  341. * @
  342. * @param :
  343. * @return :
  344. * @---------------------------------------------------
  345. */
  346. function fDelDiagSet(){
  347. var rtn = fSetTreeView();
  348. rtn = rtn.split("|");
  349. var obj = document.controls(rtn[0]);
  350. var path = rtn[1];
  351. var item = obj.item(obj.selectedIndex);
  352. var rowPos = item.index + 1;
  353. if(fSetDiagInfo(rowPos, "d")!= -1){
  354. fSaveDiagSet("Y");
  355. }
  356. }
  357. /**
  358. * @desc : 폴더 수정
  359. * @
  360. * @param :
  361. * @return :
  362. * @---------------------------------------------------
  363. */
  364. function fUpdtDiagSet(){
  365. var rtn = fSetTreeView();
  366. rtn = rtn.split("|");
  367. var obj = document.controls(rtn[0]);
  368. var path = rtn[1];
  369. var item = obj.item(obj.selectedIndex);
  370. var rowPos = item.index + 1;
  371. var indxnm = item.label;
  372. model.setValue("/root/main/iptbox/indxnm", indxnm);
  373. model.refresh();
  374. if(fSetDiagInfo(rowPos, "u")!=-1){
  375. fShowWndIptBox();
  376. }
  377. }
  378. /**
  379. * @desc : 서식 SET 저장
  380. * @
  381. * @param :
  382. * @return :
  383. * @---------------------------------------------------
  384. */
  385. function fSaveDiagSet(linkflag){
  386. grup_saveas.visible = "false";
  387. var indxnm = model.getValue("/root/main/iptbox/indxnm");
  388. if (linkflag == "N" && indxnm == "") {
  389. messageBox("폴더명칭을 ", "C001");
  390. return;
  391. }
  392. model.setValue(sSETLIST_HIDDEN + "/indxnm" , indxnm);
  393. model.setValue(sSETLIST_HIDDEN + "/linkflag" , linkflag);
  394. var admin = model.getValue("/root/send/cond/admin");
  395. model.setvalue(sSETLIST_HIDDEN + "/admin" , admin);
  396. var setflag = model.getValue("/root/send/cond/setflag");
  397. model.setvalue(sSETLIST_HIDDEN + "/setflag" , setflag);
  398. // 구분에 따라 [과, 사용자] 정보를 넘겨야 하는데...
  399. var userid = model.getValue("/root/send/cond/userid");
  400. var deptcd = model.getValue("/root/send/cond/deptcd");
  401. if (setflag == "U")
  402. {
  403. model.setValue(sSETLIST_HIDDEN + "/userid" , userid);
  404. model.setValue(sSETLIST_HIDDEN + "/deptcd" , deptcd);
  405. } else if (setflag == "D")
  406. {
  407. model.setValue(sSETLIST_HIDDEN + "/userid" , "");
  408. model.setValue(sSETLIST_HIDDEN + "/deptcd" , deptcd);
  409. }
  410. // 로그인 과 정보 넘기기...
  411. model.makeValue(sSETLIST_HIDDEN + "/mydeptcd", getUserInfo("dutplcecd"));
  412. model.copyNode("/root/send/savedata", sSETLIST_HIDDEN);
  413. submit("TXMRF03101");
  414. if (setflag == "U") {
  415. model.removeNodeset("/root/main/indxlist_u/item");
  416. model.copyNode("/root/main/indxlist_u", "/root/main/indxlist");
  417. refresh_u = 1; refresh_a = 0;
  418. } else if (setflag == "D") {
  419. model.removeNodeset("/root/main/indxlist_d/item");
  420. model.copyNode("/root/main/indxlist_d", "/root/main/indxlist");
  421. refresh_d = 1; refresh_a = 0;
  422. } else if (setflag == "A") {
  423. model.removeNodeset("/root/main/indxlist_a/item");
  424. model.copyNode("/root/main/indxlist_a", "/root/main/indxlist");
  425. refresh_u = 0; refresh_d = 0; refresh_a = 1;
  426. }
  427. model.refresh();
  428. }
  429. /**
  430. * @desc : 서식관리 폴더명을 입력할 InputBox를 보여줌.
  431. * @
  432. * @param :
  433. * @return :
  434. * @---------------------------------------------------
  435. */
  436. function fShowWndIptBox(){
  437. grup_saveas.attribute("top") = event.clientY;
  438. grup_saveas.visible = "true";
  439. }
  440. /**
  441. * @desc : 서식 SET 조회
  442. * @
  443. * @param :
  444. * @return :
  445. * @---------------------------------------------------
  446. */
  447. function fReqDetlSet(){
  448. var rtn = fSetTreeView();
  449. rtn = rtn.split("|");
  450. var obj = document.controls(rtn[0]);
  451. var path = rtn[1];
  452. if (obj.selectedIndex == 0) {
  453. return;
  454. }
  455. var item = obj.item(obj.selectedIndex);
  456. if (item != null) {
  457. var rowpos = item.index + 1;
  458. fSetDiagInfo(rowpos);
  459. var depth = model.getValue(sSETLIST_HIDDEN + "/depth");
  460. if(depth == 2){
  461. return;
  462. }
  463. }
  464. }
  465. /**
  466. * @desc : Mouse Drag Drop
  467. * @
  468. * @param :
  469. * @return : void
  470. * @authur :
  471. * @---------------------------------------------------
  472. */
  473. function fOndrop(){
  474. var rtn = fSetTreeView();
  475. rtn = rtn.split("|");
  476. var obj = document.controls(rtn[0]);
  477. var path = rtn[1];
  478. var rowpos = obj.mouseRow + 1;
  479. var depth = model.getValue(sSETLIST + "[" + rowpos + "]/depth");
  480. var indxnm = model.getValue(sSETLIST + "[" + rowpos + "]/indxnm");
  481. var x = event.clientX;
  482. var maxposX = 24 + 16 * (depth - 1) + ( 13 * indxnm.length);
  483. var minposX = 24 + 16 * (depth - 1);
  484. if(maxposX > x){
  485. fDiagSetDrop();
  486. }else{
  487. return;
  488. }
  489. }
  490. /**
  491. * @desc : Mouse Drag Over
  492. * @
  493. * @param :
  494. * @return : void
  495. * @authur :
  496. * @---------------------------------------------------
  497. */
  498. function fMouseOver(){
  499. var rtn = fSetTreeView();
  500. rtn = rtn.split("|");
  501. var obj = document.controls(rtn[0]);
  502. var path = rtn[1];
  503. var rowpos = obj.mouseRow + 1;
  504. var depth = model.getValue(sSETLIST + "[" + rowpos + "]/depth");
  505. var indxnm = model.getValue(sSETLIST + "[" + rowpos + "]/indxnm");
  506. var x = event.clientX;
  507. var maxposX = 24 + 16 * (depth - 1) + ( 10 * indxnm.length);
  508. var minposX = 24 + 16 * (depth - 1);
  509. if(maxposX > x){
  510. for ( var i = 0; i < obj.length; i++ ) {
  511. obj.item(i).attribute("background-color") = "#ffffff";
  512. obj.item(i).attribute("text-decoration") = "";
  513. }
  514. obj.item(obj.mouseRow).attribute("background-color") = "#ece1ec";
  515. obj.item(obj.mouseRow).attribute("text-decoration") = "";
  516. }
  517. }
  518. /**
  519. * @desc : TreeView에 Drag상태로 Mouse over된 경우 item의 background color를 clear함
  520. * @
  521. * @param :
  522. * @return : void
  523. * @authur :
  524. * @---------------------------------------------------
  525. */
  526. function fOnDragMouseOver(){
  527. var rtn = fSetTreeView();
  528. rtn = rtn.split("|");
  529. var obj = document.controls(rtn[0]);
  530. var path = rtn[1];
  531. var treeObj = document.controls.item(event.currentTarget);
  532. var rowpos = obj.mouseRow + 1;
  533. var depth = model.getValue(sSETLIST + "[" + rowpos + "]/depth");
  534. var indxnm = model.getValue(sSETLIST + "[" + rowpos + "]/indxnm");
  535. var x = event.clientX;
  536. var maxposX = 24 + 16 * (depth - 1) + ( 10 * indxnm.length);
  537. var minposX = 24 + 16 * (depth - 1);
  538. if(maxposX > x){
  539. if( obj.selectedIndex != treeObj.mouseRow ) {
  540. for ( var i = 0; i < treeObj.length; i++ ) {
  541. treeObj.item(i).attribute("background-color") = "#ffffff";
  542. treeObj.item(i).attribute("text-decoration") = "";
  543. }
  544. treeObj.item(treeObj.mouseRow).attribute("background-color") = "#ece1ec";
  545. treeObj.item(treeObj.mouseRow).attribute("text-decoration") = "";
  546. }
  547. }
  548. }
  549. /**
  550. * @desc : 서식 SET Drag
  551. * @
  552. * @param :
  553. * @return :
  554. * @---------------------------------------------------
  555. */
  556. function fDiagSetDrag(){
  557. var rtn = fSetTreeView();
  558. rtn = rtn.split("|");
  559. var obj = document.controls(rtn[0]);
  560. var path = rtn[1];
  561. if (obj.selectedIndex == 0) {
  562. return;
  563. }
  564. var item = obj.item(obj.selectedIndex);
  565. if (item != null) {
  566. var rowpos = item.index + 1;
  567. fSetDiagInfo(rowpos, "u");
  568. var indxnm = model.getValue(sSETLIST + "[" + rowpos + "]/indxnm");
  569. model.setValue("/root/main/iptbox/indxnm", indxnm);
  570. model.refresh();
  571. }
  572. }
  573. /**
  574. * @desc : 서식 SET Drop
  575. * @
  576. * @param :
  577. * @return :
  578. * @---------------------------------------------------
  579. */
  580. function fDiagSetDrop(){
  581. var rtn = fSetTreeView();
  582. rtn = rtn.split("|");
  583. var obj = document.controls(rtn[0]);
  584. var path = rtn[1];
  585. fClrTreeViweSelect();
  586. var admin = model.getValue("/root/send/cond/admin");
  587. var setflag = model.getValue("/root/send/cond/setflag");
  588. // 관리자인가? 구분이 개인인가?
  589. if (admin == "true" || setflag == "U") {
  590. var treeObj = document.controls.item(event.currentTarget);
  591. var rowpos = obj.mouseRow + 1;
  592. var depth = model.getValue(sSETLIST + "[" + rowpos + "]/depth");
  593. var itemindxseq = model.getValue(sSETLIST + "[" + rowpos + "]/itemindxseq");
  594. var supitemindxseq = model.getValue(sSETLIST + "[" + rowpos + "]/supitemindxseq");
  595. var linkflag = model.getValue(sSETLIST + "[" + rowpos + "]/linkflag");
  596. var cmpdepth = model.getValue(sSETLIST_HIDDEN + "/depth");
  597. var cmpitemindxseq = model.getValue(sSETLIST_HIDDEN + "/itemindxseq");
  598. var cmpsupitemindxseq = model.getValue(sSETLIST_HIDDEN + "/supitemindxseq");
  599. var cmplinkflag = model.getValue(sSETLIST_HIDDEN + "/linkflag");
  600. // 이동하는 폴더가 파일 아래로 이동하는것 방지함.
  601. if(linkflag == "Y"){
  602. messageBox("폴더가 아닌 위치로 이동", "E001");
  603. obj.item(obj.mouseRow).attribute("background-color") = "#ffffff";
  604. obj.item(obj.mouseRow).attribute("text-decoration") = "";
  605. return;
  606. }
  607. if(itemindxseq == cmpitemindxseq){
  608. // messageBox("동일한 위치로 이동", "E001");
  609. obj.item(obj.mouseRow).attribute("background-color") = "#ffffff";
  610. obj.item(obj.mouseRow).attribute("text-decoration") = "";
  611. return;
  612. }else if(itemindxseq == cmpsupitemindxseq){
  613. // 같은 과, 같은 사용자가 아니면 이동이 안됨. (why? with문 update가 안되니까..)
  614. // if (deptcd != cmpdeptcd || userid != cmpuserid) {
  615. // messageBox("지정된 위치로 이동", "E001");
  616. // obj.item(obj.mouseRow).attribute("background-color") = "#ffffff";
  617. // obj.item(obj.mouseRow).attribute("text-decoration") = "";
  618. // return;
  619. // }
  620. }
  621. //이동하는 SET폴더의 depth가 도착하는 곳보다 낮은 레벨일 경우,
  622. //자신의 child node 아래로 이동하는 것을 방지함.
  623. if(cmpdepth < depth){
  624. var rootdepth;
  625. var rootitemindxseq;
  626. while(cmpdepth != rootdepth){
  627. rootdepth = model.getValue(sSETLIST + "[" + rowpos + "]/depth");
  628. rootitemindxseq = model.getValue(sSETLIST + "[" + rowpos + "]/itemindxseq");
  629. rowpos--;
  630. }
  631. if(rootitemindxseq == cmpitemindxseq){
  632. messageBox("지정된 위치로 이동", "E001");
  633. obj.item(obj.mouseRow).attribute("background-color") = "#ffffff";
  634. obj.item(obj.mouseRow).attribute("text-decoration") = "";
  635. return;
  636. }
  637. }
  638. // 이동 폴더의 (과, 사용자) 정보, 이동 대상의 (과, 사용자) 정보
  639. var deptcd = model.getValue(sSETLIST + "[" + rowpos + "]/deptcd");
  640. var userid = model.getValue(sSETLIST + "[" + rowpos + "]/userid");
  641. var cmpdeptcd = model.getValue(sSETLIST_HIDDEN + "/deptcd");
  642. var cmpuserid = model.getValue(sSETLIST_HIDDEN + "/userid");
  643. // 같은 과, 같은 사용자가 아니면 이동이 안됨. (why? with문 update가 안되니까..)
  644. if (deptcd != cmpdeptcd || userid != cmpuserid) {
  645. messageBox("지정된 위치로 이동", "E001");
  646. obj.item(obj.mouseRow).attribute("background-color") = "#ffffff";
  647. obj.item(obj.mouseRow).attribute("text-decoration") = "";
  648. return;
  649. }
  650. // 이동 폴더의 (과, 사용자) 정보를 셋함...
  651. model.setValue(sSETLIST_HIDDEN + "/deptcd" , deptcd);
  652. model.setValue(sSETLIST_HIDDEN + "/userid" , userid);
  653. model.setValue(sSETLIST_HIDDEN + "/supitemindxseq" , itemindxseq);
  654. fSaveDiagSet("Y");
  655. }
  656. }
  657. /**
  658. * @desc : 폴더명 검색할 경우 검색한 위치로 focus를 이동한다.
  659. * @
  660. * @param :
  661. * @return : void
  662. * @authur :
  663. * @---------------------------------------------------
  664. */
  665. function fSrchDiagIndxNM(){
  666. var rtn = fSetTreeView();
  667. rtn = rtn.split("|");
  668. var obj = document.controls(rtn[0]);
  669. var path = rtn[1];
  670. var sFolderNM = model.getValue("/root/main/cond/foldernm");
  671. if (obj.selectedIndex+1 == obj.length) {
  672. obj.selectedIndex = 0;
  673. }
  674. for(var i=obj.selectedIndex+1; i<obj.length;i++){
  675. obj.select(i);
  676. if(sFolderNM == obj.label){
  677. break;
  678. }
  679. }
  680. fReqDetlSet();
  681. }
  682. /**
  683. * @desc : TreeView 선택된 item의 background color를 clear함
  684. * @
  685. * @param :
  686. * @return : void
  687. * @authur :
  688. * @---------------------------------------------------
  689. */
  690. function fClrTreeViweSelect(){
  691. var rtn = fSetTreeView();
  692. rtn = rtn.split("|");
  693. var obj = document.controls(rtn[0]);
  694. var path = rtn[1];
  695. for(var i = 0; i < obj.length; i++){
  696. obj.item(i).attribute("background-color") = "#ffffff";
  697. obj.item(i).attribute("text-decoration") = "";
  698. }
  699. }
  700. /**
  701. * @desc : 서식 SET INFO SETTING
  702. * @
  703. * @param :
  704. * @return :
  705. * @---------------------------------------------------
  706. */
  707. function fSetDiagInfo(rowpos, status){
  708. var depth = model.getValue(sSETLIST + "[" + rowpos + "]/depth");
  709. if(status == "u" && depth == 1){
  710. //messageBox("선택한 폴더는 수정", "E001");
  711. return -1;
  712. }else if(status == "d" && depth == 1){
  713. //messageBox("선택한 폴더는 삭제", "E001");
  714. return -1;
  715. }
  716. var depth = model.getValue(sSETLIST + "[" + rowpos + "]/depth");
  717. var path = model.getValue(sSETLIST + "[" + rowpos + "]/path");
  718. var itemindxseq = model.getValue(sSETLIST + "[" + rowpos + "]/itemindxseq");
  719. var supitemindxseq = model.getValue(sSETLIST + "[" + rowpos + "]/supitemindxseq");
  720. var linkflag = model.getValue(sSETLIST + "[" + rowpos + "]/linkflag");
  721. var indxnm = model.getValue(sSETLIST + "[" + rowpos + "]/indxnm");
  722. model.setValue(sSETLIST_HIDDEN + "/status" , status);
  723. model.setValue(sSETLIST_HIDDEN + "/depth" , depth);
  724. model.setValue(sSETLIST_HIDDEN + "/path" , path);
  725. model.setValue(sSETLIST_HIDDEN + "/itemindxseq" , itemindxseq);
  726. // supitemindxseq : 새로운 등록이면 상위정보, 수정이면 기존정보
  727. if(status == "i"){
  728. model.setValue(sSETLIST_HIDDEN + "/supitemindxseq", itemindxseq);
  729. }else{
  730. model.setValue(sSETLIST_HIDDEN + "/supitemindxseq", supitemindxseq);
  731. }
  732. //연결구분이 'Y' 인 경우 : 서식명칭에 값을 넣지 않는다.. (2007.06.12)
  733. if (linkflag == 'N') {
  734. model.setValue(sSETLIST_HIDDEN + "/indxnm" , indxnm);
  735. } else {
  736. model.setValue(sSETLIST_HIDDEN + "/indxnm" , "");
  737. }
  738. model.setValue(sSETLIST_HIDDEN + "/linkflag" , "N");
  739. model.setValue(sSETLIST_HIDDEN + "/linkcd" , "");
  740. // 상위 정보 (사용자, 과)
  741. var userid = model.getValue(sSETLIST + "[" + rowpos + "]/userid");
  742. var deptcd = model.getValue(sSETLIST + "[" + rowpos + "]/deptcd");
  743. model.setValue(sSETLIST_HIDDEN + "/userid" , userid);
  744. model.setValue(sSETLIST_HIDDEN + "/deptcd" , deptcd);
  745. // 기본 정보
  746. var instflag = model.getValue("/root/send/cond/setflag"); //개인과구분
  747. if(instflag =="U"){
  748. var instcd = model.getValue("/root/temp/instcd");
  749. if(instcd == ""){
  750. model.setValue(sSETLIST_HIDDEN + "/instcd" , getUserInfo("posinstcd"));
  751. }else {
  752. model.setValue(sSETLIST_HIDDEN + "/instcd" , instcd);
  753. }
  754. }else{
  755. model.setValue(sSETLIST_HIDDEN + "/instcd" , getUserInfo("posinstcd"));
  756. }
  757. model.setValue(sSETLIST_HIDDEN + "/indxflag" , "F");
  758. model.setValue(sSETLIST_HIDDEN + "/valiyn" , "Y");
  759. model.setValue(sSETLIST_HIDDEN + "/sortno" , 1000);
  760. model.setValue(sSETLIST_HIDDEN + "/comnseq" , 0);
  761. model.setValue(sSETLIST_HIDDEN + "/slipno" , 0);
  762. // 사용자 정보(관리자, 일반사용자)
  763. // 구분 정보(개인,과,전체)
  764. var admin = model.getValue("/root/send/cond/admin");
  765. var setflag = model.getValue("/root/send/cond/setflag");
  766. model.setValue(sSETLIST_HIDDEN + "/admin" , admin);
  767. model.setValue(sSETLIST_HIDDEN + "/setflag" , setflag);
  768. model.refresh();
  769. }
  770. /**
  771. * @desc : 서식 SET 에 파일 연결하기
  772. * @
  773. * @param :
  774. * @return :
  775. * @---------------------------------------------------
  776. */
  777. function fAddindx(){
  778. var rtn = fSetTreeView();
  779. rtn = rtn.split("|");
  780. var obj = document.controls(rtn[0]);
  781. var path = rtn[1];
  782. // 선택폴더가 있는가?
  783. if (obj.selectedIndex == -1) {
  784. messageBox("폴더를 ", "C002");
  785. return;
  786. }
  787. // 선택한 아이템 로우~!!
  788. var item = obj.item(obj.selectedIndex);
  789. var rowpos = item.index + 1;
  790. // 루트인가? (이동할 수 없다..)
  791. var depth = model.getValue(sSETLIST + "[" + rowpos + "]/depth");
  792. if (depth == 1) {
  793. messageBox("지정된 위치로 이동", "E001");
  794. return;
  795. }
  796. // 폴더인가? 파일이면 파일을 추가하지 않는다.
  797. var linkflag = model.getValue(sSETLIST + "[" + rowpos + "]/linkflag");
  798. if (linkflag == "Y") {
  799. messageBox("폴더를 ", "C002");
  800. return;
  801. }
  802. // 선택한 서식이 있는가?
  803. var checkflag = "false";
  804. for(var i = grd_formlist.fixedRows; i < grd_formlist.rows; i++){
  805. var flag = model.getValue("/root/main/formlist/row["+ i +"]/check");
  806. if(flag == "true"){
  807. checkflag = "true";
  808. break;
  809. }
  810. }
  811. if(checkflag == "false"){
  812. messageBox("서식을 ", "C002");
  813. return;
  814. }
  815. var item = obj.item(obj.selectedIndex);
  816. var rowpos = item.index + 1;
  817. var indxfocus = item.value;
  818. model.setValue("/root/temp/indxfocus", indxfocus);
  819. for(var i = grd_formlist.fixedRows; i < grd_formlist.rows; i++){
  820. var flag = model.getValue("/root/main/formlist/row["+ i +"]/check");
  821. if(flag=="true" ){
  822. model.setValue("/root/main/formlist/row["+ i +"]/check","false");
  823. var formcd = model.getValue("/root/main/formlist/row["+ i +"]/formcd");
  824. model.setValue(sSETLIST_HIDDEN + "/linkcd" , formcd);
  825. var userid = model.getValue(sSETLIST + "[" + rowpos + "]/userid");
  826. var deptcd = model.getValue(sSETLIST + "[" + rowpos + "]/deptcd");
  827. model.setValue(sSETLIST_HIDDEN + "/userid" , userid);
  828. model.setValue(sSETLIST_HIDDEN + "/deptcd" , deptcd);
  829. // 서식명칭에 값을 넣지 않는다.. (2007.06.12)
  830. model.setValue(sSETLIST_HIDDEN + "/indxnm" , "");
  831. model.setValue(sSETLIST_HIDDEN + "/supitemindxseq" , indxfocus);
  832. model.setValue(sSETLIST_HIDDEN + "/depth" , "");
  833. model.setValue(sSETLIST_HIDDEN + "/itemindxseq" , "");
  834. model.setValue(sSETLIST_HIDDEN + "/path" , "");
  835. model.setValue(sSETLIST_HIDDEN + "/status" , "i");
  836. model.setValue(sSETLIST_HIDDEN + "/sortno" , 1000);
  837. // 기본 정보
  838. var instflag = model.getValue("/root/send/cond/setflag"); //개인과구분
  839. if(instflag =="U"){
  840. var instcd = model.getValue("/root/temp/instcd");
  841. if(instcd == ""){
  842. model.setValue(sSETLIST_HIDDEN + "/instcd" , getUserInfo("posinstcd"));
  843. }else {
  844. model.setValue(sSETLIST_HIDDEN + "/instcd" , instcd);
  845. }
  846. }else{
  847. model.setValue(sSETLIST_HIDDEN + "/instcd" , getUserInfo("posinstcd"));
  848. }
  849. model.setValue(sSETLIST_HIDDEN + "/indxflag" , "F");
  850. var admin = model.getValue("/root/send/cond/admin");
  851. model.setValue(sSETLIST_HIDDEN + "/admin" , admin);
  852. var setflag = model.getValue("/root/send/cond/setflag");
  853. model.setValue(sSETLIST_HIDDEN + "/setflag" , setflag);
  854. model.setValue(sSETLIST_HIDDEN + "/linkflag" , "Y");
  855. model.setValue(sSETLIST_HIDDEN + "/valiyn" , "Y");
  856. model.setValue(sSETLIST_HIDDEN + "/comnseq" , 0);
  857. model.setValue(sSETLIST_HIDDEN + "/slipno" , 0);
  858. model.copyNode("/root/send/savedata", sSETLIST_HIDDEN);
  859. submit("TXMRF03101");
  860. if (setflag == "U") {
  861. model.removeNodeset("/root/main/indxlist_u/item");
  862. model.copyNode("/root/main/indxlist_u", "/root/main/indxlist");
  863. } else if (setflag == "D") {
  864. model.removeNodeset("/root/main/indxlist_d/item");
  865. model.copyNode("/root/main/indxlist_d", "/root/main/indxlist");
  866. } else if (setflag == "A") {
  867. model.removeNodeset("/root/main/indxlist_a/item");
  868. model.copyNode("/root/main/indxlist_a", "/root/main/indxlist");
  869. }
  870. model.refresh();
  871. }
  872. }
  873. }
  874. /**
  875. * @desc : 폼코드 넘겨주기
  876. * @
  877. * @param :
  878. * @return :
  879. * @---------------------------------------------------
  880. */
  881. function fSendFormInfo()
  882. {
  883. var rtn = fSetTreeView();
  884. rtn = rtn.split("|");
  885. var obj = document.controls(rtn[0]);
  886. var path = rtn[1];
  887. var rowpos = obj.mouseRow + 1;
  888. var formcd = model.getValue(path + "[" + rowpos + "]/formcd");
  889. if (formcd != "") {
  890. parent.window.javascript.fOpenNewForm(formcd);
  891. // window.close();
  892. }
  893. }
  894. /**
  895. * @desc : 폼코드 넘겨주기
  896. * @
  897. * @param :
  898. * @return :
  899. * @---------------------------------------------------
  900. */
  901. function fSendFormListInfo()
  902. {
  903. var rowpos = trv_formlist.mouseRow + 1;
  904. var formcd = model.getValue("/root/main/formlist/item" + "[" + rowpos + "]/formcd");
  905. if (formcd != "") {
  906. // 부모창의 속성값에 정해준다..
  907. //parent.window.model.makeValue("/root/hidden/parameters/formcd",formcd);
  908. parent.window.javascript.fOpenNewForm(formcd);
  909. // 파라메타값으로 넘겨준다..
  910. //window.close();
  911. }
  912. }
  913. /**
  914. * @desc : formcd,formnm 넘겨주기
  915. * @
  916. * @param :
  917. * @return :
  918. * @---------------------------------------------------
  919. */
  920. function fSendFormcdFormnm()
  921. {
  922. var rtn = fSetTreeView();
  923. rtn = rtn.split("|");
  924. var obj = document.controls(rtn[0]);
  925. var path = rtn[1];
  926. var rowpos = obj.mouseRow + 1;
  927. var formcd = model.getValue(path + "[" + rowpos + "]/formcd");
  928. if(formcd !=""){ // 폴더 아닌경우만 formcd넘긴다
  929. var formnm = model.getValue(path + "[" + rowpos + "]/formnm");
  930. opener.javascript.setParameter("formcd", formcd);
  931. opener.javascript.setParameter("formnm", formnm);
  932. model.close();
  933. }
  934. }
  935. /**
  936. * @desc : formcd,formnm 넘겨주기
  937. * @
  938. * @param :
  939. * @return :
  940. * @---------------------------------------------------
  941. */
  942. function fSendFormListFormnm()
  943. {
  944. var rowpos = trv_formlist.mouseRow + 1;
  945. var formcd = model.getValue("/root/main/formlist/item" + "[" + rowpos + "]/formcd");
  946. if(formcd !=""){ // 폴더 아닌경우만 formcd넘긴다
  947. var formnm = model.getValue("/root/main/formlist/item" + "[" + rowpos + "]/displaynm");
  948. opener.javascript.setParameter("formcd", formcd);
  949. opener.javascript.setParameter("formnm", formnm);
  950. model.close();
  951. }
  952. }
  953. /**
  954. * @desc : 공통세션변수에 formlist저장하기
  955. * @
  956. * @param :
  957. * @return :
  958. * @---------------------------------------------------
  959. */
  960. function fFormsetglobal()
  961. {
  962. model.toggle("case_list");
  963. return;
  964. var flag = getGlobalVariable("emr_gsv_formflag");
  965. //공통세션변수에 formlist 저장
  966. if(flag!="Y"){
  967. var reqnode = instance1.selectNodes("/root/main/formlist/item");
  968. var csv = getNodeListCSV(reqnode);
  969. setGlobalVariable("emr_gsv_formflag","Y");
  970. setGlobalVariable("emr_gsv_formflag_userid",getUserId());
  971. setGlobalVariable("emr_gsv_formlist",csv);
  972. }
  973. }
  974. /**
  975. * @desc : 공통세션변수에 indxlist저장하기
  976. * @
  977. * @param :
  978. * @return :
  979. * @---------------------------------------------------
  980. */
  981. function fIndxsetglobal(flag)
  982. {
  983. return;
  984. var reqnode = instance1.selectNodes("/root/main/indxlist_"+ flag +"/item");
  985. var csv = getNodeListCSV(reqnode);
  986. setGlobalVariable("emr_gsv_formflag_"+flag, "Y");
  987. setGlobalVariable("emr_gsv_formlist_"+flag, csv);
  988. }
  989. /**
  990. * @desc : 트리 expand 상태 얻기
  991. * @
  992. * @param :
  993. * @return :
  994. * @---------------------------------------------------
  995. */
  996. function fExpandCheck(trvObj)
  997. {
  998. //alert(trvObj);
  999. var Obj = window.document.controls(trvObj);
  1000. //alert(Obj);
  1001. // var Obj = trvObj;
  1002. var expandstr = 0; //트리 expand 값 저장
  1003. for(var i = 0; i < Obj.length ; i++){
  1004. if(Obj.item(i).expanded == 1)
  1005. {
  1006. expandstr += "."+i;
  1007. }
  1008. }
  1009. //공통세션변수에 저장
  1010. // setGlobalVariable("emr_gsv_"+trvObj ,expandstr);
  1011. //alert("a");
  1012. }
  1013. /**
  1014. * @desc : 트리 expand 상태 설정하기
  1015. * @
  1016. * @param :
  1017. * @return :
  1018. * @---------------------------------------------------
  1019. */
  1020. function fSetTreeExpand(trvObj)
  1021. {
  1022. return;
  1023. var Obj = window.document.controls(trvObj);
  1024. var str = getGlobalVariable("emr_gsv_"+trvObj);
  1025. if(str != ""){
  1026. var strlen = str.split('.');
  1027. var strArray = new Array(strlen.length);
  1028. for(var i=0; i<strlen.length; i++){
  1029. strArray[i] = strlen[i];
  1030. Obj.expand(strArray[i],true);
  1031. }
  1032. }
  1033. }
  1034. /**
  1035. * @desc : formlsit 재조회
  1036. * @
  1037. * @param :
  1038. * @return :
  1039. * @---------------------------------------------------
  1040. */
  1041. function fFormlistRefresh()
  1042. {
  1043. //세션 초기화
  1044. // setGlobalVariable("emr_gsv_formflag","");
  1045. // setGlobalVariable("emr_gsv_formflag_userid","");
  1046. // setGlobalVariable("emr_gsv_formlist","");
  1047. // setGlobalVariable("emr_gsv_formflag_u","");
  1048. // setGlobalVariable("emr_gsv_formflag_d","");
  1049. // setGlobalVariable("emr_gsv_formflag_a","");
  1050. // setGlobalVariable("emr_gsv_formlist_u","");
  1051. // setGlobalVariable("emr_gsv_formlist_d","");
  1052. // setGlobalVariable("emr_gsv_formlist_a","");
  1053. refresh_u = 0;
  1054. refresh_d = 0;
  1055. refresh_a = 0;
  1056. //선택된버튼 재조회
  1057. if(true== btn_list.selected ){
  1058. case_list.dispatch("DOMActivate");
  1059. submit("TRMMR02501");
  1060. return;
  1061. }
  1062. else if(true == btn_all.selected ){
  1063. case_all.dispatch("DOMActivate");
  1064. fSetIndxListSelect("A");
  1065. return;
  1066. }
  1067. else if(true == btn_dept.selected ){
  1068. case_dept.dispatch("DOMActivate");
  1069. fSetIndxListSelect("D");
  1070. return;
  1071. }
  1072. else if(true == btn_user.selected ){
  1073. case_user.dispatch("DOMActivate");
  1074. fSetIndxListSelect("U");
  1075. return;
  1076. }
  1077. }
  1078. /**
  1079. * @desc : formlsit 재조회
  1080. * @
  1081. * @param :
  1082. * @return :
  1083. * @---------------------------------------------------
  1084. function fFormlistRefresh()
  1085. {
  1086. // 서식목록 보여주자~
  1087. // setGlobal에 처음 select해온값 저장후 getGlobal 로 보여준다
  1088. var list = getGlobalVariable("emr_gsv_formlist");
  1089. if(list!=""){
  1090. setCSVToNode("/root/main/formlist/",list,"item");
  1091. model.refresh();
  1092. }else{
  1093. submit("TRMMR02501");
  1094. }
  1095. fFormsetglobal();
  1096. // 첫번째 본인 과는 오픈하자!!
  1097. trv_formlist.expand(0, true);
  1098. fSetTreeExpand("trv_formlist");
  1099. }
  1100. */
  1101. /**
  1102. * @desc : 서식목록조회
  1103. * @
  1104. * @param :
  1105. * @return :
  1106. * @---------------------------------------------------
  1107. */
  1108. function fGetFormlist()
  1109. {
  1110. submit("TRMMR02501");
  1111. // 첫번째 본인 과는 오픈하자!!
  1112. trv_formlist.expand(0, true);
  1113. return;
  1114. // 서식목록 보여주자~
  1115. // setGlobal에 처음 select해온값 저장후 getGlobal 로 보여준다
  1116. var list = getGlobalVariable("emr_gsv_formlist");
  1117. if(list!=""){
  1118. setCSVToNode("/root/main/formlist/",list,"item");
  1119. model.refresh();
  1120. }else{
  1121. submit("TRMMR02501");
  1122. }
  1123. }
  1124. /**
  1125. * @desc : 전체 목록에서 level 1 인 경우만 조회해서 트리에 추가해 주기..
  1126. * @
  1127. * @param :
  1128. * @return :
  1129. * @---------------------------------------------------
  1130. */
  1131. function fOpenSubTree()
  1132. {
  1133. var TREE_OBJ = trv_indxlist_a;
  1134. var item = TREE_OBJ.item(TREE_OBJ.selectedIndex);
  1135. if (item != null) {
  1136. var rowpos = item.index + 1;
  1137. var depth = model.getValue("/root/main/indxlist_a/item[" + rowpos + "]/depth");
  1138. var userid = model.getValue("/root/main/indxlist_a/item[" + rowpos + "]/userid");
  1139. if (depth == "2" && userid == "") {
  1140. var deptcd = model.getValue("/root/main/indxlist_a/item[" + rowpos + "]/deptcd");
  1141. var itemindxseq = model.getValue("/root/main/indxlist_a/item[" + rowpos + "]/itemindxseq");
  1142. var tmpsetflag = model.getValue("/root/send/cond/setflag");
  1143. model.makeValue("/root/send/cond/setflag", "S");
  1144. model.makeValue("/root/send/cond/subdeptcd", deptcd);
  1145. model.makeValue("/root/send/cond/itemindxseq", itemindxseq);
  1146. submit("TRMRF03102", true, "/root/send/cond", "/root/main/indxlist_t/item");
  1147. model.makeValue("/root/send/cond/setflag", tmpsetflag);
  1148. model.refresh();
  1149. fMoveInstance(rowpos);
  1150. model.setValue("/root/main/indxlist_a/item[" + rowpos + "]/userid", "x");
  1151. }
  1152. }
  1153. }
  1154. /**
  1155. * @desc : 전체 목록에서 level 1 인 경우만 조회해서 트리에 추가해 주기..
  1156. * @
  1157. * @param :
  1158. * @return :
  1159. * @---------------------------------------------------
  1160. */
  1161. function fMoveInstance(rowpos)
  1162. {
  1163. ref = "/root/main/indxlist_a/item";
  1164. stRef = "/root/main/indxlist_t/item";
  1165. var subNode = "";
  1166. var instance = document.models(0).instances(0);
  1167. var refNode = instance.selectSingleNode(ref + "[" + rowpos + "]"); //조회내용의 상위 항목
  1168. var nodelistTmp = instance.selectNodes(stRef);
  1169. var nodelength = nodelistTmp.length;
  1170. if(nodelength > 0)
  1171. {
  1172. var depth = "";
  1173. var itemindxseq = "";
  1174. var node = root.main.indxlist_a;
  1175. for(var i = nodelength; i > 0; i--)
  1176. {
  1177. itemindxseq = model.getValue(stRef + "[" + i + "]/itemindxseq");
  1178. depth = model.getValue(stRef + "[" + i + "]/depth");
  1179. subNode = instance.selectSingleNode(stRef + "[" + i + "]");
  1180. node.insertAfter(subNode, refNode); //조회항목을 상위항목의 자식으로 삽입
  1181. }
  1182. // 조회 레벨 오픈하자!!
  1183. model.setValue("/root/main/selected_a", itemindxseq);
  1184. model.refresh();
  1185. }
  1186. }