whychdw
2021-05-26 c04bbbbe82d0f1ee4bd01ba2ca9f2b3c0b71425e
提交内容
6个文件已修改
49 ■■■■ 已修改文件
src/pages/test/dialog/LoadTestDialog.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/test/dialog/completeTestDialog.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/test/js/const.js 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/test/testManager/index.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/test/testManager/testing.vue 27 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/router/index.js 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/test/dialog/LoadTestDialog.vue
@@ -184,14 +184,13 @@
            checkIsTesting() {
                getExitTest().then(res => {
                    let rs = res.data;
                    console.log(rs);
                    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');
                                    this.$router.push('/index/testManager');
                                }
                            });
                        } else {
src/pages/test/dialog/completeTestDialog.vue
@@ -46,7 +46,7 @@
    },
    methods: {
        newTest() {
            this.$router.push("/index/testManager/noTest")
            this.$router.push("/index/testManager");
        }
    },
    mounted() {
src/pages/test/js/const.js
@@ -2,13 +2,19 @@
    {
        label: '空载试验',
        value: 'kz',
        route: '/index/windingTest',
        step: true, // 是否有试验步骤
    },
    {
        label: '负载试验',
        value: 'fz',
        route: '/index/noLoadTest',
        step: true,     // 是否有试验步骤
    },
    {
        label: '绕阻试验',
        value: 'rz'
        value: 'rz',
        route: '/index/loadTest',
        step: false,
    }
];
src/pages/test/testManager/index.vue
@@ -33,7 +33,6 @@
        getExitTest() {
            getExitTest().then(res=>{
                let rs = res.data;
                console.log(rs);
                if(rs.code == 1) {
                    this.$router.push('/index/testManager/testing');
                }else {
src/pages/test/testManager/testing.vue
@@ -43,7 +43,7 @@
                <el-button type="primary" size="mini" @click="goTest">进入试验</el-button>
            </div>
        </test-card>
        <test-card no-footer>
        <test-card no-footer v-if="stepShow">
            <div slot="title" class="page-panel-title">
                <span class="title-pillar"></span>
                试验进度
@@ -61,6 +61,8 @@
        getExitTest,
        experimentPoint
    } from "@/pages/test/js/api";
    import {getItemByValue} from "@/assets/js/tools";
    import {constTestType} from "@/pages/test/js/const";
    export default {
        name: "testManagerTesting",
        components: {
@@ -71,7 +73,8 @@
        data() {
            return {
                info: {},
                list: []
                list: [],
                stepShow: false,
            }
        },
        methods: {
@@ -101,13 +104,21 @@
                    let rs = res.data;
                    if (rs.code == 1) {
                        this.info = rs.data;
                        if (this.info.type == "fz") {
                            this.info.typeName = "负载试验"
                        } else if (this.info.type == "kz") {
                            this.info.typeName = "空载试验"
                        let type = this.info.type;
                        let testInfo = getItemByValue(type, constTestType);
                        if (testInfo != -1) {
                            this.info.typeName = testInfo.label;
                            this.stepShow = testInfo.step;
                            // 显示测试步骤
                            if(this.stepShow) {
                                this.experimentPoint(rs.data.id);
                            }
                        }else {
                            this.info.typeName = "未知试验类型";
                        }
                        console.log(this.info)
                        this.experimentPoint(rs.data.id)
                    } else {
                        this.dialogVisible = true;
                    }
src/router/index.js
@@ -8,6 +8,14 @@
  routes
});
//解决vue路由重复导航错误
//获取原型对象上的push函数
const originalPush = VueRouter.prototype.push
//修改原型对象中的push方法
VueRouter.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}
/* eslint-disable */
router.beforeEach((to, from, next) => {
  if (to.name != 'login' && (!sessionStorage.getItem('uid') || sessionStorage.getItem('uid') == -1)) {