|
@@ -16,8 +16,14 @@ const {
|
|
|
openNewWin
|
|
|
} = require('./promise.js');
|
|
|
const $ = require("jquery");
|
|
|
-let showName,noticeName,clinicalPathwayName,showLis=[]
|
|
|
+let showName,noticeName,clinicalPathwayName,showLis=[],selectedDrop=0,selectedTab=0
|
|
|
|
|
|
+//如果是子窗口,隐藏网页查看按钮
|
|
|
+if(window.opener){
|
|
|
+ selectedDrop=getUrlArgObject("d")||0;
|
|
|
+ selectedTab=getUrlArgObject("t")||0;
|
|
|
+ $("#openWin").hide();
|
|
|
+}
|
|
|
let icond = require('./../images/d.png').replace(/^undefined/g, '')
|
|
|
function getInfomation() {
|
|
|
// var param = {
|
|
@@ -33,7 +39,7 @@ function getInfomation() {
|
|
|
"hisDetailName": getUrlArgObject('hisDetailName'),
|
|
|
"contentTypes":[1,2,3]
|
|
|
};
|
|
|
- showName = param.hisName;
|
|
|
+ //showName = param.hisName;
|
|
|
// if (param.type == 5 || param.type == 51) {
|
|
|
// param.type = 12;
|
|
|
// param.name = uname;
|
|
@@ -44,22 +50,23 @@ function getInfomation() {
|
|
|
const data = res.data.data
|
|
|
var str = '';
|
|
|
var anchors = '';
|
|
|
+ let sName ='';
|
|
|
if (!data||data.length===0) {
|
|
|
showEmpty();
|
|
|
return;
|
|
|
}
|
|
|
- $(".titleCont .title").html(showName);
|
|
|
showLis=data
|
|
|
for(let i = 0;i < showLis.length;i++){
|
|
|
let tmp = showLis[i]
|
|
|
- str+=`<li data-idx="${i}" title="${tmp.name}">${tmp.name}</li>`
|
|
|
+ str+=`<li data-idx="${i}" title="${tmp.name}">${tmp.name}(${tmp.hisName})</li>`
|
|
|
}
|
|
|
- $(".showWhich ul").html(str)
|
|
|
- $(".showWhichSelect").html(showLis[0].name).attr("title",showLis[0].name)
|
|
|
- showName = data[0].name
|
|
|
- document.title = showName
|
|
|
+ $(".showWhich ul").html(str);
|
|
|
+ sName=showLis[selectedDrop].name+"("+showLis[selectedDrop].hisName+")";
|
|
|
+ $(".showWhichSelect").html(sName).attr("title",sName)
|
|
|
+ showName = data[selectedDrop].name
|
|
|
showInfoSelect()
|
|
|
- showInfo(data[0])
|
|
|
+ showInfo(data[selectedDrop])
|
|
|
+ renderTitleShow();
|
|
|
$('.content img').bind('contextmenu', function(){
|
|
|
return false
|
|
|
})
|
|
@@ -95,9 +102,11 @@ function showInfoSelect(){
|
|
|
$('.showWhich li').click(function(){
|
|
|
let idx = $(this).attr('data-idx')
|
|
|
let name = $(this).html(),str=''
|
|
|
- showName = showLis[idx].name
|
|
|
- document.title = showName
|
|
|
+ selectedDrop=idx;
|
|
|
+ selectedTab=0;
|
|
|
+ showName = showLis[idx].name;
|
|
|
showInfo(showLis[idx])
|
|
|
+ renderTitleShow();
|
|
|
$('.content .infos').scrollTop(0)
|
|
|
$(".showWhich ul").css("display","none")
|
|
|
$(".showWhichSelect").html(name).attr("title",name)
|
|
@@ -110,6 +119,10 @@ function showInfoSelect(){
|
|
|
$(".showWhich ul").css("display","none")
|
|
|
})
|
|
|
}
|
|
|
+function renderTitleShow(){
|
|
|
+ document.title = showName;
|
|
|
+ $(".titleCont .title").html($(".tabList .tab:eq("+selectedTab+")").attr("data-title"));
|
|
|
+}
|
|
|
function renderContent(list, contentWrapClassName){
|
|
|
$(`.${contentWrapClassName} .infos`).html('');
|
|
|
$(`.${contentWrapClassName} .anchors ul`).html('');
|
|
@@ -180,15 +193,17 @@ function renderTab(detailList){
|
|
|
$(".tabList").append(`<span class="tab" data-module="notice" data-title="`+noticeName+`">注意事项</span>`)
|
|
|
//$(".titleCont .title").html(noticeName);
|
|
|
}
|
|
|
- $(".tabList .tab").eq(0).addClass("activeTab")
|
|
|
- let defaultModuleName = $(".tabList .tab").eq(0).attr("data-module")
|
|
|
+
|
|
|
+ $(".tabList .tab").eq(selectedTab).addClass("activeTab")
|
|
|
+ let defaultModuleName = $(".tabList .tab").eq(selectedTab).attr("data-module")
|
|
|
$(`.${defaultModuleName}`).css("display","block")
|
|
|
bindTabClick()
|
|
|
}
|
|
|
function bindTabClick(){
|
|
|
$(".tabList .tab").on("click", function(){
|
|
|
const moduleName = $(this).attr("data-module")
|
|
|
- const display = $(`.${moduleName}`).css("display")
|
|
|
+ //const display = $(`.${moduleName}`).css("display")
|
|
|
+ selectedTab=$('.tabList .tab').index(this);
|
|
|
$(".titleCont .title").html($(this).attr('data-title'));
|
|
|
//if(display == "none"){
|
|
|
$(".activeTab").removeClass("activeTab")
|
|
@@ -202,8 +217,8 @@ function bindTabClick(){
|
|
|
const type= getUrlArgObject('type');
|
|
|
const hospitalId= getUrlArgObject('hospitalId');
|
|
|
const hisName= getUrlArgObject('hisName');
|
|
|
- const hisDetailName= getUrlArgObject('hisDetailName');
|
|
|
- openNewWin("staticInfoOut.html?hospitalId="+encodeURIComponent(hospitalId)+"&hisName="+encodeURIComponent(hisName)+"&hisDetailName="+encodeURIComponent(hisDetailName||'')+"&type="+encodeURIComponent(type));
|
|
|
+ const hisDetailName= getUrlArgObject('hisDetailName');console.log(selectedDrop)
|
|
|
+ openNewWin("staticInfoOut.html?hospitalId="+encodeURIComponent(hospitalId)+"&hisName="+encodeURIComponent(hisName)+"&hisDetailName="+encodeURIComponent(hisDetailName||'')+"&type="+encodeURIComponent(type)+"&d="+selectedDrop+"&t="+selectedTab);
|
|
|
})
|
|
|
}
|
|
|
function adjustHeight() {
|
|
@@ -220,8 +235,4 @@ $(window).on('resize', function(){
|
|
|
adjustHeight()
|
|
|
adjustWidth()
|
|
|
})
|
|
|
-//如果是子窗口,隐藏网页查看按钮
|
|
|
-if(window.opener){
|
|
|
- $("#openWin").hide();
|
|
|
-}
|
|
|
|