Compare commits

...

No commits in common. "master" and "fronted-new" have entirely different histories.

123 changed files with 5942 additions and 2364 deletions

2
.gitattributes vendored
View File

@ -1,2 +0,0 @@
/mvnw text eol=lf
*.cmd text eol=crlf

51
.gitignore vendored
View File

@ -1,33 +1,24 @@
HELP.md
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
node_modules
dist
dist-ssr
*.local
### IntelliJ IDEA ###
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
*.iws
*.iml
*.ipr
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/
### VS Code ###
.vscode/
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

View File

@ -1,19 +0,0 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
wrapperVersion=3.3.2
distributionType=only-script
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip

3
.vscode/extensions.json vendored Normal file
View File

@ -0,0 +1,3 @@
{
"recommendations": ["Vue.volar"]
}

5
README.md Normal file
View File

@ -0,0 +1,5 @@
# Vue 3 + Vite
This template should help get you started developing with Vue 3 in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.
Learn more about IDE Support for Vue in the [Vue Docs Scaling up Guide](https://vuejs.org/guide/scaling-up/tooling.html#ide-support).

13
index.html Normal file
View File

@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + Vue</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.js"></script>
</body>
</html>

Binary file not shown.

259
mvnw vendored
View File

@ -1,259 +0,0 @@
#!/bin/sh
# ----------------------------------------------------------------------------
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# ----------------------------------------------------------------------------
# ----------------------------------------------------------------------------
# Apache Maven Wrapper startup batch script, version 3.3.2
#
# Optional ENV vars
# -----------------
# JAVA_HOME - location of a JDK home dir, required when download maven via java source
# MVNW_REPOURL - repo url base for downloading maven distribution
# MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven
# MVNW_VERBOSE - true: enable verbose log; debug: trace the mvnw script; others: silence the output
# ----------------------------------------------------------------------------
set -euf
[ "${MVNW_VERBOSE-}" != debug ] || set -x
# OS specific support.
native_path() { printf %s\\n "$1"; }
case "$(uname)" in
CYGWIN* | MINGW*)
[ -z "${JAVA_HOME-}" ] || JAVA_HOME="$(cygpath --unix "$JAVA_HOME")"
native_path() { cygpath --path --windows "$1"; }
;;
esac
# set JAVACMD and JAVACCMD
set_java_home() {
# For Cygwin and MinGW, ensure paths are in Unix format before anything is touched
if [ -n "${JAVA_HOME-}" ]; then
if [ -x "$JAVA_HOME/jre/sh/java" ]; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
JAVACCMD="$JAVA_HOME/jre/sh/javac"
else
JAVACMD="$JAVA_HOME/bin/java"
JAVACCMD="$JAVA_HOME/bin/javac"
if [ ! -x "$JAVACMD" ] || [ ! -x "$JAVACCMD" ]; then
echo "The JAVA_HOME environment variable is not defined correctly, so mvnw cannot run." >&2
echo "JAVA_HOME is set to \"$JAVA_HOME\", but \"\$JAVA_HOME/bin/java\" or \"\$JAVA_HOME/bin/javac\" does not exist." >&2
return 1
fi
fi
else
JAVACMD="$(
'set' +e
'unset' -f command 2>/dev/null
'command' -v java
)" || :
JAVACCMD="$(
'set' +e
'unset' -f command 2>/dev/null
'command' -v javac
)" || :
if [ ! -x "${JAVACMD-}" ] || [ ! -x "${JAVACCMD-}" ]; then
echo "The java/javac command does not exist in PATH nor is JAVA_HOME set, so mvnw cannot run." >&2
return 1
fi
fi
}
# hash string like Java String::hashCode
hash_string() {
str="${1:-}" h=0
while [ -n "$str" ]; do
char="${str%"${str#?}"}"
h=$(((h * 31 + $(LC_CTYPE=C printf %d "'$char")) % 4294967296))
str="${str#?}"
done
printf %x\\n $h
}
verbose() { :; }
[ "${MVNW_VERBOSE-}" != true ] || verbose() { printf %s\\n "${1-}"; }
die() {
printf %s\\n "$1" >&2
exit 1
}
trim() {
# MWRAPPER-139:
# Trims trailing and leading whitespace, carriage returns, tabs, and linefeeds.
# Needed for removing poorly interpreted newline sequences when running in more
# exotic environments such as mingw bash on Windows.
printf "%s" "${1}" | tr -d '[:space:]'
}
# parse distributionUrl and optional distributionSha256Sum, requires .mvn/wrapper/maven-wrapper.properties
while IFS="=" read -r key value; do
case "${key-}" in
distributionUrl) distributionUrl=$(trim "${value-}") ;;
distributionSha256Sum) distributionSha256Sum=$(trim "${value-}") ;;
esac
done <"${0%/*}/.mvn/wrapper/maven-wrapper.properties"
[ -n "${distributionUrl-}" ] || die "cannot read distributionUrl property in ${0%/*}/.mvn/wrapper/maven-wrapper.properties"
case "${distributionUrl##*/}" in
maven-mvnd-*bin.*)
MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/
case "${PROCESSOR_ARCHITECTURE-}${PROCESSOR_ARCHITEW6432-}:$(uname -a)" in
*AMD64:CYGWIN* | *AMD64:MINGW*) distributionPlatform=windows-amd64 ;;
:Darwin*x86_64) distributionPlatform=darwin-amd64 ;;
:Darwin*arm64) distributionPlatform=darwin-aarch64 ;;
:Linux*x86_64*) distributionPlatform=linux-amd64 ;;
*)
echo "Cannot detect native platform for mvnd on $(uname)-$(uname -m), use pure java version" >&2
distributionPlatform=linux-amd64
;;
esac
distributionUrl="${distributionUrl%-bin.*}-$distributionPlatform.zip"
;;
maven-mvnd-*) MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/ ;;
*) MVN_CMD="mvn${0##*/mvnw}" _MVNW_REPO_PATTERN=/org/apache/maven/ ;;
esac
# apply MVNW_REPOURL and calculate MAVEN_HOME
# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-<version>,maven-mvnd-<version>-<platform>}/<hash>
[ -z "${MVNW_REPOURL-}" ] || distributionUrl="$MVNW_REPOURL$_MVNW_REPO_PATTERN${distributionUrl#*"$_MVNW_REPO_PATTERN"}"
distributionUrlName="${distributionUrl##*/}"
distributionUrlNameMain="${distributionUrlName%.*}"
distributionUrlNameMain="${distributionUrlNameMain%-bin}"
MAVEN_USER_HOME="${MAVEN_USER_HOME:-${HOME}/.m2}"
MAVEN_HOME="${MAVEN_USER_HOME}/wrapper/dists/${distributionUrlNameMain-}/$(hash_string "$distributionUrl")"
exec_maven() {
unset MVNW_VERBOSE MVNW_USERNAME MVNW_PASSWORD MVNW_REPOURL || :
exec "$MAVEN_HOME/bin/$MVN_CMD" "$@" || die "cannot exec $MAVEN_HOME/bin/$MVN_CMD"
}
if [ -d "$MAVEN_HOME" ]; then
verbose "found existing MAVEN_HOME at $MAVEN_HOME"
exec_maven "$@"
fi
case "${distributionUrl-}" in
*?-bin.zip | *?maven-mvnd-?*-?*.zip) ;;
*) die "distributionUrl is not valid, must match *-bin.zip or maven-mvnd-*.zip, but found '${distributionUrl-}'" ;;
esac
# prepare tmp dir
if TMP_DOWNLOAD_DIR="$(mktemp -d)" && [ -d "$TMP_DOWNLOAD_DIR" ]; then
clean() { rm -rf -- "$TMP_DOWNLOAD_DIR"; }
trap clean HUP INT TERM EXIT
else
die "cannot create temp dir"
fi
mkdir -p -- "${MAVEN_HOME%/*}"
# Download and Install Apache Maven
verbose "Couldn't find MAVEN_HOME, downloading and installing it ..."
verbose "Downloading from: $distributionUrl"
verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName"
# select .zip or .tar.gz
if ! command -v unzip >/dev/null; then
distributionUrl="${distributionUrl%.zip}.tar.gz"
distributionUrlName="${distributionUrl##*/}"
fi
# verbose opt
__MVNW_QUIET_WGET=--quiet __MVNW_QUIET_CURL=--silent __MVNW_QUIET_UNZIP=-q __MVNW_QUIET_TAR=''
[ "${MVNW_VERBOSE-}" != true ] || __MVNW_QUIET_WGET='' __MVNW_QUIET_CURL='' __MVNW_QUIET_UNZIP='' __MVNW_QUIET_TAR=v
# normalize http auth
case "${MVNW_PASSWORD:+has-password}" in
'') MVNW_USERNAME='' MVNW_PASSWORD='' ;;
has-password) [ -n "${MVNW_USERNAME-}" ] || MVNW_USERNAME='' MVNW_PASSWORD='' ;;
esac
if [ -z "${MVNW_USERNAME-}" ] && command -v wget >/dev/null; then
verbose "Found wget ... using wget"
wget ${__MVNW_QUIET_WGET:+"$__MVNW_QUIET_WGET"} "$distributionUrl" -O "$TMP_DOWNLOAD_DIR/$distributionUrlName" || die "wget: Failed to fetch $distributionUrl"
elif [ -z "${MVNW_USERNAME-}" ] && command -v curl >/dev/null; then
verbose "Found curl ... using curl"
curl ${__MVNW_QUIET_CURL:+"$__MVNW_QUIET_CURL"} -f -L -o "$TMP_DOWNLOAD_DIR/$distributionUrlName" "$distributionUrl" || die "curl: Failed to fetch $distributionUrl"
elif set_java_home; then
verbose "Falling back to use Java to download"
javaSource="$TMP_DOWNLOAD_DIR/Downloader.java"
targetZip="$TMP_DOWNLOAD_DIR/$distributionUrlName"
cat >"$javaSource" <<-END
public class Downloader extends java.net.Authenticator
{
protected java.net.PasswordAuthentication getPasswordAuthentication()
{
return new java.net.PasswordAuthentication( System.getenv( "MVNW_USERNAME" ), System.getenv( "MVNW_PASSWORD" ).toCharArray() );
}
public static void main( String[] args ) throws Exception
{
setDefault( new Downloader() );
java.nio.file.Files.copy( java.net.URI.create( args[0] ).toURL().openStream(), java.nio.file.Paths.get( args[1] ).toAbsolutePath().normalize() );
}
}
END
# For Cygwin/MinGW, switch paths to Windows format before running javac and java
verbose " - Compiling Downloader.java ..."
"$(native_path "$JAVACCMD")" "$(native_path "$javaSource")" || die "Failed to compile Downloader.java"
verbose " - Running Downloader.java ..."
"$(native_path "$JAVACMD")" -cp "$(native_path "$TMP_DOWNLOAD_DIR")" Downloader "$distributionUrl" "$(native_path "$targetZip")"
fi
# If specified, validate the SHA-256 sum of the Maven distribution zip file
if [ -n "${distributionSha256Sum-}" ]; then
distributionSha256Result=false
if [ "$MVN_CMD" = mvnd.sh ]; then
echo "Checksum validation is not supported for maven-mvnd." >&2
echo "Please disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2
exit 1
elif command -v sha256sum >/dev/null; then
if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | sha256sum -c >/dev/null 2>&1; then
distributionSha256Result=true
fi
elif command -v shasum >/dev/null; then
if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | shasum -a 256 -c >/dev/null 2>&1; then
distributionSha256Result=true
fi
else
echo "Checksum validation was requested but neither 'sha256sum' or 'shasum' are available." >&2
echo "Please install either command, or disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2
exit 1
fi
if [ $distributionSha256Result = false ]; then
echo "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised." >&2
echo "If you updated your Maven version, you need to update the specified distributionSha256Sum property." >&2
exit 1
fi
fi
# unzip and move
if command -v unzip >/dev/null; then
unzip ${__MVNW_QUIET_UNZIP:+"$__MVNW_QUIET_UNZIP"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -d "$TMP_DOWNLOAD_DIR" || die "failed to unzip"
else
tar xzf${__MVNW_QUIET_TAR:+"$__MVNW_QUIET_TAR"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -C "$TMP_DOWNLOAD_DIR" || die "failed to untar"
fi
printf %s\\n "$distributionUrl" >"$TMP_DOWNLOAD_DIR/$distributionUrlNameMain/mvnw.url"
mv -- "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" "$MAVEN_HOME" || [ -d "$MAVEN_HOME" ] || die "fail to move MAVEN_HOME"
clean || :
exec_maven "$@"

149
mvnw.cmd vendored
View File

@ -1,149 +0,0 @@
<# : batch portion
@REM ----------------------------------------------------------------------------
@REM Licensed to the Apache Software Foundation (ASF) under one
@REM or more contributor license agreements. See the NOTICE file
@REM distributed with this work for additional information
@REM regarding copyright ownership. The ASF licenses this file
@REM to you under the Apache License, Version 2.0 (the
@REM "License"); you may not use this file except in compliance
@REM with the License. You may obtain a copy of the License at
@REM
@REM http://www.apache.org/licenses/LICENSE-2.0
@REM
@REM Unless required by applicable law or agreed to in writing,
@REM software distributed under the License is distributed on an
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@REM KIND, either express or implied. See the License for the
@REM specific language governing permissions and limitations
@REM under the License.
@REM ----------------------------------------------------------------------------
@REM ----------------------------------------------------------------------------
@REM Apache Maven Wrapper startup batch script, version 3.3.2
@REM
@REM Optional ENV vars
@REM MVNW_REPOURL - repo url base for downloading maven distribution
@REM MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven
@REM MVNW_VERBOSE - true: enable verbose log; others: silence the output
@REM ----------------------------------------------------------------------------
@IF "%__MVNW_ARG0_NAME__%"=="" (SET __MVNW_ARG0_NAME__=%~nx0)
@SET __MVNW_CMD__=
@SET __MVNW_ERROR__=
@SET __MVNW_PSMODULEP_SAVE=%PSModulePath%
@SET PSModulePath=
@FOR /F "usebackq tokens=1* delims==" %%A IN (`powershell -noprofile "& {$scriptDir='%~dp0'; $script='%__MVNW_ARG0_NAME__%'; icm -ScriptBlock ([Scriptblock]::Create((Get-Content -Raw '%~f0'))) -NoNewScope}"`) DO @(
IF "%%A"=="MVN_CMD" (set __MVNW_CMD__=%%B) ELSE IF "%%B"=="" (echo %%A) ELSE (echo %%A=%%B)
)
@SET PSModulePath=%__MVNW_PSMODULEP_SAVE%
@SET __MVNW_PSMODULEP_SAVE=
@SET __MVNW_ARG0_NAME__=
@SET MVNW_USERNAME=
@SET MVNW_PASSWORD=
@IF NOT "%__MVNW_CMD__%"=="" (%__MVNW_CMD__% %*)
@echo Cannot start maven from wrapper >&2 && exit /b 1
@GOTO :EOF
: end batch / begin powershell #>
$ErrorActionPreference = "Stop"
if ($env:MVNW_VERBOSE -eq "true") {
$VerbosePreference = "Continue"
}
# calculate distributionUrl, requires .mvn/wrapper/maven-wrapper.properties
$distributionUrl = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionUrl
if (!$distributionUrl) {
Write-Error "cannot read distributionUrl property in $scriptDir/.mvn/wrapper/maven-wrapper.properties"
}
switch -wildcard -casesensitive ( $($distributionUrl -replace '^.*/','') ) {
"maven-mvnd-*" {
$USE_MVND = $true
$distributionUrl = $distributionUrl -replace '-bin\.[^.]*$',"-windows-amd64.zip"
$MVN_CMD = "mvnd.cmd"
break
}
default {
$USE_MVND = $false
$MVN_CMD = $script -replace '^mvnw','mvn'
break
}
}
# apply MVNW_REPOURL and calculate MAVEN_HOME
# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-<version>,maven-mvnd-<version>-<platform>}/<hash>
if ($env:MVNW_REPOURL) {
$MVNW_REPO_PATTERN = if ($USE_MVND) { "/org/apache/maven/" } else { "/maven/mvnd/" }
$distributionUrl = "$env:MVNW_REPOURL$MVNW_REPO_PATTERN$($distributionUrl -replace '^.*'+$MVNW_REPO_PATTERN,'')"
}
$distributionUrlName = $distributionUrl -replace '^.*/',''
$distributionUrlNameMain = $distributionUrlName -replace '\.[^.]*$','' -replace '-bin$',''
$MAVEN_HOME_PARENT = "$HOME/.m2/wrapper/dists/$distributionUrlNameMain"
if ($env:MAVEN_USER_HOME) {
$MAVEN_HOME_PARENT = "$env:MAVEN_USER_HOME/wrapper/dists/$distributionUrlNameMain"
}
$MAVEN_HOME_NAME = ([System.Security.Cryptography.MD5]::Create().ComputeHash([byte[]][char[]]$distributionUrl) | ForEach-Object {$_.ToString("x2")}) -join ''
$MAVEN_HOME = "$MAVEN_HOME_PARENT/$MAVEN_HOME_NAME"
if (Test-Path -Path "$MAVEN_HOME" -PathType Container) {
Write-Verbose "found existing MAVEN_HOME at $MAVEN_HOME"
Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD"
exit $?
}
if (! $distributionUrlNameMain -or ($distributionUrlName -eq $distributionUrlNameMain)) {
Write-Error "distributionUrl is not valid, must end with *-bin.zip, but found $distributionUrl"
}
# prepare tmp dir
$TMP_DOWNLOAD_DIR_HOLDER = New-TemporaryFile
$TMP_DOWNLOAD_DIR = New-Item -Itemtype Directory -Path "$TMP_DOWNLOAD_DIR_HOLDER.dir"
$TMP_DOWNLOAD_DIR_HOLDER.Delete() | Out-Null
trap {
if ($TMP_DOWNLOAD_DIR.Exists) {
try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null }
catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" }
}
}
New-Item -Itemtype Directory -Path "$MAVEN_HOME_PARENT" -Force | Out-Null
# Download and Install Apache Maven
Write-Verbose "Couldn't find MAVEN_HOME, downloading and installing it ..."
Write-Verbose "Downloading from: $distributionUrl"
Write-Verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName"
$webclient = New-Object System.Net.WebClient
if ($env:MVNW_USERNAME -and $env:MVNW_PASSWORD) {
$webclient.Credentials = New-Object System.Net.NetworkCredential($env:MVNW_USERNAME, $env:MVNW_PASSWORD)
}
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$webclient.DownloadFile($distributionUrl, "$TMP_DOWNLOAD_DIR/$distributionUrlName") | Out-Null
# If specified, validate the SHA-256 sum of the Maven distribution zip file
$distributionSha256Sum = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionSha256Sum
if ($distributionSha256Sum) {
if ($USE_MVND) {
Write-Error "Checksum validation is not supported for maven-mvnd. `nPlease disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties."
}
Import-Module $PSHOME\Modules\Microsoft.PowerShell.Utility -Function Get-FileHash
if ((Get-FileHash "$TMP_DOWNLOAD_DIR/$distributionUrlName" -Algorithm SHA256).Hash.ToLower() -ne $distributionSha256Sum) {
Write-Error "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised. If you updated your Maven version, you need to update the specified distributionSha256Sum property."
}
}
# unzip and move
Expand-Archive "$TMP_DOWNLOAD_DIR/$distributionUrlName" -DestinationPath "$TMP_DOWNLOAD_DIR" | Out-Null
Rename-Item -Path "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" -NewName $MAVEN_HOME_NAME | Out-Null
try {
Move-Item -Path "$TMP_DOWNLOAD_DIR/$MAVEN_HOME_NAME" -Destination $MAVEN_HOME_PARENT | Out-Null
} catch {
if (! (Test-Path -Path "$MAVEN_HOME" -PathType Container)) {
Write-Error "fail to move MAVEN_HOME"
}
} finally {
try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null }
catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" }
}
Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD"

