openatc-components 0.2.6 → 0.2.7

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.
@@ -1,9 +1,20 @@
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
+ **/
1
12
  <template>
2
13
  <div class="components-container board">
3
14
  <div class="common-board-column">
4
15
  <div class="common-board-column-header" style="position:relative">
5
16
  <span>{{$t('openatccomponents.pattern.stage')+(subIndex+1)}}</span>
6
- <span v-if="this.contrloType === 'stage'" style="position: absolute;right: 0;">
17
+ <span v-if="isRing" style="position: absolute;right: 0;">
7
18
  <el-button type="primary" @click="deleteStage(subIndex)" icon="el-icon-close"></el-button>
8
19
  </span>
9
20
  </div>
@@ -17,7 +28,8 @@
17
28
  </el-col>
18
29
  <el-col :span="12">
19
30
  <el-input-number
20
- v-if="this.contrloType === 'stage'"
31
+ v-if="isRing"
32
+ class="stage-value"
21
33
  :controls="false"
22
34
  size="small"
23
35
  :disabled="true"
@@ -25,7 +37,8 @@
25
37
  v-model.number="stage.stageSplit">
26
38
  </el-input-number>
27
39
  <el-input-number
28
- v-if="this.contrloType === 'ring' || !this.contrloType"
40
+ v-if="!isRing"
41
+ class="stage-value"
29
42
  :controls="false"
30
43
  size="small"
31
44
  v-model.number="stage.split"
@@ -40,57 +53,74 @@
40
53
  {{this.$t('openatccomponents.pattern.phase')}}
41
54
  </el-col>
42
55
  <el-col :span="12">
43
- <el-select v-if="this.contrloType === 'stage'" v-model="stage.stages" multiple :placeholder="$t('openatccomponents.common.select')">
56
+ <SelectCrossPhase
57
+ v-if="isRing"
58
+ type="phases"
59
+ :pattern="false"
60
+ :phaseOption="coordphaseOption"
61
+ multiple
62
+ :row="stage"
63
+ style="width:100%;">
64
+ </SelectCrossPhase>
65
+ <!-- <el-select v-if="isRing" v-model="stage.phases" multiple :placeholder="$t('openatccomponents.common.select')">
44
66
  <el-option
45
67
  v-for="item in coordphaseOption"
46
68
  :key="item.value"
47
69
  :label="$t('openatccomponents.pattern.phase') + item.value"
48
70
  :value="item.value">
49
71
  </el-option>
50
- </el-select>
72
+ </el-select> -->
51
73
  <el-input
52
- v-if="this.contrloType === 'ring' || !this.contrloType"
74
+ v-if="!isRing"
75
+ class="stage-value"
53
76
  size="small"
54
- :value="stage.stageKanban?stage.stageKanban.join(','):''"
77
+ :value="stage.phases.join(',')"
55
78
  ref="type"
79
+ style="width:100%;align:left;"
56
80
  :disabled="true">
57
81
  </el-input>
58
82
  </el-col>
59
83
  </el-row>
60
- <el-row :gutter="0" v-if="this.contrloType === 'stage'">
84
+ <el-row :gutter="0" v-if="isRing">
61
85
  <el-col :span="12">
62
86
  {{this.$t('openatccomponents.pattern.green')}}
63
87
  </el-col>
64
88
  <el-col :span="12">
65
89
  <el-input-number
90
+ class="stage-value"
66
91
  size="small"
67
92
  :controls="false"
93
+ :min="0"
68
94
  v-model.number="stage.green"
69
95
  @change="stageSplitChange">
70
96
  </el-input-number>
71
97
  </el-col>
72
98
  </el-row>
73
- <el-row :gutter="0" v-if="this.contrloType === 'stage'">
99
+ <el-row :gutter="0" v-if="isRing">
74
100
  <el-col :span="12">
75
101
  {{this.$t('openatccomponents.pattern.yellow')}}
76
102
  </el-col>
