openatc-components 0.0.84 → 0.0.89

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 (120) hide show
  1. package/config/index.js +2 -3
  2. package/package/kisscomps/components/Channelization/Channelization.vue +544 -0
  3. package/package/kisscomps/components/Channelization/index.js +2 -0
  4. package/package/kisscomps/components/ChannelizationWithInterface/ChannelizationWithInterface.vue +498 -0
  5. package/package/kisscomps/components/ChannelizationWithInterface/index.js +2 -0
  6. package/package/kisscomps/components/DrawChannelization/drawsvg/channelizationElements.vue +249 -0
  7. package/package/kisscomps/components/DrawChannelization/drawsvg/detectorAssociatedComponent.vue +152 -0
  8. package/package/kisscomps/components/DrawChannelization/drawsvg/drawElement/TextBox.vue +91 -0
  9. package/package/kisscomps/components/DrawChannelization/drawsvg/drawElement/crossMap.vue +176 -0
  10. package/package/kisscomps/components/DrawChannelization/drawsvg/drawElement/editText.vue +108 -0
  11. package/package/kisscomps/components/DrawChannelization/drawsvg/firstImportCrossmap.vue +48 -0
  12. package/package/kisscomps/components/DrawChannelization/drawsvg/iconSvg/countdownSvg.vue +182 -0
  13. package/package/kisscomps/components/DrawChannelization/drawsvg/iconSvg/detectorChart.vue +222 -0
  14. package/package/kisscomps/components/DrawChannelization/drawsvg/iconSvg/detectorIconSvg.vue +191 -0
  15. package/package/kisscomps/components/DrawChannelization/drawsvg/iconSvg/laneIcon.vue +78 -0
  16. package/package/kisscomps/components/DrawChannelization/drawsvg/iconSvg/motorwayIconSvg.vue +433 -0
  17. package/package/kisscomps/components/DrawChannelization/drawsvg/iconSvg/pedroadIconSvg.vue +195 -0
  18. package/package/kisscomps/components/DrawChannelization/drawsvg/importDialog.vue +71 -0
  19. package/package/kisscomps/components/DrawChannelization/drawsvg/index.draw.vue +940 -0
  20. package/package/kisscomps/components/DrawChannelization/drawsvg/index.vue +119 -0
  21. package/package/kisscomps/components/DrawChannelization/drawsvg/laneEditPanel.vue +563 -0
  22. package/package/kisscomps/components/DrawChannelization/drawsvg/overlapAssociatedComponent.vue +157 -0
  23. package/package/kisscomps/components/DrawChannelization/drawsvg/phaseAssociatedComponent.check.vue +191 -0
  24. package/package/kisscomps/components/DrawChannelization/drawsvg/phaseAssociatedComponent.syncOper.vue +331 -0
  25. package/package/kisscomps/components/DrawChannelization/drawsvg/phaseAssociatedComponent.vue +157 -0
  26. package/package/kisscomps/components/DrawChannelization/drawsvg/table.vue +99 -0
  27. package/package/kisscomps/components/DrawChannelization/drawsvg/utils/loadutils.js +43 -0
  28. package/package/kisscomps/components/DrawChannelization/drawsvg/utils/phaseDataModel.js +32 -0
  29. package/package/kisscomps/components/DrawChannelization/drawsvg/utils/phasePos.json +20 -0
  30. package/package/kisscomps/components/DrawChannelization/index.js +2 -0
  31. package/package/kisscomps/components/DrawChannelization/phaseDataMgr.js +278 -0
  32. package/package/kisscomps/components/KanBan/kanban.vue +1 -1
  33. package/package/kisscomps/components/MessageBox/index.vue +96 -0
  34. package/package/kisscomps/components/SchemeConfig/SchemeConfig.vue +6 -2
  35. package/package/kisscomps/index.js +4 -0
  36. package/package/kissui.min.js +1 -1
  37. package/package.json +6 -5
  38. package/src/api/cross.js +33 -0
  39. package/src/i18n/language/en.js +77 -2
  40. package/src/i18n/language/zh.js +77 -2
  41. package/src/icons/svg/custom-BRTlane.svg +40 -0
  42. package/src/icons/svg/custom-bicyclelane.svg +7 -0
  43. package/src/icons/svg/custom-buslane.svg +40 -0
  44. package/src/icons/svg/custom-detector.svg +12 -0
  45. package/src/icons/svg/custom-east-bottom.svg +32 -0
  46. package/src/icons/svg/custom-east-top.svg +32 -0
  47. package/src/icons/svg/custom-ewped.svg +35 -0
  48. package/src/icons/svg/custom-motorway.svg +7 -0
  49. package/src/icons/svg/custom-nonmotorizedlane.svg +40 -0
  50. package/src/icons/svg/custom-north-left.svg +32 -0
  51. package/src/icons/svg/custom-north-right.svg +32 -0
  52. package/src/icons/svg/custom-pedcrossing.svg +7 -0
  53. package/src/icons/svg/custom-peddetector.svg +17 -0
  54. package/src/icons/svg/custom-pedeastward.svg +9 -0
  55. package/src/icons/svg/custom-pedestrian.svg +7 -0
  56. package/src/icons/svg/custom-pednorthward.svg +9 -0
  57. package/src/icons/svg/custom-pedsouthward.svg +9 -0
  58. package/src/icons/svg/custom-pedwestward.svg +9 -0
  59. package/src/icons/svg/custom-secondcrossing.svg +7 -0
  60. package/src/icons/svg/custom-sectionpedestrian.svg +7 -0
  61. package/src/icons/svg/custom-snped.svg +35 -0
  62. package/src/icons/svg/custom-south-left.svg +32 -0
  63. package/src/icons/svg/custom-south-right.svg +32 -0
  64. package/src/icons/svg/custom-straightahead.svg +7 -0
  65. package/src/icons/svg/custom-tramlane.svg +40 -0
  66. package/src/icons/svg/custom-turnaround.svg +7 -0
  67. package/src/icons/svg/custom-turnleft.svg +7 -0
  68. package/src/icons/svg/custom-turnright.svg +7 -0
  69. package/src/icons/svg/custom-vehiclebranch.svg +40 -0
  70. package/src/icons/svg/custom-vehiclemainroad.svg +41 -0
  71. package/src/icons/svg/custom-west-bottom.svg +32 -0
  72. package/src/icons/svg/custom-west-top.svg +32 -0
  73. package/src/icons/svg/custom-xlped.svg +14 -0
  74. package/src/icons/svg/custom-xpedestrian.svg +7 -0
  75. package/src/icons/svg/custom-xrped.svg +14 -0
  76. package/src/kisscomps/components/Channelization/Channelization.vue +544 -0
  77. package/src/kisscomps/components/Channelization/index.js +2 -0
  78. package/src/kisscomps/components/ChannelizationWithInterface/ChannelizationWithInterface.vue +498 -0
  79. package/src/kisscomps/components/ChannelizationWithInterface/index.js +2 -0
  80. package/src/kisscomps/components/DrawChannelization/drawsvg/channelizationElements.vue +249 -0
  81. package/src/kisscomps/components/DrawChannelization/drawsvg/detectorAssociatedComponent.vue +152 -0
  82. package/src/kisscomps/components/DrawChannelization/drawsvg/drawElement/TextBox.vue +91 -0
  83. package/src/kisscomps/components/DrawChannelization/drawsvg/drawElement/crossMap.vue +176 -0
  84. package/src/kisscomps/components/DrawChannelization/drawsvg/drawElement/editText.vue +108 -0
  85. package/src/kisscomps/components/DrawChannelization/drawsvg/firstImportCrossmap.vue +48 -0
  86. package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/countdownSvg.vue +182 -0
  87. package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/detectorChart.vue +222 -0
  88. package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/detectorIconSvg.vue +191 -0
  89. package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/laneIcon.vue +78 -0
  90. package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/motorwayIconSvg.vue +433 -0
  91. package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/pedroadIconSvg.vue +195 -0
  92. package/src/kisscomps/components/DrawChannelization/drawsvg/importDialog.vue +71 -0
  93. package/src/kisscomps/components/DrawChannelization/drawsvg/index.draw.vue +940 -0
  94. package/src/kisscomps/components/DrawChannelization/drawsvg/index.vue +119 -0
  95. package/src/kisscomps/components/DrawChannelization/drawsvg/laneEditPanel.vue +563 -0
  96. package/src/kisscomps/components/DrawChannelization/drawsvg/overlapAssociatedComponent.vue +157 -0
  97. package/src/kisscomps/components/DrawChannelization/drawsvg/phaseAssociatedComponent.check.vue +191 -0
  98. package/src/kisscomps/components/DrawChannelization/drawsvg/phaseAssociatedComponent.syncOper.vue +331 -0
  99. package/src/kisscomps/components/DrawChannelization/drawsvg/phaseAssociatedComponent.vue +157 -0
  100. package/src/kisscomps/components/DrawChannelization/drawsvg/table.vue +99 -0
  101. package/src/kisscomps/components/DrawChannelization/drawsvg/utils/loadutils.js +43 -0
  102. package/src/kisscomps/components/DrawChannelization/drawsvg/utils/phaseDataModel.js +32 -0
  103. package/src/kisscomps/components/DrawChannelization/drawsvg/utils/phasePos.json +20 -0
  104. package/src/kisscomps/components/DrawChannelization/index.js +2 -0
  105. package/src/kisscomps/components/DrawChannelization/phaseDataMgr.js +278 -0
  106. package/src/kisscomps/components/KanBan/kanban.vue +1 -1
  107. package/src/kisscomps/components/MessageBox/index.vue +96 -0
  108. package/src/kisscomps/components/SchemeConfig/SchemeConfig.vue +6 -2
  109. package/src/kisscomps/index.js +4 -0
  110. package/src/main.js +3 -0
  111. package/src/router/index.js +7 -0
  112. package/src/store/index.js +2 -2
  113. package/src/store/modules/globalParam.js +67 -16
  114. package/src/utils/RingDataModel.js +11 -0
  115. package/src/views/customchannelization.vue +50 -0
  116. package/src/views/intersection.vue +8 -2
  117. package/src/views/schemeconfig.vue +2 -2
  118. package/static/apiconfig.json +15 -0
  119. package/static/styles/channelizatioon.scss +365 -0
  120. package/static/styles/common.scss +1 -0
