ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
路径D:\ireport365\ireport365.war\js\enduser\designer\vs-component-echarts.js 下面的 搜索汉字应该能搜索到 直接覆盖吧 改的小地方杂多 没办法固定位置 ~~~ case "DrillDownChinaMap": // 数据处理 var option = component.config.chartConfig; var optionNode = component.config; var mapdata = option.series[0].data; option.series[0].data = mapdata; if(optionNode.curlMap){ loadMap1(optionNode.curlMap.mapCode, optionNode.curlMap.mapName); }else{ loadMap1('100000', 'china'); } function loadMap1(mapCode, mapName) { $.ajaxSettings.async = false; $.getJSON(contextPath + '/cdn/1.0/assets-map-json/main-city/' + mapCode + '.json', function(data1) { if (data1) { echarts.registerMap(mapName, data1); // console.log(data1) option.series[0].mapType = mapName // console.log(mapName) scope.component.context.chart.setOption(option, true) curMap = { mapCode: mapCode, mapName: mapName }; console.log(curMap) } else { alert('无法加载该地图'); } }); } /** 绑定用户切换地图区域事件 cityMap对象存储着地图区域名称和区域的信息(name-code) 当mapCode有值,说明可以切换到下级地图 同时保存上级地图的编号和名称 */ component.context.chart.on("mapselectchanged", function (params) { clearTimeout(timeFn); if (params.dataIndex < 0) { return } // console.log(params) timeFn = setTimeout(function(){ const name = params.batch[0].name; const mapCode = cityMap[name]; console.log(mapCode) console.log(name); if (!mapCode) { //如果地图无法继续下钻,则让点击的区域呈现选中状态 option.series[0].data = [{ name: name, selected: true, // value:Math.round(Math.random()*1000) }] return false; } else { loadMap1(mapCode, name); //将上一级地图信息压入mapStack mapStack.push({ mapCode: curMap.mapCode, mapName: curMap.mapName }); } // scope.component.context.chart.setOption(option, true) // console.log(mapStack) }, 250); }); /** 绑定双击事件,并加载上一级地图 */ component.context.chart.on('dblclick', function(params) { //当双击事件发生时,清除单击事件,仅响应双击事件 clearTimeout(timeFn); var map = mapStack.pop(); if (!mapStack.length && !map) { // alert('已经到达最上一级地图了'); if(optionNode.curlMap){ loadMap1(optionNode.curlMap.mapCode, optionNode.curlMap.mapName); }else{ loadMap1('100000', 'china'); } return; } loadMap1(map.mapCode, map.mapName); // scope.component.context.chart.setOption(option, true) }); break ~~~ 在_buildChinaAreaMapAreaChartDescription4方法里 找 这里是最上面 放在块状上面 ~~~ dataCategory.groups.push({ name: "text", title: { text: "配置地区" }, elements: [{ title: "省份", type: "select-s", bind: "provinceObj", items: [{ name: "北京", value: "110000" }, { name: "天津", value: "120000" }, { name: "上海", value: "310000" }, { name: "重庆", value: "500000" },{ name: "河北", value: "130000" }, { name: "山西", value: "140000" }, { name: "内蒙古", value: "150000" }, { name: "辽宁", value: "210000" }, { name: "吉林", value: "220000" }, { name: "黑龙江", value: "230000" }, { name: "江苏", value: "320000" }, { name: "浙江", value: "330000" }, { name: "安徽", value: "340000" }, { name: "福建", value: "350000" }, { name: "江西", value: "360000" }, { name: "山东", value: "370000" }, { name: "河南", value: "410000" }, { name: "湖北", value: "420000" }, { name: "湖南", value: "430000" }, { name: "广东", value: "440000" }, { name: "广西", value: "450000" }, { name: "海南", value: "460000" }, { name: "四川", value: "510000" }, { name: "贵州", value: "520000" }, { name: "云南", value: "530000" }, { name: "西藏", value: "540000" }, { name: "陕西", value: "610000" }, { name: "青海", value: "630000" }, { name: "宁夏", value: "640000" }, { name: "新疆", value: "650000" }, { name: "香港", value: "810000" }, { name: "澳门", value: "820000" }, { name: "台湾", value: "710000" }] }] }) ~~~ 下面是上面的监听方法 在同一个大方法里 鼠标向下滑动200行左右吧 // 选择省份 ~~~ scope.$watch("component.config.provinceObj", function (newValue, oldValue) { if (newValue != null && newValue !== oldValue) { var option = component.config.chartConfig; var optionNode = component.config; // console.log(optionNode) // console.log(newValue) loadMap(newValue.value,newValue.name); function loadMap(mapCode, mapName) { $.ajaxSettings.async = false; $.getJSON(contextPath + '/cdn/1.0/assets-map-json/main-city/' + mapCode + '.json', function(data1) { if (data1) { // console.log(data1) echarts.registerMap(mapName, data1); // console.log(data1) option.series[0].mapType = mapName // console.log(mapName) scope.component.context.chart.setOption(option, true) curlMap = { mapCode: mapCode, mapName: mapName }; // console.log(curlMap); optionNode.curlMap = curlMap; // console.log(optionNode); } else { alert('无法加载该地图'); } }); } // console.log(scope.component.description.categories[6].groups[0].elements[1].items) } }); ~~~ 路径D:\ireport365\ireport365.war\WEB-INF\classes\report-resource\design.js 同理 搜汉字搜索位置吧 替换吧 ~~~ case "DrillDownChinaMap": //存储切换的每一级地图信息 // const mapStack = [{mapCode: '100000',mapName: 'china'}]; const mapStack = []; let curMap = {}; var timeFn = null; var option = component.config.chartConfig; var optionNode = component.config; var mapdata = option.series[0].data; option.series[0].data = mapdata; if(optionNode.curlMap){ loadMap1(optionNode.curlMap.mapCode, optionNode.curlMap.mapName); }else{ loadMap1('100000', 'china'); } function loadMap1(mapCode, mapName) { // console.log(mapCode) // console.log(mapName) $.ajaxSettings.async = false; $.getJSON(contextPath + '/cdn/1.0/assets-map-json/main-city/' + mapCode + '.json', function(data) { if (data) { echarts.registerMap(mapName, data); // console.log(data) option.series[0].mapType = mapName // console.log(mapName) scope.component.context.chart.setOption(option, true) curMap = { mapCode: mapCode, mapName: mapName }; } else { alert('无法加载该地图'); } }); } /** 绑定用户切换地图区域事件 cityMap对象存储着地图区域名称和区域的信息(name-code) 当mapCode有值,说明可以切换到下级地图 同时保存上级地图的编号和名称 */ component.context.chart.on("mapselectchanged", function (params) { clearTimeout(timeFn); if (params.dataIndex < 0) { return } // console.log(params) timeFn = setTimeout(function(){ const name = params.batch[0].name; const mapCode = cityMap[name]; // console.log(mapCode) // console.log(name); if (!mapCode) { //如果地图无法继续下钻,则让点击的区域呈现选中状态 option.series[0].data = [{ name: name, selected: true, // value:Math.round(Math.random()*1000) }] return false; } else { loadMap1(mapCode, name); //将上一级地图信息压入mapStack mapStack.push({ mapCode: curMap.mapCode, mapName: curMap.mapName }); } // scope.component.context.chart.setOption(option, true) console.log(mapStack) }, 250); }); /** 绑定双击事件,并加载上一级地图 */ component.context.chart.on('dblclick', function(params) { //当双击事件发生时,清除单击事件,仅响应双击事件 clearTimeout(timeFn); var map = mapStack.pop(); if (!mapStack.length && !map) { // alert('已经到达最上一级地图了'); if(optionNode.curlMap){ loadMap1(optionNode.curlMap.mapCode, optionNode.curlMap.mapName); }else{ loadMap1('100000', 'china'); } return; } loadMap1(map.mapCode, map.mapName); // scope.component.context.chart.setOption(option, true) }); break; } }; ~~~