att
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
application.type=widget
|
||||
application.code=dashkpi
|
||||
application.title=dashkpi
|
||||
application.description=dashkpi
|
||||
application.fluig.version=null
|
||||
application.category=SYSTEM
|
||||
application.renderer=freemarker
|
||||
developer.code=andrey.cunha
|
||||
developer.name=andrey.cunha
|
||||
developer.url=http://www.fluig.com
|
||||
application.uiwidget=true
|
||||
application.mobileapp=false
|
||||
application.version=${build.version}-${build.revision}
|
||||
view.file=view.ftl
|
||||
edit.file=edit.ftl
|
||||
locale.file.base.name=dashkpi
|
||||
application.resource.js.1=/resources/js/dashkpi.js
|
||||
application.resource.css.2=/resources/css/dashkpi.css
|
||||
hash=4a16315e9e66fa7d797b3f6b1fb365b69f9a4ce2
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
<div id="MyWidget_${instanceId}" class="super-widget wcm-widget-class fluig-style-guide" data-params="MyWidget.instance()">
|
||||
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
<div id="dashKPI_${instanceId}"
|
||||
class="super-widget wcm-widget-class fluig-style-guide"
|
||||
data-params="DashKPI.instance()">
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
<h4>Total Auditorias</h4>
|
||||
<h2 id="kpi_total_${instanceId}">0</h2>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="panel panel-success">
|
||||
<div class="panel-body">
|
||||
<h4>Conformes</h4>
|
||||
<h2 id="kpi_ok_${instanceId}">0</h2>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="panel panel-danger">
|
||||
<div class="panel-body">
|
||||
<h4>Não Conformes</h4>
|
||||
<h2 id="kpi_nok_${instanceId}">0</h2>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="panel panel-info">
|
||||
<div class="panel-body">
|
||||
<h4>% Conformidade</h4>
|
||||
<h2 id="kpi_pct_${instanceId}">0%</h2>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<jboss-web>
|
||||
<context-root>/dashkpi</context-root>
|
||||
<disable-cross-context>false</disable-cross-context>
|
||||
</jboss-web>
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
|
||||
version="3.0">
|
||||
<session-config>
|
||||
<session-timeout>
|
||||
30
|
||||
</session-timeout>
|
||||
</session-config>
|
||||
</web-app>
|
||||
@@ -0,0 +1 @@
|
||||
/* Coloque aqui seu codigo CSS */
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 7.7 KiB |
@@ -0,0 +1,41 @@
|
||||
var DashKPI = SuperWidget.extend({
|
||||
|
||||
init:function(){
|
||||
|
||||
var self=this;
|
||||
|
||||
window.addEventListener("dashboardData",function(e){
|
||||
|
||||
self.calcular(e.detail);
|
||||
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
calcular:function(dados){
|
||||
|
||||
var total=dados.length;
|
||||
|
||||
var conformes=dados.filter(function(i){
|
||||
return normalizaStatus(i)=="CONFORME";
|
||||
}).length;
|
||||
|
||||
var nao=dados.filter(function(i){
|
||||
return normalizaStatus(i)=="NAO_CONFORME";
|
||||
}).length;
|
||||
|
||||
var pct= total ? Math.round((conformes/total)*100) : 0;
|
||||
|
||||
$("#kpi_total_"+this.instanceId).text(total);
|
||||
$("#kpi_ok_"+this.instanceId).text(conformes);
|
||||
$("#kpi_nok_"+this.instanceId).text(nao);
|
||||
$("#kpi_pct_"+this.instanceId).text(pct+"%");
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
function normalizaStatus(item){
|
||||
var raw = item.saidaAnalise || item.status || "";
|
||||
return String(raw).trim().toUpperCase();
|
||||
}
|
||||
Binary file not shown.
Reference in New Issue
Block a user