openatc-components 0.0.62 → 0.0.63

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.0.62",
3
+ "version": "0.0.63",
4
4
  "description": "A Vue.js project",
5
5
  "author": "openatc developer",
6
6
  "private": false,
@@ -22,7 +22,7 @@
22
22
  :modelList="modelList"
23
23
  :patternSelect="patternSelect"
24
24
  :patternAll="patternAll"
25
- :crossStatusData="realtimeStage"
25
+ :crossStatusData="crossStatusData"
26
26
  :phaseList="phaseList"
27
27
  :specialcontrolList="specialcontrolList"
28
28
  :currModel="currModel"
@@ -297,7 +297,6 @@ export default {
297
297
  ignoredFault: [],
298
298
  untreatedFault: [],
299
299
  patternAll: [],
300
- realtimeStage: {},
301
300
  patternSelect: [], // 所有方案id
302
301
  specialPage: '' // 哪一个特殊控制页面
303
302
  }
@@ -344,7 +343,6 @@ export default {
344
343
  await this.getPhase()
345
344
  this.getFault()
346
345
  this.initData()
347
- this.realtimeStages()
348
346
  },
349
347
  methods: {
350
348
  setHost (host) {
@@ -381,9 +379,6 @@ export default {
381
379
  this.faultTimer = null
382
380
  }
383
381
  },
384
- realtimeStages () {
385
- this.realtimeStage = JSON.parse(JSON.stringify(this.statusData))
386
- },
387
382
  initData () {
388
383
  this.crossStatusData = JSON.parse(JSON.stringify(this.statusData))
389
384
  let TscData = JSON.parse(JSON.stringify(this.crossStatusData))
@@ -59,7 +59,7 @@
59
59
  </div>
60
60
  <div class="stage-label">{{$t('openatccomponents.overview.stage')}}:</div>
61
61
  <div style="width: 100%; height: auto;overflow: hidden;">
62
- <Stages :crossStatusData="crossStatusData"
62
+ <Stages :crossStatusData="realtimeStage"
63
63
  :phaseList="phaseList"
64
64
  :isShowCurrentStage="false"
65
65
  @onSelectStages="selectStages"></Stages>
@@ -149,10 +149,20 @@ export default {
149
149
  type: String
150
150
  }
151
151
  },
152
+ watch: {
153
+ crossStatusData: {
154
+ handler: function (val) {
155
+ this.realtimeStage = JSON.parse(JSON.stringify(this.crossStatusData))
156
+ },
157
+ // 深度观察监听
158
+ deep: true
159
+ }
160
+ },
152
161
  data () {
153
162
  return {
154
163
  basicFuncControlId: [0, 1, 4, 5], // 基础功能包含的控制方式: 自主控制(手动下)、黄闪、步进、定周期
155
164
  visible: this.Visible,
165
+ realtimeStage: {},
156
166
  manualInfo: {
157
167
  tempPatternid: '', // 控制方式手动操作的情况下的控制编号的临时值。
158
168
  tempDelay: 0, // 控制方式手动操作的情况下的延迟时间的临时值。
@@ -166,7 +176,7 @@ export default {
166
176
  stages = this.patternAll.filter(item => {
167
177
  return item.id === value
168
178
  })[0].stages
169
- this.crossStatusData.stages = stages
179
+ this.realtimeStage.stages = stages
170
180
  },
171
181
  handleClose () {
172
182
  this.$emit('closeManualModal')
@@ -296,6 +296,7 @@ export default {
296
296
  // }
297
297
  // ],
298
298
  max: '',
299
+ patternCycleEqual: true,
299
300
  activeList: 'ring',
300
301
  ringCount: 1,
301
302
  ringCounts: 1,
@@ -1401,6 +1402,48 @@ export default {
1401
1402
  sortNumbers (a, b) {
1402
1403
  return a - b
1403
1404
  },
1405
+ isRingCycleEqual (rings) {
1406
+ let isequal = true
1407
+ this.patternmsg = []
1408
+ let maxCycle = 0
1409
+ for (let ring of rings) {
1410
+ if (ring.length === 0) continue
1411
+ let cycle = 0
1412
+ for (let r of ring) {
1413
+ if (r.mode === 7) { // 忽略相位不计周期
1414
+ continue
1415
+ }
1416
+ cycle = cycle + r.value
1417
+ }
1418
+ if (cycle > maxCycle && maxCycle === 0) {
1419
+ maxCycle = cycle
1420
+ }
1421
+ if (cycle !== maxCycle) {
1422
+ this.patternmsg.push(rings.id)
1423
+ isequal = false
1424
+ }
1425
+ }
1426
+ return isequal
1427
+ },
1428
+ checkPatternRules (rings) {
1429
+ if (!this.isRingCycleEqual(rings)) {
1430
+ this.patternCycleEqual = false
1431
+ } else {
1432
+ this.patternCycleEqual = true
1433
+ }
1434
+ if (!this.patternCycleEqual) {
1435
+ let mess = `方案${this.patternmsg.toString()}中存在环周期时长不一致`
1436
+ if (this.$i18n.locale === 'en') {
1437
+ mess = `The cycle of each ring is inconsistent in scheme${this.patternmsg.toString()}`
1438
+ }
1439
+ this.$message({
1440
+ message: mess,
1441
+ type: 'error',
1442
+ dangerouslyUseHTMLString: true
1443
+ })
1444
+ return false
1445
+ }
1446
+ },
1404
1447
  handleManualControl () {
1405
1448
  let submitdata = {
1406
1449
  control: 100,
@@ -1412,7 +1455,10 @@ export default {
1412
1455
  submitdata.data.offset = this.offset
1413
1456
  submitdata.data.cycle = this.cycle
1414
1457
  submitdata.data.rings = this.rings
1415
- this.$emit('closePhaseControl', submitdata)
1458
+ this.checkPatternRules(submitdata.data.rings)
1459
+ if (this.patternCycleEqual) {
1460
+ this.$emit('closePhaseControl', submitdata)
1461
+ }
1416
1462
  }
1417
1463
  }
1418
1464
  }