Browse Source

Merge pull request #67 from millionfor/dev-20190415

Dev 20190415
pull/2/head
millionfor 5 years ago committed by GitHub
parent
commit
6c1cbef18f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      escheduler-ui/src/js/conf/home/pages/dag/_source/formModel/formModel.vue
  2. 10
      escheduler-ui/src/js/conf/home/pages/datasource/pages/list/_source/createDataSource.vue
  3. 29
      escheduler-ui/src/js/conf/home/pages/projects/pages/_source/taskRecordList/index.vue
  4. 4
      escheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/list/_source/timing.vue
  5. 50
      escheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/list/index.vue
  6. 2
      escheduler-ui/src/js/conf/home/pages/projects/pages/index/_source/projectChart.vue
  7. 29
      escheduler-ui/src/js/conf/home/pages/projects/pages/instance/index.vue
  8. 3
      escheduler-ui/src/js/conf/home/pages/projects/pages/instance/pages/list/index.vue
  9. 58
      escheduler-ui/src/js/conf/home/pages/projects/pages/list/index.vue
  10. 31
      escheduler-ui/src/js/conf/home/pages/projects/pages/taskInstance/index.vue
  11. 62
      escheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/list/index.vue
  12. 57
      escheduler-ui/src/js/conf/home/pages/resource/pages/udf/pages/function/index.vue
  13. 56
      escheduler-ui/src/js/conf/home/pages/resource/pages/udf/pages/resource/index.vue
  14. 2
      escheduler-ui/src/js/conf/home/router/index.js
  15. 4
      escheduler-ui/src/js/module/components/listBoxF/listBoxF.vue
  16. 2
      escheduler-ui/src/js/module/components/popup/popup.vue
  17. 3
      escheduler-ui/src/js/module/i18n/locale/en_US.js
  18. 3
      escheduler-ui/src/js/module/i18n/locale/zh_CN.js
  19. 2
      escheduler-ui/src/js/module/mixin/disabledState.js
  20. 53
      escheduler-ui/src/js/module/mixin/listUrlParamHandle.js

2
escheduler-ui/src/js/conf/home/pages/dag/_source/formModel/formModel.vue

@ -255,7 +255,7 @@
*/ */
_seeHistory () { _seeHistory () {
this.self.$router.push({ this.self.$router.push({
name: 'task-instance-list', name: 'task-instance',
query: { query: {
processInstanceId: this.self.$route.params.id, processInstanceId: this.self.$route.params.id,
taskName: this.backfillItem.name taskName: this.backfillItem.name

10
escheduler-ui/src/js/conf/home/pages/datasource/pages/list/_source/createDataSource.vue

@ -333,8 +333,16 @@
padding: 0 20px; padding: 0 20px;
} }
.content-p { .content-p {
min-width: 500px; min-width: 820px;
min-height: 100px; min-height: 100px;
.list-box-f {
.text {
width: 166px;
}
.cont {
width: calc(100% - 186px);
}
}
} }
} }
</style> </style>

29
escheduler-ui/src/js/conf/home/pages/projects/pages/_source/taskRecordList/index.vue

@ -29,6 +29,7 @@
import mSpin from '@/module/components/spin/spin' import mSpin from '@/module/components/spin/spin'
import { setUrlParams } from '@/module/util/routerUtil' 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 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'
@ -53,6 +54,7 @@
} }
} }
}, },
mixins: [listUrlParamHandle],
props: { props: {
config: String config: String
}, },
@ -83,44 +85,21 @@
}, },
_onUpdate () { _onUpdate () {
this._debounceGET() this._debounceGET()
}, }
/**
* Anti-shake request interface
* @desc Prevent function from being called multiple times
*/
_debounceGET: _.debounce(function (flag) {
this._getList(flag)
}, 100, {
'leading': false,
'trailing': true
})
}, },
watch: { watch: {
// router // router
'$route' (a) { '$route' (a) {
// url no params get instance list // url no params get instance list
if (_.isEmpty(a.query)) { if (_.isEmpty(a.query)) {
this.searchParams.pageNo = 1
this.searchParams.processInstanceId = '' this.searchParams.processInstanceId = ''
} else {
this.searchParams.pageNo = a.query.pageNo || 1
}
},
'searchParams.pageNo': {
deep: true,
handler () {
this._debounceGET()
} }
this.searchParams.pageNo = _.isEmpty(a.query) ? 1 : a.query.pageNo
} }
}, },
created () { created () {
// Routing parameter merging
if (!_.isEmpty(this.$route.query)) {
this.searchParams = _.assign(this.searchParams, this.$route.query)
}
}, },
mounted () { mounted () {
this._debounceGET()
}, },
components: { mList, mConditions, mSpin, mListConstruction, mSecondaryMenu, mNoData } components: { mList, mConditions, mSpin, mListConstruction, mSecondaryMenu, mNoData }
} }

