Browse Source
* commit 'fa642cb19a1afc6cb87548f7be687b0f7c9ed2aa': (81 commits) REPORT-16527 @xiaoxia 通过直接预览触发的模版保存,该模版不会保存新版本 REPORT-16559 @xiaoxia 远程设计,开启模版版本保存,修改模版保存不会产生新版本 REPORT-16527 @xiaoxia 通过直接预览触发的模版保存,该模版不会保存新版本 REPORT-16550 模板搜索问题 REPORT-16520 @xiaoxia 设计器内打开多模版,进入模版版本管理会“卡住” REPORT-16568 @xiaoxia 多人远程设计时,第一个用户未打开模板,直接进入版本控制,模版不会上锁且能正常进入版本管理 get&set DEC-7537 设计器平台url的问题 import 移包 无JIRA任务,build failed, 错误的import ct c ct ct ct ct ct ct 代码质量 ...research/10.0
neil
6 years ago
144 changed files with 6325 additions and 627 deletions
@ -0,0 +1,67 @@
|
||||
package com.fr.design.actions.help; |
||||
|
||||
import com.fr.design.actions.UpdateAction; |
||||
import com.fr.design.dialog.BasicDialog; |
||||
import com.fr.design.dialog.DialogActionAdapter; |
||||
import com.fr.design.mainframe.DesignerContext; |
||||
import com.fr.design.ui.ModernUIPane; |
||||
import com.fr.locale.InterProviderFactory; |
||||
import com.fr.web.struct.AssembleComponent; |
||||
import com.fr.web.struct.Atom; |
||||
import com.fr.web.struct.browser.RequestClient; |
||||
import com.fr.web.struct.category.ScriptPath; |
||||
import com.fr.web.struct.impl.FineUI; |
||||
|
||||
import java.awt.event.ActionEvent; |
||||
|
||||
/** |
||||
* @author richie |
||||
* @version 10.0 |
||||
* Created by richie on 2019-03-08 |
||||
*/ |
||||
public class FineUIAction extends UpdateAction { |
||||
|
||||
public FineUIAction() { |
||||
setName("FineUI"); |
||||
} |
||||
|
||||
@Override |
||||
public void actionPerformed(final ActionEvent e) { |
||||
ModernUIPane<?> pane = new ModernUIPane.Builder<>() |
||||
// .prepare(new ScriptContextAdapter() {
|
||||
// @Override
|
||||
// public void onScriptContextCreated(ScriptContextEvent event) {
|
||||
// JSValue pool = event.getBrowser().executeJavaScriptAndReturnValue("window.Pool");
|
||||
// pool.asObject().setProperty("i18n", new I18n());
|
||||
// }
|
||||
// })
|
||||
.withComponent(new AssembleComponent() { |
||||
|
||||
@Override |
||||
public ScriptPath script(RequestClient req) { |
||||
return ScriptPath.build("/com/fr/design/ui/help/demo.js"); |
||||
} |
||||
|
||||
@Override |
||||
public Atom[] refer() { |
||||
return new Atom[] {FineUI.KEY}; |
||||
} |
||||
}) |
||||
.build(); |
||||
BasicDialog dialog = pane.showLargeWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() { |
||||
@Override |
||||
public void doOk() { |
||||
|
||||
} |
||||
}); |
||||
dialog.setVisible(true); |
||||
|
||||
} |
||||
|
||||
public static class I18n { |
||||
|
||||
public String i18nText(String key) { |
||||
return InterProviderFactory.getProvider().getLocText(key); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,17 @@
|
||||
package com.fr.design.bridge.exec; |
||||
|
||||
import java.lang.annotation.ElementType; |
||||
import java.lang.annotation.Retention; |
||||
import java.lang.annotation.RetentionPolicy; |
||||
import java.lang.annotation.Target; |
||||
|
||||
/** |
||||
* @author richie |
||||
* @version 10.0 |
||||
* Created by richie on 2019-04-18 |
||||
* 用于标记一个方法是用于和JS做桥接的,避免被误删除 |
||||
*/ |
||||
@Target(ElementType.METHOD) |
||||
@Retention(RetentionPolicy.SOURCE) |
||||
public @interface JSBridge { |
||||
} |
@ -0,0 +1,18 @@
|
||||
package com.fr.design.bridge.exec; |
||||
|
||||
/** |
||||
* Created by ibm on 2017/5/27. |
||||
*/ |
||||
public class JSCallback { |
||||
|
||||
private JSExecutor executeScript; |
||||
|
||||
public JSCallback(JSExecutor jsExecutor) { |
||||
this.executeScript = jsExecutor; |
||||
} |
||||
|
||||
public void execute(String newValue) { |
||||
executeScript.executor(newValue); |
||||
} |
||||
} |
||||
|
@ -1,4 +1,4 @@
|
||||
package com.fr.design.extra.exe.callback; |
||||
package com.fr.design.bridge.exec; |
||||
|
||||
/** |
||||
* Created by ibm on 2017/6/21. |
@ -0,0 +1,42 @@
|
||||
package com.fr.design.extra; |
||||
|
||||
import com.fr.design.bridge.exec.JSExecutor; |
||||
import com.fr.design.bridge.exec.JSUtils; |
||||
import javafx.application.Platform; |
||||
import javafx.scene.web.WebEngine; |
||||
import netscape.javascript.JSObject; |
||||
|
||||
/** |
||||
* @author richie |
||||
* @version 10.0 |
||||
* Created by richie on 2019-04-18 |
||||
*/ |
||||
public class PluginJavaFxExecutor implements JSExecutor { |
||||
|
||||
public static PluginJavaFxExecutor create(WebEngine webEngine, JSObject callback) { |
||||
return new PluginJavaFxExecutor(webEngine, callback); |
||||
} |
||||
|
||||
private WebEngine webEngine; |
||||
private JSObject callback; |
||||
|
||||
private PluginJavaFxExecutor(WebEngine webEngine, JSObject callback) { |
||||
this.webEngine = webEngine; |
||||
this.callback = callback; |
||||
} |
||||
|
||||
@Override |
||||
public void executor(final String newValue) { |
||||
Platform.runLater(new Runnable() { |
||||
@Override |
||||
public void run() { |
||||
String fun = "(" + callback + ")(\"" + JSUtils.trimText(newValue) + "\")"; |
||||
try { |
||||
webEngine.executeScript(fun); |
||||
} catch (Exception e) { |
||||
webEngine.executeScript("alert(\"" + e.getMessage() + "\")"); |
||||
} |
||||
} |
||||
}); |
||||
} |
||||
} |
@ -0,0 +1,38 @@
|
||||
package com.fr.design.fun; |
||||
|
||||
import com.fr.design.menu.MenuDef; |
||||
import com.fr.start.SplashStrategy; |
||||
|
||||
import java.awt.image.BufferedImage; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
* 设计器Oem接口 |
||||
*/ |
||||
public interface OemProcessor { |
||||
public static final String MARK_STRING = "OemProcessor"; |
||||
|
||||
/** |
||||
* 启动动画,如果不替换则返回null |
||||
* |
||||
* @return |
||||
*/ |
||||
SplashStrategy createSplashStrategy(); |
||||
|
||||
/** |
||||
* 替换标题图标--DesignerFrame.initTitleIcon |
||||
* 如果不替换则返回null |
||||
* |
||||
* @return |
||||
*/ |
||||
List<BufferedImage> createTitleIcon(); |
||||
|
||||
/** |
||||
* 处理设计器菜单(增删改) |
||||
* |
||||
* @param menuDefs 已加载的菜单 |
||||
* @return 新的菜单数组 |
||||
*/ |
||||
MenuDef[] dealWithMenuDef(MenuDef[] menuDefs); |
||||
|
||||
} |
@ -0,0 +1,25 @@
|
||||
package com.fr.design.fun.impl; |
||||
|
||||
import com.fr.design.fun.OemProcessor; |
||||
import com.fr.design.menu.MenuDef; |
||||
import com.fr.start.SplashStrategy; |
||||
|
||||
import java.awt.image.BufferedImage; |
||||
import java.util.List; |
||||
|
||||
public abstract class AbstractOemProcessor implements OemProcessor{ |
||||
@Override |
||||
public MenuDef[] dealWithMenuDef(MenuDef[] menuDefs) { |
||||
return menuDefs; |
||||
} |
||||
|
||||
@Override |
||||
public List<BufferedImage> createTitleIcon() { |
||||
return null; |
||||
} |
||||
|
||||
@Override |
||||
public SplashStrategy createSplashStrategy() { |
||||
return null; |
||||
} |
||||
} |
@ -0,0 +1,11 @@
|
||||
package com.fr.design.mainframe; |
||||
|
||||
import com.fr.event.Event; |
||||
|
||||
public enum DesignAuthorityEventType implements Event<DesignerFrame> { |
||||
|
||||
// 退出权限编辑
|
||||
StartEdit, |
||||
// 进入权限编辑
|
||||
StopEdit; |
||||
} |
@ -0,0 +1,406 @@
|
||||
package com.fr.design.upm; |
||||
|
||||
import com.fr.base.passport.FinePassportManager; |
||||
import com.fr.config.MarketConfig; |
||||
import com.fr.decision.webservice.v10.plugin.helper.category.impl.UpmResourceLoader; |
||||
import com.fr.design.bridge.exec.JSBridge; |
||||
import com.fr.design.bridge.exec.JSCallback; |
||||
import com.fr.design.extra.PluginOperateUtils; |
||||
import com.fr.design.extra.PluginUtils; |
||||
import com.fr.design.extra.exe.GetInstalledPluginsExecutor; |
||||
import com.fr.design.extra.exe.GetPluginCategoriesExecutor; |
||||
import com.fr.design.extra.exe.GetPluginFromStoreExecutor; |
||||
import com.fr.design.extra.exe.PluginLoginExecutor; |
||||
import com.fr.design.extra.exe.ReadUpdateOnlineExecutor; |
||||
import com.fr.design.extra.exe.SearchOnlineExecutor; |
||||
import com.fr.design.i18n.Toolkit; |
||||
import com.fr.design.upm.event.CertificateEvent; |
||||
import com.fr.design.upm.event.DownloadEvent; |
||||
import com.fr.design.upm.exec.UpmBrowserExecutor; |
||||
import com.fr.design.upm.task.UpmTaskWorker; |
||||
import com.fr.event.EventDispatcher; |
||||
import com.fr.general.CloudCenter; |
||||
import com.fr.general.GeneralUtils; |
||||
import com.fr.json.JSONObject; |
||||
import com.fr.log.FineLoggerFactory; |
||||
import com.fr.plugin.context.PluginMarker; |
||||
import com.fr.stable.ArrayUtils; |
||||
import com.fr.stable.StringUtils; |
||||
import com.teamdev.jxbrowser.chromium.Browser; |
||||
import com.teamdev.jxbrowser.chromium.JSArray; |
||||
import com.teamdev.jxbrowser.chromium.JSFunction; |
||||
import com.teamdev.jxbrowser.chromium.JSObject; |
||||
|
||||
import javax.swing.*; |
||||
import javax.swing.filechooser.FileNameExtensionFilter; |
||||
import java.awt.*; |
||||
import java.io.File; |
||||
import java.net.URI; |
||||
import java.util.ArrayList; |
||||
import java.util.List; |
||||
import java.util.concurrent.Callable; |
||||
import java.util.concurrent.FutureTask; |
||||
import java.util.concurrent.RunnableFuture; |
||||
|
||||
/** |
||||
* @author richie |
||||
* @version 10.0 |
||||
* Created by richie on 2019-04-12 |
||||
* 桥接Java和JavaScript的类 |
||||
*/ |
||||
public class UpmBridge { |
||||
|
||||
public static UpmBridge getBridge(Browser browser) { |
||||
return new UpmBridge(browser); |
||||
} |
||||
|
||||
private JSObject window; |
||||
|
||||
private UpmBridge(Browser browser) { |
||||
this.window = browser.executeJavaScriptAndReturnValue("window").asObject(); |
||||
} |
||||
|
||||
public void startDownload(final JSFunction callback) { |
||||
|
||||
new SwingWorker<Void, Void>(){ |
||||
@Override |
||||
protected Void doInBackground() throws Exception { |
||||
callback.invoke(window, Toolkit.i18nText("Fine-Design_Basic_Update_Plugin_Manager_Download_Start")); |
||||
UpmResourceLoader.INSTANCE.download(); |
||||
UpmResourceLoader.INSTANCE.install(); |
||||
return null; |
||||
} |
||||
|
||||
@Override |
||||
protected void done() { |
||||
try { |
||||
get(); |
||||
callback.invoke(window, Toolkit.i18nText("Fine-Design_Basic_Update_Plugin_Manager_Download_Success")); |
||||
EventDispatcher.fire(DownloadEvent.SUCCESS, "success"); |
||||
} catch (Exception e) { |
||||
callback.invoke(window, Toolkit.i18nText("Fine-Design_Basic_Update_Plugin_Manager_Download_Error")); |
||||
FineLoggerFactory.getLogger().error(e.getMessage(), e); |
||||
EventDispatcher.fire(DownloadEvent.ERROR, "error"); |
||||
} |
||||
} |
||||
}.execute(); |
||||
} |
||||
|
||||
@JSBridge |
||||
public String i18nText(String key) { |
||||
return Toolkit.i18nText(key); |
||||
} |
||||
|
||||
@JSBridge |
||||
public void closeWindow() { |
||||
UpmFinder.closeWindow(); |
||||
} |
||||
|
||||
|
||||
@JSBridge |
||||
public boolean isDesigner() { |
||||
return true; |
||||
} |
||||
|
||||
@JSBridge |
||||
public void getPackInfo(final JSFunction callback) { |
||||
callback.invoke(window, StringUtils.EMPTY); |
||||
} |
||||
|
||||
/** |
||||
* 在线获取插件分类 |
||||
* |
||||
* @param callback 回调函数 |
||||
*/ |
||||
@JSBridge |
||||
public void getPluginCategories(final JSFunction callback) { |
||||
UpmTaskWorker<Void> task = new UpmTaskWorker<>(new JSCallback(UpmBrowserExecutor.create(window, callback)), new GetPluginCategoriesExecutor()); |
||||
task.execute(); |
||||
} |
||||
|
||||
/** |
||||
* 根据条件获取在线插件 |
||||
* |
||||
* @param info 插件信息 |
||||
* @param callback 回调函数 |
||||
*/ |
||||
@JSBridge |
||||
public void getPluginFromStoreNew(String info, final JSFunction callback) { |
||||
UpmTaskWorker<Void> task = new UpmTaskWorker<>(new JSCallback(UpmBrowserExecutor.create(window, callback)), new GetPluginFromStoreExecutor(new JSONObject(info))); |
||||
task.execute(); |
||||
} |
||||
|
||||
/** |
||||
* 已安装插件检查更新 |
||||
*/ |
||||
@JSBridge |
||||
public void readUpdateOnline(final JSFunction callback) { |
||||
UpmTaskWorker<Void> task = new UpmTaskWorker<>(new JSCallback(UpmBrowserExecutor.create(window, callback)), new ReadUpdateOnlineExecutor()); |
||||
task.execute(); |
||||
} |
||||
|
||||
/** |
||||
* 获取已经安装的插件的数组 |
||||
*/ |
||||
@JSBridge |
||||
public void getInstalledPlugins(final JSFunction callback) { |
||||
UpmTaskWorker<Void> task = new UpmTaskWorker<>(new JSCallback(UpmBrowserExecutor.create(window, callback)), new GetInstalledPluginsExecutor()); |
||||
task.execute(); |
||||
} |
||||
|
||||
/** |
||||
* 从插件服务器上更新选中的插件 |
||||
* |
||||
* @param pluginIDs 插件集合 |
||||
*/ |
||||
@JSBridge |
||||
public void updatePluginOnline(Object pluginIDs, final JSFunction callback) { |
||||
JSCallback jsCallback = new JSCallback(UpmBrowserExecutor.create(window, callback)); |
||||
List<PluginMarker> pluginMarkerList = new ArrayList<>(); |
||||
if (pluginIDs instanceof String) { |
||||
pluginMarkerList.add(PluginUtils.createPluginMarker(pluginIDs.toString())); |
||||
} else if (pluginIDs instanceof JSArray) { |
||||
JSArray pluginInfos = (JSArray) pluginIDs; |
||||
for (int i = 0, len = pluginInfos.length(); i < len; i++) { |
||||
String value = pluginInfos.get(i).asString().getValue(); |
||||
pluginMarkerList.add(PluginUtils.createPluginMarker(value)); |
||||
} |
||||
} |
||||
PluginOperateUtils.updatePluginOnline(pluginMarkerList, jsCallback); |
||||
} |
||||
|
||||
/** |
||||
* 搜索在线插件 |
||||
* |
||||
* @param keyword 关键字 |
||||
*/ |
||||
@JSBridge |
||||
public void searchPlugin(String keyword, final JSFunction callback) { |
||||
UpmTaskWorker<Void> worker = new UpmTaskWorker<>(new JSCallback(UpmBrowserExecutor.create(window, callback)), new SearchOnlineExecutor(keyword)); |
||||
worker.execute(); |
||||
} |
||||
|
||||
/** |
||||
* 从磁盘上选择插件安装包进行安装 |
||||
* |
||||
* @param filePath 插件包的路径 |
||||
*/ |
||||
@JSBridge |
||||
public void installPluginFromDisk(final String filePath, final JSFunction callback) { |
||||
JSCallback jsCallback = new JSCallback(UpmBrowserExecutor.create(window, callback)); |
||||
File file = new File(filePath); |
||||
PluginOperateUtils.installPluginFromDisk(file, jsCallback); |
||||
} |
||||
|
||||
/** |
||||
* 卸载当前选中的插件 |
||||
* |
||||
* @param pluginInfo 插件信息 |
||||
*/ |
||||
@JSBridge |
||||
public void uninstallPlugin(final String pluginInfo, final boolean isForce, final JSFunction callback) { |
||||
JSCallback jsCallback = new JSCallback(UpmBrowserExecutor.create(window, callback)); |
||||
PluginOperateUtils.uninstallPlugin(pluginInfo, isForce, jsCallback); |
||||
} |
||||
|
||||
/** |
||||
* 从插件服务器上安装插件 |
||||
* |
||||
* @param pluginInfo 插件的ID |
||||
* @param callback 回调函数 |
||||
*/ |
||||
@JSBridge |
||||
public void installPluginOnline(final String pluginInfo, final JSFunction callback) { |
||||
JSCallback jsCallback = new JSCallback(UpmBrowserExecutor.create(window, callback)); |
||||
PluginMarker pluginMarker = PluginUtils.createPluginMarker(pluginInfo); |
||||
PluginOperateUtils.installPluginOnline(pluginMarker, jsCallback); |
||||
} |
||||
|
||||
/** |
||||
* 从磁盘上选择插件安装包进行插件升级 |
||||
* |
||||
* @param filePath 插件包的路径 |
||||
*/ |
||||
public void updatePluginFromDisk(String filePath, final JSFunction callback) { |
||||
JSCallback jsCallback = new JSCallback(UpmBrowserExecutor.create(window, callback)); |
||||
File file = new File(filePath); |
||||
PluginOperateUtils.updatePluginFromDisk(file, jsCallback); |
||||
} |
||||
|
||||
/** |
||||
* 修改选中的插件的活跃状态 |
||||
* |
||||
* @param pluginID 插件ID |
||||
*/ |
||||
@JSBridge |
||||
public void setPluginActive(String pluginID, final JSFunction callback) { |
||||
JSCallback jsCallback = new JSCallback(UpmBrowserExecutor.create(window, callback)); |
||||
PluginOperateUtils.setPluginActive(pluginID, jsCallback); |
||||
} |
||||
|
||||
/** |
||||
* 选择文件对话框 |
||||
* |
||||
* @return 选择的文件的路径 |
||||
*/ |
||||
@JSBridge |
||||
public String showFileChooser() { |
||||
return showFileChooserWithFilter(StringUtils.EMPTY, StringUtils.EMPTY); |
||||
} |
||||
|
||||
/** |
||||
* 选择文件对话框 |
||||
* |
||||
* @param des 过滤文件描述 |
||||
* @param filter 文件的后缀 |
||||
* @return 选择的文件的路径 |
||||
* 这里换用JFileChooser会卡死,不知道为什么 |
||||
*/ |
||||
@JSBridge |
||||
public String showFileChooserWithFilter(final String des, final String filter) { |
||||
RunnableFuture<String> future = new FutureTask<>(new Callable<String>() { |
||||
@Override |
||||
public String call() { |
||||
JFileChooser fileChooser = new JFileChooser(); |
||||
fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY); |
||||
|
||||
if (StringUtils.isNotEmpty(filter)) { |
||||
fileChooser.setFileFilter(new FileNameExtensionFilter(des, UpmUtils.findMatchedExtension(filter))); |
||||
} |
||||
|
||||
int result = fileChooser.showOpenDialog(UpmFinder.getDialog()); |
||||
if (result == JFileChooser.APPROVE_OPTION) { |
||||
return fileChooser.getSelectedFile().getAbsolutePath(); |
||||
} |
||||
return null; |
||||
} |
||||
}); |
||||
SwingUtilities.invokeLater(future); |
||||
try { |
||||
return future.get(); |
||||
} catch (Exception e) { |
||||
FineLoggerFactory.getLogger().error(e.getMessage(), e); |
||||
} |
||||
return null; |
||||
} |
||||
|
||||
/** |
||||
* 选择文件对话框 |
||||
* |
||||
* @param des 过滤文件描述 |
||||
* @param args 文件的后缀 |
||||
* @return 选择的文件的路径 |
||||
*/ |
||||
@JSBridge |
||||
public String showFileChooserWithFilters(final String des, final Object args) { |
||||
RunnableFuture<String> future = new FutureTask<>(new Callable<String>() { |
||||
@Override |
||||
public String call() { |
||||
JFileChooser fileChooser = new JFileChooser(); |
||||
List<String> filterList = new ArrayList<>(); |
||||
if (args instanceof String) { |
||||
filterList.add(GeneralUtils.objectToString(args)); |
||||
} else if (args instanceof JSArray) { |
||||
JSArray array = (JSArray)args; |
||||
for (int i = 0, len = array.length(); i < len; i ++) { |
||||
filterList.add(array.get(i).getStringValue()); |
||||
} |
||||
} |
||||
String[] filters = filterList.toArray(new String[0]); |
||||
if (ArrayUtils.isNotEmpty(filters)) { |
||||
FileNameExtensionFilter filter = new FileNameExtensionFilter(des, UpmUtils.findMatchedExtension(filters)); |
||||
fileChooser.setFileFilter(filter); |
||||
} |
||||
int result = fileChooser.showOpenDialog(UpmFinder.getDialog()); |
||||
if (result == JFileChooser.APPROVE_OPTION) { |
||||
return fileChooser.getSelectedFile().getAbsolutePath(); |
||||
} |
||||
return null; |
||||
} |
||||
}); |
||||
SwingUtilities.invokeLater(future); |
||||
try { |
||||
return future.get(); |
||||
} catch (Exception e) { |
||||
FineLoggerFactory.getLogger().error(e.getMessage(), e); |
||||
} |
||||
return null; |
||||
} |
||||
|
||||
////////登录相关///////
|
||||
|
||||
/** |
||||
* 获取系统登录的用户名 |
||||
*/ |
||||
@JSBridge |
||||
public String getLoginInfo(final JSFunction callback) { |
||||
registerLoginInfo(callback); |
||||
return MarketConfig.getInstance().getBbsUsername(); |
||||
} |
||||
|
||||
/** |
||||
* 系统登录注册 |
||||
* |
||||
* @param callback 回调函数 |
||||
*/ |
||||
@JSBridge |
||||
public void registerLoginInfo(final JSFunction callback) { |
||||
JSCallback jsCallback = new JSCallback(UpmBrowserExecutor.create(window, callback)); |
||||
String username = MarketConfig.getInstance().getBbsUsername(); |
||||
if (StringUtils.isEmpty(username)) { |
||||
jsCallback.execute(StringUtils.EMPTY); |
||||
EventDispatcher.fire(CertificateEvent.LOGOUT, StringUtils.EMPTY); |
||||
} else { |
||||
jsCallback.execute(username); |
||||
EventDispatcher.fire(CertificateEvent.LOGIN, username); |
||||
} |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 设计器端的用户登录 |
||||
* |
||||
* @param username 用户名 |
||||
* @param password 密码 |
||||
* @param callback 回调函数 |
||||
*/ |
||||
@JSBridge |
||||
public void defaultLogin(String username, String password, final JSFunction callback) { |
||||
UpmTaskWorker<Void> worker = new UpmTaskWorker<>(new JSCallback(UpmBrowserExecutor.create(window, callback)), new PluginLoginExecutor(username, password)); |
||||
worker.execute(); |
||||
} |
||||
|
||||
/** |
||||
* 清除用户信息 |
||||
*/ |
||||
public void clearUserInfo() { |
||||
MarketConfig.getInstance().setInShowBBsName(StringUtils.EMPTY); |
||||
FinePassportManager.getInstance().logout(); |
||||
EventDispatcher.fire(CertificateEvent.LOGOUT, StringUtils.EMPTY); |
||||
} |
||||
|
||||
/** |
||||
* 打开论坛消息界面 |
||||
*/ |
||||
@JSBridge |
||||
public void getPriviteMessage() { |
||||
try { |
||||
String loginUrl = CloudCenter.getInstance().acquireUrlByKind("bbs.default"); |
||||
Desktop.getDesktop().browse(new URI(loginUrl)); |
||||
} catch (Exception exp) { |
||||
FineLoggerFactory.getLogger().info(exp.getMessage()); |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* 忘记密码 |
||||
*/ |
||||
@JSBridge |
||||
public void forgetHref() { |
||||
try { |
||||
Desktop.getDesktop().browse(new URI(CloudCenter.getInstance().acquireUrlByKind("bbs.reset"))); |
||||
} catch (Exception e) { |
||||
FineLoggerFactory.getLogger().info(e.getMessage()); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,68 @@
|
||||
package com.fr.design.upm; |
||||
|
||||
import com.fr.base.FRContext; |
||||
import com.fr.design.dialog.UIDialog; |
||||
import com.fr.design.mainframe.DesignerContext; |
||||
import com.fr.event.Event; |
||||
import com.fr.event.EventDispatcher; |
||||
import com.fr.event.Listener; |
||||
import com.fr.stable.StableUtils; |
||||
import com.fr.workspace.Workspace; |
||||
import com.fr.workspace.WorkspaceEvent; |
||||
|
||||
import javax.swing.*; |
||||
import java.io.File; |
||||
|
||||
/** |
||||
* @author richie |
||||
* @version 10.0 |
||||
* Created by richie on 2019-04-12 |
||||
*/ |
||||
public class UpmFinder { |
||||
|
||||
private static final String UPM_DIR = "/upm"; |
||||
private static final String MAIN_RESOURCE_PATH = UPM_DIR + "/plugin_design.html"; |
||||
|
||||
public static String installHome = FRContext.getCommonOperator().getWebRootPath(); |
||||
|
||||
private static UIDialog dialog = null; |
||||
|
||||
static { |
||||
EventDispatcher.listen(WorkspaceEvent.AfterSwitch, new Listener<Workspace>() { |
||||
@Override |
||||
public void on(Event event, Workspace param) { |
||||
installHome = FRContext.getCommonOperator().getWebRootPath(); |
||||
} |
||||
}); |
||||
} |
||||
|
||||
public static boolean checkUPMResourcesExist() { |
||||
String mainJsPath = StableUtils.pathJoin(installHome, MAIN_RESOURCE_PATH); |
||||
File file = new File(mainJsPath); |
||||
return file.exists(); |
||||
} |
||||
|
||||
public static String getMainResourcePath() { |
||||
return "file:///" + StableUtils.pathJoin(installHome, MAIN_RESOURCE_PATH); |
||||
} |
||||
|
||||
public static UIDialog getDialog() { |
||||
return dialog; |
||||
} |
||||
|
||||
public static void showUPMDialog() { |
||||
UpmShowPane upmPane = new UpmShowPane(); |
||||
if (dialog == null) { |
||||
dialog = new UpmShowDialog(DesignerContext.getDesignerFrame(), upmPane); |
||||
} |
||||
dialog.setVisible(true); |
||||
} |
||||
|
||||
public static void closeWindow() { |
||||
if (dialog != null) { |
||||
dialog.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); |
||||
dialog.setVisible(false); |
||||
dialog = null; |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,34 @@
|
||||
package com.fr.design.upm; |
||||
|
||||
import com.fr.design.dialog.BasicPane; |
||||
import com.fr.design.dialog.UIDialog; |
||||
import com.fr.design.utils.gui.GUICoreUtils; |
||||
import com.fr.stable.StableUtils; |
||||
|
||||
import javax.swing.*; |
||||
import java.awt.*; |
||||
|
||||
/** |
||||
* @author richie |
||||
* @version 10.0 |
||||
* Created by richie on 2019-04-12 |
||||
*/ |
||||
public class UpmShowDialog extends UIDialog { |
||||
|
||||
private static final Dimension DEFAULT_SHOP = new Dimension(900, 700); |
||||
|
||||
public UpmShowDialog(Frame frame, BasicPane pane) { |
||||
super(frame); |
||||
setUndecorated(true); |
||||
JPanel panel = (JPanel) getContentPane(); |
||||
panel.setLayout(new BorderLayout()); |
||||
add(pane, BorderLayout.CENTER); |
||||
setSize(DEFAULT_SHOP); |
||||
GUICoreUtils.centerWindow(this); |
||||
setResizable(false); |
||||
} |
||||
|
||||
@Override |
||||
public void checkValid() throws Exception { |
||||
} |
||||
} |
@ -0,0 +1,63 @@
|
||||
package com.fr.design.upm; |
||||
|
||||
import com.fr.design.dialog.BasicPane; |
||||
import com.fr.design.ui.ModernUIPane; |
||||
import com.fr.design.upm.event.DownloadEvent; |
||||
import com.fr.event.Event; |
||||
import com.fr.event.EventDispatcher; |
||||
import com.fr.event.Listener; |
||||
import com.teamdev.jxbrowser.chromium.JSValue; |
||||
import com.teamdev.jxbrowser.chromium.events.ScriptContextAdapter; |
||||
import com.teamdev.jxbrowser.chromium.events.ScriptContextEvent; |
||||
|
||||
import java.awt.*; |
||||
|
||||
/** |
||||
* @author richie |
||||
* @version 10.0 |
||||
* Created by richie on 2019-04-12 |
||||
* Update Plugin Manager容器 |
||||
*/ |
||||
public class UpmShowPane extends BasicPane { |
||||
|
||||
private ModernUIPane<Object> modernUIPane; |
||||
|
||||
@Override |
||||
protected String title4PopupWindow() { |
||||
return "UPM"; |
||||
} |
||||
|
||||
public UpmShowPane() { |
||||
setLayout(new BorderLayout()); |
||||
if (UpmFinder.checkUPMResourcesExist()) { |
||||
modernUIPane = new ModernUIPane.Builder<>() |
||||
.prepare(new ScriptContextAdapter() { |
||||
@Override |
||||
public void onScriptContextCreated(ScriptContextEvent event) { |
||||
JSValue window = event.getBrowser().executeJavaScriptAndReturnValue("window"); |
||||
window.asObject().setProperty("PluginHelper", UpmBridge.getBridge(event.getBrowser())); |
||||
} |
||||
}) |
||||
.withURL(UpmFinder.getMainResourcePath()) |
||||
.build(); |
||||
} else { |
||||
modernUIPane = new ModernUIPane.Builder<>() |
||||
.withComponent(WarnComponent.KEY) |
||||
.prepare(new ScriptContextAdapter() { |
||||
@Override |
||||
public void onScriptContextCreated(ScriptContextEvent event) { |
||||
JSValue window = event.getBrowser().executeJavaScriptAndReturnValue("window"); |
||||
window.asObject().setProperty("PluginHelper", UpmBridge.getBridge(event.getBrowser())); |
||||
} |
||||
}).build(); |
||||
EventDispatcher.listen(DownloadEvent.SUCCESS, new Listener<String>() { |
||||
@Override |
||||
public void on(Event event, String param) { |
||||
modernUIPane.redirect(UpmFinder.getMainResourcePath()); |
||||
} |
||||
}); |
||||
} |
||||
add(modernUIPane, BorderLayout.CENTER); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,21 @@
|
||||
package com.fr.design.upm; |
||||
|
||||
import java.util.ArrayList; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @author richie |
||||
* @version 10.0 |
||||
* Created by richie on 2019-04-18 |
||||
*/ |
||||
public class UpmUtils { |
||||
|
||||
public static String[] findMatchedExtension(String... extensions) { |
||||
List<String> list = new ArrayList<>(); |
||||
for (String ext : extensions) { |
||||
String[] arr = ext.split("\\."); |
||||
list.add(arr[arr.length - 1]); |
||||
} |
||||
return list.toArray(new String[0]); |
||||
} |
||||
} |
@ -0,0 +1,33 @@
|
||||
package com.fr.design.upm; |
||||
|
||||
import com.fr.web.struct.AssembleComponent; |
||||
import com.fr.web.struct.Atom; |
||||
import com.fr.web.struct.browser.RequestClient; |
||||
import com.fr.web.struct.category.ScriptPath; |
||||
import com.fr.web.struct.impl.FineUI; |
||||
|
||||
/** |
||||
* @author richie |
||||
* @version 10.0 |
||||
* Created by richie on 2019-04-12 |
||||
*/ |
||||
public class WarnComponent extends AssembleComponent { |
||||
|
||||
public static final WarnComponent KEY = new WarnComponent(); |
||||
|
||||
private WarnComponent() { |
||||
|
||||
} |
||||
|
||||
@Override |
||||
public ScriptPath script(RequestClient req) { |
||||
return ScriptPath.build("com/fr/design/upm/warn.js"); |
||||
} |
||||
|
||||
@Override |
||||
public Atom[] refer() { |
||||
return new Atom[]{ |
||||
FineUI.KEY |
||||
}; |
||||
} |
||||
} |
@ -0,0 +1,12 @@
|
||||
package com.fr.design.upm.event; |
||||
|
||||
import com.fr.event.Event; |
||||
|
||||
/** |
||||
* @author richie |
||||
* @version 10.0 |
||||
* Created by richie on 2019-04-18 |
||||
*/ |
||||
public enum CertificateEvent implements Event<String> { |
||||
LOGIN,LOGOUT |
||||
} |
@ -0,0 +1,13 @@
|
||||
package com.fr.design.upm.event; |
||||
|
||||
import com.fr.event.Event; |
||||
|
||||
/** |
||||
* @author richie |
||||
* @version 10.0 |
||||
* Created by richie on 2019-04-12 |
||||
*/ |
||||
public enum DownloadEvent implements Event<String> { |
||||
|
||||
SUCCESS, ERROR |
||||
} |
@ -0,0 +1,30 @@
|
||||
package com.fr.design.upm.exec; |
||||
|
||||
import com.fr.design.bridge.exec.JSExecutor; |
||||
import com.teamdev.jxbrowser.chromium.JSFunction; |
||||
import com.teamdev.jxbrowser.chromium.JSObject; |
||||
|
||||
/** |
||||
* @author richie |
||||
* @version 10.0 |
||||
* Created by richie on 2019-04-18 |
||||
*/ |
||||
public class UpmBrowserExecutor implements JSExecutor { |
||||
|
||||
public static UpmBrowserExecutor create(JSObject window, JSFunction callback) { |
||||
return new UpmBrowserExecutor(window, callback); |
||||
} |
||||
|
||||
private JSObject window; |
||||
private JSFunction callback; |
||||
|
||||
private UpmBrowserExecutor(JSObject window, JSFunction callback) { |
||||
this.window = window; |
||||
this.callback = callback; |
||||
} |
||||
|
||||
@Override |
||||
public void executor(String newValue) { |
||||
callback.invoke(window, newValue); |
||||
} |
||||
} |
@ -0,0 +1,27 @@
|
||||
package com.fr.design.upm.loader; |
||||
|
||||
import com.fr.decision.webservice.bean.plugin.store.ProjectInfoBean; |
||||
import com.fr.decision.webservice.v10.plugin.helper.category.impl.BaseResourceLoader; |
||||
|
||||
/** |
||||
* @author richie |
||||
* @version 10.0 |
||||
* Created by richie on 2019-04-18 |
||||
*/ |
||||
public class UpmDesignResourceLoader extends BaseResourceLoader { |
||||
|
||||
@Override |
||||
public String getPluginPath() { |
||||
return "upm/plugin_design.html"; |
||||
} |
||||
|
||||
@Override |
||||
public void checkResourceExist(ProjectInfoBean projectInfoBean) throws Exception { |
||||
|
||||
} |
||||
|
||||
@Override |
||||
public String getDownloadPath() throws Exception { |
||||
return "http://fanruan-market.oss-cn-shanghai.aliyuncs.com/upm/1.0/upm-10.0.zip"; |
||||
} |
||||
} |
@ -0,0 +1,52 @@
|
||||
package com.fr.design.upm.task; |
||||
|
||||
import com.fr.design.bridge.exec.JSCallback; |
||||
import com.fr.design.bridge.exec.JSUtils; |
||||
import com.fr.design.extra.Process; |
||||
import com.fr.design.extra.exe.Command; |
||||
import com.fr.design.extra.exe.Executor; |
||||
import com.fr.stable.StringUtils; |
||||
|
||||
import javax.swing.*; |
||||
|
||||
/** |
||||
* @author richie |
||||
* @version 10.0 |
||||
* Created by richie on 2019-04-17 |
||||
*/ |
||||
public class UpmTaskWorker<V> extends SwingWorker<V, String> { |
||||
|
||||
private Executor executor; |
||||
private JSCallback callback; |
||||
|
||||
public UpmTaskWorker(final JSCallback callback, final Executor executor) { |
||||
this.executor = executor; |
||||
this.callback = callback; |
||||
} |
||||
|
||||
@Override |
||||
protected V doInBackground() throws Exception { |
||||
Command[] commands = executor.getCommands(); |
||||
for (Command command : commands) { |
||||
String message = command.getExecuteMessage(); |
||||
if (StringUtils.isNotBlank(message)) { |
||||
publish(message); |
||||
} |
||||
command.run(new Process<String>() { |
||||
@Override |
||||
public void process(String s) { |
||||
if (StringUtils.isNotBlank(s)) { |
||||
publish(JSUtils.trimText(s)); |
||||
} |
||||
} |
||||
}); |
||||
} |
||||
return null; |
||||
} |
||||
|
||||
@Override |
||||
protected void done() { |
||||
String result = executor.getTaskFinishMessage(); |
||||
callback.execute(result); |
||||
} |
||||
} |
@ -0,0 +1,26 @@
|
||||
package com.fr.design.utils; |
||||
|
||||
/** |
||||
* 为的就是能替换 DesignPort.class 实现多开,因此避免编译器常量编译展开优化 |
||||
*/ |
||||
public class DesignerPort { |
||||
private DesignerPort() { |
||||
} |
||||
|
||||
/** |
||||
* 设计器端口,避免编译期常量优化展开 |
||||
*/ |
||||
public static final int MESSAGE_PORT = getMessagePort(); |
||||
/** |
||||
* 设计器端口,避免编译期常量优化展开 |
||||
*/ |
||||
public static final int DEBUG_MESSAGE_PORT = getDebugMessagePort(); |
||||
|
||||
private static int getMessagePort() { |
||||
return 51462; |
||||
} |
||||
|
||||
private static int getDebugMessagePort() { |
||||
return 51463; |
||||
} |
||||
} |
@ -0,0 +1,93 @@
|
||||
package com.fr.file; |
||||
|
||||
import javax.swing.Icon; |
||||
import java.io.InputStream; |
||||
import java.io.OutputStream; |
||||
|
||||
public abstract class AbstractFILE implements FILE { |
||||
|
||||
@Override |
||||
public String prefix() { |
||||
throw new UnsupportedOperationException(); |
||||
} |
||||
|
||||
@Override |
||||
public boolean isDirectory() { |
||||
throw new UnsupportedOperationException(); |
||||
} |
||||
|
||||
@Override |
||||
public String getName() { |
||||
throw new UnsupportedOperationException(); |
||||
} |
||||
|
||||
@Override |
||||
public Icon getIcon() { |
||||
throw new UnsupportedOperationException(); |
||||
} |
||||
|
||||
@Override |
||||
public String getPath() { |
||||
throw new UnsupportedOperationException(); |
||||
} |
||||
|
||||
@Override |
||||
public void setPath(String path) { |
||||
throw new UnsupportedOperationException(); |
||||
} |
||||
|
||||
@Override |
||||
public FILE getParent() { |
||||
throw new UnsupportedOperationException(); |
||||
} |
||||
|
||||
@Override |
||||
public FILE[] listFiles() { |
||||
throw new UnsupportedOperationException(); |
||||
} |
||||
|
||||
@Override |
||||
public boolean createFolder(String name) { |
||||
throw new UnsupportedOperationException(); |
||||
} |
||||
|
||||
@Override |
||||
public boolean mkfile() throws Exception { |
||||
throw new UnsupportedOperationException(); |
||||
} |
||||
|
||||
@Override |
||||
public boolean exists() { |
||||
throw new UnsupportedOperationException(); |
||||
} |
||||
|
||||
@Override |
||||
public void closeTemplate() throws Exception { |
||||
throw new UnsupportedOperationException(); |
||||
} |
||||
|
||||
@Override |
||||
public InputStream asInputStream() throws Exception { |
||||
throw new UnsupportedOperationException(); |
||||
} |
||||
|
||||
@Override |
||||
public OutputStream asOutputStream() throws Exception { |
||||
throw new UnsupportedOperationException(); |
||||
} |
||||
|
||||
@Override |
||||
public String getEnvFullName() { |
||||
throw new UnsupportedOperationException(); |
||||
} |
||||
|
||||
@Override |
||||
public boolean isMemFile() { |
||||
throw new UnsupportedOperationException(); |
||||
} |
||||
|
||||
@Override |
||||
public boolean isEnvFile() { |
||||
throw new UnsupportedOperationException(); |
||||
} |
||||
} |
@ -0,0 +1,102 @@
|
||||
package com.fr.file; |
||||
|
||||
import com.fr.stable.StableUtils; |
||||
import com.fr.stable.StringUtils; |
||||
import com.fr.third.org.apache.commons.io.FileUtils; |
||||
import com.fr.web.session.SessionLocalManager; |
||||
|
||||
import javax.swing.Icon; |
||||
import java.io.File; |
||||
import java.io.FileOutputStream; |
||||
import java.io.IOException; |
||||
import java.io.OutputStream; |
||||
|
||||
public class RenameExportFILE extends AbstractFILE { |
||||
|
||||
private static final String EXPORT_SUFFIX = ".FRExportTmp"; |
||||
|
||||
private FILE file; |
||||
|
||||
private RenameExportFILE(FILE file) { |
||||
this.file = new FileFILE(new File(file.getPath() + EXPORT_SUFFIX)); |
||||
} |
||||
|
||||
public static RenameExportFILE create(FILE file) { |
||||
return new RenameExportFILE(file); |
||||
} |
||||
|
||||
public static String recoverFileName(String fileName) { |
||||
if (StringUtils.isEmpty(fileName) || !fileName.endsWith(EXPORT_SUFFIX)) { |
||||
return fileName; |
||||
} |
||||
return fileName.substring(0, fileName.lastIndexOf(EXPORT_SUFFIX)); |
||||
} |
||||
|
||||
@Override |
||||
public String prefix() { |
||||
return file.prefix(); |
||||
} |
||||
|
||||
@Override |
||||
public boolean isDirectory() { |
||||
return false; |
||||
} |
||||
|
||||
@Override |
||||
public String getName() { |
||||
return file.getName(); |
||||
} |
||||
|
||||
@Override |
||||
public Icon getIcon() { |
||||
return null; |
||||
} |
||||
|
||||
@Override |
||||
public String getPath() { |
||||
return file.getPath(); |
||||
} |
||||
|
||||
|
||||
@Override |
||||
public FILE getParent() { |
||||
return file.getParent(); |
||||
} |
||||
|
||||
|
||||
@Override |
||||
public boolean mkfile() throws Exception { |
||||
return file.mkfile(); |
||||
} |
||||
|
||||
@Override |
||||
public boolean exists() { |
||||
return file.exists(); |
||||
} |
||||
|
||||
@Override |
||||
public OutputStream asOutputStream() throws Exception { |
||||
|
||||
final File localeFile = new File(file.getPath()); |
||||
OutputStream out; |
||||
try { |
||||
StableUtils.makesureFileExist(localeFile); |
||||
out = new FileOutputStream(localeFile, false) { |
||||
@Override |
||||
public void close() throws IOException { |
||||
super.close(); |
||||
String path = file.getPath(); |
||||
if (localeFile.exists()) { |
||||
FileUtils.copyFile(localeFile, new File(recoverFileName(path))); |
||||
if (localeFile.getPath().endsWith(EXPORT_SUFFIX)) { |
||||
FileUtils.forceDelete(localeFile); |
||||
} |
||||
} |
||||
} |
||||
}; |
||||
} catch (Exception e) { |
||||
throw SessionLocalManager.createLogPackedException(e); |
||||
} |
||||
return out; |
||||
} |
||||
} |
@ -0,0 +1,14 @@
|
||||
package com.fr.start; |
||||
|
||||
import com.fr.design.fun.OemProcessor; |
||||
import com.fr.stable.bridge.StableFactory; |
||||
|
||||
/** |
||||
* OEM处理中心 |
||||
*/ |
||||
public class OemHandler { |
||||
|
||||
public static OemProcessor findOem() { |
||||
return StableFactory.getMarkedInstanceObjectFromClass(OemProcessor.MARK_STRING, OemProcessor.class); |
||||
} |
||||
} |
@ -0,0 +1,61 @@
|
||||
window.onload = function () { |
||||
let label = BI.createWidget({ |
||||
type: "bi.label", |
||||
text: PluginHelper.i18nText("Fine-Design_Basic_Update_Plugin_Manager_Resource_Warn"), |
||||
height: 30 |
||||
}); |
||||
let callback = function(text) { |
||||
download.setValue(text); |
||||
}; |
||||
let buttonOK = BI.createWidget({ |
||||
type: "bi.button", |
||||
text: PluginHelper.i18nText("Fine-Design_Basic_Update_Plugin_Manager_Download"), |
||||
level: 'common', |
||||
height: 30, |
||||
handler: function () { |
||||
PluginHelper.startDownload(callback); |
||||
} |
||||
}); |
||||
let buttonClose = BI.createWidget({ |
||||
type: "bi.button", |
||||
text: PluginHelper.i18nText("Fine-Design_Basic_Update_Plugin_Manager_Close"), |
||||
level: 'warning', |
||||
height: 30, |
||||
handler: function () { |
||||
PluginHelper.closeWindow(); |
||||
} |
||||
}); |
||||
|
||||
let download = BI.createWidget({ |
||||
type: "bi.label", |
||||
height: 30 |
||||
}); |
||||
let left = 300; |
||||
let top = 200; |
||||
BI.createWidget({ |
||||
type: "bi.absolute", |
||||
element: "body", |
||||
items: [ |
||||
{ |
||||
el: label, |
||||
left: left, |
||||
top: top |
||||
}, |
||||
{ |
||||
el : buttonOK, |
||||
left : left, |
||||
top : top + 40 |
||||
}, |
||||
{ |
||||
el : buttonClose, |
||||
left : left + 100, |
||||
top : top + 40 |
||||
}, |
||||
{ |
||||
el : download, |
||||
left : left, |
||||
top : top + 80 |
||||
} |
||||
] |
||||
}); |
||||
}; |
@ -0,0 +1,40 @@
|
||||
package com.fr.design.ui.report; |
||||
|
||||
import com.fr.web.struct.AssembleComponent; |
||||
import com.fr.web.struct.Atom; |
||||
import com.fr.web.struct.browser.RequestClient; |
||||
import com.fr.web.struct.category.ParserType; |
||||
import com.fr.web.struct.category.ScriptPath; |
||||
import com.fr.web.struct.category.StylePath; |
||||
import com.fr.web.struct.impl.FineUI; |
||||
|
||||
/** |
||||
* Created by windy on 2019/3/25. |
||||
* 报表服务器参数demo使用 |
||||
*/ |
||||
public class ReportServerParamComponent extends AssembleComponent { |
||||
|
||||
public static final ReportServerParamComponent KEY = new ReportServerParamComponent(); |
||||
|
||||
private ReportServerParamComponent() { |
||||
|
||||
} |
||||
|
||||
@Override |
||||
public Atom[] refer() { |
||||
return new Atom[] { |
||||
FineUI.KEY |
||||
}; |
||||
} |
||||
|
||||
@Override |
||||
public ScriptPath script(RequestClient req) { |
||||
return ScriptPath.build("/com/fr/design/ui/script/report.js"); |
||||
} |
||||
|
||||
@Override |
||||
public StylePath style() { |
||||
|
||||
return StylePath.build("/com/fr/design/ui/script/report.css", ParserType.DYNAMIC); |
||||
} |
||||
} |
@ -0,0 +1,29 @@
|
||||
package com.fr.design.ui.report; |
||||
|
||||
import com.fr.design.DesignerEnvManager; |
||||
import com.fr.design.ui.ModernUIPane; |
||||
import com.fr.design.ui.ModernUIPaneTest; |
||||
|
||||
import javax.swing.*; |
||||
import java.awt.*; |
||||
|
||||
/** |
||||
* Created by windy on 2019/3/25. |
||||
* 报表服务器参数demo |
||||
*/ |
||||
public class ReportServerParamDemo { |
||||
|
||||
public static void main(String... args) { |
||||
final JFrame frame = new JFrame(); |
||||
frame.setSize(660, 600); |
||||
JPanel contentPane = (JPanel) frame.getContentPane(); |
||||
// 是否需要开启调试窗口
|
||||
DesignerEnvManager.getEnvManager().setOpenDebug(true); |
||||
|
||||
final ModernUIPane<ModernUIPaneTest.Model> pane = new ModernUIPane.Builder<ModernUIPaneTest.Model>() |
||||
.withComponent(ReportServerParamComponent.KEY).build(); |
||||
contentPane.add(pane, BorderLayout.CENTER); |
||||
frame.setVisible(true); |
||||
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); |
||||
} |
||||
} |
@ -0,0 +1,40 @@
|
||||
package com.fr.design.ui.report; |
||||
|
||||
import com.fr.web.struct.AssembleComponent; |
||||
import com.fr.web.struct.Atom; |
||||
import com.fr.web.struct.browser.RequestClient; |
||||
import com.fr.web.struct.category.ParserType; |
||||
import com.fr.web.struct.category.ScriptPath; |
||||
import com.fr.web.struct.category.StylePath; |
||||
import com.fr.web.struct.impl.FineUI; |
||||
|
||||
/** |
||||
* Created by windy on 2019/3/26. |
||||
* 模板Web属性demo使用 |
||||
*/ |
||||
public class TemplateWebSettingComponent extends AssembleComponent { |
||||
|
||||
public static final TemplateWebSettingComponent KEY = new TemplateWebSettingComponent(); |
||||
|
||||
private TemplateWebSettingComponent() { |
||||
|
||||
} |
||||
|
||||
@Override |
||||
public Atom[] refer() { |
||||
return new Atom[] { |
||||
FineUI.KEY |
||||
}; |
||||
} |
||||
|
||||
@Override |
||||
public ScriptPath script(RequestClient req) { |
||||
return ScriptPath.build("/com/fr/design/ui/script/template.js"); |
||||
} |
||||
|
||||
@Override |
||||
public StylePath style() { |
||||
|
||||
return StylePath.build("/com/fr/design/ui/script/template.css", ParserType.DYNAMIC); |
||||
} |
||||
} |
@ -0,0 +1,28 @@
|
||||
package com.fr.design.ui.report; |
||||
|
||||
import com.fr.design.DesignerEnvManager; |
||||
import com.fr.design.ui.ModernUIPane; |
||||
import com.fr.design.ui.ModernUIPaneTest; |
||||
|
||||
import javax.swing.*; |
||||
import java.awt.*; |
||||
|
||||
/** |
||||
* Created by windy on 2019/3/26. |
||||
* 模板Web属性demo |
||||
*/ |
||||
public class TemplateWebSettingDemo { |
||||
public static void main(String... args) { |
||||
final JFrame frame = new JFrame(); |
||||
frame.setSize(660, 600); |
||||
JPanel contentPane = (JPanel) frame.getContentPane(); |
||||
// 是否需要开启调试窗口
|
||||
DesignerEnvManager.getEnvManager().setOpenDebug(true); |
||||
|
||||
final ModernUIPane<ModernUIPaneTest.Model> pane = new ModernUIPane.Builder<ModernUIPaneTest.Model>() |
||||
.withComponent(TemplateWebSettingComponent.KEY).build(); |
||||
contentPane.add(pane, BorderLayout.CENTER); |
||||
frame.setVisible(true); |
||||
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); |
||||
} |
||||
} |
@ -0,0 +1,12 @@
|
||||
.bi-setting-tab .tab-group { |
||||
background-color: #F2F4F7; |
||||
font-size: 12px; |
||||
} |
||||
.bi-setting-tab .tab-group .tab-item:hover { |
||||
color: #3685f2; |
||||
} |
||||
.bi-setting-tab .tab-group .tab-item.active { |
||||
background-color: #ffffff; |
||||
color: #3685f2; |
||||
border-top: 3px solid #3685f2; |
||||
} |
@ -0,0 +1,41 @@
|
||||
!(function(){ |
||||
/** |
||||
* 带确定取消的通用控件 |
||||
*/ |
||||
var Bar = BI.inherit(BI.Widget, { |
||||
props: { |
||||
baseCls: "bi-settings-bar-container", |
||||
el: { |
||||
|
||||
} |
||||
}, |
||||
|
||||
render: function() { |
||||
return { |
||||
type: "bi.vtape", |
||||
items: [this.options.el, { |
||||
type: "bi.right_vertical_adapt", |
||||
height: 24, |
||||
rgap: 10, |
||||
vgap: 10, |
||||
items: [{ |
||||
type: "bi.button", |
||||
level: "ignore", |
||||
text: BI.i18nText("Fine-Design_Report_OK"), |
||||
handler: function() { |
||||
|
||||
} |
||||
}, { |
||||
type: "bi.button", |
||||
level: "ignore", |
||||
text: BI.i18nText("Fine-Design_Basic_Engine_Cancel"), |
||||
handler: function() { |
||||
|
||||
} |
||||
}] |
||||
}] |
||||
} |
||||
} |
||||
}) |
||||
BI.shortcut("bi.settings.bar_container", Bar) |
||||
})(); |
@ -0,0 +1,89 @@
|
||||
!(function () { |
||||
/** |
||||
* 事件设置 |
||||
*/ |
||||
var List = BI.inherit(BI.Widget, { |
||||
props: { |
||||
baseCls: "bi-report-server-param-setting-edit-list" |
||||
}, |
||||
|
||||
render: function () { |
||||
var self = this; |
||||
return { |
||||
type: "bi.vtape", |
||||
vgap: 5, |
||||
items: [{ |
||||
type: "bi.vertical_adapt", |
||||
height: 24, |
||||
items: [{ |
||||
type: "bi.icon_button", |
||||
cls: "text-add-tip-font", |
||||
width: 24, |
||||
height: 24, |
||||
handler: function() { |
||||
self.group.addItems([self._createItem()]) |
||||
} |
||||
}, { |
||||
type: "bi.icon_button", |
||||
cls: "close-font", |
||||
width: 24, |
||||
height: 24, |
||||
handler: function() { |
||||
self.group.removeItemAt(); |
||||
} |
||||
}, { |
||||
type: "bi.icon_button", |
||||
cls: "close-font", |
||||
width: 24, |
||||
height: 24, |
||||
handler: function() { |
||||
self.removeItemAt(self._getIndexOfItemValue(self.group.getValue())) |
||||
} |
||||
}] |
||||
}, { |
||||
type: "bi.button_group", |
||||
cls: "bi-border bi-card", |
||||
ref: function(_ref) { |
||||
self.group = _ref; |
||||
}, |
||||
items: [] |
||||
}] |
||||
}; |
||||
}, |
||||
|
||||
_getIndexOfItemValue: function(values) { |
||||
values = BI.isArray(values) ? values : [values]; |
||||
var indexes = []; |
||||
BI.each(this.group.getAllButtons(), function(idx, button){ |
||||
if(BI.contains(values, button.getValue())) { |
||||
indexes.push(idx); |
||||
} |
||||
}); |
||||
return indexes; |
||||
}, |
||||
|
||||
_createItem: function() { |
||||
return { |
||||
type: "bi.text_button", |
||||
textAlign: "left", |
||||
hgap: 10, |
||||
text: "选项" + this.group.getAllButtons().length, |
||||
cls: "bi-list-item-select", |
||||
value: BI.UUID() |
||||
}; |
||||
}, |
||||
|
||||
populate: function(items) { |
||||
this.group.populate(items); |
||||
}, |
||||
|
||||
addItems: function(items) { |
||||
|
||||
}, |
||||
|
||||
removeItemAt: function(indexes) { |
||||
this.group.removeItemAt(indexes); |
||||
} |
||||
}); |
||||
BI.shortcut("bi.report.server.param_setting.edit_list", List); |
||||
})(); |
@ -0,0 +1,33 @@
|
||||
!(function () { |
||||
/** |
||||
* 填报当前编辑行背景设置相关 |
||||
*/ |
||||
var Analysis = BI.inherit(BI.Widget, { |
||||
props: { |
||||
baseCls: "bi-report-form-background-setting" |
||||
}, |
||||
|
||||
render: function () { |
||||
var self = this, o = this.options; |
||||
return { |
||||
type: "bi.vertical_adapt", |
||||
items: [{ |
||||
type: "bi.multi_select_item", |
||||
logic: { |
||||
dynamic: true |
||||
}, |
||||
iconWrapperWidth: 16, |
||||
text: BI.i18nText("Fine-Design_Report_Set_Face_Write_Current_Edit_Row_Background") |
||||
}, { |
||||
el: { |
||||
type: "bi.color_chooser", |
||||
width: 24, |
||||
height: 24 |
||||
}, |
||||
lgap: 10 |
||||
}] |
||||
}; |
||||
} |
||||
}); |
||||
BI.shortcut("bi.report.form_background_setting", Analysis); |
||||
})(); |
@ -0,0 +1,54 @@
|
||||
!(function () { |
||||
/** |
||||
*
|
||||
* 为模板单独设置的相关项 |
||||
*/ |
||||
var Analysis = BI.inherit(BI.Widget, { |
||||
props: { |
||||
baseCls: "bi-report-global-or-single-combo", |
||||
value: 1 |
||||
}, |
||||
|
||||
render: function () { |
||||
var self = this, o = this.options; |
||||
return { |
||||
type: "bi.vertical_adapt", |
||||
rgap: 10, |
||||
height: 24, |
||||
items: [{ |
||||
type: "bi.label", |
||||
text: BI.i18nText("Fine-Design_Report_Blow_Set") |
||||
}, { |
||||
type: "bi.text_value_combo", |
||||
width: 200, |
||||
ref: function(_ref) { |
||||
self.combo = _ref; |
||||
}, |
||||
value: o.value, |
||||
items: [{ |
||||
text: BI.i18nText("Fine-Design_Report_I_Want_To_Set_Single"), |
||||
value: 1 |
||||
}, { |
||||
text: BI.i18nText("Fine-Design_Form_Using_Server_Report_View_Settings"), |
||||
value: 2 |
||||
}], |
||||
listerners: [{ |
||||
eventName: "EVENT_CHANGE", |
||||
action: function() { |
||||
|
||||
} |
||||
}] |
||||
}] |
||||
}; |
||||
}, |
||||
|
||||
getValue: function() { |
||||
return self.combo.getValue(); |
||||
}, |
||||
|
||||
setValue: function(v) { |
||||
this.combo.setValue(v); |
||||
} |
||||
}); |
||||
BI.shortcut("bi.report.global_or_single_combo", Analysis); |
||||
})(); |
@ -0,0 +1,53 @@
|
||||
!(function () { |
||||
/** |
||||
* 离开提示/直接显示控件/自动暂存相关 |
||||
*/ |
||||
var Analysis = BI.inherit(BI.Widget, { |
||||
props: { |
||||
baseCls: "bi-report-leave-setting", |
||||
value: [1] |
||||
}, |
||||
|
||||
render: function () { |
||||
var self = this, o = this.options; |
||||
return { |
||||
type: "bi.button_group", |
||||
value: o.value, |
||||
items: BI.createItems([{ |
||||
text: BI.i18nText("Fine-Design_Report_Unload_Check"), |
||||
value: 1 |
||||
}, { |
||||
text: BI.i18nText("Fine-Design_Basic_Engine_Event_Show_Widgets"), |
||||
value: 2 |
||||
}, { |
||||
text: BI.i18nText("Fine-Design_Report_Write_Auto_Stash"), |
||||
value: 3 |
||||
}], { |
||||
type: "bi.multi_select_item", |
||||
hgap: 5, |
||||
logic: { |
||||
dynamic: true |
||||
}, |
||||
iconWrapperWidth: 16 |
||||
}), |
||||
chooseType: BI.Selection.Multi, |
||||
layouts: [{ |
||||
type: "bi.vertical_adapt", |
||||
rgap: 5 |
||||
}], |
||||
ref: function(_ref) { |
||||
self.group = _ref; |
||||
} |
||||
}; |
||||
}, |
||||
|
||||
getValue: function() { |
||||
return self.group.getValue(); |
||||
}, |
||||
|
||||
setValue: function(v) { |
||||
this.group.setValue(v); |
||||
} |
||||
}); |
||||
BI.shortcut("bi.report.leave_setting", Analysis); |
||||
})(); |
@ -0,0 +1,53 @@
|
||||
!(function () { |
||||
/** |
||||
* 报表显示位置相关 |
||||
*/ |
||||
var Analysis = BI.inherit(BI.Widget, { |
||||
props: { |
||||
baseCls: "bi-report-server-param-setting-report-show-location" |
||||
}, |
||||
|
||||
render: function () { |
||||
var self = this, o = this.options; |
||||
return { |
||||
type: "bi.vertical_adapt", |
||||
height: 24, |
||||
items: [{ |
||||
type: "bi.label", |
||||
text: BI.i18nText("Fine-Design_Report_Show_Location") |
||||
}, { |
||||
type: "bi.button_group", |
||||
ref: function(_ref) { |
||||
self.group = _ref; |
||||
}, |
||||
value: 2, |
||||
items: BI.createItems([{ |
||||
text: BI.i18nText("Fine-Design_Report_Center_Display"), |
||||
value: 1 |
||||
}, { |
||||
text: BI.i18nText("Fine-Design_Report_Left_Display"), |
||||
value: 2 |
||||
}], { |
||||
type: "bi.single_select_radio_item", |
||||
logic: { |
||||
dynamic: true |
||||
} |
||||
}), |
||||
layouts: [{ |
||||
type: "bi.left", |
||||
lgap: 10 |
||||
}] |
||||
}] |
||||
}; |
||||
}, |
||||
|
||||
getValue: function() { |
||||
return self.group.getValue(); |
||||
}, |
||||
|
||||
setValue: function(v) { |
||||
this.group.setValue(v); |
||||
} |
||||
}); |
||||
BI.shortcut("bi.report.server.param_setting.report_show_location", Analysis); |
||||
})(); |
@ -0,0 +1,59 @@
|
||||
!(function () { |
||||
|
||||
var Tab = BI.inherit(BI.Widget, { |
||||
|
||||
props: { |
||||
baseCls: "bi-setting-tab", |
||||
value: "", |
||||
tabItems: [], |
||||
cardCreator: BI.emptyFn |
||||
}, |
||||
|
||||
render: function () { |
||||
var self = this, o = this.options; |
||||
return { |
||||
type: "bi.vtape", |
||||
items: [{ |
||||
type: "bi.vertical_adapt", |
||||
cls: "tab-group", |
||||
items: [{ |
||||
type: "bi.button_group", |
||||
layouts: [{ |
||||
type: "bi.left" |
||||
}], |
||||
value: o.value, |
||||
items: BI.map(o.tabItems, function(idx, item){ |
||||
return { |
||||
el: BI.extend({ |
||||
type: "bi.text_button", |
||||
hgap: 10, |
||||
height: 24 |
||||
}, item) |
||||
}; |
||||
}), |
||||
listeners: [{ |
||||
eventName: BI.ButtonGroup.EVENT_CHANGE, |
||||
action: function (v) { |
||||
self.tableTab.setSelect(v); |
||||
} |
||||
}], |
||||
ref: function (_ref) { |
||||
// self.buttons = _ref;
|
||||
} |
||||
}], |
||||
height: 24 |
||||
}, { |
||||
type: "bi.tab", |
||||
cls: "bi-card", |
||||
showIndex: o.value, |
||||
cardCreator: this.options.cardCreator, |
||||
ref: function (ref) { |
||||
self.tableTab = ref; |
||||
} |
||||
}] |
||||
}; |
||||
} |
||||
}); |
||||
|
||||
BI.shortcut("bi.setting.tab", Tab); |
||||
})(); |
@ -0,0 +1,17 @@
|
||||
@import "../../index.less"; |
||||
.bi-setting-tab { |
||||
& .tab-group { |
||||
background-color: @color-bi-background-light-gray; |
||||
font-size: @font-size-12; |
||||
& .tab-item { |
||||
&:hover { |
||||
color: @color-bi-text-highlight; |
||||
} |
||||
&.active { |
||||
background-color: @color-bi-background-default; |
||||
color: @color-bi-text-highlight; |
||||
border-top: 3px solid @color-bi-text-highlight; |
||||
} |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,53 @@
|
||||
!(function () { |
||||
/** |
||||
* sheet标签页显示位置 |
||||
*/ |
||||
var Analysis = BI.inherit(BI.Widget, { |
||||
props: { |
||||
baseCls: "bi-report-server-param-setting-report-show-location" |
||||
}, |
||||
|
||||
render: function () { |
||||
var self = this, o = this.options; |
||||
return { |
||||
type: "bi.vertical_adapt", |
||||
height: 24, |
||||
items: [{ |
||||
type: "bi.label", |
||||
text: BI.i18nText("Fine-Design_Report_Sheet_Label_Page_Display_Position") |
||||
}, { |
||||
type: "bi.button_group", |
||||
ref: function(_ref) { |
||||
self.group = _ref; |
||||
}, |
||||
value: 2, |
||||
items: BI.createItems([{ |
||||
text: BI.i18nText("Fine-Design_Form_Base_Top"), |
||||
value: 1 |
||||
}, { |
||||
text: BI.i18nText("Fine-Design_Report_Bottom"), |
||||
value: 2 |
||||
}], { |
||||
type: "bi.single_select_radio_item", |
||||
logic: { |
||||
dynamic: true |
||||
} |
||||
}), |
||||
layouts: [{ |
||||
type: "bi.left", |
||||
lgap: 10 |
||||
}] |
||||
}] |
||||
}; |
||||
}, |
||||
|
||||
getValue: function() { |
||||
return self.group.getValue(); |
||||
}, |
||||
|
||||
setValue: function(v) { |
||||
this.group.setValue(v); |
||||
} |
||||
}); |
||||
BI.shortcut("bi.report.sheet_label_location", Analysis); |
||||
})(); |
@ -0,0 +1,126 @@
|
||||
!(function(){ |
||||
var ToolBar = BI.inherit(BI.Widget, { |
||||
props: { |
||||
baseCls: "bi-settings-tool-bar", |
||||
value: [1] |
||||
}, |
||||
|
||||
render: function() { |
||||
var self = this, o = this.options; |
||||
return { |
||||
type: "bi.vertical", |
||||
items: [{ |
||||
type: "bi.left_right_vertical_adapt", |
||||
height: 24, |
||||
bgap: 15, |
||||
rhgap: 10, |
||||
items: { |
||||
left: [{ |
||||
type: "bi.label", |
||||
text: BI.i18nText("Fine-Design_Report_Mobile_ToolBar"), |
||||
width: 70, |
||||
textAlign: "left" |
||||
}, { |
||||
type: "bi.button_group", |
||||
value: o.value, |
||||
chooseType: BI.Selection.Multi, |
||||
items: BI.createItems([{ |
||||
text: BI.i18nText("Fine-Design_Report_ToolBar_Top"), |
||||
value: 1, |
||||
listeners: [{ |
||||
eventName: "EVENT_CHANGE", |
||||
action: function() { |
||||
if(this.isSelected()) { |
||||
self._populateDefault(); |
||||
} else { |
||||
self.topRegion.populate(); |
||||
} |
||||
} |
||||
}] |
||||
}, { |
||||
text: BI.i18nText("Fine-Design_Report_ToolBar_Bottom"), |
||||
value: 2 |
||||
}], { |
||||
type: "bi.multi_select_item", |
||||
hgap: 5, |
||||
logic: { |
||||
dynamic: true |
||||
}, |
||||
iconWrapperWidth: 16 |
||||
}), |
||||
ref: function(_ref) { |
||||
self.group = _ref; |
||||
}, |
||||
layouts: [{ |
||||
type: "bi.left" |
||||
}], |
||||
listeners: [{ |
||||
eventName: "EVENT_CHANGE", |
||||
action: function() { |
||||
|
||||
} |
||||
}] |
||||
}], |
||||
right: [{ |
||||
el: { |
||||
type: "bi.text_button", |
||||
cls: "bi-border", |
||||
text: BI.i18nText("Fine-Design_Basic_Scale_Custom_Button"), |
||||
handler: function() { |
||||
|
||||
}, |
||||
hgap: 5 |
||||
} |
||||
}, { |
||||
el: { |
||||
type: "bi.text_button", |
||||
cls: "bi-border", |
||||
text: BI.i18nText("Fine-Design_Report_Restore_Default"), |
||||
handler: function() { |
||||
|
||||
}, |
||||
hgap: 5 |
||||
} |
||||
}] |
||||
} |
||||
}, { |
||||
el: { |
||||
type: "bi.settings.tool_bar.region", |
||||
height: 56, |
||||
title: BI.i18nText("Fine-Design_Report_ToolBar_Top"), |
||||
ref: function(_ref) { |
||||
self.topRegion = _ref; |
||||
}, |
||||
items: BI.contains(o.value, 1) ? this._createDefaultItems() : [] |
||||
}, |
||||
bgap: 20 |
||||
}, { |
||||
type: "bi.settings.tool_bar.region", |
||||
height: 56, |
||||
title: BI.i18nText("Fine-Design_Report_ToolBar_Bottom"), |
||||
ref: function(_ref) { |
||||
self.bottomRegion = _ref; |
||||
} |
||||
}] |
||||
} |
||||
}, |
||||
|
||||
_createDefaultItems: function() { |
||||
return BI.createItems(BI.Constants.getConstant("bi.constant.report.template.web_setting.tools"), { |
||||
type: "bi.icon_text_item", |
||||
height: 24, |
||||
extraCls: "bi-background bi-list-item-select bi-border-radius", |
||||
logic: { |
||||
dynamic: true |
||||
}, |
||||
textHgap: 10, |
||||
value: BI.UUID() |
||||
}) |
||||
}, |
||||
|
||||
_populateDefault: function() { |
||||
this.topRegion.populate(this._createDefaultItems()); |
||||
} |
||||
}) |
||||
BI.shortcut("bi.settings.tool_bar", ToolBar) |
||||
})(); |
@ -0,0 +1,42 @@
|
||||
!(function(){ |
||||
var Region = BI.inherit(BI.Widget, { |
||||
|
||||
props: { |
||||
baseCls: "bi-settings-tool-bar-region", |
||||
title: "" |
||||
}, |
||||
|
||||
render: function() { |
||||
var self = this, o = this.options; |
||||
return [{ |
||||
type: "bi.button_group", |
||||
cls: "bi-border", |
||||
items: o.items, |
||||
chooseType: BI.Selection.Multi, |
||||
layouts: [{ |
||||
type: "bi.vertical_adapt", |
||||
hgap: 10 |
||||
}], |
||||
ref: function(_ref) { |
||||
self.group = _ref; |
||||
} |
||||
}, { |
||||
type: "bi.absolute", |
||||
items: [{ |
||||
el: { |
||||
type: "bi.label", |
||||
cls: "bi-background", |
||||
text: o.title |
||||
}, |
||||
top: -10, |
||||
left: 10 |
||||
}] |
||||
}] |
||||
}, |
||||
|
||||
populate: function(items) { |
||||
this.group.populate(items); |
||||
} |
||||
}) |
||||
BI.shortcut("bi.settings.tool_bar.region", Region); |
||||
})(); |
@ -0,0 +1,67 @@
|
||||
!(function () { |
||||
/** |
||||
* 工具栏高度相关 |
||||
*/ |
||||
var Analysis = BI.inherit(BI.Widget, { |
||||
props: { |
||||
baseCls: "bi-report-server-param-setting-tool-bar-height-select", |
||||
height: 24, |
||||
value: 2 |
||||
}, |
||||
|
||||
render: function () { |
||||
var self = this, o = this.options; |
||||
return { |
||||
type: "bi.vertical_adapt", |
||||
height: 24, |
||||
items: [{ |
||||
el: { |
||||
type: "bi.label", |
||||
text: BI.i18nText("Fine-Design_Report_Mobile_ToolBar_Height") |
||||
}, |
||||
rgap: 10 |
||||
}, { |
||||
type: "bi.button_group", |
||||
value: o.value, |
||||
ref: function(_ref) { |
||||
self.group = _ref; |
||||
}, |
||||
items: BI.createItems([{ |
||||
text: BI.i18nText("Fine-Design_Report_Tool_Bar_High"), |
||||
value: 1 |
||||
}, { |
||||
text: BI.i18nText("Fine-Design_Report_Tool_Bar_Middle"), |
||||
value: 2 |
||||
}, { |
||||
text: BI.i18nText("Fine-Design_Report_Tool_Bar_Low"), |
||||
value: 3 |
||||
}], { |
||||
type: "bi.single_select_radio_item", |
||||
logic: { |
||||
dynamic: true |
||||
} |
||||
}), |
||||
layouts: [{ |
||||
type: "bi.vertical_adapt" |
||||
}], |
||||
listeners: [{ |
||||
eventName: "EVENT_CHANGE", |
||||
action: function() { |
||||
|
||||
} |
||||
}] |
||||
}] |
||||
|
||||
}; |
||||
}, |
||||
|
||||
getValue: function() { |
||||
return self.group.getValue(); |
||||
}, |
||||
|
||||
setValue: function(v) { |
||||
this.group.setValue(v); |
||||
} |
||||
}); |
||||
BI.shortcut("bi.report.server.param_setting.tool_bar_height_select", Analysis); |
||||
})(); |
@ -0,0 +1,47 @@
|
||||
!(function () { |
||||
/** |
||||
* 使用工具栏相关 |
||||
*/ |
||||
var Analysis = BI.inherit(BI.Widget, { |
||||
props: { |
||||
baseCls: "bi-report-server-param-setting-use-tool-bar" |
||||
}, |
||||
|
||||
render: function () { |
||||
var self = this; |
||||
return { |
||||
type: "bi.vertical_adapt", |
||||
height: 24, |
||||
items: [{ |
||||
el: { |
||||
type: "bi.multi_select_item", |
||||
ref: function(_ref) { |
||||
self.multiSelect = _ref; |
||||
}, |
||||
hgap: 5, |
||||
selected: true, |
||||
text: BI.i18nText("Fine-Design_Report_Use_ToolBar"), |
||||
logic: { |
||||
dynamic: true |
||||
}, |
||||
iconWrapperWidth: 16 |
||||
} |
||||
}, { |
||||
type: "bi.text_button", |
||||
cls: "bi-card bi-border", |
||||
text: BI.i18nText("Fine-Design_Report_Edit"), |
||||
hgap: 10 |
||||
}] |
||||
}; |
||||
}, |
||||
|
||||
getValue: function() { |
||||
return self.multiSelect.getSelected(); |
||||
}, |
||||
|
||||
setValue: function(v) { |
||||
this.multiSelect.setSelected(v); |
||||
} |
||||
}); |
||||
BI.shortcut("bi.report.server.param_setting.use_tool_bar", Analysis); |
||||
})(); |
@ -0,0 +1,30 @@
|
||||
window.BICst = window.BICst || {}; |
||||
BICst.REPORT_SERVER_PARAM = { |
||||
SPLIT_PAGE_PREVIEW_SETTING: 1, |
||||
FORM_PAGE_SETTING: 2, |
||||
DATA_ANALYSIS_SETTING: 3, |
||||
IMPORT_CSS: 4, |
||||
IMPORT_JS: 5, |
||||
ERROR_TEMPLATE_DEFINE: 6, |
||||
PRINT_SETTING: 7 |
||||
}; |
||||
BICst.REPORT_TEMPLATE_WEB_SETTING = { |
||||
BASE: 1, |
||||
PRINT: 2, |
||||
SPLIT_PAGE_PREVIEW_SETTING: 3, |
||||
FORM_PAGE_SETTING: 4, |
||||
DATA_ANALYSIS_SETTING: 5, |
||||
BROWSER: 6, |
||||
IMPORT_CSS: 7, |
||||
IMPORT_JS: 8 |
||||
}; |
||||
|
||||
BICst.REPORT_TEMPLATE_WEB_SETTING_TOOLS = { |
||||
FIRST_PAGE: 1, |
||||
PRE_PAGE: 2, |
||||
NEXT_PAGE: 3, |
||||
LAST_PAGE: 4, |
||||
PRINT: 5, |
||||
EXPORT: 6, |
||||
EMAIL: 7 |
||||
}; |
@ -0,0 +1,53 @@
|
||||
BI.addI18n({ |
||||
"Fine-Design_Report_WEB_Pagination_Setting": "分页预览设置", |
||||
"Fine-Design_Report_WEB_Write_Setting": "填报页面设置", |
||||
"Fine-Design_Report_Data_Analysis_Settings": "数据分析设置", |
||||
"Fine-Design_Report_ReportServerP_Import_Css": "引用Css", |
||||
"Fine-Design_Report_ReportServerP_Import_JavaScript": "引用JavaScript", |
||||
"Fine-Design_Report_Error_Handler_Template": "出错模板定义", |
||||
"Fine-Design_Report_Print_Setting": "打印设置", |
||||
"Fine-Design_Report_Mobile_ToolBar": "工具栏", |
||||
"Fine-Design_Report_Tool_Bar_High": "高", |
||||
"Fine-Design_Report_Tool_Bar_Middle": "中", |
||||
"Fine-Design_Report_Tool_Bar_Low": "低", |
||||
"Fine-Design_Report_Mobile_ToolBar_Height": "工具栏高度", |
||||
"Fine-Design_Report_Is_Paint_Page": "以图片方式显示", |
||||
"Fine-Design_Report_IS_Auto_Scale": "iframe嵌入时自动缩放", |
||||
"Fine-Design_Report_IS_TD_HEAVY_EXPORT": "重方式输出格子", |
||||
"Fine-Design_Report_Use_ToolBar": "使用工具栏", |
||||
"Fine-Design_Report_Show_Location": "报表显示位置", |
||||
"Fine-Design_Report_Center_Display": "居中展示", |
||||
"Fine-Design_Report_Left_Display": "左展示", |
||||
"Fine-Design_Report_Editing_Listeners": "事件编辑", |
||||
"Fine-Design_Report_Edit": "编辑", |
||||
"Fine-Design_Report_Sheet_Label_Page_Display_Position": "sheet标签页显示位置:", |
||||
"Fine-Design_Form_Base_Top": "上", |
||||
"Fine-Design_Report_Bottom": "下", |
||||
"Fine-Design_Report_Set_Face_Write_Current_Edit_Row_Background": "当前编辑行背景设置", |
||||
"Fine-Design_Report_Unload_Check": "未提交离开提示", |
||||
"Fine-Design_Basic_Engine_Event_Show_Widgets": "直接显示控件", |
||||
"Fine-Design_Report_Write_Auto_Stash": "自动暂存", |
||||
"Fine-Design_Report_Engine_Sort_Sort": "排序", |
||||
"Fine-Design_Report_Engine_Selection_Filter": "条件筛选", |
||||
"Fine-Design_Report_Engine_List_Filter": "列表筛选", |
||||
"Fine-Design_Basic_Engine_Cancel": "取消", |
||||
"Fine-Design_Report_OK": "确定", |
||||
"Fine-Design_Report_Basic": "基本", |
||||
"Fine-Design_Report_Printer(Server)": "打印机(服务器)", |
||||
"Fine-Design_Report_Browser_Background": "浏览器背景", |
||||
"Fine-Design_Report_I_Want_To_Set_Single": "为该模板单独设置", |
||||
"Fine-Design_Form_Using_Server_Report_View_Settings": "采用服务器设置", |
||||
"Fine-Design_Report_Blow_Set": "以下设置:", |
||||
"Fine-Design_Report_PageSetup_Page": "页面", |
||||
"Fine-Design_Report_ToolBar_Top": "顶部工具栏", |
||||
"Fine-Design_Report_ToolBar_Bottom": "底部工具栏", |
||||
"Fine-Design_Basic_Scale_Custom_Button": "自定义", |
||||
"Fine-Design_Report_Restore_Default": "恢复默认", |
||||
"Fine-Design_Report_Engine_ReportServerP_First": "首页", |
||||
"Fine-Design_Report_Engine_ReportServerP_Previous": "上一页", |
||||
"Fine-Design_Report_Engine_ReportServerP_Next": "下一页", |
||||
"Fine-Design_Report_Engine_ReportServerP_Last": "末页", |
||||
"Fine-Design_Report_Engine_Print": "打印", |
||||
"Fine-Design_Report_Engine_Export": "导出", |
||||
"Fine-Design_Report_Engine_Email": "邮件" |
||||
}); |
@ -0,0 +1 @@
|
||||
@import "../../fineui/src/less/index.less"; |
@ -0,0 +1,59 @@
|
||||
!(function () { |
||||
/** |
||||
* 服务器 数据分析设置 |
||||
*/ |
||||
var Analysis = BI.inherit(BI.Widget, { |
||||
props: { |
||||
baseCls: "bi-report-server-param-setting-data-analysis" |
||||
}, |
||||
|
||||
render: function () { |
||||
return { |
||||
type: "bi.vtape", |
||||
vgap: 10, |
||||
hgap: 10, |
||||
items: [{ |
||||
type: "bi.button_group", |
||||
height: 24, |
||||
value: [1,2,3], |
||||
items: BI.createItems([{ |
||||
text: BI.i18nText("Fine-Design_Report_Engine_Sort_Sort"), |
||||
value: 1 |
||||
}, { |
||||
text: BI.i18nText("Fine-Design_Report_Engine_Selection_Filter"), |
||||
value: 2 |
||||
}, { |
||||
text: BI.i18nText("Fine-Design_Report_Engine_List_Filter"), |
||||
value: 2 |
||||
}], { |
||||
type: "bi.multi_select_item", |
||||
logic: { |
||||
dynamic: true |
||||
}, |
||||
iconWrapperWidth: 16, |
||||
hgap: 5 |
||||
}), |
||||
chooseType: BI.Selection.Multi, |
||||
layouts: [{ |
||||
type: "bi.vertical_adapt" |
||||
}] |
||||
}, { |
||||
type: "bi.report.server.param_setting.use_tool_bar", |
||||
height: 24, |
||||
value: true |
||||
}, { |
||||
type: "bi.report.server.param_setting.tool_bar_height_select", |
||||
height: 24 |
||||
}, { |
||||
type: "bi.label", |
||||
height: 24, |
||||
textAlign: "left", |
||||
text: BI.i18nText("Fine-Design_Report_Editing_Listeners") + ":", |
||||
}, { |
||||
type: "bi.report.server.param_setting.edit_list" |
||||
}] |
||||
}; |
||||
} |
||||
}); |
||||
BI.shortcut("bi.report.server.param_setting.data_analysis", Analysis); |
||||
})(); |
@ -0,0 +1,69 @@
|
||||
!(function () { |
||||
|
||||
/** |
||||
* 服务器 填报预览设置 |
||||
*/ |
||||
var Analysis = BI.inherit(BI.Widget, { |
||||
props: { |
||||
baseCls: "bi-report-server-param-setting-form-page" |
||||
}, |
||||
|
||||
render: function () { |
||||
return { |
||||
type: "bi.vtape", |
||||
vgap: 10, |
||||
hgap: 10, |
||||
items: [{ |
||||
type: "bi.grid", |
||||
height: 78, |
||||
columns: 2, |
||||
rows: 2, |
||||
items: [{ |
||||
column: 0, |
||||
row: 0, |
||||
el: { |
||||
type: "bi.report.sheet_label_location", |
||||
height: 24 |
||||
} |
||||
}, { |
||||
column: 1, |
||||
row: 0, |
||||
el: { |
||||
type: "bi.report.server.param_setting.report_show_location", |
||||
height: 24 |
||||
} |
||||
}, { |
||||
column: 0, |
||||
row: 1, |
||||
el: { |
||||
type: "bi.report.form_background_setting", |
||||
height: 24 |
||||
} |
||||
}, { |
||||
column: 1, |
||||
row: 1, |
||||
el: { |
||||
type: "bi.report.leave_setting", |
||||
height: 24 |
||||
} |
||||
}] |
||||
}, { |
||||
type: "bi.report.server.param_setting.use_tool_bar", |
||||
height: 24, |
||||
value: true |
||||
}, { |
||||
type: "bi.report.server.param_setting.tool_bar_height_select", |
||||
height: 24 |
||||
}, { |
||||
type: "bi.label", |
||||
height: 24, |
||||
textAlign: "left", |
||||
text: BI.i18nText("Fine-Design_Report_Editing_Listeners") + ":", |
||||
}, { |
||||
type: "bi.report.server.param_setting.edit_list" |
||||
}] |
||||
}; |
||||
} |
||||
}); |
||||
BI.shortcut("bi.report.server.param_setting.form_page", Analysis); |
||||
})(); |
@ -0,0 +1,66 @@
|
||||
!(function () { |
||||
/** |
||||
* 服务器 分页预览设置 |
||||
*/ |
||||
var Analysis = BI.inherit(BI.Widget, { |
||||
props: { |
||||
baseCls: "bi-report-server-param-setting-page-preview" |
||||
}, |
||||
|
||||
render: function () { |
||||
return { |
||||
type: "bi.vtape", |
||||
vgap: 10, |
||||
hgap: 10, |
||||
items: [{ |
||||
type: "bi.report.server.param_setting.report_show_location", |
||||
height: 24 |
||||
}, { |
||||
type: "bi.button_group", |
||||
height: 92, |
||||
chooseType: BI.Selection.Multi, |
||||
items: BI.createItems([{ |
||||
el: { |
||||
text: BI.i18nText("Fine-Design_Report_Is_Paint_Page"), |
||||
value: 1 |
||||
}, |
||||
bgap: 10 |
||||
}, { |
||||
el: { |
||||
text: BI.i18nText("Fine-Design_Report_IS_Auto_Scale"), |
||||
value: 2 |
||||
}, |
||||
bgap: 10 |
||||
}, { |
||||
text: BI.i18nText("Fine-Design_Report_IS_TD_HEAVY_EXPORT"), |
||||
value: 3 |
||||
}], { |
||||
type: "bi.multi_select_item", |
||||
hgap: 5, |
||||
logic: { |
||||
dynamic: true |
||||
}, |
||||
iconWrapperWidth: 16 |
||||
}), |
||||
layouts: [{ |
||||
type: "bi.vertical" |
||||
}] |
||||
}, { |
||||
type: "bi.report.server.param_setting.use_tool_bar", |
||||
height: 24 |
||||
}, { |
||||
type: "bi.report.server.param_setting.tool_bar_height_select", |
||||
height: 24 |
||||
}, { |
||||
type: "bi.label", |
||||
height: 24, |
||||
textAlign: "left", |
||||
text: BI.i18nText("Fine-Design_Report_Editing_Listeners") + ":", |
||||
}, { |
||||
type: "bi.report.server.param_setting.edit_list" |
||||
}] |
||||
}; |
||||
} |
||||
}); |
||||
BI.shortcut("bi.report.server.param_setting.page_preview", Analysis); |
||||
})(); |
@ -0,0 +1,33 @@
|
||||
!(function () { |
||||
BI.constant("bi.constant.report.server.param_setting", [ |
||||
{ |
||||
text: BI.i18nText("Fine-Design_Report_WEB_Pagination_Setting"), |
||||
cls: "tab-item", |
||||
value: BICst.REPORT_SERVER_PARAM.SPLIT_PAGE_PREVIEW_SETTING |
||||
}, { |
||||
text: BI.i18nText("Fine-Design_Report_WEB_Write_Setting"), |
||||
cls: "tab-item", |
||||
value: BICst.REPORT_SERVER_PARAM.FORM_PAGE_SETTING |
||||
}, { |
||||
text: BI.i18nText("Fine-Design_Report_Data_Analysis_Settings"), |
||||
cls: "tab-item", |
||||
value: BICst.REPORT_SERVER_PARAM.DATA_ANALYSIS_SETTING |
||||
}, { |
||||
text: BI.i18nText("Fine-Design_Report_ReportServerP_Import_Css"), |
||||
cls: "tab-item", |
||||
value: BICst.REPORT_SERVER_PARAM.IMPORT_CSS |
||||
}, { |
||||
text: BI.i18nText("Fine-Design_Report_ReportServerP_Import_JavaScript"), |
||||
cls: "tab-item", |
||||
value: BICst.REPORT_SERVER_PARAM.IMPORT_JS |
||||
}, { |
||||
text: BI.i18nText("Fine-Design_Report_Error_Handler_Template"), |
||||
cls: "tab-item", |
||||
value: BICst.REPORT_SERVER_PARAM.ERROR_TEMPLATE_DEFINE |
||||
}, { |
||||
text: BI.i18nText("Fine-Design_Report_Print_Setting"), |
||||
cls: "tab-item", |
||||
value: BICst.REPORT_SERVER_PARAM.PRINT_SETTING |
||||
}] |
||||
); |
||||
})(); |
@ -0,0 +1,50 @@
|
||||
!(function () { |
||||
|
||||
/** |
||||
* 报表服务器参数面板 |
||||
*/ |
||||
var Tab = BI.inherit(BI.Widget, { |
||||
|
||||
props: { |
||||
baseCls: "bi-report-server-param-setting" |
||||
}, |
||||
|
||||
render: function () { |
||||
return { |
||||
type: "bi.setting.tab", |
||||
value: BICst.REPORT_SERVER_PARAM.SPLIT_PAGE_PREVIEW_SETTING, |
||||
tabItems: BI.Constants.getConstant("bi.constant.report.server.param_setting"), |
||||
cardCreator: BI.bind(this._createCard, this) |
||||
}; |
||||
}, |
||||
|
||||
_createCard: function (v) { |
||||
switch (v) { |
||||
case BICst.REPORT_SERVER_PARAM.SPLIT_PAGE_PREVIEW_SETTING: |
||||
return { |
||||
type: "bi.report.server.param_setting.page_preview" |
||||
}; |
||||
case BICst.REPORT_SERVER_PARAM.FORM_PAGE_SETTING: |
||||
return { |
||||
type: "bi.report.server.param_setting.form_page" |
||||
}; |
||||
case BICst.REPORT_SERVER_PARAM.DATA_ANALYSIS_SETTING: |
||||
return { |
||||
type: "bi.report.server.param_setting.data_analysis" |
||||
} |
||||
case BICst.REPORT_SERVER_PARAM.IMPORT_CSS: |
||||
case BICst.REPORT_SERVER_PARAM.IMPORT_JS: |
||||
case BICst.REPORT_SERVER_PARAM.ERROR_TEMPLATE_DEFINE: |
||||
case BICst.REPORT_SERVER_PARAM.PRINT_SETTING: |
||||
default: |
||||
return { |
||||
type: "bi.label", |
||||
text: "1" |
||||
}; |
||||
} |
||||
} |
||||
|
||||
}); |
||||
|
||||
BI.shortcut("bi.report.server.param_setting", Tab); |
||||
})(); |
@ -0,0 +1,64 @@
|
||||
!(function () { |
||||
/** |
||||
* 填报页面设置 |
||||
*/ |
||||
var Analysis = BI.inherit(BI.Widget, { |
||||
props: { |
||||
baseCls: "bi-report-server-param-setting-form-page" |
||||
}, |
||||
|
||||
render: function () { |
||||
return { |
||||
type: "bi.vtape", |
||||
vgap: 10, |
||||
hgap: 10, |
||||
items: [{ |
||||
type: "bi.report.global_or_single_combo", |
||||
height: 24 |
||||
}, { |
||||
type: "bi.grid", |
||||
height: 78, |
||||
columns: 2, |
||||
rows: 2, |
||||
items: [{ |
||||
column: 0, |
||||
row: 0, |
||||
el: { |
||||
type: "bi.report.sheet_label_location" |
||||
} |
||||
}, { |
||||
column: 1, |
||||
row: 0, |
||||
el: { |
||||
type: "bi.report.server.param_setting.report_show_location", |
||||
height: 24 |
||||
} |
||||
}, { |
||||
column: 0, |
||||
row: 1, |
||||
el: { |
||||
type: "bi.report.form_background_setting" |
||||
} |
||||
}, { |
||||
column: 1, |
||||
row: 1, |
||||
el: { |
||||
type: "bi.report.leave_setting" |
||||
} |
||||
}] |
||||
}, { |
||||
type: "bi.settings.tool_bar", |
||||
height: 180 |
||||
}, { |
||||
type: "bi.label", |
||||
height: 24, |
||||
textAlign: "left", |
||||
text: BI.i18nText("Fine-Design_Report_Editing_Listeners") + ":", |
||||
}, { |
||||
type: "bi.report.server.param_setting.edit_list" |
||||
}] |
||||
}; |
||||
} |
||||
}); |
||||
BI.shortcut("bi.report.template.web_setting.form_page", Analysis); |
||||
})(); |
@ -0,0 +1,73 @@
|
||||
!(function () { |
||||
/** |
||||
* 分页预览设置 |
||||
*/ |
||||
var Analysis = BI.inherit(BI.Widget, { |
||||
props: { |
||||
baseCls: "bi-report-server-param-setting-page-preview" |
||||
}, |
||||
|
||||
render: function () { |
||||
return { |
||||
type: "bi.vtape", |
||||
vgap: 10, |
||||
hgap: 10, |
||||
items: [{ |
||||
type: "bi.report.global_or_single_combo", |
||||
height: 24 |
||||
}, { |
||||
type: "bi.report.server.param_setting.report_show_location", |
||||
height: 24 |
||||
}, { |
||||
type: "bi.vertical_adapt", |
||||
height: 24, |
||||
items: [{ |
||||
type: "bi.label", |
||||
text: BI.i18nText("Fine-Design_Report_PageSetup_Page"), |
||||
textAlign: "right", |
||||
width: 70 |
||||
}, { |
||||
el: { |
||||
type: "bi.button_group", |
||||
height: 24, |
||||
chooseType: BI.Selection.Multi, |
||||
items: BI.createItems([{ |
||||
text: BI.i18nText("Fine-Design_Report_Is_Paint_Page"), |
||||
value: 1 |
||||
}, { |
||||
text: BI.i18nText("Fine-Design_Report_IS_Auto_Scale"), |
||||
value: 2 |
||||
}, { |
||||
text: BI.i18nText("Fine-Design_Report_IS_TD_HEAVY_EXPORT"), |
||||
value: 3 |
||||
}], { |
||||
type: "bi.multi_select_item", |
||||
hgap: 5, |
||||
logic: { |
||||
dynamic: true |
||||
}, |
||||
iconWrapperWidth: 16 |
||||
}), |
||||
layouts: [{ |
||||
type: "bi.left", |
||||
lgap: 5 |
||||
}] |
||||
}, |
||||
lgap: 10 |
||||
}] |
||||
}, { |
||||
type: "bi.settings.tool_bar", |
||||
height: 180 |
||||
}, { |
||||
type: "bi.label", |
||||
height: 24, |
||||
textAlign: "left", |
||||
text: BI.i18nText("Fine-Design_Report_Editing_Listeners") + ":", |
||||
}, { |
||||
type: "bi.report.server.param_setting.edit_list" |
||||
}] |
||||
}; |
||||
} |
||||
}); |
||||
BI.shortcut("bi.report.template.web_setting.page_preview", Analysis); |
||||
})(); |
@ -0,0 +1,69 @@
|
||||
!(function () { |
||||
BI.constant("bi.constant.report.template.web_setting", [ |
||||
{ |
||||
text: BI.i18nText("Fine-Design_Report_Basic"), |
||||
cls: "tab-item", |
||||
value: BICst.REPORT_TEMPLATE_WEB_SETTING.BASE |
||||
}, { |
||||
text: BI.i18nText("Fine-Design_Report_Printer(Server)"), |
||||
cls: "tab-item", |
||||
value: BICst.REPORT_TEMPLATE_WEB_SETTING.PRINT |
||||
}, { |
||||
text: BI.i18nText("Fine-Design_Report_WEB_Pagination_Setting"), |
||||
cls: "tab-item", |
||||
value: BICst.REPORT_TEMPLATE_WEB_SETTING.SPLIT_PAGE_PREVIEW_SETTING |
||||
}, { |
||||
text: BI.i18nText("Fine-Design_Report_WEB_Write_Setting"), |
||||
cls: "tab-item", |
||||
value: BICst.REPORT_TEMPLATE_WEB_SETTING.FORM_PAGE_SETTING |
||||
}, { |
||||
text: BI.i18nText("Fine-Design_Report_Data_Analysis_Settings"), |
||||
cls: "tab-item", |
||||
value: BICst.REPORT_TEMPLATE_WEB_SETTING.DATA_ANALYSIS_SETTING |
||||
}, { |
||||
text: BI.i18nText("Fine-Design_Report_Browser_Background"), |
||||
cls: "tab-item", |
||||
value: BICst.REPORT_TEMPLATE_WEB_SETTING.BROWSER |
||||
}, { |
||||
text: BI.i18nText("Fine-Design_Report_ReportServerP_Import_Css"), |
||||
cls: "tab-item", |
||||
value: BICst.REPORT_TEMPLATE_WEB_SETTING.IMPORT_CSS |
||||
}, { |
||||
text: BI.i18nText("Fine-Design_Report_ReportServerP_Import_JavaScript"), |
||||
cls: "tab-item", |
||||
value: BICst.REPORT_TEMPLATE_WEB_SETTING.IMPORT_JS |
||||
}] |
||||
); |
||||
|
||||
BI.constant("bi.constant.report.template.web_setting.tools", [ |
||||
{ |
||||
text: BI.i18nText("Fine-Design_Report_Engine_ReportServerP_First"), |
||||
cls: "close-font", |
||||
value: BICst.REPORT_TEMPLATE_WEB_SETTING_TOOLS.FIRST_PAGE |
||||
}, { |
||||
text: BI.i18nText("Fine-Design_Report_Engine_ReportServerP_Previous"), |
||||
cls: "close-font", |
||||
value: BICst.REPORT_TEMPLATE_WEB_SETTING_TOOLS.PRE_PAGE |
||||
}, { |
||||
text: BI.i18nText("Fine-Design_Report_Engine_ReportServerP_Next"), |
||||
cls: "close-font", |
||||
value: BICst.REPORT_TEMPLATE_WEB_SETTING_TOOLS.NEXT_PAGE |
||||
}, { |
||||
text: BI.i18nText("Fine-Design_Report_Engine_ReportServerP_Last"), |
||||
cls: "close-font", |
||||
value: BICst.REPORT_TEMPLATE_WEB_SETTING_TOOLS.LAST_PAGE |
||||
}, { |
||||
text: BI.i18nText("Fine-Design_Report_Engine_Print"), |
||||
cls: "close-font", |
||||
value: BICst.REPORT_TEMPLATE_WEB_SETTING_TOOLS.PRINT |
||||
}, { |
||||
text: BI.i18nText("Fine-Design_Report_Engine_Export"), |
||||
cls: "close-font", |
||||
value: BICst.REPORT_TEMPLATE_WEB_SETTING_TOOLS.EXPORT |
||||
}, { |
||||
text: BI.i18nText("Fine-Design_Report_Engine_Email"), |
||||
cls: "close-font", |
||||
value: BICst.REPORT_TEMPLATE_WEB_SETTING_TOOLS.EMAIL |
||||
}] |
||||
); |
||||
})(); |
@ -0,0 +1,48 @@
|
||||
!(function () { |
||||
|
||||
/** |
||||
* 模板Web属性面板 |
||||
*/ |
||||
var Tab = BI.inherit(BI.Widget, { |
||||
|
||||
props: { |
||||
baseCls: "bi-report-template-web-setting" |
||||
}, |
||||
|
||||
render: function () { |
||||
return { |
||||
type: "bi.setting.tab", |
||||
value: BICst.REPORT_TEMPLATE_WEB_SETTING.SPLIT_PAGE_PREVIEW_SETTING, |
||||
tabItems: BI.Constants.getConstant("bi.constant.report.template.web_setting"), |
||||
cardCreator: BI.bind(this._createCard, this) |
||||
}; |
||||
}, |
||||
|
||||
_createCard: function (v) { |
||||
switch (v) { |
||||
case BICst.REPORT_TEMPLATE_WEB_SETTING.SPLIT_PAGE_PREVIEW_SETTING: |
||||
return { |
||||
type: "bi.report.template.web_setting.page_preview" |
||||
} |
||||
case BICst.REPORT_TEMPLATE_WEB_SETTING.FORM_PAGE_SETTING: |
||||
return { |
||||
type: "bi.report.template.web_setting.form_page" |
||||
} |
||||
case BICst.REPORT_TEMPLATE_WEB_SETTING.DATA_ANALYSIS_SETTING: |
||||
case BICst.REPORT_TEMPLATE_WEB_SETTING.BASE: |
||||
case BICst.REPORT_TEMPLATE_WEB_SETTING.PRINT: |
||||
case BICst.REPORT_TEMPLATE_WEB_SETTING.BROWSER: |
||||
case BICst.REPORT_TEMPLATE_WEB_SETTING.IMPORT_CSS: |
||||
case BICst.REPORT_TEMPLATE_WEB_SETTING.IMPORT_JS: |
||||
default: |
||||
return { |
||||
type: "bi.label", |
||||
text: "1" |
||||
}; |
||||
} |
||||
} |
||||
|
||||
}); |
||||
|
||||
BI.shortcut("bi.report.template.web_setting", Tab); |
||||
})(); |
@ -0,0 +1,12 @@
|
||||
.bi-setting-tab .tab-group { |
||||
background-color: #F2F4F7; |
||||
font-size: 12px; |
||||
} |
||||
.bi-setting-tab .tab-group .tab-item:hover { |
||||
color: #3685f2; |
||||
} |
||||
.bi-setting-tab .tab-group .tab-item.active { |
||||
background-color: #ffffff; |
||||
color: #3685f2; |
||||
border-top: 3px solid #3685f2; |
||||
} |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue