Compare commits

..

1 Commits

87 changed files with 1980 additions and 20961 deletions

View File

@ -171,8 +171,8 @@
this.historyHelpList.push(item);
}
})
this.notHelpNoData = this.notHelpList.length === 0 ? true : false;
this.historyHelpNoData = this.historyHelpList.length === 0 ? true : false;
this.notHelpNoData = res.data.length === 0 ? true : false;
this.historyHelpNoData = res.data.length === 0 ? true : false;
console.log("历史帮助列表",res);
},err => {
console.log("err",err);

View File

@ -1,4 +1,5 @@
const baseUrl = 'http://127.0.0.1:8048'; //服务器地址
const baseUrl = 'http://192.168.10.29:8048'; //服务器地址
// const baseUrl = 'http://127.0.0.1:8048'; //服务器地址
const get = (url, data) => {
let httpDefaultOpts = {

31
HSLink-back/.gitignore vendored Normal file
View File

@ -0,0 +1,31 @@
HELP.md
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**
!**/src/test/**
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
### VS Code ###
.vscode/

View File

@ -0,0 +1,118 @@
/*
* Copyright 2007-present the original author or authors.
*
* Licensed 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
*
* https://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.
*/
import java.net.*;
import java.io.*;
import java.nio.channels.*;
import java.util.Properties;
public class MavenWrapperDownloader {
private static final String WRAPPER_VERSION = "0.5.6";
/**
* Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
*/
private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
+ WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar";
/**
* Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
* use instead of the default one.
*/
private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
".mvn/wrapper/maven-wrapper.properties";
/**
* Path where the maven-wrapper.jar will be saved to.
*/
private static final String MAVEN_WRAPPER_JAR_PATH =
".mvn/wrapper/maven-wrapper.jar";
/**
* Name of the property which should be used to override the default download url for the wrapper.
*/
private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
public static void main(String args[]) {
System.out.println("- Downloader started");
File baseDirectory = new File(args[0]);
System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
// If the maven-wrapper.properties exists, read it and check if it contains a custom
// wrapperUrl parameter.
File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
String url = DEFAULT_DOWNLOAD_URL;
if (mavenWrapperPropertyFile.exists()) {
FileInputStream mavenWrapperPropertyFileInputStream = null;
try {
mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
Properties mavenWrapperProperties = new Properties();
mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
} catch (IOException e) {
System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
} finally {
try {
if (mavenWrapperPropertyFileInputStream != null) {
mavenWrapperPropertyFileInputStream.close();
}
} catch (IOException e) {
// Ignore ...
}
}
}
System.out.println("- Downloading from: " + url);
File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
if (!outputFile.getParentFile().exists()) {
if (!outputFile.getParentFile().mkdirs()) {
System.out.println(
"- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'");
}
}
System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
try {
downloadFileFromURL(url, outputFile);
System.out.println("Done");
System.exit(0);
} catch (Throwable e) {
System.out.println("- Error downloading");
e.printStackTrace();
System.exit(1);
}
}
private static void downloadFileFromURL(String urlString, File destination) throws Exception {
if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
String username = System.getenv("MVNW_USERNAME");
char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
Authenticator.setDefault(new Authenticator() {
@Override
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(username, password);
}
});
}
URL website = new URL(urlString);
ReadableByteChannel rbc;
rbc = Channels.newChannel(website.openStream());
FileOutputStream fos = new FileOutputStream(destination);
fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
fos.close();
rbc.close();
}
}

Binary file not shown.

View File

@ -0,0 +1,2 @@
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar

310
HSLink-back/mvnw vendored Normal file
View File

@ -0,0 +1,310 @@
#!/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
#
# https://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.
# ----------------------------------------------------------------------------
# ----------------------------------------------------------------------------
# Maven Start Up Batch script
#
# Required ENV vars:
# ------------------
# JAVA_HOME - location of a JDK home dir
#
# Optional ENV vars
# -----------------
# M2_HOME - location of maven2's installed home dir
# MAVEN_OPTS - parameters passed to the Java VM when running Maven
# e.g. to debug Maven itself, use
# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
# MAVEN_SKIP_RC - flag to disable loading of mavenrc files
# ----------------------------------------------------------------------------
if [ -z "$MAVEN_SKIP_RC" ] ; then
if [ -f /etc/mavenrc ] ; then
. /etc/mavenrc
fi
if [ -f "$HOME/.mavenrc" ] ; then
. "$HOME/.mavenrc"
fi
fi
# OS specific support. $var _must_ be set to either true or false.
cygwin=false;
darwin=false;
mingw=false
case "`uname`" in
CYGWIN*) cygwin=true ;;
MINGW*) mingw=true;;
Darwin*) darwin=true
# Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
# See https://developer.apple.com/library/mac/qa/qa1170/_index.html
if [ -z "$JAVA_HOME" ]; then
if [ -x "/usr/libexec/java_home" ]; then
export JAVA_HOME="`/usr/libexec/java_home`"
else
export JAVA_HOME="/Library/Java/Home"
fi
fi
;;
esac
if [ -z "$JAVA_HOME" ] ; then
if [ -r /etc/gentoo-release ] ; then
JAVA_HOME=`java-config --jre-home`
fi
fi
if [ -z "$M2_HOME" ] ; then
## resolve links - $0 may be a link to maven's home
PRG="$0"
# need this for relative symlinks
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG="`dirname "$PRG"`/$link"
fi
done
saveddir=`pwd`
M2_HOME=`dirname "$PRG"`/..
# make it fully qualified
M2_HOME=`cd "$M2_HOME" && pwd`
cd "$saveddir"
# echo Using m2 at $M2_HOME
fi
# For Cygwin, ensure paths are in UNIX format before anything is touched
if $cygwin ; then
[ -n "$M2_HOME" ] &&
M2_HOME=`cygpath --unix "$M2_HOME"`
[ -n "$JAVA_HOME" ] &&
JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
[ -n "$CLASSPATH" ] &&
CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
fi
# For Mingw, ensure paths are in UNIX format before anything is touched
if $mingw ; then
[ -n "$M2_HOME" ] &&
M2_HOME="`(cd "$M2_HOME"; pwd)`"
[ -n "$JAVA_HOME" ] &&
JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
fi
if [ -z "$JAVA_HOME" ]; then
javaExecutable="`which javac`"
if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
# readlink(1) is not available as standard on Solaris 10.
readLink=`which readlink`
if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
if $darwin ; then
javaHome="`dirname \"$javaExecutable\"`"
javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
else
javaExecutable="`readlink -f \"$javaExecutable\"`"
fi
javaHome="`dirname \"$javaExecutable\"`"
javaHome=`expr "$javaHome" : '\(.*\)/bin'`
JAVA_HOME="$javaHome"
export JAVA_HOME
fi
fi
fi
if [ -z "$JAVACMD" ] ; then
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"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
else
JAVACMD="`which java`"
fi
fi
if [ ! -x "$JAVACMD" ] ; then
echo "Error: JAVA_HOME is not defined correctly." >&2
echo " We cannot execute $JAVACMD" >&2
exit 1
fi
if [ -z "$JAVA_HOME" ] ; then
echo "Warning: JAVA_HOME environment variable is not set."
fi
CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
# traverses directory structure from process work directory to filesystem root
# first directory with .mvn subdirectory is considered project base directory
find_maven_basedir() {
if [ -z "$1" ]
then
echo "Path not specified to find_maven_basedir"
return 1
fi
basedir="$1"
wdir="$1"
while [ "$wdir" != '/' ] ; do
if [ -d "$wdir"/.mvn ] ; then
basedir=$wdir
break
fi
# workaround for JBEAP-8937 (on Solaris 10/Sparc)
if [ -d "${wdir}" ]; then
wdir=`cd "$wdir/.."; pwd`
fi
# end of workaround
done
echo "${basedir}"
}
# concatenates all lines of a file
concat_lines() {
if [ -f "$1" ]; then
echo "$(tr -s '\n' ' ' < "$1")"
fi
}
BASE_DIR=`find_maven_basedir "$(pwd)"`
if [ -z "$BASE_DIR" ]; then
exit 1;
fi
##########################################################################################
# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
# This allows using the maven wrapper in projects that prohibit checking in binary data.
##########################################################################################
if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then
if [ "$MVNW_VERBOSE" = true ]; then
echo "Found .mvn/wrapper/maven-wrapper.jar"
fi
else
if [ "$MVNW_VERBOSE" = true ]; then
echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
fi
if [ -n "$MVNW_REPOURL" ]; then
jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
else
jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
fi
while IFS="=" read key value; do
case "$key" in (wrapperUrl) jarUrl="$value"; break ;;
esac
done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties"
if [ "$MVNW_VERBOSE" = true ]; then
echo "Downloading from: $jarUrl"
fi
wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar"
if $cygwin; then
wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"`
fi
if command -v wget > /dev/null; then
if [ "$MVNW_VERBOSE" = true ]; then
echo "Found wget ... using wget"
fi
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
wget "$jarUrl" -O "$wrapperJarPath"
else
wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath"
fi
elif command -v curl > /dev/null; then
if [ "$MVNW_VERBOSE" = true ]; then
echo "Found curl ... using curl"
fi
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
curl -o "$wrapperJarPath" "$jarUrl" -f
else
curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f
fi
else
if [ "$MVNW_VERBOSE" = true ]; then
echo "Falling back to using Java to download"
fi
javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java"
# For Cygwin, switch paths to Windows format before running javac
if $cygwin; then
javaClass=`cygpath --path --windows "$javaClass"`
fi
if [ -e "$javaClass" ]; then
if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
if [ "$MVNW_VERBOSE" = true ]; then
echo " - Compiling MavenWrapperDownloader.java ..."
fi
# Compiling the Java class
("$JAVA_HOME/bin/javac" "$javaClass")
fi
if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
# Running the downloader
if [ "$MVNW_VERBOSE" = true ]; then
echo " - Running MavenWrapperDownloader.java ..."
fi
("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR")
fi
fi
fi
fi
##########################################################################################
# End of extension
##########################################################################################
export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
if [ "$MVNW_VERBOSE" = true ]; then
echo $MAVEN_PROJECTBASEDIR
fi
MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
# For Cygwin, switch paths to Windows format before running java
if $cygwin; then
[ -n "$M2_HOME" ] &&
M2_HOME=`cygpath --path --windows "$M2_HOME"`
[ -n "$JAVA_HOME" ] &&
JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
[ -n "$CLASSPATH" ] &&
CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
[ -n "$MAVEN_PROJECTBASEDIR" ] &&
MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
fi
# Provide a "standardized" way to retrieve the CLI args that will
# work with both Windows and non-Windows executions.
MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@"
export MAVEN_CMD_LINE_ARGS
WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
exec "$JAVACMD" \
$MAVEN_OPTS \
-classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
"-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"

182
HSLink-back/mvnw.cmd vendored Normal file
View File

@ -0,0 +1,182 @@
@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 https://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 Maven Start Up Batch script
@REM
@REM Required ENV vars:
@REM JAVA_HOME - location of a JDK home dir
@REM
@REM Optional ENV vars
@REM M2_HOME - location of maven2's installed home dir
@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending
@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
@REM e.g. to debug Maven itself, use
@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
@REM ----------------------------------------------------------------------------
@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
@echo off
@REM set title of command window
title %0
@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on'
@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
@REM set %HOME% to equivalent of $HOME
if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
@REM Execute a user defined script before this one
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
@REM check for pre script, once with legacy .bat ending and once with .cmd ending
if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
:skipRcPre
@setlocal
set ERROR_CODE=0
@REM To isolate internal variables from possible post scripts, we use another setlocal
@setlocal
@REM ==== START VALIDATION ====
if not "%JAVA_HOME%" == "" goto OkJHome
echo.
echo Error: JAVA_HOME not found in your environment. >&2
echo Please set the JAVA_HOME variable in your environment to match the >&2
echo location of your Java installation. >&2
echo.
goto error
:OkJHome
if exist "%JAVA_HOME%\bin\java.exe" goto init
echo.
echo Error: JAVA_HOME is set to an invalid directory. >&2
echo JAVA_HOME = "%JAVA_HOME%" >&2
echo Please set the JAVA_HOME variable in your environment to match the >&2
echo location of your Java installation. >&2
echo.
goto error
@REM ==== END VALIDATION ====
:init
@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
@REM Fallback to current working directory if not found.
set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
set EXEC_DIR=%CD%
set WDIR=%EXEC_DIR%
:findBaseDir
IF EXIST "%WDIR%"\.mvn goto baseDirFound
cd ..
IF "%WDIR%"=="%CD%" goto baseDirNotFound
set WDIR=%CD%
goto findBaseDir
:baseDirFound
set MAVEN_PROJECTBASEDIR=%WDIR%
cd "%EXEC_DIR%"
goto endDetectBaseDir
:baseDirNotFound
set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
cd "%EXEC_DIR%"
:endDetectBaseDir
IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
@setlocal EnableExtensions EnableDelayedExpansion
for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
:endReadAdditionalConfig
SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B
)
@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
@REM This allows using the maven wrapper in projects that prohibit checking in binary data.
if exist %WRAPPER_JAR% (
if "%MVNW_VERBOSE%" == "true" (
echo Found %WRAPPER_JAR%
)
) else (
if not "%MVNW_REPOURL%" == "" (
SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
)
if "%MVNW_VERBOSE%" == "true" (
echo Couldn't find %WRAPPER_JAR%, downloading it ...
echo Downloading from: %DOWNLOAD_URL%
)
powershell -Command "&{"^
"$webclient = new-object System.Net.WebClient;"^
"if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^
"$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^
"}"^
"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^
"}"
if "%MVNW_VERBOSE%" == "true" (
echo Finished downloading %WRAPPER_JAR%
)
)
@REM End of extension
@REM Provide a "standardized" way to retrieve the CLI args that will
@REM work with both Windows and non-Windows executions.
set MAVEN_CMD_LINE_ARGS=%*
%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
if ERRORLEVEL 1 goto error
goto end
:error
set ERROR_CODE=1
:end
@endlocal & set ERROR_CODE=%ERROR_CODE%
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
@REM check for post script, once with legacy .bat ending and once with .cmd ending
if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
:skipRcPost
@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
if "%MAVEN_BATCH_PAUSE%" == "on" pause
if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
exit /B %ERROR_CODE%

View File

