openatc-components 0.1.139 → 0.1.142

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 (70) hide show
  1. package/package/kisscomps/components/CommonKanban/CommonKanban.vue +8 -4
  2. package/package/kisscomps/components/DrawChannelization/drawsvg/overlapAssociatedComponent.vue +1 -1
  3. package/package/kisscomps/components/DrawChannelization/drawsvg/phaseAssociatedComponent.vue +1 -1
  4. package/package/kisscomps/components/ExpendConfig/ExpendConfig.vue +1 -1
  5. package/package/kisscomps/components/KanBan/kanban.vue +1 -1
  6. package/package/kisscomps/components/OverLap/OverLap.vue +2 -2
  7. package/package/kisscomps/components/PatternOptimize/PatternOptimize.vue +1 -1
  8. package/package/kisscomps/components/PatternStatus/PatternStatus.vue +21 -20
  9. package/package/kisscomps/components/PhaseMarker/phasemarker.vue +1 -1
  10. package/package/kisscomps/components/SchemeConfig/SchemeConfig.vue +1 -1
  11. package/package/kisscomps/components/SchemeConfig/azimuthlocking/index.vue +54 -13
  12. package/package/kisscomps/components/SchemeConfig/azimuthlocking/utils.js +8 -8
  13. package/package/kisscomps/components/SchemeConfig/manualControlModal/index.vue +2 -0
  14. package/package/kisscomps/components/SchemeConfig/priorityControl/index.vue +1 -1
  15. package/package/kisscomps/components/SchemeConfig/tentativeplancontrolmodal/index.vue +1 -1
  16. package/package/kisscomps/components/Stages/index.vue +32 -2
  17. package/package/kisscomps/components/XRDDirSelector/XRDDirSelector.vue +458 -626
  18. package/package/kisscomps/components/XiaoKanban/DirSelector.vue +356 -0
  19. package/package/kisscomps/components/XiaoKanban/index.vue +102 -0
  20. package/package/kisscomps/components/patternConfig/index.js +2 -0
  21. package/package/kisscomps/components/patternConfig/index.vue +1010 -0
  22. package/package/kisscomps/components/patternConfig/pattern/patternTable.vue +349 -0
  23. package/package/kisscomps/components/patternConfig/pattern/planChart/model/coordinationModel.js +665 -0
  24. package/package/kisscomps/components/patternConfig/planContent.vue +572 -0
  25. package/package/kisscomps/components/patternConfig/planMenu.vue +329 -0
  26. package/package/kisscomps/components/patternConfig/utils.js +152 -0
  27. package/package/kisscomps/index.js +4 -0
  28. package/package/kissui.min.js +1 -1
  29. package/package.json +14 -13
  30. package/src/api/control.js +19 -0
  31. package/src/api/device.js +135 -0
  32. package/src/api/route.js +171 -0
  33. package/src/i18n/language/en.js +149 -0
  34. package/src/i18n/language/zh.js +133 -0
  35. package/src/kisscomps/components/CommonKanban/CommonKanban.vue +8 -4
  36. package/src/kisscomps/components/DrawChannelization/drawsvg/overlapAssociatedComponent.vue +1 -1
  37. package/src/kisscomps/components/DrawChannelization/drawsvg/phaseAssociatedComponent.vue +1 -1
  38. package/src/kisscomps/components/ExpendConfig/ExpendConfig.vue +1 -1
  39. package/src/kisscomps/components/KanBan/kanban.vue +1 -1
  40. package/src/kisscomps/components/OverLap/OverLap.vue +2 -2
  41. package/src/kisscomps/components/PatternOptimize/PatternOptimize.vue +1 -1
  42. package/src/kisscomps/components/PatternStatus/PatternStatus.vue +21 -20
  43. package/src/kisscomps/components/PhaseMarker/phasemarker.vue +1 -1
  44. package/src/kisscomps/components/SchemeConfig/SchemeConfig.vue +1 -1
  45. package/src/kisscomps/components/SchemeConfig/azimuthlocking/index.vue +54 -13
  46. package/src/kisscomps/components/SchemeConfig/azimuthlocking/utils.js +8 -8
  47. package/src/kisscomps/components/SchemeConfig/manualControlModal/index.vue +2 -0
  48. package/src/kisscomps/components/SchemeConfig/priorityControl/index.vue +1 -1
  49. package/src/kisscomps/components/SchemeConfig/tentativeplancontrolmodal/index.vue +1 -1
  50. package/src/kisscomps/components/Stages/index.vue +32 -2
  51. package/src/kisscomps/components/XRDDirSelector/XRDDirSelector.vue +458 -626
  52. package/src/kisscomps/components/XiaoKanban/DirSelector.vue +356 -0
  53. package/src/kisscomps/components/XiaoKanban/index.vue +102 -0
  54. package/src/kisscomps/components/patternConfig/index.js +2 -0
  55. package/src/kisscomps/components/patternConfig/index.vue +1010 -0
  56. package/src/kisscomps/components/patternConfig/pattern/patternTable.vue +349 -0
  57. package/src/kisscomps/components/patternConfig/pattern/planChart/model/coordinationModel.js +665 -0
  58. package/src/kisscomps/components/patternConfig/planContent.vue +572 -0
  59. package/src/kisscomps/components/patternConfig/planMenu.vue +329 -0
  60. package/src/kisscomps/components/patternConfig/utils.js +152 -0
  61. package/src/kisscomps/index.js +4 -0
  62. package/src/lib/publicjs/KissApi.js +2 -2
  63. package/src/router/index.js +7 -0
  64. package/src/utils/auth.js +24 -3
  65. package/src/views/intersection.vue +1 -1
  66. package/src/views/patternConfig.vue +1468 -0
  67. package/static/apiconfig.json +85 -0
  68. package/static/styles/common.scss +2 -0
  69. package/static/styles/patternConfig.scss +57 -0
  70. package/static/styles/xiaokanban.scss +51 -0
