|
|
|
@ -9,9 +9,9 @@
|
|
|
|
|
</template> |
|
|
|
|
<template slot="content"> |
|
|
|
|
<template v-if="datasourcesList.length"> |
|
|
|
|
<m-list :datasources-list="datasourcesList" :page-no="pageNo" :page-size="pageSize"></m-list> |
|
|
|
|
<m-list :datasources-list="datasourcesList" :page-no="searchParams.pageNo" :page-size="searchParams.pageSize"></m-list> |
|
|
|
|
<div class="page-box"> |
|
|
|
|
<x-page :current="pageNo" :total="total" show-elevator @on-change="_page"></x-page> |
|
|
|
|
<x-page :current="parseInt(searchParams.pageNo)" :total="total" :page-size="searchParams.pageSize" show-elevator @on-change="_page"></x-page> |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
|
<template v-if="!datasourcesList.length"> |
|
|
|
@ -23,11 +23,13 @@
|
|
|
|
|
</m-list-construction> |
|
|
|
|
</template> |
|
|
|
|
<script> |
|
|
|
|
import _ from 'lodash' |
|
|
|
|
import { mapActions } from 'vuex' |
|
|
|
|
import mList from './_source/list' |
|
|
|
|
import mSpin from '@/module/components/spin/spin' |
|
|
|
|
import mNoData from '@/module/components/noData/noData' |
|
|
|
|
import mCreateDataSource from './_source/createDataSource' |
|
|
|
|
import listUrlParamHandle from '@/module/mixin/listUrlParamHandle' |
|
|
|
|
import mConditions from '@/module/components/conditions/conditions' |
|
|
|
|
import mListConstruction from '@/module/components/listConstruction/listConstruction' |
|
|
|
|
|
|
|
|
@ -37,18 +39,21 @@
|
|
|
|
|
return { |
|
|
|
|
// loading |
|
|
|
|
isLoading: true, |
|
|
|
|
// Number of pages per page |
|
|
|
|
pageSize: 10, |
|
|
|
|
// Number of pages |
|
|
|
|
pageNo: 1, |
|
|
|
|
// Total number of articles |
|
|
|
|
total: 20, |
|
|
|
|
// Search value |
|
|
|
|
searchVal: '', |
|
|
|
|
// data sources(List) |
|
|
|
|
datasourcesList: [] |
|
|
|
|
datasourcesList: [], |
|
|
|
|
searchParams: { |
|
|
|
|
// Number of pages per page |
|
|
|
|
pageSize: 10, |
|
|
|
|
// Number of pages |
|
|
|
|
pageNo: 1, |
|
|
|
|
// Search value |
|
|
|
|
searchVal: '' |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
mixins: [listUrlParamHandle], |
|
|
|
|
props: {}, |
|
|
|
|
methods: { |
|
|
|
|
...mapActions('datasource', ['getDatasourcesListP']), |
|
|
|
@ -67,7 +72,7 @@
|
|
|
|
|
return h(mCreateDataSource, { |
|
|
|
|
on: { |
|
|
|
|
onUpdate () { |
|
|
|
|
self._getDatasourcesListP('false') |
|
|
|
|
self._debounceGET('false') |
|
|
|
|
modal.remove() |
|
|
|
|
}, |
|
|
|
|
close () { |
|
|
|
@ -85,27 +90,22 @@
|
|
|
|
|
* page |
|
|
|
|
*/ |
|
|
|
|
_page (val) { |
|
|
|
|
this.pageNo = val |
|
|
|
|
this._getDatasourcesListP() |
|
|
|
|
this.searchParams.pageNo = val |
|
|
|
|
}, |
|
|
|
|
/** |
|
|
|
|
* conditions event |
|
|
|
|
*/ |
|
|
|
|
_onConditions (o) { |
|
|
|
|
this.searchVal = o.searchVal |
|
|
|
|
this.pageNo = 1 |
|
|
|
|
this._getDatasourcesListP('false') |
|
|
|
|
this.searchParams = _.assign(this.searchParams, o) |
|
|
|
|
this.searchParams.pageNo = 1 |
|
|
|
|
}, |
|
|
|
|
/** |
|
|
|
|
* get data(List) |
|
|
|
|
*/ |
|
|
|
|
_getDatasourcesListP (flag) { |
|
|
|
|
_getList (flag) { |
|
|
|
|
this.isLoading = !flag |
|
|
|
|
this.getDatasourcesListP({ |
|
|
|
|
pageSize: this.pageSize, |
|
|
|
|
pageNo: this.pageNo, |
|
|
|
|
searchVal: this.searchVal |
|
|
|
|
}).then(res => { |
|
|
|
|
this.getDatasourcesListP(this.searchParams).then(res => { |
|
|
|
|
this.datasourcesList = [] |
|
|
|
|
this.datasourcesList = res.totalList |
|
|
|
|
this.total = res.total |
|
|
|
|
this.isLoading = false |
|
|
|
@ -114,9 +114,14 @@
|
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
watch: {}, |
|
|
|
|
watch: { |
|
|
|
|
// router |
|
|
|
|
'$route' (a) { |
|
|
|
|
// url no params get instance list |
|
|
|
|
this.searchParams.pageNo = _.isEmpty(a.query) ? 1 : a.query.pageNo |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
created () { |
|
|
|
|
this._getDatasourcesListP() |
|
|
|
|
}, |
|
|
|
|
mounted () { |
|
|
|
|
}, |
|
|
|
|