forked from github/dataease
Merge pull request #11823 from dataease/pr@dev-v2@fixDS
Pr@dev v2@fix ds
This commit is contained in:
commit
08a6b2676b
@ -3,6 +3,7 @@ package io.dataease.exportCenter.manage;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.fasterxml.jackson.core.type.TypeReference;
|
import com.fasterxml.jackson.core.type.TypeReference;
|
||||||
|
import com.google.gson.Gson;
|
||||||
import io.dataease.api.chart.dto.ViewDetailField;
|
import io.dataease.api.chart.dto.ViewDetailField;
|
||||||
import io.dataease.api.chart.request.ChartExcelRequest;
|
import io.dataease.api.chart.request.ChartExcelRequest;
|
||||||
import io.dataease.api.chart.request.ChartExcelRequestInner;
|
import io.dataease.api.chart.request.ChartExcelRequestInner;
|
||||||
@ -10,6 +11,7 @@ import io.dataease.api.dataset.dto.DataSetExportRequest;
|
|||||||
import io.dataease.api.dataset.union.DatasetGroupInfoDTO;
|
import io.dataease.api.dataset.union.DatasetGroupInfoDTO;
|
||||||
import io.dataease.api.dataset.union.UnionDTO;
|
import io.dataease.api.dataset.union.UnionDTO;
|
||||||
import io.dataease.extensions.datasource.api.PluginManageApi;
|
import io.dataease.extensions.datasource.api.PluginManageApi;
|
||||||
|
import io.dataease.extensions.view.dto.DatasetRowPermissionsTreeObj;
|
||||||
import io.dataease.model.ExportTaskDTO;
|
import io.dataease.model.ExportTaskDTO;
|
||||||
import io.dataease.api.permissions.dataset.dto.DataSetRowPermissionsTreeDTO;
|
import io.dataease.api.permissions.dataset.dto.DataSetRowPermissionsTreeDTO;
|
||||||
import io.dataease.auth.bo.TokenUserBO;
|
import io.dataease.auth.bo.TokenUserBO;
|
||||||
@ -78,22 +80,24 @@ public class ExportCenterManage {
|
|||||||
DataVisualizationServer dataVisualizationServer;
|
DataVisualizationServer dataVisualizationServer;
|
||||||
@Resource
|
@Resource
|
||||||
private CoreChartViewMapper coreChartViewMapper;
|
private CoreChartViewMapper coreChartViewMapper;
|
||||||
|
@Resource
|
||||||
|
private PermissionManage permissionManage;
|
||||||
@Autowired
|
@Autowired
|
||||||
private WsService wsService;
|
private WsService wsService;
|
||||||
@Autowired(required = false)
|
@Autowired(required = false)
|
||||||
private PluginManageApi pluginManage;
|
private PluginManageApi pluginManage;
|
||||||
@Resource
|
@Resource
|
||||||
private SysParameterManage sysParameterManage;
|
private SysParameterManage sysParameterManage;
|
||||||
@Value("${export.core.size:10}")
|
@Value("${dataease.export.core.size:10}")
|
||||||
private int core;
|
private int core;
|
||||||
@Value("${export.max.size:10}")
|
@Value("${dataease.export.max.size:10}")
|
||||||
private int max;
|
private int max;
|
||||||
|
|
||||||
@Value("${export.dataset.limit:100000}")
|
@Value("${dataease.export.dataset.limit:100000}")
|
||||||
private int limit;
|
private int limit;
|
||||||
private final static String DATA_URL_TITLE = "data:image/jpeg;base64,";
|
private final static String DATA_URL_TITLE = "data:image/jpeg;base64,";
|
||||||
private static final String exportData_path = "/opt/dataease2.0/data/exportData/";
|
private static final String exportData_path = "/opt/dataease2.0/data/exportData/";
|
||||||
@Value("${extract.page.size:50000}")
|
@Value("${dataease.export.page.size:50000}")
|
||||||
private Integer extractPageSize;
|
private Integer extractPageSize;
|
||||||
static private List<String> STATUS = Arrays.asList("SUCCESS", "FAILED", "PENDING", "IN_PROGRESS", "ALL");
|
static private List<String> STATUS = Arrays.asList("SUCCESS", "FAILED", "PENDING", "IN_PROGRESS", "ALL");
|
||||||
private ScheduledThreadPoolExecutor scheduledThreadPoolExecutor;
|
private ScheduledThreadPoolExecutor scheduledThreadPoolExecutor;
|
||||||
@ -108,8 +112,6 @@ public class ExportCenterManage {
|
|||||||
@Resource
|
@Resource
|
||||||
private DatasetSQLManage datasetSQLManage;
|
private DatasetSQLManage datasetSQLManage;
|
||||||
@Resource
|
@Resource
|
||||||
private PermissionManage permissionManage;
|
|
||||||
@Resource
|
|
||||||
private DatasetTableFieldManage datasetTableFieldManage;
|
private DatasetTableFieldManage datasetTableFieldManage;
|
||||||
@Resource
|
@Resource
|
||||||
private DatasetDataManage datasetDataManage;
|
private DatasetDataManage datasetDataManage;
|
||||||
@ -347,7 +349,7 @@ public class ExportCenterManage {
|
|||||||
datasetTableFieldDTO.setFieldShortName(ele.getDataeaseName());
|
datasetTableFieldDTO.setFieldShortName(ele.getDataeaseName());
|
||||||
return datasetTableFieldDTO;
|
return datasetTableFieldDTO;
|
||||||
}).collect(Collectors.toList());
|
}).collect(Collectors.toList());
|
||||||
dto.setAllFields(allFields);
|
|
||||||
Map<String, Object> sqlMap = datasetSQLManage.getUnionSQLForEdit(dto, null);
|
Map<String, Object> sqlMap = datasetSQLManage.getUnionSQLForEdit(dto, null);
|
||||||
String sql = (String) sqlMap.get("sql");
|
String sql = (String) sqlMap.get("sql");
|
||||||
if (ObjectUtils.isEmpty(allFields)) {
|
if (ObjectUtils.isEmpty(allFields)) {
|
||||||
@ -358,6 +360,7 @@ public class ExportCenterManage {
|
|||||||
if (ObjectUtils.isEmpty(allFields)) {
|
if (ObjectUtils.isEmpty(allFields)) {
|
||||||
DEException.throwException(Translator.get("i18n_no_column_permission"));
|
DEException.throwException(Translator.get("i18n_no_column_permission"));
|
||||||
}
|
}
|
||||||
|
dto.setAllFields(allFields);
|
||||||
datasetDataManage.buildFieldName(sqlMap, allFields);
|
datasetDataManage.buildFieldName(sqlMap, allFields);
|
||||||
Map<Long, DatasourceSchemaDTO> dsMap = (Map<Long, DatasourceSchemaDTO>) sqlMap.get("dsMap");
|
Map<Long, DatasourceSchemaDTO> dsMap = (Map<Long, DatasourceSchemaDTO>) sqlMap.get("dsMap");
|
||||||
DatasourceUtils.checkDsStatus(dsMap);
|
DatasourceUtils.checkDsStatus(dsMap);
|
||||||
@ -373,12 +376,19 @@ public class ExportCenterManage {
|
|||||||
}
|
}
|
||||||
sql = Utils.replaceSchemaAlias(sql, dsMap);
|
sql = Utils.replaceSchemaAlias(sql, dsMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
List<DataSetRowPermissionsTreeDTO> rowPermissionsTree = new ArrayList<>();
|
List<DataSetRowPermissionsTreeDTO> rowPermissionsTree = new ArrayList<>();
|
||||||
TokenUserBO user = AuthUtils.getUser();
|
TokenUserBO user = AuthUtils.getUser();
|
||||||
if (user != null) {
|
if (user != null) {
|
||||||
rowPermissionsTree = permissionManage.getRowPermissionsTree(dto.getId(), user.getUserId());
|
rowPermissionsTree = permissionManage.getRowPermissionsTree(dto.getId(), user.getUserId());
|
||||||
}
|
}
|
||||||
|
if (StringUtils.isNotEmpty(request.getExpressionTree())) {
|
||||||
|
Gson gson = new Gson();
|
||||||
|
DatasetRowPermissionsTreeObj datasetRowPermissionsTreeObj = gson.fromJson(request.getExpressionTree(), DatasetRowPermissionsTreeObj.class);
|
||||||
|
permissionManage.getField(datasetRowPermissionsTreeObj);
|
||||||
|
DataSetRowPermissionsTreeDTO dataSetRowPermissionsTreeDTO = new DataSetRowPermissionsTreeDTO();
|
||||||
|
dataSetRowPermissionsTreeDTO.setTree(datasetRowPermissionsTreeObj);
|
||||||
|
rowPermissionsTree.add(dataSetRowPermissionsTreeDTO);
|
||||||
|
}
|
||||||
|
|
||||||
Provider provider;
|
Provider provider;
|
||||||
if (crossDs) {
|
if (crossDs) {
|
||||||
@ -410,7 +420,7 @@ public class ExportCenterManage {
|
|||||||
datasourceRequest.setDsList(dsMap);
|
datasourceRequest.setDsList(dsMap);
|
||||||
Map<String, Object> previewData = datasetDataManage.buildPreviewData(provider.fetchResultField(datasourceRequest), allFields, desensitizationList);
|
Map<String, Object> previewData = datasetDataManage.buildPreviewData(provider.fetchResultField(datasourceRequest), allFields, desensitizationList);
|
||||||
List<Map<String, Object>> data = (List<Map<String, Object>>) previewData.get("data");
|
List<Map<String, Object>> data = (List<Map<String, Object>>) previewData.get("data");
|
||||||
if (p == 1L) {
|
if (p == 0L) {
|
||||||
CellStyle cellStyle = wb.createCellStyle();
|
CellStyle cellStyle = wb.createCellStyle();
|
||||||
Font font = wb.createFont();
|
Font font = wb.createFont();
|
||||||
font.setFontHeightInPoints((short) 12);
|
font.setFontHeightInPoints((short) 12);
|
||||||
|
@ -9,7 +9,7 @@ import java.io.Serializable;
|
|||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
* @author fit2cloud
|
* @author fit2cloud
|
||||||
* @since 2024-08-26
|
* @since 2024-08-28
|
||||||
*/
|
*/
|
||||||
@TableName("core_font")
|
@TableName("core_font")
|
||||||
public class CoreFont implements Serializable {
|
public class CoreFont implements Serializable {
|
||||||
@ -51,6 +51,10 @@ public class CoreFont implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private Boolean isBuiltin;
|
private Boolean isBuiltin;
|
||||||
|
|
||||||
|
private Double size;
|
||||||
|
|
||||||
|
private String sizeType;
|
||||||
|
|
||||||
public Long getId() {
|
public Long getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
@ -107,6 +111,22 @@ public class CoreFont implements Serializable {
|
|||||||
this.isBuiltin = isBuiltin;
|
this.isBuiltin = isBuiltin;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Double getSize() {
|
||||||
|
return size;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSize(Double size) {
|
||||||
|
this.size = size;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSizeType() {
|
||||||
|
return sizeType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSizeType(String sizeType) {
|
||||||
|
this.sizeType = sizeType;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "CoreFont{" +
|
return "CoreFont{" +
|
||||||
@ -117,6 +137,8 @@ public class CoreFont implements Serializable {
|
|||||||
", isDefault = " + isDefault +
|
", isDefault = " + isDefault +
|
||||||
", updateTime = " + updateTime +
|
", updateTime = " + updateTime +
|
||||||
", isBuiltin = " + isBuiltin +
|
", isBuiltin = " + isBuiltin +
|
||||||
|
", size = " + size +
|
||||||
|
", sizeType = " + sizeType +
|
||||||
"}";
|
"}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,7 @@ import org.apache.ibatis.annotations.Mapper;
|
|||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
* @author fit2cloud
|
* @author fit2cloud
|
||||||
* @since 2024-08-26
|
* @since 2024-08-28
|
||||||
*/
|
*/
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface CoreFontMapper extends BaseMapper<CoreFont> {
|
public interface CoreFontMapper extends BaseMapper<CoreFont> {
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
package io.dataease.font.manage;
|
package io.dataease.font.manage;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||||
import io.dataease.api.font.dto.FontDto;
|
import io.dataease.api.font.dto.FontDto;
|
||||||
|
import io.dataease.chart.dao.auto.entity.CoreChartView;
|
||||||
import io.dataease.exception.DEException;
|
import io.dataease.exception.DEException;
|
||||||
import io.dataease.font.dao.auto.entity.CoreFont;
|
import io.dataease.font.dao.auto.entity.CoreFont;
|
||||||
import io.dataease.font.dao.auto.mapper.CoreFontMapper;
|
import io.dataease.font.dao.auto.mapper.CoreFontMapper;
|
||||||
@ -10,6 +12,7 @@ import io.dataease.utils.FileUtils;
|
|||||||
import io.dataease.utils.IDUtils;
|
import io.dataease.utils.IDUtils;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.apache.commons.lang3.ObjectUtils;
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
@ -25,6 +28,7 @@ import java.nio.charset.StandardCharsets;
|
|||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
@ -51,6 +55,11 @@ public class FontManage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public FontDto create(FontDto fontDto) {
|
public FontDto create(FontDto fontDto) {
|
||||||
|
QueryWrapper<CoreFont> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.eq("name", fontDto.getName());
|
||||||
|
if (CollectionUtils.isNotEmpty(coreFontMapper.selectList(queryWrapper))) {
|
||||||
|
DEException.throwException("存在重名字库");
|
||||||
|
}
|
||||||
fontDto.setId(IDUtils.snowID());
|
fontDto.setId(IDUtils.snowID());
|
||||||
CoreFont coreFont = new CoreFont();
|
CoreFont coreFont = new CoreFont();
|
||||||
BeanUtils.copyBean(coreFont, fontDto);
|
BeanUtils.copyBean(coreFont, fontDto);
|
||||||
@ -64,6 +73,13 @@ public class FontManage {
|
|||||||
if (ObjectUtils.isEmpty(fontDto.getId())) {
|
if (ObjectUtils.isEmpty(fontDto.getId())) {
|
||||||
return create(fontDto);
|
return create(fontDto);
|
||||||
}
|
}
|
||||||
|
if (fontDto.getIsDefault()) {
|
||||||
|
UpdateWrapper<CoreFont> updateWrapper = new UpdateWrapper<>();
|
||||||
|
updateWrapper.ne("id", fontDto.getId());
|
||||||
|
CoreFont record = new CoreFont();
|
||||||
|
record.setIsDefault(false);
|
||||||
|
coreFontMapper.update(record, updateWrapper);
|
||||||
|
}
|
||||||
CoreFont coreFont = new CoreFont();
|
CoreFont coreFont = new CoreFont();
|
||||||
BeanUtils.copyBean(coreFont, fontDto);
|
BeanUtils.copyBean(coreFont, fontDto);
|
||||||
coreFont.setUpdateTime(System.currentTimeMillis());
|
coreFont.setUpdateTime(System.currentTimeMillis());
|
||||||
@ -88,18 +104,25 @@ public class FontManage {
|
|||||||
coreFontMapper.update(record, queryWrapper);
|
coreFontMapper.update(record, queryWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String upload(MultipartFile file) {
|
public FontDto upload(MultipartFile file) {
|
||||||
String fileUuid = UUID.randomUUID().toString();
|
String fileUuid = UUID.randomUUID().toString();
|
||||||
return saveFile(file, fileUuid);
|
return saveFile(file, fileUuid);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void download(Long id, HttpServletResponse response) {
|
public void download(String file, HttpServletResponse response) {
|
||||||
CoreFont coreFont = coreFontMapper.selectById(id);
|
|
||||||
|
QueryWrapper<CoreFont> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.eq("file_trans_name", file);
|
||||||
|
List<CoreFont> coreFonts = coreFontMapper.selectList(queryWrapper);
|
||||||
|
if (CollectionUtils.isNotEmpty(coreFonts)) {
|
||||||
|
DEException.throwException("不存在的字库文件");
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
response.setContentType("application/x-download");
|
response.setContentType("application/x-download");
|
||||||
response.setHeader("Content-Disposition", "attachment;filename=" + coreFont.getFileTransName());
|
response.setHeader("Content-Disposition", "attachment;filename=" + coreFonts.get(0).getFileTransName());
|
||||||
try (ServletOutputStream out = response.getOutputStream();
|
try (ServletOutputStream out = response.getOutputStream();
|
||||||
InputStream stream = new FileInputStream(path + coreFont.getFileTransName())) {
|
InputStream stream = new FileInputStream(path + coreFonts.get(0).getFileTransName())) {
|
||||||
byte buff[] = new byte[1024];
|
byte buff[] = new byte[1024];
|
||||||
int length;
|
int length;
|
||||||
while ((length = stream.read(buff)) > 0) {
|
while ((length = stream.read(buff)) > 0) {
|
||||||
@ -125,8 +148,8 @@ public class FontManage {
|
|||||||
return fontDtos;
|
return fontDtos;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String saveFile(MultipartFile file, String fileNameUUID) throws DEException {
|
private static FontDto saveFile(MultipartFile file, String fileNameUUID) throws DEException {
|
||||||
String fileTransName = "";
|
FontDto fontDto = new FontDto();
|
||||||
try {
|
try {
|
||||||
String filename = file.getOriginalFilename();
|
String filename = file.getOriginalFilename();
|
||||||
String suffix = filename.substring(filename.lastIndexOf(".") + 1);
|
String suffix = filename.substring(filename.lastIndexOf(".") + 1);
|
||||||
@ -136,11 +159,29 @@ public class FontManage {
|
|||||||
fileOutputStream.write(file.getBytes());
|
fileOutputStream.write(file.getBytes());
|
||||||
fileOutputStream.flush();
|
fileOutputStream.flush();
|
||||||
fileOutputStream.close();
|
fileOutputStream.close();
|
||||||
fileTransName = fileNameUUID + "." + suffix;
|
fontDto.setFileTransName(fileNameUUID + "." + suffix);
|
||||||
|
|
||||||
|
long length = file.getSize();
|
||||||
|
String unit = "MB";
|
||||||
|
Double size = 0.0;
|
||||||
|
if ((double) length / 1024 / 1024 > 1) {
|
||||||
|
if ((double) length / 1024 / 1024 / 1024 > 1) {
|
||||||
|
unit = "GB";
|
||||||
|
size = Double.valueOf(String.format("%.2f", (double) length / 1024 / 1024 / 1024));
|
||||||
|
} else {
|
||||||
|
size = Double.valueOf(String.format("%.2f", (double) length / 1024 / 1024));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
unit = "KB";
|
||||||
|
size = Double.valueOf(String.format("%.2f", (double) length / 1024));
|
||||||
|
}
|
||||||
|
fontDto.setSize(size);
|
||||||
|
fontDto.setSizeType(unit);
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
DEException.throwException(e);
|
DEException.throwException(e);
|
||||||
}
|
}
|
||||||
return fileTransName;
|
return fontDto;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -45,13 +45,13 @@ public class FontServer implements FontApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String upload(MultipartFile file) throws DEException {
|
public FontDto upload(MultipartFile file) throws DEException {
|
||||||
return fontManage.upload(file);
|
return fontManage.upload(file);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void download(Long id, HttpServletResponse response) throws DEException {
|
public void download(String file, HttpServletResponse response) throws DEException {
|
||||||
fontManage.download(id, response);
|
fontManage.download(file, response);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -84,3 +84,5 @@ CREATE TABLE `core_font`
|
|||||||
`is_BuiltIn` tinyint(1) default 0 COMMENT '是否内置',
|
`is_BuiltIn` tinyint(1) default 0 COMMENT '是否内置',
|
||||||
PRIMARY KEY (`id`)
|
PRIMARY KEY (`id`)
|
||||||
);
|
);
|
||||||
|
ALTER TABLE `core_font` ADD COLUMN `size` DOUBLE NULL AFTER `is_BuiltIn`;
|
||||||
|
ALTER TABLE `core_font` ADD COLUMN `size_type` varchar(255) NULL AFTER `size`;
|
||||||
|
@ -10,16 +10,15 @@ const state = reactive({
|
|||||||
})
|
})
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
const upload = ref()
|
const upload = ref()
|
||||||
const uploadFile = ref('')
|
|
||||||
const fileName = ref('')
|
|
||||||
const uploadExcel = () => {
|
const uploadExcel = () => {
|
||||||
const formData = new FormData()
|
const formData = new FormData()
|
||||||
formData.append('file', state.fileList.raw)
|
formData.append('file', state.fileList.raw)
|
||||||
fileName.value = state.fileList.raw.name
|
ruleForm.fileName = state.fileList.raw.name
|
||||||
loading.value = true
|
loading.value = true
|
||||||
return uploadFontFile(formData)
|
return uploadFontFile(formData)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
uploadFile.value = res.data
|
ruleForm.size = res.data.size
|
||||||
|
ruleForm.fileTransName = res.data.fileTransName
|
||||||
upload.value?.clearFiles()
|
upload.value?.clearFiles()
|
||||||
loading.value = false
|
loading.value = false
|
||||||
})
|
})
|
||||||
@ -42,6 +41,8 @@ const defaultForm = {
|
|||||||
name: '',
|
name: '',
|
||||||
fileName: '',
|
fileName: '',
|
||||||
fileTransName: '',
|
fileTransName: '',
|
||||||
|
size: 0,
|
||||||
|
sizeType: '',
|
||||||
isDefault: 0,
|
isDefault: 0,
|
||||||
isBuiltin: 0,
|
isBuiltin: 0,
|
||||||
updateTime: 0
|
updateTime: 0
|
||||||
@ -86,12 +87,9 @@ const confirm = () => {
|
|||||||
ruleFormRef.value.validate(val => {
|
ruleFormRef.value.validate(val => {
|
||||||
if (val) {
|
if (val) {
|
||||||
if (action.value === 'uploadFile') {
|
if (action.value === 'uploadFile') {
|
||||||
if (uploadFile.value === '') {
|
if (ruleForm.fileTransName === '') {
|
||||||
ElMessage.error('请上传字库文件')
|
ElMessage.error('请上传字库文件')
|
||||||
return
|
return
|
||||||
} else {
|
|
||||||
ruleForm.fileTransName = uploadFile.value
|
|
||||||
ruleForm.fileName = fileName.value
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
edit(ruleForm).then(res => {
|
edit(ruleForm).then(res => {
|
||||||
@ -144,8 +142,8 @@ const confirm = () => {
|
|||||||
<FontInfo
|
<FontInfo
|
||||||
@del="fontDel"
|
@del="fontDel"
|
||||||
v-show="state.fileList"
|
v-show="state.fileList"
|
||||||
size="52.2M"
|
:size="ruleForm.size + ruleForm.sizeType"
|
||||||
name="OsakaMono.ttf"
|
:name="ruleForm.fileName"
|
||||||
></FontInfo>
|
></FontInfo>
|
||||||
<el-upload
|
<el-upload
|
||||||
action=""
|
action=""
|
||||||
|
@ -42,10 +42,10 @@ public interface FontApi {
|
|||||||
public void changeDefault(@RequestBody FontDto fontDto);
|
public void changeDefault(@RequestBody FontDto fontDto);
|
||||||
|
|
||||||
@PostMapping("/uploadFile")
|
@PostMapping("/uploadFile")
|
||||||
String upload(@RequestParam("file") MultipartFile file) throws DEException;
|
FontDto upload(@RequestParam("file") MultipartFile file) throws DEException;
|
||||||
|
|
||||||
@GetMapping("/download/{id}")
|
@GetMapping("/download/{file}")
|
||||||
void download(@PathVariable("id") Long id, HttpServletResponse response) throws DEException;
|
void download(@PathVariable("file") String file, HttpServletResponse response) throws DEException;
|
||||||
|
|
||||||
@GetMapping("/defaultFont")
|
@GetMapping("/defaultFont")
|
||||||
List<FontDto> defaultFont() throws DEException;
|
List<FontDto> defaultFont() throws DEException;
|
||||||
|
@ -30,5 +30,7 @@ public class FontDto {
|
|||||||
private Boolean isDefault;
|
private Boolean isDefault;
|
||||||
private Long updateTime;
|
private Long updateTime;
|
||||||
private Boolean isBuiltin;
|
private Boolean isBuiltin;
|
||||||
|
private Double size;
|
||||||
|
private String sizeType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,7 +23,6 @@ public class ConnectionObj implements AutoCloseable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (session != null) {
|
if (session != null) {
|
||||||
System.out.println("session.disconnect()");
|
|
||||||
session.disconnect();
|
session.disconnect();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user