@@ -0,0 +1,349 @@
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="app-container" ref="pattern-container">
14
+ <el-table :data="newPatternList" :max-height="tableHeight" id="footerBtn">
15
+ <el-table-column type="expand" v-if="isAllowedExpand">
16
+ <template slot-scope="scope">
17
+ <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"/>
19
+ </div>
20
+ </template>
21
+ </el-table-column>
22
+ <el-table-column align="center" label="No" width="45" minWidth="40">
23
+ <template slot-scope="scope">
24
+ <span>{{scope.$index+1}}</span>
25
+ </template>
26
+ </el-table-column>
27
+ <el-table-column align="center" :label="$t('openatccomponents.greenwaveoptimize.deviceid')" width="100" minWidth="40">
28
+ <template slot-scope="scope">
29
+ <span>{{scope.row.agentid}}</span>
30
+ </template>
31
+ </el-table-column>
32
+ <el-table-column property="isValid" :label="$t('openatccomponents.token.isValid')" align="center" width="80" prop="isused">
33
+ <template slot-scope="scope">
34
+ <el-switch
35
+ style="padding-left: 5px;"
36
+ v-model="scope.row.isused"
37
+ active-color="#299BCC">
38
+ </el-switch>
39
+ </template>
40
+ </el-table-column>
41
+ <el-table-column
42
+ :label="$t('openatccomponents.greenwaveoptimize.pattern')"
43
+ width="120"
44
+ align="center">
45
+ <template slot-scope="scope">
46
+ <el-select
47
+ v-model="scope.row.patternid"
48
+ size="small"
49
+ :loading="loading"
50
+ @focus="getCurPattern(scope.row.agentid)"
51
+ @change="changeCurPattern(scope.row,$event)">
52
+ <el-option v-for="option in (scope.row.allPatterns)"
53
+ :key="option.patternid"
54
+ :label="option.patterndesc"
55
+ :value="option.patternid">
56
+ <span>{{ option.patterndesc }}</span>
57
+ </el-option>
58
+ </el-select>
59
+ <span></span>
60
+ </template>
61
+ </el-table-column>
62
+ <!-- <el-table-column align="center" :label="$t('openatccomponents.greenwaveoptimize.directionOption1')" width="150" prop="forwardphaseDesc" :formatter="formatterForwardphaseDesc">
63
+ </el-table-column>
64
+ <el-table-column align="center" :label="$t('openatccomponents.greenwaveoptimize.directionOption2')" width="150" prop="backphaseDesc" :formatter="formatterBackphaseDesc">
65
+ </el-table-column> -->
66
+ <el-table-column align="center" :label="$t('openatccomponents.greenwaveoptimize.offset')" width="120" prop="offset">
67
+ <template slot-scope="scope">
68
+ <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>
69
+ <span v-else>
70
+ {{ scope.row.offset }}
71
+ </span>
72
+ </template>
73
+ </el-table-column>
74
+ <el-table-column align="center" :label="$t('openatccomponents.greenwaveoptimize.cycle')" width="80" prop="cycle">
75
+ </el-table-column>
76
+ <el-table-column align="center" :label="$t('openatccomponents.pattern.plan')">
77
+ <template slot-scope="scope">
78
+ <div class="pattern-figure">
79
+ <pattern-list
80
+ :patternStatusList="scope.row.rings"
81
+ :cycles="scope.row.cycle"
82
+ :phaseList="scope.row.currPhase"
83
+ >
84
+ </pattern-list>
85
+ </div>
86
+ </template>
87
+ </el-table-column>
88
+ </el-table>
89
+ </div>
90
+ </template>
91
+
92
+ <script>
93
+ import XiaoKanBan from '../../XiaoKanBan'
94
+ import { getPatternList } from '../../../../api/route'
95
+ import { getMessageByCode } from '../../../../utils/responseMessage'
96
+ // import { getDirName } from '../../../components/SelectCrossPhase/utils.js'
97
+ export default {
98
+ name: 'PatternTable',
99
+ components: {
100
+ XiaoKanBan
101
+ },
102
+ props: {
103
+ optList: {
104
+ type: Array
105
+ },
106
+ isAllowedExpand: {
107
+ type: Boolean,
108
+ default: true
109
+ }
110
+ },
111
+ data () {
112
+ return {
113
+ loading: true,
114
+ tableHeight: 460,
115
+ screenHeight: window.innerHeight, // 屏幕高度
116
+ newPatternList: []
117
+ }
118
+ },
119
+ created () {
120
+ },
121
+ watch: {
122
+ screenHeight: function () {
123
+ this.tableHeight = screen.height < 1080 ? screen.height * 0.35 : screen.height * 0.5
124
+ },
125
+ optList: {
126
+ handler: function (val) {
127
+ if (val && val.length > 0) {
128
+ // for () {
129
+
130
+ // }
131
+ }
132
+ },
133
+ deep: true
134
+ },
135
+ newPatternList: {
136
+ handler: function (val) {
137
+ this.$emit('onNewPatternListChange', val)
138
+ },
139
+ deep: true
140
+ }
141
+ },
142
+ mounted: function () {
143
+ var _this = this
144
+ _this.$nextTick(function () {
145
+ _this.$nextTick(function () {
146
+ _this.tableHeight = screen.height < 1080 ? screen.height * 0.35 : screen.height * 0.5
147
+ window.onresize = function () {
148
+ _this.tableHeight = screen.height < 1080 ? screen.height * 0.35 : screen.height * 0.5
149
+ }
150
+ })
151
+ })
152
+ },
153
+ methods: {
154
+ onPatternTable (routeData, patternList, phaseList) {
155
+ if (patternList.length === 0) {
156
+ // this.$message.error('方案为空!')
157
+ return
158
+ }
159
+ if (phaseList.length === 0) {
160
+ // this.$message.error('相位为空!')
161
+ return
162
+ }
163
+ // this.routeData = routeData
164
+ // this.patternList = patternList
165
+ // this.phaseList = phaseList
166
+ this.handlePatternList(routeData, patternList, phaseList)
167
+ },
168
+ handlePatternList (routeData, patternList, phaseList) {
169
+ this.newPatternList = []
170
+ let devs = routeData.devs
171
+ for (let pattern of patternList) {
172
+ let obj = {}
173
+ let id = pattern.agentid
174
+ obj.agentid = id
175
+ let count = [] // 计算相位有几个环
176
+ if (pattern.feature !== undefined && pattern.feature.patternList.length !== 0) {
177
+ let currPatternList = pattern.feature.patternList
178
+ let dev = devs.filter(ist => ist.agentid === id)[0]
179
+ let patternId = dev.patternid
180
+ let currPattern
181
+ if (Array.isArray(currPatternList)) {
182
+ currPattern = currPatternList.filter(cpl => cpl.id === patternId)[0]
183
+ } else {
184
+ currPattern = currPatternList
185
+ }
186
+ if (!currPattern) {
187
+ currPattern = currPatternList[0]
188
+ }
189
+ // let currPattern = currPatternList.filter(cpl => cpl.id === patternId)[0]
190
+ if (currPattern.desc === '') {
191
+ obj.desc = this.$t('openatccomponents.greenwaveoptimize.pattern') + currPattern.id
192
+ } else {
193
+ obj.desc = currPattern.desc
194
+ }
195
+ obj = {...obj, ...dev}
196
+ obj.id = currPattern.id
197
+ obj.offset = currPattern.offset
198
+ obj.cycle = currPattern.cycle
199
+ obj.patternId = currPattern.id
200
+ obj.patternid = currPattern.id
201
+ obj.patternDesc = currPattern.desc === '' ? `${this.$t('openatccomponents.greenwaveoptimize.pattern')}${currPattern.id}` : currPattern.desc
202
+ obj.allPatterns = currPatternList.map(ele => {
203
+ let patterndesc = ele.desc === '' ? `${this.$t('openatccomponents.greenwaveoptimize.pattern')}${currPattern.id}` : ele.desc
204
+ return {
205
+ patternid: ele.id,
206
+ patterndes: ele.desc,
207
+ patterndesc: patterndesc,
208
+ ...ele
209
+ }
210
+ })
211
+ let rings = currPattern.rings
212
+ let currPhase = phaseList.filter(phl => phl.agentid === id)[0].feature.phaseList
213
+ obj.currPhase = currPhase
214
+ obj.phaseList = currPhase
215
+ // 计算有几个环
216
+ for (let ring of rings) {
217
+ if (ring.length === 0) continue
218
+ for (let rr of ring) {
219
+ rr.desc = []
220
+ let direction = currPhase.filter(curp => curp.id === rr.id)[0].direction // 相位方向集合
221
+ let phaseRing = currPhase.filter(curp => curp.id === rr.id)[0].ring
222
+ count.push(phaseRing)
223
+ for (let dir of direction) {
224
+ let obj = {}
225
+ obj.id = dir
226
+ rr.desc.push(obj)
227
+ }
228
+ }
229
+ }
230
+ obj.rings = rings
231
+ }
232
+ let ringCount = Array.from(new Set(count)) // 去除数组重复的元素
233
+ ringCount = ringCount.sort(this.sortNumbers) // 把数组中的值按照从小到大的顺序重新排序
234
+ obj.ringCount = ringCount
235
+ this.newPatternList.push(obj)
236
+ }
237
+ },
238
+ sortNumbers (a, b) {
239
+ return a - b
240
+ },
241
+ fatherMethod (val) {
242
+ let index = val.index
243
+ let cycle = val.cycle
244
+ this.newPatternList[index].cycle = cycle
245
+ },
246
+ changeCurPattern (row, curPatternid) {
247
+ // 修改当前方案(allPatterns: 所有可选项)
248
+ const data = {
249
+ agentid: row.agentid,
250
+ patternid: curPatternid,
251
+ patterndes: row.allPatterns.filter(ele => ele.patternid === curPatternid)[0].patterndes,
252
+ allPatterns: row.allPatterns
253
+ }
254
+ row.desc = data.patternDesc
255
+ row.patternId = data.patternid
256
+ row.patternid = data.patternid
257
+ row.patterndes = data.patterndes
258
+ row.allPatterns = data.allPatterns
259
+ row.patternid = data.patternid
260
+ let selectPattern = row.allPatterns.filter(item => item.patternid === row.patternid)[0]
261
+ let res = this.getRings(selectPattern.rings, row.phaseList)
262
+ row.rings = res.rings
263
+ row.ringCount = res.ringCount
264
+ // row.rings = selectPattern.rings
265
+ row.cycle = selectPattern.cycle
266
+ row.offset = selectPattern.offset
267
+ row.currPhase = row.phaseList
268
+ },
269
+ getRings (ringsList, phaseList) {
270
+ let res = {}
271
+ let rings = JSON.parse(JSON.stringify(ringsList))
272
+ let count = []
273
+ // 计算有几个环
274
+ for (let ring of rings) {
275
+ if (ring.length === 0) continue
276
+ for (let rr of ring) {
277
+ rr.desc = []
278
+ let direction = phaseList.filter(curp => curp.id === rr.id)[0].direction // 相位方向集合
279
+ let phaseRing = phaseList.filter(curp => curp.id === rr.id)[0].ring
280
+ count.push(phaseRing)
281
+ for (let dir of direction) {
282
+ let obj = {}
283
+ obj.id = dir
284
+ rr.desc.push(obj)
285
+ }
286
+ }
287
+ }
288
+ let ringCount = Array.from(new Set(count)) // 去除数组重复的元素
289
+ ringCount = ringCount.sort(this.sortNumbers) // 把数组中的值按照从小到大的顺序重新排序
290
+ res = {
291
+ rings: rings,
292
+ ringCount: ringCount
293
+ }
294
+ return res
295
+ },
296
+ getCurPattern (agentid) {
297
+ // 获取当前设备所有可选方案
298
+ this.loading = true
299
+ let _this = this
300
+ // let patterns = this.newPatternList.filter(item => item.agentid === agentid)[0]
301
+ // if (patterns.allPatterns && patterns.allPatterns.length > 0) {
302
+ // patterns.allPatterns = patterns.allPatterns
303
+ // return false
304
+ // }
305
+ getPatternList(agentid).then(res => {
306
+ this.loading = false
307
+ if (!res.data.success) {
308
+ if (res.data.code === '4003') {
309
+ this.$message.error(this.$t('openatc.common.devicenotonline'))
310
+ return
311
+ }
312
+ this.$message.error(getMessageByCode(res.data.code, this.$i18n.locale))
313
+ return
314
+ }
315
+ _this.newPatternList.forEach(ele => {
316
+ if (ele.agentid === agentid) {
317
+ ele.allPatterns = res.data.data.data.patternList.map(ele => {
318
+ return {
319
+ ...ele,
320
+ patternid: ele.id,
321
+ patterndes: ele.desc,
322
+ patterndesc: ele.desc === '' ? `${_this.$t('openatccomponents.greenwaveoptimize.pattern')}${ele.id}` : ele.desc
323
+ }
324
+ })
325
+ }
326
+ })
327
+ })
328
+ }
329
+ }
330
+ }
331
+ </script>
332
+
333
+ <style lang="scss">
334
+ .board {
335
+ width: 100%;
336
+ margin-left: 10px;
337
+ display: flex;
338
+ justify-content: space-around;
339
+ flex-direction: row;
340
+ align-items: flex-start;
341
+ }
342
+ // .kanban {
343
+ // &.todo {
344
+ // .board-column-header {
345
+ // background: $--color-primary;
346
+ // }
347
+ // }
348
+ // }
349
+ </style>