openatc-components 0.3.33 → 0.3.35

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.
@@ -21,7 +21,7 @@
21
21
  @change="handleChangePosY" @input.native="eventChange('y')" />
22
22
  </el-form-item>
23
23
  <el-form-item v-if="showAngle" :label="$t('openatccomponents.channelizationmap.angle') + ':'">
24
- <el-input-number :min="0" :max="360" :precision="0" :step="1" :controls="false" ref="refNumber-angle" v-model="basicCoodInfo.angle"
24
+ <el-input-number :min="0" :max="360" :controls="false" ref="refNumber-angle" v-model="basicCoodInfo.angle"
25
25
  @change="handleChangeAngle" @input.native="eventChange('angle')" />
26
26
  </el-form-item>
27
27
  <el-form-item v-if="showKeyId" label="ID:">
@@ -26,8 +26,8 @@
26
26
  :disabled="!isSeletable"
27
27
  @click="clickOpen"
28
28
  >{{$t('openatccomponents.channelizationmap.againimport')}}</el-button>
29
- <i class="lock-map el-icon-unlock" v-if="!isLockedCrossMap" @click="handleLockCrossMap()"></i>
30
- <i class="lock-map el-icon-lock" v-if="isLockedCrossMap" @click="handleLockCrossMap()"></i>
29
+ <i class="lock-map el-icon-unlock" v-if="isLockedCrossMap" @click="handleLockCrossMap()"></i>
30
+ <i class="lock-map el-icon-lock" v-if="!isLockedCrossMap" @click="handleLockCrossMap()"></i>
31
31
  </div>
32
32
 
33
33
  <div class="draw-to-sketchpad">
@@ -20,10 +20,10 @@
20
20
  :model="manualInfo"
21
21
  label-width="90px">
22
22
  <el-form-item
23
- :label="$t('openatccomponents.overview.greenclear')"
24
- prop="intersection">
25
- <el-input-number :min="0" :max="65535" :precision="0" :step="1" :controls="false" v-model.number="manualInfo.tempGreenflash" size="small"></el-input-number>
26
- </el-form-item>
23
+ :label="$t('openatccomponents.overview.duration')"
24
+ prop="count">
25
+ <el-input-number :min="0" :max="65535" :precision="0" :step="1" :controls="false" v-model.number="manualInfo.tempDuration" size="small"></el-input-number>
26
+ </el-form-item>
27
27
 
28
28
  <el-form-item
29
29
  :label="$t('openatccomponents.overview.yellowflash')"
@@ -44,13 +44,11 @@
44
44
  label-position="left"
45
45
  :model="manualInfo"
46
46
  label-width="90px">
47
-
48
- <el-form-item
49
- :label="$t('openatccomponents.overview.duration')"
50
- prop="count">
51
- <el-input-number :min="0" :max="65535" :precision="0" :step="1" :controls="false" v-model.number="manualInfo.tempDuration" size="small"></el-input-number>
52
- </el-form-item>
53
-
47
+ <el-form-item
48
+ :label="$t('openatccomponents.overview.greenclear')"
49
+ prop="intersection">
50
+ <el-input-number :min="0" :max="65535" :precision="0" :step="1" :controls="false" v-model.number="manualInfo.tempGreenflash" size="small"></el-input-number>
51
+ </el-form-item>
54
52
  <el-form-item
55
53
  :label="$t('openatccomponents.overview.allred')"
56
54
  prop="intersection">
@@ -38,7 +38,6 @@
38
38
  </div>
39
39
  <div style="height: 94%;" class="table-container">
40
40
  <PatternTable ref="patterntable"
41
- :devicesData="devicesData"
42
41
  :maxTableHeight="maxTableHeight"
43
42
  :opt="item.devs"
44
43
  :isAllowedExpand="isAllowedExpand"
@@ -56,7 +55,6 @@
56
55
  </el-container>
57
56
  <div v-if="isShowSingle" style="height: 94%;" class="table-container">
58
57
  <PatternTable ref="patterntable"
59
- :devicesData="devicesData"
60
58
  :opt="opt.optPatternList[0].devs"
61
59
  :isAllowedExpand="isAllowedExpand"
62
60
  :maxTableHeight="maxTableHeight"
@@ -123,8 +121,6 @@ export default {
123
121
  },
