openatc-components 0.2.7 → 0.2.8

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,286 +1,134 @@
1
1
  <template>
2
2
  <div class="tentativeplan-control">
3
- <div class="title" style="margin-bottom: 18px">
4
- {{ $t('openatccomponents.overview.tentativeplan') }}
5
- </div>
3
+ <div class="title" style="margin-bottom: 18px;">{{$t('openatccomponents.overview.tentativeplan')}}</div>
6
4
  <el-row>
7
5
  <el-col :span="12">
8
- <el-form
9
- ref="manual"
10
- label-position="left"
11
- :model="manualInfo"
12
- label-width="100px"
13
- >
14
- <el-form-item
15
- :label="$t('openatccomponents.overview.patternid') + ':'"
16
- prop="count"
17
- >
18
- <el-select
19
- @change="selectPattern()"
20
- v-model="manualInfo.tempPatternid"
21
- class="col-inner"
22
- size="small"
23
- :placeholder="$t('openatccomponents.common.select')"
24
- >
25
- <el-option
26
- v-for="item in patternSelect"
27
- :key="item.value"
28
- :label="item.label"
29
- :value="item.value"
30
- >
31
- </el-option>
32
- </el-select>
33
- <!-- <el-input v-model="manualInfo.tempDuration" size="mini" :placeholder="$t('openatccomponents.common.input')"></el-input> -->
34
- </el-form-item>
35
- <el-form-item
36
- :label="$t('openatccomponents.overview.delay') + ':'"
37
- prop="intersection"
38
- >
39
- <el-input-number
40
- :placeholder="$t('openatccomponents.common.input')"
41
- :min="0"
42
- :max="65535"
43
- :precision="0"
44
- :step="1"
45
- :controls="false"
46
- v-model.number="manualInfo.tempDelay"
47
- size="mini"
48
- ></el-input-number>
49
- <!-- <el-input v-model="manualInfo.tempDelay" size="mini" :placeholder="$t('openatccomponents.common.input')"></el-input> -->
50
- </el-form-item>
51
- </el-form>
6
+ <el-form
7
+ ref="manual"
8
+ label-position="left"
9
+ :model="manualInfo"
10
+ label-width="100px">
11
+ <el-form-item
12
+ :label="$t('openatccomponents.overview.patternid') + ':'"
13
+ prop="count">
14
+ <el-select @change="selectPattern()" v-model="manualInfo.tempPatternid" class="col-inner" size="small" :placeholder="$t('openatccomponents.common.select')">
15
+ <el-option
16
+ v-for="item in patternSelect"
17
+ :key="item.value"
18
+ :label="item.label"
19
+ :value="item.value">
20
+ </el-option>
21
+ </el-select>
22
+ <!-- <el-input v-model="manualInfo.tempDuration" size="mini" :placeholder="$t('openatccomponents.common.input')"></el-input> -->
23
+ </el-form-item>
24
+ <el-form-item
25
+ :label="$t('openatccomponents.overview.delay') + ':'"
26
+ prop="intersection">
27
+ <el-input-number :placeholder="$t('openatccomponents.common.input')" :min="0" :max="65535" :precision="0" :step="1" :controls="false" v-model.number="manualInfo.tempDelay" size="mini"></el-input-number>
28
+ <!-- <el-input v-model="manualInfo.tempDelay" size="mini" :placeholder="$t('openatccomponents.common.input')"></el-input> -->
29
+ </el-form-item>
30
+ </el-form>
52
31
  </el-col>
53
32
  <el-col :span="12">
