MRF04400.js 41 KB

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