124
122
  data () {
125
123
  return {
126
- devicesData: [],
127
- deviceIds: [],
128
124
  maxTableHeight: 200,
129
125
  chartData: {},
130
126
  months: monthsModel,
@@ -145,6 +141,36 @@ export default {
145
141
  // isOnlyOneTab: true,
146
142
  loading: false,
147
143
  keyintsidOptions: [],
144
+ directionOptions: [{
145
+ value: 'up',
146
+ label: this.$t('openatccomponents.greenwaveoptimize.directionOption1'),
147
+ id: '1'
148
+ }, {
149
+ value: 'down',
150
+ label: this.$t('openatccomponents.greenwaveoptimize.directionOption2'),
151
+ id: '2'
152
+ }, {
153
+ value: 'all',
154
+ label: this.$t('openatccomponents.greenwaveoptimize.directionOption3'),
155
+ id: '3'
156
+ }],
157
+ optstrategyOptions: [{
158
+ value: 'green',
159
+ label: this.$t('openatccomponents.greenwaveoptimize.optstrategyoption1'),
160
+ id: '1'
161
+ }, {
162
+ value: 'red',
163
+ label: this.$t('openatccomponents.greenwaveoptimize.optstrategyoption2'),
164
+ id: '2'
165
+ }, {
166
+ value: 'motorcade-end',
167
+ label: this.$t('openatccomponents.greenwaveoptimize.optstrategyoption3'),
168
+ id: '3'
169
+ }, {
170
+ value: 'dynamicGreen',
171
+ label: this.$t('openatccomponents.greenwaveoptimize.optstrategyoption4'),
172
+ id: '4'
173
+ }],
148
174
  editableTabsValue: '1',
149
175
  routePattern: {
150
176
  'id': 1,
@@ -240,7 +266,6 @@ export default {
240
266
  }
241
267
  }
242
268
  this.route = route
243
- await _this.getDeviceByIds(route)
244
269
  _this.onAgentidsChange('', optPatternList, _this.agentids)
245
270
  })
246
271
  },
@@ -489,6 +514,128 @@ export default {
489
514
  }
490
515
  },
491
516
  onConditionChange () {},
