// 基础配置 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('line6').points; // 线条2 let line2 = diagram.getOption('line5').points; diagram.moveDot({ id: 'line1_dot', fillStyle: springGreen, strokeStyle: springGreen, radius: scalcRadius, flush: true, points: [line1[1], line2[0]], }); // 线条1 let line3 = diagram.getOption('line3').points; // 线条2 let line4 = diagram.getOption('line2').points; diagram.moveDot({ id: 'line2_dot', fillStyle: springGreen, strokeStyle: springGreen, radius: scalcRadius, flush: true, points: [line3[1], line4[0]], }); } export default diagramStates;