Skip to content

Commit

Permalink
更新数据导出
Browse files Browse the repository at this point in the history
  • Loading branch information
yiifaa committed Jun 26, 2017
1 parent d2013ad commit f3cff7e
Show file tree
Hide file tree
Showing 6 changed files with 232 additions and 514 deletions.
85 changes: 19 additions & 66 deletions WebContent/birt/ajax/ui/dialog/BirtSimpleExportDataDialog.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
/******************************************************************************
* Copyright (c) 2004 Actuate Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Actuate Corporation - Initial implementation.
*****************************************************************************/

/**
* Birt export data dialog.
Expand Down Expand Up @@ -55,11 +45,15 @@ BirtSimpleExportDataDialog.prototype = Object.extend( new AbstractBaseDialog( ),

// Initialize exchange buttons
var oInputs = this.__instance.getElementsByTagName( 'input' );
for ( var i = 0; i < oInputs.length ; i++ )
{
for ( var i = 0; i < oInputs.length ; i++ ) {
Event.observe( oInputs[i], 'click', this.__neh_click_exchange_closure, false );
}

var oButtons = this.__instance.getElementsByTagName('button');
for(var i = 0; i < oButtons.length; i ++) {
Event.observe(oButtons[i], 'click', this.__neh_click_exchange_closure, false );
}

// Initialize exchange selects
var oSelects = this.__instance.getElementsByTagName( 'select' );
if( oSelects.length > 2 )
Expand All @@ -76,23 +70,21 @@ BirtSimpleExportDataDialog.prototype = Object.extend( new AbstractBaseDialog( ),
*/
__neh_click_exchange : function( event )
{
var oSC = Event.element( event );
if( oSC.id == 'exportDataEncoding_other' )
{
var oSC = Event.element(event);
if(oSC.id == 'exportDataEncoding_other' ) {
this.__updateButtons( );
$( 'exportDataOtherEncoding_input' ).focus( );
$('exportDataOtherEncoding_input').focus( );
}
else
{
else {
var oInputs = this.__instance.getElementsByTagName( 'input' );
var oSelects = this.__instance.getElementsByTagName( 'select' );

switch ( Event.element( event ).name )
{
case 'Addall':
{
if ( oSelects[1].options.length > 0 )
{
// 如果是子节点
if(oSC.hasClassName('glyphicon')) {
oSC = oSC.parentElement;
}
switch (oSC.name) {
case 'Addall': {
if ( oSelects[1].options.length > 0 ) {
this.moveAllItems( oSelects[1], oSelects[2] );
}
break;
Expand Down Expand Up @@ -195,52 +187,13 @@ BirtSimpleExportDataDialog.prototype = Object.extend( new AbstractBaseDialog( ),
var srcSelectedIndex = oSelects[1].selectedIndex;
var destSelectedIndex = oSelects[2].selectedIndex;

var oInputs = this.__instance.getElementsByTagName( 'input' );
var oInputs = this.__instance.getElementsByTagName('button');

if( !rtl )
{
oInputs[0].src = canAdd ? "birt/images/AddAll.gif" : "birt/images/AddAll_disabled.gif";
}
else
{
oInputs[0].src = canAdd ? "birt/images/AddAll_rtl.gif" : "birt/images/AddAll_disabled_rtl.gif";
}
oInputs[0].style.cursor = canAdd ? "pointer" : "default";

if( !rtl )
{
oInputs[1].src = canAdd && srcSelectedIndex >= 0 ? "birt/images/Add.gif" : "birt/images/Add_disabled.gif";
}
else
{
oInputs[1].src = canAdd && srcSelectedIndex >= 0 ? "birt/images/Add_rtl.gif" : "birt/images/Add_disabled_rtl.gif";
}
oInputs[1].style.cursor = canAdd ? "pointer" : "default";

if( !rtl )
{
oInputs[2].src = canRemove && destSelectedIndex >= 0 ? "birt/images/Remove.gif" : "birt/images/Remove_disabled.gif";
}
else
{
oInputs[2].src = canRemove && destSelectedIndex >= 0 ? "birt/images/Remove_rtl.gif" : "birt/images/Remove_disabled_rtl.gif";
}
oInputs[2].style.cursor = canRemove ? "pointer" : "default";

if( !rtl )
{
oInputs[3].src = canRemove ? "birt/images/RemoveAll.gif" : "birt/images/RemoveAll_disabled.gif";
}
else
{
oInputs[3].src = canRemove ? "birt/images/RemoveAll_rtl.gif" : "birt/images/RemoveAll_disabled_rtl.gif";
}
oInputs[3].style.cursor = canRemove ? "pointer" : "default";

oInputs[4].src = canRemove && destSelectedIndex >= 0 ? "birt/images/Up.gif" : "birt/images/Up_disabled.gif";
oInputs[4].style.cursor = canRemove ? "pointer" : "default";

oInputs[5].src = canRemove && destSelectedIndex >= 0 ? "birt/images/Down.gif" : "birt/images/Down_disabled.gif";
oInputs[5].style.cursor = canRemove ? "pointer" : "default";

if( canExport )
Expand All @@ -261,7 +214,7 @@ BirtSimpleExportDataDialog.prototype = Object.extend( new AbstractBaseDialog( ),
}
else
{
this.__setDisabled( 'exportDataEncodingSetting', true );
this.__setDisabled('exportDataEncodingSetting', true );
$( 'exportDataCSVSeparator' ).disabled = true;
}
},
Expand Down
121 changes: 10 additions & 111 deletions WebContent/birt/pages/dialog/ExportDataDialogFragment.jsp
Original file line number Diff line number Diff line change
@@ -1,116 +1,15 @@
<%-----------------------------------------------------------------------------
Copyright (c) 2004 Actuate Corporation and others.
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
which accompanies this distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html
Contributors:
Actuate Corporation - Initial implementation.
-----------------------------------------------------------------------------%>
<%@ page contentType="text/html; charset=utf-8" %>
<%@ page session="false" buffer="none" %>
<%@ page import="org.eclipse.birt.report.presentation.aggregation.IFragment,
org.eclipse.birt.report.resource.BirtResources" %>

<%-----------------------------------------------------------------------------
Expected java beans
-----------------------------------------------------------------------------%>
<jsp:useBean id="fragment" type="org.eclipse.birt.report.presentation.aggregation.IFragment" scope="request" />

<%-----------------------------------------------------------------------------
Export data dialog fragment
-----------------------------------------------------------------------------%>
<DIV ID="dialog_content">
<TABLE CELLSPACING="0" CELLPADDING="0" STYLE="width:100%">
<TR>
<TD>
<TABLE ID="tabs" CELLSPACING="0" CELLPADDING="2">
<TR HEIGHT="20px">
<TD CLASS="birtviewer_dialog_tab_selected" NOWRAP>
<%=
BirtResources.getMessage( "birt.viewer.dialog.exportdata.tab.field" )
%>
</TD>
<TD CLASS="birtviewer_dialog_tab_normal">
<%= BirtResources.getMessage( "birt.viewer.dialog.exportdata.tab.filter" )%>
</TD>
</TR>
</TABLE>
</TD>
</TR>
<TR>
<TD>
<DIV ID="aaacontent">
<DIV >
<TABLE CELLSPACING="2" CELLPADDING="2" CLASS="birtviewer_dialog_body">
<TR HEIGHT="5px"><TD></TD></TR>
<TR>
<TD>
<%= BirtResources.getMessage( "birt.viewer.dialog.exportdata.availablecolumn" )%>
</TD>
<TD></TD>
<TD>
<%= BirtResources.getMessage( "birt.viewer.dialog.exportdata.selectedcolumn" )%>
</TD>
</TR>
<TR>
<TD VALIGN="top">
<TABLE>
<TR><TD>
<SELECT ID="availableColumnSelect" SIZE="10" CLASS="birtviewer_exportdata_dialog_select">
</SELECT>
</TD></TR>
</TABLE>
</TD>
<TD VALIGN="top">
<TABLE HEIGHT="100%">
<TR><TD>&nbsp;</TD></TR>
<TR><TD>
<TABLE VALIGN="top">
<TR><TD>
<INPUT TYPE="button" VALUE=">>" CLASS="birtviewer_exportdata_dialog_button">
</TD></TR>
<TR><TD>
<INPUT TYPE="button" VALUE=">" CLASS="birtviewer_exportdata_dialog_button">
</TD></TR>
<TR><TD>
<INPUT TYPE="button" VALUE="<" CLASS="birtviewer_exportdata_dialog_button">
</TD></TR>
<TR><TD>
<INPUT TYPE="button" VALUE="<<" CLASS="birtviewer_exportdata_dialog_button">
</TD></TR>
</TABLE>
</TD></TR>
</TABLE>
</TD>
<TD>
<TABLE>
<TR><TD>
<SELECT ID="selectedColumnSelect" SIZE="10" CLASS="birtviewer_exportdata_dialog_select">
</SELECT>
</TD></TR>
</TABLE>
</TD>
</TR>
<TR HEIGHT="5px"><TD></TD></TR>
<TR>
<TD COLSPAN="3" STYLE="font-size:7pt">
<%= BirtResources.getMessage( "birt.viewer.dialog.exportdata.format" )%>
</TD>
</TR>
<TR HEIGHT="5px"><TD></TD></TR>
</TABLE>
</DIV>
<DIV STYLE="display:none">
<IMG NAME="add" SRC="birt/images/AddFilter.gif" TITLE="add" CLASS="birtviewer_clickable">
<TABLE ID="ExportCriteriaTable" CELLSPACING="2" CELLPADDING="2" CLASS="birtviewer_dialog_body">
<TBODY ID="ExportCriteriaTBODY">
</TBODY>
</TABLE>
</DIV>
</DIV>
</TD>
</TR>
</TABLE>
</DIV>
<div class="row">
<div class="col-sm-10 col-sm-offset-1" id="dialog_content">
<div class="form-horizontal">




</div>
</div>
</div>
24 changes: 12 additions & 12 deletions WebContent/birt/pages/dialog/ExportReportDialogFragment.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,16 @@
<div class="form-group">
<label for="exportFormat" class="col-sm-4 control-label"><%=BirtResources.getMessage("birt.viewer.dialog.page")%></label>
<div class="col-sm-8" id="exportPageSetting">
<label class="checkbox-inline">
<input type="checkbox" id="exportPageAll" name="exportPages" checked>
<label class="radio-inline">
<input type="radio" id="exportPageAll" name="exportPages" checked>
<%=BirtResources.getHtmlMessage("birt.viewer.dialog.page.all")%>
</label>
<label class="checkbox-inline">
<input type="checkbox" id="exportPageCurrent" name="exportPages">
<label class="radio-inline">
<input type="radio" id="exportPageCurrent" name="exportPages">
<%=BirtResources.getHtmlMessage("birt.viewer.dialog.page.current")%>
</label>
<label class="checkbox-inline" style="display:none;">
<input type="checkbox" id="exportPageRange" name="exportPages">
<label class="radio-inline" style="display:none;">
<input type="radio" id="exportPageRange" name="exportPages">
<%=BirtResources.getHtmlMessage("birt.viewer.dialog.page.range")%>
<input type="text" id="exportPageRange_input" class="form-control" style="display:inline-block;width:150px;" name="exportPages" disabled="disabled">
</label>
Expand All @@ -50,16 +50,16 @@
<div class="form-group" id="exportFitSetting">
<label for="exportFormat" class="col-sm-4 control-label"><%=BirtResources.getMessage("birt.viewer.dialog.export.pdf.fitto")%></label>
<div class="col-sm-8">
<label class="checkbox-inline">
<input type="checkbox" id="exportFitToAuto" name="exportFit" checked>
<label class="radio-inline">
<input type="radio" id="exportFitToAuto" name="exportFit" checked>
<%=BirtResources.getHtmlMessage("birt.viewer.dialog.export.pdf.fittoauto")%>
</label>
<label class="checkbox-inline">
<input type="checkbox" id="exportFitToActual" name="exportFit">
<label class="radio-inline">
<input type="radio" id="exportFitToActual" name="exportFit">
<%=BirtResources.getHtmlMessage("birt.viewer.dialog.export.pdf.fittoactual")%>
</label>
<label class="checkbox-inline">
<input type="checkbox" id="exportFitToWhole" name="exportFit">
<label class="radio-inline">
<input type="radio" id="exportFitToWhole" name="exportFit">
<%=BirtResources.getHtmlMessage("birt.viewer.dialog.export.pdf.fittowhole")%>
</label>
</div>
Expand Down
Loading

0 comments on commit f3cff7e

Please sign in to comment.