openatc-components 0.1.192 → 0.1.194

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 (23) hide show
  1. package/package/kisscomps/components/DirectionListConfiguration/DirectionListConfiguration.vue +19 -1
  2. package/package/kisscomps/components/DrawChannelization/drawsvg/iconSvg/detectorChart.vue +1 -1
  3. package/package/kisscomps/components/IntersectionDirectionSelection/IntersectionDirectionSelection.vue +1 -1
  4. package/package/kisscomps/components/IntersectionMap/crossDirection/crossDiagram.vue +21 -3
  5. package/package/kisscomps/components/IntersectionMap/crossDirection/phaseIcon/LphaseIconSvg.vue +4 -4
  6. package/package/kisscomps/components/IntersectionMap/crossDirection/phaseIcon/phaseIconSvg.vue +8 -8
  7. package/package/kisscomps/components/IntersectionMap/crossDirection/posJson/phasePos.json +7 -7
  8. package/package/kisscomps/components/IntersectionMap/crossDirection/posJson/phasePos.left.json +4 -4
  9. package/package/kissui.min.js +1 -1
  10. package/package.json +1 -1
  11. package/src/kisscomps/components/DirectionListConfiguration/DirectionListConfiguration.vue +19 -1
  12. package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/detectorChart.vue +1 -1
  13. package/src/kisscomps/components/IntersectionDirectionSelection/IntersectionDirectionSelection.vue +1 -1
  14. package/src/kisscomps/components/IntersectionMap/crossDirection/crossDiagram.vue +21 -3
  15. package/src/kisscomps/components/IntersectionMap/crossDirection/phaseIcon/LphaseIconSvg.vue +4 -4
  16. package/src/kisscomps/components/IntersectionMap/crossDirection/phaseIcon/phaseIconSvg.vue +8 -8
  17. package/src/kisscomps/components/IntersectionMap/crossDirection/posJson/phasePos.json +7 -7
  18. package/src/kisscomps/components/IntersectionMap/crossDirection/posJson/phasePos.left.json +4 -4
  19. package/src/router/index.js +7 -0
  20. package/src/utils/conflct.js +22 -5
  21. package/src/views/intersection.vue +1 -1
  22. package/src/views/intersection2.vue +329 -0
  23. package/static/styles/patternConfig.scss +3 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openatc-components",
3
- "version": "0.1.192",
3
+ "version": "0.1.194",
4
4
  "description": "A Vue.js project",
5
5
  "author": "openatc developer",
6
6
  "private": false,
@@ -247,11 +247,29 @@ export default {
247
247
  this.$message.error(getMessageByCode(data.data.code, this.$i18n.locale))
248
248
  return
249
249
  }
250
- this.channelList = res.data.data.channelList.filter(ele => ele.type !== undefined)
250
+ let channelList = res.data.data.channelList.filter(ele => ele.type !== undefined)
251
+ this.channelList = this.handleRepeatRealdir(channelList)
251
252
  console.log('this.channelList', this.channelList)
252
253
  this.handleChannelDirection()
253
254
  })
254
255
  },
256
+ handleRepeatRealdir (channelList) {
257
+ let map = new Map()
258
+ channelList.forEach(ele => {
259
+ ele.realdir.forEach(dir => {
260
+ if (map.get(dir) === undefined) {
261
+ map.set(dir, ele)
262
+ }
263
+ })
264
+ })
265
+ let arr = Array.from(map)
266
+ let newarr = []
267
+ arr.forEach(ele => {
268
+ newarr.push(ele[1])
269
+ })
270
+ // console.log(newarr)
271
+ return newarr
272
+ },
255
273
  handleChannelDirection () {
256
274
  this.LanePhaseData = []
257
275
  this.sidewalkPhaseData = []
@@ -39,7 +39,7 @@
39
39
  </div>
40
40
  </template>
41
41
  <script>
42
- import echart from 'echarts'
42
+ import * as echart from 'echarts'
43
43
  import { getTheme } from '../../../../../utils/auth.js'
44
44
  export default {
45
45
  name: 'countdownsvg',
@@ -106,7 +106,7 @@ export default {
106
106
  } else {
107
107
  this.isThirdSignal = false
108
108
  }
109
- if (this.thirdSignal !== undefined) {
109
+ if (this.thirdSignal) {
110
110
  this.isThirdSignal = this.thirdSignal
111
111
  }
112
112
  })
@@ -958,11 +958,30 @@ export default {
958
958
  this.$message.error(getMessageByCode(data.data.code, this.$i18n.locale))
959
959
  return
960
960
  }
961
- this.channelList = res.data.data.channelList.filter(ele => ele.type !== undefined)
962
- // console.log('this.channelList', this.channelList)
961
+ let channelList = res.data.data.channelList.filter(ele => ele.type !== undefined)
962
+ this.channelList = this.handleRepeatRealdir(channelList)
963
+ console.log('this.channelList', this.channelList)
963
964
  this.handleChannelDirection()
964
965
  })
