openatc-components 0.0.57 → 0.0.62

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.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openatc-components",
3
- "version": "0.0.57",
3
+ "version": "0.0.62",
4
4
  "description": "A Vue.js project",
5
5
  "author": "openatc developer",
6
6
  "private": false,
@@ -54,7 +54,7 @@ export default {
54
54
  props: {
55
55
  reqUrl: {
56
56
  type: String,
57
- default: 'http://192.168.13.105:11003/openatc'
57
+ default: ''
58
58
  },
59
59
  AgentId: {
60
60
  type: String,
@@ -116,7 +116,7 @@ import { getMessageByCode } from '../../../utils/responseMessage'
116
116
  import { GetAllFaultRange } from '../../../api/fault'
117
117
  import PhaseDataModel from '../IntersectionMap/crossDirection/utils.js'
118
118
  import CrossDiagramMgr from '../../../EdgeMgr/controller/crossDiagramMgr.js'
119
- import { setToken } from '../../../utils/auth.js'
119
+ import { setToken, setHost } from '../../../utils/auth.js'
120
120
  import RingDataModel from '../../../utils/RingDataModel.js'
121
121
  import { getIntersectionInfo } from '../../../api/template'
122
122
  export default {
@@ -129,6 +129,10 @@ export default {
129
129
  TentativePlanControlModal
130
130
  },
131
131
  props: {
132
+ reqUrl: {
133
+ type: String,
134
+ default: ''
135
+ },
132
136
  responseTime: {
133
137
  type: Number,
134
138
  default: 0
@@ -327,6 +331,7 @@ export default {
327
331
  }
328
332
  },
329
333
  created () {
334
+ this.setHost(this.reqUrl)
330
335
  this.PhaseDataModel = new PhaseDataModel(this.roadDirection)
331
336
  this.CrossDiagramMgr = new CrossDiagramMgr()
332
337
  if (this.realtimeStatusModalvisible === false) {
@@ -342,6 +347,12 @@ export default {
342
347
  this.realtimeStages()
343
348
  },
344
349
  methods: {
350
+ setHost (host) {
351
+ // 获取组件外传入的token,便于独立组件调用接口
352
+ if (host && host !== '') {
353
+ setHost(host)
354
+ }
355
+ },
345
356
  getIntersectionInfo (agentid) {
346
357
  // 获取路口信息
347
358
  getIntersectionInfo(agentid).then(res => {
@@ -36,7 +36,7 @@
36
36
  <el-form-item
37
37
  :label="$t('openatccomponents.overview.patternoffset') + ':'"
38
38
  prop="count">
39
- <el-input v-model="offset" size="mini" :placeholder="$t('openatccomponents.common.input')"></el-input>
39
+ <el-input v-model="manualInfo.offset" size="mini" :placeholder="$t('openatccomponents.common.input')"></el-input>
40
40
  </el-form-item>
41
41
  <el-form-item
42
42
  :label="$t('openatccomponents.overview.duration') + ':'"
@@ -186,7 +186,7 @@ export default {
186
186
  return this.patternOne.length === 0 ? this.max : (this.patternOne.length > 0 && (this.patternOne[0].cycle < this.max)) ? this.max : this.patternOne[0].cycle
187
187
  },
188
188
  offset () {
189
- return this.patternOne.length === 0 ? 0 : this.patternOne[0].offset
189
+ return Number((this.patternOne.length === 0 || this.manualInfo.offset > 0) ? this.manualInfo.offset : this.patternOne[0].offset)
190
190
  },
191
191
  forbiddenstage () {
192
192
  return this.patternOne.length === 0 ? this.allPatternList[0].forbiddenstage : this.patternOne[0].forbiddenstage
@@ -1247,9 +1247,11 @@ export default {
1247
1247
  }
1248
1248
  },
1249
1249
  selectPattern () {
1250
+ this.manualInfo.offset = 0
1250
1251
  this.patternOne = this.allPatternList.filter(item => {
1251
1252
  return item.id === this.manualInfo.tempPatternid
1252
1253
  })
1254
+ this.manualInfo.offset = this.offset
1253
1255
  for (let rings of this.patternOne[0].rings) {
1254
1256
  if (rings.length === 0) continue
1255
1257
  for (let ring of rings) {
@@ -1403,7 +1405,7 @@ export default {
1403
1405
  let submitdata = {
1404
1406
  control: 100,
1405
1407
  delay: this.manualInfo.tempDelay !== undefined ? Number(this.manualInfo.tempDelay) : 0,
1406
- duration: this.manualInfo.duration,
1408
+ duration: Number(this.manualInfo.duration),
1407
1409
  // duration: this.manualInfo.tempDuration !== undefined ? Number(this.manualInfo.tempDuration) : 0,
1408
1410
  data: {}
1409
1411
  }
@@ -102,7 +102,7 @@ export default {
102
102
  props: {
103
103
  reqUrl: {
104
104
  type: String,
105
- default: 'http://192.168.13.105:11003/openatc'
105
+ default: ''
106
106
  },
107
107
  AgentId: {
108
108
  type: String,
@@ -19,6 +19,7 @@ import StageBord from './components/StageBord/index'
19
19
  import ExpendConfig from './components/ExpendConfig/index'
20
20
  import PatternWalkSvg from './components/PatternWalkSvg/index'
21
21
  import tentativeplancontrolmodal from './components/SchemeConfig/tentativeplancontrolmodal/index'
22
+ import { setToken, setHost } from '../utils/auth.js'
22
23
 
23
24
  import en from '../i18n/language/en'
24
25
  import zh from '../i18n/language/zh'
@@ -53,6 +54,11 @@ const language = {
53
54
  zh
54
55
  }
55
56
 
57
+ const func = {
58
+ setHost,
59
+ setToken
60
+ }
61
+
56
62
  const requireAll = requireContext => requireContext.keys().map(requireContext)
57
63
  const install = function (Vue) {
58
64
  if (install.installed) return
@@ -79,7 +85,8 @@ if (typeof window !== 'undefined' && window.Vue) {
79
85
  const API = {
80
86
  install,
81
87
  ...components,
82
- language
88
+ language,
89
+ func
83
90
  }
84
91
 
85
92
  export default API
package/src/utils/auth.js CHANGED
@@ -11,8 +11,9 @@
11
11
  **/
12
12
  var localStorage = require('../lib/publicjs/localStorage')
13
13
 
14
+ const nameSpace = 'openatc_conponents_'
14
15
  const LoginKey = 'token'
15
- const LoginHost = 'kisshost'
16
+ const LoginHost = nameSpace + 'kisshost'
16
17
  const typeKey = 'type'
17
18
  const type = 'edge'
18
19
  const simuKey = 'simu_key'