54
- <el-form
55
- ref="manual"
56
- label-position="left"
57
- :model="manualInfo"
58
- label-width="100px"
59
- >
60
- <el-form-item
61
- :label="$t('openatccomponents.overview.patternoffset') + ':'"
62
- prop="count"
63
- >
64
- <el-input-number
65
- :placeholder="$t('openatccomponents.common.input')"
66
- :min="0"
67
- :max="65535"
68
- :precision="0"
69
- :step="1"
70
- :controls="false"
71
- v-model.number="manualInfo.offset"
72
- size="mini"
73
- ></el-input-number>
74
- <!-- <el-input v-model="manualInfo.offset" size="mini" :placeholder="$t('openatccomponents.common.input')"></el-input> -->
75
- </el-form-item>
76
- <el-form-item
77
- :label="$t('openatccomponents.overview.duration') + ':'"
78
- prop="intersection"
79
- >
80
- <el-input-number
81
- :placeholder="$t('openatccomponents.common.input')"
82
- :min="0"
83
- :max="65535"
84
- :precision="0"
85
- :step="1"
86
- :controls="false"
87
- v-model.number="manualInfo.duration"
88
- size="mini"
89
- ></el-input-number>
90
- <!-- <el-input v-model="manualInfo.duration" size="mini" :placeholder="$t('openatccomponents.common.input')"></el-input> -->
91
- </el-form-item>
92
- </el-form>
33
+ <el-form
34
+ ref="manual"
35
+ label-position="left"
36
+ :model="manualInfo"
37
+ label-width="100px">
38
+ <el-form-item
39
+ :label="$t('openatccomponents.overview.patternoffset') + ':'"
40
+ prop="count">
41
+ <el-input-number :placeholder="$t('openatccomponents.common.input')" :min="0" :max="65535" :precision="0" :step="1" :controls="false" v-model.number="manualInfo.offset" size="mini"></el-input-number>
42
+ <!-- <el-input v-model="manualInfo.offset" size="mini" :placeholder="$t('openatccomponents.common.input')"></el-input> -->
43
+ </el-form-item>
44
+ <el-form-item
45
+ :label="$t('openatccomponents.overview.duration') + ':'"
46
+ prop="intersection">
47
+ <el-input-number :placeholder="$t('openatccomponents.common.input')" :min="0" :max="65535" :precision="0" :step="1" :controls="false" v-model.number="manualInfo.duration" size="mini"></el-input-number>
48
+ <!-- <el-input v-model="manualInfo.duration" size="mini" :placeholder="$t('openatccomponents.common.input')"></el-input> -->
49
+ </el-form-item>
50
+ </el-form>
93
51
  </el-col>
94
52
  </el-row>
95
53
  <el-row>
96
- <el-radio
97
- style="margin-left: 30px"
98
- v-model="isRing"
99
- :label="false"
100
- @change="changeRing"
101
- >{{ $t('openatccomponents.common.ringStyle') }}</el-radio
102
- >
103
- <el-radio v-model="isRing" :label="true" @change="changeStage">{{
104
- $t('openatccomponents.common.stageStyle')
105
- }}</el-radio>
106
- <!-- <div class="title" style="margin-top:18px; margin-bottom:10px">{{$t('openatccomponents.overview.patternstate')}}:
54
+ <div class="title" style="margin-top:18px; margin-bottom:10px">{{$t('openatccomponents.overview.patternstate')}}:
107
55
  <span>({{$t('openatccomponents.overview.cycle')}}: {{cycle}} {{$t('openatccomponents.overview.patternoffset')}}: {{offset}})</span>
108
- </div> -->
109
- <!-- <stage-status
56
+ </div>
57
+ <stage-status
110
58
  :patternStatusList="patternOne.length===0?planPattern.rings:patternOne[0].rings"
111
59
  >
112
- </stage-status> -->
113
- <pattern-list
114
- :key="keyChange"
115
- :allPatternList="allPatternList"
116
- :contrloType="!this.isRing ? 'ring' : 'stage'"
117
- :stagesChange="
118
- patternOne.length === 0
119
- ? planPattern.stagesList
120
- : patternOne[0].stagesList
121
- "
122
- :patternList="patternOne.length === 0 ? planPattern.rings : patternOne"
123
- :patternStatusList="
124
- patternOne.length === 0 ? planPattern.rings : patternOne[0].rings
125
- "
126
- :cycles="
127
- patternOne.length === 0 ? planPattern.cycle : patternOne[0].cycle
128
- "
129
- :phaseList="phaseList"
130
- >
131
- </pattern-list>
60
+ </stage-status>
61
+ <pattern-list
62
+ :patternList="patternOne.length===0?planPattern.rings:patternOne"
63
+ :patternStatusList="patternOne.length===0?planPattern.rings:patternOne[0].rings"
64
+ :cycles="patternOne.length===0?planPattern.cycle:patternOne[0].cycle"
65
+ :phaseList="phaseList">
66
+ </pattern-list>
132
67
  </el-row>
