openatc-components 0.4.61 → 0.4.63

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.
@@ -0,0 +1,188 @@
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="custom-intersection-map">
14
+ <div class="crossDirection-display openatc-intersection-base-map" :class="{
15
+ 'widescreenCrossImg': bodyDomWidth > 1680,
16
+ 'superlargeCrossImg': bodyDomWidth <= 1680 && bodyDomWidth > 1440,
17
+ 'largeCrossImg': bodyDomWidth <= 1440 && bodyDomWidth > 1280,
18
+ 'middleCrossImg2': bodyDomWidth <= 1280 && bodyDomWidth > 960,
19
+ 'smallCrossImg': bodyDomWidth <= 960 && bodyDomWidth > 890,
20
+ 'smallCrossImg2': bodyDomWidth <= 890 && bodyDomWidth > 720,
21
+ 'miniCrossImg': bodyDomWidth <= 720 && bodyDomWidth > 650,
22
+ 'superminiCrossImg': bodyDomWidth <= 650 && bodyDomWidth > 450,
23
+ 'transMiddleCrossImg': bodyDomWidth <= 450 && bodyDomWidth > 350,
24
+ 'transMiddleCrossImg2': bodyDomWidth <= 350 && bodyDomWidth > 300,
25
+ 'transMiddleCrossImg3': bodyDomWidth <= 300 && bodyDomWidth > 260,
26
+ 'transMiniCrossImg': bodyDomWidth <= 260,
27
+ 'changePaddingBottom': graphicMode }">
28
+ <CustomCrossDiagram ref = "crossDiagram" v-if="reset"
29
+ :agentId="agentId"
30
+ :choosedDirection="choosedDirection"
31
+ :choosedPedDirection="choosedPedDirection"
32
+ :clickMode="clickMode"
33
+ :channelType="channelType"
34
+ :isShowMessage ="isShowMessage"
35
+ @handleClickCrossIcon="handleClickCrossIcon" />
36
+ </div>
37
+ </div>
38
+ </template>
39
+
40
+ <script>
41
+ import CustomCrossDiagram from './customCrossDiagram'
42
+ import { setToken } from '../../../utils/auth'
43
+ export default {
44
+ name: 'custom-intersection-base-map',
45
+ components: {
46
+ CustomCrossDiagram
47
+ },
48
+ data () {
49
+ return {
50
+ reset: false,
51
+ bodyDomWidth: 352,
52
+ bodyDomSize: {
53
+ width: 1920,
54
+ height: 1080
55
+ }
56
+ }
57
+ },
58
+ props: {
59
+ agentId: {
60
+ type: String
61
+ },
62
+ graphicMode: {
63
+ type: Boolean,
64
+ default: false
65
+ },
66
+ isShowInterval: {
67
+ type: Boolean,
68
+ default: true
69
+ },
70
+ isShowMessage: {
71
+ type: Boolean,
72
+ default: true
73
+ },
74
+ roadDirection: {
75
+ type: String,
76
+ default: 'right'
77
+ },
78
+ isShowState: {
79
+ type: Boolean,
80
+ devault: false
81
+ },
82
+ isShowMode: {
83
+ type: Boolean,
84
+ default: false
85
+ },
86
+ modeName: {
87
+ type: String,
88
+ default: ''
89
+ },
90
+ controlName: {
91
+ type: String,
92
+ default: ''
93
+ },
94
+ stateName: {
95
+ type: String,
96
+ default: ''
97
+ },
98
+ choosedDirection: {
99
+ type: Array
100
+ },
101
+ choosedPedDirection: {
102
+ type: Array
103
+ },
104
+ clickMode: { // 是否开启点击模式
105
+ type: Boolean,
106
+ default: false
107
+ },
108
+ channelType: {
109
+ type: Boolean,
110
+ default: false
111
+ }
112
+ },
113
+ watch: {
114
+ $route: {
115
+ handler: function (val, oldVal) {
116
+ if (val.query !== undefined && val.query.agentid !== undefined) {
117
+ this.resetCrossDiagram()
118
+ }
119
+ },
120
+ // 深度观察监听
121
+ deep: true
122
+ },
123
+ channelType: {
124
+ handler: function (val, oldVal) {
125
+ if (val) {
126
+ this.reset = true
127
+ }
128
+ }
129
+ },
130
+ agentId: {
131
+ handler: function (val1, val2) {
132
+ if (val1 !== val2 && val2 !== undefined) {
133
+ this.resetCrossDiagram()
134
+ }
135
+ }
136
+ }
137
+ },
138
+ created () {
139
+ if (this.$route.query !== undefined && Object.keys(this.$route.query).length && this.$route.query.agentid !== undefined) {
140
+ this.resetCrossDiagram()
141
+ }
142
+ },
143
+ mounted () {
144
+ this.getParentSize()
145
+ this.reset = true
146
+ },
147
+ updated () {
148
+ },
149
+ methods: {
150
+ resetCrossDiagram () {
151
+ this.reset = false
152
+ this.$nextTick(() => {
153
+ this.reset = true
154
+ })
155
+ },
156
+ getParentSize () {
157
+ // 获取最外层dom尺寸,适配准备
158
+ var _this = this
159
+ this.$nextTick(function () {
160
+ if (this.$el.parentElement === null || this.$el.parentElement === undefined) return
161
+ this.bodyDomSize.width = this.$el.parentElement.clientWidth
162
+ this.bodyDomWidth = this.bodyDomSize.width
163
+ console.log(this.bodyDomWidth)
164
+ window.addEventListener('resize', () => {
165
+ // 定义窗口大小变更通知事件
166
+ if (_this.$el.parentElement === null || _this.$el.parentElement === undefined) return
167
+ _this.bodyDomSize.width = _this.$el.parentElement.clientWidth
168
+ this.bodyDomWidth = this.bodyDomSize.width
169
+ console.log(this.bodyDomWidth)
170
+ console.log('resize this.bodyDomSize.width', _this.bodyDomSize.width)
171
+ }, false)
172
+ })
173
+ },
174
+ setPropsToken (token) {
175
+ // 获取组件外传入的token,便于独立组件调用接口
176
+ if (token && token !== '') {
177
+ setToken(token)
178
+ }
179
+ },
180
+ handleClickCrossIcon (allChoosedDir, curClickedPhase) {
181
+ console.log(allChoosedDir, curClickedPhase)
182
+ this.$emit('handleClickCrossIcon', allChoosedDir, curClickedPhase)
183
+ }
184
+ },
185
+ destroyed () {
186
+ }
187
+ }
188
+ </script>
@@ -0,0 +1,2 @@
1
+ import IntersectionMapDirSelect from './customintersectionmap.vue'
2
+ export default IntersectionMapDirSelect
@@ -34,6 +34,7 @@ import DirectionListConfiguration from './components/DirectionListConfiguration/
34
34
  import IntersectionDirectionSelection from './components/IntersectionDirectionSelection/index.js'
35
35
  import PhaseLegend from './components/PhaseLegend/index.js'
36
36
  import OverviewComponent from './components/OverviewComponent/index.js'
37
+ import IntersectionMapDirSelect from './components/IntersectionMapDirSelect/index.js'
37
38
  import { setToken, setHost, setIsCheckPermission, setUserRoles, setPermissions } from '../utils/auth.js'
38
39
  import componentsGlobalParam from '../store/modules/globalParam'
39
40
 
@@ -77,7 +78,8 @@ const components = {
77
78
  DirectionListConfiguration,
78
79
  IntersectionDirectionSelection,
79
80
  PhaseLegend,
80
- OverviewComponent
81
+ OverviewComponent,
82
+ IntersectionMapDirSelect
81
83
  }
82
84
 
83
85
  const language = {