| | |
| | | fromY = pt2.y |
| | | } |
| | | let strokeWidth = 5 |
| | | let stroke = "#95DE64" |
| | | let stroke = "#69C0FF" |
| | | |
| | | if (main_road == 1) { |
| | | stroke = "#69C0FF" |
| | | } |
| | | // if (main_road == 1) { |
| | | // stroke = "#69C0FF" |
| | | // } |
| | | const objPath = new fabric.Path( |
| | | path2, { |
| | | id: "current_teaching", |
| | |
| | | |
| | | const theta = 20; |
| | | let headlen = 10; |
| | | var main_road = 1 |
| | | var main_road = teachingData.main_road || 0 |
| | | |
| | | const len = pos_list.length |
| | | let fromX = 0, |
| | |
| | | // } |
| | | path2 += ` L${pt2.x} ${pt2.y}` |
| | | } else { |
| | | main_road = pt.main_road |
| | | if (main_road == 1) { |
| | | headlen = 15 |
| | | } |
| | | if (pt.main_road) |
| | | main_road = pt.main_road |
| | | // if (main_road == 1) { |
| | | // headlen = 15 |
| | | // } |
| | | path2 = `M${pt2.x} ${pt2.y}` |
| | | } |
| | | fromX = pt2.x |
| | |
| | | |
| | | // console.log("addTeachingPath",path2) |
| | | // path2 += " Z" |
| | | let strokeWidth = 2 |
| | | let stroke = "#95DE64" |
| | | let strokeWidth = 1.5 |
| | | let stroke = "#69C0FF" |
| | | if (type == "station_teaching") { |
| | | stroke = "#69C0FF" |
| | | } else { |
| | | if (main_road == 1) { |
| | | stroke = "#69C0FF" |
| | | if (teachingData.bidirection == 1) { |
| | | stroke = "#FF00FF" |
| | | } |
| | | } else { |
| | | //stroke = "#69C0FF" |
| | | if (teachingData.bidirection == 1) { |
| | | stroke = "#ffaa00" |
| | | } |
| | | strokeWidth = 3 |
| | | |
| | | } else { |
| | | if (teachingData.bidirection == 1) { |
| | | stroke = "#FF00FF" |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | return objPath |
| | | }, |
| | | |
| | | isObjectFullyContained(outerObj, innerObj) { |
| | | const outer = outerObj.getBoundingRect(true, true); |
| | | const inner = innerObj.getBoundingRect(true, true); |
| | |
| | | const teachingMode = item.param |
| | | _this.showEditTeachingPath(teachingMode) |
| | | |
| | | } else if (item.method == "update_teaching") { |
| | | let list = _this.canvas.getObjects() || [] |
| | | list = list.filter((a) => a.eleType == "public_teaching") |
| | | const id = `public_teaching_${item.param.name}` |
| | | const curIndex = list.findIndex((a) => a.id == id) |
| | | if (curIndex > -1) { |
| | | const obj = list[curIndex] |
| | | |
| | | |
| | | |
| | | let strokeWidth = 1.5 |
| | | let stroke = "#69C0FF" |
| | | |
| | | if (item.param.main_road == 1) { |
| | | //stroke = "#69C0FF" |
| | | if (item.param.bidirection == 1) { |
| | | stroke = "#ffaa00" |
| | | } |
| | | strokeWidth = 3 |
| | | |
| | | } else { |
| | | if (item.param.bidirection == 1) { |
| | | stroke = "#FF00FF" |
| | | } |
| | | } |
| | | |
| | | obj.set({strokeWidth,stroke}) |
| | | |
| | | } |
| | | } else if (item.method == "set_selectable") { |
| | | if (item.param) |
| | | _this.setAllObjectSelectable(true) |