133
68
  <el-row>
134
- <el-tabs v-model="activeList" type="card">
135
- <el-tab-pane
136
- v-if="!isRing"
137
- :label="$t('openatccomponents.pattern.ringConfig')"
138
- name="ring"
139
- >
140
- <div style="width: 100%; overflow: hidden; margin-top: 20px">
141
- <kan-ban
142
- v-for="n in ringCount"
143
- :key="n"
144
- class="closephasekanban"
145
- :index="n"
146
- :options="options"
147
- :list="
148
- patternOne.length === 0
149
- ? planPattern.rings[n - 1]
150
- : patternOne[0].rings[n - 1]
151
- "
152
- :phaseList="phaseList"
153
- :header-text="$t('openatccomponents.pattern.ring') + n"
154
- @handleSplit="handleSplit"
155
- >
156
- </kan-ban>
157
- </div>
158
- </el-tab-pane>
159
- <!-- <el-tab-pane v-if="isRing" :label="$t('openatccomponents.pattern.stageConfig')" name="kanban">
160
- <div class="stage-panel-contener">
161
- <StageKanban
162
- v-for="(stage, index) in scope.row.stagesList"
163
- class="kanban todo"
164
- :key="index"
165
- :stage="stage"
166
- :stageInfo="scope.row.stagesList"
167
- :isRing="isRing"
168
- :options="scope.row.options"
169
- :coordphaseOption="coordphaseOption"
170
- :rowIndex="scope.$index"
171
- :subIndex="index"
172
- @onStageSplitChange="onStageSplitChange"
173
- @stageSplitChange="stageSplitChange"
174
- @onStageDelaystartChange="onStageDelaystartChange"
175
- @onStageAdvanceendChange="onStageAdvanceendChange"
176
- />
177
- <div v-if="isRing" style="margin-left: 20px">
178
- <el-button
179
- type="primary"
180
- @click="addStage(scope.row.stagesList)"
181
- icon="el-icon-plus"
182
- circle
183
- ></el-button>
184
- </div>
185
- </div>
186
- </el-tab-pane> -->
187
- <el-tab-pane
188
- v-if="isRing"
189
- :label="$t('openatccomponents.pattern.stageConfig')"
190
- name="ring"
191
- >
192
- <div class="stage-panel-contener">
193
- <stage-bord
194
- v-for="(stage, index) in patternOne.length === 0
195
- ? planPattern.stagesList
196
- : patternOne[0].stagesList"
197
- class="kanban todo"
198
- :key="index"
199
- :stage="stage"
200
- :options="options"
201
- :isRing="isRing"
202
- :stageInfo="
203
- patternOne.length === 0
204
- ? planPattern.stagesList
205
- : patternOne[0].stagesList
206
- "
207
- :coordphaseOption="coordphaseOption"
208
- :subIndex="index"
209
- @onStageSplitChange="onStageSplitChange"
210
- @stageSplitChange="stageSplitChange"
211
- @onStageDelaystartChange="onStageDelaystartChange"
212
- @onStageAdvanceendChange="onStageAdvanceendChange"
213
- >
214
- </stage-bord>
215
- <div v-if="isRing" style="margin-left: 20px">
216
- <el-button
217
- type="primary"
218
- @click="
219
- addStage(
220
- patternOne.length === 0
221
- ? planPattern.stagesList
222
- : patternOne[0].stagesList
223
- )
224
- "
225
- icon="el-icon-plus"
226
- circle
227
- ></el-button>
228
- </div>
229
- </div>
230
- </el-tab-pane>
231
- <el-tab-pane
232
- v-if="!isRing"
233
- :label="$t('openatccomponents.pattern.parameters')"
234
- name="parame"
235
- >
236
- <el-row>
237
- <expend-config
238
- v-for="(j, index) in ringCounts"
239
- :key="index"
240
- class="expendkanban"
241
- :options="options"
242
- :header-text="$t('openatccomponents.pattern.ring') + j"
243
- :list="
244
- patternOne.length === 0
245
- ? planPattern.rings[j - 1]
246
- : patternOne[0].rings[j - 1]
247
- "
248
- >
249
- </expend-config>
250
- <div class="forbiddenstage">
251
- {{ $t('openatccomponents.pattern.forbiddenstage') }}
252
- <el-input
253
- class="stage-value"
254
- size="small"
255
- v-model="forbiddenstage"
256
- ></el-input>
257
- </div>
258
- <div class="forbiddenstage">
259
- {{ $t('openatccomponents.pattern.screenstage') }}
260
- <el-input
261
- class="stage-value"
262
- size="small"
263
- v-model="screenstage"
264
- ></el-input>
69
+ <el-tabs v-model="activeList" type="card">
70
+ <el-tab-pane :label="$t('openatccomponents.pattern.ringConfig')" name="ring">
71
+ <div style="width: 100%; overflow: hidden;margin-top: 20px;">
72
+ <kan-ban v-for="n in ringCount"
73
+ :key="n" class="closephasekanban"
74
+ :index="n"
75
+ :options="options"
76
+ :list="patternOne.length===0?planPattern.rings[n-1]:patternOne[0].rings[n-1]"
77
+ :phaseList="phaseList"
78
+ :header-text="$t('openatccomponents.pattern.ring')+n"
79
+ @handleSplit="handleSplit">
80
+ </kan-ban>
265
81
  </div>
