Browse Source

fix eslint: Unexpected side effect in 'cacheParams' computed property

pull/3/MERGE
chengshiwen 4 years ago
parent
commit
9234e46b22
  1. 29
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/flink.vue
  2. 29
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/mr.vue
  3. 29
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/python.vue
  4. 29
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/shell.vue
  5. 29
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/spark.vue
  6. 29
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/waterdrop.vue

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

@ -426,10 +426,22 @@
// Watch the cacheParams // Watch the cacheParams
cacheParams (val) { cacheParams (val) {
this.$emit('on-cache-params', val) this.$emit('on-cache-params', val)
},
resourceIdArr (arr) {
let result = []
arr.forEach(item => {
this.allNoResources.forEach(item1 => {
if (item.id === item1.id) {
// resultBool = true
result.push(item1)
}
})
})
this.noRes = result
} }
}, },
computed: { computed: {
cacheParams () { resourceIdArr () {
let isResourceId = [] let isResourceId = []
let resourceIdArr = [] let resourceIdArr = []
if (this.resourceList.length > 0) { if (this.resourceList.length > 0) {
@ -444,23 +456,16 @@
return { id: item.id, name: item.name, res: item.fullName } return { id: item.id, name: item.name, res: item.fullName }
}) })
} }
let result = [] return resourceIdArr
resourceIdArr.forEach(item => { },
this.allNoResources.forEach(item1 => { cacheParams () {
if (item.id === item1.id) {
// resultBool = true
result.push(item1)
}
})
})
this.noRes = result
return { return {
mainClass: this.mainClass, mainClass: this.mainClass,
mainJar: { mainJar: {
id: this.mainJar id: this.mainJar
}, },
deployMode: this.deployMode, deployMode: this.deployMode,
resourceList: resourceIdArr, resourceList: this.resourceIdArr,
localParams: this.localParams, localParams: this.localParams,
slot: this.slot, slot: this.slot,
taskManager: this.taskManager, taskManager: this.taskManager,

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

@ -303,10 +303,22 @@
// Watch the cacheParams // Watch the cacheParams
cacheParams (val) { cacheParams (val) {
this.$emit('on-cache-params', val) this.$emit('on-cache-params', val)
},
resourceIdArr (arr) {
let result = []
arr.forEach(item => {
this.allNoResources.forEach(item1 => {
if (item.id === item1.id) {
// resultBool = true
result.push(item1)
}
})
})
this.noRes = result
} }
}, },
computed: { computed: {
cacheParams () { resourceIdArr () {
let isResourceId = [] let isResourceId = []
let resourceIdArr = [] let resourceIdArr = []
if (this.resourceList.length > 0) { if (this.resourceList.length > 0) {
@ -321,22 +333,15 @@
return { id: item.id, name: item.name, res: item.fullName } return { id: item.id, name: item.name, res: item.fullName }
}) })
} }
let result = [] return resourceIdArr
resourceIdArr.forEach(item => { },
this.allNoResources.forEach(item1 => { cacheParams () {
if (item.id === item1.id) {
// resultBool = true
result.push(item1)
}
})
})
this.noRes = result
return { return {
mainClass: this.mainClass, mainClass: this.mainClass,
mainJar: { mainJar: {
id: this.mainJar id: this.mainJar
}, },
resourceList: resourceIdArr, resourceList: this.resourceIdArr,
localParams: this.localParams, localParams: this.localParams,
mainArgs: this.mainArgs, mainArgs: this.mainArgs,
others: this.others, others: this.others,

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

@ -259,10 +259,22 @@
// Watch the cacheParams // Watch the cacheParams
cacheParams (val) { cacheParams (val) {
this.$emit('on-cache-params', val) this.$emit('on-cache-params', val)
},
resourceIdArr (arr) {
let result = []
arr.forEach(item => {
this.allNoResources.forEach(item1 => {
if (item.id === item1.id) {
// resultBool = true
result.push(item1)
}
})
})
this.noRes = result
} }
}, },
computed: { computed: {
cacheParams () { resourceIdArr () {
let isResourceId = [] let isResourceId = []
let resourceIdArr = [] let resourceIdArr = []
if (this.resourceList.length > 0) { if (this.resourceList.length > 0) {
@ -277,18 +289,11 @@
return { id: item.id, name: item.name, res: item.fullName } return { id: item.id, name: item.name, res: item.fullName }
}) })
} }
let result = [] return resourceIdArr
resourceIdArr.forEach(item => { },
this.allNoResources.forEach(item1 => { cacheParams () {
if (item.id === item1.id) {
// resultBool = true
result.push(item1)
}
})
})
this.noRes = result
return { return {
resourceList: resourceIdArr, resourceList: this.resourceIdArr,
localParams: this.localParams localParams: this.localParams
} }
} }

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

