Browse Source

Merge branch 'master' of http://121.42.8.157:13000/zengminguo/D-MAP

hao lei 1 year ago
parent
commit
0ccb1afb68

+ 6 - 0
src/api/plan.js

@@ -49,3 +49,9 @@ export const getPlanResult = (data) => {
         param
     });
 }
+
+export const getAutoPlanDetail = (planId) => {
+  return api('/plan/'+planId, {
+    method: 'GET'
+  })
+}

+ 23 - 2
src/components/TabList/index.vue

@@ -37,7 +37,7 @@
           </div>
         </div>
         <div class="task task-item" v-if="isShowPlanList && isShowTaskList===false">
-          <div style="margin-bottom: 1.85vh" id="TaskHeaderName" @click="clickBackToTaskList">{{taskName}}</div>
+          <!-- <div style="margin-bottom: 1.85vh" id="TaskHeaderName" @click="clickBackToTaskList">{{taskName}}</div>
           <div class="task-table">
               <el-table @row-click="selectRowPlan" :data="planList" :row-class-name="rowClassName"  style="background-color: transparent;" >
                   <el-table-column label="M-ID" prop="id"></el-table-column>
@@ -45,6 +45,13 @@
                   <el-table-column label="Avaliable Carline" prop="carline"></el-table-column>
                   <el-table-column label="Avaliable Variant" prop="project"></el-table-column>
               </el-table>
+          </div> -->
+          <div class="go-back">
+              <div class="el-icon-arrow-left" @click="planBack"></div>
+              <div>{{ taskName }}</div>
+            </div>
+          <div v-for="(item, index) in planList" :key="index" class="item" v-if="!(!item.auto && !item.uuid)">
+            <div v-html="planRender(item)"></div>
           </div>
         </div>
         <div class="task task-item" v-if="isShowCaseList && isShowTaskList===false">
@@ -177,16 +184,24 @@ export default {
     },
     TextTrackListRender: {
       type: Function,
-      required: true
+      required: false
     },
     taskRender: {
       type: Function,
       required: true
     },
+    planRender: {
+      type: Function,
+      required: true
+    },
     issueRender: {
       type: Function,
       required: true
     },
+    planBack: {
+      type: Function,
+      required: true
+    },
     size: {
         type: String,
     },