965
966
  },
967
+ handleRepeatRealdir (channelList) {
968
+ // 按realdir去掉重复方向的数据
969
+ let map = new Map()
970
+ channelList.forEach(ele => {
971
+ ele.realdir.forEach(dir => {
972
+ if (map.get(dir) === undefined) {
973
+ map.set(dir, ele)
974
+ }
975
+ })
976
+ })
977
+ let arr = Array.from(map)
978
+ let newarr = []
979
+ arr.forEach(ele => {
980
+ newarr.push(ele[1])
981
+ })
982
+ // console.log(newarr)
983
+ return newarr
984
+ },
966
985
  handleChannelDirection () {
967
986
  this.LanePhaseData = []
968
987
  this.sidewalkPhaseData = []
@@ -1057,7 +1076,6 @@ export default {
1057
1076
  }
1058
1077
  }
1059
1078
  this.compLanePhaseData = JSON.parse(JSON.stringify(this.LanePhaseData))
1060
- // console.log(this.compLanePhaseData)
1061
1079
  let clickedDirection = this.compLanePhaseData.filter(ele => ele.clicked && !ele.disabled)
1062
1080
  this.inneChoosedDirection = clickedDirection.map(ele => ele.id)
1063
1081
  this.EmitAllChoosedDirection(curClickedPhase)
@@ -13,8 +13,8 @@
13
13
  <div :id="Data.key" :style="{position: 'absolute', left: Data.left, top: Data.top}">
14
14
  <div :class="Data.id < 9 ? '' : 'hide'">
15
15
  <svg v-if="Data.id === 4 || Data.id === 8" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 18.1 14.5" :width="IconLenghDiaoTou" :height="IconWdithDiaoTou">
16
- <path id="东掉头" :class="Data.name === '东掉头' ? '' : 'invisible'" d="M0,8.8c0,3.1,2.2,5.7,4.9,5.7h13.2v-2.5H4.9c-1.3,0-2.4-1.4-2.4-3.1s1.1-3.1,2.4-3.1h3.6v3.1l7.7-4.4L8.6,0v3.1H4.9C2.2,3.1,0,5.7,0,8.8z" :fill="this.FlashColor ? this.FlashColor : (Data.color ? Data.color : defaultColor)"/>
17
- <path id="西掉头" :class="Data.name === '西掉头' ? '' : 'invisible'" d="M18.1,5.7c0-3.1-2.2-5.7-4.9-5.7H0v2.5h13.3c1.3,0,2.4,1.4,2.4,3.1s-1.1,3.1-2.4,3.1H9.7V5.6L2,10l7.6,4.5v-3.2h3.6C15.9,11.3,18.1,8.8,18.1,5.7z" :fill="this.FlashColor ? this.FlashColor : (Data.color ? Data.color : defaultColor)"/>
16
+ <path id="东掉头" :class="Data.name === '东掉头' ? '' : 'invisible'" d="M4.876,3.054H8.5V0.039L16.07,4.276,8.411,8.513V5.5H4.792C3.53,5.5,2.436,6.883,2.436,8.513s1.094,3.015,2.357,3.015H18.006v2.444H4.876A5.2,5.2,0,0,1-.005,8.513,5.2,5.2,0,0,1,4.876,3.054Z" transform="translate(0 -0.031)" :fill="this.FlashColor ? this.FlashColor : (Data.color ? Data.color : defaultColor)"/>
17
+ <path id="西掉头" :class="Data.name === '西掉头' ? '' : 'invisible'" d="M13.124,10.964H9.5v3.028L1.93,9.736,9.589,5.48V8.508h3.619c1.262,0,2.357-1.391,2.357-3.028S14.47,2.452,13.208,2.452H-0.006V0H13.124c2.693,0,4.881,2.455,4.881,5.483S15.817,10.964,13.124,10.964Z" :fill="this.FlashColor ? this.FlashColor : (Data.color ? Data.color : defaultColor)"/>
18
18
  </svg>
19
19
  <svg v-else version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
20
20
  viewBox="0 0 36 26" style="enable-background:new 0 0 36 26;" xml:space="preserve" :width="IconLengh" :height="IconWdith">
@@ -38,8 +38,8 @@ L3.3,16l9,5.3v-3.8h4.3C19.8,17.5,22.4,14.5,22.4,10.8z" :fill="this.FlashColor ?
38
38
  </div>
39
39
  <div :class="Data.id >= 9 ? '' : 'hide'">
