deepsea 1 year ago
parent
commit
cadf687e59

+ 9 - 1
src/api/bench.js

@@ -24,4 +24,12 @@ export const createProduct = (data) => {
     method: "POST",
     data,
   });
-};
+};
+
+export const getMatchedBench = (data) => {
+  console.log('httpRequest-' + 'getMatchedBench');
+  return api('/arbitrator/match', {
+    method: "POST",
+    data
+  });
+}

+ 88 - 1
src/components/TabList/index.vue

@@ -117,6 +117,7 @@
                     <el-table-column label="status" prop="status"></el-table-column>
                 </el-table>
             </div>
+            <el-button @click="submitAutoCase" class="done-button">Done</el-button>
         </div>
         <div class="plan task-item case-submit" v-if="isShowCaseCommit && isShowTaskList===false">
           <div class="go-back">
@@ -180,6 +181,57 @@
             <el-button class="cancel-button" @click="clickBackToCaseList">Cancel</el-button>
             <el-button class="done-button" @click="doManualCase">Done</el-button>
         </div>
+        <div class="plan task-item case-submit" v-if="isShowAutoCaseCommit && isShowTaskList===false">
+          <div class="go-back">
+            <div class="el-icon-arrow-left" @click="clickBackToAutoCaseList"></div>
+            <div>{{ caseName }}</div>
+          </div>
+          <div class="control-panel">
+            <el-col :span=12>
+              <el-select v-model="projectValue" placeholder="Project" class="select-container" @change="autoCaseFilterChange">
+                <el-option
+                v-for="option in projectOptions"
+                :key="option.value"
+                :label="option.label"
+                :value="option.value"
+                ></el-option>
+            </el-select>
+            </el-col>
+            <el-col :span=12>
+                <el-select v-model="marketValue" placeholder="Market"  class="select-container" @change="autoCaseFilterChange">
+                    <el-option
+                    v-for="option in marketOptions"
+                    :key="option.value"
+                    :label="option.label"
+                    :value="option.value"
+                    ></el-option>
+                </el-select>
+            </el-col>
+            <el-col :span=12>
+                <el-select v-model="clusterValue" placeholder="Cluster"  class="select-container" @change="autoCaseFilterChange">
+                    <el-option
+                    v-for="option in clusterOptions"
+                    :key="option.value"
+                    :label="option.label"
+                    :value="option.value"
+                    ></el-option>
+                </el-select>
+            </el-col>
+            <el-col :span=12>
+                <el-select v-model="carlineValue" placeholder="Carline" class="select-container" @change="autoCaseFilterChange">
+                    <el-option
+                    v-for="option in carlineOptions"
+                    :key="option.value"
+                    :label="option.label"
+                    :value="option.value"
+                    ></el-option>
+                </el-select>
+            </el-col>
+          </div>
+            
+            <el-button class="cancel-button" @click="clickBackToAutoCaseList">Cancel</el-button>
+            <el-button class="done-button" @click="submitAutoCase">Start</el-button>
+        </div>
         <div class="case task-item" v-if="isShowCaseDetail && isShowTaskList===false">
           <div class="go-back">
             <div class="el-icon-arrow-left" @click="clickBackToPlan"></div>
@@ -247,12 +299,14 @@ export default {
       type: String
     },
     currentIssue: Object,
+    currentPlanId: String | Number,
     isShowTaskList: Boolean,
     isShowPlanList: Boolean,
     isShowCaseList: Boolean,
     isShowAutoCaseList: Boolean,
     isShowCaseDetail: Boolean,
     isShowCaseCommit: Boolean,
+    isShowAutoCaseCommit: Boolean,
     isShowIssueDetail: Boolean,
     taskName: String,
     planList: Array,
@@ -276,7 +330,9 @@ export default {
     clickBackToPlan: Function,
     submitManualCase: Function,
     clickBackToCaseList: Function,
-    clickBackToIssueList: Function
+    clickBackToIssueList: Function,
+    submitAutoCase: Function,
+    clickBackToAutoCaseList: Function
   },
   data() {
     return {
@@ -324,6 +380,23 @@ export default {
       }
     })
   },
