openatc-components 0.5.70 → 0.5.72
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.
- package/package/kisscomps/components/Channelization/Channelization.vue +588 -585
- package/package/kisscomps/components/DrawChannelization/drawsvg/iconSvg/detectorIconSvg.vue +247 -210
- package/package/kissui.min.js +1 -1
- package/package.json +1 -1
- package/src/kisscomps/components/Channelization/Channelization.vue +588 -585
- package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/detectorIconSvg.vue +247 -210
|
@@ -1,210 +1,247 @@
|
|
|
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 v-if="reset" class="detector-icon">
|
|
14
|
-
<drr
|
|
15
|
-
:style="{'z-index': chooseIndex === DetectorData.index ? 9 : 0}"
|
|
16
|
-
:x="item.x"
|
|
17
|
-
:y="item.y"
|
|
18
|
-
:w="item.w"
|
|
19
|
-
:h="item.h"
|
|
20
|
-
:selected="chooseIndex === DetectorData.index"
|
|
21
|
-
:selectable="isSeletable"
|
|
22
|
-
:angle="item.angle"
|
|
23
|
-
:aspectRatio="true"
|
|
24
|
-
@select="handleSelectIcon(item)"
|
|
25
|
-
@dragstop="boxDragStop(item, ...arguments)"
|
|
26
|
-
@resize="boxResize(...arguments)"
|
|
27
|
-
@resizestop="boxResizeStop(item, ...arguments)"
|
|
28
|
-
@rotatestop="boxRotateStop(item, ...arguments)"
|
|
29
|
-
>
|
|
30
|
-
<div v-if="UsageMode === 'draw'">
|
|
31
|
-
<div v-if="chooseIndex !== DetectorData.index" class="centerText defaultBg" :style="{'width': item.w + 'px', 'height': item.h + 'px'}">
|
|
32
|
-
<div class="detectorIcon"
|
|
33
|
-
:style="{'width': item.w + 'px', 'fontSize': Fontsize + 'px', 'lineHeight': item.h - 4 + 'px'}"
|
|
34
|
-
:class="{'defaultVehicleBorder': DetectorData.detectortype === 1,
|
|
35
|
-
'defaultPedBorder': DetectorData.detectortype === 2 }">{{DetectorData.detectorid}}</div>
|
|
36
|
-
</div>
|
|
37
|
-
<div v-if="chooseIndex === DetectorData.index" class="centerText highlightBg" :style="{'width': item.w + 'px', 'height': item.h + 'px'}">
|
|
38
|
-
<div class="detectorIcon"
|
|
39
|
-
:style="{'width': item.w + 'px', 'fontSize': Fontsize + 'px', 'lineHeight': item.h - 4 + 'px'}"
|
|
40
|
-
:class="{'defaultVehicleBorder': CurChooseIcon.detectortype == 1,
|
|
41
|
-
'defaultPedBorder': CurChooseIcon.detectortype == 2 }">{{CurChooseIcon.detectorid}}</div>
|
|
42
|
-
</div>
|
|
43
|
-
</div>
|
|
44
|
-
|
|
45
|
-
<div v-if="UsageMode === 'show'" class="
|
|
46
|
-
|
|
47
|
-
:style="{'width': item.w + 'px', '
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
//
|
|
78
|
-
//
|
|
79
|
-
// }
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
},
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
},
|
|
112
|
-
|
|
113
|
-
type:
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
},
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
//
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
this.
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
.
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
}
|
|
205
|
-
.
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
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 v-if="reset" class="detector-icon">
|
|
14
|
+
<drr
|
|
15
|
+
:style="{'z-index': chooseIndex === DetectorData.index ? 9 : 0}"
|
|
16
|
+
:x="item.x"
|
|
17
|
+
:y="item.y"
|
|
18
|
+
:w="item.w"
|
|
19
|
+
:h="item.h"
|
|
20
|
+
:selected="chooseIndex === DetectorData.index"
|
|
21
|
+
:selectable="isSeletable"
|
|
22
|
+
:angle="item.angle"
|
|
23
|
+
:aspectRatio="true"
|
|
24
|
+
@select="handleSelectIcon(item)"
|
|
25
|
+
@dragstop="boxDragStop(item, ...arguments)"
|
|
26
|
+
@resize="boxResize(...arguments)"
|
|
27
|
+
@resizestop="boxResizeStop(item, ...arguments)"
|
|
28
|
+
@rotatestop="boxRotateStop(item, ...arguments)"
|
|
29
|
+
>
|
|
30
|
+
<div v-if="UsageMode === 'draw'">
|
|
31
|
+
<div v-if="chooseIndex !== DetectorData.index" class="centerText defaultBg" :style="{'width': item.w + 'px', 'height': item.h + 'px'}">
|
|
32
|
+
<div class="detectorIcon"
|
|
33
|
+
:style="{'width': item.w + 'px', 'fontSize': Fontsize + 'px', 'lineHeight': item.h - 4 + 'px'}"
|
|
34
|
+
:class="{'defaultVehicleBorder': DetectorData.detectortype === 1,
|
|
35
|
+
'defaultPedBorder': DetectorData.detectortype === 2 }">{{DetectorData.detectorid}}</div>
|
|
36
|
+
</div>
|
|
37
|
+
<div v-if="chooseIndex === DetectorData.index" class="centerText highlightBg" :style="{'width': item.w + 'px', 'height': item.h + 'px'}">
|
|
38
|
+
<div class="detectorIcon"
|
|
39
|
+
:style="{'width': item.w + 'px', 'fontSize': Fontsize + 'px', 'lineHeight': item.h - 4 + 'px'}"
|
|
40
|
+
:class="{'defaultVehicleBorder': CurChooseIcon.detectortype == 1,
|
|
41
|
+
'defaultPedBorder': CurChooseIcon.detectortype == 2 }">{{CurChooseIcon.detectorid}}</div>
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
|
|
45
|
+
<div v-if="UsageMode === 'show'" class="detector-container">
|
|
46
|
+
<div class="detector-content">
|
|
47
|
+
<div class="centerText" :style="{'width': item.w + 'px', 'height': item.h + 'px'}">
|
|
48
|
+
<div class="detectorIcon"
|
|
49
|
+
:style="{'width': item.w + 'px', 'fontSize': Fontsize + 'px','lineHeight': item.h - 4 + 'px', 'background': DetectorData.fillcolor}"
|
|
50
|
+
:class="{'defaultVehicleBorder': DetectorData.detectortype == 1,
|
|
51
|
+
'defaultPedBorder': DetectorData.detectortype == 2 }"
|
|
52
|
+
>{{DetectorData.detectorid}}</div>
|
|
53
|
+
</div>
|
|
54
|
+
|
|
55
|
+
<!-- 排队长度显示在检测器右侧 -->
|
|
56
|
+
<div v-if="DetectorData.queue !== undefined"
|
|
57
|
+
class="queue-display">
|
|
58
|
+
{{DetectorData.queue}}
|
|
59
|
+
</div>
|
|
60
|
+
</div>
|
|
61
|
+
</div>
|
|
62
|
+
</drr>
|
|
63
|
+
</div>
|
|
64
|
+
</template>
|
|
65
|
+
<script>
|
|
66
|
+
export default {
|
|
67
|
+
name: 'countdownsvg',
|
|
68
|
+
data () {
|
|
69
|
+
return {
|
|
70
|
+
defaultColor: 'DeepSkyBlue', // 默认状态颜色
|
|
71
|
+
item: {},
|
|
72
|
+
reset: true,
|
|
73
|
+
Fontsize: 16 // 默认字号
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
watch: {
|
|
77
|
+
// item: {
|
|
78
|
+
// handler: function (newval, oldval) {
|
|
79
|
+
// if ((JSON.stringify(oldval) !== '{}')) {
|
|
80
|
+
// // 更改原数据的位置大小数据
|
|
81
|
+
// let data = {
|
|
82
|
+
// ...this.DetectorData,
|
|
83
|
+
// ...newval
|
|
84
|
+
// }
|
|
85
|
+
// let fields = Object.keys(newval)
|
|
86
|
+
// this.$emit('changeDetectorItem', data, fields)
|
|
87
|
+
// }
|
|
88
|
+
// }
|
|
89
|
+
// }
|
|
90
|
+
DetectorData: {
|
|
91
|
+
handler: function (val) {
|
|
92
|
+
if (this.UsageMode === 'draw') {
|
|
93
|
+
this.item.x = val.x
|
|
94
|
+
this.item.y = val.y
|
|
95
|
+
this.item.angle = val.angle
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
deep: true
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// CurChooseIcon: {
|
|
102
|
+
// handler: function (data) {
|
|
103
|
+
// debugger
|
|
104
|
+
// },
|
|
105
|
+
// deep: true
|
|
106
|
+
// }
|
|
107
|
+
},
|
|
108
|
+
props: {
|
|
109
|
+
DetectorData: {
|
|
110
|
+
type: Object
|
|
111
|
+
},
|
|
112
|
+
isSeletable: {
|
|
113
|
+
type: Boolean
|
|
114
|
+
},
|
|
115
|
+
chooseIndex: {
|
|
116
|
+
type: Number
|
|
117
|
+
},
|
|
118
|
+
UsageMode: { // 当前图标模式: 绘制draw 展示show
|
|
119
|
+
type: String,
|
|
120
|
+
default: 'draw'
|
|
121
|
+
},
|
|
122
|
+
CurChooseIcon: {
|
|
123
|
+
type: Object
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
methods: {
|
|
127
|
+
boxDragStop (origin, final) {
|
|
128
|
+
this.item = JSON.parse(JSON.stringify(final))
|
|
129
|
+
this.$emit('handleSelectIcon', this.DetectorData)
|
|
130
|
+
this.handleChangeData()
|
|
131
|
+
},
|
|
132
|
+
boxResize (final) {
|
|
133
|
+
// this.resetSvg()
|
|
134
|
+
this.item = JSON.parse(JSON.stringify(final))
|
|
135
|
+
this.handleChangeData()
|
|
136
|
+
},
|
|
137
|
+
boxResizeStop (origin, final) {
|
|
138
|
+
// this.resetSvg()
|
|
139
|
+
// this.item = JSON.parse(JSON.stringify(final))
|
|
140
|
+
},
|
|
141
|
+
boxRotateStop (origin, final) {
|
|
142
|
+
this.item = JSON.parse(JSON.stringify(final))
|
|
143
|
+
// 第四象限的角度是负值(开源组件接口返回),转化为正值便于理解
|
|
144
|
+
if (this.item.angle < 0) {
|
|
145
|
+
this.item.angle = this.item.angle + 360
|
|
146
|
+
}
|
|
147
|
+
this.handleChangeData()
|
|
148
|
+
},
|
|
149
|
+
resetSvg () {
|
|
150
|
+
this.reset = false
|
|
151
|
+
this.$nextTick(() => {
|
|
152
|
+
this.reset = true
|
|
153
|
+
})
|
|
154
|
+
},
|
|
155
|
+
handleSelectIcon (iconparams) {
|
|
156
|
+
this.$emit('handleSelectIcon', this.DetectorData)
|
|
157
|
+
},
|
|
158
|
+
culculateFontsize () {
|
|
159
|
+
// 根据倒计时图标大小,动态计算内部文字大小
|
|
160
|
+
this.Fontsize = Math.floor(this.DetectorData.w / 140 * 20)
|
|
161
|
+
},
|
|
162
|
+
handleChangeData () {
|
|
163
|
+
let data = {
|
|
164
|
+
...this.DetectorData,
|
|
165
|
+
...this.item
|
|
166
|
+
}
|
|
167
|
+
let fields = Object.keys(this.item)
|
|
168
|
+
this.$emit('changeDetectorItem', data, fields)
|
|
169
|
+
this.handleSelectIcon()
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
created () {
|
|
173
|
+
this.item = {
|
|
174
|
+
x: this.DetectorData.x,
|
|
175
|
+
y: this.DetectorData.y,
|
|
176
|
+
w: this.DetectorData.w,
|
|
177
|
+
h: this.DetectorData.h,
|
|
178
|
+
angle: this.DetectorData.angle
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
</script>
|
|
183
|
+
<style scoped>
|
|
184
|
+
.detector-container {
|
|
185
|
+
position: relative;
|
|
186
|
+
width: 100%;
|
|
187
|
+
height: 100%;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.detector-content {
|
|
191
|
+
display: flex;
|
|
192
|
+
align-items: center;
|
|
193
|
+
width: 100%;
|
|
194
|
+
height: 100%;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.centerText {
|
|
198
|
+
position: relative;
|
|
199
|
+
z-index: 9;
|
|
200
|
+
display: flex;
|
|
201
|
+
align-items: center;
|
|
202
|
+
flex-shrink: 0; /* 防止检测器被压缩 */
|
|
203
|
+
width: auto; /* 不占用额外空间 */
|
|
204
|
+
}
|
|
205
|
+
.detectorIcon {
|
|
206
|
+
font-family: SourceHanSansCN-Regular;
|
|
207
|
+
font-weight: normal;
|
|
208
|
+
font-stretch: normal;
|
|
209
|
+
letter-spacing: 0px;
|
|
210
|
+
color: #fff;
|
|
211
|
+
margin: 0 auto;
|
|
212
|
+
text-align: center;
|
|
213
|
+
height: 100%;
|
|
214
|
+
display: flex;
|
|
215
|
+
align-items: center;
|
|
216
|
+
justify-content: center;
|
|
217
|
+
}
|
|
218
|
+
.defaultBg {
|
|
219
|
+
background-color: transparent;
|
|
220
|
+
}
|
|
221
|
+
.highlightBg {
|
|
222
|
+
background-color: #299BCC;
|
|
223
|
+
}
|
|
224
|
+
.defaultVehicleBorder {
|
|
225
|
+
border: 2px solid #00FF00;
|
|
226
|
+
}
|
|
227
|
+
.defaultPedBorder {
|
|
228
|
+
border: 2px solid #0080FF;
|
|
229
|
+
}
|
|
230
|
+
.centerText .text {
|
|
231
|
+
display: inline-block;
|
|
232
|
+
color: #299BCC;
|
|
233
|
+
margin-top: 20px;
|
|
234
|
+
}
|
|
235
|
+
.queue-display {
|
|
236
|
+
display: flex;
|
|
237
|
+
align-items: center;
|
|
238
|
+
justify-content: center;
|
|
239
|
+
color: #00FF00;
|
|
240
|
+
font-size: 14px;
|
|
241
|
+
font-weight: bold;
|
|
242
|
+
white-space: nowrap;
|
|
243
|
+
margin-left: 4px; /* 增加间距 */
|
|
244
|
+
min-width: 20px; /* 确保数字有足够的显示空间 */
|
|
245
|
+
text-align: center;
|
|
246
|
+
}
|
|
247
|
+
</style>
|