Merge pull request #4438 from dataease/dev

merge dev
This commit is contained in:
fit2cloudrd 2023-02-01 15:29:48 +08:00 committed by GitHub
commit a31651a144
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 6 deletions

View File

@ -152,11 +152,17 @@ public class DataSetTableFieldController {
@DePermission(type = DePermissionType.DATASET, value = "tableId", level = ResourceAuthLevel.DATASET_LEVEL_MANAGE)
@ApiOperation("保存")
@PostMapping("save")
public DatasetTableField save(@RequestBody DatasetTableField datasetTableField) {
public DatasetTableField save(@RequestBody DatasetTableField datasetTableField) throws Exception {
dataSetTableFieldsService.checkFieldName(datasetTableField);
// 非直连数据集需先完成数据同步
DatasetTable datasetTable = dataSetTableService.get(datasetTableField.getTableId());
if (datasetTable.getMode() == 1) {
if (!dataSetTableService.checkEngineTableIsExists(datasetTableField.getTableId())) {
throw new RuntimeException(Translator.get("i18n_data_not_sync"));
}
}
try {
// 执行一次sql确保数据集中所有字段均能正确执行
DatasetTable datasetTable = dataSetTableService.get(datasetTableField.getTableId());
DataSetTableRequest dataSetTableRequest = new DataSetTableRequest();
BeanUtils.copyProperties(datasetTable, dataSetTableRequest);
dataSetTableService.getPreviewData(dataSetTableRequest, 1, 1, Collections.singletonList(datasetTableField), null);

View File

@ -17,7 +17,7 @@ import java.util.List;
* Date: 2022/9/8
* Description:
*/
@Api(tags = "仪表板:应关系")
@Api(tags = "仪表板:应关系")
@ApiSupport(order = 170)
@RestController
@RequestMapping("appTemplate")

View File

@ -103,7 +103,7 @@ public class PanelAppTemplateService {
PanelAppTemplateWithBLOBs requestTemplate = new PanelAppTemplateWithBLOBs();
BeanUtils.copyBean(requestTemplate, request);
//Store static resource into the server
if (StringUtils.isNotEmpty(request.getSnapshot())) {
if (StringUtils.isNotEmpty(request.getSnapshot()) && request.getSnapshot().indexOf("static-resource") == -1) {
String snapshotName = "app-template-" + UUIDUtil.getUUIDAsString() + ".jpeg";
staticResourceService.saveSingleFileToServe(snapshotName, request.getSnapshot().replace("data:image/jpeg;base64,", ""));
requestTemplate.setSnapshot("/" + UPLOAD_URL_PREFIX + '/' + snapshotName);

View File

@ -583,8 +583,7 @@
class-name="checkbox-table"
prop="originName"
:label="$t('dataset.parse_filed')"
:show-overflow-tooltip="true"
width="255"
show-overflow-tooltip
>
<template slot-scope="scope">
{{ scope.row.originName }}