commit 7f29c3c7c25e658e76fba1c049600d91e45350c6 Author: qcc Date: Sat Mar 16 14:09:26 2019 +0800 feat: 首次提交插件 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7bd1f8c --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +*.iml +.idea/ +.classpath +.DS_Store +lib/report/*.jar \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..9223d94 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# login-theme-fresh + +清新风格登录主题 diff --git a/build.xml b/build.xml new file mode 100644 index 0000000..0cd9c89 --- /dev/null +++ b/build.xml @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/plugin.xml b/plugin.xml new file mode 100644 index 0000000..a8d0a88 --- /dev/null +++ b/plugin.xml @@ -0,0 +1,18 @@ + + com.fr.plugin.login.theme.fresh + + no + 1.0 + 10.0 + 2018-10-10 + Frank.Qiu + + + + + + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..d695986 --- /dev/null +++ b/pom.xml @@ -0,0 +1,14 @@ + + + 4.0.0 + + + com.fr.plugin + starter + 1.0 + + jar + demo-login-theme-fresh + \ No newline at end of file diff --git a/src/main/java/com/fr/plugin/login/theme/fresh/FreshComponent.java b/src/main/java/com/fr/plugin/login/theme/fresh/FreshComponent.java new file mode 100644 index 0000000..6665fce --- /dev/null +++ b/src/main/java/com/fr/plugin/login/theme/fresh/FreshComponent.java @@ -0,0 +1,35 @@ +package com.fr.plugin.login.theme.fresh; + +import com.fr.decision.config.AppearanceConfig; +import com.fr.web.struct.Component; +import com.fr.web.struct.category.ScriptPath; +import com.fr.web.struct.category.StylePath; +import com.fr.web.struct.Filter; + +public class FreshComponent extends Component { + + public static final FreshComponent KEY = new FreshComponent(); + + private FreshComponent() { + + } + + @Override + public ScriptPath script() { + return ScriptPath.build("com/fr/plugin/login/theme/fresh/web/theme.js"); + } + + @Override + public StylePath style() { + return StylePath.build("com/fr/plugin/login/theme/fresh/web/style.css"); + } + + @Override + public Filter filter() { + return new Filter() { + public boolean accept() { + return "com.fr.plugin.login.theme.fresh".equals(AppearanceConfig.getInstance().getLoginPageId()); + } + }; + } +} \ No newline at end of file diff --git a/src/main/java/com/fr/plugin/login/theme/fresh/FreshTheme.java b/src/main/java/com/fr/plugin/login/theme/fresh/FreshTheme.java new file mode 100644 index 0000000..693c0ed --- /dev/null +++ b/src/main/java/com/fr/plugin/login/theme/fresh/FreshTheme.java @@ -0,0 +1,49 @@ +package com.fr.plugin.login.theme.fresh; + +import com.fr.decision.fun.impl.AbstractLoginPageProvider; +import com.fr.decision.web.LoginComponent; +import com.fr.intelli.record.Focus; +import com.fr.intelli.record.Original; +import com.fr.record.analyzer.EnableMetrics; +import com.fr.web.struct.Atom; + +@EnableMetrics +public class FreshTheme extends AbstractLoginPageProvider { + + + @Override + public Atom attach() { + return LoginComponent.KEY; + } + + @Override + @Focus(id = "com.fr.plugin.login.theme.fresh", text = "清新风格", source = Original.PLUGIN) + public Atom client() { + return FreshComponent.KEY; + } + + @Override + public String name() { + return "FreshTheme"; + } + + @Override + public String text() { + return "清新风格"; + } + + @Override + public String coverPath() { + return "com/fr/plugin/login/theme/fresh/web/login_style.png"; + } + + @Override + public int imgHeight() { + return 1280; + } + + @Override + public int imgWidth() { + return 1280; + } +} \ No newline at end of file diff --git a/src/main/resources/com/fr/plugin/login/theme/fresh/web/images/1x/fresh_bg.png b/src/main/resources/com/fr/plugin/login/theme/fresh/web/images/1x/fresh_bg.png new file mode 100644 index 0000000..b350885 Binary files /dev/null and b/src/main/resources/com/fr/plugin/login/theme/fresh/web/images/1x/fresh_bg.png differ diff --git a/src/main/resources/com/fr/plugin/login/theme/fresh/web/images/1x/logo_FR.png b/src/main/resources/com/fr/plugin/login/theme/fresh/web/images/1x/logo_FR.png new file mode 100644 index 0000000..07ffa03 Binary files /dev/null and b/src/main/resources/com/fr/plugin/login/theme/fresh/web/images/1x/logo_FR.png differ diff --git a/src/main/resources/com/fr/plugin/login/theme/fresh/web/images/2x/fresh_bg.png b/src/main/resources/com/fr/plugin/login/theme/fresh/web/images/2x/fresh_bg.png new file mode 100644 index 0000000..f8bf647 Binary files /dev/null and b/src/main/resources/com/fr/plugin/login/theme/fresh/web/images/2x/fresh_bg.png differ diff --git a/src/main/resources/com/fr/plugin/login/theme/fresh/web/images/2x/logo_FR.png b/src/main/resources/com/fr/plugin/login/theme/fresh/web/images/2x/logo_FR.png new file mode 100644 index 0000000..07ffa03 Binary files /dev/null and b/src/main/resources/com/fr/plugin/login/theme/fresh/web/images/2x/logo_FR.png differ diff --git a/src/main/resources/com/fr/plugin/login/theme/fresh/web/js/login.js b/src/main/resources/com/fr/plugin/login/theme/fresh/web/js/login.js new file mode 100644 index 0000000..1568684 --- /dev/null +++ b/src/main/resources/com/fr/plugin/login/theme/fresh/web/js/login.js @@ -0,0 +1,76 @@ +!(function () { + var Login = BI.inherit(BI.Widget, { + + props: { + baseCls: "dec-login" + }, + + _store: function () { + return BI.Models.getModel("dec.model.login"); + }, + + watch: { + }, + + render: function () { + var self = this, loginConfig = this.model.loginConfig; + return { + type: "bi.htape", + cls: "dec-login-fresh", + items: [{ + type: "bi.default" + }, { + type: "bi.center_adapt", + width: 0.35, + cls: "login-area", + items: [{ + type: "bi.absolute", + height: 480, + width: "100%", + items: [{ + el: { + type: "bi.vtape", + items: [{ + type: "bi.horizontal_auto", + height: 100, + items: [{ + el: { + type: "bi.center_adapt", + items: [{ + type: "bi.img", + src: BI.isEmpty(loginConfig.loginLogoImgId) ? + (Dec.resourceURL + "resources/logo.png") : (Dec.fineServletURL + "/login/image/" + loginConfig.loginLogoImgId), + height: 50, + width: "auto" + }] + } + }, { + el: { + type: "bi.label", + height: 24, + cls: "dec-font-weight-bold", + text: loginConfig.loginTitle + }, + tgap: 24 + }], + ref: function (_ref) { + self.logo = _ref; + } + }, { + type: "dec.login.index", + listeners: [{ + eventName: "EVENT_CHANGE", + action: function (v) { + self.logo.setVisible(v === DecCst.Login.Tabs.LOGIN); + } + }] + }] + }, top: 0, right: 89, bottom: 0, left: 89 + }] + }] + }] + }; + } + }); + BI.shortcut("dec.login.custom", Login); +})(); \ No newline at end of file diff --git a/src/main/resources/com/fr/plugin/login/theme/fresh/web/login_style.png b/src/main/resources/com/fr/plugin/login/theme/fresh/web/login_style.png new file mode 100644 index 0000000..0dfeeb5 Binary files /dev/null and b/src/main/resources/com/fr/plugin/login/theme/fresh/web/login_style.png differ diff --git a/src/main/resources/com/fr/plugin/login/theme/fresh/web/style.css b/src/main/resources/com/fr/plugin/login/theme/fresh/web/style.css new file mode 100644 index 0000000..87d3d30 --- /dev/null +++ b/src/main/resources/com/fr/plugin/login/theme/fresh/web/style.css @@ -0,0 +1,21 @@ +.login-area { + max-width: 500px; + min-width: 448px; + background-color: rgba(255, 255, 255, 0.95); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#f2ffffff,endColorstr=#f2ffffff); +} + +.dec-login-fresh { + background: url('com/fr/plugin/login/theme/fresh/web/images/2x/fresh_bg.png') no-repeat center center; + _filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='com/fr/plugin/login/theme/fresh/web/images/2x/fresh_bg.png'); + background-size: contain; + _background: none; +} +.dec-login-fresh.hack { + background: url('com/fr/plugin/login/theme/fresh/web/images/1x/fresh_bg.png') no-repeat center center; + _filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='com/fr/plugin/login/theme/fresh/web/dist/images/1x/fresh_bg.png'); + _background: none; +} +.dec-login-fresh { + background-size: cover; +} \ No newline at end of file diff --git a/src/main/resources/com/fr/plugin/login/theme/fresh/web/theme.js b/src/main/resources/com/fr/plugin/login/theme/fresh/web/theme.js new file mode 100644 index 0000000..1568684 --- /dev/null +++ b/src/main/resources/com/fr/plugin/login/theme/fresh/web/theme.js @@ -0,0 +1,76 @@ +!(function () { + var Login = BI.inherit(BI.Widget, { + + props: { + baseCls: "dec-login" + }, + + _store: function () { + return BI.Models.getModel("dec.model.login"); + }, + + watch: { + }, + + render: function () { + var self = this, loginConfig = this.model.loginConfig; + return { + type: "bi.htape", + cls: "dec-login-fresh", + items: [{ + type: "bi.default" + }, { + type: "bi.center_adapt", + width: 0.35, + cls: "login-area", + items: [{ + type: "bi.absolute", + height: 480, + width: "100%", + items: [{ + el: { + type: "bi.vtape", + items: [{ + type: "bi.horizontal_auto", + height: 100, + items: [{ + el: { + type: "bi.center_adapt", + items: [{ + type: "bi.img", + src: BI.isEmpty(loginConfig.loginLogoImgId) ? + (Dec.resourceURL + "resources/logo.png") : (Dec.fineServletURL + "/login/image/" + loginConfig.loginLogoImgId), + height: 50, + width: "auto" + }] + } + }, { + el: { + type: "bi.label", + height: 24, + cls: "dec-font-weight-bold", + text: loginConfig.loginTitle + }, + tgap: 24 + }], + ref: function (_ref) { + self.logo = _ref; + } + }, { + type: "dec.login.index", + listeners: [{ + eventName: "EVENT_CHANGE", + action: function (v) { + self.logo.setVisible(v === DecCst.Login.Tabs.LOGIN); + } + }] + }] + }, top: 0, right: 89, bottom: 0, left: 89 + }] + }] + }] + }; + } + }); + BI.shortcut("dec.login.custom", Login); +})(); \ No newline at end of file