openatc-components 0.4.4 → 0.4.6

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.4.4",
3
+ "version": "0.4.6",
4
4
  "description": "A Vue.js project",
5
5
  "author": "openatc developer",
6
6
  "private": false,
@@ -32,7 +32,7 @@
32
32
  <div class="right-dir-road" v-if="roadDir === 'right'">
33
33
  <div class="centerText" v-if="crossType !== 'Customroads' && isHasPhase">
34
34
  <!-- 相位倒计时 -->
35
- <div class="phaseCountdown" v-show="isShowInterval" v-if="isLoaded && isHasPhase && isHasCountdown" :class="{'countdownBg': isLoaded}">
35
+ <div class="phaseCountdown" v-show="isShowInterval" v-if="isLoaded && isHasPhase && isHasCountdown && contrloType === 'ring'" :class="{'countdownBg': isLoaded}">
36
36
  <div v-for="curPhase in phaseCountdownList" :key="curPhase.id" :style="{color: curPhase.phaseCountdownColor}">
37
37
  <div v-if="curPhase.phaseCountdown !== undefined && curPhase.phaseCountdown !== -1" style="overflow: hidden;margin-bottom: 4px;">
38
38
  <span style="float: left;width: 42px;height: 42px;position: relative;border: 1px solid rgba(255, 255, 255, 0.1);margin-right: 5px;">
@@ -45,15 +45,13 @@
45
45
  </div>
46
46
  <!-- 阶段倒计时 -->
47
47
  <div class="phaseCountdown" v-show="isShowInterval" v-if="isLoaded && contrloType === 'stage'" :class="{'countdownBg': isLoaded}">
48
- <div v-for="curStage in stageCountdownList" :key="curStage.id" :style="{color: curStage.phaseCountdownColor}">
49
- <div style="overflow: hidden;margin-bottom: 4px;">
48
+ <div style="overflow: hidden;margin-bottom: 4px;" :style="{color: stageCountdownList[0].phaseCountdownColor}">
50
49
  <span style="float: left;width: 42px;height: 42px;position: relative;border: 1px solid rgba(255, 255, 255, 0.1);margin-right: 5px;">
51
- <xdr-dir-selector :Data="xdrData" :Datas="xdrpedData" Width="55px" Height="55px" Widths="55px" Heights="55px" :showlist="curStage.showlist" :roadDirection="roadDirection"></xdr-dir-selector>
50
+ <xdr-dir-selector :Data="xdrData" :Datas="xdrpedData" Width="55px" Height="55px" Widths="55px" Heights="55px" :showlist="dirListSetTheme(stageCountdownList)" :roadDirection="roadDirection"></xdr-dir-selector>
52
51
  </span>
53
52
  <span style="float: left;color: #fff;margin-right: 8px;width: 30px;">S{{crossStatusData.current_stage}}:</span>
54
53
  <span style="float: left;font-size: 25px;">{{crossStatusData.current_stagecd}}</span>
55
54
  </div>
56
- </div>
57
55
  </div>
58
56
  <!-- 手动刷新 -->
59
57
  <div v-if="!isLoaded">
@@ -109,7 +107,7 @@
109
107
  <div class="left-dir-road" v-if="roadDir === 'left'">
110
108
  <div class="centerText" v-if="crossType !== 'Customroads' && isHasPhase">
111
109
  <!-- 相位倒计时 -->
112
- <div class="phaseCountdown" v-show="isShowInterval" v-if="isLoaded && isHasPhase && isHasCountdown" :class="{'countdownBg': isLoaded}">
110
+ <div class="phaseCountdown" v-show="isShowInterval" v-if="isLoaded && isHasPhase && isHasCountdown && contrloType === 'ring'" :class="{'countdownBg': isLoaded}">
113
111
  <div v-for="curPhase in phaseCountdownList" :key="curPhase.id" :style="{color: curPhase.phaseCountdownColor}">
114
112
  <div v-if="curPhase.phaseCountdown !== undefined && curPhase.phaseCountdown !== -1" style="overflow: hidden;margin-bottom: 4px;">
