openatc-components 0.2.42 → 0.2.43

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.2.42",
3
+ "version": "0.2.43",
4
4
  "description": "A Vue.js project",
5
5
  "author": "openatc developer",
6
6
  "private": false,
@@ -98,7 +98,7 @@ export default {
98
98
  type: Number,
99
99
  default: 1
100
100
  },
101
- StageWidth: {
101
+ StageWidth: { // 图的大小样式
102
102
  type: String,
103
103
  default: '70px'
104
104
  },
@@ -122,23 +122,26 @@ export default {
122
122
  type: String,
123
123
  default: '65PX'
124
124
  },
125
- showStyle: {
125
+ showStyle: { // 图内部方向的位置
126
126
  type: Object,
127
127
  default: () => ({
128
128
  top:'7PX',
129
129
  left:'13px'
130
130
  })
131
131
  },
132
- showStyles: {
132
+ showStyles: { // 图内部人行道的位置
133
133
  type: Object,
134
134
  default: () => ({
135
135
  top:'5PX',
136
136
  left:'12px'
137
137
  })
138
138
  },
139
- noClick: {
139
+ noClick: { // 图是否可以点击
140
140
  type: Boolean,
141
141
  default: false
142
+ },
143
+ showDataType: { // 图展示的数据类型:默认按阶段展示,如果传phase则按相位维度展示
144
+ type: String
142
145
  }
143
146
  },
144
147
  data () {
@@ -162,7 +165,11 @@ export default {
162
165
  let list = []
163
166
  if (this.crossStatusData && this.crossStatusData.stages && this.phaseList && this.phaseList.length > 0) {
164
167
  let ringDataModel = new RingDataModel(this.crossStatusData, this.phaseList)
165
- list = ringDataModel.getStageData()
168
+ if (this.showDataType === 'phase') {
169
+ list = ringDataModel.getStageData('phase')
170
+ } else {
171
+ list = ringDataModel.getStageData()
172
+ }
166
173
  if (this.isShowCurrentStage) {
167
174
  this.currentStage = this.crossStatusData.current_stage
168
175
  }
@@ -181,12 +181,19 @@ export default class RingDataModel {
181
181
  }
182
182
  return stagesTemp
183
183
  }
184
- getStageData () {
184
+ getStageData (datatype) {
185
185
  let data = this.crossStatusData
186
186
  let stagesTemp = []
187
187
  let busPhaseData = this.getBusPos()
188
188
  let sidewalkPhaseData = this.getPedPhasePos()
189
- let stages = data.stages
189
+ let stages
190
+ if (datatype === 'phase') {
191
+ // 如果需要按相位展示,datatype传'phase'
192
+ stages = data.phase.map(ele => [ele.id])
193
+ } else {
194
+ // 默认按阶段数据处理
195
+ stages = data.stages
196
+ }
190
197
  for (let stage of stages) {
191
198
  let tempList = []
192
199
  let directionList = []