Kaynağa Gözat

流水线针对测试步骤提供多选框

chenyitao.0928 5 yıl önce
ebeveyn
işleme
b56a2cbe8c
1 değiştirilmiş dosya ile 14 ekleme ve 2 silme
  1. 14 2
      src/views/Project/Pipeline.vue

+ 14 - 2
src/views/Project/Pipeline.vue

@@ -188,12 +188,22 @@
                 v-model="config.active"
               >启用该阶段</ElCheckbox>
             </div>
-            <ElFormItem v-for="(val, key) in config.configs" :key="key" :label="key">
+            <template v-for="(val, key) in config.configs" :key="key" placeholder="请选择">
+            <ElFormItem :label="key">
+              <ElSelect v-if="key === 'apiTestIds'" v-model="config.configs[key]" multiple >
+                <el-option
+                  v-for="item in apiTestOptions"
+                  :key="item.testId"
+                  :label="item.testName"
+                  :value="item.testId">
+                </el-option>
+              </ElSelect>
               <ElInput
                 :disabled="!getStage(config.name).configs.find((config) => config.name === key).editable"
                 v-model="config.configs[key]"
               ></ElInput>
             </ElFormItem>
+            </template>
           </ElForm>
         </div>
         <template #footer>
@@ -322,7 +332,7 @@
 </template>
 
 <script>
-import { PipelineAPI } from '@/api';
+import { APITestAPI, PipelineAPI } from '@/api';
 
 import { formatter } from '@/utils/time';
 
@@ -354,6 +364,7 @@ export default {
       showProductionLogModal: false,
       currentLogId: -1,
       currentLog: '',
+      apiTestOptions: [],
     };
   },
   computed: {
@@ -380,6 +391,7 @@ export default {
     this.productions = await PipelineAPI.getDeploymentsByProjectId(this.$store.state.workspace.currentProjectId);
     this.templates = await PipelineAPI.getPipelineTemplates();
     this.stages = await PipelineAPI.getStages();
+    this.apiTestOptions = await APITestAPI.getAPITestInfosByProjectId(this.$store.state.workspace.currentProjectId);
     this.loading = false;
   },
   methods: {