openatc-components 0.0.90 → 0.0.93

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.90",
3
+ "version": "0.0.93",
4
4
  "description": "A Vue.js project",
5
5
  "author": "openatc developer",
6
6
  "private": false,
@@ -9,6 +9,7 @@
9
9
  * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
10
10
  * See the Mulan PSL v2 for more details.
11
11
  **/
12
+ <!--静态渠化路口,需要传入路口状态数据和检测器状态数据-->
12
13
  <template>
13
14
  <div class="show-channelization" :class="{
14
15
  'superlargeCrossImg': bodyDomWidth <= 1680 && bodyDomWidth > 1440,
@@ -9,7 +9,7 @@
9
9
  * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
10
10
  * See the Mulan PSL v2 for more details.
11
11
  **/
12
- <!--动态路口图,只需要设备AgentId,此组件会处理方案状态接口轮询-->
12
+ <!--动态渠化路口图,只需要设备AgentId,此组件会处理方案状态接口轮询-->
13
13
  <template>
14
14
  <div class="channelization-with-interface">
15
15
  <Channelization
@@ -24,7 +24,7 @@ import Channelization from '../Channelization/Channelization'
24
24
  import { getMessageByCode } from '../../../utils/responseMessage'
25
25
  import { getTscControl, queryDevice, putTscControl } from '../../../api/control.js'
26
26
  import { registerMessage, uploadSingleTscParam } from '../../../api/param'
27
- import { getIframdevid, setIframdevid, setToken, setHost } from '../../../utils/auth.js'
27
+ import { setIframdevid, setToken, setHost } from '../../../utils/auth.js'
28
28
  import ControlFormat from '../../../utils/ControlFormat.js'
29
29
  import { getDetectorStatus } from '../../../api/cross'
