Unverified 提交 4c422b9c authored 作者: fit2cloud-chenyw's avatar fit2cloud-chenyw 提交者: GitHub

Merge branch 'dev' into pr@dev@feat_message-center

...@@ -358,6 +358,13 @@ ...@@ -358,6 +358,13 @@
<artifactId>dataease-plugin-interface</artifactId> <artifactId>dataease-plugin-interface</artifactId>
<version>1.0</version> <version>1.0</version>
</dependency> </dependency>
<dependency>
<groupId>com.oracle.database.jdbc</groupId>
<artifactId>ojdbc8</artifactId>
<version>12.2.0.1</version>
</dependency>
</dependencies> </dependencies>
<build> <build>
......
package io.dataease.datasource.constants; package io.dataease.datasource.constants;
public enum DatasourceTypes { public enum DatasourceTypes {
mysql, sqlServer, excel, doris mysql, sqlServer, excel, doris, oracle
} }
package io.dataease.datasource.dto;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class OracleConfigration extends JdbcDTO {
private String driver = "oracle.jdbc.driver.OracleDriver";
private String connectionType;
public String getJdbc() {
// 连接参数先写死,后边要把编码、时区等参数放到数据源的设置中
if(getConnectionType().equalsIgnoreCase("serviceName")){
return "jdbc:oracle:thin:@HOSTNAME:PORT/DATABASE"
.replace("HOSTNAME", getHost())
.replace("PORT", getPort().toString())
.replace("DATABASE", getDataBase());
}else {
return "jdbc:oracle:thin:@HOSTNAME:PORT:DATABASE"
.replace("HOSTNAME", getHost())
.replace("PORT", getPort().toString())
.replace("DATABASE", getDataBase());
}
}
}
...@@ -19,7 +19,7 @@ public abstract class DatasourceProvider { ...@@ -19,7 +19,7 @@ public abstract class DatasourceProvider {
return new ArrayList<>(); return new ArrayList<>();
}; };
public void test(DatasourceRequest datasourceRequest) throws Exception { public void checkStatus(DatasourceRequest datasourceRequest) throws Exception {
getData(datasourceRequest); getData(datasourceRequest);
} }
...@@ -29,5 +29,5 @@ public abstract class DatasourceProvider { ...@@ -29,5 +29,5 @@ public abstract class DatasourceProvider {
abstract public Map<String, List> fetchResultAndField(DatasourceRequest datasourceRequest) throws Exception; abstract public Map<String, List> fetchResultAndField(DatasourceRequest datasourceRequest) throws Exception;
abstract public void initDataSource(DatasourceRequest datasourceRequest, String type) throws Exception; abstract public void handleDatasource(DatasourceRequest datasourceRequest, String type) throws Exception;
} }
...@@ -4,6 +4,7 @@ import com.google.gson.Gson; ...@@ -4,6 +4,7 @@ import com.google.gson.Gson;
import com.mchange.v2.c3p0.ComboPooledDataSource; import com.mchange.v2.c3p0.ComboPooledDataSource;
import io.dataease.datasource.constants.DatasourceTypes; import io.dataease.datasource.constants.DatasourceTypes;
import io.dataease.datasource.dto.MysqlConfigration; import io.dataease.datasource.dto.MysqlConfigration;
import io.dataease.datasource.dto.OracleConfigration;
import io.dataease.datasource.dto.SqlServerConfigration; import io.dataease.datasource.dto.SqlServerConfigration;
import io.dataease.datasource.dto.TableFiled; import io.dataease.datasource.dto.TableFiled;
import io.dataease.datasource.request.DatasourceRequest; import io.dataease.datasource.request.DatasourceRequest;
...@@ -180,6 +181,7 @@ public class JdbcProvider extends DatasourceProvider { ...@@ -180,6 +181,7 @@ public class JdbcProvider extends DatasourceProvider {
field.setRemarks(l); field.setRemarks(l);
field.setFieldType(t); field.setFieldType(t);
field.setFieldSize(metaData.getColumnDisplaySize(j + 1)); field.setFieldSize(metaData.getColumnDisplaySize(j + 1));
if(t.equalsIgnoreCase("LONG")){field.setFieldSize(65533);} //oracle LONG
fieldList.add(field); fieldList.add(field);
} }
return fieldList; return fieldList;
...@@ -221,22 +223,16 @@ public class JdbcProvider extends DatasourceProvider { ...@@ -221,22 +223,16 @@ public class JdbcProvider extends DatasourceProvider {
while (resultSet.next()) { while (resultSet.next()) {
String tableName = resultSet.getString("TABLE_NAME"); String tableName = resultSet.getString("TABLE_NAME");
String database = resultSet.getString("TABLE_CAT"); String database = resultSet.getString("TABLE_CAT");
if (tableName.equals(datasourceRequest.getTable()) && database.equalsIgnoreCase(getDatabase(datasourceRequest))) { if(database != null){
TableFiled tableFiled = new TableFiled(); if (tableName.equals(datasourceRequest.getTable()) && database.equalsIgnoreCase(getDatabase(datasourceRequest))) {
String colName = resultSet.getString("COLUMN_NAME"); TableFiled tableFiled = getTableFiled(resultSet);
tableFiled.setFieldName(colName); list.add(tableFiled);
String remarks = resultSet.getString("REMARKS");
if (remarks == null || remarks.equals("")) {
remarks = colName;
} }
tableFiled.setRemarks(remarks); }else {
tableFiled.setFieldSize(Integer.valueOf(resultSet.getString("COLUMN_SIZE"))); if (tableName.equals(datasourceRequest.getTable())) {
String dbType = resultSet.getString("TYPE_NAME"); TableFiled tableFiled = getTableFiled(resultSet);
tableFiled.setFieldType(dbType); list.add(tableFiled);
if(StringUtils.isNotEmpty(dbType) && dbType.toLowerCase().contains("date") && tableFiled.getFieldSize() < 50 ){
tableFiled.setFieldSize(50);
} }
list.add(tableFiled);
} }
} }
resultSet.close(); resultSet.close();
...@@ -252,8 +248,27 @@ public class JdbcProvider extends DatasourceProvider { ...@@ -252,8 +248,27 @@ public class JdbcProvider extends DatasourceProvider {
return list; return list;
} }
private TableFiled getTableFiled(ResultSet resultSet) throws SQLException {
TableFiled tableFiled = new TableFiled();
String colName = resultSet.getString("COLUMN_NAME");
tableFiled.setFieldName(colName);
String remarks = resultSet.getString("REMARKS");
if (remarks == null || remarks.equals("")) {
remarks = colName;
}
tableFiled.setRemarks(remarks);
tableFiled.setFieldSize(Integer.valueOf(resultSet.getString("COLUMN_SIZE")));
String dbType = resultSet.getString("TYPE_NAME");
tableFiled.setFieldType(dbType);
if(dbType.equalsIgnoreCase("LONG")){tableFiled.setFieldSize(65533);}
if(StringUtils.isNotEmpty(dbType) && dbType.toLowerCase().contains("date") && tableFiled.getFieldSize() < 50 ){
tableFiled.setFieldSize(50);
}
return tableFiled;
}
@Override @Override
public void test(DatasourceRequest datasourceRequest) throws Exception { public void checkStatus(DatasourceRequest datasourceRequest) throws Exception {
String queryStr = getTablesSql(datasourceRequest); String queryStr = getTablesSql(datasourceRequest);
Connection con = null; Connection con = null;
try { try {
...@@ -290,7 +305,7 @@ public class JdbcProvider extends DatasourceProvider { ...@@ -290,7 +305,7 @@ public class JdbcProvider extends DatasourceProvider {
private Connection getConnectionFromPool(DatasourceRequest datasourceRequest) throws Exception { private Connection getConnectionFromPool(DatasourceRequest datasourceRequest) throws Exception {
ComboPooledDataSource dataSource = jdbcConnection.get(datasourceRequest.getDatasource().getId()); ComboPooledDataSource dataSource = jdbcConnection.get(datasourceRequest.getDatasource().getId());
if (dataSource == null) { if (dataSource == null) {
initDataSource(datasourceRequest, "add"); handleDatasource(datasourceRequest, "add");
} }
dataSource = jdbcConnection.get(datasourceRequest.getDatasource().getId()); dataSource = jdbcConnection.get(datasourceRequest.getDatasource().getId());
Connection co = dataSource.getConnection(); Connection co = dataSource.getConnection();
...@@ -298,27 +313,36 @@ public class JdbcProvider extends DatasourceProvider { ...@@ -298,27 +313,36 @@ public class JdbcProvider extends DatasourceProvider {
} }
@Override @Override
public void initDataSource(DatasourceRequest datasourceRequest, String type) throws Exception { public void handleDatasource(DatasourceRequest datasourceRequest, String type) throws Exception {
ComboPooledDataSource dataSource = null;
switch (type){ switch (type){
case "add": case "add":
ComboPooledDataSource dataSource = jdbcConnection.get(datasourceRequest.getDatasource().getId()); checkStatus(datasourceRequest);
dataSource = jdbcConnection.get(datasourceRequest.getDatasource().getId());
if (dataSource == null) { if (dataSource == null) {
extracted(datasourceRequest); addToPool(datasourceRequest);
} }
break; break;
case "edit": case "edit":
jdbcConnection.remove(datasourceRequest.getDatasource().getId()); dataSource = jdbcConnection.get(datasourceRequest.getDatasource().getId());
extracted(datasourceRequest); if (dataSource != null) {
dataSource.close();
}
checkStatus(datasourceRequest);
addToPool(datasourceRequest);
break; break;
case "delete": case "delete":
jdbcConnection.remove(datasourceRequest.getDatasource().getId()); dataSource = jdbcConnection.get(datasourceRequest.getDatasource().getId());
if (dataSource != null) {
dataSource.close();
}
break; break;
default: default:
break; break;
} }
} }
private void extracted(DatasourceRequest datasourceRequest) throws PropertyVetoException { private void addToPool(DatasourceRequest datasourceRequest) throws PropertyVetoException {
ComboPooledDataSource dataSource; ComboPooledDataSource dataSource;
dataSource = new ComboPooledDataSource(); dataSource = new ComboPooledDataSource();
setCredential(datasourceRequest, dataSource); setCredential(datasourceRequest, dataSource);
...@@ -334,7 +358,7 @@ public class JdbcProvider extends DatasourceProvider { ...@@ -334,7 +358,7 @@ public class JdbcProvider extends DatasourceProvider {
dataSource.setTestConnectionOnCheckout(false); // 在每个connection 提交是校验有效性 dataSource.setTestConnectionOnCheckout(false); // 在每个connection 提交是校验有效性
dataSource.setTestConnectionOnCheckin(true); // 取得连接的同时将校验连接的有效性 dataSource.setTestConnectionOnCheckin(true); // 取得连接的同时将校验连接的有效性
dataSource.setCheckoutTimeout(60000); // 从连接池获取连接的超时时间,如设为0则无限期等待。单位毫秒,默认为0 dataSource.setCheckoutTimeout(60000); // 从连接池获取连接的超时时间,如设为0则无限期等待。单位毫秒,默认为0
dataSource.setPreferredTestQuery("SELECT 1"); // dataSource.setPreferredTestQuery("SELECT 1");
dataSource.setDebugUnreturnedConnectionStackTraces(true); dataSource.setDebugUnreturnedConnectionStackTraces(true);
dataSource.setUnreturnedConnectionTimeout(3600); dataSource.setUnreturnedConnectionTimeout(3600);
jdbcConnection.put(datasourceRequest.getDatasource().getId(), dataSource); jdbcConnection.put(datasourceRequest.getDatasource().getId(), dataSource);
...@@ -368,6 +392,13 @@ public class JdbcProvider extends DatasourceProvider { ...@@ -368,6 +392,13 @@ public class JdbcProvider extends DatasourceProvider {
driver = sqlServerConfigration.getDriver(); driver = sqlServerConfigration.getDriver();
jdbcurl = sqlServerConfigration.getJdbc(); jdbcurl = sqlServerConfigration.getJdbc();
break; break;
case oracle:
OracleConfigration oracleConfigration = new Gson().fromJson(datasourceRequest.getDatasource().getConfiguration(), OracleConfigration.class);
username = oracleConfigration.getUsername();
password = oracleConfigration.getPassword();
driver = oracleConfigration.getDriver();
jdbcurl = oracleConfigration.getJdbc();
break;
default: default:
break; break;
} }
...@@ -406,6 +437,13 @@ public class JdbcProvider extends DatasourceProvider { ...@@ -406,6 +437,13 @@ public class JdbcProvider extends DatasourceProvider {
dataSource.setPassword(sqlServerConfigration.getPassword()); dataSource.setPassword(sqlServerConfigration.getPassword());
dataSource.setJdbcUrl(sqlServerConfigration.getJdbc()); dataSource.setJdbcUrl(sqlServerConfigration.getJdbc());
break; break;
case oracle:
OracleConfigration oracleConfigration = new Gson().fromJson(datasourceRequest.getDatasource().getConfiguration(), OracleConfigration.class);
dataSource.setUser(oracleConfigration.getUsername());
dataSource.setDriverClass(oracleConfigration.getDriver());
dataSource.setPassword(oracleConfigration.getPassword());
dataSource.setJdbcUrl(oracleConfigration.getJdbc());
break;
default: default:
break; break;
} }
...@@ -438,6 +476,8 @@ public class JdbcProvider extends DatasourceProvider { ...@@ -438,6 +476,8 @@ public class JdbcProvider extends DatasourceProvider {
case sqlServer: case sqlServer:
SqlServerConfigration sqlServerConfigration = new Gson().fromJson(datasourceRequest.getDatasource().getConfiguration(), SqlServerConfigration.class); SqlServerConfigration sqlServerConfigration = new Gson().fromJson(datasourceRequest.getDatasource().getConfiguration(), SqlServerConfigration.class);
return "SELECT TABLE_NAME FROM DATABASE.INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE';".replace("DATABASE", sqlServerConfigration.getDataBase()); return "SELECT TABLE_NAME FROM DATABASE.INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE';".replace("DATABASE", sqlServerConfigration.getDataBase());
case oracle:
return "select TABLE_NAME from USER_TABLES";
default: default:
return "show tables;"; return "show tables;";
} }
......
...@@ -42,6 +42,8 @@ public class ProviderFactory implements ApplicationContextAware { ...@@ -42,6 +42,8 @@ public class ProviderFactory implements ApplicationContextAware {
return context.getBean("dorisQuery", QueryProvider.class); return context.getBean("dorisQuery", QueryProvider.class);
case sqlServer: case sqlServer:
return context.getBean("sqlserverQuery", QueryProvider.class); return context.getBean("sqlserverQuery", QueryProvider.class);
case oracle:
return context.getBean("oracleQuery", QueryProvider.class);
default: default:
return context.getBean("mysqlQuery", QueryProvider.class); return context.getBean("mysqlQuery", QueryProvider.class);
} }
...@@ -54,6 +56,8 @@ public class ProviderFactory implements ApplicationContextAware { ...@@ -54,6 +56,8 @@ public class ProviderFactory implements ApplicationContextAware {
return context.getBean("mysqlDDL", DDLProvider.class); return context.getBean("mysqlDDL", DDLProvider.class);
case doris: case doris:
return context.getBean("dorisDDL", DDLProvider.class); return context.getBean("dorisDDL", DDLProvider.class);
case oracle:
return context.getBean("oracleDDL", DDLProvider.class);
case sqlServer: case sqlServer:
return context.getBean("mysqlDDL", DDLProvider.class); return context.getBean("mysqlDDL", DDLProvider.class);
default: default:
......
...@@ -56,20 +56,20 @@ public class DatasourceService { ...@@ -56,20 +56,20 @@ public class DatasourceService {
datasource.setCreateTime(currentTimeMillis); datasource.setCreateTime(currentTimeMillis);
datasource.setCreateBy(String.valueOf(AuthUtils.getUser().getUsername())); datasource.setCreateBy(String.valueOf(AuthUtils.getUser().getUsername()));
datasourceMapper.insertSelective(datasource); datasourceMapper.insertSelective(datasource);
initConnectionPool(datasource, "add"); handleConnectionPool(datasource, "add");
return datasource; return datasource;
} }
private void initConnectionPool(Datasource datasource, String type) { private void handleConnectionPool(Datasource datasource, String type) {
commonThreadPool.addTask(() -> { commonThreadPool.addTask(() -> {
try { try {
DatasourceProvider datasourceProvider = ProviderFactory.getProvider(datasource.getType()); DatasourceProvider datasourceProvider = ProviderFactory.getProvider(datasource.getType());
DatasourceRequest datasourceRequest = new DatasourceRequest(); DatasourceRequest datasourceRequest = new DatasourceRequest();
datasourceRequest.setDatasource(datasource); datasourceRequest.setDatasource(datasource);
datasourceProvider.initDataSource(datasourceRequest, type); datasourceProvider.handleDatasource(datasourceRequest, type);
LogUtil.info("Succsss to init datasource connection pool: " + datasource.getName()); LogUtil.info("Succsss to {} datasource connection pool: {}", type, datasource.getName());
} catch (Exception e) { } catch (Exception e) {
LogUtil.error("Failed to init datasource connection pool: " + datasource.getName(), e); LogUtil.error("Failed to handle datasource connection pool: " + datasource.getName(), e);
} }
}); });
} }
...@@ -100,7 +100,9 @@ public class DatasourceService { ...@@ -100,7 +100,9 @@ public class DatasourceService {
if(CollectionUtils.isNotEmpty(datasetTables)){ if(CollectionUtils.isNotEmpty(datasetTables)){
DataEaseException.throwException(datasetTables.size() + Translator.get("i18n_datasource_not_allow_delete_msg")); DataEaseException.throwException(datasetTables.size() + Translator.get("i18n_datasource_not_allow_delete_msg"));
} }
Datasource datasource = datasourceMapper.selectByPrimaryKey(datasourceId);
datasourceMapper.deleteByPrimaryKey(datasourceId); datasourceMapper.deleteByPrimaryKey(datasourceId);
handleConnectionPool(datasource, "delete");
} }
public void updateDatasource(Datasource datasource) { public void updateDatasource(Datasource datasource) {
...@@ -108,14 +110,14 @@ public class DatasourceService { ...@@ -108,14 +110,14 @@ public class DatasourceService {
datasource.setCreateTime(null); datasource.setCreateTime(null);
datasource.setUpdateTime(System.currentTimeMillis()); datasource.setUpdateTime(System.currentTimeMillis());
datasourceMapper.updateByPrimaryKeySelective(datasource); datasourceMapper.updateByPrimaryKeySelective(datasource);
initConnectionPool(datasource, "edit"); handleConnectionPool(datasource, "edit");
} }
public void validate(Datasource datasource) throws Exception { public void validate(Datasource datasource) throws Exception {
DatasourceProvider datasourceProvider = ProviderFactory.getProvider(datasource.getType()); DatasourceProvider datasourceProvider = ProviderFactory.getProvider(datasource.getType());
DatasourceRequest datasourceRequest = new DatasourceRequest(); DatasourceRequest datasourceRequest = new DatasourceRequest();
datasourceRequest.setDatasource(datasource); datasourceRequest.setDatasource(datasource);
datasourceProvider.test(datasourceRequest); datasourceProvider.checkStatus(datasourceRequest);
} }
public List<DBTableDTO> getTables(Datasource datasource) throws Exception { public List<DBTableDTO> getTables(Datasource datasource) throws Exception {
...@@ -165,7 +167,7 @@ public class DatasourceService { ...@@ -165,7 +167,7 @@ public class DatasourceService {
List<Datasource> datasources = datasourceMapper.selectByExampleWithBLOBs(new DatasourceExample()); List<Datasource> datasources = datasourceMapper.selectByExampleWithBLOBs(new DatasourceExample());
datasources.forEach(datasource -> { datasources.forEach(datasource -> {
try { try {
initConnectionPool(datasource, "add"); handleConnectionPool(datasource, "add");
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
......
...@@ -26,6 +26,10 @@ public abstract class QueryProvider { ...@@ -26,6 +26,10 @@ public abstract class QueryProvider {
public abstract String createQuerySQLWithPage(String table, List<DatasetTableField> fields, Integer page, Integer pageSize, Integer realSize); public abstract String createQuerySQLWithPage(String table, List<DatasetTableField> fields, Integer page, Integer pageSize, Integer realSize);
public abstract String createQueryTableWithLimit(String table, List<DatasetTableField> fields, Integer limit);
public abstract String createQuerySqlWithLimit(String sql, List<DatasetTableField> fields, Integer limit);
public abstract String createQuerySQLAsTmpWithPage(String sql, List<DatasetTableField> fields, Integer page, Integer pageSize, Integer realSize); public abstract String createQuerySQLAsTmpWithPage(String sql, List<DatasetTableField> fields, Integer page, Integer pageSize, Integer realSize);
public abstract String getSQL(String table, List<ChartViewFieldDTO> xAxis, List<ChartViewFieldDTO> yAxis, List<ChartCustomFilterDTO> customFilter, List<ChartExtFilterRequest> extFilterRequestList); public abstract String getSQL(String table, List<ChartViewFieldDTO> xAxis, List<ChartViewFieldDTO> yAxis, List<ChartCustomFilterDTO> customFilter, List<ChartExtFilterRequest> extFilterRequestList);
...@@ -37,4 +41,10 @@ public abstract class QueryProvider { ...@@ -37,4 +41,10 @@ public abstract class QueryProvider {
public abstract String getSQLSummary(String table, List<ChartViewFieldDTO> yAxis, List<ChartCustomFilterDTO> customFilter, List<ChartExtFilterRequest> extFilterRequestList); public abstract String getSQLSummary(String table, List<ChartViewFieldDTO> yAxis, List<ChartCustomFilterDTO> customFilter, List<ChartExtFilterRequest> extFilterRequestList);
public abstract String getSQLSummaryAsTmp(String sql, List<ChartViewFieldDTO> yAxis, List<ChartCustomFilterDTO> customFilter, List<ChartExtFilterRequest> extFilterRequestList); public abstract String getSQLSummaryAsTmp(String sql, List<ChartViewFieldDTO> yAxis, List<ChartCustomFilterDTO> customFilter, List<ChartExtFilterRequest> extFilterRequestList);
public abstract String wrapSql(String sql);
public abstract String createRawQuerySQL(String table, List<DatasetTableField> fields);
public abstract String createRawQuerySQLAsTmp(String sql, List<DatasetTableField> fields);
} }
...@@ -116,6 +116,16 @@ public class DorisQueryProvider extends QueryProvider { ...@@ -116,6 +116,16 @@ public class DorisQueryProvider extends QueryProvider {
return createQuerySQL(table, fields) + " LIMIT " + (page - 1) * pageSize + "," + realSize; return createQuerySQL(table, fields) + " LIMIT " + (page - 1) * pageSize + "," + realSize;
} }
@Override
public String createQueryTableWithLimit(String table, List<DatasetTableField> fields, Integer limit) {
return createQuerySQL(table, fields) + " LIMIT 0," + limit;
}
@Override
public String createQuerySqlWithLimit(String sql, List<DatasetTableField> fields, Integer limit) {
return createQuerySQLAsTmp(sql, fields) + " LIMIT 0," + limit;
}
@Override @Override
public String createQuerySQLAsTmpWithPage(String sql, List<DatasetTableField> fields, Integer page, Integer pageSize, Integer realSize) { public String createQuerySQLAsTmpWithPage(String sql, List<DatasetTableField> fields, Integer page, Integer pageSize, Integer realSize) {
return createQuerySQLAsTmp(sql, fields) + " LIMIT " + (page - 1) * pageSize + "," + realSize; return createQuerySQLAsTmp(sql, fields) + " LIMIT " + (page - 1) * pageSize + "," + realSize;
...@@ -328,6 +338,38 @@ public class DorisQueryProvider extends QueryProvider { ...@@ -328,6 +338,38 @@ public class DorisQueryProvider extends QueryProvider {
return getSQLSummary(" (" + sql + ") AS tmp ", yAxis, customFilter, extFilterRequestList); return getSQLSummary(" (" + sql + ") AS tmp ", yAxis, customFilter, extFilterRequestList);
} }
@Override
public String wrapSql(String sql) {
sql = sql.trim();
if (sql.lastIndexOf(";") == (sql.length() - 1)) {
sql = sql.substring(0, sql.length() - 1);
}
String tmpSql = "SELECT * FROM (" + sql + ") AS tmp " + " LIMIT 0";
return tmpSql;
}
@Override
public String createRawQuerySQL(String table, List<DatasetTableField> fields){
String[] array = fields.stream().map(f -> {
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append("`").append(f.getOriginName()).append("` AS ").append(f.getDataeaseName());
return stringBuilder.toString();
}).toArray(String[]::new);
return MessageFormat.format("SELECT {0} FROM {1} ORDER BY null", StringUtils.join(array, ","), table);
}
@Override
public String createRawQuerySQLAsTmp(String sql, List<DatasetTableField> fields) {
return createRawQuerySQL(" (" + sqlFix(sql) + ") AS tmp ", fields);
}
private String sqlFix(String sql) {
if (sql.lastIndexOf(";") == (sql.length() - 1)) {
sql = sql.substring(0, sql.length() - 1);
}
return sql;
}
public String transMysqlFilterTerm(String term) { public String transMysqlFilterTerm(String term) {
switch (term) { switch (term) {
case "eq": case "eq":
......
...@@ -102,8 +102,6 @@ public class MysqlQueryProvider extends QueryProvider { ...@@ -102,8 +102,6 @@ public class MysqlQueryProvider extends QueryProvider {
} }
return stringBuilder.toString(); return stringBuilder.toString();
}).toArray(String[]::new); }).toArray(String[]::new);
// return MessageFormat.format("SELECT {0} FROM {1} ORDER BY " + (fields.size() > 0 ? fields.get(0).getOriginName() : "null"), StringUtils.join(array, ","), table);
return MessageFormat.format("SELECT {0} FROM {1} ORDER BY null", StringUtils.join(array, ","), table); return MessageFormat.format("SELECT {0} FROM {1} ORDER BY null", StringUtils.join(array, ","), table);
} }
...@@ -117,6 +115,16 @@ public class MysqlQueryProvider extends QueryProvider { ...@@ -117,6 +115,16 @@ public class MysqlQueryProvider extends QueryProvider {
return createQuerySQL(table, fields) + " LIMIT " + (page - 1) * pageSize + "," + realSize; return createQuerySQL(table, fields) + " LIMIT " + (page - 1) * pageSize + "," + realSize;
} }
@Override
public String createQueryTableWithLimit(String table, List<DatasetTableField> fields, Integer limit) {
return createQuerySQL(table, fields) + " LIMIT 0," + limit;
}
@Override
public String createQuerySqlWithLimit(String sql, List<DatasetTableField> fields, Integer limit) {
return createQuerySQLAsTmp(sql, fields) + " LIMIT 0," + limit;
}
@Override @Override
public String createQuerySQLAsTmpWithPage(String sql, List<DatasetTableField> fields, Integer page, Integer pageSize, Integer realSize) { public String createQuerySQLAsTmpWithPage(String sql, List<DatasetTableField> fields, Integer page, Integer pageSize, Integer realSize) {
return createQuerySQLAsTmp(sql, fields) + " LIMIT " + (page - 1) * pageSize + "," + realSize; return createQuerySQLAsTmp(sql, fields) + " LIMIT " + (page - 1) * pageSize + "," + realSize;
...@@ -336,6 +344,31 @@ public class MysqlQueryProvider extends QueryProvider { ...@@ -336,6 +344,31 @@ public class MysqlQueryProvider extends QueryProvider {
return getSQLSummary(" (" + sqlFix(sql) + ") AS tmp ", yAxis, customFilter, extFilterRequestList); return getSQLSummary(" (" + sqlFix(sql) + ") AS tmp ", yAxis, customFilter, extFilterRequestList);
} }
@Override
public String wrapSql(String sql) {
sql = sql.trim();
if (sql.lastIndexOf(";") == (sql.length() - 1)) {
sql = sql.substring(0, sql.length() - 1);
}
String tmpSql = "SELECT * FROM (" + sql + ") AS tmp " + " LIMIT 0";
return tmpSql;
}
@Override
public String createRawQuerySQL(String table, List<DatasetTableField> fields){
String[] array = fields.stream().map(f -> {
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append("`").append(f.getOriginName()).append("` AS ").append(f.getDataeaseName());
return stringBuilder.toString();
}).toArray(String[]::new);
return MessageFormat.format("SELECT {0} FROM {1} ORDER BY null", StringUtils.join(array, ","), table);
}
@Override
public String createRawQuerySQLAsTmp(String sql, List<DatasetTableField> fields) {
return createRawQuerySQL(" (" + sqlFix(sql) + ") AS tmp ", fields);
}
public String transMysqlFilterTerm(String term) { public String transMysqlFilterTerm(String term) {
switch (term) { switch (term) {
case "eq": case "eq":
......
package io.dataease.provider.oracle;
import io.dataease.provider.DDLProvider;
import org.springframework.stereotype.Service;
/**
* @Author gin
* @Date 2021/5/17 4:27 下午
*/
@Service("oracleDDL")
public class OracleDDLProvider extends DDLProvider {
@Override
public String createView(String name, String viewSQL) {
return "CREATE VIEW IF NOT EXISTS " + name + " AS (" + viewSQL + ")";
}
@Override
public String dropTable(String name) {
return "DROP TABLE IF EXISTS " + name;
}
@Override
public String dropView(String name) {
return "DROP VIEW IF EXISTS " + name;
}
}
...@@ -106,6 +106,16 @@ public class SqlserverQueryProvider extends QueryProvider { ...@@ -106,6 +106,16 @@ public class SqlserverQueryProvider extends QueryProvider {
return createQuerySQL(table, fields) + " offset " + (page - 1) * pageSize + " rows fetch next " + realSize + " rows only"; return createQuerySQL(table, fields) + " offset " + (page - 1) * pageSize + " rows fetch next " + realSize + " rows only";
} }
@Override
public String createQueryTableWithLimit(String table, List<DatasetTableField> fields, Integer limit) {
return createQuerySQL(table, fields) + " LIMIT 0," + limit;
}
@Override
public String createQuerySqlWithLimit(String sql, List<DatasetTableField> fields, Integer limit) {
return createQuerySQLAsTmp(sql, fields) + " LIMIT 0," + limit;
}
@Override @Override
public String createQuerySQLAsTmpWithPage(String sql, List<DatasetTableField> fields, Integer page, Integer pageSize, Integer realSize) { public String createQuerySQLAsTmpWithPage(String sql, List<DatasetTableField> fields, Integer page, Integer pageSize, Integer realSize) {
return createQuerySQLAsTmp(sql, fields) + " LIMIT " + (page - 1) * pageSize + "," + realSize; return createQuerySQLAsTmp(sql, fields) + " LIMIT " + (page - 1) * pageSize + "," + realSize;
...@@ -250,6 +260,31 @@ public class SqlserverQueryProvider extends QueryProvider { ...@@ -250,6 +260,31 @@ public class SqlserverQueryProvider extends QueryProvider {
return null; return null;
} }
@Override
public String wrapSql(String sql) {
sql = sql.trim();
if (sql.lastIndexOf(";") == (sql.length() - 1)) {
sql = sql.substring(0, sql.length() - 1);
}
String tmpSql = "SELECT * FROM (" + sql + ") AS tmp " + " LIMIT 0";
return tmpSql;
}
@Override
public String createRawQuerySQL(String table, List<DatasetTableField> fields){
String[] array = fields.stream().map(f -> {
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append("`").append(f.getOriginName()).append("` AS ").append(f.getDataeaseName());
return stringBuilder.toString();
}).toArray(String[]::new);
return MessageFormat.format("SELECT {0} FROM {1} ORDER BY null", StringUtils.join(array, ","), table);
}
@Override
public String createRawQuerySQLAsTmp(String sql, List<DatasetTableField> fields) {
return createRawQuerySQL(" (" + sqlFix(sql) + ") AS tmp ", fields);
}
public String transMysqlFilterTerm(String term) { public String transMysqlFilterTerm(String term) {
switch (term) { switch (term) {
case "eq": case "eq":
......
...@@ -299,7 +299,7 @@ public class DataSetTableService { ...@@ -299,7 +299,7 @@ public class DataSetTableService {
e.printStackTrace(); e.printStackTrace();
} }
try { try {
datasourceRequest.setQuery(qp.createQuerySQL(table, fields) + " LIMIT 0," + dataSetTableRequest.getRow()); datasourceRequest.setQuery(qp.createQueryTableWithLimit(table, fields, Integer.valueOf(dataSetTableRequest.getRow())));
dataSetPreviewPage.setTotal(datasourceProvider.getData(datasourceRequest).size()); dataSetPreviewPage.setTotal(datasourceProvider.getData(datasourceRequest).size());
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
...@@ -316,13 +316,15 @@ public class DataSetTableService { ...@@ -316,13 +316,15 @@ public class DataSetTableService {
String sql = dataTableInfoDTO.getSql(); String sql = dataTableInfoDTO.getSql();
QueryProvider qp = ProviderFactory.getQueryProvider(ds.getType()); QueryProvider qp = ProviderFactory.getQueryProvider(ds.getType());
datasourceRequest.setQuery(qp.createQuerySQLAsTmpWithPage(sql, fields, page, pageSize, realSize)); datasourceRequest.setQuery(qp.createQuerySQLAsTmpWithPage(sql, fields, page, pageSize, realSize));
System.out.println(datasourceRequest.getQuery());
try { try {
data.addAll(datasourceProvider.getData(datasourceRequest)); data.addAll(datasourceProvider.getData(datasourceRequest));
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
try { try {
datasourceRequest.setQuery(qp.createQuerySQLAsTmp(sql, fields) + " LIMIT 0," + dataSetTableRequest.getRow()); datasourceRequest.setQuery(qp.createQuerySqlWithLimit(sql, fields, Integer.valueOf(dataSetTableRequest.getRow())));
System.out.println(datasourceRequest.getQuery());
dataSetPreviewPage.setTotal(datasourceProvider.getData(datasourceRequest).size()); dataSetPreviewPage.setTotal(datasourceProvider.getData(datasourceRequest).size());
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
...@@ -417,9 +419,6 @@ public class DataSetTableService { ...@@ -417,9 +419,6 @@ public class DataSetTableService {
} }
QueryProvider qp = ProviderFactory.getQueryProvider(ds.getType()); QueryProvider qp = ProviderFactory.getQueryProvider(ds.getType());
String sqlAsTable = qp.createSQLPreview(sql, null); String sqlAsTable = qp.createSQLPreview(sql, null);
// datasourceRequest.setQuery(sqlAsTable);
// List<TableFiled> previewFields = datasourceProvider.fetchResultField(datasourceRequest);
// 正式执行
datasourceRequest.setQuery(sqlAsTable); datasourceRequest.setQuery(sqlAsTable);
Map<String, List> result = datasourceProvider.fetchResultAndField(datasourceRequest); Map<String, List> result = datasourceProvider.fetchResultAndField(datasourceRequest);
List<String[]> data = result.get("dataList"); List<String[]> data = result.get("dataList");
...@@ -722,13 +721,14 @@ public class DataSetTableService { ...@@ -722,13 +721,14 @@ public class DataSetTableService {
}); });
List<String> originNameFileds = datasetTableFields.stream().map(DatasetTableField::getOriginName).collect(Collectors.toList()); List<String> originNameFileds = datasetTableFields.stream().map(DatasetTableField::getOriginName).collect(Collectors.toList());
Datasource ds = datasourceMapper.selectByPrimaryKey(datasetTable.getDataSourceId()); Datasource ds = datasourceMapper.selectByPrimaryKey(datasetTable.getDataSourceId());
QueryProvider qp = ProviderFactory.getQueryProvider(ds.getType());
DatasourceProvider datasourceProvider = ProviderFactory.getProvider(ds.getType()); DatasourceProvider datasourceProvider = ProviderFactory.getProvider(ds.getType());
DatasourceRequest datasourceRequest = new DatasourceRequest(); DatasourceRequest datasourceRequest = new DatasourceRequest();
datasourceRequest.setDatasource(ds); datasourceRequest.setDatasource(ds);
if (StringUtils.isNotEmpty(datasetTableIncrementalConfig.getIncrementalAdd()) && StringUtils.isNotEmpty(datasetTableIncrementalConfig.getIncrementalAdd().replace(" ", ""))) {// 增量添加 if (StringUtils.isNotEmpty(datasetTableIncrementalConfig.getIncrementalAdd()) && StringUtils.isNotEmpty(datasetTableIncrementalConfig.getIncrementalAdd().replace(" ", ""))) {// 增量添加
String sql = datasetTableIncrementalConfig.getIncrementalAdd().replace(lastUpdateTime, Long.valueOf(System.currentTimeMillis()).toString()) String sql = datasetTableIncrementalConfig.getIncrementalAdd().replace(lastUpdateTime, Long.valueOf(System.currentTimeMillis()).toString())
.replace(currentUpdateTime, Long.valueOf(System.currentTimeMillis()).toString()); .replace(currentUpdateTime, Long.valueOf(System.currentTimeMillis()).toString());
datasourceRequest.setQuery(extractDataService.sqlFix(sql)); datasourceRequest.setQuery(qp.wrapSql(sql));
List<String> sqlFileds = new ArrayList<>(); List<String> sqlFileds = new ArrayList<>();
datasourceProvider.fetchResultField(datasourceRequest).stream().map(TableFiled::getFieldName).forEach(filed -> { datasourceProvider.fetchResultField(datasourceRequest).stream().map(TableFiled::getFieldName).forEach(filed -> {
sqlFileds.add(filed); sqlFileds.add(filed);
...@@ -741,7 +741,7 @@ public class DataSetTableService { ...@@ -741,7 +741,7 @@ public class DataSetTableService {
if (StringUtils.isNotEmpty(datasetTableIncrementalConfig.getIncrementalDelete()) && StringUtils.isNotEmpty(datasetTableIncrementalConfig.getIncrementalDelete().replace(" ", ""))) {// 增量删除 if (StringUtils.isNotEmpty(datasetTableIncrementalConfig.getIncrementalDelete()) && StringUtils.isNotEmpty(datasetTableIncrementalConfig.getIncrementalDelete().replace(" ", ""))) {// 增量删除
String sql = datasetTableIncrementalConfig.getIncrementalDelete().replace(lastUpdateTime, Long.valueOf(System.currentTimeMillis()).toString()) String sql = datasetTableIncrementalConfig.getIncrementalDelete().replace(lastUpdateTime, Long.valueOf(System.currentTimeMillis()).toString())
.replace(currentUpdateTime, Long.valueOf(System.currentTimeMillis()).toString()); .replace(currentUpdateTime, Long.valueOf(System.currentTimeMillis()).toString());
datasourceRequest.setQuery(extractDataService.sqlFix(sql)); datasourceRequest.setQuery(qp.wrapSql(sql));
List<String> sqlFileds = new ArrayList<>(); List<String> sqlFileds = new ArrayList<>();
datasourceProvider.fetchResultField(datasourceRequest).stream().map(TableFiled::getFieldName).forEach(filed -> { datasourceProvider.fetchResultField(datasourceRequest).stream().map(TableFiled::getFieldName).forEach(filed -> {
sqlFileds.add(filed); sqlFileds.add(filed);
...@@ -890,7 +890,7 @@ public class DataSetTableService { ...@@ -890,7 +890,7 @@ public class DataSetTableService {
if (row == null) { if (row == null) {
throw new RuntimeException(Translator.get("i18n_excel_header_empty")); throw new RuntimeException(Translator.get("i18n_excel_header_empty"));
} }
columnNum = row.getPhysicalNumberOfCells(); columnNum = row.getLastCellNum();
} }
String[] r = new String[columnNum]; String[] r = new String[columnNum];
for (int j = 0; j < columnNum; j++) { for (int j = 0; j < columnNum; j++) {
...@@ -902,6 +902,7 @@ public class DataSetTableService { ...@@ -902,6 +902,7 @@ public class DataSetTableService {
if (StringUtils.isEmpty(columnName)) { if (StringUtils.isEmpty(columnName)) {
columnName = "NONE_" + String.valueOf(j); columnName = "NONE_" + String.valueOf(j);
} }
tableFiled.setFieldName(columnName); tableFiled.setFieldName(columnName);
tableFiled.setRemarks(columnName); tableFiled.setRemarks(columnName);
fields.add(tableFiled); fields.add(tableFiled);
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
}, },
"dependencies": { "dependencies": {
"@riophae/vue-treeselect": "0.4.0", "@riophae/vue-treeselect": "0.4.0",
"@tinymce/tinymce-vue": "^3.2.8",
"axios": "^0.21.1", "axios": "^0.21.1",
"core-js": "^2.6.5", "core-js": "^2.6.5",
"echarts": "^5.0.1", "echarts": "^5.0.1",
...@@ -32,6 +33,7 @@ ...@@ -32,6 +33,7 @@
"screenfull": "4.2.0", "screenfull": "4.2.0",
"svg-sprite-loader": "4.1.3", "svg-sprite-loader": "4.1.3",
"svgo": "1.2.2", "svgo": "1.2.2",
"tinymce": "^5.8.2",
"umy-ui": "^1.1.6", "umy-ui": "^1.1.6",
"vcolorpicker": "^1.1.0", "vcolorpicker": "^1.1.0",
"vue": "2.6.10", "vue": "2.6.10",
......
差异被折叠。
差异被折叠。
/**
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
* Licensed under the LGPL or a commercial license.
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*/
body {
background-color: #2f3742;
color: #dfe0e4;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
line-height: 1.4;
margin: 1rem;
}
a {
color: #4099ff;
}
table {
border-collapse: collapse;
}
/* Apply a default padding if legacy cellpadding attribute is missing */
table:not([cellpadding]) th,
table:not([cellpadding]) td {
padding: 0.4rem;
}
/* Set default table styles if a table has a positive border attribute
and no inline css */
table[border]:not([border="0"]):not([style*="border-width"]) th,
table[border]:not([border="0"]):not([style*="border-width"]) td {
border-width: 1px;
}
/* Set default table styles if a table has a positive border attribute
and no inline css */
table[border]:not([border="0"]):not([style*="border-style"]) th,
table[border]:not([border="0"]):not([style*="border-style"]) td {
border-style: solid;
}
/* Set default table styles if a table has a positive border attribute
and no inline css */
table[border]:not([border="0"]):not([style*="border-color"]) th,
table[border]:not([border="0"]):not([style*="border-color"]) td {
border-color: #6d737b;
}
figure {
display: table;
margin: 1rem auto;
}
figure figcaption {
color: #8a8f97;
display: block;
margin-top: 0.25rem;
text-align: center;
}
hr {
border-color: #6d737b;
border-style: solid;
border-width: 1px 0 0 0;
}
code {
background-color: #6d737b;
border-radius: 3px;
padding: 0.1rem 0.2rem;
}
.mce-content-body:not([dir=rtl]) blockquote {
border-left: 2px solid #6d737b;
margin-left: 1.5rem;
padding-left: 1rem;
}
.mce-content-body[dir=rtl] blockquote {
border-right: 2px solid #6d737b;
margin-right: 1.5rem;
padding-right: 1rem;
}
/**
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
* Licensed under the LGPL or a commercial license.
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*/
body{background-color:#2f3742;color:#dfe0e4;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,Cantarell,'Open Sans','Helvetica Neue',sans-serif;line-height:1.4;margin:1rem}a{color:#4099ff}table{border-collapse:collapse}table:not([cellpadding]) td,table:not([cellpadding]) th{padding:.4rem}table[border]:not([border="0"]):not([style*=border-width]) td,table[border]:not([border="0"]):not([style*=border-width]) th{border-width:1px}table[border]:not([border="0"]):not([style*=border-style]) td,table[border]:not([border="0"]):not([style*=border-style]) th{border-style:solid}table[border]:not([border="0"]):not([style*=border-color]) td,table[border]:not([border="0"]):not([style*=border-color]) th{border-color:#6d737b}figure{display:table;margin:1rem auto}figure figcaption{color:#8a8f97;display:block;margin-top:.25rem;text-align:center}hr{border-color:#6d737b;border-style:solid;border-width:1px 0 0 0}code{background-color:#6d737b;border-radius:3px;padding:.1rem .2rem}.mce-content-body:not([dir=rtl]) blockquote{border-left:2px solid #6d737b;margin-left:1.5rem;padding-left:1rem}.mce-content-body[dir=rtl] blockquote{border-right:2px solid #6d737b;margin-right:1.5rem;padding-right:1rem}
/**
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
* Licensed under the LGPL or a commercial license.
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*/
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
line-height: 1.4;
margin: 1rem;
}
table {
border-collapse: collapse;
}
/* Apply a default padding if legacy cellpadding attribute is missing */
table:not([cellpadding]) th,
table:not([cellpadding]) td {
padding: 0.4rem;
}
/* Set default table styles if a table has a positive border attribute
and no inline css */
table[border]:not([border="0"]):not([style*="border-width"]) th,
table[border]:not([border="0"]):not([style*="border-width"]) td {
border-width: 1px;
}
/* Set default table styles if a table has a positive border attribute
and no inline css */
table[border]:not([border="0"]):not([style*="border-style"]) th,
table[border]:not([border="0"]):not([style*="border-style"]) td {
border-style: solid;
}
/* Set default table styles if a table has a positive border attribute
and no inline css */
table[border]:not([border="0"]):not([style*="border-color"]) th,
table[border]:not([border="0"]):not([style*="border-color"]) td {
border-color: #ccc;
}
figure {
display: table;
margin: 1rem auto;
}
figure figcaption {
color: #999;
display: block;
margin-top: 0.25rem;
text-align: center;
}
hr {
border-color: #ccc;
border-style: solid;
border-width: 1px 0 0 0;
}
code {
background-color: #e8e8e8;
border-radius: 3px;
padding: 0.1rem 0.2rem;
}
.mce-content-body:not([dir=rtl]) blockquote {
border-left: 2px solid #ccc;
margin-left: 1.5rem;
padding-left: 1rem;
}
.mce-content-body[dir=rtl] blockquote {
border-right: 2px solid #ccc;
margin-right: 1.5rem;
padding-right: 1rem;
}
/**
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
* Licensed under the LGPL or a commercial license.
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*/
body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,Cantarell,'Open Sans','Helvetica Neue',sans-serif;line-height:1.4;margin:1rem}table{border-collapse:collapse}table:not([cellpadding]) td,table:not([cellpadding]) th{padding:.4rem}table[border]:not([border="0"]):not([style*=border-width]) td,table[border]:not([border="0"]):not([style*=border-width]) th{border-width:1px}table[border]:not([border="0"]):not([style*=border-style]) td,table[border]:not([border="0"]):not([style*=border-style]) th{border-style:solid}table[border]:not([border="0"]):not([style*=border-color]) td,table[border]:not([border="0"]):not([style*=border-color]) th{border-color:#ccc}figure{display:table;margin:1rem auto}figure figcaption{color:#999;display:block;margin-top:.25rem;text-align:center}hr{border-color:#ccc;border-style:solid;border-width:1px 0 0 0}code{background-color:#e8e8e8;border-radius:3px;padding:.1rem .2rem}.mce-content-body:not([dir=rtl]) blockquote{border-left:2px solid #ccc;margin-left:1.5rem;padding-left:1rem}.mce-content-body[dir=rtl] blockquote{border-right:2px solid #ccc;margin-right:1.5rem;padding-right:1rem}
/**
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
* Licensed under the LGPL or a commercial license.
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*/
@media screen {
html {
background: #f4f4f4;
min-height: 100%;
}
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}
@media screen {
body {
background-color: #fff;
box-shadow: 0 0 4px rgba(0, 0, 0, 0.15);
box-sizing: border-box;
margin: 1rem auto 0;
max-width: 820px;
min-height: calc(100vh - 1rem);
padding: 4rem 6rem 6rem 6rem;
}
}
table {
border-collapse: collapse;
}
/* Apply a default padding if legacy cellpadding attribute is missing */
table:not([cellpadding]) th,
table:not([cellpadding]) td {
padding: 0.4rem;
}
/* Set default table styles if a table has a positive border attribute
and no inline css */
table[border]:not([border="0"]):not([style*="border-width"]) th,
table[border]:not([border="0"]):not([style*="border-width"]) td {
border-width: 1px;
}
/* Set default table styles if a table has a positive border attribute
and no inline css */
table[border]:not([border="0"]):not([style*="border-style"]) th,
table[border]:not([border="0"]):not([style*="border-style"]) td {
border-style: solid;
}
/* Set default table styles if a table has a positive border attribute
and no inline css */
table[border]:not([border="0"]):not([style*="border-color"]) th,
table[border]:not([border="0"]):not([style*="border-color"]) td {
border-color: #ccc;
}
figure figcaption {
color: #999;
margin-top: 0.25rem;
text-align: center;
}
hr {
border-color: #ccc;
border-style: solid;
border-width: 1px 0 0 0;
}
.mce-content-body:not([dir=rtl]) blockquote {
border-left: 2px solid #ccc;
margin-left: 1.5rem;
padding-left: 1rem;
}
.mce-content-body[dir=rtl] blockquote {
border-right: 2px solid #ccc;
margin-right: 1.5rem;
padding-right: 1rem;
}
/**
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
* Licensed under the LGPL or a commercial license.
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*/
@media screen{html{background:#f4f4f4;min-height:100%}}body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,Cantarell,'Open Sans','Helvetica Neue',sans-serif}@media screen{body{background-color:#fff;box-shadow:0 0 4px rgba(0,0,0,.15);box-sizing:border-box;margin:1rem auto 0;max-width:820px;min-height:calc(100vh - 1rem);padding:4rem 6rem 6rem 6rem}}table{border-collapse:collapse}table:not([cellpadding]) td,table:not([cellpadding]) th{padding:.4rem}table[border]:not([border="0"]):not([style*=border-width]) td,table[border]:not([border="0"]):not([style*=border-width]) th{border-width:1px}table[border]:not([border="0"]):not([style*=border-style]) td,table[border]:not([border="0"]):not([style*=border-style]) th{border-style:solid}table[border]:not([border="0"]):not([style*=border-color]) td,table[border]:not([border="0"]):not([style*=border-color]) th{border-color:#ccc}figure figcaption{color:#999;margin-top:.25rem;text-align:center}hr{border-color:#ccc;border-style:solid;border-width:1px 0 0 0}.mce-content-body:not([dir=rtl]) blockquote{border-left:2px solid #ccc;margin-left:1.5rem;padding-left:1rem}.mce-content-body[dir=rtl] blockquote{border-right:2px solid #ccc;margin-right:1.5rem;padding-right:1rem}
/**
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
* Licensed under the LGPL or a commercial license.
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*/
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
line-height: 1.4;
margin: 1rem auto;
max-width: 900px;
}
table {
border-collapse: collapse;
}
/* Apply a default padding if legacy cellpadding attribute is missing */
table:not([cellpadding]) th,
table:not([cellpadding]) td {
padding: 0.4rem;
}
/* Set default table styles if a table has a positive border attribute
and no inline css */
table[border]:not([border="0"]):not([style*="border-width"]) th,
table[border]:not([border="0"]):not([style*="border-width"]) td {
border-width: 1px;
}
/* Set default table styles if a table has a positive border attribute
and no inline css */
table[border]:not([border="0"]):not([style*="border-style"]) th,
table[border]:not([border="0"]):not([style*="border-style"]) td {
border-style: solid;
}
/* Set default table styles if a table has a positive border attribute
and no inline css */
table[border]:not([border="0"]):not([style*="border-color"]) th,
table[border]:not([border="0"]):not([style*="border-color"]) td {
border-color: #ccc;
}
figure {
display: table;
margin: 1rem auto;
}
figure figcaption {
color: #999;
display: block;
margin-top: 0.25rem;
text-align: center;
}
hr {
border-color: #ccc;
border-style: solid;
border-width: 1px 0 0 0;
}
code {
background-color: #e8e8e8;
border-radius: 3px;
padding: 0.1rem 0.2rem;
}
.mce-content-body:not([dir=rtl]) blockquote {
border-left: 2px solid #ccc;
margin-left: 1.5rem;
padding-left: 1rem;
}
.mce-content-body[dir=rtl] blockquote {
border-right: 2px solid #ccc;
margin-right: 1.5rem;
padding-right: 1rem;
}
/**
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
* Licensed under the LGPL or a commercial license.
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*/
body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,Cantarell,'Open Sans','Helvetica Neue',sans-serif;line-height:1.4;margin:1rem auto;max-width:900px}table{border-collapse:collapse}table:not([cellpadding]) td,table:not([cellpadding]) th{padding:.4rem}table[border]:not([border="0"]):not([style*=border-width]) td,table[border]:not([border="0"]):not([style*=border-width]) th{border-width:1px}table[border]:not([border="0"]):not([style*=border-style]) td,table[border]:not([border="0"]):not([style*=border-style]) th{border-style:solid}table[border]:not([border="0"]):not([style*=border-color]) td,table[border]:not([border="0"]):not([style*=border-color]) th{border-color:#ccc}figure{display:table;margin:1rem auto}figure figcaption{color:#999;display:block;margin-top:.25rem;text-align:center}hr{border-color:#ccc;border-style:solid;border-width:1px 0 0 0}code{background-color:#e8e8e8;border-radius:3px;padding:.1rem .2rem}.mce-content-body:not([dir=rtl]) blockquote{border-left:2px solid #ccc;margin-left:1.5rem;padding-left:1rem}.mce-content-body[dir=rtl] blockquote{border-right:2px solid #ccc;margin-right:1.5rem;padding-right:1rem}
/**
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
* Licensed under the LGPL or a commercial license.
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*/
.tinymce-mobile-unfocused-selections .tinymce-mobile-unfocused-selection {
/* Note: this file is used inside the content, so isn't part of theming */
background-color: green;
display: inline-block;
opacity: 0.5;
position: absolute;
}
body {
-webkit-text-size-adjust: none;
}
body img {
/* this is related to the content margin */
max-width: 96vw;
}
body table img {
max-width: 95%;
}
body {
font-family: sans-serif;
}
table {
border-collapse: collapse;
}
/**
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
* Licensed under the LGPL or a commercial license.
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*/
.tinymce-mobile-unfocused-selections .tinymce-mobile-unfocused-selection{background-color:green;display:inline-block;opacity:.5;position:absolute}body{-webkit-text-size-adjust:none}body img{max-width:96vw}body table img{max-width:95%}body{font-family:sans-serif}table{border-collapse:collapse}
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论