StatusMonitoring.vue 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658
  1. <template>
  2. <DashboardLayout ref="layout" layoutClass="special-situation-monitoring">
  3. <template #header-left>
  4. </template>
  5. <template #header-right>
  6. <!-- 日期 -->
  7. <DateTimeWidget />
  8. </template>
  9. <template #map>
  10. <!-- 地图 -->
  11. <TongzhouTrafficMap amapKey="db2da7e3e248c3b2077d53fc809be63f"
  12. securityJsCode="a7413c674852c5eaf01d90813c5b7ef6" @map-crossing-click="handleMapCrossingClick" />
  13. </template>
  14. <template #left>
  15. <!-- 左侧Tab菜单栏 -->
  16. <div class="left-sidebar-wrap">
  17. <TechTabs v-model="activeLeftTab" type="underline" @tab-click="handleTabClick">
  18. <TechTabPane label="总览" name="overview" class="menu-scroll-view">
  19. <MenuItem theme="tech" v-for="item in menuData" :key="item.id" :node="item" :level="0"
  20. @node-click="handleMenuClick" />
  21. </TechTabPane>
  22. <TechTabPane label="路口" name="crossing" class="menu-scroll-view">
  23. <MenuItem theme="tech" v-for="item in menuData" :key="item.id" :node="item" :level="0"
  24. @node-click="handleMenuClick" />
  25. </TechTabPane>
  26. <TechTabPane label="干线" name="trunkLine" class="menu-scroll-view">
  27. <MenuItem v-for="item in menuData" :key="item.id" :node="item" :level="0"
  28. @node-click="handleMenuClick">
  29. <template #label="{ node }">
  30. <span v-if="node.children && node.children.length > 0">{{ node.label }}</span>
  31. <span v-else>{{ node.label }} 绿波带</span>
  32. </template>
  33. </MenuItem>
  34. </TechTabPane>
  35. <TechTabPane label="特勤" name="specialDuty">
  36. </TechTabPane>
  37. </TechTabs>
  38. </div>
  39. </template>
  40. <template #right>
  41. <!-- 模式切换按钮组 -->
  42. <div class="mode-switch" v-if="activeLeftTab === 'crossing'">
  43. <ButtonGroup v-model="currentView" :options="viewOptions" @select="onViewSelect" />
  44. </div>
  45. </template>
  46. <template #center>
  47. </template>
  48. </DashboardLayout>
  49. </template>
  50. <script>
  51. import DashboardLayout from '@/layouts/DashboardLayout.vue';
  52. import DateTimeWidget from '@/components/ui/DateTimeWidget.vue';
  53. import TechTabs from '@/components/ui/TechTabs.vue';
  54. import TechTabPane from '@/components/ui/TechTabPane.vue';
  55. import TongzhouTrafficMap from '@/components/TongzhouTrafficMap.vue';
  56. import MenuItem from '@/components/ui/MenuItem.vue';
  57. import ButtonGroup from '@/components/ui/ButtonGroup.vue';
  58. import { makeTrafficTimeSpaceData } from '@/mock/data';
  59. import testVideo1 from '@/assets/videos/video1.mp4';
  60. import testVideo2 from '@/assets/videos/video2.mp4';
  61. import testImg1 from '@/assets/test_img1.png';
  62. export default {
  63. name: "HomePage",
  64. components: {
  65. DashboardLayout,
  66. DateTimeWidget,
  67. TechTabs,
  68. TechTabPane,
  69. TongzhouTrafficMap,
  70. MenuItem,
  71. ButtonGroup,
  72. },
  73. data() {
  74. return {
  75. // 左侧边栏数据
  76. activeLeftTab: 'overview',
  77. menuData: [
  78. {
  79. id: 'root-1',
  80. label: '主控中心',
  81. icon: 'el-icon-monitor', // 这里可以替换为你项目用的图标类名,比如 iconfont
  82. children: [
  83. {
  84. id: 'team-1',
  85. label: '北京市交警总队',
  86. children:
  87. [
  88. {
  89. id: 'dist-1',
  90. label: '通州区',
  91. children: [
  92. {
  93. id: 'street-1',
  94. label: '中仓街道',
  95. children: [
  96. { id: 'node-1', label: '新华东街 - 新华南路' },
  97. { id: 'node-2', label: '玉带河东街 - 车站路' },
  98. { id: 'node-3', label: '赵登禹大街 - 新华东街' }
  99. ]
  100. },
  101. {
  102. id: 'street-2',
  103. label: '新华街道',
  104. children: [
  105. { id: 'node-4', label: '新华南北街交叉口' },
  106. { id: 'node-5', label: '通胡大街 - 紫运中路' },
  107. { id: 'node-6', label: '芙蓉东路 - 通胡大街' }
  108. ]
  109. },
  110. {
  111. id: 'street-3',
  112. label: '北苑街道',
  113. children: [
  114. { id: 'node-7', label: '北苑路口' },
  115. { id: 'node-8', label: '新华西街 - 北苑南路' },
  116. { id: 'node-9', label: '新城南街 - 新华西街' }
  117. ]
  118. },
  119. {
  120. id: 'street-4',
  121. label: '玉桥街道',
  122. children: [
  123. { id: 'node-10', label: '玉桥西路 - 玉桥西里中街' },
  124. { id: 'node-11', label: '运河西大街 - 玉桥中路' },
  125. { id: 'node-12', label: '梨园南街 - 运河西大街' }
  126. ]
  127. },
  128. {
  129. id: 'street-5',
  130. label: '杨庄街道',
  131. children: [
  132. { id: 'node-13', label: '怡乐中街 - 九棵树西路' },
  133. { id: 'node-14', label: '翠屏西路 - 怡乐中街' },
  134. { id: 'node-15', label: '杨庄路 - 新华西街' }
  135. ]
  136. },
  137. {
  138. id: 'street-6',
  139. label: '九棵树街道',
  140. children: [
  141. { id: 'node-16', label: '九棵树东路 - 九棵树西路' },
  142. { id: 'node-17', label: '云景东路 - 九棵树东路' },
  143. { id: 'node-18', label: '群芳南街 - 云景东路' }
  144. ]
  145. },
  146. {
  147. id: 'street-7',
  148. label: '临河里街道',
  149. children: [
  150. { id: 'node-19', label: '梨园中街 - 九棵树东路' },
  151. { id: 'node-20', label: '临河里路 - 梨园中街' },
  152. { id: 'node-21', label: '万盛南街 - 临河里路' }
  153. ]
  154. },
  155. {
  156. id: 'street-8',
  157. label: '潞邑街道',
  158. children: [
  159. { id: 'node-22', label: '潞苑北大街 - 潞邑西路' },
  160. { id: 'node-23', label: '潞苑南大街 - 潞邑三路' },
  161. { id: 'node-24', label: '东六环 - 潞苑北大街' }
  162. ]
  163. },
  164. {
  165. id: 'street-9',
  166. label: '通运街道',
  167. children: [
  168. { id: 'node-25', label: '通胡大街 - 东六环' },
  169. { id: 'node-26', label: '运河东大街 - 通胡大街' },
  170. { id: 'node-27', label: '紫运中路 - 运河东大街' }
  171. ]
  172. },
  173. {
  174. id: 'street-10',
  175. label: '潞源街道',
  176. children: [
  177. { id: 'node-28', label: '宋梁路 - 运河东大街' },
  178. { id: 'node-29', label: '东六环 - 运河东大街' },
  179. { id: 'node-30', label: '潞源北街 - 宋梁路' }
  180. ]
  181. },
  182. {
  183. id: 'street-11',
  184. label: '文景街道',
  185. children: [
  186. { id: 'node-31', label: '环球大道 - 九棵树东路' },
  187. { id: 'node-32', label: '颐瑞东路 - 环球大道' },
  188. { id: 'node-33', label: '万盛南街 - 颐瑞东路' }
  189. ]
  190. }
  191. ]
  192. }
  193. ]
  194. }
  195. ]
  196. }
  197. ],
  198. // 地图模式切换数据
  199. currentView: 'map-mode',
  200. viewOptions: [
  201. { label: '列表模式', value: 'list-mode' },
  202. { label: '地图模式', value: 'map-mode' },
  203. ]
  204. };
  205. },
  206. watch: {
  207. // 监听路由参数变化(解决多次从首页点击不同数据跳转过来,页面不刷新的问题)
  208. '$route.query': {
  209. handler() {
  210. this.checkRouteParams();
  211. },
  212. deep: true
  213. }
  214. },
  215. created() {
  216. },
  217. mounted() {
  218. // 组件挂载时检查路由
  219. this.checkRouteParams();
  220. // 初始显示顶部图表(如果没有路由参数覆盖的话)
  221. if (Object.keys(this.$route.query).length === 0) {
  222. this.showTopChartDalogs();
  223. }
  224. },
  225. methods: {
  226. // 处理地图点击事件
  227. handleMapCrossingClick(mapData, lnglat) {
  228. console.log('父组件接收到了地图路口点击事件:', mapData, lnglat);
  229. // 组装模拟数据
  230. let nodeData = {
  231. id: Math.random(1, 100),
  232. label: mapData.road,
  233. }
  234. console.log(nodeData);
  235. if (this.activeLeftTab === 'overview') { // 总览
  236. this.showOverviewDalogs(nodeData);
  237. } else if (this.activeLeftTab === 'crossing') { // 路口
  238. this.showCrossingDalogs(nodeData);
  239. } else if (this.activeLeftTab === 'trunkLine') { // 干线
  240. this.showTrunkLineDalogs(nodeData);
  241. } else if (this.activeLeftTab === 'specialDuty') { // 特勤
  242. this.showSpecialDutyDalogs(nodeData);
  243. }
  244. },
  245. // 模式切换
  246. onViewSelect(item) {
  247. console.log('你点击了:', item.label);
  248. this.currentView = item.value;
  249. this.$refs.layout.clearDialogs(); // 清空全部弹窗
  250. // 列表模式弹窗
  251. if (this.currentView === 'list-mode') {
  252. this.$refs.layout.openDialog({
  253. id: 'crossing-list', // 这里的 ID 可以根据实际业务场景动态生成
  254. title: '',
  255. component: 'CrossingListPanel',
  256. width: 1920,
  257. height: 750,
  258. center: false,
  259. showClose: true,
  260. noPadding: false,
  261. enableDblclickExpand: false,
  262. position: { x: 100, y: 150 },
  263. data: {
  264. onViewDetail: (rowData) => this.handleCrossingViewDetail(rowData)
  265. }
  266. });
  267. } else {
  268. this.showCrossingTopDialogs();
  269. }
  270. },
  271. // 处理tab点击
  272. handleTabClick(tabName) {
  273. console.log('父组件接收到了tab点击事件:', tabName);
  274. this.$refs.layout.clearDialogs(); // 清空全部弹窗
  275. this.showTopChartDalogs(); // 根据当前Tab显示对应的顶部常驻图表
  276. },
  277. // 处理菜单点击
  278. handleMenuClick(nodeData) {
  279. console.log('父组件接收到了最底层路口点击事件:', nodeData);
  280. // 根据Tab来显示不同的弹窗内容
  281. if (this.activeLeftTab === 'overview') { // 总览
  282. this.showOverviewDalogs(nodeData);
  283. } else if (this.activeLeftTab === 'crossing') { // 路口
  284. this.showCrossingDalogs(nodeData);
  285. } else if (this.activeLeftTab === 'trunkLine') { // 干线
  286. this.showTrunkLineDalogs(nodeData);
  287. } else if (this.activeLeftTab === 'specialDuty') { // 特勤
  288. this.showSpecialDutyDalogs(nodeData);
  289. }
  290. },
  291. // 处理弹窗双击展开(通过 onExpand 回调从 Layout 传入)
  292. handleDoubleClickExpend(nodeData) {
  293. console.log('处理弹窗双击事件', nodeData);
  294. if (this.activeLeftTab === 'crossing') {
  295. this.showCrossingDetailDialogs(nodeData);
  296. }
  297. },
  298. // 显示顶部常驻图表(根据当前Tab状态)
  299. showTopChartDalogs() {
  300. if (this.activeLeftTab === 'overview') { // 总览
  301. this.showOverviewTopDialogs();
  302. } else if (this.activeLeftTab === 'crossing') { // 路口
  303. this.showCrossingTopDialogs();
  304. } else if (this.activeLeftTab === 'trunkLine') { // 干线
  305. // TODO: 干线Tab的顶部图表
  306. } else if (this.activeLeftTab === 'specialDuty') { // 特勤
  307. this.openDutyDetailDialog();
  308. }
  309. },
  310. // 显示总览弹窗组
  311. showOverviewDalogs(nodeData) {
  312. console.log('显示总览弹窗组', nodeData.id, nodeData.label);
  313. this.showCrossingDetailDialogs(nodeData);
  314. },
  315. showOverviewTopDialogs() {
  316. this.$refs.layout.openDialog({
  317. id: 'top-chart-overview-1',
  318. title: '',
  319. component: 'OnlineStatusTabs',
  320. width: 300,
  321. height: 160,
  322. center: false,
  323. showClose: false,
  324. draggable: false,
  325. resizable: false,
  326. position: { x: 630, y: 130 },
  327. noPadding: true,
  328. data: {}
  329. });
  330. this.$refs.layout.openDialog({
  331. id: 'top-chart-overview-2',
  332. title: '',
  333. component: 'DeviceStatusTabs',
  334. width: 300,
  335. height: 160,
  336. center: false,
  337. showClose: false,
  338. draggable: false,
  339. resizable: false,
  340. position: { x: 980, y: 130 },
  341. noPadding: true,
  342. data: {}
  343. });
  344. },
  345. // 显示路口弹窗组
  346. showCrossingDalogs(nodeData) {
  347. console.log('显示路口弹窗组', nodeData.id, nodeData.label);
  348. // 路口弹窗
  349. // this.$refs.layout.openDialog({
  350. // id: 'crossing3_' + nodeData.id, // 这里的 ID 可以根据实际业务场景动态生成
  351. // title: nodeData.label,
  352. // component: 'CrossingPanel',
  353. // width: 260,
  354. // height: 260,
  355. // center: false,
  356. // showClose: true,
  357. // position: { x: 950, y: 430 },
  358. // noPadding: false,
  359. // data: {
  360. // ...nodeData,
  361. // onExpand: (data) => this.handleDoubleClickExpend(data)
  362. // },
  363. // onClose: () => {
  364. // this.$refs.layout.handleDialogClose('top-chart-crossing-1');
  365. // this.$refs.layout.handleDialogClose('top-chart-crossing-2');
  366. // }
  367. // });
  368. this.showCrossingDetailDialogs(nodeData);
  369. },
  370. showCrossingDetailDialogs(nodeData) {
  371. console.log('显示干线弹窗组', nodeData.id, nodeData.label);
  372. this.$refs.layout.openDialog({
  373. id: 'crossing_detail' + nodeData.id, // 这里的 ID 可以根据实际业务场景动态生成,例如 'dev-security-route' 代表特勤安保路线弹窗
  374. title: nodeData.label || nodeData.name,
  375. component: 'CrossingDetailPanel',
  376. width: 1315,
  377. height: 682,
  378. center: false,
  379. showClose: true,
  380. position: { x: 500, y: 170 },
  381. noPadding: false,
  382. enableDblclickExpand: false,
  383. data: nodeData
  384. });
  385. },
  386. showCrossingTopDialogs() {
  387. this.$refs.layout.openDialog({
  388. id: 'top-chart-crossing-1',
  389. title: '',
  390. component: 'RingDonutChart',
  391. width: 228,
  392. height: 124,
  393. center: false,
  394. showClose: false,
  395. draggable: false,
  396. resizable: false,
  397. position: { x: 730, y: 130 },
  398. noPadding: true,
  399. data: {
  400. chartData: [
  401. { name: '在线', value: 38, color: '#4DF5F8' },
  402. { name: '离线', value: 3, color: '#FFD369' }
  403. ],
  404. centerTitle: "98%",
  405. centerSubTitle: "38/41"
  406. }
  407. });
  408. this.$refs.layout.openDialog({
  409. id: 'top-chart-crossing-2',
  410. title: '',
  411. component: 'RingDonutChart',
  412. width: 228,
  413. height: 124,
  414. center: false,
  415. showClose: false,
  416. draggable: false,
  417. resizable: false,
  418. position: { x: 980, y: 130 },
  419. noPadding: true,
  420. data: {
  421. chartData: [
  422. { name: '通信', value: 10, color: '#4DF5F8' },
  423. { name: '检测器', value: 8, color: '#FFA033' },
  424. { name: '灯控', value: 15, color: '#FFF587' },
  425. { name: '冲突', value: 5, color: '#FF4D4F' }
  426. ],
  427. centerTitle: "98%",
  428. centerSubTitle: "38/41"
  429. }
  430. });
  431. },
  432. // 路口列表模式下弹窗
  433. handleCrossingViewDetail(rowData) {
  434. console.log('显示路口列表查看', rowData);
  435. this.showCrossingDetailDialogs(rowData);
  436. },
  437. // 显示干线弹窗组
  438. showTrunkLineDalogs(nodeData) {
  439. console.log('显示干线弹窗组', nodeData.id, nodeData.label);
  440. this.$refs.layout.openDialog({
  441. id: nodeData.id, // 这里的 ID 可以根据实际业务场景动态生成,例如 'dev-security-route' 代表特勤安保路线弹窗
  442. title: nodeData.label,
  443. component: 'TrafficTimeSpace',
  444. width: 1000,
  445. height: 500,
  446. center: true,
  447. showClose: true,
  448. // position: { x: 400, y: 450 },
  449. data: makeTrafficTimeSpaceData(),
  450. });
  451. },
  452. // 显示特勤弹窗组
  453. showSpecialDutyDalogs(nodeData) {
  454. console.log('显示特勤弹窗组', nodeData.id, nodeData.label);
  455. this.openDutyDetailDialog(nodeData);
  456. },
  457. // === 解析路由参数并执行对应操作 ===
  458. checkRouteParams() {
  459. // 统一参数接收:特勤接收 id,路口接收 intersectionName 和 plan
  460. const { tab, action, id, } = this.$route.query;
  461. if (!tab) return; // 如果没有传递 tab 参数,说明是正常访问,不处理
  462. // 1. 处理“特勤线路”跳转
  463. if (tab === 'specialDuty') {
  464. this.activeLeftTab = 'specialDuty'; // 切换到左侧【特勤】Tab
  465. this.handleTabClick('specialDuty'); // 手动触发 Tab 切换事件,更新顶部图表
  466. // 这里判断的条件改为 id
  467. if (action === 'open-dialog' && id) {
  468. this.$nextTick(() => {
  469. this.openDutyDetailDialog(id); // 打开特勤弹窗
  470. });
  471. }
  472. }
  473. // 2. 处理“关键路口”跳转
  474. else if (tab === 'crossing') {
  475. this.activeLeftTab = 'crossing'; // 切换到左侧【路口】Tab
  476. this.handleTabClick('crossing'); // 手动触发 Tab 切换事件,更新顶部图表
  477. if (action === 'open-dialog') {
  478. this.$nextTick(() => {
  479. // 构造一个假的 nodeData 传给详情弹窗方法
  480. this.showCrossingDetailDialogs({
  481. id: 'route_' + new Date().getTime(), // 动态生成一个ID防重复
  482. label: '路口详情',
  483. });
  484. });
  485. }
  486. }
  487. },
  488. // === 特勤详情弹窗 (你需要根据实际组件名替换) ===
  489. async openDutyDetailDialog(dutyId) {
  490. console.log('准备打开特勤线路详情,ID:', dutyId);
  491. // 1. 获取数据
  492. const panelData = await this.fetchSpecialTaskData();
  493. // 2. 呼出弹窗
  494. this.$refs.layout.openDialog({
  495. id: 'special-task-dialog',
  496. title: ' ', // 留空以隐藏默认标题,使用自定义 Header
  497. width: 1400, // 弹窗宽一点,容纳 3 列
  498. height: 700,
  499. center: false,
  500. showClose: false,
  501. noPadding: true, // 去除默认内边距,让内部组件自己控制
  502. position: {x: 200, y: 150},
  503. // 挂载主体组件和数据
  504. component: 'SpecialTaskMonitorPanel',
  505. data: { panelData: panelData },
  506. // 挂载自定义 Header 和数据
  507. headerComponent: 'TaskMonitorHeader',
  508. headerProps: {
  509. taskData: panelData.taskInfo,
  510. onEndTask: () => {
  511. console.log('点击了结束任务');
  512. this.$refs.layout.handleDialogClose('special-task-dialog');
  513. }
  514. }
  515. });
  516. },
  517. // 模拟从后端拉取数据
  518. async fetchSpecialTaskData() {
  519. // 模拟 API 请求延迟
  520. await new Promise(resolve => setTimeout(resolve, 500));
  521. // 这是后端返回的完整数据结构
  522. return {
  523. // 1. 头部任务信息
  524. taskInfo: {
  525. name: '北京路演唱会特勤路线',
  526. time: '12:00-14:00',
  527. manager: '张飞',
  528. level: '一级',
  529. status: '进行中',
  530. statusColor: '#ff4d4f' // 红色状态灯
  531. },
  532. // 2. 视频流列表 (支持有源和无源)
  533. videos: [
  534. { id: 1, url: testVideo1 }, // 有视频
  535. { id: 2, url: testVideo2 }, // 无视频,展示占位
  536. { id: 3, url: testVideo1 },
  537. { id: 4, url: testVideo2 } // 第4个,用于测试轮播翻页
  538. ],
  539. // 3. 路口控制卡片列表
  540. intersections: [
  541. {
  542. id: 'INT_01',
  543. name: '京原路与北宫路交叉口1',
  544. statusColor: '#ffaa00', // 黄色状态灯
  545. stage: 3,
  546. mode: '步进',
  547. timeLeft: 30,
  548. btnText: '立即解锁',
  549. btnType: 'normal',
  550. phases: [
  551. { id: 1, icon: '↑', img: testImg1, active: false },
  552. { id: 2, icon: '↰', img: testImg1, active: false },
  553. { id: 3, icon: '↑', img: testImg1, active: true }, // 当前激活相位
  554. { id: 4, icon: '↰', img: testImg1, active: false }
  555. ],
  556. // 传给你原有的 IntersectionMapVideos 组件的数据
  557. mapData: {
  558. armsConfig: {
  559. N: { lanes: ['L', 'S', 'R'], cameraType: 1 },
  560. S: { lanes: ['L', 'S', 'R'], cameraType: 1 },
  561. E: { lanes: ['L', 'S', 'R'], cameraType: 2 },
  562. W: { lanes: ['L', 'S', 'R'], cameraType: 2 }
  563. },
  564. signals: {
  565. ns: { isGreen: true, time: 30, phaseName: '南北直行' },
  566. ew: { isGreen: false, time: 45, phaseName: '东西直行' }
  567. }
  568. },
  569. videoUrls: {
  570. nw: testVideo1,
  571. ne: testVideo2,
  572. sw: testVideo1,
  573. se: testVideo2
  574. }
  575. },
  576. // 为了演示,这里复制上面的数据作为第2、3、4个路口
  577. ...Array.from({ length: 3 }).map((_, i) => ({
  578. id: `INT_0${i + 2}`,
  579. name: `京原路与北宫路交叉口${i + 2}`,
  580. statusColor: '#00e5ff',
  581. stage: 2, mode: '系统', timeLeft: 15,
  582. btnText: '立即执行', btnType: 'primary',
  583. phases: [
  584. { id: 1, icon: '↑', img: testImg1, active: true },
  585. { id: 2, icon: '↰', img: testImg1, active: false },
  586. { id: 3, icon: '↑', img: testImg1, active: false },
  587. { id: 4, icon: '↰', img: testImg1, active: false }
  588. ],
  589. mapData: {
  590. armsConfig: {
  591. N: { lanes: ['L', 'S', 'R'], cameraType: 1 },
  592. S: { lanes: ['L', 'S', 'R'], cameraType: 1 },
  593. E: { lanes: ['L', 'S', 'R'], cameraType: 2 },
  594. W: { lanes: ['L', 'S', 'R'], cameraType: 2 }
  595. },
  596. signals: {
  597. ns: { isGreen: true, time: 30, phaseName: '南北直行' },
  598. ew: { isGreen: false, time: 45, phaseName: '东西直行' }
  599. }
  600. },
  601. videoUrls: {
  602. nw: testVideo1,
  603. ne: testVideo2,
  604. sw: testVideo2,
  605. se: testVideo1
  606. }
  607. }))
  608. ]
  609. };
  610. },
  611. }
  612. }
  613. </script>
  614. <style scoped>
  615. .mode-switch {
  616. display: flex;
  617. flex-direction: row;
  618. justify-content: flex-end;
  619. }
  620. .mode-switch>div {
  621. width: 200px;
  622. }
  623. </style>