Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save abishekrsrikaanth/b5579bcbfb1f73cb387d774f241f12d0 to your computer and use it in GitHub Desktop.

Select an option

Save abishekrsrikaanth/b5579bcbfb1f73cb387d774f241f12d0 to your computer and use it in GitHub Desktop.
<script>
export default {
props: ['resourceName', 'resourceId', 'panel'],
data () {
return {
data: []
}
},
mounted () {
this.fetchData()
},
computed: {
model () {
return this.panel.fields[0]['model']
},
groupBy () {
return this.panel.fields[0]['group_by']
},
selectColumns () {
return this.panel.fields[0]['select_columns']
},
usingWhere () {
return this.panel.fields[0]['using_where']
},
groupTitle () {
return this.panel.fields[0]['title']
}
},
methods: {
async fetchData () {
const { data } = await Nova.request().post('/nova-vendor/grouped-view/get-grouped-data', {
model: this.model,
group_by: this.groupBy,
select_columns: this.selectColumns,
resource_id: this.resource_id,
using_where: this.usingWhere
})
this.data = data
}
}
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment