import Diagram from '@/assets/js/newDiagram' import plate from '../images/plate.png' // import ACImg from '../images/AC.png' const lineWidth = 2; const lineWidth2 = 1; const lineStrokeColor = '#ccc'//'#105b96'; const lineStrokeColor2 = '#ccc'; // const frequencyWidth = 96; // const ACWidth = 124; // const parameterWidth = 85; function girdCircuitDiagram(stc, flush) { let diagram = new Diagram(); let thisWidth = stc.scrollWidth; let thisHeight = stc.scrollHeight; diagram.width = 236; diagram.height= 579; diagram.setCanvas(stc, flush); let start = [120, 30]; let line1 = diagram.line({ id: 'line1', strokeStyle: lineStrokeColor, lineWidth: lineWidth, points: [ start, [start[0], start[1] - 50] ] }); let arc1 = diagram.arc({ id: 'arc1', point: [ line1[1][0], line1[0][1] ], fillStyle: lineStrokeColor, strokeStyle: lineStrokeColor, radius: 3, type: 'fill' }) let line2 = diagram.line({ id: 'line2', strokeStyle: lineStrokeColor, lineWidth: lineWidth, points: [ [line1[1][0],line1[1][1] + 70], [line1[1][0], line1[1][1] + 120] ] }); let arc2 = diagram.arc({ id: 'arc2', point: [ line2[0][0], line2[0][1] ], fillStyle: lineStrokeColor, strokeStyle: lineStrokeColor, radius: 3, type: 'fill' }) // 开关 let line3 = diagram.line({ id: 'line3', strokeStyle: lineStrokeColor, lineWidth: lineWidth, points: [ [line2[0][0],line2[0][1]], [line1[1][0], line1[0][1]] ] }); let line4 = diagram.line({ id: 'line4', strokeStyle: lineStrokeColor, lineWidth: lineWidth, points: [ [line2[1][0],line2[1][1]], [line2[1][0]-60, line2[1][1]] ] }); let line5 = diagram.line({ id: 'line5', strokeStyle: lineStrokeColor, lineWidth: lineWidth, points: [ [line4[1][0],line4[1][1]], [line4[1][0], line4[1][1]+230] ] }); let line6 = diagram.line({ id: 'line6', strokeStyle: lineStrokeColor, lineWidth: lineWidth, points: [ [line5[1][0],line5[1][1]], [line5[1][0]+70, line5[1][1]] ] }); let line7 = diagram.line({ id: 'line7', strokeStyle: lineStrokeColor2, lineWidth: lineWidth, points: [ [line2[1][0],line2[1][1]], [line2[1][0]+60, line2[1][1]] ] }); let line8 = diagram.line({ id: 'line8', strokeStyle: lineStrokeColor2, lineWidth: lineWidth, points: [ [line7[1][0],line7[1][1]], [line7[1][0], line7[1][1]+230] ] }); let line9 = diagram.line({ id: 'line9', strokeStyle: lineStrokeColor2, lineWidth: lineWidth, points: [ [line8[1][0],line8[1][1]], [line8[1][0] - 60, line8[1][1]] ] }); let line10 = diagram.line({ id: 'line10', strokeStyle: lineStrokeColor, lineWidth: lineWidth, points: [ [line9[1][0],line9[1][1]], [line9[1][0], line9[1][1]+70] ] }); let text1 = diagram.text({ id: "text1", text: '变压箱A', fillStyle: '#fff', fontSize: 12, type:true, point: [line4[1][0]-20,line4[1][1]+40] , radBorder: true, showPanel: false, borderColor:"#ffff18", }); let text2 = diagram.text({ id: "text2", text: ' 低压&接线柜A', fillStyle: '#fff', fontSize: 12, fontWidth:1, type:true, point: [line4[1][0]-20,line4[1][1]+80] , radBorder: true, showPanel: false, borderColor:"#ffff18", }); let text3 = diagram.text({ id: "text3", text: '整流柜A', fillStyle: '#fff', fontSize: 12, fontWidth:1, type:true, point: [line4[1][0]-20,line4[1][1]+130] , radBorder: true, showPanel: false, borderColor:"#ffff18", }); let text4 = diagram.text({ id: "text4", text: ' 直流&输出柜A', fillStyle: '#fff', fontSize: 12, fontWidth:1, type:true, point: [line4[1][0]-20,line4[1][1]+170] , radBorder: true, showPanel: false, borderColor:"#ffff18", }); let text5 = diagram.text({ id: "text5", text: '变压柜B', fillStyle: '#fff', fontSize: 12, fontWidth:1, type:true, point: [line7[1][0]-30,line7[1][1]+40] , radBorder: true, showPanel: false, borderColor:"#ffff18", }); let text6 = diagram.text({ id: "text6", text: ' 低压&接线柜B', fillStyle: '#fff', fontSize: 12, fontWidth:1, type:true, point: [line7[1][0]-30,line7[1][1]+80] , radBorder: true, showPanel: false, borderColor:"#ffff18", }); let text7 = diagram.text({ id: "text7", text: '整流柜B', fillStyle: '#fff', fontSize: 12, fontWidth:1, type:true, point: [line7[1][0]-30,line7[1][1]+130] , radBorder: true, showPanel: false, borderColor:"#ffff18", }); let text8 = diagram.text({ id: "text8", text: ' 直流&输出柜B', fillStyle: '#fff', fontSize: 12, fontWidth:1, type:true, point: [line7[1][0]-30,line7[1][1]+170] , radBorder: true, showPanel: false, borderColor:"#ffff18", }); let text9 = diagram.text({ id: "text9", text: '10kV高压配电屏', fillStyle: '#ffff18', fontSize: 12, fontWidth:1, type:true, point:[line1[0][0]+10,line1[0][1]], showPanel: false, }); let text10 = diagram.text({ id: "text10", text: '大功率整流电源', fillStyle: '#ffff18', fontSize: 12, fontWidth:1, point:[line4[1][0]-50,line4[1][1]-40], showPanel: false, }); let text11 = diagram.text({ id: "text11", text: 'A套', fillStyle: '#ffff18', fontSize: 12, fontWidth:1, point:[line4[1][0]-25,line4[1][1]+10], showPanel: false, }); let text12 = diagram.text({ id: "text12", text: 'B套', fillStyle: '#ffff18', fontSize: 12, fontWidth:1, point:[line7[1][0]+5,line7[1][1]+10], showPanel: false, }); let text13 = diagram.text({ id: "text13", text: '直流配电板', fillStyle: '#ffff18', fontSize: 12, fontWidth:1, point:[line10[1][0]+45,line10[1][1]], showPanel: false, }); let Image1 = diagram.drawImage({ id: 'img1', url: plate, point: [line10[1][0]-50, line10[1][1]], width: 70, height: 101, }) let dashLine1 =diagram.dashLine({ id:"diagram1", strokeStyle: lineStrokeColor2, lineWidth: lineWidth2, points: [ [line4[0][0]-10,line4[0][1]-5], [line4[1][0] - 50, line4[1][1]-5] ] }) let dashLine2 =diagram.dashLine({ id:"diagram2", strokeStyle: lineStrokeColor2, lineWidth: lineWidth2, points: [ [dashLine1[1][0],dashLine1[1][1]], [dashLine1[1][0], dashLine1[1][1]+245] ] }) let dashLine3 =diagram.dashLine({ id:"diagram3", strokeStyle: lineStrokeColor2, lineWidth: lineWidth2, points: [ [dashLine2[1][0],dashLine2[1][1]], [dashLine2[1][0]+100, dashLine2[1][1]] ] }) let dashLine4 =diagram.dashLine({ id:"diagram4", strokeStyle: lineStrokeColor2, lineWidth: lineWidth2, points: [ [dashLine3[1][0],dashLine3[1][1]], [dashLine1[0][0], dashLine1[0][1]] ] }) let dashLine5 =diagram.dashLine({ id:"diagram5", strokeStyle: lineStrokeColor2, lineWidth: lineWidth2, points: [ [line7[0][0]+3,line7[0][1]-5], [line7[1][0] + 38, line7[1][1]-5] ] }) let dashLine6 =diagram.dashLine({ id:"diagram6", strokeStyle: lineStrokeColor2, lineWidth: lineWidth2, points: [ [dashLine5[0][0],dashLine5[0][1]], [dashLine5[0][0], dashLine5[0][1]+245] ] }) let dashLine7 =diagram.dashLine({ id:"diagram7", strokeStyle: lineStrokeColor2, lineWidth: lineWidth2, points: [ [dashLine6[1][0],dashLine6[1][1]], [dashLine6[1][0]+94, dashLine6[1][1]] ] }) let dashLine8 =diagram.dashLine({ id:"diagram8", strokeStyle: lineStrokeColor2, lineWidth: lineWidth2, points: [ [dashLine7[1][0],dashLine7[1][1]], [dashLine5[1][0], dashLine5[1][1]] ] }) let dashLine9 =diagram.dashLine({ id:"diagram9", strokeStyle: lineStrokeColor2, lineWidth: lineWidth2, points: [ [dashLine5[1][0] +4,dashLine5[1][1]-10], [dashLine1[1][0]-4, dashLine1[1][1]-10] ] }) let dashLine10 =diagram.dashLine({ id:"diagram10", strokeStyle: lineStrokeColor2, lineWidth: lineWidth2, points: [ [dashLine9[1][0],dashLine9[1][1]], [dashLine2[1][0]-4, dashLine2[1][1]+10] ] }) let dashLine11 =diagram.dashLine({ id:"diagram11", strokeStyle: lineStrokeColor2, lineWidth: lineWidth2, points: [ [dashLine10[1][0],dashLine10[1][1]], [dashLine7[1][0]+6, dashLine7[1][1]+10] ] }) let dashLine12 =diagram.dashLine({ id:"diagram12", strokeStyle: lineStrokeColor2, lineWidth: lineWidth2, points: [ [dashLine11[1][0],dashLine11[1][1]], [dashLine9[0][0], dashLine9[0][1]] ] }) return diagram; } export default girdCircuitDiagram;