Compare commits

..

No commits in common. 'peishitong_branch' and 'master' have entirely different histories.

53
.gitignore vendored

@ -1,38 +1,23 @@
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/
.DS_Store
node_modules
/dist
### IntelliJ IDEA ###
.idea/modules.xml
.idea/jarRepositories.xml
.idea/compiler.xml
.idea/libraries/
*.iws
*.iml
*.ipr
### Eclipse ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
# local env files
.env.local
.env.*.local
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
### VS Code ###
.vscode/
### Mac OS ###
.DS_Store
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

8
.idea/.gitignore vendored

@ -1,8 +0,0 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
<file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/src/main/resources" charset="UTF-8" />
</component>
</project>

@ -1,14 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="MavenProjectsManager">
<option name="originalFiles">
<list>
<option value="$PROJECT_DIR$/pom.xml" />
</list>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

@ -1,118 +0,0 @@
/*
* 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.

@ -1,2 +0,0 @@
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

@ -0,0 +1 @@
Subproject commit df30c6ee517297783b8f1e46eba280b0300862b7

@ -1,2 +1,19 @@
# Epidemic
# vuetest
## Project setup
```
npm install
```
### Compiles and hot-reloads for development
```
npm run serve
```
### Compiles and minifies for production
```
npm run build
```
### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).

@ -0,0 +1,5 @@
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset'
]
}

14665
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -0,0 +1,36 @@
{
"name": "COVID-vue",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build"
},
"dependencies": {
"core-js": "^3.6.5",
"echarts": "^5.0.2",
"element-ui": "^2.4.5",
"vue": "^2.6.11",
"vue-router": "^3.2.0",
"vuex": "^3.4.0"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~4.5.0",
"@vue/cli-plugin-router": "~4.5.0",
"@vue/cli-plugin-vuex": "~4.5.0",
"@vue/cli-service": "~4.5.0",
"axios": "^0.18.0",
"cache-loader": "^4.1.0",
"vue-cli-plugin-axios": "0.0.4",
"vue-cli-plugin-element": "^1.0.1",
"vue-loader": "^15.11.1",
"vue-template-compiler": "^2.6.11",
"webpack": "^4.47.0",
"webpack-cli": "^4.10.0"
},
"browserslist": [
"> 1%",
"last 2 versions",
"not dead"
]
}

@ -1,96 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.liu</groupId>
<artifactId>covid</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>covid</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>1.8</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<spring-boot.version>2.2.2.RELEASE</spring-boot.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
<version>3.4.2</version>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>${spring-boot.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.3.7.RELEASE</version>
<configuration>
<mainClass>com.liu.covid.CovidApplication</mainClass>
</configuration>
<executions>
<execution>
<id>repackage</id>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

@ -0,0 +1,17 @@
<!DOCTYPE html>
<html lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= htmlWebpackPlugin.options.title %></title>
</head>
<body>
<noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>

@ -1,17 +0,0 @@
create table department
(
id int not null
primary key,
name varchar(20) null,
charge varchar(20) null
);
create index name
on department (name);
INSERT INTO covid.department (id, name, charge) VALUES (1, '财务部', '王刚');
INSERT INTO covid.department (id, name, charge) VALUES (2, '人力资源部', '李师');
INSERT INTO covid.department (id, name, charge) VALUES (3, '后勤部', '王二霞');
INSERT INTO covid.department (id, name, charge) VALUES (4, '客服部', '刘晓华');
INSERT INTO covid.department (id, name, charge) VALUES (5, '研发部', '李海红');
INSERT INTO covid.department (id, name, charge) VALUES (6, '技术部', '刘苏哈');

@ -1,28 +0,0 @@
create table emp_health
(
id int(10) auto_increment
primary key,
name varchar(20) null,
sex int(1) null,
phonenum bigint null,
temp float(4, 1) null,
risk varchar(30) null,
health varchar(30) null,
content varchar(255) null,
createTime datetime null,
depart varchar(30) null,
constraint de
foreign key (depart) references department (name)
);
INSERT INTO covid.emp_health (id, name, sex, phonenum, temp, risk, health, content, createTime, depart) VALUES (2, '刘先生', 1, 15143355464, 36.5, '', '正常', '', '2021-03-31 14:03:52', '后勤部');
INSERT INTO covid.emp_health (id, name, sex, phonenum, temp, risk, health, content, createTime, depart) VALUES (3, '吴雷师', 0, 15151549751, 37, '', '正常', '', '2021-03-13 20:16:30', '客服部');
INSERT INTO covid.emp_health (id, name, sex, phonenum, temp, risk, health, content, createTime, depart) VALUES (4, '刘腾键', 1, 13415135795, 36.5, '', '正常', '', '2021-03-13 19:54:40', '客服部');
INSERT INTO covid.emp_health (id, name, sex, phonenum, temp, risk, health, content, createTime, depart) VALUES (5, '刘腾键', 1, 13415135795, 36.5, '', '感冒', '', '2021-03-13 19:54:40', '研发部');
INSERT INTO covid.emp_health (id, name, sex, phonenum, temp, risk, health, content, createTime, depart) VALUES (6, '刘胜虎', 1, 123414234123, 39, '', '低烧', '', '2021-04-05 22:41:39', '技术部');
INSERT INTO covid.emp_health (id, name, sex, phonenum, temp, risk, health, content, createTime, depart) VALUES (7, '王继红', 0, 13513534534, 38, '', '与新冠肺炎有关的其他症状,如流涕,咽痛,肌痛,腹泻等', '', '2021-04-06 13:39:38', '客服部');
INSERT INTO covid.emp_health (id, name, sex, phonenum, temp, risk, health, content, createTime, depart) VALUES (8, '刘小姐', 1, 231123123, 23, '', '呼吸困难', '', '2021-04-06 15:34:42', '后勤部');
INSERT INTO covid.emp_health (id, name, sex, phonenum, temp, risk, health, content, createTime, depart) VALUES (9, '111', 1, 111111111, 11, '111', '正常', '11', '2021-04-10 16:03:01', '研发部');
INSERT INTO covid.emp_health (id, name, sex, phonenum, temp, risk, health, content, createTime, depart) VALUES (10, '刘渲', 1, 13514124567, 37, '', '正常', '', '2021-04-15 14:29:15', '后勤部');
INSERT INTO covid.emp_health (id, name, sex, phonenum, temp, risk, health, content, createTime, depart) VALUES (11, '王佳', 0, 13512314534, 37.5, '', '正常', '', '2021-04-15 14:42:55', '人力资源部');
INSERT INTO covid.emp_health (id, name, sex, phonenum, temp, risk, health, content, createTime, depart) VALUES (12, '刘腾键', 1, 13512365456, 36.5, '', '乏力', '', '2021-04-15 14:46:49', '技术部');

@ -1,28 +0,0 @@
create table emp_iden
(
id bigint auto_increment
primary key,
name varchar(10) null,
sex int(2) null,
idcard varchar(20) null,
idate date null,
place varchar(100) null,
phonenum bigint(100) null,
register datetime null,
status varchar(10) null,
depart varchar(20) null,
constraint emp_iden_ibfk_1
foreign key (depart) references department (name)
on update cascade on delete cascade
);
INSERT INTO covid.emp_iden (id, name, sex, idcard, idate, place, phonenum, register, status, depart) VALUES (1, '李先生', 1, '440524196002152100', '2020-11-13', '广州市第一附属医院', 13457896457, '2020-11-14 15:31:44', '确诊', '财务部');
INSERT INTO covid.emp_iden (id, name, sex, idcard, idate, place, phonenum, register, status, depart) VALUES (2, '蔡二思', 1, '440634199004050312', '2021-03-22', '深圳市福田区第一医院', null, '2021-03-03 11:33:31', '确诊', '财务部');
INSERT INTO covid.emp_iden (id, name, sex, idcard, idate, place, phonenum, register, status, depart) VALUES (3, '王金枝', 0, null, '2021-02-01', '深圳市福田区第一医院', null, null, '疑似', '后勤部');
INSERT INTO covid.emp_iden (id, name, sex, idcard, idate, place, phonenum, register, status, depart) VALUES (4, '季王红', 0, '440578199505150547', '2021-03-02', '佛山市三水人民医院', 13411234457, null, '治愈', null);
INSERT INTO covid.emp_iden (id, name, sex, idcard, idate, place, phonenum, register, status, depart) VALUES (5, '李王思', 1, '440578199902150351', '2021-01-07', '佛山市三水人民医院', 13453456785, '2021-04-06 16:05:11', '疑似', '人力资源部');
INSERT INTO covid.emp_iden (id, name, sex, idcard, idate, place, phonenum, register, status, depart) VALUES (6, '王二会', 1, '440582198005040800', '2021-02-19', '深圳市中心医院', 13457891231, '2020-04-09 16:22:26', '疑似', '后勤部');
INSERT INTO covid.emp_iden (id, name, sex, idcard, idate, place, phonenum, register, status, depart) VALUES (7, '于雪师', 1, '440578198905213551', '2020-12-12', '深圳市中心医院', 1581456785, '2021-04-06 16:05:11', '死亡', '人力资源部');
INSERT INTO covid.emp_iden (id, name, sex, idcard, idate, place, phonenum, register, status, depart) VALUES (10, '阿斯顿', 0, null, '2021-04-01', '汕头市李嘉诚医院', 13531342457, '2021-04-02 14:49:15', '治愈', '财务部');
INSERT INTO covid.emp_iden (id, name, sex, idcard, idate, place, phonenum, register, status, depart) VALUES (11, '士大夫', 0, '34124', '2021-03-31', '广州市暨南大学第一附属医院', 13411213257, '2021-04-02 14:49:32', '死亡', '客服部');
INSERT INTO covid.emp_iden (id, name, sex, idcard, idate, place, phonenum, register, status, depart) VALUES (12, '吴开师', 1, '440578199807050321', '2021-03-18', '佛山市三水人民医院', 13412823457, '2021-04-06 16:05:11', '疑似', '人力资源部');

@ -1,24 +0,0 @@
create table emp_is
(
id bigint auto_increment
primary key,
name varchar(20) null,
sex int(3) null,
phone bigint null,
temp float(10, 2) null,
type varchar(10) null,
place varchar(100) null,
begin datetime null,
end datetime null,
leaved varchar(100) null,
arrived varchar(100) null,
content varchar(255) null,
depart varchar(20) null,
constraint dep
foreign key (depart) references department (name)
);
INSERT INTO covid.emp_is (id, name, sex, phone, temp, type, place, begin, end, leaved, arrived, content, depart) VALUES (1, '黎香湖', 0, 12341231231, 35, '酒店隔离', '广州市广州南站如家酒店', '2021-04-06 00:00:00', '2021-04-20 00:00:00', '广东汕头', '广东东莞', null, '人力资源部');
INSERT INTO covid.emp_is (id, name, sex, phone, temp, type, place, begin, end, leaved, arrived, content, depart) VALUES (2, '王老二', 1, 13545479653, 38.5, '酒店集中隔离', '广州市火车站快捷酒店', '2021-04-14 00:00:00', '2021-04-28 00:00:00', '广东汕头', '广东东莞', '', '后勤部');
INSERT INTO covid.emp_is (id, name, sex, phone, temp, type, place, begin, end, leaved, arrived, content, depart) VALUES (3, '蔡司', 1, 13452342356, 36.6, '酒店集中隔离', '深圳市宝安区平和小区', '2020-11-23 00:00:00', '2020-12-07 00:00:00', '重庆市', '湖南长沙', '', '研发部');
INSERT INTO covid.emp_is (id, name, sex, phone, temp, type, place, begin, end, leaved, arrived, content, depart) VALUES (5, '蔡司', 1, 13452342356, 35.6, '居家隔离', '深圳市宝安区平和小区', '2021-01-09 00:00:00', '2021-01-23 00:00:00', '重庆市', '湖南长沙', '', '研发部');

@ -1,19 +0,0 @@
create table material_manage
(
id int(20) auto_increment
primary key,
name varchar(255) null,
count int null,
type varchar(255) null,
isImp int null,
charge varchar(255) null,
cnum bigint null,
updateTime datetime null
);
INSERT INTO covid.material_manage (id, name, count, type, isImp, charge, cnum, updateTime) VALUES (113, 'KN94口罩', 150, '', 1, '孙迪', 13415135777, '2021-03-31 13:54:36');
INSERT INTO covid.material_manage (id, name, count, type, isImp, charge, cnum, updateTime) VALUES (114, 'N95口罩', 220, '', 1, '孙迪', 13415135777, '2021-04-06 16:14:45');
INSERT INTO covid.material_manage (id, name, count, type, isImp, charge, cnum, updateTime) VALUES (123, '防护服', 30, '', 1, '王旭', 15148796568, '2021-04-22 14:21:56');
INSERT INTO covid.material_manage (id, name, count, type, isImp, charge, cnum, updateTime) VALUES (125, '酒精消毒棉片', 200, '', 1, '李建', 13431357964, '2021-03-31 13:54:06');
INSERT INTO covid.material_manage (id, name, count, type, isImp, charge, cnum, updateTime) VALUES (126, '抽纸纸巾', 20, '', 0, '李玉', 13534654675, '2021-04-22 19:29:30');
INSERT INTO covid.material_manage (id, name, count, type, isImp, charge, cnum, updateTime) VALUES (133, '防护眼罩', 30, '', 1, '杨迪', 123123123123, '2021-04-23 17:00:52');

@ -1,12 +0,0 @@
create table user
(
id int auto_increment
primary key,
username varchar(20) null,
password varchar(255) null,
depart varchar(20) null
);
INSERT INTO covid.user (id, username, password, depart) VALUES (1, 'admin', 'e10adc3949ba59abbe56e057f20f883e', '人力资源部');
INSERT INTO covid.user (id, username, password, depart) VALUES (3, 'root', 'e10adc3949ba59abbe56e057f20f883e', '后勤部');
INSERT INTO covid.user (id, username, password, depart) VALUES (12, '994091246', 'd7d7b53081e1e3ecbd28c30c34b4bcd3', '技术部');

@ -0,0 +1,24 @@
<template>
<div id="app">
<router-view></router-view>
</div>
</template>
<style>
.el-header {
background-color: #B3C0D1;
color: #333;
line-height: 60px;
}
.el-aside {
color: #333;
}
</style>
<script>
export default {
};
</script>

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

@ -0,0 +1,59 @@
<template>
<div class="hello">
<h1>{{ msg }}</h1>
<p>
For a guide and recipes on how to configure / customize this project,<br>
check out the
<a href="https://cli.vuejs.org" target="_blank" rel="noopener">vue-cli documentation</a>.
</p>
<h3>Installed CLI Plugins</h3>
<ul>
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-babel" target="_blank" rel="noopener">babel</a></li>
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-router" target="_blank" rel="noopener">router</a></li>
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-vuex" target="_blank" rel="noopener">vuex</a></li>
</ul>
<h3>Essential Links</h3>
<ul>
<li><a href="https://vuejs.org" target="_blank" rel="noopener">Core Docs</a></li>
<li><a href="https://forum.vuejs.org" target="_blank" rel="noopener">Forum</a></li>
<li><a href="https://chat.vuejs.org" target="_blank" rel="noopener">Community Chat</a></li>
<li><a href="https://twitter.com/vuejs" target="_blank" rel="noopener">Twitter</a></li>
<li><a href="https://news.vuejs.org" target="_blank" rel="noopener">News</a></li>
</ul>
<h3>Ecosystem</h3>
<ul>
<li><a href="https://router.vuejs.org" target="_blank" rel="noopener">vue-router</a></li>
<li><a href="https://vuex.vuejs.org" target="_blank" rel="noopener">vuex</a></li>
<li><a href="https://github.com/vuejs/vue-devtools#vue-devtools" target="_blank" rel="noopener">vue-devtools</a></li>
<li><a href="https://vue-loader.vuejs.org" target="_blank" rel="noopener">vue-loader</a></li>
<li><a href="https://github.com/vuejs/awesome-vue" target="_blank" rel="noopener">awesome-vue</a></li>
</ul>
</div>
</template>
<script>
export default {
name: 'HelloWorld',
props: {
msg: String
}
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h3 {
margin: 40px 0 0;
}
ul {
list-style-type: none;
padding: 0;
}
li {
display: inline-block;
margin: 0 10px;
}
a {
color: #42b983;
}
</style>

@ -0,0 +1,15 @@
import Vue from 'vue'
import './plugins/axios'
import App from './App.vue'
import router from './router'
import store from './store'
import './plugins/element.js'
import * as echarts from 'echarts'
Vue.prototype.$echarts = echarts
Vue.config.productionTip = false
new Vue({
router,
store,
render: h => h(App)
}).$mount('#app')

@ -4,15 +4,23 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
// 配置类,用于设置全局跨域访问的规则
@Configuration
public class CrosConfig implements WebMvcConfigurer {
// 重写 addCorsMappings 方法,配置跨域访问规则
@Override
public void addCorsMappings(CorsRegistry registry) {
// 允许所有路径的跨域请求
registry.addMapping("/**")
// 允许的来源,"*" 表示任意来源
.allowedOrigins("*")
// 允许的 HTTP 方法
.allowedMethods("GET","HEAD","POST","PUT","DELETE","OPTIONS")
// 是否允许携带凭据(如 Cookie
.allowCredentials(true)
// 预检请求的缓存时间,单位为秒
.maxAge(3600)
// 允许的请求头,"*" 表示任意请求头
.allowedHeaders("*");
}
}

@ -6,13 +6,17 @@ import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerIntercept
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
// 配置类,用于设置 MyBatis Plus 的拦截器
@Configuration
public class MybatisPlusConfig {
// 声明一个 MybatisPlusInterceptor Bean
@Bean
public MybatisPlusInterceptor mybatisPlusInterceptor() {
// 创建 MybatisPlusInterceptor 对象
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
// 添加分页拦截器,指定数据库类型为 MySQL
interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
// 返回配置完成的拦截器实例
return interceptor;
}
}

@ -12,15 +12,18 @@ import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.List;
// 控制器类,用于处理与部门相关的请求
@RestController
@RequestMapping("/depart")
public class DepartController {
// 自动注入 DepartService 服务
@Autowired
DepartService service;
// 处理 GET 请求,返回所有部门信息的列表// 处理 GET 请求,返回所有部门信息的列表
@GetMapping("/findAll")
private List<String> findAll(){
return service.getAll();
}
}// 调用服务层方法获取所有部门信息
}

@ -9,26 +9,31 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
// 控制器类,用于处理与员工健康信息相关的请求
@RestController
@RequestMapping("/emp")
public class EmpController {
// 自动注入 EmpMapper 对象
@Autowired
private EmpMapper mapper;
//分页查询
// 分页查询员工健康信息
@GetMapping("/findAll/{page}/{size}")
public Page<EmpHealth> findAll(@PathVariable("page") Integer page, @PathVariable("size") Integer size){
// 创建查询条件,按创建时间降序排列
QueryWrapper<EmpHealth> wrapper=new QueryWrapper<>();
wrapper.orderByDesc("createTime");
// 创建分页对象
Page<EmpHealth> page1= new Page<>(page,size);
// 执行分页查询并返回结果
Page<EmpHealth> result=mapper.selectPage(page1,wrapper).addOrder();
return result;
}
// 保存员工健康信息
@PostMapping("/save")
public String save(@RequestBody EmpHealth emp){
// 插入数据并返回操作结果
int result = mapper.insert(emp);
if (result==1){
return "success";
@ -37,13 +42,16 @@ public class EmpController {
}
}
// 根据员工 ID 查询健康信息
@GetMapping("/findById/{id}")
public EmpHealth findById(@PathVariable("id") Integer id){
return mapper.selectById(id);
}
}// 根据 ID 查询数据并返回
// 更新员工健康信息
@PutMapping("/update")
public String update(@RequestBody EmpHealth emp){
// 更新数据并返回操作结果
int result=mapper.updateById(emp);
if (result==1){
return "success";
@ -52,15 +60,19 @@ public class EmpController {
}
}
// 根据员工 ID 删除健康信息
@DeleteMapping("/deleteById/{id}")
public void deleteById(@PathVariable("id")Long id){
mapper.deleteById(id+"L");
}
}// 删除指定 ID 的数据
// 根据指定字段和内容搜索员工健康信息
@GetMapping("/search/{searchkey}/{stext}")
public List<EmpHealth> search(@PathVariable("searchkey")String searchkey, @PathVariable("stext")String stext){
// 创建查询条件,按指定字段进行模糊搜索
QueryWrapper<EmpHealth> userQueryWrapper = Wrappers.query();
userQueryWrapper.like(searchkey,stext);
// 返回符合条件的数据列表
return mapper.selectList(userQueryWrapper);
}
}

@ -14,68 +14,109 @@ import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
/**
*
*/
@RestController
@RequestMapping("/empiden")
public class EmpIdenController {
@Autowired
private ChartService chartService;
private ChartService chartService; // 图表服务
@Autowired
private EmpIdenMapper mapper;
private EmpIdenMapper mapper; // 员工身份信息的 Mapper
//分页查询
/**
*
* @param page
* @param size
* @return
*/
@GetMapping("/findAll/{page}/{size}")
public Page<EmpIden> findAll(@PathVariable("page") Integer page, @PathVariable("size") Integer size){
Page<EmpIden> page1= new Page<>(page,size);
Page<EmpIden> result=mapper.selectPage(page1,null);
public Page<EmpIden> findAll(@PathVariable("page") Integer page, @PathVariable("size") Integer size) {
Page<EmpIden> page1 = new Page<>(page, size);
Page<EmpIden> result = mapper.selectPage(page1, null);
return result;
}
/**
*
* @param empIden
* @return "success" "error"
*/
@PostMapping("/save")
public String save(@RequestBody EmpIden empIden){
public String save(@RequestBody EmpIden empIden) {
int result = mapper.insert(empIden);
if (result==1){
if (result == 1) {
return "success";
}else {
} else {
return "error";
}
}
/**
* 线
* @return 线
*/
@GetMapping("/LineVO")
public LineVO getLineVO(){
public LineVO getLineVO() {
return this.chartService.lineVOList();
}
/**
*
* @return
*/
@GetMapping("/PieVO")
public List<PieVo> getPieVO(){
public List<PieVo> getPieVO() {
return this.chartService.pieVOMap();
}
/**
* ID
* @param id ID
* @return
*/
@GetMapping("/findById/{id}")
public EmpIden findById(@PathVariable("id") Integer id){
public EmpIden findById(@PathVariable("id") Integer id) {
return mapper.selectById(id);
}
/**
*
* @param empIden
* @return "success" "error"
*/
@PutMapping("/update")
public String update(@RequestBody EmpIden empIden){
int result=mapper.updateById(empIden);
if (result==1){
public String update(@RequestBody EmpIden empIden) {
int result = mapper.updateById(empIden);
if (result == 1) {
return "success";
}else {
} else {
return "error";
}
}
/**
* ID
* @param id ID
*/
@DeleteMapping("/deleteById/{id}")
public void deleteById(@PathVariable("id")Long id){
mapper.deleteById(id+"L");
public void deleteById(@PathVariable("id") Long id) {
mapper.deleteById(id + "L");
}
/**
*
* @param searchkey
* @param stext
* @return
*/
@GetMapping("/search/{searchkey}/{stext}")
public List<EmpIden> search(@PathVariable("searchkey")String searchkey, @PathVariable("stext")String stext){
public List<EmpIden> search(@PathVariable("searchkey") String searchkey, @PathVariable("stext") String stext) {
QueryWrapper<EmpIden> userQueryWrapper = Wrappers.query();
userQueryWrapper.like(searchkey,stext);
userQueryWrapper.like(searchkey, stext);
return mapper.selectList(userQueryWrapper);
}
}

@ -1,6 +1,5 @@
package com.liu.covid.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@ -15,67 +14,104 @@ import java.util.Calendar;
import java.util.Date;
import java.util.List;
/**
*
*/
@RestController
@RequestMapping("/empis")
public class EmpIsController {
@Autowired
private EmpIsMapper mapper;
private EmpIsMapper mapper; // 员工身份信息的 Mapper
//分页查询
/**
*
* @param page
* @param size
* @return
*/
@GetMapping("/findAll/{page}/{size}")
public Page<EmpIs> findAll(@PathVariable("page") Integer page, @PathVariable("size") Integer size){
Page<EmpIs> page1= new Page<>(page,size);
Page<EmpIs> result=mapper.selectPage(page1,null);
public Page<EmpIs> findAll(@PathVariable("page") Integer page, @PathVariable("size") Integer size) {
Page<EmpIs> page1 = new Page<>(page, size);
Page<EmpIs> result = mapper.selectPage(page1, null);
return result;
}
/**
*
* @param empis
* @return "success" "error"
*/
@PostMapping("/save")
public String save(@RequestBody EmpIs empis){
public String save(@RequestBody EmpIs empis) {
// 设置结束日期为开始日期后14天
Format f = new SimpleDateFormat("yyyy-MM-dd");
Calendar c = Calendar.getInstance();
c.setTime(empis.getBegin());
c.add(Calendar.DAY_OF_MONTH, 14);
c.add(Calendar.DAY_OF_MONTH, 14); // 增加14天
Date end = c.getTime();
empis.setEnd(end);
int result = mapper.insert(empis);
if (result==1){
if (result == 1) {
return "success";
}else {
} else {
return "error";
}
}
/**
* ID
* @param id ID
* @return
*/
@GetMapping("/findById/{id}")
public EmpIs findById(@PathVariable("id") Integer id){
public EmpIs findById(@PathVariable("id") Integer id) {
return mapper.selectById(id);
}
/**
*
* @param empis
* @return "success" "error"
*/
@PutMapping("/update")
public String update(@RequestBody EmpIs empis){
public String update(@RequestBody EmpIs empis) {
// 设置结束日期为开始日期后14天
Format f = new SimpleDateFormat("yyyy-MM-dd");
Calendar c = Calendar.getInstance();
c.setTime(empis.getBegin());
c.add(Calendar.DAY_OF_MONTH, 14);
c.add(Calendar.DAY_OF_MONTH, 14); // 增加14天
Date end = c.getTime();
empis.setEnd(end);
int result=mapper.updateById(empis);
if (result==1){
int result = mapper.updateById(empis);
if (result == 1) {
return "success";
}else {
} else {
return "error";
}
}
/**
* ID
* @param id ID
*/
@DeleteMapping("/deleteById/{id}")
public void deleteById(@PathVariable("id")Long id){
mapper.deleteById(id+"L");
public void deleteById(@PathVariable("id") Long id) {
mapper.deleteById(id + "L");
}
/**
*
* @param searchkey
* @param stext
* @return
*/
@GetMapping("/search/{searchkey}/{stext}")
public List<EmpIs> search(@PathVariable("searchkey")String searchkey, @PathVariable("stext")String stext){
public List<EmpIs> search(@PathVariable("searchkey") String searchkey, @PathVariable("stext") String stext) {
QueryWrapper<EmpIs> userQueryWrapper = Wrappers.query();
userQueryWrapper.like(searchkey,stext);
userQueryWrapper.like(searchkey, stext); // 模糊查询
return mapper.selectList(userQueryWrapper);
}
}

@ -1,27 +1,41 @@
package com.liu.covid.controller;
import com.liu.covid.entity.User;
import com.liu.covid.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
*
*/
@RestController
@RequestMapping("/userlogin")
public class LoginController {
@Autowired
UserService userService;
UserService userService; // 用户服务,用于处理登录和注册逻辑
/**
*
* @param loginform
* @return
*/
@PostMapping("/user")
public String login(@RequestBody User loginform){
String message=userService.login(loginform);
return message;
public String login(@RequestBody User loginform) {
// 调用 userService 的 login 方法进行登录验证
String message = userService.login(loginform);
return message; // 返回登录结果消息
}
@PostMapping("/register")
public String register(@RequestBody User reUser){
String message=userService.register(reUser);
return message;
/**
*
* @param reUser
* @return
*/
@PostMapping("/register")
public String register(@RequestBody User reUser) {
// 调用 userService 的 register 方法进行用户注册
String message = userService.register(reUser);
return message; // 返回注册结果消息
}
}

@ -3,7 +3,6 @@ package com.liu.covid.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.liu.covid.entity.EmpIs;
import com.liu.covid.entity.MaterialManage;
import com.liu.covid.mapper.MaterialMapper;
import org.springframework.beans.factory.annotation.Autowired;
@ -11,55 +10,88 @@ import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
*
*/
@RestController
@RequestMapping("/Material")
public class MaterialController {
@Autowired
private MaterialMapper mapper;
private MaterialMapper mapper; // 物资管理的 Mapper
//分页查询
/**
*
* @param page
* @param size
* @return
*/
@GetMapping("/findAll/{page}/{size}")
public Page<MaterialManage> findAll(@PathVariable("page") Integer page, @PathVariable("size") Integer size){
Page<MaterialManage> page1= new Page<>(page,size);
Page<MaterialManage> result=mapper.selectPage(page1,null);
public Page<MaterialManage> findAll(@PathVariable("page") Integer page, @PathVariable("size") Integer size) {
Page<MaterialManage> page1 = new Page<>(page, size);
Page<MaterialManage> result = mapper.selectPage(page1, null);
return result;
}
/**
*
* @param material
* @return "success" "error"
*/
@PostMapping("/save")
public String save(@RequestBody MaterialManage material){
public String save(@RequestBody MaterialManage material) {
int result = mapper.insert(material);
if (result==1){
if (result == 1) {
return "success";
}else {
} else {
return "error";
}
}
/**
* ID
* @param id ID
* @return
*/
@GetMapping("/findById/{id}")
public MaterialManage findById(@PathVariable("id") Integer id){
public MaterialManage findById(@PathVariable("id") Integer id) {
return mapper.selectById(id);
}
/**
*
* @param material
* @return "success" "error"
*/
@PutMapping("/update")
public String update(@RequestBody MaterialManage material){
int result=mapper.updateById(material);
if (result==1){
public String update(@RequestBody MaterialManage material) {
int result = mapper.updateById(material);
if (result == 1) {
return "success";
}else {
} else {
return "error";
}
}
/**
* ID
* @param id ID
*/
@DeleteMapping("/deleteById/{id}")
public void deleteById(@PathVariable("id")Long id){
mapper.deleteById(id+"L");
public void deleteById(@PathVariable("id") Long id) {
mapper.deleteById(id + "L");
}
/**
*
* @param searchkey
* @param stext
* @return
*/
@GetMapping("/search/{searchkey}/{stext}")
public List<MaterialManage> search(@PathVariable("searchkey")String searchkey, @PathVariable("stext")String stext){
public List<MaterialManage> search(@PathVariable("searchkey") String searchkey, @PathVariable("stext") String stext) {
QueryWrapper<MaterialManage> userQueryWrapper = Wrappers.query();
userQueryWrapper.like(searchkey,stext);
userQueryWrapper.like(searchkey, stext); // 模糊查询
return mapper.selectList(userQueryWrapper);
}
}

@ -9,5 +9,4 @@ public class Department {
private Integer id;
private String name;
private String charge;
}

@ -10,20 +10,43 @@ import lombok.Data;
import java.util.Date;
/**
*
*
*/
@Data
public class EmpHealth {
// 员工健康记录的唯一标识,主键自增长
@TableId(type = IdType.AUTO)
private Long id;
// 员工姓名
private String name;
// 员工性别,使用 GenderEnum 枚举类型
private GenderEnum sex;
// 员工联系电话
private Long phonenum;
// 员工体温
private float temp;
// 健康风险评估
private String risk;
// 员工健康状态(如:健康、需要隔离等)
private String health;
// 健康内容的详细说明
private String content;
// 员工所属部门
private String depart;
@TableField(value = "createTime" ,fill = FieldFill.INSERT)
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
// 记录的创建时间,插入时自动填充,格式为 "yyyy-MM-dd HH:mm:ss"
@TableField(value = "createTime", fill = FieldFill.INSERT)
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date createTime;
}

@ -10,24 +10,44 @@ import lombok.Data;
import java.util.Date;
/**
*
*
*/
@Data
public class EmpIden {
// 员工身份记录的唯一标识,主键自增长
@TableId(type = IdType.AUTO)
private Long id;
// 员工姓名
private String name;
// 员工状态(例如:在职、离职等)
private String status;
// 员工性别,使用 GenderEnum 枚举类型
private GenderEnum sex;
// 员工身份证号码
private Long idcard;
@JsonFormat(pattern = "yyyy-MM-dd",timezone="GMT+8")
// 员工身份证发证日期,格式为 "yyyy-MM-dd"
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date idate;
// 员工出生地
private String place;
// 员工所属部门
private String depart;
// 员工联系电话
private Long phonenum;
@TableField(value = "register" ,fill = FieldFill.INSERT)
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
// 员工注册时间,插入时自动填充,格式为 "yyyy-MM-dd HH:mm:ss"
@TableField(value = "register", fill = FieldFill.INSERT)
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date register;
}

@ -8,22 +8,52 @@ import lombok.Data;
import java.util.Date;
/**
*
*
*/
@Data
public class EmpIs {
// 员工隔离记录的唯一标识,主键自增长
@TableId(type = IdType.AUTO)
private Long id;
// 员工姓名
private String name;
// 员工性别,使用 GenderEnum 枚举类型
private GenderEnum sex;
// 员工联系电话
private Long phone;
// 员工体温
private float temp;
// 隔离类型(例如:居家、集中等)
private String type;
// 隔离地点
private String place;
@JsonFormat(pattern = "yyyy-MM-dd",timezone="GMT+8")
// 隔离开始日期,格式为 "yyyy-MM-dd"
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date begin;
@JsonFormat(pattern = "yyyy-MM-dd",timezone="GMT+8")
private Date end;
// 隔离结束日期,格式为 "yyyy-MM-dd"
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date end;
// 是否离开隔离地点
private String leaved;
// 隔离期间的健康内容说明
private String content;
// 是否已到达隔离地点
private String arrived;
// 员工所属部门
private String depart;
}

@ -2,16 +2,22 @@ package com.liu.covid.entity.Enum;
import com.baomidou.mybatisplus.annotation.EnumValue;
public enum GenderEnum {
(1,"男"),
(0,"女");
/**
*
*
*/
public enum GenderEnum {
(1, "男"), // 男性code为1
(0, "女"); // 女性code为0
// 枚举类的构造函数传入code和gender值
GenderEnum(Integer code, String gender) {
this.code = code;
this.gender = gender;
}
@EnumValue
private Integer code;
private String gender;
@EnumValue // 标记该字段为数据库存储的值
private Integer code; // 性别代码1为男性0为女性
private String gender; // 性别名称:男或女
}

@ -2,16 +2,22 @@ package com.liu.covid.entity.Enum;
import com.baomidou.mybatisplus.annotation.EnumValue;
public enum ImpEnum {
(1,"是"),
(0,"否");
/**
*
*
*/
public enum ImpEnum {
(1, "是"), // 表示重要code为1
(0, "否"); // 表示不重要code为0
// 枚举类的构造函数传入code和isImp值
ImpEnum(Integer code, String isImp) {
this.code = code;
this.isImp = isImp;
}
@EnumValue
private Integer code;
private String isImp;
@EnumValue // 标记该字段为数据库存储的值
private Integer code; // 是否重要的代码1为是0为否
private String isImp; // 是否重要的名称:是或否
}

@ -7,22 +7,39 @@ import lombok.Data;
import java.util.Date;
/**
*
*
*/
@Data
@TableName(value = "material_manage")
public class MaterialManage {
// 物资管理记录的唯一标识,主键自增长
@TableId(type = IdType.AUTO)
private Long id;
// 物资名称
private String name;
// 物资数量
private int count;
// 物资类型
private String type;
// 物资是否重要,使用 ImpEnum 枚举类型(例如:是、否)
@TableField(value = "isImp")
private ImpEnum isImp;
// 物资负责人
private String charge;
// 物资负责人联系方式
private Long cnum;
@TableField(value = "updateTime" ,fill = FieldFill.INSERT_UPDATE)
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
private Date updateTime;
// 物资管理记录的更新时间,插入或更新时自动填充,格式为 "yyyy-MM-dd HH:mm:ss"
@TableField(value = "updateTime", fill = FieldFill.INSERT_UPDATE)
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date updateTime;
}

@ -6,17 +6,34 @@ import org.springframework.stereotype.Component;
import java.util.Date;
/**
* MyMetaObjectHandler
*
*/
@Component
public class MyMetaObjectHandler implements MetaObjectHandler {
/**
*
* createTimeregister updateTime
*/
@Override
public void insertFill(MetaObject metaObject) {
this.setFieldValByName("createTime",new Date(),metaObject);
this.setFieldValByName("register",new Date(),metaObject);
this.setFieldValByName("updateTime",new Date(),metaObject);
// 设置 createTime 字段为当前时间
this.setFieldValByName("createTime", new Date(), metaObject);
// 设置 register 字段为当前时间
this.setFieldValByName("register", new Date(), metaObject);
// 设置 updateTime 字段为当前时间
this.setFieldValByName("updateTime", new Date(), metaObject);
}
/**
*
* updateTime
*/
@Override
public void updateFill(MetaObject metaObject) {
this.setFieldValByName("updateTime",new Date(),metaObject);
// 设置 updateTime 字段为当前时间
this.setFieldValByName("updateTime", new Date(), metaObject);
}
}

@ -18,76 +18,91 @@ import org.springframework.stereotype.Service;
import java.text.SimpleDateFormat;
import java.util.*;
/**
* ChartServiceImpl ChartService
* 线
*/
@Service
public class ChartServiceImpl extends ServiceImpl<EmpIdenMapper, EmpIden> implements ChartService {
@Autowired
private EmpIdenMapper empIdenMapper;
private EmpIdenMapper empIdenMapper; // 自动注入 EmpIdenMapper用于操作身份证信息表
@Autowired
private EmpIsMapper empIsMapper;
private EmpIsMapper empIsMapper; // 自动注入 EmpIsMapper用于操作隔离信息表
@Autowired
private MaterialMapper materialMapper;
private MaterialMapper materialMapper; // 自动注入 MaterialMapper用于操作物资管理表
@Override
public LineVO lineVOList() {
LineVO lineVO = new LineVO();
Date date = new Date();
Calendar cal = Calendar.getInstance();
List<String> month = new ArrayList<>();
List<Integer> list=new ArrayList<>();
Map<String, List> all = new HashMap<>();
String type[] = {"确诊", "疑似", "治愈", "死亡"};
/**
* lineVOList 线 7
* @return LineVO 线
*/
@Override
public LineVO lineVOList() {
LineVO lineVO = new LineVO(); // 创建 LineVO 对象,用于存储折线图数据
Date date = new Date(); // 当前时间
Calendar cal = Calendar.getInstance(); // 获取当前时间的 Calendar 对象
List<String> month = new ArrayList<>(); // 用于存储过去 7 个月的月份
List<Integer> list = new ArrayList<>(); // 用于存储隔离人数的数量
Map<String, List> all = new HashMap<>(); // 存储每个疾病状态的数量
String type[] = {"确诊", "疑似", "治愈", "死亡"}; // 疾病状态类型数组
for (int i = 0; i < 7; i++) {
cal.setTime(date);
cal.set(Calendar.MONTH, cal.get(Calendar.MONTH) - i);
SimpleDateFormat ft = new SimpleDateFormat("yyyy-MM");
String mon = ft.format(cal.getTime());
month.add(mon);
}
//设置折线图月份
Collections.reverse(month);
lineVO.setMonth(month);
// 获取过去 7 个月的月份
for (int i = 0; i < 7; i++) {
cal.setTime(date);
cal.set(Calendar.MONTH, cal.get(Calendar.MONTH) - i); // 设置当前月份减去 i 个月
SimpleDateFormat ft = new SimpleDateFormat("yyyy-MM"); // 格式化日期为 "yyyy-MM" 格式
String mon = ft.format(cal.getTime()); // 获取当前月份
month.add(mon); // 将月份添加到 month 列表中
}
Collections.reverse(month); // 翻转月份列表,确保月份顺序从过去到现在
lineVO.setMonth(month); // 设置 LineVO 中的月份
// 设置 类型-数量 键值对
for (String t : type) {
List<Integer> cot=new ArrayList<>();
int j = 0;
while (j <7 ) {
QueryWrapper<EmpIden> userQueryWrapper = Wrappers.query();
userQueryWrapper.like("status", t).likeRight("idate", month.get(j++));
Integer count = empIdenMapper.selectCount(userQueryWrapper);
cot.add(count);
userQueryWrapper.clear();
}
all.put(t, cot);
}
// 获取每个疾病状态类型在过去 7 个月内的数量
for (String t : type) {
List<Integer> cot = new ArrayList<>();
int j = 0;
while (j <7 ) {
QueryWrapper<EmpIs> userQueryWrapper = Wrappers.query();
userQueryWrapper.likeRight("begin", month.get(j++));
Integer count = empIsMapper.selectCount(userQueryWrapper);
list.add(count);
while (j < 7) {
QueryWrapper<EmpIden> userQueryWrapper = Wrappers.query(); // 创建查询条件
userQueryWrapper.like("status", t).likeRight("idate", month.get(j++)); // 根据状态和月份查询
Integer count = empIdenMapper.selectCount(userQueryWrapper); // 获取符合条件的记录数量
cot.add(count); // 将数量添加到 cot 列表中
userQueryWrapper.clear(); // 清除查询条件
}
all.put("隔离", list);
lineVO.setStatus(all);
return lineVO;
all.put(t, cot); // 将疾病状态和数量添加到 all 映射中
}
// 获取过去 7 个月内的隔离人数
int j = 0;
while (j < 7) {
QueryWrapper<EmpIs> userQueryWrapper = Wrappers.query(); // 创建查询条件
userQueryWrapper.likeRight("begin", month.get(j++)); // 根据月份查询
Integer count = empIsMapper.selectCount(userQueryWrapper); // 获取隔离人数
list.add(count); // 将隔离人数添加到 list 列表中
}
all.put("隔离", list); // 将隔离人数添加到 all 映射中
lineVO.setStatus(all); // 设置 LineVO 中的疾病状态数量映射
return lineVO; // 返回 LineVO 对象
}
/**
* pieVOMap
* @return List<PieVo>
*/
@Override
public List<PieVo> pieVOMap() {
List<PieVo> pielist=new ArrayList<>();
QueryWrapper queryWrapper=new QueryWrapper();
queryWrapper.eq("isImp","1");
List<MaterialManage> list=materialMapper.selectList(queryWrapper);
for (MaterialManage mat:list){
PieVo pieVo=new PieVo();
pieVo.setName(mat.getName());
pieVo.setValue(mat.getCount());
pielist.add(pieVo);
List<PieVo> pielist = new ArrayList<>(); // 用于存储饼图数据的列表
QueryWrapper queryWrapper = new QueryWrapper(); // 创建查询条件
queryWrapper.eq("isImp", "1"); // 查询 isImp 字段为 1 的记录,表示重要物资
List<MaterialManage> list = materialMapper.selectList(queryWrapper); // 获取符合条件的物资记录
// 遍历所有重要物资,创建 PieVo 对象存储物资名称和数量
for (MaterialManage mat : list) {
PieVo pieVo = new PieVo();
pieVo.setName(mat.getName()); // 设置物资名称
pieVo.setValue(mat.getCount()); // 设置物资数量
pielist.add(pieVo); // 将 PieVo 对象添加到 pielist 列表中
}
return pielist;
return pielist; // 返回饼图数据列表
}
}

@ -12,19 +12,27 @@ import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
/**
* DepartServiceImpl DepartService
*/
@Service
public class DepartServiceImpl extends ServiceImpl<DepartMapper, Department> implements DepartService {
@Autowired
private DepartMapper mapper;
private DepartMapper mapper; // 自动注入 DepartMapper用于操作部门数据表
/**
*
* @return List<String>
*/
@Override
public List<String> getAll() {
List<Department> list;
List<String> name=new ArrayList<>();
list=mapper.selectList(null);
for (Department de:list){
name.add(de.getName());
List<Department> list; // 用于存储从数据库中查询到的所有部门信息
List<String> name = new ArrayList<>(); // 用于存储所有部门名称的列表
list = mapper.selectList(null); // 查询所有部门记录
for (Department de : list) { // 遍历查询到的部门记录
name.add(de.getName()); // 将部门名称添加到 name 列表中
}
return name;
return name; // 返回部门名称列表
}
}

@ -14,38 +14,82 @@ import org.springframework.util.DigestUtils;
import java.util.List;
/**
* UserServiceImpl UserService
*/
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {
@Autowired
UserMapper mapper;
UserMapper mapper; // 自动注入 UserMapper用于操作用户数据表
/**
*
* @param user
* @return "success" "error"
*/
@Override
public String login(User user) {
// 创建查询条件,根据用户名查询用户
QueryWrapper<User> userQueryWrapper = Wrappers.query();
userQueryWrapper.like("username", user.getUsername());
// 查询用户列表
List<User> list = mapper.selectList(userQueryWrapper);
if (list.size()!=0){
String password= DigestUtils.md5DigestAsHex(user.getPassword().getBytes());
if (list.get(0).getPassword().equals(password)){
return "success";
}else return "error";
}else return "error";
// 如果用户存在
if (list.size() != 0) {
// 对用户输入的密码进行MD5加密
String password = DigestUtils.md5DigestAsHex(user.getPassword().getBytes());
// 比较加密后的密码与数据库中的密码是否一致
if (list.get(0).getPassword().equals(password)) {
return "success"; // 密码匹配,登录成功
} else {
return "error"; // 密码不匹配,登录失败
}
} else {
return "error"; // 用户不存在,登录失败
}
}
/**
*
* @param user
* @return "success""error""repeat"
*/
@Override
public String register(User user) {
if (user!=null){
boolean flag=true;
for (User list:mapper.selectList(null)){
if (list.getUsername().equals(user.getUsername()))
flag=false;
// 判断用户信息是否为空
if (user != null) {
boolean flag = true;
// 检查用户名是否已经存在
for (User list : mapper.selectList(null)) {
if (list.getUsername().equals(user.getUsername())) {
flag = false; // 如果用户名已存在,则标记为 false
break;
}
}
// 如果用户名没有重复
if (flag) {
// 对用户输入的密码进行MD5加密
String pw = DigestUtils.md5DigestAsHex(user.getPassword().getBytes());
user.setPassword(pw); // 设置加密后的密码
// 插入用户数据
int index = mapper.insert(user);
// 判断插入是否成功
if (index == 1) {
return "success"; // 注册成功
} else {
return "error"; // 注册失败
}
} else {
return "repeat"; // 用户名重复,不能注册
}
if (flag){
String pw=DigestUtils.md5DigestAsHex(user.getPassword().getBytes());
user.setPassword(pw);
int index=mapper.insert(user);
if (index==1){return "success";}else return "error";
}else return "repeat";
}else return "error";
} else {
return "error"; // 用户信息为空,注册失败
}
}
}

@ -1,29 +1,44 @@
package com.liu.covid.util;
import java.sql.*;
/**
* JDBCUtils
* 使 MySQL
*/
public class JDBCUtils {
static final String url="jdbc:mysql://localhost:3306/covid?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai";
static final String user="root";
static final String password="123456";
// 数据库连接的 URL包含数据库名称、字符编码及时区设置
static final String url = "jdbc:mysql://localhost:3306/covid?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai";
// 数据库的用户名
static final String user = "root";
// 数据库的密码
static final String password = "123456";
// 数据库连接对象
private static Connection con;
/**
*
* @return
* @return null
*/
public static Connection getConnection(){
//添加驱动
// 加载数据库驱动
try {
Class.forName("coym.msql.cj.jdbc.Driver");// 8.0以后版本加载驱动
}catch (ClassNotFoundException e){
e.printStackTrace();
Class.forName("coym.msql.cj.jdbc.Driver"); // 加载 MySQL 驱动8.0 版本及以上)
} catch (ClassNotFoundException e) {
e.printStackTrace(); // 如果驱动加载失败,打印异常
}
//进行连接
// 进行数据库连接
try {
con= DriverManager.getConnection(url, user, password);
con.setAutoCommit(true);
}catch (SQLException e){
e.printStackTrace();
con = DriverManager.getConnection(url, user, password); // 使用 JDBC URL、用户名和密码进行连接
con.setAutoCommit(true); // 设置自动提交事务
} catch (SQLException e) {
e.printStackTrace(); // 如果连接失败,打印异常
}
return con;
return con; // 返回连接对象
}
}

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/java" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

@ -0,0 +1,61 @@
"use strict";
import Vue from 'vue';
import axios from "axios";
// Full config: https://github.com/axios/axios#request-config
// axios.defaults.baseURL = process.env.baseURL || process.env.apiUrl || '';
// axios.defaults.headers.common['Authorization'] = AUTH_TOKEN;
// axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';
let config = {
// baseURL: process.env.baseURL || process.env.apiUrl || ""
// timeout: 60 * 1000, // Timeout
// withCredentials: true, // Check cross-site Access-Control
};
const _axios = axios.create(config);
_axios.interceptors.request.use(
function(config) {
// Do something before request is sent
return config;
},
function(error) {
// Do something with request error
return Promise.reject(error);
}
);
// Add a response interceptor
_axios.interceptors.response.use(
function(response) {
// Do something with response data
return response;
},
function(error) {
// Do something with response error
return Promise.reject(error);
}
);
Plugin.install = function(Vue, options) {
Vue.axios = _axios;
window.axios = _axios;
Object.defineProperties(Vue.prototype, {
axios: {
get() {
return _axios;
}
},
$axios: {
get() {
return _axios;
}
},
});
};
Vue.use(Plugin)
export default Plugin;

@ -0,0 +1,5 @@
import Vue from 'vue'
import Element from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
Vue.use(Element)

@ -0,0 +1,85 @@
import Vue from 'vue'
import VueRouter from 'vue-router'
import Index from '../views/Index.vue'
import Login from '../views/login.vue'
Vue.use(VueRouter)
const routes = [
//配置默认的路径,默认显示登录页
{ path: '/', meta:false, component: () => import('../views/login.vue')},
{
path: "/Index",
name:"日常防控管理",
component:Index,
meta:true,
children:[
{
path:"/RecordManage",
name:"打卡记录",
component:() => import('../views/RecordManage.vue')
},
{
path:"/AddRecord",
name:"健康打卡申报",
component:()=>import('../views/AddRecord.vue')
}
]
},
{
path: "/Index",
name:"异常人员管理",
component:Index,
meta:true,
children:[
{
path:"/IdenManage",
name:"疑似/确诊人员登记",
component:() => import(/* webpackChunkName: "BlogManage" */ '../views/IdenManage.vue')
//const Foo = () => import(/* webpackChunkName: "group-foo" */ './Foo.vue')
},
{
path:"/IsManage",
name:"隔离人员登记",
component:()=>import(/* webpackChunkName:"AddBlog" */ '../views/IsManage.vue')
}
]
},
{
path: "/Index",
name:"防疫物资管理",
component:Index,
meta:true,
children:[{
path:"/MaterialManage",
name:"防疫物资查看",
component:()=>import(/* webpackChunkName:"MaterialManage" */ '../views/MaterialManage.vue')
},{
path:"/AddMaterial",
name:"新增防疫物资",
component:()=>import(/* webpackChunkName:"AddMaterial" */ '../views/AddMaterial.vue')
}
]
},
{
path: "/Index",
name:"疫情概况",
component:Index,
meta:true,
children:[{
path:"/EChart",
name:"防疫数据可视化",
component:()=>import(/* webpackChunkName:"MaterialManage" */ '../views/EChart.vue')
}
]
}
]
const router = new VueRouter({
mode: 'history',
base: process.env.BASE_URL,
routes
})
export default router

@ -0,0 +1,15 @@
import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
export default new Vuex.Store({
state: {
},
mutations: {
},
actions: {
},
modules: {
}
})

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/java" isTestSource="true" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="main" />
</component>
</module>

@ -0,0 +1,89 @@
<template>
<el-form style="width:60%" :model="Mat" :rules="rules" ref="Mat" label-width="100px" class="demo-Mat">
<el-form-item label="物资名称" :label-width="formLabelWidth" prop="name">
<el-input v-model="Mat.name" autocomplete="off" ></el-input>
</el-form-item>
<el-form-item label="物资数量" :label-width="formLabelWidth" prop="count">
<el-input v-model="Mat.count" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="计量单位" :label-width="formLabelWidth" prop="type">
<el-input v-model="Mat.type" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="是否为重要物资" :label-width="formLabelWidth" prop="isImp">
<el-radio v-model="Mat.isImp" label="是"></el-radio>
<el-radio v-model="Mat.isImp" label="否"></el-radio>
</el-form-item>
<el-form-item label="负责人" :label-width="formLabelWidth" prop="charge">
<el-input v-model="Mat.charge" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="负责人电话" :label-width="formLabelWidth" prop="cnum">
<el-input v-model="Mat.cnum" autocomplete="off"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="submitForm('Mat')"></el-button>
<el-button @click="resetForm('Mat')"></el-button>
</el-form-item>
</el-form>
</template>
<script>
export default {
data() {
return {
formLabelWidth: '130px',
Mat: {
name:"",
count:"",
type:"",
isImp:"",
charge:"",
cnum:"",
},
rules: {
name: [
{ required: true, message: '请输入物资名称', trigger: 'blur' },
{ min: 3, max: 20, message: '长度在 3 到 20 个字符', trigger: 'blur' }
],
count: [
{ required: true, message: '请输入物资数量', trigger: 'blur' }
],
type: [
{ required: true, message: '请输入计量单位', trigger: 'blur' }
],
isImp: [
{ required: true, message: '请输入是否为重要物资', trigger: 'blur' }
],
charge: [
{ required: true, message: '请输入负责人', trigger: 'blur' }
],
cnum: [
{ required: true, message: '请输入负责人电话', trigger: 'blur' }
]
}
};
},
methods: {
submitForm(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
axios.post('http://localhost:8080/Material/save',this.Mat).then((resp)=>{
if(resp.data=='success'){
this.$alert('物资添加成功!',"消息",{
confirmButtonText:"确定",
callback:action=>{
this.$router.push('/MaterialManage')
}
})
}
})
} else {
return false;
}
});
},
resetForm(formName) {
this.$refs[formName].resetFields();
}
}
}
</script>

@ -0,0 +1,156 @@
<template>
<el-form style="width:60%" :model="Emp" :rules="rules" ref="Emp" label-width="100px" class="demo-Emp">
<el-form-item label="姓名" :label-width="formLabelWidth" prop="name">
<el-input v-model="Emp.name" autocomplete="off" ></el-input>
</el-form-item>
<el-form-item label="性别" :label-width="formLabelWidth" prop="sex">
<el-radio v-model="Emp.sex" label="男"></el-radio>
<el-radio v-model="Emp.sex" label="女"></el-radio>
</el-form-item>
<el-form-item label="手机号码" :label-width="formLabelWidth" prop="phonenum">
<el-input v-model="Emp.phonenum" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="体温" :label-width="formLabelWidth" prop="temp">
<el-input v-model="Emp.temp" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="是否曾到达高风险地区" :label-width="formLabelWidth" prop="risk">
<el-input v-model="Emp.risk" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="健康状况" :label-width="formLabelWidth" prop="health">
<el-select v-model="Emp.health" clearable placeholder="请选择">
<el-option
v-for="item in options2"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="所属部门" :label-width="formLabelWidth" prop="depart">
<el-select
v-model="Emp.depart"
clearable
placeholder="请选择"
>
<el-option v-for="(item, index) in options3" :key="index" :label="item" :value="item">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="备注" :label-width="formLabelWidth">
<el-input v-model="Emp.content" autocomplete="off"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="submitForm('Emp')"></el-button>
<el-button @click="resetForm('Emp')"></el-button>
</el-form-item>
</el-form>
</template>
<script>
export default {
created() {
axios.get("http://localhost:8080/depart/findAll").then((resp) => {
console.log(resp.data);
this.options3 = resp.data;
});
},
data() {
return {
options3:[
{
value: "",
label: "",
},
],
options2: [{
value: '正常',
label: '无下列情况,身体健康'
}, {
value: '咳嗽',
label: '咳嗽'
}, {
value: '乏力',
label: '乏力'
}, {
value: '呼吸困难',
label: '呼吸困难'
}, {
value: '与新冠肺炎有关的其他症状,如流涕,咽痛,肌痛,腹泻等',
label: '与新冠肺炎有关的其他症状,如流涕,咽痛,肌痛,腹泻等'
}],
value: '',
formLabelWidth: '120px',
options: [{
value: '选项1',
label: '男'
}, {
value: '选项2',
label: '女'
}],
Emp: {
name:"",
sex:"",
phonenum:"",
temp:"",
risk:"",
health:"",
createTime:"",
content:"",
depart:""
},
rules: {
name: [
{ required: true, message: '请输入姓名', trigger: 'blur' },
{ min:2, max: 20, message: '长度在 3 到 20 个字符', trigger: 'blur' }
],
sex: [
{ required: true, message: '请输入性别', trigger: 'blur' }
],
phonenum: [
{ required: true, message: '请输入手机号码', trigger: 'blur' },
{ min: 8, max: 20, message: '长度在 8 到 20 个字符', trigger: 'blur' }
],
temp: [
{ required: true, message: '请输入体温', trigger: 'blur' }
],
risk: [
{ required: true, message: '请选择是否曾到达高风险地区', trigger: 'blur' }
],
health: [
{ required: true, message: '请输入健康状况', trigger: 'blur' }
],
depart: [
{ required: true, message: '请选择部门', trigger: 'blur' }
]
}
};
},
methods: {
submitForm(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
axios.post('http://localhost:8080/emp/save',this.Emp).then((resp)=>{
if(resp.data=='success'){
this.$alert('打卡成功!',"消息",{
confirmButtonText:"确定",
callback:action=>{
this.$router.push('/RecordManage')
}
})
}
})
} else {
return false;
}
});
},
resetForm(formName) {
this.$refs[formName].resetFields();
}
}
}
</script>

@ -0,0 +1,148 @@
<template>
<div>
<div id="Echart" style="width: 700px;height: 400px">
</div>
<div id="material" style="width: 700px;height: 400px">
</div>
</div>
</template>
<script>
import { color } from 'echarts';
export default {
data(){
return{
LineVO:{
month:'',
status:{
type:'',
count:''
}
},
PieVo:{
name:'',
value:''
}
}
},
mounted(){
var echarts = require('echarts');
var chartDom = document.getElementById('Echart');
var machartDom=document.getElementById('material');
var myChart = echarts.init(chartDom);
var materialChart=echarts.init(machartDom);
axios.get('http://localhost:8080/empiden/LineVO').then((resp)=>{
this.LineVO.month=resp.data.month
this.LineVO.status=resp.data.status
console.log(this.LineVO.status)
var option = {
title: {
text: '疫情趋势'
},
tooltip: {
trigger: 'axis'
},
legend: {
data: ['隔离', '疑似', '确诊', '治愈', '死亡']
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
toolbox: {
feature: {
saveAsImage: {}
}
},
xAxis: {
type: 'category',
boundaryGap: false,
data: this.LineVO.month//
},
yAxis: {
type: 'value',
data:''
},
series: [
{
name: '隔离',
type: 'line',
data: this.LineVO.status.隔离
},
{
name: '疑似',
type: 'line',
data: this.LineVO.status.疑似
},
{
name: '确诊',
type: 'line',
data: this.LineVO.status.确诊
},
{
name: '治愈',
type: 'line',
data: this.LineVO.status.治愈,
color:"yellow"
},
{
name: '死亡',
type: 'line',
data: this.LineVO.status.死亡,
color:"black"
}
]
};
myChart.setOption(option);
});
axios.get('http://localhost:8080/empiden/PieVO').then((resp)=>{
this.PieVo=resp.data
var option2= {
tooltip: {
trigger: 'item'
},
legend: {
top: '5%',
left: 'center'
},
title: {
text: '物资情况'
},
series: [
{
name: '物资数量',
type: 'pie',
radius: ['40%', '70%'],
avoidLabelOverlap: false,
itemStyle: {
borderRadius: 10,
borderColor: '#fff',
borderWidth: 2
},
label: {
show: false,
position: 'center'
},
emphasis: {
label: {
show: true,
fontSize: '25',
fontWeight: 'bold'
}
},
labelLine: {
show: false
},
data: this.PieVo
}
]
};
materialChart.setOption(option2);
})
},
methods:{
}
}
</script>

@ -0,0 +1,394 @@
<template>
<div>
<el-button type="primary" @click="addDialogFormVisible = true" size="medium"
>新增记录</el-button
>
<el-input
placeholder="请输入内容"
v-model="stext"
class="input-with-select"
style="width: 40%"
>
<el-select
v-model="cname"
slot="prepend"
placeholder="请选择"
@change="getKey"
>
<el-option label="姓名" value="name"></el-option>
<el-option label="就诊医院" value="place"></el-option>
<el-option label="所属部门" value="depart"></el-option>
<el-option label="就诊日期" value="idate"></el-option>
</el-select>
<el-button
slot="append"
icon="el-icon-search"
@click="search()"
></el-button>
</el-input>
<el-table :data="tableData" border style="width: 100%">
<el-table-column fixed prop="name" label="姓名" width="100">
</el-table-column>
<el-table-column prop="id" label="编号" width="50"> </el-table-column>
<el-table-column prop="sex" label="性别" width="50"> </el-table-column>
<el-table-column prop="idcard" label="身份证号码" width="170">
</el-table-column>
<el-table-column prop="idate" label="就诊日期" width="160">
</el-table-column>
<el-table-column prop="place" label="就诊医院" width="200">
</el-table-column>
<el-table-column prop="depart" label="所属部门" width="120">
</el-table-column>
<el-table-column prop="phonenum" label="手机号码" width="120">
</el-table-column>
<el-table-column prop="register" label="登记时间" width="170">
</el-table-column>
<el-table-column width="120" label="操作" fixed="right">
<template slot-scope="scope">
<el-button
@click="(dialogFormVisible = true), edit(scope.row)"
type="text"
size="small"
>修改</el-button
>
<el-button type="text" size="small" @click="deleteRecord(scope.row)"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
<div class="block">
<el-pagination
@current-change="handleCurrentChange"
:page-size="6"
layout="total, prev, pager, next"
:total="total"
>
</el-pagination>
<el-dialog
title="修改确诊/疑似病例记录"
:visible.sync="dialogFormVisible"
slot
>
<el-form :model="EmpIden" ref="EmpIden">
<el-form-item label="姓名" :label-width="formLabelWidth">
<el-input v-model="EmpIden.name" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="性别" :label-width="formLabelWidth">
<el-radio v-model="EmpIden.sex" label="男"></el-radio>
<el-radio v-model="EmpIden.sex" label="女"></el-radio>
</el-form-item>
<el-form-item label="身份证号" :label-width="formLabelWidth">
<el-input v-model="EmpIden.idcard" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="就诊日期" :label-width="formLabelWidth">
<el-date-picker
v-model="EmpIden.idate"
align="right"
type="date"
placeholder="选择日期"
:picker-options="pickerOptions"
>
</el-date-picker>
</el-form-item>
<el-form-item label="就诊医院" :label-width="formLabelWidth">
<el-input v-model="EmpIden.place" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="所属部门" :label-width="formLabelWidth">
<el-select
v-model="EmpIden.depart"
clearable
placeholder="请选择"
>
<el-option
v-for="(item, index) in options2"
:key="index"
:label="item"
:value="item"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="手机号码" :label-width="formLabelWidth">
<el-input v-model="EmpIden.phonenum" autocomplete="off"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false"> </el-button>
<el-button
type="primary"
@click="(dialogFormVisible = false), update()"
> </el-button
>
</div>
</el-dialog>
<el-dialog
title="新增确诊/疑似病例记录"
:visible.sync="addDialogFormVisible"
slot
>
<el-form :model="addEmpIden">
<el-form-item label="姓名" :label-width="formLabelWidth">
<el-input v-model="addEmpIden.name" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="性别" :label-width="formLabelWidth">
<el-radio v-model="addEmpIden.sex" label="男"></el-radio>
<el-radio v-model="addEmpIden.sex" label="女"></el-radio>
</el-form-item>
<el-form-item label="身份证号" :label-width="formLabelWidth">
<el-input v-model="addEmpIden.idcard" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="就诊日期" :label-width="formLabelWidth">
<el-date-picker
v-model="addEmpIden.idate"
align="right"
type="date"
placeholder="选择日期"
:picker-options="pickerOptions"
>
</el-date-picker>
</el-form-item>
<el-form-item label="就诊医院" :label-width="formLabelWidth">
<el-input v-model="addEmpIden.place" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="所属部门" :label-width="formLabelWidth">
<el-select
v-model="addEmpIden.depart"
clearable
placeholder="请选择"
>
<el-option
v-for="(item, index) in options2"
:key="index"
:label="item"
:value="item"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="手机号码" :label-width="formLabelWidth">
<el-input
v-model="addEmpIden.phonenum"
autocomplete="off"
></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="addDialogFormVisible = false"> </el-button>
<el-button
type="primary"
@click="(addDialogFormVisible = false), submitForm()"
> </el-button
>
</div>
</el-dialog>
</div>
</div>
</template>
<script>
export default {
methods: {
search() {
if (!this.stext) {
axios.get("http://localhost:8080/empiden/findAll/1/6").then((resp) => {
this.tableData = resp.data.records;
this.total = resp.data.total;
this.cname = "";
});
} else {
axios
.get(
"http://localhost:8080/empiden/search/" +
this.searchKey +
"/" +
this.stext
)
.then((resp) => {
this.tableData = resp.data;
this.total = resp.data.total;
});
}
},
getKey(e) {
this.searchKey = e;
},
submitForm() {
axios
.post("http://localhost:8080/empiden/save", this.addEmpIden)
.then((resp) => {
if (resp.data == "success") {
this.$alert("确诊/疑似病例添加成功!", "消息", {
confirmButtonText: "确定",
callback: (action) => {
window.location.reload();
},
});
}
});
},
deleteRecord(row) {
this.$confirm("是否确定要删除" + row.name + "的病例记录?", "删除数据", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(() => {
axios
.delete("http://localhost:8080/empiden/deleteById/" + row.id)
.then((resp) => {
this.$alert(row.name + "的病例记录删除成功!", "消息", {
confirmButtonText: "确定",
callback: (action) => {
window.location.reload();
},
});
});
});
},
update() {
axios
.put("http://localhost:8080/empiden/update", this.EmpIden)
.then((resp) => {
console.log(resp);
if (resp.data == "success") {
this.$alert(this.EmpIden.name + "的病例记录修改成功!", "消息", {
confirmButtonText: "确定",
callback: (action) => {
window.location.reload();
},
});
}
});
},
edit(row) {
axios
.get("http://localhost:8080/empiden/findById/" + row.id)
.then((resp) => {
this.EmpIden = resp.data;
});
},
handleCurrentChange(currentPage) {
axios
.get("http://localhost:8080/empiden/findAll/" + currentPage + "/6")
.then((resp) => {
this.tableData = resp.data.records;
this.total = resp.data.total;
});
},
remoteMethod(query) {
if (query !== "") {
this.loading = true;
setTimeout(() => {
this.loading = false;
this.options = this.list.filter((item) => {
return item.label.toLowerCase().indexOf(query.toLowerCase()) > -1;
});
}, 200);
} else {
this.options = [];
}
},
},
created() {
axios.get("http://localhost:8080/empiden/findAll/1/6").then((resp) => {
this.tableData = resp.data.records;
this.total = resp.data.total;
});
axios.get("http://localhost:8080/depart/findAll").then((resp) => {
console.log(resp.data);
this.options2 = resp.data;
});
},
data() {
return {
options2: [
{
value: "",
label: "",
},
],
value: "",
cname: "",
stext: "",
pickerOptions: {
disabledDate(time) {
return time.getTime() > Date.now();
},
shortcuts: [
{
text: "今天",
onClick(picker) {
picker.$emit("pick", new Date());
},
},
{
text: "昨天",
onClick(picker) {
const date = new Date();
date.setTime(date.getTime() - 3600 * 1000 * 24);
picker.$emit("pick", date);
},
},
{
text: "一周前",
onClick(picker) {
const date = new Date();
date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
picker.$emit("pick", date);
},
},
],
},
options: [],
value: [],
list: [],
loading: false,
tableData: null,
total: null,
dialogTableVisible: false,
dialogFormVisible: false,
addDialogFormVisible: false,
formLabelWidth: "120px",
addLabelWidth: "50px",
EmpIden: {
id: "",
name: "",
sex: "",
idcard: "",
idate: "",
place: "",
depart: "",
phonenum: "",
},
addEmpIden: {
id: "",
name: "",
sex: "",
idcard: "",
idate: "",
place: "",
depart: "",
phonenum: "",
},
};
},
};
</script>
<style>
.el-select .el-input {
width: 130px;
}
.input-with-select {
float: right;
}
.input-with-select .el-input-group__prepend {
background-color: #fff;
}
</style>

@ -0,0 +1,36 @@
<template>
<div class="index">
<el-container style="height: 100%; border: 1px solid #eee">
<el-aside width="200px" style="background-color: rgb(238, 241, 246)">
<el-menu router :default-active='$route.path'>
<el-submenu v-for="(item,index) in router" :index="index+''" :key="index" >
<template slot="title"><i class="el-icon-setting"></i>{{item.name}}</template>
<el-menu-item v-for="(item2,index2) in item.children" :index="item2.path" :key="index2"
>{{item2.name}}</el-menu-item>
</el-submenu>
</el-menu>
</el-aside>
<el-main>
<router-view></router-view>
</el-main>
</el-container>
</div>
</template>
<script>
export default {
data(){
return{
currentMenu:'',
router:""
}
},
created(){
this.router = this.$router.options.routes.filter(i=>{
return i.meta
})
},
name: 'index',
}
</script>

@ -0,0 +1,399 @@
<template>
<div>
<el-button type="primary" @click="addDialogFormVisible = true" size="medium">新增记录</el-button>
<el-input placeholder="请输入内容" v-model="stext" class="input-with-select" style="width:40%">
<el-select v-model="cname" slot="prepend" placeholder="请选择" @change="getKey">
<el-option label="姓名" value="name"></el-option>
<el-option label="隔离方式" value="type"></el-option>
<el-option label="隔离地点" value="place"></el-option>
<el-option label="出发地" value="leaved"></el-option>
<el-option label="途径地" value="arrived"></el-option>
</el-select>
<el-button slot="append" icon="el-icon-search" @click="search()"></el-button>
</el-input>
<el-table
:data="tableData"
border
style="width: 100%">
<el-table-column
prop="name"
label="姓名"
width="100">
</el-table-column>
<el-table-column
prop="id"
label="编号"
width="50">
</el-table-column>
<el-table-column
prop="sex"
label="性别"
width="60">
</el-table-column>
<el-table-column
prop="phone"
label="手机号码"
width="120">
</el-table-column>
<el-table-column
prop="temp"
label="体温"
width="100">
<template slot-scope="scope">
<div slot="reference" >
<p size="medium" :class="scope.row.temp>36 && scope.row.temp<38 ? '' : 'red'">{{ scope.row.temp + "°C" }}</p>
</div>
</template>
</el-table-column>
<el-table-column
prop="type"
label="隔离方式"
width="120">
</el-table-column>
<el-table-column
prop="place"
label="隔离地点"
width="200">
</el-table-column>
<el-table-column
prop="date"
label="隔离期"
width="200">
</el-table-column>
<el-table-column
prop="leaved"
label="出发地"
width="120">
</el-table-column>
<el-table-column
prop="arrived"
label="途径地"
width="120">
</el-table-column>
<el-table-column
prop="depart"
label="所属部门"
width="120">
</el-table-column>
<el-table-column
prop="content"
label="备注"
width="120">
</el-table-column>
<el-table-column width="120" label="操作" fixed="right">
<template slot-scope="scope">
<el-button @click="dialogFormVisible = true,edit(scope.row)" type="text" size="small">修改</el-button>
<el-button type="text" size="small" @click="deleteRecord(scope.row)"></el-button>
</template>
</el-table-column>
</el-table>
<div class="block">
<el-pagination
@current-change="handleCurrentChange"
:page-size="6"
layout="total, prev, pager, next"
:total="total">
</el-pagination>
<el-dialog title="修改隔离记录" :visible.sync="dialogFormVisible" slot>
<el-form :model="EmpIs" ref="EmpIs">
<el-form-item label="姓名" :label-width="formLabelWidth">
<el-input v-model="EmpIs.name" autocomplete="off" ></el-input>
</el-form-item>
<el-form-item label="性别" :label-width="formLabelWidth">
<el-radio v-model="EmpIs.sex" label="男"></el-radio>
<el-radio v-model="EmpIs.sex" label="女"></el-radio>
</el-form-item>
<el-form-item label="手机号码" :label-width="formLabelWidth">
<el-input v-model="EmpIs.phone" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="体温" :label-width="formLabelWidth">
<el-input v-model="EmpIs.temp" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="隔离方式" :label-width="formLabelWidth">
<el-input v-model="EmpIs.type" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="隔离地点" :label-width="formLabelWidth">
<el-input v-model="EmpIs.place" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="隔离开始日期" :label-width="formLabelWidth">
<el-input v-model="EmpIs.begin" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="出发地" :label-width="formLabelWidth">
<el-input v-model="EmpIs.leaved" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="途径地" :label-width="formLabelWidth">
<el-input v-model="EmpIs.arrived" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="所属部门" :label-width="formLabelWidth" prop="depart">
<el-select
v-model="EmpIs.depart"
clearable
placeholder="请选择"
>
<el-option
v-for="(item, index) in options3"
:key="index"
:label="item"
:value="item"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="备注" :label-width="formLabelWidth">
<el-input v-model="EmpIs.content" autocomplete="off"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false"> </el-button>
<el-button type="primary" @click="dialogFormVisible = false,update()"> </el-button>
</div>
</el-dialog>
<el-dialog title="新增隔离记录" :visible.sync="addDialogFormVisible" slot>
<el-form :model="EmpIs" >
<el-form-item label="姓名" :label-width="formLabelWidth">
<el-input v-model="EmpIs.name" autocomplete="off" ></el-input>
</el-form-item>
<el-form-item label="性别" :label-width="formLabelWidth">
<el-radio v-model="EmpIs.sex" label="男"></el-radio>
<el-radio v-model="EmpIs.sex" label="女"></el-radio>
</el-form-item>
<el-form-item label="手机号码" :label-width="formLabelWidth">
<el-input v-model="EmpIs.phone" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="体温" :label-width="formLabelWidth">
<el-input v-model="EmpIs.temp" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="隔离方式" :label-width="formLabelWidth">
<el-input v-model="EmpIs.type" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="隔离地点" :label-width="formLabelWidth">
<el-input v-model="EmpIs.place" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="隔离开始日期" :label-width="formLabelWidth">
<el-date-picker v-model="EmpIs.begin" align="right" type="date"
placeholder="选择日期" :picker-options="pickerOptions">
</el-date-picker>
</el-form-item>
<el-form-item label="出发地" :label-width="formLabelWidth">
<el-input v-model="EmpIs.leaved" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="途径地" :label-width="formLabelWidth">
<el-input v-model="EmpIs.arrived" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="所属部门" :label-width="formLabelWidth" prop="depart">
<el-select
v-model="EmpIs.depart"
clearable
placeholder="请选择"
>
<el-option
v-for="(item, index) in options3"
:key="index"
:label="item"
:value="item"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="备注" :label-width="formLabelWidth">
<el-input v-model="EmpIs.content" autocomplete="off"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="addDialogFormVisible = false"> </el-button>
<el-button type="primary" @click="addDialogFormVisible = false,submitForm()"> </el-button>
</div>
</el-dialog>
</div>
</div>
</template>
<script>
export default {
methods: {
search(){
if(!this.stext){
axios.get('http://localhost:8080/empis/findAll/1/6').then((resp)=>{
this.tableData=resp.data.records
this.total=resp.data.total
this.cname=""
})
}else{
axios.get('http://localhost:8080/empis/search/'+this.searchKey+"/"+this.stext).then((resp)=>{
this.tableData=resp.data
this.total=resp.data.total
})}
},
getKey(e){
this.searchKey = e
},
submitForm() {
console.log(this.EmpIs.end)
axios.post('http://localhost:8080/empis/save',this.EmpIs).then((resp)=>{
if(resp.data=='success'){
this.$alert('隔离记录添加成功!',"消息",{
confirmButtonText:"确定",
callback:action=>{
window.location.reload()
}
})
}
})
},
deleteRecord(row){
this.$confirm('是否确定要删除'+row.name+'的隔离记录?','删除数据',{
confirmButtonText:'确定',
cancelButtonText:'取消',
type:'warning'
}).then(()=>{axios.delete('http://localhost:8080/empis/deleteById/'+row.id).then((resp)=>{
this.$alert(row.name+'的隔离记录删除成功!',"消息",{
confirmButtonText:"确定",
callback:action=>{
window.location.reload()
}
})
})})
},
update(){
axios.put('http://localhost:8080/empis/update',this.EmpIs).then((resp)=>{
console.log(resp)
if(resp.data=='success'){
this.$alert(this.EmpIs.name+'的隔离记录修改成功!',"消息",{
confirmButtonText:"确定",
callback:action=>{
window.location.reload()
}
})
}
})
},
edit(row) {
axios.get('http://localhost:8080/empis/findById/'+row.id).then((resp)=>{
this.EmpIs=resp.data;
})
},
handleCurrentChange(currentPage){
axios.get('http://localhost:8080/empis/findAll/'+currentPage+'/6').then((resp)=>{
this.tableData=resp.data.records
this.total=resp.data.total
})
},
remoteMethod(query) {
if (query !== '') {
this.loading = true;
setTimeout(() => {
this.loading = false;
this.options = this.list.filter(item => {
return item.label.toLowerCase()
.indexOf(query.toLowerCase()) > -1;
});
}, 200);
} else {
this.options = [];
}
}
},
created(){
axios.get('http://localhost:8080/empis/findAll/1/6').then((resp)=>{
this.tableData=resp.data.records
for(var i=0;i<this.tableData.length;i++){
if(this.tableData[i].begin!=null) {
this.tableData[i].date=this.tableData[i].begin+" 至 "+this.tableData[i].end
}
}
this.total=resp.data.total
});
axios.get("http://localhost:8080/depart/findAll").then((resp) => {
console.log(resp.data);
this.options3 = resp.data;
});
},
data() {
return {
options3: [
{
value: "",
label: "",
},
],
cname:'',
stext:'',
pickerOptions: {
disabledDate(time) {
return time.getTime() > Date.now();
},
shortcuts: [{
text: '今天',
onClick(picker) {
picker.$emit('pick', new Date());
}
}, {
text: '昨天',
onClick(picker) {
const date = new Date();
date.setTime(date.getTime() - 3600 * 1000 * 24);
picker.$emit('pick', date);
}
}, {
text: '一周前',
onClick(picker) {
const date = new Date();
date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
picker.$emit('pick', date);
}
}]
},
options: [],
value: [],
list: [],
loading: false,
tableData: null,
total:null,
dialogTableVisible: false,
dialogFormVisible: false,
addDialogFormVisible: false,
formLabelWidth: '120px',
addLabelWidth:'50px',
EmpIs: {
id:"",
name:"",
sex:"",
phone:"",
temp:"",
type:"",
place:"",
leaved:"",
begin:"",
end:"",
content:"",
depart:""
}
}
}
}
</script>
<style>
.red{
color: red;
}
.el-select .el-input {
width: 130px;
}.input-with-select{
float: right;
}
.input-with-select .el-input-group__prepend {
background-color: #fff;
}
</style>

@ -0,0 +1,233 @@
<template>
<div>
<el-input placeholder="请输入内容" v-model="stext" class="input-with-select" style="width:40%">
<el-select v-model="cname" slot="prepend" placeholder="请选择" @change="getKey">
<el-option label="物资名称" value="name"></el-option>
<el-option label="负责人" value="charge"></el-option>
<el-option label="更新时间" value="updateTime"></el-option>
</el-select>
<el-button slot="append" icon="el-icon-search" @click="search()"></el-button>
</el-input>
<el-table
:data="tableData"
border
style="width: 100%">
<el-table-column
fixed
prop="id"
label="编号"
width="150">
</el-table-column>
<el-table-column
prop="name"
label="物资名称"
width="180">
</el-table-column>
<el-table-column
prop="count"
label="物资数量"
width="120">
</el-table-column>
<el-table-column
prop="type"
label="计量单位"
width="120">
</el-table-column>
<el-table-column
prop="isImp"
label="是否为重点物资"
width="120">
</el-table-column>
<el-table-column
prop="charge"
label="负责人"
width="120">
</el-table-column>
<el-table-column
prop="cnum"
label="负责人电话"
width="120">
</el-table-column>
<el-table-column
prop="updateTime"
label="更新时间"
width="180">
</el-table-column>
<el-table-column width="120" label="操作" fixed="right">
<template slot-scope="scope">
<el-button @click="dialogFormVisible = true,edit(scope.row)" type="text" size="small">修改</el-button>
<el-button type="text" size="small" @click="deleteRecord(scope.row)"></el-button>
</template>
</el-table-column>
</el-table>
<div class="block">
<el-pagination
@current-change="handleCurrentChange"
:page-size="6"
layout="total, prev, pager, next"
:total="total">
</el-pagination>
<el-dialog title="更新物资详情" :visible.sync="dialogFormVisible" slot>
<el-form :model="Mat" ref="Mat">
<el-form-item label="物资名称" :label-width="formLabelWidth">
<el-input v-model="Mat.name" autocomplete="off" ></el-input>
</el-form-item>
<el-form-item label="物资数量" :label-width="formLabelWidth">
<el-input v-model="Mat.count" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="计量单位" :label-width="formLabelWidth">
<el-input v-model="Mat.type" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="是否为重要物资" :label-width="formLabelWidth" prop="isImp">
<el-radio v-model="Mat.isImp" label="是" @change="test($event)"></el-radio>
<el-radio v-model="Mat.isImp" label="否" @change="test($event)"></el-radio>
</el-form-item>
<el-form-item label="负责人" :label-width="formLabelWidth">
<el-input v-model="Mat.charge" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="负责人电话" :label-width="formLabelWidth">
<el-input v-model="Mat.cnum" autocomplete="off"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false"> </el-button>
<el-button type="primary" @click="dialogFormVisible = false,update()"> </el-button>
</div>
</el-dialog>
</div>
</div>
</template>
<script>
export default {
methods: {
test(dd){
this.Mat.isImp=dd;
},
search(){
if(!this.stext){
axios.get('http://localhost:8080/Material/findAll/1/6').then((resp)=>{
this.tableData=resp.data.records
this.total=resp.data.total
this.cname=""
})
}else{
axios.get('http://localhost:8080/Material/search/'+this.searchKey+"/"+this.stext).then((resp)=>{
this.tableData=resp.data
this.total=resp.data.total
})}
},
getKey(e){
this.searchKey = e
},
deleteRecord(row){
this.$confirm('是否确定要删除'+row.name+'的物资记录?','删除数据',{
confirmButtonText:'确定',
cancelButtonText:'取消',
type:'warning'
}).then(()=>{axios.delete('http://localhost:8080/Material/deleteById/'+row.id).then((resp)=>{
this.$alert(row.name+'的物资记录删除成功!',"消息",{
confirmButtonText:"确定",
callback:action=>{
window.location.reload()
}
})
})})
},
update(){
axios.put('http://localhost:8080/Material/update',this.Mat).then((resp)=>{
console.log(resp)
if(resp.data=='success'){
this.$alert(this.Mat.name+'的物资记录修改成功!',"消息",{
confirmButtonText:"确定",
callback:action=>{
window.location.reload()
}
})
}
})
},
edit(row) {
axios.get('http://localhost:8080/Material/findById/'+row.id).then((resp)=>{
this.Mat=resp.data;
})
},
handleCurrentChange(currentPage){
axios.get('http://localhost:8080/Material/findAll/'+currentPage+'/6').then((resp)=>{
this.tableData=resp.data.records
this.total=resp.data.total
})
},
remoteMethod(query) {
if (query !== '') {
this.loading = true;
setTimeout(() => {
this.loading = false;
this.options = this.list.filter(item => {
return item.label.toLowerCase()
.indexOf(query.toLowerCase()) > -1;
});
}, 200);
} else {
this.options = [];
}
}
},
created(){
axios.get('http://localhost:8080/Material/findAll/1/6').then((resp)=>{
console.log(resp)
this.tableData=resp.data.records
this.total=resp.data.total
})
},
data() {
return {
cname:'',
stext:'',
formLabelWidth: '120px',
options: [],
value: [],
list: [],
loading: false,
tableData: null,
total:null,
dialogTableVisible: false,
dialogFormVisible: false,
formLabelWidth: '120px',
Mat: {
id:"",
name:"",
count:"",
type:"",
isImp:"",
charge:"",
cnum:"",
updateTime:""
}
}
}
}
</script>
<style>
.el-select .el-input {
width: 130px;
}.input-with-select{
float: right;
}
.input-with-select .el-input-group__prepend {
background-color: #fff;
}
</style>

@ -0,0 +1,307 @@
<template>
<div>
<el-input placeholder="请输入内容" v-model="stext" class="input-with-select" style="width:40%">
<el-select v-model="cname" slot="prepend" placeholder="请选择" @change="getKey">
<el-option label="姓名" value="name"></el-option>
<el-option label="健康状况" value="health"></el-option>
<el-option label="打卡时间" value="createTime"></el-option>
</el-select>
<el-button slot="append" icon="el-icon-search" @click="search()"></el-button>
</el-input>
<el-table
:data="tableData"
border
style="width: 100%">
<el-table-column
fixed
prop="id"
label="编号"
sortable
width="120">
</el-table-column>
<el-table-column
prop="name"
label="姓名"
width="120">
</el-table-column>
<el-table-column
prop="sex"
label="性别"
width="50">
</el-table-column>
<el-table-column
prop="phonenum"
label="手机号码"
width="120">
</el-table-column>
<el-table-column
label="体温"
prop="temp"
width="80"
sortable>
<template slot-scope="scope">
<div slot="reference" >
<p size="medium" :class="scope.row.temp>36 && scope.row.temp<37.2 ? '' : 'red'">{{ scope.row.temp+"°C"}}</p>
</div>
</template>
</el-table-column>
<el-table-column
prop="risk"
label="是否到达过高风险地区"
width="120">
</el-table-column>
<el-table-column
prop="health"
label="健康状况"
width="170">
</el-table-column>
<el-table-column
prop="createTime"
label="打卡时间"
width="170"
sortable>
</el-table-column>
<el-table-column
prop="depart"
label="所属部门"
width="120">
</el-table-column>
<el-table-column
prop="content"
label="备注"
width="120">
</el-table-column>
<el-table-column width="120" label="操作" fixed="right">
<template slot-scope="scope">
<el-button @click="dialogFormVisible = true,edit(scope.row)" type="text" size="small">修改</el-button>
<el-button type="text" size="small" @click="deleteRecord(scope.row)"></el-button>
</template>
</el-table-column>
</el-table>
<div class="block">
<el-pagination
@current-change="handleCurrentChange"
:page-size="6"
layout="total, prev, pager, next"
:total="total">
</el-pagination>
<el-dialog title="修改打卡记录" :visible.sync="dialogFormVisible" slot>
<el-form :model="Emp" ref="Emp">
<el-form-item label="姓名" :label-width="formLabelWidth">
<el-input v-model="Emp.name" autocomplete="off" ></el-input>
</el-form-item>
<el-form-item label="性别" :label-width="formLabelWidth" prop="sex">
<el-radio v-model="Emp.sex" label="男"></el-radio>
<el-radio v-model="Emp.sex" label="女"></el-radio>
</el-form-item>
<el-form-item label="手机号码" :label-width="formLabelWidth">
<el-input v-model="Emp.phonenum" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="体温" :label-width="formLabelWidth">
<el-input v-model="Emp.temp" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="是否曾到达高风险地区" :label-width="formLabelWidth">
<el-input v-model="Emp.risk" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="健康状况" :label-width="formLabelWidth" prop="health">
<el-select v-model="Emp.health" clearable placeholder="请选择">
<el-option
v-for="item in options2"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="打卡时间" :label-width="formLabelWidth" >
<el-input v-model="Emp.createTime" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="所属部门" :label-width="formLabelWidth">
<el-select
v-model="Emp.depart"
clearable
placeholder="请选择"
>
<el-option
v-for="(item, index) in options3"
:key="index"
:label="item"
:value="item"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="备注" :label-width="formLabelWidth">
<el-input v-model="Emp.content" autocomplete="off"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false"> </el-button>
<el-button type="primary" @click="dialogFormVisible = false,update()"> </el-button>
</div>
</el-dialog>
</div>
</div>
</template>
<script>
export default {
methods: {
search(){
if(!this.stext){
axios.get('http://localhost:8080/emp/findAll/1/6').then((resp)=>{
console.log(resp)
this.tableData=resp.data.records
this.total=resp.data.total
this.cname=""
})
}else{
axios.get('http://localhost:8080/emp/search/'+this.searchKey+"/"+this.stext).then((resp)=>{
this.tableData=resp.data
this.total=resp.data.total
})}
},
getKey(e){
this.searchKey = e
},
deleteRecord(row){
this.$confirm('是否确定要删除'+row.name+'的打卡记录?','删除数据',{
confirmButtonText:'确定',
cancelButtonText:'取消',
type:'warning'
}).then(()=>{axios.delete('http://localhost:8080/emp/deleteById/'+row.id).then((resp)=>{
this.$alert(row.name+'的打卡记录删除成功!',"消息",{
confirmButtonText:"确定",
callback:action=>{
window.location.reload()
}
})
})})
},
update(){
axios.put('http://localhost:8080/emp/update',this.Emp).then((resp)=>{
console.log(resp)
if(resp.data=='success'){
this.$alert(this.Emp.name+'的打卡记录修改成功!',"消息",{
confirmButtonText:"确定",
callback:action=>{
window.location.reload()
}
})
}
})
},
edit(row) {
axios.get('http://localhost:8080/emp/findById/'+row.id).then((resp)=>{
this.Emp=resp.data;
})
},
handleCurrentChange(currentPage){
axios.get('http://localhost:8080/emp/findAll/'+currentPage+'/6').then((resp)=>{
this.tableData=resp.data.records
this.total=resp.data.total
})
},
remoteMethod(query) {
if (query !== '') {
this.loading = true;
setTimeout(() => {
this.loading = false;
this.options = this.list.filter(item => {
return item.label.toLowerCase()
.indexOf(query.toLowerCase()) > -1;
});
}, 200);
} else {
this.options = [];
}
}
},
created(){
axios.get('http://localhost:8080/emp/findAll/1/6').then((resp)=>{
console.log(resp)
this.tableData=resp.data.records
this.total=resp.data.total
});
axios.get("http://localhost:8080/depart/findAll").then((resp) => {
console.log(resp.data);
this.options3 = resp.data;
});
},
data() {
return {
options3:[
{
value: "",
label: "",
},
],
options2: [{
value: '正常',
label: '无下列情况,身体健康'
}, {
value: '咳嗽',
label: '咳嗽'
}, {
value: '乏力',
label: '乏力'
}, {
value: '呼吸困难',
label: '呼吸困难'
}, {
value: '与新冠肺炎有关的其他症状,如流涕,咽痛,肌痛,腹泻等',
label: '与新冠肺炎有关的其他症状,如流涕,咽痛,肌痛,腹泻等'
}],
value: '',
cname:'',
stext:'',
searchKey:"",
options: [],
value: [],
list: [],
loading: false,
tableData: null,
total:null,
dialogTableVisible: false,
dialogFormVisible: false,
formLabelWidth: '120px',
LabelWidth: '180px',
Emp: {
id:"",
name:"",
sex:"",
phonenum:"",
temp:"",
risk:"",
health:"",
createTime:"",
content:"",
depart:""
}
}
}
}
</script>
<style>
.el-select .el-input {
width: 130px;
}
.input-with-select .el-input-group__prepend {
background-color: #fff;
}
.red{
color: red;
}
</style>

@ -0,0 +1,214 @@
<template>
<div>
<el-card class="login-form-layout">
<el-form
autocomplete="on"
:model="loginForm"
ref="loginForm"
label-position="left"
>
<div style="text-align: center">
<svg-icon icon-class="login-mall" style="width: 56px;height: 56px;color: #409EFF"></svg-icon>
</div>
<h2 class="login-title color-main">疫情防控管理系统登录</h2>
<el-form-item prop="username">
<el-input
name="username"
type="text"
v-model="loginForm.username"
autocomplete="on"
placeholder="请输入用户名"
>
<span slot="prefix">
<svg-icon icon-class="user" class="color-main"></svg-icon>
</span>
</el-input>
</el-form-item>
<el-form-item prop="password">
<el-input
name="password"
:type="pwdType"
@keyup.enter.native="handleLogin"
v-model="loginForm.password"
autocomplete="on"
placeholder="请输入密码"
show-password
>
<span slot="prefix">
<svg-icon icon-class="password" class="color-main"></svg-icon>
</span>
<span slot="suffix" @click="showPwd">
<svg-icon icon-class="eye" class="color-main"></svg-icon>
</span>
</el-input>
</el-form-item>
<el-form-item style="margin-bottom: 60px">
<el-button
style="width: 48%"
type="primary"
:loading="loading"
@click.native.prevent="handleLogin"
>登录</el-button>
<el-button
style="width: 48%"
type="success"
:loading="loading"
@click="dialogFormVisible = true"
>注册</el-button>
</el-form-item>
</el-form>
</el-card>
<el-dialog title="用户注册" :visible.sync="dialogFormVisible" center="">
<el-form :model="user">
<el-form-item label="用户名" :label-width="formLabelWidth">
<el-input v-model="user.username" autocomplete="off" size="small" :label-width="LabelWidth"></el-input>
</el-form-item>
<el-form-item label="密码" :label-width="formLabelWidth">
<el-input show-password :type="pwdType" v-model="user.password" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="确认密码" :label-width="formLabelWidth">
<el-input show-password :type="pwdType" v-model="user.repassword" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="所属部门" :label-width="formLabelWidth">
<el-select
v-model="user.depart"
clearable
placeholder="请选择"
>
<el-option
v-for="(item, index) in options2"
:key="index"
:label="item"
:value="item"
>
</el-option>
</el-select>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false"> </el-button>
<el-button type="primary" @click="register()"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
export default {
created(){
axios.get("http://localhost:8080/depart/findAll").then((resp) => {
this.options2 = resp.data;
});
},
name: "login",
data() {
return {
options2: [
{
value: "",
label: "",
},
],
formLabelWidth:'120px',
LabelWidth:'40px',
dialogFormVisible : false,
user:{
username: "",
password: "",
repassword:"",
depart:""
},
loginForm: {
username: "",
password: ""
},
loading: false,
pwdType: "password",
};
},
methods: {
register(){
this.dialogFormVisible = false
if(this.user.username==""||this.user.password=="") {
this.$alert("注册用户名或密码不能为空")
this.loading=false;
}else if(this.user.password==this.user.repassword){
axios.post('http://localhost:8080/userlogin/register',this.user).then((resp)=>{
console.log(resp)
this.loading=true;
if(resp.data=='success'){
this.loading=false;
this.$alert("注册成功!请登录");
}else if(resp.data=='repeat'){
this.loading=false;
this.$alert('用户名已存在!请重新注册')
}else{
this.loading=false;
this.$alert("注册失败!请重新注册")
window.location.reload()
}
})}
else {
this.$alert("两次输入的密码不一致!");
}
},
showPwd() {
if (this.pwdType === "password") {
this.pwdType = "";
} else {
this.pwdType = "password";
}
},
handleLogin() {
axios.post('http://localhost:8080/userlogin/user',this.loginForm).then((resp)=>{
console.log(resp)
this.loading=true;
if(this.loginForm.username==""||this.loginForm.password=="") {
this.$alert("用户名或密码不能为空")
this.loading=false;
}
else {
if(resp.data=='success'){
this.loading=false;
this.$message({
showClose: true,
message: '登录成功',
type: 'success'
});
this.$router.push('/index')
}else {
this.loading=false;
this.$alert("用户名或密码错误")
}
}
})
}
}
};
</script>
<style scoped>
.login-form-layout {
position: absolute;
left: 0;
right: 0;
width: 360px;
margin: 140px auto;
border-top: 10px solid #409eff;
}
.login-title {
text-align: center;
}
.login-center-layout {
background: #409eff;
width: auto;
height: auto;
max-width: 100%;
max-height: 100%;
margin-top: 200px;
}
</style>

@ -0,0 +1,7 @@
module.exports = {
devServer: {
// 项目运行时候的端口号
port: 8090
}
}
Loading…
Cancel
Save