@ -1,16 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="DataSourceManagerImpl" format="xml" multifile-model="true">
|
||||
<data-source source="LOCAL" name="@localhost" uuid="2c7ac471-219a-482b-8be5-26a81aa38c0d">
|
||||
<data-source source="LOCAL" name="@localhost" uuid="d0b56518-2a5d-4a9b-933b-039146f54f65">
|
||||
<driver-ref>mysql.8</driver-ref>
|
||||
<synchronize>true</synchronize>
|
||||
<jdbc-driver>com.mysql.cj.jdbc.Driver</jdbc-driver>
|
||||
<jdbc-url>jdbc:mysql://localhost:3306</jdbc-url>
|
||||
<jdbc-additional-properties>
|
||||
<property name="com.intellij.clouds.kubernetes.db.host.port" />
|
||||
<property name="com.intellij.clouds.kubernetes.db.enabled" value="false" />
|
||||
<property name="com.intellij.clouds.kubernetes.db.container.port" />
|
||||
</jdbc-additional-properties>
|
||||
<working-dir>$ProjectFileDir$</working-dir>
|
||||
</data-source>
|
||||
</component>
|
||||
|
||||
|
After Width: | Height: | Size: 3.7 MiB |
|
After Width: | Height: | Size: 73 KiB |
|
After Width: | Height: | Size: 972 KiB |
|
After Width: | Height: | Size: 306 KiB |
|
After Width: | Height: | Size: 443 KiB |
|
After Width: | Height: | Size: 161 KiB |
|
After Width: | Height: | Size: 161 KiB |
|
After Width: | Height: | Size: 257 KiB |
@ -0,0 +1,60 @@
|
||||
package com.example.controller;
|
||||
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
import com.example.common.Result;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.ServletOutputStream;
|
||||
import javax.servlet.ServletResponse;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.net.URLEncoder;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/files")
|
||||
public class FileController {
|
||||
|
||||
@Value("${ip}")
|
||||
private String ip;
|
||||
|
||||
@Value("${server.port}")
|
||||
private String port;
|
||||
|
||||
private static final String ROOT_PATH = System.getProperty("user.dir") + "/files";
|
||||
|
||||
/**文件上传**/
|
||||
@PostMapping("/upload")
|
||||
public Result upload(MultipartFile file) throws IOException {
|
||||
String originalFilename = file.getOriginalFilename();//获取原始文件名
|
||||
long flag = System.currentTimeMillis();//唯一标识
|
||||
String fileName = flag + "_" + originalFilename;
|
||||
|
||||
File finalFile = new File(ROOT_PATH + "/" + fileName);// 最终存到磁盘的文件对象
|
||||
if (!finalFile.getParentFile().exists()) {//如果父级目录不存在,就创建
|
||||
finalFile.getParentFile().mkdirs();
|
||||
}
|
||||
file.transferTo(finalFile);
|
||||
//返回文件的url
|
||||
//String url = "http://localhost:9090/files/download?fileName=" + fileName;
|
||||
String url = "http://" + ip + ":" + port + "/files/download?fileName=" + fileName;
|
||||
return Result.success(url);
|
||||
}
|
||||
|
||||
/**文件下载**/
|
||||
@GetMapping("/download")
|
||||
public void download(String fileName, HttpServletResponse response) throws IOException {
|
||||
File file = new File(ROOT_PATH + "/" + fileName); //文件在磁盘存储的对象
|
||||
ServletOutputStream os = response.getOutputStream();
|
||||
response.setHeader("Content-Disposition","attachment; filename=\"" + URLEncoder.encode(fileName,"UTF-8"));
|
||||
response.setContentType("application/octet-stream");
|
||||
FileUtil.writeToStream(file, os);
|
||||
os.flush();
|
||||
os.close();
|
||||
}
|
||||
}
|
||||
@ -1,4 +1,47 @@
|
||||
package com.example.controller;
|
||||
|
||||
import com.example.common.Result;
|
||||
import com.example.entity.Student;
|
||||
import com.example.service.StudentService;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/student")
|
||||
public class StudentController {
|
||||
|
||||
@Resource
|
||||
StudentService studentService;
|
||||
|
||||
/**新增**/
|
||||
@PostMapping("/add")
|
||||
public Result add(@RequestBody Student student){
|
||||
studentService.add(student);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
/**删除**/
|
||||
@DeleteMapping("/delete/{id}")
|
||||
public Result delete(@PathVariable Integer id){
|
||||
studentService.deleteById(id);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
/**更新**/
|
||||
@PutMapping("/update")
|
||||
public Result update(@RequestBody Student student){
|
||||
studentService.updateById(student);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
/**分页查询**/
|
||||
@GetMapping("/selectPage")
|
||||
public Result selectPage(@RequestParam(defaultValue = "1") Integer pageNum,
|
||||
@RequestParam(defaultValue = "10") Integer pageSize,
|
||||
Student student){
|
||||
PageInfo<Student> pageInfo = studentService.selectPage(pageNum,pageSize,student);
|
||||
return Result.success(pageInfo);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,13 +1,19 @@
|
||||
com\example\common\Result.class
|
||||
com\example\entity\Course.class
|
||||
com\example\entity\Account.class
|
||||
com\example\common\CorsConfig.class
|
||||
com\example\service\AdminService.class
|
||||
com\example\service\CourseService.class
|
||||
com\example\exception\GlobalExceptionHandler.class
|
||||
com\example\common\RoleEnum.class
|
||||
com\example\service\StudentService.class
|
||||
com\example\SpringbootApplication.class
|
||||
com\example\exception\CustomException.class
|
||||
com\example\mapper\CourseMapper.class
|
||||
com\example\mapper\StudentMapper.class
|
||||
com\example\entity\Student.class
|
||||
com\example\entity\Admin.class
|
||||
com\example\controller\WebController.class
|
||||
com\example\controller\StudentController.class
|
||||
com\example\controller\CourseController.class
|
||||
com\example\mapper\AdminMapper.class
|
||||
|
||||
@ -1,13 +1,19 @@
|
||||
C:\Users\28344\Desktop\1111\student\springboot\src\main\java\com\example\entity\Admin.java
|
||||
C:\Users\28344\Desktop\1111\student\springboot\src\main\java\com\example\common\CorsConfig.java
|
||||
C:\Users\28344\Desktop\1111\student\springboot\src\main\java\com\example\service\CourseService.java
|
||||
C:\Users\28344\Desktop\1111\student\springboot\src\main\java\com\example\entity\Course.java
|
||||
C:\Users\28344\Desktop\1111\student\springboot\src\main\java\com\example\exception\GlobalExceptionHandler.java
|
||||
C:\Users\28344\Desktop\1111\student\springboot\src\main\java\com\example\exception\CustomException.java
|
||||
C:\Users\28344\Desktop\1111\student\springboot\src\main\java\com\example\common\Result.java
|
||||
C:\Users\28344\Desktop\1111\student\springboot\src\main\java\com\example\service\AdminService.java
|
||||
C:\Users\28344\Desktop\1111\student\springboot\src\main\java\com\example\controller\WebController.java
|
||||
C:\Users\28344\Desktop\1111\student\springboot\src\main\java\com\example\mapper\CourseMapper.java
|
||||
C:\Users\28344\Desktop\1111\student\springboot\src\main\java\com\example\SpringbootApplication.java
|
||||
C:\Users\28344\Desktop\1111\student\springboot\src\main\java\com\example\mapper\AdminMapper.java
|
||||
C:\Users\28344\Desktop\1111\student\springboot\src\main\java\com\example\controller\CourseController.java
|
||||
E:\information work\1111\student\springboot\src\main\java\com\example\entity\Student.java
|
||||
E:\information work\1111\student\springboot\src\main\java\com\example\exception\CustomException.java
|
||||
E:\information work\1111\student\springboot\src\main\java\com\example\controller\CourseController.java
|
||||
E:\information work\1111\student\springboot\src\main\java\com\example\common\CorsConfig.java
|
||||
E:\information work\1111\student\springboot\src\main\java\com\example\common\Result.java
|
||||
E:\information work\1111\student\springboot\src\main\java\com\example\common\RoleEnum.java
|
||||
E:\information work\1111\student\springboot\src\main\java\com\example\service\CourseService.java
|
||||
E:\information work\1111\student\springboot\src\main\java\com\example\exception\GlobalExceptionHandler.java
|
||||
E:\information work\1111\student\springboot\src\main\java\com\example\controller\StudentController.java
|
||||
E:\information work\1111\student\springboot\src\main\java\com\example\service\StudentService.java
|
||||
E:\information work\1111\student\springboot\src\main\java\com\example\mapper\StudentMapper.java
|
||||
E:\information work\1111\student\springboot\src\main\java\com\example\controller\WebController.java
|
||||
E:\information work\1111\student\springboot\src\main\java\com\example\entity\Course.java
|
||||
E:\information work\1111\student\springboot\src\main\java\com\example\service\AdminService.java
|
||||
E:\information work\1111\student\springboot\src\main\java\com\example\mapper\CourseMapper.java
|
||||
E:\information work\1111\student\springboot\src\main\java\com\example\SpringbootApplication.java
|
||||
E:\information work\1111\student\springboot\src\main\java\com\example\entity\Admin.java
|
||||
E:\information work\1111\student\springboot\src\main\java\com\example\mapper\AdminMapper.java
|
||||
E:\information work\1111\student\springboot\src\main\java\com\example\entity\Account.java
|
||||
|
||||
@ -1,3 +0,0 @@
|
||||
// node_modules/element-plus/es/components/tag/style/index.mjs
|
||||
import "C:/Users/28344/Desktop/1111/student/vue/node_modules/element-plus/theme-chalk/src/tag.scss";
|
||||
//# sourceMappingURL=chunk-2DAU5UIR.js.map
|
||||
@ -0,0 +1,3 @@
|
||||
// node_modules/element-plus/es/components/button/style/index.mjs
|
||||
import "E:/information work/1111/student/vue/node_modules/element-plus/theme-chalk/src/button.scss";
|
||||
//# sourceMappingURL=chunk-4ORR6HVR.js.map
|
||||
@ -1,3 +0,0 @@
|
||||
// node_modules/element-plus/es/components/popper/style/index.mjs
|
||||
import "C:/Users/28344/Desktop/1111/student/vue/node_modules/element-plus/theme-chalk/src/popper.scss";
|
||||
//# sourceMappingURL=chunk-6YLF2CKD.js.map
|
||||
@ -1,3 +0,0 @@
|
||||
// node_modules/element-plus/es/components/checkbox/style/index.mjs
|
||||
import "C:/Users/28344/Desktop/1111/student/vue/node_modules/element-plus/theme-chalk/src/checkbox.scss";
|
||||
//# sourceMappingURL=chunk-A5CFU6IU.js.map
|
||||
@ -1,6 +0,0 @@
|
||||
// node_modules/element-plus/es/components/option-group/style/index.mjs
|
||||
import "C:/Users/28344/Desktop/1111/student/vue/node_modules/element-plus/theme-chalk/src/option-group.scss";
|
||||
|
||||
// node_modules/element-plus/es/components/select/style/index.mjs
|
||||
import "C:/Users/28344/Desktop/1111/student/vue/node_modules/element-plus/theme-chalk/src/select.scss";
|
||||
//# sourceMappingURL=chunk-AO5DG4NS.js.map
|
||||
@ -1,3 +0,0 @@
|
||||
// node_modules/element-plus/es/components/base/style/index.mjs
|
||||
import "C:/Users/28344/Desktop/1111/student/vue/node_modules/element-plus/theme-chalk/src/base.scss";
|
||||
//# sourceMappingURL=chunk-AV3DMDAN.js.map
|
||||
@ -1,3 +0,0 @@
|
||||
// node_modules/element-plus/es/components/tooltip/style/index.mjs
|
||||
import "C:/Users/28344/Desktop/1111/student/vue/node_modules/element-plus/theme-chalk/src/tooltip.scss";
|
||||
//# sourceMappingURL=chunk-AYEHESJ3.js.map
|
||||
@ -1,3 +0,0 @@
|
||||
// node_modules/element-plus/es/components/option/style/index.mjs
|
||||
import "C:/Users/28344/Desktop/1111/student/vue/node_modules/element-plus/theme-chalk/src/option.scss";
|
||||
//# sourceMappingURL=chunk-AZC2C57S.js.map
|
||||
@ -0,0 +1,3 @@
|
||||
// node_modules/element-plus/es/components/popper/style/index.mjs
|
||||
import "E:/information work/1111/student/vue/node_modules/element-plus/theme-chalk/src/popper.scss";
|
||||
//# sourceMappingURL=chunk-D77GAYGH.js.map
|
||||
@ -1,3 +0,0 @@
|
||||
// node_modules/element-plus/es/components/overlay/style/index.mjs
|
||||
import "C:/Users/28344/Desktop/1111/student/vue/node_modules/element-plus/theme-chalk/src/overlay.scss";
|
||||
//# sourceMappingURL=chunk-DGDJFXZF.js.map
|
||||
@ -0,0 +1,3 @@
|
||||
// node_modules/element-plus/es/components/scrollbar/style/index.mjs
|
||||
import "E:/information work/1111/student/vue/node_modules/element-plus/theme-chalk/src/scrollbar.scss";
|
||||
//# sourceMappingURL=chunk-FEGR7JD2.js.map
|
||||
@ -1,3 +0,0 @@
|
||||
// node_modules/element-plus/es/components/input/style/index.mjs
|
||||
import "C:/Users/28344/Desktop/1111/student/vue/node_modules/element-plus/theme-chalk/src/input.scss";
|
||||
//# sourceMappingURL=chunk-HWC2XRY6.js.map
|
||||
@ -0,0 +1,3 @@
|
||||
// node_modules/element-plus/es/components/option/style/index.mjs
|
||||
import "E:/information work/1111/student/vue/node_modules/element-plus/theme-chalk/src/option.scss";
|
||||
//# sourceMappingURL=chunk-LMGJIVAK.js.map
|
||||
@ -0,0 +1,3 @@
|
||||
// node_modules/element-plus/es/components/overlay/style/index.mjs
|
||||
import "E:/information work/1111/student/vue/node_modules/element-plus/theme-chalk/src/overlay.scss";
|
||||
//# sourceMappingURL=chunk-NHSPTBWR.js.map
|
||||
@ -1,3 +0,0 @@
|
||||
// node_modules/element-plus/es/components/scrollbar/style/index.mjs
|
||||
import "C:/Users/28344/Desktop/1111/student/vue/node_modules/element-plus/theme-chalk/src/scrollbar.scss";
|
||||
//# sourceMappingURL=chunk-OSV6IDCE.js.map
|
||||
@ -0,0 +1,3 @@
|
||||
// node_modules/element-plus/es/components/input/style/index.mjs
|
||||
import "E:/information work/1111/student/vue/node_modules/element-plus/theme-chalk/src/input.scss";
|
||||
//# sourceMappingURL=chunk-QEJGXXI6.js.map
|
||||
@ -0,0 +1,3 @@
|
||||
// node_modules/element-plus/es/components/tooltip/style/index.mjs
|
||||
import "E:/information work/1111/student/vue/node_modules/element-plus/theme-chalk/src/tooltip.scss";
|
||||
//# sourceMappingURL=chunk-ROTADC2C.js.map
|
||||
@ -1,3 +0,0 @@
|
||||
// node_modules/element-plus/es/components/button/style/index.mjs
|
||||
import "C:/Users/28344/Desktop/1111/student/vue/node_modules/element-plus/theme-chalk/src/button.scss";
|
||||
//# sourceMappingURL=chunk-V4VQS4OV.js.map
|
||||
@ -0,0 +1,3 @@
|
||||
// node_modules/element-plus/es/components/checkbox/style/index.mjs
|
||||
import "E:/information work/1111/student/vue/node_modules/element-plus/theme-chalk/src/checkbox.scss";
|
||||
//# sourceMappingURL=chunk-WQX2S47E.js.map
|
||||
@ -0,0 +1,3 @@
|
||||
// node_modules/element-plus/es/components/base/style/index.mjs
|
||||
import "E:/information work/1111/student/vue/node_modules/element-plus/theme-chalk/src/base.scss";
|
||||
//# sourceMappingURL=chunk-XWS6SUIF.js.map
|
||||
@ -0,0 +1,3 @@
|
||||
// node_modules/element-plus/es/components/tag/style/index.mjs
|
||||
import "E:/information work/1111/student/vue/node_modules/element-plus/theme-chalk/src/tag.scss";
|
||||
//# sourceMappingURL=chunk-Y2A3P2KJ.js.map
|
||||
@ -0,0 +1,6 @@
|
||||
// node_modules/element-plus/es/components/option-group/style/index.mjs
|
||||
import "E:/information work/1111/student/vue/node_modules/element-plus/theme-chalk/src/option-group.scss";
|
||||
|
||||
// node_modules/element-plus/es/components/select/style/index.mjs
|
||||
import "E:/information work/1111/student/vue/node_modules/element-plus/theme-chalk/src/select.scss";
|
||||
//# sourceMappingURL=chunk-YENZLIFH.js.map
|
||||
2
student/vue/node_modules/.vite/deps/element-plus_es_components_base_style_index.js
generated
vendored
@ -1,2 +1,2 @@
|
||||
import "./chunk-AV3DMDAN.js";
|
||||
import "./chunk-XWS6SUIF.js";
|
||||
//# sourceMappingURL=element-plus_es_components_base_style_index.js.map
|
||||
|
||||
4
student/vue/node_modules/.vite/deps/element-plus_es_components_button_style_index.js
generated
vendored
@ -1,3 +1,3 @@
|
||||
import "./chunk-V4VQS4OV.js";
|
||||
import "./chunk-AV3DMDAN.js";
|
||||
import "./chunk-4ORR6HVR.js";
|
||||
import "./chunk-XWS6SUIF.js";
|
||||
//# sourceMappingURL=element-plus_es_components_button_style_index.js.map
|
||||
|
||||
@ -0,0 +1,9 @@
|
||||
import "./chunk-4ORR6HVR.js";
|
||||
import "./chunk-FEGR7JD2.js";
|
||||
import "./chunk-QEJGXXI6.js";
|
||||
import "./chunk-D77GAYGH.js";
|
||||
import "./chunk-XWS6SUIF.js";
|
||||
|
||||
// node_modules/element-plus/es/components/date-picker/style/index.mjs
|
||||
import "E:/information work/1111/student/vue/node_modules/element-plus/theme-chalk/src/date-picker.scss";
|
||||
//# sourceMappingURL=element-plus_es_components_date-picker_style_index.js.map
|
||||
@ -0,0 +1,7 @@
|
||||
{
|
||||
"version": 3,
|
||||
"sources": ["../../element-plus/es/components/date-picker/style/index.mjs"],
|
||||
"sourcesContent": ["import '../../base/style/index.mjs';\r\nimport 'element-plus/theme-chalk/src/date-picker.scss';\r\nimport '../../input/style/index.mjs';\r\nimport '../../scrollbar/style/index.mjs';\r\nimport '../../popper/style/index.mjs';\r\nimport '../../button/style/index.mjs';\r\n//# sourceMappingURL=index.mjs.map\r\n"],
|
||||
"mappings": ";;;;;;;AACA,OAAO;",
|
||||
"names": []
|
||||
}
|
||||
6
student/vue/node_modules/.vite/deps/element-plus_es_components_dialog_style_index.js
generated
vendored
@ -1,6 +1,6 @@
|
||||
import "./chunk-DGDJFXZF.js";
|
||||
import "./chunk-AV3DMDAN.js";
|
||||
import "./chunk-NHSPTBWR.js";
|
||||
import "./chunk-XWS6SUIF.js";
|
||||
|
||||
// node_modules/element-plus/es/components/dialog/style/index.mjs
|
||||
import "C:/Users/28344/Desktop/1111/student/vue/node_modules/element-plus/theme-chalk/src/dialog.scss";
|
||||
import "E:/information work/1111/student/vue/node_modules/element-plus/theme-chalk/src/dialog.scss";
|
||||
//# sourceMappingURL=element-plus_es_components_dialog_style_index.js.map
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import "./chunk-AV3DMDAN.js";
|
||||
import "./chunk-XWS6SUIF.js";
|
||||
|
||||
// node_modules/element-plus/es/components/form-item/style/index.mjs
|
||||
import "C:/Users/28344/Desktop/1111/student/vue/node_modules/element-plus/theme-chalk/src/form-item.scss";
|
||||
import "E:/information work/1111/student/vue/node_modules/element-plus/theme-chalk/src/form-item.scss";
|
||||
//# sourceMappingURL=element-plus_es_components_form-item_style_index.js.map
|
||||
|
||||
4
student/vue/node_modules/.vite/deps/element-plus_es_components_form_style_index.js
generated
vendored
@ -1,5 +1,5 @@
|
||||
import "./chunk-AV3DMDAN.js";
|
||||
import "./chunk-XWS6SUIF.js";
|
||||
|
||||
// node_modules/element-plus/es/components/form/style/index.mjs
|
||||
import "C:/Users/28344/Desktop/1111/student/vue/node_modules/element-plus/theme-chalk/src/form.scss";
|
||||
import "E:/information work/1111/student/vue/node_modules/element-plus/theme-chalk/src/form.scss";
|
||||
//# sourceMappingURL=element-plus_es_components_form_style_index.js.map
|
||||
|
||||
4
student/vue/node_modules/.vite/deps/element-plus_es_components_icon_style_index.js
generated
vendored
@ -1,5 +1,5 @@
|
||||
import "./chunk-AV3DMDAN.js";
|
||||
import "./chunk-XWS6SUIF.js";
|
||||
|
||||
// node_modules/element-plus/es/components/icon/style/index.mjs
|
||||
import "C:/Users/28344/Desktop/1111/student/vue/node_modules/element-plus/theme-chalk/src/icon.scss";
|
||||
import "E:/information work/1111/student/vue/node_modules/element-plus/theme-chalk/src/icon.scss";
|
||||
//# sourceMappingURL=element-plus_es_components_icon_style_index.js.map
|
||||
|
||||
4
student/vue/node_modules/.vite/deps/element-plus_es_components_input_style_index.js
generated
vendored
@ -1,3 +1,3 @@
|
||||
import "./chunk-HWC2XRY6.js";
|
||||
import "./chunk-AV3DMDAN.js";
|
||||
import "./chunk-QEJGXXI6.js";
|
||||
import "./chunk-XWS6SUIF.js";
|
||||
//# sourceMappingURL=element-plus_es_components_input_style_index.js.map
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import "./chunk-AV3DMDAN.js";
|
||||
import "./chunk-XWS6SUIF.js";
|
||||
|
||||
// node_modules/element-plus/es/components/menu-item/style/index.mjs
|
||||
import "C:/Users/28344/Desktop/1111/student/vue/node_modules/element-plus/theme-chalk/src/menu-item.scss";
|
||||
import "E:/information work/1111/student/vue/node_modules/element-plus/theme-chalk/src/menu-item.scss";
|
||||
//# sourceMappingURL=element-plus_es_components_menu-item_style_index.js.map
|
||||
|
||||
8
student/vue/node_modules/.vite/deps/element-plus_es_components_menu_style_index.js
generated
vendored
@ -1,7 +1,7 @@
|
||||
import "./chunk-AYEHESJ3.js";
|
||||
import "./chunk-6YLF2CKD.js";
|
||||
import "./chunk-AV3DMDAN.js";
|
||||
import "./chunk-ROTADC2C.js";
|
||||
import "./chunk-D77GAYGH.js";
|
||||
import "./chunk-XWS6SUIF.js";
|
||||
|
||||
// node_modules/element-plus/es/components/menu/style/index.mjs
|
||||
import "C:/Users/28344/Desktop/1111/student/vue/node_modules/element-plus/theme-chalk/src/menu.scss";
|
||||
import "E:/information work/1111/student/vue/node_modules/element-plus/theme-chalk/src/menu.scss";
|
||||
//# sourceMappingURL=element-plus_es_components_menu_style_index.js.map
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import "./chunk-V4VQS4OV.js";
|
||||
import "./chunk-DGDJFXZF.js";
|
||||
import "./chunk-HWC2XRY6.js";
|
||||
import "./chunk-AV3DMDAN.js";
|
||||
import "./chunk-NHSPTBWR.js";
|
||||
import "./chunk-4ORR6HVR.js";
|
||||
import "./chunk-QEJGXXI6.js";
|
||||
import "./chunk-XWS6SUIF.js";
|
||||
|
||||
// node_modules/element-plus/es/components/message-box/style/index.mjs
|
||||
import "C:/Users/28344/Desktop/1111/student/vue/node_modules/element-plus/theme-chalk/src/message-box.scss";
|
||||
import "E:/information work/1111/student/vue/node_modules/element-plus/theme-chalk/src/message-box.scss";
|
||||
//# sourceMappingURL=element-plus_es_components_message-box_style_index.js.map
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import "./chunk-AV3DMDAN.js";
|
||||
import "./chunk-XWS6SUIF.js";
|
||||
|
||||
// node_modules/element-plus/es/components/badge/style/index.mjs
|
||||
import "C:/Users/28344/Desktop/1111/student/vue/node_modules/element-plus/theme-chalk/src/badge.scss";
|
||||
import "E:/information work/1111/student/vue/node_modules/element-plus/theme-chalk/src/badge.scss";
|
||||
|
||||
// node_modules/element-plus/es/components/message/style/index.mjs
|
||||
import "C:/Users/28344/Desktop/1111/student/vue/node_modules/element-plus/theme-chalk/src/message.scss";
|
||||
import "E:/information work/1111/student/vue/node_modules/element-plus/theme-chalk/src/message.scss";
|
||||
//# sourceMappingURL=element-plus_es_components_message_style_index.js.map
|
||||
|
||||
4
student/vue/node_modules/.vite/deps/element-plus_es_components_option_style_index.js
generated
vendored
@ -1,3 +1,3 @@
|
||||
import "./chunk-AZC2C57S.js";
|
||||
import "./chunk-AV3DMDAN.js";
|
||||
import "./chunk-LMGJIVAK.js";
|
||||
import "./chunk-XWS6SUIF.js";
|
||||
//# sourceMappingURL=element-plus_es_components_option_style_index.js.map
|
||||
|
||||
16
student/vue/node_modules/.vite/deps/element-plus_es_components_pagination_style_index.js
generated
vendored
@ -1,11 +1,11 @@
|
||||
import "./chunk-AO5DG4NS.js";
|
||||
import "./chunk-OSV6IDCE.js";
|
||||
import "./chunk-HWC2XRY6.js";
|
||||
import "./chunk-6YLF2CKD.js";
|
||||
import "./chunk-2DAU5UIR.js";
|
||||
import "./chunk-AZC2C57S.js";
|
||||
import "./chunk-AV3DMDAN.js";
|
||||
import "./chunk-YENZLIFH.js";
|
||||
import "./chunk-Y2A3P2KJ.js";
|
||||
import "./chunk-FEGR7JD2.js";
|
||||
import "./chunk-QEJGXXI6.js";
|
||||
import "./chunk-D77GAYGH.js";
|
||||
import "./chunk-LMGJIVAK.js";
|
||||
import "./chunk-XWS6SUIF.js";
|
||||
|
||||
// node_modules/element-plus/es/components/pagination/style/index.mjs
|
||||
import "C:/Users/28344/Desktop/1111/student/vue/node_modules/element-plus/theme-chalk/src/pagination.scss";
|
||||
import "E:/information work/1111/student/vue/node_modules/element-plus/theme-chalk/src/pagination.scss";
|
||||
//# sourceMappingURL=element-plus_es_components_pagination_style_index.js.map
|
||||
|
||||
@ -0,0 +1,5 @@
|
||||
import "./chunk-XWS6SUIF.js";
|
||||
|
||||
// node_modules/element-plus/es/components/radio-group/style/index.mjs
|
||||
import "E:/information work/1111/student/vue/node_modules/element-plus/theme-chalk/src/radio-group.scss";
|
||||
//# sourceMappingURL=element-plus_es_components_radio-group_style_index.js.map
|
||||
@ -0,0 +1,7 @@
|
||||
{
|
||||
"version": 3,
|
||||
"sources": ["../../element-plus/es/components/radio-group/style/index.mjs"],
|
||||
"sourcesContent": ["import '../../base/style/index.mjs';\r\nimport 'element-plus/theme-chalk/src/radio-group.scss';\r\n//# sourceMappingURL=index.mjs.map\r\n"],
|
||||
"mappings": ";;;AACA,OAAO;",
|
||||
"names": []
|
||||
}
|
||||
5
student/vue/node_modules/.vite/deps/element-plus_es_components_radio_style_index.js
generated
vendored
@ -0,0 +1,5 @@
|
||||
import "./chunk-XWS6SUIF.js";
|
||||
|
||||
// node_modules/element-plus/es/components/radio/style/index.mjs
|
||||
import "E:/information work/1111/student/vue/node_modules/element-plus/theme-chalk/src/radio.scss";
|
||||
//# sourceMappingURL=element-plus_es_components_radio_style_index.js.map
|
||||
@ -0,0 +1,7 @@
|
||||
{
|
||||
"version": 3,
|
||||
"sources": ["../../element-plus/es/components/radio/style/index.mjs"],
|
||||
"sourcesContent": ["import '../../base/style/index.mjs';\r\nimport 'element-plus/theme-chalk/src/radio.scss';\r\n//# sourceMappingURL=index.mjs.map\r\n"],
|
||||
"mappings": ";;;AACA,OAAO;",
|
||||
"names": []
|
||||
}
|
||||
14
student/vue/node_modules/.vite/deps/element-plus_es_components_select_style_index.js
generated
vendored
@ -1,8 +1,8 @@
|
||||
import "./chunk-AO5DG4NS.js";
|
||||
import "./chunk-OSV6IDCE.js";
|
||||
import "./chunk-HWC2XRY6.js";
|
||||
import "./chunk-6YLF2CKD.js";
|
||||
import "./chunk-2DAU5UIR.js";
|
||||
import "./chunk-AZC2C57S.js";
|
||||
import "./chunk-AV3DMDAN.js";
|
||||
import "./chunk-YENZLIFH.js";
|
||||
import "./chunk-Y2A3P2KJ.js";
|
||||
import "./chunk-FEGR7JD2.js";
|
||||
import "./chunk-QEJGXXI6.js";
|
||||
import "./chunk-D77GAYGH.js";
|
||||
import "./chunk-LMGJIVAK.js";
|
||||
import "./chunk-XWS6SUIF.js";
|
||||
//# sourceMappingURL=element-plus_es_components_select_style_index.js.map
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import "./chunk-AV3DMDAN.js";
|
||||
import "./chunk-XWS6SUIF.js";
|
||||
|
||||
// node_modules/element-plus/es/components/sub-menu/style/index.mjs
|
||||
import "C:/Users/28344/Desktop/1111/student/vue/node_modules/element-plus/theme-chalk/src/sub-menu.scss";
|
||||
import "E:/information work/1111/student/vue/node_modules/element-plus/theme-chalk/src/sub-menu.scss";
|
||||
//# sourceMappingURL=element-plus_es_components_sub-menu_style_index.js.map
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import "./chunk-A5CFU6IU.js";
|
||||
import "./chunk-2DAU5UIR.js";
|
||||
import "./chunk-AV3DMDAN.js";
|
||||
import "./chunk-WQX2S47E.js";
|
||||
import "./chunk-Y2A3P2KJ.js";
|
||||
import "./chunk-XWS6SUIF.js";
|
||||
|
||||
// node_modules/element-plus/es/components/table-column/style/index.mjs
|
||||
import "C:/Users/28344/Desktop/1111/student/vue/node_modules/element-plus/theme-chalk/src/table-column.scss";
|
||||
import "E:/information work/1111/student/vue/node_modules/element-plus/theme-chalk/src/table-column.scss";
|
||||
//# sourceMappingURL=element-plus_es_components_table-column_style_index.js.map
|
||||
|
||||
12
student/vue/node_modules/.vite/deps/element-plus_es_components_table_style_index.js
generated
vendored
@ -1,9 +1,9 @@
|
||||
import "./chunk-AYEHESJ3.js";
|
||||
import "./chunk-A5CFU6IU.js";
|
||||
import "./chunk-OSV6IDCE.js";
|
||||
import "./chunk-6YLF2CKD.js";
|
||||
import "./chunk-AV3DMDAN.js";
|
||||
import "./chunk-WQX2S47E.js";
|
||||
import "./chunk-ROTADC2C.js";
|
||||
import "./chunk-FEGR7JD2.js";
|
||||
import "./chunk-D77GAYGH.js";
|
||||
import "./chunk-XWS6SUIF.js";
|
||||
|
||||
// node_modules/element-plus/es/components/table/style/index.mjs
|
||||
import "C:/Users/28344/Desktop/1111/student/vue/node_modules/element-plus/theme-chalk/src/table.scss";
|
||||
import "E:/information work/1111/student/vue/node_modules/element-plus/theme-chalk/src/table.scss";
|
||||
//# sourceMappingURL=element-plus_es_components_table_style_index.js.map
|
||||
|
||||
@ -0,0 +1,181 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="card" style="margin-bottom: 10px">
|
||||
<el-input style="width: 260px; margin-right: 10px" placeholder="请输入账号查询" prefix-icon="Search" v-model="data.username" icon="el-icon-search"></el-input>
|
||||
<el-input style="width: 260px; margin-right: 10px" placeholder="请输入名称查询" prefix-icon="Search" v-model="data.name" icon="el-icon-search"></el-input>
|
||||
<el-button type="primary" style="margin-left: 10px" @click="load">查询</el-button>
|
||||
<el-button type="primary" @click="reset">重置</el-button>
|
||||
</div>
|
||||
<div class="card" style="margin-bottom: 10px">
|
||||
<div style="margin-bottom: 10px">
|
||||
<el-button type="primary" @click = "handleAdd">新增</el-button>
|
||||
</div>
|
||||
<div>
|
||||
<el-table :data="data.tableData" style="width: 100%">
|
||||
<el-table-column prop="id" label="序号" width="70"></el-table-column>
|
||||
<el-table-column prop="username" label="学生账号"></el-table-column>
|
||||
<el-table-column prop="name" label="学生名称"></el-table-column>
|
||||
<el-table-column prop="phone" label="学生手机号"></el-table-column>
|
||||
<el-table-column prop="email" label="学生邮箱"></el-table-column>
|
||||
<el-table-column prop="sex" label="性别"></el-table-column>
|
||||
<el-table-column prop="birth" label="生日"></el-table-column>
|
||||
<el-table-column prop="avatar" label="头像"></el-table-column>
|
||||
<el-table-column label="操作" with="180">
|
||||
<template #default="scope">
|
||||
<el-button type="primary" @click = "handleEdit(scope.row)" plain>编辑</el-button>
|
||||
<el-button type="danger" @click = "del(scope.row.id)" plain>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div calss="card">
|
||||
<el-pagination v-model:current-page="data.pageNum" v-model:page-size="data.pageSize"
|
||||
@current-change="handelCurrentChange"
|
||||
background layout="prev, pager, next" :total="data.total" ></el-pagination>
|
||||
</div>
|
||||
|
||||
<el-dialog width = "35%" v-model="data.formVisible" title="学生信息">
|
||||
<el-form :model="data.form" :rules="rules" ref="formRef" label-width="100px" label-position = "right" style = "padding-right: 40px">
|
||||
<el-form-item label="学生账号" prop="username">
|
||||
<el-input v-model="data.form.username" autocomplete="off" />
|
||||
</el-form-item>
|
||||
<el-form-item label="学生密码" prop="password">
|
||||
<el-input show-password v-model="data.form.password" autocomplete="off" />
|
||||
</el-form-item>
|
||||
<el-form-item label="学生名称">
|
||||
<el-input v-model="data.form.name" autocomplete="off" />
|
||||
</el-form-item>
|
||||
<el-form-item label="手机号">
|
||||
<el-input v-model="data.form.phone" autocomplete="off" />
|
||||
</el-form-item>
|
||||
<el-form-item label="邮箱">
|
||||
<el-input v-model="data.form.email" autocomplete="off" />
|
||||
</el-form-item>
|
||||
<el-form-item label="性别">
|
||||
<el-radio-group v-model="data.form.sex">
|
||||
<el-radio label="男"></el-radio>
|
||||
<el-radio label="女"></el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="生日">
|
||||
<el-date-picker style="width: 100%" format="YYYY-MM-DD" value-format="YYYY-MM-DD" v-model="data.form.birth"></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="data.formVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click="save">保存</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
|
||||
import {ref,reactive} from "vue";
|
||||
import {Search} from "@element-plus/icons-vue";
|
||||
import request from "@/utils/request";
|
||||
import {ElMessage, ElMessageBox} from "element-plus";
|
||||
|
||||
const baseUrl = '/student'
|
||||
|
||||
const data = reactive({
|
||||
username:'',
|
||||
name:'',
|
||||
tableData: [],
|
||||
total: 0,
|
||||
pageNum: 1, //当前页码
|
||||
pageSize: 5, //每页的个数
|
||||
formVisible:false,
|
||||
form:{}
|
||||
})
|
||||
|
||||
const load = () => {
|
||||
request.get(baseUrl + '/selectPage',{
|
||||
params :{
|
||||
pageNum: data.pageNum,
|
||||
pageSize: data.pageSize,
|
||||
username: data.username,
|
||||
name: data.name,
|
||||
}
|
||||
}).then(res =>{
|
||||
data.tableData = res.data?.list || []
|
||||
data.total = res.data?.total || 0
|
||||
})
|
||||
}
|
||||
load()
|
||||
|
||||
const handelCurrentChange = (pageNum) => {
|
||||
load()
|
||||
}
|
||||
|
||||
const reset = () => {
|
||||
data.username = ''
|
||||
data.name = ''
|
||||
load()
|
||||
}
|
||||
|
||||
const formRef = ref()
|
||||
|
||||
const rules = reactive({
|
||||
username: [
|
||||
{ required: true, message: '请输入账号', trigger: 'blur' },
|
||||
],
|
||||
password: [
|
||||
{ required: true, message: '请输入密码', trigger: 'blur' },
|
||||
],
|
||||
})
|
||||
|
||||
const handleAdd = () =>{
|
||||
data.form={}
|
||||
data.formVisible = true
|
||||
}
|
||||
//保存信息到后台
|
||||
const save = () =>{
|
||||
formRef.value.validate((valid) => {
|
||||
if(valid){
|
||||
request.request({
|
||||
url: data.form.id ? baseUrl + '/update' : baseUrl + '/add',
|
||||
method: data.form.id ? 'PUT' : 'POST',
|
||||
data: data.form
|
||||
}).then (res => {
|
||||
if(res.code === '200'){
|
||||
load() //重新获取数据
|
||||
data.formVisible = false; //关闭弹窗
|
||||
ElMessage.success("操作成功")
|
||||
}else{
|
||||
ElMessage.error(res.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const handleEdit = (row) => {
|
||||
data.form = JSON.parse(JSON.stringify(row))
|
||||
data.formVisible = true
|
||||
}
|
||||
|
||||
const del = (id) => {
|
||||
ElMessageBox.confirm('确认删除吗?','删除确认',{type: 'warning'}).then(res => {
|
||||
request.delete(baseUrl + '/delete/' + id).then(res => {
|
||||
if (res.code === '200') {
|
||||
load() //重新获取数据
|
||||
ElMessage.success("操作成功")
|
||||
} else {
|
||||
ElMessage.error(res.msg)
|
||||
}
|
||||
})
|
||||
}).catch(res => {
|
||||
ElMessage({
|
||||
type: 'info',
|
||||
message: 'Delete canceled',
|
||||
})
|
||||
}).catch(res => {})
|
||||
}
|
||||
</script>
|
||||