Skip to content

Commit 2fa3157

Browse files
authored
[Feature][Workflow] Main package. (#7177)
1 parent 27ea43d commit 2fa3157

10 files changed

Lines changed: 83 additions & 68 deletions

File tree

dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/flink.vue

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,11 @@
2020
<div slot="text">{{$t('Program Type')}}</div>
2121
<div slot="content">
2222
<el-select
23-
style="width: 130px;"
24-
size="small"
25-
v-model="programType"
26-
:disabled="isDetails">
23+
style="width: 130px;"
24+
size="small"
25+
v-model="programType"
26+
:disabled="isDetails"
27+
@change="programTypeChange">
2728
<el-option
2829
v-for="city in programTypeList"
2930
:key="city.code"
@@ -46,9 +47,9 @@
4647
</div>
4748
</m-list-box>
4849
<m-list-box>
49-
<div slot="text">{{$t('Main Jar Package')}}</div>
50+
<div slot="text">{{$t('Main Package')}}</div>
5051
<div slot="content">
51-
<treeselect v-model="mainJar" maxHeight="200" :options="mainJarLists" :disable-branch-nodes="true" :normalizer="normalizer" :disabled="isDetails" :placeholder="$t('Please enter main jar package')">
52+
<treeselect v-model="mainJar" maxHeight="200" :options="mainJarLists" :disable-branch-nodes="true" :normalizer="normalizer" :disabled="isDetails" :placeholder="$t('Please enter main package')">
5253
<div slot="value-label" slot-scope="{ node }">{{ node.raw.fullName }}</div>
5354
</treeselect>
5455
</div>
@@ -205,6 +206,7 @@
205206
import disabledState from '@/module/mixin/disabledState'
206207
import Clipboard from 'clipboard'
207208
import { diGuiTree, searchTree } from './_source/resourceTree'
209+
import { mapActions } from 'vuex'
208210
209211
export default {
210212
name: 'flink',
@@ -265,6 +267,17 @@
265267
},
266268
mixins: [disabledState],
267269
methods: {
270+
...mapActions('dag', ['getResourcesListJar']),
271+
programTypeChange () {
272+
this.mainJar = null
273+
this.mainClass = ''
274+
},
275+
getTargetResourcesListJar (programType) {
276+
this.getResourcesListJar(programType).then(res => {
277+
diGuiTree(res)
278+
this.mainJarLists = res
279+
})
280+
},
268281
_copyPath (e, node) {
269282
e.stopPropagation()
270283
let clipboard = new Clipboard('.copy-path', {
@@ -325,7 +338,7 @@
325338
}
326339
327340
if (!this.mainJar) {
328-
this.$message.warning(`${i18n.$t('Please enter main jar package')}`)
341+
this.$message.warning(`${i18n.$t('Please enter main package')}`)
329342
return false
330343
}
331344
@@ -450,9 +463,7 @@
450463
watch: {
451464
// Listening type
452465
programType (type) {
453-
if (type === 'PYTHON') {
454-
this.mainClass = ''
455-
}
466+
this.getTargetResourcesListJar(type)
456467
},
457468
// Watch the cacheParams
458469
cacheParams (val) {
@@ -511,13 +522,15 @@
511522
}
512523
},
513524
created () {
525+
this.getTargetResourcesListJar(this.programType)
514526
let item = this.store.state.dag.resourcesListS
515527
let items = this.store.state.dag.resourcesListJar
516528
diGuiTree(item)
517529
diGuiTree(items)
518530
this.mainJarList = item
519531
this.mainJarLists = items
520532
let o = this.backfillItem
533+
521534
// Non-null objects represent backfill
522535
if (!_.isEmpty(o)) {
523536
this.mainClass = o.params.mainClass || ''
@@ -570,9 +583,6 @@
570583
this.localParams = localParams
571584
}
572585
}
573-
},
574-
mounted () {
575-
576586
},
577587
components: { mLocalParams, mListBox, mList4Box, Treeselect }
578588
}

dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/mr.vue

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,12 @@
1919
<m-list-box>
2020
<div slot="text">{{$t('Program Type')}}</div>
2121
<div slot="content">
22-
<el-select v-model="programType" :disabled="isDetails" style="width: 110px;" size="small">
22+
<el-select
23+
v-model="programType"
24+
:disabled="isDetails"
25+
style="width: 110px;"
26+
size="small"
27+
@change="programTypeChange">
2328
<el-option
2429
v-for="city in programTypeList"
2530
:key="city.code"
@@ -42,9 +47,9 @@
4247
</div>
4348
</m-list-box>
4449
<m-list-box>
45-
<div slot="text">{{$t('Main Jar Package')}}</div>
50+
<div slot="text">{{$t('Main Package')}}</div>
4651
<div slot="content">
47-
<treeselect v-model="mainJar" maxHeight="200" :options="mainJarLists" :disable-branch-nodes="true" :normalizer="normalizer" :value-consists-of="valueConsistsOf" :disabled="isDetails" :placeholder="$t('Please enter main jar package')">
52+
<treeselect v-model="mainJar" maxHeight="200" :options="mainJarLists" :disable-branch-nodes="true" :normalizer="normalizer" :value-consists-of="valueConsistsOf" :disabled="isDetails" :placeholder="$t('Please enter main package')">
4853
<div slot="value-label" slot-scope="{ node }">{{ node.raw.fullName }}</div>
4954
</treeselect>
5055
</div>
@@ -118,6 +123,7 @@
118123
import disabledState from '@/module/mixin/disabledState'
119124
import Clipboard from 'clipboard'
120125
import { diGuiTree, searchTree } from './_source/resourceTree'
126+
import { mapActions } from 'vuex'
121127
122128
export default {
123129
name: 'mr',
@@ -144,9 +150,9 @@
144150
// Option parameters
145151
others: '',
146152
// Program type
147-
programType: 'JAVA',
153+
programType: 'SCALA',
148154
// Program type(List)
149-
programTypeList: [{ code: 'JAVA' }, { code: 'PYTHON' }],
155+
programTypeList: [{ code: 'JAVA' }, { code: 'SCALA' }, { code: 'PYTHON' }],
150156
normalizer (node) {
151157
return {
152158
label: node.name
@@ -161,6 +167,17 @@
161167
},
162168
mixins: [disabledState],
163169
methods: {
170+
...mapActions('dag', ['getResourcesListJar']),
171+
programTypeChange () {
172+
this.mainJar = null
173+
this.mainClass = ''
174+
},
175+
getTargetResourcesListJar (programType) {
176+
this.getResourcesListJar(programType).then(res => {
177+
diGuiTree(res)
178+
this.mainJarLists = res
179+
})
180+
},
164181
_copyPath (e, node) {
165182
e.stopPropagation()
166183
let clipboard = new Clipboard('.copy-path', {
@@ -268,7 +285,7 @@
268285
}
269286
270287
if (!this.mainJar) {
271-
this.$message.warning(`${i18n.$t('Please enter main jar package')}`)
288+
this.$message.warning(`${i18n.$t('Please enter main package')}`)
272289
return false
273290
}
274291
@@ -306,9 +323,7 @@
306323
* monitor
307324
*/
308325
programType (type) {
309-
if (type === 'PYTHON') {
310-
this.mainClass = ''
311-
}
326+
this.getTargetResourcesListJar(type)
312327
},
313328
// Watch the cacheParams
314329
cacheParams (val) {
@@ -361,6 +376,7 @@
361376
}
362377
},
363378
created () {
379+
this.getTargetResourcesListJar(this.programType)
364380
let item = this.store.state.dag.resourcesListS
365381
let items = this.store.state.dag.resourcesListJar
366382
diGuiTree(item)
@@ -378,11 +394,12 @@
378394
this.mainJar = ''
379395
} else {
380396
this.mainJar = o.params.mainJar.id || ''
397+
console.log(this.mainJar)
381398
}
382399
this.appName = o.params.appName || ''
383400
this.mainArgs = o.params.mainArgs || ''
384401
this.others = o.params.others
385-
this.programType = o.params.programType || 'JAVA'
402+
this.programType = o.params.programType || 'SCALA'
386403
387404
// backfill resourceList
388405
let resourceList = o.params.resourceList || []
@@ -414,9 +431,6 @@
414431
this.localParams = localParams
415432
}
416433
}
417-
},
418-
mounted () {
419-
420434
},
421435
components: { mLocalParams, mListBox, Treeselect }
422436
}

dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/spark.vue

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,11 @@
2020
<div slot="text">{{$t('Program Type')}}</div>
2121
<div slot="content">
2222
<el-select
23-
style="width: 130px;"
24-
size="small"
25-
v-model="programType"
26-
:disabled="isDetails">
23+
style="width: 130px;"
24+
size="small"
25+
v-model="programType"
26+
:disabled="isDetails"
27+
@change="programTypeChange">
2728
<el-option
2829
v-for="city in programTypeList"
2930
:key="city.code"
@@ -63,9 +64,9 @@
6364
</div>
6465
</m-list-box>
6566
<m-list-box>
66-
<div slot="text">{{$t('Main Jar Package')}}</div>
67+
<div slot="text">{{$t('Main Package')}}</div>
6768
<div slot="content">
68-
<treeselect v-model="mainJar" maxHeight="200" :options="mainJarLists" :disable-branch-nodes="true" :normalizer="normalizer" :disabled="isDetails" :placeholder="$t('Please enter main jar package')">
69+
<treeselect v-model="mainJar" maxHeight="200" :options="mainJarLists" :disable-branch-nodes="true" :normalizer="normalizer" :disabled="isDetails" :placeholder="$t('Please enter main package')">
6970
<div slot="value-label" slot-scope="{ node }">{{ node.raw.fullName }}</div>
7071
</treeselect>
7172
</div>
@@ -206,6 +207,7 @@
206207
import disabledState from '@/module/mixin/disabledState'
207208
import Clipboard from 'clipboard'
208209
import { diGuiTree, searchTree } from './_source/resourceTree'
210+
import { mapActions } from 'vuex'
209211
210212
export default {
211213
name: 'spark',
@@ -265,6 +267,17 @@
265267
},
266268
mixins: [disabledState],
267269
methods: {
270+
...mapActions('dag', ['getResourcesListJar']),
271+
programTypeChange () {
272+
this.mainJar = null
273+
this.mainClass = ''
274+
},
275+
getTargetResourcesListJar (programType) {
276+
this.getResourcesListJar(programType).then(res => {
277+
diGuiTree(res)
278+
this.mainJarLists = res
279+
})
280+
},
268281
_copyPath (e, node) {
269282
e.stopPropagation()
270283
let clipboard = new Clipboard('.copy-path', {
@@ -372,7 +385,7 @@
372385
}
373386
374387
if (!this.mainJar) {
375-
this.$message.warning(`${i18n.$t('Please enter main jar package')}`)
388+
this.$message.warning(`${i18n.$t('Please enter main package')}`)
376389
return false
377390
}
378391
@@ -469,9 +482,7 @@
469482
watch: {
470483
// Listening type
471484
programType (type) {
472-
if (type === 'PYTHON') {
473-
this.mainClass = ''
474-
}
485+
this.getTargetResourcesListJar(type)
475486
},
476487
// Watch the cacheParams
477488
cacheParams (val) {
@@ -531,6 +542,7 @@
531542
}
532543
},
533544
created () {
545+
this.getTargetResourcesListJar(this.programType)
534546
let item = this.store.state.dag.resourcesListS
535547
let items = this.store.state.dag.resourcesListJar
536548
diGuiTree(item)
@@ -591,9 +603,6 @@
591603
this.localParams = localParams
592604
}
593605
}
594-
},
595-
mounted () {
596-
597606
},
598607
components: { mLocalParams, mListBox, mList4Box, Treeselect }
599608
}

dolphinscheduler-ui/src/js/conf/home/pages/dag/definitionDetails.vue

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
props: {},
4747
methods: {
4848
...mapMutations('dag', ['resetParams', 'setIsDetails']),
49-
...mapActions('dag', ['getProjectList', 'getResourcesList', 'getProcessDetails', 'getResourcesListJar']),
49+
...mapActions('dag', ['getProjectList', 'getResourcesList', 'getProcessDetails']),
5050
...mapActions('security', ['getTenantList', 'getWorkerGroupsAll', 'getAlarmGroupsAll']),
5151
/**
5252
* init
@@ -63,8 +63,6 @@
6363
this.getProjectList(),
6464
// get resource
6565
this.getResourcesList(),
66-
// get jar
67-
this.getResourcesListJar(),
6866
// get worker group list
6967
this.getWorkerGroupsAll(),
7068
// get alarm group list

dolphinscheduler-ui/src/js/conf/home/pages/dag/index.vue

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
props: {},
4141
methods: {
4242
...mapMutations('dag', ['resetParams']),
43-
...mapActions('dag', ['getProjectList', 'getResourcesList', 'getResourcesListJar', 'getResourcesListJar']),
43+
...mapActions('dag', ['getProjectList', 'getResourcesList']),
4444
...mapActions('security', ['getTenantList', 'getWorkerGroupsAll', 'getAlarmGroupsAll']),
4545
/**
4646
* init
@@ -53,12 +53,8 @@
5353
Promise.all([
5454
// get project
5555
this.getProjectList(),
56-
// get jar
57-
this.getResourcesListJar(),
5856
// get resource
5957
this.getResourcesList(),
60-
// get jar
61-
this.getResourcesListJar(),
6258
// get worker group list
6359
this.getWorkerGroupsAll(),
6460
// get alarm group list

dolphinscheduler-ui/src/js/conf/home/pages/dag/instanceDetails.vue

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
props: {},
4444
methods: {
4545
...mapMutations('dag', ['setIsDetails', 'resetParams']),
46-
...mapActions('dag', ['getProjectList', 'getResourcesList', 'getInstancedetail', 'getResourcesListJar']),
46+
...mapActions('dag', ['getProjectList', 'getResourcesList', 'getInstancedetail']),
4747
...mapActions('security', ['getTenantList', 'getWorkerGroupsAll', 'getAlarmGroupsAll']),
4848
/**
4949
* init
@@ -60,8 +60,6 @@
6060
this.getProjectList(),
6161
// get resources
6262
this.getResourcesList(),
63-
// get jar
64-
this.getResourcesListJar(),
6563
// get worker group list
6664
this.getWorkerGroupsAll(),
6765
// get alarm group list

dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/taskDefinition/index.vue

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,7 @@
133133
...mapActions('dag', [
134134
'getProcessList',
135135
'getProjectList',
136-
'getResourcesList',
137-
'getResourcesListJar',
138-
'getResourcesListJar'
136+
'getResourcesList'
139137
]),
140138
...mapMutations('dag', ['resetParams', 'setIsDetails']),
141139
...mapActions('security', [
@@ -268,12 +266,8 @@
268266
this.getProcessList(),
269267
// get project
270268
this.getProjectList(),
271-
// get jar
272-
this.getResourcesListJar(),
273269
// get resource
274270
this.getResourcesList(),
275-
// get jar
276-
this.getResourcesListJar(),
277271
// get worker group list
278272
this.getWorkerGroupsAll(),
279273
// get alarm group list

0 commit comments

Comments
 (0)