| | |
| | | .text-indent-two { |
| | | text-indent: 2rem; |
| | | } |
| | | |
| | | |
| | | .useless-btn-title { |
| | | position: relative; |
| | | } |
| | | .useless-btn { |
| | | position: absolute; |
| | | right: 16px; |
| | | top: 4px; |
| | | z-index: 1001; |
| | | } |
New file |
| | |
| | | <template> |
| | | <div class="mw-drawer" v-show="visible"> |
| | | <div class="mw-mask" @click="close"></div> |
| | | <div class="mw-drawer-content"> |
| | | <div class="mw-drawer-wrapper"> |
| | | <div class="mw-drawer-title"> |
| | | <slot name="title"></slot> |
| | | </div> |
| | | <div class="mw-drawer-content"> |
| | | <slot></slot> |
| | | </div> |
| | | <div class="mw-drawer-footer"> |
| | | <slot name="footer"></slot> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | name: "mwDrawer", |
| | | props: { |
| | | visible: { |
| | | type: Boolean, |
| | | default: false, |
| | | } |
| | | }, |
| | | methods: { |
| | | close() { |
| | | this.$emit('update:visible', false); |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .mw-drawer { |
| | | position: fixed; |
| | | top: 0; |
| | | left: 0; |
| | | right: 0; |
| | | bottom: 0; |
| | | z-index: 1002; |
| | | } |
| | | .mw-mask { |
| | | position: absolute; |
| | | top: 0; |
| | | left: 0; |
| | | right: 0; |
| | | bottom: 0; |
| | | background-color: #00000030; |
| | | z-index: 1003; |
| | | } |
| | | .mw-drawer-content { |
| | | position: absolute; |
| | | width: 400px; |
| | | height: 100%; |
| | | right: 0; |
| | | background-color: #171350; |
| | | z-index: 1004; |
| | | } |
| | | .mw-drawer-wrapper { |
| | | display: flex; |
| | | flex-direction: column; |
| | | } |
| | | .mw-drawer-content { |
| | | flex: 1; |
| | | overflow-y: auto; |
| | | } |
| | | </style> |
New file |
| | |
| | | <template> |
| | | <div class="pre-option-list"> |
| | | <table> |
| | | <thead> |
| | | <tr> |
| | | <th>状态名称</th> |
| | | <th>状态</th> |
| | | </tr> |
| | | </thead> |
| | | <tbody> |
| | | <tr v-for="(item, key) in list" :key="'key'+key"> |
| | | <td>{{item.label}}</td> |
| | | <td> |
| | | <el-switch v-model="item.value" @change="changeOption(item)"></el-switch> |
| | | </td> |
| | | </tr> |
| | | </tbody> |
| | | </table> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import MwSwitch from '@/components/smallModule/mwSwitch.vue'; |
| | | import {changePreOption, checkPrecondition} from "@/pages/test/js/api"; |
| | | export default { |
| | | name: "preOptionList", |
| | | props: { |
| | | type: { |
| | | type: String, |
| | | default: "" |
| | | } |
| | | }, |
| | | components: { |
| | | MwSwitch |
| | | }, |
| | | data() { |
| | | return { |
| | | list: [ |
| | | { |
| | | id: 1, |
| | | key: 1, |
| | | label: '进线屏开关状态', |
| | | value: true, |
| | | on: 1, |
| | | off: 0 |
| | | }, |
| | | { |
| | | id: 2, |
| | | label: '大功率整流电源电压', |
| | | value: true, |
| | | on: 500, |
| | | off: 400 |
| | | }, |
| | | { |
| | | id: 3, |
| | | label: '直流配电板A排电压', |
| | | value: true, |
| | | on: 500, |
| | | off: 400 |
| | | }, |
| | | { |
| | | id: 4, |
| | | label: '直流配电板B排电压', |
| | | value: true, |
| | | on: 0, |
| | | off: 100 |
| | | }, |
| | | { |
| | | id: 5, |
| | | label: '油站', |
| | | value: true, |
| | | on: 1, |
| | | off: 0 |
| | | }, |
| | | { |
| | | id: 6, |
| | | label: '水站', |
| | | value: true, |
| | | on: 1, |
| | | off: 0 |
| | | }, |
| | | { |
| | | id: 7, |
| | | label: '被试电机通讯', |
| | | value: true, |
| | | on: 1, |
| | | off: 0 |
| | | }, |
| | | ] |
| | | } |
| | | }, |
| | | methods: { |
| | | checkPrecondition() { |
| | | checkPrecondition(this.type).then(res => { |
| | | let rs = res.data; |
| | | let data = []; |
| | | if (rs.code != 0) { |
| | | data = rs.data; |
| | | } |
| | | data.map(item=>{ |
| | | for(let i=0; i<this.list.length; i++) { |
| | | if(item.name == this.list[i].label) { |
| | | this.list[i].value = item.status?true: false; |
| | | } |
| | | } |
| | | }); |
| | | }).catch(error => { |
| | | this.loading = false; |
| | | console.log(error); |
| | | }); |
| | | }, |
| | | changeOption(data) { |
| | | let value = data.value?data.on:data.off; |
| | | changePreOption(data.id, value).then(res=>{ |
| | | let rs = res.data; |
| | | if(rs.code == 1) { |
| | | this.$layer.msg("修改成功"); |
| | | }else { |
| | | this.$layer.msg("修改失败"); |
| | | } |
| | | this.$nextTick(()=>{ |
| | | this.checkPrecondition(); |
| | | }); |
| | | }).catch(error=>{ |
| | | |
| | | }); |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.checkPrecondition(); |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .pre-option-list { |
| | | font-size: 16px; |
| | | color: #FFFFFF; |
| | | } |
| | | .pre-option-list table { |
| | | width: 100%; |
| | | border-collapse: collapse; |
| | | } |
| | | |
| | | .pre-option-list table th, |
| | | .pre-option-list table td { |
| | | border: 2px solid #6261CB; |
| | | padding: 8px 8px; |
| | | text-align: center; |
| | | } |
| | | .pre-option-list table th { |
| | | color: #FFF034; |
| | | border-top: 2px solid #797979; |
| | | border-left: 2px solid #797979; |
| | | border-right: 2px solid #797979; |
| | | } |
| | | </style> |
| | |
| | | <script> |
| | | import PageMenu from '@/components/PageMenu' |
| | | import PageHeader from '@/components/PageHeader' |
| | | |
| | | export default { |
| | | components: { |
| | | PageMenu, |
| | |
| | | this.hover = false |
| | | } |
| | | }, |
| | | mounted() { |
| | | |
| | | } |
| | | } |
| | | </script> |
| | | |
| | |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | <test-step-check :type="type"></test-step-check> |
| | | <test-step-check :type="type" @checkStatus="checkStatus" ref="testStepCheck"></test-step-check> |
| | | </div> |
| | | </el-form> |
| | | </div> |
| | | <div class="footer-button"> |
| | | <el-button type="primary" size="small" @click="proceedTest">继续试验</el-button> |
| | | <el-button type="primary" size="small" @click="reCheck" >重新检查</el-button> |
| | | <el-button type="primary" size="small" @click="proceedTest" :disabled="!status">继续试验</el-button> |
| | | </div> |
| | | </div> |
| | | </template> |
| | |
| | | } |
| | | }, |
| | | data() { |
| | | return {} |
| | | return { |
| | | status: false, |
| | | } |
| | | }, |
| | | methods: { |
| | | proceedTest() { |
| | | this.$emit('proceedTest', this.point); |
| | | }, |
| | | checkStatus(status) { |
| | | this.status = status; |
| | | }, |
| | | reCheck() { |
| | | this.$refs.testStepCheck.checkPrecondition(); |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | |
| | | <p class="p-h">当前步骤</p> |
| | | <p class="text-indent-two">① 被试电机在额定频率,额定电压及额定负载下运行到温升稳定</p> |
| | | </div> |
| | | <test-step-check :type="type"></test-step-check> |
| | | <test-step-check :type="type" @checkStatus="checkStatus" ref="testStepCheck"></test-step-check> |
| | | </div> |
| | | <div class="footer-button"> |
| | | <el-button type="primary" size="small" @click="startTest">开始下一步</el-button> |
| | | <el-button type="primary" size="small" @click="reCheck" >重新检查</el-button> |
| | | <el-button type="primary" size="small" @click="startTest" :disabled="!status">开始下一步</el-button> |
| | | </div> |
| | | </div> |
| | | </template> |
| | |
| | | } |
| | | }, |
| | | data() { |
| | | return {} |
| | | return { |
| | | status: false, |
| | | check: true, |
| | | } |
| | | }, |
| | | methods: { |
| | | startTest() { |
| | | this.$emit('startTest'); |
| | | }, |
| | | checkStatus(status) { |
| | | this.status = status; |
| | | }, |
| | | reCheck() { |
| | | this.$refs.testStepCheck.checkPrecondition(); |
| | | } |
| | | } |
| | | } |
| | |
| | | <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> |
| | | <td class="td-status" :class="{'td-status-error':!item.status}">{{ item.status ? "检查正常" : "检查异常" }}</td> |
| | | </tr> |
| | | </tbody> |
| | | </table> |
| | |
| | | } |
| | | this.list = data; |
| | | this.loading = false; |
| | | let checkStatus = true; |
| | | for(let i=0; i<data.length; i++) { |
| | | let item = data[i]; |
| | | if(item.status == 0) { |
| | | checkStatus = false; |
| | | break; |
| | | } |
| | | } |
| | | this.showButton = true; |
| | | this.$emit('checkStatus', checkStatus); |
| | | }).catch(error => { |
| | | this.loading = false; |
| | | console.log(error); |
| | |
| | | } |
| | | |
| | | .test-check { |
| | | min-height: 150px; |
| | | min-height: 200px; |
| | | } |
| | | |
| | | .test-explain table { |
| | |
| | | .test-explain table td.td-status { |
| | | font-weight: 700; |
| | | } |
| | | .td-status.td-status-error { |
| | | color: #FF0000; |
| | | } |
| | | </style> |
| | |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 完成试验 |
| | | * @param experimentId |
| | | * @returns {AxiosPromise} |
| | | */ |
| | | export const completeTest = (experimentId)=>{ |
| | | return axios({ |
| | | method: "POST", |
| | |
| | | }, |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * 手动结束试验测试点 |
| | | * @param id |
| | | * @returns {AxiosPromise} |
| | | */ |
| | | export const stopTestPoint = (id)=>{ |
| | | return axios({ |
| | | method: "POST", |
| | | url: "/experiment/finishExperimentPoint", |
| | | params: { |
| | | id: id |
| | | }, |
| | | }); |
| | | } |
| | | |
| | | export const changePreOption = (id, value)=> { |
| | | return axios({ |
| | | method: "PUT", |
| | | url: "/experiment/precondition", |
| | | params: { |
| | | id, |
| | | value |
| | | }, |
| | | }); |
| | | } |
| | |
| | | </div> |
| | | <div class="modelItemWarp top" style="width:31%;"> |
| | | <div class="content"> |
| | | <div class="title">实时曲线</div> |
| | | <div class="title useless-btn-title"> |
| | | 实时曲线 |
| | | <div class="useless-btn"> |
| | | <el-button type="primary" size="mini" @click="drawer=true">前置条件设置</el-button> |
| | | </div> |
| | | |
| | | </div> |
| | | <div class="double-line-wrapper"> |
| | | <div class="h30percent"> |
| | | <div class="chartTitle">受试电机电压电流</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" :disabled="!progressStep" @click="nextStepTest">下步试验</el-button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <load-test-dialog :type="type" :visible="dialogVisible" @updateList="updateList"></load-test-dialog> |
| | | <mw-drawer :visible.sync="drawer"> |
| | | <pre-option-list :type="type" v-if="drawer"></pre-option-list> |
| | | </mw-drawer> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | import StepList from '@/components/smallModule/stepList.vue'; |
| | | import absPanel from '@/components/smallModule/absPanel.vue'; |
| | | import LoadTestDialog from "@/pages/test/dialog/LoadTestDialog"; |
| | | import {stopTestPoint} from "@/pages/test/js/api"; |
| | | import MwDrawer from "@/components/smallModule/mwDrawer"; |
| | | import PreOptionList from "@/components/smallModule/preOptionList"; |
| | | |
| | | let diagram; |
| | | export default { |
| | |
| | | MwSwitch, |
| | | StepList, |
| | | absPanel, |
| | | MwDrawer, |
| | | PreOptionList, |
| | | }, |
| | | data() { |
| | | return { |
| | |
| | | unit: "V", |
| | | }, |
| | | ], |
| | | drawer: false, |
| | | } |
| | | }, |
| | | watch: { |
| | |
| | | }, |
| | | updateList(list) { |
| | | this.list = list; |
| | | }, |
| | | nextStepTest() { |
| | | let step = this.progressStep; |
| | | let id = step.id; |
| | | let name = step.name; |
| | | this.$confirm("确认手动完成"+name+'测试', "系统提示", { |
| | | type: 'warning' |
| | | }).then(res=>{ |
| | | stopTestPoint(id).then(res=>{ |
| | | let rs = res.data; |
| | | if(rs.code == 1) { |
| | | this.$layer.msg("手动完成成功!"); |
| | | }else { |
| | | this.$layer.msg("手动完成失败!"); |
| | | } |
| | | }).catch(error=>{ |
| | | this.$layer.msg("网络通讯异常"); |
| | | }); |
| | | }).catch(error=>{}); |
| | | } |
| | | }, |
| | | computed: {}, |
| | | computed: { |
| | | progressStep() { |
| | | let list = this.list; |
| | | let step = false; |
| | | for(let i=0; i<list.length; i++) { |
| | | let item = list[i]; |
| | | if(item.status == 1) { |
| | | step = item; |
| | | break; |
| | | } |
| | | } |
| | | return step; |
| | | }, |
| | | }, |
| | | mounted() { |
| | | this.initChart(); |
| | | diagram = gridCircuitDiagram(this.$refs.static, this.$refs.flush); |
| | |
| | | </div> |
| | | <div class="modelItemWarp top" style="width:31%;"> |
| | | <div class="content"> |
| | | <div class="title">实时曲线</div> |
| | | <div class="title useless-btn-title"> |
| | | 实时曲线 |
| | | <div class="useless-btn"> |
| | | <el-button type="primary" size="mini" @click="drawer=true">前置条件设置</el-button> |
| | | </div> |
| | | </div> |
| | | <div class="con"> |
| | | <div class="chartTitle">空载电机电压与高速齿轮关系曲线</div> |
| | | <div class="lineCon"> |
| | |
| | | <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" :disabled="!progressStep" @click="nextStepTest">下步试验</el-button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <load-test-dialog :type="type" :visible="dialogVisible" @updateList="updateList"></load-test-dialog> |
| | | <mw-drawer :visible.sync="drawer"> |
| | | <pre-option-list :type="type" v-if="drawer"></pre-option-list> |
| | | </mw-drawer> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | import MwSectionProcess from '@/components/smallModule/mwSectionProcess.vue'; |
| | | import MwThermometer from '@/components/smallModule/mwThermometer.vue'; |
| | | import LoadTestDialog from "@/pages/test/dialog/LoadTestDialog"; |
| | | import {stopTestPoint} from "@/pages/test/js/api"; |
| | | import MwDrawer from "@/components/smallModule/mwDrawer"; |
| | | import PreOptionList from "@/components/smallModule/preOptionList"; |
| | | |
| | | let diagram; |
| | | export default { |
| | | components: { |
| | | PreOptionList, |
| | | MwDrawer, |
| | | barChart, |
| | | DoubleLine, |
| | | StepList, |
| | |
| | | color: '#666ee8', |
| | | status: true |
| | | }], |
| | | list: [] |
| | | list: [], |
| | | drawer: false, |
| | | } |
| | | }, |
| | | watch: { |
| | |
| | | }, |
| | | updateList(list) { |
| | | this.list = list; |
| | | }, |
| | | nextStepTest() { |
| | | let step = this.progressStep; |
| | | let id = step.id; |
| | | let name = step.name; |
| | | this.$confirm("确认手动完成"+name+'测试', "系统提示", { |
| | | type: 'warning' |
| | | }).then(res=>{ |
| | | stopTestPoint(id).then(res=>{ |
| | | let rs = res.data; |
| | | if(rs.code == 1) { |
| | | this.$layer.msg("手动完成成功!"); |
| | | }else { |
| | | this.$layer.msg("手动完成失败!"); |
| | | } |
| | | }).catch(error=>{ |
| | | this.$layer.msg("网络通讯异常"); |
| | | }); |
| | | }).catch(error=>{}); |
| | | |
| | | } |
| | | }, |
| | | computed: { |
| | | progressStep() { |
| | | let list = this.list; |
| | | let step = false; |
| | | for(let i=0; i<list.length; i++) { |
| | | let item = list[i]; |
| | | if(item.status == 1) { |
| | | step = item; |
| | | break; |
| | | } |
| | | } |
| | | return step; |
| | | }, |
| | | } |
| | | } |
| | | </script> |