From 393c717d50fe8933e57d3014c6932b2acb750a50 Mon Sep 17 00:00:00 2001
From: whychdw <49690745@qq.com>
Date: 星期一, 24 五月 2021 10:27:17 +0800
Subject: [PATCH] 提交内容

---
 src/pages/test/noLoadTest.vue            |  910 +++++++++++++++++++++++----------------------
 src/pages/test/dialog/testStart.vue      |   38 +
 src/pages/test/dialog/LoadTestDialog.vue |   60 +-
 src/pages/test/js/const.js               |   14 
 src/assets/css/science-blue.css          |    7 
 src/pages/test/dialog/testStepCheck.vue  |   95 ++++
 src/pages/test/js/api.js                 |   15 
 src/pages/test/loadTest.vue              |   26 
 8 files changed, 682 insertions(+), 483 deletions(-)

diff --git a/src/assets/css/science-blue.css b/src/assets/css/science-blue.css
index be20b2f..11da5a0 100644
--- a/src/assets/css/science-blue.css
+++ b/src/assets/css/science-blue.css
@@ -989,4 +989,11 @@
 }
 .el-dialog__wrapper.position-absolute {
 	position: absolute;
+}
+
+.test-explain p{
+	line-height: 1.32rem;
+}
+.text-indent-two {
+	text-indent: 2rem;
 }
\ No newline at end of file
diff --git a/src/pages/test/dialog/LoadTestDialog.vue b/src/pages/test/dialog/LoadTestDialog.vue
index d23db2d..64dd091 100644
--- a/src/pages/test/dialog/LoadTestDialog.vue
+++ b/src/pages/test/dialog/LoadTestDialog.vue
@@ -1,25 +1,35 @@
 <template>
-    <el-dialog
-        :visible.sync="dialogVisible" class="position-absolute dialog-center dialog-no-header" width="840px"
-        top="0" :modal="false" :destroy-on-close="true" :close-on-press-escape="false" :close-on-click-modal="false"
-        :modal-append-to-body="false"
-        v-loading="loading" element-loading-text="鎷煎懡鍔犺浇涓�"
-        element-loading-spinner="el-icon-loading"
-        element-loading-background="rgba(0, 0, 0, 0)">
-        <mw-step v-model="step"></mw-step>
-        <div class="step-list">
-            <div class="step-item" v-show="step == 0">
-                <new-test @nextStep="newTest"></new-test>
+    <div class="el-dialog-wrapper">
+        <el-dialog
+            :visible.sync="dialogVisible" class="position-absolute dialog-center dialog-no-header" width="840px"
+            top="0" :modal="false" :destroy-on-close="true" :close-on-press-escape="false" :close-on-click-modal="false"
+            :modal-append-to-body="false"
+            v-loading="loading" element-loading-text="鎷煎懡鍔犺浇涓�"
+            element-loading-spinner="el-icon-loading"
+            element-loading-background="rgba(0, 0, 0, 0)">
+            <mw-step v-model="step"></mw-step>
+            <div class="step-list">
+                <div class="step-item" v-show="step == 0">
+                    <new-test @nextStep="newTest"></new-test>
+                </div>
+                <div class="step-item" v-show="step == 1" v-if="step>0">
+                    <test-data-input :type="params.type" @nextStep="dataInput"></test-data-input>
+                </div>
+                <div class="step-item" v-show="step == 2" v-if="step>1">
+                    <test-step-confirm v-if="type=='fz'" @nextStep="completeTest"></test-step-confirm>
+                    <test-step-confirm-kz v-else-if="type=='kz'" @nextStep="completeTest"></test-step-confirm-kz>
+                </div>
             </div>
-            <div class="step-item" v-show="step == 1" v-if="step>0">
-                <test-data-input :type="params.type" @nextStep="dataInput"></test-data-input>
-            </div>
-            <div class="step-item" v-show="step == 2" v-if="step>1">
-                <test-step-confirm v-if="type=='fz'" @nextStep="completeTest"></test-step-confirm>
-                <test-step-confirm-kz v-else-if="type=='kz'" @nextStep="completeTest"></test-step-confirm-kz>
-            </div>
-        </div>
-    </el-dialog>
+        </el-dialog>
+        <el-dialog
+            :visible.sync="testStepCheck" class="position-absolute dialog-center dialog-no-header"
+            width="840px" top="0"
+            :modal="false" :destroy-on-close="true"
+            :close-on-press-escape="false" :close-on-click-modal="false"
+            :modal-append-to-body="false">
+            <test-start :type="type" @startTest="startTest" v-if="testStepCheck"></test-start>
+        </el-dialog>
+    </div>
 </template>
 
 <script>
@@ -28,6 +38,7 @@
 import TestDataInput from "@/pages/test/dialog/testDataInput";
 import TestStepConfirm from "@/pages/test/dialog/testStepConfirm";
 import testStepConfirmKz from "@/pages/test/dialog/testStepConfirmKz";
