123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504 |
- var indexnum = 1; //버튼과 case안에 고유한 ID를 만들어주기 위한 변수
- var htmlWin = null;
- var s = null;
- //var browserSrc = "file:///C:\\CMCOracle\\application\\webapps\\emr\\emrbrowserweb\\xrw\\init.html";
- var browserSrc = getDomain() + "/himed/webapps/cmc/web/xrw/.live?submit_id=TRMRB00201&business_id=emr&macaddr=0025b361dcd6&localurl=" + getDomain().setReplaceWord("http://", "");
- function fInit(){
- plusbrowser();
- }
- function browserInit(){
- indexnum = 1
- deleteBrowserAll();
- plusbrowser();
- }
- //탭 title 세팅
- function setTitle(){
- var index = switch1.selectedIndex;
- var caseid = switch1.children.item(index).attribute("id");
- var title = ""
- if(parent.btn_tab_favorite.selected){ //즐겨찾기선택
- title = "즐겨찾기";
- }
- else{
- if(parent.switch1.selectedIndex == 0){
- title = parent.grd_midindx.valueMatrix(parent.grd_midindx.row, parent.grd_midindx.col);
- }else if(parent.switch1.selectedIndex == 1){
- title = parent.grd_chart_midindx.valueMatrix(parent.model.getValue("/root/init/chartrow"), parent.grd_chart_midindx.col);
- }else if(parent.switch1.selectedIndex == 2){
- title = "북마크";
- }
- else{
- title = parent.grd_datemidindx.valueMatrix(parent.grd_datemidindx.row, parent.grd_datemidindx.col);
- }
- }
-
- var o = eval("button" +caseid.substring(4));
- o.attribute("text") = title;
- o.ellipsis = true;
- o.hint = title;
- o.refresh();
- }
- //현제 선택돤 브라우져 return
- function getBrowser(){
- //현재 선택된 case
- var caseid = switch1.children.item(switch1.selectedIndex).attribute("id");
- var browser = eval("browser" + caseid.substring(4));
- //var browser = "browser" + caseid.substring(4);
-
- return browser;
- }
- function plusbrowser(){
- //페이지부분 안보이게 세팅
- //cap_page.visible = false;
- btn_nextpage.visible = false;
- var caseLength = switch1.children.length;
- if(caseLength >= 9){
- messageBox("더 이상 추가 할수 없습니다.", "E");
- return;
- }
-
- createCase = switch1.createChild("xforms:case", "id:case" + indexnum + ";left:0px; top:0px; width:898px; height:905px; ");
- model.refresh();
- createbrowser = createCase.createChild("xforms:browser", "id:browser" + indexnum + ";left:5px; top:50px; width:888px; height:850px; border-top-style:solid;border-left-style:solid;border-bottom-style:solid;border-right-style:solid; border-color:#c0c0c0;");
- model.refresh();
- createbrowser.src = browserSrc;
- model.refresh();
- var w = 105;
- if(caseLength == 0 ){
- w = 20;
- }
- else if(caseLength == 1 ){
- w = 105;
- }
- else if(caseLength == 2 ){
- w = 190;
- }
- else if(caseLength == 3 ){
- w = 276;
- }
- else if(caseLength == 4){
- w = 362;
- }
- else if(caseLength == 5){
- w = 448;
- }
- else if(caseLength == 6){
- w = 534;
- }
- else if(caseLength == 7){
- w = 620;
- }
- else if(caseLength == 8){
- w = 706;
- }
-
- btn = body.createChild("xforms:button", "id:button" + indexnum + ";left:"+ w + "px;top:31px;width:87px; height:22px; text:Browser" + indexnum);
- model.refresh();
- btn.attribute("class") = "btn_sw";
- btn.attribute("group") = "tab";
- //btn.attribute("selected") = "true";
- btn.attribute("onclick") = "btnClick('case" + indexnum + "')";
- //model.toggle("case" + indexnum);
- btn.dispatch("onclick");
- model.refresh();
- indexnum = indexnum + 1;
- }
- function btnClick(c){
- model.toggle(c);
- viewPageInfo();
- model.refresh();
- }
- function deletebrowser(){
- var caseLength = switch1.children.length;
- var index = switch1.selectedIndex;
- if(caseLength == 1){
- messageBox("마지막 1개는 삭제 할 수 없습니다.", "E");
- return;
- }
-
- //현재 선택된 case
- var caseid = switch1.children.item(index).attribute("id");
- var buttonid = "button" + caseid.substring(4);
-
- //이전case
- if(index != 0){
- var prevCaseid = switch1.children.item(index-1).attribute("id");
- var prevButtonid = "button" + prevCaseid.substring(4);
- }
- //다음case
- //var nextCaseindex = fGetNextIndex();
- if(caseLength != (index+1)){
- var nextCaseid = switch1.children.item(index+1).attribute("id");
- var nextButtonid = "button" + nextCaseid.substring(4);
- }
-
- switch1.removeChild(caseid);
- body.removeChild(buttonid);
-
-
- //버튼 재배치
- if(caseLength != (index+1)){ //마지막탭을 지운게 아니라면
- for(i = 0; i < switch1.children.length; i++){
- var obid = switch1.children.item(i).attribute("id");
- var btnid = "button" + obid.substring(4);
- if(i >= index){
- if(i == 0){
- w = 20;
- }
- else if(i == 1 ){
- w = 106;
- }
- else if(i == 2 ){
- w = 190;
- }
- else if(i == 3 ){
- w = 276;
- }
- else if(i == 4){
- w = 362;
- }
- else if(i == 5){
- w = 448;
- }
- else if(i == 6){
- w = 534;
- }
- else if(i == 7){
- w = 620;
- }
- else if(i == 8){
- w = 706;
- }
-
- eval(btnid).attribute("left") = w;
- }
-
- }
- }
-
- if(index == 0){
- eval(nextButtonid).dispatch("onclick");
- }
- else{
- eval(prevButtonid).dispatch("onclick");
- }
- model.removeNodeSet("/root/initpage/pageinfo["+(index+1)+"]");
- model.makeValue("/root/initpage/pageinfo/page", "0");
- model.makeValue("/root/initpage/pageinfo/totpage", "0");
- model.makeValue("/root/initpage/pageinfo/reckind", "");
- model.makeValue("/root/initpage/pageinfo/pageyn", "");
- model.makeValue("/root/initpage/pageinfo/viewyn", "");
- model.refresh();
- }
- function deleteBrowserAll(){
- body.removeChild("switch1");
- model.refresh();
- body.createChild("xforms:switch", "id:switch1;left:5px; top:0px; width:898px; height:905px; background-color:transparent;");
- model.refresh();
- /*
- var len = switch1.children.length;
-
- for(i = (len-1) ; i >= 0 ; i--){
- if(len == 0) break;
- var cas = switch1.children.item(i);
- if(cas){
- var caseid = cas.attribute("id");
- var browserid = "browser" + caseid.substring(4);
- var buttonid = "button" + caseid.substring(4);
-
- switch1.children.item(i).removeChild(browserid);
- switch1.removeChild(caseid);
- body.removeChild(buttonid);
- len--;
- }
- }
- */
-
- }
- /*
- function goUrl(url){
- if(getBrowser().document){
- //browser 컨트롤의 html을 구한다.
- htmlWin = getBrowser().document.parentWindow;
- htmlWin.domain = getDomain();
- //browser의 컨트롤의 document의 TFWin의 변수에 부모창(T/F)의 객체를 넣어준다
- htmlWin.TFWin = window;
- if(htmlWin.lockyn == "N"){
- getBrowser().document.parentWindow.goLocation(url);
- var index = switch1.selectedIndex;
- var caseid = switch1.children.item(index).attribute("id");
- var tt = ""
- if(parent.btn_tab_favorite.selected){ //즐겨찾기선택
- tt = "즐겨찾기";
- }
- else{
- if(parent.switch1.selectedIndex == 0){
- tt = parent.grd_midindx.valueMatrix(parent.grd_midindx.row, parent.grd_midindx.col);
- }else if(parent.switch1.selectedIndex == 1){
- tt = parent.grd_chart_midindx.valueMatrix(parent.model.getValue("/root/init/chartrow"), parent.grd_chart_midindx.col);
- }else if(parent.switch1.selectedIndex == 2){
- tt = "북마크";
- }
- else{
- tt = "";
- }
- }
-
- setTitle(tt, caseid.substring(4));
- }
- else{
- alert("로딩중 입니다.");
- }
- }
- else{
- alert("브라우져 초기회중입니다. 잠시 기다려 주십시요.");
- indexnum = 0;
- fInit();
- }
- }
- */
- function goUrl(node){
- htmlWin = null;
- //노드복사
- if(node != null){
- var destNode = instance1.selectSingleNode("/root/send");
- model.copyNode(destNode, node);
- }
- if(getBrowser().document != null){
- if(s != null) window.clearInterval(s);
- //browser 컨트롤의 html을 구한다.
- htmlWin = getBrowser().document.parentWindow;
-
- htmlWin.domain = getDomain();
- //browser의 컨트롤의 document의 TFWin의 변수에 부모창(T/F)의 객체를 넣어준다
- htmlWin.TFWin = window;
- if(htmlWin.lockyn == null || htmlWin.lockyn == ""){
- alert("브라우져 준비중입니다.");
- htmlWin.domain = getDomain();
- htmlWin.TFWin = window;
- //htmlWin.execScript("alert(lockyn)","JavaScript")
- }
- if(htmlWin.lockyn == "N"){
- var sIndex = switch1.selectedIndex;
- sIndex = sIndex + 1;
- setTitle();
- var url = fGetURL();
- htmlWin.setLocation(url, model.getValue("/root/send/pageindex"), model.getValue("/root/initpage/pageinfo["+sIndex+"]/viewyn"));
- }
- else{
- alert("로딩중 입니다.");
- }
-
- }
- else{
-
- //alert("브라우져 초기회중입니다. 잠시 기다려 주십시요.");
-
- if(s == null){
- if(browser1 != null){
- browser1.Navigate(browserSrc);
- }
- else{
- getBrowser().Navigate(browserSrc);
- }
- }
-
- s = window.setInterval("goUrl()", 1000);
-
- //indexnum = 0;
- //fInit();
-
- }
- }
- function fGetURL()
- {
- var submit_id = model.getValue("/root/send/submit_id");
- if(submit_id == null ||submit_id == "") submit_id = "TRMRB00202";
-
- var scrollMenuDispYN = model.getValue("/root/send/scrollMenuDispYN");
- if(scrollMenuDispYN == "") scrollMenuDispYN = "Y";
- var displayflag = model.getValue("/root/send/displayflag");
- if(displayflag == "") displayflag = "Y";
-
- var url = getDomain() + "/himed/webapps/cmc/web/xrw/.live";
- url += "?submit_id=" + submit_id;
- url += "&business_id=" + model.getValue("/root/send/business_id");
- url += "&macaddr=" + model.getValue("/root/send/macaddr");
- url += "&pid=" + model.getValue("/root/send/pid");
- url += "&orddd=" + model.getValue("/root/send/orddd");
- url += "&cretno=" + model.getValue("/root/send/cretno");
- url += "&ioflag=" + model.getValue("/root/send/ioflag");
- url += "&reckind=" + model.getValue("/root/send/reckind");
- url += "&linkcd=" + model.getValue("/root/send/linkcd");
- url += "&midindxseq=" + model.getValue("/root/send/midindxseq");
- url += "&bfopentest=" + model.getValue("/root/send/bfopentest");
- //url += "&pageindex=" + model.getValue("/root/send/pageindex");
- url += "&pagepercnt=" + model.getValue("/root/send/pagepercnt");
- url += "&localurl=" + getDomain().setReplaceWord("http://", "");
- url += "&signno=" + model.getValue("/root/send/signno");
- url += "&examflag=" + model.getValue("/root/send/examflag");
- url += "&pidynhcd=" + model.getValue("/root/init/hardcd/hardcd");
- url += "&treatno=" + model.getValue("/root/send/treatno");
- url += "&formcode=" + model.getValue("/root/send/formcode");
- url += "&scrollMenuDispYN=" + scrollMenuDispYN; //Y일때 스크롤메뉴 보임
- url += "&displayflag=" + displayflag; //Y일때 스크롤메뉴 보임
- url += "&funcflag=" + model.getValue("/root/send/funcflag");
- url += "&srchfromdd=" + model.getValue("/root/send/srchfromdd");
- url += "&srchtodd=" + model.getValue("/root/send/srchtodd");
- url += "&dataflag=" + model.getValue("/root/send/dataflag");
- url += "&orddeptcd=" + model.getValue("/root/send/orddeptcd");
- url += "&acptcnclyn=" + model.getValue("/root/send/acptcnclyn");
- //북마크 폴더 클릭
- url += "&itemno=" + model.getValue("/root/send/itemno");
- url += "&itemflag=" + model.getValue("/root/send/itemflag");
- url += "&dataflag=" + model.getValue("/root/send/dataflag");
-
- return url;
- }
- function fWritePage(page, totpage, reckind, pageyn){
- var sIndex = switch1.selectedIndex;
- sIndex = sIndex + 1;
- model.setValue("/root/initpage/pageinfo["+sIndex+"]/page", page);
- model.setValue("/root/initpage/pageinfo["+sIndex+"]/totpage", totpage);
- model.setValue("/root/initpage/pageinfo["+sIndex+"]/reckind", reckind);
- model.setValue("/root/initpage/pageinfo["+sIndex+"]/pageyn", pageyn);
- viewPageInfo();
- }
- function viewPageInfo(){
- var sIndex = switch1.selectedIndex;
- sIndex = sIndex + 1;
- var page = model.getValue("/root/initpage/pageinfo["+sIndex+"]/page");
- var totpage = model.getValue("/root/initpage/pageinfo["+sIndex+"]/totpage");
- var reckind = model.getValue("/root/initpage/pageinfo["+sIndex+"]/reckind");
- var pageyn = model.getValue("/root/initpage/pageinfo["+sIndex+"]/pageyn");
- var viewyn = model.getValue("/root/initpage/pageinfo["+sIndex+"]/viewyn");
- if(viewyn != "Y"){ //연속보기가 아닐때
- btn_nextpage.visible = true;
- cap_page.visible = true;
- chk_continue.deselect(0);
-
- if(page == null || page == "" || page == "null") page = "0";
- if(totpage == null || totpage == "" || totpage == "null") totpage = "0";
- var txt = page;
- if(totpage != "0") txt += "/" + totpage;
- if(page == "0" && totpage == "0"){
- cap_page.text = "";
- }
- else{
- cap_page.text = txt + " Page";
- }
- //다음페이지 버튼
- var npage = parseInt(page) + 1;
- if(reckind == "PRCP"){
- if(pageyn == "Y"){
- btn_nextpage.visible = true;
- btn_nextpage.attribute("DOMActivate") = "getBrowser().document.parentWindow.nPage("+npage+")";
- }
- else{
- btn_nextpage.visible = false;
- }
- }
- else{
- if(page == parseInt(totpage)){
- btn_nextpage.visible = false;
- }
- else{
- btn_nextpage.visible = true;
- btn_nextpage.attribute("DOMActivate") = "getBrowser().document.parentWindow.nPage("+npage+")";
- }
- }
- }
- else{
- chk_continue.select(0);
- }
- }
- /*
- 연속보기 클릭
- */
- function fContinueView(){
- var c = model.getValue("/root/init/continueview");
- var sIndex = switch1.selectedIndex;
- sIndex = sIndex + 1;
- if(c == "Y"){
- btn_nextpage.visible = false;
- cap_page.visible = false;
- model.setValue("/root/initpage/pageinfo["+sIndex+"]/viewyn", "Y");
- }
- else{
- model.setValue("/root/initpage/pageinfo["+sIndex+"]/viewyn", "");
- }
- }
- /*
- Print
- */
- function fPrintPreview(tmppid, hngnm, rrgstno){
- var instcd = getUserInfo("dutplceinstcd");
- var instnm = getUserInfo("dutplceinstnm"); //근무지 기관명
- var plcenm = getUserInfo("dutplcenm"); //근무지 부서명
- var usernm = getUserInfo("usernm"); //사용자 이름
- var pTime = getNewDate().getDateFormat("YYYY/MM/DD hh:mm:ss"); //출력시간
- if(htmlWin != null){
- htmlWin.Preview(instcd, instnm, tmppid, hngnm, rrgstno, pTime, usernm, plcenm);
- }
- }
|