mirror of
https://github.com/dataease/dataease.git
synced 2025-02-24 19:42:56 +08:00
Merge branch 'dev' into pr@dev_memory_component
This commit is contained in:
commit
bb73fd7959
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>dataease-server</artifactId>
|
||||
<groupId>io.dataease</groupId>
|
||||
<version>1.18.2</version>
|
||||
<version>1.18.3</version>
|
||||
</parent>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
@ -119,7 +119,7 @@
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-text</artifactId>
|
||||
<version>[1.10.0,)</version>
|
||||
<version>1.10.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-codec</groupId>
|
||||
@ -204,7 +204,7 @@
|
||||
<dependency>
|
||||
<groupId>io.dataease</groupId>
|
||||
<artifactId>dataease-plugin-interface</artifactId>
|
||||
<version>1.18.2</version>
|
||||
<version>1.18.3</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<artifactId>guava</artifactId>
|
||||
@ -215,12 +215,12 @@
|
||||
<dependency>
|
||||
<groupId>io.dataease</groupId>
|
||||
<artifactId>dataease-plugin-view</artifactId>
|
||||
<version>1.18.2</version>
|
||||
<version>1.18.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.dataease</groupId>
|
||||
<artifactId>dataease-plugin-datasource</artifactId>
|
||||
<version>1.18.2</version>
|
||||
<version>1.18.3</version>
|
||||
</dependency>
|
||||
<!-- kettle及数据源依赖 -->
|
||||
<dependency>
|
||||
|
@ -6,14 +6,13 @@ import io.dataease.auth.api.dto.LoginDto;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Api(tags = "权限:权限管理")
|
||||
@Api(tags = "登录:登录管理")
|
||||
@ApiSupport(order = 10)
|
||||
@RequestMapping("/api/auth")
|
||||
public interface AuthApi {
|
||||
|
@ -8,15 +8,17 @@ import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Api(tags = "权限:动态菜单")
|
||||
@Api(tags = "登录:动态菜单")
|
||||
@ApiSupport(order = 20)
|
||||
@RequestMapping("/api/dynamicMenu")
|
||||
public interface DynamicMenuApi {
|
||||
|
||||
/**
|
||||
* 根据heads中获取的token 获取username 获取对应权限的菜单
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("查询")
|
||||
|
@ -66,7 +66,7 @@ public class JWTFilter extends BasicHttpAuthenticationFilter {
|
||||
if (StringUtils.startsWith(authorization, "Basic")) {
|
||||
return false;
|
||||
}
|
||||
if (!TokenCacheUtils.validate(authorization)) {
|
||||
if (!TokenCacheUtils.validate(authorization) && !TokenCacheUtils.validateDelay(authorization)) {
|
||||
throw new AuthenticationException(expireMessage);
|
||||
}
|
||||
// 当没有出现登录超时 且需要刷新token 则执行刷新token
|
||||
@ -75,6 +75,7 @@ public class JWTFilter extends BasicHttpAuthenticationFilter {
|
||||
throw new AuthenticationException(expireMessage);
|
||||
}
|
||||
if (JWTUtils.needRefresh(authorization)) {
|
||||
TokenCacheUtils.addWithTtl(authorization, 1L);
|
||||
TokenCacheUtils.remove(authorization);
|
||||
authorization = refreshToken(request, response);
|
||||
}
|
||||
|
@ -7,6 +7,7 @@ import org.apache.commons.lang3.StringUtils;
|
||||
public class TokenCacheUtils {
|
||||
|
||||
private static final String KEY = "sys_token_store";
|
||||
private static final String DELAY_KEY = "sys_token_store_delay";
|
||||
|
||||
public static void add(String token, Long userId) {
|
||||
CacheUtils.put(KEY, token, userId, null, null);
|
||||
@ -25,4 +26,13 @@ public class TokenCacheUtils {
|
||||
Object sys_token_store = CacheUtils.get(KEY, token);
|
||||
return ObjectUtils.isNotEmpty(sys_token_store) && StringUtils.isNotBlank(sys_token_store.toString()) && userId == Long.parseLong(sys_token_store.toString());
|
||||
}
|
||||
|
||||
public static void addWithTtl(String token, Long userId) {
|
||||
CacheUtils.put(DELAY_KEY, token, userId, 3, 5);
|
||||
}
|
||||
|
||||
public static boolean validateDelay(String token) {
|
||||
Object tokenObj = CacheUtils.get(DELAY_KEY, token);
|
||||
return ObjectUtils.isNotEmpty(tokenObj) && StringUtils.isNotBlank(tokenObj.toString());
|
||||
}
|
||||
}
|
||||
|
@ -7,15 +7,19 @@ import com.google.common.base.Predicate;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.beans.factory.config.BeanPostProcessor;
|
||||
import org.springframework.context.annotation.*;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Import;
|
||||
import springfox.bean.validators.configuration.BeanValidatorPluginsConfiguration;
|
||||
import springfox.documentation.RequestHandler;
|
||||
import springfox.documentation.builders.*;
|
||||
import springfox.documentation.builders.ApiInfoBuilder;
|
||||
import springfox.documentation.builders.PathSelectors;
|
||||
import springfox.documentation.oas.annotations.EnableOpenApi;
|
||||
import springfox.documentation.service.*;
|
||||
import springfox.documentation.spi.DocumentationType;
|
||||
import springfox.documentation.spi.service.contexts.SecurityContext;
|
||||
import springfox.documentation.spring.web.plugins.Docket;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@ -23,7 +27,7 @@ import java.util.List;
|
||||
@EnableOpenApi
|
||||
@Configuration
|
||||
@Import(BeanValidatorPluginsConfiguration.class)
|
||||
public class Knife4jConfiguration implements BeanPostProcessor{
|
||||
public class Knife4jConfiguration implements BeanPostProcessor {
|
||||
|
||||
private static final String splitor = ",";
|
||||
|
||||
@ -33,7 +37,6 @@ public class Knife4jConfiguration implements BeanPostProcessor{
|
||||
private String version;
|
||||
|
||||
|
||||
|
||||
@Autowired
|
||||
public Knife4jConfiguration(OpenApiExtensionResolver openApiExtensionResolver) {
|
||||
this.openApiExtensionResolver = openApiExtensionResolver;
|
||||
@ -41,7 +44,7 @@ public class Knife4jConfiguration implements BeanPostProcessor{
|
||||
|
||||
@Bean(value = "authApi")
|
||||
public Docket authApi() {
|
||||
return defaultApi("权限管理", "io.dataease.auth");
|
||||
return defaultApi("登录管理", "io.dataease.auth");
|
||||
}
|
||||
|
||||
@Bean(value = "chartApi")
|
||||
@ -69,24 +72,24 @@ public class Knife4jConfiguration implements BeanPostProcessor{
|
||||
return defaultApi("系统管理", "io.dataease.controller.sys,io.dataease.plugins.server");
|
||||
}
|
||||
|
||||
private ApiInfo apiInfo(){
|
||||
private ApiInfo apiInfo() {
|
||||
return new ApiInfoBuilder()
|
||||
.title("DataEase")
|
||||
.description("人人可用的开源数据可视化分析工具")
|
||||
.termsOfServiceUrl("https://dataease.io")
|
||||
.contact(new Contact("Dataease","https://www.fit2cloud.com/dataease/index.html","dataease@fit2cloud.com"))
|
||||
.contact(new Contact("Dataease", "https://www.fit2cloud.com/dataease/index.html", "dataease@fit2cloud.com"))
|
||||
.version(version)
|
||||
.build();
|
||||
}
|
||||
|
||||
private Docket defaultApi(String groupName, String packageName) {
|
||||
List<SecurityScheme> securitySchemes=new ArrayList<>();
|
||||
List<SecurityScheme> securitySchemes = new ArrayList<>();
|
||||
securitySchemes.add(accessKey());
|
||||
securitySchemes.add(signature());
|
||||
|
||||
List<SecurityContext> securityContexts = new ArrayList<>();
|
||||
securityContexts.add(securityContext());
|
||||
Docket docket=new Docket(DocumentationType.OAS_30)
|
||||
Docket docket = new Docket(DocumentationType.OAS_30)
|
||||
.apiInfo(apiInfo())
|
||||
.groupName(groupName)
|
||||
.select()
|
||||
@ -131,7 +134,7 @@ public class Knife4jConfiguration implements BeanPostProcessor{
|
||||
return input -> declaringClass(input).transform(handlerPackage(basePackage)).or(true);
|
||||
}
|
||||
|
||||
private static Function<Class<?>, Boolean> handlerPackage(final String basePackage) {
|
||||
private static Function<Class<?>, Boolean> handlerPackage(final String basePackage) {
|
||||
return input -> {
|
||||
// 循环判断匹配
|
||||
for (String strPackage : basePackage.split(splitor)) {
|
||||
|
@ -26,6 +26,7 @@ public class DataSourceInitStartListener implements ApplicationListener<Applicat
|
||||
datasourceService.initDsCheckJob();
|
||||
dataSetTableService.updateDatasetTableStatus();
|
||||
engineService.initSimpleEngine();
|
||||
datasourceService.updateDemoDs();
|
||||
CacheUtils.removeAll("ENGINE");
|
||||
}
|
||||
|
||||
|
@ -16,19 +16,20 @@ import io.dataease.plugins.xpack.auth.dto.request.XpackSysAuthRequest;
|
||||
import io.dataease.plugins.xpack.auth.dto.response.XpackSysAuthDetail;
|
||||
import io.dataease.plugins.xpack.auth.dto.response.XpackSysAuthDetailDTO;
|
||||
import io.dataease.plugins.xpack.auth.dto.response.XpackVAuthModelDTO;
|
||||
import io.dataease.plugins.xpack.auth.service.AuthXpackService;
|
||||
import io.dataease.service.datasource.DatasourceService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import io.dataease.plugins.xpack.auth.service.AuthXpackService;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@ApiIgnore
|
||||
@Api(tags = "xpack:权限管理")
|
||||
@RequestMapping("/plugin/auth")
|
||||
@RestController
|
||||
public class XAuthServer {
|
||||
@ -41,6 +42,7 @@ public class XAuthServer {
|
||||
@RequiresPermissions("auth:read")
|
||||
@PostMapping("/authModels")
|
||||
@I18n
|
||||
@ApiOperation("根据类型查询权限树")
|
||||
public List<XpackVAuthModelDTO> authModels(@RequestBody XpackBaseTreeRequest request) {
|
||||
AuthXpackService sysAuthService = SpringContextUtil.getBean(AuthXpackService.class);
|
||||
CurrentUserDto user = AuthUtils.getUser();
|
||||
@ -49,6 +51,7 @@ public class XAuthServer {
|
||||
|
||||
@RequiresPermissions("auth:read")
|
||||
@PostMapping("/authDetails")
|
||||
@ApiOperation("查询权限源目标映射关系")
|
||||
public Map<String, List<XpackSysAuthDetailDTO>> authDetails(@RequestBody XpackSysAuthRequest request) {
|
||||
AuthXpackService sysAuthService = SpringContextUtil.getBean(AuthXpackService.class);
|
||||
return sysAuthService.searchAuthDetails(request);
|
||||
@ -57,6 +60,7 @@ public class XAuthServer {
|
||||
@RequiresPermissions("auth:read")
|
||||
@GetMapping("/authDetailsModel/{authType}/{direction}")
|
||||
@I18n
|
||||
@ApiOperation("查询授权明细")
|
||||
public List<XpackSysAuthDetail> authDetailsModel(@PathVariable String authType, @PathVariable String direction) {
|
||||
AuthXpackService sysAuthService = SpringContextUtil.getBean(AuthXpackService.class);
|
||||
List<XpackSysAuthDetail> authDetails = sysAuthService.searchAuthDetailsModel(authType);
|
||||
@ -72,6 +76,7 @@ public class XAuthServer {
|
||||
|
||||
@RequiresPermissions("auth:read")
|
||||
@PostMapping("/authChange")
|
||||
@ApiOperation("变更授权信息")
|
||||
public void authChange(@RequestBody XpackSysAuthRequest request) {
|
||||
AuthXpackService sysAuthService = SpringContextUtil.getBean(AuthXpackService.class);
|
||||
CurrentUserDto user = AuthUtils.getUser();
|
||||
@ -157,17 +162,18 @@ public class XAuthServer {
|
||||
}
|
||||
|
||||
@GetMapping("/getDatasourceTypes")
|
||||
public List<DatasourceBaseType> getDatasourceTypes(){
|
||||
Collection<DataSourceType> activeType = datasourceService.types();
|
||||
Map<String,String> activeTypeMap = activeType.stream().collect(Collectors.toMap(DataSourceType::getType, DataSourceType::getName));
|
||||
activeTypeMap.put("all","所有数据源");
|
||||
@ApiOperation("查询授权的数据类型")
|
||||
public List<DatasourceBaseType> getDatasourceTypes() {
|
||||
Collection<DataSourceType> activeType = datasourceService.types();
|
||||
Map<String, String> activeTypeMap = activeType.stream().collect(Collectors.toMap(DataSourceType::getType, DataSourceType::getName));
|
||||
activeTypeMap.put("all", "所有数据源");
|
||||
AuthXpackService sysAuthService = SpringContextUtil.getBean(AuthXpackService.class);
|
||||
List<DatasourceBaseType> presentTypes = sysAuthService.getDatasourceTypes();
|
||||
presentTypes.stream().forEach(datasourceBaseType -> {
|
||||
if(activeTypeMap.get(datasourceBaseType.getType())!=null){
|
||||
if (activeTypeMap.get(datasourceBaseType.getType()) != null) {
|
||||
datasourceBaseType.setName(activeTypeMap.get(datasourceBaseType.getType()));
|
||||
}
|
||||
});
|
||||
return presentTypes;
|
||||
return presentTypes;
|
||||
}
|
||||
}
|
||||
|
@ -155,7 +155,10 @@ public class DorisQueryProvider extends QueryProvider {
|
||||
STGroup stg = new STGroupFile(SQLConstants.SQL_TEMPLATE);
|
||||
ST st_sql = stg.getInstanceOf("previewSql");
|
||||
st_sql.add("isGroup", isGroup);
|
||||
if (CollectionUtils.isNotEmpty(xFields)) st_sql.add("groups", xFields);
|
||||
if (CollectionUtils.isNotEmpty(xFields)) {
|
||||
st_sql.add("useAliasForGroup", true);
|
||||
st_sql.add("groups", xFields);
|
||||
}
|
||||
if (ObjectUtils.isNotEmpty(tableObj)) st_sql.add("table", tableObj);
|
||||
String customWheres = transCustomFilterList(tableObj, fieldCustomFilter);
|
||||
// row permissions tree
|
||||
@ -345,7 +348,10 @@ public class DorisQueryProvider extends QueryProvider {
|
||||
|
||||
STGroup stg = new STGroupFile(SQLConstants.SQL_TEMPLATE);
|
||||
ST st_sql = stg.getInstanceOf("querySql");
|
||||
if (CollectionUtils.isNotEmpty(xFields)) st_sql.add("groups", xFields);
|
||||
if (CollectionUtils.isNotEmpty(xFields)) {
|
||||
st_sql.add("useAliasForGroup", true);
|
||||
st_sql.add("groups", xFields);
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(yFields)) st_sql.add("aggregators", yFields);
|
||||
if (CollectionUtils.isNotEmpty(wheres)) st_sql.add("filters", wheres);
|
||||
if (ObjectUtils.isNotEmpty(tableObj)) st_sql.add("table", tableObj);
|
||||
@ -435,7 +441,10 @@ public class DorisQueryProvider extends QueryProvider {
|
||||
STGroup stg = new STGroupFile(SQLConstants.SQL_TEMPLATE);
|
||||
ST st_sql = stg.getInstanceOf("previewSql");
|
||||
st_sql.add("isGroup", false);
|
||||
if (CollectionUtils.isNotEmpty(xFields)) st_sql.add("groups", xFields);
|
||||
if (CollectionUtils.isNotEmpty(xFields)) {
|
||||
st_sql.add("useAliasForGroup", true);
|
||||
st_sql.add("groups", xFields);
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(wheres)) st_sql.add("filters", wheres);
|
||||
if (ObjectUtils.isNotEmpty(tableObj)) st_sql.add("table", tableObj);
|
||||
String sql = st_sql.render();
|
||||
@ -558,7 +567,10 @@ public class DorisQueryProvider extends QueryProvider {
|
||||
|
||||
STGroup stg = new STGroupFile(SQLConstants.SQL_TEMPLATE);
|
||||
ST st_sql = stg.getInstanceOf("querySql");
|
||||
if (CollectionUtils.isNotEmpty(xFields)) st_sql.add("groups", xFields);
|
||||
if (CollectionUtils.isNotEmpty(xFields)) {
|
||||
st_sql.add("useAliasForGroup", true);
|
||||
st_sql.add("groups", xFields);
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(yFields)) st_sql.add("aggregators", yFields);
|
||||
if (CollectionUtils.isNotEmpty(wheres)) st_sql.add("filters", wheres);
|
||||
if (ObjectUtils.isNotEmpty(tableObj)) st_sql.add("table", tableObj);
|
||||
@ -672,7 +684,10 @@ public class DorisQueryProvider extends QueryProvider {
|
||||
|
||||
STGroup stg = new STGroupFile(SQLConstants.SQL_TEMPLATE);
|
||||
ST st_sql = stg.getInstanceOf("querySql");
|
||||
if (CollectionUtils.isNotEmpty(xFields)) st_sql.add("groups", xFields);
|
||||
if (CollectionUtils.isNotEmpty(xFields)) {
|
||||
st_sql.add("useAliasForGroup", true);
|
||||
st_sql.add("groups", xFields);
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(yFields)) st_sql.add("aggregators", yFields);
|
||||
if (CollectionUtils.isNotEmpty(wheres)) st_sql.add("filters", wheres);
|
||||
if (ObjectUtils.isNotEmpty(tableObj)) st_sql.add("table", tableObj);
|
||||
|
@ -1147,8 +1147,8 @@ public class DataSetTableService {
|
||||
subSelect.setAlias(new Alias(rightItem.getAlias().toString(), false));
|
||||
}
|
||||
join.setRightItem(subSelect);
|
||||
joinsList.add(join);
|
||||
}
|
||||
joinsList.add(join);
|
||||
}
|
||||
plainSelect.setJoins(joinsList);
|
||||
}
|
||||
|
@ -63,6 +63,8 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.*;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
@ -646,4 +648,22 @@ public class DatasourceService {
|
||||
addJob(basicInfo.getDsCheckIntervalType(), Integer.valueOf(basicInfo.getDsCheckInterval()));
|
||||
}
|
||||
|
||||
public void updateDemoDs() {
|
||||
Datasource datasource = datasourceMapper.selectByPrimaryKey("76026997-94f9-4a35-96ca-151084638969");
|
||||
MysqlConfiguration mysqlConfiguration = new Gson().fromJson(datasource.getConfiguration(), MysqlConfiguration.class);
|
||||
Pattern WITH_SQL_FRAGMENT = Pattern.compile("jdbc:mysql://(.*):(\\d+)/(.*)");
|
||||
Matcher matcher = WITH_SQL_FRAGMENT.matcher(env.getProperty("spring.datasource.url"));
|
||||
if (!matcher.find()) {
|
||||
return;
|
||||
}
|
||||
mysqlConfiguration.setHost(matcher.group(1));
|
||||
mysqlConfiguration.setPort(Integer.valueOf(matcher.group(2)));
|
||||
mysqlConfiguration.setDataBase(matcher.group(3).split("\\?")[0]);
|
||||
mysqlConfiguration.setExtraParams(matcher.group(3).split("\\?")[1]);
|
||||
mysqlConfiguration.setUsername(env.getProperty("spring.datasource.username"));
|
||||
mysqlConfiguration.setPassword(env.getProperty("spring.datasource.password"));
|
||||
datasource.setConfiguration(new Gson().toJson(mysqlConfiguration));
|
||||
datasourceMapper.updateByPrimaryKeyWithBLOBs(datasource);
|
||||
}
|
||||
|
||||
}
|
||||
|
4
backend/src/main/resources/db/migration/V50__1.18.3.sql
Normal file
4
backend/src/main/resources/db/migration/V50__1.18.3.sql
Normal file
@ -0,0 +1,4 @@
|
||||
UPDATE `my_plugin`
|
||||
SET `version` = '1.18.3'
|
||||
where `plugin_id` > 0
|
||||
and `version` = '1.18.2';
|
@ -279,5 +279,17 @@
|
||||
diskPersistent="false"
|
||||
/>
|
||||
|
||||
<cache
|
||||
name="sys_token_store_delay"
|
||||
eternal="false"
|
||||
maxElementsInMemory="100"
|
||||
maxElementsOnDisk="3000"
|
||||
overflowToDisk="true"
|
||||
diskPersistent="false"
|
||||
timeToIdleSeconds="3"
|
||||
timeToLiveSeconds="5"
|
||||
memoryStoreEvictionPolicy="LRU"
|
||||
/>
|
||||
|
||||
|
||||
</ehcache>
|
@ -1,4 +1,4 @@
|
||||
querySql(limitFiled, groups, aggregators, filters, orders, table, notUseAs)
|
||||
querySql(limitFiled, groups, aggregators, filters, orders, table, notUseAs, useAliasForGroup)
|
||||
::=<<
|
||||
SELECT
|
||||
<if(limitFiled)>
|
||||
@ -23,10 +23,14 @@ FROM
|
||||
WHERE
|
||||
<filters:{filter|<if(filter)><filter><endif>}; separator="\nAND ">
|
||||
<endif>
|
||||
<if(groups)>
|
||||
<if(groups && !useAliasForGroup)>
|
||||
GROUP BY
|
||||
<groups:{group|<if(group)><group.fieldName><endif>}; separator=",\n">
|
||||
<endif>
|
||||
<if(groups && useAliasForGroup)>
|
||||
GROUP BY
|
||||
<groups:{group|<if(group)><group.fieldAlias><endif>}; separator=",\n">
|
||||
<endif>
|
||||
<if(orders)>
|
||||
ORDER BY
|
||||
<orders:{order|<if(order)><order.orderAlias> <order.orderDirection><endif>}; separator=",\n">
|
||||
@ -34,7 +38,7 @@ ORDER BY
|
||||
>>
|
||||
|
||||
|
||||
previewSql(limitFiled, groups, aggregators, filters, orders, table, isGroup, notUseAs)
|
||||
previewSql(limitFiled, groups, aggregators, filters, orders, table, isGroup, notUseAs, useAliasForGroup)
|
||||
::=<<
|
||||
SELECT
|
||||
<if(limitFiled)>
|
||||
@ -59,10 +63,14 @@ FROM
|
||||
WHERE
|
||||
<filters:{filter|<if(filter)><filter><endif>}; separator="\nAND ">
|
||||
<endif>
|
||||
<if(isGroup && groups)>
|
||||
<if(groups && !useAliasForGroup)>
|
||||
GROUP BY
|
||||
<groups:{group|<if(group)><group.fieldName><endif>}; separator=",\n">
|
||||
<endif>
|
||||
<if(groups && useAliasForGroup)>
|
||||
GROUP BY
|
||||
<groups:{group|<if(group)><group.fieldAlias><endif>}; separator=",\n">
|
||||
<endif>
|
||||
<if(orders)>
|
||||
ORDER BY
|
||||
<orders:{order|<if(order)><order.orderAlias> <order.orderDirection><endif>}; separator=",\n">
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "dataease",
|
||||
"version": "1.18.2",
|
||||
"version": "1.18.3",
|
||||
"description": "dataease front",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
|
@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<artifactId>dataease-server</artifactId>
|
||||
<groupId>io.dataease</groupId>
|
||||
<version>1.18.2</version>
|
||||
<version>1.18.3</version>
|
||||
</parent>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
@ -1,7 +1,7 @@
|
||||
import axios from 'axios'
|
||||
import store from '@/store'
|
||||
import { $alert, $error } from './message'
|
||||
import { getToken, getIdToken } from '@/utils/auth'
|
||||
import { getToken, getIdToken, setToken } from '@/utils/auth'
|
||||
import Config from '@/settings'
|
||||
import i18n from '@/lang'
|
||||
import { tryShowLoading, tryHideLoading } from './loading'
|
||||
@ -157,6 +157,7 @@ const checkAuth = response => {
|
||||
// token到期后自动续命 刷新token
|
||||
if (response.headers[RefreshTokenKey]) {
|
||||
const refreshToken = response.headers[RefreshTokenKey]
|
||||
setToken(refreshToken)
|
||||
store.dispatch('user/refreshToken', refreshToken)
|
||||
}
|
||||
|
||||
|
@ -67,8 +67,8 @@
|
||||
>
|
||||
{{ $t('chart.total') }}
|
||||
<span>{{
|
||||
(chart.datasetMode === 0 && !not_support_page_dataset.includes(chart.datasourceType)) ? chart.totalItems : ((chart.data && chart.data.tableRow) ? chart.data.tableRow.length : 0)
|
||||
}}</span>
|
||||
(chart.datasetMode === 0 && !not_support_page_dataset.includes(chart.datasourceType)) ? chart.totalItems : ((chart.data && chart.data.tableRow) ? chart.data.tableRow.length : 0)
|
||||
}}</span>
|
||||
{{ $t('chart.items') }}
|
||||
</span>
|
||||
<de-pagination
|
||||
@ -339,7 +339,7 @@ export default {
|
||||
if (this.chart.type === 'table-pivot') {
|
||||
rowData = { ...meta.rowQuery, ...meta.colQuery }
|
||||
rowData[meta.valueField] = meta.fieldValue
|
||||
} else if (this.showPage) {
|
||||
} else if (this.showPage && (this.chart.datasetMode === 1 || (this.chart.datasetMode === 0 && this.not_support_page_dataset.includes(this.chart.datasourceType)))) {
|
||||
const rowIndex = (this.currentPage.page - 1) * this.currentPage.pageSize + meta.rowIndex
|
||||
rowData = this.chart.data.tableRow[rowIndex]
|
||||
} else {
|
||||
|
@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<artifactId>dataease-server</artifactId>
|
||||
<groupId>io.dataease</groupId>
|
||||
<version>1.18.2</version>
|
||||
<version>1.18.3</version>
|
||||
</parent>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
Loading…
Reference in New Issue
Block a user