Quellcode durchsuchen

Merge pull request #503 from flipped-aurora/develop

pr合并
奇淼(piexlmax vor 3 Jahren
Ursprung
Commit
0f0353f955
100 geänderte Dateien mit 2841 neuen und 2635 gelöschten Zeilen
  1. 2 3
      server/api/v1/exa_customer.go
  2. 2 2
      server/api/v1/exa_excel.go
  3. 0 1
      server/api/v1/sys_auto_code.go
  4. 1 1
      server/api/v1/sys_captcha.go
  5. 5 9
      server/api/v1/sys_initdb.go
  6. 2 5
      server/api/v1/sys_system.go
  7. 12 12
      server/api/v1/sys_user.go
  8. 0 1
      server/initialize/gorm.go
  9. 1 1
      server/resource/template/server/api.go.tpl
  10. 6 6
      server/router/exa_customer.go
  11. 5 5
      server/router/exa_excel.go
  12. 8 8
      server/router/exa_file_upload_and_download.go
  13. 4 4
      server/router/exa_simple_uploader.go
  14. 2 2
      server/router/sys_email.go
  15. 3 3
      server/router/sys_initdb.go
  16. 2 2
      server/router/sys_jwt.go
  17. 2 2
      server/router/sys_user.go
  18. 7 7
      server/service/exa_simple_uploader.go
  19. 2 2
      server/service/jwt_black_list.go
  20. 2 2
      server/service/sys_authority.go
  21. 7 11
      server/service/sys_auto_code.go
  22. 1 1
      server/service/sys_base_menu.go
  23. 1 1
      server/service/sys_dictionary_detail.go
  24. 4 4
      server/service/sys_initdb.go
  25. 1 1
      server/service/sys_menu.go
  26. 3 3
      server/service/sys_system.go
  27. 2 3
      server/utils/breakpoint_continue.go
  28. 2 2
      server/utils/db_automation.go
  29. 1 1
      server/utils/file_operations.go
  30. 1 1
      server/utils/injectionCode.go
  31. 1 1
      server/utils/upload/aliyun_oss.go
  32. 1 2
      server/utils/upload/qiniu.go
  33. 1 2
      server/utils/validator.go
  34. 1 1
      server/utils/zipfiles.go
  35. 4 0
      web/.eslintignore
  36. 269 0
      web/.eslintrc.js
  37. 4 4
      web/babel.config.js
  38. 14 16
      web/build.config.js
  39. 12 12
      web/openDocument.js
  40. 5 5
      web/src/App.vue
  41. 42 44
      web/src/api/api.js
  42. 31 33
      web/src/api/authority.js
  43. 26 28
      web/src/api/autoCode.js
  44. 17 19
      web/src/api/breakpoint.js
  45. 11 13
      web/src/api/casbin.js
  46. 26 31
      web/src/api/customer.js
  47. 6 6
      web/src/api/email.js
  48. 49 49
      web/src/api/excel.js
  49. 12 12
      web/src/api/fileUploadAndDownload.js
  50. 21 22
      web/src/api/github.js
  51. 10 12
      web/src/api/initdb.js
  52. 5 6
      web/src/api/jwt.js
  53. 44 47
      web/src/api/menu.js
  54. 10 12
      web/src/api/simpleUploader.js
  55. 34 37
      web/src/api/sysDictionary.js
  56. 34 37
      web/src/api/sysDictionaryDetail.js
  57. 16 16
      web/src/api/sysOperationRecord.js
  58. 18 18
      web/src/api/system.js
  59. 57 57
      web/src/api/user.js
  60. 70 76
      web/src/api/workflowProcess.js
  61. 23 17
      web/src/components/chooseImg/index.vue
  62. 49 49
      web/src/components/customPic/index.vue
  63. 25 26
      web/src/components/upload/image.vue
  64. 34 34
      web/src/directive/auth.js
  65. 113 115
      web/src/main.js
  66. 37 37
      web/src/mixins/infoList.js
  67. 38 38
      web/src/permission.js
  68. 16 17
      web/src/router/index.js
  69. 12 14
      web/src/store/index.js
  70. 36 36
      web/src/store/module/dictionary.js
  71. 68 69
      web/src/store/module/router.js
  72. 70 71
      web/src/store/module/user.js
  73. 2 2
      web/src/utils/_import.js
  74. 12 12
      web/src/utils/asyncRouter.js
  75. 15 15
      web/src/utils/bus.js
  76. 21 21
      web/src/utils/date.js
  77. 5 5
      web/src/utils/dictionary.js
  78. 18 18
      web/src/utils/downloadImg.js
  79. 80 82
      web/src/utils/image.js
  80. 5 5
      web/src/utils/page.js
  81. 81 82
      web/src/utils/request.js
  82. 3 3
      web/src/utils/stringFun.js
  83. 41 35
      web/src/view/about/index.vue
  84. 35 39
      web/src/view/dashboard/component/musicPlayer.vue
  85. 75 75
      web/src/view/dashboard/component/todoList/Todo.vue
  86. 106 106
      web/src/view/dashboard/component/todoList/index.vue
  87. 74 74
      web/src/view/dashboard/index.vue
  88. 13 13
      web/src/view/error/index.vue
  89. 73 75
      web/src/view/example/breakpoint/breakpoint.vue
  90. 69 69
      web/src/view/example/customer/customer.vue
  91. 23 22
      web/src/view/example/excel/excel.vue
  92. 4 5
      web/src/view/example/index.vue
  93. 67 69
      web/src/view/example/simpleUploader/simpleUploader.vue
  94. 75 75
      web/src/view/example/upload/upload.vue
  95. 296 297
      web/src/view/iconList/index.vue
  96. 33 33
      web/src/view/init/init.vue
  97. 4 6
      web/src/view/layout/aside/asideComponent/asyncSubmenu.vue
  98. 13 15
      web/src/view/layout/aside/asideComponent/index.vue
  99. 2 4
      web/src/view/layout/aside/asideComponent/menuItem.vue
  100. 133 131
      web/src/view/layout/aside/historyComponent/history.vue

+ 2 - 3
server/api/v1/exa_customer.go

@@ -1,7 +1,6 @@
 package v1
 
 import (
-	"fmt"
 	"gin-vue-admin/global"
 	"gin-vue-admin/model"
 	"gin-vue-admin/model/request"
@@ -81,7 +80,7 @@ func UpdateExaCustomer(c *gin.Context) {
 	}
 	if err := service.UpdateExaCustomer(&customer); err != nil {
 		global.GVA_LOG.Error("更新失败!", zap.Any("err", err))
-		response.FailWithMessage("更新失败!", c)
+		response.FailWithMessage("更新失败", c)
 	} else {
 		response.OkWithMessage("更新成功", c)
 	}
@@ -129,7 +128,7 @@ func GetExaCustomerList(c *gin.Context) {
 	err, customerList, total := service.GetCustomerInfoList(getUserAuthorityId(c), pageInfo)
 	if err != nil {
 		global.GVA_LOG.Error("获取失败!", zap.Any("err", err))
-		response.FailWithMessage(fmt.Sprintf("获取失败:%v", err), c)
+		response.FailWithMessage("获取失败"+err.Error(), c)
 	} else {
 		response.OkWithDetailed(response.PageResult{
 			List:     customerList,

+ 2 - 2
server/api/v1/exa_excel.go

@@ -65,7 +65,7 @@ func ImportExcel(c *gin.Context) {
 func LoadExcel(c *gin.Context) {
 	menus, err := service.ParseExcel2InfoList()
 	if err != nil {
-		global.GVA_LOG.Error("加载数据失败", zap.Any("err", err))
+		global.GVA_LOG.Error("加载数据失败!", zap.Any("err", err))
 		response.FailWithMessage("加载数据失败", c)
 		return
 	}
@@ -90,7 +90,7 @@ func DownloadTemplate(c *gin.Context) {
 	filePath := global.GVA_CONFIG.Excel.Dir + fileName
 	ok, err := utils.PathExists(filePath)
 	if !ok || err != nil {
-		global.GVA_LOG.Error("文件不存在", zap.Any("err", err))
+		global.GVA_LOG.Error("文件不存在!", zap.Any("err", err))
 		response.FailWithMessage("文件不存在", c)
 		return
 	}

+ 0 - 1
server/api/v1/sys_auto_code.go

@@ -73,7 +73,6 @@ func CreateTemp(c *gin.Context) {
 			c.Writer.Header().Add("msg", url.QueryEscape(err.Error()))
 			_ = os.Remove("./ginvueadmin.zip")
 		}
-
 	} else {
 		c.Writer.Header().Add("Content-Disposition", fmt.Sprintf("attachment; filename=%s", "ginvueadmin.zip")) // fmt.Sprintf("attachment; filename=%s", filename)对下载的文件重命名
 		c.Writer.Header().Add("Content-Type", "application/json")

+ 1 - 1
server/api/v1/sys_captcha.go

@@ -18,7 +18,7 @@ var store = base64Captcha.DefaultMemStore
 // @Success 200 {string} string "{"success":true,"data":{},"msg":"验证码获取成功"}"
 // @Router /base/captcha [post]
 func Captcha(c *gin.Context) {
-	//字符,公式,验证码配置
+	// 字符,公式,验证码配置
 	// 生成默认数字的driver
 	driver := base64Captcha.NewDriverDigit(global.GVA_CONFIG.Captcha.ImgHeight, global.GVA_CONFIG.Captcha.ImgWidth, global.GVA_CONFIG.Captcha.KeyLong, 0.7, 80)
 	cp := base64Captcha.NewCaptcha(driver, store)

+ 5 - 9
server/api/v1/sys_initdb.go

@@ -18,18 +18,18 @@ import (
 // @Router /init/initdb [post]
 func InitDB(c *gin.Context) {
 	if global.GVA_DB != nil {
-		global.GVA_LOG.Error("非法访问")
+		global.GVA_LOG.Error("非法访问!")
 		response.FailWithMessage("非法访问", c)
 		return
 	}
 	var dbInfo request.InitDB
 	if err := c.ShouldBindJSON(&dbInfo); err != nil {
-		global.GVA_LOG.Error("参数校验不通过", zap.Any("err", err))
+		global.GVA_LOG.Error("参数校验不通过!", zap.Any("err", err))
 		response.FailWithMessage("参数校验不通过", c)
 		return
 	}
 	if err := service.InitDB(dbInfo); err != nil {
-		global.GVA_LOG.Error("自动创建数据库失败", zap.Any("err", err))
+		global.GVA_LOG.Error("自动创建数据库失败!", zap.Any("err", err))
 		response.FailWithMessage("自动创建数据库失败,请查看后台日志", c)
 		return
 	}
@@ -44,15 +44,11 @@ func InitDB(c *gin.Context) {
 func CheckDB(c *gin.Context) {
 	if global.GVA_DB != nil {
 		global.GVA_LOG.Info("数据库无需初始化")
-		response.OkWithDetailed(gin.H{
-			"needInit": false,
-		}, "数据库无需初始化", c)
+		response.OkWithDetailed(gin.H{"needInit": false}, "数据库无需初始化", c)
 		return
 	} else {
 		global.GVA_LOG.Info("前往初始化数据库")
-		response.OkWithDetailed(gin.H{
-			"needInit": true,
-		}, "前往初始化数据库", c)
+		response.OkWithDetailed(gin.H{"needInit": true}, "前往初始化数据库", c)
 		return
 	}
 }

+ 2 - 5
server/api/v1/sys_system.go

@@ -55,10 +55,9 @@ func ReloadSystem(c *gin.Context) {
 	if err != nil {
 		global.GVA_LOG.Error("重启系统失败!", zap.Any("err", err))
 		response.FailWithMessage("重启系统失败", c)
-		return
+	} else {
+		response.OkWithMessage("重启系统成功", c)
 	}
-	response.OkWithMessage("重启系统成功", c)
-	return
 }
 
 // @Tags System
@@ -71,9 +70,7 @@ func GetServerInfo(c *gin.Context) {
 	if server, err := service.GetServerInfo(); err != nil {
 		global.GVA_LOG.Error("获取失败!", zap.Any("err", err))
 		response.FailWithMessage("获取失败", c)
-		return
 	} else {
 		response.OkWithDetailed(gin.H{"server": server}, "获取成功", c)
 	}
-
 }

+ 12 - 12
server/api/v1/sys_user.go

@@ -32,7 +32,7 @@ func Login(c *gin.Context) {
 	if store.Verify(L.CaptchaId, L.Captcha, true) {
 		U := &model.SysUser{Username: L.Username, Password: L.Password}
 		if err, user := service.Login(U); err != nil {
-			global.GVA_LOG.Error("登陆失败! 用户名不存在或者密码错误", zap.Any("err", err))
+			global.GVA_LOG.Error("登陆失败! 用户名不存在或者密码错误!", zap.Any("err", err))
 			response.FailWithMessage("用户名不存在或者密码错误", c)
 		} else {
 			tokenNext(c, *user)
@@ -60,7 +60,7 @@ func tokenNext(c *gin.Context, user model.SysUser) {
 	}
 	token, err := j.CreateToken(claims)
 	if err != nil {
-		global.GVA_LOG.Error("获取token失败", zap.Any("err", err))
+		global.GVA_LOG.Error("获取token失败!", zap.Any("err", err))
 		response.FailWithMessage("获取token失败", c)
 		return
 	}
@@ -74,7 +74,7 @@ func tokenNext(c *gin.Context, user model.SysUser) {
 	}
 	if err, jwtStr := service.GetRedisJWT(user.Username); err == redis.Nil {
 		if err := service.SetRedisJWT(token, user.Username); err != nil {
-			global.GVA_LOG.Error("设置登录状态失败", zap.Any("err", err))
+			global.GVA_LOG.Error("设置登录状态失败!", zap.Any("err", err))
 			response.FailWithMessage("设置登录状态失败", c)
 			return
 		}
@@ -84,7 +84,7 @@ func tokenNext(c *gin.Context, user model.SysUser) {
 			ExpiresAt: claims.StandardClaims.ExpiresAt * 1000,
 		}, "登录成功", c)
 	} else if err != nil {
-		global.GVA_LOG.Error("设置登录状态失败", zap.Any("err", err))
+		global.GVA_LOG.Error("设置登录状态失败!", zap.Any("err", err))
 		response.FailWithMessage("设置登录状态失败", c)
 	} else {
 		var blackJWT model.JwtBlacklist
@@ -121,7 +121,7 @@ func Register(c *gin.Context) {
 	user := &model.SysUser{Username: R.Username, NickName: R.NickName, Password: R.Password, HeaderImg: R.HeaderImg, AuthorityId: R.AuthorityId}
 	err, userReturn := service.Register(*user)
 	if err != nil {
-		global.GVA_LOG.Error("注册失败", zap.Any("err", err))
+		global.GVA_LOG.Error("注册失败!", zap.Any("err", err))
 		response.FailWithDetailed(response.SysUserResponse{User: userReturn}, "注册失败", c)
 	} else {
 		response.OkWithDetailed(response.SysUserResponse{User: userReturn}, "注册成功", c)
@@ -144,7 +144,7 @@ func ChangePassword(c *gin.Context) {
 	}
 	U := &model.SysUser{Username: user.Username, Password: user.Password}
 	if err, _ := service.ChangePassword(U, user.NewPassword); err != nil {
-		global.GVA_LOG.Error("修改失败", zap.Any("err", err))
+		global.GVA_LOG.Error("修改失败!", zap.Any("err", err))
 		response.FailWithMessage("修改失败,原密码与当前账户不符", c)
 	} else {
 		response.OkWithMessage("修改成功", c)
@@ -167,7 +167,7 @@ func GetUserList(c *gin.Context) {
 		return
 	}
 	if err, list, total := service.GetUserInfoList(pageInfo); err != nil {
-		global.GVA_LOG.Error("获取失败", zap.Any("err", err))
+		global.GVA_LOG.Error("获取失败!", zap.Any("err", err))
 		response.FailWithMessage("获取失败", c)
 	} else {
 		response.OkWithDetailed(response.PageResult{
@@ -195,7 +195,7 @@ func SetUserAuthority(c *gin.Context) {
 		return
 	}
 	if err := service.SetUserAuthority(sua.UUID, sua.AuthorityId); err != nil {
-		global.GVA_LOG.Error("修改失败", zap.Any("err", err))
+		global.GVA_LOG.Error("修改失败!", zap.Any("err", err))
 		response.FailWithMessage("修改失败", c)
 	} else {
 		response.OkWithMessage("修改成功", c)
@@ -246,7 +246,7 @@ func SetUserInfo(c *gin.Context) {
 		return
 	}
 	if err, ReqUser := service.SetUserInfo(user); err != nil {
-		global.GVA_LOG.Error("设置失败", zap.Any("err", err))
+		global.GVA_LOG.Error("设置失败!", zap.Any("err", err))
 		response.FailWithMessage("设置失败", c)
 	} else {
 		response.OkWithDetailed(gin.H{"userInfo": ReqUser}, "设置成功", c)
@@ -256,7 +256,7 @@ func SetUserInfo(c *gin.Context) {
 // 从Gin的Context中获取从jwt解析出来的用户ID
 func getUserID(c *gin.Context) uint {
 	if claims, exists := c.Get("claims"); !exists {
-		global.GVA_LOG.Error("从Gin的Context中获取从jwt解析出来的用户ID失败, 请检查路由是否使用jwt中间件")
+		global.GVA_LOG.Error("从Gin的Context中获取从jwt解析出来的用户ID失败, 请检查路由是否使用jwt中间件!")
 		return 0
 	} else {
 		waitUse := claims.(*request.CustomClaims)
@@ -267,7 +267,7 @@ func getUserID(c *gin.Context) uint {
 // 从Gin的Context中获取从jwt解析出来的用户UUID
 func getUserUuid(c *gin.Context) string {
 	if claims, exists := c.Get("claims"); !exists {
-		global.GVA_LOG.Error("从Gin的Context中获取从jwt解析出来的用户UUID失败, 请检查路由是否使用jwt中间件")
+		global.GVA_LOG.Error("从Gin的Context中获取从jwt解析出来的用户UUID失败, 请检查路由是否使用jwt中间件!")
 		return ""
 	} else {
 		waitUse := claims.(*request.CustomClaims)
@@ -278,7 +278,7 @@ func getUserUuid(c *gin.Context) string {
 // 从Gin的Context中获取从jwt解析出来的用户角色id
 func getUserAuthorityId(c *gin.Context) string {
 	if claims, exists := c.Get("claims"); !exists {
-		global.GVA_LOG.Error("从Gin的Context中获取从jwt解析出来的用户UUID失败, 请检查路由是否使用jwt中间件")
+		global.GVA_LOG.Error("从Gin的Context中获取从jwt解析出来的用户UUID失败, 请检查路由是否使用jwt中间件!")
 		return ""
 	} else {
 		waitUse := claims.(*request.CustomClaims)

+ 0 - 1
server/initialize/gorm.go

@@ -59,7 +59,6 @@ func MysqlTables(db *gorm.DB) {
 	global.GVA_LOG.Info("register table success")
 }
 
-//
 //@author: SliverHorn
 //@function: GormMysql
 //@description: 初始化Mysql数据库

+ 1 - 1
server/resource/template/server/api.go.tpl

@@ -117,7 +117,7 @@ func Get{{.StructName}}List(c *gin.Context) {
 	var pageInfo request.{{.StructName}}Search
 	_ = c.ShouldBindQuery(&pageInfo)
 	if err, list, total := service.Get{{.StructName}}InfoList(pageInfo); err != nil {
-	    global.GVA_LOG.Error("获取失败", zap.Any("err", err))
+	    global.GVA_LOG.Error("获取失败!", zap.Any("err", err))
         response.FailWithMessage("获取失败", c)
     } else {
         response.OkWithDetailed(response.PageResult{

+ 6 - 6
server/router/exa_customer.go

@@ -7,12 +7,12 @@ import (
 )
 
 func InitCustomerRouter(Router *gin.RouterGroup) {
-	ApiRouter := Router.Group("customer").Use(middleware.OperationRecord())
+	CustomerRouter := Router.Group("customer").Use(middleware.OperationRecord())
 	{
-		ApiRouter.POST("customer", v1.CreateExaCustomer)     // 创建客户
-		ApiRouter.PUT("customer", v1.UpdateExaCustomer)      // 更新客户
-		ApiRouter.DELETE("customer", v1.DeleteExaCustomer)   // 删除客户
-		ApiRouter.GET("customer", v1.GetExaCustomer)         // 获取单一客户信息
-		ApiRouter.GET("customerList", v1.GetExaCustomerList) // 获取客户列表
+		CustomerRouter.POST("customer", v1.CreateExaCustomer)     // 创建客户
+		CustomerRouter.PUT("customer", v1.UpdateExaCustomer)      // 更新客户
+		CustomerRouter.DELETE("customer", v1.DeleteExaCustomer)   // 删除客户
+		CustomerRouter.GET("customer", v1.GetExaCustomer)         // 获取单一客户信息
+		CustomerRouter.GET("customerList", v1.GetExaCustomerList) // 获取客户列表
 	}
 }

+ 5 - 5
server/router/exa_excel.go

@@ -6,11 +6,11 @@ import (
 )
 
 func InitExcelRouter(Router *gin.RouterGroup) {
-	FileUploadAndDownloadGroup := Router.Group("excel")
+	ExcelRouter := Router.Group("excel")
 	{
-		FileUploadAndDownloadGroup.POST("/importExcel", v1.ImportExcel)          // 导入Excel
-		FileUploadAndDownloadGroup.GET("/loadExcel", v1.LoadExcel)               // 加载Excel数据
-		FileUploadAndDownloadGroup.POST("/exportExcel", v1.ExportExcel)          // 导出Excel
-		FileUploadAndDownloadGroup.GET("/downloadTemplate", v1.DownloadTemplate) // 下载模板文件
+		ExcelRouter.POST("/importExcel", v1.ImportExcel)          // 导入Excel
+		ExcelRouter.GET("/loadExcel", v1.LoadExcel)               // 加载Excel数据
+		ExcelRouter.POST("/exportExcel", v1.ExportExcel)          // 导出Excel
+		ExcelRouter.GET("/downloadTemplate", v1.DownloadTemplate) // 下载模板文件
 	}
 }

+ 8 - 8
server/router/exa_file_upload_and_download.go

@@ -6,14 +6,14 @@ import (
 )
 
 func InitFileUploadAndDownloadRouter(Router *gin.RouterGroup) {
-	FileUploadAndDownloadGroup := Router.Group("fileUploadAndDownload")
+	FileUploadAndDownloadRouter := Router.Group("fileUploadAndDownload")
 	{
-		FileUploadAndDownloadGroup.POST("/upload", v1.UploadFile)                                 // 上传文件
-		FileUploadAndDownloadGroup.POST("/getFileList", v1.GetFileList)                           // 获取上传文件列表
-		FileUploadAndDownloadGroup.POST("/deleteFile", v1.DeleteFile)                             // 删除指定文件
-		FileUploadAndDownloadGroup.POST("/breakpointContinue", v1.BreakpointContinue)             // 断点续传
-		FileUploadAndDownloadGroup.GET("/findFile", v1.FindFile)                                  // 查询当前文件成功的切片
-		FileUploadAndDownloadGroup.POST("/breakpointContinueFinish", v1.BreakpointContinueFinish) // 查询当前文件成功的切片
-		FileUploadAndDownloadGroup.POST("/removeChunk", v1.RemoveChunk)                           // 查询当前文件成功的切片
+		FileUploadAndDownloadRouter.POST("/upload", v1.UploadFile)                                 // 上传文件
+		FileUploadAndDownloadRouter.POST("/getFileList", v1.GetFileList)                           // 获取上传文件列表
+		FileUploadAndDownloadRouter.POST("/deleteFile", v1.DeleteFile)                             // 删除指定文件
+		FileUploadAndDownloadRouter.POST("/breakpointContinue", v1.BreakpointContinue)             // 断点续传
+		FileUploadAndDownloadRouter.GET("/findFile", v1.FindFile)                                  // 查询当前文件成功的切片
+		FileUploadAndDownloadRouter.POST("/breakpointContinueFinish", v1.BreakpointContinueFinish) // 查询当前文件成功的切片
+		FileUploadAndDownloadRouter.POST("/removeChunk", v1.RemoveChunk)                           // 查询当前文件成功的切片
 	}
 }

+ 4 - 4
server/router/exa_simple_uploader.go

@@ -6,10 +6,10 @@ import (
 )
 
 func InitSimpleUploaderRouter(Router *gin.RouterGroup) {
-	ApiRouter := Router.Group("simpleUploader")
+	SimpleUploaderRouter := Router.Group("simpleUploader")
 	{
-		ApiRouter.POST("upload", v1.SimpleUploaderUpload) // 上传功能
-		ApiRouter.GET("checkFileMd5", v1.CheckFileMd5)    // 文件完整度验证
-		ApiRouter.GET("mergeFileMd5", v1.MergeFileMd5)    // 合并文件
+		SimpleUploaderRouter.POST("upload", v1.SimpleUploaderUpload) // 上传功能
+		SimpleUploaderRouter.GET("checkFileMd5", v1.CheckFileMd5)    // 文件完整度验证
+		SimpleUploaderRouter.GET("mergeFileMd5", v1.MergeFileMd5)    // 合并文件
 	}
 }

+ 2 - 2
server/router/sys_email.go

@@ -7,8 +7,8 @@ import (
 )
 
 func InitEmailRouter(Router *gin.RouterGroup) {
-	UserRouter := Router.Group("email").Use(middleware.OperationRecord())
+	EmailRouter := Router.Group("email").Use(middleware.OperationRecord())
 	{
-		UserRouter.POST("emailTest", v1.EmailTest) // 发送测试邮件
+		EmailRouter.POST("emailTest", v1.EmailTest) // 发送测试邮件
 	}
 }

+ 3 - 3
server/router/sys_initdb.go

@@ -6,9 +6,9 @@ import (
 )
 
 func InitInitRouter(Router *gin.RouterGroup) {
-	ApiRouter := Router.Group("init")
+	InitRouter := Router.Group("init")
 	{
-		ApiRouter.POST("initdb", v1.InitDB)   // 创建Api
-		ApiRouter.POST("checkdb", v1.CheckDB) // 创建Api
+		InitRouter.POST("initdb", v1.InitDB)   // 创建Api
+		InitRouter.POST("checkdb", v1.CheckDB) // 创建Api
 	}
 }

+ 2 - 2
server/router/sys_jwt.go

@@ -7,8 +7,8 @@ import (
 )
 
 func InitJwtRouter(Router *gin.RouterGroup) {
-	ApiRouter := Router.Group("jwt").Use(middleware.OperationRecord())
+	JwtRouter := Router.Group("jwt").Use(middleware.OperationRecord())
 	{
-		ApiRouter.POST("jsonInBlacklist", v1.JsonInBlacklist) // jwt加入黑名单
+		JwtRouter.POST("jsonInBlacklist", v1.JsonInBlacklist) // jwt加入黑名单
 	}
 }

+ 2 - 2
server/router/sys_user.go

@@ -9,8 +9,8 @@ import (
 func InitUserRouter(Router *gin.RouterGroup) {
 	UserRouter := Router.Group("user").Use(middleware.OperationRecord())
 	{
-		UserRouter.POST("register", v1.Register)
-		UserRouter.POST("changePassword", v1.ChangePassword)     // 修改密码
+		UserRouter.POST("register", v1.Register)                 // 用户注册账号
+		UserRouter.POST("changePassword", v1.ChangePassword)     // 用户修改密码
 		UserRouter.POST("getUserList", v1.GetUserList)           // 分页获取用户列表
 		UserRouter.POST("setUserAuthority", v1.SetUserAuthority) // 设置用户权限
 		UserRouter.DELETE("deleteUser", v1.DeleteUser)           // 删除用户

+ 7 - 7
server/service/exa_simple_uploader.go

@@ -42,22 +42,22 @@ func CheckFileMd5(md5 string) (err error, uploads []model.ExaSimpleUploader, isD
 func MergeFileMd5(md5 string, fileName string) (err error) {
 	finishDir := "./finish/"
 	dir := "./chunk/" + md5
-	//如果文件上传成功 不做后续操作 通知成功即可
+	// 如果文件上传成功 不做后续操作 通知成功即可
 	if !errors.Is(global.GVA_DB.First(&model.ExaSimpleUploader{}, "identifier = ? AND is_done = ?", md5, true).Error, gorm.ErrRecordNotFound) {
 		return nil
 	}
 
-	//打开切片文件夹
+	// 打开切片文件夹
 	rd, err := ioutil.ReadDir(dir)
 	_ = os.MkdirAll(finishDir, os.ModePerm)
-	//创建目标文件
+	// 创建目标文件
 	fd, err := os.OpenFile(finishDir+fileName, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0644)
 	if err != nil {
 		return
 	}
-	//关闭文件
+	// 关闭文件
 	defer fd.Close()
-	//将切片文件按照顺序写入
+	// 将切片文件按照顺序写入
 	for k := range rd {
 		content, _ := ioutil.ReadFile(dir + "/" + fileName + strconv.Itoa(k+1))
 		_, err = fd.Write(content)
@@ -70,7 +70,7 @@ func MergeFileMd5(md5 string, fileName string) (err error) {
 		return err
 	}
 	err = global.GVA_DB.Transaction(func(tx *gorm.DB) error {
-		//删除切片信息
+		// 删除切片信息
 		if err = tx.Delete(&model.ExaSimpleUploader{}, "identifier = ? AND is_done = ?", md5, false).Error; err != nil {
 			fmt.Println(err)
 			return err
@@ -89,6 +89,6 @@ func MergeFileMd5(md5 string, fileName string) (err error) {
 		return nil
 	})
 
-	err = os.RemoveAll(dir) //清除切片
+	err = os.RemoveAll(dir) // 清除切片
 	return err
 }

+ 2 - 2
server/service/jwt_black_list.go

@@ -44,8 +44,8 @@ func GetRedisJWT(userName string) (err error, redisJWT string) {
 //@author: [piexlmax](https://github.com/piexlmax)
 //@function: SetRedisJWT
 //@description: jwt存入redis并设置过期时间
-//@param: userName string
-//@return: err error, redisJWT string
+//@param: jwt string, userName string
+//@return: err error
 
 func SetRedisJWT(jwt string, userName string) (err error) {
 	// 此处过期时间等于jwt过期时间

+ 2 - 2
server/service/sys_authority.go

@@ -59,7 +59,7 @@ func CopyAuthority(copyInfo response.SysAuthorityCopyResponse) (err error, autho
 //@function: UpdateAuthority
 //@description: 更改一个角色
 //@param: auth model.SysAuthority
-//@return:err error, authority model.SysAuthority
+//@return: err error, authority model.SysAuthority
 
 func UpdateAuthority(auth model.SysAuthority) (err error, authority model.SysAuthority) {
 	err = global.GVA_DB.Where("authority_id = ?", auth.AuthorityId).First(&model.SysAuthority{}).Updates(&auth).Error
@@ -126,7 +126,7 @@ func GetAuthorityInfo(auth model.SysAuthority) (err error, sa model.SysAuthority
 //@function: SetDataAuthority
 //@description: 设置角色资源权限
 //@param: auth model.SysAuthority
-//@return:error
+//@return: error
 
 func SetDataAuthority(auth model.SysAuthority) error {
 	var s model.SysAuthority

+ 7 - 11
server/service/sys_auto_code.go

@@ -96,7 +96,7 @@ func PreviewTemp(autoCode model.AutoCodeStruct) (map[string]string, error) {
 //@function: CreateTemp
 //@description: 创建代码
 //@param: model.AutoCodeStruct
-//@return: error
+//@return: err error
 
 func CreateTemp(autoCode model.AutoCodeStruct) (err error) {
 	dataList, fileList, needMkdir, err := getNeedList(&autoCode)
@@ -186,9 +186,8 @@ func GetAllTplFile(pathName string, fileList []string) ([]string, error) {
 //@author: [piexlmax](https://github.com/piexlmax)
 //@function: GetTables
 //@description: 获取数据库的所有表名
-//@param: pathName string
-//@param: fileList []string
-//@return: []string, error
+//@param: dbName string
+//@return: err error, TableNames []request.TableReq
 
 func GetTables(dbName string) (err error, TableNames []request.TableReq) {
 	err = global.GVA_DB.Raw("select table_name as table_name from information_schema.tables where table_schema = ?", dbName).Scan(&TableNames).Error
@@ -198,9 +197,7 @@ func GetTables(dbName string) (err error, TableNames []request.TableReq) {
 //@author: [piexlmax](https://github.com/piexlmax)
 //@function: GetDB
 //@description: 获取数据库的所有数据库名
-//@param: pathName string
-//@param: fileList []string
-//@return: []string, error
+//@return: err error, DBNames []request.DBReq
 
 func GetDB() (err error, DBNames []request.DBReq) {
 	err = global.GVA_DB.Raw("SELECT SCHEMA_NAME AS `database` FROM INFORMATION_SCHEMA.SCHEMATA;").Scan(&DBNames).Error
@@ -210,9 +207,8 @@ func GetDB() (err error, DBNames []request.DBReq) {
 //@author: [piexlmax](https://github.com/piexlmax)
 //@function: GetDB
 //@description: 获取指定数据库和指定数据表的所有字段名,类型值等
-//@param: pathName string
-//@param: fileList []string
-//@return: []string, error
+//@param: tableName string, dbName string
+//@return: err error, Columns []request.ColumnReq
 
 func GetColumn(tableName string, dbName string) (err error, Columns []request.ColumnReq) {
 	err = global.GVA_DB.Raw("SELECT COLUMN_NAME column_name,DATA_TYPE data_type,CASE DATA_TYPE WHEN 'longtext' THEN c.CHARACTER_MAXIMUM_LENGTH WHEN 'varchar' THEN c.CHARACTER_MAXIMUM_LENGTH WHEN 'double' THEN CONCAT_WS( ',', c.NUMERIC_PRECISION, c.NUMERIC_SCALE ) WHEN 'decimal' THEN CONCAT_WS( ',', c.NUMERIC_PRECISION, c.NUMERIC_SCALE ) WHEN 'int' THEN c.NUMERIC_PRECISION WHEN 'bigint' THEN c.NUMERIC_PRECISION ELSE '' END AS data_type_long,COLUMN_COMMENT column_comment FROM INFORMATION_SCHEMA.COLUMNS c WHERE table_name = ? AND table_schema = ?", tableName, dbName).Scan(&Columns).Error
@@ -269,7 +265,7 @@ func addAutoMoveFile(data *tplData) {
 //@function: CreateApi
 //@description: 自动创建api数据,
 //@param: a *model.AutoCodeStruct
-//@return: error
+//@return: err error
 
 func AutoCreateApi(a *model.AutoCodeStruct) (err error) {
 	var apiList = []model.SysApi{

+ 1 - 1
server/service/sys_base_menu.go

@@ -34,7 +34,7 @@ func DeleteBaseMenu(id float64) (err error) {
 //@function: UpdateBaseMenu
 //@description: 更新路由
 //@param: menu model.SysBaseMenu
-//@return:err error
+//@return: err error
 
 func UpdateBaseMenu(menu model.SysBaseMenu) (err error) {
 	var oldMenu model.SysBaseMenu

+ 1 - 1
server/service/sys_dictionary_detail.go

@@ -54,7 +54,7 @@ func GetSysDictionaryDetail(id uint) (err error, sysDictionaryDetail model.SysDi
 //@function: GetSysDictionaryDetailInfoList
 //@description: 分页获取字典详情列表
 //@param: info request.SysDictionaryDetailSearch
-//@return: err error
+//@return: err error, list interface{}, total int64
 
 func GetSysDictionaryDetailInfoList(info request.SysDictionaryDetailSearch) (err error, list interface{}, total int64) {
 	limit := info.PageSize

+ 4 - 4
server/service/sys_initdb.go

@@ -18,7 +18,7 @@ import (
 //@author: [songzhibin97](https://github.com/songzhibin97)
 //@function: writeConfig
 //@description: 回写配置
-//@param:
+//@param: viper *viper.Viper, mysql config.Mysql
 //@return: error
 
 func writeConfig(viper *viper.Viper, mysql config.Mysql) error {
@@ -67,8 +67,8 @@ func initDB(InitDBFunctions ...model.InitDBFunc) (err error) {
 //@author: [songzhibin97](https://github.com/songzhibin97)
 //@function: InitDB
 //@description: 创建数据库并初始化
-//@param: authorityId string
-//@return: err error, treeMap map[string][]model.SysMenu
+//@param: conf request.InitDB
+//@return: error
 
 func InitDB(conf request.InitDB) error {
 	BaseMysql := config.Mysql{
@@ -118,7 +118,7 @@ func InitDB(conf request.InitDB) error {
 		SkipInitializeWithVersion: false,   // 根据版本自动配置
 	}
 	if db, err := gorm.Open(mysql.New(mysqlConfig), &gorm.Config{DisableForeignKeyConstraintWhenMigrating: true}); err != nil {
-		//global.GVA_LOG.Error("MySQL启动异常", zap.Any("err", err))
+		//global.GVA_LOG.Error("MySQL启动异常!", zap.Any("err", err))
 		//os.Exit(0)
 		//return nil
 		_ = writeConfig(global.GVA_VP, BaseMysql)

+ 1 - 1
server/service/sys_menu.go

@@ -87,7 +87,7 @@ func getBaseChildrenList(menu *model.SysBaseMenu, treeMap map[string][]model.Sys
 //@function: AddBaseMenu
 //@description: 添加基础路由
 //@param: menu model.SysBaseMenu
-//@return: err error
+//@return: error
 
 func AddBaseMenu(menu model.SysBaseMenu) error {
 	if !errors.Is(global.GVA_DB.Where("name = ?", menu.Name).First(&model.SysBaseMenu{}).Error, gorm.ErrRecordNotFound) {

+ 3 - 3
server/service/sys_system.go

@@ -42,15 +42,15 @@ func GetServerInfo() (server *utils.Server, err error) {
 	var s utils.Server
 	s.Os = utils.InitOS()
 	if s.Cpu, err = utils.InitCPU(); err != nil {
-		global.GVA_LOG.Error("func utils.InitCPU() Failed!", zap.String("err", err.Error()))
+		global.GVA_LOG.Error("func utils.InitCPU() Failed", zap.String("err", err.Error()))
 		return &s, err
 	}
 	if s.Rrm, err = utils.InitRAM(); err != nil {
-		global.GVA_LOG.Error("func utils.InitRAM() Failed!", zap.String("err", err.Error()))
+		global.GVA_LOG.Error("func utils.InitRAM() Failed", zap.String("err", err.Error()))
 		return &s, err
 	}
 	if s.Disk, err = utils.InitDisk(); err != nil {
-		global.GVA_LOG.Error("func utils.InitDisk() Failed!", zap.String("err", err.Error()))
+		global.GVA_LOG.Error("func utils.InitDisk() Failed", zap.String("err", err.Error()))
 		return &s, err
 	}
 

+ 2 - 3
server/utils/breakpoint_continue.go

@@ -40,9 +40,9 @@ func BreakPointContinue(content []byte, fileName string, contentNumber int, cont
 func CheckMd5(content []byte, chunkMd5 string) (CanUpload bool) {
 	fileMd5 := MD5V(content)
 	if fileMd5 == chunkMd5 {
-		return true // "可以继续上传"
+		return true // 可以继续上传
 	} else {
-		return false // "切片不完整,废弃"
+		return false // 切片不完整,废弃
 	}
 }
 
@@ -92,7 +92,6 @@ func MakeFile(fileName string, FileMd5 string) (error, string) {
 			return err, finishDir + fileName
 		}
 	}
-
 	return nil, finishDir + fileName
 }
 

+ 2 - 2
server/utils/db_automation.go

@@ -11,8 +11,8 @@ import (
 //@author: [songzhibin97](https://github.com/songzhibin97)
 //@function: ClearTable
 //@description: 清理数据库表数据
-//@param: target db(数据库对象) *gorm.DB,tableName(表名) string,compareField(比较字段) string , interval string  间隔
-//@return: err
+//@param: db(数据库对象) *gorm.DB, tableName(表名) string, compareField(比较字段) string, interval(间隔) string
+//@return: error
 
 func ClearTable(db *gorm.DB, tableName string, compareField string, interval string) error {
 	if db == nil {

+ 1 - 1
server/utils/file_operations.go

@@ -46,7 +46,7 @@ Redirect:
 //@function: TrimSpace
 //@description: 去除结构体空格
 //@param: target interface (target: 目标结构体,传入必须是指针类型)
-//@return: err error
+//@return: null
 
 func TrimSpace(target interface{}) {
 	t := reflect.TypeOf(target)

+ 1 - 1
server/utils/injectionCode.go

@@ -13,7 +13,7 @@ import (
 //@function: AutoInjectionCode
 //@description: 向文件中固定注释位置写入代码
 //@param: filepath string, funcName string, codeData string
-//@return: err error
+//@return: error
 
 func AutoInjectionCode(filepath string, funcName string, codeData string) error {
 	startComment := "Code generated by gin-vue-admin Begin; DO NOT EDIT."

+ 1 - 1
server/utils/upload/aliyun_oss.go

@@ -26,7 +26,7 @@ func (*AliyunOSS) UploadFile(file *multipart.FileHeader) (string, string, error)
 		return "", "", errors.New("function file.Open() Failed, err:" + openError.Error())
 	}
 
-	//上传阿里云路径 文件名格式 自己可以改 建议保证唯一性
+	// 上传阿里云路径 文件名格式 自己可以改 建议保证唯一性
 	yunFileTmpPath := filepath.Join("uploads", time.Now().Format("2006-01-02")) + "/" + file.Filename
 
 	// 上传文件流。

+ 1 - 2
server/utils/upload/qiniu.go

@@ -71,8 +71,7 @@ func (*Qiniu) DeleteFile(key string) error {
 //@object: *Qiniu
 //@function: qiniuConfig
 //@description: 根据配置文件进行返回七牛云的配置
-//@param: key string
-//@return: error
+//@return: *storage.Config
 
 func qiniuConfig() *storage.Config {
 	cfg := storage.Config{

+ 1 - 2
server/utils/validator.go

@@ -31,8 +31,7 @@ func RegisterRule(key string, rule Rules) (err error) {
 //@author: [piexlmax](https://github.com/piexlmax)
 //@function: NotEmpty
 //@description: 非空 不能为其对应类型的0值
-//@param: key string, rule Rules
-//@return: err error
+//@return: string
 
 func NotEmpty() string {
 	return "notEmpty"

+ 1 - 1
server/utils/zipfiles.go

@@ -10,7 +10,7 @@ import (
 //@author: [piexlmax](https://github.com/piexlmax)
 //@function: ZipFiles
 //@description: 压缩文件
-//@param: filename string, files []string, oldform, newform string
+//@param: filename string, files []string, oldForm, newForm string
 //@return: error
 
 func ZipFiles(filename string, files []string, oldForm, newForm string) error {

+ 4 - 0
web/.eslintignore

@@ -0,0 +1,4 @@
+build/*.js
+src/assets
+public
+dist

+ 269 - 0
web/.eslintrc.js

@@ -0,0 +1,269 @@
+//@author: [bstdn](https://github.com/bstdn)
+//@description: ESlint 语法检测
+module.exports = {
+  root: true,
+  parserOptions: {
+    parser: 'babel-eslint',
+    sourceType: 'module'
+  },
+  env: {
+    browser: true,
+    node: true,
+    es6: true
+  },
+  extends: ['plugin:vue/recommended', 'eslint:recommended'],
+
+  // add your custom rules here
+  // it is base on https://github.com/vuejs/eslint-config-vue
+  rules: {
+    'vue/max-attributes-per-line': [
+      2,
+      {
+        singleline: 10,
+        multiline: {
+          max: 1,
+          allowFirstLine: false
+        }
+      }
+    ],
+    'vue/singleline-html-element-content-newline': 'off',
+    'vue/multiline-html-element-content-newline': 'off',
+    'vue/name-property-casing': ['error', 'PascalCase'],
+    'vue/no-v-html': 'off',
+    'accessor-pairs': 2,
+    'arrow-spacing': [
+      2,
+      {
+        before: true,
+        after: true
+      }
+    ],
+    'block-spacing': [2, 'always'],
+    'brace-style': [
+      2,
+      '1tbs',
+      {
+        allowSingleLine: true
+      }
+    ],
+    camelcase: [
+      0,
+      {
+        properties: 'always'
+      }
+    ],
+    'comma-dangle': [2, 'never'],
+    'comma-spacing': [
+      2,
+      {
+        before: false,
+        after: true
+      }
+    ],
+    'comma-style': [2, 'last'],
+    'constructor-super': 2,
+    curly: [2, 'multi-line'],
+    'dot-location': [2, 'property'],
+    'eol-last': 2,
+    eqeqeq: ['error', 'always', { null: 'ignore' }],
+    'generator-star-spacing': [
+      2,
+      {
+        before: true,
+        after: true
+      }
+    ],
+    'handle-callback-err': [2, '^(err|error)$'],
+    indent: [
+      2,
+      2,
+      {
+        SwitchCase: 1
+      }
+    ],
+    'jsx-quotes': [2, 'prefer-single'],
+    'key-spacing': [
+      2,
+      {
+        beforeColon: false,
+        afterColon: true
+      }
+    ],
+    'keyword-spacing': [
+      2,
+      {
+        before: true,
+        after: true
+      }
+    ],
+    'new-cap': [
+      2,
+      {
+        newIsCap: true,
+        capIsNew: false
+      }
+    ],
+    'new-parens': 2,
+    'no-array-constructor': 2,
+    'no-caller': 2,
+    'no-console': 'off',
+    'no-class-assign': 2,
+    'no-cond-assign': 2,
+    'no-const-assign': 2,
+    'no-control-regex': 0,
+    'no-delete-var': 2,
+    'no-dupe-args': 2,
+    'no-dupe-class-members': 2,
+    'no-dupe-keys': 2,
+    'no-duplicate-case': 2,
+    'no-empty-character-class': 2,
+    'no-empty-pattern': 2,
+    'no-eval': 2,
+    'no-ex-assign': 2,
+    'no-extend-native': 2,
+    'no-extra-bind': 2,
+    'no-extra-boolean-cast': 2,
+    'no-extra-parens': [2, 'functions'],
+    'no-fallthrough': 2,
+    'no-floating-decimal': 2,
+    'no-func-assign': 2,
+    'no-implied-eval': 2,
+    'no-inner-declarations': [2, 'functions'],
+    'no-invalid-regexp': 2,
+    'no-irregular-whitespace': 2,
+    'no-iterator': 2,
+    'no-label-var': 2,
+    'no-labels': [
+      2,
+      {
+        allowLoop: false,
+        allowSwitch: false
+      }
+    ],
+    'no-lone-blocks': 2,
+    'no-mixed-spaces-and-tabs': 2,
+    'no-multi-spaces': 2,
+    'no-multi-str': 2,
+    'no-multiple-empty-lines': [
+      2,
+      {
+        max: 1
+      }
+    ],
+    'no-native-reassign': 2,
+    'no-negated-in-lhs': 2,
+    'no-new-object': 2,
+    'no-new-require': 2,
+    'no-new-symbol': 2,
+    'no-new-wrappers': 2,
+    'no-obj-calls': 2,
+    'no-octal': 2,
+    'no-octal-escape': 2,
+    'no-path-concat': 2,
+    'no-proto': 2,
+    'no-redeclare': 2,
+    'no-regex-spaces': 2,
+    'no-return-assign': [2, 'except-parens'],
+    'no-self-assign': 2,
+    'no-self-compare': 2,
+    'no-sequences': 2,
+    'no-shadow-restricted-names': 2,
+    'no-spaced-func': 2,
+    'no-sparse-arrays': 2,
+    'no-this-before-super': 2,
+    'no-throw-literal': 2,
+    'no-trailing-spaces': 2,
+    'no-undef': 2,
+    'no-undef-init': 2,
+    'no-unexpected-multiline': 2,
+    'no-unmodified-loop-condition': 2,
+    'no-unneeded-ternary': [
+      2,
+      {
+        defaultAssignment: false
+      }
+    ],
+    'no-unreachable': 2,
+    'no-unsafe-finally': 2,
+    'no-unused-vars': [
+      2,
+      {
+        vars: 'all',
+        args: 'none'
+      }
+    ],
+    'no-useless-call': 2,
+    'no-useless-computed-key': 2,
+    'no-useless-constructor': 2,
+    'no-useless-escape': 0,
+    'no-whitespace-before-property': 2,
+    'no-with': 2,
+    'one-var': [
+      2,
+      {
+        initialized: 'never'
+      }
+    ],
+    'operator-linebreak': [
+      2,
+      'after',
+      {
+        overrides: {
+          '?': 'before',
+          ':': 'before'
+        }
+      }
+    ],
+    'padded-blocks': [2, 'never'],
+    quotes: [
+      2,
+      'single',
+      {
+        avoidEscape: true,
+        allowTemplateLiterals: true
+      }
+    ],
+    semi: [2, 'never'],
+    'semi-spacing': [
+      2,
+      {
+        before: false,
+        after: true
+      }
+    ],
+    'space-before-blocks': [2, 'always'],
+    'space-before-function-paren': [2, 'never'],
+    'space-in-parens': [2, 'never'],
+    'space-infix-ops': 2,
+    'space-unary-ops': [
+      2,
+      {
+        words: true,
+        nonwords: false
+      }
+    ],
+    'spaced-comment': [
+      2,
+      'always',
+      {
+        markers: ['global', 'globals', 'eslint', 'eslint-disable', '*package', '!', ',']
+      }
+    ],
+    'template-curly-spacing': [2, 'never'],
+    'use-isnan': 2,
+    'valid-typeof': 2,
+    'wrap-iife': [2, 'any'],
+    'yield-star-spacing': [2, 'both'],
+    yoda: [2, 'never'],
+    'prefer-const': 2,
+    'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
+    'object-curly-spacing': [
+      2,
+      'always',
+      {
+        objectsInObjects: false
+      }
+    ],
+    'array-bracket-spacing': [2, 'never']
+  }
+}

+ 4 - 4
web/babel.config.js

@@ -2,12 +2,12 @@ module.exports = {
   presets: [
     '@vue/cli-plugin-babel/preset'
   ],
-  "plugins": [
+  'plugins': [
     [
-      "component",
+      'component',
       {
-        "libraryName": "element-ui",
-        "styleLibraryName": "theme-chalk"
+        'libraryName': 'element-ui',
+        'styleLibraryName': 'theme-chalk'
       }
     ]
   ]

+ 14 - 16
web/build.config.js

@@ -1,19 +1,17 @@
 'use strict'
 
 module.exports = {
-    title: 'GIN-VUE-ADMIN1',
-    vueClientPort: 8080,
-    goServerPort: 8888,
-    baseCdnUrl: '//cdn.staticfile.org',
-    cdns: [
-        /**
-         * 如果设置path属性, { name: 'vue', scope: 'Vue', path: '/vue/2.6.9/vue.min.js' } 即编译出来以[baseCdnUrl][path]
-         * 否则自动拼写 [baseCdnUrl]/[name]/[version]/[name].min.js
-         * */ 
-        { name: 'vue', scope: 'Vue' },
-        { name: 'vue-router', scope: 'VueRouter' },
-        { name: 'vuex', scope: 'Vuex' },
-        { name: 'axios', scope: 'axios' },
-        { name: 'element-ui', scope: 'ELEMENT',  path: '/element-ui/2.12.0/index.js'},
-    ]
-};
+  title: 'GIN-VUE-ADMIN',
+  baseCdnUrl: '//cdn.staticfile.org',
+  cdns: [
+    /**
+     * 如果设置path属性, { name: 'vue', scope: 'Vue', path: '/vue/2.6.9/vue.min.js' } 即编译出来以[baseCdnUrl][path]
+     * 否则自动拼写 [baseCdnUrl]/[name]/[version]/[name].min.js
+     * */
+    { name: 'vue', scope: 'Vue' },
+    { name: 'vue-router', scope: 'VueRouter' },
+    { name: 'vuex', scope: 'Vuex' },
+    { name: 'axios', scope: 'axios' },
+    { name: 'element-ui', scope: 'ELEMENT', path: '/element-ui/2.12.0/index.js' }
+  ]
+}

+ 12 - 12
web/openDocument.js

@@ -5,19 +5,19 @@
                           否则将依法维权
 */
 
-var child_process = require("child_process");
+var child_process = require('child_process')
 
-var url = "https://www.gin-vue-admin.com",
-    cmd = '';
+var url = 'https://www.gin-vue-admin.com'
+var cmd = ''
 console.log(process.platform)
 switch (process.platform) {
-    case 'win32':
-        cmd = 'start';
-        child_process.exec(cmd + ' ' + url);
-        break;
+  case 'win32':
+    cmd = 'start'
+    child_process.exec(cmd + ' ' + url)
+    break
 
-    case 'darwin':
-        cmd = 'open';
-        child_process.exec(cmd + ' ' + url);
-        break;
-}
+  case 'darwin':
+    cmd = 'open'
+    child_process.exec(cmd + ' ' + url)
+    break
+}

+ 5 - 5
web/src/App.vue

@@ -1,16 +1,16 @@
 <template>
   <div id="app">
-    <router-view></router-view>
+    <router-view />
   </div>
 </template>
 
 <script>
-import { checkDB } from "@/api/initdb"
+import { checkDB } from '@/api/initdb'
 export default {
-  name: 'app',
-  async created(){
+  name: 'App',
+  async created() {
     await checkDB()
-  }  
+  }
 }
 </script>
 

+ 42 - 44
web/src/api/api.js

@@ -1,4 +1,5 @@
 import service from '@/utils/request'
+
 // @Tags api
 // @Summary 分页获取角色列表
 // @Security ApiKeyAuth
@@ -12,14 +13,13 @@ import service from '@/utils/request'
 //	pageSize int
 // }
 export const getApiList = (data) => {
-    return service({
-        url: "/api/getApiList",
-        method: 'post',
-        data
-    })
+  return service({
+    url: '/api/getApiList',
+    method: 'post',
+    data
+  })
 }
 
-
 // @Tags Api
 // @Summary 创建基础api
 // @Security ApiKeyAuth
@@ -29,11 +29,11 @@ export const getApiList = (data) => {
 // @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}"
 // @Router /api/createApi [post]
 export const createApi = (data) => {
-    return service({
-        url: "/api/createApi",
-        method: 'post',
-        data
-    })
+  return service({
+    url: '/api/createApi',
+    method: 'post',
+    data
+  })
 }
 
 // @Tags menu
@@ -45,15 +45,13 @@ export const createApi = (data) => {
 // @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}"
 // @Router /menu/getApiById [post]
 export const getApiById = (data) => {
-    return service({
-        url: "/api/getApiById",
-        method: 'post',
-        data
-    })
+  return service({
+    url: '/api/getApiById',
+    method: 'post',
+    data
+  })
 }
 
-
-
 // @Tags Api
 // @Summary 更新api
 // @Security ApiKeyAuth
@@ -63,11 +61,11 @@ export const getApiById = (data) => {
 // @Success 200 {string} json "{"success":true,"data":{},"msg":"更新成功"}"
 // @Router /api/updateApi [post]
 export const updateApi = (data) => {
-    return service({
-        url: "/api/updateApi",
-        method: 'post',
-        data
-    })
+  return service({
+    url: '/api/updateApi',
+    method: 'post',
+    data
+  })
 }
 
 // @Tags Api
@@ -79,11 +77,11 @@ export const updateApi = (data) => {
 // @Success 200 {string} json "{"success":true,"data":{},"msg":"更新成功"}"
 // @Router /api/setAuthApi [post]
 export const setAuthApi = (data) => {
-    return service({
-        url: "/api/setAuthApi",
-        method: 'post',
-        data
-    })
+  return service({
+    url: '/api/setAuthApi',
+    method: 'post',
+    data
+  })
 }
 
 // @Tags Api
@@ -94,11 +92,11 @@ export const setAuthApi = (data) => {
 // @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}"
 // @Router /api/getAllApis [post]
 export const getAllApis = (data) => {
-    return service({
-        url: "/api/getAllApis",
-        method: 'post',
-        data
-    })
+  return service({
+    url: '/api/getAllApis',
+    method: 'post',
+    data
+  })
 }
 
 // @Tags Api
@@ -110,11 +108,11 @@ export const getAllApis = (data) => {
 // @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}"
 // @Router /api/deleteApi [post]
 export const deleteApi = (data) => {
-    return service({
-        url: "/api/deleteApi",
-        method: 'post',
-        data
-    })
+  return service({
+    url: '/api/deleteApi',
+    method: 'post',
+    data
+  })
 }
 
 // @Tags SysApi
@@ -126,9 +124,9 @@ export const deleteApi = (data) => {
 // @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
 // @Router /api/deleteApisByIds [delete]
 export const deleteApisByIds = (data) => {
-    return service({
-        url: "/api/deleteApisByIds",
-        method: 'delete',
-        data
-    })
-}
+  return service({
+    url: '/api/deleteApisByIds',
+    method: 'delete',
+    data
+  })
+}

+ 31 - 33
web/src/api/authority.js

@@ -1,16 +1,14 @@
 import service from '@/utils/request'
 
-
 // @Router /authority/getAuthorityList [post]
 export const getAuthorityList = (data) => {
-    return service({
-        url: "/authority/getAuthorityList",
-        method: 'post',
-        data
-    })
+  return service({
+    url: '/authority/getAuthorityList',
+    method: 'post',
+    data
+  })
 }
 
-
 // @Summary 删除角色
 // @Security ApiKeyAuth
 // @accept application/json
@@ -19,11 +17,11 @@ export const getAuthorityList = (data) => {
 // @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}"
 // @Router /authority/deleteAuthority [post]
 export const deleteAuthority = (data) => {
-    return service({
-        url: "/authority/deleteAuthority",
-        method: 'post',
-        data
-    })
+  return service({
+    url: '/authority/deleteAuthority',
+    method: 'post',
+    data
+  })
 }
 
 // @Summary 创建角色
@@ -34,11 +32,11 @@ export const deleteAuthority = (data) => {
 // @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}"
 // @Router /authority/createAuthority [post]
 export const createAuthority = (data) => {
-    return service({
-        url: "/authority/createAuthority",
-        method: 'post',
-        data
-    })
+  return service({
+    url: '/authority/createAuthority',
+    method: 'post',
+    data
+  })
 }
 
 // @Tags authority
@@ -50,11 +48,11 @@ export const createAuthority = (data) => {
 // @Success 200 {string} json "{"success":true,"data":{},"msg":"拷贝成功"}"
 // @Router /authority/copyAuthority [post]
 export const copyAuthority = (data) => {
-    return service({
-        url: "/authority/copyAuthority",
-        method: 'post',
-        data
-    })
+  return service({
+    url: '/authority/copyAuthority',
+    method: 'post',
+    data
+  })
 }
 
 // @Summary 设置角色资源权限
@@ -65,11 +63,11 @@ export const copyAuthority = (data) => {
 // @Success 200 {string} string "{"success":true,"data":{},"msg":"设置成功"}"
 // @Router /authority/setDataAuthority [post]
 export const setDataAuthority = (data) => {
-    return service({
-        url: "/authority/setDataAuthority",
-        method: 'post',
-        data
-    })
+  return service({
+    url: '/authority/setDataAuthority',
+    method: 'post',
+    data
+  })
 }
 
 // @Summary 修改角色
@@ -80,9 +78,9 @@ export const setDataAuthority = (data) => {
 // @Success 200 {string} string "{"success":true,"data":{},"msg":"设置成功"}"
 // @Router /authority/setDataAuthority [post]
 export const updateAuthority = (data) => {
-    return service({
-        url: "/authority/updateAuthority",
-        method: 'put',
-        data
-    })
-}
+  return service({
+    url: '/authority/updateAuthority',
+    method: 'put',
+    data
+  })
+}

+ 26 - 28
web/src/api/autoCode.js

@@ -1,20 +1,20 @@
 import service from '@/utils/request'
 
 export const preview = (data) => {
-    return service({
-        url: "/autoCode/preview",
-        method: 'post',
-        data,
-    })
+  return service({
+    url: '/autoCode/preview',
+    method: 'post',
+    data
+  })
 }
 
 export const createTemp = (data) => {
-    return service({
-        url: "/autoCode/createTemp",
-        method: 'post',
-        data,
-        responseType: 'blob'
-    })
+  return service({
+    url: '/autoCode/createTemp',
+    method: 'post',
+    data,
+    responseType: 'blob'
+  })
 }
 
 // @Tags SysApi
@@ -25,14 +25,12 @@ export const createTemp = (data) => {
 // @Success 200 {string} string "{"success":true,"data":{},"msg":"创建成功"}"
 // @Router /autoCode/getDatabase [get]
 export const getDB = () => {
-    return service({
-        url: "/autoCode/getDB",
-        method: 'get',
-    })
+  return service({
+    url: '/autoCode/getDB',
+    method: 'get'
+  })
 }
 
-
-
 // @Tags SysApi
 // @Summary 获取当前数据库所有表
 // @Security ApiKeyAuth
@@ -41,11 +39,11 @@ export const getDB = () => {
 // @Success 200 {string} string "{"success":true,"data":{},"msg":"创建成功"}"
 // @Router /autoCode/getTables [get]
 export const getTable = (params) => {
-    return service({
-        url: "/autoCode/getTables",
-        method: 'get',
-        params,
-    })
+  return service({
+    url: '/autoCode/getTables',
+    method: 'get',
+    params
+  })
 }
 
 // @Tags SysApi
@@ -56,9 +54,9 @@ export const getTable = (params) => {
 // @Success 200 {string} string "{"success":true,"data":{},"msg":"创建成功"}"
 // @Router /autoCode/getColumn [get]
 export const getColumn = (params) => {
-    return service({
-        url: "/autoCode/getColumn",
-        method: 'get',
-        params,
-    })
-}
+  return service({
+    url: '/autoCode/getColumn',
+    method: 'get',
+    params
+  })
+}

+ 17 - 19
web/src/api/breakpoint.js

@@ -9,28 +9,26 @@ import service from '@/utils/request'
 // @Router /authority/setDataAuthority [post]
 
 export const findFile = (params) => {
-    return service({
-        url: "/fileUploadAndDownload/findFile",
-        method: 'get',
-        params
-    })
+  return service({
+    url: '/fileUploadAndDownload/findFile',
+    method: 'get',
+    params
+  })
 }
 
-
-
 export const breakpointContinueFinish = (params) => {
-    return service({
-        url: "/fileUploadAndDownload/breakpointContinueFinish",
-        method: 'post',
-        params
-    })
+  return service({
+    url: '/fileUploadAndDownload/breakpointContinueFinish',
+    method: 'post',
+    params
+  })
 }
 
 export const removeChunk = (data, params) => {
-    return service({
-        url: "/fileUploadAndDownload/removeChunk",
-        method: 'post',
-        data,
-        params
-    })
-}
+  return service({
+    url: '/fileUploadAndDownload/removeChunk',
+    method: 'post',
+    data,
+    params
+  })
+}

+ 11 - 13
web/src/api/casbin.js

@@ -8,16 +8,14 @@ import service from '@/utils/request'
 // @Param data body api.CreateAuthorityPatams true "更改角色api权限"
 // @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}"
 // @Router /casbin/UpdateCasbin [post]
-
 export const UpdateCasbin = (data) => {
-    return service({
-        url: "/casbin/updateCasbin",
-        method: 'post',
-        data
-    })
+  return service({
+    url: '/casbin/updateCasbin',
+    method: 'post',
+    data
+  })
 }
 
-
 // @Tags casbin
 // @Summary 获取权限列表
 // @Security ApiKeyAuth
@@ -27,9 +25,9 @@ export const UpdateCasbin = (data) => {
 // @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}"
 // @Router /casbin/getPolicyPathByAuthorityId [post]
 export const getPolicyPathByAuthorityId = (data) => {
-    return service({
-        url: "/casbin/getPolicyPathByAuthorityId",
-        method: 'post',
-        data
-    })
-}
+  return service({
+    url: '/casbin/getPolicyPathByAuthorityId',
+    method: 'post',
+    data
+  })
+}

+ 26 - 31
web/src/api/customer.js

@@ -9,15 +9,13 @@ import service from '@/utils/request'
 // @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
 // @Router /customer/customer [post]
 export const createExaCustomer = (data) => {
-    return service({
-        url: "/customer/customer",
-        method: 'post',
-        data
-    })
+  return service({
+    url: '/customer/customer',
+    method: 'post',
+    data
+  })
 }
 
-
-
 // @Tags SysApi
 // @Summary 更新客户信息
 // @Security ApiKeyAuth
@@ -27,14 +25,13 @@ export const createExaCustomer = (data) => {
 // @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
 // @Router /customer/customer [put]
 export const updateExaCustomer = (data) => {
-    return service({
-        url: "/customer/customer",
-        method: 'put',
-        data
-    })
+  return service({
+    url: '/customer/customer',
+    method: 'put',
+    data
+  })
 }
 
-
 // @Tags SysApi
 // @Summary 创建客户
 // @Security ApiKeyAuth
@@ -44,14 +41,13 @@ export const updateExaCustomer = (data) => {
 // @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
 // @Router /customer/customer [delete]
 export const deleteExaCustomer = (data) => {
-    return service({
-        url: "/customer/customer",
-        method: 'delete',
-        data
-    })
+  return service({
+    url: '/customer/customer',
+    method: 'delete',
+    data
+  })
 }
 
-
 // @Tags SysApi
 // @Summary 获取单一客户信息
 // @Security ApiKeyAuth
@@ -61,14 +57,13 @@ export const deleteExaCustomer = (data) => {
 // @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
 // @Router /customer/customer [get]
 export const getExaCustomer = (params) => {
-    return service({
-        url: "/customer/customer",
-        method: 'get',
-        params
-    })
+  return service({
+    url: '/customer/customer',
+    method: 'get',
+    params
+  })
 }
 
-
 // @Tags SysApi
 // @Summary 获取权限客户列表
 // @Security ApiKeyAuth
@@ -78,9 +73,9 @@ export const getExaCustomer = (params) => {
 // @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
 // @Router /customer/customerList [get]
 export const getExaCustomerList = (params) => {
-    return service({
-        url: "/customer/customerList",
-        method: 'get',
-        params
-    })
-}
+  return service({
+    url: '/customer/customerList',
+    method: 'get',
+    params
+  })
+}

+ 6 - 6
web/src/api/email.js

@@ -7,9 +7,9 @@ import service from '@/utils/request'
 // @Success 200 {string} string "{"success":true,"data":{},"msg":"返回成功"}"
 // @Router /email/emailTest [post]
 export const emailTest = (data) => {
-    return service({
-        url: "/email/emailTest",
-        method: 'post',
-        data
-    })
-}
+  return service({
+    url: '/email/emailTest',
+    method: 'post',
+    data
+  })
+}

+ 49 - 49
web/src/api/excel.js

@@ -1,29 +1,29 @@
-import service from '@/utils/request';
-import { Message } from 'element-ui';
+import service from '@/utils/request'
+import { Message } from 'element-ui'
 
 const handleFileError = (res, fileName) => {
-    if (typeof(res.data) !== "undefined") {
-        if (res.data.type == "application/json") {
-            const reader = new FileReader();
-            reader.onload = function() {
-                let message = JSON.parse(reader.result).msg;
-                Message({
-                    showClose: true,
-                    message: message,
-                    type: 'error'
-                })
-            };
-            reader.readAsText(new Blob([res.data]));
-        }
-    } else {
-        var downloadUrl = window.URL.createObjectURL(new Blob([res]));
-        var a = document.createElement('a');
-        a.style.display = 'none';
-        a.href = downloadUrl;
-        a.download = fileName;
-        var event = new MouseEvent("click");
-        a.dispatchEvent(event);
+  if (typeof (res.data) !== 'undefined') {
+    if (res.data.type === 'application/json') {
+      const reader = new FileReader()
+      reader.onload = function() {
+        const message = JSON.parse(reader.result).msg
+        Message({
+          showClose: true,
+          message: message,
+          type: 'error'
+        })
+      }
+      reader.readAsText(new Blob([res.data]))
     }
+  } else {
+    var downloadUrl = window.URL.createObjectURL(new Blob([res]))
+    var a = document.createElement('a')
+    a.style.display = 'none'
+    a.href = downloadUrl
+    a.download = fileName
+    var event = new MouseEvent('click')
+    a.dispatchEvent(event)
+  }
 }
 
 // @Tags excel
@@ -35,17 +35,17 @@ const handleFileError = (res, fileName) => {
 // @Success 200
 // @Router /excel/exportExcel [post]
 export const exportExcel = (tableData, fileName) => {
-    service({
-        url: "/excel/exportExcel",
-        method: 'post',
-        data: {
-            fileName: fileName,
-            infoList: tableData
-        },
-        responseType: 'blob'
-    }).then((res) => {
-        handleFileError(res, fileName)
-    })
+  service({
+    url: '/excel/exportExcel',
+    method: 'post',
+    data: {
+      fileName: fileName,
+      infoList: tableData
+    },
+    responseType: 'blob'
+  }).then((res) => {
+    handleFileError(res, fileName)
+  })
 }
 
 // @Tags excel
@@ -57,10 +57,10 @@ export const exportExcel = (tableData, fileName) => {
 // @Success 200 {string} string "{"success":true,"data":{},"msg":"导入成功"}"
 // @Router /excel/importExcel [post]
 export const loadExcelData = () => {
-    return service({
-        url: "/excel/loadExcel",
-        method: 'get'
-    })
+  return service({
+    url: '/excel/loadExcel',
+    method: 'get'
+  })
 }
 
 // @Tags excel
@@ -72,14 +72,14 @@ export const loadExcelData = () => {
 // @Success 200
 // @Router /excel/downloadTemplate [get]
 export const downloadTemplate = (fileName) => {
-    return service({
-        url: "/excel/downloadTemplate",
-        method: 'get',
-        params: {
-            fileName: fileName
-        },
-        responseType: 'blob'
-    }).then((res) => {
-        handleFileError(res, fileName)
-    })
-}
+  return service({
+    url: '/excel/downloadTemplate',
+    method: 'get',
+    params: {
+      fileName: fileName
+    },
+    responseType: 'blob'
+  }).then((res) => {
+    handleFileError(res, fileName)
+  })
+}

+ 12 - 12
web/src/api/fileUploadAndDownload.js

@@ -1,4 +1,4 @@
-import service from '@/utils/request';
+import service from '@/utils/request'
 
 // @Tags FileUploadAndDownload
 // @Summary 分页文件列表
@@ -9,11 +9,11 @@ import service from '@/utils/request';
 // @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}"
 // @Router /fileUploadAndDownload/getFileList [post]
 export const getFileList = (data) => {
-    return service({
-        url: "/fileUploadAndDownload/getFileList",
-        method: "post",
-        data
-    })
+  return service({
+    url: '/fileUploadAndDownload/getFileList',
+    method: 'post',
+    data
+  })
 }
 
 // @Tags FileUploadAndDownload
@@ -24,9 +24,9 @@ export const getFileList = (data) => {
 // @Success 200 {string} json "{"success":true,"data":{},"msg":"返回成功"}"
 // @Router /fileUploadAndDownload/deleteFile [post]
 export const deleteFile = (data) => {
-    return service({
-        url: "/fileUploadAndDownload/deleteFile",
-        method: "post",
-        data
-    })
-}
+  return service({
+    url: '/fileUploadAndDownload/deleteFile',
+    method: 'post',
+    data
+  })
+}

+ 21 - 22
web/src/api/github.js

@@ -1,33 +1,32 @@
-import axios from "axios";
-import { Loading } from "element-ui";
+import axios from 'axios'
+import { Loading } from 'element-ui'
 
-let loadingInstance;
-let service = axios.create();
+let loadingInstance
+const service = axios.create()
 
 service.interceptors.request.use((config) => {
-    loadingInstance = Loading.service({ fullscreen: true });
-    return config;
-});
+  loadingInstance = Loading.service({ fullscreen: true })
+  return config
+})
 
 service.interceptors.response.use((resp) => {
-    loadingInstance.close();
-    return resp;
+  loadingInstance.close()
+  return resp
 }, (error) => {
-    loadingInstance.close();
-    return error;
-});
+  loadingInstance.close()
+  return error
+})
 
 export function Commits(page) {
-    return service({
-        url: "https://api.github.com/repos/flipped-aurora/gin-vue-admin/commits?page=" +
-            page,
-        method: "get",
-    });
+  return service({
+    url: 'https://api.github.com/repos/flipped-aurora/gin-vue-admin/commits?page=' + page,
+    method: 'get'
+  })
 }
 
 export function Members() {
-    return service({
-        url: "https://api.github.com/orgs/FLIPPED-AURORA/members",
-        method: "get",
-    });
-}
+  return service({
+    url: 'https://api.github.com/orgs/FLIPPED-AURORA/members',
+    method: 'get'
+  })
+}

+ 10 - 12
web/src/api/initdb.js

@@ -7,23 +7,21 @@ import service from '@/utils/request'
 // @Success 200 {string} string "{"code":0,"data":{},"msg":"自动创建数据库成功"}"
 // @Router /init/initdb [post]
 export const initDB = (data) => {
-    return service({
-        url: "/init/initdb",
-        method: 'post',
-        data
-    })
+  return service({
+    url: '/init/initdb',
+    method: 'post',
+    data
+  })
 }
 
-
 // @Tags CheckDB
 // @Summary 初始化用户数据库
 // @Produce  application/json
 // @Success 200 {string} string "{"code":0,"data":{},"msg":"探测完成"}"
 // @Router /init/checkdb [post]
-
 export const checkDB = () => {
-    return service({
-        url: "/init/checkdb",
-        method: 'post',
-    })
-}
+  return service({
+    url: '/init/checkdb',
+    method: 'post'
+  })
+}

+ 5 - 6
web/src/api/jwt.js

@@ -7,10 +7,9 @@ import service from '@/utils/request'
 // @Produce application/json
 // @Success 200 {string} string "{"success":true,"data":{},"msg":"拉黑成功"}"
 // @Router /jwt/jsonInBlacklist [post]
-
 export const jsonInBlacklist = () => {
-    return service({
-        url: "/jwt/jsonInBlacklist",
-        method: 'post',
-    })
-}
+  return service({
+    url: '/jwt/jsonInBlacklist',
+    method: 'post'
+  })
+}

+ 44 - 47
web/src/api/menu.js

@@ -5,10 +5,10 @@ import service from '@/utils/request'
 // @Param 可以什么都不填 调一下即可
 // @Router /menu/getMenu [post]
 export const asyncMenu = () => {
-    return service({
-        url: "/menu/getMenu",
-        method: 'post',
-    })
+  return service({
+    url: '/menu/getMenu',
+    method: 'post'
+  })
 }
 
 // @Summary 获取menu列表
@@ -19,24 +19,23 @@ export const asyncMenu = () => {
 // }
 // @Router /menu/getMenuList [post]
 export const getMenuList = (data) => {
-    return service({
-        url: "/menu/getMenuList",
-        method: 'post',
-        data
-    })
+  return service({
+    url: '/menu/getMenuList',
+    method: 'post',
+    data
+  })
 }
 
-
 // @Summary 新增基础menu
 // @Produce  application/json
 // @Param menu Object
 // @Router /menu/getMenuList [post]
 export const addBaseMenu = (data) => {
-    return service({
-        url: "/menu/addBaseMenu",
-        method: 'post',
-        data
-    })
+  return service({
+    url: '/menu/addBaseMenu',
+    method: 'post',
+    data
+  })
 }
 
 // @Summary 获取基础路由列表
@@ -44,10 +43,10 @@ export const addBaseMenu = (data) => {
 // @Param 可以什么都不填 调一下即可
 // @Router /menu/getBaseMenuTree [post]
 export const getBaseMenuTree = () => {
-    return service({
-        url: "/menu/getBaseMenuTree",
-        method: 'post',
-    })
+  return service({
+    url: '/menu/getBaseMenuTree',
+    method: 'post'
+  })
 }
 
 // @Summary 添加用户menu关联关系
@@ -55,11 +54,11 @@ export const getBaseMenuTree = () => {
 // @Param menus Object authorityId string
 // @Router /menu/getMenuList [post]
 export const addMenuAuthority = (data) => {
-    return service({
-        url: "/menu/addMenuAuthority",
-        method: 'post',
-        data
-    })
+  return service({
+    url: '/menu/addMenuAuthority',
+    method: 'post',
+    data
+  })
 }
 
 // @Summary 获取用户menu关联关系
@@ -67,11 +66,11 @@ export const addMenuAuthority = (data) => {
 // @Param authorityId string
 // @Router /menu/getMenuAuthority [post]
 export const getMenuAuthority = (data) => {
-    return service({
-        url: "/menu/getMenuAuthority",
-        method: 'post',
-        data
-    })
+  return service({
+    url: '/menu/getMenuAuthority',
+    method: 'post',
+    data
+  })
 }
 
 // @Summary 获取用户menu关联关系
@@ -79,27 +78,25 @@ export const getMenuAuthority = (data) => {
 // @Param ID float64
 // @Router /menu/deleteBaseMenu [post]
 export const deleteBaseMenu = (data) => {
-    return service({
-        url: "/menu/deleteBaseMenu",
-        method: 'post',
-        data
-    })
+  return service({
+    url: '/menu/deleteBaseMenu',
+    method: 'post',
+    data
+  })
 }
 
-
 // @Summary 修改menu列表
 // @Produce  application/json
 // @Param menu Object
 // @Router /menu/updateBaseMenu [post]
 export const updateBaseMenu = (data) => {
-    return service({
-        url: "/menu/updateBaseMenu",
-        method: 'post',
-        data
-    })
+  return service({
+    url: '/menu/updateBaseMenu',
+    method: 'post',
+    data
+  })
 }
 
-
 // @Tags menu
 // @Summary 根据id获取菜单
 // @Security ApiKeyAuth
@@ -109,9 +106,9 @@ export const updateBaseMenu = (data) => {
 // @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}"
 // @Router /menu/getBaseMenuById [post]
 export const getBaseMenuById = (data) => {
-    return service({
-        url: "/menu/getBaseMenuById",
-        method: 'post',
-        data
-    })
-}
+  return service({
+    url: '/menu/getBaseMenuById',
+    method: 'post',
+    data
+  })
+}

+ 10 - 12
web/src/api/simpleUploader.js

@@ -1,5 +1,4 @@
 
-
 import service from '@/utils/request'
 
 // @Tags SimpleUploader
@@ -11,14 +10,13 @@ import service from '@/utils/request'
 // @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}"
 // @Router /simpleUploader/checkFileMd5 [get]
 export const checkFileMd5 = (params) => {
-    return service({
-        url: "/simpleUploader/checkFileMd5",
-        method: 'get',
-        params
-    })
+  return service({
+    url: '/simpleUploader/checkFileMd5',
+    method: 'get',
+    params
+  })
 }
 
-
 // @Tags SimpleUploader
 // @Summary 合并文件
 // @Security ApiKeyAuth
@@ -27,10 +25,10 @@ export const checkFileMd5 = (params) => {
 // @Success 200 {string} string "{"success":true,"data":{},"msg":"合并成功"}"
 // @Router /simpleUploader/mergeFileMd5 [get]
 export const mergeFileMd5 = (params) => {
-    return service({
-        url: "/simpleUploader/mergeFileMd5",
-        method: 'get',
-        params
-    })
+  return service({
+    url: '/simpleUploader/mergeFileMd5',
+    method: 'get',
+    params
+  })
 }
 

+ 34 - 37
web/src/api/sysDictionary.js

@@ -9,13 +9,12 @@ import service from '@/utils/request'
 // @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
 // @Router /sysDictionary/createSysDictionary [post]
 export const createSysDictionary = (data) => {
-     return service({
-         url: "/sysDictionary/createSysDictionary",
-         method: 'post',
-         data
-     })
- }
-
+  return service({
+    url: '/sysDictionary/createSysDictionary',
+    method: 'post',
+    data
+  })
+}
 
 // @Tags SysDictionary
 // @Summary 删除SysDictionary
@@ -25,13 +24,13 @@ export const createSysDictionary = (data) => {
 // @Param data body model.SysDictionary true "删除SysDictionary"
 // @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
 // @Router /sysDictionary/deleteSysDictionary [delete]
- export const deleteSysDictionary = (data) => {
-     return service({
-         url: "/sysDictionary/deleteSysDictionary",
-         method: 'delete',
-         data
-     })
- }
+export const deleteSysDictionary = (data) => {
+  return service({
+    url: '/sysDictionary/deleteSysDictionary',
+    method: 'delete',
+    data
+  })
+}
 
 // @Tags SysDictionary
 // @Summary 更新SysDictionary
@@ -41,14 +40,13 @@ export const createSysDictionary = (data) => {
 // @Param data body model.SysDictionary true "更新SysDictionary"
 // @Success 200 {string} string "{"success":true,"data":{},"msg":"更新成功"}"
 // @Router /sysDictionary/updateSysDictionary [put]
- export const updateSysDictionary = (data) => {
-     return service({
-         url: "/sysDictionary/updateSysDictionary",
-         method: 'put',
-         data
-     })
- }
-
+export const updateSysDictionary = (data) => {
+  return service({
+    url: '/sysDictionary/updateSysDictionary',
+    method: 'put',
+    data
+  })
+}
 
 // @Tags SysDictionary
 // @Summary 用id查询SysDictionary
@@ -58,14 +56,13 @@ export const createSysDictionary = (data) => {
 // @Param data body model.SysDictionary true "用id查询SysDictionary"
 // @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}"
 // @Router /sysDictionary/findSysDictionary [get]
- export const findSysDictionary = (params) => {
-     return service({
-         url: "/sysDictionary/findSysDictionary",
-         method: 'get',
-         params
-     })
- }
-
+export const findSysDictionary = (params) => {
+  return service({
+    url: '/sysDictionary/findSysDictionary',
+    method: 'get',
+    params
+  })
+}
 
 // @Tags SysDictionary
 // @Summary 分页获取SysDictionary列表
@@ -75,10 +72,10 @@ export const createSysDictionary = (data) => {
 // @Param data body request.PageInfo true "分页获取SysDictionary列表"
 // @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
 // @Router /sysDictionary/getSysDictionaryList [get]
- export const getSysDictionaryList = (params) => {
-     return service({
-         url: "/sysDictionary/getSysDictionaryList",
-         method: 'get',
-         params
-     })
- }
+export const getSysDictionaryList = (params) => {
+  return service({
+    url: '/sysDictionary/getSysDictionaryList',
+    method: 'get',
+    params
+  })
+}

+ 34 - 37
web/src/api/sysDictionaryDetail.js

@@ -9,13 +9,12 @@ import service from '@/utils/request'
 // @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
 // @Router /sysDictionaryDetail/createSysDictionaryDetail [post]
 export const createSysDictionaryDetail = (data) => {
-     return service({
-         url: "/sysDictionaryDetail/createSysDictionaryDetail",
-         method: 'post',
-         data
-     })
- }
-
+  return service({
+    url: '/sysDictionaryDetail/createSysDictionaryDetail',
+    method: 'post',
+    data
+  })
+}
 
 // @Tags SysDictionaryDetail
 // @Summary 删除SysDictionaryDetail
@@ -25,13 +24,13 @@ export const createSysDictionaryDetail = (data) => {
 // @Param data body model.SysDictionaryDetail true "删除SysDictionaryDetail"
 // @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
 // @Router /sysDictionaryDetail/deleteSysDictionaryDetail [delete]
- export const deleteSysDictionaryDetail = (data) => {
-     return service({
-         url: "/sysDictionaryDetail/deleteSysDictionaryDetail",
-         method: 'delete',
-         data
-     })
- }
+export const deleteSysDictionaryDetail = (data) => {
+  return service({
+    url: '/sysDictionaryDetail/deleteSysDictionaryDetail',
+    method: 'delete',
+    data
+  })
+}
 
 // @Tags SysDictionaryDetail
 // @Summary 更新SysDictionaryDetail
@@ -41,14 +40,13 @@ export const createSysDictionaryDetail = (data) => {
 // @Param data body model.SysDictionaryDetail true "更新SysDictionaryDetail"
 // @Success 200 {string} string "{"success":true,"data":{},"msg":"更新成功"}"
 // @Router /sysDictionaryDetail/updateSysDictionaryDetail [put]
- export const updateSysDictionaryDetail = (data) => {
-     return service({
-         url: "/sysDictionaryDetail/updateSysDictionaryDetail",
-         method: 'put',
-         data
-     })
- }
-
+export const updateSysDictionaryDetail = (data) => {
+  return service({
+    url: '/sysDictionaryDetail/updateSysDictionaryDetail',
+    method: 'put',
+    data
+  })
+}
 
 // @Tags SysDictionaryDetail
 // @Summary 用id查询SysDictionaryDetail
@@ -58,14 +56,13 @@ export const createSysDictionaryDetail = (data) => {
 // @Param data body model.SysDictionaryDetail true "用id查询SysDictionaryDetail"
 // @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}"
 // @Router /sysDictionaryDetail/findSysDictionaryDetail [get]
- export const findSysDictionaryDetail = (params) => {
-     return service({
-         url: "/sysDictionaryDetail/findSysDictionaryDetail",
-         method: 'get',
-         params
-     })
- }
-
+export const findSysDictionaryDetail = (params) => {
+  return service({
+    url: '/sysDictionaryDetail/findSysDictionaryDetail',
+    method: 'get',
+    params
+  })
+}
 
 // @Tags SysDictionaryDetail
 // @Summary 分页获取SysDictionaryDetail列表
@@ -75,10 +72,10 @@ export const createSysDictionaryDetail = (data) => {
 // @Param data body request.PageInfo true "分页获取SysDictionaryDetail列表"
 // @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
 // @Router /sysDictionaryDetail/getSysDictionaryDetailList [get]
- export const getSysDictionaryDetailList = (params) => {
-     return service({
-         url: "/sysDictionaryDetail/getSysDictionaryDetailList",
-         method: 'get',
-         params
-     })
- }
+export const getSysDictionaryDetailList = (params) => {
+  return service({
+    url: '/sysDictionaryDetail/getSysDictionaryDetailList',
+    method: 'get',
+    params
+  })
+}

+ 16 - 16
web/src/api/sysOperationRecord.js

@@ -9,11 +9,11 @@ import service from '@/utils/request'
 // @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
 // @Router /sysOperationRecord/deleteSysOperationRecord [delete]
 export const deleteSysOperationRecord = (data) => {
-    return service({
-        url: "/sysOperationRecord/deleteSysOperationRecord",
-        method: 'delete',
-        data
-    })
+  return service({
+    url: '/sysOperationRecord/deleteSysOperationRecord',
+    method: 'delete',
+    data
+  })
 }
 
 // @Tags SysOperationRecord
@@ -25,11 +25,11 @@ export const deleteSysOperationRecord = (data) => {
 // @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
 // @Router /sysOperationRecord/deleteSysOperationRecord [delete]
 export const deleteSysOperationRecordByIds = (data) => {
-    return service({
-        url: "/sysOperationRecord/deleteSysOperationRecordByIds",
-        method: 'delete',
-        data
-    })
+  return service({
+    url: '/sysOperationRecord/deleteSysOperationRecordByIds',
+    method: 'delete',
+    data
+  })
 }
 
 // @Tags SysOperationRecord
@@ -41,9 +41,9 @@ export const deleteSysOperationRecordByIds = (data) => {
 // @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
 // @Router /sysOperationRecord/getSysOperationRecordList [get]
 export const getSysOperationRecordList = (params) => {
-    return service({
-        url: "/sysOperationRecord/getSysOperationRecordList",
-        method: 'get',
-        params
-    })
-}
+  return service({
+    url: '/sysOperationRecord/getSysOperationRecordList',
+    method: 'get',
+    params
+  })
+}

+ 18 - 18
web/src/api/system.js

@@ -1,4 +1,4 @@
-import service from "@/utils/request";
+import service from '@/utils/request'
 
 // @Tags systrm
 // @Summary 获取配置文件内容
@@ -7,11 +7,11 @@ import service from "@/utils/request";
 // @Success 200 {string} string "{"success":true,"data":{},"msg":"返回成功"}"
 // @Router /system/getSystemConfig [post]
 export const getSystemConfig = () => {
-    return service({
-        url: "/system/getSystemConfig",
-        method: "post",
-    });
-};
+  return service({
+    url: '/system/getSystemConfig',
+    method: 'post'
+  })
+}
 
 // @Tags system
 // @Summary 设置配置文件内容
@@ -21,12 +21,12 @@ export const getSystemConfig = () => {
 // @Success 200 {string} string "{"success":true,"data":{},"msg":"返回成功"}"
 // @Router /system/setSystemConfig [post]
 export const setSystemConfig = (data) => {
-    return service({
-        url: "/system/setSystemConfig",
-        method: "post",
-        data,
-    });
-};
+  return service({
+    url: '/system/setSystemConfig',
+    method: 'post',
+    data
+  })
+}
 
 // @Tags system
 // @Summary 获取服务器运行状态
@@ -35,9 +35,9 @@ export const setSystemConfig = (data) => {
 // @Success 200 {string} string "{"success":true,"data":{},"msg":"返回成功"}"
 // @Router /system/getServerInfo [post]
 export const getSystemState = () => {
-    return service({
-        url: "/system/getServerInfo",
-        method: "post",
-        donNotShowLoading: true
-    });
-};
+  return service({
+    url: '/system/getServerInfo',
+    method: 'post',
+    donNotShowLoading: true
+  })
+}

+ 57 - 57
web/src/api/user.js

@@ -5,11 +5,11 @@ import service from '@/utils/request'
 // @Param data body {username:"string",password:"string"}
 // @Router /base/login [post]
 export const login = (data) => {
-    return service({
-        url: "/base/login",
-        method: 'post',
-        data: data
-    })
+  return service({
+    url: '/base/login',
+    method: 'post',
+    data: data
+  })
 }
 
 // @Summary 获取验证码
@@ -17,11 +17,11 @@ export const login = (data) => {
 // @Param data body {username:"string",password:"string"}
 // @Router /base/captcha [post]
 export const captcha = (data) => {
-    return service({
-        url: "/base/captcha",
-        method: 'post',
-        data: data
-    })
+  return service({
+    url: '/base/captcha',
+    method: 'post',
+    data: data
+  })
 }
 
 // @Summary 用户注册
@@ -29,39 +29,40 @@ export const captcha = (data) => {
 // @Param data body {username:"string",password:"string"}
 // @Router /base/resige [post]
 export const register = (data) => {
-        return service({
-            url: "/user/register",
-            method: 'post',
-            data: data
-        })
-    }
-    // @Summary 修改密码
-    // @Produce  application/json
-    // @Param data body {username:"string",password:"string",newPassword:"string"}
-    // @Router /user/changePassword [post]
+  return service({
+    url: '/user/register',
+    method: 'post',
+    data: data
+  })
+}
+
+// @Summary 修改密码
+// @Produce  application/json
+// @Param data body {username:"string",password:"string",newPassword:"string"}
+// @Router /user/changePassword [post]
 export const changePassword = (data) => {
-        return service({
-            url: "/user/changePassword",
-            method: 'post',
-            data: data
-        })
-    }
-    // @Tags User
-    // @Summary 分页获取用户列表
-    // @Security ApiKeyAuth
-    // @accept application/json
-    // @Produce application/json
-    // @Param data body modelInterface.PageInfo true "分页获取用户列表"
-    // @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}"
-    // @Router /user/getUserList [post]
-export const getUserList = (data) => {
-    return service({
-        url: "/user/getUserList",
-        method: 'post',
-        data: data
-    })
+  return service({
+    url: '/user/changePassword',
+    method: 'post',
+    data: data
+  })
 }
 
+// @Tags User
+// @Summary 分页获取用户列表
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data body modelInterface.PageInfo true "分页获取用户列表"
+// @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}"
+// @Router /user/getUserList [post]
+export const getUserList = (data) => {
+  return service({
+    url: '/user/getUserList',
+    method: 'post',
+    data: data
+  })
+}
 
 // @Tags User
 // @Summary 设置用户权限
@@ -72,14 +73,13 @@ export const getUserList = (data) => {
 // @Success 200 {string} json "{"success":true,"data":{},"msg":"修改成功"}"
 // @Router /user/setUserAuthority [post]
 export const setUserAuthority = (data) => {
-    return service({
-        url: "/user/setUserAuthority",
-        method: 'post',
-        data: data
-    })
+  return service({
+    url: '/user/setUserAuthority',
+    method: 'post',
+    data: data
+  })
 }
 
-
 // @Tags SysUser
 // @Summary 删除用户
 // @Security ApiKeyAuth
@@ -89,11 +89,11 @@ export const setUserAuthority = (data) => {
 // @Success 200 {string} string "{"success":true,"data":{},"msg":"修改成功"}"
 // @Router /user/deleteUser [delete]
 export const deleteUser = (data) => {
-    return service({
-        url: "/user/deleteUser",
-        method: 'delete',
-        data: data
-    })
+  return service({
+    url: '/user/deleteUser',
+    method: 'delete',
+    data: data
+  })
 }
 
 // @Tags SysUser
@@ -105,9 +105,9 @@ export const deleteUser = (data) => {
 // @Success 200 {string} string "{"success":true,"data":{},"msg":"修改成功"}"
 // @Router /user/setUserInfo [put]
 export const setUserInfo = (data) => {
-    return service({
-        url: "/user/setUserInfo",
-        method: 'put',
-        data: data
-    })
-}
+  return service({
+    url: '/user/setUserInfo',
+    method: 'put',
+    data: data
+  })
+}

+ 70 - 76
web/src/api/workflowProcess.js

@@ -9,14 +9,13 @@ import service from '@/utils/request'
 // @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
 // @Router /workflowProcess/createWorkflowProcess [post]
 export const createWorkflowProcess = (data) => {
-    return service({
-        url: "/workflowProcess/createWorkflowProcess",
-        method: 'post',
-        data
-    })
+  return service({
+    url: '/workflowProcess/createWorkflowProcess',
+    method: 'post',
+    data
+  })
 }
 
-
 // @Tags WorkflowProcess
 // @Summary 删除WorkflowProcess
 // @Security ApiKeyAuth
@@ -26,11 +25,11 @@ export const createWorkflowProcess = (data) => {
 // @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
 // @Router /workflowProcess/deleteWorkflowProcess [delete]
 export const deleteWorkflowProcess = (data) => {
-    return service({
-        url: "/workflowProcess/deleteWorkflowProcess",
-        method: 'delete',
-        data
-    })
+  return service({
+    url: '/workflowProcess/deleteWorkflowProcess',
+    method: 'delete',
+    data
+  })
 }
 
 // @Tags WorkflowProcess
@@ -42,11 +41,11 @@ export const deleteWorkflowProcess = (data) => {
 // @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
 // @Router /workflowProcess/deleteWorkflowProcess [delete]
 export const deleteWorkflowProcessByIds = (data) => {
-    return service({
-        url: "/workflowProcess/deleteWorkflowProcessByIds",
-        method: 'delete',
-        data
-    })
+  return service({
+    url: '/workflowProcess/deleteWorkflowProcessByIds',
+    method: 'delete',
+    data
+  })
 }
 
 // @Tags WorkflowProcess
@@ -58,14 +57,13 @@ export const deleteWorkflowProcessByIds = (data) => {
 // @Success 200 {string} string "{"success":true,"data":{},"msg":"更新成功"}"
 // @Router /workflowProcess/updateWorkflowProcess [put]
 export const updateWorkflowProcess = (data) => {
-    return service({
-        url: "/workflowProcess/updateWorkflowProcess",
-        method: 'put',
-        data
-    })
+  return service({
+    url: '/workflowProcess/updateWorkflowProcess',
+    method: 'put',
+    data
+  })
 }
 
-
 // @Tags WorkflowProcess
 // @Summary 用id查询WorkflowProcess
 // @Security ApiKeyAuth
@@ -75,14 +73,13 @@ export const updateWorkflowProcess = (data) => {
 // @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}"
 // @Router /workflowProcess/findWorkflowProcess [get]
 export const findWorkflowProcess = (params) => {
-    return service({
-        url: "/workflowProcess/findWorkflowProcess",
-        method: 'get',
-        params
-    })
+  return service({
+    url: '/workflowProcess/findWorkflowProcess',
+    method: 'get',
+    params
+  })
 }
 
-
 // @Tags WorkflowProcess
 // @Summary 分页获取WorkflowProcess列表
 // @Security ApiKeyAuth
@@ -92,11 +89,11 @@ export const findWorkflowProcess = (params) => {
 // @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
 // @Router /workflowProcess/getWorkflowProcessList [get]
 export const getWorkflowProcessList = (params) => {
-    return service({
-        url: "/workflowProcess/getWorkflowProcessList",
-        method: 'get',
-        params
-    })
+  return service({
+    url: '/workflowProcess/getWorkflowProcessList',
+    method: 'get',
+    params
+  })
 }
 
 // @Tags WorkflowProcess
@@ -108,14 +105,13 @@ export const getWorkflowProcessList = (params) => {
 // @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}"
 // @Router /workflowProcess/findWorkflowStep [get]
 export const findWorkflowStep = (params) => {
-    return service({
-        url: "/workflowProcess/findWorkflowStep",
-        method: 'get',
-        params
-    })
+  return service({
+    url: '/workflowProcess/findWorkflowStep',
+    method: 'get',
+    params
+  })
 }
 
-
 // @Tags ExaWfLeave
 // @Summary 创建ExaWfLeave
 // @Security ApiKeyAuth
@@ -124,15 +120,14 @@ export const findWorkflowStep = (params) => {
 // @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
 // @Router /workflowProcess/startWorkflow [post]
 export const startWorkflow = (data, params = { businessType: data.wf.businessType }) => {
-    return service({
-        url: "/workflowProcess/startWorkflow",
-        method: 'post',
-        data,
-        params
-    })
+  return service({
+    url: '/workflowProcess/startWorkflow',
+    method: 'post',
+    data,
+    params
+  })
 }
 
-
 // @Tags ExaWfLeave
 // @Summary 创建ExaWfLeave
 // @Security ApiKeyAuth
@@ -141,28 +136,27 @@ export const startWorkflow = (data, params = { businessType: data.wf.businessTyp
 // @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
 // @Router /workflowProcess/completeWorkflowMove [post]
 export const completeWorkflowMove = (data, params = { businessType: data.wf.businessType }) => {
-        return service({
-            url: "/workflowProcess/completeWorkflowMove",
-            method: 'post',
-            data,
-            params
-        })
-    }
-    // @Tags WorkflowProcess
-    // @Summary 我发起的工作流
-    // @Security ApiKeyAuth
-    // @accept application/json
-    // @Produce application/json
-    // @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
-    // @Router /workflowProcess/getMyStated [get]
-export const getMyStated = () => {
-    return service({
-        url: "/workflowProcess/getMyStated",
-        method: 'get',
-    })
+  return service({
+    url: '/workflowProcess/completeWorkflowMove',
+    method: 'post',
+    data,
+    params
+  })
 }
 
-
+// @Tags WorkflowProcess
+// @Summary 我发起的工作流
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
+// @Router /workflowProcess/getMyStated [get]
+export const getMyStated = () => {
+  return service({
+    url: '/workflowProcess/getMyStated',
+    method: 'get'
+  })
+}
 
 // @Tags WorkflowProcess
 // @Summary 我发起的工作流
@@ -172,10 +166,10 @@ export const getMyStated = () => {
 // @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
 // @Router /workflowProcess/getMyNeed [get]
 export const getMyNeed = () => {
-    return service({
-        url: "/workflowProcess/getMyNeed",
-        method: 'get',
-    })
+  return service({
+    url: '/workflowProcess/getMyNeed',
+    method: 'get'
+  })
 }
 
 // @Tags WorkflowProcess
@@ -187,9 +181,9 @@ export const getMyNeed = () => {
 // @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
 // @Router /workflowProcess/getWorkflowMoveByID [get]
 export const getWorkflowMoveByID = (params) => {
-    return service({
-        url: "/workflowProcess/getWorkflowMoveByID",
-        method: 'get',
-        params
-    })
-}
+  return service({
+    url: '/workflowProcess/getWorkflowMoveByID',
+    method: 'get',
+    params
+  })
+}

+ 23 - 17
web/src/components/chooseImg/index.vue

@@ -2,14 +2,14 @@
   <el-drawer title="媒体库" :visible.sync="drawer">
     <div class="media">
       <el-image
-        class="header-img-box-list"
-        :src="(item.url && item.url.slice(0, 4) !== 'http')?path+item.url:item.url"
         v-for="(item,key) in picList"
         :key="key"
+        class="header-img-box-list"
+        :src="(item.url && item.url.slice(0, 4) !== 'http')?path+item.url:item.url"
         @click.native="chooseImg(item.url,target,targetKey)"
       >
         <div slot="error" class="header-img-box-list">
-          <i class="el-icon-picture-outline"></i>
+          <i class="el-icon-picture-outline" />
         </div>
       </el-image>
     </div>
@@ -18,34 +18,40 @@
 
 <script>
 const path = process.env.VUE_APP_BASE_API
-import { getFileList } from "@/api/fileUploadAndDownload";
+import { getFileList } from '@/api/fileUploadAndDownload'
 export default {
   props: {
-    target: [Object],
-    targetKey: [String]
+    target: {
+      type: Object,
+      default: null
+    },
+    targetKey: {
+      type: String,
+      default: ''
+    }
   },
   data() {
     return {
       drawer: false,
       picList: [],
-      path:path
-    };
+      path: path
+    }
   },
   methods: {
     chooseImg(url, target, targetKey) {
-      if(target&&targetKey){
-        target[targetKey] = url;
+      if (target && targetKey) {
+        target[targetKey] = url
       }
-      this.$emit("enter-img", url);
-      this.drawer = false;
+      this.$emit('enter-img', url)
+      this.drawer = false
     },
     async open() {
-      const res = await getFileList({ page: 1, pageSize: 9999 });
-      this.picList = res.data.list;
-      this.drawer = true;
+      const res = await getFileList({ page: 1, pageSize: 9999 })
+      this.picList = res.data.list
+      this.drawer = true
     }
   }
-};
+}
 </script>
 
 <style lang="scss">
@@ -65,4 +71,4 @@ export default {
 }
 }
 
-</style>
+</style>

+ 49 - 49
web/src/components/customPic/index.vue

@@ -1,63 +1,63 @@
 <template>
-    <span class="headerAvatar">
-        <template v-if="picType === 'avatar'">
-            <el-avatar :size="30" :src="avatar" v-if="userInfo.headerImg"></el-avatar>
-            <el-avatar :size="30" :src="require('@/assets/noBody.png')" v-else></el-avatar>
-        </template>
-        <template v-if="picType === 'img'">
-            <img :src="avatar" class="avatar" v-if="userInfo.headerImg" />
-            <img :src="require('@/assets/noBody.png')" class="avatar" v-else/>
-        </template>
-        <template v-if="picType === 'file'">
-            <img :src="file" class="file"/>
-        </template>
-    </span>
+  <span class="headerAvatar">
+    <template v-if="picType === 'avatar'">
+      <el-avatar v-if="userInfo.headerImg" :size="30" :src="avatar" />
+      <el-avatar v-else :size="30" :src="require('@/assets/noBody.png')" />
+    </template>
+    <template v-if="picType === 'img'">
+      <img v-if="userInfo.headerImg" :src="avatar" class="avatar">
+      <img v-else :src="require('@/assets/noBody.png')" class="avatar">
+    </template>
+    <template v-if="picType === 'file'">
+      <img :src="file" class="file">
+    </template>
+  </span>
 </template>
 
 <script>
 import { mapGetters } from 'vuex'
 const path = process.env.VUE_APP_BASE_API
 export default {
-    name: "customPic",
-    props: {
-        picType: {
-            type: String,
-            required: false,
-            default: "avatar"
-        },
-        picSrc: {
-            type: String,
-            required: false,
-            default: ""
-        }
+  name: 'CustomPic',
+  props: {
+    picType: {
+      type: String,
+      required: false,
+      default: 'avatar'
     },
-    data(){
-        return{
-            path: path + '/',
+    picSrc: {
+      type: String,
+      required: false,
+      default: ''
+    }
+  },
+  data() {
+    return {
+      path: path + '/'
+    }
+  },
+  computed: {
+    ...mapGetters('user', ['userInfo']),
+    avatar() {
+      if (this.picSrc === '') {
+        if (this.userInfo.headerImg !== '' && this.userInfo.headerImg.slice(0, 4) === 'http') {
+          return this.userInfo.headerImg
         }
-    },
-    computed:{
-        ...mapGetters('user', ['userInfo']),
-        avatar(){
-            if(this.picSrc === ''){
-                if(this.userInfo.headerImg !== '' && this.userInfo.headerImg.slice(0, 4) === "http"){
-                    return this.userInfo.headerImg
-                }
-                return this.path + this.userInfo.headerImg
-            }else{
-                if(this.picSrc !== '' && this.picSrc.slice(0, 4) === "http"){
-                    return this.picSrc
-                }
-                return this.path + this.picSrc
-            }
-        },
-        file(){
-            if(this.picSrc && this.picSrc.slice(0, 4) !== "http"){
-                return this.path + this.picSrc
-            }
-            return this.picSrc
+        return this.path + this.userInfo.headerImg
+      } else {
+        if (this.picSrc !== '' && this.picSrc.slice(0, 4) === 'http') {
+          return this.picSrc
         }
+        return this.path + this.picSrc
+      }
+    },
+    file() {
+      if (this.picSrc && this.picSrc.slice(0, 4) !== 'http') {
+        return this.path + this.picSrc
+      }
+      return this.picSrc
     }
+  }
 }
 </script>
 

+ 25 - 26
web/src/components/upload/image.vue

@@ -4,8 +4,6 @@
     <upload-image v-model="imageUrl" :fileSize="512" />
     已上传文件 {{ imageUrl }}
   </div>
-
-
 -->
 
 <template>
@@ -19,62 +17,63 @@
       :before-upload="beforeImageUpload"
       :multiple="false"
     >
-      <img v-if="imageUrl" :src="path + imageUrl" class="image" />
-      <i v-else class="el-icon-plus image-uploader-icon"></i>
+      <img v-if="imageUrl" :src="path + imageUrl" class="image">
+      <i v-else class="el-icon-plus image-uploader-icon" />
     </el-upload>
   </div>
 </template>
+
 <script>
-const path = process.env.VUE_APP_BASE_API;
-import { mapGetters } from "vuex";
-import ImageCompress from "@/utils/image.js";
+const path = process.env.VUE_APP_BASE_API
+import { mapGetters } from 'vuex'
+import ImageCompress from '@/utils/image'
 export default {
-  name: "upload-image",
+  name: 'UploadImage',
   model: {
-    prop: "imageUrl",
-    event: "change",
+    prop: 'imageUrl',
+    event: 'change'
   },
   props: {
     imageUrl: {
       type: String,
-      default: "",
+      default: ''
     },
     fileSize: {
       type: Number,
-      default: 2048, // 2M 超出后执行压缩
+      default: 2048 // 2M 超出后执行压缩
     },
     maxWH: {
       type: Number,
-      default: 1920, // 图片长宽上限
-    },
+      default: 1920 // 图片长宽上限
+    }
   },
   data() {
     return {
-      path: path,
-    };
+      path: path
+    }
   },
   computed: {
-    ...mapGetters("user", ["userInfo", "token"]),
+    ...mapGetters('user', ['userInfo', 'token'])
   },
   methods: {
     beforeImageUpload(file) {
-      let isRightSize = file.size / 1024 < this.fileSize;
+      const isRightSize = file.size / 1024 < this.fileSize
       if (!isRightSize) {
         // 压缩
-        let compress = new ImageCompress(file, this.fileSize, this.maxWH);
-        return compress.compress();
+        const compress = new ImageCompress(file, this.fileSize, this.maxWH)
+        return compress.compress()
       }
-      return isRightSize;
+      return isRightSize
     },
     handleImageSuccess(res) {
       // this.imageUrl = URL.createObjectURL(file.raw);
-      const {  data } = res;
+      const { data } = res
       if (data.file) {
-        this.$emit("change", data.file.url);
+        this.$emit('change', data.file.url)
       }
-    },
-  },
-};
+    }
+  }
+}
 </script>
 
 <style lang="scss" scoped>

+ 34 - 34
web/src/directive/auth.js

@@ -1,39 +1,39 @@
 // 权限按钮展示指令
-import { store } from '@/store/index'
+import { store } from '@/store'
 export const auth = (Vue) => {
-    Vue.directive('auth', {
-        // 当被绑定的元素插入到 DOM 中时……
-        bind: function (el, binding) {
-          const userInfo = store.getters['user/userInfo']
-          let type = ""
-          switch (Object.prototype.toString.call(binding.value)) {
-            case "[object Array]":
-              type = "Array"
-              break;
-            case "[object String]":
-              type = "String"
-              break;
-            case "[object Number]":
-              type = "Number"
-              break;
-            default:
-              type = ""
-              break;
-          }
-          if (type === "") {
-            /* eslint-disable */
+  Vue.directive('auth', {
+    // 当被绑定的元素插入到 DOM 中时……
+    bind: function(el, binding) {
+      const userInfo = store.getters['user/userInfo']
+      let type = ''
+      switch (Object.prototype.toString.call(binding.value)) {
+        case '[object Array]':
+          type = 'Array'
+          break
+        case '[object String]':
+          type = 'String'
+          break
+        case '[object Number]':
+          type = 'Number'
+          break
+        default:
+          type = ''
+          break
+      }
+      if (type === '') {
+        /* eslint-disable */
             console.error("v-auth必须是Array,Number,String属性,暂不支持其他属性")
             /* eslint-enable */
-            return
-          }
-          const waitUse = binding.value.toString().split(",")
-          let flag = waitUse.some(item=>item==userInfo.authorityId)
-          if (binding.modifiers.not) {
-            flag = !flag
-          }
-          if(!flag){
-            el.style.display = 'none'
-          }
-        }
-      })
+        return
+      }
+      const waitUse = binding.value.toString().split(',')
+      let flag = waitUse.some(item => item === userInfo.authorityId)
+      if (binding.modifiers.not) {
+        flag = !flag
+      }
+      if (!flag) {
+        el.style.display = 'none'
+      }
+    }
+  })
 }

+ 113 - 115
web/src/main.js

@@ -3,112 +3,112 @@ import App from './App.vue'
 
 //  按需引入element
 import {
-    Button, 
-    Select, 
-    Dialog, 
-    Form, 
-    Input,
-    FormItem, 
-    Option, 
-    Loading, 
-    Message, 
-    Container, 
-    Card,
-    Dropdown,
-    DropdownMenu,
-    DropdownItem,
-    Row,
-    Col,
-    Menu,
-    Submenu,
-    MenuItem,
-    Aside,
-    Main,
-    Badge,
-    Header,
-    Tabs,
-    Breadcrumb,
-    BreadcrumbItem,
-    Scrollbar,
-    Avatar,
-    TabPane,
-    Divider,
-    Table,
-    TableColumn,
-    Cascader,
-    Checkbox,
-    CheckboxGroup,
-    Pagination,
-    Tag,
-    Drawer,
-    Tree,
-    Popover,
-    Switch,
-    Collapse,
-    CollapseItem,
-    Tooltip,
-    DatePicker,
-    InputNumber,
-    Steps,
-    Upload,
-    Progress,
-    MessageBox,
-    Image
-} from 'element-ui';
+  Button,
+  Select,
+  Dialog,
+  Form,
+  Input,
+  FormItem,
+  Option,
+  Loading,
+  Message,
+  Container,
+  Card,
+  Dropdown,
+  DropdownMenu,
+  DropdownItem,
+  Row,
+  Col,
+  Menu,
+  Submenu,
+  MenuItem,
+  Aside,
+  Main,
+  Badge,
+  Header,
+  Tabs,
+  Breadcrumb,
+  BreadcrumbItem,
+  Scrollbar,
+  Avatar,
+  TabPane,
+  Divider,
+  Table,
+  TableColumn,
+  Cascader,
+  Checkbox,
+  CheckboxGroup,
+  Pagination,
+  Tag,
+  Drawer,
+  Tree,
+  Popover,
+  Switch,
+  Collapse,
+  CollapseItem,
+  Tooltip,
+  DatePicker,
+  InputNumber,
+  Steps,
+  Upload,
+  Progress,
+  MessageBox,
+  Image
+} from 'element-ui'
 
-Vue.use(Button);
-Vue.use(Select);
-Vue.use(Dialog);
-Vue.use(Form);
-Vue.use(FormItem);
-Vue.use(Input);
-Vue.use(Option);
-Vue.use(Container);
-Vue.use(Card);
-Vue.use(Dropdown);
-Vue.use(DropdownMenu);
-Vue.use(DropdownItem);
-Vue.use(Row);
-Vue.use(Col);
-Vue.use(Menu);
-Vue.use(Submenu);
-Vue.use(MenuItem);
-Vue.use(Aside);
-Vue.use(Main);
-Vue.use(Badge);
-Vue.use(Header);
-Vue.use(Tabs);
-Vue.use(Breadcrumb);
-Vue.use(BreadcrumbItem);
-Vue.use(Avatar);
-Vue.use(TabPane);
-Vue.use(Divider);
-Vue.use(Table);
-Vue.use(TableColumn);
-Vue.use(Checkbox);
-Vue.use(Cascader);
-Vue.use(Tag);
-Vue.use(Pagination);
-Vue.use(Drawer);
-Vue.use(Tree);
-Vue.use(CheckboxGroup);
-Vue.use(Popover);
-Vue.use(InputNumber);
-Vue.use(Switch);
-Vue.use(Collapse);
-Vue.use(CollapseItem);
-Vue.use(Tooltip);
-Vue.use(DatePicker);
-Vue.use(Steps);
-Vue.use(Upload);
-Vue.use(Progress);
-Vue.use(Scrollbar);
-Vue.use(Loading.directive);
+Vue.use(Button)
+Vue.use(Select)
+Vue.use(Dialog)
+Vue.use(Form)
+Vue.use(FormItem)
+Vue.use(Input)
+Vue.use(Option)
+Vue.use(Container)
+Vue.use(Card)
+Vue.use(Dropdown)
+Vue.use(DropdownMenu)
+Vue.use(DropdownItem)
+Vue.use(Row)
+Vue.use(Col)
+Vue.use(Menu)
+Vue.use(Submenu)
+Vue.use(MenuItem)
+Vue.use(Aside)
+Vue.use(Main)
+Vue.use(Badge)
+Vue.use(Header)
+Vue.use(Tabs)
+Vue.use(Breadcrumb)
+Vue.use(BreadcrumbItem)
+Vue.use(Avatar)
+Vue.use(TabPane)
+Vue.use(Divider)
+Vue.use(Table)
+Vue.use(TableColumn)
+Vue.use(Checkbox)
+Vue.use(Cascader)
+Vue.use(Tag)
+Vue.use(Pagination)
+Vue.use(Drawer)
+Vue.use(Tree)
+Vue.use(CheckboxGroup)
+Vue.use(Popover)
+Vue.use(InputNumber)
+Vue.use(Switch)
+Vue.use(Collapse)
+Vue.use(CollapseItem)
+Vue.use(Tooltip)
+Vue.use(DatePicker)
+Vue.use(Steps)
+Vue.use(Upload)
+Vue.use(Progress)
+Vue.use(Scrollbar)
+Vue.use(Loading.directive)
 Vue.use(Image)
 
-Vue.prototype.$loading = Loading.service;
-Vue.prototype.$message = Message;
-Vue.prototype.$confirm = MessageBox.confirm;
+Vue.prototype.$loading = Loading.service
+Vue.prototype.$message = Message
+Vue.prototype.$confirm = MessageBox.confirm
 Dialog.props.closeOnClickModal.default = false
 
 // 引入封装的router
@@ -118,20 +118,19 @@ import router from '@/router/index'
 import '../node_modules/timeline-vuejs/dist/timeline-vuejs.css'
 
 import '@/permission'
-import { store } from '@/store/index'
+import { store } from '@/store'
 Vue.config.productionTip = false
 
 // 路由守卫
-import Bus from '@/utils/bus.js'
+import Bus from '@/utils/bus'
 Vue.use(Bus)
 
-import APlayer from '@moefe/vue-aplayer';
+import APlayer from '@moefe/vue-aplayer'
 
 Vue.use(APlayer, {
-    defaultCover: 'https://github.com/u3u.png',
-    productionTip: true,
-});
-
+  defaultCover: 'https://github.com/u3u.png',
+  productionTip: true
+})
 
 import { auth } from '@/directive/auth'
 // 按钮权限指令
@@ -141,12 +140,11 @@ import uploader from 'vue-simple-uploader'
 Vue.use(uploader)
 
 export default new Vue({
-    render: h => h(App),
-    router,
-    store
+  render: h => h(App),
+  router,
+  store
 }).$mount('#app')
 
-
 console.log(`
        欢迎使用 Gin-Vue-Admin
        当前版本:V2.4.2
@@ -154,4 +152,4 @@ console.log(`
        默认自动化文档地址:http://127.0.0.1:${process.env.VUE_APP_SERVER_PORT}/swagger/index.html
        默认前端文件运行地址:http://127.0.0.1:${process.env.VUE_APP_CLI_PORT}
        如果项目让您获得了收益,希望您能请团队喝杯可乐:https://www.gin-vue-admin.com/docs/coffee
-`)
+`)

+ 37 - 37
web/src/mixins/infoList.js

@@ -1,40 +1,40 @@
-import { getDict } from "@/utils/dictionary";
+import { getDict } from '@/utils/dictionary'
 export default {
-    data() {
-        return {
-            page: 1,
-            total: 10,
-            pageSize: 10,
-            tableData: [],
-            searchInfo: {}
-        }
+  data() {
+    return {
+      page: 1,
+      total: 10,
+      pageSize: 10,
+      tableData: [],
+      searchInfo: {}
+    }
+  },
+  methods: {
+    filterDict(value, type) {
+      const rowLabel = this[type + 'Options'] && this[type + 'Options'].filter(item => item.value === value)
+      return rowLabel && rowLabel[0] && rowLabel[0].label
+    },
+    async getDict(type) {
+      const dicts = await getDict(type)
+      this[type + 'Options'] = dicts
+      return dicts
+    },
+    handleSizeChange(val) {
+      this.pageSize = val
+      this.getTableData()
+    },
+    handleCurrentChange(val) {
+      this.page = val
+      this.getTableData()
     },
-    methods: {
-        filterDict(value, type) {
-            const rowLabel = this[type + "Options"] && this[type + "Options"].filter(item => item.value == value)
-            return rowLabel && rowLabel[0] && rowLabel[0].label
-        },
-        async getDict(type) {
-            const dicts = await getDict(type)
-            this[type + "Options"] = dicts
-            return dicts
-        },
-        handleSizeChange(val) {
-            this.pageSize = val
-            this.getTableData()
-        },
-        handleCurrentChange(val) {
-            this.page = val
-            this.getTableData()
-        },
-        async getTableData(page = this.page, pageSize = this.pageSize) {
-            const table = await this.listApi({ page, pageSize, ...this.searchInfo })
-            if (table.code == 0) {
-                this.tableData = table.data.list
-                this.total = table.data.total
-                this.page = table.data.page
-                this.pageSize = table.data.pageSize
-            }
-        }
+    async getTableData(page = this.page, pageSize = this.pageSize) {
+      const table = await this.listApi({ page, pageSize, ...this.searchInfo })
+      if (table.code === 0) {
+        this.tableData = table.data.list
+        this.total = table.data.total
+        this.page = table.data.page
+        this.pageSize = table.data.pageSize
+      }
     }
-}
+  }
+}

+ 38 - 38
web/src/permission.js

@@ -1,47 +1,47 @@
 import router from './router'
-import { store } from '@/store/index'
+import { store } from '@/store'
 import getPageTitle from '@/utils/page'
 
 let asyncRouterFlag = 0
 
-const whiteList = ['login', 'init']
-router.beforeEach(async (to, from, next) => {
-    const token = store.getters['user/token']
-    // 在白名单中的判断情况
-    //修改网页标签名称
-    document.title = getPageTitle(to.meta.title)
-    if (whiteList.indexOf(to.name) > -1) {
-        if (token) {
-            next({ name: store.getters["user/userInfo"].authority.defaultRouter })
-        } else {
-            next()
-        }
+const whiteList = ['Login', 'Init']
+router.beforeEach(async(to, from, next) => {
+  const token = store.getters['user/token']
+  // 在白名单中的判断情况
+  // 修改网页标签名称
+  document.title = getPageTitle(to.meta.title)
+  if (whiteList.indexOf(to.name) > -1) {
+    if (token) {
+      next({ name: store.getters['user/userInfo'].authority.defaultRouter })
     } else {
-        // 不在白名单中并且已经登陆的时候
-        if (token) {
-            // 添加flag防止多次获取动态路由和栈溢出
-            if (!asyncRouterFlag && store.getters['router/asyncRouters'].length == 0) {
-                asyncRouterFlag++
-                await store.dispatch('router/SetAsyncRouter')
-                const asyncRouters = store.getters['router/asyncRouters']
-                router.addRoutes(asyncRouters)
-                next({ ...to, replace: true })
-            } else {
-                if (to.matched.length) {
-                    next()
-                } else {
-                    next({ path: "/layout/404" })
-                }
-            }
+      next()
+    }
+  } else {
+    // 不在白名单中并且已经登陆的时候
+    if (token) {
+      // 添加flag防止多次获取动态路由和栈溢出
+      if (!asyncRouterFlag && store.getters['router/asyncRouters'].length === 0) {
+        asyncRouterFlag++
+        await store.dispatch('router/SetAsyncRouter')
+        const asyncRouters = store.getters['router/asyncRouters']
+        router.addRoutes(asyncRouters)
+        next({ ...to, replace: true })
+      } else {
+        if (to.matched.length) {
+          next()
+        } else {
+          next({ path: '/layout/404' })
         }
-        // 不在白名单中并且未登陆的时候
-        if (!token) {
-            next({
-                name: "login",
-                query: {
-                    redirect: document.location.hash
-                }
-            })
+      }
+    }
+    // 不在白名单中并且未登陆的时候
+    if (!token) {
+      next({
+        name: 'Login',
+        query: {
+          redirect: document.location.hash
         }
+      })
     }
-})
+  }
+})

+ 16 - 17
web/src/router/index.js

@@ -3,35 +3,34 @@ import Router from 'vue-router'
 
 Vue.use(Router)
 
-//获取原型对象上的push函数
+// 获取原型对象上的push函数
 const originalPush = Router.prototype.push
-//修改原型对象中的push方法
+// 修改原型对象中的push方法
 Router.prototype.push = function push(location) {
-    return originalPush.call(this, location).catch(err => err)
+  return originalPush.call(this, location).catch(err => err)
 }
 
-const baseRouters = [{
+const baseRouters = [
+  {
     path: '/',
     redirect: '/login'
-},
-{
-    path: "/init",
-    name: 'init',
-    component: () =>
-        import('@/view/init/init.vue')
-},
-{
+  },
+  {
+    path: '/init',
+    name: 'Init',
+    component: () => import('@/view/init/init')
+  },
+  {
     path: '/login',
-    name: 'login',
-    component: () =>
-        import('@/view/login/login.vue')
-}
+    name: 'Login',
+    component: () => import('@/view/login/login')
+  }
 ]
 
 // 需要通过后台数据来生成的组件
 
 const createRouter = () => new Router({
-    routes: baseRouters
+  routes: baseRouters
 })
 
 const router = createRouter()

+ 12 - 14
web/src/store/index.js

@@ -2,22 +2,20 @@ import Vue from 'vue'
 import Vuex from 'vuex'
 import VuexPersistence from 'vuex-persist'
 
-import { user } from "@/store/module/user"
-import { router } from "@/store/module/router"
-import { dictionary } from "@/store/module/dictionary"
+import { user } from '@/store/module/user'
+import { router } from '@/store/module/router'
+import { dictionary } from '@/store/module/dictionary'
 Vue.use(Vuex)
 
-
-
 const vuexLocal = new VuexPersistence({
-    storage: window.localStorage,
-    modules: ['user']
+  storage: window.localStorage,
+  modules: ['user']
 })
 export const store = new Vuex.Store({
-    modules: {
-        user,
-        router,
-        dictionary
-    },
-    plugins: [vuexLocal.plugin]
-})
+  modules: {
+    user,
+    router,
+    dictionary
+  },
+  plugins: [vuexLocal.plugin]
+})

+ 36 - 36
web/src/store/module/dictionary.js

@@ -1,42 +1,42 @@
 import { findSysDictionary } from '@/api/sysDictionary'
 
 export const dictionary = {
-    namespaced: true,
-    state: {
-        dictionaryMap: {},
-    },
-    mutations: {
-        setDictionaryMap(state, dictionaryMap) {
-            state.dictionaryMap = { ...state.dictionaryMap, ...dictionaryMap }
-        },
+  namespaced: true,
+  state: {
+    dictionaryMap: {}
+  },
+  mutations: {
+    setDictionaryMap(state, dictionaryMap) {
+      state.dictionaryMap = { ...state.dictionaryMap, ...dictionaryMap }
+    }
 
-    },
-    actions: {
-        // 从后台获取动态路由
-        async getDictionary({ commit, state }, type) {
-            if (state.dictionaryMap[type]) {
-                return state.dictionaryMap[type]
-            } else {
-                const res = await findSysDictionary({ type })
-                if (res.code == 0) {
-                    const dictionaryMap = {}
-                    const dict = []
-                    res.data.resysDictionary.sysDictionaryDetails && res.data.resysDictionary.sysDictionaryDetails.map(item => {
-                        dict.push({
-                            label: item.label,
-                            value: item.value
-                        })
-                    })
-                    dictionaryMap[res.data.resysDictionary.type] = dict
-                    commit("setDictionaryMap", dictionaryMap)
-                    return state.dictionaryMap[type]
-                }
-            }
-        }
-    },
-    getters:{
-        getDictionary(state){
-            return state.dictionaryMap
+  },
+  actions: {
+    // 从后台获取动态路由
+    async getDictionary({ commit, state }, type) {
+      if (state.dictionaryMap[type]) {
+        return state.dictionaryMap[type]
+      } else {
+        const res = await findSysDictionary({ type })
+        if (res.code === 0) {
+          const dictionaryMap = {}
+          const dict = []
+          res.data.resysDictionary.sysDictionaryDetails && res.data.resysDictionary.sysDictionaryDetails.map(item => {
+            dict.push({
+              label: item.label,
+              value: item.value
+            })
+          })
+          dictionaryMap[res.data.resysDictionary.type] = dict
+          commit('setDictionaryMap', dictionaryMap)
+          return state.dictionaryMap[type]
         }
+      }
+    }
+  },
+  getters: {
+    getDictionary(state) {
+      return state.dictionaryMap
     }
-}
+  }
+}

+ 68 - 69
web/src/store/module/router.js

@@ -1,83 +1,82 @@
-import { asyncRouterHandle } from '@/utils/asyncRouter';
+import { asyncRouterHandle } from '@/utils/asyncRouter'
 
 import { asyncMenu } from '@/api/menu'
 
 const routerList = []
 const formatRouter = (routes) => {
-    routes && routes.map(item => {
-        if ((!item.children || item.children.every(ch => ch.hidden)) && item.name != '404') {
-            routerList.push({ label: item.meta.title, value: item.name })
-        }
-        if (item.children && item.children.length > 0) {
-            formatRouter(item.children)
-        }
-    })
+  routes && routes.map(item => {
+    if ((!item.children || item.children.every(ch => ch.hidden)) && item.name !== '404') {
+      routerList.push({ label: item.meta.title, value: item.name })
+    }
+    if (item.children && item.children.length > 0) {
+      formatRouter(item.children)
+    }
+  })
 }
 
 export const router = {
-    namespaced: true,
-    state: {
-        asyncRouters: [],
-        routerList: routerList,
+  namespaced: true,
+  state: {
+    asyncRouters: [],
+    routerList: routerList
+  },
+  mutations: {
+    setRouterList(state, routerList) {
+      state.routerList = routerList
     },
-    mutations: {
-        setRouterList(state, routerList) {
-            state.routerList = routerList
+    // 设置动态路由
+    setAsyncRouter(state, asyncRouters) {
+      state.asyncRouters = asyncRouters
+    }
+  },
+  actions: {
+    // 从后台获取动态路由
+    async SetAsyncRouter({ commit }) {
+      const baseRouter = [{
+        path: '/layout',
+        name: 'layout',
+        component: 'view/layout/index.vue',
+        meta: {
+          title: '底层layout'
         },
-        // 设置动态路由
-        setAsyncRouter(state, asyncRouters) {
-            state.asyncRouters = asyncRouters
+        children: []
+      }]
+      const asyncRouterRes = await asyncMenu()
+      if (asyncRouterRes.code !== 0) {
+        return
+      }
+      const asyncRouter = asyncRouterRes.data && asyncRouterRes.data.menus
+      asyncRouter.push({
+        path: '404',
+        name: '404',
+        hidden: true,
+        meta: {
+          title: '迷路了*。*'
         },
+        component: 'view/error/index.vue'
+      })
+      formatRouter(asyncRouter)
+      baseRouter[0].children = asyncRouter
+      baseRouter.push({
+        path: '*',
+        redirect: '/layout/404'
+      })
+      asyncRouterHandle(baseRouter)
+      commit('setAsyncRouter', baseRouter)
+      commit('setRouterList', routerList)
+      return true
+    }
+  },
+  getters: {
+    // 获取动态路由
+    asyncRouters(state) {
+      return state.asyncRouters
     },
-    actions: {
-        // 从后台获取动态路由
-        async SetAsyncRouter({ commit }) {
-            const baseRouter = [{
-                path: '/layout',
-                name: 'layout',
-                component: "view/layout/index.vue",
-                meta: {
-                    title: "底层layout"
-                },
-                children: []
-            }]
-            const asyncRouterRes = await asyncMenu()
-            if(asyncRouterRes.code !=0){
-                return
-            }
-            const asyncRouter = asyncRouterRes.data&&asyncRouterRes.data.menus
-            asyncRouter.push({
-                path: "404",
-                name: "404",
-                hidden: true,
-                meta: {
-                    title: "迷路了*。*",
-                },
-                component: 'view/error/index.vue'
-            })
-            formatRouter(asyncRouter)
-            baseRouter[0].children = asyncRouter
-            baseRouter.push({
-                path: '*',
-                redirect: '/layout/404'
-
-            })
-            asyncRouterHandle(baseRouter)
-            commit('setAsyncRouter', baseRouter)
-            commit('setRouterList', routerList)
-            return true
-        }
+    routerList(state) {
+      return state.routerList
     },
-    getters: {
-        // 获取动态路由
-        asyncRouters(state) {
-            return state.asyncRouters
-        },
-        routerList(state) {
-            return state.routerList
-        },
-        defaultRouter(state) {
-            return state.defaultRouter
-        }
+    defaultRouter(state) {
+      return state.defaultRouter
     }
-}
+  }
+}

+ 70 - 71
web/src/store/module/user.js

@@ -2,78 +2,77 @@ import { login } from '@/api/user'
 import { jsonInBlacklist } from '@/api/jwt'
 import router from '@/router/index'
 export const user = {
-    namespaced: true,
-    state: {
-        userInfo: {
-            uuid: "",
-            nickName: "",
-            headerImg: "",
-            authority: "",
-        },
-        token: "",
+  namespaced: true,
+  state: {
+    userInfo: {
+      uuid: '',
+      nickName: '',
+      headerImg: '',
+      authority: ''
     },
-    mutations: {
-        setUserInfo(state, userInfo) {
-            // 这里的 `state` 对象是模块的局部状态
-            state.userInfo = userInfo
-        },
-        setToken(state, token) {
-            // 这里的 `state` 对象是模块的局部状态
-            state.token = token
-        },
-        NeedInit(state){
-            state.userInfo = {}
-            state.token = ""
-            sessionStorage.clear()
-            router.push({ name: 'init', replace: true })
-
-        },
-        LoginOut(state) {
-            state.userInfo = {}
-            state.token = ""
-            sessionStorage.clear()
-            router.push({ name: 'login', replace: true })
-            window.location.reload()
-        },
-        ResetUserInfo(state, userInfo = {}) {
-            state.userInfo = {...state.userInfo,
-                ...userInfo
-            }
-        }
+    token: ''
+  },
+  mutations: {
+    setUserInfo(state, userInfo) {
+      // 这里的 `state` 对象是模块的局部状态
+      state.userInfo = userInfo
     },
-    actions: {
-        async LoginIn({ commit, dispatch, rootGetters, getters }, loginInfo) {
-            const res = await login(loginInfo)
-            if (res.code == 0) {
-                commit('setUserInfo', res.data.user)
-                commit('setToken', res.data.token)
-                await dispatch('router/SetAsyncRouter', {}, { root: true })
-                const asyncRouters = rootGetters['router/asyncRouters']
-                router.addRoutes(asyncRouters)
-                // const redirect = router.history.current.query.redirect
-                // console.log(redirect)
-                // if (redirect) {
-                //     router.push({ path: redirect })
-                // } else {
-                    router.push({ name: getters["userInfo"].authority.defaultRouter })
-                // }
-                return true
-            }
-        },
-        async LoginOut({ commit }) {
-            const res = await jsonInBlacklist()
-            if (res.code == 0) {
-                commit("LoginOut")
-            }
-        }
+    setToken(state, token) {
+      // 这里的 `state` 对象是模块的局部状态
+      state.token = token
     },
-    getters: {
-        userInfo(state) {
-            return state.userInfo
-        },
-        token(state) {
-            return state.token
-        },
-
+    NeedInit(state) {
+      state.userInfo = {}
+      state.token = ''
+      sessionStorage.clear()
+      router.push({ name: 'Init', replace: true })
+    },
+    LoginOut(state) {
+      state.userInfo = {}
+      state.token = ''
+      sessionStorage.clear()
+      router.push({ name: 'Login', replace: true })
+      window.location.reload()
+    },
+    ResetUserInfo(state, userInfo = {}) {
+      state.userInfo = { ...state.userInfo,
+        ...userInfo
+      }
     }
-}
+  },
+  actions: {
+    async LoginIn({ commit, dispatch, rootGetters, getters }, loginInfo) {
+      const res = await login(loginInfo)
+      if (res.code === 0) {
+        commit('setUserInfo', res.data.user)
+        commit('setToken', res.data.token)
+        await dispatch('router/SetAsyncRouter', {}, { root: true })
+        const asyncRouters = rootGetters['router/asyncRouters']
+        router.addRoutes(asyncRouters)
+        // const redirect = router.history.current.query.redirect
+        // console.log(redirect)
+        // if (redirect) {
+        //     router.push({ path: redirect })
+        // } else {
+        router.push({ name: getters['userInfo'].authority.defaultRouter })
+        // }
+        return true
+      }
+    },
+    async LoginOut({ commit }) {
+      const res = await jsonInBlacklist()
+      if (res.code === 0) {
+        commit('LoginOut')
+      }
+    }
+  },
+  getters: {
+    userInfo(state) {
+      return state.userInfo
+    },
+    token(state) {
+      return state.token
+    }
+
+  }
+}

+ 2 - 2
web/src/utils/_import.js

@@ -1,3 +1,3 @@
 module.exports = file => () => {
-    return import ('@/' + file)
-}
+  return import ('@/' + file)
+}

+ 12 - 12
web/src/utils/asyncRouter.js

@@ -1,13 +1,13 @@
-const _import = require('./_import') //获取组件的方法
+const _import = require('./_import') // 获取组件的方法
 export const asyncRouterHandle = (asyncRouter) => {
-    asyncRouter.map(item => {
-        if (item.component) {
-            item.component = _import(item.component)
-        } else {
-            delete item['component']
-        }
-        if (item.children) {
-            asyncRouterHandle(item.children)
-        }
-    })
-}
+  asyncRouter.map(item => {
+    if (item.component) {
+      item.component = _import(item.component)
+    } else {
+      delete item['component']
+    }
+    if (item.children) {
+      asyncRouterHandle(item.children)
+    }
+  })
+}

+ 15 - 15
web/src/utils/bus.js

@@ -1,18 +1,18 @@
 const install = (Vue) => {
-    const Bus = new Vue({
-        methods: {
-            emit(event, ...args) {
-                this.$emit(event, ...args)
-            },
-            on(event, cb) {
-                this.$on(event, cb)
-            },
-            off(event, cb) {
-                this.$off(event, cb)
-            }
-        },
-    })
-    Vue.prototype.$bus = Bus
+  const Bus = new Vue({
+    methods: {
+      emit(event, ...args) {
+        this.$emit(event, ...args)
+      },
+      on(event, cb) {
+        this.$on(event, cb)
+      },
+      off(event, cb) {
+        this.$off(event, cb)
+      }
+    }
+  })
+  Vue.prototype.$bus = Bus
 }
 
-export default install
+export default install

+ 21 - 21
web/src/utils/date.js

@@ -3,28 +3,28 @@
 // 年(y)可以用 1-4 个占位符,毫秒(S)只能用 1 个占位符(是 1-3 位的数字)
 // (new Date()).Format("yyyy-MM-dd hh:mm:ss.S") ==> 2006-07-02 08:09:04.423
 // (new Date()).Format("yyyy-M-d h:m:s.S")      ==> 2006-7-2 8:9:4.18
+// eslint-disable-next-line no-extend-native
 Date.prototype.Format = function(fmt) {
-    var o = {
-        "M+": this.getMonth() + 1, //月份
-        "d+": this.getDate(), //日
-        "h+": this.getHours(), //小时
-        "m+": this.getMinutes(), //分
-        "s+": this.getSeconds(), //秒
-        "q+": Math.floor((this.getMonth() + 3) / 3), //季度
-        "S": this.getMilliseconds() //毫秒
-    };
-    if (/(y+)/.test(fmt))
-        fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
-    for (var k in o)
-        if (new RegExp("(" + k + ")").test(fmt))
-            fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
-    return fmt;
+  var o = {
+    'M+': this.getMonth() + 1, // 月份
+    'd+': this.getDate(), // 日
+    'h+': this.getHours(), // 小时
+    'm+': this.getMinutes(), // 分
+    's+': this.getSeconds(), // 秒
+    'q+': Math.floor((this.getMonth() + 3) / 3), // 季度
+    'S': this.getMilliseconds() // 毫秒
+  }
+  if (/(y+)/.test(fmt)) { fmt = fmt.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length)) }
+  for (var k in o) {
+    if (new RegExp('(' + k + ')').test(fmt)) { fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length))) }
+  }
+  return fmt
 }
 
 export function formatTimeToStr(times, pattern) {
-    var d = new Date(times).Format("yyyy-MM-dd hh:mm:ss");
-    if (pattern) {
-        d = new Date(times).Format(pattern);
-    }
-    return d.toLocaleString();
-}
+  var d = new Date(times).Format('yyyy-MM-dd hh:mm:ss')
+  if (pattern) {
+    d = new Date(times).Format(pattern)
+  }
+  return d.toLocaleString()
+}

+ 5 - 5
web/src/utils/dictionary.js

@@ -1,6 +1,6 @@
-import { store } from '@/store/index'
+import { store } from '@/store'
 //  获取字典方法 使用示例 getDict('sex').then(res)  或者 async函数下 const res = await getDict('sex')
-export const getDict = async (type) => {
-    await store.dispatch("dictionary/getDictionary", type)
-    return store.getters["dictionary/getDictionary"][type]
-}
+export const getDict = async(type) => {
+  await store.dispatch('dictionary/getDictionary', type)
+  return store.getters['dictionary/getDictionary'][type]
+}

+ 18 - 18
web/src/utils/downloadImg.js

@@ -1,19 +1,19 @@
-export const downloadImage = (imgsrc, name) => { //下载图片地址和图片名
-    var image = new Image();
-    image.setAttribute("crossOrigin", "anonymous");
-    image.onload = function() {
-        var canvas = document.createElement("canvas");
-        canvas.width = image.width;
-        canvas.height = image.height;
-        var context = canvas.getContext("2d");
-        context.drawImage(image, 0, 0, image.width, image.height);
-        var url = canvas.toDataURL("image/png"); //得到图片的base64编码数据
+export const downloadImage = (imgsrc, name) => { // 下载图片地址和图片名
+  var image = new Image()
+  image.setAttribute('crossOrigin', 'anonymous')
+  image.onload = function() {
+    var canvas = document.createElement('canvas')
+    canvas.width = image.width
+    canvas.height = image.height
+    var context = canvas.getContext('2d')
+    context.drawImage(image, 0, 0, image.width, image.height)
+    var url = canvas.toDataURL('image/png') // 得到图片的base64编码数据
 
-        var a = document.createElement("a"); // 生成一个a元素
-        var event = new MouseEvent("click"); // 创建一个单击事件
-        a.download = name || "photo"; // 设置图片名称
-        a.href = url; // 将生成的URL设置为a.href属性
-        a.dispatchEvent(event); // 触发a的单击事件
-    };
-    image.src = imgsrc;
-}
+    var a = document.createElement('a') // 生成一个a元素
+    var event = new MouseEvent('click') // 创建一个单击事件
+    a.download = name || 'photo' // 设置图片名称
+    a.href = url // 将生成的URL设置为a.href属性
+    a.dispatchEvent(event) // 触发a的单击事件
+  }
+  image.src = imgsrc
+}

+ 80 - 82
web/src/utils/image.js

@@ -1,94 +1,92 @@
 export default class ImageCompress {
-    constructor(file, fileSize, maxWH = 1920) {
-        this.file = file
-        this.fileSize = fileSize
-        this.maxWH = maxWH // 最大长宽
-    }
-
-    compress() {
-        // 压缩
-        const fileType = this.file.type
-        const fileSize = this.file.size / 1024
-        return new Promise(resolve => {
-            const reader = new FileReader();
-            reader.readAsDataURL(this.file);
-            reader.onload = () => {
-                const canvas = document.createElement('canvas');
-                const img = document.createElement('img');
-                img.src = reader.result;
-                img.onload = () => {
-                    const ctx = canvas.getContext('2d');
-                    let _dWH = this.dWH(img.width, img.height, this.maxWH)
-                    canvas.width = _dWH.width
-                    canvas.height = _dWH.height
-
-                    // 清空后, 重写画布
-                    ctx.clearRect(0, 0, canvas.width, canvas.height)
-                    ctx.drawImage(img, 0, 0, canvas.width, canvas.height)
+  constructor(file, fileSize, maxWH = 1920) {
+    this.file = file
+    this.fileSize = fileSize
+    this.maxWH = maxWH // 最大长宽
+  }
 
-                    let newImgData = canvas.toDataURL(fileType, 0.90)
+  compress() {
+    // 压缩
+    const fileType = this.file.type
+    const fileSize = this.file.size / 1024
+    return new Promise(resolve => {
+      const reader = new FileReader()
+      reader.readAsDataURL(this.file)
+      reader.onload = () => {
+        const canvas = document.createElement('canvas')
+        const img = document.createElement('img')
+        img.src = reader.result
+        img.onload = () => {
+          const ctx = canvas.getContext('2d')
+          const _dWH = this.dWH(img.width, img.height, this.maxWH)
+          canvas.width = _dWH.width
+          canvas.height = _dWH.height
 
-                    // 压缩宽高后的图像大小
-                    let newImgSize = this.fileSizeKB(newImgData)
+          // 清空后, 重写画布
+          ctx.clearRect(0, 0, canvas.width, canvas.height)
+          ctx.drawImage(img, 0, 0, canvas.width, canvas.height)
 
-                    if (newImgSize > this.fileSize) {
-                        console.log('图片尺寸太大!' + fileSize + " >> " + newImgSize)
-                    }
+          const newImgData = canvas.toDataURL(fileType, 0.90)
 
-                    let blob = this.dataURLtoBlob(newImgData, fileType)
-                    let nfile = new File([blob], this.file.name);
-                    resolve(nfile)
-                };
-            };
-        });
-    }
+          // 压缩宽高后的图像大小
+          const newImgSize = this.fileSizeKB(newImgData)
 
-    /*
-     * 长宽等比缩小
-     * 图像的一边(长或宽)为最大目标值
-     * */
-    dWH(srcW, srcH, dMax) {
+          if (newImgSize > this.fileSize) {
+            console.log('图片尺寸太大!' + fileSize + ' >> ' + newImgSize)
+          }
 
-        let defaults = {
-            width: srcW,
-            height: srcH
-        }
-        if (Math.max(srcW, srcH) > dMax) {
-            if (srcW > srcH) {
-                defaults.width = dMax
-                defaults.height = Math.round(srcH * (dMax / srcW))
-                return defaults
-            } else {
-                defaults.height = dMax
-                defaults.width = Math.round(srcW * (dMax / srcH))
-                return defaults
-            }
-        } else {
-            return defaults
+          const blob = this.dataURLtoBlob(newImgData, fileType)
+          const nfile = new File([blob], this.file.name)
+          resolve(nfile)
         }
-    }
+      }
+    })
+  }
 
-    fileSizeKB(dataURL) {
-        let sizeKB = 0
-        sizeKB = Math.round((dataURL.split(',')[1].length * 3 / 4) / 1024)
-        return sizeKB
+  /**
+   * 长宽等比缩小
+   * 图像的一边(长或宽)为最大目标值
+   */
+  dWH(srcW, srcH, dMax) {
+    const defaults = {
+      width: srcW,
+      height: srcH
     }
-
-    /*
-     * 转为Blob
-     * */
-    dataURLtoBlob(dataURL, fileType) {
-        let byteString = atob(dataURL.split(',')[1])
-        let mimeString = dataURL.split(',')[0].split(':')[1].split(';')[0]
-        let ab = new ArrayBuffer(byteString.length)
-        let ia = new Uint8Array(ab)
-        for (let i = 0; i < byteString.length; i++) {
-            ia[i] = byteString.charCodeAt(i)
-        }
-        if (fileType) {
-            mimeString = fileType
-        }
-        return new Blob([ab], { type: mimeString, lastModifiedDate: new Date() })
+    if (Math.max(srcW, srcH) > dMax) {
+      if (srcW > srcH) {
+        defaults.width = dMax
+        defaults.height = Math.round(srcH * (dMax / srcW))
+        return defaults
+      } else {
+        defaults.height = dMax
+        defaults.width = Math.round(srcW * (dMax / srcH))
+        return defaults
+      }
+    } else {
+      return defaults
     }
+  }
 
-}
+  fileSizeKB(dataURL) {
+    let sizeKB = 0
+    sizeKB = Math.round((dataURL.split(',')[1].length * 3 / 4) / 1024)
+    return sizeKB
+  }
+
+  /**
+   * 转为Blob
+   */
+  dataURLtoBlob(dataURL, fileType) {
+    const byteString = atob(dataURL.split(',')[1])
+    let mimeString = dataURL.split(',')[0].split(':')[1].split(';')[0]
+    const ab = new ArrayBuffer(byteString.length)
+    const ia = new Uint8Array(ab)
+    for (let i = 0; i < byteString.length; i++) {
+      ia[i] = byteString.charCodeAt(i)
+    }
+    if (fileType) {
+      mimeString = fileType
+    }
+    return new Blob([ab], { type: mimeString, lastModifiedDate: new Date() })
+  }
+}

+ 5 - 5
web/src/utils/page.js

@@ -1,8 +1,8 @@
 const title = 'GIN-VUE-ADMIN'
 
 export default function getPageTitle(pageTitle) {
-    if (pageTitle) {
-        return `${pageTitle} - ${title}`
-    }
-    return `${title}`
-}
+  if (pageTitle) {
+    return `${pageTitle} - ${title}`
+  }
+  return `${title}`
+}

+ 81 - 82
web/src/utils/request.js

@@ -1,103 +1,102 @@
-import axios from 'axios'; // 引入axios
-import { Message } from 'element-ui';
-import { store } from '@/store/index'
-import context from '@/main.js'
+import axios from 'axios' // 引入axios
+import { Message } from 'element-ui'
+import { store } from '@/store'
+import context from '@/main'
 import router from '@/router/index'
 
 const service = axios.create({
-    baseURL: process.env.VUE_APP_BASE_API,
-    timeout: 99999
+  baseURL: process.env.VUE_APP_BASE_API,
+  timeout: 99999
 })
 let acitveAxios = 0
 let timer
 const showLoading = () => {
-    acitveAxios++
-    if (timer) {
-        clearTimeout(timer)
+  acitveAxios++
+  if (timer) {
+    clearTimeout(timer)
+  }
+  timer = setTimeout(() => {
+    if (acitveAxios > 0) {
+      context.$bus.emit('showLoading')
     }
-    timer = setTimeout(() => {
-        if (acitveAxios > 0) {
-            context.$bus.emit("showLoading")
-        }
-    }, 400);
+  }, 400)
 }
 
 const closeLoading = () => {
-        acitveAxios--
-        if (acitveAxios <= 0) {
-            clearTimeout(timer)
-            context.$bus.emit("closeLoading")
-        }
-    }
-    //http request 拦截器
+  acitveAxios--
+  if (acitveAxios <= 0) {
+    clearTimeout(timer)
+    context.$bus.emit('closeLoading')
+  }
+}
+// http request 拦截器
 service.interceptors.request.use(
-    config => {
-        if (!config.donNotShowLoading) {
-            showLoading()
-        }
-        const token = store.getters['user/token']
-        const user = store.getters['user/userInfo']
-        config.data = JSON.stringify(config.data);
-        config.headers = {
-            'Content-Type': 'application/json',
-            'x-token': token,
-            'x-user-id': user.ID
-        }
-        return config;
-    },
-    error => {
-        closeLoading()
-        Message({
-            showClose: true,
-            message: error,
-            type: 'error'
-        })
-        return error;
+  config => {
+    if (!config.donNotShowLoading) {
+      showLoading()
     }
-);
-
+    const token = store.getters['user/token']
+    const user = store.getters['user/userInfo']
+    config.data = JSON.stringify(config.data)
+    config.headers = {
+      'Content-Type': 'application/json',
+      'x-token': token,
+      'x-user-id': user.ID
+    }
+    return config
+  },
+  error => {
+    closeLoading()
+    Message({
+      showClose: true,
+      message: error,
+      type: 'error'
+    })
+    return error
+  }
+)
 
-//http response 拦截器
+// http response 拦截器
 service.interceptors.response.use(
-    response => {
-        closeLoading()
+  response => {
+    closeLoading()
 
-        if (response.headers["new-token"]) {
-            store.commit('user/setToken', response.headers["new-token"])
-        }
-        if(response.data.code == 0){
-            if(response.data.data?.needInit){
-                Message({
-                    type:"info",
-                    message:"您是第一次使用,请初始化"
-                })
-                    store.commit("user/NeedInit")
-                    router.push({name:"init"})
-            }
-        }
-        if (response.data.code == 0 || response.headers.success === "true") {
-            return response.data
-        } else {
-            Message({
-                showClose: true,
-                message: response.data.msg || decodeURI(response.headers.msg),
-                type: response.headers.msgtype||'error',
-            })
-            if (response.data.data && response.data.data.reload) {
-                store.commit('user/LoginOut')
-            }
-            return response.data.msg ? response.data : response
-        }
-    },
-    error => {
-        closeLoading()
+    if (response.headers['new-token']) {
+      store.commit('user/setToken', response.headers['new-token'])
+    }
+    if (response.data.code === 0) {
+      if (response.data.data?.needInit) {
         Message({
-            showClose: true,
-            message: error,
-            type: 'error'
+          type: 'info',
+          message: '您是第一次使用,请初始化'
         })
-        return error
+        store.commit('user/NeedInit')
+        router.push({ name: 'Init' })
+      }
+    }
+    if (response.data.code === 0 || response.headers.success === 'true') {
+      return response.data
+    } else {
+      Message({
+        showClose: true,
+        message: response.data.msg || decodeURI(response.headers.msg),
+        type: response.headers.msgtype || 'error'
+      })
+      if (response.data.data && response.data.data.reload) {
+        store.commit('user/LoginOut')
+      }
+      return response.data.msg ? response.data : response
     }
+  },
+  error => {
+    closeLoading()
+    Message({
+      showClose: true,
+      message: error,
+      type: 'error'
+    })
+    return error
+  }
 )
 
-export default service
+export default service

+ 3 - 3
web/src/utils/stringFun.js

@@ -3,7 +3,7 @@ export const toUpperCase = (str) => {
     if (str[0]) {
         return str.replace(str[0], str[0].toUpperCase())
     } else {
-        return ""
+        return ''
     }
 }
 
@@ -11,13 +11,13 @@ export const toLowerCase = (str) => {
     if (str[0]) {
         return str.replace(str[0], str[0].toLowerCase())
     } else {
-        return ""
+        return ''
     }
 }
 
 // 驼峰转换下划线
 export const toSQLLine = (str) => {
-    if (str == "ID") return "ID"
+    if (str === 'ID') return 'ID'
     return str.replace(/([A-Z])/g, "_$1").toLowerCase();
 }
 

+ 41 - 35
web/src/view/about/index.vue

@@ -12,7 +12,7 @@
                     class="org-img dom-center"
                     src="@/assets/logo.png"
                     alt="gin-vue-admin"
-                  />
+                  >
                 </a>
               </el-col>
             </el-row>
@@ -23,7 +23,7 @@
                     class="dom-center"
                     src="https://img.shields.io/github/watchers/flipped-aurora/gin-vue-admin.svg?label=Watch"
                     alt=""
-                  />
+                  >
                 </a>
               </el-col>
               <el-col :span="8">
@@ -31,15 +31,19 @@
                   <img
                     class="dom-center"
                     src="https://img.shields.io/github/stars/flipped-aurora/gin-vue-admin.svg?style=social"
-                    alt=""/></a
-              ></el-col>
+                    alt=""
+                  >
+                </a>
+              </el-col>
               <el-col :span="8">
                 <a href="https://github.com/flipped-aurora/gin-vue-admin">
                   <img
                     class="dom-center"
                     src="https://img.shields.io/github/forks/flipped-aurora/gin-vue-admin.svg?label=Fork"
-                    alt=""/></a
-              ></el-col>
+                    alt=""
+                  >
+                </a>
+              </el-col>
             </el-row>
           </div>
         </el-card>
@@ -53,15 +57,15 @@
                     class="org-img dom-center"
                     src="@/assets/flipped-aurora.png"
                     alt="flipped-aurora"
-                  />
+                  >
                 </a>
               </el-col>
             </el-row>
             <el-row style="margin-left: 40px" :gutter="20">
               <template v-for="(item, index) in members">
-                <el-col :span="8" :key="index">
+                <el-col :key="index" :span="8">
                   <a :href="item.html_url">
-                    <img class="avatar-img" :src="item.avatar_url" />
+                    <img class="avatar-img" :src="item.avatar_url">
                     <a class="author-name" style="">{{ item.login }}</a>
                   </a>
                 </el-col>
@@ -79,16 +83,18 @@
             <Timeline
               :timeline-items="dataTimeline"
               :message-when-no-items="messageWhenNoItems"
-              :uniqueTimeline="true"
+              :unique-timeline="true"
               :unique-year="true"
               :show-day-and-month="true"
               order="desc"
-              dateLocale="zh-CN"
+              date-locale="zh-CN"
             />
           </div>
-          <el-button class="load-more" @click="loadMore" type="text"
-            >Load more</el-button
-          >
+          <el-button
+            class="load-more"
+            type="text"
+            @click="loadMore"
+          >Load more</el-button>
         </el-card>
       </el-col>
     </el-row>
@@ -96,29 +102,29 @@
 </template>
 
 <script>
-import { Commits, Members } from "@/api/github";
-import Timeline from "timeline-vuejs";
+import { Commits, Members } from '@/api/github'
+import Timeline from 'timeline-vuejs'
 export default {
-  name: "Test",
+  name: 'About',
   components: {
-    Timeline,
+    Timeline
   },
   data() {
     return {
-      messageWhenNoItems: "There arent commits",
+      messageWhenNoItems: 'There arent commits',
       members: [],
       dataTimeline: [],
-      page: 0,
-    };
+      page: 0
+    }
   },
   created() {
-    this.loadCommits();
-    this.loadMembers();
+    this.loadCommits()
+    this.loadMembers()
   },
   methods: {
     loadMore() {
-      this.page++;
-      this.loadCommits();
+      this.page++
+      this.loadCommits()
     },
     loadCommits() {
       Commits(this.page).then(({ data }) => {
@@ -128,20 +134,20 @@ export default {
               from: new Date(element.commit.author.date),
               title: element.commit.author.name,
               showDayAndMonth: true,
-              description: `<a style="color: #26191b" href="${element.html_url}">${element.commit.message}</a>`,
-            });
+              description: `<a style="color: #26191b" href="${element.html_url}">${element.commit.message}</a>`
+            })
           }
-        });
-      });
+        })
+      })
     },
     loadMembers() {
       Members().then(({ data }) => {
-        this.members = data;
-        this.members.sort();
-      });
-    },
-  },
-};
+        this.members = data
+        this.members.sort()
+      })
+    }
+  }
+}
 </script>
 
 <style scoped>

+ 35 - 39
web/src/view/dashboard/component/musicPlayer.vue

@@ -1,48 +1,44 @@
 <template>
-    <div>
-        <div style="width: 100%">
-            <APlayer :audio="audio"></APlayer>
-        </div>
+  <div>
+    <div style="width: 100%">
+      <APlayer :audio="audio" />
     </div>
+  </div>
 </template>
 
 <script>
-    import { APlayer } from '@moefe/vue-aplayer';
-    export default {
-        name: "musicPlayer",
-        components:{
-            APlayer
+import { APlayer } from '@moefe/vue-aplayer'
+export default {
+  name: 'MusicPlayer',
+  components: {
+    APlayer
+  },
+  data() {
+    return {
+      audio: [
+        {
+          name: '东西(Cover:林俊呈)',
+          artist: '纳豆',
+          url: 'http://music.163.com/song/media/outer/url?id=1321594530.mp3',
+          cover: 'https://p1.music.126.net/5zs7IvmLv7KahY3BFzUmrg==/109951163635241613.jpg?param=300y300', // prettier-ignore
+          lrc: 'https://cdn.moefe.org/music/lrc/thing.lrc'
         },
-        data(){
-            return {
-                audio :[
-                    {
-                        name: '东西(Cover:林俊呈)',
-                        artist: '纳豆',
-                        url: 'http://music.163.com/song/media/outer/url?id=1321594530.mp3',
-                        cover: 'https://p1.music.126.net/5zs7IvmLv7KahY3BFzUmrg==/109951163635241613.jpg?param=300y300', // prettier-ignore
-                        lrc: 'https://cdn.moefe.org/music/lrc/thing.lrc',
-                    },
-                    {
-                        name: '响喜乱舞(Cover:MARiA)',
-                        artist: '泠鸢yousa',
-                        url: 'http://music.163.com/song/media/outer/url?id=1318962459.mp3',
-                        cover: 'https://p1.music.126.net/AUGVPQ_rVrngDH9ocQrn3Q==/109951163613037822.jpg?param=300y300', // prettier-ignore
-                        lrc: 'https://cdn.moefe.org/music/lrc/kyoukiranbu.lrc',
-                    },
-                    {
-                        name: '啵唧',
-                        artist: 'Hanser',
-                        url: 'http://music.163.com/song/media/outer/url?id=1321424246.mp3',
-                        cover: 'https://p1.music.126.net/K0-IPcIQ9QFvA0jXTBqoWQ==/109951163636756693.jpg?param=300y300', // prettier-ignore
-                        lrc: 'https://cdn.moefe.org/music/lrc/kiss.lrc',
-                    },
-                ]
-            }
+        {
+          name: '响喜乱舞(Cover:MARiA)',
+          artist: '泠鸢yousa',
+          url: 'http://music.163.com/song/media/outer/url?id=1318962459.mp3',
+          cover: 'https://p1.music.126.net/AUGVPQ_rVrngDH9ocQrn3Q==/109951163613037822.jpg?param=300y300', // prettier-ignore
+          lrc: 'https://cdn.moefe.org/music/lrc/kyoukiranbu.lrc'
+        },
+        {
+          name: '啵唧',
+          artist: 'Hanser',
+          url: 'http://music.163.com/song/media/outer/url?id=1321424246.mp3',
+          cover: 'https://p1.music.126.net/K0-IPcIQ9QFvA0jXTBqoWQ==/109951163636756693.jpg?param=300y300', // prettier-ignore
+          lrc: 'https://cdn.moefe.org/music/lrc/kiss.lrc'
         }
+      ]
     }
+  }
+}
 </script>
-
-<style scoped>
-
-</style>

+ 75 - 75
web/src/view/dashboard/component/todoList/Todo.vue

@@ -1,81 +1,81 @@
 <template>
-    <li :class="{ completed: todo.done, editing: editing }" class="todo">
-        <div class="view">
-            <input
-                    :checked="todo.done"
-                    class="toggle"
-                    type="checkbox"
-                    @change="toggleTodo( todo)"
-            >
-            <label @dblclick="editing = true" v-text="todo.text" />
-            <button class="destroy" @click="deleteTodo( todo )" />
-        </div>
-        <input
-                v-show="editing"
-                v-focus="editing"
-                :value="todo.text"
-                class="edit"
-                @keyup.enter="doneEdit"
-                @keyup.esc="cancelEdit"
-                @blur="doneEdit"
-        >
-    </li>
+  <li :class="{ completed: todo.done, editing: editing }" class="todo">
+    <div class="view">
+      <input
+        :checked="todo.done"
+        class="toggle"
+        type="checkbox"
+        @change="toggleTodo( todo)"
+      >
+      <label @dblclick="editing = true" v-text="todo.text" />
+      <button class="destroy" @click="deleteTodo( todo )" />
+    </div>
+    <input
+      v-show="editing"
+      v-focus="editing"
+      :value="todo.text"
+      class="edit"
+      @keyup.enter="doneEdit"
+      @keyup.esc="cancelEdit"
+      @blur="doneEdit"
+    >
+  </li>
 </template>
 
 <script>
-    export default {
-        name: 'Todo',
-        directives: {
-            focus(el, { value }, { context }) {
-                if (value) {
-                    context.$nextTick(() => {
-                        el.focus()
-                    })
-                }
-            }
-        },
-        props: {
-            todo: {
-                type: Object,
-                default: function() {
-                    return {}
-                }
-            }
-        },
-        data() {
-            return {
-                editing: false
-            }
-        },
-        methods: {
-            deleteTodo(todo) {
-                this.$emit('deleteTodo', todo)
-            },
-            editTodo({ todo, value }) {
-                this.$emit('editTodo', { todo, value })
-            },
-            toggleTodo(todo) {
-                this.$emit('toggleTodo', todo)
-            },
-            doneEdit(e) {
-                const value = e.target.value.trim()
-                const { todo } = this
-                if (!value) {
-                    this.deleteTodo({
-                        todo
-                    })
-                } else if (this.editing) {
-                    this.editTodo({
-                        todo,
-                        value
-                    })
-                    this.editing = false
-                }
-            },
-            cancelEdit(e) {
-                e.target.value = this.todo.text
-                this.editing = false
-            }
-        }
+export default {
+  name: 'Todo',
+  directives: {
+    focus(el, { value }, { context }) {
+      if (value) {
+        context.$nextTick(() => {
+          el.focus()
+        })
+      }
     }
+  },
+  props: {
+    todo: {
+      type: Object,
+      default: function() {
+        return {}
+      }
+    }
+  },
+  data() {
+    return {
+      editing: false
+    }
+  },
+  methods: {
+    deleteTodo(todo) {
+      this.$emit('deleteTodo', todo)
+    },
+    editTodo({ todo, value }) {
+      this.$emit('editTodo', { todo, value })
+    },
+    toggleTodo(todo) {
+      this.$emit('toggleTodo', todo)
+    },
+    doneEdit(e) {
+      const value = e.target.value.trim()
+      const { todo } = this
+      if (!value) {
+        this.deleteTodo({
+          todo
+        })
+      } else if (this.editing) {
+        this.editTodo({
+          todo,
+          value
+        })
+        this.editing = false
+      }
+    },
+    cancelEdit(e) {
+      e.target.value = this.todo.text
+      this.editing = false
+    }
+  }
+}
 </script>

+ 106 - 106
web/src/view/dashboard/component/todoList/index.vue

@@ -1,120 +1,120 @@
 <template>
-    <section class="todoapp">
-        <!-- header -->
-        <header class="header">
-            <input class="new-todo" autocomplete="off" placeholder="Todo List" @keyup.enter="addTodo">
-        </header>
-        <!-- main section -->
-        <section v-show="todos.length" class="main">
-            <input id="toggle-all" :checked="allChecked" class="toggle-all" type="checkbox" @change="toggleAll({ done: !allChecked })">
-            <label for="toggle-all" />
-            <ul class="todo-list">
-                <todo
-                        v-for="(todo, index) in filteredTodos"
-                        :key="index"
-                        :todo="todo"
-                        @toggleTodo="toggleTodo"
-                        @editTodo="editTodo"
-                        @deleteTodo="deleteTodo"
-                />
-            </ul>
-        </section>
-        <!-- footer -->
-        <footer v-show="todos.length" class="footer">
+  <section class="todoapp">
+    <!-- header -->
+    <header class="header">
+      <input class="new-todo" autocomplete="off" placeholder="Todo List" @keyup.enter="addTodo">
+    </header>
+    <!-- main section -->
+    <section v-show="todos.length" class="main">
+      <input id="toggle-all" :checked="allChecked" class="toggle-all" type="checkbox" @change="toggleAll({ done: !allChecked })">
+      <label for="toggle-all" />
+      <ul class="todo-list">
+        <todo
+          v-for="(todo, index) in filteredTodos"
+          :key="index"
+          :todo="todo"
+          @toggleTodo="toggleTodo"
+          @editTodo="editTodo"
+          @deleteTodo="deleteTodo"
+        />
+      </ul>
+    </section>
+    <!-- footer -->
+    <footer v-show="todos.length" class="footer">
       <span class="todo-count">
         <strong>{{ remaining }}</strong>
         {{ remaining | pluralize('item') }} left
       </span>
-            <ul class="filters">
-                <li v-for="(val, key) in filters" :key="key">
-                    <a :class="{ selected: visibility === key }" @click.prevent="visibility = key">{{ key | capitalize }}</a>
-                </li>
-            </ul>
-            <!-- <button class="clear-completed" v-show="todos.length > remaining" @click="clearCompleted">
-              Clear completed
-            </button> -->
-        </footer>
-    </section>
+      <ul class="filters">
+        <li v-for="(val, key) in filters" :key="key">
+          <a :class="{ selected: visibility === key }" @click.prevent="visibility = key">{{ key | capitalize }}</a>
+        </li>
+      </ul>
+      <!-- <button class="clear-completed" v-show="todos.length > remaining" @click="clearCompleted">
+        Clear completed
+      </button> -->
+    </footer>
+  </section>
 </template>
 
 <script>
-    import Todo from './Todo.vue'
+import Todo from './Todo.vue'
 
-    const STORAGE_KEY = 'todos'
-    const filters = {
-        all: todos => todos,
-        active: todos => todos.filter(todo => !todo.done),
-        completed: todos => todos.filter(todo => todo.done)
+const STORAGE_KEY = 'todos'
+const filters = {
+  all: todos => todos,
+  active: todos => todos.filter(todo => !todo.done),
+  completed: todos => todos.filter(todo => todo.done)
+}
+const defaultList = [
+  { text: '工作流功能绘制工具', done: false },
+  { text: '工作流流转方法', done: false },
+  { text: '自动化代码优化', done: false }
+]
+export default {
+  components: { Todo },
+  filters: {
+    pluralize: (n, w) => n === 1 ? w : w + 's',
+    capitalize: s => s.charAt(0).toUpperCase() + s.slice(1)
+  },
+  data() {
+    return {
+      visibility: 'all',
+      filters,
+      // todos: JSON.parse(window.localStorage.getItem(STORAGE_KEY)) || defaultList
+      todos: defaultList
+    }
+  },
+  computed: {
+    allChecked() {
+      return this.todos.every(todo => todo.done)
+    },
+    filteredTodos() {
+      return filters[this.visibility](this.todos)
+    },
+    remaining() {
+      return this.todos.filter(todo => !todo.done).length
     }
-    const defalutList = [
-        { text: '工作流功能绘制工具', done: false },
-        { text: '工作流流转方法', done: false },
-        { text: '自动化代码优化', done: false }
-    ]
-    export default {
-        components: { Todo },
-        filters: {
-            pluralize: (n, w) => n === 1 ? w : w + 's',
-            capitalize: s => s.charAt(0).toUpperCase() + s.slice(1)
-        },
-        data() {
-            return {
-                visibility: 'all',
-                filters,
-                // todos: JSON.parse(window.localStorage.getItem(STORAGE_KEY)) || defalutList
-                todos: defalutList
-            }
-        },
-        computed: {
-            allChecked() {
-                return this.todos.every(todo => todo.done)
-            },
-            filteredTodos() {
-                return filters[this.visibility](this.todos)
-            },
-            remaining() {
-                return this.todos.filter(todo => !todo.done).length
-            }
-        },
-        methods: {
-            setLocalStorage() {
-                window.localStorage.setItem(STORAGE_KEY, JSON.stringify(this.todos))
-            },
-            addTodo(e) {
-                const text = e.target.value
-                if (text.trim()) {
-                    this.todos.push({
-                        text,
-                        done: false
-                    })
-                    this.setLocalStorage()
-                }
-                e.target.value = ''
-            },
-            toggleTodo(val) {
-                val.done = !val.done
-                this.setLocalStorage()
-            },
-            deleteTodo(todo) {
-                this.todos.splice(this.todos.indexOf(todo), 1)
-                this.setLocalStorage()
-            },
-            editTodo({ todo, value }) {
-                todo.text = value
-                this.setLocalStorage()
-            },
-            clearCompleted() {
-                this.todos = this.todos.filter(todo => !todo.done)
-                this.setLocalStorage()
-            },
-            toggleAll({ done }) {
-                this.todos.forEach(todo => {
-                    todo.done = done
-                    this.setLocalStorage()
-                })
-            }
-        }
+  },
+  methods: {
+    setLocalStorage() {
+      window.localStorage.setItem(STORAGE_KEY, JSON.stringify(this.todos))
+    },
+    addTodo(e) {
+      const text = e.target.value
+      if (text.trim()) {
+        this.todos.push({
+          text,
+          done: false
+        })
+        this.setLocalStorage()
+      }
+      e.target.value = ''
+    },
+    toggleTodo(val) {
+      val.done = !val.done
+      this.setLocalStorage()
+    },
+    deleteTodo(todo) {
+      this.todos.splice(this.todos.indexOf(todo), 1)
+      this.setLocalStorage()
+    },
+    editTodo({ todo, value }) {
+      todo.text = value
+      this.setLocalStorage()
+    },
+    clearCompleted() {
+      this.todos = this.todos.filter(todo => !todo.done)
+      this.setLocalStorage()
+    },
+    toggleAll({ done }) {
+      this.todos.forEach(todo => {
+        todo.done = done
+        this.setLocalStorage()
+      })
     }
+  }
+}
 </script>
 
 <style lang="scss">

+ 74 - 74
web/src/view/dashboard/index.vue

@@ -2,20 +2,20 @@
   <div class="big">
     <el-row>
       <div class="card">
-        <el-col :xs="24" :lg="16" :md="16" >
+        <el-col :xs="24" :lg="16" :md="16">
           <div class="car-left">
             <el-row>
               <div>
                 <el-col :xs="4" :md="3" :lg="3">
                   <span class="card-img">
-                    <img :src="userInfo.headerImg" alt="" />
+                    <img :src="userInfo.headerImg" alt="">
                   </span>
                 </el-col>
                 <el-col :xs="20" :lg="12" :md="12">
                   <div class="text">
                     <h4>早安,管理员, 请开始您一天的工作吧!</h4>
                     <p class="tips-text">
-                      <i class="el-icon-sunny el-icon"></i>
+                      <i class="el-icon-sunny el-icon" />
                       <span>今日晴,0℃ - 10℃,天气寒冷,注意添加衣物。</span>
                     </p>
                   </div>
@@ -24,34 +24,34 @@
             </el-row>
           </div>
         </el-col>
-        <el-col :xs="24" :lg='8' :md="8">
+        <el-col :xs="24" :lg="8" :md="8">
           <div class="car-right">
             <el-row>
-              <el-col :span="8"
-                ><div class="car-item">
-                  <span class="flow"><i class="el-icon-s-grid"></i></span>
+              <el-col :span="8">
+                <div class="car-item">
+                  <span class="flow"><i class="el-icon-s-grid" /></span>
                   <span>今日流量 </span>
                   <b>13260</b>
-                </div></el-col
-              >
-              <el-col :span="8"
-                ><div class="car-item">
+                </div>
+              </el-col>
+              <el-col :span="8">
+                <div class="car-item">
                   <span class="user-number">
-                    <i class="el-icon-s-custom"></i>
+                    <i class="el-icon-s-custom" />
                   </span>
                   <span>总用户 </span>
                   <b>48286</b>
-                </div></el-col
-              >
-              <el-col :span="8"
-                ><div class="car-item">
+                </div>
+              </el-col>
+              <el-col :span="8">
+                <div class="car-item">
                   <span class="feedback">
-                    <i class="el-icon-star-on"></i>
+                    <i class="el-icon-star-on" />
                   </span>
                   <span>好评率 </span>
                   <b>98%</b>
-                </div></el-col
-              >
+                </div>
+              </el-col>
             </el-row>
           </div>
         </el-col>
@@ -59,27 +59,27 @@
     </el-row>
     <el-row>
       <el-card shadow="hover">
-          <h2>
-            使用教学:<a style="color:#409EFF"  target="view_window" href="https://www.bilibili.com/video/BV1fV411y7dT/">https://www.bilibili.com/video/BV1fV411y7dT/</a>
-          </h2>
-          <br>
-          <h2>
-            工作流教学:<a style="color:#409EFF"  target="view_window" href="https://www.bilibili.com/video/BV1Ka411F7Ji/">https://www.bilibili.com/video/BV1Ka411F7Ji/</a>
-          </h2>
-          <div></div>
+        <h2>
+          使用教学:<a style="color:#409EFF" target="view_window" href="https://www.bilibili.com/video/BV1fV411y7dT/">https://www.bilibili.com/video/BV1fV411y7dT/</a>
+        </h2>
+        <br>
+        <h2>
+          工作流教学:<a style="color:#409EFF" target="view_window" href="https://www.bilibili.com/video/BV1Ka411F7Ji/">https://www.bilibili.com/video/BV1Ka411F7Ji/</a>
+        </h2>
+        <div />
       </el-card>
     </el-row>
     <div class="shadow">
       <el-row :gutter="20">
         <el-col
-          :span="4"
           v-for="(card, key) in toolCards"
           :key="key"
-          @click.native="toTarget(card.name)"
+          :span="4"
           :xs="8"
+          @click.native="toTarget(card.name)"
         >
           <el-card shadow="hover" class="grid-content">
-            <i :class="card.icon" :style="{ color: card.color }"></i>
+            <i :class="card.icon" :style="{ color: card.color }" />
             <p>{{ card.label }}</p>
           </el-card>
         </el-col>
@@ -89,7 +89,7 @@
       <el-row :gutter="32">
         <el-col :xs="24" :sm="24" :lg="12">
           <div class="chart-player">
-            <musicPlayer />
+            <music-player />
           </div>
         </el-col>
         <el-col :xs="24" :sm="24" :lg="12">
@@ -103,69 +103,69 @@
 </template>
 
 <script>
-import musicPlayer from "./component/musicPlayer";
-import TodoList from "./component/todoList";
-import { mapGetters } from "vuex";
+import musicPlayer from './component/musicPlayer'
+import TodoList from './component/todoList'
+import { mapGetters } from 'vuex'
 export default {
-  name: "Dashboard",
+  name: 'Dashboard',
+  components: {
+    musicPlayer, // 音乐播放器
+    TodoList // TodoList
+    // RaddarChart, //雷达图
+    // stackMap, //堆叠图
+    // Sunburst, //旭日图
+  },
   data() {
     return {
       toolCards: [
         {
-          label: "用户管理",
-          icon: "el-icon el-icon-monitor",
-          name: "user",
-          color: "#ff9c6e",
+          label: '用户管理',
+          icon: 'el-icon el-icon-monitor',
+          name: 'user',
+          color: '#ff9c6e'
         },
         {
-          label: "角色管理",
-          icon: "el-icon el-icon-setting",
-          name: "authority",
-          color: "#69c0ff",
+          label: '角色管理',
+          icon: 'el-icon el-icon-setting',
+          name: 'authority',
+          color: '#69c0ff'
         },
         {
-          label: "菜单管理",
-          icon: "el-icon el-icon-menu",
-          name: "menu",
-          color: "#b37feb",
+          label: '菜单管理',
+          icon: 'el-icon el-icon-menu',
+          name: 'menu',
+          color: '#b37feb'
         },
         {
-          label: "代码生成器",
-          icon: "el-icon el-icon-cpu",
-          name: "autoCode",
-          color: "#ffd666",
+          label: '代码生成器',
+          icon: 'el-icon el-icon-cpu',
+          name: 'autoCode',
+          color: '#ffd666'
         },
         {
-          label: "表单生成器",
-          icon: "el-icon el-icon-document-checked",
-          name: "formCreate",
-          color: "#ff85c0",
+          label: '表单生成器',
+          icon: 'el-icon el-icon-document-checked',
+          name: 'formCreate',
+          color: '#ff85c0'
         },
         {
-          label: "关于我们",
-          icon: "el-icon el-icon-user",
-          name: "about",
-          color: "#5cdbd3",
-        },
-      ],
-    };
+          label: '关于我们',
+          icon: 'el-icon el-icon-user',
+          name: 'about',
+          color: '#5cdbd3'
+        }
+      ]
+    }
   },
   computed: {
-    ...mapGetters("user", ["userInfo"]),
-  },
-  components: {
-    musicPlayer, //音乐播放器
-    TodoList, //TodoList
-    // RaddarChart, //雷达图
-    // stackMap, //堆叠图
-    // Sunburst, //旭日图
+    ...mapGetters('user', ['userInfo'])
   },
   methods: {
     toTarget(name) {
-      this.$router.push({ name });
-    },
-  },
-};
+      this.$router.push({ name })
+    }
+  }
+}
 </script>
 
 <style lang="scss" scoped>

+ 13 - 13
web/src/view/error/index.vue

@@ -1,21 +1,21 @@
 <template>
-    <div>
-        <div class="big">
-            <div class="inner">
-                <img src="../../assets/notFound.png">
-                <p>页面被神秘力量吸走了,请联系我们修复</p>
-                <p style="font-size:18px;line-height:40px;">常见问题为菜单未分配仪表盘,可自行分配仪表盘或修改默认路由</p>
-                <p>↓</p>
-                <img src="../../assets/qm.png" class="leftPic">
-            </div>
-        </div>
+  <div>
+    <div class="big">
+      <div class="inner">
+        <img src="../../assets/notFound.png">
+        <p>页面被神秘力量吸走了,请联系我们修复</p>
+        <p style="font-size:18px;line-height:40px;">常见问题为菜单未分配仪表盘,可自行分配仪表盘或修改默认路由</p>
+        <p>↓</p>
+        <img src="../../assets/qm.png" class="leftPic">
+      </div>
     </div>
+  </div>
 </template>
 
 <script>
 export default {
-    name:"Login"
-    
+  name: 'Error'
+
 }
 </script>
 
@@ -42,4 +42,4 @@ export default {
         margin-left: 44%;
         margin-top: 20px;
     }
-</style>
+</style>

+ 73 - 75
web/src/view/example/breakpoint/breakpoint.vue

@@ -1,30 +1,31 @@
 <template>
   <div class="hello">
-     <el-divider content-position="left">大文件上传</el-divider>
-    <form id="fromCont" method="post" >
+    <el-divider content-position="left">大文件上传</el-divider>
+    <form id="fromCont" method="post">
       <div class="fileUpload" @click="inputChange">
         选择文件
-        <input v-show="false"  @change="choseFile" id="file" multiple="multiple" type="file" ref="Input"  />
+        <input v-show="false" id="file" ref="Input" multiple="multiple" type="file" @change="choseFile">
       </div>
     </form>
-     <el-button @click="getFile" :disabled="limitFileSize" type="primary" size="medium" class="uploadBtn">上传文件</el-button>
+    <el-button :disabled="limitFileSize" type="primary" size="medium" class="uploadBtn" @click="getFile">上传文件</el-button>
     <div class="el-upload__tip">请上传不超过5MB的文件</div>
     <div class="list">
-      <transition  name="list" tag="p">
-        <div class="list-item" v-if="file" >
-          <i class="el-icon-document"></i>
+      <transition name="list" tag="p">
+        <div v-if="file" class="list-item">
+          <i class="el-icon-document" />
           <span>{{ file.name }}</span>
-          <span class="percentage" >{{percentage}}%</span>
-          <el-progress  :show-text='false' :text-inside="false" :stroke-width="2" :percentage="percentage"></el-progress>
-        </div> 
+          <span class="percentage">{{ percentage }}%</span>
+          <el-progress :show-text="false" :text-inside="false" :stroke-width="2" :percentage="percentage" />
+        </div>
       </transition>
-   </div>
-     <!-- <span
+    </div>
+    <!-- <span
       v-if="this.file"
     >{{Math.floor(((this.formDataList.length-this.waitNum)/this.formDataList.length)*100)}}%</span> -->
     <div class="tips">此版本为先行体验功能测试版,样式美化和性能优化正在进行中,上传切片文件和合成的完整文件分别再QMPlusserver目录的breakpointDir文件夹和fileDir文件夹</div>
   </div>
 </template>
+
 <script>
 import SparkMD5 from 'spark-md5'
 import axios from 'axios'
@@ -43,83 +44,80 @@ export default {
       waitUpLoad: [],
       waitNum: 0,
       limitFileSize: false,
-      percentage:0,
+      percentage: 0,
       percentageFlage: true,
       customColor: '#409eff'
     }
-  },
-  created(){
-   
   },
   methods: {
     // 选中文件的函数
     async choseFile(e) {
       const fileR = new FileReader() // 创建一个reader用来读取文件流
       const file = e.target.files[0] // 获取当前文件
-      const maxSize = 5*1024*1024
+      const maxSize = 5 * 1024 * 1024
       this.file = file // file 丢全局方便后面用 可以改进为func传参形式
       this.percentage = 0
-    if(file.size<maxSize){
-      fileR.readAsArrayBuffer(file) // 把文件读成ArrayBuffer  主要为了保持跟后端的流一致
-      fileR.onload = async e => {
-        // 读成arrayBuffer的回调 e 为方法自带参数 相当于 dom的e 流存在e.target.result 中
-        const blob = e.target.result
-        let spark = new SparkMD5.ArrayBuffer() // 创建md5制造工具 (md5用于检测文件一致性 这里不懂就打电话问我)
-        spark.append(blob) // 文件流丢进工具
-        this.fileMd5 = spark.end() // 工具结束 产生一个a 总文件的md5
-        const FileSliceCap = 1 * 1024 * 1024 // 分片字节数
-        let start = 0 // 定义分片开始切的地方
-        let end = 0 // 每片结束切的地方a
-        let i = 0 // 第几片
-        this.formDataList = [] // 分片存储的一个池子 丢全局
-        while (end < file.size) {
-          // 当结尾数字大于文件总size的时候 结束切片
-          start = i * FileSliceCap // 计算每片开始位置
-          end = (i + 1) * FileSliceCap // 计算每片结束位置
-          var fileSlice = this.file.slice(start, end) // 开始切  file.slice 为 h5方法 对文件切片 参数为 起止字节数
-          const formData = new window.FormData() // 创建FormData用于存储传给后端的信息
-          formData.append('fileMd5', this.fileMd5) // 存储总文件的Md5 让后端知道自己是谁的切片
-          formData.append('file', fileSlice) //当前的切片
-          formData.append('chunkNumber', i) // 当前是第几片
-          formData.append('fileName', this.file.name) //当前文件的文件名 用于后端文件切片的命名  formData.appen 为 formData对象添加参数的方法
-          this.formDataList.push({ key: i, formData }) // 把当前切片信息 自己是第几片 存入我们方才准备好的池子
-          i++
-        }
-        const params = {
-          fileName: this.file.name,
-          fileMd5: this.fileMd5,
-          chunkTotal: this.formDataList.length
-        }
-        const res = await findFile(params)
-        // 全部切完以后 发一个请求给后端 拉当前文件后台存储的切片信息 用于检测有多少上传成功的切片
-        const finishList = res.data.file.ExaFileChunk // 上传成功的切片
-        const IsFinish = res.data.file.IsFinish // 是否是同文件不同命 (文件md5相同 文件名不同 则默认是同一个文件但是不同文件名 此时后台数据库只需要拷贝一下数据库文件即可 不需要上传文件 即秒传功能)
-        if (!IsFinish) {
-          // 当是断点续传时候
-          this.waitUpLoad = this.formDataList.filter(all => {
-            return !(
-              finishList &&
+      if (file.size < maxSize) {
+        fileR.readAsArrayBuffer(file) // 把文件读成ArrayBuffer  主要为了保持跟后端的流一致
+        fileR.onload = async e => {
+          // 读成arrayBuffer的回调 e 为方法自带参数 相当于 dom的e 流存在e.target.result 中
+          const blob = e.target.result
+          const spark = new SparkMD5.ArrayBuffer() // 创建md5制造工具 (md5用于检测文件一致性 这里不懂就打电话问我)
+          spark.append(blob) // 文件流丢进工具
+          this.fileMd5 = spark.end() // 工具结束 产生一个a 总文件的md5
+          const FileSliceCap = 1 * 1024 * 1024 // 分片字节数
+          let start = 0 // 定义分片开始切的地方
+          let end = 0 // 每片结束切的地方a
+          let i = 0 // 第几片
+          this.formDataList = [] // 分片存储的一个池子 丢全局
+          while (end < file.size) {
+            // 当结尾数字大于文件总size的时候 结束切片
+            start = i * FileSliceCap // 计算每片开始位置
+            end = (i + 1) * FileSliceCap // 计算每片结束位置
+            var fileSlice = this.file.slice(start, end) // 开始切  file.slice 为 h5方法 对文件切片 参数为 起止字节数
+            const formData = new window.FormData() // 创建FormData用于存储传给后端的信息
+            formData.append('fileMd5', this.fileMd5) // 存储总文件的Md5 让后端知道自己是谁的切片
+            formData.append('file', fileSlice) // 当前的切片
+            formData.append('chunkNumber', i) // 当前是第几片
+            formData.append('fileName', this.file.name) // 当前文件的文件名 用于后端文件切片的命名  formData.appen 为 formData对象添加参数的方法
+            this.formDataList.push({ key: i, formData }) // 把当前切片信息 自己是第几片 存入我们方才准备好的池子
+            i++
+          }
+          const params = {
+            fileName: this.file.name,
+            fileMd5: this.fileMd5,
+            chunkTotal: this.formDataList.length
+          }
+          const res = await findFile(params)
+          // 全部切完以后 发一个请求给后端 拉当前文件后台存储的切片信息 用于检测有多少上传成功的切片
+          const finishList = res.data.file.ExaFileChunk // 上传成功的切片
+          const IsFinish = res.data.file.IsFinish // 是否是同文件不同命 (文件md5相同 文件名不同 则默认是同一个文件但是不同文件名 此时后台数据库只需要拷贝一下数据库文件即可 不需要上传文件 即秒传功能)
+          if (!IsFinish) {
+            // 当是断点续传时候
+            this.waitUpLoad = this.formDataList.filter(all => {
+              return !(
+                finishList &&
               finishList.some(fi => fi.FileChunkNumber === all.key)
-            ) // 找出需要上传的切片
-          })
-        } else {
-          this.waitUpLoad = [] // 秒传则没有需要上传的切片
+              ) // 找出需要上传的切片
+            })
+          } else {
+            this.waitUpLoad = [] // 秒传则没有需要上传的切片
+          }
+          this.waitNum = this.waitUpLoad.length // 记录长度用于百分比展示
         }
-        this.waitNum = this.waitUpLoad.length // 记录长度用于百分比展示
-      }
       } else {
-         this.limitFileSize = true
-         this.$message('请上传小于5M文件')
+        this.limitFileSize = true
+        this.$message('请上传小于5M文件')
       }
     },
     getFile() {
       // 确定按钮
-      if (this.file == null) {
+      if (this.file === null) {
         this.$message('请先上传文件')
         return
       }
-      this.percentage = Math.floor(((this.formDataList.length-this.waitNum)/this.formDataList.length)*100)
-      if(this.percentage == 100){
+      this.percentage = Math.floor(((this.formDataList.length - this.waitNum) / this.formDataList.length) * 100)
+      if (this.percentage === 100) {
         this.percentageFlage = false
       }
       this.sliceFile() // 上传切片
@@ -127,13 +125,13 @@ export default {
     sliceFile() {
       this.waitUpLoad &&
         this.waitUpLoad.map(item => {
-          //需要上传的切片
+          // 需要上传的切片
           item.formData.append('chunkTotal', this.formDataList.length) // 切片总数携带给后台 总有用的
           const fileR = new FileReader() // 功能同上
           const file = item.formData.get('file')
           fileR.readAsArrayBuffer(file)
           fileR.onload = e => {
-            let spark = new SparkMD5.ArrayBuffer()
+            const spark = new SparkMD5.ArrayBuffer()
             spark.append(e.target.result)
             item.formData.append('chunkMd5', spark.end()) // 获取当前切片md5 后端用于验证切片完整性
             this.upLoadFileSlice(item)
@@ -142,9 +140,9 @@ export default {
     },
     async upLoadFileSlice(item) {
       // 切片上传
-      await axios.post(process.env.VUE_APP_BASE_API+"/fileUploadAndDownload/breakpointContinue",item.formData)
+      await axios.post(process.env.VUE_APP_BASE_API + '/fileUploadAndDownload/breakpointContinue', item.formData)
       this.waitNum-- // 百分数增加
-      if (this.waitNum == 0) {
+      if (this.waitNum === 0) {
         // 切片传完以后 合成文件
         const params = {
           fileName: this.file.name,
@@ -162,7 +160,7 @@ export default {
         }
       }
     },
-    inputChange(){
+    inputChange() {
       this.$refs.Input.dispatchEvent(new MouseEvent('click'))
     }
   }
@@ -226,7 +224,7 @@ a {
   .el-divider{
     margin: 0 0 30px 0;
   }
- 
+
  .list{
    margin-top:15px;
  }
@@ -249,4 +247,4 @@ a {
   opacity: 0;
   transform: translateY(-30px);
 }
-</style>
+</style>

+ 69 - 69
web/src/view/example/customer/customer.vue

@@ -3,35 +3,35 @@
     <div class="search-term">
       <el-form :inline="true" :model="searchInfo" class="demo-form-inline">
         <el-form-item>
-          <el-button @click="openDialog" type="primary">新增客户</el-button>
+          <el-button type="primary" @click="openDialog">新增客户</el-button>
         </el-form-item>
       </el-form>
     </div>
     <el-table
+      ref="multipleTable"
       :data="tableData"
       border
-      ref="multipleTable"
       stripe
       style="width: 100%"
       tooltip-effect="dark"
     >
-      <el-table-column type="selection" width="55"></el-table-column>
+      <el-table-column type="selection" width="55" />
       <el-table-column label="接入日期" width="180">
         <template slot-scope="scope">{{ scope.row.CreatedAt|formatDate }}</template>
       </el-table-column>
-      <el-table-column label="姓名" prop="customerName" width="120"></el-table-column>
-      <el-table-column label="电话" prop="customerPhoneData" width="120"></el-table-column>
-      <el-table-column label="接入人ID" prop="sysUserId" width="120"></el-table-column>
+      <el-table-column label="姓名" prop="customerName" width="120" />
+      <el-table-column label="电话" prop="customerPhoneData" width="120" />
+      <el-table-column label="接入人ID" prop="sysUserId" width="120" />
       <el-table-column label="按钮组" min-width="160">
         <template slot-scope="scope">
-          <el-button @click="updateCustomer(scope.row)" size="small" type="text">变更</el-button>
-          <el-popover placement="top" width="160" v-model="scope.row.visible">
+          <el-button size="small" type="text" @click="updateCustomer(scope.row)">变更</el-button>
+          <el-popover v-model="scope.row.visible" placement="top" width="160">
             <p>确定要删除吗?</p>
             <div style="text-align: right; margin: 0">
               <el-button size="mini" type="text" @click="scope.row.visible = false">取消</el-button>
               <el-button type="primary" size="mini" @click="deleteCustomer(scope.row)">确定</el-button>
             </div>
-            <el-button type="danger" icon="el-icon-delete" size="mini" slot="reference">删除</el-button>
+            <el-button slot="reference" type="danger" icon="el-icon-delete" size="mini">删除</el-button>
           </el-popover>
         </template>
       </el-table-column>
@@ -43,23 +43,23 @@
       :page-sizes="[10, 30, 50, 100]"
       :style="{float:'right',padding:'20px'}"
       :total="total"
+      layout="total, sizes, prev, pager, next, jumper"
       @current-change="handleCurrentChange"
       @size-change="handleSizeChange"
-      layout="total, sizes, prev, pager, next, jumper"
-    ></el-pagination>
+    />
 
     <el-dialog :before-close="closeDialog" :visible.sync="dialogFormVisible" title="客户">
       <el-form :inline="true" :model="form" label-width="80px">
         <el-form-item label="客户名">
-          <el-input autocomplete="off" v-model="form.customerName"></el-input>
+          <el-input v-model="form.customerName" autocomplete="off" />
         </el-form-item>
         <el-form-item label="客户电话">
-          <el-input autocomplete="off" v-model="form.customerPhoneData"></el-input>
+          <el-input v-model="form.customerPhoneData" autocomplete="off" />
         </el-form-item>
       </el-form>
-      <div class="dialog-footer" slot="footer">
+      <div slot="footer" class="dialog-footer">
         <el-button @click="closeDialog">取 消</el-button>
-        <el-button @click="enterDialog" type="primary">确 定</el-button>
+        <el-button type="primary" @click="enterDialog">确 定</el-button>
       </div>
     </el-dialog>
     <div class="tips">在资源权限中将此角色的资源权限清空 或者不包含创建者的角色 即可屏蔽此客户资源的显示</div>
@@ -73,93 +73,93 @@ import {
   deleteExaCustomer,
   getExaCustomer,
   getExaCustomerList
-} from "@/api/customer";
-import { formatTimeToStr } from "@/utils/date";
-import infoList from "@/mixins/infoList";
+} from '@/api/customer'
+import { formatTimeToStr } from '@/utils/date'
+import infoList from '@/mixins/infoList'
 
 export default {
-  name: "Customer",
+  name: 'Customer',
+  filters: {
+    formatDate: function(time) {
+      if (time !== null && time !== '') {
+        var date = new Date(time)
+        return formatTimeToStr(date, 'yyyy-MM-dd hh:mm:ss')
+      } else {
+        return ''
+      }
+    }
+  },
   mixins: [infoList],
   data() {
     return {
       listApi: getExaCustomerList,
       dialogFormVisible: false,
-      type: "",
+      type: '',
       form: {
-        customerName: "",
-        customerPhoneData: ""
-      }
-    };
-  },
-  filters: {
-    formatDate: function(time) {
-      if (time != null && time != "") {
-        var date = new Date(time);
-        return formatTimeToStr(date, "yyyy-MM-dd hh:mm:ss");
-      } else {
-        return "";
+        customerName: '',
+        customerPhoneData: ''
       }
     }
   },
+  created() {
+    this.getTableData()
+  },
   methods: {
     async updateCustomer(row) {
-      const res = await getExaCustomer({ ID: row.ID });
-      this.type = "update";
-      if (res.code == 0) {
-        this.form = res.data.customer;
-        this.dialogFormVisible = true;
+      const res = await getExaCustomer({ ID: row.ID })
+      this.type = 'update'
+      if (res.code === 0) {
+        this.form = res.data.customer
+        this.dialogFormVisible = true
       }
     },
     closeDialog() {
-      this.dialogFormVisible = false;
+      this.dialogFormVisible = false
       this.form = {
-        customerName: "",
-        customerPhoneData: ""
-      };
+        customerName: '',
+        customerPhoneData: ''
+      }
     },
     async deleteCustomer(row) {
-      row.visible = false;
-      const res = await deleteExaCustomer({ ID: row.ID });
-      if (res.code == 0) {
+      row.visible = false
+      const res = await deleteExaCustomer({ ID: row.ID })
+      if (res.code === 0) {
         this.$message({
-          type: "success",
-          message: ""
-        });
-        if (this.tableData.length == 1 && this.page > 1 ) {
-          this.page--;
+          type: 'success',
+          message: ''
+        })
+        if (this.tableData.length === 1 && this.page > 1) {
+          this.page--
         }
-        this.getTableData();
+        this.getTableData()
       }
     },
     async enterDialog() {
-      let res;
+      let res
       switch (this.type) {
-        case "create":
-          res = await createExaCustomer(this.form);
-          break;
-        case "update":
-          res = await updateExaCustomer(this.form);
-          break;
+        case 'create':
+          res = await createExaCustomer(this.form)
+          break
+        case 'update':
+          res = await updateExaCustomer(this.form)
+          break
         default:
-          res = await createExaCustomer(this.form);
-          break;
+          res = await createExaCustomer(this.form)
+          break
       }
 
-      if (res.code == 0) {
-        this.closeDialog();
-        this.getTableData();
+      if (res.code === 0) {
+        this.closeDialog()
+        this.getTableData()
       }
     },
     openDialog() {
-      this.type = "create";
-      this.dialogFormVisible = true;
+      this.type = 'create'
+      this.dialogFormVisible = true
     }
-  },
-  created() {
-    this.getTableData();
   }
-};
+}
 </script>
 
 <style>
-</style>
+</style>

+ 23 - 22
web/src/view/example/excel/excel.vue

@@ -19,26 +19,27 @@
       </el-col>
     </el-row>
     <el-table :data="tableData" border row-key="ID" stripe>
-      <el-table-column label="ID" min-width="100" prop="ID"></el-table-column>
-      <el-table-column label="路由Name" min-width="160" prop="name"></el-table-column>
-      <el-table-column label="路由Path" min-width="160" prop="path"></el-table-column>
+      <el-table-column label="ID" min-width="100" prop="ID" />
+      <el-table-column label="路由Name" min-width="160" prop="name" />
+      <el-table-column label="路由Path" min-width="160" prop="path" />
       <el-table-column label="是否隐藏" min-width="100" prop="hidden">
         <template slot-scope="scope">
-          <span>{{scope.row.hidden?"隐藏":"显示"}}</span>
+          <span>{{ scope.row.hidden?"隐藏":"显示" }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="父节点" min-width="90" prop="parentId"></el-table-column>
-      <el-table-column label="排序" min-width="70" prop="sort"></el-table-column>
-      <el-table-column label="文件路径" min-width="360" prop="component"></el-table-column>
+      <el-table-column label="父节点" min-width="90" prop="parentId" />
+      <el-table-column label="排序" min-width="70" prop="sort" />
+      <el-table-column label="文件路径" min-width="360" prop="component" />
     </el-table>
   </div>
 </template>
+
 <script>
-const path = process.env.VUE_APP_BASE_API;
-import { mapGetters } from 'vuex';
-import infoList from "@/mixins/infoList";
-import { exportExcel, loadExcelData, downloadTemplate } from "@/api/excel";
-import { getMenuList } from "@/api/menu";
+const path = process.env.VUE_APP_BASE_API
+import { mapGetters } from 'vuex'
+import infoList from '@/mixins/infoList'
+import { exportExcel, loadExcelData, downloadTemplate } from '@/api/excel'
+import { getMenuList } from '@/api/menu'
 export default {
   name: 'Excel',
   mixins: [infoList],
@@ -51,24 +52,24 @@ export default {
   computed: {
     ...mapGetters('user', ['userInfo', 'token'])
   },
+  created() {
+    this.pageSize = 999
+    this.getTableData()
+  },
   methods: {
     handleExcelExport(fileName) {
-      if (!fileName || typeof fileName !== "string") {
-        fileName = "ExcelExport.xlsx";
+      if (!fileName || typeof fileName !== 'string') {
+        fileName = 'ExcelExport.xlsx'
       }
-      exportExcel(this.tableData, fileName);
+      exportExcel(this.tableData, fileName)
     },
     loadExcel() {
-      this.listApi = loadExcelData;
-      this.getTableData();
+      this.listApi = loadExcelData
+      this.getTableData()
     },
     downloadExcelTemplate() {
       downloadTemplate('ExcelTemplate.xlsx')
     }
-  },
-  created() {
-    this.pageSize = 999;
-    this.getTableData();
   }
 }
-</script>
+</script>

+ 4 - 5
web/src/view/example/index.vue

@@ -1,15 +1,14 @@
 <template>
   <div>
     <keep-alive>
-      <router-view v-if="$route.meta.keepAlive"></router-view>
+      <router-view v-if="$route.meta.keepAlive" />
     </keep-alive>
-    <router-view v-if="!$route.meta.keepAlive"></router-view>
+    <router-view v-if="!$route.meta.keepAlive" />
   </div>
 </template>
 
 <script>
 export default {
-  name: "Example",
-};
+  name: 'Example'
+}
 </script>
-<style lang="scss"></style>

+ 67 - 69
web/src/view/example/simpleUploader/simpleUploader.vue

@@ -2,145 +2,143 @@
   <uploader
     :options="options"
     :file-status-text="statusText"
-    :autoStart="false"
+    :auto-start="false"
+    class="uploader-example"
     @file-added="fileAdded"
     @file-progress="onFileProgress"
     @file-success="onFileSuccess"
     @file-error="onFileError"
-    class="uploader-example"
   >
-    <uploader-unsupport></uploader-unsupport>
+    <uploader-unsupport />
     <uploader-drop>
       <p>拖拽文件至此或点击</p>
       <uploader-btn>选择文件</uploader-btn>
     </uploader-drop>
-    <uploader-list></uploader-list>
+    <uploader-list />
   </uploader>
 </template>
 
 <script>
-var notUploadedChunks = []; // 已经上传过的文件chunkNumber数组
-var isUploaded = false; // 文件已经上传成功了
-import { mapGetters } from "vuex";
-import { checkFileMd5,mergeFileMd5 } from "@/api/simpleUploader";
-import SparkMD5 from "spark-md5";
-const path = process.env.VUE_APP_BASE_API;
+var notUploadedChunks = [] // 已经上传过的文件chunkNumber数组
+var isUploaded = false // 文件已经上传成功了
+import { mapGetters } from 'vuex'
+import { checkFileMd5, mergeFileMd5 } from '@/api/simpleUploader'
+import SparkMD5 from 'spark-md5'
+const path = process.env.VUE_APP_BASE_API
 export default {
-  name: "simpleUploader",
-  data(){
-    return{
-      md5:""
+  name: 'SimpleUploader',
+  data() {
+    return {
+      md5: ''
     }
   },
   computed: {
-    ...mapGetters("user", ["userInfo", "token"]),
+    ...mapGetters('user', ['userInfo', 'token']),
     statusText() {
       return {
-        success: "成功了",
-        error: "出错了",
-        uploading: "上传中",
-        paused: "暂停中",
-        waiting: "等待中"
-      };
+        success: '成功了',
+        error: '出错了',
+        uploading: '上传中',
+        paused: '暂停中',
+        waiting: '等待中'
+      }
     },
     options() {
       return {
-        target: path + "/simpleUploader/upload",
+        target: path + '/simpleUploader/upload',
         testChunks: false,
         simultaneousUploads: 5,
         chunkSize: 2 * 1024 * 1024,
         headers: {
-          "x-token": this.token,
-          "x-user-id": this.userInfo.ID
+          'x-token': this.token,
+          'x-user-id': this.userInfo.ID
         },
         checkChunkUploadedByResponse(chunk) {
           if (isUploaded) {
-            return true; // return true 会忽略当前文件,不会再发送给后台
+            return true // return true 会忽略当前文件,不会再发送给后台
           } else {
-              // 根据已经上传过的切片来进行忽略
-              return (
-                notUploadedChunks &&
+            // 根据已经上传过的切片来进行忽略
+            return (
+              notUploadedChunks &&
                 notUploadedChunks.some(
-                  item => item.chunkNumber == chunk.offset + 1
+                  item => item.chunkNumber === chunk.offset + 1
                 )
-              );
+            )
           }
         }
-      };
+      }
     }
   },
   methods: {
 
     // 上传单个文件
     fileAdded(file) {
-      this.computeMD5(file); // 生成MD5
+      this.computeMD5(file) // 生成MD5
     },
     // 计算MD5值
     computeMD5(file) {
-      var that = this;
-      isUploaded = false; // 这个文件是否已经上传成功过
-      notUploadedChunks = []; // 未成功的chunkNumber
-      var fileReader = new FileReader();
-      var md5 = "";
+      var that = this
+      isUploaded = false // 这个文件是否已经上传成功过
+      notUploadedChunks = [] // 未成功的chunkNumber
+      var fileReader = new FileReader()
+      var md5 = ''
 
-      file.pause();
+      file.pause()
 
-      fileReader.readAsArrayBuffer(file.file);
+      fileReader.readAsArrayBuffer(file.file)
       fileReader.onload = async function(e) {
-        if (file.size != e.target.result.byteLength) {
+        if (file.size !== e.target.result.byteLength) {
           this.error(
-            "Browser reported success but could not read the file until the end."
-          );
-          return false;
+            'Browser reported success but could not read the file until the end.'
+          )
+          return false
         }
-        md5 = SparkMD5.ArrayBuffer.hash(e.target.result, false);
+        md5 = SparkMD5.ArrayBuffer.hash(e.target.result, false)
 
-        file.uniqueIdentifier = md5;
-        if (md5 != "") {
-          const res = await checkFileMd5({ md5: md5 });
-          if (res.code == 0) {
+        file.uniqueIdentifier = md5
+        if (md5 !== '') {
+          const res = await checkFileMd5({ md5: md5 })
+          if (res.code === 0) {
             if (res.data.isDone) {
               // 上传成功过
-              isUploaded = true;
+              isUploaded = true
               that.$message({
-                message: "该文件已经上传成功过了,秒传成功。",
-                type: "success"
-              });
+                message: '该文件已经上传成功过了,秒传成功。',
+                type: 'success'
+              })
 
-              file.cancel();
+              file.cancel()
             } else {
-              isUploaded = false;
-              notUploadedChunks = res.data.chunks;
-              if(notUploadedChunks.length){
-                file.resume();
+              isUploaded = false
+              notUploadedChunks = res.data.chunks
+              if (notUploadedChunks.length) {
+                file.resume()
               }
             }
           }
         }
-
-        
-      };
+      }
       fileReader.onerror = function() {
         this.error(
-          "generater md5 时FileReader异步读取文件出错了,FileReader onerror was triggered, maybe the browser aborted due to high memory usage."
-        );
-        return false;
-      };
+          'generater md5 时FileReader异步读取文件出错了,FileReader onerror was triggered, maybe the browser aborted due to high memory usage.'
+        )
+        return false
+      }
     },
     // 上传进度
     onFileProgress() {},
     // 上传成功
     async onFileSuccess(rootFile, file) {
-      await mergeFileMd5({md5:file.uniqueIdentifier,fileName:file.name})
+      await mergeFileMd5({ md5: file.uniqueIdentifier, fileName: file.name })
     },
     onFileError(rootFile, file, response) {
       this.$message({
         message: response,
-        type: "error"
-      });
+        type: 'error'
+      })
     }
   }
-};
+}
 </script>
 
 <style>
@@ -160,4 +158,4 @@ export default {
   overflow-x: hidden;
   overflow-y: auto;
 }
-</style>
+</style>

+ 75 - 75
web/src/view/example/upload/upload.vue

@@ -12,12 +12,12 @@
             :show-file-list="false"
           >
             <el-button size="small" type="primary">点击上传</el-button>
-            <div class="el-upload__tip" slot="tip">只能上传jpg/png文件,且不超过500kb</div>
+            <div slot="tip" class="el-upload__tip">只能上传jpg/png文件,且不超过500kb</div>
           </el-upload>
         </el-col>
         <el-col :span="12">
           带压缩的上传, (512(k)为压缩限制)
-          <upload-image v-model="imageUrl" :fileSize="512" :maxWH="1080" />
+          <upload-image v-model="imageUrl" :file-size="512" :max-w-h="1080" />
           已上传文件 {{ imageUrl }}
         </el-col>
       </el-row>
@@ -25,7 +25,7 @@
       <el-table :data="tableData" border stripe>
         <el-table-column label="预览" width="100">
           <template slot-scope="scope">
-            <CustomPic picType="file" :picSrc="scope.row.url" />
+            <CustomPic pic-type="file" :pic-src="scope.row.url" />
           </template>
         </el-table-column>
         <el-table-column label="日期" prop="UpdatedAt" width="180">
@@ -33,8 +33,8 @@
             <div>{{ scope.row.UpdatedAt | formatDate }}</div>
           </template>
         </el-table-column>
-        <el-table-column label="文件名" prop="name" width="180"></el-table-column>
-        <el-table-column label="链接" prop="url" min-width="300"></el-table-column>
+        <el-table-column label="文件名" prop="name" width="180" />
+        <el-table-column label="链接" prop="url" min-width="300" />
         <el-table-column label="标签" prop="tag" width="100">
           <template slot-scope="scope">
             <el-tag
@@ -45,8 +45,8 @@
         </el-table-column>
         <el-table-column label="操作" width="160">
           <template slot-scope="scope">
-            <el-button @click="downloadFile(scope.row)" size="small" type="text">下载</el-button>
-            <el-button @click="deleteFile(scope.row)" size="small" type="text">删除</el-button>
+            <el-button size="small" type="text" @click="downloadFile(scope.row)">下载</el-button>
+            <el-button size="small" type="text" @click="deleteFile(scope.row)">删除</el-button>
           </template>
         </el-table-column>
       </el-table>
@@ -56,124 +56,124 @@
         :page-sizes="[10, 30, 50, 100]"
         :style="{ float: 'right', padding: '20px' }"
         :total="total"
+        layout="total, sizes, prev, pager, next, jumper"
         @current-change="handleCurrentChange"
         @size-change="handleSizeChange"
-        layout="total, sizes, prev, pager, next, jumper"
-      ></el-pagination>
+      />
     </div>
   </div>
 </template>
 
 <script>
-const path = process.env.VUE_APP_BASE_API;
-import { mapGetters } from "vuex";
-import infoList from "@/mixins/infoList";
-import { getFileList, deleteFile } from "@/api/fileUploadAndDownload";
-import { downloadImage } from "@/utils/downloadImg";
-import { formatTimeToStr } from "@/utils/date";
-import CustomPic from "@/components/customPic";
-import UploadImage from "@/components/upload/image.vue";
+const path = process.env.VUE_APP_BASE_API
+import { mapGetters } from 'vuex'
+import infoList from '@/mixins/infoList'
+import { getFileList, deleteFile } from '@/api/fileUploadAndDownload'
+import { downloadImage } from '@/utils/downloadImg'
+import { formatTimeToStr } from '@/utils/date'
+import CustomPic from '@/components/customPic'
+import UploadImage from '@/components/upload/image.vue'
 export default {
-  name: "Upload",
-  mixins: [infoList],
+  name: 'Upload',
   components: {
     CustomPic,
     UploadImage
   },
+  filters: {
+    formatDate: function(time) {
+      if (time !== null && time !== '') {
+        var date = new Date(time)
+        return formatTimeToStr(date, 'yyyy-MM-dd hh:mm:ss')
+      } else {
+        return ''
+      }
+    }
+  },
+  mixins: [infoList],
   data() {
     return {
       fullscreenLoading: false,
       listApi: getFileList,
       path: path,
       tableData: [],
-      imageUrl: ""
-    };
+      imageUrl: ''
+    }
   },
   computed: {
-    ...mapGetters("user", ["userInfo", "token"])
+    ...mapGetters('user', ['userInfo', 'token'])
   },
-  filters: {
-    formatDate: function(time) {
-      if (time != null && time != "") {
-        var date = new Date(time);
-        return formatTimeToStr(date, "yyyy-MM-dd hh:mm:ss");
-      } else {
-        return "";
-      }
-    }
+  created() {
+    this.getTableData()
   },
   methods: {
     async deleteFile(row) {
-      this.$confirm("此操作将永久文件, 是否继续?", "提示", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning"
+      this.$confirm('此操作将永久文件, 是否继续?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
       })
-        .then(async () => {
-          const res = await deleteFile(row);
-          if (res.code == 0) {
+        .then(async() => {
+          const res = await deleteFile(row)
+          if (res.code === 0) {
             this.$message({
-              type: "success",
-              message: "删除成功!"
-            });
-            if (this.tableData.length == 1 && this.page > 1 ) {
-              this.page--;
+              type: 'success',
+              message: '删除成功!'
+            })
+            if (this.tableData.length === 1 && this.page > 1) {
+              this.page--
             }
-            this.getTableData();
+            this.getTableData()
           }
         })
         .catch(() => {
           this.$message({
-            type: "info",
-            message: "已取消删除"
-          });
-        });
+            type: 'info',
+            message: '已取消删除'
+          })
+        })
     },
     checkFile(file) {
-      this.fullscreenLoading = true;
-      const isJPG = file.type === "image/jpeg";
-      const isPng = file.type === "image/png";
-      const isLt2M = file.size / 1024 / 1024 < 2;
+      this.fullscreenLoading = true
+      const isJPG = file.type === 'image/jpeg'
+      const isPng = file.type === 'image/png'
+      const isLt2M = file.size / 1024 / 1024 < 2
       if (!isJPG && !isPng) {
-        this.$message.error("上传头像图片只能是 JPG或png 格式!");
-        this.fullscreenLoading = false;
+        this.$message.error('上传头像图片只能是 JPG或png 格式!')
+        this.fullscreenLoading = false
       }
       if (!isLt2M) {
-        this.$message.error("上传头像图片大小不能超过 2MB!");
-        this.fullscreenLoading = false;
+        this.$message.error('上传头像图片大小不能超过 2MB!')
+        this.fullscreenLoading = false
       }
-      return (isPng || isJPG) && isLt2M;
+      return (isPng || isJPG) && isLt2M
     },
     uploadSuccess(res) {
-      this.fullscreenLoading = false;
-      if (res.code == 0) {
+      this.fullscreenLoading = false
+      if (res.code === 0) {
         this.$message({
-          type: "success",
-          message: "上传成功"
-        });
-        if (res.code == 0) {
-          this.getTableData();
+          type: 'success',
+          message: '上传成功'
+        })
+        if (res.code === 0) {
+          this.getTableData()
         }
       } else {
         this.$message({
-          type: "warning",
+          type: 'warning',
           message: res.msg
-        });
+        })
       }
     },
     uploadError() {
       this.$message({
-        type: "error",
-        message: "上传失败"
-      });
-      this.fullscreenLoading = false;
+        type: 'error',
+        message: '上传失败'
+      })
+      this.fullscreenLoading = false
     },
     downloadFile(row) {
-      downloadImage(row.url, row.name);
+      downloadImage(row.url, row.name)
     }
-  },
-  created() {
-    this.getTableData();
   }
-};
+}
 </script>

+ 296 - 297
web/src/view/iconList/index.vue

@@ -1,305 +1,304 @@
 <template>
-    <ul class="icon-list clearfix">
-        <li v-for="item in iconList" :key="item">
-          <span>
-            <i :class="item"></i>
-            <span class="icon-name">{{item}}</span>
-          </span>
-        </li>
-    </ul>
+  <ul class="icon-list clearfix">
+    <li v-for="item in iconList" :key="item">
+      <span>
+        <i :class="item" />
+        <span class="icon-name">{{ item }}</span>
+      </span>
+    </li>
+  </ul>
 </template>
 
 <script>
-    export default {
-        name: 'IconList',
-        data() {
-            return {
-              iconList : [
-                "el-icon-platform-eleme",
-                "el-icon-eleme",
-                "el-icon-delete-solid",
-                "el-icon-delete",
-                "el-icon-s-tools",
-                "el-icon-setting",
-                "el-icon-user-solid",
-                "el-icon-user",
-                "el-icon-phone",
-                "el-icon-phone-outline",
-                "el-icon-more",
-                "el-icon-more-outline",
-                "el-icon-star-on",
-                "el-icon-star-off",
-                "el-icon-s-goods",
-                "el-icon-goods",
-                "el-icon-warning",
-                "el-icon-warning-outline",
-                "el-icon-question",
-                "el-icon-info",
-                "el-icon-remove",
-                "el-icon-circle-plus",
-                "el-icon-success",
-                "el-icon-error",
-                "el-icon-zoom-in",
-                "el-icon-zoom-out",
-                "el-icon-remove-outline",
-                "el-icon-circle-plus-outline",
-                "el-icon-circle-check",
-                "el-icon-circle-close",
-                "el-icon-s-help",
-                "el-icon-help",
-                "el-icon-minus",
-                "el-icon-plus",
-                "el-icon-check",
-                "el-icon-close",
-                "el-icon-picture",
-                "el-icon-picture-outline",
-                "el-icon-picture-outline-round",
-                "el-icon-upload",
-                "el-icon-upload2",
-                "el-icon-download",
-                "el-icon-camera-solid",
-                "el-icon-camera",
-                "el-icon-video-camera-solid",
-                "el-icon-video-camera",
-                "el-icon-message-solid",
-                "el-icon-bell",
-                "el-icon-s-cooperation",
-                "el-icon-s-order",
-                "el-icon-s-platform",
-                "el-icon-s-fold",
-                "el-icon-s-unfold",
-                "el-icon-s-operation",
-                "el-icon-s-promotion",
-                "el-icon-s-home",
-                "el-icon-s-release",
-                "el-icon-s-ticket",
-                "el-icon-s-management",
-                "el-icon-s-open",
-                "el-icon-s-shop",
-                "el-icon-s-marketing",
-                "el-icon-s-flag",
-                "el-icon-s-comment",
-                "el-icon-s-finance",
-                "el-icon-s-claim",
-                "el-icon-s-custom",
-                "el-icon-s-opportunity",
-                "el-icon-s-data",
-                "el-icon-s-check",
-                "el-icon-s-grid",
-                "el-icon-menu",
-                "el-icon-share",
-                "el-icon-d-caret",
-                "el-icon-caret-left",
-                "el-icon-caret-right",
-                "el-icon-caret-bottom",
-                "el-icon-caret-top",
-                "el-icon-bottom-left",
-                "el-icon-bottom-right",
-                "el-icon-back",
-                "el-icon-right",
-                "el-icon-bottom",
-                "el-icon-top",
-                "el-icon-top-left",
-                "el-icon-top-right",
-                "el-icon-arrow-left",
-                "el-icon-arrow-right",
-                "el-icon-arrow-down",
-                "el-icon-arrow-up",
-                "el-icon-d-arrow-left",
-                "el-icon-d-arrow-right",
-                "el-icon-video-pause",
-                "el-icon-video-play",
-                "el-icon-refresh",
-                "el-icon-refresh-right",
-                "el-icon-refresh-left",
-                "el-icon-finished",
-                "el-icon-sort",
-                "el-icon-sort-up",
-                "el-icon-sort-down",
-                "el-icon-rank",
-                "el-icon-loading",
-                "el-icon-view",
-                "el-icon-c-scale-to-original",
-                "el-icon-date",
-                "el-icon-edit",
-                "el-icon-edit-outline",
-                "el-icon-folder",
-                "el-icon-folder-opened",
-                "el-icon-folder-add",
-                "el-icon-folder-remove",
-                "el-icon-folder-delete",
-                "el-icon-folder-checked",
-                "el-icon-tickets",
-                "el-icon-document-remove",
-                "el-icon-document-delete",
-                "el-icon-document-copy",
-                "el-icon-document-checked",
-                "el-icon-document",
-                "el-icon-document-add",
-                "el-icon-printer",
-                "el-icon-paperclip",
-                "el-icon-takeaway-box",
-                "el-icon-search",
-                "el-icon-monitor",
-                "el-icon-attract",
-                "el-icon-mobile",
-                "el-icon-scissors",
-                "el-icon-umbrella",
-                "el-icon-headset",
-                "el-icon-brush",
-                "el-icon-mouse",
-                "el-icon-coordinate",
-                "el-icon-magic-stick",
-                "el-icon-reading",
-                "el-icon-data-line",
-                "el-icon-data-board",
-                "el-icon-pie-chart",
-                "el-icon-data-analysis",
-                "el-icon-collection-tag",
-                "el-icon-film",
-                "el-icon-suitcase",
-                "el-icon-suitcase-1",
-                "el-icon-receiving",
-                "el-icon-collection",
-                "el-icon-files",
-                "el-icon-notebook-1",
-                "el-icon-notebook-2",
-                "el-icon-toilet-paper",
-                "el-icon-office-building",
-                "el-icon-school",
-                "el-icon-table-lamp",
-                "el-icon-house",
-                "el-icon-no-smoking",
-                "el-icon-smoking",
-                "el-icon-shopping-cart-full",
-                "el-icon-shopping-cart-1",
-                "el-icon-shopping-cart-2",
-                "el-icon-shopping-bag-1",
-                "el-icon-shopping-bag-2",
-                "el-icon-sold-out",
-                "el-icon-sell",
-                "el-icon-present",
-                "el-icon-box",
-                "el-icon-bank-card",
-                "el-icon-money",
-                "el-icon-coin",
-                "el-icon-wallet",
-                "el-icon-discount",
-                "el-icon-price-tag",
-                "el-icon-news",
-                "el-icon-guide",
-                "el-icon-male",
-                "el-icon-female",
-                "el-icon-thumb",
-                "el-icon-cpu",
-                "el-icon-link",
-                "el-icon-connection",
-                "el-icon-open",
-                "el-icon-turn-off",
-                "el-icon-set-up",
-                "el-icon-chat-round",
-                "el-icon-chat-line-round",
-                "el-icon-chat-square",
-                "el-icon-chat-dot-round",
-                "el-icon-chat-dot-square",
-                "el-icon-chat-line-square",
-                "el-icon-message",
-                "el-icon-postcard",
-                "el-icon-position",
-                "el-icon-turn-off-microphone",
-                "el-icon-microphone",
-                "el-icon-close-notification",
-                "el-icon-bangzhu",
-                "el-icon-time",
-                "el-icon-odometer",
-                "el-icon-crop",
-                "el-icon-aim",
-                "el-icon-switch-button",
-                "el-icon-full-screen",
-                "el-icon-copy-document",
-                "el-icon-mic",
-                "el-icon-stopwatch",
-                "el-icon-medal-1",
-                "el-icon-medal",
-                "el-icon-trophy",
-                "el-icon-trophy-1",
-                "el-icon-first-aid-kit",
-                "el-icon-discover",
-                "el-icon-place",
-                "el-icon-location",
-                "el-icon-location-outline",
-                "el-icon-location-information",
-                "el-icon-add-location",
-                "el-icon-delete-location",
-                "el-icon-map-location",
-                "el-icon-alarm-clock",
-                "el-icon-timer",
-                "el-icon-watch-1",
-                "el-icon-watch",
-                "el-icon-lock",
-                "el-icon-unlock",
-                "el-icon-key",
-                "el-icon-service",
-                "el-icon-mobile-phone",
-                "el-icon-bicycle",
-                "el-icon-truck",
-                "el-icon-ship",
-                "el-icon-basketball",
-                "el-icon-football",
-                "el-icon-soccer",
-                "el-icon-baseball",
-                "el-icon-wind-power",
-                "el-icon-light-rain",
-                "el-icon-lightning",
-                "el-icon-heavy-rain",
-                "el-icon-sunrise",
-                "el-icon-sunrise-1",
-                "el-icon-sunset",
-                "el-icon-sunny",
-                "el-icon-cloudy",
-                "el-icon-partly-cloudy",
-                "el-icon-cloudy-and-sunny",
-                "el-icon-moon",
-                "el-icon-moon-night",
-                "el-icon-dish",
-                "el-icon-dish-1",
-                "el-icon-food",
-                "el-icon-chicken",
-                "el-icon-fork-spoon",
-                "el-icon-knife-fork",
-                "el-icon-burger",
-                "el-icon-tableware",
-                "el-icon-sugar",
-                "el-icon-dessert",
-                "el-icon-ice-cream",
-                "el-icon-hot-water",
-                "el-icon-water-cup",
-                "el-icon-coffee-cup",
-                "el-icon-cold-drink",
-                "el-icon-goblet",
-                "el-icon-goblet-full",
-                "el-icon-goblet-square",
-                "el-icon-goblet-square-full",
-                "el-icon-refrigerator",
-                "el-icon-grape",
-                "el-icon-watermelon",
-                "el-icon-cherry",
-                "el-icon-apple",
-                "el-icon-pear",
-                "el-icon-orange",
-                "el-icon-coffee",
-                "el-icon-ice-tea",
-                "el-icon-ice-drink",
-                "el-icon-milk-tea",
-                "el-icon-potato-strips",
-                "el-icon-lollipop",
-                "el-icon-ice-cream-square",
-                "el-icon-ice-cream-round",
-              ]
-            }
-        },
-      
+export default {
+  name: 'IconList',
+  data() {
+    return {
+      iconList: [
+        'el-icon-platform-eleme',
+        'el-icon-eleme',
+        'el-icon-delete-solid',
+        'el-icon-delete',
+        'el-icon-s-tools',
+        'el-icon-setting',
+        'el-icon-user-solid',
+        'el-icon-user',
+        'el-icon-phone',
+        'el-icon-phone-outline',
+        'el-icon-more',
+        'el-icon-more-outline',
+        'el-icon-star-on',
+        'el-icon-star-off',
+        'el-icon-s-goods',
+        'el-icon-goods',
+        'el-icon-warning',
+        'el-icon-warning-outline',
+        'el-icon-question',
+        'el-icon-info',
+        'el-icon-remove',
+        'el-icon-circle-plus',
+        'el-icon-success',
+        'el-icon-error',
+        'el-icon-zoom-in',
+        'el-icon-zoom-out',
+        'el-icon-remove-outline',
+        'el-icon-circle-plus-outline',
+        'el-icon-circle-check',
+        'el-icon-circle-close',
+        'el-icon-s-help',
+        'el-icon-help',
+        'el-icon-minus',
+        'el-icon-plus',
+        'el-icon-check',
+        'el-icon-close',
+        'el-icon-picture',
+        'el-icon-picture-outline',
+        'el-icon-picture-outline-round',
+        'el-icon-upload',
+        'el-icon-upload2',
+        'el-icon-download',
+        'el-icon-camera-solid',
+        'el-icon-camera',
+        'el-icon-video-camera-solid',
+        'el-icon-video-camera',
+        'el-icon-message-solid',
+        'el-icon-bell',
+        'el-icon-s-cooperation',
+        'el-icon-s-order',
+        'el-icon-s-platform',
+        'el-icon-s-fold',
+        'el-icon-s-unfold',
+        'el-icon-s-operation',
+        'el-icon-s-promotion',
+        'el-icon-s-home',
+        'el-icon-s-release',
+        'el-icon-s-ticket',
+        'el-icon-s-management',
+        'el-icon-s-open',
+        'el-icon-s-shop',
+        'el-icon-s-marketing',
+        'el-icon-s-flag',
+        'el-icon-s-comment',
+        'el-icon-s-finance',
+        'el-icon-s-claim',
+        'el-icon-s-custom',
+        'el-icon-s-opportunity',
+        'el-icon-s-data',
+        'el-icon-s-check',
+        'el-icon-s-grid',
+        'el-icon-menu',
+        'el-icon-share',
+        'el-icon-d-caret',
+        'el-icon-caret-left',
+        'el-icon-caret-right',
+        'el-icon-caret-bottom',
+        'el-icon-caret-top',
+        'el-icon-bottom-left',
+        'el-icon-bottom-right',
+        'el-icon-back',
+        'el-icon-right',
+        'el-icon-bottom',
+        'el-icon-top',
+        'el-icon-top-left',
+        'el-icon-top-right',
+        'el-icon-arrow-left',
+        'el-icon-arrow-right',
+        'el-icon-arrow-down',
+        'el-icon-arrow-up',
+        'el-icon-d-arrow-left',
+        'el-icon-d-arrow-right',
+        'el-icon-video-pause',
+        'el-icon-video-play',
+        'el-icon-refresh',
+        'el-icon-refresh-right',
+        'el-icon-refresh-left',
+        'el-icon-finished',
+        'el-icon-sort',
+        'el-icon-sort-up',
+        'el-icon-sort-down',
+        'el-icon-rank',
+        'el-icon-loading',
+        'el-icon-view',
+        'el-icon-c-scale-to-original',
+        'el-icon-date',
+        'el-icon-edit',
+        'el-icon-edit-outline',
+        'el-icon-folder',
+        'el-icon-folder-opened',
+        'el-icon-folder-add',
+        'el-icon-folder-remove',
+        'el-icon-folder-delete',
+        'el-icon-folder-checked',
+        'el-icon-tickets',
+        'el-icon-document-remove',
+        'el-icon-document-delete',
+        'el-icon-document-copy',
+        'el-icon-document-checked',
+        'el-icon-document',
+        'el-icon-document-add',
+        'el-icon-printer',
+        'el-icon-paperclip',
+        'el-icon-takeaway-box',
+        'el-icon-search',
+        'el-icon-monitor',
+        'el-icon-attract',
+        'el-icon-mobile',
+        'el-icon-scissors',
+        'el-icon-umbrella',
+        'el-icon-headset',
+        'el-icon-brush',
+        'el-icon-mouse',
+        'el-icon-coordinate',
+        'el-icon-magic-stick',
+        'el-icon-reading',
+        'el-icon-data-line',
+        'el-icon-data-board',
+        'el-icon-pie-chart',
+        'el-icon-data-analysis',
+        'el-icon-collection-tag',
+        'el-icon-film',
+        'el-icon-suitcase',
+        'el-icon-suitcase-1',
+        'el-icon-receiving',
+        'el-icon-collection',
+        'el-icon-files',
+        'el-icon-notebook-1',
+        'el-icon-notebook-2',
+        'el-icon-toilet-paper',
+        'el-icon-office-building',
+        'el-icon-school',
+        'el-icon-table-lamp',
+        'el-icon-house',
+        'el-icon-no-smoking',
+        'el-icon-smoking',
+        'el-icon-shopping-cart-full',
+        'el-icon-shopping-cart-1',
+        'el-icon-shopping-cart-2',
+        'el-icon-shopping-bag-1',
+        'el-icon-shopping-bag-2',
+        'el-icon-sold-out',
+        'el-icon-sell',
+        'el-icon-present',
+        'el-icon-box',
+        'el-icon-bank-card',
+        'el-icon-money',
+        'el-icon-coin',
+        'el-icon-wallet',
+        'el-icon-discount',
+        'el-icon-price-tag',
+        'el-icon-news',
+        'el-icon-guide',
+        'el-icon-male',
+        'el-icon-female',
+        'el-icon-thumb',
+        'el-icon-cpu',
+        'el-icon-link',
+        'el-icon-connection',
+        'el-icon-open',
+        'el-icon-turn-off',
+        'el-icon-set-up',
+        'el-icon-chat-round',
+        'el-icon-chat-line-round',
+        'el-icon-chat-square',
+        'el-icon-chat-dot-round',
+        'el-icon-chat-dot-square',
+        'el-icon-chat-line-square',
+        'el-icon-message',
+        'el-icon-postcard',
+        'el-icon-position',
+        'el-icon-turn-off-microphone',
+        'el-icon-microphone',
+        'el-icon-close-notification',
+        'el-icon-bangzhu',
+        'el-icon-time',
+        'el-icon-odometer',
+        'el-icon-crop',
+        'el-icon-aim',
+        'el-icon-switch-button',
+        'el-icon-full-screen',
+        'el-icon-copy-document',
+        'el-icon-mic',
+        'el-icon-stopwatch',
+        'el-icon-medal-1',
+        'el-icon-medal',
+        'el-icon-trophy',
+        'el-icon-trophy-1',
+        'el-icon-first-aid-kit',
+        'el-icon-discover',
+        'el-icon-place',
+        'el-icon-location',
+        'el-icon-location-outline',
+        'el-icon-location-information',
+        'el-icon-add-location',
+        'el-icon-delete-location',
+        'el-icon-map-location',
+        'el-icon-alarm-clock',
+        'el-icon-timer',
+        'el-icon-watch-1',
+        'el-icon-watch',
+        'el-icon-lock',
+        'el-icon-unlock',
+        'el-icon-key',
+        'el-icon-service',
+        'el-icon-mobile-phone',
+        'el-icon-bicycle',
+        'el-icon-truck',
+        'el-icon-ship',
+        'el-icon-basketball',
+        'el-icon-football',
+        'el-icon-soccer',
+        'el-icon-baseball',
+        'el-icon-wind-power',
+        'el-icon-light-rain',
+        'el-icon-lightning',
+        'el-icon-heavy-rain',
+        'el-icon-sunrise',
+        'el-icon-sunrise-1',
+        'el-icon-sunset',
+        'el-icon-sunny',
+        'el-icon-cloudy',
+        'el-icon-partly-cloudy',
+        'el-icon-cloudy-and-sunny',
+        'el-icon-moon',
+        'el-icon-moon-night',
+        'el-icon-dish',
+        'el-icon-dish-1',
+        'el-icon-food',
+        'el-icon-chicken',
+        'el-icon-fork-spoon',
+        'el-icon-knife-fork',
+        'el-icon-burger',
+        'el-icon-tableware',
+        'el-icon-sugar',
+        'el-icon-dessert',
+        'el-icon-ice-cream',
+        'el-icon-hot-water',
+        'el-icon-water-cup',
+        'el-icon-coffee-cup',
+        'el-icon-cold-drink',
+        'el-icon-goblet',
+        'el-icon-goblet-full',
+        'el-icon-goblet-square',
+        'el-icon-goblet-square-full',
+        'el-icon-refrigerator',
+        'el-icon-grape',
+        'el-icon-watermelon',
+        'el-icon-cherry',
+        'el-icon-apple',
+        'el-icon-pear',
+        'el-icon-orange',
+        'el-icon-coffee',
+        'el-icon-ice-tea',
+        'el-icon-ice-drink',
+        'el-icon-milk-tea',
+        'el-icon-potato-strips',
+        'el-icon-lollipop',
+        'el-icon-ice-cream-square',
+        'el-icon-ice-cream-round'
+      ]
     }
+  }
+}
 </script>
 
 <style lang="scss" scoped>

+ 33 - 33
web/src/view/init/init.vue

@@ -5,28 +5,27 @@
     <div class="form-card in-three a-fadeinB">
       <el-form ref="form" :model="form" label-width="100px">
         <el-form-item label="数据库类型">
-          <el-select disabled v-model="form.sqlType" placeholder="请选择">
-            <el-option key="mysql" label="mysql(目前只支持mysql)" value="mysql">
-            </el-option>
+          <el-select v-model="form.sqlType" disabled placeholder="请选择">
+            <el-option key="mysql" label="mysql(目前只支持mysql)" value="mysql" />
           </el-select>
         </el-form-item>
         <el-form-item label="host">
-          <el-input v-model="form.host" placeholder="请输入数据库链接"></el-input>
+          <el-input v-model="form.host" placeholder="请输入数据库链接" />
         </el-form-item>
         <el-form-item label="port">
-          <el-input v-model="form.port" placeholder="请输入数据库端口"></el-input>
+          <el-input v-model="form.port" placeholder="请输入数据库端口" />
         </el-form-item>
         <el-form-item label="userName">
-          <el-input v-model="form.userName" placeholder="请输入数据库用户名"></el-input>
+          <el-input v-model="form.userName" placeholder="请输入数据库用户名" />
         </el-form-item>
         <el-form-item label="password">
           <el-input
             v-model="form.password"
             placeholder="请输入数据库密码(没有则为空)"
-          ></el-input>
+          />
         </el-form-item>
         <el-form-item label="dbName">
-          <el-input v-model="form.dbName" placeholder="请输入数据库名称"></el-input>
+          <el-input v-model="form.dbName" placeholder="请输入数据库名称" />
         </el-form-item>
         <el-form-item>
           <div style="text-align: right">
@@ -39,46 +38,47 @@
 </template>
 
 <script>
-import { initDB } from "@/api/initdb";
+import { initDB } from '@/api/initdb'
 export default {
-  name: "Init",
+  name: 'Init',
   data() {
     return {
       form: {
-        sqlType: "mysql",
-        host: "127.0.0.1",
-        port: "3306",
-        userName: "root",
-        password: "",
-        dbName: "gva",
-      },
-    };
+        sqlType: 'mysql',
+        host: '127.0.0.1',
+        port: '3306',
+        userName: 'root',
+        password: '',
+        dbName: 'gva'
+      }
+    }
   },
   methods: {
     async onSubmit() {
       const loading = this.$loading({
         lock: true,
-        text: "正在初始化数据库,请稍候",
-        spinner: "el-icon-loading",
-        background: "rgba(0, 0, 0, 0.7)",
-      });
+        text: '正在初始化数据库,请稍候',
+        spinner: 'el-icon-loading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      })
       try {
-        const res = await initDB(this.form);
-        if (res.code == 0) {
+        const res = await initDB(this.form)
+        if (res.code === 0) {
           this.$message({
-            type: "success",
-            message: res.msg,
-          });
-          this.$router.push({name:"login"})
+            type: 'success',
+            message: res.msg
+          })
+          this.$router.push({ name: 'Login' })
         }
-          loading.close();
+        loading.close()
       } catch (err) {
-          loading.close();
+        loading.close()
       }
-    },
-  },
-};
+    }
+  }
+}
 </script>
+
 <style lang="scss">
 .init {
   height: 100vh;

+ 4 - 6
web/src/view/layout/aside/asideComponent/asyncSubmenu.vue

@@ -1,10 +1,10 @@
 <template>
-  <el-submenu :popper-append-to-body="false" ref="subMenu" :index="routerInfo.name">
+  <el-submenu ref="subMenu" :popper-append-to-body="false" :index="routerInfo.name">
     <template slot="title">
-      <i :class="'el-icon-'+routerInfo.meta.icon"></i>
-      <span slot="title">{{routerInfo.meta.title}}</span>
+      <i :class="'el-icon-'+routerInfo.meta.icon" />
+      <span slot="title">{{ routerInfo.meta.title }}</span>
     </template>
-    <slot></slot>
+    <slot />
   </el-submenu>
 </template>
 
@@ -21,5 +21,3 @@ export default {
   }
 }
 </script>
-<style lang="scss">
-</style>

+ 13 - 15
web/src/view/layout/aside/asideComponent/index.vue

@@ -1,7 +1,7 @@
 <template>
-  <component :is="menuComponent" :routerInfo="routerInfo" v-if="!routerInfo.hidden">
+  <component :is="menuComponent" v-if="!routerInfo.hidden" :router-info="routerInfo">
     <template v-if="routerInfo.children&&routerInfo.children.length">
-      <AsideComponent :key="item.name" :routerInfo="item" v-for="item in routerInfo.children" />
+      <AsideComponent v-for="item in routerInfo.children" :key="item.name" :router-info="item" />
     </template>
   </component>
 </template>
@@ -12,14 +12,9 @@ import AsyncSubmenu from './asyncSubmenu'
 
 export default {
   name: 'AsideComponent',
-  computed: {
-    menuComponent() {
-      if (this.routerInfo.children&&this.routerInfo.children.filter(item=>!item.hidden).length) {
-        return 'AsyncSubmenu'
-      } else {
-        return 'MenuItem'
-      }
-    }
+  components: {
+    MenuItem,
+    AsyncSubmenu
   },
   props: {
     routerInfo: {
@@ -29,11 +24,14 @@ export default {
       type: Object
     }
   },
-  components: {
-    MenuItem,
-    AsyncSubmenu
+  computed: {
+    menuComponent() {
+      if (this.routerInfo.children && this.routerInfo.children.filter(item => !item.hidden).length) {
+        return 'AsyncSubmenu'
+      } else {
+        return 'MenuItem'
+      }
+    }
   }
 }
 </script>
-<style lang="scss">
-</style>

+ 2 - 4
web/src/view/layout/aside/asideComponent/menuItem.vue

@@ -1,7 +1,7 @@
 <template>
   <el-menu-item :index="routerInfo.name" :route="{parameters:routerInfo.parameters}">
-    <i :class="'el-icon-'+routerInfo.meta.icon"></i>
-    <span slot="title">{{routerInfo.meta.title}}</span>
+    <i :class="'el-icon-'+routerInfo.meta.icon" />
+    <span slot="title">{{ routerInfo.meta.title }}</span>
   </el-menu-item>
 </template>
 
@@ -18,5 +18,3 @@ export default {
   }
 }
 </script>
-<style lang="scss">
-</style>

+ 133 - 131
web/src/view/layout/aside/historyComponent/history.vue

@@ -1,24 +1,24 @@
 <template>
   <div class="router-history">
     <el-tabs
-      :closable="!(historys.length==1&&this.$route.name==defaultRouter)"
+      v-model="activeValue"
+      :closable="!(historys.length===1&&this.$route.name===defaultRouter)"
+      type="card"
       @contextmenu.prevent.native="openContextMenu($event)"
       @tab-click="changeTab"
       @tab-remove="removeTab"
-      type="card"
-      v-model="activeValue"
     >
       <el-tab-pane
+        v-for="item in historys"
         :key="item.name + JSON.stringify(item.query)+JSON.stringify(item.params)"
         :label="item.meta.title"
         :name="item.name + JSON.stringify(item.query)+JSON.stringify(item.params)"
         :tab="item"
-        v-for="item in historys"
-      ></el-tab-pane>
+      />
     </el-tabs>
 
     <!--自定义右键菜单html代码-->
-    <ul :style="{left:left+'px',top:top+'px'}" class="contextmenu" v-show="contextMenuVisible">
+    <ul v-show="contextMenuVisible" :style="{left:left+'px',top:top+'px'}" class="contextmenu">
       <li @click="closeAll">关闭所有</li>
       <li @click="closeLeft">关闭左侧</li>
       <li @click="closeRight">关闭右侧</li>
@@ -26,84 +26,107 @@
     </ul>
   </div>
 </template>
+
 <script>
-import { mapGetters } from "vuex";
- const getFmtString = (item)=>{
-         return item.name +
-            JSON.stringify(item.query) +
-            JSON.stringify(item.params)
-    }
+import { mapGetters } from 'vuex'
+const getFmtString = (item) => {
+  return item.name +
+      JSON.stringify(item.query) +
+      JSON.stringify(item.params)
+}
 export default {
-  name: "HistoryComponent",
+  name: 'HistoryComponent',
   data() {
     return {
       historys: [],
-      activeValue: "",
+      activeValue: '',
       contextMenuVisible: false,
       left: 0,
       top: 0,
       isCollapse: false,
       isMobile: false,
-      rightActive: ""
-    };
+      rightActive: ''
+    }
   },
   computed: {
-    ...mapGetters("user", ["userInfo"]),
+    ...mapGetters('user', ['userInfo']),
     defaultRouter() {
-      return this.userInfo.authority.defaultRouter;
+      return this.userInfo.authority.defaultRouter
+    }
+  },
+  watch: {
+    contextMenuVisible() {
+      if (this.contextMenuVisible) {
+        document.body.addEventListener('click', () => {
+          this.contextMenuVisible = false
+        })
+      } else {
+        document.body.removeEventListener('click', () => {
+          this.contextMenuVisible = false
+        })
+      }
+    },
+    $route(to, now) {
+      this.historys = this.historys.filter(item => !item.meta.closeTab)
+      this.setTab(to)
+      sessionStorage.setItem('historys', JSON.stringify(this.historys))
+      this.activeValue = window.sessionStorage.getItem('activeValue')
+      if (now && to && now.name === to.name) {
+        this.$bus.$emit('reload')
+      }
     }
   },
   created() {
-    this.$bus.on("mobile", isMobile => {
-      this.isMobile = isMobile;
-    });
-    this.$bus.on("collapse", isCollapse => {
-      this.isCollapse = isCollapse;
-    });
+    this.$bus.on('mobile', isMobile => {
+      this.isMobile = isMobile
+    })
+    this.$bus.on('collapse', isCollapse => {
+      this.isCollapse = isCollapse
+    })
     const initHistorys = [
       {
         name: this.defaultRouter,
         meta: {
-          title: "首页"
+          title: '首页'
         },
         query: {},
         params: {}
       }
-    ];
+    ]
     this.historys =
-      JSON.parse(sessionStorage.getItem("historys")) || initHistorys;
-      if(!window.sessionStorage.getItem("activeValue")){
-        this.activeValue = getFmtString(this.$route)
-      }else{
-        this.activeValue = window.sessionStorage.getItem("activeValue");
-      }
-    this.setTab(this.$route);
+      JSON.parse(sessionStorage.getItem('historys')) || initHistorys
+    if (!window.sessionStorage.getItem('activeValue')) {
+      this.activeValue = getFmtString(this.$route)
+    } else {
+      this.activeValue = window.sessionStorage.getItem('activeValue')
+    }
+    this.setTab(this.$route)
   },
 
   beforeDestroy() {
-    this.$bus.off("collapse");
-    this.$bus.off("mobile");
+    this.$bus.off('collapse')
+    this.$bus.off('mobile')
   },
   methods: {
-   
+
     openContextMenu(e) {
-      if (this.historys.length == 1 && this.$route.name == this.defaultRouter) {
-        return false;
+      if (this.historys.length === 1 && this.$route.name === this.defaultRouter) {
+        return false
       }
       if (e.srcElement.id) {
-        this.contextMenuVisible = true;
-        let width;
+        this.contextMenuVisible = true
+        let width
         if (this.isCollapse) {
-          width = 54;
+          width = 54
         } else {
-          width = 220;
+          width = 220
         }
         if (this.isMobile) {
-          width = 0;
+          width = 0
         }
-        this.left = e.clientX - width;
-        this.top = e.clientY + 10;
-        this.rightActive = e.srcElement.id.split("-")[1];
+        this.left = e.clientX - width
+        this.top = e.clientY + 10
+        this.rightActive = e.srcElement.id.split('-')[1]
       }
     },
     closeAll() {
@@ -111,155 +134,134 @@ export default {
         {
           name: this.defaultRouter,
           meta: {
-            title: "首页"
+            title: '首页'
           },
           query: {},
           params: {}
         }
-      ];
-      this.$router.push({ name: this.defaultRouter });
-      this.contextMenuVisible = false;
-      sessionStorage.setItem("historys", JSON.stringify(this.historys));
+      ]
+      this.$router.push({ name: this.defaultRouter })
+      this.contextMenuVisible = false
+      sessionStorage.setItem('historys', JSON.stringify(this.historys))
     },
     closeLeft() {
-      let right;
+      let right
       const rightIndex = this.historys.findIndex(item => {
-        if (getFmtString(item) == this.rightActive) {
-          right = item;
+        if (getFmtString(item) === this.rightActive) {
+          right = item
         }
         return (
-          getFmtString(item) == this.rightActive
-        );
-      });
+          getFmtString(item) === this.rightActive
+        )
+      })
       const activeIndex = this.historys.findIndex(
-        item => getFmtString(item) == this.activeValue
-      );
-      this.historys.splice(0, rightIndex);
+        item => getFmtString(item) === this.activeValue
+      )
+      this.historys.splice(0, rightIndex)
       if (rightIndex > activeIndex) {
-        this.$router.push(right);
+        this.$router.push(right)
       }
-      sessionStorage.setItem("historys", JSON.stringify(this.historys));
+      sessionStorage.setItem('historys', JSON.stringify(this.historys))
     },
     closeRight() {
-      let right;
+      let right
       const leftIndex = this.historys.findIndex(item => {
-        if ( getFmtString(item) ==  this.rightActive ) {
-          right = item;
+        if (getFmtString(item) === this.rightActive) {
+          right = item
         }
-        return ( getFmtString(item) == this.rightActive );
-      });
+        return (getFmtString(item) === this.rightActive)
+      })
       const activeIndex = this.historys.findIndex(
-        item => getFmtString(item) == this.activeValue
-      );
-      this.historys.splice(leftIndex + 1, this.historys.length);
+        item => getFmtString(item) === this.activeValue
+      )
+      this.historys.splice(leftIndex + 1, this.historys.length)
       if (leftIndex < activeIndex) {
-        this.$router.push(right);
+        this.$router.push(right)
       }
-      sessionStorage.setItem("historys", JSON.stringify(this.historys));
+      sessionStorage.setItem('historys', JSON.stringify(this.historys))
     },
     closeOther() {
-      let right;
+      let right
       this.historys = this.historys.filter(item => {
-        if ( getFmtString(item) == this.rightActive
+        if (getFmtString(item) === this.rightActive
         ) {
-          right = item;
+          right = item
         }
-        return ( getFmtString(item) == this.rightActive
-        );
-      });
-      this.$router.push(right);
-      sessionStorage.setItem("historys", JSON.stringify(this.historys));
+        return (getFmtString(item) === this.rightActive
+        )
+      })
+      this.$router.push(right)
+      sessionStorage.setItem('historys', JSON.stringify(this.historys))
     },
     isSame(route1, route2) {
-      if (route1.name != route2.name) {
-        return false;
+      if (route1.name !== route2.name) {
+        return false
       }
-      for (let key in route1.query) {
-        if (route1.query[key] != route2.query[key]) {
-          return false;
+      for (const key in route1.query) {
+        if (route1.query[key] !== route2.query[key]) {
+          return false
         }
       }
-      for (let key in route1.params) {
-        if (route1.params[key] != route2.params[key]) {
-          return false;
+      for (const key in route1.params) {
+        if (route1.params[key] !== route2.params[key]) {
+          return false
         }
       }
-      return true;
+      return true
     },
     setTab(route) {
       if (!this.historys.some(item => this.isSame(item, route))) {
-        const obj = {};
-        obj.name = route.name;
-        obj.meta = route.meta;
-        obj.query = route.query;
-        obj.params = route.params;
-        this.historys.push(obj);
+        const obj = {}
+        obj.name = route.name
+        obj.meta = route.meta
+        obj.query = route.query
+        obj.params = route.params
+        this.historys.push(obj)
       }
       window.sessionStorage.setItem(
-        "activeValue",
+        'activeValue',
         getFmtString(this.$route)
-      );
+      )
     },
     changeTab(component) {
-      const tab = component.$attrs.tab;
+      const tab = component.$attrs.tab
       this.$router.push({
         name: tab.name,
         query: tab.query,
         params: tab.params
-      });
+      })
     },
     removeTab(tab) {
       const index = this.historys.findIndex(
-        item => getFmtString(item) ==  tab
-      );
+        item => getFmtString(item) === tab
+      )
       if (
-        getFmtString(this.$route) == tab
+        getFmtString(this.$route) === tab
       ) {
-        if (this.historys.length == 1) {
-          this.$router.push({ name: this.defaultRouter });
+        if (this.historys.length === 1) {
+          this.$router.push({ name: this.defaultRouter })
         } else {
           if (index < this.historys.length - 1) {
             this.$router.push({
               name: this.historys[index + 1].name,
               query: this.historys[index + 1].query,
               params: this.historys[index + 1].params
-            });
+            })
           } else {
             this.$router.push({
               name: this.historys[index - 1].name,
               query: this.historys[index - 1].query,
               params: this.historys[index - 1].params
-            });
+            })
           }
         }
       }
-      this.historys.splice(index, 1);
-    }
-  },
-  watch: {
-    contextMenuVisible() {
-      if (this.contextMenuVisible) {
-        document.body.addEventListener("click", () => {
-          this.contextMenuVisible = false;
-        });
-      } else {
-        document.body.removeEventListener("click", () => {
-          this.contextMenuVisible = false;
-        });
-      }
-    },
-    $route(to, now) {
-      this.historys = this.historys.filter(item => !item.meta.closeTab);
-      this.setTab(to);
-      sessionStorage.setItem("historys", JSON.stringify(this.historys));
-      this.activeValue = window.sessionStorage.getItem("activeValue");
-      if (now && to && now.name == to.name) {
-        this.$bus.$emit("reload");
-      }
+      this.historys.splice(index, 1)
     }
   }
-};
+}
 </script>
+
 <style lang="scss">
 .contextmenu {
   width: 100px;
@@ -283,4 +285,4 @@ export default {
   background: #f2f2f2;
   cursor: pointer;
 }
-</style>
+</style>

Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden.