| | |
| | | }, |
| | | ripplesStep: 0.6 |
| | | }; |
| | | |
| | | // 转动轴全局配置 |
| | | this.rollAxis = { |
| | | speed: 0.1, |
| | | start: 0, |
| | | }; |
| | | |
| | | // 显示线条的id |
| | | this.showLineId = false; |
| | | } |
| | |
| | | }); |
| | | }; |
| | | |
| | | /** |
| | | * 绘制转动的轴 |
| | | * @param option 配置项 |
| | | * start起始坐标点,end结束坐标点必填项 |
| | | * start.y=end.y |
| | | */ |
| | | Diagram.prototype.drawRollAxis = function(option) { |
| | | let ctx = option.flush ? this.f_ctx : this.s_ctx; // 获取上下文 |
| | | let start = option.start; |
| | | let end = option.end; |
| | | let height = option.height?option.height:16; |
| | | let width = Math.abs(start[0] - end[0]); |
| | | let rollAxis = this.rollAxis; |
| | | |
| | | let rollNumber = rollAxis.start; // 旋转轴的开始点 |
| | | let rollSpeed = rollAxis.speed; // 旋转的速度 |
| | | let color1 = option.color1?option.color1:"#cdcaca"; // 开始颜色 |
| | | let color2 = option.color2?option.color2:"#FFFFFF"; // 中间颜色 |
| | | let grd = ctx.createLinearGradient(start[0], start[0], start[0], height+start[0]); // 渐变色 |
| | | grd.addColorStop(rollNumber-Math.floor(rollNumber), color1); |
| | | rollNumber = rollNumber+0.25; |
| | | grd.addColorStop(rollNumber-Math.floor(rollNumber),color2); |
| | | rollNumber = rollNumber+0.25; |
| | | grd.addColorStop(rollNumber-Math.floor(rollNumber), color1); |
| | | rollNumber = rollNumber+0.25; |
| | | grd.addColorStop(rollNumber-Math.floor(rollNumber),color2); |
| | | rollNumber = rollNumber+0.25; |
| | | grd.addColorStop(rollNumber-Math.floor(rollNumber), color1); |
| | | ctx.fillStyle = grd; |
| | | ctx.fillRect(start[0], start[1],width, height); |
| | | |
| | | rollAxis.start += rollSpeed; |
| | | if(rollAxis.start>1.25) { |
| | | rollAxis.start = 0; |
| | | } |
| | | |
| | | // 添加配置项 |
| | | option.method = "drawRollAxis"; |
| | | this.addOptions(option); |
| | | return { |
| | | left: [start[0], start[1]+height/2], |
| | | bottom: [end[0], end[1]+height/2], |
| | | } |
| | | } |
| | | |
| | | export default Diagram; |
| | |
| | | import rectifier from '../images/rectifier.png' |
| | | import plate from '../images/plate.png' |
| | | import speedCabinet from '../images/speedCabinet.png' |
| | | import electric from '../images/electric.png' |
| | | import electric from '../images/electric2.png' |
| | | import sensor from '../images/sensor.png' |
| | | import dynamometry from '../images/dynamometry.png' |
| | | import dynamometry from '../images/dynamometry2.png' |
| | | import AFE from '../images/AFE.png' |
| | | import transformer from '../images/transformer.png' |
| | | import waterStation from '../images/waterStation.png' |
| | |
| | | let Image5 = diagram.drawImage({ |
| | | id: 'img5', |
| | | url: electric, |
| | | point: [line9[1][0] - 9, line9[1][1] - 76], |
| | | point: [line9[1][0] - 9, line9[1][1] - 45], |
| | | width: 160, |
| | | height: 120, |
| | | height: 100, |
| | | }) |
| | | |
| | | // 受试推进电机 |
| | |
| | | let Image8 = diagram.drawImage({ |
| | | id: 'img8', |
| | | url: dynamometry, |
| | | point: [line11[1][0] - 5, line11[1][1] - 50], |
| | | point: [line11[1][0]-6, line11[1][1] - 30], |
| | | width: 90, |
| | | height: 85, |
| | | }) |
| | |
| | | text: '测功机', |
| | | fillStyle: '#ffffff', |
| | | fontSize: 14, |
| | | point: [Image8.top[0] - 20, Image8.top[1] - 22], |
| | | point: [Image8.top[0] - 20, Image8.top[1] - 20], |
| | | radBorder: true, |
| | | showPanel: false |
| | | }); |
| | |
| | | import Diagram from '@/assets/js/newDiagram' |
| | | import dynamometry from '../images/dynamometry.png' |
| | | import testedmotor from '../images/testedmotor.png' |
| | | import dynamometry from '../images/dynamometry2.png' |
| | | import testedmotor from '../images/testedmotor2.png' |
| | | import sensor from '../images/sensor.png' |
| | | import AFE from '../images/AFE.png' |
| | | import speedCabinet from '../images/speedCabinet.png' |
| | |
| | | let Image2 = diagram.drawImage({ |
| | | id: 'img2', |
| | | url: testedmotor, |
| | | point: [line3[1][0], line3[1][1] - 145], |
| | | width: 270, |
| | | height: 215, |
| | | point: [line3[1][0], line3[1][1] - 289*270/395/2], |
| | | width: 270/395*395, |
| | | height: 289*270/395, |
| | | }) |
| | | |
| | | let line4 = diagram.line({ |
| | |
| | | let Image4 = diagram.drawImage({ |
| | | id: 'img4', |
| | | url: dynamometry, |
| | | point: [line8[1][0], line8[1][1] - 100], |
| | | point: [line8[1][0]-4, line8[1][1] - 229*180/347/2+10], |
| | | width: 180, |
| | | height: 174, |
| | | height: 229*180/347, |
| | | }) |
| | | |
| | | let line9 = diagram.line({ |
| | |
| | | fillStyle: "#ffffff", |
| | | fontSize: 28, |
| | | fontWidth: 1, |
| | | point: [Image2.bottom[0] - 40, Image2.bottom[1] + 20], |
| | | point: [Image2.bottom[0]-80, Image2.bottom[1] + 20], |
| | | showPanel: false, |
| | | }); |
| | | |
| | | let text8 = diagram.text({ |
| | | id: "text8", |
| | | text: '受功电机', |
| | | text: '测功机', |
| | | fillStyle: "#ffffff", |
| | | fontSize: 28, |
| | | fontWidth: 1, |
| | |
| | | let rsData = res.data; |
| | | if (rsData.code == 1) { |
| | | rsData.data.map(item => { |
| | | let start = item.startTime ? new Date(item.startTime).format("hh:mm:ss") : ''; |
| | | let end = item.endTime ? new Date(item.endTime).format("hh:mm:ss") : ''; |
| | | this.list.push({ |
| | | name: item.name, |
| | | status: item.status, |
| | | start: item.startTime ? `开始时间${item.startTime}` : '', |
| | | end: item.endTime ? `完成时间${item.endTime}` : '', |
| | | start: item.startTime ? `开始时间${start}` : '', |
| | | end: item.endTime ? `完成时间${end}` : '', |
| | | endText: item.averagePower ? `平均功率${item.averagePower}kW` : '', |
| | | }) |
| | | }) |