Browse Source

Merge pull request #16 in PG/plugin-bi-screen-adaptive from release/10.0 to persist/10.0

* commit 'a18ffcc2088c1fc68a971de43c3579d7c5d6eac2':
  fix: 修复jar信息
  fix: 修复jar信息
  fix: 修复jar信息
  BI-52775 fix: 空模板处理
  changelog
persist/10.0
Lanlan 5 years ago
parent
commit
3f50abeec2
  1. 5
      README.md
  2. 7
      plugin.xml
  3. 12
      src/main/resources/com/finebi/plugin/web/plugin.screen_adaptive.js
  4. 12
      src/main/resources/com/finebi/plugin/web/scripts/entry.js

5
README.md

@ -1,6 +1,3 @@
# BI模板自适应插件
用户查看模板时可以选择自适应屏幕宽度的查看方式。
待解决问题:
1. IE下图表的弹出框错位
用户查看模板时可以选择自适应屏幕宽度的查看方式。

7
plugin.xml

@ -3,11 +3,14 @@
<id>com.finebi.plugin.screenadaptive</id>
<name><![CDATA[BI模板屏幕自适应]]></name>
<active>yes</active>
<version>1.1.30</version>
<version>1.1.31</version>
<env-version>10.0</env-version>
<jartime>2019-03-01</jartime>
<jartime>2019-08-16</jartime>
<vendor>fay</vendor>
<description><![CDATA[预览BI模板时,根据屏幕的宽度自适应显示模板]]></description>
<change-notes><![CDATA[
[2019-08-28]为BI模板添加模板自适应功能。<br/>
]]></change-notes>
<extra-decision>
<AbstractWebResourceProvider class="com.finebi.plugin.ScreenAdaptive"/>
</extra-decision>

12
src/main/resources/com/finebi/plugin/web/plugin.screen_adaptive.js

@ -91,13 +91,21 @@
// 获取缩放倍数,原模板宽高
function getScaleBounds() {
var widgts = BI.designConfigure.widgets,
var widgets = BI.designConfigure.widgets,
layoutRatio = BI.designConfigure.layoutRatio,
freeLayoutRatio = BI.designConfigure.freeLayoutRatio,
freeWidgets = BI.designConfigure.freeWidgetIds;
if (Object.keys(widgets).length === 0) {
return {
scale: 1,
width: html.clientWidth,
height: html.clientHeight
}
}
var left = null, right = null, top = null, bottom = null,
freeLeft = null, freeRight = null, freeTop = null, freeBottom = null;
BI.each(widgts, function (wId, widget) {
BI.each(widgets, function (wId, widget) {
var bounds = widget.bounds || {};
if (BI.contains(freeWidgets, wId)) {
freeLeft = BI.isNull(freeLeft) ? bounds.left : Math.min(freeLeft, bounds.left);

12
src/main/resources/com/finebi/plugin/web/scripts/entry.js

@ -91,13 +91,21 @@
// 获取缩放倍数,原模板宽高
function getScaleBounds() {
var widgts = BI.designConfigure.widgets,
var widgets = BI.designConfigure.widgets,
layoutRatio = BI.designConfigure.layoutRatio,
freeLayoutRatio = BI.designConfigure.freeLayoutRatio,
freeWidgets = BI.designConfigure.freeWidgetIds;
if (Object.keys(widgets).length === 0) {
return {
scale: 1,
width: html.clientWidth,
height: html.clientHeight
}
}
var left = null, right = null, top = null, bottom = null,
freeLeft = null, freeRight = null, freeTop = null, freeBottom = null;
BI.each(widgts, function (wId, widget) {
BI.each(widgets, function (wId, widget) {
var bounds = widget.bounds || {};
if (BI.contains(freeWidgets, wId)) {
freeLeft = BI.isNull(freeLeft) ? bounds.left : Math.min(freeLeft, bounds.left);

Loading…
Cancel
Save