openatc-components 0.3.67 → 0.3.70
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/kisscomps/components/BoardCard/BoardCard.vue +0 -11
- package/package/kisscomps/components/OverviewComponent/index.js +2 -0
- package/package/kisscomps/components/OverviewComponent/index.vue +771 -0
- package/package/kisscomps/components/PatternOptimize/PatternOptimize.vue +2 -11
- package/package/kisscomps/components/PatternStatus/PatternStatus.vue +8 -83
- package/package/kisscomps/components/patternList/patternList.vue +0 -11
- package/package/kisscomps/index.js +3 -1
- package/package/kissui.min.js +1 -1
- package/package.json +1 -1
- package/src/i18n/language/en.js +9 -4
- package/src/i18n/language/zh.js +9 -4
- package/src/kisscomps/components/BoardCard/BoardCard.vue +0 -11
- package/src/kisscomps/components/OverviewComponent/index.js +2 -0
- package/src/kisscomps/components/OverviewComponent/index.vue +771 -0
- package/src/kisscomps/components/PatternOptimize/PatternOptimize.vue +2 -11
- package/src/kisscomps/components/PatternStatus/PatternStatus.vue +8 -83
- package/src/kisscomps/components/patternList/patternList.vue +0 -11
- package/src/kisscomps/index.js +3 -1
- package/src/views/intersection.vue +1 -1
- package/src/views/overView.vue +4 -3
- package/package/kisscomps/components/OptimizeKanban/index.js +0 -2
- package/package/kisscomps/components/OptimizeKanban/index.vue +0 -369
- package/src/node_modules/.package_versions.json +0 -1
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
<el-tooltip class="item" effect="dark" placement="left">
|
|
51
51
|
<div slot="content">{{element.name}}</div>
|
|
52
52
|
<div class="common-phase-description">
|
|
53
|
-
<xdrdirselector Width="70px" Height="70px" Widths="
|
|
53
|
+
<xdrdirselector Width="70px" Height="70px" Widths="50px" Heights="50px" :Data="styles" :showlist="element.desc" :ISActiveMask="ISActiveMask" :MaskColor="MaskColor"></xdrdirselector>
|
|
54
54
|
</div>
|
|
55
55
|
</el-tooltip>
|
|
56
56
|
</el-col>
|
|
@@ -79,13 +79,9 @@ export default {
|
|
|
79
79
|
},
|
|
80
80
|
data () {
|
|
81
81
|
return {
|
|
82
|
-
showStyle: {
|
|
83
|
-
left: '2px',
|
|
84
|
-
top: '0px'
|
|
85
|
-
},
|
|
86
82
|
styles: {
|
|
87
83
|
left: '1px',
|
|
88
|
-
top: '
|
|
84
|
+
top: '0'
|
|
89
85
|
},
|
|
90
86
|
typeOptions: [{
|
|
91
87
|
value: 'flow-split-opt'
|
|
@@ -101,9 +97,6 @@ export default {
|
|
|
101
97
|
type: String,
|
|
102
98
|
default: 'Header'
|
|
103
99
|
},
|
|
104
|
-
id: {
|
|
105
|
-
type: Number
|
|
106
|
-
},
|
|
107
100
|
rings: {
|
|
108
101
|
type: Object
|
|
109
102
|
},
|
|
@@ -216,7 +209,6 @@ export default {
|
|
|
216
209
|
}
|
|
217
210
|
}
|
|
218
211
|
}
|
|
219
|
-
this.$emit('optimizesucess', this.id)
|
|
220
212
|
}
|
|
221
213
|
}).catch(error => {
|
|
222
214
|
console.log(error)
|
|
@@ -240,7 +232,6 @@ export default {
|
|
|
240
232
|
}
|
|
241
233
|
}
|
|
242
234
|
}
|
|
243
|
-
this.$emit('optimizesucess', this.id)
|
|
244
235
|
}
|
|
245
236
|
}).catch(error => {
|
|
246
237
|
console.log(error)
|
|
@@ -14,9 +14,8 @@
|
|
|
14
14
|
<!-- 环模式true -->
|
|
15
15
|
<div v-if="this.contrloType === 'ring' || !this.contrloType">
|
|
16
16
|
<div class="ring-first" v-for="(list, index1) in patternInfo" :key="index1">
|
|
17
|
-
<
|
|
18
|
-
<div
|
|
19
|
-
<div class="first-1" :class="item.mode === 8 ? 'mask' : item.mode === 9 ? 'yellowClass' : ''" :style="{'width':Number(item.greenWidth.replace('%', ''))/Number((((item.split+(item.sum?item.sum:0)) / (max?max:item.cycle) * 100) + '%').replace('%', ''))*100+'%','height':'34px','background':'#7ccc66'}">
|
|
17
|
+
<div style="position: relative;" :style="{'height': '34px','float':'left','width':((item.split+(item.sum?item.sum:0)) / (max?max:item.cycle) * 100) + '%'}" v-for="(item,index2) in list" :key="index2" :class="item.mode===7?'direction': ''">
|
|
18
|
+
<div class="first-1" :class="item.mode === 8 ? 'mask' : item.mode === 9 ? 'yellowClass' : ''" :style="{'width':Number(item.greenWidth.replace('%', ''))/Number((((item.split+(item.sum?item.sum:0)) / (max?max:item.cycle) * 100) + '%').replace('%', ''))*100+'%','height':'34px','background':'#7ccc66'}">
|
|
20
19
|
<el-tooltip placement="top-start" effect="light">
|
|
21
20
|
<div slot="content">{{$t('openatccomponents.phase.phase')}}{{item.id}}:{{item.split}}</div>
|
|
22
21
|
<div style="cursor:pointer;">
|
|
@@ -26,18 +25,7 @@
|
|
|
26
25
|
</div>
|
|
27
26
|
<div v-if="isShowTip" class="box" style="position: absolute; left:40px; width:40px; top: -1px;">
|
|
28
27
|
<div class="ring-nums">{{$t('openatccomponents.phase.phase')}}{{item.id}}</div>
|
|
29
|
-
<div
|
|
30
|
-
<el-input-number
|
|
31
|
-
v-if="!isMove"
|
|
32
|
-
class="ring-nums"
|
|
33
|
-
size="small"
|
|
34
|
-
:controls="false"
|
|
35
|
-
:min="0"
|
|
36
|
-
:step="1"
|
|
37
|
-
v-model.number="item.split"
|
|
38
|
-
@change="handleEdit(item)"
|
|
39
|
-
style="width: 24px"
|
|
40
|
-
></el-input-number>
|
|
28
|
+
<div class="ring-nums">{{item.split}}</div>
|
|
41
29
|
</div>
|
|
42
30
|
</div>
|
|
43
31
|
</el-tooltip>
|
|
@@ -53,8 +41,7 @@
|
|
|
53
41
|
<div class="first-1" :class="item.mode === 8 ? 'mask' : item.mode === 9 ? 'yellowClass' : ''" :style="{'width':Number(item.flashgreen.replace('%', ''))/Number((((item.split+(item.sum?item.sum:0)) / (max?max:item.cycle) * 100).toFixed(3) + '%').replace('%', ''))*100+'%','height':'34px','float':'left','background': 'linear-gradient(to right, #ffffff 50%, #7ccc66 0)','background-size': '4px 100%'}"></div>
|
|
54
42
|
<div class="first-1" :class="item.mode === 8 ? 'mask' : item.mode === 9 ? 'yellowClass' : ''" :style="{'width':Number(item.yellowWidth.replace('%', ''))/Number((((item.split+(item.sum?item.sum:0)) / (max?max:item.cycle) * 100) + '%').replace('%', ''))*100+'%','height':'34px','background':'#f9dc6a'}"></div>
|
|
55
43
|
<div class="first-1" :class="item.mode === 8 ? 'mask' : item.mode === 9 ? 'yellowClass' : ''" :style="{'width':Number(item.redWidth.replace('%', ''))/Number((((item.split+(item.sum?item.sum:0)) / (max?max:item.cycle) * 100).toFixed(3) + '%').replace('%', ''))*100+'%','height':'34px','background':'#f27979'}"></div>
|
|
56
|
-
|
|
57
|
-
</draggable>
|
|
44
|
+
</div>
|
|
58
45
|
</div>
|
|
59
46
|
<div v-if="showBarrier">
|
|
60
47
|
<div v-for="(item, index) in barrierList" :key="index + '1'">
|
|
@@ -113,7 +100,6 @@
|
|
|
113
100
|
<script>
|
|
114
101
|
// import patternwalksvg from '../PatternWalkSvg/PatternWalkSvg'
|
|
115
102
|
import xdrdirselector from '../XRDDirSelector/XRDDirSelector'
|
|
116
|
-
import draggable from 'vuedraggable'
|
|
117
103
|
// import PatternWalkSvg from '../IntersectionMap/crossDirection/baseImg/PatternWalkSvg'
|
|
118
104
|
import PhaseDataModel from '../IntersectionMap/crossDirection/utils.js'
|
|
119
105
|
import CrossDiagramMgr from '../../../EdgeMgr/controller/crossDiagramMgr.js'
|
|
@@ -121,7 +107,6 @@ export default {
|
|
|
121
107
|
name: 'pattern-list',
|
|
122
108
|
components: {
|
|
123
109
|
// patternwalksvg,
|
|
124
|
-
draggable,
|
|
125
110
|
xdrdirselector
|
|
126
111
|
},
|
|
127
112
|
data () {
|
|
@@ -129,7 +114,6 @@ export default {
|
|
|
129
114
|
barrierHeight: '',
|
|
130
115
|
stageCycle: '',
|
|
131
116
|
barrierList: [],
|
|
132
|
-
barrierArr: [],
|
|
133
117
|
newCycle: this.cycles,
|
|
134
118
|
patternIds: this.patternId,
|
|
135
119
|
newPatterns: [],
|
|
@@ -158,10 +142,6 @@ export default {
|
|
|
158
142
|
stagesChange: {
|
|
159
143
|
type: Array
|
|
160
144
|
},
|
|
161
|
-
isMove: {
|
|
162
|
-
type: Boolean,
|
|
163
|
-
default: true
|
|
164
|
-
},
|
|
165
145
|
controlPhase: {
|
|
166
146
|
type: Object
|
|
167
147
|
},
|
|
@@ -363,11 +343,11 @@ export default {
|
|
|
363
343
|
handler: function (val, oldVal) {
|
|
364
344
|
this.handleBarrierHeight() // 计算屏障高度
|
|
365
345
|
if (this.patternStatusList && this.newCycle) {
|
|
366
|
-
|
|
367
|
-
|
|
346
|
+
setTimeout(() => {
|
|
347
|
+
this.handleCurrentChange(this.patternStatusList)
|
|
348
|
+
this.handleBarrierHeight()
|
|
349
|
+
}, 10)
|
|
368
350
|
this.handleBarrierHeight()
|
|
369
|
-
// }, 10)
|
|
370
|
-
// this.handleBarrierHeight()
|
|
371
351
|
}
|
|
372
352
|
},
|
|
373
353
|
// 深度观察监听
|
|
@@ -395,60 +375,6 @@ export default {
|
|
|
395
375
|
}
|
|
396
376
|
},
|
|
397
377
|
methods: {
|
|
398
|
-
move (e) {
|
|
399
|
-
// 这里的e表示即将停靠的元素。
|
|
400
|
-
let result = this.barrierArr.filter(item => item.includes(e.relatedContext.element.id))[0]
|
|
401
|
-
if (!result.includes(e.draggedContext.element.id)) {
|
|
402
|
-
return false
|
|
403
|
-
}
|
|
404
|
-
},
|
|
405
|
-
endDrag (index) {
|
|
406
|
-
// 拖动后对原数据排序
|
|
407
|
-
const idIndexMap = {}
|
|
408
|
-
this.patternInfo.forEach((subArray, subArrayIndex) => {
|
|
409
|
-
subArray.forEach((item, index) => {
|
|
410
|
-
idIndexMap[item.id] = { subArrayIndex, index }
|
|
411
|
-
})
|
|
412
|
-
})
|
|
413
|
-
this.patternStatusList.forEach((subArray, subArrayIndex) => {
|
|
414
|
-
if (subArray.length > 0) {
|
|
415
|
-
subArray.sort((aItem, bItem) => {
|
|
416
|
-
const aIndex = idIndexMap[aItem.id] ? idIndexMap[aItem.id].index : Infinity
|
|
417
|
-
const bIndex = idIndexMap[bItem.id] ? idIndexMap[bItem.id].index : Infinity
|
|
418
|
-
return aIndex - bIndex
|
|
419
|
-
})
|
|
420
|
-
}
|
|
421
|
-
})
|
|
422
|
-
},
|
|
423
|
-
handleEdit (val) {
|
|
424
|
-
this.patternStatusList.map(d => {
|
|
425
|
-
d.map(r => {
|
|
426
|
-
if (r.id === val.id) {
|
|
427
|
-
r.value = val.split
|
|
428
|
-
}
|
|
429
|
-
})
|
|
430
|
-
})
|
|
431
|
-
// this.handleCurrentChange(this.patternStatusList)
|
|
432
|
-
this.$emit('handleSplitMove', this.patternId)
|
|
433
|
-
},
|
|
434
|
-
getMaxCycle (pattern) {
|
|
435
|
-
// let rings = pattern.rings
|
|
436
|
-
let maxCycle = 0
|
|
437
|
-
for (let ring of pattern) {
|
|
438
|
-
if (ring.length === 0) continue
|
|
439
|
-
let cycle = 0
|
|
440
|
-
for (let r of ring) {
|
|
441
|
-
if (r.mode === 7) { // 忽略相位不计周期
|
|
442
|
-
continue
|
|
443
|
-
}
|
|
444
|
-
cycle = cycle + r.value
|
|
445
|
-
}
|
|
446
|
-
if (cycle > maxCycle) {
|
|
447
|
-
maxCycle = cycle
|
|
448
|
-
}
|
|
449
|
-
}
|
|
450
|
-
return maxCycle
|
|
451
|
-
},
|
|
452
378
|
getPed (data) {
|
|
453
379
|
let ped = []
|
|
454
380
|
for (let stg of data) {
|
|
@@ -1253,7 +1179,6 @@ export default {
|
|
|
1253
1179
|
}
|
|
1254
1180
|
}
|
|
1255
1181
|
let resArr = ringArr.map(item => item.data)
|
|
1256
|
-
this.barrierArr = resArr
|
|
1257
1182
|
let ringTeam = this.step1(this.phaseList, resArr)
|
|
1258
1183
|
let ringTeams = ringTeam.filter(item => item.length !== 0)
|
|
1259
1184
|
if (this.patternList) {
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
:contrloType="contrloType"
|
|
6
6
|
:stagesChange="stagesChange"
|
|
7
7
|
:isShowTip="isShowTip"
|
|
8
|
-
:isMove="isMove"
|
|
9
8
|
:patternStatusList="patternStatusList"
|
|
10
9
|
:cycles="cycles"
|
|
11
10
|
:cycle="cycle"
|
|
@@ -20,7 +19,6 @@
|
|
|
20
19
|
:agentId="agentId"
|
|
21
20
|
:controlData="controlData"
|
|
22
21
|
:syncTime="syncTime"
|
|
23
|
-
@handleSplitMove="handleSplitMove"
|
|
24
22
|
:isPhase="isPhase"
|
|
25
23
|
>
|
|
26
24
|
</BoardCard>
|
|
@@ -504,10 +502,6 @@ export default {
|
|
|
504
502
|
type: Boolean,
|
|
505
503
|
default: true
|
|
506
504
|
},
|
|
507
|
-
isMove: {
|
|
508
|
-
type: Boolean,
|
|
509
|
-
default: true
|
|
510
|
-
},
|
|
511
505
|
contrloType: {
|
|
512
506
|
type: String
|
|
513
507
|
},
|
|
@@ -587,11 +581,6 @@ export default {
|
|
|
587
581
|
// if (this.$route.query !== undefined && Object.keys(this.$route.query).length) {
|
|
588
582
|
// this.resetCrossDiagram()
|
|
589
583
|
// }
|
|
590
|
-
},
|
|
591
|
-
methods: {
|
|
592
|
-
handleSplitMove (data) {
|
|
593
|
-
this.$emit('handleSplitMove', data)
|
|
594
|
-
}
|
|
595
584
|
}
|
|
596
585
|
}
|
|
597
586
|
</script>
|
package/src/kisscomps/index.js
CHANGED
|
@@ -32,6 +32,7 @@ import XiaoKanBan from './components/XiaoKanBan/index.vue'
|
|
|
32
32
|
import DirectionListConfiguration from './components/DirectionListConfiguration/index.js'
|
|
33
33
|
import IntersectionDirectionSelection from './components/IntersectionDirectionSelection/index.js'
|
|
34
34
|
import PhaseLegend from './components/PhaseLegend/index.js'
|
|
35
|
+
import OverviewComponent from './components/OverviewComponent/index.js'
|
|
35
36
|
import { setToken, setHost, setIsCheckPermission, setUserRoles, setPermissions } from '../utils/auth.js'
|
|
36
37
|
import componentsGlobalParam from '../store/modules/globalParam'
|
|
37
38
|
|
|
@@ -73,7 +74,8 @@ const components = {
|
|
|
73
74
|
PhaseDirectionSelect,
|
|
74
75
|
DirectionListConfiguration,
|
|
75
76
|
IntersectionDirectionSelection,
|
|
76
|
-
PhaseLegend
|
|
77
|
+
PhaseLegend,
|
|
78
|
+
OverviewComponent
|
|
77
79
|
}
|
|
78
80
|
|
|
79
81
|
const language = {
|
|
@@ -166,7 +166,7 @@ export default {
|
|
|
166
166
|
// agentId: '12007_390',
|
|
167
167
|
// agentId: '12014',
|
|
168
168
|
reqUrl: 'http://192.168.13.103:10003/openatc',
|
|
169
|
-
Token: '
|
|
169
|
+
Token: 'eyJraWQiOiIxNzI5NjcyNzM2MjAzIiwidHlwIjoiSldUIiwiYWxnIjoiSFMyNTYifQ.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTcyOTY3NjMzNiwiaWF0IjoxNzI5NjY5MTM2fQ.cBsomsqXJxoEazdEVL-T6DfXeKwWrbQHNb4aA-MSdug',
|
|
170
170
|
// agentId: '30003-352',
|
|
171
171
|
// reqUrl: 'https://kints-dev.devdolphin.com/openatc',
|
|
172
172
|
// Token: 'eyJraWQiOiIxNjUwNTA5MDI2ODk2IiwidHlwIjoiSldUIiwiYWxnIjoiSFMyNTYifQ.eyJzdWIiOiJ4aWFvbWluZyIsImV4cCI6MTczNjkwOTAyNiwiaWF0IjoxNjUwNTA5MDI2fQ.-s4T-uMRmB2zf9yer87USKQXLY1a12Zq5lCOnqjNmfA',
|
package/src/views/overView.vue
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div id="test1">
|
|
3
|
-
<overview
|
|
3
|
+
<!-- <overview
|
|
4
4
|
:AgentId="agentId"
|
|
5
5
|
:reqUrl="reqUrl"
|
|
6
6
|
:modeName="modeName"
|
|
7
7
|
:controlName="controlName"
|
|
8
8
|
:isShowState="isShowState"
|
|
9
9
|
:isShowMode="isShowMode"
|
|
10
|
-
:Token="Token"></overview>
|
|
10
|
+
:Token="Token"></overview> -->
|
|
11
|
+
<overview-component :AgentId="agentId" />
|
|
11
12
|
</div>
|
|
12
13
|
</template>
|
|
13
14
|
|
|
@@ -19,7 +20,7 @@ export default {
|
|
|
19
20
|
isShowMode: true,
|
|
20
21
|
modeName: '交警遥控',
|
|
21
22
|
controlName: '步进',
|
|
22
|
-
agentId: '
|
|
23
|
+
agentId: '12008_ticp',
|
|
23
24
|
Token: 'eyJraWQiOiIxNzA4OTA5NDk2ODcxIiwidHlwIjoiSldUIiwiYWxnIjoiSFMyNTYifQ.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTcwODk1MjY5NiwiaWF0IjoxNzA4OTA5NDk2fQ.FI0gzBQFLyQsj95LG56lVZxb6WYlr2-datNsyv6fF-I',
|
|
24
25
|
reqUrl: 'http://192.168.13.103:10003/openatc'
|
|
25
26
|
}
|
|
@@ -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
|
-
{}
|