commit e909c9365abfa15150c8889b60b276fbfad9acc3 Author: pioneer Date: Thu Nov 10 16:17:27 2022 +0800 open diff --git a/README.md b/README.md new file mode 100644 index 0000000..e487af5 --- /dev/null +++ b/README.md @@ -0,0 +1,6 @@ +# open-JSD-9988 + +JSD-9988 决策平台主题调整\ +免责说明:该源码为第三方爱好者提供,不保证源码和方案的可靠性,也不提供任何形式的源码教学指导和协助!\ +仅作为开发者学习参考使用!禁止用于任何商业用途!\ +为保护开发者隐私,开发者信息已隐去!若原开发者希望公开自己的信息,可联系【pioneer】处理。 \ No newline at end of file diff --git a/doc/JSD-9988-需求确认书V1 .docx b/doc/JSD-9988-需求确认书V1 .docx new file mode 100644 index 0000000..9fdf341 Binary files /dev/null and b/doc/JSD-9988-需求确认书V1 .docx differ diff --git a/plugin.xml b/plugin.xml new file mode 100644 index 0000000..119a9a4 --- /dev/null +++ b/plugin.xml @@ -0,0 +1,25 @@ + + + com.fr.plugin.xx.theme.sky.jsd9988 + + yes + 1.0.3 + 10.0~11.0 + 2021-04-20 + fr.open + + + [2022-04-21]1.0.2 增加自定义左侧菜单宽度控制
+ [2022-04-15]1.0.0 基于天空主题1.1.1版本开发
+ ]]>
+ + + + + + + + + +
\ No newline at end of file diff --git a/src/main/java/com/fr/plugin/zk/theme/sky/Client.java b/src/main/java/com/fr/plugin/zk/theme/sky/Client.java new file mode 100644 index 0000000..b243b90 --- /dev/null +++ b/src/main/java/com/fr/plugin/zk/theme/sky/Client.java @@ -0,0 +1,66 @@ +package com.fr.plugin.xx.theme.sky; + +import com.fr.general.CloudCenter; +import com.fr.invoke.Reflect; +import com.fr.invoke.ReflectException; + +/** + * @author k + * @Project name finereport10 + * @description: + * @created on 2020/1/7 17:24. + * @email xx.xx@qq.com + * @Modified By + */ +public enum Client { + SERVER("server"), + REPORT("report"), + DESIGNER("designer"), + BI("bi"), + UNKNOWN("unknown"); + + private String text; + + private Client(String var3) { + this.text = var3; + } + + public static Client parse() { + Class var0 = null; + + try { + try { + var0 = Reflect.on("com.fr.start.Designer").get(); + } catch (ReflectException var4) { + } + + if (var0 != null) { + return DESIGNER; + } else { + try { + var0 = Reflect.on("com.finebi.web.constant.FineWebConstant").get(); + } catch (ReflectException var3) { + } + + if (var0 != null) { + return BI; + } else { + try { + var0 = Reflect.on("com.fr.report.report.Report").get(); + } catch (ReflectException var2) { + } + + return var0 != null ? REPORT : SERVER; + } + } + } catch (Throwable var5) { + return UNKNOWN; + } + } + + @Override + public String toString() { + return this.text; + } + +} diff --git a/src/main/java/com/fr/plugin/zk/theme/sky/Constants.java b/src/main/java/com/fr/plugin/zk/theme/sky/Constants.java new file mode 100644 index 0000000..1fedbf6 --- /dev/null +++ b/src/main/java/com/fr/plugin/zk/theme/sky/Constants.java @@ -0,0 +1,13 @@ +package com.fr.plugin.xx.theme.sky; + +/** + * @author k + * @Project name finereport10 + * @description: + * @created on 2019/10/24 0:09. + * @email xx.xx@qq.com + * @Modified By + */ +public interface Constants { + String PLUGIN_ID = "com.fr.plugin.xx.theme.sky.jsd9988"; +} diff --git a/src/main/java/com/fr/plugin/zk/theme/sky/SkyComponent.java b/src/main/java/com/fr/plugin/zk/theme/sky/SkyComponent.java new file mode 100644 index 0000000..adfb3a4 --- /dev/null +++ b/src/main/java/com/fr/plugin/zk/theme/sky/SkyComponent.java @@ -0,0 +1,68 @@ +package com.fr.plugin.xx.theme.sky; + +import com.fr.decision.config.AppearanceConfig; +import com.fr.intelli.record.Focus; +import com.fr.intelli.record.Original; +import com.fr.plugin.PluginLicense; +import com.fr.plugin.PluginLicenseManager; +import com.fr.plugin.context.PluginContexts; +import com.fr.plugin.transform.FunctionRecorder; +import com.fr.plugin.xx.theme.sky.config.SkyThemeConfig; +import com.fr.record.analyzer.EnableMetrics; +import com.fr.web.struct.Component; +import com.fr.web.struct.Filter; +import com.fr.web.struct.category.ParserType; +import com.fr.web.struct.category.ScriptPath; +import com.fr.web.struct.category.StylePath; + +/** + * @author k + * @Project name starter + * @description: + * @created on 2019/10/24 22:13. + * @email xx.xx@qq.com + * @Modified By + */ +@EnableMetrics +@FunctionRecorder +public class SkyComponent extends Component { + public static final SkyComponent KEY = new SkyComponent(); + + private SkyComponent() { + + } + + + @Focus(id = Constants.PLUGIN_ID, text = "Visit Sky Theme", source = Original.PLUGIN) + @Override + public ScriptPath script() { + if (!PluginContexts.currentContext().isAvailable()) { + return ScriptPath.build(""); + } +// if (isBefore()) { +// return ScriptPath.build("/com/fr/plugin/xx/theme/sky/resource/oldtheme.js"); +// } + return ScriptPath.build("/com/fr/plugin/xx/theme/sky/resource/theme.js", ParserType.PLAIN); + } + + @Override + public StylePath style() { + if (!PluginContexts.currentContext().isAvailable()) { + return StylePath.build(""); + } +// if (isBefore()) { +// return StylePath.build("/com/fr/plugin/xx/theme/sky/resource/oldstyle.css", ParserType.DYNAMIC); +// } + return StylePath.build("/com/fr/plugin/xx/theme/sky/resource/style.css", ParserType.DYNAMIC); + } + + @Override + public Filter filter() { + return new Filter() { + @Override + public boolean accept() { + return Constants.PLUGIN_ID.equals(AppearanceConfig.getInstance().getThemeId()); + } + }; + } +} \ No newline at end of file diff --git a/src/main/java/com/fr/plugin/zk/theme/sky/SkyTheme.java b/src/main/java/com/fr/plugin/zk/theme/sky/SkyTheme.java new file mode 100644 index 0000000..3c87138 --- /dev/null +++ b/src/main/java/com/fr/plugin/zk/theme/sky/SkyTheme.java @@ -0,0 +1,57 @@ +package com.fr.plugin.xx.theme.sky; + +import com.fr.decision.fun.impl.AbstractThemeVariousProvider; +import com.fr.decision.web.MainComponent; +import com.fr.intelli.record.Focus; +import com.fr.intelli.record.Original; +import com.fr.locale.InterProviderFactory; +import com.fr.log.FineLoggerFactory; +import com.fr.plugin.transform.FunctionRecorder; +import com.fr.record.analyzer.EnableMetrics; +import com.fr.stable.fun.Authorize; +import com.fr.stable.version.ProductVersion; +import com.fr.stable.version.ProductVersionManager; +import com.fr.web.struct.Atom; + +import java.util.List; + +/** + * @author k + * @Project name starter + * @description: + * @created on 2019/10/24 22:13. + * @email xx.xx@qq.com + * @Modified By + */ +@FunctionRecorder +@Authorize(callSignKey = Constants.PLUGIN_ID) +@EnableMetrics +public class SkyTheme extends AbstractThemeVariousProvider { + + @Override + public Atom attach() { + return MainComponent.KEY; + } + + @Override + @Focus(id = Constants.PLUGIN_ID, text = "Sky Theme", source = Original.PLUGIN) + public Atom client() { + return SkyComponent.KEY; + } + + @Override + public String name() { + return InterProviderFactory.getProvider().getLocText("FS-THEME-SKY-TITLE"); + } + + @Override + public String text() { + return InterProviderFactory.getProvider().getLocText("FS-THEME-SKY-TITLE"); + } + + @Override + public String coverPath() { + return "com/fr/plugin/xx/theme/sky/resource/cover.png"; + } + +} \ No newline at end of file diff --git a/src/main/java/com/fr/plugin/zk/theme/sky/config/SkyThemeConfig.java b/src/main/java/com/fr/plugin/zk/theme/sky/config/SkyThemeConfig.java new file mode 100644 index 0000000..8de115f --- /dev/null +++ b/src/main/java/com/fr/plugin/zk/theme/sky/config/SkyThemeConfig.java @@ -0,0 +1,114 @@ +package com.fr.plugin.xx.theme.sky.config; + +import com.fr.config.*; +import com.fr.config.holder.Conf; +import com.fr.config.holder.factory.Holders; + +@Visualization(category = "天空主题扩展配置") +public class SkyThemeConfig extends DefaultConfiguration { + private static volatile SkyThemeConfig config = null; + + public static SkyThemeConfig getInstance() { + if (config == null) { + config = ConfigContext.getConfigInstance(SkyThemeConfig.class); + } + return config; + } + + @Identifier(value = "isOpen", name = "开起扩展配置", description = "开起后刷新生效", status = Status.HIDE, group = "core") + private Conf isOpen = Holders.simple(true); + + + @Identifier(value = "", name = "", description = "", status = Status.HIDE, group = "core") + private Conf test = Holders.simple(""); + + + @Identifier(value = "logoFontSize", name = "Logo字体大小", description = "", status = Status.SHOW, group = "logo") + private Conf logoFontSize = Holders.simple(16D); + + + @Identifier(value = "logoFontColor", name = "Logo字体颜色", description = "请使用#FFFFFF或rgb(255,255,255)", status = Status.SHOW, group = "logo") + private Conf logoFontColor = Holders.simple("#FFFFFF"); + + + @Identifier(value = "navFontSize", name = "导航字体大小", description = "", status = Status.SHOW, group = "nav") + private Conf navFontSize = Holders.simple(12); + + + @Identifier(value = "navFontColor", name = "导航字体颜色", description = "请使用#FFFFFF或rgb(255,255,255)", status = Status.SHOW, group = "nav") + private Conf navFontColor = Holders.simple("#FFFFFF"); + + + @Identifier(value = "topFontSize", name = "顶部字体大小", description = "", status = Status.SHOW, group = "top") + private Conf topFontSize = Holders.simple(13); + + + @Identifier(value = "topFontColor", name = "顶部字体颜色", description = "请使用#FFFFFF或rgb(255,255,255)", status = Status.SHOW, group = "top") + private Conf topFontColor = Holders.simple("#FFFFFF"); + + + @Identifier(value = "childMenuFontSize", name = "子菜单字体大小", description = "", status = Status.SHOW, group = "child") + private Conf childMenuFontSize = Holders.simple(14); + + + @Identifier(value = "childMenuFontColor", name = "子菜单字体颜色", description = "请使用#FFFFFF或rgb(255,255,255)", status = Status.HIDE, group = "child") + private Conf childMenuFontColor = Holders.simple("#3d4d66"); + + + @Identifier(value = "menuWidth", name = "左侧菜单宽度", description = "", status = Status.SHOW, group = "leftMenu") + private Conf leftMenuWidth = Holders.simple(240); + + @Identifier(value = "menuMarginColor", name = "菜单间隔颜色", description = "请使用#FFFFFF或rgb(255,255,255)", status = Status.SHOW, group = "leftMenu") + private Conf leftMenuColor = Holders.simple("#c1c1c1"); + + public Boolean getIsOpen() { + return isOpen.get(); + } + + public Double getLogoFontSize() { + return logoFontSize.get(); + } + + public String getLogoFontColor() { + return logoFontColor.get(); + } + + public Integer getNavFontSize() { + return navFontSize.get(); + } + + public String getNavFontColor() { + return navFontColor.get(); + } + + public Integer getTopFontSize() { + return topFontSize.get(); + } + + public String getTopFontColor() { + return topFontColor.get(); + } + + public Integer getChildMenuFontSize() { + return childMenuFontSize.get(); + } + + public String getChildMenuFontColor() { + return childMenuFontColor.get(); + } + + public Integer getLeftMenuWidth() { + return leftMenuWidth.get(); + } + + + public String getLeftMenuColor() { + return leftMenuColor.get(); + } + + + @Override + public String getNameSpace() { + return "SkyThemeConfig"; + } +} diff --git a/src/main/java/com/fr/plugin/zk/theme/sky/locale/SkyLocaleFinder.java b/src/main/java/com/fr/plugin/zk/theme/sky/locale/SkyLocaleFinder.java new file mode 100644 index 0000000..ba2d9da --- /dev/null +++ b/src/main/java/com/fr/plugin/zk/theme/sky/locale/SkyLocaleFinder.java @@ -0,0 +1,14 @@ + +package com.fr.plugin.xx.theme.sky.locale; + +import com.fr.plugin.xx.theme.sky.config.SkyThemeConfig; +import com.fr.stable.fun.impl.AbstractLocaleFinder; + +public class SkyLocaleFinder extends AbstractLocaleFinder { + @Override + public String find() { + SkyThemeConfig.getInstance(); + return "com/fr/plugin/xx/theme/sky/locale/locale"; + } +} + diff --git a/src/main/java/com/fr/plugin/zk/theme/sky/web/ActionHandlerProvider.java b/src/main/java/com/fr/plugin/zk/theme/sky/web/ActionHandlerProvider.java new file mode 100644 index 0000000..6667170 --- /dev/null +++ b/src/main/java/com/fr/plugin/zk/theme/sky/web/ActionHandlerProvider.java @@ -0,0 +1,23 @@ +package com.fr.plugin.xx.theme.sky.web; + +import com.fr.decision.fun.HttpHandler; +import com.fr.decision.fun.impl.AbstractHttpHandlerProvider; + +/** + * @author k + * @Project name finereport10 + * @description: + * @created on 2019/10/27 16:43. + * @email xx.xx@qq.com + * @Modified By + */ +public class ActionHandlerProvider extends AbstractHttpHandlerProvider { + private HttpHandler[] actions = new HttpHandler[]{new GetAllMenuHttpHandler(),new ConfigHttpHandler()}; + public ActionHandlerProvider() { + } + + @Override + public HttpHandler[] registerHandlers() { + return this.actions; + } +} diff --git a/src/main/java/com/fr/plugin/zk/theme/sky/web/AliasBridge.java b/src/main/java/com/fr/plugin/zk/theme/sky/web/AliasBridge.java new file mode 100644 index 0000000..382184e --- /dev/null +++ b/src/main/java/com/fr/plugin/zk/theme/sky/web/AliasBridge.java @@ -0,0 +1,25 @@ +package com.fr.plugin.xx.theme.sky.web; + +import com.fr.decision.fun.impl.AbstractURLAliasProvider; +import com.fr.decision.webservice.url.alias.URLAlias; +import com.fr.decision.webservice.url.alias.URLAliasFactory; + +/** + * @author k + * @Project name finereport10 + * @description: + * @created on 2019/10/27 16:44. + * @email xx.xx@qq.com + * @Modified By + */ +public class AliasBridge extends AbstractURLAliasProvider { + public AliasBridge() { + } + + @Override + public URLAlias[] registerAlias() { + return new URLAlias[]{ + URLAliasFactory.createPluginAlias("/sky/getAllMenu", "/sky/getAllMenu", true), + URLAliasFactory.createPluginAlias("/sky/getConfig", "/sky/getConfig", true)}; + } +} \ No newline at end of file diff --git a/src/main/java/com/fr/plugin/zk/theme/sky/web/ConfigHttpHandler.java b/src/main/java/com/fr/plugin/zk/theme/sky/web/ConfigHttpHandler.java new file mode 100644 index 0000000..5ade4c7 --- /dev/null +++ b/src/main/java/com/fr/plugin/zk/theme/sky/web/ConfigHttpHandler.java @@ -0,0 +1,68 @@ +package com.fr.plugin.xx.theme.sky.web; + +import com.fr.cert.token.lang.Collections; +import com.fr.decision.fun.impl.BaseHttpHandler; +import com.fr.decision.webservice.Response; +import com.fr.decision.webservice.bean.config.StyleConfigBean; +import com.fr.decision.webservice.bean.entry.EntryBean; +import com.fr.decision.webservice.v10.config.ConfigService; +import com.fr.decision.webservice.v10.entry.EntryService; +import com.fr.decision.webservice.v10.login.LoginService; +import com.fr.decision.webservice.v10.user.UserService; +import com.fr.log.FineLoggerFactory; +import com.fr.plugin.xx.theme.sky.config.SkyThemeConfig; +import com.fr.stable.StringUtils; +import com.fr.third.fasterxml.jackson.databind.ObjectMapper; +import com.fr.third.springframework.beans.BeanUtils; +import com.fr.third.springframework.web.bind.annotation.RequestMethod; +import com.fr.web.utils.WebUtils; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.util.*; +import java.util.stream.Collectors; + +/** + * @author k + * @Project name finereport10 + * @description: + * @created on 2019/10/27 16:45. + * @email xx.xx@qq.com + * @Modified By + */ +public class ConfigHttpHandler extends BaseHttpHandler { + public ConfigHttpHandler() { + } + + private static final ObjectMapper objectMapper = new ObjectMapper(); + + @Override + public RequestMethod getMethod() { + return RequestMethod.GET; + } + + @Override + public String getPath() { + return "/sky/getConfig"; + } + + @Override + public boolean isPublic() { + return true; + } + + @Override + public void handle(HttpServletRequest request, HttpServletResponse response) throws Exception { + + String type = WebUtils.getHTTPRequestParameter(request, "type"); + if (StringUtils.isNotEmpty(type) && "style".equals(type)) { + StyleConfigBean bean = ConfigService.getInstance().getStyleConfig(); + String valueAsString = objectMapper.writerWithDefaultPrettyPrinter().writeValueAsString(Response.ok(bean)); + WebUtils.printAsString(response, valueAsString); + return; + } + SkyThemeConfig config = SkyThemeConfig.getInstance(); + WebUtils.printAsString(response, objectMapper.writerWithDefaultPrettyPrinter().writeValueAsString(Response.ok(config))); + } + +} \ No newline at end of file diff --git a/src/main/java/com/fr/plugin/zk/theme/sky/web/EntryBeanModel.java b/src/main/java/com/fr/plugin/zk/theme/sky/web/EntryBeanModel.java new file mode 100644 index 0000000..6e563b7 --- /dev/null +++ b/src/main/java/com/fr/plugin/zk/theme/sky/web/EntryBeanModel.java @@ -0,0 +1,166 @@ +package com.fr.plugin.xx.theme.sky.web; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author k + * @Project name finereport10 + * @description: + * @created on 2019/10/27 16:44. + * @email xx.xx@qq.com + * @Modified By + */ +public class EntryBeanModel { + private String id; + private String pId; + private String text; + private String path; + private String description; + private int deviceType = 1; + private int entryType; + private String nodeIcon; + private String mobileNodeIcon; + private long sortIndex; + private boolean isParent; + private boolean open; + private String value; + private String icon; + private String cover; + private List childs = new ArrayList(); + + public EntryBeanModel() { + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getpId() { + return pId; + } + + public void setpId(String pId) { + this.pId = pId; + } + + public String getText() { + return text; + } + + public void setText(String text) { + this.text = text; + } + + public String getPath() { + return path; + } + + public void setPath(String path) { + this.path = path; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public int getDeviceType() { + return deviceType; + } + + public void setDeviceType(int deviceType) { + this.deviceType = deviceType; + } + + public int getEntryType() { + return entryType; + } + + public void setEntryType(int entryType) { + this.entryType = entryType; + } + + public String getNodeIcon() { + return nodeIcon; + } + + public void setNodeIcon(String nodeIcon) { + this.nodeIcon = nodeIcon; + } + + public String getMobileNodeIcon() { + return mobileNodeIcon; + } + + public void setMobileNodeIcon(String mobileNodeIcon) { + this.mobileNodeIcon = mobileNodeIcon; + } + + public long getSortIndex() { + return sortIndex; + } + + public void setSortIndex(long sortIndex) { + this.sortIndex = sortIndex; + } + + public boolean isIsParent() { + return this.isParent; + } + + public void setIsParent(boolean isParent) { + this.isParent = isParent; + } + + public boolean isOpen() { + return open; + } + + public void setOpen(boolean open) { + this.open = open; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + public String getIcon() { + return icon; + } + + public void setIcon(String icon) { + this.icon = icon; + } + + public String getCover() { + return cover; + } + + public void setCover(String cover) { + this.cover = cover; + } + + public List getChilds() { + return childs; + } + + public void addChild(EntryBeanModel var1) { + this.childs.add(var1); + } + + public void setChilds(List var1) { + this.childs = var1; + } +} diff --git a/src/main/java/com/fr/plugin/zk/theme/sky/web/GetAllMenuHttpHandler.java b/src/main/java/com/fr/plugin/zk/theme/sky/web/GetAllMenuHttpHandler.java new file mode 100644 index 0000000..e6ac483 --- /dev/null +++ b/src/main/java/com/fr/plugin/zk/theme/sky/web/GetAllMenuHttpHandler.java @@ -0,0 +1,160 @@ +package com.fr.plugin.xx.theme.sky.web; + +import com.fr.cert.token.lang.Collections; +import com.fr.decision.fun.impl.BaseHttpHandler; +import com.fr.decision.webservice.Response; +import com.fr.decision.webservice.bean.config.StyleConfigBean; +import com.fr.decision.webservice.bean.entry.EntryBean; +import com.fr.decision.webservice.v10.config.ConfigService; +import com.fr.decision.webservice.v10.entry.EntryService; +import com.fr.decision.webservice.v10.login.LoginService; +import com.fr.decision.webservice.v10.user.UserService; +import com.fr.log.FineLoggerFactory; +import com.fr.stable.StringUtils; +import com.fr.third.fasterxml.jackson.databind.ObjectMapper; +import com.fr.third.springframework.beans.BeanUtils; +import com.fr.third.springframework.web.bind.annotation.RequestMethod; +import com.fr.web.utils.WebUtils; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.util.*; +import java.util.stream.Collectors; + +/** + * @author k + * @Project name finereport10 + * @description: + * @created on 2019/10/27 16:45. + * @email xx.xx@qq.com + * @Modified By + */ +public class GetAllMenuHttpHandler extends BaseHttpHandler { + public GetAllMenuHttpHandler() { + } + + private static final ObjectMapper objectMapper = new ObjectMapper(); + + @Override + public RequestMethod getMethod() { + return RequestMethod.GET; + } + + @Override + public String getPath() { + return "/sky/getAllMenu"; + } + + @Override + public boolean isPublic() { + return true; + } + + @Override + public void handle(HttpServletRequest request, HttpServletResponse response) throws Exception { + EntryBeanModel entryBeanModel = new EntryBeanModel(); + try { + String userName = LoginService.getInstance().getUserNameFromRequest(request); + String userId = UserService.getInstance().getCurrentUserId(userName); + List entries = EntryService.getInstance().getAllEntries(userId); + entryBeanModel.setChilds(getList(entries)); + entryBeanModel.setId(""); + }catch (Exception e){ + FineLoggerFactory.getLogger().error(e.getMessage(),e); + entryBeanModel.setChilds(new ArrayList<>()); + } + WebUtils.printAsString(response, objectMapper.writerWithDefaultPrettyPrinter().writeValueAsString(Response.ok(entryBeanModel))); + } + + private List getList(List entries){ + if(Collections.isEmpty(entries)){ + return new ArrayList<>(); + } + EntryBeanModel finalEntryBeanModel = new EntryBeanModel(); + Map entryMap = new HashMap<>(); + Iterator entrisList = entries.iterator(); + EntryBean entryBean; + EntryBeanModel entryBeanModel = null; + // 获取整个顶层目录 + while (entrisList.hasNext()) { + entryBean = (EntryBean) entrisList.next(); + if (entryBean != null && entryBean.getDeviceType() % 2 != 0) { + entryBeanModel = new EntryBeanModel(); + BeanUtils.copyProperties(entryBean, entryBeanModel); + if (entryBean.isIsParent()) { + entryMap.put(entryBean.getId(), entryBeanModel); + } + if ("decision-directory-root".equalsIgnoreCase(entryBeanModel.getId())) { + finalEntryBeanModel = entryBeanModel; + } + } + } + entrisList = entries.iterator(); + while (entrisList.hasNext()) { + entryBean = (EntryBean) entrisList.next(); + if (entryBean != null && entryBean.getDeviceType() % 2 != 0) { + EntryBeanModel beanModel; + if (entryBean.getEntryType() == 3) { + String parentId = entryBean.getpId(); + beanModel = entryMap.get(entryBean.getId()); + if (StringUtils.isNotBlank(parentId) && beanModel != null) { + EntryBeanModel entry = entryMap.get(parentId); + if(entry!=null){ + entry.addChild(beanModel); + } + } + } else { + entryBeanModel = new EntryBeanModel(); + BeanUtils.copyProperties(entryBean, entryBeanModel); + if (StringUtils.isNotBlank(entryBeanModel.getpId())) { + beanModel = entryMap.get(entryBeanModel.getpId()); + if(beanModel != null){ + beanModel.addChild(entryBeanModel); + } + } + } + } + } + List list = new ArrayList<>(); + finalEntryBeanModel.setChilds(menu(finalEntryBeanModel.getChilds())); + list.add(finalEntryBeanModel); + return list; + } + + private List menu(List models) { + List entryBeanModels = new ArrayList<>(); + try { + models = models.stream().sorted((o1, o2) -> { + if (o1 == null && o2 == null) { + return 0; + } + if (o1 == null) { + return 1; + } + if (o2 == null) { + return -1; + } + return Long.compare(o1.getSortIndex(), o2.getSortIndex()); + }).collect(Collectors.toList()); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + for (EntryBeanModel entryBeanModel : models) { + List childRoot = new ArrayList<>(); + menuEntry(childRoot, entryBeanModel.getChilds()); + entryBeanModel.setChilds(childRoot); + entryBeanModels.add(entryBeanModel); + } + return entryBeanModels; + } + + private void menuEntry(List childRoot, List child) { + for (EntryBeanModel entryBeanModel : child) { + if (!Collections.isEmpty(entryBeanModel.getChilds())) { + menuEntry(childRoot, entryBeanModel.getChilds()); + } + entryBeanModel.setValue(entryBeanModel.getId()); + childRoot.add(entryBeanModel); + } + } +} \ No newline at end of file diff --git a/src/main/resources/com/fr/plugin/zk/theme/sky/locale/locale.properties b/src/main/resources/com/fr/plugin/zk/theme/sky/locale/locale.properties new file mode 100644 index 0000000..7a86f25 --- /dev/null +++ b/src/main/resources/com/fr/plugin/zk/theme/sky/locale/locale.properties @@ -0,0 +1,2 @@ +FS-FRAME-SEARCH-PLACEHOLDER = Search content +FS-THEME-SKY-TITLE = Sky Theme \ No newline at end of file diff --git a/src/main/resources/com/fr/plugin/zk/theme/sky/locale/locale_en_US.properties b/src/main/resources/com/fr/plugin/zk/theme/sky/locale/locale_en_US.properties new file mode 100644 index 0000000..7a86f25 --- /dev/null +++ b/src/main/resources/com/fr/plugin/zk/theme/sky/locale/locale_en_US.properties @@ -0,0 +1,2 @@ +FS-FRAME-SEARCH-PLACEHOLDER = Search content +FS-THEME-SKY-TITLE = Sky Theme \ No newline at end of file diff --git a/src/main/resources/com/fr/plugin/zk/theme/sky/locale/locale_zh_CN.properties b/src/main/resources/com/fr/plugin/zk/theme/sky/locale/locale_zh_CN.properties new file mode 100644 index 0000000..d69740f --- /dev/null +++ b/src/main/resources/com/fr/plugin/zk/theme/sky/locale/locale_zh_CN.properties @@ -0,0 +1,2 @@ +FS-FRAME-SEARCH-PLACEHOLDER = \u641C\u7D22\u5167\u5BB9 +FS-THEME-SKY-TITLE = \u5929\u7A7A\u4E3B\u9898 \ No newline at end of file diff --git a/src/main/resources/com/fr/plugin/zk/theme/sky/locale/locale_zh_TW.properties b/src/main/resources/com/fr/plugin/zk/theme/sky/locale/locale_zh_TW.properties new file mode 100644 index 0000000..41d5b17 --- /dev/null +++ b/src/main/resources/com/fr/plugin/zk/theme/sky/locale/locale_zh_TW.properties @@ -0,0 +1,2 @@ +FS-FRAME-SEARCH-PLACEHOLDER = \u641C\u7D22\u5167\u5BB9 +FS-THEME-SKY-TITLE = \u5929\u7A7A\u4E3B\u984C \ No newline at end of file diff --git a/src/main/resources/com/fr/plugin/zk/theme/sky/resource/cover.png b/src/main/resources/com/fr/plugin/zk/theme/sky/resource/cover.png new file mode 100644 index 0000000..6ef755f Binary files /dev/null and b/src/main/resources/com/fr/plugin/zk/theme/sky/resource/cover.png differ diff --git a/src/main/resources/com/fr/plugin/zk/theme/sky/resource/fonts/icomoon.eot b/src/main/resources/com/fr/plugin/zk/theme/sky/resource/fonts/icomoon.eot new file mode 100644 index 0000000..0817dd0 Binary files /dev/null and b/src/main/resources/com/fr/plugin/zk/theme/sky/resource/fonts/icomoon.eot differ diff --git a/src/main/resources/com/fr/plugin/zk/theme/sky/resource/fonts/icomoon.svg b/src/main/resources/com/fr/plugin/zk/theme/sky/resource/fonts/icomoon.svg new file mode 100644 index 0000000..982f4af --- /dev/null +++ b/src/main/resources/com/fr/plugin/zk/theme/sky/resource/fonts/icomoon.svg @@ -0,0 +1,383 @@ + + + +Generated by IcoMoon + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/com/fr/plugin/zk/theme/sky/resource/fonts/icomoon.ttf b/src/main/resources/com/fr/plugin/zk/theme/sky/resource/fonts/icomoon.ttf new file mode 100644 index 0000000..d23d441 Binary files /dev/null and b/src/main/resources/com/fr/plugin/zk/theme/sky/resource/fonts/icomoon.ttf differ diff --git a/src/main/resources/com/fr/plugin/zk/theme/sky/resource/fonts/icomoon.woff b/src/main/resources/com/fr/plugin/zk/theme/sky/resource/fonts/icomoon.woff new file mode 100644 index 0000000..85cd1b4 Binary files /dev/null and b/src/main/resources/com/fr/plugin/zk/theme/sky/resource/fonts/icomoon.woff differ diff --git a/src/main/resources/com/fr/plugin/zk/theme/sky/resource/image/bg_search.png b/src/main/resources/com/fr/plugin/zk/theme/sky/resource/image/bg_search.png new file mode 100644 index 0000000..4469462 Binary files /dev/null and b/src/main/resources/com/fr/plugin/zk/theme/sky/resource/image/bg_search.png differ diff --git a/src/main/resources/com/fr/plugin/zk/theme/sky/resource/image/icon_hide.png b/src/main/resources/com/fr/plugin/zk/theme/sky/resource/image/icon_hide.png new file mode 100644 index 0000000..6923094 Binary files /dev/null and b/src/main/resources/com/fr/plugin/zk/theme/sky/resource/image/icon_hide.png differ diff --git a/src/main/resources/com/fr/plugin/zk/theme/sky/resource/image/icon_show.png b/src/main/resources/com/fr/plugin/zk/theme/sky/resource/image/icon_show.png new file mode 100644 index 0000000..03008c0 Binary files /dev/null and b/src/main/resources/com/fr/plugin/zk/theme/sky/resource/image/icon_show.png differ diff --git a/src/main/resources/com/fr/plugin/zk/theme/sky/resource/style.css b/src/main/resources/com/fr/plugin/zk/theme/sky/resource/style.css new file mode 100644 index 0000000..f01ef5b --- /dev/null +++ b/src/main/resources/com/fr/plugin/zk/theme/sky/resource/style.css @@ -0,0 +1,573 @@ +.root-dashboard { + width: 100%; + height: 100% +} + +.dec-frame-popover .dec-frame-text { + color: #3d4d66 +} + +.dec-frame-platform-list-item { + color: #3d4d66 +} + +.dec-frame-platform-list-item-active { + color: #3d4d66 +} + +.dec-frame-popover { + background-color: #f5f7fe !important +} + +.manage-scroll-view { + background-color: #fff +} + +.k-sky-button-group { + background-color: #f5f7fe +} + +.tab-other { + background-color: #f5f7fe +} + +.dec-workbench-tabs-button-wrapper.dec-frame-tab-pane-tabs-normal-item.bi-border-left.bi-border-right.bi-absolute-layout.active { + background-color: #fff +} + +.segment-list-text-item { + width: 100%; + left: 30px +} + +@font-face { + font-family: icomoon; + src: url(${fineServletURL}/resources?path=/com/fr/plugin/xx/theme/sky/resource/fonts/icomoon.eot); + src: url(${fineServletURL}/resources?path=/com/fr/plugin/xx/theme/sky/resource/fonts/icomoon.eot#iefix) format('embedded-opentype'), url(${fineServletURL}/resources?path=/com/fr/plugin/xx/theme/sky/resource/fonts/icomoon.ttf) format('truetype'), url(${fineServletURL}/resources?path=/com/fr/plugin/xx/theme/sky/resource/fonts/icomoon.woff) format('woff'), url(${fineServletURL}/resources?path=/com/fr/plugin/xx/theme/sky/resource/fonts/icomoon.svg#icomoon) format('svg'); + font-weight: 400; + font-style: normal +} + +.fs-frame-header .node-navi .node-navi-li { + width: 90px; + height: 60px +} + +.fs-frame-header .node-navi { + position: absolute; + top: 40px; + left: 0; + width: 100%; + height: 60px; + border-bottom: 3px solid #f2aa3b; + background-color: #4f73c2; + background-color: rgba(255, 255, 255, .15) !important +} + +.node-navi li { + position: relative; + float: left; + left: 0; + display: block; + height: 60px; + line-height: 60px; + color: #fff; + font-size: 14px; + padding: 0; + cursor: pointer +} + +.search-button { + top: 0 +} + +.dec-account { + z-index: 1 +} + +.node-navi li.select { + background-color: #f2aa3b +} + +.node-navi-item { + width: 90px; + height: 40px; + margin-top: 10px; + border-right: 1px solid #839cd4; + border-right: 1px solid rgba(255, 255, 255, .3) +} + +.node-navi-item .node-navi-title { + font-size: 12px; + color: #fff; + text-align: center; + line-height: 20px; + height: 20px; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis +} + +.node-navi-item .node-navi-icon { + font-size: 16px; + line-height: 20px; + display: block; + font-family: icomoon !important; + speak: none; + font-style: normal; + font-weight: 400; + font-variant: normal; + text-transform: none; + text-align: center; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale +} + +.menu-border { + border-bottom: 3px solid #f2aa3b; + background-color: #4f73c2; + overflow-x: auto !important; + overflow-y: hidden !important +} + +.config-icon i { + font-size: 16px; +} + +.segment-buton-conetent { + line-height: 60px !important +} + +.segment-buton-conetent i { + height: 45px +} + +.menu-color { + border-right: 1px solid rgba(255, 255, 255, .3); + color: #fff !important +} + +.dec-frame-panel.dec-frame-icon { + color: #fff +} + +.fs-frame-navi .menu-message-color { + color: #fff +} + +.menu-color.active { + background-color: #f2aa3b !important +} + +.menu-version { +} + +.menu-icon-border { + border-color: #4f73c2 +} + +.node-navi-icon { + font-family: icomoon !important; + font-style: normal; + font-weight: 400; + font-variant: normal; + text-transform: none; + font-size: 15px +} + +.node-navi-icon-0:before { + content: '\e900' +} + +.node-navi-icon-1:before { + content: '\e901' +} + +.node-navi-icon-2:before { + content: '\e902' +} + +.node-navi-icon-3:before { + content: '\e903' +} + +.node-navi-icon-4:before { + content: '\e904' +} + +.node-navi-icon-5:before { + content: '\e905' +} + +.node-navi-icon-6:before { + content: '\e906' +} + +.node-navi-icon-7:before { + content: '\e907' +} + +.node-navi-icon-8 { + font-family: icomoon !important; + font-style: normal; + font-weight: 400; + font-variant: normal; + text-transform: none +} + +.node-navi-icon-8:before { + content: '\e908' +} + +.node-navi-icon-9:before { + content: '\e909' +} + +.node-navi-icon-10:before { + content: '\e90a' +} + +.node-navi-icon-11:before { + content: '\e90b' +} + +.node-navi-icon-12:before { + content: '\e90c' +} + +.node-navi-icon-13:before { + content: '\e90d' +} + +.node-navi-icon-14:before { + content: '\e90e' +} + +.node-navi-icon-15:before { + content: '\e90f' +} + +.node-navi-icon-16:before { + content: '\e910' +} + +.node-navi-icon-17:before { + content: '\e911' +} + +.node-navi-icon-18:before { + content: '\e912' +} + +.node-navi-icon-19:before { + content: '\e000' +} + +.node-navi-icon-20:before { + content: '\e001' +} + +.node-navi-icon-21:before { + content: '\e002' +} + +.node-navi-icon-22:before { + content: '\e003' +} + +.node-navi-icon-23:before { + content: '\e004' +} + +.node-navi-icon-24:before { + content: '\e005' +} + +.node-navi-icon-25:before { + content: '\e006' +} + +.node-navi-icon-26:before { + content: '\e007' +} + +.node-navi-icon-27:before { + content: '\e008' +} + +.node-navi-icon-28:before { + content: '\e009' +} + +.node-navi-icon-29:before { + content: '\e010' +} + +.node-navi-icon-30:before { + content: '\e011' +} + +.node-navi-icon-31:before { + content: '\e012' +} + +.node-navi-icon-32:before { + content: '\e013' +} + +.node-navi-icon-more { + width: 100px; + height: 40px; + line-height: 40px; + text-align: center; + white-space: nowrap; + text-overflow: ellipsis; + position: absolute !important; + margin: 0 auto; + float: right; + right: 0; + color: #fff; + top: 0 +} + +.node-navi-icon-more:before { + content: '\e055' +} + +.fs-frame-navi .icon-navi-search:before { + content: '\e909' +} + +.fs-frame-navi .icon-navi-favorite:before { + content: '\e90a' +} + +.fs-frame-navi .icon-navi-message:before { + content: '\e90b' +} + +.fs-frame-navi .icon-navi-admin:before { + content: '\e90c' +} + +.fs-admin-combo, .fs-message-combo { + top: 40px +} + +i { + font-family: fui, icomoon +} + +i.icon-remove-favorite:before { + content: '\e117' +} + +.fs-frame-header { + background-color: #305ab7; + height: 73px !important; + color: #fff !important +} + +/*.fs-frame-banner .bi-flex-vertical-center-adapt-layout {*/ +/* top: 4px*/ +/*}*/ + +.dec-frame-header-account { + top: 0 !important +} + +.menu-message-color { + top: 0 !important +} + +.header-background { + border-color: #305ab7; + background-color: #305ab7 +} + +.header-color { + color: #fff +} + +.fs-frame-banner { + color: #fff +} + +.fs-frame-banner .fs-banner-logo { + left: 15px; + top: 0px; + cursor: pointer; +} + +.fs-frame-banner .fs-banner-title.on { + height: auto; + white-space: normal; + background-color: #6e8bcd; + background-color: rgba(255, 255, 255, .3) +} + +.fs-frame-banner .fs-banner-title { + cursor: pointer; + top: 0px; + left: 25px; + font-size: 16px; + line-height: 32px; + height: 32px; + max-width: 500px; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + z-index: 9999; + cursor: default +} + +body { + background-image: none !important +} + +a.fs-menu-item.select i.icon-tree-leaf:before { + content: '' +} + +a.fs-menu-item i.icon-tree-fork:before { + content: '\e61f' +} + +a.fs-menu-item.on i.icon-tree-fork:before { + content: '\e624' +} + +.fs-tab .fs-tab-btns { + color: #333; + -moz-border-radius: 0 !important; + -webkit-border-radius: 0 !important; + border-radius: 0 !important; + border-right: 1px solid #fff; + border-right: 1px solid rgba(255, 255, 255, .8) !important; + background-color: #eaeaea !important +} + +.fs-tab-btns .select { + color: #3059b8 !important +} + +.fs-tab-btns .fui-seb { + -moz-border-radius: 0 !important; + -webkit-border-radius: 0 !important; + border-radius: 0 !important; + border-right: 1px solid #fff; + background-color: #eaeaea !important +} + +.fs-tab-btns .fui-bsb { + background-color: #fff !important +} + +.fs-tab .fs-tab-homepage { + width: 50px; + border-right: 1px solid #fff !important +} + +.fs-tab .fs-tab-exd { + position: relative; + float: left; + width: 35px; + height: 30px; + line-height: 30px; + text-align: center; + font-size: 18px; + border-right: 1px solid #fff; + padding-top: 3px; + cursor: pointer +} + +.fs-tab .fs-tab-exd .icon-tab-exd:before { + content: '\e90d' +} + +.fs-tab .fs-tab-exd.off .icon-tab-exd:before { + content: '\e911' +} + +.fs-tab .fs-tab-names .fs-tab-item { + -moz-border-radius: 0 !important; + -webkit-border-radius: 0 !important; + border-radius: 0 !important; + border-right: 1px solid #fff; + background-color: #eaeaea; + color: #333 +} + +.fui-bsc { + color: #3059b8 +} + +.fui-seb { + background-color: transparent +} + +iframe { + border: 0 +} + +iframe.fs-tab-content-item { + border: 0 solid #ccc !important +} + +.fs-menu-hide { + top: 48%; + background-image: url(${fineServletURL}/resources?path=/com/fr/plugin/xx/theme/sky/resource/image/icon_hide.png) +} + +.fs-menu-show { + top: 48%; + background-image: url(${fineServletURL}/resources?path=/com/fr/plugin/xx/theme/sky/resource/image/icon_show.png) +} + +@media \0screen\,screen\9 { + .fs-tab .fs-tab-btns { + z-index: 1 + } + + .fs-tab iframe.fs-tab-content-item { + margin: -4px; + z-index: 0 + } +} + +.node-navi-icon-addanysis:before { + content: '\e692'; + font-family: icomoon, bi, fui +} + +.node-navi-icon-addanysis { + line-height: 38px !important +} + +.node-navi-icon-datasetting:before { + content: '\e693'; + font-family: icomoon, bi, fui +} + +.root-menus-tool { + cursor: ew-resize +} + +.root-manage-menus-tree { + border-right: #fff; + border-right-width: 0; + border-right-style: none +} + +.bi-segment-button .menu-label { + padding-left: 3px; + padding-right: 3px +} + +.ie-pop-icon { + top: -13px !important; +} + +.config-menu-font { + width: 40px; +} \ No newline at end of file diff --git a/src/main/resources/com/fr/plugin/zk/theme/sky/resource/theme.js b/src/main/resources/com/fr/plugin/zk/theme/sky/resource/theme.js new file mode 100644 index 0000000..11450da --- /dev/null +++ b/src/main/resources/com/fr/plugin/zk/theme/sky/resource/theme.js @@ -0,0 +1,5185 @@ +"use strict"; + +function _defineProperty(e, t, i) { + return ( + t in e + ? Object.defineProperty(e, t, { + value: i, + enumerable: !0, + configurable: !0, + writable: !0, + }) + : (e[t] = i), + e + ); +} + +var MenuEntries = [], + TabSelectID = Fix.define({ + commSelectId: "", + manageSelectId: "", + willSelectId: "", + }); +var UTIL = { + themeConfig: { + leftMenuWidth: 240, + leftMenuMax: 240 + 300, + }, + openTab: function (e) { + var t; + switch (e.entryType) { + case DecCst.Entries.Entry_Type.BI_REPORT: + t = + Dec.fineServletURL + + "/v10/entry/access/" + + e.id + + "?dashboardType=" + + (BI.isNotNull(e.homePageType) ? "5" : "4"); + break; + case DecCst.Entries.Entry_Type.SEARCH_SHARE: + t = + Dec.fineServletURL + + "/v5/design/report/" + + e.id + + "/view?entryType=6"; + break; + case DecCst.Entries.Entry_Type.LINK_TYPE: + t = e.path || e.pcURL; + break; + default: + t = BI.isKey(e.id) + ? Dec.fineServletURL + + "/v10/entry/access/" + + e.id + + "?dashboardType=5" + : "about:blank"; + } + BI.Providers.getProvider("dec.provider.k.sky.tab_pane").behaviour( + "addCardByName", + e.id, + { + text: e.text, + value: e.id, + entry: 1, + cardType: {src: t, isEntry: 1}, + } + ); + }, + goHome: function () { + (TabSelectID.commSelectId = -1), + (TabSelectID.manageSelectId = -1), + BI.Providers.getProvider("dec.provider.k.sky.tab_pane").behaviour( + "showCardByName", + -1 + ); + }, + getAllStyle: function (action) { + var self = this; + BI.$.ajax({ + url: Dec.fineServletURL + "/url/sky/getConfig?type=style", + type: "GET", + headers: { + Authorization: "Bearer " + BI.Cache.getCookie(DecCst.Cookie.TOKEN), + }, + // headers: i.headers, + contentType: "application/json", + dataType: "json", + cache: !1, + async: !0, + error: function (e) { + }, + complete: function (e, t) { + e = BI.jsonDecode(e.responseText); + if (e.data.colorScheme === 0) { + self.getConfigStyle(action); + return; + } + var colors = e.data.customColors; + var headerColor = colors[0]; + var headerTextColor = findTextColor(headerColor); + var mainMenu = colors[2]; + var mainMenuText = findTextColor(mainMenu); + var mainMenuActive = colors[1]; + var leftMenu = colors[3]; + var userTextColor = colors[5]; + var activeColor = colors[4]; + var activeTextColor = findTextColor(activeColor); + if (e.data.colorScheme === 1) { + //深色模式 + headerColor = "#1972c6"; + headerTextColor = "#edf3fa"; + mainMenu = "#0a1733"; + leftMenu = "#21304c"; + mainMenuActive = "#233f66"; + activeColor = "#233f66"; + userTextColor = "#edf3fa"; + mainMenuText = "#edf3fa"; + activeTextColor = "#edf3fa"; + } + var headerImg = ""; + if (e.data.headBgMode === 1 && e.data.headerType === 2) { + var imgSrc = + Dec.fineServletURL + "/v10/attach/image/" + e.data.headBgImgId; + headerImg = + ".fs-frame-banner{background: url('" + + imgSrc + + "'); background-size: 100% 100%; background-repeat: no-repeat;}\n .header-background{background-color:transparent;border-color:transparent;}\n"; + } + var headerCss = $( + '" + ); + $("head").append(headerCss); + self.getConfigStyle(action); + }, + }); + }, + getConfigStyle: function (action) { + var self = this; + BI.$.ajax({ + url: Dec.fineServletURL + "/url/sky/getConfig", + type: "GET", + headers: { + Authorization: "Bearer " + BI.Cache.getCookie(DecCst.Cookie.TOKEN), + }, + // headers: i.headers, + contentType: "application/json", + dataType: "json", + cache: !1, + async: !0, + error: function (e) { + }, + complete: function (e, t) { + var data = BI.jsonDecode(e.responseText); + if (data.data) { + var detailData = data.data; + self.themeConfig.leftMenuWidth = detailData.leftMenuWidth; + window.letMenuWidt = UTIL.themeConfig.leftMenuWidth - 10; + self.themeConfig.leftMenuMax = detailData.leftMenuWidth + 300; + var headerCss = $( + '" + ); + $("head").append(headerCss); + } + if (action) { + action(); + } + }, + }); + }, +}; + +DecCst.Web.Frame.Tab.PLATFORM_HOME_TAB_ID = -1; +!(function () { + // BI.config("dec.header", function (e) { + // return e.type = "demo.header", e + // }); + BI.config("dec.provider.layout", function (e) { + e.inject({layoutStrategy: {type: "dec.xx.layout"}}); + }); +})(), + (function () { + var e = BI.inherit(BI.Widget, { + created: function () { + this._defaultWindow(); + }, + beforeInit: function (ui) { + UTIL.getAllStyle(function () { + ui(); + }); + }, + mounted: function () { + if (BI.isEmptyArray(Dec.tabPaneModel.openedTabs)) + return ( + Dec.tabPaneModel.openedTabs.push( + BI.extend( + { + width: 50, + type: "dec.frame.k.sky.tab_pane.tabs.homepage_tab", + }, + BI.Providers.getProvider( + "dec.provider.k.sky.tab_pane" + ).getHomepageParser(Dec.personal.homepage.homePageType)( + Dec.personal.homepage + ) + ) + ), + void (Dec.tabPaneModel.activeTab = + DecCst.Web.Frame.Tab.PLATFORM_HOME_TAB_ID) + ); + Dec.tabPaneModel.openedTabs.unshift( + BI.extend( + { + width: 50, + type: "dec.frame.k.sky.tab_pane.tabs.homepage_tab", + }, + BI.Providers.getProvider( + "dec.provider.k.sky.tab_pane" + ).getHomepageParser(Dec.personal.homepage.homePageType)( + Dec.personal.homepage + ) + ) + ); + + }, + render: function () { + var e = this; + return { + type: "bi.absolute", + cls: "demo-background", + items: [ + { + el: { + cls: "root-layout", + type: "bi.absolute", + items: [ + { + el: { + type: "xx.sidebar", + width: UTIL.themeConfig.leftMenuWidth, + ref: function (t) { + e.sidebar = t; + }, + listeners: [ + { + eventName: "EVENT_SHOWHIDE_SIDEBAR", + action: function (t) { + e._showHideSidebar(); + }, + }, + ], + }, + top: 0, + bottom: 0, + left: 0, + }, + { + el: BI.Providers.getProvider( + "dec.provider.k.sky.tab_pane" + ).getTabPaneComponent({ + ref: function (t) { + e.mainContaner = t; + }, + invisible: 0, + cls: "bi-card tab-provider", + }), + top: 0, + bottom: 20, + right: 20, + ref: function (e) { + }, + left: UTIL.themeConfig.leftMenuWidth + 10, + }, + ], + }, + //整体主高度 + top: 73, + left: 0, + right: 0, + bottom: 0, + }, + { + el: { + type: "demo.header", + listeners: [ + { + eventName: "EVENT_CHANGE", + action: function (t, i) { + e._setMenus(t, []), + setTimeout(function () { + e._setMenus(t, i); + }, 100); + }, + }, + ], + ref: function (t) { + e.rootHeader = t; + }, + }, + height: 50, + top: 0, + left: 0, + right: 0, + }, + ], + }; + }, + _setMenus: function (e, t) { + if ("xx_system" === e) + $(".root-dashboard").remove(), + $(".demo-sidebar").show(), + $(".tab-provider").show(), + this.sidebar._refreshTree(e, []); + else if ("xx_dashboard" === e) { + $(".demo-sidebar").hide(), + $(".tab-provider").hide(), + $(".root-dashboard").remove(); + var i = { + type: "bi.vertical", + items: [ + { + el: { + cls: "root-dashboard analysis-menu-font", + type: "dec.dashboard", + }, + }, + ], + element: ".root-layout", + }; + BI.createWidget(i); + } else if ("xx_create_form" === e) + $(".root-dashboard").remove(), + $(".demo-sidebar").show(), + $(".tab-provider").show(), + this.sidebar._refreshTree(e, []); + else { + $(".demo-sidebar").show(), + $(".tab-provider").show(), + $(".root-dashboard").remove(); + for (var n = 0; n < t.length; n++) { + var o = t[n]; + if (o.id === e) { + null !== o.path && UTIL.openTab(o), + (window.selectTabItem = e), + this.sidebar._refreshTree && + this.sidebar._refreshTree(e, o.childs); + break; + } + } + } + }, + _showHideSidebar: function () { + this.showMenu + ? (this.sidebar._showHide(!0), + $(this.sidebar.element).css({left: 0}), + $(".root-menus-tool").css({cursor: "ew-resize"}), + (this.showMenu = !1), + this._resizeContaner(window.letMenuWidt + 10)) + : (this.sidebar._showHide(!1), + $(".root-menus-tool").css({cursor: "auto"}), + $(this.sidebar.element).css({left: -window.letMenuWidt}), + (this.showMenu = !0), + this._resizeContaner(10)); + }, + _defaultWindow: function () { + var e = + document.body.clientWidth - UTIL.themeConfig.leftMenuWidth + "px"; + $(this.mainContaner.element).css({width: e}); + var t = this; + $(window).resize(function () { + var e = + document.body.clientWidth - UTIL.themeConfig.leftMenuWidth + "px"; + $(t.mainContaner.element).css({width: e}); + }), + this._resizeWindow(); + }, + _resizeWindow: function () { + var e = this; + setTimeout(function () { + $(".root-menus-tool").mousedown(function () { + $("iframe").css("pointer-events", "none"); + $(".root-layout").css("cursor", "ew-resize"), + $(document).mousemove(function (t) { + if ( + t.pageX > UTIL.themeConfig.leftMenuWidth && + t.pageX < UTIL.themeConfig.leftMenuMax + ) { + e._resizeContaner(t.pageX); + e._resizeSidebar(t.pageX); + } + }); + }), + $(".root-menus-tool").mouseup(function () { + $("iframe").css("pointer-events", "auto"); + $(".root-layout").css("cursor", "auto"), + $(document).unbind("mousemove"); + }), + $(document).mouseup(function () { + $("iframe").css("pointer-events", "auto"); + $(".root-layout").css("cursor", "auto"), + $(document).unbind("mousemove"); + }); + }, 200); + }, + _resizeContaner: function (e) { + var t = document.body.clientWidth - e; + $(this.mainContaner.element).css({width: t}), + $(this.mainContaner.element).css({left: e}); + }, + _resizeSidebar: function (e) { + $(this.sidebar.element).css({width: e}), + this.sidebar._refreshWidth(e); + }, + }); + BI.shortcut("dec.xx.layout", e); + })(), + (function () { + var e = BI.inherit(BI.Widget, { + props: {baseCls: "demo-sidebar"}, + beforeInit: function (e) { + e(); + }, + created: function () { + }, + render: function () { + var e = [], + t = this; + return { + type: "bi.htape", + items: [ + { + cls: "menu-tree-type", + width: UTIL.themeConfig.leftMenuWidth - 10, + ref: function (e) { + t.menuType = e; + }, + el: { + type: "dec.k.sky.menu_tree", + items: BI.deepClone(e), + ref: function (e) { + t.tree = e; + }, + listeners: [ + { + eventName: "EVENT_CHANGE", + action: function (e) { + t._openTab(e); + }, + }, + ], + }, + }, + { + width: 10, + el: { + cls: "root-menus-tool", + type: "bi.center_adapt", + items: [ + { + type: "bi.image_button", + src: + Dec.fineServletURL + + "/resources?path=/com/fr/plugin/xx/theme/sky/resource/image/icon_hide.png", + width: 10, + height: 44, + handler: function () { + t.fireEvent("EVENT_SHOWHIDE_SIDEBAR"); + }, + ref: function (e) { + t.imgBtn = e; + }, + }, + ], + ref: function (e) { + t.imgDiv = e; + }, + }, + }, + { + width: UTIL.themeConfig.leftMenuWidth - 10, + cls: "root-manage-menus", + el: { + visible: !1, + cls: "root-manage-menus-tree", + type: "dec.k.sky.mag.nav", + items: BI.deepClone(e), + ref: function (e) { + t.manageTree = e; + }, + listeners: [ + { + eventName: "EVENT_CHANGE", + action: function (e) { + t._openTab(e); + }, + }, + ], + }, + }, + ], + }; + }, + _refreshTree: function (e, t) { + var i = t; + if ("xx_system" === e || "xx_create_form" === e) + if ( + (this.manageTree.setVisible(!0), + $(this.manageTree.element).css({left: "0px"}), + this.tree.setVisible(!1), + "xx_create_form" === e) + ) { + // var n = this._initBICreateItems(); + // this.manageTree.populate(n) + } else this.manageTree.initTab("directory"); + else + this.tree.setVisible(!0), + this.manageTree.setVisible(!1), + $(this.manageTree.element).css({ + left: UTIL.themeConfig.leftMenuWidth + "px", + }); + this.tree._refreshTree(e, i); + }, + _openTab: function (e) { + var t = BI.find( + BI.Constants.getConstant("dec.constant.management.navigation"), + function (t, i) { + return i.value === e; + } + ); + if (t) Dec.Plugin.tabPane.openTab(t); + else { + var i = BI.find(this.childMenus, function (t, i) { + return i.id === e; + }); + i && UTIL.openTab(i); + } + }, + _initBICreateItems: function () { + var e = []; + if (Dec.BIEnable) { + if (Dec.decisionModules && Dec.decisionModules.length > 0) { + e.push( + _defineProperty( + { + $testId: "dec-management-connection", + cardType: "dec.dcm.main", + cls: "management-connection-font", + id: "decision-add-data", + pId: "decision-management-connection", + text: BI.i18nText("BI-Conf_Add_Connection"), + value: "connection", + }, + "id", + "decision-add-data" + ) + ); + e.push({ + id: "decision-add-database-table", + value: "aaxxaa-database_table-aaxxaa", + isParent: !1, + open: !1, + cls: "create-database-table-font", + text: BI.i18nText("Dec-Create_Database_Table"), + }); + e.push({ + id: "decision-add-sql-table", + value: "aaxxaa-sql_table-aaxxaa", + isParent: !1, + open: !1, + cls: "create-sql-table-font", + text: BI.i18nText("Dec-Create_SQL_Data_Set"), + }); + } + e.push({ + id: "decision-add-excel", + value: "aaxxaa-add_excel-aaxxaa", + isParent: !1, + open: !1, + cls: "create-excel-table-font", + text: BI.i18nText("Dec-Create_Excel_Data_Set"), + }); + e.push({ + id: "decision-add--custom-data", + value: "aaxxaa-custom_data-aaxxaa", + isParent: !1, + open: !1, + cls: "create-analysis-table-font", + text: BI.i18nText("BI-Conf_Add_Analysis_Table"), + }); + e.push({ + id: "decision-add-new-table", + value: "aaxxaa-new_table-aaxxaa", + isParent: !1, + open: !1, + cls: "dir-panel-template-font", + text: BI.i18nText("BI-Basic_Create_Dashboard"), + }); + } + return e; + }, + _showHide: function (e) { + e + ? this.imgBtn.setSrc( + Dec.fineServletURL + + "/resources?path=/com/fr/plugin/xx/theme/sky/resource/image/icon_hide.png" + ) + : this.imgBtn.setSrc( + Dec.fineServletURL + + "/resources?path=/com/fr/plugin/xx/theme/sky/resource/image/icon_show.png" + ); + }, + _refreshWidth: function (e) { + e < UTIL.themeConfig.leftMenuWidth && + (e = UTIL.themeConfig.leftMenuWidth), + e > UTIL.themeConfig.leftMenuMax && + (e = UTIL.themeConfig.leftMenuMax), + (e -= 10), + (window.letMenuWidt = e), + $(this.imgDiv.element).css("left", e), + $(this.tree.element).css("width", e), + $(this.manageTree.element).css("width", e); + }, + }); + BI.shortcut("xx.sidebar", e); + })(), + (function () { + var e = BI.inherit(BI.Widget, { + props: {baseCls: "fs-frame-header"}, + beforeInit: function (e) { + var t = this; + // t.registerText = BI.i18nText("Dec-Un_Register"); + t.registerText = ""; + // 有系统管理时才显示是否是注册 + if (Dec.decisionModules && Dec.decisionModules.length > 0) { + Dec.asyncAjax({ + url: "/v10/register/info", + type: "GET", + data: "", + success: function (i) { + if (i.data !== undefined) { + var n = BI.Services.getService( + "dec.service.lic" + ).getRegisterStatus(i.data); + t.registerText = t._switchRegisterStatus(n); + } + }, + complete: function (a) { + e(); + }, + }); + } else { + e(); + } + }, + mounted: function () { + setTimeout(function () { + var child = $(".dec-header-i18n-combo-trigger").children(); + $(child).css("inset", "0px 5px 0px 0px"); + }, 200); + }, + render: function () { + var e = this, + t = 5, + i = 400, + n = this._initNormal(this.registerText); + if (Dec.BIEnable) { + t = 7; + i = 600; + try { + if (BI.Services.getService("dec.service.bi.user").isBiDesigner()) { + n = this.initBIItems(this.registerText); + } + } catch (xx) { + } + } + return { + type: "bi.absolute", + items: [ + { + top: 0, + left: 0, + right: 0, + bottom: 0, + el: { + type: "bi.vertical", + cls: "bi-card header-background", + items: [ + { + type: "bi.left_right_vertical_adapt", + height: 40, + cls: "fs-frame-banner dec-frame-header", + items: { + left: [ + { + el: { + type: "bi.img", + src: BI.isEmpty(Dec.platformStyles.logoImgId) + ? Dec.fineServletURL + + "/resources?path=/com/fr/web/resources/dist/resources/logo_FR_white.png" + : Dec.fineServletURL + + "/v10/attach/image/" + + Dec.platformStyles.logoImgId, + cls: "fs-banner-logo", + height: 30, + width: "auto", + handler: function () { + UTIL.goHome(); + }, + }, + }, + { + el: { + type: "bi.text_button", + textAlign: "left", + cls: "fs-banner-title", + text: Dec.platformStyles.platformTitle, + handler: function () { + UTIL.goHome(); + }, + }, + }, + ], + right: [ + { + type: "bi.vertical_adapt", + cls: "bi-border header-color header-background fs-frame-navi", + height: 40, + // width: i, + vgap: 10, + hgap: 10, + // columns: t, + items: n, + }, + ], + }, + ref: function (x) { + setTimeout(function () { + //按原始结构模拟数知鸟需求层级 + var items = $(x.element[0]).children(".bi-f-v-c"); + if (items.length > 0) { + $(items[1]).addClass("bi-r-v-a"); + } + //数知鸟样式 + setTimeout(function () { + var item = $(".bi-flex-vertical-center-adapt-layout"); + if (item.length > 0) { + item[0].addEventListener('click', function () { + $("#integration-elite-assistant").css("top", "40px"); + setTimeout(function () { + $("#integration-elite-assistant").css("height", "calc(100% - 60px);"); + }, 200); + }, false); + } + }, 3000); + }, 80) + }, + }, + { + type: "dec.xx.menu.tab", + cls: "menu-border", + listeners: [ + { + eventName: "EVENT_CHANGE", + action: function (t, i) { + e.fireEvent("EVENT_CHANGE", t, i); + }, + }, + ], + ref: function (t) { + e.menuTab = t; + }, + }, + ], + }, + }, + ], + }; + }, + _switchRegisterStatus: function (e) { + switch (e) { + case DecCst.Register.ConfigInfo.RegisterStatus.UN_REGISTER: + return BI.i18nText("Dec-Un_Register"); + case DecCst.Register.ConfigInfo.RegisterStatus.REGISTER_FAIL: + return BI.i18nText("Dec-Register_Failed"); + case DecCst.Register.ConfigInfo.RegisterStatus.REGISTER_SUCCESS: + return ""; + default: + return ""; + } + }, + initBIItems: function (e) { + var t = this; + var items = [ + { + column: 1, + row: 0, + el: { + type: "bi.combo", + toggle: 1, + isNeedAdjustHeight: !1, + isNeedAdjustWidth: !1, + el: { + type: "bi.icon_button", + cls: "search-font search-button", + $testId: "authority-entity-search-button", + width: 40, + height: 40, + handler: function () { + }, + }, + ref: function (e) { + t.combo = e; + }, + container: this, + popup: { + cls: "search-editor", + el: { + type: "dec.xx.bar.search", + listeners: [ + { + eventName: "CLOSE_EDITOR", + action: function () { + t.combo.hideView(), t.combo.setValue(""); + }, + }, + ], + }, + }, + listeners: [ + { + eventName: BI.Combo.EVENT_BEFORE_POPUPVIEW, + action: function () { + }, + }, + ], + }, + }, + { + column: 2, + row: 0, + el: { + type: "bi.bubble_combo", + cls: "bi-new-dashboard", + destroyWhenHide: !0, + el: { + type: "bi.icon_button", + title: BI.i18nText("BI-Platform_New_Dashboard"), + width: 40, + height: 40, + logic: {dynamic: !0}, + cls: "node-navi-icon node-navi-icon-addanysis", + }, + ref: function (e) { + t.anysisCombo = e; + }, + popup: { + type: "bi.xx.new_dashboard_popup", + listeners: [ + { + eventName: "EVENT_CHANGE", + action: function () { + t.anysisCombo.hideView(); + }, + }, + ], + }, + }, + }, + { + column: 3, + row: 0, + el: { + type: "bi.icon_button", + width: 40, + cls: "config-menu-font config-icon", + title: BI.i18nText("BI-Func_Basic_Data_Preparation"), + handler: function () { + t.menuTab._changeToDataConfig(), + $(".demo-sidebar").hide(), + $(".tab-provider").hide(), + $(".root-dashboard").remove(); + var e = { + type: "bi.vertical", + items: [{el: {cls: "root-dashboard", type: "bi.conf"}}], + element: ".root-layout", + }; + BI.createWidget(e); + }, + }, + }, + {column: 4, row: 0, el: {type: "dec.xx.header.favorite"}}, + { + column: 5, + row: 0, + el: {type: "dec.header.message", cls: "menu-message-color"}, + }, + { + column: 6, + row: 0, + el: { + cls: "dec-account", + type: "dec.account", + rgap: 15, + height: 40, + }, + }, + ]; + var regist = { + column: 0, + row: 0, + el: { + type: "bi.text_button", + cls: "menu-version", + text: e, + width: 90, + height: 40, + handler: function () { + BI.Services.getService("dec.service.tabs").openCustomTab( + BI.i18nText("Dec-Version_Info"), + "dec.register.version" + ); + }, + ref: function (e) { + t.version = e; + }, + }, + }; + if (!BI.isEmpty(e)) { + items.unshift(regist); + } + + try { + var widget = BI.createWidget({type: "dec.header.i18nChanger"}); + items.unshift({ + column: 0, + row: 0, + el: {type: "dec.header.i18nChanger"}, + }); + } catch (xx) { + // console.log(xx); + } + return items; + }, + _initNormal: function (e) { + var items = [ + { + column: 1, + row: 1, + el: { + type: "bi.combo", + toggle: 1, + isNeedAdjustHeight: !1, + isNeedAdjustWidth: !1, + title: BI.i18nText("BI-Basic_Search"), + el: { + type: "bi.icon_button", + cls: "search-font search-button", + $testId: "authority-entity-search-button", + width: 40, + height: 40, + title: BI.i18nText("BI-Basic_Search"), + handler: function () { + }, + }, + ref: function (t) { + e.combo = t; + }, + container: this, + popup: { + cls: "search-editor", + el: { + type: "dec.xx.bar.search", + listeners: [ + { + eventName: "CLOSE_EDITOR", + action: function () { + e.combo.hideView(); + }, + }, + ], + }, + }, + listeners: [ + { + eventName: BI.Combo.EVENT_BEFORE_POPUPVIEW, + action: function () { + }, + }, + ], + }, + }, + {column: 2, row: 0, el: {type: "dec.xx.header.favorite"}}, + { + column: 3, + row: 0, + el: { + type: "dec.header.message", + title: BI.i18nText("Dec-Version_Info"), + cls: "menu-message-color", + }, + }, + { + column: 4, + row: 0, + el: { + cls: "dec-account", + type: "dec.account", + rgap: 15, + height: 40, + }, + }, + ]; + + try { + var widget = BI.createWidget({type: "dec.header.i18nChanger"}); + items.unshift({ + column: 0, + row: 0, + el: {type: "dec.header.i18nChanger"}, + }); + } catch (xx) { + // console.log(xx); + } + var regist = { + column: 0, + row: 0, + el: { + type: "bi.text_button", + cls: "menu-version", + text: this.registerText, + width: 90, + height: 28, + handler: function () { + BI.Services.getService("dec.service.tabs").openCustomTab( + BI.i18nText("Dec-Version_Info"), + "dec.register.version" + ); + }, + ref: function (t) { + e.version = t; + }, + }, + }; + if (!BI.isEmpty(e)) { + items.unshift(regist); + } + return items; + }, + }); + BI.shortcut("demo.header", e); + })(), + (function () { + var e = BI.inherit(BI.NodeButton, { + props: { + baseCls: "platform-list-item-active cursor-pointer", + $testId: "dec-workbench-panel-favorite-item", + layer: 0, + id: "", + pId: "", + open: !1, + height: 24, + closeable: !1, + iconCls: "dir-panel-template-font", + }, + render: function () { + var ieclass = ""; + if (!!window.ActiveXObject || "ActiveXObject" in window) { + //当为ie11时防止防止菜单栏弹出列表位置偏差 + ieclass = "ie-pop-icon"; + } + var e = this.options, + t = { + type: "bi.center_adapt", + height: e.height, + cls: "platform-node-icon " + e.iconCls + " " + ieclass, + items: [{type: "bi.icon", height: 16, width: 16}], + }, + i = { + type: "bi.htape", + height: e.height, + width: "100%", + cls: "segment-list-text-item", + items: [ + { + type: "bi.label", + cls: "platform-list-item-active-text", + textAlign: "left", + text: e.text, + height: e.height, + title: e.text, + }, + ], + }, + n = []; + return ( + n.push({type: "bi.layout", width: 5, height: e.height}), + n.push({ + el: t, + height: e.height, + }), + n.push({el: i, height: e.height}), + { + type: "bi.absolute", + items: [ + { + el: {type: "bi.htape", items: n}, + top: 0, + bottom: 0, + left: 0, + right: e.closeable ? 24 : 0, + }, + ], + } + ); + }, + isOnce: function () { + return !0; + }, + getValue: function () { + return this.options.id; + }, + doRedMark: function () { + this.text.doRedMark.apply(this.node, arguments); + }, + unRedMark: function () { + this.text.unRedMark.apply(this.node, arguments); + }, + doClick: function () { + BI.NodeButton.superclass.doClick.apply(this, arguments); + }, + setOpened: function (t) { + e.superclass.setOpened.apply(this, arguments), + BI.isNotNull(this.checkbox) && this.checkbox.setSelected(t); + }, + }); + BI.shortcut("dec.more.button.list.item", e); + var t = BI.inherit(BI.Widget, { + props: {baseCls: "dec-segment-menu-list"}, + render: function () { + var e = this, + t = BI.map(this.options.items, function (e, t) { + return BI.extend( + { + type: "dec.more.button.list.item", + closeable: !0, + id: t.value, + text: t.text, + iconCls: null == t.icon ? "dir-panel-folder-font" : t.icon, + height: DecCst.Entry_Node_Size.HEIGHT, + }, + t + ); + }); + return { + type: "bi.button_group", + cls: "dec-text tab-more-btn-list", + ref: function (t) { + e.list = t; + }, + layouts: [{type: "bi.list_view", hgap: 10}], + listeners: [ + { + eventName: "EVENT_CHANGE", + action: function () { + e.fireEvent("EVENT_SELECT", this.getValue()[0]); + this.setValue(""); + }, + }, + ], + value: window.selectTabItem, + items: t, + }; + }, + }); + BI.shortcut("dec.more.button.list", t); + })(), + (function () { + var e = BI.inherit(BI.BasicButton, { + _defaultConfig: function () { + var t = e.superclass._defaultConfig.apply(this, arguments); + return BI.extend(t, { + baseCls: (t.baseCls || "") + " bi-segment-button bi-list-item-active", + shadow: !0, + readonly: !0, + hgap: 10, + height: 60, + }); + }, + _init: function () { + e.superclass._init.apply(this, arguments); + var t = this.options, + i = "segment-buton-conetent ", + n = null; + BI.isEmpty(t.icon) + ? (i += "dir-panel-folder-font") + : t.icon.indexOf("MapCache") > -1 || t.icon.indexOf("holder") > -1 + ? (n = t.icon) + : (i += t.icon), + "xx_system" === t.value && + null === t.icon && + (i = "segment-buton-conetent node-navi-icon node-navi-icon-8"); + var o = this; + if ( + ((this.text = BI.createWidget({ + element: this, + type: "bi.horizontal_auto", + cls: "menu-button-root", + height: 30, + items: [ + // { + // type: "bi.icon_label", + // cls: i, + // height: 45, + // ref: function (e) { + // o.iconDiv = e + // } + // }, + { + cls: "menu-label", + type: "bi.label", + height: 30, + width: 100, + whiteSpace: t.whiteSpace, + title: t.text, + text: t.text, + value: t.value, + }, + ], + })), + null != n) + ) { + var a = Dec.fineServletURL + "/v10/attach/image/" + n; + $(o.iconDiv.element).append( + '' + ); + } + }, + setSelected: function () { + e.superclass.setSelected.apply(this, arguments); + }, + setText: function (t) { + e.superclass.setText.apply(this, arguments), this.text.setText(t); + }, + destroy: function () { + e.superclass.destroy.apply(this, arguments); + }, + }); + BI.shortcut("xx.segment_button", e); + var t = BI.inherit(BI.Widget, { + mounted: function () { + this.uiResize(); + }, + _defaultConfig: function () { + return BI.extend(t.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-segment", + items: [], + height: 30, + }); + }, + _store: function () { + return BI.Models.getModel("dec.model.xx.segment"); + }, + _init: function (e, resize) { + t.superclass._init.apply(this, arguments); + var self = this; + if (!resize) { + this._store().initMenu(function (t, n) { + self.firstMenu = t; + self.secondMenu = n; + self.getUI(t, n, e); + //初次页面时加载主页 + UTIL.goHome(); + }); + } else { + //页面修改大小时调用 + self.getUI(self.firstMenu, self.secondMenu, !0); + } + }, + setValue: function (e) { + this.buttonGroup.setValue(e); + }, + setEnabledValue: function (e) { + this.buttonGroup.setEnabledValue(e); + }, + getValue: function () { + return this.buttonGroup.getValue(); + }, + getUI: function (e, i, n) { + var o = $(window).width(), + a = this, + r = this.options, + s = parseInt(o / 100), + c = BI.deepClone(e), + l = [], + d = !1; + e.length >= s ? ((l = e.slice(0, s - 1)), (d = !0)) : (l = e), + $(".button-root-div").remove(), + $(".node-navi-icon-more").remove(), + (a.buttonGroup = BI.createWidget({ + element: ".menu-segment", + cls: "menu-button-group", + type: "bi.button_group", + items: BI.createItems(l, { + cls: "menu-color", + type: "xx.segment_button", + height: 30, + width: 100, + whiteSpace: r.whiteSpace, + }), + layouts: [ + { + type: "bi.center_adapt", + items: [ + { + el: { + type: "bi.horizontal", + width: "100%", + cls: "button-root-div", + }, + }, + ], + }, + ], + })), + a.buttonGroup.on(BI.Controller.EVENT_CHANGE, function () { + a.fireEvent(BI.Controller.EVENT_CHANGE, arguments); + }), + a.buttonGroup.on(BI.ButtonGroup.EVENT_CHANGE, function (e, n) { + a.fireEvent(t.EVENT_CHANGE, e, i); + }); + var defaultSelect = e.length > 0 ? e[0].value : ""; + var u = c.slice(s - 1, e.length); + if (d) { + a.buttonGroup.combo = BI.createWidget({ + element: a.buttonGroup.element[0], + type: "bi.combo", + destroyWhenHide: false, + comboClass: "more-button-combo", + // trigger: "", + isNeedAdjustHeight: true, + hideWhenBlur: true, + direction: "bottom", + cls: "menu-more-button-root", + listeners: [ + { + eventName: "EVENT_EXPAND", + action: function (t) { + }, + }, + ], + el: { + type: "bi.text_button", + cls: "node-navi-icon node-navi-icon-more", + width: 100, + height: 30, + handler: function () { + // a.buttonGroup.combo.showView(); + if (!!window.ActiveXObject || "ActiveXObject" in window) { + // console.log("是ie") + var popView = a.buttonGroup.combo.getView().element; + $(popView).css("top", "100px"); + } + }, + }, + popup: { + el: { + type: "dec.more.button.list", + items: u, + listeners: [ + { + eventName: "EVENT_CLOSE", + action: function () { + a.buttonGroup.combo.hideView(); + }, + }, + { + eventName: "EVENT_SELECT", + action: function (e) { + (window.selectTabItem = e), + a.fireEvent(t.EVENT_CHANGE, e, i), + a.hideCombo(), + a.buttonGroup.setValue(""), + a.buttonGroup.combo.setValue(""); + }, + }, + ], + }, + maxHeight: 300, + maxWidth: 240, + minWidth: 240, + top: 100, + }, + }); + } + n + ? a.buttonGroup.setValue(window.selectTabItem) + : (a.buttonGroup.setValue(defaultSelect), + a.fireEvent(t.EVENT_CHANGE, defaultSelect, i)); + }, + hideCombo: function () { + $(".node-navi-icon-more").click(), this.buttonGroup.combo.hideView(); + }, + uiResize: function () { + this.oldWidth = document.body.clientWidth; + var e = this; + $(window).resize(function () { + (document.body.clientWidth - e.oldWidth > 100 || + e.oldWidth - document.body.clientWidth > 100) && + ((e.oldWidth = document.body.clientWidth), e._init(!0, true)), + Dec.BIEnable + ? document.body.clientWidth < 816 + ? $(".fs-frame-navi").hide() + : $(".fs-frame-navi").show() + : document.body.clientWidth < 599 + ? $(".fs-frame-navi").hide() + : $(".fs-frame-navi").show(); + }), + Dec.BIEnable + ? document.body.clientWidth < 816 + ? $(".fs-frame-navi").hide() + : $(".fs-frame-navi").show() + : document.body.clientWidth < 599 + ? $(".fs-frame-navi").hide() + : $(".fs-frame-navi").show(); + }, + }); + (t.EVENT_CHANGE = "EVENT_CHANGE"), BI.shortcut("xx.segment", t); + var i = BI.inherit(Fix.Model, { + state: function () { + return {rootMenu: [], allMenu: []}; + }, + childContext: [], + computed: {}, + actions: { + initMenu: function (e) { + var t = this; + Dec.reqGet( + "/url/sky/getAllMenu", + "", + function (i) { + var n = i.data.childs, + o = []; + for (var a in n) { + var r = n[a]; + if ("decision-directory-root" === r.id) { + (o = r.childs), (t.model.allMenu = r.childs); + break; + } + } + Dec.themeMenu = n; + for (var s = 0; s < o.length; s++) { + var c = o[s]; + t.model.rootMenu.push({ + text: c.text, + value: c.id, + icon: c.icon, + }); + } + if (Dec.BIEnable) { + try { + if ( + BI.Services.getService("dec.service.bi.user").isBiDesigner() + ) { + t.model.rootMenu.push({ + text: BI.i18nText("BI-Platform_Dashboard"), + value: "xx_dashboard", + icon: "analysis-menu-font", + }); + } + } catch (xx) { + } + } + if (Dec.decisionModules && Dec.decisionModules.length > 0) { + + t.model.rootMenu.push({ + text: BI.i18nText("Dec-Authority_PlatformModule"), + value: "xx_system", + icon: "node-navi-icon-8", + }); + } + // Dec.BIEnable && (t.model.rootMenu.push({ + // text: BI.i18nText("BI-Platform_Dashboard"), + // value: "xx_dashboard", + // icon: "analysis-menu-font" + // }), t.model.rootMenu.push({ + // text: BI.i18nText("Dec-Basic_Create"), + // value: "xx_create_form", + // icon: "create-menu-font" + // })), + e(t.model.rootMenu, t.model.allMenu); + setTimeout(function () { + NProgress.status = 1; + NProgress.done(); + NProgress.remove(); + }, 5000); + }, + function (e) { + } + ); + }, + }, + _dealConnectItems: function (e) { + }, + }); + BI.model("dec.model.xx.segment", i); + var n = BI.inherit(BI.Widget, { + _store: function () { + }, + render: function () { + var e = this; + return { + type: "bi.vertical", + items: [ + { + el: { + type: "xx.segment", + cls: "menu-segment", + listeners: [ + { + eventName: t.EVENT_CHANGE, + action: function (t, i) { + e.fireEvent("EVENT_CHANGE", t, i); + }, + }, + ], + ref: function (t) { + e.xxSegment = t; + }, + }, + }, + ], + }; + }, + _changeToDataConfig: function () { + this.xxSegment.setValue(""); + }, + }); + BI.shortcut("dec.xx.menu.tab", n); + })(), + (function () { + var e = BI.inherit(BI.Pane, { + props: {baseCls: ""}, + _store: function () { + return BI.Models.getModel("dec.model.workbench.k.sky.panel.search"); + }, + watch: { + items: function () { + this.list.setVisible(!0), this.list.populate(this.model.items); + }, + }, + hide: function () { + this.list.setVisible(!1); + }, + render: function () { + var e = this; + return { + el: { + type: "bi.popup_view", + el: { + type: "bi.button_group", + layouts: [{type: "bi.vertical"}], + items: [], + listeners: [ + { + eventName: "EVENT_CHANGE", + action: function (t) { + e.store.openTab(t), e.fireEvent("OPENTAB_CHANGE"); + }, + }, + ], + }, + width: UTIL.themeConfig.leftMenuWidth, + invisible: !0, + ref: function (t) { + e.list = t; + }, + }, + lgap: 10, + }; + }, + }); + BI.shortcut("dec.xx.header.search", e); + var t = BI.inherit(BI.Widget, { + _store: function () { + return BI.Models.getModel("dec.model.workbench.k.sky.panel"); + }, + render: function () { + var e = this; + return { + type: "bi.vertical", + items: [ + { + el: { + type: "bi.search_editor", + width: 200, + cls: "zxl_search", + watermark: BI.i18nText("BI-Basic_Search"), + ref: function (t) { + e.ser_input = t; + }, + listeners: [ + { + eventName: "EVENT_CHANGE", + action: function () { + e.store.doSearch(this.getValue()); + }, + }, + { + eventName: BI.SearchEditor.EVENT_ENTER, + action: function () { + e.store.doSearch(this.getValue()); + }, + }, + { + eventName: BI.SearchEditor.EVENT_CLEAR, + action: function () { + e.lisPan.hide(); + }, + }, + { + eventName: BI.Editor.EVENT_BLUR, + action: function () { + var t = this; + setTimeout(function () { + "" === t.getValue() && e.lisPan.hide(); + }, 100); + }, + }, + ], + }, + }, + { + el: { + type: "dec.xx.header.search", + ref: function (t) { + e.lisPan = t; + }, + listeners: [ + { + eventName: "OPENTAB_CHANGE", + action: function () { + e.ser_input.setValue(""), e.fireEvent("CLOSE_EDITOR"); + }, + }, + ], + }, + hgap: 0, + }, + ], + }; + }, + setValue: function (e) { + this.ser_input.setValue(""), this.lisPan.hide(); + }, + }); + BI.shortcut("dec.xx.bar.search", t); + })(), + (function () { + var e = BI.inherit(BI.Widget, { + props: {baseCls: "dec-header-fav"}, + mounted: function () { + BI.Models.getModel("dec.model.workbench.k.sky.panel").initData( + function () { + } + ); + }, + render: function () { + var e = this; + return { + type: "bi.combo", + destroyWhenHide: !0, + trigger: "", + direction: "bottom,left", + innerVGap: 5, + el: { + type: "dec.xx.header.fav.combo.trigger", + handler: function () { + e.showView(); + }, + }, + ref: function () { + e.combo = this; + }, + popup: { + el: { + type: "dec.workbench.k.sky.favorite", + listeners: [ + { + eventName: "EVENT_CLOSE", + action: function () { + e.combo.hideView(); + }, + }, + ], + }, + maxHeight: 300, + minWidth: 240, + }, + }; + }, + showView: function () { + var e = this; + BI.Models.getModel("dec.model.workbench.k.sky.panel").initData( + function () { + } + ), + this.combo.showView(); + var t = null; + e.combo.element.on("mouseleave." + e.getName(), function (i) { + t = window.setTimeout(function () { + e.hideView(), window.clearTimeout(t); + }, 300); + }), + e.combo.element.on("mouseenter." + e.getName(), function (e) { + window.clearTimeout(t); + }); + }, + hideView: function () { + this.combo.hideView(); + }, + }); + BI.shortcut("dec.xx.header.favorite", e); + })(), + (function () { + var e = BI.inherit(BI.BasicButton, { + props: {baseCls: "dec-header-message-combo-trigger"}, + render: function () { + return { + type: "bi.absolute", + width: 40, + height: 40, + items: [ + { + el: { + type: "bi.icon_button", + cls: "already-favorite-font", + iconWidth: 16, + iconHeight: 16, + title: BI.i18nText("Dec-Basic_Favorite"), + }, + top: 5, + left: 0, + bottom: 5, + right: 5, + }, + ], + }; + }, + }); + BI.shortcut("dec.xx.header.fav.combo.trigger", e); + })(), + (function () { + var e = BI.inherit(BI.Widget, { + props: {baseCls: "dec-workbench-panel-favorite"}, + _store: function () { + return BI.Models.getModel("dec.model.workbench.k.sky.panel.favorite"); + }, + watch: { + items: function () { + this.list.populate(this.model.items); + }, + currentSelect: function () { + this.list.setValue(this.model.currentSelect); + }, + }, + render: function () { + var e = this; + return ( + this.options, + { + type: "bi.button_group", + cls: "dec-text", + ref: function (t) { + e.list = t; + }, + layouts: [{type: "bi.list_view", hgap: 10}], + listeners: [ + { + eventName: "EVENT_CHANGE", + action: function () { + e.store.openTab(this.getValue()[0]); + }, + }, + ], + value: this.model.currentSelect, + items: this.model.items, + } + ); + }, + }); + BI.shortcut("dec.workbench.k.sky.favorite", e); + })(), + (function () { + Dec.Favorites = Fix.define({favorites: []}); + var e = BI.inherit(Fix.Model, { + _init: function () { + this.platform = Dec.globleModel; + }, + state: function () { + return {}; + }, + computed: { + items: function () { + var e = this; + if (Dec.Favorites.favorites && Dec.Favorites.favorites.length > 0) + return BI.map(Dec.Favorites.favorites, function (t, i) { + return BI.extend( + { + type: "dec.workbench.k.sky.panel.favorite.item", + closeable: !0, + onClose: BI.bind(e.handleUnCollect, e, i.id || i.value), + id: i.value, + height: DecCst.Entry_Node_Size.HEIGHT, + }, + i + ); + }); + var t = { + cover: null, + description: "", + deviceType: 7, + entryType: 201, + fullParentName: "无收藏数据", + icon: null, + id: "xx_no_faviorte", + isParent: !1, + mobileNodeIcon: null, + open: !1, + pId: null, + path: "", + privilegeDetailBeanList: null, + sortIndex: 1, + templateId: "", + text: "无收藏数据", + }; + return [ + BI.extend( + { + type: "dec.workbench.k.sky.panel.favorite.item", + closeable: 0, + id: "xx_no_faviorte", + height: DecCst.Entry_Node_Size.HEIGHT, + }, + t + ), + ]; + }, + currentSelect: function () { + return this.platform.selectedTab; + }, + }, + actions: { + openTab: function (e) { + var t = BI.find(this.model.items, function (t, i) { + return i && i.id === e; + }); + "xx_no_faviorte" !== t.id && + ($(".root-dashboard").remove(), + $(".demo-sidebar").show(), + $(".tab-provider").show(), + UTIL.openTab(t)); + }, + handleUnCollect: function (e) { + Dec.Utils.handlerCollect(e, !1, function (t) { + Dec.Favorites.favorites = BI.filter( + Dec.Favorites.favorites, + function (t, i) { + return i.id !== e; + } + ); + }); + }, + }, + }); + BI.model("dec.model.workbench.k.sky.panel.favorite", e); + })(), + (function () { + var e = BI.inherit(Fix.Model, { + _init: function () { + this.platform = Dec.globleModel; + }, + state: function () { + return {results: [], loading: !1}; + }, + context: ["reports", "isSearching", "keyword"], + computed: { + items: function () { + var e = this; + return BI.isEmpty(this.model.results) + ? [ + { + type: "bi.label", + cls: "dec-disabled-text", + text: + this.model.keyword && !this.model.loading + ? BI.i18nText("Dec-No_Matching_Item") + : "", + height: 24, + }, + ] + : BI.map(this.model.results, function (t, i) { + return BI.extend( + { + type: "dec.workbench.k.sky.panel.no.icon.item", + keyword: e.model.keyword, + }, + i + ); + }); + }, + currentSelect: function () { + return this.platform.selectedTab; + }, + }, + watch: { + isSearching: function () { + (this.model.keyword = ""), (this.model.results = []); + }, + keyword: function (e) { + (this.model.results = []), BI.isKey(e) && this.doSearch(e); + }, + }, + actions: { + openTab: function (e) { + var t = BI.find(this.model.items, function (t, i) { + return i && i.id === e; + }); + Dec.BIEnable && + ($(".root-dashboard").remove(), + $(".demo-sidebar").show(), + $(".tab-provider").show()), + UTIL.openTab(t); + }, + doSearch: function (e) { + var t = this; + (t.model.loading = !0), + this._getSearchResults(e, function (e) { + (t.model.loading = !1), (t.model.results = e); + }); + }, + }, + _getSearchResults: function (e, t) { + var i = []; + Dec.Utils.searchWorkbenchSubDirectory(e, function (n) { + i = BI.filter(n.data, function (e, t) { + return !t.isParent; + }); + var o = BI.Func.getSearchResult(i, e, "text"); + t(o.match.concat(o.find)); + }); + }, + }); + BI.model("dec.model.workbench.k.sky.panel.search", e); + })(), + (function () { + var e = BI.inherit(BI.NodeButton, { + props: { + baseCls: "platform-list-item-active cursor-pointer", + $testId: "dec-workbench-panel-no-icon-item", + layer: 1, + id: "", + pId: "", + open: !1, + height: DecCst.Entry_Node_Size.HEIGHT, + closeable: !1, + iconCls: "dir-panel-template-font", + }, + render: function () { + var e = this, + t = this.options, + i = { + type: "bi.text_item", + ref: function (t) { + e.iconTextItem = t; + }, + cls: "platform-list-item-active-text " + t.iconCls, + textLgap: 2, + height: t.height, + hgap: t.hgap, + text: t.text, + value: t.value, + logic: {dynamic: !0}, + keyword: t.keyword, + }, + n = []; + return ( + BI.count(0, t.layer, function () { + n.push({type: "bi.layout", width: 15, height: t.height}); + }), + n.push({el: i, height: t.height}), + { + type: "bi.absolute", + items: [ + { + el: {type: "bi.htape", items: n}, + top: 0, + bottom: 0, + left: 0, + right: 0, + }, + { + el: { + type: "bi.icon_button", + stopPropagation: !0, + invisible: !t.closeable, + cls: "close-h-font close-button", + width: 18, + height: 18, + handler: function () { + e.options.onClose(); + }, + }, + top: 3, + bottom: 3, + right: 5, + }, + ], + } + ); + }, + isOnce: function () { + return !0; + }, + getValue: function () { + return this.options.id; + }, + doRedMark: function () { + this.text.doRedMark.apply(this.node, arguments); + }, + unRedMark: function () { + this.text.unRedMark.apply(this.node, arguments); + }, + setSelected: function (t) { + e.superclass.setSelected.apply(this, arguments), + this.iconTextItem.setSelected(t); + }, + doClick: function () { + BI.NodeButton.superclass.doClick.apply(this, arguments); + }, + setOpened: function (t) { + e.superclass.setOpened.apply(this, arguments), + BI.isNotNull(this.checkbox) && this.checkbox.setSelected(t); + }, + }); + BI.shortcut("dec.workbench.k.sky.panel.no.icon.item", e); + })(), + (function () { + var e = BI.inherit(BI.NodeButton, { + props: { + baseCls: "platform-list-item-active cursor-pointer", + $testId: "dec-workbench-panel-favorite-item", + layer: 0, + id: "", + pId: "", + open: !1, + height: 24, + closeable: !1, + iconCls: "dir-panel-template-font", + }, + render: function () { + var e = this, + t = this.options, + i = { + type: "bi.center_adapt", + height: t.height, + cls: "platform-node-icon " + t.iconCls, + items: [{type: "bi.icon", height: 16, width: 16}], + }, + n = { + type: "bi.htape", + height: t.height, + items: [ + { + type: "bi.label", + cls: "platform-list-item-active-text", + textAlign: "left", + text: t.text, + height: t.height, + title: t.text, + }, + ], + }, + o = []; + return ( + o.push({type: "bi.layout", width: 5, height: t.height}), + o.push({ + el: i, + height: t.height, + width: t.height, + }), + o.push({el: n, height: t.height}), + { + type: "bi.absolute", + items: [ + { + el: {type: "bi.htape", items: o}, + top: 0, + bottom: 0, + left: 0, + right: t.closeable ? 24 : 0, + }, + { + el: { + type: "bi.icon_button", + stopPropagation: !0, + invisible: !t.closeable, + cls: "close-h-font close-button", + width: 18, + height: t.height, + handler: function () { + e.options.onClose(); + }, + }, + top: 0, + bottom: 0, + right: 5, + }, + ], + } + ); + }, + isOnce: function () { + return !0; + }, + getValue: function () { + return this.options.id; + }, + doRedMark: function () { + this.text.doRedMark.apply(this.node, arguments); + }, + unRedMark: function () { + this.text.unRedMark.apply(this.node, arguments); + }, + doClick: function () { + "xx_no_faviorte" !== this.options.id && + BI.NodeButton.superclass.doClick.apply(this, arguments); + }, + setOpened: function (t) { + e.superclass.setOpened.apply(this, arguments), + BI.isNotNull(this.checkbox) && this.checkbox.setSelected(t); + }, + }); + BI.shortcut("dec.workbench.k.sky.panel.favorite.item", e); + })(), + (function () { + var e = BI.inherit(Fix.Model, { + state: function () { + return { + activeTab: "directory", + isSearching: !1, + keyword: "", + reports: [], + }; + }, + context: ["isPin"], + childContext: ["reports", "isSearching", "keyword", "isSearching"], + computed: { + tabs: function () { + return BI.map( + BI.Constants.getConstant("dec.constant.workbench.panel.tabs"), + function (e, t) { + return BI.extend({type: "dec.workbench.pane.button"}, t); + } + ); + }, + }, + actions: { + initData: function (e) { + Dec.Utils.getFavoritesList(function (t) { + (Dec.Favorites.favorites = t.data), e && e(); + }); + }, + selectTab: function (e) { + this.model.activeTab = e; + }, + pinPane: function () { + window.localStorage.setItem( + "workbenchPinStatus", + this.model.isPin ? "unPin" : "pin" + ), + (this.model.isPin = !this.model.isPin); + }, + startSearch: function () { + this.model.isSearching = !0; + }, + stopSearch: function () { + this.model.isSearching = !1; + }, + doSearch: function (e) { + this.model.keyword = e; + }, + }, + }); + BI.model("dec.model.workbench.k.sky.panel", e); + })(), + (function () { + var e = BI.inherit(Fix.Model, { + state: function () { + return { + openRoot: null, + expandRootNode: null, + favorites: [], + entries: [], + selectedId: null, + loading: null, + isPin: null, + }; + }, + context: ["isPin", "favorites", "entries", "selectedId", "loading"], + computed: {}, + actions: { + initEntryTrees: function (ui) { + var t = this; + this.toggleLoading(!0), + Dec.Utils.getFavoritesList(function (e) { + var i = BI.Services.getService( + "dec.service.frame.entry" + ).normalizeEntries(e.data, !1); + t.model.favorites = i; + }); + Dec.Utils.getCompleteDirectoryTree(function (i) { + MenuEntries = BI.Services.getService( + "dec.service.frame.entry" + ).normalizeEntries(i.data); + t.toggleLoading(!1); + }); + try { + var n = Dec.themeMenu ? Dec.themeMenu[0].childs[0].childs : []; + t.model.entries = t._expandMenus(n); + } catch (e) { + t.model.entries = []; + } + ui(); + }, + openTab: function (e) { + var t = BI.find(this.model.entries, function (t, i) { + return i && i.id === e; + }); + (TabSelectID.commSelectId = e), + (this.model.selectedId = e), + BI.Providers.getProvider("dec.provider.k.sky.tab_pane").behaviour( + "addCardByName", + t.id, + { + text: t.text, + value: t.id, + entry: !0, + cardType: {src: t.iframeSrc}, + } + ); + }, + initRootNodes: function (e) { + this.getSubItemsByPId(DecCst.DIRECTORY_TREE_ROOT_ID, 0, e); + }, + getSubItemsByPId: function (e, t, i) { + var n = this._getSubItemsByPId(e); + i(this._formatItems(n, t)); + }, + expandNode: function (e) { + BI.some(this.model.entries, function (t, i) { + return i.id === e && i.pId === DecCst.DIRECTORY_TREE_ROOT_ID; + }) && (this.model.expandRootNode = e); + }, + toggleLoading: function (e) { + this.model.loading = e; + }, + }, + _formatItems: function (e, t) { + var i = this, + n = BI.deepClone(e); + return ( + BI.each(n, function (e, n) { + var o = { + layer: t, + $value: t + "-" + n.text, + height: DecCst.Entry_Node_Size.HEIGHT, + }; + !0 === n.isParent + ? ((o.type = "dec.common.img.icon_text_node"), + (o.cls = "dec-frame-platform-list-item dec-font-size-14")) + : ((o.type = "dec.common.img.icon_text_item"), + (o.cls = + "dec-frame-platform-list-item-active dec-font-size-14"), + (n.selected = n.id === i.model.selectedId)), + BI.defaults(n, o); + }), + n + ); + }, + _getSubItemsByPId: function (e) { + var t = BI.filter(this.model.entries, function (t, i) { + return i.pId === e; + }); + return BI.sortBy(t, "sortIndex"); + }, + populate: function (e) { + var t = Array.prototype.slice.call(arguments, 0); + arguments.length > 0 && (t[0] = this._formatItems(e)), + this.tree.populate.apply(this.tree, t); + }, + _expandMenus: function (e, t) { + for (var i = [], n = 0; n < e.length; n++) { + var o = e[n]; + t === o.pId && (o.pId = DecCst.DIRECTORY_TREE_ROOT_ID), + delete o.childs, + i.push(o); + } + return BI.Services.getService( + "dec.service.frame.entry" + ).normalizeEntries(i); + }, + }); + BI.model("dec.model.k.skye.menu_tree", e); + var t = BI.inherit(BI.Widget, { + props: {baseCls: "comm-menu-tree"}, + _store: function () { + return BI.Models.getModel("dec.model.k.skye.menu_tree"); + }, + watch: { + selectedId: function () { + this.tree.setValue(this.model.selectedId); + }, + expandRootNode: function () { + this._closeOtherRootNodes(this.model.expandRootNode); + }, + }, + created: function () { + var e = this; + Fix.watch(TabSelectID, "commSelectId", function (t) { + e.tree.setValue(TabSelectID.commSelectId); + }), + Fix.watch(TabSelectID, "willSelectId", function (t) { + if (t) { + if (t !== -1 && -1 === t.indexOf("decision-management")) { + e.tree.setValue(t); + } else { + e.tree.setValue(""); + } + } + }); + }, + beforeInit: function (e) { + this.store.initEntryTrees(e); + }, + render: function () { + var e = this; + return { + type: "dec.common.scroll_view", + cls: "common-xx-menu", + width: UTIL.themeConfig.leftMenuWidth - 10, + content: { + el: { + type: "bi.vertical", + items: [ + { + type: "bi.custom_tree", + ref: function (t) { + e.tree = t; + }, + expander: {el: {}, popup: {type: "bi.custom_tree"}}, + items: this.model.items, + el: { + type: "bi.loader", + next: !1, + isDefaultInit: !0, + el: { + type: "bi.button_tree", + chooseType: 0, + layouts: [{type: "bi.vertical"}], + }, + }, + itemsCreator: function (t, i) { + t.node + ? e.store.getSubItemsByPId( + t.node.id, + t.node.layer + 1, + function (e) { + i(e); + } + ) + : e.store.initRootNodes(function (e) { + i(e); + }); + }, + listeners: [ + { + eventName: BI.Controller.EVENT_CHANGE, + action: function (t, i, n) { + t === BI.Events.EXPAND && + e.store.expandNode(n.getValue()), + t === BI.Events.CLICK && e.store.openTab(i); + }, + }, + ], + }, + ], + }, + }, + }; + }, + _closeOtherRootNodes: function (e) { + var t = this.tree.getAllButtons(); + BI.each(t, function (t, i) { + BI.isEqual(i.options.id, e) || (i.hideView && i.hideView()); + }); + }, + _refreshTree: function (e, t) { + this.tree.populate([]), + (this.model.entries = this.store._expandMenus(t, e)); + var i = this.store._getSubItemsByPId(DecCst.DIRECTORY_TREE_ROOT_ID), + n = this.store._formatItems(i, 0); + this.tree.populate(n); + }, + }); + BI.shortcut("dec.k.sky.menu_tree", t); + })(), + (function () { + var e = BI.inherit(Fix.Model, { + _init: function () { + this.platform = Dec.globleModel; + }, + state: function () { + return {modules: [], openedNode: ""}; + }, + context: ["isPin"], + computed: { + selectedManageNav: function () { + return this.platform.selectedManageNav; + }, + items: function () { + var e = this, + t = BI.Services.getService( + "dec.service.management" + ).getComputedManagementNavigations(); + return ( + BI.each(t, function (t, i) { + BI.isNotEmptyArray(i.children) && + BI.some(i.children, function (t, n) { + if (n.value === e.platform.selectedManageNav) + return (n.selected = !0), (i.open = !0); + }), + i.value === e.model.selectedManageNav && (i.selected = !0); + }), + t + ); + }, + }, + actions: { + initDecisionModules: function (e) { + var t = this; + BI.isEmpty(Dec.decisionModules) + ? Dec.Utils.getDecisionModules(function (i) { + (t.model.modules = i.data), + t.openTab(t.model.selectedManageNav), + e(); + }) + : ((t.model.modules = Dec.decisionModules), + t.openTab(t.model.selectedManageNav), + e()); + }, + openTab: function (e) { + // if (e.startsWith("aaxxaa")) this._openBI(e); else + // { + // 新版已不支持 + TabSelectID.manageSelectId = e; + var t = BI.find( + BI.Constants.getConstant("dec.constant.management.navigation"), + function (t, i) { + return i.value === e; + } + ); + t && BI.Services.getService("dec.service.k.sky.frame.tab_pane").addItem(t); + // } + }, + pinPane: function () { + window.localStorage.setItem( + "managementPinStatus", + this.model.isPin ? "unPin" : "pin" + ), + (this.model.isPin = !this.model.isPin); + }, + _openBI: function (e) { + if (e.startsWith("aaxxaa-") && e.endsWith("-aaxxaa")) { + var t = e.split("-")[1]; + if ( + ("add_data" === t && + BI.Services.getService( + "dec.service.k.sky.frame.tab_pane" + ).addItem( + _defineProperty( + { + $testId: "dec-management-connection", + cardType: "dec.dcm.main", + cls: "management-connection-font", + id: "decision-add-data", + text: BI.i18nText("BI-Conf_Add_Connection"), + value: "connection", + }, + "id", + "decision-add-data" + ) + ), + "add_excel" === t) + ) { + var i = null, + n = "弹出层id1"; + return ( + BI.Popovers.create(n, { + header: BI.i18nText("Dec-Create_Excel_Data_Set"), + size: "small", + body: { + type: "dec.add.new.excel_table", + ref: function (e) { + i = e; + }, + listeners: [ + { + eventName: "EVENT_CANCEL", + action: function () { + BI.Popovers.close(n); + }, + }, + { + eventName: "EVENT_CONFIRM", + action: function () { + BI.Popovers.close(n); + }, + }, + ], + }, + }).open(n), + void (i && i.initPopup()) + ); + } + if ("custom_data" === t) { + var o = null, + n = "弹出层id2"; + return ( + BI.Popovers.create(n, { + header: BI.i18nText("BI-Conf_Add_Analysis_Table"), + size: "small", + body: { + type: "dec.add.new.analysis_table", + ref: function (e) { + o = e; + }, + listeners: [ + { + eventName: "EVENT_CANCEL", + action: function () { + BI.Popovers.close(n); + }, + }, + { + eventName: "EVENT_CONFIRM", + action: function () { + BI.Popovers.close(n); + }, + }, + ], + }, + }).open(n), + void (o && o.initPopup()) + ); + } + if ("new_table" === t) { + var n = "弹出层id3", + a = null; + return ( + BI.Popovers.create(n, { + header: BI.i18nText("BI-Basic_Create_Dashboard"), + size: "small", + body: { + type: "dec.add.new.dashboard", + ref: function (e) { + a = e; + }, + listeners: [ + { + eventName: "EVENT_CANCEL", + action: function () { + BI.Popovers.close("弹出层id3"); + }, + }, + { + eventName: "EVENT_CONFIRM", + action: function () { + BI.Popovers.close("弹出层id3"); + }, + }, + ], + }, + }).open(n), + void (a && a.initPopup()) + ); + } + + if ("database_table" === t) { + var n = "database_table_popup", + a = null; + return ( + BI.Popovers.create(n, { + header: BI.i18nText("Dec-Create_Database_Table"), + size: "small", + body: { + type: "dec.add.new.database_table", + ref: function (e) { + a = e; + }, + listeners: [ + { + eventName: "EVENT_CANCEL", + action: function () { + BI.Popovers.close(n); + }, + }, + { + eventName: "EVENT_CONFIRM", + action: function () { + BI.Popovers.close(n); + }, + }, + ], + }, + }).open(n), + void (a && a.initPopup()) + ); + } + if ("sql_table" === t) { + var n = "sql_table_popup", + a = null; + return ( + BI.Popovers.create(n, { + header: BI.i18nText("Dec-Create_SQL_Data_Set"), + size: "small", + body: { + type: "dec.add.new.sql_table", + ref: function (e) { + a = e; + }, + listeners: [ + { + eventName: "EVENT_CANCEL", + action: function () { + BI.Popovers.close(n); + }, + }, + { + eventName: "EVENT_CONFIRM", + action: function () { + BI.Popovers.close(n); + }, + }, + ], + }, + }).open(n), + void (a && a.initPopup()) + ); + } + return !0; + } + return !1; + }, + }, + }); + BI.model("dec.model.k.sky.nav", e); + var t = BI.inherit(BI.Widget, { + props: { + baseCls: "dec-management-nav dec-popover dec-frame-popover", + pinedPane: !1, + }, + _store: function () { + return BI.Models.getModel("dec.model.k.sky.nav"); + }, + watch: { + selectedManageNav: function (e) { + this.tree.setValue(e); + }, + isPin: function (e) { + this.pinIcon.setIcon(e ? "unpin-font" : "pin-font"), + e + ? this.element.addClass("pined").removeClass("un-pined") + : this.element.removeClass("pined").addClass("un-pined"); + }, + openedNode: function () { + this.populate(this.model.items); + }, + }, + beforeInit: function (e) { + this.store.initDecisionModules(e); + }, + created: function () { + var e = this; + Fix.watch(TabSelectID, "manageSelectId", function () { + if (-1 === TabSelectID.manageSelectId) e.tree.setValue(-1); + else { + var t = TabSelectID.manageSelectId, + i = t.split("-"); + e.tree.setValue(i[i.length - 1]); + } + }), + Fix.watch(TabSelectID, "willSelectId", function (t) { + if (t !== -1) { + if (t.indexOf("decision-management") > -1) { + var i = t.split("-"); + e.tree.setValue(i[i.length - 1]); + } + } else { + e.tree.setValue(""); + } + }); + }, + mounted: function () { + BI.Services.getService("dec.service.style.configure").watchStyle(this); + }, + render: function () { + var e = this; + this.options; + return { + type: "bi.absolute", + scrollable: !1, + items: [ + { + el: { + type: "dec.common.scroll_view", + cls: "manage-scroll-view", + content: { + type: "bi.custom_tree", + cls: "dec-text", + ref: function (t) { + e.tree = t; + }, + el: { + type: "bi.button_tree", + chooseType: 0, + layouts: [{type: "bi.vertical", vgap: 5}], + }, + listeners: [ + { + eventName: "EVENT_CHANGE", + action: function () { + e.store.openTab(this.getValue()[0]), + e.tree.setValue(-1); + }, + }, + ], + items: this._formatItems(this.model.items, 0), + }, + }, + top: 0, + left: 0, + right: 0, + bottom: 0, + }, + ], + }; + }, + _formatItems: function (e, t) { + var i = this; + return ( + BI.each(e, function (e, n) { + var o = {layer: t}; + !0 === n.isParent || BI.isNotEmptyArray(n.children) + ? ((o.type = "dec.nav.node"), + BI.defaults(n, o), + i._formatItems(n.children, t + 1)) + : (n.type && n.type.startsWith("aaxxaa") + ? (o.type = "dec.k.bi.nav.item") + : (o.type = "dec.nav.item"), + (o.height = DecCst.Entry_Node_Size.HEIGHT - 6 * t), + BI.defaults(n, o)); + }), + e + ); + }, + populate: function (e) { + (e = this._formatItems(e, 0)), this.tree.populate(e); + }, + initTab: function (e) { + this.populate(this.model.items); + }, + }); + (t.EVENT_VALUE_CHANGE = "EVENT_VALUE_CHANGE"), + BI.shortcut("dec.k.sky.mag.nav", t); + })(), + (function () { + var e = BI.inherit(BI.NodeButton, { + props: { + baseCls: + "dec-nav-item dec-frame-platform-list-item-active cursor-pointer", + layer: 0, + id: "", + pId: "", + open: !1, + height: DecCst.Entry_Node_Size.HEIGHT, + }, + render: function () { + var e = this.options, + t = { + type: "bi.center_adapt", + height: e.height, + width: e.height, + cls: "platform-node-icon " + e.iconCls, + items: [{type: "bi.icon", height: 16, width: 16}], + }, + i = { + type: "bi.htape", + height: e.height, + items: [ + { + type: "bi.label", + textAlign: "left", + cls: "dec-frame-text", + text: e.text, + height: e.height, + title: e.text, + }, + ], + }, + n = []; + return ( + n.push({type: "bi.layout", width: 10, height: e.height}), + BI.count(0, e.layer, function () { + n.push({type: "bi.layout", width: 30, height: e.height}); + }), + n.push({el: t, height: e.height, width: e.height}), + n.push({ + el: i, + height: e.height, + }), + {type: "bi.htape", items: n} + ); + }, + isOnce: function () { + return !0; + }, + getValue: function () { + return this.options.value; + }, + setSelected: function (e) { + }, + doClick: function () { + }, + setOpened: function (e) { + }, + }); + BI.shortcut("dec.k.bi.nav.item", e); + })(), + BI.provider("dec.provider.k.sky.tab_pane", function () { + var e = this, + t = null, + i = { + type: "dec.frame.k.sky.tab_pane", + buttons: { + left: [], + right: [ + { + type: "dec.frame.tab_pane.k.sky.down_list", + cls: "tab-other", + width: 30, + height: 30, + }, + ], + }, + height: "100%", + width: "100%", + }, + n = {}; + (this.registerHomepageParser = function (e, t) { + n[e] = t; + }), + (function () { + e.registerHomepageParser( + DecCst.Homepage.Homepage_Type.LINK, + function (e) { + return { + value: -1, + id: e.pcURL, + cardName: e.pcURL, + entryType: e.pcURLentryType, + cardType: { + src: BI.isKey(e.pcURL) + ? Dec.Utils.preCheckLink(e.pcURL) + : "about:blank", + }, + }; + } + ), + e.registerHomepageParser( + DecCst.Homepage.Homepage_Type.ENTRY, + function (e) { + var t = ""; + return ( + (t = BI.isKey(e.pcURL) + ? e.pcURLentryType && + e.pcURLentryType === DecCst.Entries.Entry_Type.LINK_TYPE + ? e.pcURL + : Dec.fineServletURL + + "/v10/entry/access/" + + e.pcURL + + "?dashboardType=5" + : "about:blank"), + { + value: -1, + id: e.pcURL, + cardName: e.pcURL, + entryType: e.pcURLentryType, + cardType: {src: t}, + } + ); + } + ); + })(), + (this.registerTabPaneComponent = function (e) { + BI.deepExtend(i, e); + }), + (this.$get = function () { + return BI.inherit(BI.OB, { + behaviour: function (e) { + var i = Array.prototype.slice.call(arguments, 1); + return t[e].apply(t, i); + }, + getHomepageParser: function (e) { + return ( + n[e] || + function () { + return {value: -1, cardType: {src: "about:blank"}}; + } + ); + }, + getTabPaneComponent: function (e) { + return ( + (t = BI.createWidget(BI.extend(i, e))).on( + BI.Events.UNMOUNT, + function () { + t = null; + } + ), + t + ); + }, + openCustomTab: function (e, i) { + if (BI.isNull(t)) + return ( + Dec.tabPaneModel.openedTabs.push(i), + void (Dec.tabPaneModel.activeTab = i.value) + ); + this.behaviour("addCardByName", e, i); + }, + resetState: function () { + (Dec.tabPaneModel.activeTab = ""), + BI.each( + Dec.tabPaneModel.openedTabs, + function (e, t) { + this.behaviour("closeTabByName", t.value); + }, + this + ), + (Dec.tabPaneModel.openedTabs = []); + }, + }); + }); + }), + BI.config("dec.provider.k.sky.tab_pane", function (e) { + e.registerHomepageParser( + DecCst.Homepage.Homepage_Type.TEMPLATE, + function (e) { + if (!BI.isKey(e.pcURL)) + return { + value: -1, + id: e.pcURL, + cardName: e.pcURL, + entryType: e.pcURLentryType, + cardType: {src: "about:blank"}, + }; + var t = ""; + switch (e.pcURL.split(".").pop()) { + case "cpt": + t = + Dec.fineServletURL + + "/view/report?" + + Dec.Utils.transformObject2URLParam( + {viewlet: e.pcURL}, + null, + !0 + ); + break; + case "frm": + default: + t = + Dec.fineServletURL + + "/view/form?" + + Dec.Utils.transformObject2URLParam( + {viewlet: e.pcURL}, + null, + !0 + ); + } + return { + value: -1, + id: e.pcURL, + cardName: e.pcURL, + entryType: e.pcURLentryType, + cardType: {src: t}, + }; + } + ); + }), + (function () { + var e = BI.inherit(BI.Widget, { + props: {baseCls: "dec-tabs-pane-card"}, + mounted: function () { + var e = this, + t = this.options; + BI.each(t.items, function (t, i) { + e.addCardByName(i.cardName, i); + }); + }, + render: function () { + var e = this; + return ( + this.options, + (this.park = []), + (this.showing = null), + { + type: "bi.absolute", + ref: function (t) { + e.container = t; + }, + } + ); + }, + _createItems: function (e) { + return BI.createItems(e, {}, {top: 0, left: 0, right: 0, bottom: 0}); + }, + _showCard: function (e) { + e.setVisible(!0); + }, + _hideCard: function (e) { + e.setVisible(!1); + }, + _compareSrc: function (e, t) { + if (BI.isNull(t)) return !1; + var i = BI.stripEL(t); + return ( + e.attr("originalSrc") !== i.src && + (e.attr("originalSrc", i.src), this._appendOffsetParams(i.src)) + ); + }, + _appendOffsetParams: function (e) { + return BI.isKey(e) + ? BI.appendQuery(e, { + width: this.element.width(), + height: this.element.height(), + }) + : e; + }, + addCardByName: function (e, t) { + var i = this, + n = BI.deepClone(t); + BI.isKey(n.src) && + ((n.originalSrc = n.src), (n.src = this._appendOffsetParams(n.src))), + BI.extend(n, { + ref: function (t) { + i.park.push({value: e, widget: t}); + }, + }); + var o = BI.extend(n, {top: 0, left: 0}); + this.container + .addItem(o) + .element.css({top: "0", left: "0", width: "100%", height: "100%"}); + }, + deleteCardByName: function (e) { + var t = 0, + i = 0, + n = BI.clone(this.showing), + o = this; + BI.each(this.park, function (n, a) { + a.value === e && (t = n), o.showing === a.value && (i = n); + }), + BI.each(this.park, function (t, i) { + i.value === e && i.widget.destroy(); + }), + BI.remove(this.park, function (t, i) { + return i.value === e; + }); + if (t < i) { + this.fireEvent("CLOSE_TAP_OPEN_LAST", n); + } else if (t === i) { + if (this.park.length > 0) { + if (this.park[t]) { + this.fireEvent("CLOSE_TAP_OPEN_LAST", this.park[t].value); + } else { + this.fireEvent("CLOSE_TAP_OPEN_LAST", this.park[t - 1].value); + } + } + } + // t < i ? this.fireEvent("CLOSE_TAP_OPEN_LAST", n) : t === i && (this.park[t] ? this.fireEvent("CLOSE_TAP_OPEN_LAST", this.park[t].value) + // : this.fireEvent("CLOSE_TAP_OPEN_LAST", this.park[t - 1].value)) + }, + showCardByName: function (e, t) { + (this.showing = e), + BI.each( + this.park, + function (i, n) { + if (n.value === e) { + this._showCard(n.widget); + var o = this.getShowingCard(), + a = this._compareSrc(o, t); + a && o.setSrc && o.setSrc(a); + } else this._hideCard(n.widget); + }, + this + ); + }, + isCardExisted: function (e) { + return BI.some(this.park, function (t, i) { + return i.value === e; + }); + }, + getCardByName: function (e) { + var t = BI.find( + this.park, + function (t, i) { + return i.value === e; + }, + this + ); + if (t) return t.widget; + }, + getShowingCard: function () { + var e = BI.find( + this.park, + function (e, t) { + return t.value === this.showing; + }, + this + ); + if (e) return e.widget; + }, + }); + BI.shortcut("dec.frame.k.sky.tab_pane.card.display", e); + var t = BI.inherit(BI.Widget, { + props: { + baseCls: "dec-tabs-down-list-combo dec-frame-tab-pane-tabs-down-list", + $testId: "dec-frame-tab-pane-tabs-down-list", + items: [], + adjustLength: 0, + direction: "bottom", + trigger: "click", + container: null, + stopPropagation: !1, + el: {}, + }, + render: function () { + var e = this; + return { + type: "bi.center_adapt", + items: [ + { + type: "bi.combo", + ref: function (t) { + e.downlistcombo = t; + }, + trigger: "", + destroyWhenHide: !0, + direction: "bottom,left", + adjustXOffset: 8, + adjustYOffset: -2, + stopPropagation: this.options.stopPropagation, + el: { + type: "bi.icon_button", + $value: "more-tabs", + cls: "more-tabs-font dec-frame-icon", + width: 30, + height: 30, + handler: function () { + e.showView(); + }, + }, + popup: { + el: { + type: "dec.frame.tab_pane.k.sky.down_list_popup", + ref: function (t) { + e.popup = t; + }, + listeners: [ + { + eventName: "EVENT_CHANGE", + action: function () { + e.hideView(); + }, + }, + ], + }, + cls: "dec-beautified-border", + maxHeight: 1e3, + minWidth: 120, + }, + listeners: [ + { + eventName: BI.Combo.EVENT_AFTER_POPUPVIEW, + action: function () { + }, + }, + { + eventName: BI.Combo.EVENT_AFTER_HIDEVIEW, + action: function () { + }, + }, + ], + }, + ], + }; + }, + showView: function () { + var e = this; + this.downlistcombo.showView(); + var t = null; + e.downlistcombo.element.hover( + function () { + window.clearTimeout(t); + }, + function () { + t = window.setTimeout(function () { + e.hideView(); + }, 300); + } + ); + }, + hideView: function () { + this.downlistcombo.hideView(); + }, + }); + BI.shortcut("dec.frame.tab_pane.k.sky.down_list", t); + var i = BI.inherit(BI.Widget, { + props: { + baseCls: "dec-tabs-down-list-combo dec-frame-popover", + items: [], + adjustLength: 0, + direction: "bottom", + trigger: "click", + container: null, + stopPropagation: !1, + el: {}, + }, + _store: function () { + return BI.Models.getModel( + "dec.model.frame.tab_pane.k.sky.down_list_popup" + ); + }, + watch: { + downListTabs: function () { + this.tabsItems.populate(this.model.downListTabs); + }, + operatorItems: function () { + this.operators.populate(this.model.operatorItems); + }, + }, + render: function () { + return ( + this.options, + { + type: "bi.vertical", + items: [this.createOperators(), this.createTabsItems()], + } + ); + }, + createOperators: function () { + var e = this; + return { + type: "bi.button_group", + ref: function (t) { + e.operators = t; + }, + items: this.model.operatorItems, + layouts: [{type: "bi.vertical"}], + listeners: [ + { + eventName: "EVENT_CHANGE", + action: function (t) { + e.store.clickOperator(t), e.fireEvent("EVENT_CHANGE"); + }, + }, + ], + }; + }, + createTabsItems: function () { + var e = this; + return { + type: "bi.button_group", + ref: function (t) { + e.tabsItems = t; + }, + items: this.model.downListTabs, + layouts: [{type: "bi.vertical"}], + listeners: [ + { + eventName: "EVENT_CHANGE", + action: function (t) { + BI.Providers.getProvider( + "dec.provider.k.sky.tab_pane" + ).behaviour("showCardByName", t), + e.fireEvent("EVENT_CHANGE"); + }, + }, + ], + }; + }, + populate: function () { + this.createOperators(), this.createTabsItems(); + }, + }); + BI.shortcut("dec.frame.tab_pane.k.sky.down_list_popup", i); + var n = BI.inherit(Fix.Model, { + state: function () { + return {}; + }, + context: ["openedTabs", "maxSize", "activeTab", "tabs"], + computed: { + downListTabs: function () { + var e = this; + return BI.map( + this.model.tabs.slice(this.model.maxSize), + function (t, i) { + return BI.extend({}, i, { + type: "dec.frame.tab_pane.down_list_popup.item", + cls: "dec-frame-platform-list-item-active", + invisible: !1, + height: 30, + listeners: [ + { + eventName: "EVENT_CHANGE", + action: function (t) { + e.closeTab(t); + }, + }, + ], + }); + } + ); + }, + operatorItems: function () { + return BI.createItems( + [ + { + text: BI.FullScreen.isFullScreen() + ? BI.i18nText("Dec-Exist_Full_Screen") + : BI.i18nText("Dec-Full_Screen"), + value: "FULL_SCREEN", + }, + {text: BI.i18nText("Dec-Close_All"), value: "CLOSE_ALL"}, + { + text: BI.i18nText("Dec-Close_Other_Tabs"), + value: "CLOSE_OTHER", + }, + ], + { + type: "bi.text_item", + textLgap: 10, + height: 30, + cls: "dec-frame-platform-list-item-active", + textAlign: "left", + } + ); + }, + }, + actions: { + clickOperator: function (e) { + switch (e) { + case "CLOSE_OTHER": + this.closeOther(); + break; + case "CLOSE_ALL": + this.closeAll(); + break; + case "FULL_SCREEN": + this.fullscreen(); + } + }, + closeOther: function () { + BI.Services.getService( + "dec.service.frame.k.sky.tab_pane" + ).closeOtherTabs(); + }, + closeAll: function () { + BI.Services.getService( + "dec.service.frame.k.sky.tab_pane" + ).closeAllTabs(); + }, + fullscreen: function () { + BI.Providers.getProvider("dec.provider.k.sky.tab_pane").behaviour( + "fullscreen", + !BI.FullScreen.isFullScreen() + ); + }, + closeTab: function (e) { + BI.Services.getService("dec.service.frame.k.sky.tab_pane").closeTab( + e + ); + }, + }, + }); + BI.model("dec.model.frame.tab_pane.k.sky.down_list_popup", n); + var o = BI.inherit(BI.OB, { + addItem: function (e) { + e.entryType + ? this._addEntry2Tabs(e) + : this._isManagementModules(e) + ? this._addManagementModulesTabs(e) + : this.openCustomTab(e.text, e.id, e.cardType); + }, + closeTab: function (e) { + var t = Dec.tabPaneModel.openedTabs, + i = t.length; + BI.some(t, function (n, o) { + if (o.value === Dec.tabPaneModel.activeTab && o.value === e) + return ( + (Dec.tabPaneModel.activeTab = + n < i - 1 + ? t[n + 1].value + : 0 < n + ? t[n - 1].value + : DecCst.Web.Frame.Tab.PLATFORM_HOME_TAB_ID), + !0 + ); + }), + (Dec.tabPaneModel.openedTabs = BI.filter(t, function (t, i) { + return i.value !== e; + })), + (Dec.tabPaneModel.inactiveTabs = [e]); + }, + closeOtherTabs: function () { + var e = Dec.tabPaneModel.openedTabs, + t = Dec.tabPaneModel.activeTab, + i = BI.filter(e, function (e, i) { + return ( + i.value !== t && + i.value !== DecCst.Web.Frame.Tab.PLATFORM_HOME_TAB_ID + ); + }); + (i = BI.map(i, "value")), + BI.remove(Dec.tabPaneModel.openedTabs, function (e, t) { + return BI.contains(i, t.value); + }), + (Dec.tabPaneModel.inactiveTabs = i); + }, + closeAllTabs: function () { + var e = Dec.tabPaneModel.openedTabs, + t = BI.filter(e, function (e, t) { + return t.value !== DecCst.Web.Frame.Tab.PLATFORM_HOME_TAB_ID; + }); + (t = BI.map(t, "value")), + BI.remove(Dec.tabPaneModel.openedTabs, function (e, i) { + return BI.contains(t, i.value); + }), + (Dec.tabPaneModel.inactiveTabs = t), + (Dec.tabPaneModel.activeTab = BI.get(Dec.tabPaneModel.openedTabs, [ + 0, + "value", + ])); + }, + refreshTab: function (e, t) { + BI.find(Dec.tabPaneModel.openedTabs, function (i, n) { + if (n.value === e) return BI.extend(n, t), !0; + }) + ? BI.Providers.getProvider("dec.provider.tab_pane").behaviour( + "refreshCardByName", + e + ) + : console.warn("no cardValue matched"); + }, + closeActiveTab: function () { + this.closeTab(Dec.tabPaneModel.activeTab); + }, + getShowingTab: function () { + return Dec.tabPaneModel.activeTab; + }, + fullScreen: function () { + BI.Providers.getProvider("dec.provider.tab_pane").behaviour( + "fullscreen", + !0 + ); + }, + exitFullScreen: function () { + BI.Providers.getProvider("dec.provider.tab_pane").behaviour( + "fullscreen", + !1 + ); + }, + openCustomTab: function (e, t, i) { + var n = Array.prototype.slice.call(arguments); + 2 === BI.size(n) && n.splice(1, 0, n[0]), + BI.history.navigate("directory", {trigger: !0}); + var o = {text: n[0], value: n[1], cardType: n[2]}, + a = BI.findIndex(Dec.tabPaneModel.openedTabs, function (e, t) { + return t.value === o.value; + }); + -1 < a + ? Dec.tabPaneModel.openedTabs.splice(a, 1, o) + : Dec.tabPaneModel.openedTabs.push(o), + (Dec.tabPaneModel.activeTab = o.value); + }, + showTab: function (e) { + this._showTabByValue(e); + }, + alternatePlay: function (e, t) { + var i = this, + n = this.getShowingTab(), + o = Dec.tabPaneModel.openedTabs.length - 1, + a = (function (e) { + return ( + BI.findIndex(Dec.tabPaneModel.openedTabs, function (t, i) { + return i.value === e; + }) - 1 + ); + })(n); + return setInterval(function () { + a++; + var e = (function () { + return Dec.tabPaneModel.openedTabs[(a % o) + 1].value; + })(); + t && i.refreshTab(e, {}), (Dec.tabPaneModel.activeTab = e); + }, 1e3 * e); + }, + _isManagementModules: function (e) { + return BI.some(Dec.decisionModules, function (t, i) { + return e.id === i.id; + }); + }, + _addEntry2Tabs: function (e) { + var t = ""; + switch (e.entryType) { + case DecCst.Entries.Entry_Type.BI_REPORT: + t = + Dec.fineServletURL + + "/v10/entry/access/" + + e.id + + "?dashboardType=" + + (BI.isNotNull(e.homePageType) ? "5" : "4"); + break; + case DecCst.Entries.Entry_Type.SEARCH_SHARE: + t = + Dec.fineServletURL + + "/v5/design/report/" + + e.id + + "/view?entryType=6"; + break; + case DecCst.Entries.Entry_Type.LINK_TYPE: + t = e.path || e.pcURL; + break; + default: + t = BI.isKey(e.id) + ? Dec.fineServletURL + + "/v10/entry/access/" + + e.id + + "?dashboardType=5" + : "about:blank"; + } + this.openCustomTab(e.text, e.id, {src: t, isEntry: !0}); + }, + _showTabByValue: function (e) { + Dec.tabPaneModel.activeTab = e; + }, + _addManagementModulesTabs: function (e) { + this.openCustomTab(e.text, e.id, e.cardType); + }, + }); + BI.service("dec.service.frame.k.sky.tab_pane", o); + })(), + (function () { + var e = BI.inherit(BI.OB, { + addItem: function (e) { + e.entryType + ? this._addEntry2Tabs(e) + : this._isManagementModules(e) + ? this._addManagementModulesTabs(e) + : this.openCustomTab(e.text, e.id, e.cardType); + }, + closeTab: function (e) { + var t = -1; + BI.remove(Dec.tabPaneModel.openedTabs, function (i, n) { + if (n.value === e) return (t = i), !0; + }), + Dec.tabPaneModel.activeTab === e && + (t === Dec.tabPaneModel.openedTabs.length && t--, + (Dec.tabPaneModel.activeTab = Dec.tabPaneModel.openedTabs[t] + ? Dec.tabPaneModel.openedTabs[t].value + : "")); + }, + refreshTab: function (e, t) { + BI.find(Dec.tabPaneModel.openedTabs, function (i, n) { + if (n.value === e) return BI.extend(n, t), !0; + }) + ? BI.Providers.getProvider("dec.provider.k.sky.tab_pane").behaviour( + "refreshCardByName", + e + ) + : console.warn("no cardValue matched"); + }, + closeActiveTab: function () { + this.closeTab(Dec.tabPaneModel.activeTab); + }, + getShowingTab: function () { + return Dec.tabPaneModel.activeTab; + }, + fullScreen: function () { + BI.Providers.getProvider("dec.provider.k.sky.tab_pane").behaviour( + "fullscreen", + !0 + ); + }, + exitFullScreen: function () { + BI.Providers.getProvider("dec.provider.k.sky.tab_pane").behaviour( + "fullscreen", + !1 + ); + }, + openCustomTab: function (e, t, i) { + var n = Array.prototype.slice.call(arguments); + 2 === BI.size(n) && n.splice(1, 0, n[0]), + BI.history.navigate("directory", {trigger: !0}), + BI.Providers.getProvider("dec.provider.k.sky.tab_pane").openCustomTab( + n[1], + { + text: n[0], + value: n[1], + cardType: n[2], + } + ); + }, + showTab: function (e) { + this._showTabByValue(e); + }, + alternatePlay: function (e, t) { + var i = this, + n = this.getShowingTab(), + o = Dec.tabPaneModel.openedTabs.length - 1, + a = (function (e) { + return ( + BI.findIndex(Dec.tabPaneModel.openedTabs, function (t, i) { + return i.value === e; + }) - 1 + ); + })(n); + return setInterval(function () { + a++; + var e = (function () { + return Dec.tabPaneModel.openedTabs[(a % o) + 1].value; + })(); + t && i.refreshTab(e, {}), (Dec.tabPaneModel.activeTab = e); + }, 1e3 * e); + }, + _isManagementModules: function (e) { + return BI.some(Dec.decisionModules, function (t, i) { + return e.id === i.id; + }); + }, + _addEntry2Tabs: function (e) { + var t = ""; + switch (e.entryType) { + case DecCst.Entries.Entry_Type.BI_REPORT: + t = + Dec.fineServletURL + + "/v10/entry/access/" + + e.id + + "?dashboardType=" + + (BI.isNotNull(e.homePageType) ? "5" : "4"); + break; + case DecCst.Entries.Entry_Type.SEARCH_SHARE: + t = + Dec.fineServletURL + + "/v5/design/report/" + + e.id + + "/view?entryType=6"; + break; + case DecCst.Entries.Entry_Type.LINK_TYPE: + t = e.path || e.pcURL; + break; + default: + t = BI.isKey(e.id) + ? Dec.fineServletURL + + "/v10/entry/access/" + + e.id + + "?dashboardType=5" + : "about:blank"; + } + this.openCustomTab(e.text, e.id, {src: t, isEntry: !0}); + }, + _showTabByValue: function (e) { + Dec.tabPaneModel.activeTab = e; + }, + _addManagementModulesTabs: function (e) { + this.openCustomTab(e.text, e.id, e.cardType); + }, + }); + BI.service("dec.service.k.sky.frame.tab_pane", e); + var t = BI.inherit(Fix.Model, { + state: function () { + return {regionWidth: 1e4}; + }, + computed: { + activeTab: function () { + return Dec.tabPaneModel.activeTab; + }, + openedTabs: function () { + return Dec.tabPaneModel.openedTabs; + }, + maxSize: function () { + for (var e = 0, t = 0; t < this.model.regionWidth;) + e < this.model.openedTabs.length + ? (t += + this.model.openedTabs[e].width || + DecCst.Web.Frame.Tab.NORMAL_TAB_WIDTH) + : (t += DecCst.Web.Frame.Tab.NORMAL_TAB_WIDTH), + e++; + return BI.max([e - 1, 0]); + }, + tabs: function () { + var e = [], + t = this; + return ( + BI.each(this.model.openedTabs, function (i, n) { + n && + e.push( + BI.extend( + { + type: "dec.frame.k.sky.tab_pane.tabs.tab", + selected: n.value === t.model.activeTab, + invisible: i >= t.model.maxSize, + }, + n + ) + ); + }), + e + ); + }, + activeCard: function () { + var e = this, + t = BI.find(this.model.openedTabs, function (t, i) { + return i.value === e.model.activeTab; + }); + return BI.isKey(t.cardType) + ? {type: t.cardType, value: t.value} + : BI.extend( + { + type: "bi.iframe", + value: t.value, + name: t.value, + cls: "bi-card", + }, + t.cardType + ); + }, + }, + childContext: [ + "openedTabs", + "maxSize", + "activeTab", + "tabs", + "regionWidth", + ], + watch: { + activeTab: function () { + this.resortTabs(); + }, + maxSize: function () { + this.resortTabs(); + }, + }, + actions: { + addCardByName: function (e, t) { + var i = BI.findIndex(this.model.openedTabs, function (e, i) { + return i.value === t.value; + }); + -1 < i + ? Dec.tabPaneModel.openedTabs.splice(i, 1, t) + : Dec.tabPaneModel.openedTabs.push(t), + (Dec.tabPaneModel.activeTab = t.value); + }, + showCardByName: function (e, t) { + BI.some(this.model.openedTabs, function (i, n) { + if (n.value === e) return BI.extend(n, t), !0; + }), + (Dec.tabPaneModel.activeTab = e); + }, + selectTab: function (e) { + Dec.tabPaneModel.activeTab = e; + }, + closeTab: function (e) { + var t = this, + i = this.model.openedTabs.length; + BI.some(this.model.openedTabs, function (n, o) { + if (o.value === t.model.activeTab && o.value === e) + return ( + (Dec.tabPaneModel.activeTab = + n < i - 1 + ? t.model.openedTabs[n + 1].value + : 0 < n + ? t.model.openedTabs[n - 1].value + : DecCst.Web.Frame.Tab.PLATFORM_HOME_TAB_ID), + !0 + ); + }), + (Dec.tabPaneModel.openedTabs = BI.filter( + this.model.openedTabs, + function (t, i) { + return i.value !== e; + } + )); + }, + resortTabs: function () { + var e = BI.findIndex(Dec.tabPaneModel.openedTabs, function (e, t) { + return t.value === Dec.tabPaneModel.activeTab; + }); + if ( + ((Dec.tabPaneModel.openedTabs = BI.sortBy( + Dec.tabPaneModel.openedTabs, + function (e, t) { + return t.value !== DecCst.Web.Frame.Tab.PLATFORM_HOME_TAB_ID; + } + )), + e >= this.model.maxSize) + ) { + var t = Dec.tabPaneModel.openedTabs.splice(e, 1); + Dec.tabPaneModel.openedTabs.splice(this.model.maxSize - 1, 0, t[0]); + } + }, + }, + }); + BI.model("dec.model.frame.k.sky.tab_pane", t); + var i = BI.inherit(BI.Widget, { + props: { + baseCls: " ", + $testId: "dec-frame-tab-pane", + buttons: {left: [], right: []}, + }, + _store: function () { + return BI.Models.getModel( + "dec.model.frame.k.sky.tab_pane", + this.options + ); + }, + watch: { + tabs: function (e) { + this._populate(e); + }, + activeCard: function (e) { + BI.isNull(e) || + (this.isCardExisted(e.value) || this._addCardByName(e.value, e), + this._showCardByName(e.value, e)); + }, + }, + render: function () { + var e = this, + t = this.options; + return { + type: "bi.absolute", + items: [ + { + el: { + cls: "dec.frame.k.sky.tab_pane.card.display", + type: "dec.frame.k.sky.tab_pane.card.display", + ref: function (t) { + e.cards = t; + }, + items: BI.isNotNull(this.model.activeCard) + ? [this.model.activeCard] + : [], + listeners: [ + { + eventName: "CLOSE_TAP_OPEN_LAST", + action: function (e) { + TabSelectID.willSelectId = e; + }, + }, + ], + }, + left: 0, + right: 0, + bottom: 0, + top: 31, + }, + { + el: { + type: "bi.htape", + height: 30, + cls: "dec-frame-tab-pane-tabs-container dec-frame-tab-pane-split-line", + ref: function (t) { + e.header = t; + }, + items: t.buttons.left + .concat([ + { + type: "dec.frame.k.sky.tab_pane.tabs", + ref: function (t) { + e.tabs = t; + }, + }, + ]) + .concat(t.buttons.right), + }, + top: 0, + left: 0, + right: 0, + }, + ], + }; + }, + _addCardByName: function (e, t) { + this.cards.addCardByName(e, t); + }, + _showCardByName: function (e, t) { + this.cards.showCardByName(e, t), this.tabs.setValue(e); + }, + _populate: function (e) { + this.tabs.populate(e); + }, + _dealWithTabsFullScreen: function (e) { + function t(e) { + BI.isNull(o) && + (o = setTimeout(function () { + e(); + }, 300)); + } + + function i() { + clearTimeout(o), (o = null); + } + + var n = this, + o = null; + e + ? (this.cards.element.css({top: 0}), + this.header.element.css("opacity", 0), + this.header.element.css({top: -29}), + this.header.element.hover( + function () { + i(), + BI.FullScreen.isFullScreen() && + t(function () { + n.header.element.css("opacity", 1), + n.header.element.css({top: 0}); + }); + }, + function () { + i(), + t(function () { + BI.FullScreen.isFullScreen() && + (n.header.element.css("opacity", 0), + n.header.element.css({top: -29})); + }); + } + )) + : (i(), + this.header.element.unbind("mouseenter").unbind("mouseleave"), + this.header.element.css("opacity", 1), + this.header.element.css({top: 0}), + this.cards.element.css({top: 31})); + }, + fullscreen: function (e) { + var t = this; + e + ? BI.FullScreen.requestFullScreen( + this, + function (e) { + e && t._dealWithTabsFullScreen(!0); + }, + function () { + t._dealWithTabsFullScreen(!1); + } + ) + : BI.FullScreen.isFullScreen() && BI.FullScreen.exitFullScreen(); + }, + isCardExisted: function (e) { + return this.cards.isCardExisted(e); + }, + getOpenedTabs: function () { + return this.model.openedTabs; + }, + getActiveTab: function () { + return this.model.activeTab; + }, + showCardByName: function (e, t) { + this.store.showCardByName(e, t), this.fireEvent(i.EVENT_SHOW, e); + }, + addCardByName: function (e, t) { + this.store.addCardByName(e, t), this.fireEvent(i.EVENT_ADD, e); + }, + closeTabByName: function (e) { + this.store.closeTab(e), + this.cards.deleteCardByName(e), + this.fireEvent(i.EVENT_CLOSE, e, this.model.activeTab); + }, + refreshCardByName: function (e) { + this.cards.deleteCardByName(e), + this._addCardByName(e, this.model.activeCard); + }, + }); + (i.EVENT_SHOW = "EVENT_SHOW"), + (i.EVENT_ADD = "EVENT_ADD"), + (i.EVENT_CLOSE = "EVENT_CLOSE"), + BI.shortcut("dec.frame.k.sky.tab_pane", i); + var n = BI.inherit(Fix.Model, { + state: function () { + return {}; + }, + context: ["openedTabs", "maxSize", "activeTab", "tabs", "regionWidth"], + actions: { + setRegionWidth: function (e) { + 0 < e && (this.model.regionWidth = e); + }, + }, + }); + BI.model("dec.model.k.sky.frame.tab_pane.tabs", n); + var o = BI.inherit(BI.Widget, { + props: {$testId: "dec-frame-tab-pane-tabs"}, + _store: function () { + return BI.Models.getModel("dec.model.k.sky.frame.tab_pane.tabs"); + }, + mounted: function () { + BI.Resizers.add(this.getName(), BI.bind(this._calculateMaxSize, this)), + this._calculateMaxSize(); + }, + render: function () { + var e = this; + return ( + this.options, + { + type: "bi.htape", + height: 30, + items: [ + { + type: "bi.button_group", + cls: "dec-tabs-button-group k-sky-button-group", + ref: function (t) { + e.tabs = t; + }, + layouts: [{type: "bi.left", lgap: -2, scrollable: !1}], + items: this.model.tabs, + value: this.model.activeTab, + listeners: [ + { + eventName: "EVENT_CHANGE", + action: function (e) { + if ( + (BI.Providers.getProvider( + "dec.provider.k.sky.tab_pane" + ).behaviour("showCardByName", e), + -1 === e) + ) + return ( + (TabSelectID.commSelectId = e), + void (TabSelectID.manageSelectId = e) + ); + -1 === e.indexOf("decision-management") + ? (TabSelectID.commSelectId = e) + : e.indexOf("decision-management") > -1 + ? (TabSelectID.manageSelectId = e) + : ((TabSelectID.commSelectId = e), + (TabSelectID.manageSelectId = e)); + }, + }, + ], + }, + ], + } + ); + }, + _calculateMaxSize: function () { + var e = this.element.width(); + this.store.setRegionWidth(e); + }, + _populate: function (e) { + this.tabs.populate(e); + }, + setValue: function (e) { + this.tabs.setValue(e); + }, + populate: function (e) { + this.tabs.populate(e); + }, + beforeDestroy: function () { + BI.Resizers.remove(this.getName()); + }, + }); + BI.shortcut("dec.frame.k.sky.tab_pane.tabs", o); + var a = BI.inherit(BI.BasicButton, { + props: { + baseCls: + "dec-workbench-tabs-button-wrapper dec-frame-tab-pane-tabs-normal-item bi-border-left bi-border-right", + $testId: "dec-frame-tab-pane-tabs-tab", + text: "", + value: "", + height: 30, + width: 134, + textWidth: 115, + entry: !1, + }, + render: function () { + var e = this, + t = this.options; + return { + type: "bi.absolute", + cls: "k-sky-button", + items: [ + { + el: { + type: "bi.bubble_combo", + cls: "dec-workbench-tabs-bubble-combo", + trigger: "", + offsetStyle: "center", + isNeedAdjustWidth: (this._isFirst = !1), + el: { + type: "bi.text_button", + cls: "dec-frame-text dec-frame-tab-text", + height: t.height, + textAlign: "left", + hgap: 10, + text: t.cardName || t.text, + title: t.cardName || t.text, + value: t.value, + selected: t.selected, + ref: function (t) { + e.tabButton = t; + }, + listeners: [ + { + eventName: BI.Controller.EVENT_CHANGE, + action: function () { + e.fireEvent(BI.Controller.EVENT_CHANGE, arguments); + }, + }, + ], + }, + popup: { + el: { + type: "dec.frame.k.sky.tab_pane.tabs.tab.tools", + value: t.value, + entry: t.entry, + isFavorite: t.isFavorite, + ref: function (t) { + e.popup = t; + }, + listeners: [ + { + eventName: "EVENT_CHANGE", + action: function () { + e.combo.hideView(); + }, + }, + ], + }, + cls: "dec-frame-tab-pane-tabs-item-popup-view", + maxWidth: null, + minWidth: null, + minHeight: "", + }, + ref: function (t) { + e.combo = t; + }, + }, + top: 0, + right: 0, + bottom: 0, + left: 0, + }, + { + el: { + type: "bi.center_adapt", + cls: "close-button-container blur-background", + items: [ + { + type: "bi.icon_button", + width: 16, + stopPropagation: !0, + cls: "close-h-font close-button", + title: BI.i18nText("Dec-Basic_Close"), + ref: function (t) { + e.closeButton = t; + }, + listeners: [ + { + eventName: BI.IconButton.EVENT_CHANGE, + action: function () { + BI.Providers.getProvider( + "dec.provider.k.sky.tab_pane" + ).behaviour("closeTabByName", t.value); + }, + }, + ], + }, + ], + }, + top: 0, + right: 2, + bottom: 0, + }, + ], + }; + }, + _isFirstClick: function () { + return this._isFirst; + }, + setSelected: function (e) { + var t = this; + a.superclass.setSelected.apply(this, arguments), + e + ? this.element.hover( + function () { + t._isFirstClick() && t.combo.showView(); + }, + function () { + t.combo.hideView(); + } + ) + : (this.element.unbind("mouseenter").unbind("mouseleave"), + (t._isFirst = !1)), + t.tabButton.setSelected(e), + BI.delay(function () { + t._isFirst = !0; + }, 70); + }, + isSelected: function () { + return this.tabButton.isSelected(); + }, + getValue: function () { + return this.options.value; + }, + }); + (a.EVENT_CHANGE = "EVENT_CHANGE"), + BI.shortcut("dec.frame.k.sky.tab_pane.tabs.tab", a); + var r = BI.inherit(Fix.Model, { + state: function () { + return {}; + }, + context: [], + computed: { + isFavorite: function () { + var e = this; + return BI.some(Dec.Favorites.favorites, function (t, i) { + return i.id === e.options.value; + }); + }, + }, + actions: { + addFavorite: function (e) { + Dec.Utils.handlerCollect(e, !0, function (t) { + BI.Tree.traversal(MenuEntries, function (t, i) { + if (i.value === e) + return ( + Dec.Favorites.favorites.unshift( + BI.extend({id: i.value}, i) + ), + !1 + ); + }); + }); + }, + removeFavorite: function (e) { + Dec.Utils.handlerCollect(e, !1, function (t) { + BI.remove(Dec.Favorites.favorites, function (t, i) { + return i.id === e; + }); + }); + }, + }, + }); + BI.model("dec.model.frame.k.sky.tab_pane.tabs.tools", r); + var s = BI.inherit(BI.Widget, { + props: { + baseCls: "dec-refresh-favorite-tools dec-frame-tab-pane-tabs-tools", + $testId: "dec-frame-tab-pane-tabs-tools", + value: "", + height: 40, + }, + _store: function () { + return BI.Models.getModel( + "dec.model.frame.k.sky.tab_pane.tabs.tools", + this.options + ); + }, + watch: { + isFavorite: function () { + this._refreshTools(); + }, + }, + render: function () { + var e = this; + return ( + this.options, + { + type: "bi.button_group", + layouts: [{type: "bi.center_adapt"}], + ref: function (t) { + e.tools = t; + }, + items: this._createTools(), + } + ); + }, + _createTools: function () { + var e = this, + t = this.options, + i = []; + return ( + i.push({ + type: "bi.icon_text_item", + logic: {dynamic: !0}, + height: 22, + cls: "refresh-tab-font dec-frame-tab-pane-tabs-tools-item", + text: BI.i18nText("Dec-Basic_Refresh"), + handler: function () { + BI.Providers.getProvider("dec.provider.k.sky.tab_pane").behaviour( + "refreshCardByName", + t.value + ), + e.fireEvent("EVENT_CHANGE"); + }, + }), + t.entry && + (i.push({ + el: { + type: "bi.center_adapt", + items: [ + { + type: "bi.layout", + cls: "dec-frame-tab-pane-tabs-normal-item-split-line", + height: 15, + width: 1, + }, + ], + }, + width: 1, + }), + i.push({ + type: "bi.icon_text_item", + logic: {dynamic: !0}, + height: 22, + cls: + (this.model.isFavorite + ? "already-favorite-font" + : "favorite-font") + " dec-frame-tab-pane-tabs-tools-item", + text: this.model.isFavorite + ? BI.i18nText("Dec-Basic_Cancel") + : BI.i18nText("Dec-Basic_Favorite"), + handler: function () { + e.model.isFavorite + ? e.store.removeFavorite(t.value) + : e.store.addFavorite(t.value); + }, + })), + BI.map(i, function (e, t) { + return {type: "bi.center_adapt", hgap: 8, items: [t]}; + }) + ); + }, + _refreshTools: function () { + this.tools.populate(this._createTools()); + }, + }); + BI.shortcut("dec.frame.k.sky.tab_pane.tabs.tab.tools", s); + var c = BI.inherit(BI.BasicButton, { + props: { + baseCls: "dec-frame-tab-pane-tabs-homepage-item", + $testId: "dec-frame-tab-pane-tabs-homepage-tab", + text: "", + value: "", + height: 30, + width: 60, + entry: !1, + }, + render: function () { + var e = this, + t = this.options; + return { + type: "bi.absolute", + items: [ + { + el: { + type: "bi.bubble_combo", + cls: "dec-workbench-tabs-bubble-combo home-page", + trigger: "", + offsetStyle: "center", + isNeedAdjustWidth: (this._isFirst = !1), + el: { + type: "bi.icon_button", + cls: "home-font dec-workbench-tabs-button", + height: t.height, + hgap: 10, + value: t.value, + selected: t.selected, + ref: function (t) { + e.tabButton = t; + }, + listeners: [ + { + eventName: BI.Controller.EVENT_CHANGE, + action: function () { + e.fireEvent(BI.Controller.EVENT_CHANGE, arguments); + }, + }, + ], + }, + popup: { + el: { + type: "dec.frame.k.sky.tab_pane.tabs.tab.tools", + value: t.value, + entry: t.entry, + isFavorite: t.isFavorite, + ref: function (t) { + e.popup = t; + }, + }, + cls: "dec-frame-tab-pane-tabs-item-popup-view", + maxWidth: null, + minWidth: null, + minHeight: "", + }, + ref: function (t) { + e.combo = t; + }, + listeners: [ + { + eventName: BI.BubbleCombo.EVENT_CHANGE, + action: function () { + }, + }, + ], + }, + top: 0, + right: 1, + bottom: 0, + left: 0, + }, + { + el: { + type: "bi.layout", + cls: "dec-tab-button-gap-line", + width: 1, + }, + top: 0, + bottom: 0, + left: 0, + }, + ], + }; + }, + _isFirstClick: function () { + return this._isFirst; + }, + setSelected: function (e) { + var t = this; + c.superclass.setSelected.apply(this, arguments), + e + ? this.element.hover( + function () { + t._isFirstClick() && t.combo.showView(); + }, + function () { + t.combo.hideView(); + } + ) + : (this.element.unbind("mouseenter").unbind("mouseleave"), + (t._isFirst = !1)), + t.tabButton.setSelected(e), + BI.delay(function () { + t._isFirst = !0; + }, 70); + }, + isSelected: function () { + return this.tabButton.isSelected(); + }, + getValue: function () { + return this.options.value; + }, + }); + BI.shortcut("dec.frame.k.sky.tab_pane.tabs.homepage_tab", c); + })(), + (function () { + var e = BI.inherit(BI.Widget, { + props: {baseCls: "bi-dashboard-new-popup"}, + _store: function () { + return BI.Models.getModel("bi.model.xx.new_dashboard_popup"); + }, + watch: { + nameValid: function () { + this.name.focus(); + }, + errorText: function (e) { + BI.isNotNull(e) && this.saveButton.setWarningTitle(BI.i18nText(e)); + }, + }, + beforeInit: function (e) { + this.store.assertAllList(e); + }, + mounted: function () { + this.name.focus(!0); + }, + render: function () { + var e = this; + return { + type: "bi.bubble_bar_popup_view", + el: { + type: "bi.absolute", + height: 70, + items: [ + { + el: { + type: "bi.vertical", + items: [ + { + el: { + type: "bi.vertical_adapt", + height: 24, + items: [ + { + type: "bi.label", + textAlign: "left", + text: BI.i18nText("BI-Basic_Name"), + hgap: 5, + }, + { + type: "dec.error_label", + width: 196, + errorHeight: 18, + el: { + type: "bi.editor", + cls: "bi-border", + height: 22, + ref: function (t) { + e.name = t; + }, + value: this.model.name, + validationChecker: BI.bind( + this.store.checkName, + this.store + ), + quitChecker: function () { + return !1; + }, + errorText: function (e) { + return BI.i18nText( + "" === e + ? "BI-Platform_Dashboard_Name_No_Blank" + : "BI-Platform_Dashboard_Name_No_Repeat" + ); + }, + listeners: [ + { + eventName: BI.SignEditor.EVENT_VALID, + action: function (t) { + e.editorError.hideError(), + e.store.setName(t); + }, + }, + { + eventName: BI.SignEditor.EVENT_ERROR, + action: function (t) { + e.store.setName(t); + }, + }, + { + eventName: BI.SignEditor.EVENT_CHANGE, + action: function () { + e.editorError.hideError(), + e.store.setName(this.getValue()); + }, + }, + { + eventName: BI.SignEditor.EVENT_BLUR, + action: function () { + e.editorError.hideError(); + }, + }, + ], + }, + ref: function (t) { + e.editorError = t; + }, + }, + ], + }, + tgap: 20, + }, + { + el: { + type: "bi.vertical_adapt", + height: 24, + items: [ + { + type: "bi.label", + textAlign: "left", + text: BI.i18nText("BI-Basic_Position"), + hgap: 5, + }, + { + type: "bi.multilayer_select_tree_combo", + height: 24, + width: 196, + ref: function (t) { + e.locationCombo = t; + }, + items: this.model.locationItems, + value: this.model.location, + listeners: [ + { + eventName: + BI.MultiLayerSelectTreeCombo.EVENT_CHANGE, + action: function () { + e.store.setLocation(this.getValue()[0]); + }, + }, + ], + }, + ], + }, + tgap: 10, + }, + ], + }, + top: -10, + left: 0, + right: 0, + bottom: 0, + }, + ], + }, + buttons: [ + { + text: BI.i18nText("BI-Basic_Cancel"), + level: "ignore", + height: 24, + stopPropagation: !0, + handler: function () { + e.fireEvent("EVENT_CHANGE"); + }, + }, + { + text: BI.i18nText("BI-Basic_Sure"), + height: 24, + stopPropagation: !0, + ref: function () { + e.saveButton = this; + }, + handler: function () { + e._validation() && e.store.newDashboard(e._closePopup.bind(e)); + }, + }, + ], + minWidth: 270, + }; + }, + _closePopup: function () { + this.fireEvent("EVENT_CHANGE"); + }, + _validation: function () { + return !!this.model.nameValid || (this.name.focus(), !1); + }, + }); + BI.shortcut("bi.xx.new_dashboard_popup", e); + })(), + (function () { + var e = + (BI.i18nText("BI-Platform_Dashboard"), + BI.i18nText("BI-Platform_Dashboard"), + BI.inherit(Fix.Model, { + _init: function () { + this.service = BI.Services.getService( + "bi.service.dashboard.new_dashboard", + {ROOT: -1} + ); + }, + state: function () { + return { + rootItem: { + id: Dec.personal.userId, + text: BI.i18nText("BI-Platform_Dashboard"), + title: BI.i18nText("BI-Platform_Dashboard"), + value: Dec.personal.userId, + open: !0, + }, + location: Dec.personal.userId, + name: "", + allList: [], + currentFolderTemplates: [], + curFolder: {id: ""}, + }; + }, + context: ["list", "addResult"], + computed: { + locationItems: function () { + return [this.model.rootItem].concat(this.model.allList); + }, + errorText: function () { + return this.model.nameValid + ? null + : BI.isEmptyString(this.model.name) + ? "BI-Platform_Dashboard_Name_No_Blank" + : "BI-Platform_Dashboard_Name_No_Repeat"; + }, + nameValid: function () { + var e = this.model.name; + return ( + !BI.find(this.model.currentFolderTemplates, function (t, i) { + return i.name === e; + }) && !BI.isEmptyString(e) + ); + }, + }, + actions: { + assertAllList: function (e) { + var t = this, + i = null; + t.model.curFolder && + t.model.curFolder.id && + (i = t.model.curFolder.id), + BI.Utils.getAllReportFolders(function (n) { + var o = t.service.formatList(n.data); + (t.model.allList = o), + (t.model.location = i || t.model.location), + t.handleLocationChange(t.model.location, function () { + (t.model.name = BI.Func.createDistinctName( + t.model.currentFolderTemplates, + BI.i18nText("BI-Platform_New_Dashboard") + )), + e(); + }); + }); + }, + checkName: function (e) { + return ( + !BI.find(this.model.currentFolderTemplates, function (t, i) { + return i.name === e; + }) && !BI.isEmptyString(e) + ); + }, + setName: function (e) { + this.model.name = e; + }, + handleLocationChange: function (e, t) { + var i = this; + (this.model.location = e), + BI.Utils.getReportListUnderFolder( + this.model.location, + function (e) { + (i.model.currentFolderTemplates = e.data), t && t(); + } + ); + }, + setLocation: function (e) { + (this.model.location = e), + this.handleLocationChange(this.model.location); + }, + newDashboard: function (e) { + var t = this, + i = {name: this.model.name, parentId: this.model.location}, + n = window.open(); + BI.Utils.newDashboard(i, function (i) { + (t.model.addResult = i), + (n.name = i.data.id + "edit"), + (n.location = + Dec.fineServletURL + + "/v5/design/report/" + + i.data.id + + "/edit"), + e(); + }); + }, + }, + })); + BI.model("bi.model.xx.new_dashboard_popup", e); + })(), + (function () { + var r = BI.inherit(Fix.Model, { + state: function () { + return { + isAssistantEnabled: window.isShuzhiniaoAssistantEnabled + } + }, + computed: {}, + actions: { + checkAssistantEnabled: function () { + var t = this; + window.isShuzhiniaoAssistantEnabled ? t.model.isAssistantEnabled = !0 : window.addEventListener("message", (function e(r) { + var n = r.data; + "AssistantPermissionChange" === n.type && (n.value && (window.isShuzhiniaoAssistantEnabled = !0, t.model.isAssistantEnabled = !0), window.removeEventListener("message", e, !1)) + }), !1) + } + } + }); + BI.model("dec.model.plugin.sky.elite.issue.entry", r); + var afun = function(t) { + var e = ""; + return window.Dec && window.Dec.fineServletURL ? e = window.Dec.fineServletURL : window.FR && window.FR.fineServletURL && (e = window.FR.fineServletURL), + e + "/url/elite/sso?redirect=" + encodeURIComponent(t) + } + var t = "shuzhiniao-create-issue", + e = BI.inherit(BI.Widget, { + props: { + baseCls: "dec-refresh-favorite-tools dec-frame-tab-pane-tabs-tools", + $testId: "dec-frame-tab-pane-tabs-tools", + value: "", + isFavorite: !1, + collectable: !1, + height: 40 + }, + _store: function () { + return BI.Models.getModel("dec.model.plugin.sky.elite.issue.entry") + }, + watch: { + isAssistantEnabled: function (t) { + this._refreshTools() + } + }, + mounted: function () { + this.store.checkAssistantEnabled() + }, + render: function () { + var t = this; + this.options; + return { + type: "bi.button_group", + layouts: [{ + type: "bi.center_adapt" + }], + ref: function (e) { + t.tools = e + }, + items: this._createTools() + } + }, + _createTools: function () { + var t = this, + e = this.options, + r = [Object.assign({}, e, { + type: "dec.frame.k.sky.tab_pane.tabs.tab.tools", + originalTabTools: !0 + })]; + return e.entry && t.model.isAssistantEnabled && (r.push({ + el: { + type: "bi.center_adapt", + hgap: 8, + items: [{ + type: "bi.layout", + cls: "dec-frame-tab-pane-tabs-normal-item-split-line", + height: 15, + width: 1 + }] + }, + width: 1 + }), r.push({ + type: "bi.text_item", + logic: { + dynamic: !0 + }, + height: 22, + textHgap: 8, + cls: "dec-frame-tab-pane-tabs-tools-item", + text: "需求反馈", + handler: function () { + t.showIssueModal(e.value), t.fireEvent("EVENT_CHANGE") + } + }), r.push({ + el: { + type: "bi.center_adapt", + hgap: 8, + items: [{ + type: "bi.layout", + cls: "dec-frame-tab-pane-tabs-normal-item-split-line", + height: 15, + width: 1 + }] + }, + width: 1 + }), r.push({ + type: "bi.text_item", + logic: { + dynamic: !0 + }, + height: 22, + textHgap: 8, + cls: "dec-frame-tab-pane-tabs-tools-item", + text: "关联内容", + handler: function () { + t.showIssueListModal(e), t.fireEvent("EVENT_CHANGE") + } + })), r + }, + _refreshTools: function () { + this.tools.populate(this._createTools()) + }, + showIssueListModal: function (t) { + var e = t.value, + r = window.ShuZhiNiao.baseUrl + "/#/requirement/filter/report?frEntryId=" + e, + n = "shuzhiniao-issue-list", + o = !0, + i = function () { + o = !1, BI.Layers.remove(n) + }; + BI.Layers.make(n, { + container: document.body, + offset: { + right: 0, + top: 0, + bottom: 0, + left: 0 + }, + type: "bi.absolute", + items: [{ + el: { + type: "bi.iframe", + name: "需求反馈", + src: r, + width: 660, + css: { + background: "#FFFFFF", + "box-shadow": "0px 9px 28px 8px rgba(0, 0, 0, 0.05), 0px 6px 16px 0px rgba(0, 0, 0, 0.08), 0px 3px 6px -4px rgba(0, 0, 0, 0.12)" + } + }, + right: 0, + top: 0, + bottom: 0 + }, { + el: { + type: "bi.icon_button", + cls: "bi-message-close close-font", + css: "text-align: center;line-height: 40px;z-index=1;", + width: 56, + height: 40, + handler: function () { + i() + } + }, + top: 8, + right: 0 + }] + }), BI.Layers.show(n), window.document.body.addEventListener("click", (function () { + o && i() + }), !1) + }, + showIssueModal: function (e) { + var r = afun("/h5/business/brd?embedded=true&modal=true&hideRootMenu=true&transparent=true&frEntry=" + e); + window.ShuZhiNiao && window.ShuZhiNiao.showModal ? ShuZhiNiao.showModal({ + id: "shuzhiniao-create-issue", + src: r + }) : BI.Popovers.create(t, { + width: 800, + bodyHgap: 20, + bodyTgap: 10, + header: "需求反馈", + logic: { + dynamic: !1, + maxHeight: 600 + }, + body: { + type: "bi.absolute", + items: [{ + el: { + type: "bi.absolute", + items: [{ + el: { + type: "bi.iframe", + name: "需求反馈", + src: r + } + }] + }, + left: -20, + top: -10, + right: -20, + bottom: 0 + }] + }, + listeners: [{ + eventName: "EVENT_CLOSE", + action: function () { + BI.Popovers.remove(t) + } + }] + }).open(t) + } + }); + BI.shortcut("dec.plugin.sky.elite.tab_pane.tabs.tab.tools", e); + //数知鸟 + BI.config("dec.frame.k.sky.tab_pane.tabs.tab.tools", (function (t) { + return t.originalTabTools || (t.type = "dec.plugin.sky.elite.tab_pane.tabs.tab.tools"), t + })); + })(); + +function findTextColor(colorValue) { + // #123456或者rgb(12,34,56)转为rgb数组[12,34,56] + var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/; + var that = colorValue; + if (/^(rgb|RGB)/.test(that)) { + // 处理rgb转为数组 + var aColor = that.replace(/(?:\(|\)|rgb|RGB)*/g, "").split(","); + return resBgColor(aColor); + } else if (reg.test(that)) { + // 处理十六进制色值 + var sColor = colorValue.toLowerCase(); + if (sColor && reg.test(sColor)) { + if (sColor.length === 4) { + var sColorNew = "#"; + for (var i = 1; i < 4; i += 1) { + sColorNew += sColor.slice(i, i + 1).concat(sColor.slice(i, i + 1)); + } + sColor = sColorNew; + } + //处理六位的颜色值 + var sColorChange = []; + for (var i = 1; i < 7; i += 2) { + sColorChange.push(parseInt("0x" + sColor.slice(i, i + 2))); + } + return resBgColor(sColorChange); + } else { + return false; + } + } else { + return false; + } +} +function resBgColor(rgbArr) { + // 当color值大于128时,color值偏向255,即#ffffff,此时字体颜色应为#000000 + // 当color值小于128时,color值偏向0,即#000000,此时字体颜色应为#ffffff + var color = + 0.213 * rgbArr[0] + 0.715 * rgbArr[1] + 0.072 * rgbArr[2] > 255 / 2; + return color ? "#000000" : "#ffffff"; +} + +// 去掉导航栏icon +const styleEl = document.createElement("style"); +styleEl.innerHTML = ` +.bi-expander .dec-common-icon-item { display: none!important } +.dec-common-scroll-wrapper > div > div.bi-v > div > div > div > div .bi-text { margin-left: -38px } +.dec-common-scroll-wrapper > div > div.bi-v > div > div > div > div .bi-basic-button { margin-left: -14px } +.dec-common-scroll-wrapper > div > div.bi-v > div > div > div > div .bi-custom-tree.expander-popup { margin-left: -5px } +.dec-common-scroll-wrapper > div > div.bi-v > div > div > div > div .bi-custom-tree.expander-popup .bi-button-tree.bi-v { margin-left: -10px } + +`; +document.head.appendChild(styleEl);