1784
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

27
package.json Normal file
View File

@ -0,0 +1,27 @@
{
"name": "medical-frontend",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview"
},
"dependencies": {
"@vueuse/core": "^12.0.0",
"axios": "^1.7.9",
"echarts": "^5.4.3",
"element-plus": "^2.3.9",
"pinia": "^2.1.6",
"tesseract.js": "^4.1.1",
"vue": "^3.3.4",
"vue-router": "^4.2.4"
},
"devDependencies": {
"@element-plus/icons-vue": "^2.1.0",
"@vitejs/plugin-vue": "^4.2.3",
"sass": "^1.65.1",
"vite": "^4.4.9"
}
}

99
pom.xml
View File

@ -1,99 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.3.5</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>edu.zrh</groupId>
<artifactId>healthSystem</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>healthSystem</name>
<description>healthSystem</description>
<url/>
<licenses>
<license/>
</licenses>
<developers>
<developer/>
</developers>
<scm>
<connection/>
<developerConnection/>
<tag/>
<url/>
</scm>
<properties>
<java.version>23</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<!-- Spring Boot Starter Web: 包含了Spring MVC、Tomcat等 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>3.3.5</version> <!-- 指定版本 -->
</dependency>
<!-- Spring Security依赖 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<!-- Spring Boot Starter Data JPA: 用于简化JPA的开发 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.12</version> <!-- 使用适合你数据库版本的版本号 -->
</dependency>
<!--<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.13.3</version>
</dependency>-->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<!-- <plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<path>/</path>
<port>8080</port>
</configuration>
</plugin>-->
</plugins>
</build>
</project>

1
public/vite.svg Normal file
View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

96
src/App.vue Normal file
View File