40
40
  <svg v-if="Data.id === 12 || Data.id === 16" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 14.5 18.1" :width="IconWdithDiaoTou" :height="IconLenghDiaoTou">
41
- <path id="南掉头" :class="Data.name === '南掉头' ? '' : 'invisible'" d="M5.7,0C2.5,0,0,2.2,0,4.9l0,13.2h2.5V4.9c0-1.3,1.4-2.4,3.1-2.4s3.1,1.1,3.1,2.4v3.6H5.7l4.4,7.7l4.4-7.7h-3.2V4.9C11.3,2.2,8.8,0,5.7,0z" :fill="this.FlashColor ? this.FlashColor : (Data.color ? Data.color : defaultColor)"/>
42
- <path id="北掉头" :class="Data.name === '北掉头' ? '' : 'invisible'" d="M8.8,18.1c3.1,0,5.7-2.2,5.7-4.9V0l-2.5,0v13.3c0,1.3-1.4,2.4-3.1,2.4s-3.1-1.1-3.1-2.4V9.7h3.1L4.4,2L0,9.6h3.1v3.6C3.1,15.9,5.7,18.1,8.8,18.1z" :fill="this.FlashColor ? this.FlashColor : (Data.color ? Data.color : defaultColor)"/>
41
+ <path id="南掉头" :class="Data.name === '南掉头' ? '' : 'invisible'" d="M10.946,4.876V8.5h3.015L9.724,16.07,5.487,8.411H8.5V4.792c0-1.262-1.385-2.357-3.015-2.357S2.472,3.53,2.472,4.792V18.006H0.028V4.876A5.2,5.2,0,0,1,5.487-.005,5.2,5.2,0,0,1,10.946,4.876Z" transform="translate(-0.031)" :fill="this.FlashColor ? this.FlashColor : (Data.color ? Data.color : defaultColor)"/>
42
+ <path id="北掉头" :class="Data.name === '北掉头' ? '' : 'invisible'" d="M3.036,13.124V9.5H0.008L4.264,1.93,8.52,9.589H5.492v3.619c0,1.262,1.391,2.357,3.028,2.357s3.028-1.094,3.028-2.357V-0.006H14V13.124c0,2.693-2.455,4.881-5.483,4.881S3.036,15.817,3.036,13.124Z" :fill="this.FlashColor ? this.FlashColor : (Data.color ? Data.color : defaultColor)"/>
43
43
  </svg>
44
44
  <svg v-else version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
45
45
  viewBox="0 0 26 36" style="enable-background:new 0 0 26 36;" xml:space="preserve" :width="IconWdith" :height="IconLengh">
@@ -12,9 +12,9 @@
12
12
  <template>
13
13
  <div :id="Data.key" :style="{position: 'absolute', left: Data.left, top: Data.top}">
14
14
  <div :class="Data.id < 9 ? '' : 'hide'">
15
- <svg v-if="Data.id === 4 || Data.id === 8" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18.11 14.47" :width="IconLenghDiaoTou" :height="IconWdithDiaoTou">
16
- <path id="东掉头" :class="Data.name === '东掉头' ? '' : 'invisible'" d="M4.91,11.34H8.55v3.13l7.7-4.4-7.7-4.4V8.8H4.91c-1.27,0-2.37-1.44-2.37-3.13s1.1-3.13,2.37-3.13h13.2V0H4.91C2.2,0,0,2.54,0,5.67S2.2,11.34,4.91,11.34Z" :fill="this.FlashColor ? this.FlashColor : (Data.color ? Data.color : defaultColor)"/>
17
- <path id="西掉头" :class="Data.name === '西掉头' ? '' : 'invisible'" d="M13.2,3.22H9.56V0L2,4.48l7.7,4.4V5.75h3.63c1.27,0,2.37,1.44,2.37,3.13S14.55,12,13.28,12H0v2.53H13.2c2.71,0,4.91-2.53,4.91-5.67S15.91,3.22,13.2,3.22Z" :fill="this.FlashColor ? this.FlashColor : (Data.color ? Data.color : defaultColor)"/>
15
+ <svg v-if="Data.id === 4 || Data.id === 8" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 14" :width="IconLenghDiaoTou" :height="IconWdithDiaoTou">
16
+ <path id="东掉头" :class="Data.name === '东掉头' ? '' : 'invisible'" d="M4.876,10.981H8.5v3.042L16.07,9.748,8.411,5.474V8.515H4.792c-1.262,0-2.357-1.4-2.357-3.042S3.53,2.432,4.792,2.432H18.006V-0.034H4.876c-2.693,0-4.881,2.466-4.881,5.508S2.183,10.981,4.876,10.981Z" :fill="this.FlashColor ? this.FlashColor : (Data.color ? Data.color : defaultColor)"/>
17
+ <path id="西掉头" :class="Data.name === '西掉头' ? '' : 'invisible'" d="M13.124,3.036H9.5V0.008L1.93,4.264,9.589,8.52V5.492h3.619c1.262,0,2.357,1.391,2.357,3.028s-1.094,3.028-2.357,3.028H-0.006V14H13.124c2.693,0,4.881-2.455,4.881-5.483S15.817,3.036,13.124,3.036Z" :fill="this.FlashColor ? this.FlashColor : (Data.color ? Data.color : defaultColor)"/>
18
18
  </svg>
