| | |
| | | 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 { |
| | |
| | | }, |
| | | methods: { |
| | | newTest() { |
| | | this.$router.push("/index/testManager/noTest") |
| | | this.$router.push("/index/testManager"); |
| | | } |
| | | }, |
| | | mounted() { |
| | |
| | | { |
| | | 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, |
| | | } |
| | | ]; |
| | |
| | | getExitTest() { |
| | | getExitTest().then(res=>{ |
| | | let rs = res.data; |
| | | console.log(rs); |
| | | if(rs.code == 1) { |
| | | this.$router.push('/index/testManager/testing'); |
| | | }else { |
| | |
| | | <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> |
| | | 试验进度 |
| | |
| | | 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: { |
| | |
| | | data() { |
| | | return { |
| | | info: {}, |
| | | list: [] |
| | | list: [], |
| | | stepShow: false, |
| | | } |
| | | }, |
| | | methods: { |
| | |
| | | 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; |
| | | } |
| | |
| | | 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)) { |