openatc-components 0.2.36 → 0.2.37

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 (46) hide show
  1. package/package/kisscomps/components/DirectionListConfiguration/DirectionListConfiguration.vue +49 -49
  2. package/package/kisscomps/components/IntersectionDirectionSelection/IntersectionDirectionSelection.vue +39 -8
  3. package/package/kisscomps/components/PatternStatus/PatternStatus.vue +5 -8
  4. package/package/kisscomps/components/SchemeConfig/SchemeConfig.vue +25 -178
  5. package/package/kisscomps/components/SchemeConfig/azimuthlocking/index.vue +29 -72
  6. package/package/kisscomps/components/SchemeConfig/closePhaselControlModal/index.vue +3 -14
  7. package/package/kisscomps/components/SchemeConfig/lockingPhaselControlModal/index.vue +7 -17
  8. package/package/kisscomps/components/SchemeConfig/manualControlModal/index.vue +1 -1
  9. package/package/kisscomps/components/SchemeConfig/priorityControl/index.vue +9 -18
  10. package/package/kisscomps/components/SchemeConfig/realtimeStatusModal/index.vue +1 -1
  11. package/package/kisscomps/components/SchemeConfig/tentativeplancontrolmodal/index.vue +36 -38
  12. package/package/kisscomps/components/Stages/index.vue +11 -52
  13. package/package/kisscomps/components/XRDDirSelector/XRDDirSelector.vue +29 -30
  14. package/package/kisscomps/components/patternConfig/pattern/patternTable.vue +73 -13
  15. package/package/kisscomps/components/patternConfig/planContent.vue +3 -0
  16. package/package/kissui.min.js +1 -1
  17. package/package.json +2 -2
  18. package/src/i18n/language/en.js +2 -6
  19. package/src/i18n/language/zh.js +3 -7
  20. package/src/kisscomps/components/DirectionListConfiguration/DirectionListConfiguration.vue +49 -49
  21. package/src/kisscomps/components/IntersectionDirectionSelection/IntersectionDirectionSelection.vue +39 -8
  22. package/src/kisscomps/components/PatternStatus/PatternStatus.vue +5 -8
  23. package/src/kisscomps/components/SchemeConfig/SchemeConfig.vue +25 -178
  24. package/src/kisscomps/components/SchemeConfig/azimuthlocking/index.vue +29 -72
  25. package/src/kisscomps/components/SchemeConfig/closePhaselControlModal/index.vue +3 -14
  26. package/src/kisscomps/components/SchemeConfig/lockingPhaselControlModal/index.vue +7 -17
  27. package/src/kisscomps/components/SchemeConfig/manualControlModal/index.vue +1 -1
  28. package/src/kisscomps/components/SchemeConfig/priorityControl/index.vue +9 -18
  29. package/src/kisscomps/components/SchemeConfig/realtimeStatusModal/index.vue +1 -1
  30. package/src/kisscomps/components/SchemeConfig/tentativeplancontrolmodal/index.vue +36 -38
  31. package/src/kisscomps/components/Stages/index.vue +11 -52
  32. package/src/kisscomps/components/XRDDirSelector/XRDDirSelector.vue +29 -30
  33. package/src/kisscomps/components/patternConfig/pattern/patternTable.vue +73 -13
  34. package/src/kisscomps/components/patternConfig/planContent.vue +3 -0
  35. package/src/views/intersection.vue +11 -5
  36. package/src/views/patternConfig.vue +7 -970
  37. package/src/views/schemeconfig.vue +50 -19
  38. package/static/styles/schemeconfig.scss +58 -70
  39. package/static/styles/stages.scss +8 -1
  40. package/src/icons/svg/fangxiangsuoding.svg +0 -1
  41. package/src/icons/svg/jieduansuoding.svg +0 -1
  42. package/src/icons/svg/xiangweisuoding.svg +0 -1
  43. package/src/kisscomps/components/SchemeConfig/manualControlModalNew/controlModelGroup.vue +0 -128
  44. package/src/kisscomps/components/SchemeConfig/manualControlModalNew/icon.vue +0 -426
  45. package/src/kisscomps/components/SchemeConfig/manualControlModalNew/index.vue +0 -820
  46. package/src/kisscomps/components/SchemeConfig/manualControlModalNew/othersIcon.vue +0 -194
