Browse Source

提交开源任务材料

10.0
LAPTOP-SB56SG4Q\86185 3 years ago
parent
commit
16bd970643
  1. 5
      README.md
  2. 1049
      doc/GettingStarted.cpt
  3. BIN
      doc/JSD-9576任务需求文档V1.docx
  4. BIN
      doc/JSD-9576配置使用文档.docx
  5. BIN
      lib/finekit-10.0.jar
  6. 24
      plugin.xml
  7. 23
      src/main/java/com/fr/plugin/iegf/Constants.java
  8. 40
      src/main/java/com/fr/plugin/iegf/LocaleFinder.java
  9. 12
      src/main/java/com/fr/plugin/iegf/ui/CssFile.java
  10. 23
      src/main/java/com/fr/plugin/iegf/ui/JavaScriptFile.java
  11. 2
      src/main/resources/com/fr/plugin/iegf/locale/lang.properties
  12. 2
      src/main/resources/com/fr/plugin/iegf/locale/lang_zh_CN.properties
  13. 55
      src/main/resources/com/fr/plugin/iegf/ui/iegf.css
  14. 208
      src/main/resources/com/fr/plugin/iegf/ui/iegf.js

5
README.md

@ -1,3 +1,6 @@
# open-JSD-9576
JSD-9576 参数面板支持滚动条
JSD-9576 参数面板支持滚动条\
免责说明:该源码为第三方爱好者提供,不保证源码和方案的可靠性,也不提供任何形式的源码教学指导和协助!\
仅作为开发者学习参考使用!禁止用于任何商业用途!\
为保护开发者隐私,开发者信息已隐去!若原开发者希望公开自己的信息,可联系hugh处理。

1049
doc/GettingStarted.cpt

File diff suppressed because it is too large Load Diff

BIN
doc/JSD-9576任务需求文档V1.docx

Binary file not shown.

BIN
doc/JSD-9576配置使用文档.docx

Binary file not shown.

BIN
lib/finekit-10.0.jar

Binary file not shown.

24
plugin.xml

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<plugin>
<id>com.fr.plugin.iegf.par</id>
<name><![CDATA[参数面板定制]]></name>
<active>yes</active>
<version>1.0</version>
<env-version>10.0</env-version>
<jartime>2018-07-31</jartime>
<vendor>fr.open</vendor>
<description><![CDATA[参数面板定制]]></description>
<change-notes><![CDATA[参数面板定制]]></change-notes>
<main-package>com.fr.plugin.iegf</main-package>
<prefer-packages>
<prefer-package>com.fanruan.api</prefer-package>
</prefer-packages>
<extra-core>
<LocaleFinder class="com.fr.plugin.iegf.LocaleFinder"/>
</extra-core>
<extra-report>
<JavaScriptFileHandler class="com.fr.plugin.iegf.ui.JavaScriptFile"/>
<CssFileHandler class="com.fr.plugin.iegf.ui.CssFile"/>
</extra-report>
<function-recorder class="com.fr.plugin.iegf.LocaleFinder"/>
</plugin>

23
src/main/java/com/fr/plugin/iegf/Constants.java

@ -0,0 +1,23 @@
/**
* Copyright (C), 2015-2018
* FileName: parameterPaneAdjustShiftConstants
* Author: mqh
* Date: 2018/10/11 11:31
* Description: 常量类
* History:
* <author> <time> <version> <desc>
* 作者姓名 修改时间 版本号 描述
*/
package com.fr.plugin.iegf;
/**
* 功能简述<br>
* 常量类
*
* @author fr.open
* @create 2018/10/11
* @since 1.0.0
*/
public class Constants {
public static final String PLUGIN_ID = "com.fr.plugin.iegf.par";
}

40
src/main/java/com/fr/plugin/iegf/LocaleFinder.java

@ -0,0 +1,40 @@
/*
* Copyright (C), 2018-2020
* Project: starter
* FileName: LocaleFinder
* Author: Louis
* Date: 2020/8/31 22:19
*/
package com.fr.plugin.iegf;
import com.fr.intelli.record.Focus;
import com.fr.intelli.record.Original;
import com.fr.record.analyzer.EnableMetrics;
import com.fr.stable.fun.Authorize;
import com.fr.stable.fun.impl.AbstractLocaleFinder;
import static com.fr.plugin.iegf.LocaleFinder.PLUGIN_ID;
/**
* <Function Description><br>
* <LocaleFinder>
*
* @author fr.open
* @since 1.0.0
*/
@EnableMetrics
@Authorize(callSignKey = PLUGIN_ID)
public class LocaleFinder extends AbstractLocaleFinder {
public static final String PLUGIN_ID = "com.fr.plugin.iegf.par";
@Override
@Focus(id = PLUGIN_ID, text = "Plugin-iegf", source = Original.PLUGIN)
public String find() {
return "com/fr/plugin/iegf/locale/lang";
}
@Override
public int currentAPILevel() {
return CURRENT_LEVEL;
}
}

