diff --git a/.docker-compose/shell/server-handle.sh b/.docker-compose/shell/server-handle.sh index 1b53cf5d..46cec0fc 100644 --- a/.docker-compose/shell/server-handle.sh +++ b/.docker-compose/shell/server-handle.sh @@ -61,11 +61,11 @@ captcha: # mysql connect configuration mysql: - path: '177.7.0.13:3306' - config: 'charset=utf8mb4&parseTime=True&loc=Local' - db-name: 'qmPlus' - username: 'root' - password: 'Aa@6447985' + path: '' + config: '' + db-name: '' + username: '' + password: '' max-idle-conns: 10 max-open-conns: 100 log-mode: false diff --git a/docker-compose.yaml b/docker-compose.yaml index b78711fc..d997d799 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,4 +1,4 @@ -version: "3.8" +version: "3" networks: network: diff --git a/dockerfile_server b/dockerfile_server index 9cba8a42..54d23dda 100644 --- a/dockerfile_server +++ b/dockerfile_server @@ -12,20 +12,17 @@ RUN sh ./server-handle.sh RUN rm -f server-handle.sh RUN cat ./config.yaml -RUN go build -o gva cmd/main.go RUN go env && go build -o server . - FROM alpine:latest LABEL MAINTAINER="SliverHorn@sliver_horn@qq.com" WORKDIR /go/src/gin-vue-admin -COPY --from=0 /go/src/gin-vue-admin/gva ./ COPY --from=0 /go/src/gin-vue-admin/server ./ COPY --from=0 /go/src/gin-vue-admin/config.yaml ./ COPY --from=0 /go/src/gin-vue-admin/resource ./resource EXPOSE 8888 -ENTRYPOINT ./gva initdb && ./server +ENTRYPOINT ./server diff --git a/server/api/v1/exa_excel.go b/server/api/v1/exa_excel.go index 2aa70db5..62807817 100644 --- a/server/api/v1/exa_excel.go +++ b/server/api/v1/exa_excel.go @@ -82,7 +82,7 @@ func LoadExcel(c *gin.Context) { // @Security ApiKeyAuth // @accept multipart/form-data // @Produce application/json -// @Param fileName query fileName true "模板名称" +// @Param fileName query string true "模板名称" // @Success 200 // @Router /excel/downloadTemplate [get] func DownloadTemplate(c *gin.Context) { diff --git a/server/config.yaml b/server/config.yaml index 7b4d25ac..658bce95 100644 --- a/server/config.yaml +++ b/server/config.yaml @@ -64,6 +64,21 @@ mysql: log-mode: false log-zap: "" +autoCode: + root: '' + server: '/server' + server-api: '/api/v1' + server-model: '/model' + server-request: '/model/request/' + server-router: '/router' + server-service: '/service' + + web: '/web/src' + web-api: '/api' + web-form: '/view' + web-table: '/view' + web-flow: '/view' + # local configuration local: path: 'uploads/file' diff --git a/server/config/auto_code.go b/server/config/auto_code.go new file mode 100644 index 00000000..9c230f9e --- /dev/null +++ b/server/config/auto_code.go @@ -0,0 +1,16 @@ +package config + +type Autocode struct { + Root string `mapstructure:"root" json:"root" yaml:"root"` + Server string `mapstructure:"server" json:"server" yaml:"server"` + SApi string `mapstructure:"server-api" json:"serverApi" yaml:"server-api"` + SModel string `mapstructure:"server-model" json:"serverModel" yaml:"server-model"` + SRequest string `mapstructure:"server-request" json:"serverRequest" yaml:"server-request"` + SRouter string `mapstructure:"server-router" json:"serverRouter" yaml:"server-router"` + SService string `mapstructure:"server-service" json:"serverService" yaml:"server-service"` + Web string `mapstructure:"web" json:"web" yaml:"web"` + WApi string `mapstructure:"web-api" json:"webApi" yaml:"web-api"` + WForm string `mapstructure:"web-form" json:"webForm" yaml:"web-form"` + WTable string `mapstructure:"web-table" json:"webTable" yaml:"web-table"` + WFlow string `mapstructure:"web-flow" json:"webFlow" yaml:"web-flow"` +} diff --git a/server/config/config.go b/server/config/config.go index 6f391403..ab88c827 100644 --- a/server/config/config.go +++ b/server/config/config.go @@ -8,12 +8,14 @@ type Server struct { Casbin Casbin `mapstructure:"casbin" json:"casbin" yaml:"casbin"` System System `mapstructure:"system" json:"system" yaml:"system"` Captcha Captcha `mapstructure:"captcha" json:"captcha" yaml:"captcha"` + // aoto + AutoCode Autocode `mapstructure:"autoCode" json:"autoCode" yaml:"autoCode"` // gorm Mysql Mysql `mapstructure:"mysql" json:"mysql" yaml:"mysql"` // oss - Local Local `mapstructure:"local" json:"local" yaml:"local"` - Qiniu Qiniu `mapstructure:"qiniu" json:"qiniu" yaml:"qiniu"` - AliyunOSS AliyunOSS `mapstructure:"aliyun-oss" json:"aliyunOSS" yaml:"aliyun-oss"` + Local Local `mapstructure:"local" json:"local" yaml:"local"` + Qiniu Qiniu `mapstructure:"qiniu" json:"qiniu" yaml:"qiniu"` + AliyunOSS AliyunOSS `mapstructure:"aliyun-oss" json:"aliyunOSS" yaml:"aliyun-oss"` TencentCOS TencentCOS `mapstructure:"tencent-cos" json:"tencentCOS" yaml:"tencent-cos"` - Excel Excel `mapstructure:"excel" json:"excel" yaml:"excel"` + Excel Excel `mapstructure:"excel" json:"excel" yaml:"excel"` } diff --git a/server/core/viper.go b/server/core/viper.go index e1d67b83..282770d6 100644 --- a/server/core/viper.go +++ b/server/core/viper.go @@ -6,9 +6,11 @@ import ( "gin-vue-admin/global" _ "gin-vue-admin/packfile" "gin-vue-admin/utils" + "os" + "path/filepath" + "github.com/fsnotify/fsnotify" "github.com/spf13/viper" - "os" ) func Viper(path ...string) *viper.Viper { @@ -46,9 +48,9 @@ func Viper(path ...string) *viper.Viper { fmt.Println(err) } }) - if err := v.Unmarshal(&global.GVA_CONFIG); err != nil { fmt.Println(err) } + global.GVA_CONFIG.AutoCode.Root, _ = filepath.Abs("..") return v } diff --git a/server/docs/docs.go b/server/docs/docs.go index f3b28cee..b392f782 100644 --- a/server/docs/docs.go +++ b/server/docs/docs.go @@ -487,6 +487,17 @@ var doc = `{ "AutoCode" ], "summary": "自动代码模板", + "parameters": [ + { + "description": "创建自动代码", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.AutoCodeStruct" + } + } + ], "responses": { "200": { "description": "{\"success\":true,\"data\":{},\"msg\":\"创建成功\"}", @@ -578,6 +589,44 @@ var doc = `{ } } }, + "/autoCode/preview": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "AutoCode" + ], + "summary": "预览创建后的代码", + "parameters": [ + { + "description": "预览创建代码", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.AutoCodeStruct" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"创建成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, "/base/captcha": { "post": { "security": [ @@ -919,6 +968,134 @@ var doc = `{ } } }, + "/excel/downloadTemplate": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "multipart/form-data" + ], + "produces": [ + "application/json" + ], + "tags": [ + "excel" + ], + "summary": "下载模板", + "parameters": [ + { + "type": "string", + "description": "模板名称", + "name": "fileName", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "" + } + } + } + }, + "/excel/exportExcel": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/octet-stream" + ], + "tags": [ + "excel" + ], + "summary": "导出Excel", + "parameters": [ + { + "description": "导出Excel文件信息", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.ExcelInfo" + } + } + ], + "responses": { + "200": { + "description": "" + } + } + } + }, + "/excel/importExcel": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "multipart/form-data" + ], + "produces": [ + "application/json" + ], + "tags": [ + "excel" + ], + "summary": "导入Excel文件", + "parameters": [ + { + "type": "file", + "description": "导入Excel文件", + "name": "file", + "in": "formData", + "required": true + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"导入成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/excel/loadExcel": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "produces": [ + "application/json" + ], + "tags": [ + "excel" + ], + "summary": "加载Excel数据", + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"加载数据成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, "/fileUploadAndDownload/breakpointContinue": { "post": { "security": [ @@ -1136,6 +1313,55 @@ var doc = `{ } } }, + "/init/checkdb": { + "post": { + "produces": [ + "application/json" + ], + "tags": [ + "CheckDB" + ], + "summary": "初始化用户数据库", + "responses": { + "200": { + "description": "{\"code\":0,\"data\":{},\"msg\":\"探测完成\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/init/initdb": { + "post": { + "produces": [ + "application/json" + ], + "tags": [ + "InitDB" + ], + "summary": "初始化用户数据库", + "parameters": [ + { + "description": "初始化数据库参数", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.InitDB" + } + } + ], + "responses": { + "200": { + "description": "{\"code\":0,\"data\":{},\"msg\":\"自动创建数据库成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, "/jwt/jsonInBlacklist": { "post": { "security": [ @@ -1582,6 +1808,15 @@ var doc = `{ "SimpleUploader" ], "summary": "断点续传插件版示例", + "parameters": [ + { + "type": "file", + "description": "断点续传插件版示例", + "name": "file", + "in": "formData", + "required": true + } + ], "responses": { "200": { "description": "{\"success\":true,\"data\":{},\"msg\":\"切片创建成功\"}", @@ -2162,7 +2397,7 @@ var doc = `{ } } }, - "/system/ReloadSystem": { + "/system/getServerInfo": { "post": { "security": [ { @@ -2175,21 +2410,10 @@ var doc = `{ "tags": [ "System" ], - "summary": "重启系统", - "parameters": [ - { - "description": "重启系统", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.System" - } - } - ], + "summary": "获取服务器信息", "responses": { "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"重启系统成功\"}", + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", "schema": { "type": "string" } @@ -2197,7 +2421,7 @@ var doc = `{ } } }, - "/system/getServerInfo": { + "/system/getSystemConfig": { "post": { "security": [ { @@ -2210,7 +2434,7 @@ var doc = `{ "tags": [ "System" ], - "summary": "获取服务器信息", + "summary": "获取配置文件内容", "responses": { "200": { "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", @@ -2221,7 +2445,7 @@ var doc = `{ } } }, - "/system/getSystemConfig": { + "/system/reloadSystem": { "post": { "security": [ { @@ -2234,10 +2458,10 @@ var doc = `{ "tags": [ "System" ], - "summary": "获取配置文件内容", + "summary": "重启系统", "responses": { "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "description": "{\"code\":0,\"data\":{},\"msg\":\"重启系统成功\"}", "schema": { "type": "string" } @@ -2497,39 +2721,441 @@ var doc = `{ } } }, - "/workflow/createWorkFlow": { + "/workflowProcess/completeWorkflowMove": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "WorkflowProcess" + ], + "summary": "提交工作流", + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/workflowProcess/createWorkflowProcess": { "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], "produces": [ "application/json" ], "tags": [ - "workflow" + "WorkflowProcess" ], - "summary": "注册工作流", + "summary": "创建WorkflowProcess", "parameters": [ { - "description": "注册工作流接口", + "description": "创建WorkflowProcess", "name": "data", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/model.SysWorkflow" + "$ref": "#/definitions/model.WorkflowProcess" } } ], "responses": { "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"注册成功\"}", + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", "schema": { "type": "string" } } } } - } - }, - "definitions": { - "config.Captcha": { + }, + "/workflowProcess/deleteWorkflowProcess": { + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "WorkflowProcess" + ], + "summary": "删除WorkflowProcess", + "parameters": [ + { + "description": "删除WorkflowProcess", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.WorkflowProcess" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"删除成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/workflowProcess/deleteWorkflowProcessByIds": { + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "WorkflowProcess" + ], + "summary": "批量删除WorkflowProcess", + "parameters": [ + { + "description": "批量删除WorkflowProcess", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.IdsReq" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"删除成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/workflowProcess/findWorkflowProcess": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "WorkflowProcess" + ], + "summary": "用id查询WorkflowProcess", + "parameters": [ + { + "description": "用id查询WorkflowProcess", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.WorkflowProcess" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"查询成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/workflowProcess/findWorkflowStep": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "WorkflowProcess" + ], + "summary": "用id查询工作流步骤", + "parameters": [ + { + "description": "用id查询WorkflowProcess", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.WorkflowProcess" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"查询成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/workflowProcess/getMyNeed": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "WorkflowProcess" + ], + "summary": "我的待办", + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/workflowProcess/getMyStated": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "WorkflowProcess" + ], + "summary": "我发起的工作流", + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/workflowProcess/getWorkflowMoveByID": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "WorkflowProcess" + ], + "summary": "根据id获取当前节点详情和历史", + "parameters": [ + { + "description": "根据id获取当前节点详情和过往", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.GetById" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/workflowProcess/getWorkflowProcessList": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "WorkflowProcess" + ], + "summary": "分页获取WorkflowProcess列表", + "parameters": [ + { + "description": "分页获取WorkflowProcess列表", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.WorkflowProcessSearch" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/workflowProcess/startWorkflow": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "WorkflowProcess" + ], + "summary": "开启工作流", + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/workflowProcess/updateWorkflowProcess": { + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "WorkflowProcess" + ], + "summary": "更新WorkflowProcess", + "parameters": [ + { + "description": "更新WorkflowProcess", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.WorkflowProcess" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"更新成功\"}", + "schema": { + "type": "string" + } + } + } + } + } + }, + "definitions": { + "config.AliyunOSS": { + "type": "object", + "properties": { + "accessKeyId": { + "type": "string" + }, + "accessKeySecret": { + "type": "string" + }, + "bucketName": { + "type": "string" + }, + "bucketUrl": { + "type": "string" + }, + "endpoint": { + "type": "string" + } + } + }, + "config.Captcha": { "type": "object", "properties": { "imgHeight": { @@ -2577,9 +3203,23 @@ var doc = `{ } } }, + "config.Excel": { + "type": "object", + "properties": { + "dir": { + "type": "string" + } + } + }, "config.JWT": { "type": "object", "properties": { + "bufferTime": { + "type": "integer" + }, + "expiresTime": { + "type": "integer" + }, "signingKey": { "type": "string" } @@ -2605,6 +3245,9 @@ var doc = `{ "logMode": { "type": "boolean" }, + "logZap": { + "type": "string" + }, "maxIdleConns": { "type": "integer" }, @@ -2665,6 +3308,10 @@ var doc = `{ "config.Server": { "type": "object", "properties": { + "aliyunOSS": { + "type": "object", + "$ref": "#/definitions/config.AliyunOSS" + }, "captcha": { "type": "object", "$ref": "#/definitions/config.Captcha" @@ -2677,6 +3324,10 @@ var doc = `{ "type": "object", "$ref": "#/definitions/config.Email" }, + "excel": { + "type": "object", + "$ref": "#/definitions/config.Excel" + }, "jwt": { "type": "object", "$ref": "#/definitions/config.JWT" @@ -2703,6 +3354,10 @@ var doc = `{ "type": "object", "$ref": "#/definitions/config.System" }, + "tencentCOS": { + "type": "object", + "$ref": "#/definitions/config.TencentCOS" + }, "zap": { "type": "object", "$ref": "#/definitions/config.Zap" @@ -2729,6 +3384,29 @@ var doc = `{ } } }, + "config.TencentCOS": { + "type": "object", + "properties": { + "baseURL": { + "type": "string" + }, + "bucket": { + "type": "string" + }, + "pathPrefix": { + "type": "string" + }, + "region": { + "type": "string" + }, + "secretID": { + "type": "string" + }, + "secretKey": { + "type": "string" + } + } + }, "config.Zap": { "type": "object", "properties": { @@ -2756,7 +3434,39 @@ var doc = `{ "showLine": { "type": "boolean" }, - "stacktraceKey": { + "stacktraceKey": { + "type": "string" + } + } + }, + "model.AutoCodeStruct": { + "type": "object", + "properties": { + "abbreviation": { + "type": "string" + }, + "autoCreateApiToSql": { + "type": "boolean" + }, + "autoMoveFile": { + "type": "boolean" + }, + "description": { + "type": "string" + }, + "fields": { + "type": "array", + "items": { + "$ref": "#/definitions/model.Field" + } + }, + "packageName": { + "type": "string" + }, + "structName": { + "type": "string" + }, + "tableName": { "type": "string" } } @@ -2817,6 +3527,55 @@ var doc = `{ } } }, + "model.ExcelInfo": { + "type": "object", + "properties": { + "fileName": { + "type": "string" + }, + "infoList": { + "type": "array", + "items": { + "$ref": "#/definitions/model.SysBaseMenu" + } + } + } + }, + "model.Field": { + "type": "object", + "properties": { + "columnName": { + "type": "string" + }, + "comment": { + "type": "string" + }, + "dataType": { + "type": "string" + }, + "dataTypeLong": { + "type": "string" + }, + "dictType": { + "type": "string" + }, + "fieldDesc": { + "type": "string" + }, + "fieldJson": { + "type": "string" + }, + "fieldName": { + "type": "string" + }, + "fieldSearchType": { + "type": "string" + }, + "fieldType": { + "type": "string" + } + } + }, "model.SysApi": { "type": "object", "properties": { @@ -2867,6 +3626,9 @@ var doc = `{ "$ref": "#/definitions/model.SysAuthority" } }, + "defaultRouter": { + "type": "string" + }, "deletedAt": { "type": "string" }, @@ -2899,6 +3661,9 @@ var doc = `{ "$ref": "#/definitions/model.SysBaseMenu" } }, + "closeTab": { + "type": "boolean" + }, "component": { "type": "string" }, @@ -3114,40 +3879,76 @@ var doc = `{ } } }, - "model.SysWorkflow": { + "model.System": { + "type": "object", + "properties": { + "config": { + "type": "object", + "$ref": "#/definitions/config.Server" + } + } + }, + "model.WorkflowEdge": { "type": "object", "properties": { + "clazz": { + "type": "string" + }, + "conditionExpression": { + "type": "string" + }, "createdAt": { "type": "string" }, + "description": { + "type": "string" + }, + "endPoint": { + "description": "终点信息", + "type": "object", + "$ref": "#/definitions/model.WorkflowEndPoint" + }, + "hideIcon": { + "type": "boolean" + }, "id": { - "type": "integer" + "type": "string" }, - "updatedAt": { + "label": { "type": "string" }, - "workflowDescription": { - "description": "工作流描述", + "reverse": { + "type": "boolean" + }, + "seq": { "type": "string" }, - "workflowName": { - "description": "工作流英文id", + "shape": { "type": "string" }, - "workflowNickName": { - "description": "工作流名称", + "source": { "type": "string" }, - "workflowStep": { - "description": "工作流步骤", - "type": "array", - "items": { - "$ref": "#/definitions/model.SysWorkflowStepInfo" - } + "sourceAnchor": { + "type": "integer" + }, + "startPoint": { + "description": "起点信息", + "type": "object", + "$ref": "#/definitions/model.WorkflowStartPoint" + }, + "target": { + "type": "string" + }, + "targetAnchor": { + "type": "integer" + }, + "updatedAt": { + "type": "string" } } }, - "model.SysWorkflowStepInfo": { + "model.WorkflowEndPoint": { "type": "object", "properties": { "createdAt": { @@ -3156,41 +3957,172 @@ var doc = `{ "id": { "type": "integer" }, - "isEnd": { - "description": "是否是完结流节点", + "index": { + "type": "integer" + }, + "updatedAt": { + "type": "string" + }, + "workflowEdgeID": { + "type": "string" + }, + "x": { + "type": "number" + }, + "y": { + "type": "number" + } + } + }, + "model.WorkflowNode": { + "type": "object", + "properties": { + "assignType": { + "type": "string" + }, + "assignValue": { + "type": "string" + }, + "clazz": { + "type": "string" + }, + "content": { + "type": "string" + }, + "createdAt": { + "type": "string" + }, + "cycle": { + "type": "string" + }, + "description": { + "type": "string" + }, + "dueDate": { + "type": "string" + }, + "duration": { + "type": "string" + }, + "hideIcon": { "type": "boolean" }, - "isStart": { - "description": "是否是开始流节点", + "id": { + "type": "string" + }, + "label": { + "type": "string" + }, + "shape": { + "type": "string" + }, + "stateValue": { + "type": "string" + }, + "subject": { + "type": "string" + }, + "success": { "type": "boolean" }, - "stepAuthorityID": { - "description": "操作者级别id", + "to": { + "type": "string" + }, + "type": { + "type": "string" + }, + "updatedAt": { + "type": "string" + }, + "view": { + "type": "string" + }, + "waitState": { "type": "string" }, - "stepName": { - "description": "工作流名称", + "workflowProcessID": { "type": "string" }, - "stepNo": { - "description": "步骤id (第几步)", + "x": { + "type": "number" + }, + "y": { "type": "number" + } + } + }, + "model.WorkflowProcess": { + "type": "object", + "properties": { + "category": { + "type": "string" + }, + "clazz": { + "type": "string" + }, + "createdAt": { + "type": "string" + }, + "description": { + "type": "string" + }, + "edges": { + "description": "流程链接数据", + "type": "array", + "items": { + "$ref": "#/definitions/model.WorkflowEdge" + } + }, + "hideIcon": { + "type": "boolean" + }, + "id": { + "type": "string" + }, + "label": { + "type": "string" + }, + "name": { + "type": "string" + }, + "nodes": { + "description": "流程节点数据", + "type": "array", + "items": { + "$ref": "#/definitions/model.WorkflowNode" + } }, "updatedAt": { "type": "string" }, - "workflowID": { - "description": "所属工作流ID", - "type": "integer" + "view": { + "type": "string" } } }, - "model.System": { + "model.WorkflowStartPoint": { "type": "object", "properties": { - "config": { - "type": "object", - "$ref": "#/definitions/config.Server" + "createdAt": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "index": { + "type": "integer" + }, + "updatedAt": { + "type": "string" + }, + "workflowEdgeID": { + "type": "string" + }, + "x": { + "type": "number" + }, + "y": { + "type": "number" } } }, @@ -3277,6 +4209,30 @@ var doc = `{ } } }, + "request.InitDB": { + "type": "object", + "required": [ + "dbName", + "userName" + ], + "properties": { + "dbName": { + "type": "string" + }, + "host": { + "type": "string" + }, + "password": { + "type": "string" + }, + "port": { + "type": "string" + }, + "userName": { + "type": "string" + } + } + }, "request.Login": { "type": "object", "properties": { @@ -3481,6 +4437,61 @@ var doc = `{ } } }, + "request.WorkflowProcessSearch": { + "type": "object", + "properties": { + "category": { + "type": "string" + }, + "clazz": { + "type": "string" + }, + "createdAt": { + "type": "string" + }, + "description": { + "type": "string" + }, + "edges": { + "description": "流程链接数据", + "type": "array", + "items": { + "$ref": "#/definitions/model.WorkflowEdge" + } + }, + "hideIcon": { + "type": "boolean" + }, + "id": { + "type": "string" + }, + "label": { + "type": "string" + }, + "name": { + "type": "string" + }, + "nodes": { + "description": "流程节点数据", + "type": "array", + "items": { + "$ref": "#/definitions/model.WorkflowNode" + } + }, + "page": { + "type": "integer" + }, + "pageSize": { + "type": "integer" + }, + "updatedAt": { + "type": "string" + }, + "view": { + "type": "string" + } + } + }, "response.SysAuthorityCopyResponse": { "type": "object", "properties": { diff --git a/server/docs/swagger.json b/server/docs/swagger.json index c8bb402e..b90baea6 100644 --- a/server/docs/swagger.json +++ b/server/docs/swagger.json @@ -471,6 +471,17 @@ "AutoCode" ], "summary": "自动代码模板", + "parameters": [ + { + "description": "创建自动代码", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.AutoCodeStruct" + } + } + ], "responses": { "200": { "description": "{\"success\":true,\"data\":{},\"msg\":\"创建成功\"}", @@ -562,6 +573,44 @@ } } }, + "/autoCode/preview": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "AutoCode" + ], + "summary": "预览创建后的代码", + "parameters": [ + { + "description": "预览创建代码", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.AutoCodeStruct" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"创建成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, "/base/captcha": { "post": { "security": [ @@ -903,6 +952,134 @@ } } }, + "/excel/downloadTemplate": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "multipart/form-data" + ], + "produces": [ + "application/json" + ], + "tags": [ + "excel" + ], + "summary": "下载模板", + "parameters": [ + { + "type": "string", + "description": "模板名称", + "name": "fileName", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "" + } + } + } + }, + "/excel/exportExcel": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/octet-stream" + ], + "tags": [ + "excel" + ], + "summary": "导出Excel", + "parameters": [ + { + "description": "导出Excel文件信息", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.ExcelInfo" + } + } + ], + "responses": { + "200": { + "description": "" + } + } + } + }, + "/excel/importExcel": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "multipart/form-data" + ], + "produces": [ + "application/json" + ], + "tags": [ + "excel" + ], + "summary": "导入Excel文件", + "parameters": [ + { + "type": "file", + "description": "导入Excel文件", + "name": "file", + "in": "formData", + "required": true + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"导入成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/excel/loadExcel": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "produces": [ + "application/json" + ], + "tags": [ + "excel" + ], + "summary": "加载Excel数据", + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"加载数据成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, "/fileUploadAndDownload/breakpointContinue": { "post": { "security": [ @@ -1120,6 +1297,55 @@ } } }, + "/init/checkdb": { + "post": { + "produces": [ + "application/json" + ], + "tags": [ + "CheckDB" + ], + "summary": "初始化用户数据库", + "responses": { + "200": { + "description": "{\"code\":0,\"data\":{},\"msg\":\"探测完成\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/init/initdb": { + "post": { + "produces": [ + "application/json" + ], + "tags": [ + "InitDB" + ], + "summary": "初始化用户数据库", + "parameters": [ + { + "description": "初始化数据库参数", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.InitDB" + } + } + ], + "responses": { + "200": { + "description": "{\"code\":0,\"data\":{},\"msg\":\"自动创建数据库成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, "/jwt/jsonInBlacklist": { "post": { "security": [ @@ -1566,6 +1792,15 @@ "SimpleUploader" ], "summary": "断点续传插件版示例", + "parameters": [ + { + "type": "file", + "description": "断点续传插件版示例", + "name": "file", + "in": "formData", + "required": true + } + ], "responses": { "200": { "description": "{\"success\":true,\"data\":{},\"msg\":\"切片创建成功\"}", @@ -2146,7 +2381,7 @@ } } }, - "/system/ReloadSystem": { + "/system/getServerInfo": { "post": { "security": [ { @@ -2159,21 +2394,10 @@ "tags": [ "System" ], - "summary": "重启系统", - "parameters": [ - { - "description": "重启系统", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.System" - } - } - ], + "summary": "获取服务器信息", "responses": { "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"重启系统成功\"}", + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", "schema": { "type": "string" } @@ -2181,7 +2405,7 @@ } } }, - "/system/getServerInfo": { + "/system/getSystemConfig": { "post": { "security": [ { @@ -2194,7 +2418,7 @@ "tags": [ "System" ], - "summary": "获取服务器信息", + "summary": "获取配置文件内容", "responses": { "200": { "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", @@ -2205,7 +2429,7 @@ } } }, - "/system/getSystemConfig": { + "/system/reloadSystem": { "post": { "security": [ { @@ -2218,10 +2442,10 @@ "tags": [ "System" ], - "summary": "获取配置文件内容", + "summary": "重启系统", "responses": { "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "description": "{\"code\":0,\"data\":{},\"msg\":\"重启系统成功\"}", "schema": { "type": "string" } @@ -2481,39 +2705,441 @@ } } }, - "/workflow/createWorkFlow": { + "/workflowProcess/completeWorkflowMove": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "WorkflowProcess" + ], + "summary": "提交工作流", + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/workflowProcess/createWorkflowProcess": { "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], "produces": [ "application/json" ], "tags": [ - "workflow" + "WorkflowProcess" ], - "summary": "注册工作流", + "summary": "创建WorkflowProcess", "parameters": [ { - "description": "注册工作流接口", + "description": "创建WorkflowProcess", "name": "data", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/model.SysWorkflow" + "$ref": "#/definitions/model.WorkflowProcess" } } ], "responses": { "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"注册成功\"}", + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", "schema": { "type": "string" } } } } - } - }, - "definitions": { - "config.Captcha": { + }, + "/workflowProcess/deleteWorkflowProcess": { + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "WorkflowProcess" + ], + "summary": "删除WorkflowProcess", + "parameters": [ + { + "description": "删除WorkflowProcess", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.WorkflowProcess" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"删除成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/workflowProcess/deleteWorkflowProcessByIds": { + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "WorkflowProcess" + ], + "summary": "批量删除WorkflowProcess", + "parameters": [ + { + "description": "批量删除WorkflowProcess", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.IdsReq" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"删除成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/workflowProcess/findWorkflowProcess": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "WorkflowProcess" + ], + "summary": "用id查询WorkflowProcess", + "parameters": [ + { + "description": "用id查询WorkflowProcess", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.WorkflowProcess" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"查询成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/workflowProcess/findWorkflowStep": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "WorkflowProcess" + ], + "summary": "用id查询工作流步骤", + "parameters": [ + { + "description": "用id查询WorkflowProcess", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.WorkflowProcess" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"查询成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/workflowProcess/getMyNeed": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "WorkflowProcess" + ], + "summary": "我的待办", + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/workflowProcess/getMyStated": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "WorkflowProcess" + ], + "summary": "我发起的工作流", + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/workflowProcess/getWorkflowMoveByID": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "WorkflowProcess" + ], + "summary": "根据id获取当前节点详情和历史", + "parameters": [ + { + "description": "根据id获取当前节点详情和过往", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.GetById" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/workflowProcess/getWorkflowProcessList": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "WorkflowProcess" + ], + "summary": "分页获取WorkflowProcess列表", + "parameters": [ + { + "description": "分页获取WorkflowProcess列表", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.WorkflowProcessSearch" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/workflowProcess/startWorkflow": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "WorkflowProcess" + ], + "summary": "开启工作流", + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/workflowProcess/updateWorkflowProcess": { + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "WorkflowProcess" + ], + "summary": "更新WorkflowProcess", + "parameters": [ + { + "description": "更新WorkflowProcess", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.WorkflowProcess" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"更新成功\"}", + "schema": { + "type": "string" + } + } + } + } + } + }, + "definitions": { + "config.AliyunOSS": { + "type": "object", + "properties": { + "accessKeyId": { + "type": "string" + }, + "accessKeySecret": { + "type": "string" + }, + "bucketName": { + "type": "string" + }, + "bucketUrl": { + "type": "string" + }, + "endpoint": { + "type": "string" + } + } + }, + "config.Captcha": { "type": "object", "properties": { "imgHeight": { @@ -2561,9 +3187,23 @@ } } }, + "config.Excel": { + "type": "object", + "properties": { + "dir": { + "type": "string" + } + } + }, "config.JWT": { "type": "object", "properties": { + "bufferTime": { + "type": "integer" + }, + "expiresTime": { + "type": "integer" + }, "signingKey": { "type": "string" } @@ -2589,6 +3229,9 @@ "logMode": { "type": "boolean" }, + "logZap": { + "type": "string" + }, "maxIdleConns": { "type": "integer" }, @@ -2649,6 +3292,10 @@ "config.Server": { "type": "object", "properties": { + "aliyunOSS": { + "type": "object", + "$ref": "#/definitions/config.AliyunOSS" + }, "captcha": { "type": "object", "$ref": "#/definitions/config.Captcha" @@ -2661,6 +3308,10 @@ "type": "object", "$ref": "#/definitions/config.Email" }, + "excel": { + "type": "object", + "$ref": "#/definitions/config.Excel" + }, "jwt": { "type": "object", "$ref": "#/definitions/config.JWT" @@ -2687,6 +3338,10 @@ "type": "object", "$ref": "#/definitions/config.System" }, + "tencentCOS": { + "type": "object", + "$ref": "#/definitions/config.TencentCOS" + }, "zap": { "type": "object", "$ref": "#/definitions/config.Zap" @@ -2713,6 +3368,29 @@ } } }, + "config.TencentCOS": { + "type": "object", + "properties": { + "baseURL": { + "type": "string" + }, + "bucket": { + "type": "string" + }, + "pathPrefix": { + "type": "string" + }, + "region": { + "type": "string" + }, + "secretID": { + "type": "string" + }, + "secretKey": { + "type": "string" + } + } + }, "config.Zap": { "type": "object", "properties": { @@ -2740,7 +3418,39 @@ "showLine": { "type": "boolean" }, - "stacktraceKey": { + "stacktraceKey": { + "type": "string" + } + } + }, + "model.AutoCodeStruct": { + "type": "object", + "properties": { + "abbreviation": { + "type": "string" + }, + "autoCreateApiToSql": { + "type": "boolean" + }, + "autoMoveFile": { + "type": "boolean" + }, + "description": { + "type": "string" + }, + "fields": { + "type": "array", + "items": { + "$ref": "#/definitions/model.Field" + } + }, + "packageName": { + "type": "string" + }, + "structName": { + "type": "string" + }, + "tableName": { "type": "string" } } @@ -2801,6 +3511,55 @@ } } }, + "model.ExcelInfo": { + "type": "object", + "properties": { + "fileName": { + "type": "string" + }, + "infoList": { + "type": "array", + "items": { + "$ref": "#/definitions/model.SysBaseMenu" + } + } + } + }, + "model.Field": { + "type": "object", + "properties": { + "columnName": { + "type": "string" + }, + "comment": { + "type": "string" + }, + "dataType": { + "type": "string" + }, + "dataTypeLong": { + "type": "string" + }, + "dictType": { + "type": "string" + }, + "fieldDesc": { + "type": "string" + }, + "fieldJson": { + "type": "string" + }, + "fieldName": { + "type": "string" + }, + "fieldSearchType": { + "type": "string" + }, + "fieldType": { + "type": "string" + } + } + }, "model.SysApi": { "type": "object", "properties": { @@ -2851,6 +3610,9 @@ "$ref": "#/definitions/model.SysAuthority" } }, + "defaultRouter": { + "type": "string" + }, "deletedAt": { "type": "string" }, @@ -2883,6 +3645,9 @@ "$ref": "#/definitions/model.SysBaseMenu" } }, + "closeTab": { + "type": "boolean" + }, "component": { "type": "string" }, @@ -3098,40 +3863,76 @@ } } }, - "model.SysWorkflow": { + "model.System": { + "type": "object", + "properties": { + "config": { + "type": "object", + "$ref": "#/definitions/config.Server" + } + } + }, + "model.WorkflowEdge": { "type": "object", "properties": { + "clazz": { + "type": "string" + }, + "conditionExpression": { + "type": "string" + }, "createdAt": { "type": "string" }, + "description": { + "type": "string" + }, + "endPoint": { + "description": "终点信息", + "type": "object", + "$ref": "#/definitions/model.WorkflowEndPoint" + }, + "hideIcon": { + "type": "boolean" + }, "id": { - "type": "integer" + "type": "string" }, - "updatedAt": { + "label": { "type": "string" }, - "workflowDescription": { - "description": "工作流描述", + "reverse": { + "type": "boolean" + }, + "seq": { "type": "string" }, - "workflowName": { - "description": "工作流英文id", + "shape": { "type": "string" }, - "workflowNickName": { - "description": "工作流名称", + "source": { "type": "string" }, - "workflowStep": { - "description": "工作流步骤", - "type": "array", - "items": { - "$ref": "#/definitions/model.SysWorkflowStepInfo" - } + "sourceAnchor": { + "type": "integer" + }, + "startPoint": { + "description": "起点信息", + "type": "object", + "$ref": "#/definitions/model.WorkflowStartPoint" + }, + "target": { + "type": "string" + }, + "targetAnchor": { + "type": "integer" + }, + "updatedAt": { + "type": "string" } } }, - "model.SysWorkflowStepInfo": { + "model.WorkflowEndPoint": { "type": "object", "properties": { "createdAt": { @@ -3140,41 +3941,172 @@ "id": { "type": "integer" }, - "isEnd": { - "description": "是否是完结流节点", + "index": { + "type": "integer" + }, + "updatedAt": { + "type": "string" + }, + "workflowEdgeID": { + "type": "string" + }, + "x": { + "type": "number" + }, + "y": { + "type": "number" + } + } + }, + "model.WorkflowNode": { + "type": "object", + "properties": { + "assignType": { + "type": "string" + }, + "assignValue": { + "type": "string" + }, + "clazz": { + "type": "string" + }, + "content": { + "type": "string" + }, + "createdAt": { + "type": "string" + }, + "cycle": { + "type": "string" + }, + "description": { + "type": "string" + }, + "dueDate": { + "type": "string" + }, + "duration": { + "type": "string" + }, + "hideIcon": { "type": "boolean" }, - "isStart": { - "description": "是否是开始流节点", + "id": { + "type": "string" + }, + "label": { + "type": "string" + }, + "shape": { + "type": "string" + }, + "stateValue": { + "type": "string" + }, + "subject": { + "type": "string" + }, + "success": { "type": "boolean" }, - "stepAuthorityID": { - "description": "操作者级别id", + "to": { + "type": "string" + }, + "type": { + "type": "string" + }, + "updatedAt": { + "type": "string" + }, + "view": { + "type": "string" + }, + "waitState": { "type": "string" }, - "stepName": { - "description": "工作流名称", + "workflowProcessID": { "type": "string" }, - "stepNo": { - "description": "步骤id (第几步)", + "x": { + "type": "number" + }, + "y": { "type": "number" + } + } + }, + "model.WorkflowProcess": { + "type": "object", + "properties": { + "category": { + "type": "string" + }, + "clazz": { + "type": "string" + }, + "createdAt": { + "type": "string" + }, + "description": { + "type": "string" + }, + "edges": { + "description": "流程链接数据", + "type": "array", + "items": { + "$ref": "#/definitions/model.WorkflowEdge" + } + }, + "hideIcon": { + "type": "boolean" + }, + "id": { + "type": "string" + }, + "label": { + "type": "string" + }, + "name": { + "type": "string" + }, + "nodes": { + "description": "流程节点数据", + "type": "array", + "items": { + "$ref": "#/definitions/model.WorkflowNode" + } }, "updatedAt": { "type": "string" }, - "workflowID": { - "description": "所属工作流ID", - "type": "integer" + "view": { + "type": "string" } } }, - "model.System": { + "model.WorkflowStartPoint": { "type": "object", "properties": { - "config": { - "type": "object", - "$ref": "#/definitions/config.Server" + "createdAt": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "index": { + "type": "integer" + }, + "updatedAt": { + "type": "string" + }, + "workflowEdgeID": { + "type": "string" + }, + "x": { + "type": "number" + }, + "y": { + "type": "number" } } }, @@ -3261,6 +4193,30 @@ } } }, + "request.InitDB": { + "type": "object", + "required": [ + "dbName", + "userName" + ], + "properties": { + "dbName": { + "type": "string" + }, + "host": { + "type": "string" + }, + "password": { + "type": "string" + }, + "port": { + "type": "string" + }, + "userName": { + "type": "string" + } + } + }, "request.Login": { "type": "object", "properties": { @@ -3465,6 +4421,61 @@ } } }, + "request.WorkflowProcessSearch": { + "type": "object", + "properties": { + "category": { + "type": "string" + }, + "clazz": { + "type": "string" + }, + "createdAt": { + "type": "string" + }, + "description": { + "type": "string" + }, + "edges": { + "description": "流程链接数据", + "type": "array", + "items": { + "$ref": "#/definitions/model.WorkflowEdge" + } + }, + "hideIcon": { + "type": "boolean" + }, + "id": { + "type": "string" + }, + "label": { + "type": "string" + }, + "name": { + "type": "string" + }, + "nodes": { + "description": "流程节点数据", + "type": "array", + "items": { + "$ref": "#/definitions/model.WorkflowNode" + } + }, + "page": { + "type": "integer" + }, + "pageSize": { + "type": "integer" + }, + "updatedAt": { + "type": "string" + }, + "view": { + "type": "string" + } + } + }, "response.SysAuthorityCopyResponse": { "type": "object", "properties": { diff --git a/server/docs/swagger.yaml b/server/docs/swagger.yaml index b0e5315b..03318a51 100644 --- a/server/docs/swagger.yaml +++ b/server/docs/swagger.yaml @@ -1,5 +1,18 @@ basePath: / definitions: + config.AliyunOSS: + properties: + accessKeyId: + type: string + accessKeySecret: + type: string + bucketName: + type: string + bucketUrl: + type: string + endpoint: + type: string + type: object config.Captcha: properties: imgHeight: @@ -31,8 +44,17 @@ definitions: to: type: string type: object + config.Excel: + properties: + dir: + type: string + type: object config.JWT: properties: + bufferTime: + type: integer + expiresTime: + type: integer signingKey: type: string type: object @@ -49,6 +71,8 @@ definitions: type: string logMode: type: boolean + logZap: + type: string maxIdleConns: type: integer maxOpenConns: @@ -88,6 +112,9 @@ definitions: type: object config.Server: properties: + aliyunOSS: + $ref: '#/definitions/config.AliyunOSS' + type: object captcha: $ref: '#/definitions/config.Captcha' type: object @@ -97,6 +124,9 @@ definitions: email: $ref: '#/definitions/config.Email' type: object + excel: + $ref: '#/definitions/config.Excel' + type: object jwt: $ref: '#/definitions/config.JWT' type: object @@ -117,6 +147,9 @@ definitions: system: $ref: '#/definitions/config.System' type: object + tencentCOS: + $ref: '#/definitions/config.TencentCOS' + type: object zap: $ref: '#/definitions/config.Zap' type: object @@ -134,6 +167,21 @@ definitions: useMultipoint: type: boolean type: object + config.TencentCOS: + properties: + baseURL: + type: string + bucket: + type: string + pathPrefix: + type: string + region: + type: string + secretID: + type: string + secretKey: + type: string + type: object config.Zap: properties: director: @@ -155,6 +203,27 @@ definitions: stacktraceKey: type: string type: object + model.AutoCodeStruct: + properties: + abbreviation: + type: string + autoCreateApiToSql: + type: boolean + autoMoveFile: + type: boolean + description: + type: string + fields: + items: + $ref: '#/definitions/model.Field' + type: array + packageName: + type: string + structName: + type: string + tableName: + type: string + type: object model.ExaCustomer: properties: createdAt: @@ -192,6 +261,38 @@ definitions: url: type: string type: object + model.ExcelInfo: + properties: + fileName: + type: string + infoList: + items: + $ref: '#/definitions/model.SysBaseMenu' + type: array + type: object + model.Field: + properties: + columnName: + type: string + comment: + type: string + dataType: + type: string + dataTypeLong: + type: string + dictType: + type: string + fieldDesc: + type: string + fieldJson: + type: string + fieldName: + type: string + fieldSearchType: + type: string + fieldType: + type: string + type: object model.SysApi: properties: apiGroup: @@ -225,6 +326,8 @@ definitions: items: $ref: '#/definitions/model.SysAuthority' type: array + defaultRouter: + type: string deletedAt: type: string menus: @@ -246,6 +349,8 @@ definitions: items: $ref: '#/definitions/model.SysBaseMenu' type: array + closeTab: + type: boolean component: type: string createdAt: @@ -388,61 +493,170 @@ definitions: uuid: type: string type: object - model.SysWorkflow: + model.System: properties: + config: + $ref: '#/definitions/config.Server' + type: object + type: object + model.WorkflowEdge: + properties: + clazz: + type: string + conditionExpression: + type: string createdAt: type: string + description: + type: string + endPoint: + $ref: '#/definitions/model.WorkflowEndPoint' + description: 终点信息 + type: object + hideIcon: + type: boolean id: - type: integer - updatedAt: type: string - workflowDescription: - description: 工作流描述 + label: type: string - workflowName: - description: 工作流英文id + reverse: + type: boolean + seq: type: string - workflowNickName: - description: 工作流名称 + shape: + type: string + source: + type: string + sourceAnchor: + type: integer + startPoint: + $ref: '#/definitions/model.WorkflowStartPoint' + description: 起点信息 + type: object + target: + type: string + targetAnchor: + type: integer + updatedAt: type: string - workflowStep: - description: 工作流步骤 - items: - $ref: '#/definitions/model.SysWorkflowStepInfo' - type: array type: object - model.SysWorkflowStepInfo: + model.WorkflowEndPoint: properties: createdAt: type: string id: type: integer - isEnd: - description: 是否是完结流节点 + index: + type: integer + updatedAt: + type: string + workflowEdgeID: + type: string + x: + type: number + "y": + type: number + type: object + model.WorkflowNode: + properties: + assignType: + type: string + assignValue: + type: string + clazz: + type: string + content: + type: string + createdAt: + type: string + cycle: + type: string + description: + type: string + dueDate: + type: string + duration: + type: string + hideIcon: type: boolean - isStart: - description: 是否是开始流节点 + id: + type: string + label: + type: string + shape: + type: string + stateValue: + type: string + subject: + type: string + success: type: boolean - stepAuthorityID: - description: 操作者级别id + to: type: string - stepName: - description: 工作流名称 + type: + type: string + updatedAt: + type: string + view: type: string - stepNo: - description: 步骤id (第几步) + waitState: + type: string + workflowProcessID: + type: string + x: type: number + "y": + type: number + type: object + model.WorkflowProcess: + properties: + category: + type: string + clazz: + type: string + createdAt: + type: string + description: + type: string + edges: + description: 流程链接数据 + items: + $ref: '#/definitions/model.WorkflowEdge' + type: array + hideIcon: + type: boolean + id: + type: string + label: + type: string + name: + type: string + nodes: + description: 流程节点数据 + items: + $ref: '#/definitions/model.WorkflowNode' + type: array updatedAt: type: string - workflowID: - description: 所属工作流ID - type: integer + view: + type: string type: object - model.System: + model.WorkflowStartPoint: properties: - config: - $ref: '#/definitions/config.Server' - type: object + createdAt: + type: string + id: + type: integer + index: + type: integer + updatedAt: + type: string + workflowEdgeID: + type: string + x: + type: number + "y": + type: number type: object request.AddMenuAuthorityInfo: properties: @@ -497,6 +711,22 @@ definitions: type: integer type: array type: object + request.InitDB: + properties: + dbName: + type: string + host: + type: string + password: + type: string + port: + type: string + userName: + type: string + required: + - dbName + - userName + type: object request.Login: properties: captcha: @@ -631,6 +861,43 @@ definitions: user_id: type: integer type: object + request.WorkflowProcessSearch: + properties: + category: + type: string + clazz: + type: string + createdAt: + type: string + description: + type: string + edges: + description: 流程链接数据 + items: + $ref: '#/definitions/model.WorkflowEdge' + type: array + hideIcon: + type: boolean + id: + type: string + label: + type: string + name: + type: string + nodes: + description: 流程节点数据 + items: + $ref: '#/definitions/model.WorkflowNode' + type: array + page: + type: integer + pageSize: + type: integer + updatedAt: + type: string + view: + type: string + type: object response.SysAuthorityCopyResponse: properties: authority: @@ -919,6 +1186,13 @@ paths: post: consumes: - application/json + parameters: + - description: 创建自动代码 + in: body + name: data + required: true + schema: + $ref: '#/definitions/model.AutoCodeStruct' produces: - application/json responses: @@ -979,6 +1253,29 @@ paths: summary: 获取当前数据库所有表 tags: - AutoCode + /autoCode/preview: + post: + consumes: + - application/json + parameters: + - description: 预览创建代码 + in: body + name: data + required: true + schema: + $ref: '#/definitions/model.AutoCodeStruct' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"创建成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 预览创建后的代码 + tags: + - AutoCode /base/captcha: post: consumes: @@ -1186,6 +1483,83 @@ paths: summary: 发送测试邮件 tags: - System + /excel/downloadTemplate: + get: + consumes: + - multipart/form-data + parameters: + - description: 模板名称 + in: query + name: fileName + required: true + type: string + produces: + - application/json + responses: + "200": + description: "" + security: + - ApiKeyAuth: [] + summary: 下载模板 + tags: + - excel + /excel/exportExcel: + post: + consumes: + - application/json + parameters: + - description: 导出Excel文件信息 + in: body + name: data + required: true + schema: + $ref: '#/definitions/model.ExcelInfo' + produces: + - application/octet-stream + responses: + "200": + description: "" + security: + - ApiKeyAuth: [] + summary: 导出Excel + tags: + - excel + /excel/importExcel: + post: + consumes: + - multipart/form-data + parameters: + - description: 导入Excel文件 + in: formData + name: file + required: true + type: file + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"导入成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 导入Excel文件 + tags: + - excel + /excel/loadExcel: + get: + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"加载数据成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 加载Excel数据 + tags: + - excel /fileUploadAndDownload/breakpointContinue: post: consumes: @@ -1318,6 +1692,37 @@ paths: summary: 上传文件示例 tags: - ExaFileUploadAndDownload + /init/checkdb: + post: + produces: + - application/json + responses: + "200": + description: '{"code":0,"data":{},"msg":"探测完成"}' + schema: + type: string + summary: 初始化用户数据库 + tags: + - CheckDB + /init/initdb: + post: + parameters: + - description: 初始化数据库参数 + in: body + name: data + required: true + schema: + $ref: '#/definitions/request.InitDB' + produces: + - application/json + responses: + "200": + description: '{"code":0,"data":{},"msg":"自动创建数据库成功"}' + schema: + type: string + summary: 初始化用户数据库 + tags: + - InitDB /jwt/jsonInBlacklist: post: consumes: @@ -1581,6 +1986,12 @@ paths: post: consumes: - multipart/form-data + parameters: + - description: 断点续传插件版示例 + in: formData + name: file + required: true + type: file produces: - application/json responses: @@ -1938,28 +2349,21 @@ paths: summary: 分页获取SysOperationRecord列表 tags: - SysOperationRecord - /system/ReloadSystem: + /system/getServerInfo: post: - parameters: - - description: 重启系统 - in: body - name: data - required: true - schema: - $ref: '#/definitions/model.System' produces: - application/json responses: "200": - description: '{"success":true,"data":{},"msg":"重启系统成功"}' + description: '{"success":true,"data":{},"msg":"获取成功"}' schema: type: string security: - ApiKeyAuth: [] - summary: 重启系统 + summary: 获取服务器信息 tags: - System - /system/getServerInfo: + /system/getSystemConfig: post: produces: - application/json @@ -1970,21 +2374,21 @@ paths: type: string security: - ApiKeyAuth: [] - summary: 获取服务器信息 + summary: 获取配置文件内容 tags: - System - /system/getSystemConfig: + /system/reloadSystem: post: produces: - application/json responses: "200": - description: '{"success":true,"data":{},"msg":"获取成功"}' + description: '{"code":0,"data":{},"msg":"重启系统成功"}' schema: type: string security: - ApiKeyAuth: [] - summary: 获取配置文件内容 + summary: 重启系统 tags: - System /system/setSystemConfig: @@ -2140,25 +2544,254 @@ paths: summary: 设置用户信息 tags: - SysUser - /workflow/createWorkFlow: + /workflowProcess/completeWorkflowMove: post: + consumes: + - application/json + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"获取成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 提交工作流 + tags: + - WorkflowProcess + /workflowProcess/createWorkflowProcess: + post: + consumes: + - application/json parameters: - - description: 注册工作流接口 + - description: 创建WorkflowProcess in: body name: data required: true schema: - $ref: '#/definitions/model.SysWorkflow' + $ref: '#/definitions/model.WorkflowProcess' produces: - application/json responses: "200": - description: '{"success":true,"data":{},"msg":"注册成功"}' + description: '{"success":true,"data":{},"msg":"获取成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 创建WorkflowProcess + tags: + - WorkflowProcess + /workflowProcess/deleteWorkflowProcess: + delete: + consumes: + - application/json + parameters: + - description: 删除WorkflowProcess + in: body + name: data + required: true + schema: + $ref: '#/definitions/model.WorkflowProcess' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"删除成功"}' schema: type: string - summary: 注册工作流 + security: + - ApiKeyAuth: [] + summary: 删除WorkflowProcess + tags: + - WorkflowProcess + /workflowProcess/deleteWorkflowProcessByIds: + delete: + consumes: + - application/json + parameters: + - description: 批量删除WorkflowProcess + in: body + name: data + required: true + schema: + $ref: '#/definitions/request.IdsReq' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"删除成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 批量删除WorkflowProcess + tags: + - WorkflowProcess + /workflowProcess/findWorkflowProcess: + get: + consumes: + - application/json + parameters: + - description: 用id查询WorkflowProcess + in: body + name: data + required: true + schema: + $ref: '#/definitions/model.WorkflowProcess' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"查询成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 用id查询WorkflowProcess + tags: + - WorkflowProcess + /workflowProcess/findWorkflowStep: + get: + consumes: + - application/json + parameters: + - description: 用id查询WorkflowProcess + in: body + name: data + required: true + schema: + $ref: '#/definitions/model.WorkflowProcess' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"查询成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 用id查询工作流步骤 + tags: + - WorkflowProcess + /workflowProcess/getMyNeed: + get: + consumes: + - application/json + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"获取成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 我的待办 + tags: + - WorkflowProcess + /workflowProcess/getMyStated: + get: + consumes: + - application/json + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"获取成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 我发起的工作流 + tags: + - WorkflowProcess + /workflowProcess/getWorkflowMoveByID: + get: + consumes: + - application/json + parameters: + - description: 根据id获取当前节点详情和过往 + in: body + name: data + required: true + schema: + $ref: '#/definitions/request.GetById' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"获取成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 根据id获取当前节点详情和历史 + tags: + - WorkflowProcess + /workflowProcess/getWorkflowProcessList: + get: + consumes: + - application/json + parameters: + - description: 分页获取WorkflowProcess列表 + in: body + name: data + required: true + schema: + $ref: '#/definitions/request.WorkflowProcessSearch' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"获取成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 分页获取WorkflowProcess列表 + tags: + - WorkflowProcess + /workflowProcess/startWorkflow: + post: + consumes: + - application/json + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"获取成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 开启工作流 + tags: + - WorkflowProcess + /workflowProcess/updateWorkflowProcess: + put: + consumes: + - application/json + parameters: + - description: 更新WorkflowProcess + in: body + name: data + required: true + schema: + $ref: '#/definitions/model.WorkflowProcess' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"更新成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 更新WorkflowProcess tags: - - workflow + - WorkflowProcess securityDefinitions: ApiKeyAuth: in: header diff --git a/server/resource/template/web/form.vue.tpl b/server/resource/template/web/form.vue.tpl index 811cd8c0..44ace3cb 100644 --- a/server/resource/template/web/form.vue.tpl +++ b/server/resource/template/web/form.vue.tpl @@ -107,10 +107,10 @@ export default { const res = await find{{.StructName}}({ ID: this.$route.query.id }) if(res.code == 0){ this.formData = res.data.re{{.Abbreviation}} - this.type == "update" + this.type = "update" } }else{ - this.type == "create" + this.type = "create" } {{ range .Fields -}} {{- if .DictType }} diff --git a/server/resource/template/web/workflowForm.vue.tpl b/server/resource/template/web/workflowForm.vue.tpl index ae312026..18df4529 100644 --- a/server/resource/template/web/workflowForm.vue.tpl +++ b/server/resource/template/web/workflowForm.vue.tpl @@ -117,6 +117,7 @@ export default { return false } } + return false }, ...mapGetters("user", ["userInfo"]) }, diff --git a/server/service/sys_auto_code.go b/server/service/sys_auto_code.go index b9a89b9c..caf5b434 100644 --- a/server/service/sys_auto_code.go +++ b/server/service/sys_auto_code.go @@ -2,7 +2,6 @@ package service import ( "errors" - "fmt" "gin-vue-admin/global" "gin-vue-admin/model" "gin-vue-admin/model/request" @@ -132,7 +131,6 @@ func CreateTemp(autoCode model.AutoCodeStruct) (err error) { } for _, value := range dataList { // 移动文件 if err := utils.FileMove(value.autoCodePath, value.autoMoveFilePath); err != nil { - fmt.Println(err) return err } } @@ -212,7 +210,6 @@ func GetColumn(tableName string, dbName string) (err error, Columns []request.Co //@return: null func addAutoMoveFile(data *tplData) { - dir := filepath.Base(filepath.Dir(data.autoCodePath)) base := filepath.Base(data.autoCodePath) fileSlice := strings.Split(data.autoCodePath, string(os.PathSeparator)) n := len(fileSlice) @@ -221,25 +218,34 @@ func addAutoMoveFile(data *tplData) { } if strings.Contains(fileSlice[1], "server") { if strings.Contains(fileSlice[n-2], "router") { - data.autoMoveFilePath = filepath.Join(dir, base) + data.autoMoveFilePath = filepath.Join(global.GVA_CONFIG.AutoCode.Root, global.GVA_CONFIG.AutoCode.Server, + global.GVA_CONFIG.AutoCode.SRouter, base) } else if strings.Contains(fileSlice[n-2], "api") { - data.autoMoveFilePath = filepath.Join(dir, "v1", base) + data.autoMoveFilePath = filepath.Join(global.GVA_CONFIG.AutoCode.Root, + global.GVA_CONFIG.AutoCode.Server, global.GVA_CONFIG.AutoCode.SApi, base) } else if strings.Contains(fileSlice[n-2], "service") { - data.autoMoveFilePath = filepath.Join(dir, base) + data.autoMoveFilePath = filepath.Join(global.GVA_CONFIG.AutoCode.Root, + global.GVA_CONFIG.AutoCode.Server, global.GVA_CONFIG.AutoCode.SService, base) } else if strings.Contains(fileSlice[n-2], "model") { - data.autoMoveFilePath = filepath.Join(dir, base) + data.autoMoveFilePath = filepath.Join(global.GVA_CONFIG.AutoCode.Root, + global.GVA_CONFIG.AutoCode.Server, global.GVA_CONFIG.AutoCode.SModel, base) } else if strings.Contains(fileSlice[n-2], "request") { - data.autoMoveFilePath = filepath.Join("model", dir, base) + data.autoMoveFilePath = filepath.Join(global.GVA_CONFIG.AutoCode.Root, + global.GVA_CONFIG.AutoCode.Server, global.GVA_CONFIG.AutoCode.SRequest, base) } } else if strings.Contains(fileSlice[1], "web") { if strings.Contains(fileSlice[n-1], "js") { - data.autoMoveFilePath = filepath.Join("../", "web", "src", dir, base) + data.autoMoveFilePath = filepath.Join(global.GVA_CONFIG.AutoCode.Root, + global.GVA_CONFIG.AutoCode.Web, global.GVA_CONFIG.AutoCode.WApi, base) } else if strings.Contains(fileSlice[n-2], "workflowForm") { - data.autoMoveFilePath = filepath.Join("../", "web", "src", "view", filepath.Base(filepath.Dir(filepath.Dir(data.autoCodePath))), strings.TrimSuffix(base, filepath.Ext(base))+"WorkflowForm.vue") + data.autoMoveFilePath = filepath.Join(global.GVA_CONFIG.AutoCode.Root, + global.GVA_CONFIG.AutoCode.Web, global.GVA_CONFIG.AutoCode.WFlow, filepath.Base(filepath.Dir(filepath.Dir(data.autoCodePath))), strings.TrimSuffix(base, filepath.Ext(base))+"WorkflowForm.vue") } else if strings.Contains(fileSlice[n-2], "form") { - data.autoMoveFilePath = filepath.Join("../", "web", "src", "view", filepath.Base(filepath.Dir(filepath.Dir(data.autoCodePath))), strings.TrimSuffix(base, filepath.Ext(base))+"Form.vue") + data.autoMoveFilePath = filepath.Join(global.GVA_CONFIG.AutoCode.Root, + global.GVA_CONFIG.AutoCode.Web, global.GVA_CONFIG.AutoCode.WForm, filepath.Base(filepath.Dir(filepath.Dir(data.autoCodePath))), strings.TrimSuffix(base, filepath.Ext(base))+"Form.vue") } else if strings.Contains(fileSlice[n-2], "table") { - data.autoMoveFilePath = filepath.Join("../", "web", "src", "view", filepath.Base(filepath.Dir(filepath.Dir(data.autoCodePath))), base) + data.autoMoveFilePath = filepath.Join(global.GVA_CONFIG.AutoCode.Root, + global.GVA_CONFIG.AutoCode.Web, global.GVA_CONFIG.AutoCode.WTable, filepath.Base(filepath.Dir(filepath.Dir(data.autoCodePath))), base) } } } diff --git a/web/babel.config.js b/web/babel.config.js index e9558405..682afd8b 100644 --- a/web/babel.config.js +++ b/web/babel.config.js @@ -1,5 +1,14 @@ module.exports = { presets: [ '@vue/cli-plugin-babel/preset' + ], + "plugins": [ + [ + "component", + { + "libraryName": "element-ui", + "styleLibraryName": "theme-chalk" + } + ] ] } diff --git a/web/build.config.js b/web/build.config.js index 8aafcb5e..75b666ee 100644 --- a/web/build.config.js +++ b/web/build.config.js @@ -14,7 +14,6 @@ module.exports = { { name: 'vue-router', scope: 'VueRouter' }, { name: 'vuex', scope: 'Vuex' }, { name: 'axios', scope: 'axios' }, - { name: 'echarts', scope: 'echarts' }, { name: 'element-ui', scope: 'ELEMENT', path: '/element-ui/2.12.0/index.js'}, ] }; diff --git a/web/package-lock.json b/web/package-lock.json index d0e63dab..d45c1ffa 100644 --- a/web/package-lock.json +++ b/web/package-lock.json @@ -3449,13 +3449,6 @@ "integrity": "sha1-6Bj9ac5cz8tARZT4QpY79TFkzDc=", "dev": true }, - "emojis-list": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz", - "integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==", - "dev": true, - "optional": true - }, "fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npm.taobao.org/fast-deep-equal/download/fast-deep-equal-3.1.3.tgz?cache=0&sync_timestamp=1591599659970&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ffast-deep-equal%2Fdownload%2Ffast-deep-equal-3.1.3.tgz", @@ -3483,31 +3476,12 @@ "path-exists": "^4.0.0" } }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "optional": true - }, "is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npm.taobao.org/is-fullwidth-code-point/download/is-fullwidth-code-point-3.0.0.tgz", "integrity": "sha1-8Rb4Bk/pCz94RKOJl8C3UFEmnx0=", "dev": true }, - "loader-utils": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz", - "integrity": "sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ==", - "dev": true, - "optional": true, - "requires": { - "big.js": "^5.2.2", - "emojis-list": "^3.0.0", - "json5": "^2.1.2" - } - }, "locate-path": { "version": "5.0.0", "resolved": "https://registry.npm.taobao.org/locate-path/download/locate-path-5.0.0.tgz", @@ -3673,16 +3647,6 @@ "ansi-regex": "^5.0.0" } }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "optional": true, - "requires": { - "has-flag": "^4.0.0" - } - }, "terser": { "version": "4.8.0", "resolved": "https://registry.npm.taobao.org/terser/download/terser-4.8.0.tgz?cache=0&sync_timestamp=1599751633316&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fterser%2Fdownload%2Fterser-4.8.0.tgz", @@ -3721,31 +3685,6 @@ "punycode": "^2.1.1" } }, - "vue-loader-v16": { - "version": "npm:vue-loader@16.1.2", - "resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.1.2.tgz", - "integrity": "sha512-8QTxh+Fd+HB6fiL52iEVLKqE9N1JSlMXLR92Ijm6g8PZrwIxckgpqjPDWRP5TWxdiPaHR+alUWsnu1ShQOwt+Q==", - "dev": true, - "optional": true, - "requires": { - "chalk": "^4.1.0", - "hash-sum": "^2.0.0", - "loader-utils": "^2.0.0" - }, - "dependencies": { - "chalk": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", - "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", - "dev": true, - "optional": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - } - } - }, "wrap-ansi": { "version": "6.2.0", "resolved": "https://registry.npm.taobao.org/wrap-ansi/download/wrap-ansi-6.2.0.tgz", @@ -4518,6 +4457,65 @@ } } }, + "babel-code-frame": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", + "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", + "dev": true, + "requires": { + "chalk": "^1.1.3", + "esutils": "^2.0.2", + "js-tokens": "^3.0.2" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "requires": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + } + }, + "js-tokens": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", + "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", + "dev": true + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true + } + } + }, "babel-eslint": { "version": "10.1.0", "resolved": "https://registry.npm.taobao.org/babel-eslint/download/babel-eslint-10.1.0.tgz", @@ -4658,6 +4656,98 @@ } } }, + "babel-helper-call-delegate": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-call-delegate/-/babel-helper-call-delegate-6.24.1.tgz", + "integrity": "sha1-7Oaqzdx25Bw0YfiL/Fdb0Nqi340=", + "dev": true, + "requires": { + "babel-helper-hoist-variables": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "babel-helper-define-map": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-helper-define-map/-/babel-helper-define-map-6.26.0.tgz", + "integrity": "sha1-pfVtq0GiX5fstJjH66ypgZ+Vvl8=", + "dev": true, + "requires": { + "babel-helper-function-name": "^6.24.1", + "babel-runtime": "^6.26.0", + "babel-types": "^6.26.0", + "lodash": "^4.17.4" + } + }, + "babel-helper-function-name": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz", + "integrity": "sha1-00dbjAPtmCQqJbSDUasYOZ01gKk=", + "dev": true, + "requires": { + "babel-helper-get-function-arity": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "babel-helper-get-function-arity": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.24.1.tgz", + "integrity": "sha1-j3eCqpNAfEHTqlCQj4mwMbG2hT0=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-helper-hoist-variables": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.24.1.tgz", + "integrity": "sha1-HssnaJydJVE+rbyZFKc/VAi+enY=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-helper-optimise-call-expression": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.24.1.tgz", + "integrity": "sha1-96E0J7qfc/j0+pk8VKl4gtEkQlc=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-helper-regex": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-helper-regex/-/babel-helper-regex-6.26.0.tgz", + "integrity": "sha1-MlxZ+QL4LyS3T6zu0DY5VPZJXnI=", + "dev": true, + "requires": { + "babel-runtime": "^6.26.0", + "babel-types": "^6.26.0", + "lodash": "^4.17.4" + } + }, + "babel-helper-replace-supers": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-replace-supers/-/babel-helper-replace-supers-6.24.1.tgz", + "integrity": "sha1-v22/5Dk40XNpohPKiov3S2qQqxo=", + "dev": true, + "requires": { + "babel-helper-optimise-call-expression": "^6.24.1", + "babel-messages": "^6.23.0", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, "babel-helper-vue-jsx-merge-props": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/babel-helper-vue-jsx-merge-props/-/babel-helper-vue-jsx-merge-props-2.0.3.tgz", @@ -4756,6 +4846,56 @@ } } }, + "babel-messages": { + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/babel-messages/-/babel-messages-6.23.0.tgz", + "integrity": "sha1-8830cDhYA1sqKVHG7F7fbGLyYw4=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-check-es2015-constants": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz", + "integrity": "sha1-NRV7EBQm/S/9PaP3XH0ekYNbv4o=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-component": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/babel-plugin-component/-/babel-plugin-component-1.1.1.tgz", + "integrity": "sha512-WUw887kJf2GH80Ng/ZMctKZ511iamHNqPhd9uKo14yzisvV7Wt1EckIrb8oq/uCz3B3PpAW7Xfl7AkTLDYT6ag==", + "dev": true, + "requires": { + "@babel/helper-module-imports": "7.0.0-beta.35" + }, + "dependencies": { + "@babel/helper-module-imports": { + "version": "7.0.0-beta.35", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.0.0-beta.35.tgz", + "integrity": "sha512-vaC1KyIZSuyWb3Lj277fX0pxivyHwuDU4xZsofqgYAbkDxNieMg2vuhzP5AgMweMY7fCQUMTi+BgPqTLjkxXFg==", + "dev": true, + "requires": { + "@babel/types": "7.0.0-beta.35", + "lodash": "^4.2.0" + } + }, + "@babel/types": { + "version": "7.0.0-beta.35", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.0.0-beta.35.tgz", + "integrity": "sha512-y9XT11CozHDgjWcTdxmhSj13rJVXpa5ZXwjjOiTedjaM0ba5ItqdS02t31EhPl7HtOWxsZkYCCUNrSfrOisA6w==", + "dev": true, + "requires": { + "esutils": "^2.0.2", + "lodash": "^4.2.0", + "to-fast-properties": "^2.0.0" + } + } + } + }, "babel-plugin-dynamic-import-node": { "version": "2.3.3", "resolved": "https://registry.npm.taobao.org/babel-plugin-dynamic-import-node/download/babel-plugin-dynamic-import-node-2.3.3.tgz?cache=0&sync_timestamp=1587496311403&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fbabel-plugin-dynamic-import-node%2Fdownload%2Fbabel-plugin-dynamic-import-node-2.3.3.tgz", @@ -4765,6 +4905,338 @@ "object.assign": "^4.1.0" } }, + "babel-plugin-transform-es2015-arrow-functions": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz", + "integrity": "sha1-RSaSy3EdX3ncf4XkQM5BufJE0iE=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-block-scoped-functions": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.22.0.tgz", + "integrity": "sha1-u8UbSflk1wy42OC5ToICRs46YUE=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-block-scoping": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.26.0.tgz", + "integrity": "sha1-1w9SmcEwjQXBL0Y4E7CgnnOxiV8=", + "dev": true, + "requires": { + "babel-runtime": "^6.26.0", + "babel-template": "^6.26.0", + "babel-traverse": "^6.26.0", + "babel-types": "^6.26.0", + "lodash": "^4.17.4" + } + }, + "babel-plugin-transform-es2015-classes": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.24.1.tgz", + "integrity": "sha1-WkxYpQyclGHlZLSyo7+ryXolhNs=", + "dev": true, + "requires": { + "babel-helper-define-map": "^6.24.1", + "babel-helper-function-name": "^6.24.1", + "babel-helper-optimise-call-expression": "^6.24.1", + "babel-helper-replace-supers": "^6.24.1", + "babel-messages": "^6.23.0", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-computed-properties": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.24.1.tgz", + "integrity": "sha1-b+Ko0WiV1WNPTNmZttNICjCBWbM=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-destructuring": { + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz", + "integrity": "sha1-mXux8auWf2gtKwh2/jWNYOdlxW0=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-duplicate-keys": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.24.1.tgz", + "integrity": "sha1-c+s9MQypaePvnskcU3QabxV2Qj4=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-for-of": { + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz", + "integrity": "sha1-9HyVsrYT3x0+zC/bdXNiPHUkhpE=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-function-name": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.24.1.tgz", + "integrity": "sha1-g0yJhTvDaxrw86TF26qU/Y6sqos=", + "dev": true, + "requires": { + "babel-helper-function-name": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-literals": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.22.0.tgz", + "integrity": "sha1-T1SgLWzWbPkVKAAZox0xklN3yi4=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-modules-amd": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.24.1.tgz", + "integrity": "sha1-Oz5UAXI5hC1tGcMBHEvS8AoA0VQ=", + "dev": true, + "requires": { + "babel-plugin-transform-es2015-modules-commonjs": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-modules-commonjs": { + "version": "6.26.2", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.2.tgz", + "integrity": "sha512-CV9ROOHEdrjcwhIaJNBGMBCodN+1cfkwtM1SbUHmvyy35KGT7fohbpOxkE2uLz1o6odKK2Ck/tz47z+VqQfi9Q==", + "dev": true, + "requires": { + "babel-plugin-transform-strict-mode": "^6.24.1", + "babel-runtime": "^6.26.0", + "babel-template": "^6.26.0", + "babel-types": "^6.26.0" + } + }, + "babel-plugin-transform-es2015-modules-systemjs": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.24.1.tgz", + "integrity": "sha1-/4mhQrkRmpBhlfXxBuzzBdlAfSM=", + "dev": true, + "requires": { + "babel-helper-hoist-variables": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-modules-umd": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.24.1.tgz", + "integrity": "sha1-rJl+YoXNGO1hdq22B9YCNErThGg=", + "dev": true, + "requires": { + "babel-plugin-transform-es2015-modules-amd": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-object-super": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.24.1.tgz", + "integrity": "sha1-JM72muIcuDp/hgPa0CH1cusnj40=", + "dev": true, + "requires": { + "babel-helper-replace-supers": "^6.24.1", + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-parameters": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.24.1.tgz", + "integrity": "sha1-V6w1GrScrxSpfNE7CfZv3wpiXys=", + "dev": true, + "requires": { + "babel-helper-call-delegate": "^6.24.1", + "babel-helper-get-function-arity": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-shorthand-properties": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.24.1.tgz", + "integrity": "sha1-JPh11nIch2YbvZmkYi5R8U3jiqA=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-spread": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz", + "integrity": "sha1-1taKmfia7cRTbIGlQujdnxdG+NE=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-sticky-regex": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.24.1.tgz", + "integrity": "sha1-AMHNsaynERLN8M9hJsLta0V8zbw=", + "dev": true, + "requires": { + "babel-helper-regex": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-template-literals": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.22.0.tgz", + "integrity": "sha1-qEs0UPfp+PH2g51taH2oS7EjbY0=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-typeof-symbol": { + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz", + "integrity": "sha1-3sCfHN3/lLUqxz1QXITfWdzOs3I=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-unicode-regex": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.24.1.tgz", + "integrity": "sha1-04sS9C6nMj9yk4fxinxa4frrNek=", + "dev": true, + "requires": { + "babel-helper-regex": "^6.24.1", + "babel-runtime": "^6.22.0", + "regexpu-core": "^2.0.0" + }, + "dependencies": { + "jsesc": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", + "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", + "dev": true + }, + "regexpu-core": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-2.0.0.tgz", + "integrity": "sha1-SdA4g3uNz4v6W5pCE5k45uoq4kA=", + "dev": true, + "requires": { + "regenerate": "^1.2.1", + "regjsgen": "^0.2.0", + "regjsparser": "^0.1.4" + } + }, + "regjsgen": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.2.0.tgz", + "integrity": "sha1-bAFq3qxVT3WCP+N6wFuS1aTtsfc=", + "dev": true + }, + "regjsparser": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.1.5.tgz", + "integrity": "sha1-fuj4Tcb6eS0/0K4ijSS9lJ6tIFw=", + "dev": true, + "requires": { + "jsesc": "~0.5.0" + } + } + } + }, + "babel-plugin-transform-regenerator": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.26.0.tgz", + "integrity": "sha1-4HA2lvveJ/Cj78rPi03KL3s6jy8=", + "dev": true, + "requires": { + "regenerator-transform": "^0.10.0" + }, + "dependencies": { + "regenerator-transform": { + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.10.1.tgz", + "integrity": "sha512-PJepbvDbuK1xgIgnau7Y90cwaAmO/LCLMI2mPvaXq2heGMR3aWW5/BQvYrhJ8jgmQjXewXvBjzfqKcVOmhjZ6Q==", + "dev": true, + "requires": { + "babel-runtime": "^6.18.0", + "babel-types": "^6.19.0", + "private": "^0.1.6" + } + } + } + }, + "babel-plugin-transform-strict-mode": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz", + "integrity": "sha1-1fr3qleKZbvlkc9e2uBKDGcCB1g=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-preset-es2015": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-preset-es2015/-/babel-preset-es2015-6.24.1.tgz", + "integrity": "sha1-1EBQ1rwsn+6nAqrzjXJ6AhBTiTk=", + "dev": true, + "requires": { + "babel-plugin-check-es2015-constants": "^6.22.0", + "babel-plugin-transform-es2015-arrow-functions": "^6.22.0", + "babel-plugin-transform-es2015-block-scoped-functions": "^6.22.0", + "babel-plugin-transform-es2015-block-scoping": "^6.24.1", + "babel-plugin-transform-es2015-classes": "^6.24.1", + "babel-plugin-transform-es2015-computed-properties": "^6.24.1", + "babel-plugin-transform-es2015-destructuring": "^6.22.0", + "babel-plugin-transform-es2015-duplicate-keys": "^6.24.1", + "babel-plugin-transform-es2015-for-of": "^6.22.0", + "babel-plugin-transform-es2015-function-name": "^6.24.1", + "babel-plugin-transform-es2015-literals": "^6.22.0", + "babel-plugin-transform-es2015-modules-amd": "^6.24.1", + "babel-plugin-transform-es2015-modules-commonjs": "^6.24.1", + "babel-plugin-transform-es2015-modules-systemjs": "^6.24.1", + "babel-plugin-transform-es2015-modules-umd": "^6.24.1", + "babel-plugin-transform-es2015-object-super": "^6.24.1", + "babel-plugin-transform-es2015-parameters": "^6.24.1", + "babel-plugin-transform-es2015-shorthand-properties": "^6.24.1", + "babel-plugin-transform-es2015-spread": "^6.22.0", + "babel-plugin-transform-es2015-sticky-regex": "^6.24.1", + "babel-plugin-transform-es2015-template-literals": "^6.22.0", + "babel-plugin-transform-es2015-typeof-symbol": "^6.22.0", + "babel-plugin-transform-es2015-unicode-regex": "^6.24.1", + "babel-plugin-transform-regenerator": "^6.24.1" + } + }, "babel-runtime": { "version": "6.26.0", "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", @@ -4786,6 +5258,85 @@ } } }, + "babel-template": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-template/-/babel-template-6.26.0.tgz", + "integrity": "sha1-3gPi0WOWsGn0bdn/+FIfsaDjXgI=", + "dev": true, + "requires": { + "babel-runtime": "^6.26.0", + "babel-traverse": "^6.26.0", + "babel-types": "^6.26.0", + "babylon": "^6.18.0", + "lodash": "^4.17.4" + } + }, + "babel-traverse": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.26.0.tgz", + "integrity": "sha1-RqnL1+3MYsjlwGTi0tjQ9ANXZu4=", + "dev": true, + "requires": { + "babel-code-frame": "^6.26.0", + "babel-messages": "^6.23.0", + "babel-runtime": "^6.26.0", + "babel-types": "^6.26.0", + "babylon": "^6.18.0", + "debug": "^2.6.8", + "globals": "^9.18.0", + "invariant": "^2.2.2", + "lodash": "^4.17.4" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "globals": { + "version": "9.18.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", + "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==", + "dev": true + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, + "babel-types": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-types/-/babel-types-6.26.0.tgz", + "integrity": "sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc=", + "dev": true, + "requires": { + "babel-runtime": "^6.26.0", + "esutils": "^2.0.2", + "lodash": "^4.17.4", + "to-fast-properties": "^1.0.3" + }, + "dependencies": { + "to-fast-properties": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz", + "integrity": "sha1-uDVx+k2MJbguIxsG46MFXeTKGkc=", + "dev": true + } + } + }, + "babylon": { + "version": "6.18.0", + "resolved": "https://registry.npmjs.org/babylon/-/babylon-6.18.0.tgz", + "integrity": "sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==", + "dev": true + }, "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npm.taobao.org/balanced-match/download/balanced-match-1.0.0.tgz", @@ -12278,6 +12829,12 @@ "utila": "~0.4" } }, + "private": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz", + "integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==", + "dev": true + }, "process": { "version": "0.11.10", "resolved": "https://registry.npm.taobao.org/process/download/process-0.11.10.tgz", @@ -14998,6 +15555,94 @@ } } }, + "vue-loader-v16": { + "version": "npm:vue-loader@16.1.2", + "resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.1.2.tgz", + "integrity": "sha512-8QTxh+Fd+HB6fiL52iEVLKqE9N1JSlMXLR92Ijm6g8PZrwIxckgpqjPDWRP5TWxdiPaHR+alUWsnu1ShQOwt+Q==", + "dev": true, + "optional": true, + "requires": { + "chalk": "^4.1.0", + "hash-sum": "^2.0.0", + "loader-utils": "^2.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "optional": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "dev": true, + "optional": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "optional": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "optional": true + }, + "emojis-list": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz", + "integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==", + "dev": true, + "optional": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "optional": true + }, + "loader-utils": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz", + "integrity": "sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ==", + "dev": true, + "optional": true, + "requires": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^2.1.2" + } + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "optional": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, "vue-particle-line": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/vue-particle-line/-/vue-particle-line-0.1.4.tgz", diff --git a/web/package.json b/web/package.json index 7ea3aaae..761d36ab 100644 --- a/web/package.json +++ b/web/package.json @@ -15,16 +15,12 @@ "@antv/util": "~2.0.9", "@moefe/vue-aplayer": "^2.0.0-beta.5", "axios": "^0.19.2", - "core-js": "^3.6.5", - "echarts": "^4.7.0", "element-ui": "^2.12.0", "highlight.js": "^10.6.0", "marked": "^2.0.0", - "node-sass": "^4.14.1", "path": "^0.12.7", "qs": "^6.8.0", "quill": "^1.3.7", - "sass-loader": "^8.0.0", "screenfull": "^5.0.2", "script-ext-html-webpack-plugin": "^2.1.4", "spark-md5": "^3.0.1", @@ -42,14 +38,16 @@ "@vue/cli-plugin-eslint": "^4.5.6", "@vue/cli-service": "^4.5.6", "babel-eslint": "^10.1.0", + "babel-plugin-component": "^1.1.1", + "babel-preset-es2015": "^6.24.1", + "core-js": "^3.3.2", "eslint": "^6.7.2", "eslint-plugin-vue": "^6.2.2", - "vue-template-compiler": "^2.6.10", - "core-js": "^3.3.2", "node-sass": "^4.12.0", "numericjs": "^1.2.6", "raw-loader": "^3.1.0", - "sass-loader": "^8.0.0" + "sass-loader": "^8.0.0", + "vue-template-compiler": "^2.6.10" }, "eslintConfig": { "root": true, @@ -74,4 +72,4 @@ "> 1%", "last 2 versions" ] -} \ No newline at end of file +} diff --git a/web/src/main.js b/web/src/main.js index ba77a1aa..7c205274 100644 --- a/web/src/main.js +++ b/web/src/main.js @@ -1,11 +1,112 @@ import Vue from 'vue' import App from './App.vue' -// 引入element -import ElementUI from 'element-ui'; -import 'element-ui/lib/theme-chalk/index.css'; -// 全局配置elementui的dialog不能通过点击遮罩层关闭 -ElementUI.Dialog.props.closeOnClickModal.default = false -Vue.use(ElementUI); + +// 按需引入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 +} 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.prototype.$loading = Loading.service; +Vue.prototype.$message = Message; +Dialog.props.closeOnClickModal.default = false + // 引入封装的router import router from '@/router/index' @@ -41,11 +142,6 @@ export default new Vue({ store }).$mount('#app') -//引入echarts -import echarts from 'echarts' -import buildConfig from '../build.config'; -Vue.prototype.$echarts = echarts; - console.log(` 欢迎使用 Gin-Vue-Admin 当前版本:V2.4.0