Browse Source

Merge pull request #11 in PG/plugin-bi-screen-adaptive from ~FAY/plugin-bi-screen-adaptive:release/10.0 to release/10.0

* commit '9ac71125e47308bd6f81187f95f4db35602e8428':
  BI-52775 fix: 空模板处理
feature/10.0
fay 5 years ago
parent
commit
49f688c726
  1. 5
      README.md
  2. 2
      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下图表的弹出框错位
用户查看模板时可以选择自适应屏幕宽度的查看方式。

2
plugin.xml

@ -3,7 +3,7 @@
<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>
<vendor>fay</vendor>

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