Merge pull request #11852 from dataease/pr@dev-v2_st

fix(系统设置): 添加字体,使总数超过10个,10个以后的字体无法展示
This commit is contained in:
dataeaseShu 2024-08-29 16:36:56 +08:00 committed by GitHub
commit 5e5868cd26
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 35 additions and 30 deletions

View File

@ -75,14 +75,14 @@ defineExpose({
})
const beforeAvatarUpload = rawFile => {
if (rawFile.type !== 'font/ttf') {
if (!rawFile.name.endsWith('.ttf')) {
ElMessage.error('只支持上传ttf格式的字体文件!')
return false
}
return true
}
const onChange = file => {
if (file.raw?.type === 'font/ttf') {
if (file.raw?.name.endsWith('.ttf')) {
state.fileList = file
}
}

View File

@ -128,6 +128,7 @@ onMounted(() => {
</el-button>
</div>
</div>
<div class="font-content_overflow">
<div class="font-content_list">
<div class="font-content_item" v-for="ele in fontList" :key="ele">
<span v-if="ele.isDefault" class="font-default">默认字体</span>
@ -159,6 +160,7 @@ onMounted(() => {
</div>
</div>
</div>
</div>
<UploadDetail @finish="uploadFilish" ref="uploadDetail"></UploadDetail>
</template>
@ -183,12 +185,15 @@ onMounted(() => {
}
}
}
.font-content_overflow {
height: calc(100vh - 146px);
overflow-y: auto;
}
.font-content_list {
display: flex;
flex-wrap: wrap;
row-gap: 16px;
justify-content: space-between;
.font-content_item {
border-radius: 4px;
background: #fff;