30
30
  export default {
@@ -56,31 +56,27 @@ export default {
56
56
  Token: {
57
57
  type: String,
58
58
  default: ''
59
- },
60
- roadDirection: {
61
- type: String,
62
- default: 'right'
63
- },
64
- isShowInterval: {
65
- type: Boolean,
66
- default: true
67
- },
68
- isShowState: {
69
- type: Boolean,
70
- devault: false
71
- },
72
- isShowMode: {
73
- type: Boolean,
74
- default: false
75
- },
76
- modeName: {
77
- type: String,
78
- default: ''
79
- },
80
- controlName: {
81
- type: String,
82
- default: ''
83
59
  }
60
+ // isShowInterval: {
61
+ // type: Boolean,
62
+ // default: true
63
+ // },
64
+ // isShowState: {
65
+ // type: Boolean,
66
+ // devault: false
67
+ // },
68
+ // isShowMode: {
69
+ // type: Boolean,
70
+ // default: false
71
+ // },
72
+ // modeName: {
73
+ // type: String,
74
+ // default: ''
75
+ // },
76
+ // controlName: {
77
+ // type: String,
78
+ // default: ''
79
+ // }
84
80
  },
85
81
  watch: {
86
82
  AgentId: {
@@ -154,8 +150,8 @@ export default {
154
150
  },
155
151
  initData () {
156
152
  this.intervalFlag = false
157
- let iframdevid = getIframdevid()
158
- console.log(iframdevid)
153
+ // let iframdevid = getIframdevid()
154
+ // console.log(iframdevid)
159
155
  let startTime = new Date().getTime()
160
156
  getTscControl(this.AgentId).then((data) => {
161
157
  let endTime = new Date().getTime()
@@ -9,6 +9,7 @@
9
9
  * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
10
10
  * See the Mulan PSL v2 for more details.
11
11
  **/
12
+ <!--渠化绘制功能-->
12
13
  <template>
13
14
  <div class="custom-cross" v-if="visible">
14
15
  <ImportDialog ref="importDialog" @loadSvgString="loadSvgString"/>
@@ -9,6 +9,7 @@
9
9
  * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
10
10
  * See the Mulan PSL v2 for more details.
11
11
  **/
12
+ <!--完整渠化编辑功能,包含导入-->
12
13
  <template>
13
14
  <div class="custom-cross-part">
14
15
  <FirstImportCrossmap v-if="pageindex === 1"
@@ -22,7 +23,7 @@
22
23
  <script>
23
24
  import FirstImportCrossmap from './firstImportCrossmap'
24
25
  import CustomDraw from './index.draw'
25
- import { mapState } from 'vuex'
26
+ // import { mapState } from 'vuex'
26
27
  // import { getIframdevid } from '../../../../utils/auth.js'
27
28
  import { getChannelizatonChart } from '../../../../api/cross'
28
29
  // import { getMessageByCode } from '../../../utils/responseMessage.js'
@@ -44,22 +45,11 @@ export default {
44
45
  },
45
46
  data () {
46
47
  return {
47
- pageindex: 1,
48
+ pageindex: 1, // 渠化编辑显示: 1 代表首次导入 2 代表已有保存的渠化图
48
49
  loadedChannelizatonData: {} // 接口返回的已保存路口渠化数据
49
50
  }
50
51
  },
51
- computed: {
52
- ...mapState({
53
- channelizationPageIndex: state => state.globalParam.channelizationPageIndex,
54
- curOpenatcAgentid: state => state.globalParam.curOpenatcAgentid
55
- })
56
- },
57
52
  watch: {
58
- channelizationPageIndex: {
59
- handler: function (index) {
60
- this.pageindex = index
61
- }
62
- },
63
53
  AgentId: {
64
54
  handler: function (val) {
65
55
  this.getChannelizatonChart()
@@ -85,7 +75,7 @@ export default {
85
75
  getChannelizatonChart () {
86
76
  // let agentid = getIframdevid()
87
77
  let _this = this
88
- _this.$store.dispatch('SetChannelizationPageIndex', false)
78
+ _this.pageindex = 1
89
79
  getChannelizatonChart(this.AgentId).then(data => {
90
80
  if (!data.data.success) {
91
81
  // let parrenterror = getMessageByCode(data.data.code, _this.$i18n.locale)
@@ -102,7 +92,7 @@ export default {
102
92
  return
103
93
  }
104
94
  if (JSON.stringify(data.data.data) === '{}') return
105
- _this.$store.dispatch('SetChannelizationPageIndex', true)
95
+ _this.pageindex = 2
106
96
  _this.loadedChannelizatonData = JSON.parse(JSON.stringify(data.data.data))
107
97
  })
108
98
  },
@@ -22,6 +22,7 @@ import ExpendConfig from './components/ExpendConfig/index'
22
22
  import PatternWalkSvg from './components/PatternWalkSvg/index'
23
23
  import tentativeplancontrolmodal from './components/SchemeConfig/tentativeplancontrolmodal/index'
24
24
  import { setToken, setHost } from '../utils/auth.js'
25
+ import componentsGlobalParam from '../store/modules/globalParam'
25
26
 
26
27
  import en from '../i18n/language/en'
27
28
  import zh from '../i18n/language/zh'
@@ -63,6 +64,10 @@ const func = {
63
64
  setToken
64
65
  }
65
66
 
67
+ const Store = {
68
+ componentsGlobalParam
69
+ }
70
+
66
71
  const requireAll = requireContext => requireContext.keys().map(requireContext)
67
72
  const install = function (Vue) {
68
73
  if (install.installed) return
@@ -90,7 +95,8 @@ const API = {
90
95
  install,
91
96
  ...components,
92
97
  language,
93
- func
98
+ func,
99
+ Store
94
100
  }
95
101
 
96
102
  export default API
@@ -38,7 +38,6 @@ const tscParam = {
38
38
  const Global = {
39
39
  state: {
40
40
  tscParam: JSON.parse(JSON.stringify(tscParam)),
41
- channelizationPageIndex: 1, // 总览编辑页面显示: 1 代表首次导入 2 代表已有保存的渠化图
42
41
  associatedPhaseList: [], // 关联相位列表
43
42
  PhaseDataMgr: {} // 关联相位数据处理模型
44
43
  },
@@ -51,13 +50,6 @@ const Global = {
51
50
  },
52
51
  INIT_PHASE_DATA_MGR: (state, PhaseDataMgrClass) => {
53
52
  state.PhaseDataMgr = PhaseDataMgrClass
54
- },
55
- SET_CHANNELZATION_PAGE_INDEX: (state, isHasChannelSetting) => {
56
- if (isHasChannelSetting) {
57
- state.channelizationPageIndex = 2
58
- } else {
59
- state.channelizationPageIndex = 1
60
- }
61
53
  }
62
54
  },
63
55
  actions: {
@@ -69,9 +61,6 @@ const Global = {
69
61
  },
70
62
  InitPhaseDataMgr ({ commit }, PhaseDataMgrClass) {
71
63
  commit('INIT_PHASE_DATA_MGR', PhaseDataMgrClass)
72
- },
73
- SetChannelizationPageIndex ({ commit }, isHasChannelSetting) {
74
- commit('SET_CHANNELZATION_PAGE_INDEX', isHasChannelSetting)
75
64
  }
76
65
  }
77
66
  }
@@ -16,7 +16,7 @@ export default {
16
16
  name: 'custom-channelization-demo',
17
17
  data () {
18
18
  return {
19
- agentId: '40001-547',
19
+ agentId: '10003-391',
20
20
  tscParams: {}
21
21
  }
22
22
  },
@@ -67,7 +67,12 @@
67
67
  :Token="Token"/> -->
68
68
 
69
69
  <channelization-with-interface
70
- :AgentId="agentId" />
70
+ ref="channelization"
71
+ :AgentId="agentId"
72
+ :reqUrl="reqUrl"
73
+ :Token="Token"
74
+ @getTscControl="getTscControl"
75
+ @onPhaseChange="onPhaseChange"/>
71
76
  <!-- <ChannelizationWithInterface
72
77
  :AgentId="agentId" /> -->
73
78
  </div>
@@ -178,11 +183,10 @@ export default {
178
183
  console.log('onPhaseChange:')
179
184
  console.log(res, index)
180
185
  this.stagesList = res
181
- // this.currentStage = index;
186
+ // this.currentStage = index
182
187
  },
183
188
  getTscControl (res) {
184
- console.log('getTscControl:')
185
- console.log(res)
189
+ console.log('getTscControl:', res)
186
190
  // let control = res.data.data.control
187
191
  // let mode = res.data.data.mode
188
192
  // console.log("control,mode:",control,mode)
@@ -190,12 +194,10 @@ export default {
190
194
  // this.modeName = mode
191
195
  },
192
196
  registerMessage (res) {
193
- console.log('registerMessage')
194
- console.log(res)
197
+ console.log('registerMessage:', res)
195
198
  },
196
199
  queryDevice (res) {
197
- console.log('queryDevice')
198
- console.log(res)
200
+ console.log('queryDevice:', res)
199
201
  },
200
202
  clearInterVals () {
201
203
  this.$refs.intersection.clearInterVals()
@@ -53,7 +53,7 @@ export default {
53
53
  lockPhaseBtnName: this.$t('openatccomponents.overview.comfirm'),
54
54
  agentId: '10002-994',
55
55
  Token: 'eyJraWQiOiIxNjUzMjgyODkwMDYxIiwidHlwIjoiSldUIiwiYWxnIjoiSFMyNTYifQ.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTczOTY4Mjg5MCwiaWF0IjoxNjUzMjgyODkwfQ.emqFxXlot1Zk6TGkLMDx0zIp2B8toSz17xdZI_DrXZI',
56
- Token103: 'eyJraWQiOiIxNjU4MzgxMzQ4NjczIiwidHlwIjoiSldUIiwiYWxnIjoiSFMyNTYifQ.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc0NDc4NDY1NSwiaWF0IjoxNjU4Mzg0NjU1fQ.5HIdmPgPCf9n5NbyVqXFq7rFA3g1IxGDw3IQeB6fJ8s',
56
+ Token103: 'eyJraWQiOiIxNjQ5MzM4NzA5MTA0IiwidHlwIjoiSldUIiwiYWxnIjoiSFMyNTYifQ.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTczNTczODcwOSwiaWF0IjoxNjQ5MzM4NzA5fQ.JDSkpT1SbB61dEKvorhVdZJHKJzoQZEY5DPKHs1Imo0',
57
57
  boxVisible: false,
58
58
  dialogWidth: '80%',
59
59
  crossStatusData: {} // 路口状态数据
@@ -118,7 +118,7 @@ export default {
118
118
  this.setDialogWidth()
119
119
  },
120
120
  mounted () {
121
- this.setPropsToken(this.Token103)
121
+ this.setPropsToken(this.Token)
122
122
  this.initData()
123
123
  window.onresize = () => {
124
124
  return (() => {