提交 6dc8a4d3 编写于 作者: G gongzijian

解决分页url带参数问题/创建用户增加队列

上级 4d9d72fe
# 后端接口地址 # 后端接口地址
API_BASE = http://192.168.220.154:12345 API_BASE = http://192.168.220.247:12345
# 本地开发如需ip访问项目把"#"号去掉 # 本地开发如需ip访问项目把"#"号去掉
#DEV_HOST = 192.168.xx.xx #DEV_HOST = 192.168.xx.xx
...@@ -9,9 +9,9 @@ ...@@ -9,9 +9,9 @@
</template> </template>
<template slot="content"> <template slot="content">
<template v-if="datasourcesList.length"> <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"> <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> </div>
</template> </template>
<template v-if="!datasourcesList.length"> <template v-if="!datasourcesList.length">
...@@ -23,11 +23,13 @@ ...@@ -23,11 +23,13 @@
</m-list-construction> </m-list-construction>
</template> </template>
<script> <script>
import _ from 'lodash'
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import mList from './_source/list' import mList from './_source/list'
import mSpin from '@/module/components/spin/spin' import mSpin from '@/module/components/spin/spin'
import mNoData from '@/module/components/noData/noData' import mNoData from '@/module/components/noData/noData'
import mCreateDataSource from './_source/createDataSource' import mCreateDataSource from './_source/createDataSource'
import listUrlParamHandle from '@/module/mixin/listUrlParamHandle'
import mConditions from '@/module/components/conditions/conditions' import mConditions from '@/module/components/conditions/conditions'
import mListConstruction from '@/module/components/listConstruction/listConstruction' import mListConstruction from '@/module/components/listConstruction/listConstruction'
...@@ -37,18 +39,21 @@ ...@@ -37,18 +39,21 @@
return { return {
// loading // loading
isLoading: true, isLoading: true,
// Number of pages per page
pageSize: 10,
// Number of pages
pageNo: 1,
// Total number of articles // Total number of articles
total: 20, total: 20,
// Search value
searchVal: '',
// data sources(List) // data sources(List)
datasourcesList: [] datasourcesList: [],
searchParams: {
// Number of pages per page
pageSize: 10,
// Number of pages
pageNo: 1,
// Search value
searchVal: ''
}
} }
}, },
mixins: [listUrlParamHandle],
props: {}, props: {},
methods: { methods: {
...mapActions('datasource', ['getDatasourcesListP']), ...mapActions('datasource', ['getDatasourcesListP']),
...@@ -67,7 +72,7 @@ ...@@ -67,7 +72,7 @@
return h(mCreateDataSource, { return h(mCreateDataSource, {
on: { on: {
onUpdate () { onUpdate () {
self._getDatasourcesListP('false') self._debounceGET('false')
modal.remove() modal.remove()
}, },
close () { close () {
...@@ -85,27 +90,22 @@ ...@@ -85,27 +90,22 @@
* page * page
*/ */
_page (val) { _page (val) {
this.pageNo = val this.searchParams.pageNo = val
this._getDatasourcesListP()
}, },
/** /**
* conditions event * conditions event
*/ */
_onConditions (o) { _onConditions (o) {
this.searchVal = o.searchVal this.searchParams = _.assign(this.searchParams, o)
this.pageNo = 1 this.searchParams.pageNo = 1
this._getDatasourcesListP('false')
}, },
/** /**
* get data(List) * get data(List)
*/ */
_getDatasourcesListP (flag) { _getList (flag) {
this.isLoading = !flag this.isLoading = !flag
this.getDatasourcesListP({ this.getDatasourcesListP(this.searchParams).then(res => {
pageSize: this.pageSize, this.datasourcesList = []
pageNo: this.pageNo,
searchVal: this.searchVal
}).then(res => {
this.datasourcesList = res.totalList this.datasourcesList = res.totalList
this.total = res.total this.total = res.total
this.isLoading = false this.isLoading = false
...@@ -114,9 +114,14 @@ ...@@ -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 () { created () {
this._getDatasourcesListP()
}, },
mounted () { mounted () {
}, },
......
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
import store from '@/conf/home/store' import store from '@/conf/home/store'
import mConditions from './_source/conditions' import mConditions from './_source/conditions'
import mSpin from '@/module/components/spin/spin' import mSpin from '@/module/components/spin/spin'
import { setUrlParams } from '@/module/util/routerUtil'
import mNoData from '@/module/components/noData/noData' import mNoData from '@/module/components/noData/noData'
import listUrlParamHandle from '@/module/mixin/listUrlParamHandle' import listUrlParamHandle from '@/module/mixin/listUrlParamHandle'
import mSecondaryMenu from '@/module/components/secondaryMenu/secondaryMenu' import mSecondaryMenu from '@/module/components/secondaryMenu/secondaryMenu'
...@@ -61,13 +60,10 @@ ...@@ -61,13 +60,10 @@
methods: { methods: {
_onQuery (o) { _onQuery (o) {
this.searchParams = _.assign(this.searchParams, o) this.searchParams = _.assign(this.searchParams, o)
setUrlParams(this.searchParams) this.searchParams.pageNo = 1
this._debounceGET()
}, },
_page (val) { _page (val) {
this.searchParams.pageNo = val this.searchParams.pageNo = val
setUrlParams(this.searchParams)
this._debounceGET()
}, },
/** /**
* get list data * get list data
......
...@@ -30,7 +30,6 @@ ...@@ -30,7 +30,6 @@
import mList from './_source/list' import mList from './_source/list'
import mSpin from '@/module/components/spin/spin' import mSpin from '@/module/components/spin/spin'
import localStore from '@/module/util/localStorage' import localStore from '@/module/util/localStorage'
import { setUrlParams } from '@/module/util/routerUtil'
import mNoData from '@/module/components/noData/noData' import mNoData from '@/module/components/noData/noData'
import listUrlParamHandle from '@/module/mixin/listUrlParamHandle' import listUrlParamHandle from '@/module/mixin/listUrlParamHandle'
import mConditions from '@/module/components/conditions/conditions' import mConditions from '@/module/components/conditions/conditions'
...@@ -62,8 +61,6 @@ ...@@ -62,8 +61,6 @@
*/ */
_page (val) { _page (val) {
this.searchParams.pageNo = val this.searchParams.pageNo = val
setUrlParams(this.searchParams)
this._debounceGET()
}, },
/** /**
* conditions * conditions
...@@ -71,8 +68,6 @@ ...@@ -71,8 +68,6 @@
_onConditions (o) { _onConditions (o) {
this.searchParams.searchVal = o.searchVal this.searchParams.searchVal = o.searchVal
this.searchParams.pageNo = 1 this.searchParams.pageNo = 1
setUrlParams(this.searchParams)
this._debounceGET()
}, },
/** /**
* get data list * get data list
......
...@@ -162,3 +162,6 @@ ...@@ -162,3 +162,6 @@
components: { mList, mInstanceConditions, mSpin, mListConstruction, mSecondaryMenu, mNoData } components: { mList, mInstanceConditions, mSpin, mListConstruction, mSecondaryMenu, mNoData }
} }
</script> </script>
<style lang="scss" rel="stylesheet/scss">
</style>
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
import mSpin from '@/module/components/spin/spin' import mSpin from '@/module/components/spin/spin'
import mCreateProject from './_source/createProject' import mCreateProject from './_source/createProject'
import mNoData from '@/module/components/noData/noData' import mNoData from '@/module/components/noData/noData'
import { setUrlParams } from '@/module/util/routerUtil'
import listUrlParamHandle from '@/module/mixin/listUrlParamHandle' import listUrlParamHandle from '@/module/mixin/listUrlParamHandle'
import mConditions from '@/module/components/conditions/conditions' import mConditions from '@/module/components/conditions/conditions'
import mListConstruction from '@/module/components/listConstruction/listConstruction' import mListConstruction from '@/module/components/listConstruction/listConstruction'
...@@ -57,8 +56,11 @@ ...@@ -57,8 +56,11 @@
*/ */
_onConditions (o) { _onConditions (o) {
this.searchParams = _.assign(this.searchParams, o) this.searchParams = _.assign(this.searchParams, o)
setUrlParams(this.searchParams) this.searchParams.pageNo = 1
this._debounceGET() },
_page (val) {
this.searchParams.pageNo = val
}, },
_create (item) { _create (item) {
let self = this let self = this
...@@ -86,11 +88,6 @@ ...@@ -86,11 +88,6 @@
_onUpdate () { _onUpdate () {
this._debounceGET() this._debounceGET()
}, },
_page (val) {
this.searchParams.pageNo = val
setUrlParams(this.searchParams)
this._debounceGET()
},
_getList (flag) { _getList (flag) {
this.isLoading = !flag this.isLoading = !flag
this.getProjectsList(this.searchParams).then(res => { this.getProjectsList(this.searchParams).then(res => {
......
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import mList from './_source/list' import mList from './_source/list'
import mSpin from '@/module/components/spin/spin' import mSpin from '@/module/components/spin/spin'
import { setUrlParams } from '@/module/util/routerUtil'
import mNoData from '@/module/components/noData/noData' import mNoData from '@/module/components/noData/noData'
import listUrlParamHandle from '@/module/mixin/listUrlParamHandle' import listUrlParamHandle from '@/module/mixin/listUrlParamHandle'
import mSecondaryMenu from '@/module/components/secondaryMenu/secondaryMenu' import mSecondaryMenu from '@/module/components/secondaryMenu/secondaryMenu'
...@@ -72,13 +71,10 @@ ...@@ -72,13 +71,10 @@
if (this.searchParams.taskName) { if (this.searchParams.taskName) {
this.searchParams.taskName = '' this.searchParams.taskName = ''
} }
setUrlParams(this.searchParams) this.searchParams.pageNo = 1
this._debounceGET()
}, },
_page (val) { _page (val) {
this.searchParams.pageNo = val this.searchParams.pageNo = val
setUrlParams(this.searchParams)
this._debounceGET()
}, },
/** /**
* get list data * get list data
......
...@@ -36,7 +36,6 @@ ...@@ -36,7 +36,6 @@
import mSpin from '@/module/components/spin/spin' import mSpin from '@/module/components/spin/spin'
import { findComponentDownward } from '@/module/util/' import { findComponentDownward } from '@/module/util/'
import mNoData from '@/module/components/noData/noData' import mNoData from '@/module/components/noData/noData'
import { setUrlParams } from '@/module/util/routerUtil'
import listUrlParamHandle from '@/module/mixin/listUrlParamHandle' import listUrlParamHandle from '@/module/mixin/listUrlParamHandle'
import mConditions from '@/module/components/conditions/conditions' import mConditions from '@/module/components/conditions/conditions'
import mSecondaryMenu from '@/module/components/secondaryMenu/secondaryMenu' import mSecondaryMenu from '@/module/components/secondaryMenu/secondaryMenu'
...@@ -70,17 +69,12 @@ ...@@ -70,17 +69,12 @@
_onConditions (o) { _onConditions (o) {
this.searchParams = _.assign(this.searchParams, o) this.searchParams = _.assign(this.searchParams, o)
this.searchParams.pageNo = 1 this.searchParams.pageNo = 1
setUrlParams(this.searchParams)
this._debounceGET()
}, },
_page (val) { _page (val) {
this.searchParams.pageNo = val this.searchParams.pageNo = val
setUrlParams(this.searchParams)
this._debounceGET()
}, },
_getList (flag) { _getList (flag) {
this.isLoading = !flag this.isLoading = !flag
this.fileResourcesList = []
this.getResourcesListP(this.searchParams).then(res => { this.getResourcesListP(this.searchParams).then(res => {
this.fileResourcesList = res.totalList this.fileResourcesList = res.totalList
this.total = res.total this.total = res.total
...@@ -92,7 +86,6 @@ ...@@ -92,7 +86,6 @@
_updateList () { _updateList () {
this.searchParams.pageNo = 1 this.searchParams.pageNo = 1
this.searchParams.searchVal = '' this.searchParams.searchVal = ''
setUrlParams(this.searchParams)
this._debounceGET() this._debounceGET()
} }
}, },
......
...@@ -33,7 +33,6 @@ ...@@ -33,7 +33,6 @@
import mCreateUdf from './_source/createUdf' import mCreateUdf from './_source/createUdf'
import mSpin from '@/module/components/spin/spin' import mSpin from '@/module/components/spin/spin'
import mNoData from '@/module/components/noData/noData' import mNoData from '@/module/components/noData/noData'
import { setUrlParams } from '@/module/util/routerUtil'
import listUrlParamHandle from '@/module/mixin/listUrlParamHandle' import listUrlParamHandle from '@/module/mixin/listUrlParamHandle'
import mConditions from '@/module/components/conditions/conditions' import mConditions from '@/module/components/conditions/conditions'
import mSecondaryMenu from '@/module/components/secondaryMenu/secondaryMenu' import mSecondaryMenu from '@/module/components/secondaryMenu/secondaryMenu'
...@@ -60,13 +59,9 @@ ...@@ -60,13 +59,9 @@
_onConditions (o) { _onConditions (o) {
this.searchParams = _.assign(this.searchParams, o) this.searchParams = _.assign(this.searchParams, o)
this.searchParams.pageNo = 1 this.searchParams.pageNo = 1
setUrlParams(this.searchParams)
this._debounceGET()
}, },
_page (val) { _page (val) {
this.searchParams.pageNo = val this.searchParams.pageNo = val
setUrlParams(this.searchParams)
this._debounceGET()
}, },
_create () { _create () {
let self = this let self = this
...@@ -96,13 +91,12 @@ ...@@ -96,13 +91,12 @@
_updateList () { _updateList () {
this.searchParams.pageNo = 1 this.searchParams.pageNo = 1
this.searchParams.searchVal = '' this.searchParams.searchVal = ''
setUrlParams(this.searchParams)
this._debounceGET() this._debounceGET()
}, },
_getList (flag) { _getList (flag) {
this.isLoading = !flag this.isLoading = !flag
this.udfFuncList = []
this.getUdfFuncListP(this.searchParams).then(res => { this.getUdfFuncListP(this.searchParams).then(res => {
this.udfFuncList = []
this.udfFuncList = res.totalList this.udfFuncList = res.totalList
this.total = res.total this.total = res.total
this.isLoading = false this.isLoading = false
......
...@@ -33,7 +33,6 @@ ...@@ -33,7 +33,6 @@
import mSpin from '@/module/components/spin/spin' import mSpin from '@/module/components/spin/spin'
import { findComponentDownward } from '@/module/util/' import { findComponentDownward } from '@/module/util/'
import mNoData from '@/module/components/noData/noData' import mNoData from '@/module/components/noData/noData'
import { setUrlParams } from '@/module/util/routerUtil'
import listUrlParamHandle from '@/module/mixin/listUrlParamHandle' import listUrlParamHandle from '@/module/mixin/listUrlParamHandle'
import mConditions from '@/module/components/conditions/conditions' import mConditions from '@/module/components/conditions/conditions'
import mSecondaryMenu from '@/module/components/secondaryMenu/secondaryMenu' import mSecondaryMenu from '@/module/components/secondaryMenu/secondaryMenu'
...@@ -67,24 +66,19 @@ ...@@ -67,24 +66,19 @@
_onConditions (o) { _onConditions (o) {
this.searchParams = _.assign(this.searchParams, o) this.searchParams = _.assign(this.searchParams, o)
this.searchParams.pageNo = 1 this.searchParams.pageNo = 1
setUrlParams(this.searchParams)
this._debounceGET()
}, },
_page (val) { _page (val) {
this.searchParams.pageNo = val this.searchParams.pageNo = val
setUrlParams(this.searchParams)
this._debounceGET()
}, },
_updateList () { _updateList () {
this.searchParams.pageNo = 1 this.searchParams.pageNo = 1
this.searchParams.searchVal = '' this.searchParams.searchVal = ''
setUrlParams(this.searchParams)
this._debounceGET() this._debounceGET()
}, },
_getList (flag) { _getList (flag) {
this.isLoading = !flag this.isLoading = !flag
this.udfResourcesList = []
this.getResourcesListP(this.searchParams).then(res => { this.getResourcesListP(this.searchParams).then(res => {
this.udfResourcesList = []
this.udfResourcesList = res.totalList this.udfResourcesList = res.totalList
this.total = res.total this.total = res.total
this.isLoading = false this.isLoading = false
......
...@@ -12,9 +12,9 @@ ...@@ -12,9 +12,9 @@
</template> </template>
<template slot="content"> <template slot="content">
<template v-if="queueList.length"> <template v-if="queueList.length">
<m-list :queue-list="queueList" :page-no="pageNo" :page-size="pageSize"></m-list> <m-list :queue-list="queueList" :page-no="searchParams.pageNo" :page-size="searchParams.pageSize"></m-list>
<div class="page-box"> <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> </div>
</template> </template>
<template v-if="!queueList.length"> <template v-if="!queueList.length">
...@@ -27,11 +27,13 @@ ...@@ -27,11 +27,13 @@
</div> </div>
</template> </template>
<script> <script>
import _ from 'lodash'
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import mList from './_source/list' import mList from './_source/list'
import mSpin from '@/module/components/spin/spin' import mSpin from '@/module/components/spin/spin'
import mCreateQueue from './_source/createQueue' import mCreateQueue from './_source/createQueue'
import mNoData from '@/module/components/noData/noData' import mNoData from '@/module/components/noData/noData'
import listUrlParamHandle from '@/module/mixin/listUrlParamHandle'
import mConditions from '@/module/components/conditions/conditions' import mConditions from '@/module/components/conditions/conditions'
import mSecondaryMenu from '@/module/components/secondaryMenu/secondaryMenu' import mSecondaryMenu from '@/module/components/secondaryMenu/secondaryMenu'
import mListConstruction from '@/module/components/listConstruction/listConstruction' import mListConstruction from '@/module/components/listConstruction/listConstruction'
...@@ -40,14 +42,17 @@ ...@@ -40,14 +42,17 @@
name: 'queue-index', name: 'queue-index',
data () { data () {
return { return {
pageSize: 10,
pageNo: 1,
total: null, total: null,
searchVal: '',
isLoading: true, isLoading: true,
queueList: [] queueList: [],
searchParams: {
pageSize: 10,
pageNo: 1,
searchVal: ''
}
} }
}, },
mixins: [listUrlParamHandle],
props: {}, props: {},
methods: { methods: {
...mapActions('security', ['getQueueListP']), ...mapActions('security', ['getQueueListP']),
...@@ -55,13 +60,11 @@ ...@@ -55,13 +60,11 @@
* Query * Query
*/ */
_onConditions (o) { _onConditions (o) {
this.searchVal = o.searchVal this.searchParams = _.assign(this.searchParams, o)
this.pageNo = 1 this.searchParams.pageNo = 1
this._getQueueListP()
}, },
_page (val) { _page (val) {
this.pageNo = val this.searchParams.pageNo = val
this._getQueueListP()
}, },
_create (item) { _create (item) {
let self = this let self = this
...@@ -75,7 +78,7 @@ ...@@ -75,7 +78,7 @@
return h(mCreateQueue, { return h(mCreateQueue, {
on: { on: {
onUpdate () { onUpdate () {
self._getQueueListP('false') self._debounceGET('false')
modal.remove() modal.remove()
}, },
close () { close () {
...@@ -89,13 +92,10 @@ ...@@ -89,13 +92,10 @@
} }
}) })
}, },
_getQueueListP (flag) { _getList (flag) {
this.isLoading = !flag this.isLoading = !flag
this.getQueueListP({ this.getQueueListP(this.searchParams).then(res => {
pageSize: this.pageSize, this.queueList = []
pageNo: this.pageNo,
searchVal: this.searchVal
}).then(res => {
this.queueList = res.totalList this.queueList = res.totalList
this.total = res.total this.total = res.total
this.isLoading = false this.isLoading = false
...@@ -104,9 +104,14 @@ ...@@ -104,9 +104,14 @@
}) })
} }
}, },
watch: {}, watch: {
// router
'$route' (a) {
// url no params get instance list
this.searchParams.pageNo = _.isEmpty(a.query) ? 1 : a.query.pageNo
}
},
created () { created () {
this._getQueueListP()
}, },
mounted () { mounted () {
......
...@@ -157,19 +157,19 @@ ...@@ -157,19 +157,19 @@
watch: { watch: {
}, },
created () { created () {
},
mounted () {
this._getQueueList().then(res => { this._getQueueList().then(res => {
if (this.item) { if (this.item) {
this.$nextTick(() => { this.$nextTick(() => {
this.queueId = _.filter(this.queueList, v => v.id === this.item.queueId)[0] this.queueId = _.find(this.queueList, ['id', this.item.queueId])
}) })
this.tenantCode = this.item.tenantCode this.tenantCode = this.item.tenantCode
this.tenantName = this.item.tenantName this.tenantName = this.item.tenantName
this.desc = this.item.desc this.desc = this.item.desc
} }
}) })
},
mounted () {
}, },
components: { mPopup, mListBoxF } components: { mPopup, mListBoxF }
} }
......
...@@ -12,9 +12,9 @@ ...@@ -12,9 +12,9 @@
</template> </template>
<template slot="content"> <template slot="content">
<template v-if="tenementList.length"> <template v-if="tenementList.length">
<m-list :tenement-list="tenementList" :page-no="pageNo" :page-size="pageSize"></m-list> <m-list :tenement-list="tenementList" :page-no="searchParams.pageNo" :page-size="searchParams.pageSize"></m-list>
<div class="page-box"> <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> </div>
</template> </template>
<template v-if="!tenementList.length"> <template v-if="!tenementList.length">
...@@ -27,11 +27,13 @@ ...@@ -27,11 +27,13 @@
</div> </div>
</template> </template>
<script> <script>
import _ from 'lodash'
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import mList from './_source/list' import mList from './_source/list'
import mSpin from '@/module/components/spin/spin' import mSpin from '@/module/components/spin/spin'
import mCreateTenement from './_source/createTenement' import mCreateTenement from './_source/createTenement'
import mNoData from '@/module/components/noData/noData' import mNoData from '@/module/components/noData/noData'
import listUrlParamHandle from '@/module/mixin/listUrlParamHandle'
import mConditions from '@/module/components/conditions/conditions' import mConditions from '@/module/components/conditions/conditions'
import mSecondaryMenu from '@/module/components/secondaryMenu/secondaryMenu' import mSecondaryMenu from '@/module/components/secondaryMenu/secondaryMenu'
import mListConstruction from '@/module/components/listConstruction/listConstruction' import mListConstruction from '@/module/components/listConstruction/listConstruction'
...@@ -40,14 +42,17 @@ ...@@ -40,14 +42,17 @@
name: 'tenement-index', name: 'tenement-index',
data () { data () {
return { return {
pageSize: 10,
pageNo: 1,
total: null, total: null,
searchVal: '',
isLoading: true, isLoading: true,
tenementList: [] tenementList: [],
searchParams: {
pageSize: 10,
pageNo: 1,
searchVal: ''
}
} }
}, },
mixins: [listUrlParamHandle],
props: {}, props: {},
methods: { methods: {
...mapActions('security', ['getTenantListP']), ...mapActions('security', ['getTenantListP']),
...@@ -55,13 +60,11 @@ ...@@ -55,13 +60,11 @@
* Query * Query
*/ */
_onConditions (o) { _onConditions (o) {
this.searchVal = o.searchVal this.searchParams = _.assign(this.searchParams, o)
this.pageNo = 1 this.searchParams.pageNo = 1
this._getTenantListP()
}, },
_page (val) { _page (val) {
this.pageNo = val this.searchParams.pageNo = val
this._getTenantListP()
}, },
_create (item) { _create (item) {
let self = this let self = this
...@@ -75,7 +78,7 @@ ...@@ -75,7 +78,7 @@
return h(mCreateTenement, { return h(mCreateTenement, {
on: { on: {
onUpdate () { onUpdate () {
self._getTenantListP('false') self._debounceGET('false')
modal.remove() modal.remove()
}, },
close () { close () {
...@@ -89,13 +92,10 @@ ...@@ -89,13 +92,10 @@
} }
}) })
}, },
_getTenantListP (flag) { _getList (flag) {
this.isLoading = !flag this.isLoading = !flag
this.getTenantListP({ this.getTenantListP(this.searchParams).then(res => {
pageSize: this.pageSize, this.tenementList = []
pageNo: this.pageNo,
searchVal: this.searchVal
}).then(res => {
this.tenementList = res.totalList this.tenementList = res.totalList
this.total = res.total this.total = res.total
this.isLoading = false this.isLoading = false
...@@ -104,12 +104,16 @@ ...@@ -104,12 +104,16 @@
}) })
} }
}, },
watch: {}, watch: {
// router
'$route' (a) {
// url no params get instance list
this.searchParams.pageNo = _.isEmpty(a.query) ? 1 : a.query.pageNo
}
},
created () { created () {
this._getTenantListP()
}, },
mounted () { mounted () {
}, },
components: { mSecondaryMenu, mList, mListConstruction, mConditions, mSpin, mNoData } components: { mSecondaryMenu, mList, mListConstruction, mConditions, mSpin, mNoData }
} }
......
...@@ -39,6 +39,19 @@ ...@@ -39,6 +39,19 @@
</x-select> </x-select>
</template> </template>
</m-list-box-f> </m-list-box-f>
<m-list-box-f>
<template slot="name"><b>*</b>{{$t('Queue')}}</template>
<template slot="content">
<x-select v-model="queueName">
<x-option
v-for="city in queueList"
:key="city.id"
:value="city"
:label="city.code">
</x-option>
</x-select>
</template>
</m-list-box-f>
<m-list-box-f> <m-list-box-f>
<template slot="name"><b>*</b>{{$t('Email')}}</template> <template slot="name"><b>*</b>{{$t('Email')}}</template>
<template slot="content"> <template slot="content">
...@@ -77,9 +90,11 @@ ...@@ -77,9 +90,11 @@
return { return {
store, store,
router, router,
queueList: [],
userName: '', userName: '',
userPassword: '', userPassword: '',
tenantId: {}, tenantId: {},
queueName: {},
email: '', email: '',
phone: '', phone: '',
tenantList: [], tenantList: [],
...@@ -144,6 +159,22 @@ ...@@ -144,6 +159,22 @@
return true return true
}, },
_getQueueList () {
return new Promise((resolve, reject) => {
this.store.dispatch('security/getQueueList').then(res => {
this.queueList = _.map(res, v => {
return {
id: v.id,
code: v.queueName
}
})
this.$nextTick(() => {
this.queueName = this.queueList[0]
})
resolve()
})
})
},
_getTenantList () { _getTenantList () {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
this.store.dispatch('security/getTenantList').then(res => { this.store.dispatch('security/getTenantList').then(res => {
...@@ -167,6 +198,7 @@ ...@@ -167,6 +198,7 @@
userPassword: this.userPassword, userPassword: this.userPassword,
tenantId: this.tenantId.id, tenantId: this.tenantId.id,
email: this.email, email: this.email,
queue: this.queueName.code,
phone: this.phone phone: this.phone
} }
if (this.item) { if (this.item) {
...@@ -188,13 +220,16 @@ ...@@ -188,13 +220,16 @@
created () { created () {
// Administrator gets tenant list // Administrator gets tenant list
if (this.isADMIN) { if (this.isADMIN) {
this._getTenantList().then(res => { Promise.all([this._getQueueList(), this._getTenantList()]).then(() => {
if (this.item) { if (this.item) {
this.userName = this.item.userName this.userName = this.item.userName
this.userPassword = '' this.userPassword = ''
this.email = this.item.email this.email = this.item.email
this.phone = this.item.phone this.phone = this.item.phone
this.tenantId = _.filter(this.tenantList, v => v.id === this.item.tenantId)[0] this.tenantId = _.find(this.tenantList, ['id', this.item.tenantId])
this.$nextTick(() => {
this.queueName = _.find(this.queueList, ['code', this.item.queue])
})
} }
}) })
} else { } else {
...@@ -204,10 +239,12 @@ ...@@ -204,10 +239,12 @@
this.email = this.item.email this.email = this.item.email
this.phone = this.item.phone this.phone = this.item.phone
this.tenantId.id = this.item.tenantId this.tenantId.id = this.item.tenantId
this.queueName = { queue: this.item.queue }
} }
} }
}, },
mounted () { mounted () {
}, },
components: { mPopup, mListBoxF } components: { mPopup, mListBoxF }
} }
......
...@@ -12,6 +12,9 @@ ...@@ -12,6 +12,9 @@
<th> <th>
<span>{{$t('Tenant')}}</span> <span>{{$t('Tenant')}}</span>
</th> </th>
<th>
<span>{{$t('Queue')}}</span>
</th>
<th> <th>
<span>{{$t('Email')}}</span> <span>{{$t('Email')}}</span>
</th> </th>
...@@ -38,6 +41,7 @@ ...@@ -38,6 +41,7 @@
</span> </span>
</td> </td>
<td><span>{{item.tenantName || '-'}}</span></td> <td><span>{{item.tenantName || '-'}}</span></td>
<td><span>{{item.queue || '-'}}</span></td>
<td> <td>
<span>{{item.email || '-'}}</span> <span>{{item.email || '-'}}</span>
</td> </td>
......
...@@ -12,9 +12,9 @@ ...@@ -12,9 +12,9 @@
</template> </template>
<template slot="content"> <template slot="content">
<template v-if="userList.length"> <template v-if="userList.length">
<m-list :user-list="userList" :page-no="pageNo" :page-size="pageSize"></m-list> <m-list :user-list="userList" :page-no="searchParams.pageNo" :page-size="searchParams.pageSize"></m-list>
<div class="page-box"> <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> </div>
</template> </template>
<template v-if="!userList.length"> <template v-if="!userList.length">
...@@ -27,11 +27,13 @@ ...@@ -27,11 +27,13 @@
</div> </div>
</template> </template>
<script> <script>
import _ from 'lodash'
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import mList from './_source/list' import mList from './_source/list'
import mCreateUser from './_source/createUser' import mCreateUser from './_source/createUser'
import mSpin from '@/module/components/spin/spin' import mSpin from '@/module/components/spin/spin'
import mNoData from '@/module/components/noData/noData' import mNoData from '@/module/components/noData/noData'
import listUrlParamHandle from '@/module/mixin/listUrlParamHandle'
import mConditions from '@/module/components/conditions/conditions' import mConditions from '@/module/components/conditions/conditions'
import mSecondaryMenu from '@/module/components/secondaryMenu/secondaryMenu' import mSecondaryMenu from '@/module/components/secondaryMenu/secondaryMenu'
import mListConstruction from '@/module/components/listConstruction/listConstruction' import mListConstruction from '@/module/components/listConstruction/listConstruction'
...@@ -40,14 +42,17 @@ ...@@ -40,14 +42,17 @@
name: 'users-index', name: 'users-index',
data () { data () {
return { return {
pageSize: 10,
pageNo: 1,
total: null, total: null,
searchVal: '',
isLoading: true, isLoading: true,
userList: [] userList: [],
searchParams: {
pageSize: 10,
pageNo: 1,
searchVal: ''
}
} }
}, },
mixins: [listUrlParamHandle],
props: {}, props: {},
methods: { methods: {
...mapActions('security', ['getUsersList']), ...mapActions('security', ['getUsersList']),
...@@ -55,13 +60,11 @@ ...@@ -55,13 +60,11 @@
* Query * Query
*/ */
_onConditions (o) { _onConditions (o) {
this.searchVal = o.searchVal this.searchParams = _.assign(this.searchParams, o)
this.pageNo = 1 this.searchParams.pageNo = 1
this._getUsersListP()
}, },
_page (val) { _page (val) {
this.pageNo = val this.searchParams.pageNo = val
this._getUsersListP()
}, },
_create (item) { _create (item) {
let self = this let self = this
...@@ -75,7 +78,7 @@ ...@@ -75,7 +78,7 @@
return h(mCreateUser, { return h(mCreateUser, {
on: { on: {
onUpdate () { onUpdate () {
self._getUsersListP('false') self._debounceGET('false')
modal.remove() modal.remove()
}, },
close () { close () {
...@@ -89,13 +92,10 @@ ...@@ -89,13 +92,10 @@
} }
}) })
}, },
_getUsersListP (flag) { _getList (flag) {
this.isLoading = !flag this.isLoading = !flag
this.getUsersList({ this.getUsersList(this.searchParams).then(res => {
pageSize: this.pageSize, this.userList = []
pageNo: this.pageNo,
searchVal: this.searchVal
}).then(res => {
this.userList = res.totalList this.userList = res.totalList
this.total = res.total this.total = res.total
this.isLoading = false this.isLoading = false
...@@ -104,9 +104,14 @@ ...@@ -104,9 +104,14 @@
}) })
} }
}, },
watch: {}, watch: {
// router
'$route' (a) {
// url no params get instance list
this.searchParams.pageNo = _.isEmpty(a.query) ? 1 : a.query.pageNo
}
},
created () { created () {
this._getUsersListP()
}, },
mounted () { mounted () {
}, },
......
...@@ -12,10 +12,9 @@ ...@@ -12,10 +12,9 @@
</template> </template>
<template slot="content"> <template slot="content">
<template v-if="alertgroupList.length"> <template v-if="alertgroupList.length">
<m-list :alertgroup-list="alertgroupList" :page-no="pageNo" :page-size="pageSize"></m-list> <m-list :alertgroup-list="alertgroupList" :page-no="searchParams.pageNo" :page-size="searchParams.pageSize"></m-list>
<div class="page-box"> <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> </div>
</template> </template>
<template v-if="!alertgroupList.length"> <template v-if="!alertgroupList.length">
...@@ -28,11 +27,13 @@ ...@@ -28,11 +27,13 @@
</div> </div>
</template> </template>
<script> <script>
import _ from 'lodash'
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import mList from './_source/list' import mList from './_source/list'
import mSpin from '@/module/components/spin/spin' import mSpin from '@/module/components/spin/spin'
import mCreateWarning from './_source/createWarning' import mCreateWarning from './_source/createWarning'
import mNoData from '@/module/components/noData/noData' import mNoData from '@/module/components/noData/noData'
import listUrlParamHandle from '@/module/mixin/listUrlParamHandle'
import mConditions from '@/module/components/conditions/conditions' import mConditions from '@/module/components/conditions/conditions'
import mSecondaryMenu from '@/module/components/secondaryMenu/secondaryMenu' import mSecondaryMenu from '@/module/components/secondaryMenu/secondaryMenu'
import mListConstruction from '@/module/components/listConstruction/listConstruction' import mListConstruction from '@/module/components/listConstruction/listConstruction'
...@@ -41,14 +42,17 @@ ...@@ -41,14 +42,17 @@
name: 'warning-groups-index', name: 'warning-groups-index',
data () { data () {
return { return {
pageSize: 10,
pageNo: 1,
total: null, total: null,
searchVal: '',
isLoading: false, isLoading: false,
alertgroupList: [] alertgroupList: [],
searchParams: {
pageSize: 10,
pageNo: 1,
searchVal: ''
}
} }
}, },
mixins: [listUrlParamHandle],
props: {}, props: {},
methods: { methods: {
...mapActions('security', ['getAlertgroupP']), ...mapActions('security', ['getAlertgroupP']),
...@@ -56,13 +60,11 @@ ...@@ -56,13 +60,11 @@
* Inquire * Inquire
*/ */
_onConditions (o) { _onConditions (o) {
this.searchVal = o.searchVal this.searchParams = _.assign(this.searchParams, o)
this.pageNo = 1 this.searchParams.pageNo = 1
this._getAlertgroupP()
}, },
_page (val) { _page (val) {
this.pageNo = val this.searchParams.pageNo = val
this._getAlertgroupP()
}, },
_create (item) { _create (item) {
let self = this let self = this
...@@ -76,7 +78,7 @@ ...@@ -76,7 +78,7 @@
return h(mCreateWarning, { return h(mCreateWarning, {
on: { on: {
onUpdate () { onUpdate () {
self._getAlertgroupP('false') self._debounceGET('false')
modal.remove() modal.remove()
}, },
close () { close () {
...@@ -90,13 +92,10 @@ ...@@ -90,13 +92,10 @@
} }
}) })
}, },
_getAlertgroupP (flag) { _getList (flag) {
this.isLoading = !flag this.isLoading = !flag
this.getAlertgroupP({ this.getAlertgroupP(this.searchParams).then(res => {
pageSize: this.pageSize, this.alertgroupList = []
pageNo: this.pageNo,
searchVal: this.searchVal
}).then(res => {
this.alertgroupList = res.totalList this.alertgroupList = res.totalList
this.total = res.total this.total = res.total
this.isLoading = false this.isLoading = false
...@@ -105,9 +104,14 @@ ...@@ -105,9 +104,14 @@
}) })
} }
}, },
watch: {}, watch: {
// router
'$route' (a) {
// url no params get instance list
this.searchParams.pageNo = _.isEmpty(a.query) ? 1 : a.query.pageNo
}
},
created () { created () {
this._getAlertgroupP()
}, },
mounted () { mounted () {
}, },
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import _ from 'lodash' import _ from 'lodash'
import { setUrlParams } from '@/module/util/routerUtil'
/** /**
* Mainly used for data list paging url param handle * Mainly used for data list paging url param handle
* @param _getList => api function(required) * @param _getList => api function(required)
...@@ -22,9 +23,10 @@ import _ from 'lodash' ...@@ -22,9 +23,10 @@ import _ from 'lodash'
export default { export default {
watch: { watch: {
// watch pageNo // watch pageNo
'searchParams.pageNo': { 'searchParams': {
deep: true, deep: true,
handler () { handler () {
setUrlParams(this.searchParams)
this._debounceGET() this._debounceGET()
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册