// 基础配置 let springGreen = "#50cef5"; let red = "#b370fe"; let scalcRadius = 3; // 放电状态 function diagramStates(diagram, type) { // 断开所有的开关 // diagram.setOption('km1', 'state', false); // diagram.setOption('km2', 'state', false); // diagram.setOption('km3', 'state', false); // diagram.setOption('km4', 'state', false); // 清除电流 // diagram.del(/^line.*dot$/); if (type == "run1") { run1Charge(diagram); } } // 运行状态1 function run1Charge(diagram) { // 线条1 let line1 = diagram.getOption('line3').points; // 线条2 let line2 = diagram.getOption('line2').points; diagram.moveDot({ id: 'line1_dot', fillStyle: springGreen, strokeStyle: springGreen, radius: scalcRadius, flush: true, points: [line1[0], line2[0]], }); // 线条3 let line3 = diagram.getOption('line5').points; diagram.moveDot({ id: 'line2_dot', fillStyle: springGreen, strokeStyle: springGreen, radius: scalcRadius, flush: true, points: [line2[0], line3[1]], }); //线条4 let line4 = diagram.getOption('line6').points; diagram.moveDot({ id: 'line3_dot', fillStyle: springGreen, strokeStyle: springGreen, radius: scalcRadius, flush: true, points: [line3[0], line4[1]], }); // 线条5 let line5 = diagram.getOption('line12').points; diagram.moveDot({ id: 'line4_dot', fillStyle: springGreen, strokeStyle: springGreen, radius: scalcRadius, flush: true, points: [line4[1], line5[1]], }); // 线条6 let line6 = diagram.getOption('line13').points; diagram.moveDot({ id: 'line5_dot', fillStyle: springGreen, strokeStyle: springGreen, radius: scalcRadius, flush: true, points: [line5[1], line6[1]], }); } export default diagramStates;