115
113
  <span style="float: left;width: 42px;height: 42px;position: relative;border: 1px solid rgba(255, 255, 255, 0.1);margin-right: 5px;">
@@ -117,20 +115,18 @@
117
115
  </span>
118
116
  <span style="float: left;color: #fff;margin-right: 8px;width: 30px;">P{{curPhase.id}}:</span>
119
117
  <span style="float: left;font-size: 25px;">{{curPhase.phaseCountdown}}</span>
118
+ </div>
120
119
  </div>
121
- </div>
122
120
  </div>
123
121
  <!-- 阶段倒计时 -->
124
122
  <div class="phaseCountdown" v-show="isShowInterval" v-if="isLoaded && contrloType === 'stage'" :class="{'countdownBg': isLoaded}">
125
- <div v-for="curStage in stageCountdownList" :key="curStage.id" :style="{color: curStage.phaseCountdownColor}">
126
- <div style="overflow: hidden;margin-bottom: 4px;">
123
+ <div style="overflow: hidden;margin-bottom: 4px;" :style="{color: stageCountdownList[0].phaseCountdownColor}">
127
124
  <span style="float: left;width: 42px;height: 42px;position: relative;border: 1px solid rgba(255, 255, 255, 0.1);margin-right: 5px;">
128
- <xdr-dir-selector :Data="xdrData" :Datas="xdrpedData" Width="55px" Height="55px" Widths="55px" Heights="55px" :showlist="curStage.showlist" :roadDirection="roadDirection"></xdr-dir-selector>
125
+ <xdr-dir-selector :Data="xdrData" :Datas="xdrpedData" Width="55px" Height="55px" Widths="55px" Heights="55px" :showlist="dirListSetTheme(stageCountdownList)" :roadDirection="roadDirection"></xdr-dir-selector>
129
126
  </span>
130
127
  <span style="float: left;color: #fff;margin-right: 8px;width: 30px;">S{{crossStatusData.current_stage}}:</span>
131
128
  <span style="float: left;font-size: 25px;">{{crossStatusData.current_stagecd}}</span>
132
129
  </div>
133
- </div>
134
130
  </div>
135
131
  <!-- 手动刷新 -->
136
132
  <div v-if="!isLoaded">
@@ -203,6 +199,7 @@ import BusMapSvg from './busIcon/busMapSvg'
203
199
  import { getMessageByCode } from '../../../../utils/responseMessage.js'
204
200
 
205
201
  import CrossDirectionConflictList from '../../../../utils/conflictList.js'
202
+ import RingDataModel from '../../../../utils/RingDataModel.js'
206
203
 
207
204
  export default {
208
205
  name: 'crossDiagram',
@@ -391,7 +388,8 @@ export default {
391
388
  left: '1px',
392
389
  top: '1px'
393
390
  },
394
- isHasCountdown: false
391
+ isHasCountdown: false,
392
+ contrloType: 'ring'
395
393
  }
396
394
  },
397
395
  methods: {
@@ -526,11 +524,6 @@ export default {
526
524
  item.id = ''
527
525
  item.phaseCountdownColor = '#fff'
528
526
  })
529
- this.stageCountdownList.forEach(item => {
530
- item.phaseCountdown = ''
531
- item.id = ''
532
- item.phaseCountdownColor = '#fff'
533
- })
534
527
  }
535
528
  if (this.compLanePhaseData.length) {
536
529
  const compLanePhaseData = this.compLanePhaseData.map(data => ({
@@ -730,30 +723,43 @@ export default {
730
723
  })
731
724
  })
732
725
  },
