Skip to content

Commit 89bd56e

Browse files
Adjusting sonar issues
1 parent 2941109 commit 89bd56e

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

plugins/mixins/service/snackbarManager.js

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ if (!Vue.__snackbarManager__) {
123123
additionalOptions.topology = this.selectedTopology
124124

125125
if (idAnalysisUnit) { additionalOptions.au = this.$analysisUnitModel.findPlaceByID(idAnalysisUnit) }
126-
if (chartType == 'SANKEYD3') { additionalOptions.metadata = metadata }
126+
if (chartType === 'SANKEYD3') { additionalOptions.metadata = metadata }
127127
if (chartOptions.colorScale && chartOptions.colorScale.scale_name_value && chartOptions.colorScale.color_array) {
128128
if (this.customFilters && this.customFilters[chartOptions.colorScale.scale_name_value]) {
129129
additionalOptions.colorScaleSelectedName = chartOptions.colorScale.color_array[this.customFilters[chartOptions.colorScale.scale_name_value]]
@@ -132,7 +132,7 @@ if (!Vue.__snackbarManager__) {
132132
if (this.leafletBasedCharts.includes(chartType)) {
133133
if (chartOptions.tooltip_function == null) { additionalOptions.tooltipFunction = this.$tooltipBuildingService.defaultLeafletTooltip }
134134

135-
if (chartType == 'MAP_MIGRATION') {
135+
if (chartType === 'MAP_MIGRATION') {
136136
additionalOptions.targetTooltipFunction = chartOptions.target.tooltip_function ? this[chartOptions.target.tooltip_function] : this.$tooltipBuildingService.defaultLeafletTooltip
137137
}
138138
// Prepares the layers
@@ -143,7 +143,7 @@ if (!Vue.__snackbarManager__) {
143143
visibleLayers = this.customParams.enabled
144144
} else if (chartOptions.indicadores) {
145145
for (const ident of chartOptions.indicadores) {
146-
if (chartOptions.show_all || visibleLayers[ident] == null || visibleLayers[ident] == undefined) {
146+
if (chartOptions.show_all || visibleLayers[ident] == null || visibleLayers[ident] === undefined) {
147147
visibleLayers[ident] = true
148148
} else {
149149
visibleLayers[ident] = false
@@ -172,12 +172,12 @@ if (!Vue.__snackbarManager__) {
172172
if (options && options.clickable) {
173173
text += "<p class='text-xs-right ma-0'><a href='" + this.$tooltipBuildingService.getUrlByPlace(target.options.rowData.cd_mun_ibge, route) + "' class='primary--text font-weight-black'>IR PARA</a></p>"
174174
}
175-
if (this.customParams.filterUrl && this.customParams.filterUrl != '') {
175+
if (this.customParams.filterUrl && this.customParams.filterUrl !== '') {
176176
url = url + this.customParams.filterUrl
177177
urlSUAS = urlSUAS + this.customParams.filterUrl
178178
text += 'Considerados os seguintes filtros: ' + this.customParams.filterText
179179
}
180-
if (this.customFilters && this.customFilters.filterUrl && this.customFilters.filterUrl != '') {
180+
if (this.customFilters && this.customFilters.filterUrl && this.customFilters.filterUrl !== '') {
181181
url = url + this.customFilters.filterUrl
182182
urlSUAS = urlSUAS + this.customFilters.filterUrl
183183
text += 'Considerados os seguintes filtros: ' + this.customFilters.filterText
@@ -274,13 +274,13 @@ if (!Vue.__snackbarManager__) {
274274

275275
text += "<tr><td class='font-weight-bold green--text accent-4'>RESGATES</td></tr>"
276276
text += '<tr><td>' + this.$numberTransformService.formatNumber(vl_rgt, 'inteiro') + ' resgates</td></tr>'
277-
if (vl_rgt != 0) {
277+
if (vl_rgt !== 0) {
278278
text += '<tr><td>' + vl_rgt_rank_uf + 'ª posição no Estado com ' + vl_rgt_pct_uf + ' do total</td></tr>'
279279
text += '<tr><td>' + vl_rgt_rank_br + 'ª posição no Brasil com ' + vl_rgt_pct_br + ' do total</td></tr>'
280280
ano_min = this.customParams.value_min && this.customParams.value_min >= vl_rgt_nu_competencia_min ? this.customParams.value_min : vl_rgt_nu_competencia_min
281281
ano_max = this.customParams.value_max && this.customParams.value_max <= vl_rgt_nu_competencia_max ? this.customParams.value_max : vl_rgt_nu_competencia_max
282282
text += '<tr><td>Fonte: Radar SIT - Painel de Informações e Estatísticas da Inspeção do Trabalho no Brasil</td></tr>'
283-
text += '<tr><td>Período: ' + ano_min + (ano_min != ano_max ? ' a ' + ano_max : '') + '</td></tr>'
283+
text += '<tr><td>Período: ' + ano_min + (ano_min !== ano_max ? ' a ' + ano_max : '') + '</td></tr>'
284284
}
285285
// text += "<tr><td class='font-weight-bold accent-4'><br/>OPERAÇÕES</td></tr>"
286286
// text += '<tr><td>' + this.$numberTransformService.formatNumber(vl_ope, 'inteiro') + ' operações</td></tr>'
@@ -298,23 +298,23 @@ if (!Vue.__snackbarManager__) {
298298
// }
299299
text += "<tr><td class='font-weight-bold red--text'><br/>RESGATADOS NATURAIS</td></tr>"
300300
text += '<tr><td>' + this.$numberTransformService.formatNumber(vl_nat, 'inteiro') + ' trabalhadores regatados nascidos no município em destaque</td></tr>'
301-
if (vl_nat != 0) {
301+
if (vl_nat !== 0) {
302302
text += '<tr><td>' + vl_nat_rank_uf + 'ª posição no Estado com ' + vl_nat_pct_uf + ' do total</td></tr>'
303303
text += '<tr><td>' + vl_nat_rank_br + 'ª posição no Brasil com ' + vl_nat_pct_br + ' do total</td></tr>'
304304
ano_min = this.customParams.value_min && this.customParams.value_min >= vl_nat_nu_competencia_min ? this.customParams.value_min : vl_nat_nu_competencia_min
305305
ano_max = this.customParams.value_max && this.customParams.value_max <= vl_nat_nu_competencia_max ? this.customParams.value_max : vl_nat_nu_competencia_max
306306
text += '<tr><td>Fonte: Seguro Desemprego do Trabalhador Resgatado (MTb)</td></tr>'
307-
text += '<tr><td>Período: ' + ano_min + (ano_min != ano_max ? ' a ' + ano_max : '') + '</td></tr>'
307+
text += '<tr><td>Período: ' + ano_min + (ano_min !== ano_max ? ' a ' + ano_max : '') + '</td></tr>'
308308
}
309309
text += "<tr><td class='font-weight-bold light-blue--text'><br/>RESGATADOS RESIDENTES</td></tr>"
310310
text += '<tr><td>' + this.$numberTransformService.formatNumber(vl_res, 'inteiro') + ' trabalhadores resgatados que declararam residir, no momento do resgate, no município em destaque</td></tr>'
311-
if (vl_res != 0) {
311+
if (vl_res !== 0) {
312312
text += '<tr><td>' + vl_res_rank_uf + 'ª posição no Estado com ' + vl_res_pct_uf + ' do total</td></tr>'
313313
text += '<tr><td>' + vl_res_rank_br + 'ª posição no Brasil com ' + vl_res_pct_br + ' do total</td></tr>'
314314
ano_min = this.customParams.value_min && this.customParams.value_min >= vl_res_nu_competencia_min ? this.customParams.value_min : vl_res_nu_competencia_min
315315
ano_max = this.customParams.value_max && this.customParams.value_max <= vl_res_nu_competencia_max ? this.customParams.value_max : vl_res_nu_competencia_max
316316
text += '<tr><td>Fonte: Seguro Desemprego do Trabalhador Resgatado (MTb)</td></tr>'
317-
text += '<tr><td>Período: ' + ano_min + (ano_min != ano_max ? ' a ' + ano_max : '') + '</td></tr>'
317+
text += '<tr><td>Período: ' + ano_min + (ano_min !== ano_max ? ' a ' + ano_max : '') + '</td></tr>'
318318
}
319319
text += "<tr><td class='font-weight-bold purple--text'><br/>SOBREVIVENTES ATENDIDOS PELA ASSISTÊNCIA</td></tr>"
320320
text += '<tr><td>' + (dtSUAS && dtSUAS[0] ? 'Possui sobreviventes de tráfico de pessoas com acompanhamento pelo Serviço de Proteção e Atendimento Especializado a Famílias e Indivíduos (PAEFI) no Centro de Referência Especializado de Assistência Social (CREAS)' : 'Nenhum registro de sobreviventes de tráfico de pessoas com acompanhamento pelo Serviço de Proteção e Atendimento Especializado a Famílias e Indivíduos (PAEFI) no Centro de Referência Especializado de Assistência Social (CREAS)') + '</td></tr>'
@@ -388,7 +388,7 @@ if (!Vue.__snackbarManager__) {
388388
if (options && options.clickable) {
389389
text += "<p class='text-xs-right ma-0'><a href='" + this.$tooltipBuildingService.getUrlByPlace(target.options.rowData.cd_mun_ibge, route) + "' class='primary--text font-weight-black'>IR PARA</a></p>"
390390
}
391-
if (this.customParams.filterUrl && this.customParams.filterUrl != '') {
391+
if (this.customParams.filterUrl && this.customParams.filterUrl !== '') {
392392
urlSinan = urlSinan + this.customParams.filterUrl
393393
urlCatMenores = urlCatMenores + this.customParams.filterUrl
394394
urlProvaBrasil = urlProvaBrasil + this.customParams.filterUrl
@@ -474,7 +474,7 @@ if (!Vue.__snackbarManager__) {
474474
if (options && options.clickable) {
475475
text += "<p class='text-xs-right ma-0'><a href='" + this.$tooltipBuildingService.getUrlByPlace(target.options.rowData.cd_municipio_ibge_dv, route) + "' class='primary--text font-weight-black'>IR PARA</a></p>"
476476
}
477-
if (target.options.rowData.codigo == 'sinan') {
477+
if (target.options.rowData.codigo === 'sinan') {
478478
const urlIndicadores = "/indicadoresmunicipais?categorias=nm_municipio_uf,ds_agreg_primaria,ds_fonte&valor=vl_indicador,nu_competencia,nu_competencia&agregacao=sum,min,max&ordenacao=ds_agreg_primaria&filtros=nn-vl_indicador,and,ne-vl_indicador-0,and,in-cd_indicador-'06_05_01_00'-'06_05_02_00'-'06_05_03_00'-'06_05_04_00'-'06_05_05_00'-'06_05_06_00'-'06_05_07_00'-'06_05_08_00'-'06_05_09_00'-'06_05_20_00',and,ge-nu_competencia-'2012',and,eq-cd_mun_ibge-" + target.options.rowData.cd_mun_ibge
479479
// if (this.customParams.filterUrl && this.customParams.filterUrl != ""){
480480
// url = url + this.customParams.filterUrl;
@@ -508,12 +508,12 @@ if (!Vue.__snackbarManager__) {
508508
let txtTipoQtde = ''
509509
let txtColor = ''
510510
let filtro = ''
511-
if (this.customParams.filterUrl && this.customParams.filterUrl != '') {
511+
if (this.customParams.filterUrl && this.customParams.filterUrl !== '') {
512512
filtro = this.customParams.filterUrl
513513
text += 'Considerados os seguintes filtros: ' + this.customParams.filterText
514514
}
515515

516-
if (target.options.rowData.codigo == 'cat') {
516+
if (target.options.rowData.codigo === 'cat') {
517517
urlPeriodo = '/sst/cats?categorias=1&valor=ano_cat&agregacao=min,max'
518518
urlTipo = "/sst/cats?categorias=ds_natureza_lesao-nm_tipo&agregacao=COUNT&filtros=ne-ds_natureza_lesao-'',and,eq-cd_municipio_ibge-" + target.options.rowData.cd_mun_ibge + filtro + '&ordenacao=-agr_count&limit=5'
519519
txtTipoTitulo = 'ACIDENTES DE TRABALHO'
@@ -522,7 +522,7 @@ if (!Vue.__snackbarManager__) {
522522
urlAtividade = "/sst/cats?categorias=ds_cnae_classe_cat-nm_atividade&agregacao=COUNT&filtros=ne-ds_cnae_classe_cat-'',and,ne-ds_cnae_classe_cat-'Indefinido',and,eq-cd_municipio_ibge-" + target.options.rowData.cd_mun_ibge + filtro + '&ordenacao=-agr_count&limit=5'
523523
urlObs1 = '/sst/cats?categorias=cd_municipio_ibge&agregacao=COUNT&filtros=lt-idade_cat-18,and,ne-idade_cat-0,and,eq-cd_municipio_ibge-' + target.options.rowData.cd_mun_ibge + filtro
524524
urlObs2 = "/sst/cats?categorias=cd_municipio_ibge&agregacao=COUNT&filtros=eq-cd_indica_obito-'S',and,eq-cd_municipio_ibge-" + target.options.rowData.cd_mun_ibge + filtro
525-
} else if (target.options.rowData.codigo == 'mortes') {
525+
} else if (target.options.rowData.codigo === 'mortes') {
526526
urlPeriodo = '/sst/cats?categorias=1&valor=ano_cat&agregacao=min,max'
527527
urlTipo = "/sst/cats?categorias=ds_natureza_lesao-nm_tipo&agregacao=COUNT&filtros=ne-ds_natureza_lesao-'',and,eq-cd_indica_obito-'S',and,eq-cd_municipio_ibge-" + target.options.rowData.cd_mun_ibge + filtro + '&ordenacao=-agr_count&limit=5'
528528
txtTipoTitulo = 'ACIDENTES DE TRABALHO COM MORTES'
@@ -576,17 +576,17 @@ if (!Vue.__snackbarManager__) {
576576
text += "<tr><td colspan='2'><br/></td></tr>"
577577
let ano_min = ''
578578
let ano_max = ''
579-
if (target.options.rowData.codigo == 'cat' || target.options.rowData.codigo == 'mortes') {
579+
if (target.options.rowData.codigo === 'cat' || target.options.rowData.codigo === 'mortes') {
580580
ano_min = this.customParams.value_min_ano_cat ? this.customParams.value_min_ano_cat : dtPeriodo.dataset[0].agr_min_ano_cat
581581
ano_max = this.customParams.value_max_ano_cat ? this.customParams.value_max_ano_cat : dtPeriodo.dataset[0].agr_max_ano_cat
582582
if (dtObs1.length > 0) {
583583
text += "<tr><td colspan='2'>" + this.$numberTransformService.formatNumber(dtObs1[0].agr_count, 'inteiro') + ' ocorrências envolveram menores de 18 anos.</td></tr>'
584584
}
585-
if (dtObs2.length > 0 && target.options.rowData.codigo == 'cat') {
585+
if (dtObs2.length > 0 && target.options.rowData.codigo === 'cat') {
586586
text += "<tr><td colspan='2'>Foram reportadas, ainda, " + this.$numberTransformService.formatNumber(dtObs2[0].agr_count, 'inteiro') + ' mortes.</td></tr>'
587587
}
588588
text += "<tr><td colspan='2'><br/>Fonte: " + dtPeriodo.metadata.fonte + '</td></tr>'
589-
text += "<tr><td colspan='2'>Período: " + ano_min + (ano_min != ano_max ? ' a ' + ano_max : '') + '</td></tr>'
589+
text += "<tr><td colspan='2'>Período: " + ano_min + (ano_min !== ano_max ? ' a ' + ano_max : '') + '</td></tr>'
590590
} else {
591591
ano_min = this.customParams.value_min_ano_beneficio ? this.customParams.value_min_ano_beneficio : dtPeriodo.dataset[0].agr_min_ano_beneficio
592592
ano_max = this.customParams.value_max_ano_beneficio ? this.customParams.value_max_ano_beneficio : dtPeriodo.dataset[0].agr_max_ano_beneficio
@@ -596,7 +596,7 @@ if (!Vue.__snackbarManager__) {
596596
text += "<tr><td colspan='2'>O impacto previdenciário dos afastamentos acidentários no município foi de " + this.$numberTransformService.formatNumber(dtObs1[0].agr_sum_vl_indicador, 'monetario', 2) + ' , com a perda de ' + this.$numberTransformService.formatNumber(dtObs2[0].agr_sum_qt_dias_perdidos, 'inteiro') + ' dias de trabalho.</td></tr>'
597597
}
598598
text += "<tr><td colspan='2'><br/>Fonte: " + dtPeriodo.metadata.fonte + '</td></tr>'
599-
text += "<tr><td colspan='2'>Período: " + ano_min + (ano_min != ano_max ? ' a ' + ano_max : '') + '</td></tr>'
599+
text += "<tr><td colspan='2'>Período: " + ano_min + (ano_min !== ano_max ? ' a ' + ano_max : '') + '</td></tr>'
600600
}
601601
text += '</table>'
602602

0 commit comments

Comments
 (0)