@@ -20,12 +20,12 @@
20
20
  :close-on-click-modal="false"
21
21
  @close="oncancle"
22
22
  append-to-body>
23
- <!-- <scheme-config
24
- :agentId="agentId"
25
- :statusData="crossStatusData"
26
- :realtimeStatusModalvisible="false"
27
- @patternCommitCallback="patternCommitCallback"/> -->
28
23
  <scheme-config
24
+ ref="rightpanel"
25
+ :agentId="agentId"
26
+ :statusData="crossStatusData"
27
+ :phaseList="phaseList2"/>
28
+ <!-- <scheme-config
29
29
  ref="rightpanel"
30
30
  :agentId="agentId"
31
31
  :lockPhaseBtnName="lockPhaseBtnName"
@@ -33,8 +33,7 @@
33
33
  :phaseList="phaseList"
34
34
  :realtimeStatusModalvisible="true"
35
35
  roadDirection="left"
36
- />
37
- <!-- funcSort="basicFunc" -->
36
+ /> -->
38
37
  </el-dialog>
39
38
  </div>
40
39
  </template>
@@ -42,6 +41,7 @@
42
41
  import { getTscControl } from '../api/control.js'
43
42
  import { getMessageByCode } from '../utils/responseMessage.js'
44
43
  import { getIntersectionInfo } from '../api/template'
44
+ import { getTscPhase } from '../api/cross.js'
45
45
  import {
46
46
  setToken
47
47
  } from '../utils/auth'
@@ -51,14 +51,16 @@ export default {
51
51
  },
52
52
  data () {
53
53
  return {
54
+ timer: 0,
55
+ phaseList2: [],
54
56
  phaseList: [],
55
57
  showWalk: [ 1, 2 ],
56
58
  sidewalkPhaseData: [{key: 'pedphase1653873194007699', phaseid: 1, id: 1, name: '东人行横道', isshow: false}],
57
59
  lockPhaseBtnName: this.$t('openatccomponents.overview.comfirm'),
58
- agentId: '12004-950',
59
- Token: 'eyJraWQiOiIxNjcwMzc0ODA4MTcyIiwidHlwIjoiSldUIiwiYWxnIjoiSFMyNTYifQ.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc1Njc3NDgwOCwiaWF0IjoxNjcwMzc0ODA4fQ.xsRoye_tk_Xf60w5Mpigm8vrPgQJCLN-W_IW4U7dafA',
60
+ agentId: 'cslsnl',
61
+ Token: 'eyJraWQiOiIxNzAxODMyOTQ3MTUwIiwidHlwIjoiSldUIiwiYWxnIjoiSFMyNTYifQ.eyJzdWIiOiJxeXl0aCIsImV4cCI6MTc2OTc4ODgwMCwiaWF0IjoxNzAxMzYwMDAwfQ.RIQpNEkJibL-RYllirDeNLi8G9-t8PecM_m7KlZNQXg',
60
62
  Token103: 'eyJraWQiOiIxNjcwMzc0ODA4MTcyIiwidHlwIjoiSldUIiwiYWxnIjoiSFMyNTYifQ.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc1Njc3NDgwOCwiaWF0IjoxNjcwMzc0ODA4fQ.xsRoye_tk_Xf60w5Mpigm8vrPgQJCLN-W_IW4U7dafA',
61
- boxVisible: false,
63
+ boxVisible: true,
62
64
  dialogWidth: '80%',
63
65
  crossStatusData: {} // 路口状态数据
64
66
  }
@@ -82,11 +84,10 @@ export default {
82
84
  this.dialogWidth = def + 'px'
83
85
  }
84
86
  },