+  mounted() {
+    let that = this;
+    this.$nextTick(() => {
+      if(that.isShowAutoCaseCommit) {
+        let data = {
+          Carline: that.carlineValue,
+          Cluster: that.clusterValue,
+          Market: that.marketValue,
+          Project: that.projectValue,
+          plan_id: that.currentPlanId,
+          repeat_times: 1,
+          skips: [],
+        }
+        that.$store.dispatch('benchList/getMatchedBench', data);
+      }
+    })
+  },
   methods: {
     changeTab(index) {
       console.log('tab 切换 index', index);
@@ -334,6 +407,20 @@ export default {
     },
     cancelManualCase() {
 
+    },
+    autoCaseFilterChange() {
+      if(this.isShowAutoCaseCommit) {
+        let data = {
+          Carline: this.carlineValue,
+          Cluster: this.clusterValue,
+          Market: this.marketValue,
+          Project: this.projectValue,
+          plan_id: this.currentPlanId,
+          repeat_times: 1,
+          skips: [],
+        }
+        this.$store.dispatch('benchList/getMatchedBench', data);
+      }
     }
   }
 };

+ 4 - 0
src/store/modules/bench/actions.js

@@ -18,6 +18,10 @@ export default {
       console.log("error", "服务异常", 1000);
     }
   },
