提交 52aaf0ec 编写于 作者: B break60

[Fix-3469][ui]The value of maintenance resources and the filtering of...

[Fix-3469][ui]The value of maintenance resources and the filtering of resources according to different program types
上级 45424ec2
......@@ -22,6 +22,7 @@
<x-select
style="width: 130px;"
v-model="programType"
@on-change="_onChange"
:disabled="isDetails">
<x-option
v-for="city in programTypeList"
......@@ -181,6 +182,8 @@
// Master jar package(List)
mainJarLists: [],
mainJarList: [],
jarList: [],
pyList: [],
// Deployment method
deployMode: 'cluster',
// Resource(list)
......@@ -221,6 +224,16 @@
},
mixins: [disabledState],
methods: {
/**
* programType change
*/
_onChange(o) {
if(o.value === 'PYTHON') {
this.mainJarLists = this.pyList
} else {
this.mainJarLists = this.jarList
}
},
/**
* getResourceId
*/
......@@ -396,12 +409,13 @@
if(optionsCmp.length>0) {
this.allNoResources = optionsCmp
optionsCmp = optionsCmp.map(item=>{
return {id: item.id,name: item.name,fullName: item.res}
return {id: item.id,name: item.name || item.res,fullName: item.res}
})
optionsCmp.forEach(item=>{
item.isNew = true
})
noResources[0].children = optionsCmp
this.mainJarList = _.filter(this.mainJarList, o=> { return o.id!==-1 })
this.mainJarList = this.mainJarList.concat(noResources)
}
}
......@@ -465,13 +479,24 @@
}
},
created () {
let o = this.backfillItem
let item = this.store.state.dag.resourcesListS
let items = this.store.state.dag.resourcesListJar
let pythonList = this.store.state.dag.resourcesListPy
this.diGuiTree(item)
this.diGuiTree(items)
this.diGuiTree(pythonList)
this.mainJarList = item
this.mainJarLists = items
let o = this.backfillItem
this.jarList = items
this.pyList = pythonList
if(!_.isEmpty(o) && o.params.programType === 'PYTHON') {
this.mainJarLists = pythonList
} else {
this.mainJarLists = items
}
// Non-null objects represent backfill
if (!_.isEmpty(o)) {
this.mainClass = o.params.mainClass || ''
......
......@@ -19,7 +19,7 @@
<m-list-box>
<div slot="text">{{$t('Program Type')}}</div>
<div slot="content">
<x-select v-model="programType" :disabled="isDetails" style="width: 110px;">
<x-select v-model="programType" @on-change="_onChange" :disabled="isDetails" style="width: 110px;">
<x-option
v-for="city in programTypeList"
:key="city.code"
......@@ -117,6 +117,8 @@
// Main jar package (List)
mainJarLists: [],
mainJarList: [],
jarList: [],
pyList: [],
// Resource(list)
resourceList: [],
// Cache ResourceList
......@@ -145,6 +147,16 @@
},
mixins: [disabledState],
methods: {
/**
* programType change
*/
_onChange(o) {
if(o.value === 'PYTHON') {
this.mainJarLists = this.pyList
} else {
this.mainJarLists = this.jarList
}
},
/**
* getResourceId
*/
......@@ -237,12 +249,13 @@
if(optionsCmp.length>0) {
this.allNoResources = optionsCmp
optionsCmp = optionsCmp.map(item=>{
return {id: item.id,name: item.name,fullName: item.res}
return {id: item.id,name: item.name || item.res,fullName: item.res}
})
optionsCmp.forEach(item=>{
item.isNew = true
})
noResources[0].children = optionsCmp
this.mainJarList = _.filter(this.mainJarList, o=> { return o.id!==-1 })
this.mainJarList = this.mainJarList.concat(noResources)
}
}
......@@ -343,13 +356,24 @@
}
},
created () {
let o = this.backfillItem
let item = this.store.state.dag.resourcesListS
let items = this.store.state.dag.resourcesListJar
let pythonList = this.store.state.dag.resourcesListPy
this.diGuiTree(item)
this.diGuiTree(items)
this.diGuiTree(pythonList)
this.mainJarList = item
this.mainJarLists = items
let o = this.backfillItem
this.jarList = items
this.pyList = pythonList
if(!_.isEmpty(o) && o.params.programType === 'PYTHON') {
this.mainJarLists = pythonList
} else {
this.mainJarLists = items
}
// Non-null objects represent backfill
if (!_.isEmpty(o)) {
......
......@@ -229,12 +229,13 @@
if(optionsCmp.length>0) {
this.allNoResources = optionsCmp
optionsCmp = optionsCmp.map(item=>{
return {id: item.id,name: item.name,fullName: item.res}
return {id: item.id,name: item.name || item.res,fullName: item.res}
})
optionsCmp.forEach(item=>{
item.isNew = true
})
noResources[0].children = optionsCmp
this.resourceOptions = _.filter(this.resourceOptions, o=> { return o.id!==-1 })
this.resourceOptions = this.resourceOptions.concat(noResources)
}
}
......
......@@ -267,12 +267,13 @@
if(optionsCmp.length>0) {
this.allNoResources = optionsCmp
optionsCmp = optionsCmp.map(item=>{
return {id: item.id,name: item.name,fullName: item.res}
return {id: item.id,name: item.name || item.res,fullName: item.res}
})
optionsCmp.forEach(item=>{
item.isNew = true
})
noResources[0].children = optionsCmp
this.options = _.filter(this.options, o=> { return o.id!==-1 })
this.options = this.options.concat(noResources)
}
}
......
......@@ -22,6 +22,7 @@
<x-select
style="width: 130px;"
v-model="programType"
@on-change="_onChange"
:disabled="isDetails">
<x-option
v-for="city in programTypeList"
......@@ -220,6 +221,8 @@
// Master jar package(List)
mainJarLists: [],
mainJarList: [],
jarList: [],
pyList: [],
// Deployment method
deployMode: 'cluster',
// Resource(list)
......@@ -264,6 +267,16 @@
},
mixins: [disabledState],
methods: {
/**
* programType change
*/
_onChange(o) {
if(o.value === 'PYTHON') {
this.mainJarLists = this.pyList
} else {
this.mainJarLists = this.jarList
}
},
/**
* getResourceId
*/
......@@ -356,12 +369,13 @@
if(optionsCmp.length>0) {
this.allNoResources = optionsCmp
optionsCmp = optionsCmp.map(item=>{
return {id: item.id,name: item.name,fullName: item.res}
return {id: item.id,name: item.name || item.res,fullName: item.res}
})
optionsCmp.forEach(item=>{
item.isNew = true
})
noResources[0].children = optionsCmp
this.mainJarList = _.filter(this.mainJarList, o=> { return o.id!==-1 })
this.mainJarList = this.mainJarList.concat(noResources)
}
}
......@@ -512,13 +526,22 @@
}
},
created () {
let o = this.backfillItem
let item = this.store.state.dag.resourcesListS
let items = this.store.state.dag.resourcesListJar
let pythonList = this.store.state.dag.resourcesListPy
this.diGuiTree(item)
this.diGuiTree(items)
this.diGuiTree(pythonList)
this.mainJarList = item
this.mainJarLists = items
let o = this.backfillItem
this.jarList = items
this.pyList = pythonList
if(!_.isEmpty(o) && o.params.programType === 'PYTHON') {
this.mainJarLists = pythonList
} else {
this.mainJarLists = items
}
// Non-null objects represent backfill
if (!_.isEmpty(o)) {
......
......@@ -62,6 +62,7 @@
this.getResourcesList(),
// get jar
this.getResourcesListJar(),
this.getResourcesListJar('PYTHON'),
// get worker group list
this.getWorkerGroupsAll(),
this.getTenantList()
......
......@@ -64,6 +64,7 @@
this.getResourcesList(),
// get jar
this.getResourcesListJar(),
this.getResourcesListJar('PYTHON'),
// get worker group list
this.getWorkerGroupsAll(),
this.getTenantList()
......
......@@ -374,16 +374,21 @@ export default {
/**
* get jar
*/
getResourcesListJar ({ state }) {
getResourcesListJar ({ state }, payload) {
return new Promise((resolve, reject) => {
if (state.resourcesListJar.length) {
resolve()
return
}
io.get('resources/list/jar', {
type: 'FILE'
type: 'FILE',
programType: payload
}, res => {
state.resourcesListJar = res.data
if(payload) {
state.resourcesListPy = res.data
} else {
state.resourcesListJar = res.data
}
resolve(res.data)
}).catch(res => {
reject(res)
......
......@@ -109,6 +109,7 @@ export default {
state.processListS = (payload && payload.processListS) || []
state.resourcesListS = (payload && payload.resourcesListS) || []
state.resourcesListJar = (payload && payload.resourcesListJar) || []
state.resourcesListPy = (payload && payload.resourcesListPy) || []
state.projectListS = (payload && payload.projectListS) || []
state.isDetails = (payload && payload.isDetails) || false
state.runFlag = (payload && payload.runFlag) || ''
......
......@@ -55,6 +55,8 @@ export default {
resourcesListS: [],
// tasks resourcesListJar
resourcesListJar: [],
// tasks resourcesListPy
resourcesListPy: [],
// tasks datasource Type
dsTypeListS: [
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册