Skip to content

Commit

Permalink
fix: 体验问题修复
Browse files Browse the repository at this point in the history
  • Loading branch information
yuri0528 committed Dec 12, 2023
1 parent cd3a83e commit 0b82b17
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 12 deletions.
12 changes: 7 additions & 5 deletions src/pages/src/components/custom-fields/view.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
v-for="(item, index) in extras"
:key="index">
<span class="details-content-key">{{ item.displayName }}:</span>
<span class="details-content-value">{{ ConvertVal(item.value) }}</span>
<span class="details-content-value">{{ ConvertVal(item) }}</span>
</div>
</div>
</template>
Expand All @@ -20,12 +20,14 @@ defineProps({
},
});
const ConvertVal = (val: any) => {
const ConvertVal = (item: any) => {
const demo = ref('');
if (val instanceof Array) {
demo.value = val?.map(item => item.value).join('') || '--';
if (item.type === 'multi_enum') {
demo.value = item.value?.map(k => k.value).join('') || '--';
} else if (item.type === 'number') {
demo.value = item.value;
} else {
demo.value = val || '--';
demo.value = item.value || '--';
}
return demo.value;
};
Expand Down
6 changes: 6 additions & 0 deletions src/pages/src/hooks/useCustomFields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export const useCustomFields = (data, customFields) => {
key: item.name,
value: k.value,
displayName: item.display_name,
type: item.data_type,
});
}
});
Expand All @@ -20,13 +21,15 @@ export const useCustomFields = (data, customFields) => {
key: item.name,
value: item.options.filter((k: string) => item.default.includes(k.id)).filter(k => k.value),
displayName: item.display_name,
type: item.data_type,
});
} else {
extras.push({
id: item.id,
key: item.name,
value: item.default,
displayName: item.display_name,
type: item.data_type,
});
}
} else {
Expand All @@ -38,6 +41,7 @@ export const useCustomFields = (data, customFields) => {
key: item.name,
value: k.value,
displayName: item.display_name,
type: item.data_type,
});
}
});
Expand All @@ -47,13 +51,15 @@ export const useCustomFields = (data, customFields) => {
key: item.name,
value: item.options.filter((k: string) => data[item.name].includes(k.id)).filter(k => k.value),
displayName: item.display_name,
type: item.data_type,
});
} else {
extras.push({
id: item.id,
key: item.name,
value: data[item.name],
displayName: item.display_name,
type: item.data_type,
});
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/src/views/data-source/new-data/Local.vue
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
</bk-checkbox>
</bk-form-item>
<bk-form-item label="" required>
<div>
<div class="div-flex">
<bk-checkbox
v-model="formData.config.password_initial.cannot_use_previous_password"
@change="handleChange">
Expand Down
9 changes: 9 additions & 0 deletions src/pages/src/views/data-source/new-data/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
font-weight: 700;
}

.div-flex {
display: flex;
align-items: center;
}

::v-deep .bk-form-item {
padding-bottom: 24px;
margin-bottom: 0;
Expand All @@ -23,6 +28,10 @@
margin-bottom: 24px;
}

.bk-form-content {
line-height: 22px;
}

.bk-radio-button {
width: 80px;

Expand Down
12 changes: 7 additions & 5 deletions src/pages/src/views/personal-center/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@
<div class="item-flex">
<li v-for="(item, index) in currentUserInfo.extras" :key="index">
<bk-overflow-title class="key" type="tips">{{ item.displayName }}:</bk-overflow-title>
<span class="value">{{ ConvertVal(item.value) }}</span>
<span class="value">{{ ConvertVal(item) }}</span>
</li>
</div>
</li>
Expand Down Expand Up @@ -313,12 +313,14 @@ const getCurrentUser = async (id) => {
infoLoading.value = false;
};

const ConvertVal = (val: any) => {
const ConvertVal = (item: any) => {
const demo = ref('');
if (val instanceof Array) {
demo.value = val?.map(item => item.value).join('') || '--';
if (item.type === 'multi_enum') {
demo.value = item.value?.map(k => k.value).join('') || '--';
} else if (item.type === 'number') {
demo.value = item.value;
} else {
demo.value = val || '--';
demo.value = item.value || '--';
}
return demo.value;
};
Expand Down
2 changes: 1 addition & 1 deletion src/pages/src/views/setting/AccountSetting.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<bk-switcher v-model="formData.enabled" theme="primary" size="large" @change="changeEnabled" />
</bk-form-item>
<div v-if="formData.enabled">
<bk-form-item label="账号有效期">
<bk-form-item label="账号有效期" required>
<bk-radio-group v-model="formData.validity_period" @change="handleChange">
<bk-radio-button
v-for="(item, index) in VALID_TIME"
Expand Down

0 comments on commit 0b82b17

Please sign in to comment.