Created
March 9, 2020 17:11
-
-
Save abishekrsrikaanth/b5579bcbfb1f73cb387d774f241f12d0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <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