4
escheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/list/_source/timing.vue

@ -198,11 +198,11 @@
if (this.item.crontab) { if (this.item.crontab) {
api = 'dag/updateSchedule' api = 'dag/updateSchedule'
searchParams.id = this.item.id searchParams.id = this.item.id
msg = '编辑成功!不要忘记上线' msg = `${i18n.$t('Edit')}${i18n.$t('success')},${i18n.$t('Please go online')}`
} else { } else {
api = 'dag/createSchedule' api = 'dag/createSchedule'
searchParams.processDefinitionId = this.item.id searchParams.processDefinitionId = this.item.id
msg = '创建成功' msg = `${i18n.$t('Create')}${i18n.$t('success')}`
} }
this.store.dispatch(api, searchParams).then(res => { this.store.dispatch(api, searchParams).then(res => {

50
escheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/list/index.vue

@ -32,6 +32,7 @@
import localStore from '@/module/util/localStorage' import localStore from '@/module/util/localStorage'
import { setUrlParams } from '@/module/util/routerUtil' 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 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'
@ -44,15 +45,14 @@
processListP: [], processListP: [],
isLoading: true, isLoading: true,
searchParams: { searchParams: {
//
pageSize: 10, pageSize: 10,
//
pageNo: 1, pageNo: 1,
// searchVal: '',
searchVal: '' userId: ''
} }
} }
}, },
mixins: [listUrlParamHandle],
props: { props: {
}, },
methods: { methods: {
@ -77,15 +77,9 @@
/** /**
* get data list * get data list
*/ */
_getProcessListP (flag) { _getList (flag) {
this.isLoading = !flag this.isLoading = !flag
this.getProcessListP({ this.getProcessListP(this.searchParams).then(res => {
pageSize: this.searchParams.pageSize,
pageNo: this.searchParams.pageNo,
searchVal: this.searchParams.searchVal,
userId: this.$route.query.userId || ''
}).then(res => {
setUrlParams({ pageNo: this.pageNo })
this.processListP = [] this.processListP = []
this.processListP = res.totalList this.processListP = res.totalList
this.total = res.total this.total = res.total
@ -96,48 +90,20 @@
}, },
_onUpdate () { _onUpdate () {
this._debounceGET('false') this._debounceGET('false')
}, }
/**
* Anti-shake request interface
* @desc Prevent function from being called multiple times
*/
_debounceGET: _.debounce(function (flag) {
this._getProcessListP(flag)
}, 100, {
'leading': false,
'trailing': true
})
}, },
watch: { watch: {
'$route' (a) { '$route' (a) {
// url no params get instance list // url no params get instance list
if (_.isEmpty(a.query)) { this.searchParams.pageNo = _.isEmpty(a.query) ? 1 : a.query.pageNo
this.searchParams.pageNo = 1
} else {
this.searchParams.pageNo = a.query.pageNo || 1
}
},
'searchParams': {
deep: true,
handler () {
this._debounceGET()
}
} }
}, },
created () { created () {
localStore.removeItem('subProcessId') localStore.removeItem('subProcessId')
// Routing parameter merging
if (!_.isEmpty(this.$route.query)) {
this.searchParams = _.assign(this.searchParams, this.$route.query)
}
}, },
mounted () { mounted () {
this._debounceGET()
}, },
components: { mList, mConditions, mSpin, mListConstruction, mSecondaryMenu, mNoData } components: { mList, mConditions, mSpin, mListConstruction, mSecondaryMenu, mNoData }
} }
</script> </script>
<style lang="scss" rel="stylesheet/scss">
</style>

2
escheduler-ui/src/js/conf/home/pages/projects/pages/index/_source/projectChart.vue

@ -122,7 +122,7 @@
}, },
_goTask (name) { _goTask (name) {
this.$router.push({ this.$router.push({
name: 'task-instance-list', name: 'task-instance',
query: { query: {
stateType: _.find(stateType, ['label', name])['code'], stateType: _.find(stateType, ['label', name])['code'],
startDate: this.scheduleTime[0], startDate: this.scheduleTime[0],

29
escheduler-ui/src/js/conf/home/pages/projects/pages/instance/index.vue

@ -3,33 +3,6 @@
</template> </template>
<script> <script>
export default { export default {
name: 'process-instance-index', name: 'process-instance-index'
data () {
return {
}
},
props: {},
methods: {
},
watch: {
},
created () {
},
mounted () {
},
updated () {
},
beforeDestroy () {
},
destroyed () {
},
computed: {
},
components: { }
} }
</script> </script>
<style lang="scss" rel="stylesheet/scss">
</style>

3
escheduler-ui/src/js/conf/home/pages/projects/pages/instance/pages/list/index.vue

@ -162,6 +162,3 @@
components: { mList, mInstanceConditions, mSpin, mListConstruction, mSecondaryMenu, mNoData } components: { mList, mInstanceConditions, mSpin, mListConstruction, mSecondaryMenu, mNoData }
} }
</script> </script>
<style lang="scss" rel="stylesheet/scss">
</style>

58
escheduler-ui/src/js/conf/home/pages/projects/pages/list/index.vue

@ -9,9 +9,9 @@
</template> </template>
<template slot="content"> <template slot="content">
<template v-if="projectsList.length"> <template v-if="projectsList.length">
<m-list :projects-list="projectsList" @on-update="_onUpdate" :page-no="pageNo" :page-size="pageSize"></m-list> <m-list :projects-list="projectsList" @on-update="_onUpdate" :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="!projectsList.length"> <template v-if="!projectsList.length">
@ -22,26 +22,33 @@
</m-list-construction> </m-list-construction>
</template> </template>
<script> <script>
import _ from 'lodash'
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import mListConstruction from '@/module/components/listConstruction/listConstruction'
import mConditions from '@/module/components/conditions/conditions'
import mList from './_source/list' import mList from './_source/list'
import mCreateProject from './_source/createProject'
import mSpin from '@/module/components/spin/spin' import mSpin from '@/module/components/spin/spin'
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 mConditions from '@/module/components/conditions/conditions'
import mListConstruction from '@/module/components/listConstruction/listConstruction'
export default { export default {
name: 'projects-list', name: 'projects-list',
data () { data () {
return { return {
pageSize: 10,
pageNo: 1,
total: null, total: null,
searchVal: '',
projectsList: [], projectsList: [],
isLoading: true isLoading: true,
searchParams: {
pageSize: 10,
pageNo: 1,
searchVal: ''
}
} }
}, },
mixins: [listUrlParamHandle],
props: {}, props: {},
methods: { methods: {
...mapActions('projects', ['getProjectsList']), ...mapActions('projects', ['getProjectsList']),
@ -49,9 +56,9 @@
* Inquire * Inquire
*/ */
_onConditions (o) { _onConditions (o) {
this.searchVal = o.searchVal this.searchParams = _.assign(this.searchParams, o)
this.pageNo = 1 setUrlParams(this.searchParams)
this._getProjectsList() this._debounceGET()
}, },
_create (item) { _create (item) {
let self = this let self = this
@ -65,7 +72,7 @@
return h(mCreateProject, { return h(mCreateProject, {
on: { on: {
onUpdate () { onUpdate () {
self._getProjectsList() self._debounceGET()
modal.remove() modal.remove()
} }
}, },
@ -77,19 +84,17 @@
}) })
}, },
_onUpdate () { _onUpdate () {
this._getProjectsList() this._debounceGET()
}, },
_page (val) { _page (val) {
this.pageNo = val this.searchParams.pageNo = val
this._getProjectsList() setUrlParams(this.searchParams)
this._debounceGET()
}, },
_getProjectsList (flag) { _getList (flag) {
this.isLoading = !flag this.isLoading = !flag
this.getProjectsList({ this.getProjectsList(this.searchParams).then(res => {
pageSize: this.pageSize, this.projectsList = []
pageNo: this.pageNo,
searchVal: this.searchVal
}).then(res => {
this.projectsList = res.totalList this.projectsList = res.totalList
this.total = res.total this.total = res.total
this.isLoading = false this.isLoading = false
@ -98,11 +103,16 @@
}) })
} }
}, },
watch: {}, watch: {
// router
'$route' (a) {
// url no params get instance list
this.searchParams.pageNo = _.isEmpty(a.query) ? 1 : a.query.pageNo
}
},
created () { created () {
}, },
mounted () { mounted () {
this._getProjectsList()
}, },
components: { mListConstruction, mSpin, mConditions, mList, mCreateProject, mNoData } components: { mListConstruction, mSpin, mConditions, mList, mCreateProject, mNoData }
} }

31
escheduler-ui/src/js/conf/home/pages/projects/pages/taskInstance/index.vue

@ -28,6 +28,7 @@
import mSpin from '@/module/components/spin/spin' import mSpin from '@/module/components/spin/spin'
import { setUrlParams } from '@/module/util/routerUtil' 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 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'
import mInstanceConditions from '@/conf/home/pages/projects/pages/_source/instanceConditions' import mInstanceConditions from '@/conf/home/pages/projects/pages/_source/instanceConditions'
@ -59,6 +60,7 @@
} }
} }
}, },
mixins: [listUrlParamHandle],
props: {}, props: {},
methods: { methods: {
...mapActions('dag', ['getTaskInstanceList']), ...mapActions('dag', ['getTaskInstanceList']),
@ -81,7 +83,7 @@
/** /**
* get list data * get list data
*/ */
_getTaskInstanceList (flag) { _getList (flag) {
this.isLoading = !flag this.isLoading = !flag
this.getTaskInstanceList(this.searchParams).then(res => { this.getTaskInstanceList(this.searchParams).then(res => {
this.taskInstanceList = [] this.taskInstanceList = []
@ -91,44 +93,21 @@
}).catch(e => { }).catch(e => {
this.isLoading = false this.isLoading = false
}) })
}, }
/**
* Anti-shake request interface
* @desc Prevent function from being called multiple times
*/
_debounceGET: _.debounce(function (flag) {
this._getTaskInstanceList(flag)
}, 100, {
'leading': false,
'trailing': true
})
}, },
watch: { watch: {
// router // router
'$route' (a) { '$route' (a) {
// url no params get instance list // url no params get instance list
if (_.isEmpty(a.query)) { if (_.isEmpty(a.query)) {
this.searchParams.pageNo = 1
this.searchParams.processInstanceId = '' this.searchParams.processInstanceId = ''
} else {
this.searchParams.pageNo = a.query.pageNo || 1
}
},
'searchParams': {
deep: true,
handler () {
this._debounceGET()
} }
this.searchParams.pageNo = _.isEmpty(a.query) ? 1 : a.query.pageNo
} }
}, },
created () { created () {
// Routing parameter merging
if (!_.isEmpty(this.$route.query)) {
this.searchParams = _.assign(this.searchParams, this.$route.query)
}
}, },
mounted () { mounted () {
this._debounceGET()
}, },
components: { mList, mInstanceConditions, mSpin, mListConstruction, mSecondaryMenu, mNoData } components: { mList, mInstanceConditions, mSpin, mListConstruction, mSecondaryMenu, mNoData }
} }

