Merge branch 'dev' into v1.18
This commit is contained in:
commit
f677880c13
18
.typos.toml
18
.typos.toml
@ -9,5 +9,21 @@ keynode = "keynode"
|
||||
SCHEM = "SCHEM"
|
||||
|
||||
[files]
|
||||
extend-exclude = ["public/", "amap-wx/", "m-icon/", "uni-card/", "uni-col/", "uni-link/", "uni-list/", "uni-list-item/", "uni-row/", "migration/", "mapFiles/", "frontend/src/views/chart/components/table/TableNormal.vue"]
|
||||
extend-exclude = [
|
||||
"public/",
|
||||
"amap-wx/",
|
||||
"m-icon/",
|
||||
"uni-card/",
|
||||
"uni-col/",
|
||||
"uni-link/",
|
||||
"uni-list/",
|
||||
"uni-list-item/",
|
||||
"uni-row/",
|
||||
"migration/",
|
||||
"mapFiles/",
|
||||
"core/frontend/src/views/chart/components/table/TableNormal.vue",
|
||||
"core/backend/src/main/java/io/dataease/ext/ExtSysUserMapper.xml",
|
||||
"core/backend/src/main/java/io/dataease/ext/AuthMapper.xml",
|
||||
"installer/dataease/templates/be.conf"
|
||||
]
|
||||
|
||||
|
||||
@ -4,9 +4,9 @@ import java.util.List;
|
||||
|
||||
import org.apache.shiro.authc.AuthenticationException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import groovy.lang.Lazy;
|
||||
import io.dataease.auth.api.dto.CurrentRoleDto;
|
||||
import io.dataease.auth.api.dto.CurrentUserDto;
|
||||
import io.dataease.auth.entity.SysUserEntity;
|
||||
|
||||
@ -3,13 +3,13 @@ package io.dataease.auth.service.impl;
|
||||
import io.dataease.auth.api.dto.CurrentRoleDto;
|
||||
import io.dataease.auth.entity.AccountLockStatus;
|
||||
import io.dataease.auth.entity.SysUserEntity;
|
||||
import io.dataease.commons.constants.ParamConstants;
|
||||
import io.dataease.commons.utils.CodingUtil;
|
||||
import io.dataease.exception.DataEaseException;
|
||||
import io.dataease.ext.*;
|
||||
import io.dataease.auth.service.AuthUserService;
|
||||
import io.dataease.commons.constants.AuthConstants;
|
||||
import io.dataease.commons.constants.ParamConstants;
|
||||
import io.dataease.commons.utils.CodingUtil;
|
||||
import io.dataease.commons.utils.LogUtil;
|
||||
import io.dataease.exception.DataEaseException;
|
||||
import io.dataease.ext.AuthMapper;
|
||||
import io.dataease.i18n.Translator;
|
||||
import io.dataease.plugins.common.base.domain.SysLoginLimit;
|
||||
import io.dataease.plugins.common.base.domain.SysLoginLimitExample;
|
||||
@ -27,8 +27,9 @@ import io.dataease.plugins.xpack.ldap.service.LdapXpackService;
|
||||
import io.dataease.plugins.xpack.loginlimit.dto.response.LoginLimitInfo;
|
||||
import io.dataease.plugins.xpack.loginlimit.service.LoginLimitXpackService;
|
||||
import io.dataease.plugins.xpack.oidc.service.OidcXpackService;
|
||||
|
||||
import io.dataease.plugins.xpack.wecom.service.WecomXpackService;
|
||||
import io.dataease.service.sys.SysUserService;
|
||||
import io.dataease.service.system.EmailService;
|
||||
import io.dataease.service.system.SystemParameterService;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
@ -36,6 +37,7 @@ import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.cache.annotation.CacheEvict;
|
||||
import org.springframework.cache.annotation.Cacheable;
|
||||
import org.springframework.cache.annotation.Caching;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@ -45,6 +47,8 @@ import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static io.dataease.commons.constants.ParamConstants.BASIC.LOCKED_EMAIL;
|
||||
|
||||
@Service
|
||||
public class AuthUserServiceImpl implements AuthUserService {
|
||||
|
||||
@ -62,6 +66,14 @@ public class AuthUserServiceImpl implements AuthUserService {
|
||||
@Resource
|
||||
private SystemParameterService systemParameterService;
|
||||
|
||||
@Resource
|
||||
private EmailService emailService;
|
||||
|
||||
@Lazy
|
||||
@Resource
|
||||
private SysUserService sysUserService;
|
||||
|
||||
|
||||
/**
|
||||
* 此处需被F2CRealm登录认证调用 也就是说每次请求都会被调用 所以最好加上缓存
|
||||
*
|
||||
@ -285,10 +297,30 @@ public class AuthUserServiceImpl implements AuthUserService {
|
||||
sysLoginLimit.setLoginType(logintype);
|
||||
sysLoginLimit.setRecordTime(now);
|
||||
sysLoginLimitMapper.insert(sysLoginLimit);
|
||||
return lockStatus(username, logintype);
|
||||
AccountLockStatus accountLockStatus = lockStatus(username, logintype);
|
||||
if (ObjectUtils.isNotEmpty(accountLockStatus) && accountLockStatus.getLocked()) {
|
||||
sendLockedEmail(username);
|
||||
}
|
||||
return accountLockStatus;
|
||||
|
||||
}
|
||||
|
||||
public void sendLockedEmail(String username) {
|
||||
String value = systemParameterService.getValue(LOCKED_EMAIL.getValue());
|
||||
if (StringUtils.isNotBlank(value) && StringUtils.equals("true", value)) {
|
||||
String email = sysUserService.adminEmail();
|
||||
if (StringUtils.isBlank(email)) return;
|
||||
String format = "账号【%s】登录失败次数过多,已被锁定!";
|
||||
String content = String.format(format, username);
|
||||
try {
|
||||
emailService.send(email, "账号锁定通知", content);
|
||||
} catch (Exception e) {
|
||||
LogUtil.error(e.getMessage(), e);
|
||||
systemParameterService.disabledLockedEmail();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unlockAccount(String username, Integer logintype) {
|
||||
SysLoginLimitExample example = new SysLoginLimitExample();
|
||||
|
||||
@ -116,7 +116,7 @@ public interface ParamConstants {
|
||||
DS_CHECK_INTERVAL_TYPE("basic.dsCheckIntervalType"),
|
||||
DEFAULT_LOGIN_TYPE("basic.loginType"),
|
||||
OPEN_HOME_PAGE("ui.openHomePage"),
|
||||
|
||||
AUTO_MOBILE("ui.autoMobile"),
|
||||
OPEN_MARKET_PAGE("ui.openMarketPage"),
|
||||
TEMPLATE_MARKET_ULR("basic.templateMarketUlr"),
|
||||
|
||||
@ -125,6 +125,7 @@ public interface ParamConstants {
|
||||
LOGIN_LIMIT_RELIEVETIMES("loginlimit.relieveTimes"),
|
||||
|
||||
LOGIN_LIMIT_OPEN("loginlimit.open"),
|
||||
LOCKED_EMAIL("loginlimit.lockedEmail"),
|
||||
|
||||
SCAN_CREATE_USER("loginlimit.scanCreateUser"),
|
||||
|
||||
|
||||
@ -14,7 +14,7 @@ public class PanelTemplateRequest extends PanelTemplateWithBLOBs {
|
||||
@ApiModelProperty("排序")
|
||||
private String sort;
|
||||
@ApiModelProperty("详细信息")
|
||||
private String withBlobs="Y";
|
||||
private String withBlobs="N";
|
||||
@ApiModelProperty("操作类型")
|
||||
private String optType;
|
||||
@ApiModelProperty("静态文件")
|
||||
|
||||
@ -1,29 +1,34 @@
|
||||
package io.dataease.controller.sys;
|
||||
|
||||
|
||||
import io.dataease.plugins.common.base.domain.SystemParameter;
|
||||
import io.dataease.commons.constants.ParamConstants;
|
||||
import io.dataease.commons.utils.LogUtil;
|
||||
import io.dataease.controller.ResultHolder;
|
||||
import io.dataease.controller.sys.response.BasicInfo;
|
||||
import io.dataease.controller.sys.response.MailInfo;
|
||||
import io.dataease.dto.SystemParameterDTO;
|
||||
import io.dataease.listener.DatasetCheckListener;
|
||||
import io.dataease.listener.util.CacheUtils;
|
||||
import io.dataease.plugins.common.base.domain.SystemParameter;
|
||||
import io.dataease.plugins.common.util.GlobalFileUtil;
|
||||
import io.dataease.plugins.xpack.cas.dto.CasSaveResult;
|
||||
import io.dataease.service.FileService;
|
||||
import io.dataease.service.sys.SysUserService;
|
||||
import io.dataease.service.system.EmailService;
|
||||
import io.dataease.service.system.SystemParameterService;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.core.io.ByteArrayResource;
|
||||
import org.springframework.http.*;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.IOException;
|
||||
|
||||
import java.net.URLDecoder;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@ -42,6 +47,23 @@ public class SystemParameterController {
|
||||
@Resource
|
||||
private EmailService emailService;
|
||||
|
||||
@Resource
|
||||
private SysUserService sysUserService;
|
||||
|
||||
@PostMapping("/email/checkAdmin")
|
||||
public ResultHolder checkAdminEmail() {
|
||||
String email = sysUserService.adminEmail();
|
||||
if (StringUtils.isBlank(email)) {
|
||||
return ResultHolder.error("管理员邮箱地址为空,请尽快配置");
|
||||
}
|
||||
try {
|
||||
emailService.testConnection(email);
|
||||
} catch (Exception e) {
|
||||
LogUtil.error(e.getMessage(), e);
|
||||
return ResultHolder.error(e.getMessage());
|
||||
}
|
||||
return ResultHolder.success(true);
|
||||
}
|
||||
|
||||
@RequiresPermissions("sysparam:read")
|
||||
@GetMapping("/mail/info")
|
||||
|
||||
@ -29,5 +29,7 @@ public class BasicInfo extends LoginLimitInfo implements Serializable {
|
||||
private String dsCheckInterval;
|
||||
@ApiModelProperty("数据源检测时间间隔类型")
|
||||
private String dsCheckIntervalType;
|
||||
@ApiModelProperty("自动识别移动端")
|
||||
private String autoMobile = "true";
|
||||
|
||||
}
|
||||
|
||||
@ -14,11 +14,19 @@ public class Db2Configuration extends JdbcConfiguration {
|
||||
|
||||
public String getJdbc() {
|
||||
if(StringUtils.isEmpty(extraParams.trim())){
|
||||
return "jdbc:db2://HOSTNAME:PORT/DATABASE:currentSchema=SCHEMA;"
|
||||
.replace("HOSTNAME", getHost().trim())
|
||||
.replace("PORT", getPort().toString().trim())
|
||||
.replace("DATABASE", getDataBase().trim()
|
||||
.replace("SCHEMA",getSchema().trim()));
|
||||
if (StringUtils.isEmpty(getSchema())) {
|
||||
return "jdbc:db2://HOSTNAME:PORT/DATABASE:currentSchema=SCHEMA;"
|
||||
.replace("HOSTNAME", getHost().trim())
|
||||
.replace("PORT", getPort().toString().trim())
|
||||
.replace("DATABASE", getDataBase().trim());
|
||||
} else {
|
||||
return "jdbc:db2://HOSTNAME:PORT/DATABASE:currentSchema=SCHEMA;"
|
||||
.replace("HOSTNAME", getHost().trim())
|
||||
.replace("PORT", getPort().toString().trim())
|
||||
.replace("DATABASE", getDataBase().trim())
|
||||
.replace("SCHEMA", getSchema().trim());
|
||||
}
|
||||
|
||||
}else {
|
||||
return "jdbc:hive2://HOSTNAME:PORT/DATABASE?EXTRA_PARAMS"
|
||||
.replace("HOSTNAME", getHost().trim())
|
||||
|
||||
@ -9,10 +9,10 @@
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
panel_template.id, panel_template.`name`, panel_template.pid, panel_template.`level`, panel_template.node_type, panel_template.create_by, panel_template.create_time, panel_template.template_type
|
||||
panel_template.id, panel_template.`name`, panel_template.pid, panel_template.`level`, panel_template.node_type, panel_template.create_by, panel_template.create_time, panel_template.template_type, panel_template.snapshot
|
||||
</sql>
|
||||
<sql id="Blob_Column_List">
|
||||
panel_template.snapshot, panel_template.template_style, panel_template.template_data, panel_template.dynamic_data
|
||||
panel_template.template_style, panel_template.template_data, panel_template.dynamic_data
|
||||
</sql>
|
||||
|
||||
<select id="panelTemplate" resultMap="BaseResultMapDTO">
|
||||
|
||||
@ -9,4 +9,6 @@ public interface ExtSysUserMapper {
|
||||
List<SysUserGridResponse> query(GridExample example);
|
||||
|
||||
List<String> ldapUserNames(Integer from);
|
||||
|
||||
String queryAdminEmail();
|
||||
}
|
||||
|
||||
@ -2,25 +2,27 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="io.dataease.ext.ExtSysUserMapper">
|
||||
|
||||
<resultMap id="sysUserDept" type="io.dataease.controller.sys.response.SysUserDept" >
|
||||
<resultMap id="sysUserDept" type="io.dataease.controller.sys.response.SysUserDept">
|
||||
<id column="dept_id" property="deptId"></id>
|
||||
<result column="pid" property="pid"></result>
|
||||
<result column="dept_name" property="deptName"></result>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="sysUserRole" type="io.dataease.controller.sys.response.SysUserRole" >
|
||||
<resultMap id="sysUserRole" type="io.dataease.controller.sys.response.SysUserRole">
|
||||
<result column="role_id" property="roleId"></result>
|
||||
<result column="role_name" property="roleName"></result>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="BaseResultMap" type="io.dataease.controller.sys.response.SysUserGridResponse" extends="io.dataease.plugins.common.base.mapper.SysUserMapper.BaseResultMap">
|
||||
<resultMap id="BaseResultMap" type="io.dataease.controller.sys.response.SysUserGridResponse"
|
||||
extends="io.dataease.plugins.common.base.mapper.SysUserMapper.BaseResultMap">
|
||||
<result property="id" column="id"></result>
|
||||
<association property="dept" javaType="io.dataease.controller.sys.response.SysUserDept">
|
||||
<id column="dept_id" property="deptId"/>
|
||||
<result column="pid" property="pid" />
|
||||
<result column="dept_name" property="deptName" />
|
||||
<result column="pid" property="pid"/>
|
||||
<result column="dept_name" property="deptName"/>
|
||||
</association>
|
||||
<association property="dept" column="dept_id" javaType="io.dataease.controller.sys.response.SysUserDept" resultMap="sysUserDept"/>
|
||||
<association property="dept" column="dept_id" javaType="io.dataease.controller.sys.response.SysUserDept"
|
||||
resultMap="sysUserDept"/>
|
||||
|
||||
<collection property="roles"
|
||||
javaType="java.util.ArrayList"
|
||||
@ -31,8 +33,6 @@
|
||||
</resultMap>
|
||||
|
||||
|
||||
|
||||
|
||||
<select id="query" parameterType="io.dataease.ext.query.GridExample" resultMap="BaseResultMap">
|
||||
SELECT DISTINCT
|
||||
u.*,
|
||||
@ -41,20 +41,20 @@
|
||||
d.NAME AS dept_name
|
||||
FROM
|
||||
(
|
||||
select * from sys_user
|
||||
<if test="extendCondition != null">
|
||||
where
|
||||
nick_name like concat('%', #{extendCondition} , '%')
|
||||
or
|
||||
email like concat('%', #{extendCondition} , '%')
|
||||
</if>
|
||||
select * from sys_user
|
||||
<if test="extendCondition != null">
|
||||
where
|
||||
nick_name like concat('%', #{extendCondition} , '%')
|
||||
or
|
||||
email like concat('%', #{extendCondition} , '%')
|
||||
</if>
|
||||
) u
|
||||
LEFT JOIN sys_dept d ON d.dept_id = u.dept_id
|
||||
LEFT JOIN sys_users_roles sur ON sur.user_id = u.user_id
|
||||
LEFT JOIN sys_role r ON r.role_id = sur.role_id
|
||||
|
||||
<if test="_parameter != null">
|
||||
<include refid="io.dataease.ext.query.GridSql.gridCondition" />
|
||||
<include refid="io.dataease.ext.query.GridSql.gridCondition"/>
|
||||
</if>
|
||||
<if test="orderByClause != null">
|
||||
order by ${orderByClause}
|
||||
@ -67,11 +67,19 @@
|
||||
<select id="queryRole" resultMap="sysUserRole">
|
||||
select r.role_id, r.name as role_name
|
||||
from sys_users_roles sur
|
||||
left join sys_role r on r.role_id = sur.role_id
|
||||
left join sys_role r on r.role_id = sur.role_id
|
||||
where sur.user_id = #{user_id}
|
||||
</select>
|
||||
|
||||
<select id="ldapUserNames" resultType="java.lang.String" parameterType="java.lang.Integer">
|
||||
select username from sys_user u where u.from = #{from}
|
||||
select username
|
||||
from sys_user u
|
||||
where u.from = #{from}
|
||||
</select>
|
||||
|
||||
<select id="queryAdminEmail" resultType="String">
|
||||
select email
|
||||
from sys_user
|
||||
where user_id = 1
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@ -1077,8 +1077,11 @@ public class DorisQueryProvider extends QueryProvider {
|
||||
String format = transDateFormat(request.getDateStyle(), request.getDatePattern());
|
||||
if (field.getDeExtractType() == 0 || field.getDeExtractType() == 5 || field.getDeExtractType() == 1) {
|
||||
String date = String.format(MySQLConstants.STR_TO_DATE, originName, StringUtils.isNotEmpty(field.getDateFormat()) ? field.getDateFormat() : MysqlConstants.DEFAULT_DATE_FORMAT);
|
||||
if (request.getOperator().equals("between")) {
|
||||
whereName = date;
|
||||
if (field.getType().equalsIgnoreCase("YEAR") || StringUtils.equalsIgnoreCase(field.getDateFormat(), "%Y")) {
|
||||
date = String.format(MySQLConstants.DATE_FORMAT, "CONCAT(" + date + ",'-01-01')", "%Y-01-01");
|
||||
}
|
||||
if (request.getOperator().equals("between") && request.getDatasetTableField().getDeExtractType() != 1) {
|
||||
whereName = String.format(MySQLConstants.UNIX_TIMESTAMP, date) + "*1000";
|
||||
} else {
|
||||
whereName = String.format(MySQLConstants.DATE_FORMAT, date, format);
|
||||
}
|
||||
@ -1126,10 +1129,14 @@ public class DorisQueryProvider extends QueryProvider {
|
||||
whereName = "upper(" + whereName + ")";
|
||||
} else if (StringUtils.containsIgnoreCase(request.getOperator(), "between")) {
|
||||
if (request.getDatasetTableField().getDeType() == 1) {
|
||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
|
||||
String startTime = simpleDateFormat.format(new Date(Long.parseLong(value.get(0))));
|
||||
String endTime = simpleDateFormat.format(new Date(Long.parseLong(value.get(1))));
|
||||
whereValue = String.format(DorisConstants.WHERE_BETWEEN, startTime, endTime);
|
||||
if (request.getDatasetTableField().getDeExtractType() == 1) {
|
||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
|
||||
String startTime = simpleDateFormat.format(new Date(Long.parseLong(value.get(0))));
|
||||
String endTime = simpleDateFormat.format(new Date(Long.parseLong(value.get(1))));
|
||||
whereValue = String.format(DorisConstants.WHERE_BETWEEN, startTime, endTime);
|
||||
} else {
|
||||
whereValue = String.format(DorisConstants.WHERE_BETWEEN, value.get(0), value.get(1));
|
||||
}
|
||||
} else {
|
||||
whereValue = String.format(DorisConstants.WHERE_BETWEEN, value.get(0), value.get(1));
|
||||
}
|
||||
@ -1179,6 +1186,8 @@ public class DorisQueryProvider extends QueryProvider {
|
||||
return "%Y" + split + "%m" + split + "%d";
|
||||
case "H_m_s":
|
||||
return "%H:%i:%S";
|
||||
case "y_M_d_H":
|
||||
return "%Y" + split + "%m" + split + "%d" + " %H";
|
||||
case "y_M_d_H_m":
|
||||
return "%Y" + split + "%m" + split + "%d" + " %H:%i";
|
||||
case "y_M_d_H_m_s":
|
||||
@ -1211,8 +1220,8 @@ public class DorisQueryProvider extends QueryProvider {
|
||||
if (x.getDeExtractType() == 0) {
|
||||
if (StringUtils.equalsIgnoreCase(x.getDateStyle(), "y_Q")) {
|
||||
fieldName = String.format(format,
|
||||
String.format(DorisConstants.DATE_FORMAT, String.format(DorisConstants.STR_TO_DATE, originField, DorisConstants.DEFAULT_DATE_FORMAT), "%Y"),
|
||||
String.format(DorisConstants.QUARTER, String.format(DorisConstants.STR_TO_DATE, originField, DorisConstants.DEFAULT_DATE_FORMAT)));
|
||||
String.format(DorisConstants.DATE_FORMAT, String.format(DorisConstants.STR_TO_DATE, originField, StringUtils.isNotEmpty(x.getDateFormat()) ? x.getDateFormat() : DorisConstants.DEFAULT_DATE_FORMAT), "%Y"),
|
||||
String.format(DorisConstants.QUARTER, String.format(DorisConstants.STR_TO_DATE, originField, StringUtils.isNotEmpty(x.getDateFormat()) ? x.getDateFormat() : DorisConstants.DEFAULT_DATE_FORMAT)));
|
||||
} else {
|
||||
fieldName = String.format(DorisConstants.DATE_FORMAT, String.format(DorisConstants.STR_TO_DATE, originField, StringUtils.isNotEmpty(x.getDateFormat()) ? x.getDateFormat() : DorisConstants.DEFAULT_DATE_FORMAT), format);
|
||||
}
|
||||
|
||||
@ -1064,16 +1064,16 @@ public class MysqlQueryProvider extends QueryProvider {
|
||||
String format = transDateFormat(request.getDateStyle(), request.getDatePattern());
|
||||
if (field.getDeExtractType() == 0 || field.getDeExtractType() == 5 || field.getDeExtractType() == 1) {
|
||||
String date = String.format(MySQLConstants.STR_TO_DATE, originName, StringUtils.isNotEmpty(field.getDateFormat()) ? field.getDateFormat() : MysqlConstants.DEFAULT_DATE_FORMAT);
|
||||
if(request.getOperator().equals("between")){
|
||||
if (request.getOperator().equals("between")) {
|
||||
whereName = date;
|
||||
}else {
|
||||
} else {
|
||||
whereName = String.format(MySQLConstants.DATE_FORMAT, date, format);
|
||||
}
|
||||
}
|
||||
if (field.getDeExtractType() == 2 || field.getDeExtractType() == 3 || field.getDeExtractType() == 4) {
|
||||
if(request.getOperator().equals("between")){
|
||||
if (request.getOperator().equals("between")) {
|
||||
whereName = originName;
|
||||
}else {
|
||||
} else {
|
||||
String cast = String.format(MySQLConstants.CAST, originName, MySQLConstants.DEFAULT_INT_FORMAT) + "/1000";
|
||||
whereName = String.format(DorisConstants.FROM_UNIXTIME, cast, format);
|
||||
}
|
||||
@ -1166,6 +1166,8 @@ public class MysqlQueryProvider extends QueryProvider {
|
||||
return "%Y" + split + "%m" + split + "%d";
|
||||
case "H_m_s":
|
||||
return "%H:%i:%S";
|
||||
case "y_M_d_H":
|
||||
return "%Y" + split + "%m" + split + "%d" + " %H";
|
||||
case "y_M_d_H_m":
|
||||
return "%Y" + split + "%m" + split + "%d" + " %H:%i";
|
||||
case "y_M_d_H_m_s":
|
||||
|
||||
@ -31,11 +31,9 @@ import org.stringtemplate.v4.STGroup;
|
||||
import org.stringtemplate.v4.STGroupFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.text.Format;
|
||||
import java.text.MessageFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
@ -822,9 +820,9 @@ public class CKQueryProvider extends QueryProvider {
|
||||
}
|
||||
|
||||
public String getTotalCount(boolean isTable, String sql, Datasource ds) {
|
||||
if(isTable){
|
||||
if (isTable) {
|
||||
return "SELECT COUNT(*) from " + String.format(CKConstants.KEYWORD_TABLE, sql);
|
||||
}else {
|
||||
} else {
|
||||
return "SELECT COUNT(*) from ( " + sqlFix(sql) + " ) DE_COUNT_TEMP";
|
||||
}
|
||||
}
|
||||
@ -1253,6 +1251,8 @@ public class CKQueryProvider extends QueryProvider {
|
||||
return "%Y" + split + "%m" + split + "%d";
|
||||
case "H_m_s":
|
||||
return "%H:%M:%S";
|
||||
case "y_M_d_H":
|
||||
return "%Y" + split + "%m" + split + "%d" + " %H";
|
||||
case "y_M_d_H_m":
|
||||
return "%Y" + split + "%m" + split + "%d" + " %H:%M";
|
||||
case "y_M_d_H_m_s":
|
||||
@ -1415,6 +1415,11 @@ public class CKQueryProvider extends QueryProvider {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String sqlForPreview(String table, Datasource ds) {
|
||||
return "SELECT * FROM " + String.format(CKConstants.KEYWORD_TABLE, table);
|
||||
}
|
||||
|
||||
public List<Dateformat> dateformat() {
|
||||
return JSONArray.parseArray("[\n" +
|
||||
"{\"dateformat\": \"%Y%m%d\"},\n" +
|
||||
|
||||
@ -1122,25 +1122,25 @@ public class Db2QueryProvider extends QueryProvider {
|
||||
} else {
|
||||
originName = String.format(Db2Constants.STR_TO_DATE, originName);
|
||||
}
|
||||
if(request.getOperator().equals("between")){
|
||||
if (request.getOperator().equals("between")) {
|
||||
whereName = originName;
|
||||
}else {
|
||||
} else {
|
||||
whereName = String.format(Db2Constants.DATE_FORMAT, originName, format);
|
||||
}
|
||||
}
|
||||
if (field.getDeExtractType() == DeTypeConstants.DE_INT || field.getDeExtractType() == 3 || field.getDeExtractType() == 4) {
|
||||
if(request.getOperator().equals("between")){
|
||||
if (request.getOperator().equals("between")) {
|
||||
String cast = String.format(Db2Constants.CAST, originName, Db2Constants.DEFAULT_INT_FORMAT);
|
||||
whereName = String.format(Db2Constants.FROM_UNIXTIME, cast, Db2Constants.DEFAULT_DATE_FORMAT);
|
||||
}else {
|
||||
} else {
|
||||
String cast = String.format(Db2Constants.CAST, originName, Db2Constants.DEFAULT_INT_FORMAT);
|
||||
whereName = String.format(Db2Constants.FROM_UNIXTIME, cast, format);
|
||||
}
|
||||
}
|
||||
if (field.getDeExtractType() == DeTypeConstants.DE_TIME) {
|
||||
if(request.getOperator().equals("between")){
|
||||
if (request.getOperator().equals("between")) {
|
||||
whereName = originName;
|
||||
}else {
|
||||
} else {
|
||||
if (field.getType().equalsIgnoreCase("TIME")) {
|
||||
whereName = String.format(Db2Constants.FORMAT_TIME, originName, format);
|
||||
} else if (field.getType().equalsIgnoreCase("DATE")) {
|
||||
@ -1242,6 +1242,8 @@ public class Db2QueryProvider extends QueryProvider {
|
||||
return "YYYY" + split + "MM" + split + "DD";
|
||||
case "H_m_s":
|
||||
return "HH24:MI:SS";
|
||||
case "y_M_d_H":
|
||||
return "YYYY" + split + "MM" + split + "DD" + " HH24";
|
||||
case "y_M_d_H_m":
|
||||
return "YYYY" + split + "MM" + split + "DD" + " HH24:MI";
|
||||
case "y_M_d_H_m_s":
|
||||
|
||||
@ -1174,6 +1174,8 @@ public class EsQueryProvider extends QueryProvider {
|
||||
return "yyyy" + split + "MM" + split + "dd";
|
||||
case "H_m_s":
|
||||
return "HH:mm:ss";
|
||||
case "y_M_d_H":
|
||||
return "yyyy" + split + "MM" + split + "dd" + " HH";
|
||||
case "y_M_d_H_m":
|
||||
return "yyyy" + split + "MM" + split + "dd" + " HH:mm";
|
||||
case "y_M_d_H_m_s":
|
||||
@ -1329,7 +1331,7 @@ public class EsQueryProvider extends QueryProvider {
|
||||
}
|
||||
|
||||
public String getResultCount(boolean isTable, String sql, List<ChartViewFieldDTO> xAxis, List<ChartFieldCustomFilterDTO> fieldCustomFilter, List<DataSetRowPermissionsTreeDTO> rowPermissionsTree, List<ChartExtFilterRequest> extFilterRequestList, Datasource ds, ChartViewWithBLOBs view) {
|
||||
return null;
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -1147,6 +1147,8 @@ public class HiveQueryProvider extends QueryProvider {
|
||||
return "yyyy" + split + "MM" + split + "dd";
|
||||
case "H_m_s":
|
||||
return "HH:mm:ss";
|
||||
case "y_M_d_H":
|
||||
return "yyyy" + split + "MM" + split + "dd" + " HH";
|
||||
case "y_M_d_H_m":
|
||||
return "yyyy" + split + "MM" + split + "dd" + " HH:mm";
|
||||
case "y_M_d_H_m_s":
|
||||
|
||||
@ -1153,6 +1153,8 @@ public class ImpalaQueryProvider extends QueryProvider {
|
||||
return "yyyy" + split + "MM" + split + "dd";
|
||||
case "H_m_s":
|
||||
return "HH:mm:ss";
|
||||
case "y_M_d_H":
|
||||
return "yyyy" + split + "MM" + split + "dd" + " HH";
|
||||
case "y_M_d_H_m":
|
||||
return "yyyy" + split + "MM" + split + "dd" + " HH:mm";
|
||||
case "y_M_d_H_m_s":
|
||||
|
||||
@ -1038,6 +1038,8 @@ public class MongoQueryProvider extends QueryProvider {
|
||||
return "%Y" + split + "%m" + split + "%d";
|
||||
case "H_m_s":
|
||||
return "%H:%i:%S";
|
||||
case "y_M_d_H":
|
||||
return "%Y" + split + "%m" + split + "%d" + " %H";
|
||||
case "y_M_d_H_m":
|
||||
return "%Y" + split + "%m" + split + "%d" + " %H:%i";
|
||||
case "y_M_d_H_m_s":
|
||||
|
||||
@ -1066,12 +1066,12 @@ public class MysqlQueryProvider extends QueryProvider {
|
||||
String format = transDateFormat(request.getDateStyle(), request.getDatePattern());
|
||||
if (field.getDeExtractType() == 0 || field.getDeExtractType() == 5 || field.getDeExtractType() == 1) {
|
||||
String date;
|
||||
if (field.getType().equalsIgnoreCase("YEAR")) {
|
||||
if (field.getType().equalsIgnoreCase("YEAR") || StringUtils.equalsIgnoreCase(field.getDateFormat(), "%Y")) {
|
||||
date = String.format(MySQLConstants.DATE_FORMAT, "CONCAT(" + originName + ",'-01-01')", StringUtils.isNotEmpty(field.getDateFormat()) ? field.getDateFormat() : MysqlConstants.DEFAULT_DATE_FORMAT);
|
||||
} else {
|
||||
date = String.format(MySQLConstants.DATE_FORMAT, originName, StringUtils.isNotEmpty(field.getDateFormat()) ? field.getDateFormat() : MysqlConstants.DEFAULT_DATE_FORMAT);
|
||||
}
|
||||
if (request.getOperator().equals("between")) {
|
||||
if (request.getOperator().equals("between") && request.getDatasetTableField().getDeExtractType() != 1) {
|
||||
whereName = String.format(MySQLConstants.UNIX_TIMESTAMP, date) + "*1000";
|
||||
} else {
|
||||
if (StringUtils.equalsIgnoreCase(request.getDateStyle(), "y_Q")) {
|
||||
@ -1190,6 +1190,8 @@ public class MysqlQueryProvider extends QueryProvider {
|
||||
return "%Y" + split + "%m" + split + "%d";
|
||||
case "H_m_s":
|
||||
return "%H:%i:%S";
|
||||
case "y_M_d_H":
|
||||
return "%Y" + split + "%m" + split + "%d" + " %H";
|
||||
case "y_M_d_H_m":
|
||||
return "%Y" + split + "%m" + split + "%d" + " %H:%i";
|
||||
case "y_M_d_H_m_s":
|
||||
|
||||
@ -1318,6 +1318,8 @@ public class OracleQueryProvider extends QueryProvider {
|
||||
return "YYYY" + split + "MM" + split + "DD";
|
||||
case "H_m_s":
|
||||
return "HH24:MI:SS";
|
||||
case "y_M_d_H":
|
||||
return "YYYY" + split + "MM" + split + "DD" + " HH24";
|
||||
case "y_M_d_H_m":
|
||||
return "YYYY" + split + "MM" + split + "DD" + " HH24:MI";
|
||||
case "y_M_d_H_m_s":
|
||||
|
||||
@ -1181,6 +1181,8 @@ public class PgQueryProvider extends QueryProvider {
|
||||
return "YYYY" + split + "MM" + split + "DD";
|
||||
case "H_m_s":
|
||||
return "HH24:MI:SS";
|
||||
case "y_M_d_H":
|
||||
return "YYYY" + split + "MM" + split + "DD" + " HH24";
|
||||
case "y_M_d_H_m":
|
||||
return "YYYY" + split + "MM" + split + "DD" + " HH24:MI";
|
||||
case "y_M_d_H_m_s":
|
||||
|
||||
@ -1169,6 +1169,8 @@ public class RedshiftQueryProvider extends QueryProvider {
|
||||
return "YYYY" + split + "MM" + split + "DD";
|
||||
case "H_m_s":
|
||||
return "HH24:MI:SS'";
|
||||
case "y_M_d_H":
|
||||
return "YYYY" + split + "MM" + split + "DD" + " HH24";
|
||||
case "y_M_d_H_m":
|
||||
return "YYYY" + split + "MM" + split + "DD" + " HH24:MI";
|
||||
case "y_M_d_H_m_s":
|
||||
|
||||
@ -1149,7 +1149,7 @@ public class SqlserverQueryProvider extends QueryProvider {
|
||||
String whereValue = "";
|
||||
|
||||
if (StringUtils.containsIgnoreCase(request.getOperator(), "in")) {
|
||||
if(request.getDatasetTableField().getType().equalsIgnoreCase("NVARCHAR")) {
|
||||
if(request.getDatasetTableField() != null && request.getDatasetTableField().getType().equalsIgnoreCase("NVARCHAR")) {
|
||||
whereValue = "(" + value.stream().map(str -> {
|
||||
return "N" + "'" + str + "'";
|
||||
}).collect(Collectors.joining(",")) + ")";
|
||||
@ -1171,7 +1171,7 @@ public class SqlserverQueryProvider extends QueryProvider {
|
||||
}
|
||||
} else {
|
||||
|
||||
if(request.getDatasetTableField().getType().equalsIgnoreCase("NVARCHAR")){
|
||||
if(request.getDatasetTableField() != null && request.getDatasetTableField().getType().equalsIgnoreCase("NVARCHAR")){
|
||||
whereValue = String.format(SqlServerSQLConstants.WHERE_VALUE_VALUE_CH, value.get(0));
|
||||
}else {
|
||||
whereValue = String.format(SqlServerSQLConstants.WHERE_VALUE_VALUE, value.get(0));
|
||||
@ -1227,6 +1227,12 @@ public class SqlserverQueryProvider extends QueryProvider {
|
||||
}
|
||||
case "H_m_s":
|
||||
return "CONVERT(varchar(100), " + originField + ", 8)";
|
||||
case "y_M_d_H":
|
||||
if (split.equalsIgnoreCase("-")) {
|
||||
return "substring( convert(varchar," + originField + ",120),1,13)";
|
||||
} else {
|
||||
return "replace(" + "substring( convert(varchar," + originField + ",120),1,13), '-','/')";
|
||||
}
|
||||
case "y_M_d_H_m":
|
||||
if (split.equalsIgnoreCase("-")) {
|
||||
return "substring( convert(varchar," + originField + ",120),1,16)";
|
||||
|
||||
@ -604,12 +604,21 @@ public class ChartViewService {
|
||||
List<ChartViewFieldDTO> viewFields = gson.fromJson(view.getViewFields(), tokenType);
|
||||
final Map<String, List<ChartViewFieldDTO>> extFieldsMap = new LinkedHashMap<>();
|
||||
if (CollectionUtils.isNotEmpty(viewFields)) {
|
||||
viewFields.forEach(field -> {
|
||||
String[] busiFlagArray = new String[] {"daxis", "locationXaxis", "locationYaxis"};
|
||||
Map<String, Boolean> flagMap = new HashMap<>();
|
||||
for (String s : busiFlagArray) {
|
||||
flagMap.put(s, false);
|
||||
}
|
||||
for (ChartViewFieldDTO field : viewFields) {
|
||||
flagMap.put(field.getBusiType(), true);
|
||||
String busiType = field.getBusiType();
|
||||
List<ChartViewFieldDTO> list = extFieldsMap.containsKey(busiType) ? extFieldsMap.get(busiType) : new ArrayList<>();
|
||||
list.add(field);
|
||||
extFieldsMap.put(field.getBusiType(), list);
|
||||
});
|
||||
}
|
||||
if (flagMap.get("daxis") && (!flagMap.get("locationXaxis") || !flagMap.get("locationYaxis"))) {
|
||||
viewFields = viewFields.stream().filter(field -> !StringUtils.equals("daxis", field.getBusiType())).collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
|
||||
List<ChartViewFieldDTO> xAxisBase = gson.fromJson(view.getXAxis(), tokenType);
|
||||
@ -1474,6 +1483,8 @@ public class ChartViewService {
|
||||
|
||||
List<PluginViewField> pluginViewFields = fieldMap.entrySet().stream().flatMap(entry -> entry.getValue().stream().map(field -> {
|
||||
PluginViewField pluginViewField = BeanUtils.copyBean(new PluginViewField(), field);
|
||||
pluginViewField.setFilter(gson.fromJson(gson.toJson(field.getFilter()), new TypeToken<List<PluginChartCustomFilterItem>>() {
|
||||
}.getType()));
|
||||
pluginViewField.setTypeField(entry.getKey());
|
||||
return pluginViewField;
|
||||
})).collect(Collectors.toList());
|
||||
|
||||
@ -2,6 +2,7 @@ package io.dataease.service.chart;
|
||||
|
||||
import cn.hutool.core.util.ReflectUtil;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import io.dataease.commons.model.PluginViewSetImpl;
|
||||
import io.dataease.commons.utils.TableUtils;
|
||||
import io.dataease.controller.request.chart.ChartExtRequest;
|
||||
@ -14,6 +15,7 @@ import io.dataease.plugins.common.constants.DatasetType;
|
||||
import io.dataease.plugins.common.constants.datasource.SQLConstants;
|
||||
import io.dataease.plugins.common.dto.chart.ChartFieldCustomFilterDTO;
|
||||
import io.dataease.plugins.common.dto.chart.ChartViewFieldDTO;
|
||||
import io.dataease.plugins.common.dto.chart.ChartViewFieldFilterDTO;
|
||||
import io.dataease.plugins.common.dto.sqlObj.SQLObj;
|
||||
import io.dataease.plugins.common.request.chart.ChartExtFilterRequest;
|
||||
import io.dataease.plugins.common.request.permission.DataSetRowPermissionsTreeDTO;
|
||||
@ -247,6 +249,9 @@ public class ViewPluginBaseServiceImpl implements ViewPluginBaseService {
|
||||
methodName = "getYWheres";
|
||||
}
|
||||
ChartViewFieldDTO chartViewFieldDTO = BeanUtils.copyBean(new ChartViewFieldDTO(), field);
|
||||
chartViewFieldDTO.setFilter(gson.fromJson(gson.toJson(field.getFilter()), new TypeToken<List<ChartViewFieldFilterDTO>>() {
|
||||
}.getType()));
|
||||
|
||||
Object execResult;
|
||||
if ((execResult = execProviderMethod(queryProvider, methodName, chartViewFieldDTO, originField, fieldAlias)) != null) {
|
||||
String where = (String) execResult;
|
||||
|
||||
@ -152,9 +152,6 @@ public class DataSetGroupService {
|
||||
if (StringUtils.isNotEmpty(datasetGroup.getId())) {
|
||||
criteria.andIdNotEqualTo(datasetGroup.getId());
|
||||
}
|
||||
if (ObjectUtils.isNotEmpty(datasetGroup.getLevel())) {
|
||||
criteria.andLevelEqualTo(datasetGroup.getLevel());
|
||||
}
|
||||
List<DatasetGroup> list = datasetGroupMapper.selectByExample(datasetGroupExample);
|
||||
if (list.size() > 0) {
|
||||
throw new RuntimeException(Translator.get("I18N_DATASET_GROUP_EXIST"));
|
||||
|
||||
@ -211,7 +211,7 @@ public class ExtractDataService {
|
||||
for (DatasetTableField oldField : oldFields) {
|
||||
boolean delete = true;
|
||||
for (DatasetTableField datasetTableField : datasetTableFields) {
|
||||
if (oldField.getDataeaseName().equalsIgnoreCase(datasetTableField.getDataeaseName())) {
|
||||
if (oldField.getDataeaseName().equalsIgnoreCase(datasetTableField.getDataeaseName()) && oldField.getType().equalsIgnoreCase(datasetTableField.getType())) {
|
||||
delete = false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -314,7 +314,8 @@ public class PanelAppTemplateService {
|
||||
for (ChartViewWithBLOBs chartView : chartViewsInfo) {
|
||||
String oldViewId = chartView.getId();
|
||||
// 替换datasetId
|
||||
chartView.setTableId(datasetsRealMap.get(chartView.getTableId()));
|
||||
String newTableId = datasetsRealMap.get(chartView.getTableId());
|
||||
chartView.setTableId(StringUtils.isEmpty(newTableId) ? " " : newTableId);
|
||||
datasetsRealMap.forEach((k, v) -> {
|
||||
chartView.setXAxis(chartView.getXAxis().replaceAll(k, v));
|
||||
chartView.setXAxisExt(chartView.getXAxisExt().replaceAll(k, v));
|
||||
@ -423,12 +424,12 @@ public class PanelAppTemplateService {
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Map<String,String> applyLinkJumps(List<PanelLinkJump> linkJumps, Map<String, String> chartViewsRealMap, String newPanelId) {
|
||||
Map<String,String> linkJumpIdMap = new HashMap<>();
|
||||
if(!CollectionUtils.isEmpty(linkJumps)){
|
||||
for(PanelLinkJump linkJump :linkJumps){
|
||||
public Map<String, String> applyLinkJumps(List<PanelLinkJump> linkJumps, Map<String, String> chartViewsRealMap, String newPanelId) {
|
||||
Map<String, String> linkJumpIdMap = new HashMap<>();
|
||||
if (!CollectionUtils.isEmpty(linkJumps)) {
|
||||
for (PanelLinkJump linkJump : linkJumps) {
|
||||
String newLinkJumpId = UUIDUtil.getUUIDAsString();
|
||||
linkJumpIdMap.put(linkJump.getId(),newLinkJumpId);
|
||||
linkJumpIdMap.put(linkJump.getId(), newLinkJumpId);
|
||||
linkJump.setId(newLinkJumpId);
|
||||
linkJump.setSourcePanelId(newPanelId);
|
||||
linkJump.setSourceViewId(chartViewsRealMap.get(linkJump.getSourceViewId()));
|
||||
@ -440,8 +441,8 @@ public class PanelAppTemplateService {
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void applyLinkJumpInfos(List<PanelLinkJumpInfo> linkJumpInfos, Map<String, String> linkJumpIdMap, Map<String, String> datasetFieldsRealMap) {
|
||||
if(!CollectionUtils.isEmpty(linkJumpInfos)){
|
||||
for(PanelLinkJumpInfo linkJumpInfo :linkJumpInfos){
|
||||
if (!CollectionUtils.isEmpty(linkJumpInfos)) {
|
||||
for (PanelLinkJumpInfo linkJumpInfo : linkJumpInfos) {
|
||||
String newLinkJumpInfoId = UUIDUtil.getUUIDAsString();
|
||||
linkJumpInfo.setId(newLinkJumpInfoId);
|
||||
linkJumpInfo.setLinkJumpId(linkJumpIdMap.get(linkJumpInfo.getLinkJumpId()));
|
||||
@ -455,12 +456,12 @@ public class PanelAppTemplateService {
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Map<String,String> applyLinkages(List<PanelViewLinkage> linkages, Map<String, String> chartViewsRealMap, String newPanelId) {
|
||||
Map<String,String> linkageIdMap = new HashMap<>();
|
||||
if(!CollectionUtils.isEmpty(linkages)){
|
||||
for(PanelViewLinkage linkage :linkages){
|
||||
public Map<String, String> applyLinkages(List<PanelViewLinkage> linkages, Map<String, String> chartViewsRealMap, String newPanelId) {
|
||||
Map<String, String> linkageIdMap = new HashMap<>();
|
||||
if (!CollectionUtils.isEmpty(linkages)) {
|
||||
for (PanelViewLinkage linkage : linkages) {
|
||||
String newId = UUIDUtil.getUUIDAsString();
|
||||
linkageIdMap.put(linkage.getId(),newId);
|
||||
linkageIdMap.put(linkage.getId(), newId);
|
||||
linkage.setId(newId);
|
||||
linkage.setPanelId(newPanelId);
|
||||
linkage.setSourceViewId(chartViewsRealMap.get(linkage.getSourceViewId()));
|
||||
@ -473,8 +474,8 @@ public class PanelAppTemplateService {
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void applyLinkageFields(List<PanelViewLinkageField> linkageFields, Map<String, String> linkageIdMap, Map<String, String> datasetFieldsRealMap) {
|
||||
if(!CollectionUtils.isEmpty(linkageFields)){
|
||||
for(PanelViewLinkageField linkageField :linkageFields){
|
||||
if (!CollectionUtils.isEmpty(linkageFields)) {
|
||||
for (PanelViewLinkageField linkageField : linkageFields) {
|
||||
String newId = UUIDUtil.getUUIDAsString();
|
||||
linkageField.setId(newId);
|
||||
linkageField.setLinkageId(linkageIdMap.get(linkageField.getLinkageId()));
|
||||
|
||||
@ -3,16 +3,16 @@ package io.dataease.service.sys;
|
||||
import io.dataease.auth.api.dto.CurrentUserDto;
|
||||
import io.dataease.auth.service.AuthUserService;
|
||||
import io.dataease.auth.service.ExtAuthService;
|
||||
import io.dataease.commons.exception.DEException;
|
||||
import io.dataease.controller.sys.request.*;
|
||||
import io.dataease.ext.ExtSysUserMapper;
|
||||
import io.dataease.ext.query.GridExample;
|
||||
import io.dataease.commons.constants.AuthConstants;
|
||||
import io.dataease.commons.exception.DEException;
|
||||
import io.dataease.commons.utils.AuthUtils;
|
||||
import io.dataease.commons.utils.BeanUtils;
|
||||
import io.dataease.commons.utils.CodingUtil;
|
||||
import io.dataease.controller.sys.request.*;
|
||||
import io.dataease.controller.sys.response.SysUserGridResponse;
|
||||
import io.dataease.controller.sys.response.SysUserRole;
|
||||
import io.dataease.ext.ExtSysUserMapper;
|
||||
import io.dataease.ext.query.GridExample;
|
||||
import io.dataease.i18n.Translator;
|
||||
import io.dataease.plugins.common.base.domain.*;
|
||||
import io.dataease.plugins.common.base.mapper.SysUserAssistMapper;
|
||||
@ -23,7 +23,6 @@ import io.dataease.plugins.xpack.dingtalk.dto.response.DingUserEntity;
|
||||
import io.dataease.plugins.xpack.lark.dto.entity.LarkUserInfo;
|
||||
import io.dataease.plugins.xpack.larksuite.dto.entity.UserData;
|
||||
import io.dataease.plugins.xpack.oidc.dto.SSOUserInfo;
|
||||
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
@ -33,7 +32,6 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -605,4 +603,7 @@ public class SysUserService {
|
||||
sysUserMapper.updateByPrimaryKeySelective(sysUser);
|
||||
}
|
||||
|
||||
public String adminEmail() {
|
||||
return extSysUserMapper.queryAdminEmail();
|
||||
}
|
||||
}
|
||||
|
||||
@ -277,6 +277,60 @@ public class EmailService {
|
||||
});
|
||||
}
|
||||
|
||||
private JavaMailSenderImpl buildSender() {
|
||||
MailInfo mailInfo = proxy().mailInfo();
|
||||
checkMailInfo(mailInfo);
|
||||
JavaMailSenderImpl javaMailSender = new JavaMailSenderImpl();
|
||||
javaMailSender.setDefaultEncoding("UTF-8");
|
||||
javaMailSender.setHost(mailInfo.getHost());
|
||||
javaMailSender.setPort(Integer.parseInt(mailInfo.getPort()));
|
||||
javaMailSender.setUsername(mailInfo.getAccount());
|
||||
javaMailSender.setPassword(mailInfo.getPassword());
|
||||
Properties props = new Properties();
|
||||
if (BooleanUtils.toBoolean(mailInfo.getSsl())) {
|
||||
props.put("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory");
|
||||
}
|
||||
if (BooleanUtils.toBoolean(mailInfo.getTls())) {
|
||||
props.put("mail.smtp.starttls.enable", "true");
|
||||
}
|
||||
props.put("mail.smtp.timeout", "30000");
|
||||
props.put("mail.smtp.connectiontimeout", "10000");
|
||||
javaMailSender.setJavaMailProperties(props);
|
||||
return javaMailSender;
|
||||
}
|
||||
|
||||
private void testSendEmail(String recipients, JavaMailSenderImpl javaMailSender, boolean isAdmin) {
|
||||
if (!StringUtils.isBlank(recipients)) {
|
||||
MimeMessage mimeMessage = javaMailSender.createMimeMessage();
|
||||
MimeMessageHelper helper;
|
||||
try {
|
||||
helper = new MimeMessageHelper(mimeMessage, true);
|
||||
helper.setFrom(javaMailSender.getUsername());
|
||||
helper.setSubject("DataEase测试邮件 ");
|
||||
helper.setText("这是一封测试邮件,邮件发送成功", true);
|
||||
helper.setTo(recipients);
|
||||
javaMailSender.send(mimeMessage);
|
||||
} catch (Exception e) {
|
||||
LogUtil.error(e.getMessage(), e);
|
||||
String key = "connection_failed";
|
||||
if (isAdmin) key = "connection_failed_admin";
|
||||
DEException.throwException(Translator.get(key));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void testConnection(String email) {
|
||||
JavaMailSenderImpl javaMailSender = null;
|
||||
try {
|
||||
javaMailSender = buildSender();
|
||||
javaMailSender.testConnection();
|
||||
} catch (MessagingException e) {
|
||||
LogUtil.error(e.getMessage(), e);
|
||||
DEException.throwException(Translator.get("connection_failed"));
|
||||
}
|
||||
testSendEmail(email, javaMailSender, true);
|
||||
}
|
||||
|
||||
public void testConnection(HashMap<String, String> hashMap) {
|
||||
JavaMailSenderImpl javaMailSender = new JavaMailSenderImpl();
|
||||
javaMailSender.setDefaultEncoding("UTF-8");
|
||||
@ -301,21 +355,6 @@ public class EmailService {
|
||||
LogUtil.error(e.getMessage(), e);
|
||||
DEException.throwException(Translator.get("connection_failed"));
|
||||
}
|
||||
if (!StringUtils.isBlank(recipients)) {
|
||||
MimeMessage mimeMessage = javaMailSender.createMimeMessage();
|
||||
MimeMessageHelper helper;
|
||||
try {
|
||||
helper = new MimeMessageHelper(mimeMessage, true);
|
||||
helper.setFrom(javaMailSender.getUsername());
|
||||
helper.setSubject("DataEase测试邮件 ");
|
||||
helper.setText("这是一封测试邮件,邮件发送成功", true);
|
||||
helper.setTo(recipients);
|
||||
javaMailSender.send(mimeMessage);
|
||||
} catch (Exception e) {
|
||||
LogUtil.error(e.getMessage(), e);
|
||||
DEException.throwException(Translator.get("connection_failed"));
|
||||
}
|
||||
}
|
||||
|
||||
testSendEmail(recipients, javaMailSender, false);
|
||||
}
|
||||
}
|
||||
|
||||
@ -7,6 +7,7 @@ import io.dataease.commons.utils.EncryptUtils;
|
||||
import io.dataease.controller.sys.response.BasicInfo;
|
||||
import io.dataease.dto.SystemParameterDTO;
|
||||
import io.dataease.exception.DataEaseException;
|
||||
import io.dataease.ext.ExtSystemParameterMapper;
|
||||
import io.dataease.plugins.common.base.domain.FileMetadata;
|
||||
import io.dataease.plugins.common.base.domain.SystemParameter;
|
||||
import io.dataease.plugins.common.base.domain.SystemParameterExample;
|
||||
@ -26,6 +27,7 @@ import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import springfox.documentation.annotations.Cacheable;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.imageio.ImageIO;
|
||||
@ -34,9 +36,6 @@ import java.io.InputStream;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
import io.dataease.ext.*;
|
||||
import springfox.documentation.annotations.Cacheable;
|
||||
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class SystemParameterService {
|
||||
@ -62,9 +61,11 @@ public class SystemParameterService {
|
||||
List<SystemParameter> homePageList = this.getParamList("ui.openHomePage");
|
||||
List<SystemParameter> marketPageList = this.getParamList("ui.openMarketPage");
|
||||
List<SystemParameter> loginLimitList = this.getParamList("loginlimit");
|
||||
List<SystemParameter> autoMobileList = this.getParamList("ui.autoMobile");
|
||||
paramList.addAll(homePageList);
|
||||
paramList.addAll(marketPageList);
|
||||
paramList.addAll(loginLimitList);
|
||||
paramList.addAll(autoMobileList);
|
||||
BasicInfo result = new BasicInfo();
|
||||
result.setOpenHomePage("true");
|
||||
Map<String, LoginLimitXpackService> beansOfType = SpringContextUtil.getApplicationContext().getBeansOfType((LoginLimitXpackService.class));
|
||||
@ -92,6 +93,10 @@ public class SystemParameterService {
|
||||
boolean open = StringUtils.equals("true", param.getParamValue());
|
||||
result.setOpenMarketPage(open ? "true" : "false");
|
||||
}
|
||||
if (StringUtils.equals(param.getParamKey(), ParamConstants.BASIC.AUTO_MOBILE.getValue())) {
|
||||
boolean close = StringUtils.equals("false", param.getParamValue());
|
||||
result.setAutoMobile(close ? "false" : "true");
|
||||
}
|
||||
if (StringUtils.equals(param.getParamKey(), ParamConstants.BASIC.TEMPLATE_MARKET_ULR.getValue())) {
|
||||
result.setTemplateMarketUlr(param.getParamValue());
|
||||
}
|
||||
@ -123,6 +128,10 @@ public class SystemParameterService {
|
||||
boolean open = StringUtils.equals("true", param.getParamValue());
|
||||
result.setOpen(open ? "true" : "false");
|
||||
}
|
||||
if (StringUtils.equals(param.getParamKey(), ParamConstants.BASIC.LOCKED_EMAIL.getValue())) {
|
||||
boolean open = StringUtils.equals("true", param.getParamValue());
|
||||
result.setLockedEmail(open ? "true" : "false");
|
||||
}
|
||||
if (StringUtils.equals(param.getParamKey(), ParamConstants.BASIC.SCAN_CREATE_USER.getValue())) {
|
||||
boolean open = StringUtils.equals("true", param.getParamValue());
|
||||
result.setScanCreateUser(open ? "true" : "false");
|
||||
@ -160,8 +169,7 @@ public class SystemParameterService {
|
||||
CasSaveResult casSaveResult = afterSwitchDefaultLogin(parameters);
|
||||
BasicInfo basicInfo = basicInfo();
|
||||
String oldMultiLogin = this.getValue("loginlimit.multiLogin");
|
||||
for (int i = 0; i < parameters.size(); i++) {
|
||||
SystemParameter parameter = parameters.get(i);
|
||||
for (SystemParameter parameter : parameters) {
|
||||
SystemParameterExample example = new SystemParameterExample();
|
||||
|
||||
example.createCriteria().andParamKeyEqualTo(parameter.getParamKey());
|
||||
@ -274,6 +282,16 @@ public class SystemParameterService {
|
||||
return param.getParamValue();
|
||||
}
|
||||
|
||||
public void disabledLockedEmail() {
|
||||
SystemParameter param = systemParameterMapper.selectByPrimaryKey(ParamConstants.BASIC.LOCKED_EMAIL.getValue());
|
||||
if (ObjectUtils.isNotEmpty(param)) {
|
||||
SystemParameterExample example = new SystemParameterExample();
|
||||
example.createCriteria().andParamKeyEqualTo(ParamConstants.BASIC.LOCKED_EMAIL.getValue());
|
||||
param.setParamValue("false");
|
||||
systemParameterMapper.updateByExample(param, example);
|
||||
}
|
||||
}
|
||||
|
||||
public Integer defaultLoginType() {
|
||||
String value = getValue(LOGIN_TYPE_KEY);
|
||||
return StringUtils.isNotBlank(value) ? Integer.parseInt(value) : 0;
|
||||
|
||||
@ -228,7 +228,7 @@ SET FOREIGN_KEY_CHECKS = 0;
|
||||
-- ----------------------------
|
||||
-- Table structure for demo_new_trend_of_diagnosis
|
||||
-- ----------------------------
|
||||
CREATE TABLE `demo_new_trend_of_diagnosis` (
|
||||
CREATE TABLE IF NOT EXISTS `demo_new_trend_of_diagnosis` (
|
||||
`date` varchar(50) NOT NULL DEFAULT '' COMMENT '日期',
|
||||
`new_diagnosis` bigint(13) DEFAULT NULL COMMENT '新增确诊',
|
||||
`current_diagnosis` bigint(13) DEFAULT NULL COMMENT '现有确诊'
|
||||
|
||||
@ -47,7 +47,6 @@ ALTER TABLE `demo_stny_carbon_emission_trend` COMMENT = '官方示例模板数
|
||||
ALTER TABLE `demo_stny_disposable_energy` COMMENT = '官方示例模板数据(双碳及能源情况概览)';
|
||||
ALTER TABLE `demo_stny_energy_consumption_proportion` COMMENT = '官方示例模板数据(双碳及能源情况概览)';
|
||||
ALTER TABLE `demo_stny_energy_consumption_total` COMMENT = '官方示例模板数据(双碳及能源情况概览)';
|
||||
ALTER TABLE `demo_stny_province_city_index` COMMENT = '官方示例模板数据(双碳及能源情况概览)';
|
||||
ALTER TABLE `de_engine` COMMENT = '引擎设置表';
|
||||
ALTER TABLE `file_content` COMMENT = '文件内容表';
|
||||
ALTER TABLE `file_metadata` COMMENT = '文件基础信息表';
|
||||
|
||||
@ -129,6 +129,7 @@ i18n_field_name_repeat=Field name can't repeat
|
||||
i18n_calc_field_error=Field expression error
|
||||
i18n_cp_exist=Column permission of the same type already exists
|
||||
connection_failed=Connection Failed
|
||||
connection_failed_admin=Connection failed, please check email configuration or administrator mailbox
|
||||
theme_name_repeat=name of theme has been existed
|
||||
theme_name_empty=name can not be empty
|
||||
i18n_public_chart=\u3010Public Chart\u3011
|
||||
|
||||
@ -129,6 +129,7 @@ i18n_field_name_repeat=\u5B57\u6BB5\u540D\u4E0D\u80FD\u91CD\u590D
|
||||
i18n_calc_field_error=\u5B57\u6BB5\u8868\u8FBE\u5F0F\u8BED\u6CD5\u9519\u8BEF
|
||||
i18n_cp_exist=\u5DF2\u6709\u540C\u7C7B\u578B\u7684\u5217\u6743\u9650\u5B58\u5728
|
||||
connection_failed=\u8FDE\u63A5\u5931\u8D25
|
||||
connection_failed_admin=\u8FDE\u63A5\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u90AE\u4EF6\u914D\u7F6E\u6216\u7BA1\u7406\u5458\u90AE\u7BB1
|
||||
theme_name_repeat=\u540D\u79F0\u5DF2\u5B58\u5728
|
||||
theme_name_empty=\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A
|
||||
i18n_public_chart=\u3010\u5B58\u91CF\u89C6\u56FE\u3011
|
||||
|
||||
@ -129,6 +129,7 @@ i18n_field_name_repeat=\u5B57\u6BB5\u540D\u4E0D\u80FD\u91CD\u5FA9
|
||||
i18n_calc_field_error=\u5B57\u6BB5\u8868\u9054\u5F0F\u8A9E\u6CD5\u932F\u8AA4
|
||||
i18n_cp_exist=\u5DF2\u6709\u540C\u985E\u578B\u7684\u5217\u6B0A\u9650\u5B58\u5728
|
||||
connection_failed=\u9023\u63A5\u5931\u6557
|
||||
connection_failed_admin=\u9023\u63A5\u5931\u6557\uFF0C\u8ACB\u6AA2\u67E5\u90F5\u4EF6\u914D\u7F6E\u6216\u7BA1\u7406\u54E1\u90F5\u7BB1
|
||||
theme_name_repeat=\u540D\u7A31\u5DF2\u5B58\u5728
|
||||
theme_name_empty=\u540D\u7A31\u4E0D\u80FD\u70BA\u7A7A
|
||||
i18n_public_chart=\u3010\u5B58\u91CF\u89C6\u56FE\u3011
|
||||
|
||||
@ -34,6 +34,7 @@
|
||||
{{ $t('commons.confirm') }}
|
||||
</el-button>
|
||||
<el-button
|
||||
style="margin-right: 24px"
|
||||
size="mini"
|
||||
@click="editCancel"
|
||||
>
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
<div
|
||||
:style="getOutStyleDefault(config.style)"
|
||||
class="component component-outer"
|
||||
:class="{'component-active': filterActive}"
|
||||
@click="handleClick"
|
||||
@mousedown="elementMouseDown"
|
||||
>
|
||||
@ -75,19 +76,19 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getStyle } from '@/components/canvas/utils/style'
|
||||
import {getStyle} from '@/components/canvas/utils/style'
|
||||
import runAnimation from '@/components/canvas/utils/runAnimation'
|
||||
import { mixins } from '@/components/canvas/utils/events'
|
||||
import { mapState } from 'vuex'
|
||||
import {mixins} from '@/components/canvas/utils/events'
|
||||
import {mapState} from 'vuex'
|
||||
import DeOutWidget from '@/components/dataease/DeOutWidget'
|
||||
import EditBar from '@/components/canvas/components/editor/EditBar'
|
||||
import MobileCheckBar from '@/components/canvas/components/editor/MobileCheckBar'
|
||||
import CloseBar from '@/components/canvas/components/editor/CloseBar'
|
||||
import { hexColorToRGBA } from '@/views/chart/chart/util'
|
||||
import { imgUrlTrans } from '@/components/canvas/utils/utils'
|
||||
import {hexColorToRGBA} from '@/views/chart/chart/util'
|
||||
import {imgUrlTrans} from '@/components/canvas/utils/utils'
|
||||
|
||||
export default {
|
||||
components: { CloseBar, MobileCheckBar, DeOutWidget, EditBar },
|
||||
components: {CloseBar, MobileCheckBar, DeOutWidget, EditBar},
|
||||
mixins: [mixins],
|
||||
props: {
|
||||
canvasId: {
|
||||
@ -134,7 +135,7 @@ export default {
|
||||
canvasStyleData: {
|
||||
type: Object,
|
||||
required: false,
|
||||
default: function() {
|
||||
default: function () {
|
||||
return {}
|
||||
}
|
||||
},
|
||||
@ -157,10 +158,13 @@ export default {
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
filterActive() {
|
||||
return this.curComponent && this.config.id === this.curComponent.id && this.config.type === 'custom'
|
||||
},
|
||||
chart() {
|
||||
if (this.config.propValue?.viewId) {
|
||||
const viewInfo = this.panelViewDetailsInfo[this.config.propValue.viewId];
|
||||
return viewInfo?JSON.parse(viewInfo):null
|
||||
return viewInfo ? JSON.parse(viewInfo) : null
|
||||
}
|
||||
return null
|
||||
},
|
||||
@ -320,7 +324,7 @@ export default {
|
||||
e.stopPropagation()
|
||||
const _this = this
|
||||
setTimeout(() => {
|
||||
_this.$store.commit('setCurComponent', { component: _this.config, index: _this.index })
|
||||
_this.$store.commit('setCurComponent', {component: _this.config, index: _this.index})
|
||||
}, 200)
|
||||
},
|
||||
showViewDetails(params) {
|
||||
@ -354,12 +358,6 @@ export default {
|
||||
.component {
|
||||
position: absolute;
|
||||
}
|
||||
.component-outer {
|
||||
transform: translate(0);
|
||||
}
|
||||
.component-outer:hover {
|
||||
box-shadow: 0px 0px 3px #0a7be0;
|
||||
}
|
||||
|
||||
.gap_class {
|
||||
padding: 5px;
|
||||
@ -374,7 +372,6 @@ export default {
|
||||
.main_view {
|
||||
position: relative;
|
||||
background-size: 100% 100% !important;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.component {
|
||||
@ -388,4 +385,12 @@ export default {
|
||||
width: 100% !important;
|
||||
height: 100% !important;
|
||||
}
|
||||
|
||||
.component-outer {
|
||||
transform: translate(0);
|
||||
}
|
||||
|
||||
.component-active {
|
||||
z-index: 1;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -985,7 +985,7 @@ export default {
|
||||
...style
|
||||
}
|
||||
} else if (this.canvasStyleData.panel.backgroundType === 'color') {
|
||||
const colorRGBA = hexColorToRGBA(this.canvasStyleData.panel.color, this.canvasStyleData.panel.alpha||100)
|
||||
const colorRGBA = hexColorToRGBA(this.canvasStyleData.panel.color, this.canvasStyleData.panel.alpha === undefined ? 100 : this.canvasStyleData.panel.alpha)
|
||||
style = {
|
||||
background: colorRGBA,
|
||||
...style
|
||||
|
||||
@ -575,7 +575,7 @@ export default {
|
||||
.bar-main {
|
||||
position: absolute;
|
||||
float: right;
|
||||
z-index: 2;
|
||||
z-index: 10;
|
||||
border-radius: 2px;
|
||||
padding-left: 3px;
|
||||
padding-right: 0px;
|
||||
|
||||
@ -120,7 +120,8 @@
|
||||
icon="el-icon-plus"
|
||||
round
|
||||
@click="addLinkageField(null,null)"
|
||||
>追加联动依赖字段</el-button>
|
||||
>追加联动依赖字段
|
||||
</el-button>
|
||||
</el-row>
|
||||
|
||||
<!-- <el-button slot="reference">T</el-button>-->
|
||||
@ -132,8 +133,9 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState } from 'vuex'
|
||||
import { checkSameDataSet } from '@/api/chart/chart'
|
||||
import {mapState} from 'vuex'
|
||||
import {checkSameDataSet} from '@/api/chart/chart'
|
||||
|
||||
export default {
|
||||
|
||||
props: {
|
||||
@ -172,18 +174,24 @@ export default {
|
||||
},
|
||||
...mapState([
|
||||
'targetLinkageInfo',
|
||||
'curLinkageView'
|
||||
'curLinkageView',
|
||||
'panelViewDetailsInfo'
|
||||
])
|
||||
},
|
||||
mounted() {
|
||||
const _this = this
|
||||
// 初始化映射关系 如果当前是相同的数据集且没有关联关系,则自动补充映射关系
|
||||
checkSameDataSet(this.curLinkageView.propValue.viewId, this.element.propValue.viewId).then(res => {
|
||||
const chartDetails = JSON.parse(this.panelViewDetailsInfo[this.curLinkageView.propValue.viewId])
|
||||
const curCheckAllAxisStr = chartDetails.xaxis + chartDetails.xaxisExt + chartDetails.yaxis + chartDetails.yaxisExt
|
||||
const targetChartDetails = JSON.parse(this.panelViewDetailsInfo[this.element.propValue.viewId])
|
||||
const targetCheckAllAxisStr = targetChartDetails.xaxis + targetChartDetails.xaxisExt + targetChartDetails.yaxis + targetChartDetails.yaxisExt
|
||||
|
||||
if (res.data === 'YES' && this.linkageInfo.linkageFields.length === 0) {
|
||||
this.sourceLinkageInfo.targetViewFields.forEach(item => {
|
||||
_this.$nextTick(() => {
|
||||
if (curCheckAllAxisStr.includes(item.id)&&targetCheckAllAxisStr.includes(item.id)) {
|
||||
this.addLinkageField(item.id, item.id)
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
@ -213,46 +221,48 @@ export default {
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.slot-class{
|
||||
color: white;
|
||||
}
|
||||
.slot-class {
|
||||
color: white;
|
||||
}
|
||||
|
||||
.bottom {
|
||||
margin-top: 20px;
|
||||
text-align: center;
|
||||
.bottom {
|
||||
margin-top: 20px;
|
||||
text-align: center;
|
||||
|
||||
}
|
||||
.ellip{
|
||||
/*width: 100%;*/
|
||||
margin-left: 10px;
|
||||
margin-right: 10px;
|
||||
overflow: hidden;/*超出部分隐藏*/
|
||||
white-space: nowrap;/*不换行*/
|
||||
text-overflow:ellipsis;/*超出部分文字以...显示*/
|
||||
background-color: #f7f8fa;
|
||||
color: #3d4d66;
|
||||
font-size: 12px;
|
||||
line-height: 24px;
|
||||
height: 24px;
|
||||
border-radius: 3px;
|
||||
}
|
||||
}
|
||||
|
||||
.select-filed{
|
||||
/*width: 100%;*/
|
||||
margin-left: 10px;
|
||||
margin-right: 10px;
|
||||
overflow: hidden;/*超出部分隐藏*/
|
||||
white-space: nowrap;/*不换行*/
|
||||
text-overflow:ellipsis;/*超出部分文字以...显示*/
|
||||
color: #3d4d66;
|
||||
font-size: 12px;
|
||||
line-height: 35px;
|
||||
height: 35px;
|
||||
border-radius: 3px;
|
||||
}
|
||||
::v-deep .el-popover{
|
||||
height: 200px;
|
||||
overflow: auto;
|
||||
}
|
||||
.ellip {
|
||||
/*width: 100%;*/
|
||||
margin-left: 10px;
|
||||
margin-right: 10px;
|
||||
overflow: hidden; /*超出部分隐藏*/
|
||||
white-space: nowrap; /*不换行*/
|
||||
text-overflow: ellipsis; /*超出部分文字以...显示*/
|
||||
background-color: #f7f8fa;
|
||||
color: #3d4d66;
|
||||
font-size: 12px;
|
||||
line-height: 24px;
|
||||
height: 24px;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.select-filed {
|
||||
/*width: 100%;*/
|
||||
margin-left: 10px;
|
||||
margin-right: 10px;
|
||||
overflow: hidden; /*超出部分隐藏*/
|
||||
white-space: nowrap; /*不换行*/
|
||||
text-overflow: ellipsis; /*超出部分文字以...显示*/
|
||||
color: #3d4d66;
|
||||
font-size: 12px;
|
||||
line-height: 35px;
|
||||
height: 35px;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
::v-deep .el-popover {
|
||||
height: 200px;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
@ -145,30 +145,32 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getStyle } from '@/components/canvas/utils/style'
|
||||
import { mapState } from 'vuex'
|
||||
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, imgUrlTrans } from '@/components/canvas/utils/utils'
|
||||
import {changeStyleWithScale} from '@/components/canvas/utils/translate'
|
||||
import {uuid} from 'vue-uuid'
|
||||
import {deepCopy, imgUrlTrans} from '@/components/canvas/utils/utils'
|
||||
import eventBus from '@/components/canvas/utils/eventBus'
|
||||
import elementResizeDetectorMaker from 'element-resize-detector'
|
||||
import CanvasOptBar from '@/components/canvas/components/editor/CanvasOptBar'
|
||||
import bus from '@/utils/bus'
|
||||
import { buildFilterMap, buildViewKeyMap, formatCondition, valueValid, viewIdMatch } from '@/utils/conditionUtil'
|
||||
import { hasDataPermission } from '@/utils/permission'
|
||||
import { activeWatermark } from '@/components/canvas/tools/watermark'
|
||||
import { proxyUserLoginInfo, userLoginInfo } from '@/api/systemInfo/userLogin'
|
||||
import {buildFilterMap, buildViewKeyMap, formatCondition, valueValid, viewIdMatch} from '@/utils/conditionUtil'
|
||||
import {hasDataPermission} from '@/utils/permission'
|
||||
import {activeWatermark} from '@/components/canvas/tools/watermark'
|
||||
import {proxyUserLoginInfo, userLoginInfo} from '@/api/systemInfo/userLogin'
|
||||
import html2canvas from 'html2canvasde'
|
||||
import { queryAll } from '@/api/panel/pdfTemplate'
|
||||
import {queryAll} from '@/api/panel/pdfTemplate'
|
||||
import PDFPreExport from '@/views/panel/export/PDFPreExport'
|
||||
import { listenGlobalKeyDownPreview } from '@/components/canvas/utils/shortcutKey'
|
||||
import {listenGlobalKeyDownPreview} from '@/components/canvas/utils/shortcutKey'
|
||||
import UserViewDialog from '@/components/canvas/customComponent/UserViewDialog'
|
||||
import {hexColorToRGBA} from "@/views/chart/chart/util";
|
||||
import {isMobile} from '@/utils/index'
|
||||
|
||||
|
||||
const erd = elementResizeDetectorMaker()
|
||||
export default {
|
||||
components: { UserViewDialog, ComponentWrapper, CanvasOptBar, PDFPreExport },
|
||||
components: {UserViewDialog, ComponentWrapper, CanvasOptBar, PDFPreExport},
|
||||
model: {
|
||||
prop: 'show',
|
||||
event: 'change'
|
||||
@ -205,14 +207,14 @@ export default {
|
||||
componentData: {
|
||||
type: Array,
|
||||
required: false,
|
||||
default: function() {
|
||||
default: function () {
|
||||
return []
|
||||
}
|
||||
},
|
||||
canvasStyleData: {
|
||||
type: Object,
|
||||
required: false,
|
||||
default: function() {
|
||||
default: function () {
|
||||
return {}
|
||||
}
|
||||
},
|
||||
@ -344,7 +346,7 @@ export default {
|
||||
background: `url(${imgUrlTrans(styleInfo.imageUrl)}) no-repeat`
|
||||
}
|
||||
} else if (styleInfo.backgroundType === 'color') {
|
||||
const colorRGBA = hexColorToRGBA(styleInfo.color, styleInfo.alpha||100)
|
||||
const colorRGBA = hexColorToRGBA(styleInfo.color, styleInfo.alpha === undefined ? 100 : styleInfo.alpha)
|
||||
style = {
|
||||
background: colorRGBA
|
||||
}
|
||||
@ -623,9 +625,8 @@ export default {
|
||||
return -1
|
||||
},
|
||||
_isMobile() {
|
||||
const flag = navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i)
|
||||
const flag = isMobile()
|
||||
this.terminal = flag ? 'mobile' : 'pc'
|
||||
// this.terminal = 'mobile'
|
||||
},
|
||||
canvasStyleDataInit() {
|
||||
// 数据刷新计时器
|
||||
@ -648,7 +649,7 @@ export default {
|
||||
},
|
||||
clearAllLinkage() {
|
||||
this.$store.commit('clearPanelLinkageInfo')
|
||||
bus.$emit('clear_panel_linkage', { viewId: 'all' })
|
||||
bus.$emit('clear_panel_linkage', {viewId: 'all'})
|
||||
},
|
||||
changeStyleWithScale,
|
||||
getStyle,
|
||||
@ -707,13 +708,13 @@ export default {
|
||||
},
|
||||
exportViewImg() {
|
||||
this.imageDownloading = true
|
||||
this.$refs['userViewDialog-canvas-main'].exportViewImg(()=>{
|
||||
this.$refs['userViewDialog-canvas-main'].exportViewImg(() => {
|
||||
this.imageDownloading = false
|
||||
})
|
||||
},
|
||||
deselectCurComponent(e) {
|
||||
if (!this.isClickComponent) {
|
||||
this.$store.commit('setCurComponent', { component: null, index: null })
|
||||
this.$store.commit('setCurComponent', {component: null, index: null})
|
||||
if (this.$refs?.['canvas-opt-bar']) {
|
||||
this.$refs['canvas-opt-bar'].setWidgetStatus()
|
||||
}
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
trigger="click"
|
||||
@mouseup="handleMouseUp"
|
||||
>
|
||||
<slot name="icon"/>
|
||||
<slot name="icon" />
|
||||
<el-dropdown-menu v-if="curComponent">
|
||||
<el-dropdown-item
|
||||
v-if="editFilter.includes(curComponent.type)"
|
||||
@ -17,8 +17,7 @@
|
||||
v-if="curComponent.type != 'custom-button'"
|
||||
icon="el-icon-document-copy"
|
||||
@click.native="copy"
|
||||
><span>{{ $t('panel.copy') }} (<span v-show="systemOS==='Mac'"><i class="icon iconfont icon-command"
|
||||
/>+ D</span> <span v-show="systemOS!=='Mac'">Control + D</span>)</span>
|
||||
><span>{{ $t('panel.copy') }} (<span v-show="systemOS==='Mac'"><i class="icon iconfont icon-command" />+ D</span> <span v-show="systemOS!=='Mac'">Control + D</span>)</span>
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item
|
||||
icon="el-icon-delete"
|
||||
@ -34,7 +33,7 @@
|
||||
<el-dropdown-item v-if="!curComponent.auxiliaryMatrix">
|
||||
<el-dropdown placement="right-start">
|
||||
<span class="el-icon-copy-document">
|
||||
{{ $t('panel.level') }} <i class="el-icon-arrow-right el-icon--right"/>
|
||||
{{ $t('panel.level') }} <i class="el-icon-arrow-right el-icon--right" />
|
||||
</span>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item
|
||||
@ -93,13 +92,13 @@
|
||||
<el-dropdown-item
|
||||
v-if="curComponent.type != 'custom-button'"
|
||||
@click.native="hyperlinksSet"
|
||||
><i class="icon iconfont icon-chaolianjie1"/>{{ $t('panel.hyperlinks') }}
|
||||
><i class="icon iconfont icon-chaolianjie1" />{{ $t('panel.hyperlinks') }}
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item
|
||||
v-if="curComponent.type !== 'view' && !curComponent.auxiliaryMatrix"
|
||||
@click.native="positionAdjust"
|
||||
>
|
||||
<i class="el-icon-map-location"/>
|
||||
<i class="el-icon-map-location" />
|
||||
{{ $t('panel.position_adjust') }}
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
@ -180,7 +179,7 @@ import TabCarouselDialog from '@/components/canvas/components/editor/TabCarousel
|
||||
import CustomTabsSort from '@/components/widget/deWidget/CustomTabsSort'
|
||||
|
||||
export default {
|
||||
components: { CustomTabsSort, HyperlinksDialog,TabCarouselDialog },
|
||||
components: { CustomTabsSort, HyperlinksDialog, TabCarouselDialog },
|
||||
data() {
|
||||
return {
|
||||
tabCarouselVisible: false,
|
||||
@ -193,7 +192,8 @@ export default {
|
||||
'text',
|
||||
'label',
|
||||
'flow-map',
|
||||
'bidirectional-bar'
|
||||
'bidirectional-bar',
|
||||
'race-bar'
|
||||
],
|
||||
linkageExcludeViewType: [
|
||||
'richTextView',
|
||||
@ -202,7 +202,8 @@ export default {
|
||||
'text',
|
||||
'label',
|
||||
'flow-map',
|
||||
'bidirectional-bar'
|
||||
'bidirectional-bar',
|
||||
'race-bar'
|
||||
],
|
||||
copyData: null,
|
||||
hyperlinksSetVisible: false,
|
||||
|
||||
@ -35,6 +35,7 @@
|
||||
:obj="{active, chart, trackMenu, searchCount, terminalType: scaleCoefficientType}"
|
||||
:chart="chart"
|
||||
:track-menu="trackMenu"
|
||||
:in-screen="inScreen"
|
||||
:search-count="searchCount"
|
||||
:terminal-type="scaleCoefficientType"
|
||||
:scale="scale"
|
||||
@ -67,6 +68,7 @@
|
||||
:scale="scale"
|
||||
:theme-style="element.commonBackground"
|
||||
:active="active"
|
||||
:in-screen="inScreen"
|
||||
@onChartClick="chartClick"
|
||||
@onJumpClick="jumpClick"
|
||||
/>
|
||||
@ -360,7 +362,7 @@ export default {
|
||||
computed: {
|
||||
// 首次加载且非编辑状态新复制的视图,使用外部filter
|
||||
initLoad() {
|
||||
return !(this.isEdit && this.currentCanvasNewId.includes(this.element.id)) && this.isFirstLoad && this.canvasId === 'canvas-main'
|
||||
return !(this.isEdit && this.currentCanvasNewId.includes(this.element.id)) && this.isFirstLoad
|
||||
},
|
||||
scaleCoefficient() {
|
||||
if (this.terminal === 'pc' && !this.mobileLayoutStatus) {
|
||||
|
||||
@ -144,7 +144,7 @@ export default {
|
||||
...style
|
||||
}
|
||||
} else if (this.canvasStyleData.panel.backgroundType === 'color') {
|
||||
const colorRGBA = hexColorToRGBA(this.canvasStyleData.panel.color, this.canvasStyleData.panel.alpha||100)
|
||||
const colorRGBA = hexColorToRGBA(this.canvasStyleData.panel.color, this.canvasStyleData.panel.alpha === undefined ? 100 : this.canvasStyleData.panel.alpha)
|
||||
style = {
|
||||
background: colorRGBA,
|
||||
...style
|
||||
|
||||
@ -102,7 +102,7 @@ export default {
|
||||
...style
|
||||
}
|
||||
} else if (this.canvasStyleData.panel.backgroundType === 'color') {
|
||||
const colorRGBA = hexColorToRGBA(this.canvasStyleData.panel.color, this.canvasStyleData.panel.alpha||100)
|
||||
const colorRGBA = hexColorToRGBA(this.canvasStyleData.panel.color, this.canvasStyleData.panel.alpha === undefined ? 100 : this.canvasStyleData.panel.alpha)
|
||||
style = {
|
||||
background: colorRGBA,
|
||||
...style
|
||||
|
||||
@ -27,6 +27,10 @@ export default {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
canvasStyleData:{
|
||||
type: Object,
|
||||
default: {}
|
||||
},
|
||||
size: String
|
||||
},
|
||||
|
||||
@ -45,10 +49,7 @@ export default {
|
||||
}
|
||||
}
|
||||
return false
|
||||
},
|
||||
...mapState([
|
||||
'canvasStyleData'
|
||||
])
|
||||
}
|
||||
|
||||
},
|
||||
created() {
|
||||
|
||||
@ -60,7 +60,8 @@ export default {
|
||||
values: null,
|
||||
onFocus: false,
|
||||
show: true,
|
||||
timer: null
|
||||
outTimer: null,
|
||||
innerTimer: null
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@ -134,12 +135,7 @@ export default {
|
||||
|
||||
},
|
||||
watch: {
|
||||
canvasStyleData: {
|
||||
handler(newVal, oldVla) {
|
||||
this.canvasStyleDataInit()
|
||||
},
|
||||
deep: true
|
||||
},
|
||||
|
||||
'viewIds': function(value, old) {
|
||||
if (typeof value === 'undefined' || value === old) return
|
||||
this.setCondition()
|
||||
@ -174,7 +170,9 @@ export default {
|
||||
},
|
||||
created() {
|
||||
this.loadInit()
|
||||
this.canvasStyleDataInit()
|
||||
this.$nextTick(() => {
|
||||
this.dynamicRefresh()
|
||||
})
|
||||
},
|
||||
mounted() {
|
||||
bus.$on('onScroll', this.onScroll)
|
||||
@ -183,18 +181,14 @@ export default {
|
||||
}
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.timer && clearInterval(this.timer)
|
||||
this.clearTime()
|
||||
bus.$off('onScroll', this.onScroll)
|
||||
bus.$off('reset-default-value', this.resetDefaultValue)
|
||||
},
|
||||
methods: {
|
||||
loadInit() {
|
||||
if (this.element.options.attrs.default && this.element.options.attrs.default.isDynamic) {
|
||||
if (this.element.options.attrs.default) {
|
||||
const widget = ApplicationContext.getService(this.element.serviceName)
|
||||
this.values = widget.dynamicDateFormNow(this.element)
|
||||
this.dateChange(this.values)
|
||||
}
|
||||
this.clearTime()
|
||||
if (this.refreshHandler()) {
|
||||
return
|
||||
}
|
||||
if (this.element.options.value) {
|
||||
@ -202,22 +196,42 @@ export default {
|
||||
this.dateChange(this.values)
|
||||
}
|
||||
},
|
||||
canvasStyleDataInit() {
|
||||
if (this.inDraw && this.canvasStyleData.refreshViewEnable && this.element.options.attrs.default && this.element.options.attrs.default.isDynamic) {
|
||||
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
|
||||
refreshHandler() {
|
||||
if (this.element.options.attrs.default?.isDynamic) {
|
||||
const widget = ApplicationContext.getService(this.element.serviceName)
|
||||
this.values = widget.dynamicDateFormNow(this.element)
|
||||
this.dateChange(this.values)
|
||||
return true
|
||||
}
|
||||
return false
|
||||
},
|
||||
clearTime() {
|
||||
if (this.outTimer) {
|
||||
clearTimeout(this.outTimer)
|
||||
this.outTimer = null
|
||||
}
|
||||
if (this.innerTimer) {
|
||||
clearInterval(this.innerTimer)
|
||||
this.innerTimer = null
|
||||
}
|
||||
},
|
||||
dynamicRefresh() {
|
||||
if (this.inDraw && this.element.options.attrs.default?.isDynamic) {
|
||||
const nowDate = new Date()
|
||||
const nowTime = nowDate.getTime()
|
||||
const tomorrow = new Date(`${nowDate.getFullYear()}-${nowDate.getMonth() + 1}-${nowDate.getDate() + 1} 00:00:01`)
|
||||
const tomorrowTime = tomorrow.getTime()
|
||||
this.clearTime()
|
||||
this.outTimer = setTimeout(() => {
|
||||
if (this.inDraw) {
|
||||
this.refreshHandler()
|
||||
}
|
||||
}
|
||||
this.timer = setInterval(() => {
|
||||
this.loadInit()
|
||||
this.searchCount++
|
||||
}, refreshTime)
|
||||
this.innerTimer = setInterval(() => {
|
||||
if (this.inDraw) {
|
||||
this.refreshHandler()
|
||||
}
|
||||
}, 24 * 3600 * 1000)
|
||||
}, tomorrowTime - nowTime)
|
||||
}
|
||||
},
|
||||
clearHandler() {
|
||||
|
||||
@ -27,6 +27,10 @@ export default {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
canvasStyleData:{
|
||||
type: Object,
|
||||
default: {}
|
||||
},
|
||||
size: String
|
||||
},
|
||||
data() {
|
||||
@ -44,11 +48,7 @@ export default {
|
||||
}
|
||||
}
|
||||
return false
|
||||
},
|
||||
...mapState([
|
||||
'canvasStyleData'
|
||||
])
|
||||
|
||||
}
|
||||
},
|
||||
created() {
|
||||
},
|
||||
|
||||
@ -669,7 +669,7 @@ export default {
|
||||
input_phone: 'Please enter the phone number',
|
||||
input_roles: 'Please select role',
|
||||
select_users: 'Please select user',
|
||||
user_name_pattern_error: 'IDs can only contain alphanumeric and ._- and start with a letter!',
|
||||
user_name_pattern_error: 'IDs can only contain alphanumeric and ._- and start with a letter or number!',
|
||||
special_characters_are_not_supported: 'Special characters are not supported',
|
||||
mobile_number_format_is_incorrect: 'Incorrect format of mobile phone number',
|
||||
email_format_is_incorrect: 'The mailbox format is incorrect',
|
||||
@ -1192,6 +1192,7 @@ export default {
|
||||
y_W: 'Year Week',
|
||||
y_M_d: 'Year Month Day',
|
||||
H_m_s: 'Hour Minute Second',
|
||||
y_M_d_H: 'Year Month Day Hour',
|
||||
y_M_d_H_m: 'Year Month Day Hour Minute',
|
||||
y_M_d_H_m_s: 'Year Month Day Hour Minute Second',
|
||||
date_sub: 'yyyy-MM-dd',
|
||||
@ -1466,6 +1467,7 @@ export default {
|
||||
dimension_text_style: 'Name Style',
|
||||
dimension_letter_space: 'Name Letter Space',
|
||||
font_family: 'Font Family',
|
||||
font_family_tip: 'The font will only take effect if it is installed on the operating system',
|
||||
letter_space: 'Letter Space',
|
||||
font_shadow: 'Font Shadow',
|
||||
chart_area: 'Area',
|
||||
@ -1487,6 +1489,8 @@ export default {
|
||||
label_content: 'Label Content',
|
||||
percent: 'Percent',
|
||||
table_index_desc: 'Index Header Name',
|
||||
table_row_tooltip: 'Row Tooltip',
|
||||
table_col_tooltip: 'Column Tooltip',
|
||||
total_sort: 'Total Sort',
|
||||
total_sort_none: 'None',
|
||||
total_sort_asc: 'ASC',
|
||||
@ -2412,6 +2416,7 @@ export default {
|
||||
themeDark: 'Dark',
|
||||
themeCustom: 'Custom',
|
||||
openHomePage: 'Show Home Page',
|
||||
auto_identify_mobile_devices: 'Automatically identify mobile devices',
|
||||
openMarketPage: 'Show Market Page',
|
||||
mobileBG: 'Mobile Login page BG',
|
||||
helpLink: 'Help Document Link',
|
||||
@ -2853,7 +2858,8 @@ export default {
|
||||
geo_json: 'Geo Json',
|
||||
fileplaceholder: 'Please upload the JSON format coordinate file',
|
||||
delete_confirm: 'And child nodes will be deleted. Confirm to execute ?',
|
||||
cur_node: 'Current node'
|
||||
cur_node: 'Current node',
|
||||
prohibit_prompts: '000 and 156 are the global village and China area code prefixes respectively. Removal is prohibited. Please use other code prefixes!'
|
||||
},
|
||||
map_mapping: {
|
||||
map: 'Map',
|
||||
|
||||
@ -669,7 +669,7 @@ export default {
|
||||
input_roles: '請選擇角色',
|
||||
select_users: '請選擇用戶',
|
||||
select_gender: '請選擇性別',
|
||||
user_name_pattern_error: 'ID只能包含字母数字以及._-并以字母开头!',
|
||||
user_name_pattern_error: 'ID只能包含字母數字以及._-並以字母或數字開頭!',
|
||||
special_characters_are_not_supported: '不支持特殊字符',
|
||||
mobile_number_format_is_incorrect: '手機號碼格式不正確',
|
||||
email_format_is_incorrect: '郵箱格式不正確',
|
||||
@ -1191,6 +1191,7 @@ export default {
|
||||
y_W: '年周',
|
||||
y_M_d: '年月日',
|
||||
H_m_s: '時分秒',
|
||||
y_M_d_H: '年月日時',
|
||||
y_M_d_H_m: '年月日時分',
|
||||
y_M_d_H_m_s: '年月日時分秒',
|
||||
date_sub: 'yyyy-MM-dd',
|
||||
@ -1465,6 +1466,7 @@ export default {
|
||||
dimension_text_style: '名稱樣式',
|
||||
dimension_letter_space: '名稱字間距',
|
||||
font_family: '字體',
|
||||
font_family_tip: '只有操作系統上已安裝該字體才能生效',
|
||||
letter_space: '字間距',
|
||||
font_shadow: '字體陰影',
|
||||
chart_area: '面積圖',
|
||||
@ -1486,6 +1488,8 @@ export default {
|
||||
label_content: '標籤展示',
|
||||
percent: '占比',
|
||||
table_index_desc: '表頭名稱',
|
||||
table_row_tooltip: '行頭提示',
|
||||
table_col_tooltip: '列頭提示',
|
||||
total_sort: '總計排序',
|
||||
total_sort_none: '無',
|
||||
total_sort_asc: '升序',
|
||||
@ -2406,6 +2410,7 @@ export default {
|
||||
themeDark: '深色',
|
||||
themeCustom: '自定義',
|
||||
openHomePage: '顯示首頁',
|
||||
auto_identify_mobile_devices: '自動識別移動設備',
|
||||
openMarketPage: '顯示模板市場',
|
||||
mobileBG: '移動端登錄頁背景',
|
||||
helpLink: '幫助文檔鏈接',
|
||||
@ -2847,7 +2852,8 @@ export default {
|
||||
geo_json: '坐標文件',
|
||||
fileplaceholder: '請上傳json格式坐標文件',
|
||||
delete_confirm: '及子節點都會被刪除,確認執行?',
|
||||
cur_node: '當前節點'
|
||||
cur_node: '當前節點',
|
||||
prohibit_prompts: '000、156分別是地球村和中華人民共和國區域代碼前綴,禁止移除,請使用其他代碼前綴!'
|
||||
},
|
||||
map_mapping: {
|
||||
map: '圖形',
|
||||
|
||||
@ -668,7 +668,7 @@ export default {
|
||||
input_roles: '请选择角色',
|
||||
select_users: '请选择用户',
|
||||
select_gender: '请选择性别',
|
||||
user_name_pattern_error: 'ID只能包含字母数字以及._-并以字母开头!',
|
||||
user_name_pattern_error: 'ID只能包含字母数字以及._-并以字母或数字开头!',
|
||||
special_characters_are_not_supported: '不支持特殊字符',
|
||||
mobile_number_format_is_incorrect: '手机号码格式不正确',
|
||||
email_format_is_incorrect: '邮箱格式不正确',
|
||||
@ -1190,6 +1190,7 @@ export default {
|
||||
y_W: '年周',
|
||||
y_M_d: '年月日',
|
||||
H_m_s: '时分秒',
|
||||
y_M_d_H: '年月日时',
|
||||
y_M_d_H_m: '年月日时分',
|
||||
y_M_d_H_m_s: '年月日时分秒',
|
||||
date_sub: 'yyyy-MM-dd',
|
||||
@ -1464,6 +1465,7 @@ export default {
|
||||
dimension_text_style: '名称样式',
|
||||
dimension_letter_space: '名称字间距',
|
||||
font_family: '字体',
|
||||
font_family_tip: '只有操作系统上已安装该字体才能生效',
|
||||
letter_space: '字间距',
|
||||
font_shadow: '字体阴影',
|
||||
chart_area: '面积图',
|
||||
@ -1485,6 +1487,8 @@ export default {
|
||||
label_content: '标签展示',
|
||||
percent: '占比',
|
||||
table_index_desc: '表头名称',
|
||||
table_row_tooltip: '行头提示',
|
||||
table_col_tooltip: '列头提示',
|
||||
total_sort: '总计排序',
|
||||
total_sort_none: '无',
|
||||
total_sort_asc: '升序',
|
||||
@ -2406,6 +2410,7 @@ export default {
|
||||
themeDark: '深色',
|
||||
themeCustom: '自定义',
|
||||
openHomePage: '显示首页',
|
||||
auto_identify_mobile_devices: '自动识别移动设备',
|
||||
openMarketPage: '显示模板市场',
|
||||
mobileBG: '移动端登录页背景',
|
||||
helpLink: '帮助文档链接',
|
||||
@ -2847,7 +2852,8 @@ export default {
|
||||
geo_json: '坐标文件',
|
||||
fileplaceholder: '请上传json格式坐标文件',
|
||||
delete_confirm: '及子节点都会被删除,确认执行?',
|
||||
cur_node: '当前节点'
|
||||
cur_node: '当前节点',
|
||||
prohibit_prompts: '000、156分别是地球村和中华人民共和国区域代码前缀,禁止移除,请使用其他代码前缀!'
|
||||
},
|
||||
map_mapping: {
|
||||
map: '图形',
|
||||
|
||||
@ -40,6 +40,7 @@ import VueFriendlyIframe from 'vue-friendly-iframe'
|
||||
import vueToPdf from 'vue-to-pdf'
|
||||
import VueVideoPlayer from 'vue-video-player'
|
||||
import 'video.js/dist/video-js.css'
|
||||
import '@antv/s2/dist/style.min.css'
|
||||
// 控制标签宽高成比例的指令
|
||||
import proportion from 'vue-proportion-directive'
|
||||
|
||||
|
||||
@ -5,6 +5,7 @@ import { seizeLogin } from '@/api/user'
|
||||
import router from '@/router'
|
||||
import store from '@/store'
|
||||
import { Loading } from 'element-ui'
|
||||
import { getSysUI } from '@/utils/auth'
|
||||
export function timeSection(date, type, labelFormat = 'yyyy-MM-dd') {
|
||||
if (!date) {
|
||||
return null
|
||||
@ -308,6 +309,10 @@ export function getQueryVariable(variable) {
|
||||
}
|
||||
|
||||
export function isMobile() {
|
||||
const uiInfo = getSysUI()
|
||||
if (uiInfo['ui.autoMobile']?.paramValue === 'false') {
|
||||
return false
|
||||
}
|
||||
const flag = navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i)
|
||||
return flag
|
||||
}
|
||||
|
||||
@ -109,15 +109,6 @@ service.interceptors.response.use(response => {
|
||||
config.loading && tryHideLoading(store.getters.currentPath)
|
||||
|
||||
let msg = ''
|
||||
if (error?.response?.config?.url === 'dataset/table/exportDataset') {
|
||||
checkAuth(error.response)
|
||||
var reader = new FileReader()
|
||||
reader.readAsText(error.response.data, 'utf-8')
|
||||
reader.onload = () => {
|
||||
$error((JSON.parse(reader.result) || {}).message)
|
||||
}
|
||||
return Promise.reject()
|
||||
}
|
||||
|
||||
if (error.response) {
|
||||
checkAuth(error.response)
|
||||
|
||||
@ -228,7 +228,7 @@ export default {
|
||||
...style
|
||||
}
|
||||
} else if (this.canvasStyleData.panel.backgroundType === 'color') {
|
||||
const colorRGBA = hexColorToRGBA(this.canvasStyleData.panel.color, this.canvasStyleData.panel.alpha||100)
|
||||
const colorRGBA = hexColorToRGBA(this.canvasStyleData.panel.color, this.canvasStyleData.panel.alpha === undefined ? 100 : this.canvasStyleData.panel.alpha)
|
||||
style = {
|
||||
background: colorRGBA,
|
||||
...style
|
||||
|
||||
@ -291,7 +291,7 @@ export default {
|
||||
...style
|
||||
}
|
||||
} else if (this.canvasStyleData.panel.backgroundType === 'color') {
|
||||
const colorRGBA = hexColorToRGBA(this.canvasStyleData.panel.color, this.canvasStyleData.panel.alpha||100)
|
||||
const colorRGBA = hexColorToRGBA(this.canvasStyleData.panel.color, this.canvasStyleData.panel.alpha === undefined ? 100 : this.canvasStyleData.panel.alpha)
|
||||
style = {
|
||||
background: colorRGBA,
|
||||
...style
|
||||
|
||||
@ -45,6 +45,16 @@ export function baseBarOptionAntV(plot, container, chart, action, isGroup, isSta
|
||||
yAxis: yAxis,
|
||||
slider: slider,
|
||||
annotations: analyse,
|
||||
brush: {
|
||||
enabled: true,
|
||||
isStartEnable: (context) => {
|
||||
// 按住 shift 键,才能开启交互
|
||||
if (context.event.gEvent.originalEvent?.shiftKey) {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
},
|
||||
interactions: [
|
||||
{
|
||||
type: 'legend-active', cfg: {
|
||||
@ -162,6 +172,16 @@ export function hBaseBarOptionAntV(plot, container, chart, action, isGroup, isSt
|
||||
yAxis: yAxis,
|
||||
slider: slider,
|
||||
annotations: analyse,
|
||||
brush: {
|
||||
enabled: true,
|
||||
isStartEnable: (context) => {
|
||||
// 按住 shift 键,才能开启交互
|
||||
if (context.event.gEvent.originalEvent?.shiftKey) {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
},
|
||||
interactions: [
|
||||
{
|
||||
type: 'legend-active', cfg: {
|
||||
|
||||
@ -86,6 +86,12 @@ export const DEFAULT_SIZE = {
|
||||
tableHeaderAlign: 'left',
|
||||
tableItemAlign: 'right',
|
||||
tableAutoBreakLine: false,
|
||||
tableRowTooltip: {
|
||||
show: false
|
||||
},
|
||||
tableColTooltip: {
|
||||
show: false
|
||||
},
|
||||
gaugeMinType: 'fix', // fix or dynamic
|
||||
gaugeMinField: {
|
||||
id: '',
|
||||
@ -1146,6 +1152,13 @@ export const CHART_FONT_FAMILY = [
|
||||
{ name: '楷体', value: 'KaiTi' }
|
||||
]
|
||||
|
||||
export const CHART_CONT_FAMILY_MAP = {
|
||||
'Microsoft YaHei': 'Microsoft YaHei',
|
||||
'SimSun': 'SimSun, "Songti SC", STSong',
|
||||
'SimHei': 'SimHei, Helvetica',
|
||||
'KaiTi': 'KaiTi, "Kaiti SC", STKaiti'
|
||||
}
|
||||
|
||||
export const CHART_FONT_LETTER_SPACE = [
|
||||
{ name: '0px', value: '0' },
|
||||
{ name: '1px', value: '1' },
|
||||
|
||||
@ -141,6 +141,11 @@ export function getLabel(chart) {
|
||||
if (l.position === 'inner') {
|
||||
label.offset = -10
|
||||
}
|
||||
} else if (chart.type.includes('bar')) {
|
||||
label = {
|
||||
layout: [{ type: 'limit-in-canvas' }],
|
||||
position: l.position
|
||||
}
|
||||
} else {
|
||||
label = {
|
||||
position: l.position
|
||||
@ -588,9 +593,11 @@ export function getXAxis(chart) {
|
||||
stroke: axisCfg.lineStyle.color
|
||||
}
|
||||
} : null
|
||||
const rotate = parseInt(a.axisLabel.rotate)
|
||||
const label = a.axisLabel.show ? {
|
||||
rotate: parseInt(a.axisLabel.rotate) * Math.PI / 180,
|
||||
rotate: rotate * Math.PI / 180,
|
||||
style: {
|
||||
textAlign: rotate > 20 ? 'start' : rotate < -20 ? 'end' : 'center',
|
||||
fill: a.axisLabel.color,
|
||||
fontSize: parseInt(a.axisLabel.fontSize)
|
||||
},
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { TableSheet, S2Event, PivotSheet, DataCell, EXTRA_FIELD, TOTAL_VALUE } from '@antv/s2'
|
||||
import { TableSheet, S2Event, PivotSheet, DataCell, EXTRA_FIELD, TOTAL_VALUE, BaseEvent } from '@antv/s2'
|
||||
import { getCustomTheme, getSize } from '@/views/chart/chart/common/common_table'
|
||||
import { DEFAULT_COLOR_CASE, DEFAULT_TOTAL } from '@/views/chart/chart/chart'
|
||||
import { formatterItem, valueFormatter } from '@/views/chart/chart/formatter'
|
||||
@ -7,7 +7,7 @@ export function baseTableInfo(s2, container, chart, action, tableData, pageInfo)
|
||||
const containerDom = document.getElementById(container)
|
||||
|
||||
// fields
|
||||
const fields = chart.data.fields
|
||||
let fields = chart.data.fields
|
||||
if (!fields || fields.length === 0) {
|
||||
if (s2) {
|
||||
s2.destroy()
|
||||
@ -17,8 +17,17 @@ export function baseTableInfo(s2, container, chart, action, tableData, pageInfo)
|
||||
|
||||
const columns = []
|
||||
const meta = []
|
||||
|
||||
// add drill list
|
||||
// 记录下钻起始字段的index
|
||||
let xAxis = []
|
||||
try {
|
||||
xAxis = JSON.parse(chart.xaxis)
|
||||
} catch (err) {
|
||||
xAxis = JSON.parse(JSON.stringify(chart.xaxis))
|
||||
}
|
||||
const nameMap = xAxis.reduce((pre, next) => {
|
||||
pre[next.dataeaseName] = next
|
||||
return pre
|
||||
}, {})
|
||||
if (chart.drill) {
|
||||
let drillFields = []
|
||||
try {
|
||||
@ -26,107 +35,44 @@ export function baseTableInfo(s2, container, chart, action, tableData, pageInfo)
|
||||
} catch (err) {
|
||||
drillFields = JSON.parse(JSON.stringify(chart.drillFields))
|
||||
}
|
||||
|
||||
const drillField = drillFields[chart.drillFilters.length]
|
||||
|
||||
const drillFilters = JSON.parse(JSON.stringify(chart.drillFilters))
|
||||
const drillExp = drillFilters[drillFilters.length - 1].datasetTableField
|
||||
|
||||
// 记录下钻起始字段的index
|
||||
let xAxis = []
|
||||
try {
|
||||
xAxis = JSON.parse(chart.xaxis)
|
||||
} catch (err) {
|
||||
xAxis = JSON.parse(JSON.stringify(chart.xaxis))
|
||||
}
|
||||
let index = 0
|
||||
for (let i = 0; i < xAxis.length; i++) {
|
||||
if (xAxis[i].id === drillFilters[0].fieldId) {
|
||||
index = i
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
// 移除所有下钻字段
|
||||
const removeField = []
|
||||
for (let i = 0; i < chart.drillFilters.length; i++) {
|
||||
const ele = chart.drillFilters[i].datasetTableField
|
||||
removeField.push(ele.dataeaseName)
|
||||
}
|
||||
|
||||
// build field
|
||||
fields.forEach(ele => {
|
||||
if (removeField.indexOf(ele.dataeaseName) < 0) {
|
||||
// 用下钻字段替换当前字段
|
||||
if (drillExp.dataeaseName === ele.dataeaseName) {
|
||||
columns.push(drillField.dataeaseName)
|
||||
meta.push({
|
||||
field: drillField.dataeaseName,
|
||||
name: drillField.name
|
||||
})
|
||||
} else {
|
||||
const f = getCurrentField(chart.xaxis, ele)
|
||||
columns.push(ele.dataeaseName)
|
||||
meta.push({
|
||||
field: ele.dataeaseName,
|
||||
name: ele.name,
|
||||
formatter: function(value) {
|
||||
if (!f) {
|
||||
return value
|
||||
}
|
||||
if (value === null || value === undefined) {
|
||||
return value
|
||||
}
|
||||
if (f.groupType === 'd') {
|
||||
return value
|
||||
} else {
|
||||
if (f.formatterCfg) {
|
||||
const v = valueFormatter(value, f.formatterCfg)
|
||||
return v.includes('NaN') ? value : v
|
||||
} else {
|
||||
const v = valueFormatter(value, formatterItem)
|
||||
return v.includes('NaN') ? value : v
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
// 修正下钻字段的index,获取下钻位置元素添加到index位置,并删除
|
||||
const ele = columns[columns.length - 1]
|
||||
columns.splice(index, 0, ele)
|
||||
columns.splice(columns.length - 1, 1)
|
||||
} else {
|
||||
fields.forEach(ele => {
|
||||
const f = getCurrentField(chart.xaxis, ele)
|
||||
columns.push(ele.dataeaseName)
|
||||
meta.push({
|
||||
field: ele.dataeaseName,
|
||||
name: ele.name,
|
||||
formatter: function(value) {
|
||||
if (!f) {
|
||||
return value
|
||||
}
|
||||
if (value === null || value === undefined) {
|
||||
return value
|
||||
}
|
||||
if (f.groupType === 'd') {
|
||||
return value
|
||||
} else {
|
||||
if (f.formatterCfg) {
|
||||
const v = valueFormatter(value, f.formatterCfg)
|
||||
return v.includes('NaN') ? value : v
|
||||
} else {
|
||||
const v = valueFormatter(value, formatterItem)
|
||||
return v.includes('NaN') ? value : v
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
// 总下钻过滤字段
|
||||
const drillFilters = JSON.parse(JSON.stringify(chart.drillFilters)).map(i => i.fieldId)
|
||||
// 当前下钻字段
|
||||
const curDrillField = drillFields[chart.drillFilters.length]
|
||||
drillFilters.push(curDrillField.id)
|
||||
// 下钻入口字段的下标
|
||||
const drillEnterFieldIndex = xAxis.findIndex(item => item.id === drillFilters[0])
|
||||
// 移除所有下钻字段,调整当前下钻字段到下钻入口位置
|
||||
fields = fields.filter(item => !drillFilters.includes(item.id))
|
||||
fields.splice(drillEnterFieldIndex, 0, curDrillField)
|
||||
}
|
||||
fields.forEach(ele => {
|
||||
const f = nameMap[ele.dataeaseName]
|
||||
columns.push(ele.dataeaseName)
|
||||
meta.push({
|
||||
field: ele.dataeaseName,
|
||||
name: ele.name,
|
||||
formatter: function(value) {
|
||||
if (!f) {
|
||||
return value
|
||||
}
|
||||
if (value === null || value === undefined) {
|
||||
return value
|
||||
}
|
||||
if (f.groupType === 'd') {
|
||||
return value
|
||||
} else {
|
||||
if (f.formatterCfg) {
|
||||
const v = valueFormatter(value, f.formatterCfg)
|
||||
return v.includes('NaN') ? value : v
|
||||
} else {
|
||||
const v = valueFormatter(value, formatterItem)
|
||||
return v.includes('NaN') ? value : v
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
// 空值处理
|
||||
const newData = handleTableEmptyStrategy(tableData, chart)
|
||||
// data config
|
||||
@ -174,6 +120,11 @@ export function baseTableInfo(s2, container, chart, action, tableData, pageInfo)
|
||||
|
||||
// click
|
||||
s2.on(S2Event.DATA_CELL_CLICK, action)
|
||||
// hover
|
||||
const size = customAttr.size
|
||||
if (size.tableColTooltip?.show) {
|
||||
s2.on(S2Event.COL_CELL_HOVER, event => showTooltip(s2, event))
|
||||
}
|
||||
|
||||
// theme
|
||||
const customTheme = getCustomTheme(chart)
|
||||
@ -342,7 +293,11 @@ export function baseTableNormal(s2, container, chart, action, tableData) {
|
||||
|
||||
// click
|
||||
s2.on(S2Event.DATA_CELL_CLICK, action)
|
||||
|
||||
// hover
|
||||
const size = customAttr.size
|
||||
if (size.tableColTooltip?.show) {
|
||||
s2.on(S2Event.COL_CELL_HOVER, event => showTooltip(s2, event))
|
||||
}
|
||||
// theme
|
||||
const customTheme = getCustomTheme(chart)
|
||||
s2.setThemeCfg({ theme: customTheme })
|
||||
@ -455,8 +410,8 @@ export function baseTablePivot(s2, container, chart, action, headerAction, table
|
||||
// total config
|
||||
let totalCfg = {}
|
||||
const chartObj = JSON.parse(JSON.stringify(chart))
|
||||
let customAttr
|
||||
if (chartObj.customAttr) {
|
||||
let customAttr = null
|
||||
if (Object.prototype.toString.call(chartObj.customAttr) === '[object Object]') {
|
||||
customAttr = JSON.parse(JSON.stringify(chartObj.customAttr))
|
||||
} else {
|
||||
@ -528,7 +483,14 @@ export function baseTablePivot(s2, container, chart, action, headerAction, table
|
||||
s2.on(S2Event.DATA_CELL_CLICK, action)
|
||||
s2.on(S2Event.ROW_CELL_CLICK, headerAction)
|
||||
s2.on(S2Event.COL_CELL_CLICK, headerAction)
|
||||
|
||||
// hover
|
||||
const size = customAttr?.size
|
||||
if (size?.tableRowTooltip?.show) {
|
||||
s2.on(S2Event.ROW_CELL_HOVER, event => showTooltip(s2, event))
|
||||
}
|
||||
if (size?.tableColTooltip?.show) {
|
||||
s2.on(S2Event.COL_CELL_HOVER, event => showTooltip(s2, event))
|
||||
}
|
||||
// theme
|
||||
const customTheme = getCustomTheme(chart)
|
||||
s2.setThemeCfg({ theme: customTheme })
|
||||
@ -740,3 +702,16 @@ function mappingColor(value, defaultColor, field, type) {
|
||||
}
|
||||
return color
|
||||
}
|
||||
|
||||
function showTooltip(s2Instance, event) {
|
||||
const cell = s2Instance.getCell(event.target)
|
||||
const content = cell.actualText
|
||||
|
||||
s2Instance.showTooltip({
|
||||
position: {
|
||||
x: event.clientX,
|
||||
y: event.clientY
|
||||
},
|
||||
content
|
||||
})
|
||||
}
|
||||
|
||||
@ -62,7 +62,8 @@ export const TYPE_CONFIGS = [
|
||||
'tableItemHeight',
|
||||
'tableColumnMode',
|
||||
'showIndex',
|
||||
'indexLabel'
|
||||
'indexLabel',
|
||||
'tableColTooltip'
|
||||
],
|
||||
'title-selector-ant-v': [
|
||||
'show',
|
||||
@ -111,7 +112,8 @@ export const TYPE_CONFIGS = [
|
||||
'tableItemHeight',
|
||||
'tableColumnMode',
|
||||
'showIndex',
|
||||
'indexLabel'
|
||||
'indexLabel',
|
||||
'tableColTooltip'
|
||||
],
|
||||
'title-selector-ant-v': [
|
||||
'show',
|
||||
@ -157,7 +159,9 @@ export const TYPE_CONFIGS = [
|
||||
'tableItemAlign',
|
||||
'tableTitleHeight',
|
||||
'tableItemHeight',
|
||||
'tableColumnMode'
|
||||
'tableColumnMode',
|
||||
'tableRowTooltip',
|
||||
'tableColTooltip'
|
||||
],
|
||||
'total-cfg': [
|
||||
'row',
|
||||
@ -297,7 +301,7 @@ export const TYPE_CONFIGS = [
|
||||
'gaugeStartAngle',
|
||||
'gaugeEndAngle',
|
||||
'gaugeTickCount',
|
||||
'gaugeAxisLabel'
|
||||
'gaugeAxisLine'
|
||||
],
|
||||
'label-selector-ant-v': [
|
||||
'labelGauge'
|
||||
@ -2160,7 +2164,7 @@ export const TYPE_CONFIGS = [
|
||||
'gaugeMax',
|
||||
'gaugeStartAngle',
|
||||
'gaugeEndAngle',
|
||||
'gaugeAxisLabel'
|
||||
'gaugeAxisLine'
|
||||
],
|
||||
'label-selector': [
|
||||
'show',
|
||||
|
||||
@ -65,6 +65,11 @@ export default {
|
||||
MapController
|
||||
},
|
||||
props: {
|
||||
inScreen: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: true
|
||||
},
|
||||
active: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
@ -184,13 +189,19 @@ export default {
|
||||
},
|
||||
mounted() {
|
||||
bus.$on('change-series-id', this.changeSeriesId)
|
||||
document.getElementById(this.chartId).addEventListener('mouseover', this.bodyMouseover)
|
||||
document.getElementById(this.chartId).addEventListener('mouseout', this.bodyMouseout)
|
||||
const dom = document.getElementById(this.chartId)
|
||||
if (dom) {
|
||||
dom.addEventListener('mouseover', this.bodyMouseover)
|
||||
dom.addEventListener('mouseout', this.bodyMouseout)
|
||||
}
|
||||
this.preDraw()
|
||||
},
|
||||
beforeDestroy() {
|
||||
document.getElementById(this.chartId).removeEventListener('mouseover', this.bodyMouseover)
|
||||
document.getElementById(this.chartId).removeEventListener('mouseout', this.bodyMouseout)
|
||||
const dom = document.getElementById(this.chartId)
|
||||
if (dom) {
|
||||
dom.removeEventListener('mouseover', this.bodyMouseover)
|
||||
dom.removeEventListener('mouseout', this.bodyMouseout)
|
||||
}
|
||||
bus.$off('change-series-id', this.changeSeriesId)
|
||||
window.removeEventListener('resize', this.myChart.resize)
|
||||
this.myChart.dispose()
|
||||
@ -292,6 +303,7 @@ export default {
|
||||
this.myChart = this.$echarts.init(document.getElementById(this.chartId))
|
||||
}
|
||||
this.drawEcharts()
|
||||
this.myChart.off('click')
|
||||
this.myChart.on('click', function(param) {
|
||||
that.pointParam = param
|
||||
if (that.linkageActiveParam) {
|
||||
@ -408,7 +420,7 @@ export default {
|
||||
chart_option.legend['pageIconInactiveColor'] = '#8c8c8c'
|
||||
}
|
||||
}
|
||||
if (chart_option.tooltip) {
|
||||
if (chart_option.tooltip && this.inScreen) {
|
||||
chart_option.tooltip.appendToBody = true
|
||||
}
|
||||
this.myEcharts(chart_option)
|
||||
@ -493,12 +505,6 @@ export default {
|
||||
trackClick(trackAction) {
|
||||
const param = this.pointParam
|
||||
if (!param || !param.data || !param.data.dimensionList) {
|
||||
if (this.chart.type === 'map') {
|
||||
const zoom = this.myChart.getOption().geo[0].zoom
|
||||
if (zoom <= 1) {
|
||||
this.$warning(this.$t('panel.no_drill_field'))
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
const quotaList = this.pointParam.data.quotaList
|
||||
|
||||
@ -55,7 +55,7 @@ import { baseRadarOptionAntV } from '@/views/chart/chart/radar/radar_antv'
|
||||
import { baseWaterfallOptionAntV } from '@/views/chart/chart/waterfall/waterfall'
|
||||
import { baseWordCloudOptionAntV } from '@/views/chart/chart/wordCloud/word_cloud'
|
||||
import TitleRemark from '@/views/chart/view/TitleRemark'
|
||||
import { DEFAULT_TITLE_STYLE } from '@/views/chart/chart/chart'
|
||||
import { CHART_CONT_FAMILY_MAP, DEFAULT_TITLE_STYLE } from '@/views/chart/chart/chart'
|
||||
import { baseMixOptionAntV } from '@/views/chart/chart/mix/mix_antv'
|
||||
import ChartTitleUpdate from './ChartTitleUpdate.vue'
|
||||
import { equalsAny } from '@/utils/StringUtils'
|
||||
@ -429,7 +429,7 @@ export default {
|
||||
this.title_class.fontStyle = customStyle.text.isItalic ? 'italic' : 'normal'
|
||||
this.title_class.fontWeight = customStyle.text.isBolder ? 'bold' : 'normal'
|
||||
|
||||
this.title_class.fontFamily = customStyle.text.fontFamily ? customStyle.text.fontFamily : DEFAULT_TITLE_STYLE.fontFamily
|
||||
this.title_class.fontFamily = customStyle.text.fontFamily ? CHART_CONT_FAMILY_MAP[customStyle.text.fontFamily] : DEFAULT_TITLE_STYLE.fontFamily
|
||||
this.title_class.letterSpacing = (customStyle.text.letterSpace ? customStyle.text.letterSpace : DEFAULT_TITLE_STYLE.letterSpace) + 'px'
|
||||
this.title_class.textShadow = customStyle.text.fontShadow ? '2px 2px 4px' : 'none'
|
||||
}
|
||||
|
||||
@ -97,7 +97,7 @@ import ViewTrackBar from '@/components/canvas/components/editor/ViewTrackBar'
|
||||
import { getRemark, hexColorToRGBA } from '@/views/chart/chart/util'
|
||||
import { baseTableInfo, baseTableNormal, baseTablePivot } from '@/views/chart/chart/table/table-info'
|
||||
import TitleRemark from '@/views/chart/view/TitleRemark'
|
||||
import { DEFAULT_TITLE_STYLE, NOT_SUPPORT_PAGE_DATASET } from '@/views/chart/chart/chart'
|
||||
import { CHART_CONT_FAMILY_MAP, DEFAULT_TITLE_STYLE, NOT_SUPPORT_PAGE_DATASET } from '@/views/chart/chart/chart'
|
||||
import ChartTitleUpdate from './ChartTitleUpdate.vue'
|
||||
import { mapState } from 'vuex'
|
||||
import DePagination from '@/components/deCustomCm/pagination.js'
|
||||
@ -431,6 +431,7 @@ export default {
|
||||
}
|
||||
switch (trackAction) {
|
||||
case 'drill':
|
||||
this.currentPage.page = 1
|
||||
this.$emit('onChartClick', this.pointParam)
|
||||
break
|
||||
case 'linkage':
|
||||
@ -459,7 +460,7 @@ export default {
|
||||
this.$refs.title.style.fontSize = customStyle.text.fontSize + 'px'
|
||||
}
|
||||
|
||||
this.title_class.fontFamily = customStyle.text.fontFamily ? customStyle.text.fontFamily : DEFAULT_TITLE_STYLE.fontFamily
|
||||
this.title_class.fontFamily = customStyle.text.fontFamily ? CHART_CONT_FAMILY_MAP[customStyle.text.fontFamily] : DEFAULT_TITLE_STYLE.fontFamily
|
||||
this.title_class.letterSpacing = (customStyle.text.letterSpace ? customStyle.text.letterSpace : DEFAULT_TITLE_STYLE.letterSpace) + 'px'
|
||||
this.title_class.textShadow = customStyle.text.fontShadow ? '2px 2px 4px' : 'none'
|
||||
// 表格总计与分页颜色,取标题颜色
|
||||
@ -613,3 +614,8 @@ export default {
|
||||
background: transparent !important;
|
||||
}
|
||||
</style>
|
||||
<style>
|
||||
.antv-s2-tooltip-container {
|
||||
padding: 4px 2px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -50,6 +50,20 @@
|
||||
:value="option.value"
|
||||
/>
|
||||
</el-select>
|
||||
<el-tooltip
|
||||
class="item"
|
||||
effect="dark"
|
||||
placement="bottom"
|
||||
>
|
||||
<div
|
||||
slot="content"
|
||||
v-html="$t('chart.font_family_tip')"
|
||||
/>
|
||||
<i
|
||||
class="el-icon-info"
|
||||
style="cursor: pointer;color: #606266;margin-left: 4px;"
|
||||
/>
|
||||
</el-tooltip>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-show="showProperty('fontSize')"
|
||||
|
||||
@ -51,6 +51,20 @@
|
||||
:value="option.value"
|
||||
/>
|
||||
</el-select>
|
||||
<el-tooltip
|
||||
class="item"
|
||||
effect="dark"
|
||||
placement="bottom"
|
||||
>
|
||||
<div
|
||||
slot="content"
|
||||
v-html="$t('chart.font_family_tip')"
|
||||
/>
|
||||
<i
|
||||
class="el-icon-info"
|
||||
style="cursor: pointer;color: #606266;margin-left: 4px;"
|
||||
/>
|
||||
</el-tooltip>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-show="showProperty('fontSize')"
|
||||
|
||||
@ -99,7 +99,7 @@ export default {
|
||||
...style
|
||||
}
|
||||
} else if (this.canvasStyleData.panel.backgroundType === 'color') {
|
||||
const colorRGBA = hexColorToRGBA(this.canvasStyleData.panel.color, this.canvasStyleData.panel.alpha||100)
|
||||
const colorRGBA = hexColorToRGBA(this.canvasStyleData.panel.color, this.canvasStyleData.panel.alpha === undefined ? 100 : this.canvasStyleData.panel.alpha)
|
||||
style = {
|
||||
background: colorRGBA,
|
||||
...style
|
||||
|
||||
@ -134,7 +134,15 @@
|
||||
</span>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item :command="beforeDateStyle('y')">{{ $t('chart.y') }}</el-dropdown-item>
|
||||
<el-dropdown-item
|
||||
v-if="showDateExt"
|
||||
:command="beforeDateStyle('y_Q')"
|
||||
>{{ $t('chart.y_Q') }}</el-dropdown-item>
|
||||
<el-dropdown-item :command="beforeDateStyle('y_M')">{{ $t('chart.y_M') }}</el-dropdown-item>
|
||||
<el-dropdown-item
|
||||
v-if="showDateExt"
|
||||
:command="beforeDateStyle('y_W')"
|
||||
>{{ $t('chart.y_W') }}</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('y_M_d_H_m')">{{ $t('chart.y_M_d_H_m') }}</el-dropdown-item>
|
||||
@ -223,6 +231,10 @@ export default {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
chart: {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
index: {
|
||||
type: Number,
|
||||
required: true
|
||||
@ -245,6 +257,14 @@ export default {
|
||||
tagType: 'success'
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
showDateExt() {
|
||||
return this.chart.datasourceType === 'mysql' ||
|
||||
this.chart.datasourceType === 'ds_doris' ||
|
||||
this.chart.datasourceType === 'StarRocks' ||
|
||||
this.chart.datasetMode === 1
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dimensionData: function() {
|
||||
this.getItemTagType()
|
||||
|
||||
@ -122,6 +122,7 @@
|
||||
:command="beforeDateStyle('H_m_s')"
|
||||
divided
|
||||
>{{ $t('chart.H_m_s') }}</el-dropdown-item>
|
||||
<el-dropdown-item :command="beforeDateStyle('y_M_d_H')">{{ $t('chart.y_M_d_H') }}</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>
|
||||
@ -298,7 +299,7 @@ export default {
|
||||
},
|
||||
getDateExtStatus() {
|
||||
if (this.chart) {
|
||||
this.showDateExt = this.showDateExt = this.chart.datasourceType === 'mysql' ||
|
||||
this.showDateExt = this.chart.datasourceType === 'mysql' ||
|
||||
this.chart.datasourceType === 'ds_doris' ||
|
||||
this.chart.datasourceType === 'StarRocks' ||
|
||||
this.chart.datasetMode === 1
|
||||
|
||||
@ -130,6 +130,7 @@
|
||||
:command="beforeDateStyle('H_m_s')"
|
||||
divided
|
||||
>{{ $t('chart.H_m_s') }}</el-dropdown-item>
|
||||
<el-dropdown-item :command="beforeDateStyle('y_M_d_H')">{{ $t('chart.y_M_d_H') }}</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>
|
||||
|
||||
@ -275,6 +275,11 @@ export default {
|
||||
this.logic = this.item.logic
|
||||
this.filterType = this.item.filterType
|
||||
this.enumCheckField = this.item.enumCheckField
|
||||
|
||||
// init enum option
|
||||
if (this.item.filterType === 'enum' && this.needRequestEnum) {
|
||||
this.initEnumOptions()
|
||||
}
|
||||
},
|
||||
initEnumOptions() {
|
||||
// 查找枚举值
|
||||
|
||||
@ -49,7 +49,7 @@ import { getRemark, hexColorToRGBA } from '../../chart/util'
|
||||
import eventBus from '@/components/canvas/utils/eventBus'
|
||||
import { formatterItem, valueFormatter } from '@/views/chart/chart/formatter'
|
||||
import TitleRemark from '@/views/chart/view/TitleRemark'
|
||||
import { DEFAULT_SIZE, DEFAULT_TITLE_STYLE } from '@/views/chart/chart/chart'
|
||||
import { CHART_CONT_FAMILY_MAP, DEFAULT_SIZE, DEFAULT_TITLE_STYLE } from '@/views/chart/chart/chart'
|
||||
import ChartTitleUpdate from '../ChartTitleUpdate.vue'
|
||||
|
||||
export default {
|
||||
@ -209,7 +209,7 @@ export default {
|
||||
this.title_class.fontStyle = customStyle.text.isItalic ? 'italic' : 'normal'
|
||||
this.title_class.fontWeight = customStyle.text.isBolder ? 'bold' : 'normal'
|
||||
|
||||
this.title_class.fontFamily = customStyle.text.fontFamily ? customStyle.text.fontFamily : DEFAULT_TITLE_STYLE.fontFamily
|
||||
this.title_class.fontFamily = customStyle.text.fontFamily ? CHART_CONT_FAMILY_MAP[customStyle.text.fontFamily] : DEFAULT_TITLE_STYLE.fontFamily
|
||||
this.title_class.letterSpacing = (customStyle.text.letterSpace ? customStyle.text.letterSpace : DEFAULT_TITLE_STYLE.letterSpace) + 'px'
|
||||
this.title_class.textShadow = customStyle.text.fontShadow ? '2px 2px 4px' : 'none'
|
||||
}
|
||||
|
||||
@ -61,7 +61,7 @@ import { getRemark, hexColorToRGBA } from '../../chart/util'
|
||||
import eventBus from '@/components/canvas/utils/eventBus'
|
||||
import ViewTrackBar from '@/components/canvas/components/editor/ViewTrackBar'
|
||||
import TitleRemark from '@/views/chart/view/TitleRemark'
|
||||
import { DEFAULT_SIZE, DEFAULT_TITLE_STYLE } from '@/views/chart/chart/chart'
|
||||
import { CHART_CONT_FAMILY_MAP, DEFAULT_SIZE, DEFAULT_TITLE_STYLE } from '@/views/chart/chart/chart'
|
||||
import ChartTitleUpdate from '../ChartTitleUpdate.vue'
|
||||
|
||||
export default {
|
||||
@ -236,7 +236,7 @@ export default {
|
||||
this.title_class.fontStyle = customStyle.text.isItalic ? 'italic' : 'normal'
|
||||
this.title_class.fontWeight = customStyle.text.isBolder ? 'bold' : 'normal'
|
||||
|
||||
this.title_class.fontFamily = customStyle.text.fontFamily ? customStyle.text.fontFamily : DEFAULT_TITLE_STYLE.fontFamily
|
||||
this.title_class.fontFamily = customStyle.text.fontFamily ? CHART_CONT_FAMILY_MAP[customStyle.text.fontFamily] : DEFAULT_TITLE_STYLE.fontFamily
|
||||
this.title_class.letterSpacing = (customStyle.text.letterSpace ? customStyle.text.letterSpace : DEFAULT_TITLE_STYLE.letterSpace) + 'px'
|
||||
this.title_class.textShadow = customStyle.text.fontShadow ? '2px 2px 4px' : 'none'
|
||||
}
|
||||
|
||||
@ -477,13 +477,13 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-show="showProperty('gaugeAxisLabel')"
|
||||
v-show="showProperty('gaugeAxisLine')"
|
||||
:label="$t('chart.gauge_axis_label')"
|
||||
class="form-item"
|
||||
>
|
||||
<el-checkbox
|
||||
v-model="sizeForm.gaugeAxisLine"
|
||||
@change="changeBarSizeCase('gaugeAxisLabel')"
|
||||
@change="changeBarSizeCase('gaugeAxisLine')"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!--gauge-end-->
|
||||
|
||||
@ -384,6 +384,28 @@
|
||||
@blur="changeBarSizeCase('indexLabel')"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-show="showProperty('tableRowTooltip')"
|
||||
label-width="100px"
|
||||
:label="$t('chart.table_row_tooltip')"
|
||||
class="form-item"
|
||||
>
|
||||
<el-checkbox
|
||||
v-model="sizeForm.tableRowTooltip.show"
|
||||
@change="changeBarSizeCase('tableRowTooltip')"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-show="showProperty('tableColTooltip')"
|
||||
label-width="100px"
|
||||
:label="$t('chart.table_col_tooltip')"
|
||||
class="form-item"
|
||||
>
|
||||
<el-checkbox
|
||||
v-model="sizeForm.tableColTooltip.show"
|
||||
@change="changeBarSizeCase('tableColTooltip')"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<!--chart-mix-start-->
|
||||
<span v-show="showProperty('mix')">
|
||||
@ -522,243 +544,245 @@
|
||||
label-width="100px"
|
||||
size="mini"
|
||||
>
|
||||
<el-form-item
|
||||
v-show="showProperty('gaugeMin')"
|
||||
:label="$t('chart.min')"
|
||||
class="form-item"
|
||||
>
|
||||
<el-radio-group
|
||||
v-model="sizeForm.gaugeMinType"
|
||||
size="mini"
|
||||
@change="changeQuotaField('min')"
|
||||
<div v-show="!batchOptStatus">
|
||||
<el-form-item
|
||||
v-show="showProperty('gaugeMin')"
|
||||
:label="$t('chart.min')"
|
||||
class="form-item"
|
||||
>
|
||||
<el-radio-button label="fix">{{ $t('chart.fix') }}</el-radio-button>
|
||||
<el-radio-button label="dynamic">{{ $t('chart.dynamic') }}</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-if="showProperty('gaugeMin') && sizeForm.gaugeMinType === 'fix'"
|
||||
class="form-item form-item-slider"
|
||||
>
|
||||
<el-input-number
|
||||
v-model="sizeForm.gaugeMin"
|
||||
size="mini"
|
||||
@change="changeBarSizeCase('gaugeMin')"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-if="showProperty('gaugeMin') && sizeForm.gaugeMinType === 'dynamic'"
|
||||
class="form-item form-flex"
|
||||
>
|
||||
<el-select
|
||||
v-model="sizeForm.gaugeMinField.id"
|
||||
:placeholder="$t('chart.field')"
|
||||
@change="changeQuotaField('min',true)"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in quotaData"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
<el-radio-group
|
||||
v-model="sizeForm.gaugeMinType"
|
||||
size="mini"
|
||||
@change="changeQuotaField('min')"
|
||||
>
|
||||
<span style="float: left">
|
||||
<svg-icon
|
||||
v-if="item.deType === 0"
|
||||
icon-class="field_text"
|
||||
class="field-icon-text"
|
||||
/>
|
||||
<svg-icon
|
||||
v-if="item.deType === 1"
|
||||
icon-class="field_time"
|
||||
class="field-icon-time"
|
||||
/>
|
||||
<svg-icon
|
||||
v-if="item.deType === 2 || item.deType === 3"
|
||||
icon-class="field_value"
|
||||
class="field-icon-value"
|
||||
/>
|
||||
<svg-icon
|
||||
v-if="item.deType === 5"
|
||||
icon-class="field_location"
|
||||
class="field-icon-location"
|
||||
/>
|
||||
</span>
|
||||
<span style="float: left; color: #8492a6; font-size: 12px">{{ item.name }}</span>
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-select
|
||||
v-model="sizeForm.gaugeMinField.summary"
|
||||
:placeholder="$t('chart.summary')"
|
||||
@change="changeQuotaField('min')"
|
||||
<el-radio-button label="fix">{{ $t('chart.fix') }}</el-radio-button>
|
||||
<el-radio-button label="dynamic">{{ $t('chart.dynamic') }}</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-if="showProperty('gaugeMin') && sizeForm.gaugeMinType === 'fix'"
|
||||
class="form-item form-item-slider"
|
||||
>
|
||||
<el-option
|
||||
v-if="validMinField"
|
||||
key="sum"
|
||||
value="sum"
|
||||
:label="$t('chart.sum')"
|
||||
<el-input-number
|
||||
v-model="sizeForm.gaugeMin"
|
||||
size="mini"
|
||||
@change="changeBarSizeCase('gaugeMin')"
|
||||
/>
|
||||
<el-option
|
||||
v-if="validMinField"
|
||||
key="avg"
|
||||
value="avg"
|
||||
:label="$t('chart.avg')"
|
||||
/>
|
||||
<el-option
|
||||
v-if="validMinField"
|
||||
key="max"
|
||||
value="max"
|
||||
:label="$t('chart.max')"
|
||||
/>
|
||||
<el-option
|
||||
v-if="validMinField"
|
||||
key="min"
|
||||
value="min"
|
||||
:label="$t('chart.min')"
|
||||
/>
|
||||
<el-option
|
||||
v-if="validMinField"
|
||||
key="stddev_pop"
|
||||
value="stddev_pop"
|
||||
:label="$t('chart.stddev_pop')"
|
||||
/>
|
||||
<el-option
|
||||
v-if="validMinField"
|
||||
key="var_pop"
|
||||
value="var_pop"
|
||||
:label="$t('chart.var_pop')"
|
||||
/>
|
||||
<el-option
|
||||
key="count"
|
||||
value="count"
|
||||
:label="$t('chart.count')"
|
||||
/>
|
||||
<el-option
|
||||
v-if="minField.id !== 'count'"
|
||||
key="count_distinct"
|
||||
value="count_distinct"
|
||||
:label="$t('chart.count_distinct')"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-if="showProperty('gaugeMin') && sizeForm.gaugeMinType === 'dynamic'"
|
||||
class="form-item form-flex"
|
||||
>
|
||||
<el-select
|
||||
v-model="sizeForm.gaugeMinField.id"
|
||||
:placeholder="$t('chart.field')"
|
||||
@change="changeQuotaField('min',true)"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in quotaData"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
>
|
||||
<span style="float: left">
|
||||
<svg-icon
|
||||
v-if="item.deType === 0"
|
||||
icon-class="field_text"
|
||||
class="field-icon-text"
|
||||
/>
|
||||
<svg-icon
|
||||
v-if="item.deType === 1"
|
||||
icon-class="field_time"
|
||||
class="field-icon-time"
|
||||
/>
|
||||
<svg-icon
|
||||
v-if="item.deType === 2 || item.deType === 3"
|
||||
icon-class="field_value"
|
||||
class="field-icon-value"
|
||||
/>
|
||||
<svg-icon
|
||||
v-if="item.deType === 5"
|
||||
icon-class="field_location"
|
||||
class="field-icon-location"
|
||||
/>
|
||||
</span>
|
||||
<span style="float: left; color: #8492a6; font-size: 12px">{{ item.name }}</span>
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-select
|
||||
v-model="sizeForm.gaugeMinField.summary"
|
||||
:placeholder="$t('chart.summary')"
|
||||
@change="changeQuotaField('min')"
|
||||
>
|
||||
<el-option
|
||||
v-if="validMinField"
|
||||
key="sum"
|
||||
value="sum"
|
||||
:label="$t('chart.sum')"
|
||||
/>
|
||||
<el-option
|
||||
v-if="validMinField"
|
||||
key="avg"
|
||||
value="avg"
|
||||
:label="$t('chart.avg')"
|
||||
/>
|
||||
<el-option
|
||||
v-if="validMinField"
|
||||
key="max"
|
||||
value="max"
|
||||
:label="$t('chart.max')"
|
||||
/>
|
||||
<el-option
|
||||
v-if="validMinField"
|
||||
key="min"
|
||||
value="min"
|
||||
:label="$t('chart.min')"
|
||||
/>
|
||||
<el-option
|
||||
v-if="validMinField"
|
||||
key="stddev_pop"
|
||||
value="stddev_pop"
|
||||
:label="$t('chart.stddev_pop')"
|
||||
/>
|
||||
<el-option
|
||||
v-if="validMinField"
|
||||
key="var_pop"
|
||||
value="var_pop"
|
||||
:label="$t('chart.var_pop')"
|
||||
/>
|
||||
<el-option
|
||||
key="count"
|
||||
value="count"
|
||||
:label="$t('chart.count')"
|
||||
/>
|
||||
<el-option
|
||||
v-if="minField.id !== 'count'"
|
||||
key="count_distinct"
|
||||
value="count_distinct"
|
||||
:label="$t('chart.count_distinct')"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item
|
||||
v-show="showProperty('gaugeMax')"
|
||||
:label="$t('chart.max')"
|
||||
class="form-item"
|
||||
>
|
||||
<el-radio-group
|
||||
v-model="sizeForm.gaugeMaxType"
|
||||
size="mini"
|
||||
@change="changeQuotaField('max')"
|
||||
<el-form-item
|
||||
v-show="showProperty('gaugeMax')"
|
||||
:label="$t('chart.max')"
|
||||
class="form-item"
|
||||
>
|
||||
<el-radio-button label="fix">{{ $t('chart.fix') }}</el-radio-button>
|
||||
<el-radio-button label="dynamic">{{ $t('chart.dynamic') }}</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-if="showProperty('gaugeMax') && sizeForm.gaugeMaxType === 'fix'"
|
||||
class="form-item form-item-slider"
|
||||
>
|
||||
<el-input-number
|
||||
v-model="sizeForm.gaugeMax"
|
||||
size="mini"
|
||||
@change="changeBarSizeCase('gaugeMax')"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-if="showProperty('gaugeMax') && sizeForm.gaugeMaxType === 'dynamic'"
|
||||
class="form-item form-flex"
|
||||
>
|
||||
<el-select
|
||||
v-model="sizeForm.gaugeMaxField.id"
|
||||
:placeholder="$t('chart.field')"
|
||||
@change="changeQuotaField('max',true)"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in quotaData"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
<el-radio-group
|
||||
v-model="sizeForm.gaugeMaxType"
|
||||
size="mini"
|
||||
@change="changeQuotaField('max')"
|
||||
>
|
||||
<span style="float: left">
|
||||
<svg-icon
|
||||
v-if="item.deType === 0"
|
||||
icon-class="field_text"
|
||||
class="field-icon-text"
|
||||
/>
|
||||
<svg-icon
|
||||
v-if="item.deType === 1"
|
||||
icon-class="field_time"
|
||||
class="field-icon-time"
|
||||
/>
|
||||
<svg-icon
|
||||
v-if="item.deType === 2 || item.deType === 3"
|
||||
icon-class="field_value"
|
||||
class="field-icon-value"
|
||||
/>
|
||||
<svg-icon
|
||||
v-if="item.deType === 5"
|
||||
icon-class="field_location"
|
||||
class="field-icon-location"
|
||||
/>
|
||||
</span>
|
||||
<span style="float: left; color: #8492a6; font-size: 12px">{{ item.name }}</span>
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-select
|
||||
v-model="sizeForm.gaugeMaxField.summary"
|
||||
:placeholder="$t('chart.summary')"
|
||||
@change="changeQuotaField('max')"
|
||||
<el-radio-button label="fix">{{ $t('chart.fix') }}</el-radio-button>
|
||||
<el-radio-button label="dynamic">{{ $t('chart.dynamic') }}</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-if="showProperty('gaugeMax') && sizeForm.gaugeMaxType === 'fix'"
|
||||
class="form-item form-item-slider"
|
||||
>
|
||||
<el-option
|
||||
v-if="validMaxField"
|
||||
key="sum"
|
||||
value="sum"
|
||||
:label="$t('chart.sum')"
|
||||
<el-input-number
|
||||
v-model="sizeForm.gaugeMax"
|
||||
size="mini"
|
||||
@change="changeBarSizeCase('gaugeMax')"
|
||||
/>
|
||||
<el-option
|
||||
v-if="validMaxField"
|
||||
key="avg"
|
||||
value="avg"
|
||||
:label="$t('chart.avg')"
|
||||
/>
|
||||
<el-option
|
||||
v-if="validMaxField"
|
||||
key="max"
|
||||
value="max"
|
||||
:label="$t('chart.max')"
|
||||
/>
|
||||
<el-option
|
||||
v-if="validMaxField"
|
||||
key="min"
|
||||
value="min"
|
||||
:label="$t('chart.min')"
|
||||
/>
|
||||
<el-option
|
||||
v-if="validMaxField"
|
||||
key="stddev_pop"
|
||||
value="stddev_pop"
|
||||
:label="$t('chart.stddev_pop')"
|
||||
/>
|
||||
<el-option
|
||||
v-if="validMaxField"
|
||||
key="var_pop"
|
||||
value="var_pop"
|
||||
:label="$t('chart.var_pop')"
|
||||
/>
|
||||
<el-option
|
||||
key="count"
|
||||
value="count"
|
||||
:label="$t('chart.count')"
|
||||
/>
|
||||
<el-option
|
||||
v-if="maxField.id !== 'count'"
|
||||
key="count_distinct"
|
||||
value="count_distinct"
|
||||
:label="$t('chart.count_distinct')"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-if="showProperty('gaugeMax') && sizeForm.gaugeMaxType === 'dynamic'"
|
||||
class="form-item form-flex"
|
||||
>
|
||||
<el-select
|
||||
v-model="sizeForm.gaugeMaxField.id"
|
||||
:placeholder="$t('chart.field')"
|
||||
@change="changeQuotaField('max',true)"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in quotaData"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
>
|
||||
<span style="float: left">
|
||||
<svg-icon
|
||||
v-if="item.deType === 0"
|
||||
icon-class="field_text"
|
||||
class="field-icon-text"
|
||||
/>
|
||||
<svg-icon
|
||||
v-if="item.deType === 1"
|
||||
icon-class="field_time"
|
||||
class="field-icon-time"
|
||||
/>
|
||||
<svg-icon
|
||||
v-if="item.deType === 2 || item.deType === 3"
|
||||
icon-class="field_value"
|
||||
class="field-icon-value"
|
||||
/>
|
||||
<svg-icon
|
||||
v-if="item.deType === 5"
|
||||
icon-class="field_location"
|
||||
class="field-icon-location"
|
||||
/>
|
||||
</span>
|
||||
<span style="float: left; color: #8492a6; font-size: 12px">{{ item.name }}</span>
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-select
|
||||
v-model="sizeForm.gaugeMaxField.summary"
|
||||
:placeholder="$t('chart.summary')"
|
||||
@change="changeQuotaField('max')"
|
||||
>
|
||||
<el-option
|
||||
v-if="validMaxField"
|
||||
key="sum"
|
||||
value="sum"
|
||||
:label="$t('chart.sum')"
|
||||
/>
|
||||
<el-option
|
||||
v-if="validMaxField"
|
||||
key="avg"
|
||||
value="avg"
|
||||
:label="$t('chart.avg')"
|
||||
/>
|
||||
<el-option
|
||||
v-if="validMaxField"
|
||||
key="max"
|
||||
value="max"
|
||||
:label="$t('chart.max')"
|
||||
/>
|
||||
<el-option
|
||||
v-if="validMaxField"
|
||||
key="min"
|
||||
value="min"
|
||||
:label="$t('chart.min')"
|
||||
/>
|
||||
<el-option
|
||||
v-if="validMaxField"
|
||||
key="stddev_pop"
|
||||
value="stddev_pop"
|
||||
:label="$t('chart.stddev_pop')"
|
||||
/>
|
||||
<el-option
|
||||
v-if="validMaxField"
|
||||
key="var_pop"
|
||||
value="var_pop"
|
||||
:label="$t('chart.var_pop')"
|
||||
/>
|
||||
<el-option
|
||||
key="count"
|
||||
value="count"
|
||||
:label="$t('chart.count')"
|
||||
/>
|
||||
<el-option
|
||||
v-if="maxField.id !== 'count'"
|
||||
key="count_distinct"
|
||||
value="count_distinct"
|
||||
:label="$t('chart.count_distinct')"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</div>
|
||||
|
||||
<el-form-item
|
||||
v-show="showProperty('gaugeStartAngle')"
|
||||
@ -791,13 +815,13 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-show="showProperty('gaugeAxisLabel')"
|
||||
:label="$t('chart.gauge_axis_label')"
|
||||
class="form-item"
|
||||
v-show="showProperty('gaugeAxisLine')"
|
||||
:label="$t('chart.gauge_axis_label')"
|
||||
class="form-item"
|
||||
>
|
||||
<el-checkbox
|
||||
v-model="sizeForm.gaugeAxisLine"
|
||||
@change="changeBarSizeCase('gaugeAxisLabel')"
|
||||
v-model="sizeForm.gaugeAxisLine"
|
||||
@change="changeBarSizeCase('gaugeAxisLine')"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item v-show="showProperty('gaugeTickCount')" :label="$t('chart.tick_count')" class="form-item form-item-slider">-->
|
||||
@ -891,6 +915,54 @@
|
||||
@change="changeBarSizeCase('quotaFontShadow')"
|
||||
>{{ $t('chart.font_shadow') }}</el-checkbox>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-show="showProperty('hPosition')"
|
||||
:label="$t('chart.h_position')"
|
||||
class="form-item"
|
||||
>
|
||||
<el-select
|
||||
v-model="sizeForm.hPosition"
|
||||
:placeholder="$t('chart.h_position')"
|
||||
@change="changeBarSizeCase('hPosition')"
|
||||
>
|
||||
<el-option
|
||||
value="start"
|
||||
:label="$t('chart.p_left')"
|
||||
>{{ $t('chart.p_left') }}</el-option>
|
||||
<el-option
|
||||
value="center"
|
||||
:label="$t('chart.p_center')"
|
||||
>{{ $t('chart.p_center') }}</el-option>
|
||||
<el-option
|
||||
value="end"
|
||||
:label="$t('chart.p_right')"
|
||||
>{{ $t('chart.p_right') }}</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-show="showProperty('vPosition')"
|
||||
:label="$t('chart.v_position')"
|
||||
class="form-item"
|
||||
>
|
||||
<el-select
|
||||
v-model="sizeForm.vPosition"
|
||||
:placeholder="$t('chart.v_position')"
|
||||
@change="changeBarSizeCase('vPosition')"
|
||||
>
|
||||
<el-option
|
||||
value="start"
|
||||
:label="$t('chart.p_top')"
|
||||
>{{ $t('chart.p_top') }}</el-option>
|
||||
<el-option
|
||||
value="center"
|
||||
:label="$t('chart.p_center')"
|
||||
>{{ $t('chart.p_center') }}</el-option>
|
||||
<el-option
|
||||
value="end"
|
||||
:label="$t('chart.p_bottom')"
|
||||
>{{ $t('chart.p_bottom') }}</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-divider v-if="showProperty('dimensionShow')" />
|
||||
<el-form-item
|
||||
v-show="showProperty('dimensionShow')"
|
||||
@ -981,7 +1053,6 @@
|
||||
@change="changeBarSizeCase('dimensionFontShadow')"
|
||||
>{{ $t('chart.font_shadow') }}</el-checkbox>
|
||||
</el-form-item>
|
||||
<el-divider v-if="showProperty('spaceSplit')" />
|
||||
<el-form-item
|
||||
v-show="showProperty('spaceSplit')"
|
||||
:label="$t('chart.space_split')"
|
||||
@ -994,54 +1065,6 @@
|
||||
@change="changeBarSizeCase('spaceSplit')"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-show="showProperty('hPosition')"
|
||||
:label="$t('chart.h_position')"
|
||||
class="form-item"
|
||||
>
|
||||
<el-select
|
||||
v-model="sizeForm.hPosition"
|
||||
:placeholder="$t('chart.h_position')"
|
||||
@change="changeBarSizeCase('hPosition')"
|
||||
>
|
||||
<el-option
|
||||
value="start"
|
||||
:label="$t('chart.p_left')"
|
||||
>{{ $t('chart.p_left') }}</el-option>
|
||||
<el-option
|
||||
value="center"
|
||||
:label="$t('chart.p_center')"
|
||||
>{{ $t('chart.p_center') }}</el-option>
|
||||
<el-option
|
||||
value="end"
|
||||
:label="$t('chart.p_right')"
|
||||
>{{ $t('chart.p_right') }}</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-show="showProperty('vPosition')"
|
||||
:label="$t('chart.v_position')"
|
||||
class="form-item"
|
||||
>
|
||||
<el-select
|
||||
v-model="sizeForm.vPosition"
|
||||
:placeholder="$t('chart.v_position')"
|
||||
@change="changeBarSizeCase('vPosition')"
|
||||
>
|
||||
<el-option
|
||||
value="start"
|
||||
:label="$t('chart.p_top')"
|
||||
>{{ $t('chart.p_top') }}</el-option>
|
||||
<el-option
|
||||
value="center"
|
||||
:label="$t('chart.p_center')"
|
||||
>{{ $t('chart.p_center') }}</el-option>
|
||||
<el-option
|
||||
value="end"
|
||||
:label="$t('chart.p_bottom')"
|
||||
>{{ $t('chart.p_bottom') }}</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<!--text&label-end-->
|
||||
<!--scatter-begin-->
|
||||
@ -1369,7 +1392,7 @@
|
||||
<el-form-item
|
||||
v-show="showProperty('wordSizeRange') "
|
||||
:label="$t('chart.word_size_range')"
|
||||
class="form-item form-item-slider"
|
||||
class="form-item form-item-slider form-item-range-slider"
|
||||
>
|
||||
<el-slider
|
||||
v-model="sizeForm.wordSizeRange"
|
||||
@ -1386,6 +1409,9 @@
|
||||
>
|
||||
<el-slider
|
||||
v-model="sizeForm.wordSpacing"
|
||||
show-input
|
||||
:show-input-controls="false"
|
||||
input-size="mini"
|
||||
:min="0"
|
||||
:max="20"
|
||||
@change="changeBarSizeCase('wordSpacing')"
|
||||
@ -1402,6 +1428,7 @@
|
||||
<script>
|
||||
import { CHART_FONT_FAMILY, CHART_FONT_LETTER_SPACE, DEFAULT_SIZE } from '../../chart/chart'
|
||||
import { equalsAny } from '@/utils/StringUtils'
|
||||
import { mapState } from 'vuex'
|
||||
|
||||
export default {
|
||||
name: 'SizeSelectorAntV',
|
||||
@ -1490,7 +1517,8 @@ export default {
|
||||
return customAttr.color.mapLineGradient && equalsAny(this.sizeForm.mapLineType, 'line', 'arc')
|
||||
}
|
||||
return false
|
||||
}
|
||||
},
|
||||
...mapState(['batchOptStatus'])
|
||||
},
|
||||
watch: {
|
||||
'chart': {
|
||||
@ -1558,6 +1586,8 @@ export default {
|
||||
|
||||
this.sizeForm.tableHeaderAlign = this.sizeForm.tableHeaderAlign ? this.sizeForm.tableHeaderAlign : DEFAULT_SIZE.tableHeaderAlign
|
||||
this.sizeForm.tableItemAlign = this.sizeForm.tableItemAlign ? this.sizeForm.tableItemAlign : DEFAULT_SIZE.tableItemAlign
|
||||
this.sizeForm.tableRowTooltip = this.sizeForm.tableRowTooltip ?? DEFAULT_SIZE.tableRowTooltip
|
||||
this.sizeForm.tableColTooltip = this.sizeForm.tableColTooltip ?? DEFAULT_SIZE.tableColTooltip
|
||||
|
||||
this.sizeForm.showIndex = this.sizeForm.showIndex ? this.sizeForm.showIndex : DEFAULT_SIZE.showIndex
|
||||
if (this.sizeForm.indexLabel === null || this.sizeForm.indexLabel === undefined) {
|
||||
@ -1750,6 +1780,10 @@ export default {
|
||||
line-height: 38px;
|
||||
}
|
||||
|
||||
.form-item-range-slider ::v-deep .el-form-item__content {
|
||||
padding-right: 6px
|
||||
}
|
||||
|
||||
.form-item ::v-deep .el-form-item__label {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
@ -863,6 +863,7 @@
|
||||
:param="param"
|
||||
:index="index"
|
||||
:item="item"
|
||||
:chart="chart"
|
||||
:dimension-data="dimension"
|
||||
:quota-data="quota"
|
||||
@onItemChange="stackItemChange"
|
||||
@ -923,6 +924,7 @@
|
||||
:param="param"
|
||||
:index="index"
|
||||
:item="item"
|
||||
:chart="chart"
|
||||
:dimension-data="dimension"
|
||||
:quota-data="quota"
|
||||
@onItemChange="bubbleItemChange"
|
||||
@ -1322,6 +1324,7 @@
|
||||
ref="itemForm"
|
||||
label-width="80px"
|
||||
:model="itemForm"
|
||||
@submit.native.prevent
|
||||
:rules="itemFormRules"
|
||||
>
|
||||
<el-form-item
|
||||
@ -1339,7 +1342,6 @@
|
||||
style="width: 200px"
|
||||
size="mini"
|
||||
clearable
|
||||
@keypress.stop
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
@ -235,6 +235,7 @@
|
||||
</deBtn>
|
||||
<deBtn
|
||||
type="primary"
|
||||
v-loading="exportDatasetLoading"
|
||||
@click="exportDatasetRequest"
|
||||
>{{ $t('dataset.confirm') }}
|
||||
</deBtn>
|
||||
@ -282,6 +283,7 @@ export default {
|
||||
name: ''
|
||||
},
|
||||
fields: [],
|
||||
exportDatasetLoading: false,
|
||||
filedList: [],
|
||||
data: [],
|
||||
syncStatus: '',
|
||||
@ -490,6 +492,7 @@ export default {
|
||||
return
|
||||
}
|
||||
this.table.expressionTree = JSON.stringify({ items, logic })
|
||||
this.exportDatasetLoading = true
|
||||
exportDataset(this.table).then((res) => {
|
||||
const blob = new Blob([res], { type: 'application/vnd.ms-excel' })
|
||||
const link = document.createElement('a')
|
||||
@ -499,6 +502,8 @@ export default {
|
||||
document.body.appendChild(link)
|
||||
link.click()
|
||||
document.body.removeChild(link)
|
||||
}).finally(() => {
|
||||
this.exportDatasetLoading = false
|
||||
})
|
||||
}
|
||||
} else {
|
||||
|
||||
@ -82,7 +82,7 @@ export default {
|
||||
background: `url(${imgUrlTrans(styleInfo.imageUrl)}) no-repeat`
|
||||
}
|
||||
} else if (styleInfo.backgroundType === 'color') {
|
||||
const colorRGBA = hexColorToRGBA(styleInfo.color, styleInfo.alpha||100)
|
||||
const colorRGBA = hexColorToRGBA(styleInfo.color, styleInfo.alpha === undefined ? 100 : styleInfo.alpha)
|
||||
style = {
|
||||
background: colorRGBA
|
||||
}
|
||||
|
||||
@ -368,6 +368,7 @@
|
||||
<Preview
|
||||
v-if="previewVisible"
|
||||
:in-screen="!previewVisible"
|
||||
:class="previewVisible && 'fullscreen-visual-selects'"
|
||||
:panel-info="panelInfo"
|
||||
:show-type="canvasStyleData.selfAdaption?'full':'width'"
|
||||
:canvas-style-data="canvasStyleData"
|
||||
@ -723,7 +724,7 @@ export default {
|
||||
background: `url(${imgUrlTrans(styleInfo.imageUrl)}) no-repeat`
|
||||
}
|
||||
} else if (styleInfo.backgroundType === 'color') {
|
||||
const colorRGBA = hexColorToRGBA(styleInfo.color, styleInfo.alpha||100)
|
||||
const colorRGBA = hexColorToRGBA(styleInfo.color, styleInfo.alpha === undefined ? 100 : styleInfo.alpha)
|
||||
style = {
|
||||
background: colorRGBA
|
||||
}
|
||||
@ -747,7 +748,7 @@ export default {
|
||||
...style
|
||||
}
|
||||
} else if (this.canvasStyleData.panel.backgroundType === 'color') {
|
||||
const colorRGBA = hexColorToRGBA(this.canvasStyleData.panel.color, this.canvasStyleData.panel.alpha||100)
|
||||
const colorRGBA = hexColorToRGBA(this.canvasStyleData.panel.color, this.canvasStyleData.panel.alpha === undefined ? 100 : this.canvasStyleData.panel.alpha)
|
||||
style = {
|
||||
background: colorRGBA,
|
||||
...style
|
||||
|
||||
@ -798,7 +798,7 @@ export default {
|
||||
async loadField(tableId, init) {
|
||||
const res = await fieldListWithPermission(tableId)
|
||||
let data = res.data || []
|
||||
if (init && !this.checkSuperior(data, this.anotherTableInfo(tableId))) {
|
||||
if (init && (!data.length || !this.checkSuperior(data, this.anotherTableInfo(tableId)))) {
|
||||
this.backToLink()
|
||||
}
|
||||
if (this.widget && this.widget.filterFieldMethod) {
|
||||
|
||||
@ -932,6 +932,15 @@ export default {
|
||||
top: inherit !important;
|
||||
left: inherit !important;
|
||||
}
|
||||
.el-tree-select-popper {
|
||||
left: 0 !important;
|
||||
top: inherit !important;
|
||||
}
|
||||
|
||||
.track-menu,
|
||||
.coustom-date-picker {
|
||||
left: inherit !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
@ -207,6 +207,24 @@
|
||||
>{{ $t("commons.no") }}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item
|
||||
:label="
|
||||
$t('commons.yes') + $t('commons.no') + $t('display.auto_identify_mobile_devices')
|
||||
"
|
||||
prop="autoMobile"
|
||||
>
|
||||
<el-radio-group v-model="formInline.autoMobile">
|
||||
<el-radio
|
||||
label="true"
|
||||
size="mini"
|
||||
>{{ $t("commons.yes") }}</el-radio>
|
||||
<el-radio
|
||||
label="false"
|
||||
size="mini"
|
||||
>{{ $t("commons.no") }}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
@ -348,6 +366,7 @@ export default {
|
||||
this.originLoginType = this.formInline.loginType
|
||||
}
|
||||
this.formInline.open = (this.formInline.open && this.formInline.open === 'true')
|
||||
this.formInline.lockedEmail = this.formInline?.lockedEmail === 'true'
|
||||
this.formInline.scanCreateUser = (this.formInline.scanCreateUser && this.formInline.scanCreateUser === 'true')
|
||||
|
||||
this.$nextTick(() => {
|
||||
@ -412,6 +431,12 @@ export default {
|
||||
type: 'text',
|
||||
sort: 14
|
||||
},
|
||||
{
|
||||
paramKey: 'ui.autoMobile',
|
||||
paramValue: this.formInline.autoMobile,
|
||||
type: 'text',
|
||||
sort: 15
|
||||
},
|
||||
|
||||
{
|
||||
paramKey: 'loginlimit.limitTimes',
|
||||
@ -431,6 +456,12 @@ export default {
|
||||
type: 'text',
|
||||
sort: 3
|
||||
},
|
||||
{
|
||||
paramKey: 'loginlimit.lockedEmail',
|
||||
paramValue: this.formInline.lockedEmail,
|
||||
type: 'text',
|
||||
sort: 4
|
||||
},
|
||||
{
|
||||
paramKey: 'loginlimit.scanCreateUser',
|
||||
paramValue: this.formInline.scanCreateUser,
|
||||
|
||||
@ -100,7 +100,7 @@ export default {
|
||||
label: 'name',
|
||||
value: 'id'
|
||||
},
|
||||
expandedKeys: []
|
||||
expandedKeys: ['000000000']
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
|
||||
@ -2,12 +2,20 @@
|
||||
<de-container
|
||||
v-loading="$store.getters.loadingMap[$store.getters.currentPath]"
|
||||
class="de-earth"
|
||||
style="height: calc(100vh - 150px);"
|
||||
style="height: calc(100vh - 200px);"
|
||||
>
|
||||
|
||||
<div class="de-map-tips">
|
||||
<el-alert
|
||||
:title="$t('map_setting.prohibit_prompts')"
|
||||
type="warning"
|
||||
description=""
|
||||
:closable="false"
|
||||
show-icon
|
||||
/>
|
||||
</div>
|
||||
<de-aside-container
|
||||
type="mapset"
|
||||
style="height: 100%;"
|
||||
class="map-setting-aside"
|
||||
>
|
||||
<map-setting-left
|
||||
ref="map_setting_tree"
|
||||
@ -18,7 +26,9 @@
|
||||
/>
|
||||
</de-aside-container>
|
||||
|
||||
<de-main-container style="height: 100%;">
|
||||
<de-main-container
|
||||
class="map-setting-main"
|
||||
>
|
||||
<map-setting-right
|
||||
ref="map_setting_form"
|
||||
:tree-data="treeData"
|
||||
@ -83,5 +93,17 @@ export default {
|
||||
padding: 24px;
|
||||
width: 100%;
|
||||
overflow: auto;
|
||||
.de-map-tips {
|
||||
position: absolute;
|
||||
width: calc(100% - 135px);
|
||||
}
|
||||
.map-setting-aside {
|
||||
top: 50px;
|
||||
height: calc(100% - 40px) !important;
|
||||
}
|
||||
.map-setting-main {
|
||||
margin-top: 50px;
|
||||
height: calc(100% - 50px);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -50,16 +50,14 @@
|
||||
class="tabs-container"
|
||||
:class="[activeName !== 'eight' ? 'is-center' : 'pad-center']"
|
||||
>
|
||||
<div class="min-w600">
|
||||
<div :class="activeName === 'ten' ? 'max-w600' : 'min-w600'">
|
||||
<basic-setting
|
||||
v-if="activeName === 'zero'"
|
||||
:is-plugin-loaded="isPluginLoaded"
|
||||
/>
|
||||
<email-setting v-if="activeName === 'first'" />
|
||||
<map-setting
|
||||
v-if="activeName === 'ten'"
|
||||
ref="mapSetting"
|
||||
/>
|
||||
<map-setting v-if="activeName === 'ten'" />
|
||||
|
||||
<simple-mode v-if="activeName === 'six'" />
|
||||
<cluster-mode v-if="activeName === 'seven'" />
|
||||
<kettle-setting v-if="activeName === 'eight'" />
|
||||
@ -123,6 +121,14 @@ export default {
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
}
|
||||
.max-w600 {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
& > :nth-child(1) {
|
||||
box-sizing: border-box;
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.is-center {
|
||||
|
||||
@ -432,7 +432,7 @@ export default {
|
||||
}
|
||||
},
|
||||
validateUsername(rule, value, callback) {
|
||||
const pattern = '^[a-zA-Z][a-zA-Z0-9\._-]*$'
|
||||
const pattern = '^[a-zA-Z0-9][a-zA-Z0-9\._-]*$'
|
||||
const regep = new RegExp(pattern)
|
||||
if (!regep.test(value) && this.formType === 'add') {
|
||||
const msg = this.$t('user.user_name_pattern_error')
|
||||
|
||||
@ -4,7 +4,7 @@ import Stomp from 'stompjs'
|
||||
import store from '@/store'
|
||||
class DeWebsocket {
|
||||
constructor() {
|
||||
this.ws_url = '/websocket'
|
||||
this.ws_url = `${process.env.VUE_APP_BASE_API}websocket`
|
||||
this.client = null
|
||||
this.channels = [
|
||||
{
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -348,10 +348,6 @@
|
||||
this.pointParam.viewId = this.chart.id
|
||||
const param = this.pointParam
|
||||
if (!param || !param.data || !param.data.dimensionList) {
|
||||
const zoom = this.myChart.getOption().geo[0].zoom
|
||||
if (zoom <= 1) {
|
||||
this.$warning(this.$t('panel.no_drill_field'))
|
||||
}
|
||||
return
|
||||
}
|
||||
const linkageParam = {
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
#!/bin/sh
|
||||
mvn clean package
|
||||
|
||||
cp view-chartmix-backend/target/view-chartmix-backend-1.18.9.jar .
|
||||
cp view-chartmix-backend/target/view-chartmix-backend-1.18.10.jar .
|
||||
|
||||
zip -r chartmix.zip ./view-chartmix-backend-1.18.9.jar ./plugin.json
|
||||
zip -r chartmix.zip ./view-chartmix-backend-1.18.10.jar ./plugin.json
|
||||
|
||||
rm -f ./view-chartmix-backend-1.18.9.jar
|
||||
rm -f ./view-chartmix-backend-1.18.10.jar
|
||||
|
||||
@ -5,9 +5,9 @@
|
||||
"cost": 0,
|
||||
"category": "view",
|
||||
"descript": "AntV G2Plot 组合图插件",
|
||||
"version": "1.18.9",
|
||||
"version": "1.18.10",
|
||||
"creator": "DATAEASE",
|
||||
"moduleName": "view-chartmix-backend",
|
||||
"require": "1.18.9",
|
||||
"require": "1.18.10",
|
||||
"dsType": ""
|
||||
}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package io.dataease.plugins.view.official.handler;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import io.dataease.plugins.common.constants.datasource.SQLConstants;
|
||||
import io.dataease.plugins.common.request.permission.DataSetRowPermissionsTreeDTO;
|
||||
import io.dataease.plugins.common.util.ConstantsUtil;
|
||||
@ -19,7 +20,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class DefaultViewStatHandler implements PluginViewStatHandler {
|
||||
public class ChartMixViewStatHandler implements PluginViewStatHandler {
|
||||
|
||||
@Override
|
||||
public String build(PluginViewParam pluginViewParam, ViewPluginService viewPluginService) {
|
||||
@ -43,6 +44,7 @@ public class DefaultViewStatHandler implements PluginViewStatHandler {
|
||||
|
||||
List<PluginViewSQL> xFields = fieldSQLMap.getOrDefault("xAxis", new ArrayList<>()).stream().filter(singleField -> ObjectUtils.isNotEmpty(singleField.getField())).map(PluginSingleField::getField).collect(Collectors.toList());
|
||||
List<PluginViewSQL> xOrders = fieldSQLMap.getOrDefault("xAxis", new ArrayList<>()).stream().filter(singleField -> ObjectUtils.isNotEmpty(singleField.getSort())).map(PluginSingleField::getSort).collect(Collectors.toList());
|
||||
|
||||
// List<String> xWheres = fieldSQLMap.get("xAxis").stream().map(singleField -> singleField.getWhere()).collect(Collectors.toList());
|
||||
|
||||
List<PluginViewSQL> yFields = fieldSQLMap.getOrDefault("yAxis", new ArrayList<>()).stream().filter(singleField -> ObjectUtils.isNotEmpty(singleField.getField())).map(PluginSingleField::getField).collect(Collectors.toList());
|
||||
@ -75,6 +77,8 @@ public class DefaultViewStatHandler implements PluginViewStatHandler {
|
||||
List<PluginViewSQL> orders = new ArrayList<>();
|
||||
orders.addAll(xOrders);
|
||||
orders.addAll(yOrders);
|
||||
|
||||
|
||||
List<String> aggWheres = new ArrayList<>();
|
||||
aggWheres.addAll(yWheres.stream().filter(ObjectUtils::isNotEmpty).collect(Collectors.toList()));
|
||||
|
||||
@ -3,7 +3,7 @@ package io.dataease.plugins.view.official.impl;
|
||||
import com.google.gson.Gson;
|
||||
import io.dataease.plugins.common.dto.StaticResource;
|
||||
import io.dataease.plugins.view.entity.*;
|
||||
import io.dataease.plugins.view.official.handler.DefaultViewStatHandler;
|
||||
import io.dataease.plugins.view.official.handler.ChartMixViewStatHandler;
|
||||
import io.dataease.plugins.view.service.ViewPluginService;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
@ -110,11 +110,10 @@ public class ChartMixService extends ViewPluginService {
|
||||
if (CollectionUtils.isNotEmpty(yAxisExt)) {
|
||||
yAxis.addAll(yAxisExt);
|
||||
}*/
|
||||
System.out.println(new Gson().toJson(yAxis));
|
||||
if (CollectionUtils.isEmpty(xAxis) || CollectionUtils.isEmpty(yAxis)) {
|
||||
return null;
|
||||
}
|
||||
String sql = new DefaultViewStatHandler().build(param, this);
|
||||
String sql = new ChartMixViewStatHandler().build(param, this);
|
||||
System.out.println(sql);
|
||||
return sql;
|
||||
|
||||
|
||||
@ -16,6 +16,34 @@
|
||||
<el-color-picker v-model="labelForm.color" class="color-picker-style" :predefine="predefineColors"
|
||||
@change="changeLabelAttr"/>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
class="form-item"
|
||||
>
|
||||
<template #label>
|
||||
{{ $t('chart.label_position') }}
|
||||
<el-tooltip
|
||||
effect="dark"
|
||||
content="仅对柱状图生效"
|
||||
>
|
||||
<i
|
||||
class="el-icon-info"
|
||||
style="cursor: pointer;"
|
||||
/>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
<el-select
|
||||
v-model="labelForm.position"
|
||||
:placeholder="$t('chart.label_position')"
|
||||
@change="changeLabelAttr"
|
||||
>
|
||||
<el-option
|
||||
v-for="option in labelPositionV"
|
||||
:key="option.value"
|
||||
:label="option.name"
|
||||
:value="option.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item :label="$t('chart.label')" class="form-item">
|
||||
<el-select v-model="values" :placeholder="$t('commons.please_select')" multiple collapse-tags
|
||||
@change="changeFields">
|
||||
@ -125,7 +153,12 @@ export default {
|
||||
],
|
||||
predefineColors: COLOR_PANEL,
|
||||
values: null,
|
||||
busiType: 'labelAxis'
|
||||
busiType: 'labelAxis',
|
||||
labelPositionV: [
|
||||
{name: this.$t('chart.text_pos_top'), value: 'top'},
|
||||
{name: this.$t('chart.center'), value: 'middle'},
|
||||
{name: this.$t('chart.text_pos_bottom'), value: 'bottom'}
|
||||
],
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
|
||||
@ -122,6 +122,9 @@ export default {
|
||||
.form-item>>>.el-form-item__label{
|
||||
font-size: 12px;
|
||||
}
|
||||
.form-item ::v-deep .el-form-item__label {
|
||||
font-size: 12px;
|
||||
}
|
||||
.el-select-dropdown__item{
|
||||
padding: 0 20px;
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user