openatc-components 0.0.97 → 0.0.100

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/package/kisscomps/components/Channelization/Channelization.vue +10 -13
  2. package/package/kisscomps/components/DrawChannelization/drawsvg/basicCoordInfo.vue +113 -0
  3. package/package/kisscomps/components/DrawChannelization/drawsvg/channelizationElements.vue +11 -18
  4. package/package/kisscomps/components/DrawChannelization/drawsvg/drawElement/crossMap.vue +74 -54
  5. package/package/kisscomps/components/DrawChannelization/drawsvg/firstImportCrossmap.vue +4 -1
  6. package/package/kisscomps/components/DrawChannelization/drawsvg/iconSvg/countdownSvg.vue +34 -11
  7. package/package/kisscomps/components/DrawChannelization/drawsvg/iconSvg/detectorChart.vue +26 -1
  8. package/package/kisscomps/components/DrawChannelization/drawsvg/iconSvg/detectorIconSvg.vue +37 -18
  9. package/package/kisscomps/components/DrawChannelization/drawsvg/iconSvg/laneIcon.vue +0 -6
  10. package/package/kisscomps/components/DrawChannelization/drawsvg/iconSvg/motorwayIconSvg.vue +50 -28
  11. package/package/kisscomps/components/DrawChannelization/drawsvg/iconSvg/pedroadIconSvg.vue +53 -29
  12. package/package/kisscomps/components/DrawChannelization/drawsvg/importDialog.vue +4 -1
  13. package/package/kisscomps/components/DrawChannelization/drawsvg/index.draw.vue +130 -147
  14. package/package/kisscomps/components/DrawChannelization/drawsvg/index.vue +6 -5
  15. package/package/kisscomps/components/DrawChannelization/drawsvg/laneEditPanel.vue +144 -43
  16. package/package/kisscomps/components/DrawChannelization/drawsvg/utils/loadutils.js +45 -1
  17. package/package/kisscomps/components/SchemeConfig/SchemeConfig.vue +0 -16
  18. package/package/kisscomps/index.js +0 -2
  19. package/package/kissui.min.js +1 -1
  20. package/package.json +12 -13
  21. package/src/i18n/language/en.js +7 -32
  22. package/src/i18n/language/zh.js +6 -31
  23. package/src/kisscomps/components/Channelization/Channelization.vue +10 -13
  24. package/src/kisscomps/components/DrawChannelization/drawsvg/basicCoordInfo.vue +113 -0
  25. package/src/kisscomps/components/DrawChannelization/drawsvg/channelizationElements.vue +11 -18
  26. package/src/kisscomps/components/DrawChannelization/drawsvg/drawElement/crossMap.vue +74 -54
  27. package/src/kisscomps/components/DrawChannelization/drawsvg/firstImportCrossmap.vue +4 -1
  28. package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/countdownSvg.vue +34 -11
  29. package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/detectorChart.vue +26 -1
  30. package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/detectorIconSvg.vue +37 -18
  31. package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/laneIcon.vue +0 -6
  32. package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/motorwayIconSvg.vue +50 -28
  33. package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/pedroadIconSvg.vue +53 -29
  34. package/src/kisscomps/components/DrawChannelization/drawsvg/importDialog.vue +4 -1
  35. package/src/kisscomps/components/DrawChannelization/drawsvg/index.draw.vue +130 -147
  36. package/src/kisscomps/components/DrawChannelization/drawsvg/index.vue +6 -5
  37. package/src/kisscomps/components/DrawChannelization/drawsvg/laneEditPanel.vue +144 -43
  38. package/src/kisscomps/components/DrawChannelization/drawsvg/utils/loadutils.js +45 -1
  39. package/src/kisscomps/components/SchemeConfig/SchemeConfig.vue +0 -16
  40. package/src/kisscomps/index.js +0 -2
  41. package/src/router/index.js +2 -2
  42. package/static/styles/channelizatioon.scss +40 -2
  43. package/static/styles/schemeconfig.scss +0 -52
  44. package/package/kisscomps/components/SchemeConfig/priorityControl/index.vue +0 -190
  45. package/package/kisscomps/components/SchemeConfig/priorityControl/utils.js +0 -163
  46. package/src/kisscomps/components/DrawChannelization/drawsvg/phaseAssociatedComponent.check.vue +0 -191
  47. package/src/kisscomps/components/DrawChannelization/drawsvg/phaseAssociatedComponent.syncOper.vue +0 -331
  48. package/src/kisscomps/components/SchemeConfig/priorityControl/index.vue +0 -190
  49. package/src/kisscomps/components/SchemeConfig/priorityControl/utils.js +0 -163