@ -71,18 +71,10 @@
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.yml</include>
<include>**/*.properties</include>
<include>**/*.xml</include>
</includes>
<filtering>false</filtering>
</resource>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*.yml</include>
<include>**/*.xml</include>
</includes>
<filtering>false</filtering>
<filtering>true</filtering>
</resource>
</resources>
</build>

View File

@ -1,25 +1,25 @@
package com.qinxx.hslink.controller;
import com.qinxx.hslink.model.HsWinners;
import com.qinxx.hslink.model.base.AjaxResult;
import com.qinxx.hslink.service.AdminHSService;
import com.qinxx.hslink.service.IHsWinnersService;
import com.qinxx.hslink.service.HSService;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author PHY
*/
@RestController
@Controller
@RequestMapping("/admin")
public class AdminHSController extends BaseController {
public class AdminHSController {
/**
* 日志
@ -27,10 +27,7 @@ public class AdminHSController extends BaseController {
private static Logger logger = LogManager.getLogger(HSController.class);
@Resource
AdminHSService adminhsService;
@Resource
private IHsWinnersService hsWinnersService;
AdminHSService AdminhsService;
/**
* 获取待审核文章列表
@ -38,9 +35,10 @@ public class AdminHSController extends BaseController {
* @return
*/
@PostMapping("/getVerifyList")
@ResponseBody
public Map<String, Object> getVerifyList(@RequestBody Map<String,Object> param){
Map<String, Object> result = new HashMap<>();
result = adminhsService.getVerifyList(param);
result = AdminhsService.getVerifyList(param);
return result;
}
@ -50,9 +48,10 @@ public class AdminHSController extends BaseController {
* @return
*/
@PostMapping("/verifyArticle")
@ResponseBody
public Map<String, Object> verifyArticle(@RequestBody Map<String,Object> param){
Map<String, Object> result = new HashMap<>();
result = adminhsService.verifyArticle(param);
result = AdminhsService.verifyArticle(param);
return result;
}
@ -62,30 +61,10 @@ public class AdminHSController extends BaseController {
* @return
*/
@PostMapping("/getPersonnelManagement")
@ResponseBody
public Map<String, Object> getPersonnelManagement(@RequestBody Map<String,Object> param){
Map<String, Object> result = new HashMap<>();
result = adminhsService.getPersonnelManagement(param);
return result;
}
/**
* 删除人员信息
*/
@DeleteMapping("/person/{ids}")
public AjaxResult removePerson(@PathVariable String[] ids)
{
return toAjax(adminhsService.deletePersonByIds(ids));
}
/**
* 获取人员详情
* @param param
* @return
*/
@PostMapping("/getPersonInfo")
public Map<String, Object> getPersonInfo(@RequestBody Map<String,Object> param){
Map<String, Object> result = new HashMap<>();
result = adminhsService.getPersonInfo(param);
result = AdminhsService.getPersonnelManagement(param);
return result;
}
@ -95,9 +74,10 @@ public class AdminHSController extends BaseController {
* @return
*/
@PostMapping("/peopleManagement")
@ResponseBody
public Map<String, Object> peopleManagement(@RequestBody Map<String,Object> param){
Map<String, Object> result = new HashMap<>();
result = adminhsService.peopleManagement(param);
result = AdminhsService.peopleManagement(param);
return result;
}
@ -107,9 +87,10 @@ public class AdminHSController extends BaseController {
* @return
*/
@PostMapping("/getHelpAnswerList")
@ResponseBody
public Map<String, Object> getHelpAnswerList(@RequestBody Map<String,Object> param){
Map<String, Object> result = new HashMap<>();
result = adminhsService.getHelpAnswerList(param);
result = AdminhsService.getHelpAnswerList(param);
return result;
}
@ -119,9 +100,10 @@ public class AdminHSController extends BaseController {
* @return
*/
@PostMapping("/answerHelp")
@ResponseBody
public Map<String, Object> answerHelp(@RequestBody Map<String,Object> param){
Map<String, Object> result = new HashMap<>();
result = adminhsService.answerHelp(param);
result = AdminhsService.answerHelp(param);
return result;
}
@ -131,9 +113,10 @@ public class AdminHSController extends BaseController {
* @return
*/
@PostMapping("/getRegisterManagementData")
@ResponseBody
public Map<String, Object> getRegisterManagementData(@RequestBody Map<String,Object> param){
Map<String, Object> result = new HashMap<>();
result = adminhsService.getRegisterManagementData(param);
result = AdminhsService.getRegisterManagementData(param);
return result;
}
@ -143,9 +126,10 @@ public class AdminHSController extends BaseController {
* @return
*/
@PostMapping("/passRegister")
@ResponseBody
public Map<String, Object> passRegister(@RequestBody Map<String,Object> param){
Map<String, Object> result = new HashMap<>();
result = adminhsService.passRegister(param);
result = AdminhsService.passRegister(param);
return result;
}
@ -155,91 +139,11 @@ public class AdminHSController extends BaseController {
* @return
*/
@PostMapping("/getMyPageNumber")
@ResponseBody
public Map<String, Object> getMyPageNumber(@RequestBody Map<String,Object> param){
Map<String, Object> result = new HashMap<>();
result = adminhsService.getMyPageNumber(param);
result = AdminhsService.getMyPageNumber(param);
return result;
}
/**
* 上传轮播图
* @param param
* @return
*/
@PostMapping("/uploadRotationPhoto")
public Map<String, Object> uploadRotationPhoto(@RequestBody Map<String,Object> param){
Map<String, Object> result = new HashMap<>();
result = adminhsService.uploadRotationPhoto(param);
return result;
}
/**
* 删除轮播图
* @param param
* @return
*/
@PostMapping("/deleteRotationPhoto")
public Map<String, Object> deleteRotationPhoto(@RequestBody Map<String,Object> param){
Map<String, Object> result = new HashMap<>();
result = adminhsService.deleteRotationPhoto(param);
return result;
}
/**
* 查询获奖列表
*/
@GetMapping("/winners/list")
public AjaxResult listWinners(HsWinners hsWinners)
{
List<HsWinners> list = hsWinnersService.selectHsWinnersList(hsWinners);
return AjaxResult.success(list);
}
/**
* 新增获奖
*/
@PostMapping("/winners")
public AjaxResult addWinners(@RequestBody HsWinners hsWinners)
{
return toAjax(hsWinnersService.insertHsWinners(hsWinners));
}
/**
* 修改获奖
*/
@PutMapping("/winners")
public AjaxResult editWinners(@RequestBody HsWinners hsWinners)
{
return toAjax(hsWinnersService.updateHsWinners(hsWinners));
}
/**
* 删除获奖
*/
@DeleteMapping("/winners/{ids}")
public AjaxResult removeWinners(@PathVariable Long[] ids)
{
return toAjax(hsWinnersService.deleteHsWinnersByIds(ids));
}
/**
* 查询班级列表
*/
@PostMapping("/class/list")
public AjaxResult listClass(@RequestBody Map<String, Object> params)
{
List<Map<String, Object>> list = adminhsService.selectClassList(params);
return AjaxResult.success(list);
}
/**
* 查询职务列表
*/
@PostMapping("/post/list")
public AjaxResult listPost(@RequestBody Map<String, Object> params)
{
List<Map<String, Object>> list = adminhsService.selectPostList(params);
return AjaxResult.success(list);
}
}

View File

@ -1,28 +0,0 @@
package com.qinxx.hslink.controller;
import com.qinxx.hslink.model.base.AjaxResult;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* web层通用数据处理
*
* @author ruoyi
*/
public class BaseController
{
protected final Logger logger = LoggerFactory.getLogger(BaseController.class);
/**
* 响应返回结果
*
* @param rows 影响行数
* @return 操作结果
*/
protected AjaxResult toAjax(int rows)
{
return rows > 0 ? AjaxResult.success() : AjaxResult.error();
}
}

View File

@ -1,16 +1,22 @@
package com.qinxx.hslink.controller;
import com.qinxx.hslink.service.HSService;
import org.apache.ibatis.annotations.Param;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.Part;
import java.io.*;
import java.net.URLEncoder;
import java.util.HashMap;
import java.util.Map;
@ -28,9 +34,6 @@ public class HSController {
@Resource
HSService hsService;
/**文件路径*/
@Value("${filePath}")
private String filesPath;
/**登录验证*/
@RequestMapping(value = "/login", method = {RequestMethod.POST, RequestMethod.GET})
@ -474,41 +477,4 @@ public class HSController {
return result;
}
/**
* 以流的形式写照片
*
* @param response
* @throws FileNotFoundException
* @throws IOException
*/
@RequestMapping("/showImg/{fileName}")
private void showImg(HttpServletResponse response, @PathVariable(value = "fileName") String fileName) throws IOException {
String filePath = filesPath + fileName;
File imageFile = new File(filePath);
if (imageFile.exists()) {
FileInputStream fis = null;
OutputStream os = null;
try {
fis = new FileInputStream(imageFile);
os = response.getOutputStream();
int count = 0;
byte[] buffer = new byte[1024 * 8];
while ((count = fis.read(buffer)) != -1) {
os.write(buffer, 0, count);
os.flush();
}
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
fis.close();
os.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
}

View File

@ -80,46 +80,4 @@ public interface AdminHSMapper {
* @return
*/
List<Map<String, Object>> getRegisterManagementData(Map<String, Object> param);
/**
* 上传轮播图
* @param param
* @return
*/
int uploadRotationPhoto(Map<String, Object> param);
/**
* 删除轮播图
* @param param
* @return
*/
int deleteRotationPhoto(Map<String, Object> param);
/**
* 获取人员详情
* @param param
* @return
*/
Map<String, Object> getPersonInfo(Map<String, Object> param);
/***
* 删除人员
* @param ids
* @return
*/
int deletePersonByIds(String[] ids);
/**
* 获取班级列表
* @param params
* @return
*/
List<Map<String, Object>> selectClassList(Map<String, Object> params);
/**
* 获取职务列表
* @param params
* @return
*/
List<Map<String, Object>> selectPostList(Map<String, Object> params);
}

View File

@ -1,55 +0,0 @@
package com.qinxx.hslink.dao;
import com.qinxx.hslink.model.HsWinners;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* @author by PHY
* @Classname HsWinnersMapper
* @date 2021-06-02 11:42
*/
@Mapper
public interface HsWinnersMapper {
/**
* 查询获奖列表
*
* @param hsWinners 获奖
* @return 获奖集合
*/
public List<HsWinners> selectHsWinnersList(HsWinners hsWinners);
/**
* 新增获奖
*
* @param hsWinners 获奖
* @return 结果
*/
public int insertHsWinners(HsWinners hsWinners);
/**
* 修改获奖
*
* @param hsWinners 获奖
* @return 结果
*/
public int updateHsWinners(HsWinners hsWinners);
/**
* 删除获奖
*
* @param id 获奖ID
* @return 结果
*/
public int deleteHsWinnersById(Long id);
/**
* 批量删除获奖
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteHsWinnersByIds(Long[] ids);
}

View File

@ -9,13 +9,6 @@
( uuid(), (SELECT release_id FROM hs_notice WHERE id = #{articleId}), #{articleId}, #{operating}, now( ) )
</insert>
<!--上传轮播图-->
<insert id="uploadRotationPhoto" parameterType="map">
INSERT INTO hs_file_type ( id, file_id, type_code, type_name, create_time )
VALUES
( uuid( ), #{fileId}, 'rotationChart', '轮播图', now( ) )
</insert>
<!--审核文章(通过/驳回)-->
<update id="verifyArticle" parameterType="map">
UPDATE hs_notice set is_pass = #{operating} where id = #{articleId}
@ -41,11 +34,6 @@
update hs_user set take_effect = #{takeEffect} where user_id = #{userId}
</update>
<!--删除轮播图-->
<delete id="deleteRotationPhoto" parameterType="map">
DELETE from hs_file_type where id = #{id}
</delete>
<!--获取待审核文章数据-->
<select id="getVerifyList" parameterType="map" resultType="map">
SELECT
@ -64,10 +52,8 @@
<if test="content != '' and content != null">
and title like CONCAT('%',#{content},'%')
</if>
<if test="author != '' and author != null">
and u.real_name like CONCAT('%',#{author},'%')
</if>
AND is_pass = '0'
and type != "班级通知"
ORDER BY release_time desc
</select>
@ -78,25 +64,10 @@
(SELECT count(*) from hs_follow f where f.follow_id = u.user_id) fansNumber
FROM hs_user u where
u.user_type != "管理员"
<if test="name != '' and name != null">
<if test="content != '' and content != null">
and u.real_name like CONCAT('%',#{name},'%')
</if>
<if test="userType != '' and userType != null">
and u.user_type = #{userType}
</if>
<if test="className != '' and className != null">
and u.class_name = #{className}
</if>
<if test="className == ''">
and (u.class_name = '' or u.class_name is null)
</if>
<if test="takeEffect != '' and takeEffect != null">
and u.take_effect = #{takeEffect}
</if>
<if test="takeEffect == '' or takeEffect == null">
and u.take_effect = '1'
</if>
order by u.frozen_state
and u.take_effect = "1" order by u.frozen_state
</select>
<!--获取帮助答复列表-->
@ -124,27 +95,4 @@
select * from hs_user where take_effect = '0'
</select>
<!--获取人员详情-->
<select id="getPersonInfo" resultType="map" parameterType="map">
select * from hs_user where user_id = #{userId}
</select>
<!--获取班级列表-->
<select id="selectClassList" resultType="map" parameterType="map">
select DISTINCT class_name from hs_user
</select>
<!--获取职务列表-->
<select id="selectPostList" resultType="map" parameterType="map">
select DISTINCT post from hs_user where class_name = #{className}
</select>
<!--删除人员信息-->
<delete id="deletePersonByIds" parameterType="String">
delete from hs_user where user_id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
</mapper>

View File

@ -10,11 +10,7 @@
<!--注册-->
<insert id="register" parameterType="map">
INSERT INTO hs_user ( user_id, pass_word,real_name, mobile, user_type,
<if test="takeEffect != '' and takeEffect != null">
take_effect,
</if>
create_time)
INSERT INTO hs_user ( user_id, pass_word,real_name, mobile, user_type, create_time)
VALUES
(
uuid(),
@ -22,9 +18,6 @@
#{realname},
#{mobile},
#{type},
<if test="takeEffect != '' and takeEffect != null">
#{takeEffect},
</if>
now()
)
</insert>
@ -113,8 +106,6 @@
read_number,
case when (select count(*) from hs_collection where user_id = #{userId} and article_id = #{id}) > 0
then 1 else 0 end isCollection,
case when (select count(*) from hs_follow where user_id = '201610060129' and follow_id = author_id) > 0
then 1 else 0 end isFollow,
is_pass
from hs_notice n left join hs_user u on n.release_id = u.user_id
where id = #{id}
@ -193,11 +184,9 @@
<!--新增一条班级通知-->
<insert id="addClassNotice" parameterType="map">
insert into hs_notice (id,class_id,class_name,label,
title,content,release_id,release_time,is_pass,type)
insert into hs_notice (id,class_id,class_name,label,title,content,release_id,release_time,type)
values
(uuid(),#{classId},#{className},#{label},#{title},
#{content},#{releaseId},#{release_time},'1',"班级通知")
(uuid(),#{classId},#{className},#{label},#{title},#{content},#{releaseId},#{release_time},"班级通知")
</insert>
<!--获取班级公告-->
@ -342,31 +331,10 @@
<!--编辑个人信息-->
<update id="updatePersonalInfo" parameterType="map">
update hs_user set
<if test="sex != '' and sex != null">
sex = #{sex},
</if>
<if test="studentNumber != '' and studentNumber != null">
student_number = #{studentNumber},
</if>
<if test="birthday != '' and birthday != null">
birthday = #{birthday},
</if>
<if test="address != '' and address != null">
address = #{address},
</if>
<if test="signature != '' and signature != null">
signature = #{signature},
</if>
<if test="post != '' and post != null">
post = #{post},
</if>
<if test="className != null">
class_name = #{className},
</if>
<if test="takeEffect != '' and takeEffect != null">
take_effect = #{takeEffect},
</if>
error_times=0
sex = #{sex},
birthday = #{birthday},
address = #{address},
signature = #{signature}
where user_id = #{userId}
</update>
@ -599,9 +567,6 @@
left join hs_collection c on p.id = c.article_id
WHERE
c.user_id = #{userId}
<if test="text != null and text != ''">
and (title like CONCAT('%',#{text},'%') or content like CONCAT('%',#{text}, '%'))
</if>
AND STATUS = "1" and is_pass ="1"
ORDER BY
release_time DESC
@ -639,4 +604,4 @@
and is_read = '0'
</select>
</mapper>
</mapper>

View File

@ -1,89 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.qinxx.hslink.dao.HsWinnersMapper">
<resultMap type="com.qinxx.hslink.model.HsWinners" id="HsWinnersResult">
<result property="id" column="id" />
<result property="userId" column="user_id" />
<result property="userName" column="user_name" />
<result property="type" column="type" />
<result property="post" column="post" />
<result property="version" column="version" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectHsWinnersVo">
select id, user_id, user_name, type, post, version, create_by, create_time, update_by, update_time, remark from hs_winners
</sql>
<select id="selectHsWinnersList" parameterType="com.qinxx.hslink.model.HsWinners" resultMap="HsWinnersResult">
<include refid="selectHsWinnersVo"/>
<where>
<if test="userId != null and userId != ''"> and user_id = #{userId}</if>
<if test="userName != null and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
<if test="type != null and type != ''"> and type = #{type}</if>
<if test="post != null and post != ''"> and post = #{post}</if>
<if test="version != null and version != ''"> and version = #{version}</if>
</where>
</select>
<insert id="insertHsWinners" parameterType="com.qinxx.hslink.model.HsWinners" useGeneratedKeys="true" keyProperty="id">
insert into hs_winners
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="userId != null">user_id,</if>
<if test="userName != null">user_name,</if>
<if test="type != null">type,</if>
<if test="post != null">post,</if>
<if test="version != null">version,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="userId != null">#{userId},</if>
<if test="userName != null">#{userName},</if>
<if test="type != null">#{type},</if>
<if test="post != null">#{post},</if>
<if test="version != null">#{version},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateHsWinners" parameterType="com.qinxx.hslink.model.HsWinners">
update hs_winners
<trim prefix="SET" suffixOverrides=",">
<if test="userId != null">user_id = #{userId},</if>
<if test="userName != null">user_name = #{userName},</if>
<if test="type != null">type = #{type},</if>
<if test="post != null">post = #{post},</if>
<if test="version != null">version = #{version},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteHsWinnersById" parameterType="Long">
delete from hs_winners where id = #{id}
</delete>
<delete id="deleteHsWinnersByIds" parameterType="String">
delete from hs_winners where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -1,99 +0,0 @@
package com.qinxx.hslink.model;
import com.qinxx.hslink.model.base.BaseEntity;
/**
* @author by PHY
* @Classname HsWinners
* @date 2021-06-02 11:31
*/
public class HsWinners extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** $column.columnComment */
private Long id;
/** 人员id
*/
private String userId;
/** 人员姓名 */
private String userName;
/** 获奖类型 */
private String type;
/** 获奖人职务 */
private String post;
/** 版本号 */
private String version;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setUserId(String userId)
{
this.userId = userId;
}
public String getUserId()
{
return userId;
}
public void setUserName(String userName)
{
this.userName = userName;
}
public String getUserName()
{
return userName;
}
public void setType(String type)
{
this.type = type;
}
public String getType()
{
return type;
}
public void setPost(String post)
{
this.post = post;
}
public String getPost()
{
return post;
}
public void setVersion(String version)
{
this.version = version;
}
public String getVersion()
{
return version;
}
@Override
public String toString() {
return "HsWinners{" +
"id=" + id +
", userId='" + userId + '\'' +
", userName='" + userName + '\'' +
", type='" + type + '\'' +
", post='" + post + '\'' +
", version='" + version + '\'' +
'}';
}
}

View File

@ -1,149 +0,0 @@
package com.qinxx.hslink.model.base;
import com.qinxx.hslink.util.HttpStatus;
import com.qinxx.hslink.util.StringUtils;
import java.util.HashMap;
/**
* 操作消息提醒
*
* @author ruoyi
*/
public class AjaxResult extends HashMap<String, Object>
{
private static final long serialVersionUID = 1L;
/** 状态码 */
public static final String CODE_TAG = "code";
/** 返回内容 */
public static final String MSG_TAG = "msg";
/** 数据对象 */
public static final String DATA_TAG = "data";
/**
* 初始化一个新创建的 AjaxResult 对象使其表示一个空消息
*/
public AjaxResult()
{
}
/**
* 初始化一个新创建的 AjaxResult 对象
*
* @param code 状态码
* @param msg 返回内容
*/
public AjaxResult(int code, String msg)
{
super.put(CODE_TAG, code);
super.put(MSG_TAG, msg);
}
/**
* 初始化一个新创建的 AjaxResult 对象
*
* @param code 状态码
* @param msg 返回内容
* @param data 数据对象
*/
public AjaxResult(int code, String msg, Object data)
{
super.put(CODE_TAG, code);
super.put(MSG_TAG, msg);
if (StringUtils.isNotNull(data))
{
super.put(DATA_TAG, data);
}
}
/**
* 返回成功消息
*
* @return 成功消息
*/
public static AjaxResult success()
{
return AjaxResult.success("操作成功");
}
/**
* 返回成功数据
*
* @return 成功消息
*/
public static AjaxResult success(Object data)
{
return AjaxResult.success("操作成功", data);
}
/**
* 返回成功消息
*
* @param msg 返回内容
* @return 成功消息
*/
public static AjaxResult success(String msg)
{
return AjaxResult.success(msg, null);
}
/**
* 返回成功消息
*
* @param msg 返回内容
* @param data 数据对象
* @return 成功消息
*/
public static AjaxResult success(String msg, Object data)
{
return new AjaxResult(HttpStatus.SUCCESS, msg, data);
}
/**
* 返回错误消息
*
* @return
*/
public static AjaxResult error()
{
return AjaxResult.error("操作失败");
}
/**
* 返回错误消息
*
* @param msg 返回内容
* @return 警告消息
*/
public static AjaxResult error(String msg)
{
return AjaxResult.error(msg, null);
}
/**
* 返回错误消息
*
* @param msg 返回内容
* @param data 数据对象
* @return 警告消息
*/
public static AjaxResult error(String msg, Object data)
{
return new AjaxResult(HttpStatus.ERROR, msg, data);
}
/**
* 返回错误消息
*
* @param code 状态码
* @param msg 返回内容
* @return 警告消息
*/
public static AjaxResult error(int code, String msg)
{
return new AjaxResult(code, msg, null);
}
}

View File

@ -1,115 +0,0 @@
package com.qinxx.hslink.model.base;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
/**
* Entity基类
*
* @author ruoyi
*/
public class BaseEntity implements Serializable
{
private static final long serialVersionUID = 1L;
/** 搜索值 */
private String searchValue;
/** 创建者 */
private String createBy;
/** 创建时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
/** 更新者 */
private String updateBy;
/** 更新时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateTime;
/** 备注 */
private String remark;
/** 请求参数 */
private Map<String, Object> params;
public String getSearchValue()
{
return searchValue;
}
public void setSearchValue(String searchValue)
{
this.searchValue = searchValue;
}
public String getCreateBy()
{
return createBy;
}
public void setCreateBy(String createBy)
{
this.createBy = createBy;
}
public Date getCreateTime()
{
return createTime;
}
public void setCreateTime(Date createTime)
{
this.createTime = createTime;
}
public String getUpdateBy()
{
return updateBy;
}
public void setUpdateBy(String updateBy)
{
this.updateBy = updateBy;
}
public Date getUpdateTime()
{
return updateTime;
}
public void setUpdateTime(Date updateTime)
{
this.updateTime = updateTime;
}
public String getRemark()
{
return remark;
}
public void setRemark(String remark)
{
this.remark = remark;
}
public Map<String, Object> getParams()
{
if (params == null)
{
params = new HashMap<>();
}
return params;
}
public void setParams(Map<String, Object> params)
{
this.params = params;
}
}

View File

@ -1,6 +1,5 @@
package com.qinxx.hslink.service;
import java.util.List;
import java.util.Map;
/**
@ -22,13 +21,6 @@ public interface AdminHSService {
*/
Map<String, Object> getPersonnelManagement(Map<String, Object> param);
/**
* 获取人员详情
* @param param
* @return
*/
Map<String, Object> getPersonInfo(Map<String, Object> param);
/**
* 审核文章通过/驳回
* @param param
@ -77,40 +69,4 @@ public interface AdminHSService {
* @return
*/
Map<String, Object> getRegisterManagementData(Map<String, Object> param);
/**
* 上传轮播图
* @param param
* @return
*/
Map<String, Object> uploadRotationPhoto(Map<String, Object> param);
/**
* 删除轮播图
* @param param
* @return
*/
Map<String, Object> deleteRotationPhoto(Map<String, Object> param);
/**
* 删除人员
* @param ids
* @return
*/
int deletePersonByIds(String[] ids);
/**
* 获取班级列表
* @param params
* @return
*/
List<Map<String, Object>> selectClassList(Map<String, Object> params);
/**
* 获取职务列表
* @param params
* @return
*/
List<Map<String, Object>> selectPostList(Map<String, Object> params);
}

View File

@ -1,53 +0,0 @@
package com.qinxx.hslink.service;
import com.qinxx.hslink.model.HsWinners;
import java.util.List;
/**
* @author by PHY
* @Classname HsWinnersService
* @date 2021-06-02 11:40
*/
public interface IHsWinnersService {
/**
* 查询获奖列表
*
* @param hsWinners 获奖
* @return 获奖集合
*/
public List<HsWinners> selectHsWinnersList(HsWinners hsWinners);
/**
* 新增获奖
*
* @param hsWinners 获奖
* @return 结果
*/
public int insertHsWinners(HsWinners hsWinners);
/**
* 修改获奖
*
* @param hsWinners 获奖
* @return 结果
*/
public int updateHsWinners(HsWinners hsWinners);
/**
* 批量删除获奖
*
* @param ids 需要删除的获奖ID
* @return 结果
*/
public int deleteHsWinnersByIds(Long[] ids);
/**
* 删除获奖信息
*
* @param id 获奖ID
* @return 结果
*/
public int deleteHsWinnersById(Long id);
}

View File

@ -1,14 +1,13 @@
package com.qinxx.hslink.service.impl;
import com.qinxx.hslink.dao.AdminHSMapper;
import com.qinxx.hslink.dao.HSLinkMapper;
import com.qinxx.hslink.service.AdminHSService;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.io.File;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -26,9 +25,6 @@ public class AdminHSServiceImpl implements AdminHSService {
@Resource
AdminHSMapper adminHSMapper;
/**文件路径*/
@Value("${filePath}")
private String filesPath;
/**
* 获取待审核文章数据
* @param param
@ -57,20 +53,6 @@ public class AdminHSServiceImpl implements AdminHSService {
return result;
}
/**
* 获取人员详情
* @param param
* @return
*/
@Override
public Map<String, Object> getPersonInfo(Map<String, Object> param) {
Map<String, Object> result = new HashMap<>();
Map<String, Object> res = adminHSMapper.getPersonInfo(param);
result.put("data",res);
result.put("success",true);
return result;
}
/**
* 审核文章通过/驳回
* @param param
@ -193,76 +175,4 @@ public class AdminHSServiceImpl implements AdminHSService {
result.put("success",true);
return result;
}
/**
* 上传轮播图
* @param param
* @return
*/
@Override
public Map<String, Object> uploadRotationPhoto(Map<String, Object> param) {
int res = 0;
Map<String, Object> result = new HashMap<>();
try {
res = adminHSMapper.uploadRotationPhoto(param);
} catch (Exception e) {
e.printStackTrace();
res = 0;
}
result.put("data",res);
result.put("success",true);
return result;
}
@Override
public Map<String, Object> deleteRotationPhoto(Map<String, Object> param) {
int res = 0;
File file = new File(filesPath + param.get("fileEncryption"));
// 路径为文件且不为空则进行删除
if (file.isFile() && file.exists()) {
file.delete();
}
Map<String, Object> result = new HashMap<>();
try {
res = adminHSMapper.deleteRotationPhoto(param);
} catch (Exception e) {
e.printStackTrace();
res = 0;
}
result.put("data",res);
result.put("success",true);
return result;
}
/**
* 删除人员信息
*
* @param ids ID
* @return 结果
*/
@Override
public int deletePersonByIds(String[] ids)
{
return adminHSMapper.deletePersonByIds(ids);
}
/**
* 获取班级列表
* @param params
* @return
*/
@Override
public List<Map<String, Object>> selectClassList(Map<String, Object> params) {
return adminHSMapper.selectClassList(params);
}
/**
* 获取职务列表
* @param params
* @return
*/
@Override
public List<Map<String, Object>> selectPostList(Map<String, Object> params) {
return adminHSMapper.selectPostList(params);
}
}

View File

@ -359,7 +359,7 @@ public class HSServiceImpl implements HSService {
if(httpServletRequest instanceof MultipartHttpServletRequest){
multipartHttpServletRequest = (MultipartHttpServletRequest) httpServletRequest;
}else{
return dealResultMap(false, "上传失败", new HashMap<>());
return dealResultMap(false, "上传失败");
}
//获取MultipartFile文件信息(注意参数为前端对应的参数名称)
MultipartFile mf = multipartHttpServletRequest.getFile("file");
@ -380,7 +380,7 @@ public class HSServiceImpl implements HSService {
mf.transferTo(file);
} catch (IOException e) {
e.printStackTrace();
return dealResultMap(false, "上传失败", new HashMap<>());
return dealResultMap(false, "上传失败");
}
//保存文件路径
Map<String,Object> param = new HashMap<>();
@ -389,7 +389,7 @@ public class HSServiceImpl implements HSService {
param.put("fileEncryption",id+fileName);
param.put("filePath",String.valueOf(file));
hsLinkMapper.insertFilePath(param);
return dealResultMap(true, "上传成功", param);
return dealResultMap(true, "上传成功");
}
@Override
@ -764,13 +764,10 @@ public class HSServiceImpl implements HSService {
* @param message
* @return
*/
private Map<String, Object> dealResultMap(boolean flag,
String message,
Map<String, Object> fileInfo) {
private Map<String, Object> dealResultMap(boolean flag, String message) {
HashMap<String, Object> map = new HashMap<>();
map.put("flag",flag);
map.put("message",message);
map.put("fileInfo", fileInfo);
return map;
}
}

View File

@ -1,85 +0,0 @@
package com.qinxx.hslink.service.impl;
import com.qinxx.hslink.dao.HsWinnersMapper;
import com.qinxx.hslink.model.HsWinners;
import com.qinxx.hslink.service.IHsWinnersService;
import com.qinxx.hslink.util.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/**
* @author by PHY
* @Classname HsWinnersServiceImpl
* @date 2021-06-02 11:40
*/
@Service
public class HsWinnersServiceImpl implements IHsWinnersService {
@Resource
private HsWinnersMapper hsWinnersMapper;
/**
* 查询获奖列表
*
* @param hsWinners 获奖
* @return 获奖
*/
@Override
public List<HsWinners> selectHsWinnersList(HsWinners hsWinners)
{
return hsWinnersMapper.selectHsWinnersList(hsWinners);
}
/**
* 新增获奖
*
* @param hsWinners 获奖
* @return 结果
*/
@Override
public int insertHsWinners(HsWinners hsWinners)
{
hsWinners.setCreateTime(DateUtils.getNowDate());
return hsWinnersMapper.insertHsWinners(hsWinners);
}
/**
* 修改获奖
*
* @param hsWinners 获奖
* @return 结果
*/
@Override
public int updateHsWinners(HsWinners hsWinners)
{
hsWinners.setUpdateTime(DateUtils.getNowDate());
return hsWinnersMapper.updateHsWinners(hsWinners);
}
/**
* 批量删除获奖
*
* @param ids 需要删除的获奖ID
* @return 结果
*/
@Override
public int deleteHsWinnersByIds(Long[] ids)
{
return hsWinnersMapper.deleteHsWinnersByIds(ids);
}
/**
* 删除获奖信息
*
* @param id 获奖ID
* @return 结果
*/
@Override
public int deleteHsWinnersById(Long id)
{
return hsWinnersMapper.deleteHsWinnersById(id);
}
}

View File

@ -1,95 +0,0 @@
package com.qinxx.hslink.util;
/**
* 基础异常
*
* @author ruoyi
*/
public class BaseException extends RuntimeException
{
private static final long serialVersionUID = 1L;
/**
* 所属模块
*/
private String module;
/**
* 错误码
*/
private String code;
/**
* 错误码对应的参数
*/
private Object[] args;
/**
* 错误消息
*/
private String defaultMessage;
public BaseException(String module, String code, Object[] args, String defaultMessage)
{
this.module = module;
this.code = code;
this.args = args;
this.defaultMessage = defaultMessage;
}
public BaseException(String module, String code, Object[] args)
{
this(module, code, args, null);
}
public BaseException(String module, String defaultMessage)
{
this(module, null, null, defaultMessage);
}
public BaseException(String code, Object[] args)
{
this(null, code, args, null);
}
public BaseException(String defaultMessage)
{
this(null, null, null, defaultMessage);
}
@Override
public String getMessage()
{
String message = null;
if (!StringUtils.isEmpty(code))
{
message = MessageUtils.message(code, args);
}
if (message == null)
{
message = defaultMessage;
}
return message;
}
public String getModule()
{
return module;
}
public String getCode()
{
return code;
}
public Object[] getArgs()
{
return args;
}
public String getDefaultMessage()
{
return defaultMessage;
}
}

View File

@ -1,986 +0,0 @@
package com.qinxx.hslink.util;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.nio.ByteBuffer;
import java.nio.charset.Charset;
import java.text.NumberFormat;
import java.util.Set;
/**
* 类型转换器
*
* @author ruoyi
*/
public class Convert
{
/**
* 转换为字符串<br>
* 如果给定的值为null或者转换失败返回默认值<br>
* 转换失败不会报错
*
* @param value 被转换的值
* @param defaultValue 转换错误时的默认值
* @return 结果
*/
public static String toStr(Object value, String defaultValue)
{
if (null == value)
{
return defaultValue;
}
if (value instanceof String)
{
return (String) value;
}
return value.toString();
}
/**
* 转换为字符串<br>
* 如果给定的值为<code>null</code>或者转换失败返回默认值<code>null</code><br>
* 转换失败不会报错
*
* @param value 被转换的值
* @return 结果
*/
public static String toStr(Object value)
{
return toStr(value, null);
}
/**
* 转换为字符<br>
* 如果给定的值为null或者转换失败返回默认值<br>
* 转换失败不会报错
*
* @param value 被转换的值
* @param defaultValue 转换错误时的默认值
* @return 结果
*/
public static Character toChar(Object value, Character defaultValue)
{
if (null == value)
{
return defaultValue;
}
if (value instanceof Character)
{
return (Character) value;
}
final String valueStr = toStr(value, null);
return StringUtils.isEmpty(valueStr) ? defaultValue : valueStr.charAt(0);
}
/**
* 转换为字符<br>
* 如果给定的值为<code>null</code>或者转换失败返回默认值<code>null</code><br>
* 转换失败不会报错
*
* @param value 被转换的值
* @return 结果
*/
public static Character toChar(Object value)
{
return toChar(value, null);
}
/**
* 转换为byte<br>
* 如果给定的值为<code>null</code>或者转换失败返回默认值<br>
* 转换失败不会报错
*
* @param value 被转换的值
* @param defaultValue 转换错误时的默认值
* @return 结果
*/
public static Byte toByte(Object value, Byte defaultValue)
{
if (value == null)
{
return defaultValue;
}
if (value instanceof Byte)
{
return (Byte) value;
}
if (value instanceof Number)
{
return ((Number) value).byteValue();
}
final String valueStr = toStr(value, null);
if (StringUtils.isEmpty(valueStr))
{
return defaultValue;
}
try
{
return Byte.parseByte(valueStr);
}
catch (Exception e)
{
return defaultValue;
}
}
/**
* 转换为byte<br>
* 如果给定的值为<code>null</code>或者转换失败返回默认值<code>null</code><br>
* 转换失败不会报错
*
* @param value 被转换的值
* @return 结果
*/
public static Byte toByte(Object value)
{
return toByte(value, null);
}
/**
* 转换为Short<br>
* 如果给定的值为<code>null</code>或者转换失败返回默认值<br>
* 转换失败不会报错
*
* @param value 被转换的值
* @param defaultValue 转换错误时的默认值
* @return 结果
*/
public static Short toShort(Object value, Short defaultValue)
{
if (value == null)
{
return defaultValue;
}
if (value instanceof Short)
{
return (Short) value;
}
if (value instanceof Number)
{
return ((Number) value).shortValue();
}
final String valueStr = toStr(value, null);
if (StringUtils.isEmpty(valueStr))
{
return defaultValue;
}
try
{
return Short.parseShort(valueStr.trim());
}
catch (Exception e)
{
return defaultValue;
}
}
/**
* 转换为Short<br>
* 如果给定的值为<code>null</code>或者转换失败返回默认值<code>null</code><br>
* 转换失败不会报错
*
* @param value 被转换的值
* @return 结果
*/
public static Short toShort(Object value)
{
return toShort(value, null);
}
/**
* 转换为Number<br>
* 如果给定的值为空或者转换失败返回默认值<br>
* 转换失败不会报错
*
* @param value 被转换的值
* @param defaultValue 转换错误时的默认值
* @return 结果
*/
public static Number toNumber(Object value, Number defaultValue)
{
if (value == null)
{
return defaultValue;
}
if (value instanceof Number)
{
return (Number) value;
}
final String valueStr = toStr(value, null);
if (StringUtils.isEmpty(valueStr))
{
return defaultValue;
}
try
{
return NumberFormat.getInstance().parse(valueStr);
}
catch (Exception e)
{
return defaultValue;
}
}
/**
* 转换为Number<br>
* 如果给定的值为空或者转换失败返回默认值<code>null</code><br>
* 转换失败不会报错
*
* @param value 被转换的值
* @return 结果
*/
public static Number toNumber(Object value)
{
return toNumber(value, null);
}
/**
* 转换为int<br>
* 如果给定的值为空或者转换失败返回默认值<br>
* 转换失败不会报错
*
* @param value 被转换的值
* @param defaultValue 转换错误时的默认值
* @return 结果
*/
public static Integer toInt(Object value, Integer defaultValue)
{
if (value == null)
{
return defaultValue;
}
if (value instanceof Integer)
{
return (Integer) value;
}
if (value instanceof Number)
{
return ((Number) value).intValue();
}
final String valueStr = toStr(value, null);
if (StringUtils.isEmpty(valueStr))
{
return defaultValue;
}
try
{
return Integer.parseInt(valueStr.trim());
}
catch (Exception e)
{
return defaultValue;
}
}
/**
* 转换为int<br>
* 如果给定的值为<code>null</code>或者转换失败返回默认值<code>null</code><br>
* 转换失败不会报错
*
* @param value 被转换的值
* @return 结果
*/
public static Integer toInt(Object value)
{
return toInt(value, null);
}
/**
* 转换为Integer数组<br>
*
* @param str 被转换的值
* @return 结果
*/
public static Integer[] toIntArray(String str)
{
return toIntArray(",", str);
}
/**
* 转换为Long数组<br>
*
* @param str 被转换的值
* @return 结果
*/
public static Long[] toLongArray(String str)
{
return toLongArray(",", str);
}
/**
* 转换为Integer数组<br>
*
* @param split 分隔符
* @param split 被转换的值
* @return 结果
*/
public static Integer[] toIntArray(String split, String str)
{
if (StringUtils.isEmpty(str))
{
return new Integer[] {};
}
String[] arr = str.split(split);
final Integer[] ints = new Integer[arr.length];
for (int i = 0; i < arr.length; i++)
{
final Integer v = toInt(arr[i], 0);
ints[i] = v;
}
return ints;
}
/**
* 转换为Long数组<br>
*
* @param split 分隔符
* @param str 被转换的值
* @return 结果
*/
public static Long[] toLongArray(String split, String str)
{
if (StringUtils.isEmpty(str))
{
return new Long[] {};
}
String[] arr = str.split(split);
final Long[] longs = new Long[arr.length];
for (int i = 0; i < arr.length; i++)
{
final Long v = toLong(arr[i], null);
longs[i] = v;
}
return longs;
}
/**
* 转换为String数组<br>
*
* @param str 被转换的值
* @return 结果
*/
public static String[] toStrArray(String str)
{
return toStrArray(",", str);
}
/**
* 转换为String数组<br>
*
* @param split 分隔符
* @param split 被转换的值
* @return 结果
*/
public static String[] toStrArray(String split, String str)
{
return str.split(split);
}
/**
* 转换为long<br>
* 如果给定的值为空或者转换失败返回默认值<br>
* 转换失败不会报错
*
* @param value 被转换的值
* @param defaultValue 转换错误时的默认值
* @return 结果
*/
public static Long toLong(Object value, Long defaultValue)
{
if (value == null)
{
return defaultValue;
}
if (value instanceof Long)
{
return (Long) value;
}
if (value instanceof Number)
{
return ((Number) value).longValue();
}
final String valueStr = toStr(value, null);
if (StringUtils.isEmpty(valueStr))
{
return defaultValue;
}
try
{
// 支持科学计数法
return new BigDecimal(valueStr.trim()).longValue();
}
catch (Exception e)
{
return defaultValue;
}
}
/**
* 转换为long<br>
* 如果给定的值为<code>null</code>或者转换失败返回默认值<code>null</code><br>
* 转换失败不会报错
*
* @param value 被转换的值
* @return 结果
*/
public static Long toLong(Object value)
{
return toLong(value, null);
}
/**
* 转换为double<br>
* 如果给定的值为空或者转换失败返回默认值<br>
* 转换失败不会报错
*
* @param value 被转换的值
* @param defaultValue 转换错误时的默认值
* @return 结果
*/
public static Double toDouble(Object value, Double defaultValue)
{
if (value == null)
{
return defaultValue;
}
if (value instanceof Double)
{
return (Double) value;
}
if (value instanceof Number)
{
return ((Number) value).doubleValue();
}
final String valueStr = toStr(value, null);
if (StringUtils.isEmpty(valueStr))
{
return defaultValue;
}
try
{
// 支持科学计数法
return new BigDecimal(valueStr.trim()).doubleValue();
}
catch (Exception e)
{
return defaultValue;
}
}
/**
* 转换为double<br>
* 如果给定的值为空或者转换失败返回默认值<code>null</code><br>
* 转换失败不会报错
*
* @param value 被转换的值
* @return 结果
*/
public static Double toDouble(Object value)
{
return toDouble(value, null);
}
/**
* 转换为Float<br>
* 如果给定的值为空或者转换失败返回默认值<br>
* 转换失败不会报错
*
* @param value 被转换的值
* @param defaultValue 转换错误时的默认值
* @return 结果
*/
public static Float toFloat(Object value, Float defaultValue)
{
if (value == null)
{
return defaultValue;
}
if (value instanceof Float)
{
return (Float) value;
}
if (value instanceof Number)
{
return ((Number) value).floatValue();
}
final String valueStr = toStr(value, null);
if (StringUtils.isEmpty(valueStr))
{
return defaultValue;
}
try
{
return Float.parseFloat(valueStr.trim());
}
catch (Exception e)
{
return defaultValue;
}
}
/**
* 转换为Float<br>
* 如果给定的值为空或者转换失败返回默认值<code>null</code><br>
* 转换失败不会报错
*
* @param value 被转换的值
* @return 结果
*/
public static Float toFloat(Object value)
{
return toFloat(value, null);
}
/**
* 转换为boolean<br>
* String支持的值为truefalseyesokno1,0 如果给定的值为空或者转换失败返回默认值<br>
* 转换失败不会报错
*
* @param value 被转换的值
* @param defaultValue 转换错误时的默认值
* @return 结果
*/
public static Boolean toBool(Object value, Boolean defaultValue)
{
if (value == null)
{
return defaultValue;
}
if (value instanceof Boolean)
{
return (Boolean) value;
}
String valueStr = toStr(value, null);
if (StringUtils.isEmpty(valueStr))
{
return defaultValue;
}
valueStr = valueStr.trim().toLowerCase();
switch (valueStr)
{
case "true":
return true;
case "false":
return false;
case "yes":
return true;
case "ok":
return true;
case "no":
return false;
case "1":
return true;
case "0":
return false;
default:
return defaultValue;
}
}
/**
* 转换为boolean<br>
* 如果给定的值为空或者转换失败返回默认值<code>null</code><br>
* 转换失败不会报错
*
* @param value 被转换的值
* @return 结果
*/
public static Boolean toBool(Object value)
{
return toBool(value, null);
}
/**
* 转换为Enum对象<br>
* 如果给定的值为空或者转换失败返回默认值<br>
*
* @param clazz Enum的Class
* @param value
* @param defaultValue 默认值
* @return Enum
*/
public static <E extends Enum<E>> E toEnum(Class<E> clazz, Object value, E defaultValue)
{
if (value == null)
{
return defaultValue;
}
if (clazz.isAssignableFrom(value.getClass()))
{
@SuppressWarnings("unchecked")
E myE = (E) value;
return myE;
}
final String valueStr = toStr(value, null);
if (StringUtils.isEmpty(valueStr))
{
return defaultValue;
}
try
{
return Enum.valueOf(clazz, valueStr);
}
catch (Exception e)
{
return defaultValue;
}
}
/**
* 转换为Enum对象<br>
* 如果给定的值为空或者转换失败返回默认值<code>null</code><br>
*
* @param clazz Enum的Class
* @param value
* @return Enum
*/
public static <E extends Enum<E>> E toEnum(Class<E> clazz, Object value)
{
return toEnum(clazz, value, null);
}
/**
* 转换为BigInteger<br>
* 如果给定的值为空或者转换失败返回默认值<br>
* 转换失败不会报错
*
* @param value 被转换的值
* @param defaultValue 转换错误时的默认值
* @return 结果
*/
public static BigInteger toBigInteger(Object value, BigInteger defaultValue)
{
if (value == null)
{
return defaultValue;
}
if (value instanceof BigInteger)
{
return (BigInteger) value;
}
if (value instanceof Long)
{
return BigInteger.valueOf((Long) value);
}
final String valueStr = toStr(value, null);
if (StringUtils.isEmpty(valueStr))
{
return defaultValue;
}
try
{
return new BigInteger(valueStr);
}
catch (Exception e)
{
return defaultValue;
}
}
/**
* 转换为BigInteger<br>
* 如果给定的值为空或者转换失败返回默认值<code>null</code><br>
* 转换失败不会报错
*
* @param value 被转换的值
* @return 结果
*/
public static BigInteger toBigInteger(Object value)
{
return toBigInteger(value, null);
}
/**
* 转换为BigDecimal<br>
* 如果给定的值为空或者转换失败返回默认值<br>
* 转换失败不会报错
*
* @param value 被转换的值
* @param defaultValue 转换错误时的默认值
* @return 结果
*/
public static BigDecimal toBigDecimal(Object value, BigDecimal defaultValue)
{
if (value == null)
{
return defaultValue;
}
if (value instanceof BigDecimal)
{
return (BigDecimal) value;
}
if (value instanceof Long)
{
return new BigDecimal((Long) value);
}
if (value instanceof Double)
{
return new BigDecimal((Double) value);
}
if (value instanceof Integer)
{
return new BigDecimal((Integer) value);
}
final String valueStr = toStr(value, null);
if (StringUtils.isEmpty(valueStr))
{
return defaultValue;
}
try
{
return new BigDecimal(valueStr);
}
catch (Exception e)
{
return defaultValue;
}
}
/**
* 转换为BigDecimal<br>
* 如果给定的值为空或者转换失败返回默认值<br>
* 转换失败不会报错
*
* @param value 被转换的值
* @return 结果
*/
public static BigDecimal toBigDecimal(Object value)
{
return toBigDecimal(value, null);
}
/**
* 将对象转为字符串<br>
* 1Byte数组和ByteBuffer会被转换为对应字符串的数组 2对象数组会调用Arrays.toString方法
*
* @param obj 对象
* @param charsetName 字符集
* @return 字符串
*/
public static String str(Object obj, String charsetName)
{
return str(obj, Charset.forName(charsetName));
}
/**
* 将对象转为字符串<br>
* 1Byte数组和ByteBuffer会被转换为对应字符串的数组 2对象数组会调用Arrays.toString方法
*
* @param obj 对象
* @param charset 字符集
* @return 字符串
*/
public static String str(Object obj, Charset charset)
{
if (null == obj)
{
return null;
}
if (obj instanceof String)
{
return (String) obj;
}
else if (obj instanceof byte[] || obj instanceof Byte[])
{
return str((Byte[]) obj, charset);
}
else if (obj instanceof ByteBuffer)
{
return str((ByteBuffer) obj, charset);
}
return obj.toString();
}
/**
* 将byte数组转为字符串
*
* @param bytes byte数组
* @param charset 字符集
* @return 字符串
*/
public static String str(byte[] bytes, String charset)
{
return str(bytes, StringUtils.isEmpty(charset) ? Charset.defaultCharset() : Charset.forName(charset));
}
/**
* 解码字节码
*
* @param data 字符串
* @param charset 字符集如果此字段为空则解码的结果取决于平台
* @return 解码后的字符串
*/
public static String str(byte[] data, Charset charset)
{
if (data == null)
{
return null;
}
if (null == charset)
{
return new String(data);
}
return new String(data, charset);
}
/**
* 将编码的byteBuffer数据转换为字符串
*
* @param data 数据
* @param charset 字符集如果为空使用当前系统字符集
* @return 字符串
*/
public static String str(ByteBuffer data, String charset)
{
if (data == null)
{
return null;
}
return str(data, Charset.forName(charset));
}
/**
* 将编码的byteBuffer数据转换为字符串
*
* @param data 数据
* @param charset 字符集如果为空使用当前系统字符集
* @return 字符串
*/
public static String str(ByteBuffer data, Charset charset)
{
if (null == charset)
{
charset = Charset.defaultCharset();
}
return charset.decode(data).toString();
}
// ----------------------------------------------------------------------- 全角半角转换
/**
* 半角转全角
*
* @param input String.
* @return 全角字符串.
*/
public static String toSBC(String input)
{
return toSBC(input, null);
}
/**
* 半角转全角
*
* @param input String
* @param notConvertSet 不替换的字符集合
* @return 全角字符串.
*/
public static String toSBC(String input, Set<Character> notConvertSet)
{
char c[] = input.toCharArray();
for (int i = 0; i < c.length; i++)
{
if (null != notConvertSet && notConvertSet.contains(c[i]))
{
// 跳过不替换的字符
continue;
}
if (c[i] == ' ')
{
c[i] = '\u3000';
}
else if (c[i] < '\177')
{
c[i] = (char) (c[i] + 65248);
}
}
return new String(c);
}
/**
* 全角转半角
*
* @param input String.
* @return 半角字符串
*/
public static String toDBC(String input)
{
return toDBC(input, null);
}
/**
* 替换全角为半角
*
* @param text 文本
* @param notConvertSet 不替换的字符集合
* @return 替换后的字符
*/
public static String toDBC(String text, Set<Character> notConvertSet)
{
char c[] = text.toCharArray();
for (int i = 0; i < c.length; i++)
{
if (null != notConvertSet && notConvertSet.contains(c[i]))
{
// 跳过不替换的字符
continue;
}
if (c[i] == '\u3000')
{
c[i] = ' ';
}
else if (c[i] > '\uFF00' && c[i] < '\uFF5F')
{
c[i] = (char) (c[i] - 65248);
}
}
String returnString = new String(c);
return returnString;
}
/**
* 数字金额大写转换 先写个完整的然后将如零拾替换成零
*
* @param n 数字
* @return 中文大写数字
*/
public static String digitUppercase(double n)
{
String[] fraction = { "", "" };
String[] digit = { "", "", "", "", "", "", "", "", "", "" };
String[][] unit = { { "", "", "亿" }, { "", "", "", "" } };
String head = n < 0 ? "" : "";
n = Math.abs(n);
String s = "";
for (int i = 0; i < fraction.length; i++)
{
s += (digit[(int) (Math.floor(n * 10 * Math.pow(10, i)) % 10)] + fraction[i]).replaceAll("(零.)+", "");
}
if (s.length() < 1)
{
s = "";
}
int integerPart = (int) Math.floor(n);
for (int i = 0; i < unit[0].length && integerPart > 0; i++)
{
String p = "";
for (int j = 0; j < unit[1].length && n > 0; j++)
{
p = digit[integerPart % 10] + unit[1][j] + p;
integerPart = integerPart / 10;
}
s = p.replaceAll("(零.)*零$", "").replaceAll("^$", "") + unit[0][i] + s;
}
return head + s.replaceAll("(零.)*零元", "").replaceFirst("(零.)+", "").replaceAll("(零.)+", "").replaceAll("^整$", "零元整");
}
}

View File

@ -1,117 +0,0 @@
package com.qinxx.hslink.util;
import java.lang.management.ManagementFactory;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
/**
* 时间工具类
*
* @author ruoyi
*/
public class DateUtils
{
public static String YYYY = "yyyy";
public static String YYYY_MM = "yyyy-MM";
public static String YYYY_MM_DD = "yyyy-MM-dd";
public static String YYYYMMDDHHMMSS = "yyyyMMddHHmmss";
public static String YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss";
private static String[] parsePatterns = {
"yyyy-MM-dd", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm", "yyyy-MM",
"yyyy/MM/dd", "yyyy/MM/dd HH:mm:ss", "yyyy/MM/dd HH:mm", "yyyy/MM",
"yyyy.MM.dd", "yyyy.MM.dd HH:mm:ss", "yyyy.MM.dd HH:mm", "yyyy.MM"};
/**
* 获取当前Date型日期
*
* @return Date() 当前日期
*/
public static Date getNowDate()
{
return new Date();
}
/**
* 获取当前日期, 默认格式为yyyy-MM-dd
*
* @return String
*/
public static String getDate()
{
return dateTimeNow(YYYY_MM_DD);
}
public static final String getTime()
{
return dateTimeNow(YYYY_MM_DD_HH_MM_SS);
}
public static final String dateTimeNow()
{
return dateTimeNow(YYYYMMDDHHMMSS);
}
public static final String dateTimeNow(final String format)
{
return parseDateToStr(format, new Date());
}
public static final String dateTime(final Date date)
{
return parseDateToStr(YYYY_MM_DD, date);
}
public static final String parseDateToStr(final String format, final Date date)
{
return new SimpleDateFormat(format).format(date);
}
public static final Date dateTime(final String format, final String ts)
{
try
{
return new SimpleDateFormat(format).parse(ts);
}
catch (ParseException e)
{
throw new RuntimeException(e);
}
}
/**
* 获取服务器启动时间
*/
public static Date getServerStartDate()
{
long time = ManagementFactory.getRuntimeMXBean().getStartTime();
return new Date(time);
}
/**
* 计算两个时间差
*/
public static String getDatePoor(Date endDate, Date nowDate)
{
long nd = 1000 * 24 * 60 * 60;
long nh = 1000 * 60 * 60;
long nm = 1000 * 60;
// long ns = 1000;
// 获得两个时间的毫秒时间差异
long diff = endDate.getTime() - nowDate.getTime();
// 计算差多少天
long day = diff / nd;
// 计算差多少小时
long hour = diff % nd / nh;
// 计算差多少分钟
long min = diff % nd % nh / nm;
// 计算差多少秒//输出结果
// long sec = diff % nd % nh % nm / ns;
return day + "" + hour + "小时" + min + "分钟";
}
}

View File

@ -1,89 +0,0 @@
package com.qinxx.hslink.util;
/**
* 返回状态码
*
* @author ruoyi
*/
public class HttpStatus
{
/**
* 操作成功
*/
public static final int SUCCESS = 200;
/**
* 对象创建成功
*/
public static final int CREATED = 201;
/**
* 请求已经被接受
*/
public static final int ACCEPTED = 202;
/**
* 操作已经执行成功但是没有返回数据
*/
public static final int NO_CONTENT = 204;
/**
* 资源已被移除
*/
public static final int MOVED_PERM = 301;
/**
* 重定向
*/
public static final int SEE_OTHER = 303;
/**
* 资源没有被修改
*/
public static final int NOT_MODIFIED = 304;
/**
* 参数列表错误缺少格式不匹配
*/
public static final int BAD_REQUEST = 400;
/**
* 未授权
*/
public static final int UNAUTHORIZED = 401;
/**
* 访问受限授权过期
*/
public static final int FORBIDDEN = 403;
/**
* 资源服务未找到
*/
public static final int NOT_FOUND = 404;
/**
* 不允许的http方法
*/
public static final int BAD_METHOD = 405;
/**
* 资源冲突或者资源被锁
*/
public static final int CONFLICT = 409;
/**
* 不支持的数据媒体类型
*/
public static final int UNSUPPORTED_TYPE = 415;
/**
* 系统内部错误
*/
public static final int ERROR = 500;
/**
* 接口未实现
*/
public static final int NOT_IMPLEMENTED = 501;
}

View File

@ -1,25 +0,0 @@
package com.qinxx.hslink.util;
import org.springframework.context.MessageSource;
import org.springframework.context.i18n.LocaleContextHolder;
/**
* 获取i18n资源文件
*
* @author ruoyi
*/
public class MessageUtils
{
/**
* 根据消息键和参数 获取消息 委托给spring messageSource
*
* @param code 消息键
* @param args 参数
* @return 获取国际化翻译值
*/
public static String message(String code, Object... args)
{
MessageSource messageSource = SpringUtils.getBean(MessageSource.class);
return messageSource.getMessage(code, args, LocaleContextHolder.getLocale());
}
}

View File

@ -1,70 +0,0 @@
package com.qinxx.hslink.util;
/**
* 分页数据
*
* @author ruoyi
*/
public class PageDomain
{
/** 当前记录起始索引 */
private Integer pageNum;
/** 每页显示记录数 */
private Integer pageSize;
/** 排序列 */
private String orderByColumn;
/** 排序的方向desc或者asc */
private String isAsc = "asc";
public String getOrderBy()
{
if (StringUtils.isEmpty(orderByColumn))
{
return "";
}
return StringUtils.toUnderScoreCase(orderByColumn) + " " + isAsc;
}
public Integer getPageNum()
{
return pageNum;
}
public void setPageNum(Integer pageNum)
{
this.pageNum = pageNum;
}
public Integer getPageSize()
{
return pageSize;
}
public void setPageSize(Integer pageSize)
{
this.pageSize = pageSize;
}
public String getOrderByColumn()
{
return orderByColumn;
}
public void setOrderByColumn(String orderByColumn)
{
this.orderByColumn = orderByColumn;
}
public String getIsAsc()
{
return isAsc;
}
public void setIsAsc(String isAsc)
{
this.isAsc = isAsc;
}
}

View File

@ -27,11 +27,11 @@ public class SaticScheduleTask {
/**
* 3.添加定时任务
*/
/*@Scheduled(cron = "0/5 * * * * ?")*/
@Scheduled(cron = "0/5 * * * * ?")
/**
* 或直接指定时间间隔例如5秒
*/
@Scheduled(fixedRate = 120000)
/*@Scheduled(fixedRate=5000)*/
private void configureTasks() {
Map<String, Object> map = new HashMap<>();

View File

@ -1,136 +0,0 @@
package com.qinxx.hslink.util;
import org.springframework.web.context.request.RequestAttributes;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;
/**
* 客户端工具类
*
* @author ruoyi
*/
public class ServletUtils
{
/**
* 获取String参数
*/
public static String getParameter(String name)
{
return getRequest().getParameter(name);
}
/**
* 获取String参数
*/
public static String getParameter(String name, String defaultValue)
{
return Convert.toStr(getRequest().getParameter(name), defaultValue);
}
/**
* 获取Integer参数
*/
public static Integer getParameterToInt(String name)
{
return Convert.toInt(getRequest().getParameter(name));
}
/**
* 获取Integer参数
*/
public static Integer getParameterToInt(String name, Integer defaultValue)
{
return Convert.toInt(getRequest().getParameter(name), defaultValue);
}
/**
* 获取request
*/
public static HttpServletRequest getRequest()
{
return getRequestAttributes().getRequest();
}
/**
* 获取response
*/
public static HttpServletResponse getResponse()
{
return getRequestAttributes().getResponse();
}
/**
* 获取session
*/
public static HttpSession getSession()
{
return getRequest().getSession();
}
public static ServletRequestAttributes getRequestAttributes()
{
RequestAttributes attributes = RequestContextHolder.getRequestAttributes();
return (ServletRequestAttributes) attributes;
}
/**
* 将字符串渲染到客户端
*
* @param response 渲染对象
* @param string 待渲染的字符串
* @return null
*/
public static String renderString(HttpServletResponse response, String string)
{
try
{
response.setStatus(200);
response.setContentType("application/json");
response.setCharacterEncoding("utf-8");
response.getWriter().print(string);
}
catch (IOException e)
{
e.printStackTrace();
}
return null;
}
/**
* 是否是Ajax异步请求
*
* @param request
*/
public static boolean isAjaxRequest(HttpServletRequest request)
{
String accept = request.getHeader("accept");
if (accept != null && accept.indexOf("application/json") != -1)
{
return true;
}
String xRequestedWith = request.getHeader("X-Requested-With");
if (xRequestedWith != null && xRequestedWith.indexOf("XMLHttpRequest") != -1)
{
return true;
}
String uri = request.getRequestURI();
if (StringUtils.inStringIgnoreCase(uri, ".json", ".xml"))
{
return true;
}
String ajax = request.getParameter("__ajax");
if (StringUtils.inStringIgnoreCase(ajax, "json", "xml"))
{
return true;
}
return false;
}
}

View File

@ -1,145 +0,0 @@
package com.qinxx.hslink.util;
import org.springframework.aop.framework.AopContext;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;
/**
* spring工具类 方便在非spring管理环境中获取bean
*
* @author ruoyi
*/
@Component
public final class SpringUtils implements BeanFactoryPostProcessor, ApplicationContextAware
{
/** Spring应用上下文环境 */
private static ConfigurableListableBeanFactory beanFactory;
private static ApplicationContext applicationContext;
@Override
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException
{
SpringUtils.beanFactory = beanFactory;
}
@Override
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException
{
SpringUtils.applicationContext = applicationContext;
}
/**
* 获取对象
*
* @param name
* @return Object 一个以所给名字注册的bean的实例
* @throws org.springframework.beans.BeansException
*
*/
@SuppressWarnings("unchecked")
public static <T> T getBean(String name) throws BeansException
{
return (T) beanFactory.getBean(name);
}
/**
* 获取类型为requiredType的对象
*
* @param clz
* @return
* @throws org.springframework.beans.BeansException
*
*/
public static <T> T getBean(Class<T> clz) throws BeansException
{
T result = (T) beanFactory.getBean(clz);
return result;
}
/**
* 如果BeanFactory包含一个与所给名称匹配的bean定义则返回true
*
* @param name
* @return boolean
*/
public static boolean containsBean(String name)
{
return beanFactory.containsBean(name);
}
/**
* 判断以给定名字注册的bean定义是一个singleton还是一个prototype 如果与给定名字相应的bean定义没有被找到将会抛出一个异常NoSuchBeanDefinitionException
*
* @param name
* @return boolean
* @throws org.springframework.beans.factory.NoSuchBeanDefinitionException
*
*/
public static boolean isSingleton(String name) throws NoSuchBeanDefinitionException
{
return beanFactory.isSingleton(name);
}
/**
* @param name
* @return Class 注册对象的类型
* @throws org.springframework.beans.factory.NoSuchBeanDefinitionException
*
*/
public static Class<?> getType(String name) throws NoSuchBeanDefinitionException
{
return beanFactory.getType(name);
}
/**
* 如果给定的bean名字在bean定义中有别名则返回这些别名
*
* @param name
* @return
* @throws org.springframework.beans.factory.NoSuchBeanDefinitionException
*
*/
public static String[] getAliases(String name) throws NoSuchBeanDefinitionException
{
return beanFactory.getAliases(name);
}
/**
* 获取aop代理对象
*
* @param invoker
* @return
*/
@SuppressWarnings("unchecked")
public static <T> T getAopProxy(T invoker)
{
return (T) AopContext.currentProxy();
}
/**
* 获取当前的环境配置无配置返回null
*
* @return 当前的环境配置
*/
public static String[] getActiveProfiles()
{
return applicationContext.getEnvironment().getActiveProfiles();
}
/**
* 获取当前的环境配置当有多个环境配置时只获取第一个
*
* @return 当前的环境配置
*/
public static String getActiveProfile()
{
final String[] activeProfiles = getActiveProfiles();
return StringUtils.isNotEmpty(activeProfiles) ? activeProfiles[0] : null;
}
}

View File

@ -1,35 +0,0 @@
package com.qinxx.hslink.util;
/**
* sql操作工具类
*
* @author ruoyi
*/
public class SqlUtil
{
/**
* 仅支持字母数字下划线空格逗号小数点支持多个字段排序
*/
public static String SQL_PATTERN = "[a-zA-Z0-9_\\ \\,\\.]+";
/**
* 检查字符防止注入绕过
*/
public static String escapeOrderBySql(String value)
{
if (StringUtils.isNotEmpty(value) && !isValidOrderBySql(value))
{
throw new BaseException("参数不符合规范,不能进行查询");
}
return value;
}
/**
* 验证 order by 语法是否符合规范
*/
public static boolean isValidOrderBySql(String value)
{
return value.matches(SQL_PATTERN);
}
}

View File

@ -1,413 +0,0 @@
package com.qinxx.hslink.util;
import java.util.*;
/**
* 字符串工具类
*
* @author ruoyi
*/
public class StringUtils
{
/** 空字符串 */
private static final String NULLSTR = "";
/** 下划线 */
private static final char SEPARATOR = '_';
/**
* 获取参数不为空值
*
* @param value defaultValue 要判断的value
* @return value 返回值
*/
public static <T> T nvl(T value, T defaultValue)
{
return value != null ? value : defaultValue;
}
/**
* * 判断一个Collection是否为空 包含ListSetQueue
*
* @param coll 要判断的Collection
* @return true为空 false非空
*/
public static boolean isEmpty(Collection<?> coll)
{
return isNull(coll) || coll.isEmpty();
}
/**
* * 判断一个Collection是否非空包含ListSetQueue
*
* @param coll 要判断的Collection
* @return true非空 false
*/
public static boolean isNotEmpty(Collection<?> coll)
{
return !isEmpty(coll);
}
/**
* * 判断一个对象数组是否为空
*
* @param objects 要判断的对象数组
** @return true为空 false非空
*/
public static boolean isEmpty(Object[] objects)
{
return isNull(objects) || (objects.length == 0);
}
/**
* * 判断一个对象数组是否非空
*
* @param objects 要判断的对象数组
* @return true非空 false
*/
public static boolean isNotEmpty(Object[] objects)
{
return !isEmpty(objects);
}
/**
* * 判断一个Map是否为空
*
* @param map 要判断的Map
* @return true为空 false非空
*/
public static boolean isEmpty(Map<?, ?> map)
{
return isNull(map) || map.isEmpty();
}
/**
* * 判断一个Map是否为空
*
* @param map 要判断的Map
* @return true非空 false
*/
public static boolean isNotEmpty(Map<?, ?> map)
{
return !isEmpty(map);
}
/**
* * 判断一个字符串是否为空串
*
* @param str String
* @return true为空 false非空
*/
public static boolean isEmpty(String str)
{
return isNull(str) || NULLSTR.equals(str.trim());
}
/**
* * 判断一个字符串是否为非空串
*
* @param str String
* @return true非空串 false空串
*/
public static boolean isNotEmpty(String str)
{
return !isEmpty(str);
}
/**
* * 判断一个对象是否为空
*
* @param object Object
* @return true为空 false非空
*/
public static boolean isNull(Object object)
{
return object == null;
}
/**
* * 判断一个对象是否非空
*
* @param object Object
* @return true非空 false
*/
public static boolean isNotNull(Object object)
{
return !isNull(object);
}
/**
* * 判断一个对象是否是数组类型Java基本型别的数组
*
* @param object 对象
* @return true是数组 false不是数组
*/
public static boolean isArray(Object object)
{
return isNotNull(object) && object.getClass().isArray();
}
/**
* 去空格
*/
public static String trim(String str)
{
return (str == null ? "" : str.trim());
}
/**
* 截取字符串
*
* @param str 字符串
* @param start 开始
* @return 结果
*/
public static String substring(final String str, int start)
{
if (str == null)
{
return NULLSTR;
}
if (start < 0)
{
start = str.length() + start;
}
if (start < 0)
{
start = 0;
}
if (start > str.length())
{
return NULLSTR;
}
return str.substring(start);
}
/**
* 截取字符串
*
* @param str 字符串
* @param start 开始
* @param end 结束
* @return 结果
*/
public static String substring(final String str, int start, int end)
{
if (str == null)
{
return NULLSTR;
}
if (end < 0)
{
end = str.length() + end;
}
if (start < 0)
{
start = str.length() + start;
}
if (end > str.length())
{
end = str.length();
}
if (start > end)
{
return NULLSTR;
}
if (start < 0)
{
start = 0;
}
if (end < 0)
{
end = 0;
}
return str.substring(start, end);
}
/**
* 字符串转set
*
* @param str 字符串
* @param sep 分隔符
* @return set集合
*/
public static final Set<String> str2Set(String str, String sep)
{
return new HashSet<String>(str2List(str, sep, true, false));
}
/**
* 字符串转list
*
* @param str 字符串
* @param sep 分隔符
* @param filterBlank 过滤纯空白
* @param trim 去掉首尾空白
* @return list集合
*/
public static final List<String> str2List(String str, String sep, boolean filterBlank, boolean trim)
{
List<String> list = new ArrayList<String>();
if (StringUtils.isEmpty(str))
{
return list;
}
return list;
}
/**
* 下划线转驼峰命名
*/
public static String toUnderScoreCase(String str)
{
if (str == null)
{
return null;
}
StringBuilder sb = new StringBuilder();
// 前置字符是否大写
boolean preCharIsUpperCase = true;
// 当前字符是否大写
boolean curreCharIsUpperCase = true;
// 下一字符是否大写
boolean nexteCharIsUpperCase = true;
for (int i = 0; i < str.length(); i++)
{
char c = str.charAt(i);
if (i > 0)
{
preCharIsUpperCase = Character.isUpperCase(str.charAt(i - 1));
}
else
{
preCharIsUpperCase = false;
}
curreCharIsUpperCase = Character.isUpperCase(c);
if (i < (str.length() - 1))
{
nexteCharIsUpperCase = Character.isUpperCase(str.charAt(i + 1));
}
if (preCharIsUpperCase && curreCharIsUpperCase && !nexteCharIsUpperCase)
{
sb.append(SEPARATOR);
}
else if ((i != 0 && !preCharIsUpperCase) && curreCharIsUpperCase)
{
sb.append(SEPARATOR);
}
sb.append(Character.toLowerCase(c));
}
return sb.toString();
}
/**
* 是否包含字符串
*
* @param str 验证字符串
* @param strs 字符串组
* @return 包含返回true
*/
public static boolean inStringIgnoreCase(String str, String... strs)
{
if (str != null && strs != null)
{
for (String s : strs)
{
if (str.equalsIgnoreCase(trim(s)))
{
return true;
}
}
}
return false;
}
/**
* 将下划线大写方式命名的字符串转换为驼峰式如果转换前的下划线大写方式命名的字符串为空则返回空字符串 例如HELLO_WORLD->HelloWorld
*
* @param name 转换前的下划线大写方式命名的字符串
* @return 转换后的驼峰式命名的字符串
*/
public static String convertToCamelCase(String name)
{
StringBuilder result = new StringBuilder();
// 快速检查
if (name == null || name.isEmpty())
{
// 没必要转换
return "";
}
else if (!name.contains("_"))
{
// 不含下划线仅将首字母大写
return name.substring(0, 1).toUpperCase() + name.substring(1);
}
// 用下划线将原始字符串分割
String[] camels = name.split("_");
for (String camel : camels)
{
// 跳过原始字符串中开头结尾的下换线或双重下划线
if (camel.isEmpty())
{
continue;
}
// 首字母大写
result.append(camel.substring(0, 1).toUpperCase());
result.append(camel.substring(1).toLowerCase());
}
return result.toString();
}
/**
* 驼峰式命名法 例如user_name->userName
*/
public static String toCamelCase(String s)
{
if (s == null)
{
return null;
}
s = s.toLowerCase();
StringBuilder sb = new StringBuilder(s.length());
boolean upperCase = false;
for (int i = 0; i < s.length(); i++)
{
char c = s.charAt(i);
if (c == SEPARATOR)
{
upperCase = true;
}
else if (upperCase)
{
sb.append(Character.toUpperCase(c));
upperCase = false;
}
else
{
sb.append(c);
}
}
return sb.toString();
}
@SuppressWarnings("unchecked")
public static <T> T cast(Object obj)
{
return (T) obj;
}
}

View File

@ -1,48 +0,0 @@
package com.qinxx.hslink.util;
/**
* 表格数据处理
*
* @author ruoyi
*/
public class TableSupport
{
/**
* 当前记录起始索引
*/
public static final String PAGE_NUM = "pageNum";
/**
* 每页显示记录数
*/
public static final String PAGE_SIZE = "pageSize";
/**
* 排序列
*/
public static final String ORDER_BY_COLUMN = "orderByColumn";
/**
* 排序的方向 "desc" 或者 "asc".
*/
public static final String IS_ASC = "isAsc";
/**
* 封装分页对象
*/
public static PageDomain getPageDomain()
{
PageDomain pageDomain = new PageDomain();
pageDomain.setPageNum(ServletUtils.getParameterToInt(PAGE_NUM));
pageDomain.setPageSize(ServletUtils.getParameterToInt(PAGE_SIZE));
pageDomain.setOrderByColumn(ServletUtils.getParameter(ORDER_BY_COLUMN));
pageDomain.setIsAsc(ServletUtils.getParameter(IS_ASC));
return pageDomain;
}
public static PageDomain buildPageRequest()
{
return getPageDomain();
}
}

View File

@ -0,0 +1,8 @@
{
"properties": [
{
"name": "filePath",
"type": "java.lang.String",
"description": "Description for filePath."
}
] }

View File

@ -1,12 +0,0 @@
##文件保存路径
filePath: ${user.dir}\src\main\static\files\
##数据源
spring:
datasource:
url: jdbc:mysql://127.0.0.1:3306/hslink?serverTimezone=Hongkong&useUnicode=true&characterEncoding=utf8
username: root
password: 123456
db-name: hslink
filters: log4j,wall,mergeStat
driverClassName: com.mysql.cj.jdbc.Driver

View File

@ -9,7 +9,15 @@ mybatis:
logging:
level:
com.qinxx.hslink.dao : debug
##数据源
spring:
profiles:
active: dev
datasource:
url: jdbc:mysql://127.0.0.1:3306/hslink?serverTimezone=Hongkong&useUnicode=true&characterEncoding=utf8
username: root
password: 123456
db-name: hslink
filters: log4j,wall,mergeStat
driverClassName: com.mysql.cj.jdbc.Driver
##文件保存路径
filePath: D:\office\phy\HSLink\HSLink-front\src\assets\file

View File

@ -1,7 +0,0 @@
Spring Boot Version: v2.2.6.RELEASE
__ _______ __ _ __
/ / / / ___// / (_)___ / /__
/ /_/ /\__ \/ / / / __ \/ //_/
/ __ /___/ / /___/ / / / / ,<
/_/ /_//____/_____/_/_/ /_/_/|_|

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 112 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 99 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 207 KiB

View File

@ -0,0 +1 @@
测试文件

View File

@ -1,11 +0,0 @@
# 开发环境配置
ENV = 'development'
# 开发环境
VUE_APP_BASE_API = '/dev-api'
# 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true
# 后端地址+端口
VUE_APP_BACK = 'http://127.0.0.1:8048'

View File

@ -1,8 +0,0 @@
# 生产环境配置
ENV = 'production'
# 生产环境
VUE_APP_BASE_API = '/prod-api'
# 后端地址+端口
VUE_APP_BACK = 'http://phy0412.top:8862/prod-api'

View File

@ -13,7 +13,7 @@ module.exports = {
proxyTable: {},
// Various Dev Server settings
host: '127.0.0.1', // can be overwritten by process.env.HOST
host: '0.0.0.0', // can be overwritten by process.env.HOST
port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
autoOpenBrowser: false,
errorOverlay: true,

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
{
"name": "hslink",
"version": "1.0.0",
"description": "家校通",
"description": "A Vue.js project",
"author": "peihaoyu <617594538@qq.com>",
"private": true,
"scripts": {
@ -14,7 +14,6 @@
"element-ui": "^2.13.0",
"jquery": "^3.4.1",
"marked": "^0.8.2",
"mavon-editor": "^2.9.1",
"react": "^16.13.1",
"vue": "^2.5.2",
"vue-router": "^3.0.1",
@ -55,7 +54,7 @@
"vue-style-loader": "^3.0.1",
"vue-template-compiler": "^2.5.2",
"webpack": "^3.6.0",
"webpack-bundle-analyzer": "^2.9.0",
"webpack-bundle-analyzer": "^3.3.2",
"webpack-dev-server": "^2.9.1",
"webpack-merge": "^4.1.0"
},

View File

@ -6,12 +6,7 @@
<script>
export default {
name: 'App',
mounted() {
const url = `http://pnkx.top:8862/prod-api`;
// const url = `http://127.0.0.1:8048`;
sessionStorage.setItem('url', url);
}
name: 'App'
}
</script>

View File

@ -1,36 +0,0 @@
import request from '@/util/request'
// 查询获奖列表
export function listWinners(query) {
return request({
url: '/admin/winners/list',
method: 'get',
params: query
})
}
// 新增获奖
export function addWinners(data) {
return request({
url: '/admin/winners',
method: 'post',
data: data
})
}
// 修改获奖
export function updateWinners(data) {
return request({
url: '/admin/winners',
method: 'put',
data: data
})
}
// 删除获奖
export function delWinners(id) {
return request({
url: '/admin/winners/' + id,
method: 'delete'
})
}

View File

@ -1,6 +1,9 @@
// 配置API接口地址
import de from "element-ui/src/locale/lang/de";
// let root = 'http://192.168.10.29:8048'
let root = 'http://106.53.113.158:8048'
// let root = 'http://127.0.0.1:8048'
// 引用axios
let axios = require('axios')
// 自定义判断元素类型JS
@ -43,12 +46,15 @@ function apiAxios (method, url, params, success, failure) {
url: url,
data: method === 'POST' || method === 'PUT' ? params : null,
params: method === 'GET' || method === 'DELETE' ? params : null,
baseURL: sessionStorage.getItem('url'),
baseURL: root,
withCredentials: false
})
.then(function (res) {
if (res.data) {
success(res.data)
console.log("success",res)
if (res.data.success === true) {
if (success) {
success(res.data.data)
}
} else {
if (failure) {
failure(res.data)

View File

@ -1,46 +0,0 @@
import request from '@/util/request'
// 注册
export function register(query) {
return request({
url: '/hs/register',
method: 'post',
data: query
})
}
// 编辑人员信息
export function editPerson(query) {
return request({
url: '/hs/updatePersonalInfo',
method: 'post',
data: query
})
}
// 删除人员
export function delPerson(id) {
return request({
url: '/admin/person/' + id,
method: 'delete'
})
}
// 获取班级列表
export function getClassList(query) {
return request({
url: '/admin/class/list',
method: 'post',
data: query
})
}
// 获取职务列表
export function getPostList(query) {
return request({
url: '/admin/post/list',
method: 'post',
data: query
})
}

View File

@ -1,12 +0,0 @@
import request from '@/util/request'
// 获取字典列表
export function getDict(query) {
return request({
url: '/hs/getDictionariesData',
method: 'post',
data: {
code: query
}
})
}

View File

@ -41,56 +41,9 @@ body{
.theme-font-blue{
color: #1B94D4;
}
.theme-font-green{
color: #06d400;
}
.theme-font-red{
color: #d7371c;
}
.body-background{
background: #EEFCFE;
}
body{
padding-right:0 !important
}
.article-content img {
max-width: 100%;
}
.class-table-box {
width: 50%!important;
overflow: auto;
}
/*滚动条样式*/
::-webkit-scrollbar
{
width: 5px;
}
/*定义滚动条轨道 内阴影+圆角*/
::-webkit-scrollbar-track {
border-radius: 0.5rem;
background-color: rgba(0,0,0,0);
}
/*定义滑块 内阴影+圆角*/
::-webkit-scrollbar-thumb
{
border-radius: 0.5rem;
-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.4);
background-color: rgba(0,0,0,0.4);
}

View File

@ -9,18 +9,23 @@
</div>
<div class="indexContainer">
<div class="maskContainer" v-if="dilogStatus">
<div class="contentContainer">
<div class="closeBtnContainer" @click="closeMaskFn"></div>
<textarea class="showAreaContainer" v-model="msgShow" readonly></textarea>
</div>
</div>
<div class="editorContainer">
<mavon-editor
:placeholder="'开始创作···'"
:toolbars="toolbars"
:toolbarsBackground="'#f9f9f9'"
@change="change"
@imgAdd="imgAdd"
@imgDel="imgDel"
ref="md"
style="height: 50vh"
v-model="content"
/>
<markdown
:mdValuesP="msg.mdValue"
:fullPageStatusP="false"
:editStatusP="true"
:previewStatusP="true"
:navStatusP="true"
:icoStatusP="true"
@childevent="childEventHandler"
ref="markdown"
></markdown>
</div>
</div>
<el-button class="" type="primary" @click="publish"> </el-button>
@ -42,44 +47,14 @@
name: "Posting",
data() {
return {
//
toolbars: {
bold: true, //
italic: true, //
header: true, //
underline: true, // 线
strikethrough: true, // 线
mark: true, //
superscript: true, //
subscript: true, //
quote: true, //
ol: true, //
ul: true, //
link: true, //
imagelink: true, //
code: true, // code
table: true, //
fullscreen: false, //
readmodel: false, //
htmlcode: true, // html
help: true, //
/* 1.3.5 */
undo: true, //
redo: true, //
trash: true, //
save: false, // eventssave
navigation: true, //
alignleft: true, //
aligncenter: true, //
alignright: true, //
subfield: true, //
preview: false //
},
label: "",
title:"",
type:'',
content:'',
msgShow:'我要显示的内容',
dilogStatus:false,
msg: {
mdValue:''
},
flag:false,
}
},
@ -98,36 +73,33 @@
}
},
methods: {
imgAdd (pos, file) {
// ..
const formData = new FormData();
formData.append('image', file);
this.$ajax.post('https://phy0412.top/prod-api/open/uploadImage', formData, res => {
this.$refs.md.$img2Url(pos, 'https://phy0412.top/prod-api' + res.imgUrl)
})
},
imgDel (pos) {
delete this.img_file[pos]
},
change (value, render) {
this.html = render
},
goBack() {
this.$router.back(-1)
},
childEventHandler:function(res){
// resdata,mdValuehtmlValue
this.msg=res;
},
closeMaskFn:function(){
this.msgShow='';
this.dilogStatus=false;
},
handleChange(value) {
console.log(value);
},
publish() {
if (this.label.length !== 4) {
this.$notify({
if (this.label.length != 4) {
this.$message({
message: "文章标签只能为4个汉字",
type: "warning"
})
} else if (this.title === '') {
this.$notify({
} else if (this.title == '') {
this.$message({
message: "文章标题不能为空",
type: "warning"
})
} else if (this.content === '') {
this.$notify({
} else if (this.msg.mdValue == '') {
this.$message({
message: "编辑内容不能为空",
type: "warning"
})
@ -135,12 +107,13 @@
if (sessionStorage.getItem("releaseType") === "classNotice") {
let userInfo = JSON.parse(sessionStorage.getItem("userInfo"));
this.$ajax.post("/hs/addClassNotice",{classId:userInfo.class_id,className:userInfo.class_name,
label:this.label,title:this.title,content:this.html,content_md: this.content ,releaseId:userInfo.user_id,
label:this.label,title:this.title,content:this.msg.mdValue,releaseId:userInfo.user_id,
release_time:getDate(),type:this.type},r=> {
if (r.data === 1) {
if (r === 1) {
this.$ajax.post("/hs/timingTask",{userId:userInfo.user_id},r=>{
console.log(r)
});
this.$notify({
this.$message({
message: "发布成功",
type: "success"
});
@ -152,12 +125,13 @@
sessionStorage.setItem("releaseType","")
} else {
let userInfo = JSON.parse(sessionStorage.getItem("userInfo"));
this.$ajax.post("/hs/addArticle",{label:this.label,title:this.title,content:this.html,content_md: this.content,release_id:userInfo.user_id,
this.$ajax.post("/hs/addArticle",{label:this.label,title:this.title,content:this.msg.mdValue,release_id:userInfo.user_id,
release_time:getDate(),type:this.type},r=>{
if (r.data === 1) {
if (r === 1) {
this.$ajax.post("/hs/timingTask",{userId:userInfo.user_id},r=>{
console.log(r)
});
this.$notify({
this.$message({
message: "发表成功",
type: "success"
});
@ -170,6 +144,9 @@
}
}
},
components: {
markdown
},
}
</script>
@ -193,7 +170,7 @@
padding-bottom: 1rem;
}
.editorContainer{
height: fit-content;
height: 500px;
}
.integral img{
display: inline-block;

View File

@ -16,24 +16,30 @@
</div>
</div>
<div class="middle">
<div class="editorContainer article-content" v-html="all.content"></div>
<div class="editorContainer">
<markdown
:mdValuesP="msg.mdValue"
:fullPageStatusP="false"
:editStatusP="true"
:previewStatusP="true"
:navStatusP="true"
:icoStatusP="true"
@childevent="childEventHandler"
ref="markdown"
></markdown>
</div>
</div>
<div class="footer">
<el-row class="article-read">
<div class="reading-volume">
阅读 {{all.read_number}}
</div>
<div class="collection" :class="all.isCollection === 0 ? '' : 'collection-active'" @click="collection(all.isCollection)">
<i class="el-icon-star-on"/>
{{all.isCollection === 0 ? '收藏' : '已收藏'}}
</div>
<el-row>
<el-button type="primary" icon="el-icon-thumb" size="mini" plain @click="follow"> </el-button>
<el-button type="primary" icon="el-icon-share" size="mini" plain @click="follow"> </el-button>
</el-row>
</div>
</div>
<div class="comment-area">
<el-button class="message" type="primary" @click="messages">留言</el-button>
<div class="comment-list">
<div class="comment-one" v-for="(item, index) in message" :key='index'>
<div class="comment-one" v-for="(item,index) in message">
<div class="comment-header">
<div class="header-photo">{{item.header_photo}}</div>
<div class="name">{{item.real_name}}</div>
@ -46,7 +52,7 @@
</div>
</div>
</el-main>
<div class="index-right">
<el-aside>
<div class="person-info">
<div class="info">
<div class="name">
@ -70,18 +76,19 @@
</div>
<hr>
<div class="operation">
<el-button type="primary" plain size="mini" @click="follow(all.isFollow)">{{all.isFollow === 0 ? ' ' : '取消关注'}}</el-button>
<el-button type="primary" plain size="mini" @click="follow"> </el-button>
<el-button type="primary" plain size="mini" @click="sendLetter(all.author_id,all.author_name)"> </el-button>
</div>
</div>
<footers/>
</div>
<footers></footers>
</el-aside>
</el-container>
</template>
<script>
import { getDate } from '../assets/js/public.js'
import footers from './components/Footer'
import markdown from "./components/Mdeditor";
export default {
name: "Content",
data() {
@ -89,6 +96,11 @@
all: "",
message: '',
id:'',
msgShow:'我要显示的内容',
dilogStatus:false,
msg: {
mdValue:''
},
flag:false,
userId: JSON.parse(sessionStorage.getItem("userInfo")).user_id
}
@ -96,48 +108,20 @@
created() {
},
mounted() {
this.getNotice()
this.$ajax.post("/hs/getOneContent", {
id: sessionStorage.getItem("noticeId")
}, r => {
this.all = r.content;
this.message = r.message;
this.msg.mdValue = r.content.content;
this.all.header_photo = this.all.author_name.substring(0, 1);
for (let i = 0; i < this.message.length; i++) {
this.message[i].header_photo = this.message[i].real_name.substring(0, 1);
}
setTimeout(()=>{this.$refs.markdown.addLine()},1)
})
},
methods: {
/**
* 获取通知
*/
getNotice() {
this.$ajax.post("/hs/getOneContent", {
id: sessionStorage.getItem("noticeId"),
userId: this.userId
}, r => {
this.all = r.data.content;
this.message = r.data.message;
this.all.header_photo = this.all.author_name.substring(0, 1);
for (let i = 0; i < this.message.length; i++) {
this.message[i].header_photo = this.message[i].real_name.substring(0, 1);
}
this.$ajax.post("/hs/updateReadNumber",{
noticeId: sessionStorage.getItem("noticeId"),
number: Number(this.all.read_number)+1
}, res => {
this.all.read_number = Number(this.all.read_number)+1
})
})
},
/**
* 收藏
*/
collection(option) {
const URL = {
"0": "/hs/addCollection",
"1": "/hs/cancelCollection",
};
this.$ajax.post(URL[option],{
noticeId: sessionStorage.getItem("noticeId"),
userId: this.userId,
}, res=>{
if (res.data > 0) {
this.getNotice()
}
})
},
deleteMy(id) {
this.$confirm('确定删除该条留言, 是否继续?', '删除', {
confirmButtonText: '确定',
@ -145,15 +129,15 @@
type: 'warning'
}).then(() => {
this.$ajax.post("/hs/deleteOneMessage",{id:id},r=>{
if (r.data === 1) {
this.$notify({
if (r === 1) {
this.$message({
type: 'success',
message: '删除成功!'
});
this.$ajax.post("/hs/getOneContent", {
id: sessionStorage.getItem("noticeId")
}, r => {
this.message = r.data.message;
this.message = r.message;
for (let i = 0; i < this.message.length; i++) {
this.message[i].header_photo = this.message[i].real_name.substring(0, 1)
}
@ -161,7 +145,10 @@
}
})
}).catch(() => {
this.$notify.info('已取消删除');
this.$message({
type: 'info',
message: '已取消删除'
});
});
},
sendLetter(id,name) {
@ -173,31 +160,26 @@
inputErrorMessage: '内容不能为空'
}).then(({ value }) => {
this.$ajax.post("/hs/sendLetter",{sendId:userInfo.user_id,receiveId:id,content:value,time:getDate()},r=>{
if (r.data === 1) {
this.$notify({
if (r === 1) {
this.$message({
type: 'success',
message: '发送成功'
});
} else {
this.$notify.error("发送失败")
this.$message.error("发送失败")
}
})
}).catch(() => {
this.$notify.info('取消输入');
this.$message({
type: 'info',
message: '取消输入'
});
});
},
follow(option) {
const URL = {
0: '/hs/addFollow',
1: '/hs/cancelFollow'
};
this.$ajax.post(URL[option],{
userId: this.userId,
followId: this.all.author_id
}, res => {
if (res.data > 0) {
this.getNotice();
}
follow() {
this.$message({
type:"success",
message: "喜欢就好"
})
},
searchLabel(label) {
@ -224,15 +206,15 @@
}).then(({ value }) => {
this.$ajax.post("/hs/addMessage",{noticeId:sessionStorage.getItem("noticeId"),content:value,
createTime:getDate(),userId:JSON.parse(sessionStorage.getItem("userInfo")).user_id},r=>{
if (r.data === 1) {
this.$notify({
if (r === 1) {
this.$message({
type: 'success',
message: '留言成功'
});
this.$ajax.post("/hs/getOneContent", {
id: sessionStorage.getItem("noticeId")
}, r => {
this.message = r.data.message;
this.message = r.message;
for (let i = 0; i < this.message.length; i++) {
this.message[i].header_photo = this.message[i].real_name.substring(0, 1)
}
@ -240,8 +222,14 @@
}
});
this.$ajax.post("/hs/timingTask",{userId:JSON.parse(sessionStorage.getItem("userInfo")).user_id},r=>{
console.log(r)
});
})
}).catch(() => {
this.$message({
type: 'info',
message: '取消输入'
});
});
},
childEventHandler:function(res){
// resdata,mdValuehtmlValue
@ -252,39 +240,16 @@
this.dilogStatus=false;
},
handleChange(val) {
console.log(val);
},
},
components: {
footers,
markdown
},
}
</script>
<style lang="scss" scoped>
.article-read {
display: flex;
align-items: center;
.reading-volume {
font-size: 0.9rem;
color: #999999;
}
.collection {
margin-left: 1rem;
padding: 0.2rem;
color: #999999;
cursor: pointer;
}
.collection-active {
color: #00afff!important;
}
.collection:hover {
color: #00afff;
}
}
.index-right {
width: 16%;
position: fixed;
right: 5%;
}
.comment-one:hover .delete-my{
display: inline-block;
}
@ -496,10 +461,8 @@
padding: 0;
}
.el-aside{
/*margin-top: 1rem;*/
width: 14rem!important;
position: fixed;
top: 15rem;
right: 10%;
}
.el-main{
padding: 0;

View File

@ -10,17 +10,24 @@
</div>
<div class="indexContainer">
<mavon-editor
:placeholder="'开始创作···'"
:toolbars="toolbars"
:toolbarsBackground="'#f9f9f9'"
@change="change"
@imgAdd="imgAdd"
@imgDel="imgDel"
ref="md"
style="height: 70vh"
v-model="content"
/>
<div class="maskContainer" v-if="dilogStatus">
<div class="contentContainer">
<div class="closeBtnContainer" @click="closeMaskFn"></div>
<textarea class="showAreaContainer" v-model="msgShow" readonly></textarea>
</div>
</div>
<div class="editorContainer">
<markdown
:mdValuesP="msg.mdValue"
:fullPageStatusP="false"
:editStatusP="true"
:previewStatusP="true"
:navStatusP="true"
:icoStatusP="true"
@childevent="childEventHandler"
ref="markdown"
></markdown>
</div>
</div>
<el-button class="" type="primary" @click="publish"> </el-button>
<div class="notes">
@ -39,100 +46,68 @@
<script>
import {getDate} from "../assets/js/public";
import markdown from "./components/Mdeditor";
import footers from "./components/Footer";
export default {
name: "EditorContent",
data() {
return{
//
toolbars: {
bold: true, //
italic: true, //
header: true, //
underline: true, // 线
strikethrough: true, // 线
mark: true, //
superscript: true, //
subscript: true, //
quote: true, //
ol: true, //
ul: true, //
link: true, //
imagelink: true, //
code: true, // code
table: true, //
fullscreen: false, //
readmodel: false, //
htmlcode: true, // html
help: true, //
/* 1.3.5 */
undo: true, //
redo: true, //
trash: true, //
save: false, // eventssave
navigation: true, //
alignleft: true, //
aligncenter: true, //
alignright: true, //
subfield: true, //
preview: false //
},
label: "",
title:"",
type:'',
content:'',
msgShow:'我要显示的内容',
dilogStatus:false,
msg: {
mdValue:''
},
flag:false,
}
},
mounted() {
this.$ajax.post("/hs/getOneContent",{id:sessionStorage.getItem("noticeId")},r=>{
this.label = r.data.content.label;
this.title = r.data.content. title;
this.content = r.data.content.content
this.label = r.content.label;
this.title = r.content. title;
this.msg.mdValue = r. content.content
})
},
methods: {
imgAdd (pos, file) {
// ..
const formData = new FormData();
formData.append('image', file);
this.$ajax.post('/open/uploadImage', formData, res => {
this.$refs.md.$img2Url(pos, 'https://phy0412.top' + res.imgUrl)
})
},
imgDel (pos) {
delete this.img_file[pos]
},
change (value, render) {
this.html = render
},
goBack() {
this.$router.back(-1)
},
childEventHandler:function(res){
// resdata,mdValuehtmlValue
this.msg=res;
},
closeMaskFn:function(){
this.msgShow='';
this.dilogStatus=false;
},
handleChange(value) {
console.log(value);
},
publish() {
if (this.label.length !== 4) {
this.$notify({
if (this.label.length != 4) {
this.$message({
message: "文章标签只能为4个汉字",
type: "warning"
})
} else if (this.title === '') {
this.$notify({
} else if (this.title == '') {
this.$message({
message: "文章标题不能为空",
type: "warning"
})
} else if (this.content === '') {
this.$notify({
} else if (this.msg.mdValue == '') {
this.$message({
message: "编辑内容不能为空",
type: "warning"
})
} else {
this.$ajax.post("/hs/updateOneContent",{label:this.label,title:this.title,
content:this.html,content_md: this.content ,id:sessionStorage.getItem("noticeId")},r=>{
if (r.data === 1) {
this.$notify({
content:this.msg.mdValue,id:sessionStorage.getItem("noticeId")},r=>{
if (r === 1) {
this.$message({
type: "success",
message: "编辑成功"
})
@ -140,13 +115,14 @@
sessionStorage.setItem("noticeId",sessionStorage.getItem("noticeId"));*/
this.$router.back(-1)
} else {
this.$notify.error("编辑失败")
this.$message.error("编辑失败")
}
})
}
}
},
components: {
markdown,
footers
},
}

View File

@ -53,6 +53,7 @@
},
methods:{
handleClick(tab, event) {
console.log(tab, event);
}
},
components: {

View File

@ -12,21 +12,21 @@
</div>
<el-carousel indicator-position="outside">
<el-carousel-item v-for="(item,index) in rotationPhotoList" :key="index">
<img class="rotation-photo" :src='imgPath(item)'/>
<img :src="item.fileName" height="100%" width="100%"/>
</el-carousel-item>
</el-carousel>
</div>
</div>
<div id="bottom">
<div class="left">
<el-tabs v-model="activeName" v-loading="tabLoading">
<el-tabs v-model="activeName" @tab-click="" v-loading="tabLoading">
<el-tab-pane label="校园通知" name="first">
<div class="newest-notice module">
<div class="title">
<i class="el-icon-chat-dot-square"></i>
</div>
<div class="content">
<div class="one theme-font-blue" v-for="(item, index) in newestNotice" :data-id="item.id" :key='index'>
<div class="one theme-font-blue" v-for="item in newestNotice" :data-id="item.id" >
<div class="type" @click="searchLabel(item.label)">
[{{item.label}}]
</div>
@ -43,7 +43,7 @@
<i class="el-icon-chat-line-square"></i>
</div>
<div class="content">
<div class="one theme-font-blue" v-for="(item, index) in goodAdvice" :data-id="item.id" :key='index'>
<div class="one theme-font-blue" v-for="item in goodAdvice" :data-id="item.id">
<div class="type" @click="searchLabel(item.label)">[{{item.label}}]</div>
<div class="text" @click="getContent(item.id)">{{item.title}}</div>
<div class="release" @click="goPersonalInfo(item.user_id)">{{item.real_name}}</div>
@ -58,7 +58,7 @@
<i class="el-icon-chat-square"></i>
</div>
<div class="content">
<div class="one theme-font-blue" v-for="(item, index) in magicalThinking" :data-id="item.id" :key='index'>
<div class="one theme-font-blue" v-for="item in magicalThinking" :data-id="item.id">
<div class="type" @click="searchLabel(item.label)">[{{item.label}}]</div>
<div class="text" @click="getContent(item.id)">{{item.title}}</div>
<div class="release" @click="goPersonalInfo(item.user_id)">{{item.real_name}}</div>
@ -75,13 +75,11 @@
<i class="el-icon-trophy"></i>
</div>
<div class="one" v-for="(item, index) in prominentTeacher" :key='index'>
<el-tooltip class="item" effect="light" :content="item.userName" placement="top">
<div class="name theme-font-blue">{{item.userName}}老师</div>
</el-tooltip>
<el-tooltip class="item" effect="light" :content="item.post" placement="top">
<div class="class theme-font-blue">{{item.post}}</div>
</el-tooltip>
<div class="one" v-for="item in prominentTeacher">
<div class="name theme-font-blue">{{item.name}}老师</div>
<!-- <div class="subject theme-font-blue">数学</div>-->
<!-- <div class="grade theme-font-blue">2016</div>-->
<div class="class theme-font-blue">{{item.class}}</div>
</div>
</div>
<div class="merit-student">
@ -89,13 +87,10 @@
<i class="el-icon-trophy-1"></i>
</div>
<div class="one" v-for="(item, index) in meritStudent" :key='index'>
<el-tooltip class="item" effect="light" :content="item.userName" placement="top">
<div class="name theme-font-blue">{{item.userName}}同学</div>
</el-tooltip>
<el-tooltip class="item" effect="light" :content="item.post" placement="top">
<div class="class theme-font-blue">{{item.post}}</div>
</el-tooltip>
<div class="one" v-for="item in meritStudent">
<div class="name theme-font-blue">{{item.name}}同学</div>
<!-- <div class="grade theme-font-blue">2016</div>-->
<div class="subject theme-font-blue">{{item.class}}</div>
</div>
</div>
</div>
@ -105,9 +100,7 @@
</template>
<script>
import { listWinners } from "@/api/admin/winners";
export default {
export default {
name: "Hompage",
data() {
return{
@ -119,52 +112,91 @@
goodAdvice: '',
magicalThinking: '',
activeName: 'first',
prominentTeacher: [],
meritStudent: [],
prominentTeacher: [
{
id: '',
name: '张伟',
class: '2016届物联网一班',
},
{
id: '',
name: '吕小布',
class: '2016届物联网二班',
},
{
id: '',
name: '李星',
class: '大数据一班',
},
{
id: '',
name: '吴达',
class: '软件外包一班',
},
{
id: '',
name: '田七',
class: '机算计科学与技术一班',
},
],
meritStudent: [
{
id: '',
name: '王阔',
class: '2016届物联网一班',
},
{
id: '',
name: '于洋',
class: '2016届生物医学1班',
},
{
id: '',
name: '冯宇',
class: '2016届大数据一班',
},
{
id: '',
name: '刘强',
class: '2016届软件外包一班',
},
{
id: '',
name: '张智超',
class: '2016届护理一班',
},
],
}
},
mounted() {
this.getRotationPhotoList();
this.getNoticeList();
this.getWinnerList()
},
methods: {
/**
* 获取获奖人员
*/
getWinnerList() {
listWinners().then(res => {
if (res.data.data.length > 0) {
res.data.data.forEach(item => {
if (item.type === '优秀教师') {
this.prominentTeacher.push(item)
} else if (item.type === '三好学生') {
this.meritStudent.push(item)
}
})
}
})
},
/**
* 图片地址
*/
imgPath(item) {
return `${sessionStorage.getItem('url')}/hs/showImg/${item.fileEncryption}`
},
//
getNoticeList() {
this.tabLoading = true;
this.$ajax.post("/hs/getAllContent",{},r=>{
this.tabLoading = false;
this.newestNotice = r.data.schoolNoticeList.slice(0,12);
this.goodAdvice = r.data.parentAdvice.slice(0,12);
this.magicalThinking = r.data.studentThinking.slice(0,12);
this.newestNotice = r.schoolNoticeList.slice(0,12);
this.goodAdvice = r.parentAdvice.slice(0,12);
this.magicalThinking = r.studentThinking.slice(0,12);
})
},
//
getRotationPhotoList() {
this.$ajax.post('/hs/getRotationPhotoList',{},res=>{
this.rotationPhotoList = res.data.rotationPhotoList;
console.log("轮播图列表",res);
this.rotationPhotoList = [];
for (let i = 0; i < res.rotationPhotoList.length; i++) {
this.rotationPhotoList.push(
{
id: res.rotationPhotoList[i].id,
fileId: res.rotationPhotoList[i].fileId,
fileName: require('../assets/img/carousel/'+res.rotationPhotoList[i].fileName)},
);
}
console.log("rotationPhotoList",this.rotationPhotoList)
})
},
searchLabel(label) {
@ -188,11 +220,6 @@
</script>
<style scoped>
.rotation-photo{
object-fit: contain;
width: 100%;
height: 100%;
}
.el-main{
padding: 0.5rem 1rem;
}

View File

@ -8,8 +8,6 @@
<span class="pointer special-font-blue " v-if="isLogin" @click="goPersonalInfo(userInfo.user_id)">欢迎{{userInfo.real_name}}{{userInfo.user_type}}</span>
<span class="pointer special-font-blue " v-if="isLogin" @click="cancellation">注销</span>
<el-divider direction="vertical"></el-divider>
<span class="pointer special-font-blue " v-if="userInfo.user_type === '管理员'" @click="admin">后台管理</span>
<el-divider direction="vertical"></el-divider>
<span class="pointer special-font-blue" @click="service">客服中心</span>
<el-divider direction="vertical"></el-divider>
<span class="pointer special-font-blue" @click="opinion">用户意见</span>
@ -18,7 +16,7 @@
<el-divider direction="vertical" v-if="!isLogin"></el-divider>
<span class="pointer special-font-blue" v-if="isLogin" @click="forget">忘记密码</span>
<el-divider direction="vertical" v-if="isLogin"></el-divider>
<span class="pointer special-font-blue" @click="goToPage('help')">帮助中心</span>
<span class="pointer special-font-blue" @click="help">帮助中心</span>
</div>
</div>
</el-header>
@ -27,8 +25,12 @@
<el-menu
default-active="1"
class="el-menu-vertical-demo">
<el-menu-item :key="item.index" :index="item.path" @click="goToPage(item.path)" v-for="item in menuList">{{item.name}}</el-menu-item>
<el-menu-item index="100" @click="goMore" disabled>更多···</el-menu-item>
<el-menu-item index="1" @click="goHomepage">首页</el-menu-item>
<el-menu-item index="2" @click="goSchoolNotice">校园通知</el-menu-item>
<el-menu-item index="3" @click="goMyClass">我的班级</el-menu-item>
<el-menu-item index="4" @click="goParentsOpinion">家长意见</el-menu-item>
<el-menu-item index="5" @click="goStudentThought">学生想法</el-menu-item>
<el-menu-item index="6" @click="goMore" disabled>更多···</el-menu-item>
</el-menu>
</el-aside>
<el-main>
@ -50,14 +52,6 @@
real_name: '',
user_type: '',
},
//
menuList: [
{name: '首页', path: 'homepage', index: '1'},
{name: '校园通知', path: 'schoolnotice', index: '2'},
{name: '我的班级', path: 'myclass', index: '3'},
{name: '家长意见', path: 'parentsproposal', index: '4'},
{name: '学生想法', path: 'studentthought', index: '5'},
]
}
},
mounted() {
@ -65,7 +59,7 @@
/*setInterval(()=>{
this.timingTask(userInfo.user_id)
},60000);*/
if (userInfo === '' || userInfo === null) {
if (userInfo == '' || userInfo === null) {
} else {
this.isLogin = true;
@ -80,14 +74,9 @@
+day2.getMinutes():day2.getMinutes())+"分"+(day2.getSeconds()<10?"0"+day2.getSeconds():day2.getSeconds())+"";},1000)
},
methods:{
/**
* 跳转到后台管理模式
*/
admin() {
this.$router.push({name: 'homepagemanagement'});
},
timingTask(userId) {
this.$ajax.post("/hs/timingTask",{userId:userId},r=>{
console.log(r)
})
},
goPersonalInfo(userId) {
@ -96,22 +85,42 @@
this.$refs.child.getUserInfo();
},
goMore() {
this.$notify("期待更多内容",)
this.$message({
message:"期待更多内容",
})
},
goToPage(path) {
if (path === 'myclass') {
if (JSON.parse(sessionStorage.getItem("userInfo")).class_name === undefined) {
this.$message.warning("您没有加入任何班级")
} else {
this.$router.push({name: path})
}
goMyClass() {
if (JSON.parse(sessionStorage.getItem("userInfo")).class_name === undefined) {
this.$message.warning("您没有加入任何班级")
} else {
this.$router.push({name: path})
if (this.isLogin === true) {
this.$router.push({name: "myclass"})
} else {
this.$message.warning("请先登录")
this.$router.push({name: "login"})
}
}
},
goStudentThought() {
this.$router.push({name: "studentthought"})
},
goParentsOpinion() {
this.$router.push({name: "parentsproposal"})
},
goSchoolNotice() {
this.$router.push({name: "schoolnotice"})
},
goHomepage() {
this.$router.push({name: "homepage"})
},
help() {
this.$router.push({
name: "help",
})
},
forget() {
this.$notify("请联系管理员重置密码")
this.$message("请联系管理员重置密码")
},
register() {
this.$router.push({
@ -122,10 +131,10 @@
})
},
opinion() {
this.$notify('用户意见请发邮箱至617594538@qq.com')
this.$message('用户意见请发邮箱至617594538@qq.com')
},
service() {
this.$notify('客服中心请拨打15006732580')
this.$message('客服中心请拨打15006732580')
},
login() {
this.$router.push({
@ -144,7 +153,10 @@
})
// location.reload()
}).catch(() => {
this.$notify.info('已取消退出');
this.$message({
type: 'info',
message: '已取消退出'
});
});
}
},
@ -165,8 +177,6 @@
margin-top: 1rem;
text-align: center;
height: 21rem;
position: sticky;
top: 1rem;
}
.el-radio-group{
margin-bottom: 0!important;

View File

@ -13,7 +13,7 @@
close-on-click-modal=false
label-position="left">
<el-form-item label="角色" prop="role">
<el-select v-model="form.role" placeholder="请选择角色">
<el-select v-model="form.role" placeholder="请选择">
<el-option :value="item.dd_detail" v-for="(item,index) in userTypeList" :key="index"></el-option>
</el-select>
</el-form-item>
@ -35,7 +35,7 @@
<span style="float: right; color: #8492a6; font-size: 13px" @click="deleteUser(item.username,index)"><i class="el-icon-circle-close"></i></span>
</el-option>
</el-select>-->
<el-input v-model="form.username" type="text" placeholder="请输入手机号"></el-input>
<el-input v-model="form.username" type="text" placeholder="请输入手机号或姓名"></el-input>
</el-form-item>
<el-form-item label="密码" prop="password">
<el-input v-model="form.password" type="password" placeholder="请输入密码" @keyup.enter.native="login"></el-input>
@ -55,22 +55,23 @@
close-on-click-modal=false
label-position="left">
<el-form-item label="角色" prop="role">
<el-select v-model="form1.role" placeholder="请选择角色">
<el-select v-model="form1.role" placeholder="请选择">
<!-- <el-option value="学生"></el-option>-->
<el-option value="家长"></el-option>
<el-option value="教师"></el-option>
</el-select>
</el-form-item>
<el-form-item label="姓名" prop="realName">
<el-input v-model="form1.realName" placeholder="请输入姓名" type="text"></el-input>
<el-input v-model="form1.realName" type="text"></el-input>
</el-form-item>
<el-form-item label="手机号" prop="mobile">
<el-input v-model="form1.mobile" placeholder="请输入手机号" type="text"></el-input>
<el-input v-model="form1.mobile" type="text"></el-input>
</el-form-item>
<el-form-item label="密码" prop="password">
<el-input v-model="form1.password" placeholder="请输入密码" type="password"></el-input>
<el-input v-model="form1.password" type="password"></el-input>
</el-form-item>
<el-form-item label="确认密码" prop="againPassword" @keyup.enter.native="register">
<el-input v-model="form1.againPassword" placeholder="请确认密码" type="password"></el-input>
<el-input v-model="form1.againPassword" type="password"></el-input>
</el-form-item>
<el-button type="primary" @click="register"> </el-button>
</el-form>
@ -94,7 +95,7 @@
}
}
let type;
if (this.$route.params.type === "login" || this.$route.params.type === "register") {
if (this.$route.params.type == "login" || this.$route.params.type == "register") {
type = this.$route.params.type
} else {
type = "login"
@ -196,32 +197,30 @@
*/
getUserType() {
this.$ajax.post('/hs/getDictionariesData',{code: 'userType'},res => {
this.userTypeList = res.data;
console.log('用户类型字典项', res);
this.userTypeList = res;
})
},
forget() {
this.$notify("请联系管理员重置密码")
this.$message("请联系管理员重置密码")
},
login() {
this.loading = true;
this.$ajax.post("/hs/login",{role:this.form.role,username: this.form.username,password:this.form.password},r=>{
if (r.data === '' || r.data === null) {
this.$notify.error('用户名和密码不匹配');
} else if (r.data.take_effect === '0') {
this.$notify.error('该账户未通过审核');
} else if (r.data.frozen_state === '1') {
this.$notify.error('该账户已冻结');
if (r == '' || r == null) {
this.$message.error('用户名和密码不匹配');
this.loading = false;
} else {
if (this.form.role === '管理员') {
this.$router.push({
name: "homepagemanagement"
name: "admin"
})
} else {
this.$router.push({
name: "homepage"
})
}
this.$notify({
this.$message({
message: "登录成功",
type: "success"
});
@ -250,20 +249,21 @@
sessionStorage.setItem("rememberList",JSON.stringify(rememberList));
}
}*/
sessionStorage.setItem("userInfo",JSON.stringify(r.data));
this.loading = false;
sessionStorage.setItem("userInfo",JSON.stringify(r));
// location.reload();
}
this.loading = false;
})
},
register() {
this.$ajax.post("/hs/register",{type:this.form1.role,realname:this.form1.realName,mobile:this.form1.mobile,password:this.form1.password},r=>{
if (r.data === 0) {
this.$notify.error('该手机号已被注册');
console.log(r)
if (r == '0') {
this.$message.error('该手机号已被注册');
this.form1.password = '';
this.form1.againPassword = '';
} else {
this.$notify({
this.$message({
message: "注册成功",
type: "success"
});

View File

@ -1,15 +1,15 @@
<template>
<el-container>
<el-main>
<el-page-header @back="goBack" content="发布班级通知" v-if="addClassNotice"/>
<el-page-header @back="goBack" content="发布班级通知" v-if="addClassNotice"></el-page-header>
<addArticle
v-if="addClassNotice"
@editorTitle="editorTitle"
@goInfo="goInfo"
@refresh="refresh"
/>
></addArticle>
<div class="search" v-if="!addClassNotice">
<el-input class="searchinp" v-model="condition" placeholder="请输入内容" @keydown.enter.native="search"/>
<el-input class="searchinp" v-model="condition" placeholder="请输入内容" @keydown.enter.native="search"></el-input>
<el-button type="primary" class="searchbtn" @click="search">搜索</el-button>
</div>
<div class="class-bulletin" v-if="!addClassNotice">
@ -22,23 +22,21 @@
<el-button class="editor" @click="editor">编辑</el-button>
</div>
</div>
<div class="list" v-loading="loading">
<div class="list" v-if="!addClassNotice">
<div class="title">班级通知</div>
<el-button class="releasebut" size="small" @click="release" plain>发布通知</el-button>
<nodate v-if="noDate"/>
<div class="list-in-box" v-if="!addClassNotice && !noDate">
<div class="one" v-for="item in noticeList">
<div class="type">[{{item.label}}]</div>
<div class="text" @click="getContent(item.id)">{{item.title}}</div>
<div class="release" @click="goPersonalInfo(item.user_id)">{{item.real_name}}</div>
<div class="release-time">{{item.release_time}}</div>
</div>
<p class="sum" v-if="!noDate">{{length}}条数据</p>
<nodate v-if="noDate"></nodate>
<div class="one" v-for="item in noticeList" v-if="!noDate">
<div class="type">[{{item.label}}]</div>
<div class="text" @click="getContent(item.id)">{{item.title}}</div>
<div class="release" @click="goPersonalInfo(item.user_id)">{{item.real_name}}</div>
<div class="release-time">{{item.release_time}}</div>
</div>
<p class="sum" v-if="!noDate">{{length}}条数据</p>
</div>
</el-main>
<el-aside>
<div class="title">班级成员 <span v-if="userInfo.post==='班主任'" class="admin" @click="drawer=true">管理</span></div>
<div class="title">班级成员</div>
<div class="students">
<div class="student" v-for="item in students">
<div class="header pointer">{{item.real_name.substring(0,1)}}</div>
@ -67,170 +65,19 @@
<el-button type="primary" @click="bulletinSubmit"> </el-button>
</span>
</el-dialog>
<el-drawer
:title="userInfo.class_name"
:visible.sync="drawer"
custom-class="class-table-box"
direction="ltr">
<div class="class-table" style="padding: 1rem;">
<el-table :data="students">
<el-table-column label="序号" width="80" align="center">
<template slot-scope="scope">
<span>{{scope.$index + 1}}</span>
</template>
</el-table-column>
<el-table-column label="学号" align="center">
<template slot-scope="scope">
<span v-if="scope.row.post==='班主任'">{{scope.row.student_number}}</span>
<el-input v-if="scope.row.post!=='班主任'"
size="mini"
@change="editStudentNumber($event, scope.row)"
v-model="scope.row.student_number"
placeholder="请输入学号"/>
</template>
</el-table-column>
<el-table-column label="姓名" align="center" prop="real_name" />
<el-table-column label="职务" align="center" prop="post" >
<template slot-scope="scope">
<span v-if="scope.row.post==='班主任'">{{scope.row.post}}</span>
<el-select v-if="scope.row.post!=='班主任'"
v-model="scope.row.post"
filterable
size="mini"
allow-create
default-first-option
@change="changePost($event, scope.row)"
placeholder="请选择职务">
<el-option
v-for="item in postList"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</template>
</el-table-column>
<el-table-column label="手机号" align="center" prop="mobile" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<div style="display:flex;justify-content: flex-end;margin: 1rem">
<el-button type="primary" @click="addStudent">添加学生</el-button>
</div>
</div>
</el-drawer>
<el-dialog
title="添加学生"
:visible.sync="addStudentFlag"
width="50%">
<div class="student-list">
<div class="button">
<el-button type="primary" @click="registerFlag=true">添加学生</el-button>
</div>
<div class="search">
<el-input v-model="searchCode" placeholder="请输入学生姓名" @change="getNoClassStudent"/>
</div>
<el-table
:data="noClassStudent"
style="width: 100%">
<el-table-column label="姓名" align="center" prop="real_name" />
<el-table-column label="性别" align="center" >
<template slot-scope="scope">
<span>{{scope.row.sex || '未填写'}}</span>
</template>
</el-table-column>
<el-table-column label="年级" align="center" prop="grade" />
<el-table-column label="手机号" align="center" prop="mobile" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleAdd(scope.row)"
>添加</el-button>
</template>
</el-table-column>
</el-table>
</div>
</el-dialog>
<el-dialog
title="学生注册"
:visible.sync="registerFlag"
width="40%">
<el-form :model="registerForm"
:rules="registerRules"
ref="form1"
label-width="80px"
class="demo-ruleForm"
close-on-click-modal=false
label-position="left">
<el-form-item label="姓名" prop="realname">
<el-input v-model="registerForm.realname" type="text"></el-input>
</el-form-item>
<el-form-item label="手机号" prop="mobile">
<el-input v-model="registerForm.mobile" type="text"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="registerStudent"> </el-button>
</span>
</el-dialog>
</el-container>
</template>
<script>
import { register, getPostList } from '@/api/index/user'
import { getDate } from '../assets/js/public.js'
import nodate from './components/NoData'
import addArticle from './AddArticle'
export default {
name: "MyClass",
data() {
return{//
loading: false,
registerForm: {
type: '学生',
realname: '',
mobile: '',
username: '',
password: '123456',
takeEffect: '1'
},
registerRules: {
realname: [
{ required: true, message: '请输入真实姓名', trigger: 'blur' },
{ min: 2, max: 10, message: '请输入正确的姓名', trigger: 'blur' }
],
mobile: [
{ required: true, message: '请输入手机号', trigger: 'blur' },
{ min: 11, max: 11, message: '手机号格式不正确', trigger: 'blur' }
],
},
//
registerFlag: false,
//
searchCode: '',
//
addStudentFlag: false,
//
postList: [
{label: '班长', value: '班长'},
{label: '团支书', value: '团支书'},
{label: '副班长', value: '副班长'},
],
//
drawer: false,
userInfo: JSON.parse(sessionStorage.getItem("userInfo")),
return{
addClassNotice: false,
noDate: false,
condition: '',
@ -244,205 +91,43 @@
},
noticeList: '',
length: '',
students: [],
//
noClassStudent: [],
students: '',
isNull: false,
dialogVisible: false,
}
},
mounted() {
this.getPostList();
this.getPageDate()
},
watch: {
addClassNotice(oldValue, newValue) {
if (newValue === true) {
this.getPageDate()
}
}
},
methods: {
/**
* 获取职务列表
*/
getPostList() {
getPostList({className: this.userInfo.class_name}).then(res => {
if (res.data.data.length > 0) {
res.data.data.forEach(item => {
if (!(item.post === '班长' || item.post === '副班长' || item.post === '团支书')) {
this.postList.push({
label: item.post, value: item.post
})
}
})
}
this.postList = this.postList.filter(post => {
return post.label !== '班主任'
});
let obj = {};
this.postList = this.postList.reduce((item, next) => {
if (!obj[next.label]) {
obj[next.label] = item.push(next)
}
return item;
}, [])
})
},
/**
* 注册学生
*/
registerStudent() {
register(this.registerForm).then(res => {
if (res.data.data > 0) {
this.getNoClassStudent();
this.registerForm = {
type: '学生',
realname: '',
mobile: '',
username: '',
password: '123456',
takeEffect: '1'
};
this.registerFlag = false
}
})
},
/**
* 修改学生学号
*/
editStudentNumber(studentNumber, row) {
if (studentNumber === '') {
this.$notify.error('学号不能为空!')
let userInfo = JSON.parse(sessionStorage.getItem("userInfo"))
this.$ajax.post("/hs/getClassInfo",{id:userInfo.user_id},r=>{
if (r.bulletin == null) {
this.isNull = true;
} else {
this.$ajax.post('/hs/updatePersonalInfo',
{studentNumber: studentNumber, userId: row.user_id}, res => {
if (res.data > 0) {
this.$notify.success('修改成功');
this.getPageDate()
} else {
this.$notify.error('网络异常,请刷新页面重新尝试')
}
})
this.bulletin = r.bulletin;
}
},
/**
* 将学生加入该班级
*/
handleAdd(row) {
this.$ajax.post('/hs/updatePersonalInfo',
{className: this.userInfo.class_name, userId: row.user_id}, res => {
if (res.data > 0) {
this.addStudentFlag = false;
this.$notify.success('添加成功');
this.getPageDate()
} else {
this.$notify.error('网络异常,请刷新页面重新尝试')
}
})
},
/**
* 打开未加入班级学生
*/
addStudent() {
this.addStudentFlag = true;
this.getNoClassStudent();
},
/**
* 获取未加入班级的学生
*/
getNoClassStudent() {
this.$ajax.post('/admin/getPersonnelManagement', {
name: this.searchCode, userType: '学生', className: ''
}, res => {
this.noClassStudent = res.data
})
},
getPageDate() {
this.loading = true;
this.$ajax.post("/hs/getClassInfo",{id:this.userInfo.user_id},r=>{
if (r.data.bulletin == null) {
this.isNull = true;
} else {
this.bulletin = r.data.bulletin;
}
this.noticeList = r.data.noticeList;
this.length = r.data.noticeList.length;
let studentList = r.data.students;
studentList.forEach(item => {
if (item.post === '班主任') {
item.index = 1
} else if (item.post === '班长') {
item.index = 2
} else if (item.post === '团支书') {
item.index = 3
} else if (item.post === '副班长') {
item.index = 4
} else if (item.post === '同学') {
item.index = 6
} else if (item.post === '' || item.post === undefined) {
item.index = 7
} else {
item.index = 5
}
});
this.students = studentList.sort((a, b) => {return a.index - b.index});
if (r.data.noticeList.length === 0) {
this.noDate = true
}
this.loading = false;
})
},
/**
* 改变学生职务
*/
changePost(post, row) {
this.$ajax.post('/hs/updatePersonalInfo',
{post: post, userId: row.user_id}, res => {
if (res.data > 0) {
this.dialogVisible = false;
this.$notify.success('修改成功');
this.getPostList()
} else {
this.$notify.error('网络异常,请刷新页面重新尝试')
}
})
},
/**
* 删除学生信息
*/
handleDelete(row) {
this.$confirm(`确认将${row.real_name}同学移除班级`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$ajax.post('/hs/updatePersonalInfo',
{className: '', userId: row.user_id}, res => {
if (res.data > 0) {
this.getPageDate();
this.$notify.success('删除成功');
} else {
this.$notify.error('网络异常,请刷新页面重新尝试')
}
})
})
},
this.noticeList = r. noticeList;
this.length = r. noticeList.length;
this.students = r.students;
if (r. noticeList.length === 0) {
this.noDate = true
}
})
},
methods: {
goBack() {
this.addClassNotice = false
},
refresh() {
let userInfo = JSON.parse(sessionStorage.getItem("userInfo"))
this.$ajax.post("/hs/getClassInfo",{id:userInfo.user_id},r=>{
if (r.data.bulletin == null) {
if (r.bulletin == null) {
this.isNull = true;
} else {
this.bulletin = r.data.bulletin;
this.bulletin = r.bulletin;
}
this.noticeList = r.data. noticeList;
this.length = r.data. noticeList.length;
this.students = r.data.students;
if (r.data.noticeList.length === 0) {
this.noticeList = r. noticeList;
this.length = r. noticeList.length;
this.students = r.students;
if (r. noticeList.length === 0) {
this.noDate = true
}
})
@ -455,24 +140,25 @@
},
release() {
let userInfo = JSON.parse(sessionStorage.getItem("userInfo"))
if (userInfo.post === "班主任" || userInfo.post === "班长") {
this.addClassNotice = true;
if (userInfo.user_type === "教师") {
this.addClassNotice = true
sessionStorage.setItem("releaseType","classNotice")
} else {
this.$notify.error("没有权限发布通知")
this.$message.error("没有权限发布通知")
}
},
bulletinSubmit() {
let userInfo = JSON.parse(sessionStorage.getItem("userInfo"))
if (this.isNull === false) {
this.$ajax.post("/hs/updateBulletin",{classId:userInfo.class_id,
className:userInfo.class_name,title:this.editors.title,content:this.editors.content,id:this.bulletin.id},r=>{
if (r.data === 1) {
className:userInfo.class_name,title:this.editors.title,content:this.editors.content,
releaseTime:getDate(),id:this.bulletin.id},r=>{
if (r === 1) {
let userInfo = JSON.parse(sessionStorage.getItem("userInfo"))
this.$ajax.post("/hs/getClassInfo",{id:userInfo.user_id},r=>{
this.bulletin = r.data.bulletin;
this.bulletin = r.bulletin;
})
this.$notify({
this.$message({
type:'success',
message: '编辑公告成功'
})
@ -482,12 +168,12 @@
this.$ajax.post("/hs/addBulletin",{classId:userInfo.class_id,
className:userInfo.class_name,title:this.editors.title,content:this.editors.content,
releaseTime:getDate()},r=>{
if (r.data === 1) {
if (r === 1) {
let userInfo = JSON.parse(sessionStorage.getItem("userInfo"))
this.$ajax.post("/hs/getClassInfo",{id:userInfo.user_id},r=>{
this.bulletin = r.data.bulletin;
this.bulletin = r.bulletin;
})
this.$notify({
this.$message({
type:'success',
message: '编辑公告成功'
})
@ -498,20 +184,20 @@
},
editor() {
let userInfo = JSON.parse(sessionStorage.getItem("userInfo"))
if (userInfo.user_type === "教师" || userInfo.post === '班主任' || userInfo.post === '班长') {
if (userInfo.user_type === "教师") {
this.dialogVisible = true;
this.editors.title = this.bulletin.title;
this.editors.content = this.bulletin.content;
} else {
this.$notify.error("没有权限编辑公告")
this.$message.error("没有权限编辑公告")
}
},
search() {
let userInfo = JSON.parse(sessionStorage.getItem("userInfo"))
sessionStorage.setItem("condition",this.condition)
this.$ajax.post("/hs/getClassInfo",{id:userInfo.user_id,text:this.condition},r=>{
this.noticeList = r.data.noticeList
this.length = r.data.noticeList.length
this.noticeList = r. noticeList
this.length = r. noticeList.length
})
},
getContent(id) {
@ -531,30 +217,7 @@
}
</script>
<style lang="scss" scoped>
.student-list {
.button {
display: flex;
justify-content: flex-end;
margin-bottom: 1rem;
}
.search {
margin: 0;
}
.one-student {
margin: 1rem;
border-bottom: 1px solid #00afff;
display: flex;
justify-content: space-between;
align-items: center;
color: #4d4d4d;
}
}
.title .admin {
font-size: 0.9rem;
color: #00afff;
cursor: pointer;
}
<style scoped>
.el-page-header{
padding: 1rem;
background: #fff;
@ -584,9 +247,6 @@
padding: 1rem;
font-size: 1.5rem;
}
.list {
min-height: 10rem;
}
.list .title{
padding-bottom: 1rem;
font-size: 1.5rem;
@ -693,7 +353,6 @@
line-height: 1.5rem;
margin-left: 0.5rem;
flex: 1;
white-space: nowrap;
}
.student .post{
line-height: 1.5rem;

View File

@ -7,16 +7,14 @@
</div>
<div class="list">
<div class="title">家长建议</div>
<div class="list-box" v-loading="loading">
<nodate v-if="noDate"></nodate>
<div class="one" v-for="item in adviceList" v-if="!noDate">
<div class="type">[{{item.label}}]</div>
<div class="text" @click="getContent(item.id)">{{item.title}}</div>
<div class="release" @click="goPersonalInfo(item.user_id)">{{item.real_name}}</div>
<div class="release-time">{{item.release_time}}</div>
</div>
<p class="sum" v-if="!noDate">{{length}}条数据</p>
<nodate v-if="noDate"></nodate>
<div class="one" v-for="item in adviceList" v-if="!noDate">
<div class="type">[{{item.label}}]</div>
<div class="text" @click="getContent(item.id)">{{item.title}}</div>
<div class="release" @click="goPersonalInfo(item.user_id)">{{item.real_name}}</div>
<div class="release-time">{{item.release_time}}</div>
</div>
<p class="sum" v-if="!noDate">{{length}}条数据</p>
</div>
</el-main>
<el-aside>
@ -33,8 +31,6 @@
name: "ParentsOpinion",
data() {
return{
//
loading: false,
condition: '',
adviceList: '',
length: '',
@ -42,22 +38,20 @@
}
},
mounted() {
this.loading = true;
this.$ajax.post("/hs/getListByAttribute",{text:"",type:"家长建议"},r=>{
this.adviceList = r.data
this.length = r.data.length
if (r.data.length === 0) {
this.adviceList = r
this.length = r.length
if (r.length === 0) {
this.noDate = true
}
this.loading = false;
})
},
methods: {
search() {
this.$ajax.post("/hs/getListByAttribute",{text:this.condition,type:"家长建议"},r=>{
this.adviceList = r
this.length = r.data.length
if (r.data.length === 0) {
this.length = r.length
if (r.length === 0) {
this.noDate = true
}
})

File diff suppressed because it is too large Load Diff

View File

@ -20,7 +20,7 @@
:visible.sync="dialogVisible"
width="40%">
<div class="list">
<div class="one" v-for="(item, index) in list" :key='index'>
<div class="one" v-for="item in list" >
<div class="type">[{{item.label}}]</div>
<div class="text" @click="getContent(item.id)">{{item.title}}</div>
<div class="release" @click="goPersonalInfo(item.user_id)">{{item.real_name}}</div>
@ -52,10 +52,10 @@
mounted() {
this.$ajax.post("/hs/getListByAttribute",{type:"校园通知",text:''},r=>{
let list = [];
for (let i = 0; i < r.data.length; i++) {
for (let i = 0; i < r.length; i++) {
let one = {};
one.date = r.data[i].release_time.substring(0,10);
one.content = r.data[i].label;
one.date = r[i].release_time.substring(0,10);
one.content = r[i].label;
list.push(one)
}
this.resDate = list
@ -76,10 +76,11 @@
},
getDay(date) {
this.dialogVisible = true
console.log(date)
this.$ajax.post("/hs/getListByAttribute",{release_time: date.day,text: '',type:"校园通知"},
r=> {
this.list = r.data;
this.length = r.data.length;
this.list = r;
this.length = r.length;
})
},
dealMyDate(v) {

View File

@ -7,16 +7,14 @@
</div>
<div class="list">
<div class="title">学生想法</div>
<div class="list-box" v-loading="loading">
<nodate v-if="noDate"/>
<div class="one" v-for="item in thinkingList" v-if="!noDate">
<div class="type">[{{item.label}}]</div>
<div class="text" @click="getContent(item.id)">{{item.title}}</div>
<div class="release" @click="goPersonalInfo(item.user_id)">{{item.real_name}}</div>
<div class="release-time">{{item.release_time}}</div>
</div>
<p class="sum" v-if="!noDate">{{length}}条数据</p>
<nodate v-if="noDate"></nodate>
<div class="one" v-for="item in thinkingList" v-if="!noDate">
<div class="type">[{{item.label}}]</div>
<div class="text" @click="getContent(item.id)">{{item.title}}</div>
<div class="release" @click="goPersonalInfo(item.user_id)">{{item.real_name}}</div>
<div class="release-time">{{item.release_time}}</div>
</div>
<p class="sum" v-if="!noDate">{{length}}条数据</p>
</div>
</el-main>
<el-aside>
@ -33,8 +31,7 @@
name: "StudentThought",
data() {
return{
//
loading: false,
noDate: '',
condition: '',
thinkingList: '',
length: '',
@ -42,19 +39,17 @@
}
},
mounted() {
this.loading = true;
this.$ajax.post("/hs/getListByAttribute",{text:"",type:"学生想法"},r=>{
this.thinkingList = r.data;
this.length = r.data.length;
this.loading = false
this.thinkingList = r
this.length = r.length
})
},
methods: {
search() {
this.$ajax.post("/hs/getListByAttribute",{text:this.condition,type:"学生想法"},r=>{
this.thinkingList = r.data
this.length = r.data.length
if (r.data.length === 0) {
this.thinkingList = r
this.length = r.length
if (r.length === 0) {
this.noDate = true
}
})

View File

@ -1,100 +0,0 @@
<template>
<div :class="{'hidden':hidden}" class="pagination-container">
<el-pagination
:background="background"
:current-page.sync="currentPage"
:page-size.sync="pageSize"
:layout="layout"
:page-sizes="pageSizes"
:total="total"
v-bind="$attrs"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
</div>
</template>
<script>
import { scrollTo } from '@/util/scroll-to'
export default {
name: 'Pagination',
props: {
total: {
required: true,
type: Number
},
page: {
type: Number,
default: 1
},
limit: {
type: Number,
default: 20
},
pageSizes: {
type: Array,
default() {
return [10, 20, 30, 50]
}
},
layout: {
type: String,
default: 'total, sizes, prev, pager, next, jumper'
},
background: {
type: Boolean,
default: true
},
autoScroll: {
type: Boolean,
default: true
},
hidden: {
type: Boolean,
default: false
}
},
computed: {
currentPage: {
get() {
return this.page
},
set(val) {
this.$emit('update:page', val)
}
},
pageSize: {
get() {
return this.limit
},
set(val) {
this.$emit('update:limit', val)
}
}
},
methods: {
handleSizeChange(val) {
this.$emit('pagination', { page: this.currentPage, limit: val })
if (this.autoScroll) {
scrollTo(0, 800)
}
},
handleCurrentChange(val) {
this.$emit('pagination', { page: val, limit: this.pageSize })
if (this.autoScroll) {
scrollTo(0, 800)
}
}
}
}
</script>
<style scoped>
.pagination-container {
padding: 32px 16px;
}
.pagination-container.hidden {
display: none;
}
</style>

View File

@ -6,20 +6,15 @@ import 'element-ui/lib/theme-chalk/index.css'
import App from './App'
import router from './router'
import '@/assets/css/public.css'
// 引用API文件
import api from './api/index.js'
import axios from 'axios'
import Pagination from "@/components/components/Pagination";
import scroll from 'vue-scroll'
import mavonEditor from 'mavon-editor'
import 'mavon-editor/dist/css/index.css'
import { getDict } from '@/api/system/dict'
Vue.prototype.getDict = getDict;
Vue.prototype.$axios = axios;
// 将API方法绑定到全局
import marked from 'marked'
import scroll from 'vue-scroll'
Vue.prototype.$ajax = api;
Vue.component('Pagination', Pagination);
Vue.config.productionTip = false;
Vue.use(mavonEditor);
Vue.use(ElementUI);
Vue.use(scroll);
/* eslint-disable no-new */

View File

@ -34,11 +34,6 @@ export default new Router({
path: '/homepagemanagement',
name: 'homepagemanagement',
component:() => import('@/view/admin/homepageManagement/HomepageManagement')
},
{
path: '/helpreply',
name: 'helpreply',
component:() => import('@/view/admin/helpReply/HelpReply')
}
]
},

View File

@ -1,12 +0,0 @@
import axios from 'axios'
axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8'
// 创建axios实例
const service = axios.create({
// axios中请求配置有baseURL选项表示请求URL公共部分
baseURL: sessionStorage.getItem('url'),
// 超时
timeout: 300000
});
export default service

View File

@ -1,58 +0,0 @@
Math.easeInOutQuad = function(t, b, c, d) {
t /= d / 2
if (t < 1) {
return c / 2 * t * t + b
}
t--
return -c / 2 * (t * (t - 2) - 1) + b
}
// requestAnimationFrame for Smart Animating http://goo.gl/sx5sts
var requestAnimFrame = (function() {
return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || function(callback) { window.setTimeout(callback, 1000 / 60) }
})()
/**
* Because it's so fucking difficult to detect the scrolling element, just move them all
* @param {number} amount
*/
function move(amount) {
document.documentElement.scrollTop = amount
document.body.parentNode.scrollTop = amount
document.body.scrollTop = amount
}
function position() {
return document.documentElement.scrollTop || document.body.parentNode.scrollTop || document.body.scrollTop
}
/**
* @param {number} to
* @param {number} duration
* @param {Function} callback
*/
export function scrollTo(to, duration, callback) {
const start = position()
const change = to - start
const increment = 20
let currentTime = 0
duration = (typeof (duration) === 'undefined') ? 500 : duration
var animateScroll = function() {
// increment the time
currentTime += increment
// find the value with the quadratic in-out easing function
var val = Math.easeInOutQuad(currentTime, start, change, duration)
// move the document.body
move(val)
// do the animation unless its over
if (currentTime < duration) {
requestAnimFrame(animateScroll)
} else {
if (callback && typeof (callback) === 'function') {
// the animation is done so lets callback
callback()
}
}
}
animateScroll()
}

View File

@ -29,7 +29,8 @@
<el-menu-item index="1" @click="goToHomepageManagement">首页管理</el-menu-item>
<el-menu-item index="2" @click="goToArticleReview">文章审核</el-menu-item>
<el-menu-item index="3" @click="goToPersonnelManagement">人员管理</el-menu-item>
<el-menu-item index="5" @click="goToHelpReply">帮助答复</el-menu-item>
<el-menu-item index="4" @click="goToHomepageManagement">注册管理</el-menu-item>
<el-menu-item index="5" @click="goToHomepageManagement">帮助答复</el-menu-item>
<el-menu-item index="6" disabled>更多···</el-menu-item>
</el-menu>
</el-aside>
@ -82,12 +83,9 @@
goToHomepageManagement() {
this.$router.push({name: "homepagemanagement"})
},
//
goToHelpReply() {
this.$router.push({name: "helpreply"})
},
timingTask(userId) {
this.$ajax.post("/hs/timingTask",{userId:userId},r=>{
console.log(r)
})
},
goPersonalInfo(userId) {
@ -96,7 +94,9 @@
this.$refs.child.getUserInfo();
},
goMore() {
this.$notify.info("期待更多内容")
this.$message({
message:"期待更多内容",
})
},
help() {
@ -105,7 +105,7 @@
})
},
forget() {
this.$notify.info("请联系管理员重置密码")
this.$message("请联系管理员重置密码")
},
register() {
this.$router.push({
@ -116,10 +116,10 @@
})
},
opinion() {
this.$notify.info('用户意见请发邮箱至617594538@qq.com')
this.$message('用户意见请发邮箱至617594538@qq.com')
},
service() {
this.$notify.info('客服中心请拨打15006732580')
this.$message('客服中心请拨打15006732580')
},
login() {
this.$router.push({
@ -138,7 +138,7 @@
})
// location.reload()
}).catch(() => {
this.$notify({
this.$message({
type: 'info',
message: '已取消退出'
});
@ -170,8 +170,6 @@
margin-top: 1rem;
text-align: center;
height: 21rem;
position: sticky;
top: 8.8rem;
}
.el-radio-group{
margin-bottom: 0!important;
@ -179,7 +177,6 @@
.second{
background: #EEFCFE;
padding: 0 20%;
margin-top: 7.3rem;
}
.user-cancellation{
float: right;
@ -217,11 +214,5 @@
background-size: 100%;
background-position: 0 2rem;
background-repeat: no-repeat;
position: fixed;
width: 100%;
background-color: #fff;
z-index: 2000;
top: 0;
padding-top: 0.2rem;
}
</style>

View File

@ -1,57 +1,33 @@
<template>
<div class="page">
<div class="top">
<el-form :model="queryParams" ref="queryForm" :inline="true" label-width="6rem">
<el-form-item label="文章标题">
<el-input
v-model="queryParams.content"
placeholder="请输入文章标题"
clearable
size="small"
@keyup.enter.native="getVerifyList"
/>
</el-form-item>
<el-form-item label="作者姓名">
<el-input
v-model="queryParams.author"
placeholder="请输入作者姓名"
clearable
size="small"
@keyup.enter.native="getVerifyList"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="getVerifyList">搜索</el-button>
</el-form-item>
</el-form>
</div>
<div class="list-box" v-loading="loading">
<no-date v-if="noDate"/>
<div class="table" v-if="!noDate">
<div class="table-header">
<div class="index box">序号</div>
<div class="article-name box">文章名称</div>
<div class="article-type box">文章类型</div>
<div class="article-label box">文章标签</div>
<div class="author box">发表人</div>
<div class="time box">发表时间</div>
<div class="function box">操作</div>
</div>
<div class="table-content">
<div class="one-data" v-for="(article, index) in articleList" :key="index">
<div class="index box">{{index+1}}</div>
<div class="article-name box theme-font-blue special-text" @click="getContent(article.articleId)">{{article.title}}</div>
<div class="article-type box theme-font-blue special-text" @click="searchLabel(article.type)">{{article.type}}</div>
<div class="article-label box theme-font-blue special-text" @click="searchLabel(article.label)">{{article.label}}</div>
<div class="author box theme-font-blue special-text" @click="goPersonalInfo(article.releaseId)">{{article.releaseName}}</div>
<div class="time box">{{article.releaseTime}}</div>
<div class="function box">
<el-button type="success" size='mini' @click="verifyArticle(article, '1')">通过</el-button>
<el-button type="danger" size='mini' @click="verifyArticle(article, '2')">驳回</el-button>
</div>
<no-date v-if="noDate"></no-date>
<div class="table" v-if="!noDate">
<div class="table-header">
<div class="index box">序号</div>
<div class="article-name box">文章名称</div>
<div class="article-type box">文章类型</div>
<div class="article-label box">文章标签</div>
<div class="author box">发表人</div>
<div class="time box">发表时间</div>
<div class="function box">操作</div>
</div>
<div class="table-content">
<div class="one-data" v-for="(article, index) in articleList" :key="index">
<div class="index box">{{index+1}}</div>
<div class="article-name box theme-font-blue special-text" @click="getContent(article.articleId)">{{article.title}}</div>
<div class="article-type box theme-font-blue special-text" @click="searchLabel(article.type)">{{article.type}}</div>
<div class="article-label box theme-font-blue special-text" @click="searchLabel(article.label)">{{article.label}}</div>
<div class="author box theme-font-blue special-text" @click="goPersonalInfo(article.releaseId)">{{article.releaseName}}</div>
<div class="time box">{{article.releaseTime}}</div>
<div class="function box">
<el-button type="success" size='mini' @click="verifyArticle(article, '1')">通过</el-button>
<el-button type="danger" size='mini' @click="verifyArticle(article, '2')">驳回</el-button>
</div>
<div class="number">{{articleList.length}}条数据</div>
</div>
<div class="number">{{articleList.length}}条数据</div>
</div>
</div>
</div>
@ -65,13 +41,6 @@
},
data() {
return {
//
queryParams: {
content: '',
author: ''
},
//
loading: false,
//
articleList: [],
//
@ -100,8 +69,9 @@
articleId: item.articleId,
operating: operating
}, res => {
if (res.data > 0) {
this.$notify({
console.log("审核结果", res);
if (res > 0) {
this.$message({
type: 'success',
message: `${OPERATING[operating]}成功`
});
@ -109,7 +79,10 @@
_this.getVerifyList();
}, 1000)
} else {
this.$notify.error('服务器出小差了,请稍后再试');
this.$message({
type: 'error',
message: '服务器出小差了,请稍后再试'
});
}
})
})
@ -118,15 +91,14 @@
* 获取待审核文章列表
*/
getVerifyList() {
this.loading = true;
this.$ajax.post('/admin/getVerifyList', this.queryParams, res => {
if (res.data.length > 0) {
this.$ajax.post('/admin/getVerifyList', {}, res => {
console.log('待审核文章列表', res);
if (res.length > 0) {
this.noDate = false;
this.articleList = res.data;
this.articleList = res;
} else {
this.noDate = true;
}
this.loading = false
})
},
/**

View File

@ -1,43 +0,0 @@
<template>
<div class="page">
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="等待帮助" name="1">
<notHelp></notHelp>
</el-tab-pane>
<el-tab-pane label="历史帮助" name="2">
<historyHelp></historyHelp>
</el-tab-pane>
</el-tabs>
</div>
</template>
<script>
import notHelp from '@/view/admin/helpReply/notHelp/notHelp';
import historyHelp from '@/view/admin/helpReply/historyHelp/historyHelp';
export default {
components: {
notHelp,
historyHelp
},
name: "",
data() {
return{
activeName: '1'
}
},
mounted() {
},
methods: {
/**
* 切换tab
*/
handleClick(tab, event) {
},
}
}
</script>
<style scoped>
</style>

View File

@ -1,90 +0,0 @@
<template>
<div class="page">
<div class="no-help">
<div class="help" v-for="(help, index) in historyHelpList" :key='index'>
<div class="question">
<div class="label">提问内容</div>
<div class="content">{{help.question}}</div>
</div>
<div class="question-person">
<div class="label">提问人</div>
<div class="content pointer theme-font-blue" @click="goToPersonal(help)">{{help.questionName}}</div>
</div>
<div class="question-time">
<div class="label">提问时间</div>
<div class="content grey">{{help.create_time}}</div>
</div>
<div class="answer-content">
<div class="label">解决方案</div>
<div class="content">{{help.answer}}</div>
</div>
<div class="answer-time">
<div class="label">回答时间</div>
<div class="content grey">{{help.answer_time}}</div>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
data() {
return{
//
historyHelpList: [],
//
historyHelpNoData: false
}
},
mounted() {
this.getHelpAnswerList()
},
methods: {
/**
* 跳转个人首页
*/
goToPersonal(help) {
this.$router.push({name: 'personalinfo'});
sessionStorage.setItem("userId",help.create_id);
},
/**
* 获取帮助答复列表
*/
getHelpAnswerList() {
this.$ajax.post('/admin/getHelpAnswerList', {}, res => {
res.data.forEach(item => {
if (item.answer_id !== undefined) {
this.historyHelpList.push(item);
}
this.historyHelpNoData = this.historyHelpList.length === 0 ? true : false;
});
})
}
}
}
</script>
<style scoped>
.help{
border: 1px solid rgb(221, 221, 221);
margin-bottom: 1rem;
border-radius: 5px;
}
.question, .question-person, .question-time, .answer-content, .answer-personal, .answer-time{
padding: 0.5rem;
display: flex;
}
.answer{
margin: 0.5rem;
}
.label{
width: 6rem;
text-align-last: justify;
margin-right: 1rem;
}
.page{
margin: 0;
padding: 0;
}
</style>

View File

@ -1,109 +0,0 @@
<template>
<div class="page">
<div class="no-help">
<div class="help" v-for="(help, index) in notHelpList" :key='index'>
<div class="question">
<div class="label">提问内容</div>
<div class="content">{{help.question}}</div>
</div>
<div class="question-person">
<div class="label">提问人</div>
<div class="content pointer theme-font-blue" @click="goToPersonal(help)">{{help.questionName}}</div>
</div>
<div class="question-time">
<div class="label">提问时间</div>
<div class="content grey">{{help.create_time}}</div>
</div>
<el-button class="answer" type="success" size="small" @click="answer(help)">帮助解决</el-button>
</div>
</div>
</div>
</template>
<script>
export default {
data() {
return{
//
notHelpList: [],
//
notHelpNoData: false,
}
},
mounted() {
this.getHelpAnswerList()
},
methods: {
/**
* 帮助解决
*/
answer(help) {
let userInfo = JSON.parse(sessionStorage.getItem("userInfo"));
this.$prompt(`${help.question}`, '请输入解决方案', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputPattern: /\S/,
inputErrorMessage: '内容不能为空'
}).then(({ value }) => {
this.$ajax.post("/admin/answerHelp",{
answerId: userInfo.user_id,
answer: value,
id: help.id}, res => {
if (res.data === 1) {
this.$notify({
type: 'success',
message: '提交成功'
});
} else {
this.$notify.error("提交失败")
}
})
})
},
/**
* 跳转个人首页
*/
goToPersonal(help) {
this.$router.push({name: 'personalinfo'});
sessionStorage.setItem("userId",help.create_id);
},
/**
* 获取帮助答复列表
*/
getHelpAnswerList() {
this.$ajax.post('/admin/getHelpAnswerList', {}, res => {
res.data.forEach(item => {
if (item.answer_id === undefined) {
this.notHelpList.push(item);
}
this.notHelpNoData = this.notHelpList.length === 0 ? true : false;
});
})
}
}
}
</script>
<style scoped>
.help{
border: 1px solid rgb(221, 221, 221);
margin-bottom: 1rem;
border-radius: 5px;
}
.question, .question-person, .question-time{
padding: 0.5rem;
display: flex;
}
.answer{
margin: 0.5rem;
}
.label{
width: 6rem;
text-align-last: justify;
margin-right: 1rem;
}
.page{
margin: 0;
padding: 0;
}
</style>

View File

@ -1,40 +1,12 @@
<template>
<div class="page">
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="轮播图管理" name="1">
<rotation-photo-management></rotation-photo-management>
</el-tab-pane>
<el-tab-pane label="版块管理" name="2">
<plate-management></plate-management>
</el-tab-pane>
</el-tabs>
<h1>完善中···</h1>
</div>
</template>
<script>
import rotationPhotoManagement from '@/view/admin/homepageManagement/homepageManagement/RotationPhotoManagement';
import plateManagement from '@/view/admin/homepageManagement/plateManagement/PlateManagement.vue';
export default {
components: {
rotationPhotoManagement,
plateManagement
},
name: "HomepageManagement",
data() {
return{
activeName: '1'
}
},
mounted() {
},
methods: {
/**
* 切换tab
*/
handleClick(tab, event) {
},
}
name: "HomepageManagement"
}
</script>

View File

@ -1,142 +0,0 @@
<template>
<div>
<div class="img-list" v-loading="loading">
<div class="img" v-for="(img, index) in rotationPhotoList" :key='index'>
<el-image class="rotation-photo"
:src='imgPath(img)'
:preview-src-list="srcList"
fit='scale-down'/>
<i class="el-icon-circle-close delete-icon pointer" @click="deleteImg(img)"/>
</div>
<el-upload
class="upload-demo"
:action="url"
list-type="picture"
:show-file-list='false'
:on-success='success'
:on-error='error'>
<div class="add-img pointer">
<i class="el-icon-plus"/>
</div>
</el-upload>
</div>
</div>
</template>
<script>
export default {
data() {
return{
//
loading: false,
//
rotationPhotoList: [],
//URL
srcList: [],
//
url: `${sessionStorage.getItem('url')}/hs/upload`,
}
},
mounted() {
this.getRotationPhotoList();
},
methods: {
/**
* 上传图片成功
*/
success(response, file, fileList) {
this.$ajax.post('/admin/uploadRotationPhoto', {fileId: response.fileInfo.id}, res => {
if (res.data === 1) {
this.$notify({
type: 'success',
message: '上传成功'
})
this.getRotationPhotoList();
} else {
this.$notify.error('网络异常,请稍后再试')
}
})
},
/**
* 上传图片失败
*/
error() {
this.$notify.error('网络异常,请稍后再试')
},
/**
* 删除图片
*/
deleteImg(img) {
this.$ajax.post('/admin/deleteRotationPhoto', {
id: img.id,
fileEncryption: img.fileEncryption
}, res => {
if (res.data === 1) {
this.$notify({
type: 'success',
message: '删除成功'
})
this.getRotationPhotoList();
} else {
this.$notify.error('网络异常,请稍后再试')
}
})
},
/**
* 图片地址
*/
imgPath(item) {
return `${sessionStorage.getItem('url')}/hs/showImg/${item.fileEncryption}`
},
//
getRotationPhotoList() {
this.loading = true;
this.$ajax.post('/hs/getRotationPhotoList',{},res=>{
if (res.data.rotationPhotoList.length > 0) {
this.rotationPhotoList = res.data.rotationPhotoList;
res.data.rotationPhotoList.forEach(img => {
this.srcList.push(`${sessionStorage.getItem('url')}/hs/showImg/${img.fileEncryption}`)
});
}
this.loading = false
})
},
}
}
</script>
<style scoped>
.delete-icon{
position: absolute;
margin-left: -1rem;
margin-top: -0.4rem;
color: #ff0000;
font-size: 1.5rem;
}
.img-list{
display: flex;
flex-wrap: wrap;
}
.add-img{
width: 10rem;
height: 10rem;
display: flex;
justify-content: center;
align-items: center;
}
.add-img i{
font-size: 5rem;
color: #999999;
}
.img, .add-img{
border: 1px solid #999999;
margin: 0.5rem;
padding: 0.5rem;
border-radius: 0.5rem
}
.rotation-photo{
width: 10rem;
height: 10rem;
}
</style>

View File

@ -1,241 +0,0 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="6rem">
<el-form-item label="获奖人员姓名" prop="userName">
<el-input
v-model="queryParams.userName"
placeholder="请输入获奖人员姓名"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="获奖类型" prop="type">
<el-select v-model="queryParams.type" placeholder="请选择获奖类型" clearable size="small">
<el-option v-for="item in winnerTypeList"
:label="item.dd_detail"
:key="item.id"
:value="item.dd_detail" />
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
>删除</el-button>
</el-col>
</el-row>
<el-table v-loading="loading" :data="winnersList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="人员姓名" align="center" prop="userName" />
<el-table-column label="获奖类型" align="center" prop="type" />
<el-table-column label="获奖人职务" align="center" prop="post" />
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<!-- 添加或修改获奖对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="6rem">
<el-form-item label="获奖人员姓名" prop="userName">
<el-input v-model="form.userName" placeholder="请输入人员姓名" />
</el-form-item>
<el-form-item label="获奖类型" prop="type">
<el-select v-model="form.type" placeholder="请选择获奖类型">
<el-option v-for="item in winnerTypeList"
:label="item.dd_detail"
:key="item.id"
:value="item.dd_detail" />
</el-select>
</el-form-item>
<el-form-item label="获奖人职务" prop="post">
<el-input v-model="form.post" placeholder="请输入获奖人职务" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listWinners, delWinners, addWinners, updateWinners } from "@/api/admin/winners";
export default {
name: "PlateManagement",
data() {
return {
//
winnerTypeList: [],
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
winnersList: [],
//
title: "",
//
open: false,
//
queryParams: {
userName: null,
type: null,
},
//
form: {},
//
rules: {
}
};
},
created() {
this.getList();
this.getDict('WinnerType').then(res => {
this.winnerTypeList = res.data.data;
})
},
methods: {
/** 查询获奖列表 */
getList() {
this.loading = true;
listWinners(this.queryParams).then(response => {
this.winnersList = response.data.data;
this.total = response.data.data.length;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
userId: null,
userName: null,
type: null,
post: null,
version: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null
};
},
/** 搜索按钮操作 */
handleQuery() {
this.getList();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加获奖";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids;
listWinners({id: row.id}).then(response => {
this.form = response.data.data[0];
this.open = true;
this.title = "修改获奖";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateWinners(this.form).then(response => {
this.$notify.success("修改成功");
this.open = false;
this.getList();
});
} else {
addWinners(this.form).then(response => {
this.$notify.success("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$confirm(`是否确认删除${row.userName}的获奖信息`, "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return delWinners(ids);
}).then(() => {
this.getList();
this.$notify.success("删除成功");
})
},
}
}
</script>
<style lang='scss' scoped>
</style>

View File

@ -12,10 +12,12 @@
</template>
<script>
import noDate from '@/components/components/NoData'
import person from '@/view/admin/personnelManagement/personnelManagement/PersonnelManagement'
import registration from '@/view/admin/personnelManagement/registrationManagement/RegistrationManagement'
export default {
components: {
noDate,
person,
registration
},
@ -27,6 +29,7 @@
},
methods: {
handleClick(tab, event) {
console.log(tab, event);
}
}
}

View File

@ -1,132 +1,38 @@
<template>
<div class="page">
<div class="top">
<el-form :model="queryParams" ref="queryForm" :inline="true" label-width="6rem">
<el-form-item label="人员姓名">
<el-input
v-model="queryParams.name"
placeholder="请输入人员姓名"
clearable
size="small"
@keyup.enter.native="getFollowPeopleList"
/>
</el-form-item>
<el-form-item label="人员类型">
<el-select v-model="queryParams.userType" placeholder="请选择人员类型" clearable size="small">
<el-option
v-for="dict in userTypeList"
:key="dict.id"
:label="dict.dd_detail"
:value="dict.dd_detail"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="getFollowPeopleList">搜索</el-button>
</el-form-item>
</el-form>
</div>
<div class="list-box" v-loading="loading">
<no-date v-if="noDate"/>
<div class="table" v-if="!noDate">
<div class="table-header">
<div class="index box">序号</div>
<div class="article-name box">人员姓名</div>
<div class="article-type box">人员类型</div>
<div class="time box">注册时间</div>
<div class="article-type box">是否冻结</div>
<div class="function box">操作</div>
</div>
<div class="table-content">
<div class="one-data" v-for="(person, index) in personList" :key="index">
<div class="index box">{{index+1}}</div>
<div class="article-name box theme-font-blue special-text" @click="goPersonalInfo(person.user_id)">{{person.real_name}}</div>
<div class="article-type box">{{person.user_type}}</div>
<div class="time box theme-font-blue special-text">{{person.create_time}}</div>
<div class="article-type box" :class="person.frozen_state === '0' ? 'theme-font-green' : 'theme-font-red'">{{person.frozen_state === '0' ? '未冻结' : '已冻结'}}</div>
<div class="function box">
<el-button type="danger" size='mini' @click="peopleManagement(person, '1')" v-if="person.frozen_state === '0'">冻结</el-button>
<el-button type="success" size='mini' @click="peopleManagement(person, '0')" v-if="person.frozen_state === '1'">解冻</el-button>
<el-button type="primary" size='mini' @click="openEdit(person)">编辑</el-button>
</div>
<no-date v-if="noDate"></no-date>
<div class="table" v-if="!noDate">
<div class="table-header">
<div class="index box">序号</div>
<div class="article-name box">人员名称</div>
<div class="article-type box">人员类型</div>
<div class="time box">注册时间</div>
<div class="article-type box">是否冻结</div>
<div class="function box">操作</div>
</div>
<div class="table-content">
<div class="one-data" v-for="(person, index) in personList" :key="index">
<div class="index box">{{index+1}}</div>
<div class="article-name box theme-font-blue special-text">{{person.real_name}}</div>
<div class="article-type box theme-font-blue special-text">{{person.user_type}}</div>
<div class="article-label box theme-font-blue special-text">{{person.create_time}}</div>
<div class="article-type box theme-font-blue special-text">{{person.frozen_state === '0' ? '未冻结' : '已冻结'}}</div>
<div class="function box">
<el-button type="success" size='mini' @click="" v-if="person.frozen_state === '0'">冻结</el-button>
<el-button type="danger" size='mini' @click="" v-if="person.frozen_state === '1'">解冻</el-button>
</div>
<div class="number">{{personList.length}}条数据</div>
</div>
<div class="number">{{personList.length}}条数据</div>
</div>
</div>
<el-dialog
title="个人信息"
:visible.sync="dialogVisible"
width="fit-content">
<div class="person-info">
<div class="one">
<div class="label">姓名</div>
<div class="content">{{personInfo.real_name}}</div>
</div>
<div class="one">
<div class="label">性别</div>
<div class="content">{{personInfo.sex}}</div>
</div>
<div class="one">
<div class="label">出生日期</div>
<div class="content">{{personInfo.birthday}}</div>
</div>
<div class="one">
<div class="label">手机号</div>
<div class="content">{{personInfo.mobile}}</div>
</div>
<div class="one">
<div class="label">身份</div>
<div class="content">{{personInfo.user_type}}</div>
</div>
<div class="one">
<div class="label">个性签名</div>
<div class="content">{{personInfo.signature}}</div>
</div>
<div class="one">
<div class="label">职务</div>
<div class="content">
<el-select size="mini"
v-model="personInfo.post"
filterable
allow-create
default-first-option
placeholder="请输入职务">
<el-option v-for="item in postList"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</div>
</div>
<div class="one">
<div class="label">班级</div>
<div class="content">
<el-select size="mini"
v-model="personInfo.class_name"
filterable
allow-create
default-first-option
placeholder="请输入班级">
<el-option v-for="item in classList"
:key="item.class_name"
:label="item.class_name"
:value="item.class_name"/>
</el-select>
</div>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="updatePersonalInfo"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import noDate from '@/components/components/NoData'
import { getClassList } from '@/api/index/user'
export default {
components: {
@ -135,171 +41,35 @@
name: "PersonnelManagement",
data() {
return{
//
loading: false,
//
classList: [],
//
queryParams: {
name: '',
userType: ''
},
//
userTypeList: [],
//
postList: [
{label: '无', value: '无'},
{label: '班主任', value: '班主任'},
],
//
dialogVisible: false,
//
noDate: true,
//
personList: [],
//
personInfo: {}
personList: []
}
},
mounted() {
this.getUserType();
this.getClassList();
this.getFollowPeopleList()
},
methods: {
/**
* 获取班级列表
*/
getClassList() {
getClassList({}).then(res => {
if (res.data.data.length > 0) {
res.data.data.forEach(item => {
if (item && item.class_name !== '') {
this.classList.push(item)
}
});
}
})
},
/**
* 获取人员类型
*/
getUserType() {
this.getDict('UserType').then(res => {
this.userTypeList = res.data.data.filter(item => {
return item.dd_detail !== '管理员'
})
})
},
/**
* 编辑个人信息
*/
updatePersonalInfo() {
if (this.personInfo.post === '班主任' && this.personInfo.user_type === '学生') {
this.$notify.error('学生不可赋予班主任职务')
} else {
this.$ajax.post('/hs/updatePersonalInfo',
{className: this.personInfo.class_name, post: this.personInfo.post, userId: this.personInfo.user_id}, res => {
if (res.data > 0) {
this.dialogVisible = false;
this.$notify.success('修改成功')
}
})
}
},
/**
* 打开个人信息
*/
openEdit(person) {
this.dialogVisible = true;
this.$ajax.post('/admin/getPersonInfo', {userId: person.user_id}, res => {
this.personInfo = res.data
})
},
/**
* 冻结/解冻
* @param {Object} item
* @param {Object} operation 冻结/解冻
*/
peopleManagement(item, operating) {
const OPERATING = {
"0": "解冻",
"1": "冻结",
};
let _this = this;
_this.$confirm(`确认${OPERATING[operating]+item.real_name}?`, `${OPERATING[operating]}`, {
confirmButtonText: '确定',
cancelButtonText: '取消',
}).then(() => {
this.$ajax.post('/admin/peopleManagement', {
userId: item.user_id,
operating: operating
}, res => {
if (res.data > 0) {
this.$notify({
type: 'success',
message: `${OPERATING[operating]+item.real_name}成功`
});
setTimeout(() => {
_this.getFollowPeopleList();
}, 1000)
} else {
this.$notify.error('服务器出小差了,请稍后再试');
}
})
})
},
/**
* 查看个人主页
*/
goPersonalInfo(userId) {
this.$router.push({name: 'personalinfo'});
sessionStorage.setItem("userId",userId);
},
/**
* 获取人员列表
*/
getFollowPeopleList() {
this.loading = true;
this.$ajax.post('/admin/getPersonnelManagement', this.queryParams, res => {
if (res.data.length > 0) {
this.personList = res.data;
this.$ajax.post('/admin/getPersonnelManagement', {}, res => {
console.log('人员列表', res);
if (res.length > 0) {
this.personList = res;
this.noDate = false;
} else {
this.noDate = true
}
this.loading = false
})
}
}
}
</script>
<style lang="scss" scoped>
.page {
padding: 0;
.table {
padding: 0 1rem;
}
}
.person-info {
width: 40vw;
display: flex;
flex-flow: column;
.one {
display: flex;
margin-bottom: 1rem;
align-items: center;
.label {
width: 6em;
text-align-last: justify;
}
.content {
flex: 1;
color: #00afff;
}
}
}
<style scoped>
.el-button+.el-button{
margin-left: 0;
}
@ -323,19 +93,21 @@
}
.index{
width: 3rem;
text-align: center;
}
.article-name{
width: 6rem;
text-align: center;
}
.article-type{
width: 6rem;
color: #999999;
text-align: center;
}
.article-label{
width: 6rem;
}
.author{
width: 6rem;
}
.time{
width: 14rem;
width: 10rem;
color: #999;
text-decoration: none!important;
cursor: default!important;
@ -345,10 +117,6 @@
}
.box{
text-align: center;
display: flex;
.el-button {
margin-right: 0.5rem;
}
}
.table-header{
color: #999;

View File

@ -1,230 +1,13 @@
<template>
<div class="page">
<div class="top">
<el-form :model="queryParams" ref="queryForm" :inline="true" label-width="6rem">
<el-form-item label="人员姓名">
<el-input
v-model="queryParams.name"
placeholder="请输入人员姓名"
clearable
size="small"
@keyup.enter.native="getFollowPeopleList"
/>
</el-form-item>
<el-form-item label="人员类型">
<el-select v-model="queryParams.userType" placeholder="请选择人员类型" clearable size="small">
<el-option
v-for="dict in userTypeList"
:key="dict.id"
:label="dict.dd_detail"
:value="dict.dd_detail"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="getFollowPeopleList">搜索</el-button>
</el-form-item>
</el-form>
</div>
<div class="list-box" v-loading="loading">
<no-date v-if="noDate"/>
<div class="table" v-if="!noDate">
<div class="table-header">
<div class="index box">序号</div>
<div class="article-name box">人员名称</div>
<div class="article-type box">人员类型</div>
<div class="time box">注册时间</div>
<div class="function box">操作</div>
</div>
<div class="table-content">
<div class="one-data" v-for="(person, index) in personList" :key="index">
<div class="index box">{{index+1}}</div>
<div class="article-name box theme-font-blue special-text" @click="goPersonalInfo(person.user_id)">{{person.real_name}}</div>
<div class="article-type box">{{person.user_type}}</div>
<div class="time box theme-font-blue special-text">{{person.create_time}}</div>
<div class="function box">
<el-button type="success" size='mini' @click="passRegistration(person)">通过</el-button>
<el-button type="danger" size='mini' @click="deleteRegistration(person)">删除</el-button>
</div>
</div>
<div class="number">{{personList.length}}条数据</div>
</div>
</div>
</div>
</div>
</template>
<script>
import noDate from '@/components/components/NoData'
import { delPerson, editPerson } from '@/api/index/user'
export default {
components: {
noDate
},
name: "PersonnelManagement",
data() {
return{
//
loading: false,
//
queryParams: {
name: '',
userType: '',
takeEffect: '0'
},
//
userTypeList: [],
//
noDate: true,
//
personList: [],
}
},
mounted() {
this.getUserType();
this.getFollowPeopleList()
},
methods: {
/**
* 获取人员类型
*/
getUserType() {
this.getDict('UserType').then(res => {
this.userTypeList = res.data.data.filter(item => {
return item.dd_detail !== '管理员'
})
})
},
/**
* 删除人员
*/
deleteRegistration(person) {
this.$confirm(`是否确认删除${person.real_name}的注册信息`, "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return delPerson(person.user_id);
}).then(() => {
this.getFollowPeopleList();
this.$notify.success("删除成功");
})
},
/**
* 通过审核
*/
passRegistration(person) {
this.$confirm(`是否确认通过${person.real_name}的注册信息`, "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return editPerson({userId: person.user_id, takeEffect: '1'});
}).then(() => {
this.getFollowPeopleList();
this.$notify.success("通过成功");
})
},
/**
* 获取人员列表
*/
getFollowPeopleList() {
this.loading = true;
this.$ajax.post('/admin/getPersonnelManagement', this.queryParams, res => {
if (res.data.length > 0) {
this.personList = res.data;
this.noDate = false;
} else {
this.noDate = true
}
this.loading = false
})
}
export default {
name: "RegistrationManagement"
}
}
</script>
<style lang="scss" scoped>
.person-info {
width: 40vw;
display: flex;
flex-flow: column;
.one {
display: flex;
margin-bottom: 1rem;
align-items: center;
.label {
width: 6em;
text-align-last: justify;
}
.content {
flex: 1;
color: #00afff;
}
}
}
.el-button+.el-button{
margin-left: 0;
}
.table-content{
padding-bottom: 2rem;
}
.number{
font-size: 0.9rem;
color: #999;
float: right;
margin: 1rem;
}
.special-text{
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
cursor: pointer;
}
.special-text:hover{
text-decoration: underline;
}
.index{
width: 3rem;
text-align: center;
}
.article-name{
width: 6rem;
text-align: center;
}
.article-type{
width: 6rem;
color: #999999;
text-align: center;
}
.time{
width: 14rem;
color: #999;
text-decoration: none!important;
cursor: default!important;
}
.function{
width: 10rem;
}
.box{
text-align: center;
display: flex;
.el-button {
margin-right: 0.5rem;
}
}
.table-header{
color: #999;
}
.one-data{
font-size: 0.9rem;
}
.table-header, .one-data{
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 1px solid #ADDFFA;
padding: 0.5rem 0;
}
<style scoped>
</style>

View File

@ -2,7 +2,7 @@
<div id="upload">
<el-upload
class="upload-demo"
:action="url"
action="http://127.0.0.1:8048/hs/upload"
:on-preview="handlePreview"
:on-remove="handleRemove"
:file-list="fileList"
@ -11,23 +11,17 @@
<div slot="tip" class="el-upload__tip">只能上传jpg/png文件且不超过500kb</div>
</el-upload>
<div class="img">
<img v-for="(item,index) in fileList" :src="item.path" height="100" width="100" :key='index'/>
<img v-for="(item,index) in fileList" :src="item.path" height="100" width="100"/>
</div>
<el-button @click="fileUpload">
下载
</el-button>
<img :src="imgUrl" alt="">
</div>
</template>
<script>
export default {
data() {
return {
//
imgUrl: `${sessionStorage.getItem('url')}/hs/showImg/3fdc4d49-8bd4-4dc7-a8c1-50d2fa8e89f5carousel4.jpg`,
//
url: `${sessionStorage.getItem('url')}/hs/upload`,
//
fileList: []
};
},
@ -40,7 +34,7 @@
this.$axios(
{
method: 'post',
url: `${sessionStorage.getItem('url')}/hs/fileDownload`,
url: 'http://127.0.0.1:8048/hs/fileDownload',
params: {
fileId: '111'
},
@ -67,14 +61,16 @@
getPhoto() {
this.$ajax.post('/hs/getFileList',{},r=>{
this.fileList = [];
for (let i = 0; i < r.data.fileList.length; i++) {
this.fileList.push({path: require('../assets/file/'+r.data.fileList[i].fileEncryption)})
for (let i = 0; i < r.fileList.length; i++) {
this.fileList.push({path: require('../assets/file/'+r.fileList[i].fileEncryption)})
}
})
},
handleRemove(file, fileList) {
console.log(file, fileList);
},
handlePreview(file) {
console.log(file);
}
}
}

107
README.md
View File

@ -1,98 +1,17 @@
<p align=center>
<a href="http://pnkx.top:8862">
<img style="width: 100px; height:100px;" src="https://gitee.com/phyqxx/picture-warehouse/raw/master/hslink/eee.ico" alt="nice blog system">
</a>
</p>
<p align=center>
HSLink 是一个前后端分离的家校通网站
</p>
## 项目选型
采用SpringBoot + Vue
# HSLink
毕设:家校通
## 网站功能
- :tw-1f334: 采用了时下流行的SpringBoot + Vue技术。
- :tw-1f363: MySQL严格的数据库规范设计。
- :tw-1f375: 独具特色的评论回复功能,不依赖任何三方评论回复插件
## 环境依赖
| 环境依赖 | 说明描述 |
| ------------------------ | ----------------------------- |
| 软件基础环境 | 服务器(例:1 vCPU 2 GiB 1Mbps+域名(例kiwipeach.cn) ,注意这里的域名需要备案才能够访问喔|
| 数据库 | MySQL |
| JDK | 推荐使用jdk1.8及1.8以上的版本 |
| node | 前端需要使用node环境启动前端服务其中请求转发可以使用前端提供转发工具当然也可以使用nginx看具体部署条件。 |
## 主要功能预览
### PC客户端端
#### 登录
![输入图片说明](https://gitee.com/phyqxx/picture-warehouse/raw/master/hslink/%E7%99%BB%E5%BD%95.jpg "在这里输入图片标题")
#### 注册
![输入图片说明](https://gitee.com/phyqxx/picture-warehouse/raw/master/hslink/%E6%B3%A8%E5%86%8C.jpg "在这里输入图片标题")
#### 首页
![输入图片说明](https://gitee.com/phyqxx/picture-warehouse/raw/master/hslink/%E9%A6%96%E9%A1%B5.jpg "在这里输入图片标题")
#### 文章详情
![输入图片说明](https://gitee.com/phyqxx/picture-warehouse/raw/master/hslink/%E6%96%87%E7%AB%A0%E8%AF%A6%E6%83%85.png "在这里输入图片标题")
#### 校园通知
![输入图片说明](https://gitee.com/phyqxx/picture-warehouse/raw/master/hslink/%E6%A0%A1%E5%9B%AD%E9%80%9A%E7%9F%A5.jpg "在这里输入图片标题")
#### 我的班级
![输入图片说明](https://gitee.com/phyqxx/picture-warehouse/raw/master/hslink/%E6%88%91%E7%9A%84%E7%8F%AD%E7%BA%A7.png "在这里输入图片标题")
#### 家长建议
![输入图片说明](https://gitee.com/phyqxx/picture-warehouse/raw/master/hslink/%E5%AE%B6%E9%95%BF%E5%BB%BA%E8%AE%AE.jpg "在这里输入图片标题")
#### 学生想法
![输入图片说明](https://gitee.com/phyqxx/picture-warehouse/raw/master/hslink/%E5%AD%A6%E7%94%9F%E6%83%B3%E6%B3%95.jpg "在这里输入图片标题")
#### 个人中心
![输入图片说明](https://gitee.com/phyqxx/picture-warehouse/raw/master/hslink/%E4%B8%AA%E4%BA%BA%E4%B8%AD%E5%BF%83.jpg "在这里输入图片标题")
#### 私信
![输入图片说明](https://gitee.com/phyqxx/picture-warehouse/raw/master/hslink/%E7%A7%81%E4%BF%A1.jpg "在这里输入图片标题")
#### 发表文章
![输入图片说明](https://gitee.com/phyqxx/picture-warehouse/raw/master/hslink/%E5%8F%91%E8%A1%A8%E6%96%87%E7%AB%A0.jpg "在这里输入图片标题")
### PC管理端
#### 首页管理
![输入图片说明](https://gitee.com/phyqxx/picture-warehouse/raw/master/hslink/%E9%A6%96%E9%A1%B5%E7%AE%A1%E7%90%86.jpg "在这里输入图片标题")
#### 文章审核
![输入图片说明](https://gitee.com/phyqxx/picture-warehouse/raw/master/hslink/%E6%96%87%E7%AB%A0%E5%AE%A1%E6%A0%B8.jpg "在这里输入图片标题")
#### 人员管理
![输入图片说明](https://gitee.com/phyqxx/picture-warehouse/raw/master/hslink/%E4%BA%BA%E5%91%98%E7%AE%A1%E7%90%86.jpg "在这里输入图片标题")
#### 帮助答复
![输入图片说明](https://gitee.com/phyqxx/picture-warehouse/raw/master/hslink/%E5%B8%AE%E5%8A%A9%E7%AD%94%E5%A4%8D.jpg "在这里输入图片标题")
### APP端
![输入图片说明](https://gitee.com/phyqxx/picture-warehouse/raw/master/hslink/app%E7%99%BB%E5%BD%95.jpg "在这里输入图片标题")
![输入图片说明](https://gitee.com/phyqxx/picture-warehouse/raw/master/hslink/app%E6%B3%A8%E5%86%8C.jpg "在这里输入图片标题")
![输入图片说明](https://gitee.com/phyqxx/picture-warehouse/raw/master/hslink/app%E9%A6%96%E9%A1%B5.jpg "在这里输入图片标题")
![输入图片说明](https://gitee.com/phyqxx/picture-warehouse/raw/master/hslink/app%E5%85%B3%E6%B3%A8.jpg "在这里输入图片标题")
![输入图片说明](https://gitee.com/phyqxx/picture-warehouse/raw/master/hslink/app%E5%8F%91%E8%A1%A8%E6%96%87%E7%AB%A0.jpg "在这里输入图片标题")
![输入图片说明](https://gitee.com/phyqxx/picture-warehouse/raw/master/hslink/app%E6%B6%88%E6%81%AF%E5%88%97%E8%A1%A8.jpg "在这里输入图片标题")
![输入图片说明](https://gitee.com/phyqxx/picture-warehouse/raw/master/hslink/app%E4%B8%AA%E4%BA%BA%E4%B8%AD%E5%BF%83.jpg "在这里输入图片标题")
![输入图片说明](https://gitee.com/phyqxx/picture-warehouse/raw/master/hslink/app%E6%88%91%E7%9A%84%E6%94%B6%E8%97%8F.jpg "在这里输入图片标题")
![输入图片说明](https://gitee.com/phyqxx/picture-warehouse/raw/master/hslink/app%E6%88%91%E7%9A%84%E6%96%87%E7%AB%A0.jpg "在这里输入图片标题")
![输入图片说明](https://gitee.com/phyqxx/picture-warehouse/raw/master/hslink/app%E9%80%9A%E7%9F%A5.jpg "在这里输入图片标题")
![输入图片说明](https://gitee.com/phyqxx/picture-warehouse/raw/master/hslink/app%E7%BC%96%E8%BE%91%E4%B8%AA%E4%BA%BA%E4%BF%A1%E6%81%AF.jpg "在这里输入图片标题")
![输入图片说明](https://gitee.com/phyqxx/picture-warehouse/raw/master/hslink/app%E8%AE%BE%E7%BD%AE.jpg "在这里输入图片标题")
![输入图片说明](https://gitee.com/phyqxx/picture-warehouse/raw/master/hslink/app%E5%B8%AE%E5%8A%A9.jpg "在这里输入图片标题")
还在完善
## HSLink -> [点击跳转](http://pnkx.top:8862)
前端Vue
后端SpringBoot
数据库MySQL
移动端uni-app
有需要完整内容的可以加我QQ617594538备注写清意图