2017-05-06 00:15:04 -04:00
|
|
|
<script>
|
2017-06-08 03:29:21 -04:00
|
|
|
import tablePagination from '~/vue_shared/components/table_pagination.vue';
|
2017-06-06 01:06:08 -04:00
|
|
|
import eventHub from '../event_hub';
|
2017-09-06 12:14:34 -04:00
|
|
|
import { getParameterByName } from '../../lib/utils/common_utils';
|
2017-05-22 13:47:05 -04:00
|
|
|
|
2017-05-06 00:15:04 -04:00
|
|
|
export default {
|
2017-10-04 10:10:24 -04:00
|
|
|
components: {
|
|
|
|
tablePagination,
|
|
|
|
},
|
2017-05-10 04:06:51 -04:00
|
|
|
props: {
|
|
|
|
groups: {
|
2017-10-04 10:10:24 -04:00
|
|
|
type: Array,
|
2017-05-10 04:06:51 -04:00
|
|
|
required: true,
|
2017-05-08 16:22:26 -04:00
|
|
|
},
|
2017-05-22 13:47:05 -04:00
|
|
|
pageInfo: {
|
|
|
|
type: Object,
|
|
|
|
required: true,
|
|
|
|
},
|
2017-10-04 10:10:24 -04:00
|
|
|
searchEmpty: {
|
|
|
|
type: Boolean,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
searchEmptyMessage: {
|
|
|
|
type: String,
|
|
|
|
required: true,
|
|
|
|
},
|
2017-06-07 04:45:48 -04:00
|
|
|
},
|
2017-05-22 13:47:05 -04:00
|
|
|
methods: {
|
2017-06-06 01:06:08 -04:00
|
|
|
change(page) {
|
2017-09-06 12:14:34 -04:00
|
|
|
const filterGroupsParam = getParameterByName('filter_groups');
|
|
|
|
const sortParam = getParameterByName('sort');
|
2017-06-06 01:06:08 -04:00
|
|
|
eventHub.$emit('fetchPage', page, filterGroupsParam, sortParam);
|
2017-05-22 13:47:05 -04:00
|
|
|
},
|
2017-05-08 16:22:26 -04:00
|
|
|
},
|
2017-05-06 00:15:04 -04:00
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
2017-05-22 19:20:15 -04:00
|
|
|
<div class="groups-list-tree-container">
|
2017-10-04 10:10:24 -04:00
|
|
|
<div
|
|
|
|
v-if="searchEmpty"
|
|
|
|
class="has-no-search-results">
|
|
|
|
{{searchEmptyMessage}}
|
|
|
|
</div>
|
2017-06-07 04:45:48 -04:00
|
|
|
<group-folder
|
2017-10-04 10:10:24 -04:00
|
|
|
v-if="!searchEmpty"
|
2017-06-07 04:45:48 -04:00
|
|
|
:groups="groups"
|
|
|
|
/>
|
|
|
|
<table-pagination
|
2017-10-04 10:10:24 -04:00
|
|
|
v-if="!searchEmpty"
|
2017-05-22 13:47:05 -04:00
|
|
|
:change="change"
|
2017-06-07 04:45:48 -04:00
|
|
|
:pageInfo="pageInfo"
|
|
|
|
/>
|
2017-05-09 19:10:19 -04:00
|
|
|
</div>
|
2017-05-06 00:15:04 -04:00
|
|
|
</template>
|