{"remainingRequest":"D:\\jenkins\\workspace\\yhxt-web\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\yhxt-web\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\yhxt-web\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!D:\\jenkins\\workspace\\yhxt-web\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\yhxt-web\\src\\views\\basicDataManagement\\carManagement\\MonitoringManagement.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\yhxt-web\\src\\views\\basicDataManagement\\carManagement\\MonitoringManagement.vue","mtime":1714500819515},{"path":"D:\\jenkins\\workspace\\yhxt-web\\babel.config.js","mtime":1667326389982},{"path":"D:\\jenkins\\workspace\\yhxt-web\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\yhxt-web\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\yhxt-web\\node_modules\\babel-loader\\lib\\index.js","mtime":456789000000},{"path":"D:\\jenkins\\workspace\\yhxt-web\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\yhxt-web\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["import \"core-js/modules/es6.regexp.search\";\nimport \"core-js/modules/es6.function.name\";\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\nimport Vue from 'vue';\nimport InfoWindow from \"./InfoWindow.vue\";\nimport basicData from '@/api/basicData.js';\nimport videoPlayer from '@/components/videoPlayer.vue';\nexport default {\n name: 'MonitoringManagement',\n components: {\n InfoWindow: InfoWindow,\n videoPlayer: videoPlayer\n },\n data: function data() {\n return {\n map: null,\n inputSearchVal: '',\n // 组件加载后隐藏\n showInfoWindow: false,\n infoWindow: {},\n data: [],\n input: '',\n //搜索输入内容\n open: true,\n //控制是否是展开列表,默人展开\n defaultProps: {\n children: 'list',\n label: 'name'\n },\n detailInfo: {},\n //传递到信息窗口的数据\n queryData: {\n pageNo: 1,\n pageSize: 20\n },\n showVideoModel: false,\n siteCode: '',\n options: [],\n filterText: '',\n freshing: false,\n loading: false\n };\n },\n created: function created() {\n // setTimeout(() => {\n // this.initMap()\n // // this.addMarker()\n // }, 1000)\n // this.getData()\n this.getCarData();\n },\n watch: {\n filterText: function filterText(val) {\n this.$refs.carCameraTree.filter(val);\n }\n },\n methods: {\n handleNodeClick: function handleNodeClick(data, node) {\n // this.showVideoModel = true\n // this.siteCode = data.cameraIndexCode\n // return\n if (data.cameraIndexCode && data.status == '1') {\n this.showVideoModel = true;\n this.siteCode = data.cameraIndexCode;\n } else if (data.cameraIndexCode && data.status == '0') {\n this.$message.warning('车辆视频状态离线,不可预览!');\n }\n },\n filterNode: function filterNode(value, data, node) {\n console.log(data);\n if (!value) return true;\n var _array = []; //这里使用数组存储 只是为了存储值。\n this.getReturnNode(node, _array, value);\n var result = false;\n _array.forEach(function (item) {\n result = result || item;\n });\n return result;\n },\n getReturnNode: function getReturnNode(node, _array, value) {\n var isPass = node.data && node.data.name && node.data.name.indexOf(value) !== -1;\n isPass ? _array.push(isPass) : '';\n this.index++;\n if (!isPass && node.level != 1 && node.parent) {\n this.getReturnNode(node.parent, _array, value);\n }\n },\n getCarData: function getCarData() {\n var _this = this;\n this.$http.get('${yhxt}/bizVehicle/v1/getCarList').then(function (res) {\n console.log(res, 'res');\n _this.options = res.data.value;\n });\n },\n freshTreeData: function freshTreeData() {\n var _this2 = this;\n this.loading = true;\n this.freshing = true;\n this.$http.get('${yhxt}/bizVehicle/v1/synCarData').then(function (res) {\n console.log(res, 'res');\n }).finally(function () {\n _this2.freshing = false;\n _this2.getCarData();\n _this2.loading = false;\n });\n },\n //初始化地图\n // initMap() {\n // this.map = new AMap.Map('container', {\n // center: [106.45, 29.56667],\n // zoom: 11,\n // mapStyle: 'amap://styles/darkblue', //地图主题\n // // mapStyle:'amap://styles/260ac3de881fb752fdf854ea2b2540d8',\n // })\n // },\n //弹窗信息\n openInfo: function openInfo(positionResult) {\n this.showInfoWindow = true;\n var that = this;\n var infoWindow = new AMap.InfoWindow({\n isCustom: true,\n content: that.$refs.infoWindow.$el,\n offset: new AMap.Pixel(0, -15)\n });\n infoWindow.open(this.map, positionResult);\n this.infoWindow = infoWindow;\n },\n //添加标记点\n addMarker: function addMarker() {\n var _this3 = this;\n var icon = new AMap.Icon({\n size: new AMap.Size(52, 26),\n image: 'https://webapi.amap.com/images/car.png'\n });\n // 将 Icon 实例添加到 marker 上:\n this.marker = new AMap.Marker({\n map: this.map,\n position: new AMap.LngLat(106.45, 29.56667),\n offset: new AMap.Pixel(-10, -10),\n icon: icon,\n // 添加 Icon 实例\n title: '北京',\n zoom: 13\n });\n this.map.add(this.marker);\n //定位到标记点\n this.map.setFitView();\n //点标记绑定事件\n AMap.event.addListener(this.marker, 'click', function (e) {\n console.log(e);\n _this3.openInfo([106.45, 29.56667]);\n });\n },\n //关闭弹窗\n closeInfoWindow: function closeInfoWindow() {\n this.map.clearInfoWindow();\n },\n getData: function getData() {\n var _this4 = this;\n var params = {\n pageBean: {\n page: this.queryData.pageNo,\n pageSize: this.queryData.pageSize,\n showTotal: true\n }\n };\n basicData.getCarInfoManagement(params).then(function (response) {\n _this4.data = response.rows;\n });\n },\n //打开数据列表\n openList: function openList() {\n this.open = !this.open;\n },\n //搜索过滤\n btnSearch: function btnSearch() {\n var _this5 = this;\n if (!this.input) {\n this.getData();\n } else {\n this.data = this.data.filter(function (item) {\n return item.carNumber.indexOf(_this5.input) != -1;\n });\n // this.data = Array(30).fill(this.data[0])\n }\n },\n rowClick: function rowClick(row, column, event) {\n console.log(row);\n this.addMarker();\n this.detailInfo = row;\n },\n getHistoryLine: function getHistoryLine() {\n var _this6 = this;\n this.map.clearInfoWindow();\n AMap.plugin('AMap.Driving', function () {\n // 构造路线导航类\n var driving = new AMap.Driving();\n // 根据起终点经纬度规划驾车导航路线\n driving.search(new AMap.LngLat(116.379028, 39.865042), new AMap.LngLat(116.427281, 39.903719), function (status, result) {\n if (status === 'complete') {\n if (result.routes && result.routes.length) {\n // 绘制第一条路线,也可以按需求绘制其它几条路线\n _this6.drawRoute(result.routes[0]);\n }\n } else {\n _this6.$messge.error('获取驾车数据失败:' + result);\n }\n });\n });\n },\n drawRoute: function drawRoute(route) {\n var path = this.parseRouteToPath(route);\n var startMarker = new AMap.Marker({\n position: path[0],\n icon: 'https://webapi.amap.com/theme/v1.3/markers/n/start.png',\n map: this.map\n });\n var endMarker = new AMap.Marker({\n position: path[path.length - 1],\n icon: 'https://webapi.amap.com/theme/v1.3/markers/n/end.png',\n map: this.map\n });\n var routeLine = new AMap.Polyline({\n path: path,\n isOutline: true,\n outlineColor: '#ffeeee',\n borderWeight: 2,\n strokeWeight: 5,\n strokeOpacity: 0.9,\n strokeColor: '#0091ff',\n lineJoin: 'round'\n });\n this.map.add(routeLine);\n\n // 调整视野达到最佳显示区域\n this.map.setFitView([startMarker, endMarker, routeLine]);\n },\n parseRouteToPath: function parseRouteToPath(route) {\n var path = [];\n for (var i = 0, l = route.steps.length; i < l; i++) {\n var step = route.steps[i];\n for (var j = 0, n = step.path.length; j < n; j++) {\n path.push(step.path[j]);\n }\n }\n return path;\n }\n }\n};",null]}