62
escheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/list/index.vue

@ -14,10 +14,10 @@
</template> </template>
<template slot="content"> <template slot="content">
<template v-if="fileResourcesList.length"> <template v-if="fileResourcesList.length">
<m-list :file-resources-list="fileResourcesList" :page-no="pageNo" :page-size="pageSize"> <m-list :file-resources-list="fileResourcesList" :page-no="searchParams.pageNo" :page-size="searchParams.pageSize">
</m-list> </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="!fileResourcesList.length"> <template v-if="!fileResourcesList.length">
@ -30,11 +30,14 @@
</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 { 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 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'
@ -43,14 +46,18 @@
name: 'resource-list-index-FILE', name: 'resource-list-index-FILE',
data () { data () {
return { return {
total: null,
isLoading: false,
fileResourcesList: [],
searchParams: {
pageSize: 10, pageSize: 10,
pageNo: 1, pageNo: 1,
total: null,
searchVal: '', searchVal: '',
isLoading: false, type: 'FILE'
fileResourcesList: [] }
} }
}, },
mixins: [listUrlParamHandle],
props: {}, props: {},
methods: { methods: {
...mapActions('resource', ['getResourcesListP']), ...mapActions('resource', ['getResourcesListP']),
@ -61,22 +68,20 @@
findComponentDownward(this.$root, 'roof-nav')._fileUpdate('FILE') findComponentDownward(this.$root, 'roof-nav')._fileUpdate('FILE')
}, },
_onConditions (o) { _onConditions (o) {
this.searchVal = o.searchVal this.searchParams = _.assign(this.searchParams, o)
this.pageNo = 1 this.searchParams.pageNo = 1
this._getResourcesList() setUrlParams(this.searchParams)
this._debounceGET()
}, },
_page (val) { _page (val) {
this.pageNo = val this.searchParams.pageNo = val
this._getResourcesList() setUrlParams(this.searchParams)
this._debounceGET()
}, },
_getResourcesList (flag) { _getList (flag) {
this.isLoading = !flag this.isLoading = !flag
this.getResourcesListP({ this.fileResourcesList = []
pageSize: this.pageSize, this.getResourcesListP(this.searchParams).then(res => {
pageNo: this.pageNo,
searchVal: this.searchVal,
type: 'FILE'
}).then(res => {
this.fileResourcesList = res.totalList this.fileResourcesList = res.totalList
this.total = res.total this.total = res.total
this.isLoading = false this.isLoading = false
@ -85,25 +90,22 @@
}) })
}, },
_updateList () { _updateList () {
this.pageSize = 10 this.searchParams.pageNo = 1
this.pageNo = 1 this.searchParams.searchVal = ''
this.searchVal = '' setUrlParams(this.searchParams)
this._getResourcesList() this._debounceGET()
},
_routerView () {
let name = this.$route.name
if (name === 'resource-file-details') {
return true
} else {
return false
} }
},
watch: {
// router
'$route' (a) {
// url no params get instance list
this.searchParams.pageNo = _.isEmpty(a.query) ? 1 : a.query.pageNo
} }
}, },
watch: {},
created () { created () {
}, },
mounted () { mounted () {
this._getResourcesList()
}, },
components: { mSecondaryMenu, mListConstruction, mConditions, mList, mSpin, mNoData } components: { mSecondaryMenu, mListConstruction, mConditions, mList, mSpin, mNoData }
} }

