| | |
| | | that.ourDatas[k].id = +k + 1; |
| | | } |
| | | } |
| | | //判断dom是否存在 |
| | | this.checkDom("getMapDataRefs", (dom) => { |
| | | //提供数据 |
| | | dom.onceOnlodad(that.ourDatas); |
| | | }); |
| | | this.nowId = +this.ourDatas.length + 1; |
| | | }, |
| | | methods: { |
| | | openDrawLineMethod() { |
| | | //添加线路的对象 |
| | | let id = this.nowId++; |
| | | this.ourDatas.push({ |
| | | label: "路径" + +id, |
| | | value: "", |
| | | name: "", |
| | | notPath: false, |
| | | //notpath判断是否验证通过的提示 2 为不通过 |
| | | isLine: true, |
| | | //isLine来判断是否是线 |
| | | id: +id, |
| | | //id确定不重复 |
| | | }); |
| | | }, |
| | | openDrawPointMethod() { |
| | | //添加点的对象 |
| | | let id = this.nowId++; |
| | | this.ourDatas.push({ |
| | | label: "标点" + +id, |
| | |
| | | }); |
| | | }, |
| | | deleteRowOurs(index) { |
| | | //删除 |
| | | this.ourDatas.splice(index, 1); |
| | | }, |
| | | backMapDataOurData(val, index) { |
| | | //在地图内useMapData方法中触发 |
| | | if (val == "line") { |
| | | this.ourDatas[index].value = this.rotesData; |
| | | } else if (val == "point") { |
| | |
| | | //以上是添加数据集方法 |
| | | //选择map数据 |
| | | openMap(val, num, value) { |
| | | //开始对地图做操作 |
| | | this.MapDataShow = true; |
| | | this.openTitle = val; |
| | | this.$refs.getMapDataRefs.init(val, num, value); |