266
- <div class="forbiddenstage">
267
- {{ $t('openatccomponents.pattern.coordinatestage') }}
268
- <el-input
269
- class="stage-value"
270
- size="small"
271
- v-model="coordinatestage"
272
- ></el-input>
273
- </div>
274
- </el-row>
275
82
  </el-tab-pane>
276
- <el-tab-pane
277
- v-if="!isRing"
278
- :label="$t('openatccomponents.pattern.overLap')"
279
- name="overlap"
280
- >
281
- <el-row :gutter="20">
282
- <el-col :span="24">
283
- <over-lap
83
+ <!-- <el-tab-pane :label="$t('openatccomponents.pattern.stageConfig')" name="kanban">
84
+ <el-scrollbar :vertical="true">
85
+ <div class="stage-panel-contener">
86
+ <stage-board v-for="(stage,index) in patternOne.length===0?stagesList:patternOne[0].stagesList"
87
+ class="closephasekanban"
88
+ :key="index"
89
+ :stage="stage"
90
+ :options="options"
91
+ :stageInfo="patternOne.length===0?stagesList:patternOne[0].stagesList"
92
+ :coordphaseOption="coordphaseOption"
93
+ :subIndex="index"
94
+ @onStageSplitChange="onStageSplitChange"
95
+ @stageSplitChange="stageSplitChange"
96
+ @onStageDelaystartChange="onStageDelaystartChange"
97
+ @onStageAdvanceendChange="onStageAdvanceendChange"
98
+ >
99
+ </stage-board>
100
+ </div>
101
+ </el-scrollbar>
102
+ </el-tab-pane> -->
103
+ <el-tab-pane :label="$t('openatccomponents.pattern.parameters')" name="parame">
104
+ <el-row>
105
+ <expend-config
106
+ v-for="(j,index) in ringCounts"
107
+ :key="index"
108
+ class="expendkanban"
109
+ :options="options"
110
+ :header-text="$t('openatccomponents.pattern.ring')+j"
111
+ :list="patternOne.length===0?planPattern.rings[j-1]:patternOne[0].rings[j-1]"
112
+ >
113
+ </expend-config>
114
+ <div class="forbiddenstage">
115
+ {{$t('openatccomponents.pattern.forbiddenstage')}}
116
+ <el-input class="stage-value" size="small" v-model="forbiddenstage"></el-input>
117
+ </div>
118
+ <div class="forbiddenstage">
119
+ {{$t('openatccomponents.pattern.screenstage')}}
120
+ <el-input class="stage-value" size="small" v-model="screenstage"></el-input>
121
+ </div>
122
+ <div class="forbiddenstage">
123
+ {{$t('openatccomponents.pattern.coordinatestage')}}
124
+ <el-input class="stage-value" size="small" v-model="coordinatestage"></el-input>
125
+ </div>
126
+ </el-row>
127
+ </el-tab-pane>
128
+ <el-tab-pane :label="$t('openatccomponents.pattern.overLap')" name="overlap">
129
+ <el-row :gutter="20">
130
+ <el-col :span="24" >
131
+ <over-lap
284
132
  :stageList="stagesList"
