feat:增加仪表盘设计组件及设计

This commit is contained in:
wangjiahao
2021-03-12 16:08:55 +08:00
parent fec733f262
commit 8b80d8fa72
23 changed files with 4016 additions and 11 deletions

View File

@@ -29,6 +29,7 @@ public class ShiroServiceImpl implements ShiroService {
filterChainDefinitionMap.put("/v2/**","anon");
filterChainDefinitionMap.put("/v3/**","anon");
filterChainDefinitionMap.put("/static/**", "anon");
filterChainDefinitionMap.put("/common-files/**", "anon");
// filterChainDefinitionMap.put("/401", "anon");

View File

@@ -0,0 +1,22 @@
package io.dataease.controller;
import io.dataease.service.CommonFilesService;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
@RestController
@RequestMapping("common-files")
public class CommonFilesController {
@Resource
private CommonFilesService commonFilesService;
@GetMapping("/images/{imageId}")
public ResponseEntity<byte[]> image(@PathVariable("imageId") String imageId) {
return commonFilesService.getImageById(imageId);
}
}

View File

@@ -5,7 +5,9 @@ import io.dataease.controller.request.dataset.DataSetGroupRequest;
import io.dataease.controller.request.panel.PanelGroupRequest;
import io.dataease.dto.dataset.DataSetGroupDTO;
import io.dataease.dto.panel.PanelGroupDTO;
import io.dataease.service.CommonFilesService;
import io.dataease.service.panel.PanelGroupService;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;

View File

@@ -0,0 +1,33 @@
package io.dataease.service;
import io.dataease.base.domain.FileMetadata;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@Service
public class CommonFilesService {
@Resource
private FileService fileService;
public ResponseEntity<byte[]> getImageById(String imageId) {
byte[] bytes = null;
MediaType contentType = MediaType.parseMediaType("application/octet-stream");
FileMetadata fileMetadata = fileService.copyFile(imageId);
if (fileMetadata == null) {
return null;
}
bytes = fileService.loadFileAsBytes(imageId);
return ResponseEntity.ok()
.contentType(contentType)
.header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" + fileMetadata.getName() + "\"")
.body(bytes);
}
}