@@ -0,0 +1,119 @@
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="custom-cross-part">
14
+ <FirstImportCrossmap v-if="pageindex === 1"
15
+ @loadSvgString="loadSvgString" />
16
+ <CustomDraw v-show="pageindex === 2" ref="CustomDraw"
17
+ :AgentId="AgentId"
18
+ :loadedChannelizatonData="loadedChannelizatonData"
19
+ @saveCallback="saveCallback" />
20
+ </div>
21
+ </template>
22
+ <script>
23
+ import FirstImportCrossmap from './firstImportCrossmap'
24
+ import CustomDraw from './index.draw'
25
+ import { mapState } from 'vuex'
26
+ // import { getIframdevid } from '../../../../utils/auth.js'
27
+ import { getChannelizatonChart } from '../../../../api/cross'
28
+ // import { getMessageByCode } from '../../../utils/responseMessage.js'
29
+
30
+ export default {
31
+ name: 'custom-channelization',
32
+ components: {
33
+ FirstImportCrossmap,
34
+ CustomDraw
35
+ },
36
+ props: {
37
+ AgentId: {
38
+ type: String,
39
+ default: '0'
40
+ },
41
+ tscParam: {
42
+ type: Object
43
+ }
44
+ },
45
+ data () {
46
+ return {
47
+ pageindex: 1,
48
+ loadedChannelizatonData: {} // 接口返回的已保存路口渠化数据
49
+ }
50
+ },
51
+ computed: {
52
+ ...mapState({
53
+ channelizationPageIndex: state => state.globalParam.channelizationPageIndex,
54
+ curOpenatcAgentid: state => state.globalParam.curOpenatcAgentid
55
+ })
56
+ },
57
+ watch: {
58
+ channelizationPageIndex: {
59
+ handler: function (index) {
60
+ this.pageindex = index
61
+ }
62
+ },
63
+ curOpenatcAgentid: {
64
+ handler: function (val) {
65
+ this.getChannelizatonChart()
66
+ },
67
+ deep: true
68
+ },
69
+ tscParam: {
70
+ handler: function (val) {
71
+ if (val) {
72
+ this.$store.dispatch('SetTscParam', val)
73
+ }
74
+ },
75
+ deep: true
76
+ }
77
+ },
78
+ methods: {
79
+ loadSvgString (type, imgstr) {
80
+ this.pageindex = 2
81
+ this.$nextTick(() => {
82
+ this.$refs.CustomDraw.loadSvgString(type, imgstr)
83
+ })
84
+ },
85
+ getChannelizatonChart () {
86
+ // let agentid = getIframdevid()
87
+ let _this = this
88
+ _this.$store.dispatch('SetChannelizationPageIndex', false)
89
+ getChannelizatonChart(this.AgentId).then(data => {
90
+ if (!data.data.success) {
91
+ // let parrenterror = getMessageByCode(data.data.code, _this.$i18n.locale)
92
+ // if (data.data.data) {
93
+ // // 子类型错误
94
+ // let childErrorCode = data.data.data.errorCode
95
+ // if (childErrorCode) {
96
+ // let childerror = getMessageByCode(data.data.data.errorCode, _this.$i18n.locale)
97
+ // _this.$message.error(parrenterror + ',' + childerror)
98
+ // }
99
+ // } else {
100
+ // _this.$message.error(parrenterror)
101
+ // }
102
+ return
103
+ }
104
+ if (JSON.stringify(data.data.data) === '{}') return
105
+ _this.$store.dispatch('SetChannelizationPageIndex', true)
106
+ _this.loadedChannelizatonData = JSON.parse(JSON.stringify(data.data.data))
107
+ })
108
+ },
109
+ saveCallback (res) {
110
+ this.$emit('saveCallback', res)
111
+ }
112
+ },
113
+ mounted () {
114
+ this.getChannelizatonChart()
115
+ }
116
+ }
117
+ </script>
118
+ <style scoped>
119
+ </style>
@@ -0,0 +1,563 @@
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="lane-edit-panel">
14
+ <!-- 车道编辑面板 -->
15
+ <div class="vehile" v-if="Data.icontype === 'vehile'">
16
+ <div class="edit-id">
17
+ <span style="margin-right: 3px;">
18
+ {{$t('openatccomponents.channelizationmap.vehiclelane') + ':'}}
19
+ </span>
20
+ <span>{{Data.id}}</span>
21
+ </div>
22
+ <div class="directions">
23
+ <div class="tittle">{{$t('openatccomponents.channelizationmap.laneturn')}}</div>
24
+ <div class="each-icon" v-for="(item, index) in directionList" :key="index">
25
+ <div class="single-icon"
26
+ @click="selectDire(item.id)"
27
+ :class="preselectDirection.indexOf(item.id) !== -1 ? 'single-icon-select' : ''">
28
+ <svg-icon :icon-class="item.iconclass" className="direction-icon"></svg-icon>
29
+ </div>
30
+ <div class="single-icon-name">{{item.name}}</div>
31
+ </div>
32
+ </div>
33
+
34
+ <div class="position">
35
+ <div class="tittle">{{$t('openatccomponents.channelizationmap.position')}}</div>
36
+ <div class="position-options">
37
+ <el-radio-group v-model="lanePosition" @change="selectLanePos">
38
+ <el-radio :label="1">{{$t('openatccomponents.channelizationmap.eastward')}}</el-radio>
39
+ <el-radio :label="2">{{$t('openatccomponents.channelizationmap.westward')}}</el-radio>
40
+ <el-radio :label="3">{{$t('openatccomponents.channelizationmap.southward')}}</el-radio>
41
+ <el-radio :label="4">{{$t('openatccomponents.channelizationmap.northward')}}</el-radio>
42
+ </el-radio-group>
43
+ </div>
44
+ </div>
45
+
46
+ <div class="lane-types">
47
+ <div class="tittle">{{$t('openatccomponents.channelizationmap.lanetype')}}</div>
48
+ <div class="each-icon" v-for="(item, index) in lanetypeList" :key="index">
49
+ <div class="single-icon"
50
+ @click="selectLanetype(item.id)"
51
+ :class="preselectLanetype === item.id ? 'single-icon-select' : ''">
52
+ <svg-icon :icon-class="item.iconclass" className="type-icon"></svg-icon>
53
+ </div>
54
+ <div class="single-icon-name">{{item.name}}</div>
55
+ </div>
56
+ <div v-if="Data.controltype !== 0 && Data.controltype !== 1">
57
+ <el-switch
58
+ :value="flip"
59
+ @change="handleChangeFilp"
60
+ :active-text="$t('openatccomponents.channelizationmap.flipdisplay')">
61
+ </el-switch>
62
+ </div>
63
+ </div>
64
+
65
+ <div class="phase-associated">
66
+ <div class="tittle">{{$t('openatccomponents.channelizationmap.phaseassociated')}}</div>
67
+ <!-- 相位可以编辑,增加,删除,校验 -->
68
+ <!-- <PhaseAssociatedComponentCheck
69
+ ref="phaseAssociated"
70
+ :editData="Data"
71
+ :Motorways="Motorways"
72
+ @selectPhase="selectPhase"
73
+ @handleDisassociatePhase="handleDisassociatePhase" /> -->
74
+ <!-- 相位仅可以关联选择,不可修改 -->
75
+ <PhaseAssociatedComponent
76
+ :editData="Data"
77
+ @selectPhaseNew="selectPhaseNew" />
78
+ </div>
79
+ <div class="overlap-associated">
80
+ <div class="tittle">{{$t('openatccomponents.channelizationmap.overlapassociated')}}</div>
81
+ <OverlapAssociatedComponent :editData="Data"
82
+ @selectPhaseNew="selectPhaseNew"/>
83
+ </div>
84
+ </div>
85
+
86
+ <!-- 行人编辑面板 -->
87
+ <div class="ped" v-if="Data.icontype === 'ped'">
88
+ <div class="edit-id">
89
+ <span style="margin-right: 3px;">
90
+ {{$t('openatccomponents.channelizationmap.sidewalk') + ':'}}
91
+ </span>
92
+ <span>{{Data.id}}</span>
93
+ </div>
94
+ <div class="ped-type">
95
+ <div class="tittle">{{$t('openatccomponents.channelizationmap.pedestriantype')}}</div>
96
+ <div class="each-icon" v-for="(item, index) in pedestriantypeList" :key="index">
97
+ <div class="single-icon"
98
+ @click="selectPedType(item.id)"
99
+ :class="Data.iconpedtypeid === item.id ? 'single-icon-select' : ''">
100
+ <svg-icon :icon-class="item.iconclass" className="ped-icon"></svg-icon>
101
+ </div>
102
+ <div class="single-icon-name">{{item.name}}</div>
103
+ </div>
104
+ </div>
105
+ <div class="ped-position">
106
+ <div class="tittle">{{$t('openatccomponents.channelizationmap.position')}}</div>
107
+ <div class="each-icon" v-for="(item, index) in pedPosList" :key="index">
108
+ <div class="single-icon"
109
+ @click="selectPedPos(item.id)"
110
+ :class="Data.iconpedposition === item.id ? 'single-icon-select' : ''">
111
+ <svg-icon :icon-class="item.iconclass" className="ped-icon"></svg-icon>
112
+ </div>
113
+ <div class="single-icon-name">{{item.name}}</div>
114
+ </div>
115
+ </div>
116
+ <div class="phase-associated">
117
+ <div class="tittle">{{$t('openatccomponents.channelizationmap.phaseassociated')}}</div>
118
+ <!-- 相位可以编辑,增加,删除,校验 -->
119
+ <!-- <PhaseAssociatedComponentCheck
120
+ ref="phaseAssociated"
121
+ :editData="Data"
122
+ @selectPhase="selectPhase"
123
+ @handleDisassociatePhase="handleDisassociatePhase" /> -->
124
+ <!-- 相位仅可以关联选择,不可修改 -->
125
+ <PhaseAssociatedComponent
126
+ :editData="Data"
127
+ @selectPhaseNew="selectPhaseNew" />
128
+ </div>
129
+ <div class="overlap-associated">
130
+ <div class="tittle">{{$t('openatccomponents.channelizationmap.overlapassociated')}}</div>
131
+ <OverlapAssociatedComponent :editData="Data"
132
+ @selectPhaseNew="selectPhaseNew"/>
133
+ </div>
134
+ </div>
135
+
136
+ <!-- 检测器编辑面板 -->
137
+ <div class="detector" v-if="Data.icontype === 'detector' && Data.detailtype === 'detector'">
138
+ <div class="detector-type">
139
+ <div class="tittle">{{$t('openatccomponents.channelizationmap.detectortype')}}</div>
140
+ <div class="each-icon" v-for="(item, index) in detectortypeList" :key="index">
141
+ <div class="single-icon"
142
+ @click="selectDetectorType(item.id)"
143
+ :class="Data.detectortype === item.id ? 'single-icon-select' : ''">
144
+ <svg-icon :icon-class="item.iconclass" className="ped-icon"></svg-icon>
145
+ </div>
146
+ <div class="single-icon-name">{{item.name}}</div>
147
+ </div>
148
+ </div>
149
+ <div class="detector-associated">
150
+ <div class="tittle">{{$t('openatccomponents.channelizationmap.detectorassociated')}}</div>
151
+ <DetectorAssociatedComponent :editData="Data"
152
+ @selectAssociatedDetector="selectAssociatedDetector"/>
153
+ </div>
154
+ <div class="detector-threshold" v-if="Data.detectortype === 1">
155
+ <div class="tittle">{{$t('openatccomponents.channelizationmap.detectorthreshold')}}</div>
156
+ <el-form
157
+ ref="threshold"
158
+ label-position="left"
159
+ label-width="130px">
160
+ <el-form-item
161
+ :label="$t('openatccomponents.channelizationmap.occupancythreshold') + ':'"
162
+ prop="intersection">
163
+ <el-input-number :min="0" :max="100" :precision="0" :step="1" :controls="false"
164
+ :value="occupancythreshold" size="mini"
165
+ @change="handleChangeOccuthreshold" />
166
+ <span class="detector-threshold-formtext">%</span>
167
+ </el-form-item>
168
+ <el-form-item
169
+ :label="$t('openatccomponents.channelizationmap.saturationthreshold') + ':'"
170
+ prop="count">
171
+ <el-input-number :min="0" :max="100" :precision="0" :step="1" :controls="false"
172
+ :value="flowsaturationthreshold" size="mini"
173
+ @change="handleChangeFlowthreshold" />
174
+ <span class="detector-threshold-formtext">%</span>
175
+ </el-form-item>
176
+ </el-form>
177
+ </div>
178
+ </div>
179
+
180
+ <div class="delete-drawed-item" v-if="JSON.stringify(Data) !== '{}' && Data.detailtype !== 'detectorChart'">
181
+ <el-button type="primary" @click="handledelete">{{$t('openatccomponents.channelizationmap.delete')}}</el-button>
182
+ </div>
183
+ </div>
184
+ </template>
185
+ <script>
186
+ import PhaseAssociatedComponentCheck from './phaseAssociatedComponent.check'
187
+ import PhaseAssociatedComponent from './phaseAssociatedComponent.vue'
188
+ import OverlapAssociatedComponent from './overlapAssociatedComponent'
189
+ import DetectorAssociatedComponent from './detectorAssociatedComponent.vue'
190
+ export default {
191
+ name: 'lane-edit-panel',
192
+ components: {
193
+ PhaseAssociatedComponent,
194
+ PhaseAssociatedComponentCheck,
195
+ OverlapAssociatedComponent,
196
+ DetectorAssociatedComponent
197
+ },
198
+ data () {
199
+ return {
200
+ iconObj: {},
201
+ preselectDirection: [1], // 预选方向
202
+ preselectPedType: [1], // 预选行人类型
203
+ directionList: [], // 业务下方向选择列表(非机动车没有掉头)
204
+ allDirectionsList: [{
205
+ id: 1,
206
+ key: 'straightahead',
207
+ iconclass: 'custom-straightahead',
208
+ name: this.$t('openatccomponents.channelizationmap.straightahead')
209
+ }, {
210
+ id: 2,
211
+ key: 'turnleft',
212
+ iconclass: 'custom-turnleft',
213
+ name: this.$t('openatccomponents.channelizationmap.turnleft')
214
+ }, {
215
+ id: 3,
216
+ key: 'turnright',
217
+ iconclass: 'custom-turnright',
218
+ name: this.$t('openatccomponents.channelizationmap.turnright')
219
+ }, {
220
+ id: 4,
221
+ key: 'turnaround',
222
+ iconclass: 'custom-turnaround',
223
+ name: this.$t('openatccomponents.channelizationmap.turnaround')
224
+ }],
225
+ pedestriantypeList: [{
226
+ id: 1,
227
+ key: 'pedestrian',
228
+ iconclass: 'custom-pedestrian',
229
+ name: this.$t('openatccomponents.channelizationmap.pedestrian')
230
+ }, {
231
+ id: 2,
232
+ key: 'secondcrossing',
233
+ iconclass: 'custom-secondcrossing',
234
+ name: this.$t('openatccomponents.channelizationmap.secondcrossing')
235
+ }, {
236
+ id: 3,
237
+ key: 'xpedestrian',
238
+ iconclass: 'custom-xpedestrian',
239
+ name: this.$t('openatccomponents.channelizationmap.xpedestrian')
240
+ }, {
241
+ id: 4,
242
+ key: 'sectionpedestrian',
243
+ iconclass: 'custom-sectionpedestrian',
244
+ name: this.$t('openatccomponents.channelizationmap.sectionpedestrian')
245
+ }],
246
+ preselectLanetype: 0,
247
+ flip: false, // 默认车道类型图标不反转,正向为西
248
+ lanetypeList: [{
249
+ id: 0, // id对于controltype
250
+ key: 'vehiclemainroad',
251
+ iconclass: 'custom-vehiclemainroad',
252
+ name: this.$t('openatccomponents.channelizationmap.vehiclemainroad')
253
+ }, {
254
+ id: 1,
255
+ key: 'vehiclebranch',
256
+ iconclass: 'custom-vehiclebranch',
257
+ name: this.$t('openatccomponents.channelizationmap.vehiclebranch')
258
+ }, {
259
+ id: 6,
260
+ key: 'nonmotorizedlane',
261
+ iconclass: 'custom-nonmotorizedlane',
262
+ name: this.$t('openatccomponents.channelizationmap.nonmotorizedlane')
263
+ }, {
264
+ id: 3,
265
+ key: 'buslane',
266
+ iconclass: 'custom-buslane',
267
+ name: this.$t('openatccomponents.channelizationmap.buslane')
268
+ }, {
269
+ id: 4,
270
+ key: 'BRTlane',
271
+ iconclass: 'custom-BRTlane',
272
+ name: this.$t('openatccomponents.channelizationmap.BRTlane')
273
+ }, {
274
+ id: 5,
275
+ key: 'tramlane',
276
+ iconclass: 'custom-tramlane',
277
+ name: this.$t('openatccomponents.channelizationmap.tramlane')
278
+ }],
279
+ lanePosition: 1, // 方位默认东向
280
+ pedPosList: [], // 当前显示的方位列表,由类型决定
281
+ pedCrossingPosList: [{
282
+ id: 1,
283
+ key: 'pedeastward',
284
+ iconclass: 'custom-pedeastward',
285
+ name: this.$t('openatccomponents.channelizationmap.eastward')
286
+ }, {
287
+ id: 2,
288
+ key: 'pedwestward',
289
+ iconclass: 'custom-pedwestward',
290
+ name: this.$t('openatccomponents.channelizationmap.westward')
291
+ }, {
292
+ id: 3,
293
+ key: 'pedsouthward',
294
+ iconclass: 'custom-pedsouthward',
295
+ name: this.$t('openatccomponents.channelizationmap.southward')
296
+ }, {
297
+ id: 4,
298
+ key: 'pednorthward',
299
+ iconclass: 'custom-pednorthward',
300
+ name: this.$t('openatccomponents.channelizationmap.northward')
301
+ }],
302
+ pedSecondCrossingPosList: [{
303
+ id: 5,
304
+ key: 'east-top',
305
+ iconclass: 'custom-east-top',
306
+ name: this.$t('openatccomponents.channelizationmap.etped')
307
+ }, {
308
+ id: 6,
309
+ key: 'east-bottom',
310
+ iconclass: 'custom-east-bottom',
311
+ name: this.$t('openatccomponents.channelizationmap.ebped')
312
+ }, {
313
+ id: 7,
314
+ key: 'west-top',
315
+ iconclass: 'custom-west-top',
316
+ name: this.$t('openatccomponents.channelizationmap.wtped')
317
+ }, {
318
+ id: 8,
319
+ key: 'west-bottom',
320
+ iconclass: 'custom-west-bottom',
321
+ name: this.$t('openatccomponents.channelizationmap.wbped')
322
+ }, {
323
+ id: 9,
324
+ key: 'south-left',
325
+ iconclass: 'custom-south-left',
326
+ name: this.$t('openatccomponents.channelizationmap.slped')
327
+ }, {
328
+ id: 10,
329
+ key: 'south-right',
330
+ iconclass: 'custom-south-right',
331
+ name: this.$t('openatccomponents.channelizationmap.srped')
332
+ }, {
333
+ id: 11,
334
+ key: 'north-left',
335
+ iconclass: 'custom-north-left',
336
+ name: this.$t('openatccomponents.channelizationmap.nlped')
337
+ }, {
338
+ id: 12,
339
+ key: 'north-right',
340
+ iconclass: 'custom-north-right',
341
+ name: this.$t('openatccomponents.channelizationmap.nrped')
342
+ }],
343
+ pedObliqueCrossingPosList: [{
344
+ id: 13,
345
+ key: 'xrped',
346
+ iconclass: 'custom-xrped',
347
+ name: this.$t('openatccomponents.channelizationmap.xrped')
348
+ }, {
349
+ id: 14,
350
+ key: 'xlped',
351
+ iconclass: 'custom-xlped',
352
+ name: this.$t('openatccomponents.channelizationmap.xlped')
353
+ }],
354
+ pedSectionCrossingPosList: [{
355
+ id: 15,
356
+ key: 'ewped',
357
+ iconclass: 'custom-ewped',
358
+ name: this.$t('openatccomponents.channelizationmap.ewped')
359
+ }, {
360
+ id: 16,
361
+ key: 'snped',
362
+ iconclass: 'custom-snped',
363
+ name: this.$t('openatccomponents.channelizationmap.snped')
364
+ }],
365
+ detectortypeList: [{
366
+ id: 1,
367
+ key: 'vehiclemainroad',
368
+ iconclass: 'custom-detector',
369
+ name: this.$t('openatccomponents.channelizationmap.vehicledetector')
370
+ }, {
371
+ id: 2,
372
+ key: 'vehiclebranch',
373
+ iconclass: 'custom-peddetector',
374
+ name: this.$t('openatccomponents.channelizationmap.pedestriandetector')
375
+ }],
376
+ occupancythreshold: 80,
377
+ flowsaturationthreshold: 20
378
+ }
379
+ },
380
+ watch: {
381
+ Data: {
382
+ handler: function (data) {
383
+ this.iconObj = JSON.parse(JSON.stringify(data))
384
+ this.initDirOptions()
385
+ if (data.icondireid !== undefined) {
386
+ this.preselectDirection = JSON.parse(JSON.stringify(data.icondireid))
387
+ }
388
+ if (data.controltype !== undefined) {
389
+ this.preselectLanetype = data.controltype
390
+ }
391
+ if (data.lanePosition !== undefined) {
392
+ this.lanePosition = data.lanePosition
393
+ }
394
+ if (data.occupancythreshold !== undefined) {
395
+ this.occupancythreshold = data.occupancythreshold
396
+ }
397
+ if (data.flowsaturationthreshold !== undefined) {
398
+ this.flowsaturationthreshold = data.flowsaturationthreshold
399
+ }
400
+ if (data.flip !== undefined) {
401
+ this.flip = data.flip
402
+ }
403
+ this.getCurPedPosList(data.iconpedtypeid)
404
+ },
405
+ deep: true
406
+ }
407
+ },
408
+ props: {
409
+ Data: {
410
+ type: Object
411
+ },
412
+ Motorways: {
413
+ type: Array
414
+ }
415
+ },
416
+ methods: {
417
+ initDirOptions () {
418
+ this.directionList = JSON.parse(JSON.stringify(this.allDirectionsList))
419
+ },
420
+ selectDire (value) {
421
+ let index = this.iconObj.icondireid.indexOf(value)
422
+ if (index === -1) {
423
+ this.iconObj.icondireid.push(value)
424
+ } else {
425
+ this.iconObj.icondireid.splice(index, 1)
426
+ }
427
+ this.$emit('handleChooseDire', this.iconObj)
428
+ // this.handleAssociatedPhase()
429
+ },
430
+ selectLanetype (id) {
431
+ this.iconObj.controltype = id
432
+ this.$emit('changeIconDataByType', this.iconObj, ['controltype'])
433
+ },
434
+ selectPedType (value) {
435
+ this.iconObj.iconpedtypeid = value
436
+ this.getCurPedPosList(value)
437
+ // 默认选择第一方位
438
+ this.iconObj.iconpedposition = this.pedPosList[0].id
439
+ this.$emit('handleChoosePed', this.iconObj)
440
+ },
441
+ selectDetectorType (value) {
442
+ if (this.iconObj.detectortype !== undefined && this.iconObj.detectortype !== value) {
443
+ this.iconObj.detectorid = undefined
444
+ }
445
+ this.iconObj.detectortype = value
446
+ this.$emit('changeIconDataByType', this.iconObj, ['detectortype', 'detectorid'])
447
+ if (value === 2) {
448
+ // 行人检测器没有阈值设置
449
+ this.iconObj.occupancythreshold = undefined
450
+ this.iconObj.flowsaturationthreshold = undefined
451
+ this.$emit('changeIconDataByType', this.iconObj, ['occupancythreshold', 'flowsaturationthreshold'])
452
+ }
453
+ },
454
+ selectPedPos (value) {
455
+ this.iconObj.iconpedposition = value
456
+ this.$emit('handleChoosePed', this.iconObj)
457
+ },
458
+ handledelete () {
459
+ this.$emit('deleteItem', this.iconObj)
460
+ },
461
+ selectLanePos (value) {
462
+ this.iconObj.lanePosition = value
463
+ this.$emit('changeIconDataByType', this.iconObj, ['lanePosition'])
464
+ // this.handleAssociatedPhase()
465
+ },
466
+ selectPhase (phaseid, direction) {
467
+ // 关联相位的同时,会修改相位方向
468
+ this.iconObj.phaseid = phaseid
469
+ this.iconObj.phaselabel = `P${phaseid}`
470
+ this.iconObj.direction = direction
471
+ this.$emit('changeIconDataByType', this.iconObj, ['phaseid', 'phaselabel', 'direction'])
472
+ },
473
+ selectPhaseNew (phaseid, phasetype) {
474
+ // 仅关联相位,不修改原相位
475
+ this.iconObj.phasetype = phasetype
476
+ this.iconObj.phaseid = phaseid
477
+ if (phasetype === 'phase') {
478
+ this.iconObj.phaselabel = `P${phaseid}`
479
+ }
480
+ if (phasetype === 'overlap') {
481
+ this.iconObj.phaselabel = `OP${phaseid}`
482
+ }
483
+ this.$emit('changeIconDataByType', this.iconObj, ['phaseid', 'phaselabel', 'phasetype'])
484
+ },
485
+ handleDisassociatePhase (deletePhaseid) {
486
+ this.$emit('handleDisassociatePhase', deletePhaseid)
487
+ },
488
+ // handleAssociatedPhase () {
489
+ // // 如果已关联相位,再改变车道转向或者方位时,需要同步更新选中的关联相位
490
+ // if (this.iconObj.phaseid !== undefined) {
491
+ // this.$refs.phaseAssociated.changeDirection(this.iconObj)
492
+ // }
493
+ // },
494
+ selectAssociatedDetector (detectorid) {
495
+ // 仅关联检测器,不修改
496
+ this.iconObj.detectorid = detectorid
497
+ this.$emit('changeIconDataByType', this.iconObj, ['detectorid'])
498
+ },
499
+ handleChangeOccuthreshold (occupancythreshold) {
500
+ if (occupancythreshold === undefined) {
501
+ this.$message.error(this.$t('openatccomponents.channelizationmap.checkthreshold'))
502
+ this.occupancythreshold = 80
503
+ return
504
+ }
505
+ this.occupancythreshold = occupancythreshold
506
+ this.iconObj.occupancythreshold = occupancythreshold
507
+ this.$emit('changeIconDataByType', this.iconObj, ['occupancythreshold'])
508
+ },
509
+ handleChangeFlowthreshold (flowsaturationthreshold) {
510
+ if (flowsaturationthreshold === undefined) {
511
+ this.$message.error(this.$t('openatccomponents.channelizationmap.checkthreshold'))
512
+ this.flowsaturationthreshold = 20
513
+ return
514
+ }
515
+ this.flowsaturationthreshold = flowsaturationthreshold
516
+ this.iconObj.flowsaturationthreshold = flowsaturationthreshold
517
+ this.$emit('changeIconDataByType', this.iconObj, ['flowsaturationthreshold'])
518
+ },
519
+ getCurPedPosList (iconpedtypeid) {
520
+ // 方位根据行人类型显示
521
+ switch (iconpedtypeid) {
522
+ case 1: this.pedPosList = JSON.parse(JSON.stringify(this.pedCrossingPosList))
523
+ break
524
+ case 2: this.pedPosList = JSON.parse(JSON.stringify(this.pedSecondCrossingPosList))
525
+ break
526
+ case 3: this.pedPosList = JSON.parse(JSON.stringify(this.pedObliqueCrossingPosList))
527
+ break
528
+ case 4: this.pedPosList = JSON.parse(JSON.stringify(this.pedSectionCrossingPosList))
529
+ break
530
+ }
531
+ },
532
+ handleChangeFilp (value) {
533
+ this.iconObj.flip = value
534
+ this.$emit('changeIconDataByType', this.iconObj, ['flip'])
535
+ }
536
+ },
537
+ mounted () {
538
+ if (JSON.stringify(this.Data) === '{}') return
539
+ this.iconObj = JSON.parse(JSON.stringify(this.Data))
540
+ if (this.Data.icondireid !== undefined) {
541
+ this.preselectDirection = JSON.parse(JSON.stringify(this.Data.icondireid))
542
+ }
543
+ if (this.Data.controltype !== undefined) {
544
+ this.preselectLanetype = this.Data.controltype
545
+ }
546
+ if (this.Data.lanePosition !== undefined) {
547
+ this.lanePosition = this.Data.lanePosition
548
+ }
549
+ if (this.Data.occupancythreshold !== undefined) {
550
+ this.occupancythreshold = this.Data.occupancythreshold
551
+ }
552
+ if (this.Data.flowsaturationthreshold !== undefined) {
553
+ this.flowsaturationthreshold = this.Data.flowsaturationthreshold
554
+ }
555
+ if (this.Data.flip !== undefined) {
556
+ this.flip = this.Data.flip
557
+ }
558
+ this.getCurPedPosList(this.Data.iconpedtypeid)
559
+ }
560
+ }
561
+ </script>
562
+ <style scoped>
563
+ </style>