@ -0,0 +1,96 @@
<script setup>
import { useDark, useToggle } from '@vueuse/core'
import {ChatDotRound} from "@element-plus/icons-vue";
import {ref} from "vue";
const showChat = ref(false)
const toggleChat = () => {
showChat.value = !showChat.value
}
useDark({
selector: 'html',
attribute: 'class',
valueDark: 'dark',
valueLight: 'light'
})
useDark({
onChanged(dark) { useToggle(dark) }
})
</script>
<template>
<header>
<div class="wrapper">
<router-view/>
</div>
</header>
</template>
<style scoped>
header {
line-height: 1.5;
}
.chat-button {
position: fixed;
right: 30px;
bottom: 30px;
z-index: 1000;
width: 60px;
height: 60px;
border-radius: 30px;
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
animation: float 3s ease-in-out infinite;
background: linear-gradient(145deg, #4dabff, #409EFF);
border: none;
display: flex;
align-items: center;
justify-content: center;
}
@keyframes float {
0% {
transform: translateY(0px);
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}
50% {
transform: translateY(-10px);
box-shadow: 0 15px 15px rgba(0, 0, 0, 0.1);
}
100% {
transform: translateY(0px);
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}
}
.chat-button:hover {
animation-play-state: paused;
background: linear-gradient(145deg, #5bb4ff, #50a8ff);
transform: scale(1.05);
transition: all 0.3s ease;
}
.chat-button:active {
transform: scale(0.95);
}
.chat-button .el-icon {
font-size: 28px;
animation: pulse 2s infinite;
color: #ffffff;
}
@keyframes pulse {
0% {
transform: scale(1);
}
50% {
transform: scale(1.1);
}
100% {
transform: scale(1);
}
}
</style>

65
src/api/medical.js Normal file
View File

@ -0,0 +1,65 @@
import axiosInstance from '/src/utils/axiosInstance.js';
const BASE_URL = '/api/medical-records';
export const medicalApi = {
// 创建病历
async createRecord(record) {
try {
const response = await axiosInstance.post(BASE_URL, record);
return response.data; // 返回响应数据
} catch (error) {
console.error('创建病历失败:', error);
throw new Error(error.response?.data?.message || '创建病历失败'); // 抛出错误
}
},
// 获取所有病历
async getAllRecords(patientName = '') {
try {
const response = await axiosInstance.get(BASE_URL, {
params: {
patientName
}
});
console.log('111获取所有病历的响应:', response); // 打印响应
console.log('222获取所有病历的响应:', response.data); // 打印响应
return response ; // 返回响应数据
} catch (error) {
console.error('获取病历失败:', error);
throw new Error(error.response?.data?.message || '获取病历失败'); // 抛出错误
}
},
// 获取单个病历
async getRecord(id) {
try {
const response = await axiosInstance.get(`${BASE_URL}/${id}`);
return response.data; // 返回响应数据
} catch (error) {
console.error('获取病历失败:', error);
throw new Error(error.response?.data?.message || '获取病历失败'); // 抛出错误
}
},
// 更新病历
async updateRecord(id, record) {
try {
const response = await axiosInstance.put(`${BASE_URL}/${id}`, record);
return response.data; // 返回响应数据
} catch (error) {
console.error('更新病历失败:', error);
throw new Error(error.response?.data?.message || '更新病历失败'); // 抛出错误
}
},
// 删除病历
async deleteRecord(id) {
try {
await axiosInstance.delete(`${BASE_URL}/${id}`);
} catch (error) {
console.error('删除病历失败:', error);
throw new Error(error.response?.data?.message || '删除病历失败'); // 抛出错误
}
}
}

36
src/api/user.js Normal file
View File

@ -0,0 +1,36 @@
import request from "@/utils/axiosInstance.js";
// 获取所有用户
export function userGetAllService() {
return request.get("/user/getAll")
}
// 条件分页查询用户
export function userSelectService(params) {
return request.get("/user/page02", { params: params })
}
// 新增用户
export function userAddService(userModel) {
return request.post("/user/add", userModel)
}
// 根据id删除用户
export const userDeleteService = (id) => {
return request.delete('/user/deleteById/' + id)
}
// 根据id批量删除用户
export const userDeleteByIdsService = (ids) => {
return request.delete("/user/deleteByIds/" + ids)
}
// 根据id修改用户
export const userUpdateService = (userModel) => {
return request.put('user/update', userModel)
}
// 用户数据导出
export const userExportService = () => {
return request.get('user/export')
}

BIN
src/assets/R-C.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 657 KiB

23
src/assets/css/basic.scss Normal file
View File

@ -0,0 +1,23 @@
body {
margin: 0;
}
.icon-r-edit:before {
content: "" !important;
}
.icon-r-no:before {
content: "" !important;
}
.icon-r-yes:before {
content: "" !important;
}
.icon-r-delete:before {
content: "" !important;
}
.icon-r-add:before {
content: "" !important;
}

View File

@ -0,0 +1,65 @@
// 编辑按钮
.edit-button{
background-color: rgb(56, 183, 129);
font-size: 12px;
padding: 2px 15px;
border-radius: 3px;
height: 25px;
line-height: 25px;
display: inline-block;
user-select: none;
cursor: pointer;
color: #FFFFFF;
margin-right: 6px;
}
.edit-button:hover{
background-color: rgb(56, 183, 129);
color: #FFFFFF;
}
// 取消按钮
.channel-button{
background-color: rgb(245, 245, 245);
font-size: 12px;
padding: 2px 15px;
height: 25px;
line-height: 25px;
border-radius: 3px;
display: inline-block;
user-select: none;
cursor: pointer;
color: #1c1c1c;
margin: 0 10px;
}
.channel-button:hover{
color: #304a99;
}
// 文字按钮
.text-button{
margin-right: 10px;
color: rgb(43, 121, 203);
cursor: pointer;
}
// 删除按钮
.delete-button{
background-color: rgb(241, 241, 241);
font-size: 12px;
padding: 2px 15px;
height: 25px;
line-height: 25px;
border-radius: 3px;
display: inline-block;
user-select: none;
cursor: pointer;
color: #1c1c1c;
}
.delete-button:hover{
background-color: rgb(167, 83, 90);
font-size: 12px;
color: #FFFFFF;
}

View File

@ -0,0 +1,39 @@
// 标签
.theme-tag {
color: #1c1c1c;
background-color: rgb(237, 235, 235);
padding: 3px 10px;
border-radius: 3px;
font-size: 12px;
margin-right: 5px;
}
// 弹窗标题
.dialog-title {
font-size: 16px;
padding: 25px 20px;
user-select: none;
color: rgb(107, 106, 106);
}
.dialog-avatar {
width: 98px;
height: 98px;
}
.dialog-input {
font-size: 24px;
font-weight: 600;
width: 100%;
border: 5px;
padding: 4px 5px;
border: none;
outline: none;
user-select: none;
}
.dialog-hover{
display: inline-block;
padding: 10px 6px;
font-size: 12px;
color: rgb(107, 106, 106);
}

View File

@ -0,0 +1,64 @@
// 富文本下的样式显示
.html-content {
/* table 样式 */
table {
border-top: 1px solid #ccc;
border-left: 1px solid #ccc;
}
table td,
table th {
border-bottom: 1px solid #ccc;
border-right: 1px solid #ccc;
padding: 3px 5px;
}
table th {
border-bottom: 2px solid #ccc;
text-align: center;
}
/* blockquote 样式 */
blockquote {
display: block;
border-left: 8px solid #d0e5f2;
padding: 5px 10px;
margin: 10px 0;
line-height: 1.4;
font-size: 100%;
background-color: #f1f1f1;
}
/* code 样式 */
code {
display: inline-block;
*display: inline;
*zoom: 1;
background-color: #f1f1f1;
border-radius: 3px;
padding: 3px 5px;
margin: 0 3px;
}
pre code {
display: block;
}
/* ul ol 样式 */
ul,
ol {
margin: 10px 0 10px 20px;
}
}
.w-e-textarea-video-container {
background-image: none !important;
padding: 0 !important;
margin: 0 !important;
// 视频
video {
width: 100% !important;
height: 300px !important;
}
}

View File

@ -0,0 +1,173 @@
// ElementUI 自定义覆盖样式
.dialog-footer {
/* 使按钮水平居中 */
display: flex;
justify-content: center;
align-items: center;
}
.el-slider__bar {
height: 16px;
background-color: #c1cc57;
}
.el-slider__button-wrapper {
height: 66px;
width: 66px;
top: -25px;
}
.el-switch.is-checked .el-switch__core{
border-color: rgb(43, 121, 203) !important;
background-color: rgb(43, 121, 203) !important;
}
.avatar-uploader .el-upload {
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
}
/* 标签栏 */
.el-tabs__active-bar {
height: 6px !important;
border-radius: 3px;
}
/* 标签栏 */
.el-tabs__item {
height: 50px !important;
line-height: 50px !important;
user-select: none;
}
.avatar-uploader .el-upload:hover {
border-color: #409EFF;
}
.avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 88px;
height: 88px !important;
line-height: 88px !important;
text-align: center;
}
.el-timeline {
padding: 10px;
}
.el-timeline-item__tail {
border-left: 2px solid #155599 !important;
}
.el-timeline-item__node {
background-color: #155599 !important;
}
/* 表格表头 */
.el-table thead tr th {
color: #656464 !important;
font-weight: 400;
font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
background-color: rgb(246, 246, 246) !important;
text-align: left !important;
}
.el-dialog__body {
padding: 0 !important;
}
.el-badge__content.is-fixed {
top: 4px !important;
right: 6px !important;
}
.el-dialog__header {
padding: 0 !important;
}
/* 多选框偏移 */
.el-table th>.cell {
padding-left: 15px !important;
font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
}
/* 表格单元格 */
.el-table__row .cell {
font-size: 14px !important;
color: #1c1c1c;
padding-left: 15px !important;
}
/* 表格多选框颜色 */
.el-checkbox__input.is-checked .el-checkbox__inner,
.el-checkbox__input.is-indeterminate .el-checkbox__inner {
background-color: #a7535a !important;
border-color: #a7535a !important;
}
/* 分页显示色 */
.el-pager li.active {
color: #FFFFFF !important;
cursor: default;
border-radius: 3px;
border: 1px solid rgb(21, 85, 154);
background-color: rgb(21, 85, 154);
}
.el-radio-button__orig-radio:checked+.el-radio-button__inner {
color: #ffffff !important;
background-color: #64d134 !important;
border-color: #64d134 !important;
box-shadow: -1px 0 0 0 #64d134 !important;
}
.el-menu {
border-right: none !important;
}
.w-e-text-container [data-slate-editor] pre>code {
text-shadow: none !important;
background-color: #2d2d2d !important;
color: aliceblue !important;
padding: 0 10px !important;
}
/* 代码高亮插入后,会出现 “=” 背景色,这里去掉 */
.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
background: none !important;
}
#w-e-text-12 span {
background-color: #268611 !important;
}
/* 气泡确认框 */
.el-popconfirm__main {
padding-bottom: 21px !important;
}
/* 标签 */
.el-tag+.el-tag {
margin-left: 10px !important;
}
.el-dropdown-menu {
padding: 20px !important;
user-select: none !important;
color: #1c1c1c;
.el-dropdown-item:hover {
background-color: #ffffff !important;
}
}

25
src/assets/css/input.scss Normal file
View File

@ -0,0 +1,25 @@
// 输入框
.input-title {
width: 100%;
border: none;
outline: none;
padding: 5px 10px;
font-size: 22px;
font-weight: bold;
}
.top-bar {
display: inline-block;
margin: 0 10px;
font-size: 14px;
color: #909399;
}
.input-child {
width: 100%;
border: none;
outline: none;
padding: 5px 10px;
font-size: 22px;
font-weight: bold;
}

1
src/assets/vue.svg Normal file
View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="37.07" height="36" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 198"><path fill="#41B883" d="M204.8 0H256L128 220.8L0 0h97.92L128 51.2L157.44 0h47.36Z"></path><path fill="#41B883" d="m0 0l128 220.8L256 0h-51.2L128 132.48L50.56 0H0Z"></path><path fill="#35495E" d="M50.56 0L128 133.12L204.8 0h-47.36L128 51.2L97.92 0H50.56Z"></path></svg>

After

Width:  |  Height:  |  Size: 496 B

125
src/components/Header.vue Normal file
View File

@ -0,0 +1,125 @@
<template>
<div class="header">
<div class="header-content">
<div class="system-info">
<h1>病历管理系统</h1>
<div class="subtitle">Medical Record Management System</div>
</div>
<div class="user-info">
<el-dropdown>
<span class="user-dropdown">
<el-avatar :size="32" class="user-avatar">
<el-icon><User /></el-icon>
</el-avatar>
<span class="username">{{ userInfo.username }}</span>
<el-icon><CaretBottom /></el-icon>
</span>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item>
<el-icon><UserFilled /></el-icon>
</el-dropdown-item>
<el-dropdown-item>
<el-icon><Setting /></el-icon>
</el-dropdown-item>
<el-dropdown-item divided @click="logout">
<el-icon><SwitchButton /></el-icon>退
</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
</div>
</div>
</div>
<router-view />
</template>
<script setup>
import { ref } from 'vue'
import { User, CaretBottom, UserFilled, Setting, SwitchButton } from '@element-plus/icons-vue'
import router from "@/router/index.js";
const userInfo = ref({
username: sessionStorage.getItem('username') || '未登录',
})
const logout = () => {
// sessionStorage
sessionStorage.clear()
//
router.push('/login')
}
</script>
<style scoped>
.header {
background-color: #fff;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
padding: 0 20px;
position: fixed;
top: 0;
left: 200px; /* Sidebar width */
right: 0;
z-index: 1000;
height: 60px;
}
.header-content {
display: flex;
justify-content: space-between;
align-items: center;
height: 100%;
max-width: 1400px;
margin: 0 auto;
}
.system-info h1 {
margin: 0;
font-size: 20px;
color: #409EFF;
}
.subtitle {
font-size: 12px;
color: #909399;
margin-top: 2px;
}
.user-info {
display: flex;
align-items: center;
}
.user-dropdown {
display: flex;
align-items: center;
cursor: pointer;
padding: 5px 10px;
border-radius: 4px;
transition: background-color 0.3s;
}
.user-dropdown:hover {
background-color: #f5f7fa;
}
.user-avatar {
background-color: #409EFF;
color: #fff;
}
.username {
margin: 0 8px;
font-size: 14px;
color: #606266;
}
.el-dropdown-menu {
padding: 5px 0;
}
.el-dropdown-menu .el-icon {
margin-right: 8px;
vertical-align: middle;
}
</style>

26
src/components/Layout.vue Normal file
View File

@ -0,0 +1,26 @@
<template>
<div class="layout">
<Sidebar />
<div class="main-content">
<router-view></router-view>
</div>
</div>
</template>
<script setup>
import Sidebar from './Sidebar.vue'
</script>
<style scoped>
.layout {
min-height: 100vh;
display: flex;
}
.main-content {
flex: 1;
margin-left: 200px;
padding: 20px;
background-color: #f5f7fa;
}
</style>

View File

@ -0,0 +1,93 @@
<template>
<div class="sidebar">
<el-menu
:default-active="activeIndex"
class="sidebar-menu"
:collapse="isCollapse"
:unique-opened="true"
background-color="#545c64"
text-color="#fff"
active-text-color="#ffd04b"
router
>
<el-menu-item index="/home">
<el-icon><House /></el-icon>
<span>首页</span>
</el-menu-item>
<el-sub-menu index="/medical">
<template #title>
<el-icon><Document /></el-icon>
<span>病历管理</span>
</template>
<el-menu-item index="/medical/input">病历录入</el-menu-item>
<el-menu-item index="/medical/query">病历查询</el-menu-item>
<el-menu-item index="/medical/edit">病历修改</el-menu-item>
<el-menu-item index="/medical/delete">病历删除</el-menu-item>
</el-sub-menu>
<el-sub-menu index="/consultation">
<template #title>
<el-icon><ChatLineRound /></el-icon>
<span>医慧咨询</span>
</template>
<el-menu-item index="/consultation/inquiry">病情询问</el-menu-item>
<el-menu-item index="/consultation/record">询问记录</el-menu-item>
</el-sub-menu>
<el-sub-menu index="/template">
<template #title>
<el-icon><Files /></el-icon>
<span>病历模板</span>
</template>
<el-menu-item index="/template/input">模板录入</el-menu-item>
<el-menu-item index="/template/query">模板查询</el-menu-item>
<el-menu-item index="/template/edit">模板修改</el-menu-item>
<el-menu-item index="/template/delete">模板删除</el-menu-item>
</el-sub-menu>
<el-menu-item index="/data">
<el-icon><DataLine /></el-icon>
<span>病历数据</span>
</el-menu-item>
<el-menu-item index="/ocr">
<el-icon><Document /></el-icon>
<span>文字识别</span>
</el-menu-item>
<el-menu-item index="/user" v-if="isPermission">
<el-icon><User /></el-icon>
<span>用户管理</span>
</el-menu-item>
</el-menu>
</div>
</template>
<script setup>
import { ref } from 'vue'
import { House, Document, ChatLineRound, Files, DataLine, User } from '@element-plus/icons-vue'
const isCollapse = ref(false)
const activeIndex = ref('/home')
const isPermission = ref(sessionStorage.getItem('permission')==='0')
</script>
<style scoped>
.sidebar {
position: fixed;
height: 100vh;
left: 0;
top: 0;
z-index: 1000;
}
.sidebar-menu {
height: 100%;
width: 200px;
}
.sidebar-menu:not(.el-menu--collapse) {
width: 200px;
}
</style>

100
src/layout/Layout.vue Normal file
View File

@ -0,0 +1,100 @@
<template>
<el-container class="layout-container">
<el-aside width="200px">
<el-menu
:default-active="route.path"
class="el-menu-vertical"
router
>
<el-menu-item index="/home">
<el-icon><HomeFilled /></el-icon>
<span>首页</span>
</el-menu-item>
<el-menu-item index="/patients">
<el-icon><User /></el-icon>
<span>患者管理</span>
</el-menu-item>
<el-menu-item index="/records">
<el-icon><Document /></el-icon>
<span>病历管理</span>
</el-menu-item>
</el-menu>
</el-aside>
<el-container>
<el-header>
<div class="header-left">
<h2>医疗病历管理系统</h2>
</div>
<div class="header-right">
<el-dropdown>
<el-avatar :size="32" icon="UserFilled" />
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item>个人信息</el-dropdown-item>
<el-dropdown-item>退出登录</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
</div>
</el-header>
<el-main>
<router-view></router-view>
</el-main>
</el-container>
</el-container>
</template>
<script setup>
import { useRoute } from 'vue-router'
import { HomeFilled, User, Document } from '@element-plus/icons-vue'
const route = useRoute()
</script>
<style scoped>
.layout-container {
height: 100vh;
}
.el-header {
background-color: #fff;
border-bottom: 1px solid #dcdfe6;
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 20px;
}
.el-aside {
background-color: #304156;
color: #fff;
}
.el-menu {
border-right: none;
background-color: #304156;
}
.el-menu-item {
color: #fff;
}
.el-menu-item:hover {
background-color: #263445;
}
.el-menu-item.is-active {
background-color: #263445;
}
.header-right {
cursor: pointer;
}
.el-main {
background-color: #f0f2f5;
padding: 20px;
}
</style>

