openatc-components 0.0.99 → 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 (59) hide show
  1. package/package/kisscomps/components/BoardCard/BoardCard.vue +1 -6
  2. package/package/kisscomps/components/Channelization/Channelization.vue +10 -13
  3. package/package/kisscomps/components/DrawChannelization/drawsvg/basicCoordInfo.vue +113 -0
  4. package/package/kisscomps/components/DrawChannelization/drawsvg/channelizationElements.vue +11 -18
  5. package/package/kisscomps/components/DrawChannelization/drawsvg/drawElement/crossMap.vue +74 -54
  6. package/package/kisscomps/components/DrawChannelization/drawsvg/firstImportCrossmap.vue +4 -1
  7. package/package/kisscomps/components/DrawChannelization/drawsvg/iconSvg/countdownSvg.vue +34 -11
  8. package/package/kisscomps/components/DrawChannelization/drawsvg/iconSvg/detectorChart.vue +26 -1
  9. package/package/kisscomps/components/DrawChannelization/drawsvg/iconSvg/detectorIconSvg.vue +37 -18
  10. package/package/kisscomps/components/DrawChannelization/drawsvg/iconSvg/laneIcon.vue +0 -6
  11. package/package/kisscomps/components/DrawChannelization/drawsvg/iconSvg/motorwayIconSvg.vue +50 -28
  12. package/package/kisscomps/components/DrawChannelization/drawsvg/iconSvg/pedroadIconSvg.vue +53 -29
  13. package/package/kisscomps/components/DrawChannelization/drawsvg/importDialog.vue +4 -1
  14. package/package/kisscomps/components/DrawChannelization/drawsvg/index.draw.vue +130 -147
  15. package/package/kisscomps/components/DrawChannelization/drawsvg/index.vue +6 -5
  16. package/package/kisscomps/components/DrawChannelization/drawsvg/laneEditPanel.vue +144 -43
  17. package/package/kisscomps/components/DrawChannelization/drawsvg/utils/loadutils.js +45 -1
  18. package/package/kisscomps/components/KanBan/kanban.vue +6 -6
  19. package/package/kisscomps/components/PatternStatus/PatternStatus.vue +38 -153
  20. package/package/kisscomps/components/SchemeConfig/SchemeConfig.vue +0 -16
  21. package/package/kisscomps/components/StageStatus/StageStatus.vue +2 -6
  22. package/package/kisscomps/components/patternList/patternList.vue +0 -5
  23. package/package/kisscomps/index.js +0 -2
  24. package/package/kissui.min.js +1 -1
  25. package/package.json +12 -13
  26. package/src/i18n/language/en.js +7 -32
  27. package/src/i18n/language/zh.js +6 -31
  28. package/src/kisscomps/components/BoardCard/BoardCard.vue +1 -6
  29. package/src/kisscomps/components/Channelization/Channelization.vue +10 -13
  30. package/src/kisscomps/components/DrawChannelization/drawsvg/basicCoordInfo.vue +113 -0
  31. package/src/kisscomps/components/DrawChannelization/drawsvg/channelizationElements.vue +11 -18
  32. package/src/kisscomps/components/DrawChannelization/drawsvg/drawElement/crossMap.vue +74 -54
  33. package/src/kisscomps/components/DrawChannelization/drawsvg/firstImportCrossmap.vue +4 -1
  34. package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/countdownSvg.vue +34 -11
  35. package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/detectorChart.vue +26 -1
  36. package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/detectorIconSvg.vue +37 -18
  37. package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/laneIcon.vue +0 -6
  38. package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/motorwayIconSvg.vue +50 -28
  39. package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/pedroadIconSvg.vue +53 -29
  40. package/src/kisscomps/components/DrawChannelization/drawsvg/importDialog.vue +4 -1
  41. package/src/kisscomps/components/DrawChannelization/drawsvg/index.draw.vue +130 -147
  42. package/src/kisscomps/components/DrawChannelization/drawsvg/index.vue +6 -5
  43. package/src/kisscomps/components/DrawChannelization/drawsvg/laneEditPanel.vue +144 -43
  44. package/src/kisscomps/components/DrawChannelization/drawsvg/utils/loadutils.js +45 -1
  45. package/src/kisscomps/components/KanBan/kanban.vue +6 -6
  46. package/src/kisscomps/components/PatternStatus/PatternStatus.vue +38 -153
  47. package/src/kisscomps/components/SchemeConfig/SchemeConfig.vue +0 -16
  48. package/src/kisscomps/components/StageStatus/StageStatus.vue +2 -6
  49. package/src/kisscomps/components/patternList/patternList.vue +0 -5
  50. package/src/kisscomps/index.js +0 -2
  51. package/src/router/index.js +2 -2
  52. package/static/styles/channelizatioon.scss +40 -2
  53. package/static/styles/schemeconfig.scss +0 -52
  54. package/package/kisscomps/components/SchemeConfig/priorityControl/index.vue +0 -190
  55. package/package/kisscomps/components/SchemeConfig/priorityControl/utils.js +0 -163
  56. package/src/kisscomps/components/DrawChannelization/drawsvg/phaseAssociatedComponent.check.vue +0 -191
  57. package/src/kisscomps/components/DrawChannelization/drawsvg/phaseAssociatedComponent.syncOper.vue +0 -331
  58. package/src/kisscomps/components/SchemeConfig/priorityControl/index.vue +0 -190
  59. package/src/kisscomps/components/SchemeConfig/priorityControl/utils.js +0 -163
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openatc-components",
3
- "version": "0.0.99",
3
+ "version": "0.0.100",
4
4
  "description": "A Vue.js project",