77
103
  <el-col :span="12">
78
104
  <el-input-number
105
+ class="stage-value"
79
106
  size="small"
80
107
  :controls="false"
108
+ :min="0"
81
109
  v-model.number="stage.yellow"
82
110
  @change="stageSplitChange">
83
111
  </el-input-number>
84
112
  </el-col>
85
113
  </el-row>
86
- <el-row :gutter="0" v-if="this.contrloType === 'stage'">
114
+ <el-row :gutter="0" v-if="isRing">
87
115
  <el-col :span="12">
88
116
  {{this.$t('openatccomponents.pattern.red')}}
89
117
  </el-col>
90
118
  <el-col :span="12">
91
119
  <el-input-number
120
+ class="stage-value"
92
121
  size="small"
93
122
  :controls="false"
123
+ :min="0"
94
124
  v-model.number="stage.red"
95
125
  @change="stageSplitChange">
96
126
  </el-input-number>
@@ -103,11 +133,12 @@
103
133
  </template>
104
134
  <script>
105
135
  import draggable from 'vuedraggable'
106
-
136
+ import SelectCrossPhase from '../SelectCrossPhase/index.vue'
107
137
  export default {
108
- name: 'stage-board',
138
+ name: 'stage-bord',
109
139
  components: {
110
- draggable
140
+ draggable,
141
+ SelectCrossPhase
111
142
  },
112
143
  data () {
113
144
  return {
@@ -127,8 +158,8 @@ export default {
127
158
  return []
128
159
  }
129
160
  },
130
- contrloType: {
131
- type: String
161
+ isRing: {
162
+ type: Boolean
132
163
  },
133
164
  options: {
134
165
  type: Object,
@@ -141,7 +172,7 @@ export default {
141
172
  default () {
142
173
  return {
143
174
  split: 0,
144
- stages: [],
175
+ // stages: [],
145
176
  phases: [],
146
177
  stageSplit: 0,
147
178
  green: 0,
@@ -162,23 +193,30 @@ export default {
162
193
  created () {
163
194
  },
164
195
  watch: {
165
- stage: {
166
- handler: function () {
167
- if (this.contrloType) {
168
- let n = this.rowIndex
169
- const globalParamModel = this.$store.getters.globalParamModel
170
- let pattern = globalParamModel.getParamsByType('patternList')[n]
171
- globalParamModel.getParamsByType('patternList')[n].cycle = this.getMaxCycle(pattern)
172
- }
173
- },
174
- deep: true
175
- }
196
+ // stage: {
197
+ // handler: function () {
198
+ // if (this.isRing) {
199
+ // let n = this.rowIndex
200
+ // const globalParamModel = this.$store.getters.globalParamModel
201
+ // let pattern = globalParamModel.getParamsByType('patternList')[n]
202
+ // globalParamModel.getParamsByType('patternList')[n].cycle = this.getMaxCycle(pattern)
203
+ // }
204
+ // },
205
+ // deep: true
206
+ // }
176
207
  },
177
208
  mounted () {
178
209
  },
179
210
  methods: {
180
211
  deleteStage (index) {
181
212
  this.stageInfo.splice(index, 1)
213
+ this.stageInfo.forEach((item, index) => {
214
+ item.key = index
215
+ })
216
+ // let n = this.rowIndex
217
+ // const globalParamModel = this.$store.getters.globalParamModel
218
+ // let pattern = globalParamModel.getParamsByType('patternList')[n]
219
+ // globalParamModel.getParamsByType('patternList')[n].cycle = this.getMaxCycle(pattern)
182
220
  },
183
221
  getMaxCycle (pattern) {
184
222
  let rings = pattern.stagesList
@@ -227,16 +265,23 @@ export default {
227
265
  width: 100%;
228
266
  height: auto;
229
267
  margin: 5px 0;
268
+ text-align: left;
230
269
  line-height: 40px;
231
- // color: #FFFFFF;
232
270
  padding: 1px 1px;
233
271
  box-sizing: border-box;
234
272
  }
235
273
  .el-button--primary:hover, .el-button--primary:focus{
236
274
  background: #299BCC;
237
275
  border-color: #299BCC;
238
- // color: #FFFFFF;
276
+ color: #FFFFFF;
277
+ }
278
+ .stage-value {
279
+ text-align: left;
280
+ width: 100%;
239
281
  }
240
282
  </style>
241
283
  <style lang="scss">
284
+ .stage-value .el-input__inner {
285
+ text-align: center;
286
+ }
242
287
  </style>
@@ -11,6 +11,7 @@
11
11
  :patternList="patternList"
12
12
  :controlPhase="controlPhase"
13
13
  :showCondition="showCondition"
14
+ :allPatternList="allPatternList"
14
15
  :localPatternList="localPatternList"
15
16
  :phaseList="phaseList"
16
17
  :showBarrier="showBarrier"
@@ -507,6 +508,9 @@ export default {
507
508
  type: Boolean,
508
509
  default: false
509
510
  },
511
+ allPatternList: {
512
+ type: Array
513
+ },
510
514
  controlPhase: {
511
515
  type: Object
512
516
  },
@@ -19,7 +19,7 @@ export default {
19
19
  isShowMode: true,
20
20
  modeName: '交警遥控',
21
21
  controlName: '步进',
22
- agentId: 'bclsnl',
22
+ agentId: 'jmlxhl',
23
23
  Token: 'eyJraWQiOiIxNzA4OTA5NDk2ODcxIiwidHlwIjoiSldUIiwiYWxnIjoiSFMyNTYifQ.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTcwODk1MjY5NiwiaWF0IjoxNzA4OTA5NDk2fQ.FI0gzBQFLyQsj95LG56lVZxb6WYlr2-datNsyv6fF-I',
24
24
  reqUrl: 'http://192.168.13.103:10003/openatc'
25
25
  }
@@ -55,8 +55,8 @@ export default {
55
55
  showWalk: [ 1, 2 ],
56
56
  sidewalkPhaseData: [{key: 'pedphase1653873194007699', phaseid: 1, id: 1, name: '东人行横道', isshow: false}],
57
57
  lockPhaseBtnName: this.$t('openatccomponents.overview.comfirm'),
58
- agentId: 'bclsnl',
59
- Token: 'eyJraWQiOiIxNzEzNDkyMDM3Mzc5IiwidHlwIjoiSldUIiwiYWxnIjoiSFMyNTYifQ.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTcxMzUzNTIzNywiaWF0IjoxNzEzNDkyMDM3fQ.SONz4foJQutGgyF_CJhcQRimDcYwbsJyMzdjZg9cgLE',
58
+ agentId: '12004-950',
59
+ Token: 'eyJraWQiOiIxNjcwMzc0ODA4MTcyIiwidHlwIjoiSldUIiwiYWxnIjoiSFMyNTYifQ.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc1Njc3NDgwOCwiaWF0IjoxNjcwMzc0ODA4fQ.xsRoye_tk_Xf60w5Mpigm8vrPgQJCLN-W_IW4U7dafA',
60
60
  Token103: 'eyJraWQiOiIxNjcwMzc0ODA4MTcyIiwidHlwIjoiSldUIiwiYWxnIjoiSFMyNTYifQ.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc1Njc3NDgwOCwiaWF0IjoxNjcwMzc0ODA4fQ.xsRoye_tk_Xf60w5Mpigm8vrPgQJCLN-W_IW4U7dafA',
61
61
  boxVisible: false,
62
62
  dialogWidth: '80%',
@@ -333,7 +333,7 @@
333
333
  }
334
334
  }
335
335
  .tentativeplan-control{
336
- height: 100%;
336
+ // height: 100%;
337
337
  padding: 21PX 0PX 21PX 28PX;
338
338
  min-width: 360PX;
339
339
  overflow: hidden !important;