att
This commit is contained in:
@@ -8,6 +8,7 @@ data-params="DashTabela.instance()">
|
||||
<table class="table table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Solicitação</th>
|
||||
<th>Data Inicio</th>
|
||||
<th>Prazo</th>
|
||||
<th>Ciclo</th>
|
||||
@@ -20,7 +21,7 @@ data-params="DashTabela.instance()">
|
||||
|
||||
<tbody id="lista_${instanceId}">
|
||||
<tr>
|
||||
<td colspan="7" class="text-center">Aguardando filtro...</td>
|
||||
<td colspan="8" class="text-center">Aguardando filtro...</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
+31
-11
@@ -1,24 +1,36 @@
|
||||
div[id^="dashTabela_"] .dtb-card {
|
||||
background: #ececed;
|
||||
border-radius: 34px;
|
||||
padding: 16px 20px;
|
||||
padding: 12px 16px;
|
||||
}
|
||||
|
||||
div[id^="dashTabela_"] .dtb-title {
|
||||
color: #004a6a;
|
||||
font-size: 34px;
|
||||
font-size: 26px;
|
||||
font-weight: 800;
|
||||
text-align: center;
|
||||
margin-bottom: 10px;
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
|
||||
div[id^="dashTabela_"] table th,
|
||||
div[id^="dashTabela_"] table td {
|
||||
vertical-align: top;
|
||||
font-size: 12px;
|
||||
padding-top: 8px;
|
||||
padding-bottom: 8px;
|
||||
}
|
||||
|
||||
div[id^="dashTabela_"] table th {
|
||||
color: #0a4f70;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
div[id^="dashTabela_"] .dtb-row-link {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
div[id^="dashTabela_"] .dtb-row-link:hover td {
|
||||
background: rgba(10, 93, 130, 0.06);
|
||||
}
|
||||
|
||||
div[id^="dashTabela_"] table th:nth-child(1),
|
||||
@@ -32,36 +44,38 @@ div[id^="dashTabela_"] table td:nth-child(3) {
|
||||
|
||||
div[id^="dashTabela_"] table th:nth-child(6),
|
||||
div[id^="dashTabela_"] table td:nth-child(6) {
|
||||
min-width: 220px;
|
||||
min-width: 190px;
|
||||
}
|
||||
|
||||
div[id^="dashTabela_"] .dash-table-footer {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 10px;
|
||||
padding-top: 8px;
|
||||
gap: 8px;
|
||||
padding-top: 6px;
|
||||
border-top: 1px solid #d4d9dd;
|
||||
}
|
||||
|
||||
div[id^="dashTabela_"] .dash-page-size {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
div[id^="dashTabela_"] .dash-page-size label {
|
||||
margin: 0;
|
||||
font-size: 12px;
|
||||
font-size: 11px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
div[id^="dashTabela_"] .dash-page-size select {
|
||||
width: 72px;
|
||||
width: 64px;
|
||||
height: 30px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
div[id^="dashTabela_"] .dash-page-info {
|
||||
font-size: 12px;
|
||||
font-size: 11px;
|
||||
color: #44525a;
|
||||
}
|
||||
|
||||
@@ -70,9 +84,15 @@ div[id^="dashTabela_"] .dash-page-actions {
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
div[id^="dashTabela_"] .dash-page-actions .btn {
|
||||
min-height: 30px;
|
||||
padding: 4px 10px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
@media (max-width: 1300px) {
|
||||
div[id^="dashTabela_"] .dtb-title {
|
||||
font-size: 24px;
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
div[id^="dashTabela_"] .dash-table-footer {
|
||||
|
||||
+84
-4
@@ -35,6 +35,15 @@ self.render(e.detail || []);
|
||||
|
||||
});
|
||||
|
||||
$("#lista_"+this.instanceId).on("click","tr[data-process-number]",function(){
|
||||
var processNumber = String($(this).attr("data-process-number") || "").trim();
|
||||
var processId = String($(this).attr("data-process-id") || "").trim();
|
||||
var link = buildProcessLink(processNumber, processId);
|
||||
if(link){
|
||||
window.open(link,"_blank");
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
render:function(dados){
|
||||
@@ -49,6 +58,8 @@ renderPage:function(){
|
||||
|
||||
var html="";
|
||||
var totalPaginas = this.getTotalPaginas();
|
||||
var totalHeaders = $("#dashTabela_" + this.instanceId + " thead th").length;
|
||||
var hasSolicitacaoColumn = totalHeaders >= 8;
|
||||
|
||||
if(this.paginaAtual > totalPaginas){
|
||||
this.paginaAtual = totalPaginas;
|
||||
@@ -58,9 +69,14 @@ var inicio = (this.paginaAtual - 1) * this.itensPorPagina;
|
||||
var fim = inicio + this.itensPorPagina;
|
||||
var paginaDados = this.dados.slice(inicio,fim);
|
||||
|
||||
paginaDados.forEach(function(item){
|
||||
|
||||
html+="<tr>";
|
||||
paginaDados.forEach(function(item){
|
||||
var numeroSolicitacao = String(item.numeroSolicitacao || "").trim();
|
||||
var processId = String(item.processId || "checklist").trim();
|
||||
var clickableClass = numeroSolicitacao ? "dtb-row-link" : "";
|
||||
html+="<tr class='"+clickableClass+"' data-process-number='"+escAttr(numeroSolicitacao)+"' data-process-id='"+escAttr(processId)+"'>";
|
||||
if(hasSolicitacaoColumn){
|
||||
html+="<td>"+esc(numeroSolicitacao || "-")+"</td>";
|
||||
}
|
||||
html+="<td>"+esc(formataData(item.dataAuditoria))+"</td>";
|
||||
html+="<td>"+esc(formataData(item.dataLimite))+"</td>";
|
||||
html+="<td>"+esc(item.ciclo || "")+"</td>";
|
||||
@@ -73,7 +89,7 @@ html+="</tr>";
|
||||
});
|
||||
|
||||
if(!html){
|
||||
html+="<tr><td colspan='7' class='text-center'>Sem dados para o filtro selecionado</td></tr>";
|
||||
html+="<tr><td colspan='"+(hasSolicitacaoColumn ? 8 : 7)+"' class='text-center'>Sem dados para o filtro selecionado</td></tr>";
|
||||
}
|
||||
|
||||
$("#lista_"+this.instanceId).html(html);
|
||||
@@ -101,6 +117,10 @@ return String(v == null ? "" : v)
|
||||
.replace(/'/g,"'");
|
||||
}
|
||||
|
||||
function escAttr(v){
|
||||
return esc(v).replace(/"/g,""");
|
||||
}
|
||||
|
||||
function formataData(v){
|
||||
var s = String(v || "").trim();
|
||||
if(!s){
|
||||
@@ -120,3 +140,63 @@ return "CONFORME";
|
||||
}
|
||||
return "NAO_CONFORME";
|
||||
}
|
||||
|
||||
function buildProcessLink(numeroSolicitacao, processId){
|
||||
var num = String(numeroSolicitacao || "").trim();
|
||||
if(!num){
|
||||
return "";
|
||||
}
|
||||
|
||||
var pid = String(processId || "").trim() || "checklist";
|
||||
var server = "";
|
||||
var companyId = "";
|
||||
|
||||
try{
|
||||
server = String(window.WCMAPI && window.WCMAPI.serverURL || "").trim();
|
||||
}catch(e){}
|
||||
|
||||
try{
|
||||
companyId = String(window.WCMAPI && window.WCMAPI.organizationId || "").trim();
|
||||
}catch(e2){}
|
||||
|
||||
if(!server){
|
||||
server = window.location.origin;
|
||||
}
|
||||
|
||||
if(!companyId){
|
||||
companyId = getCompanyIdFromDom();
|
||||
}
|
||||
|
||||
if(!companyId){
|
||||
companyId = "1";
|
||||
}
|
||||
|
||||
return server + "/portal/p/" + companyId + "/pageworkflowview?app_ecm_workflowview_detailsProcessInstanceID=" + encodeURIComponent(num) + "&processID=" + encodeURIComponent(pid);
|
||||
}
|
||||
|
||||
function getCompanyIdFromDom(){
|
||||
var selectors = [
|
||||
"input[name='WKCompany']",
|
||||
"#WKCompany",
|
||||
"input[name='companyId']",
|
||||
"#companyId"
|
||||
];
|
||||
|
||||
for(var i=0;i<selectors.length;i++){
|
||||
try{
|
||||
var value = String($(selectors[i]).val() || "").trim();
|
||||
if(value) return value;
|
||||
}catch(e){}
|
||||
}
|
||||
|
||||
try{
|
||||
if(window.parent && window.parent.$){
|
||||
for(var j=0;j<selectors.length;j++){
|
||||
var parentValue = String(window.parent.$(selectors[j]).val() || "").trim();
|
||||
if(parentValue) return parentValue;
|
||||
}
|
||||
}
|
||||
}catch(e2){}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user