openatc-components 0.0.94 → 0.0.95

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 (117) hide show
  1. package/package/kisscomps/components/Channelization/Channelization.vue +546 -0
  2. package/package/kisscomps/components/Channelization/index.js +2 -0
  3. package/package/kisscomps/components/ChannelizationWithInterface/ChannelizationWithInterface.vue +494 -0
  4. package/package/kisscomps/components/ChannelizationWithInterface/index.js +2 -0
  5. package/package/kisscomps/components/DrawChannelization/drawsvg/channelizationElements.vue +249 -0
  6. package/package/kisscomps/components/DrawChannelization/drawsvg/detectorAssociatedComponent.vue +152 -0
  7. package/package/kisscomps/components/DrawChannelization/drawsvg/drawElement/TextBox.vue +91 -0
  8. package/package/kisscomps/components/DrawChannelization/drawsvg/drawElement/crossMap.vue +176 -0
  9. package/package/kisscomps/components/DrawChannelization/drawsvg/drawElement/editText.vue +108 -0
  10. package/package/kisscomps/components/DrawChannelization/drawsvg/firstImportCrossmap.vue +48 -0
  11. package/package/kisscomps/components/DrawChannelization/drawsvg/iconSvg/countdownSvg.vue +182 -0
  12. package/package/kisscomps/components/DrawChannelization/drawsvg/iconSvg/detectorChart.vue +222 -0
  13. package/package/kisscomps/components/DrawChannelization/drawsvg/iconSvg/detectorIconSvg.vue +191 -0
  14. package/package/kisscomps/components/DrawChannelization/drawsvg/iconSvg/laneIcon.vue +78 -0
  15. package/package/kisscomps/components/DrawChannelization/drawsvg/iconSvg/motorwayIconSvg.vue +433 -0
  16. package/package/kisscomps/components/DrawChannelization/drawsvg/iconSvg/pedroadIconSvg.vue +195 -0
  17. package/package/kisscomps/components/DrawChannelization/drawsvg/importDialog.vue +71 -0
  18. package/package/kisscomps/components/DrawChannelization/drawsvg/index.draw.vue +940 -0
  19. package/package/kisscomps/components/DrawChannelization/drawsvg/index.vue +109 -0
  20. package/package/kisscomps/components/DrawChannelization/drawsvg/laneEditPanel.vue +563 -0
  21. package/package/kisscomps/components/DrawChannelization/drawsvg/overlapAssociatedComponent.vue +157 -0
  22. package/package/kisscomps/components/DrawChannelization/drawsvg/phaseAssociatedComponent.check.vue +191 -0
  23. package/package/kisscomps/components/DrawChannelization/drawsvg/phaseAssociatedComponent.syncOper.vue +331 -0
  24. package/package/kisscomps/components/DrawChannelization/drawsvg/phaseAssociatedComponent.vue +157 -0
  25. package/package/kisscomps/components/DrawChannelization/drawsvg/table.vue +99 -0
  26. package/package/kisscomps/components/DrawChannelization/drawsvg/utils/loadutils.js +43 -0
  27. package/package/kisscomps/components/DrawChannelization/drawsvg/utils/phaseDataModel.js +32 -0
  28. package/package/kisscomps/components/DrawChannelization/drawsvg/utils/phasePos.json +20 -0
  29. package/package/kisscomps/components/DrawChannelization/index.js +2 -0
  30. package/package/kisscomps/components/DrawChannelization/phaseDataMgr.js +278 -0
  31. package/package/kisscomps/components/KanBan/kanban.vue +1 -1
  32. package/package/kisscomps/components/MessageBox/index.vue +96 -0
  33. package/package/kisscomps/components/SchemeConfig/closePhaselControlModal/index.vue +2 -2
  34. package/package/kisscomps/index.js +11 -1
  35. package/package/kissui.min.js +1 -1
  36. package/package.json +4 -2
  37. package/src/api/cross.js +33 -0
  38. package/src/i18n/language/en.js +77 -2
  39. package/src/i18n/language/zh.js +77 -2
  40. package/src/icons/svg/custom-BRTlane.svg +40 -0
  41. package/src/icons/svg/custom-bicyclelane.svg +7 -0
  42. package/src/icons/svg/custom-buslane.svg +40 -0
  43. package/src/icons/svg/custom-detector.svg +12 -0
  44. package/src/icons/svg/custom-east-bottom.svg +32 -0
  45. package/src/icons/svg/custom-east-top.svg +32 -0
  46. package/src/icons/svg/custom-ewped.svg +35 -0
  47. package/src/icons/svg/custom-motorway.svg +7 -0
  48. package/src/icons/svg/custom-nonmotorizedlane.svg +40 -0
  49. package/src/icons/svg/custom-north-left.svg +32 -0
  50. package/src/icons/svg/custom-north-right.svg +32 -0
  51. package/src/icons/svg/custom-pedcrossing.svg +7 -0
  52. package/src/icons/svg/custom-peddetector.svg +17 -0
  53. package/src/icons/svg/custom-pedeastward.svg +9 -0
  54. package/src/icons/svg/custom-pedestrian.svg +7 -0
  55. package/src/icons/svg/custom-pednorthward.svg +9 -0
  56. package/src/icons/svg/custom-pedsouthward.svg +9 -0
  57. package/src/icons/svg/custom-pedwestward.svg +9 -0
  58. package/src/icons/svg/custom-secondcrossing.svg +7 -0
  59. package/src/icons/svg/custom-sectionpedestrian.svg +7 -0
  60. package/src/icons/svg/custom-snped.svg +35 -0
  61. package/src/icons/svg/custom-south-left.svg +32 -0
  62. package/src/icons/svg/custom-south-right.svg +32 -0
  63. package/src/icons/svg/custom-straightahead.svg +7 -0
  64. package/src/icons/svg/custom-tramlane.svg +40 -0
  65. package/src/icons/svg/custom-turnaround.svg +7 -0
  66. package/src/icons/svg/custom-turnleft.svg +7 -0
  67. package/src/icons/svg/custom-turnright.svg +7 -0
  68. package/src/icons/svg/custom-vehiclebranch.svg +40 -0
  69. package/src/icons/svg/custom-vehiclemainroad.svg +41 -0
  70. package/src/icons/svg/custom-west-bottom.svg +32 -0
  71. package/src/icons/svg/custom-west-top.svg +32 -0
  72. package/src/icons/svg/custom-xlped.svg +14 -0
  73. package/src/icons/svg/custom-xpedestrian.svg +7 -0
  74. package/src/icons/svg/custom-xrped.svg +14 -0
  75. package/src/kisscomps/components/Channelization/Channelization.vue +546 -0
  76. package/src/kisscomps/components/Channelization/index.js +2 -0
  77. package/src/kisscomps/components/ChannelizationWithInterface/ChannelizationWithInterface.vue +494 -0
  78. package/src/kisscomps/components/ChannelizationWithInterface/index.js +2 -0
  79. package/src/kisscomps/components/DrawChannelization/drawsvg/channelizationElements.vue +249 -0
  80. package/src/kisscomps/components/DrawChannelization/drawsvg/detectorAssociatedComponent.vue +152 -0
  81. package/src/kisscomps/components/DrawChannelization/drawsvg/drawElement/TextBox.vue +91 -0
  82. package/src/kisscomps/components/DrawChannelization/drawsvg/drawElement/crossMap.vue +176 -0
  83. package/src/kisscomps/components/DrawChannelization/drawsvg/drawElement/editText.vue +108 -0
  84. package/src/kisscomps/components/DrawChannelization/drawsvg/firstImportCrossmap.vue +48 -0
  85. package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/countdownSvg.vue +182 -0
  86. package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/detectorChart.vue +222 -0
  87. package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/detectorIconSvg.vue +191 -0
  88. package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/laneIcon.vue +78 -0
  89. package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/motorwayIconSvg.vue +433 -0
  90. package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/pedroadIconSvg.vue +195 -0
  91. package/src/kisscomps/components/DrawChannelization/drawsvg/importDialog.vue +71 -0
  92. package/src/kisscomps/components/DrawChannelization/drawsvg/index.draw.vue +940 -0
  93. package/src/kisscomps/components/DrawChannelization/drawsvg/index.vue +109 -0
  94. package/src/kisscomps/components/DrawChannelization/drawsvg/laneEditPanel.vue +563 -0
  95. package/src/kisscomps/components/DrawChannelization/drawsvg/overlapAssociatedComponent.vue +157 -0
  96. package/src/kisscomps/components/DrawChannelization/drawsvg/phaseAssociatedComponent.check.vue +191 -0
  97. package/src/kisscomps/components/DrawChannelization/drawsvg/phaseAssociatedComponent.syncOper.vue +331 -0
  98. package/src/kisscomps/components/DrawChannelization/drawsvg/phaseAssociatedComponent.vue +157 -0
  99. package/src/kisscomps/components/DrawChannelization/drawsvg/table.vue +99 -0
  100. package/src/kisscomps/components/DrawChannelization/drawsvg/utils/loadutils.js +43 -0
  101. package/src/kisscomps/components/DrawChannelization/drawsvg/utils/phaseDataModel.js +32 -0
  102. package/src/kisscomps/components/DrawChannelization/drawsvg/utils/phasePos.json +20 -0
  103. package/src/kisscomps/components/DrawChannelization/index.js +2 -0
  104. package/src/kisscomps/components/DrawChannelization/phaseDataMgr.js +278 -0
  105. package/src/kisscomps/components/KanBan/kanban.vue +1 -1
  106. package/src/kisscomps/components/MessageBox/index.vue +96 -0
  107. package/src/kisscomps/components/SchemeConfig/closePhaselControlModal/index.vue +2 -2
  108. package/src/kisscomps/index.js +11 -1
  109. package/src/main.js +3 -0
  110. package/src/router/index.js +7 -0
  111. package/src/store/index.js +2 -2
  112. package/src/store/modules/globalParam.js +56 -16
  113. package/src/views/customchannelization.vue +49 -0
  114. package/src/views/intersection.vue +17 -9
  115. package/static/apiconfig.json +15 -0
  116. package/static/styles/channelizatioon.scss +365 -0
  117. package/static/styles/common.scss +1 -0
