Merge pull request #745 from dataease/dev

Dev
This commit is contained in:
王嘉豪 2021-09-01 16:13:30 +08:00 committed by GitHub
commit 6fe0a0b27b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
65 changed files with 756 additions and 247 deletions

View File

@ -17,7 +17,7 @@
<where>
FIND_IN_SET(chart_group.id,cids)
</where>
order by create_time desc
order by `type` desc,name asc
</select>
@ -27,7 +27,7 @@
<where>
FIND_IN_SET(chart_view.id,cids)
</where>
order by create_time desc
order by `type` desc,name asc
</select>

View File

@ -7,6 +7,7 @@ public class DeTypeConstants {
public final static Integer DE_INT = 2;
public final static Integer DE_FLOAT = 3;
public final static Integer DE_BOOL = 4;
public final static Integer DE_Binary = 5;
public final static Integer DE_LOCATION = 5;
public final static Integer DE_BINARY = 6;
}

View File

@ -235,7 +235,7 @@ public class XssAndSqlHttpServletRequestWrapper extends HttpServletRequestWrappe
if (Arrays.stream(whiteLists.split(",")).anyMatch(item -> url.indexOf(item) != -1)) return false;
}
Pattern pattern= Pattern.compile("(.*\\=.*\\-\\-.*)|(.*(\\+).*)|(.*\\w+(%|\\$|#|&)\\w+.*)|(.*\\|\\|.*)|(.*\\s+(and|or)\\s+.*)" +
"|(.*\\b(select|update|union|and|or|delete|insert|trancate|char|into|substr|ascii|declare|exec|count|master|into|drop|execute)\\b.*)");
"|(.*\\b(select|update|union|and|or|delete|insert|trancate|char|into|substr|ascii|declare|exec|count|master|into|drop|execute|sleep|extractvalue|updatexml|substring|database|concat|rand)\\b.*)");
Matcher matcher=pattern.matcher(orders.toLowerCase());
return matcher.find();
}

View File

@ -12,8 +12,8 @@ public class MysqlConfigration extends JdbcDTO {
public String getJdbc() {
// 连接参数先写死后边要把编码时区等参数放到数据源的设置中
return "jdbc:mysql://HOSTNAME:PORT/DATABASE?characterEncoding=UTF-8&connectTimeout=5000"
.replace("HOSTNAME", getHost())
.replace("PORT", getPort().toString())
.replace("DATABASE", getDataBase());
.replace("HOSTNAME", getHost().trim())
.replace("PORT", getPort().toString().trim())
.replace("DATABASE", getDataBase().trim());
}
}

View File

@ -14,14 +14,14 @@ public class OracleConfigration extends JdbcDTO {
// 连接参数先写死后边要把编码时区等参数放到数据源的设置中
if(getConnectionType().equalsIgnoreCase("serviceName")){
return "jdbc:oracle:thin:@HOSTNAME:PORT/DATABASE"
.replace("HOSTNAME", getHost())
.replace("PORT", getPort().toString())
.replace("DATABASE", getDataBase());
.replace("HOSTNAME", getHost().trim())
.replace("PORT", getPort().toString().trim())
.replace("DATABASE", getDataBase().trim());
}else {
return "jdbc:oracle:thin:@HOSTNAME:PORT:DATABASE"
.replace("HOSTNAME", getHost())
.replace("PORT", getPort().toString())
.replace("DATABASE", getDataBase());
.replace("HOSTNAME", getHost().trim())
.replace("PORT", getPort().toString().trim())
.replace("DATABASE", getDataBase().trim());
}
}
}

View File

@ -12,8 +12,8 @@ public class PgConfigration extends JdbcDTO {
public String getJdbc() {
// 连接参数先写死后边要把编码时区等参数放到数据源的设置中
return "jdbc:postgresql://HOSTNAME:PORT/DATABASE"
.replace("HOSTNAME", getHost())
.replace("PORT", getPort().toString())
.replace("DATABASE", getDataBase());
.replace("HOSTNAME", getHost().trim())
.replace("PORT", getPort().toString().trim())
.replace("DATABASE", getDataBase().trim());
}
}

View File

@ -10,6 +10,9 @@ public class SqlServerConfigration extends JdbcDTO {
private String driver = "com.microsoft.sqlserver.jdbc.SQLServerDriver";
public String getJdbc(){
return "jdbc:sqlserver://HOSTNAME:PORT;DatabaseName=DATABASE".replace("HOSTNAME", getHost()).replace("PORT", getPort().toString()).replace("DATABASE", getDataBase());
return "jdbc:sqlserver://HOSTNAME:PORT;DatabaseName=DATABASE"
.replace("HOSTNAME", getHost().trim())
.replace("PORT", getPort().toString().trim())
.replace("DATABASE", getDataBase().trim());
}
}

View File

@ -44,4 +44,6 @@ public class ChartViewFieldDTO implements Serializable {
private String datePattern;
private Integer extField;
private String chartType;
}

View File

