From 6bff5791a6b91f030a8af674006dd1d080818fc0 Mon Sep 17 00:00:00 2001 From: break60 <790061044@qq.com> Date: Thu, 17 Oct 2019 14:24:10 +0800 Subject: [PATCH] Resource authorization add file resource and UDF resource tab (#1043) * Delete third party import license * Resource authorization add file resource and UDF resource tab --- .../security/pages/users/_source/list.vue | 35 ++- .../module/components/transfer/resource.vue | 255 ++++++++++++++++++ .../src/js/module/i18n/locale/en_US.js | 2 + .../src/js/module/i18n/locale/zh_CN.js | 2 + 4 files changed, 289 insertions(+), 5 deletions(-) create mode 100644 dolphinscheduler-ui/src/js/module/components/transfer/resource.vue diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/security/pages/users/_source/list.vue b/dolphinscheduler-ui/src/js/conf/home/pages/security/pages/users/_source/list.vue index f8f3c4241c..e1dd05d29f 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/security/pages/users/_source/list.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/security/pages/users/_source/list.vue @@ -123,6 +123,7 @@ import i18n from '@/module/i18n' import { mapActions } from 'vuex' import mTransfer from '@/module/components/transfer/transfer' + import mResource from '@/module/components/transfer/resource' export default { name: 'user-list', @@ -218,13 +219,33 @@ let sourceListPrs = _.map(data[0], v => { return { id: v.id, - name: v.alias + name: v.alias, + type: v.type + } + }) + let fileSourceList = [] + let udfSourceList = [] + sourceListPrs.forEach((value,index,array)=>{ + if(value.type =='FILE'){ + fileSourceList.push(value) + } else{ + udfSourceList.push(value) } }) let targetListPrs = _.map(data[1], v => { return { id: v.id, - name: v.alias + name: v.alias, + type: v.type + } + }) + let fileTargetList = [] + let udfTargetList = [] + targetListPrs.forEach((value,index,array)=>{ + if(value.type =='FILE'){ + fileTargetList.push(value) + } else{ + udfTargetList.push(value) } }) let self = this @@ -235,7 +256,7 @@ className: 'v-modal-custom', transitionName: 'opacityp', render (h) { - return h(mTransfer, { + return h(mResource, { on: { onUpdate (resourceIds) { self._grantAuthorization('users/grant-file', { @@ -249,8 +270,12 @@ } }, props: { - sourceListPrs: sourceListPrs, - targetListPrs: targetListPrs, + // sourceListPrs: sourceListPrs, + // targetListPrs: targetListPrs, + fileSourceList: fileSourceList, + udfSourceList: udfSourceList, + fileTargetList: fileTargetList, + udfTargetList: udfTargetList, type: { name: `${i18n.$t('Resources')}` } diff --git a/dolphinscheduler-ui/src/js/module/components/transfer/resource.vue b/dolphinscheduler-ui/src/js/module/components/transfer/resource.vue new file mode 100644 index 0000000000..0ab0d97510 --- /dev/null +++ b/dolphinscheduler-ui/src/js/module/components/transfer/resource.vue @@ -0,0 +1,255 @@ +/* + * 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. + */ + + + + + + + {{$t('File resources')}} + {{$t('UDF resources')}} + + + + + {{type.name}}{{$t('List')}} + ({{cacheSourceList.length}}) + + + + + + {{item.name}} + + + + + + + + + {{$t('Selected')}}{{type.name}} + ({{cacheTargetList.length}}) + + + + + {{item.name}} + + + + + + + + + + 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 3300d5dd12..fbcb744639 100644 --- a/dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js +++ b/dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js @@ -174,6 +174,8 @@ export default { 'Please enter the correct mobile phone format': 'Please enter the correct mobile phone format', 'Project': 'Project', 'Authorize': 'Authorize', + 'File resources': 'File resources', + 'UDF resources': 'UDF resources', 'Edit alarm group': 'Edit alarm group', 'Create alarm group': 'Create alarm group', 'Group Name': 'Group Name', 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 4cf6222ae9..1b1672ffa9 100644 --- a/dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js +++ b/dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js @@ -174,6 +174,8 @@ export default { 'Please enter the correct mobile phone format': '请输入正确的手机格式', 'Project': '项目', 'Authorize': '授权', + 'File resources': '文件资源', + 'UDF resources': 'UDF资源', 'Edit alarm group': '编辑告警组', 'Create alarm group': '创建告警组', 'Group Name': '组名称',