85
- initData () {
86
- // let iframdevid = getIframdevid()
87
- this.getIntersectionInfo(this.agentId, '')
88
- getTscControl(this.agentId).then((data) => {
89
- if (!data.data.success) {
87
+ getPhase () {
88
+ getTscPhase(this.agentId).then(data => {
89
+ let res = data.data
90
+ if (!res.success) {
90
91
  if (data.data.code === '4002' && data.data.data.errorCode === '4209') {
91
92
  let success = data.data.data.content.success
92
93
  if (success !== 0) {
@@ -95,10 +96,31 @@ export default {
95
96
  return
96
97
  }
97
98
  }
98
- if (data.data.code === '4003') {
99
- this.$message.error(getMessageByCode(data.data.code, this.$i18n.locale))
100
- return
99
+ let parrenterror = getMessageByCode(data.data.code, this.$i18n.locale)
100
+ if (data.data.data) {
101
+ // 子类型错误
102
+ let childErrorCode = data.data.data.errorCode
103
+ if (childErrorCode) {
104
+ let childerror = getMessageByCode(data.data.data.errorCode, this.$i18n.locale)
105
+ this.$message.error(parrenterror + ',' + childerror)
106
+ }
107
+ } else {
108
+ this.$message.error(parrenterror)
101
109
  }
110
+ return
111
+ }
112
+ if (res.data.data && res.data.data.phaseList) {
113
+ this.phaseList2 = res.data.data.phaseList
114
+ }
115
+ })
116
+ },
117
+ initData () {
118
+ // let iframdevid = getIframdevid()
119
+ this.getIntersectionInfo(this.agentId, '')
120
+ this.getPhase()
121
+ getTscControl(this.agentId).then((data) => {
122
+ // debugger
123
+ if (!data.data.success) {
102
124
  let parrenterror = getMessageByCode(data.data.code, this.$i18n.locale)
103
125
  if (data.data.data) {
104
126
  // 子类型错误
@@ -112,7 +134,11 @@ export default {
112
134
  }
113
135
  return
114
136
  }
137
+ console.log(data.data.data)
115
138
  this.crossStatusData = JSON.parse(JSON.stringify(data.data.data.data))
139
+ // debugger
140
+ console.log(this.crossStatusData)
141
+ // debugger
116
142
  }).catch(error => {
117
143
  console.log(error)
118
144
  })
@@ -136,9 +162,14 @@ export default {
136
162
  created () {
137
163
  this.setDialogWidth()
138
164
  },
165
+ beforeDestroy () {
166
+ clearInterval(this.timer)
167
+ },
139
168
  mounted () {
140
169
  this.setPropsToken(this.Token)
141
- this.initData()
170
+ this.timer = setInterval(() => {
171
+ this.initData()
172
+ }, 1000 * 2)
142
173
  window.onresize = () => {
143
174
  return (() => {
144
175
  this.setDialogWidth()
@@ -57,14 +57,14 @@
57
57
  .model-label, .stage-label {
58
58
  width: 100PX;
59
59
  font-size: 14PX;
60
- font-weight: 700;
61
- color: $--color-text-secondary;;
60
+ font-weight: 400;
61
+ color: #606266;
62
62
  line-height: 28PX;
63
63
  padding-right: 12PX;
64
64
  }
65
65
  .model-label-title {
66
66
  font-size: 14PX;
67
- font-weight: 700;
67
+ font-weight: 400;
68
68
  line-height: 28PX;
69
69
  color: $--color-text-secondary;
70
70
  padding-right: 12PX;
@@ -74,8 +74,8 @@
74
74
  text-align: center;
75
75
  cursor:pointer;
76
76
  width: 70PX;
77
- height: 80PX;
78
- // background-color: #edf6ff;
77
+ height: 65PX;
78
+ background-color: #edf6ff;
79
79
  border-radius: 6PX;
80
80
  line-height: 1.15;
81
81
  .patternWalk{
@@ -88,28 +88,22 @@
88
88
  height: 24PX;
89
89
  }
90
90
  .single-model .model-icon {
91
- margin: 0 auto;
91
+ margin-top: 10PX;
92
92
  width: 24PX;
93
93
  height: 24PX;
94
- color: $--color-text-regular;
95
94
  }
96
95
  .single-model-select {
97
- // background-color: #299BCC !important;
98
- // border: solid 1PX #409eff;
99
- }
100
- .single-model-new {
101
96
  margin-right: 10PX;
102
- padding-top: 13PX;
103
97
  text-align: center;
104
98
  cursor:pointer;
105
99
  width: 70PX;
106
- height: 80PX;
107
- background-color: #edf6ff;
100
+ height: 65PX;
101
+ background-color: #a2cfff;
108
102
  border-radius: 6PX;
109
- line-height: 1.15;
103
+ // border: solid 1PX #409eff;
110
104
  }
111
105
  .single-model-name {
112
- margin-top: 13PX;
106
+ margin-top: 3PX;
113
107
  font-size: 12PX;
114
108
  font-weight: normal;
115
109
  font-stretch: normal;
@@ -117,15 +111,6 @@
117
111
  letter-spacing: 0PX;
118
112
  color: #606266;
119
113
  }
120
- .single-model-name-theme {
121
- margin-top: 13PX;
122
- font-size: 12PX;
123
- font-weight: normal;
124
- font-stretch: normal;
125
- // line-height: 22PX;
126
- letter-spacing: 0PX;
127
- color: $--color-text-regular;
128
- }
129
114
  .current-stage-num {
130
115
  margin-top: 3PX;
131
116
  font-size: 12PX;
@@ -222,7 +207,7 @@
222
207
  }
223
208
  // 手动控制弹框
224
209
  .manual-control-modal{
225
- // padding: 21PX 0PX 21PX 28PX;
210
+ padding: 21PX 0PX 21PX 28PX;
226
211
  min-width: 360PX;
227
212
  overflow: auto;
228
213
  .title {
@@ -255,6 +240,7 @@
255
240
  }
256
241
  .el-form-item__label {
257
242
  font-size: 14PX;
243
+ font-weight: 400;
258
244
  color: $--color-text-secondary;
259
245
  }
260
246
  .el-dialog__footer {
@@ -278,52 +264,25 @@
278
264
  text-align: left;
279
265
  }
280
266
  }
267
+ .footer {
268
+ button {
269
+ width: 56PX;
270
+ height: 32PX;
271
+ padding: 0;
272
+ text-align: center;
273
+ line-height: 30PX;
274
+ font-size: 12PX;
275
+ font-weight: normal;
276
+ font-stretch: normal;
277
+ }
278
+ }
281
279
  .model-label, .stage-label {
282
280
  color: $--color-text-secondary;
283
281
  }
284
282
  }
285
- .manual-control-modal-new {
286
- padding: 20PX;
287
- .el-tabs__nav.is-top {
288
- width: 100%;
289
- }
290
- .el-tabs--card>.el-tabs__header .el-tabs__item {
291
- background-color: $--background-color-base;
292
- width: 25%;
293
- text-align: center;
294
- border-left: none;
295
- border-bottom-color: $--border-color-light;
296
- }
297
- .el-tabs--card>.el-tabs__header .el-tabs__item.is-active {
298
- background-color: $--color-white;
299
- border-bottom: none;
300
- }
301
- .group-control {
302
- margin-bottom: 20PX;
303
- overflow: hidden;
304
- }
305
-
306
- .common-config {
307
- .el-form-item__label {
308
- color: $--color-text-secondary;
309
- }
310
- .el-form-item {
311
- margin-bottom: 0PX;
312
- }
313
- .el-input-number {
314
- .el-input__inner {
315
- text-align: left;
316
- }
317
- }
318
- }
319
-
320
- .footer {
321
- float: right;
322
- margin: 28PX 0PX 40PX 0;
323
- }
324
- }
325
283
  .priority-control{
326
284
  height: 100%;
285
+ padding: 21PX 0PX 21PX 28PX;
327
286
  min-width: 360PX;
328
287
  overflow: auto;
329
288
  .title {
@@ -340,19 +299,32 @@
340
299
  }
341
300
  .footer {
342
301
  float: right;
302
+ margin: 38PX 24PX 40PX 0;
303
+ button {
304
+ width: 56PX;
305
+ height: 32PX;
306
+ padding: 0;
307
+ text-align: center;
308
+ line-height: 30PX;
309
+ font-size: 12PX;
310
+ font-weight: normal;
311
+ font-stretch: normal;
312
+ }
343
313
  }
344
314
  .el-input--mini{
345
315
  width: 90%;
346
316
  }
347
317
  .el-form-item {
348
318
  margin-bottom: 10PX;
349
- margin-right: 10PX;
350
319
  }
351
320
  .el-form-item__label {
352
321
  font-size: 14PX;
353
- font-weight: 700;
322
+ font-weight: 400;
354
323
  color: $--color-text-secondary;
355
324
  }
325
+ .el-select {
326
+ width: 90%;
327
+ }
356
328
  .el-input-number {
357
329
  width: 100%;
358
330
  .el-input__inner {
@@ -362,7 +334,7 @@
362
334
  }
363
335
  .tentativeplan-control{
364
336
  // height: 100%;
365
- // padding: 21PX 0PX 21PX 28PX;
337
+ padding: 21PX 0PX 21PX 28PX;
366
338
  min-width: 360PX;
367
339
  overflow: hidden !important;
368
340
  .forbiddenstage{
@@ -417,13 +389,14 @@
417
389
  }
418
390
  .footer {
419
391
  float: right;
392
+ margin: 38PX 24PX 40PX 0;
420
393
  }
421
394
  .el-form-item {
422
395
  margin-bottom: 0PX;
423
- margin-right: 10PX;
424
396
  }
425
397
  .el-form-item__label {
426
398
  font-size: 14PX;
399
+ font-weight: 400;
427
400
  color: $--color-text-secondary;
428
401
  }
429
402
  .el-dialog__footer {
@@ -432,12 +405,27 @@
432
405
  .el-dialog__header {
433
406
  padding: 19PX 30PX;
434
407
  }
408
+ .el-select {
409
+ width: 90%;
410
+ }
435
411
  .el-input-number {
436
412
  width: 100%;
437
413
  .el-input__inner {
438
414
  text-align: left;
439
415
  }
440
416
  }
417
+ .footer {
418
+ button {
419
+ width: 56PX;
420
+ height: 32PX;
421
+ padding: 0;
422
+ text-align: center;
423
+ line-height: 30PX;
424
+ font-size: 12PX;
425
+ font-weight: normal;
426
+ font-stretch: normal;
427
+ }
428
+ }
441
429
  .model-label, .stage-label {
442
430
  color: $--color-text-secondary;
443
431
  }
@@ -35,7 +35,14 @@
35
35
  }
36
36
  }
37
37
  .single-model-select {
38
- // background-color: #a2cfff;
38
+ margin-right: 10px;
39
+ text-align: center;
40
+ cursor:pointer;
41
+ width: 70px;
42
+ height: 65px;
43
+ background-color: #a2cfff;
44
+ border-radius: 6px;
45
+ // border: solid 1PX #409eff;
39
46
  }
40
47
  .single-model-name {
41
48
  margin-top: 3px;
@@ -1 +0,0 @@
1
- <?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1714021963787" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="12286" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M1023.606154 512l-267.815385-154.781538v111.852307h-200.467692v-200.861538h111.458461L512.393846 0.393846l-154.781538 267.815385h111.458461v200.861538H268.603077V357.218462L0.787692 512l267.815385 154.781538V555.323077h200.467692v200.467692H357.612308l154.781538 267.815385 154.387692-267.815385h-111.458461V555.323077h200.467692v111.458461z" p-id="12287"></path></svg>
@@ -1 +0,0 @@
1
- <?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1714021956193" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="12129" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M54.218328 0.002671h184.821636a52.882491 52.882491 0 0 1 53.416657 53.416658v916.09568a52.882491 52.882491 0 0 1-53.416657 53.416658H54.218328a53.416658 53.416658 0 0 1-53.416658-53.416658V53.419329a53.416658 53.416658 0 0 1 53.416658-53.416658z m438.016593 0h112.174982a53.416658 53.416658 0 0 1 53.416658 53.416658v916.09568a53.416658 53.416658 0 0 1-53.416658 53.416658H492.234921a52.882491 52.882491 0 0 1-53.416657-53.416658V53.419329a52.882491 52.882491 0 0 1 53.416657-53.416658z m364.835773 0h112.174981a53.416658 53.416658 0 0 1 53.416658 53.416658v916.09568a53.416658 53.416658 0 0 1-53.416658 53.416658h-112.174981a53.416658 53.416658 0 0 1-53.416658-53.416658V53.419329a53.416658 53.416658 0 0 1 53.416658-53.416658z" p-id="12130"></path></svg>
@@ -1 +0,0 @@
1
- <?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1714026084421" class="icon" viewBox="0 0 1180 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="11864" xmlns:xlink="http://www.w3.org/1999/xlink" width="230.46875" height="200"><path d="M0.040891 1024V477.751546a302.998089 302.998089 0 0 1 298.163013-307.948286h397.166948V0L1179.454044 288.37774l-484.083192 288.377741V406.95222h-397.166948a71.777853 71.777853 0 0 0-70.223721 72.526139v544.521641H0.040891z" fill="#606266" p-id="11865"></path></svg>
@@ -1,128 +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="control-model-group">
14
- <div :class="className" class="group-control">
15
- <div class="control-model" v-for="(item, index) in controllist" :key="index">
16
-
17
- <template v-if="othersControl && specialControl.indexOf(item.id) !== -1">
18
- <div class="single-model-new"
19
- :style="{'backgroundColor': item.bgcolor}"
20
- @click="selectModel(item)"
21
- v-if="isHasPermission(item.permission)">
22
- <div class="closephase-icon">
23
- <OthersIconSvg :type="item.type" />
24
- </div>
25
- <div class="single-model-name-theme">{{item.iconName}}</div>
26
- </div>
27
- </template>
28
-
29
- <template v-else>
30
- <div class="single-model-new"
31
- :style="{'backgroundColor': item.bgcolor}"
32
- @click="selectModel(item)"
33
- :class="preselecttype == item.type? 'single-model-select' : ''"
34
- v-if="isHasPermission(item.permission) && (funcSort === 'allFunc' || (funcSort === 'basicFunc'&& basicFuncControlId.indexOf(item.id) !== -1))">
35
- <!-- <svg-icon :icon-class="item.iconClass" className="model-icon"></svg-icon> -->
36
- <div class="model-icon">
37
- <IconSvg :type="item.type" />
38
- </div>
39
- <div class="single-model-name-theme">{{item.iconName}}</div>
40
- </div>
41
- </template>
42
- </div>
43
- </div>
44
- </div>
45
- </template>
46
-
47
- <script>
48
- import { hasPermission, getTheme } from '../../../../utils/auth'
49
-
50
- import IconSvg from './icon.vue'
51
- import OthersIconSvg from './othersIcon.vue'
52
-
53
- export default {
54
- name: 'ControlModelGroup',
55
- components: {
56
- IconSvg,
57
- OthersIconSvg
58
- },
59
- props: {
60
- className: {
61
- type: String
62
- },
63
- controlList: {
64
- type: Array
65
- },
66
- funcSort: {
67
- type: String,
68
- default: 'allFunc'
69
- },
70
- othersControl: {
71
- type: Boolean,
72
- default: false
73
- }
74
- },
75
- data () {
76
- return {
77
- preselecttype: '',
78
- controllist: [],
79
- specialControl: [23, 22, 100, 24, 25]
80
- }
81
- },
82
- computed: {
83
- },
84
- watch: {
85
- controlList: {
86
- handler (newVal, oldVal) {
87
- this.controllist = JSON.parse(JSON.stringify(newVal))
88
- },
89
- deep: true
90
- }
91
- },
92
- methods: {
93
- isHasPermission (path) {
94
- let res = hasPermission(path)
95
- return res
96
- },
97
- selectModel (item) {
98
- this.preselecttype = item.type
99
- this.clickType(item)
100
- if (this.specialControl.indexOf(item.id) !== -1) {
101
- this.$emit('selectSpecialModel')
102
- }
103
- this.$emit('selectModel', item)
104
- },
105
- init () {
106
- this.selectModel(this.controllist[0])
107
- },
108
- clickType (item) {
109
- this.curTypeItem = item
110
- for (let i = 0; i < this.controllist.length; i++) {
111
- if (this.controllist[i].clicked) {
112
- delete this.controllist[i].clicked
113
- this.controllist[i].bgcolor = getTheme() === 'light' ? '#edf6ff' : '#243d59'
114
- }
115
- }
116
- for (let i = 0; i < this.controllist.length; i++) {
117
- if (this.controllist[i].type === item.type) {
118
- this.controllist[i].clicked = true
119
- this.controllist[i].bgcolor = getTheme() === 'light' ? '#c1e0ff' : '#0082ac'
120
- }
121
- }
122
- }
123
- },
124
- mounted () {
125
- this.controllist = JSON.parse(JSON.stringify(this.controlList))
126
- }
127
- }
128
- </script>