openatc-components 0.3.48 → 0.3.50

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.
Files changed (40) hide show
  1. package/.eslintrc.js +3 -1
  2. package/config/index.js +1 -1
  3. package/package/kisscomps/components/DrawChannelization/drawsvg/iconSvg/motorwayIconSvg.vue +145 -46
  4. package/package/kisscomps/components/DrawChannelization/drawsvg/index.draw.vue +4 -4
  5. package/package/kisscomps/components/SchemeConfig/SchemeConfig.vue +11 -10
  6. package/package/kisscomps/components/SchemeConfig/azimuthlocking/index.vue +7 -7
  7. package/package/kisscomps/components/SchemeConfig/closePhaselControlModal/index.vue +8 -8
  8. package/package/kisscomps/components/SchemeConfig/lockingPhaselControlModal/index.vue +18 -17
  9. package/package/kisscomps/components/SchemeConfig/manualControlModalNew/index.vue +30 -33
  10. package/package/kisscomps/components/SchemeConfig/priorityControl/index.vue +10 -10
  11. package/package/kisscomps/components/SchemeConfig/tentativeplancontrolmodal/index.vue +9 -17
  12. package/package/kisscomps/components/XiaoKanban/index.vue +34 -14
  13. package/package/kisscomps/components/patternConfig/index.vue +61 -12
  14. package/package/kisscomps/components/patternConfig/pattern/patternTable.vue +196 -29
  15. package/package/kisscomps/components/patternConfig/planContent.vue +2 -4
  16. package/package/kissui.min.js +1 -1
  17. package/package.json +9 -10
  18. package/src/api/control.js +7 -3
  19. package/src/i18n/language/en.js +8 -0
  20. package/src/i18n/language/zh.js +9 -0
  21. package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/motorwayIconSvg.vue +145 -46
  22. package/src/kisscomps/components/DrawChannelization/drawsvg/index.draw.vue +4 -4
  23. package/src/kisscomps/components/SchemeConfig/SchemeConfig.vue +11 -10
  24. package/src/kisscomps/components/SchemeConfig/azimuthlocking/index.vue +7 -7
  25. package/src/kisscomps/components/SchemeConfig/closePhaselControlModal/index.vue +8 -8
  26. package/src/kisscomps/components/SchemeConfig/lockingPhaselControlModal/index.vue +18 -17
  27. package/src/kisscomps/components/SchemeConfig/manualControlModalNew/index.vue +30 -33
  28. package/src/kisscomps/components/SchemeConfig/priorityControl/index.vue +10 -10
  29. package/src/kisscomps/components/SchemeConfig/tentativeplancontrolmodal/index.vue +9 -17
  30. package/src/kisscomps/components/XiaoKanban/index.vue +34 -14
  31. package/src/kisscomps/components/patternConfig/index.vue +61 -12
  32. package/src/kisscomps/components/patternConfig/pattern/patternTable.vue +196 -29
  33. package/src/kisscomps/components/patternConfig/planContent.vue +2 -4
  34. package/src/views/patternConfig.vue +108 -309
  35. package/static/styles/common.scss +3 -3
  36. package/static/styles/dark/theme/element-dark.scss +1 -1
  37. package/static/styles/intersection.scss +15 -5
  38. package/static/styles/light/theme/element-light.scss +1 -1
  39. package/static/styles/schemeconfig.scss +3 -6
  40. package/static/styles/xiaokanban.scss +11 -0
@@ -38,6 +38,9 @@
38
38
  </div>
39
39
  <div style="height: 94%;" class="table-container">
40
40
  <PatternTable ref="patterntable"
41
+ :isSingleCrossMode="isSingleCrossMode"
42
+ :isShowTableHeader="isShowTableHeader"
43
+ :tableColums="tableColums"
41
44
  :devicesData="devicesData"
42
45
  :maxTableHeight="maxTableHeight"
43
46
  :opt="item.devs"
@@ -54,10 +57,13 @@
54
57
  </el-tabs>
