Skip to content

Commit

Permalink
fix: 调整配置文件权限设置交互 (#3295)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuikill committed Jun 19, 2024
1 parent a630b9f commit 754d2df
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
class="group-checkboxs"
:model-value="privilegeGroupsValue[index]"
@change="handleSelectPrivilege(index, $event)">
<bk-checkbox size="small" :label="4" :disabled="true">
<bk-checkbox size="small" :label="4">
{{ t('') }}
</bk-checkbox>
<bk-checkbox size="small" :label="2">{{ t('') }}</bk-checkbox>
Expand Down Expand Up @@ -208,7 +208,7 @@
// 权限输入框失焦后,校验输入是否合法,如不合法回退到上次输入
const handlePrivilegeInputBlur = () => {
const val = String(privilegeInputVal.value);
if (/^[0-7]{3}$/.test(val)) {
if (/^[0-7]{3}$/.test(val) || val === '') {
localVal.value.privilege = val;
showPrivilegeErrorTips.value = false;
} else {
Expand All @@ -229,7 +229,12 @@
}
digits.push(sum);
}
const newVal = digits.join('');
// 选择其他权限 自动选择own的读取权限
if (digits[0] < 4 && digits.some((item) => item > 0)) {
digits[0] += 4;
}
const newVal = digits.every((item) => item === 0) ? '' : digits.join('');
privilegeInputVal.value = newVal;
localVal.value.privilege = newVal;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
class="group-checkboxs"
:model-value="privilegeGroupsValue[index]"
@change="handleSelectPrivilege(index, $event)">
<bk-checkbox size="small" :label="4" :disabled="privilegeGroupsValue[0]">
<bk-checkbox size="small" :label="4" :disabled="index === 0">
{{ t('') }}
</bk-checkbox>
<bk-checkbox size="small" :label="2">{{ t('') }}</bk-checkbox>
Expand Down

0 comments on commit 754d2df

Please sign in to comment.