Compare commits

...

5 Commits

Author SHA1 Message Date
fuhou
92412bf850 Merge branch 'main-dev2' into main-dev
# Conflicts:
#	pom.xml
2025-04-21 21:17:07 +08:00
fuhou
aefded7edd 🎉 init project 2025-04-21 21:12:58 +08:00
10118e9cbe 🎉 init project 2025-04-21 16:47:28 +08:00
c798e23c0b 🎉 init project 2025-04-21 16:15:05 +08:00
e7ad5f30f2 🎉 init project 2025-04-21 15:57:22 +08:00
6 changed files with 170 additions and 257 deletions

Binary file not shown.

Binary file not shown.

162
pom.xml
View File

@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>cecilia-ui</groupId>
<artifactId>cecilia-ui</artifactId>
<version>1.0-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<properties>
<java.version>17</java.version>
@ -16,7 +16,7 @@
<feign.version>12.1</feign.version>
<datafx.version>8.0.2-SNAPSHOT</datafx.version>
<atlantafx.version>2.0.0</atlantafx.version>
<spring-boot.version>2.7.1</spring-boot.version>
<spring-boot.version>2.7.18</spring-boot.version>
</properties>
<dependencies>
@ -59,22 +59,6 @@
<version>11.13.5</version>
</dependency>
<dependency>
<groupId>de.saxsys</groupId>
<artifactId>mvvmfx</artifactId>
<version>${mvvmfx-version}</version>
<!-- <scope>system</scope>-->
<!-- <systemPath>${pom.basedir}/libs/mvvmfx-1.9.0-SNAPSHOT.jar</systemPath>-->
</dependency>
<dependency>
<groupId>de.saxsys</groupId>
<artifactId>mvvmfx-validation</artifactId>
<version>${mvvmfx-version}</version>
<!-- <scope>system</scope>-->
<!-- <systemPath>${pom.basedir}/libs/mvvmfx-validation-1.9.0-SNAPSHOT.jar</systemPath>-->
</dependency>
<dependency>
<groupId>fr.brouillard.oss</groupId>
<artifactId>cssfx</artifactId>
@ -96,22 +80,6 @@
<artifactId>ikonli-material2-pack</artifactId>
<version>${ikonli-javafx-version}</version>
</dependency>
<dependency>
<groupId>com.github.goxr3plus</groupId>
<artifactId>FX-BorderlessScene</artifactId>
<version>4.4.0</version>
<scope>system</scope>
<systemPath>${pom.basedir}/libs/FX-BorderlessScene-4.4.0.jar</systemPath>
</dependency>
<dependency>
<groupId>com.formdev</groupId>
<artifactId>svgSalamander</artifactId>
<version>1.1.3</version>
</dependency>
<dependency>
<groupId>org.kordamp.jipsy</groupId>
<artifactId>jipsy-processor</artifactId>
@ -119,6 +87,27 @@
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.github.openfeign</groupId>
<artifactId>feign-core</artifactId>
<version>${feign.version}</version>
</dependency>
<dependency>
<groupId>io.github.openfeign</groupId>
<artifactId>feign-slf4j</artifactId>
<version>${feign.version}</version>
</dependency>
<dependency>
<groupId>io.github.openfeign</groupId>
<artifactId>feign-gson</artifactId>
<version>${feign.version}</version>
</dependency>
<dependency>
<groupId>io.github.openfeign</groupId>
<artifactId>feign-okhttp</artifactId>
<version>${feign.version}</version>
</dependency>
<dependency>
<groupId>datafx-core</groupId>
<artifactId>datafx-core</artifactId>
@ -126,6 +115,46 @@
<scope>system</scope>
<systemPath>${pom.basedir}/libs/datafx-core-8.0.2-SNAPSHOT.jar</systemPath>
</dependency>
<dependency>
<groupId>com.dlsc.gemsfx</groupId>
<artifactId>gemsfx</artifactId>
<version>2.32.0</version>
<exclusions>
<exclusion>
<groupId>org.openjfx</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
<scope>system</scope>
<systemPath>${pom.basedir}/libs/gemsfx-2.32.0.jar</systemPath>
</dependency>
<dependency>
<groupId>com.github.goxr3plus</groupId>
<artifactId>FX-BorderlessScene</artifactId>
<version>4.4.0</version>
<scope>system</scope>
<systemPath>${pom.basedir}/libs/FX-BorderlessScene-4.4.0.jar</systemPath>
</dependency>
<dependency>
<groupId>de.saxsys</groupId>
<artifactId>mvvmfx</artifactId>
<version>${mvvmfx-version}</version>
<!--<scope>system</scope>
<systemPath>${pom.basedir}/libs/mvvmfx-1.9.0-SNAPSHOT.jar</systemPath>-->
</dependency>
<dependency>
<groupId>de.saxsys</groupId>
<artifactId>mvvmfx-validation</artifactId>
<version>${mvvmfx-version}</version>
<scope>system</scope>
<systemPath>${pom.basedir}/libs/mvvmfx-validation-1.9.0-SNAPSHOT.jar</systemPath>
</dependency>
<dependency>
<groupId>com.formdev</groupId>
<artifactId>svgSalamander</artifactId>
<version>1.1.3</version>
</dependency>
<dependency>
<groupId>io.github.typhon0</groupId>
<artifactId>AnimateFX</artifactId>
@ -141,29 +170,6 @@
<artifactId>hutool-all</artifactId>
<version>5.8.4</version>
</dependency>
<dependency>
<groupId>io.github.openfeign</groupId>
<artifactId>feign-core</artifactId>
<version>${feign.version}</version>
</dependency>
<dependency>
<groupId>io.github.openfeign</groupId>
<artifactId>feign-slf4j</artifactId>
<version>${feign.version}</version>
</dependency>
<dependency>
<groupId>io.github.openfeign</groupId>
<artifactId>feign-gson</artifactId>
<version>${feign.version}</version>
</dependency>
<dependency>
<groupId>io.github.openfeign</groupId>
<artifactId>feign-okhttp</artifactId>
<version>${feign.version}</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
@ -175,7 +181,6 @@
<version>0.7.6</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>net.datafaker</groupId>
<artifactId>datafaker</artifactId>
@ -202,7 +207,6 @@
</exclusion>
</exclusions>
</dependency>
</dependencies>
@ -218,22 +222,7 @@
</dependencies>
</dependencyManagement>
<repositories>
<repository>
<id>sonatype-snapshots</id>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@ -243,32 +232,8 @@
<source>17</source>
<target>17</target>
<release>17</release>
</configuration>
</plugin>
<!-- compile SCSS -->
<plugin>
<groupId>us.hebi.sass</groupId>
<artifactId>sass-cli-maven-plugin</artifactId>
<version>1.0.1</version>
<configuration>
<args>
<arg>
${project.basedir}/src/main/resources/styles/scss/index.scss:${project.build.directory}/classes/styles/index.css
</arg>
<arg>--no-source-map</arg>
</args>
</configuration>
<executions>
<execution>
<id>run-sass</id>
<phase>generate-resources</phase>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
@ -290,5 +255,4 @@
</plugins>
</build>
</project>