12
src/main/java/com/fr/plugin/iegf/ui/CssFile.java

@ -0,0 +1,12 @@
package com.fr.plugin.iegf.ui;
import com.fr.stable.fun.impl.AbstractCssFileHandler;
public class CssFile extends AbstractCssFileHandler {
@Override
public String[] pathsForFiles() {
return new String[]{
"/com/fr/plugin/iegf/ui/iegf.css"
};
}
}

23
src/main/java/com/fr/plugin/iegf/ui/JavaScriptFile.java

@ -0,0 +1,23 @@
package com.fr.plugin.iegf.ui;
import com.fanruan.api.i18n.I18nKit;
import com.fanruan.api.log.LogKit;
import com.fr.plugin.context.PluginContexts;
import com.fr.plugin.iegf.Constants;
import com.fr.stable.fun.Authorize;
import com.fr.stable.fun.impl.AbstractJavaScriptFileHandler;
@Authorize(callSignKey = Constants.PLUGIN_ID)
public class JavaScriptFile extends AbstractJavaScriptFileHandler {
@Override
public String[] pathsForFiles() {
if (PluginContexts.currentContext().isAvailable()) {
return new String[]{
"/com/fr/plugin/iegf/ui/iegf.js"
};
} else {
LogKit.error(I18nKit.getLocText("Plugin-iegf_Licence_Expired"));
return new String[]{};
}
}
}

2
src/main/resources/com/fr/plugin/iegf/locale/lang.properties

@ -0,0 +1,2 @@
Plugin-iegf=Parameter Panel Plugin
Plugin-iegf_Licence_Expired=Parameter Panel Plugin Licence Expired

2
src/main/resources/com/fr/plugin/iegf/locale/lang_zh_CN.properties

@ -0,0 +1,2 @@
Plugin-iegf=\u53C2\u6570\u9762\u677F\u5B9A\u5236\u63D2\u4EF6
Plugin-iegf_Licence_Expired=\u53C2\u6570\u9762\u677F\u5B9A\u5236\u63D2\u4EF6\u8BB8\u53EF\u8FC7\u671F

55
src/main/resources/com/fr/plugin/iegf/ui/iegf.css

@ -0,0 +1,55 @@
.parameter-containerOut {
background-color: greenyellow;
}
.vScrollPane_dragbar {
position: absolute;
top: 0;
/*right: 0;*/
width: 8px;
margin: 0 auto;
background-position: top -32px;
background-color: #eee;
}
.vScrollPane_draghandle {
height: 30px;
border: 1px solid #d5d3d3;
overflow: hidden;
position: absolute;
top: 0;
cursor: default;
background-position: center -48px;
background-repeat: no-repeat;
background-color: #e5e5e5;
-moz-border-radius: 3px;
-khtml-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
}
.vScrollPane_toparrow, .vScrollPane_bottomarrow {
display: inline-block;
height: 8px;
width: 8px;
overflow: hidden;
position: absolute;
right: 0;
}
.vScrollPane_toparrow {
top: 0;
}
.vScrollPane_toparrow:hover {
background-position: top -64px;
}
.vScrollPane_bottomarrow {
bottom: 0;
background-position: top -8px;
}
.vScrollPane_bottomarrow:hover {
background-position: top -80px;
}

208
src/main/resources/com/fr/plugin/iegf/ui/iegf.js

