diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/list/_source/list.vue b/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/list/_source/list.vue index 5de30e90b4712f691d15a5981f18378bacfd977b..01b478f6bdc85b865a2cb71f40772c41b08f02f1 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/list/_source/list.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/list/_source/list.vue @@ -139,6 +139,8 @@ @@ -147,6 +149,7 @@ import _ from 'lodash' import mStart from './start' import mTiming from './timing' + import mRelatedItems from './relatedItems' import { mapActions } from 'vuex' import { publishStatus } from '@/conf/home/pages/dag/_source/config' import mVersions from './versions' @@ -166,7 +169,7 @@ pageSize: Number }, methods: { - ...mapActions('dag', ['editProcessState', 'getStartCheck', 'getReceiver', 'deleteDefinition', 'batchDeleteDefinition', 'exportDefinition', 'getProcessDefinitionVersionsPage', 'copyProcess', 'switchProcessDefinitionVersion', 'deleteProcessDefinitionVersion']), + ...mapActions('dag', ['editProcessState', 'getStartCheck', 'getReceiver', 'deleteDefinition', 'batchDeleteDefinition', 'exportDefinition', 'getProcessDefinitionVersionsPage', 'copyProcess', 'switchProcessDefinitionVersion', 'deleteProcessDefinitionVersion', 'moveProcess']), ...mapActions('security', ['getWorkerGroupsAll']), _rtPublishStatus (code) { return _.filter(publishStatus, v => v.code === code)[0].desc @@ -317,8 +320,27 @@ */ _copyProcess (item) { this.copyProcess({ - processId: item.id + processDefinitionIds: item.id, + targetProjectId: item.projectId + }).then(res => { + this.strSelectIds = '' + this.$message.success(res.msg) + $('body').find('.tooltip.fade.top.in').remove() + this._onUpdate() + }).catch(e => { + this.$message.error(e.msg || '') + }) + }, + + /** + * move + */ + _moveProcess (item) { + this.moveProcess({ + processDefinitionIds: item.id, + targetProjectId: item.projectId }).then(res => { + this.strSelectIds = '' this.$message.success(res.msg) $('body').find('.tooltip.fade.top.in').remove() this._onUpdate() @@ -469,7 +491,64 @@ this.$message.error(e.msg) }) }, - + /** + * Batch Copy + */ + _batchCopy () { + let self = this + let modal = this.$modal.dialog({ + closable: false, + showMask: true, + escClose: true, + className: 'v-modal-custom', + transitionName: 'opacityp', + render (h) { + return h(mRelatedItems, { + on: { + onBatchCopy (item) { + self._copyProcess({id: self.strSelectIds,projectId: item}) + modal.remove() + }, + close () { + modal.remove() + } + }, + props: { + tmp: false + } + }) + } + }) + }, + /** + * _batchMove + */ + _batchMove() { + let self = this + let modal = this.$modal.dialog({ + closable: false, + showMask: true, + escClose: true, + className: 'v-modal-custom', + transitionName: 'opacityp', + render (h) { + return h(mRelatedItems, { + on: { + onBatchMove (item) { + self._moveProcess({id: self.strSelectIds,projectId: item}) + modal.remove() + }, + close () { + modal.remove() + } + }, + props: { + tmp: true + } + }) + } + }) + }, /** * Edit state */ diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/list/_source/relatedItems.vue b/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/list/_source/relatedItems.vue new file mode 100644 index 0000000000000000000000000000000000000000..9090bbd77177ce3ed71d8c4f482fa3192b019388 --- /dev/null +++ b/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/list/_source/relatedItems.vue @@ -0,0 +1,94 @@ +/* + * 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. + */ + + \ No newline at end of file diff --git a/dolphinscheduler-ui/src/js/conf/home/store/dag/actions.js b/dolphinscheduler-ui/src/js/conf/home/store/dag/actions.js index be516042b0d47b157ea3df844f900a4baf8eb332..93fab5a224d328eb4373138bacab4d5857ead959 100644 --- a/dolphinscheduler-ui/src/js/conf/home/store/dag/actions.js +++ b/dolphinscheduler-ui/src/js/conf/home/store/dag/actions.js @@ -196,7 +196,8 @@ export default { copyProcess ({ state }, payload) { return new Promise((resolve, reject) => { io.post(`projects/${state.projectName}/process/copy`, { - processId: payload.processId + processDefinitionIds: payload.processDefinitionIds, + targetProjectId: payload.targetProjectId }, res => { resolve(res) }).catch(e => { @@ -205,6 +206,35 @@ export default { }) }, + /** + * Get process definition DAG diagram details + */ + moveProcess ({ state }, payload) { + return new Promise((resolve, reject) => { + io.post(`projects/${state.projectName}/process/move`, { + processDefinitionIds: payload.processDefinitionIds, + targetProjectId: payload.targetProjectId + }, res => { + resolve(res) + }).catch(e => { + reject(e) + }) + }) + }, + + /** + * Get all the items created by the logged in user + */ + getAllItems ({ state }, payload) { + return new Promise((resolve, reject) => { + io.get(`projects/login-user-created-project`, {}, res => { + resolve(res) + }).catch(e => { + reject(e) + }) + }) + }, + /** * Get the process instance DAG diagram details */ diff --git a/dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js b/dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js index ae66bc4baea886078d8c60443cdb678d87d6abdc..b0f315a5390134a71a2b95b0661d77a719e0e1a7 100755 --- a/dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js +++ b/dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js @@ -638,5 +638,8 @@ export default { 'Connection name': 'Connection name', 'Current connection settings': 'Current connection settings', 'Please save the DAG before formatting': 'Please save the DAG before formatting', - 'Batch copy': 'Batch copy' + 'Batch copy': 'Batch copy', + 'Related items': 'Related items', + 'Project name is required': 'Project name is required', + 'Batch move': 'Batch move' } diff --git a/dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js b/dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js index bb3924c6e139a97a6d6d15d721827f4d57b5a625..53f0e3e483ac8973e9620417bdb3c4cd7acdc459 100755 --- a/dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js +++ b/dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js @@ -638,5 +638,8 @@ export default { 'Connection name': '连线名', 'Current connection settings': '当前连线设置', 'Please save the DAG before formatting': '格式化前请先保存DAG', - 'Batch copy': '批量复制' + 'Batch copy': '批量复制', + 'Related items': '关联项目', + 'Project name is required': '项目名称必填', + 'Batch move': '批量移动' }