@@ -12,7 +12,7 @@
12
12
  <!--渠化绘制功能-->
13
13
  <template>
14
14
  <div class="custom-cross" v-if="visible">
15
- <ImportDialog ref="importDialog" @loadSvgString="loadSvgString"/>
15
+ <ImportDialog ref="importDialog" @loadSvgString="loadSvgString" @loadMapSize="loadMapSize" />
16
16
  <Messagebox :visible="canclesettingvisible" :text="$t('openatccomponents.channelizationmap.canclesetting')" @cancle="cancleSetting" @ok="completeSetting"/>
17
17
  <div class="custom-main" ref="custommain">
18
18
  <div class="custom-group drawPanelAnimation" ref="customGroup">
@@ -26,6 +26,8 @@
26
26
  :disabled="!isSeletable"
27
27
  @click="clickOpen"
28
28
  >{{$t('openatccomponents.channelizationmap.againimport')}}</el-button>
29
+ <i class="lock-map el-icon-unlock" v-if="isLockedCrossMap" @click="handleLockCrossMap()"></i>
30
+ <i class="lock-map el-icon-lock" v-if="!isLockedCrossMap" @click="handleLockCrossMap()"></i>
29
31
  </div>
30
32
 
31
33
  <div class="draw-to-sketchpad">
@@ -53,17 +55,6 @@
53
55
  </div>
54
56
  <!-- 画板区域 -->
55
57
  <div class="sketchpad-area" id="sketchpadgroup" ref="sketchpadgroup">
56
- <!-- <drr
57
- id="sketchpadArea"
58
- :resizable="false"
59
- :x="allitem.x"
60
- :y="allitem.y"
61
- :w="allitem.w"
62
- :h="allitem.h"
63
- :angle="allitem.angle"
64
- :selectable="false"
65
- :aspectRatio="true"
66
- > -->
67
58
  <ChannelizationElements
68
59
  id="channelizationElements"
69
60
  :allitem="allitem"
@@ -86,8 +77,8 @@
86
77
  :DetectorChart="DetectorChart"
87
78
  :CurChooseIcon="curChooseIcon"
88
79
  @changeDetectorChartItem="changeDetectorChartItem"
80
+ :isLockedCrossMap="isLockedCrossMap"
89
81
  />
90
- <!-- </drr> -->
91
82
  </div>
92
83
  <div class="draw-end-function">
93
84
  <el-button type="primary" @click="handleReset()">{{$t('openatccomponents.button.reset')}}</el-button>
@@ -103,6 +94,7 @@
103
94
  @handleChooseDire="handleChooseDire"
104
95
  @handleChoosePed="handleChoosePed"
105
96
  @deleteItem="deleteItem"
97
+ @cloneItem="cloneItem"
106
98
  @changeIconDataByType="changeIconDataByType"
107
99
  @handleDisassociatePhase="handleDisassociatePhase"
108
100
  />
@@ -155,8 +147,6 @@ export default {
155
147
  ...mapState({
156
148
  phaseList: state => state.globalParam.tscParam.phaseList,
157
149
  PhaseDataMgr: state => state.globalParam.PhaseDataMgr
158
- // ,curBodyWidth: state => state.globalParam.curBodyWidth
159
- // ,curOpenatcAgentid: state => state.globalParam.curOpenatcAgentid
160
150
  })
161
151
  },
162
152
  props: {
@@ -169,21 +159,6 @@ export default {
169
159
  }
170
160
  },
