2017-09-10 17:25:29 +05:30
|
|
|
<script>
|
2018-03-17 18:26:18 +05:30
|
|
|
import tablePagination from '~/vue_shared/components/table_pagination.vue';
|
|
|
|
import eventHub from '../event_hub';
|
|
|
|
import { getParameterByName } from '../../lib/utils/common_utils';
|
2017-09-10 17:25:29 +05:30
|
|
|
|
2018-03-17 18:26:18 +05:30
|
|
|
export default {
|
|
|
|
components: {
|
|
|
|
tablePagination,
|
2017-09-10 17:25:29 +05:30
|
|
|
},
|
2018-03-17 18:26:18 +05:30
|
|
|
props: {
|
|
|
|
groups: {
|
|
|
|
type: Array,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
pageInfo: {
|
|
|
|
type: Object,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
searchEmpty: {
|
|
|
|
type: Boolean,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
searchEmptyMessage: {
|
|
|
|
type: String,
|
|
|
|
required: true,
|
|
|
|
},
|
2017-09-10 17:25:29 +05:30
|
|
|
},
|
2018-03-17 18:26:18 +05:30
|
|
|
methods: {
|
|
|
|
change(page) {
|
|
|
|
const filterGroupsParam = getParameterByName('filter_groups');
|
|
|
|
const sortParam = getParameterByName('sort');
|
|
|
|
const archivedParam = getParameterByName('archived');
|
|
|
|
eventHub.$emit('fetchPage', page, filterGroupsParam, sortParam, archivedParam);
|
|
|
|
},
|
2017-09-10 17:25:29 +05:30
|
|
|
},
|
2018-03-17 18:26:18 +05:30
|
|
|
};
|
2017-09-10 17:25:29 +05:30
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<div class="groups-list-tree-container">
|
2018-03-17 18:26:18 +05:30
|
|
|
<div
|
|
|
|
v-if="searchEmpty"
|
|
|
|
class="has-no-search-results"
|
|
|
|
>
|
|
|
|
{{ searchEmptyMessage }}
|
|
|
|
</div>
|
2017-09-10 17:25:29 +05:30
|
|
|
<group-folder
|
2018-03-17 18:26:18 +05:30
|
|
|
v-if="!searchEmpty"
|
2017-09-10 17:25:29 +05:30
|
|
|
:groups="groups"
|
|
|
|
/>
|
|
|
|
<table-pagination
|
2018-03-17 18:26:18 +05:30
|
|
|
v-if="!searchEmpty"
|
2017-09-10 17:25:29 +05:30
|
|
|
:change="change"
|
2018-03-17 18:26:18 +05:30
|
|
|
:page-info="pageInfo"
|
2017-09-10 17:25:29 +05:30
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</template>
|