openatc-components 0.1.102 → 0.1.104

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.
@@ -77,6 +77,14 @@
77
77
  @closePhaseBack="closePhaseBack"
78
78
  @closePhaseControl="closePhaseControl"
79
79
  />
80
+ <AzimuthLocking
81
+ v-if="specialPage === 'azimuthlocking'"
82
+ :realtimeStatusModalvisible="realtimeStatusModalvisible"
83
+ :phaseList="phaseList"
84
+ :patternStatus="statusData"
85
+ @closePhaseBack="closePhaseBack"
86
+ @closePhaseControl="closePhaseControl"
87
+ />
80
88
  </div>
81
89
  </transition>
82
90
 
@@ -117,6 +125,7 @@ import ManualControlModal from './manualControlModal'
117
125
  import ClosePhaseControlModal from './closePhaselControlModal'
118
126
  import LockingPhaseControlModal from './lockingPhaselControlModal'
119
127
  import TentativePlanControlModal from './tentativeplancontrolmodal'
128
+ import AzimuthLocking from './azimuthlocking'
120
129
  import priorityControl from './priorityControl'
121
130
  // import { getFaultMesZh, getFaultMesEn } from '../../utils/faultcode.js'
122
131
  import { getMessageByCode } from '../../../utils/responseMessage'
@@ -134,6 +143,7 @@ export default {
134
143
  ClosePhaseControlModal,
135
144
  LockingPhaseControlModal,
136
145
  priorityControl,
146
+ AzimuthLocking,
137
147
  TentativePlanControlModal
138
148
  },
139
149
  props: {
@@ -318,6 +328,10 @@ export default {
318
328
  id: 24,
319
329
  permission: 'configer:manual:preempt',
320
330
  iconClass: 'tentativeplan'
331
+ }, {
332
+ id: 25,
333
+ permission: 'configer:manual:optimize',
334
+ iconClass: 'azimuthlocking'
321
335
  }],
322
336
  phaseRings: [],
323
337
  curFaultList: [],
