Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
wangjiahao 2022-06-22 18:02:55 +08:00
commit bc5d6f0b8a
71 changed files with 1057 additions and 349 deletions

View File

@ -31,38 +31,44 @@ DataEase 是开源的数据可视化分析工具,帮助用户快速分析数
## DataEase 支持的数据源
- Excel
- MySQL
- Oracle
- SQL Server
- PostgreSQL
- Elasticsearch
- MariaDB
- Apache Doris
- ClickHouse
- MongoDB
- Amazon Redshift
- Hive
- DB2
- API
- Impala
- TiDB
- StarRocks
- Presto
<p align="center">
<img src="https://dataease.io/images/dataSource/excel.jpg" alt="excel" border="0" width="155" height="107"/>
<img src="https://dataease.io/images/dataSource/mysql.png" alt="mysql" border="0" width="155" height="107"/>
<img src="https://dataease.io/images/dataSource/oracle.jpg" alt="oracle" border="0" width="155" height="107"/>
<img src="https://dataease.io/images/dataSource/sqlservel.jpg" alt="sqlserver" border="0" width="155" height="107"/>
<img src="https://dataease.io/images/dataSource/mariadb.jpg" alt="mariadb" border="0" width="155" height="107"/>
<img src="https://dataease.io/images/dataSource/elasticsearch.jpg" alt="elasticsearch" border="0" width="155" height="107"/>
<img src="https://dataease.io/images/dataSource/clickhouse.jpg" alt="clickhouse" border="0" width="155" height="107"/>
<img src="https://dataease.io/images/dataSource/doris.jpg" alt="doris" border="0" width="155" height="107"/>
<img src="https://dataease.io/images/dataSource/mongodb.jpg" alt="mongodb" border="0" width="155" height="107"/>
<img src="https://dataease.io/images/dataSource/redshift.jpg" alt="redshift" border="0" width="155" height="107"/>
<img src="https://dataease.io/images/dataSource/hive.png" alt="hive" border="0" width="155" height="107"/>
<img src="https://dataease.io/images/dataSource/DB2.jpg" alt="DB2" border="0" width="155" height="107"/>
<img src="https://dataease.io/images/dataSource/API.jpg" alt="API" border="0" width="155" height="107"/>
<img src="https://dataease.io/images/dataSource/TiDB.jpg" alt="TiDB" border="0" width="155" height="107"/>
<img src="https://dataease.io/images/dataSource/StarRocks.jpg" alt="StarRocks" border="0" width="155" height="107"/>
<img src="https://dataease.io/images/dataSource/PrestoDB.jpg" alt="PrestoDB" border="0" width="155" height="107"/>
</p>
> 更多数据源支持持续增加中...
## UI 展示
## DataEase 模板市场
![de-ui](https://dataease.io/docs/img/index/%E7%95%8C%E9%9D%A2%E5%B1%95%E7%A4%BA.gif)
- [模板市场](https://dataease.io/templates/)
## 在线体验
![模板市场](https://dataease.io/images/templates/templates.gif)
> 更多优质模板持续增加中...
## 快速开始
**在线体验**
- 环境地址:<https://dataease.fit2cloud.com/>
- 用户名demo
- 密码dataease
## 快速开始
**一键安装**
仅需两步快速安装 DataEase
@ -73,15 +79,17 @@ DataEase 是开源的数据可视化分析工具,帮助用户快速分析数
curl -sSL https://github.com/dataease/dataease/releases/latest/download/quick_start.sh | sh
```
**学习资料**
- [在线文档](https://dataease.io/docs/)
- [教学视频](https://dataease.io/video.html)
- [在线学习班](https://edu.fit2cloud.com/page/2635362?navIndex=0)
## 微信群
**加入微信交流群**
<img src="https://dataease.oss-cn-hangzhou.aliyuncs.com/img/wechat-group.png" width="156" height="156"/>
## 技术栈
## DataEase 的技术栈
- 前端:[Vue.js](https://vuejs.org/)、[Element](https://element.eleme.cn/)
- 图库:[Apache ECharts](https://github.com/apache/echarts)、[AntV](https://antv.vision/zh)

View File

@ -2,6 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>dataease-server</artifactId>
<groupId>io.dataease</groupId>
@ -11,26 +12,22 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>backend</artifactId>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<shiro.version>1.7.1</shiro.version>
<java.version>1.8</java.version>
<graalvm.version>20.1.0</graalvm.version>
<jwt.version>3.12.1</jwt.version>
<buji.version>4.0.0</buji.version>
<pac4j.version>3.3.0</pac4j.version>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
@ -39,14 +36,11 @@
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
@ -57,18 +51,15 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId>
@ -86,9 +77,6 @@
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-websocket</artifactId>
@ -97,7 +85,6 @@
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</dependency>
<!-- flyway -->
<dependency>
<groupId>org.flywaydb</groupId>
@ -112,7 +99,7 @@
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper</artifactId>
<version>5.0.3</version>
<version>5.3.0</version>
</dependency>
<dependency>
<groupId>org.apache.shiro</groupId>
@ -179,7 +166,6 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.fit2cloud</groupId>
<artifactId>quartz-spring-boot-starter</artifactId>
@ -191,15 +177,11 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
<version>1.21</version>
</dependency>
<!--xpath不加这个依赖会报错-->
<dependency>
<groupId>jaxen</groupId>
@ -229,8 +211,6 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.dataease</groupId>
<artifactId>dataease-plugin-interface</artifactId>
@ -246,8 +226,6 @@
<artifactId>dataease-plugin-datasource</artifactId>
<version>1.12.0</version>
</dependency>
<!-- kettle及数据源依赖 -->
<dependency>
<groupId>pentaho-kettle</groupId>
@ -296,18 +274,15 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
</dependency>
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.14.3</version>
</dependency>
<dependency>
<groupId>com.jayway.jsonpath</groupId>
<artifactId>json-path</artifactId>
@ -319,21 +294,14 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-pool2</artifactId>
</dependency>
<dependency>
<groupId>com.github.jsqlparser</groupId>
<artifactId>jsqlparser</artifactId>
<version>4.4</version>
</dependency>
</dependencies>
<build>
@ -348,7 +316,6 @@
</resource>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<excludes>
<exclude>static/**/*.woff</exclude>
@ -357,7 +324,6 @@
<exclude>static/**/*.ico</exclude>
</excludes>
</resource>
<resource>
<directory>src/main/resources</directory>
<filtering>false</filtering>
@ -369,8 +335,8 @@
</includes>
</resource>
</resources>
<plugins>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
@ -401,12 +367,6 @@
<skipTests>true</skipTests>
</configuration>
</plugin>
<!--<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.4.3</version>
</plugin>-->
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<configuration>
@ -436,14 +396,12 @@
<target>1.8</target>
</configuration>
</plugin>
<!-- Overlay guacamole-common-js (zip) -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.6</version>
</plugin>
<plugin>
<groupId>org.mybatis.generator</groupId>
<artifactId>mybatis-generator-maven-plugin</artifactId>
@ -465,8 +423,6 @@
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
@ -481,7 +437,6 @@
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
@ -502,17 +457,13 @@
<include name="*.html"/>
</fileset>
</move>
<copy todir="src/main/resources/static/de-app">
<fileset dir="../mobile/dist">
<exclude name="*.html"/>
</fileset>
</copy>
<copy file="../mobile/dist/index.html" tofile="src/main/resources/templates/app.html" />
<copy file="../mobile/dist/index.html"
tofile="src/main/resources/templates/app.html"/>
</target>
</configuration>
<goals>
@ -524,7 +475,6 @@
</plugins>
</build>
</profile>
<profile>
<id>stage</id>
<properties>
@ -533,7 +483,6 @@
</profile>
</profiles>
<repositories>
<repository>
<id>pentaho-public</id>

View File

@ -4,9 +4,13 @@ import io.dataease.auth.annotation.DePermission;
import io.dataease.auth.annotation.DePermissions;
import io.dataease.auth.entity.AuthItem;
import io.dataease.auth.util.ReflectUtil;
import io.dataease.commons.constants.DePermissionType;
import io.dataease.commons.utils.AuthUtils;
import io.dataease.commons.utils.LogUtil;
import io.dataease.dto.log.FolderItem;
import io.dataease.i18n.Translator;
import io.dataease.service.sys.log.LogManager;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.authz.UnauthorizedException;
import org.apache.shiro.authz.annotation.Logical;
import org.aspectj.lang.ProceedingJoinPoint;
@ -15,6 +19,7 @@ import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.reflect.MethodSignature;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.lang.reflect.Array;
import java.lang.reflect.Method;
import java.util.*;
@ -24,6 +29,9 @@ import java.util.stream.Collectors;
@Component
public class DePermissionAnnotationHandler {
@Resource
private LogManager logManager;
@Around(value = "@annotation(io.dataease.auth.annotation.DePermissions)")
public Object PermissionsAround(ProceedingJoinPoint point) throws Throwable {
@ -31,66 +39,59 @@ public class DePermissionAnnotationHandler {
return point.proceed(point.getArgs());
}
Boolean access = false;
try {
MethodSignature ms = (MethodSignature) point.getSignature();
Method method = ms.getMethod();
DePermissions annotation = method.getAnnotation(DePermissions.class);
Logical logical = annotation.logical();
DePermission[] dePermissions = annotation.value();
Object[] args = point.getArgs();
if (logical == Logical.AND) {
access = true;
for (int i = 0; i < dePermissions.length; i++) {
DePermission permission = dePermissions[i];
boolean currentAccess = access(args[permission.paramIndex()], permission, 0);
if (!currentAccess) {
access = false;
break;
}
}
} else {
List<Exception> exceptions = new ArrayList<>();
for (int i = 0; i < dePermissions.length; i++) {
DePermission permission = dePermissions[i];
try {
boolean currentAccess = access(args[permission.paramIndex()], permission, 0);
if (currentAccess) {
access = true;
break;
}
} catch (Exception e) {
exceptions.add(e);
}
}
if (!access && exceptions.size() > 0) {
throw exceptions.get(0);
MethodSignature ms = (MethodSignature) point.getSignature();
Method method = ms.getMethod();
DePermissions annotation = method.getAnnotation(DePermissions.class);
Logical logical = annotation.logical();
DePermission[] dePermissions = annotation.value();
Object[] args = point.getArgs();
if (logical == Logical.AND) {
access = true;
for (int i = 0; i < dePermissions.length; i++) {
DePermission permission = dePermissions[i];
boolean currentAccess = access(args[permission.paramIndex()], permission, 0);
if (!currentAccess) {
access = false;
break;
}
}
} catch (Throwable throwable) {
LogUtil.error(throwable.getMessage(), throwable);
throw new RuntimeException(throwable.getMessage());
} else {
List<Exception> exceptions = new ArrayList<>();
for (int i = 0; i < dePermissions.length; i++) {
DePermission permission = dePermissions[i];
try {
boolean currentAccess = access(args[permission.paramIndex()], permission, 0);
if (currentAccess) {
access = true;
break;
}
} catch (Exception e) {
exceptions.add(e);
}
}
if (!access && exceptions.size() > 0) {
throw exceptions.get(0);
}
}
return access ? point.proceed(point.getArgs()) : null;
}
@Around(value = "@annotation(io.dataease.auth.annotation.DePermission)")
public Object PermissionAround(ProceedingJoinPoint point) throws Throwable {
Boolean access = false;
try {
if (AuthUtils.getUser().getIsAdmin()) {
return point.proceed(point.getArgs());
}
MethodSignature ms = (MethodSignature) point.getSignature();
Method method = ms.getMethod();
DePermission annotation = method.getAnnotation(DePermission.class);
Object arg = point.getArgs()[annotation.paramIndex()];
if (access(arg, annotation, 0)) {
access = true;
}
} catch (Throwable throwable) {
LogUtil.error(throwable.getMessage(), throwable);
throw new RuntimeException(throwable.getMessage());
if (AuthUtils.getUser().getIsAdmin()) {
return point.proceed(point.getArgs());
}
MethodSignature ms = (MethodSignature) point.getSignature();
Method method = ms.getMethod();
DePermission annotation = method.getAnnotation(DePermission.class);
Object arg = point.getArgs()[annotation.paramIndex()];
if (access(arg, annotation, 0)) {
access = true;
}
return access ? point.proceed(point.getArgs()) : null;
}
@ -107,8 +108,7 @@ public class DePermissionAnnotationHandler {
boolean permissionValid = resourceIds.contains(arg);
if (permissionValid)
return true;
throw new UnauthorizedException("Subject does not have permission[" + annotation.level().name() + ":"
+ annotation.type() + ":" + arg + "]");
throw new UnauthorizedException(msgI18n(arg, annotation));
} else if (ReflectUtil.isArray(parameterType)) {
for (int i = 0; i < Array.getLength(arg); i++) {
Object o = Array.get(arg, i);
@ -139,4 +139,26 @@ public class DePermissionAnnotationHandler {
}
return true;
}
private String msgI18n(Object arg, DePermission annotation) {
int sourceTypeValue = 0;
DePermissionType type = annotation.type();
if (type == DePermissionType.DATASOURCE) {
sourceTypeValue = 1;
}
if (type == DePermissionType.DATASET) {
sourceTypeValue = 2;
}
if (type == DePermissionType.PANEL) {
sourceTypeValue = 3;
}
String name = arg.toString();
if (sourceTypeValue > 0) {
FolderItem sourceInfo = logManager.nameWithId(arg.toString(), sourceTypeValue);
if (ObjectUtils.isNotEmpty(sourceInfo))
name = StringUtils.isNotBlank(sourceInfo.getName()) ? sourceInfo.getName() : arg.toString();
}
String msg = Translator.get("I18N_NO_PERMISSION") + "[" + Translator.get("I18N_" + annotation.level().name()) + ": " + Translator.get("SOURCE_TYPE_" + annotation.type().name()) + ": " + name + "]," + Translator.get("I18N_PLEASE_CONCAT_ADMIN");
return msg;
}
}

View File

@ -44,7 +44,6 @@ public class DePermissionProxyHandler {
return point.proceed(args);
} catch (Throwable throwable) {
LogUtil.error(throwable.getMessage(), throwable);
/* throw new RuntimeException(throwable.getMessage()); */
DataEaseException.throwException(throwable);
} finally {
AuthUtils.cleanProxyUser();

View File

@ -74,6 +74,7 @@ public class ShiroServiceImpl implements ShiroService {
filterChainDefinitionMap.put("/api/auth/login", ANON);
filterChainDefinitionMap.put("/api/auth/logout", ANON);
filterChainDefinitionMap.put("/api/auth/isPluginLoaded", ANON);
filterChainDefinitionMap.put("/system/requestTimeOut", ANON);
filterChainDefinitionMap.put("/api/auth/validateName", ANON);

View File

@ -3,7 +3,6 @@ package io.dataease.controller.dataset;
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import io.dataease.auth.annotation.DePermission;
import io.dataease.commons.constants.DePermissionType;
import io.dataease.commons.constants.ResourceAuthLevel;
import io.dataease.plugins.common.base.domain.DatasetTableFunction;
import io.dataease.service.dataset.DatasetFunctionService;
import io.swagger.annotations.Api;
@ -28,7 +27,7 @@ public class DatasetFunctionController {
@Resource
private DatasetFunctionService datasetFunctionService;
@DePermission(type = DePermissionType.DATASET, level = ResourceAuthLevel.DATASET_LEVEL_MANAGE)
@DePermission(type = DePermissionType.DATASET)
@ApiOperation("查询")
@PostMapping("listByTableId/{tableId}")
public List<DatasetTableFunction> listByTableId(@PathVariable String tableId) {

View File

@ -68,11 +68,12 @@ public class SystemParameterController {
@RequiresPermissions("sysparam:read")
@PostMapping("/edit/basic")
public CasSaveResult editBasic(@RequestBody List<SystemParameter> systemParameter) {
int timeout = Integer.parseInt(systemParameter.stream().filter(
parameter -> parameter.getParamKey().equals("basic.frontTimeOut")
).findFirst().get().getParamValue());
if (timeout < 0 || timeout > 300) { //增加了合法性检验
throw new NumberFormatException("Timeout Range Error!");
String value = systemParameter.stream().filter(parameter -> parameter.getParamKey().equals("basic.frontTimeOut")).findFirst().get().getParamValue();
if (StringUtils.isNotBlank(value)) {
int timeout = Integer.parseInt(value);
if (timeout < 0 || timeout > 300) { //增加了合法性检验
throw new NumberFormatException("Timeout Range Error!");
}
}
return systemParameterService.editBasic(systemParameter);
}

View File

@ -1,9 +0,0 @@
package io.dataease.provider;
import org.apache.commons.lang3.StringUtils;
public class Utils {
public static boolean joinSort(String sort) {
return (StringUtils.equalsIgnoreCase(sort, "asc") || StringUtils.equalsIgnoreCase(sort, "desc"));
}
}

View File

@ -15,7 +15,6 @@ import io.dataease.plugins.common.dto.datasource.DeSortField;
import io.dataease.plugins.common.dto.sqlObj.SQLObj;
import io.dataease.plugins.common.request.chart.ChartExtFilterRequest;
import io.dataease.plugins.datasource.query.QueryProvider;
import io.dataease.provider.Utils;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
@ -23,6 +22,7 @@ import org.springframework.stereotype.Service;
import org.stringtemplate.v4.ST;
import org.stringtemplate.v4.STGroup;
import org.stringtemplate.v4.STGroupFile;
import io.dataease.plugins.datasource.query.Utils;
import javax.annotation.Resource;
import java.text.MessageFormat;

View File

@ -15,7 +15,6 @@ import io.dataease.plugins.common.dto.datasource.DeSortField;
import io.dataease.plugins.common.dto.sqlObj.SQLObj;
import io.dataease.plugins.common.request.chart.ChartExtFilterRequest;
import io.dataease.plugins.datasource.query.QueryProvider;
import io.dataease.provider.Utils;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
@ -23,6 +22,7 @@ import org.springframework.stereotype.Service;
import org.stringtemplate.v4.ST;
import org.stringtemplate.v4.STGroup;
import org.stringtemplate.v4.STGroupFile;
import io.dataease.plugins.datasource.query.Utils;
import javax.annotation.Resource;
import java.text.MessageFormat;

View File

@ -16,7 +16,6 @@ import io.dataease.plugins.common.dto.datasource.DeSortField;
import io.dataease.plugins.common.dto.sqlObj.SQLObj;
import io.dataease.plugins.common.request.chart.ChartExtFilterRequest;
import io.dataease.plugins.datasource.query.QueryProvider;
import io.dataease.provider.Utils;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
@ -24,6 +23,7 @@ import org.springframework.stereotype.Service;
import org.stringtemplate.v4.ST;
import org.stringtemplate.v4.STGroup;
import org.stringtemplate.v4.STGroupFile;
import io.dataease.plugins.datasource.query.Utils;
import javax.annotation.Resource;
import java.text.MessageFormat;

View File

@ -18,7 +18,6 @@ import io.dataease.plugins.common.dto.datasource.DeSortField;
import io.dataease.plugins.common.dto.sqlObj.SQLObj;
import io.dataease.plugins.common.request.chart.ChartExtFilterRequest;
import io.dataease.plugins.datasource.query.QueryProvider;
import io.dataease.provider.Utils;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
@ -26,6 +25,7 @@ import org.springframework.stereotype.Service;
import org.stringtemplate.v4.ST;
import org.stringtemplate.v4.STGroup;
import org.stringtemplate.v4.STGroupFile;
import io.dataease.plugins.datasource.query.Utils;
import javax.annotation.Resource;
import java.text.MessageFormat;

View File

@ -16,7 +16,6 @@ import io.dataease.plugins.common.dto.datasource.DeSortField;
import io.dataease.plugins.common.dto.sqlObj.SQLObj;
import io.dataease.plugins.common.request.chart.ChartExtFilterRequest;
import io.dataease.plugins.datasource.query.QueryProvider;
import io.dataease.provider.Utils;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
@ -24,6 +23,7 @@ import org.springframework.stereotype.Service;
import org.stringtemplate.v4.ST;
import org.stringtemplate.v4.STGroup;
import org.stringtemplate.v4.STGroupFile;
import io.dataease.plugins.datasource.query.Utils;
import javax.annotation.Resource;
import java.text.MessageFormat;

View File

@ -16,7 +16,6 @@ import io.dataease.plugins.common.dto.datasource.DeSortField;
import io.dataease.plugins.common.dto.sqlObj.SQLObj;
import io.dataease.plugins.common.request.chart.ChartExtFilterRequest;
import io.dataease.plugins.datasource.query.QueryProvider;
import io.dataease.provider.Utils;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
@ -24,6 +23,7 @@ import org.springframework.stereotype.Service;
import org.stringtemplate.v4.ST;
import org.stringtemplate.v4.STGroup;
import org.stringtemplate.v4.STGroupFile;
import io.dataease.plugins.datasource.query.Utils;
import javax.annotation.Resource;
import java.text.MessageFormat;

View File

@ -16,7 +16,6 @@ import io.dataease.plugins.common.dto.datasource.DeSortField;
import io.dataease.plugins.common.dto.sqlObj.SQLObj;
import io.dataease.plugins.common.request.chart.ChartExtFilterRequest;
import io.dataease.plugins.datasource.query.QueryProvider;
import io.dataease.provider.Utils;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
@ -24,6 +23,7 @@ import org.springframework.stereotype.Service;
import org.stringtemplate.v4.ST;
import org.stringtemplate.v4.STGroup;
import org.stringtemplate.v4.STGroupFile;
import io.dataease.plugins.datasource.query.Utils;
import javax.annotation.Resource;
import java.text.MessageFormat;

View File

@ -16,7 +16,6 @@ import io.dataease.plugins.common.dto.datasource.DeSortField;
import io.dataease.plugins.common.dto.sqlObj.SQLObj;
import io.dataease.plugins.common.request.chart.ChartExtFilterRequest;
import io.dataease.plugins.datasource.query.QueryProvider;
import io.dataease.provider.Utils;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
@ -24,6 +23,7 @@ import org.springframework.stereotype.Service;
import org.stringtemplate.v4.ST;
import org.stringtemplate.v4.STGroup;
import org.stringtemplate.v4.STGroupFile;
import io.dataease.plugins.datasource.query.Utils;
import javax.annotation.Resource;
import java.text.MessageFormat;

View File

@ -16,7 +16,6 @@ import io.dataease.plugins.common.dto.datasource.DeSortField;
import io.dataease.plugins.common.dto.sqlObj.SQLObj;
import io.dataease.plugins.common.request.chart.ChartExtFilterRequest;
import io.dataease.plugins.datasource.query.QueryProvider;
import io.dataease.provider.Utils;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
@ -24,6 +23,7 @@ import org.springframework.stereotype.Service;
import org.stringtemplate.v4.ST;
import org.stringtemplate.v4.STGroup;
import org.stringtemplate.v4.STGroupFile;
import io.dataease.plugins.datasource.query.Utils;
import javax.annotation.Resource;
import java.text.MessageFormat;

View File

@ -18,7 +18,6 @@ import io.dataease.plugins.common.dto.sqlObj.SQLObj;
import io.dataease.plugins.common.request.chart.ChartExtFilterRequest;
import io.dataease.plugins.datasource.entity.JdbcConfiguration;
import io.dataease.plugins.datasource.query.QueryProvider;
import io.dataease.provider.Utils;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
@ -26,6 +25,7 @@ import org.springframework.stereotype.Service;
import org.stringtemplate.v4.ST;
import org.stringtemplate.v4.STGroup;
import org.stringtemplate.v4.STGroupFile;
import io.dataease.plugins.datasource.query.Utils;
import javax.annotation.Resource;
import java.text.MessageFormat;

View File

@ -18,7 +18,6 @@ import io.dataease.plugins.common.dto.sqlObj.SQLObj;
import io.dataease.plugins.common.request.chart.ChartExtFilterRequest;
import io.dataease.plugins.datasource.entity.JdbcConfiguration;
import io.dataease.plugins.datasource.query.QueryProvider;
import io.dataease.provider.Utils;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
@ -26,6 +25,7 @@ import org.springframework.stereotype.Service;
import org.stringtemplate.v4.ST;
import org.stringtemplate.v4.STGroup;
import org.stringtemplate.v4.STGroupFile;
import io.dataease.plugins.datasource.query.Utils;
import javax.annotation.Resource;
import java.text.MessageFormat;

View File

@ -19,7 +19,6 @@ import io.dataease.plugins.common.dto.sqlObj.SQLObj;
import io.dataease.plugins.common.request.chart.ChartExtFilterRequest;
import io.dataease.plugins.datasource.entity.JdbcConfiguration;
import io.dataease.plugins.datasource.query.QueryProvider;
import io.dataease.provider.Utils;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
@ -27,6 +26,7 @@ import org.springframework.stereotype.Service;
import org.stringtemplate.v4.ST;
import org.stringtemplate.v4.STGroup;
import org.stringtemplate.v4.STGroupFile;
import io.dataease.plugins.datasource.query.Utils;
import javax.annotation.Resource;
import java.text.MessageFormat;

View File

@ -17,7 +17,6 @@ import io.dataease.plugins.common.dto.sqlObj.SQLObj;
import io.dataease.plugins.common.request.chart.ChartExtFilterRequest;
import io.dataease.plugins.datasource.entity.JdbcConfiguration;
import io.dataease.plugins.datasource.query.QueryProvider;
import io.dataease.provider.Utils;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
@ -25,6 +24,7 @@ import org.springframework.stereotype.Service;
import org.stringtemplate.v4.ST;
import org.stringtemplate.v4.STGroup;
import org.stringtemplate.v4.STGroupFile;
import io.dataease.plugins.datasource.query.Utils;
import javax.annotation.Resource;
import java.text.MessageFormat;

View File

@ -63,6 +63,12 @@ public class ChartViewFieldService {
chartViewFieldMapper.deleteByExample(chartViewFieldExample);
}
public void deleteByChartIds(List<String> chartIds) {
ChartViewFieldExample chartViewFieldExample = new ChartViewFieldExample();
chartViewFieldExample.createCriteria().andChartIdIn(chartIds);
chartViewFieldMapper.deleteByExample(chartViewFieldExample);
}
public void checkFieldName(ChartViewField chartViewField) {
if (StringUtils.isNotEmpty(chartViewField.getName()) && StringUtils.isNotEmpty(chartViewField.getChartId())) {
ChartViewFieldExample chartViewFieldExample = new ChartViewFieldExample();
@ -77,4 +83,17 @@ public class ChartViewFieldService {
}
}
}
public void copyField(String sourceChartId, String targetChartId) {
ChartViewFieldExample chartViewFieldExample = new ChartViewFieldExample();
chartViewFieldExample.createCriteria().andChartIdEqualTo(sourceChartId);
List<ChartViewField> chartViewFields = chartViewFieldMapper.selectByExampleWithBLOBs(chartViewFieldExample);
if (CollectionUtils.isNotEmpty(chartViewFields)) {
for (ChartViewField field : chartViewFields) {
field.setId(null);
field.setChartId(targetChartId);
save(field);
}
}
}
}

View File

@ -103,6 +103,8 @@ public class ChartViewService {
private ExtPanelGroupExtendDataMapper extPanelGroupExtendDataMapper;
@Resource
private ChartViewCacheService chartViewCacheService;
@Resource
private ChartViewFieldService chartViewFieldService;
//默认使用非公平
@ -450,7 +452,7 @@ public class ChartViewService {
datasourceRequest.setQuery(qp.getSQL(dataTableInfoDTO.getTable(), xAxis, yAxis, fieldCustomFilter, extFilterList, ds, view));
}
} else if (StringUtils.equalsIgnoreCase(table.getType(), DatasetType.SQL.name())) {
String sql = dataTableInfoDTO.getSql();
String sql = dataTableInfoDTO.getSql();
sql = handleVariable(sql, requestList);
if (StringUtils.equalsIgnoreCase("text", view.getType()) || StringUtils.equalsIgnoreCase("gauge", view.getType()) || StringUtils.equalsIgnoreCase("liquid", view.getType())) {
datasourceRequest.setQuery(qp.getSQLSummaryAsTmp(sql, yAxis, fieldCustomFilter, extFilterList, view));
@ -543,9 +545,14 @@ public class ChartViewService {
}.getType();
List<ChartViewFieldDTO> viewFields = gson.fromJson(view.getViewFields(), tokenType);
Map<String, List<ChartViewFieldDTO>> extFieldsMap = null;
final Map<String, List<ChartViewFieldDTO>> extFieldsMap = new LinkedHashMap<>();
if (CollectionUtils.isNotEmpty(viewFields)) {
extFieldsMap = viewFields.stream().collect(Collectors.groupingBy(ChartViewFieldDTO::getBusiType));
viewFields.forEach(field -> {
String busiType = field.getBusiType();
List<ChartViewFieldDTO> list = extFieldsMap.containsKey(busiType) ? extFieldsMap.get(busiType) : new ArrayList<>();
list.add(field);
extFieldsMap.put(field.getBusiType(), list);
});
}
@ -773,12 +780,12 @@ public class ChartViewService {
// 如果是插件视图 走插件内部的逻辑
if (ObjectUtils.isNotEmpty(view.getIsPlugin()) && view.getIsPlugin()) {
Map<String, List<ChartViewFieldDTO>> fieldMap = ObjectUtils.isEmpty(extFieldsMap) ? new HashMap<>() : extFieldsMap;
Map<String, List<ChartViewFieldDTO>> fieldMap = ObjectUtils.isEmpty(extFieldsMap) ? new LinkedHashMap<>() : extFieldsMap;
fieldMap.put("yAxis", yAxis);
fieldMap.put("extStack", extStack);
fieldMap.put("extBubble", extBubble);
fieldMap.put("xAxis", xAxis);
fieldMap.put("yAxis", yAxis);
PluginViewParam pluginViewParam = buildPluginParam(fieldMap, fieldCustomFilter, extFilterList, ds, table, view);
String sql = pluginViewSql(pluginViewParam, view);
if (StringUtils.isBlank(sql)) {
@ -821,7 +828,7 @@ public class ChartViewService {
datasourceRequest.setQuery(qp.getSQL(dataTableInfoDTO.getTable(), xAxis, yAxis, fieldCustomFilter, extFilterList, ds, view));
}
} else if (StringUtils.equalsIgnoreCase(table.getType(), DatasetType.SQL.name())) {
String sql = dataTableInfoDTO.getSql();
String sql = dataTableInfoDTO.getSql();
sql = handleVariable(sql, requestList);
if (StringUtils.equalsIgnoreCase("text", view.getType()) || StringUtils.equalsIgnoreCase("gauge", view.getType()) || StringUtils.equalsIgnoreCase("liquid", view.getType())) {
datasourceRequest.setQuery(qp.getSQLSummaryAsTmp(sql, yAxis, fieldCustomFilter, extFilterList, view));
@ -1344,6 +1351,7 @@ public class ChartViewService {
extChartViewMapper.copyCache(sourceViewId, newViewId);
extPanelGroupExtendDataMapper.copyExtendData(sourceViewId, newViewId, panelId);
chartViewCacheService.refreshCache(newViewId);
chartViewFieldService.copyField(sourceViewId, newViewId);
return newViewId;
}
@ -1492,17 +1500,20 @@ public class ChartViewService {
chartViewMapper.updateByPrimaryKeySelective(chartView);
}
private String handleVariable(String sql, ChartExtRequest requestList)throws Exception{
if(requestList !=null &&CollectionUtils.isNotEmpty(requestList.getFilter()) ){
private String handleVariable(String sql, ChartExtRequest requestList) throws Exception {
if (requestList != null && CollectionUtils.isNotEmpty(requestList.getFilter())) {
for (ChartExtFilterRequest chartExtFilterRequest : requestList.getFilter()) {
if(CollectionUtils.isEmpty(chartExtFilterRequest.getValue())){
if (CollectionUtils.isEmpty(chartExtFilterRequest.getValue())) {
continue;
}
if(chartExtFilterRequest.getValue().size() > 1){
if(CollectionUtils.isEmpty(chartExtFilterRequest.getParameters())){
continue;
}
if (chartExtFilterRequest.getValue().size() > 1) {
for (String parameter : chartExtFilterRequest.getParameters()) {
sql = sql.replace("${" + parameter + "}", String.join(",", chartExtFilterRequest.getValue()));
}
}else {
} else {
for (String parameter : chartExtFilterRequest.getParameters()) {
sql = sql.replace("${" + parameter + "}", chartExtFilterRequest.getValue().get(0));
}

View File

@ -101,12 +101,13 @@ public class ViewPluginBaseServiceImpl implements ViewPluginBaseService {
if (ObjectUtils.isNotEmpty(pluginViewSet.getMode()) && 1 == pluginViewSet.getMode()) {
tableName = TableUtils.tableName(pluginViewSet.getTabelId());
}else {
switch (DatasetType.valueOf(pluginViewSet.getType())) {
switch (DatasetType.getEnumObjByKey(pluginViewSet.getType())) {
case DB:
tableName = dataTableInfoDTO.getTable();
break;
case SQL:
tableName = dataSetTableService.handleVariableDefaultValue(dataTableInfoDTO.getSql(), pluginViewSet.getSqlVariableDetails());
tableName = "(" + tableName + ")";
break;
case CUSTOM:
List<DataSetTableUnionDTO> list = dataSetTableUnionService.listByTableId(dataTableInfoDTO.getList().get(0).getTableId());

View File

@ -8,6 +8,8 @@ import com.google.gson.reflect.TypeToken;
import io.dataease.auth.annotation.DeCleaner;
import io.dataease.auth.api.dto.CurrentUserDto;
import io.dataease.controller.request.chart.ChartExtRequest;
import io.dataease.controller.sys.base.BaseGridRequest;
import io.dataease.controller.sys.base.ConditionEntity;
import io.dataease.dto.SysLogDTO;
import io.dataease.ext.ExtDataSetGroupMapper;
import io.dataease.ext.ExtDataSetTableMapper;
@ -32,7 +34,6 @@ import io.dataease.plugins.common.constants.DatasetType;
import io.dataease.plugins.common.constants.DatasourceTypes;
import io.dataease.plugins.common.dto.chart.ChartFieldCustomFilterDTO;
import io.dataease.plugins.common.dto.datasource.TableField;
import io.dataease.plugins.common.request.chart.ChartExtFilterRequest;
import io.dataease.plugins.common.request.datasource.DatasourceRequest;
import io.dataease.plugins.datasource.provider.Provider;
import io.dataease.plugins.datasource.query.QueryProvider;
@ -80,7 +81,6 @@ import javax.annotation.Resource;
import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.StringReader;
import java.math.BigDecimal;
import java.text.MessageFormat;
import java.text.NumberFormat;
@ -133,6 +133,8 @@ public class DataSetTableService {
private SysAuthService sysAuthService;
@Resource
private ChartViewMapper chartViewMapper;
@Resource
private DataSetTableTaskLogService dataSetTableTaskLogService;
private static boolean isUpdatingDatasetTableStatus = false;
private static final String lastUpdateTime = "${__last_update_time__}";
@ -526,6 +528,7 @@ public class DataSetTableService {
public Map<String, Object> getPreviewData(DataSetTableRequest dataSetTableRequest, Integer page, Integer pageSize,
List<DatasetTableField> extFields) throws Exception {
Map<String, Object> map = new HashMap<>();
String sycnStatus = "";
DatasetTableField datasetTableField = DatasetTableField.builder().tableId(dataSetTableRequest.getId())
.checked(Boolean.TRUE).build();
List<DatasetTableField> fields = dataSetTableFieldsService.list(datasetTableField);
@ -737,6 +740,20 @@ public class DataSetTableService {
logger.error(e.getMessage());
DEException.throwException(Translator.get("i18n_ds_error") + "->" + e.getMessage());
}
BaseGridRequest request = new BaseGridRequest();
ConditionEntity entity2 = new ConditionEntity();
entity2.setField("dataset_table_task_log.table_id");
entity2.setOperator("eq");
entity2.setValue(dataSetTableRequest.getId());
List<ConditionEntity> conditionEntities = new ArrayList<>();
conditionEntities.add(entity2);
request.setConditions(conditionEntities);
List<DataSetTaskLogDTO> dataSetTaskLogDTOS = dataSetTableTaskLogService.listTaskLog(request, "excel");
if(CollectionUtils.isNotEmpty(dataSetTaskLogDTOS)){
dataSetTaskLogDTOS.get(0).getStatus().equalsIgnoreCase(JobStatus.Underway.name());
sycnStatus = dataSetTaskLogDTOS.get(0).getStatus();
}
} else if (StringUtils.equalsIgnoreCase(datasetTable.getType(), "custom")) {
if (datasetTable.getMode() == 0) {
Datasource ds = datasourceMapper.selectByPrimaryKey(dataSetTableRequest.getDataSourceId());
@ -902,6 +919,7 @@ public class DataSetTableService {
map.put("fields", fields);
map.put("data", jsonArray);
map.put("page", dataSetPreviewPage);
map.put("sycnStatus", sycnStatus);
return map;
}
@ -962,14 +980,22 @@ public class DataSetTableService {
public String removeVariables(String sql) throws Exception {
Pattern pattern = Pattern.compile(regex);
Matcher matcher = pattern.matcher(sql);
boolean hasVariables = false;
while (matcher.find()) {
hasVariables = true;
sql = sql.replace(matcher.group(), SubstitutedParams);
}
if(!hasVariables){
return sql;
}
CCJSqlParserUtil.parse(sql, parser -> parser.withSquareBracketQuotation(true));
Statement statement = CCJSqlParserUtil.parse(sql);
Select select = (Select) statement;
PlainSelect plainSelect = ((PlainSelect) select.getSelectBody());
Expression expr = plainSelect.getWhere();
if(expr == null){
return sql;
}
StringBuilder stringBuilder = new StringBuilder();
BinaryExpression binaryExpression = (BinaryExpression)expr;
@ -1814,11 +1840,11 @@ public class DataSetTableService {
}
datasetTableField.setSize(filed.getFieldSize());
datasetTableField.setChecked(true);
datasetTableField.setColumnIndex(i);
datasetTableField.setLastSyncTime(syncTime);
datasetTableField.setExtField(0);
datasetTableField.setGroupType((datasetTableField.getDeType() < 2 || datasetTableField.getDeType() == 6) ? "d" : "q");
}
datasetTableField.setColumnIndex(i);
dataSetTableFieldsService.save(datasetTableField);
}
// delete 数据库中多余的字段
@ -2517,11 +2543,11 @@ public class DataSetTableService {
return;
}
visitBinaryExpression(likeExpression, (likeExpression.isNot() ? " NOT" : "") + (likeExpression.isCaseInsensitive() ? " ILIKE " : " LIKE "));
Expression escape = likeExpression.getEscape();
visitBinaryExpression(likeExpression,
(likeExpression.isNot() ? " NOT" : "") + (likeExpression.isCaseInsensitive() ? " ILIKE " : " LIKE "));
String escape = likeExpression.getEscape();
if (escape != null) {
getBuffer().append(" ESCAPE ");
likeExpression.getEscape().accept(this);
buffer.append(" ESCAPE '").append(escape).append('\'');
}
}

View File

@ -143,7 +143,8 @@ public class DatasourceService {
}
if(datasourceDTO.getType().equalsIgnoreCase(DatasourceTypes.mysql.toString())){
datasourceDTO.setConfiguration(datasourceDTO.getConfiguration());
MysqlConfiguration mysqlConfiguration = new Gson().fromJson(datasourceDTO.getConfiguration(), MysqlConfiguration.class);
datasourceDTO.setConfiguration(new Gson().toJson(mysqlConfiguration));
}
if (datasourceDTO.getType().equalsIgnoreCase(DatasourceTypes.api.toString())) {
List<ApiDefinition> apiDefinitionList = new Gson().fromJson(datasourceDTO.getConfiguration(), new TypeToken<ArrayList<ApiDefinition>>() {}.getType());

View File

@ -11,14 +11,12 @@ import io.dataease.commons.exception.DEException;
import io.dataease.commons.utils.CodingUtil;
import io.dataease.commons.utils.DeFileUtils;
import io.dataease.commons.utils.LogUtil;
import io.dataease.commons.utils.ZipUtils;
import io.dataease.controller.sys.base.BaseGridRequest;
import io.dataease.i18n.Translator;
import io.dataease.listener.util.CacheUtils;
import io.dataease.plugins.common.base.domain.MyPlugin;
import io.dataease.plugins.common.base.mapper.MyPluginMapper;
import io.dataease.plugins.config.LoadjarUtil;
import io.dataease.plugins.config.SpringContextUtil;
import io.dataease.service.datasource.DatasourceService;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ArrayUtils;
@ -31,7 +29,6 @@ import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import java.io.File;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.util.Arrays;
import java.util.List;
@ -98,14 +95,14 @@ public class PluginService {
DeFileUtils.deleteFile(folder);
String msg = "缺少插件描述文件【plugin.json】";
LogUtil.error(msg);
DEException.throwException(new RuntimeException(msg));
DEException.throwException(msg);
}
MyPluginDTO myPlugin = formatJsonFile(jsonFiles[0]);
if (!versionMatch(myPlugin.getRequire())) {
String msg = "当前插件要求系统版本最低为:" + myPlugin.getRequire();
LogUtil.error(msg);
DEException.throwException(new RuntimeException(msg));
DEException.throwException(msg);
}
//4.加载jar包 失败则 直接返回错误 删除文件
File[] jarFiles = folderFile.listFiles(this::isPluginJar);
@ -114,13 +111,13 @@ public class PluginService {
DeFileUtils.deleteFile(folder);
String msg = "缺少插件jar文件";
LogUtil.error(msg);
DEException.throwException(new RuntimeException(msg));
DEException.throwException(msg);
}
if (pluginExist(myPlugin)) {
String msg = "插件【"+myPlugin.getName()+"】已存在,请先卸载";
LogUtil.error(msg);
DEException.throwException(new RuntimeException(msg));
DEException.throwException(msg);
}
String targetDir = null;
try {
@ -188,7 +185,7 @@ public class PluginService {
if (ObjectUtils.isEmpty(myPlugin)) {
String msg = "当前插件不存在";
LogUtil.error(msg);
DEException.throwException(new RuntimeException(msg));
DEException.throwException(msg);
}
deleteJarFile(myPlugin);
CacheUtils.removeAll(AuthConstants.USER_CACHE_NAME);
@ -197,7 +194,7 @@ public class PluginService {
if(myPlugin.getCategory().equalsIgnoreCase("datasource")){
if(CollectionUtils.isNotEmpty(datasourceService.selectByType(myPlugin.getDsType()))){
throw new RuntimeException(Translator.get("i18n_plugin_not_allow_delete"));
DEException.throwException(Translator.get("i18n_plugin_not_allow_delete"));
}
loadjarUtil.deleteModule(myPlugin.getModuleName() + "-" + myPlugin.getVersion());
}

View File

@ -264,7 +264,7 @@ public class LogService {
//文件名称
String fileName = "DataEase操作日志";
String encodeFileName = URLEncoder.encode(fileName, "UTF-8");
response.setHeader("Content-disposition", "attachment;filename="+encodeFileName+".xlsx");
response.setHeader("Content-disposition", "attachment;filename="+encodeFileName+".xls");
wb.write(outputStream);
outputStream.flush();
outputStream.close();

View File

@ -22,3 +22,8 @@ CREATE TABLE `chart_view_field`
ALTER TABLE `dataset_table` ADD COLUMN `sql_variable_details` LONGTEXT NULL AFTER `last_update_time`;
INSERT INTO `my_plugin` (`name`, `store`, `free`, `cost`, `category`, `descript`, `version`, `creator`, `load_mybatis`,
`install_time`, `module_name`, `ds_type`)
VALUES ('达梦数据源插件', 'default', '0', '0', 'datasource', '达梦数据源插件', '1.0-SNAPSHOT', 'DATAEASE', '0',
'1650765903630', 'dm-backend', 'dm');

View File

@ -163,3 +163,28 @@ i18n_user_not_exist=user does not exist
i18n_default_login_reset=Switched back to default login mode
I18N_COMMON_LEVEL_USE=Consult
I18N_PANNEL_LEVEL_VIEW=Consult
I18N_PANNEL_LEVEL_EXPORT=Export
I18N_PANNEL_LEVEL_MANAGE=Manage
I18N_PANNEL_LEVEL_GRANT=Grant
I18N_DATASET_LEVEL_USE=Consult
I18N_DATASET_LEVEL_MANAGE=Manage
I18N_DATASET_LEVEL_GRANT=Grant
I18N_LINK_LEVEL_USE=Consult
I18N_LINK_LEVEL_MANAGE=Manage
I18N_LINK_LEVEL_GRANT=Grant
I18N_DATASOURCE_LEVEL_USE=Consult
I18N_DATASOURCE_LEVEL_MANAGE=Manage
I18N_DATASOURCE_LEVEL_GRANT=Grant
I18N_NO_PERMISSION=You do not have permission to
I18N_PLEASE_CONCAT_ADMIN=Please contact the administrator for authorization

View File

@ -166,4 +166,27 @@ i18n_not_admin_error=不是管理员账号
i18n_user_not_exist=用户不存在
i18n_default_login_reset=已切换回默认登录方式
i18n_default_login_reset=已切换回默认登录方式
I18N_COMMON_LEVEL_USE=查看
I18N_PANNEL_LEVEL_VIEW=查看
I18N_PANNEL_LEVEL_EXPORT=导出
I18N_PANNEL_LEVEL_MANAGE=管理
I18N_PANNEL_LEVEL_GRANT=授权
I18N_DATASET_LEVEL_USE=查看
I18N_DATASET_LEVEL_MANAGE=管理
I18N_DATASET_LEVEL_GRANT=授权
I18N_LINK_LEVEL_USE=查看
I18N_LINK_LEVEL_MANAGE=管理
I18N_LINK_LEVEL_GRANT=授权
I18N_DATASOURCE_LEVEL_USE=查看
I18N_DATASOURCE_LEVEL_MANAGE=管理
I18N_DATASOURCE_LEVEL_GRANT=授权
I18N_NO_PERMISSION=当前用户没有权限
I18N_PLEASE_CONCAT_ADMIN=请联系管理员开通

View File

@ -159,4 +159,29 @@ I18N_DRIVER_NOT_FOUND=未找到驅動
i18n_not_admin_error=不是管理員賬號
i18n_user_not_exist=用戶不存在
i18n_default_login_reset=已切換回默認登錄方式
i18n_default_login_reset=已切換回默認登錄方式
I18N_COMMON_LEVEL_USE=查看
I18N_PANNEL_LEVEL_VIEW=查看
I18N_PANNEL_LEVEL_EXPORT=導出
I18N_PANNEL_LEVEL_MANAGE=管理
I18N_PANNEL_LEVEL_GRANT=授權
I18N_DATASET_LEVEL_USE=查看
I18N_DATASET_LEVEL_MANAGE=管理
I18N_DATASET_LEVEL_GRANT=授權
I18N_LINK_LEVEL_USE=查看
I18N_LINK_LEVEL_MANAGE=管理
I18N_LINK_LEVEL_GRANT=授權
I18N_DATASOURCE_LEVEL_USE=查看
I18N_DATASOURCE_LEVEL_MANAGE=管理
I18N_DATASOURCE_LEVEL_GRANT=授權
I18N_NO_PERMISSION=當前用戶沒有權限
I18N_PLEASE_CONCAT_ADMIN=請聯系管理員開通

View File

@ -61,4 +61,5 @@
</plugin>
</plugins>
</build>
</project>

View File

@ -470,15 +470,26 @@ export default {
_treeCheckFun(data, node, vm) {
this.ids = []
const { propsValue } = this
node.checkedNodes.forEach(item => {
const checkKeys = this.$refs.tree.getCheckedKeys()
checkKeys.forEach((i, n) => {
const node = this.$refs.tree.getNode(i)
if (!node.visible && node.checked) {
this.$refs.tree.setChecked(i, false)
}
})
const checkedNodes = this.$refs.tree.getCheckedNodes()
checkedNodes.forEach(item => {
this.ids.push(item[propsValue])
})
/*
点击复选框对外抛出 `data, node, vm`<br>
`data:` 当前点击的节点数据<br>
`node:` 当前点击的node<br>
`vm:` 当前组件的vm
*/
点击复选框对外抛出 `data, node, vm`<br>
`data:` 当前点击的节点数据<br>
`node:` 当前点击的node<br>
`vm:` 当前组件的vm
*/
node.checkedKeys = checkedNodes.map(node => node.id)
this.$emit('check', data, node, vm)
this._emitFun()
},
@ -551,6 +562,7 @@ export default {
// el
_popoverShowFun(val) {
this._updateH()
this.$emit('onFoucs')
},
//
_popoverHideFun(e) {

View File

@ -43,7 +43,7 @@
top="5vh"
>
<span v-if="chartDetailsVisible" style="position: absolute;right: 70px;top:15px">
<el-button v-if="showChartInfoType==='enlarge'" class="el-icon-picture-outline" size="mini" @click="exportViewImg">
<el-button v-if="showChartInfoType==='enlarge' && showChartInfo && showChartInfo.type !== 'symbol-map'" class="el-icon-picture-outline" size="mini" @click="exportViewImg">
{{ $t('chart.export_img') }}
</el-button>
<el-button v-if="showChartInfoType==='details'" size="mini" @click="exportExcel">

View File

@ -144,7 +144,7 @@
top="5vh"
>
<span v-if="chartDetailsVisible" style="position: absolute;right: 70px;top:15px">
<el-button v-if="showChartInfoType==='enlarge'" class="el-icon-picture-outline" size="mini" @click="exportViewImg">
<el-button v-if="showChartInfoType==='enlarge' && showChartInfo && showChartInfo.type !== 'symbol-map'" class="el-icon-picture-outline" size="mini" @click="exportViewImg">
{{ $t('chart.export_img') }}
</el-button>
<el-button v-if="showChartInfoType==='details'" size="mini" @click="exportExcel">

View File

@ -153,7 +153,7 @@
<div v-if="attrShow('titlePostion')" style="width: 20px;float: left;margin-top: 2px;margin-left: 10px;">
<el-tooltip content="标题位置">
<title-postion :show-vertical="showVertical" :style-info="styleInfo" />
<title-postion :elementType="elementType" :show-vertical="showVertical" :style-info="styleInfo" />
</el-tooltip>
</div>
<!--tab 内部组件样式-->
@ -352,6 +352,9 @@ export default {
styleInfo() {
return this.$store.state.curComponent.style
},
elementType() {
return this.$store.state.curComponent.component
},
canvasWidth() {
return this.canvasStyleData.width * this.curCanvasScale.scalePointWidth
},

View File

@ -1,5 +1,5 @@
<template>
<de-container v-loading="$store.getters.loadingMap[$store.getters.currentPath]">
<de-container v-loading="$store.getters.loadingMap[$store.getters.currentPath]" :class="isAbsoluteContainer ? 'abs-container' : ''">
<de-main-container v-show="showChartCanvas">
<div id="chartCanvas" class="canvas-class" :style="customStyle">
<div class="canvas-class" :style="commonStyle">
@ -66,7 +66,9 @@ export default {
}
},
computed: {
isAbsoluteContainer() {
return this.chart.type === 'symbol-map'
},
showChartCanvas() {
return this.openType === 'enlarge'
},
@ -229,4 +231,9 @@ export default {
height: 100%;
background-size: 100% 100% !important;
}
.abs-container {
position: absolute;
width: 100%;
margin-left: -20px;
}
</style>

View File

@ -19,6 +19,7 @@
<div class="first-element">
<div
:class="element.component === 'de-select-grid' ? 'first-element-grid-contaner': ''"
:style="deSelectGridBg"
class="first-element-contaner"
>
@ -27,6 +28,7 @@
v-if="element.type==='custom'"
:id="'component' + element.id"
class="component-custom"
ref="deOutWidget"
:out-style="element.style"
:element="element"
:in-draw="inDraw"
@ -44,8 +46,10 @@
<script>
import { mapState } from 'vuex'
import inputStyleMixin from '@/components/widget/DeWidget/inputStyleMixin'
export default {
name: 'DeOutWidget',
mixins: [inputStyleMixin],
props: {
element: {
type: Object,
@ -99,12 +103,23 @@ export default {
},
...mapState([
'curCanvasScale'
])
]),
deSelectGridBg() {
if (this.element.component !== 'de-select-grid') return null;
const { backgroundColorSelect, color } = this.element.commonBackground;
return {
background: backgroundColorSelect ? color : '#fff',
border: backgroundColorSelect ? 'none' : '1px solid #d7dae2'
}
},
isFilterComponent() {
return ['de-select', 'de-select-grid', 'de-date', "de-input-search", "de-number-range", "de-select-tree"].includes(this.element.component)
}
},
watch: {
'element.style': {
handler(val) {
this.handlerPositionChange(val)
this.handlerPositionChange(val);
},
deep: true,
immediate: true
@ -114,9 +129,13 @@ export default {
// this.watchSize()
},
created() {
const { horizontal, vertical } = this.element.style
// console.log('aaaaaa')
const { horizontal, vertical, brColor, wordColor, innerBgColor } = this.element.style
this.$set(this.element.style, 'horizontal', horizontal || 'left')
this.$set(this.element.style, 'vertical', vertical || 'center')
this.$set(this.element.style, 'brColor', brColor || '')
this.$set(this.element.style, 'wordColor', wordColor || '')
this.$set(this.element.style, 'innerBgColor', innerBgColor || '')
},
methods: {
handlerPositionChange(val) {
@ -128,7 +147,7 @@ export default {
this.outsideStyle = {
flexWrap: 'wrap'
}
if (vertical !== 'top') {
if (vertical !== 'top' && this.element.component !== 'de-select-grid') {
this.titleStyle = null
this.outsideStyle = {
flexDirection: horizontal === 'right' ? 'row-reverse' : '',

View File

@ -3,6 +3,7 @@
v-if="element.options!== null && element.options.attrs!==null"
ref="dateRef"
v-model="values"
popper-class="coustom-date-picker"
:type="element.options.attrs.type"
:range-separator="$t(element.options.attrs.rangeSeparator)"
:start-placeholder="$t(element.options.attrs.startPlaceholder)"
@ -26,8 +27,10 @@ import {
timeSection
} from '@/utils'
import bus from '@/utils/bus'
export default {
import customInput from '@/components/widget/DeWidget/customInput'
export default {
mixins: [customInput],
props: {
element: {
type: Object,
@ -133,6 +136,9 @@ export default {
},
toFocus() {
this.onFocus = true
this.$nextTick(() => {
this.handleCoustomStyle()
})
},
search() {
this.setCondition()
@ -204,6 +210,44 @@ export default {
</script>
<style lang="scss" scoped>
<style lang="scss">
.coustom-date-picker {
border:1px solid var(--BrDateColor, #dfe4ed) !important;
background: var(--BgDateColor, #FFFFFF) !important;
// .popper__arrow::after{
// border-bottom-color: var(--BgDateColor, #FFFFFF) !important;
// }
.popper__arrow,
.popper__arrow::after {
display: none !important;
}
.el-date-range-picker__content.is-left{
border-right:1px solid var(--BrDateColor, #e6ebf5) !important;
}
.el-date-table th,
.el-date-picker__header--bordered {
border-bottom:1px solid var(--BrDateColor, #e6ebf5) !important;
}
.el-date-range-picker__header,
.el-date-table th,
.el-date-table__row,
.el-month-table td .cell,
.el-year-table td .cell,
.el-picker-panel__icon-btn,
.el-date-picker__header-label{
color: var(--DateColor, #606266);
}
.el-month-table td.current:not(.disabled) .cell,
.el-month-table td.today:not(.disabled) .cell,
.el-year-table td.current:not(.disabled) .cell,
.el-year-table td.today:not(.disabled) .cell {
color: #409EFF;
}
}
</style>

View File

@ -6,6 +6,8 @@
resize="vertical"
:placeholder="$t(element.options.attrs.placeholder)"
:size="size"
class="de-range-tag"
ref="de-input-search"
@input="valueChange"
@keypress.enter.native="search"
@dblclick="setEdit"
@ -111,6 +113,10 @@ export default {
}
</script>
<style lang="scss" scoped>
<style lang="scss">
// .de-range-tag {
// input::placeholder {
// color: var(--CustomColor, #909399) !important;
// }
// }
</style>

View File

@ -3,11 +3,11 @@
<el-form v-if="element.options!== null && element.options.attrs!==null" ref="form" :model="form" :rules="rules">
<div class="de-number-range-container">
<el-form-item prop="min">
<el-input v-model="form.min" :placeholder="$t(element.options.attrs.placeholder_min)" :size="size" @input="inputChange" @change="handleMinChange" />
<el-input ref='de-number-range-min' v-model="form.min" :placeholder="$t(element.options.attrs.placeholder_min)" :size="size" @input="inputChange" @change="handleMinChange" />
</el-form-item>
<span>{{ $t('denumberrange.split_placeholder') }}</span>
<el-form-item prop="max">
<el-input v-model="form.max" :placeholder="$t(element.options.attrs.placeholder_max)" :size="size" @input="inputChange" @change="handleMaxChange" />
<el-input ref='de-number-range-max' v-model="form.max" :placeholder="$t(element.options.attrs.placeholder_max)" :size="size" @input="inputChange" @change="handleMaxChange" />
</el-form-item>
</div>
</el-form>

View File

@ -11,6 +11,8 @@
:popper-append-to-body="inScreen"
:size="size"
:filterable="true"
class="de-select-tag"
popper-class="coustom-de-select"
@change="changeValue"
@focus="setOptionWidth"
@blur="onBlur"
@ -32,8 +34,10 @@
import { multFieldValues, linkMultFieldValues } from '@/api/dataset/dataset'
import bus from '@/utils/bus'
import { getLinkToken, getToken } from '@/utils/auth'
export default {
import customInput from '@/components/widget/DeWidget/customInput'
export default {
mixins: [customInput],
props: {
element: {
type: Object,
@ -120,6 +124,7 @@ export default {
this.show = false
this.$nextTick(() => {
this.show = true
this.handleCoustomStyle()
})
},
'element.options.attrs.sort': function(value, old) {
@ -253,6 +258,7 @@ export default {
this.$nextTick(() => {
// this.selectOptionWidth = event.srcElement.offsetWidth + 'px'
this.selectOptionWidth = event.srcElement.parentElement.parentElement.offsetWidth + 'px'
this.handleCoustomStyle()
})
}
@ -261,6 +267,45 @@ export default {
}
</script>
<style lang="scss" scoped>
<style lang="scss">
.coustom-de-select {
background-color: var(--BgSelectColor, #FFFFFF) !important;
// .popper__arrow::after{
// border-bottom-color: var(--BgSelectColor, #FFFFFF) !important;
// }
</style>
.popper__arrow,
.popper__arrow::after {
display: none !important;
}
.el-select-dropdown__item {
color: var(--SelectColor, #606266);
}
.el-select-dropdown__item.selected {
color: #409eff;
background-color: rgb(245, 247, 250, .5);
}
.el-select-dropdown__item.hover {
background-color: rgb(245, 247, 250, .5);
}
}
.de-select-tag {
.el-select__tags {
.el-tag {
background-color: var(--BgSelectColor, #f4f4f5) !important;
border-color: var(--BrSelectColor, #e9e9eb) !important;
color: var(--SelectColor, #909399) !important;
i {
color: var(--SelectColor, #909399) !important;
}
}
.el-icon-close {
background-color: var(--BgSelectColor, #C0C4CC) !important;
}
}
}
</style>

View File

@ -3,6 +3,7 @@
<div v-if="element.options!== null && element.options.attrs!==null && show" class="de-select-grid-class">
<div class="de-select-grid-search">
<el-input
ref="de-select-grid"
v-model="keyWord"
:placeholder="$t('deinputsearch.placeholder')"
:size="size"
@ -39,8 +40,9 @@
import { multFieldValues, linkMultFieldValues } from '@/api/dataset/dataset'
import { getLinkToken, getToken } from '@/utils/auth'
import bus from '@/utils/bus'
export default {
import { attrsMap, styleAttrs, textSelectGridWidget } from '@/components/widget/DeWidget/serviceNameFn.js'
export default {
props: {
element: {
type: Object,
@ -96,6 +98,10 @@ export default {
},
panelInfo() {
return this.$store.state.panel.panelInfo
},
cssArr() {
const { brColor, wordColor, innerBgColor } = this.element.style
return { brColor, wordColor, innerBgColor }
}
},
watch: {
@ -130,6 +136,11 @@ export default {
this.element.options.attrs.fieldId.length > 0 &&
method(param).then(res => {
this.datas = this.optionDatas(res.data)
this.changeInputStyle()
if (this.element.options.attrs.multiple) {
this.checkAll = this.value.length === this.datas.length
this.isIndeterminate = this.value.length > 0 && this.value.length < this.datas.length
}
}) || (this.element.options.value = '')
},
'element.options.attrs.multiple': function(value, old) {
@ -148,6 +159,7 @@ export default {
this.checkAll = this.value.length === this.datas.length
this.isIndeterminate = this.value.length > 0 && this.value.length < this.datas.length
}
this.changeInputStyle()
})
},
'element.options.attrs.sort': function(value, old) {
@ -167,8 +179,18 @@ export default {
this.element.options.attrs.fieldId.length > 0 &&
method(param).then(res => {
this.datas = this.optionDatas(res.data)
this.changeInputStyle()
if (this.element.options.attrs.multiple) {
this.checkAll = this.value.length === this.datas.length
this.isIndeterminate = this.value.length > 0 && this.value.length < this.datas.length
}
}) || (this.element.options.value = '')
}
},
cssArr: {
handler: 'changeInputStyle',
deep: true
},
keyWord: 'changeInputStyle'
},
created() {
if (!this.element.options.attrs.sort) {
@ -191,6 +213,24 @@ export default {
},
methods: {
changeInputStyle() {
if (!this.$parent.handlerInputStyle) return
this.$nextTick(() => {
this.handlerInputStyle(this.element.style)
})
},
handlerInputStyle(newValue) {
let nodeCache = ''
if (!this.$refs['de-select-grid']) return
styleAttrs.forEach(ele => {
if (!nodeCache) {
nodeCache = this.$refs['de-select-grid'].$el.querySelector('.el-input__inner')
}
nodeCache.style[attrsMap[ele]] = newValue[ele]
this.textSelectGridWidget(this.$el, ele, newValue[ele])
})
},
textSelectGridWidget: textSelectGridWidget,
initLoad() {
this.value = this.element.options.attrs.multiple ? [] : null
if (this.element.options.attrs.fieldId) {
@ -202,6 +242,7 @@ export default {
}
method({ fieldIds: this.element.options.attrs.fieldId.split(','), sort: this.element.options.attrs.sort }).then(res => {
this.datas = this.optionDatas(res.data)
this.changeInputStyle()
if (this.element.options.attrs.multiple) {
this.checkAll = this.value.length === this.datas.length
this.isIndeterminate = this.value.length > 0 && this.value.length < this.datas.length

View File

@ -15,6 +15,7 @@
@removeTag="changeNodeIds"
@check="changeCheckNode"
@select-clear="selectClear"
@onFoucs="onFoucs"
/>
</template>
@ -24,8 +25,11 @@ import { mappingFieldValues, linkMappingFieldValues } from '@/api/dataset/datase
import bus from '@/utils/bus'
import { getLinkToken, getToken } from '@/utils/auth'
import ElTreeSelect from '@/components/ElTreeSelect'
import customInput from '@/components/widget/DeWidget/customInput'
export default {
components: { ElTreeSelect },
mixins: [customInput],
props: {
element: {
type: Object,
@ -208,6 +212,11 @@ export default {
},
methods: {
onFoucs() {
this.$nextTick(() => {
this.handleCoustomStyle()
})
},
selectClear() {
this.changeValue(this.value)
},
@ -354,6 +363,33 @@ export default {
}
</script>
<style lang="scss" scoped>
<style lang="scss">
.test-class-wrap {
background: var(--BgSelectTreeColor, #FFFFFF) !important;
.popper__arrow,
.popper__arrow::after {
display: none !important;
}
.el-tree {
background: var(--BgSelectTreeColor, #FFFFFF) !important;
color: var(--SelectTreeColor, #606266) !important;
}
.el-input-group--append {
.el-input__inner {
background: var(--BgSelectTreeColor, #FFFFFF) !important;
color: var(--SelectTreeColor, #606266) !important;
border: 1px solid var(--BrSelectTreeColor, #606266) !important;
}
.el-input-group__append {
background: var(--BgSelectTreeColor, #FFFFFF) !important;
color: var(--SelectTreeColor, #606266) !important;
border: 1px solid var(--BrSelectTreeColor, #606266) !important;
border-left: none;
}
}
}
</style>

View File

@ -9,7 +9,7 @@
<el-form-item :label="$t('chart.text_h_position')" class="form-item">
<el-radio-group v-model="styleInfo.horizontal" size="mini">
<el-radio-button label="left">{{ $t('chart.text_pos_left') }}</el-radio-button>
<el-radio-button :disabled="styleInfo.vertical === 'center'" label="center">{{ $t('chart.text_pos_center') }}</el-radio-button>
<el-radio-button :disabled="styleInfo.vertical === 'center' && this.elementType !== 'de-select-grid'" label="center">{{ $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>
@ -40,7 +40,11 @@ export default {
showVertical: {
type: Boolean,
default: false
}
},
elementType: {
type: String,
default: ''
},
}
}

View File

@ -0,0 +1,39 @@
// 通过控制css变量控制过滤组件弹框样式 de-select-grid除外
import { attrsMap, styleAttrs } from '@/components/widget/DeWidget/serviceNameFn.js'
export default {
data() {
return {
attrsMap,
styleAttrs,
// 过滤组件名css变量映射
refComNameMap: {
'de-date': ['--BgDateColor', '--DateColor', '--BrDateColor'],
'de-select': ['--BgSelectColor', '--SelectColor', '--BrSelectColor'],
'de-select-tree': ['--BgSelectTreeColor', '--SelectTreeColor', '--BrSelectTreeColor'],
"de-input-search": ['--BgSearchColor', '--SearchColor', '--BrSearchColor'],
"de-number-range": ['--BgRangeColor', '--RangeColor', '--BrRangeColor']
}
}
},
mounted() {
this.handleCoustomStyle()
},
methods: {
typeTransform() {
let refNode = this.refComNameMap[this.element.component];
if (!refNode) return [];
return refNode
},
handleCoustomStyle() {
// 判断组件是否是在仪表板内部 否则css样式取默认值
const isPanelDe = this.$parent.handlerInputStyle;
const { brColor, wordColor, innerBgColor } = this.element.style;
const newValue = { brColor, wordColor, innerBgColor };
const cssVar = this.typeTransform();
this.styleAttrs.forEach((ele, index) => {
document.documentElement.style.setProperty(cssVar[index], !isPanelDe ? '' : newValue[ele])
})
},
}
}

View File

@ -0,0 +1,74 @@
// 通过控制 js 控制过滤组件输入框样式 如需额外处理 声明组件serviceName同名函数处理
import { timeDateRangeWidget, textInputWidget, attrsMap, styleAttrs } from '@/components/widget/DeWidget/serviceNameFn.js'
export default {
data() {
return {
attrsMap,
styleAttrs,
// 过滤组件名ref映射
refComNameMap: {
'de-date': 'dateRef',
'de-select-grid': 'de-select-grid',
'de-select': 'deSelect',
'de-select-tree': 'deSelectTree',
"de-input-search": "de-input-search",
"de-number-range": ['de-number-range-min', 'de-number-range-max']
}
}
},
watch: {
cssArr: {
handler(newValue) {
if (!this.isFilterComponent) return;
this.typeTransform().forEach(ele => {
this.handlerInputStyle(ele, newValue)
})
},
deep: true
},
},
computed: {
cssArr() {
const { brColor, wordColor, innerBgColor } = this.element.style;
return { brColor, wordColor, innerBgColor }
}
},
mounted() {
if (!this.isFilterComponent) return;
this.typeTransform().forEach(item => {
const nodeCache = this.$refs.deOutWidget.$refs[item].$el.querySelector('.el-input__inner') || this.$refs.deOutWidget.$refs[item].$el
this.styleAttrs.forEach(ele => {
nodeCache.style[this.attrsMap[ele]] = this.element.style[ele];
this[this.element.serviceName] && this[this.element.serviceName](this.selectRange(item), ele, this.element.style[ele])
})
})
},
methods: {
handlerInputStyle(type, newValue) {
let nodeCache = '';
this.styleAttrs.forEach(ele => {
if (!nodeCache) {
nodeCache = this.$refs.deOutWidget.$refs[type].$el.querySelector('.el-input__inner') || this.$refs.deOutWidget.$refs[type].$el
}
nodeCache.style[this.attrsMap[ele]] = newValue[ele];
this[this.element.serviceName] && this[this.element.serviceName](this.selectRange(type), ele, newValue[ele])
})
},
selectRange(item) {
if (this.element.component === 'de-select-grid') {
return this.$refs.deOutWidget.$el;
}
return this.$refs.deOutWidget.$refs[item].$el;
},
timeDateRangeWidget: timeDateRangeWidget,
textInputWidget: textInputWidget,
typeTransform() {
let refNode = this.refComNameMap[this.element.component];
if (!refNode) return [];
if (!Array.isArray(refNode)) {
refNode = [refNode]
}
return refNode
}
}
}

View File

@ -0,0 +1,46 @@
const attrsMap = { brColor: 'borderColor', wordColor: 'color', innerBgColor: 'backgroundColor' }
const styleAttrs = ['innerBgColor', 'wordColor', 'brColor']
function timeDateRangeWidget (nodeCache, name, value) {
const classList = ['.el-range-input', '.el-range-separator']
classList.forEach(ele => {
let nodeList = nodeCache.querySelectorAll(ele);
if (!nodeList.length) return;
nodeList.forEach(ele => {
ele.style[attrsMap[name]] = value;
})
})
}
function textInputWidget (nodeCache, name, value) {
let groupAppend = nodeCache.querySelector('.el-input-group__append');
groupAppend.style[attrsMap[name]] = value;
if (name === 'brColor') {
groupAppend.style.borderLeft = 'none'
}
}
function textSelectGridWidget (nodeCache, name, value) {
if (name === 'innerBgColor') {
nodeCache.querySelector('.list').style.backgroundColor = value;
}
if (name === 'wordColor') {
let elRadio = nodeCache.querySelectorAll('.el-radio')
let elCheckbox = nodeCache.querySelectorAll('.el-checkbox')
if (elRadio.length) {
elRadio.forEach(ele => {
ele.style.color = value;
});
}
if (elCheckbox.length) {
elCheckbox.forEach(ele => {
ele.style.color = value;
});
}
}
}
export {
attrsMap,
styleAttrs,
timeDateRangeWidget,
textInputWidget,
textSelectGridWidget,
}

View File

@ -659,7 +659,8 @@ export default {
tip: 'Tip: use as test mail recipient only',
engine_mode_setting: 'Engine Setting',
kettle_setting: 'Kettle Setting',
cas_selected_warn: 'Selecting CAS will cause you to login again'
cas_selected_warn: 'Selecting CAS will cause you to login again',
cas_reset: 'CAS switches back to the default login mode to access API:'
},
chart: {
view_reset: 'View Reset',
@ -1114,6 +1115,7 @@ export default {
form_type: 'From Type'
},
dataset: {
dataset_sync: ' ( Data sync... )',
sheet_warn: 'There are multiple sheet pages, and the first one is extracted by default',
datalist: 'Data Set',
name: 'DataSet Name',

View File

@ -661,7 +661,8 @@ export default {
tip: '提示:僅用來作爲測試郵件收件人',
engine_mode_setting: '引擎設置',
kettle_setting: 'Kettle 設置',
cas_selected_warn: '選擇CAS方式保存後會註銷當前回話重新登錄'
cas_selected_warn: '選擇CAS方式保存後會註銷當前回話重新登錄',
cas_reset: 'CAS切換回默認登錄方式訪問API'
},
chart: {
view_reset: '視圖重置',
@ -1114,6 +1115,7 @@ export default {
form_type: '類別'
},
dataset: {
dataset_sync: ' ( 資料同步中... )',
sheet_warn: '有多個 Sheet 頁,默認抽取第一個',
datalist: '數據集',
name: '數據集名稱',

View File

@ -662,7 +662,8 @@ export default {
tip: '提示:仅用来作为测试邮件收件人',
engine_mode_setting: '引擎设置',
kettle_setting: 'Kettle 设置',
cas_selected_warn: '选择CAS方式保存后会注销当前回话重新登录'
cas_selected_warn: '选择CAS方式保存后会注销当前回话重新登录',
cas_reset: 'CAS切换回默认登录方式访问API'
},
chart: {
view_reset: '视图重置',
@ -1116,6 +1117,7 @@ export default {
form_type: '类别'
},
dataset: {
dataset_sync: ' ( 数据同步中... )',
sheet_warn: '有多个 Sheet 页,默认抽取第一个',
datalist: '数据集',
name: '数据集名称',

View File

@ -140,7 +140,6 @@ const actions = {
const method = param && param.casEnable ? deLogout : logout
return new Promise((resolve, reject) => {
method(state.token).then(res => {
debugger
removeToken() // must remove token first
resetRouter()
commit('RESET_STATE')

View File

@ -22,6 +22,32 @@ $--color-black: #FFFFFF;
$--background-color-base: #171b22;
/* 定义全局变量 */
:root{
--BgSelectColor: #ffffff;
--SelectColor: #fff;
--BrSelectColor: #fff;
--BgSelectTreeColor: #ffffff;
--SelectTreeColor: #fff;
--BrSelectTreeColor: #fff;
--BgDateColor: #ffffff;
--DateColor: #fff;
--BrDateColor: #fff;
--BgRangeColor: #ffffff;
--RangeColor: #fff;
--BrRangeColor: #fff;
--BgSerachColor: #ffffff;
--SerachColor: #fff;
--BrSerachColor: #fff;
--BgSelectGridColor: #ffffff;
--SelectGridColor: #fff;
--BrSelectGridColor: #fff;
}
// 与CSS原生变量映射
#app {
@ -56,3 +82,4 @@ $--background-color-base: #171b22;
}

View File

@ -93,6 +93,29 @@
</el-col>
</el-row>
</el-row>
<el-row v-if="isFilterComponent" style="height: 40px;overflow: hidden;">
<el-col :span="5" style="padding-left: 10px;padding-top: 8px">
输入框样式(颜色):
</el-col>
<el-col :span="2" style="padding-left: 10px;padding-top: 8px">
边框
</el-col>
<el-col :span="3" style="padding-top: 5px">
<el-color-picker v-model="curComponent.style.brColor" size="mini" class="color-picker-style" :predefine="predefineColors" />
</el-col>
<el-col :span="2" style="padding-left: 10px;padding-top: 8px">
文字
</el-col>
<el-col :span="3" style="padding-top: 5px">
<el-color-picker v-model="curComponent.style.wordColor" size="mini" class="color-picker-style" :predefine="predefineColors" />
</el-col>
<el-col :span="2" style="padding-left: 10px;padding-top: 8px">
背景
</el-col>
<el-col :span="3" style="padding-top: 5px">
<el-color-picker v-model="curComponent.style.innerBgColor" size="mini" class="color-picker-style" :predefine="predefineColors" />
</el-col>
</el-row>
</el-row>
<el-row class="root-class">
@ -139,7 +162,10 @@ export default {
...mapState([
'curComponent',
'componentData'
])
]),
isFilterComponent() {
return ['de-select', 'de-select-grid', 'de-date', "de-input-search", "de-number-range", "de-select-tree"].includes(this.curComponent.component)
}
},
methods: {
init() {

View File

@ -216,12 +216,13 @@ export function seniorCfg(chart_option, chart) {
}
}
}
// begin mark line settings
chart_option.series[0].markLine = {
symbol: 'none',
data: []
}
if (senior.assistLine && senior.assistLine.length > 0) {
if (chart_option.series && chart_option.series.length > 0) {
chart_option.series[0].markLine = {
symbol: 'none',
data: []
}
const customStyle = JSON.parse(chart.customStyle)
let xAxis, yAxis
if (customStyle.xAxis) {

View File

@ -1,10 +1,13 @@
import { getPadding, getTheme } from '@/views/chart/chart/common/common_antv'
import { Gauge } from '@antv/g2plot'
import { DEFAULT_SIZE, DEFAULT_THRESHOLD } from '@/views/chart/chart/chart'
import { DEFAULT_LABEL, DEFAULT_SIZE, DEFAULT_THRESHOLD } from '@/views/chart/chart/chart'
import { getScaleValue } from '@/components/canvas/utils/style'
import { valueFormatter } from '@/views/chart/chart/formatter'
let labelFormatter = null
export function baseGaugeOptionAntV(plot, container, chart, action, scale = 1) {
let max, labelContent, startAngel, endAngel
let min, max, labelContent, startAngel, endAngel, tickCount
// theme
const theme = getTheme(chart)
// data
@ -15,11 +18,14 @@ export function baseGaugeOptionAntV(plot, container, chart, action, scale = 1) {
customAttr = JSON.parse(chart.customAttr)
if (customAttr.size) {
const size = JSON.parse(JSON.stringify(customAttr.size))
min = size.gaugeMin ? size.gaugeMin : DEFAULT_SIZE.gaugeMin
max = size.gaugeMax ? size.gaugeMax : DEFAULT_SIZE.gaugeMax
tickCount = size.gaugeTickCount ? size.gaugeTickCount : DEFAULT_SIZE.gaugeTickCount
startAngel = parseInt(size.gaugeStartAngle) * Math.PI / 180
endAngel = parseInt(size.gaugeEndAngle) * Math.PI / 180
}
}
const per = (parseFloat(data) - parseFloat(min)) / (parseFloat(max) - parseFloat(min))
// label
if (customAttr.label) {
const label = JSON.parse(JSON.stringify(customAttr.label))
@ -28,13 +34,22 @@ export function baseGaugeOptionAntV(plot, container, chart, action, scale = 1) {
style: ({ percent }) => ({
fontSize: parseInt(label.fontSize),
color: label.color
})
}),
formatter: function(v) {
let value
if (labelFormatter.type === 'percent') {
value = per
} else {
value = data
}
return valueFormatter(value, labelFormatter)
}
}
} else {
labelContent = false
}
labelFormatter = label.gaugeLabelFormatter ? label.gaugeLabelFormatter : DEFAULT_LABEL.gaugeLabelFormatter
}
const per = (parseFloat(data) / parseFloat(max))
const range = [0]
let index = 0
@ -75,9 +90,13 @@ export function baseGaugeOptionAntV(plot, container, chart, action, scale = 1) {
content: labelContent
},
axis: {
tickInterval: 1 / tickCount,
label: {
style: {
fontSize: getScaleValue(14, scale) // 刻度值字体大小
},
formatter: function(v) {
return Number(v) * (max - min) + min
}
},
tickLine: {

View File

@ -237,14 +237,13 @@ export const TYPE_CONFIGS = [
'alpha'
],
'size-selector-ant-v': [
'gaugeMin',
'gaugeMax',
'gaugeStartAngle',
'gaugeEndAngle'
],
'label-selector-ant-v': [
'show',
'fontSize',
'color'
'labelGauge'
],
'title-selector-ant-v': [
'show',
@ -1550,16 +1549,7 @@ export const TYPE_CONFIGS = [
'alpha'
],
'size-selector': [
'barDefault',
'barWidth',
'barGap',
'lineWidth',
'lineType',
'lineSymbol',
'lineSymbolSize',
'lineArea',
'bubble_scatterSymbol',
'bubble_scatterSymbolSize'
'mix'
],
'label-selector': [
'show',

View File

@ -31,12 +31,48 @@
</el-form-item>
</div>
</el-form>
<el-form v-show="showProperty('labelGauge') && chart.type && chart.type.includes('gauge')" ref="labelForm" :model="labelForm" label-width="80px" size="mini">
<el-form-item :label="$t('chart.show')" class="form-item">
<el-checkbox v-model="labelForm.show" @change="changeLabelAttr">{{ $t('chart.show') }}</el-checkbox>
</el-form-item>
<div v-show="labelForm.show">
<el-form-item :label="$t('chart.text_fontsize')" class="form-item">
<el-select v-model="labelForm.fontSize" :placeholder="$t('chart.text_fontsize')" size="mini" @change="changeLabelAttr">
<el-option v-for="option in fontSize" :key="option.value" :label="option.name" :value="option.value" />
</el-select>
</el-form-item>
<el-form-item :label="$t('chart.text_color')" class="form-item">
<el-color-picker v-model="labelForm.color" class="color-picker-style" :predefine="predefineColors" @change="changeLabelAttr" />
</el-form-item>
<el-form-item :label="$t('chart.value_formatter_type')" class="form-item">
<el-select v-model="labelForm.gaugeLabelFormatter.type" @change="changeLabelAttr">
<el-option v-for="type in typeList" :key="type.value" :label="$t('chart.' + type.name)" :value="type.value" />
</el-select>
</el-form-item>
<el-form-item v-show="labelForm.gaugeLabelFormatter.type !== 'auto'" :label="$t('chart.value_formatter_decimal_count')" class="form-item">
<el-input-number v-model="labelForm.gaugeLabelFormatter.decimalCount" :precision="0" :min="0" :max="10" size="mini" @change="changeLabelAttr" />
</el-form-item>
<el-form-item v-show="labelForm.gaugeLabelFormatter.type !== 'percent'" :label="$t('chart.value_formatter_unit')" class="form-item">
<el-select v-model="labelForm.gaugeLabelFormatter.unit" :placeholder="$t('chart.pls_select_field')" size="mini" @change="changeLabelAttr">
<el-option v-for="item in unitList" :key="item.value" :label="$t('chart.' + item.name)" :value="item.value" />
</el-select>
</el-form-item>
<el-form-item :label="$t('chart.value_formatter_suffix')" class="form-item">
<el-input v-model="labelForm.gaugeLabelFormatter.suffix" size="mini" clearable :placeholder="$t('commons.input_content')" @change="changeLabelAttr" />
</el-form-item>
<el-form-item :label="$t('chart.value_formatter_thousand_separator')" class="form-item">
<el-checkbox v-model="labelForm.gaugeLabelFormatter.thousandSeparator" @change="changeLabelAttr" />
</el-form-item>
</div>
</el-form>
</el-col>
</div>
</template>
<script>
import { COLOR_PANEL, DEFAULT_LABEL } from '../../chart/chart'
import { formatterType, unitList } from '@/views/chart/chart/formatter'
export default {
name: 'LabelSelectorAntV',
@ -77,7 +113,9 @@ export default {
{ name: this.$t('chart.center'), value: 'middle' },
{ name: this.$t('chart.text_pos_bottom'), value: 'bottom' }
],
predefineColors: COLOR_PANEL
predefineColors: COLOR_PANEL,
typeList: formatterType,
unitList: unitList
}
},
watch: {
@ -108,6 +146,9 @@ export default {
if (!this.labelForm.labelLine) {
this.labelForm.labelLine = JSON.parse(JSON.stringify(DEFAULT_LABEL.labelLine))
}
if (!this.labelForm.gaugeLabelFormatter) {
this.labelForm.gaugeLabelFormatter = JSON.parse(JSON.stringify(DEFAULT_LABEL.gaugeLabelFormatter))
}
}
}
},

View File

@ -171,55 +171,56 @@
<el-slider v-model="sizeForm.treemapHeight" show-input :show-input-controls="false" input-size="mini" :min="0" :max="100" @change="changeBarSizeCase('treemapHeight')" />
</el-form-item>
<!--treemap-end-->
<!--chart-mix-end-->
<el-divider v-if="showProperty('barDefault')" content-position="center" class="divider-style">{{ $t('chart.chart_bar') }}</el-divider>
<el-form-item v-show="showProperty('barDefault')" :label="$t('chart.adapt')" class="form-item">
<el-checkbox v-model="sizeForm.barDefault" @change="changeBarSizeCase('barDefault')">{{ $t('chart.adapt') }}</el-checkbox>
</el-form-item>
<el-form-item v-show="showProperty('barWidth')" :label="$t('chart.bar_width')" class="form-item form-item-slider">
<el-slider v-model="sizeForm.barWidth" :disabled="sizeForm.barDefault" show-input :show-input-controls="false" input-size="mini" :min="1" :max="80" @change="changeBarSizeCase('barWidth')" />
</el-form-item>
<el-form-item v-show="showProperty('barGap')" :label="$t('chart.bar_gap')" class="form-item form-item-slider">
<el-slider v-model="sizeForm.barGap" :disabled="sizeForm.barDefault" show-input :show-input-controls="false" input-size="mini" :min="0" :max="5" :step="0.1" @change="changeBarSizeCase('barGap')" />
</el-form-item>
<el-divider v-if="showProperty('lineWidth')" content-position="center" class="divider-style">{{ $t('chart.chart_line') }}</el-divider>
<el-form-item v-show="showProperty('lineWidth')" :label="$t('chart.line_width')" class="form-item form-item-slider">
<el-slider v-model="sizeForm.lineWidth" show-input :show-input-controls="false" input-size="mini" :min="0" :max="10" @change="changeBarSizeCase('lineWidth')" />
</el-form-item>
<el-form-item v-show="showProperty('lineType')" :label="$t('chart.line_type')" class="form-item">
<el-radio-group v-model="sizeForm.lineType" @change="changeBarSizeCase('lineType')">
<el-radio-button label="solid">{{ $t('chart.line_type_solid') }}</el-radio-button>
<el-radio-button label="dashed">{{ $t('chart.line_type_dashed') }}</el-radio-button>
</el-radio-group>
</el-form-item>
<el-form-item v-show="showProperty('lineSymbol')" :label="$t('chart.line_symbol')" class="form-item">
<el-select v-model="sizeForm.lineSymbol" :placeholder="$t('chart.line_symbol')" @change="changeBarSizeCase('lineSymbol')">
<el-option
v-for="item in lineSymbolOptions"
:key="item.value"
:label="item.name"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item v-show="showProperty('lineArea')" :label="$t('chart.line_area')" class="form-item">
<el-checkbox v-model="sizeForm.lineArea" @change="changeBarSizeCase('lineArea')">{{ $t('chart.show') }}</el-checkbox>
</el-form-item>
<el-divider v-if="showProperty('bubble_scatterSymbol')" content-position="center" class="divider-style">{{ $t('chart.chart_scatter') }}</el-divider>
<el-form-item v-show="showProperty('bubble_scatterSymbol')" :label="$t('chart.bubble_symbol')" class="form-item">
<el-select v-model="sizeForm.scatterSymbol" :placeholder="$t('chart.line_symbol')" @change="changeBarSizeCase('scatterSymbol')">
<el-option
v-for="item in lineSymbolOptions"
:key="item.value"
:label="item.name"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item v-show="showProperty('bubble_scatterSymbolSize')" :label="$t('chart.bubble_size')" class="form-item form-item-slider">
<el-slider v-model="sizeForm.scatterSymbolSize" show-input :show-input-controls="false" input-size="mini" :min="1" :max="40" @change="changeBarSizeCase('scatterSymbolSize')" />
</el-form-item>
<!--chart-mix-start-->
<span v-show="showProperty('mix')">
<el-divider content-position="center" class="divider-style">{{ $t('chart.chart_bar') }}</el-divider>
<el-form-item :label="$t('chart.adapt')" class="form-item">
<el-checkbox v-model="sizeForm.barDefault" @change="changeBarSizeCase('barDefault')">{{ $t('chart.adapt') }}</el-checkbox>
</el-form-item>
<el-form-item :label="$t('chart.bar_width')" class="form-item form-item-slider">
<el-slider v-model="sizeForm.barWidth" :disabled="sizeForm.barDefault" show-input :show-input-controls="false" input-size="mini" :min="1" :max="80" @change="changeBarSizeCase('barWidth')" />
</el-form-item>
<el-form-item :label="$t('chart.bar_gap')" class="form-item form-item-slider">
<el-slider v-model="sizeForm.barGap" :disabled="sizeForm.barDefault" show-input :show-input-controls="false" input-size="mini" :min="0" :max="5" :step="0.1" @change="changeBarSizeCase('barGap')" />
</el-form-item>
<el-divider content-position="center" class="divider-style">{{ $t('chart.chart_line') }}</el-divider>
<el-form-item :label="$t('chart.line_width')" class="form-item form-item-slider">
<el-slider v-model="sizeForm.lineWidth" show-input :show-input-controls="false" input-size="mini" :min="0" :max="10" @change="changeBarSizeCase('lineWidth')" />
</el-form-item>
<el-form-item v-show="false" :label="$t('chart.line_type')" class="form-item">
<el-radio-group v-model="sizeForm.lineType" @change="changeBarSizeCase('lineType')">
<el-radio-button label="solid">{{ $t('chart.line_type_solid') }}</el-radio-button>
<el-radio-button label="dashed">{{ $t('chart.line_type_dashed') }}</el-radio-button>
</el-radio-group>
</el-form-item>
<el-form-item :label="$t('chart.line_symbol')" class="form-item">
<el-select v-model="sizeForm.lineSymbol" :placeholder="$t('chart.line_symbol')" @change="changeBarSizeCase('lineSymbol')">
<el-option
v-for="item in lineSymbolOptions"
:key="item.value"
:label="item.name"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('chart.line_smooth')" class="form-item">
<el-checkbox v-model="sizeForm.lineSmooth" @change="changeBarSizeCase('lineSmooth')">{{ $t('chart.line_smooth') }}</el-checkbox>
</el-form-item>
<el-divider content-position="center" class="divider-style">{{ $t('chart.chart_scatter') }}</el-divider>
<el-form-item :label="$t('chart.bubble_symbol')" class="form-item">
<el-select v-model="sizeForm.scatterSymbol" :placeholder="$t('chart.line_symbol')" @change="changeBarSizeCase('scatterSymbol')">
<el-option
v-for="item in lineSymbolOptions"
:key="item.value"
:label="item.name"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('chart.bubble_size')" class="form-item form-item-slider">
<el-slider v-model="sizeForm.scatterSymbolSize" show-input :show-input-controls="false" input-size="mini" :min="1" :max="40" @change="changeBarSizeCase('scatterSymbolSize')" />
</el-form-item>
</span>
<!--chart-mix-end-->
<!--liquid-begin-->
<el-form-item v-show="showProperty('liquidShape')" :label="$t('chart.liquid_shape')" class="form-item">

View File

@ -273,10 +273,16 @@
@change="changeBarSizeCase('tableColumnMode')"
/>
</el-form-item>
<!--table-end-->
<!--gauge-begin-->
</el-form>
<!--table-end-->
<!--gauge-begin-->
<el-form v-show="chart.type && chart.type.includes('gauge')" ref="sizeFormGauge" :model="sizeForm" label-width="100px" size="mini">
<el-form-item v-show="showProperty('gaugeMin')" :label="$t('chart.min')" class="form-item form-item-slider">
<el-input-number v-model="sizeForm.gaugeMin" size="mini" @change="changeBarSizeCase" />
</el-form-item>
<el-form-item v-show="showProperty('gaugeMax')" :label="$t('chart.max')" class="form-item form-item-slider">
<el-input-number v-model="sizeForm.gaugeMax" size="mini" @change="changeBarSizeCase('gaugeMax')" />
<el-input-number v-model="sizeForm.gaugeMax" size="mini" @change="changeBarSizeCase" />
</el-form-item>
<el-form-item
v-show="showProperty('gaugeStartAngle')"
@ -308,14 +314,22 @@
@change="changeBarSizeCase('gaugeEndAngle')"
/>
</el-form-item>
<!--gauge-end-->
<!--text&label-end-->
<el-form-item v-show="showProperty('quotaFontSize')" :label="$t('chart.quota_font_size')" class="form-item">
<el-select
v-model="sizeForm.quotaFontSize"
:placeholder="$t('chart.quota_font_size')"
@change="changeBarSizeCase('quotaFontSize')"
>
/>
</el-form-item>
<el-form-item :label="$t('chart.tick_count')" class="form-item form-item-slider">
<el-input-number v-model="sizeForm.gaugeTickCount" :min="1" :step="1" :precision="0" size="mini" @change="changeBarSizeCase" />
</el-form-item>
</el-form>
<!--gauge-end-->
<el-form v-show="chart.type && (chart.type.includes('text') || chart.type === 'label')" ref="sizeFormPie" :model="sizeForm" label-width="100px" size="mini">
<el-form-item :label="$t('chart.quota_font_size')" class="form-item">
<el-select v-model="sizeForm.quotaFontSize" :placeholder="$t('chart.quota_font_size')" @change="changeBarSizeCase">
<el-option v-for="option in fontSize" :key="option.value" :label="option.name" :value="option.value" />
</el-select>
</el-form-item>
@ -521,6 +535,8 @@ export default {
this.sizeForm.tableHeaderAlign = this.sizeForm.tableHeaderAlign ? this.sizeForm.tableHeaderAlign : DEFAULT_SIZE.tableHeaderAlign
this.sizeForm.tableItemAlign = this.sizeForm.tableItemAlign ? this.sizeForm.tableItemAlign : DEFAULT_SIZE.tableItemAlign
this.sizeForm.gaugeTickCount = this.sizeForm.gaugeTickCount ? this.sizeForm.gaugeTickCount : DEFAULT_SIZE.gaugeTickCount
}
}
},

View File

@ -298,6 +298,7 @@ export default {
watch: {
'param': function() {
this.initFunctions()
this.initDsFields()
},
'field': {
handler: function() {
@ -333,7 +334,7 @@ export default {
this.$refs.myCm.codemirror.showHint()
})
this.initFunctions()
// this.initField()
this.initDsFields()
},
methods: {
onCmReady(cm) {
@ -364,8 +365,6 @@ export default {
post('/dataset/function/listByTableId/' + this.param.tableId, null).then(response => {
this.functions = response.data
this.functionData = JSON.parse(JSON.stringify(this.functions))
this.initDsFields()
})
},

View File

@ -28,7 +28,6 @@
<el-input
v-model="scope.row.name"
size="mini"
:disabled="!hasDataPermission('manage',param.privileges)"
@blur="saveEdit(scope.row)"
@keyup.enter.native="saveEdit(scope.row)"
/>
@ -40,7 +39,6 @@
v-model="scope.row.deType"
size="mini"
style="display: inline-block;width: 26px;"
:disabled="!hasDataPermission('manage',param.privileges)"
@change="saveEdit(scope.row)"
>
<el-option
@ -149,7 +147,6 @@
icon="el-icon-sort"
size="mini"
circle
:disabled="!hasDataPermission('manage',param.privileges)"
@click="dqTrans(scope.row,'d')"
/>
</template>
@ -158,7 +155,6 @@
<template slot-scope="scope">
<el-button
v-if="scope.row.extField === 2"
:disabled="!hasDataPermission('manage',param.privileges)"
type="text"
size="mini"
@click="editField(scope.row)"
@ -166,7 +162,6 @@
</el-button>
<el-button
v-if="scope.row.extField !== 0"
:disabled="!hasDataPermission('manage',param.privileges)"
type="text"
size="mini"
@click="deleteField(scope.row)"
@ -184,7 +179,6 @@
<el-input
v-model="scope.row.name"
size="mini"
:disabled="!hasDataPermission('manage',param.privileges)"
@blur="saveEdit(scope.row)"
@keyup.enter.native="saveEdit(scope.row)"
/>
@ -196,7 +190,6 @@
v-model="scope.row.deType"
size="mini"
style="display: inline-block;width: 26px;"
:disabled="!hasDataPermission('manage',param.privileges)"
@change="saveEdit(scope.row)"
>
<el-option
@ -297,7 +290,6 @@
icon="el-icon-sort"
size="mini"
circle
:disabled="!hasDataPermission('manage',param.privileges)"
@click="dqTrans(scope.row,'q')"
/>
</template>
@ -306,7 +298,6 @@
<template slot-scope="scope">
<el-button
v-if="scope.row.extField === 2"
:disabled="!hasDataPermission('manage',param.privileges)"
type="text"
size="mini"
@click="editField(scope.row)"
@ -314,7 +305,6 @@
</el-button>
<el-button
v-if="scope.row.extField !== 0"
:disabled="!hasDataPermission('manage',param.privileges)"
type="text"
size="mini"
@click="deleteField(scope.row)"

View File

@ -382,8 +382,7 @@ export default {
this.fieldForm.tableId = this.param.id
this.fieldForm.columnIndex = this.tableFields.dimensionList.length + this.tableFields.quotaList.length
}
this.fieldForm.originName = this.setNameIdTrans('name', 'id', originName)
post('/dataset/field/save', this.fieldForm).then(response => {
post('/dataset/field/save', {...this.fieldForm, originName: this.setNameIdTrans('name', 'id', originName) }).then(response => {
this.closeCalcField()
})
},

View File

@ -4,6 +4,9 @@
<span class="title-text" style="line-height: 26px;">
{{ table.name }}
</span>
<span v-if="sycnStatus === 'Underway'" class="blue-color" style="line-height: 26px;">
{{ $t('dataset.dataset_sync') }}
</span>
<el-popover
placement="right-start"
width="400"
@ -102,6 +105,8 @@ export default {
},
fields: [],
data: [],
sycnStatus: '',
lastRequestComplete: true,
page: {
page: 1,
pageSize: 1000,
@ -132,7 +137,22 @@ export default {
})
},
created() {
this.taskLogTimer = setInterval(() => {
console.log(this.sycnStatus)
console.log(this.lastRequestComplete)
if (this.sycnStatus !== 'Underway') {
return;
}
if (!this.lastRequestComplete) {
return
} else {
this.lastRequestComplete = false
}
this.initPreviewData(this.page)
}, 5000)
},
beforeDestroy() {
clearInterval(this.taskLogTimer)
},
mounted() {
this.initTable(this.param.id)
@ -160,13 +180,16 @@ export default {
this.fields = response.data.fields
this.data = response.data.data
this.page = response.data.page
this.sycnStatus = response.data.sycnStatus
if (response.data.status === 'warnning') {
this.$warning(response.data.msg, 3000)
}
if (response.data.status === 'error') {
this.$error(response.data.msg, 3000)
}
this.lastRequestComplete = true
}).catch(response => {
this.lastRequestComplete = true
this.fields = []
this.data = []
this.page = {

View File

@ -33,7 +33,7 @@
v-if="showDomType === 'tree'"
:default-expanded-keys="expandedArray"
node-key="id"
:data="datas"
:data="tempTreeDatas || datas"
:props="defaultProps"
@node-click="handleNodeClick"
@ -296,7 +296,8 @@ export default {
viewInfos: []
},
currentElement: null,
allFields: []
allFields: [],
tempTreeDatas: null
}
},
computed: {
@ -427,7 +428,6 @@ export default {
}, {})
const roots = []
arrs.forEach(el => {
// ###
el.type = el.modelInnerType
el.isLeaf = el.leaf
if (el[this.defaultProps.parentId] === null || el[this.defaultProps.parentId] === 0 || el[this
@ -435,22 +435,29 @@ export default {
roots.push(el)
return
}
//
const parentEl = arrs[idMapping[el[this.defaultProps.parentId]]]
// `children`
parentEl.children = [...(parentEl.children || []), el]
//
if (parentEl.children.length > 0) {
this.expandedArray.push(parentEl[this.defaultProps.id])
}
})
return roots
},
getNode(id, roots) {
for (let index = 0; index < roots.length; index++) {
const node = roots[index]
if (node.id === id) return node
if (node && node.children && node.children.length) {
const temp = this.getNode(id, node.children)
if (temp) return temp
}
}
return null
},
loadViews() {
/* const viewIds = this.componentData
.filter(item => item.type === 'view' && item.propValue && item.propValue.viewId)
.map(item => item.propValue.viewId) */
let viewIds = []; let tabViewIds = []
for (let index = 0; index < this.componentData.length; index++) {
const element = this.componentData[index]
@ -465,27 +472,21 @@ export default {
}
viewIds && viewIds.length > 0 && viewsWithIds(viewIds).then(res => {
const datas = res.data
/* datas.forEach(item => {
if (tabViewIds.includes(item.id)) {
item.name = 'tabs(' + item.name + ')'
}
}) */
this.viewInfos = datas
this.childViews.viewInfos = datas
})
viewIds && viewIds.length > 0 && paramsWithIds(viewIds).then(res => {
const datas = res.data
/* datas.forEach(item => {
if (tabViewIds.includes(item.id)) {
item.name = 'tabs(' + item.name + ')'
}
}) */
this.childViews.datasetParams = datas
})
},
handleNodeClick(data) {
if (data.type !== 'group') {
if (data.modelInnerType !== 'group') {
this.showFieldDatas(data)
} else {
this.showNextGroup(data)
}
},
@ -499,7 +500,7 @@ export default {
setTailLink(node) {
const tail = this.dataSetBreads[this.dataSetBreads.length - 1]
tail.type = node.type
tail.type = node.modelInnerType
tail.link = true
},
comSetTailLink(node) {
@ -511,10 +512,58 @@ export default {
const tail = {
link: false,
label: node.label || node.name,
type: node.type
type: node.modelInnerType,
id: node.id
}
this.dataSetBreads.push(tail)
},
addQueue(node) {
this.dataSetBreads = this.dataSetBreads.slice(0, 1)
const root = {
id: null,
children: JSON.parse(JSON.stringify(this.datas))
}
this.getPathById(node.id, root, res => {
if (res.length > 1) {
for (let index = 1; index < res.length; index++) {
const node = res[index]
const temp = {
link: true,
label: node.label || node.name,
type: node.modelInnerType,
id: node.id
}
this.dataSetBreads.push(temp)
this.dataSetBreads[0].link = true
}
this.dataSetBreads[this.dataSetBreads.length - 1].link = false
}
})
},
getPathById(id, catalog, callback) {
var temppath = []
try {
const getNodePath = function(node) {
temppath.push(node)
if (node.id === id) {
// eslint-disable-next-line no-throw-literal
throw ('GOT IT!')
}
if (node.children && node.children.length > 0) {
for (var i = 0; i < node.children.length; i++) {
getNodePath(node.children[i])
}
temppath.pop()
} else {
temppath.pop()
}
}
getNodePath(catalog)
} catch (e) {
callback(temppath)
}
},
comAddTail(node) {
const tail = {
link: false,
@ -525,9 +574,14 @@ export default {
},
removeTail(bread) {
if (!bread.id) {
this.dataSetBreads = this.dataSetBreads.slice(0, 1)
this.dataSetBreads[this.dataSetBreads.length - 1]['link'] = false
return
}
for (let index = 0; index < this.dataSetBreads.length; index++) {
const element = this.dataSetBreads[index]
if (element.type === bread.type) {
if (element.type === bread.type && element.id === bread.id) {
this.dataSetBreads = this.dataSetBreads.slice(0, index + 1)
this.dataSetBreads[this.dataSetBreads.length - 1]['link'] = false
return
@ -546,6 +600,15 @@ export default {
this.expandedArray = []
this.keyWord = ''
this.isTreeSearch = false
if (bread.id) {
const node = this.getNode(bread.id, this.datas)
if (node) {
this.tempTreeDatas = node.children
}
} else {
this.tempTreeDatas = null
}
this.datas = JSON.parse(JSON.stringify(this.defaultDatas))
})
},
@ -580,11 +643,16 @@ export default {
showFieldDatas(row) {
this.keyWord = ''
this.showDomType = 'field'
this.setTailLink(row)
this.addTail(row)
this.addQueue(row)
this.fieldsParent = row
this.loadField(row.id)
},
showNextGroup(row) {
this.tempTreeDatas = JSON.parse(JSON.stringify(row.children))
this.keyWord = ''
this.showDomType = 'tree'
this.addQueue(row)
},
comShowFieldDatas(row) {
this.viewKeyWord = ''
this.comShowDomType = 'field'

View File

@ -40,9 +40,14 @@
<el-radio v-if="loginTypes.includes(2)" :label="2" size="mini">OIDC</el-radio>
<el-radio v-if="loginTypes.includes(3)" :label="3" size="mini">CAS</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
<el-row v-if="loginTypes.includes(3)">
<el-button class="pwd-tips" type="text">{{ $t('system_parameter_setting.cas_reset') + '[/cas/reset/{adminAcount}/{adminPwd}]' }}</el-button>
</el-row>
<el-row>
<el-col>
@ -102,6 +107,9 @@ export default {
},
originLoginType: null
}
},
computed: {
},
beforeCreate() {
ldapStatus().then(res => {

View File

@ -54,7 +54,9 @@ export default {
options: [],
multiple: true,
class: 'de-log-filter',
defaultOperator: 'in'
defaultOperator: 'in',
filterable: true,
'reserve-keyword': true
},
{ field: 'nick_name', label: this.$t('log.user'), component: 'DeComplexInput', class: 'de-log-filter' },
@ -116,7 +118,7 @@ export default {
const link = document.createElement('a')
link.style.display = 'none'
link.href = URL.createObjectURL(blob)
link.download = 'DataEase操作日志.xlsx' //
link.download = 'DataEase操作日志.xls' //
document.body.appendChild(link)
link.click()
document.body.removeChild(link)

View File

@ -118,6 +118,16 @@ export default {
},
uploadFail(response, file, fileList) {
const msg = response && response.message || '安装失败'
try {
const result = JSON.parse(msg)
if (result && result.message) {
this.$error(result.message)
this.uploading = false
}
return
} catch (e) {
console.error(e)
}
this.$error(msg)
this.uploading = false
},

View File

@ -61,4 +61,5 @@
</plugin>
</plugins>
</build>
</project>

View File

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>io.dataease</groupId>
<artifactId>dataease-server</artifactId>
@ -15,6 +16,7 @@
</parent>
<name>dataease</name>
<modules>
<module>frontend</module>
<module>mobile</module>