92
src/layout/Layout1.vue Normal file
View File

@ -0,0 +1,92 @@
<script setup>
import Header from '@/components/Header.vue'
</script>
<template>
<div class="app-container">
<el-container class="layout-container">
<el-container>
<el-header height="60px" class="fixed-header">
<Header />
</el-header>
<el-main class="main-content">
<div class="view-container">
<router-view></router-view>
</div>
</el-main>
</el-container>
</el-container>
</div>
</template>
<style>
html, body, #app {
margin: 0;
padding: 0;
height: 100%;
overflow: hidden;
}
.app-container {
height: 100%;
}
.layout-container {
height: 100%;
}
.fixed-header {
padding: 0;
position: fixed;
width: 100%;
top: 0;
left: 0;
z-index: 1000;
background-color: #fff;
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}
.main-content {
margin-top: 60px;
padding: 20px;
height: calc(100vh - 60px);
overflow-y: auto;
background-color: #f0f2f5;
}
.view-container {
min-height: 100%;
padding: 20px;
background-color: #fff;
border-radius: 4px;
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}
/* 全局样式覆盖 */
.el-table {
width: 100% !important;
height: auto !important;
overflow: visible !important;
}
.el-card {
margin-bottom: 20px;
overflow: visible !important;
}
/* 自定义滚动条样式 */
::-webkit-scrollbar {
width: 6px;
}
::-webkit-scrollbar-thumb {
background-color: #909399;
border-radius: 3px;
}
::-webkit-scrollbar-track {
background-color: #f0f2f5;
}
</style>

26
src/main.js Normal file
View File

@ -0,0 +1,26 @@
import { createApp } from 'vue';
import ElementPlus from 'element-plus';
import 'element-plus/dist/index.css';
import * as ElementPlusIconsVue from '@element-plus/icons-vue';
import { createPinia } from 'pinia';
import router from './router/index.js';
import App from './App.vue';
import './styles/views.css';
import * as Vue from "echarts";
import axiosInstance from './utils/axiosInstance'; // 导入axios实例
const app = createApp(App);
// 注册所有图标
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
app.component(key, component);
}
// 将axios实例添加到Vue应用的全球属性中
app.config.globalProperties.$axios = axiosInstance;
app.use(ElementPlus);
app.use(createPinia());
app.use(router);
app.mount('#app');

View File

@ -1,17 +0,0 @@
package edu.zrh.healthsystem;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
/**
* @author han
*/
@SpringBootApplication
public class HealthSystemApplication {
public static void main(String[] args) {
SpringApplication.run(HealthSystemApplication.class, args);
}
}

View File

@ -1,22 +0,0 @@
package edu.zrh.healthsystem.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.web.client.RestTemplate;
/**
* @author han
*/
@Configuration
public class WebConfig {
@Bean
public BCryptPasswordEncoder passwordEncoder() {
return new BCryptPasswordEncoder();
}
@Bean
public RestTemplate restTemplate() {
return new RestTemplate();
}
}

View File

@ -1,18 +0,0 @@
package edu.zrh.healthsystem.controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @author han
*/
@CrossOrigin(origins = "*")
@RestController
public class HelloController {
@GetMapping("/hello")
public String home() {
return "Hello, World!";
}
}

View File

@ -1,76 +0,0 @@
package edu.zrh.healthsystem.controller;
import edu.zrh.healthsystem.model.Elderly;
import edu.zrh.healthsystem.model.elderly.RegularCheckupInfoResponse;
import edu.zrh.healthsystem.service.RegularCheckupService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Map;
@CrossOrigin(origins = "*")
@RestController
@RequestMapping("/regularcheckup")
public class RegularCheckupController {
private final RegularCheckupService regularCheckupService;
@Autowired
public RegularCheckupController(RegularCheckupService regularCheckupService) {
this.regularCheckupService = regularCheckupService;
}
@PostMapping("/add")
public Map<String, Object> add(@RequestBody Elderly elderly) {
RegularCheckupInfoResponse result = regularCheckupService.add(elderly);
if (result != null) {
return Map.of("status", "success", "data", result);
} else {
// 如果登录失败返回失败信息
return Map.of("status", "fail", "message", "连接失败");
}
}
@PostMapping("/delete")
public Map<String, Object> delete(@RequestBody Elderly elderly) {
RegularCheckupInfoResponse result = regularCheckupService.delete(elderly);
if (result != null) {
return Map.of("status", "success", "data", result);
} else {
// 如果登录失败返回失败信息
return Map.of("status", "fail", "message", "连接失败");
}
}
@PostMapping("/update")
public Map<String, Object> update(@RequestBody Elderly elderly) {
RegularCheckupInfoResponse result = regularCheckupService.update(elderly);
if (result != null) {
return Map.of("status", "success", "data", result);
} else {
// 如果登录失败返回失败信息
return Map.of("status", "fail", "message", "连接失败");
}
}
@PostMapping("/get")
public Map<String, Object> get(@RequestBody Elderly elderly) {
RegularCheckupInfoResponse result = regularCheckupService.get(elderly);
if (result != null) {
return Map.of("status", "success", "data", result);
} else {
// 如果登录失败返回失败信息
return Map.of("status", "fail", "message", "连接失败");
}
}
@GetMapping("/getall")
public Map<String, Object> getAll() {
RegularCheckupInfoResponse result = regularCheckupService.getAll();
if (result != null) {
return Map.of("status", "success", "data", result);
} else {
// 如果登录失败返回失败信息
return Map.of("status", "fail", "message", "连接失败");
}
}
}

View File

@ -1,39 +0,0 @@
package edu.zrh.healthsystem.controller;
import edu.zrh.healthsystem.model.Talk;
import edu.zrh.healthsystem.model.TalkResponse;
import edu.zrh.healthsystem.service.TalkService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Map;
/**
* @author han
*/
@CrossOrigin(origins = "*")
@RestController
public class TalkController {
private final TalkService talkService;
@Autowired
public TalkController(TalkService talkService) {
this.talkService = talkService;
}
@GetMapping("/talk/test")
public String callApi() {
return talkService.callApi("http://10.10.10.44:11434/");
}
@PostMapping("/talk/main")
public Map<String, Object> callApiChat(@RequestBody Talk talk) {
TalkResponse result = talkService.callApiChat(talk);
if (result != null) {
return Map.of("status", "success", "data", result);
} else {
// 如果登录失败返回失败信息
return Map.of("status", "fail", "message", "登录失败");
}
}
}

View File

@ -1,35 +0,0 @@
package edu.zrh.healthsystem.controller.elderly;
import edu.zrh.healthsystem.service.elderly.ElderMainService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Map;
/**
* @author han
*/
@CrossOrigin(origins = "*")
@RestController
public class ElderMainController {
private ElderMainService elderMainService;
@Autowired
public ElderMainController(ElderMainService elderMainService) {
this.elderMainService = elderMainService;
}
@GetMapping("/elderly/main")
public Map elderMain() {
List result = elderMainService.elderMain();
if (result != null) {
return Map.of("status", "success", "data", result);
} else {
// 如果登录失败返回失败信息
return Map.of("status", "fail", "message", "登录失败");
}
}
}

View File

@ -1,36 +0,0 @@
package edu.zrh.healthsystem.controller.elderly;
import edu.zrh.healthsystem.model.elderly.ElderlyConnect;
import edu.zrh.healthsystem.model.elderly.ElderlyConnectResponse;
import edu.zrh.healthsystem.service.elderly.ElderlyConnectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;
/**
* @author han
*/
@CrossOrigin(origins = "*")
@RestController
public class ElderlyConnectController {
private final ElderlyConnectService elderlyConnectService;
@Autowired
public ElderlyConnectController(ElderlyConnectService elderlyConnectService) {
this.elderlyConnectService = elderlyConnectService;
}
@PostMapping("/elderly/Connect")
public Map<String,Object> elderlyConnect(@RequestBody ElderlyConnect elderlyConnect){
ElderlyConnectResponse result= elderlyConnectService.getElderlyConnectResponse(elderlyConnect);
if (result != null) {
return Map.of("status", "success", "data", result);
} else {
// 如果登录失败返回失败信息
return Map.of("status", "fail", "message", "创建失败");
}
}
}

View File

@ -1,33 +0,0 @@
package edu.zrh.healthsystem.controller.elderly;
import edu.zrh.healthsystem.model.elderly.ElderlyNew;
import edu.zrh.healthsystem.model.elderly.ElderlyNewResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import edu.zrh.healthsystem.service.elderly.ElderlyNewService;
import java.util.Map;
@CrossOrigin(origins = "*")
@RestController
public class ElderlyNewController {
private final ElderlyNewService elderlyNewService;
@Autowired
public ElderlyNewController(ElderlyNewService elderlyNewService) {
this.elderlyNewService = elderlyNewService;
}
@PostMapping("/elderly/new")
public Map<String,Object> elderlyNew(@RequestBody ElderlyNew elderlyNew){
ElderlyNewResponse result= elderlyNewService.elderly(elderlyNew);
if (result != null) {
return Map.of("status", "success", "data", result);
} else {
// 如果登录失败返回失败信息
return Map.of("status", "fail", "message", "创建失败");
}
}
}

View File

@ -1,34 +0,0 @@
package edu.zrh.healthsystem.controller.elderly;
import edu.zrh.healthsystem.model.Elderly;
import edu.zrh.healthsystem.model.elderly.ElderlyShowResponse;
import edu.zrh.healthsystem.service.elderly.ElderlyShowService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;
@CrossOrigin(origins = "*")
@RestController
public class ElderlyShowController {
private final ElderlyShowService elderlyShowService;
@Autowired
public ElderlyShowController(ElderlyShowService elderlyShowService) {
this.elderlyShowService = elderlyShowService;
}
@PostMapping("/elderly/show")
public Map<String,Object> elderlyShow(@RequestBody Elderly elderly){
ElderlyShowResponse result= elderlyShowService.getElderlyShow(elderly);
if (result != null) {
return Map.of("status", "success", "data", result);
} else {
// 如果登录失败返回失败信息
return Map.of("status", "fail", "message", "连接失败");
}
}
}

View File

@ -1,38 +0,0 @@
package edu.zrh.healthsystem.controller.user;
import edu.zrh.healthsystem.model.user.UserLogin;
import edu.zrh.healthsystem.model.user.UserLoginResponse;
import edu.zrh.healthsystem.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Map;
/**
* @author han
*/
@CrossOrigin(origins = "*")
@RestController
public class LoginController {
private final LoginService loginService;
@Autowired
public LoginController(LoginService loginService) {
this.loginService = loginService;
}
@PostMapping("/login")
public Map<String, Object> login(@RequestBody UserLogin userLogin) {
// 调用登录服务
UserLoginResponse result = loginService.login(userLogin);
// 如果登录成功返回成功信息和用户信息
if (result != null) {
return Map.of("status", "success", "data", result);
} else {
// 如果登录失败返回失败信息
return Map.of("status", "fail", "message", "登录失败");
}
}
}

View File

@ -1,35 +0,0 @@
package edu.zrh.healthsystem.controller.user;
import edu.zrh.healthsystem.model.user.UserRegister;
import edu.zrh.healthsystem.model.user.UserRegisterResponse;
import edu.zrh.healthsystem.service.RegisterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;
/**
* @author han
*/
@RestController
public class RegisterController {
private final RegisterService registerService;
@Autowired
public RegisterController(RegisterService registerService) {
this.registerService = registerService;
}
@PostMapping("/register")
public Map<String,Object> register(@RequestBody UserRegister userRegister) {
UserRegisterResponse result = registerService.register(userRegister);
if (result != null) {
return Map.of("status", "success", "data", result);
} else {
// 如果登录失败返回失败信息
return Map.of("status", "fail", "message", "登录失败");
}
}
}

View File

@ -1,75 +0,0 @@
package edu.zrh.healthsystem.eneity;
import jakarta.persistence.*;
import lombok.Data;
import java.util.Date;
/**
* @author han
*/
@Data
@Entity
@Table(name = "basic_info")
public class BasicInfo {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "elderly_id")
private int elderlyId;
@Column(name = "full_name")
private String fullName;
@Column(name = "gender")
private String gender;
@Column(name = "date_of_birth")
private Date dateOfBirth;
@Column(name = "ethnicity")
private String ethnicity;
@Column(name = "native_place")
private String nativePlace;
@Column(name = "id_number")
private String idNumber;
@Column(name = "permanent_address")
private String permanentAddress;
@Column(name = "occupation")
private String occupation;
@Column(name = "education_level")
private String educationLevel;
@Column(name = "living_alone")
private String livingAlone;
@Column(name = "marital_status")
private String maritalStatus;
@Column(name = "phone_number")
private String phoneNumber;
@Column(name = "contact_name")
private String contactName;
@Column(name = "contact_relation")
private String contactRelation;
@Column(name = "contact_phone")
private String contactPhone;
@Column(name = "eating_habits")
private String eatingHabits;
@Column(name = "exercise_frequency")
private String exerciseFrequency;
}