@@ -662,6 +676,11 @@ export default {
662
676
  this.isClosePhase = true
663
677
  this.phaseRings = ringDataModel.initRingPhaseData()
664
678
  this.specialPage = 'prioritycontrol'
679
+ } else if (id === 25) {
680
+ this.toPage = 3
681
+ this.isClosePhase = true
682
+ this.phaseRings = ringDataModel.initRingPhaseData()
683
+ this.specialPage = 'azimuthlocking'
665
684
  } else {
666
685
  this.isClosePhase = false
667
686
  this.specialPage = ''
@@ -0,0 +1,258 @@
1
+ <template>
2
+ <div class="tentativeplan-control">
3
+ <div class="title" style="margin-bottom: 18px;">{{$t('openatccomponents.overview.azimuthlocking')}}</div>
4
+ <el-row>
5
+ <el-col :span="12">
6
+ <el-form
7
+ ref="manual"
8
+ label-position="left"
9
+ :model="manualInfo"
10
+ label-width="100px">
11
+ <el-form-item
12
+ :label="$t('openatccomponents.overview.duration') + ':'"
13
+ prop="count">
14
+ <el-input-number :placeholder="$t('openatccomponents.common.input')" :min="0" :max="65535" :precision="0" :step="1" :controls="false" v-model.number="manualInfo.duration" size="mini"></el-input-number>
15
+ </el-form-item>
16
+ <el-form-item
17
+ :label="$t('openatccomponents.overview.yellowflash') + ':'"
18
+ prop="intersection">
19
+ <el-input-number :placeholder="$t('openatccomponents.common.input')" :min="0" :max="65535" :precision="0" :step="1" :controls="false" v-model.number="manualInfo.yellowflash" size="mini"></el-input-number>
20
+ </el-form-item>
21
+ <el-form-item
22
+ :label="$t('openatccomponents.overview.mingreen') + ':'"
23
+ prop="intersection">
24
+ <el-input-number :placeholder="$t('openatccomponents.common.input')" :min="0" :max="65535" :precision="0" :step="1" :controls="false" v-model.number="manualInfo.mingreen" size="mini"></el-input-number>
25
+ </el-form-item>
26
+ </el-form>
27
+ </el-col>
28
+ <el-col :span="12">
29
+ <el-form
30
+ ref="manual"
31
+ label-position="left"
32
+ :model="manualInfo"
33
+ label-width="100px">
34
+ <el-form-item
35
+ :label="$t('openatccomponents.overview.greenclear') + ':'"
36
+ prop="count">
37
+ <el-input-number :placeholder="$t('openatccomponents.common.input')" :min="0" :max="65535" :precision="0" :step="1" :controls="false" v-model.number="manualInfo.greenclear" size="mini"></el-input-number>
38
+ </el-form-item>
39
+ <el-form-item
40
+ :label="$t('openatccomponents.overview.allred') + ':'"
41
+ prop="intersection">
42
+ <el-input-number :placeholder="$t('openatccomponents.common.input')" :min="0" :max="65535" :precision="0" :step="1" :controls="false" v-model.number="manualInfo.allred" size="mini"></el-input-number>
43
+ </el-form-item>
44
+ </el-form>
45
+ </el-col>
46
+ </el-row>
47
+ <el-row>
48
+ <el-col :span="5">
49
+ <span class="model-label-title">{{$t('openatccomponents.overview.indirection')}}:</span>
50
+ </el-col>
51
+ <el-col :span="19">
52
+ <div class="control-model" v-for="(item, index) in imgs" :key="index">
53
+ <div :class="{'single-model-select':spanIndex.indexOf(index)>-1}" class="single-model" @click="boxShow(index,item)">
54
+ <div v-if="item.class" :class="item.class" style="border:0px"></div>
55
+ <div class="single-model-name">{{item.name}}</div>
56
+ </div>
57
+ </div>
58
+ <div v-if="currentName !==''" style="width: 100%; height: auto;overflow: hidden;">
59
+ <div style="margin-top:20px" class="model-label-title">{{currentName}}{{$t('openatccomponents.overview.currentphase')}}:</div>
60
+ <div class="control-model" v-for="(item, index) in sidewalkPhaseData" :key="index">
61
+ <div style="position:relative;" class="single-model">
62
+ <xdr-dir-selector Width="40PX" Height="40PX" :Data="showStyle" :showlist="item"></xdr-dir-selector>
63
+ <div style="height:65px;display:flex;flex-direction:row;justify-content:center;align-items:end;">
64
+ <div class="current-stage-num" style="width:20%;">{{index + 1}}</div>
65
+ <div style="width:70%;">
66
+ <i class="iconfont icon-feijidongche" style="font-size:11PX;color:#606266;margin-left:10PX" v-if="item[item.length-1].controltype === 6"></i>
67
+ <i class="iconfont icon-lukouzhilu" style="font-size:16PX;color:#454545;margin-left:10PX" v-if="item[item.length-1].controltype === 1"></i>
68
+ <i class="iconfont icon-BRT" style="font-size:11PX;color:#454545;margin-left:10PX" v-if="item[item.length-1].controltype === 4"></i>
69
+ <div style="transform:scale(0.65);margin-left:10PX">
70
+ <i class="iconfont icon-xuxiangwei-xin" style="font-size:5PX;color:#454545;" v-if="item[item.length-1].controltype === 99"></i>
71
+ </div>
72
+ <i class="iconfont icon-gongjiaoche" style="font-size:11PX;color:#606266;margin-left:10PX" v-if="item[item.length-1].controltype === 3"></i>
73
+ <i class="iconfont icon-youguidianche" style="font-size:11PX;color:#606266;margin-left:10PX" v-if="item[item.length-1].controltype === 5"></i>
74
+ </div>
75
+ </div>
76
+ </div>
77
+ </div>
78
+ </div>
79
+ <!-- </div> -->
80
+ </el-col>
81
+ </el-row>
82
+ <!-- <div class="model-label" style="width: auto;overflow: hidden;">
83
+ <span class="intitle">{{$t('openatccomponents.overview.indirection')}}:</span>
84
+ <div class="control-model" v-for="(item, index) in imgs" :key="index">
85
+ <div :class="{'single-model-select':spanIndex.indexOf(index)>-1}" class="single-model" @click="boxShow(index,item)">
86
+ <div v-if="item.class" :class="item.class" style="border:0px"></div>
87
+ <div class="single-model-name">{{item.name}}</div>
88
+ </div>
89
+ </div>
90
+ </div> -->
91
+ <div class="footer" v-if="realtimeStatusModalvisible">
92
+ <el-button @click="handleClose()">{{$t('openatccomponents.button.Back')}}</el-button>
93
+ <el-button type="primary" @click="handleManualControl()">{{$t('openatccomponents.overview.implement')}}</el-button>
94
+ </div>
95
+ <div class="footer" v-if="!realtimeStatusModalvisible">
96
+ <el-button @click="handleClose()">{{$t('openatccomponents.button.Back')}}</el-button>
97
+ <el-button type="primary" @click="handleManualControl()">{{$t('openatccomponents.overview.comfirm')}}</el-button>
98
+ </div>
99
+ </div>
100
+ </template>
101
+
102
+ <script>
103
+ import { getPhase } from './utils'
104
+ // import { getIframdevid } from '../../../../utils/auth'
105
+ import { getlockPhase, lockPhase } from '../../../../api/control'
106
+ import Stages from '../../Stages/index'
107
+ import RingDataModel from '../../../../utils/RingDataModel.js'
108
+ import { getMessageByCode } from '../../../../utils/responseMessage'
109
+ export default {
110
+ name: 'tentativeplancontrol',
111
+ components: {
112
+ Stages
113
+ },
114
+ props: {
115
+ realtimeStatusModalvisible: {
116
+ type: Boolean,
117
+ default: true
118
+ }
119
+ },
120
+ watch: {
121
+ sidewalkPhaseData: {
122
+ handler: function (val, oldVal) {
123
+ this.sidewalkPhaseData = val
124
+ },
125
+ // 深度观察监听
126
+ deep: true
127
+ }
128
+ },
129
+ computed: {
130
+ tankuangSize () {
131
+ let widths = ((100 / 2) - 2) + '%'
132
+ let styleObj = {
133
+ width: widths
134
+ }
135
+ return styleObj
136
+ },
137
+ imgs () {
138
+ let arrays = []
139
+ let images = getPhase()
140
+ images.forEach(v => {
141
+ let obj = Object.assign({}, v)
142
+ obj.name = this.$t(obj.name)
143
+ arrays.push(obj)
144
+ })
145
+ return arrays
146
+ }
147
+ },
148
+ data () {
149
+ return {
150
+ showStyle: {
151
+ top: '5PX',
152
+ left: '14px'
153
+ },
154
+ sidewalkPhaseData: [],
155
+ currentName: '',
156
+ lockList: [],
157
+ patternCycleEqual: true,
158
+ spanIndex: [],
159
+ directions: [],
160
+ manualInfo: {
161
+ allred: 2,
162
+ greenclear: 6,
163
+ mingreen: 15,
164
+ duration: 600,
165
+ yellowflash: 3
166
+ }
167
+ }
168
+ },
169
+ created () {
170
+ },
171
+ methods: {
172
+ checkId (val) {
173
+ if (val.id === 1) {
174
+ return 2
175
+ } else if (val.id === 5) {
176
+ return 1
177
+ } else if (val.id === 13) {
178
+ return 4
179
+ } else if (val.id === 9) {
180
+ return 3
181
+ } else if (val.id === 17) {
182
+ return 8
183
+ } else if (val.id === 21) {
184
+ return 5
185
+ } else if (val.id === 25) {
186
+ return 7
187
+ } else if (val.id === 29) {
188
+ return 6
189
+ }
190
+ },
191
+ getLockPhase (val) {
192
+ this.directions = [this.checkId(val)]
193
+ let param = {
194
+ 'agentid': 'config_test',
195
+ 'direction': this.directions
196
+ }
197
+ getlockPhase(param).then(res => {
198
+ if (res.data.success !== true) {
199
+ this.$message.error(getMessageByCode(res.data.code, this.$i18n.locale))
200
+ return
201
+ }
202
+ this.lockList = res.data.data
203
+ let ringDataModel = new RingDataModel({}, res.data.data)
204
+ this.sidewalkPhaseData = ringDataModel.getlockData()
205
+ })
206
+ },
207
+ boxShow (index, data) {
208
+ this.spanIndex = []
209
+ let arrIndex = this.spanIndex.indexOf(index)
210
+ if (arrIndex > -1) {
211
+ this.spanIndex.splice(arrIndex, 1)
212
+ } else {
213
+ this.spanIndex.push(index)
214
+ }
215
+ this.getLockPhase(data)
216
+ this.currentName = data.name
217
+ },
218
+ handleClose () {
219
+ this.$emit('closePhaseBack')
220
+ },
221
+ handleManualControl () {
222
+ if (this.directions.length === 0) {
223
+ this.$message.error(this.$t('openatccomponents.overview.directionnull'))
224
+ return
225
+ }
226
+ let submitdata = {
227
+ agentid: 'config_test',
228
+ direction: this.directions,
229
+ greenflash: this.manualInfo.greenclear,
230
+ duration: this.manualInfo.duration,
231
+ yellow: this.manualInfo.yellowflash,
232
+ redclear: this.manualInfo.allred,
233
+ mingreen: this.manualInfo.mingreen
234
+
235
+ }
236
+ lockPhase(submitdata).then(res => {
237
+ if (res.data.success !== true) {
238
+ this.$message.error(getMessageByCode(res.data.code, this.$i18n.locale))
239
+ }
240
+ this.$alert(this.$t('openatccomponents.common.download'), { type: 'success' })
241
+ })
242
+ }
243
+ }
244
+ }
245
+ </script>
246
+
247
+ <style lang="scss" scoped>
248
+ .single-model-select {
249
+ margin-right: 10px;
250
+ text-align: center;
251
+ cursor:pointer;
252
+ width: 70px;
253
+ height: 65px;
254
+ background-color: #a2cfff;
255
+ border-radius: 6px;
256
+ // border: solid 1PX #409eff;
257
+ }
258
+ </style>
@@ -0,0 +1,92 @@
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
+ import store from '../../../../store/index'
13
+ let images = [
14
+ {
15
+ id: 1,
16
+ // name: 'East-Straight',
17
+ name: 'openatccomponents.overview.es',
18
+ // img: require('./images/East-Straight.svg'),
19
+ class: 'iconfont icon-dongzhihang'
20
+ },
21
+ {
22
+ id: 5,
23
+ // name: 'West-Straight',
24
+ name: 'openatccomponents.overview.ws',
25
+ // img: require('./images/West-Straight.svg'),
26
+ class: 'iconfont icon-xizhihang'
27
+ },
28
+ {
29
+ id: 13,
30
+ // name: 'South-Straight',
31
+ name: 'openatccomponents.overview.ss',
32
+ // img: require('./images/South-Straight.svg'),
33
+ class: 'iconfont icon-nanzhihang'
34
+ },
35
+ {
36
+ id: 9,
37
+ // name: 'North-Straight',
38
+ name: 'openatccomponents.overview.ns',
39
+ // img: require('./images/North-Straight.svg'),
40
+ class: 'iconfont icon-beizhihang'
41
+ },
42
+ {
43
+ id: 17,
44
+ // name: 'South-Back',
45
+ name: 'openatccomponents.overview.ses',
46
+ // img: require('./images/South-Back.svg'),
47
+ class: 'iconfont icon-dongnanzhihang'
48
+ },
49
+ {
50
+ id: 21,
51
+ // name: 'South-Back',
52
+ name: 'openatccomponents.overview.sws',
53
+ // img: require('./images/South-Back.svg'),
54
+ class: 'iconfont icon-xinanzhihang'
55
+ },
56
+ {
57
+ id: 25,
58
+ // name: 'South-Back',
59
+ name: 'openatccomponents.overview.nes',
60
+ // img: require('./images/South-Back.svg'),
61
+ class: 'iconfont icon-dongbeizhihang'
62
+ },
63
+ {
64
+ id: 29,
65
+ // name: 'South-Back',
66
+ name: 'openatccomponents.overview.nws',
67
+ // img: require('./images/South-Back.svg'),
68
+ class: 'iconfont icon-xibeizhihang'
69
+ }
70
+ ]
71
+ const getPhase = () => {
72
+ if (store.getters.roadDirection === 'left') {
73
+ // 左行下,掉头图标替换
74
+ images.forEach((img) => {
75
+ if (img.id === 4) {
76
+ img.class = 'iconfont icon-dongtiaotou-yinni'
77
+ }
78
+ if (img.id === 8) {
79
+ img.class = 'iconfont icon-xitiaotou-yinni'
80
+ }
81
+ if (img.id === 12) {
82
+ img.class = 'iconfont icon-beitiaotou-yinni'
83
+ }
84
+ if (img.id === 16) {
85
+ img.class = 'iconfont icon-nantiaotou-yinni'
86
+ }
87
+ })
88
+ }
89
+ return images
90
+ }
91
+
92
+ export {getPhase}
@@ -125,6 +125,8 @@ export default {
125
125
  this.currentStage = this.crossStatusData.current_stage
126
126
  }
127
127
  }
128
+ console.log(list,'list')
129
+ console.log(this.phaseList,'this.phaseList')
128
130
  return list
129
131
  },
130
132
  stageStyle () {