|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
<panel-form xmlns="http://www.davinti.com.br/vitruvio/form/mobile/panel"
|
|
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
|
xsi:schemaLocation="http://www.davinti.com.br/vitruvio/form/mobile/panel vitruvio-mobile-panel-form.xsd">
|
|
|
|
|
|
<form formKey="mobile2">
|
|
|
<name>Geral X Dia</name>
|
|
|
|
|
|
<ServerSide>
|
|
|
<DataSources>
|
|
|
<QueryDataSource key="veiculo" autoSyncOnInit="false" refreshInSeconds="3600" autoSyncOnDiscovery="true" />
|
|
|
</DataSources>
|
|
|
</ServerSide>
|
|
|
|
|
|
<initScript language="JavaScript">
|
|
|
<![CDATA[
|
|
|
function run() {
|
|
|
engine.getWidgetController('btnFilter').getButton().setIcon("FILTRAR");
|
|
|
engine.getWidgetController('btnApply').getButton().setIcon("APLICAR");
|
|
|
var hoje = moment().format();
|
|
|
var primeiro = moment().startOf("month");
|
|
|
engine.getField("f_data").setValue(primeiro);
|
|
|
engine.getField("f_data2").setValue(hoje);
|
|
|
}
|
|
|
]]>
|
|
|
</initScript>
|
|
|
|
|
|
<components>
|
|
|
<VerticalLayout>
|
|
|
|
|
|
<ButtonWidget id="btnFilter" caption="">
|
|
|
<onClickScript language="JavaScript">
|
|
|
<![CDATA[
|
|
|
function run() {
|
|
|
engine.getWidgetController('btnFilter').getButton().setVisible(false);
|
|
|
engine.getField("f_data").setVisible(true);
|
|
|
engine.getField("f_data2").setVisible(true);
|
|
|
engine.getField("placa").setVisible(true);
|
|
|
engine.getWidgetController('btnApply').getButton().setVisible(true);
|
|
|
}
|
|
|
]]>
|
|
|
</onClickScript>
|
|
|
</ButtonWidget>
|
|
|
|
|
|
<DateField id="f_data" caption="Data início" type="date" visible="false" required="false" format="dd/MM/yyyy" resolution="DAY"/>
|
|
|
<DateField id="f_data2" caption="Data final" type="date" visible="false" required="false" format="dd/MM/yyyy" resolution="DAY"/>
|
|
|
<DBComboBox type="string" id="placa" caption="Placa veículo" visible="false" >
|
|
|
<datasource>
|
|
|
<query ref="veiculo" />
|
|
|
</datasource>
|
|
|
<key-field>CODIGO</key-field>
|
|
|
<caption-field>PLACA</caption-field>
|
|
|
</DBComboBox>
|
|
|
|
|
|
<ButtonWidget id="btnApply" visible="false" caption=" Aplicar">
|
|
|
<onClickScript language="JavaScript">
|
|
|
<![CDATA[
|
|
|
function run() {
|
|
|
|
|
|
engine.getWidgetController('btnApply').getButton().setVisible(false);
|
|
|
engine.getField("f_data").setVisible(false);
|
|
|
engine.getField("f_data2").setVisible(false);
|
|
|
engine.getField("placa").setVisible(false);
|
|
|
|
|
|
engine.getWidgetController('btnFilter').getButton().setVisible(true);
|
|
|
|
|
|
var data = moment(engine.getField('f_data').getValue()).valueOf();
|
|
|
var data2 = moment(engine.getField('f_data2').getValue()).valueOf();
|
|
|
var placa = engine.getField('placa').getValue();
|
|
|
|
|
|
engine.getDesktopPanel("listaGraficoSemana").addFieldId("dataInicio", data);
|
|
|
engine.getDesktopPanel("listaGraficoSemana").addFieldId("dataFinal", data2);
|
|
|
if (engine.getField('placa').getValue()) {
|
|
|
engine.getDesktopPanel("listaGraficoSemana").addFieldId("placa", placa);
|
|
|
}
|
|
|
engine.getDesktopPanel("listaGraficoSemana").reload();
|
|
|
}
|
|
|
]]>
|
|
|
</onClickScript>
|
|
|
</ButtonWidget>
|
|
|
<DesktopPanel height="400px" id="listaGraficoSemana" panelKey="geralplaca" layoutId="pnlGeral" forceFieldsRender="dataInicio, dataFinal, placa"/>
|
|
|
</VerticalLayout>
|
|
|
</components>
|
|
|
</form>
|
|
|
|
|
|
</panel-form>
|