57
escheduler-ui/src/js/conf/home/pages/resource/pages/udf/pages/function/index.vue

@ -11,10 +11,10 @@
</template> </template>
<template slot="content"> <template slot="content">
<template v-if="udfFuncList.length"> <template v-if="udfFuncList.length">
<m-list :udf-func-list="udfFuncList" :page-no="pageNo" :page-size="pageSize" @on-update="_updateList"> <m-list :udf-func-list="udfFuncList" :page-no="searchParams.pageNo" :page-size="searchParams.pageSize" @on-update="_updateList">
</m-list> </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="!udfFuncList.length"> <template v-if="!udfFuncList.length">
@ -27,37 +27,46 @@
</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 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 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'
export default { export default {
name: 'udf-function-index', name: 'udf-function-index',
data () { data () {
return { return {
total: null,
isLoading: false,
udfFuncList: [],
searchParams: {
pageSize: 10, pageSize: 10,
pageNo: 1, pageNo: 1,
total: 20, searchVal: ''
searchVal: '', }
isLoading: false,
udfFuncList: []
} }
}, },
mixins: [listUrlParamHandle],
props: {}, props: {},
methods: { methods: {
...mapActions('resource', ['getUdfFuncListP']), ...mapActions('resource', ['getUdfFuncListP']),
_onConditions (o) { _onConditions (o) {
this.searchVal = o.searchVal this.searchParams = _.assign(this.searchParams, o)
this.pageNo = 1 this.searchParams.pageNo = 1
this._getUdfFuncListP() setUrlParams(this.searchParams)
this._debounceGET()
}, },
_page (val) { _page (val) {
this.pageNo = val this.searchParams.pageNo = val
this._getUdfFuncListP() setUrlParams(this.searchParams)
this._debounceGET()
}, },
_create () { _create () {
let self = this let self = this
@ -85,18 +94,15 @@
}) })
}, },
_updateList () { _updateList () {
this.pageSize = 10 this.searchParams.pageNo = 1
this.pageNo = 1 this.searchParams.searchVal = ''
this.searchVal = '' setUrlParams(this.searchParams)
this._getUdfFuncListP() this._debounceGET()
}, },
_getUdfFuncListP (flag) { _getList (flag) {
this.isLoading = !flag this.isLoading = !flag
this.getUdfFuncListP({ this.udfFuncList = []
pageSize: this.pageSize, this.getUdfFuncListP(this.searchParams).then(res => {
pageNo: this.pageNo,
searchVal: this.searchVal
}).then(res => {
this.udfFuncList = res.totalList this.udfFuncList = res.totalList
this.total = res.total this.total = res.total
this.isLoading = false this.isLoading = false
@ -105,11 +111,16 @@
}) })
} }
}, },
watch: {}, watch: {
// router
'$route' (a) {
// url no params get instance list
this.searchParams.pageNo = _.isEmpty(a.query) ? 1 : a.query.pageNo
}
},
created () { created () {
}, },
mounted () { mounted () {
this._getUdfFuncListP()
}, },
components: { mSecondaryMenu, mListConstruction, mConditions, mList, mSpin, mCreateUdf, mNoData } components: { mSecondaryMenu, mListConstruction, mConditions, mList, mSpin, mCreateUdf, mNoData }
} }