+  async getMatchedBench({commit}, data) {
+    let benchList = benchApi.getMatchedBench(data);
+    commit("setMatchedBenchList", benchList.data)
+  },
   async getBenchDetail({commit}, benchId) {
     try {
       const bench = await benchApi.getBenchDetail(benchId);

+ 2 - 1
src/store/modules/bench/index.js

@@ -14,7 +14,8 @@ export default {
       carlineOptions:[],
       variantOptions:[],
       clusterOptions:[],
-      marketOptions:[]
+      marketOptions:[],
+      matchedBenchList:[]
     };
   },
   mutations,

+ 7 - 0
src/store/modules/bench/mutations.js

@@ -94,6 +94,13 @@ export default {
 
 
 
+  },
+  setMatchedBenchList(state, benchList) {
+    // benchList.forEach(b => {
+    //   if(!state.matchedBenchList.some(m => m.id == b.id)) {
+    //     state.matchedBenchList.push(b);
+    //   }
+    // })
   },
   setBenchImgList(state, data) {
     if (!state.benchImgList.some(b => b.alt == data.benchId)) {

+ 11 - 0
src/store/modules/common/mutations.js

@@ -6,6 +6,7 @@ export default {
     let result = options.mantis_result;
     let type = options.mantis_tb_type;
     let variant = options.mantis_variant;
+    let project = options.mantis_project;
 
     for(let key in cluster) {
       let value = cluster[key];
@@ -17,6 +18,16 @@ export default {
       }
     }
 
+    for(let key in project) {
+      let value = project[key];
+      if (!state.projectOptions.some(s => s.value == value)) {
+        state.projectOptions.push({
+          value: value,
+          label: value
+        })
+      }
+    }
+
     for(let key in variant) {
       let value = variant[key];
       if (!state.variantOptions.some(s => s.value == value)) {

+ 15 - 3
src/views/ordinaryPage/index.vue

@@ -223,10 +223,10 @@
             <TabList :tabs="tabs" :itemRender="itemRender" :planRender="planRender" :taskRender="taskRender" :issueRender="issueRender" :planList="planList" :caseList="caseList" :autoCaseList="autoCaseList" :is-show-auto-case-list="isShowAutoCaseList" :planName="planName" :taskName="taskName" :caseName="caseName"
             :is-show-plan-list="isShowPlanList" :is-show-task-list="isShowTaskList" :is-show-case-commit="isShowCaseCommit" :is-show-case-list="isShowCaseList" :is-show-case-detail="isShowCaseDetail" :clickBackToTaskList="clickBackToTaskList" 
             :clickBackToPlanList="clickBackToPlanList" :selectRowPlan="selectRowPlan" :caseProject="caseProject" 
-            :caseActive="caseActive" :caseFunction="caseFunction" caseContent="caseContent" 
+            :caseActive="caseActive" :caseFunction="caseFunction" caseContent="caseContent" :isShowAutoCaseCommit="isShowAutoCaseCommit"
             :caseSubFunction="caseSubFunction" :caseMarket="caseMarket" :caseLanguage="caseLanguage" v-if="renderBenchList" 
             :selectRowCase="selectRowCase" :clickBackToAutoPlanList="clickBackToAutoPlanList" :tabClass="tabClass" :planBack="planBack" :clickBackToPlan="clickBackToPlan" :submitManualCase="submitManualCase" :clickBackToCaseList="clickBackToCaseList"
-            :isShowIssueList="isShowIssueList" :isShowIssueDetail="isShowIssueDetail" :currentIssue="currentIssue"></TabList>
+            :isShowIssueList="isShowIssueList" :isShowIssueDetail="isShowIssueDetail" :currentIssue="currentIssue" :currentPlanId="currentPlanId" :submitAutoCase="submitAutoCase" :clickBackToAutoCaseList="clickBackToAutoCaseList" :clickBackToIssueList="clickBackToIssueList"></TabList>
         </div>
 
         <bench-detail :is-detail-visible="isDetailVisible" :is-remote-btn-visible="isRemoteBtnVisible" :closeDetail="closeDetail" ref="benchdetail" :bench="currentBench"/>
@@ -265,6 +265,7 @@
                 isShowCaseCommit: false,
                 isShowIssueList: true,
                 isShowIssueDetail: false,
+                isShowAutoCaseCommit: false,
                 taskName: '',
                 planName: '',
                 caseName: '',
@@ -288,6 +289,7 @@
                 filters: [],
                 currentCase: null,
                 currentIssue: null,
+                currentPlanId: null,
                 tabs: [
                     {
                     title: 'Bench',
@@ -509,9 +511,18 @@
               this.isShowAutoCaseList = true;
             }
           },
+          submitAutoCase() {
+            this.isShowAutoCaseList = false;
+            this.isShowAutoCaseCommit = true;
+          },
+          clickBackToAutoCaseList() {
+            this.isShowAutoCaseList = true;
+            this.isShowAutoCaseCommit = false;
+          },
           selectRowPlan(id, auto, name){
             console.log(id, 'selectrowdata')
             if (!auto || auto == 'undefined' || auto == 'false') {
+              this.currentPlanId = id;
               this.$store.dispatch('caseList/fetchCaseList',{
                   uuid: id,
                   page_num: 1,
@@ -521,13 +532,14 @@
               sessionStorage.setItem('autoCase', 0)
             } else {
               if (id == 109) id = 222; 
+              this.currentPlanId = id;
               this.$store.dispatch('caseList/fetchAutoCaseList', {
                 planId: id
               })
               this.isShowAutoCaseList = true;
               sessionStorage.setItem('autoCase', 1)
-              
             }
+
             this.$store.dispatch('common/fetchOptionList');
 
             this.isShowPlanList = false;

+ 5 - 0
vue.config.js

@@ -29,6 +29,11 @@ module.exports = defineConfig({
         changeOrigin: true, //需要代理跨域
         rewrite: (path) => path.replace(/^\/tts-test/, ''), //路径重写,把'/api'替换为''
       },
+      '/arbitrator': {
+        target: 'http://139.196.158.57:8080', //需要代理的域名,目标域名
+        changeOrigin: true, //需要代理跨域
+        rewrite: (path) => path.replace(/^\/arbitrator/, ''), //路径重写,把'/api'替换为''
+      },
     },
   },
 });