openatc-components 0.3.31 → 0.3.33

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.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openatc-components",
3
- "version": "0.3.31",
3
+ "version": "0.3.33",
4
4
  "description": "A Vue.js project",
5
5
  "author": "openatc developer",
6
6
  "private": false,
@@ -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">
@@ -38,6 +38,7 @@
38
38
  </div>
39
39
  <div style="height: 94%;" class="table-container">
40
40
  <PatternTable ref="patterntable"
41
+ :devicesData="devicesData"
41
42
  :maxTableHeight="maxTableHeight"
42
43
  :opt="item.devs"
43
44
  :isAllowedExpand="isAllowedExpand"
@@ -55,6 +56,7 @@
55
56
  </el-container>
56
57
  <div v-if="isShowSingle" style="height: 94%;" class="table-container">
57
58
  <PatternTable ref="patterntable"
59
+ :devicesData="devicesData"
58
60
  :opt="opt.optPatternList[0].devs"
59
61
  :isAllowedExpand="isAllowedExpand"
60
62
  :maxTableHeight="maxTableHeight"
@@ -121,6 +123,8 @@ export default {
121
123
  },
122
124
  data () {
123
125
  return {
126
+ devicesData: [],
127
+ deviceIds: [],
124
128
  maxTableHeight: 200,
125
129
  chartData: {},
126
130
  months: monthsModel,
@@ -141,36 +145,6 @@ export default {
141
145
  // isOnlyOneTab: true,
142
146
  loading: false,
143
147
  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
- }],
174
148
  editableTabsValue: '1',
175
149
  routePattern: {
176
150
  'id': 1,
@@ -266,6 +240,7 @@ export default {
266
240
  }
267
241
  }
268
242
  this.route = route
243
+ await _this.getDeviceByIds(route)
269
244
  _this.onAgentidsChange('', optPatternList, _this.agentids)
270
245
  })
271
246
  },
@@ -514,128 +489,6 @@ export default {
514
489
  }
515
490
  },
516
491
  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
- },
639
492
  beforeLeave (currentName, oldName) {
640
493
  // var self = this // 重点,如果name是add,则什么都不触发
641
494
  if (currentName === 'add') {
@@ -835,22 +688,22 @@ export default {
835
688
  }
836
689
  patterntable.newPatternList = []
837
690
  },
838
- getDeviceByIds (routeData) {
691
+ async getDeviceByIds (routeData) {
839
692
  // 获取设备表格信息
840
693
  let realtimeRouteData = JSON.parse(JSON.stringify(routeData))
841
694
  this.deviceIds = realtimeRouteData.devs.map(ele => ele.agentid)
842
- GetDeviceByIds(this.deviceIds).then(res => {
695
+ await GetDeviceByIds(this.deviceIds).then(res => {
843
696
  if (!res.data.success) {
844
697
  this.$message.error(getMessageByCode(res.data.code, this.$i18n.locale))
845
698
  return
846
699
  }
847
700
  this.devicesData = res.data.data
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
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
854
707
  // this.$refs.chartDialog.show(true, this.chartData, this.route.name, this.devicesData)
855
708
  })
856
709
  },
@@ -29,6 +29,11 @@
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>
32
37
  <el-table-column property="isValid" :label="$t('openatccomponents.token.isValid')" align="center" width="80" prop="isused">
33
38
  <template slot-scope="scope">
34
39
  <el-switch
@@ -59,11 +64,7 @@
59
64
  <span></span>
60
65
  </template>
61
66
  </el-table-column>
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">
67
+ <el-table-column align="center" :label="$t('openatccomponents.greenwaveoptimize.offset')" width="70" prop="offset">
67
68
  <template slot-scope="scope">
68
69
  <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>
69
70
  <span v-else>
@@ -71,7 +72,7 @@
71
72
  </span>
72
73
  </template>
73
74
  </el-table-column>
74
- <el-table-column align="center" :label="$t('openatccomponents.greenwaveoptimize.cycle')" width="80" prop="cycle">
75
+ <el-table-column align="center" :label="$t('openatccomponents.greenwaveoptimize.cycle')" width="60" prop="cycle">
75
76
  </el-table-column>
76
77
  <el-table-column align="center" :label="$t('openatccomponents.pattern.plan')">
77
78
  <template slot-scope="scope">
@@ -125,6 +126,10 @@ export default {
125
126
  XiaoKanBan
126
127
  },
127
128
  props: {
129
+ devicesData: {
130
+ type: Array,
131
+ default: () => []
132
+ },
128
133
  optList: {
129
134
  type: Array
130
135
  },
@@ -176,6 +181,14 @@ export default {
176
181
  })
177
182
  },
178
183
  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
+ },
179
192
  onPatternTable (routeData, patternList, phaseList) {
180
193
  if (patternList.length === 0) {
181
194
  // this.$message.error('方案为空!')
@@ -11,12 +11,12 @@
11
11
 
12
12
  // 全局滚动条样式
13
13
  ::-webkit-scrollbar {
14
- width: 6PX;
15
- height: 6PX;
14
+ width: 12PX;
15
+ height: 12PX;
16
16
  }
17
17
  ::-webkit-scrollbar-thumb {
18
18
  // 滚动条的滑块
19
- border-radius: 3PX;
19
+ border-radius: 4px;
20
20
  background: rgba(144, 147, 153, 0.3);
21
21
  }
22
22
  ::-webkit-scrollbar-corner{
@@ -226,7 +226,7 @@
226
226
  overflow-y: auto;
227
227
  }
228
228
  .manual-common-content::-webkit-scrollbar {
229
- width: 6PX;
229
+ width: 8PX;
230
230
  }
231
231
  }
232
232
  // 手动控制弹框