517
+ onOptstrategyChange (val) {
518
+ if (this.chartData.patternList) {
519
+ this.chartData.routeData.optstrategy = val
520
+ }
521
+ },
522
+ onDirectionChange (val) {
523
+ if (this.chartData.patternList) {
524
+ this.chartData.routeData.direction = val
525
+ }
526
+ },
527
+ onUpspeedChange (val) {
528
+ if (this.chartData.patternList) {
529
+ this.chartData.routeData.upspeed = val
530
+ }
531
+ },
532
+ onDownspeedChange (val) {
533
+ if (this.chartData.patternList) {
534
+ this.chartData.routeData.downspeed = val
535
+ }
536
+ },
537
+ handleMonth (val, index) {
538
+ let allValues = []
539
+ // 保留所有值
540
+ for (let item of this.months) {
541
+ allValues.push(item.value)
542
+ }
543
+ // 若是全部选择
544
+ if (val.includes(0)) this.editableTabs[index].month = allValues
545
+ // 取消全部选中,上次有,当前没有,表示取消全选
546
+ if (this.oldOptions.includes(0) && !val.includes(0)) this.editableTabs[index].month = []
547
+ // 点击非全部选中,需要排除全部选中,以及,当前点击的选项
548
+ // 新老数据都有全部选中
549
+ if (this.oldOptions.includes(0) && val.includes(0)) {
550
+ let tempIndex = val.indexOf(0)
551
+ val.splice(tempIndex, 1) // 排除全选选项
552
+ this.editableTabs[index].month = val
553
+ }
554
+ // 全选未选,但是其他选项全部选上,则全选选上,上次和当前,都没有全选
555
+ if (!this.oldOptions.includes(0) && !val.includes(0)) {
556
+ if (val.length === allValues.length - 1) this.editableTabs[index].month = [0].concat(val)
557
+ }
558
+ this.oldOptions = this.editableTabs[index].month
559
+ },
560
+ handleDate (val, index) {
561
+ let allValues = []
562
+ // 保留所有值
563
+ for (let item of this.dates) {
564
+ allValues.push(item)
565
+ }
566
+ // 判断中英文
567
+ if (this.$i18n.locale === 'en') {
568
+ // 若是全部选择
569
+ if (val.includes('All')) this.editableTabs[index].date = allValues
570
+ // 取消全部选中,上次有,当前没有,表示取消全选
571
+ if (this.oldOptions.includes('All') && !val.includes('All')) this.editableTabs[index].date = []
572
+ // 点击非全部选中,需要排除全部选中,以及,当前点击的选项
573
+ // 新老数据都有全部选中
574
+ if (this.oldOptions.includes('All') && val.includes('All')) {
575
+ let tempIndex = val.indexOf('All')
576
+ val.splice(tempIndex, 1) // 排除全选选项
577
+ this.editableTabs[index].date = val
578
+ }
579
+ // 全选未选,但是其他选项全部选上,则全选选上,上次和当前,都没有全选
580
+ if (!this.oldOptions.includes('All') && !val.includes('All')) {
581
+ if (val.length === allValues.length - 1) this.editableTabs[index].date = ['All'].concat(val)
582
+ }
583
+ } else if (this.$i18n.locale === 'zh') {
584
+ // 若是全部选择
585
+ if (val.includes('全选')) this.editableTabs[index].date = allValues
586
+ // 取消全部选中,上次有,当前没有,表示取消全选
587
+ if (this.oldOptions.includes('全选') && !val.includes('全选')) this.editableTabs[index].date = []
588
+ // 点击非全部选中,需要排除全部选中,以及,当前点击的选项
589
+ // 新老数据都有全部选中
590
+ if (this.oldOptions.includes('全选') && val.includes('全选')) {
591
+ let tempIndex = val.indexOf('全选')
592
+ val.splice(tempIndex, 1) // 排除全选选项
593
+ this.editableTabs[index].date = val
594
+ }
595
+ // 全选未选,但是其他选项全部选上,则全选选上,上次和当前,都没有全选
596
+ if (!this.oldOptions.includes('全选') && !val.includes('全选')) {
597
+ if (val.length === allValues.length - 1) this.editableTabs[index].date = ['全选'].concat(val)
598
+ }
599
+ }
600
+ this.oldOptions = this.editableTabs[index].date
601
+ },
602
+ handleDateInit (val, status) {
603
+ if (status) {
604
+ this.oldOptions = val
605
+ } else {
606
+ this.oldOptions = []
607
+ }
608
+ },
609
+ handleDay (val, index) {
610
+ let allValues = []
611
+ // 保留所有值
612
+ for (let item of this.days) {
613
+ allValues.push(item.value)
614
+ }
615
+ // 若是全部选择
616
+ if (val.includes(8)) this.editableTabs[index].day = allValues
617
+ // 取消全部选中,上次有,当前没有,表示取消全选
618
+ if (this.oldOptions.includes(8) && !val.includes(8)) this.editableTabs[index].day = []
619
+ // 点击非全部选中,需要排除全部选中,以及,当前点击的选项
620
+ // 新老数据都有全部选中
621
+ if (this.oldOptions.includes(8) && val.includes(8)) {
622
+ let tempIndex = val.indexOf(8)
623
+ val.splice(tempIndex, 1) // 排除全选选项
624
+ this.editableTabs[index].day = val
625
+ }
626
+ // 全选未选,但是其他选项全部选上,则全选选上,上次和当前,都没有全选
627
+ if (!this.oldOptions.includes(8) && !val.includes(8)) {
628
+ if (val.length === allValues.length - 1) this.editableTabs[index].day = [8].concat(val)
629
+ }
630
+ this.oldOptions = this.editableTabs[index].day
631
+ },
632
+ initOldOptions (val, status) {
633
+ if (status) {
634
+ this.oldOptions = val
635
+ } else {
636
+ this.oldOptions = []
637
+ }
638
+ },
492
639
  beforeLeave (currentName, oldName) {
493
640
  // var self = this // 重点,如果name是add,则什么都不触发
494
641
  if (currentName === 'add') {
@@ -688,22 +835,22 @@ export default {
688
835
  }
689
836
  patterntable.newPatternList = []
690
837
  },
691
- async getDeviceByIds (routeData) {
838
+ getDeviceByIds (routeData) {
692
839
  // 获取设备表格信息
693
840
  let realtimeRouteData = JSON.parse(JSON.stringify(routeData))
694
841
  this.deviceIds = realtimeRouteData.devs.map(ele => ele.agentid)
695
- await GetDeviceByIds(this.deviceIds).then(res => {
842
+ GetDeviceByIds(this.deviceIds).then(res => {
696
843
  if (!res.data.success) {
697
844
  this.$message.error(getMessageByCode(res.data.code, this.$i18n.locale))
698
845
  return
699
846
  }
700
847
  this.devicesData = res.data.data
701
- // // 取路口对应的实际方案id
702
- // let devs = realtimeRouteData.devs
703
- // for (let inter of devs) {
704
- // inter.patternid = this.getActurlPatternid(inter.agentid)
705
- // }
706
- // this.chartData.realPatternRouteData = realtimeRouteData
848
+ // 取路口对应的实际方案id
849
+ let devs = realtimeRouteData.devs
850
+ for (let inter of devs) {
851
+ inter.patternid = this.getActurlPatternid(inter.agentid)
852
+ }
853
+ this.chartData.realPatternRouteData = realtimeRouteData
707
854
  // this.$refs.chartDialog.show(true, this.chartData, this.route.name, this.devicesData)
708
855
  })
709
856
  },
@@ -29,11 +29,6 @@
29
29
  <span>{{scope.row.agentid}}</span>
30
30
  </template>
31
31
  </el-table-column>
32
- <el-table-column align="center" :label="$t('openatccomponents.overview.crossname')" width="120" minWidth="40">
33
- <template slot-scope="scope">
34
- <span>{{getDevName(scope.row)}}</span>
35
- </template>
36
- </el-table-column>
37
32
  <el-table-column property="isValid" :label="$t('openatccomponents.token.isValid')" align="center" width="80" prop="isused">
38
33
  <template slot-scope="scope">
39
34
  <el-switch
@@ -64,7 +59,11 @@
64
59
  <span></span>
65
60
  </template>
66
61
  </el-table-column>
67
- <el-table-column align="center" :label="$t('openatccomponents.greenwaveoptimize.offset')" width="70" prop="offset">
62
+ <!-- <el-table-column align="center" :label="$t('openatccomponents.greenwaveoptimize.directionOption1')" width="150" prop="forwardphaseDesc" :formatter="formatterForwardphaseDesc">
63
+ </el-table-column>
64
+ <el-table-column align="center" :label="$t('openatccomponents.greenwaveoptimize.directionOption2')" width="150" prop="backphaseDesc" :formatter="formatterBackphaseDesc">
65
+ </el-table-column> -->
66
+ <el-table-column align="center" :label="$t('openatccomponents.greenwaveoptimize.offset')" width="120" prop="offset">
68
67
  <template slot-scope="scope">
69
68
  <el-input-number v-if="isAllowedExpand" :controls="false" :min="0" :step="1" v-model.number="scope.row.offset" size="small" style="width:70%;"></el-input-number>
70
69
  <span v-else>
@@ -72,7 +71,7 @@
72
71
  </span>
73
72
  </template>
74
73
  </el-table-column>
75
- <el-table-column align="center" :label="$t('openatccomponents.greenwaveoptimize.cycle')" width="60" prop="cycle">
74
+ <el-table-column align="center" :label="$t('openatccomponents.greenwaveoptimize.cycle')" width="80" prop="cycle">
76
75
  </el-table-column>
77
76
  <el-table-column align="center" :label="$t('openatccomponents.pattern.plan')">
78
77
  <template slot-scope="scope">
@@ -126,10 +125,6 @@ export default {
126
125
  XiaoKanBan
127
126
  },
128
127
  props: {
129
- devicesData: {
130
- type: Array,
131
- default: () => []
132
- },
133
128
  optList: {
134
129
  type: Array
135
130
  },
@@ -181,14 +176,6 @@ export default {
181
176
  })
182
177
  },
183
178
  methods: {
184
- getDevName (row) {
185
- let res = row.name ? row.name : ''
186
- if (this.devicesData) {
187
- let dev = this.devicesData.find(item => item.agentid === row.agentid)
188
- res = dev ? dev.name : res
189
- }
190
- return res
191
- },
192
179
  onPatternTable (routeData, patternList, phaseList) {
193
180
  if (patternList.length === 0) {
194
181
  // this.$message.error('方案为空!')