@ -268,10 +268,22 @@
// Watch the cacheParams // Watch the cacheParams
cacheParams (val) { cacheParams (val) {
this.$emit('on-cache-params', val) this.$emit('on-cache-params', val)
},
resourceIdArr (arr) {
let result = []
arr.forEach(item => {
this.allNoResources.forEach(item1 => {
if (item.id === item1.id) {
// resultBool = true
result.push(item1)
}
})
})
this.noRes = result
} }
}, },
computed: { computed: {
cacheParams () { resourceIdArr () {
let isResourceId = [] let isResourceId = []
let resourceIdArr = [] let resourceIdArr = []
if (this.resourceList.length > 0) { if (this.resourceList.length > 0) {
@ -286,18 +298,11 @@
return { id: item.id, name: item.name, res: item.fullName } return { id: item.id, name: item.name, res: item.fullName }
}) })
} }
let result = [] return resourceIdArr
resourceIdArr.forEach(item => { },
this.allNoResources.forEach(item1 => { cacheParams () {
if (item.id === item1.id) {
// resultBool = true
result.push(item1)
}
})
})
this.noRes = result
return { return {
resourceList: resourceIdArr, resourceList: this.resourceIdArr,
localParams: this.localParams localParams: this.localParams
} }
} }

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

@ -457,10 +457,22 @@
// Watch the cacheParams // Watch the cacheParams
cacheParams (val) { cacheParams (val) {
this.$emit('on-cache-params', val) this.$emit('on-cache-params', val)
},
resourceIdArr (arr) {
let result = []
arr.forEach(item => {
this.allNoResources.forEach(item1 => {
if (item.id === item1.id) {
// resultBool = true
result.push(item1)
}
})
})
this.noRes = result
} }
}, },
computed: { computed: {
cacheParams () { resourceIdArr () {
let isResourceId = [] let isResourceId = []
let resourceIdArr = [] let resourceIdArr = []
if (this.resourceList.length > 0) { if (this.resourceList.length > 0) {
@ -475,23 +487,16 @@
return { id: item.id, name: item.name, res: item.fullName } return { id: item.id, name: item.name, res: item.fullName }
}) })
} }
let result = [] return resourceIdArr
resourceIdArr.forEach(item => { },
this.allNoResources.forEach(item1 => { cacheParams () {
if (item.id === item1.id) {
// resultBool = true
result.push(item1)
}
})
})
this.noRes = result
return { return {
mainClass: this.mainClass, mainClass: this.mainClass,
mainJar: { mainJar: {
id: this.mainJar id: this.mainJar
}, },
deployMode: this.deployMode, deployMode: this.deployMode,
resourceList: resourceIdArr, resourceList: this.resourceIdArr,
localParams: this.localParams, localParams: this.localParams,
driverCores: this.driverCores, driverCores: this.driverCores,
driverMemory: this.driverMemory, driverMemory: this.driverMemory,

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

@ -312,6 +312,18 @@
this.resourceNameVal = val this.resourceNameVal = val
this.$emit('on-cache-params', val) this.$emit('on-cache-params', val)
}, },
resourceIdArr (arr) {
let result = []
arr.forEach(item => {
this.allNoResources.forEach(item1 => {
if (item.id === item1.id) {
// resultBool = true
result.push(item1)
}
})
})
this.noRes = result
},
master: { master: {
handler (code) { handler (code) {
if (code === 'spark://') { if (code === 'spark://') {
@ -326,7 +338,7 @@
} }
}, },
computed: { computed: {
cacheParams () { resourceIdArr () {
let isResourceId = [] let isResourceId = []
let resourceIdArr = [] let resourceIdArr = []
if (this.resourceList.length > 0) { if (this.resourceList.length > 0) {
@ -341,18 +353,11 @@
return { id: item.id, name: item.name, res: item.fullName } return { id: item.id, name: item.name, res: item.fullName }
}) })
} }
let result = [] return resourceIdArr
resourceIdArr.forEach(item => { },
this.allNoResources.forEach(item1 => { cacheParams () {
if (item.id === item1.id) {
// resultBool = true
result.push(item1)
}
})
})
this.noRes = result
return { return {
resourceList: resourceIdArr, resourceList: this.resourceIdArr,
localParams: this.localParams, localParams: this.localParams,
deployMode: this.deployMode, deployMode: this.deployMode,
master: this.master, master: this.master,

Loading…
Cancel
Save