19
19
  <svg v-else xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" viewBox="0 0 36 26" :width="IconLengh" :height="IconWdith">
20
20
  <!-- 东相位 -->
@@ -36,9 +36,9 @@
36
36
  </svg>
37
37
  </div>
38
38
  <div :class="Data.id >= 9 ? '' : 'hide'">
39
- <svg v-if="Data.id === 12 || Data.id === 16" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14.47 18.11" :width="IconWdithDiaoTou" :height="IconLenghDiaoTou">
40
- <path id="南掉头" :class="Data.name === '南掉头' ? '' : 'invisible'" d="M3.22,4.91V8.55H0l4.4,7.7,4.4-7.7H5.67V4.91c0-1.27,1.44-2.37,3.13-2.37s3.13,1.1,3.13,2.37v13.2h2.54V4.91C14.47,2.2,11.93,0,8.8,0S3.22,2.2,3.22,4.91Z" :fill="this.FlashColor ? this.FlashColor : (Data.color ? Data.color : defaultColor)" />
41
- <path id="北掉头" :class="Data.name === '北掉头' ? '' : 'invisible'" d="M11.34,13.2V9.56h3.13L10.07,2l-4.4,7.7H8.8v3.63c0,1.27-1.44,2.37-3.13,2.37s-3.13-1.1-3.13-2.37V0H0V13.2c0,2.71,2.54,4.91,5.67,4.91S11.34,15.91,11.34,13.2Z" :fill="this.FlashColor ? this.FlashColor : (Data.color ? Data.color : defaultColor)" />
39
+ <svg v-if="Data.id === 12 || Data.id === 16" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 18" :width="IconWdithDiaoTou" :height="IconLenghDiaoTou">
40
+ <path id="南掉头" :class="Data.name === '南掉头' ? '' : 'invisible'" d="M3.036,4.876V8.5H0.008L4.264,16.07,8.52,8.411H5.492V4.792c0-1.262,1.391-2.357,3.028-2.357s3.028,1.094,3.028,2.357V18.006H14V4.876C14,2.183,11.548-.005,8.52-0.005S3.036,2.183,3.036,4.876Z" :fill="this.FlashColor ? this.FlashColor : (Data.color ? Data.color : defaultColor)" />
41
+ <path id="北掉头" :class="Data.name === '北掉头' ? '' : 'invisible'" d="M10.981,13.124V9.5h3.042L9.748,1.93,5.474,9.589H8.515v3.619c0,1.262-1.4,2.357-3.042,2.357S2.432,14.47,2.432,13.208V-0.006H-0.034V13.124c0,2.693,2.466,4.881,5.508,4.881S10.981,15.817,10.981,13.124Z" :fill="this.FlashColor ? this.FlashColor : (Data.color ? Data.color : defaultColor)" />
42
42
  </svg>
43
43
  <svg v-else xmlns="http://www.w3.org/2000/svg" x="0px" y="0px"
44
44
  viewBox="0 0 26 36" style="enable-background:new 0 0 26 36;" xml:space="preserve" :width="IconWdith" :height="IconLengh">
@@ -119,11 +119,11 @@ export default {
119
119
  },
120
120
  IconLenghDiaoTou: {
121
121
  type: String,
122
- default: '18.11px'
122
+ default: '18px'
123
123
  },
124
124
  IconWdithDiaoTou: {
125
125
  type: String,
126
- default: '14.47px'
126
+ default: '14px'
127
127
  },
128
128
  Data: {
129
129
  type: Object
@@ -24,8 +24,8 @@
24
24
  "id": 4,
25
25
  "name": "东掉头",
26
26
  "ename": "East-Back",
27
- "x": "601px",
28
- "y": "297.8px"
27
+ "x": "602px",
28
+ "y": "300px"
29
29
  },
30
30
  {
31
31
  "id": 5,
@@ -52,8 +52,8 @@
52
52
  "id": 8,
53
53
  "name": "西掉头",
54
54
  "ename": "West-Back",
55
- "x": "246px",
56
- "y": "330.8px"
55
+ "x": "247px",
56
+ "y": "333px"
57
57
  },
