forked from github/dataease
fix(系统设置): 添加字体,字体名称输入空格或制表符,可以添加字体成功
This commit is contained in:
parent
db25cf4ec4
commit
2378c6ad98
@ -333,8 +333,9 @@ const setType = () => {
|
||||
if (field?.deType === 7) {
|
||||
curComponent.value.displayType = '0'
|
||||
}
|
||||
|
||||
if (
|
||||
displayType !== curComponent.value.displayType &&
|
||||
+displayType !== +curComponent.value.displayType &&
|
||||
!([3, 4].includes(+displayType) && +curComponent.value.displayType === 2)
|
||||
) {
|
||||
setTypeChange()
|
||||
@ -807,7 +808,7 @@ const validate = () => {
|
||||
}
|
||||
|
||||
if (ele.displayType !== '9' && ele.optionValueSource === 1 && !ele.field.id) {
|
||||
ElMessage.error('请选择数据集的选项值字段')
|
||||
ElMessage.error(!ele.dataset?.id ? '请选择数据集及选项值字段' : '请选择数据集的选项值字段')
|
||||
return true
|
||||
}
|
||||
|
||||
|
@ -476,14 +476,19 @@ const emits = defineEmits(['update:item', 'del'])
|
||||
<div class="bottom-line"></div>
|
||||
</template>
|
||||
<template v-else-if="!['null', 'empty', 'not_null', 'not_empty'].includes(item.term)">
|
||||
<el-input
|
||||
@click="handleClick"
|
||||
<el-tooltip
|
||||
class="item"
|
||||
v-if="item.deType === 1 && item.filterTypeTime === 'dynamicDate'"
|
||||
readonly
|
||||
class="w70 mar5"
|
||||
size="small"
|
||||
v-model="item.timeValue"
|
||||
/>
|
||||
effect="light"
|
||||
:content="item.timeValue"
|
||||
placement="top"
|
||||
><el-input
|
||||
@click="handleClick"
|
||||
readonly
|
||||
class="w70 mar5"
|
||||
size="small"
|
||||
v-model="item.timeValue"
|
||||
/></el-tooltip>
|
||||
<el-input v-else class="w70 mar5" size="small" v-model="item.value" />
|
||||
<div class="bottom-line"></div>
|
||||
</template>
|
||||
|
@ -73,8 +73,17 @@ defineExpose({
|
||||
init
|
||||
})
|
||||
|
||||
const beforeAvatarUpload = rawFile => {
|
||||
if (rawFile.type !== 'font/ttf') {
|
||||
ElMessage.error('只支持上传ttf格式的字体文件!')
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
const onChange = file => {
|
||||
state.fileList = file
|
||||
if (file.raw?.type === 'font/ttf') {
|
||||
state.fileList = file
|
||||
}
|
||||
}
|
||||
|
||||
const uploadFail = response => {
|
||||
@ -110,6 +119,7 @@ const confirm = () => {
|
||||
<template>
|
||||
<el-dialog v-model="dialogVisible" :before-close="cancel" :title="dialogTitle" width="420">
|
||||
<el-form
|
||||
@submit.prevent
|
||||
ref="ruleFormRef"
|
||||
:model="ruleForm"
|
||||
label-position="top"
|
||||
@ -118,7 +128,7 @@ const confirm = () => {
|
||||
class="demo-ruleForm"
|
||||
>
|
||||
<el-form-item v-if="action !== 'uploadFile'" label="字体名称" prop="name">
|
||||
<el-input placeholder="请输入字体名称" v-model="ruleForm.name" />
|
||||
<el-input placeholder="请输入字体名称" v-model.trim="ruleForm.name" />
|
||||
</el-form-item>
|
||||
<el-form-item v-loading="loading" v-if="action !== 'rename'" label="字库文件">
|
||||
<el-upload
|
||||
@ -128,6 +138,7 @@ const confirm = () => {
|
||||
:show-file-list="false"
|
||||
accept=".ttf"
|
||||
:on-change="onChange"
|
||||
:before-upload="beforeAvatarUpload"
|
||||
:http-request="uploadExcel"
|
||||
:on-error="uploadFail"
|
||||
name="file"
|
||||
@ -152,6 +163,7 @@ const confirm = () => {
|
||||
action=""
|
||||
:multiple="false"
|
||||
ref="uploadAgain"
|
||||
:before-upload="beforeAvatarUpload"
|
||||
:show-file-list="false"
|
||||
accept=".ttf"
|
||||
:on-change="onChange"
|
||||
|
@ -112,7 +112,7 @@ onMounted(() => {
|
||||
<div class="route-title">
|
||||
字体管理
|
||||
<div class="search-font">
|
||||
<el-input v-model="fontKeyword" clearable style="width: 240px" placeholder="搜索插件名称">
|
||||
<el-input v-model="fontKeyword" clearable style="width: 240px" placeholder="搜索字体名称">
|
||||
<template #prefix>
|
||||
<el-icon>
|
||||
<Icon name="icon_search-outline_outlined"></Icon>
|
||||
@ -154,9 +154,7 @@ onMounted(() => {
|
||||
<el-button v-if="!ele.isDefault" @click="setToDefault(ele)" secondary
|
||||
>设为默认字体</el-button
|
||||
>
|
||||
<el-button v-if="ele.name !== 'PingFang'" @click="deleteFont(ele)" secondary
|
||||
>删除</el-button
|
||||
>
|
||||
<el-button v-if="ele.id !== '1'" @click="deleteFont(ele)" secondary>删除</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user