Compare commits
6 Commits
96ac78f856
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 6495150a80 | |||
| 9d4e3081b9 | |||
| 06b7a095ad | |||
| 9e723b3d8a | |||
| ac1512088f | |||
| 84ebce764b |
452
doc/sql.md
452
doc/sql.md
@@ -3,24 +3,44 @@
|
||||
```sql
|
||||
/* ---------------------------------------------------- */
|
||||
/* Generated by Enterprise Architect Version 10.10 */
|
||||
/* Created On : 20-1月-2026 15:13:42 */
|
||||
/* Created On : 22-1月-2026 10:57:00 */
|
||||
/* DBMS : PostgreSQL */
|
||||
/* ---------------------------------------------------- */
|
||||
|
||||
/* Drop Sequences for Autonumber Columns */
|
||||
DROP SEQUENCE IF EXISTS cg_template_id_seq;
|
||||
|
||||
|
||||
|
||||
DROP SEQUENCE IF EXISTS cg_template_id_seq
|
||||
;
|
||||
|
||||
/* Drop Tables */
|
||||
DROP TABLE IF EXISTS cg_fun_item CASCADE;
|
||||
DROP TABLE IF EXISTS cg_fun_module CASCADE;
|
||||
DROP TABLE IF EXISTS cg_fun_operation CASCADE;
|
||||
DROP TABLE IF EXISTS cg_menu CASCADE;
|
||||
DROP TABLE IF EXISTS cg_role CASCADE;
|
||||
DROP TABLE IF EXISTS cg_role_fun CASCADE;
|
||||
DROP TABLE IF EXISTS cg_template CASCADE;
|
||||
|
||||
DROP TABLE IF EXISTS cg_fun_item CASCADE
|
||||
;
|
||||
|
||||
DROP TABLE IF EXISTS cg_fun_module CASCADE
|
||||
;
|
||||
|
||||
DROP TABLE IF EXISTS cg_fun_operation CASCADE
|
||||
;
|
||||
|
||||
DROP TABLE IF EXISTS cg_menu CASCADE
|
||||
;
|
||||
|
||||
DROP TABLE IF EXISTS cg_role CASCADE
|
||||
;
|
||||
|
||||
DROP TABLE IF EXISTS cg_role_fun CASCADE
|
||||
;
|
||||
|
||||
DROP TABLE IF EXISTS cg_template CASCADE
|
||||
;
|
||||
|
||||
/* Create Tables */
|
||||
CREATE TABLE cg_fun_item (
|
||||
|
||||
CREATE TABLE cg_fun_item
|
||||
(
|
||||
id bigint NOT NULL, -- id
|
||||
module_id bigint NOT NULL, -- 模块ID
|
||||
item_id bigint NOT NULL, -- 功能ID
|
||||
@@ -29,9 +49,11 @@ CREATE TABLE cg_fun_item (
|
||||
is_tenant boolean NOT NULL DEFAULT true, -- 是否租户
|
||||
describe varchar(250) NULL, -- 说明
|
||||
sort_order smallint NOT NULL DEFAULT 0 -- 排序
|
||||
);
|
||||
)
|
||||
;
|
||||
|
||||
CREATE TABLE cg_fun_module (
|
||||
CREATE TABLE cg_fun_module
|
||||
(
|
||||
id bigint NOT NULL, -- id
|
||||
module_code varchar(16) NOT NULL, -- 模块编码
|
||||
module_name varchar(8) NOT NULL, -- 模块名称
|
||||
@@ -39,9 +61,11 @@ CREATE TABLE cg_fun_module (
|
||||
api_package_name varchar(250) NOT NULL, -- 参数包名
|
||||
sort_order smallint NOT NULL DEFAULT 0, -- 排序
|
||||
describe varchar(250) NULL -- 描述
|
||||
);
|
||||
)
|
||||
;
|
||||
|
||||
CREATE TABLE cg_fun_operation (
|
||||
CREATE TABLE cg_fun_operation
|
||||
(
|
||||
id bigint NOT NULL, -- id
|
||||
module_id bigint NOT NULL, -- 模块ID
|
||||
item_id bigint NOT NULL, -- 功能ID(表主键ID)
|
||||
@@ -59,9 +83,11 @@ CREATE TABLE cg_fun_operation (
|
||||
field_config json NOT NULL DEFAULT '[]', -- 可配置字段
|
||||
sort_order smallint NOT NULL DEFAULT 0, -- 排序
|
||||
describe varchar(250) NULL -- 说明说明
|
||||
);
|
||||
)
|
||||
;
|
||||
|
||||
CREATE TABLE cg_menu (
|
||||
CREATE TABLE cg_menu
|
||||
(
|
||||
id bigint NOT NULL, -- 主键ID
|
||||
client_type smallint NOT NULL, -- 客户端类型:0 PC端,1 小程序端,2 H5端
|
||||
menu_name varchar(32) NOT NULL, -- 菜单名称
|
||||
@@ -69,19 +95,24 @@ CREATE TABLE cg_menu (
|
||||
fun_id bigint NULL, -- 操作ID/来自操作表
|
||||
menu_type smallint NOT NULL DEFAULT 0, -- 0菜单1按钮
|
||||
path varchar(64) NULL, -- 路由路径
|
||||
page_path varchar(64) NULL,
|
||||
icon varchar(64) NULL, -- 菜单图标
|
||||
is_tenant boolean NOT NULL DEFAULT true, -- 是否租户
|
||||
is_hide boolean NOT NULL DEFAULT false, -- 是否隐藏
|
||||
sort_order smallint NOT NULL DEFAULT 0 -- 排序
|
||||
);
|
||||
)
|
||||
;
|
||||
|
||||
CREATE TABLE cg_role (
|
||||
CREATE TABLE cg_role
|
||||
(
|
||||
id bigint NOT NULL, -- 主键ID
|
||||
role_name varchar(32) NOT NULL, -- 角色名称
|
||||
role_type smallint NOT NULL -- 角色类型 0平台 1套餐
|
||||
);
|
||||
)
|
||||
;
|
||||
|
||||
CREATE TABLE cg_role_fun (
|
||||
CREATE TABLE cg_role_fun
|
||||
(
|
||||
id bigint NOT NULL, -- 主键ID
|
||||
role_id bigint NOT NULL, -- 角色ID
|
||||
fun_id bigint NOT NULL, -- 操作ID
|
||||
@@ -89,110 +120,331 @@ CREATE TABLE cg_role_fun (
|
||||
assign_data_scope json NOT NULL DEFAULT '[]', -- 指定的数据权限范围
|
||||
exclude_field json NOT NULL DEFAULT '[]', -- 排除的字段
|
||||
client_type smallserial NOT NULL -- 客户端类型:0 PC端,1 小程序端,2 H5端
|
||||
);
|
||||
)
|
||||
;
|
||||
|
||||
CREATE TABLE cg_template (
|
||||
CREATE TABLE cg_template
|
||||
(
|
||||
id bigint NOT NULL DEFAULT NEXTVAL(('"cg_template_id_seq"'::text)::regclass), -- 主键ID
|
||||
is_use boolean NOT NULL DEFAULT false, -- 是否使用
|
||||
template_name varchar(32) NOT NULL, -- 模板名称
|
||||
template_type smallint NOT NULL, -- 模板类型
|
||||
content text NOT NULL -- 正文
|
||||
);
|
||||
)
|
||||
;
|
||||
|
||||
/* Create Primary Keys, Indexes, Uniques, Checks */
|
||||
ALTER TABLE cg_fun_item ADD CONSTRAINT "PK_cg_fun_item" PRIMARY KEY (id);
|
||||
ALTER TABLE cg_fun_item ADD CONSTRAINT u_module_item_code UNIQUE (module_id, item_id, item_code);
|
||||
ALTER TABLE cg_fun_item ADD CONSTRAINT u_module_item_id UNIQUE (module_id, item_id);
|
||||
|
||||
ALTER TABLE cg_fun_module ADD CONSTRAINT "PK_cg_fun_module" PRIMARY KEY (id);
|
||||
ALTER TABLE cg_fun_item ADD CONSTRAINT "PK_cg_fun_item"
|
||||
PRIMARY KEY (id)
|
||||
;
|
||||
|
||||
ALTER TABLE cg_fun_operation ADD CONSTRAINT "PK_cg_fun_operation" PRIMARY KEY (id);
|
||||
ALTER TABLE cg_fun_operation ADD CONSTRAINT u_module_item_opration UNIQUE (module_id, item_id, operation_code);
|
||||
ALTER TABLE cg_fun_operation ADD CONSTRAINT u_module_item_operation_id UNIQUE (module_id, item_id, operation_id);
|
||||
ALTER TABLE cg_fun_item
|
||||
ADD CONSTRAINT u_module_item_code UNIQUE (module_id,item_id,item_code)
|
||||
;
|
||||
|
||||
ALTER TABLE cg_menu ADD CONSTRAINT "PK_cg_menu" PRIMARY KEY (id);
|
||||
ALTER TABLE cg_fun_item
|
||||
ADD CONSTRAINT u_module_item_id UNIQUE (module_id,item_id)
|
||||
;
|
||||
|
||||
ALTER TABLE cg_role ADD CONSTRAINT "PK_cg_role" PRIMARY KEY (id);
|
||||
ALTER TABLE cg_fun_module ADD CONSTRAINT "PK_cg_fun_module"
|
||||
PRIMARY KEY (id)
|
||||
;
|
||||
|
||||
ALTER TABLE cg_role_fun ADD CONSTRAINT "PK_cg_role_fun" PRIMARY KEY (id);
|
||||
ALTER TABLE cg_fun_operation ADD CONSTRAINT "PK_cg_fun_operation"
|
||||
PRIMARY KEY (id)
|
||||
;
|
||||
|
||||
ALTER TABLE cg_template ADD CONSTRAINT "PK_cg_template" PRIMARY KEY (id);
|
||||
ALTER TABLE cg_fun_operation
|
||||
ADD CONSTRAINT u_module_item_opration UNIQUE (module_id,item_id,operation_code)
|
||||
;
|
||||
|
||||
ALTER TABLE cg_fun_operation
|
||||
ADD CONSTRAINT u_module_item_operation_id UNIQUE (module_id,item_id,operation_id)
|
||||
;
|
||||
|
||||
ALTER TABLE cg_menu ADD CONSTRAINT "PK_cg_menu"
|
||||
PRIMARY KEY (id)
|
||||
;
|
||||
|
||||
ALTER TABLE cg_role ADD CONSTRAINT "PK_cg_role"
|
||||
PRIMARY KEY (id)
|
||||
;
|
||||
|
||||
ALTER TABLE cg_role_fun ADD CONSTRAINT "PK_cg_role_fun"
|
||||
PRIMARY KEY (id)
|
||||
;
|
||||
|
||||
ALTER TABLE cg_template ADD CONSTRAINT "PK_cg_template"
|
||||
PRIMARY KEY (id)
|
||||
;
|
||||
|
||||
/* Create Table Comments, Sequences for Autonumber Columns */
|
||||
COMMENT ON TABLE cg_fun_item IS '功能项配置';
|
||||
COMMENT ON COLUMN cg_fun_item.id IS 'id';
|
||||
COMMENT ON COLUMN cg_fun_item.module_id IS '模块ID';
|
||||
COMMENT ON COLUMN cg_fun_item.item_id IS '功能ID';
|
||||
COMMENT ON COLUMN cg_fun_item.item_name IS '功能名称';
|
||||
COMMENT ON COLUMN cg_fun_item.item_code IS '功能编码';
|
||||
COMMENT ON COLUMN cg_fun_item.is_tenant IS '是否租户';
|
||||
COMMENT ON COLUMN cg_fun_item.describe IS '说明';
|
||||
COMMENT ON COLUMN cg_fun_item.sort_order IS '排序';
|
||||
|
||||
COMMENT ON TABLE cg_fun_module IS '模块配置';
|
||||
COMMENT ON COLUMN cg_fun_module.id IS 'id';
|
||||
COMMENT ON COLUMN cg_fun_module.module_code IS '模块编码';
|
||||
COMMENT ON COLUMN cg_fun_module.module_name IS '模块名称';
|
||||
COMMENT ON COLUMN cg_fun_module.package_name IS '包名称';
|
||||
COMMENT ON COLUMN cg_fun_module.api_package_name IS '参数包名';
|
||||
COMMENT ON COLUMN cg_fun_module.sort_order IS '排序';
|
||||
COMMENT ON COLUMN cg_fun_module.describe IS '描述';
|
||||
COMMENT ON TABLE cg_fun_item
|
||||
IS '功能项配置'
|
||||
;
|
||||
|
||||
COMMENT ON TABLE cg_fun_operation IS '操作配置';
|
||||
COMMENT ON COLUMN cg_fun_operation.id IS 'id';
|
||||
COMMENT ON COLUMN cg_fun_operation.module_id IS '模块ID';
|
||||
COMMENT ON COLUMN cg_fun_operation.item_id IS '功能ID(表主键ID)';
|
||||
COMMENT ON COLUMN cg_fun_operation.is_green_light IS '直接放行';
|
||||
COMMENT ON COLUMN cg_fun_operation.operation_id IS '操作ID';
|
||||
COMMENT ON COLUMN cg_fun_operation.operation_code IS '操作编码';
|
||||
COMMENT ON COLUMN cg_fun_operation.fun_name IS '操作名称';
|
||||
COMMENT ON COLUMN cg_fun_operation.fun_type IS '操作类型 > >查 > >改 > >删 > >增';
|
||||
COMMENT ON COLUMN cg_fun_operation.request_type IS '请求类型';
|
||||
COMMENT ON COLUMN cg_fun_operation.is_req_params IS '是否需要请求参数';
|
||||
COMMENT ON COLUMN cg_fun_operation.is_res_params IS '是否需要响应参数';
|
||||
COMMENT ON COLUMN cg_fun_operation.is_page IS '是否分页';
|
||||
COMMENT ON COLUMN cg_fun_operation.path_params IS '路径参数(与请求参数true互斥)';
|
||||
COMMENT ON COLUMN cg_fun_operation.usable_config IS '可配置数据类型json[]';
|
||||
COMMENT ON COLUMN cg_fun_operation.field_config IS '可配置字段';
|
||||
COMMENT ON COLUMN cg_fun_operation.sort_order IS '排序';
|
||||
COMMENT ON COLUMN cg_fun_operation.describe IS '说明说明';
|
||||
COMMENT ON COLUMN cg_fun_item.id
|
||||
IS 'id'
|
||||
;
|
||||
|
||||
COMMENT ON TABLE cg_menu IS '菜单';
|
||||
COMMENT ON COLUMN cg_menu.id IS '主键ID';
|
||||
COMMENT ON COLUMN cg_menu.client_type IS '客户端类型:0 PC端,1 小程序端,2 H5端';
|
||||
COMMENT ON COLUMN cg_menu.menu_name IS '菜单名称';
|
||||
COMMENT ON COLUMN cg_menu.parent_id IS '父菜单ID';
|
||||
COMMENT ON COLUMN cg_menu.fun_id IS '操作ID/来自操作表';
|
||||
COMMENT ON COLUMN cg_menu.menu_type IS '0菜单1按钮';
|
||||
COMMENT ON COLUMN cg_menu.path IS '路由路径';
|
||||
COMMENT ON COLUMN cg_menu.icon IS '菜单图标';
|
||||
COMMENT ON COLUMN cg_menu.is_tenant IS '是否租户';
|
||||
COMMENT ON COLUMN cg_menu.is_hide IS '是否隐藏';
|
||||
COMMENT ON COLUMN cg_menu.sort_order IS '排序';
|
||||
COMMENT ON COLUMN cg_fun_item.module_id
|
||||
IS '模块ID'
|
||||
;
|
||||
|
||||
COMMENT ON TABLE cg_role IS '角色表';
|
||||
COMMENT ON COLUMN cg_role.id IS '主键ID';
|
||||
COMMENT ON COLUMN cg_role.role_name IS '角色名称';
|
||||
COMMENT ON COLUMN cg_role.role_type IS '角色类型 0平台 1套餐';
|
||||
COMMENT ON COLUMN cg_fun_item.item_id
|
||||
IS '功能ID'
|
||||
;
|
||||
|
||||
COMMENT ON TABLE cg_role_fun IS '角色权限表';
|
||||
COMMENT ON COLUMN cg_role_fun.id IS '主键ID';
|
||||
COMMENT ON COLUMN cg_role_fun.role_id IS '角色ID';
|
||||
COMMENT ON COLUMN cg_role_fun.fun_id IS '操作ID';
|
||||
COMMENT ON COLUMN cg_role_fun.data_scope IS '数据权限默认:0无';
|
||||
COMMENT ON COLUMN cg_role_fun.assign_data_scope IS '指定的数据权限范围';
|
||||
COMMENT ON COLUMN cg_role_fun.exclude_field IS '排除的字段';
|
||||
COMMENT ON COLUMN cg_role_fun.client_type IS '客户端类型:0 PC端,1 小程序端,2 H5端';
|
||||
COMMENT ON COLUMN cg_fun_item.item_name
|
||||
IS '功能名称'
|
||||
;
|
||||
|
||||
COMMENT ON TABLE cg_template IS '模板表';
|
||||
COMMENT ON COLUMN cg_template.id IS '主键ID';
|
||||
COMMENT ON COLUMN cg_template.is_use IS '是否使用';
|
||||
COMMENT ON COLUMN cg_template.template_name IS '模板名称';
|
||||
COMMENT ON COLUMN cg_template.template_type IS '模板类型';
|
||||
COMMENT ON COLUMN cg_template.content IS '正文';
|
||||
COMMENT ON COLUMN cg_fun_item.item_code
|
||||
IS '功能编码'
|
||||
;
|
||||
|
||||
COMMENT ON COLUMN cg_fun_item.is_tenant
|
||||
IS '是否租户'
|
||||
;
|
||||
|
||||
COMMENT ON COLUMN cg_fun_item.describe
|
||||
IS '说明'
|
||||
;
|
||||
|
||||
COMMENT ON COLUMN cg_fun_item.sort_order
|
||||
IS '排序'
|
||||
;
|
||||
|
||||
COMMENT ON TABLE cg_fun_module
|
||||
IS '模块配置'
|
||||
;
|
||||
|
||||
COMMENT ON COLUMN cg_fun_module.id
|
||||
IS 'id'
|
||||
;
|
||||
|
||||
COMMENT ON COLUMN cg_fun_module.module_code
|
||||
IS '模块编码'
|
||||
;
|
||||
|
||||
COMMENT ON COLUMN cg_fun_module.module_name
|
||||
IS '模块名称'
|
||||
;
|
||||
|
||||
COMMENT ON COLUMN cg_fun_module.package_name
|
||||
IS '包名称'
|
||||
;
|
||||
|
||||
COMMENT ON COLUMN cg_fun_module.api_package_name
|
||||
IS '参数包名'
|
||||
;
|
||||
|
||||
COMMENT ON COLUMN cg_fun_module.sort_order
|
||||
IS '排序'
|
||||
;
|
||||
|
||||
COMMENT ON COLUMN cg_fun_module.describe
|
||||
IS '描述'
|
||||
;
|
||||
|
||||
COMMENT ON TABLE cg_fun_operation
|
||||
IS '操作配置'
|
||||
;
|
||||
|
||||
COMMENT ON COLUMN cg_fun_operation.id
|
||||
IS 'id'
|
||||
;
|
||||
|
||||
COMMENT ON COLUMN cg_fun_operation.module_id
|
||||
IS '模块ID'
|
||||
;
|
||||
|
||||
COMMENT ON COLUMN cg_fun_operation.item_id
|
||||
IS '功能ID(表主键ID)'
|
||||
;
|
||||
|
||||
COMMENT ON COLUMN cg_fun_operation.is_green_light
|
||||
IS '直接放行'
|
||||
;
|
||||
|
||||
COMMENT ON COLUMN cg_fun_operation.operation_id
|
||||
IS '操作ID'
|
||||
;
|
||||
|
||||
COMMENT ON COLUMN cg_fun_operation.operation_code
|
||||
IS '操作编码'
|
||||
;
|
||||
|
||||
COMMENT ON COLUMN cg_fun_operation.fun_name
|
||||
IS '操作名称'
|
||||
;
|
||||
|
||||
COMMENT ON COLUMN cg_fun_operation.fun_type
|
||||
IS '操作类型>>查>>改>>删>>增'
|
||||
;
|
||||
|
||||
COMMENT ON COLUMN cg_fun_operation.request_type
|
||||
IS '请求类型'
|
||||
;
|
||||
|
||||
COMMENT ON COLUMN cg_fun_operation.is_req_params
|
||||
IS '是否需要请求参数'
|
||||
;
|
||||
|
||||
COMMENT ON COLUMN cg_fun_operation.is_res_params
|
||||
IS '是否需要响应参数'
|
||||
;
|
||||
|
||||
COMMENT ON COLUMN cg_fun_operation.is_page
|
||||
IS '是否分页'
|
||||
;
|
||||
|
||||
COMMENT ON COLUMN cg_fun_operation.path_params
|
||||
IS '路径参数(与请求参数true互斥)'
|
||||
;
|
||||
|
||||
COMMENT ON COLUMN cg_fun_operation.usable_config
|
||||
IS '可配置数据类型json[]'
|
||||
;
|
||||
|
||||
COMMENT ON COLUMN cg_fun_operation.field_config
|
||||
IS '可配置字段'
|
||||
;
|
||||
|
||||
COMMENT ON COLUMN cg_fun_operation.sort_order
|
||||
IS '排序'
|
||||
;
|
||||
|
||||
COMMENT ON COLUMN cg_fun_operation.describe
|
||||
IS '说明说明'
|
||||
;
|
||||
|
||||
COMMENT ON TABLE cg_menu
|
||||
IS '菜单'
|
||||
;
|
||||
|
||||
COMMENT ON COLUMN cg_menu.id
|
||||
IS '主键ID'
|
||||
;
|
||||
|
||||
COMMENT ON COLUMN cg_menu.client_type
|
||||
IS '客户端类型:0 PC端,1 小程序端,2 H5端'
|
||||
;
|
||||
|
||||
COMMENT ON COLUMN cg_menu.menu_name
|
||||
IS '菜单名称'
|
||||
;
|
||||
|
||||
COMMENT ON COLUMN cg_menu.parent_id
|
||||
IS '父菜单ID'
|
||||
;
|
||||
|
||||
COMMENT ON COLUMN cg_menu.fun_id
|
||||
IS '操作ID/来自操作表'
|
||||
;
|
||||
|
||||
COMMENT ON COLUMN cg_menu.menu_type
|
||||
IS '0菜单1按钮'
|
||||
;
|
||||
|
||||
COMMENT ON COLUMN cg_menu.path
|
||||
IS '路由路径'
|
||||
;
|
||||
|
||||
COMMENT ON COLUMN cg_menu.icon
|
||||
IS '菜单图标'
|
||||
;
|
||||
|
||||
COMMENT ON COLUMN cg_menu.is_tenant
|
||||
IS '是否租户'
|
||||
;
|
||||
|
||||
COMMENT ON COLUMN cg_menu.is_hide
|
||||
IS '是否隐藏'
|
||||
;
|
||||
|
||||
COMMENT ON COLUMN cg_menu.sort_order
|
||||
IS '排序'
|
||||
;
|
||||
|
||||
COMMENT ON TABLE cg_role
|
||||
IS '角色表'
|
||||
;
|
||||
|
||||
COMMENT ON COLUMN cg_role.id
|
||||
IS '主键ID'
|
||||
;
|
||||
|
||||
COMMENT ON COLUMN cg_role.role_name
|
||||
IS '角色名称'
|
||||
;
|
||||
|
||||
COMMENT ON COLUMN cg_role.role_type
|
||||
IS '角色类型 0平台 1套餐'
|
||||
;
|
||||
|
||||
COMMENT ON TABLE cg_role_fun
|
||||
IS '角色权限表'
|
||||
;
|
||||
|
||||
COMMENT ON COLUMN cg_role_fun.id
|
||||
IS '主键ID'
|
||||
;
|
||||
|
||||
COMMENT ON COLUMN cg_role_fun.role_id
|
||||
IS '角色ID'
|
||||
;
|
||||
|
||||
COMMENT ON COLUMN cg_role_fun.fun_id
|
||||
IS '操作ID'
|
||||
;
|
||||
|
||||
COMMENT ON COLUMN cg_role_fun.data_scope
|
||||
IS '数据权限默认:0无'
|
||||
;
|
||||
|
||||
COMMENT ON COLUMN cg_role_fun.assign_data_scope
|
||||
IS '指定的数据权限范围'
|
||||
;
|
||||
|
||||
COMMENT ON COLUMN cg_role_fun.exclude_field
|
||||
IS '排除的字段'
|
||||
;
|
||||
|
||||
COMMENT ON COLUMN cg_role_fun.client_type
|
||||
IS '客户端类型:0 PC端,1 小程序端,2 H5端'
|
||||
;
|
||||
|
||||
|
||||
|
||||
COMMENT ON COLUMN cg_template.id
|
||||
IS '主键ID'
|
||||
;
|
||||
|
||||
COMMENT ON COLUMN cg_template.is_use
|
||||
IS '是否使用'
|
||||
;
|
||||
|
||||
COMMENT ON COLUMN cg_template.template_name
|
||||
IS '模板名称'
|
||||
;
|
||||
|
||||
COMMENT ON COLUMN cg_template.template_type
|
||||
IS '模板类型'
|
||||
;
|
||||
|
||||
COMMENT ON COLUMN cg_template.content
|
||||
IS '正文'
|
||||
;
|
||||
|
||||
CREATE SEQUENCE cg_template_id_seq INCREMENT 1 START 1
|
||||
;
|
||||
|
||||
CREATE SEQUENCE cg_template_id_seq INCREMENT 1 START 1;
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
130
doc/模版.md
130
doc/模版.md
@@ -95,7 +95,7 @@ public class $basics.itemCodeUp$Controller {
|
||||
$operationList:{op |
|
||||
|
||||
@OperLog
|
||||
@SecureAudit(id = $op.id$,$if(op.isGreenLight)$isGreenLight = true,$endif$ $if(!op.isTenant)$isTenant = false,$endif$
|
||||
@SecureAudit(id = $op.id$,$if(op.isGreenLight)$isGreenLight = true,$endif$ $if(!item.isTenant)$isTenant = false,$endif$
|
||||
funType = FunTypeEnum.$op.funType$, funName = "$op.funName$", funCode = "$module.moduleCode$:$item.itemCode$:$op.operationCode$")
|
||||
@Operation(summary = "$op.funName$", description = "$op.describe$")
|
||||
$requestAnnotations.(op.requestType)$("$op.url$$op.pathParamsUrl$")
|
||||
@@ -279,7 +279,9 @@ moduleTemplate(module) ::= <<
|
||||
$module:{op |
|
||||
<insert tableName="ms_fun_module">
|
||||
<column name="id" value="$op.id$"/>
|
||||
<column name="module_name" value="$op.moduleCode$"/>
|
||||
<column name="module_code" value="$op.moduleCode$"/>
|
||||
<column name="module_name" value="$op.moduleName$"/>
|
||||
<column name="remark" value="$op.describe$"/>
|
||||
</insert>
|
||||
}$
|
||||
</changeSet>
|
||||
@@ -301,9 +303,10 @@ itemTemplate(item) ::= <<
|
||||
<insert tableName="ms_fun_item">
|
||||
<column name="id" value="$op.id$"/>
|
||||
<column name="module_id" value="$op.moduleId$"/>
|
||||
<column name="item_code" value="$op.itemCode$"/>
|
||||
<column name="item_name" value="$op.itemName$"/>
|
||||
<column name="is_tenant" value="$op.isTenant$"/>
|
||||
<column name="describe" value="$op.describe$"/>
|
||||
<column name="remark" value="$op.describe$"/>
|
||||
</insert>
|
||||
}$
|
||||
</changeSet>
|
||||
@@ -342,18 +345,18 @@ operationTemplate(operation) ::= <<
|
||||
<changeSet id="insert-ms-fun-operation-data" author="xinghe">
|
||||
<comment>初始化操作数据</comment>
|
||||
$operation:{op |
|
||||
<insert tableName="ms_fun_item">
|
||||
<insert tableName="ms_fun_operation">
|
||||
<column name="id" value="$op.id$"/>
|
||||
<column name="module_id" value="$op.moduleId$"/>
|
||||
<column name="item_id" value="$op.itemId$"/>
|
||||
<column name="is_green_light" value="$op.isGreenLight$"/>
|
||||
<column name="fun_code" value="$op.operationCode$"/>
|
||||
<column name="fun_code" value="$op.moduleCode$:$op.itemCode$:$op.operationCode$"/>
|
||||
<column name="fun_name" value="$op.funName$"/>
|
||||
<column name="fun_type" value="$funTypeAnnotations.(op.funType)$"/>
|
||||
<column name="usable_config" value="$op.usableConfigJson$"/>
|
||||
<column name="field_cofnig" value="$op.fieldConfigJson$"/>
|
||||
<column name="field_config" value="$op.fieldConfigJson$"/>
|
||||
<column name="sort_order" value="$op.sortOrder$"/>
|
||||
<column name="describe" value="$op.describe$"/>
|
||||
<column name="remark" value="$op.describe$"/>
|
||||
</insert>
|
||||
}$
|
||||
</changeSet>
|
||||
@@ -362,3 +365,116 @@ operationTemplate(operation) ::= <<
|
||||
>>
|
||||
```
|
||||
|
||||
|
||||
|
||||
## 角色套餐
|
||||
|
||||
初始化数据
|
||||
|
||||
```xml
|
||||
group dbXml;
|
||||
|
||||
roleBindFunTemplate(operations,clientTypeCode,clientTypeDesc) ::= <<
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<databaseChangeLog
|
||||
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
|
||||
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.24.xsd">
|
||||
|
||||
<changeSet id="insert-ms-user-role-fun-data" author="xinghe">
|
||||
<comment>初始化平台角色权限数据($clientTypeDesc$)</comment>
|
||||
$operations:{op |
|
||||
<!-- $op.funName$ -->
|
||||
<insert tableName="ms_user_role_fun">
|
||||
<column name="id" value="$op.id$$clientTypeCode$100"/>
|
||||
<column name="role_id" value="100"/>
|
||||
<column name="fun_id" value="$op.id$"/>
|
||||
<column name="client_type" value="$clientTypeCode$"/>
|
||||
<column name="data_scope" value="0"/>
|
||||
<column name="assign_data_scope" value="[]"/>
|
||||
<column name="exclude_field" value="[]"/>
|
||||
<column name="update_by_id" value="10086"/>
|
||||
<column name="update_time" value="2025-01-01 00:00:00"/>
|
||||
</insert>
|
||||
}$
|
||||
</changeSet>
|
||||
</databaseChangeLog>
|
||||
>>
|
||||
|
||||
|
||||
mealBindFunTemplate(meals,clientTypeCode,clientTypeDesc) ::= <<
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<databaseChangeLog
|
||||
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
|
||||
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.24.xsd">
|
||||
|
||||
<changeSet id="insert-ms-tenant-meal-bind-fun-data" author="xinghe">
|
||||
<comment>初始化模块数据($clientTypeDesc$)</comment>
|
||||
$meals:{op |
|
||||
<!-- $op.funName$ -->
|
||||
<insert tableName="ms_tenant_meal_bind_fun">
|
||||
<column name="id" value="$op.id$$clientTypeCode$200"/>
|
||||
<column name="meal_id" value="200"/>
|
||||
<column name="fun_id" value="$op.id$"/>
|
||||
<column name="client_type" value="$clientTypeCode$"/>
|
||||
</insert>
|
||||
}$
|
||||
</changeSet>
|
||||
</databaseChangeLog>
|
||||
>>
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## 菜单数据
|
||||
|
||||
菜单数据生成
|
||||
|
||||
```xml
|
||||
menuTypeAnnotations ::= [
|
||||
"MENU_ID": "0",
|
||||
"BUTTON_ID": "1"
|
||||
]
|
||||
clientTypeAnnotations ::= [
|
||||
"PC": "0",
|
||||
"MINI_PROGRAM": "1",
|
||||
"H5": "2"
|
||||
]
|
||||
menuTemplate(menus) ::= <<
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<databaseChangeLog
|
||||
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
|
||||
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.24.xsd">
|
||||
|
||||
<changeSet id="insert-ms-menu-data" author="xinghe">
|
||||
<comment>初始化菜单数据</comment>
|
||||
$menus:{op |
|
||||
<insert tableName="ms_menu">
|
||||
<column name="id" value="$op.id$"/>
|
||||
<column name="parent_id" value="$op.parentId$"/>
|
||||
<column name="fun_id" value="$if(op.funId)$$op.funId$$else$null$endif$"/>
|
||||
<column name="menu_name" value="$op.menuName$"/>
|
||||
<column name="menu_type" value="$menuTypeAnnotations.(op.menuType)$"/>
|
||||
<column name="client_type" value="$clientTypeAnnotations.(op.clientType)$"/>
|
||||
<column name="route_path" value="$op.path$"/>
|
||||
<column name="page_path" value="$op.pagePath$"/>
|
||||
<column name="icon" value="$op.icon$"/>
|
||||
<column name="is_tenant" value="$op.isTenant$"/>
|
||||
<column name="is_hide" value="$op.isHide$"/>
|
||||
<column name="sort_order" value="$op.sortOrder$"/>
|
||||
</insert>
|
||||
}$
|
||||
</changeSet>
|
||||
</databaseChangeLog>
|
||||
>>
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
Binary file not shown.
40
pom.xml
40
pom.xml
@@ -75,18 +75,7 @@
|
||||
<artifactId>fastjson2</artifactId>
|
||||
<version>${fastjson2.version}</version>
|
||||
</dependency>
|
||||
<!-- knife4j -->
|
||||
<dependency>
|
||||
<groupId>com.github.xiaoymin</groupId>
|
||||
<artifactId>knife4j-openapi3-jakarta-spring-boot-starter</artifactId>
|
||||
<version>${knife4j.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.springdoc</groupId>
|
||||
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springdoc</groupId>
|
||||
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
|
||||
@@ -150,4 +139,31 @@
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>dev</id>
|
||||
<activation>
|
||||
<activeByDefault>true</activeByDefault>
|
||||
</activation>
|
||||
<dependencies>
|
||||
<!-- knife4j -->
|
||||
<dependency>
|
||||
<groupId>com.github.xiaoymin</groupId>
|
||||
<artifactId>knife4j-openapi3-jakarta-spring-boot-starter</artifactId>
|
||||
<version>${knife4j.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.springdoc</groupId>
|
||||
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</profile>
|
||||
|
||||
<profile>
|
||||
<id>prod</id>
|
||||
</profile>
|
||||
</profiles>
|
||||
</project>
|
||||
@@ -5,20 +5,19 @@ import com.cczsa.xinghe.codegen.entity.enums.MenuTypeEnum;
|
||||
import com.mybatisflex.annotation.Id;
|
||||
import com.mybatisflex.annotation.KeyType;
|
||||
import com.mybatisflex.annotation.Table;
|
||||
import java.io.Serializable;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 菜单 实体类。
|
||||
*
|
||||
* @author My
|
||||
* @author xiayb
|
||||
* @since 0.0.1
|
||||
*/
|
||||
@Data
|
||||
@@ -68,6 +67,11 @@ public class MenuEntity extends BaseEntity implements Serializable {
|
||||
*/
|
||||
private String path;
|
||||
|
||||
/**
|
||||
* 页面路径
|
||||
*/
|
||||
private String pagePath;
|
||||
|
||||
/**
|
||||
* 菜单图标
|
||||
*/
|
||||
|
||||
@@ -29,9 +29,6 @@ public class CodeGen implements Serializable {
|
||||
@Schema(description = "功能ID")
|
||||
private Long itemId;
|
||||
|
||||
@Schema(description = "模块ID")
|
||||
private Long moduleId;
|
||||
|
||||
|
||||
@Hidden
|
||||
@AssertTrue(message = "当代码生成类型为 CONTROLLER 时,功能ID不能为空")
|
||||
@@ -42,15 +39,5 @@ public class CodeGen implements Serializable {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Hidden
|
||||
@AssertTrue(message = "当代码生成类型为 MODULE_DATA_INFO 时,模块ID不能为空")
|
||||
public boolean isModuleIdValid() {
|
||||
if (codeGenType == CodeGenType.MODULE_DATA_INFO) {
|
||||
return moduleId != null;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -15,7 +15,9 @@ import lombok.Getter;
|
||||
public enum CodeGenType {
|
||||
|
||||
CONTROLLER(0, "controller"),
|
||||
MODULE_DATA_INFO(1, "module_data_info");
|
||||
MODULE_DATA_INFO(1, "module_data_info"),
|
||||
ROLE_PERMISSION(2,"role_permission"),
|
||||
MENU_DATA_INFO(3, "menu_data_info");
|
||||
|
||||
private final int code;
|
||||
private final String desc;
|
||||
|
||||
@@ -15,6 +15,22 @@ import lombok.EqualsAndHashCode;
|
||||
@Data
|
||||
public class FunOperationTemp extends FunOperationEntity {
|
||||
|
||||
/**
|
||||
* 模块名称
|
||||
*/
|
||||
private String moduleName;
|
||||
/**
|
||||
* 模块编码
|
||||
*/
|
||||
private String moduleCode;
|
||||
/**
|
||||
* 功能名称
|
||||
*/
|
||||
private String itemName;
|
||||
/**
|
||||
* 功能编码
|
||||
*/
|
||||
private String itemCode;
|
||||
/**
|
||||
* URL路径
|
||||
*/
|
||||
|
||||
@@ -25,7 +25,9 @@ public enum TemplateTypeEnum {
|
||||
RESPONSE_PARAM(2, "响应参数"),
|
||||
SERVICE(3, "服务接口"),
|
||||
SERVICE_IMPL(4, "服务实现"),
|
||||
MODULE_DATA_INFO(5, "模块功能操作数据生成");
|
||||
MODULE_DATA_INFO(5, "模块功能操作数据生成"),
|
||||
ROLE_DATA_INFO(6, "角色套餐权限数据生成"),
|
||||
MENU_DATA_INFO(7, "菜单数据生成");
|
||||
|
||||
private final int code;
|
||||
private final String desc;
|
||||
|
||||
@@ -29,4 +29,7 @@ public class FunItemQueryReq implements Serializable {
|
||||
@Schema(description = "功能编码")
|
||||
private String itemCode;
|
||||
|
||||
@Schema(description = "是否租户")
|
||||
private Boolean isTenant;
|
||||
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.cczsa.xinghe.codegen.entity.enums.ClientTypeEnum;
|
||||
import com.cczsa.xinghe.codegen.entity.enums.MenuTypeEnum;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Pattern;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@@ -35,9 +36,16 @@ public class MenuAddReq implements Serializable {
|
||||
@Schema(description = "父菜单ID")
|
||||
private Long parentId = 0L;
|
||||
|
||||
@Pattern(
|
||||
regexp = "^(?:$|/(?:[a-zA-Z0-9_=?#&-]+/)*[a-zA-Z0-9_=?#&-]+)$",
|
||||
message = "路由路径格式不正确:必须以'/'开头,不能以'/'结尾,且只能包含字母、数字、下划线、横杠、等号、问号、井号、与号,以及分隔斜杠(不能连续)"
|
||||
)
|
||||
@Schema(description = "路由路径")
|
||||
private String path;
|
||||
|
||||
@Schema(description = "页面路径")
|
||||
private String pagePath;
|
||||
|
||||
@Schema(description = "菜单图标")
|
||||
private String icon;
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.cczsa.xinghe.codegen.entity.enums.ClientTypeEnum;
|
||||
import com.cczsa.xinghe.codegen.entity.enums.MenuTypeEnum;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Pattern;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import java.io.Serial;
|
||||
@@ -37,9 +38,16 @@ public class MenuEditReq implements Serializable {
|
||||
@Schema(description = "父菜单ID")
|
||||
private Long parentId = 0L;
|
||||
|
||||
@Pattern(
|
||||
regexp = "^(?:$|/(?:[a-zA-Z0-9_=?#&-]+/)*[a-zA-Z0-9_=?#&-]+)$",
|
||||
message = "路由路径格式不正确:必须以'/'开头,不能以'/'结尾,且只能包含字母、数字、下划线、横杠、等号、问号、井号、与号,以及分隔斜杠(不能连续)"
|
||||
)
|
||||
@Schema(description = "路由路径")
|
||||
private String path;
|
||||
|
||||
@Schema(description = "页面路径")
|
||||
private String pagePath;
|
||||
|
||||
@Schema(description = "菜单图标")
|
||||
private String icon;
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import com.cczsa.xinghe.codegen.entity.MenuEntity;
|
||||
/**
|
||||
* 菜单 映射层。
|
||||
*
|
||||
* @author My
|
||||
* @author xiayb
|
||||
* @since 0.0.1
|
||||
*/
|
||||
@Mapper
|
||||
|
||||
@@ -8,7 +8,7 @@ import java.io.Serial;
|
||||
/**
|
||||
* 菜单 表定义层。
|
||||
*
|
||||
* @author My
|
||||
* @author xiayb
|
||||
* @since 0.0.1
|
||||
*/
|
||||
public class MenuDef extends TableDef {
|
||||
@@ -61,6 +61,11 @@ public class MenuDef extends TableDef {
|
||||
*/
|
||||
public final QueryColumn MENU_TYPE = new QueryColumn(this, "menu_type");
|
||||
|
||||
/**
|
||||
* 页面路径
|
||||
*/
|
||||
public final QueryColumn PAGE_PATH = new QueryColumn(this, "page_path");
|
||||
|
||||
/**
|
||||
* 父菜单ID
|
||||
*/
|
||||
@@ -84,7 +89,7 @@ public class MenuDef extends TableDef {
|
||||
/**
|
||||
* 默认字段,不包含逻辑删除或者 large 等字段。
|
||||
*/
|
||||
public final QueryColumn[] DEFAULT_COLUMNS = new QueryColumn[]{ID, CLIENT_TYPE, MENU_NAME, PARENT_ID, FUN_ID, MENU_TYPE, PATH, ICON, IS_TENANT, IS_HIDE, SORT_ORDER};
|
||||
public final QueryColumn[] DEFAULT_COLUMNS = new QueryColumn[]{ID, CLIENT_TYPE, MENU_NAME, PARENT_ID, FUN_ID, MENU_TYPE, PATH, PAGE_PATH, ICON, IS_TENANT, IS_HIDE, SORT_ORDER};
|
||||
|
||||
public MenuDef() {
|
||||
super("", "cg_menu");
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
package com.cczsa.xinghe.codegen.service.flow.template;
|
||||
|
||||
import com.cczsa.xinghe.codegen.entity.MenuEntity;
|
||||
import com.cczsa.xinghe.codegen.entity.enums.TemplateTypeEnum;
|
||||
import com.cczsa.xinghe.codegen.mapper.MenuMapper;
|
||||
import com.cczsa.xinghe.codegen.service.TemplateService;
|
||||
import com.yomahub.liteflow.annotation.LiteflowComponent;
|
||||
import com.yomahub.liteflow.core.NodeComponent;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.stringtemplate.v4.ST;
|
||||
import org.stringtemplate.v4.STGroup;
|
||||
import org.stringtemplate.v4.STGroupString;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.zip.ZipEntry;
|
||||
import java.util.zip.ZipOutputStream;
|
||||
|
||||
/**
|
||||
* @author xia
|
||||
* @date 2026/1/23
|
||||
* @version 0.0.1
|
||||
*/
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
@LiteflowComponent(id = "menuDataInfo", name = "菜单数据生成")
|
||||
public class MenuDataInfo extends NodeComponent {
|
||||
|
||||
private final TemplateService templateService;
|
||||
private final MenuMapper menuMapper;
|
||||
|
||||
// 压缩流
|
||||
private ZipOutputStream zos;
|
||||
|
||||
@Override
|
||||
public void process() throws Exception {
|
||||
// 获取 模版
|
||||
String template = templateService.getTemplateTypeContent(TemplateTypeEnum.MENU_DATA_INFO);
|
||||
if (template == null){
|
||||
return;
|
||||
}
|
||||
// 流
|
||||
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
|
||||
zos = new ZipOutputStream(outputStream);
|
||||
|
||||
// 平台角色
|
||||
STGroup group = new STGroupString("dbXml",template, '$', '$');
|
||||
// 平台角色 功能权限
|
||||
ST menuTemplate = group.getInstanceOf("menuTemplate"); // 使用正确的模板名称
|
||||
List<MenuEntity> menuEntities = menuMapper.selectAll();
|
||||
menuEntities.sort(Comparator.comparing(MenuEntity::getId));
|
||||
menuTemplate.add("menus",menuEntities);
|
||||
writeCodeToZip(menuTemplate);
|
||||
|
||||
// 确保 ZIP 流结束
|
||||
zos.finish();
|
||||
// 返回数据
|
||||
this.getSlot().setResponseData(outputStream.toByteArray());
|
||||
}
|
||||
|
||||
private void writeCodeToZip(ST st) throws IOException {
|
||||
// 生成代码
|
||||
String result = st.render();
|
||||
ZipEntry entry = new ZipEntry("insert-menus-data.xml");
|
||||
zos.putNextEntry(entry);
|
||||
zos.write(result.getBytes(StandardCharsets.UTF_8));
|
||||
zos.closeEntry();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -8,6 +8,9 @@ import com.cczsa.xinghe.codegen.entity.enums.TemplateTypeEnum;
|
||||
import com.cczsa.xinghe.codegen.mapper.FunItemMapper;
|
||||
import com.cczsa.xinghe.codegen.mapper.FunModuleMapper;
|
||||
import com.cczsa.xinghe.codegen.mapper.FunOperationMapper;
|
||||
import com.cczsa.xinghe.codegen.mapper.def.FunItemDef;
|
||||
import com.cczsa.xinghe.codegen.mapper.def.FunModuleDef;
|
||||
import com.cczsa.xinghe.codegen.mapper.def.FunOperationDef;
|
||||
import com.cczsa.xinghe.codegen.service.TemplateService;
|
||||
import com.mybatisflex.core.query.QueryWrapper;
|
||||
import com.yomahub.liteflow.annotation.LiteflowComponent;
|
||||
@@ -47,12 +50,6 @@ public class ModuleDataInfoCreate extends NodeComponent {
|
||||
|
||||
@Override
|
||||
public void process() throws Exception {
|
||||
Long moduleId = this.getContextBean(Long.class);
|
||||
|
||||
FunModuleEntity moduleEntity = funModuleMapper.selectOneById(moduleId);
|
||||
if (moduleEntity == null){
|
||||
return;
|
||||
}
|
||||
|
||||
// 获取 模版
|
||||
String template = templateService.getTemplateTypeContent(TemplateTypeEnum.MODULE_DATA_INFO);
|
||||
@@ -83,7 +80,17 @@ public class ModuleDataInfoCreate extends NodeComponent {
|
||||
|
||||
ST operationTemplate = group.getInstanceOf("operationTemplate"); // 使用正确的模板名称
|
||||
// 操作数据生成
|
||||
List<FunOperationTemp> funOperationEntities = funOperationMapper.selectListByQueryAs(QueryWrapper.create(),FunOperationTemp.class);
|
||||
FunModuleDef moduleDef = FunModuleDef.FUN_MODULE_ENTITY;
|
||||
FunItemDef itemDefDef = FunItemDef.FUN_ITEM_ENTITY;
|
||||
FunOperationDef operationDef = FunOperationDef.FUN_OPERATION_ENTITY;
|
||||
|
||||
QueryWrapper wrapper = QueryWrapper.create();
|
||||
wrapper.select(operationDef.ALL_COLUMNS,moduleDef.MODULE_NAME,moduleDef.MODULE_CODE,itemDefDef.ITEM_NAME,itemDefDef.ITEM_CODE)
|
||||
.from(operationDef)
|
||||
.leftJoin(moduleDef).on(operationDef.MODULE_ID.eq(moduleDef.ID))
|
||||
.leftJoin(itemDefDef).on(operationDef.ITEM_ID.eq(itemDefDef.ID))
|
||||
.where(operationDef.ID.isNotNull());
|
||||
List<FunOperationTemp> funOperationEntities = funOperationMapper.selectListByQueryAs(wrapper,FunOperationTemp.class);
|
||||
funOperationEntities.sort(Comparator.comparing(FunOperationEntity::getId));
|
||||
funOperationEntities.forEach(FunOperationTemp::info);
|
||||
operationTemplate.add("operation", funOperationEntities);
|
||||
|
||||
@@ -0,0 +1,121 @@
|
||||
package com.cczsa.xinghe.codegen.service.flow.template;
|
||||
|
||||
import com.cczsa.xinghe.codegen.entity.FunOperationEntity;
|
||||
import com.cczsa.xinghe.codegen.entity.enums.ClientTypeEnum;
|
||||
import com.cczsa.xinghe.codegen.entity.enums.TemplateTypeEnum;
|
||||
import com.cczsa.xinghe.codegen.mapper.FunOperationMapper;
|
||||
import com.cczsa.xinghe.codegen.mapper.def.FunItemDef;
|
||||
import com.cczsa.xinghe.codegen.mapper.def.FunOperationDef;
|
||||
import com.cczsa.xinghe.codegen.service.TemplateService;
|
||||
import com.mybatisflex.core.query.QueryWrapper;
|
||||
import com.yomahub.liteflow.annotation.LiteflowComponent;
|
||||
import com.yomahub.liteflow.core.NodeComponent;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.stringtemplate.v4.ST;
|
||||
import org.stringtemplate.v4.STGroup;
|
||||
import org.stringtemplate.v4.STGroupString;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.zip.ZipEntry;
|
||||
import java.util.zip.ZipOutputStream;
|
||||
|
||||
/**
|
||||
* 角色 套餐权限相关数据生成
|
||||
* @author xia
|
||||
* @date 2026/1/23
|
||||
* @version 0.0.1
|
||||
*/
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
@LiteflowComponent(id = "roleDataInfo", name = "角色 套餐权限相关数据生成")
|
||||
public class RoleDataInfo extends NodeComponent {
|
||||
|
||||
private final FunOperationMapper funOperationMapper;
|
||||
private final TemplateService templateService;
|
||||
|
||||
// 压缩流
|
||||
private ZipOutputStream zos;
|
||||
|
||||
|
||||
@Override
|
||||
public void process() throws Exception {
|
||||
// 获取 模版
|
||||
String template = templateService.getTemplateTypeContent(TemplateTypeEnum.ROLE_DATA_INFO);
|
||||
if (template == null){
|
||||
return;
|
||||
}
|
||||
// 流
|
||||
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
|
||||
zos = new ZipOutputStream(outputStream);
|
||||
|
||||
|
||||
// 平台角色
|
||||
STGroup group = new STGroupString("dbXml",template, '$', '$');
|
||||
|
||||
|
||||
// 功能数据生成
|
||||
FunOperationDef funOperationDef = FunOperationDef.FUN_OPERATION_ENTITY.as("o");
|
||||
FunItemDef funItemDef = FunItemDef.FUN_ITEM_ENTITY.as("i");
|
||||
QueryWrapper wrapper = QueryWrapper.create()
|
||||
.select(funOperationDef.ALL_COLUMNS)
|
||||
.from(funItemDef)
|
||||
.leftJoin(funOperationDef).on(funOperationDef.ITEM_ID.eq(funItemDef.ID))
|
||||
.where(funItemDef.IS_TENANT.eq(false))
|
||||
.and(funOperationDef.IS_GREEN_LIGHT.eq(false));
|
||||
List<FunOperationEntity> funOperationEntities = funOperationMapper.selectListByQuery(wrapper);
|
||||
|
||||
funOperationEntities.sort(Comparator.comparing(FunOperationEntity::getId));
|
||||
// 循环 ClientTypeEnum
|
||||
for (ClientTypeEnum clientTypeEnum : ClientTypeEnum.values()) {
|
||||
// 平台角色 功能权限
|
||||
ST roleBindFunTemplate = group.getInstanceOf("roleBindFunTemplate"); // 使用正确的模板名称
|
||||
roleBindFunTemplate.add("operations",funOperationEntities);
|
||||
roleBindFunTemplate.add("clientTypeCode",clientTypeEnum.getCode());
|
||||
roleBindFunTemplate.add("clientTypeDesc",clientTypeEnum.getDesc());
|
||||
writeCodeToZip(roleBindFunTemplate,"roleBindFun-"+clientTypeEnum.getDesc());
|
||||
}
|
||||
|
||||
|
||||
QueryWrapper wrapper2 = QueryWrapper.create()
|
||||
.select(funOperationDef.ALL_COLUMNS)
|
||||
.from(funItemDef)
|
||||
.leftJoin(funOperationDef).on(funOperationDef.ITEM_ID.eq(funItemDef.ID))
|
||||
.where(funItemDef.IS_TENANT.eq(true))
|
||||
.and(funOperationDef.IS_GREEN_LIGHT.eq(false));
|
||||
List<FunOperationEntity> mealsFun = funOperationMapper.selectListByQuery(wrapper2);
|
||||
mealsFun.sort(Comparator.comparing(FunOperationEntity::getId));
|
||||
// 功能数据生成
|
||||
for (ClientTypeEnum clientTypeEnum : ClientTypeEnum.values()) {
|
||||
// 平台套餐 功能权限
|
||||
ST mealBindFunTemplate = group.getInstanceOf("mealBindFunTemplate"); // 使用正确的模板名称
|
||||
mealBindFunTemplate.add("meals",mealsFun);
|
||||
mealBindFunTemplate.add("clientTypeCode",clientTypeEnum.getCode());
|
||||
mealBindFunTemplate.add("clientTypeDesc",clientTypeEnum.getDesc());
|
||||
writeCodeToZip(mealBindFunTemplate,"mealBindFun-"+clientTypeEnum.getDesc());
|
||||
}
|
||||
|
||||
|
||||
// 确保 ZIP 流结束
|
||||
zos.finish();
|
||||
// 返回数据
|
||||
this.getSlot().setResponseData(outputStream.toByteArray());
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void writeCodeToZip(ST st,String fileName) throws IOException {
|
||||
// 生成代码
|
||||
String result = st.render();
|
||||
// insert-ms-fun-operation-data.xml
|
||||
ZipEntry entry = new ZipEntry("insert-"+ fileName +"-data.xml");
|
||||
zos.putNextEntry(entry);
|
||||
zos.write(result.getBytes(StandardCharsets.UTF_8));
|
||||
zos.closeEntry();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.cczsa.xinghe.codegen.service.impl;
|
||||
|
||||
import com.cczsa.xinghe.codegen.entity.FunItemEntity;
|
||||
import com.cczsa.xinghe.codegen.entity.FunModuleEntity;
|
||||
import com.cczsa.xinghe.codegen.entity.domain.template.CodeGen;
|
||||
import com.cczsa.xinghe.codegen.entity.domain.template.CodeGenType;
|
||||
import com.cczsa.xinghe.codegen.mapper.FunItemMapper;
|
||||
@@ -43,21 +42,11 @@ public class CodeGenServiceImpl implements CodeGenService {
|
||||
id = req.getItemId();
|
||||
}
|
||||
|
||||
if(req.getCodeGenType() == CodeGenType.MODULE_DATA_INFO){
|
||||
FunModuleEntity funModuleEntity = funModuleMapper.selectOneById(req.getModuleId());
|
||||
if (funModuleEntity == null) {
|
||||
return null;
|
||||
}
|
||||
id = req.getModuleId();
|
||||
}
|
||||
|
||||
if(id != null){
|
||||
LiteflowResponse response = flowExecutor.execute2Resp(req.getCodeGenType().getDesc(),null,id);
|
||||
log.info("执行结果:{}",response);
|
||||
if (response.isSuccess()) {
|
||||
return (byte[]) response.getSlot().getResponseData();
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.cczsa.xinghe.codegen.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.cczsa.xinghe.codegen.constant.CodegenConstant;
|
||||
import com.cczsa.xinghe.codegen.entity.FunItemEntity;
|
||||
import com.cczsa.xinghe.codegen.entity.FunModuleEntity;
|
||||
@@ -15,7 +16,6 @@ import com.cczsa.xinghe.codegen.mapper.def.FunItemDef;
|
||||
import com.cczsa.xinghe.codegen.mapper.def.FunModuleDef;
|
||||
import com.cczsa.xinghe.codegen.service.FunItemService;
|
||||
import com.cczsa.xinghe.codegen.util.XResult;
|
||||
import com.github.xiaoymin.knife4j.core.util.StrUtil;
|
||||
import com.mybatisflex.core.query.QueryWrapper;
|
||||
import com.mybatisflex.core.util.ObjectUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -51,6 +51,7 @@ public class FunItemServiceImpl implements FunItemService {
|
||||
.from(funItemDef)
|
||||
.join(funModuleDef).on(funItemDef.MODULE_ID.eq(funModuleDef.ID))
|
||||
.eq(FunItemEntity::getModuleId, req.getModuleId(), ObjectUtil.areNotNull(req.getModuleId()))
|
||||
.eq(FunItemEntity::getIsTenant, req.getIsTenant(), ObjectUtil.areNotNull(req.getIsTenant()))
|
||||
.like(FunItemEntity::getItemName, req.getItemName(), StrUtil.isNotBlank(req.getItemName()))
|
||||
.like(FunItemEntity::getItemCode, req.getItemCode(), StrUtil.isNotBlank(req.getItemCode()))
|
||||
.orderBy(FunItemEntity::getSortOrder, false);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.cczsa.xinghe.codegen.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.cczsa.xinghe.codegen.constant.CodegenConstant;
|
||||
import com.cczsa.xinghe.codegen.entity.FunItemEntity;
|
||||
import com.cczsa.xinghe.codegen.entity.FunModuleEntity;
|
||||
@@ -18,7 +19,6 @@ import com.cczsa.xinghe.codegen.mapper.def.FunModuleDef;
|
||||
import com.cczsa.xinghe.codegen.mapper.def.FunOperationDef;
|
||||
import com.cczsa.xinghe.codegen.service.FunModuleService;
|
||||
import com.cczsa.xinghe.codegen.util.XResult;
|
||||
import com.github.xiaoymin.knife4j.core.util.StrUtil;
|
||||
import com.mybatisflex.core.query.QueryWrapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.cczsa.xinghe.codegen.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.cczsa.xinghe.codegen.entity.FunItemEntity;
|
||||
import com.cczsa.xinghe.codegen.entity.FunModuleEntity;
|
||||
import com.cczsa.xinghe.codegen.entity.FunOperationEntity;
|
||||
@@ -16,7 +17,6 @@ import com.cczsa.xinghe.codegen.mapper.def.FunModuleDef;
|
||||
import com.cczsa.xinghe.codegen.mapper.def.FunOperationDef;
|
||||
import com.cczsa.xinghe.codegen.service.FunOperationService;
|
||||
import com.cczsa.xinghe.codegen.util.XResult;
|
||||
import com.github.xiaoymin.knife4j.core.util.StrUtil;
|
||||
import com.mybatisflex.core.query.QueryWrapper;
|
||||
import com.mybatisflex.core.util.CollectionUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.cczsa.xinghe.codegen.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.cczsa.xinghe.codegen.entity.FunItemEntity;
|
||||
import com.cczsa.xinghe.codegen.entity.FunOperationEntity;
|
||||
import com.cczsa.xinghe.codegen.entity.MenuEntity;
|
||||
@@ -11,11 +12,12 @@ import com.cczsa.xinghe.codegen.entity.res.menu.MenuQueryRes;
|
||||
import com.cczsa.xinghe.codegen.mapper.FunItemMapper;
|
||||
import com.cczsa.xinghe.codegen.mapper.FunOperationMapper;
|
||||
import com.cczsa.xinghe.codegen.mapper.MenuMapper;
|
||||
import com.cczsa.xinghe.codegen.mapper.RoleFunMapper;
|
||||
import com.cczsa.xinghe.codegen.mapper.def.FunOperationDef;
|
||||
import com.cczsa.xinghe.codegen.mapper.def.MenuDef;
|
||||
import com.cczsa.xinghe.codegen.mapper.def.RoleFunDef;
|
||||
import com.cczsa.xinghe.codegen.service.MenuService;
|
||||
import com.cczsa.xinghe.codegen.util.XResult;
|
||||
import com.github.xiaoymin.knife4j.core.util.StrUtil;
|
||||
import com.mybatisflex.core.query.QueryWrapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
@@ -40,6 +42,7 @@ public class MenuServiceImpl implements MenuService {
|
||||
private final MenuMapper menuMapper;
|
||||
private final FunOperationMapper funOperationMapper;
|
||||
private final FunItemMapper funItemMapper;
|
||||
private final RoleFunMapper roleFunMapper;
|
||||
|
||||
|
||||
/**
|
||||
@@ -146,6 +149,7 @@ public class MenuServiceImpl implements MenuService {
|
||||
query.select(menuDef.ID)
|
||||
.from(menuDef)
|
||||
.eq(MenuEntity::getParentId, req.getParentId())
|
||||
.eq(MenuEntity::getClientType, req.getClientType())
|
||||
.eq(MenuEntity::getMenuName, req.getMenuName());
|
||||
long count = menuMapper.selectCountByQuery(query);
|
||||
if (count > 0) {
|
||||
@@ -198,9 +202,20 @@ public class MenuServiceImpl implements MenuService {
|
||||
if (count > 0) {
|
||||
return XResult.failed("请先删除子菜单");
|
||||
}
|
||||
QueryWrapper deleteMenu = new QueryWrapper();
|
||||
deleteMenu.eq(MenuEntity::getId, id);
|
||||
menuMapper.deleteByQuery(deleteMenu);
|
||||
// 获取菜单
|
||||
MenuEntity menuEntity = menuMapper.selectOneById(id);
|
||||
// 删除配置的角色
|
||||
if (menuEntity != null && menuEntity.getFunId() != null){
|
||||
// 删除角色的权限
|
||||
RoleFunDef roleFunDef = RoleFunDef.ROLE_FUN_ENTITY;
|
||||
QueryWrapper deleteRoleFun = new QueryWrapper();
|
||||
deleteRoleFun.from(roleFunDef);
|
||||
deleteRoleFun.where(roleFunDef.CLIENT_TYPE.eq(menuEntity.getClientType()));
|
||||
deleteRoleFun.and(roleFunDef.FUN_ID.eq(menuEntity.getFunId()));
|
||||
roleFunMapper.deleteByQuery(deleteRoleFun);
|
||||
}
|
||||
// 删除菜单
|
||||
menuMapper.deleteById(id);
|
||||
return XResult.ok();
|
||||
}
|
||||
|
||||
@@ -211,9 +226,7 @@ public class MenuServiceImpl implements MenuService {
|
||||
@Override
|
||||
public XResult<Void> bindFun(MenuBindFunReq req) {
|
||||
// 获取菜单
|
||||
QueryWrapper queryMenu = new QueryWrapper();
|
||||
queryMenu.eq(MenuEntity::getId, req.getMenuId());
|
||||
MenuEntity menuEntity = menuMapper.selectOneByQuery(queryMenu);
|
||||
MenuEntity menuEntity = menuMapper.selectOneById(req.getMenuId());
|
||||
if (menuEntity == null) {
|
||||
return XResult.failed("菜单不存在");
|
||||
}
|
||||
@@ -237,23 +250,47 @@ public class MenuServiceImpl implements MenuService {
|
||||
}
|
||||
menuEntity.setFunId(req.getFunId());
|
||||
menuMapper.update(menuEntity);
|
||||
|
||||
// 删除配置的角色操作权限
|
||||
RoleFunDef roleFunDef = RoleFunDef.ROLE_FUN_ENTITY;
|
||||
QueryWrapper wrapper = new QueryWrapper();
|
||||
wrapper.from(roleFunDef);
|
||||
wrapper.where(roleFunDef.CLIENT_TYPE.eq(menuEntity.getClientType()));
|
||||
wrapper.and(roleFunDef.FUN_ID.eq(req.getFunId()));
|
||||
|
||||
return XResult.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除菜单权限
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public XResult<Void> deleteFun(Long menuId) {
|
||||
// 获取菜单
|
||||
QueryWrapper queryMenu = new QueryWrapper();
|
||||
queryMenu.eq(MenuEntity::getId, menuId);
|
||||
MenuEntity menuEntity = menuMapper.selectOneByQuery(queryMenu);
|
||||
|
||||
if (menuEntity == null) {
|
||||
return XResult.failed("菜单不存在");
|
||||
}
|
||||
Long funId = menuEntity.getFunId();
|
||||
if (funId == null) {
|
||||
return XResult.failed("菜单未绑定权限");
|
||||
}
|
||||
|
||||
menuEntity.setFunId(null);
|
||||
menuMapper.update(menuEntity, false);
|
||||
|
||||
// 删除配置的 角色绑定操作权限
|
||||
RoleFunDef roleFunDef = RoleFunDef.ROLE_FUN_ENTITY;
|
||||
QueryWrapper wrapper = new QueryWrapper();
|
||||
wrapper.from(roleFunDef);
|
||||
wrapper.where(roleFunDef.CLIENT_TYPE.eq(menuEntity.getClientType()));
|
||||
wrapper.and(roleFunDef.FUN_ID.eq(funId));
|
||||
|
||||
roleFunMapper.deleteByQuery(wrapper);
|
||||
return XResult.ok();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
package com.cczsa.xinghe.codegen.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.cczsa.xinghe.codegen.entity.FunOperationEntity;
|
||||
import com.cczsa.xinghe.codegen.entity.MenuEntity;
|
||||
import com.cczsa.xinghe.codegen.entity.RoleEntity;
|
||||
import com.cczsa.xinghe.codegen.entity.RoleFunEntity;
|
||||
import com.cczsa.xinghe.codegen.entity.enums.RoleTypeEnum;
|
||||
import com.cczsa.xinghe.codegen.entity.enums.UsableConfigEnum;
|
||||
import com.cczsa.xinghe.codegen.entity.req.role.RoleAddReq;
|
||||
import com.cczsa.xinghe.codegen.entity.req.role.RoleBindFunReq;
|
||||
@@ -22,7 +24,6 @@ import com.cczsa.xinghe.codegen.mapper.def.RoleDef;
|
||||
import com.cczsa.xinghe.codegen.mapper.def.RoleFunDef;
|
||||
import com.cczsa.xinghe.codegen.service.RoleService;
|
||||
import com.cczsa.xinghe.codegen.util.XResult;
|
||||
import com.github.xiaoymin.knife4j.core.util.StrUtil;
|
||||
import com.mybatisflex.core.query.QueryWrapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
@@ -212,6 +213,14 @@ public class RoleServiceImpl implements RoleService {
|
||||
*/
|
||||
@Override
|
||||
public XResult<List<RoleQueryFunRes>> queryRoleFun(RoleQueryFunReq req) {
|
||||
// 获取角色
|
||||
RoleEntity roleEntity = roleMapper.selectOneById(req.getRoleId());
|
||||
if (roleEntity == null) {
|
||||
return XResult.failed("角色不存在");
|
||||
}
|
||||
RoleTypeEnum roleType = roleEntity.getRoleType();
|
||||
boolean isTenant = roleType == RoleTypeEnum.PACKAGE;
|
||||
|
||||
// 获取菜单
|
||||
MenuDef menuDef = MenuDef.MENU_ENTITY;
|
||||
FunOperationDef funOperationDef = FunOperationDef.FUN_OPERATION_ENTITY;
|
||||
@@ -228,6 +237,7 @@ public class RoleServiceImpl implements RoleService {
|
||||
.from(menuDef)
|
||||
.leftJoin(funOperationDef).on(menuDef.FUN_ID.eq(funOperationDef.ID))
|
||||
.eq(MenuEntity::getClientType, req.getClientType())
|
||||
.eq(MenuEntity::getIsTenant, isTenant)
|
||||
.orderBy(MenuEntity::getSortOrder, false);
|
||||
List<RoleQueryFunRes> roleQueryFunList = menuMapper.selectListByQueryAs(queryMenu, RoleQueryFunRes.class);
|
||||
// 获取角色功能权限
|
||||
@@ -239,6 +249,10 @@ public class RoleServiceImpl implements RoleService {
|
||||
.eq(RoleFunEntity::getRoleId, req.getRoleId());
|
||||
List<RoleFunEntity> roleFunEntities = roleFunMapper.selectListByQuery(queryRoleFun);
|
||||
for (RoleQueryFunRes roleQueryFunRes : roleQueryFunList) {
|
||||
if(isTenant){
|
||||
roleQueryFunRes.setUsableConfig(new ArrayList<>());
|
||||
roleQueryFunRes.setFieldConfig(new ArrayList<>());
|
||||
}
|
||||
// 获取菜单功能
|
||||
RoleFunEntity roleFunEntity = roleFunEntities.stream()
|
||||
.filter(entity -> entity.getFunId().equals(roleQueryFunRes.getFunId()))
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.cczsa.xinghe.codegen.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.cczsa.xinghe.codegen.entity.TemplateEntity;
|
||||
import com.cczsa.xinghe.codegen.entity.enums.TemplateTypeEnum;
|
||||
import com.cczsa.xinghe.codegen.entity.req.template.TemplateAddReq;
|
||||
@@ -10,7 +11,6 @@ import com.cczsa.xinghe.codegen.mapper.TemplateMapper;
|
||||
import com.cczsa.xinghe.codegen.mapper.def.TemplateDef;
|
||||
import com.cczsa.xinghe.codegen.service.TemplateService;
|
||||
import com.cczsa.xinghe.codegen.util.XResult;
|
||||
import com.github.xiaoymin.knife4j.core.util.StrUtil;
|
||||
import com.mybatisflex.core.query.QueryWrapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
spring:
|
||||
# 使用不同模块的数据库配置
|
||||
profiles:
|
||||
active: dev
|
||||
active: pro
|
||||
@@ -10,4 +10,15 @@
|
||||
THEN(moduleDataInfo);
|
||||
</chain>
|
||||
|
||||
<!-- 主流程:角色 套餐权限 -->
|
||||
<chain name="role_permission">
|
||||
THEN(roleDataInfo);
|
||||
</chain>
|
||||
|
||||
|
||||
<!-- 主流程:角色 套餐权限 -->
|
||||
<chain name="menu_data_info">
|
||||
THEN(menuDataInfo);
|
||||
</chain>
|
||||
|
||||
</flow>
|
||||
@@ -6,10 +6,10 @@
|
||||
<link rel="icon" href="/favicon.ico" />
|
||||
<link rel="stylesheet" href="/app-loading.css" />
|
||||
<title>功能管理</title>
|
||||
<script type="module" crossorigin src="/static/index-380a124d.js"></script>
|
||||
<script type="module" crossorigin src="/static/index-e2eede5f.js"></script>
|
||||
<link rel="modulepreload" crossorigin href="/static/vue-5ea6dbbd.js">
|
||||
<link rel="modulepreload" crossorigin href="/static/element-a57cc571.js">
|
||||
<link rel="modulepreload" crossorigin href="/static/vxe-830e4310.js">
|
||||
<link rel="modulepreload" crossorigin href="/static/element-9324df56.js">
|
||||
<link rel="modulepreload" crossorigin href="/static/vxe-5e0bd050.js">
|
||||
<link rel="stylesheet" href="/static/index-213f7bee.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
import{_}from"./index-380a124d.js";import{ag as e,l as n,m as c,p as d,H as l,U as t,O as o,S as p}from"./vue-5ea6dbbd.js";const u={},i={class:"error-page"},f={class:"error-page-svg"};function m(r,g){const a=e("el-button"),s=e("router-link");return n(),c("div",i,[d("div",f,[l(r.$slots,"default",{},void 0,!0)]),t(s,{to:"/"},{default:o(()=>[t(a,{type:"primary"},{default:o(()=>[p("回到首页")]),_:1})]),_:1})])}const x=_(u,[["render",m],["__scopeId","data-v-2fba9562"]]);export{x as E};
|
||||
import{_}from"./index-e2eede5f.js";import{ag as e,l as n,m as c,p as d,H as l,U as t,O as o,S as p}from"./vue-5ea6dbbd.js";const u={},i={class:"error-page"},f={class:"error-page-svg"};function m(r,g){const a=e("el-button"),s=e("router-link");return n(),c("div",i,[d("div",f,[l(r.$slots,"default",{},void 0,!0)]),t(s,{to:"/"},{default:o(()=>[t(a,{type:"primary"},{default:o(()=>[p("回到首页")]),_:1})]),_:1})])}const x=_(u,[["render",m],["__scopeId","data-v-2fba9562"]]);export{x as E};
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
.app-container[data-v-3401b7f6]{padding:20px}.role-info[data-v-3401b7f6]{margin-bottom:20px;display:flex;justify-content:space-between;align-items:center}.role-info h2[data-v-3401b7f6]{margin:0}.permission-wrapper[data-v-3401b7f6]{display:flex;gap:20px;margin-bottom:30px}.menu-tree[data-v-3401b7f6]{width:30%;border-right:1px solid #ebeef5;padding-right:20px}.menu-tree h3[data-v-3401b7f6]{margin:0 0 15px;font-size:16px;font-weight:600}.menu-tree .tree-node[data-v-3401b7f6]{display:flex;align-items:center;gap:5px}.menu-tree .tree-node.is-active[data-v-3401b7f6]{color:#67c23a;font-weight:600}.menu-tree .tree-node .node-icon[data-v-3401b7f6]{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;font-size:16px;color:#909399}.menu-tree .tree-node .el-icon[data-v-3401b7f6]{color:#67c23a}.menu-tree .tree-node .node-badge[data-v-3401b7f6]{margin-left:4px}.menu-tree .tree-node .node-badge[data-v-3401b7f6] .el-badge__content{transform:translateY(-50%) translate(0);right:-10px}.permission-config[data-v-3401b7f6]{width:70%}.permission-config h3[data-v-3401b7f6]{margin:0 0 15px;font-size:16px;font-weight:600}.fun-permission[data-v-3401b7f6]{margin-bottom:30px}.fun-permission .menu-title[data-v-3401b7f6]{margin-bottom:15px;font-weight:600;color:#409eff}.fun-permission .menu-title .menu-title-header[data-v-3401b7f6]{display:flex;align-items:center;gap:8px;margin-bottom:10px}.fun-permission .menu-title .menu-info-tags[data-v-3401b7f6]{display:flex;flex-wrap:wrap;gap:8px}.fun-permission .fun-item[data-v-3401b7f6]{padding:15px;background-color:#f5f7fa;border-radius:4px;display:flex;flex-direction:column;align-items:flex-start;gap:10px}.fun-permission .switch-with-text[data-v-3401b7f6]{display:flex;align-items:center;gap:8px}.fun-permission .switch-label[data-v-3401b7f6]{font-size:14px;color:#606266}.fun-permission .empty-tip[data-v-3401b7f6]{text-align:center;padding:30px;color:#909399;background-color:#f5f7fa;border-radius:4px}.data-permission[data-v-3401b7f6]{background-color:#f5f7fa;padding:15px;border-radius:4px}.data-permission .el-form-item[data-v-3401b7f6]{margin-bottom:20px}.operation-buttons[data-v-3401b7f6]{display:flex;justify-content:flex-end;gap:10px;margin-top:20px}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +0,0 @@
|
||||
.app-container[data-v-23d40a43]{padding:20px}.role-info[data-v-23d40a43]{margin-bottom:20px;display:flex;justify-content:space-between;align-items:center}.role-info h2[data-v-23d40a43]{margin:0}.permission-wrapper[data-v-23d40a43]{display:flex;gap:20px;margin-bottom:30px}.menu-tree[data-v-23d40a43]{width:30%;border-right:1px solid #ebeef5;padding-right:20px}.menu-tree h3[data-v-23d40a43]{margin:0 0 15px;font-size:16px;font-weight:600}.menu-tree .tree-node[data-v-23d40a43]{display:flex;align-items:center;gap:5px}.menu-tree .tree-node.is-active[data-v-23d40a43]{color:#67c23a;font-weight:600}.menu-tree .tree-node .el-icon[data-v-23d40a43]{color:#67c23a}.permission-config[data-v-23d40a43]{width:70%}.permission-config h3[data-v-23d40a43]{margin:0 0 15px;font-size:16px;font-weight:600}.fun-permission[data-v-23d40a43]{margin-bottom:30px}.fun-permission .menu-title[data-v-23d40a43]{margin-bottom:15px;font-weight:600;color:#409eff}.fun-permission .menu-title .menu-title-header[data-v-23d40a43]{display:flex;align-items:center;gap:8px;margin-bottom:10px}.fun-permission .menu-title .menu-info-tags[data-v-23d40a43]{display:flex;flex-wrap:wrap;gap:8px}.fun-permission .fun-item[data-v-23d40a43]{padding:15px;background-color:#f5f7fa;border-radius:4px;display:flex;flex-direction:column;align-items:flex-start;gap:10px}.fun-permission .switch-with-text[data-v-23d40a43]{display:flex;align-items:center;gap:8px}.fun-permission .switch-label[data-v-23d40a43]{font-size:14px;color:#606266}.fun-permission .empty-tip[data-v-23d40a43]{text-align:center;padding:30px;color:#909399;background-color:#f5f7fa;border-radius:4px}.data-permission[data-v-23d40a43]{background-color:#f5f7fa;padding:15px;border-radius:4px}.data-permission .el-form-item[data-v-23d40a43]{margin-bottom:20px}.operation-buttons[data-v-23d40a43]{display:flex;justify-content:flex-end;gap:10px;margin-top:20px}
|
||||
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
import{h as O}from"./index-e628964d.js";import{B as P,E as g,C as A}from"./element-a57cc571.js";import{G as _,r as b,e as m,d as i,b as h,l as v,M as I,O as y,m as C,a7 as S,F as D,u as T}from"./vue-5ea6dbbd.js";const U=_({__name:"index",props:{idType:{},moduleId:{},itemId:{},modelValue:{},placeholder:{default:"请选择ID"},disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0},originalId:{}},emits:["update:modelValue","change","clear"],setup(a,{emit:t}){const e=a,n=b(!1),o=b([]),E=m(()=>{let l=[...o.value];return e.originalId!==void 0&&!l.includes(e.originalId)&&(l=[e.originalId,...l].sort((u,d)=>u-d)),l.map(u=>({label:u.toString(),value:u}))}),c=m({get:()=>e.modelValue,set:l=>t("update:modelValue",l)}),s=()=>e.idType===0?!0:e.idType===1?e.moduleId===void 0||e.moduleId===null||e.moduleId===0?(console.warn("获取功能ID列表失败: moduleId 为必传参数"),!1):!0:e.idType===2?e.moduleId===void 0||e.moduleId===null||e.moduleId===0?(console.warn("获取操作ID列表失败: moduleId 为必传参数"),!1):e.itemId===void 0||e.itemId===null||e.itemId===0?(console.warn("获取操作ID列表失败: itemId 为必传参数"),!1):!0:(console.warn(`未知的 idType: ${e.idType}`),!1),r=async()=>{if(!s()){o.value=[];return}try{n.value=!0;const l=await O({idType:e.idType,moduleId:e.moduleId,itemId:e.itemId});o.value=l.data||[]}catch(l){console.error("获取ID列表失败:",l),g.error("获取ID列表失败"),o.value=[]}finally{n.value=!1}};i(()=>e.idType,()=>{r()}),i(()=>e.moduleId,()=>{(e.idType===1||e.idType===2)&&(s()?r():o.value=[])}),i(()=>e.itemId,()=>{e.idType===2&&(s()?r():o.value=[])});const f=l=>{t("change",l)},p=()=>{t("clear")};return h(()=>{r()}),(l,u)=>(v(),I(T(P),{modelValue:c.value,"onUpdate:modelValue":u[0]||(u[0]=d=>c.value=d),placeholder:l.placeholder,disabled:l.disabled,clearable:l.clearable,loading:n.value,onChange:f,onClear:p},{default:y(()=>[(v(!0),C(D,null,S(E.value,d=>(v(),I(T(A),{key:d.value,label:d.label,value:d.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder","disabled","clearable","loading"]))}});var N=(a=>(a[a.MODULE=0]="MODULE",a[a.ITEM=1]="ITEM",a[a.OPERATION=2]="OPERATION",a))(N||{});const B=[{label:"新增",value:0},{label:"删除",value:1},{label:"修改",value:2},{label:"查询",value:3},{label:"上传",value:4},{label:"下载",value:5},{label:"导入",value:6},{label:"导出",value:7},{label:"打印",value:8},{label:"注册",value:9},{label:"登录",value:10},{label:"登出",value:11},{label:"短信",value:12},{label:"邮件",value:13},{label:"微信",value:14},{label:"其它",value:99}],V={0:"新增",1:"删除",2:"修改",3:"查询",4:"上传",5:"下载",6:"导入",7:"导出",8:"打印",9:"注册",10:"登录",11:"登出",12:"短信",13:"邮件",14:"微信",99:"其它"},w=[{label:"GET",value:0},{label:"HEAD",value:1},{label:"POST",value:2},{label:"PUT",value:3},{label:"PATCH",value:4},{label:"DELETE",value:5},{label:"OPTIONS",value:6},{label:"TRACE",value:7}],G={0:"GET",1:"HEAD",2:"POST",3:"PUT",4:"PATCH",5:"DELETE",6:"OPTIONS",7:"TRACE"},k=[{label:"所有",value:1},{label:"本人",value:2},{label:"本部门",value:3},{label:"本部门及子部门",value:4},{label:"指定部门",value:5},{label:"指定人员",value:6}],F={1:"所有",2:"本人",3:"本部门",4:"本部门及子部门",5:"指定部门",6:"指定人员"};export{N as I,V as O,G as R,k as U,U as _,B as a,w as b,F as c};
|
||||
import{h as O}from"./index-bfe0dfe9.js";import{B as P,E as g,C as A}from"./element-9324df56.js";import{G as _,r as b,e as m,d as i,b as h,l as v,M as I,O as y,m as C,a7 as S,F as D,u as T}from"./vue-5ea6dbbd.js";const U=_({__name:"index",props:{idType:{},moduleId:{},itemId:{},modelValue:{},placeholder:{default:"请选择ID"},disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0},originalId:{}},emits:["update:modelValue","change","clear"],setup(a,{emit:t}){const e=a,n=b(!1),o=b([]),E=m(()=>{let l=[...o.value];return e.originalId!==void 0&&!l.includes(e.originalId)&&(l=[e.originalId,...l].sort((u,d)=>u-d)),l.map(u=>({label:u.toString(),value:u}))}),c=m({get:()=>e.modelValue,set:l=>t("update:modelValue",l)}),s=()=>e.idType===0?!0:e.idType===1?e.moduleId===void 0||e.moduleId===null||e.moduleId===0?(console.warn("获取功能ID列表失败: moduleId 为必传参数"),!1):!0:e.idType===2?e.moduleId===void 0||e.moduleId===null||e.moduleId===0?(console.warn("获取操作ID列表失败: moduleId 为必传参数"),!1):e.itemId===void 0||e.itemId===null||e.itemId===0?(console.warn("获取操作ID列表失败: itemId 为必传参数"),!1):!0:(console.warn(`未知的 idType: ${e.idType}`),!1),r=async()=>{if(!s()){o.value=[];return}try{n.value=!0;const l=await O({idType:e.idType,moduleId:e.moduleId,itemId:e.itemId});o.value=l.data||[]}catch(l){console.error("获取ID列表失败:",l),g.error("获取ID列表失败"),o.value=[]}finally{n.value=!1}};i(()=>e.idType,()=>{r()}),i(()=>e.moduleId,()=>{(e.idType===1||e.idType===2)&&(s()?r():o.value=[])}),i(()=>e.itemId,()=>{e.idType===2&&(s()?r():o.value=[])});const f=l=>{t("change",l)},p=()=>{t("clear")};return h(()=>{r()}),(l,u)=>(v(),I(T(P),{modelValue:c.value,"onUpdate:modelValue":u[0]||(u[0]=d=>c.value=d),placeholder:l.placeholder,disabled:l.disabled,clearable:l.clearable,loading:n.value,onChange:f,onClear:p},{default:y(()=>[(v(!0),C(D,null,S(E.value,d=>(v(),I(T(A),{key:d.value,label:d.label,value:d.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder","disabled","clearable","loading"]))}});var N=(a=>(a[a.MODULE=0]="MODULE",a[a.ITEM=1]="ITEM",a[a.OPERATION=2]="OPERATION",a))(N||{});const B=[{label:"新增",value:0},{label:"删除",value:1},{label:"修改",value:2},{label:"查询",value:3},{label:"上传",value:4},{label:"下载",value:5},{label:"导入",value:6},{label:"导出",value:7},{label:"打印",value:8},{label:"注册",value:9},{label:"登录",value:10},{label:"登出",value:11},{label:"短信",value:12},{label:"邮件",value:13},{label:"微信",value:14},{label:"其它",value:99}],V={0:"新增",1:"删除",2:"修改",3:"查询",4:"上传",5:"下载",6:"导入",7:"导出",8:"打印",9:"注册",10:"登录",11:"登出",12:"短信",13:"邮件",14:"微信",99:"其它"},w=[{label:"GET",value:0},{label:"HEAD",value:1},{label:"POST",value:2},{label:"PUT",value:3},{label:"PATCH",value:4},{label:"DELETE",value:5},{label:"OPTIONS",value:6},{label:"TRACE",value:7}],G={0:"GET",1:"HEAD",2:"POST",3:"PUT",4:"PATCH",5:"DELETE",6:"OPTIONS",7:"TRACE"},k=[{label:"所有",value:1},{label:"本人",value:2},{label:"本部门",value:3},{label:"本部门及子部门",value:4},{label:"指定部门",value:5},{label:"指定人员",value:6}],F={1:"所有",2:"本人",3:"本部门",4:"本部门及子部门",5:"指定部门",6:"指定人员"};export{N as I,V as O,G as R,k as U,U as _,B as a,w as b,F as c};
|
||||
File diff suppressed because one or more lines are too long
1
src/main/resources/static/static/index-19213782.js
Normal file
1
src/main/resources/static/static/index-19213782.js
Normal file
File diff suppressed because one or more lines are too long
1
src/main/resources/static/static/index-1cca6468.css
Normal file
1
src/main/resources/static/static/index-1cca6468.css
Normal file
@@ -0,0 +1 @@
|
||||
.search-wrapper[data-v-25594890]{margin-bottom:20px}.search-wrapper[data-v-25594890] .el-card__body{padding-bottom:2px}.toolbar-wrapper[data-v-25594890]{display:flex;justify-content:space-between;margin-bottom:20px}.table-wrapper[data-v-25594890]{margin-bottom:20px}
|
||||
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
import{e}from"./index-380a124d.js";function r(o){return e({url:"/codegen/download",method:"post",data:o,responseType:"blob"})}export{r as c};
|
||||
import{e}from"./index-e2eede5f.js";function r(o){return e({url:"/codegen/download",method:"post",data:o,responseType:"blob"})}export{r as c};
|
||||
@@ -1 +0,0 @@
|
||||
.search-wrapper[data-v-ca91c9a5]{margin-bottom:20px}.search-wrapper[data-v-ca91c9a5] .el-card__body{padding-bottom:2px}.toolbar-wrapper[data-v-ca91c9a5]{display:flex;justify-content:space-between;margin-bottom:20px}.table-wrapper[data-v-ca91c9a5]{margin-bottom:20px}
|
||||
@@ -1 +1 @@
|
||||
import{e as t}from"./index-380a124d.js";function r(e){return t({url:"/role/query",method:"post",data:e})}function n(e){return t({url:"/role/add",method:"put",data:e})}function u(e){return t({url:"/role/edit",method:"post",data:e})}function l(e){return t({url:"/role/query/fun",method:"post",data:e})}function i(e){return t({url:"/role/bind/fun",method:"post",data:e})}function d(e){return t({url:`/role/delete/${e}`,method:"delete"})}function s(e){return t({url:`/role/delete/fun/${e}`,method:"delete"})}export{n as a,l as b,s as c,d,u as e,i as f,r as g};
|
||||
import{e as t}from"./index-e2eede5f.js";function r(e){return t({url:"/role/query",method:"post",data:e})}function n(e){return t({url:"/role/add",method:"put",data:e})}function u(e){return t({url:"/role/edit",method:"post",data:e})}function l(e){return t({url:"/role/query/fun",method:"post",data:e})}function i(e){return t({url:"/role/bind/fun",method:"post",data:e})}function d(e){return t({url:`/role/delete/${e}`,method:"delete"})}function s(e){return t({url:`/role/delete/fun/${e}`,method:"delete"})}export{n as a,l as b,s as c,d,u as e,i as f,r as g};
|
||||
File diff suppressed because one or more lines are too long
1
src/main/resources/static/static/index-62d613e6.css
Normal file
1
src/main/resources/static/static/index-62d613e6.css
Normal file
@@ -0,0 +1 @@
|
||||
.search-wrapper[data-v-f5ea3f90]{margin-bottom:20px}.search-wrapper[data-v-f5ea3f90] .el-card__body{padding-bottom:2px}.toolbar-wrapper[data-v-f5ea3f90]{display:flex;justify-content:space-between;margin-bottom:20px}.table-wrapper[data-v-f5ea3f90]{margin-bottom:20px}
|
||||
1
src/main/resources/static/static/index-9962b727.css
Normal file
1
src/main/resources/static/static/index-9962b727.css
Normal file
@@ -0,0 +1 @@
|
||||
@charset "UTF-8";.app-container[data-v-d0ce0224]{padding:20px;width:100%;max-width:100%;box-sizing:border-box;overflow-x:hidden}.search-wrapper[data-v-d0ce0224]{margin-bottom:20px}.toolbar-wrapper[data-v-d0ce0224]{display:grid;grid-template-columns:1fr auto;gap:15px;align-items:center;margin-bottom:20px;padding:15px;border:1px solid #ebeef5;border-radius:4px;background-color:#fff}.toolbar-left[data-v-d0ce0224]{display:flex;gap:10px}.toolbar-right[data-v-d0ce0224]{display:flex;align-items:center}.el-button--circle[data-v-d0ce0224]{display:flex!important;align-items:center!important;justify-content:center!important;width:36px!important;height:36px!important;padding:0!important;border-radius:50%!important;box-sizing:border-box!important}.el-button--circle .el-icon[data-v-d0ce0224]{font-size:18px!important;margin:0!important;padding:0!important;line-height:1!important}.refresh-button[data-v-d0ce0224]{display:flex!important;align-items:center!important;justify-content:center!important;width:36px!important;height:36px!important;padding:0!important;border-radius:50%!important;box-sizing:border-box!important;overflow:hidden!important}.search-wrapper[data-v-d0ce0224]{margin-bottom:15px}.table-wrapper[data-v-d0ce0224]{margin-bottom:20px}.empty-text[data-v-d0ce0224]{text-align:center;padding:20px;color:#999}.hint-text[data-v-d0ce0224]{color:#909399;margin-left:10px;font-size:14px}.bound-functions-header[data-v-d0ce0224]{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px}.pagination-wrapper[data-v-d0ce0224]{display:flex;justify-content:flex-end;margin-top:15px}@media (max-width: 768px){.refresh-button[data-v-d0ce0224]{width:32px!important;height:32px!important}.refresh-button .el-icon[data-v-d0ce0224]{font-size:16px!important}}.content-wrapper[data-v-d0ce0224]{display:flex;gap:20px;height:calc(100vh - 280px)}@media (max-width: 992px){.content-wrapper[data-v-d0ce0224]{flex-direction:column;height:auto}}.menu-tree-wrapper[data-v-d0ce0224]{flex:0 0 40%;overflow-y:auto;min-height:600px}@media (max-width: 992px){.menu-tree-wrapper[data-v-d0ce0224]{flex:0 0 auto;height:400px}}.menu-tree-wrapper .custom-tree-node[data-v-d0ce0224]{display:flex;align-items:center;gap:8px;padding:2px 0}.menu-tree-wrapper .custom-tree-node .node-icon[data-v-d0ce0224]{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;font-size:16px}.menu-tree-wrapper .custom-tree-node .node-name[data-v-d0ce0224]{flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.menu-tree-wrapper .el-tree-node__content[data-v-d0ce0224]{padding:4px 8px!important}.menu-tree-wrapper .el-tree-node__expand-icon[data-v-d0ce0224]{font-size:12px;margin-right:4px}.menu-detail-wrapper[data-v-d0ce0224]{flex:1;overflow-y:auto;padding:20px}.menu-detail-wrapper .section-title[data-v-d0ce0224]{font-size:16px;font-weight:700;margin:20px 0 15px;padding-left:5px;border-left:3px solid #409eff}.menu-detail-wrapper .action-buttons[data-v-d0ce0224]{display:flex;justify-content:flex-end;gap:10px;margin-top:30px;padding-top:20px;border-top:1px solid #ebeef5}.menu-detail-wrapper .empty-text[data-v-d0ce0224]{color:#909399;text-align:center;padding:20px}
|
||||
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
import{e as t}from"./index-380a124d.js";function n(e){return t({url:"/funModule/save/update",method:"post",data:e})}function o(e){return t({url:"/funModule/query",method:"post",data:e})}function s(e){return t({url:"/funModule/delete",method:"delete",data:e})}function d(e){return t({url:"/funItem/save/update",method:"post",data:e})}function a(e){return t({url:"/funItem/query",method:"post",data:e})}function l(e){return t({url:"/funItem/delete",method:"delete",data:e})}function f(e){return t({url:"/funOperation/save/update",method:"post",data:e})}function p(e){return t({url:"/funOperation/query",method:"post",data:e})}function i(e,u){return t({url:`/funOperation/query/${u}`,method:"post",data:e})}function m(e){return t({url:"/funOperation/delete",method:"delete",data:e})}function c(e){return t({url:"/funModule/getIdList",method:"post",data:e})}export{d as a,l as b,a as c,s as d,f as e,m as f,p as g,c as h,i,o as q,n as s};
|
||||
import{e as t}from"./index-e2eede5f.js";function n(e){return t({url:"/funModule/save/update",method:"post",data:e})}function o(e){return t({url:"/funModule/query",method:"post",data:e})}function s(e){return t({url:"/funModule/delete",method:"delete",data:e})}function d(e){return t({url:"/funItem/save/update",method:"post",data:e})}function a(e){return t({url:"/funItem/query",method:"post",data:e})}function l(e){return t({url:"/funItem/delete",method:"delete",data:e})}function f(e){return t({url:"/funOperation/save/update",method:"post",data:e})}function p(e){return t({url:"/funOperation/query",method:"post",data:e})}function i(e,u){return t({url:`/funOperation/query/${u}`,method:"post",data:e})}function m(e){return t({url:"/funOperation/delete",method:"delete",data:e})}function c(e){return t({url:"/funModule/getIdList",method:"post",data:e})}export{d as a,l as b,a as c,s as d,f as e,m as f,p as g,c as h,i,o as q,n as s};
|
||||
1
src/main/resources/static/static/index-c06e3abe.js
Normal file
1
src/main/resources/static/static/index-c06e3abe.js
Normal file
File diff suppressed because one or more lines are too long
@@ -1 +0,0 @@
|
||||
@charset "UTF-8";.app-container[data-v-7f921f63]{padding:20px;width:100%;max-width:100%;box-sizing:border-box;overflow-x:hidden}.search-wrapper[data-v-7f921f63]{margin-bottom:20px}.toolbar-wrapper[data-v-7f921f63]{display:grid;grid-template-columns:1fr auto;gap:15px;align-items:center;margin-bottom:20px;padding:15px;border:1px solid #ebeef5;border-radius:4px;background-color:#fff}.toolbar-left[data-v-7f921f63]{display:flex;gap:10px}.toolbar-right[data-v-7f921f63]{display:flex;align-items:center}.el-button--circle[data-v-7f921f63]{display:flex!important;align-items:center!important;justify-content:center!important;width:36px!important;height:36px!important;padding:0!important;border-radius:50%!important;box-sizing:border-box!important}.el-button--circle .el-icon[data-v-7f921f63]{font-size:18px!important;margin:0!important;padding:0!important;line-height:1!important}.refresh-button[data-v-7f921f63]{display:flex!important;align-items:center!important;justify-content:center!important;width:36px!important;height:36px!important;padding:0!important;border-radius:50%!important;box-sizing:border-box!important;overflow:hidden!important}.search-wrapper[data-v-7f921f63]{margin-bottom:15px}.table-wrapper[data-v-7f921f63]{margin-bottom:20px}.empty-text[data-v-7f921f63]{text-align:center;padding:20px;color:#999}.hint-text[data-v-7f921f63]{color:#909399;margin-left:10px;font-size:14px}.bound-functions-header[data-v-7f921f63]{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px}.pagination-wrapper[data-v-7f921f63]{display:flex;justify-content:flex-end;margin-top:15px}@media (max-width: 768px){.refresh-button[data-v-7f921f63]{width:32px!important;height:32px!important}.refresh-button .el-icon[data-v-7f921f63]{font-size:16px!important}}.content-wrapper[data-v-7f921f63]{display:flex;gap:20px;height:calc(100vh - 280px)}@media (max-width: 992px){.content-wrapper[data-v-7f921f63]{flex-direction:column;height:auto}}.menu-tree-wrapper[data-v-7f921f63]{flex:0 0 40%;overflow-y:auto;min-height:600px}@media (max-width: 992px){.menu-tree-wrapper[data-v-7f921f63]{flex:0 0 auto;height:400px}}.menu-tree-wrapper .custom-tree-node[data-v-7f921f63]{display:flex;align-items:center;gap:8px;padding:2px 0}.menu-tree-wrapper .custom-tree-node .node-icon[data-v-7f921f63]{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;font-size:16px}.menu-tree-wrapper .custom-tree-node .node-name[data-v-7f921f63]{flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.menu-tree-wrapper .el-tree-node__content[data-v-7f921f63]{padding:4px 8px!important}.menu-tree-wrapper .el-tree-node__expand-icon[data-v-7f921f63]{font-size:12px;margin-right:4px}.menu-detail-wrapper[data-v-7f921f63]{flex:1;overflow-y:auto;padding:20px}.menu-detail-wrapper .section-title[data-v-7f921f63]{font-size:16px;font-weight:700;margin:20px 0 15px;padding-left:5px;border-left:3px solid #409eff}.menu-detail-wrapper .action-buttons[data-v-7f921f63]{display:flex;justify-content:flex-end;gap:10px;margin-top:30px;padding-top:20px;border-top:1px solid #ebeef5}.menu-detail-wrapper .empty-text[data-v-7f921f63]{color:#909399;text-align:center;padding:20px}
|
||||
@@ -1 +1 @@
|
||||
import{G as y,aD as V,r as p,Z as k,ag as r,l as C,m as S,U as o,p as l,O as n,u as g,a2 as U,S as F,a8 as I,aG as R,aH as z}from"./vue-5ea6dbbd.js";import{c as B,_ as K}from"./index-380a124d.js";import{t as M,v as N}from"./element-a57cc571.js";import{_ as q}from"./index.vue_vue_type_script_setup_true_lang-cc3fa793.js";import"./vxe-830e4310.js";const D="/static/logo-text-2-eef467fb.png",G=t=>(R("data-v-db1658f3"),t=t(),z(),t),E={class:"login-container"},H={class:"login-card"},L=G(()=>l("div",{class:"title"},[l("img",{src:D})],-1)),O={class:"content"},T=y({__name:"index",setup(t){const v=V(),u=p(null),i=p(!1),x=p(""),e=k({username:"admin",password:"9527",code:""}),h={username:[{required:!0,message:"请输入用户名",trigger:"blur"}],password:[{required:!0,message:"请输入密码",trigger:"blur"},{min:4,max:16,message:"长度在 4 到 16 个字符",trigger:"blur"}]},m=()=>{var d;(d=u.value)==null||d.validate((s,a)=>{s?(i.value=!0,B().login(e).then(()=>{v.push({path:"/"})}).catch(()=>{_(),e.password=""}).finally(()=>{i.value=!1})):console.error("表单校验不通过",a)})},_=()=>{e.code="",x.value=""};return _(),(d,s)=>{const a=r("el-input"),f=r("el-form-item"),w=r("el-button"),b=r("el-form");return C(),S("div",E,[o(q,{class:"theme-switch"}),l("div",H,[L,l("div",O,[o(b,{ref_key:"loginFormRef",ref:u,model:e,rules:h,onKeyup:I(m,["enter"])},{default:n(()=>[o(f,{prop:"username"},{default:n(()=>[o(a,{modelValue:e.username,"onUpdate:modelValue":s[0]||(s[0]=c=>e.username=c),modelModifiers:{trim:!0},placeholder:"用户名",type:"text",tabindex:"1","prefix-icon":g(M),size:"large"},null,8,["modelValue","prefix-icon"])]),_:1}),o(f,{prop:"password"},{default:n(()=>[o(a,{modelValue:e.password,"onUpdate:modelValue":s[1]||(s[1]=c=>e.password=c),modelModifiers:{trim:!0},placeholder:"密码",type:"password",tabindex:"2","prefix-icon":g(N),size:"large","show-password":""},null,8,["modelValue","prefix-icon"])]),_:1}),o(w,{loading:i.value,type:"primary",size:"large",onClick:U(m,["prevent"])},{default:n(()=>[F("登 录")]),_:1},8,["loading","onClick"])]),_:1},8,["model","onKeyup"])])])])}}});const P=K(T,[["__scopeId","data-v-db1658f3"]]);export{P as default};
|
||||
import{G as y,aD as V,r as p,Z as k,ag as r,l as C,m as S,U as o,p as l,O as n,u as g,a2 as U,S as F,a8 as I,aG as R,aH as z}from"./vue-5ea6dbbd.js";import{c as B,_ as K}from"./index-e2eede5f.js";import{t as M,v as N}from"./element-9324df56.js";import{_ as q}from"./index.vue_vue_type_script_setup_true_lang-0a12c768.js";import"./vxe-5e0bd050.js";const D="/static/logo-text-2-eef467fb.png",G=t=>(R("data-v-db1658f3"),t=t(),z(),t),E={class:"login-container"},H={class:"login-card"},L=G(()=>l("div",{class:"title"},[l("img",{src:D})],-1)),O={class:"content"},T=y({__name:"index",setup(t){const v=V(),u=p(null),i=p(!1),x=p(""),e=k({username:"admin",password:"9527",code:""}),h={username:[{required:!0,message:"请输入用户名",trigger:"blur"}],password:[{required:!0,message:"请输入密码",trigger:"blur"},{min:4,max:16,message:"长度在 4 到 16 个字符",trigger:"blur"}]},m=()=>{var d;(d=u.value)==null||d.validate((s,a)=>{s?(i.value=!0,B().login(e).then(()=>{v.push({path:"/"})}).catch(()=>{_(),e.password=""}).finally(()=>{i.value=!1})):console.error("表单校验不通过",a)})},_=()=>{e.code="",x.value=""};return _(),(d,s)=>{const a=r("el-input"),f=r("el-form-item"),w=r("el-button"),b=r("el-form");return C(),S("div",E,[o(q,{class:"theme-switch"}),l("div",H,[L,l("div",O,[o(b,{ref_key:"loginFormRef",ref:u,model:e,rules:h,onKeyup:I(m,["enter"])},{default:n(()=>[o(f,{prop:"username"},{default:n(()=>[o(a,{modelValue:e.username,"onUpdate:modelValue":s[0]||(s[0]=c=>e.username=c),modelModifiers:{trim:!0},placeholder:"用户名",type:"text",tabindex:"1","prefix-icon":g(M),size:"large"},null,8,["modelValue","prefix-icon"])]),_:1}),o(f,{prop:"password"},{default:n(()=>[o(a,{modelValue:e.password,"onUpdate:modelValue":s[1]||(s[1]=c=>e.password=c),modelModifiers:{trim:!0},placeholder:"密码",type:"password",tabindex:"2","prefix-icon":g(N),size:"large","show-password":""},null,8,["modelValue","prefix-icon"])]),_:1}),o(w,{loading:i.value,type:"primary",size:"large",onClick:U(m,["prevent"])},{default:n(()=>[F("登 录")]),_:1},8,["loading","onClick"])]),_:1},8,["model","onKeyup"])])])])}}});const P=K(T,[["__scopeId","data-v-db1658f3"]]);export{P as default};
|
||||
@@ -1 +0,0 @@
|
||||
.search-wrapper[data-v-92adff16]{margin-bottom:20px}.search-wrapper[data-v-92adff16] .el-card__body{padding-bottom:2px}.toolbar-wrapper[data-v-92adff16]{display:flex;justify-content:space-between;margin-bottom:20px}.table-wrapper[data-v-92adff16]{margin-bottom:20px}
|
||||
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
import{_ as c,c as a}from"./index-380a124d.js";import{ag as s,l as n,m as _,U as r,G as i,M as d,Q as p,u as m}from"./vue-5ea6dbbd.js";import"./element-a57cc571.js";import"./vxe-830e4310.js";const l={},u={class:"app-container center"};function f(t,o){const e=s("el-empty");return n(),_("div",u,[r(e,{description:"Admin 权限可见"})])}const v=c(l,[["render",f],["__scopeId","data-v-540a7bcc"]]);const y={},x={class:"app-container center"};function h(t,o){const e=s("el-empty");return n(),_("div",x,[r(e,{description:"Editor 权限可见"})])}const b=c(y,[["render",h],["__scopeId","data-v-e677b768"]]),C=i({__name:"index",setup(t){const e=a().roles.includes("admin");return(A,E)=>(n(),d(p(m(e)?v:b)))}});export{C as default};
|
||||
import{_ as c,c as a}from"./index-e2eede5f.js";import{ag as s,l as n,m as _,U as r,G as i,M as d,Q as p,u as m}from"./vue-5ea6dbbd.js";import"./element-9324df56.js";import"./vxe-5e0bd050.js";const l={},u={class:"app-container center"};function f(t,o){const e=s("el-empty");return n(),_("div",u,[r(e,{description:"Admin 权限可见"})])}const v=c(l,[["render",f],["__scopeId","data-v-540a7bcc"]]);const y={},x={class:"app-container center"};function h(t,o){const e=s("el-empty");return n(),_("div",x,[r(e,{description:"Editor 权限可见"})])}const b=c(y,[["render",h],["__scopeId","data-v-e677b768"]]),C=i({__name:"index",setup(t){const e=a().roles.includes("admin");return(A,E)=>(n(),d(p(m(e)?v:b)))}});export{C as default};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
src/main/resources/static/static/index-ff1b2e54.js
Normal file
1
src/main/resources/static/static/index-ff1b2e54.js
Normal file
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
import{d as k}from"./index-380a124d.js";import{w as g}from"./element-a57cc571.js";import{G as C,ag as o,l,M as m,O as e,U as n,m as h,a7 as x,u as t,F as B,p as s,T}from"./vue-5ea6dbbd.js";const V=C({__name:"index",setup(b){const{themeList:d,activeThemeName:c,setTheme:r}=k();return(v,N)=>{const _=o("el-icon"),p=o("el-tooltip"),i=o("el-dropdown-item"),u=o("el-dropdown-menu"),f=o("el-dropdown");return l(),m(f,{trigger:"click",onCommand:t(r)},{dropdown:e(()=>[n(u,null,{default:e(()=>[(l(!0),h(B,null,x(t(d),(a,w)=>(l(),m(i,{key:w,disabled:t(c)===a.name,command:a.name},{default:e(()=>[s("span",null,T(a.title),1)]),_:2},1032,["disabled","command"]))),128))]),_:1})]),default:e(()=>[s("div",null,[n(p,{effect:"dark",content:"主题模式",placement:"bottom"},{default:e(()=>[n(_,{size:20},{default:e(()=>[n(t(g))]),_:1})]),_:1})])]),_:1},8,["onCommand"])}}});export{V as _};
|
||||
import{d as k}from"./index-e2eede5f.js";import{w as g}from"./element-9324df56.js";import{G as C,ag as o,l,M as m,O as e,U as n,m as h,a7 as x,u as t,F as B,p as s,T}from"./vue-5ea6dbbd.js";const V=C({__name:"index",setup(b){const{themeList:d,activeThemeName:c,setTheme:r}=k();return(v,N)=>{const _=o("el-icon"),p=o("el-tooltip"),i=o("el-dropdown-item"),u=o("el-dropdown-menu"),f=o("el-dropdown");return l(),m(f,{trigger:"click",onCommand:t(r)},{dropdown:e(()=>[n(u,null,{default:e(()=>[(l(!0),h(B,null,x(t(d),(a,w)=>(l(),m(i,{key:w,disabled:t(c)===a.name,command:a.name},{default:e(()=>[s("span",null,T(a.title),1)]),_:2},1032,["disabled","command"]))),128))]),_:1})]),default:e(()=>[s("div",null,[n(p,{effect:"dark",content:"主题模式",placement:"bottom"},{default:e(()=>[n(_,{size:20},{default:e(()=>[n(t(g))]),_:1})]),_:1})])]),_:1},8,["onCommand"])}}});export{V as _};
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user