whychdw
2021-06-03 2baa58f9515a661d53118344e237e3441300b24f
内容修改
10个文件已修改
1个文件已添加
281 ■■■■■ 已修改文件
src/components/smallModule/mwSwitch.vue 124 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/smallModule/mwThermometer.vue 50 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/dynamometerMmotor/dynamometerMmotor.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/test/closeTest.vue 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/test/dialog/pointResultTest.vue 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/test/dialog/testStepDialog.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/test/js/api.js 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/test/loadTest.vue 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/test/noLoadTest.vue 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/windingTest/windingTest.vue 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/windingTest/windingTestIndex.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/smallModule/mwSwitch.vue
@@ -1,62 +1,74 @@
<template>
  <div>
    <span class="weui-switch" :class="{'weui-switch-on' : isChecked}" :value="value" @click="toggle"
      style="position:relative">
      <div v-if="isChecked && direction.length > 0" style="width:100%;height:100%;position:absolute;padding:0 5px;display: flex;
    align-items: center;color:#FFF;user-select:none">
        {{direction[0]}}
      </div>
      <div v-if="!isChecked && direction.length > 0" style="width:100%;height:100%;position:absolute;padding:0 5px;right:2px;display: flex;flex-direction: row-reverse;
    align-items: center;color:#7A7A7A;user-select:none">
        {{direction[1]}}
      </div>
    </span>
  </div>
    <div>
        <span
        class="weui-switch" :class="{'weui-switch-on' : isChecked, 'switch-disabled': disabled}"
        :value="value" @click="toggle" style="position:relative">
            <div v-if="isChecked && direction.length > 0" style="width:100%;height:100%;position:absolute;padding:0 5px;display: flex;
            align-items: center;color:#FFF;user-select:none">
                {{ direction[0] }}
            </div>
            <div v-if="!isChecked && direction.length > 0" style="width:100%;height:100%;position:absolute;padding:0 5px;right:2px;display: flex;flex-direction: row-reverse;
            align-items: center;color:#7A7A7A;user-select:none">
                {{ direction[1] }}
            </div>
        </span>
    </div>
</template>
<script>
  export default {
export default {
    name: 'switchComponent',
    model: {
        prop: "value",
        event: 'changeValue'
    },
    props: {
      value: {
        type: Boolean,
        default: true
      },
      text: {
        type: String,
        default: ''
      }
        value: {
            type: Boolean,
            default: true
        },
        text: {
            type: String,
            default: ''
        },
        disabled: {
            type: Boolean,
            default: false
        },
    },
    data() {
      return {
        isChecked: this.value
      }
        return {
            isChecked: this.value
        }
    },
    computed: {
      direction() {
        if (this.text) {
          return this.text.split('|')
        } else {
          return []
        direction() {
            if (this.text) {
                return this.text.split('|')
            } else {
                return []
            }
        }
      }
    },
    watch: {
      value(val) {
        this.isChecked = val
      },
      isChecked(val) {
        this.$emit('change', val);
      }
        value(val) {
            this.isChecked = val
        },
        isChecked(val) {
            this.$emit('change', val);
        }
    },
    methods: {
      toggle() {
        this.isChecked = !this.isChecked;
      }
    }
  }
        toggle() {
            if(!this.disabled) {
                this.isChecked = !this.isChecked;
                this.$emit('changeValue', this.isChecked);
            }
        }
    },
}
</script>
<style>
  .weui-switch {
.weui-switch {
    display: block;
    position: relative;
    width: 72px;
@@ -68,9 +80,11 @@
    transition: background-color 0.1s, border 0.1s;
    cursor: pointer;
    font-size: 12px;
  }
  .weui-switch:before {
}
.weui-switch.switch-disabled {
    cursor: not-allowed;
}
.weui-switch:before {
    content: " ";
    position: absolute;
    top: 0;
@@ -80,9 +94,9 @@
    border-radius: 15px;
    background-color: #d7d7d7;
    transition: transform 0.35s cubic-bezier(0.45, 1, 0.4, 1);
  }
}
  .weui-switch:after {
.weui-switch:after {
    content: " ";
    position: absolute;
    top: 0;
@@ -93,19 +107,19 @@
    background-color: #FFFFFF;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    transition: transform 0.35s cubic-bezier(0.4, 0.4, 0.25, 1.35);
  }
}
  .weui-switch-on {
.weui-switch-on {
    border-color: #6F6F6F;
    background-color: #1AAD19;
  }
}
  .weui-switch-on:before {
.weui-switch-on:before {
    border-color: #1AAD19;
    background-color: #409eff;
  }
}
  .weui-switch-on:after {
.weui-switch-on:after {
    transform: translateX(45px);
  }
}
</style>
src/components/smallModule/mwThermometer.vue
@@ -1,52 +1,52 @@
<template>
  <div class="thermometer" :class="{ active: state}">
    <div class="line"></div>
    <div class="arc"></div>
  </div>
    <div class="thermometer" :class="{ active: state}">
        <div class="line"></div>
        <div class="arc"></div>
    </div>