56
escheduler-ui/src/js/conf/home/pages/resource/pages/udf/pages/resource/index.vue

@ -11,10 +11,10 @@
</template> </template>
<template slot="content"> <template slot="content">
<template v-if="udfResourcesList.length"> <template v-if="udfResourcesList.length">
<m-list :udf-resources-list="udfResourcesList" :page-no="pageNo" :page-size="pageSize"> <m-list :udf-resources-list="udfResourcesList" :page-no="searchParams.pageNo" :page-size="searchParams.pageSize">
</m-list> </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="!udfResourcesList.length"> <template v-if="!udfResourcesList.length">
@ -27,11 +27,14 @@
</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 { 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 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 +43,18 @@
name: 'resource-list-index-UDF', name: 'resource-list-index-UDF',
data () { data () {
return { return {
total: null,
isLoading: false,
udfResourcesList: [],
searchParams: {
pageSize: 10, pageSize: 10,
pageNo: 1, pageNo: 1,
total: null,
searchVal: '', searchVal: '',
isLoading: false, type: 'UDF'
udfResourcesList: [] }
} }
}, },
mixins: [listUrlParamHandle],
props: {}, props: {},
methods: { methods: {
...mapActions('resource', ['getResourcesListP']), ...mapActions('resource', ['getResourcesListP']),
@ -58,28 +65,26 @@
findComponentDownward(this.$root, 'roof-nav')._fileUpdate('UDF') findComponentDownward(this.$root, 'roof-nav')._fileUpdate('UDF')
}, },
_onConditions (o) { _onConditions (o) {
this.searchVal = o.searchVal this.searchParams = _.assign(this.searchParams, o)
this.pageNo = 1 this.searchParams.pageNo = 1
this._getResourcesListP() setUrlParams(this.searchParams)
this._debounceGET()
}, },
_page (val) { _page (val) {
this.pageNo = val this.searchParams.pageNo = val
this._getResourcesListP() setUrlParams(this.searchParams)
this._debounceGET()
}, },
_updateList () { _updateList () {
this.pageSize = 10 this.searchParams.pageNo = 1
this.pageNo = 1 this.searchParams.searchVal = ''
this.searchVal = '' setUrlParams(this.searchParams)
this._getResourcesListP() this._debounceGET()
}, },
_getResourcesListP (flag) { _getList (flag) {
this.isLoading = !flag this.isLoading = !flag
this.getResourcesListP({ this.udfResourcesList = []
pageSize: this.pageSize, this.getResourcesListP(this.searchParams).then(res => {
pageNo: this.pageNo,
searchVal: this.searchVal,
type: 'UDF'
}).then(res => {
this.udfResourcesList = res.totalList this.udfResourcesList = res.totalList
this.total = res.total this.total = res.total
this.isLoading = false this.isLoading = false
@ -88,11 +93,16 @@
}) })
} }
}, },
watch: {}, watch: {
// router
'$route' (a) {
// url no params get instance list
this.searchParams.pageNo = _.isEmpty(a.query) ? 1 : a.query.pageNo
}
},
created () { created () {
}, },
mounted () { mounted () {
this._getResourcesListP()
}, },
components: { mSecondaryMenu, mListConstruction, mConditions, mList, mSpin, mNoData } components: { mSecondaryMenu, mListConstruction, mConditions, mList, mSpin, mNoData }
} }