View File

@ -1,31 +0,0 @@
package edu.zrh.healthsystem.eneity;
import jakarta.persistence.*;
import lombok.Data;
import java.sql.Timestamp;
@Entity
@Table(name = "daily_schedule_info")
@Data
public class DailyScheduleInfo {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int checkInId;
@Column(name = "Elderly_id")
private Integer elderlyId;
@Column(name = "Schedule_id")
private Integer scheduleId;
@Column(name = "Check_in_time")
private Timestamp checkInTime;
@Column(name = "Check_out_time")
private Timestamp checkOutTime;
@Column(name = "notes")
private String notes;
}

View File

@ -1,65 +0,0 @@
package edu.zrh.healthsystem.eneity;
import jakarta.persistence.*;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
@Entity
@Table(name = "diseaserecord_info")
public class DiseaseRecordInfo {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "DiseaseID", nullable = false)
private Integer id;
@ManyToOne(fetch = FetchType.LAZY, optional = false)
@JoinColumn(name = "ProfileID", nullable = false)
private MainProfileInfo profileID;
@Lob
@Column(name = "PastMedicalHistory")
private String pastMedicalHistory;
@Lob
@Column(name = "CurrentMedicalHistory")
private String currentMedicalHistory;
@Lob
@Column(name = "FamilyMedicalHistory")
private String familyMedicalHistory;
@Lob
@Column(name = "Allergies")
private String allergies;
@Lob
@Column(name = "Disability")
private String disability;
@Lob
@Column(name = "VaccinationHistory")
private String vaccinationHistory;
@Lob
@Column(name = "ExposureHistory")
private String exposureHistory;
@Lob
@Column(name = "GeneticDiseaseHistory")
private String geneticDiseaseHistory;
@Lob
@Column(name = "TreatmentHistory")
private String treatmentHistory;
@Lob
@Column(name = "NursingHistory")
private String nursingHistory;
@Lob
@Column(name = "FollowUpManagement")
private String followUpManagement;
}

View File

@ -1,27 +0,0 @@
package edu.zrh.healthsystem.eneity;
import jakarta.persistence.*;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
@Entity
@Table(name = "healthbehavior_info")
public class HealthBehaviorInfo {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "BehaviorID", nullable = false)
private Integer id;
@ManyToOne(fetch = FetchType.LAZY, optional = false)
@JoinColumn(name = "ProfileID", nullable = false)
private MainProfileInfo profileID;
@Column(name = "SmokingStatus", nullable = false)
private String smokingStatus;
@Column(name = "DrinkingStatus", nullable = false)
private String drinkingStatus;
}

View File

@ -1,17 +0,0 @@
package edu.zrh.healthsystem.eneity;
import jakarta.persistence.*;
import lombok.Data;
@Data
@Entity
@Table(name = "mainprofile_info")
public class MainProfileInfo {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int profileId;
@OneToOne
@JoinColumn(name = "elderly_id")
private BasicInfo elderlyId;
}

View File

@ -1,29 +0,0 @@
package edu.zrh.healthsystem.eneity;
import jakarta.persistence.*;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
@Entity
@Table(name = "mentalhealth_info")
public class MentalHealthInfo {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "MentalHealthID", nullable = false)
private Integer id;
@ManyToOne(fetch = FetchType.LAZY, optional = false)
@JoinColumn(name = "Elderly_id", nullable = false)
private MainProfileInfo elderly;
@Lob
@Column(name = "PsychologicalIssues")
private String psychologicalIssues;
@Lob
@Column(name = "FollowUpRecord")
private String followUpRecord;
}

View File

@ -1,37 +0,0 @@
package edu.zrh.healthsystem.eneity;
import jakarta.persistence.*;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
@Entity
@Table(name = "pastmedicalhistoryrecord_info")
public class PastMedicalHistoryrecordInfo {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "PastMedicalHistoryID", nullable = false)
private Integer id;
@ManyToOne(fetch = FetchType.LAZY, optional = false)
@JoinColumn(name = "ProfileID", nullable = false)
private MainProfileInfo profileID;
@Lob
@Column(name = "CurrentMedicalHistory")
private String currentMedicalHistory;
@Lob
@Column(name = "ExposureHistory")
private String exposureHistory;
@Lob
@Column(name = "TreatmentHistory")
private String treatmentHistory;
@Lob
@Column(name = "NursingHistory")
private String nursingHistory;
}

View File

@ -1,67 +0,0 @@
package edu.zrh.healthsystem.eneity;
import jakarta.persistence.*;
import lombok.Getter;
import lombok.Setter;
import java.math.BigDecimal;
import java.time.LocalDate;
@Getter
@Setter
@Entity
@Table(name = "regularcheckup_info")
public class RegularCheckupInfo {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "CheckupID", nullable = false)
private Integer id;
@ManyToOne(fetch = FetchType.LAZY, optional = false)
@JoinColumn(name = "ProfileID", nullable = false)
private MainProfileInfo profileId;
@Column(name = "WeightStatus", nullable = false)
private String weightStatus;
@Column(name = "BloodType", nullable = false)
private String bloodType;
@Lob
@Column(name = "ChronicDiseases")
private String chronicDiseases;
@Column(name = "Height", precision = 5, scale = 2)
private BigDecimal height;
@Column(name = "Weight", precision = 5, scale = 2)
private BigDecimal weight;
@Column(name = "HeartRate")
private Integer heartRate;
@Column(name = "Temperature", precision = 3, scale = 1)
private BigDecimal temperature;
@Column(name = "OxygenSaturation")
private Integer oxygenSaturation;
@Column(name = "BloodPressure", length = 10)
private String bloodPressure;
@Column(name = "GlucoseLevel", precision = 5, scale = 2)
private BigDecimal glucoseLevel;
@Column(name = "Pulse")
private Integer pulse;
@Column(name = "face_image")
private byte[] faceImage;
@Column(name = "tongue_image")
private byte[] tongueImage;
@Column(name = "CheckupDate")
private LocalDate checkupDate;
}

View File

@ -1,29 +0,0 @@
package edu.zrh.healthsystem.eneity;
import jakarta.persistence.*;
import lombok.Getter;
import lombok.Setter;
import java.time.Instant;
@Getter
@Setter
@Entity
@Table(name = "schedule_info")
public class ScheduleInfo {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "schedule_id", nullable = false)
private Integer id;
@ManyToOne(fetch = FetchType.LAZY, optional = false)
@JoinColumn(name = "elderly_id", nullable = false)
private BasicInfo elderly;
@Column(name = "event_description")
private String eventDescription;
@Column(name = "event_time")
private Instant eventTime;
}

View File

@ -1,31 +0,0 @@
package edu.zrh.healthsystem.eneity;
import jakarta.persistence.*;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.ColumnDefault;
import java.time.Instant;
@Getter
@Setter
@Entity
@Table(name = "tcm_diagnosis_info")
public class TcmDiagnosisInfo {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "diagnosis_id", nullable = false)
private Integer id;
@ManyToOne(fetch = FetchType.LAZY, optional = false)
@JoinColumn(name = "elderly_id", nullable = false)
private BasicInfo elderly;
@Column(name = "diagnosis", nullable = false)
private String diagnosis;
@ColumnDefault("CURRENT_TIMESTAMP")
@Column(name = "diagnosis_time")
private Instant diagnosisTime;
}

View File

@ -1,36 +0,0 @@
package edu.zrh.healthsystem.eneity;
import jakarta.persistence.*;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.ColumnDefault;
import java.time.Instant;
@Getter
@Setter
@Entity
@Table(name = "tcm_qa_info")
public class TcmQaInfo {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "qa_id", nullable = false)
private Integer id;
@ManyToOne(fetch = FetchType.LAZY, optional = false)
@JoinColumn(name = "elderly_id", nullable = false)
private BasicInfo elderly;
@ColumnDefault("CURRENT_TIMESTAMP")
@Column(name = "asked_time")
private Instant askedTime;
@Lob
@Column(name = "question", nullable = false)
private String question;
@Lob
@Column(name = "answer", nullable = false)
private String answer;
}

View File

@ -1,29 +0,0 @@
package edu.zrh.healthsystem.eneity;
import jakarta.persistence.*;
import lombok.Data;
/**
* @author han
*/
@Data
@Entity
@Table(name = "user_info")
public class UserInfo {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int userId;
@Column(name = "User_name")
private String userName;
@Column(name = "User_password")
private String userPassword;
@Column(name = "User_elderly")
private Integer userElderly;
@Column(name = "User_email")
private String userEmail;
}

View File

@ -1,20 +0,0 @@
package edu.zrh.healthsystem.model;
/**
* @author han
*/
public class Basic {
private int elderlyId;
private String fullName;
private char gender;
private String dateOfBirth;
private String ethnicity;
private String nativePlace;
private String idNumber;
private String permanentAddress;
private String occupation;
private String educationLevel;
private boolean livingAlone;
private String maritalStatus;
private String phoneNumber;
}

View File

@ -1,43 +0,0 @@
package edu.zrh.healthsystem.model;
import edu.zrh.healthsystem.eneity.MainProfileInfo;
import lombok.Data;
import java.math.BigDecimal;
import java.time.LocalDate;
public @Data class Elderly {
private int elderlyId;
private MainProfileInfo profileId;
private String weightStatus;
private String bloodType;
private String chronicDiseases;
private BigDecimal height;
private BigDecimal weight;
private Integer heartRate;
private BigDecimal temperature;
private Integer oxygenSaturation;
private String bloodPressure;
private BigDecimal glucoseLevel;
private Integer pulse;
private byte[] faceImage;
private byte[] tongueImage;
private LocalDate checkupDate;
private String message;
}

View File

@ -1,8 +0,0 @@
package edu.zrh.healthsystem.model;
import lombok.Data;
public @Data class Message {
private String role="user";
private String content;
}

View File

@ -1,15 +0,0 @@
package edu.zrh.healthsystem.model;
import lombok.Data;
import java.util.List;
/**
* @author han
*/
public @Data class Talk {
private String model="qwen2";
private List<Message> messages;
private Boolean stream=false;
}

View File

@ -1,21 +0,0 @@
package edu.zrh.healthsystem.model;
import lombok.Data;
import java.util.List;
/**
* @author han
*/
public @Data class TalkResponse {
private String model;
private String created_at;
private String done;
private String total_duration;
private String load_duration;
private String prompt_eval_count;
private String prompt_eval_duration;
private String eval_count;
private String eval_duration;
private List<Message> messages;
}

View File

@ -1,8 +0,0 @@
package edu.zrh.healthsystem.model.elderly;
import lombok.Data;
public @Data class ElderlyConnect {
private int userId;
private int userElderly;
}

View File

@ -1,8 +0,0 @@
package edu.zrh.healthsystem.model.elderly;
import lombok.Data;
public @Data class ElderlyConnectResponse {
private int userId;
private String message;
}

View File

@ -1,32 +0,0 @@
package edu.zrh.healthsystem.model.elderly;
import lombok.Data;
import java.util.Date;
/**
* @author han
*/
public @Data class ElderlyNew {
private String fullName;
private String gender;
private Date dateOfBirth;
private String ethnicity;
private String nativePlace;
private String idNumber;
private String permanentAddress;
private String occupation;
private String educationLevel;
private String livingAlone;
private String maritalStatus;
private String phoneNumber;
private String contactName;
private String contactRelation;
private String contactPhone;
private String eatingHabits;
private String exerciseFrequency;
}

View File

@ -1,8 +0,0 @@
package edu.zrh.healthsystem.model.elderly;
import lombok.Data;
public @Data class ElderlyNewResponse {
private int elderlyId;
private String message;
}

View File

@ -1,27 +0,0 @@
package edu.zrh.healthsystem.model.elderly;
import lombok.Data;
import java.util.Date;
public @Data class ElderlyShowResponse {
private int ElderlyId;
private String fullName;
private String gender;
private Date dateOfBirth;
private String ethnicity;
private String nativePlace;
private String idNumber;
private String permanentAddress;
private String occupation;
private String educationLevel;
private String livingAlone;
private String maritalStatus;
private String phoneNumber;
private String contactName;
private String contactRelation;
private String contactPhone;
private String eatingHabits;
private String exerciseFrequency;
private String message;
}

View File

@ -1,47 +0,0 @@
package edu.zrh.healthsystem.model.elderly;
import edu.zrh.healthsystem.eneity.MainProfileInfo;
import jakarta.persistence.*;
import lombok.Data;
import java.math.BigDecimal;
import java.time.LocalDate;
/**
* @author han
*/
public @Data class RegularCheckupInfoResponse {
private Integer id;
private MainProfileInfo profileId;
private String weightStatus;
private String bloodType;
private String chronicDiseases;
private BigDecimal height;
private BigDecimal weight;
private Integer heartRate;
private BigDecimal temperature;
private Integer oxygenSaturation;
private String bloodPressure;
private BigDecimal glucoseLevel;
private Integer pulse;
private byte[] faceImage;
private byte[] tongueImage;
private LocalDate checkupDate;
private String message;
}

View File

@ -1,10 +0,0 @@
package edu.zrh.healthsystem.model.user;
import lombok.Data;
/**
* @author han
*/
public @Data class UserLogin {
private String userName;
private String userPassword;
}

View File