285
133
  :overlap="overlap"
286
134
  :checked="true"
@@ -288,50 +136,33 @@
288
136
  :cycle="overLapCycle"
289
137
  >
290
138
  </over-lap>
291
- </el-col>
292
- </el-row>
293
- </el-tab-pane>
294
- <el-tab-pane
295
- v-if="!isRing"
296
- :label="$t('openatccomponents.pattern.patternOptimize')"
297
- name="patternOptimize"
298
- >
299
- <pattern-optimize
300
- v-for="n in optimizes"
301
- :key="n"
302
- class="expendkanban"
303
- :list="
304
- patternOne.length === 0
305
- ? planPattern.rings[n - 1]
306
- : patternOne[0].rings[n - 1]
307
- "
308
- :rings="patternOne.length === 0 ? planPattern : patternOne[0]"
309
- :phaseList="phaseList"
310
- :options="options"
311
- :header-text="$t('openatccomponents.pattern.ring') + n"
312
- :index="n"
313
- :nowNumber="n"
314
- @handleSplit="handleSplit"
315
- >
316
- </pattern-optimize>
317
- </el-tab-pane>
318
- </el-tabs>
139
+ </el-col>
140
+ </el-row>
141
+ </el-tab-pane>
142
+ <el-tab-pane :label="$t('openatccomponents.pattern.patternOptimize')" name="patternOptimize">
143
+ <pattern-optimize
144
+ v-for="n in optimizes"
145
+ :key="n" class="expendkanban"
146
+ :list="patternOne.length===0?planPattern.rings[n-1]:patternOne[0].rings[n-1]"
147
+ :rings="patternOne.length===0?planPattern:patternOne[0]"
148
+ :phaseList="phaseList"
149
+ :options="options"
150
+ :header-text="$t('openatccomponents.pattern.ring')+n"
151
+ :index="n"
152
+ :nowNumber="n"
153
+ @handleSplit="handleSplit"
154
+ >
155
+ </pattern-optimize>
156
+ </el-tab-pane>
157
+ </el-tabs>
319
158
  </el-row>
320
159
  <div class="footer" v-if="realtimeStatusModalvisible">
321
- <el-button @click="handleClose()">{{
322
- $t('openatccomponents.button.Back')
323
- }}</el-button>
324
- <el-button type="primary" @click="handleManualControl()">{{
325
- $t('openatccomponents.overview.implement')
326
- }}</el-button>
160
+ <el-button @click="handleClose()">{{$t('openatccomponents.button.Back')}}</el-button>
161
+ <el-button type="primary" @click="handleManualControl()">{{$t('openatccomponents.overview.implement')}}</el-button>
327
162
  </div>
328
163
  <div class="footer" v-if="!realtimeStatusModalvisible">
329
- <el-button @click="handleClose()">{{
330
- $t('openatccomponents.button.Back')
331
- }}</el-button>
332
- <el-button type="primary" @click="handleManualControl()">{{
333
- $t('openatccomponents.overview.comfirm')
334
- }}</el-button>
164
+ <el-button @click="handleClose()">{{$t('openatccomponents.button.Back')}}</el-button>
165
+ <el-button type="primary" @click="handleManualControl()">{{$t('openatccomponents.overview.comfirm')}}</el-button>
335
166
  </div>
336
167
  </div>
337
168
  </template>
