From 2e6ef2bb8a63cd62319c153a46da9f5fa74ca332 Mon Sep 17 00:00:00 2001 From: dengbf Date: Tue, 16 Sep 2025 19:06:41 +0800 Subject: [PATCH] =?UTF-8?q?-=20[=E4=BF=AE=E5=A4=8D]=20#[1511726393032704]?= =?UTF-8?q?=E8=B6=85=E7=BA=A7=E6=B5=81=E6=B0=B4=E7=BA=BF=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E6=A0=A1=E9=AA=8C=E4=BF=9D=E5=AD=98=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=20http://192.168.0.96:8090/demo/rdm.html#/bug-detail/?= =?UTF-8?q?939050947543040/939050947543057/1511726393032704?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pipeline/edit-jobtemplate-dialog.vue | 53 +++++++++++-------- 1 file changed, 30 insertions(+), 23 deletions(-) diff --git a/src/views/pages/deploy/pipeline/edit-jobtemplate-dialog.vue b/src/views/pages/deploy/pipeline/edit-jobtemplate-dialog.vue index 8609ee52..c271f06e 100644 --- a/src/views/pages/deploy/pipeline/edit-jobtemplate-dialog.vue +++ b/src/views/pages/deploy/pipeline/edit-jobtemplate-dialog.vue @@ -20,17 +20,13 @@
{{ item.scenarioName }}
+
{{ moduleListValidTip }}
@@ -225,7 +222,8 @@ export default { text: this.$t('page.autoexecbatchround'), value: 'roundCount' } - ] + ], + moduleListValidTip: '' }; }, beforeCreate() {}, @@ -380,14 +378,16 @@ export default { this.updateInstanceList(env.id); }, save() { + let isValid = this.valid(); + this.moduleListValidTip = ''; + const moduleList = this.$refs?.moduleList.getData() || []; + if (!this.jobTemplateData.config) { + this.$set(this.jobTemplateData, 'config', {}); + } + if (this.$refs.param) { + this.$set(this.jobTemplateData.config, 'param', this.$refs.param.getValue()); + } if (!this.jobTemplateData.id && !this.jobTemplateData.uuid) { - if (!this.jobTemplateData.config) { - this.$set(this.jobTemplateData, 'config', {}); - } - if (this.$refs.param) { - this.$set(this.jobTemplateData.config, 'param', this.$refs.param.getValue()); - } - const moduleList = this.$refs?.moduleList.getData() || []; if (moduleList && moduleList.length > 0) { const jobTemplateList = []; moduleList.forEach(module => { @@ -398,21 +398,21 @@ export default { data.uuid = this.$utils.setUuid(); jobTemplateList.push(data); }); - this.$emit('insert', jobTemplateList); + if (isValid) { + this.$emit('insert', jobTemplateList); + } } else { - this.$Message.info(this.$t('form.placeholder.pleaseselect', {target: this.$t('page.module')})); + this.moduleListValidTip = this.$t('form.placeholder.pleaseselect', {target: this.$t('page.module')}); } } else { - const moduleList = this.$refs?.moduleList.getData() || []; if (moduleList && moduleList.length == 1) { const module = moduleList[0]; - if (!this.jobTemplateData.config) { - this.jobTemplateData.config = {}; - } this.jobTemplateData.config.selectNodeList = module.selectNodeList; - this.$emit('update', this.jobTemplateData); + if (isValid) { + this.$emit('update', this.jobTemplateData); + } } else { - this.$Message.info(this.$t('form.placeholder.pleaseselect', {target: this.$t('page.module')})); + this.moduleListValidTip = this.$t('form.placeholder.pleaseselect', {target: this.$t('page.module')}); } } }, @@ -469,6 +469,13 @@ export default { this.jobTemplateData.parallelCount = 2; } } + }, + valid() { + let isValid = true; + if (this.$refs.param && !this.$refs.param.valid()) { + isValid = false; + } + return isValid; } }, filter: {}, -- Gitee