55
58
  </div>
56
59
  </el-container>
57
- <div v-if="isShowSingle" style="height: 94%;" class="table-container">
60
+ <div v-if="isShowSingle" style="height: 100%;" class="table-container">
58
61
  <PatternTable ref="patterntable"
62
+ :isSingleCrossMode="isSingleCrossMode"
63
+ :isShowTableHeader="isShowTableHeader"
64
+ :tableColums="tableColums"
59
65
  :devicesData="devicesData"
60
- :opt="opt.optPatternList[0].devs"
66
+ :opt="opt.optPatternList && opt.optPatternList.length > 0 ? opt.optPatternList[0].devs : {}"
61
67
  :isAllowedExpand="isAllowedExpand"
62
68
  :maxTableHeight="maxTableHeight"
63
69
  @onNewPatternListChange="onNewPatternListChange"/>
@@ -97,6 +103,18 @@ export default {
97
103
  type: Object,
98
104
  default: () => null
99
105
  },
106
+ isShowTableHeader: {
107
+ type: Boolean,
108
+ default: true
109
+ },
110
+ isSingleCrossMode: {
111
+ type: Boolean,
112
+ default: false
113
+ },
114
+ tableColums: {
115
+ type: Array,
116
+ default: () => ['no', 'agentid', 'name', 'isused', 'patternid', 'offset', 'cycle', 'pattern']
117
+ },
100
118
  isOnlyOneTab: {
101
119
  type: Boolean,
102
120
  default: true
@@ -210,13 +228,23 @@ export default {
210
228
  }
211
229
  },
212
230
  mounted () {
213
- // this.getAllPlan()
214
- const clientHeight = this.$el.parentElement.clientHeight
215
- const extHeight = this.isShowSingle ? 0 : 94
216
- this.maxTableHeight = clientHeight - extHeight - 1
231
+ this.calcMaxTableHeight()
217
232
  },
