From bec5aff11e1fa27348c5a000943f657144b6a84c Mon Sep 17 00:00:00 2001 From: fannluo Date: Fri, 12 Apr 2019 17:09:09 +0800 Subject: [PATCH] =?UTF-8?q?feature:=E8=81=8C=E8=83=BD=E5=8C=96=E4=B8=AD?= =?UTF-8?q?=E5=BF=83=E5=88=97=E8=A1=A8=E3=80=81=E5=AE=A1=E8=AE=A1=E4=B8=AD?= =?UTF-8?q?=E5=BF=83=E5=88=97=E8=A1=A8=E5=A2=9E=E5=8A=A0=E9=AB=98=E7=BA=A7?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E5=8A=9F=E8=83=BD=20#125?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pipeline/blueflow/src/pages/audit/index.vue | 187 ++++++++++- pipeline/blueflow/src/pages/functor/index.vue | 292 +++++++++++++++--- 2 files changed, 427 insertions(+), 52 deletions(-) diff --git a/pipeline/blueflow/src/pages/audit/index.vue b/pipeline/blueflow/src/pages/audit/index.vue index 4bd1c69e6a..a84be3f7e8 100644 --- a/pipeline/blueflow/src/pages/audit/index.vue +++ b/pipeline/blueflow/src/pages/audit/index.vue @@ -13,8 +13,81 @@
-
- + + +
@@ -91,6 +164,8 @@ import NoData from '@/components/common/base/NoData.vue' import BaseTitle from '@/components/common/base/BaseTitle.vue' import BaseSearch from '@/components/common/base/BaseSearch.vue' import toolsUtils from '@/utils/tools.js' +import moment from 'moment-timezone' + export default { name: 'auditTaskHome', components: { @@ -133,12 +208,14 @@ export default { listLoading: true, isAdvancedSerachShow: false, currentPage: 1, + selectedCcId: -1, totalPage: 1, countPerPage: 15, totalCount: 0, taskSync: 0, statusSync: 0, searchStr: '', + bizCcId: undefined, creator: undefined, executor: undefined, activeTaskCategory: undefined, @@ -146,32 +223,64 @@ export default { executeEndTime: undefined, isStarted: undefined, isFinished: undefined, + business: { + list: [], + loading: false, + id: null, + searchable: true, + empty: false + }, auditList: [], - statusList: [], taskCategory: [], + statusList: [ + {'id': 'nonExecution', 'name': gettext('未执行')}, + {'id': 'runing', 'name': gettext('未完成')}, + {'id': 'finished', 'name': gettext('完成')} + ], executeStatus: [] // 任务执行态 } }, - computed: { - }, created () { this.loadFunctionTask() this.onSearchInput = toolsUtils.debounce(this.searchInputhandler, 500) + this.getBusinessList() + this.getBusinessBaseInfo() }, methods: { ...mapActions('auditTask/', [ 'loadAuditTaskList' ]), + ...mapActions('functionTask/', [ + 'loadFunctionBusinessList' + ]), ...mapActions('task/', [ 'getInstanceStatus' ]), + ...mapActions('template/', [ + 'loadBusinessBaseInfo' + ]), async loadFunctionTask () { this.listLoading = true try { const data = { limit: this.countPerPage, offset: (this.currentPage - 1) * this.countPerPage, - q: this.searchStr + business__cc_id: this.bizCcId, + category: this.activeTaskCategory, + audit__pipeline_instance__name__contains: this.searchStr, + pipeline_instance__is_started: this.isStarted, + pipeline_instance__is_finished: this.isFinished, + pipeline_instance__creator__contains: this.creator, + pipeline_instance__executor__contains: this.executor + } + if (this.executeEndTime) { + if (this.common) { + data['pipeline_template__start_time__gte'] = moment(this.executeStartTime).format('YYYY-MM-DD') + data['pipeline_template__start_time__lte'] = moment(this.executeEndTime).add('1','d').format('YYYY-MM-DD') + } else { + data['pipeline_instance__start_time__gte'] = moment.tz(this.executeStartTime, this.businessTimezone).format('YYYY-MM-DD') + data['pipeline_instance__start_time__lte'] = moment.tz(this.executeEndTime, this.businessTimezone).add('1','d').format('YYYY-MM-DD') + } } const auditListData = await this.loadAuditTaskList(data) const list = auditListData.objects @@ -254,6 +363,28 @@ export default { errorHandler(e, this) } }, + async getBusinessList () { + this.business.loading = true + try { + let businessData = await this.loadFunctionBusinessList() + this.business.list = businessData.objects + } catch (e) { + errorHandler(e, this) + } finally { + this.business.loading = false + } + }, + async getBusinessBaseInfo () { + this.taskBasicInfoLoading = true + try { + const data = await this.loadBusinessBaseInfo() + this.taskCategory = data.task_categories + } catch (e) { + errorHandler(e, this) + } finally { + this.taskBasicInfoLoading = false + } + }, onAdvanceShow () { this.isAdvancedSerachShow = !this.isAdvancedSerachShow }, @@ -265,8 +396,35 @@ export default { onClearCategory (){ this.activeTaskCategory = undefined }, - onSelectedCategory () { + onSelectedCategory (name, value) { this.activeTaskCategory = name + }, + onResetForm () { + this.isStarted = undefined + this.isFinished = undefined + this.creator = undefined + this.executor = undefined + this.searchStr = undefined + this.statusSync = 0 + this.selectedCcId = 0 + this.taskSync = 0 + this.activeTaskCategory = undefined + this.executeStartTime = undefined + this.executeEndTime = undefined + }, + onSelectedStatus (id, name) { + this.isStarted = id !== 'nonExecution' + this.isFinished = id === 'finished' + }, + onClearStatus () { + this.isStarted = undefined + this.isFinished = undefined + }, + onSelectedBizCcId (name, value) { + if (this.bizCcId === name) { + return + } + this.bizCcId = name } } } @@ -399,6 +557,21 @@ export default { width: 260px; } } + .query-button { + padding: 10px; + min-width: 450px; + @media screen and (max-width: 1420px) { + min-width: 390px; + } + text-align: center; + .query-cancel { + margin-left: 5px; + } + .bk-button { + height: 32px; + line-height: 32px; + } + } } } .common-icon-dark-circle-pause { diff --git a/pipeline/blueflow/src/pages/functor/index.vue b/pipeline/blueflow/src/pages/functor/index.vue index 31e64eec73..35f4fca166 100644 --- a/pipeline/blueflow/src/pages/functor/index.vue +++ b/pipeline/blueflow/src/pages/functor/index.vue @@ -12,12 +12,63 @@