Skip to content

Commit

Permalink
fix: 账号有效期交互优化 (#1394)
Browse files Browse the repository at this point in the history
  • Loading branch information
yuri0528 authored Nov 16, 2023
1 parent 6156a05 commit f4445a3
Showing 1 changed file with 15 additions and 2 deletions.
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

0 comments on commit f4445a3

Please sign in to comment.