@@ -241,6 +256,12 @@ export default {
 </script>
 
 <style scoped lang="less">
+.go-back {
+  color: #fff;
+  display: flex;
+  margin-bottom: 10px;
+  align-items: center;
+}
 .tabs {
     display: flex;
     flex-direction: column;

+ 9 - 1
src/store/modules/plan/actions.js

@@ -5,7 +5,7 @@ export default {
     try {
       const planList = await planApi.fetchPlanList(data)
       console.log('planList',planList);
-      commit("setPlanList", planList.data.data);
+      commit("setMaualPlanList", planList.data.data);
     } catch (err) {
       console.log("error", "服务异常", 1000);
     }
@@ -17,5 +17,13 @@ export default {
     } catch (err) {
       console.log("error", "服务异常", 1000);
     }
+  },
+  async fetchPlanDetail({ commit }, data) {
+    try {
+      const detail = await planApi.getAutoPlanDetail(data.planId)
+      commit('setAutoPlanDetail', detail)
+    } catch (err) {
+      console.log("error", "服务异常", 1000);
+    }
   }
 };

+ 73 - 4
src/store/modules/plan/mutations.js

@@ -1,20 +1,89 @@
 export default {
   setPlanList(state, planList) {
-    planList.forEach((plan) => {
-      if(!state.planList.some(p => p.id == plan.id)) {
+    debugger
+    planList.forEach((planId) => {
+      debugger
+      if(!state.planList.some(p => p.id == planId)) {
+        let plan = {};
+        plan.id = planId;
         plan.checked = false;
+        plan.carline = [];
+        plan.case_list = [109, 110, 111, 112, 113]
+        plan.cluster = 1
+        plan.create_time = ""
+        plan.creator = ""
+        plan.delete_flag = 0
+        plan.description = ""
+        plan.function = [1, 2]
+        plan.language = [1, 2]
+        plan.level = [1, 2]
+        plan.market = [1, 2]
+        plan.name = ""
+        plan.platform = [1, 2]
+        plan.project = [1, 2]
+        plan.sub_function = [1, 2]
+        plan.update_time = ""
+        plan.uuid = ""
         state.planList.push(plan)
       }
     });
   },
+  setMaualPlanList(state, planList) {
+    let maualPlanList = state.planList;
+    maualPlanList.forEach(p => {
+      debugger
+      let plan = planList.find(s => s.id == p.id);
+      if (plan) {
+        for(let key in p) {
+          p[key] = plan[key];
+        }
+      }
+      
+    })
+  },
   setAutoPlanList(state, planList) {
-    planList.forEach((plan) => {
-      if(!state.autoPlanList.some(p => p.id == plan.id)) {
+    planList.forEach((planId) => {
+      if(!state.autoPlanList.some(p => p.id == planId)) {
+        let plan = {}
+        plan.id = planId + 101;
         plan.checked = false;
+        plan.active_time = null
+        plan.active_user = null
+        plan.case_quantity = 5
+        plan.comment = null
+        plan.create_time = "2023-04-21T06:55:18.403Z"
+        plan.create_user = "testserver@audi.com.cn"
+        plan.create_user_name = "testserver@audi.com.cn"
+        plan.description =  ""
+        plan.is_delete = 1
+        plan.lastrun_time = null
+        plan.modify_time =  null
+        plan.modify_user = null
+        plan.modify_user_name = null
+        plan.name = "testplan"
+        plan.repeats =  ["1", "1", "1", "1", "1"]
+        plan.repository = "repo3"
+        plan.skips = ["not", "not", "not", "not", "not"]
+        plan.skips_count = 0
+        plan.task_array = null
+        plan.task_quantity = null
+        plan.testcase_array = [2863, 2824, 2915, 2820, 2722]
+        plan.type = null
+        plan.auto = true;
         state.autoPlanList.push(plan)
       }
     });
   },
+  setAutoPlanDetail(state, planDetail) {
+    planDetail = planDetail.data;
+    let id = planDetail.id;
+    let detail = state.autoPlanList.find(p => p.id == id);
+    if (detail) {
+      for (let key in planDetail) {
+        detail[key] = planDetail[key];
+      }
+    }
+  },
   setTaskList(state, taskList) {
     taskList.forEach((task) => {
       if(!state.taskList.some(p => p.id == task.id)) {

+ 0 - 19
src/store/modules/task/actions.js

@@ -1,25 +1,6 @@
 import * as taskApi from "../../../api/task.js";
 
 export default {
-  async fetchBenchList({ commit }) {
-    try {
-      const benchList = await taskApi.fetchBenchList()
-      commit("setBenchList", benchList.data);
-    } catch (err) {
-      console.log("error", "服务异常", 1000);
-    }
-  },
-  async getBenchDetail({commit}, benchId) {
-    try {
-      const bench = await taskApi.getBenchDetail(benchId);
-      commit("setBenchDetail", bench.data)
-    } catch (err) {
-      console.log("error", "服务异常", 1000)
-    }
-  },
-  setBenchImgList({commit}, benchId, img) {
-    commit(benchId, img)
-  },
   async fetchTaskList({ commit }, data) {
     try {
       const taskList = await taskApi.fetchTaskList(data)

+ 1 - 13
src/store/modules/task/mutations.js

@@ -1,23 +1,11 @@
 export default {
-  setAllBillings(state, billings) {
-    state.allBillings = billings;
-  },
-  setMyBillings(state, billings) {
-    state.myBillings = billings;
-  },
-  addToAllBillings(state, billings) {
-    state.allBillings.push(...billings);
-  },
-  addToMyBillings(state, billings) {
-    state.myBillings.push(...billings);
-  },
   setTaskList(state, taskList) {
     console.log('setTaskList',taskList);
     taskList.forEach((task, i) => {
       if(!state.taskList.some(t => t.id == task.id)) {
         task.checked = false;
         task.itemtype = 2;
-        i % 2 == 0 ? (task.auto = true) : (task.auto = false)
+        task.auto = false;
         state.taskList.push(task)
       }
     });

+ 17 - 5
src/views/ordinaryPage/index.less

@@ -136,7 +136,9 @@
         .item-tag {
           display: flex;
           margin-top: 0vh;
-          width: 10vw;
+          width: 12vw;
+          // width: max-content;
+          overflow: auto;
           .tag {
             margin-bottom: 0.2vh;
             //width: 3.13vw;
@@ -148,6 +150,8 @@
             border-radius: 10px;
             color: #f2f2f2;
             margin-right: 0.2vw;
+            padding: 0px 10px;
+            width: max-content;
           }
         }
       }
@@ -209,10 +213,7 @@
       font-weight: 400;
       color: #fbfbfb;
       line-height: 4.17vh;
-      width: 150px;
-      overflow: hidden;
-      text-overflow: ellipsis;
-      white-space: nowrap;
+      // width: 150px;
     }
     .item-description {
       margin-top: 0.37vh;
@@ -371,4 +372,15 @@
   color: #fff;
   text-align: center;
   margin-left: 10px;
+}
+
+.plan-tag {
+  margin-bottom: 0.2vh;
+  font-size: xx-small;
+  padding: 5px 10px;
+  text-align: center;
+  background-color: #5d9a6d;
+  border-radius: 10px;
+  color: #f2f2f2;
+  margin-right: 0.2vw;
 }

+ 51 - 28
src/views/ordinaryPage/index.vue

@@ -220,12 +220,12 @@
         </div>
 
         <div class="ordinary-list">
-            <TabList :tabs="tabs" :itemRender="itemRender" :taskRender="taskRender" :issueRender="issueRender" :planList="planList" :caseList="caseList" :planName="planName" :taskName="taskName" :caseName="caseName"
+            <TabList :tabs="tabs" :itemRender="itemRender" :planRender="planRender" :taskRender="taskRender" :issueRender="issueRender" :planList="planList" :caseList="caseList" :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" 
             :caseSubFunction="caseSubFunction" :caseMarket="caseMarket" :caseLanguage="caseLanguage" v-if="renderBenchList" 
-            :selectRowCase="selectRowCase" :tabClass="tabClass"></TabList>
+            :selectRowCase="selectRowCase" :tabClass="tabClass" :planBack="planBack"></TabList>
         </div>
 
         <bench-detail :is-detail-visible="isDetailVisible" :is-remote-btn-visible="isRemoteBtnVisible" :closeDetail="closeDetail" ref="benchdetail" :bench="currentBench"/>
@@ -372,7 +372,10 @@
                   return state.taskList.taskList;
               },
               planList: state => {
-                return state.planList.planList;
+                console.log(state.planList.planList, 'planList==============');
+                let planList = state.planList.planList.concat(state.planList.autoPlanList);
+                planList = planList.sort((p1, p2) => p1.id - p2.id);
+                return planList;
               },
               caseList: state => {
                 return state.caseList.caseList;
@@ -421,7 +424,7 @@
                 "ticket_status": 0,
                 "ticket_type": 0
             })
-            //that.$store.dispatch('planList/fetchPlanList');
+            // that.$store.dispatch('planList/fetchPlanList');
             //setInterval(() => {
             //  that.$store.dispatch('benchList/fetchBenchList');
             //}, 1500)
@@ -471,7 +474,7 @@
           clickBackToTaskList() {
             this.isShowPlanList = false;
             this.isShowTaskList = true;
-            this.planList = [];
+            // this.planList = [];
           },
           selectRowPlan(row){
             console.log(row, 'selectrowdata')
@@ -575,25 +578,26 @@
                 this.isOpen = false;
             },
             handleClickTask(taskId, auto) {
-              that.$store.dispatch('planList/fetchPlanList', {
-                page_num: 1,
-                page_size: 100,
-                task_id: ""
+              let task = that.taskList.find(t => t.id == taskId);
+              // 获取手动测试plan列表
+              let manualList = task.plan_list[1];
+              // 获取自动测试plan列表
+              let autoList = task.plan_list[2];
+              autoList.forEach(at => {
+                that.$store.dispatch('planList/fetchPlanDetail', { planId: at+101})
               })
-              if (auto) {
-                that.isShowCaseCommit = true;
-                that.isShowPlanList = false;
-              } else {
-                that.$store.dispatch('caseList/fetchCaseList',{
-                    uuid: taskId,
-                    page_num: 1,
-                    page_size: 100
+              that.isShowPlanList = true;
+              that.isShowTaskList = false;
+              this.$store.commit('planList/setAutoPlanList', autoList)
+              this.$store.commit('planList/setPlanList', manualList)
+              that.taskName = task.name;
+              this.$nextTick(() => {
+                that.$store.dispatch('planList/fetchPlanList', {
+                  page_num: 1,
+                  page_size: 10000
                 })
-                that.isShowPlanList = false;
-                that.isShowCaseList = true;
-                that.planName = '< ' + "";
-              }
-              console.log(taskId, '任务id');
+              })
+              console.log(task, '任务详情');
             },
             handleClickIssue(issueId) {
               console.log(issueId, 'issueid')
@@ -652,8 +656,8 @@
                 console.log('task id',benchId);
                 this.$store.dispatch('planList/fetchPlanList', {
                   page_num: 1,
-                  page_size: 100,
-                  task_id: benchId
+                  page_size: 10000,
+                  task_id: ''
                 })
                 console.log('test',this.isShowTaskList,this.isShowPlanList);
                 this.isShowTaskList = false;
@@ -705,21 +709,40 @@
               },10)
               
             },
+            planBack() {
+              that.isShowPlanList = false;
+              that.isShowTaskList = true;
+            },
             taskRender(item) {
               return `<div class="item-box" style="display:flex;align-items: top; justify-content: space-between;">
                     <div class="left">
-                        <div style="display:flex;align-items: center;">
+                        <div style="">
                           <div class="item-title">${item.name}</div>
-                          <div class="task-auto" style="display:${item.auto ? 'block': 'none'}">Auto</div>
+                          <div class="item-title">${item.description}</div>
                         </div>
                         <div class="item-tag">
-                            <div class="tag">3b</div>
-                            <div class="tag">MHIS_AS_AU_E4235</div>
+                            <div class="tag">${item.processor_name}</div>
+                            <div class="tag">${item.sw}</div>
                         </div>
                     </div>
                     <div class="taskBtn" onClick="handleClickTask('${item.uuid || item.id}', '${item.auto}')">To Do</div>
                 </div>`
             },
+            planRender(item) {
+              return `<div class="item-box" style="display:${(!item.auto && !item.uuid) ? 'none': 'flex'};align-items: top; justify-content: space-between;color: #fff;">
+                    <div class="left">
+                        <div style="display:flex;align-items: center;">
+                          <div class="item-title">${item.name}</div>
+                          <div class="task-auto" style="display:${item.auto ? 'block': 'none'}">Auto</div>
+                        </div>
+                        <div class="item-tag" style="display: flex;margin-top: 10px">
+                            <div class="plan-tag">3b</div>
+                            <div class="plan-tag">MHIS_AS_AU_E4235</div>
+                        </div>
+                    </div>
+                    <!-- <div class="taskBtn" onClick="handleClickTask('${item.uuid || item.id}', '${item.auto}')">To Do</div> -->
+                </div>`
+            },
             issueRender(item) {
               return `<div class="item-box" style="display:flex;align-items: center;justify-content: space-between;" onClick="handleClickIssue('${item.uuid || item.id}')">
                     <div class="left">

+ 1 - 2
src/views/originPage/index.less

@@ -134,14 +134,13 @@
         .tag {
           margin-bottom: 0.2vh;
           //width: 3.13vw;
-          height: 1.96vh;
           font-size: xx-small;
-          line-height: 1.96vh;
           text-align: center;
           background-color: #5d9a6d;
           border-radius: 10px;
           color: #f2f2f2;
           margin-right: 0.2vw;
+          padding: 5px 10px;
         }
       }
     }

+ 0 - 1
src/views/task1/list.vue

@@ -131,7 +131,6 @@
                 })
             },
             handleClickItem(uuid) {
-                debugger
                 let plan = this.planList.find(p => p.uuid == uuid)
                 if (plan) {
                     plan.checked = !plan.checked;