ソースを参照

fix: 对齐后端接口与enum字段

hkshu12 5 年 前
コミット
29cdea6723
3 ファイル変更24 行追加7 行削除
  1. 4 0
      src/App.vue
  2. 2 1
      src/api/devcloud/pipeline.ts
  3. 18 6
      src/views/Project/Pipeline.vue

+ 4 - 0
src/App.vue

@@ -46,6 +46,10 @@ html, body {
   width: 100%;
 }
 
+div[role=tooltip] {
+  max-width: 30vw;
+}
+
 #app {
   font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB",
   "Microsoft YaHei","微软雅黑",Arial,sans-serif;

+ 2 - 1
src/api/devcloud/pipeline.ts

@@ -7,7 +7,8 @@ interface PipelinePayload {
   pipelineId: number;
 }
 
-type CreatePipelinePayload = PipelinePayload & {
+type CreatePipelinePayload = {
+  projectId: number;
   name: string;
   templateName: string;
 }

+ 18 - 6
src/views/Project/Pipeline.vue

@@ -37,15 +37,18 @@
           filter-placement="bottom-end"
         >
           <template #default="scope">
-            <template v-if="scope.row.result === '成功'">
+            <template v-if="scope.row.result === '部署成功'">
               <ElTag type="success">{{scope.row.result}}</ElTag>
             </template>
-            <template v-else-if="scope.row.result === '失败'">
+            <template v-else-if="scope.row.result === '部署失败'">
               <ElTag type="danger">{{scope.row.result}}</ElTag>
             </template>
-            <template v-else-if="scope.row.result === '执行中'">
+            <template v-else-if="scope.row.result === '部署中'">
               <ElTag>{{scope.row.result}}<i class="el-icon-loading"></i></ElTag>
             </template>
+            <template v-else-if="scope.row.result === '无执行记录'">
+              <ElTag>{{scope.row.result}}</ElTag>
+            </template>
             <template v-else>
               <ElTag type="warning">未知状态</ElTag>
             </template>
@@ -122,6 +125,7 @@
       <ElDialog
         v-loading="dialogLoading"
         v-model="showPipelineEditModal"
+        width="80%"
         destroy-on-close
       >
         <template #title>
@@ -131,9 +135,18 @@
           <ElStep
             v-for="(config, index) in pipelineConfig"
             :key="index"
-            :title="getStage(config.name).title"
-            :description="getStage(config.name).description"
           >
+          <template #title>
+            <span>{{getStage(config.name).title}}</span>
+            <ElTooltip
+            class="tooltip"
+              effect="dark"
+              :content="getStage(config.name).description"
+              placement="right-end"
+            >
+              <i class="el-icon-question"></i>
+            </ElTooltip>
+          </template>
           </ElStep>
         </ElSteps>
         <div class="edit-pipeline-form" v-for="(config, index) in pipelineConfig" :key="index" v-show="activeStep === index">
@@ -394,7 +407,6 @@ export default {
         if (valid) {
           await PipelineAPI.createPipeline({
             projectId: this.$store.state.workspace.currentProjectId,
-            pipelineId: this.editingPipelineId,
             name: this.createPipelineForm.name,
             templateName: this.createPipelineForm.template,
           });