218
233
  methods: {
234
+ calcMaxTableHeight () {
235
+ let parentElement = this.$el.parentElement
236
+ console.log('parentElement', parentElement)
237
+ const clientHeight = parentElement.clientHeight
238
+ console.log('clientHeight', clientHeight)
239
+ const extHeight = this.isShowSingle ? 0 : 94
240
+ this.maxTableHeight = clientHeight - extHeight - 1
241
+ console.log('calcMaxTableHeight:', this.maxTableHeight)
242
+ if (this.maxTableHeight < 150) {
243
+ this.maxTableHeight = 200
244
+ }
245
+ },
219
246
  async handeAgentidsChange () {
247
+ // this.calcMaxTableHeight()
220
248
  let devs = []
221
249
  for (let agentid of this.agentids) {
222
250
  let item = {
@@ -255,15 +283,36 @@ export default {
255
283
  for (let opt of optPatternList) {
256
284
  if (opt.devs && opt.devs.length > 0) {
257
285
  for (let dev of opt.devs) {
258
- if (!dev.feature || dev.feature.patternList) {
259
- resetFlag = true
260
- break
286
+ if (!dev.feature || !dev.feature.patternList) {
287
+ if (!resetFlag) {
288
+ resetFlag = true
289
+ }
290
+ } else {
291
+ // reset ring flow
292
+ let phases = dev.feature.phases
293
+ if (phases && phases.length > 0) {
294
+ let patternList = dev.feature.patternList
295
+ for (let pattern of patternList) {
296
+ let rings = pattern.rings
297
+ if (rings && rings.length > 0) {
298
+ for (let ringList of rings) {
299
+ if (ringList && ringList.length > 0) {
300
+ for (let ring of ringList) {
301
+ let pahseItem = phases.find(item => item.id === ring.id)
302
+ if (pahseItem) {
303
+ ring = Object.assign(ring, pahseItem)
304
+ // ring = {...ring, ...pahseItem}
305
+ // console.log(ring)
306
+ }
307
+ }
308
+ }
309
+ }
310
+ }
311
+ }
312
+ }
261
313
  }
262
314
  }
263
315
  }
264
- if (resetFlag) {
265
- break
266
- }
267
316
  }
268
317
  if (resetFlag) {
269
318
  res = await this.getFullOptList(optPatternList)
@@ -11,30 +11,57 @@
11
11
  **/
12
12
  <template>
13
13
  <div class="app-container" ref="pattern-container">
14
- <el-table :data="newPatternList" :max-height="tableHeight" id="footerBtn">
14
+ <el-table :data="newPatternList" :max-height="tableHeight" id="footerBtn" :show-header="isShowTableHeader">
15
15
  <el-table-column type="expand" v-if="isAllowedExpand">
16
16
  <template slot-scope="scope">
17
+ <div v-if="isAllowedExpand && isSingleCrossMode" class="optimizetype">
18
+ <span>{{$t('openatccomponents.pattern.optimizetype')}}</span>
19
+ <el-select v-model="value" clearable :placeholder="$t('openatccomponents.common.select')">
20
+ <el-option
21
+ v-for="item in typeOptions"
22
+ :key="item.value"
23
+ :label="$t('openatccomponents.overview.type' + item.value)"
24
+ :value="item.value"
25
+ >
26
+ </el-option>
27
+ </el-select>
28
+ <span class="optimiNum">{{$t('openatccomponents.pattern.optimizecycle')}}</span>
29
+ <el-input v-model="optimizecycle" clearable :placeholder="$t('openatccomponents.common.enter')"></el-input>
30
+ <el-button type="primary" @click="onOptimizeClick(scope.row, scope.$index)">{{$t('openatccomponents.pattern.inoptimize')}}</el-button>
31
+ </div>
17
32
  <div class="components-container board">
18
- <XiaoKanBan v-for="n in scope.row.ringCount" :key="n" class="kanban todo" :list="scope.row.rings[n-1]" :header-text="$t('openatccomponents.pattern.ring') +' '+n" :index="scope.$index" @fatherMethod="fatherMethod"/>
33
+ <XiaoKanBan v-for="n in scope.row.ringCount"
34
+ :key="n"
35
+ :isSingleCrossMode="isSingleCrossMode"
36
+ class="kanban todo"
37
+ :list="scope.row.rings[n-1]"
38
+ :header-text="$t('openatccomponents.pattern.ring') +' '+n"
39
+ :index="scope.$index"
40
+ @fatherMethod="fatherMethod"/>
19
41
  </div>
20
42
  </template>
21
43
  </el-table-column>
22
- <el-table-column align="center" label="No" width="45" minWidth="40">
44
+ <el-table-column align="center" label="No" width="45" minWidth="40" v-if="isShowColumn('no')">
23
45
  <template slot-scope="scope">
24
46
  <span>{{scope.$index+1}}</span>
25
47
  </template>
26
48
  </el-table-column>
27
- <el-table-column align="center" :label="$t('openatccomponents.greenwaveoptimize.deviceid')" width="100" minWidth="40">
49
+ <el-table-column align="center" :label="$t('openatccomponents.greenwaveoptimize.deviceid')" width="100" minWidth="40" v-if="isShowColumn('agentid')">
28
50
  <template slot-scope="scope">
29
51
  <span>{{scope.row.agentid}}</span>
30
52
  </template>
31
53
  </el-table-column>
32
- <el-table-column align="center" :label="$t('openatccomponents.overview.crossname')" width="120" minWidth="40">
54
+ <el-table-column align="center" :label="$t('openatccomponents.greenwaveoptimize.period')" width="100" minWidth="40" v-if="isShowColumn('period')">
55
+ <template slot-scope="scope">
56
+ <span>{{getPeriod(scope.row)}}</span>
57
+ </template>
58
+ </el-table-column>
59
+ <el-table-column align="center" :label="$t('openatccomponents.overview.crossname')" width="120" minWidth="40" v-if="isShowColumn('name')">
33
60
  <template slot-scope="scope">
34
61
  <span>{{getDevName(scope.row)}}</span>
35
62
  </template>
36
63
  </el-table-column>
37
- <el-table-column property="isValid" :label="$t('openatccomponents.token.isValid')" align="center" width="80" prop="isused">
64
+ <el-table-column property="isValid" :label="$t('openatccomponents.token.isValid')" align="center" width="80" prop="isused" v-if="isShowColumn('isused')">
38
65
  <template slot-scope="scope">
39
66
  <el-switch
40
67
  style="padding-left: 5px;"
@@ -46,7 +73,8 @@
46
73
  <el-table-column
47
74
  :label="$t('openatccomponents.greenwaveoptimize.pattern')"
48
75
  width="120"
49
- align="center">
76
+ align="center"
77
+ v-if="isShowColumn('patternid')">
50
78
  <template slot-scope="scope">
51
79
  <el-select
52
80
  v-model="scope.row.patternid"
@@ -64,7 +92,7 @@
64
92
  <span></span>
65
93
  </template>
66
94
  </el-table-column>
67
- <el-table-column align="center" :label="$t('openatccomponents.greenwaveoptimize.offset')" width="70" prop="offset">
95
+ <el-table-column align="center" :label="$t('openatccomponents.greenwaveoptimize.offset')" width="85" prop="offset" v-if="isShowColumn('offset')">
68
96
  <template slot-scope="scope">
69
97
  <el-input-number v-if="isAllowedExpand" :controls="false" :min="0" :step="1" v-model.number="scope.row.offset" size="small" style="width:70%;"></el-input-number>
70
98
  <span v-else>
@@ -72,18 +100,11 @@
72
100
  </span>
73
101
  </template>
74
102
  </el-table-column>
75
- <el-table-column align="center" :label="$t('openatccomponents.greenwaveoptimize.cycle')" width="60" prop="cycle">
103
+ <el-table-column align="center" :label="$t('openatccomponents.greenwaveoptimize.cycle')" width="60" prop="cycle" v-if="isShowColumn('cycle')">
76
104
  </el-table-column>
77
- <el-table-column align="center" :label="$t('openatccomponents.pattern.plan')">
105
+ <el-table-column align="center" :label="$t('openatccomponents.pattern.plan')" v-if="isShowColumn('pattern')">
78
106
  <template slot-scope="scope">
79
107
  <div class="pattern-figure">
80
- <!-- <pattern-list
81
- :patternStatusList="scope.row.rings"
82
- :cycles="scope.row.cycle"
83
- :phaseList="scope.row.currPhase"
84
- :contrloType="getControlType(scope.row)"
85
- >
86
- </pattern-list> -->
87
108
  <pattern-list
88
109
  v-if="getControlType(scope.row) === 'ring'"
89
110
  :patternStatusList="scope.row.rings"
@@ -115,10 +136,11 @@
115
136
  </template>
116
137
 
117
138
  <script>
118
- import XiaoKanBan from '../../XiaoKanBan'
139
+ import XiaoKanBan from '../../XiaoKanBan/index.vue'
119
140
  // import { getPatternList } from '../../../../api/route'
120
141
  import { getIntersectionInfo } from '../../../../api/template'
121
142
  import { getMessageByCode } from '../../../../utils/responseMessage'
143
+ import { getDuration } from '../../../../api/cross'
122
144
  // import { getDirName } from '../../../components/SelectCrossPhase/utils.js'
123
145
  export default {
124
146
  name: 'PatternTable',
@@ -133,10 +155,26 @@ export default {
133
155
  optList: {
134
156
  type: Array
135
157
  },
158
+ isSingleCrossMode: {
159
+ type: Boolean,
160
+ default: false
161
+ },
162
+ tableColums: {
163
+ type: Array,
164
+ default: () => []
165
+ },
136
166
  isAllowedExpand: {
137
167
  type: Boolean,
138
168
  default: true
139
169
  },
170
+ isShowGenerateButton: {
171
+ type: Boolean,
172
+ default: true
173
+ },
174
+ isShowTableHeader: {
175
+ type: Boolean,
176
+ default: true
177
+ },
140
178
  maxTableHeight: {
141
179
  type: Number,
142
180
  default: 200
@@ -144,6 +182,13 @@ export default {
144
182
  },
145
183
  data () {
146
184
  return {
185
+ typeOptions: [{
186
+ value: 'flow-split-opt'
187
+ }, {
188
+ value: 'cycle-opt'
189
+ }],
190
+ value: 'flow-split-opt',
191
+ optimizecycle: 0,
147
192
  controlType: 'stage',
148
193
  loading: true,
149
194
  tableHeight: 460,
@@ -181,6 +226,113 @@ export default {
181
226
  })
182
227
  },
183
228
  methods: {
229
+ onOptimizeClick (row, index) {
230
+ let msg = this.$t('openatccomponents.pattern.algorithmEngineOptimization')
231
+ const loading = this.$loading({
232
+ lock: true,
233
+ text: msg,
234
+ spinner: 'el-icon-loading',
235
+ background: 'rgba(0, 0, 0, 0.7)'
236
+ })
237
+ setTimeout(() => {
238
+ loading.close()
239
+ this.handeleOptimizeClick(row, index)
240
+ }, 1000)
241
+ },
242
+ handeleOptimizeClick (row, index) {
243
+ let newPha = []
244
+ for (let i = 0; i < row.rings.length; i++) {
245
+ newPha.push(...row.rings[i])
246
+ }
247
+ let phaseData = newPha.map(item => {
248
+ return {
249
+ id: item.id,
250
+ flowperhour: item.flowperhour,
251
+ saturation: item.saturation
252
+ }
253
+ })
254
+ let patternList = row.allPatterns
255
+ if (row.feature && row.feature.patternList && row.feature.patternList.length > 0) {
256
+ patternList = row.feature.patternList
257
+ }
258
+ let pattern = patternList.filter((item) => item.id === row.patternid)[0]
259
+ let phaseList = row.currPhase
260
+ let reqData = {
261
+ 'type': this.value,
262
+ 'optcycle': this.optimizecycle ? this.optimizecycle : 0,
263
+ 'phaseList': phaseList,
264
+ 'pattern': pattern,
265
+ 'phases': phaseData
266
+ }
267
+ let isValidata = []
268
+ for (let j = 0; j < newPha.length; j++) {
269
+ let comNum = (newPha[j].length / 4) * 1700 * 0.8
270
+ isValidata.push(newPha[j].flowperhour > comNum)
271
+ }
272
+ if (isValidata.includes(true)) {
273
+ this.$confirm(this.$t('openatccomponents.overview.maxFlow'),
274
+ this.$t('openatccomponents.common.alarm'), {
275
+ confirmButtonText: this.$t('openatccomponents.common.confirm'),
276
+ cancelButtonText: this.$t('openatccomponents.common.cancel'),
277
+ type: 'warning'
278
+ }).then(() => {
279
+ this.doOptimize(row, index, reqData)
280
+ }).catch(() => {})
281
+ } else {
282
+ this.doOptimize(row, index, reqData)
283
+ }
284
+ },
285
+ doOptimize (row, index, reqData) {
286
+ // let _this = this
287
+ getDuration(reqData).then(data => {
288
+ if (data.data.success) {
289
+ this.$message({
290
+ type: 'success',
291
+ message: this.$t('openatccomponents.pattern.success')
292
+ })
293
+ // let cycle = 0
294
+ for (let i = 0; i < row.rings.length; i++) {
295
+ for (let j = 0; j < row.rings[i].length; j++) {
296
+ for (let h = 0; h < data.data.data.phase.length; h++) {
297
+ if (row.rings[i][j].id === data.data.data.phase[h].id) {
298
+ row.rings[i][j].value = data.data.data.phase[h].duration
299
+ // cycle = cycle + row.rings[i][j].value
300
+ }
301
+ }
302
+ }
303
+ }
304
+ // row.cycle = cycle
305
+ // let newPattern = _this.newPatternList[index]
306
+ // newPattern.cycle = cycle
307
+ // newPattern.rings = row.rings
308
+ // _this.newPatternList[index] = newPattern
309
+ // if (row.feature && row.feature.patternList && row.feature.patternList.length > 0) {
310
+ // let pattern = row.feature.patternList.find((item) => item.id === row.patternid)
311
+ // if (pattern) {
312
+ // pattern.cycle = cycle
313
+ // pattern.rings = row.rings
314
+ // }
315
+ // }
316
+ }
317
+ }).catch(error => {
318
+ console.log(error)
319
+ })
320
+ },
321
+ isShowColumn (colum) {
322
+ let res = true
323
+ if (this.tableColums && this.tableColums.length > 0) {
324
+ res = this.tableColums.find(item => item === colum)
325
+ }
326
+ return res
327
+ },
328
+ getPeriod (row) {
329
+ let period = row.period
330
+ let res = ''
331
+ if (period && period.length > 0) {
332
+ res = period[0] + '-' + period[1]
333
+ }
334
+ return res
335
+ },
184
336
  getDevName (row) {
185
337
  let res = row.name ? row.name : ''
186
338
  if (this.devicesData) {
@@ -258,7 +410,9 @@ export default {
258
410
  if (ring.length === 0) continue
259
411
  for (let rr of ring) {
260
412
  rr.desc = []
261
- let direction = currPhase.filter(curp => curp.id === rr.id)[0].direction // 相位方向集合
413
+ let targetPhase = currPhase.filter(curp => curp.id === rr.id)[0]
414
+ if (!targetPhase) continue
415
+ let direction = targetPhase.direction // 相位方向集合
262
416
  let phaseRing = currPhase.filter(curp => curp.id === rr.id)[0].ring
263
417
  count.push(phaseRing)
264
418
  for (let dir of direction) {
@@ -405,17 +559,30 @@ export default {
405
559
  <style lang="scss">
406
560
  .board {
407
561
  width: 100%;
408
- margin-left: 10px;
562
+ margin-left: 10PX;
409
563
  display: flex;
410
- justify-content: space-around;
411
- flex-direction: row;
564
+ justify-content: flex-start;
565
+ gap: 10PX;
412
566
  align-items: flex-start;
413
567
  }
414
- // .kanban {
415
- // &.todo {
416
- // .board-column-header {
417
- // background: $--color-primary;
418
- // }
419
- // }
420
- // }
568
+ .optimizetype{
569
+ font-size: 14PX;
570
+ display: flex;
571
+ justify-content: flex-start;
572
+ align-items: center;
573
+ gap: 10PX;
574
+ padding-left: 20PX;
575
+ .el-input {
576
+ width: 120PX;
577
+ }
578
+ // .el-select{
579
+ // width: 170PX;
580
+ // }
581
+ // .el-button {
582
+ // margin-left: 10PX;
583
+ // }
584
+ .optimiNum {
585
+ padding-left: 10PX;
586
+ }
587
+ }
421
588
  </style>
@@ -119,7 +119,7 @@ export default {
119
119
  let res = []
120
120
  let devs = tab.devs
121
121
  for (let dev of devs) {
122
- if (!dev.patternList || dev.patternList.length === 0) {
122
+ if (!dev.feature || !dev.feature.patternList || dev.feature.patternList.length === 0) {
123
123
  res = list
124
124
  return res
125
125
  }
@@ -127,9 +127,7 @@ export default {
127
127
  let devPatternList = devs.map(item => {
128
128
  let pattern = {
129
129
  agentid: item.agentid,
130
- feature: {
131
- patternList: item.patternList
132
- }
130
+ feature: item.feature
133
131
  }
134
132
  return pattern
135
133
  })