whyczyk
2021-07-19 b9f0dfc4c0c48d65842d417b5babe1304439a735
src/pages/home/topoGraphdiagram/js/diagramStates.js
@@ -1,7 +1,7 @@
// 基础配置
let springGreen = "#50cef5";
let red = "#b370fe";
let scalcRadius = 6;
let scalcRadius = 7;
// 放电状态
function diagramStates(diagram, type) {
    // 断开所有的开关
@@ -1211,24 +1211,24 @@
    diagram.ripples({
        id: 'ripples1',
        flush: true,
        color: '#50cef5',
        color: red,
        point: [Image2.point[0] + Image2.width / 2, Image2.point[1] + Image2.height / 2],
        maxRadius: Image2.width > Image2.height ? (Image2.width / 2) + 15 : (Image2.height / 2) + 15,
        minRadius: Image2.width > Image2.height ? Image2.width / 4 : Image2.height / 4,
        radius: Image2.width > Image2.height ? Image2.width / 2 : Image2.height / 2,
    })
    let line18 = diagram.getOption('line18').points;
    diagram.moveDot({
        id: 'line18_dot',
        fillStyle: springGreen,
        strokeStyle: springGreen,
        radius: scalcRadius,
        flush: true,
        points: [
            [line18[0][0] - 35, line18[0][1]],
            [line18[1][0] + 35, line18[1][1]]
        ],
    });
    // let line18 = diagram.getOption('line18').points;
    // diagram.moveDot({
    //     id: 'line18_dot',
    //     fillStyle: springGreen,
    //     strokeStyle: springGreen,
    //     radius: scalcRadius,
    //     flush: true,
    //     points: [
    //         [line18[0][0] - 35, line18[0][1]],
    //         [line18[1][0] + 35, line18[1][1]]
    //     ],
    // });
}
function eleBoardCharge(diagram) {
@@ -1237,50 +1237,50 @@
    diagram.ripples({
        id: 'ripples2',
        flush: true,
        color: '#50cef5',
        color: red,
        point: [Image3.point[0] + Image3.width / 2, Image3.point[1] + Image3.height / 2],
        maxRadius: Image3.width > Image3.height ? (Image3.width / 2) + 15 : (Image3.height / 2) + 15,
        minRadius: Image3.width > Image3.height ? Image3.width / 4 : Image3.height / 4,
        radius: Image3.width > Image3.height ? Image3.width / 2 : Image3.height / 2,
    })
    let line18 = diagram.getOption('line18').points;
    let line19 = diagram.getOption('line19').points;
    let line20 = diagram.getOption('line20').points;
    let line21 = diagram.getOption('line21').points;
    // let line18 = diagram.getOption('line18').points;
    // let line19 = diagram.getOption('line19').points;
    // let line20 = diagram.getOption('line20').points;
    // let line21 = diagram.getOption('line21').points;
    diagram.moveDot({
        id: 'line21_dot',
        fillStyle: springGreen,
        strokeStyle: springGreen,
        radius: scalcRadius,
        flush: true,
        points: [
            [line18[0][0] - 35, line21[1][1]],
            [line21[0][0], line21[0][1]],
        ],
    });
    diagram.moveDot({
        id: 'line20_dot',
        fillStyle: springGreen,
        strokeStyle: springGreen,
        radius: scalcRadius,
        flush: true,
        points: [
            [line20[1][0], line20[1][1]],
            [line20[0][0], line20[0][1]],
        ],
    });
    diagram.moveDot({
        id: 'line19_dot',
        fillStyle: springGreen,
        strokeStyle: springGreen,
        radius: scalcRadius,
        flush: true,
        points: [
            [line19[0][0], line19[0][1]],
            [line19[1][0] + 35, line19[1][1]],
        ],
    });
    // diagram.moveDot({
    //     id: 'line21_dot',
    //     fillStyle: springGreen,
    //     strokeStyle: springGreen,
    //     radius: scalcRadius,
    //     flush: true,
    //     points: [
    //         [line18[0][0] - 35, line21[1][1]],
    //         [line21[0][0], line21[0][1]],
    //     ],
    // });
    // diagram.moveDot({
    //     id: 'line20_dot',
    //     fillStyle: springGreen,
    //     strokeStyle: springGreen,
    //     radius: scalcRadius,
    //     flush: true,
    //     points: [
    //         [line20[1][0], line20[1][1]],
    //         [line20[0][0], line20[0][1]],
    //     ],
    // });
    // diagram.moveDot({
    //     id: 'line19_dot',
    //     fillStyle: springGreen,
    //     strokeStyle: springGreen,
    //     radius: scalcRadius,
    //     flush: true,
    //     points: [
    //         [line19[0][0], line19[0][1]],
    //         [line19[1][0] + 35, line19[1][1]],
    //     ],
    // });
}
function speedCabinetCharge(diagram) {
@@ -1289,74 +1289,74 @@
    diagram.ripples({
        id: 'ripples3',
        flush: true,
        color: '#50cef5',
        color: red,
        point: [Image4.point[0] + Image4.width / 2, Image4.point[1] + Image4.height / 2],
        maxRadius: Image4.width > Image4.height ? (Image4.width / 2) + 15 : (Image4.height / 2) + 15,
        minRadius: Image4.width > Image4.height ? Image4.width / 4 : Image4.height / 4,
        radius: Image4.width > Image4.height ? Image4.width / 2 : Image4.height / 2,
    })
    let line22 = diagram.getOption('line22').points;
    let line23 = diagram.getOption('line23').points;
    let line24 = diagram.getOption('line24').points;
    let line25 = diagram.getOption('line25').points;
    let line26 = diagram.getOption('line26').points;
    // let line22 = diagram.getOption('line22').points;
    // let line23 = diagram.getOption('line23').points;
    // let line24 = diagram.getOption('line24').points;
    // let line25 = diagram.getOption('line25').points;
    // let line26 = diagram.getOption('line26').points;
    diagram.moveDot({
        id: 'line26_dot',
        fillStyle: springGreen,
        strokeStyle: springGreen,
        radius: scalcRadius,
        flush: true,
        points: [
            [line26[1][0] - 35, line26[1][1]],
            [line26[0][0], line26[0][1]],
        ],
    });
    diagram.moveDot({
        id: 'line25_dot',
        fillStyle: springGreen,
        strokeStyle: springGreen,
        radius: scalcRadius,
        flush: true,
        points: [
            [line25[1][0], line25[1][1]],
            [line25[0][0], line25[0][1]],
        ],
    });
    diagram.moveDot({
        id: 'line24_dot',
        fillStyle: springGreen,
        strokeStyle: springGreen,
        radius: scalcRadius,
        flush: true,
        points: [
            [line24[1][0], line24[1][1]],
            [line24[0][0], line24[0][1]],
        ],
    });
    diagram.moveDot({
        id: 'line23_dot',
        fillStyle: springGreen,
        strokeStyle: springGreen,
        radius: scalcRadius,
        flush: true,
        points: [
            [line23[1][0], line23[1][1]],
            [line23[0][0], line23[0][1]],
        ],
    });
    diagram.moveDot({
        id: 'line22_dot',
        fillStyle: springGreen,
        strokeStyle: springGreen,
        radius: scalcRadius,
        flush: true,
        points: [
            [line22[0][0], line22[0][1]],
            [line22[1][0] + 35, line22[1][1]],
        ],
    });
    // diagram.moveDot({
    //     id: 'line26_dot',
    //     fillStyle: springGreen,
    //     strokeStyle: springGreen,
    //     radius: scalcRadius,
    //     flush: true,
    //     points: [
    //         [line26[1][0] - 35, line26[1][1]],
    //         [line26[0][0], line26[0][1]],
    //     ],
    // });
    // diagram.moveDot({
    //     id: 'line25_dot',
    //     fillStyle: springGreen,
    //     strokeStyle: springGreen,
    //     radius: scalcRadius,
    //     flush: true,
    //     points: [
    //         [line25[1][0], line25[1][1]],
    //         [line25[0][0], line25[0][1]],
    //     ],
    // });
    // diagram.moveDot({
    //     id: 'line24_dot',
    //     fillStyle: springGreen,
    //     strokeStyle: springGreen,
    //     radius: scalcRadius,
    //     flush: true,
    //     points: [
    //         [line24[1][0], line24[1][1]],
    //         [line24[0][0], line24[0][1]],
    //     ],
    // });
    // diagram.moveDot({
    //     id: 'line23_dot',
    //     fillStyle: springGreen,
    //     strokeStyle: springGreen,
    //     radius: scalcRadius,
    //     flush: true,
    //     points: [
    //         [line23[1][0], line23[1][1]],
    //         [line23[0][0], line23[0][1]],
    //     ],
    // });
    // diagram.moveDot({
    //     id: 'line22_dot',
    //     fillStyle: springGreen,
    //     strokeStyle: springGreen,
    //     radius: scalcRadius,
    //     flush: true,
    //     points: [
    //         [line22[0][0], line22[0][1]],
    //         [line22[1][0] + 35, line22[1][1]],
    //     ],
    // });
}
function electricCharge(diagram) {
@@ -1365,86 +1365,86 @@
    diagram.ripples({
        id: 'ripples4',
        flush: true,
        color: '#50cef5',
        color: red,
        point: [Image5.point[0] + Image5.width / 2, Image5.point[1] + Image5.height / 2],
        maxRadius: Image5.width > Image5.height ? (Image5.width / 2) + 15 : (Image5.height / 2) + 15,
        minRadius: Image5.width > Image5.height ? Image5.width / 4 : Image5.height / 4,
        radius: Image5.width > Image5.height ? Image5.width / 2 : Image5.height / 2,
    })
    let line27 = diagram.getOption('line27').points;
    let line28 = diagram.getOption('line28').points;
    // let line27 = diagram.getOption('line27').points;
    // let line28 = diagram.getOption('line28').points;
    diagram.moveDot({
        id: 'line28_dot',
        fillStyle: springGreen,
        strokeStyle: springGreen,
        radius: scalcRadius,
        flush: true,
        points: [
            [line28[1][0], line28[1][1] + 35],
            [line28[0][0], line28[0][1]],
        ],
    });
    diagram.moveDot({
        id: 'line27_dot',
        fillStyle: springGreen,
        strokeStyle: springGreen,
        radius: scalcRadius,
        flush: true,
        points: [
            [line27[0][0], line27[0][1]],
            [line27[1][0] + 35, line27[1][1]],
        ],
    });
    let line30 = diagram.getOption('line30').points;
    let line31 = diagram.getOption('line31').points;
    let line29 = diagram.getOption('line29').points;
    // diagram.moveDot({
    //     id: 'line28_dot',
    //     fillStyle: springGreen,
    //     strokeStyle: springGreen,
    //     radius: scalcRadius,
    //     flush: true,
    //     points: [
    //         [line28[1][0], line28[1][1] + 35],
    //         [line28[0][0], line28[0][1]],
    //     ],
    // });
    // diagram.moveDot({
    //     id: 'line27_dot',
    //     fillStyle: springGreen,
    //     strokeStyle: springGreen,
    //     radius: scalcRadius,
    //     flush: true,
    //     points: [
    //         [line27[0][0], line27[0][1]],
    //         [line27[1][0] + 35, line27[1][1]],
    //     ],
    // });
    // let line30 = diagram.getOption('line30').points;
    // let line31 = diagram.getOption('line31').points;
    // let line29 = diagram.getOption('line29').points;
    diagram.moveDot({
        id: 'line30_dot',
        fillStyle: springGreen,
        strokeStyle: springGreen,
        radius: scalcRadius,
        flush: true,
        points: [
            [line30[1][0] - 35, line30[1][1]],
            [line30[0][0], line30[0][1]],
        ],
    });
    diagram.moveDot({
        id: 'line31_dot',
        fillStyle: springGreen,
        strokeStyle: springGreen,
        radius: scalcRadius,
        flush: true,
        points: [
            [line31[0][0], line31[0][1]],
            [line31[1][0], line31[1][1] - 35],
        ],
    });
    // diagram.moveDot({
    //     id: 'line30_dot',
    //     fillStyle: springGreen,
    //     strokeStyle: springGreen,
    //     radius: scalcRadius,
    //     flush: true,
    //     points: [
    //         [line30[1][0] - 35, line30[1][1]],
    //         [line30[0][0], line30[0][1]],
    //     ],
    // });
    // diagram.moveDot({
    //     id: 'line31_dot',
    //     fillStyle: springGreen,
    //     strokeStyle: springGreen,
    //     radius: scalcRadius,
    //     flush: true,
    //     points: [
    //         [line31[0][0], line31[0][1]],
    //         [line31[1][0], line31[1][1] - 35],
    //     ],
    // });
    //震动测试器
    let Image14 = diagram.getOption('img14');
    diagram.ripples({
        id: 'ripples14',
        flush: true,
        color: '#50cef5',
        color: red,
        point: [Image14.point[0] + Image14.width / 2, Image14.point[1] + Image14.height / 2],
        maxRadius: Image14.width > Image14.height ? (Image14.width / 2) + 15 : (Image14.height / 2) + 15,
        minRadius: Image14.width > Image14.height ? Image14.width / 4 : Image14.height / 4,
        radius: Image14.width > Image14.height ? Image14.width / 2 : Image14.height / 2,
    })
    diagram.moveDot({
        id: 'line29_dot',
        fillStyle: springGreen,
        strokeStyle: springGreen,
        radius: scalcRadius,
        flush: true,
        points: [
            [line29[1][0], line29[1][1] + 35],
            [line29[0][0], line29[0][1] - 35],
        ],
    });
    // diagram.moveDot({
    //     id: 'line29_dot',
    //     fillStyle: springGreen,
    //     strokeStyle: springGreen,
    //     radius: scalcRadius,
    //     flush: true,
    //     points: [
    //         [line29[1][0], line29[1][1] + 35],
    //         [line29[0][0], line29[0][1] - 35],
    //     ],
    // });
}
function sensorCharge(diagram) {
@@ -1453,24 +1453,24 @@
    diagram.ripples({
        id: 'ripples5',
        flush: true,
        color: '#50cef5',
        color: red,
        point: [Image7.point[0] + Image7.width / 2, Image7.point[1] + Image7.height / 2],
        maxRadius: Image7.width > Image7.height ? (Image7.width / 2) + 15 : (Image7.height / 2) + 15,
        minRadius: Image7.width > Image7.height ? Image7.width / 4 : Image7.height / 4,
        radius: Image7.width > Image7.height ? Image7.width / 2 : Image7.height / 2,
    })
    let line32 = diagram.getOption('line32').points;
    diagram.moveDot({
        id: 'line32_dot',
        fillStyle: springGreen,
        strokeStyle: springGreen,
        radius: scalcRadius,
        flush: true,
        points: [
            [line32[1][0], line32[1][1] + 35],
            [line32[0][0], line32[0][1] - 35],
        ],
    });
    // let line32 = diagram.getOption('line32').points;
    // diagram.moveDot({
    //     id: 'line32_dot',
    //     fillStyle: springGreen,
    //     strokeStyle: springGreen,
    //     radius: scalcRadius,
    //     flush: true,
    //     points: [
    //         [line32[1][0], line32[1][1] + 35],
    //         [line32[0][0], line32[0][1] - 35],
    //     ],
    // });
}
function dynamometerCharge(diagram) {
@@ -1479,48 +1479,48 @@
    diagram.ripples({
        id: 'ripples6',
        flush: true,
        color: '#50cef5',
        color: red,
        point: [Image8.point[0] + Image8.width / 2, Image8.point[1] + Image8.height / 2],
        maxRadius: Image8.width > Image8.height ? (Image8.width / 2) + 15 : (Image8.height / 2) + 15,
        minRadius: Image8.width > Image8.height ? Image8.width / 4 : Image8.height / 4,
        radius: Image8.width > Image8.height ? Image8.width / 2 : Image8.height / 2,
    })
    let line35 = diagram.getOption('line35').points;
    let line34 = diagram.getOption('line34').points;
    let line33 = diagram.getOption('line33').points;
    diagram.moveDot({
        id: 'line35_dot',
        fillStyle: springGreen,
        strokeStyle: springGreen,
        radius: scalcRadius,
        flush: true,
        points: [
            [line35[1][0] + 35, line35[1][1]],
            [line35[0][0], line35[0][1]],
        ],
    });
    diagram.moveDot({
        id: 'line34_dot',
        fillStyle: springGreen,
        strokeStyle: springGreen,
        radius: scalcRadius,
        flush: true,
        points: [
            [line34[1][0], line34[1][1]],
            [line34[0][0], line34[0][1]],
        ],
    });
    diagram.moveDot({
        id: 'line33_dot',
        fillStyle: springGreen,
        strokeStyle: springGreen,
        radius: scalcRadius,
        flush: true,
        points: [
            [line33[1][0], line33[1][1]],
            [line33[0][0] - 35, line33[0][1]],
        ],
    });
    // let line35 = diagram.getOption('line35').points;
    // let line34 = diagram.getOption('line34').points;
    // let line33 = diagram.getOption('line33').points;
    // diagram.moveDot({
    //     id: 'line35_dot',
    //     fillStyle: springGreen,
    //     strokeStyle: springGreen,
    //     radius: scalcRadius,
    //     flush: true,
    //     points: [
    //         [line35[1][0] + 35, line35[1][1]],
    //         [line35[0][0], line35[0][1]],
    //     ],
    // });
    // diagram.moveDot({
    //     id: 'line34_dot',
    //     fillStyle: springGreen,
    //     strokeStyle: springGreen,
    //     radius: scalcRadius,
    //     flush: true,
    //     points: [
    //         [line34[1][0], line34[1][1]],
    //         [line34[0][0], line34[0][1]],
    //     ],
    // });
    // diagram.moveDot({
    //     id: 'line33_dot',
    //     fillStyle: springGreen,
    //     strokeStyle: springGreen,
    //     radius: scalcRadius,
    //     flush: true,
    //     points: [
    //         [line33[1][0], line33[1][1]],
    //         [line33[0][0] - 35, line33[0][1]],
    //     ],
    // });
}
function AFEcabinetCharge(diagram) {
@@ -1529,48 +1529,48 @@
    diagram.ripples({
        id: 'ripples7',
        flush: true,
        color: '#50cef5',
        color: red,
        point: [Image9.point[0] + Image9.width / 2, Image9.point[1] + Image9.height / 2],
        maxRadius: Image9.width > Image9.height ? (Image9.width / 2) + 15 : (Image9.height / 2) + 15,
        minRadius: Image9.width > Image9.height ? Image9.width / 4 : Image9.height / 4,
        radius: Image9.width > Image9.height ? Image9.width / 2 : Image9.height / 2,
    })
    let line36 = diagram.getOption('line36').points;
    let line37 = diagram.getOption('line37').points;
    let line38 = diagram.getOption('line38').points;
    diagram.moveDot({
        id: 'line38_dot',
        fillStyle: springGreen,
        strokeStyle: springGreen,
        radius: scalcRadius,
        flush: true,
        points: [
            [line38[1][0] + 35, line38[1][1]],
            [line38[0][0], line38[0][1]],
        ],
    });
    diagram.moveDot({
        id: 'line37_dot',
        fillStyle: springGreen,
        strokeStyle: springGreen,
        radius: scalcRadius,
        flush: true,
        points: [
            [line37[1][0], line37[1][1]],
            [line37[0][0], line37[0][1]],
        ],
    });
    diagram.moveDot({
        id: 'line36_dot',
        fillStyle: springGreen,
        strokeStyle: springGreen,
        radius: scalcRadius,
        flush: true,
        points: [
            [line36[1][0], line36[1][1]],
            [line36[0][0] - 35, line36[0][1]],
        ],
    });
    // let line36 = diagram.getOption('line36').points;
    // let line37 = diagram.getOption('line37').points;
    // let line38 = diagram.getOption('line38').points;
    // diagram.moveDot({
    //     id: 'line38_dot',
    //     fillStyle: springGreen,
    //     strokeStyle: springGreen,
    //     radius: scalcRadius,
    //     flush: true,
    //     points: [
    //         [line38[1][0] + 35, line38[1][1]],
    //         [line38[0][0], line38[0][1]],
    //     ],
    // });
    // diagram.moveDot({
    //     id: 'line37_dot',
    //     fillStyle: springGreen,
    //     strokeStyle: springGreen,
    //     radius: scalcRadius,
    //     flush: true,
    //     points: [
    //         [line37[1][0], line37[1][1]],
    //         [line37[0][0], line37[0][1]],
    //     ],
    // });
    // diagram.moveDot({
    //     id: 'line36_dot',
    //     fillStyle: springGreen,
    //     strokeStyle: springGreen,
    //     radius: scalcRadius,
    //     flush: true,
    //     points: [
    //         [line36[1][0], line36[1][1]],
    //         [line36[0][0] - 35, line36[0][1]],
    //     ],
    // });
}
function transformerCharge(diagram) {
@@ -1579,7 +1579,7 @@
    diagram.ripples({
        id: 'ripples8',
        flush: true,
        color: '#50cef5',
        color: red,
        point: [Image10.point[0] + Image10.width / 2, Image10.point[1] + Image10.height / 2],
        maxRadius: Image10.width > Image10.height ? (Image10.width / 2) + 15 : (Image10.height / 2) + 15,
        minRadius: Image10.width > Image10.height ? Image10.width / 4 : Image10.height / 4,
@@ -1593,24 +1593,24 @@
    diagram.ripples({
        id: 'ripples9',
        flush: true,
        color: '#50cef5',
        color: red,
        point: [Image11.point[0] + Image11.width / 2, Image11.point[1] + Image11.height / 2],
        maxRadius: Image11.width > Image11.height ? (Image11.width / 2) + 15 : (Image11.height / 2) + 15,
        minRadius: Image11.width > Image11.height ? Image11.width / 4 : Image11.height / 4,
        radius: Image11.width > Image11.height ? Image11.width / 2 : Image11.height / 2,
    })
    let line16 = diagram.getOption('line16').points;
    diagram.moveDot({
        id: 'line16_dot',
        fillStyle: springGreen,
        strokeStyle: springGreen,
        radius: scalcRadius,
        flush: true,
        points: [line16[0],
            [line16[1][0] + 35, line16[1][1]]
        ],
    });
    // let line16 = diagram.getOption('line16').points;
    // diagram.moveDot({
    //     id: 'line16_dot',
    //     fillStyle: springGreen,
    //     strokeStyle: springGreen,
    //     radius: scalcRadius,
    //     flush: true,
    //     points: [line16[0],
    //         [line16[1][0] + 35, line16[1][1]]
    //     ],
    // });
}
function oilStationCharge(diagram) {
@@ -1619,24 +1619,24 @@
    diagram.ripples({
        id: 'ripples10',
        flush: true,
        color: '#50cef5',
        color: red,
        point: [Image12.point[0] + Image12.width / 2, Image12.point[1] + Image12.height / 2],
        maxRadius: Image12.width > Image12.height ? (Image12.width / 2) + 15 : (Image12.height / 2) + 15,
        minRadius: Image12.width > Image12.height ? Image12.width / 4 : Image12.height / 4,
        radius: Image12.width > Image12.height ? Image12.width / 2 : Image12.height / 2,
    })
    let line17 = diagram.getOption('line17').points;
    diagram.moveDot({
        id: 'line17_dot',
        fillStyle: springGreen,
        strokeStyle: springGreen,
        radius: scalcRadius,
        flush: true,
        points: [line17[0],
            [line17[1][0] + 35, line17[1][1]]
        ],
    });
    // let line17 = diagram.getOption('line17').points;
    // diagram.moveDot({
    //     id: 'line17_dot',
    //     fillStyle: springGreen,
    //     strokeStyle: springGreen,
    //     radius: scalcRadius,
    //     flush: true,
    //     points: [line17[0],
    //         [line17[1][0] + 35, line17[1][1]]
    //     ],
    // });
}