5
5
  "author": "openatc developer",
6
6
  "private": false,
@@ -21,25 +21,24 @@
21
21
  "npm2yuanqu": "npm config set registry http://nexus.ctsp.kedacom.com/content/groups/npm-host-yuanqu/"
22
22
  },
23
23
  "dependencies": {
24
- "@minogin/vue-drag-resize-rotate": "^1.0.5",
25
- "@openatc/edgebase-front": "^2.4.0",
26
- "animate.css": "^3.7.2",
27
- "axios": "0.21.1",
28
- "echarts": "^4.9.0",
29
- "element-ui": "^2.7.2",
30
24
  "flatpickr": "^4.5.1",
31
25
  "jquery": "^3.3.1",
32
- "js-cookie": "2.2.0",
33
- "localStorage": "^1.0.4",
34
- "moment": "^2.24.0",
35
26
  "pend": "^1.2.0",
36
- "scss-loader": "0.0.1",
37
27
  "v-tooltip": "^2.0.0-rc.33",
38
28
  "vue": "^2.5.2",
39
- "vue-i18n": "^8.7.0",
40
29
  "vue-router": "^3.0.1",
30
+ "element-ui": "^2.7.2",
31
+ "moment": "^2.24.0",
32
+ "axios": "0.21.1",
33
+ "js-cookie": "2.2.0",
34
+ "localStorage": "^1.0.4",
35
+ "vue-i18n": "^8.7.0",
36
+ "vuex": "3.0.1",
37
+ "scss-loader": "0.0.1",
41
38
  "vuedraggable": "^2.16.0",
42
- "vuex": "3.0.1"
39
+ "animate.css": "^3.7.2",
40
+ "echarts": "^4.9.0",
41
+ "@minogin/vue-drag-resize-rotate": "^1.0.5"
43
42
  },
