diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/flink.vue b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/flink.vue index 6b3c6e6999..2dc804ad8e 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/flink.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/flink.vue @@ -20,10 +20,11 @@
{{$t('Program Type')}}
+ style="width: 130px;" + size="small" + v-model="programType" + :disabled="isDetails" + @change="programTypeChange"> -
{{$t('Main Jar Package')}}
+
{{$t('Main Package')}}
- +
{{ node.raw.fullName }}
@@ -205,6 +206,7 @@ import disabledState from '@/module/mixin/disabledState' import Clipboard from 'clipboard' import { diGuiTree, searchTree } from './_source/resourceTree' + import { mapActions } from 'vuex' export default { name: 'flink', @@ -265,6 +267,17 @@ }, mixins: [disabledState], methods: { + ...mapActions('dag', ['getResourcesListJar']), + programTypeChange () { + this.mainJar = null + this.mainClass = '' + }, + getTargetResourcesListJar (programType) { + this.getResourcesListJar(programType).then(res => { + diGuiTree(res) + this.mainJarLists = res + }) + }, _copyPath (e, node) { e.stopPropagation() let clipboard = new Clipboard('.copy-path', { @@ -325,7 +338,7 @@ } if (!this.mainJar) { - this.$message.warning(`${i18n.$t('Please enter main jar package')}`) + this.$message.warning(`${i18n.$t('Please enter main package')}`) return false } @@ -450,9 +463,7 @@ watch: { // Listening type programType (type) { - if (type === 'PYTHON') { - this.mainClass = '' - } + this.getTargetResourcesListJar(type) }, // Watch the cacheParams cacheParams (val) { @@ -511,6 +522,7 @@ } }, created () { + this.getTargetResourcesListJar(this.programType) let item = this.store.state.dag.resourcesListS let items = this.store.state.dag.resourcesListJar diGuiTree(item) @@ -518,6 +530,7 @@ this.mainJarList = item this.mainJarLists = items let o = this.backfillItem + // Non-null objects represent backfill if (!_.isEmpty(o)) { this.mainClass = o.params.mainClass || '' @@ -570,9 +583,6 @@ this.localParams = localParams } } - }, - mounted () { - }, components: { mLocalParams, mListBox, mList4Box, Treeselect } } diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/mr.vue b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/mr.vue index d6718f1c8e..d9f91f3a18 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/mr.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/mr.vue @@ -19,7 +19,12 @@
{{$t('Program Type')}}
- + -
{{$t('Main Jar Package')}}
+
{{$t('Main Package')}}
- +
{{ node.raw.fullName }}
@@ -118,6 +123,7 @@ import disabledState from '@/module/mixin/disabledState' import Clipboard from 'clipboard' import { diGuiTree, searchTree } from './_source/resourceTree' + import { mapActions } from 'vuex' export default { name: 'mr', @@ -144,9 +150,9 @@ // Option parameters others: '', // Program type - programType: 'JAVA', + programType: 'SCALA', // Program type(List) - programTypeList: [{ code: 'JAVA' }, { code: 'PYTHON' }], + programTypeList: [{ code: 'JAVA' }, { code: 'SCALA' }, { code: 'PYTHON' }], normalizer (node) { return { label: node.name @@ -161,6 +167,17 @@ }, mixins: [disabledState], methods: { + ...mapActions('dag', ['getResourcesListJar']), + programTypeChange () { + this.mainJar = null + this.mainClass = '' + }, + getTargetResourcesListJar (programType) { + this.getResourcesListJar(programType).then(res => { + diGuiTree(res) + this.mainJarLists = res + }) + }, _copyPath (e, node) { e.stopPropagation() let clipboard = new Clipboard('.copy-path', { @@ -268,7 +285,7 @@ } if (!this.mainJar) { - this.$message.warning(`${i18n.$t('Please enter main jar package')}`) + this.$message.warning(`${i18n.$t('Please enter main package')}`) return false } @@ -306,9 +323,7 @@ * monitor */ programType (type) { - if (type === 'PYTHON') { - this.mainClass = '' - } + this.getTargetResourcesListJar(type) }, // Watch the cacheParams cacheParams (val) { @@ -361,6 +376,7 @@ } }, created () { + this.getTargetResourcesListJar(this.programType) let item = this.store.state.dag.resourcesListS let items = this.store.state.dag.resourcesListJar diGuiTree(item) @@ -378,11 +394,12 @@ this.mainJar = '' } else { this.mainJar = o.params.mainJar.id || '' + console.log(this.mainJar) } this.appName = o.params.appName || '' this.mainArgs = o.params.mainArgs || '' this.others = o.params.others - this.programType = o.params.programType || 'JAVA' + this.programType = o.params.programType || 'SCALA' // backfill resourceList let resourceList = o.params.resourceList || [] @@ -414,9 +431,6 @@ this.localParams = localParams } } - }, - mounted () { - }, components: { mLocalParams, mListBox, Treeselect } } diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/spark.vue b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/spark.vue index e2e0d068b2..6674d1f250 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/spark.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/spark.vue @@ -20,10 +20,11 @@
{{$t('Program Type')}}
+ style="width: 130px;" + size="small" + v-model="programType" + :disabled="isDetails" + @change="programTypeChange"> -
{{$t('Main Jar Package')}}
+
{{$t('Main Package')}}
- +
{{ node.raw.fullName }}
@@ -206,6 +207,7 @@ import disabledState from '@/module/mixin/disabledState' import Clipboard from 'clipboard' import { diGuiTree, searchTree } from './_source/resourceTree' + import { mapActions } from 'vuex' export default { name: 'spark', @@ -265,6 +267,17 @@ }, mixins: [disabledState], methods: { + ...mapActions('dag', ['getResourcesListJar']), + programTypeChange () { + this.mainJar = null + this.mainClass = '' + }, + getTargetResourcesListJar (programType) { + this.getResourcesListJar(programType).then(res => { + diGuiTree(res) + this.mainJarLists = res + }) + }, _copyPath (e, node) { e.stopPropagation() let clipboard = new Clipboard('.copy-path', { @@ -372,7 +385,7 @@ } if (!this.mainJar) { - this.$message.warning(`${i18n.$t('Please enter main jar package')}`) + this.$message.warning(`${i18n.$t('Please enter main package')}`) return false } @@ -469,9 +482,7 @@ watch: { // Listening type programType (type) { - if (type === 'PYTHON') { - this.mainClass = '' - } + this.getTargetResourcesListJar(type) }, // Watch the cacheParams cacheParams (val) { @@ -531,6 +542,7 @@ } }, created () { + this.getTargetResourcesListJar(this.programType) let item = this.store.state.dag.resourcesListS let items = this.store.state.dag.resourcesListJar diGuiTree(item) @@ -591,9 +603,6 @@ this.localParams = localParams } } - }, - mounted () { - }, components: { mLocalParams, mListBox, mList4Box, Treeselect } } diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/dag/definitionDetails.vue b/dolphinscheduler-ui/src/js/conf/home/pages/dag/definitionDetails.vue index 052d956ab1..ff8e562550 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/dag/definitionDetails.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/dag/definitionDetails.vue @@ -46,7 +46,7 @@ props: {}, methods: { ...mapMutations('dag', ['resetParams', 'setIsDetails']), - ...mapActions('dag', ['getProjectList', 'getResourcesList', 'getProcessDetails', 'getResourcesListJar']), + ...mapActions('dag', ['getProjectList', 'getResourcesList', 'getProcessDetails']), ...mapActions('security', ['getTenantList', 'getWorkerGroupsAll', 'getAlarmGroupsAll']), /** * init @@ -63,8 +63,6 @@ this.getProjectList(), // get resource this.getResourcesList(), - // get jar - this.getResourcesListJar(), // get worker group list this.getWorkerGroupsAll(), // get alarm group list diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/dag/index.vue b/dolphinscheduler-ui/src/js/conf/home/pages/dag/index.vue index 2099c38f46..482793e669 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/dag/index.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/dag/index.vue @@ -40,7 +40,7 @@ props: {}, methods: { ...mapMutations('dag', ['resetParams']), - ...mapActions('dag', ['getProjectList', 'getResourcesList', 'getResourcesListJar', 'getResourcesListJar']), + ...mapActions('dag', ['getProjectList', 'getResourcesList']), ...mapActions('security', ['getTenantList', 'getWorkerGroupsAll', 'getAlarmGroupsAll']), /** * init @@ -53,12 +53,8 @@ Promise.all([ // get project this.getProjectList(), - // get jar - this.getResourcesListJar(), // get resource this.getResourcesList(), - // get jar - this.getResourcesListJar(), // get worker group list this.getWorkerGroupsAll(), // get alarm group list diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/dag/instanceDetails.vue b/dolphinscheduler-ui/src/js/conf/home/pages/dag/instanceDetails.vue index c9e3b98e93..3534b4878d 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/dag/instanceDetails.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/dag/instanceDetails.vue @@ -43,7 +43,7 @@ props: {}, methods: { ...mapMutations('dag', ['setIsDetails', 'resetParams']), - ...mapActions('dag', ['getProjectList', 'getResourcesList', 'getInstancedetail', 'getResourcesListJar']), + ...mapActions('dag', ['getProjectList', 'getResourcesList', 'getInstancedetail']), ...mapActions('security', ['getTenantList', 'getWorkerGroupsAll', 'getAlarmGroupsAll']), /** * init @@ -60,8 +60,6 @@ this.getProjectList(), // get resources this.getResourcesList(), - // get jar - this.getResourcesListJar(), // get worker group list this.getWorkerGroupsAll(), // get alarm group list diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/taskDefinition/index.vue b/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/taskDefinition/index.vue index 40d83f3e8e..50a8b0a7f4 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/taskDefinition/index.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/taskDefinition/index.vue @@ -133,9 +133,7 @@ ...mapActions('dag', [ 'getProcessList', 'getProjectList', - 'getResourcesList', - 'getResourcesListJar', - 'getResourcesListJar' + 'getResourcesList' ]), ...mapMutations('dag', ['resetParams', 'setIsDetails']), ...mapActions('security', [ @@ -268,12 +266,8 @@ this.getProcessList(), // get project this.getProjectList(), - // get jar - this.getResourcesListJar(), // get resource this.getResourcesList(), - // get jar - this.getResourcesListJar(), // get worker group list this.getWorkerGroupsAll(), // get alarm group list 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 535f3a91ca..76ed45127e 100644 --- a/dolphinscheduler-ui/src/js/conf/home/store/dag/actions.js +++ b/dolphinscheduler-ui/src/js/conf/home/store/dag/actions.js @@ -449,16 +449,12 @@ export default { /** * get jar */ - getResourcesListJar ({ state }) { + getResourcesListJar ({ state }, programType) { return new Promise((resolve, reject) => { - if (state.resourcesListJar.length) { - resolve() - return - } io.get('resources/query-by-type', { - type: 'FILE' + type: 'FILE', + programType }, res => { - state.resourcesListJar = res.data resolve(res.data) }).catch(res => { reject(res) 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 4f6b866bb7..f4ad2eb15a 100755 --- a/dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js +++ b/dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js @@ -87,8 +87,8 @@ export default { 'Please enter a positive integer': 'Please enter a positive integer', 'Program Type': 'Program Type', 'Main Class': 'Main Class', - 'Main Jar Package': 'Main Jar Package', - 'Please enter main jar package': 'Please enter main jar package', + 'Main Package': 'Main Package', + 'Please enter main package': 'Please enter main package', 'Please enter main class': 'Please enter main class', 'Main Arguments': 'Main Arguments', 'Please enter main arguments': 'Please enter main arguments', 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 dc63c50936..ee5faedf8c 100644 --- a/dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js +++ b/dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js @@ -87,8 +87,8 @@ export default { 'Please enter a positive integer': '请输入正整数', 'Program Type': '程序类型', 'Main Class': '主函数的Class', - 'Main Jar Package': '主Jar包', - 'Please enter main jar package': '请选择主Jar包', + 'Main Package': '主程序包', + 'Please enter main package': '请选择主程序包', 'Please enter main class': '请填写主函数的Class', 'Main Arguments': '主程序参数', 'Please enter main arguments': '请输入主程序参数',