mirror of
https://github.com/dataease/dataease.git
synced 2025-02-25 20:35:26 +08:00
Merge branch 'dev' into pr@dev_memory_component
This commit is contained in:
commit
a2da48f2dd
@ -118,6 +118,7 @@ public class ShiroServiceImpl implements ShiroService {
|
|||||||
|
|
||||||
filterChainDefinitionMap.put("/api/link/resourceDetail/**", "link");
|
filterChainDefinitionMap.put("/api/link/resourceDetail/**", "link");
|
||||||
filterChainDefinitionMap.put("/api/link/viewDetail/**", "link");
|
filterChainDefinitionMap.put("/api/link/viewDetail/**", "link");
|
||||||
|
filterChainDefinitionMap.put("/api/link/viewLog", "link");
|
||||||
filterChainDefinitionMap.put("/panel/group/exportDetails", ANON);
|
filterChainDefinitionMap.put("/panel/group/exportDetails", ANON);
|
||||||
filterChainDefinitionMap.put("/dataset/field/linkMultFieldValues", "link");
|
filterChainDefinitionMap.put("/dataset/field/linkMultFieldValues", "link");
|
||||||
filterChainDefinitionMap.put("/dataset/field/linkMappingFieldValues", "link");
|
filterChainDefinitionMap.put("/dataset/field/linkMappingFieldValues", "link");
|
||||||
|
@ -37,6 +37,7 @@ public class SysLogConstants {
|
|||||||
UNBIND(17, "OPERATE_TYPE_UNBIND");
|
UNBIND(17, "OPERATE_TYPE_UNBIND");
|
||||||
private Integer value;
|
private Integer value;
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
OPERATE_TYPE(Integer value, String name) {
|
OPERATE_TYPE(Integer value, String name) {
|
||||||
this.value = value;
|
this.value = value;
|
||||||
this.name = name;
|
this.name = name;
|
||||||
@ -62,7 +63,7 @@ public class SysLogConstants {
|
|||||||
DATASET(2, "SOURCE_TYPE_DATASET"),
|
DATASET(2, "SOURCE_TYPE_DATASET"),
|
||||||
PANEL(3, "SOURCE_TYPE_PANEL"),
|
PANEL(3, "SOURCE_TYPE_PANEL"),
|
||||||
VIEW(4, "SOURCE_TYPE_VIEW"),
|
VIEW(4, "SOURCE_TYPE_VIEW"),
|
||||||
/*LINK(5, "SOURCE_TYPE_LINK"),*/
|
LINK(5, "SOURCE_TYPE_LINK"),
|
||||||
USER(6, "SOURCE_TYPE_USER"),
|
USER(6, "SOURCE_TYPE_USER"),
|
||||||
DEPT(7, "SOURCE_TYPE_DEPT"),
|
DEPT(7, "SOURCE_TYPE_DEPT"),
|
||||||
ROLE(8, "SOURCE_TYPE_ROLE"),
|
ROLE(8, "SOURCE_TYPE_ROLE"),
|
||||||
|
@ -34,14 +34,14 @@ public class DeLogUtils {
|
|||||||
DeLogUtils.logService = logService;
|
DeLogUtils.logService = logService;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static SysLogDTO buildLog(OPERATE_TYPE operatetype, SOURCE_TYPE sourcetype, Object sourceIdValue, Object targetId, SOURCE_TYPE target_type ) {
|
public static SysLogDTO buildLog(OPERATE_TYPE operatetype, SOURCE_TYPE sourcetype, Object sourceIdValue, Object targetId, SOURCE_TYPE target_type) {
|
||||||
SysLogDTO sysLogDTO = buildLog(operatetype, sourcetype, sourceIdValue, null, targetId, target_type);
|
SysLogDTO sysLogDTO = buildLog(operatetype, sourcetype, sourceIdValue, null, targetId, target_type);
|
||||||
if (sourcetype == SysLogConstants.SOURCE_TYPE.DATASOURCE) {
|
if (sourcetype == SysLogConstants.SOURCE_TYPE.DATASOURCE) {
|
||||||
FolderItem folderItem = logManager.dsTypeInfoById(sourceIdValue.toString());
|
FolderItem folderItem = logManager.dsTypeInfoById(sourceIdValue.toString());
|
||||||
List<FolderItem> items = new ArrayList<>();
|
List<FolderItem> items = new ArrayList<>();
|
||||||
items.add(folderItem);
|
items.add(folderItem);
|
||||||
sysLogDTO.setPositions(items);
|
sysLogDTO.setPositions(items);
|
||||||
}else {
|
} else {
|
||||||
List<FolderItem> parentsAndSelf = logManager.justParents(sourceIdValue.toString(), sourcetype);
|
List<FolderItem> parentsAndSelf = logManager.justParents(sourceIdValue.toString(), sourcetype);
|
||||||
sysLogDTO.setPositions(parentsAndSelf);
|
sysLogDTO.setPositions(parentsAndSelf);
|
||||||
}
|
}
|
||||||
@ -66,7 +66,7 @@ public class DeLogUtils {
|
|||||||
return sysLogDTO;
|
return sysLogDTO;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static SysLogDTO buildLog(OPERATE_TYPE operatetype, SOURCE_TYPE sourcetype, Object sourceIdValue, Object positionId, Object targetId, SOURCE_TYPE target_type ) {
|
public static SysLogDTO buildLog(OPERATE_TYPE operatetype, SOURCE_TYPE sourcetype, Object sourceIdValue, Object positionId, Object targetId, SOURCE_TYPE target_type) {
|
||||||
SysLogDTO sysLogDTO = new SysLogDTO();
|
SysLogDTO sysLogDTO = new SysLogDTO();
|
||||||
sysLogDTO.setOperateType(operatetype.getValue());
|
sysLogDTO.setOperateType(operatetype.getValue());
|
||||||
sysLogDTO.setSourceType(sourcetype.getValue());
|
sysLogDTO.setSourceType(sourcetype.getValue());
|
||||||
@ -83,14 +83,14 @@ public class DeLogUtils {
|
|||||||
List<FolderItem> items = new ArrayList<>();
|
List<FolderItem> items = new ArrayList<>();
|
||||||
items.add(folderItem);
|
items.add(folderItem);
|
||||||
sysLogDTO.setPositions(items);
|
sysLogDTO.setPositions(items);
|
||||||
}else {
|
} else {
|
||||||
if(sourcetype == SOURCE_TYPE.DRIVER_FILE){
|
if (sourcetype == SOURCE_TYPE.DRIVER_FILE) {
|
||||||
List<FolderItem> parentsAndSelf = logManager.parentsAndSelf(positionId.toString(), SOURCE_TYPE.DRIVER);
|
List<FolderItem> parentsAndSelf = logManager.parentsAndSelf(positionId.toString(), SOURCE_TYPE.DRIVER);
|
||||||
sysLogDTO.setPositions(parentsAndSelf);
|
sysLogDTO.setPositions(parentsAndSelf);
|
||||||
}else if(sourcetype == SOURCE_TYPE.VIEW){
|
} else if (sourcetype == SOURCE_TYPE.VIEW || sourcetype == SOURCE_TYPE.LINK) {
|
||||||
List<FolderItem> parentsAndSelf = logManager.parentsAndSelf(positionId.toString(), SOURCE_TYPE.PANEL);
|
List<FolderItem> parentsAndSelf = logManager.parentsAndSelf(positionId.toString(), SOURCE_TYPE.PANEL);
|
||||||
sysLogDTO.setPositions(parentsAndSelf);
|
sysLogDTO.setPositions(parentsAndSelf);
|
||||||
}else {
|
} else {
|
||||||
List<FolderItem> parentsAndSelf = logManager.parentsAndSelf(positionId.toString(), sourcetype);
|
List<FolderItem> parentsAndSelf = logManager.parentsAndSelf(positionId.toString(), sourcetype);
|
||||||
sysLogDTO.setPositions(parentsAndSelf);
|
sysLogDTO.setPositions(parentsAndSelf);
|
||||||
}
|
}
|
||||||
|
45
backend/src/main/java/io/dataease/commons/utils/IPUtils.java
Normal file
45
backend/src/main/java/io/dataease/commons/utils/IPUtils.java
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
package io.dataease.commons.utils;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
public class IPUtils {
|
||||||
|
|
||||||
|
private static final String HEAD_KEYS = "x-forwarded-for, Proxy-Client-IP, WL-Proxy-Client-IP";
|
||||||
|
|
||||||
|
private static final String UNKNOWN = "unknown";
|
||||||
|
|
||||||
|
private static final String LOCAL_IP_KEY = "0:0:0:0:0:0:0:1";
|
||||||
|
private static final String LOCAL_IP_VAL = "127.0.0.1";
|
||||||
|
|
||||||
|
public static String get() {
|
||||||
|
|
||||||
|
String ipStr = null;
|
||||||
|
boolean isProxy = false;
|
||||||
|
|
||||||
|
HttpServletRequest request = null;
|
||||||
|
try {
|
||||||
|
request = ServletUtils.request();
|
||||||
|
} catch (Exception e) {
|
||||||
|
LogUtil.error(e.getMessage(), e);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
String[] keyArr = HEAD_KEYS.split(",");
|
||||||
|
for (String key : keyArr) {
|
||||||
|
String header = request.getHeader(key.trim());
|
||||||
|
if (StringUtils.isNotBlank(header) && !StringUtils.equalsIgnoreCase(UNKNOWN, header)) {
|
||||||
|
ipStr = header;
|
||||||
|
isProxy = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isProxy) {
|
||||||
|
ipStr = request.getRemoteAddr();
|
||||||
|
}
|
||||||
|
ipStr = Arrays.stream(ipStr.split(",")).filter(item -> StringUtils.isNotBlank(item) && !StringUtils.equalsIgnoreCase(UNKNOWN, item.trim())).findFirst().orElse(ipStr);
|
||||||
|
return StringUtils.equals(LOCAL_IP_KEY, ipStr) ? LOCAL_IP_VAL : ipStr;
|
||||||
|
}
|
||||||
|
}
|
@ -4,12 +4,14 @@ import com.github.xiaoymin.knife4j.annotations.ApiSupport;
|
|||||||
import io.dataease.auth.annotation.DePermission;
|
import io.dataease.auth.annotation.DePermission;
|
||||||
import io.dataease.commons.constants.DePermissionType;
|
import io.dataease.commons.constants.DePermissionType;
|
||||||
import io.dataease.controller.request.chart.ChartExtRequest;
|
import io.dataease.controller.request.chart.ChartExtRequest;
|
||||||
|
import io.dataease.controller.request.panel.PanelViewLogRequest;
|
||||||
import io.dataease.controller.request.panel.link.*;
|
import io.dataease.controller.request.panel.link.*;
|
||||||
import io.dataease.dto.panel.link.GenerateDto;
|
import io.dataease.dto.panel.link.GenerateDto;
|
||||||
import io.dataease.dto.panel.link.ValidateDto;
|
import io.dataease.dto.panel.link.ValidateDto;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import springfox.documentation.annotations.ApiIgnore;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@ -58,9 +60,15 @@ public interface LinkApi {
|
|||||||
@ApiOperation("视图详细信息")
|
@ApiOperation("视图详细信息")
|
||||||
@PostMapping("/viewDetail/{viewId}/{panelId}")
|
@PostMapping("/viewDetail/{viewId}/{panelId}")
|
||||||
Object viewDetail(@PathVariable("viewId") String viewId, @PathVariable("panelId") String panelId,
|
Object viewDetail(@PathVariable("viewId") String viewId, @PathVariable("panelId") String panelId,
|
||||||
@RequestBody ChartExtRequest requestList) throws Exception;
|
@RequestBody ChartExtRequest requestList) throws Exception;
|
||||||
|
|
||||||
@ApiOperation("压缩链接")
|
@ApiOperation("压缩链接")
|
||||||
@PostMapping("/shortUrl")
|
@PostMapping("/shortUrl")
|
||||||
String shortUrl(@RequestBody Map<String, String> param);
|
String shortUrl(@RequestBody Map<String, String> param);
|
||||||
|
|
||||||
|
@ApiIgnore
|
||||||
|
@PostMapping("/viewLog")
|
||||||
|
void viewLinkLog(@RequestBody LinkViewLogRequest request);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,9 @@ package io.dataease.controller.panel.server;
|
|||||||
import com.auth0.jwt.JWT;
|
import com.auth0.jwt.JWT;
|
||||||
import com.auth0.jwt.interfaces.DecodedJWT;
|
import com.auth0.jwt.interfaces.DecodedJWT;
|
||||||
import io.dataease.auth.filter.F2CLinkFilter;
|
import io.dataease.auth.filter.F2CLinkFilter;
|
||||||
|
import io.dataease.commons.constants.SysLogConstants;
|
||||||
|
import io.dataease.commons.utils.DeLogUtils;
|
||||||
|
import io.dataease.plugins.common.base.domain.PanelGroupWithBLOBs;
|
||||||
import io.dataease.plugins.common.base.domain.PanelLink;
|
import io.dataease.plugins.common.base.domain.PanelLink;
|
||||||
import io.dataease.controller.panel.api.LinkApi;
|
import io.dataease.controller.panel.api.LinkApi;
|
||||||
import io.dataease.controller.request.chart.ChartExtRequest;
|
import io.dataease.controller.request.chart.ChartExtRequest;
|
||||||
@ -111,4 +114,19 @@ public class LinkServer implements LinkApi {
|
|||||||
String resourceId = param.get("resourceId");
|
String resourceId = param.get("resourceId");
|
||||||
return panelLinkService.getShortUrl(resourceId);
|
return panelLinkService.getShortUrl(resourceId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void viewLinkLog(LinkViewLogRequest request) {
|
||||||
|
String panelId = request.getPanelId();
|
||||||
|
Boolean mobile = request.getMobile();
|
||||||
|
Long userId = request.getUserId();
|
||||||
|
SysLogConstants.OPERATE_TYPE operateType = SysLogConstants.OPERATE_TYPE.PC_VIEW;
|
||||||
|
if (ObjectUtils.isNotEmpty(mobile) && mobile) {
|
||||||
|
operateType = SysLogConstants.OPERATE_TYPE.MB_VIEW;
|
||||||
|
}
|
||||||
|
if (ObjectUtils.isEmpty(userId)) return;
|
||||||
|
PanelGroupWithBLOBs panelGroupWithBLOBs = panelLinkService.resourceInfo(panelId);
|
||||||
|
String pid = panelGroupWithBLOBs.getPid();
|
||||||
|
DeLogUtils.save(operateType, SysLogConstants.SOURCE_TYPE.LINK, panelId, pid, userId, SysLogConstants.SOURCE_TYPE.USER);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,12 @@
|
|||||||
|
package io.dataease.controller.request.panel.link;
|
||||||
|
|
||||||
|
import io.dataease.controller.request.panel.PanelViewLogRequest;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class LinkViewLogRequest extends PanelViewLogRequest implements Serializable {
|
||||||
|
|
||||||
|
private Long userId;
|
||||||
|
}
|
@ -22,4 +22,7 @@ public class SysLogGridDTO implements Serializable {
|
|||||||
|
|
||||||
@ApiModelProperty("操作时间")
|
@ApiModelProperty("操作时间")
|
||||||
private Long time;
|
private Long time;
|
||||||
|
|
||||||
|
@ApiModelProperty("IP地址")
|
||||||
|
private String ip;
|
||||||
}
|
}
|
||||||
|
@ -28,15 +28,12 @@ public class LogManager {
|
|||||||
|
|
||||||
protected static final String contentFormat = "【%s】";
|
protected static final String contentFormat = "【%s】";
|
||||||
|
|
||||||
protected static final String positionFormat = "在【%s】";
|
|
||||||
|
|
||||||
protected static final String format = "给%s【%s】";
|
|
||||||
|
|
||||||
protected Gson gson = new Gson();
|
protected Gson gson = new Gson();
|
||||||
|
|
||||||
|
|
||||||
protected Type type = new TypeToken<List<FolderItem>>() {}.getType();
|
protected Type type = new TypeToken<List<FolderItem>>() {
|
||||||
|
}.getType();
|
||||||
|
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
@ -47,26 +44,28 @@ public class LogManager {
|
|||||||
|
|
||||||
|
|
||||||
public String detailInfo(SysLogWithBLOBs vo) {
|
public String detailInfo(SysLogWithBLOBs vo) {
|
||||||
String sourceName = vo.getSourceName();
|
|
||||||
String position = null;
|
String position = null;
|
||||||
String operateTypeName = SysLogConstants.operateTypeName(vo.getOperateType());
|
String operateTypeName = SysLogConstants.operateTypeName(vo.getOperateType());
|
||||||
operateTypeName = Translator.get(operateTypeName);
|
operateTypeName = Translator.get(operateTypeName);
|
||||||
String sourceTypeName = SysLogConstants.sourceTypeName(vo.getSourceType());
|
String sourceTypeName = SysLogConstants.sourceTypeName(vo.getSourceType());
|
||||||
sourceTypeName = Translator.get(sourceTypeName);
|
sourceTypeName = Translator.get(sourceTypeName);
|
||||||
String result = operateTypeName + sourceTypeName + String.format(contentFormat, sourceName) + remarkInfo(vo);
|
String result = operateTypeName + sourceTypeName + String.format(contentFormat, vo.getSourceName());
|
||||||
|
if (vo.getSourceType() != SysLogConstants.SOURCE_TYPE.LINK.getValue()) {
|
||||||
|
result += remarkInfo(vo, false);
|
||||||
|
}
|
||||||
if ((position = vo.getPosition()) != null) {
|
if ((position = vo.getPosition()) != null) {
|
||||||
List<FolderItem> folderItems = gson.fromJson(position, type);
|
List<FolderItem> folderItems = gson.fromJson(position, type);
|
||||||
String template = folderItems.stream().map(folderItem -> folderItem.getName()).collect(Collectors.joining("/"));
|
String template = folderItems.stream().map(folderItem -> folderItem.getName()).collect(Collectors.joining("/"));
|
||||||
String positionResult = String.format(positionFormat, template);
|
String positionResult = String.format(Translator.get("I18N_LOG_FORMAT_POSITION"), template);
|
||||||
return positionResult + result;
|
result = positionResult + result;
|
||||||
|
}
|
||||||
|
if (vo.getSourceType() == SysLogConstants.SOURCE_TYPE.LINK.getValue()) {
|
||||||
|
result = remarkInfo(vo, true) + result;
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String remarkInfo(SysLogWithBLOBs vo, Boolean isPrefix) {
|
||||||
|
|
||||||
public String remarkInfo(SysLogWithBLOBs vo) {
|
|
||||||
String remakrk = null;
|
String remakrk = null;
|
||||||
if ((remakrk = vo.getRemark()) != null) {
|
if ((remakrk = vo.getRemark()) != null) {
|
||||||
String targetTypeName = null;
|
String targetTypeName = null;
|
||||||
@ -77,14 +76,16 @@ public class LogManager {
|
|||||||
Integer targetType = item.getType();
|
Integer targetType = item.getType();
|
||||||
targetTypeName = SysLogConstants.sourceTypeName(targetType);
|
targetTypeName = SysLogConstants.sourceTypeName(targetType);
|
||||||
targetTypeName = Translator.get(targetTypeName);
|
targetTypeName = Translator.get(targetTypeName);
|
||||||
return String.format(format, targetTypeName, template);
|
if (isPrefix) {
|
||||||
|
return String.format(Translator.get("I18N_LOG_FORMAT_PREFIX"), targetTypeName, template);
|
||||||
|
}
|
||||||
|
return String.format(Translator.get("I18N_LOG_FORMAT"), targetTypeName, template);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private LogTypeItem parentIds(String id, Integer value) {
|
private LogTypeItem parentIds(String id, Integer value) {
|
||||||
LogTypeItem result = new LogTypeItem();
|
LogTypeItem result = new LogTypeItem();
|
||||||
String typeValue = "";
|
String typeValue = "";
|
||||||
@ -119,7 +120,7 @@ public class LogManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private List<FolderItem> parentInfos(List<String> ids, Integer value){
|
private List<FolderItem> parentInfos(List<String> ids, Integer value) {
|
||||||
List<FolderItem> folderItems = extSysLogMapper.idAndName(ids, value);
|
List<FolderItem> folderItems = extSysLogMapper.idAndName(ids, value);
|
||||||
if (value == 3) {
|
if (value == 3) {
|
||||||
folderItems.forEach(item -> {
|
folderItems.forEach(item -> {
|
||||||
@ -164,7 +165,7 @@ public class LogManager {
|
|||||||
ArrayList<DataSourceType> dataSourceTypes = new ArrayList<>(datasourceService.types());
|
ArrayList<DataSourceType> dataSourceTypes = new ArrayList<>(datasourceService.types());
|
||||||
String name = null;
|
String name = null;
|
||||||
for (int i = 0; i < dataSourceTypes.size(); i++) {
|
for (int i = 0; i < dataSourceTypes.size(); i++) {
|
||||||
if (dataSourceTypes.get(i).getType().equals(typeId)){
|
if (dataSourceTypes.get(i).getType().equals(typeId)) {
|
||||||
name = dataSourceTypes.get(i).getName();
|
name = dataSourceTypes.get(i).getName();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -9,6 +9,7 @@ import io.dataease.commons.constants.ParamConstants;
|
|||||||
import io.dataease.commons.constants.SysLogConstants;
|
import io.dataease.commons.constants.SysLogConstants;
|
||||||
import io.dataease.commons.utils.AuthUtils;
|
import io.dataease.commons.utils.AuthUtils;
|
||||||
import io.dataease.commons.utils.BeanUtils;
|
import io.dataease.commons.utils.BeanUtils;
|
||||||
|
import io.dataease.commons.utils.IPUtils;
|
||||||
import io.dataease.commons.utils.ServletUtils;
|
import io.dataease.commons.utils.ServletUtils;
|
||||||
import io.dataease.controller.sys.base.ConditionEntity;
|
import io.dataease.controller.sys.base.ConditionEntity;
|
||||||
import io.dataease.controller.sys.request.KeyGridRequest;
|
import io.dataease.controller.sys.request.KeyGridRequest;
|
||||||
@ -28,6 +29,7 @@ import org.apache.commons.lang3.ObjectUtils;
|
|||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.apache.poi.hssf.usermodel.*;
|
import org.apache.poi.hssf.usermodel.*;
|
||||||
import org.apache.poi.ss.usermodel.*;
|
import org.apache.poi.ss.usermodel.*;
|
||||||
|
import org.apache.poi.xssf.usermodel.*;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
@ -46,6 +48,8 @@ public class LogService {
|
|||||||
// 仪表板的额外操作 分享以及公共链接
|
// 仪表板的额外操作 分享以及公共链接
|
||||||
private static Integer[] panel_ext_ope = {4, 5, 8, 9, 10};
|
private static Integer[] panel_ext_ope = {4, 5, 8, 9, 10};
|
||||||
|
|
||||||
|
private static Integer[] link_ext_ope = {13, 14};
|
||||||
|
|
||||||
// 驱动文件操作 上传, 删除
|
// 驱动文件操作 上传, 删除
|
||||||
private static Integer[] driver_file_ope = {11, 3};
|
private static Integer[] driver_file_ope = {11, 3};
|
||||||
|
|
||||||
@ -247,6 +251,16 @@ public class LogService {
|
|||||||
results.add(folderItem);
|
results.add(folderItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (int i = 0; i < link_ext_ope.length; i++) {
|
||||||
|
SysLogConstants.SOURCE_TYPE sourceType = SysLogConstants.SOURCE_TYPE.LINK;
|
||||||
|
FolderItem folderItem = new FolderItem();
|
||||||
|
folderItem.setId(link_ext_ope[i] + "-" + sourceType.getValue());
|
||||||
|
String operateTypeName = SysLogConstants.operateTypeName(link_ext_ope[i]);
|
||||||
|
String sourceTypeName = sourceType.getName();
|
||||||
|
folderItem.setName(Translator.get(operateTypeName) + Translator.get(sourceTypeName));
|
||||||
|
results.add(folderItem);
|
||||||
|
}
|
||||||
|
|
||||||
FolderItem userLogin = new FolderItem();
|
FolderItem userLogin = new FolderItem();
|
||||||
SysLogConstants.OPERATE_TYPE operateTypeLogin = SysLogConstants.OPERATE_TYPE.LOGIN;
|
SysLogConstants.OPERATE_TYPE operateTypeLogin = SysLogConstants.OPERATE_TYPE.LOGIN;
|
||||||
SysLogConstants.SOURCE_TYPE sourceTypeLogin = SysLogConstants.SOURCE_TYPE.USER;
|
SysLogConstants.SOURCE_TYPE sourceTypeLogin = SysLogConstants.SOURCE_TYPE.USER;
|
||||||
@ -308,6 +322,7 @@ public class LogService {
|
|||||||
sysLogGridDTO.setTime(vo.getTime());
|
sysLogGridDTO.setTime(vo.getTime());
|
||||||
sysLogGridDTO.setUser(vo.getNickName());
|
sysLogGridDTO.setUser(vo.getNickName());
|
||||||
sysLogGridDTO.setDetail(logManager.detailInfo(vo));
|
sysLogGridDTO.setDetail(logManager.detailInfo(vo));
|
||||||
|
sysLogGridDTO.setIp(vo.getIp());
|
||||||
return sysLogGridDTO;
|
return sysLogGridDTO;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -330,12 +345,14 @@ public class LogService {
|
|||||||
sysLogWithBLOBs.setLoginName(sysLogDTO.getSourceName());
|
sysLogWithBLOBs.setLoginName(sysLogDTO.getSourceName());
|
||||||
sysLogWithBLOBs.setNickName(sysLogDTO.getSourceName());
|
sysLogWithBLOBs.setNickName(sysLogDTO.getSourceName());
|
||||||
}
|
}
|
||||||
|
sysLogWithBLOBs.setIp(IPUtils.get());
|
||||||
|
|
||||||
sysLogMapper.insert(sysLogWithBLOBs);
|
sysLogMapper.insert(sysLogWithBLOBs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void exportExcel(KeyGridRequest request) throws Exception {
|
public void exportExcel(KeyGridRequest request) throws Exception {
|
||||||
|
request = logRetentionProxy(request);
|
||||||
request = detailRequest(request);
|
request = detailRequest(request);
|
||||||
String keyWord = request.getKeyWord();
|
String keyWord = request.getKeyWord();
|
||||||
List<String> ids = null;
|
List<String> ids = null;
|
||||||
@ -355,24 +372,25 @@ public class LogService {
|
|||||||
List<String[]> details = lists.stream().map(item -> {
|
List<String[]> details = lists.stream().map(item -> {
|
||||||
String operateTypeName = SysLogConstants.operateTypeName(item.getOperateType());
|
String operateTypeName = SysLogConstants.operateTypeName(item.getOperateType());
|
||||||
String sourceTypeName = SysLogConstants.sourceTypeName(item.getSourceType());
|
String sourceTypeName = SysLogConstants.sourceTypeName(item.getSourceType());
|
||||||
String[] row = new String[4];
|
String[] row = new String[5];
|
||||||
row[0] = Translator.get(operateTypeName) + " " + Translator.get(sourceTypeName);
|
row[0] = Translator.get(operateTypeName) + " " + Translator.get(sourceTypeName);
|
||||||
row[1] = logManager.detailInfo(item);
|
row[1] = logManager.detailInfo(item);
|
||||||
row[2] = item.getNickName();
|
row[2] = item.getNickName();
|
||||||
row[3] = DateUtil.formatDateTime(new Date(item.getTime()));
|
row[3] = item.getIp();
|
||||||
|
row[4] = DateUtil.formatDateTime(new Date(item.getTime()));
|
||||||
return row;
|
return row;
|
||||||
}).collect(Collectors.toList());
|
}).collect(Collectors.toList());
|
||||||
String[] headArr = {"操作类型", "详情", "用户", "时间"};
|
String[] headArr = {"操作类型", "详情", "用户", "IP地址", "时间"};
|
||||||
details.add(0, headArr);
|
details.add(0, headArr);
|
||||||
|
|
||||||
|
|
||||||
HSSFWorkbook wb = new HSSFWorkbook();
|
XSSFWorkbook wb = new XSSFWorkbook();
|
||||||
//明细sheet
|
//明细sheet
|
||||||
HSSFSheet detailsSheet = wb.createSheet("数据");
|
XSSFSheet detailsSheet = wb.createSheet("数据");
|
||||||
|
|
||||||
//给单元格设置样式
|
//给单元格设置样式
|
||||||
CellStyle cellStyle = wb.createCellStyle();
|
XSSFCellStyle cellStyle = wb.createCellStyle();
|
||||||
Font font = wb.createFont();
|
XSSFFont font = wb.createFont();
|
||||||
//设置字体大小
|
//设置字体大小
|
||||||
font.setFontHeightInPoints((short) 12);
|
font.setFontHeightInPoints((short) 12);
|
||||||
//设置字体加粗
|
//设置字体加粗
|
||||||
@ -386,11 +404,11 @@ public class LogService {
|
|||||||
|
|
||||||
if (CollectionUtils.isNotEmpty(details)) {
|
if (CollectionUtils.isNotEmpty(details)) {
|
||||||
for (int i = 0; i < details.size(); i++) {
|
for (int i = 0; i < details.size(); i++) {
|
||||||
HSSFRow row = detailsSheet.createRow(i);
|
XSSFRow row = detailsSheet.createRow(i);
|
||||||
String[] rowData = details.get(i);
|
String[] rowData = details.get(i);
|
||||||
if (rowData != null) {
|
if (rowData != null) {
|
||||||
for (int j = 0; j < rowData.length; j++) {
|
for (int j = 0; j < rowData.length; j++) {
|
||||||
HSSFCell cell = row.createCell(j);
|
XSSFCell cell = row.createCell(j);
|
||||||
cell.setCellValue(rowData[j]);
|
cell.setCellValue(rowData[j]);
|
||||||
if (i == 0) {// 头部
|
if (i == 0) {// 头部
|
||||||
cell.setCellStyle(cellStyle);
|
cell.setCellStyle(cellStyle);
|
||||||
@ -406,7 +424,7 @@ public class LogService {
|
|||||||
//文件名称
|
//文件名称
|
||||||
String fileName = "DataEase操作日志";
|
String fileName = "DataEase操作日志";
|
||||||
String encodeFileName = URLEncoder.encode(fileName, "UTF-8");
|
String encodeFileName = URLEncoder.encode(fileName, "UTF-8");
|
||||||
response.setHeader("Content-disposition", "attachment;filename=" + encodeFileName + ".xls");
|
response.setHeader("Content-disposition", "attachment;filename=" + encodeFileName + ".xlsx");
|
||||||
wb.write(outputStream);
|
wb.write(outputStream);
|
||||||
outputStream.flush();
|
outputStream.flush();
|
||||||
outputStream.close();
|
outputStream.close();
|
||||||
|
4
backend/src/main/resources/db/migration/V44__1.17.sql
Normal file
4
backend/src/main/resources/db/migration/V44__1.17.sql
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
ALTER TABLE `sys_log`
|
||||||
|
CHANGE COLUMN `user_id` `user_id` BIGINT NULL COMMENT '操作人',
|
||||||
|
CHANGE COLUMN `login_name` `login_name` VARCHAR (255) NULL COMMENT '登录账号',
|
||||||
|
CHANGE COLUMN `nick_name` `nick_name` VARCHAR (255) NULL COMMENT '姓名';
|
@ -167,6 +167,7 @@ SOURCE_TYPE_ROLE=ROLE
|
|||||||
SOURCE_TYPE_DRIVER=DRIVER
|
SOURCE_TYPE_DRIVER=DRIVER
|
||||||
SOURCE_TYPE_DRIVER_FILE=DRIVER FILE
|
SOURCE_TYPE_DRIVER_FILE=DRIVER FILE
|
||||||
SOURCE_TYPE_MENU=MENU
|
SOURCE_TYPE_MENU=MENU
|
||||||
|
SOURCE_TYPE_LINK=PUBLIC LINK
|
||||||
I18N_OPERATE_TYPE=Operation type
|
I18N_OPERATE_TYPE=Operation type
|
||||||
I18N_DETAIL=Operation details
|
I18N_DETAIL=Operation details
|
||||||
I18N_USER=Operator
|
I18N_USER=Operator
|
||||||
@ -241,3 +242,7 @@ I18N_APP_NO_DATASOURCE=This panel don't have datasource
|
|||||||
I18N_APP_ONE_DATASOURCE_TIPS=This panel should have only one datasource
|
I18N_APP_ONE_DATASOURCE_TIPS=This panel should have only one datasource
|
||||||
I18N_PROHIBIT_SCANNING_TO_CREATE_USER=Prohibit scanning code to create user
|
I18N_PROHIBIT_SCANNING_TO_CREATE_USER=Prohibit scanning code to create user
|
||||||
|
|
||||||
|
I18N_LOG_FORMAT_POSITION=IN\u3010%s\u3011
|
||||||
|
I18N_LOG_FORMAT=TO %s\u3010%s\u3011
|
||||||
|
I18N_LOG_FORMAT_PREFIX=With authority of %s\u3010%s\u3011
|
||||||
|
|
||||||
|
@ -167,6 +167,7 @@ SOURCE_TYPE_ROLE=\u89D2\u8272
|
|||||||
SOURCE_TYPE_DRIVER=\u9A71\u52A8
|
SOURCE_TYPE_DRIVER=\u9A71\u52A8
|
||||||
SOURCE_TYPE_DRIVER_FILE=\u9A71\u52A8\u6587\u4EF6
|
SOURCE_TYPE_DRIVER_FILE=\u9A71\u52A8\u6587\u4EF6
|
||||||
SOURCE_TYPE_MENU=\u83DC\u5355
|
SOURCE_TYPE_MENU=\u83DC\u5355
|
||||||
|
SOURCE_TYPE_LINK=\u516C\u5171\u94FE\u63A5
|
||||||
I18N_OPERATE_TYPE=\u64CD\u4F5C\u7C7B\u578B
|
I18N_OPERATE_TYPE=\u64CD\u4F5C\u7C7B\u578B
|
||||||
I18N_DETAIL=\u64CD\u4F5C\u8BE6\u60C5
|
I18N_DETAIL=\u64CD\u4F5C\u8BE6\u60C5
|
||||||
I18N_USER=\u64CD\u4F5C\u4EBA
|
I18N_USER=\u64CD\u4F5C\u4EBA
|
||||||
@ -241,3 +242,7 @@ I18N_APP_NO_DATASOURCE=\u6CA1\u6709\u627E\u5230\u6570\u636E\u6E90
|
|||||||
I18N_APP_ONE_DATASOURCE_TIPS=\u8BE5\u4EEA\u8868\u677F\u53EA\u80FD\u5B58\u5728\u4E00\u4E2A\u6570\u636E\u6E90
|
I18N_APP_ONE_DATASOURCE_TIPS=\u8BE5\u4EEA\u8868\u677F\u53EA\u80FD\u5B58\u5728\u4E00\u4E2A\u6570\u636E\u6E90
|
||||||
I18N_PROHIBIT_SCANNING_TO_CREATE_USER=\u7981\u6B62\u626B\u7801\u521B\u5EFA\u7528\u6237\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\uFF01
|
I18N_PROHIBIT_SCANNING_TO_CREATE_USER=\u7981\u6B62\u626B\u7801\u521B\u5EFA\u7528\u6237\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\uFF01
|
||||||
|
|
||||||
|
I18N_LOG_FORMAT_POSITION=\u5728\u3010%s\u3011
|
||||||
|
I18N_LOG_FORMAT=\u7ED9%s\u3010%s\u3011
|
||||||
|
I18N_LOG_FORMAT_PREFIX=\u4EE5%s\u3010%s\u3011\u6743\u9650
|
||||||
|
|
||||||
|
@ -167,6 +167,7 @@ SOURCE_TYPE_ROLE=\u89D2\u8272
|
|||||||
SOURCE_TYPE_DRIVER=\u9A45\u52D5
|
SOURCE_TYPE_DRIVER=\u9A45\u52D5
|
||||||
SOURCE_TYPE_DRIVER_FILE=\u9A45\u52D5\u6587\u4EF6
|
SOURCE_TYPE_DRIVER_FILE=\u9A45\u52D5\u6587\u4EF6
|
||||||
SOURCE_TYPE_MENU=\u83DC\u55AE
|
SOURCE_TYPE_MENU=\u83DC\u55AE
|
||||||
|
SOURCE_TYPE_LINK=\u516C\u5171\u93C8\u63A5
|
||||||
I18N_DRIVER_NOT_DELETE=\u4F7F\u7528\u4E2D\u7684\u9A45\u52D5\u4E0D\u5141\u8A31\u5220\u9664
|
I18N_DRIVER_NOT_DELETE=\u4F7F\u7528\u4E2D\u7684\u9A45\u52D5\u4E0D\u5141\u8A31\u5220\u9664
|
||||||
I18N_DRIVER_REPEAT_NAME=\u540D\u7A31\u91CD\u8907
|
I18N_DRIVER_REPEAT_NAME=\u540D\u7A31\u91CD\u8907
|
||||||
I18N_DRIVER_NOT_FOUND=\u672A\u627E\u5230\u9A45\u52D5
|
I18N_DRIVER_NOT_FOUND=\u672A\u627E\u5230\u9A45\u52D5
|
||||||
@ -236,3 +237,7 @@ I18N_APP_ERROR_DATASET=\u5100\u8868\u677F\u4E2D\u4E0D\u80FD\u5B58\u5728API\u6578
|
|||||||
I18N_APP_NO_DATASOURCE=\u6C92\u6709\u627E\u5230\u6578\u64DA\u6E90
|
I18N_APP_NO_DATASOURCE=\u6C92\u6709\u627E\u5230\u6578\u64DA\u6E90
|
||||||
I18N_APP_ONE_DATASOURCE_TIPS=\u8A72\u5100\u8868\u677F\u53EA\u80FD\u5B58\u5728\u4E00\u500B\u6578\u64DA\u6E90
|
I18N_APP_ONE_DATASOURCE_TIPS=\u8A72\u5100\u8868\u677F\u53EA\u80FD\u5B58\u5728\u4E00\u500B\u6578\u64DA\u6E90
|
||||||
I18N_PROHIBIT_SCANNING_TO_CREATE_USER=\u7981\u6B62\u6383\u78BC\u5275\u5EFA\u7528\u6236\uFF0C\u8ACB\u806F\u7CFB\u7BA1\u7406\u54E1\uFF01
|
I18N_PROHIBIT_SCANNING_TO_CREATE_USER=\u7981\u6B62\u6383\u78BC\u5275\u5EFA\u7528\u6236\uFF0C\u8ACB\u806F\u7CFB\u7BA1\u7406\u54E1\uFF01
|
||||||
|
|
||||||
|
I18N_LOG_FORMAT_POSITION=\u5728\u3010%s\u3011
|
||||||
|
I18N_LOG_FORMAT=\u7D66%s\u3010%s\u3011
|
||||||
|
I18N_LOG_FORMAT_PREFIX=\u4EE5%s\u3010%s\u3011\u6B0A\u9650
|
||||||
|
@ -50,6 +50,15 @@ export function switchEnablePwd(data) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function viewLinkLog(data) {
|
||||||
|
return request({
|
||||||
|
url: 'api/link/viewLog',
|
||||||
|
method: 'post',
|
||||||
|
loading: true,
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
export function loadGenerate(resourceId) {
|
export function loadGenerate(resourceId) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/link/currentGenerate/' + resourceId,
|
url: 'api/link/currentGenerate/' + resourceId,
|
||||||
|
129
frontend/src/components/suspensionSelector/index.vue
Normal file
129
frontend/src/components/suspensionSelector/index.vue
Normal file
@ -0,0 +1,129 @@
|
|||||||
|
<template>
|
||||||
|
<div style="width: 100%;">
|
||||||
|
<el-col>
|
||||||
|
<el-form
|
||||||
|
ref="suspensionForm"
|
||||||
|
:model="suspensionForm"
|
||||||
|
label-width="80px"
|
||||||
|
size="mini"
|
||||||
|
>
|
||||||
|
<el-form-item
|
||||||
|
v-show="showProperty('show')"
|
||||||
|
:label="$t('chart.show')"
|
||||||
|
class="form-item"
|
||||||
|
>
|
||||||
|
<el-checkbox
|
||||||
|
v-model="suspensionForm.show"
|
||||||
|
@change="changeSuspensionAttr('show')"
|
||||||
|
>{{ $t('chart.show') }}
|
||||||
|
</el-checkbox>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
</el-form>
|
||||||
|
</el-col>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { DEFAULT_SUSPENSION } from '@/views/chart/chart/chart'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'SuspensionForm',
|
||||||
|
props: {
|
||||||
|
param: {
|
||||||
|
type: Object,
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
chart: {
|
||||||
|
type: Object,
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
propertyInner: {
|
||||||
|
type: Array,
|
||||||
|
required: false,
|
||||||
|
default: function() {
|
||||||
|
return []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
suspensionForm: JSON.parse(JSON.stringify(DEFAULT_SUSPENSION)),
|
||||||
|
fontSize: []
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
'chart': {
|
||||||
|
handler: function() {
|
||||||
|
this.initData()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.initData()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
initData() {
|
||||||
|
const chart = JSON.parse(JSON.stringify(this.chart))
|
||||||
|
if (chart.customAttr) {
|
||||||
|
let customAttr = null
|
||||||
|
if (Object.prototype.toString.call(chart.customAttr) === '[object Object]') {
|
||||||
|
customAttr = JSON.parse(JSON.stringify(chart.customAttr))
|
||||||
|
} else {
|
||||||
|
customAttr = JSON.parse(chart.customAttr)
|
||||||
|
}
|
||||||
|
if (customAttr.suspension) {
|
||||||
|
this.suspensionForm = customAttr.suspension
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
changeSuspensionAttr(modifyName) {
|
||||||
|
this.suspensionForm['modifyName'] = modifyName
|
||||||
|
this.$emit('onSuspensionChange', this.suspensionForm)
|
||||||
|
},
|
||||||
|
|
||||||
|
showProperty(property) {
|
||||||
|
return this.propertyInner.includes(property)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.shape-item{
|
||||||
|
padding: 6px;
|
||||||
|
border: none;
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
.form-item-slider ::v-deep .el-form-item__label{
|
||||||
|
font-size: 12px;
|
||||||
|
line-height: 38px;
|
||||||
|
}
|
||||||
|
.form-item ::v-deep .el-form-item__label{
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
.el-select-dropdown__item{
|
||||||
|
padding: 0 20px;
|
||||||
|
}
|
||||||
|
span{
|
||||||
|
font-size: 12px
|
||||||
|
}
|
||||||
|
.el-form-item{
|
||||||
|
margin-bottom: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.switch-style{
|
||||||
|
position: absolute;
|
||||||
|
right: 10px;
|
||||||
|
margin-top: -4px;
|
||||||
|
}
|
||||||
|
.color-picker-style{
|
||||||
|
cursor: pointer;
|
||||||
|
z-index: 1003;
|
||||||
|
}
|
||||||
|
</style>
|
@ -58,7 +58,7 @@ export default {
|
|||||||
mounted() {
|
mounted() {
|
||||||
if (!this.isFilterComponent) return
|
if (!this.isFilterComponent) return
|
||||||
this.typeTransform().forEach(item => {
|
this.typeTransform().forEach(item => {
|
||||||
const nodeCache = this.$refs.deOutWidget.$refs[item].$el.querySelector('.el-input__inner') || this.$refs.deOutWidget.$refs[item].$el
|
const nodeCache = this.$refs.deOutWidget?.$refs[item].$el.querySelector('.el-input__inner') || this.$refs.deOutWidget.$refs[item].$el
|
||||||
this.styleAttrs.forEach(ele => {
|
this.styleAttrs.forEach(ele => {
|
||||||
nodeCache.style[this.attrsMap[ele]] = this.element.style[ele]
|
nodeCache.style[this.attrsMap[ele]] = this.element.style[ele]
|
||||||
this[this.element.serviceName] && this[this.element.serviceName](this.selectRange(item), ele, this.element.style[ele])
|
this[this.element.serviceName] && this[this.element.serviceName](this.selectRange(item), ele, this.element.style[ele])
|
||||||
@ -70,7 +70,7 @@ export default {
|
|||||||
let nodeCache = ''
|
let nodeCache = ''
|
||||||
this.styleAttrs.forEach(ele => {
|
this.styleAttrs.forEach(ele => {
|
||||||
if (!nodeCache) {
|
if (!nodeCache) {
|
||||||
nodeCache = this.$refs.deOutWidget.$refs[type].$el.querySelector('.el-input__inner') || this.$refs.deOutWidget.$refs[type].$el
|
nodeCache = this.$refs.deOutWidget?.$refs[type].$el.querySelector('.el-input__inner') || this.$refs.deOutWidget.$refs[type].$el
|
||||||
}
|
}
|
||||||
nodeCache.style[this.attrsMap[ele]] = newValue[ele]
|
nodeCache.style[this.attrsMap[ele]] = newValue[ele]
|
||||||
this[this.element.serviceName] && this[this.element.serviceName](this.selectRange(type), ele, newValue[ele])
|
this[this.element.serviceName] && this[this.element.serviceName](this.selectRange(type), ele, newValue[ele])
|
||||||
|
@ -915,6 +915,7 @@ export default {
|
|||||||
password_input_error: 'Original password input error'
|
password_input_error: 'Original password input error'
|
||||||
},
|
},
|
||||||
chart: {
|
chart: {
|
||||||
|
suspension: 'Suspension',
|
||||||
chart_background: 'Component background',
|
chart_background: 'Component background',
|
||||||
solid_color: 'Solid color',
|
solid_color: 'Solid color',
|
||||||
split_gradient: 'Split gradient',
|
split_gradient: 'Split gradient',
|
||||||
@ -2605,7 +2606,8 @@ export default {
|
|||||||
time: 'Time',
|
time: 'Time',
|
||||||
export: 'Export',
|
export: 'Export',
|
||||||
confirm: 'Sure Export ?',
|
confirm: 'Sure Export ?',
|
||||||
search_by_key: 'Search by key'
|
search_by_key: 'Search by key',
|
||||||
|
ip: 'IP'
|
||||||
},
|
},
|
||||||
plugin_style: {
|
plugin_style: {
|
||||||
border: 'Border'
|
border: 'Border'
|
||||||
|
@ -915,6 +915,7 @@ export default {
|
|||||||
password_input_error: '原始密碼輸入錯誤'
|
password_input_error: '原始密碼輸入錯誤'
|
||||||
},
|
},
|
||||||
chart: {
|
chart: {
|
||||||
|
suspension: '懸浮',
|
||||||
chart_background: '組件背景',
|
chart_background: '組件背景',
|
||||||
solid_color: '純色',
|
solid_color: '純色',
|
||||||
split_gradient: '分離漸變',
|
split_gradient: '分離漸變',
|
||||||
@ -2606,7 +2607,8 @@ export default {
|
|||||||
time: '操作時間',
|
time: '操作時間',
|
||||||
export: '導出',
|
export: '導出',
|
||||||
confirm: '確定導出嗎?',
|
confirm: '確定導出嗎?',
|
||||||
search_by_key: '搜索詳情'
|
search_by_key: '搜索詳情',
|
||||||
|
ip: 'IP地址'
|
||||||
},
|
},
|
||||||
plugin_style: {
|
plugin_style: {
|
||||||
border: '邊框'
|
border: '邊框'
|
||||||
|
@ -914,6 +914,7 @@ export default {
|
|||||||
password_input_error: '原始密码输入错误'
|
password_input_error: '原始密码输入错误'
|
||||||
},
|
},
|
||||||
chart: {
|
chart: {
|
||||||
|
suspension: '悬浮',
|
||||||
chart_background: '组件背景',
|
chart_background: '组件背景',
|
||||||
solid_color: '纯色',
|
solid_color: '纯色',
|
||||||
split_gradient: '分离渐变',
|
split_gradient: '分离渐变',
|
||||||
@ -2606,7 +2607,8 @@ export default {
|
|||||||
time: '操作时间',
|
time: '操作时间',
|
||||||
export: '导出',
|
export: '导出',
|
||||||
confirm: '确定导出吗?',
|
confirm: '确定导出吗?',
|
||||||
search_by_key: '搜索详情'
|
search_by_key: '搜索详情',
|
||||||
|
ip: 'IP地址'
|
||||||
},
|
},
|
||||||
plugin_style: {
|
plugin_style: {
|
||||||
border: '边框'
|
border: '边框'
|
||||||
|
@ -124,6 +124,9 @@ export const DEFAULT_SIZE = {
|
|||||||
showIndex: false,
|
showIndex: false,
|
||||||
indexLabel: '序号'
|
indexLabel: '序号'
|
||||||
}
|
}
|
||||||
|
export const DEFAULT_SUSPENSION = {
|
||||||
|
show: true
|
||||||
|
}
|
||||||
export const DEFAULT_LABEL = {
|
export const DEFAULT_LABEL = {
|
||||||
show: false,
|
show: false,
|
||||||
position: 'top',
|
position: 'top',
|
||||||
|
@ -125,6 +125,11 @@ export function baseMapOption(chart_option, chart, themeStyle, curAreaCode) {
|
|||||||
if (themeStyle) {
|
if (themeStyle) {
|
||||||
chart_option.visualMap.textStyle = { color: themeStyle }
|
chart_option.visualMap.textStyle = { color: themeStyle }
|
||||||
}
|
}
|
||||||
|
if (customAttr.suspension && !customAttr.suspension.show) {
|
||||||
|
chart_option.visualMap.show = false
|
||||||
|
} else if ('show' in chart_option.visualMap) {
|
||||||
|
delete chart_option.visualMap.show
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (let i = 0; i < valueArr.length; i++) {
|
for (let i = 0; i < valueArr.length; i++) {
|
||||||
|
@ -3073,7 +3073,8 @@ export const TYPE_CONFIGS = [
|
|||||||
'color-selector',
|
'color-selector',
|
||||||
'label-selector',
|
'label-selector',
|
||||||
'tooltip-selector',
|
'tooltip-selector',
|
||||||
'title-selector'
|
'title-selector',
|
||||||
|
'suspension-selector'
|
||||||
],
|
],
|
||||||
propertyInner: {
|
propertyInner: {
|
||||||
|
|
||||||
@ -3107,6 +3108,9 @@ export const TYPE_CONFIGS = [
|
|||||||
'vPosition',
|
'vPosition',
|
||||||
'isItalic',
|
'isItalic',
|
||||||
'isBolder'
|
'isBolder'
|
||||||
|
],
|
||||||
|
'suspension-selector': [
|
||||||
|
'show'
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
:style="{ borderRadius: borderRadius}"
|
:style="{ borderRadius: borderRadius}"
|
||||||
/>
|
/>
|
||||||
<div
|
<div
|
||||||
v-if="chart.type === 'map'"
|
v-if="chart.type === 'map' && showSuspension"
|
||||||
class="map-zoom-box"
|
class="map-zoom-box"
|
||||||
>
|
>
|
||||||
<div style="margin-bottom: 0.5em;">
|
<div style="margin-bottom: 0.5em;">
|
||||||
@ -143,7 +143,8 @@ export default {
|
|||||||
mapCenter: null,
|
mapCenter: null,
|
||||||
linkageActiveParam: null,
|
linkageActiveParam: null,
|
||||||
buttonTextColor: null,
|
buttonTextColor: null,
|
||||||
loading: true
|
loading: true,
|
||||||
|
showSuspension: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -318,6 +319,9 @@ export default {
|
|||||||
}
|
}
|
||||||
if (chart.type === 'map') {
|
if (chart.type === 'map') {
|
||||||
const customAttr = JSON.parse(chart.customAttr)
|
const customAttr = JSON.parse(chart.customAttr)
|
||||||
|
if (customAttr.suspension) {
|
||||||
|
this.showSuspension = customAttr.suspension.show
|
||||||
|
}
|
||||||
if (!customAttr.areaCode) {
|
if (!customAttr.areaCode) {
|
||||||
this.myChart.clear()
|
this.myChart.clear()
|
||||||
return
|
return
|
||||||
|
@ -951,6 +951,7 @@
|
|||||||
@onLegendChange="onLegendChange"
|
@onLegendChange="onLegendChange"
|
||||||
@onMarginChange="onMarginChange"
|
@onMarginChange="onMarginChange"
|
||||||
@onChangeBackgroundForm="onChangeBackgroundForm"
|
@onChangeBackgroundForm="onChangeBackgroundForm"
|
||||||
|
@onSuspensionChange="onSuspensionChange"
|
||||||
/>
|
/>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane
|
<el-tab-pane
|
||||||
@ -2415,6 +2416,10 @@ export default {
|
|||||||
this.view.customAttr.color = val
|
this.view.customAttr.color = val
|
||||||
this.calcStyle('color')
|
this.calcStyle('color')
|
||||||
},
|
},
|
||||||
|
onSuspensionChange(val) {
|
||||||
|
this.view.customAttr.suspension = val
|
||||||
|
this.calcStyle()
|
||||||
|
},
|
||||||
|
|
||||||
onSizeChange(val) {
|
onSizeChange(val) {
|
||||||
this.view.customAttr.size = val
|
this.view.customAttr.size = val
|
||||||
|
@ -121,6 +121,19 @@
|
|||||||
@onTotalCfgChange="onTotalCfgChange($event,'total-cfg')"
|
@onTotalCfgChange="onTotalCfgChange($event,'total-cfg')"
|
||||||
/>
|
/>
|
||||||
</el-collapse-item>
|
</el-collapse-item>
|
||||||
|
<el-collapse-item
|
||||||
|
v-show="showPropertiesCollapse(['suspension-selector'])"
|
||||||
|
name="suspension"
|
||||||
|
:title="$t('chart.suspension')"
|
||||||
|
>
|
||||||
|
<suspension-selector
|
||||||
|
:param="param"
|
||||||
|
class="attr-selector"
|
||||||
|
:chart="chart"
|
||||||
|
:property-inner="propertyInnerAll['suspension-selector']"
|
||||||
|
@onSuspensionChange="onSuspensionChange($event,'suspension-selector')"
|
||||||
|
/>
|
||||||
|
</el-collapse-item>
|
||||||
</el-collapse>
|
</el-collapse>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row class="de-collapse-style">
|
<el-row class="de-collapse-style">
|
||||||
@ -317,6 +330,7 @@ import LegendSelectorAntV from '@/views/chart/components/componentStyle/LegendSe
|
|||||||
import BackgroundColorSelector from '@/views/chart/components/componentStyle/BackgroundColorSelector'
|
import BackgroundColorSelector from '@/views/chart/components/componentStyle/BackgroundColorSelector'
|
||||||
import SplitSelector from '@/views/chart/components/componentStyle/SplitSelector'
|
import SplitSelector from '@/views/chart/components/componentStyle/SplitSelector'
|
||||||
import SplitSelectorAntV from '@/views/chart/components/componentStyle/SplitSelectorAntV'
|
import SplitSelectorAntV from '@/views/chart/components/componentStyle/SplitSelectorAntV'
|
||||||
|
import SuspensionSelector from '@/components/suspensionSelector'
|
||||||
import { mapState } from 'vuex'
|
import { mapState } from 'vuex'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@ -344,7 +358,8 @@ export default {
|
|||||||
SizeSelector,
|
SizeSelector,
|
||||||
ColorSelector,
|
ColorSelector,
|
||||||
MarginSelector,
|
MarginSelector,
|
||||||
PluginCom
|
PluginCom,
|
||||||
|
SuspensionSelector
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
chart: {
|
chart: {
|
||||||
@ -422,6 +437,10 @@ export default {
|
|||||||
val['propertyName'] = propertyName
|
val['propertyName'] = propertyName
|
||||||
this.$emit('onColorChange', val)
|
this.$emit('onColorChange', val)
|
||||||
},
|
},
|
||||||
|
onSuspensionChange(val, propertyName) {
|
||||||
|
val['propertyName'] = propertyName
|
||||||
|
this.$emit('onSuspensionChange', val)
|
||||||
|
},
|
||||||
onSizeChange(val, propertyName) {
|
onSizeChange(val, propertyName) {
|
||||||
val['propertyName'] = propertyName
|
val['propertyName'] = propertyName
|
||||||
this.$emit('onSizeChange', val)
|
this.$emit('onSizeChange', val)
|
||||||
|
@ -462,21 +462,27 @@ export default {
|
|||||||
this.showExport = false
|
this.showExport = false
|
||||||
},
|
},
|
||||||
exportDatasetRequest() {
|
exportDatasetRequest() {
|
||||||
if (this.table.id) {
|
this.$refs['exportForm'].validate((valid) => {
|
||||||
this.table.row = 100000
|
if (valid) {
|
||||||
this.table.filename = this.exportForm.name
|
if (this.table.id) {
|
||||||
this.table.expressionTree = this.exportForm.expressionTree
|
this.table.row = 100000
|
||||||
exportDataset(this.table).then((res) => {
|
this.table.filename = this.exportForm.name
|
||||||
const blob = new Blob([res], { type: 'application/vnd.ms-excel' })
|
this.table.expressionTree = this.exportForm.expressionTree
|
||||||
const link = document.createElement('a')
|
exportDataset(this.table).then((res) => {
|
||||||
link.style.display = 'none'
|
const blob = new Blob([res], { type: 'application/vnd.ms-excel' })
|
||||||
link.href = URL.createObjectURL(blob)
|
const link = document.createElement('a')
|
||||||
link.download = this.exportForm.name + '.xlsx' // 下载的文件名
|
link.style.display = 'none'
|
||||||
document.body.appendChild(link)
|
link.href = URL.createObjectURL(blob)
|
||||||
link.click()
|
link.download = this.exportForm.name + '.xlsx' // 下载的文件名
|
||||||
document.body.removeChild(link)
|
document.body.appendChild(link)
|
||||||
})
|
link.click()
|
||||||
}
|
document.body.removeChild(link)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { loadResource } from '@/api/link'
|
import { loadResource, viewLinkLog } from '@/api/link'
|
||||||
|
import { isMobile } from '@/utils/index'
|
||||||
import { uuid } from 'vue-uuid'
|
import { uuid } from 'vue-uuid'
|
||||||
import Preview from '@/components/canvas/components/editor/Preview'
|
import Preview from '@/components/canvas/components/editor/Preview'
|
||||||
import { getPanelAllLinkageInfo } from '@/api/panel/linkage'
|
import { getPanelAllLinkageInfo } from '@/api/panel/linkage'
|
||||||
@ -50,8 +51,19 @@ export default {
|
|||||||
created() {
|
created() {
|
||||||
this.show = false
|
this.show = false
|
||||||
this.setPanelInfo()
|
this.setPanelInfo()
|
||||||
|
this.viewLog()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
viewLog() {
|
||||||
|
const param = {
|
||||||
|
panelId: this.resourceId,
|
||||||
|
userId: this.user,
|
||||||
|
mobile: !!isMobile()
|
||||||
|
}
|
||||||
|
viewLinkLog(param).then(res => {
|
||||||
|
|
||||||
|
})
|
||||||
|
},
|
||||||
setPanelInfo() {
|
setPanelInfo() {
|
||||||
loadResource(this.resourceId).then(res => {
|
loadResource(this.resourceId).then(res => {
|
||||||
this.show = false
|
this.show = false
|
||||||
|
@ -95,7 +95,7 @@
|
|||||||
show-overflow-tooltip
|
show-overflow-tooltip
|
||||||
prop="opType"
|
prop="opType"
|
||||||
:label="$t('log.optype')"
|
:label="$t('log.optype')"
|
||||||
width="140"
|
width="160"
|
||||||
>
|
>
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<span>{{ row.opType + row.sourceType }}</span>
|
<span>{{ row.opType + row.sourceType }}</span>
|
||||||
@ -112,6 +112,12 @@
|
|||||||
:label="$t('log.user')"
|
:label="$t('log.user')"
|
||||||
width="100"
|
width="100"
|
||||||
/>
|
/>
|
||||||
|
<el-table-column
|
||||||
|
show-overflow-tooltip
|
||||||
|
prop="ip"
|
||||||
|
:label="$t('log.ip')"
|
||||||
|
width="100"
|
||||||
|
/>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
show-overflow-tooltip
|
show-overflow-tooltip
|
||||||
prop="time"
|
prop="time"
|
||||||
@ -204,7 +210,7 @@ export default {
|
|||||||
const link = document.createElement('a')
|
const link = document.createElement('a')
|
||||||
link.style.display = 'none'
|
link.style.display = 'none'
|
||||||
link.href = URL.createObjectURL(blob)
|
link.href = URL.createObjectURL(blob)
|
||||||
link.download = 'DataEase操作日志.xls' // 下载的文件名
|
link.download = 'DataEase操作日志.xlsx' // 下载的文件名
|
||||||
document.body.appendChild(link)
|
document.body.appendChild(link)
|
||||||
link.click()
|
link.click()
|
||||||
document.body.removeChild(link)
|
document.body.removeChild(link)
|
||||||
|
Loading…
Reference in New Issue
Block a user