@@ -384,7 +215,6 @@ export default {
384
215
  return {
385
216
  stagesList: [],
386
217
  phaseRings: [],
387
- keyChange: false,
388
218
  overLapCycle: 0,
389
219
  options: {
390
220
  group: 'pattern'
@@ -392,8 +222,6 @@ export default {
392
222
  max: '',
393
223
  patternCycleEqual: true,
394
224
  activeList: 'ring',
395
- isRing: false,
396
- // isChange: false,
397
225
  ringCount: 1,
398
226
  ringCounts: 1,
399
227
  barriers: [],
@@ -419,137 +247,9 @@ export default {
419
247
  this.initData()
420
248
  },
421
249
  methods: {
422
- addStage (row) {
423
- // this.isChange = false
424
- if (row.length > 15) {
425
- this.$message.error(
426
- this.$t('edge.pattern.mostlist')
427
- )
428
- return
429
- }
430
- if (this.patternOne.length !== 0) {
431
- this.patternOne[0].stagesList.push({
432
- key: row.length,
433
- green: 25,
434
- yellow: 3,
435
- red: 2,
436
- phases: [],
437
- stageSplit: 30
438
- })
439
- } else {
440
- this.planPattern.stagesList.push({
441
- key: row.length,
442
- green: 25,
443
- yellow: 3,
444
- red: 2,
445
- phases: [],
446
- stageSplit: 30
447
- })
448
- }
449
- },
450
- changeRing () {
451
- // this.contrloType = 'stage'
452
- this.isRing = false
453
- // const globalParamModel = this.$store.getters.globalParamModel
454
- // let pattern = globalParamModel.getParamsByType('patternList')
455
- // let pattern = this.allPatternList
456
- this.getCycle()
457
- this.patternOne = this.allPatternList.filter(item => {
458
- return item.id === Number(this.manualInfo.tempPatternid)
459
- })
460
- // if (this.isChange) {
461
- // for (let i = 0; i < pattern.length; i++) {
462
- this.handleStageData(this.patternOne.rings)
463
- // }
464
- // } else {
465
- // for (let i = 0; i < pattern.length; i++) {
466
- // this.setStageList(pattern[i].stagesList, pattern[i].id)
467
- // }
468
- // }
469
- },
470
- changeStage () {
471
- this.isRing = true
472
- this.getStageCycle()
473
- },
474
- getStageCycle () {
475
- // this.patternOne.length === 0 ? this.allPatternList this.patternOne
476
- if (this.patternOne.length === 0) {
477
- this.setStageList(this.planPattern.stagesList, this.planPattern.id)
478
- } else {
479
- // this.patternOne = this.allPatternList.filter(item => {
480
- // return item.id === Number(this.manualInfo.tempPatternid)
481
- // })
482
- this.setStageList(this.patternOne[0].stagesList, this.patternOne[0].id)
483
- }
484
- // let pattern = this.allPatternList
485
- // for (let i = 0; i < pattern.length; i++) {
486
- // this.patternOne[0].cycle = this.changeStageCycle(pattern[i])
487
- // }
488
- },
489
- // changeStageCycle (pattern) {
490
- // let rings = pattern.stagesList
491
- // let stageCycleList = rings.map(item => {
492
- // if (item.stageSplit) {
493
- // return item.stageSplit
494
- // } else {
495
- // return 0
496
- // }
497
- // })
498
- // let maxCycle = stageCycleList.reduce((a, b) => {
499
- // return a + b
500
- // }, 0)
501
- // return maxCycle
502
- // },
503
- setStageList (stageChange, id) {
504
- // let patternList = this.globalParamModel.getParamsByType('patternList')
505
- // let patternList = this.allPatternList
506
- let stagesList = []
507
- for (let i = 0; i < stageChange.length; i++) {
508
- let stage = JSON.parse(JSON.stringify(stageChange[i]))
509
- let stageItem = this.getStageItems(stage.phases, i, stageChange)
510
- stagesList.push(JSON.parse(JSON.stringify(stageItem)))
511
- }
512
- (this.patternOne.length === 0 ? this.planPattern : this.patternOne).map(item => { // 添加特征参数stage
513
- if (item.id === id) {
514
- if (this.isRing) {
515
- item.contrloType = 'stage'
516
- } else {
517
- item.contrloType = 'ring'
518
- }
519
- item.stagesList = JSON.parse(JSON.stringify(stagesList.filter(item => item.stageSplit)))
520
- }
521
- })
522
- this.stagesList = stagesList.filter(item => item.stageSplit)
523
- },
524
- getStageItems (stageArr, i, stageChange) {
525
- let res = {
526
- key: i,
527
- split: this.narr[i], // 阶段绿性比
528
- phases: stageArr,
529
- delaystart: 0,
530
- advanceend: 0
531
- }
532
- for (let rings of stageChange) {
533
- if (i === rings.key) {
534
- res.green = rings.green ? rings.green : rings.green === 0 ? 0 : 25
535
- res.yellow = rings.yellow ? rings.yellow : rings.yellow === 0 ? 0 : 3
536
- res.red = rings.red ? rings.red : rings.red === 0 ? 0 : 2
537
- res.phases = rings.phases ? rings.phases : stageArr
538
- // res.stageSplit = rings.split ? rings.split : 30
539
- if (rings.split) {
540
- res.stageSplit = rings.split
541
- } else if (rings.stageSplit) {
542
- res.stageSplit = rings.stageSplit
543
- } else {
544
- res.stageSplit = 0
545
- }
546
- }
547
- }
548
- return res
549
- },
550
250
  tranform (arr) { // 分barrier
551
251
  let newMap = new Map()
552
- arr.forEach(({ id, current }) => {
252
+ arr.forEach(({id, current}) => {
553
253
  const find = newMap.get(current.join())
554
254
  if (find) newMap.get(current.join()).push(id)
555
255
  else newMap.set(current.join(), [id])
@@ -722,7 +422,7 @@ export default {
722
422
  if (listObj[b]) {
723
423
  const find = retItem.find(r => r.ring === listObj[b])
724
424
  if (find) find.data.push(b)
725
- else retItem.push({ ring: listObj[b], data: [b] })
425
+ else retItem.push({ring: listObj[b], data: [b]})
726
426
  }
727
427
  })
728
428
  ret.push(retItem)
@@ -733,7 +433,6 @@ export default {
733
433
  let Pattern = {
734
434
  offset: 0,
735
435
  cycle: 0,
736
- stagesList: [],
737
436
  rings: [[], [], [], []]
738
437
  }
739
438
  var newPattern = JSON.parse(JSON.stringify(Pattern))
@@ -826,13 +525,13 @@ export default {
826
525
  }
827
526
  },
828
527
  stageSplitChange (diff, rowIndex, subIndex) {
829
- let row = this.patternOne.length === 0 ? this.planPattern : this.patternOne
830
- let ringsList = this.patternOne.length === 0 ? row.stagesList : row[0].stagesList
528
+ let row = this.patternList[rowIndex]
529
+ let ringsList = row.stagesList
831
530
  for (let rings of ringsList) {
832
- // if (subIndex === rings.key) {
833
- rings.stageSplit = (rings.green ? rings.green : 0) + (rings.yellow ? rings.yellow : 0) + (rings.red ? rings.red : 0)
834
- continue
835
- // }
531
+ if (subIndex === rings.key) {
532
+ rings.stageSplit = (rings.green ? rings.green : 0) + (rings.yellow ? rings.yellow : 0) + (rings.red ? rings.red : 0)
533
+ continue
534
+ }
836
535
  }
837
536
  },
838
537
  onStageDelaystartChange (diff, rowIndex, subIndex) {
@@ -884,9 +583,6 @@ export default {
884
583
  this.patternOne = this.allPatternList.filter(item => {
885
584
  return item.id === selectId
886
585
  })
887
- // if (this.patternOne[0].contrloType === 'stage') {
888
- // this.changeStage()
889
- // }
890
586
  this.manualInfo.offset = this.offset
891
587
  for (let rings of this.patternOne[0].rings) {
892
588
  if (rings.length === 0) continue
@@ -1025,13 +721,12 @@ export default {
1025
721
  },
1026
722
  initData () {
1027
723
  // 判断有几个环,就创建几个看板
1028
- // let phaseList = this.globalParamModel.getParamsByType('phaseList')
1029
- // this.coordphaseOption = this.phaseList.map(ele => {
1030
- // return {
1031
- // value: ele.id
1032
- // }
1033
- // })
1034
- this.coordphaseOption = this.phaseList
724
+ // let phaseList = this.globalParamModel.getParamsByType('phaseList')
725
+ this.coordphaseOption = this.phaseList.map(ele => {
726
+ return {
727
+ value: ele.id
728
+ }
729
+ })
1035
730
  // this.overlap = this.globalParamModel.getParamsByType('overlaplList')
1036
731
  // this.agentId = getIframdevid()
1037
732
  let rings = []
@@ -1048,10 +743,10 @@ export default {
1048
743
  this.ringCounts = this.ringCounts.sort(this.sortNumbers) // 把数组中的值按照从小到大的顺序重新排序
1049
744
  this.optimizes = Array.from(new Set(rings)) // 去除数组重复的元素
1050
745
  this.optimizes = this.optimizes.sort(this.sortNumbers) // 把数组中的值按照从小到大的顺序重新排序
1051
- // this.increaseId()
1052
- // this.getCycle()
1053
- // this.updatePhaseDescription()
1054
- // this.getOptionsOfRing()
746
+ // this.increaseId()
747
+ // this.getCycle()
748
+ // this.updatePhaseDescription()
749
+ // this.getOptionsOfRing()
1055
750
  },
1056
751
  sortNumbers (a, b) {
1057
752
  return a - b
@@ -1079,20 +774,6 @@ export default {
1079
774
  }
1080
775
  return isequal
1081
776
  },
1082
- getMaxCycleStage (pattern) {
1083
- let rings = pattern.stagesList
1084
- let stageCycleList = rings.map(item => {
1085
- if (item.stageSplit) {
1086
- return item.stageSplit
1087
- } else {
1088
- return 0
1089
- }
1090
- })
1091
- let maxCycle = stageCycleList.reduce((a, b) => {
1092
- return a + b
1093
- }, 0)
1094
- return maxCycle
1095
- },
1096
777
  getMaxCycle (pattern) {
1097
778
  let rings = pattern.rings
1098
779
  let maxCycle = 0
@@ -1138,31 +819,13 @@ export default {
1138
819
  // duration: this.manualInfo.tempDuration !== undefined ? Number(this.manualInfo.tempDuration) : 0,
1139
820
  data: {}
1140
821
  }
1141
- if (this.manualInfo.tempPatternid) {
1142
- submitdata.terminal = Number(this.manualInfo.tempPatternid)
1143
- }
1144
822
  if (this.patternOne.length === 0) {
1145
- if (this.isRing) {
1146
- submitdata.data.cycle = this.getMaxCycleStage(this.planPattern)
1147
- } else {
1148
- submitdata.data.cycle = this.getMaxCycle(this.planPattern)
1149
- }
1150
- submitdata.data.stagesList = this.planPattern.stagesList
823
+ submitdata.data.cycle = this.getMaxCycle(this.planPattern)
1151
824
  } else {
1152
- if (this.isRing) {
1153
- submitdata.data.cycle = this.getMaxCycleStage(this.patternOne[0])
1154
- } else {
1155
- submitdata.data.cycle = this.getMaxCycle(this.patternOne[0])
1156
- }
1157
- submitdata.data.stagesList = this.patternOne[0].stagesList
825
+ submitdata.data.cycle = this.getMaxCycle(this.patternOne[0])
1158
826
  }
1159
827
  submitdata.data.offset = this.offset
1160
- if (this.patternOne.length === 0) {
1161
- submitdata.data.rings = this.planPattern.rings
1162
- } else {
1163
- submitdata.data.rings = this.patternOne[0].rings
1164
- }
1165
- // submitdata.data.rings = this.patternOne.length === 0 ? this.planPattern.rings : this.patternOne[0].rings
828
+ submitdata.data.rings = this.rings
1166
829
  // this.checkPatternRules(submitdata.data.rings)
1167
830
  if (this.patternCycleEqual) {
1168
831
  this.$emit('closePhaseControl', submitdata)