@ -1,14 +0,0 @@
package edu.zrh.healthsystem.model.user;
import lombok.Data;
/**
* @author han
*/
public @Data class UserLoginResponse {
private boolean userRe;
private int userId;
private String message;
}

View File

@ -1,13 +0,0 @@
package edu.zrh.healthsystem.model.user;
import lombok.Data;
/**
* @author han
*/
public @Data class UserRegister {
private String userName;
private String userPassword;
private String userEmail;
}

View File

@ -1,10 +0,0 @@
package edu.zrh.healthsystem.model.user;
import lombok.Data;
public @Data class UserRegisterResponse {
private boolean userRe;
private int userId;
private String message;
}

View File

@ -1,7 +0,0 @@
package edu.zrh.healthsystem.repository;
import edu.zrh.healthsystem.eneity.DailyScheduleInfo;
import org.springframework.data.jpa.repository.JpaRepository;
public interface DailyScheduleRepository extends JpaRepository<DailyScheduleInfo, Integer> {
}

View File

@ -1,7 +0,0 @@
package edu.zrh.healthsystem.repository;
import edu.zrh.healthsystem.eneity.DiseaseRecordInfo;
import org.springframework.data.jpa.repository.JpaRepository;
public interface DiseaseRecordRepository extends JpaRepository<DiseaseRecordInfo, Integer> {
}

View File

@ -1,7 +0,0 @@
package edu.zrh.healthsystem.repository;
import edu.zrh.healthsystem.eneity.HealthBehaviorInfo;
import org.springframework.data.jpa.repository.JpaRepository;
public interface HealthBehaviorInfoRespository extends JpaRepository<HealthBehaviorInfo, Integer> {
}

View File

@ -1,16 +0,0 @@
package edu.zrh.healthsystem.repository;
import edu.zrh.healthsystem.eneity.UserInfo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import java.util.Optional;
/**
* @author han
*/
@Repository
public interface LoginRepository extends JpaRepository<UserInfo, Integer> {
Optional<UserInfo> findByUserName(String username);
}

View File

@ -1,8 +0,0 @@
package edu.zrh.healthsystem.repository;
import edu.zrh.healthsystem.eneity.MainProfileInfo;
import edu.zrh.healthsystem.eneity.UserInfo;
import org.springframework.data.jpa.repository.JpaRepository;
public interface MainProfileInfoRepository extends JpaRepository<MainProfileInfo, Integer> {
}

View File

@ -1,18 +0,0 @@
package edu.zrh.healthsystem.repository;
import edu.zrh.healthsystem.eneity.UserInfo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import java.util.Optional;
/**
* @author han
*/
@Repository
public interface RegisterRepository extends JpaRepository<UserInfo, Integer> {
Optional<UserInfo> findByUserName(String username);
Optional<UserInfo> findByUserEmail(String userEmail);
}

View File

@ -1,13 +0,0 @@
package edu.zrh.healthsystem.repository;
import edu.zrh.healthsystem.eneity.RegularCheckupInfo;
import org.springframework.data.jpa.repository.JpaRepository;
import java.util.Optional;
/**
* @author han
*/
public interface RegularCheckupRepository extends JpaRepository<RegularCheckupInfo, Integer> {
Optional<RegularCheckupInfo> findById(int id);
}

View File

@ -1,7 +0,0 @@
package edu.zrh.healthsystem.repository.elderly;
import edu.zrh.healthsystem.eneity.BasicInfo;
import org.springframework.data.jpa.repository.JpaRepository;
public interface ElderMainRepository extends JpaRepository<BasicInfo, Integer> {
}

View File

@ -1,13 +0,0 @@
package edu.zrh.healthsystem.repository.elderly;
import edu.zrh.healthsystem.eneity.UserInfo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import java.util.Optional;
@Repository
public interface ElderlyConnectRepository extends JpaRepository<UserInfo, Integer> {
Optional<UserInfo> findByUserId(int userId);
Optional<UserInfo> findByUserElderly(int userElderly);
}

View File

@ -1,11 +0,0 @@
package edu.zrh.healthsystem.repository.elderly;
import edu.zrh.healthsystem.eneity.BasicInfo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import java.util.Optional;
@Repository
public interface ElderlyNewRepository extends JpaRepository<BasicInfo, Integer> {
Optional<BasicInfo> findByFullName(String fullName);
}

View File

@ -1,10 +0,0 @@
package edu.zrh.healthsystem.repository.elderly;
import edu.zrh.healthsystem.eneity.BasicInfo;
import org.springframework.data.jpa.repository.JpaRepository;
import java.util.Optional;
public interface ElderlyShowRepository extends JpaRepository<BasicInfo, Integer> {
Optional<BasicInfo> findByElderlyId(int elderlyId);
}

View File

@ -1,57 +0,0 @@
package edu.zrh.healthsystem.service;
import edu.zrh.healthsystem.eneity.UserInfo;
import edu.zrh.healthsystem.model.user.UserLogin;
import edu.zrh.healthsystem.model.user.UserLoginResponse;
import edu.zrh.healthsystem.repository.LoginRepository;
import jakarta.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.stereotype.Service;
import java.util.Optional;
/**
* @author han
*/
@Service
public class LoginService {
private final LoginRepository loginRepository;
@Resource
private BCryptPasswordEncoder passwordEncoder;
@Autowired
public LoginService( LoginRepository loginRepository){
this.loginRepository = loginRepository;
}
public UserLoginResponse login(UserLogin userLogin) {
Optional<UserInfo> optionalUserInfo = loginRepository.findByUserName(userLogin.getUserName());
UserLoginResponse userLoginResponse = new UserLoginResponse();
if (optionalUserInfo.isPresent()) {
UserInfo userInfo = optionalUserInfo.get();
// 检查提供的密码是否与数据库中存储的密码匹配
if (passwordEncoder.matches(userLogin.getUserPassword(), userInfo.getUserPassword())) {
// 如果密码正确返回userLogin对象
userLoginResponse.setUserId(userInfo.getUserId());
userLoginResponse.setUserRe(true);
userLoginResponse.setMessage("登录成功");
} else {
// 如果密码不正确抛出异常或返回null
userLoginResponse.setUserId(-1);
userLoginResponse.setUserRe(true);
userLoginResponse.setMessage("密码错误");
}
} else {
// 如果找不到用户抛出异常或返回null
userLoginResponse.setUserId(-2);
userLoginResponse.setUserRe(true);
userLoginResponse.setMessage("未注册用户");
}
return userLoginResponse;
}
}

View File

@ -1,55 +0,0 @@
package edu.zrh.healthsystem.service;
import edu.zrh.healthsystem.eneity.UserInfo;
import edu.zrh.healthsystem.model.user.UserRegister;
import edu.zrh.healthsystem.model.user.UserRegisterResponse;
import edu.zrh.healthsystem.repository.RegisterRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.stereotype.Service;
import java.util.Optional;
/**
* @author han
*/
@Service
public class RegisterService {
private final RegisterRepository registerRepository;
// 密码加密
BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
@Autowired
public RegisterService(RegisterRepository registerRepository) {
this.registerRepository = registerRepository;
}
public UserRegisterResponse register(UserRegister userRegister) {
// 检查用户名和电子邮件是否已存在
Optional<UserInfo> optionalName = registerRepository.findByUserName(userRegister.getUserName());
Optional<UserInfo> optionalEmail = registerRepository.findByUserEmail(userRegister.getUserEmail());
UserRegisterResponse userRegisterResponse = new UserRegisterResponse();
if (optionalName.isPresent()) {
userRegisterResponse.setMessage("已经存在账户名");
}
else
{
if (optionalEmail.isPresent()) {
userRegisterResponse.setMessage("已经存在电子邮件");
}
else
{
UserInfo user = new UserInfo();
user.setUserName(userRegister.getUserName());
user.setUserEmail(userRegister.getUserEmail());
user.setUserPassword(passwordEncoder.encode(userRegister.getUserPassword()));
registerRepository.save(user);
userRegisterResponse.setUserId(user.getUserId());
userRegisterResponse.setMessage("注册成功");
}
}
return userRegisterResponse;
}
}

View File

@ -1,134 +0,0 @@
package edu.zrh.healthsystem.service;
import edu.zrh.healthsystem.eneity.RegularCheckupInfo;
import edu.zrh.healthsystem.model.Elderly;
import edu.zrh.healthsystem.model.elderly.RegularCheckupInfoResponse;
import edu.zrh.healthsystem.repository.RegularCheckupRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Optional;
@Service
public class RegularCheckupService {
private final RegularCheckupRepository regularCheckupRespository;
@Autowired
public RegularCheckupService(RegularCheckupRepository regularCheckupRespository) {
this.regularCheckupRespository = regularCheckupRespository;
}
RegularCheckupInfoResponse regularCheckupInfoResponse = new RegularCheckupInfoResponse();
public RegularCheckupInfoResponse add(Elderly elderly) {
Optional<RegularCheckupInfo> optionalElderly = regularCheckupRespository.findById(elderly.getElderlyId());
if (optionalElderly.isPresent()) {
regularCheckupInfoResponse.setMessage("已经有表");
} else {
RegularCheckupInfo regularCheckupInfo = new RegularCheckupInfo();
regularCheckupInfo.setBloodType(elderly.getBloodType());
regularCheckupInfo.setId(elderly.getElderlyId());
regularCheckupInfo.setCheckupDate(elderly.getCheckupDate());
regularCheckupInfo.setBloodPressure(elderly.getBloodPressure());
regularCheckupInfo.setFaceImage(elderly.getFaceImage());
regularCheckupInfo.setHeight(elderly.getHeight());
regularCheckupInfo.setGlucoseLevel(elderly.getGlucoseLevel());
regularCheckupInfo.setPulse(elderly.getPulse());
regularCheckupInfo.setHeartRate(elderly.getHeartRate());
regularCheckupInfo.setChronicDiseases(elderly.getChronicDiseases());
regularCheckupInfo.setTemperature(elderly.getTemperature());
regularCheckupInfo.setWeight(elderly.getWeight());
regularCheckupInfo.setTongueImage(elderly.getTongueImage());
regularCheckupInfo.setWeightStatus(elderly.getWeightStatus());
regularCheckupInfo.setOxygenSaturation(elderly.getOxygenSaturation());
regularCheckupRespository.save(regularCheckupInfo);
regularCheckupInfoResponse.setMessage("添加成功");
}
return regularCheckupInfoResponse;
}
public RegularCheckupInfoResponse delete(Elderly elderly) {
Optional<RegularCheckupInfo> optionalElderly = regularCheckupRespository.findById(elderly.getElderlyId());
if (optionalElderly.isPresent()) {
RegularCheckupInfo regularCheckupInfo = optionalElderly.get();
regularCheckupInfo.setBloodType(elderly.getBloodType());
regularCheckupInfo.setId(elderly.getElderlyId());
regularCheckupInfo.setCheckupDate(elderly.getCheckupDate());
regularCheckupInfo.setBloodPressure(elderly.getBloodPressure());
regularCheckupInfo.setFaceImage(elderly.getFaceImage());
regularCheckupInfo.setHeight(elderly.getHeight());
regularCheckupInfo.setGlucoseLevel(elderly.getGlucoseLevel());
regularCheckupInfo.setPulse(elderly.getPulse());
regularCheckupInfo.setHeartRate(elderly.getHeartRate());
regularCheckupInfo.setChronicDiseases(elderly.getChronicDiseases());
regularCheckupInfo.setTemperature(elderly.getTemperature());
regularCheckupInfo.setWeight(elderly.getWeight());
regularCheckupInfo.setTongueImage(elderly.getTongueImage());
regularCheckupInfo.setWeightStatus(elderly.getWeightStatus());
regularCheckupInfo.setOxygenSaturation(elderly.getOxygenSaturation());
regularCheckupRespository.save(regularCheckupInfo);
regularCheckupInfoResponse.setMessage("删除成功");
} else {
regularCheckupInfoResponse.setMessage("没有该表");
}
return regularCheckupInfoResponse;
}
public RegularCheckupInfoResponse update(Elderly elderly) {
Optional<RegularCheckupInfo> optionalElderly = regularCheckupRespository.findById(elderly.getElderlyId());
if (optionalElderly.isPresent()) {
RegularCheckupInfo regularCheckupInfo = optionalElderly.get();
regularCheckupInfo.setBloodType(elderly.getBloodType());
regularCheckupInfo.setId(elderly.getElderlyId());
regularCheckupInfo.setCheckupDate(elderly.getCheckupDate());
regularCheckupInfo.setBloodPressure(elderly.getBloodPressure());
regularCheckupInfo.setFaceImage(elderly.getFaceImage());
regularCheckupInfo.setHeight(elderly.getHeight());
regularCheckupInfo.setGlucoseLevel(elderly.getGlucoseLevel());
regularCheckupInfo.setPulse(elderly.getPulse());
regularCheckupInfo.setHeartRate(elderly.getHeartRate());
regularCheckupInfo.setChronicDiseases(elderly.getChronicDiseases());
regularCheckupInfo.setTemperature(elderly.getTemperature());
regularCheckupInfo.setWeight(elderly.getWeight());
regularCheckupInfo.setTongueImage(elderly.getTongueImage());
regularCheckupInfo.setWeightStatus(elderly.getWeightStatus());
regularCheckupInfo.setOxygenSaturation(elderly.getOxygenSaturation());
regularCheckupRespository.save(regularCheckupInfo);
regularCheckupInfoResponse.setMessage("更新成功");
} else {
regularCheckupInfoResponse.setMessage("没有该表");
}
return regularCheckupInfoResponse;
}
public RegularCheckupInfoResponse get(Elderly elderly) {
Optional<RegularCheckupInfo> optionalElderly = regularCheckupRespository.findById(elderly.getElderlyId());
if (optionalElderly.isPresent()) {
regularCheckupInfoResponse.setBloodType(elderly.getBloodType());
regularCheckupInfoResponse.setId(elderly.getElderlyId());
regularCheckupInfoResponse.setCheckupDate(elderly.getCheckupDate());
regularCheckupInfoResponse.setBloodPressure(elderly.getBloodPressure());
regularCheckupInfoResponse.setFaceImage(elderly.getFaceImage());
regularCheckupInfoResponse.setHeight(elderly.getHeight());
regularCheckupInfoResponse.setGlucoseLevel(elderly.getGlucoseLevel());
regularCheckupInfoResponse.setPulse(elderly.getPulse());
regularCheckupInfoResponse.setHeartRate(elderly.getHeartRate());
regularCheckupInfoResponse.setChronicDiseases(elderly.getChronicDiseases());
regularCheckupInfoResponse.setTemperature(elderly.getTemperature());
regularCheckupInfoResponse.setWeight(elderly.getWeight());
regularCheckupInfoResponse.setProfileId(elderly.getProfileId());
regularCheckupInfoResponse.setTongueImage(elderly.getTongueImage());
regularCheckupInfoResponse.setWeightStatus(elderly.getWeightStatus());
regularCheckupInfoResponse.setOxygenSaturation(elderly.getOxygenSaturation());
regularCheckupInfoResponse.setMessage("查找成功");
} else {
regularCheckupInfoResponse.setMessage("没有该表");
}
return regularCheckupInfoResponse;
}
public RegularCheckupInfoResponse getAll() {
//待实现
regularCheckupInfoResponse.setMessage("查找全部成功");
return regularCheckupInfoResponse;
}
}