@ -19,6 +19,8 @@ public class DorisConstants extends SQLConstants {
public static final String FROM_UNIXTIME = "FROM_UNIXTIME(%s,'%s')";
public static final String STR_TO_DATE = "STR_TO_DATE(%s,'%s')";
public static final String CAST = "CAST(%s AS %s)";
public static final String DEFAULT_DATE_FORMAT = "%Y-%m-%d %H:%i:%S";

View File

@ -686,9 +686,14 @@ public class DorisQueryProvider extends QueryProvider {
originName = String.format(DorisConstants.KEYWORD_FIX, tableObj.getTableAlias(), field.getDataeaseName());
}
if (field.getDeType() == 1 && field.getDeExtractType() != 1) {
String cast = String.format(DorisConstants.CAST, originName, DorisConstants.DEFAULT_INT_FORMAT) + "/1000";
whereName = String.format(DorisConstants.FROM_UNIXTIME, cast, DorisConstants.DEFAULT_DATE_FORMAT);
if (field.getDeType() == 1) {
if (field.getDeExtractType() == 0 || field.getDeExtractType() == 5 || field.getDeExtractType() == 1) {
whereName = String.format(DorisConstants.STR_TO_DATE, originName, DorisConstants.DEFAULT_DATE_FORMAT);
}
if (field.getDeExtractType() == 2 || field.getDeExtractType() == 3) {
String cast = String.format(DorisConstants.CAST, originName, DorisConstants.DEFAULT_INT_FORMAT) + "/1000";
whereName = String.format(DorisConstants.FROM_UNIXTIME, cast, DorisConstants.DEFAULT_DATE_FORMAT);
}
} else if (field.getDeType() == 0) {
whereName = String.format(DorisConstants.CAST, originName, DorisConstants.VARCHAR);
} else {
@ -738,9 +743,14 @@ public class DorisQueryProvider extends QueryProvider {
originName = String.format(DorisConstants.KEYWORD_FIX, tableObj.getTableAlias(), field.getDataeaseName());
}
if (field.getDeType() == 1 && field.getDeExtractType() != 1) {
String cast = String.format(DorisConstants.CAST, originName, DorisConstants.DEFAULT_INT_FORMAT) + "/1000";
whereName = String.format(DorisConstants.FROM_UNIXTIME, cast, DorisConstants.DEFAULT_DATE_FORMAT);
if (field.getDeType() == 1) {
if (field.getDeExtractType() == 0 || field.getDeExtractType() == 5 || field.getDeExtractType() == 1) {
whereName = String.format(DorisConstants.STR_TO_DATE, originName, DorisConstants.DEFAULT_DATE_FORMAT);
}
if (field.getDeExtractType() == 2 || field.getDeExtractType() == 3) {
String cast = String.format(DorisConstants.CAST, originName, DorisConstants.DEFAULT_INT_FORMAT) + "/1000";
whereName = String.format(DorisConstants.FROM_UNIXTIME, cast, DorisConstants.DEFAULT_DATE_FORMAT);
}
} else if (field.getDeType() == 0) {
whereName = String.format(DorisConstants.CAST, originName, DorisConstants.VARCHAR);
} else {

View File

@ -19,6 +19,8 @@ public class MySQLConstants extends SQLConstants {
public static final String FROM_UNIXTIME = "FROM_UNIXTIME(%s,'%s')";
public static final String STR_TO_DATE = "STR_TO_DATE(%s,'%s')";
public static final String CAST = "CAST(%s AS %s)";
public static final String DEFAULT_DATE_FORMAT = "%Y-%m-%d %H:%i:%S";

View File

@ -671,9 +671,14 @@ public class MysqlQueryProvider extends QueryProvider {
} else {
originName = String.format(MySQLConstants.KEYWORD_FIX, tableObj.getTableAlias(), field.getOriginName());
}
if (field.getDeType() == 1 && field.getDeExtractType() != 1) {
String cast = String.format(MySQLConstants.CAST, originName, MySQLConstants.DEFAULT_INT_FORMAT) + "/1000";
whereName = String.format(MySQLConstants.FROM_UNIXTIME, cast, MySQLConstants.DEFAULT_DATE_FORMAT);
if (field.getDeType() == 1) {
if (field.getDeExtractType() == 0 || field.getDeExtractType() == 5) {
whereName = String.format(MySQLConstants.STR_TO_DATE, originName, MySQLConstants.DEFAULT_DATE_FORMAT);
}
if (field.getDeExtractType() == 2 || field.getDeExtractType() == 3) {
String cast = String.format(MySQLConstants.CAST, originName, MySQLConstants.DEFAULT_INT_FORMAT) + "/1000";
whereName = String.format(MySQLConstants.FROM_UNIXTIME, cast, MySQLConstants.DEFAULT_DATE_FORMAT);
}
} else {
whereName = originName;
}
@ -721,9 +726,14 @@ public class MysqlQueryProvider extends QueryProvider {
originName = String.format(MySQLConstants.KEYWORD_FIX, tableObj.getTableAlias(), field.getOriginName());
}
if (field.getDeType() == 1 && field.getDeExtractType() != 1) {
String cast = String.format(MySQLConstants.CAST, originName, MySQLConstants.DEFAULT_INT_FORMAT) + "/1000";
whereName = String.format(MySQLConstants.FROM_UNIXTIME, cast, MySQLConstants.DEFAULT_DATE_FORMAT);
if (field.getDeType() == 1) {
if (field.getDeExtractType() == 0 || field.getDeExtractType() == 5) {
whereName = String.format(MySQLConstants.STR_TO_DATE, originName, MySQLConstants.DEFAULT_DATE_FORMAT);
}
if (field.getDeExtractType() == 2 || field.getDeExtractType() == 3) {
String cast = String.format(MySQLConstants.CAST, originName, MySQLConstants.DEFAULT_INT_FORMAT) + "/1000";
whereName = String.format(MySQLConstants.FROM_UNIXTIME, cast, MySQLConstants.DEFAULT_DATE_FORMAT);
}
} else {
whereName = originName;
}

View File

@ -17,7 +17,7 @@ public class OracleConstants extends SQLConstants {
public static final String UNIX_TIMESTAMP = "UNIX_TIMESTAMP(%s)";
public static final String DATE_FORMAT = "DATE_FORMAT(%s,'%s')";
public static final String DATE_FORMAT = "to_timestamp(%s,'%s')";
public static final String FROM_UNIXTIME = "FROM_UNIXTIME(%s,'%s')";

View File

@ -640,7 +640,12 @@ public class OracleQueryProvider extends QueryProvider {
@Override
public String createRawQuerySQLAsTmp(String sql, List<DatasetTableField> fields) {
return createRawQuerySQL(" (" + sqlFix(sql) + ") DE_TMP ", fields, null);
String[] array = fields.stream().map(f -> {
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append(" \"").append(f.getOriginName()).append("\"");
return stringBuilder.toString();
}).toArray(String[]::new);
return MessageFormat.format("SELECT {0} FROM {1} ORDER BY null", StringUtils.join(array, ","), " (" + sqlFix(sql) + ") DE_TMP ");
}
public String transMysqlFilterTerm(String term) {
@ -701,9 +706,14 @@ public class OracleQueryProvider extends QueryProvider {
originName = String.format(OracleConstants.KEYWORD_FIX, tableObj.getTableAlias(), field.getOriginName());
}
if (field.getDeType() == 1 && field.getDeExtractType() != 1) {
String cast = String.format(OracleConstants.CAST, originName, OracleConstants.DEFAULT_INT_FORMAT) + "/1000";
whereName = String.format(OracleConstants.FROM_UNIXTIME, cast, OracleConstants.DEFAULT_DATE_FORMAT);
if (field.getDeType() == 1) {
if (field.getDeExtractType() == 0 || field.getDeExtractType() == 5) {
whereName = String.format(OracleConstants.TO_DATE, originName, OracleConstants.DEFAULT_DATE_FORMAT);
}
if (field.getDeExtractType() == 2 || field.getDeExtractType() == 3) {
String cast = String.format(OracleConstants.CAST, originName, OracleConstants.DEFAULT_INT_FORMAT) + "/1000";
whereName = String.format(OracleConstants.FROM_UNIXTIME, cast, OracleConstants.DEFAULT_DATE_FORMAT);
}
} else {
whereName = originName;
}
@ -716,7 +726,11 @@ public class OracleQueryProvider extends QueryProvider {
} else if (StringUtils.containsIgnoreCase(request.getTerm(), "like")) {
whereValue = "'%" + value + "%'";
} else {
whereValue = String.format(OracleConstants.WHERE_VALUE_VALUE, value);
if (field.getDeType() == 1) {
whereValue = String.format(OracleConstants.TO_DATE, "'" + value + "'", OracleConstants.DEFAULT_DATE_FORMAT);
} else {
whereValue = String.format(OracleConstants.WHERE_VALUE_VALUE, value);
}
}
list.add(SQLObj.builder()
.whereField(whereName)
@ -751,9 +765,14 @@ public class OracleQueryProvider extends QueryProvider {
originName = String.format(OracleConstants.KEYWORD_FIX, tableObj.getTableAlias(), field.getOriginName());
}
if (field.getDeType() == 1 && field.getDeExtractType() != 1) {
String cast = String.format(OracleConstants.CAST, originName, OracleConstants.DEFAULT_INT_FORMAT) + "/1000";
whereName = String.format(OracleConstants.FROM_UNIXTIME, cast, OracleConstants.DEFAULT_DATE_FORMAT);
if (field.getDeType() == 1) {
if (field.getDeExtractType() == 0 || field.getDeExtractType() == 5) {
whereName = String.format(OracleConstants.TO_DATE, originName, OracleConstants.DEFAULT_DATE_FORMAT);
}
if (field.getDeExtractType() == 2 || field.getDeExtractType() == 3) {
String cast = String.format(OracleConstants.CAST, originName, OracleConstants.DEFAULT_INT_FORMAT) + "/1000";
whereName = String.format(OracleConstants.FROM_UNIXTIME, cast, OracleConstants.DEFAULT_DATE_FORMAT);
}
} else {
whereName = originName;
}
@ -767,7 +786,9 @@ public class OracleQueryProvider extends QueryProvider {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String startTime = simpleDateFormat.format(new Date(Long.parseLong(value.get(0))));
String endTime = simpleDateFormat.format(new Date(Long.parseLong(value.get(1))));
whereValue = String.format(OracleConstants.WHERE_BETWEEN, startTime, endTime);
String st = String.format(OracleConstants.TO_DATE, "'" + startTime + "'", OracleConstants.DEFAULT_DATE_FORMAT);
String et = String.format(OracleConstants.TO_DATE, "'" + endTime + "'", OracleConstants.DEFAULT_DATE_FORMAT);
whereValue = st + " AND " + et;
} else {
whereValue = String.format(OracleConstants.WHERE_BETWEEN, value.get(0), value.get(1));
}

View File

@ -19,6 +19,8 @@ public class PgConstants extends SQLConstants {
public static final String FROM_UNIXTIME = "to_timestamp(%s)";
public static final String TO_DATE = "to_date(%s,'%s')";
public static final String CAST = "CAST(%s AS %s)";
public static final String DEFAULT_DATE_FORMAT = "'YYYY-MM-DD HH24:MI:SS'";

View File

@ -32,7 +32,6 @@ import java.util.regex.Pattern;
import static io.dataease.provider.SQLConstants.TABLE_ALIAS_PREFIX;
@Service("pgQuery")
public class PgQueryProvider extends QueryProvider {
@Resource
@ -86,7 +85,7 @@ public class PgQueryProvider extends QueryProvider {
case "TINYINT":
return DeTypeConstants.DE_BOOL;// 布尔
case "bytea":
return DeTypeConstants.DE_Binary;// 二进制
return DeTypeConstants.DE_BINARY;// 二进制
default:
return DeTypeConstants.DE_STRING;
}
@ -100,11 +99,11 @@ public class PgQueryProvider extends QueryProvider {
@Override
public String createQuerySQL(String table, List<DatasetTableField> fields, boolean isGroup, Datasource ds) {
SQLObj tableObj = SQLObj.builder()
.tableName((table.startsWith("(") && table.endsWith(")")) ? table : String.format( PgConstants.KEYWORD_TABLE, table))
.tableName((table.startsWith("(") && table.endsWith(")")) ? table : String.format(PgConstants.KEYWORD_TABLE, table))
.tableAlias(String.format(TABLE_ALIAS_PREFIX, 0))
.build();
setSchema(tableObj,ds);
setSchema(tableObj, ds);
List<SQLObj> xFields = new ArrayList<>();
if (CollectionUtils.isNotEmpty(fields)) {
for (int i = 0; i < fields.size(); i++) {
@ -114,35 +113,35 @@ public class PgQueryProvider extends QueryProvider {
// 解析origin name中有关联的字段生成sql表达式
originField = calcFieldRegex(f.getOriginName(), tableObj);
} else if (ObjectUtils.isNotEmpty(f.getExtField()) && f.getExtField() == 1) {
originField = String.format( PgConstants.KEYWORD_FIX, tableObj.getTableAlias(), f.getOriginName());
originField = String.format(PgConstants.KEYWORD_FIX, tableObj.getTableAlias(), f.getOriginName());
} else {
originField = String.format( PgConstants.KEYWORD_FIX, tableObj.getTableAlias(), f.getOriginName());
originField = String.format(PgConstants.KEYWORD_FIX, tableObj.getTableAlias(), f.getOriginName());
}
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
String fieldName = "";
// 处理横轴字段
if (f.getDeExtractType() == DeTypeConstants.DE_TIME) {
if (f.getDeType() == DeTypeConstants.DE_INT || f.getDeType() == DeTypeConstants.DE_FLOAT) {
fieldName = String.format( PgConstants.UNIX_TIMESTAMP, originField);
fieldName = String.format(PgConstants.UNIX_TIMESTAMP, originField);
} else {
fieldName = originField;
}
} else if (f.getDeExtractType() == DeTypeConstants.DE_STRING) {
if (f.getDeType() == DeTypeConstants.DE_INT) {
fieldName = String.format( PgConstants.CAST, originField, PgConstants.DEFAULT_INT_FORMAT);
fieldName = String.format(PgConstants.CAST, originField, PgConstants.DEFAULT_INT_FORMAT);
} else if (f.getDeType() == DeTypeConstants.DE_FLOAT) {
fieldName = String.format( PgConstants.CAST, originField, PgConstants.DEFAULT_FLOAT_FORMAT);
fieldName = String.format(PgConstants.CAST, originField, PgConstants.DEFAULT_FLOAT_FORMAT);
} else if (f.getDeType() == DeTypeConstants.DE_TIME) {
fieldName = String.format( PgConstants.CAST, originField, "timestamp");
fieldName = String.format(PgConstants.CAST, originField, "timestamp");
} else {
fieldName = originField;
}
} else {
if (f.getDeType() == DeTypeConstants.DE_TIME) {
String cast = String.format( PgConstants.CAST, originField, "bigint");
fieldName = String.format( PgConstants.FROM_UNIXTIME, cast );
String cast = String.format(PgConstants.CAST, originField, "bigint");
fieldName = String.format(PgConstants.FROM_UNIXTIME, cast);
} else if (f.getDeType() == DeTypeConstants.DE_INT) {
fieldName = String.format( PgConstants.CAST, originField, PgConstants.DEFAULT_INT_FORMAT);
fieldName = String.format(PgConstants.CAST, originField, PgConstants.DEFAULT_INT_FORMAT);
} else {
fieldName = originField;
}
@ -190,10 +189,10 @@ public class PgQueryProvider extends QueryProvider {
@Override
public String getSQL(String table, List<ChartViewFieldDTO> xAxis, List<ChartViewFieldDTO> yAxis, List<ChartCustomFilterDTO> customFilter, List<ChartExtFilterRequest> extFilterRequestList, Datasource ds) {
SQLObj tableObj = SQLObj.builder()
.tableName((table.startsWith("(") && table.endsWith(")")) ? table : String.format( PgConstants.KEYWORD_TABLE, table))
.tableName((table.startsWith("(") && table.endsWith(")")) ? table : String.format(PgConstants.KEYWORD_TABLE, table))
.tableAlias(String.format(TABLE_ALIAS_PREFIX, 0))
.build();
setSchema(tableObj,ds);
setSchema(tableObj, ds);
List<SQLObj> xFields = new ArrayList<>();
List<SQLObj> xWheres = new ArrayList<>();
List<SQLObj> xOrders = new ArrayList<>();
@ -205,9 +204,9 @@ public class PgQueryProvider extends QueryProvider {
// 解析origin name中有关联的字段生成sql表达式
originField = calcFieldRegex(x.getOriginName(), tableObj);
} else if (ObjectUtils.isNotEmpty(x.getExtField()) && x.getExtField() == 1) {
originField = String.format( PgConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName());
originField = String.format(PgConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName());
} else {
originField = String.format( PgConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName());
originField = String.format(PgConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName());
}
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
// 处理横轴字段
@ -235,9 +234,9 @@ public class PgQueryProvider extends QueryProvider {
// 解析origin name中有关联的字段生成sql表达式
originField = calcFieldRegex(y.getOriginName(), tableObj);
} else if (ObjectUtils.isNotEmpty(y.getExtField()) && y.getExtField() == 1) {
originField = String.format( PgConstants.KEYWORD_FIX, tableObj.getTableAlias(), y.getOriginName());
originField = String.format(PgConstants.KEYWORD_FIX, tableObj.getTableAlias(), y.getOriginName());
} else {
originField = String.format( PgConstants.KEYWORD_FIX, tableObj.getTableAlias(), y.getOriginName());
originField = String.format(PgConstants.KEYWORD_FIX, tableObj.getTableAlias(), y.getOriginName());
}
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_Y_PREFIX, i);
// 处理纵轴字段
@ -285,7 +284,7 @@ public class PgQueryProvider extends QueryProvider {
ST st = stg.getInstanceOf("querySql");
SQLObj tableSQL = SQLObj.builder()
.tableName(String.format( PgConstants.BRACKETS, sql))
.tableName(String.format(PgConstants.BRACKETS, sql))
.tableAlias(String.format(TABLE_ALIAS_PREFIX, 1))
.build();
if (CollectionUtils.isNotEmpty(aggWheres)) st.add("filters", aggWheres);
@ -303,10 +302,10 @@ public class PgQueryProvider extends QueryProvider {
@Override
public String getSQLStack(String table, List<ChartViewFieldDTO> xAxis, List<ChartViewFieldDTO> yAxis, List<ChartCustomFilterDTO> customFilter, List<ChartExtFilterRequest> extFilterRequestList, List<ChartViewFieldDTO> extStack, Datasource ds) {
SQLObj tableObj = SQLObj.builder()
.tableName((table.startsWith("(") && table.endsWith(")")) ? table : String.format( PgConstants.KEYWORD_TABLE, table))
.tableName((table.startsWith("(") && table.endsWith(")")) ? table : String.format(PgConstants.KEYWORD_TABLE, table))
.tableAlias(String.format(TABLE_ALIAS_PREFIX, 0))
.build();
setSchema(tableObj,ds);
setSchema(tableObj, ds);
List<SQLObj> xFields = new ArrayList<>();
List<SQLObj> xWheres = new ArrayList<>();
List<SQLObj> xOrders = new ArrayList<>();
@ -321,9 +320,9 @@ public class PgQueryProvider extends QueryProvider {
// 解析origin name中有关联的字段生成sql表达式
originField = calcFieldRegex(x.getOriginName(), tableObj);
} else if (ObjectUtils.isNotEmpty(x.getExtField()) && x.getExtField() == 1) {
originField = String.format( PgConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName());
originField = String.format(PgConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName());
} else {
originField = String.format( PgConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName());
originField = String.format(PgConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName());
}
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
// 处理横轴字段
@ -351,9 +350,9 @@ public class PgQueryProvider extends QueryProvider {
// 解析origin name中有关联的字段生成sql表达式
originField = calcFieldRegex(y.getOriginName(), tableObj);
} else if (ObjectUtils.isNotEmpty(y.getExtField()) && y.getExtField() == 1) {
originField = String.format( PgConstants.KEYWORD_FIX, tableObj.getTableAlias(), y.getOriginName());
originField = String.format(PgConstants.KEYWORD_FIX, tableObj.getTableAlias(), y.getOriginName());
} else {
originField = String.format( PgConstants.KEYWORD_FIX, tableObj.getTableAlias(), y.getOriginName());
originField = String.format(PgConstants.KEYWORD_FIX, tableObj.getTableAlias(), y.getOriginName());
}
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_Y_PREFIX, i);
// 处理纵轴字段
@ -401,7 +400,7 @@ public class PgQueryProvider extends QueryProvider {
ST st = stg.getInstanceOf("querySql");
SQLObj tableSQL = SQLObj.builder()
.tableName(String.format( PgConstants.BRACKETS, sql))
.tableName(String.format(PgConstants.BRACKETS, sql))
.tableAlias(String.format(TABLE_ALIAS_PREFIX, 1))
.build();
if (CollectionUtils.isNotEmpty(aggWheres)) st.add("filters", aggWheres);
@ -418,10 +417,10 @@ public class PgQueryProvider extends QueryProvider {
@Override
public String getSQLScatter(String table, List<ChartViewFieldDTO> xAxis, List<ChartViewFieldDTO> yAxis, List<ChartCustomFilterDTO> customFilter, List<ChartExtFilterRequest> extFilterRequestList, List<ChartViewFieldDTO> extBubble, Datasource ds) {
SQLObj tableObj = SQLObj.builder()
.tableName((table.startsWith("(") && table.endsWith(")")) ? table : String.format( PgConstants.KEYWORD_TABLE, table))
.tableName((table.startsWith("(") && table.endsWith(")")) ? table : String.format(PgConstants.KEYWORD_TABLE, table))
.tableAlias(String.format(TABLE_ALIAS_PREFIX, 0))
.build();
setSchema(tableObj,ds);
setSchema(tableObj, ds);
List<SQLObj> xFields = new ArrayList<>();
List<SQLObj> xWheres = new ArrayList<>();
List<SQLObj> xOrders = new ArrayList<>();
@ -433,9 +432,9 @@ public class PgQueryProvider extends QueryProvider {
// 解析origin name中有关联的字段生成sql表达式
originField = calcFieldRegex(x.getOriginName(), tableObj);
} else if (ObjectUtils.isNotEmpty(x.getExtField()) && x.getExtField() == 1) {
originField = String.format( PgConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName());
originField = String.format(PgConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName());
} else {
originField = String.format( PgConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName());
originField = String.format(PgConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName());
}
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
// 处理横轴字段
@ -466,9 +465,9 @@ public class PgQueryProvider extends QueryProvider {
// 解析origin name中有关联的字段生成sql表达式
originField = calcFieldRegex(y.getOriginName(), tableObj);
} else if (ObjectUtils.isNotEmpty(y.getExtField()) && y.getExtField() == 1) {
originField = String.format( PgConstants.KEYWORD_FIX, tableObj.getTableAlias(), y.getOriginName());
originField = String.format(PgConstants.KEYWORD_FIX, tableObj.getTableAlias(), y.getOriginName());
} else {
originField = String.format( PgConstants.KEYWORD_FIX, tableObj.getTableAlias(), y.getOriginName());
originField = String.format(PgConstants.KEYWORD_FIX, tableObj.getTableAlias(), y.getOriginName());
}
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_Y_PREFIX, i);
// 处理纵轴字段
@ -516,7 +515,7 @@ public class PgQueryProvider extends QueryProvider {
ST st = stg.getInstanceOf("querySql");
SQLObj tableSQL = SQLObj.builder()
.tableName(String.format( PgConstants.BRACKETS, sql))
.tableName(String.format(PgConstants.BRACKETS, sql))
.tableAlias(String.format(TABLE_ALIAS_PREFIX, 1))
.build();
if (CollectionUtils.isNotEmpty(aggWheres)) st.add("filters", aggWheres);
@ -539,7 +538,7 @@ public class PgQueryProvider extends QueryProvider {
public String getSQLSummary(String table, List<ChartViewFieldDTO> yAxis, List<ChartCustomFilterDTO> customFilter, List<ChartExtFilterRequest> extFilterRequestList) {
// 字段汇总 排序等
SQLObj tableObj = SQLObj.builder()
.tableName((table.startsWith("(") && table.endsWith(")")) ? table : String.format( PgConstants.KEYWORD_TABLE, table))
.tableName((table.startsWith("(") && table.endsWith(")")) ? table : String.format(PgConstants.KEYWORD_TABLE, table))
.tableAlias(String.format(TABLE_ALIAS_PREFIX, 0))
.build();
List<SQLObj> yFields = new ArrayList<>();
@ -553,9 +552,9 @@ public class PgQueryProvider extends QueryProvider {
// 解析origin name中有关联的字段生成sql表达式
originField = calcFieldRegex(y.getOriginName(), tableObj);
} else if (ObjectUtils.isNotEmpty(y.getExtField()) && y.getExtField() == 1) {
originField = String.format( PgConstants.KEYWORD_FIX, tableObj.getTableAlias(), y.getOriginName());
originField = String.format(PgConstants.KEYWORD_FIX, tableObj.getTableAlias(), y.getOriginName());
} else {
originField = String.format( PgConstants.KEYWORD_FIX, tableObj.getTableAlias(), y.getOriginName());
originField = String.format(PgConstants.KEYWORD_FIX, tableObj.getTableAlias(), y.getOriginName());
}
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_Y_PREFIX, i);
// 处理纵轴字段
@ -598,7 +597,7 @@ public class PgQueryProvider extends QueryProvider {
ST st = stg.getInstanceOf("querySql");
SQLObj tableSQL = SQLObj.builder()
.tableName(String.format( PgConstants.BRACKETS, sql))
.tableName(String.format(PgConstants.BRACKETS, sql))
.tableAlias(String.format(TABLE_ALIAS_PREFIX, 1))
.build();
if (CollectionUtils.isNotEmpty(aggWheres)) st.add("filters", aggWheres);
@ -629,11 +628,11 @@ public class PgQueryProvider extends QueryProvider {
stringBuilder.append("\"").append(f.getOriginName()).append("\" AS ").append(f.getDataeaseName());
return stringBuilder.toString();
}).toArray(String[]::new);
if(ds != null){
if (ds != null) {
String schema = new Gson().fromJson(ds.getConfiguration(), JdbcDTO.class).getSchema();
String tableWithSchema = String.format(SqlServerSQLConstants.KEYWORD_TABLE, schema) + "." + String.format(SqlServerSQLConstants.KEYWORD_TABLE, table);
return MessageFormat.format("SELECT {0} FROM {1} ", StringUtils.join(array, ","), tableWithSchema);
}else {
} else {
return MessageFormat.format("SELECT {0} FROM {1} ", StringUtils.join(array, ","), table);
}
}
@ -695,18 +694,23 @@ public class PgQueryProvider extends QueryProvider {
// 解析origin name中有关联的字段生成sql表达式
originName = calcFieldRegex(field.getOriginName(), tableObj);
} else if (ObjectUtils.isNotEmpty(field.getExtField()) && field.getExtField() == 1) {
originName = String.format( PgConstants.KEYWORD_FIX, tableObj.getTableAlias(), field.getOriginName());
originName = String.format(PgConstants.KEYWORD_FIX, tableObj.getTableAlias(), field.getOriginName());
} else {
originName = String.format( PgConstants.KEYWORD_FIX, tableObj.getTableAlias(), field.getOriginName());
originName = String.format(PgConstants.KEYWORD_FIX, tableObj.getTableAlias(), field.getOriginName());
}
if (field.getDeType() == 1 && field.getDeExtractType() != 1) {
String cast = String.format( PgConstants.CAST, originName, "bigint");
whereName = String.format( PgConstants.FROM_UNIXTIME, cast);
if (field.getDeType() == 1) {
if (field.getDeExtractType() == 0 || field.getDeExtractType() == 5) {
whereName = String.format(PgConstants.TO_DATE, originName, PgConstants.DEFAULT_DATE_FORMAT);
}
if (field.getDeExtractType() == 2 || field.getDeExtractType() == 3) {
String cast = String.format(PgConstants.CAST, originName, "bigint");
whereName = String.format(PgConstants.FROM_UNIXTIME, cast);
}
} else {
whereName = originName;
}
if (StringUtils.equalsIgnoreCase(request.getTerm(), "null")) {
whereValue = PgConstants.WHERE_VALUE_NULL;
whereValue = PgConstants.WHERE_VALUE_NULL;
} else if (StringUtils.equalsIgnoreCase(request.getTerm(), "not_null")) {
whereTerm = String.format(whereTerm, originName);
} else if (StringUtils.containsIgnoreCase(request.getTerm(), "in")) {
@ -714,7 +718,7 @@ public class PgQueryProvider extends QueryProvider {
} else if (StringUtils.containsIgnoreCase(request.getTerm(), "like")) {
whereValue = "'%" + value + "%'";
} else {
whereValue = String.format( PgConstants.WHERE_VALUE_VALUE, value);
whereValue = String.format(PgConstants.WHERE_VALUE_VALUE, value);
}
list.add(SQLObj.builder()
.whereField(whereName)
@ -744,14 +748,19 @@ public class PgQueryProvider extends QueryProvider {
// 解析origin name中有关联的字段生成sql表达式
originName = calcFieldRegex(field.getOriginName(), tableObj);
} else if (ObjectUtils.isNotEmpty(field.getExtField()) && field.getExtField() == 1) {
originName = String.format( PgConstants.KEYWORD_FIX, tableObj.getTableAlias(), field.getOriginName());
originName = String.format(PgConstants.KEYWORD_FIX, tableObj.getTableAlias(), field.getOriginName());
} else {
originName = String.format( PgConstants.KEYWORD_FIX, tableObj.getTableAlias(), field.getOriginName());
originName = String.format(PgConstants.KEYWORD_FIX, tableObj.getTableAlias(), field.getOriginName());
}
if (field.getDeType() == 1 && field.getDeExtractType() != 1) {
String cast = String.format( PgConstants.CAST, originName, "bigint");
whereName = String.format( PgConstants.FROM_UNIXTIME, cast);
if (field.getDeType() == 1) {
if (field.getDeExtractType() == 0 || field.getDeExtractType() == 5) {
whereName = String.format(PgConstants.TO_DATE, originName, PgConstants.DEFAULT_DATE_FORMAT);
}
if (field.getDeExtractType() == 2 || field.getDeExtractType() == 3) {
String cast = String.format(PgConstants.CAST, originName, "bigint");
whereName = String.format(PgConstants.FROM_UNIXTIME, cast);
}
} else {
whereName = originName;
}
@ -765,12 +774,12 @@ public class PgQueryProvider extends QueryProvider {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String startTime = simpleDateFormat.format(new Date(Long.parseLong(value.get(0))));
String endTime = simpleDateFormat.format(new Date(Long.parseLong(value.get(1))));
whereValue = String.format( PgConstants.WHERE_BETWEEN, startTime, endTime);
whereValue = String.format(PgConstants.WHERE_BETWEEN, startTime, endTime);
} else {
whereValue = String.format( PgConstants.WHERE_BETWEEN, value.get(0), value.get(1));
whereValue = String.format(PgConstants.WHERE_BETWEEN, value.get(0), value.get(1));
}
} else {
whereValue = String.format( PgConstants.WHERE_VALUE_VALUE, value.get(0));
whereValue = String.format(PgConstants.WHERE_VALUE_VALUE, value.get(0));
}
list.add(SQLObj.builder()
.whereField(whereName)
@ -817,10 +826,10 @@ public class PgQueryProvider extends QueryProvider {
String fieldName = "";
if (x.getDeExtractType() == DeTypeConstants.DE_TIME) {
if (x.getDeType() == 2 || x.getDeType() == 3) {
fieldName = String.format( PgConstants.UNIX_TIMESTAMP, originField);
fieldName = String.format(PgConstants.UNIX_TIMESTAMP, originField);
} else if (x.getDeType() == DeTypeConstants.DE_TIME) {
String format = transDateFormat(x.getDateStyle(), x.getDatePattern());
fieldName = String.format( PgConstants.DATE_FORMAT, originField, format);
fieldName = String.format(PgConstants.DATE_FORMAT, originField, format);
} else {
fieldName = originField;
}
@ -828,11 +837,11 @@ public class PgQueryProvider extends QueryProvider {
if (x.getDeType() == DeTypeConstants.DE_TIME) {
String format = transDateFormat(x.getDateStyle(), x.getDatePattern());
if (x.getDeExtractType() == DeTypeConstants.DE_STRING) {
fieldName = String.format( PgConstants.DATE_FORMAT, originField, format);
fieldName = String.format(PgConstants.DATE_FORMAT, originField, format);
} else {
String cast = String.format( PgConstants.CAST, originField, "bigint");
String from_unixtime = String.format( PgConstants.FROM_UNIXTIME, cast);
fieldName = String.format( PgConstants.DATE_FORMAT, from_unixtime, format);
String cast = String.format(PgConstants.CAST, originField, "bigint");
String from_unixtime = String.format(PgConstants.FROM_UNIXTIME, cast);
fieldName = String.format(PgConstants.DATE_FORMAT, from_unixtime, format);
}
} else {
fieldName = originField;
@ -847,17 +856,17 @@ public class PgQueryProvider extends QueryProvider {
private SQLObj getYFields(ChartViewFieldDTO y, String originField, String fieldAlias) {
String fieldName = "";
if (StringUtils.equalsIgnoreCase(y.getOriginName(), "*")) {
fieldName = PgConstants.AGG_COUNT;
fieldName = PgConstants.AGG_COUNT;
} else if (SQLConstants.DIMENSION_TYPE.contains(y.getDeType())) {
fieldName = String.format( PgConstants.AGG_FIELD, y.getSummary(), originField);
fieldName = String.format(PgConstants.AGG_FIELD, y.getSummary(), originField);
} else {
if (StringUtils.equalsIgnoreCase(y.getSummary(), "avg") || StringUtils.containsIgnoreCase(y.getSummary(), "pop")) {
String cast = String.format( PgConstants.CAST, originField, y.getDeType() == DeTypeConstants.DE_INT ? PgConstants.DEFAULT_INT_FORMAT : PgConstants.DEFAULT_FLOAT_FORMAT);
String agg = String.format( PgConstants.AGG_FIELD, y.getSummary(), cast);
fieldName = String.format( PgConstants.CAST, agg, PgConstants.DEFAULT_FLOAT_FORMAT);
String cast = String.format(PgConstants.CAST, originField, y.getDeType() == DeTypeConstants.DE_INT ? PgConstants.DEFAULT_INT_FORMAT : PgConstants.DEFAULT_FLOAT_FORMAT);
String agg = String.format(PgConstants.AGG_FIELD, y.getSummary(), cast);
fieldName = String.format(PgConstants.CAST, agg, PgConstants.DEFAULT_FLOAT_FORMAT);
} else {
String cast = String.format( PgConstants.CAST, originField, y.getDeType() == DeTypeConstants.DE_INT ? PgConstants.DEFAULT_INT_FORMAT : PgConstants.DEFAULT_FLOAT_FORMAT);
fieldName = String.format( PgConstants.AGG_FIELD, y.getSummary(), cast);
String cast = String.format(PgConstants.CAST, originField, y.getDeType() == DeTypeConstants.DE_INT ? PgConstants.DEFAULT_INT_FORMAT : PgConstants.DEFAULT_FLOAT_FORMAT);
fieldName = String.format(PgConstants.AGG_FIELD, y.getSummary(), cast);
}
}
return SQLObj.builder()
@ -874,7 +883,7 @@ public class PgQueryProvider extends QueryProvider {
String whereValue = "";
// 原始类型不是时间在de中被转成时间的字段做处理
if (StringUtils.equalsIgnoreCase(f.getTerm(), "null")) {
whereValue = PgConstants.WHERE_VALUE_NULL;
whereValue = PgConstants.WHERE_VALUE_NULL;
} else if (StringUtils.equalsIgnoreCase(f.getTerm(), "not_null")) {
whereTerm = String.format(whereTerm, originField);
} else if (StringUtils.containsIgnoreCase(f.getTerm(), "in")) {
@ -882,7 +891,7 @@ public class PgQueryProvider extends QueryProvider {
} else if (StringUtils.containsIgnoreCase(f.getTerm(), "like")) {
whereValue = "'%" + f.getValue() + "%'";
} else {
whereValue = String.format( PgConstants.WHERE_VALUE_VALUE, f.getValue());
whereValue = String.format(PgConstants.WHERE_VALUE_VALUE, f.getValue());
}
list.add(SQLObj.builder()
.whereField(fieldAlias)
@ -913,7 +922,7 @@ public class PgQueryProvider extends QueryProvider {
List<DatasetTableField> calcFields = datasetTableFieldMapper.selectByExample(datasetTableFieldExample);
for (DatasetTableField ele : calcFields) {
originField = originField.replaceAll("\\[" + ele.getId() + "]",
String.format( PgConstants.KEYWORD_FIX, tableObj.getTableAlias(), ele.getOriginName()));
String.format(PgConstants.KEYWORD_FIX, tableObj.getTableAlias(), ele.getOriginName()));
}
return originField;
}

View File

@ -13,6 +13,7 @@ import io.dataease.dto.chart.ChartViewFieldDTO;
import io.dataease.dto.sqlObj.SQLObj;
import io.dataease.provider.QueryProvider;
import io.dataease.provider.SQLConstants;
import io.dataease.provider.mysql.MySQLConstants;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
@ -73,7 +74,7 @@ public class SqlserverQueryProvider extends QueryProvider {
case "TINYINT":
return DeTypeConstants.DE_BOOL;// 布尔
case "TIMESTAMP":
return DeTypeConstants.DE_Binary;// 二进制
return DeTypeConstants.DE_BINARY;// 二进制
default:
return DeTypeConstants.DE_STRING;
}
@ -91,7 +92,7 @@ public class SqlserverQueryProvider extends QueryProvider {
.tableName((table.startsWith("(") && table.endsWith(")")) ? table : String.format(SqlServerSQLConstants.KEYWORD_TABLE, table))
.tableAlias(String.format(TABLE_ALIAS_PREFIX, 0))
.build();
setSchema(tableObj,ds);
setSchema(tableObj, ds);
List<SQLObj> xFields = new ArrayList<>();
if (CollectionUtils.isNotEmpty(fields)) {
@ -159,12 +160,12 @@ public class SqlserverQueryProvider extends QueryProvider {
@Override
public String createQueryTableWithLimit(String table, List<DatasetTableField> fields, Integer limit, boolean isGroup, Datasource ds) {
return createQuerySQL(table, fields, isGroup, ds) + " ORDER BY \"" + fields.get(0).getOriginName() + "\" offset 0 rows fetch next " + limit + " rows only";
return createQuerySQL(table, fields, isGroup, ds) + " ORDER BY \"" + fields.get(0).getOriginName() + "\" offset 0 rows fetch next " + limit + " rows only";
}
@Override
public String createQuerySqlWithLimit(String sql, List<DatasetTableField> fields, Integer limit, boolean isGroup) {
return createQuerySQLAsTmp(sql, fields, isGroup) + " ORDER BY \"" + fields.get(0).getOriginName() + "\" offset 0 rows fetch next " + limit + " rows only";
return createQuerySQLAsTmp(sql, fields, isGroup) + " ORDER BY \"" + fields.get(0).getOriginName() + "\" offset 0 rows fetch next " + limit + " rows only";
}
@Override
@ -173,7 +174,7 @@ public class SqlserverQueryProvider extends QueryProvider {
.tableName((table.startsWith("(") && table.endsWith(")")) ? table : String.format(SqlServerSQLConstants.KEYWORD_TABLE, table))
.tableAlias(String.format(TABLE_ALIAS_PREFIX, 0))
.build();
setSchema(tableObj,ds);
setSchema(tableObj, ds);
List<SQLObj> xFields = new ArrayList<>();
List<SQLObj> xWheres = new ArrayList<>();
List<SQLObj> xOrders = new ArrayList<>();
@ -270,7 +271,7 @@ public class SqlserverQueryProvider extends QueryProvider {
.tableName((table.startsWith("(") && table.endsWith(")")) ? table : String.format(SqlServerSQLConstants.KEYWORD_TABLE, table))
.tableAlias(String.format(TABLE_ALIAS_PREFIX, 0))
.build();
setSchema(tableObj,ds);
setSchema(tableObj, ds);
List<SQLObj> xFields = new ArrayList<>();
List<SQLObj> xWheres = new ArrayList<>();
List<SQLObj> xOrders = new ArrayList<>();
@ -388,7 +389,7 @@ public class SqlserverQueryProvider extends QueryProvider {
.tableName((table.startsWith("(") && table.endsWith(")")) ? table : String.format(SqlServerSQLConstants.KEYWORD_TABLE, table))
.tableAlias(String.format(TABLE_ALIAS_PREFIX, 0))
.build();
setSchema(tableObj,ds);
setSchema(tableObj, ds);
List<SQLObj> xFields = new ArrayList<>();
List<SQLObj> xWheres = new ArrayList<>();
List<SQLObj> xOrders = new ArrayList<>();
@ -588,11 +589,11 @@ public class SqlserverQueryProvider extends QueryProvider {
stringBuilder.append("\"").append(f.getOriginName()).append("\" AS ").append(f.getDataeaseName());
return stringBuilder.toString();
}).toArray(String[]::new);
if(ds != null){
if (ds != null) {
String schema = new Gson().fromJson(ds.getConfiguration(), JdbcDTO.class).getSchema();
String tableWithSchema = String.format(SqlServerSQLConstants.KEYWORD_TABLE, schema) + "." + String.format(SqlServerSQLConstants.KEYWORD_TABLE, table);
return MessageFormat.format("SELECT {0} FROM {1} ", StringUtils.join(array, ","), tableWithSchema);
}else {
} else {
return MessageFormat.format("SELECT {0} FROM {1} ", StringUtils.join(array, ","), table);
}
}
@ -651,9 +652,15 @@ public class SqlserverQueryProvider extends QueryProvider {
String whereTerm = transMysqlFilterTerm(request.getTerm());
String whereValue = "";
String originName = String.format(SqlServerSQLConstants.KEYWORD_FIX, tableObj.getTableAlias(), field.getOriginName());
if (field.getDeType() == DeTypeConstants.DE_TIME && field.getDeExtractType() != DeTypeConstants.DE_TIME) {
String cast = String.format(SqlServerSQLConstants.LONG_TO_DATE, originName + "/1000");
whereName = String.format(SqlServerSQLConstants.FROM_UNIXTIME, cast);
if (field.getDeType() == 1) {
if (field.getDeExtractType() == 0 || field.getDeExtractType() == 5) {
whereName = String.format(SqlServerSQLConstants.STRING_TO_DATE, originName);
}
if (field.getDeExtractType() == 2 || field.getDeExtractType() == 3) {
String cast = String.format(SqlServerSQLConstants.LONG_TO_DATE, originName + "/1000");
whereName = String.format(SqlServerSQLConstants.FROM_UNIXTIME, cast);
}
} else {
whereName = originName;
}
@ -692,9 +699,14 @@ public class SqlserverQueryProvider extends QueryProvider {
String whereValue = "";
String originName = String.format(SqlServerSQLConstants.KEYWORD_FIX, tableObj.getTableAlias(), field.getOriginName());
if (field.getDeType() == 1 && field.getDeExtractType() != 1) {
String cast = String.format(SqlServerSQLConstants.LONG_TO_DATE, originName + "/1000");
whereName = String.format(SqlServerSQLConstants.FROM_UNIXTIME, cast);
if (field.getDeType() == 1) {
if (field.getDeExtractType() == 0 || field.getDeExtractType() == 5) {
whereName = String.format(SqlServerSQLConstants.STRING_TO_DATE, originName);
}
if (field.getDeExtractType() == 2 || field.getDeExtractType() == 3) {
String cast = String.format(SqlServerSQLConstants.LONG_TO_DATE, originName + "/1000");
whereName = String.format(SqlServerSQLConstants.FROM_UNIXTIME, cast);
}
} else {
whereName = originName;
}
@ -744,30 +756,30 @@ public class SqlserverQueryProvider extends QueryProvider {
case "y":
return "CONVERT(varchar(100), datepart(yy, " + originField + "))";
case "y_M":
if(split.equalsIgnoreCase("-")){
if (split.equalsIgnoreCase("-")) {
return "substring( convert(varchar," + originField + ",120),1,7)";
}else {
return "replace("+ "substring( convert(varchar," + originField + ",120),1,7), '-','/')";
} else {
return "replace(" + "substring( convert(varchar," + originField + ",120),1,7), '-','/')";
}
case "y_M_d":
if(split.equalsIgnoreCase("-")){
if (split.equalsIgnoreCase("-")) {
return "CONVERT(varchar(100), " + originField + ", 23)";
}else {
} else {
return "CONVERT(varchar(100), " + originField + ", 111)";
}
case "H_m_s":
return "CONVERT(varchar(100), " + originField + ", 8)";
case "y_M_d_H_m":
if(split.equalsIgnoreCase("-")){
if (split.equalsIgnoreCase("-")) {
return "substring( convert(varchar," + originField + ",120),1,16)";
}else {
return "replace("+ "substring( convert(varchar," + originField + ",120),1,16), '-','/')";
} else {
return "replace(" + "substring( convert(varchar," + originField + ",120),1,16), '-','/')";
}
case "y_M_d_H_m_s":
if(split.equalsIgnoreCase("-")){
if (split.equalsIgnoreCase("-")) {
return "convert(varchar," + originField + ",120)";
}else {
return "replace("+ "convert(varchar," + originField + ",120), '-','/')";
} else {
return "replace(" + "convert(varchar," + originField + ",120), '-','/')";
}
default:
return "convert(varchar," + originField + ",120)";
@ -790,7 +802,7 @@ public class SqlserverQueryProvider extends QueryProvider {
String cast = String.format(SqlServerSQLConstants.STRING_TO_DATE, originField);
fieldName = transDateFormat(x.getDateStyle(), x.getDatePattern(), cast);
} else {// 数值转时间
String cast = String.format(SqlServerSQLConstants.LONG_TO_DATE, originField+ "/1000");
String cast = String.format(SqlServerSQLConstants.LONG_TO_DATE, originField + "/1000");
fieldName = transDateFormat(x.getDateStyle(), x.getDatePattern(), cast);
}
} else {

View File

@ -427,6 +427,8 @@ public class ChartViewService {
} else if (StringUtils.containsIgnoreCase(view.getType(), "text")
|| StringUtils.containsIgnoreCase(view.getType(), "gauge")) {
mapChart = transNormalChartData(xAxis, yAxis, view, data, isDrill);
} else if (StringUtils.containsIgnoreCase(view.getType(), "chart-mix")) {
mapChart = transMixChartData(xAxis, yAxis, view, data, isDrill);
} else {
mapChart = transChartData(xAxis, yAxis, view, data, isDrill);
}
@ -561,6 +563,67 @@ public class ChartViewService {
return map;
}
// 组合图形
private Map<String, Object> transMixChartData(List<ChartViewFieldDTO> xAxis, List<ChartViewFieldDTO> yAxis, ChartViewWithBLOBs view, List<String[]> data, boolean isDrill) {
Map<String, Object> map = new HashMap<>();
List<String> x = new ArrayList<>();
List<Series> series = new ArrayList<>();
for (ChartViewFieldDTO y : yAxis) {
Series series1 = new Series();
series1.setName(y.getName());
series1.setType(y.getChartType());
series1.setData(new ArrayList<>());
series.add(series1);
}
for (int i1 = 0; i1 < data.size(); i1++) {
String[] d = data.get(i1);
StringBuilder a = new StringBuilder();
for (int i = xAxis.size(); i < xAxis.size() + yAxis.size(); i++) {
List<ChartDimensionDTO> dimensionList = new ArrayList<>();
List<ChartQuotaDTO> quotaList = new ArrayList<>();
AxisChartDataDTO axisChartDataDTO = new AxisChartDataDTO();
for (int j = 0; j < xAxis.size(); j++) {
ChartDimensionDTO chartDimensionDTO = new ChartDimensionDTO();
chartDimensionDTO.setId(xAxis.get(j).getId());
chartDimensionDTO.setValue(d[j]);
dimensionList.add(chartDimensionDTO);
}
axisChartDataDTO.setDimensionList(dimensionList);
int j = i - xAxis.size();
ChartQuotaDTO chartQuotaDTO = new ChartQuotaDTO();
chartQuotaDTO.setId(yAxis.get(j).getId());
quotaList.add(chartQuotaDTO);
axisChartDataDTO.setQuotaList(quotaList);
try {
axisChartDataDTO.setValue(new BigDecimal(StringUtils.isEmpty(d[i]) ? "0" : d[i]));
} catch (Exception e) {
axisChartDataDTO.setValue(new BigDecimal(0));
}
series.get(j).getData().add(axisChartDataDTO);
}
if (isDrill) {
a.append(d[xAxis.size() - 1]);
} else {
for (int i = 0; i < xAxis.size(); i++) {
if (i == xAxis.size() - 1) {
a.append(d[i]);
} else {
a.append(d[i]).append("\n");
}
}
}
x.add(a.toString());
}
map.put("x", x);
map.put("series", series);
return map;
}
// 常规图形
private Map<String, Object> transNormalChartData(List<ChartViewFieldDTO> xAxis, List<ChartViewFieldDTO> yAxis, ChartViewWithBLOBs view, List<String[]> data, boolean isDrill) {
Map<String, Object> map = new HashMap<>();

View File

@ -191,6 +191,11 @@ public class DataSetTableTaskService {
if(dataSetTaskDTOS.get(0).getNextExecTime() == null || dataSetTaskDTOS.get(0).getNextExecTime() <= 0){
datasetTableTask.setStatus(TaskStatus.Stopped.name());
update(datasetTableTask);
return;
}
if(dataSetTaskDTOS.get(0).getNextExecTime() > datasetTableTask.getEndTime()){
datasetTableTask.setStatus(TaskStatus.Stopped.name());
update(datasetTableTask);
}
}
}

View File

@ -555,7 +555,7 @@ public class ExtractDataService {
datasetTableTaskLog.setTaskId(taskId);
datasetTableTaskLog.setStatus(JobStatus.Underway.name());
datasetTableTaskLog.setTriggerType(TriggerType.Custom.name());
for (int i = 0; i < 5; i++) {
for (int i = 0; i < 10; i++) {
List<DatasetTableTaskLog> datasetTableTaskLogs = dataSetTableTaskLogService.select(datasetTableTaskLog);
if (CollectionUtils.isNotEmpty(datasetTableTaskLogs)) {
return datasetTableTaskLogs.get(0);
@ -768,7 +768,7 @@ public class ExtractDataService {
switch (datasourceType) {
case mysql:
MysqlConfigration mysqlConfigration = new Gson().fromJson(datasource.getConfiguration(), MysqlConfigration.class);
dataMeta = new DatabaseMeta("db", "MYSQL", "Native", mysqlConfigration.getHost(), mysqlConfigration.getDataBase(), mysqlConfigration.getPort().toString(), mysqlConfigration.getUsername(), mysqlConfigration.getPassword());
dataMeta = new DatabaseMeta("db", "MYSQL", "Native", mysqlConfigration.getHost().trim(), mysqlConfigration.getDataBase().trim(), mysqlConfigration.getPort().toString(), mysqlConfigration.getUsername(), mysqlConfigration.getPassword());
dataMeta.addExtraOption("MYSQL", "characterEncoding", "UTF-8");
transMeta.addDatabase(dataMeta);
selectSQL = getSelectSQL(extractType, datasetTable, datasource, datasetTableFields, selectSQL);
@ -777,7 +777,7 @@ public class ExtractDataService {
break;
case sqlServer:
SqlServerConfigration sqlServerConfigration = new Gson().fromJson(datasource.getConfiguration(), SqlServerConfigration.class);
dataMeta = new DatabaseMeta("db", "MSSQLNATIVE", "Native", sqlServerConfigration.getHost(), sqlServerConfigration.getDataBase(), sqlServerConfigration.getPort().toString(), sqlServerConfigration.getUsername(), sqlServerConfigration.getPassword());
dataMeta = new DatabaseMeta("db", "MSSQLNATIVE", "Native", sqlServerConfigration.getHost().trim(), sqlServerConfigration.getDataBase(), sqlServerConfigration.getPort().toString(), sqlServerConfigration.getUsername(), sqlServerConfigration.getPassword());
transMeta.addDatabase(dataMeta);
selectSQL = getSelectSQL(extractType, datasetTable, datasource, datasetTableFields, selectSQL);
inputStep = inputStep(transMeta, selectSQL);
@ -785,7 +785,7 @@ public class ExtractDataService {
break;
case pg:
PgConfigration pgConfigration = new Gson().fromJson(datasource.getConfiguration(), PgConfigration.class);
dataMeta = new DatabaseMeta("db", "POSTGRESQL", "Native", pgConfigration.getHost(), pgConfigration.getDataBase(), pgConfigration.getPort().toString(), pgConfigration.getUsername(), pgConfigration.getPassword());
dataMeta = new DatabaseMeta("db", "POSTGRESQL", "Native", pgConfigration.getHost().trim(), pgConfigration.getDataBase(), pgConfigration.getPort().toString(), pgConfigration.getUsername(), pgConfigration.getPassword());
transMeta.addDatabase(dataMeta);
selectSQL = getSelectSQL(extractType, datasetTable, datasource, datasetTableFields, selectSQL);
inputStep = inputStep(transMeta, selectSQL);
@ -797,7 +797,7 @@ public class ExtractDataService {
String database = "(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = ORACLE_HOSTNAME)(PORT = ORACLE_PORT))(CONNECT_DATA = (SERVER = DEDICATED)(SERVICE_NAME = ORACLE_SERVICE_NAME )))".replace("ORACLE_HOSTNAME", oracleConfigration.getHost()).replace("ORACLE_PORT", oracleConfigration.getPort().toString()).replace("ORACLE_SERVICE_NAME", oracleConfigration.getDataBase());
dataMeta = new DatabaseMeta("db", "ORACLE", "Native", "", database, "-1", oracleConfigration.getUsername(), oracleConfigration.getPassword());
} else {
dataMeta = new DatabaseMeta("db", "ORACLE", "Native", oracleConfigration.getHost(), oracleConfigration.getDataBase(), oracleConfigration.getPort().toString(), oracleConfigration.getUsername(), oracleConfigration.getPassword());
dataMeta = new DatabaseMeta("db", "ORACLE", "Native", oracleConfigration.getHost().trim(), oracleConfigration.getDataBase(), oracleConfigration.getPort().toString(), oracleConfigration.getUsername(), oracleConfigration.getPassword());
}
transMeta.addDatabase(dataMeta);
@ -1001,8 +1001,9 @@ public class ExtractDataService {
}
private StepMeta udjc(List<DatasetTableField> datasetTableFields, DatasourceTypes datasourceType) {
String needToChangeColumnType = "";
// String needToChangeColumnType = "";
String handleBinaryTypeCode = "";
String excelCompletion = "";
for (DatasetTableField datasetTableField : datasetTableFields) {
if(datasetTableField.getDeExtractType() == 5){
@ -1016,9 +1017,8 @@ public class ExtractDataService {
fields.add(fieldInfo);
userDefinedJavaClassMeta.setFieldInfo(fields);
List<UserDefinedJavaClassDef> definitions = new ArrayList<UserDefinedJavaClassDef>();
String tmp_code = code.replace("alterColumnTypeCode", needToChangeColumnType);
String tmp_code = code.replace("handleWraps", handleWraps).replace("handleBinaryType", handleBinaryTypeCode);
tmp_code = tmp_code.replace("handleWraps", handleWraps);
String Column_Fields = "";
if (datasourceType.equals(DatasourceTypes.oracle)) {
Column_Fields = String.join(",", datasetTableFields.stream().map(DatasetTableField::getOriginName).collect(Collectors.toList()));
@ -1027,12 +1027,13 @@ public class ExtractDataService {
}
if (datasourceType.equals(DatasourceTypes.excel)) {
tmp_code = tmp_code.replace("handleExcelIntColumn", handleExcelIntColumn).replace("Column_Fields", Column_Fields);
tmp_code = tmp_code.replace("handleExcelIntColumn", handleExcelIntColumn).replace("Column_Fields", Column_Fields)
.replace("ExcelCompletion", excelCompletion);
} else {
tmp_code = tmp_code.replace("handleExcelIntColumn", "").replace("Column_Fields", Column_Fields);
tmp_code = tmp_code.replace("handleExcelIntColumn", "").replace("Column_Fields", Column_Fields)
.replace("ExcelCompletion", "");;
}
tmp_code = tmp_code.replace("handleBinaryType", handleBinaryTypeCode);
UserDefinedJavaClassDef userDefinedJavaClassDef = new UserDefinedJavaClassDef(UserDefinedJavaClassDef.ClassType.TRANSFORM_CLASS, "Processor", tmp_code);
userDefinedJavaClassDef.setActive(true);
@ -1121,15 +1122,15 @@ public class ExtractDataService {
" \t}";
private final static String alterColumnTypeCode = " if(\"FILED\".equalsIgnoreCase(filed)){\n" +
"\t if(tmp != null && tmp.equalsIgnoreCase(\"Y\")){\n" +
" get(Fields.Out, filed).setValue(r, 1);\n" +
" get(Fields.Out, filed).getValueMeta().setType(2);\n" +
" }else{\n" +
" get(Fields.Out, filed).setValue(r, 0);\n" +
" get(Fields.Out, filed).getValueMeta().setType(2);\n" +
" }\n" +
" }\n";
// private final static String alterColumnTypeCode = " if(\"FILED\".equalsIgnoreCase(filed)){\n" +
// "\t if(tmp != null && tmp.equalsIgnoreCase(\"Y\")){\n" +
// " get(Fields.Out, filed).setValue(r, 1);\n" +
// " get(Fields.Out, filed).getValueMeta().setType(2);\n" +
// " }else{\n" +
// " get(Fields.Out, filed).setValue(r, 0);\n" +
// " get(Fields.Out, filed).getValueMeta().setType(2);\n" +
// " }\n" +
// " }\n" ;
private final static String handleExcelIntColumn = " \t\tif(tmp != null && tmp.endsWith(\".0\")){\n" +
" try {\n" +
@ -1144,7 +1145,12 @@ public class ExtractDataService {
" tmp = tmp.replaceAll(\"\\r\",\" \");\n" +
" tmp = tmp.replaceAll(\"\\n\",\" \");\n" +
" get(Fields.Out, filed).setValue(r, tmp);\n" +
" } ";
" } \n";
private final static String excelCompletion = "\t\tif(tmp == null){\n" +
" \t\t\ttmp = \"\";\n" +
"\t\t\tget(Fields.Out, filed).setValue(r, tmp);\n" +
"\t\t}";
private final static String code = "import org.pentaho.di.core.row.ValueMetaInterface;\n" +
"import java.util.List;\n" +
@ -1176,7 +1182,7 @@ public class ExtractDataService {
" for (String filed : fileds) {\n" +
" String tmp = get(Fields.In, filed).getString(r);\n" +
"handleWraps \n" +
"alterColumnTypeCode \n" +
"ExcelCompletion \n" +
"handleBinaryType \n" +
"handleExcelIntColumn \n" +
" str = str + tmp;\n" +

View File

@ -383,3 +383,72 @@ INSERT INTO `sys_auth_detail` (`id`, `auth_id`, `privilege_name`, `privilege_typ
INSERT INTO `sys_auth_detail` (`id`, `auth_id`, `privilege_name`, `privilege_type`, `privilege_value`, `privilege_extend`, `remark`, `create_user`, `create_time`, `update_time`) VALUES ('dc1d32ff-064a-11ec-a2b0-0242ac130003', 'd78c6e77-9cc7-44f8-a730-32ca6ca33f60', 'i18n_auth_grant', 15, 0, 'grant', '基础权限-授权', 'admin', 1629967913000, NULL);
INSERT INTO `sys_auth_detail` (`id`, `auth_id`, `privilege_name`, `privilege_type`, `privilege_value`, `privilege_extend`, `remark`, `create_user`, `create_time`, `update_time`) VALUES ('dc1d3358-064a-11ec-a2b0-0242ac130003', 'd78c6e77-9cc7-44f8-a730-32ca6ca33f60', 'i18n_auth_manage', 5, 0, 'manage', '基础权限-管理', 'admin', 1629967913000, NULL);
INSERT INTO `sys_auth_detail` (`id`, `auth_id`, `privilege_name`, `privilege_type`, `privilege_value`, `privilege_extend`, `remark`, `create_user`, `create_time`, `update_time`) VALUES ('dc1d33a4-064a-11ec-a2b0-0242ac130003', 'd78c6e77-9cc7-44f8-a730-32ca6ca33f60', 'i18n_auth_view', 1, 1, 'view', '基础权限-查看', 'admin', 1629967913000, NULL);
INSERT INTO `sys_auth` (`id`, `auth_source`, `auth_source_type`, `auth_target`, `auth_target_type`, `auth_time`, `auth_details`, `auth_user`, `update_time`) VALUES ('00590a7c-8e7b-45f4-8428-55532be07602', '10', 'menu', '1', 'role', 1630482462199, NULL, 'admin', NULL);
INSERT INTO `sys_auth` (`id`, `auth_source`, `auth_source_type`, `auth_target`, `auth_target_type`, `auth_time`, `auth_details`, `auth_user`, `update_time`) VALUES ('06ba0edb-143d-4b51-a864-8cfcf2b5d71e', '1', 'menu', '1', 'role', 1630482426344, NULL, 'admin', NULL);
INSERT INTO `sys_auth` (`id`, `auth_source`, `auth_source_type`, `auth_target`, `auth_target_type`, `auth_time`, `auth_details`, `auth_user`, `update_time`) VALUES ('1a18aa12-8daa-4f47-b5eb-999e473273df', '6', 'menu', '1', 'role', 1630482450994, NULL, 'admin', NULL);
INSERT INTO `sys_auth` (`id`, `auth_source`, `auth_source_type`, `auth_target`, `auth_target_type`, `auth_time`, `auth_details`, `auth_user`, `update_time`) VALUES ('1bf39d8d-7fe9-4832-8df3-f74b21a69288', '4', 'menu', '1', 'role', 1630482450458, NULL, 'admin', NULL);
INSERT INTO `sys_auth` (`id`, `auth_source`, `auth_source_type`, `auth_target`, `auth_target_type`, `auth_time`, `auth_details`, `auth_user`, `update_time`) VALUES ('359771bb-95b8-40ad-a6c5-b5c39c93cb10', '24', 'menu', '1', 'role', 1630482459156, NULL, 'admin', NULL);
INSERT INTO `sys_auth` (`id`, `auth_source`, `auth_source_type`, `auth_target`, `auth_target_type`, `auth_time`, `auth_details`, `auth_user`, `update_time`) VALUES ('5960fd93-013c-4636-8f6b-2e6b49b7e869', '5', 'menu', '1', 'role', 1630482450626, NULL, 'admin', NULL);
INSERT INTO `sys_auth` (`id`, `auth_source`, `auth_source_type`, `auth_target`, `auth_target_type`, `auth_time`, `auth_details`, `auth_user`, `update_time`) VALUES ('5e0a9ad5-81ed-4f83-91f6-a74be724bda7', '23', 'menu', '1', 'role', 1630482452131, NULL, 'admin', NULL);
INSERT INTO `sys_auth` (`id`, `auth_source`, `auth_source_type`, `auth_target`, `auth_target_type`, `auth_time`, `auth_details`, `auth_user`, `update_time`) VALUES ('5ec5c9a7-04c0-4655-9b63-9ca5a439e2f3', '18', 'menu', '1', 'role', 1630482451166, NULL, 'admin', NULL);
INSERT INTO `sys_auth` (`id`, `auth_source`, `auth_source_type`, `auth_target`, `auth_target_type`, `auth_time`, `auth_details`, `auth_user`, `update_time`) VALUES ('60b3644b-2493-4805-8204-90880cfac9c6', '8', 'menu', '1', 'role', 1630482460538, NULL, 'admin', NULL);
INSERT INTO `sys_auth` (`id`, `auth_source`, `auth_source_type`, `auth_target`, `auth_target_type`, `auth_time`, `auth_details`, `auth_user`, `update_time`) VALUES ('74ff225f-2a79-4221-9b32-c6eb9bcadd61', '19', 'menu', '1', 'role', 1630482451329, NULL, 'admin', NULL);
INSERT INTO `sys_auth` (`id`, `auth_source`, `auth_source_type`, `auth_target`, `auth_target_type`, `auth_time`, `auth_details`, `auth_user`, `update_time`) VALUES ('7823499e-dbb6-42a9-a28f-22377de18a39', '40', 'menu', '1', 'role', 1630482427369, NULL, 'admin', NULL);
INSERT INTO `sys_auth` (`id`, `auth_source`, `auth_source_type`, `auth_target`, `auth_target_type`, `auth_time`, `auth_details`, `auth_user`, `update_time`) VALUES ('88c778e6-ede3-4397-af4c-375e1feac8ef', '41', 'menu', '1', 'role', 1630482452340, NULL, 'admin', NULL);
INSERT INTO `sys_auth` (`id`, `auth_source`, `auth_source_type`, `auth_target`, `auth_target_type`, `auth_time`, `auth_details`, `auth_user`, `update_time`) VALUES ('998e402b-6f15-48dc-ae4d-2cd04460a3f3', '15', 'menu', '1', 'role', 1630482426695, NULL, 'admin', NULL);
INSERT INTO `sys_auth` (`id`, `auth_source`, `auth_source_type`, `auth_target`, `auth_target_type`, `auth_time`, `auth_details`, `auth_user`, `update_time`) VALUES ('9f01c7ef-753b-4dea-97d4-c199f84c2c74', '17', 'menu', '1', 'role', 1630482427049, NULL, 'admin', NULL);
INSERT INTO `sys_auth` (`id`, `auth_source`, `auth_source_type`, `auth_target`, `auth_target_type`, `auth_time`, `auth_details`, `auth_user`, `update_time`) VALUES ('a6837d68-80a6-4a26-a7c0-e84001dfc817', '34', 'menu', '1', 'role', 1630482458991, NULL, 'admin', NULL);
INSERT INTO `sys_auth` (`id`, `auth_source`, `auth_source_type`, `auth_target`, `auth_target_type`, `auth_time`, `auth_details`, `auth_user`, `update_time`) VALUES ('b319dc39-c499-423b-8e99-22e9a0caba6f', '58', 'menu', '1', 'role', 1630482427545, NULL, 'admin', NULL);
INSERT INTO `sys_auth` (`id`, `auth_source`, `auth_source_type`, `auth_target`, `auth_target_type`, `auth_time`, `auth_details`, `auth_user`, `update_time`) VALUES ('bdd3bed8-35d4-4aa8-84c2-85e2412d6cbb', '2', 'menu', '1', 'role', 1630482426513, NULL, 'admin', NULL);
INSERT INTO `sys_auth` (`id`, `auth_source`, `auth_source_type`, `auth_target`, `auth_target_type`, `auth_time`, `auth_details`, `auth_user`, `update_time`) VALUES ('c18b47e9-aa22-4f17-b12c-a3459ca4dd90', '28', 'menu', '1', 'role', 1630482427208, NULL, 'admin', NULL);
INSERT INTO `sys_auth` (`id`, `auth_source`, `auth_source_type`, `auth_target`, `auth_target_type`, `auth_time`, `auth_details`, `auth_user`, `update_time`) VALUES ('d3d558e5-b0b1-4475-bb69-f20fa5c47f4f', '22', 'menu', '1', 'role', 1630482451962, NULL, 'admin', NULL);
INSERT INTO `sys_auth` (`id`, `auth_source`, `auth_source_type`, `auth_target`, `auth_target_type`, `auth_time`, `auth_details`, `auth_user`, `update_time`) VALUES ('d400c00f-9c18-4eb6-a70f-9c8caf8dddfe', '21', 'menu', '1', 'role', 1630482451749, NULL, 'admin', NULL);
INSERT INTO `sys_auth` (`id`, `auth_source`, `auth_source_type`, `auth_target`, `auth_target_type`, `auth_time`, `auth_details`, `auth_user`, `update_time`) VALUES ('d8d18115-c7b9-4e99-96a8-fd1bbfddf543', '16', 'menu', '1', 'role', 1630482426857, NULL, 'admin', NULL);
INSERT INTO `sys_auth` (`id`, `auth_source`, `auth_source_type`, `auth_target`, `auth_target_type`, `auth_time`, `auth_details`, `auth_user`, `update_time`) VALUES ('f17dc7f3-c97a-41b4-a2f4-1a04a857ae8a', '20', 'menu', '1', 'role', 1630482451497, NULL, 'admin', NULL);
INSERT INTO `sys_auth_detail` (`id`, `auth_id`, `privilege_name`, `privilege_type`, `privilege_value`, `privilege_extend`, `remark`, `create_user`, `create_time`, `update_time`) VALUES ('cf3c570c-0af8-11ec-a2b0-0242ac130003', '06ba0edb-143d-4b51-a864-8cfcf2b5d71e', 'i18n_auth_grant', 15, 0, 'grant', '基础权限-授权', 'admin', 1630482428000, NULL);
INSERT INTO `sys_auth_detail` (`id`, `auth_id`, `privilege_name`, `privilege_type`, `privilege_value`, `privilege_extend`, `remark`, `create_user`, `create_time`, `update_time`) VALUES ('cf3c59d1-0af8-11ec-a2b0-0242ac130003', '06ba0edb-143d-4b51-a864-8cfcf2b5d71e', 'i18n_auth_use', 1, 1, 'use', '基础权限-使用', 'admin', 1630482428000, NULL);
INSERT INTO `sys_auth_detail` (`id`, `auth_id`, `privilege_name`, `privilege_type`, `privilege_value`, `privilege_extend`, `remark`, `create_user`, `create_time`, `update_time`) VALUES ('cf573296-0af8-11ec-a2b0-0242ac130003', 'bdd3bed8-35d4-4aa8-84c2-85e2412d6cbb', 'i18n_auth_grant', 15, 0, 'grant', '基础权限-授权', 'admin', 1630482428000, NULL);
INSERT INTO `sys_auth_detail` (`id`, `auth_id`, `privilege_name`, `privilege_type`, `privilege_value`, `privilege_extend`, `remark`, `create_user`, `create_time`, `update_time`) VALUES ('cf57354a-0af8-11ec-a2b0-0242ac130003', 'bdd3bed8-35d4-4aa8-84c2-85e2412d6cbb', 'i18n_auth_use', 1, 1, 'use', '基础权限-使用', 'admin', 1630482428000, NULL);
INSERT INTO `sys_auth_detail` (`id`, `auth_id`, `privilege_name`, `privilege_type`, `privilege_value`, `privilege_extend`, `remark`, `create_user`, `create_time`, `update_time`) VALUES ('cf705f77-0af8-11ec-a2b0-0242ac130003', '998e402b-6f15-48dc-ae4d-2cd04460a3f3', 'i18n_auth_grant', 15, 0, 'grant', '基础权限-授权', 'admin', 1630482429000, NULL);
INSERT INTO `sys_auth_detail` (`id`, `auth_id`, `privilege_name`, `privilege_type`, `privilege_value`, `privilege_extend`, `remark`, `create_user`, `create_time`, `update_time`) VALUES ('cf7061d1-0af8-11ec-a2b0-0242ac130003', '998e402b-6f15-48dc-ae4d-2cd04460a3f3', 'i18n_auth_use', 1, 1, 'use', '基础权限-使用', 'admin', 1630482429000, NULL);
INSERT INTO `sys_auth_detail` (`id`, `auth_id`, `privilege_name`, `privilege_type`, `privilege_value`, `privilege_extend`, `remark`, `create_user`, `create_time`, `update_time`) VALUES ('cf8b490d-0af8-11ec-a2b0-0242ac130003', 'd8d18115-c7b9-4e99-96a8-fd1bbfddf543', 'i18n_auth_grant', 15, 0, 'grant', '基础权限-授权', 'admin', 1630482429000, NULL);
INSERT INTO `sys_auth_detail` (`id`, `auth_id`, `privilege_name`, `privilege_type`, `privilege_value`, `privilege_extend`, `remark`, `create_user`, `create_time`, `update_time`) VALUES ('cf8b4b35-0af8-11ec-a2b0-0242ac130003', 'd8d18115-c7b9-4e99-96a8-fd1bbfddf543', 'i18n_auth_use', 1, 1, 'use', '基础权限-使用', 'admin', 1630482429000, NULL);
INSERT INTO `sys_auth_detail` (`id`, `auth_id`, `privilege_name`, `privilege_type`, `privilege_value`, `privilege_extend`, `remark`, `create_user`, `create_time`, `update_time`) VALUES ('cfa66a8d-0af8-11ec-a2b0-0242ac130003', '9f01c7ef-753b-4dea-97d4-c199f84c2c74', 'i18n_auth_grant', 15, 0, 'grant', '基础权限-授权', 'admin', 1630482429000, NULL);
INSERT INTO `sys_auth_detail` (`id`, `auth_id`, `privilege_name`, `privilege_type`, `privilege_value`, `privilege_extend`, `remark`, `create_user`, `create_time`, `update_time`) VALUES ('cfa66ca4-0af8-11ec-a2b0-0242ac130003', '9f01c7ef-753b-4dea-97d4-c199f84c2c74', 'i18n_auth_use', 1, 1, 'use', '基础权限-使用', 'admin', 1630482429000, NULL);
INSERT INTO `sys_auth_detail` (`id`, `auth_id`, `privilege_name`, `privilege_type`, `privilege_value`, `privilege_extend`, `remark`, `create_user`, `create_time`, `update_time`) VALUES ('cfbf0608-0af8-11ec-a2b0-0242ac130003', 'c18b47e9-aa22-4f17-b12c-a3459ca4dd90', 'i18n_auth_grant', 15, 0, 'grant', '基础权限-授权', 'admin', 1630482429000, NULL);
INSERT INTO `sys_auth_detail` (`id`, `auth_id`, `privilege_name`, `privilege_type`, `privilege_value`, `privilege_extend`, `remark`, `create_user`, `create_time`, `update_time`) VALUES ('cfbf0839-0af8-11ec-a2b0-0242ac130003', 'c18b47e9-aa22-4f17-b12c-a3459ca4dd90', 'i18n_auth_use', 1, 1, 'use', '基础权限-使用', 'admin', 1630482429000, NULL);
INSERT INTO `sys_auth_detail` (`id`, `auth_id`, `privilege_name`, `privilege_type`, `privilege_value`, `privilege_extend`, `remark`, `create_user`, `create_time`, `update_time`) VALUES ('cfd814bc-0af8-11ec-a2b0-0242ac130003', '7823499e-dbb6-42a9-a28f-22377de18a39', 'i18n_auth_grant', 15, 0, 'grant', '基础权限-授权', 'admin', 1630482429000, NULL);
INSERT INTO `sys_auth_detail` (`id`, `auth_id`, `privilege_name`, `privilege_type`, `privilege_value`, `privilege_extend`, `remark`, `create_user`, `create_time`, `update_time`) VALUES ('cfd816d7-0af8-11ec-a2b0-0242ac130003', '7823499e-dbb6-42a9-a28f-22377de18a39', 'i18n_auth_use', 1, 1, 'use', '基础权限-使用', 'admin', 1630482429000, NULL);
INSERT INTO `sys_auth_detail` (`id`, `auth_id`, `privilege_name`, `privilege_type`, `privilege_value`, `privilege_extend`, `remark`, `create_user`, `create_time`, `update_time`) VALUES ('cff28219-0af8-11ec-a2b0-0242ac130003', 'b319dc39-c499-423b-8e99-22e9a0caba6f', 'i18n_auth_grant', 15, 0, 'grant', '基础权限-授权', 'admin', 1630482429000, NULL);
INSERT INTO `sys_auth_detail` (`id`, `auth_id`, `privilege_name`, `privilege_type`, `privilege_value`, `privilege_extend`, `remark`, `create_user`, `create_time`, `update_time`) VALUES ('cff28507-0af8-11ec-a2b0-0242ac130003', 'b319dc39-c499-423b-8e99-22e9a0caba6f', 'i18n_auth_use', 1, 1, 'use', '基础权限-使用', 'admin', 1630482429000, NULL);
INSERT INTO `sys_auth_detail` (`id`, `auth_id`, `privilege_name`, `privilege_type`, `privilege_value`, `privilege_extend`, `remark`, `create_user`, `create_time`, `update_time`) VALUES ('dd9ba5c6-0af8-11ec-a2b0-0242ac130003', '1bf39d8d-7fe9-4832-8df3-f74b21a69288', 'i18n_auth_grant', 15, 0, 'grant', '基础权限-授权', 'admin', 1630482452000, NULL);
INSERT INTO `sys_auth_detail` (`id`, `auth_id`, `privilege_name`, `privilege_type`, `privilege_value`, `privilege_extend`, `remark`, `create_user`, `create_time`, `update_time`) VALUES ('dd9ba7e8-0af8-11ec-a2b0-0242ac130003', '1bf39d8d-7fe9-4832-8df3-f74b21a69288', 'i18n_auth_use', 1, 1, 'use', '基础权限-使用', 'admin', 1630482452000, NULL);
INSERT INTO `sys_auth_detail` (`id`, `auth_id`, `privilege_name`, `privilege_type`, `privilege_value`, `privilege_extend`, `remark`, `create_user`, `create_time`, `update_time`) VALUES ('ddb3094b-0af8-11ec-a2b0-0242ac130003', '5960fd93-013c-4636-8f6b-2e6b49b7e869', 'i18n_auth_grant', 15, 0, 'grant', '基础权限-授权', 'admin', 1630482452000, NULL);
INSERT INTO `sys_auth_detail` (`id`, `auth_id`, `privilege_name`, `privilege_type`, `privilege_value`, `privilege_extend`, `remark`, `create_user`, `create_time`, `update_time`) VALUES ('ddb30bd2-0af8-11ec-a2b0-0242ac130003', '5960fd93-013c-4636-8f6b-2e6b49b7e869', 'i18n_auth_use', 1, 1, 'use', '基础权限-使用', 'admin', 1630482452000, NULL);
INSERT INTO `sys_auth_detail` (`id`, `auth_id`, `privilege_name`, `privilege_type`, `privilege_value`, `privilege_extend`, `remark`, `create_user`, `create_time`, `update_time`) VALUES ('ddec6eab-0af8-11ec-a2b0-0242ac130003', '1a18aa12-8daa-4f47-b5eb-999e473273df', 'i18n_auth_grant', 15, 0, 'grant', '基础权限-授权', 'admin', 1630482453000, NULL);
INSERT INTO `sys_auth_detail` (`id`, `auth_id`, `privilege_name`, `privilege_type`, `privilege_value`, `privilege_extend`, `remark`, `create_user`, `create_time`, `update_time`) VALUES ('ddeccfa8-0af8-11ec-a2b0-0242ac130003', '1a18aa12-8daa-4f47-b5eb-999e473273df', 'i18n_auth_use', 1, 1, 'use', '基础权限-使用', 'admin', 1630482453000, NULL);
INSERT INTO `sys_auth_detail` (`id`, `auth_id`, `privilege_name`, `privilege_type`, `privilege_value`, `privilege_extend`, `remark`, `create_user`, `create_time`, `update_time`) VALUES ('de0719cb-0af8-11ec-a2b0-0242ac130003', '5ec5c9a7-04c0-4655-9b63-9ca5a439e2f3', 'i18n_auth_grant', 15, 0, 'grant', '基础权限-授权', 'admin', 1630482453000, NULL);
INSERT INTO `sys_auth_detail` (`id`, `auth_id`, `privilege_name`, `privilege_type`, `privilege_value`, `privilege_extend`, `remark`, `create_user`, `create_time`, `update_time`) VALUES ('de071bd9-0af8-11ec-a2b0-0242ac130003', '5ec5c9a7-04c0-4655-9b63-9ca5a439e2f3', 'i18n_auth_use', 1, 1, 'use', '基础权限-使用', 'admin', 1630482453000, NULL);
INSERT INTO `sys_auth_detail` (`id`, `auth_id`, `privilege_name`, `privilege_type`, `privilege_value`, `privilege_extend`, `remark`, `create_user`, `create_time`, `update_time`) VALUES ('de202758-0af8-11ec-a2b0-0242ac130003', '74ff225f-2a79-4221-9b32-c6eb9bcadd61', 'i18n_auth_grant', 15, 0, 'grant', '基础权限-授权', 'admin', 1630482453000, NULL);
INSERT INTO `sys_auth_detail` (`id`, `auth_id`, `privilege_name`, `privilege_type`, `privilege_value`, `privilege_extend`, `remark`, `create_user`, `create_time`, `update_time`) VALUES ('de202961-0af8-11ec-a2b0-0242ac130003', '74ff225f-2a79-4221-9b32-c6eb9bcadd61', 'i18n_auth_use', 1, 1, 'use', '基础权限-使用', 'admin', 1630482453000, NULL);
INSERT INTO `sys_auth_detail` (`id`, `auth_id`, `privilege_name`, `privilege_type`, `privilege_value`, `privilege_extend`, `remark`, `create_user`, `create_time`, `update_time`) VALUES ('de42f5ec-0af8-11ec-a2b0-0242ac130003', 'f17dc7f3-c97a-41b4-a2f4-1a04a857ae8a', 'i18n_auth_grant', 15, 0, 'grant', '基础权限-授权', 'admin', 1630482453000, NULL);
INSERT INTO `sys_auth_detail` (`id`, `auth_id`, `privilege_name`, `privilege_type`, `privilege_value`, `privilege_extend`, `remark`, `create_user`, `create_time`, `update_time`) VALUES ('de42f8b4-0af8-11ec-a2b0-0242ac130003', 'f17dc7f3-c97a-41b4-a2f4-1a04a857ae8a', 'i18n_auth_use', 1, 1, 'use', '基础权限-使用', 'admin', 1630482453000, NULL);
INSERT INTO `sys_auth_detail` (`id`, `auth_id`, `privilege_name`, `privilege_type`, `privilege_value`, `privilege_extend`, `remark`, `create_user`, `create_time`, `update_time`) VALUES ('de65f6d9-0af8-11ec-a2b0-0242ac130003', 'd400c00f-9c18-4eb6-a70f-9c8caf8dddfe', 'i18n_auth_grant', 15, 0, 'grant', '基础权限-授权', 'admin', 1630482454000, NULL);
INSERT INTO `sys_auth_detail` (`id`, `auth_id`, `privilege_name`, `privilege_type`, `privilege_value`, `privilege_extend`, `remark`, `create_user`, `create_time`, `update_time`) VALUES ('de65fa72-0af8-11ec-a2b0-0242ac130003', 'd400c00f-9c18-4eb6-a70f-9c8caf8dddfe', 'i18n_auth_use', 1, 1, 'use', '基础权限-使用', 'admin', 1630482454000, NULL);
INSERT INTO `sys_auth_detail` (`id`, `auth_id`, `privilege_name`, `privilege_type`, `privilege_value`, `privilege_extend`, `remark`, `create_user`, `create_time`, `update_time`) VALUES ('de80ddc9-0af8-11ec-a2b0-0242ac130003', 'd3d558e5-b0b1-4475-bb69-f20fa5c47f4f', 'i18n_auth_grant', 15, 0, 'grant', '基础权限-授权', 'admin', 1630482454000, NULL);
INSERT INTO `sys_auth_detail` (`id`, `auth_id`, `privilege_name`, `privilege_type`, `privilege_value`, `privilege_extend`, `remark`, `create_user`, `create_time`, `update_time`) VALUES ('de80e001-0af8-11ec-a2b0-0242ac130003', 'd3d558e5-b0b1-4475-bb69-f20fa5c47f4f', 'i18n_auth_use', 1, 1, 'use', '基础权限-使用', 'admin', 1630482454000, NULL);
INSERT INTO `sys_auth_detail` (`id`, `auth_id`, `privilege_name`, `privilege_type`, `privilege_value`, `privilege_extend`, `remark`, `create_user`, `create_time`, `update_time`) VALUES ('de9f30cd-0af8-11ec-a2b0-0242ac130003', '5e0a9ad5-81ed-4f83-91f6-a74be724bda7', 'i18n_auth_grant', 15, 0, 'grant', '基础权限-授权', 'admin', 1630482454000, NULL);
INSERT INTO `sys_auth_detail` (`id`, `auth_id`, `privilege_name`, `privilege_type`, `privilege_value`, `privilege_extend`, `remark`, `create_user`, `create_time`, `update_time`) VALUES ('de9f32d3-0af8-11ec-a2b0-0242ac130003', '5e0a9ad5-81ed-4f83-91f6-a74be724bda7', 'i18n_auth_use', 1, 1, 'use', '基础权限-使用', 'admin', 1630482454000, NULL);
INSERT INTO `sys_auth_detail` (`id`, `auth_id`, `privilege_name`, `privilege_type`, `privilege_value`, `privilege_extend`, `remark`, `create_user`, `create_time`, `update_time`) VALUES ('dec15e1b-0af8-11ec-a2b0-0242ac130003', '88c778e6-ede3-4397-af4c-375e1feac8ef', 'i18n_auth_grant', 15, 0, 'grant', '基础权限-授权', 'admin', 1630482454000, NULL);
INSERT INTO `sys_auth_detail` (`id`, `auth_id`, `privilege_name`, `privilege_type`, `privilege_value`, `privilege_extend`, `remark`, `create_user`, `create_time`, `update_time`) VALUES ('dec16031-0af8-11ec-a2b0-0242ac130003', '88c778e6-ede3-4397-af4c-375e1feac8ef', 'i18n_auth_use', 1, 1, 'use', '基础权限-使用', 'admin', 1630482454000, NULL);
INSERT INTO `sys_auth_detail` (`id`, `auth_id`, `privilege_name`, `privilege_type`, `privilege_value`, `privilege_extend`, `remark`, `create_user`, `create_time`, `update_time`) VALUES ('e2b029b9-0af8-11ec-a2b0-0242ac130003', 'a6837d68-80a6-4a26-a7c0-e84001dfc817', 'i18n_auth_grant', 15, 0, 'grant', '基础权限-授权', 'admin', 1630482461000, NULL);
INSERT INTO `sys_auth_detail` (`id`, `auth_id`, `privilege_name`, `privilege_type`, `privilege_value`, `privilege_extend`, `remark`, `create_user`, `create_time`, `update_time`) VALUES ('e2b02bcb-0af8-11ec-a2b0-0242ac130003', 'a6837d68-80a6-4a26-a7c0-e84001dfc817', 'i18n_auth_use', 1, 1, 'use', '基础权限-使用', 'admin', 1630482461000, NULL);
INSERT INTO `sys_auth_detail` (`id`, `auth_id`, `privilege_name`, `privilege_type`, `privilege_value`, `privilege_extend`, `remark`, `create_user`, `create_time`, `update_time`) VALUES ('e2c9aba7-0af8-11ec-a2b0-0242ac130003', '359771bb-95b8-40ad-a6c5-b5c39c93cb10', 'i18n_auth_grant', 15, 0, 'grant', '基础权限-授权', 'admin', 1630482461000, NULL);
INSERT INTO `sys_auth_detail` (`id`, `auth_id`, `privilege_name`, `privilege_type`, `privilege_value`, `privilege_extend`, `remark`, `create_user`, `create_time`, `update_time`) VALUES ('e2c9adc8-0af8-11ec-a2b0-0242ac130003', '359771bb-95b8-40ad-a6c5-b5c39c93cb10', 'i18n_auth_use', 1, 1, 'use', '基础权限-使用', 'admin', 1630482461000, NULL);
INSERT INTO `sys_auth_detail` (`id`, `auth_id`, `privilege_name`, `privilege_type`, `privilege_value`, `privilege_extend`, `remark`, `create_user`, `create_time`, `update_time`) VALUES ('e39cb3fe-0af8-11ec-a2b0-0242ac130003', '60b3644b-2493-4805-8204-90880cfac9c6', 'i18n_auth_grant', 15, 0, 'grant', '基础权限-授权', 'admin', 1630482462000, NULL);
INSERT INTO `sys_auth_detail` (`id`, `auth_id`, `privilege_name`, `privilege_type`, `privilege_value`, `privilege_extend`, `remark`, `create_user`, `create_time`, `update_time`) VALUES ('e39cb619-0af8-11ec-a2b0-0242ac130003', '60b3644b-2493-4805-8204-90880cfac9c6', 'i18n_auth_use', 1, 1, 'use', '基础权限-使用', 'admin', 1630482462000, NULL);
INSERT INTO `sys_auth_detail` (`id`, `auth_id`, `privilege_name`, `privilege_type`, `privilege_value`, `privilege_extend`, `remark`, `create_user`, `create_time`, `update_time`) VALUES ('e49bef48-0af8-11ec-a2b0-0242ac130003', '00590a7c-8e7b-45f4-8428-55532be07602', 'i18n_auth_grant', 15, 0, 'grant', '基础权限-授权', 'admin', 1630482464000, NULL);
INSERT INTO `sys_auth_detail` (`id`, `auth_id`, `privilege_name`, `privilege_type`, `privilege_value`, `privilege_extend`, `remark`, `create_user`, `create_time`, `update_time`) VALUES ('e49bf17e-0af8-11ec-a2b0-0242ac130003', '00590a7c-8e7b-45f4-8428-55532be07602', 'i18n_auth_use', 1, 1, 'use', '基础权限-使用', 'admin', 1630482464000, NULL);

View File

@ -280,4 +280,5 @@ i18n_datasource_connect_error=Data source connection exception:
i18n_check_sql_error=Check incremental SQL exception,
i18n_change_task_status_error=Suspension is not allowed. The task status is
i18n_Stopped=END
i18n_Exec=Running
i18n_Exec=Running
i18n_no_trigger=The current setting does not trigger task generation.

View File

@ -280,4 +280,5 @@ i18n_check_sql_error=校验增量 SQL 异常,
i18n_change_task_status_error=不允许暂停,任务状态为:
i18n_Stopped=执行结束
i18n_Exec=运行中
i18n_no_trigger=当前设置没有触发任务生成

View File

@ -282,4 +282,5 @@ i18n_datasource_connect_error=數據源連接異常:
i18n_check_sql_error=校驗增量SQL異常,
i18n_change_task_status_error=不允許暫停,任務狀態為:
i18n_Stopped=執行結束
i18n_Exec=運行中
i18n_Exec=運行中
i18n_no_trigger=当前设置没有触发任务生成 當前設置沒有觸發任務生成.

View File

@ -42,7 +42,7 @@
"vue-axios": "3.2.4",
"vue-clipboard2": "0.3.1",
"vue-codemirror": "^4.0.6",
"vue-fullscreen": "^2.5.1",
"vue-fullscreen": "^2.5.2",
"vue-i18n": "7.3.2",
"vue-router": "3.0.6",
"vue-uuid": "2.0.2",

View File

@ -20,7 +20,7 @@
@mouseenter="enter"
@mouseleave="leave"
>
<edit-bar style="transform: translateZ(10px)" v-if="active||linkageSettingStatus" :active-model="'edit'" :element="element" @showViewDetails="showViewDetails" />
<edit-bar v-if="active||linkageSettingStatus" style="transform: translateZ(10px)" :active-model="'edit'" :element="element" @showViewDetails="showViewDetails" />
<div
v-for="(handlei, indexi) in actualHandles"
:key="indexi"
@ -629,7 +629,7 @@ export default {
elementMouseDown(e) {
// private
this.$store.commit('setClickComponentStatus', true)
if (this.element.component !== 'v-text' && this.element.component !== 'rect-shape' && this.element.component !== 'de-input-search' && this.element.component !== 'de-select-grid' && this.element.component !== 'de-number-range') {
if (this.element.component !== 'v-text' && this.element.component !== 'rect-shape' && this.element.component !== 'de-input-search' && this.element.component !== 'de-select-grid' && this.element.component !== 'de-number-range' && this.element.component !== 'de-date') {
e.preventDefault()
}
//
@ -1176,7 +1176,7 @@ export default {
if (this.canvasStyleData.auxiliaryMatrix) {
this.recordMatrixCurStyle()
}
this.hasMove && this.$store.commit('recordSnapshot')
this.hasMove && this.$store.commit('recordSnapshot', 'handleUp')
// snapshot false
this.hasMove = false

View File

@ -104,7 +104,7 @@ export default {
elementMouseDown(e) {
// private
this.$store.commit('setClickComponentStatus', true)
if (this.config.component !== 'v-text' && this.config.component !== 'rect-shape' && this.config.component !== 'de-input-search' && this.config.component !== 'de-select-grid' && this.config.component !== 'de-number-range') {
if (this.config.component !== 'v-text' && this.config.component !== 'rect-shape' && this.config.component !== 'de-input-search' && this.config.component !== 'de-select-grid' && this.config.component !== 'de-number-range' && this.config.component !== 'de-date') {
e.preventDefault()
}
//

View File

@ -87,13 +87,13 @@ export default {
paste() {
this.$store.commit('paste', true)
this.$store.commit('recordSnapshot')
this.$store.commit('recordSnapshot', 'paste')
},
deleteComponent() {
this.deleteCurCondition()
this.$store.commit('deleteComponent')
this.$store.commit('recordSnapshot')
this.$store.commit('recordSnapshot', 'deleteComponent')
this.$store.commit('setCurComponent', { component: null, index: null })
},
@ -106,22 +106,22 @@ export default {
upComponent() {
this.$store.commit('upComponent')
this.$store.commit('recordSnapshot')
this.$store.commit('recordSnapshot', 'upComponent')
},
downComponent() {
this.$store.commit('downComponent')
this.$store.commit('recordSnapshot')
this.$store.commit('recordSnapshot', 'downComponent')
},
topComponent() {
this.$store.commit('topComponent')
this.$store.commit('recordSnapshot')
this.$store.commit('recordSnapshot', 'topComponent')
},
bottomComponent() {
this.$store.commit('bottomComponent')
this.$store.commit('recordSnapshot')
this.$store.commit('recordSnapshot', 'bottomComponent')
}
}
}

View File

@ -86,13 +86,13 @@ export default {
paste() {
this.$store.commit('paste', true)
this.$store.commit('recordSnapshot')
this.$store.commit('recordSnapshot','paste')
},
deleteComponent() {
this.deleteCurCondition()
this.$store.commit('deleteComponent')
this.$store.commit('recordSnapshot')
this.$store.commit('recordSnapshot','deleteComponent')
this.$store.commit('setCurComponent', { component: null, index: null })
},
@ -105,22 +105,22 @@ export default {
upComponent() {
this.$store.commit('upComponent')
this.$store.commit('recordSnapshot')
this.$store.commit('recordSnapshot','upComponent')
},
downComponent() {
this.$store.commit('downComponent')
this.$store.commit('recordSnapshot')
this.$store.commit('recordSnapshot','downComponent')
},
topComponent() {
this.$store.commit('topComponent')
this.$store.commit('recordSnapshot')
this.$store.commit('recordSnapshot','topComponent')
},
bottomComponent() {
this.$store.commit('bottomComponent')
this.$store.commit('recordSnapshot')
this.$store.commit('recordSnapshot','bottomComponent')
},
linkageSetting() {
debugger

View File

@ -226,7 +226,7 @@ export default {
handleMouseDownOnShape(e) {
this.$store.commit('setClickComponentStatus', true)
if (this.element.component !== 'v-text' && this.element.component !== 'rect-shape' && this.element.component !== 'de-input-search' && this.element.component !== 'de-select-grid' && this.element.component !== 'de-number-range') {
if (this.element.component !== 'v-text' && this.element.component !== 'rect-shape' && this.element.component !== 'de-input-search' && this.element.component !== 'de-select-grid' && this.element.component !== 'de-number-range' && this.element.component !== 'de-date') {
e.preventDefault()
}

View File

@ -292,17 +292,17 @@ export default {
},
deep: true
},
canvasStyleData: {
handler(newVal, oldVla) {
//
if (this.changeIndex++ > 0) {
this.resizeParentBounds()
this.$store.state.styleChangeTimes++
}
// this.changeScale()
},
deep: true
},
// canvasStyleData: {
// handler(newVal, oldVla) {
// //
// if (this.changeIndex++ > 0) {
// // this.resizeParentBounds()
// this.$store.state.styleChangeTimes++
// }
// // this.changeScale()
// },
// deep: true
// },
componentData: {
handler(newVal, oldVla) {
// console.log('11111')

View File

@ -154,8 +154,7 @@ export default {
}
},
styleChange() {
debugger
this.$store.state.styleChangeTimes++
this.$store.commit('recordStyleChange')
}
}
}

View File

@ -206,7 +206,7 @@ export default {
}
},
styleChange() {
this.$store.state.styleChangeTimes++
this.$store.commit('recordStyleChange')
}
}
}

View File

@ -189,7 +189,7 @@ export default {
}
},
styleChange() {
this.$store.state.styleChangeTimes++
this.$store.commit('recordStyleChange')
}
}
}

View File

@ -214,12 +214,12 @@ export default {
compose() {
this.$store.commit('compose')
this.$store.commit('recordSnapshot')
this.$store.commit('recordSnapshot','compose')
},
decompose() {
this.$store.commit('decompose')
this.$store.commit('recordSnapshot')
this.$store.commit('recordSnapshot','decompose')
},
undo() {
@ -267,7 +267,7 @@ export default {
}
})
this.$store.commit('recordSnapshot')
this.$store.commit('recordSnapshot','handleFileChange')
}
img.src = fileResult
@ -306,7 +306,7 @@ export default {
clearCanvas() {
this.$store.commit('setComponentData', [])
this.$store.commit('setCanvasStyle', DEFAULT_COMMON_CANVAS_STYLE_STRING)
this.$store.commit('recordSnapshot')
this.$store.commit('recordSnapshot','clearCanvas')
},
handlePreviewChange() {

View File

@ -67,6 +67,7 @@ export default {
methods: {
handleInput(e) {
this.$emit('input', this.element, e.target.innerHTML)
this.$store.commit('recordStyleChange')
},
handleKeydown(e) {

View File

@ -96,7 +96,7 @@ export default {
component.style.left = e.offsetX
component.id = generateID()
this.$store.commit('addComponent', { component })
this.$store.commit('recordSnapshot')
this.$store.commit('recordSnapshot','handleDrop')
},
handleDragOver(e) {

View File

@ -52,6 +52,11 @@ export default {
refreshSaveStatus(state) {
state.changeTimes = 0
state.lastSaveSnapshotIndex = deepCopy(state.snapshotIndex)
},
recordStyleChange(state) {
if (state.curComponent) {
state.styleChangeTimes++
}
}
}
}

View File

@ -86,7 +86,7 @@ export default {
}
},
styleChange() {
this.$store.state.styleChangeTimes++
this.$store.commit('recordStyleChange')
}
}
}

View File

@ -142,7 +142,7 @@ export default {
}
this.setCondition()
this.styleChange()
this.$store.commit('recordStyleChange')
})
},
setCondition() {
@ -177,7 +177,7 @@ export default {
}
},
styleChange() {
this.$store.state.styleChangeTimes++
this.$store.commit('recordStyleChange')
}
}
}

View File

@ -104,7 +104,7 @@ export default {
this.inDraw && this.$store.commit('addViewFilter', param)
},
styleChange() {
this.$store.state.styleChangeTimes++
this.$store.commit('recordStyleChange')
}
}

View File

@ -211,7 +211,7 @@ export default {
// return data[this.defaultProp.label].indexOf(value) !== -1
// },
styleChange() {
this.$store.state.styleChangeTimes++
this.$store.commit('recordStyleChange')
}
}

View File

@ -0,0 +1 @@
<svg t="1630391478183" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="839" width="200" height="200"><path d="M64 104.1c0-1.3 0.5-2.6 1.5-3.6s2.3-1.5 3.6-1.5H101c1.3 0 2.6 0.5 3.6 1.5s1.5 2.3 1.5 3.6V883H955c1.3 0 2.6 0.5 3.6 1.5s1.5 2.3 1.5 3.6V920c0 1.3-0.5 2.6-1.5 3.6s-2.3 1.5-3.6 1.5H64v-821z" p-id="840"></path><path d="M792 454.2c0-3.9 1.5-7.7 4.4-10.7s6.8-4.4 10.7-4.4h137.7c3.9 0 7.7 1.5 10.7 4.4 3 3 4.4 6.8 4.4 10.7V827H792V454.2zM601.5 577.6L374.8 378.1 223.9 567.5 162 518.3l203.3-254.5 227.9 201.4L900.1 99l60 50.5-358.6 428.1zM162 648.1c0-3.9 1.5-7.7 4.4-10.7s6.8-4.4 10.7-4.4h137.7c3.9 0 7.7 1.5 10.7 4.4 3 3 4.4 6.8 4.4 10.7V827H162V648.1z" p-id="841"></path><path d="M372 586.8c0-3.9 1.5-7.7 4.4-10.7s6.8-4.4 10.7-4.4h137.7c3.9 0 7.7 1.5 10.7 4.4 3 3 4.4 6.8 4.4 10.7V827H372V586.8zM582 714.4c0-3.9 1.5-7.7 4.4-10.7s6.8-4.4 10.7-4.4h137.7c3.9 0 7.7 1.5 10.7 4.4 3 3 4.4 6.8 4.4 10.7V827H582V714.4z" p-id="842"></path></svg>

After

Width:  |  Height:  |  Size: 986 B

View File

@ -542,7 +542,7 @@ export default {
create: 'Create',
modify: 'Modify',
delete: 'Delete',
delete_confirm: 'Deleting the organization will be associated with deleting the subordinate organization, Are you sure you want to delete it?',
delete_confirm: 'Are you sure you want to delete the organization?',
input_name: 'Please enter name',
select_organization: 'Please select organization',
search_by_name: 'Search by name',
@ -848,7 +848,8 @@ export default {
system_case: 'System',
custom_case: 'Custom',
last_layer: 'This Is The Last Layer',
radar_size: 'Size'
radar_size: 'Size',
chart_mix: 'Mix'
},
dataset: {
sheet_warn: 'There are multiple sheet pages, and the first one is extracted by default',

View File

@ -542,7 +542,7 @@ export default {
create: '新建組織',
modify: '修改組織',
delete: '刪除組織',
delete_confirm: '刪除該組織會關聯刪除該組織的下屬組織,確定要刪除嗎?',
delete_confirm: '確定要刪除該組織嗎?',
input_name: '請輸入組織名稱',
select_organization: '請選擇組織',
search_by_name: '根據名稱搜索',
@ -847,7 +847,8 @@ export default {
system_case: '系統方案',
custom_case: '自定義',
last_layer: '當前已經是最後一級',
radar_size: '大小'
radar_size: '大小',
chart_mix: '組合圖'
},
dataset: {
sheet_warn: '有多個sheet頁面默認抽取第一個',

View File

@ -542,7 +542,7 @@ export default {
create: '新建组织',
modify: '修改组织',
delete: '删除组织',
delete_confirm: '删除该组织会关联删除该组织的下属组织,确定要删除吗?',
delete_confirm: '确定要删除该组织吗?',
input_name: '请输入组织名称',
select_organization: '请选择组织',
search_by_name: '根据名称搜索',
@ -847,7 +847,8 @@ export default {
system_case: '系统方案',
custom_case: '自定义',
last_layer: '当前已经是最后一级',
radar_size: '大小'
radar_size: '大小',
chart_mix: '组合图'
},
dataset: {
sheet_warn: '有多个 Sheet 页,默认抽取第一个',

View File

@ -736,3 +736,60 @@ export const BASE_TREEMAP = {
}
]
}
export const BASE_MIX = {
title: {
text: '',
textStyle: {
fontWeight: 'normal'
}
},
grid: {
containLabel: true
},
tooltip: {},
legend: {
show: true,
type: 'scroll',
itemWidth: 10,
itemHeight: 10,
icon: 'rect',
data: []
},
xAxis: {
data: []
},
yAxis: {
type: 'value'
},
series: [],
dataZoom: [
{
type: 'slider',
show: false,
xAxisIndex: [0],
start: 0,
end: 100
},
{
type: 'slider',
show: false,
yAxisIndex: [0],
left: '93%',
start: 0,
end: 100
},
{
type: 'inside',
xAxisIndex: [0],
start: 0,
end: 100
},
{
type: 'inside',
yAxisIndex: [0],
start: 0,
end: 100
}
]
}

View File

@ -51,7 +51,7 @@ export function componentStyle(chart_option, chart) {
chart_option.legend.icon = customStyle.legend.icon
chart_option.legend.textStyle = customStyle.legend.textStyle
}
if (customStyle.xAxis && (chart.type.includes('bar') || chart.type.includes('line') || chart.type.includes('scatter'))) {
if (customStyle.xAxis && (chart.type.includes('bar') || chart.type.includes('line') || chart.type.includes('scatter') || chart.type === 'chart-mix')) {
chart_option.xAxis.show = customStyle.xAxis.show
chart_option.xAxis.position = customStyle.xAxis.position
chart_option.xAxis.name = customStyle.xAxis.name
@ -61,8 +61,12 @@ export function componentStyle(chart_option, chart) {
chart_option.xAxis.axisLabel.showMaxLabel = true
chart_option.xAxis.axisLabel.showMinLabel = true
if (!customStyle.xAxis.show) {
chart_option.xAxis.axisLabel.show = false
}
}
if (customStyle.yAxis && (chart.type.includes('bar') || chart.type.includes('line') || chart.type.includes('scatter'))) {
if (customStyle.yAxis && (chart.type.includes('bar') || chart.type.includes('line') || chart.type.includes('scatter') || chart.type === 'chart-mix')) {
chart_option.yAxis.show = customStyle.yAxis.show
chart_option.yAxis.position = customStyle.yAxis.position
chart_option.yAxis.name = customStyle.yAxis.name
@ -70,8 +74,12 @@ export function componentStyle(chart_option, chart) {
chart_option.yAxis.splitLine = customStyle.yAxis.splitLine
chart_option.yAxis.nameTextStyle = customStyle.yAxis.nameTextStyle
chart_option.xAxis.axisLabel.showMaxLabel = true
chart_option.xAxis.axisLabel.showMinLabel = true
chart_option.yAxis.axisLabel.showMaxLabel = true
chart_option.yAxis.axisLabel.showMinLabel = true
if (!customStyle.yAxis.show) {
chart_option.yAxis.axisLabel.show = false
}
}
if (customStyle.split && chart.type.includes('radar')) {
chart_option.radar.name = customStyle.split.name

View File

@ -36,8 +36,12 @@ export function baseLineOption(chart_option, chart) {
type: customAttr.size.lineType
}
y.smooth = customAttr.size.lineSmooth
y.areaStyle = {
opacity: customAttr.size.lineArea ? 0.6 : 0
if (customAttr.size.lineArea) {
y.areaStyle = {
opacity: 0.6
}
} else {
delete y.areaStyle
}
}
// label

View File

@ -47,6 +47,9 @@ export function baseMapOption(chart_option, chart) {
chart_option.visualMap.min = 0
chart_option.visualMap.max = 0
}
if (chart_option.visualMap.min === 0 && chart_option.visualMap.max === 0) {
chart_option.visualMap.max = 100
}
// color
if (customAttr.color && customAttr.color.colors) {
chart_option.visualMap.inRange.color = customAttr.color.colors

View File

@ -0,0 +1,77 @@
import { hexColorToRGBA } from '@/views/chart/chart/util'
import { componentStyle } from '../common/common'
export function baseMixOption(chart_option, chart) {
// 处理shape attr
let customAttr = {}
if (chart.customAttr) {
customAttr = JSON.parse(chart.customAttr)
if (customAttr.color) {
chart_option.color = customAttr.color.colors
}
// tooltip
if (customAttr.tooltip) {
const tooltip = JSON.parse(JSON.stringify(customAttr.tooltip))
const reg = new RegExp('\n', 'g')
tooltip.formatter = tooltip.formatter.replace(reg, '<br/>')
chart_option.tooltip = tooltip
}
}
// 处理data
if (chart.data) {
chart_option.title.text = chart.title
chart_option.xAxis.data = chart.data.x
for (let i = 0; i < chart.data.series.length; i++) {
const y = chart.data.series[i]
y.type = y.type ? y.type : 'bar'
// color
y.itemStyle = {
color: hexColorToRGBA(customAttr.color.colors[i % 9], customAttr.color.alpha)
}
// size
if (customAttr.size) {
// bar
if (y.type === 'bar') {
if (customAttr.size.barDefault) {
y.barWidth = null
y.barGap = null
} else {
y.barWidth = customAttr.size.barWidth
y.barGap = customAttr.size.barGap
}
}
// line
if (y.type === 'line') {
y.symbol = customAttr.size.lineSymbol
y.symbolSize = customAttr.size.lineSymbolSize
y.lineStyle = {
width: customAttr.size.lineWidth,
type: customAttr.size.lineType
}
y.smooth = customAttr.size.lineSmooth
if (customAttr.size.lineArea) {
y.areaStyle = {
opacity: 0.6
}
} else {
delete y.areaStyle
}
}
// scatter
if (y.type === 'scatter') {
y.symbol = customAttr.size.scatterSymbol ? customAttr.size.scatterSymbol : 'circle'
y.symbolSize = customAttr.size.scatterSymbolSize ? customAttr.size.scatterSymbolSize : 20
}
}
// label
if (customAttr.label) {
y.label = customAttr.label
}
chart_option.legend.data.push(y.name)
chart_option.series.push(y)
}
}
// console.log(chart_option);
componentStyle(chart_option, chart)
return chart_option
}

View File

@ -28,6 +28,9 @@ export function baseRadarOption(chart_option, chart) {
const maxValues = []
for (let i = 0; i < chart.data.series.length; i++) {
const y = chart.data.series[i]
if (y.data.length === 0) {
continue
}
// color
y.itemStyle = {
color: hexColorToRGBA(customAttr.color.colors[i % 9], customAttr.color.alpha)

View File

@ -6,7 +6,19 @@
</template>
<script>
import { BASE_BAR, BASE_LINE, HORIZONTAL_BAR, BASE_PIE, BASE_FUNNEL, BASE_RADAR, BASE_GAUGE, BASE_MAP, BASE_SCATTER, BASE_TREEMAP } from '../chart/chart'
import {
BASE_BAR,
BASE_LINE,
HORIZONTAL_BAR,
BASE_PIE,
BASE_FUNNEL,
BASE_RADAR,
BASE_GAUGE,
BASE_MAP,
BASE_SCATTER,
BASE_TREEMAP,
BASE_MIX
} from '../chart/chart'
import { baseBarOption, stackBarOption, horizontalBarOption, horizontalStackBarOption } from '../chart/bar/bar'
import { baseLineOption, stackLineOption } from '../chart/line/line'
import { basePieOption, rosePieOption } from '../chart/pie/pie'
@ -16,6 +28,7 @@ import { baseRadarOption } from '../chart/radar/radar'
import { baseGaugeOption } from '../chart/gauge/gauge'
import { baseScatterOption } from '../chart/scatter/scatter'
import { baseTreemapOption } from '../chart/treemap/treemap'
import { baseMixOption } from '@/views/chart/chart/mix/mix'
// import eventBus from '@/components/canvas/utils/eventBus'
import { uuid } from 'vue-uuid'
import { geoJson } from '@/api/map/map'
@ -139,7 +152,10 @@ export default {
chart_option = baseScatterOption(JSON.parse(JSON.stringify(BASE_SCATTER)), chart)
} else if (chart.type === 'treemap') {
chart_option = baseTreemapOption(JSON.parse(JSON.stringify(BASE_TREEMAP)), chart)
} else if (chart.type === 'chart-mix') {
chart_option = baseMixOption(JSON.parse(JSON.stringify(BASE_MIX)), chart)
}
console.log(JSON.stringify(chart_option))
if (chart.type === 'map') {
const customAttr = JSON.parse(chart.customAttr)
@ -214,11 +230,21 @@ export default {
//
const chart = this.myChart
chart.resize()
this.reDrawMap()
},
reDrawMap() {
const chart = this.chart
if (chart.type === 'map') {
this.preDraw()
}
},
trackClick(trackAction) {
const param = this.pointParam
if (!param || !param.data || !param.data.dimensionList) {
this.$warning(this.$t('panel.no_drill_field'))
//
if (this.chart.type === 'map') {
this.$warning(this.$t('panel.no_drill_field'))
}
return
}
const linkageParam = {

View File

@ -6,6 +6,9 @@
<svg-icon v-if="item.deType === 1" icon-class="field_time" class="field-icon-time" />
<svg-icon v-if="item.deType === 2 || item.deType === 3" icon-class="field_value" class="field-icon-value" />
<svg-icon v-if="item.deType === 5" icon-class="field_location" class="field-icon-location" />
<svg-icon v-if="chart.type ==='chart-mix' && item.chartType === 'bar'" icon-class="bar" class-name="field-icon-sort" />
<svg-icon v-if="chart.type ==='chart-mix' && item.chartType === 'line'" icon-class="line" class-name="field-icon-sort" />
<svg-icon v-if="chart.type ==='chart-mix' && item.chartType === 'scatter'" icon-class="scatter" class-name="field-icon-sort" />
<svg-icon v-if="item.sort === 'asc'" icon-class="sort-asc" class-name="field-icon-sort" />
<svg-icon v-if="item.sort === 'desc'" icon-class="sort-desc" class-name="field-icon-sort" />
</span>
@ -20,6 +23,9 @@
<svg-icon v-if="item.deType === 1" icon-class="field_time" class="field-icon-time" />
<svg-icon v-if="item.deType === 2 || item.deType === 3" icon-class="field_value" class="field-icon-value" />
<svg-icon v-if="item.deType === 5" icon-class="field_location" class="field-icon-location" />
<svg-icon v-if="chart.type ==='chart-mix' && item.chartType === 'bar'" icon-class="bar" class-name="field-icon-sort" />
<svg-icon v-if="chart.type ==='chart-mix' && item.chartType === 'line'" icon-class="line" class-name="field-icon-sort" />
<svg-icon v-if="chart.type ==='chart-mix' && item.chartType === 'scatter'" icon-class="scatter" class-name="field-icon-sort" />
<svg-icon v-if="item.sort === 'asc'" icon-class="sort-asc" class-name="field-icon-sort" />
<svg-icon v-if="item.sort === 'desc'" icon-class="sort-desc" class-name="field-icon-sort" />
</span>
@ -28,7 +34,23 @@
<i class="el-icon-arrow-down el-icon--right" style="position: absolute;top: 6px;right: 10px;" />
</el-tag>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item>
<el-dropdown-item v-show="chart.type ==='chart-mix'">
<el-dropdown placement="right-start" size="mini" style="width: 100%" @command="switchChartType">
<span class="el-dropdown-link inner-dropdown-menu">
<span>
<i class="el-icon-s-data" />
<span>{{ $t('chart.chart_type') }}</span>
</span>
<i class="el-icon-arrow-right el-icon--right" />
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item :command="beforeSwitch('bar')">{{ $t('chart.chart_bar') }}</el-dropdown-item>
<el-dropdown-item :command="beforeSwitch('line')">{{ $t('chart.chart_line') }}</el-dropdown-item>
<el-dropdown-item :command="beforeSwitch('scatter')">{{ $t('chart.chart_scatter') }}</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</el-dropdown-item>
<el-dropdown-item divided>
<el-dropdown placement="right-start" size="mini" style="width: 100%" @command="summary">
<span class="el-dropdown-link inner-dropdown-menu">
<span>
@ -112,6 +134,10 @@ export default {
index: {
type: Number,
required: true
},
chart: {
type: Object,
required: true
}
},
data() {
@ -157,6 +183,17 @@ export default {
}
},
switchChartType(param) {
// console.log(param)
this.item.chartType = param.type
this.$emit('onQuotaItemChange', this.item)
},
beforeSwitch(type) {
return {
type: type
}
},
quickCalc(param) {
},

View File

@ -151,7 +151,7 @@
</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="20" @change="changeBarSizeCase" />
<el-slider v-model="sizeForm.scatterSymbolSize" show-input :show-input-controls="false" input-size="mini" :min="1" :max="40" @change="changeBarSizeCase" />
</el-form-item>
</el-form>
@ -163,6 +163,61 @@
<el-slider v-model="sizeForm.treemapHeight" show-input :show-input-controls="false" input-size="mini" :min="0" :max="100" @change="changeBarSizeCase" />
</el-form-item>
</el-form>
<el-form v-show="chart.type && chart.type === 'chart-mix'" ref="sizeFormBar" :disabled="param && !hasDataPermission('manage',param.privileges)" :model="sizeForm" label-width="80px" size="mini">
<el-form-item :label="$t('chart.adapt')" class="form-item">
<el-checkbox v-model="sizeForm.barDefault" @change="changeBarSizeCase">{{ $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" />
</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" />
</el-form-item>
<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" />
</el-form-item>
<el-form-item :label="$t('chart.line_type')" class="form-item">
<el-radio-group v-model="sizeForm.lineType" @change="changeBarSizeCase">
<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">
<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_symbol_size')" class="form-item form-item-slider">
<el-slider v-model="sizeForm.lineSymbolSize" show-input :show-input-controls="false" input-size="mini" :min="0" :max="20" @change="changeBarSizeCase" />
</el-form-item>
<el-form-item :label="$t('chart.line_smooth')" class="form-item">
<el-checkbox v-model="sizeForm.lineSmooth" @change="changeBarSizeCase">{{ $t('chart.line_smooth') }}</el-checkbox>
</el-form-item>
<el-form-item :label="$t('chart.line_area')" class="form-item">
<el-checkbox v-model="sizeForm.lineArea" @change="changeBarSizeCase">{{ $t('chart.show') }}</el-checkbox>
</el-form-item>
<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">
<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" />
</el-form-item>
</el-form>
</el-col>
</div>
</template>
@ -268,4 +323,7 @@ export default {
.el-form-item{
margin-bottom: 6px;
}
.el-divider--horizontal {
margin: 10px 0
}
</style>

View File

@ -113,7 +113,6 @@
<span>{{ $t('chart.chart_type') }}</span>
<el-row>
<div class="chart-type">
<!--这里要替换好看点的图标UI标签可以重新定义-->
<el-radio-group
v-model="view.type"
style="width: 100%"
@ -168,13 +167,18 @@
<svg-icon icon-class="scatter" class="chart-icon" />
</span>
</el-radio>
<el-radio value="chart-mix" label="chart-mix">
<span :title="$t('chart.chart_mix')">
<svg-icon icon-class="chart-mix" class="chart-icon" />
</span>
</el-radio>
</div>
<div style="width: 100%;display: flex;display: -webkit-flex;justify-content: space-between;flex-direction: row;flex-wrap: wrap;">
<el-radio value="map" label="map">
<span :title="$t('chart.chart_map')">
<svg-icon icon-class="map" class="chart-icon" />
</span>
</el-radio>
</div>
<div style="width: 100%;display: flex;display: -webkit-flex;justify-content: space-between;flex-direction: row;flex-wrap: wrap;">
<el-radio value="radar" label="radar">
<span :title="$t('chart.chart_radar')">
<svg-icon icon-class="radar" class="chart-icon" />
@ -195,13 +199,13 @@
<svg-icon icon-class="pie-rose" class="chart-icon" />
</span>
</el-radio>
</div>
<div style="width: 100%;display: flex;display: -webkit-flex;justify-content: space-between;flex-direction: row;flex-wrap: wrap;">
<el-radio value="funnel" label="funnel">
<span :title="$t('chart.chart_funnel')">
<svg-icon icon-class="funnel" class="chart-icon" />
</span>
</el-radio>
</div>
<div style="width: 100%;display: flex;display: -webkit-flex;justify-content: space-between;flex-direction: row;flex-wrap: wrap;">
<el-radio value="treemap" label="treemap">
<span :title="$t('chart.chart_treemap')">
<svg-icon icon-class="treemap" class="chart-icon" />
@ -210,7 +214,6 @@
<el-radio value="" label="" disabled class="disabled-none-cursor"><svg-icon icon-class="" class="chart-icon" /></el-radio>
<el-radio value="" label="" disabled class="disabled-none-cursor"><svg-icon icon-class="" class="chart-icon" /></el-radio>
<el-radio value="" label="" disabled class="disabled-none-cursor"><svg-icon icon-class="" class="chart-icon" /></el-radio>
<el-radio value="" label="" disabled class="disabled-none-cursor"><svg-icon icon-class="" class="chart-icon" /></el-radio>
</div>
</el-radio-group>
</div>
@ -250,7 +253,7 @@
<el-row v-if="view.type !=='text' && view.type !== 'gauge'" class="padding-lr">
<span style="width: 80px;text-align: right;">
<span v-if="view.type && view.type.includes('table')">{{ $t('chart.drag_block_table_data_column') }}</span>
<span v-else-if="view.type && (view.type.includes('bar') || view.type.includes('line') || view.type.includes('scatter'))">{{ $t('chart.drag_block_type_axis') }}</span>
<span v-else-if="view.type && (view.type.includes('bar') || view.type.includes('line') || view.type.includes('scatter') || view.type === 'chart-mix')">{{ $t('chart.drag_block_type_axis') }}</span>
<span v-else-if="view.type && view.type.includes('pie')">{{ $t('chart.drag_block_pie_label') }}</span>
<span v-else-if="view.type && view.type.includes('funnel')">{{ $t('chart.drag_block_funnel_split') }}</span>
<span v-else-if="view.type && view.type.includes('radar')">{{ $t('chart.drag_block_radar_label') }}</span>
@ -280,7 +283,7 @@
<el-row class="padding-lr" style="margin-top: 6px;">
<span style="width: 80px;text-align: right;">
<span v-if="view.type && view.type.includes('table')">{{ $t('chart.drag_block_table_data_column') }}</span>
<span v-else-if="view.type && (view.type.includes('bar') || view.type.includes('line') || view.type.includes('scatter'))">{{ $t('chart.drag_block_value_axis') }}</span>
<span v-else-if="view.type && (view.type.includes('bar') || view.type.includes('line') || view.type.includes('scatter') || view.type === 'chart-mix')">{{ $t('chart.drag_block_value_axis') }}</span>
<span v-else-if="view.type && view.type.includes('pie')">{{ $t('chart.drag_block_pie_angel') }}</span>
<span v-else-if="view.type && view.type.includes('funnel')">{{ $t('chart.drag_block_funnel_width') }}</span>
<span v-else-if="view.type && view.type.includes('radar')">{{ $t('chart.drag_block_radar_length') }}</span>
@ -302,7 +305,7 @@
@update="save(true)"
>
<transition-group class="draggable-group">
<quota-item v-for="(item,index) in view.yaxis" :key="item.id" :param="param" :index="index" :item="item" @onQuotaItemChange="quotaItemChange" @onQuotaItemRemove="quotaItemRemove" @editItemFilter="showQuotaEditFilter" @onNameEdit="showRename" />
<quota-item v-for="(item,index) in view.yaxis" :key="item.id" :param="param" :index="index" :item="item" :chart="chart" @onQuotaItemChange="quotaItemChange" @onQuotaItemRemove="quotaItemRemove" @editItemFilter="showQuotaEditFilter" @onNameEdit="showRename" />
</transition-group>
</draggable>
<div v-if="!view.yaxis || view.yaxis.length === 0" class="drag-placeholder-style">
@ -453,10 +456,10 @@
<el-row>
<span class="padding-lr">{{ $t('chart.module_style') }}</span>
<el-collapse v-model="styleActiveNames" class="style-collapse">
<el-collapse-item v-show="view.type && (view.type.includes('bar') || view.type.includes('line') || view.type.includes('scatter'))" name="xAxis" :title="$t('chart.xAxis')">
<el-collapse-item v-show="view.type && (view.type.includes('bar') || view.type.includes('line') || view.type.includes('scatter') || view.type === 'chart-mix')" name="xAxis" :title="$t('chart.xAxis')">
<x-axis-selector :param="param" class="attr-selector" :chart="chart" @onChangeXAxisForm="onChangeXAxisForm" />
</el-collapse-item>
<el-collapse-item v-show="view.type && (view.type.includes('bar') || view.type.includes('line') || view.type.includes('scatter'))" name="yAxis" :title="$t('chart.yAxis')">
<el-collapse-item v-show="view.type && (view.type.includes('bar') || view.type.includes('line') || view.type.includes('scatter') || view.type === 'chart-mix')" name="yAxis" :title="$t('chart.yAxis')">
<y-axis-selector :param="param" class="attr-selector" :chart="chart" @onChangeYAxisForm="onChangeYAxisForm" />
</el-collapse-item>
<el-collapse-item v-show="view.type && view.type.includes('radar')" name="split" :title="$t('chart.split')">
@ -860,6 +863,9 @@ export default {
view.yaxis = [view.yaxis[0]]
}
view.yaxis.forEach(function(ele) {
if (!ele.chartType) {
ele.chartType = 'bar'
}
if (!ele.summary || ele.summary === '') {
if (ele.id === 'count' || ele.deType === 0 || ele.deType === 1) {
ele.summary = 'count'
@ -1644,7 +1650,7 @@ export default {
}
.chart-type>>>.el-radio__input{
display: none;
display: none!important;
}
.el-radio{

View File

@ -513,8 +513,8 @@ export default {
}
this.update_task = true
},
listTask() {
post('/dataset/task/list', { tableId: this.table.id }).then(response => {
listTask(loading = true) {
post('/dataset/task/list', { tableId: this.table.id }, loading).then(response => {
this.taskData = response.data
})
},

View File

@ -115,7 +115,7 @@ export default {
}
})
this.$store.commit('recordSnapshot')
this.$store.commit('recordSnapshot','handleFileChange')
}
img.src = fileResult

View File

@ -80,7 +80,7 @@ export default {
const canvasStyleData = deepCopy(this.canvasStyleData)
canvasStyleData.panel = this.panel
this.$store.commit('setCanvasStyle', canvasStyleData)
this.$store.commit('recordSnapshot')
this.$store.commit('recordSnapshot','commitStyle')
},
onChangeType() {
this.commitStyle()

View File

@ -44,7 +44,7 @@ export default {
const canvasStyleData = deepCopy(this.canvasStyleData)
canvasStyleData.panel = this.panel
this.$store.commit('setCanvasStyle', canvasStyleData)
this.$store.commit('recordSnapshot')
this.$store.commit('recordSnapshot','onChangePanelStyle')
}
}
}

View File

@ -189,7 +189,7 @@ export default {
},
subjectChange() {
this.$store.commit('setCanvasStyle', JSON.parse(this.subjectItem.details))
this.$store.commit('recordSnapshot')
this.$store.commit('recordSnapshot','subjectChange')
bus.$emit('onSubjectChange')
},
templateEdit() {

View File

@ -135,7 +135,7 @@ export default {
chart.customFilter = JSON.stringify(this.chart.customFilter)
canvasStyleData.chart = chart
this.$store.commit('setCanvasStyle', canvasStyleData)
this.$store.commit('recordSnapshot')
this.$store.commit('recordSnapshot','save')
}
}
}

View File

@ -311,6 +311,7 @@ export default {
this.init(newVal.id)
},
'$store.state.styleChangeTimes'() {
// console.log('styleChangeTimes' + this.$store.state.styleChangeTimes)
if (this.$store.state.styleChangeTimes > 0) {
this.destroyTimeMachine()
this.recordStyleChange(this.$store.state.styleChangeTimes)
@ -383,7 +384,7 @@ export default {
// this.$store.commit('setComponentData', this.resetID(JSON.parse(response.data.panelData)))
const panelStyle = JSON.parse(response.data.panelStyle)
this.$store.commit('setCanvasStyle', panelStyle)
this.$store.commit('recordSnapshot')//
this.$store.commit('recordSnapshot', 'init')//
//
getPanelAllLinkageInfo(panelId).then(rsp => {
this.$store.commit('setNowPanelTrackInfo', rsp.data)
@ -493,7 +494,7 @@ export default {
component.style.left = this.getPositionX(e.layerX)
component.id = newComponentId
this.$store.commit('addComponent', { component })
this.$store.commit('recordSnapshot')
this.$store.commit('recordSnapshot', 'handleDrop')
this.clearCurrentInfo()
// //
@ -545,7 +546,7 @@ export default {
// this.$store.commit('addComponent', { component })
this.$store.commit('setComponentWithId', component)
this.$store.commit('recordSnapshot')
this.$store.commit('recordSnapshot', 'sureFilter')
this.cancelFilter()
},
reFreshComponent(component) {
@ -625,7 +626,7 @@ export default {
}
})
this.$store.commit('recordSnapshot')
this.$store.commit('recordSnapshot', 'handleFileChange')
}
img.src = fileResult
@ -677,7 +678,7 @@ export default {
component.style.left = 600
component.id = newComponentId
this.$store.commit('addComponent', { component })
this.$store.commit('recordSnapshot')
this.$store.commit('recordSnapshot', 'newViewInfo')
this.clearCurrentInfo()
this.$store.commit('setCurComponent', { component: component, index: this.componentData.length - 1 })
@ -703,7 +704,7 @@ export default {
recordStyleChange(index) {
this.timeMachine = setTimeout(() => {
if (index === this.$store.state.styleChangeTimes) {
this.$store.commit('recordSnapshot')
this.$store.commit('recordSnapshot', 'recordStyleChange')
this.$store.state.styleChangeTimes = 0
}
this.destroyTimeMachine()

View File

@ -10,7 +10,7 @@
<el-table-column prop="name" :label="$t('commons.name')">
<template :id="scope.row.storeId" slot-scope="scope">
<div class="start-item">
<div class="filter-db-row star-item-content" @click="showPanel(scope.row)">
<div class="filter-db-row star-item-content" style="white-space:nowrap;overflow:hidden;text-overflow:ellipsis;" @click="showPanel(scope.row)">
<svg-icon icon-class="panel" class="ds-icon-scene" />
<span> {{ scope.row.name }}</span>
</div>

View File

@ -77,7 +77,7 @@ import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import { PHONE_REGEX } from '@/utils/validate'
import { LOAD_CHILDREN_OPTIONS, LOAD_ROOT_OPTIONS } from '@riophae/vue-treeselect'
import { getDeptTree, treeByDeptId } from '@/api/system/dept'
import { allRoles } from '@/api/system/role'
import { allRoles } from '@/api/system/user'
import { updatePerson, persionInfo } from '@/api/system/user'
export default {