View File

@ -2,6 +2,10 @@ package com.cecilia.view.loginregister;
import animatefx.animation.*;
import animatefx.util.ParallelAnimationFX;
import atlantafx.base.layout.DeckPane;
import com.cecilia.AppStart;
import com.cecilia.Resources;
import com.dlsc.gemsfx.SVGImageView;
import com.kitfox.svg.app.beans.SVGIcon;
import de.saxsys.mvvmfx.FxmlView;
import de.saxsys.mvvmfx.InjectViewModel;
@ -13,12 +17,16 @@ import io.github.palexdev.materialfx.utils.SwingFXUtils;
import javafx.beans.binding.Bindings;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.scene.control.Hyperlink;
import javafx.scene.control.Label;
import javafx.scene.control.ProgressBar;
import javafx.scene.image.ImageView;
import javafx.scene.layout.HBox;
import javafx.scene.layout.StackPane;
import javafx.scene.layout.*;
import javafx.scene.paint.CycleMethod;
import javafx.scene.paint.LinearGradient;
import javafx.scene.paint.Stop;
import javafx.scene.shape.Rectangle;
import org.kordamp.ikonli.feather.Feather;
import org.kordamp.ikonli.javafx.FontIcon;
@ -26,7 +34,7 @@ import org.kordamp.ikonli.javafx.FontIcon;
import java.awt.image.BufferedImage;
import java.net.URISyntaxException;
import java.net.URL;
import java.util.ResourceBundle;
import java.util.*;
import static atlantafx.base.theme.Styles.STATE_DANGER;
import static com.cecilia.view.loginregister.LoginRegisterViewModel.ON_VIEW_ADDEDA;
@ -41,68 +49,42 @@ public class LoginRegisterView implements FxmlView<LoginRegisterViewModel>, Init
@FXML
private HBox loginPane;
@FXML
private HBox registerPane;
@FXML
private Hyperlink loginLink;
@FXML
private Hyperlink registerLink;
@FXML
private ImageView logoImageView;
@FXML
private ImageView registerImageView;
@FXML
private MFXButton loginBut;
@FXML
private MFXTextField usrNameTextField;
@FXML
private MFXTextField vefCodeTextField;
@FXML
private MFXPasswordField pwdTextField;
@FXML
private MFXButton closeBut;
@FXML
private ImageView codeImeageView;
@FXML
private ProgressBar bar;
@FXML
private Label msg;
@FXML
private DeckPane deckPane;
private final Random random = new Random();
@Override
public void initialize(URL url, ResourceBundle resourceBundle) {
closeBut.setOnAction(event -> MvvmFX.getNotificationCenter().publish("exit"));
SVGIcon svgIcon = new SVGIcon();
SVGIcon svgIcon1 = new SVGIcon();
createImageView();
try {
svgIcon.setSvgURI(LoginRegisterView.class.getResource("/images/dd.svg").toURI());
svgIcon1.setSvgURI(LoginRegisterView.class.getResource("/images/bb.svg").toURI());
} catch (URISyntaxException e) {
throw new RuntimeException(e);
}
closeBut.setOnAction(event -> MvvmFX.getNotificationCenter().publish("exit"));
msg.pseudoClassStateChanged(STATE_DANGER, true);
loginRegisterViewModel.getCodeCommand().execute();
codeImeageView.imageProperty().bind(loginRegisterViewModel.codeImageProperty());
logoImageView.setImage(SwingFXUtils.toFXImage((BufferedImage) svgIcon.getImage(), null));
registerImageView.setImage(SwingFXUtils.toFXImage((BufferedImage) svgIcon1.getImage(), null));
codeImeageView.setOnMouseClicked(event -> loginRegisterViewModel.getCodeCommand().execute());
loginBut.setOnAction(event -> {
loginRegisterViewModel.getLoginCommand().execute();
//
});
loginBut.setOnAction(event -> loginRegisterViewModel.getLoginCommand().execute());
loginRegisterViewModel.successProperty().addListener((observable, oldValue, newValue) -> {
if (newValue) {
BounceOutUp bounceOutDown = new BounceOutUp(loginPane);
bounceOutDown.setOnFinished(event1 -> MvvmFX.getNotificationCenter().publish("showMainView", "显示主界面"));
new ParallelAnimationFX(bounceOutDown, new BounceOutUp(registerPane)).play();
new ParallelAnimationFX(bounceOutDown).play();
}
});
bar.visibleProperty().bind(loginRegisterViewModel.getLoginCommand().runningProperty());
@ -110,6 +92,7 @@ public class LoginRegisterView implements FxmlView<LoginRegisterViewModel>, Init
bar.progressProperty().bind(Bindings.createDoubleBinding(
() -> loginRegisterViewModel.getLoginCommand().isRunning() ? -1d : 0d, loginRegisterViewModel.getLoginCommand().runningProperty())
);
usrNameTextField.textProperty().bindBidirectional(loginRegisterViewModel.userNameProperty());
usrNameTextField.setTrailingIcon(new FontIcon(Feather.USER));
pwdTextField.textProperty().bindBidirectional(loginRegisterViewModel.passWordProperty());
@ -134,37 +117,95 @@ public class LoginRegisterView implements FxmlView<LoginRegisterViewModel>, Init
});
loginRegisterViewModel.subscribe(ON_VIEW_ADDEDA, (s, objects) -> {
new ParallelAnimationFX(new BounceInUp(loginPane), new BounceInUp(registerPane)).play();
new ParallelAnimationFX(new BounceInUp(loginPane)).play();
});
registerLink.setOnAction(event -> {
}
RotateOutDownRight rotateOutDownRight = new RotateOutDownRight(loginPane);
rotateOutDownRight.setResetOnFinished(true);
RotateInDownRight rotateInDownRight = new RotateInDownRight(registerPane);
rotateInDownRight.setResetOnFinished(true);
rotateInDownRight.setOnFinished(event1 -> loginPane.setVisible(false));
ParallelAnimationFX parallelAnimationFX
= new ParallelAnimationFX(rotateOutDownRight, rotateInDownRight);
registerPane.setVisible(true);
parallelAnimationFX.play();
private void createImageView() {
});
List<FunctionType> functionTypes = new ArrayList<>();
// 添加功能
functionTypes.add(new FunctionType("用户管理", "用户管理功能允许管理员轻松管理系统中的用户", "/icons/user-manage.svg"));
functionTypes.add(new FunctionType("数据分析与报表", "数据分析与报表功能提供了系统内部数据的分析和可视化工具", "/icons/baobiaofenxi.svg"));
functionTypes.add(new FunctionType("权限管理", "权限管理功能允许管理员灵活设置系统内各项功能的访问权限", "/icons/quanxian.svg"));
functionTypes.add(new FunctionType("日志审计与监控", "日志审计与监控功能记录和跟踪系统内的操作日志", "/icons/jiankong.svg"));
loginLink.setOnAction(event -> {
RotateOutUpRight rotateOutDownRight = new RotateOutUpRight(registerPane);
rotateOutDownRight.setResetOnFinished(true);
RotateInUpRight rotateInDownRight = new RotateInUpRight(loginPane);
rotateInDownRight.setResetOnFinished(true);
rotateInDownRight.setOnFinished(event1 -> registerPane.setVisible(false));
ParallelAnimationFX parallelAnimationFX
= new ParallelAnimationFX(rotateOutDownRight, rotateInDownRight);
loginPane.setVisible(true);
parallelAnimationFX.play();
});
for (FunctionType functionType : functionTypes) {
SVGImageView svgImageView = new SVGImageView();
svgImageView.setFitWidth(450);
svgImageView.setFitHeight(300);
svgImageView.setSvgUrl(Resources.getResource(functionType.getIcon()).getPath());
VBox.setVgrow(svgImageView, Priority.ALWAYS);
Label titleLabel = new Label(functionType.getTitle());
titleLabel.getStyleClass().add("title-3");
titleLabel.setStyle("-fx-text-fill: #ffffff");
titleLabel.setAlignment(Pos.CENTER);
Label subLabel = new Label(functionType.getDescription());
subLabel.getStyleClass().add("title-4");
subLabel.setStyle("-fx-text-fill: #ffffff");
subLabel.setAlignment(Pos.CENTER);
subLabel.setWrapText(true);
VBox vBox = new VBox(svgImageView, titleLabel, subLabel);
vBox.setAlignment(Pos.CENTER);
vBox.setSpacing(10);
vBox.setStyle(getRandomGradientStyle());
vBox.setPadding(new Insets(10));
AnchorPane.setBottomAnchor(vBox,10D);
AnchorPane.setTopAnchor(vBox,10D);
AnchorPane.setLeftAnchor(vBox,10D);
AnchorPane.setRightAnchor(vBox,10D);
deckPane.getChildren().add(vBox);
}
}
private String getRandomGradientStyle() {
// 生成随机的颜色
Stop[] stops = new Stop[] {
new Stop(0, randomColor()),
new Stop(1, randomColor())
};
LinearGradient gradient = new LinearGradient(0, 0, 1, 1, true, CycleMethod.NO_CYCLE, stops);
// 将渐变转换为CSS样式
return String.format("-fx-background-color: linear-gradient(from 0%% 0%% to 100%% 100%%, %s 0%%, %s 100%%);-fx-background-radius:10 10 10 10",
toHex(stops[0].getColor()), toHex(stops[1].getColor()));
}
private String toHex(javafx.scene.paint.Color color) {
return String.format("#%02X%02X%02X",
(int) (color.getRed() * 255),
(int) (color.getGreen() * 255),
(int) (color.getBlue() * 255));
}
private javafx.scene.paint.Color randomColor() {
return new javafx.scene.paint.Color(random.nextDouble(), random.nextDouble(), random.nextDouble(), 1.0);
}
class FunctionType {
private String title;
private String description;
private String icon;
public FunctionType(String title, String description, String icon) {
this.title = title;
this.description = description;
this.icon = icon;
}
public String getTitle() {
return title;
}
public String getDescription() {
return description;
}
public String getIcon() {
return icon;
}
}
}

