Merge branch 'dev' into pr@dev@variable

This commit is contained in:
taojinlong 2021-12-10 23:21:01 +08:00
commit 14536b648a
63 changed files with 1748 additions and 194 deletions

View File

@ -2,12 +2,6 @@ FROM registry.cn-qingdao.aliyuncs.com/dataease/fabric8-java-alpine-openjdk8-jre
ARG IMAGE_TAG
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
RUN apk add chromium=77.0.3865.120-r0 --no-cache
RUN apk add chromium-chromedriver=77.0.3865.120-r0 --no-cache
RUN mkdir -p /opt/apps
RUN mkdir -p /opt/dataease/data/feature/full

View File

@ -0,0 +1,18 @@
package io.dataease.base.mapper.ext;
import io.dataease.mobile.entity.PanelEntity;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface MobileDirMapper {
List<PanelEntity> query(String pid);
List<PanelEntity> queryWithName(String name);
List<String> idsWithUser(String userId);
List<String> idsWithDept(String deptId);
List<String> idsWithRoles(@Param("roleIds") List<String> roleIds);
}

View File

@ -0,0 +1,74 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="io.dataease.base.mapper.ext.MobileDirMapper">
<select id="query" resultType="io.dataease.mobile.entity.PanelEntity">
select
id,
name as text,
pid,
node_type as `type`
from panel_group g
where pid = #{pid} and g.mobile_layout = 1
</select>
<select id="queryWithName" resultType="io.dataease.mobile.entity.PanelEntity">
select
id,
name as text,
pid,
node_type as `type`
from panel_group g
where g.mobile_layout = 1
<if test="name != null">
and name like CONCAT('%', #{name, jdbcType=VARCHAR}, '%')
</if>
</select>
<select id="idsWithUser" resultType="java.lang.String">
select a.auth_source
from sys_auth a
left join sys_auth_detail d on a.id = d.auth_id
where
a.auth_target_type = 'user' and
a.auth_target = #{userId} and
a.auth_source_type = 'panel' and
d.privilege_type = 1 and
d.privilege_value = 1
</select>
<select id="idsWithDept" resultType="java.lang.String">
select a.auth_source
from sys_auth a
left join sys_auth_detail d on a.id = d.auth_id
where
a.auth_target_type = 'dept' and
a.auth_target = #{deptId} and
a.auth_source_type = 'panel' and
d.privilege_type = 1 and
d.privilege_value = 1
</select>
<select id="idsWithRoles" resultType="java.lang.String">
select a.auth_source
from sys_auth a
left join sys_auth_detail d on a.id = d.auth_id
where
a.auth_target_type = 'role' and
a.auth_target in
<foreach collection="roleIds" item="roleId" open='(' separator=',' close=')'>
#{roleId}
</foreach>
and
a.auth_source_type = 'panel' and
d.privilege_type = 1 and
d.privilege_value = 1
</select>
</mapper>

View File

@ -0,0 +1,8 @@
package io.dataease.base.mapper.ext;
import io.dataease.mobile.dto.MeItemDTO;
public interface MobileMeMapper {
MeItemDTO query(Long userId);
}

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="io.dataease.base.mapper.ext.MobileMeMapper">
<select id="query" resultType="io.dataease.mobile.dto.MeItemDTO">
select
d.name as dept_name,
u.create_time
from sys_user u
left join sys_dept d on d.dept_id = u.dept_id
where u.user_id = #{userId}
</select>
</mapper>

View File

@ -1,7 +1,9 @@
package io.dataease.controller;
import io.dataease.commons.exception.DEException;
import io.dataease.commons.license.DefaultLicenseService;
import io.dataease.commons.license.F2CLicenseResponse;
import io.dataease.commons.utils.LogUtil;
import io.dataease.commons.utils.ServletUtils;
import io.dataease.service.panel.PanelLinkService;
import org.springframework.stereotype.Controller;
@ -11,6 +13,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import javax.annotation.Resource;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
@Controller
@RequestMapping
@ -45,13 +48,15 @@ public class IndexController {
}
@GetMapping("/link/{index}")
public String link(@PathVariable(value = "index", required = true) Long index) {
public void link(@PathVariable(value = "index", required = true) Long index) {
String url = panelLinkService.getUrlByIndex(index);
HttpServletResponse response = ServletUtils.response();
String param = url.substring(url.indexOf("?") + 1);
Cookie cookie = new Cookie("link", param.split("=")[1]);
response.addCookie(cookie);
return url;
try {
response.sendRedirect(url);
} catch (IOException e) {
LogUtil.error(e.getMessage());
DEException.throwException(e);
}
}

View File

@ -32,7 +32,12 @@ public interface StoreApi {
@ApiOperation("移除收藏")
@PostMapping("/remove/{storeId}")
void remove(@PathVariable("storeId") String storeId);
@PostMapping("/remove/{panelId}")
void remove(@PathVariable("panelId") String panelId);
@ApiOperation("收藏状态")
@PostMapping("/status/{id}")
Boolean hasStar(@PathVariable("id") String id);
}

View File

@ -29,4 +29,9 @@ public class StoreServer implements StoreApi {
public void remove(String panelId) {
storeService.removeByPanelId(panelId);
}
@Override
public Boolean hasStar(String id) {
return storeService.count(id) > 0L;
}
}

View File

@ -0,0 +1,21 @@
package io.dataease.dto.chart;
import lombok.Data;
import java.util.List;
/**
* @Author gin
* @Date 2021/12/9 2:48 下午
*/
@Data
public class ChartFieldCompareCustomDTO {
private String field;
private String calcType;
private String timeType;
private String currentTime;
private String compareTime;
private List<String> currentTimeRange;
private List<String> compareTimeRange;
}

View File

@ -0,0 +1,15 @@
package io.dataease.dto.chart;
import lombok.Data;
/**
* @Author gin
* @Date 2021/12/9 2:48 下午
*/
@Data
public class ChartFieldCompareDTO {
private String type;
private String resultData;
private String field;
private ChartFieldCompareCustomDTO custom;
}

View File

@ -46,4 +46,6 @@ public class ChartViewFieldDTO implements Serializable {
private Integer extField;
private String chartType;
private ChartFieldCompareDTO compareCalc;
}

View File

@ -0,0 +1,22 @@
package io.dataease.mobile.api;
import io.dataease.mobile.dto.DirItemDTO;
import io.dataease.mobile.dto.DirRequest;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import java.util.List;
@Api(tags = "移动端:目录")
@RequestMapping("/mobile/dir")
public interface DirApi {
@ApiOperation("查询")
@PostMapping("/query")
List<DirItemDTO> query(@RequestBody DirRequest request);
}

View File

@ -0,0 +1,18 @@
package io.dataease.mobile.api;
import io.dataease.mobile.dto.MeItemDTO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
@Api(tags = "移动端:我的")
@RequestMapping("/mobile/me")
public interface MeApi {
@ApiOperation("查询个人信息")
@PostMapping("/query")
MeItemDTO query();
}

View File

@ -0,0 +1,21 @@
package io.dataease.mobile.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
@Data
@ApiModel("目录数据实体")
public class DirItemDTO implements Serializable {
@ApiModelProperty("ID")
private String id;
@ApiModelProperty("名称")
private String text;
@ApiModelProperty(value = "类型", allowableValues = "{@code folder, panel}")
private String type;
@ApiModelProperty("子集数")
private Integer subs;
}

View File

@ -0,0 +1,19 @@
package io.dataease.mobile.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
@Data
@ApiModel("目录查询条件")
public class DirRequest implements Serializable {
@ApiModelProperty("父ID")
private String pid;
@ApiModelProperty("名称")
private String name;
}

View File

@ -0,0 +1,16 @@
package io.dataease.mobile.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
@Data
@ApiModel("个人信息")
public class MeItemDTO implements Serializable {
@ApiModelProperty("组织名称")
private String deptName;
@ApiModelProperty("创建时间")
private Long createTime;
}

View File

@ -0,0 +1,17 @@
package io.dataease.mobile.entity;
import lombok.Data;
import java.io.Serializable;
@Data
public class PanelEntity implements Serializable {
private String id;
private String text;
private String pid;
private String type;
}

View File

@ -0,0 +1,22 @@
package io.dataease.mobile.server;
import io.dataease.mobile.api.DirApi;
import io.dataease.mobile.dto.DirItemDTO;
import io.dataease.mobile.dto.DirRequest;
import io.dataease.mobile.service.DirService;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;
@RestController
public class DirServer implements DirApi {
@Resource
private DirService dirService;
@Override
public List<DirItemDTO> query(DirRequest request) {
return dirService.query(request);
}
}

View File

@ -0,0 +1,19 @@
package io.dataease.mobile.server;
import io.dataease.mobile.api.MeApi;
import io.dataease.mobile.dto.MeItemDTO;
import io.dataease.mobile.service.MeService;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
@RestController
public class MeServer implements MeApi {
@Resource
private MeService meService;
@Override
public MeItemDTO query() {
return meService.personInfo();
}
}

View File

@ -0,0 +1,77 @@
package io.dataease.mobile.service;
import io.dataease.auth.api.dto.CurrentUserDto;
import io.dataease.base.mapper.ext.MobileDirMapper;
import io.dataease.commons.utils.AuthUtils;
import io.dataease.commons.utils.CommonBeanFactory;
import io.dataease.mobile.dto.DirItemDTO;
import io.dataease.mobile.dto.DirRequest;
import io.dataease.mobile.entity.PanelEntity;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
@Service
public class DirService {
@Resource
private MobileDirMapper mobileDirMapper;
public List<String> permissions() {
CurrentUserDto user = AuthUtils.getUser();
Long userId = user.getUserId();
Long deptId = user.getDeptId();
List<String> roles = user.getRoles().stream().map(item -> item.getId().toString()).collect(Collectors.toList());
List<String> idsWithUser = mobileDirMapper.idsWithUser(userId.toString());
List<String> idsWithDept = mobileDirMapper.idsWithDept(deptId.toString());
List<String> idsWithRoles = mobileDirMapper.idsWithRoles(roles);
List<String> panelIds = new ArrayList<>();
panelIds.addAll(idsWithUser);
panelIds.addAll(idsWithDept);
panelIds.addAll(idsWithRoles);
return panelIds.stream().distinct().collect(Collectors.toList());
}
public List<DirItemDTO> query(DirRequest request) {
CurrentUserDto user = AuthUtils.getUser();
List<PanelEntity> panelEntities = new ArrayList<>();
if (StringUtils.isNotBlank(request.getName())) {
panelEntities = mobileDirMapper.queryWithName(request.getName());
}else {
panelEntities = mobileDirMapper.query(request.getPid());
}
if (CollectionUtils.isEmpty(panelEntities)) return null;
List<DirItemDTO> dtos = panelEntities.stream().map(data -> {
DirItemDTO dirItemDTO = new DirItemDTO();
dirItemDTO.setId(data.getId());
dirItemDTO.setText(data.getText());
dirItemDTO.setType(data.getType());
return dirItemDTO;
}).collect(Collectors.toList());
if (user.getUserId() == 1 && StringUtils.equals("admin", user.getUsername())) {
return dtos;
}
List<String> permissions = proxy().permissions();
return dtos.stream().filter(
dto -> permissions.stream().anyMatch(
permission -> StringUtils.equals(permission, dto.getId())
)
).collect(Collectors.toList());
}
public DirService proxy() {
return CommonBeanFactory.getBean(DirService.class);
}
}

View File

@ -7,7 +7,6 @@ import io.dataease.mobile.dto.HomeItemDTO;
import io.dataease.base.mapper.ext.HomeMapper;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -20,15 +19,11 @@ public class HomeService {
private HomeMapper homeMapper;
public List<HomeItemDTO> query(Integer type) {
List<HomeItemDTO> result = new ArrayList<>();
CurrentUserDto user = AuthUtils.getUser();
switch (type){
case 0:
result = homeMapper.queryStore(user.getUserId());
break;
case 1:
result = homeMapper.queryHistory();
break;
return homeMapper.queryHistory();
case 2:
Map<String, Object> param = new HashMap<>();
Long deptId = user.getDeptId();
@ -36,9 +31,10 @@ public class HomeService {
param.put("userId", user.getUserId());
param.put("deptId", deptId);
param.put("roleIds", roleIds);
result = homeMapper.queryShare(param);
break;
List<HomeItemDTO> result = homeMapper.queryShare(param);
return result;
default:
return homeMapper.queryStore(user.getUserId());
}
return result;
}
}

View File

@ -0,0 +1,19 @@
package io.dataease.mobile.service;
import io.dataease.base.mapper.ext.MobileMeMapper;
import io.dataease.commons.utils.AuthUtils;
import io.dataease.mobile.dto.MeItemDTO;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@Service
public class MeService {
@Resource
private MobileMeMapper mobileMeMapper;
public MeItemDTO personInfo() {
return mobileMeMapper.query(AuthUtils.getUser().getUserId());
}
}

View File

@ -0,0 +1,13 @@
package io.dataease.service.chart;
/**
* @Author gin
* @Date 2021/12/9 3:58 下午
*/
public class ChartConstants {
public static final String YEAR_MOM = "year_mom";
public static final String MONTH_MOM = "month_mom";
public static final String YEAR_YOY = "year_yoy";
public static final String DAY_MOM = "day_mom";
public static final String MONTH_YOY = "month_yoy";
}

View File

@ -36,6 +36,7 @@ import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.locks.ReentrantLock;
import java.util.stream.Collectors;
@ -433,6 +434,88 @@ public class ChartViewService {
}
}
// 同比/环比计算通过对比类型和数据设置计算出对应指标的结果然后替换结果data数组中的对应元素
// 如果因维度变化如时间字段缺失时间字段的展示格式变化导致无法计算结果的则结果data数组中的对应元素全置为null
// 根据不同图表类型获得需要替换的指标index array
for (int i = 0; i < yAxis.size(); i++) {
ChartViewFieldDTO chartViewFieldDTO = yAxis.get(i);
ChartFieldCompareDTO compareCalc = chartViewFieldDTO.getCompareCalc();
if (ObjectUtils.isEmpty(compareCalc)) {
continue;
}
if (StringUtils.isNotEmpty(compareCalc.getType())
&& !StringUtils.equalsIgnoreCase(compareCalc.getType(), "none")) {
String compareFieldId = compareCalc.getField();// 选中字段
String resultData = compareCalc.getResultData();// 数据设置
// 获取选中字段以及下标
List<ChartViewFieldDTO> checkedField = new ArrayList<>(xAxis);
if (StringUtils.containsIgnoreCase(view.getType(), "stack")) {
checkedField.addAll(extStack);
}
int timeIndex = 0;// 时间字段下标
ChartViewFieldDTO timeField = null;
for (int j = 0; j < checkedField.size(); j++) {
if (StringUtils.equalsIgnoreCase(checkedField.get(j).getId(), compareFieldId)) {
timeIndex = j;
timeField = checkedField.get(j);
}
}
// 计算指标对应的下标
int dataIndex = 0;// 数据字段下标
if (StringUtils.containsIgnoreCase(view.getType(), "stack")) {
dataIndex = xAxis.size() + extStack.size() + i;
} else {
dataIndex = xAxis.size() + i;
}
// 无选中字段或者选中字段已经不在维度list中或者选中字段日期格式不符合对比类型的直接将对应数据置为null
if (ObjectUtils.isEmpty(timeField) || !checkCalcType(timeField.getDateStyle(), compareCalc.getType())) {
// set null
for (String[] item : data) {
item[dataIndex] = null;
}
} else {
// 计算 同比/环比
// 1处理当期数据2根据type计算上一期数据3根据resultData计算结果
Map<String, String> currentMap = new LinkedHashMap<>();
for (String[] item : data) {
String[] dimension = Arrays.copyOfRange(item, 0, checkedField.size());
currentMap.put(StringUtils.join(dimension, "-"), item[dataIndex]);
}
for (int index = 0; index < data.size(); index++) {
String[] item = data.get(index);
String cTime = item[timeIndex];
String cValue = item[dataIndex];
// 获取计算后的时间并且与所有维度拼接
String lastTime = calcLastTime(cTime, compareCalc.getType(), timeField.getDateStyle());
String[] dimension = Arrays.copyOfRange(item, 0, checkedField.size());
dimension[timeIndex] = lastTime;
String lastValue = currentMap.get(StringUtils.join(dimension, "-"));
if (StringUtils.isEmpty(cValue) || StringUtils.isEmpty(lastValue)) {
item[dataIndex] = null;
} else {
if (StringUtils.equalsIgnoreCase(resultData, "sub")) {
item[dataIndex] = new BigDecimal(cValue).subtract(new BigDecimal(lastValue)).toString();
} else if (StringUtils.equalsIgnoreCase(resultData, "percent")) {
if (Integer.parseInt(lastValue) == 0) {
item[dataIndex] = null;
} else {
item[dataIndex] = new BigDecimal(cValue)
.divide(new BigDecimal(lastValue), 2, RoundingMode.HALF_UP)
.subtract(new BigDecimal(1))
.setScale(2, RoundingMode.HALF_UP)
.toString();
}
}
}
}
}
}
}
// 构建结果
Map<String, Object> map = new TreeMap<>();
// 图表组件可再扩展
Map<String, Object> mapChart = new HashMap<>();
@ -491,6 +574,68 @@ public class ChartViewService {
return dto;
}
private boolean checkCalcType(String dateStyle, String calcType) {
switch (dateStyle) {
case "y":
return StringUtils.equalsIgnoreCase(calcType, "year_mom");
case "y_M":
return StringUtils.equalsIgnoreCase(calcType, "month_mom")
|| StringUtils.equalsIgnoreCase(calcType, "year_yoy");
case "y_M_d":
return StringUtils.equalsIgnoreCase(calcType, "day_mom")
|| StringUtils.equalsIgnoreCase(calcType, "month_yoy")
|| StringUtils.equalsIgnoreCase(calcType, "year_yoy");
}
return false;
}
private String calcLastTime(String cTime, String type, String dateStyle) throws Exception {
String lastTime = null;
Calendar calendar = Calendar.getInstance();
if (StringUtils.equalsIgnoreCase(type, ChartConstants.YEAR_MOM)) {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy");
Date date = simpleDateFormat.parse(cTime);
calendar.setTime(date);
calendar.add(Calendar.YEAR, -1);
lastTime = simpleDateFormat.format(calendar.getTime());
} else if (StringUtils.equalsIgnoreCase(type, ChartConstants.MONTH_MOM)) {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM");
Date date = simpleDateFormat.parse(cTime);
calendar.setTime(date);
calendar.add(Calendar.MONTH, -1);
lastTime = simpleDateFormat.format(calendar.getTime());
} else if (StringUtils.equalsIgnoreCase(type, ChartConstants.YEAR_YOY)) {
SimpleDateFormat simpleDateFormat = null;
if (StringUtils.equalsIgnoreCase(dateStyle, "y_M")) {
simpleDateFormat = new SimpleDateFormat("yyyy-MM");
} else if (StringUtils.equalsIgnoreCase(dateStyle, "y_M_d")) {
simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
}
Date date = simpleDateFormat.parse(cTime);
calendar.setTime(date);
calendar.add(Calendar.YEAR, -1);
lastTime = simpleDateFormat.format(calendar.getTime());
} else if (StringUtils.equalsIgnoreCase(type, ChartConstants.DAY_MOM)) {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
Date date = simpleDateFormat.parse(cTime);
calendar.setTime(date);
calendar.add(Calendar.DAY_OF_MONTH, -1);
lastTime = simpleDateFormat.format(calendar.getTime());
} else if (StringUtils.equalsIgnoreCase(type, ChartConstants.MONTH_YOY)) {
SimpleDateFormat simpleDateFormat = null;
if (StringUtils.equalsIgnoreCase(dateStyle, "y_M")) {
simpleDateFormat = new SimpleDateFormat("yyyy-MM");
} else if (StringUtils.equalsIgnoreCase(dateStyle, "y_M_d")) {
simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
}
Date date = simpleDateFormat.parse(cTime);
calendar.setTime(date);
calendar.add(Calendar.MONTH, -1);
lastTime = simpleDateFormat.format(calendar.getTime());
}
return lastTime;
}
private boolean checkDrillExist(List<ChartViewFieldDTO> xAxis, List<ChartViewFieldDTO> extStack, ChartViewFieldDTO dto, ChartViewWithBLOBs view) {
if (CollectionUtils.isNotEmpty(xAxis)) {
for (ChartViewFieldDTO x : xAxis) {
@ -588,7 +733,7 @@ public class ChartViewService {
quotaList.add(chartQuotaDTO);
axisChartDataDTO.setQuotaList(quotaList);
try {
axisChartDataDTO.setValue(new BigDecimal(StringUtils.isEmpty(row[i]) ? "0" : row[i]));
axisChartDataDTO.setValue(StringUtils.isEmpty(row[i]) ? null : new BigDecimal(row[i]));
} catch (Exception e) {
axisChartDataDTO.setValue(new BigDecimal(0));
}
@ -644,7 +789,7 @@ public class ChartViewService {
quotaList.add(chartQuotaDTO);
axisChartDataDTO.setQuotaList(quotaList);
try {
axisChartDataDTO.setValue(new BigDecimal(StringUtils.isEmpty(row[valueIndex]) ? "0" : row[valueIndex]));
axisChartDataDTO.setValue(StringUtils.isEmpty(row[valueIndex]) ? null : new BigDecimal(row[valueIndex]));
} catch (Exception e) {
axisChartDataDTO.setValue(new BigDecimal(0));
}
@ -692,7 +837,7 @@ public class ChartViewService {
quotaList.add(chartQuotaDTO);
axisChartDataDTO.setQuotaList(quotaList);
try {
axisChartDataDTO.setValue(new BigDecimal(StringUtils.isEmpty(row[i]) ? "0" : row[i]));
axisChartDataDTO.setValue(StringUtils.isEmpty(row[i]) ? null : new BigDecimal(row[i]));
} catch (Exception e) {
axisChartDataDTO.setValue(new BigDecimal(0));
}
@ -747,14 +892,18 @@ public class ChartViewService {
quotaList.add(chartQuotaDTO);
axisChartDataDTO.setQuotaList(quotaList);
try {
axisChartDataDTO.setValue(new BigDecimal(StringUtils.isEmpty(row[i]) ? "0" : row[i]));
axisChartDataDTO.setValue(StringUtils.isEmpty(row[i]) ? null : new BigDecimal(row[i]));
} catch (Exception e) {
axisChartDataDTO.setValue(new BigDecimal(0));
}
axisChartDataDTO.setCategory(yAxis.get(j).getName());
// pop
if (CollectionUtils.isNotEmpty(extBubble)) {
axisChartDataDTO.setPopSize(new BigDecimal(StringUtils.isEmpty(row[xAxis.size() + yAxis.size()]) ? "0" : row[xAxis.size() + yAxis.size()]));
try {
axisChartDataDTO.setPopSize(StringUtils.isEmpty(row[xAxis.size() + yAxis.size()]) ? null : new BigDecimal(row[xAxis.size() + yAxis.size()]));
} catch (Exception e) {
axisChartDataDTO.setPopSize(new BigDecimal(0));
}
}
datas.add(axisChartDataDTO);
}
@ -806,7 +955,7 @@ public class ChartViewService {
quotaList.add(chartQuotaDTO);
axisChartDataDTO.setQuotaList(quotaList);
try {
axisChartDataDTO.setValue(new BigDecimal(StringUtils.isEmpty(row[i]) ? "0" : row[i]));
axisChartDataDTO.setValue(StringUtils.isEmpty(row[i]) ? null : new BigDecimal(row[i]));
} catch (Exception e) {
axisChartDataDTO.setValue(new BigDecimal(0));
}
@ -868,7 +1017,7 @@ public class ChartViewService {
quotaList.add(chartQuotaDTO);
axisChartDataDTO.setQuotaList(quotaList);
try {
axisChartDataDTO.setValue(new BigDecimal(StringUtils.isEmpty(d[i]) ? "0" : d[i]));
axisChartDataDTO.setValue(StringUtils.isEmpty(d[i]) ? null : new BigDecimal(d[i]));
} catch (Exception e) {
axisChartDataDTO.setValue(new BigDecimal(0));
}
@ -916,7 +1065,7 @@ public class ChartViewService {
quotaList.add(chartQuotaDTO);
axisChartDataDTO.setQuotaList(quotaList);
try {
axisChartDataDTO.setValue(new BigDecimal(StringUtils.isEmpty(d[i]) ? "0" : d[i]));
axisChartDataDTO.setValue(StringUtils.isEmpty(d[i]) ? null : new BigDecimal(d[i]));
} catch (Exception e) {
axisChartDataDTO.setValue(new BigDecimal(0));
}
@ -977,7 +1126,7 @@ public class ChartViewService {
quotaList.add(chartQuotaDTO);
axisChartDataDTO.setQuotaList(quotaList);
try {
axisChartDataDTO.setValue(new BigDecimal(StringUtils.isEmpty(d[i]) ? "0" : d[i]));
axisChartDataDTO.setValue(StringUtils.isEmpty(d[i]) ? null : new BigDecimal(d[i]));
} catch (Exception e) {
axisChartDataDTO.setValue(new BigDecimal(0));
}
@ -1032,7 +1181,7 @@ public class ChartViewService {
for (int i = xAxis.size(); i < xAxis.size() + yAxis.size(); i++) {
int j = i - xAxis.size();
try {
series.get(j).getData().add(new BigDecimal(StringUtils.isEmpty(d[i]) ? "0" : d[i]));
series.get(j).getData().add(StringUtils.isEmpty(d[i]) ? null : new BigDecimal(d[i]));
} catch (Exception e) {
series.get(j).getData().add(new BigDecimal(0));
}
@ -1074,7 +1223,7 @@ public class ChartViewService {
for (int i = xAxis.size(); i < xAxis.size() + yAxis.size(); i++) {
int j = i - xAxis.size();
try {
series.get(j).getData().add(new BigDecimal(StringUtils.isEmpty(d[i]) ? "0" : d[i]));
series.get(j).getData().add(StringUtils.isEmpty(d[i]) ? null : new BigDecimal(d[i]));
} catch (Exception e) {
series.get(j).getData().add(new BigDecimal(0));
}
@ -1214,7 +1363,7 @@ public class ChartViewService {
quotaList.add(chartQuotaDTO);
axisChartDataDTO.setQuotaList(quotaList);
try {
axisChartDataDTO.setValue(new BigDecimal(StringUtils.isEmpty(d[i]) ? "0" : d[i]));
axisChartDataDTO.setValue(StringUtils.isEmpty(d[i]) ? null : new BigDecimal(d[i]));
} catch (Exception e) {
axisChartDataDTO.setValue(new BigDecimal(0));
}
@ -1292,8 +1441,8 @@ public class ChartViewService {
try {
scatterChartDataDTO.setValue(new Object[]{
a.toString(),
new BigDecimal(StringUtils.isEmpty(d[i]) ? "0" : d[i]),
new BigDecimal(StringUtils.isEmpty(d[xAxis.size() + yAxis.size()]) ? "0" : d[xAxis.size() + yAxis.size()])
StringUtils.isEmpty(d[i]) ? null : new BigDecimal(d[i]),
StringUtils.isEmpty(d[xAxis.size() + yAxis.size()]) ? null : new BigDecimal(d[xAxis.size() + yAxis.size()])
});
} catch (Exception e) {
scatterChartDataDTO.setValue(new Object[]{a.toString(), new BigDecimal(0), new BigDecimal(0)});
@ -1302,7 +1451,7 @@ public class ChartViewService {
try {
scatterChartDataDTO.setValue(new Object[]{
a.toString(),
new BigDecimal(StringUtils.isEmpty(d[i]) ? "0" : d[i])
StringUtils.isEmpty(d[i]) ? null : new BigDecimal(d[i])
});
} catch (Exception e) {
scatterChartDataDTO.setValue(new Object[]{a.toString(), new BigDecimal(0)});
@ -1338,7 +1487,7 @@ public class ChartViewService {
if (chartViewFieldDTO.getDeType() == 0 || chartViewFieldDTO.getDeType() == 1) {
d.put(fields.get(i).getDataeaseName(), StringUtils.isEmpty(ele[i]) ? "" : ele[i]);
} else if (chartViewFieldDTO.getDeType() == 2 || chartViewFieldDTO.getDeType() == 3) {
d.put(fields.get(i).getDataeaseName(), new BigDecimal(StringUtils.isEmpty(ele[i]) ? "0" : ele[i]).setScale(2, RoundingMode.HALF_UP));
d.put(fields.get(i).getDataeaseName(), StringUtils.isEmpty(ele[i]) ? null : new BigDecimal(ele[i]).setScale(2, RoundingMode.HALF_UP));
}
}
tableRow.add(d);

View File

@ -53,4 +53,11 @@ public class StoreService {
return extPanelStoreMapper.query(example);
}
public Long count(String panelId) {
PanelStoreExample example = new PanelStoreExample();
example.createCriteria().andUserIdEqualTo(AuthUtils.getUser().getUserId()).andPanelGroupIdEqualTo(panelId);
return panelStoreMapper.countByExample(example);
}
}

View File

@ -203,7 +203,7 @@ public class EmailService {
props.put("mail.smtp.starttls.enable", "true");
}
props.put("mail.smtp.timeout", "30000");
props.put("mail.smtp.connectiontimeout", "5000");
props.put("mail.smtp.connectiontimeout", "10000");
javaMailSender.setJavaMailProperties(props);
try {
javaMailSender.testConnection();
@ -221,7 +221,7 @@ public class EmailService {
helper.setText("这是一封测试邮件,邮件发送成功", true);
helper.setTo(recipients);
javaMailSender.send(mimeMessage);
} catch (MessagingException e) {
} catch (Exception e) {
LogUtil.error(e.getMessage(), e);
DEException.throwException(Translator.get("connection_failed"));
}

View File

@ -30,4 +30,4 @@ END
delimiter ;
DROP VIEW IF EXISTS `v_auth_model`;
CREATE ALGORITHM = UNDEFINED SQL SECURITY DEFINER VIEW `v_auth_model` AS select `sys_user`.`user_id` AS `id`,`sys_user`.`username` AS `name`,`sys_user`.`username` AS `label`,'0' AS `pid`,'leaf' AS `node_type`,'user' AS `model_type`,'user' AS `model_inner_type`,'target' AS `auth_type`,`sys_user`.`create_by` AS `create_by` from `sys_user` union all select `sys_role`.`role_id` AS `id`,`sys_role`.`name` AS `name`,`sys_role`.`name` AS `label`,'0' AS `pid`,'leaf' AS `node_type`,'role' AS `model_type`,'role' AS `model_inner_type`,'target' AS `auth_type`,`sys_role`.`create_by` AS `create_by` from `sys_role` union all select `sys_dept`.`dept_id` AS `id`,`sys_dept`.`name` AS `name`,`sys_dept`.`name` AS `lable`,cast(`sys_dept`.`pid` as char) AS `pid`,if((`sys_dept`.`sub_count` = 0),'leaf','spine') AS `node_type`,'dept' AS `model_type`,'dept' AS `model_inner_type`,'target' AS `auth_type`,`sys_dept`.`create_by` AS `create_by` from `sys_dept` union all select `datasource`.`id` AS `id`,`datasource`.`name` AS `NAME`,`datasource`.`name` AS `label`,'0' AS `pid`,'leaf' AS `node_type`,'link' AS `model_type`,`datasource`.`type` AS `model_inner_type`,'source' AS `auth_type`,`datasource`.`create_by` AS `create_by` from `datasource` union all select `dataset_group`.`id` AS `id`,`dataset_group`.`name` AS `NAME`,`dataset_group`.`name` AS `lable`,if(isnull(`dataset_group`.`pid`),'0',`dataset_group`.`pid`) AS `pid`,'spine' AS `node_type`,'dataset' AS `model_type`,`dataset_group`.`type` AS `model_inner_type`,'source' AS `auth_type`,`dataset_group`.`create_by` AS `create_by` from `dataset_group` union all select `dataset_table`.`id` AS `id`,`dataset_table`.`name` AS `NAME`,`dataset_table`.`name` AS `lable`,`dataset_table`.`scene_id` AS `pid`,'leaf' AS `node_type`,'dataset' AS `model_type`,`dataset_table`.`type` AS `model_inner_type`,'source' AS `auth_type`,`dataset_table`.`create_by` AS `create_by` from `dataset_table` union all select `chart_group`.`id` AS `id`,`chart_group`.`name` AS `name`,`chart_group`.`name` AS `label`,if(isnull(`chart_group`.`pid`),'0',`chart_group`.`pid`) AS `pid`,'spine' AS `node_type`,'chart' AS `model_type`,`chart_group`.`type` AS `model_inner_type`,'source' AS `auth_type`,`chart_group`.`create_by` AS `create_by` from `chart_group` union all select `chart_view`.`id` AS `id`,`chart_view`.`name` AS `name`,`chart_view`.`name` AS `label`,`chart_view`.`scene_id` AS `pid`,'leaf' AS `node_type`,'chart' AS `model_type`,`chart_view`.`type` AS `model_inner_type`,'source' AS `auth_type`,`chart_view`.`create_by` AS `create_by` from `chart_view` union all select `panel_group`.`id` AS `id`,`panel_group`.`name` AS `NAME`,`panel_group`.`name` AS `label`,(case `panel_group`.`id` when 'panel_list' then '0' when 'default_panel' then '0' else `panel_group`.`pid` end) AS `pid`,if((`panel_group`.`node_type` = 'folder'),'spine','leaf') AS `node_type`,'panel' AS `model_type`,`panel_group`.`panel_type` AS `model_inner_type`,'source' AS `auth_type`,`panel_group`.`create_by` AS `create_by` from `panel_group` union all select `sys_menu`.`menu_id` AS `menu_id`,`sys_menu`.`title` AS `name`,`sys_menu`.`title` AS `label`,`sys_menu`.`pid` AS `pid`,if((`sys_menu`.`sub_count` > 0),'spine','leaf') AS `node_type`,'menu' AS `model_type`,(case `sys_menu`.`type` when 0 then 'folder' when 1 then 'menu' when 2 then 'button' end) AS `model_inner_type`,'source' AS `auth_type`,`sys_menu`.`create_by` AS `create_by` from `sys_menu` where (((`sys_menu`.`permission` is not null) or (`sys_menu`.`pid` = 0)) and ((`sys_menu`.`name` <> 'panel') or isnull(`sys_menu`.`name`))) union all select `plugin_sys_menu`.`menu_id` AS `menu_id`,`plugin_sys_menu`.`title` AS `name`,`plugin_sys_menu`.`title` AS `label`,`plugin_sys_menu`.`pid` AS `pid`,if((`plugin_sys_menu`.`sub_count` > 0),'spine','leaf') AS `node_type`,'menu' AS `model_type`,(case `plugin_sys_menu`.`type` when 0 then 'folder' when 1 then 'menu' when 2 then 'button' end) AS `model_inner_type`,'source' AS `auth_type`,`plugin_sys_menu`.`create_by` AS `create_by` from `plugin_sys_menu` where ((`plugin_sys_menu`.`permission` is not null) or (`plugin_sys_menu`.`pid` = 0));
CREATE ALGORITHM = UNDEFINED SQL SECURITY DEFINER VIEW `v_auth_model` AS select `sys_user`.`user_id` AS `id`,`sys_user`.`username` AS `name`,`sys_user`.`username` AS `label`,'0' AS `pid`,'leaf' AS `node_type`,'user' AS `model_type`,'user' AS `model_inner_type`,'target' AS `auth_type`,`sys_user`.`create_by` AS `create_by` from `sys_user` union all select `sys_role`.`role_id` AS `id`,`sys_role`.`name` AS `name`,`sys_role`.`name` AS `label`,'0' AS `pid`,'leaf' AS `node_type`,'role' AS `model_type`,'role' AS `model_inner_type`,'target' AS `auth_type`,`sys_role`.`create_by` AS `create_by` from `sys_role` union all select `sys_dept`.`dept_id` AS `id`,`sys_dept`.`name` AS `name`,`sys_dept`.`name` AS `lable`,cast( `sys_dept`.`pid` AS CHAR CHARACTER set utf8mb4) COLLATE utf8mb4_general_ci AS `pid`,if((`sys_dept`.`sub_count` = 0),'leaf','spine') AS `node_type`,'dept' AS `model_type`,'dept' AS `model_inner_type`,'target' AS `auth_type`,`sys_dept`.`create_by` AS `create_by` from `sys_dept` union all select `datasource`.`id` AS `id`,`datasource`.`name` AS `NAME`,`datasource`.`name` AS `label`,'0' AS `pid`,'leaf' AS `node_type`,'link' AS `model_type`,`datasource`.`type` AS `model_inner_type`,'source' AS `auth_type`,`datasource`.`create_by` AS `create_by` from `datasource` union all select `dataset_group`.`id` AS `id`,`dataset_group`.`name` AS `NAME`,`dataset_group`.`name` AS `lable`,if(isnull(`dataset_group`.`pid`),'0',`dataset_group`.`pid`) AS `pid`,'spine' AS `node_type`,'dataset' AS `model_type`,`dataset_group`.`type` AS `model_inner_type`,'source' AS `auth_type`,`dataset_group`.`create_by` AS `create_by` from `dataset_group` union all select `dataset_table`.`id` AS `id`,`dataset_table`.`name` AS `NAME`,`dataset_table`.`name` AS `lable`,`dataset_table`.`scene_id` AS `pid`,'leaf' AS `node_type`,'dataset' AS `model_type`,`dataset_table`.`type` AS `model_inner_type`,'source' AS `auth_type`,`dataset_table`.`create_by` AS `create_by` from `dataset_table` union all select `chart_group`.`id` AS `id`,`chart_group`.`name` AS `name`,`chart_group`.`name` AS `label`,if(isnull(`chart_group`.`pid`),'0',`chart_group`.`pid`) AS `pid`,'spine' AS `node_type`,'chart' AS `model_type`,`chart_group`.`type` AS `model_inner_type`,'source' AS `auth_type`,`chart_group`.`create_by` AS `create_by` from `chart_group` union all select `chart_view`.`id` AS `id`,`chart_view`.`name` AS `name`,`chart_view`.`name` AS `label`,`chart_view`.`scene_id` AS `pid`,'leaf' AS `node_type`,'chart' AS `model_type`,`chart_view`.`type` AS `model_inner_type`,'source' AS `auth_type`,`chart_view`.`create_by` AS `create_by` from `chart_view` union all select `panel_group`.`id` AS `id`,`panel_group`.`name` AS `NAME`,`panel_group`.`name` AS `label`,(case `panel_group`.`id` when 'panel_list' then '0' when 'default_panel' then '0' else `panel_group`.`pid` end) AS `pid`,if((`panel_group`.`node_type` = 'folder'),'spine','leaf') AS `node_type`,'panel' AS `model_type`,`panel_group`.`panel_type` AS `model_inner_type`,'source' AS `auth_type`,`panel_group`.`create_by` AS `create_by` from `panel_group` union all select `sys_menu`.`menu_id` AS `menu_id`,`sys_menu`.`title` AS `name`,`sys_menu`.`title` AS `label`,`sys_menu`.`pid` AS `pid`,if((`sys_menu`.`sub_count` > 0),'spine','leaf') AS `node_type`,'menu' AS `model_type`,(case `sys_menu`.`type` when 0 then 'folder' when 1 then 'menu' when 2 then 'button' end) AS `model_inner_type`,'source' AS `auth_type`,`sys_menu`.`create_by` AS `create_by` from `sys_menu` where (((`sys_menu`.`permission` is not null) or (`sys_menu`.`pid` = 0)) and ((`sys_menu`.`name` <> 'panel') or isnull(`sys_menu`.`name`))) union all select `plugin_sys_menu`.`menu_id` AS `menu_id`,`plugin_sys_menu`.`title` AS `name`,`plugin_sys_menu`.`title` AS `label`,`plugin_sys_menu`.`pid` AS `pid`,if((`plugin_sys_menu`.`sub_count` > 0),'spine','leaf') AS `node_type`,'menu' AS `model_type`,(case `plugin_sys_menu`.`type` when 0 then 'folder' when 1 then 'menu' when 2 then 'button' end) AS `model_inner_type`,'source' AS `auth_type`,`plugin_sys_menu`.`create_by` AS `create_by` from `plugin_sys_menu` where ((`plugin_sys_menu`.`permission` is not null) or (`plugin_sys_menu`.`pid` = 0));

View File

@ -33,7 +33,7 @@ SELECT
`sys_dept`.`dept_id` AS `id`,
`sys_dept`.`name` AS `name`,
`sys_dept`.`name` AS `lable`,
cast( `sys_dept`.`pid` AS CHAR ) AS `pid`,
cast( `sys_dept`.`pid` AS CHAR CHARACTER set utf8mb4) COLLATE utf8mb4_general_ci AS `pid`,
IF
(( `sys_dept`.`sub_count` = 0 ), 'leaf', 'spine' ) AS `node_type`,
'dept' AS `model_type`,

View File

@ -33,7 +33,7 @@ SELECT
`sys_dept`.`dept_id` AS `id`,
`sys_dept`.`name` AS `name`,
`sys_dept`.`name` AS `lable`,
cast( `sys_dept`.`pid` AS CHAR ) AS `pid`,
cast( `sys_dept`.`pid` AS CHAR CHARACTER set utf8mb4) COLLATE utf8mb4_general_ci AS `pid`,
IF
(( `sys_dept`.`sub_count` = 0 ), 'leaf', 'spine' ) AS `node_type`,
'dept' AS `model_type`,

File diff suppressed because one or more lines are too long

View File

@ -65,7 +65,7 @@ SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- View structure for v_auth_model
-- ----------------------------
CREATE ALGORITHM = UNDEFINED SQL SECURITY DEFINER VIEW `v_auth_model` AS select `sys_user`.`user_id` AS `id`,`sys_user`.`username` AS `name`,`sys_user`.`username` AS `label`,'0' AS `pid`,'leaf' AS `node_type`,'user' AS `model_type`,'user' AS `model_inner_type`,'target' AS `auth_type`,`sys_user`.`create_by` AS `create_by` from `sys_user` where (`sys_user`.`is_admin` <> 1) union all select `sys_role`.`role_id` AS `id`,`sys_role`.`name` AS `name`,`sys_role`.`name` AS `label`,'0' AS `pid`,'leaf' AS `node_type`,'role' AS `model_type`,'role' AS `model_inner_type`,'target' AS `auth_type`,`sys_role`.`create_by` AS `create_by` from `sys_role` union all select `sys_dept`.`dept_id` AS `id`,`sys_dept`.`name` AS `name`,`sys_dept`.`name` AS `lable`,cast(`sys_dept`.`pid` as char ) AS `pid`,if((`sys_dept`.`sub_count` = 0),'leaf','spine') AS `node_type`,'dept' AS `model_type`,'dept' AS `model_inner_type`,'target' AS `auth_type`,`sys_dept`.`create_by` AS `create_by` from `sys_dept` union all select `datasource`.`id` AS `id`,`datasource`.`name` AS `NAME`,`datasource`.`name` AS `label`,'0' AS `pid`,'leaf' AS `node_type`,'link' AS `model_type`,`datasource`.`type` AS `model_inner_type`,'source' AS `auth_type`,`datasource`.`create_by` AS `create_by` from `datasource` union all select `dataset_group`.`id` AS `id`,`dataset_group`.`name` AS `NAME`,`dataset_group`.`name` AS `lable`,if(isnull(`dataset_group`.`pid`),'0',`dataset_group`.`pid`) AS `pid`,'spine' AS `node_type`,'dataset' AS `model_type`,`dataset_group`.`type` AS `model_inner_type`,'source' AS `auth_type`,`dataset_group`.`create_by` AS `create_by` from `dataset_group` union all select `dataset_table`.`id` AS `id`,`dataset_table`.`name` AS `NAME`,`dataset_table`.`name` AS `lable`,`dataset_table`.`scene_id` AS `pid`,'leaf' AS `node_type`,'dataset' AS `model_type`,`dataset_table`.`type` AS `model_inner_type`,'source' AS `auth_type`,`dataset_table`.`create_by` AS `create_by` from `dataset_table` union all select `chart_group`.`id` AS `id`,`chart_group`.`name` AS `name`,`chart_group`.`name` AS `label`,if(isnull(`chart_group`.`pid`),'0',`chart_group`.`pid`) AS `pid`,'spine' AS `node_type`,'chart' AS `model_type`,`chart_group`.`type` AS `model_inner_type`,'source' AS `auth_type`,`chart_group`.`create_by` AS `create_by` from `chart_group` union all select `chart_view`.`id` AS `id`,`chart_view`.`name` AS `name`,`chart_view`.`name` AS `label`,`chart_view`.`scene_id` AS `pid`,'leaf' AS `node_type`,'chart' AS `model_type`,`chart_view`.`type` AS `model_inner_type`,'source' AS `auth_type`,`chart_view`.`create_by` AS `create_by` from `chart_view` union all select `panel_group`.`id` AS `id`,`panel_group`.`name` AS `NAME`,`panel_group`.`name` AS `label`,(case `panel_group`.`id` when 'panel_list' then '0' when 'default_panel' then '0' else `panel_group`.`pid` end) AS `pid`,if((`panel_group`.`node_type` = 'folder'),'spine','leaf') AS `node_type`,'panel' AS `model_type`,`panel_group`.`panel_type` AS `model_inner_type`,'source' AS `auth_type`,`panel_group`.`create_by` AS `create_by` from `panel_group` union all select `sys_menu`.`menu_id` AS `menu_id`,`sys_menu`.`title` AS `name`,`sys_menu`.`title` AS `label`,`sys_menu`.`pid` AS `pid`,if((`sys_menu`.`sub_count` > 0),'spine','leaf') AS `node_type`,'menu' AS `model_type`,(case `sys_menu`.`type` when 0 then 'folder' when 1 then 'menu' when 2 then 'button' end) AS `model_inner_type`,'source' AS `auth_type`,`sys_menu`.`create_by` AS `create_by` from `sys_menu` where ((`sys_menu`.`hidden` = 0) and ((`sys_menu`.`name` <> 'panel') or isnull(`sys_menu`.`name`))) union all select `plugin_sys_menu`.`menu_id` AS `menu_id`,`plugin_sys_menu`.`title` AS `name`,`plugin_sys_menu`.`title` AS `label`,`plugin_sys_menu`.`pid` AS `pid`,if((`plugin_sys_menu`.`sub_count` > 0),'spine','leaf') AS `node_type`,'menu' AS `model_type`,(case `plugin_sys_menu`.`type` when 0 then 'folder' when 1 then 'menu' when 2 then 'button' end) AS `model_inner_type`,'source' AS `auth_type`,`plugin_sys_menu`.`create_by` AS `create_by` from `plugin_sys_menu` where (`plugin_sys_menu`.`hidden` = 0);
CREATE ALGORITHM = UNDEFINED SQL SECURITY DEFINER VIEW `v_auth_model` AS select `sys_user`.`user_id` AS `id`,`sys_user`.`username` AS `name`,`sys_user`.`username` AS `label`,'0' AS `pid`,'leaf' AS `node_type`,'user' AS `model_type`,'user' AS `model_inner_type`,'target' AS `auth_type`,`sys_user`.`create_by` AS `create_by` from `sys_user` where (`sys_user`.`is_admin` <> 1) union all select `sys_role`.`role_id` AS `id`,`sys_role`.`name` AS `name`,`sys_role`.`name` AS `label`,'0' AS `pid`,'leaf' AS `node_type`,'role' AS `model_type`,'role' AS `model_inner_type`,'target' AS `auth_type`,`sys_role`.`create_by` AS `create_by` from `sys_role` union all select `sys_dept`.`dept_id` AS `id`,`sys_dept`.`name` AS `name`,`sys_dept`.`name` AS `lable`,cast( `sys_dept`.`pid` AS CHAR CHARACTER set utf8mb4) COLLATE utf8mb4_general_ci AS `pid`,if((`sys_dept`.`sub_count` = 0),'leaf','spine') AS `node_type`,'dept' AS `model_type`,'dept' AS `model_inner_type`,'target' AS `auth_type`,`sys_dept`.`create_by` AS `create_by` from `sys_dept` union all select `datasource`.`id` AS `id`,`datasource`.`name` AS `NAME`,`datasource`.`name` AS `label`,'0' AS `pid`,'leaf' AS `node_type`,'link' AS `model_type`,`datasource`.`type` AS `model_inner_type`,'source' AS `auth_type`,`datasource`.`create_by` AS `create_by` from `datasource` union all select `dataset_group`.`id` AS `id`,`dataset_group`.`name` AS `NAME`,`dataset_group`.`name` AS `lable`,if(isnull(`dataset_group`.`pid`),'0',`dataset_group`.`pid`) AS `pid`,'spine' AS `node_type`,'dataset' AS `model_type`,`dataset_group`.`type` AS `model_inner_type`,'source' AS `auth_type`,`dataset_group`.`create_by` AS `create_by` from `dataset_group` union all select `dataset_table`.`id` AS `id`,`dataset_table`.`name` AS `NAME`,`dataset_table`.`name` AS `lable`,`dataset_table`.`scene_id` AS `pid`,'leaf' AS `node_type`,'dataset' AS `model_type`,`dataset_table`.`type` AS `model_inner_type`,'source' AS `auth_type`,`dataset_table`.`create_by` AS `create_by` from `dataset_table` union all select `chart_group`.`id` AS `id`,`chart_group`.`name` AS `name`,`chart_group`.`name` AS `label`,if(isnull(`chart_group`.`pid`),'0',`chart_group`.`pid`) AS `pid`,'spine' AS `node_type`,'chart' AS `model_type`,`chart_group`.`type` AS `model_inner_type`,'source' AS `auth_type`,`chart_group`.`create_by` AS `create_by` from `chart_group` union all select `chart_view`.`id` AS `id`,`chart_view`.`name` AS `name`,`chart_view`.`name` AS `label`,`chart_view`.`scene_id` AS `pid`,'leaf' AS `node_type`,'chart' AS `model_type`,`chart_view`.`type` AS `model_inner_type`,'source' AS `auth_type`,`chart_view`.`create_by` AS `create_by` from `chart_view` union all select `panel_group`.`id` AS `id`,`panel_group`.`name` AS `NAME`,`panel_group`.`name` AS `label`,(case `panel_group`.`id` when 'panel_list' then '0' when 'default_panel' then '0' else `panel_group`.`pid` end) AS `pid`,if((`panel_group`.`node_type` = 'folder'),'spine','leaf') AS `node_type`,'panel' AS `model_type`,`panel_group`.`panel_type` AS `model_inner_type`,'source' AS `auth_type`,`panel_group`.`create_by` AS `create_by` from `panel_group` union all select `sys_menu`.`menu_id` AS `menu_id`,`sys_menu`.`title` AS `name`,`sys_menu`.`title` AS `label`,`sys_menu`.`pid` AS `pid`,if((`sys_menu`.`sub_count` > 0),'spine','leaf') AS `node_type`,'menu' AS `model_type`,(case `sys_menu`.`type` when 0 then 'folder' when 1 then 'menu' when 2 then 'button' end) AS `model_inner_type`,'source' AS `auth_type`,`sys_menu`.`create_by` AS `create_by` from `sys_menu` where ((`sys_menu`.`hidden` = 0) and ((`sys_menu`.`name` <> 'panel') or isnull(`sys_menu`.`name`))) union all select `plugin_sys_menu`.`menu_id` AS `menu_id`,`plugin_sys_menu`.`title` AS `name`,`plugin_sys_menu`.`title` AS `label`,`plugin_sys_menu`.`pid` AS `pid`,if((`plugin_sys_menu`.`sub_count` > 0),'spine','leaf') AS `node_type`,'menu' AS `model_type`,(case `plugin_sys_menu`.`type` when 0 then 'folder' when 1 then 'menu' when 2 then 'button' end) AS `model_inner_type`,'source' AS `auth_type`,`plugin_sys_menu`.`create_by` AS `create_by` from `plugin_sys_menu` where (`plugin_sys_menu`.`hidden` = 0);
-- ----------------------------
-- View structure for v_auth_privilege
@ -333,7 +333,7 @@ DECLARE oTempChild VARCHAR(8000);
SET oTemp = '';
SET oTempChild = CAST(parentId AS CHAR);
SET oTempChild = CAST(parentId AS CHAR CHARACTER set utf8mb4) COLLATE utf8mb4_general_ci;
WHILE oTempChild IS NOT NULL
@ -366,7 +366,8 @@ DECLARE oTempChild VARCHAR(8000);
SET oTemp = '';
SET oTempChild = CAST(parentId AS CHAR);
SET oTempChild = CAST(parentId AS CHAR CHARACTER set utf8mb4) COLLATE utf8mb4_general_ci;
WHILE oTempChild IS NOT NULL
@ -420,7 +421,7 @@ DECLARE oTempChild longtext;
SET oTemp = '';
SET oTempChild = CAST(parentId AS CHAR);
SET oTempChild = CAST(parentId AS CHAR CHARACTER set utf8mb4) COLLATE utf8mb4_general_ci;
WHILE oTempChild IS NOT NULL
@ -453,7 +454,7 @@ DECLARE oTempParent longtext;
SET oTemp = '';
SET oTempParent = CAST(childrenId AS CHAR);
SET oTempParent = CAST(childrenId AS CHAR CHARACTER set utf8mb4) COLLATE utf8mb4_general_ci;
WHILE oTempParent IS NOT NULL

View File

@ -1,33 +1,42 @@
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
</head>
<body style="height: 100%;">
<div id="link"></div>
<div id="link"></div>
</body>
<script>
function getQueryVariable(variable) {
debugger
let query = window.location.search.substring(1)
let vars = []
if (!query) {
query = document.cookie
vars = query.split(';')
}else {
vars = query.split('&')
}
for (var i = 0; i < vars.length; i++) {
const pair = vars[i].split('=')
if (pair[0].trim() === variable) { return pair[1] }
}
return (false)
function getQueryVariable(variable) {
let query = window.location.search.substring(1)
let vars = []
if (!query) {
query = document.cookie
vars = query.split(';')
} else {
vars = query.split('&')
}
const link = getQueryVariable('link')
const url = "/#/delink?link="+encodeURIComponent(link)
window.location.href = url
for (var i = 0; i < vars.length; i++) {
const pair = vars[i].split('=')
if (pair[0].trim() === variable) {
return pair[1]
}
}
return (false)
}
const link = getQueryVariable('link')
const terminal = getQueryVariable('terminal')
let url = "/#/delink?link=" + encodeURIComponent(link)
if (terminal) {
url += '&terminal=' + terminal
}
window.location.href = url
</script>
</html>

View File

@ -25,3 +25,10 @@ export function enshrineList(data) {
})
}
export function starStatus(panelId) {
return request({
url: '/api/store/status/' + panelId,
method: 'post',
loading: true
})
}

View File

@ -5,7 +5,7 @@
@click="handleClick"
@mousedown="elementMouseDown"
>
<edit-bar v-if="editBarShow" :element="config" @showViewDetails="showViewDetails" />
<edit-bar v-if="componentActiveFlag" :element="config" @showViewDetails="showViewDetails" />
<de-out-widget
v-if="config.type==='custom'"
:id="'component' + config.id"
@ -23,6 +23,7 @@
:style="getComponentStyleDefault(config.style)"
:prop-value="config.propValue"
:is-edit="false"
:active="componentActiveFlag"
:element="config"
:search-count="searchCount"
:h="config.style.height"
@ -66,7 +67,7 @@ export default {
}
},
computed: {
editBarShow() {
componentActiveFlag() {
return this.curComponent && this.config === this.curComponent
},
curGap() {

View File

@ -0,0 +1,90 @@
<template>
<div class="bar-main">
<div v-if="!linkageSettingStatus">
<span v-if="isEdit" :title="$t('panel.edit')">
<i class="icon iconfont icon-edit" @click.stop="edit" />
</span>
<span :title="$t('panel.details')">
<i class="icon iconfont icon-fangda" @click.stop="showViewDetails" />
</span>
</div>
</div>
</template>
<script>
import bus from '@/utils/bus'
import { mapState } from 'vuex'
export default {
props: {
viewId: {
type: String,
required: true
},
isEdit: {
type: Boolean,
required: false,
default: true
}
},
data() {
return {
componentType: null,
linkageActiveStatus: false,
editFilter: [
'view',
'custom'
],
timer: null
}
},
computed: {
...mapState([
'linkageSettingStatus'
])
},
mounted() {
},
beforeDestroy() {
},
methods: {
edit() {
//
this.$store.dispatch('panel/setComponentDataTemp', JSON.stringify(this.componentData))
this.$store.dispatch('panel/setCanvasStyleDataTemp', JSON.stringify(this.canvasStyleData))
this.$store.dispatch('chart/setViewId', null)
this.$store.dispatch('chart/setViewId', this.viewId)
bus.$emit('PanelSwitchComponent', { name: 'ChartEdit', param: { 'id': this.viewId, 'optType': 'edit' }})
},
linkageEdit() {
},
amRemoveItem() {
this.$emit('amRemoveItem')
},
showViewDetails() {
this.$emit('showViewDetails')
}
}
}
</script>
<style lang="scss" scoped>
.bar-main{
position: absolute;
right: 0px;
float:right;
z-index: 2;
border-radius:2px;
padding-left: 5px;
padding-right: 2px;
cursor:pointer!important;
background-color: #0a7be0;
}
.bar-main i{
color: white;
float: right;
margin-right: 3px;
}
</style>

View File

@ -9,7 +9,7 @@
@mouseup="deselectCurComponent"
@mousedown="handleMouseDown"
>
<el-row v-if="componentDataShow.length===0" style="height: 100%;" class="custom-position">
<el-row v-if="componentDataShow.length===0" class="custom-position">
{{ $t('panel.panelNull') }}
</el-row>
<canvas-opt-bar />
@ -103,7 +103,15 @@ export default {
searchCount: 0,
chartDetailsVisible: false,
showChartInfo: {},
showChartTableInfo: {}
showChartTableInfo: {},
// 1.pc pc 2.mobile
terminal: 'pc'
}
},
created() {
const terminalInfo = this.$route.query.terminal
if (terminalInfo) {
this.terminal = terminalInfo
}
},
computed: {
@ -158,16 +166,15 @@ export default {
mounted() {
const _this = this
const erd = elementResizeDetectorMaker()
// div
const mainDom = document.getElementById('canvasInfoMain')
erd.listenTo(mainDom, element => {
// div
erd.listenTo(document.getElementById('canvasInfoMain'), element => {
_this.$nextTick(() => {
_this.restore()
})
})
// div
// div
const tempCanvas = document.getElementById('canvasInfoTemp')
erd.listenTo(tempCanvas, element => {
erd.listenTo(document.getElementById('canvasInfoTemp'), element => {
_this.$nextTick(() => {
// mainHeight px html2canvas
_this.mainHeight = tempCanvas.scrollHeight + 'px!important'
@ -176,6 +183,10 @@ export default {
eventBus.$on('openChartDetailsDialog', this.openChartDetailsDialog)
_this.$store.commit('clearLinkageSettingInfo', false)
_this.canvasStyleDataInit()
//
if (_this.terminal === 'mobile') {
_this.initMobileCanvas()
}
},
beforeDestroy() {
clearInterval(this.timer)
@ -202,8 +213,8 @@ export default {
restore() {
const canvasHeight = document.getElementById('canvasInfoMain').offsetHeight
const canvasWidth = document.getElementById('canvasInfoMain').offsetWidth
this.scaleWidth = canvasWidth * 100 / parseInt(this.canvasStyleData.width)//
this.scaleHeight = canvasHeight * 100 / parseInt(this.canvasStyleData.height)//
this.scaleWidth = (canvasWidth) * 100 / this.canvasStyleData.width //
this.scaleHeight = canvasHeight * 100 / this.canvasStyleData.height//
this.handleScaleChange()
},
resetID(data) {
@ -215,7 +226,7 @@ export default {
return data
},
format(value, scale) {
return value * parseInt(scale) / 100
return value * scale / 100
},
handleScaleChange() {
if (this.componentData) {
@ -249,6 +260,9 @@ export default {
},
handleMouseDown() {
this.$store.commit('setClickComponentStatus', false)
},
initMobileCanvas() {
this.$store.commit('openMobileLayout')
}
}
}
@ -257,7 +271,7 @@ export default {
<style lang="scss" scoped>
.bg {
padding: 5px;
min-width: 600px;
min-width: 200px;
min-height: 300px;
width: 100%;
height: 100%;
@ -272,6 +286,7 @@ export default {
}
.custom-position {
height: 100%;
flex: 1;
display: flex;
align-items: center;
@ -281,10 +296,6 @@ export default {
color: #9ea6b2;
}
.gap_class {
padding: 5px;
}
.dialog-css > > > .el-dialog__title {
font-size: 14px;
}

View File

@ -0,0 +1,305 @@
<template>
<div class="bg" :style="customStyle">
<div id="canvasInfoMain" ref="canvasInfoMain" style="width: 100%;height: 100%">
<div
id="canvasInfoTemp"
ref="canvasInfoTemp"
:style="[{height:mainHeight},screenShotStyle]"
class="main-class"
@mouseup="deselectCurComponent"
@mousedown="handleMouseDown"
>
<el-row v-if="componentDataShow.length===0" style="height: 100%;" class="custom-position">
{{ $t('panel.panelNull') }}
</el-row>
<canvas-opt-bar />
<ComponentWrapper
v-for="(item, index) in componentDataInfo"
:key="index"
:config="item"
:search-count="searchCount"
:in-screen="inScreen"
/>
<!--视图详情-->
<el-dialog
:title="'['+showChartInfo.name+']'+$t('chart.chart_details')"
:visible.sync="chartDetailsVisible"
width="70%"
class="dialog-css"
:destroy-on-close="true"
>
<span style="position: absolute;right: 70px;top:15px">
<el-button size="mini" @click="exportExcel">
<svg-icon icon-class="ds-excel" class="ds-icon-excel" />
{{ $t('chart.export_details') }}
</el-button>
</span>
<UserViewDialog ref="userViewDialog" :chart="showChartInfo" :chart-table="showChartTableInfo" />
</el-dialog>
</div>
</div>
</div>
</template>
<script>
import { getStyle } from '@/components/canvas/utils/style'
import { mapState } from 'vuex'
import ComponentWrapper from './ComponentWrapper'
import { changeStyleWithScale } from '@/components/canvas/utils/translate'
import { uuid } from 'vue-uuid'
import { deepCopy } from '@/components/canvas/utils/utils'
import eventBus from '@/components/canvas/utils/eventBus'
import elementResizeDetectorMaker from 'element-resize-detector'
import UserViewDialog from '@/components/canvas/custom-component/UserViewDialog'
import CanvasOptBar from '@/components/canvas/components/Editor/CanvasOptBar'
export default {
components: { ComponentWrapper, UserViewDialog, CanvasOptBar },
model: {
prop: 'show',
event: 'change'
},
props: {
screenShot: {
type: Boolean,
default: false
},
show: {
type: Boolean,
default: false
},
showType: {
type: String,
required: false,
default: 'full'
},
inScreen: {
type: Boolean,
required: false,
default: true
}
},
data() {
return {
isShowPreview: false,
panelId: '',
needToChangeHeight: [
'top',
'height'
],
needToChangeWidth: [
'left',
'width',
'fontSize',
'borderWidth',
'letterSpacing'
],
scaleWidth: '100',
scaleHeight: '100',
timer: null,
componentDataShow: [],
mainWidth: '100%',
mainHeight: '100%',
searchCount: 0,
chartDetailsVisible: false,
showChartInfo: {},
showChartTableInfo: {}
}
},
computed: {
customStyle() {
let style = {
width: '100%'
}
if (this.canvasStyleData.openCommonStyle) {
if (this.canvasStyleData.panel.backgroundType === 'image' && this.canvasStyleData.panel.imageUrl) {
style = {
background: `url(${this.canvasStyleData.panel.imageUrl}) no-repeat`,
...style
}
} else if (this.canvasStyleData.panel.backgroundType === 'color') {
style = {
background: this.canvasStyleData.panel.color,
...style
}
}
}
return style
},
screenShotStyle() {
return this.screenShot ? this.customStyle : {}
},
// componentData mapState
componentDataInfo() {
return this.componentDataShow
},
...mapState([
'isClickComponent',
'curComponent',
'componentData',
'canvasStyleData',
'componentGap'
])
},
watch: {
componentData: {
handler(newVal, oldVla) {
this.restore()
},
deep: true
},
canvasStyleData: {
handler(newVal, oldVla) {
this.canvasStyleDataInit()
},
deep: true
}
},
mounted() {
const _this = this
const erd = elementResizeDetectorMaker()
// div
const mainDom = document.getElementById('canvasInfoMain')
erd.listenTo(mainDom, element => {
_this.$nextTick(() => {
_this.restore()
})
})
// div
const tempCanvas = document.getElementById('canvasInfoTemp')
erd.listenTo(tempCanvas, element => {
_this.$nextTick(() => {
// mainHeight px html2canvas
_this.mainHeight = tempCanvas.scrollHeight + 'px!important'
})
})
eventBus.$on('openChartDetailsDialog', this.openChartDetailsDialog)
_this.$store.commit('clearLinkageSettingInfo', false)
_this.canvasStyleDataInit()
},
beforeDestroy() {
clearInterval(this.timer)
},
methods: {
canvasStyleDataInit() {
//
this.searchCount = 0
this.timer && clearInterval(this.timer)
let refreshTime = 300000
if (this.canvasStyleData.refreshTime && this.canvasStyleData.refreshTime > 0) {
if (this.canvasStyleData.refreshUnit === 'second') {
refreshTime = this.canvasStyleData.refreshTime * 1000
} else {
refreshTime = this.canvasStyleData.refreshTime * 60000
}
}
this.timer = setInterval(() => {
this.searchCount++
}, refreshTime)
},
changeStyleWithScale,
getStyle,
restore() {
const canvasHeight = document.getElementById('canvasInfoMain').offsetHeight
const canvasWidth = document.getElementById('canvasInfoMain').offsetWidth
this.scaleWidth = canvasWidth * 100 / parseInt(this.canvasStyleData.width)//
this.scaleHeight = canvasHeight * 100 / parseInt(this.canvasStyleData.height)//
this.handleScaleChange()
},
resetID(data) {
if (data) {
data.forEach(item => {
item.type !== 'custom' && (item.id = uuid.v1())
})
}
return data
},
format(value, scale) {
return value * parseInt(scale) / 100
},
handleScaleChange() {
if (this.componentData) {
const componentData = deepCopy(this.componentData)
componentData.forEach(component => {
Object.keys(component.style).forEach(key => {
if (this.needToChangeHeight.includes(key)) {
component.style[key] = this.format(component.style[key], this.scaleHeight)
}
if (this.needToChangeWidth.includes(key)) {
component.style[key] = this.format(component.style[key], this.scaleWidth)
}
})
})
this.componentDataShow = componentData
this.$nextTick(() => (eventBus.$emit('resizing', '')))
}
},
openChartDetailsDialog(chartInfo) {
this.showChartInfo = chartInfo.chart
this.showChartTableInfo = chartInfo.tableChart
this.chartDetailsVisible = true
},
exportExcel() {
this.$refs['userViewDialog'].exportExcel()
},
deselectCurComponent(e) {
if (!this.isClickComponent) {
this.$store.commit('setCurComponent', { component: null, index: null })
}
},
handleMouseDown() {
this.$store.commit('setClickComponentStatus', false)
}
}
}
</script>
<style lang="scss" scoped>
.bg {
padding: 5px;
min-width: 600px;
min-height: 300px;
width: 100%;
height: 100%;
overflow-x: hidden;
background-size: 100% 100% !important;
}
.main-class {
width: 100%;
height: 100%;
background-size: 100% 100% !important;
}
.custom-position {
flex: 1;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 14px;
flex-flow: row nowrap;
color: #9ea6b2;
}
.gap_class {
padding: 5px;
}
.dialog-css > > > .el-dialog__title {
font-size: 14px;
}
.dialog-css > > > .el-dialog__header {
padding: 20px 20px 0;
}
.dialog-css > > > .el-dialog__body {
padding: 10px 20px 20px;
}
::-webkit-scrollbar {
width: 0px!important;
height: 0px!important;
}
</style>

View File

@ -13,7 +13,7 @@
<el-dropdown-item icon="el-icon-arrow-down" @click.native="downComponent">{{ $t('panel.downComponent') }}</el-dropdown-item>
<el-dropdown-item v-if="'view'===curComponent.type" icon="el-icon-link" @click.native="linkageSetting">{{ $t('panel.linkage_setting') }}</el-dropdown-item>
<el-dropdown-item v-if="'de-tabs'===curComponent.type" icon="el-icon-link" @click.native="addTab">{{ $t('panel.add_tab') }}</el-dropdown-item>
<el-dropdown-item v-if="'view'===curComponent.type" icon="el-icon-connection" @click.native="linkJumpSet">跳转设置</el-dropdown-item>
<el-dropdown-item v-if="'view'===curComponent.type" icon="el-icon-connection" @click.native="linkJumpSet">跳转设置</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>

View File

@ -347,25 +347,9 @@ export default {
auxiliaryMatrixChange() {
this.canvasStyleData.auxiliaryMatrix = !this.canvasStyleData.auxiliaryMatrix
},
//
openMobileLayout() {
this.$store.commit('setComponentDataCache', JSON.stringify(this.componentData))
this.$store.commit('setPcComponentData', this.componentData)
const mainComponentData = []
//
this.componentData.forEach(item => {
if (item.mobileSelected) {
item.style = item.mobileStyle.style
item.x = item.mobileStyle.x
item.y = item.mobileStyle.y
item.sizex = item.mobileStyle.sizex
item.sizey = item.mobileStyle.sizey
item.auxiliaryMatrix = item.mobileStyle.auxiliaryMatrix
mainComponentData.push(item)
}
})
this.$store.commit('setComponentData', mainComponentData)
this.$store.commit('setMobileLayoutStatus', !this.mobileLayoutStatus)
this.$store.commit('openMobileLayout')
},
editSave() {
if (this.mobileLayoutStatus) {

View File

@ -8,6 +8,7 @@
'rect-shape'
]"
>
<EditBarView v-if="editBarViewShowFlag" :is-edit="isEdit" :view-id="element.propValue.viewId" @showViewDetails="openChartDetailsDialog" />
<div v-if="requestStatus==='error'" class="chart-error-class">
<div class="chart-error-message-class">
{{ message }},{{ $t('chart.chart_show_error') }}
@ -67,10 +68,11 @@ import { getToken, getLinkToken } from '@/utils/auth'
import DrillPath from '@/views/chart/view/DrillPath'
import { areaMapping } from '@/api/map/map'
import ChartComponentG2 from '@/views/chart/components/ChartComponentG2'
import EditBarView from '@/components/canvas/components/Editor/EditBarView'
export default {
name: 'UserView',
components: { ChartComponent, TableNormal, LabelNormal, DrillPath, ChartComponentG2 },
components: { EditBarView, ChartComponent, TableNormal, LabelNormal, DrillPath, ChartComponentG2 },
props: {
element: {
type: Object,
@ -93,10 +95,19 @@ export default {
required: false,
default: false
},
// eslint-disable-next-line vue/require-default-prop
componentIndex: {
type: Number,
required: false
},
inTab: {
type: Boolean,
required: false,
default: false
},
isEdit: {
type: Boolean,
require: false,
default: true
}
},
data() {
@ -120,6 +131,9 @@ export default {
}
},
computed: {
editBarViewShowFlag() {
return this.active && this.inTab
},
charViewShowFlag() {
return this.httpRequest.status && this.chart.type && !this.chart.type.includes('table') && !this.chart.type.includes('text') && this.renderComponent() === 'echarts'
},
@ -566,31 +580,31 @@ export default {
display: block !important;
}
.rect-shape > i {
right: 5px;
color: gray;
position: absolute;
}
/*.rect-shape > i {*/
/* right: 5px;*/
/* color: gray;*/
/* position: absolute;*/
/*}*/
.rect-shape > > > i:hover {
color: red;
}
/*.rect-shape > > > i:hover {*/
/* color: red;*/
/*}*/
.rect-shape:hover > > > .icon-fangda {
z-index: 2;
display: block;
}
/*.rect-shape:hover > > > .icon-fangda {*/
/* z-index: 2;*/
/* display: block;*/
/*}*/
.rect-shape > > > .icon-fangda {
display: none
}
/*.rect-shape > > > .icon-fangda {*/
/* display: none*/
/*}*/
.rect-shape:hover > > > .icon-shezhi {
z-index: 2;
display: block;
}
/*.rect-shape:hover > > > .icon-shezhi {*/
/* z-index: 2;*/
/* display: block;*/
/*}*/
.rect-shape > > > .icon-shezhi {
display: none
}
/*.rect-shape > > > .icon-shezhi {*/
/* display: none*/
/*}*/
</style>

View File

@ -0,0 +1,93 @@
<template>
<div v-loading="dataLoading" class="bg">
<Preview v-if="!dataLoading" />
</div>
</template>
<script>
import Preview from './Preview'
import { uuid } from 'vue-uuid'
import { findOne } from '@/api/panel/panel'
import { getPanelAllLinkageInfo } from '@/api/panel/linkage'
import { queryPanelJumpInfo, queryTargetPanelJumpInfo } from '@/api/panel/linkJump'
export default {
components: { Preview },
props: {
panelId: {
type: String,
require: true
}
},
data() {
return {
dataLoading: false
}
},
mounted() {
this.restore()
},
methods: {
restore() {
this.dataLoading = true
//
findOne(this.panelId).then(response => {
this.dataLoading = false
this.$store.commit('setComponentData', this.resetID(JSON.parse(response.data.panelData)))
this.$store.commit('setCanvasStyle', JSON.parse(response.data.panelStyle))
const data = {
id: response.data.id,
name: response.data.name
}
//
getPanelAllLinkageInfo(this.panelId).then(rsp => {
this.$store.commit('setNowPanelTrackInfo', rsp.data)
})
//
queryPanelJumpInfo(this.panelId).then(rsp => {
this.$store.commit('setNowPanelJumpInfo', rsp.data)
})
//
const tempParam = localStorage.getItem('jumpInfoParam')
if (tempParam) {
localStorage.removeItem('jumpInfoParam')
const jumpParam = JSON.parse(tempParam)
const jumpRequestParam = {
sourcePanelId: jumpParam.sourcePanelId,
sourceViewId: jumpParam.sourceViewId,
sourceFieldId: jumpParam.sourceFieldId,
targetPanelId: this.panelId
}
this.dataLoading = true
//
queryTargetPanelJumpInfo(jumpRequestParam).then(rsp => {
this.dataLoading = false
this.$store.commit('setNowTargetPanelJumpInfo', rsp.data)
this.$store.commit('addViewTrackFilter', jumpParam)
})
}
this.$store.dispatch('panel/setPanelInfo', data)
})
},
resetID(data) {
if (data) {
data.forEach(item => {
item.type !== 'custom' && (item.id = uuid.v1())
})
}
return data
}
}
}
</script>
<style lang="scss" scoped>
.bg {
width: 100%;
height: 100vh!important;
min-width: 800px;
min-height: 600px;
background-color: #f7f8fa;
}
</style>

View File

@ -35,7 +35,7 @@
</span>
<div v-if="activeTabName === item.name" class="de-tab-content">
<user-view v-if="item.content && item.content.propValue && item.content.propValue.viewId" :ref="item.name" :element="item.content" :out-style="outStyle" />
<user-view v-if="item.content && item.content.propValue && item.content.propValue.viewId" :ref="item.name" :in-tab="true" :is-edit="isEdit" :active="active" :element="item.content" :out-style="outStyle" />
</div>
</el-tab-pane>
@ -94,6 +94,7 @@ import ViewSelect from '@/views/panel/ViewSelect'
import { uuid } from 'vue-uuid'
import bus from '@/utils/bus'
import componentList from '@/components/canvas/custom-component/component-list'
import { mapState } from 'vuex'
export default {
name: 'DeTabls',
@ -107,6 +108,10 @@ export default {
type: Boolean,
default: true
},
active: {
type: Boolean,
default: false
},
outStyle: {
type: Object,
required: false,
@ -129,11 +134,24 @@ export default {
tabList: []
}
},
watch: {
curComponent: {
handler(newVal, oldVla) {
console.log(newVal)
},
deep: true
}
},
created() {
bus.$on('add-new-tab', this.addNewTab)
this.tabList = this.element.options && this.element.options.tabList
this.activeTabName = this.tabList[0].name
},
computed: {
...mapState([
'curComponent'
])
},
methods: {
beforeHandleCommond(item, param) {
return {

View File

@ -973,7 +973,26 @@ export default {
next: 'Next',
select_dataset: 'Select Dataset',
select_chart_type: 'Select Chart Type',
recover: 'Reset'
recover: 'Reset',
yoy_label: 'YOY/MOM',
yoy_setting: 'Setting',
pls_select_field: 'Select Field',
compare_date: 'Compare Date',
compare_type: 'Compare Type',
compare_data: 'Data Setting',
year_yoy: 'Year yoy',
month_yoy: 'Month yoy',
quarter_yoy: 'Quarter yoy',
week_yoy: 'Week yoy',
day_yoy: 'Day yoy',
year_mom: 'Year mom',
month_mom: 'Month mom',
quarter_mom: 'Quarter mom',
week_mom: 'Week mom',
day_mom: 'Day mom',
data_sub: 'Sub',
data_percent: 'Percent',
compare_calc_expression: 'Expression'
},
dataset: {
sheet_warn: 'There are multiple sheet pages, and the first one is extracted by default',

View File

@ -973,8 +973,26 @@ export default {
preview: '上一步',
next: '下一步',
select_dataset: '選擇數據集',
select_chart_type: '選擇圖表類型',
recover: '重置'
recover: '重置',
yoy_label: '同比/環比',
yoy_setting: '同環比設置',
pls_select_field: '請選擇字段',
compare_date: '對比日期',
compare_type: '對比類型',
compare_data: '數據設置',
year_yoy: '年同比',
month_yoy: '月同比',
quarter_yoy: '季同比',
week_yoy: '周同比',
day_yoy: '日同比',
year_mom: '年環比',
month_mom: '月環比',
quarter_mom: '季環比',
week_mom: '周環比',
day_mom: '日環比',
data_sub: '對比差值',
data_percent: '差值百分比',
compare_calc_expression: '計算公式'
},
dataset: {
sheet_warn: '有多個 Sheet 頁,默認抽取第一個',

View File

@ -976,7 +976,26 @@ export default {
next: '下一步',
select_dataset: '选择数据集',
select_chart_type: '选择图表类型',
recover: '重置'
recover: '重置',
yoy_label: '同比/环比',
yoy_setting: '同环比设置',
pls_select_field: '请选择字段',
compare_date: '对比日期',
compare_type: '对比类型',
compare_data: '数据设置',
year_yoy: '年同比',
month_yoy: '月同比',
quarter_yoy: '季同比',
week_yoy: '周同比',
day_yoy: '日同比',
year_mom: '年环比',
month_mom: '月环比',
quarter_mom: '季环比',
week_mom: '周环比',
day_mom: '日环比',
data_sub: '对比差值',
data_percent: '差值百分比',
compare_calc_expression: '计算公式'
},
dataset: {
sheet_warn: '有多个 Sheet 页,默认抽取第一个',

View File

@ -75,7 +75,6 @@ router.beforeEach(async(to, from, next) => {
export const loadMenus = (next, to) => {
buildMenus().then(res => {
const datas = res.data
disableSomeMenu(datas)
const filterDatas = filterRouter(datas)
const asyncRouter = filterAsyncRouter(filterDatas)
asyncRouter.push({ path: '*', redirect: '/404', hidden: true })
@ -89,17 +88,6 @@ export const loadMenus = (next, to) => {
})
})
}
const disableSomeMenu = datas => {
datas.forEach(menu => {
if (menu.name === 'system') {
menu.children.forEach(item => {
if (item.name === 'sys-task') {
item.children = [item.children[0]]
}
})
}
})
}
/**
* 验证path是否有效

View File

@ -325,6 +325,26 @@ const data = {
},
setMobileLayoutStatus(state, status) {
state.mobileLayoutStatus = status
},
// 启用移动端布局
openMobileLayout(state) {
state.componentDataCache = JSON.stringify(state.componentData)
state.pcComponentData = state.componentData
const mainComponentData = []
// 移动端布局转换
state.componentData.forEach(item => {
if (item.mobileSelected) {
item.style = item.mobileStyle.style
item.x = item.mobileStyle.x
item.y = item.mobileStyle.y
item.sizex = item.mobileStyle.sizex
item.sizey = item.mobileStyle.sizey
item.auxiliaryMatrix = item.mobileStyle.auxiliaryMatrix
mainComponentData.push(item)
}
})
state.componentData = mainComponentData
state.mobileLayoutStatus = !state.mobileLayoutStatus
}
},
modules: {

View File

@ -0,0 +1,29 @@
export const compareItem = {
type: 'none', // year-yoy/month-yoy等
resultData: 'percent', // 对比差sub百分比percent等
field: '',
custom: {
field: '',
calcType: '0', // 0-增长值1-增长率
timeType: '0', // 0-固定日期1-日期区间
currentTime: '',
compareTime: '',
currentTimeRange: [],
compareTimeRange: []
}
}
export const compareYearList = [
{ name: 'year_mom', value: 'year_mom' }
]
export const compareMonthList = [
{ name: 'month_mom', value: 'month_mom' },
{ name: 'year_yoy', value: 'year_yoy' }
]
export const compareDayList = [
{ name: 'day_mom', value: 'day_mom' },
{ name: 'month_yoy', value: 'month_yoy' },
{ name: 'year_yoy', value: 'year_yoy' }
]

View File

@ -0,0 +1,121 @@
<template>
<div>
<el-form ref="form" :model="compareItem.compareCalc" label-width="80px" size="mini" class="compare-form">
<el-form-item :label="$t('chart.compare_date')">
<el-select v-model="compareItem.compareCalc.field" :placeholder="$t('chart.pls_select_field')" size="mini" @change="initCompareType">
<el-option v-for="field in fieldList" :key="field.id" :label="field.name + '(' + $t('chart.' + field.dateStyle) + ')'" :value="field.id" />
</el-select>
</el-form-item>
<el-form-item :label="$t('chart.compare_type')">
<el-radio-group v-model="compareItem.compareCalc.type">
<el-radio v-for="radio in compareList" :key="radio.value" :label="radio.value">{{ $t('chart.' + radio.value) }}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item :label="$t('chart.compare_data')">
<el-radio-group v-model="compareItem.compareCalc.resultData">
<el-radio label="sub">{{ $t('chart.data_sub') }}</el-radio>
<el-radio label="percent">{{ $t('chart.data_percent') }}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item :label="$t('chart.compare_calc_expression')">
<span v-if="compareItem.compareCalc.resultData === 'sub'" class="exp-style">本期数据 - 上期数据</span>
<span v-else-if="compareItem.compareCalc.resultData === 'percent'" class="exp-style">(本期数据 / 上期数据 - 1) * 100%</span>
</el-form-item>
</el-form>
</div>
</template>
<script>
import { compareDayList, compareMonthList, compareYearList } from '@/views/chart/chart/compare'
export default {
name: 'CompareEdit',
props: {
compareItem: {
type: Object,
required: true
},
chart: {
type: Object,
required: true
}
},
data() {
return {
fieldList: [],
compareList: []
}
},
watch: {
'chart': function() {
this.initFieldList()
this.initCompareType()
}
},
mounted() {
this.initFieldList()
this.initCompareType()
},
methods: {
// xaxisextStack
initFieldList() {
const xAxis = JSON.parse(this.chart.xaxis)
const t1 = xAxis.filter(ele => { return ele.deType === 1 })
this.fieldList = t1
//
if ((!this.compareItem.compareCalc.field || this.compareItem.compareCalc.field === '') && this.fieldList.length > 0) {
this.compareItem.compareCalc.field = this.fieldList[0].id
}
},
//
initCompareType() {
const checkedField = this.fieldList.filter(ele => ele.id === this.compareItem.compareCalc.field)
if (checkedField && checkedField.length > 0) {
switch (checkedField[0].dateStyle) {
case 'y':
this.compareList = compareYearList
break
case 'y_M':
this.compareList = compareMonthList
break
case 'y_M_d':
this.compareList = compareDayList
break
default:
break
}
} else {
this.compareList = []
}
//
if ((!this.compareItem.compareCalc.type || this.compareItem.compareCalc.type === '' || this.compareItem.compareCalc.type === 'none') && this.compareList.length > 0) {
this.compareItem.compareCalc.type = this.compareList[0].value
}
}
}
}
</script>
<style scoped>
.el-form-item{
margin-bottom: 10px!important;
}
.compare-form >>> .el-form-item__label{
font-size: 12px!important;
font-weight: 400!important;
}
.compare-form >>> .el-radio__label{
font-size: 12px!important;
font-weight: 400!important;
}
.el-select-dropdown__item >>> span{
font-size: 12px!important;
}
.exp-style{
color: #C0C4CC;
font-size: 12px;
}
</style>

View File

@ -11,6 +11,9 @@
</span>
<span class="item-span-style" :title="item.name">{{ item.name }}</span>
<span v-if="item.summary" class="summary-span">{{ $t('chart.'+item.summary) }}</span>
<span v-if="item.deType === 1" class="summary-span">
{{ $t('chart.' + item.dateStyle) }}
</span>
</el-tag>
<el-dropdown v-else trigger="click" size="mini" @command="clickItem">
<span class="el-dropdown-link">
@ -25,6 +28,9 @@
</span>
<span class="item-span-style" :title="item.name">{{ item.name }}</span>
<span v-if="item.summary" class="summary-span">{{ $t('chart.'+item.summary) }}</span>
<span v-if="item.deType === 1" class="summary-span">
{{ $t('chart.' + item.dateStyle) }}
</span>
<i class="el-icon-arrow-down el-icon--right" style="position: absolute;top: 6px;right: 10px;" />
</el-tag>
<el-dropdown-menu slot="dropdown">
@ -239,7 +245,7 @@ export default {
.item-span-style{
display: inline-block;
width: 80px;
width: 70px;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
@ -254,6 +260,6 @@ export default {
margin-left: 4px;
color: #878d9f;
position: absolute;
right: 30px;
right: 25px;
}
</style>

View File

@ -10,6 +10,9 @@
<svg-icon v-if="item.sort === 'desc'" icon-class="sort-desc" class-name="field-icon-sort" />
</span>
<span class="item-span-style" :title="item.name">{{ item.name }}</span>
<span v-if="item.deType === 1" class="summary-span">
{{ $t('chart.' + item.dateStyle) }}
</span>
</el-tag>
<el-dropdown v-else trigger="click" size="mini" @command="clickItem">
<span class="el-dropdown-link">
@ -23,6 +26,9 @@
<svg-icon v-if="item.sort === 'desc'" icon-class="sort-desc" class-name="field-icon-sort" />
</span>
<span class="item-span-style" :title="item.name">{{ item.name }}</span>
<span v-if="item.deType === 1" class="summary-span">
{{ $t('chart.' + item.dateStyle) }}
</span>
<i class="el-icon-arrow-down el-icon--right" style="position: absolute;top: 6px;right: 10px;" />
</el-tag>
<el-dropdown-menu slot="dropdown">
@ -32,7 +38,7 @@
<span>
<i class="el-icon-sort" />
<span>{{ $t('chart.sort') }}</span>
<span class="summary-span">({{ $t('chart.'+item.sort) }})</span>
<span class="summary-span-item">({{ $t('chart.'+item.sort) }})</span>
</span>
<i class="el-icon-arrow-right el-icon--right" />
</span>
@ -53,7 +59,7 @@
<span>
<i class="el-icon-c-scale-to-original" />
<span>{{ $t('chart.dateStyle') }}</span>
<span class="summary-span">({{ $t('chart.'+item.dateStyle) }})</span>
<span class="summary-span-item">({{ $t('chart.'+item.dateStyle) }})</span>
</span>
<i class="el-icon-arrow-right el-icon--right" />
</span>
@ -61,7 +67,7 @@
<el-dropdown-item :command="beforeDateStyle('y')">{{ $t('chart.y') }}</el-dropdown-item>
<el-dropdown-item :command="beforeDateStyle('y_M')">{{ $t('chart.y_M') }}</el-dropdown-item>
<el-dropdown-item :command="beforeDateStyle('y_M_d')">{{ $t('chart.y_M_d') }}</el-dropdown-item>
<el-dropdown-item :command="beforeDateStyle('H_m_s')">{{ $t('chart.H_m_s') }}</el-dropdown-item>
<el-dropdown-item :command="beforeDateStyle('H_m_s')" divided>{{ $t('chart.H_m_s') }}</el-dropdown-item>
<el-dropdown-item :command="beforeDateStyle('y_M_d_H_m')">{{ $t('chart.y_M_d_H_m') }}</el-dropdown-item>
<el-dropdown-item :command="beforeDateStyle('y_M_d_H_m_s')">{{ $t('chart.y_M_d_H_m_s') }}</el-dropdown-item>
</el-dropdown-menu>
@ -73,7 +79,7 @@
<span>
<i class="el-icon-timer" />
<span>{{ $t('chart.datePattern') }}</span>
<span class="summary-span">({{ $t('chart.'+item.datePattern) }})</span>
<span class="summary-span-item">({{ $t('chart.'+item.datePattern) }})</span>
</span>
<i class="el-icon-arrow-right el-icon--right" />
</span>
@ -215,7 +221,9 @@ export default {
.summary-span{
margin-left: 4px;
color: #878d9f;;
color: #878d9f;
position: absolute;
right: 25px;
}
.inner-dropdown-menu{
@ -227,9 +235,14 @@ export default {
.item-span-style{
display: inline-block;
width: 80px;
width: 70px;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
.summary-span-item{
margin-left: 4px;
color: #878d9f;
}
</style>

View File

@ -13,7 +13,9 @@
<svg-icon v-if="item.sort === 'desc'" icon-class="sort-desc" class-name="field-icon-sort" />
</span>
<span class="item-span-style" :title="item.name">{{ item.name }}</span>
<span v-if="chart.type !== 'table-info' && item.summary" class="summary-span">{{ $t('chart.'+item.summary) }}</span>
<span v-if="chart.type !== 'table-info' && item.summary" class="summary-span">
{{ $t('chart.' + item.summary) }}<span v-if="item.compareCalc && item.compareCalc.type && item.compareCalc.type !== '' && item.compareCalc.type !== 'none'">-{{ $t('chart.' + item.compareCalc.type) }}</span>
</span>
</el-tag>
<el-dropdown v-else trigger="click" size="mini" @command="clickItem">
<span class="el-dropdown-link">
@ -30,7 +32,9 @@
<svg-icon v-if="item.sort === 'desc'" icon-class="sort-desc" class-name="field-icon-sort" />
</span>
<span class="item-span-style" :title="item.name">{{ item.name }}</span>
<span v-if="chart.type !== 'table-info' && item.summary" class="summary-span">{{ $t('chart.'+item.summary) }}</span>
<span v-if="chart.type !== 'table-info' && item.summary" class="summary-span">
{{ $t('chart.' + item.summary) }}<span v-if="item.compareCalc && item.compareCalc.type && item.compareCalc.type !== '' && item.compareCalc.type !== 'none'">-{{ $t('chart.' + item.compareCalc.type) }}</span>
</span>
<i class="el-icon-arrow-down el-icon--right" style="position: absolute;top: 6px;right: 10px;" />
</el-tag>
<el-dropdown-menu slot="dropdown">
@ -87,6 +91,25 @@
<!-- </el-dropdown-menu>-->
<!-- </el-dropdown>-->
<!-- </el-dropdown-item>-->
<!--同比/环比-->
<el-dropdown-item v-show="chart.type !== 'table-info'">
<el-dropdown placement="right-start" size="mini" style="width: 100%" @command="quickCalc">
<span class="el-dropdown-link inner-dropdown-menu">
<span>
<i class="el-icon-s-grid" />
<span>{{ $t('chart.quick_calc') }}</span>
<span class="summary-span-item">({{ !item.compareCalc ? $t('chart.none') : $t('chart.' + item.compareCalc.type) }})</span>
</span>
<i class="el-icon-arrow-right el-icon--right" />
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item :command="beforeQuickCalc('none')">{{ $t('chart.none') }}</el-dropdown-item>
<el-dropdown-item :disabled="disableEditCompare" :command="beforeQuickCalc('setting')">{{ $t('chart.yoy_label') }}...</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</el-dropdown-item>
<el-dropdown-item :divided="chart.type !== 'table-info'">
<el-dropdown placement="right-start" size="mini" style="width: 100%" @command="sort">
<span class="el-dropdown-link inner-dropdown-menu">
@ -120,6 +143,8 @@
</template>
<script>
import { compareItem } from '@/views/chart/chart/compare'
export default {
name: 'QuotaExtItem',
props: {
@ -142,12 +167,40 @@ export default {
},
data() {
return {
compareItem: compareItem,
disableEditCompare: false
}
},
watch: {
'chart.xaxis': function() {
this.isEnableCompare()
},
'chart.extStack': function() {
this.isEnableCompare()
}
},
mounted() {
this.init()
this.isEnableCompare()
},
methods: {
init() {
if (!this.item.compareCalc) {
this.item.compareCalc = JSON.parse(JSON.stringify(this.compareItem))
}
},
isEnableCompare() {
const xAxis = JSON.parse(this.chart.xaxis)
const t1 = xAxis.filter(ele => {
return ele.deType === 1
})
// /
if (t1.length === 1 && this.chart.type !== 'text' && this.chart.type !== 'gauge' && this.chart.type !== 'liquid') {
this.disableEditCompare = false
} else {
this.disableEditCompare = true
}
},
clickItem(param) {
if (!param) {
return
@ -195,7 +248,17 @@ export default {
},
quickCalc(param) {
switch (param.type) {
case 'none':
this.item.compareCalc.type = 'none'
this.$emit('onQuotaItemChange', this.item)
break
case 'setting':
this.editCompare()
break
default:
break
}
},
beforeQuickCalc(type) {
return {
@ -227,6 +290,12 @@ export default {
this.item.index = this.index
this.item.filterType = 'quotaExt'
this.$emit('editItemFilter', this.item)
},
editCompare() {
this.item.index = this.index
this.item.calcType = 'quotaExt'
this.$emit('editItemCompare', this.item)
}
}
}
@ -264,7 +333,7 @@ export default {
margin-left: 4px;
color: #878d9f;
position: absolute;
right: 30px;
right: 25px;
}
.inner-dropdown-menu{
@ -276,7 +345,7 @@ export default {
.item-span-style{
display: inline-block;
width: 70px;
width: 50px;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;

View File

@ -13,7 +13,9 @@
<svg-icon v-if="item.sort === 'desc'" icon-class="sort-desc" class-name="field-icon-sort" />
</span>
<span class="item-span-style" :title="item.name">{{ item.name }}</span>
<span v-if="chart.type !== 'table-info' && item.summary" class="summary-span">{{ $t('chart.'+item.summary) }}</span>
<span v-if="chart.type !== 'table-info' && item.summary" class="summary-span">
{{ $t('chart.' + item.summary) }}<span v-if="item.compareCalc && item.compareCalc.type && item.compareCalc.type !== '' && item.compareCalc.type !== 'none'">-{{ $t('chart.' + item.compareCalc.type) }}</span>
</span>
</el-tag>
<el-dropdown v-else trigger="click" size="mini" @command="clickItem">
<span class="el-dropdown-link">
@ -30,7 +32,9 @@
<svg-icon v-if="item.sort === 'desc'" icon-class="sort-desc" class-name="field-icon-sort" />
</span>
<span class="item-span-style" :title="item.name">{{ item.name }}</span>
<span v-if="chart.type !== 'table-info' && item.summary" class="summary-span">{{ $t('chart.'+item.summary) }}</span>
<span v-if="chart.type !== 'table-info' && item.summary" class="summary-span">
{{ $t('chart.' + item.summary) }}<span v-if="item.compareCalc && item.compareCalc.type && item.compareCalc.type !== '' && item.compareCalc.type !== 'none'">-{{ $t('chart.' + item.compareCalc.type) }}</span>
</span>
<i class="el-icon-arrow-down el-icon--right" style="position: absolute;top: 6px;right: 10px;" />
</el-tag>
<el-dropdown-menu slot="dropdown">
@ -87,6 +91,25 @@
<!-- </el-dropdown-menu>-->
<!-- </el-dropdown>-->
<!-- </el-dropdown-item>-->
<!--同比/环比-->
<el-dropdown-item v-show="chart.type !== 'table-info'">
<el-dropdown placement="right-start" size="mini" style="width: 100%" @command="quickCalc">
<span class="el-dropdown-link inner-dropdown-menu">
<span>
<i class="el-icon-s-grid" />
<span>{{ $t('chart.quick_calc') }}</span>
<span class="summary-span-item">({{ !item.compareCalc ? $t('chart.none') : $t('chart.' + item.compareCalc.type) }})</span>
</span>
<i class="el-icon-arrow-right el-icon--right" />
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item :command="beforeQuickCalc('none')">{{ $t('chart.none') }}</el-dropdown-item>
<el-dropdown-item :disabled="disableEditCompare" :command="beforeQuickCalc('setting')">{{ $t('chart.yoy_label') }}...</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</el-dropdown-item>
<el-dropdown-item :divided="chart.type !== 'table-info'">
<el-dropdown placement="right-start" size="mini" style="width: 100%" @command="sort">
<span class="el-dropdown-link inner-dropdown-menu">
@ -120,6 +143,8 @@
</template>
<script>
import { compareItem } from '@/views/chart/chart/compare'
export default {
name: 'QuotaItem',
props: {
@ -142,12 +167,37 @@ export default {
},
data() {
return {
compareItem: compareItem,
disableEditCompare: false
}
},
watch: {
'chart': function() {
this.isEnableCompare()
}
},
mounted() {
this.init()
this.isEnableCompare()
},
methods: {
init() {
if (!this.item.compareCalc) {
this.item.compareCalc = JSON.parse(JSON.stringify(this.compareItem))
}
},
isEnableCompare() {
const xAxis = JSON.parse(this.chart.xaxis)
const t1 = xAxis.filter(ele => {
return ele.deType === 1
})
// /
if (t1.length === 1 && this.chart.type !== 'text' && this.chart.type !== 'gauge' && this.chart.type !== 'liquid') {
this.disableEditCompare = false
} else {
this.disableEditCompare = true
}
},
clickItem(param) {
if (!param) {
return
@ -195,7 +245,17 @@ export default {
},
quickCalc(param) {
switch (param.type) {
case 'none':
this.item.compareCalc.type = 'none'
this.$emit('onQuotaItemChange', this.item)
break
case 'setting':
this.editCompare()
break
default:
break
}
},
beforeQuickCalc(type) {
return {
@ -227,6 +287,12 @@ export default {
this.item.index = this.index
this.item.filterType = 'quota'
this.$emit('editItemFilter', this.item)
},
editCompare() {
this.item.index = this.index
this.item.calcType = 'quota'
this.$emit('editItemCompare', this.item)
}
}
}
@ -264,7 +330,7 @@ export default {
margin-left: 4px;
color: #878d9f;
position: absolute;
right: 30px;
right: 25px;
}
.inner-dropdown-menu{
@ -276,7 +342,7 @@ export default {
.item-span-style{
display: inline-block;
width: 70px;
width: 50px;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;

View File

@ -330,6 +330,7 @@
@onQuotaItemRemove="quotaItemRemove"
@editItemFilter="showQuotaEditFilter"
@onNameEdit="showRename"
@editItemCompare="showQuotaEditCompare"
/>
</transition-group>
</draggable>
@ -365,6 +366,7 @@
@onQuotaItemRemove="quotaItemRemove"
@editItemFilter="showQuotaEditFilter"
@onNameEdit="showRename"
@editItemCompare="showQuotaEditCompare"
/>
</transition-group>
</draggable>
@ -858,8 +860,8 @@
<p style="margin-top: 10px;color:#F56C6C;font-size: 12px;">{{ $t('chart.change_ds_tip') }}</p>
<div slot="footer" class="dialog-footer">
<el-button size="mini" @click="closeChangeChart">{{ $t('chart.cancel') }}</el-button>
<el-button type="primary" size="mini" :disabled="!changeTable || !changeTable.id" @click="changeChart">{{
$t('chart.confirm') }}
<el-button type="primary" size="mini" :disabled="!changeTable || !changeTable.id" @click="changeChart">
{{ $t('chart.confirm') }}
</el-button>
</div>
</el-dialog>
@ -881,11 +883,27 @@
<el-button size="mini" style="float: right;" @click="closeEditDsField">{{ $t('chart.close') }}</el-button>
</div>
</el-dialog>
<el-dialog
v-if="showEditQuotaCompare"
v-dialogDrag
:title="$t('chart.yoy_setting')"
:visible="showEditQuotaCompare"
:show-close="false"
width="600px"
class="dialog-css"
>
<compare-edit :compare-item="quotaItemCompare" :chart="chart" />
<div slot="footer" class="dialog-footer">
<el-button size="mini" @click="closeQuotaEditCompare">{{ $t('chart.cancel') }}</el-button>
<el-button type="primary" size="mini" @click="saveQuotaEditCompare">{{ $t('chart.confirm') }}</el-button>
</div>
</el-dialog>
</el-row>
</template>
<script>
import { ajaxGetData, ajaxGetDataOnly, post } from '@/api/chart/chart'
import { ajaxGetDataOnly, post } from '@/api/chart/chart'
import draggable from 'vuedraggable'
import DimensionItem from '../components/drag-item/DimensionItem'
import QuotaItem from '../components/drag-item/QuotaItem'
@ -904,12 +922,12 @@ import {
DEFAULT_LABEL,
DEFAULT_LEGEND_STYLE,
DEFAULT_SIZE,
DEFAULT_SPLIT,
DEFAULT_TITLE_STYLE,
DEFAULT_TOOLTIP,
DEFAULT_XAXIS_STYLE,
DEFAULT_YAXIS_STYLE,
DEFAULT_SPLIT,
DEFAULT_YAXIS_EXT_STYLE
DEFAULT_YAXIS_EXT_STYLE,
DEFAULT_YAXIS_STYLE
} from '../chart/chart'
import ColorSelector from '../components/shape-attr/ColorSelector'
import SizeSelector from '../components/shape-attr/SizeSelector'
@ -942,10 +960,13 @@ import YAxisSelectorAntV from '@/views/chart/components/component-style/YAxisSel
import YAxisExtSelectorAntV from '@/views/chart/components/component-style/YAxisExtSelectorAntV'
import SizeSelectorAntV from '@/views/chart/components/shape-attr/SizeSelectorAntV'
import SplitSelectorAntV from '@/views/chart/components/component-style/SplitSelectorAntV'
import CompareEdit from '@/views/chart/components/compare/CompareEdit'
import { compareItem } from '@/views/chart/chart/compare'
export default {
name: 'ChartEdit',
components: {
CompareEdit,
SplitSelectorAntV,
SizeSelectorAntV,
YAxisExtSelectorAntV,
@ -1071,7 +1092,9 @@ export default {
{ name: 'ECharts', value: 'echarts' }
],
drill: false,
hasEdit: false
hasEdit: false,
quotaItemCompare: {},
showEditQuotaCompare: false
}
},
computed: {
@ -1217,6 +1240,9 @@ export default {
if (!ele.filter) {
ele.filter = []
}
if (!ele.compareCalc) {
ele.compareCalc = compareItem
}
})
if (view.type === 'chart-mix') {
view.yaxisExt.forEach(function(ele) {
@ -1236,6 +1262,9 @@ export default {
if (!ele.filter) {
ele.filter = []
}
if (!ele.compareCalc) {
ele.compareCalc = compareItem
}
})
}
view.extStack.forEach(function(ele) {
@ -1489,12 +1518,6 @@ export default {
},
quotaItemChange(item) {
// item
// this.view.yaxis.forEach(function(ele) {
// if (ele.id === item.id) {
// ele.summary = item.summary
// }
// })
this.calcData(true)
},
@ -1673,6 +1696,24 @@ export default {
// this.itemForm = {}
},
showQuotaEditCompare(item) {
this.quotaItemCompare = JSON.parse(JSON.stringify(item))
this.showEditQuotaCompare = true
},
closeQuotaEditCompare() {
this.showEditQuotaCompare = false
},
saveQuotaEditCompare() {
//
if (this.quotaItemCompare.calcType === 'quota') {
this.view.yaxis[this.quotaItemCompare.index].compareCalc = this.quotaItemCompare.compareCalc
} else if (this.quotaItemCompare.calcType === 'quotaExt') {
this.view.yaxisExt[this.quotaItemCompare.index].compareCalc = this.quotaItemCompare.compareCalc
}
this.calcData(true)
this.closeQuotaEditCompare()
},
showTab() {
this.tabStatus = true
},

View File

@ -16,7 +16,7 @@
<el-divider />
<div>
<el-form :inline="true" style="display: flex;align-items: center;justify-content: space-between;">
<el-form-item class="form-item">
<el-form-item class="form-item" :label="$t('commons.name')">
<el-input v-model="name" size="mini" :placeholder="$t('commons.name')" clearable />
</el-form-item>
<el-form-item class="form-item">
@ -59,7 +59,7 @@
</div>
<!--选择数据集-->
<el-dialog v-dialogDrag :title="$t('chart.select_dataset')" :visible="selectDsDialog" :show-close="false" width="360px" class="dialog-css" destroy-on-close>
<el-dialog v-if="selectDsDialog" v-dialogDrag :title="$t('chart.select_dataset')" :visible="selectDsDialog" :show-close="false" width="400px" class="dialog-css">
<dataset-group-selector-tree :fix-height="true" show-mode="union" :custom-type="customType" @getTable="firstDs" />
<div slot="footer" class="dialog-footer">
<el-button size="mini" @click="closeSelectDs()">{{ $t('dataset.cancel') }}</el-button>
@ -337,4 +337,8 @@ export default {
.preview-style >>> .el-drawer .el-drawer__body{
padding: 0 16px 10px!important;
}
.form-item >>> .el-form-item__label{
font-size: 12px!important;
font-weight: 400!important;
}
</style>

View File

@ -28,7 +28,7 @@
</div>
<!--选择数据集-->
<el-dialog v-dialogDrag :title="$t('chart.select_dataset')" :visible="selectDsDialog" :show-close="false" width="360px" class="dialog-css" destroy-on-close>
<el-dialog v-if="selectDsDialog" v-dialogDrag :title="$t('chart.select_dataset')" :visible="selectDsDialog" :show-close="false" width="400px" class="dialog-css">
<dataset-group-selector-tree :fix-height="true" show-mode="union" :custom-type="customType" :mode="currentNode.currentDs.mode" @getTable="firstDs" />
<div slot="footer" class="dialog-footer">
<el-button size="mini" @click="closeSelectDs()">{{ $t('dataset.cancel') }}</el-button>
@ -37,7 +37,7 @@
</el-dialog>
<!--编辑单个数据集字段-->
<el-dialog v-if="editField" v-dialogDrag :title="$t('dataset.field_select')" :visible="editField" :show-close="false" width="360px" class="dialog-css" destroy-on-close>
<el-dialog v-if="editField" v-dialogDrag :title="$t('dataset.field_select')" :visible="editField" :show-close="false" width="400px" class="dialog-css">
<union-field-edit :node="currentNode" />
<div slot="footer" class="dialog-footer">
<el-button size="mini" @click="closeEditField()">{{ $t('dataset.cancel') }}</el-button>

View File

@ -173,7 +173,7 @@ export default {
},
isTreeSearch: false,
treeStyle: this.fixHeight ? {
height: '200px',
height: '300px',
overflow: 'auto'
} : {}
}

View File

@ -56,7 +56,7 @@
<el-tab-pane :label="$t('dataset.field_manage')" name="fieldEdit">
<field-edit :param="param" :table="table" />
</el-tab-pane>
<el-tab-pane v-if="table.type !== 'custom' && !(table.type === 'sql' && table.mode === 0)" :label="$t('dataset.join_view')" name="joinView">
<el-tab-pane v-if="table.type !== 'union' && table.type !== 'custom' && !(table.type === 'sql' && table.mode === 0)" :label="$t('dataset.join_view')" name="joinView">
<union-view :param="param" :table="table" />
</el-tab-pane>
<el-tab-pane v-if="table.mode === 1 && (table.type === 'excel' || table.type === 'db' || table.type === 'sql')" :label="$t('dataset.update_info')" name="updateInfo">

View File

@ -82,7 +82,6 @@ export default {
width: 100%;
height: calc(100% - 30px);
overflow-y: auto;
background-color: lightgray;
}
.component-custom {
outline: none;

View File

@ -8,6 +8,7 @@
v-if="config.type==='custom'"
:id="'component' + config.id"
class="component-custom"
:style="getComponentStyleDefault(config.style)"
:out-style="outStyle"
:element="config"
/>
@ -17,6 +18,7 @@
ref="wrapperChild"
:out-style="outStyle"
:prop-value="config.propValue"
:style="getComponentStyleDefault(config.style)"
:is-edit="false"
:element="config"
:h="itemHeight"
@ -27,6 +29,7 @@
<script>
import { mapState } from 'vuex'
import MobileCheckBar from '@/components/canvas/components/Editor/MobileCheckBar'
import { getStyle } from '@/components/canvas/utils/style'
export default {
name: 'ComponentWaitItem',
@ -75,6 +78,9 @@ export default {
])
},
methods: {
getComponentStyleDefault(style) {
return getStyle(style, ['top', 'left', 'width', 'height', 'rotate'])
}
}
}
</script>

View File

@ -125,13 +125,14 @@
<el-row
id="canvasInfoMobile"
class="this_mobile_canvas_main"
:style="mobileCanvasStyle"
>
<Editor ref="editorMobile" :matrix-count="mobileMatrixCount" :out-style="outStyle" :scroll-top="scrollTop" />
</el-row>
<el-row class="this_mobile_canvas_bottom" />
</div>
</el-col>
<el-col :span="16" class="this_mobile_canvas_cell">
<el-col :span="16" class="this_mobile_canvas_cell this_mobile_canvas_wait_cell" :style="mobileCanvasStyle">
<component-wait />
</el-col>
</el-row>
@ -143,6 +144,7 @@
:title="(currentWidget && currentWidget.getLeftPanel && currentWidget.getLeftPanel().label ? $t(currentWidget.getLeftPanel().label) : '') + $t('panel.module')"
:visible.sync="filterVisible"
custom-class="de-filter-dialog"
@close="cancelFilter"
>
<filter-dialog v-if="filterVisible && currentWidget" :widget-info="currentWidget" :component-info="currentFilterCom" @re-fresh-component="reFreshComponent">
<component
@ -320,7 +322,9 @@ export default {
return !this.linkageSettingStatus && !this.mobileLayoutStatus
},
showAttr() {
if (this.curComponent && this.showAttrComponent.includes(this.curComponent.type)) {
if (this.mobileLayoutStatus) {
return false
} else if (this.curComponent && this.showAttrComponent.includes(this.curComponent.type)) {
//
if (this.curComponent.type === 'custom' && !this.curComponent.options.attrs.title) {
return false
@ -336,6 +340,25 @@ export default {
padding: this.componentGap + 'px'
}
},
mobileCanvasStyle() {
let style
if (this.canvasStyleData.openCommonStyle) {
if (this.canvasStyleData.panel.backgroundType === 'image' && this.canvasStyleData.panel.imageUrl) {
style = {
background: `url(${this.canvasStyleData.panel.imageUrl}) no-repeat`
}
} else if (this.canvasStyleData.panel.backgroundType === 'color') {
style = {
background: this.canvasStyleData.panel.color
}
} else {
style = {
background: '#f7f8fa'
}
}
}
return style
},
customCanvasStyle() {
let style = {
padding: this.componentGap + 'px'
@ -684,7 +707,6 @@ export default {
},
closeLeftPanel() {
this.show = false
// this.beforeDestroy()
},
previewFullScreen() {
this.previewVisible = true
@ -975,6 +997,10 @@ export default {
align-items: center;
justify-content: center;
}
.this_mobile_canvas_wait_cell{
background-size:100% 100% !important;
border: 2px solid #9ea6b2
}
.this_canvas{
width: 100%;

View File

@ -125,7 +125,7 @@ import SaveToTemplate from '@/views/panel/list/SaveToTemplate'
import { mapState } from 'vuex'
import html2canvas from 'html2canvasde'
import FileSaver from 'file-saver'
import { enshrineList, saveEnshrine, deleteEnshrine } from '@/api/panel/enshrine'
import { starStatus, saveEnshrine, deleteEnshrine } from '@/api/panel/enshrine'
import bus from '@/utils/bus'
import { queryAll } from '@/api/panel/pdfTemplate'
import ShareHead from '@/views/panel/GrantAuth/ShareHead'
@ -294,9 +294,8 @@ export default {
})
},
initHasStar() {
const param = {}
enshrineList(param).then(res => {
this.hasStar = res.data && res.data.some(item => item.panelGroupId === this.panelInfo.id)
starStatus(this.panelInfo.id).then(res => {
this.hasStar = res.data
})
},
refreshStarList(isStar) {

BIN
simsun.ttc Normal file

Binary file not shown.