Browse Source

worked out this issue (#14438)

3.2.1-prepare
calvin 1 year ago committed by GitHub
parent
commit
babb8d9d85
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 13
      dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-hive-cli.ts
  2. 6
      dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-resources.ts

13
dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-hive-cli.ts

@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { computed } from 'vue'
import { computed, watch, Ref, ref } from 'vue'
import { useI18n } from 'vue-i18n'
import { useCustomParams, useResources } from '.'
import type { IJsonItem } from '../types'
@ -24,13 +24,22 @@ export function useHiveCli(model: { [field: string]: any }): IJsonItem[] {
const hiveSqlScriptSpan = computed(() =>
model.hiveCliTaskExecutionType === 'SCRIPT' ? 24 : 0
)
const resourcesRequired = computed(() =>
const resourcesRequired = ref(
model.hiveCliTaskExecutionType === 'SCRIPT' ? false : true
)
const resourcesLimit = computed(() =>
model.hiveCliTaskExecutionType === 'SCRIPT' ? -1 : 1
)
watch(
() => model.hiveCliTaskExecutionType,
() => {
resourcesRequired.value =
model.hiveCliTaskExecutionType === 'SCRIPT' ? false : true
}
)
return [
{
type: 'select',

6
dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-resources.ts

@ -15,7 +15,7 @@
* limitations under the License.
*/
import { ref, onMounted, Ref } from 'vue'
import { ref, onMounted, Ref, isRef } from 'vue'
import { useI18n } from 'vue-i18n'
import { queryResourceList } from '@/service/modules/resources'
import { useTaskNodeStore } from '@/store/project/task-node'
@ -75,8 +75,8 @@ export function useResources(
trigger: ['input', 'blur'],
required: required,
validator(validate: any, value: IResource[]) {
if (required) {
if (!value) {
if (isRef(required) ? required.value : required) {
if (!value || value.length == 0) {
return new Error(t('project.node.resources_tips'))
}

Loading…
Cancel
Save