From 7aba36c696adb389fc5ecb8ef7fe0c481ed17603 Mon Sep 17 00:00:00 2001 From: taojinlong Date: Tue, 16 Apr 2024 17:16:57 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E7=94=A8=E6=88=B7=E7=AE=A1=E7=90=86):=20?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E7=94=A8=E6=88=B7=E6=89=A9=E5=B1=95=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E7=94=A8=E4=BA=8E=E9=85=8D=E7=BD=AE=E8=A1=8C=E6=9D=83?= =?UTF-8?q?=E9=99=90=E7=B3=BB=E7=BB=9F=E5=8F=98=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/io/dataease/dataset/manage/PermissionManage.java | 3 +++ core/core-frontend/src/locales/zh-CN.ts | 1 + .../core-frontend/src/views/visualized/data/dataset/options.js | 2 +- .../java/io/dataease/api/permissions/user/dto/UserCreator.java | 2 ++ .../java/io/dataease/api/permissions/user/vo/UserFormVO.java | 3 +++ 5 files changed, 10 insertions(+), 1 deletion(-) diff --git a/core/core-backend/src/main/java/io/dataease/dataset/manage/PermissionManage.java b/core/core-backend/src/main/java/io/dataease/dataset/manage/PermissionManage.java index 3667ede8de..ddb8854528 100644 --- a/core/core-backend/src/main/java/io/dataease/dataset/manage/PermissionManage.java +++ b/core/core-backend/src/main/java/io/dataease/dataset/manage/PermissionManage.java @@ -198,6 +198,9 @@ public class PermissionManage { if (StringUtils.isNotEmpty(userEntity.getName())) { expressionTree = expressionTree.replaceAll("\\$\\{sysParams\\.userName}", userEntity.getName()); } + if (StringUtils.isNotEmpty(userEntity.getLabel())) { + expressionTree = expressionTree.replaceAll("\\$\\{sysParams\\.userLabel}", userEntity.getLabel()); + } record.setExpressionTree(expressionTree); DatasetRowPermissionsTreeObj tree = JsonUtil.parseObject(expressionTree, DatasetRowPermissionsTreeObj.class); record.setTree(tree); diff --git a/core/core-frontend/src/locales/zh-CN.ts b/core/core-frontend/src/locales/zh-CN.ts index e5e6036502..bace4cbb1f 100644 --- a/core/core-frontend/src/locales/zh-CN.ts +++ b/core/core-frontend/src/locales/zh-CN.ts @@ -182,6 +182,7 @@ export default { user_id: '账号', user_name: '姓名', user_source: '用户来源', + user_label: '用户标签', user_email: '邮箱', dept: '组织', role: '角色' diff --git a/core/core-frontend/src/views/visualized/data/dataset/options.js b/core/core-frontend/src/views/visualized/data/dataset/options.js index 7f0cb017e2..a222bb11b7 100644 --- a/core/core-frontend/src/views/visualized/data/dataset/options.js +++ b/core/core-frontend/src/views/visualized/data/dataset/options.js @@ -20,7 +20,7 @@ const valueOptions = valueEnum.map(formatEnum) const sysParams = ['eq', 'not_eq', 'like', 'not like', 'in', 'not in'] const textOptionsForSysParams = sysParams.map(formatEnum) -const sysParamsEnum = ['userId', 'userName', 'userEmail'] +const sysParamsEnum = ['userId', 'userName', 'userEmail', 'userLabel'] const sysParamsIlns = sysParamsEnum.map(_ => { return { value: `\${sysParams.${_}}`, label: `auth.sysParams_type.${toLine(_)}` } diff --git a/sdk/api/api-permissions/src/main/java/io/dataease/api/permissions/user/dto/UserCreator.java b/sdk/api/api-permissions/src/main/java/io/dataease/api/permissions/user/dto/UserCreator.java index e97d13e952..e11127967b 100644 --- a/sdk/api/api-permissions/src/main/java/io/dataease/api/permissions/user/dto/UserCreator.java +++ b/sdk/api/api-permissions/src/main/java/io/dataease/api/permissions/user/dto/UserCreator.java @@ -31,4 +31,6 @@ public class UserCreator implements Serializable { @Schema(hidden = true) @JsonIgnore private Long uid; + @Schema(description = "标签", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + private String label; } diff --git a/sdk/api/api-permissions/src/main/java/io/dataease/api/permissions/user/vo/UserFormVO.java b/sdk/api/api-permissions/src/main/java/io/dataease/api/permissions/user/vo/UserFormVO.java index 851ab91999..13d33f2c91 100644 --- a/sdk/api/api-permissions/src/main/java/io/dataease/api/permissions/user/vo/UserFormVO.java +++ b/sdk/api/api-permissions/src/main/java/io/dataease/api/permissions/user/vo/UserFormVO.java @@ -42,4 +42,7 @@ public class UserFormVO implements Serializable { @Schema(description = "模式") private String model; + + @Schema(description = "标签") + private String label; }