forked from github/dataease
commit
ebfc8e0182
@ -14,6 +14,7 @@ import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
@ -91,7 +92,9 @@ public class FontManage {
|
||||
CoreFont coreFont = coreFontMapper.selectById(id);
|
||||
if (coreFont != null) {
|
||||
coreFontMapper.deleteById(id);
|
||||
FileUtils.deleteFile(path + coreFont.getFileTransName());
|
||||
if (StringUtils.isNotEmpty(coreFont.getFileTransName())) {
|
||||
FileUtils.deleteFile(path + coreFont.getFileTransName());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -152,6 +155,9 @@ public class FontManage {
|
||||
FontDto fontDto = new FontDto();
|
||||
try {
|
||||
String filename = file.getOriginalFilename();
|
||||
if (StringUtils.isEmpty(filename) || !filename.endsWith(".ttf")) {
|
||||
DEException.throwException("非法格式的文件!");
|
||||
}
|
||||
String suffix = filename.substring(filename.lastIndexOf(".") + 1);
|
||||
String filePath = path + fileNameUUID + "." + suffix;
|
||||
File f = new File(filePath);
|
||||
|
@ -13,12 +13,13 @@ const upload = ref()
|
||||
const uploadExcel = () => {
|
||||
const formData = new FormData()
|
||||
formData.append('file', state.fileList.raw)
|
||||
ruleForm.fileName = state.fileList.raw.name
|
||||
loading.value = true
|
||||
return uploadFontFile(formData)
|
||||
.then(res => {
|
||||
ruleForm.size = res.data.size
|
||||
ruleForm.sizeType = res.data.sizeType
|
||||
ruleForm.fileTransName = res.data.fileTransName
|
||||
ruleForm.fileName = state.fileList.raw.name
|
||||
upload.value?.clearFiles()
|
||||
})
|
||||
.catch(error => {
|
||||
@ -156,7 +157,7 @@ const confirm = () => {
|
||||
<FontInfo
|
||||
@del="fontDel"
|
||||
v-show="state.fileList"
|
||||
:size="ruleForm.size + ruleForm.sizeType"
|
||||
:size="ruleForm.size + ' ' + ruleForm.sizeType"
|
||||
:name="ruleForm.fileName"
|
||||
></FontInfo>
|
||||
<el-upload
|
||||
|
@ -104,15 +104,8 @@ const exportFormRules = {
|
||||
}
|
||||
]
|
||||
}
|
||||
const computedFiledList = computed(() => {
|
||||
return allFields.reduce((pre, next) => {
|
||||
if (next.id !== '-1') {
|
||||
pre[next.id] = next
|
||||
}
|
||||
return pre
|
||||
}, {})
|
||||
})
|
||||
provide('filedList', computedFiledList)
|
||||
const datasetTableFiled = ref([])
|
||||
provide('filedList', datasetTableFiled)
|
||||
|
||||
const nickName = ref('')
|
||||
const router = useRouter()
|
||||
@ -342,6 +335,7 @@ const exportDataset = () => {
|
||||
showExport.value = true
|
||||
exportForm.value.name = nodeInfo.name
|
||||
exportForm.value.expressionTree = ''
|
||||
console.log(computedFiledList)
|
||||
nextTick(() => {
|
||||
rowAuth.value.init({})
|
||||
rowAuth.value.relationList = []
|
||||
@ -461,6 +455,7 @@ const handleClick = (tabName: TabPaneName) => {
|
||||
getDatasetPreview(nodeInfo.id)
|
||||
.then(res => {
|
||||
allFields = (res?.allFields as unknown as Field[]) || []
|
||||
datasetTableFiled.value = allFields
|
||||
columnsPreview = generateColumns((res?.data?.fields as Field[]) || [])
|
||||
dataPreview = (res?.data?.data as Array<{}>) || []
|
||||
columns.value = columnsPreview
|
||||
|
@ -600,7 +600,7 @@ const apiObjRules = {
|
||||
const setActiveName = val => {
|
||||
gridData.value = val.fields
|
||||
activeParamsName.value = val.name
|
||||
activeParamsName.value = val.serialNumber
|
||||
activeParamsID.value = val.serialNumber
|
||||
}
|
||||
|
||||
const paramsObjRef = ref()
|
||||
|
Loading…
Reference in New Issue
Block a user