</template>
<script>
  export default {
export default {
    props: ['switch'],
    data() {
      return {
        state: false
      }
        return {
            state: false
        }
    },
    watch: {
      'switch': {
        handler(val) {
          this.state = val
        'switch': {
            handler(val) {
                this.state = val
            },
            deep: true
        },
        deep: true
      },
    },
    mounted() {
      this.state = this.switch
        this.state = this.switch
    }
  }
}
</script>
<style scoped>
  .thermometer {
.thermometer {
    width: 16px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
  }
}
  .line {
.line {
    width: 8px;
    height: 54px;
    background-color: #ffffff;
    border-radius: 4px 4px 0 0;
    overflow: hidden;
    position: relative;
  }
}
  .thermometer.active .line::before {
.thermometer.active .line::before {
    content: "";
    display: block;
    width: 6px;
@@ -55,9 +55,9 @@
    bottom: 0;
    left: 1px;
    background: -webkit-linear-gradient(top, #ffffff, #318bf1);
  }
}
  .arc {
.arc {
    width: 18px;
    height: 18px;
    border-radius: 50%;
@@ -65,9 +65,9 @@
    margin-top: -1px;
    overflow: hidden;
    position: relative;
  }
}
  .thermometer.active .arc::before {
.thermometer.active .arc::before {
    content: "";
    display: block;
    width: 20px;
@@ -77,5 +77,5 @@
    position: absolute;
    bottom: -1px;
    left: -1px;
  }
}
</style>
src/pages/dynamometerMmotor/dynamometerMmotor.vue
@@ -403,7 +403,7 @@
                    yData.push(a.value);
                }
            });
        let option = {
            let option = {
                backgroundColor: "#111c4e",
                color: ['#3398DB'],
                tooltip: {
src/pages/test/closeTest.vue
New file
@@ -0,0 +1,13 @@
<template>
    <div class="closeTest"></div>
</template>
<script>
export default {
    name: "closeTest"
}
</script>
<style scoped>
</style>
src/pages/test/dialog/pointResultTest.vue
@@ -75,6 +75,7 @@
            </el-form>
        </div>
        <div class="footer-button">
            <el-button type="primary" size="small" @click="preStep">重做当前步骤</el-button>
            <el-button type="primary" size="small" @click="completeTest" v-if="end">完成试验</el-button>
            <el-button type="primary" size="small" @click="nextStep" v-else>开始下一步</el-button>
        </div>
@@ -82,6 +83,8 @@
</template>
<script>
import {redoTestPoint} from "@/pages/test/js/api";
export default {
    name: "pointResultTest",
    props: {
@@ -120,6 +123,25 @@
        nextStep() {
            this.$emit('nextStep');
        },
        preStep() {
            this.$confirm("确定重做当前步骤", "系统提示", {
                type: "warning",
            }).then(()=>{
                let point = this.point;
                redoTestPoint(point.id).then(res=>{
                    let rs = res.data;
                    if(rs.code == 1) {
                        this.$emit('preStep');
                    }
                    this.$layer.msg(rs.msg);
                }).catch(error=>{
                    console.log(error);
                });
            }).catch(error=>{
            });
        },
        completeTest() {
            this.$emit('completeTest', this.point);
        }
src/pages/test/dialog/testStepDialog.vue
@@ -10,7 +10,7 @@
            :visible.sync="resultDialog" 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">
            <point-result-test :point="prePoint" @nextStep="nextStep" @completeTest="completeTest" :end="endTest"></point-result-test>
            <point-result-test :point="prePoint" @preStep="preStep" @nextStep="nextStep" @completeTest="completeTest" :end="endTest"></point-result-test>
        </el-dialog>
        <complete-test-dialog :visible.sync="completeDialog" :type="type"></complete-test-dialog>
    </div>
@@ -88,6 +88,10 @@
                this.resultDialog = true;
            }
        },
        preStep() {
            this.resultDialog = false;
            this.endTest = false;
        },
        nextStep() {
            this.resultDialog = false;
            this.pointDialog = true;
src/pages/test/js/api.js
@@ -210,4 +210,19 @@
            value
        },
    });
}
/**
 * 重做当前试验点
 * @param id
 * @returns {AxiosPromise}
 */