View File

@ -17,112 +17,20 @@
<?import javafx.scene.text.Font?>
<?import org.kordamp.ikonli.javafx.FontIcon?>
<?import atlantafx.base.layout.DeckPane?>
<AnchorPane xmlns="http://javafx.com/javafx/19" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.cecilia.view.loginregister.LoginRegisterView">
<children>
<StackPane id="login-pane" fx:id="rootPane" prefHeight="525.0" prefWidth="887.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<children>
<HBox id="login-context-pane" fx:id="registerPane" maxHeight="369.0" maxWidth="630.0" prefHeight="369.0" prefWidth="530.0" visible="false">
<children>
<VBox id="register-info-pane" alignment="TOP_CENTER" HBox.hgrow="ALWAYS">
<children>
<VBox alignment="TOP_CENTER" prefHeight="356.0" prefWidth="310.0" spacing="30.0" VBox.vgrow="ALWAYS">
<children>
<Label text="XXX系统">
<font>
<Font size="48.0" />
</font>
<effect>
<Reflection fraction="0.57" topOffset="-10.0" topOpacity="0.26" />
</effect>
</Label>
<Label text="欢迎访问">
<font>
<Font size="24.0" />
</font>
</Label>
<ImageView fx:id="registerImageView" fitHeight="167.0" fitWidth="254.0" pickOnBounds="true" preserveRatio="true" VBox.vgrow="ALWAYS" />
</children>
<padding>
<Insets top="40.0" />
</padding>
</VBox>
<Label text="©中国.xxx" />
</children>
<padding>
<Insets bottom="10.0" />
</padding>
</VBox>
<VBox id="login-text-pane" alignment="CENTER" maxWidth="300.0" prefWidth="300.0" spacing="10.0">
<children>
<Label text="注 册">
<font>
<Font name="System Bold" size="36.0" />
</font>
</Label>
<MFXTextField id="validatedField" fx:id="usrNameTextField1" floatMode="BORDER" floatingText="用户名" maxWidth="1.7976931348623157E308" prefHeight="45.0" prefWidth="237.0">
<font>
<Font size="16.0" />
</font>
</MFXTextField>
<MFXPasswordField id="validatedField" fx:id="pwdTextField1" floatMode="BORDER" floatingText="密码" maxWidth="1.7976931348623157E308" prefHeight="40.0">
<font>
<Font size="16.0" />
</font>
</MFXPasswordField>
<MFXPasswordField id="validatedField" fx:id="pwdTextField11" floatMode="BORDER" floatingText="确认密码" maxWidth="1.7976931348623157E308" prefHeight="40.0">
<font>
<Font size="16.0" />
</font>
</MFXPasswordField>
<MFXButton id="register-button" fx:id="registerBut" buttonType="RAISED" maxWidth="1.7976931348623157E308" prefHeight="40.0" text="注 册">
<font>
<Font size="18.0" />
</font>
</MFXButton>
<HBox alignment="CENTER_LEFT" />
<HBox alignment="BOTTOM_CENTER" VBox.vgrow="ALWAYS">
<children>
<Label prefHeight="40.0" text="已有账号去" textFill="#00000091" />
<Hyperlink fx:id="loginLink" prefHeight="40.0" text="登录">
<font>
<Font size="16.0" />
</font>
</Hyperlink>
</children>
</HBox>
</children>
<padding>
<Insets bottom="10.0" left="20.0" right="20.0" top="40.0" />
</padding>
</VBox>
</children>
</HBox>
<HBox id="login-context-pane" fx:id="loginPane" maxHeight="369.0" maxWidth="630.0" prefHeight="369.0" prefWidth="530.0">
<children>
<VBox id="login-info-pane" alignment="TOP_CENTER" HBox.hgrow="ALWAYS">
<children>
<VBox alignment="TOP_CENTER" spacing="30.0" VBox.vgrow="ALWAYS">
<children>
<Label text="XXX系统">
<font>
<Font size="48.0" />
</font>
<effect>
<Reflection fraction="0.57" topOffset="-10.0" topOpacity="0.26" />
</effect>
</Label>
<Label text="欢迎访问">
<font>
<Font size="24.0" />
</font>
</Label>
<ImageView fx:id="logoImageView" fitHeight="167.0" fitWidth="254.0" pickOnBounds="true" preserveRatio="true" VBox.vgrow="ALWAYS" />
</children>
<DeckPane fx:id="deckPane" animationDuration="500.0ms" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" VBox.vgrow="ALWAYS">
<padding>
<Insets top="40.0" />
<Insets bottom="20.0" left="20.0" right="20.0" top="20.0" />
</padding>
</VBox>
<Label text="©中国.xxx" />
</DeckPane>
</children>
<padding>
<Insets bottom="10.0" />

View File

@ -1084,7 +1084,7 @@
#login-pane {
-fx-background-size: 100% 100%;
-fx-background-image: url(/images/login.png);
-fx-background-image: url(/images/beijing.png);
}
#login-text {