View File

@ -1,28 +0,0 @@
package edu.zrh.healthsystem.service;
import edu.zrh.healthsystem.model.Talk;
import edu.zrh.healthsystem.model.TalkResponse;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;
import java.util.Map;
/**
* @author han
*/
@Service
public class TalkService {
private final RestTemplate restTemplate;
public TalkService(RestTemplate restTemplate) {
this.restTemplate = restTemplate;
}
public String callApi(String url) {
return restTemplate.getForObject(url, String.class);
}
public TalkResponse callApiChat(Talk request) {
return restTemplate.postForObject("http://10.10.10.44:11434/api/chat", request, TalkResponse.class);
}
}

View File

@ -1,25 +0,0 @@
package edu.zrh.healthsystem.service.elderly;
import edu.zrh.healthsystem.eneity.BasicInfo;
import edu.zrh.healthsystem.repository.elderly.ElderMainRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @author han
*/
@Service
public class ElderMainService {
private final ElderMainRepository elderMainRepository;
@Autowired
public ElderMainService(ElderMainRepository elderMainRepository) {this.elderMainRepository = elderMainRepository;}
public List elderMain(){
List<BasicInfo> basicInfoList = elderMainRepository.findAll();
return basicInfoList;
}
}

View File

@ -1,47 +0,0 @@
package edu.zrh.healthsystem.service.elderly;
import edu.zrh.healthsystem.eneity.UserInfo;
import edu.zrh.healthsystem.model.elderly.ElderlyConnect;
import edu.zrh.healthsystem.model.elderly.ElderlyConnectResponse;
import edu.zrh.healthsystem.repository.elderly.ElderlyConnectRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Optional;
/**
* @author han
*/
@Service
public class ElderlyConnectService {
private final ElderlyConnectRepository elderlyConnectRepository;
@Autowired
public ElderlyConnectService(ElderlyConnectRepository elderlyConnectRepository) {
this.elderlyConnectRepository = elderlyConnectRepository;
}
public ElderlyConnectResponse getElderlyConnectResponse(ElderlyConnect elderlyConnect) {
Optional<UserInfo> optionalUserId = elderlyConnectRepository.findByUserId(elderlyConnect.getUserId());
Optional<UserInfo> optionalUserElderly = elderlyConnectRepository.findByUserElderly(elderlyConnect.getUserElderly());
ElderlyConnectResponse elderlyConnectResponse = new ElderlyConnectResponse();
if (optionalUserId.isPresent()) {
if(optionalUserElderly.isPresent())
{
UserInfo userInfo = optionalUserId.get();
userInfo.setUserElderly(elderlyConnect.getUserElderly());
elderlyConnectResponse.setUserId(elderlyConnect.getUserId());
elderlyConnectResponse.setMessage("添加成功");
}
else {
elderlyConnectResponse.setUserId(-2);
elderlyConnectResponse.setMessage("该老人不存在");
}
}
else {
elderlyConnectResponse.setUserId(-1);
elderlyConnectResponse.setMessage("该用户不存在");
}
return elderlyConnectResponse;
}
}

View File

@ -1,66 +0,0 @@
package edu.zrh.healthsystem.service.elderly;
import edu.zrh.healthsystem.eneity.BasicInfo;
import edu.zrh.healthsystem.eneity.MainProfileInfo;
import edu.zrh.healthsystem.model.elderly.ElderlyNew;
import edu.zrh.healthsystem.model.elderly.ElderlyNewResponse;
import edu.zrh.healthsystem.repository.elderly.ElderlyNewRepository;
import edu.zrh.healthsystem.repository.MainProfileInfoRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Optional;
/**
* @author han
*/
@Service
public class ElderlyNewService {
private final ElderlyNewRepository elderlyNewRepository;
private final MainProfileInfoRepository mainProfileInfoRepository;
@Autowired
public ElderlyNewService(ElderlyNewRepository elderlyNewRepository, MainProfileInfoRepository mainProfileInfoRepository) {
this.elderlyNewRepository = elderlyNewRepository;
this.mainProfileInfoRepository = mainProfileInfoRepository;
}
public ElderlyNewResponse elderly(ElderlyNew elderlyNew) {
Optional<BasicInfo> optionalBasicInfo = elderlyNewRepository.findByFullName(elderlyNew.getFullName());
ElderlyNewResponse elderlyNewResponse = new ElderlyNewResponse();
if (optionalBasicInfo.isPresent()) {
elderlyNewResponse.setElderlyId(-1);
elderlyNewResponse.setMessage("该用户已存在");
}
else {
BasicInfo basic = new BasicInfo();
basic.setContactRelation(elderlyNew.getContactRelation());
basic.setContactPhone(elderlyNew.getContactPhone());
basic.setContactName(elderlyNew.getContactName());
basic.setFullName(elderlyNew.getFullName());
basic.setGender(elderlyNew.getGender());
basic.setDateOfBirth(elderlyNew.getDateOfBirth());
basic.setEthnicity(elderlyNew.getEthnicity());
basic.setNativePlace(elderlyNew.getNativePlace());
basic.setIdNumber(elderlyNew.getIdNumber());
basic.setPermanentAddress(elderlyNew.getPermanentAddress());
basic.setOccupation(elderlyNew.getOccupation());
basic.setEducationLevel(elderlyNew.getEducationLevel());
basic.setLivingAlone(elderlyNew.getLivingAlone());
basic.setMaritalStatus(elderlyNew.getMaritalStatus());
basic.setPhoneNumber(elderlyNew.getPhoneNumber());
basic.setEatingHabits(elderlyNew.getEatingHabits());
basic.setExerciseFrequency(elderlyNew.getExerciseFrequency());
elderlyNewRepository.save(basic);
// 创建MainProfile记录
MainProfileInfo mainProfile = new MainProfileInfo();
mainProfile.setElderlyId(basic);
// 保存MainProfile记录
mainProfileInfoRepository.save(mainProfile);
elderlyNewResponse.setElderlyId(basic.getElderlyId());
elderlyNewResponse.setMessage("提交成功");
}
return elderlyNewResponse;
}
}

View File

@ -1,51 +0,0 @@
package edu.zrh.healthsystem.service.elderly;
import edu.zrh.healthsystem.eneity.BasicInfo;
import edu.zrh.healthsystem.model.Elderly;
import edu.zrh.healthsystem.repository.elderly.ElderlyShowRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import edu.zrh.healthsystem.model.elderly.ElderlyShowResponse;
import java.util.Optional;
@Service
public class ElderlyShowService {
private final ElderlyShowRepository elderlyShowRepository;
@Autowired
public ElderlyShowService(ElderlyShowRepository elderlyShowRepository) {
this.elderlyShowRepository = elderlyShowRepository;
}
public ElderlyShowResponse getElderlyShow(Elderly elderly) {
Optional<BasicInfo> optionalelderlyId = elderlyShowRepository.findByElderlyId(elderly.getElderlyId());
ElderlyShowResponse elderlyShowResponse = new ElderlyShowResponse();
if (optionalelderlyId.isPresent()) {
BasicInfo basic=optionalelderlyId.get();
elderlyShowResponse.setElderlyId(basic.getElderlyId());
elderlyShowResponse.setContactName(basic.getContactName());
elderlyShowResponse.setContactPhone(basic.getContactPhone());
elderlyShowResponse.setEatingHabits(basic.getEatingHabits());
elderlyShowResponse.setContactRelation(basic.getContactRelation());
elderlyShowResponse.setEthnicity(basic.getEthnicity());
elderlyShowResponse.setEducationLevel(basic.getEducationLevel());
elderlyShowResponse.setExerciseFrequency(basic.getExerciseFrequency());
elderlyShowResponse.setGender(basic.getGender());
elderlyShowResponse.setMaritalStatus(basic.getMaritalStatus());
elderlyShowResponse.setDateOfBirth(basic.getDateOfBirth());
elderlyShowResponse.setOccupation(basic.getOccupation());
elderlyShowResponse.setLivingAlone(basic.getLivingAlone());
elderlyShowResponse.setNativePlace(basic.getNativePlace());
elderlyShowResponse.setFullName(basic.getFullName());
elderlyShowResponse.setMessage("获取成功");
elderlyShowResponse.setPermanentAddress(basic.getPermanentAddress());
elderlyShowResponse.setIdNumber(basic.getIdNumber());
elderlyShowResponse.setPhoneNumber(basic.getPhoneNumber());
}
else {
elderlyShowResponse.setMessage("该用户不存在");
}
return elderlyShowResponse;
}
}

View File

@ -1,34 +0,0 @@
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc.xsd">
<!--开启包扫描-->
<context:component-scan base-package="edu.zrh.healthsystem"/>
<context:property-placeholder location="classpath:application.properties" />
<!--开启注解驱动注册一些必要的Bean到SpringMVC容器里面-->
<mvc:annotation-driven>
<!-- 处理乱码 -->
<mvc:message-converters register-defaults="true">
<bean class="org.springframework.http.converter.StringHttpMessageConverter">
<constructor-arg value="UTF-8"/>
</bean>
</mvc:message-converters>
</mvc:annotation-driven>
<!-- 视图解析器
作用1.捕获后端控制器的返回值="index"
2.解析: 在返回值的前后 拼接 ==> "/index.jsp"
-->
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<!-- 前缀 -->
<property name="prefix" value="/WEB-INF/jsp/"></property>
<!-- 后缀 -->
<property name="suffix" value=".jsp"></property>
</bean>
</beans>

View File

@ -1,23 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
version="4.0">
<servlet>
<servlet-name>springmvc</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<!-- 告诉SpringMVC配置文件在哪里-->
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:/WEB-INF/spring-conf/mvc.xml</param-value>
<!-- <param-value>/WEB-INF/spring-conf/mvc.xml</param-value>-->
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>springmvc</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
</web-app>

View File

@ -1,7 +0,0 @@
spring.application.name=healthSystem
# DataSource settings
spring.datasource.url= jdbc:mysql://localhost:3306/healthsystem?allowPublicKeyRetrieval=true&useSSL=false&serverTimezone=Asia/Shanghai
spring.datasource.username=root
spring.datasource.password=1234
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver

157
src/router/index.js Normal file
View File