58
58
  {
59
59
  "id": 9,
@@ -80,8 +80,8 @@
80
80
  "id": 12,
81
81
  "name": "北掉头",
82
82
  "ename": "North-Back",
83
- "x": "411px",
84
- "y": "136px"
83
+ "x": "412px",
84
+ "y": "137px"
85
85
  },
86
86
  {
87
87
  "id": 13,
@@ -109,7 +109,7 @@
109
109
  "name": "南掉头",
110
110
  "ename": "South-Back",
111
111
  "x": "444px",
112
- "y": "490px"
112
+ "y": "489px"
113
113
  }
114
114
  ]
115
115
  }
@@ -24,8 +24,8 @@
24
24
  "id": 4,
25
25
  "name": "东掉头",
26
26
  "ename": "East-Back",
27
- "x": "605px",
28
- "y": "331px"
27
+ "x": "604px",
28
+ "y": "334px"
29
29
  },
30
30
  {
31
31
  "id": 5,
@@ -53,7 +53,7 @@
53
53
  "name": "西掉头",
54
54
  "ename": "West-Back",
55
55
  "x": "248px",
56
- "y": "299px"
56
+ "y": "301px"
57
57
  },
58
58
  {
59
59
  "id": 9,
@@ -108,7 +108,7 @@
108
108
  "id": 16,
109
109
  "name": "南掉头",
110
110
  "ename": "South-Back",
111
- "x": "411px",
111
+ "x": "412px",
112
112
  "y": "495px"
113
113
  }
114
114
  ]
@@ -17,6 +17,13 @@ export default new Router({
17
17
  require(['@/views/intersection'], resolve)
18
18
  }
19
19
  },