export const redoTestPoint = (id)=>{
    return axios({
        method: "POST",
        url: "/experiment/restartExperimentPoint",
        params: {
            id,
        },
    });
}
src/pages/test/loadTest.vue
@@ -49,12 +49,12 @@
                        <abs-panel class="diagramPanel4" title="受功电机" :list="underServiceMotor"></abs-panel>
                        <abs-panel class="diagramPanel5" title="AFE变频驱动柜" :list="afeBox"></abs-panel>
                        <div class="thermometerCon">
                            <mw-thermometer :switch="true"></mw-thermometer>
                            AFE变频器<br>水冷开启
                            <mw-thermometer :switch="true"></mw-thermometer>
                            受功电机<br>水冷开启
                            <mw-thermometer :switch="true"></mw-thermometer>
                            受试电机<br>水冷开启
                            <mw-thermometer :switch="value1"></mw-thermometer>
                            AFE变频器<br>水冷{{ value1?"开启":"关闭" }}
                            <mw-thermometer :switch="value2"></mw-thermometer>
                            受功电机<br>水冷{{ value2?"开启":"关闭" }}
                            <mw-thermometer :switch="value3"></mw-thermometer>
                            受试电机<br>水冷{{ value3?"开启":"关闭" }}
                        </div>
                    </div>
                </div>
@@ -180,11 +180,11 @@
                            </div>
                            <div class="optItem">
                                <div class="lineTit">受试电机水冷</div>
                                <mw-switch v-model="value1" text="开启|关闭"></mw-switch>
                                <mw-switch v-model="value2" text="开启|关闭"></mw-switch>
                            </div>
                            <div class="optItem">
                                <div class="lineTit">测功电机水冷</div>
                                <mw-switch v-model="value1" text="开启|关闭"></mw-switch>
                                <mw-switch v-model="value3" text="开启|关闭"></mw-switch>
                            </div>
                        </div>
                    </div>
@@ -202,7 +202,7 @@
                        </div>
                        <div class="stepBtnCon">
                            <el-button type="primary" size="mini">查看结果</el-button>
                            <el-button type="primary" size="mini">完成试验</el-button>
                            <el-button type="primary" size="mini">关闭试验</el-button>
                            <el-button type="primary" size="mini" :disabled="!progressStep" @click="nextStepTest">下步试验</el-button>
                        </div>
                    </div>