44
43
  "devDependencies": {
45
44
  "autoprefixer": "^7.1.2",
@@ -129,7 +129,6 @@ const en = {
129
129
  'phaseclose': 'Close Phase',
130
130
  'phaselocking': 'Priority Control',
131
131
  'tentativeplan': 'Tentative Plan',
132
- 'prioritycontrol': 'Priority Control',
133
132
  'implement': 'Execute',
134
133
  'comfirm': 'Comfirm',
135
134
  'ipaddress': 'IP',
@@ -207,34 +206,7 @@ const en = {
207
206
  'modelList22': 'Priority Control',
208
207
  'modelList23': 'Close Phase',
209
208
  'modelList100': 'Tentative Plan',
210
- 'modelList24': 'Priority Control',
211
- 'priorityType': 'Priority Type',
212
- 'priorityPhase': 'Priority Phase',
213
- 'typeOption0': 'Regular Priority',
214
- 'typeOption1': 'Urgent Priority',
215
- 'es': 'East-Straight',
216
- 'el': 'East-Left',
217
- 'er': 'East-Right',
218
- 'eb': 'East-Back',
219
- 'ws': 'West-Straight',
220
- 'wl': 'West-Left',
221
- 'wr': 'West-Right',
222
- 'wb': 'West-Back',
223
- 'ns': 'North-Straight',
224
- 'nl': 'North-Left',
225
- 'nr': 'North-Right',
226
- 'nb': 'North-Back',
227
- 'ss': 'South-Straight',
228
- 'sl': 'South-Left',
229
- 'sr': 'South-Right',
230
- 'sb': 'South-Back',
231
- 'level': 'Level',
232
- 'levelOption': 'LevelOption',
233
- 'levelOption1': '1',
234
- 'levelOption2': '2',
235
- 'levelOption3': '3',
236
- 'levelOption4': '4',
237
- 'levelOption5': '5',
209
+ 'modelList24': 'Emergency Control',
238
210
  'modelList99': 'Device Mantenance',
239
211
  'tips': 'Tips',
240
212
  'exitmanul': 'It is necessary to restore self-control before exiting. Do you want to exit?',
@@ -1184,6 +1156,7 @@ const en = {
1184
1156
  'xpedestrian': 'X Pedestrian',
1185
1157
  'sectionpedestrian': 'Section Pedestrian',
1186
1158
  'delete': 'Delete',
1159
+ 'clone': 'Clone',
1187
1160
  'drawtips': 'Click add on the intersection map after selection',
1188
1161
  'canclesetting': 'Cancel the channelization setting of the current intersection?',
1189
1162
  'phaseassociated': 'Phase Associated',
@@ -1197,8 +1170,8 @@ const en = {
1197
1170
  'pedestriandetector': 'Pedestrian Detector',
1198
1171
  'detectorassociated': 'Detector Associated',
1199
1172
  'detectorthreshold': 'Detector Threshold',
1200
- 'occupancythreshold': 'Occupancy threshold',
1201
- 'saturationthreshold': 'Flow Saturation threshold',
1173
+ 'occupancythreshold': 'Greenlight Utilization Threshold',
1174
+ 'saturationthreshold': 'Flow Saturation Threshold',
1202
1175
  'checkthreshold': 'The threshold value cannot be blank. Please fill in a positive integer within the range of 0-100!',
1203
1176
  'pedestriancrossing': 'Pedestrian crossing',
1204
1177
  'pedestriansecondarycrossing': 'Pedestrian secondary crossing',
@@ -1206,7 +1179,9 @@ const en = {
1206
1179
  'sectionpedestriancrossing': 'Section pedestrian crossing',
1207
1180
  'flipdisplay': 'Flip display',
1208
1181
  'vehiclelane': 'Vehicle lane',
1209
- 'sidewalk': 'Sidewalk'
1182
+ 'sidewalk': 'Sidewalk',
1183
+ 'angle': 'Angle',
1184
+ 'basicinfo': 'Basic information'
1210
1185
  }
1211
1186
  }
1212
1187
  }
@@ -129,34 +129,6 @@ const zh = {
129
129
  'phaseclose': '相位关断',
130
130
  'phaselocking': '相位锁定',
131
131
  'tentativeplan': '临时方案',
132
- 'prioritycontrol': '优先控制',
133
- 'priorityType': '优先类型',
134
- 'priorityPhase': '优先相位',
135
- 'typeOption0': '常规优先',
136
- 'typeOption1': '紧急优先',
137
- 'es': '东直行',
138
- 'el': '东左转',
139
- 'er': '东右转',
140
- 'eb': '东掉头',
141
- 'ws': '西直行',
142
- 'wl': '西左转',
143
- 'wr': '西右转',
144
- 'wb': '西掉头',
145
- 'ns': '北直行',
146
- 'nl': '北左转',
147
- 'nr': '北右转',
148
- 'nb': '北掉头',
149
- 'ss': '南直行',
150
- 'sl': '南左转',
151
- 'sr': '南右转',
152
- 'sb': '南掉头',
153
- 'level': '优先级',
154
- 'levelOption': 'levelOption',
155
- 'levelOption1': '1',
156
- 'levelOption2': '2',
157
- 'levelOption3': '3',
158
- 'levelOption4': '4',
159
- 'levelOption5': '5',
160
132
  'implement': '执行',
161
133
  'comfirm': '确定',
162
134
  'ipaddress': 'IP地址',
@@ -234,7 +206,7 @@ const zh = {
234
206
  'modelList22': '相位锁定',
235
207
  'modelList23': '相位关断',
236
208
  'modelList100': '临时方案',
237
- 'modelList24': '优先控制',
209
+ 'modelList24': '紧急控制',
238
210
  'modelList99': '设备维护',
239
211
  'tips': '提示',
240
212
  'exitmanul': '退出前需要先恢复自主控制, 是否退出?',
@@ -1183,6 +1155,7 @@ const zh = {
1183
1155
  'xpedestrian': '斜向行人',
1184
1156
  'sectionpedestrian': '路段行人',
1185
1157
  'delete': '删除',
1158
+ 'clone': '克隆',
1186
1159
  'drawtips': '选择后在路口图上点击添加',
1187
1160
  'canclesetting': '是否取消当前路口渠化设置?',
1188
1161
  'phaseassociated': '相位关联',
@@ -1196,7 +1169,7 @@ const zh = {
1196
1169
  'pedestriandetector': '行人检测器',
1197
1170
  'detectorassociated': '检测器关联',
1198
1171
  'detectorthreshold': '检测器阈值',
1199
- 'occupancythreshold': '占有率阈值',
1172
+ 'occupancythreshold': '绿灯利用率阈值',
1200
1173
  'saturationthreshold': '流量饱和度阈值',
1201
1174
  'checkthreshold': '阈值不可为空,请填0-100范围内的正整数!',
1202
1175
  'pedestriancrossing': '行人过街',
@@ -1205,7 +1178,9 @@ const zh = {
1205
1178
  'sectionpedestriancrossing': '路段行人过街',
1206
1179
  'flipdisplay': '翻转显示',
1207
1180
  'vehiclelane': '车道',
1208
- 'sidewalk': '人行道'
1181
+ 'sidewalk': '人行道',
1182
+ 'angle': '旋转角度',
1183
+ 'basicinfo': '基础信息'
1209
1184
  }
1210
1185
  }
1211
1186
  }
@@ -8,7 +8,6 @@
8
8
  :patternStatusList="patternStatusList">
9
9
  </StageStatus>
10
10
  <PatternStatus
11
- :showBarrier="showBarrier"
12
11
  :localPatternList="localPatternList"
13
12
  :contrloType="contrloType"
14
13
  :stagesChange="stagesChange"
@@ -18,7 +17,7 @@
18
17
  :phaseList="phaseList"
19
18
  :cycle="cycle"
20
19
  :syncTime="syncTime"
21
- :style="{'margin-top':(cycle || !showBarrier)? '25px':'0'}"
20
+ :style="{'margin-top':cycle ? '25px':'0'}"
22
21
  :patternStatusList="patternStatusList"
23
22
  :patternId="patternId"
24
23
  :cycles="cycles">
@@ -53,10 +52,6 @@ export default {
53
52
  stagesChange: {
54
53
  type: Array
55
54
  },
56
- showBarrier: {
57
- type: Boolean,
58
- default: false
59
- },
60
55
  phaseList: {
61
56
  type: Array
62
57
  },
@@ -128,6 +128,11 @@ export default {
128
128
  },
129
129
  CrossMapVisible: true, // 控制底图显示隐藏
130
130
  CrossMapData: {
131
+ x: 400,
132
+ y: 100,
133
+ w: 800,
134
+ h: 200,
135
+ angle: 0,
131
136
  svgstr: '',
132
137
  imgfilesrc: ''
133
138
  }, // 管理底图数据
@@ -297,19 +302,6 @@ export default {
297
302
  }
298
303
  if (key === 'crossMap') {
299
304
  this.CrossMapData = JSON.parse(JSON.stringify(value))
300
- if (value.type === 'vectorgraph') {
301
- // svg底图,只加载底图870*650区域范围内的元素
302
- let { svgstr, ...allitem } = value
303
- this.allitem = allitem
304
- } else {
305
- this.allitem = {
306
- x: 435,
307
- y: 325,
308
- w: 870,
309
- h: 650,
310
- angle: 0
311
- }
312
- }
313
305
  }
314
306
  }
315
307
  this.isSeletable = false
@@ -328,6 +320,11 @@ export default {
328
320
  this.Pedwalk = []
329
321
  this.Detector = []
330
322
  this.CrossMapData = {
323
+ x: 400,
324
+ y: 100,
325
+ w: 800,
326
+ h: 200,
327
+ angle: 0,
331
328
  svgstr: '',
332
329
  imgfilesrc: ''
333
330
  }
@@ -0,0 +1,113 @@
1
+ /**
2
+ * Copyright (c) 2020 kedacom
3
+ * OpenATC is licensed under Mulan PSL v2.
4
+ * You can use this software according to the terms and conditions of the Mulan PSL v2.
5
+ * You may obtain a copy of Mulan PSL v2 at:
6
+ * http://license.coscl.org.cn/MulanPSL2
7
+ * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
8
+ * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
9
+ * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
10
+ * See the Mulan PSL v2 for more details.
11
+ **/
12
+ <template>
13
+ <div class="basic-coodinfo-component">
14
+ <el-form
15
+ :inline="true"
16
+ :model="basicCoodInfo"
17
+ label-position="left">
18
+ <el-form-item
19
+ label="X:"
20
+ prop="intersection">
21
+ <el-input-number :min="0" :controls="false"
22
+ ref="refNumber-x"
23
+ v-model="basicCoodInfo.x"
24
+ @input.native="eventChange('x')" />
25
+ </el-form-item>
26
+ <el-form-item
27
+ label="Y:"
28
+ prop="count">
29
+ <el-input-number :min="0" :controls="false"
30
+ ref="refNumber-y"
31
+ v-model="basicCoodInfo.y"
32
+ @input.native="eventChange('y')" />
33
+ </el-form-item>
34
+ <el-form-item
35
+ v-if="showAngle"
36
+ :label="$t('openatccomponents.channelizationmap.angle') + ':'"
37
+ prop="count">
38
+ <el-input-number :min="0" :max="360" :controls="false"
39
+ ref="refNumber-angle"
40
+ v-model="basicCoodInfo.angle"
41
+ @input.native="eventChange('angle')" />
42
+ </el-form-item>
43
+ </el-form>
44
+ </div>
45
+ </template>
46
+ <script>
47
+ export default {
48
+ name: 'basic-coodinfo-component',
49
+ components: {
50
+ },
51
+ data () {
52
+ return {
53
+ showAngle: true,
54
+ basicCoodInfo: {
55
+ x: 0,
56
+ y: 0,
57
+ angle: 0
58
+ }
59
+ }
60
+ },
61
+ props: {
62
+ drawingObjInfo: {
63
+ type: Object
64
+ }
65
+ },
66
+ computed: {
67
+ },
68
+ watch: {
69
+ drawingObjInfo: {
70
+ handler: function (obj) {
71
+ this.basicCoodInfo = {
72
+ x: obj.x,
73
+ y: obj.y,
74
+ angle: obj.angle
75
+ }
76
+ this.isShowAngleSetting()
77
+ },
78
+ deep: true
79
+ }
80
+ },
81
+ methods: {
82
+ eventChange (field) {
83
+ const key = this.$refs[`refNumber-${field}`].displayValue
84
+ this.basicCoodInfo[field] = Number(key)
85
+ this.$emit('handleChangeBasicCoord', this.basicCoodInfo)
86
+ },
87
+ isShowAngleSetting () {
88
+ this.showAngle = true
89
+ if (this.drawingObjInfo.icontype === 'countdown') {
90
+ this.showAngle = false
91
+ }
92
+ if (this.drawingObjInfo.icontype === 'detector' && this.drawingObjInfo.detailtype === 'detectorChart') {
93
+ this.showAngle = false
94
+ }
95
+ }
96
+ },
97
+ mounted () {
98
+ if (this.drawingObjInfo) {
99
+ this.icontype = this.drawingObjInfo.icontype
100
+ this.basicCoodInfo = {
101
+ x: this.drawingObjInfo.x,
102
+ y: this.drawingObjInfo.y,
103
+ angle: this.drawingObjInfo.angle
104
+ }
105
+ this.isShowAngleSetting()
106
+ }
107
+ },
108
+ destroyed () {
109
+ }
110
+ }
111
+ </script>
112
+ <style lang="scss">
113
+ </style>
@@ -30,9 +30,11 @@
30
30
  v-if="CrossMapVisible"
31
31
  :UsageMode="UsageMode"
32
32
  :CrossMapData="CrossMapData"
33
- :isSeletable="isSeletable"
33
+ :isSeletable="!isLockedCrossMap"
34
34
  :pointchange="pointchange"
35
+ :chooseIndex="curChooseIconIndex"
35
36
  @changeCrossMap="changeCrossMap"
37
+ @handleSelectIcon="handleSelectIcon"
36
38
  />
37
39
  <!-- 机动车图标 -->
38
40
  <div v-if="resetflag">
@@ -47,18 +49,6 @@
47
49
  @handleSelectIcon="handleSelectIcon"
48
50
  />
49
51
  </div>
50
-
51
- <!-- 非机动车图标 -->
52
- <!-- <BicyclelanesIconSvg
53
- :UsageMode="UsageMode"
54
- v-for="bicycleitem in Bicyclelanes"
55
- :key="bicycleitem.index"
56
- :chooseIndex="curChooseIconIndex"
57
- :Data="bicycleitem"
58
- :isSeletable="isSeletable"
59
- @changeBicyclelaneItem="changeBicyclelaneItem"
60
- @handleSelectIcon="handleSelectIcon"
61
- />-->
62
52
  <!-- 文字图标 -->
63
53
  <!-- <EditableText
64
54
  :UsageMode="UsageMode"
@@ -105,15 +95,16 @@
105
95
  @changeDetectorItem="changeDetectorItem"
106
96
  @handleSelectIcon="handleSelectIcon"
107
97
  />
108
- <DetectorChart
98
+ <!-- <DetectorChart
109
99
  :UsageMode="UsageMode"
110
100
  v-for="detchartitem in DetectorChart"
111
101
  :key="'detectorchart-' + detchartitem.index"
112
102
  :chooseIndex="curChooseIconIndex"
113
103
  :DetectorChartData="detchartitem"
104
+ :Detector="Detector"
114
105
  :isSeletable="isSeletable"
115
106
  @changeDetectorChartItem="changeDetectorChartItem"
116
- @handleSelectIcon="handleSelectIcon" />
107
+ @handleSelectIcon="handleSelectIcon" /> -->
117
108
  </drr>
118
109
  </div>
119
110
  </template>
@@ -133,7 +124,6 @@ export default {
133
124
  CrossMap,
134
125
  EditableText,
135
126
  MotorwayIconSvg,
136
- // BicyclelanesIconSvg,
137
127
  CountdownIcon,
138
128
  PedroadIconSvg,
139
129
  DetectorIconSvg,
@@ -192,6 +182,9 @@ export default {
192
182
  },
193
183
  CurChooseIcon: {
194
184
  type: Object
185
+ },
186
+ isLockedCrossMap: { // 是否锁定底图(是否允许编辑底图位置,角度等)
187
+ type: Boolean
195
188
  }
196
189
  },
197
190
  data () {
@@ -206,8 +199,8 @@ export default {
206
199
  changeMotorwayItem (MotorwayItem, fields) {
207
200
  this.$emit('changeMotorwayItem', MotorwayItem, fields)
208
201
  },
209
- handleSelectIcon (iconobj) {
210
- this.$emit('handleSelectIcon', iconobj)
202
+ handleSelectIcon (iconobj, isCrossMap) {
203
+ this.$emit('handleSelectIcon', iconobj, isCrossMap)
211
204
  },
212
205
  changeText (textobj, fields) {
213
206
  this.$emit('changeText', textobj, fields)
@@ -12,31 +12,30 @@
12
12
  <template>
13
13
  <!-- 自定义底图 -->
14
14
  <div class="cross-map-part" ref="crossmap">
15
- <div v-if="mapreset && CrossMapData.type === 'vectorgraph'">
16
- <!-- 底图可缩放 -->
17
- <!-- <drr
18
- id="crossmapdrr"
19
- :selectable="isSeletable"
20
- :x="crossmapitem.x"
21
- :y="crossmapitem.y"
22
- :w="crossmapitem.w"
23
- :h="crossmapitem.h"
24
- :angle="crossmapitem.angle"
25
- :aspectRatio="true"
26
- @dragstop="mapDragStop(crossmapitem, ...arguments)"
27
- @resizestop="mapResizeStop(crossmapitem, ...arguments)"
28
- @rotatestop="mapRotateStop(crossmapitem, ...arguments)"
29
- >
30
- <div class="cross-map" v-html="CrossMapData.svgstr"></div>
31
- </drr> -->
15
+ <!-- 底图可缩放 -->
16
+ <drr
17
+ id="crossmapdrr"
18
+ :x="crossmapitem.x"
19
+ :y="crossmapitem.y"
20
+ :w="crossmapitem.w"
21
+ :h="crossmapitem.h"
22
+ :angle="crossmapitem.angle"
23
+ :selected="chooseIndex === CrossMapData.index"
24
+ :selectable="isSeletable"
25
+ :aspectRatio="true"
26
+ @select="handleSelectIcon(crossmapitem)"
27
+ @dragstop="mapDragStop(crossmapitem, ...arguments)"
28
+ @resizestop="mapResizeStop(crossmapitem, ...arguments)"
29
+ @rotatestop="mapRotateStop(crossmapitem, ...arguments)"
30
+ >
31
+ <div v-if="mapreset && CrossMapData.type === 'vectorgraph'">
32
+ <div class="cross-map" :style="{'width': crossmapitem.w + 'px', 'height': crossmapitem.h + 'px'}" v-html="CrossMapData.svgstr"></div>
33
+ </div>
32
34
 
33
- <!-- 底图取消操作 -->
34
- <div class="cross-map" :style="{'width': crossmapitem.w + 'px', 'height': crossmapitem.h + 'px'}" v-html="CrossMapData.svgstr"></div>
35
- </div>
36
-
37
- <div v-if="mapreset && CrossMapData.type === 'picture'" class="cross-map">
38
- <img height="100%" :src="CrossMapData.imgfilesrc">
39
- </div>
35
+ <div v-if="mapreset && CrossMapData.type === 'picture'" class="cross-map" >
36
+ <img id="pngMap" :src="CrossMapData.imgfilesrc" :style="{'width': crossmapitem.w + 'px', 'height': crossmapitem.h + 'px'}">
37
+ </div>
38
+ </drr>
40
39
  </div>
41
40
  </template>
42
41
 
@@ -55,6 +54,9 @@ export default {
55
54
  isSeletable: {
56
55
  type: Boolean
57
56
  },
57
+ chooseIndex: {
58
+ type: Number
59
+ },
58
60
  pointchange: {
59
61
  type: Boolean
60
62
  }
@@ -62,26 +64,17 @@ export default {
62
64
  watch: {
63
65
  CrossMapData: {
64
66
  handler: function (val) {
65
- this.crossmapitem = {
66
- x: 0,
67
- y: 0,
68
- w: 0,
69
- h: 0,
70
- angle: 0
71
- }
67
+ this.crossmapitem.x = val.x
68
+ this.crossmapitem.y = val.y
69
+ this.crossmapitem.w = val.w
70
+ this.crossmapitem.h = val.h
71
+ this.crossmapitem.angle = val.angle
72
72
  if (val.type === 'vectorgraph') {
73
73
  if (val.svgstr === '') {
74
74
  this.mapreset = false
75
75
  return
76
76
  }
77
77
  this.mapreset = true
78
- this.crossmapitem = {
79
- x: val.x,
80
- y: val.y,
81
- w: val.w,
82
- h: val.h,
83
- angle: val.angle
84
- }
85
78
  }
86
79
  if (val.type === 'picture') {
87
80
  if (val.imgfilesrc === undefined || val.imgfilesrc === '') {
@@ -93,19 +86,19 @@ export default {
93
86
  },
94
87
  deep: true
95
88
  },
96
- crossmapitem: {
97
- handler: function (newval, oldval) {
98
- if ((JSON.stringify(oldval) !== '{}') && !this.isEqual(newval, oldval)) {
99
- // 更改原数据的位置大小数据
100
- let data = {
101
- ...this.CrossMapData,
102
- ...newval
103
- }
104
- let fields = Object.keys(newval)
105
- this.$emit('changeCrossMap', data, fields)
106
- }
107
- }
108
- },
89
+ // crossmapitem: {
90
+ // handler: function (newval, oldval) {
91
+ // if ((JSON.stringify(oldval) !== '{}') && !this.isEqual(newval, oldval)) {
92
+ // // 更改原数据的位置大小数据
93
+ // let data = {
94
+ // ...this.CrossMapData,
95
+ // ...newval
96
+ // }
97
+ // let fields = Object.keys(newval)
98
+ // this.$emit('changeCrossMap', data, fields)
99
+ // }
100
+ // }
101
+ // },
109
102
  pointchange: {
110
103
  handler: function (val) {
111
104
  // 解决光标样式被选区样式覆盖问题
@@ -132,17 +125,32 @@ export default {
132
125
  mapDragStop (origin, final) {
133
126
  // 底图拖动停止
134
127
  this.crossmapitem = JSON.parse(JSON.stringify(final))
128
+ this.handleChangeData()
135
129
  },
136
130
  mapResizeStop (origin, final) {
137
131
  // 底图改变大小停止
132
+ let svgdom = document.querySelector('.cross-map svg')
133
+ if (svgdom) {
134
+ // 解决svg源文件里有宽高属性,此时对svg父容器改变宽高,svg尺寸不会改变的问题
135
+ // 因此要修改svg文件的宽高属性
136
+ if (svgdom.getAttribute('width')) {
137
+ svgdom.setAttribute('width', final.w + 'px')
138
+ }
139
+ if (svgdom.getAttribute('height')) {
140
+ svgdom.setAttribute('height', final.h + 'px')
141
+ }
142
+ }
138
143
  this.resetMapSvg()
139
144
  this.crossmapitem = JSON.parse(JSON.stringify(final))
140
- // this.$refs.crossmap.style.height = final.w + 'px'
141
- // this.$refs.crossmap.style.width = final.h + 'px'
145
+ this.handleChangeData()
142
146
  },
143
147
  mapRotateStop (origin, final) {
144
148
  // 底图旋转停止
145
- this.crossmapitem = JSON.parse(JSON.stringify(final))
149
+ this.crossmapitem = JSON.parse(JSON.stringify(final))// 第四象限的角度是负值(开源组件接口返回),转化为正值便于理解
150
+ if (this.crossmapitem.angle < 0) {
151
+ this.crossmapitem.angle = this.crossmapitem.angle + 360
152
+ }
153
+ this.handleChangeData()
146
154
  },
147
155
  resetMapSvg () {
148
156
  // 重绘底图svg
@@ -166,6 +174,18 @@ export default {
166
174
  }
167
175
  }
168
176
  return true
177
+ },
178
+ handleSelectIcon (iconparams) {
179
+ this.$emit('handleSelectIcon', this.CrossMapData, 'crossmap')
180
+ },
181
+ handleChangeData () {
182
+ let data = {
183
+ ...this.CrossMapData,
184
+ ...this.crossmapitem
185
+ }
186
+ let fields = Object.keys(this.crossmapitem)
187
+ this.$emit('changeCrossMap', data, fields)
188
+ this.handleSelectIcon()
169
189
  }
170
190
  }
171
191
  }
@@ -11,7 +11,7 @@
11
11
  **/
12
12
  <template>
13
13
  <div class="first-import-crossmap">
14
- <ImportDialog ref="importDialog" @loadSvgString="loadSvgString" />
14
+ <ImportDialog ref="importDialog" @loadSvgString="loadSvgString" @loadMapSize="loadMapSize" />
15
15
  <div class="import-btn">
16
16
  <el-button type="primary" @click="clickOpen">{{$t('openatccomponents.channelizationmap.importpicture')}}</el-button>
17
17
  <div class="tip">{{$t('openatccomponents.channelizationmap.importtip')}}</div>
@@ -39,6 +39,9 @@ export default {
39
39
  },
40
40
  loadSvgString (type, imgstr) {
41
41
  this.$emit('loadSvgString', type, imgstr)
42
+ },
43
+ loadMapSize (type, mapsize) {
44
+ this.$emit('loadMapSize', type, mapsize)
42
45
  }
43
46
  },
44
47
  mounted () {}