Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 账号有效期交互优化 #1394

Merged
merged 1 commit into from
Nov 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions src/pages/src/views/setting/AccountSetting.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<bk-loading :loading="isLoading" :z-index="9" class="account-setting-wrapper user-scroll-y">
<bk-form class="account-setting-content" form-type="vertical" :model="formData" ref="formRef">
<bk-form-item label="账号有效期开启">
<bk-switcher v-model="formData.enabled" theme="primary" size="large" @change="handleChange" />
<bk-switcher v-model="formData.enabled" theme="primary" size="large" @change="changeEnabled" />
</bk-form-item>
<div v-if="formData.enabled">
<bk-form-item label="账号有效期">
Expand Down Expand Up @@ -70,7 +70,7 @@
</template>

<script setup lang="ts">
import { Message } from 'bkui-vue';
import { InfoBox, Message } from 'bkui-vue';
import { AngleDown, AngleUp } from 'bkui-vue/lib/icon';
import { onMounted, ref } from 'vue';

Expand Down Expand Up @@ -135,6 +135,19 @@ const changeApplication = async () => {
console.warn(e);
}
};

const changeEnabled = (value) => {
if (!value) {
InfoBox({
title: '确认要关闭账号有效期吗?',
subTitle: '关闭后,存量账号有效期不变,新账号有效期永久。',
onClosed() {
formData.value.enabled = !value;
},
});
}
window.changeInput = true;
};
</script>

<style lang="less" scoped>
Expand Down