2
escheduler-ui/src/js/conf/home/router/index.js

@ -177,7 +177,7 @@ const router = new Router({
name: 'history-task-record', name: 'history-task-record',
component: resolve => require(['../pages/projects/pages/historyTaskRecord'], resolve), component: resolve => require(['../pages/projects/pages/historyTaskRecord'], resolve),
meta: { meta: {
title: `History task record` title: `${i18n.$t('History task record')}`
} }
} }

4
escheduler-ui/src/js/module/components/listBoxF/listBoxF.vue

@ -21,7 +21,7 @@
margin-bottom: 0; margin-bottom: 0;
} }
.text { .text {
width: 120px; width: 144px;
float: left; float: left;
text-align: right; text-align: right;
line-height: 32px; line-height: 32px;
@ -32,7 +32,7 @@
} }
} }
.cont { .cont {
width: calc(100% - 140px); width: calc(100% - 162px);
float: left; float: left;
.textarea-content { .textarea-content {
.v-input { .v-input {

2
escheduler-ui/src/js/module/components/popup/popup.vue

@ -82,7 +82,7 @@
padding: 0 20px; padding: 0 20px;
} }
.content-p { .content-p {
min-width: 500px; min-width: 520px;
min-height: 100px; min-height: 100px;
} }
} }

3
escheduler-ui/src/js/module/i18n/locale/en_US.js

@ -408,5 +408,6 @@ export default {
'Create queue': 'Create queue', 'Create queue': 'Create queue',
'Edit queue': 'Edit queue', 'Edit queue': 'Edit queue',
'Datasource manage': 'Datasource', 'Datasource manage': 'Datasource',
'History task record': 'History task record' 'History task record': 'History task record',
'Please go online': 'Please go online'
} }

3
escheduler-ui/src/js/module/i18n/locale/zh_CN.js

@ -407,5 +407,6 @@ export default {
'Create queue': '创建队列', 'Create queue': '创建队列',
'Edit queue': '编辑队列', 'Edit queue': '编辑队列',
'Datasource manage': '数据源中心', 'Datasource manage': '数据源中心',
'History task record': '历史任务记录' 'History task record': '历史任务记录',
'Please go online': '不要忘记上线'
} }

2
escheduler-ui/src/js/module/mixin/disabledState.js

@ -29,8 +29,6 @@ export default {
created () { created () {
this.isDetails = this.store.state.dag.isDetails this.isDetails = this.store.state.dag.isDetails
}, },
methods: {
},
computed: { computed: {
_isDetails () { _isDetails () {
return this.isDetails ? 'icon-disabled' : '' return this.isDetails ? 'icon-disabled' : ''

53
escheduler-ui/src/js/module/mixin/listUrlParamHandle.js

@ -0,0 +1,53 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import _ from 'lodash'
/**
* Mainly used for data list paging url param handle
* @param _getList => api function(required)
*/
export default {
watch: {
// watch pageNo
'searchParams.pageNo': {
deep: true,
handler () {
this._debounceGET()
}
}
},
created () {
// Routing parameter merging
if (!_.isEmpty(this.$route.query)) {
this.searchParams = _.assign(this.searchParams, this.$route.query)
}
},
mounted () {
this._debounceGET()
},
methods: {
/**
* Anti-shake request interface
* @desc Prevent function from being called multiple times
*/
_debounceGET: _.debounce(function (flag) {
this._getList(flag)
}, 100, {
'leading': false,
'trailing': true
})
}
}
Loading…
Cancel
Save