<apex:page id="Page" standardcontroller="Account" showHeader="false" sidebar="false" extensions="OFSHospitalLayoutController" action="{!init}" standardStylesheets="true" applyBodyTag="false" applyHtmlTag="false">
|
<html>
|
<head>
|
<meta name="viewport" content="width=1150,user-scalable=no" /> <!-- TODO 1150はコンテンツの幅 -->
|
<apex:stylesheet value="{!URLFOR($Resource.OFSHospitalLayoutCss)}"/>
|
<apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/>
|
<apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/>
|
<apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/>
|
<!--FIXME yu: <title>{!accLabelMap[acc.Id]}</title> -->
|
<script src="https://hammerjs.github.io/dist/hammer.js"></script>
|
<script type="text/javascript">
|
function toggleMenuHover(pDiv) {
|
jQuery(pDiv).parent().toggleClass("hoverClass");
|
jQuery(pDiv).toggleClass("hoverClass");
|
}
|
|
function showAssetLayer() {
|
j$("#glayLayer").show();
|
j$("#divRelationList").show();
|
}
|
|
function checkAll(checker) {
|
var cnt = document.getElementById('ProductCnt').value;
|
for (var i = 0; i < cnt; i++) {
|
document.getElementById('Page:Form:assetBlock:Dataline0:' + i + ':CheckAsset').checked = checker.checked;
|
}
|
}
|
|
// レイアを用意 と heightをあわせる
|
j$(function(){
|
//reportを読み込む前と後は高さに差がある
|
var DIFHT = 21;
|
var ht = j$(window).innerHeight() - j$(escapeVfId('InfoHeader')).height() - j$(escapeVfId('InfoFoot')).height() - DIFHT;
|
j$(escapeVfId('InfoBody')).css('height', ht + 'px');
|
|
//alert(j$(escapeVfId('InfoHeader')).height() + j$(escapeVfId('InfoFoot')).height() + ht -j$(window).innerHeight());
|
//alert(scrollbarWidth());
|
// レイアを用意
|
j$("#glayLayer").click(function(){
|
j$(this).hide();
|
j$("#divRelationList").hide();
|
})
|
})
|
</script>
|
</head>
|
<body>
|
<apex:form id="Form" style="margin:0 5px;">
|
<apex:actionFunction name="showList" action="{!showList}" rerender="PanelRelation">
|
<apex:param name="p1" assignTo="{!index}" value=""/>
|
</apex:actionFunction>
|
|
|
|
<apex:outputPanel id="MessageP">
|
<apex:pageMessages />
|
</apex:outputPanel>
|
<div><apex:pageBlock mode="maindetail" Id="Block" rendered="{!initFlag}">
|
<div style="position: relative;top:0;width:100%;" Id="InfoHeader">
|
<ul class="menu-">
|
<li class="menu-case">
|
<div class="menu-name" onclick="toggleMenuHover(this)">☰ {!accLabelMap[labelMapKeyMap[acc.Id]]}</div>
|
<ul class="menu-list">
|
<!-- TODO: 販売店はまだ-->
|
<apex:repeat value="{!accIds}" var="accId" id="AccIds">
|
<li class="menu-one">
|
<a style="text-decoration: none;" href="/apex/OFSHospitalLayout?id={!
|
URLENCODE(accId)}&wv=1">{!accLabelMap[accId]}</a>
|
</li>
|
</apex:repeat>
|
</ul>
|
</li>
|
</ul>
|
<table>
|
<tr>
|
<td><apex:outputLabel value="{!$ObjectType.Account.Label}:" style="font-size:18px;font-weight: bold;padding-right: 5px;"/></td>
|
<td><apex:outputLabel value="{!acc.Name}" style="font-size:18px;font-weight: bold;padding-right: 20px;"/></td>
|
<td style="text-align: center;padding-right: 100px;"><apex:commandButton style="width:80px;" value="保存" action="{!save}"/></td>
|
<td style="text-align: center;"><apex:commandButton style="width:80px;" value="关闭窗口" onclick="location.href='/apex/OFSWindowClose';return false;"/></td>
|
</tr>
|
</table>
|
<apex:pageBlockSection title="{!sectionList[0].title}" columns="{!sectionList[0].column}" showHeader="{!sectionList[0].showHeader}" rendered="{!sectionList.size>0}">
|
<apex:repeat value="{!sectionList[0].sectionItemList}" var="sectionItem" id="SectionItemList">
|
<apex:outputField value="{!acc[sectionItem.api]}" rendered="{!NOT(sectionItem.isDummy)&&NOT(sectionItem.isCustomize)&&NOT(sectionItem.isInput)}"/>
|
<apex:inputField style="width:{!sectionItem.width};height:{!sectionItem.height};" value="{!acc[sectionItem.api]}" rendered="{!NOT(sectionItem.isDummy)&&NOT(sectionItem.isCustomize)&§ionItem.isInput}" required="{!sectionItem.isRequired}" html-tabindex="{!sectionItem.index}"/>
|
<apex:pageblockSectionItem rendered="{!NOT(sectionItem.isDummy)&&(sectionItem.isCustomize)&&Not(isNull(sectionItem.customizeLable))}">
|
<apex:outputLabel value="{!sectionItem.customizeLable}"/>
|
<apex:outputPanel layout="none">
|
<apex:repeat value="{!sectionItem.apiList}" var="api">
|
<apex:outputLabel style="font-weight: bold; padding-right: 5px;" value="{!sectionItem.apiLabelMap[api]}"/>
|
<apex:inputField value="{!acc[api]}" style="{!sectionItem.apiStyleMap[api]}" rendered="{!NOT(api=='') && (sectionItem.isInput || sectionItem.apiInputMap[api])}" required="{!sectionItem.apiRequireMap[api]}" html-tabindex="{!sectionItem.index}"/>
|
<apex:outputPanel style="display:inline-block;{!sectionItem.apiStyleMap[api]}" rendered="{!NOT(api=='') && NOT((sectionItem.isInput || sectionItem.apiInputMap[api]))}">
|
<apex:outputField value="{!acc[api]}"/>
|
</apex:outputPanel>
|
</apex:repeat>
|
</apex:outputPanel>
|
</apex:pageblockSectionItem>
|
<apex:pageblockSectionItem rendered="{!NOT(sectionItem.isDummy)&&(sectionItem.isCustomize)&&(isNull(sectionItem.customizeLable))}">
|
<apex:outputPanel layout="none">
|
<apex:repeat value="{!sectionItem.apiList}" var="api">
|
<apex:outputLabel style="font-weight: bold; padding-right: 5px;" value="{!sectionItem.apiLabelMap[api]}"/>
|
<apex:inputField value="{!acc[api]}" style="{!sectionItem.apiStyleMap[api]}" rendered="{!NOT(api=='') && (sectionItem.isInput || sectionItem.apiInputMap[api])}" required="{!sectionItem.apiRequireMap[api]}" html-tabindex="{!sectionItem.index}"/>
|
<apex:outputPanel style="display:inline-block;{!sectionItem.apiStyleMap[api]}" rendered="{!NOT(api=='') && NOT((sectionItem.isInput || sectionItem.apiInputMap[api]))}">
|
<apex:outputField value="{!acc[api]}"/>
|
</apex:outputPanel>
|
</apex:repeat>
|
</apex:outputPanel>
|
</apex:pageblockSectionItem>
|
<apex:pageBlockSectionItem rendered="{!sectionItem.isDummy}"/>
|
</apex:repeat>
|
</apex:pageBlockSection>
|
</div>
|
<div style="position: relative;top:0;height:700px;overflow:hidden;overflow-y:auto;-webkit-overflow-scrolling: touch;">
|
<apex:repeat value="{!sectionList}" var="section" id="SectionList">
|
<apex:pageBlockSection title="{!section.title}" columns="{!section.column}" showHeader="{!section.showHeader}" rendered="{!!section.isTop}">
|
<apex:repeat value="{!section.sectionItemList}" var="sectionItem" id="SectionItemList">
|
<apex:outputField value="{!acc[sectionItem.api]}" rendered="{!NOT(sectionItem.isDummy)&&NOT(sectionItem.isCustomize)&&NOT(sectionItem.isInput)}"/>
|
<apex:inputField style="width:{!sectionItem.width};height:{!sectionItem.height};" value="{!acc[sectionItem.api]}" rendered="{!NOT(sectionItem.isDummy)&&NOT(sectionItem.isCustomize)&§ionItem.isInput}" required="{!sectionItem.isRequired}" html-tabindex="{!sectionItem.index}"/>
|
<apex:pageblockSectionItem rendered="{!NOT(sectionItem.isDummy)&&(sectionItem.isCustomize)&&Not(isNull(sectionItem.customizeLable))}">
|
<apex:outputLabel value="{!sectionItem.customizeLable}"/>
|
<apex:outputPanel layout="none">
|
<apex:repeat value="{!sectionItem.apiList}" var="api">
|
<apex:outputLabel style="font-weight: bold; padding-right: 5px;" value="{!sectionItem.apiLabelMap[api]}"/>
|
<apex:inputField value="{!acc[api]}" style="{!sectionItem.apiStyleMap[api]}" rendered="{!NOT(api=='') && (sectionItem.isInput || sectionItem.apiInputMap[api])}" required="{!sectionItem.apiRequireMap[api]}" html-tabindex="{!sectionItem.index}"/>
|
<apex:outputPanel style="display:inline-block;{!sectionItem.apiStyleMap[api]}" rendered="{!NOT(api=='') && NOT((sectionItem.isInput || sectionItem.apiInputMap[api]))}">
|
<apex:outputField value="{!acc[api]}"/>
|
</apex:outputPanel>
|
</apex:repeat>
|
</apex:outputPanel>
|
</apex:pageblockSectionItem>
|
<apex:pageblockSectionItem rendered="{!NOT(sectionItem.isDummy)&&(sectionItem.isCustomize)&&(isNull(sectionItem.customizeLable))}">
|
<apex:outputPanel layout="none">
|
<apex:repeat value="{!sectionItem.apiList}" var="api">
|
<apex:outputLabel style="font-weight: bold; padding-right: 5px;" value="{!sectionItem.apiLabelMap[api]}"/>
|
<apex:inputField value="{!acc[api]}" style="{!sectionItem.apiStyleMap[api]}" rendered="{!NOT(api=='') && (sectionItem.isInput || sectionItem.apiInputMap[api])}" required="{!sectionItem.apiRequireMap[api]}" html-tabindex="{!sectionItem.index}"/>
|
<apex:outputPanel style="display:inline-block;{!sectionItem.apiStyleMap[api]}" rendered="{!NOT(api=='') && NOT((sectionItem.isInput || sectionItem.apiInputMap[api]))}">
|
<apex:outputField value="{!acc[api]}"/>
|
</apex:outputPanel>
|
</apex:repeat>
|
</apex:outputPanel>
|
</apex:pageblockSectionItem>
|
<apex:pageBlockSectionItem rendered="{!sectionItem.isDummy}"/>
|
</apex:repeat>
|
</apex:pageBlockSection>
|
</apex:repeat>
|
</div>
|
<div style="position: fixed; bottom: 0; width:100%;z-index:1" Id="InfoFoot">
|
<apex:pageBlockSection title="报告" columns="3" Id="Report" showHeader="false" >
|
<apex:outputPanel styleClass="reportElement" layout="block" rendered="{!selectedRptMapList.size > pageNo*3+0}" style="float:left;width:100%">
|
<apex:outputPanel layout="none" rendered="{!(selectedRptMapList[pageNo*3+0]['Column'] != 'false')}">
|
<analytics:reportChart reportId="{!selectedRptMapList[pageNo*3+0]['Report']}" cacheResults="true" size="tiny" filter="[{column:'{!selectedRptMapList[pageNo*3+0]['Column']}',operator:'startsWith',value:'{!Left(acc.Id,15)}'}]" />
|
</apex:outputPanel>
|
<apex:outputPanel layout="none" rendered="{!(selectedRptMapList[pageNo*3+0]['Column'] == 'false')}">
|
<analytics:reportChart reportId="{!selectedRptMapList[pageNo*3+0]['Report']}" cacheResults="true" size="tiny"/>
|
</apex:outputPanel>
|
</apex:outputPanel>
|
<apex:outputPanel styleClass="reportElement" layout="block" rendered="{!selectedRptMapList.size > pageNo*3+1}" style="float:left;">
|
<apex:outputPanel layout="none" rendered="{!(selectedRptMapList[pageNo*3+1]['Column'] != 'false')}">
|
<analytics:reportChart reportId="{!selectedRptMapList[pageNo*3+1]['Report']}" cacheResults="true" size="tiny" filter="[{column:'{!selectedRptMapList[pageNo*3+1]['Column']}',operator:'startsWith',value:'{!Left(acc.Id,15)}'}]" />
|
</apex:outputPanel>
|
<apex:outputPanel layout="none" rendered="{!(selectedRptMapList[pageNo*3+1]['Column'] == 'false')}">
|
<analytics:reportChart reportId="{!selectedRptMapList[pageNo*3+1]['Report']}" cacheResults="true" size="tiny"/>
|
</apex:outputPanel>
|
</apex:outputPanel>
|
<apex:outputPanel styleClass="reportElement" layout="block" rendered="{!selectedRptMapList.size > pageNo*3+2}" style="float:left;">
|
<apex:outputPanel layout="none" rendered="{!(selectedRptMapList[pageNo*3+2]['Column'] != 'false')}">
|
<analytics:reportChart reportId="{!selectedRptMapList[pageNo*3+2]['Report']}" cacheResults="true" size="tiny" filter="[{column:'{!selectedRptMapList[pageNo*3+2]['Column']}',operator:'startsWith',value:'{!Left(acc.Id,15)}'}]" />
|
</apex:outputPanel>
|
<apex:outputPanel layout="none" rendered="{!(selectedRptMapList[pageNo*3+2]['Column'] == 'false')}">
|
<analytics:reportChart reportId="{!selectedRptMapList[pageNo*3+2]['Report']}" cacheResults="true" size="tiny"/>
|
</apex:outputPanel>
|
</apex:outputPanel>
|
</apex:pageBlockSection>
|
<apex:outputPanel rendered="{!selectedRptMapList.size > 0}">
|
<br/>
|
<table style="width:100%; font-size:12px; font-weight:bold;">
|
<tr><td style="text-align:center;">
|
<apex:commandButton id="swipeLeft" action="{!prePage}" value="←" disabled="{!pageNo <= 0}" onclick="windowResize();"/>
|
{!pageNo+1}/{!CEILING(selectedRptMapList.size/3)}
|
<apex:commandButton id="swipeRight" action="{!nextPage}" value="→" disabled="{!pageNo+1 >= CEILING(selectedRptMapList.size/3)}" onclick="windowResize();"/>
|
</td></tr>
|
</table>
|
</apex:outputPanel>
|
<apex:outputPanel >
|
<table class="relationList">
|
<tr>
|
<apex:repeat value="{!relationKeyList}" var="rkey">
|
<apex:commandButton value="{!relationMap[rkey].fieldSetLabel}" onclick="showList('{!rkey}');" rerender="dummy"/>
|
</apex:repeat>
|
</tr>
|
</table>
|
</apex:outputPanel>
|
</div>
|
</apex:pageBlock></div>
|
|
<div id="glayLayer" style="z-index:2"></div>
|
<!-- 関連リストのLayer-->
|
<apex:outputPanel id="PanelRelation" layout="inline" >
|
<apex:variable value="{!relationMap[index]}" var="relationList" />
|
<div id="divRelationList" style="display:none;z-index:3;top:{!relationList.top};max-height:{!relationList.height}">
|
<apex:outputPanel id="PanelAsset" layout="none" rendered="{!(relationList.obj=='Asset')}">
|
<apex:pageBlock id="assetBlock" rendered="{!(relationList.mode=='relation')}">
|
<apex:commandButton value="新建点检报告书" action="{!irCreate}"/>
|
<input type="hidden" id="ProductCnt" value="{!productCount}" />
|
<table class="list" border="1" style="border-collapse:collapse;table-layout:fixed;border-bottom-width:0px;border-spacing:0;width:100%">
|
<tr style="background-color:#DCDCDC;" class="headerRow">
|
<td style="width:25px">
|
<input type='checkbox' onClick='checkAll(this)'/>
|
</td>
|
<apex:repeat value="{!relationList.title}" var="t">
|
<td><apex:outputText value="{!t}"/></td>
|
</apex:repeat>
|
</tr>
|
<apex:repeat id="Dataline0" value="{!sobjectMap[index]}" var="sobject">
|
<tr>
|
<td style="padding: 2px 5px; width:25px">
|
<apex:inputCheckbox value="{!checkMap[sobject.Id]}" id="CheckAsset"/>
|
</td>
|
<apex:repeat value="{!relationList.columns}" var="cs">
|
<td>
|
<apex:outputPanel rendered="{!(cs.column1=='')}" layout="none">
|
<apex:outputField value="{!sobject[cs.column0]}"/>
|
</apex:outputPanel>
|
<apex:outputPanel rendered="{!(cs.column1!='')}" layout="none">
|
<apex:outputField value="{!sobject[cs.column0][cs.column1]}"/>
|
</apex:outputPanel>
|
</td>
|
</apex:repeat>
|
</tr>
|
</apex:repeat>
|
</table>
|
<apex:commandButton value="新建点检报告书" action="{!irCreate}"/>
|
<script type="text/javascript">
|
showAssetLayer();
|
</script>
|
</apex:pageBlock>
|
</apex:outputPanel>
|
<apex:outputPanel id="PanelOthers" layout="none" rendered="{!(relationList.obj!='Asset')}">
|
<apex:pageBlock rendered="{!(relationList.mode=='relation')}">
|
<table class="list" border="1" style="border-collapse:collapse;table-layout:fixed;border-bottom-width:0px;border-spacing:0;width:100%">
|
<tr style="background-color:#DCDCDC;" class="headerRow">
|
<apex:repeat value="{!relationList.title}" var="t">
|
<td><apex:outputText value="{!t}"/></td>
|
</apex:repeat>
|
</tr>
|
<apex:repeat id="Dataline" value="{!sobjectMap[index]}" var="sobject">
|
<tr>
|
<apex:repeat value="{!relationList.columns}" var="cs">
|
<td>
|
<apex:outputPanel rendered="{!(cs.column1=='')}" layout="none">
|
<apex:outputField value="{!sobject[cs.column0]}"/>
|
</apex:outputPanel>
|
<apex:outputPanel rendered="{!(cs.column1!='')}" layout="none">
|
<apex:outputField value="{!sobject[cs.column0][cs.column1]}"/>
|
</apex:outputPanel>
|
</td>
|
</apex:repeat>
|
</tr>
|
</apex:repeat>
|
</table>
|
<script type="text/javascript">
|
showAssetLayer();
|
</script>
|
</apex:pageBlock>
|
<apex:outputPanel layout="none" rendered="{!(relationList.mode=='page')}">
|
<apex:iframe height="{!relationList.height}" width="99%" src="{!relationList.fieldSet}" scrolling="true" />
|
</apex:outputPanel>
|
</apex:outputPanel>
|
</div>
|
</apex:outputPanel>
|
</apex:form>
|
<script type="text/javascript">
|
var myElement = document.getElementById('Page:Form:Block:Report');
|
var mc = new Hammer(myElement);
|
mc.get('pan').set({ direction: Hammer.DIRECTION_ALL });
|
mc.on("swipeleft swiperight", function(ev) {
|
if (ev.type == "swipeleft") {
|
document.getElementById('Page:Form:Block:swipeLeft').click();
|
} else {
|
document.getElementById('Page:Form:Block:swipeRight').click();
|
}
|
});
|
</script>
|
</body>
|
</html>
|
</apex:page>
|