Browse Source

0.0.4: 图表DEMO_EK 保存配置接口

master
Ivan.Guo-郭一凡 9 months ago
parent
commit
7bb53d89b9
  1. 3
      plugin.xml
  2. 28
      src/main/resources/com/finebi/plugin/tptj/ivan/chart/demo/amap/js/chart.js
  3. BIN
      说明/0.0.3/0.0.3.zip
  4. BIN
      说明/0.0.3/fine-plugin-com.finebi.plugin.tptj.ivan.chart.demo.amap-0.0.3.zip
  5. BIN
      说明/0.0.4/0.0.4.zip
  6. BIN
      说明/0.0.4/fine-plugin-com.finebi.plugin.tptj.ivan.chart.demo.amap-0.0.4.zip

3
plugin.xml

@ -3,7 +3,7 @@
<id>com.finebi.plugin.tptj.ivan.chart.demo.amap</id> <id>com.finebi.plugin.tptj.ivan.chart.demo.amap</id>
<name><![CDATA[图表DEMO_EK]]></name> <name><![CDATA[图表DEMO_EK]]></name>
<active>yes</active> <active>yes</active>
<version>0.0.2</version> <version>0.0.4</version>
<env-version>11.0~11.0</env-version> <env-version>11.0~11.0</env-version>
<jartime>2021-08-30</jartime> <jartime>2021-08-30</jartime>
<vendor>DEMO</vendor> <vendor>DEMO</vendor>
@ -12,6 +12,7 @@
0.0.1: 图表DEMO_EK init<br/> 0.0.1: 图表DEMO_EK init<br/>
0.0.2: 图表DEMO_EK 数据处理接口<br/> 0.0.2: 图表DEMO_EK 数据处理接口<br/>
0.0.3: 图表DEMO_EK 页面刷新接口<br/> 0.0.3: 图表DEMO_EK 页面刷新接口<br/>
0.0.4: 图表DEMO_EK 保存配置接口<br/>
]]></change-notes> ]]></change-notes>
<bi-env-version>6.0~</bi-env-version> <bi-env-version>6.0~</bi-env-version>
<main-package>com.finebi.plugin.tptj.ivan.chart.demo.amap</main-package> <main-package>com.finebi.plugin.tptj.ivan.chart.demo.amap</main-package>

28
src/main/resources/com/finebi/plugin/tptj/ivan/chart/demo/amap/js/chart.js

@ -19,11 +19,22 @@
const mapAttribute = config["chartStyle"]["mapProp"]["value"]; const mapAttribute = config["chartStyle"]["mapProp"]["value"];
// 地图组件初始化 // 地图组件初始化
const map = new AMap.Map(dom, { let map;
resizeEnable: true, let customConfig = config.customConfig;
center: [mapAttribute[0], mapAttribute[1]], if (customConfig != null && JSON.stringify(customConfig).length > 2) {
zoom: mapAttribute[2], // 读取保存的配置
}); map = new AMap.Map(dom, {
resizeEnable: true,
center: [customConfig.lng, customConfig.lat],
zoom: customConfig.zoom,
});
} else {
map = new AMap.Map(dom, {
resizeEnable: true,
center: [mapAttribute[0], mapAttribute[1]],
zoom: mapAttribute[2],
});
}
// 地图设置样式 // 地图设置样式
const styleName = "amap://styles/" + mapAttribute[3]; const styleName = "amap://styles/" + mapAttribute[3];
@ -48,6 +59,13 @@
}); });
document.querySelector("#amap-demo-click").onclick = function () { document.querySelector("#amap-demo-click").onclick = function () {
let conf = {
zoom: map.getZoom(),
lng: map.getCenter().lng,
lat: map.getCenter().lat,
};
// 保存配置
saveSessionCallback(conf);
extensionCallBack('refresh'); extensionCallBack('refresh');
} }
} }

BIN
说明/0.0.3/0.0.3.zip

Binary file not shown.

BIN
说明/0.0.3/fine-plugin-com.finebi.plugin.tptj.ivan.chart.demo.amap-0.0.2.zip → 说明/0.0.3/fine-plugin-com.finebi.plugin.tptj.ivan.chart.demo.amap-0.0.3.zip

Binary file not shown.

BIN
说明/0.0.4/0.0.4.zip

Binary file not shown.

BIN
说明/0.0.4/fine-plugin-com.finebi.plugin.tptj.ivan.chart.demo.amap-0.0.4.zip

Binary file not shown.
Loading…
Cancel
Save