@ -0,0 +1,157 @@
import { createRouter, createWebHistory } from 'vue-router'
import {User} from "@element-plus/icons-vue";
const routes = [
{
path: "",
redirect: "/login",
children: [
{
path: "/login",
component: () => import(`@/views/login/Index.vue`)
}
]
},
{
path: '/',
name: 'Layout1',
component: () => import('../layout/Layout1.vue'),
children: [
{
path: '',
name: 'Layout',
component: () => import('../components/Layout.vue'),
redirect: 'home',
children: [
{
path: 'home',
name: 'Home',
component: () => import('../views/Home.vue'),
meta: { title: '首页' }
},
{
path: 'medical',
name: 'Medical',
component: () => import('../views/medical/Index.vue'),
redirect: 'medical/query',
meta: { title: '病历管理' },
children: [
{
path: 'input',
name: 'MedicalInput',
component: () => import('../views/medical/Input.vue'),
meta: { title: '病历录入' }
},
{
path: 'query',
name: 'MedicalQuery',
component: () => import('../views/medical/Query.vue'),
meta: { title: '病历查询' }
},
{
path: 'edit',
name: 'MedicalEdit',
component: () => import('../views/medical/Edit.vue'),
meta: { title: '病历修改' }
},
{
path: 'delete',
name: 'MedicalDelete',
component: () => import('../views/medical/Delete.vue'),
meta: { title: '病历删除' }
}
]
},
{
path: 'consultation',
name: 'Consultation',
component: () => import('../views/consultation/Index.vue'),
redirect: 'consultation/inquiry',
meta: { title: '医慧咨询' },
children: [
{
path: 'inquiry',
name: 'ConsultationInquiry',
component: () => import('../views/consultation/Inquiry.vue'),
meta: { title: '病情询问' }
},
{
path: 'record',
name: 'ConsultationRecord',
component: () => import('../views/consultation/Record.vue'),
meta: { title: '病历记录' }
}
]
},
{
path: 'template',
name: 'Template',
component: () => import('../views/template/Index.vue'),
redirect: 'template/query',
meta: { title: '病历模板' },
children: [
{
path: 'input',
name: 'TemplateInput',
component: () => import('../views/template/Input.vue'),
meta: { title: '模板录入' }
},
{
path: 'query',
name: 'TemplateQuery',
component: () => import('../views/template/Query.vue'),
meta: { title: '模板查询' }
},
{
path: 'edit',
name: 'TemplateEdit',
component: () => import('../views/template/Edit.vue'),
meta: { title: '模板修改' }
},
{
path: 'delete',
name: 'TemplateDelete',
component: () => import('../views/template/Delete.vue'),
meta: { title: '模板删除' }
}
]
},
{
path: 'data',
name: 'Data',
component: () => import('../views/data/Index.vue'),
meta: { title: '病历数据' }
},
{
path: 'ocr',
name: 'OCR',
component: () => import('../views/ocr/TextRecognition.vue'),
meta: { title: '文字识别' }
},
{
path: 'user',
name: 'User',
component: () => import('../views/user/User.vue'),
meta: { title: '用户管理' }
}
]
}
]
},
]
const router = createRouter({
history: createWebHistory(),
routes
})
export default router

79
src/style.css Normal file
View File

@ -0,0 +1,79 @@
:root {
font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
line-height: 1.5;
font-weight: 400;
color-scheme: light dark;
color: rgba(255, 255, 255, 0.87);
background-color: #242424;
font-synthesis: none;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
a {
font-weight: 500;
color: #646cff;
text-decoration: inherit;
}
a:hover {
color: #535bf2;
}
body {
margin: 0;
display: flex;
place-items: center;
min-width: 320px;
min-height: 100vh;
}
h1 {
font-size: 3.2em;
line-height: 1.1;
}
button {
border-radius: 8px;
border: 1px solid transparent;
padding: 0.6em 1.2em;
font-size: 1em;
font-weight: 500;
font-family: inherit;
background-color: #1a1a1a;
cursor: pointer;
transition: border-color 0.25s;
}
button:hover {
border-color: #646cff;
}
button:focus,
button:focus-visible {
outline: 4px auto -webkit-focus-ring-color;
}
.card {
padding: 2em;
}
#app {
max-width: 1280px;
margin: 0 auto;
padding: 2rem;
text-align: center;
}
@media (prefers-color-scheme: light) {
:root {
color: #213547;
background-color: #ffffff;
}
a:hover {
color: #747bff;
}
button {
background-color: #f9f9f9;
}
}

View File

@ -0,0 +1,20 @@
/* 自定义 Element Plus 主题 */
@forward 'element-plus/theme-chalk/src/common/var.scss' with (
$colors: (
'primary': (
'base': #409eff,
),
'success': (
'base': #67c23a,
),
'warning': (
'base': #e6a23c,
),
'danger': (
'base': #f56c6c,
),
'info': (
'base': #909399,
),
)
);

37
src/styles/views.css Normal file
View File

@ -0,0 +1,37 @@
/* 统一视图组件样式 */
.medical-query,
.data-view,
.medical-input,
.medical-edit,
.medical-delete,
.user-input,
.user-edit,
.user-delete,
.template-input,
.template-query,
.template-edit {
height: 100%;
width: 100%;
box-sizing: border-box;
}
/* 移除所有视图组件的内边距,由主布局统一控制 */
.el-main {
padding: 0 !important;
}
/* 确保表格容器不会产生独立滚动条 */
.el-table {
width: 100% !important;
}
/* 统一卡片样式 */
.el-card {
margin-bottom: 20px;
}
/* 图表容器样式 */
.chart-container {
height: 300px;
width: 100%;
}

View File

@ -1,22 +0,0 @@
package edu.zrh.healthsystem;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
import java.sql.DriverManager;
import java.sql.Driver;
import java.util.Enumeration;
@SpringBootTest
class HealthSystemApplicationTests {
@Test
void contextLoads() {
Enumeration<Driver> drivers = DriverManager.getDrivers();
while (drivers.hasMoreElements()) {
Driver driver = drivers.nextElement();
System.out.println("驱动名称: " + driver.getClass().getName());
}
}
}

View File

@ -0,0 +1,54 @@
// axiosInstance.js
import axios from "axios";
// 定义一个变量记录公共的前缀baseURL
const baseURL = 'http://localhost:8080'; // 请根据实际后端接口修改
const instance = axios.create({ baseURL });
// 添加请求拦截器
instance.interceptors.request.use(
config => {
const token = sessionStorage.getItem('token');
console.log("请求拦截器", token);
if (token) {
console.log("有token");
config.headers['Authorization'] = `Bearer ${token}`; // 添加 Bearer Token
} else {
console.log("无token");
delete config.headers['Authorization']; // 未登录时,删除 Authorization
}
return config;
},
error => {
console.log("请求拦截器错误", error);
return Promise.reject(error);
}
);
// 添加响应拦截器
instance.interceptors.response.use(
result => {
// 成功的回调(状态码为200)
return result.data;
},
err => {
// 失败的回调(状态码非200)
if (err.response && err.response.status === 401) {
// 401 Unauthorized: Token 可能已过期或无效
alert("身份认证失败,请重新登录!");
sessionStorage.removeItem('token'); // 清除无效 Token
window.location.href = '/login'; // 跳转到登录页面
} else if(err.response && err.response.status === 403) {
// 403 Forbidden: 没有权限访问
alert("没有权限访问");
} else {
// 其它错误
alert("服务异常");
}
// 异步状态转为失败状态
return Promise.reject(err);
}
);
// 将实例暴露到外界
export default instance;

19
src/utils/data.js Normal file
View File

@ -0,0 +1,19 @@
export function timeAgo(dateString) {
const now = new Date();
const date = new Date(dateString);
const secondsPast = (now.getTime() - date.getTime()) / 1000;
if (secondsPast < 60) {
return `${Math.floor(secondsPast)} 秒前`;
} else if (secondsPast < 3600) {
return `${Math.floor(secondsPast / 60)} 分钟前`;
} else if (secondsPast <= 86400) {
return `${Math.floor(secondsPast / 3600)} 小时前`;
} else {
const daysPast = Math.floor(secondsPast / 86400);
if (daysPast === 1) {
return '1 天前';
} else {
return `${daysPast} 天前`;
}
}
}

29
src/utils/storage.js Normal file
View File

@ -0,0 +1,29 @@
const TOKEN_KEY="token"
const INFO = "health-info";
const ACTIVE_PATH="active_key"
export function getToken(){
return sessionStorage.getItem(TOKEN_KEY);
}
export function setToken(token){
sessionStorage.setItem(TOKEN_KEY,token);
}
export function getHealthInfo(){
return sessionStorage.getItem(INFO);
}
export function setHealthInfo(obj){
sessionStorage.setItem(INFO,obj);
}
export function clearToken(){
sessionStorage.clear();
}
export function getActivePath(){
return sessionStorage.getItem(ACTIVE_PATH);
}
export function setActivePath(path){
sessionStorage.setItem(ACTIVE_PATH, path);
}

40
src/utils/swalPlugin.js Normal file
View File

@ -0,0 +1,40 @@
// swalPlugin.js
import Swal from 'sweetalert2';
// 五种图标: success\error\info\warning\question
// 提示框:
// this.$swal.fire({
// title: '退出登录',
// text: '您已成功退出登录。',
// icon: 'success', // 使用'success'图标表示操作成功
// showConfirmButton: false, // 隐藏确认按钮,使得弹窗只展示信息后自动关闭
// timer: 2000, // 自动关闭弹窗的延迟时间这里是2秒
// });
const swalPlugin = {
install(Vue) {
Vue.prototype.$swalConfirm = async function(options = {}) {
const defaultOptions = {
title: "提示",
text: '',
icon: 'info',
reverseButtons: true,
showCancelButton: true,
confirmButtonText: '确认',
cancelButtonText: '取消',
customClass: {
confirmButton: 'sweet-btn-primary',
},
...options,
};
try {
const result = await Swal.fire(defaultOptions);
return result.isConfirmed;
} catch (error) {
console.error('Swal Error:', error);
return false;
}
};
},
};
export default swalPlugin;

244
src/views/Home.vue Normal file
View File

@ -0,0 +1,244 @@
<template>
<div class="home-container">
<el-row :gutter="20">
<el-col :span="8">
<el-card class="box-card">
<template #header>
<div class="card-header">
<span>今日就诊人数</span>
</div>
</template>
<div class="card-content">
<el-statistic :value="156">
<template #title>
<div style="display: inline-flex; align-items: center">
较昨日
<el-icon style="color: #3c9cff; margin-left: 4px">
<CaretTop />
</el-icon>
<span style="color: #3c9cff; margin-left: 4px">13%</span>
</div>
</template>
</el-statistic>
</div>
</el-card>
</el-col>
<el-col :span="8">
<el-card class="box-card">
<template #header>
<div class="card-header">
<span>待处理病历</span>
</div>
</template>
<div class="card-content">
<el-statistic :value="28">
<template #title>
<div style="display: inline-flex; align-items: center">
较昨日
<el-icon style="color: #f56c6c; margin-left: 4px">
<CaretBottom />
</el-icon>
<span style="color: #f56c6c; margin-left: 4px">8%</span>
</div>
</template>
</el-statistic>
</div>
</el-card>
</el-col>
<el-col :span="8">
<el-card class="box-card">
<template #header>
<div class="card-header">
<span>系统消息</span>
</div>
</template>
<div class="card-content">
<el-statistic :value="5">
<template #title>
<div style="display: inline-flex; align-items: center">
未读消息
</div>
</template>
</el-statistic>
</div>
</el-card>
</el-col>
</el-row>
<el-row :gutter="20" class="chart-row">
<el-col :span="12">
<el-card class="chart-card">
<template #header>
<div class="card-header">
<span>就诊人数趋势</span>
</div>
</template>
<div class="chart-container" ref="lineChart"></div>
</el-card>
</el-col>
<el-col :span="12">
<el-card class="chart-card">
<template #header>
<div class="card-header">
<span>科室分布</span>
</div>
</template>
<div class="chart-container" ref="pieChart"></div>
</el-card>
</el-col>
</el-row>
<el-row style="margin-top: 20px">
<el-col :span="24">
<el-card class="box-card">
<template #header>
<div class="card-header">
<span>最近病历记录</span>
<el-button class="button" text>查看更多</el-button>
</div>
</template>
<el-table :data="tableData" style="width: 100%">
<el-table-column prop="date" label="日期" width="180" />
<el-table-column prop="name" label="患者姓名" width="180" />
<el-table-column prop="department" label="就诊科室" />
<el-table-column prop="doctor" label="主治医师" />
<el-table-column prop="status" label="状态">
<template #default="scope">
<el-tag :type="scope.row.status === '已完成' ? 'success' : 'warning'">
{{ scope.row.status }}
</el-tag>
</template>
</el-table-column>
</el-table>
</el-card>
</el-col>
</el-row>
</div>
</template>
<script setup>
import { ref, onMounted } from 'vue'
import { CaretTop, CaretBottom } from '@element-plus/icons-vue'
import * as echarts from 'echarts'
const tableData = ref([
{
date: '2024-03-15',
name: '张三',
department: '内科',
doctor: '李医生',
status: '已完成'
},
{
date: '2024-03-15',
name: '李四',
department: '外科',
doctor: '王医生',
status: '处理中'
},
{
date: '2024-03-15',
name: '王五',
department: '骨科',
doctor: '赵医生',
status: '已完成'
}
])
const lineChart = ref(null)
const pieChart = ref(null)
onMounted(() => {
// 线
const lineChartInstance = echarts.init(lineChart.value)
lineChartInstance.setOption({
tooltip: {
trigger: 'axis'
},
xAxis: {
type: 'category',
data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日']
},
yAxis: {
type: 'value'
},
series: [
{
data: [82, 93, 90, 93, 129, 133, 132],
type: 'line',
smooth: true
}
]
})
//
const pieChartInstance = echarts.init(pieChart.value)
pieChartInstance.setOption({
tooltip: {
trigger: 'item'
},
legend: {
orient: 'vertical',
left: 'left'
},
series: [
{
type: 'pie',
radius: '50%',
data: [
{ value: 235, name: '内科' },
{ value: 180, name: '外科' },
{ value: 147, name: '儿科' },
{ value: 102, name: '妇科' },
{ value: 95, name: '眼科' }
],
emphasis: {
itemStyle: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)'
}
}
}
]
})
//
window.addEventListener('resize', () => {
lineChartInstance.resize()
pieChartInstance.resize()
})
})
</script>
<style scoped>
.home-container {
padding: 20px;
}
.box-card {
margin-bottom: 20px;
}
.card-header {
display: flex;
justify-content: space-between;
align-items: center;
}
.card-content {
text-align: center;
}
.chart-row {
margin-top: 20px;
}
.chart-card {
margin-bottom: 20px;
}
.chart-container {
height: 300px;
}
</style>

Some files were not shown because too many files have changed in this diff Show More