171
161
  watch: {
172
- // curBodyWidth: {
173
- // handler: function (oldval, newval) {
174
- // if (newval !== oldval) {
175
- // this.resizePanelWidth(newval)
176
- // }
177
- // }
178
- // },
179
- // sidebar: {
180
- // handler: function (oldval, newval) {
181
- // setTimeout(() => {
182
- // this.resizePanelWidth(this.curBodyWidth)
183
- // }, 200)
184
- // },
185
- // deep: true
186
- // },
187
162
  AgentId: {
188
163
  handler: function (val) {
189
164
  // 平台设备切换时,清空上一个渠化配置
@@ -208,8 +183,8 @@ export default {
208
183
  index: 0,
209
184
  motorid: 1, // 车道id
210
185
  pedid: 1, // 人行道id
186
+ detectorcoilid: 1, // 检测器线圈id(非关联检测器id)
211
187
  Motorways: [], // 管理所有自定义机动车图标数据
212
- // Bicyclelanes: [], // 非机动车图标数据
213
188
  customlist: [], // 所有自定义的图标列表
214
189
  Texts: [], // 管理所有自定义文字数据
215
190
  Pedwalk: [], // 管理所有人行横道
@@ -224,11 +199,19 @@ export default {
224
199
  pedH: 22,
225
200
  MapW: 800,
226
201
  MapH: 200,
227
- detectorW: 30,
228
- detectorH: 30,
202
+ detectorW: 20,
203
+ detectorH: 20,
229
204
  detectorchartW: 70,
230
205
  detectorchartH: 100,
206
+ isLockedCrossMap: true, // 底图是否是锁定状态
231
207
  CrossMapData: {
208
+ index: -2,
209
+ icontype: 'crossmap',
210
+ x: 400,
211
+ y: 100,
212
+ w: 800,
213
+ h: 200,
214
+ angle: 0,
232
215
  svgstr: '',
233
216
  imgfilesrc: ''
234
217
  }, // 管理底图数据
@@ -258,7 +241,7 @@ export default {
258
241
  pointchange: false, // 控制选中时光标样式
259
242
  CrossMapVisible: true, // 控制底图显示隐藏
260
243
 
261
- curChooseIconIndex: -1,
244
+ curChooseIconIndex: -1, // 底图暂用-2代替,别的图标与递增的index相关
262
245
  curChooseIcon: {},
263
246
  editBtnGroup: [
264
247
  {
@@ -268,13 +251,6 @@ export default {
268
251
  width: '16px',
269
252
  height: '16px'
270
253
  },
271
- // {
272
- // label: this.$t('openatccomponents.channelizationmap.bicyclelane'),
273
- // type: 'bicyclelane',
274
- // active: false,
275
- // width: '7px',
276
- // height: '16px'
277
- // },
278
254
  {
279
255
  label: this.$t('openatccomponents.channelizationmap.pedcrossing'),
280
256
  type: 'pedcrossing',
@@ -316,7 +292,6 @@ export default {
316
292
  // 改变鼠标样式
317
293
  changeMouse () {
318
294
  if (!this.isSeletable) return
319
- // document.getElementById('sketchpadArea').style.cursor = 'url(resource/pic/icons/magnifier3.cur) 12 12,crosshair'
320
295
  document.getElementById('sketchpadArea').style.cursor =
321
296
  'url(resource/pic/icons/magnifier3.cur) 12 12,pointer'
322
297
  this.pointchange = true
@@ -346,6 +321,8 @@ export default {
346
321
  case 'detector':
347
322
  this.changeDetectorItem(iconObj, changefield)
348
323
  break
324
+ case 'crossmap':
325
+ this.changeCrossMap(iconObj, changefield)
349
326
  }
350
327
  console.log('this.customlist', this.customlist)
351
328
  },
@@ -425,9 +402,13 @@ export default {
425
402
  },
426
403
 
427
404
  // 选中图标
428
- handleSelectIcon (iconobj) {
405
+ handleSelectIcon (iconobj, isCrossMap) {
429
406
  // console.log('选中的图标', iconobj)
430
- this.curChooseIconIndex = iconobj.index
407
+ if (isCrossMap === 'crossmap') {
408
+ this.curChooseIconIndex = -2
409
+ } else {
410
+ this.curChooseIconIndex = iconobj.index
411
+ }
431
412
  this.curChooseIcon = JSON.parse(JSON.stringify(iconobj))
432
413
  },
433
414
  // 根据多选的车道,修改车道图标
@@ -446,7 +427,6 @@ export default {
446
427
  'icondirename'
447
428
  ])
448
429
  }
449
- console.log(this.curChooseIcon)
450
430
  },
451
431
 
452
432
  addPedwalkIcon () {
@@ -521,8 +501,9 @@ export default {
521
501
 
522
502
  addAllDetector () {
523
503
  // 统计图暂留
524
- // this.addDetectorChart()
525
504
  this.addDetector()
505
+ // this.addDetectorChart()
506
+ this.detectorcoilid = this.increaseId(this.Detector, 'id')
526
507
  },
527
508
  addDetector () {
528
509
  let defaultDetectorParam = {
@@ -532,16 +513,18 @@ export default {
532
513
  h: this.detectorH,
533
514
  angle: 0
534
515
  }
535
- this.detectorW = 30
536
- this.detectorH = 30
516
+ this.detectorW = 20
517
+ this.detectorH = 20
537
518
  let detectoritem = {
538
519
  index: this.index,
520
+ id: this.detectorcoilid,
539
521
  icontype: 'detector',
540
522
  detailtype: 'detector',
541
523
  detectortype: 1, // 检测器类型: 1 车辆检测器 2 行人检测器
542
524
  detectorid: undefined,
543
525
  occupancythreshold: 80,
544
- flowsaturationthreshold: 20,
526
+ minflowsaturationthreshold: 30,
527
+ maxflowsaturationthreshold: 70,
545
528
  ...defaultDetectorParam
546
529
  }
547
530
  this.curChooseIconIndex = detectoritem.index
@@ -566,6 +549,7 @@ export default {
566
549
  this.detectorchartH = 100
567
550
  let detectoritem = {
568
551
  index: this.index,
552
+ id: this.detectorcoilid,
569
553
  icontype: 'detector',
570
554
  detailtype: 'detectorChart',
571
555
  ...defaultDetectorParam
@@ -621,57 +605,109 @@ export default {
621
605
  },
622
606
  deleteItem (row) {
623
607
  let index = row.index
608
+ // let id = row.id
624
609
  this.customlist = this.customlist.filter(ele => ele.index !== index)
625
610
  switch (row.icontype) {
626
- case 'text':
627
- this.Texts = this.Texts.filter(ele => ele.index !== index)
628
- break
611
+ // case 'text':
612
+ // this.Texts = this.Texts.filter(ele => ele.index !== index)
613
+ // break
629
614
  case 'vehile':
630
615
  this.Motorways = this.Motorways.filter(ele => ele.index !== index)
616
+ this.motorid = this.increaseId(this.Motorways, 'id')
631
617
  break
632
618
  case 'ped':
633
619
  this.Pedwalk = this.Pedwalk.filter(ele => ele.index !== index)
620
+ this.pedid = this.increaseId(this.Pedwalk, 'id')
634
621
  break
635
622
  case 'countdown':
636
623
  this.Countdown = this.Countdown.filter(ele => ele.index !== index)
637
624
  break
638
625
  case 'detector':
639
626
  this.Detector = this.Detector.filter(ele => ele.index !== index)
640
- this.DetectorChart = this.DetectorChart.filter(ele => ele.index !== index)
627
+ // this.DetectorChart = this.DetectorChart.filter(ele => ele.id !== id)
628
+ this.detectorcoilid = this.increaseId(this.Detector, 'id')
641
629
  }
642
630
  this.curChooseIconIndex = -1
643
631
  this.curChooseIcon = {}
644
632
  },
633
+ cloneItem (row) {
634
+ // 克隆元素
635
+ let cloneObj = {
636
+ ...row,
637
+ index: this.index,
638
+ x: 435,
639
+ y: 325
640
+ }
641
+ switch (row.icontype) {
642
+ case 'vehile':
643
+ cloneObj.id = this.motorid
644
+ this.Motorways.push(cloneObj)
645
+ this.motorid = this.increaseId(this.Motorways, 'id')
646
+ this.customlist.push(cloneObj)
647
+ break
648
+ case 'ped':
649
+ cloneObj.id = this.pedid
650
+ this.Pedwalk.push(cloneObj)
651
+ this.pedid = this.increaseId(this.Pedwalk, 'id')
652
+ this.customlist.push(cloneObj)
653
+ break
654
+ // case 'countdown':
655
+ // this.Countdown.push(cloneObj)
656
+ // this.customlist.push(cloneObj)
657
+ // break
658
+ case 'detector':
659
+ cloneObj.id = this.detectorcoilid
660
+ this.Detector.push(cloneObj)
661
+ this.customlist.push(cloneObj)
662
+ // 同时克隆统计图
663
+ // this.index = this.increaseId(this.customlist, 'index')
664
+ // let curchartobj = JSON.parse(JSON.stringify(this.DetectorChart)).filter(ele => ele.id === row.id)[0]
665
+ // curchartobj.index = this.index
666
+ // curchartobj.id = this.detectorcoilid
667
+ // curchartobj.x = 435
668
+ // curchartobj.y = 325 - 100
669
+ // this.DetectorChart.push(curchartobj)
670
+ // this.customlist.push(curchartobj)
671
+ this.detectorcoilid = this.increaseId(this.Detector, 'id')
672
+ }
673
+ this.curChooseIconIndex = this.index
674
+ this.curChooseIcon = JSON.parse(JSON.stringify(cloneObj))
675
+ this.index = this.increaseId(this.customlist, 'index')
676
+ },
645
677
 
646
678
  loadSvgString (type, imgstr) {
647
679
  // 加载用户上传的底图svg字符串
648
680
  if (type === 'vectorgraph') {
649
681
  // 导入矢量图
650
- this.getCrossMapViewbox(imgstr)
651
- let defaultCrossMapParam = {
652
- x: this.MapW / 2,
653
- y: this.MapH / 2,
654
- w: this.MapW,
655
- h: this.MapH,
656
- angle: 0
657
- }
658
- // (由于底图采用定位,导致脱离标准流,父元素高度塌陷,此处需要重新设置父元素高度,以防底图超出弹窗边界)
659
- // this.$refs.crossmap.style.height = this.MapH
660
- // this.$refs.crossmap.style.width = this.MapW
682
+ // this.getCrossMapViewbox(imgstr)
661
683
  this.CrossMapData = {
684
+ ...this.CrossMapData,
662
685
  type,
663
- svgstr: imgstr,
664
- ...defaultCrossMapParam
686
+ svgstr: imgstr
665
687
  }
666
688
  }
667
689
  if (type === 'picture') {
668
690
  // 导入图片
669
691
  this.CrossMapData = {
692
+ ...this.CrossMapData,
670
693
  type,
671
694
  imgfilesrc: imgstr
672
695
  }
673
696
  }
674
697
  },
698
+ loadMapSize (type, mapsize) {
699
+ this.CrossMapData = {
700
+ ...this.CrossMapData,
701
+ angle: 0,
702
+ x: Math.round(mapsize.width / 2),
703
+ y: Math.round(mapsize.height / 2),
704
+ w: Math.round(mapsize.width),
705
+ h: Math.round(mapsize.height)
706
+ }
707
+ this.MapW = mapsize.width
708
+ this.MapH = mapsize.height
709
+ },
710
+
675
711
  getCrossMapViewbox (svgstr) {
676
712
  // 获取户上传svg的viewBox属性的大小
677
713
  let arr = svgstr.split('"')
@@ -701,6 +737,13 @@ export default {
701
737
  this.Detector = []
702
738
  this.DetectorChart = []
703
739
  this.CrossMapData = {
740
+ index: -2, // 暂定为-2,用于复用图标判断逻辑
741
+ icontype: 'crossmap',
742
+ x: this.MapW / 2,
743
+ y: this.MapH / 2,
744
+ w: this.MapW,
745
+ h: this.MapH,
746
+ angle: 0,
704
747
  svgstr: '',
705
748
  imgfilesrc: ''
706
749
  }
@@ -729,7 +772,7 @@ export default {
729
772
  temp[item.icontype] = [item]
730
773
  }
731
774
  }
732
- if (this.CrossMapData.svgstr !== '') {
775
+ if (this.CrossMapData.svgstr !== '' || this.CrossMapData.imgfilesrc !== '') {
733
776
  temp.crossMap = this.CrossMapData
734
777
  }
735
778
  this.saveChannelizatonChart(temp)
@@ -737,8 +780,6 @@ export default {
737
780
  // 加载
738
781
  load (type) {
739
782
  this.curChooseIconIndex = -1
740
- // this.getChannelizatonChart().then((channelizatondata) => {
741
- // let savedTemp = JSON.parse(localStorage.getItem('savedTemp'))
742
783
  let savedTemp = JSON.parse(JSON.stringify(this.loadedChannelizatonData))
743
784
  let arr = []
744
785
  for (const [key, value] of Object.entries(savedTemp)) {
@@ -756,15 +797,10 @@ export default {
756
797
  }
757
798
  if (key === 'detector') {
758
799
  this.Detector = value.filter(ele => ele.detailtype === 'detector')
759
- this.DetectorChart = value.filter(ele => ele.detailtype === 'detectorChart')
800
+ // this.DetectorChart = value.filter(ele => ele.detailtype === 'detectorChart')
760
801
  }
761
802
  if (key === 'crossMap') {
762
803
  this.CrossMapData = JSON.parse(JSON.stringify(value))
763
- // if (value.type === 'vectorgraph') {
764
- // // svg底图,只加载底图区域870*650范围内的元素
765
- // let { svgstr, ...allitem } = value
766
- // this.allitem = allitem
767
- // }
768
804
  } else {
769
805
  if (value.length > 1) {
770
806
  arr = [...arr, ...value]
@@ -774,16 +810,18 @@ export default {
774
810
  }
775
811
  }
776
812
  this.customlist = JSON.parse(JSON.stringify(arr))
777
- this.index = this.increaseId(this.customlist, 'index')
778
- this.motorid = this.increaseId(this.Motorways, 'id')
779
- this.pedid = this.increaseId(this.Pedwalk, 'id')
780
- // if (type === 'all') {
781
- // // 加载整体模版后,默认切换到元素不可编辑状态,但整体可编辑
782
- // this.isSeletable = false
783
- // } else {
784
- // this.isSeletable = true
785
- // }
786
- // })
813
+ if (this.customlist.length > 0) {
814
+ this.index = this.increaseId(this.customlist, 'index')
815
+ }
816
+ if (this.Motorways.length > 0) {
817
+ this.motorid = this.increaseId(this.Motorways, 'id')
818
+ }
819
+ if (this.Pedwalk.length > 0) {
820
+ this.pedid = this.increaseId(this.Pedwalk, 'id')
821
+ }
822
+ if (this.Detector.length > 0) {
823
+ this.detectorcoilid = this.increaseId(this.Detector, 'id')
824
+ }
787
825
  },
788
826
  increaseId (arr, field) { // 实现field对应的index或者id, 在arr的基础上寻找最小的
789
827
  let List = arr.map(ele => ele[field])
@@ -808,25 +846,6 @@ export default {
808
846
  return btn
809
847
  })
810
848
  },
811
- resizePanelWidth (bodywidth) {
812
- // 根据1920适配,右侧过宽
813
- // this.drawpartWidth = ((1089 / 1980) * bodywidth).toFixed(0)
814
- // this.mainWidth = this.$refs.custommain.offsetWidth
815
- // this.editpartWidth = Number(this.mainWidth) - Number(this.drawpartWidth) - 20
816
- // this.$refs.customGroup.style.width = this.drawpartWidth + 'px'
817
- // this.$refs.customEdit.style.width = this.editpartWidth + 'px'
818
- // this.allitem.w = this.drawpartWidth
819
- // this.allitem.x = this.drawpartWidth / 2
820
- // 编辑面板固定宽度600,左侧适配
821
- this.mainWidth = this.$refs.custommain.offsetWidth
822
- this.drawpartWidth = this.mainWidth - 545
823
- this.$refs.customGroup.style.width = this.drawpartWidth + 'px'
824
- this.$refs.customGroup.style.transition = 'width 0.5s ease-in-out'
825
- if (this.mainWidth && this.drawpartWidth) {
826
- this.allitem.w = this.drawpartWidth
827
- this.allitem.x = this.drawpartWidth / 2
828
- }
829
- },
830
849
  saveChannelizatonChart (ChannelizatonData) {
831
850
  // let agentid = getIframdevid()
832
851
  let params = {
@@ -857,31 +876,6 @@ export default {
857
876
  })
858
877
  })
859
878
  },
860
- // getChannelizatonChart () {
861
- // let agentid = getIframdevid()
862
- // return new Promise((resolve, reject) => {
863
- // getChannelizatonChart(agentid).then(data => {
864
- // if (!data.data.success) {
865
- // let parrenterror = getMessageByCode(data.data.code, this.$i18n.locale)
866
- // if (data.data.data) {
867
- // // 子类型错误
868
- // let childErrorCode = data.data.data.errorCode
869
- // if (childErrorCode) {
870
- // let childerror = getMessageByCode(data.data.data.errorCode, this.$i18n.locale)
871
- // this.$message.error(parrenterror + ',' + childerror)
872
- // }
873
- // } else {
874
- // this.$message.error(parrenterror)
875
- // }
876
- // this.handleReset()
877
- // return
878
- // }
879
- // this.handleReset()
880
- // let channelizatondata = data.data.data
881
- // resolve(channelizatondata)
882
- // })
883
- // })
884
- // },
885
879
  handleClickSketchpad () {
886
880
  // 监听画板区域点击事件,改变图标放置的位置
887
881
  let sketchpadArea = document.getElementById('sketchpadArea')
@@ -891,12 +885,10 @@ export default {
891
885
  document.getElementById('sketchpadArea').style.cursor =
892
886
  'url(resource/pic/icons/magnifier3.cur) 12 12,default'
893
887
  _this.pointchange = false
894
- _this.setLeft =
895
- e.clientX -
896
- document.getElementById('channelizationElements').getBoundingClientRect().left
897
- _this.setTop =
898
- e.clientY -
899
- document.getElementById('channelizationElements').getBoundingClientRect().top
888
+ let boundingClientLeft = document.getElementById('channelizationElements').getBoundingClientRect().left
889
+ let boundingClientTop = document.getElementById('channelizationElements').getBoundingClientRect().top
890
+ _this.setLeft = Math.round(e.clientX - boundingClientLeft) // 四舍五入
891
+ _this.setTop = Math.round(e.clientY - boundingClientTop)
900
892
  if (_this.AddType === '') return
901
893
  switch (_this.AddType) {
902
894
  case 'motorway':
@@ -914,25 +906,16 @@ export default {
914
906
  _this.resetAddParams()
915
907
  }
916
908
  })
909
+ },
910
+ handleLockCrossMap () {
911
+ this.isLockedCrossMap = !this.isLockedCrossMap
917
912
  }
918
913
  },
919
- created () {},
920
914
  mounted () {
921
- // this.resizePanelWidth(this.curBodyWidth)
922
915
  let PhaseData = new PhaseDataMgr(this.phaseList)
923
916
  this.$store.dispatch('InitPhaseDataMgr', PhaseData)
924
917
  this.handleClickSketchpad()
925
- // 初始加载已保存的渠化图
926
- // this.load('all')
927
918
  }
928
- // updated () {
929
- // if (this.$refs.sketchpadgroup.offsetWidth) {
930
- // this.allitem.w = this.$refs.sketchpadgroup.offsetWidth
931
- // this.allitem.x = this.$refs.sketchpadgroup.offsetWidth / 2
932
- // this.allitem.h = this.$refs.sketchpadgroup.offsetHeight
933
- // this.allitem.y = this.$refs.sketchpadgroup.offsetHeight / 2
934
- // }
935
- // }
936
919
  }
937
920
  </script>
938
921
 
@@ -13,7 +13,7 @@
13
13
  <template>
14
14
  <div class="custom-cross-part draw-channelization">
15
15
  <FirstImportCrossmap v-if="pageindex === 1"
16
- @loadSvgString="loadSvgString" />
16
+ @loadSvgString="loadSvgString" @loadMapSize="loadMapSize" />
17
17
  <CustomDraw v-show="pageindex === 2" ref="CustomDraw"
18
18
  :AgentId="AgentId"
19
19
  :loadedChannelizatonData="loadedChannelizatonData"
@@ -23,10 +23,7 @@
23
23
  <script>
24
24
  import FirstImportCrossmap from './firstImportCrossmap'
25
25
  import CustomDraw from './index.draw'
26
- // import { mapState } from 'vuex'
27
- // import { getIframdevid } from '../../../../utils/auth.js'
28
26
  import { getChannelizatonChart } from '../../../../api/cross'
29
- // import { getMessageByCode } from '../../../utils/responseMessage.js'
30
27
 
31
28
  export default {
32
29
  name: 'custom-channelization',
@@ -72,8 +69,12 @@ export default {
72
69
  this.$refs.CustomDraw.loadSvgString(type, imgstr)
73
70
  })
74
71
  },
72
+ loadMapSize (type, mapsize) {
73
+ this.$nextTick(() => {
74
+ this.$refs.CustomDraw.loadMapSize(type, mapsize)
75
+ })
76
+ },
75
77
  getChannelizatonChart () {
76
- // let agentid = getIframdevid()
77
78
  let _this = this
78
79
  _this.pageindex = 1
79
80
  getChannelizatonChart(this.AgentId).then(data => {