@@ -0,0 +1,249 @@
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
+ <!-- 渠化图支持显示的元素类型 -->
14
+ <div class="channelization-elements-components"
15
+ :class="{'show-channelization-elements-components': UsageMode === 'show'}"
16
+ :style="{'height': allitem.h + 'px', 'width': allitem.w + 'px'}">
17
+ <drr
18
+ id="sketchpadArea"
19
+ :resizable="false"
20
+ :x="allitem.x"
21
+ :y="allitem.y"
22
+ :w="allitem.w"
23
+ :h="allitem.h"
24
+ :angle="allitem.angle"
25
+ :selectable="false"
26
+ :aspectRatio="true"
27
+ >
28
+ <!-- 自定义底图 -->
29
+ <CrossMap
30
+ v-if="CrossMapVisible"
31
+ :UsageMode="UsageMode"
32
+ :CrossMapData="CrossMapData"
33
+ :isSeletable="isSeletable"
34
+ :pointchange="pointchange"
35
+ @changeCrossMap="changeCrossMap"
36
+ />
37
+ <!-- 机动车图标 -->
38
+ <div v-if="resetflag">
39
+ <MotorwayIconSvg
40
+ v-for="motorwaysitem in Motorways"
41
+ :key="'motor-' + motorwaysitem.index"
42
+ :UsageMode="UsageMode"
43
+ :chooseIndex="curChooseIconIndex"
44
+ :Data="motorwaysitem"
45
+ :isSeletable="isSeletable"
46
+ @changeMotorwayItem="changeMotorwayItem"
47
+ @handleSelectIcon="handleSelectIcon"
48
+ />
49
+ </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
+ <!-- 文字图标 -->
63
+ <!-- <EditableText
64
+ :UsageMode="UsageMode"
65
+ v-for="textitem in Texts"
66
+ :key="textitem.index"
67
+ :TextData="textitem"
68
+ :isSeletable="isSeletable"
69
+ @changeText="changeText"
70
+ /> -->
71
+ <!-- 倒计时图标 -->
72
+ <CountdownIcon
73
+ :UsageMode="UsageMode"
74
+ v-for="timeitem in Countdown"
75
+ :key="timeitem.index"
76
+ :chooseIndex="curChooseIconIndex"
77
+ :CountdownData="timeitem"
78
+ :isSeletable="isSeletable"
79
+ :CountdownList="CountdownList"
80
+ :isHasPhase="isHasPhase"
81
+ @changeTimeItem="changeTimeItem"
82
+ @handleSelectIcon="handleSelectIcon"
83
+ />
84
+ <!-- 人行横道图标 -->
85
+ <div v-if="resetflag">
86
+ <PedroadIconSvg
87
+ :UsageMode="UsageMode"
88
+ v-for="peditem in Pedwalk"
89
+ :key="'ped-' + peditem.index"
90
+ :chooseIndex="curChooseIconIndex"
91
+ :PedData="peditem"
92
+ :isSeletable="isSeletable"
93
+ @changePedItem="changePedItem"
94
+ @handleSelectIcon="handleSelectIcon"
95
+ />
96
+ </div>
97
+ <DetectorIconSvg
98
+ :UsageMode="UsageMode"
99
+ v-for="detectoritem in Detector"
100
+ :key="'detector-' + detectoritem.index"
101
+ :chooseIndex="curChooseIconIndex"
102
+ :DetectorData="detectoritem"
103
+ :isSeletable="isSeletable"
104
+ :CurChooseIcon="CurChooseIcon"
105
+ @changeDetectorItem="changeDetectorItem"
106
+ @handleSelectIcon="handleSelectIcon"
107
+ />
108
+ <DetectorChart
109
+ :UsageMode="UsageMode"
110
+ v-for="detchartitem in DetectorChart"
111
+ :key="'detectorchart-' + detchartitem.index"
112
+ :chooseIndex="curChooseIconIndex"
113
+ :DetectorChartData="detchartitem"
114
+ :isSeletable="isSeletable"
115
+ @changeDetectorChartItem="changeDetectorChartItem"
116
+ @handleSelectIcon="handleSelectIcon" />
117
+ </drr>
118
+ </div>
119
+ </template>
120
+
121
+ <script>
122
+ import CrossMap from './drawElement/crossMap'
123
+ import EditableText from './drawElement/editText'
124
+ import MotorwayIconSvg from './iconSvg/motorwayIconSvg'
125
+ import CountdownIcon from './iconSvg/countdownSvg'
126
+ import PedroadIconSvg from './iconSvg/pedroadIconSvg'
127
+ import DetectorIconSvg from './iconSvg/detectorIconSvg'
128
+ import DetectorChart from './iconSvg/detectorChart.vue'
129
+
130
+ export default {
131
+ name: 'channelization-elements',
132
+ components: {
133
+ CrossMap,
134
+ EditableText,
135
+ MotorwayIconSvg,
136
+ // BicyclelanesIconSvg,
137
+ CountdownIcon,
138
+ PedroadIconSvg,
139
+ DetectorIconSvg,
140
+ DetectorChart
141
+ },
142
+ props: {
143
+ isSeletable: { // 元素是否可以编辑
144
+ type: Boolean,
145
+ default: true
146
+ },
147
+ allitem: {
148
+ type: Object,
149
+ required: true
150
+ },
151
+ CrossMapVisible: {
152
+ type: Boolean,
153
+ default: true
154
+ },
155
+ CrossMapData: {
156
+ type: Object,
157
+ required: true
158
+ },
159
+ pointchange: {
160
+ type: Boolean,
161
+ default: false
162
+ },
163
+ Motorways: {
164
+ type: Array
165
+ },
166
+ Countdown: {
167
+ type: Array
168
+ },
169
+ CountdownList: {
170
+ type: Array
171
+ },
172
+ Pedwalk: {
173
+ type: Array
174
+ },
175
+ curChooseIconIndex: {
176
+ type: Number,
177
+ default: -1
178
+ },
179
+ UsageMode: {
180
+ type: String,
181
+ default: 'draw'
182
+ },
183
+ isHasPhase: {
184
+ type: Boolean,
185
+ default: true
186
+ },
187
+ Detector: {
188
+ type: Array
189
+ },
190
+ DetectorChart: {
191
+ type: Array
192
+ },
193
+ CurChooseIcon: {
194
+ type: Object
195
+ }
196
+ },
197
+ data () {
198
+ return {
199
+ resetflag: true // 离线或者特殊控制后,控制行人相位、车道相位reset标识,主要是清空绿闪样式
200
+ }
201
+ },
202
+ methods: {
203
+ changeCrossMap (mapdata, fields) {
204
+ this.$emit('changeCrossMap', mapdata, fields)
205
+ },
206
+ changeMotorwayItem (MotorwayItem, fields) {
207
+ this.$emit('changeMotorwayItem', MotorwayItem, fields)
208
+ },
209
+ handleSelectIcon (iconobj) {
210
+ this.$emit('handleSelectIcon', iconobj)
211
+ },
212
+ changeText (textobj, fields) {
213
+ this.$emit('changeText', textobj, fields)
214
+ },
215
+ changeTimeItem (timeItem, fields) {
216
+ this.$emit('changeTimeItem', timeItem, fields)
217
+ },
218
+ changePedItem (PedItem, fields) {
219
+ this.$emit('changePedItem', PedItem, fields)
220
+ },
221
+ changeDetectorItem (detectorItem, fields) {
222
+ this.$emit('changeDetectorItem', detectorItem, fields)
223
+ },
224
+ changeDetectorChartItem (detectorChartItem, fields) {
225
+ this.$emit('changeDetectorChartItem', detectorChartItem, fields)
226
+ },
227
+ resetPhaseStatus () {
228
+ // 车道相位、行人相位恢复默认状态
229
+ this.resetflag = false
230
+ this.$nextTick(() => {
231
+ this.resetflag = true
232
+ })
233
+ }
234
+ },
235
+ created () {},
236
+ mounted () {}
237
+ }
238
+ </script>
239
+ <style lang="scss" scoped>
240
+ .channelization-elements-components {
241
+ position: relative;
242
+ }
243
+ .show-channelization-elements-components {
244
+ left: 50%;
245
+ top: 30px;
246
+ transform: translateX(-50%);
247
+ overflow: hidden;
248
+ }
249
+ </style>
@@ -0,0 +1,152 @@
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="detector-associated-component">
14
+ <div class="detector-box" v-for="(item, index) in preDetList" :key="index">
15
+ <div class="single-detector" @click="selectAssociatedDetector(index, item)" :class="preselectDetector == item.id ? 'single-detector-select' : ''">
16
+ {{item.id}}
17
+ </div>
18
+ </div>
19
+ </div>
20
+ </template>
21
+ <script>
22
+ import { mapState } from 'vuex'
23
+ export default {
24
+ name: 'detector-associated-component',
25
+ data () {
26
+ return {
27
+ preselectDetector: -1,
28
+ id: 1,
29
+ isCanAdd: true,
30
+ preDetList: []
31
+ }
32
+ },
33
+ props: {
34
+ editData: {
35
+ type: Object
36
+ }
37
+ },
38
+ computed: {
39
+ ...mapState({
40
+ detectorList: state => state.globalParam.tscParam.detectorList,
41
+ peddetectorList: state => state.globalParam.tscParam.pedestrainDetectorList,
42
+ roadDirection: state => state.globalParam.roadDirection
43
+ })
44
+ },
45
+ watch: {
46
+ detectorList: {
47
+ handler: function (list) {
48
+ },
49
+ deep: true
50
+ },
51
+ editData: {
52
+ handler: function (editobj) {
53
+ this.loadCurDetectorList(editobj)
54
+ this.initChoosedDetector(editobj)
55
+ },
56
+ deep: true
57
+ }
58
+ },
59
+ methods: {
60
+ initChoosedDetector (editobj) {
61
+ if (editobj.detectorid !== undefined) {
62
+ this.preselectDetector = editobj.detectorid
63
+ } else {
64
+ this.preselectDetector = -1
65
+ }
66
+ },
67
+ selectAssociatedDetector (index, item) {
68
+ // 关联相位
69
+ this.preselectDetector = item.id
70
+ this.$emit('selectAssociatedDetector', this.preselectDetector)
71
+ },
72
+ handleDisassociateDetector (deleteDetectorid) {
73
+ // 删除相位后,解除相位关联
74
+ this.$emit('handleDisassociateDetector', deleteDetectorid)
75
+ },
76
+ loadCurDetectorList (editobj) {
77
+ this.detectortype = editobj.detectortype
78
+ if (editobj.detectortype === 1) {
79
+ // 车辆检测器
80
+ this.preDetList = JSON.parse(JSON.stringify(this.detectorList))
81
+ }
82
+ if (editobj.detectortype === 2) {
83
+ // 行人检测器
84
+ this.preDetList = JSON.parse(JSON.stringify(this.peddetectorList))
85
+ }
86
+ }
87
+ },
88
+ created () {
89
+ },
90
+ mounted () {
91
+ this.loadCurDetectorList(this.editData)
92
+ this.initChoosedDetector(this.editData)
93
+ },
94
+ destroyed () {
95
+ }
96
+ }
97
+ </script>
98
+ <style lang="scss">
99
+ .detector-associated-component {
100
+ width: 100%;
101
+ height: auto;
102
+ overflow: hidden;
103
+ .detector-box {
104
+ float: left;
105
+ margin-top: 10px;
106
+ .single-detector {
107
+ margin-right: 10px;
108
+ text-align: center;
109
+ cursor:pointer;
110
+ width: 35px;
111
+ height: 35px;
112
+ background-color: #edf6ff;
113
+ border-radius: 6px;
114
+ line-height: 35px;
115
+ position: relative;
116
+ }
117
+ .single-detector-select {
118
+ background-color: #a2cfff;
119
+ }
120
+ .single-detector-name {
121
+ width: 70PX;
122
+ margin-top: 3PX;
123
+ font-size: 12PX;
124
+ font-weight: normal;
125
+ font-stretch: normal;
126
+ line-height: 22PX;
127
+ letter-spacing: 0PX;
128
+ color: #606266;
129
+ text-align: center;
130
+ height: 40PX;
131
+ }
132
+ }
133
+
134
+ .add-detector {
135
+ padding-top: 23px;
136
+ }
137
+ .icon-fangda {
138
+ font-size: 24px;
139
+ color: #409EFF;
140
+ }
141
+ .add-disabled {
142
+ color: #bcbec2;
143
+ background-color: #f4f4f5;
144
+ }
145
+ .special-lane {
146
+ display:flex;
147
+ flex-direction:row;
148
+ justify-content:center;
149
+ align-items:center;
150
+ }
151
+ }
152
+ </style>
@@ -0,0 +1,91 @@
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="text" :class="{ 'hasborder': bordervisible, 'noborder': !bordervisible}" @active="onActive()" v-if="!textActive">
14
+ {{text}}
15
+ </div>
16
+ <textarea ref="area" v-model="text" class="textarea" @blur="onBlur" v-else>
17
+ </textarea>
18
+ </template>
19
+
20
+ <script>
21
+ export default {
22
+ data () {
23
+ return {
24
+ text: '',
25
+ textActive: false,
26
+ bordervisible: true
27
+ }
28
+ },
29
+ props: {
30
+ content: {
31
+ type: String
32
+ }
33
+ },
34
+ watch: {
35
+ content: {
36
+ handler: function (val) {
37
+ this.text = val
38
+ if (val === '') {
39
+ this.bordervisible = true
40
+ } else {
41
+ this.bordervisible = false
42
+ }
43
+ }
44
+ }
45
+ },
46
+ mounted () {
47
+ this.text = this.content
48
+ if (this.content === '') {
49
+ this.bordervisible = true
50
+ } else {
51
+ this.bordervisible = false
52
+ }
53
+ this.$on('active', this.onActive)
54
+ },
55
+ methods: {
56
+ onActive () {
57
+ this.textActive = true
58
+ this.$nextTick(() => {
59
+ this.$refs.area.focus()
60
+ })
61
+ },
62
+ onBlur () {
63
+ this.textActive = false
64
+ this.$parent.$emit('content-inactive')
65
+ this.$emit('changeText', this.text)
66
+ }
67
+ }
68
+ }
69
+ </script>
70
+
71
+ <style>
72
+ .text {
73
+ width: 100%;
74
+ height: 100%;
75
+ font-size: 20px; /*默认字体大小*/
76
+ }
77
+
78
+ .hasborder {
79
+ border: 1px solid #ccc;
80
+ }
81
+
82
+ .noborder {
83
+ border: none;
84
+ }
85
+
86
+ .textarea {
87
+ position: absolute;
88
+ width: 100%;
89
+ height: 100%;
90
+ }
91
+ </style>
@@ -0,0 +1,176 @@
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
+ <!-- 自定义底图 -->
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> -->
32
+
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>
40
+ </div>
41
+ </template>
42
+
43
+ <script>
44
+ export default {
45
+ data () {
46
+ return {
47
+ crossmapitem: {},
48
+ mapreset: false
49
+ }
50
+ },
51
+ props: {
52
+ CrossMapData: {
53
+ type: Object
54
+ },
55
+ isSeletable: {
56
+ type: Boolean
57
+ },
58
+ pointchange: {
59
+ type: Boolean
60
+ }
61
+ },
62
+ watch: {
63
+ CrossMapData: {
64
+ handler: function (val) {
65
+ this.crossmapitem = {
66
+ x: 0,
67
+ y: 0,
68
+ w: 0,
69
+ h: 0,
70
+ angle: 0
71
+ }
72
+ if (val.type === 'vectorgraph') {
73
+ if (val.svgstr === '') {
74
+ this.mapreset = false
75
+ return
76
+ }
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
+ }
86
+ if (val.type === 'picture') {
87
+ if (val.imgfilesrc === undefined || val.imgfilesrc === '') {
88
+ this.mapreset = false
89
+ return
90
+ }
91
+ this.mapreset = true
92
+ }
93
+ },
94
+ deep: true
95
+ },
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
+ },
109
+ pointchange: {
110
+ handler: function (val) {
111
+ // 解决光标样式被选区样式覆盖问题
112
+ let dom = document.getElementById('crossmapdrr')
113
+ if (dom === null || dom === undefined) return
114
+ if (val) {
115
+ dom.style.cursor = 'url(resource/pic/icons/magnifier3.cur) 12 12,crosshair'
116
+ return
117
+ }
118
+ dom.style.cursor = 'url(resource/pic/icons/magnifier3.cur) 12 12,default'
119
+ }
120
+ }
121
+ },
122
+ created () {
123
+ this.crossmapitem = {
124
+ x: this.CrossMapData.x,
125
+ y: this.CrossMapData.y,
126
+ w: this.CrossMapData.w,
127
+ h: this.CrossMapData.h,
128
+ angle: this.CrossMapData.angle
129
+ }
130
+ },
131
+ methods: {
132
+ mapDragStop (origin, final) {
133
+ // 底图拖动停止
134
+ this.crossmapitem = JSON.parse(JSON.stringify(final))
135
+ },
136
+ mapResizeStop (origin, final) {
137
+ // 底图改变大小停止
138
+ this.resetMapSvg()
139
+ 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'
142
+ },
143
+ mapRotateStop (origin, final) {
144
+ // 底图旋转停止
145
+ this.crossmapitem = JSON.parse(JSON.stringify(final))
146
+ },
147
+ resetMapSvg () {
148
+ // 重绘底图svg
149
+ this.mapreset = false
150
+ this.$nextTick(() => {
151
+ this.mapreset = true
152
+ })
153
+ },
154
+ isEqual (obj1, obj2) {
155
+ if (!(obj1 instanceof Object) || !(obj2 instanceof Object)) {
156
+ return obj1 === obj2
157
+ }
158
+ if (Object.keys(obj1).length !== Object.keys(obj2).length) {
159
+ return false
160
+ }
161
+ for (var attr in obj1) { // 逐个值进行判断
162
+ if (obj1[attr] instanceof Object && obj2[attr] instanceof Object) {
163
+ return this.isEqual(obj1[attr], obj2[attr])
164
+ } else if (obj1[attr] !== obj2[attr]) {
165
+ return false
166
+ }
167
+ }
168
+ return true
169
+ }
170
+ }
171
+ }
172
+ </script>
173
+
174
+ <style>
175
+
176
+ </style>