@ -0,0 +1,208 @@
/**
* Created by Louis on 18/10/15.
*/
(function ($) {
FR.BasePane.prototype._createFormParameterPane = function (options, layout, paramsTemplate) {
var collapsePaneHeight = 8;
options.alignLayoutName = '__layout4align__';
var self = this, paramO = options.param;
var config = paramO.html;
self.scrollHeight = 6;
//这边maxWidth 7.1的时候被改成了paramO.width, 导致web端的居右居中效果很奇怪
var maxWidth = 0, maxHeight = 0;
for (var i = 0; i < config.items.length; i++) {
var item = config.items[i];
maxWidth = Math.max(maxWidth, item.x + item.width);
maxHeight = Math.max(maxHeight, item.y + item.height);
}
var deltaHeight = paramO.height - maxHeight;
var formLayout;
var barHeight = paramO.width > document.body.offsetWidth ? self.scrollHeight : 0;
var $paraContainer = $("<div class='parameter-container' style='overflow: auto;'>").css({
'height': paramO.height + barHeight + collapsePaneHeight,
'width': document.body.offsetWidth
});
var paramsTemplateHeight = (paramO.useParamsTemplate && paramsTemplate !== null ? 30 : 0);
FR.parameterContainerHeight = paramO.height + barHeight + collapsePaneHeight + paramsTemplateHeight;
options.$paraContainer = $paraContainer;
config.onCalculate = function (currentMaxHeight) {
if ($.isFunction(options.onCalculate)) {
options.onCalculate.call(this, currentMaxHeight + deltaHeight, collapsePaneHeight, $paraContainer);
}
};
var $expandEl = $("<div class='parameter-container-collapseimg-up' style='cursor: pointer'></div>").click(function () {
var resizeTime = new Date();
self.lastResizeTime = resizeTime;
setTimeout(function () {
if (resizeTime === self.lastResizeTime) {
delete self.lastResizeTime;
$paraContainer.animate({
height: (self.hasCollapsed ? "+=" : "-=") + (paramO.height + paramsTemplateHeight)
}, "fast", function () {
if (self.hasCollapsed) {
FR.parameterContainerHeight += (paramO.height + paramsTemplateHeight);
} else {
FR.parameterContainerHeight -= (paramO.height + paramsTemplateHeight);
}
self.hasCollapsed = !self.hasCollapsed;
$expandEl.switchClass('parameter-container-collapseimg-down', 'parameter-container-collapseimg-up');
if ($.isFunction(options.onCollapse)) {
var height = $paraContainer.height();
options.onCollapse.call(this, self.hasCollapsed, options.alignLayoutName, height);
self.doAfterCollapse();
self.afterLoad();
}
});
}
}, 222);
});
var alignment = 'left';
switch (paramO.alignLocation) {
case 0 :
alignment = 'left';
break;
case 1 :
alignment = 'center';
break;
case 2 :
alignment = 'right';
break;
default :
alignment = 'left';
}
var $center = $('<div class="pmeter-container"></div>').css({
"height": paramO.height,
"width": paramO.width
});
var paramstemplateHeight = 30;
var paramstemplateContainer = {
region: 'north',
height: paramstemplateHeight,
el: {
type: 'border',
widgetName: 'paramsTemplate',
items: [
{
region: 'east',
width: 138,
el: {
type: 'horizontal',
alignment: 'right',
items: [{
el: {
type: 'button',
widgetName: 'saveBtn',
text: FR.i18nText("Fine-Engine_Report_Designer_Save_As_Params_Template")
}, width: 128
}, {
el: $('<div>'), width: 10
}]
}
}, {
region: 'center',
el: {
type: 'horizontal',
widgetName: 'paramsTemplatePane',
alignment: 'left',
items: []
}
}, {
region: 'west',
width: 30,
el: {
type: 'horizontal',
alignment: 'left',
items: [
{
el: {
type: 'iconbutton',
widgetName: 'newParamsBtn',
width: 30,
baseClass: 'fs-new-params-template-blue'
},
width: 30
}
]
}
}
]
}
};
if (!options.param.useParamsTemplate || paramsTemplate === null) {
paramstemplateHeight = 0;
paramstemplateContainer = {};
}
//定义一下用来滚动的对象
var paraConfig = {
renderEl: $paraContainer,
type: 'border',
items: [
paramstemplateContainer,
{
region: 'south', height: collapsePaneHeight, el: {
type: 'horizontal',
items: [
{el: $expandEl, width: 120}
]
}
},
{
region: 'center', el: {
type: 'vertical',//垂直滚动条定制:改成了纵向布局
scrollable: true,//垂直滚动条定制:纵向布局允许滚动条
width: paramO.width,
minWidth: paramO.width,
widgetName: options.alignLayoutName,
alignment: alignment,
items: [
{el: $center, width: maxWidth, height: maxHeight + 20} //ezreal:参数面板大小改成最大高度
]
}
}
]
};
this._setBackground(paramO, $paraContainer);
if (paramO.showType === 1) {
layout.push({
region: 'north',
el: paraConfig,
height: paramO.height + collapsePaneHeight + barHeight + paramstemplateHeight
});
}
if (paramO.showType === 0) {
$paraContainer.css({
position: "absolute",
width: paramO.width,
height: paramO.height
}).appendTo("body");
config.listeners = [
{
once: true,
eventName: 'submitcomplete',
action: function () {
FR.closeDialog();
}
}
];
config.renderEl = $paraContainer;
formLayout = new FR.contentForm(config);
} else {
config.renderEl = $center;
config.container = $paraContainer;
formLayout = new FR.contentForm(config);
}
if (paramO.showType === 0) {
formLayout.doLayout();
FR.showDialog({
title: paramO.paramWindowTitle,
width: paramO.width + 20,
height: paramO.height + 45,
contentHtml: $paraContainer
});
}
return formLayout;
};
})(jQuery);
Loading…
Cancel
Save