@@ -255,6 +255,8 @@
            SVCValue: 30,
            FVCValue: 110,
            value1: true,
            value2: true,
            value3: true,
            statusList1: [
                {
                    text: '运行中',
src/pages/test/noLoadTest.vue
@@ -46,8 +46,12 @@
                        <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>水冷开启
                            <mw-thermometer :switch="value1"></mw-thermometer>
                            AFE变频器<br>水冷{{ value1?"开启":"关闭" }}
                            <mw-thermometer :switch="value2"></mw-thermometer>
                            受功电机<br>水冷{{ value2?"开启":"关闭" }}
                            <mw-thermometer :switch="value3"></mw-thermometer>
                            受试电机<br>水冷{{ value3?"开启":"关闭" }}
                        </div>
                    </div>
@@ -172,11 +176,11 @@
                            </div>
                            <div class="optItem">
                                <div class="lineTit">受试电机水冷</div>
                                <mw-switch v-model="value1" text="开启|关闭"></mw-switch>
                                <mw-switch v-model="value2" text="开启|关闭"></mw-switch>
                            </div>
                            <div class="optItem">
                                <div class="lineTit">测功电机水冷</div>
                                <mw-switch v-model="value1" text="开启|关闭"></mw-switch>
                                <mw-switch v-model="value3" text="开启|关闭"></mw-switch>
                            </div>
                        </div>
                    </div>
@@ -194,7 +198,7 @@
                        </div>
                        <div class="stepBtnCon">
                            <el-button type="primary" size="mini">查看结果</el-button>
                            <el-button type="primary" size="mini">完成试验</el-button>
                            <el-button type="primary" size="mini">关闭试验</el-button>
                            <el-button type="primary" size="mini" :disabled="!progressStep" @click="nextStepTest">下步试验</el-button>
                        </div>
                    </div>
@@ -272,7 +276,9 @@
                },
            ],
            text1Pos: [20, 20],
            value1: true,
            value1: true,       // AFE变频器水冷
            value2: true,       // 受试电机水冷
            value3: true,       // 测工电机水冷
            speedValue: 0,
            nbmspeedValue: 0,
            VFValue: 10,
@@ -646,7 +652,7 @@
.thermometerCon {
    position: absolute;
    bottom: 20px;
    right: 40px;
    right: 16px;
    color: #318bf1;
    font-size: 10px;
    display: flex;
src/pages/windingTest/windingTest.vue
@@ -76,6 +76,10 @@
            <el-table :data="tableData" style="width: 100%;" :max-height="h +'px'"  :span-method="objectSpanMethod"><!--:span-method="objectSpanMethod"--> 
                <el-table-column prop="id" label="ID" align="center"></el-table-column>
                <el-table-column prop="saveTime" label="数据保存时间" width="160" align="center"></el-table-column>
                <el-table-column prop="winding" label="绕组编号" align="center" width="150"></el-table-column>
                <el-table-column prop="resistance" :label="next_status==1?'绝缘电阻值(Ω)':'直流电阻值(Ω)'" width="150" align="center"></el-table-column>
                <el-table-column prop="electricCurrent" :label="next_status==1?'电流(μA)':'电流(mA)'" width="150" align="center"></el-table-column>
                <el-table-column prop="vol" label="电压(V)" align="center" width="150"></el-table-column>
                <el-table-column prop="experimentId" label="设备SN" width="150" align="center"></el-table-column>
                <el-table-column label="设备类型" align="center" width="150">
                    <template slot-scope="scope">
@@ -84,10 +88,6 @@
                        </div>
                    </template>
                </el-table-column>
                <el-table-column prop="winding" label="绕组编号" align="center" width="150"></el-table-column>
                <el-table-column prop="resistance" :label="next_status==1?'绝缘电阻值(Ω)':'直流电阻值(Ω)'" width="150" align="center"></el-table-column>
                <el-table-column prop="electricCurrent" :label="next_status==1?'电流(μA)':'电流(mA)'" width="150" align="center"></el-table-column>
                <el-table-column prop="vol" label="电压(V)" align="center" width="150"></el-table-column>
                <el-table-column prop="realName" label="测试人" align="center" width="150"></el-table-column>
                <el-table-column label="操作" align="center" fixed="right" width="150">
                    <template slot-scope="scope">
src/pages/windingTest/windingTestIndex.vue
@@ -273,6 +273,7 @@
    color:#606266 !important;
}
.explain p{
    font-size: 16px;
    padding: 10px 10px;
}
</style>