Parcourir la source

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

57862207 il y a 1 an
Parent
commit
72c7ccab05

+ 0 - 1
src/api/case.js

@@ -71,7 +71,6 @@ return api('/mantis-test/v1.0.0/mantis/update/digital/map/case', {
 }
 
 export const startPlan = (data) => {
-  debugger 
   console.log('httpRequest-' + 'startPlan');
   return api('/arbitrator/start', {
       method: 'POST',

+ 7 - 4
src/components/BenchDetail/index.vue

@@ -48,9 +48,9 @@
                   <div>Mac Adress</div>
                 </el-col>
                 <el-col :span=8>
-                  <div> {{ bench.slave[0].status }}</div>
-                  <div> {{ bench.slave[0].ip }}</div>
-                  <div> {{ bench.slave[0].mac }}</div>
+                  <div> {{ bench.slave[1].status }}</div>
+                  <div> {{ bench.slave[1].ip }}</div>
+                  <div> {{ bench.slave[1].mac }}</div>
                 </el-col>
               </el-row>
               </el-col>
@@ -149,7 +149,6 @@ export default {
         this.data = data;
         this.basicInfo = data?.groups?.['Basic Information'];
         this.equipmentTableData = data?.equipment;
-
     },
     postMessage() {
       let benchId = this.bench.id;
@@ -165,6 +164,10 @@ export default {
       this.equipmentTableData.push({
           ...this.bench.equipment
       })
+      this.equipmentTableData.forEach(m => {
+        debugger
+        m.binding = m.name+'('+m.id+')'
+      })
     }
   }
 };

+ 1 - 1
src/components/PlanList/index.vue

@@ -280,7 +280,7 @@ export default {
         line-height: 3.7vh;
     }
     .tab-content{
-        background: rgba(0,0,0,0.49);
+        // background: rgba(0,0,0,0.49);
         border-radius: 2.08vw;
         border: 1px solid #707070;
     }

+ 284 - 172
src/components/TabList/index.vue

@@ -11,166 +11,192 @@
       </div>
     </div>
     <div
-        class="square-count backgroundBox"
-        v-if="activeTab === 0 && isOpenSquare"
-      >
-        <status-bar
-          :ready="readyCount"
-          :occupied="occupiedCount"
-          :offline="offlineCount"
-        ></status-bar>
-      </div>
-      <div
-        class="origin-basic backgroundBox"
-        v-if="activeTab === 0"
-        v-show="!isGoHome && currentBench.name"
-      >
-        <h2>{{ currentBench && currentBench.name }}</h2>
-        <div class="originBasicRow">
-          <div>
-            <span>Location:</span>
-            <span>Automation Lab-7E</span>
-          </div>
-          <div>
-            <span>MU_SW:</span>
-            <span>{{ currentBench.MU_SW }}</span>
-          </div>
+      class="square-count backgroundBox"
+      v-if="activeTab === 0 && isOpenSquare"
+    >
+      <status-bar
+        :ready="readyCount"
+        :occupied="occupiedCount"
+        :offline="offlineCount"
+      ></status-bar>
+    </div>
+    <div
+      class="origin-basic backgroundBox"
+      v-if="activeTab === 0"
+      v-show="!isGoHome && currentBench.name"
+    >
+      <h2>{{ currentBench && currentBench.name }}</h2>
+      <div class="originBasicRow">
+        <div>
+          <span>Location:</span>
+          <span>Automation Lab-7E</span>
         </div>
-        <div class="originBasicRow">
-          <div>
-            <span>Cluster:</span>
-            <span>{{ currentBench.Cluster }}</span>
-          </div>
-          <div>
-            <span>Market:</span>
-            <span>{{ currentBench.Market }}</span>
-          </div>
+        <div>
+          <span>MU_SW:</span>
+          <span>{{ currentBench.MU_SW }}</span>
         </div>
-        <div class="originBasicRow">
-          <div>
-            <span>Box IP:</span>
-            <span>{{ currentBench.ip }}</span>
-          </div>
-          <div>
-            <span>Box Version:</span>
-            <span>{{ currentBench.equipment? (currentBench.equipment[0]? currentBench.equipment[0].version: "") : "" }}</span>
-          </div>
+      </div>
+      <div class="originBasicRow">
+        <div>
+          <span>Cluster:</span>
+          <span>{{ currentBench.Cluster }}</span>
+        </div>
+        <div>
+          <span>Market:</span>
+          <span>{{ currentBench.Market }}</span>
         </div>
       </div>
-      <div
-        class="secondScreen"
-        v-if="activeTab === 0 && benchDisplayLowerVisible && !isOpenSquare && isConnected"
-        @click="switchScreen"
-      >
-        <img
-          class="bmBenchImg bmBenchImgLower"
-          :src="currentScreen == 'upper' ? benchImgLower : benchImgUpper"
-          alt=""
-        />
+      <div class="originBasicRow">
+        <div>
+          <span>Box IP:</span>
+          <span>{{ currentBench.ip }}</span>
+        </div>
+        <div>
+          <span>Box Version:</span>
+          <span>{{
+            currentBench.equipment
+              ? currentBench.equipment[0]
+                ? currentBench.equipment[0].version
+                : ""
+              : ""
+          }}</span>
+        </div>
       </div>
-      <vue-scroll
-        class="tab-content backgroundBox"
-        :class="{ short: benchDisplayLowerVisible }"
-        :style="{ height: (!isGoHome && currentBench.name) ? (isOpenSquare ? '30vh': '50vh'): (isOpenSquare? '50vh': '70vh')}"
-        v-if="activeTab === 0"
-      >
-        <div class="panel-container">
-          <div class="list">
-            <div
-              v-for="(item, index) in activeTabItems"
-              :key="index"
-              class="item"
-            >
-              <div v-html="itemRender(item)"></div>
-            </div>
+    </div>
+    <div
+      class="secondScreen"
+      v-if="
+        activeTab === 0 &&
+        benchDisplayLowerVisible &&
+        !isOpenSquare &&
+        isConnected
+      "
+      @click="switchScreen"
+    >
+      <img
+        class="bmBenchImg bmBenchImgLower"
+        :src="currentScreen == 'upper' ? benchImgLower : benchImgUpper"
+        alt=""
+      />
+    </div>
+    <vue-scroll
+      class="tab-content backgroundBox"
+      :class="{ short: benchDisplayLowerVisible }"
+      :style="{
+        height:
+          !isGoHome && currentBench.name
+            ? isOpenSquare
+              ? '30vh'
+              : '50vh'
+            : isOpenSquare
+            ? '50vh'
+            : '70vh',
+      }"
+      v-if="activeTab === 0"
+    >
+      <div class="panel-container">
+        <div class="list">
+          <div
+            v-for="(item, index) in activeTabItems"
+            :key="index"
+            class="item"
+          >
+            <div v-html="itemRender(item)"></div>
           </div>
         </div>
-        <!-- <div class="panel-bottom">
+      </div>
+      <!-- <div class="panel-bottom">
           <div class="bench-left-bottom-btn"></div>
         </div> -->
-      </vue-scroll>
-      <vue-scroll class="tab-content backgroundBox" :class="tabClass" v-if="activeTab === 2" :style="{ height: '70vh'}">
-        <div class="panel-container">
-          <div class="list issue-list" v-if="isShowIssueList">
-            <div
-              v-for="(item, index) in activeTabItems"
-              :key="index"
-              class="item"
-            >
-              <div v-html="issueRender(item)"></div>
-            </div>
-          </div>
+    </vue-scroll>
+    <vue-scroll
+      class="tab-content backgroundBox"
+      :class="tabClass"
+      v-if="activeTab === 2"
+      :style="{ height: '70vh' }"
+    >
+      <div class="panel-container">
+        <div class="list issue-list" v-if="isShowIssueList">
           <div
-            class="case task-item"
-            v-if="isShowIssueDetail && !isShowIssueList"
+            v-for="(item, index) in activeTabItems"
+            :key="index"
+            class="item"
           >
-            <div class="go-back">
-              <div
-                class="el-icon-arrow-left"
-                @click="clickBackToIssueList"
-              ></div>
-              <div>{{ currentIssue.ticket_title }}</div>
-            </div>
-            <div class="task-title">ID</div>
-            <div class="task-content">{{ currentIssue.id || '-' }}</div>
-            <div class="task-title">Title</div>
-            <div class="task-content">{{ currentIssue.ticket_title || '-' }}</div>
-            <div class="task-title">Type</div>
-            <div class="task-content">{{ currentIssue.ticket_type || '-' }}</div>
-            <div class="task-title">Bench_id</div>
-            <div class="task-content">{{ currentIssue.bench_id || '-' }}</div>
-            <div class="task-title">Status</div>
-            <div class="task-content">{{ currentIssue.ticket_status || '-' }}</div>
-            <div class="task-title">Description</div>
-            <div class="task-content" v-html="currentIssue.ticket_desc"></div>
-            <div class="task-title">Creator</div>
-            <div class="task-content">{{ currentIssue.creator || '-' }}</div>
-            <div class="task-title">Difficulty</div>
-            <div class="task-content">{{ currentIssue.ticket_difficulty || '-' }}</div>
-            <div class="task-title">Complexity</div>
-            <div class="task-content">{{ currentIssue.ticket_complexity || '-' }}</div>
-            <div class="task-title">Action</div>
-            <div class="task-table">
-              <el-table
-                :data="currentIssue.action"
-                :row-class-name="rowClassName"
-                style="background-color: transparent"
-              >
-                <el-table-column
-                  width="95"
-                  label="Time"
-                  prop="time"
-                ></el-table-column>
-                <el-table-column
-                  label="Processor"
-                  prop="processor"
-                ></el-table-column>
-                <el-table-column
-                  width="60"
-                  label="type"
-                  prop="action_type"
-                ></el-table-column>
-                <el-table-column
-                  label="Spend Time"
-                  prop="spend_time"
-                ></el-table-column>
-                <el-table-column
-                  label="comment"
-                  prop="comment"
-                ></el-table-column>
-              </el-table>
-            </div>
-            <el-button @click="clickBackToIssueList" class="done-button"
-              >Close</el-button
+            <div v-html="issueRender(item)"></div>
+          </div>
+        </div>
+        <div
+          class="case task-item"
+          v-if="isShowIssueDetail && !isShowIssueList"
+        >
+          <div class="go-back">
+            <div class="el-icon-arrow-left" @click="clickBackToIssueList"></div>
+            <div>{{ currentIssue.ticket_title }}</div>
+          </div>
+          <div class="task-title">ID</div>
+          <div class="task-content">{{ currentIssue.id || "-" }}</div>
+          <div class="task-title">Title</div>
+          <div class="task-content">{{ currentIssue.ticket_title || "-" }}</div>
+          <div class="task-title">Type</div>
+          <div class="task-content">{{ currentIssue.ticket_type || "-" }}</div>
+          <div class="task-title">Bench_id</div>
+          <div class="task-content">{{ currentIssue.bench_id || "-" }}</div>
+          <div class="task-title">Status</div>
+          <div class="task-content">
+            {{ currentIssue.ticket_status || "-" }}
+          </div>
+          <div class="task-title">Description</div>
+          <div class="task-content" v-html="currentIssue.ticket_desc"></div>
+          <div class="task-title">Creator</div>
+          <div class="task-content">{{ currentIssue.creator || "-" }}</div>
+          <div class="task-title">Difficulty</div>
+          <div class="task-content">
+            {{ currentIssue.ticket_difficulty || "-" }}
+          </div>
+          <div class="task-title">Complexity</div>
+          <div class="task-content">
+            {{ currentIssue.ticket_complexity || "-" }}
+          </div>
+          <div class="task-title">Action</div>
+          <div class="task-table">
+            <el-table
+              :data="currentIssue.action"
+              :row-class-name="rowClassName"
+              style="background-color: transparent"
             >
+              <el-table-column
+                width="95"
+                label="Time"
+                prop="time"
+              ></el-table-column>
+              <el-table-column
+                label="Processor"
+                prop="processor"
+              ></el-table-column>
+              <el-table-column
+                width="60"
+                label="type"
+                prop="action_type"
+              ></el-table-column>
+              <el-table-column
+                label="Spend Time"
+                prop="spend_time"
+              ></el-table-column>
+              <el-table-column label="comment" prop="comment"></el-table-column>
+            </el-table>
           </div>
+          <el-button @click="clickBackToIssueList" class="done-button"
+            >Close</el-button
+          >
         </div>
-        <div class="panel-bottom"></div>
-      </vue-scroll>
+      </div>
+      <div class="panel-bottom"></div>
+    </vue-scroll>
+    <div style="border-radius: 2.08vw;background: linear-gradient(179deg, rgba(255,255,255,0.36) 0%, rgba(255,255,255,0.1) 100%);">
       <vue-scroll
-        class="tab-content backgroundBox task-right-panel"
+        class="tab-content task-right-panel"
         :class="tabClass"
-        :style="{ height: '70vh'}"
+        :style="{ height: isShowAutoCaseList && isShowTaskList === false? '60vh': '70vh' }"
         v-if="activeTab === 1"
       >
         <div class="panel-container">
@@ -259,20 +285,65 @@
                 :row-class-name="rowClassName"
                 style="background-color: transparent"
               >
-                <el-table-column label="ID" prop="id" width="60"></el-table-column>
-                <el-table-column label="name" prop="name" width="180"></el-table-column>
+                <el-table-column
+                  label="ID"
+                  prop="id"
+                  width="60"
+                ></el-table-column>
+                <el-table-column
+                  label="name"
+                  prop="name"
+                  width="180"
+                ></el-table-column>
                 <el-table-column label="status">
                   <template slot-scope="scope">
-                    <div v-if="scope.row.status == 'ready'" style="background: #7BAF66;" class="bench-status">{{ scope.row.status }}</div>
-                    <div v-if="scope.row.status == 'running' || scope.row.status == 'waiting'" style="background: #eebe77;" class="bench-status">{{ scope.row.status }}</div>
-                    <div v-if="scope.row.status != 'running' && scope.row.status != 'ready' && scope.row.status != 'waiting'" style="background: #92949B;" class="bench-status">{{ scope.row.status }}</div>
+                    <div
+                      v-if="
+                        scope.row.status == 'ready' ||
+                        scope.row.status == 'valid' ||
+                        scope.row.status == null ||
+                        !scope.row.status
+                      "
+                      style="background: #7baf66"
+                      class="bench-status"
+                    >
+                      {{ "ready" }}
+                    </div>
+                    <div
+                      v-if="
+                        scope.row.status == 'running' ||
+                        scope.row.status == 'waiting'
+                      "
+                      style="background: #eebe77"
+                      class="bench-status"
+                    >
+                      {{ scope.row.status }}
+                    </div>
+                    <div
+                      v-if="scope.row.status == 'error'"
+                      style="background: #f96262"
+                      class="bench-status"
+                    >
+                      {{ scope.row.status }}
+                    </div>
+                    <div
+                      v-if="
+                        scope.row.status != 'running' &&
+                        scope.row.status != 'ready' &&
+                        scope.row.status != 'waiting' &&
+                        scope.row.status != 'valid' &&
+                        scope.row.status != 'error' &&
+                        !!scope.row.status
+                      "
+                      style="background: #92949b"
+                      class="bench-status"
+                    >
+                      {{ scope.row.status }}
+                    </div>
                   </template>
                 </el-table-column>
               </el-table>
             </div>
-            <el-button @click="submitAutoCase" class="done-button" :class="autoTaskStatus"
-              >{{autoTaskStatus == 'ready' ? 'Start': (autoTaskStatus == 'waiting' || autoTaskStatus == 'running') ? 'Stop' : 'Start'}}</el-button
-            >
           </div>
           <div
             class="plan task-item case-submit"
@@ -456,9 +527,30 @@
               </el-table-column>
               <el-table-column label="Status" width="120">
                 <template slot-scope="scope">
-                  <div v-if="scope.row.status == 'ready'" style="background: #7BAF66;" class="bench-status">{{ scope.row.status }}</div>
-                  <div v-if="scope.row.status == 'running'" style="background: #eebe77;" class="bench-status">{{ scope.row.status }}</div>
-                  <div v-if="scope.row.status != 'running' && scope.row.status != 'ready'" style="background: #92949B;" class="bench-status">{{ scope.row.status || "offline" }}</div>
+                  <div
+                    v-if="scope.row.status == 'ready'"
+                    style="background: #7baf66"
+                    class="bench-status"
+                  >
+                    {{ scope.row.status }}
+                  </div>
+                  <div
+                    v-if="scope.row.status == 'running'"
+                    style="background: #eebe77"
+                    class="bench-status"
+                  >
+                    {{ scope.row.status }}
+                  </div>
+                  <div
+                    v-if="
+                      scope.row.status != 'running' &&
+                      scope.row.status != 'ready'
+                    "
+                    style="background: #92949b"
+                    class="bench-status"
+                  >
+                    {{ scope.row.status || "offline" }}
+                  </div>
                 </template>
               </el-table-column>
             </el-table>
@@ -475,7 +567,7 @@
           >
             <div class="go-back">
               <div class="el-icon-arrow-left" @click="clickBackToPlan"></div>
-              <div style="font-size:18px">{{ caseName }}</div>
+              <div style="font-size: 18px">{{ caseName }}</div>
             </div>
             <div class="task-title">Precondition</div>
             <!--<div class="task-content">{{caseActive}}</div>
@@ -499,6 +591,20 @@
           <div class="task-left-bottom-btn">+</div>
         </div> -->
       </vue-scroll>
+      <el-button
+        @click="submitAutoCase"
+        class="done-button"
+        :class="autoTaskStatus"
+        v-if="activeTab === 1 && isShowAutoCaseList && isShowTaskList === false"
+        >{{
+          autoTaskStatus == "ready"
+            ? "Start"
+            : autoTaskStatus == "waiting" || autoTaskStatus == "running"
+            ? "Stop"
+            : "Start"
+        }}</el-button
+      >
+    </div>
   </div>
 </template>
 
@@ -586,15 +692,15 @@ export default {
   mounted() {
     bus.on("benchInfoVisible", (param) => {
       // console.log('benchInfoVisible', param);
-      if (this.benchList.find(b => b.benchId == param.benchId)) {
-        this.$store.dispatch('benchList/setCurrentBench', param)
+      if (this.benchList.find((b) => b.benchId == param.benchId)) {
+        this.$store.dispatch("benchList/setCurrentBench", param);
         // window.selectBench(param.benchId);
         let items = document.getElementsByClassName("item-box");
         for (var index = 0; index < items.length; index++) {
           items[index].style.background = "#00000032";
           let title = items[index].getElementsByClassName("item-title");
           console.log("textContent", title[0].textContent);
-          if(items[index].dataset.index == param.benchId){
+          if (items[index].dataset.index == param.benchId) {
             items[index].style.background = "#000000C0";
           }
         }
@@ -646,7 +752,7 @@ export default {
     },
     ...mapState({
       isGoHome(state) {
-        return state.common.isGoHome
+        return state.common.isGoHome;
       },
       projectOptions(state) {
         return state.common.projectOptions;
@@ -679,17 +785,17 @@ export default {
         return state.benchList.matchedBenchList;
       },
       autoTaskStatus(state) {
-        return state.caseList.autoTaskStatus
+        return state.caseList.autoTaskStatusMap[state.caseList.currentTaskIndex] || 'ready';
       },
       remoteBenchList(state) {
-        return state.benchList.remoteBenchList
+        return state.benchList.remoteBenchList;
       },
       currentBench(state) {
-        return state.benchList.currentBench || {}
+        return state.benchList.currentBench || {};
       },
       benchList(state) {
-        return state.benchList.benchList
-      }
+        return state.benchList.benchList;
+      },
     }),
   },
   updated() {
@@ -748,7 +854,7 @@ export default {
     },
     handleSelectionChange() {},
     startAutoCase() {
-      let data = {}
+      let data = {};
       data.data = {
         plan_id: this.currentPlanId,
         attribute: {},
@@ -758,7 +864,7 @@ export default {
         custom_agent_id: this.multipleSelection,
       };
       data.planId = this.currentPlanId;
-      debugger
+      data.planName = this.currentPlanName;
       this.$store.dispatch("caseList/startPlan", data);
       this.clickBackToAutoCaseList();
     },
@@ -833,7 +939,7 @@ export default {
   width: 100%;
   background-size: 100% 100%;
   border-radius: 2.08vw;
-  background: rgba(255,255,255,0.36);
+  // background: rgba(255, 255, 255, 0.36);
 }
 
 // .short {
@@ -932,7 +1038,7 @@ export default {
     line-height: 3.7vh;
   }
   .tab-content {
-    background: rgba(0, 0, 0, 0.49);
+    // background: rgba(0, 0, 0, 0.49);
     border-radius: 2.08vw;
     border: 1px solid #707070;
   }
@@ -1000,9 +1106,10 @@ export default {
       border: 1px solid rgba(255, 255, 255, 0.4);
       color: #fff;
       padding: 0;
-      position: absolute;
+      // position: absolute;
       bottom: 1.75vh;
       right: 0.93vw;
+      margin: 15px;
     }
     .cancel-button {
       width: 11.6vw;
@@ -1143,7 +1250,7 @@ export default {
 
 .cancel-button,
 .done-button {
-  width: 11.6vw;
+  width: 11vw;
   height: 4.25vh;
   line-height: 4.25vh;
   border-radius: 67px 67px 67px 67px;
@@ -1151,18 +1258,23 @@ export default {
   border: 1px solid rgba(255, 255, 255, 0.4);
   color: #fff;
   padding: 0;
-  position: absolute;
+  // position: absolute;
   bottom: 1.75vh;
+  float: right;
+  
 }
 
 .cancel-button {
   background: rgba(255, 255, 255, 0.5);
   left: 15px;
+  float: left;
+  margin-top: 15px;
 }
 
 .done-button {
   background: linear-gradient(180deg, #83cbfb 0%, #2e74b2 100%);
   right: 15px;
+  margin: 15px 15px 0 0;
 }
 </style>
 <style lang="less">

+ 8 - 6
src/store/modules/case/actions.js

@@ -5,7 +5,8 @@ export default {
     try {
       const caseList = await caseApi.fetchCaseList(data)
       console.log('caselist',caseList.data.data.data)
-      commit("setCaseList", caseList.data.data.data);
+      debugger
+      commit("setCaseList", {caseList: caseList.data.data.data, uuid: data.uuid});
     } catch (err) {
       console.log("error", "服务异常", 1000);
     }
@@ -19,7 +20,7 @@ export default {
         let getAutoPlanStatusParam = {
           name: data.planName,
           currentPage: 1,
-          pageSize: 20,
+          pageSize: 200,
         };
         caseApi.getAutoPlanStatus(getAutoPlanStatusParam).then((res) => {
           let rows = res.data.rows;
@@ -68,18 +69,19 @@ export default {
   },
   async startPlan({commit}, data) {
     try {
-      debugger
       const result = await caseApi.startPlan(data.data);
       commit('setAutoStatus', {
         id: data.planId,
+        name: data.planName,
         res: result
       })
     }catch(e) {
 
     }
   },
-  async cancelPlan({commit}, data) {
-    const result = caseApi.cancelPlan(data)
+  async cancelPlan({commit, state}) {
+    debugger
+    const result = caseApi.cancelPlan(state.currentTaskIndex)
     commit('cancelPlan')
   },
   setCurrentTask({commit}, id) {
@@ -90,7 +92,7 @@ export default {
       let getAutoPlanStatusParam = {
         name: data.planName,
         currentPage: 1,
-        pageSize: 20,
+        pageSize: 200,
       };
       caseApi.getAutoPlanStatus(getAutoPlanStatusParam).then((res) => {
         let rows = res.data.rows;

+ 7 - 0
src/store/modules/case/index.js

@@ -6,6 +6,7 @@ export default {
   namespaced: true,
   state() {
     let map = {}
+    let map1 = {}
     let autoTaskStatusMap = {}
     if (localStorage.getItem("autoCurrentTaskData")) {
       map = JSON.parse(localStorage.getItem("autoCurrentTaskData"))
@@ -13,10 +14,15 @@ export default {
         autoTaskStatusMap[key] = 'ready'
       }
     }
+    if (localStorage.getItem("autoCurrentTaskName")) {
+      map1 = JSON.parse(localStorage.getItem("autoCurrentTaskName"))
+    }
     return {
       autoCaseList: [],
       autoCaseListMap: {},
+      autoTaskNameMap: map1,
       caseList: [],
+      caseListMap: [],
       autoTaskStatus: 'ready',
       autoTaskStatusMap: autoTaskStatusMap,
       planExecId: 0,
@@ -25,6 +31,7 @@ export default {
       autoTaskItems: [],
       autoTaskItemsMap: {},
       autoTaskPercentMap: {},
+      taskPercentMap: {},
       currentPlanId: 0
     };
   },

+ 48 - 23
src/store/modules/case/mutations.js

@@ -1,23 +1,49 @@
 export default {
-  setCaseList(state, caseList) {
+  setCaseList(state, data) {
+    let caseList = data.caseList;
+    let uuid = data.uuid;
+    while (state.caseListMap[uuid] && state.caseListMap[uuid].length) {
+      state.caseListMap[uuid].pop();
+    }
+
     caseList.forEach((caseA) => {
-      if(!state.caseList.some(p => p.case_no == caseA.case_no)) {
-        state.caseList.push(caseA)
+      if (!state.caseListMap[uuid]) {
+        state.caseListMap[uuid] = []
+      }
+      if (!state.caseListMap[uuid].some(p => p.case_no == caseA.case_no)) {
+        state.caseListMap[uuid].push(caseA)
       }
     });
+    
+    if (state.caseListMap[uuid] && state.caseListMap[uuid].length) {
+      state.caseList = state.caseListMap[uuid];
+    }
+
+    let length = state.caseList ? state.caseList.length : 0;
+    let finished = 0;
+    for (let i = 0; i < length; i++) {
+      if (
+        state.caseList[i].result == "pass" ||
+        state.caseList[i].result == "fail" ||
+        state.caseList[i].result == "tb"
+      ) {
+        finished++;
+      }
+    }
+    let rate = (finished / length) * 100;
+    state.autoTaskPercentMap[uuid] = rate;
   },
   setAutoCaseList(state, data) {
     let autoCaseList = data.autoCaseList;
     let planId = data.planId;
-    while(state.autoCaseListMap[planId] && state.autoCaseListMap[planId].length) {
+    while (state.autoCaseListMap[planId] && state.autoCaseListMap[planId].length) {
       state.autoCaseListMap[planId].pop()
     }
-    debugger
     autoCaseList.forEach((caseA) => {
       if (!state.autoCaseListMap[planId]) {
         state.autoCaseListMap[planId] = []
       }
-      if(!state.autoCaseListMap[planId].some(p => p.id == caseA.id)) {
+      if (!state.autoCaseListMap[planId].some(p => p.id == caseA.id)) {
         state.autoCaseListMap[planId].push(caseA)
       }
     });
@@ -27,7 +53,7 @@ export default {
   },
   setAutoPlanStatus(state, rows) {
     let map = JSON.parse(localStorage.getItem("autoCurrentTaskData"))
-    for(let key in map) {
+    for (let key in map) {
       let planExecId = map[key];
       for (let i in res) {
         if (res[i].id == planExecId) {
@@ -38,7 +64,6 @@ export default {
       }
 
       if (state.currentPlanId) {
-        debugger
         let cases = state.autoTaskItemsMap[state.currentPlanId];
         cases.forEach(c => {
           let caseId = c.testcase_id;
@@ -49,22 +74,25 @@ export default {
           // console.log('autoCaseList', state.autoCaseList);
         })
       }
-    }    
+    }
   },
   setPlanExecId(state, id) {
     state.planExecId = id
   },
   setAutoStatus(state, data) {
-    debugger
     // state.autoTaskSubmitLoading = false;
-    state.autoTaskStatus = "running";
-    state.autoTaskStatusMap[data.id] = "running";
+    debugger
+    state.autoTaskStatus = data.res.data.result == 'SUCCESS' ? 'running': data.res.data.result;
+    // state.autoTaskStatusMap[data.id] = data.res.data.result == 'SUCCESS' ? 'running': data.res.data.result;
     state.planExecId = data.res.data.info[0];
     state.planExecIdMap[data.id] = data.res.data.info[0];
-    debugger
+    state.autoTaskNameMap[data.id] = data.name;
     localStorage.setItem("autoCurrentTaskData", JSON.stringify(state.planExecIdMap));
+    localStorage.setItem("autoCurrentTaskName", JSON.stringify(state.autoTaskNameMap));
     state.autoCaseListMap[data.id].forEach(c => {
-      c.status = "running"
+      if (!c.status) {
+        c.status = 'waiting'
+      }
     })
   },
   setCurrentTask(state, id) {
@@ -73,14 +101,13 @@ export default {
       state.autoCaseList = state.autoCaseListMap[id]
     }
   },
-  cancelPlan(state, res) {
-    state.autoTaskStatus = "ready";
-    localStorage.removeItem("autoCurrentTaskData")
+  cancelPlan(state) {
+    state.autoTaskStatus = "stopped";
+    state.autoTaskStatusMap[state.currentTaskIndex] = "stopped";
   },
   setAllAutoPlanStatus(state, data) {
-    debugger
     let map = JSON.parse(localStorage.getItem("autoCurrentTaskData"))
-    for(let key in map) {
+    for (let key in map) {
       let planExecId = map[key];
       for (let i in data.res) {
         if (data.res[i].id == planExecId) {
@@ -113,9 +140,8 @@ export default {
     }
     state.autoTaskItemsMap[data.info.planId] = data.res.data.list;
     let rate = (finishedCaseNum / planCaseNum) * 100;
-    debugger
     state.autoTaskPercentMap[data.info.planId] = rate;
-    state.autoTaskStatusMap[data.info.planId] = data.res.data.detail.status;
+    // state.autoTaskStatusMap[data.info.planId] = data.res.data.detail.status;
     if (state.currentPlanId) {
       let cases = state.autoTaskItemsMap[state.currentPlanId];
       if (!cases) return;
@@ -124,8 +150,7 @@ export default {
         let caseTemp = state.autoCaseList.find(t => t.id == caseId);
         if (caseTemp) {
           caseTemp.status = c.status;
-          if(caseTemp.status == 'finished')
-          {
+          if (caseTemp.status == 'finished') {
             caseTemp.status = c.result;
           }
         }

+ 127 - 114
src/uwb-sample.js

@@ -12,6 +12,9 @@ window.waterMap = {}
 window.sdkInstance = null;
 window.uwbInstance = null;
 window.getsqlData = getsqlData;
+window.modeChangeInterval = null;
+window.benchListInterval = null;
+window.otherInterval = null;
 var fbxLoader1Loaded = false;
 var fbxLoader2Loaded = false;
 
@@ -24,7 +27,7 @@ window.benchMeshMap = {};
 window.benchMeshWaterMap = {};
 window.benchDBList = null
 
-function getsqlData(sdkInstance, uwbInstance,bAddModel) {
+function getsqlData(sdkInstance, uwbInstance, bAddModel) {
   let g_PosArrayResult = null;
   if (g_PosArrayResult == null) {
     var sqlstr = "SELECT * FROM dat_bench_extend order by bench_id asc";
@@ -131,10 +134,11 @@ function getsqlData(sdkInstance, uwbInstance,bAddModel) {
           let show_remote_button = item.show_remote_button;
           // 添加水滴
           let benchList = window.store ? window.store.getters['benchList/getBenchList'] : [];
+          let benchIdList = window.store.getters['benchList/getBenchList'].map(m => m.id);
           let currentBench = benchList.find(b => b.id == bench_id);
           let texture = null;
           if (currentBench) {
-            switch(currentBench.status) {
+            switch (currentBench.status) {
               case "ready":
                 texture = textureReady;
                 break;
@@ -151,7 +155,7 @@ function getsqlData(sdkInstance, uwbInstance,bAddModel) {
           } else {
             texture = textureOffline;
           }
-          
+
           if (window.waterMap[bench_id]) {
             sdkInstance.sceneRenderer.scene.remove(window.waterMap[bench_id]);
           }
@@ -162,9 +166,9 @@ function getsqlData(sdkInstance, uwbInstance,bAddModel) {
             map: texture
           });
           let uniformsA = {
-            amplitude: {value: 1.0},
-            color: {value: new THREE.Color(0xff2200)},
-            texture: {value: texture }
+            amplitude: { value: 1.0 },
+            color: { value: new THREE.Color(0xff2200) },
+            texture: { value: texture }
           };
           // 创建着色器材质
           const shaderMaterial = new THREE.ShaderMaterial({
@@ -185,7 +189,7 @@ function getsqlData(sdkInstance, uwbInstance,bAddModel) {
             transparent: true
           })
           let sprite = new THREE.Sprite(spriteMaterial);
-          
+
           const mesh = new THREE.Mesh(geometry, shaderMaterial);
           var customData = {
             benchId: bench_id,
@@ -198,18 +202,19 @@ function getsqlData(sdkInstance, uwbInstance,bAddModel) {
           mesh.position.set(x, y + 10, z);
           mesh.rotation.set(-Math.PI / 2, 0, 0);
           window.waterMap[bench_id] = mesh;
-          console.log('添加模型和水滴1111')
+          console.log('添加模型和水滴1111',benchIdList)
           if (sdkInstance) {
-            
-            if(bAddModel && window.benchMeshWaterMap[bench_id])
-            {
-              window.benchMeshWaterMap[bench_id] = mesh;
-              sdkInstance.sceneRenderer.scene.add(mesh)
-            }
-            else
-            {
-              window.benchMeshWaterMap[bench_id] = mesh;
+            if (benchIdList.indexOf(Number(bench_id)) > 0) {
+              if (bAddModel && window.benchMeshWaterMap[bench_id]) {
+                window.benchMeshWaterMap[bench_id] = mesh;
+                console.log('添加benchid', bench_id)
+                sdkInstance.sceneRenderer.scene.add(mesh)
+              }
+              else {
+                window.benchMeshWaterMap[bench_id] = mesh;
+              }
             }
+
           }
         };
       }
@@ -222,6 +227,7 @@ function getsqlData(sdkInstance, uwbInstance,bAddModel) {
       if (!fbxLoader1Loaded) {
         fbxLoader1.load("../models/meshDraco.gltf", function (fbx) {
           console.log('loadzmg')
+          let benchIdList = window.store.getters['benchList/getBenchList'].map(m => m.id);
           //fbxLoader1Loaded = true;
           let result = g_PosArrayResult;
           for (var item of result) {
@@ -243,20 +249,20 @@ function getsqlData(sdkInstance, uwbInstance,bAddModel) {
             }
             else {
             }
-  
+
             var distance = 10000.0;
-  
+
             var xSubTmp = x;
             var ySubTmp = y;
             var zSubTmp = z;
             var ang_xSubTmp = ang_x;
             var ang_ySubTmp = ang_y;
             var ang_zSubTmp = ang_z;
-  
+
             if (g_PosArrayResult) {
               var iCount = 0;
               for (var itemSub of g_PosArrayResult) {
-  
+
                 iCount++;
                 var xSub = itemSub.x;
                 var ySub = itemSub.y;
@@ -282,8 +288,8 @@ function getsqlData(sdkInstance, uwbInstance,bAddModel) {
                 }
               }
             }
-  
-  
+
+
             x = xSubTmp;
             y = ySubTmp;
             z = zSubTmp;
@@ -296,7 +302,7 @@ function getsqlData(sdkInstance, uwbInstance,bAddModel) {
             ang_x = JSON.parse(JSON.stringify(ang_xSubTmp));
             ang_y = JSON.parse(JSON.stringify(ang_ySubTmp));
             ang_z = JSON.parse(JSON.stringify(ang_zSubTmp));
-  
+
             let card_id = item.card_id;
             let bench_id = item.bench_id;
             let bench_img = item.bench_img;
@@ -321,24 +327,25 @@ function getsqlData(sdkInstance, uwbInstance,bAddModel) {
                 benchImg: bench_img,
               };
               childMeshTmp.userData = customData;
-              
-  
+
+
               console.log('添加模型和水滴1111')
-              if(bAddModel && window.benchMeshMap[bench_id])
-              {
-                window.benchMeshMap[bench_id] = childMeshTmp;
-                sdkInstance.sceneRenderer.scene.add(childMeshTmp)
-              }
-              else
-              {
-                window.benchMeshMap[bench_id] = childMeshTmp;
+              if (benchIdList.indexOf(Number(bench_id)) > 0) {
+                if (bAddModel && window.benchMeshMap[bench_id]) {
+                  window.benchMeshMap[bench_id] = childMeshTmp;
+                  sdkInstance.sceneRenderer.scene.add(childMeshTmp)
+                }
+                else {
+                  window.benchMeshMap[bench_id] = childMeshTmp;
+                }
               }
+
             }
-  
+
           };
         })
       }
-      
+
 
       var fbxLoader2 = new THREE.GLTFLoader();
       fbxLoader2.setDRACOLoader(dracoLoader);
@@ -365,20 +372,20 @@ function getsqlData(sdkInstance, uwbInstance,bAddModel) {
             }
             else {
             }
-  
+
             var distance = 10000.0;
-  
+
             var xSubTmp = x;
             var ySubTmp = y;
             var zSubTmp = z;
             var ang_xSubTmp = ang_x;
             var ang_ySubTmp = ang_y;
             var ang_zSubTmp = ang_z;
-  
+
             if (g_PosArrayResult) {
               var iCount = 0;
               for (var itemSub of g_PosArrayResult) {
-  
+
                 iCount++;
                 var xSub = itemSub.x;
                 var ySub = itemSub.y;
@@ -404,8 +411,8 @@ function getsqlData(sdkInstance, uwbInstance,bAddModel) {
                 }
               }
             }
-  
-  
+
+
             x = xSubTmp;
             y = ySubTmp;
             z = zSubTmp;
@@ -418,12 +425,12 @@ function getsqlData(sdkInstance, uwbInstance,bAddModel) {
             ang_x = JSON.parse(JSON.stringify(ang_xSubTmp));
             ang_y = JSON.parse(JSON.stringify(ang_ySubTmp));
             ang_z = JSON.parse(JSON.stringify(ang_zSubTmp));
-  
+
             let card_id = item.card_id;
             let bench_id = item.bench_id;
             let show_remote_button = item.show_remote_button;
             let bench_img = item.bench_img;
-  
+
             if (benchType == 2) {
               console.log("控制台查看加载gltf文件返回的对象结构", fbx);
               var childMesh = fbx.scene.children[0];
@@ -445,38 +452,38 @@ function getsqlData(sdkInstance, uwbInstance,bAddModel) {
               };
               childMeshTmp.userData = customData;
 
-              if(bAddModel && window.benchMeshMap[bench_id])
-              {
+              if (bAddModel && window.benchMeshMap[bench_id]) {
                 window.benchMeshMap[bench_id] = childMeshTmp;
                 sdkInstance.sceneRenderer.scene.add(childMeshTmp)
               }
-              else
-              {
+              else {
                 window.benchMeshMap[bench_id] = childMeshTmp;
               }
             }
           };
           if (!sessionStorage.getItem('3dMode') || sessionStorage.getItem('3dMode') == 0) {
-            setTimeout(() => {
-              var benchPosList = [];
-              for (var item of result) {
-                var localPosition = new THREE.Vector3(item.fix_pos_x, item.fix_pos_y, item.fix_pos_z);
-                var worldPosition = uwbInstance.convertLocalToWorld(localPosition);
-                var pos = sdkInstance.getScreenPosition(worldPosition);
-                benchPosList.push(
-                  {
-                    x: pos.x,
-                    y: pos.y,
-                    benchType: item.bench_type,
-                    benchId: item.bench_id,
-                    benchImg: item.bench_img,
-                  }
-                )
+            otherInterval = setInterval(() => {
+              if (uwbInstance) {
+                clearInterval(otherInterval)
+                var benchPosList = [];
+                for (var item of result) {
+                  var localPosition = new THREE.Vector3(item.fix_pos_x, item.fix_pos_y, item.fix_pos_z);
+                  var worldPosition = uwbInstance.convertLocalToWorld(localPosition);
+                  var pos = sdkInstance.getScreenPosition(worldPosition);
+                  benchPosList.push(
+                    {
+                      x: pos.x,
+                      y: pos.y,
+                      benchType: item.bench_type,
+                      benchId: item.bench_id,
+                      benchImg: item.bench_img,
+                    }
+                  )
+                }
+                window.showBenchPos(benchPosList);
+                setInterval(() => { getsqlDataRealTime(); }, 5 * 60 * 1000)
               }
-              window.showBenchPos(benchPosList);
-              setInterval(()=>{getsqlDataRealTime();},5*60*1000)
-            }, 2000
-            )
+            }, 2000)
           }
         })
       }
@@ -523,8 +530,8 @@ function getsqlDataRealTime() {
           var xSubTmp = x;
           var ySubTmp = y;
           var zSubTmp = z;
-          x = x-14.7;
-          z = y-14
+          x = x - 14.7;
+          z = y - 14
           var ang_xSubTmp = ang_x;
           var ang_ySubTmp = ang_y;
           var ang_zSubTmp = ang_z;
@@ -562,21 +569,20 @@ function getsqlDataRealTime() {
           ang_x = ang_xSubTmp;
           ang_y = ang_ySubTmp;
           ang_z = ang_zSubTmp;
-          
+
           x = JSON.parse(JSON.stringify(xSubTmp));
           y = JSON.parse(JSON.stringify(ySubTmp));
           z = JSON.parse(JSON.stringify(zSubTmp));
           ang_x = JSON.parse(JSON.stringify(ang_xSubTmp));
           ang_y = JSON.parse(JSON.stringify(ang_ySubTmp));
           ang_z = JSON.parse(JSON.stringify(ang_zSubTmp));
-          
+
         }
         window.benchMeshMap[item.bench_id].position.set(x, y, z);
-        window.benchMeshWaterMap[item.bench_id].position.set(x, y+10, z);
-        if(item.use_fix_pos == 0)
-        {
-          window.benchMeshMap[item.bench_id].position.set(x-14.7, JSON.parse(JSON.stringify(item.fix_pos_y)), y-14);
-          window.benchMeshWaterMap[item.bench_id].position.set(x-14.7, JSON.parse(JSON.stringify(item.fix_pos_y))+10, y-14);
+        window.benchMeshWaterMap[item.bench_id].position.set(x, y + 10, z);
+        if (item.use_fix_pos == 0) {
+          window.benchMeshMap[item.bench_id].position.set(x - 14.7, JSON.parse(JSON.stringify(item.fix_pos_y)), y - 14);
+          window.benchMeshWaterMap[item.bench_id].position.set(x - 14.7, JSON.parse(JSON.stringify(item.fix_pos_y)) + 10, y - 14);
         }
       }
     });
@@ -654,13 +660,16 @@ export function uwbMain(domId, modelWidth, modelHeight, finalMode, callback) {
           element.style.marginTop = ((height - (height * ratio)) / 2) + 'px';
           let playersmall = document.getElementById('playersmall')
           playersmall.appendChild(element)
-          setTimeout(() => {
-            window.sdkInstance.changeMode('floorplan');
-            sdkInstance.player.cameras.floorplan.position.setY(10)
-          }, 3000)
+          modeChangeInterval = setInterval(() => {
+            if (window.sdkInstance.player.controls) {
+              clearInterval(modeChangeInterval);
+              window.sdkInstance.changeMode('floorplan');
+              sdkInstance.player.cameras.floorplan.position.setY(10)
+            }
+          }, 500)
         }, 1500)
       }
-      
+
       sdkInstance.on("endLoading", (mode) => {
         console.log(mode, '-----+++++-----')
         vrBgContainer.style.display = "none";
@@ -719,10 +728,13 @@ export function uwbMain(domId, modelWidth, modelHeight, finalMode, callback) {
           //     500
           //   );
           // }
-          getsqlData(sdkInstance, uwbInstance,false)
-          // var timerId = setInterval(function () {
-          //   getsqlData(sdkInstance, uwbInstance)
-          // }, 1500);
+          benchListInterval = setInterval(() => {
+            let benchIdList = window.store.getters['benchList/getBenchList'].map(m => m.id);
+            if (benchIdList.length > 0) {
+              clearInterval(benchListInterval)
+              getsqlData(sdkInstance, uwbInstance, false)
+            }
+          }, 500);
         }
 
 
@@ -749,38 +761,39 @@ export function uwbMain(domId, modelWidth, modelHeight, finalMode, callback) {
             intersects.forEach(m => {
               console.log('点击水滴', event, m && m.object && m.object.geometry && m.object.geometry.type, m.object)
               if (m.object.geometry.type != "PlaneBufferGeometry") {
-                 console.log('onmousedown', 111)
-                 if (m.object.userData && m.object.userData.benchFlag == true) {
-                   if (!bool) {
-                     bool = true;
-                     //m.object.material = window.shader1;
-                     ////m.object.scale.set(10, 10, 10)
-                     //m.object.scale.set(5, 5, 5)
-                     //outlineObj(m.object)
-                     // let player = document.getElementById(domId)
-                     // player.style.display = "none
-                     if (box) {
-                       sdkInstance.sceneRenderer.scene.remove(box);
-                     }
-                     window.handleBenchClick(m.object.userData.benchId, m.object.userData.bShowRemoteButton)
-                     box = new THREE.BoxHelper(m.object, '#ff0000');  //object 模型
-                     sdkInstance.sceneRenderer.scene.add(box)
-                     //let ambientLight = new THREE.AmbientLight(0xffffff); //设置环境光
-                     //sdkInstance.sceneRenderer.scene.add(ambientLight); //将环境光添加到场景中
-                     //let pointLight = new THREE.PointLight(0xffffff, 1, 0);
-                     //pointLight.position.set(200, 200, 200); //设置点光源位置
-                     //sdkInstance.sceneRenderer.scene.add(pointLight); //将点光源添加至场景
-                   }
-                   //outlineObj(m.object
-                   //m.object.material = FXAAShader
-                 
-               } 
+                console.log('onmousedown', 111)
+                if (m.object.userData && m.object.userData.benchFlag == true) {
+                  if (!bool) {
+                    bool = true;
+                    //m.object.material = window.shader1;
+                    ////m.object.scale.set(10, 10, 10)
+                    //m.object.scale.set(5, 5, 5)
+                    //outlineObj(m.object)
+                    // let player = document.getElementById(domId)
+                    // player.style.display = "none
+                    if (box) {
+                      sdkInstance.sceneRenderer.scene.remove(box);
+                    }
+                    window.handleBenchClick(m.object.userData.benchId, m.object.userData.bShowRemoteButton)
+                    box = new THREE.BoxHelper(m.object, '#ff0000');  //object 模型
+                    sdkInstance.sceneRenderer.scene.add(box)
+                    //let ambientLight = new THREE.AmbientLight(0xffffff); //设置环境光
+                    //sdkInstance.sceneRenderer.scene.add(ambientLight); //将环境光添加到场景中
+                    //let pointLight = new THREE.PointLight(0xffffff, 1, 0);
+                    //pointLight.position.set(200, 200, 200); //设置点光源位置
+                    //sdkInstance.sceneRenderer.scene.add(pointLight); //将点光源添加至场景
+                  }
+                  //outlineObj(m.object
+                  //m.object.material = FXAAShader
+
+                }
               } else if (m.object.geometry.type == "PlaneBufferGeometry") {
                 console.log('onmousedown', 222)
                 if (m.object.userData && m.object.userData.benchFlag == true) {
                   window.handleListClick(m.object.userData.benchId)
                 }
-              }})
+              }
+            })
             bool = false;
             bool1 = false;
           }
@@ -801,12 +814,12 @@ export function uwbMain(domId, modelWidth, modelHeight, finalMode, callback) {
             marginLeft = (width - (width * 1.8)) / 2;
             marginTop = (height - (height * 1.8)) / 2;
 
-            mouse.x = ((event.clientX + Math.abs(marginLeft))  / parseFloat(housePlayer.style.width)) * 2 - 1;
+            mouse.x = ((event.clientX + Math.abs(marginLeft)) / parseFloat(housePlayer.style.width)) * 2 - 1;
             mouse.y = -((event.clientY + Math.abs(marginTop)) / parseFloat(housePlayer.style.height)) * 2 + 1;
           }
 
 
-          
+
           console.log('======鼠标坐标=====', mouse)
 
           raycaster.setFromCamera(mouse, sdkInstance.player.cameras.floorplan);

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

@@ -31,6 +31,11 @@
   background-color: #92949B;
 }
 
+.taskBtn.stopped {
+  background-image: none;
+  background-color: #F96262;
+}
+
 .process-percent {
   border-radius: 30px;
   background-color: #000;

+ 17 - 6
src/views/ordinaryPage/index.vue

@@ -461,7 +461,6 @@
             :caseSubFunction="caseSubFunction"
             :caseMarket="caseMarket"
             :caseLanguage="caseLanguage"
-            v-if="renderBenchList"
             :selectRowCase="selectRowCase"
             :clickBackToAutoPlanList="clickBackToAutoPlanList"
             :tabClass="tabClass"
@@ -473,6 +472,7 @@
             :isShowIssueDetail="isShowIssueDetail"
             :currentIssue="currentIssue"
             :currentPlanId="currentPlanId"
+            :currentPlanName="currentPlanName"
             :submitAutoCase="submitAutoCase"
             :clickBackToAutoCaseList="clickBackToAutoCaseList"
             :clickBackToIssueList="clickBackToIssueList"
@@ -609,6 +609,7 @@ export default {
       currentCase: null,
       currentIssue: null,
       currentPlanId: null,
+      currentPlanName: null,
       currentCaseIndex: 0,
       tabs: [
         {
@@ -1021,11 +1022,22 @@ export default {
     {
       this.autoPlanResultInterval = setInterval(() => {
         let autoCurrentTaskData = window.localStorage.getItem("autoCurrentTaskData");
+        let autoCurrentTaskName = window.localStorage.getItem("autoCurrentTaskName");
         autoCurrentTaskData = JSON.parse(autoCurrentTaskData);
-        debugger
+        autoCurrentTaskName = JSON.parse(autoCurrentTaskName);
         if (autoCurrentTaskData) {
           for (let planId in autoCurrentTaskData) {
             let planExecId = autoCurrentTaskData[planId];
+            if (autoCurrentTaskName) {
+              let planName = autoCurrentTaskName[planId];
+              if (planName) {
+                this.$store.dispatch("caseList/fetchAutoCaseList", {
+                  planId: planId,
+                  planName: planName
+                });
+              }
+            }
+            
             this.$store.dispatch("caseList/setPlanExecId", planExecId);
             this.$store.dispatch('caseList/getAutoPlanResult',{planId, planExecId});
           }
@@ -1098,10 +1110,7 @@ export default {
     },
     submitAutoCase() {
       if (this.autoTaskStatus == 'waiting' || this.autoTaskStatus == 'running') {
-        let plan = JSON.parse(localStorage.getItem('autoCurrentTaskData'))
-        let planId = plan.id || 0;
-        this.$store.dispatch('caseList/cancelPlan', planId);
-        clearInterval(this.autoPlanResultInterval)
+        this.$store.dispatch('caseList/cancelPlan');
         this.clickBackToTaskList()
         this.isShowAutoCaseList = false;
         return
@@ -1118,6 +1127,7 @@ export default {
       debugger
       if (!auto || auto == "undefined" || auto == "false") {
         this.currentPlanId = id;
+        this.currentPlanName = name;
         this.$store.dispatch("caseList/fetchCaseList", {
           uuid: id,
           page_num: 1,
@@ -1129,6 +1139,7 @@ export default {
       } else {
         if (id == 109) id = 222;
         this.currentPlanId = id;
+        this.currentPlanName = name;
         this.$store.dispatch("caseList/setCurrentPlanId", id);
         this.$store.dispatch("caseList/fetchAutoCaseList", {
           planId: id,