726
+ stagesList () {
727
+ let list = []
728
+ if (this.crossStatusData && this.crossStatusData.stages && this.crossInfo.phaseList && this.crossInfo.phaseList.length > 0) {
729
+ let ringDataModel = new RingDataModel(this.crossStatusData, this.crossInfo.phaseList)
730
+ list = ringDataModel.getStageData()
731
+ if (this.isShowCurrentStage) {
732
+ this.currentStage = this.crossStatusData.current_stage
733
+ }
734
+ }
735
+ return list
736
+ },
737
+ dirListSetTheme (list) {
738
+ let dirArr = []
739
+ for (let rec of list) {
740
+ let recd = {
741
+ ...rec,
742
+ color: '#fff'
743
+ }
744
+ dirArr.push(recd)
745
+ for (let i = 0; i < rec.peddirection.length; i++) {
746
+ rec.peddirection[i].color = 'rgba(255, 255, 255, 0.6)'
747
+ }
748
+ }
749
+ return dirArr
750
+ },
733
751
  getCurStageCountdown () {
734
752
  // 获取当前相位倒计时颜色
735
753
  this.stageCountdownList = []
736
- this.phaseStatusList.forEach(phaseInfo => {
737
- if (phaseInfo.id === this.curStage) {
738
- let countdownObj = {}
739
- countdownObj.id = phaseInfo.id
740
- countdownObj.phaseCountdown = phaseInfo.countdown
741
- countdownObj.phaseCountdownColor = this.ColorMap.get(phaseInfo.type)
742
- let curphasedir = this.phaseDirMap.get(phaseInfo.id)
743
- if (curphasedir !== undefined) {
744
- countdownObj.showlist = curphasedir.direction.map(dir => {
745
- return {
746
- id: dir,
747
- peddirection: this.getshowped(curphasedir.peddirection),
748
- color: '#fff'
749
- }
750
- })
751
- } else {
752
- countdownObj.showlist = []
753
- }
754
- this.stageCountdownList.push(countdownObj)
754
+ let stagesList = this.stagesList()
755
+ this.stageCountdownList = stagesList[this.curStage - 1]
756
+ this.stageCountdownList = this.stageCountdownList.map(phaseInfo => {
757
+ return {
758
+ ...phaseInfo,
759
+ phaseCountdownColor: this.ColorMap.get(phaseInfo.type)
755
760
  }
756
761
  })
762
+ // console.log(this.stageCountdownList)
757
763
  },
758
764
  getshowped (peddirection) {
759
765
  let peddirarr = peddirection.map(peddir => ({
@@ -765,6 +771,7 @@ export default {
765
771
  },
766
772
  getIntersectionInfo () {
767
773
  // 获取路口信息
774
+ this.contrloType = 'ring'
768
775
  const agentid = this.agentId
769
776
  getIntersectionInfo(agentid).then(res => {
770
777
  if (!res.data.success) {
@@ -802,6 +809,10 @@ export default {
802
809
  this.allPatternList = res.data.data.param.patternList
803
810
  if (this.allPatternList[0].rings === undefined || this.allPatternList[0].rings.length === 0) {
804
811
  this.contrloType = 'stage'
812
+ } else if (this.allPatternList[0].contrloType === 'stage') {
813
+ this.contrloType = 'stage'
814
+ } else {
815
+ this.contrloType = 'ring'
805
816
  }
806
817
  })
807
818
  },
@@ -195,8 +195,10 @@ export default class RingDataModel {
195
195
  let currPhaseid = ''
196
196
  let stageControType = 0
197
197
  let peddirections = []
198
+ let phasetype
198
199
  for (let stg of stage) {
199
200
  let phaseMode = data.phase.filter(item => item.id === stg)
201
+ phasetype = phaseMode[0].type
200
202
  let currPhase = this.phaseList.filter((item) => {
201
203
  return item.id === stg
202
204
  })[0]
@@ -235,7 +237,8 @@ export default class RingDataModel {
235
237
  color: '#606266',
236
238
  controltype: stageControType,
237
239
  peddirection: peddirections,
238
- sidewalkPhaseData: sidewalkPhaseData
240
+ sidewalkPhaseData: sidewalkPhaseData,
241
+ type: phasetype
239
242
  }
240
243
  return temp
241
244
  })
@@ -246,7 +249,8 @@ export default class RingDataModel {
246
249
  color: '#606266',
247
250
  controltype: stageControType,
248
251
  peddirection: peddirections,
249
- sidewalkPhaseData: sidewalkPhaseData
252
+ sidewalkPhaseData: sidewalkPhaseData,
253
+ type: phasetype
250
254
  }
251
255
  ]
252
256
  }
@@ -167,7 +167,7 @@ export default {
167
167
  // agentId: '12007_390',
168
168
  // agentId: '12014',
169
169
  reqUrl: 'http://192.168.13.103:10003/openatc',
170
- Token: 'eyJraWQiOiIxNzMwODU1NTQ1NzA3IiwidHlwIjoiSldUIiwiYWxnIjoiSFMyNTYifQ.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTczMDg1OTE0NSwiaWF0IjoxNzMwODUxOTQ1fQ.CBl61S3eRifl4qEtTmgVjOZGo2hqNSGQKPxG1bN-utU',
170
+ Token: 'eyJraWQiOiIxNzM1ODg1MDA0NjQ1IiwidHlwIjoiSldUIiwiYWxnIjoiSFMyNTYifQ.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTczNTg4ODYwNCwiaWF0IjoxNzM1ODgxNDA0fQ.vzRHd88kW3GT_7h8br4Z4xUeFLabjkr3JrIPwhauaHg',
171
171
  // agentId: '30003-352',
172
172
  // reqUrl: 'https://kints-dev.devdolphin.com/openatc',
173
173
  // Token: 'eyJraWQiOiIxNjUwNTA5MDI2ODk2IiwidHlwIjoiSldUIiwiYWxnIjoiSFMyNTYifQ.eyJzdWIiOiJ4aWFvbWluZyIsImV4cCI6MTczNjkwOTAyNiwiaWF0IjoxNjUwNTA5MDI2fQ.-s4T-uMRmB2zf9yer87USKQXLY1a12Zq5lCOnqjNmfA',
@@ -10,7 +10,7 @@
10
10
  :Token="Token"></overview> -->
11
11
  <el-button @click="handleChangeOverview">切换overview组件</el-button>
12
12
  <overview-component
13
- :AgentId="agentId2"
13
+ :AgentId="agentid2"
14
14
  :isShowInterval="isShowInterval"
15
15
  :isShowMessage ="isShowMessage"/>
16
16
  </div>
@@ -26,11 +26,11 @@ export default {
26
26
  controlName: '步进',
27
27
  agentId: '13013',
28
28
  agentid1: 'gjnlahql',
29
- agentid2: '12007_390',
29
+ agentid2: 'xylsnl',
30
30
  isShowMessage: false,
31
31
  isShowInterval: true,
32
32
  sum: 0,
33
- Token: 'eyJraWQiOiIxNzMzODg3MDYyMjgwIiwidHlwIjoiSldUIiwiYWxnIjoiSFMyNTYifQ.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTczMzg5MDY2MiwiaWF0IjoxNzMzODgzNDYyfQ.qUJZ4lKv0WU3s3lWfYwl5ZM77n2rriYeFQ8qOwRFuzk',
33
+ Token: 'eyJraWQiOiIxNzM1ODg1MDA0NjQ1IiwidHlwIjoiSldUIiwiYWxnIjoiSFMyNTYifQ.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTczNTg4ODYwNCwiaWF0IjoxNzM1ODgxNDA0fQ.vzRHd88kW3GT_7h8br4Z4xUeFLabjkr3JrIPwhauaHg',
34
34
  reqUrl: 'http://192.168.13.103:10003/openatc',
35
35
  isOnlyMap: true
36
36
  }
@@ -1,2 +0,0 @@
1
- import OptimizeKanban from './OptimizeKanban.vue'
2
- export default OptimizeKanban
@@ -1,369 +0,0 @@
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
- **/
12
- <template>
13
- <div class="kanbanOptimize">
14
- <div v-if="this.nowNumber === 1" class="optimizetype">
15
- <span>{{$t('openatccomponents.pattern.optimizetype')}}</span>
16
- <el-select v-model="value" clearable :placeholder="$t('openatccomponents.common.select')">
17
- <el-option
18
- v-for="item in typeOptions"
19
- :key="item.value"
20
- :label="$t('openatccomponents.overview.type' + item.value)"
21
- :value="item.value"
22
- >
23
- </el-option>
24
- </el-select>
25
- <span class="optimiNum">{{$t('openatccomponents.pattern.optimizecycle')}}</span>
26
- <el-input v-model="optimizecycle" clearable :placeholder="$t('openatccomponents.common.enter')"></el-input>
27
- <!-- <el-button type="primary" @click="onOptimizeClick()">{{$t('openatccomponents.pattern.inoptimize')}}</el-button> -->
28
- </div>
29
- <div class="common-board-column" :style="{marginTop:this.nowNumber === 1 ? 0 : '50px',marginLeft:this.nowNumber === 1 ? 0 : 0}">
30
- <div class="common-board-column-header">
31
- {{headerText}}
32
- </div>
33
- <div class="openatccomponents-board-table-header">
34
- <el-row :gutter="13">
35
- <el-col :span="4">{{this.$t('openatccomponents.overview.phase')}}
36
- </el-col>
37
- <el-col :span="10">{{this.$t('openatccomponents.overview.flow')}}
38
- </el-col>
39
- <el-col :span="10">{{this.$t('openatccomponents.overview.saturationflow')}}
40
- </el-col>
41
- </el-row>
42
- </div>
43
- <draggable
44
- class="common-board-column-content"
45
- :list="list"
46
- :options="options">
47
- <div class="common-board-item" v-for="element in list" :key="element.id">
48
- <el-row :gutter="13">
49
- <el-col :span="4">
50
- <el-tooltip class="item" effect="dark" placement="left">
51
- <div slot="content">{{element.name}}</div>
52
- <div class="common-phase-description">
53
- <xdrdirselector Width="70px" Height="70px" Widths="58px" Heights="58px" :Datas="styles" :Data="showStyle" :showlist="element.desc" :ISActiveMask="ISActiveMask" :MaskColor="MaskColor"></xdrdirselector>
54
- </div>
55
- </el-tooltip>
56
- </el-col>
57
- <el-col :span="10">
58
- <el-input-number :controls="false" class="col-content" size="small" :step="1" v-model.number="element.flowperhour" ref="type" :disabled="element.mode === 7"></el-input-number>
59
- </el-col>
60
- <el-col :span="10">
61
- <el-input-number :controls="false" class="col-content" size="small" :step="1" v-model.number="element.saturation" ref="types" :disabled="element.mode === 7"></el-input-number>
62
- </el-col>
63
- </el-row>
64
- </div>
65
- </draggable>
66
- </div>
67
- </div>
68
- </template>
69
- <script>
70
- import draggable from 'vuedraggable'
71
- import { getDuration } from '@/api/cross'
72
- import xdrdirselector from '@/components/XRDDirSelector'
73
-
74
- export default {
75
- name: 'patternOptimize',
76
- components: {
77
- draggable,
78
- xdrdirselector
79
- },
80
- data () {
81
- return {
82
- showStyle: {
83
- left: '7px',
84
- top: '0px'
85
- },
86
- styles: {
87
- left: '7px',
88
- top: '0px'
89
- },
90
- typeOptions: [{
91
- value: 'flow-split-opt'
92
- }, {
93
- value: 'cycle-opt'
94
- }],
95
- value: 'flow-split-opt',
96
- optimizecycle: 0
97
- }
98
- },
99
- props: {
100
- headerText: {
101
- type: String,
102
- default: 'Header'
103
- },
104
- id: {
105
- type: Number
106
- },
107
- rings: {
108
- type: Array
109
- },
110
- nowNumber: {
111
- type: Number
112
- },
113
- phaseList: {
114
- type: Array
115
- },
116
- options: {
117
- type: Object,
118
- default () {
119
- return {}
120
- }
121
- },
122
- list: {
123
- type: Array,
124
- default () {
125
- return []
126
- }
127
- },
128
- // index: {
129
- // type: Number
130
- // },
131
- ISActiveMask: {
132
- type: Boolean,
133
- default: true
134
- },
135
- // 当phase的描述为空时,显示的图形颜色。
136
- MaskColor: {
137
- type: String,
138
- default: '#000000'
139
- }
140
- },
141
- created () {
142
- // this.addMinSplit()
143
- this.addMin()
144
- },
145
- computed () {
146
-
147
- },
148
- watch: {
149
- list: {
150
- handler: function () {
151
- // let list = this.$refs.type
152
- // let flow = this.$refs.types
153
- // console.log(this.list, 'list')
154
- // let cycle = 0
155
- // let n = this.index
156
- // for (let i = 0; i < list.length; i++) {
157
- // cycle = cycle + Number(list[i].currentValue)
158
- // }
159
- // const globalParamModel = this.$store.getters.globalParamModel
160
- // // let MaxCycle = globalParamModel.getParamsByType('patternList')[n].cycle
161
- // let pattern = globalParamModel.getParamsByType('patternList')[n]
162
- // globalParamModel.getParamsByType('patternList')[n].cycle = this.getMaxCycle(pattern)
163
- // this.addMinSplit()
164
- // this.$emit('handleSplit', n)
165
- },
166
- deep: true
167
- }
168
- },
169
- methods: {
170
- onOptimizeClick () {
171
- let msg = this.$t('openatccomponents.pattern.algorithmEngineOptimization')
172
- const loading = this.$loading({
173
- lock: true,
174
- text: msg,
175
- spinner: 'el-icon-loading',
176
- background: 'rgba(0, 0, 0, 0.7)'
177
- })
178
- setTimeout(() => {
179
- loading.close()
180
- this.handeleOptimizeClick()
181
- }, 1000)
182
- },
183
- handeleOptimizeClick () {
184
- let newPha = []
185
- for (let i = 0; i < this.rings.length; i++) {
186
- newPha.push(...this.rings[i])
187
- }
188
- let phaseData = newPha.map(item => {
189
- return {
190
- id: item.id,
191
- flowperhour: item.flowperhour,
192
- saturation: item.saturation
193
- }
194
- })
195
- let patternList = this.$store.state.globalParam.tscParam.patternList
196
- let pattern = patternList.filter((item) => item.id === this.id)[0]
197
- let reqData = {
198
- 'type': this.value,
199
- 'optcycle': this.optimizecycle ? this.optimizecycle : 0,
200
- 'phaseList': this.phaseList,
201
- 'pattern': pattern,
202
- 'phases': phaseData
203
- }
204
- let isValidata = []
205
- for (let j = 0; j < newPha.length; j++) {
206
- let comNum = (newPha[j].length / 4) * 1700 * 0.8
207
- isValidata.push(newPha[j].flowperhour > comNum)
208
- }
209
- if (isValidata.includes(true)) {
210
- this.$confirm(this.$t('openatccomponents.overview.maxFlow'),
211
- this.$t('openatccomponents.common.alarm'), {
212
- confirmButtonText: this.$t('eopenatccomponentsdge.common.confirm'),
213
- cancelButtonText: this.$t('openatccomponents.common.cancel'),
214
- type: 'warning'
215
- }).then(() => {
216
- getDuration(reqData).then(data => {
217
- if (data.data.success) {
218
- this.$message({
219
- type: 'success',
220
- message: this.$t('openatccomponents.pattern.success')
221
- })
222
- for (let i = 0; i < this.rings.length; i++) {
223
- for (let j = 0; j < this.rings[i].length; j++) {
224
- for (let h = 0; h < data.data.data.phase.length; h++) {
225
- if (this.rings[i][j].id === data.data.data.phase[h].id) {
226
- this.rings[i][j].value = data.data.data.phase[h].duration
227
- // this.rings[i][j].cycle = data.data.data.phase[h].cycle
228
- }
229
- }
230
- }
231
- }
232
- }
233
- }).catch(error => {
234
- console.log(error)
235
- })
236
- }).catch(() => {
237
- })
238
- } else {
239
- getDuration(reqData).then(data => {
240
- if (data.data.success) {
241
- this.$message({
242
- type: 'success',
243
- message: this.$t('openatccomponents.pattern.success')
244
- })
245
- for (let i = 0; i < this.rings.length; i++) {
246
- for (let j = 0; j < this.rings[i].length; j++) {
247
- for (let h = 0; h < data.data.data.phase.length; h++) {
248
- if (this.rings[i][j].id === data.data.data.phase[h].id) {
249
- this.rings[i][j].value = data.data.data.phase[h].duration
250
- // this.rings[i][j].cycle = data.data.data.phase[h].cycle
251
- }
252
- }
253
- }
254
- }
255
- }
256
- }).catch(error => {
257
- console.log(error)
258
- })
259
- }
260
- },
261
- addMin () {
262
- for (let i of this.list) {
263
- if (!i.flowperhour || !i.saturation) {
264
- i.length = this.list.length
265
- i.flowperhour = 0
266
- i.saturation = 1700
267
- }
268
- }
269
- }
270
- // addMinSplit () {
271
- // const globalParamModel = this.$store.getters.globalParamModel
272
- // let phaseList = globalParamModel.getParamsByType('phaseList')
273
- // for (let ls of this.list) {
274
- // let phase = phaseList.filter((item) => {
275
- // return item.id === ls.id
276
- // })[0]
277
- // if (!phase.redyellow) {
278
- // phase.redyellow = 0
279
- // }
280
- // if (!phase.yellow) {
281
- // phase.yellow = 0
282
- // }
283
- // if (!phase.redclear) {
284
- // phase.redclear = 0
285
- // }
286
- // if (!phase.flashgreen) {
287
- // phase.flashgreen = 0
288
- // }
289
- // if (!phase.phasewalk) {
290
- // phase.phasewalk = 0
291
- // }
292
- // if (!phase.pedclear) {
293
- // phase.pedclear = 0
294
- // }
295
- // // let temp1 = phase.redyellow + phase.yellow + phase.redclear + phase.flashgreen // 绿信比的最小值要大于最小绿+黄灯+全红+绿闪
296
- // // let temp2 = phase.phasewalk + phase.pedclear
297
- // // if (temp1 > temp2) {
298
- // // ls.minSplit = temp1
299
- // // } else {
300
- // // ls.minSplit = temp2
301
- // // }
302
- // // if (ls.mode !== 7 && ls.value < ls.minSplit) {
303
- // // ls.value = ls.minSplit
304
- // // }
305
- // // let temp1 = phase.yellow + phase.redclear + phase.flashgreen // 绿信比的最小值要大于最小绿+黄灯+全红+绿闪
306
- // let temp1 = phase.yellow + phase.redclear + phase.mingreen
307
- // let temp2 = phase.yellow + phase.redclear + phase.phasewalk + phase.pedclear
308
- // ls.minSplit = temp1 > temp2 ? temp1 : temp2
309
- // if (ls.mode !== 7 && ls.value < ls.minSplit) {
310
- // ls.value = ls.minSplit
311
- // this.$message.error(this.$t('openatccomponents.pattern.splitCheckMsg'))
312
- // }
313
- // }
314
- // },
315
- // getMaxCycle (pattern) {
316
- // let rings = pattern.rings
317
- // let maxCycle = 0
318
- // for (let ring of rings) {
319
- // if (ring.length === 0) continue
320
- // let cycle = 0
321
- // for (let r of ring) {
322
- // if (r.mode === 7) { // 忽略相位不计周期
323
- // continue
324
- // }
325
- // cycle = cycle + r.value
326
- // }
327
- // if (cycle > maxCycle) {
328
- // maxCycle = cycle
329
- // }
330
- // }
331
- // return maxCycle
332
- // },
333
- // doChange (val) {
334
- // // if (val.mode === 7) {
335
- // // val.value = 0
336
- // // } else {
337
- // // val.value = 30
338
- // // }
339
- // }
340
- }
341
- }
342
- </script>
343
- <style lang="scss" scoped>
344
- .col-content {
345
- width: 100%;
346
- }
347
- .kanbanOptimize {
348
- .common-board-column {
349
- max-width: unset !important;
350
- }
351
- }
352
- .optimizetype{
353
- // float: left;
354
- font-size: 14PX;
355
- margin:0 0 10PX 0;
356
- .el-input {
357
- width: 80PX;
358
- }
359
- .el-select{
360
- width: 145PX;
361
- }
362
- .el-button {
363
- margin-left: 10PX;
364
- }
365
- .optimiNum {
366
- padding-left: 10PX;
367
- }
368
- }
369
- </style>
@@ -1 +0,0 @@
1
- {}