20
+ {
21
+ path: '/intersection',
22
+ name: 'intersection',
23
+ component: (resolve) => {
24
+ require(['@/views/intersection2'], resolve)
25
+ }
26
+ },
20
27
  {
21
28
  path: '/pattern',
22
29
  name: 'pattern',
@@ -6,7 +6,7 @@ import i18n from '../i18n/index'
6
6
  export async function computedRelation (id) {
7
7
  let uploadData = await UploadTscParam(id)
8
8
  if (!uploadData) return
9
- let result = []
9
+ let results = []
10
10
  let channel = uploadData.channelList
11
11
  // let channel = store.getters.globalParamModel.getParamsByType('channelList')
12
12
  let tableData = channel.map(item => {
@@ -23,7 +23,7 @@ export async function computedRelation (id) {
23
23
  // 处理peddirection
24
24
  itemA.peddirection.forEach(pedDir => {
25
25
  if (pedDir > 0) {
26
- result.push({
26
+ results.push({
27
27
  direction: pedDir,
28
28
  type: 'pedphase',
29
29
  laneConflictList: [],
@@ -35,7 +35,7 @@ export async function computedRelation (id) {
35
35
  // 处理phasedirection
36
36
  itemA.phasedirection.forEach(phaseDir => {
37
37
  if (phaseDir > 0) {
38
- result.push({
38
+ results.push({
39
39
  direction: phaseDir,
40
40
  type: 'phase',
41
41
  conflictchannel: itemB.greenconflict,
@@ -47,7 +47,7 @@ export async function computedRelation (id) {
47
47
  }
48
48
  })
49
49
  })
50
- result.forEach(item => {
50
+ results.forEach(item => {
51
51
  item.conflictchannel.forEach(aaaValue => {
52
52
  channel.forEach(cha => {
53
53
  if (cha.id === aaaValue) {
@@ -61,7 +61,24 @@ export async function computedRelation (id) {
61
61
  })
62
62
  delete item.conflictchannel
63
63
  })
64
- console.log(result, 'result')
64
+ const uniqueDirections = new Set()
65
+ const doChange = results.filter(obj => {
66
+ if (uniqueDirections.has(obj.direction)) {
67
+ return false
68
+ }
69
+ uniqueDirections.add(obj.direction)
70
+ return true
71
+ })
72
+ let result = doChange.map(item => {
73
+ let uniqueLaneConflictList = [...new Set(item.laneConflictList)]
74
+ let uniquePedConflictList = [...new Set(item.pedConflictList)]
75
+ return {
76
+ ...item,
77
+ laneConflictList: uniqueLaneConflictList,
78
+ pedConflictList: uniquePedConflictList
79
+ }
80
+ })
81
+ console.log('result', result)
65
82
  return result
66
83
  }
67
84
  export function getDefaul (data) {
@@ -138,7 +138,7 @@ export default {
138
138
  // agentId: '12007_390',
139
139
  // agentId: '12014',
140
140
  reqUrl: 'http://192.168.13.103:10003/openatc',
141
- Token: 'eyJraWQiOiIxNzExNTg4NzM3MDczIiwidHlwIjoiSldUIiwiYWxnIjoiSFMyNTYifQ.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTcxMTYzMTkzNywiaWF0IjoxNzExNTg4NzM3fQ.gzdE_LOpS5rYTipJhvP9nvf5_Yg6CFr8mvV9_EWOGXg',
141
+ Token: 'eyJraWQiOiIxNzEwNzU4MTU3Njk0IiwidHlwIjoiSldUIiwiYWxnIjoiSFMyNTYifQ.eyJzdWIiOiIxMjM0NTYiLCJleHAiOjE3MTM4ODgwMDAsImlhdCI6MTcxMDY5MTIwMH0.vicLABPjoZEWmHr12-5FXMbjYmEKv-WSTVRROR1eOME',
142
142
  // agentId: '30003-352',
143
143
  // reqUrl: 'https://kints-dev.devdolphin.com/openatc',
144
144
  // Token: 'eyJraWQiOiIxNjUwNTA5MDI2ODk2IiwidHlwIjoiSldUIiwiYWxnIjoiSFMyNTYifQ.eyJzdWIiOiJ4aWFvbWluZyIsImV4cCI6MTczNjkwOTAyNiwiaWF0IjoxNjUwNTA5MDI2fQ.-s4T-uMRmB2zf9yer87USKQXLY1a12Zq5lCOnqjNmfA',
@@ -0,0 +1,329 @@
1
+ <template>
2
+ <div>
3
+ <!-- <h2>静态路口图</h2> -->
4
+ <!-- <intersection-base-map
5
+ ref="intersectionMap"
6
+ :crossStatusData="crossStatusData"
7
+ :agentId="agentId"
8
+ :clickMode="true" /> -->
9
+
10
+ <!-- <button @click="lockPhase" >相位锁定</button><br/>
11
+ <button @click="unlockPhase" >解锁相位</button><br/>
12
+ <button @click="changeControlPattern" >改变控制方案</button><br/>
13
+ <button @click="getPhaseInfo" >获取相位参数信息</button><br/>
14
+ <button @click="getControlInfo" >获取当前方案信息</button>
15
+ <button @click="clearInterVals" >清除定时器</button> -->
16
+ <!-- <el-button type="primary" @click="handleOpenConfigPanel" style="margin: 20px;">打开路口图面板</el-button>
17
+ <el-dialog
18
+ refs="intersectionMapDialog"
19
+ class="abow_dialog"
20
+ :width="dialogWidth"
21
+ :visible.sync="boxVisible"
22
+ :close-on-click-modal="false"
23
+ @close="oncancle"
24
+ append-to-body> -->
25
+ <!-- <intersection-with-interface
26
+ ref="intersection"
27
+ :AgentId="agentId"
28
+ :reqUrl="reqUrl"
29
+ :Token="Token"
30
+ :roadDirection="roadDirection"
31
+ :modeName="modeName"
32
+ :controlName="controlName"
33
+ :isShowMode="isShowMode"
34
+ :isShowInterval="isShowInterval"
35
+ :isShowMessage ="isShowMessage"
36
+ :isShowPatternStatus="isShowPatternStatus"
37
+ :isShowIntersection="isShowIntersection"
38
+ :isShowStages="isShowStages"
39
+ @getTscControl="getTscControl"
40
+ @registerMessage="registerMessage"
41
+ @queryDevice="queryDevice"
42
+ @onPhaseChange="onPhaseChange"
43
+ @onSelectStages="onSelectStages">
44
+ </intersection-with-interface> -->
45
+ <!-- </el-dialog> -->
46
+ <div class="layout-container2">
47
+ <h2 style="color: #fff;">路口图</h2>
48
+ <intersection-with-interface
49
+ ref="intersection"
50
+ :AgentId="agentId"
51
+ :reqUrl="reqUrl"
52
+ :Token="Token"
53
+ :roadDirection="roadDirection"
54
+ :modeName="modeName"
55
+ :controlName="controlName"
56
+ :isShowState="isShowState"
57
+ :isShowMode="isShowMode"
58
+ :isShowInterval="isShowInterval"
59
+ :isShowMessage ="isShowMessage"
60
+ :isShowPatternStatus="isShowPatternStatus"
61
+ :isShowIntersection="isShowIntersection"
62
+ :isShowStages="isShowStages"
63
+ @getTscControl="getTscControl"
64
+ @registerMessage="registerMessage"
65
+ @queryDevice="queryDevice"
66
+ @onPhaseChange="onPhaseChange"
67
+ @onSelectStages="onSelectStages">
68
+ </intersection-with-interface>
69
+ <!-- <Stages :stagesList="stagesList"
70
+ :currentStage="currentStage"
71
+ @onSelectStages="onSelectStages"></Stages> -->
72
+
73
+ <!-- <h2 style="color: #fff;">渠化图</h2>
74
+ <channelization-with-interface
75
+ ref="channelization"
76
+ :AgentId="agentId"
77
+ :reqUrl="reqUrl"
78
+ :Token="Token"
79
+ @getTscControl="getTscControl"
80
+ @onPhaseChange="onPhaseChange"/>
81
+
82
+ <h2 style="color: #fff;">流量统计渠化路口图</h2>
83
+ <channelization-flow-statistic
84
+ :AgentId="agentId"
85
+ :phasesStatisticsList="phasesStatisticsList"
86
+ bcgColor="#009900"
87
+ :customText="customText"
88
+ textFontSize="50"/> -->
89
+
90
+ </div>
91
+ </div>
92
+ </template>
93
+ <script>
94
+ import {
95
+ setToken
96
+ } from '../utils/auth'
97
+ import IntersectionWithInterface from '../kisscomps/components/IntersectionWithInterface'
98
+ import ChannelizationWithInterface from '../kisscomps/components/ChannelizationWithInterface/ChannelizationWithInterface'
99
+ export default {
100
+ name: 'demo',
101
+ data () {
102
+ return {
103
+ roadDirection: 'left',
104
+ // reqUrl: 'http://192.168.13.103:10003/openatc',
105
+ agentId: 'cllzpl',
106
+ // agentId: '13013',
107
+ // agentId: '12007_390',
108
+ // agentId: '12014',
109
+ reqUrl: 'http://192.168.13.103:10003/openatc',
110
+ Token: 'eyJraWQiOiIxNzEwNzU4MTU3Njk0IiwidHlwIjoiSldUIiwiYWxnIjoiSFMyNTYifQ.eyJzdWIiOiIxMjM0NTYiLCJleHAiOjE3MTM4ODgwMDAsImlhdCI6MTcxMDY5MTIwMH0.vicLABPjoZEWmHr12-5FXMbjYmEKv-WSTVRROR1eOME',
111
+ // agentId: '30003-352',
112
+ // reqUrl: 'https://kints-dev.devdolphin.com/openatc',
113
+ // Token: 'eyJraWQiOiIxNjUwNTA5MDI2ODk2IiwidHlwIjoiSldUIiwiYWxnIjoiSFMyNTYifQ.eyJzdWIiOiJ4aWFvbWluZyIsImV4cCI6MTczNjkwOTAyNiwiaWF0IjoxNjUwNTA5MDI2fQ.-s4T-uMRmB2zf9yer87USKQXLY1a12Zq5lCOnqjNmfA',
114
+ boxVisible: false,
115
+ dialogWidth: '80%',
116
+ modeName: '交警遥控',
117
+ controlName: '步进',
118
+ isShowState: true,
119
+ isShowMode: true,
120
+ isShowMessage: true,
121
+ isShowPatternStatus: false,
122
+ isShowIntersection: true,
123
+ isShowInterval: true,
124
+ isShowStages: true,
125
+ customText: 'A',
126
+ phasesStatisticsList: [
127
+ {
128
+ 'phaseno': 1,
129
+ 'time': '2020-08-09 15:44:22',
130
+ 'phasestatistics': {
131
+ 'totalflow': 49,
132
+ 'averageflow': 12,
133
+ 'saturation': 1,
134
+ 'occupyrate': 69,
135
+ 'congestionindex': 'A',
136
+ 'greenusage': 10
137
+ }
138
+ },
139
+ {
140
+ 'phaseno': 2,
141
+ 'time': '2020-08-09 15:44:22',
142
+ 'phasestatistics': {
143
+ 'totalflow': 62,
144
+ 'averageflow': 31,
145
+ 'saturation': 3,
146
+ 'occupyrate': 98,
147
+ 'congestionindex': 'F',
148
+ 'greenusage': 10
149
+ }
150
+ }
151
+ ],
152
+ crossStatusData: {}
153
+ }
154
+ },
155
+ components: {
156
+ IntersectionWithInterface,
157
+ ChannelizationWithInterface
158
+ },
159
+ methods: {
160
+ oncancle () {
161
+ this.boxVisible = false
162
+ },
163
+ handleOpenConfigPanel () {
164
+ this.boxVisible = true
165
+ },
166
+ setDialogWidth () {
167
+ var val = document.body.offsetWidth
168
+ const def = 1200 // 默认宽度
169
+ if (val < def) {
170
+ this.dialogWidth = '80%'
171
+ } else {
172
+ this.dialogWidth = def + 'px'
173
+ }
174
+ },
175
+ async lockPhase (reqData) {
176
+ console.log('lock')
177
+ reqData = {
178
+ 'mode': 0,
179
+ 'control': 4,
180
+ 'terminal': 1,
181
+ 'delay': null,
182
+ 'duration': null,
183
+ 'value': 1
184
+ }
185
+ let res = await this.$refs.intersection.lockPhase(reqData)
186
+ console.log(res)
187
+ console.log(reqData)
188
+ },
189
+ async unlockPhase (reqData) {
190
+ console.log('unlock')
191
+ reqData = {
192
+ 'mode': 0,
193
+ 'control': 0,
194
+ 'terminal': 1,
195
+ 'delay': null,
196
+ 'duration': null,
197
+ 'value': 0
198
+ }
199
+ let res = await this.$refs.intersection.unlockPhase(reqData)
200
+ console.log(res)
201
+ console.log(reqData)
202
+ },
203
+ async changeControlPattern (reqData) {
204
+ console.log('changeControlPattern')
205
+ reqData = {
206
+ 'mode': 0,
207
+ 'control': 1,
208
+ 'terminal': 1,
209
+ 'delay': null,
210
+ 'duration': null,
211
+ 'value': 0
212
+ }
213
+ let res = await this.$refs.intersection.changeControlPattern(reqData)
214
+ console.log(res)
215
+ console.log(reqData)
216
+ },
217
+ async getPhaseInfo () {
218
+ console.log('getPhaseInfo')
219
+ let res = await this.$refs.intersection.getPhaseInfo()
220
+ console.log(res)
221
+ return res
222
+ },
223
+ async getControlInfo () {
224
+ console.log('getControlInfo')
225
+ let res = await this.$refs.intersection.getControlInfo()
226
+ console.log(res)
227
+ return res
228
+ },
229
+ onPhaseChange (res, index) {
230
+ console.log('onPhaseChange:')
231
+ console.log(res, index)
232
+ this.stagesList = res
233
+ // this.currentStage = index
234
+ },
235
+ getTscControl (res) {
236
+ console.log('getTscControl:', res)
237
+ // let control = res.data.data.control
238
+ // let mode = res.data.data.mode
239
+ // console.log("control,mode:",control,mode)
240
+ // this.controlName = control
241
+ // this.modeName = mode
242
+ },
243
+ registerMessage (res) {
244
+ console.log('registerMessage:', res)
245
+ },
246
+ queryDevice (res) {
247
+ console.log('queryDevice:', res)
248
+ },
249
+ clearInterVals () {
250
+ this.$refs.intersection.clearInterVals()
251
+ },
252
+ onSelectStages (res) {
253
+ console.log('onSelectStages')
254
+ console.log(res)
255
+ },
256
+ setPropsToken (token) {
257
+ // 获取组件外传入的token,便于独立组件调用接口
258
+ if (token && token !== '') {
259
+ setToken(token)
260
+ }
261
+ },
262
+ handleClickCrossIcon (allChoosedDir, curClickedPhase) {
263
+ debugger
264
+ console.log('handleClickCrossIcon', allChoosedDir, curClickedPhase)
265
+ }
266
+ },
267
+ created () {
268
+ this.setDialogWidth()
269
+ },
270
+ mounted () {
271
+ // let _this = this
272
+ // setTimeout(function () {
273
+ // alert('Hello')
274
+ // _this.agentId = 'scats1'
275
+ // }, 5 * 1000)
276
+ this.setPropsToken(this.Token)
277
+ window.onresize = () => {
278
+ return (() => {
279
+ this.setDialogWidth()
280
+ })()
281
+ }
282
+ },
283
+ destroyed () {
284
+ }
285
+ }
286
+ </script>
287
+ <style lang='scss'>
288
+ .layout-container {
289
+ width: 800PX;
290
+ }
291
+ .layout-container1 {
292
+ width: 242PX;
293
+ height: 176PX;
294
+ border: 1PX solid green;
295
+ }
296
+ .layout-container2 {
297
+ /* height: 600px; */
298
+ width: 1020px;
299
+ border: 1PX solid yellow;
300
+ position: relative;
301
+ }
302
+ .abow_dialog {
303
+ display: flex;
304
+ justify-content: center;
305
+ align-items: Center;
306
+ overflow: hidden;
307
+ .el-dialog {
308
+ margin: 0 auto !important;
309
+ height: 90%;
310
+ overflow: hidden;
311
+ .el-dialog__body {
312
+ position: absolute;
313
+ left: 0;
314
+ top: 54px;
315
+ bottom: 0;
316
+ right: 0;
317
+ padding: 0;
318
+ z-index: 1;
319
+ overflow-y: auto;
320
+ overflow-x: auto;
321
+ }
322
+ }
323
+ }
324
+ </style>
325
+ <style lang="scss" scoped>
326
+ .text {
327
+ color: #fff;
328
+ }
329
+ </style>