{"remainingRequest":"D:\\jenkins\\workspace\\bbsl-fvue\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\bbsl-fvue\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\bbsl-fvue\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!D:\\jenkins\\workspace\\bbsl-fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\bbsl-fvue\\src\\views\\frontScreens\\components\\gisTabComponents\\DailyRainfall.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\bbsl-fvue\\src\\views\\frontScreens\\components\\gisTabComponents\\DailyRainfall.vue","mtime":1684458238559},{"path":"D:\\jenkins\\workspace\\bbsl-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\bbsl-fvue\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\bbsl-fvue\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\bbsl-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\bbsl-fvue\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["import _defineProperty from \"D:/jenkins/workspace/bbsl-fvue/node_modules/@babel/runtime/helpers/esm/defineProperty\";\nimport \"core-js/modules/web.dom.iterable\";\nimport \"regenerator-runtime/runtime\";\nimport _asyncToGenerator from \"D:/jenkins/workspace/bbsl-fvue/node_modules/@babel/runtime/helpers/esm/asyncToGenerator\";\n\nvar _methods;\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//\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 * as d3 from 'd3';\nimport { gisCompMixin } from '@/mixins/gisCompMixin.js';\nimport dictUtils from '@/components/dict/DictSelectUtils.js';\nimport DailyModel from '@/views/frontScreens/components/gisTabComponents/module/DailyModel';\nimport gisMap from '@/api/frontScreen/gisMap.js';\nexport default {\n name: 'DailyRainfall',\n mixins: [gisCompMixin],\n components: {\n DailyModel: DailyModel\n },\n data: function data() {\n return {\n // 指定坐标字段\n lg: 'lgtd',\n lt: 'lttd',\n czyyfl: [],\n currentPoint: {},\n params: {\n appTypeList: [],\n stnm: ''\n },\n showInfo: false,\n filterData: [],\n barOverLayer: null,\n refreshData: null\n };\n },\n inject: ['mapData'],\n created: function created() {\n var mapData = this.mapData();\n this.L = mapData.L;\n this.map = mapData.map;\n this.czyyfl = dictUtils.getDictItemsFromCache('czyyfl');\n },\n mounted: function mounted() {\n var _this = this;\n\n this.$nextTick( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {\n return regeneratorRuntime.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n _context.next = 2;\n return _this.getFindResList();\n\n case 2:\n // this.initZhu()\n _this.initBar();\n\n _this.initMarkers();\n\n case 4:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee);\n })));\n this.refreshData = setInterval(function () {\n _this.getFindResList();\n\n _this.updateMarkers();\n }, 1000 * 60 * 10);\n },\n beforeDestroy: function beforeDestroy() {\n clearInterval(this.refreshData);\n this.refreshData = null;\n },\n methods: (_methods = {\n initBar: function initBar() {\n var map = this.map;\n var width = 6;\n var height = 1;\n var tableData = this.filterData;\n var sels;\n this.barOverLayer = this.L.d3SvgOverlay(function (sel, proj) {\n sels = sel;\n var citiesUpd = sel.selectAll('rect').data(tableData);\n citiesUpd.enter().append('rect').attr('class', 'rect').attr('x', width / 2).attr('y', function (d2, i) {\n if (d2.dyp > 100) {\n return -d2.dyp * (height / 2);\n } else {\n return -d2.dyp * height;\n }\n }).attr('width', width).attr('height', function (d2, i) {\n if (d2.dyp > 100) {\n return d2.dyp * (height / 2);\n } else {\n return d2.dyp * height;\n }\n }).attr('fill', '#1451a0').attr('transform', function (d2, i) {\n var _latlng = new L.latLng(d2.lttd, d2.lgtd);\n\n return 'translate(' + map.latLngToLayerPoint(_latlng).x + ',' + map.latLngToLayerPoint(_latlng).y + ')';\n }).attr('stroke', '#409eff').attr('stroke-width', 1);\n });\n this.barOverLayer.addTo(this.map);\n\n function update(sel, proj) {\n sel.selectAll('rect').each(function (d, i) {\n if (d && d.lgtd && d.lttd) {\n var _latlng = new L.latLng(d.lttd, d.lgtd);\n\n d3.select(this).attr('transform', 'translate(' + map.latLngToLayerPoint(_latlng).x + ',' + map.latLngToLayerPoint(_latlng).y + ')');\n }\n });\n }\n },\n changeStation: function () {\n var _changeStation = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(val) {\n return regeneratorRuntime.wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n _context2.next = 2;\n return this.getFindResList();\n\n case 2:\n this.searchClear = true;\n this.clearMarkers();\n this.searchClear = false;\n this.initBar();\n this.initMarkers();\n\n case 7:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee2, this);\n }));\n\n function changeStation(_x) {\n return _changeStation.apply(this, arguments);\n }\n\n return changeStation;\n }(),\n changeSearch: function () {\n var _changeSearch = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3(val) {\n return regeneratorRuntime.wrap(function _callee3$(_context3) {\n while (1) {\n switch (_context3.prev = _context3.next) {\n case 0:\n _context3.next = 2;\n return this.getFindResList();\n\n case 2:\n this.searchClear = true;\n this.clearMarkers();\n this.searchClear = false;\n this.initBar();\n this.initMarkers();\n\n case 7:\n case \"end\":\n return _context3.stop();\n }\n }\n }, _callee3, this);\n }));\n\n function changeSearch(_x2) {\n return _changeSearch.apply(this, arguments);\n }\n\n return changeSearch;\n }(),\n updateMarkers: function updateMarkers() {\n // 获得新的列表数据后清除旧的标点、重新创建地图标点\n this.searchClear = true;\n this.clearMarkers();\n this.searchClear = false;\n this.initBar();\n this.initMarkers();\n },\n getFindResList: function getFindResList() {\n var _this2 = this;\n\n return new Promise(function (resolve, reject) {\n gisMap.dayYlList(_this2.params, function (res) {\n if (res.state) {\n _this2.filterData = res.value;\n resolve();\n }\n\n reject();\n });\n });\n },\n customClear: function customClear() {\n if (this.barOverLayer) {\n this.map.removeLayer(this.barOverLayer);\n this.barOverLayer = null;\n }\n },\n initZhu: function initZhu() {\n var map = this.map;\n var tableData = this.filterData;\n var svg = d3.select(map.getPanes().overlayPane).append('svg').attr('class', 'leaflet-zoom-hide');\n\n function drawRect() {\n var width = 4;\n var height = 1;\n var rects = svg.selectAll('g.rectg').data(tableData).enter().append('g').attr('class', 'rectg');\n rects.each(function (d1, i) {\n if (d1.dyp) {\n var data = [d1.dyp];\n d3.select(this).selectAll('g.rect').data(data).enter().append('rect').attr('class', 'rect').attr('x', width / 2).attr('y', function (d2, i) {\n if (d2 > 100) {\n return -d2 * (height / 2);\n } else {\n return -d2 * height;\n }\n }).attr('width', 10).attr('height', function (d2, i) {\n if (d2 > 100) {\n return d2 * (height / 2);\n } else {\n return d2 * height;\n }\n }).attr('fill', '#4db7ff');\n }\n });\n }\n\n function update() {\n svg.selectAll('g.rectg').each(function (d, i) {\n if (d && d.lgtd && d.lttd) {\n var _latlng = new L.latLng(d.lttd, d.lgtd);\n\n d3.select(this).attr('transform', 'translate(' + map.latLngToLayerPoint(_latlng).x + ',' + map.latLngToLayerPoint(_latlng).y + ')');\n }\n });\n }\n\n function initial() {\n svg.attr('width', 1920).attr('height', 2000);\n drawRect();\n } //初始化画图的函数\n\n\n initial();\n update(); //事件响应\n\n map.on('zoom', update);\n },\n infoWindow: function infoWindow() {\n var sContent = this.$refs.DailyModel.$el;\n var infoWin = new L.popup({\n autoPan: true,\n maxHeight: 500,\n maxWidth: 600,\n minWidth: 500\n }).setContent(sContent);\n return infoWin;\n },\n // 点击列表行创建对应标点\n rowClick: function rowClick(row) {\n if (!row[this.lt] || !row[this.lg]) {\n this.$message.warning('暂无点位数据');\n return;\n }\n\n this.currentPoint = row;\n var latlng = new L.latLng(row[this.lt], row[this.lg]);\n this.initMark(latlng, row);\n this.inits(row);\n },\n inits: function inits(row) {\n var map = this.map;\n var width = 6;\n var height = 1;\n var tableData = [];\n tableData.push(row);\n var sels;\n this.barOverLayer = this.L.d3SvgOverlay(function (sel, proj) {\n sels = sel;\n var citiesUpd = sel.selectAll('rect').data(tableData);\n citiesUpd.enter().append('rect').attr('class', 'rect').attr('x', width / 2).attr('y', function (d2, i) {\n if (d2.dyp > 100) {\n return -d2.dyp * (height / 2);\n } else {\n return -d2.dyp * height;\n }\n }).attr('width', width).attr('height', function (d2, i) {\n if (d2.dyp > 100) {\n return d2.dyp * (height / 2);\n } else {\n return d2.dyp * height;\n }\n }).attr('fill', '#1451a0').attr('transform', function (d2, i) {\n var _latlng = new L.latLng(d2.lttd, d2.lgtd);\n\n return 'translate(' + map.latLngToLayerPoint(_latlng).x + ',' + map.latLngToLayerPoint(_latlng).y + ')';\n }).attr('stroke', '#409eff').attr('stroke-width', 1);\n });\n this.barOverLayer.addTo(this.map);\n\n function update(sel, proj) {\n sel.selectAll('rect').each(function (d, i) {\n if (d && d.lgtd && d.lttd) {\n var _latlng = new L.latLng(d.lttd, d.lgtd);\n\n d3.select(this).attr('transform', 'translate(' + map.latLngToLayerPoint(_latlng).x + ',' + map.latLngToLayerPoint(_latlng).y + ')');\n }\n });\n }\n },\n initMark: function initMark(latlng, row) {\n var _this3 = this;\n\n this.updateMarkers();\n this.LayerGroup = null;\n this.markerslayer = [];\n var label = new L.divIcon({\n html: \"