Merge branch 'v1.18' of github.com:dataease/dataease into v1.18
This commit is contained in:
commit
9bc3d05fde
@ -79,7 +79,7 @@ DataEase 是开源的数据可视化分析工具,帮助用户快速分析数
|
||||
2. 以 root 用户执行如下命令一键安装 DataEase。
|
||||
|
||||
```sh
|
||||
curl -sSL https://github.com/dataease/dataease/releases/latest/download/quick_start.sh | sh
|
||||
curl -sSL https://dataease.oss-cn-hangzhou.aliyuncs.com/quick_start.sh | sh
|
||||
```
|
||||
|
||||
**学习资料**
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>dataease-server</artifactId>
|
||||
<groupId>io.dataease</groupId>
|
||||
<version>1.18.2</version>
|
||||
<version>1.18.3</version>
|
||||
</parent>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
@ -204,7 +204,7 @@
|
||||
<dependency>
|
||||
<groupId>io.dataease</groupId>
|
||||
<artifactId>dataease-plugin-interface</artifactId>
|
||||
<version>1.18.2</version>
|
||||
<version>1.18.3</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<artifactId>guava</artifactId>
|
||||
@ -215,12 +215,12 @@
|
||||
<dependency>
|
||||
<groupId>io.dataease</groupId>
|
||||
<artifactId>dataease-plugin-view</artifactId>
|
||||
<version>1.18.2</version>
|
||||
<version>1.18.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.dataease</groupId>
|
||||
<artifactId>dataease-plugin-datasource</artifactId>
|
||||
<version>1.18.2</version>
|
||||
<version>1.18.3</version>
|
||||
</dependency>
|
||||
<!-- kettle及数据源依赖 -->
|
||||
<dependency>
|
||||
|
||||
@ -6,14 +6,13 @@ import io.dataease.auth.api.dto.LoginDto;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Api(tags = "权限:权限管理")
|
||||
@Api(tags = "登录:登录管理")
|
||||
@ApiSupport(order = 10)
|
||||
@RequestMapping("/api/auth")
|
||||
public interface AuthApi {
|
||||
|
||||
@ -8,15 +8,17 @@ import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Api(tags = "权限:动态菜单")
|
||||
@Api(tags = "登录:动态菜单")
|
||||
@ApiSupport(order = 20)
|
||||
@RequestMapping("/api/dynamicMenu")
|
||||
public interface DynamicMenuApi {
|
||||
|
||||
/**
|
||||
* 根据heads中获取的token 获取username 获取对应权限的菜单
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("查询")
|
||||
|
||||
@ -84,7 +84,7 @@ public class F2CRealm extends AuthorizingRealm {
|
||||
token = (String) auth.getCredentials();
|
||||
// 解密获得username,用于和数据库进行对比
|
||||
tokenInfo = JWTUtils.tokenInfoByToken(token);
|
||||
if (!TokenCacheUtils.validate(token)) {
|
||||
if (TokenCacheUtils.invalid(token)) {
|
||||
throw new AuthenticationException("token invalid");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
||||
@ -79,12 +79,7 @@ public class F2CDocFilter extends AccessControlFilter {
|
||||
if (StringUtils.isBlank(authorization)) {
|
||||
return false;
|
||||
}
|
||||
if (JWTUtils.loginExpire(authorization)) {
|
||||
return false;
|
||||
}
|
||||
if (JWTUtils.needRefresh(authorization)) {
|
||||
authorization = refreshToken(authorization);
|
||||
}
|
||||
|
||||
TokenInfo tokenInfo = JWTUtils.tokenInfoByToken(authorization);
|
||||
AuthUserService authUserService = CommonBeanFactory.getBean(AuthUserService.class);
|
||||
SysUserEntity user = authUserService.getUserById(tokenInfo.getUserId());
|
||||
@ -96,20 +91,6 @@ public class F2CDocFilter extends AccessControlFilter {
|
||||
return verify;
|
||||
}
|
||||
|
||||
private String refreshToken(String token) throws Exception {
|
||||
TokenInfo tokenInfo = JWTUtils.tokenInfoByToken(token);
|
||||
AuthUserService authUserService = CommonBeanFactory.getBean(AuthUserService.class);
|
||||
SysUserEntity user = authUserService.getUserById(tokenInfo.getUserId());
|
||||
if (user == null) {
|
||||
DataEaseException.throwException(Translator.get("i18n_not_find_user"));
|
||||
}
|
||||
String password = user.getPassword();
|
||||
Algorithm algorithm = Algorithm.HMAC256(password);
|
||||
JWTUtils.verifySign(algorithm, token);
|
||||
String newToken = JWTUtils.sign(tokenInfo, password);
|
||||
return newToken;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean onAccessDenied(ServletRequest req, ServletResponse res) throws Exception {
|
||||
HttpServletResponse response = (HttpServletResponse) res;
|
||||
|
||||
@ -1,24 +1,18 @@
|
||||
package io.dataease.auth.filter;
|
||||
|
||||
import com.auth0.jwt.algorithms.Algorithm;
|
||||
import io.dataease.auth.entity.ASKToken;
|
||||
import io.dataease.auth.entity.JWTToken;
|
||||
import io.dataease.auth.entity.SysUserEntity;
|
||||
import io.dataease.auth.entity.TokenInfo;
|
||||
|
||||
import io.dataease.auth.handler.ApiKeyHandler;
|
||||
import io.dataease.auth.service.AuthUserService;
|
||||
import io.dataease.auth.util.JWTUtils;
|
||||
import io.dataease.commons.utils.CommonBeanFactory;
|
||||
|
||||
import io.dataease.commons.utils.LogUtil;
|
||||
import io.dataease.commons.utils.TokenCacheUtils;
|
||||
import io.dataease.exception.DataEaseException;
|
||||
import io.dataease.i18n.Translator;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.shiro.authc.AuthenticationException;
|
||||
import org.apache.shiro.subject.Subject;
|
||||
import org.apache.shiro.web.filter.authc.BasicHttpAuthenticationFilter;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
|
||||
@ -30,7 +24,6 @@ import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
public class JWTFilter extends BasicHttpAuthenticationFilter {
|
||||
|
||||
private Logger LOGGER = LoggerFactory.getLogger(this.getClass());
|
||||
|
||||
public final static String expireMessage = "Login token is expire.";
|
||||
|
||||
@ -66,18 +59,10 @@ public class JWTFilter extends BasicHttpAuthenticationFilter {
|
||||
if (StringUtils.startsWith(authorization, "Basic")) {
|
||||
return false;
|
||||
}
|
||||
if (!TokenCacheUtils.validate(authorization)) {
|
||||
if (TokenCacheUtils.invalid(authorization)) {
|
||||
throw new AuthenticationException(expireMessage);
|
||||
}
|
||||
// 当没有出现登录超时 且需要刷新token 则执行刷新token
|
||||
if (JWTUtils.loginExpire(authorization)) {
|
||||
TokenCacheUtils.remove(authorization);
|
||||
throw new AuthenticationException(expireMessage);
|
||||
}
|
||||
if (JWTUtils.needRefresh(authorization)) {
|
||||
TokenCacheUtils.remove(authorization);
|
||||
authorization = refreshToken(request, response);
|
||||
}
|
||||
|
||||
JWTToken token = new JWTToken(authorization);
|
||||
Subject subject = getSubject(request, response);
|
||||
// 提交给realm进行登入,如果错误他会抛出异常并被捕获
|
||||
@ -111,28 +96,6 @@ public class JWTFilter extends BasicHttpAuthenticationFilter {
|
||||
}
|
||||
|
||||
|
||||
private String refreshToken(ServletRequest request, ServletResponse response) throws Exception {
|
||||
// 获取AccessToken(Shiro中getAuthzHeader方法已经实现)
|
||||
String token = this.getAuthzHeader(request);
|
||||
// 获取当前Token的帐号信息
|
||||
TokenInfo tokenInfo = JWTUtils.tokenInfoByToken(token);
|
||||
AuthUserService authUserService = CommonBeanFactory.getBean(AuthUserService.class);
|
||||
SysUserEntity user = authUserService.getUserById(tokenInfo.getUserId());
|
||||
if (user == null) {
|
||||
DataEaseException.throwException(Translator.get("i18n_not_find_user"));
|
||||
}
|
||||
String password = user.getPassword();
|
||||
Algorithm algorithm = Algorithm.HMAC256(password);
|
||||
JWTUtils.verifySign(algorithm, token);
|
||||
String newToken = JWTUtils.sign(tokenInfo, password);
|
||||
// 设置响应的Header头新Token
|
||||
HttpServletResponse httpServletResponse = (HttpServletResponse) response;
|
||||
httpServletResponse.addHeader("Access-Control-Expose-Headers", "RefreshAuthorization");
|
||||
httpServletResponse.setHeader("RefreshAuthorization", newToken);
|
||||
return newToken;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 对跨域提供支持
|
||||
*/
|
||||
|
||||
@ -63,6 +63,7 @@ public class AuthServer implements AuthApi {
|
||||
|
||||
@Override
|
||||
public Object login(@RequestBody LoginDto loginDto) throws Exception {
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
String username = RsaUtil.decryptByPrivateKey(RsaProperties.privateKey, loginDto.getUsername());
|
||||
String pwd = RsaUtil.decryptByPrivateKey(RsaProperties.privateKey, loginDto.getPassword());
|
||||
|
||||
@ -147,9 +148,11 @@ public class AuthServer implements AuthApi {
|
||||
AccountLockStatus lockStatus = authUserService.recordLoginFail(username, 0);
|
||||
DataEaseException.throwException(appendLoginErrorMsg(Translator.get("i18n_id_or_pwd_error"), lockStatus));
|
||||
}
|
||||
if (user.getIsAdmin() && user.getPassword().equals("40b8893ea9ebc2d631c4bb42bb1e8996")) {
|
||||
result.put("passwordModified", false);
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
TokenInfo tokenInfo = TokenInfo.builder().userId(user.getUserId()).username(username).build();
|
||||
String token = JWTUtils.sign(tokenInfo, realPwd);
|
||||
// 记录token操作时间
|
||||
@ -234,7 +237,7 @@ public class AuthServer implements AuthApi {
|
||||
if (StringUtils.isBlank(result)) {
|
||||
result = "success";
|
||||
}
|
||||
TokenCacheUtils.remove(token);
|
||||
TokenCacheUtils.add(token, userId);
|
||||
} catch (Exception e) {
|
||||
LogUtil.error(e);
|
||||
if (StringUtils.isBlank(result)) {
|
||||
@ -288,7 +291,7 @@ public class AuthServer implements AuthApi {
|
||||
if (StringUtils.isBlank(result)) {
|
||||
result = "success";
|
||||
}
|
||||
TokenCacheUtils.remove(token);
|
||||
TokenCacheUtils.add(token, userId);
|
||||
} catch (Exception e) {
|
||||
LogUtil.error(e);
|
||||
if (StringUtils.isBlank(result)) {
|
||||
|
||||
@ -4,13 +4,11 @@ import com.auth0.jwt.JWT;
|
||||
import com.auth0.jwt.JWTVerifier;
|
||||
import com.auth0.jwt.JWTCreator.Builder;
|
||||
import com.auth0.jwt.algorithms.Algorithm;
|
||||
import com.auth0.jwt.exceptions.JWTDecodeException;
|
||||
import com.auth0.jwt.interfaces.DecodedJWT;
|
||||
import com.auth0.jwt.interfaces.Verification;
|
||||
import io.dataease.auth.entity.TokenInfo;
|
||||
import io.dataease.auth.entity.TokenInfo.TokenInfoBuilder;
|
||||
import io.dataease.commons.utils.CommonBeanFactory;
|
||||
import io.dataease.commons.utils.TokenCacheUtils;
|
||||
import io.dataease.exception.DataEaseException;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
@ -20,10 +18,8 @@ import java.util.Date;
|
||||
|
||||
public class JWTUtils {
|
||||
|
||||
// token过期时间1min (过期会自动刷新续命 目的是避免一直都是同一个token )
|
||||
private static final long EXPIRE_TIME = 1 * 60 * 1000;
|
||||
// 登录间隔时间10min 超过这个时间强制重新登录
|
||||
private static long Login_Interval;
|
||||
|
||||
private static Long expireTime;
|
||||
|
||||
/**
|
||||
* 校验token是否正确
|
||||
@ -66,62 +62,24 @@ public class JWTUtils {
|
||||
return tokenInfoBuilder.build();
|
||||
}
|
||||
|
||||
public static boolean needRefresh(String token) {
|
||||
Date exp = JWTUtils.getExp(token);
|
||||
return new Date().getTime() >= exp.getTime();
|
||||
}
|
||||
|
||||
/**
|
||||
* 当前token是否登录超时
|
||||
*
|
||||
* @param token
|
||||
* @return
|
||||
*/
|
||||
public static boolean loginExpire(String token) {
|
||||
if (Login_Interval == 0) {
|
||||
// 默认超时时间是8h
|
||||
Long minute = CommonBeanFactory.getBean(Environment.class).getProperty("dataease.login_timeout", Long.class,
|
||||
8 * 60L);
|
||||
// 分钟换算成毫秒
|
||||
Login_Interval = minute * 1000 * 60;
|
||||
}
|
||||
Long lastOperateTime = tokenLastOperateTime(token);
|
||||
boolean isExpire = true;
|
||||
if (lastOperateTime != null) {
|
||||
Long now = System.currentTimeMillis();
|
||||
isExpire = now - lastOperateTime > Login_Interval;
|
||||
}
|
||||
return isExpire;
|
||||
}
|
||||
|
||||
public static Date getExp(String token) {
|
||||
try {
|
||||
DecodedJWT jwt = JWT.decode(token);
|
||||
return jwt.getClaim("exp").asDate();
|
||||
} catch (JWTDecodeException e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成签名,5min后过期
|
||||
*
|
||||
* @param tokenInfo 用户信息
|
||||
* @param secret 用户的密码
|
||||
* @return 加密的token
|
||||
*/
|
||||
public static String sign(TokenInfo tokenInfo, String secret) {
|
||||
try {
|
||||
Date date = new Date(System.currentTimeMillis() + EXPIRE_TIME);
|
||||
if (ObjectUtils.isEmpty(expireTime)) {
|
||||
expireTime = CommonBeanFactory.getBean(Environment.class).getProperty("dataease.login_timeout", Long.class, 480L);
|
||||
}
|
||||
long expireTimeMillis = expireTime * 60000L;
|
||||
Date date = new Date(System.currentTimeMillis() + expireTimeMillis);
|
||||
Algorithm algorithm = Algorithm.HMAC256(secret);
|
||||
Builder builder = JWT.create()
|
||||
.withClaim("username", tokenInfo.getUsername())
|
||||
.withClaim("userId", tokenInfo.getUserId());
|
||||
String sign = builder.withExpiresAt(date).sign(algorithm);
|
||||
TokenCacheUtils.add(sign, tokenInfo.getUserId());
|
||||
return sign;
|
||||
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
@ -144,7 +102,6 @@ public class JWTUtils {
|
||||
} else {
|
||||
verifier = JWT.require(algorithm).withClaim("resourceId", resourceId).withClaim("userId", userId).build();
|
||||
}
|
||||
|
||||
try {
|
||||
verifier.verify(token);
|
||||
return true;
|
||||
@ -153,16 +110,5 @@ public class JWTUtils {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前token上次操作时间
|
||||
*
|
||||
* @param token
|
||||
* @return
|
||||
*/
|
||||
public static Long tokenLastOperateTime(String token) {
|
||||
DecodedJWT jwt = JWT.decode(token);
|
||||
Date expiresAt = jwt.getExpiresAt();
|
||||
return expiresAt.getTime();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -359,8 +359,8 @@ public class ExcelXlsxReader extends DefaultHandler {
|
||||
formatIndex = style.getDataFormat();
|
||||
formatString = style.getDataFormatString();
|
||||
short format = this.formatIndex;
|
||||
if ((14 <= format && format <= 17) || format == 0 || format == 20 || format == 22 || format == 31 || format == 35 || (45 <= format && format <= 49) || format == 46 || format == 47 || (57 <= format && format <= 59)
|
||||
|| (59 < format && format <= 76) || (175 < format && format <= 196) || (210 <= format && format <= 213) || (208 == format)) { // 日期
|
||||
if ((14 <= format && format <= 17) || format == 20 || format == 22 || format == 31 || format == 35 || format == 45 || format == 46 || format == 47 || (57 <= format && format <= 59)
|
||||
|| (175 < format && format < 178) || (182 <= format && format <= 196) || (210 <= format && format <= 213) || (208 == format)) { // 日期
|
||||
isDateFormat = true;
|
||||
}
|
||||
|
||||
|
||||
@ -3,26 +3,77 @@ package io.dataease.commons.utils;
|
||||
import io.dataease.listener.util.CacheUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.data.redis.core.ValueOperations;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
|
||||
@Component
|
||||
public class TokenCacheUtils {
|
||||
|
||||
|
||||
private static final String KEY = "sys_token_store";
|
||||
|
||||
private static String cacheType;
|
||||
|
||||
private static Long expTime;
|
||||
|
||||
@Value("${spring.cache.type:ehcache}")
|
||||
public void setCacheType(String cacheType) {
|
||||
TokenCacheUtils.cacheType = cacheType;
|
||||
}
|
||||
|
||||
@Value("${dataease.login_timeout:480}")
|
||||
public void setExpTime(Long expTime) {
|
||||
TokenCacheUtils.expTime = expTime;
|
||||
}
|
||||
|
||||
private static boolean useRedis() {
|
||||
return StringUtils.equals(cacheType, "redis");
|
||||
}
|
||||
|
||||
|
||||
private static ValueOperations cacheHandler() {
|
||||
RedisTemplate redisTemplate = (RedisTemplate) CommonBeanFactory.getBean("redisTemplate");
|
||||
ValueOperations valueOperations = redisTemplate.opsForValue();
|
||||
return valueOperations;
|
||||
}
|
||||
|
||||
public static void add(String token, Long userId) {
|
||||
CacheUtils.put(KEY, token, userId, null, null);
|
||||
if (useRedis()) {
|
||||
ValueOperations valueOperations = cacheHandler();
|
||||
valueOperations.set(KEY + token, userId, expTime, TimeUnit.MINUTES);
|
||||
return;
|
||||
}
|
||||
|
||||
Long time = expTime * 60;
|
||||
Double v = time * 0.6;
|
||||
CacheUtils.put(KEY, token, userId, time.intValue(), v.intValue());
|
||||
CacheUtils.flush(KEY);
|
||||
}
|
||||
|
||||
public static void remove(String token) {
|
||||
if (useRedis()) {
|
||||
RedisTemplate redisTemplate = (RedisTemplate) CommonBeanFactory.getBean("redisTemplate");
|
||||
String key = KEY + token;
|
||||
if (redisTemplate.hasKey(key)) {
|
||||
redisTemplate.delete(key);
|
||||
}
|
||||
return;
|
||||
}
|
||||
CacheUtils.remove(KEY, token);
|
||||
}
|
||||
|
||||
public static boolean validate(String token) {
|
||||
public static boolean invalid(String token) {
|
||||
if (useRedis()) {
|
||||
RedisTemplate redisTemplate = (RedisTemplate) CommonBeanFactory.getBean("redisTemplate");
|
||||
return redisTemplate.hasKey(KEY + token);
|
||||
}
|
||||
Object sys_token_store = CacheUtils.get(KEY, token);
|
||||
return ObjectUtils.isNotEmpty(sys_token_store) && StringUtils.isNotBlank(sys_token_store.toString());
|
||||
}
|
||||
|
||||
public static boolean validate(String token, Long userId) {
|
||||
Object sys_token_store = CacheUtils.get(KEY, token);
|
||||
return ObjectUtils.isNotEmpty(sys_token_store) && StringUtils.isNotBlank(sys_token_store.toString()) && userId == Long.parseLong(sys_token_store.toString());
|
||||
}
|
||||
}
|
||||
|
||||
@ -7,15 +7,19 @@ import com.google.common.base.Predicate;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.beans.factory.config.BeanPostProcessor;
|
||||
import org.springframework.context.annotation.*;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Import;
|
||||
import springfox.bean.validators.configuration.BeanValidatorPluginsConfiguration;
|
||||
import springfox.documentation.RequestHandler;
|
||||
import springfox.documentation.builders.*;
|
||||
import springfox.documentation.builders.ApiInfoBuilder;
|
||||
import springfox.documentation.builders.PathSelectors;
|
||||
import springfox.documentation.oas.annotations.EnableOpenApi;
|
||||
import springfox.documentation.service.*;
|
||||
import springfox.documentation.spi.DocumentationType;
|
||||
import springfox.documentation.spi.service.contexts.SecurityContext;
|
||||
import springfox.documentation.spring.web.plugins.Docket;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@ -23,7 +27,7 @@ import java.util.List;
|
||||
@EnableOpenApi
|
||||
@Configuration
|
||||
@Import(BeanValidatorPluginsConfiguration.class)
|
||||
public class Knife4jConfiguration implements BeanPostProcessor{
|
||||
public class Knife4jConfiguration implements BeanPostProcessor {
|
||||
|
||||
private static final String splitor = ",";
|
||||
|
||||
@ -33,7 +37,6 @@ public class Knife4jConfiguration implements BeanPostProcessor{
|
||||
private String version;
|
||||
|
||||
|
||||
|
||||
@Autowired
|
||||
public Knife4jConfiguration(OpenApiExtensionResolver openApiExtensionResolver) {
|
||||
this.openApiExtensionResolver = openApiExtensionResolver;
|
||||
@ -41,7 +44,7 @@ public class Knife4jConfiguration implements BeanPostProcessor{
|
||||
|
||||
@Bean(value = "authApi")
|
||||
public Docket authApi() {
|
||||
return defaultApi("权限管理", "io.dataease.auth");
|
||||
return defaultApi("登录管理", "io.dataease.auth");
|
||||
}
|
||||
|
||||
@Bean(value = "chartApi")
|
||||
@ -69,24 +72,24 @@ public class Knife4jConfiguration implements BeanPostProcessor{
|
||||
return defaultApi("系统管理", "io.dataease.controller.sys,io.dataease.plugins.server");
|
||||
}
|
||||
|
||||
private ApiInfo apiInfo(){
|
||||
private ApiInfo apiInfo() {
|
||||
return new ApiInfoBuilder()
|
||||
.title("DataEase")
|
||||
.description("人人可用的开源数据可视化分析工具")
|
||||
.termsOfServiceUrl("https://dataease.io")
|
||||
.contact(new Contact("Dataease","https://www.fit2cloud.com/dataease/index.html","dataease@fit2cloud.com"))
|
||||
.contact(new Contact("Dataease", "https://www.fit2cloud.com/dataease/index.html", "dataease@fit2cloud.com"))
|
||||
.version(version)
|
||||
.build();
|
||||
}
|
||||
|
||||
private Docket defaultApi(String groupName, String packageName) {
|
||||
List<SecurityScheme> securitySchemes=new ArrayList<>();
|
||||
List<SecurityScheme> securitySchemes = new ArrayList<>();
|
||||
securitySchemes.add(accessKey());
|
||||
securitySchemes.add(signature());
|
||||
|
||||
List<SecurityContext> securityContexts = new ArrayList<>();
|
||||
securityContexts.add(securityContext());
|
||||
Docket docket=new Docket(DocumentationType.OAS_30)
|
||||
Docket docket = new Docket(DocumentationType.OAS_30)
|
||||
.apiInfo(apiInfo())
|
||||
.groupName(groupName)
|
||||
.select()
|
||||
@ -131,7 +134,7 @@ public class Knife4jConfiguration implements BeanPostProcessor{
|
||||
return input -> declaringClass(input).transform(handlerPackage(basePackage)).or(true);
|
||||
}
|
||||
|
||||
private static Function<Class<?>, Boolean> handlerPackage(final String basePackage) {
|
||||
private static Function<Class<?>, Boolean> handlerPackage(final String basePackage) {
|
||||
return input -> {
|
||||
// 循环判断匹配
|
||||
for (String strPackage : basePackage.split(splitor)) {
|
||||
|
||||
@ -72,11 +72,12 @@ public class DataSetTableController {
|
||||
}, logical = Logical.AND)
|
||||
@ApiOperation("更新")
|
||||
@PostMapping("update")
|
||||
public List<DatasetTable> save(@RequestBody DataSetTableRequest datasetTable) throws Exception {
|
||||
public List<VAuthModelDTO> save(@RequestBody DataSetTableRequest datasetTable) throws Exception {
|
||||
if (datasetTable.getType().equalsIgnoreCase("excel")) {
|
||||
return dataSetTableService.saveExcel(datasetTable);
|
||||
List<String> ids = dataSetTableService.saveExcel(datasetTable).stream().map(DatasetTable::getId).collect(Collectors.toList());
|
||||
return vAuthModelService.queryAuthModelByIds("dataset", ids);
|
||||
} else {
|
||||
return Collections.singletonList(dataSetTableService.save(datasetTable));
|
||||
return vAuthModelService.queryAuthModelByIds("dataset", Collections.singletonList(dataSetTableService.save(datasetTable).getId()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package io.dataease.controller.panel;
|
||||
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
|
||||
import io.dataease.controller.handler.annotation.I18n;
|
||||
import io.dataease.plugins.common.base.domain.PanelPdfTemplate;
|
||||
import io.dataease.service.panel.PanelPdfTemplateService;
|
||||
import io.swagger.annotations.Api;
|
||||
@ -26,6 +27,7 @@ public class PanelPdfTemplateController {
|
||||
private PanelPdfTemplateService panelPdfTemplateService;
|
||||
|
||||
@GetMapping("queryAll")
|
||||
@I18n
|
||||
@ApiOperation("查询所有仪表板模板")
|
||||
public List<PanelPdfTemplate> queryAll() {
|
||||
return panelPdfTemplateService.queryAll();
|
||||
|
||||
@ -0,0 +1,24 @@
|
||||
package io.dataease.listener;
|
||||
|
||||
import io.dataease.commons.utils.LogUtil;
|
||||
import net.sf.ehcache.CacheManager;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.ApplicationListener;
|
||||
import org.springframework.context.event.ContextClosedEvent;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class ApplicationCloseEventListener implements ApplicationListener<ContextClosedEvent> {
|
||||
|
||||
@Autowired(required = false)
|
||||
CacheManager cacheManager;
|
||||
|
||||
@Override
|
||||
public void onApplicationEvent(ContextClosedEvent event) {
|
||||
|
||||
if (ObjectUtils.isNotEmpty(cacheManager))
|
||||
cacheManager.shutdown();
|
||||
LogUtil.info("DataEase is stopping");
|
||||
}
|
||||
}
|
||||
@ -26,6 +26,7 @@ public class DataSourceInitStartListener implements ApplicationListener<Applicat
|
||||
datasourceService.initDsCheckJob();
|
||||
dataSetTableService.updateDatasetTableStatus();
|
||||
engineService.initSimpleEngine();
|
||||
datasourceService.updateDemoDs();
|
||||
CacheUtils.removeAll("ENGINE");
|
||||
}
|
||||
|
||||
|
||||
@ -66,6 +66,12 @@ public class CacheUtils {
|
||||
return cache(cacheName).remove(key);
|
||||
}
|
||||
|
||||
public static void flush(String cacheName) {
|
||||
CacheManager manager = getCacheManager();
|
||||
if (manager instanceof RedisCacheManager) return;
|
||||
cache(cacheName).flush();
|
||||
}
|
||||
|
||||
public static void removeAll(String cacheName) {
|
||||
if (getCacheManager() instanceof RedisCacheManager) {
|
||||
org.springframework.cache.Cache cache = getCacheManager().getCache(cacheName);
|
||||
|
||||
@ -16,19 +16,20 @@ import io.dataease.plugins.xpack.auth.dto.request.XpackSysAuthRequest;
|
||||
import io.dataease.plugins.xpack.auth.dto.response.XpackSysAuthDetail;
|
||||
import io.dataease.plugins.xpack.auth.dto.response.XpackSysAuthDetailDTO;
|
||||
import io.dataease.plugins.xpack.auth.dto.response.XpackVAuthModelDTO;
|
||||
import io.dataease.plugins.xpack.auth.service.AuthXpackService;
|
||||
import io.dataease.service.datasource.DatasourceService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import io.dataease.plugins.xpack.auth.service.AuthXpackService;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@ApiIgnore
|
||||
@Api(tags = "xpack:权限管理")
|
||||
@RequestMapping("/plugin/auth")
|
||||
@RestController
|
||||
public class XAuthServer {
|
||||
@ -41,6 +42,7 @@ public class XAuthServer {
|
||||
@RequiresPermissions("auth:read")
|
||||
@PostMapping("/authModels")
|
||||
@I18n
|
||||
@ApiOperation("根据类型查询权限树")
|
||||
public List<XpackVAuthModelDTO> authModels(@RequestBody XpackBaseTreeRequest request) {
|
||||
AuthXpackService sysAuthService = SpringContextUtil.getBean(AuthXpackService.class);
|
||||
CurrentUserDto user = AuthUtils.getUser();
|
||||
@ -49,6 +51,7 @@ public class XAuthServer {
|
||||
|
||||
@RequiresPermissions("auth:read")
|
||||
@PostMapping("/authDetails")
|
||||
@ApiOperation("查询权限源目标映射关系")
|
||||
public Map<String, List<XpackSysAuthDetailDTO>> authDetails(@RequestBody XpackSysAuthRequest request) {
|
||||
AuthXpackService sysAuthService = SpringContextUtil.getBean(AuthXpackService.class);
|
||||
return sysAuthService.searchAuthDetails(request);
|
||||
@ -57,6 +60,7 @@ public class XAuthServer {
|
||||
@RequiresPermissions("auth:read")
|
||||
@GetMapping("/authDetailsModel/{authType}/{direction}")
|
||||
@I18n
|
||||
@ApiOperation("查询授权明细")
|
||||
public List<XpackSysAuthDetail> authDetailsModel(@PathVariable String authType, @PathVariable String direction) {
|
||||
AuthXpackService sysAuthService = SpringContextUtil.getBean(AuthXpackService.class);
|
||||
List<XpackSysAuthDetail> authDetails = sysAuthService.searchAuthDetailsModel(authType);
|
||||
@ -72,6 +76,7 @@ public class XAuthServer {
|
||||
|
||||
@RequiresPermissions("auth:read")
|
||||
@PostMapping("/authChange")
|
||||
@ApiOperation("变更授权信息")
|
||||
public void authChange(@RequestBody XpackSysAuthRequest request) {
|
||||
AuthXpackService sysAuthService = SpringContextUtil.getBean(AuthXpackService.class);
|
||||
CurrentUserDto user = AuthUtils.getUser();
|
||||
@ -157,17 +162,18 @@ public class XAuthServer {
|
||||
}
|
||||
|
||||
@GetMapping("/getDatasourceTypes")
|
||||
public List<DatasourceBaseType> getDatasourceTypes(){
|
||||
Collection<DataSourceType> activeType = datasourceService.types();
|
||||
Map<String,String> activeTypeMap = activeType.stream().collect(Collectors.toMap(DataSourceType::getType, DataSourceType::getName));
|
||||
activeTypeMap.put("all","所有数据源");
|
||||
@ApiOperation("查询授权的数据类型")
|
||||
public List<DatasourceBaseType> getDatasourceTypes() {
|
||||
Collection<DataSourceType> activeType = datasourceService.types();
|
||||
Map<String, String> activeTypeMap = activeType.stream().collect(Collectors.toMap(DataSourceType::getType, DataSourceType::getName));
|
||||
activeTypeMap.put("all", "所有数据源");
|
||||
AuthXpackService sysAuthService = SpringContextUtil.getBean(AuthXpackService.class);
|
||||
List<DatasourceBaseType> presentTypes = sysAuthService.getDatasourceTypes();
|
||||
presentTypes.stream().forEach(datasourceBaseType -> {
|
||||
if(activeTypeMap.get(datasourceBaseType.getType())!=null){
|
||||
if (activeTypeMap.get(datasourceBaseType.getType()) != null) {
|
||||
datasourceBaseType.setName(activeTypeMap.get(datasourceBaseType.getType()));
|
||||
}
|
||||
});
|
||||
return presentTypes;
|
||||
return presentTypes;
|
||||
}
|
||||
}
|
||||
|
||||
@ -336,14 +336,15 @@ public class ApiProvider extends Provider {
|
||||
o.put("deType", 0);
|
||||
o.put("extField", 0);
|
||||
o.put("checked", false);
|
||||
// for (DatasetTableFieldDTO fieldDTO : apiDefinition.getFields()) {
|
||||
// if (StringUtils.isNotEmpty(o.getString("jsonPath")) && StringUtils.isNotEmpty(fieldDTO.getJsonPath()) && fieldDTO.getJsonPath().equals(o.getString("jsonPath"))) {
|
||||
// o.put("checked", true);
|
||||
// o.put("deExtractType", fieldDTO.getDeExtractType());
|
||||
// o.put("name", fieldDTO.getName());
|
||||
// }
|
||||
// }
|
||||
|
||||
if (!apiDefinition.isUseJsonPath()) {
|
||||
for (DatasetTableFieldDTO fieldDTO : apiDefinition.getFields()) {
|
||||
if (StringUtils.isNotEmpty(o.getString("jsonPath")) && StringUtils.isNotEmpty(fieldDTO.getJsonPath()) && fieldDTO.getJsonPath().equals(o.getString("jsonPath"))) {
|
||||
o.put("checked", true);
|
||||
o.put("deExtractType", fieldDTO.getDeExtractType());
|
||||
o.put("name", fieldDTO.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static private boolean hasItem(ApiDefinition apiDefinition, List<JSONObject> fields, JSONObject item) {
|
||||
|
||||
@ -155,7 +155,10 @@ public class DorisQueryProvider extends QueryProvider {
|
||||
STGroup stg = new STGroupFile(SQLConstants.SQL_TEMPLATE);
|
||||
ST st_sql = stg.getInstanceOf("previewSql");
|
||||
st_sql.add("isGroup", isGroup);
|
||||
if (CollectionUtils.isNotEmpty(xFields)) st_sql.add("groups", xFields);
|
||||
if (CollectionUtils.isNotEmpty(xFields)) {
|
||||
st_sql.add("useAliasForGroup", true);
|
||||
st_sql.add("groups", xFields);
|
||||
}
|
||||
if (ObjectUtils.isNotEmpty(tableObj)) st_sql.add("table", tableObj);
|
||||
String customWheres = transCustomFilterList(tableObj, fieldCustomFilter);
|
||||
// row permissions tree
|
||||
@ -345,7 +348,10 @@ public class DorisQueryProvider extends QueryProvider {
|
||||
|
||||
STGroup stg = new STGroupFile(SQLConstants.SQL_TEMPLATE);
|
||||
ST st_sql = stg.getInstanceOf("querySql");
|
||||
if (CollectionUtils.isNotEmpty(xFields)) st_sql.add("groups", xFields);
|
||||
if (CollectionUtils.isNotEmpty(xFields)) {
|
||||
st_sql.add("useAliasForGroup", true);
|
||||
st_sql.add("groups", xFields);
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(yFields)) st_sql.add("aggregators", yFields);
|
||||
if (CollectionUtils.isNotEmpty(wheres)) st_sql.add("filters", wheres);
|
||||
if (ObjectUtils.isNotEmpty(tableObj)) st_sql.add("table", tableObj);
|
||||
@ -435,7 +441,10 @@ public class DorisQueryProvider extends QueryProvider {
|
||||
STGroup stg = new STGroupFile(SQLConstants.SQL_TEMPLATE);
|
||||
ST st_sql = stg.getInstanceOf("previewSql");
|
||||
st_sql.add("isGroup", false);
|
||||
if (CollectionUtils.isNotEmpty(xFields)) st_sql.add("groups", xFields);
|
||||
if (CollectionUtils.isNotEmpty(xFields)) {
|
||||
st_sql.add("useAliasForGroup", true);
|
||||
st_sql.add("groups", xFields);
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(wheres)) st_sql.add("filters", wheres);
|
||||
if (ObjectUtils.isNotEmpty(tableObj)) st_sql.add("table", tableObj);
|
||||
String sql = st_sql.render();
|
||||
@ -558,7 +567,10 @@ public class DorisQueryProvider extends QueryProvider {
|
||||
|
||||
STGroup stg = new STGroupFile(SQLConstants.SQL_TEMPLATE);
|
||||
ST st_sql = stg.getInstanceOf("querySql");
|
||||
if (CollectionUtils.isNotEmpty(xFields)) st_sql.add("groups", xFields);
|
||||
if (CollectionUtils.isNotEmpty(xFields)) {
|
||||
st_sql.add("useAliasForGroup", true);
|
||||
st_sql.add("groups", xFields);
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(yFields)) st_sql.add("aggregators", yFields);
|
||||
if (CollectionUtils.isNotEmpty(wheres)) st_sql.add("filters", wheres);
|
||||
if (ObjectUtils.isNotEmpty(tableObj)) st_sql.add("table", tableObj);
|
||||
@ -672,7 +684,10 @@ public class DorisQueryProvider extends QueryProvider {
|
||||
|
||||
STGroup stg = new STGroupFile(SQLConstants.SQL_TEMPLATE);
|
||||
ST st_sql = stg.getInstanceOf("querySql");
|
||||
if (CollectionUtils.isNotEmpty(xFields)) st_sql.add("groups", xFields);
|
||||
if (CollectionUtils.isNotEmpty(xFields)) {
|
||||
st_sql.add("useAliasForGroup", true);
|
||||
st_sql.add("groups", xFields);
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(yFields)) st_sql.add("aggregators", yFields);
|
||||
if (CollectionUtils.isNotEmpty(wheres)) st_sql.add("filters", wheres);
|
||||
if (ObjectUtils.isNotEmpty(tableObj)) st_sql.add("table", tableObj);
|
||||
|
||||
@ -808,7 +808,7 @@ public class MysqlQueryProvider extends QueryProvider {
|
||||
}
|
||||
return stringBuilder.toString();
|
||||
}).toArray(String[]::new);
|
||||
return MessageFormat.format("SELECT {0} FROM {1} LIMIT DE_OFFSET, DE_PAGE_SIZE ", StringUtils.join(array, ","), table);
|
||||
return MessageFormat.format("SELECT {0} FROM {1} LIMIT DE_OFFSET, DE_PAGE_SIZE ", StringUtils.join(array, ","), String.format(MySQLConstants.KEYWORD_TABLE, table));
|
||||
}
|
||||
|
||||
public String getTotalCount(boolean isTable, String sql, Datasource ds) {
|
||||
|
||||
@ -880,6 +880,7 @@ public class OracleQueryProvider extends QueryProvider {
|
||||
ChartViewFieldDTO f = new ChartViewFieldDTO();
|
||||
f.setOriginName(datasetTableField.getOriginName());
|
||||
f.setDeType(0);
|
||||
f.setType(datasetTableField.getType());
|
||||
xAxis.add(f);
|
||||
});
|
||||
|
||||
@ -916,6 +917,9 @@ public class OracleQueryProvider extends QueryProvider {
|
||||
continue;
|
||||
}
|
||||
String originField = String.format(OracleConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName());
|
||||
if(xAxis.get(i).getType().equals("DATE")){
|
||||
originField = String.format(OracleConstants.TO_CHAR, originField, OracleConstants.DEFAULT_DATE_FORMAT);
|
||||
}
|
||||
String fieldAlias = String.format(OracleConstants.KEYWORD_TABLE, x.getOriginName());
|
||||
xFields.add(getXFields(x, originField, fieldAlias));
|
||||
}
|
||||
|
||||
@ -529,6 +529,9 @@ public class ChartViewService {
|
||||
xAxisForRequest.addAll(xAxis);
|
||||
xAxisForRequest.addAll(extStack);
|
||||
datasourceRequest.setXAxis(xAxisForRequest);
|
||||
List<ChartViewFieldDTO> yAxisForRequest = new ArrayList<>();
|
||||
yAxisForRequest.addAll(yAxis);
|
||||
datasourceRequest.setYAxis(yAxisForRequest);
|
||||
data = datasourceProvider.getData(datasourceRequest);
|
||||
} else if (table.getMode() == 1) {// 抽取
|
||||
datasourceRequest.setDatasource(ds);
|
||||
@ -668,7 +671,7 @@ public class ChartViewService {
|
||||
if (StringUtils.equalsIgnoreCase(view.getResultMode(), "custom")) {
|
||||
chartExtRequest.setGoPage(1L);
|
||||
chartExtRequest.setPageSize(view.getResultCount().longValue());
|
||||
} else {
|
||||
} else if (!chartExtRequest.getExcelExportFlag()) {
|
||||
chartExtRequest.setGoPage(null);
|
||||
chartExtRequest.setPageSize(null);
|
||||
}
|
||||
@ -841,22 +844,37 @@ public class ChartViewService {
|
||||
// 下钻
|
||||
List<ChartExtFilterRequest> drillFilters = new ArrayList<>();
|
||||
boolean isDrill = false;
|
||||
List<ChartDrillRequest> drillRequest = chartExtRequest.getDrill();
|
||||
if (CollectionUtils.isNotEmpty(drillRequest) && (drill.size() > drillRequest.size())) {
|
||||
for (int i = 0; i < drillRequest.size(); i++) {
|
||||
ChartDrillRequest request = drillRequest.get(i);
|
||||
for (ChartDimensionDTO dto : request.getDimensionList()) {
|
||||
ChartViewFieldDTO chartViewFieldDTO = drill.get(i);
|
||||
List<ChartDrillRequest> drillRequestList = chartExtRequest.getDrill();
|
||||
if (CollectionUtils.isNotEmpty(drillRequestList) && (drill.size() > drillRequestList.size())) {
|
||||
// 如果是从子维度开始下钻,那么先把主维度的条件先加上去
|
||||
if (CollectionUtils.isNotEmpty(xAxisExt) && StringUtils.equalsIgnoreCase(drill.get(0).getId(), xAxisExt.get(0).getId())) {
|
||||
ChartDrillRequest head = drillRequestList.get(0);
|
||||
for (int i = 0; i < xAxisBase.size(); i++) {
|
||||
ChartDimensionDTO dimensionDTO = head.getDimensionList().get(i);
|
||||
DatasetTableField datasetTableField = dataSetTableFieldsService.get(dimensionDTO.getId());
|
||||
ChartExtFilterRequest tmp = new ChartExtFilterRequest();
|
||||
tmp.setFieldId(tmp.getFieldId());
|
||||
tmp.setValue(Collections.singletonList(dimensionDTO.getValue()));
|
||||
tmp.setOperator("in");
|
||||
tmp.setDatasetTableField(datasetTableField);
|
||||
extFilterList.add(tmp);
|
||||
drillFilters.add(tmp);
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < drillRequestList.size(); i++) {
|
||||
ChartDrillRequest request = drillRequestList.get(i);
|
||||
ChartViewFieldDTO chartViewFieldDTO = drill.get(i);
|
||||
for (ChartDimensionDTO requestDimension : request.getDimensionList()) {
|
||||
// 将钻取值作为条件传递,将所有钻取字段作为xAxis并加上下一个钻取字段
|
||||
if (StringUtils.equalsIgnoreCase(dto.getId(), chartViewFieldDTO.getId())) {
|
||||
if (StringUtils.equalsIgnoreCase(requestDimension.getId(), chartViewFieldDTO.getId())) {
|
||||
isDrill = true;
|
||||
DatasetTableField datasetTableField = dataSetTableFieldsService.get(dto.getId());
|
||||
DatasetTableField datasetTableField = dataSetTableFieldsService.get(requestDimension.getId());
|
||||
ChartViewFieldDTO d = new ChartViewFieldDTO();
|
||||
BeanUtils.copyBean(d, datasetTableField);
|
||||
|
||||
ChartExtFilterRequest drillFilter = new ChartExtFilterRequest();
|
||||
drillFilter.setFieldId(dto.getId());
|
||||
drillFilter.setValue(Collections.singletonList(dto.getValue()));
|
||||
drillFilter.setFieldId(requestDimension.getId());
|
||||
drillFilter.setValue(Collections.singletonList(requestDimension.getValue()));
|
||||
drillFilter.setOperator("in");
|
||||
drillFilter.setDatasetTableField(datasetTableField);
|
||||
extFilterList.add(drillFilter);
|
||||
@ -866,7 +884,8 @@ public class ChartViewService {
|
||||
if (!checkDrillExist(xAxis, extStack, d, view)) {
|
||||
xAxis.add(d);
|
||||
}
|
||||
if (i == drillRequest.size() - 1) {
|
||||
//
|
||||
if (i == drillRequestList.size() - 1) {
|
||||
ChartViewFieldDTO nextDrillField = drill.get(i + 1);
|
||||
if (!checkDrillExist(xAxis, extStack, nextDrillField, view)) {
|
||||
// get drill list first element's sort,then assign to nextDrillField
|
||||
@ -1037,6 +1056,7 @@ public class ChartViewService {
|
||||
}
|
||||
if (StringUtils.isNotEmpty(totalPageSql) && StringUtils.equalsIgnoreCase((String) mapSize.get("tablePageMode"), "page")) {
|
||||
datasourceRequest.setQuery(totalPageSql);
|
||||
datasourceRequest.setTotalPageFlag(true);
|
||||
java.util.List<java.lang.String[]> tmpData = datasourceProvider.getData(datasourceRequest);
|
||||
totalItems = CollectionUtils.isEmpty(tmpData) ? 0 : Long.valueOf(tmpData.get(0)[0]);
|
||||
totalPage = (totalItems / pageInfo.getPageSize()) + (totalItems % pageInfo.getPageSize() > 0 ? 1 : 0);
|
||||
@ -1047,6 +1067,10 @@ public class ChartViewService {
|
||||
xAxisForRequest.addAll(xAxis);
|
||||
xAxisForRequest.addAll(extStack);
|
||||
datasourceRequest.setXAxis(xAxisForRequest);
|
||||
List<ChartViewFieldDTO> yAxisForRequest = new ArrayList<>();
|
||||
yAxisForRequest.addAll(yAxis);
|
||||
datasourceRequest.setYAxis(yAxisForRequest);
|
||||
datasourceRequest.setTotalPageFlag(false);
|
||||
data = datasourceProvider.getData(datasourceRequest);
|
||||
if (CollectionUtils.isNotEmpty(assistFields)) {
|
||||
datasourceAssistRequest.setQuery(assistSQL(datasourceRequest.getQuery(), assistFields));
|
||||
|
||||
@ -34,6 +34,7 @@ import io.dataease.plugins.common.base.mapper.*;
|
||||
import io.dataease.plugins.common.constants.DatasetType;
|
||||
import io.dataease.plugins.common.constants.DatasourceTypes;
|
||||
import io.dataease.plugins.common.constants.DeTypeConstants;
|
||||
import io.dataease.plugins.common.dto.chart.ChartViewFieldDTO;
|
||||
import io.dataease.plugins.common.dto.dataset.SqlVariableDetails;
|
||||
import io.dataease.plugins.common.dto.datasource.DataSourceType;
|
||||
import io.dataease.plugins.common.dto.datasource.TableField;
|
||||
@ -712,6 +713,7 @@ public class DataSetTableService {
|
||||
datasourceRequest.setPreviewData(true);
|
||||
try {
|
||||
datasourceRequest.setPageable(true);
|
||||
datasourceRequest.setPermissionFields(fields);
|
||||
data.addAll(datasourceProvider.getData(datasourceRequest));
|
||||
} catch (Exception e) {
|
||||
logger.error(e.getMessage());
|
||||
|
||||
@ -195,6 +195,7 @@ public class DirectFieldService implements DataSetFieldService {
|
||||
datasourceRequest.setQuery(qp.createQuerySQL(tableName, permissionFields, !needSort, null, customFilter, rowPermissionsTree, deSortFields));
|
||||
}
|
||||
LogUtil.info(datasourceRequest.getQuery());
|
||||
datasourceRequest.setPermissionFields(permissionFields);
|
||||
List<String[]> rows = datasourceProvider.getData(datasourceRequest);
|
||||
if (!needMapping) {
|
||||
List<Object> results = rows.stream().map(row -> row[0]).distinct().collect(Collectors.toList());
|
||||
|
||||
@ -63,6 +63,8 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.*;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
@ -646,4 +648,22 @@ public class DatasourceService {
|
||||
addJob(basicInfo.getDsCheckIntervalType(), Integer.valueOf(basicInfo.getDsCheckInterval()));
|
||||
}
|
||||
|
||||
public void updateDemoDs() {
|
||||
Datasource datasource = datasourceMapper.selectByPrimaryKey("76026997-94f9-4a35-96ca-151084638969");
|
||||
MysqlConfiguration mysqlConfiguration = new Gson().fromJson(datasource.getConfiguration(), MysqlConfiguration.class);
|
||||
Pattern WITH_SQL_FRAGMENT = Pattern.compile("jdbc:mysql://(.*):(\\d+)/(.*)");
|
||||
Matcher matcher = WITH_SQL_FRAGMENT.matcher(env.getProperty("spring.datasource.url"));
|
||||
if (!matcher.find()) {
|
||||
return;
|
||||
}
|
||||
mysqlConfiguration.setHost(matcher.group(1));
|
||||
mysqlConfiguration.setPort(Integer.valueOf(matcher.group(2)));
|
||||
mysqlConfiguration.setDataBase(matcher.group(3).split("\\?")[0]);
|
||||
mysqlConfiguration.setExtraParams(matcher.group(3).split("\\?")[1]);
|
||||
mysqlConfiguration.setUsername(env.getProperty("spring.datasource.username"));
|
||||
mysqlConfiguration.setPassword(env.getProperty("spring.datasource.password"));
|
||||
datasource.setConfiguration(new Gson().toJson(mysqlConfiguration));
|
||||
datasourceMapper.updateByPrimaryKeyWithBLOBs(datasource);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
6
backend/src/main/resources/db/migration/V50__1.18.3.sql
Normal file
6
backend/src/main/resources/db/migration/V50__1.18.3.sql
Normal file
@ -0,0 +1,6 @@
|
||||
UPDATE `my_plugin`
|
||||
SET `version` = '1.18.3'
|
||||
where `plugin_id` > 0
|
||||
and `version` = '1.18.2';
|
||||
UPDATE `panel_pdf_template` SET `name` = 'I18N_PANEL_PDF_TEMPLATE_WITH_PARAMS',`template_content` = '<div style=\"margin-top: 5px\">\n <div contenteditable=\"true\"> \n $t(''panel.panel_name''):$panelName$ </br>\n $t(''panel.export_time''):$yyyy-MM-dd hh:mm:ss$ </br>\n $t(''panel.export_user''):$nickName$ </br>\n $t(''panel.you_can_type_here'')\n </div>\n <div>\n <img width=\"100%\" src=\"$snapshot$\">\n </div>\n </div>' WHERE id='1';
|
||||
UPDATE `panel_pdf_template` SET `name` = 'I18N_PANEL_PDF_TEMPLATE_ONLY_PIC' WHERE id='2';
|
||||
@ -272,12 +272,18 @@
|
||||
|
||||
<cache
|
||||
name="sys_token_store"
|
||||
eternal="true"
|
||||
maxElementsInMemory="100"
|
||||
maxElementsOnDisk="3000"
|
||||
eternal="false"
|
||||
maxElementsInMemory="5000"
|
||||
maxElementsOnDisk="50000"
|
||||
overflowToDisk="true"
|
||||
diskPersistent="false"
|
||||
/>
|
||||
timeToIdleSeconds="28800"
|
||||
timeToLiveSeconds="28800"
|
||||
memoryStoreEvictionPolicy="LRU"
|
||||
diskPersistent="true">
|
||||
<BootstrapCacheLoaderFactory class="net.sf.ehcache.store.DiskStoreBootstrapCacheLoaderFactory" properties="bootstrapAsynchronously=true" />
|
||||
</cache>
|
||||
|
||||
|
||||
|
||||
|
||||
</ehcache>
|
||||
@ -62,7 +62,7 @@ i18n_panel_list=Dashboard
|
||||
i18n_processing_data=Processing data now, Refresh later
|
||||
i18n_union_already_exists=Union relation already exists
|
||||
i18n_union_field_exists=The same field can't in two dataset
|
||||
i18n_cron_time_error=Start time can't greater then end time
|
||||
i18n_cron_time_error=Start time can't greater than end time
|
||||
i18n_auth_source_be_canceled=This Auth Resource Already Be Canceled,Please Connect Admin
|
||||
i18n_username_exists=ID is already exists
|
||||
i18n_nickname_exists=NickName is already exists
|
||||
@ -134,7 +134,7 @@ theme_name_empty=name can not be empty
|
||||
i18n_public_chart=\u3010Public Chart\u3011
|
||||
i18n_class_blue=Blue Tone
|
||||
\u63D2\u4EF6\u7BA1\u7406=Plugins
|
||||
i18n_plugin_not_allow_delete=The plugin in in use cannot be deleted
|
||||
i18n_plugin_not_allow_delete=The plugin in use cannot be deleted
|
||||
i18n_wrong_content=Wrong content
|
||||
i18n_wrong_tel=Wrong tel format
|
||||
i18n_wrong_email=Wrong email format
|
||||
@ -146,7 +146,7 @@ OPERATE_TYPE_DELETE=Delete
|
||||
OPERATE_TYPE_SHARE=Share
|
||||
OPERATE_TYPE_UNSHARE=Unshare
|
||||
OPERATE_TYPE_AUTHORIZE=Authorize
|
||||
OPERATE_TYPE_UNAUTHORIZE=Unauthorize
|
||||
OPERATE_TYPE_UNAUTHORIZE=Unauthorized
|
||||
OPERATE_TYPE_CREATELINK=Create Link
|
||||
OPERATE_TYPE_DELETELINK=Delete Link
|
||||
OPERATE_TYPE_MODIFYLINK=Modify Link
|
||||
@ -261,4 +261,16 @@ I18N_LOG_FORMAT_PREFIX=With authority of %s\u3010%s\u3011
|
||||
\u6C34\u5370\u7BA1\u7406=Watermark
|
||||
\u8840\u7F18\u5173\u7CFB=Relationship
|
||||
|
||||
I18N_CRON_ERROR=Cron expression error
|
||||
I18N_CRON_ERROR=Cron expression error
|
||||
I18N_PANEL_PDF_TEMPLATE_WITH_PARAMS=Default template with params
|
||||
I18N_PANEL_PDF_TEMPLATE_ONLY_PIC=Default template only screenshot
|
||||
\u8FB9\u68461=Border 1
|
||||
\u8FB9\u68462=Border 2
|
||||
\u8FB9\u68463=Border 3
|
||||
\u8FB9\u68464=Border 4
|
||||
\u8FB9\u68465=Border 5
|
||||
\u8FB9\u68466=Border 6
|
||||
\u8FB9\u68467=Border 7
|
||||
\u8FB9\u68468=Border 8
|
||||
\u8FB9\u68469=Border 9
|
||||
\u8FB9\u684610=Border 10
|
||||
|
||||
@ -262,4 +262,6 @@ I18N_LOG_FORMAT_PREFIX=\u4EE5%s\u3010%s\u3011\u6743\u9650
|
||||
\u8840\u7F18\u5173\u7CFB=\u8840\u7F18\u5173\u7CFB
|
||||
|
||||
I18N_CRON_ERROR=cron\u8868\u8FBE\u5F0F\u9519\u8BEF
|
||||
I18N_PANEL_PDF_TEMPLATE_WITH_PARAMS=\u9ED8\u8BA4\u6A21\u677F(\u52A0\u53C2\u6570\u6837\u5F0F)
|
||||
I18N_PANEL_PDF_TEMPLATE_ONLY_PIC=\u9ED8\u8BA4\u6A21\u677F(\u53EA\u622A\u56FE)
|
||||
|
||||
|
||||
@ -257,4 +257,16 @@ I18N_LOG_FORMAT_PREFIX=\u4EE5%s\u3010%s\u3011\u6B0A\u9650
|
||||
\u6C34\u5370\u7BA1\u7406=\u6C34\u5370\u7BA1\u7406
|
||||
\u8840\u7F18\u5173\u7CFB=\u8840\u7DE3\u95DC\u7CFB
|
||||
|
||||
I18N_CRON_ERROR=cron\u8868\u9054\u5F0F\u932F\u8AA4
|
||||
I18N_CRON_ERROR=cron\u8868\u9054\u5F0F\u932F\u8AA4
|
||||
I18N_PANEL_PDF_TEMPLATE_WITH_PARAMS=\u9ED8\u8A8D\u6A21\u677F(\u52A0\u53C3\u6578\u6A23\u5F0F)
|
||||
I18N_PANEL_PDF_TEMPLATE_ONLY_PIC=\u9ED8\u8A8D\u6A21\u677F(\u53EA\u622A\u5716)
|
||||
\u8FB9\u68461=\u908A\u6846 1
|
||||
\u8FB9\u68462=\u908A\u6846 2
|
||||
\u8FB9\u68463=\u908A\u6846 3
|
||||
\u8FB9\u68464=\u908A\u6846 4
|
||||
\u8FB9\u68465=\u908A\u6846 5
|
||||
\u8FB9\u68466=\u908A\u6846 6
|
||||
\u8FB9\u68467=\u908A\u6846 7
|
||||
\u8FB9\u68468=\u908A\u6846 8
|
||||
\u8FB9\u68469=\u908A\u6846 9
|
||||
\u8FB9\u684610=\u908A\u6846 10
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
querySql(limitFiled, groups, aggregators, filters, orders, table, notUseAs)
|
||||
querySql(limitFiled, groups, aggregators, filters, orders, table, notUseAs, useAliasForGroup)
|
||||
::=<<
|
||||
SELECT
|
||||
<if(limitFiled)>
|
||||
@ -23,10 +23,14 @@ FROM
|
||||
WHERE
|
||||
<filters:{filter|<if(filter)><filter><endif>}; separator="\nAND ">
|
||||
<endif>
|
||||
<if(groups)>
|
||||
<if(groups && !useAliasForGroup)>
|
||||
GROUP BY
|
||||
<groups:{group|<if(group)><group.fieldName><endif>}; separator=",\n">
|
||||
<endif>
|
||||
<if(groups && useAliasForGroup)>
|
||||
GROUP BY
|
||||
<groups:{group|<if(group)><group.fieldAlias><endif>}; separator=",\n">
|
||||
<endif>
|
||||
<if(orders)>
|
||||
ORDER BY
|
||||
<orders:{order|<if(order)><order.orderAlias> <order.orderDirection><endif>}; separator=",\n">
|
||||
@ -34,7 +38,7 @@ ORDER BY
|
||||
>>
|
||||
|
||||
|
||||
previewSql(limitFiled, groups, aggregators, filters, orders, table, isGroup, notUseAs)
|
||||
previewSql(limitFiled, groups, aggregators, filters, orders, table, isGroup, notUseAs, useAliasForGroup)
|
||||
::=<<
|
||||
SELECT
|
||||
<if(limitFiled)>
|
||||
@ -59,10 +63,14 @@ FROM
|
||||
WHERE
|
||||
<filters:{filter|<if(filter)><filter><endif>}; separator="\nAND ">
|
||||
<endif>
|
||||
<if(isGroup && groups)>
|
||||
<if(groups && !useAliasForGroup)>
|
||||
GROUP BY
|
||||
<groups:{group|<if(group)><group.fieldName><endif>}; separator=",\n">
|
||||
<endif>
|
||||
<if(groups && useAliasForGroup)>
|
||||
GROUP BY
|
||||
<groups:{group|<if(group)><group.fieldAlias><endif>}; separator=",\n">
|
||||
<endif>
|
||||
<if(orders)>
|
||||
ORDER BY
|
||||
<orders:{order|<if(order)><order.orderAlias> <order.orderDirection><endif>}; separator=",\n">
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "dataease",
|
||||
"version": "1.18.2",
|
||||
"version": "1.18.3",
|
||||
"description": "dataease front",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
@ -88,7 +88,8 @@
|
||||
"vuedraggable": "^2.24.3",
|
||||
"vuex": "3.1.0",
|
||||
"webpack": "^4.46.0",
|
||||
"xlsx": "^0.17.0"
|
||||
"xlsx": "^0.17.0",
|
||||
"xss": "^1.0.14"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.4.0-0",
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<artifactId>dataease-server</artifactId>
|
||||
<groupId>io.dataease</groupId>
|
||||
<version>1.18.2</version>
|
||||
<version>1.18.3</version>
|
||||
</parent>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@ -6,17 +6,49 @@
|
||||
ref="de-theme"
|
||||
component-name="ThemeSetting"
|
||||
/>
|
||||
<el-dialog
|
||||
v-if="$route.path !== '/login'"
|
||||
:visible.sync="showPasswordModifiedDialog"
|
||||
append-to-body
|
||||
:title="$t('user.change_password')"
|
||||
:show-close="false"
|
||||
>
|
||||
<PasswordUpdateForm oldPwd="dataease" />
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import PluginCom from '@/views/system/plugin/PluginCom'
|
||||
import { mapState } from 'vuex'
|
||||
import PasswordUpdateForm from '@/views/system/user/PasswordUpdateForm.vue'
|
||||
|
||||
export default {
|
||||
name: 'App',
|
||||
components: { PluginCom },
|
||||
beforeCreate() {
|
||||
|
||||
components: { PluginCom, PasswordUpdateForm },
|
||||
computed: {
|
||||
...mapState('user', [
|
||||
'passwordModified',
|
||||
])
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
showPasswordModifiedDialog: false
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
const passwordModified = JSON.parse(localStorage.getItem('passwordModified'))
|
||||
if (typeof passwordModified === 'boolean') {
|
||||
this.$store.commit('user/SET_PASSWORD_MODIFIED', passwordModified)
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
passwordModified: {
|
||||
handler(val) {
|
||||
this.showPasswordModifiedDialog = !val
|
||||
},
|
||||
immediate: true
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@ -35,6 +35,7 @@ export const addUser = (data) => {
|
||||
return request({
|
||||
url: pathMap.createPath,
|
||||
method: 'post',
|
||||
loading: true,
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
@ -466,7 +466,7 @@ export default {
|
||||
initFontSize: 12,
|
||||
initActiveFontSize: 18,
|
||||
miniFontSize: 12,
|
||||
maxFontSize: 128,
|
||||
maxFontSize: 256,
|
||||
textAlignOptions: [
|
||||
{
|
||||
icon: 'iconfont icon-juzuo',
|
||||
|
||||
@ -37,6 +37,7 @@ import 'tinymce/plugins/nonbreaking'
|
||||
import 'tinymce/plugins/pagebreak'
|
||||
import { mapState } from 'vuex'
|
||||
import Vue from 'vue'
|
||||
import xssCheck from 'xss'
|
||||
|
||||
export default {
|
||||
name: 'DeRichText',
|
||||
@ -77,7 +78,7 @@ export default {
|
||||
canEdit: false,
|
||||
// 初始化配置
|
||||
tinymceId: 'tinymce-' + this.element.id,
|
||||
myValue: this.propValue,
|
||||
myValue: xssCheck(this.propValue),
|
||||
init: {
|
||||
selector: '#tinymce-' + this.element.id,
|
||||
toolbar_items_size: 'small',
|
||||
|
||||
@ -38,6 +38,7 @@ import 'tinymce/plugins/pagebreak'
|
||||
import { mapState } from 'vuex'
|
||||
import bus from '@/utils/bus'
|
||||
import { uuid } from 'vue-uuid'
|
||||
import xssCheck from 'xss'
|
||||
|
||||
export default {
|
||||
name: 'DeRichTextView',
|
||||
@ -152,7 +153,7 @@ export default {
|
||||
viewInit() {
|
||||
bus.$on('fieldSelect-' + this.element.propValue.viewId, this.fieldSelect)
|
||||
tinymce.init({})
|
||||
this.myValue = this.assignment(this.element.propValue.textValue)
|
||||
this.myValue = xssCheck(this.assignment(this.element.propValue.textValue))
|
||||
bus.$on('initCurFields-' + this.element.id, this.initCurFieldsChange)
|
||||
this.$nextTick(() => {
|
||||
this.initReady = true
|
||||
|
||||
@ -759,7 +759,7 @@ export default {
|
||||
const attrSize = JSON.parse(this.view.customAttr).size
|
||||
if (this.chart.type === 'table-info' && this.view.datasetMode === 0 && (!attrSize.tablePageMode || attrSize.tablePageMode === 'page')) {
|
||||
requestInfo.goPage = this.currentPage.page
|
||||
requestInfo.pageSize = this.currentPage.pageSize
|
||||
requestInfo.pageSize = this.currentPage.pageSize === parseInt(attrSize.tablePageSize) ? this.currentPage.pageSize : parseInt(attrSize.tablePageSize)
|
||||
}
|
||||
}
|
||||
if (this.isFirstLoad) {
|
||||
|
||||
@ -64,7 +64,7 @@
|
||||
:enable-scroll="false"
|
||||
:chart="chartTable"
|
||||
:show-summary="false"
|
||||
class="table-class"
|
||||
class="table-class-dialog"
|
||||
/>
|
||||
</de-main-container>
|
||||
</de-container>
|
||||
@ -342,8 +342,9 @@ export default {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.table-class {
|
||||
.table-class-dialog {
|
||||
height: 100%;
|
||||
overflow-y: auto !important;
|
||||
}
|
||||
|
||||
.canvas-class {
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
@mousedown="handleMousedown"
|
||||
@blur="handleBlur"
|
||||
@input="handleInput"
|
||||
v-html="element.propValue"
|
||||
v-html="$xss(element.propValue)"
|
||||
/>
|
||||
<div
|
||||
v-if="!canEdit"
|
||||
@ -28,7 +28,7 @@
|
||||
@mousedown="handleMousedown"
|
||||
@blur="handleBlur"
|
||||
@input="handleInput"
|
||||
v-html="element.propValue"
|
||||
v-html="$xss(element.propValue)"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
@ -37,7 +37,7 @@
|
||||
>
|
||||
<div
|
||||
:style="{ verticalAlign: element.style.verticalAlign }"
|
||||
v-html="textInfo"
|
||||
v-html="$xss(textInfo)"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
@ -80,7 +80,7 @@ export default {
|
||||
},
|
||||
textInfo() {
|
||||
if (this.element && this.element.hyperlinks && this.element.hyperlinks.enable) {
|
||||
return "<a title='" + this.element.hyperlinks.content + "' target='" + this.element.hyperlinks.openMode + "' href='" + this.element.hyperlinks.content + "'>" + this.element.propValue + '</a>'
|
||||
return '<a title=\'' + this.element.hyperlinks.content + '\' target=\'' + this.element.hyperlinks.openMode + '\' href=\'' + this.element.hyperlinks.content + '\'>' + this.element.propValue + '</a>'
|
||||
} else {
|
||||
return this.element.propValue
|
||||
}
|
||||
|
||||
@ -381,7 +381,10 @@ export function adaptCurThemeCommonStyle(component) {
|
||||
if (isFilterComponent(component.component)) {
|
||||
const filterStyle = store.state.canvasStyleData.chartInfo.filterStyle
|
||||
for (const styleKey in filterStyle) {
|
||||
Vue.set(component.style, styleKey, filterStyle[styleKey])
|
||||
// 位置属性不修改
|
||||
if (styleKey !== 'horizontal' && styleKey !== 'vertical') {
|
||||
Vue.set(component.style, styleKey, filterStyle[styleKey])
|
||||
}
|
||||
}
|
||||
} else if (isTabComponent(component.component)) {
|
||||
const tabStyle = store.state.canvasStyleData.chartInfo.tabStyle
|
||||
|
||||
@ -411,6 +411,10 @@ export default {
|
||||
const _this = this
|
||||
_this.$nextTick(() => {
|
||||
try {
|
||||
const targetRef = _this.$refs['canvasTabRef-' + _this.activeTabName]
|
||||
if (targetRef) {
|
||||
targetRef[0].restore()
|
||||
}
|
||||
_this.$refs[this.activeTabName][0].resizeChart()
|
||||
} catch (e) {
|
||||
// ignore
|
||||
|
||||
@ -19,12 +19,14 @@
|
||||
<el-radio-group
|
||||
v-model="styleInfo.horizontal"
|
||||
size="mini"
|
||||
@change="styleChange"
|
||||
>
|
||||
<el-radio-button label="left">{{ $t('chart.text_pos_left') }}</el-radio-button>
|
||||
<el-radio-button
|
||||
:disabled="styleInfo.vertical === 'center' && elementType !== 'de-select-grid'"
|
||||
label="center"
|
||||
>{{ $t('chart.text_pos_center') }}</el-radio-button>
|
||||
>{{ $t('chart.text_pos_center') }}
|
||||
</el-radio-button>
|
||||
<el-radio-button label="right">{{ $t('chart.text_pos_right') }}</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
@ -36,12 +38,14 @@
|
||||
<el-radio-group
|
||||
v-model="styleInfo.vertical"
|
||||
size="mini"
|
||||
@change="styleChange"
|
||||
>
|
||||
<el-radio-button label="top">{{ $t('chart.text_pos_top') }}</el-radio-button>
|
||||
<el-radio-button
|
||||
:disabled="styleInfo.horizontal === 'center'"
|
||||
label="center"
|
||||
>{{ $t('chart.text_pos_center') }}</el-radio-button>
|
||||
>{{ $t('chart.text_pos_center') }}
|
||||
</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
|
||||
@ -73,6 +77,12 @@ export default {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
styleChange() {
|
||||
this.$store.commit('canvasChange')
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
5
frontend/src/icons/svg/icon_info_filled.svg
Normal file
5
frontend/src/icons/svg/icon_info_filled.svg
Normal file
@ -0,0 +1,5 @@
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M12 23C18.0751 23 23 18.0751 23 12C23 5.92487 18.0751 1 12 1C5.92487 1 1 5.92487 1 12C1 18.0751 5.92487 23 12 23Z"/>
|
||||
<path d="M12 5.5C12.6903 5.5 13.25 6.05965 13.25 6.75C13.25 7.44035 12.6903 8 12 8C11.3097 8 10.75 7.44035 10.75 6.75C10.75 6.05965 11.3097 5.5 12 5.5Z" fill="white"/>
|
||||
<path d="M12.25 9H10.75C10.4739 9 10.25 9.22386 10.25 9.5V10.5C10.25 10.7761 10.4739 11 10.75 11H11.25V16H10C9.72386 16 9.5 16.2239 9.5 16.5V17.5C9.5 17.7761 9.72386 18 10 18H14.5C14.7761 18 15 17.7761 15 17.5V16.5C15 16.2239 14.7761 16 14.5 16H13.25V10C13.25 9.44772 12.8023 9 12.25 9Z" fill="white"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 688 B |
12
frontend/src/icons/svg/icon_info_outlined.svg
Normal file
12
frontend/src/icons/svg/icon_info_outlined.svg
Normal file
@ -0,0 +1,12 @@
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||
<g clip-path="url(#clip0_3234_102287)">
|
||||
<path d="M12 5.5C12.6903 5.5 13.25 6.05965 13.25 6.75C13.25 7.44035 12.6903 8 12 8C11.3097 8 10.75 7.44035 10.75 6.75C10.75 6.05965 11.3097 5.5 12 5.5Z"/>
|
||||
<path d="M12.25 9H10.75C10.4739 9 10.25 9.22386 10.25 9.5V10.5C10.25 10.7761 10.4739 11 10.75 11H11.25V16H10C9.72386 16 9.5 16.2239 9.5 16.5V17.5C9.5 17.7761 9.72386 18 10 18H14.5C14.7761 18 15 17.7761 15 17.5V16.5C15 16.2239 14.7761 16 14.5 16H13.25V10C13.25 9.44772 12.8023 9 12.25 9Z" />
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M12 22.9998C5.925 22.9998 1 18.0748 1 11.9998C1 5.92476 5.925 0.999756 12 0.999756C18.075 0.999756 23 5.92476 23 11.9998C23 18.0748 18.075 22.9998 12 22.9998ZM12 20.9998C16.9705 20.9998 21 16.9703 21 11.9998C21 7.02926 16.9705 2.99976 12 2.99976C7.0295 2.99976 3 7.02926 3 11.9998C3 16.9703 7.0295 20.9998 12 20.9998Z"/>
|
||||
</g>
|
||||
<defs>
|
||||
<clipPath id="clip0_3234_102287">
|
||||
<rect width="24" height="24" rx="4"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.0 KiB |
@ -2316,7 +2316,13 @@ export default {
|
||||
fold: 'Fold',
|
||||
expand: 'Expand',
|
||||
pdf_export: 'PDF Export',
|
||||
switch_pdf_template: 'Switch PDF Template'
|
||||
switch_pdf_template: 'Switch PDF Template',
|
||||
pdf_template_with_params: 'Default template(with params)',
|
||||
pdf_template_only_pic: 'Default template(only screenshot)',
|
||||
panel_name: 'Panel name',
|
||||
export_user: 'Export User',
|
||||
export_time: 'Export Time',
|
||||
you_can_type_here: 'You can type here'
|
||||
},
|
||||
plugin: {
|
||||
local_install: 'Local installation',
|
||||
|
||||
@ -2310,7 +2310,13 @@ export default {
|
||||
fold: '收起',
|
||||
expand: '展開',
|
||||
pdf_export: 'PDF 導出',
|
||||
switch_pdf_template: '切換 PDF 模板'
|
||||
switch_pdf_template: '切換 PDF 模板',
|
||||
pdf_template_with_params: '默認模板(加參數樣式)',
|
||||
pdf_template_only_pic: '默認模板(只截圖)',
|
||||
panel_name: '儀錶板名稱',
|
||||
export_user: '導出用戶',
|
||||
export_time: '導出時間',
|
||||
you_can_type_here: '可以在這裡輸入其他內容'
|
||||
},
|
||||
plugin: {
|
||||
local_install: '本地安裝',
|
||||
|
||||
@ -2310,7 +2310,13 @@ export default {
|
||||
fold: '收起',
|
||||
expand: '展开',
|
||||
pdf_export: 'PDF 导出',
|
||||
switch_pdf_template: '切换 PDF 模板'
|
||||
switch_pdf_template: '切换 PDF 模板',
|
||||
pdf_template_with_params: '默认模板(加参数样式)',
|
||||
pdf_template_only_pic: '默认模板(只截图)',
|
||||
panel_name: '仪表板名称',
|
||||
export_user: '导出用户',
|
||||
export_time: '导出时间',
|
||||
you_can_type_here: '可以在这里输入其他内容'
|
||||
},
|
||||
plugin: {
|
||||
local_install: '本地安装',
|
||||
|
||||
@ -43,6 +43,12 @@ import 'video.js/dist/video-js.css'
|
||||
// 控制标签宽高成比例的指令
|
||||
import proportion from 'vue-proportion-directive'
|
||||
|
||||
import xss from 'xss'
|
||||
// 定义全局XSS解决方法
|
||||
Object.defineProperty(Vue.prototype, '$xss', {
|
||||
value: xss
|
||||
})
|
||||
|
||||
Vue.config.productionTip = false
|
||||
Vue.use(VueClipboard)
|
||||
Vue.use(widgets)
|
||||
|
||||
@ -18,9 +18,13 @@ import {
|
||||
changeFavicon
|
||||
} from '@/utils/index'
|
||||
import Layout from '@/layout/index'
|
||||
import { getSysUI } from '@/utils/auth'
|
||||
import {
|
||||
getSysUI
|
||||
} from '@/utils/auth'
|
||||
|
||||
import { getSocket } from '@/websocket'
|
||||
import {
|
||||
getSocket
|
||||
} from '@/websocket'
|
||||
|
||||
NProgress.configure({
|
||||
showSpinner: false
|
||||
@ -56,11 +60,19 @@ const routeBefore = (callBack) => {
|
||||
router.beforeEach(async (to, from, next) => routeBefore(() => {
|
||||
// start progress bar
|
||||
NProgress.start()
|
||||
const mobileIgnores = ['/delink']
|
||||
const mobileIgnores = ['/delink', '/de-auto-login']
|
||||
const mobilePreview = '/preview/'
|
||||
const hasToken = getToken()
|
||||
|
||||
if (isMobile() && !to.path.includes(mobilePreview) && mobileIgnores.indexOf(to.path) === -1) {
|
||||
window.location.href = window.origin + '/app.html'
|
||||
let urlSuffix = '/app.html'
|
||||
if (hasToken) {
|
||||
urlSuffix += ('?detoken=' + hasToken)
|
||||
}
|
||||
localStorage.removeItem('user-info')
|
||||
localStorage.removeItem('userId')
|
||||
localStorage.removeItem('Authorization')
|
||||
window.location.href = window.origin + urlSuffix
|
||||
NProgress.done()
|
||||
}
|
||||
|
||||
@ -68,7 +80,7 @@ router.beforeEach(async (to, from, next) => routeBefore(() => {
|
||||
document.title = getPageTitle(to.meta.title)
|
||||
|
||||
// determine whether the user has logged in
|
||||
const hasToken = getToken()
|
||||
|
||||
if (hasToken) {
|
||||
if (to.path === '/login') {
|
||||
// if is logged in, redirect to the home page
|
||||
@ -118,7 +130,7 @@ router.beforeEach(async (to, from, next) => routeBefore(() => {
|
||||
next()
|
||||
} else {
|
||||
// other pages that do not have permission to access are redirected to the login page.
|
||||
next(`/login?redirect=${to.path}`)
|
||||
next(`/login?redirect=${to.fullPath}`)
|
||||
NProgress.done()
|
||||
}
|
||||
}
|
||||
|
||||
@ -13,6 +13,7 @@ const getDefaultState = () => {
|
||||
name: '',
|
||||
user: {},
|
||||
roles: [],
|
||||
passwordModified: true,
|
||||
avatar: '',
|
||||
// 第一次加载菜单时用到
|
||||
loadMenus: false,
|
||||
@ -66,7 +67,10 @@ const mutations = {
|
||||
if (language && i18n.locale !== language) {
|
||||
i18n.locale = language
|
||||
}
|
||||
}
|
||||
},
|
||||
SET_PASSWORD_MODIFIED: (state, passwordModified) => {
|
||||
state.passwordModified = passwordModified
|
||||
},
|
||||
}
|
||||
|
||||
const actions = {
|
||||
@ -79,6 +83,12 @@ const actions = {
|
||||
commit('SET_TOKEN', data.token)
|
||||
commit('SET_LOGIN_MSG', null)
|
||||
setToken(data.token)
|
||||
let passwordModified = true
|
||||
if (data.hasOwnProperty('passwordModified')) {
|
||||
passwordModified = data.passwordModified
|
||||
}
|
||||
commit('SET_PASSWORD_MODIFIED', passwordModified)
|
||||
localStorage.setItem('passwordModified', passwordModified)
|
||||
resolve()
|
||||
}).catch(error => {
|
||||
reject(error)
|
||||
|
||||
@ -828,8 +828,12 @@ div:focus {
|
||||
color: #1F2329 !important;
|
||||
}
|
||||
|
||||
.de-select-grid-class {
|
||||
.el-checkbox__input.is-checked:not(.is-disabled)+.el-checkbox__label {
|
||||
.el-radio__input.is-checked:not(.is-disabled)+.el-radio__label {
|
||||
color: var(--deTextPrimary, #1F2329) !important;
|
||||
}
|
||||
|
||||
.de-select-grid-class{
|
||||
.el-checkbox__input.is-checked:not(.is-disabled)+.el-checkbox__label, .el-radio__input.is-checked:not(.is-disabled)+.el-radio__label {
|
||||
color: #3370ff !important;
|
||||
}
|
||||
}
|
||||
@ -1176,9 +1180,6 @@ div:focus {
|
||||
color: var(--deTextPrimary, #1F2329) !important;
|
||||
}
|
||||
|
||||
.el-radio__input.is-checked:not(.is-disabled)+.el-radio__label {
|
||||
color: var(--deTextPrimary, #1F2329) !important;
|
||||
}
|
||||
|
||||
.date-filter-poper>.el-scrollbar>.el-select-dropdown__wrap {
|
||||
max-height: 230px !important;
|
||||
@ -1759,4 +1760,10 @@ div:focus {
|
||||
|
||||
.el-table__fixed-right::before {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.auth-tab {
|
||||
.custom-tree-node {
|
||||
padding-right: 0 !important;
|
||||
}
|
||||
}
|
||||
@ -1,3 +1,5 @@
|
||||
import i18n from '@/lang'
|
||||
|
||||
// 替换所有 标准模板格式 为 $panelName$
|
||||
export function pdfTemplateReplaceAll(content, source, target) {
|
||||
const pattern = '\\$' + source + '\\$'
|
||||
@ -37,3 +39,20 @@ export function includesAny(target, ...sources) {
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// 替换字符串中的国际化内容, 格式为$t('xxx')
|
||||
export function replaceInlineI18n(rawString) {
|
||||
const res = []
|
||||
const reg = /\$t\('([\w.]+)'\)/gm
|
||||
let tmp
|
||||
if (!rawString) {
|
||||
return res
|
||||
}
|
||||
while ((tmp = reg.exec(rawString)) !== null) {
|
||||
res.push(tmp)
|
||||
}
|
||||
res.forEach((tmp) => {
|
||||
rawString = rawString.replaceAll(tmp[0], i18n.t(tmp[1]))
|
||||
})
|
||||
return rawString
|
||||
}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import axios from 'axios'
|
||||
import store from '@/store'
|
||||
import { $alert, $error } from './message'
|
||||
import { getToken, getIdToken } from '@/utils/auth'
|
||||
import { getToken, getIdToken, setToken } from '@/utils/auth'
|
||||
import Config from '@/settings'
|
||||
import i18n from '@/lang'
|
||||
import { tryShowLoading, tryHideLoading } from './loading'
|
||||
@ -157,6 +157,7 @@ const checkAuth = response => {
|
||||
// token到期后自动续命 刷新token
|
||||
if (response.headers[RefreshTokenKey]) {
|
||||
const refreshToken = response.headers[RefreshTokenKey]
|
||||
setToken(refreshToken)
|
||||
store.dispatch('user/refreshToken', refreshToken)
|
||||
}
|
||||
|
||||
|
||||
@ -179,13 +179,13 @@
|
||||
:span="5"
|
||||
style="padding-left: 10px;padding-top: 8px"
|
||||
>
|
||||
输入框样式(颜色):
|
||||
{{ $t('panel.input_style') }}:
|
||||
</el-col>
|
||||
<el-col
|
||||
:span="2"
|
||||
style="padding-left: 10px;padding-top: 8px"
|
||||
>
|
||||
边框
|
||||
{{ $t('panel.board') }}
|
||||
</el-col>
|
||||
<el-col
|
||||
:span="3"
|
||||
@ -202,7 +202,7 @@
|
||||
:span="2"
|
||||
style="padding-left: 10px;padding-top: 8px"
|
||||
>
|
||||
文字
|
||||
{{ $t('panel.text') }}
|
||||
</el-col>
|
||||
<el-col
|
||||
:span="3"
|
||||
@ -219,7 +219,7 @@
|
||||
:span="2"
|
||||
style="padding-left: 10px;padding-top: 8px"
|
||||
>
|
||||
背景
|
||||
{{ $t('panel.background') }}
|
||||
</el-col>
|
||||
<el-col
|
||||
:span="3"
|
||||
|
||||
@ -67,8 +67,8 @@
|
||||
>
|
||||
{{ $t('chart.total') }}
|
||||
<span>{{
|
||||
(chart.datasetMode === 0 && !not_support_page_dataset.includes(chart.datasourceType)) ? chart.totalItems : ((chart.data && chart.data.tableRow) ? chart.data.tableRow.length : 0)
|
||||
}}</span>
|
||||
(chart.datasetMode === 0 && !not_support_page_dataset.includes(chart.datasourceType)) ? chart.totalItems : ((chart.data && chart.data.tableRow) ? chart.data.tableRow.length : 0)
|
||||
}}</span>
|
||||
{{ $t('chart.items') }}
|
||||
</span>
|
||||
<de-pagination
|
||||
@ -339,7 +339,7 @@ export default {
|
||||
if (this.chart.type === 'table-pivot') {
|
||||
rowData = { ...meta.rowQuery, ...meta.colQuery }
|
||||
rowData[meta.valueField] = meta.fieldValue
|
||||
} else if (this.showPage) {
|
||||
} else if (this.showPage && (this.chart.datasetMode === 1 || (this.chart.datasetMode === 0 && this.not_support_page_dataset.includes(this.chart.datasourceType)))) {
|
||||
const rowIndex = (this.currentPage.page - 1) * this.currentPage.pageSize + meta.rowIndex
|
||||
rowData = this.chart.data.tableRow[rowIndex]
|
||||
} else {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
:content="$t('chart.field_error_tips')"
|
||||
placement="bottom"
|
||||
>
|
||||
<span><i class="el-icon-warning" /></span>
|
||||
<span><svg-icon icon-class="icon_info_filled" /></span>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -393,7 +393,6 @@ export default {
|
||||
},
|
||||
getItemTagType() {
|
||||
this.$refs['markForm'].validate((valid) => {
|
||||
console.log(valid)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@ -28,11 +28,7 @@
|
||||
:data="view"
|
||||
:tab-status="tabStatus"
|
||||
/>
|
||||
<i
|
||||
slot="reference"
|
||||
class="el-icon-warning icon-class"
|
||||
style="position:absolute; margin-left: 30px; top:14px;cursor: pointer;"
|
||||
/>
|
||||
<svg-icon slot="reference" class="icon-class" style="position:absolute; margin-left: 30px; top:14px;cursor: pointer;" icon-class="icon_info_filled" />
|
||||
</el-popover>
|
||||
<span
|
||||
class="title-text view-title-name"
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
class="title-text"
|
||||
>
|
||||
<span style="line-height: 26px;">
|
||||
{{ param.tableId?$t('dataset.edit_custom_table'):$t('dataset.add_custom_table') }}
|
||||
{{ param.tableId ? $t('dataset.edit_custom_table') : $t('dataset.add_custom_table') }}
|
||||
</span>
|
||||
<el-row style="float: right">
|
||||
<el-button
|
||||
@ -24,7 +24,7 @@
|
||||
</el-button>
|
||||
</el-row>
|
||||
</el-row>
|
||||
<el-divider />
|
||||
<el-divider/>
|
||||
<el-row>
|
||||
<el-form :inline="true">
|
||||
<el-form-item
|
||||
@ -105,9 +105,10 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { post, getTable } from '@/api/dataset/dataset'
|
||||
import { getTable, post } from '@/api/dataset/dataset'
|
||||
import DatasetGroupSelector from '../common/DatasetGroupSelector'
|
||||
import DatasetCustomField from '../common/DatasetCustomField'
|
||||
import { updateCacheTree } from '@/components/canvas/utils/utils'
|
||||
|
||||
export default {
|
||||
name: 'AddCustom',
|
||||
@ -252,6 +253,12 @@ export default {
|
||||
}
|
||||
post('/dataset/table/update', table).then(response => {
|
||||
// this.$store.dispatch('dataset/setSceneData', new Date().getTime())
|
||||
if (table.id) {
|
||||
const renameNode = { id: table.id, name: table.name, label: table.name }
|
||||
updateCacheTree('rename', 'dataset-tree', renameNode, JSON.parse(localStorage.getItem('dataset-tree')))
|
||||
} else {
|
||||
updateCacheTree('batchNew', 'dataset-tree', response.data, JSON.parse(localStorage.getItem('dataset-tree')))
|
||||
}
|
||||
this.$emit('saveSuccess', table)
|
||||
this.cancel()
|
||||
})
|
||||
@ -296,49 +303,50 @@ export default {
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-divider--horizontal {
|
||||
margin: 12px 0;
|
||||
}
|
||||
.el-divider--horizontal {
|
||||
margin: 12px 0;
|
||||
}
|
||||
|
||||
.form-item {
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
.form-item {
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
|
||||
.el-checkbox {
|
||||
margin-bottom: 14px;
|
||||
margin-left: 0;
|
||||
margin-right: 14px;
|
||||
}
|
||||
.el-checkbox {
|
||||
margin-bottom: 14px;
|
||||
margin-left: 0;
|
||||
margin-right: 14px;
|
||||
}
|
||||
|
||||
.el-checkbox.is-bordered + .el-checkbox.is-bordered {
|
||||
margin-left: 0;
|
||||
}
|
||||
.el-checkbox.is-bordered + .el-checkbox.is-bordered {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.dataPreview ::v-deep .el-card__header{
|
||||
padding: 0 8px 12px;
|
||||
}
|
||||
.dataPreview ::v-deep .el-card__header {
|
||||
padding: 0 8px 12px;
|
||||
}
|
||||
|
||||
.dataPreview ::v-deep .el-card__body{
|
||||
padding:10px;
|
||||
}
|
||||
.dataPreview ::v-deep .el-card__body {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
span{
|
||||
font-size: 14px;
|
||||
}
|
||||
span {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.panel-height{
|
||||
height: calc(100vh - 56px - 15px - 26px - 25px - 43px);
|
||||
}
|
||||
.panel-height {
|
||||
height: calc(100vh - 56px - 15px - 26px - 25px - 43px);
|
||||
}
|
||||
|
||||
.blackTheme .panel-height{
|
||||
height: calc(100vh - 56px - 15px - 26px - 25px - 43px);
|
||||
border-color: var(--TableBorderColor) !important;
|
||||
}
|
||||
.blackTheme .panel-height {
|
||||
height: calc(100vh - 56px - 15px - 26px - 25px - 43px);
|
||||
border-color: var(--TableBorderColor) !important;
|
||||
}
|
||||
|
||||
.span-number{
|
||||
color: #0a7be0;
|
||||
}
|
||||
.table-count{
|
||||
color: #606266;
|
||||
}
|
||||
.span-number {
|
||||
color: #0a7be0;
|
||||
}
|
||||
|
||||
.table-count {
|
||||
color: #606266;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
class="arrow-right"
|
||||
@click="showLeft = true"
|
||||
>
|
||||
<i class="el-icon-d-arrow-right" />
|
||||
<i class="el-icon-d-arrow-right"/>
|
||||
</p>
|
||||
<div
|
||||
v-show="showLeft"
|
||||
@ -21,16 +21,16 @@
|
||||
effect="dark"
|
||||
placement="right"
|
||||
>
|
||||
<div slot="content">
|
||||
{{ $t('dataset.excel_info_1') }}<br>
|
||||
{{ $t('dataset.excel_info_2') }}<br>
|
||||
{{ $t('dataset.excel_info_3') }}
|
||||
</div>
|
||||
<i class="el-icon-warning-outline" /> </el-tooltip></span>
|
||||
<i
|
||||
class="el-icon-d-arrow-left"
|
||||
@click="showLeft = false"
|
||||
/>
|
||||
<div slot="content">
|
||||
{{ $t('dataset.excel_info_1') }}<br>
|
||||
{{ $t('dataset.excel_info_2') }}<br>
|
||||
{{ $t('dataset.excel_info_3') }}
|
||||
</div>
|
||||
<svg-icon icon-class="icon_info_outlined" /></el-tooltip></span>
|
||||
<i
|
||||
class="el-icon-d-arrow-left"
|
||||
@click="showLeft = false"
|
||||
/>
|
||||
</p>
|
||||
<el-upload
|
||||
:action="baseUrl + 'dataset/table/excel/upload'"
|
||||
@ -160,7 +160,7 @@
|
||||
:key="field.fieldName + field.fieldType"
|
||||
@command="(type) => handleCommand(type, field)"
|
||||
>
|
||||
<span class="type-switch">
|
||||
<span class="type-switch">
|
||||
<svg-icon
|
||||
v-if="field.fieldType === 'TEXT'"
|
||||
icon-class="field_text"
|
||||
@ -179,7 +179,7 @@
|
||||
icon-class="field_value"
|
||||
class="field-icon-value"
|
||||
/>
|
||||
<i class="el-icon-arrow-down el-icon--right" /></span>
|
||||
<i class="el-icon-arrow-down el-icon--right"/></span>
|
||||
<el-dropdown-menu
|
||||
slot="dropdown"
|
||||
style="width: 178px"
|
||||
@ -237,8 +237,11 @@ import { $alert } from '@/utils/message'
|
||||
import store from '@/store'
|
||||
import msgCfm from '@/components/msgCfm/index'
|
||||
import cancelMix from './cancelMix'
|
||||
import Config from "@/settings";
|
||||
import { updateCacheTree } from '@/components/canvas/utils/utils'
|
||||
|
||||
const token = getToken()
|
||||
const RefreshTokenKey = Config.RefreshTokenKey
|
||||
|
||||
export default {
|
||||
name: 'AddExcel',
|
||||
@ -453,6 +456,12 @@ export default {
|
||||
this.$refs.tree.setCheckedKeys(this.defaultCheckedKeys)
|
||||
})
|
||||
this.fileList = fileList
|
||||
|
||||
if (response.headers[RefreshTokenKey]) {
|
||||
const refreshToken = response.headers[RefreshTokenKey]
|
||||
setToken(refreshToken)
|
||||
store.dispatch('user/refreshToken', refreshToken)
|
||||
}
|
||||
},
|
||||
|
||||
save() {
|
||||
@ -569,6 +578,9 @@ export default {
|
||||
table.mergeSheet = false
|
||||
post('/dataset/table/update', table)
|
||||
.then((response) => {
|
||||
if (!table.id) {
|
||||
updateCacheTree('batchNew', 'dataset-tree', response.data, JSON.parse(localStorage.getItem('dataset-tree')))
|
||||
}
|
||||
this.openMessageSuccess('deDataset.set_saved_successfully')
|
||||
this.cancel(response.data)
|
||||
})
|
||||
@ -582,6 +594,9 @@ export default {
|
||||
this.loading = true
|
||||
post('/dataset/table/update', table)
|
||||
.then((response) => {
|
||||
if (!table.id) {
|
||||
updateCacheTree('batchNew', 'dataset-tree', response.data, JSON.parse(localStorage.getItem('dataset-tree')))
|
||||
}
|
||||
this.openMessageSuccess('deDataset.set_saved_successfully')
|
||||
this.cancel(response.data)
|
||||
})
|
||||
@ -637,10 +652,12 @@ export default {
|
||||
border-top-right-radius: 13px;
|
||||
border-bottom-right-radius: 13px;
|
||||
}
|
||||
|
||||
.table-list {
|
||||
p {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
height: 100%;
|
||||
width: 240px;
|
||||
padding: 16px 12px;
|
||||
@ -653,6 +670,7 @@ export default {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
color: var(--deTextPrimary, #1f2329);
|
||||
|
||||
i {
|
||||
font-size: 14px;
|
||||
color: var(--deTextPlaceholder, #8f959e);
|
||||
@ -666,10 +684,12 @@ export default {
|
||||
.table-checkbox-list {
|
||||
height: calc(100% - 100px);
|
||||
overflow-y: auto;
|
||||
|
||||
.custom-tree-node {
|
||||
position: relative;
|
||||
width: 80%;
|
||||
display: flex;
|
||||
|
||||
.label {
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
@ -677,11 +697,13 @@ export default {
|
||||
width: 85%;
|
||||
}
|
||||
}
|
||||
|
||||
.error-name-exist {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.item {
|
||||
height: 40px;
|
||||
width: 215px;
|
||||
@ -719,6 +741,7 @@ export default {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
|
||||
.name {
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
@ -749,10 +772,12 @@ export default {
|
||||
padding: 2px 1.5px;
|
||||
display: inline-block;
|
||||
cursor: pointer;
|
||||
|
||||
i {
|
||||
margin-left: 4px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
background: rgba(31, 35, 41, 0.1);
|
||||
border-radius: 4px;
|
||||
|
||||
@ -70,7 +70,7 @@
|
||||
class="de-text-btn"
|
||||
@click="dataReference = true"
|
||||
>
|
||||
<svg-icon icon-class="data-reference" />
|
||||
<svg-icon icon-class="data-reference"/>
|
||||
{{ $t('deDataset.data_reference') }}
|
||||
</el-button>
|
||||
<el-button
|
||||
@ -80,17 +80,17 @@
|
||||
class="de-text-btn"
|
||||
@click="variableMgm"
|
||||
>
|
||||
<svg-icon icon-class="reference-setting" />
|
||||
<svg-icon icon-class="reference-setting"/>
|
||||
{{ $t('sql_variable.variable_mgm') }}
|
||||
</el-button>
|
||||
<el-divider direction="vertical" />
|
||||
<el-divider direction="vertical"/>
|
||||
<el-button
|
||||
class="de-text-btn"
|
||||
type="text"
|
||||
size="small"
|
||||
@click="getSQLPreview"
|
||||
>
|
||||
<svg-icon icon-class="reference-play" />
|
||||
<svg-icon icon-class="reference-play"/>
|
||||
{{ $t('deDataset.run_a_query') }}
|
||||
</el-button>
|
||||
</el-col>
|
||||
@ -111,7 +111,7 @@
|
||||
dataTable = ''
|
||||
;keywords = ''
|
||||
"
|
||||
><i class="el-icon-arrow-left" /> {{ $t('chart.back') }}</span>
|
||||
><i class="el-icon-arrow-left"/> {{ $t('chart.back') }}</span>
|
||||
<span v-else>{{ $t('deDataset.data_reference') }}</span>
|
||||
<i
|
||||
style="cursor: pointer"
|
||||
@ -131,7 +131,7 @@
|
||||
:title="(showTable && dataTable) || selectedDatasource.name"
|
||||
class="grey-name"
|
||||
>
|
||||
<svg-icon icon-class="db-de" />
|
||||
<svg-icon icon-class="db-de"/>
|
||||
{{ (showTable && dataTable) || selectedDatasource.name }}
|
||||
</span>
|
||||
<span class="grey">
|
||||
@ -146,59 +146,61 @@
|
||||
v-if="!dataSource"
|
||||
class="no-select-datasource"
|
||||
>{{
|
||||
$t('deDataset.to_start_using')
|
||||
}}</span>
|
||||
$t('deDataset.to_start_using')
|
||||
}}</span>
|
||||
<template v-else>
|
||||
<el-input :placeholder="$t('fu.search_bar.please_input')" style="padding: 5px" size="small" v-model="keywords"></el-input>
|
||||
<el-input :placeholder="$t('fu.search_bar.please_input')" style="padding: 5px" size="small"
|
||||
v-model="keywords"
|
||||
></el-input>
|
||||
<div
|
||||
v-if="dataSource && !dataTable"
|
||||
v-loading="tableLoading"
|
||||
class="item-list"
|
||||
>
|
||||
<div
|
||||
v-for="ele in tableDataCopy"
|
||||
:key="ele.name"
|
||||
class="table-or-field"
|
||||
@click="typeSwitch(ele)"
|
||||
v-if="dataSource && !dataTable"
|
||||
v-loading="tableLoading"
|
||||
class="item-list"
|
||||
>
|
||||
<div
|
||||
v-for="ele in tableDataCopy"
|
||||
:key="ele.name"
|
||||
class="table-or-field"
|
||||
@click="typeSwitch(ele)"
|
||||
>
|
||||
<span
|
||||
:title="ele.remark"
|
||||
class="name"
|
||||
>{{ ele.name }}</span>
|
||||
<i
|
||||
v-clipboard:copy="ele.name"
|
||||
v-clipboard:success="onCopy"
|
||||
v-clipboard:error="onError"
|
||||
class="el-icon-document-copy"
|
||||
@click.stop
|
||||
/>
|
||||
<i
|
||||
v-clipboard:copy="ele.name"
|
||||
v-clipboard:success="onCopy"
|
||||
v-clipboard:error="onError"
|
||||
class="el-icon-document-copy"
|
||||
@click.stop
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
v-else-if="dataSource && dataTable"
|
||||
v-loading="tableLoading"
|
||||
class="item-list"
|
||||
>
|
||||
<div
|
||||
v-for="ele in fieldDataCopy"
|
||||
:key="ele.fieldName"
|
||||
class="table-or-field field"
|
||||
v-else-if="dataSource && dataTable"
|
||||
v-loading="tableLoading"
|
||||
class="item-list"
|
||||
>
|
||||
<div
|
||||
v-for="ele in fieldDataCopy"
|
||||
:key="ele.fieldName"
|
||||
class="table-or-field field"
|
||||
>
|
||||
<span
|
||||
:title="ele.remarks"
|
||||
class="name"
|
||||
>{{ ele.fieldName }}</span>
|
||||
<i
|
||||
v-clipboard:copy="ele.fieldName"
|
||||
v-clipboard:success="onCopy"
|
||||
v-clipboard:error="onError"
|
||||
class="el-icon-document-copy"
|
||||
@click.stop
|
||||
/>
|
||||
<i
|
||||
v-clipboard:copy="ele.fieldName"
|
||||
v-clipboard:success="onCopy"
|
||||
v-clipboard:error="onError"
|
||||
class="el-icon-document-copy"
|
||||
@click.stop
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="sql-table">
|
||||
<div
|
||||
@ -229,10 +231,10 @@
|
||||
v-if="tabActive === 'result'"
|
||||
class="result-num"
|
||||
>{{
|
||||
`(${$t('dataset.preview_show')} 1000 ${$t(
|
||||
'dataset.preview_item'
|
||||
)})`
|
||||
}}</span>
|
||||
`(${$t('dataset.preview_show')} 1000 ${$t(
|
||||
'dataset.preview_item'
|
||||
)})`
|
||||
}}</span>
|
||||
|
||||
<span
|
||||
class="drag"
|
||||
@ -269,7 +271,8 @@
|
||||
:image-size="60"
|
||||
:image="errImg"
|
||||
:description="$t('deDataset.run_failed')"
|
||||
>{{ errMsgCont }}</el-empty>
|
||||
>{{ errMsgCont }}
|
||||
</el-empty>
|
||||
<el-table
|
||||
v-else
|
||||
:data="plxTableData"
|
||||
@ -365,7 +368,7 @@
|
||||
direction="rtl"
|
||||
>
|
||||
<div class="content">
|
||||
<i class="el-icon-info" />
|
||||
<i class="el-icon-info"/>
|
||||
{{ $t('dataset.sql_variable_limit_1') }}<br>
|
||||
{{ $t('dataset.sql_variable_limit_2') }}<br>
|
||||
</div>
|
||||
@ -451,7 +454,7 @@
|
||||
:content="$t('commons.parameter_effect')"
|
||||
placement="top"
|
||||
>
|
||||
<i class="el-icon-warning" />
|
||||
<svg-icon icon-class="icon_info_filled" />
|
||||
</el-tooltip>
|
||||
</template>
|
||||
<template slot-scope="scope">
|
||||
@ -519,14 +522,16 @@
|
||||
secondary
|
||||
@click="closeVariableMgm"
|
||||
>{{
|
||||
$t('dataset.cancel')
|
||||
}}</deBtn>
|
||||
$t('dataset.cancel')
|
||||
}}
|
||||
</deBtn>
|
||||
<deBtn
|
||||
type="primary"
|
||||
@click="saveVariable()"
|
||||
>{{
|
||||
$t('dataset.confirm')
|
||||
}}</deBtn>
|
||||
$t('dataset.confirm')
|
||||
}}
|
||||
</deBtn>
|
||||
</div>
|
||||
</el-drawer>
|
||||
</div>
|
||||
@ -536,9 +541,8 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { post, listDatasource, isKettleRunning } from '@/api/dataset/dataset'
|
||||
import { getTable, isKettleRunning, listDatasource, post } from '@/api/dataset/dataset'
|
||||
import { codemirror } from 'vue-codemirror'
|
||||
import { getTable } from '@/api/dataset/dataset'
|
||||
import { Base64 } from 'js-base64'
|
||||
// 核心样式
|
||||
import 'codemirror/lib/codemirror.css'
|
||||
@ -568,6 +572,8 @@ import cancelMix from './cancelMix'
|
||||
import { pySort } from './util'
|
||||
import _ from 'lodash'
|
||||
import GridTable from '@/components/gridTable/index.vue'
|
||||
import { updateCacheTree } from '@/components/canvas/utils/utils'
|
||||
|
||||
export default {
|
||||
name: 'AddSQL',
|
||||
components: { codemirror, GridTable },
|
||||
@ -575,7 +581,8 @@ export default {
|
||||
props: {
|
||||
param: {
|
||||
type: Object,
|
||||
default: () => {}
|
||||
default: () => {
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@ -762,7 +769,7 @@ export default {
|
||||
this.fieldData = res.data
|
||||
this.fieldDataCopy = this.arrSort([...this.fieldData])
|
||||
})
|
||||
.finally(() => {
|
||||
.finally(() => {
|
||||
this.tableLoading = false
|
||||
})
|
||||
},
|
||||
@ -827,8 +834,8 @@ export default {
|
||||
},
|
||||
arrSort(arr = [], field = 'fieldName') {
|
||||
arr.sort((a, b) => {
|
||||
return a[field][0].toLowerCase().charCodeAt() - b[field][0].toLowerCase().charCodeAt()
|
||||
})
|
||||
return a[field][0].toLowerCase().charCodeAt() - b[field][0].toLowerCase().charCodeAt()
|
||||
})
|
||||
|
||||
return arr
|
||||
},
|
||||
@ -923,16 +930,17 @@ export default {
|
||||
listSqlLog() {
|
||||
post(
|
||||
'/dataset/table/sqlLog/' +
|
||||
this.paginationConfig.currentPage +
|
||||
'/' +
|
||||
this.paginationConfig.pageSize,
|
||||
this.paginationConfig.currentPage +
|
||||
'/' +
|
||||
this.paginationConfig.pageSize,
|
||||
{ id: this.param.tableId, dataSourceId: this.dataSource }
|
||||
)
|
||||
.then((response) => {
|
||||
this.sqlData = response.data.listObject
|
||||
this.paginationConfig.total = response.data.itemCount
|
||||
})
|
||||
.catch(() => {})
|
||||
.catch(() => {
|
||||
})
|
||||
},
|
||||
save() {
|
||||
if (!this.dataSource || this.datasource === '') {
|
||||
@ -965,6 +973,12 @@ export default {
|
||||
}
|
||||
post('/dataset/table/update', table)
|
||||
.then((response) => {
|
||||
if (table.id) {
|
||||
const renameNode = { id: table.id, name: table.name, label: table.name }
|
||||
updateCacheTree('rename', 'dataset-tree', renameNode, JSON.parse(localStorage.getItem('dataset-tree')))
|
||||
} else {
|
||||
updateCacheTree('batchNew', 'dataset-tree', response.data, JSON.parse(localStorage.getItem('dataset-tree')))
|
||||
}
|
||||
this.openMessageSuccess('deDataset.set_saved_successfully')
|
||||
this.cancel(response.data)
|
||||
})
|
||||
@ -975,14 +989,16 @@ export default {
|
||||
onCopy(e) {
|
||||
this.openMessageSuccess('commons.copy_success')
|
||||
},
|
||||
onError(e) {},
|
||||
onError(e) {
|
||||
},
|
||||
showSQL(val) {
|
||||
this.sql = val || ''
|
||||
},
|
||||
onCmReady(cm) {
|
||||
this.codemirror.setSize('-webkit-fill-available', 'auto')
|
||||
},
|
||||
onCmFocus(cm) {},
|
||||
onCmFocus(cm) {
|
||||
},
|
||||
onCmCodeChange(newCode) {
|
||||
this.sql = newCode
|
||||
this.$emit('codeChange', this.sql)
|
||||
@ -1068,6 +1084,7 @@ export default {
|
||||
|
||||
.select-type {
|
||||
width: 180px;
|
||||
|
||||
.el-input__inner {
|
||||
padding-left: 32px;
|
||||
}
|
||||
@ -1079,6 +1096,7 @@ export default {
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
|
||||
.content {
|
||||
height: 62px;
|
||||
width: 822px;
|
||||
@ -1097,14 +1115,17 @@ export default {
|
||||
font-size: 14px;
|
||||
color: var(--primary, #3370ff);
|
||||
}
|
||||
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
.dataset-sql {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.sql-editer {
|
||||
background: #f5f6f7;
|
||||
padding: 16px 24px;
|
||||
@ -1115,11 +1136,13 @@ export default {
|
||||
display: flex;
|
||||
flex-direction: row-reverse;
|
||||
overflow: hidden;
|
||||
|
||||
.data-reference {
|
||||
width: 280px;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
border-left: 1px solid var(--deCardStrokeColor, #dee0e3);
|
||||
|
||||
.no-select-datasource {
|
||||
font-family: PingFang SC;
|
||||
font-size: 14px;
|
||||
@ -1129,6 +1152,7 @@ export default {
|
||||
width: 100%;
|
||||
padding: 16px 12px;
|
||||
}
|
||||
|
||||
.table-database-name {
|
||||
font-family: PingFang SC;
|
||||
font-size: 16px;
|
||||
@ -1136,6 +1160,7 @@ export default {
|
||||
color: var(--deTextPrimary, #1f2329);
|
||||
padding: 16px 12px;
|
||||
border-bottom: 1px solid var(--deCardStrokeColor, #dee0e3);
|
||||
|
||||
p {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@ -1161,6 +1186,7 @@ export default {
|
||||
padding: 16px 8px;
|
||||
height: calc(100vh - 242px);
|
||||
overflow: auto;
|
||||
|
||||
.table-or-field {
|
||||
height: 40px;
|
||||
width: 100%;
|
||||
@ -1203,34 +1229,40 @@ export default {
|
||||
i {
|
||||
display: block;
|
||||
}
|
||||
|
||||
background: rgba(31, 35, 41, 0.1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.sql-table {
|
||||
flex: 1;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
|
||||
.code-container {
|
||||
background: #f5f6f7;
|
||||
box-sizing: border-box;
|
||||
min-height: 248px;
|
||||
color: var(--deTextPrimary, #1f2329);
|
||||
|
||||
.CodeMirror {
|
||||
height: 100% !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.sql-result {
|
||||
font-family: PingFang SC;
|
||||
font-size: 14px;
|
||||
overflow-y: auto;
|
||||
box-sizing: border-box;
|
||||
flex: 1;
|
||||
|
||||
.sql-title {
|
||||
user-select: none;
|
||||
height: 54px;
|
||||
@ -1247,6 +1279,7 @@ export default {
|
||||
color: var(--deTextSecondary, #646a73);
|
||||
margin-left: 12px;
|
||||
}
|
||||
|
||||
.drag {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
@ -1271,6 +1304,7 @@ export default {
|
||||
padding: 0 25px 18px 25px;
|
||||
overflow-y: auto;
|
||||
box-sizing: border-box;
|
||||
|
||||
.el-empty__bottom,
|
||||
.el-empty__description p {
|
||||
font-family: PingFang SC;
|
||||
@ -1281,16 +1315,20 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.table-container {
|
||||
height: calc(100% - 125px);
|
||||
padding: 0 24px;
|
||||
|
||||
.mar6 {
|
||||
margin-right: 6px;
|
||||
}
|
||||
|
||||
.mar3 {
|
||||
margin-left: -3px;
|
||||
}
|
||||
}
|
||||
|
||||
.table-container-filter {
|
||||
height: calc(100% - 110px);
|
||||
}
|
||||
|
||||
@ -53,8 +53,8 @@
|
||||
<div class="sql-title">
|
||||
{{ $t('deDataset.data_preview') }}
|
||||
<span class="result-num">{{
|
||||
`(${$t('dataset.preview_show')} 1000 ${$t('dataset.preview_item')})`
|
||||
}}</span>
|
||||
`(${$t('dataset.preview_show')} 1000 ${$t('dataset.preview_item')})`
|
||||
}}</span>
|
||||
<span
|
||||
class="drag"
|
||||
@mousedown="mousedownDrag"
|
||||
@ -96,13 +96,15 @@
|
||||
secondary
|
||||
@click="closeSelectDs()"
|
||||
>{{
|
||||
$t('dataset.cancel')
|
||||
}}</deBtn>
|
||||
$t('dataset.cancel')
|
||||
}}
|
||||
</deBtn>
|
||||
<deBtn
|
||||
:disabled="!tempDs.id"
|
||||
type="primary"
|
||||
@click="confirmSelectDs()"
|
||||
>{{ $t('dataset.confirm') }}</deBtn>
|
||||
>{{ $t('dataset.confirm') }}
|
||||
</deBtn>
|
||||
</div>
|
||||
</el-drawer>
|
||||
|
||||
@ -120,20 +122,22 @@
|
||||
size="840px"
|
||||
direction="rtl"
|
||||
>
|
||||
<union-edit :union-param="unionParam" />
|
||||
<union-edit :union-param="unionParam"/>
|
||||
<div class="de-foot">
|
||||
<deBtn
|
||||
secondary
|
||||
@click="closeEditUnion()"
|
||||
>{{
|
||||
$t('dataset.cancel')
|
||||
}}</deBtn>
|
||||
$t('dataset.cancel')
|
||||
}}
|
||||
</deBtn>
|
||||
<deBtn
|
||||
type="primary"
|
||||
@click="confirmEditUnion()"
|
||||
>{{
|
||||
$t('dataset.confirm')
|
||||
}}</deBtn>
|
||||
$t('dataset.confirm')
|
||||
}}
|
||||
</deBtn>
|
||||
</div>
|
||||
</el-drawer>
|
||||
</div>
|
||||
@ -148,6 +152,8 @@ import { post } from '@/api/dataset/dataset'
|
||||
import UnionPreview from '@/views/dataset/add/union/UnionPreview'
|
||||
import cancelMix from './cancelMix'
|
||||
import msgCfm from '@/components/msgCfm/index'
|
||||
import { updateCacheTree } from '@/components/canvas/utils/utils'
|
||||
|
||||
export default {
|
||||
name: 'AddUnion',
|
||||
components: {
|
||||
@ -267,6 +273,12 @@ export default {
|
||||
}
|
||||
post('/dataset/table/update', table)
|
||||
.then((response) => {
|
||||
if (table.id) {
|
||||
const renameNode = { id: table.id, name: table.name, label: table.name }
|
||||
updateCacheTree('rename', 'dataset-tree', renameNode, JSON.parse(localStorage.getItem('dataset-tree')))
|
||||
} else {
|
||||
updateCacheTree('batchNew', 'dataset-tree', response.data, JSON.parse(localStorage.getItem('dataset-tree')))
|
||||
}
|
||||
this.$emit('saveSuccess', table)
|
||||
this.cancel(response.data)
|
||||
})
|
||||
@ -413,6 +425,7 @@ export default {
|
||||
overflow-y: auto;
|
||||
box-sizing: border-box;
|
||||
flex: 1;
|
||||
|
||||
.sql-title {
|
||||
user-select: none;
|
||||
height: 54px;
|
||||
@ -437,6 +450,7 @@ export default {
|
||||
color: var(--deTextSecondary, #646a73);
|
||||
margin-left: 12px;
|
||||
}
|
||||
|
||||
.drag {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
|
||||
@ -48,10 +48,7 @@
|
||||
:data="table"
|
||||
:tab-status="tabStatus"
|
||||
/>
|
||||
<i
|
||||
slot="reference"
|
||||
class="el-icon-warning-outline detail"
|
||||
/>
|
||||
<svg-icon slot="reference" class="detail" icon-class="icon_info_outlined" />
|
||||
</el-popover>
|
||||
</el-col>
|
||||
<el-col
|
||||
|
||||
@ -39,7 +39,7 @@
|
||||
import JsPDF from 'jspdf'
|
||||
import html2canvas from 'html2canvasde'
|
||||
import { formatTimeToStr } from './date.js'
|
||||
import { pdfTemplateReplaceAll } from '@/utils/StringUtils.js'
|
||||
import { pdfTemplateReplaceAll, replaceInlineI18n } from '@/utils/StringUtils.js'
|
||||
|
||||
export default {
|
||||
name: 'PDFPreExport',
|
||||
@ -121,6 +121,7 @@ export default {
|
||||
for (const [key, value] of Object.entries(this.varsInfo)) {
|
||||
this.templateContentChange = pdfTemplateReplaceAll(this.templateContentChange, key, value || '')
|
||||
}
|
||||
this.templateContentChange = replaceInlineI18n(this.templateContentChange)
|
||||
},
|
||||
|
||||
cancel() {
|
||||
|
||||
@ -77,11 +77,7 @@
|
||||
trigger="click"
|
||||
>
|
||||
<panel-detail-info />
|
||||
<i
|
||||
slot="reference"
|
||||
class="el-icon-warning-outline icon-class"
|
||||
style="margin-left: 4px;cursor: pointer;font-size: 14px;"
|
||||
/>
|
||||
<svg-icon slot="reference" style="margin-left: 4px;cursor: pointer;font-size: 14px;" class="icon-class" icon-class="icon_info_outlined" />
|
||||
</el-popover>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
|
||||
@ -71,7 +71,7 @@
|
||||
popper-class="api-table-delete"
|
||||
trigger="click"
|
||||
>
|
||||
<i :disabled="disabled" class="el-icon-warning" />
|
||||
<svg-icon :disabled="disabled" icon-class="icon_info_filled" />
|
||||
<div class="tips">
|
||||
{{ $t('datasource.delete_this_item') }}
|
||||
</div>
|
||||
|
||||
@ -262,7 +262,7 @@
|
||||
v-dialogDrag
|
||||
:title="$t('datasource.create')"
|
||||
:visible.sync="dsTypeRelate"
|
||||
width="1005px"
|
||||
width="1010px"
|
||||
class="de-dialog-form none-scroll-bar"
|
||||
append-to-body
|
||||
>
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -47,7 +47,7 @@
|
||||
:content="$t('system_parameter_setting.front_time_out')"
|
||||
placement="top"
|
||||
>
|
||||
<i class="el-icon-warning-outline tips" />
|
||||
<svg-icon class="tips" icon-class="icon_info_outlined" />
|
||||
</el-tooltip>
|
||||
</template>
|
||||
<el-input
|
||||
|
||||
@ -90,7 +90,7 @@
|
||||
:content="$t('system_parameter_setting.test_mail_recipient')"
|
||||
placement="top"
|
||||
>
|
||||
<i class="el-icon-warning-outline tips-not-absolute" />
|
||||
<svg-icon icon-class="icon_info_outlined" class="tips-not-absolute" />
|
||||
</el-tooltip>
|
||||
</template>
|
||||
<dePwd
|
||||
@ -106,7 +106,7 @@
|
||||
:content="$t('system_parameter_setting.to_enable_ssl')"
|
||||
placement="top"
|
||||
>
|
||||
<i class="el-icon-warning-outline tips-not-absolute" />
|
||||
<svg-icon icon-class="icon_info_outlined" class="tips-not-absolute" />
|
||||
</el-tooltip>
|
||||
</el-checkbox>
|
||||
|
||||
@ -118,7 +118,7 @@
|
||||
:content="$t('system_parameter_setting.to_enable_tsl')"
|
||||
placement="top"
|
||||
>
|
||||
<i class="el-icon-warning-outline tips-not-absolute" />
|
||||
<svg-icon icon-class="icon_info_outlined" class="tips-not-absolute" />
|
||||
</el-tooltip>
|
||||
</el-checkbox>
|
||||
</el-form-item>
|
||||
|
||||
111
frontend/src/views/system/user/PasswordUpdateForm.vue
Normal file
111
frontend/src/views/system/user/PasswordUpdateForm.vue
Normal file
@ -0,0 +1,111 @@
|
||||
<template>
|
||||
<el-form
|
||||
ref="createUserForm"
|
||||
:model="form"
|
||||
:rules="rule"
|
||||
size="small"
|
||||
label-width="auto"
|
||||
label-position="right"
|
||||
>
|
||||
<el-form-item v-if="!oldPwd" :label="$t('user.origin_passwd')" prop="oldPwd">
|
||||
<dePwd v-model="form.oldPwd" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('user.new_passwd')" prop="newPwd">
|
||||
<dePwd v-model="form.newPwd" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('user.confirm_passwd')" prop="repeatPwd">
|
||||
<dePwd v-model="form.repeatPwd" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="save">{{
|
||||
$t('commons.confirm')
|
||||
}}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { updatePersonPwd } from '@/api/system/user'
|
||||
import dePwd from '@/components/deCustomCm/DePwd.vue'
|
||||
export default {
|
||||
name: 'PasswordUpdateForm',
|
||||
components: { dePwd },
|
||||
props: {
|
||||
oldPwd: {
|
||||
type: String,
|
||||
default: ""
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
form: {},
|
||||
rule: {
|
||||
oldPwd: [
|
||||
{
|
||||
required: true,
|
||||
message: this.$t('user.input_password'),
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
newPwd: [
|
||||
{
|
||||
required: true,
|
||||
message: this.$t('user.input_password'),
|
||||
trigger: 'blur'
|
||||
},
|
||||
{
|
||||
required: true,
|
||||
pattern: /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[^]{8,30}$/,
|
||||
message: this.$t('member.password_format_is_incorrect'),
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
repeatPwd: [
|
||||
{
|
||||
required: true,
|
||||
message: this.$t('user.input_password'),
|
||||
trigger: 'blur'
|
||||
},
|
||||
{ required: true, trigger: 'blur', validator: this.repeatValidator }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
if (this.oldPwd) {
|
||||
this.form.oldPwd = this.oldPwd
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
repeatValidator(rule, value, callback) {
|
||||
if (value !== this.form.newPwd) {
|
||||
callback(new Error(this.$t('member.inconsistent_passwords')))
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
},
|
||||
|
||||
save() {
|
||||
this.$refs.createUserForm.validate((valid) => {
|
||||
if (valid) {
|
||||
const param = {
|
||||
password: this.form.oldPwd,
|
||||
newPassword: this.form.newPwd
|
||||
}
|
||||
updatePersonPwd(param).then((res) => {
|
||||
this.$success(this.$t('commons.save_success'))
|
||||
this.$store.commit('user/SET_PASSWORD_MODIFIED', true)
|
||||
this.logout()
|
||||
})
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
async logout() {
|
||||
await this.$store.dispatch('user/logout')
|
||||
this.$router.push('/')
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@ -5,45 +5,7 @@
|
||||
<div class="form-header">
|
||||
<span>{{ $t('user.change_password') }}</span>
|
||||
</div>
|
||||
<el-form
|
||||
ref="createUserForm"
|
||||
:model="form"
|
||||
:rules="rule"
|
||||
size="small"
|
||||
label-width="auto"
|
||||
label-position="right"
|
||||
>
|
||||
<el-form-item
|
||||
:label="$t('user.origin_passwd')"
|
||||
prop="oldPwd"
|
||||
>
|
||||
<dePwd
|
||||
v-model="form.oldPwd"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
:label="$t('user.new_passwd')"
|
||||
prop="newPwd"
|
||||
>
|
||||
<dePwd
|
||||
v-model="form.newPwd"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
:label="$t('user.confirm_passwd')"
|
||||
prop="repeatPwd"
|
||||
>
|
||||
<dePwd
|
||||
v-model="form.repeatPwd"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="save"
|
||||
>{{ $t('commons.confirm') }}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<PasswordUpdateForm />
|
||||
</el-card>
|
||||
</div>
|
||||
</layout-content>
|
||||
@ -51,39 +13,9 @@
|
||||
|
||||
<script>
|
||||
import LayoutContent from '@/components/business/LayoutContent'
|
||||
import { updatePersonPwd } from '@/api/system/user'
|
||||
import dePwd from '@/components/deCustomCm/DePwd.vue'
|
||||
import PasswordUpdateForm from './PasswordUpdateForm'
|
||||
export default {
|
||||
|
||||
components: { LayoutContent, dePwd },
|
||||
data() {
|
||||
return {
|
||||
form: {
|
||||
|
||||
},
|
||||
rule: {
|
||||
|
||||
oldPwd: [
|
||||
{ required: true, message: this.$t('user.input_password'), trigger: 'blur' }
|
||||
],
|
||||
newPwd: [
|
||||
{ required: true, message: this.$t('user.input_password'), trigger: 'blur' },
|
||||
{
|
||||
required: true,
|
||||
pattern: /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[^]{8,30}$/,
|
||||
message: this.$t('member.password_format_is_incorrect'),
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
repeatPwd: [
|
||||
{ required: true, message: this.$t('user.input_password'), trigger: 'blur' },
|
||||
{ required: true, trigger: 'blur', validator: this.repeatValidator }
|
||||
]
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
components: { LayoutContent, PasswordUpdateForm },
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('app/toggleSideBarHide', true)
|
||||
@ -92,36 +24,6 @@ export default {
|
||||
created() {
|
||||
this.$store.dispatch('app/toggleSideBarHide', true)
|
||||
},
|
||||
methods: {
|
||||
repeatValidator(rule, value, callback) {
|
||||
if (value !== this.form.newPwd) {
|
||||
callback(new Error(this.$t('member.inconsistent_passwords')))
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
},
|
||||
|
||||
save() {
|
||||
this.$refs.createUserForm.validate(valid => {
|
||||
if (valid) {
|
||||
const param = {
|
||||
password: this.form.oldPwd,
|
||||
newPassword: this.form.newPwd
|
||||
}
|
||||
updatePersonPwd(param).then(res => {
|
||||
this.$success(this.$t('commons.save_success'))
|
||||
this.logout()
|
||||
})
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
async logout() {
|
||||
await this.$store.dispatch('user/logout')
|
||||
this.$router.push('/')
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-loading="loading"
|
||||
:title="formType == 'add' ? $t('user.create') : $t('user.modify')"
|
||||
:visible.sync="dialogVisible"
|
||||
class="user-editer-form"
|
||||
@ -229,6 +230,7 @@ import { pluginLoaded, defaultPwd, wecomStatus, dingtalkStatus, larkStatus } fro
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
defaultProps: {
|
||||
children: 'children',
|
||||
label: 'label',
|
||||
@ -553,12 +555,13 @@ export default {
|
||||
save() {
|
||||
this.$refs.createUserForm.validate((valid) => {
|
||||
if (valid) {
|
||||
// !this.form.deptId && (this.form.deptId = 0)
|
||||
this.loading = true
|
||||
const method = this.formType === 'add' ? addUser : editUser
|
||||
method(this.form).then((res) => {
|
||||
this.$success(this.$t('commons.save_success'))
|
||||
this.reset()
|
||||
this.$emit('saved')
|
||||
this.loading = false
|
||||
})
|
||||
} else {
|
||||
return false
|
||||
|
||||
@ -261,7 +261,7 @@
|
||||
popper-class="reset-pwd"
|
||||
trigger="click"
|
||||
>
|
||||
<i class="el-icon-warning" />
|
||||
<svg-icon class="reset-pwd-icon" icon-class="icon_info_filled" />
|
||||
<div class="tips">{{ $t('user.recover_pwd') }}</div>
|
||||
<div class="editer-form-title">
|
||||
<span
|
||||
@ -681,6 +681,10 @@ export default {
|
||||
}
|
||||
</style>
|
||||
<style lang="scss">
|
||||
.reset-pwd-icon {
|
||||
margin-top: 4px;
|
||||
color: rgb(255, 153, 0);
|
||||
}
|
||||
.reset-pwd {
|
||||
padding: 20px 24px !important;
|
||||
display: flex;
|
||||
|
||||
1
frontend/static/svg/de-dashboard.svg
Normal file
1
frontend/static/svg/de-dashboard.svg
Normal file
@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1676880438895" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2075" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M913.408 202.752c0 12.288-8.192 20.48-20.48 20.48s-20.48-8.192-20.48-20.48v-18.432c0-45.056-36.864-81.92-81.92-81.92h-573.44c-45.056 0-81.92 36.864-81.92 81.92v655.36c0 45.056 36.864 81.92 81.92 81.92h573.44c45.056 0 81.92-36.864 81.92-81.92v-464.896c0-12.288 8.192-20.48 20.48-20.48s20.48 8.192 20.48 20.48V839.68c0 67.584-55.296 122.88-122.88 122.88h-573.44c-67.584 0-122.88-55.296-122.88-122.88v-655.36c0-67.584 55.296-122.88 122.88-122.88h573.44c67.584 0 122.88 55.296 122.88 122.88v18.432z m-665.6 73.728h102.4v552.96h-102.4v-552.96z m204.8 122.88h102.4v430.08h-102.4v-430.08z m204.8 102.4h102.4v327.68h-102.4v-327.68z" fill="#32373B" p-id="2076"></path></svg>
|
||||
|
After Width: | Height: | Size: 998 B |
1
frontend/static/svg/de-dataset.svg
Normal file
1
frontend/static/svg/de-dataset.svg
Normal file
@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1676880471027" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3111" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M483.555556 56.888889L910.222222 284.444444v455.111112l-426.666666 227.555555L56.888889 739.555556V284.444444l426.666667-227.555555zM113.777778 318.577778v386.844444l369.777778 193.422222 369.777777-193.422222V318.577778L483.555556 125.155556 113.777778 318.577778z" fill="#333333" p-id="3112"></path><path d="M494.933333 540.444444h-28.444444l-398.222222-187.733333 28.444444-51.2 386.844445 182.044445 386.844444-182.044445 22.755556 51.2z" fill="#333333" p-id="3113"></path><path d="M455.111111 523.377778h56.888889V910.222222H455.111111z" fill="#333333" p-id="3114"></path></svg>
|
||||
|
After Width: | Height: | Size: 916 B |
1
frontend/static/svg/de-datasource.svg
Normal file
1
frontend/static/svg/de-datasource.svg
Normal file
@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1676880491070" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4150" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M512 160a115.936 115.936 0 0 1 114.816 99.328 313.28 313.28 0 0 1 192.224 355.392A115.52 115.52 0 0 1 864 706.304a115.904 115.904 0 0 1-115.968 115.84c-20.48 0-39.712-5.344-56.416-14.624A312.16 312.16 0 0 1 512 864a312.576 312.576 0 0 1-179.648-56.448c-16.64 9.28-35.904 14.56-56.384 14.56A115.904 115.904 0 0 1 160 706.272c0-37.248 17.6-70.4 44.992-91.584-4.352-26.112-6.56-47.424-6.56-63.84a313.28 313.28 0 0 1 198.784-291.52A115.904 115.904 0 0 1 512 160z m105.12 164.704c-20.384 41.856-59.68 66.944-105.12 66.944a116 116 0 0 1-105.152-66.88 249.28 249.28 0 0 0-144.416 226.08c-0.736 15.488 3.2 40.128 3.2 40.128 73.248-5.312 126.304 51.36 126.304 115.328a115.2 115.2 0 0 1-13.824 54.88A248.192 248.192 0 0 0 512 800.096c48.288 0 94.4-13.728 133.92-38.88a115.04 115.04 0 0 1-13.856-54.912c0-64 54.144-121.76 126.24-115.328 0 0 3.264-26.56 3.264-40.128a249.344 249.344 0 0 0-144.448-226.144z m130.912 329.696A51.936 51.936 0 1 0 800 706.304c0-28.672-23.264-51.904-51.968-51.904z m-472.064 0a51.936 51.936 0 1 0 51.968 51.904c0-28.672-23.264-51.904-51.968-51.904zM512 223.904a51.936 51.936 0 1 0 51.968 51.904c0-28.64-23.264-51.904-51.968-51.904z" fill="#686C78" p-id="4151"></path></svg>
|
||||
|
After Width: | Height: | Size: 1.5 KiB |
@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<artifactId>dataease-server</artifactId>
|
||||
<groupId>io.dataease</groupId>
|
||||
<version>1.18.2</version>
|
||||
<version>1.18.3</version>
|
||||
</parent>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@ -142,4 +142,17 @@ export function parseLanguage() {
|
||||
const language = getLanguage()
|
||||
if(language === 'sys') return uni.getLocale()
|
||||
return language
|
||||
}
|
||||
}
|
||||
|
||||
export function getUrlParams(url){
|
||||
const Params = {}
|
||||
if(url.indexOf('?')>0){//判断是否有qurey
|
||||
let parmas = url.slice(url.indexOf('?')+1)//截取出query
|
||||
const paramlists = parmas.split('&')//分割键值对
|
||||
for (const param of paramlists) {
|
||||
let a = param.split('=')
|
||||
Object.assign(Params,{[a[0]]:a[1]})//将键值对封装成对象
|
||||
}
|
||||
}
|
||||
return Params
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
{
|
||||
"app.name": "Hello uni-app",
|
||||
"app.name": "DataEase",
|
||||
|
||||
"navigate.menuHome": "首页",
|
||||
"navigate.menuDir": "目录",
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
{
|
||||
"app.name": "Hello uni-app",
|
||||
"app.name": "DataEase",
|
||||
"navigate.menuHome": "首頁",
|
||||
"navigate.menuDir": "目錄",
|
||||
"navigate.menuMe": "我的",
|
||||
|
||||
@ -1,192 +1,192 @@
|
||||
{
|
||||
"pages": [
|
||||
"pages": [
|
||||
|
||||
{
|
||||
"path": "pages/login/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "%app.name%",
|
||||
"app-plus": {
|
||||
"titleNView": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/tabBar/home/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "%navigate.menuHome%",
|
||||
"app-plus": {
|
||||
"titleNView": false
|
||||
|
||||
{
|
||||
"path": "pages/login/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "%navigate.login%",
|
||||
"app-plus": {
|
||||
"titleNView": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/tabBar/home/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "%navigate.menuHome%",
|
||||
"app-plus": {
|
||||
"titleNView": false
|
||||
|
||||
},
|
||||
"enablePullDownRefresh": true
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "pages/tabBar/home/detail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"app-plus": {
|
||||
"titleNView": false,
|
||||
"bounce": "none"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/tabBar/dir/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "%navigate.menuDir%",
|
||||
"app-plus": {
|
||||
"titleNView": {
|
||||
"type": "transparent",
|
||||
"titleColor": "#fff",
|
||||
"backgroundColor": "#0faeff",
|
||||
"buttons": [],
|
||||
"searchInput": {
|
||||
"backgroundColor": "#fff",
|
||||
"borderRadius": "6px",
|
||||
"placeholder": "%searchPlaceholder%",
|
||||
"disabled": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"enablePullDownRefresh": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/tabBar/dir/search",
|
||||
"style": {
|
||||
"navigationBarTitleText": "%navigate.search%",
|
||||
"app-plus": {
|
||||
"titleNView": {
|
||||
"titleColor": "#fff",
|
||||
"backgroundColor": "#0faeff",
|
||||
|
||||
"searchInput": {
|
||||
"backgroundColor": "#fff",
|
||||
"borderRadius": "6px",
|
||||
"placeholder": "%searchPlaceholder%",
|
||||
"autoFocus": true
|
||||
}
|
||||
}
|
||||
}
|
||||
"enablePullDownRefresh": true
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "pages/tabBar/home/detail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"app-plus": {
|
||||
"titleNView": false,
|
||||
"bounce": "none"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/tabBar/dir/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "%navigate.menuDir%",
|
||||
"app-plus": {
|
||||
"titleNView": {
|
||||
"type": "transparent",
|
||||
"titleColor": "#fff",
|
||||
"backgroundColor": "#0faeff",
|
||||
"buttons": [],
|
||||
"searchInput": {
|
||||
"backgroundColor": "#fff",
|
||||
"borderRadius": "6px",
|
||||
"placeholder": "%searchPlaceholder%",
|
||||
"disabled": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/tabBar/dir/folder",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"app-plus": {
|
||||
"titleNView": {
|
||||
"type": "transparent"
|
||||
}
|
||||
},
|
||||
"h5": {
|
||||
"titleNView": {
|
||||
"type": "transparent",
|
||||
"buttons": []
|
||||
}
|
||||
}
|
||||
"enablePullDownRefresh": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/tabBar/dir/search",
|
||||
"style": {
|
||||
"navigationBarTitleText": "%navigate.search%",
|
||||
"app-plus": {
|
||||
"titleNView": {
|
||||
"titleColor": "#fff",
|
||||
"backgroundColor": "#0faeff",
|
||||
|
||||
"searchInput": {
|
||||
"backgroundColor": "#fff",
|
||||
"borderRadius": "6px",
|
||||
"placeholder": "%searchPlaceholder%",
|
||||
"autoFocus": true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/tabBar/dir/folder",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"app-plus": {
|
||||
"titleNView": {
|
||||
"type": "transparent"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/tabBar/me/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "%navigate.menuMe%",
|
||||
"app-plus": {
|
||||
"titleNView": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/tabBar/me/person",
|
||||
"style": {
|
||||
"navigationBarTitleText": "%navigate.personInfo%",
|
||||
|
||||
"app-plus": {
|
||||
"titleNView": {
|
||||
"type": "transparent"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/tabBar/me/language",
|
||||
"style": {
|
||||
"navigationBarTitleText": "%navigate.language%",
|
||||
|
||||
"app-plus": {
|
||||
"titleNView": {
|
||||
"type": "transparent"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/tabBar/me/about",
|
||||
"style": {
|
||||
"navigationBarTitleText": "%navigate.about%",
|
||||
|
||||
"app-plus": {
|
||||
"titleNView": {
|
||||
"type": "transparent"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/tabBar/me/outlink",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
|
||||
"app-plus": {
|
||||
"titleNView": {
|
||||
"type": "transparent"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/index/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "%app.name%",
|
||||
"h5": {
|
||||
"maxWidth": 1190,
|
||||
"navigationBarTextStyle": "black",
|
||||
"navigationBarBackgroundColor": "#F1F1F1"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"globalStyle": {
|
||||
"navigationBarTextStyle": "black",
|
||||
"navigationBarTitleText": "%app.name%",
|
||||
"navigationBarBackgroundColor": "#ffffff",
|
||||
"backgroundColor": "#ffffff"
|
||||
},
|
||||
"tabBar": {
|
||||
"color": "#7A7E83",
|
||||
"selectedColor": "#007AFF",
|
||||
"borderStyle": "black",
|
||||
"backgroundColor": "#ffffff",
|
||||
|
||||
"list": [{
|
||||
"pagePath": "pages/tabBar/home/index",
|
||||
"iconPath": "static/home.png",
|
||||
"selectedIconPath": "static/home_select.png",
|
||||
"text": "%navigate.menuHome%"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/tabBar/dir/index",
|
||||
"iconPath": "static/dir.png",
|
||||
"selectedIconPath": "static/dir_select.png",
|
||||
"text": "%navigate.menuDir%"
|
||||
}, {
|
||||
"pagePath": "pages/tabBar/me/index",
|
||||
"iconPath": "static/me.png",
|
||||
"selectedIconPath": "static/me_select.png",
|
||||
"text": "%navigate.menuMe%"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
"h5": {
|
||||
"titleNView": {
|
||||
"type": "transparent",
|
||||
"buttons": []
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/tabBar/me/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "%navigate.menuMe%",
|
||||
"app-plus": {
|
||||
"titleNView": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/tabBar/me/person",
|
||||
"style": {
|
||||
"navigationBarTitleText": "%navigate.personInfo%",
|
||||
|
||||
"app-plus": {
|
||||
"titleNView": {
|
||||
"type": "transparent"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/tabBar/me/language",
|
||||
"style": {
|
||||
"navigationBarTitleText": "%navigate.language%",
|
||||
|
||||
"app-plus": {
|
||||
"titleNView": {
|
||||
"type": "transparent"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/tabBar/me/about",
|
||||
"style": {
|
||||
"navigationBarTitleText": "%navigate.about%",
|
||||
|
||||
"app-plus": {
|
||||
"titleNView": {
|
||||
"type": "transparent"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/tabBar/me/outlink",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
|
||||
"app-plus": {
|
||||
"titleNView": {
|
||||
"type": "transparent"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/index/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "%app.name%",
|
||||
"h5": {
|
||||
"maxWidth": 1190,
|
||||
"navigationBarTextStyle": "black",
|
||||
"navigationBarBackgroundColor": "#F1F1F1"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"globalStyle": {
|
||||
"navigationBarTextStyle": "black",
|
||||
"navigationBarTitleText": "%app.name%",
|
||||
"navigationBarBackgroundColor": "#ffffff",
|
||||
"backgroundColor": "#ffffff"
|
||||
},
|
||||
"tabBar": {
|
||||
"color": "#7A7E83",
|
||||
"selectedColor": "#007AFF",
|
||||
"borderStyle": "black",
|
||||
"backgroundColor": "#ffffff",
|
||||
|
||||
"list": [{
|
||||
"pagePath": "pages/tabBar/home/index",
|
||||
"iconPath": "static/home.png",
|
||||
"selectedIconPath": "static/home_select.png",
|
||||
"text": "%navigate.menuHome%"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/tabBar/dir/index",
|
||||
"iconPath": "static/dir.png",
|
||||
"selectedIconPath": "static/dir_select.png",
|
||||
"text": "%navigate.menuDir%"
|
||||
}, {
|
||||
"pagePath": "pages/tabBar/me/index",
|
||||
"iconPath": "static/me.png",
|
||||
"selectedIconPath": "static/me_select.png",
|
||||
"text": "%navigate.menuMe%"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@ -1,385 +1,411 @@
|
||||
<template>
|
||||
<view
|
||||
v-if="axiosFinished"
|
||||
:class="mobileBG ? 'content-de' : 'content'"
|
||||
:style="mobileBG ? {background:'url(' + mobileBG + ') no-repeat', 'backgroundSize':'cover'} : ''"
|
||||
>
|
||||
|
||||
<view class="input-group" >
|
||||
<view class="input-row">
|
||||
<text class="welcome">{{$t('login.title')}}</text>
|
||||
</view>
|
||||
<view class="input-row border">
|
||||
<text class="title">{{$t('login.account')}}</text>
|
||||
<m-input class="m-input" type="text" clearable focus v-model="username" :placeholder="$t('login.accountPlaceholder')"></m-input>
|
||||
</view>
|
||||
<view class="input-row border">
|
||||
<text class="title">{{$t('login.password')}}</text>
|
||||
<m-input type="password" displayable v-model="password" :placeholder="$t('login.passwordPlaceholder')"></m-input>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="btn-row">
|
||||
<button type="primary" class="primary" :loading="loginBtnLoading" @tap="bindLogin">{{$t('login.loginbtn')}}</button>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view v-if="axiosFinished" :class="mobileBG ? 'content-de' : 'content'"
|
||||
:style="mobileBG ? {background:'url(' + mobileBG + ') no-repeat', 'backgroundSize':'cover'} : ''">
|
||||
|
||||
<view class="input-group">
|
||||
<view class="input-row">
|
||||
<text class="welcome">{{$t('login.title')}}</text>
|
||||
</view>
|
||||
<view class="input-row border">
|
||||
<text class="title">{{$t('login.account')}}</text>
|
||||
<m-input class="m-input" type="text" clearable focus v-model="username"
|
||||
:placeholder="$t('login.accountPlaceholder')"></m-input>
|
||||
</view>
|
||||
<view class="input-row border">
|
||||
<text class="title">{{$t('login.password')}}</text>
|
||||
<m-input type="password" displayable v-model="password" :placeholder="$t('login.passwordPlaceholder')">
|
||||
</m-input>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="btn-row">
|
||||
<button type="primary" class="primary" :loading="loginBtnLoading"
|
||||
@tap="bindLogin">{{$t('login.loginbtn')}}</button>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
mapState,
|
||||
mapMutations
|
||||
} from 'vuex'
|
||||
import mInput from '../../components/m-input.vue'
|
||||
import {login, getInfo, getPublicKey, getUIinfo } from '@/api/auth'
|
||||
import {encrypt, setLocalPK, getLocalPK, setToken, getToken, setUserInfo, getUserInfo } from '@/common/utils'
|
||||
import {
|
||||
mapState,
|
||||
mapMutations
|
||||
} from 'vuex'
|
||||
import mInput from '../../components/m-input.vue'
|
||||
import {
|
||||
login,
|
||||
getInfo,
|
||||
getPublicKey,
|
||||
getUIinfo
|
||||
} from '@/api/auth'
|
||||
import {
|
||||
encrypt,
|
||||
setLocalPK,
|
||||
getLocalPK,
|
||||
setToken,
|
||||
getToken,
|
||||
setUserInfo,
|
||||
getUserInfo,
|
||||
getUrlParams
|
||||
} from '@/common/utils'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
mInput
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
username: '',
|
||||
loginBtnLoading: false,
|
||||
password: '',
|
||||
mobileBG: null,
|
||||
axiosFinished: false
|
||||
|
||||
}
|
||||
},
|
||||
computed: mapState(['forcedLogin', 'hasLogin', 'univerifyErrorMsg', 'hideUniverify']),
|
||||
onLoad() {
|
||||
uni.showLoading({
|
||||
title: this.$t('commons.loading')
|
||||
});
|
||||
this.loadUiInfo()
|
||||
this.loadPublicKey()
|
||||
if(getToken() && getUserInfo()) {
|
||||
this.toMain()
|
||||
export default {
|
||||
components: {
|
||||
mInput
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
username: '',
|
||||
loginBtnLoading: false,
|
||||
password: '',
|
||||
mobileBG: null,
|
||||
axiosFinished: false
|
||||
}
|
||||
},
|
||||
computed: mapState(['forcedLogin', 'hasLogin', 'univerifyErrorMsg', 'hideUniverify']),
|
||||
|
||||
onLoad() {
|
||||
uni.showLoading({
|
||||
title: this.$t('commons.loading')
|
||||
});
|
||||
this.loadUiInfo()
|
||||
this.loadPublicKey()
|
||||
if (!this.autoLogin() && getToken() && getUserInfo()) {
|
||||
this.toMain()
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
...mapMutations(['login']),
|
||||
|
||||
async loginByPwd() {
|
||||
if (this.username.length < 1) {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: this.$t('login.accFmtError')
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (this.password.length < 1) {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: this.$t('login.passwordPlaceholder')
|
||||
});
|
||||
return;
|
||||
}
|
||||
const data = {
|
||||
username: encrypt(this.username),
|
||||
password: encrypt(this.password)
|
||||
};
|
||||
this.loginBtnLoading = true
|
||||
login(data).then(res => {
|
||||
if (res.success) {
|
||||
setToken(res.data.token)
|
||||
this.toMain()
|
||||
}
|
||||
|
||||
}).catch(error => {
|
||||
this.loginBtnLoading = false
|
||||
uni.showToast({
|
||||
icon: 'error',
|
||||
title: error.response.data.message,
|
||||
});
|
||||
})
|
||||
},
|
||||
|
||||
bindLogin() {
|
||||
this.loginByPwd()
|
||||
},
|
||||
|
||||
toMain(userName) {
|
||||
getInfo().then(res => {
|
||||
setUserInfo(res.data)
|
||||
uni.reLaunch({
|
||||
url: '../tabBar/home/index',
|
||||
});
|
||||
})
|
||||
},
|
||||
|
||||
loadUiInfo() {
|
||||
getUIinfo().then(res => {
|
||||
const list = res.data
|
||||
list.forEach(item => {
|
||||
if (item.paramKey === 'ui.mobileBG' && item.paramValue) {
|
||||
this.mobileBG = '/system/ui/image/' + item.paramValue
|
||||
return false
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
methods: {
|
||||
...mapMutations(['login']),
|
||||
|
||||
async loginByPwd() {
|
||||
|
||||
if (this.username.length < 1) {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: this.$t('login.accFmtError')
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (this.password.length < 1) {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: this.$t('login.passwordPlaceholder')
|
||||
});
|
||||
return;
|
||||
}
|
||||
const data = {
|
||||
username: encrypt(this.username),
|
||||
password: encrypt(this.password)
|
||||
};
|
||||
this.loginBtnLoading = true
|
||||
login(data).then(res => {
|
||||
if(res.success) {
|
||||
setToken(res.data.token)
|
||||
this.toMain()
|
||||
}
|
||||
|
||||
}).catch(error => {
|
||||
this.loginBtnLoading = false
|
||||
uni.showToast({
|
||||
icon: 'error',
|
||||
title: error.response.data.message,
|
||||
});
|
||||
})
|
||||
|
||||
},
|
||||
|
||||
bindLogin() {
|
||||
this.loginByPwd()
|
||||
},
|
||||
|
||||
toMain(userName) {
|
||||
getInfo().then(res => {
|
||||
setUserInfo(res.data)
|
||||
uni.reLaunch({
|
||||
url: '../tabBar/home/index',
|
||||
});
|
||||
})
|
||||
|
||||
},
|
||||
|
||||
loadUiInfo() {
|
||||
getUIinfo().then(res => {
|
||||
|
||||
|
||||
const list = res.data
|
||||
list.forEach(item => {
|
||||
if(item.paramKey === 'ui.mobileBG' && item.paramValue) {
|
||||
this.mobileBG = '/system/ui/image/' + item.paramValue
|
||||
return false
|
||||
}
|
||||
})
|
||||
setTimeout(() => {
|
||||
uni.hideLoading()
|
||||
this.axiosFinished = true
|
||||
}, 1500)
|
||||
|
||||
})
|
||||
},
|
||||
})
|
||||
setTimeout(() => {
|
||||
uni.hideLoading()
|
||||
this.axiosFinished = true
|
||||
}, 1500)
|
||||
|
||||
loadPublicKey() {
|
||||
if(!getLocalPK()) {
|
||||
getPublicKey().then(res => {
|
||||
setLocalPK(res.data)
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
},
|
||||
onReady() {
|
||||
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
loadPublicKey() {
|
||||
if (!getLocalPK()) {
|
||||
getPublicKey().then(res => {
|
||||
setLocalPK(res.data)
|
||||
})
|
||||
}
|
||||
},
|
||||
autoLogin() {
|
||||
const url = window.location.href
|
||||
const param = getUrlParams(url)
|
||||
if (param?.detoken) {
|
||||
if(param.detoken.endsWith('#/'))
|
||||
param.detoken = param.detoken.substr(0, param.detoken.length - 2)
|
||||
setToken(param.detoken)
|
||||
getInfo().then(res => {
|
||||
setUserInfo(res.data)
|
||||
const redirect = window.location.href.split('?')[0]
|
||||
|
||||
window.location.href = redirect
|
||||
})
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
},
|
||||
onReady() {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
@import "@/components/m-icon/m-icon.css";
|
||||
@import "@/components/m-icon/m-icon.css";
|
||||
|
||||
/*每个页面公共css */
|
||||
page {
|
||||
min-height: 100%;
|
||||
display: flex;
|
||||
font-size: 14px;
|
||||
}
|
||||
/*每个页面公共css */
|
||||
page {
|
||||
min-height: 100%;
|
||||
display: flex;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
input,
|
||||
textarea,
|
||||
button {
|
||||
font-size: 14px;
|
||||
}
|
||||
input,
|
||||
textarea,
|
||||
button {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
/* #ifdef MP-BAIDU */
|
||||
page {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: block;
|
||||
}
|
||||
/* #ifdef MP-BAIDU */
|
||||
page {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: block;
|
||||
}
|
||||
|
||||
swan-template {
|
||||
width: 100%;
|
||||
min-height: 100%;
|
||||
display: flex;
|
||||
}
|
||||
swan-template {
|
||||
width: 100%;
|
||||
min-height: 100%;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
/* 原生组件模式下需要注意组件外部样式 */
|
||||
custom-component {
|
||||
width: 100%;
|
||||
min-height: 100%;
|
||||
display: flex;
|
||||
}
|
||||
/* 原生组件模式下需要注意组件外部样式 */
|
||||
custom-component {
|
||||
width: 100%;
|
||||
min-height: 100%;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
/* #endif */
|
||||
/* #endif */
|
||||
|
||||
/* #ifdef MP-ALIPAY */
|
||||
page {
|
||||
min-height: 100vh;
|
||||
}
|
||||
/* #ifdef MP-ALIPAY */
|
||||
page {
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
/* #endif */
|
||||
/* #endif */
|
||||
|
||||
/* 原生组件模式下需要注意组件外部样式 */
|
||||
m-input {
|
||||
width: 100%;
|
||||
/* min-height: 100%; */
|
||||
display: flex;
|
||||
flex: 1;
|
||||
}
|
||||
/* 原生组件模式下需要注意组件外部样式 */
|
||||
m-input {
|
||||
width: 100%;
|
||||
/* min-height: 100%; */
|
||||
display: flex;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.content {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
flex-direction: column;
|
||||
background-color: #000000;
|
||||
background-image: url(../../static/logo-bg.jpg);
|
||||
padding: 10px;
|
||||
justify-content: center;
|
||||
background-repeat: no-repeat;
|
||||
background-size: 100% 100%;
|
||||
opacity: 0.75;
|
||||
}
|
||||
|
||||
.content-de {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
flex-direction: column;
|
||||
background-color: #000000;
|
||||
padding: 10px;
|
||||
justify-content: center;
|
||||
background-repeat: no-repeat;
|
||||
background-size: 100% 100%;
|
||||
opacity: 0.75;
|
||||
}
|
||||
.content {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
flex-direction: column;
|
||||
background-color: #000000;
|
||||
background-image: url(../../static/logo-bg.jpg);
|
||||
padding: 10px;
|
||||
justify-content: center;
|
||||
background-repeat: no-repeat;
|
||||
background-size: 100% 100%;
|
||||
opacity: 0.75;
|
||||
}
|
||||
|
||||
.input-group {
|
||||
background-color: #ffffff;
|
||||
margin-top: 20px;
|
||||
position: relative;
|
||||
opacity: 0.95;
|
||||
border-radius: 10px;
|
||||
overflow: hidden;
|
||||
}
|
||||
.content-de {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
flex-direction: column;
|
||||
background-color: #000000;
|
||||
padding: 10px;
|
||||
justify-content: center;
|
||||
background-repeat: no-repeat;
|
||||
background-size: 100% 100%;
|
||||
opacity: 0.75;
|
||||
}
|
||||
|
||||
.input-group::before {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
left: 0;
|
||||
height: 1px;
|
||||
content: '';
|
||||
-webkit-transform: scaleY(.5);
|
||||
transform: scaleY(.5);
|
||||
background-color: #c8c7cc;
|
||||
}
|
||||
.input-group {
|
||||
background-color: #ffffff;
|
||||
margin-top: 20px;
|
||||
position: relative;
|
||||
opacity: 0.95;
|
||||
border-radius: 10px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.input-group::after {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
height: 1px;
|
||||
content: '';
|
||||
-webkit-transform: scaleY(.5);
|
||||
transform: scaleY(.5);
|
||||
background-color: #c8c7cc;
|
||||
}
|
||||
.input-group::before {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
left: 0;
|
||||
height: 1px;
|
||||
content: '';
|
||||
-webkit-transform: scaleY(.5);
|
||||
transform: scaleY(.5);
|
||||
background-color: #c8c7cc;
|
||||
}
|
||||
|
||||
.input-row {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
position: relative;
|
||||
/* font-size: 18px; */
|
||||
height: 50px;
|
||||
line-height: 50px;
|
||||
}
|
||||
.input-group::after {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
height: 1px;
|
||||
content: '';
|
||||
-webkit-transform: scaleY(.5);
|
||||
transform: scaleY(.5);
|
||||
background-color: #c8c7cc;
|
||||
}
|
||||
|
||||
.input-row .title {
|
||||
width: 70px;
|
||||
padding-left: 15px;
|
||||
}
|
||||
.input-row {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
position: relative;
|
||||
/* font-size: 18px; */
|
||||
height: 50px;
|
||||
line-height: 50px;
|
||||
}
|
||||
|
||||
.input-row.border::after {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 8px;
|
||||
height: 1px;
|
||||
content: '';
|
||||
-webkit-transform: scaleY(.5);
|
||||
transform: scaleY(.5);
|
||||
background-color: #c8c7cc;
|
||||
}
|
||||
.input-row .title {
|
||||
width: 70px;
|
||||
padding-left: 15px;
|
||||
}
|
||||
|
||||
.btn-row {
|
||||
margin-top: 10px;
|
||||
padding: 10px 0;
|
||||
}
|
||||
.input-row.border::after {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 8px;
|
||||
height: 1px;
|
||||
content: '';
|
||||
-webkit-transform: scaleY(.5);
|
||||
transform: scaleY(.5);
|
||||
background-color: #c8c7cc;
|
||||
}
|
||||
|
||||
button.primary {
|
||||
background-color: #0faeff;
|
||||
line-height: 40px;
|
||||
border-radius: 5px;
|
||||
overflow: hidden;
|
||||
}
|
||||
.login-type {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
.btn-row {
|
||||
margin-top: 10px;
|
||||
padding: 10px 0;
|
||||
}
|
||||
|
||||
.login-type-btn {
|
||||
line-height: 30px;
|
||||
margin: 0px 15px;
|
||||
}
|
||||
button.primary {
|
||||
background-color: #0faeff;
|
||||
line-height: 40px;
|
||||
border-radius: 5px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.login-type-btn.act {
|
||||
color: #0FAEFF;
|
||||
border-bottom: solid 1px #0FAEFF;
|
||||
}
|
||||
.login-type {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.send-code-btn {
|
||||
width: 120px;
|
||||
text-align: center;
|
||||
background-color: #0FAEFF;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
.login-type-btn {
|
||||
line-height: 30px;
|
||||
margin: 0px 15px;
|
||||
}
|
||||
|
||||
.action-row {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: center;
|
||||
}
|
||||
.login-type-btn.act {
|
||||
color: #0FAEFF;
|
||||
border-bottom: solid 1px #0FAEFF;
|
||||
}
|
||||
|
||||
.action-row navigator {
|
||||
color: #007aff;
|
||||
padding: 0 10px;
|
||||
}
|
||||
.send-code-btn {
|
||||
width: 120px;
|
||||
text-align: center;
|
||||
background-color: #0FAEFF;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.oauth-row {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: space-around;
|
||||
flex-wrap: wrap;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
}
|
||||
.action-row {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.oauth-image {
|
||||
position: relative;
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
border: 1px solid #dddddd;
|
||||
border-radius: 50px;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
.action-row navigator {
|
||||
color: #007aff;
|
||||
padding: 0 10px;
|
||||
}
|
||||
|
||||
.oauth-image image {
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
margin: 10px;
|
||||
}
|
||||
.oauth-row {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: space-around;
|
||||
flex-wrap: wrap;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.oauth-image button {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
opacity: 0;
|
||||
}
|
||||
.oauth-image {
|
||||
position: relative;
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
border: 1px solid #dddddd;
|
||||
border-radius: 50px;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
.captcha-view {
|
||||
line-height: 0;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
display: flex;
|
||||
position: relative;
|
||||
background-color: #f3f3f3;
|
||||
}
|
||||
.welcome {
|
||||
padding-left: 15px;
|
||||
font-size: x-large;
|
||||
font-weight: 500;
|
||||
letter-spacing: 2px;
|
||||
}
|
||||
</style>
|
||||
.oauth-image image {
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
margin: 10px;
|
||||
}
|
||||
|
||||
.oauth-image button {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.captcha-view {
|
||||
line-height: 0;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
display: flex;
|
||||
position: relative;
|
||||
background-color: #f3f3f3;
|
||||
}
|
||||
|
||||
.welcome {
|
||||
padding-left: 15px;
|
||||
font-size: x-large;
|
||||
font-weight: 500;
|
||||
letter-spacing: 2px;
|
||||
}
|
||||
</style>
|
||||
Loading…
Reference in New Issue
Block a user