Upon opening my page, I encountered an issue where the graphics appear blank. This is because I set up the callback for generating graphic data through params request.
I wish to first fetch the general data when the page opens, and only load with params when a filter is applied
Unfortunately, I am unsure of the approach to take in this scenario
mounted() {
this.refresh()
},
methods: {
refresh () {
this.$axios.get()
var situacao = this.situacao.map(st => st.id)
var cliente = this.cliente.id
var especialidade = this.especialidade.id
var tipo = this.tipos.id
var helpDesk = this.helpDesk.id
var supervisor = this.supervisor.id
var params = {
tipo: tipo,
situacao: situacao,
cliente: cliente,
helpDesk: helpDesk,
especialidade: especialidade,
supervisor: supervisor
}
this.$axios.get("/Operacional/GetRelatorio/?" + qs.stringify( params, { arrayFormat: 'repeat' }))
.then(res => {
this.prazos = res.data
this.$refs.chart1.updateSeries([{
name: 'NO PRAZO',
data: [this.prazos.noPrazo, this.prazos.emDia, this.prazos.atrasadas]
}])
})
My aim is to trigger the params only upon selecting a filter. Otherwise, I want to make a normal GET request without any params so that the graphics do not show as blank once the page is loaded