+import TestStart from "@/pages/test/dialog/testStart";
 import {addKzFzTest} from "@/pages/test/js/api";
 
 export default {
@@ -47,13 +58,15 @@
         TestDataInput,
         mwStep,
         newTest,
-        testStepConfirmKz
+        testStepConfirmKz,
+        TestStart
     },
     data() {
         return {
             loading: false,
             step: 0,
             dialogVisible: false,
+            testStepCheck: false,
             params: {
                 baseData: {
                     experimentId: "",           // 璇曢獙缂栧彿
@@ -113,11 +126,11 @@
             this.loading = true;
             addKzFzTest(this.params).then(res => {
                 let rs = res.data;
-                console.log(rs);
                 if (rs.code == 1) {
                     this.dialogVisible = false;
                     this.$nextTick(() => {
                         this.$layer.msg("鐢熸垚璇曢獙鎴愬姛");
+                        this.testStepCheck = true;
                     });
                 } else {
                     this.$layer.msg("鐢熸垚璇曢獙澶辫触");
@@ -128,6 +141,9 @@
                 this.loading = false;
             });
         },
+        startTest() {
+            console.log(123);
+        }
     },
     mounted() {
         this.params.type = this.type;
diff --git a/src/pages/test/dialog/testStart.vue b/src/pages/test/dialog/testStart.vue
new file mode 100644
index 0000000..b8c0a78
--- /dev/null
+++ b/src/pages/test/dialog/testStart.vue
@@ -0,0 +1,38 @@
+<template>
+    <div class="params-container params-container-flex">
+        <div class="form-title">
+
+        </div>
+        <div class="form-wrapper">
+            <div class="test-explain">
+                <p class="p-h">褰撳墠姝ラ</p>
+                <p class="text-indent-two">鈶� 琚瘯鐢垫満鍦ㄩ瀹氶鐜囷紝棰濆畾鐢靛帇鍙婇瀹氳礋杞戒笅杩愯鍒版俯鍗囩ǔ瀹�</p>
+            </div>
+            <test-step-check :type="type"></test-step-check>
+        </div>
+        <div class="footer-button">
+
+        </div>
+    </div>
+</template>
+
+<script>
+import TestStepCheck from "@/pages/test/dialog/testStepCheck";
+export default {
+    name: "testStart",
+    components: {TestStepCheck},
+    props: {
+        type: {
+            type: String,
+            default: "",
+        }
+    },
+}
+</script>
+
+<style scoped>
+.p-h {
+    font-size: 18px;
+    font-weight: 700;
+}
+</style>
\ No newline at end of file
diff --git a/src/pages/test/dialog/testStepCheck.vue b/src/pages/test/dialog/testStepCheck.vue
index d5b575f..4916634 100644
--- a/src/pages/test/dialog/testStepCheck.vue
+++ b/src/pages/test/dialog/testStepCheck.vue
@@ -1,17 +1,104 @@
 <template>
-    <div class="params-container params-container-flex">
-        <div class="form-wrapper">
-
+    <div class="test-check">
+        <div class="test-explain">
+            <p class="p-h">鍓嶇疆鏉′欢妫�鏌�</p>
+        </div>
+        <div class="test-explain"
+            v-loading="loading"
+            element-loading-text="妫�鏌ヤ腑"
+            element-loading-spinner="el-icon-loading"
+            element-loading-background="rgba(0, 0, 0, 0)">
+            <table>
+                <tbody>
+                <tr v-for="(item, key) in list" :key="'item'+key">
+                    <td class="td-name">{{ item.name }}</td>
+                    <td>{{ item.valueDescription }}</td>
+                    <td class="td-status">{{ item.status ? "妫�鏌ユ甯�" : "妫�鏌ュ紓甯�" }}</td>
+                </tr>
+                </tbody>
+            </table>
+        </div>
+        <div class="test-check-button" v-if="showButton">
+            <el-button type="primary" size="small" @click="startTest">寮�濮嬭瘯楠�</el-button>
         </div>
     </div>
 </template>
 
 <script>
+import {checkPrecondition} from "@/pages/test/js/api";
+
 export default {
-    name: "testStepCheck"
+    name: "testStepCheck",
+    props: {
+        type: {
+            type: String,
+            default: ""
+        }
+    },
+    data() {
+        return {
+            loading: false,
+            showButton: false,
+            list: [],
+        }
+    },
+    methods: {
+        checkPrecondition() {
+            this.loading = true;
+            this.$nextTick(() => {
+                checkPrecondition(this.type).then(res => {
+                    let rs = res.data;
+                    let data = [];
+                    if (rs.code == 1) {
+                        data = rs.data;
+                    }
+                    this.list = data;
+                    this.loading = false;
+                    this.showButton = true;
+                }).catch(error => {
+                    this.loading = false;
+                    console.log(error);
+                });
+            });
+        },
+        startTest() {
+            this.$emit('startTest');
+        }
+    },
+    mounted() {
+        this.checkPrecondition();
+    }
 }
 </script>
 
 <style scoped>
+.p-h {
+    font-size: 18px;
+    font-weight: 700;
+}
 
+.test-check {
+    min-height: 300px;
+}
+
+.test-explain table {
+    margin-left: 32px;
+}
+
+.test-explain table td {
+    padding: 4px 16px;
+}
+
+.test-explain table td.td-name {
+    text-align: right;
+}
+
+.test-explain table td.td-status {
+    font-weight: 700;
+}
+
+.test-check-button {
+    padding: 8px 16px;
+    text-align: right;
+}
 </style>
\ No newline at end of file
diff --git a/src/pages/test/js/api.js b/src/pages/test/js/api.js
index e63e342..7137b44 100644
--- a/src/pages/test/js/api.js
+++ b/src/pages/test/js/api.js
@@ -126,4 +126,19 @@
         params: params,
     });
 
+}
+
+/**
+ * 妫�鏌ュ墠缃潯浠�
+ * @param type
+ * @returns {AxiosPromise}
+ */
+export const checkPrecondition = (type) => {
+    return axios({
+        method: "GET",
+        url: "/experiment/checkPrecondition",
+        params: {
+            type: type,
+        }
+    });
 }
\ No newline at end of file
diff --git a/src/pages/test/js/const.js b/src/pages/test/js/const.js
new file mode 100644
index 0000000..d4d4137
--- /dev/null
+++ b/src/pages/test/js/const.js
@@ -0,0 +1,14 @@
+export const constTestType = [
+    {
+        label: '绌鸿浇璇曢獙',
+        value: 'kz',
+    },
+    {
+        label: '璐熻浇璇曢獙',
+        value: 'fz',
+    },
+    {
+        label: '缁曢樆璇曢獙',
+        value: 'rz'
+    }
+];
\ No newline at end of file
diff --git a/src/pages/test/loadTest.vue b/src/pages/test/loadTest.vue
index 409c802..5b88cd8 100644
--- a/src/pages/test/loadTest.vue
+++ b/src/pages/test/loadTest.vue
@@ -202,15 +202,7 @@
                 </div>
             </div>
         </div>
-        <load-test-dialog type="fz" :visible="dialogVisible"></load-test-dialog>
-        <el-dialog
-            :visible.sync="testStepCheck" class="position-absolute dialog-center dialog-no-header"
-            width="840px" top="0"
-            :modal="false" :destroy-on-close="true"
-            :close-on-press-escape="false" :close-on-click-modal="false"
-            :modal-append-to-body="false">
-
-        </el-dialog>
+        <load-test-dialog :type="type" :visible="dialogVisible"></load-test-dialog>
     </div>
 </template>
 
@@ -225,6 +217,8 @@
 import absPanel from '@/components/smallModule/absPanel.vue';
 import LoadTestDialog from "@/pages/test/dialog/LoadTestDialog";
 import {getExitTest} from "@/pages/test/js/api";
+import {constTestType} from "@/pages/test/js/const";
+import {getLabel} from "@/assets/js/tools";
 
 let diagram;
 export default {
@@ -241,6 +235,7 @@
     },
     data() {
         return {
+            type: 'fz',
             dialogVisible: false,
             speedValue: 0,
             nbmspeedValue: 0,
@@ -387,7 +382,6 @@
                     unit: "V",
                 },
             ],
-            testStepCheck: false,
         }
     },
     watch: {
@@ -479,7 +473,17 @@
             getExitTest().then(res=>{
                 let rs = res.data;
                 if(rs.code ==  1) {
-                    this.$layer.msg('宸插瓨鍦ㄨ瘯楠�');
+                    let data = rs.data;
+                    if(data.type != this.type) {
+                        let testType = getLabel(data.type, constTestType);
+                        this.$alert("褰撳墠宸插紑鍚瘯楠岋細"+testType+"銆傚闇�瑕佽繘琛屽叾浠栬瘯楠岄渶鍏堝叧闂璇曢獙銆�", '绯荤粺鎻愮ず', {
+                            callback:()=>{
+                                this.$router.push('/index/testManager/testing');
+                            }
+                        });
+                    }else {
+                        console.log('鏌ヨ璇曢獙姝ラ');
+                    }
                 }else {
                     this.dialogVisible = true;
                 }
diff --git a/src/pages/test/noLoadTest.vue b/src/pages/test/noLoadTest.vue
index 39e51b1..17759be 100644
--- a/src/pages/test/noLoadTest.vue
+++ b/src/pages/test/noLoadTest.vue
@@ -1,482 +1,500 @@
 <template>
-  <div class="noLoadTest">
-    <div class="page-panel-title">
-      <span class="title-pillar"></span>
-      绌鸿浇璇曢獙
-    </div>
-    <div class="flex-warp">
-      <div class="top" style="width:19%;">
-        <div class="modelItemWarp" style="height:50%">
-          <div class="content">
-            <div class="title">瀹氬瓙娓╁害鎯呭喌</div>
-            <div class="con">
-              <bar-chart ref="temperatureBar" id="temperatureBar" :show-label="false"></bar-chart>
-            </div>
-          </div>
+    <div class="noLoadTest">
+        <div class="page-panel-title">
+            <span class="title-pillar"></span>
+            绌鸿浇璇曢獙
         </div>
-        <div class="modelItemWarp" style="height:50%">
-          <div class="content">
-            <div class="title">鍛婅鎯呭喌</div>
-            <div class="con">
-              <div class="scrollCon">
-                <div class="list">
-                  <div class="text">10:30 AFE鍙橀椹卞姩鏌滃姛鐜囧紓甯稿憡璀�</div>
-                  <div class="see">鏌ョ湅</div>
+        <div class="flex-warp">
+            <div class="top" style="width:19%;">
+                <div class="modelItemWarp" style="height:50%">
+                    <div class="content">
+                        <div class="title">瀹氬瓙娓╁害鎯呭喌</div>
+                        <div class="con">
+                            <bar-chart ref="temperatureBar" id="temperatureBar" :show-label="false"></bar-chart>
+                        </div>
+                    </div>
                 </div>
-                <div class="list">
-                  <div class="text">10:45 鍙楄瘯鐢垫満娓╁害寮傚父鍛婅</div>
-                  <div class="see">鏌ョ湅</div>
+                <div class="modelItemWarp" style="height:50%">
+                    <div class="content">
+                        <div class="title">鍛婅鎯呭喌</div>
+                        <div class="con">
+                            <div class="scrollCon">
+                                <div class="list">
+                                    <div class="text">10:30 AFE鍙橀椹卞姩鏌滃姛鐜囧紓甯稿憡璀�</div>
+                                    <div class="see">鏌ョ湅</div>
+                                </div>
+                                <div class="list">
+                                    <div class="text">10:45 鍙楄瘯鐢垫満娓╁害寮傚父鍛婅</div>
+                                    <div class="see">鏌ョ湅</div>
+                                </div>
+                            </div>
+                        </div>
+                    </div>
                 </div>
-              </div>
             </div>
-          </div>
-        </div>
-      </div>
-      <div class="modelItemWarp top" style="width:50%;">
-        <div class="content">
-          <div class="title">璇曢獙鎷撴墤鍥�</div>
-          <div class="con" style="position:relative;">
-            <div class="diagram-content">
-              <div class="diagram-stc" ref="static"></div>
-              <div class="diagram-flush" ref="flush"></div>
-            </div>
-            <div class="diagramStatus">
-              <status-module :statusList="diagramStatus"></status-module>
-            </div>
-            <abs-panel class="diagramPanel1" title="鐩存祦閰嶇數鏌�" :list="dcBox"></abs-panel>
-            <abs-panel class="diagramPanel2" title="鍙楄瘯鐢垫満" :list="underTestMotor"></abs-panel>
-            <div class="thermometerCon">
-              <mw-thermometer :switch="true"></mw-thermometer>
-              鍙楄瘯鐢垫満<br>姘村喎寮�鍚�
-            </div>
+            <div class="modelItemWarp top" style="width:50%;">
+                <div class="content">
+                    <div class="title">璇曢獙鎷撴墤鍥�</div>
+                    <div class="con" style="position:relative;">
+                        <div class="diagram-content">
+                            <div class="diagram-stc" ref="static"></div>
+                            <div class="diagram-flush" ref="flush"></div>
+                        </div>
+                        <div class="diagramStatus">
+                            <status-module :statusList="diagramStatus"></status-module>
+                        </div>
+                        <abs-panel class="diagramPanel1" title="鐩存祦閰嶇數鏌�" :list="dcBox"></abs-panel>
+                        <abs-panel class="diagramPanel2" title="鍙楄瘯鐢垫満" :list="underTestMotor"></abs-panel>
+                        <div class="thermometerCon">
+                            <mw-thermometer :switch="true"></mw-thermometer>
+                            鍙楄瘯鐢垫満<br>姘村喎寮�鍚�
+                        </div>
 
-          </div>
-        </div>
-      </div>
-      <div class="modelItemWarp top" style="width:31%;">
-        <div class="content">
-          <div class="title">瀹炴椂鏇茬嚎</div>
-          <div class="con">
-            <div class="chartTitle">绌鸿浇鐢垫満鐢靛帇涓庨珮閫熼娇杞叧绯绘洸绾�</div>
-            <div class="lineCon">
-              <double-line id="DoubleLine" ref="DoubleLine"></double-line>
-            </div>
-            <div class="chartTitle">楂橀�熼娇杞浆閫�</div>
-            <div class="chartTitle mw-process-warp">
-              <mw-process :process="60" text="600"></mw-process>
-            </div>
-            <div class="chartTitle">鍙楄瘯鐢垫満鐢靛帇</div>
-            <div class="chartTitle mw-process-warp">
-              <mw-section-process title="褰撳墠鐢靛帇 600V" leftText="-5V" rightText="+6V"></mw-section-process>
-            </div>
-            <div class="chartTitle">鍙楄瘯鐢垫満鐢垫祦</div>
-            <div class="chartTitle mw-process-warp">
-              <mw-section-process title="褰撳墠鐢靛帇 2200mA" leftText="-20mA" rightText="+20mA"></mw-section-process>
-            </div>
-          </div>
-        </div>
-      </div>
-      <div class="modelItemWarp bottom" style="width:26%;">
-        <div class="content">
-          <div class="title">鐩存祦璋冮�熸煖鎿嶄綔</div>
-          <div class="con">
-            <div class="speedCon">
-              <el-slider v-model="speedValue"></el-slider>
-            </div>
-            <div class="flexCon">
-              <el-button type="primary" size="mini" @click="changeSpeed('add')">鍔犻��</el-button>
-              <el-button type="primary" size="mini" @click="changeSpeed('reduce')">鍑忛��</el-button>
-              <el-input v-model="nbmspeedValue" placeholder="璇疯緭鍏ュ唴瀹�" size="mini" class="speedInput"></el-input>
-              <el-button type="primary" size="mini">纭璋冮��</el-button>
-            </div>
-          </div>
-        </div>
-      </div>
-      <div class="modelItemWarp bottom" style="width:26%;">
-        <div class="content">
-          <div class="title">AFE鍙橀鎿嶄綔</div>
-          <div class="con">
-            <div class="flexWarp">
-              <div class="status">
-                <div class="text">鏁存祦鍚姩</div>
-                <div class="moduleCon">
-                  <status-module :statusList="statusList1"></status-module>
+                    </div>
                 </div>
-              </div>
-              <div class="status">
-                <div class="text">鏁存祦閫嗗彉</div>
-                <div class="moduleCon">
-                  <status-module :statusList="statusList2"></status-module>
-                </div>
-              </div>
-              <div class="status">
-                <div class="text">鏁存祦妯″紡</div>
-                <div class="moduleCon">
-                  <status-module :statusList="statusList3"></status-module>
-                </div>
-              </div>
-              <div class="status lineCon">
-                <div class="line">
-                  <div class="text">VF</div>
-                  <el-input v-model="VFValue" placeholder="璇疯緭鍏ュ唴瀹�" size="mini" class="input"></el-input>
-                  <div class="text">鍙傝�冨��1~50</div>
-                </div>
-                <div class="line">
-                  <div class="text">SVC</div>
-                  <el-input v-model="SVCValue" placeholder="璇疯緭鍏ュ唴瀹�" size="mini" class="input"></el-input>
-                  <div class="text">鍙傝�冨��1~200</div>
-                </div>
-                <div class="line">
-                  <div class="text">FVC</div>
-                  <el-input v-model="FVCValue" placeholder="璇疯緭鍏ュ唴瀹�" size="mini" class="input"></el-input>
-                  <div class="text">鍙傝�冨��1~1000</div>
-                </div>
-              </div>
-              <div class="status">
-                <el-button type="primary" size="mini">鏁存祦澶嶄綅</el-button>
-                <el-button type="danger" size="mini">绱ф�ュ仠姝�</el-button>
-              </div>
             </div>
-          </div>
+            <div class="modelItemWarp top" style="width:31%;">
+                <div class="content">
+                    <div class="title">瀹炴椂鏇茬嚎</div>
+                    <div class="con">
+                        <div class="chartTitle">绌鸿浇鐢垫満鐢靛帇涓庨珮閫熼娇杞叧绯绘洸绾�</div>
+                        <div class="lineCon">
+                            <double-line id="DoubleLine" ref="DoubleLine"></double-line>
+                        </div>
+                        <div class="chartTitle">楂橀�熼娇杞浆閫�</div>
+                        <div class="chartTitle mw-process-warp">
+                            <mw-process :process="60" text="600"></mw-process>
+                        </div>
+                        <div class="chartTitle">鍙楄瘯鐢垫満鐢靛帇</div>
+                        <div class="chartTitle mw-process-warp">
+                            <mw-section-process title="褰撳墠鐢靛帇 600V" leftText="-5V" rightText="+6V"></mw-section-process>
+                        </div>
+                        <div class="chartTitle">鍙楄瘯鐢垫満鐢垫祦</div>
+                        <div class="chartTitle mw-process-warp">
+                            <mw-section-process title="褰撳墠鐢靛帇 2200mA" leftText="-20mA"
+                                                rightText="+20mA"></mw-section-process>
+                        </div>
+                    </div>
+                </div>
+            </div>
+            <div class="modelItemWarp bottom" style="width:26%;">
+                <div class="content">
+                    <div class="title">鐩存祦璋冮�熸煖鎿嶄綔</div>
+                    <div class="con">
+                        <div class="speedCon">
+                            <el-slider v-model="speedValue"></el-slider>
+                        </div>
+                        <div class="flexCon">
+                            <el-button type="primary" size="mini" @click="changeSpeed('add')">鍔犻��</el-button>
+                            <el-button type="primary" size="mini" @click="changeSpeed('reduce')">鍑忛��</el-button>
+                            <el-input v-model="nbmspeedValue" placeholder="璇疯緭鍏ュ唴瀹�" size="mini"
+                                      class="speedInput"></el-input>
+                            <el-button type="primary" size="mini">纭璋冮��</el-button>
+                        </div>
+                    </div>
+                </div>
+            </div>
+            <div class="modelItemWarp bottom" style="width:26%;">
+                <div class="content">
+                    <div class="title">AFE鍙橀鎿嶄綔</div>
+                    <div class="con">
+                        <div class="flexWarp">
+                            <div class="status">
+                                <div class="text">鏁存祦鍚姩</div>
+                                <div class="moduleCon">
+                                    <status-module :statusList="statusList1"></status-module>
+                                </div>
+                            </div>
+                            <div class="status">
+                                <div class="text">鏁存祦閫嗗彉</div>
+                                <div class="moduleCon">
+                                    <status-module :statusList="statusList2"></status-module>
+                                </div>
+                            </div>
+                            <div class="status">
+                                <div class="text">鏁存祦妯″紡</div>
+                                <div class="moduleCon">
+                                    <status-module :statusList="statusList3"></status-module>
+                                </div>
+                            </div>
+                            <div class="status lineCon">
+                                <div class="line">
+                                    <div class="text">VF</div>
+                                    <el-input v-model="VFValue" placeholder="璇疯緭鍏ュ唴瀹�" size="mini"
+                                              class="input"></el-input>
+                                    <div class="text">鍙傝�冨��1~50</div>
+                                </div>
+                                <div class="line">
+                                    <div class="text">SVC</div>
+                                    <el-input v-model="SVCValue" placeholder="璇疯緭鍏ュ唴瀹�" size="mini"
+                                              class="input"></el-input>
+                                    <div class="text">鍙傝�冨��1~200</div>
+                                </div>
+                                <div class="line">
+                                    <div class="text">FVC</div>
+                                    <el-input v-model="FVCValue" placeholder="璇疯緭鍏ュ唴瀹�" size="mini"
+                                              class="input"></el-input>
+                                    <div class="text">鍙傝�冨��1~1000</div>
+                                </div>
+                            </div>
+                            <div class="status">
+                                <el-button type="primary" size="mini">鏁存祦澶嶄綅</el-button>
+                                <el-button type="danger" size="mini">绱ф�ュ仠姝�</el-button>
+                            </div>
+                        </div>
+                    </div>
+                </div>
+            </div>
+            <div class="modelItemWarp bottom" style="width:8.5%;">
+                <div class="content">
+                    <div class="title">鏁存祦鐢靛帇鎿嶄綔</div>
+                    <div class="con">
+                        <div class="couflex">
+                            <el-button type="primary" size="mini" class="stopBtn">鍋滄</el-button>
+                            <el-button type="danger" size="mini" class="stopBtn">绱ф�ュ仠姝�</el-button>
+                        </div>
+                    </div>
+                </div>
+            </div>
+            <div class="modelItemWarp bottom" style="width:8.5%;">
+                <div class="content">
+                    <div class="title">姘村喎鎿嶄綔</div>
+                    <div class="con">
+                        <div class="couflex">
+                            <div class="optItem">
+                                <div class="lineTit">AFE鍙橀鍣ㄦ按鍐�</div>
+                                <mw-switch v-model="value1" text="寮�鍚瘄鍏抽棴"></mw-switch>
+                            </div>
+                            <div class="optItem">
+                                <div class="lineTit">鍙楄瘯鐢垫満姘村喎</div>
+                                <mw-switch v-model="value1" text="寮�鍚瘄鍏抽棴"></mw-switch>
+                            </div>
+                            <div class="optItem">
+                                <div class="lineTit">娴嬪姛鐢垫満姘村喎</div>
+                                <mw-switch v-model="value1" text="寮�鍚瘄鍏抽棴"></mw-switch>
+                            </div>
+                        </div>
+                    </div>
+                </div>
+            </div>
+            <div class="modelItemWarp bottom" style="width:31%;">
+                <div class="content">
+                    <div class="title">璇曢獙鐘舵��</div>
+                    <div class="con" style="position:relative;overflow:auto;">
+                        <div class="stepCont">
+                            <step-list v-for="(item, index) in list" :key="'key'+index" :data="item"
+                                       :end="(list.length-1) == index"
+                                       size="mini">
+                            </step-list>
+                        </div>
+                        <div class="stepBtnCon">
+                            <el-button type="primary" size="mini">鏌ョ湅缁撴灉</el-button>
+                            <el-button type="primary" size="mini">瀹屾垚璇曢獙</el-button>
+                        </div>
+                    </div>
+                </div>
+            </div>
         </div>
-      </div>
-      <div class="modelItemWarp bottom" style="width:8.5%;">
-        <div class="content">
-          <div class="title">鏁存祦鐢靛帇鎿嶄綔</div>
-          <div class="con">
-            <div class="couflex">
-              <el-button type="primary" size="mini" class="stopBtn">鍋滄</el-button>
-              <el-button type="danger" size="mini" class="stopBtn">绱ф�ュ仠姝�</el-button>
-            </div>
-          </div>
-        </div>
-      </div>
-      <div class="modelItemWarp bottom" style="width:8.5%;">
-        <div class="content">
-          <div class="title">姘村喎鎿嶄綔</div>
-          <div class="con">
-            <div class="couflex">
-              <div class="optItem">
-                <div class="lineTit">AFE鍙橀鍣ㄦ按鍐�</div>
-                <mw-switch v-model="value1" text="寮�鍚瘄鍏抽棴"></mw-switch>
-              </div>
-              <div class="optItem">
-                <div class="lineTit">鍙楄瘯鐢垫満姘村喎</div>
-                <mw-switch v-model="value1" text="寮�鍚瘄鍏抽棴"></mw-switch>
-              </div>
-              <div class="optItem">
-                <div class="lineTit">娴嬪姛鐢垫満姘村喎</div>
-                <mw-switch v-model="value1" text="寮�鍚瘄鍏抽棴"></mw-switch>
-              </div>
-            </div>
-          </div>
-        </div>
-      </div>
-      <div class="modelItemWarp bottom" style="width:31%;">
-        <div class="content">
-          <div class="title">璇曢獙鐘舵��</div>
-          <div class="con" style="position:relative;overflow:auto;">
-            <div class="stepCont">
-              <step-list v-for="(item, index) in list" :key="'key'+index" :data="item" :end="(list.length-1) == index"
-                size="mini">
-              </step-list>
-            </div>
-            <div class="stepBtnCon">
-              <el-button type="primary" size="mini">鏌ョ湅缁撴灉</el-button>
-              <el-button type="primary" size="mini">瀹屾垚璇曢獙</el-button>
-            </div>
-          </div>
-        </div>
-      </div>
+        <load-test-dialog :type="type" :visible="dialogVisible"></load-test-dialog>
     </div>
-    <load-test-dialog type="kz" :visible="dialogVisible"></load-test-dialog>
-  </div>
 </template>
 
 <script>
-  import barChart from '@/components/chart/barChart.vue'
-  import gridCircuitDiagram from '@/pages/test/js/noLoadTestDiagram'
-  import DoubleLine from '@/components/chart/doubleLine.vue';
-  import StepList from '@/components/smallModule/stepList.vue';
-  import MwSwitch from '@/components/smallModule/mwSwitch.vue';
-  import StatusModule from '@/components/smallModule/statusModule.vue';
-  import absPanel from '@/components/smallModule/absPanel.vue';
-  import MwProcess from '@/components/smallModule/mwProcess.vue';
-  import MwSectionProcess from '@/components/smallModule/mwSectionProcess.vue';
-  import MwThermometer from '@/components/smallModule/mwThermometer.vue';
-  import LoadTestDialog from "@/pages/test/dialog/LoadTestDialog";
-  import {
+import barChart from '@/components/chart/barChart.vue'
+import gridCircuitDiagram from '@/pages/test/js/noLoadTestDiagram'
+import DoubleLine from '@/components/chart/doubleLine.vue';
+import StepList from '@/components/smallModule/stepList.vue';
+import MwSwitch from '@/components/smallModule/mwSwitch.vue';
+import StatusModule from '@/components/smallModule/statusModule.vue';
+import absPanel from '@/components/smallModule/absPanel.vue';
+import MwProcess from '@/components/smallModule/mwProcess.vue';
+import MwSectionProcess from '@/components/smallModule/mwSectionProcess.vue';
+import MwThermometer from '@/components/smallModule/mwThermometer.vue';
+import LoadTestDialog from "@/pages/test/dialog/LoadTestDialog";
+import {
     getExitTest,
     experimentPoint
-  } from "@/pages/test/js/api";
-  let diagram;
-  export default {
+} from "@/pages/test/js/api";
+import {getLabel} from "@/assets/js/tools";
+import {constTestType} from "@/pages/test/js/const";
+
+let diagram;
+export default {
     components: {
-      barChart,
-      DoubleLine,
-      StepList,
-      MwSwitch,
-      StatusModule,
-      MwProcess,
-      MwSectionProcess,
-      MwThermometer,
-      absPanel,
-      LoadTestDialog,
+        barChart,
+        DoubleLine,
+        StepList,
+        MwSwitch,
+        StatusModule,
+        MwProcess,
+        MwSectionProcess,
+        MwThermometer,
+        absPanel,
+        LoadTestDialog,
     },
     data() {
-      return {
-        dialogVisible: false,
-        dcBox: [{
-            label: '鐢靛帇锛�',
-            value: 0,
-            unit: "V",
-          },
-          {
-            label: '鐢垫祦锛�',
-            value: 0,
-            unit: "A",
-          },
-        ],
-        underTestMotor: [{
-            label: '杞�燂細',
-            value: 0,
-            unit: "r/min",
-          },
-          {
-            label: '鍔熺巼锛�',
-            value: 0,
-            unit: "kW",
-          },
-          {
-            label: '鍣0锛�',
-            value: 0,
-            unit: "dB",
-          },
-        ],
-        text1Pos: [20, 20],
-        value1: true,
-        speedValue: 0,
-        nbmspeedValue: 0,
-        VFValue: 10,
-        SVCValue: 30,
-        FVCValue: 110,
-        statusList1: [{
-          text: '杩愯涓�',
-          color: '#82e866',
-          status: false
-        }, {
-          text: '宸插仠姝�',
-          color: '#f78989',
-          status: true
-        }],
-        statusList2: [{
-          text: '杩愯涓�',
-          color: '#82e866',
-          status: true
-        }, {
-          text: '宸插仠姝�',
-          color: '#f78989',
-          status: false
-        }],
-        statusList3: [{
-          text: '閫熷害',
-          color: '#82e866',
-          status: false
-        }, {
-          text: '杞煩',
-          color: '#82e866',
-          status: true
-        }],
-        diagramStatus: [{
-          text: '杩愯',
-          color: '#82e866',
-          status: true
-        }, {
-          text: '鎶ヨ',
-          color: '#ffff00',
-          status: true
-        }, {
-          text: '鏁呴殰',
-          color: '#f78989',
-          status: true
-        }, {
-          text: '绱у仠',
-          color: '#666ee8',
-          status: true
-        }],
-        list: []
-      }
+        return {
+            type: 'kz',
+            dialogVisible: false,
+            dcBox: [{
+                label: '鐢靛帇锛�',
+                value: 0,
+                unit: "V",
+            },
+                {
+                    label: '鐢垫祦锛�',
+                    value: 0,
+                    unit: "A",
+                },
+            ],
+            underTestMotor: [{
+                label: '杞�燂細',
+                value: 0,
+                unit: "r/min",
+            },
+                {
+                    label: '鍔熺巼锛�',
+                    value: 0,
+                    unit: "kW",
+                },
+                {
+                    label: '鍣0锛�',
+                    value: 0,
+                    unit: "dB",
+                },
+            ],
+            text1Pos: [20, 20],
+            value1: true,
+            speedValue: 0,
+            nbmspeedValue: 0,
+            VFValue: 10,
+            SVCValue: 30,
+            FVCValue: 110,
+            statusList1: [{
+                text: '杩愯涓�',
+                color: '#82e866',
+                status: false
+            }, {
+                text: '宸插仠姝�',
+                color: '#f78989',
+                status: true
+            }],
+            statusList2: [{
+                text: '杩愯涓�',
+                color: '#82e866',
+                status: true
+            }, {
+                text: '宸插仠姝�',
+                color: '#f78989',
+                status: false
+            }],
+            statusList3: [{
+                text: '閫熷害',
+                color: '#82e866',
+                status: false
+            }, {
+                text: '杞煩',
+                color: '#82e866',
+                status: true
+            }],
+            diagramStatus: [{
+                text: '杩愯',
+                color: '#82e866',
+                status: true
+            }, {
+                text: '鎶ヨ',
+                color: '#ffff00',
+                status: true
+            }, {
+                text: '鏁呴殰',
+                color: '#f78989',
+                status: true
+            }, {
+                text: '绱у仠',
+                color: '#666ee8',
+                status: true
+            }],
+            list: []
+        }
     },
     watch: {
-      'nbmspeedValue': {
-        handler(val) {
-          this.speedValue = Number(val)
+        'nbmspeedValue': {
+            handler(val) {
+                this.speedValue = Number(val)
+            },
+            deep: true
         },
-        deep: true
-      },
-      'speedValue': {
-        handler(val) {
-          this.nbmspeedValue = Number(val)
+        'speedValue': {
+            handler(val) {
+                this.nbmspeedValue = Number(val)
+            },
+            deep: true
         },
-        deep: true
-      },
     },
     mounted() {
-      this.initChart();
-      diagram = gridCircuitDiagram(this.$refs.static, this.$refs.flush);
-      this.checkIsTesting();
+        this.initChart();
+        diagram = gridCircuitDiagram(this.$refs.static, this.$refs.flush);
+        this.checkIsTesting();
     },
     methods: {
-      experimentPoint(id) {
-        let postData = {
-          experimentId: id
-        }
-        experimentPoint(postData).then((res) => {
-          let rsData = res.data;
-          if (rsData.code == 1) {
-            rsData.data.map(item => {
-              this.list.push({
-                name: item.name,
-                status: item.status,
-                start: item.startTime ? `寮�濮嬫椂闂碶n${item.startTime}` : '',
-                end: item.endTime ? `瀹屾垚鏃堕棿\n${item.endTime}` : '',
-                endText: item.averagePower ? `骞冲潎鍔熺巼\n${item.averagePower}kW` : '',
-              })
-            })
-          }
-        }).catch((err) => {
-          console.log(err)
-        });
-      },
-      checkIsTesting() {
-        getExitTest().then(res => {
-          let rs = res.data;
-          if (rs.code == 1) {
-            this.$layer.msg('宸插瓨鍦ㄨ瘯楠�');
-            if (rs.data.id.indexOf('kz') != -1) {
-              this.experimentPoint(rs.data.id)
+        experimentPoint(id) {
+            let postData = {
+                experimentId: id
             }
-          } else {
-            this.dialogVisible = true;
-          }
-        }).catch(error => {
+            experimentPoint(postData).then((res) => {
+                let rsData = res.data;
+                if (rsData.code == 1) {
+                    rsData.data.map(item => {
+                        this.list.push({
+                            name: item.name,
+                            status: item.status,
+                            start: item.startTime ? `寮�濮嬫椂闂碶n${item.startTime}` : '',
+                            end: item.endTime ? `瀹屾垚鏃堕棿\n${item.endTime}` : '',
+                            endText: item.averagePower ? `骞冲潎鍔熺巼\n${item.averagePower}kW` : '',
+                        })
+                    })
+                }
+            }).catch((err) => {
+                console.log(err)
+            });
+        },
+        checkIsTesting() {
+            getExitTest().then(res => {
+                let rs = res.data;
+                if (rs.code == 1) {
+                    let data = rs.data;
+                    if(data.type != this.type) {
+                        let testType = getLabel(data.type, constTestType);
+                        this.$alert("褰撳墠宸插紑鍚瘯楠岋細"+testType+"銆傚闇�瑕佽繘琛屽叾浠栬瘯楠岄渶鍏堝叧闂璇曢獙銆�", '绯荤粺鎻愮ず', {
+                            callback:()=>{
+                                this.$router.push('/index/testManager/testing');
+                            }
+                        });
+                    }else {
+                        console.log('鏌ヨ璇曢獙姝ラ');
+                        this.experimentPoint(rs.data.id)
+                    }
+                } else {
+                    this.dialogVisible = true;
+                }
+            }).catch(error => {
 
-        });
-      },
-      changeSpeed(type) {
-        if (type == 'add') {
-          this.speedValue += 1
-        } else {
-          this.speedValue -= 1
+            });
+        },
+        changeSpeed(type) {
+            if (type == 'add') {
+                this.speedValue += 1
+            } else {
+                this.speedValue -= 1
+            }
+        },
+        initChart() {
+            this.$refs.temperatureBar.setData({
+                xData: ['#1', '#2', '#3', '#4', '#5', '#6', '#7', '#8', '#9', '#10', '#11', '#12'],
+                series: [{
+                    color: '#ffc71c',
+                    name: '瀹氬瓙娓╁害鎯呭喌',
+                    data: [38, 56, 80, 64, 58, 36, 1, 1, 1, 1, 1, 1],
+                    smooth: false,
+                    showlabel: false
+                }]
+            });
+            this.$refs.DoubleLine.setData({
+                xData: ['9:44:05', '9:44:10', '9:44:15', '9:44:20', '9:44:25', '9:44:30', '9:44:35'],
+                series: [{
+                    color: '#1e9ff2',
+                    name: '绌鸿浇鐢垫満鐢靛帇',
+                    data: [10, 10, 30, 12, 15, 3, 7],
+                    showSymbol: true,
+                    yAxisIndex: 0,
+                }, {
+                    color: '#1bd9a0',
+                    name: '楂橀�熼娇杞�',
+                    data: [150, 120, 170, 140, 500, 160, 110],
+                    showSymbol: true,
+                    yAxisIndex: 1,
+                }]
+            });
         }
-      },
-      initChart() {
-        this.$refs.temperatureBar.setData({
-          xData: ['#1', '#2', '#3', '#4', '#5', '#6', '#7', '#8', '#9', '#10', '#11', '#12'],
-          series: [{
-            color: '#ffc71c',
-            name: '瀹氬瓙娓╁害鎯呭喌',
-            data: [38, 56, 80, 64, 58, 36, 1, 1, 1, 1, 1, 1],
-            smooth: false,
-            showlabel: false
-          }]
-        });
-        this.$refs.DoubleLine.setData({
-          xData: ['9:44:05', '9:44:10', '9:44:15', '9:44:20', '9:44:25', '9:44:30', '9:44:35'],
-          series: [{
-            color: '#1e9ff2',
-            name: '绌鸿浇鐢垫満鐢靛帇',
-            data: [10, 10, 30, 12, 15, 3, 7],
-            showSymbol: true,
-            yAxisIndex: 0,
-          }, {
-            color: '#1bd9a0',
-            name: '楂橀�熼娇杞�',
-            data: [150, 120, 170, 140, 500, 160, 110],
-            showSymbol: true,
-            yAxisIndex: 1,
-          }]
-        });
-      }
     }
-  }
+}
 </script>
 
 <style scoped>
-  .noLoadTest {
+.noLoadTest {
     width: 100%;
     height: 100%;
-  }
+}
 
-  .flex-warp {
+.flex-warp {
     width: 100%;
     height: 100%;
     display: flex;
     flex-wrap: wrap;
     padding-bottom: 25px;
-  }
+}
 
-  .flex-warp .top {
+.flex-warp .top {
     height: 68%;
-  }
+}
 
-  .flex-warp .bottom {
+.flex-warp .bottom {
     height: 32%;
-  }
+}
 
-  .chart {
+.chart {
     width: 100%;
     height: 100%;
-  }
+}
 
-  .diagram-content {
+.diagram-content {
     top: -24px;
-  }
+}
 
-  .scrollCon {
+.scrollCon {
     width: 100%;
     height: 100%;
     overflow: auto;
-  }
+}
 
-  .scrollCon .list {
+.scrollCon .list {
     width: 100%;
     display: flex;
     align-items: center;
     font-size: 12px;
     padding: 6px 14px;
     justify-content: space-between;
-  }
+}
 
-  .scrollCon .list .text {
+.scrollCon .list .text {
     color: #ffffff;
     width: 80%;
     overflow: hidden;
     white-space: nowrap;
     text-overflow: ellipsis;
-  }
+}
 
-  .scrollCon .list .see {
+.scrollCon .list .see {
     color: #02A7F0;
     cursor: pointer;
-  }
+}
 
-  .lineCon {
+.lineCon {
     width: 100%;
     height: 200px;
-  }
+}
 
-  .chartTitle {
+.chartTitle {
     width: 100%;
     font-size: 14px;
     padding: 8px 15px;
-  }
+}
 
-  .stepCont {
+.stepCont {
     padding: 10px;
-  }
+}
 
-  .speedCon {
+.speedCon {
     width: 86%;
     height: 60px;
     background: inherit;
@@ -490,32 +508,32 @@
     padding: 0 20px;
     display: flex;
     align-items: center;
-  }
+}
 
-  .speedCon /deep/ .el-slider {
+.speedCon /deep/ .el-slider {
     width: 100%;
-  }
+}
 
-  .flexCon {
+.flexCon {
     width: 100%;
     display: flex;
     align-items: center;
     padding: 0 7%;
-  }
+}
 
-  .speedInput {
+.speedInput {
     margin: 0 10px;
-  }
+}
 
-  .couflex {
+.couflex {
     width: 100%;
     height: 100%;
     display: flex;
     align-items: center;
     flex-direction: column;
-  }
+}
 
-  .stopBtn {
+.stopBtn {
     width: 60%;
     margin-top: 20px;
     margin-left: 0;
@@ -523,92 +541,92 @@
     display: flex;
     align-items: center;
     justify-content: center;
-  }
+}
 
-  .couflex .optItem {
+.couflex .optItem {
     width: 100%;
     display: flex;
     align-items: center;
     justify-content: center;
     flex-direction: column;
     margin-top: 10px;
-  }
+}
 
-  .couflex .lineTit {
+.couflex .lineTit {
     font-size: 12px;
     margin-bottom: 6px;
-  }
+}
 
-  .flexWarp {
+.flexWarp {
     display: flex;
     flex-wrap: wrap;
     padding: 6px;
-  }
+}
 
-  .flexWarp .status {
+.flexWarp .status {
     width: 48%;
     display: flex;
     justify-content: center;
     margin-bottom: 10px;
     padding: 0 2px 0 10px;
-  }
+}
 
-  .flexWarp .status .text {
+.flexWarp .status .text {
     font-size: 10px;
-  }
+}
 
-  .flexWarp .status .moduleCon {
+.flexWarp .status .moduleCon {
     flex: 1;
     margin-left: 6px;
-  }
+}
 
-  .flexWarp .status .line {
+.flexWarp .status .line {
     display: flex;
     align-items: center;
     width: 100%;
     margin-bottom: 4px;
-  }
+}
 
-  .flexWarp .status .line .text {
+.flexWarp .status .line .text {
     margin: 0 8px 0 4px;
-  }
+}
 
-  .flexWarp .status .line .text:first-of-type {
+.flexWarp .status .line .text:first-of-type {
     width: 30px;
-  }
+}
 
-  .flexWarp .status .line .input {
+.flexWarp .status .line .input {
     width: 58px;
-  }
+}
 
-  .flexWarp .status.lineCon {
+.flexWarp .status.lineCon {
     display: block;
     width: 52%;
     height: 60px;
-  }
+}
 
-  .diagramStatus {
+.diagramStatus {
     width: 200px;
     position: absolute;
     bottom: 20px;
     left: 20px;
-  }
+}
 
-  .modelItemWarp .diagramPanel1 {
+.modelItemWarp .diagramPanel1 {
     left: 140px;
     top: 130px;
-  }
+}
 
-  .modelItemWarp .diagramPanel2 {
+.modelItemWarp .diagramPanel2 {
     left: 290px;
     top: 190px;
-  }
+}
 
-  .mw-process-warp {
+.mw-process-warp {
     margin-bottom: 20px;
-  }
+}
 
-  .stepBtnCon {
+.stepBtnCon {
     position: absolute;
     width: 100px;
     right: 10px;
@@ -617,14 +635,14 @@
     align-items: center;
     justify-content: center;
     flex-direction: column;
-  }
+}
 
-  .stepBtnCon /deep/ .el-button {
+.stepBtnCon /deep/ .el-button {
     margin: 0;
     margin-bottom: 10px;
-  }
+}
 
-  .thermometerCon {
+.thermometerCon {
     position: absolute;
     bottom: 20px;
     right: 40px;
@@ -634,5 +652,5 @@
     align-items: center;
     justify-content: center;
     flex-direction: column;
-  }
+}
 </style>
\ No newline at end of file

--
Gitblit v1.9.1