Merge pull request #3898 from dataease/pr@dev@fix_dataset

fix(数据集): 自定义时间格式
This commit is contained in:
taojinlong 2022-11-28 12:22:34 +08:00 committed by GitHub
commit 7443493b3a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View File

@ -1012,7 +1012,7 @@ public class ChartDataBuild {
switch (columnPermissionItem.getDesensitizationRule().getCustomBuiltInRule()) {
case RetainBeforeMAndAfterN:
if (StringUtils.isEmpty(originStr) || originStr.length() < columnPermissionItem.getDesensitizationRule().getM() + columnPermissionItem.getDesensitizationRule().getN() + 1) {
desensitizationStr = String.join("", Collections.nCopies(columnPermissionItem.getDesensitizationRule().getM(), "X")) + "***" + Collections.nCopies(columnPermissionItem.getDesensitizationRule().getN(), "X");
desensitizationStr = String.join("", Collections.nCopies(columnPermissionItem.getDesensitizationRule().getM(), "X")) + "***" + String.join("", Collections.nCopies(columnPermissionItem.getDesensitizationRule().getN(), "X"));
} else {
desensitizationStr = StringUtils.substring(originStr, 0, columnPermissionItem.getDesensitizationRule().getM() - 1) + "***" + StringUtils.substring(originStr, originStr.length() - columnPermissionItem.getDesensitizationRule().getN(), originStr.length() - 1);
}
@ -1030,7 +1030,7 @@ public class ChartDataBuild {
desensitizationStr = "***" + StringUtils.substring(originStr, columnPermissionItem.getDesensitizationRule().getM() - 1, columnPermissionItem.getDesensitizationRule().getN()) + "***";
break;
}
if (originStr.length() >= columnPermissionItem.getDesensitizationRule().getN() && originStr.length() < columnPermissionItem.getDesensitizationRule().getN()) {
if (originStr.length() >= columnPermissionItem.getDesensitizationRule().getM() && originStr.length() < columnPermissionItem.getDesensitizationRule().getN()) {
desensitizationStr = "***" + StringUtils.substring(originStr, columnPermissionItem.getDesensitizationRule().getM() - 1, originStr.length());
}
break;

View File

@ -833,8 +833,9 @@ export default {
this.quotaChange()
})
dateformats(this.param.id).then((response) => {
const children = (response?.data || []).map(ele => ({ label: ele.dateformat, value: ele.dateformat }))
children.push({ label: '自定义', value: 'custom' })
const children = (response?.data || []).map(ele => ({ label: ele.dateformat + ( ele.desc !== null ? ('(' + ele.desc) + ')' : ""), value: ele.dateformat }))
children.push({ label: this.$t('commons.custom'), value: 'custom' })
this.dateformats = children
})
},