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

This commit is contained in:
ulleo 2024-01-25 16:27:16 +08:00
commit b82e4f2863
29 changed files with 206 additions and 132 deletions

View File

@ -370,6 +370,9 @@ public class ExcelXlsReader implements HSSFListener {
private String checkType(String str, int thisColumn) {
if (str.length() > 19) {
return "TEXT";
}
String type = null;
try {
double d = Double.valueOf(str);

View File

@ -5,16 +5,17 @@ import com.auth0.jwt.interfaces.DecodedJWT;
import io.dataease.auth.filter.F2CLinkFilter;
import io.dataease.commons.constants.SysLogConstants;
import io.dataease.commons.utils.DeLogUtils;
import io.dataease.plugins.common.base.domain.PanelGroupWithBLOBs;
import io.dataease.plugins.common.base.domain.PanelLink;
import io.dataease.controller.panel.api.LinkApi;
import io.dataease.controller.request.chart.ChartExtRequest;
import io.dataease.controller.request.panel.link.*;
import io.dataease.dto.panel.link.GenerateDto;
import io.dataease.dto.panel.link.ValidateDto;
import io.dataease.plugins.common.base.domain.PanelGroupWithBLOBs;
import io.dataease.plugins.common.base.domain.PanelLink;
import io.dataease.service.chart.ChartViewService;
import io.dataease.service.panel.PanelLinkService;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
@ -25,6 +26,7 @@ import org.springframework.web.context.request.ServletRequestAttributes;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.net.URLDecoder;
import java.nio.charset.StandardCharsets;
import java.util.Map;
@RestController
@ -65,22 +67,32 @@ public class LinkServer implements LinkApi {
@Override
public ValidateDto validate(@RequestBody LinkValidateRequest request) throws Exception {
String link = request.getLink();
link = URLDecoder.decode(link, "UTF-8");
link = URLDecoder.decode(link, StandardCharsets.UTF_8);
String json = panelLinkService.decryptParam(link);
String[] jsonArray = json.split(",");
String uuid = null;
int len = jsonArray.length;
if (len > 1) {
uuid = jsonArray[1];
}
String user = request.getUser();
user = URLDecoder.decode(user, "UTF-8");
user = URLDecoder.decode(user, StandardCharsets.UTF_8);
user = panelLinkService.decryptParam(user);
ValidateDto dto = new ValidateDto();
dto.setUserId(user);
String resourceId = json;
String resourceId = jsonArray[0];
PanelLink one = panelLinkService.findOne(resourceId, Long.valueOf(user));
dto.setResourceId(resourceId);
if (ObjectUtils.isEmpty(one)) {
dto.setValid(false);
return dto;
}
String mappingUuid = panelLinkService.getMappingUuid(one);
if (!StringUtils.equals(uuid, mappingUuid)) {
dto.setValid(false);
return dto;
}
dto.setValid(one.getValid());
dto.setEnablePwd(one.getEnablePwd());
dto.setPassPwd(panelLinkService.validateHeads(one));
@ -94,8 +106,8 @@ public class LinkServer implements LinkApi {
}
@Override
public Object resourceDetail(@PathVariable String resourceId,@PathVariable String userId) {
return panelLinkService.resourceInfo(resourceId,userId);
public Object resourceDetail(@PathVariable String resourceId, @PathVariable String userId) {
return panelLinkService.resourceInfo(resourceId, userId);
}
@Override
@ -125,7 +137,7 @@ public class LinkServer implements LinkApi {
operateType = SysLogConstants.OPERATE_TYPE.MB_VIEW;
}
if (ObjectUtils.isEmpty(userId)) return;
PanelGroupWithBLOBs panelGroupWithBLOBs = panelLinkService.resourceInfo(panelId,String.valueOf(userId));
PanelGroupWithBLOBs panelGroupWithBLOBs = panelLinkService.resourceInfo(panelId, String.valueOf(userId));
String pid = panelGroupWithBLOBs.getPid();
DeLogUtils.save(operateType, SysLogConstants.SOURCE_TYPE.LINK, panelId, pid, userId, SysLogConstants.SOURCE_TYPE.USER);
}

View File

@ -3,17 +3,15 @@
<mapper namespace="io.dataease.ext.MobileDirMapper">
<select id="query" resultType="io.dataease.mobile.entity.PanelEntity">
SELECT
id,
NAME AS text,
pid,
node_type AS `type`
FROM
panel_group g,
( SELECT GET_V_AUTH_MODEL_ID_P_USE_MOBILE ( #{userId}, 'panel' ) cids ) t
WHERE
g.pid = #{pid}
AND FIND_IN_SET( g.id, cids )
SELECT id,
NAME AS text,
pid,
node_type AS `type`
FROM panel_group g,
(SELECT GET_V_AUTH_MODEL_ID_P_USE_MOBILE(#{userId}, 'panel') cids) t
WHERE g.pid = #{pid}
AND FIND_IN_SET(g.id, cids)
ORDER BY g.panel_sort desc, CONVERT(g.name using gbk)
</select>
<select id="queryWithName" resultType="io.dataease.mobile.entity.PanelEntity">
@ -26,35 +24,34 @@
panel_group g,
( SELECT GET_V_AUTH_MODEL_ID_P_USE_MOBILE ( #{userId}, 'panel' ) cids ) t
WHERE
FIND_IN_SET( g.id, cids )
<if test="name != null">
and name like CONCAT('%', #{name, jdbcType=VARCHAR}, '%')
</if>
FIND_IN_SET( g.id, cids )
<if test="name != null">
and name like CONCAT('%', #{name, jdbcType=VARCHAR}, '%')
</if>
ORDER BY g.panel_sort desc, CONVERT(g.name using gbk)
</select>
<select id="idsWithUser" resultType="java.lang.String">
select a.auth_source
from sys_auth a
left join sys_auth_detail d on a.id = d.auth_id
where
a.auth_target_type = 'user' and
a.auth_target = #{userId} and
a.auth_source_type = 'panel' and
d.privilege_type = 1 and
d.privilege_value = 1
left join sys_auth_detail d on a.id = d.auth_id
where a.auth_target_type = 'user'
and a.auth_target = #{userId}
and a.auth_source_type = 'panel'
and d.privilege_type = 1
and d.privilege_value = 1
</select>
<select id="idsWithDept" resultType="java.lang.String">
select a.auth_source
from sys_auth a
left join sys_auth_detail d on a.id = d.auth_id
where
a.auth_target_type = 'dept' and
a.auth_target = #{deptId} and
a.auth_source_type = 'panel' and
d.privilege_type = 1 and
d.privilege_value = 1
left join sys_auth_detail d on a.id = d.auth_id
where a.auth_target_type = 'dept'
and a.auth_target = #{deptId}
and a.auth_source_type = 'panel'
and d.privilege_type = 1
and d.privilege_value = 1
</select>
<select id="idsWithRoles" resultType="java.lang.String">
@ -62,20 +59,16 @@
from sys_auth a
left join sys_auth_detail d on a.id = d.auth_id
where
a.auth_target_type = 'role' and
a.auth_target in
<foreach collection="roleIds" item="roleId" open='(' separator=',' close=')'>
#{roleId}
</foreach>
and
a.auth_source_type = 'panel' and
d.privilege_type = 1 and
d.privilege_value = 1
a.auth_target_type = 'role' and
a.auth_target in
<foreach collection="roleIds" item="roleId" open='(' separator=',' close=')'>
#{roleId}
</foreach>
and
a.auth_source_type = 'panel' and
d.privilege_type = 1 and
d.privilege_value = 1
</select>
</mapper>

View File

@ -63,15 +63,15 @@ public class DorisDDLProvider extends DDLProviderImpl {
}
}
sql = sql.replace("`UNIQUE_KEY`", "`" + String.join("`, `", keys) + "`")
.replace("DISTRIBUTED_BY_HASH", keys.get(0)).replace("Column_Fields", createDorisTableColumnSql(datasetTableFields, version));
.replace("DISTRIBUTED_BY_HASH", keys.get(0)).replace("Column_Fields", createDorisTableColumnSql(datasetTableFields, version, keys));
} else {
sql = sql.replace("UNIQUE_KEY", "dataease_uuid").replace("DISTRIBUTED_BY_HASH", "dataease_uuid").replace("Column_Fields", createDorisTableColumnSql(datasetTableFields, version));
sql = sql.replace("UNIQUE_KEY", "dataease_uuid").replace("DISTRIBUTED_BY_HASH", "dataease_uuid").replace("Column_Fields", createDorisTableColumnSql(datasetTableFields, version, null));
}
return sql;
}
private String createDorisTableColumnSql(final List<DatasetTableField> datasetTableFields, String version) {
private String createDorisTableColumnSql(final List<DatasetTableField> datasetTableFields, String version, List<String> keys) {
StringBuilder Column_Fields = new StringBuilder("`");
for (DatasetTableField datasetTableField : datasetTableFields) {
Column_Fields.append(datasetTableField.getDataeaseName()).append("` ");
@ -81,11 +81,14 @@ public class DorisDDLProvider extends DDLProviderImpl {
}
switch (datasetTableField.getDeExtractType()) {
case 0:
Column_Fields.append("STRING".replace("length", String.valueOf(size))).append(",`");
if (size <= 65533 || (keys != null && keys.contains(datasetTableField.getDataeaseName()))) {
Column_Fields.append("VARCHAR(length)".replace("length", String.valueOf(size))).append(",`");
} else {
Column_Fields.append("STRING".replace("length", String.valueOf(size))).append(",`");
}
break;
case 1:
size = size < 50 ? 50 : size;
Column_Fields.append("STRING".replace("length", String.valueOf(size))).append(",`");
Column_Fields.append("DATETIME").append(",`");
break;
case 2:
Column_Fields.append("bigint").append(",`");
@ -99,7 +102,7 @@ public class DorisDDLProvider extends DDLProviderImpl {
}
} else {
Column_Fields.append("DOUBLE").append(",`");
Column_Fields.append("DECIMAL(27,8)").append(",`");
}
break;
case 4:

View File

@ -437,10 +437,10 @@ public class SqlserverQueryProvider extends QueryProvider {
@Override
public String getSQLTableInfo(String table, List<ChartViewFieldDTO> xAxis, FilterTreeObj fieldCustomFilter, List<DataSetRowPermissionsTreeDTO> rowPermissionsTree, List<ChartExtFilterRequest> extFilterRequestList, Datasource ds, ChartViewWithBLOBs view) {
return originTableInfo(table, xAxis, fieldCustomFilter, rowPermissionsTree, extFilterRequestList, ds, view, true, true);
return originTableInfo(table, xAxis, fieldCustomFilter, rowPermissionsTree, extFilterRequestList, ds, view, true, true, false);
}
public String originTableInfo(String table, List<ChartViewFieldDTO> xAxis, FilterTreeObj fieldCustomFilter, List<DataSetRowPermissionsTreeDTO> rowPermissionsTree, List<ChartExtFilterRequest> extFilterRequestList, Datasource ds, ChartViewWithBLOBs view, boolean needOrder, boolean needResultCount) {
public String originTableInfo(String table, List<ChartViewFieldDTO> xAxis, FilterTreeObj fieldCustomFilter, List<DataSetRowPermissionsTreeDTO> rowPermissionsTree, List<ChartExtFilterRequest> extFilterRequestList, Datasource ds, ChartViewWithBLOBs view, boolean needOrder, boolean needResultCount, boolean ignoreOrder) {
SQLObj tableObj = SQLObj.builder()
.tableName((table.startsWith("(") && table.endsWith(")")) ? table : String.format(SqlServerSQLConstants.KEYWORD_TABLE, table))
.tableAlias(String.format(TABLE_ALIAS_PREFIX, 0))
@ -494,13 +494,15 @@ public class SqlserverQueryProvider extends QueryProvider {
groups.addAll(xFields);
// 外层再次套sql
List<SQLObj> orders = new ArrayList<>();
orders.addAll(xOrders);
if (needOrder && CollectionUtils.isEmpty(xOrders)) {
orders.add(SQLObj.builder()
.orderField(String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, 0))
.orderAlias(String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, 0))
.orderDirection("ASC")
.build());
if (!ignoreOrder) {
orders.addAll(xOrders);
if (needOrder && CollectionUtils.isEmpty(xOrders)) {
orders.add(SQLObj.builder()
.orderField(String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, 0))
.orderAlias(String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, 0))
.orderDirection("ASC")
.build());
}
}
STGroup stg = new STGroupFile(SQLConstants.SQL_TEMPLATE);
@ -526,8 +528,8 @@ public class SqlserverQueryProvider extends QueryProvider {
return st.render();
}
public String originSQLAsTmpTableInfo(String sql, List<ChartViewFieldDTO> xAxis, FilterTreeObj fieldCustomFilter, List<DataSetRowPermissionsTreeDTO> rowPermissionsTree, List<ChartExtFilterRequest> extFilterRequestList, Datasource ds, ChartViewWithBLOBs view, boolean needOrder) {
return originTableInfo("(" + sqlFix(sql) + ")", xAxis, fieldCustomFilter, rowPermissionsTree, extFilterRequestList, null, view, needOrder, true);
public String originSQLAsTmpTableInfo(String sql, List<ChartViewFieldDTO> xAxis, FilterTreeObj fieldCustomFilter, List<DataSetRowPermissionsTreeDTO> rowPermissionsTree, List<ChartExtFilterRequest> extFilterRequestList, Datasource ds, ChartViewWithBLOBs view, boolean needOrder, boolean ignoreOrder) {
return originTableInfo("(" + sqlFix(sql) + ")", xAxis, fieldCustomFilter, rowPermissionsTree, extFilterRequestList, null, view, needOrder, true, ignoreOrder);
}
public String getSQLWithPage(boolean isTable, String sql, List<ChartViewFieldDTO> xAxis, FilterTreeObj fieldCustomFilter, List<DataSetRowPermissionsTreeDTO> rowPermissionsTree, List<ChartExtFilterRequest> extFilterRequestList, Datasource ds, ChartViewWithBLOBs view, PageInfo pageInfo) {
@ -541,9 +543,9 @@ public class SqlserverQueryProvider extends QueryProvider {
boolean isPage = (pageInfo.getGoPage() != null && pageInfo.getPageSize() != null);
String limit = (isPage ? " OFFSET " + (pageInfo.getGoPage() - 1) * pageInfo.getPageSize() + " ROW FETCH NEXT " + pageInfo.getPageSize() + " ROW ONLY " : "");
if (isTable) {
return originTableInfo(sql, xAxis, fieldCustomFilter, rowPermissionsTree, extFilterRequestList, ds, view, true, !isPage) + limit;
return originTableInfo(sql, xAxis, fieldCustomFilter, rowPermissionsTree, extFilterRequestList, ds, view, true, !isPage, false) + limit;
} else {
return originTableInfo("(" + sqlFix(sql) + ")", xAxis, fieldCustomFilter, rowPermissionsTree, extFilterRequestList, ds, view, true, !isPage) + limit;
return originTableInfo("(" + sqlFix(sql) + ")", xAxis, fieldCustomFilter, rowPermissionsTree, extFilterRequestList, ds, view, true, !isPage, false) + limit;
}
}
}
@ -1788,9 +1790,9 @@ public class SqlserverQueryProvider extends QueryProvider {
@Override
public String getResultCount(boolean isTable, String sql, List<ChartViewFieldDTO> xAxis, FilterTreeObj fieldCustomFilter, List<DataSetRowPermissionsTreeDTO> rowPermissionsTree, List<ChartExtFilterRequest> extFilterRequestList, Datasource ds, ChartViewWithBLOBs view) {
if (isTable) {
return "SELECT COUNT(*) AS count from (" + originTableInfo(sql, xAxis, fieldCustomFilter, rowPermissionsTree, extFilterRequestList, ds, view, false, true) + ") COUNT_TEMP";
return "SELECT COUNT(*) AS count from (" + originTableInfo(sql, xAxis, fieldCustomFilter, rowPermissionsTree, extFilterRequestList, ds, view, false, true, true) + ") COUNT_TEMP";
} else {
return "SELECT COUNT(*) AS count from (" + originSQLAsTmpTableInfo(sql, xAxis, fieldCustomFilter, rowPermissionsTree, extFilterRequestList, ds, view, false) + ") COUNT_TEMP";
return "SELECT COUNT(*) AS count from (" + originSQLAsTmpTableInfo(sql, xAxis, fieldCustomFilter, rowPermissionsTree, extFilterRequestList, ds, view, false, true) + ") COUNT_TEMP";
}
}
}

View File

@ -2949,6 +2949,9 @@ public class DataSetTableService {
}
private String cellType(String value) {
if (value.length() > 19) {
return "TEXT";
}
try {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
sdf.parse(value);

View File

@ -449,6 +449,7 @@ public class ExtractDataService {
datasetTableField.setDeExtractType(0);
datasetTableField.setDataeaseName("dataease_uuid");
datasetTableField.setOriginName("dataease_uuid");
datasetTableField.setSize(0);
datasetTableFields.add(0, datasetTableField);
return datasetTableFields;
}
@ -479,9 +480,10 @@ public class ExtractDataService {
}
private void extractApiData(DatasetTable datasetTable, Datasource datasource, List<DatasetTableField> datasetTableFields, String extractType) throws Exception {
DataTableInfoDTO dataTableInfoDTO = new Gson().fromJson(datasetTable.getInfo(), DataTableInfoDTO.class);
List<ApiDefinition> lists = new Gson().fromJson(datasource.getConfiguration(), new TypeToken<ArrayList<ApiDefinition>>() {
}.getType());
lists = lists.stream().filter(item -> item.getName().equalsIgnoreCase(new Gson().fromJson(datasetTable.getInfo(), DataTableInfoDTO.class).getTable())).collect(Collectors.toList());
lists = lists.stream().filter(item -> item.getName().equalsIgnoreCase(dataTableInfoDTO.getTable())).collect(Collectors.toList());
if (CollectionUtils.isEmpty(lists)) {
throw new Exception("未找到API数据表");
}
@ -521,15 +523,16 @@ public class ExtractDataService {
script = String.format(streamLoadScript, dorisConfiguration.getUsername(), dorisConfiguration.getPassword(), System.currentTimeMillis(), separator, columns, "APPEND", dataFile, dorisConfiguration.getHost(), dorisConfiguration.getHttpPort(), dorisConfiguration.getDataBase(), TableUtils.tableName(datasetTable.getId()), dataFile);
break;
}
BufferedWriter bw = new BufferedWriter(new FileWriter(dataFile));
for (String[] strings : dataList) {
String content = "";
for (int i = 0; i < strings.length; i++) {
content = content + strings[i] + separator;
content = i != strings.length - 1 ? content + strings[i] + separator : content + strings[i];
}
boolean isSetKey = dataTableInfoDTO.isSetKey() && CollectionUtils.isNotEmpty(dataTableInfoDTO.getKeys());
if (!isSetKey) {
content = Md5Utils.md5(content) + separator + content;
}
content = content + Md5Utils.md5(content);
bw.write(content);
bw.newLine();
}
@ -565,8 +568,8 @@ public class ExtractDataService {
} catch (Exception e) {
throw e;
} finally {
File deleteFile = new File(root_path + datasetTable.getId() + ".sh");
FileUtils.forceDelete(deleteFile);
// File deleteFile = new File(root_path + datasetTable.getId() + ".sh");
// FileUtils.forceDelete(deleteFile);
}
}

View File

@ -520,8 +520,7 @@ public class DatasourceService {
}
public ApiDefinition checkApiDatasource(ApiDefinition apiDefinition) throws Exception {
BasicInfo basicInfo = systemParameterService.basicInfo();
String response = ApiProvider.execHttpRequest(apiDefinition, StringUtils.isNotBlank(basicInfo.getFrontTimeOut()) ? Integer.parseInt(basicInfo.getFrontTimeOut()) : 10);
String response = ApiProvider.execHttpRequest(apiDefinition, apiDefinition.getApiQueryTimeout() == null || apiDefinition.getApiQueryTimeout() <= 0 ? 30 : apiDefinition.getApiQueryTimeout());
return ApiProvider.checkApiDefinition(apiDefinition, response);
}

View File

@ -4,7 +4,10 @@ import io.dataease.auth.config.RsaProperties;
import io.dataease.auth.util.JWTUtils;
import io.dataease.auth.util.RsaUtil;
import io.dataease.commons.constants.SysLogConstants;
import io.dataease.commons.utils.*;
import io.dataease.commons.utils.AuthUtils;
import io.dataease.commons.utils.CodingUtil;
import io.dataease.commons.utils.DeLogUtils;
import io.dataease.commons.utils.ServletUtils;
import io.dataease.controller.request.panel.link.EnablePwdRequest;
import io.dataease.controller.request.panel.link.LinkRequest;
import io.dataease.controller.request.panel.link.OverTimeRequest;
@ -127,6 +130,16 @@ public class PanelLinkService {
}
}
public String getMappingUuid(PanelLink link) {
String resourceId = link.getResourceId();
Long userId = link.getUserId();
PanelLinkMappingExample example = new PanelLinkMappingExample();
example.createCriteria().andResourceIdEqualTo(resourceId).andUserIdEqualTo(userId);
List<PanelLinkMapping> mappings = panelLinkMappingMapper.selectByExample(example);
if (CollectionUtils.isNotEmpty(mappings)) return mappings.get(0).getUuid();
return null;
}
@Transactional
public GenerateDto currentGenerate(String resourceId) {
PanelLink one = findOne(resourceId, AuthUtils.getUser().getUserId());
@ -143,14 +156,17 @@ public class PanelLinkService {
PanelLinkMappingExample example = new PanelLinkMappingExample();
example.createCriteria().andResourceIdEqualTo(resourceId).andUserIdEqualTo(AuthUtils.getUser().getUserId());
List<PanelLinkMapping> mappings = panelLinkMappingMapper.selectByExample(example);
PanelLinkMapping mapping = null;
if (CollectionUtils.isEmpty(mappings)) {
PanelLinkMapping mapping = new PanelLinkMapping();
mapping = new PanelLinkMapping();
mapping.setResourceId(resourceId);
mapping.setUserId(AuthUtils.getUser().getUserId());
mapping.setUuid(CodingUtil.shortUuid());
panelLinkMappingMapper.insert(mapping);
} else {
mapping = mappings.get(0);
}
return convertDto(one);
return convertDto(one, mapping.getUuid());
}
public void deleteByResourceId(String resourceId) {
@ -177,20 +193,24 @@ public class PanelLinkService {
return null;
}
private String buildLinkParam(PanelLink link) {
String linkParam = encrypt(link.getResourceId());
private String buildLinkParam(PanelLink link, String uuid) {
String resourceId = link.getResourceId();
if (StringUtils.isNotBlank(uuid)) {
resourceId += ("," + uuid);
}
String linkParam = encrypt(resourceId);
if (link.getUserId() != null) {
linkParam = linkParam + USERPARAM + encrypt(link.getUserId().toString());
}
return linkParam;
}
private GenerateDto convertDto(PanelLink link) {
private GenerateDto convertDto(PanelLink link, String uuid) {
GenerateDto result = new GenerateDto();
result.setValid(link.getValid());
result.setEnablePwd(link.getEnablePwd());
result.setPwd(link.getPwd());
result.setUri(BASEURL + buildLinkParam(link));
result.setUri(BASEURL + buildLinkParam(link, uuid));
result.setOverTime(link.getOverTime());
return result;
}
@ -237,8 +257,8 @@ public class PanelLinkService {
return pass;
}
public PanelGroupDTO resourceInfo(String resourceId,String userId) {
PanelGroupDTO result = extPanelGroupMapper.findOneWithPrivileges(resourceId,userId);
public PanelGroupDTO resourceInfo(String resourceId, String userId) {
PanelGroupDTO result = extPanelGroupMapper.findOneWithPrivileges(resourceId, userId);
result.setWatermarkInfo(panelWatermarkMapper.selectByPrimaryKey("system_default"));
return result;
}
@ -261,7 +281,7 @@ public class PanelLinkService {
if (StringUtils.isNotBlank(mapping.getUuid())) {
one.setResourceId("error-resource-id");
}
return convertDto(one).getUri();
return convertDto(one, mapping.getUuid()).getUri();
}
public String getUrlByUuid(String uuid) {
@ -271,12 +291,12 @@ public class PanelLinkService {
if (CollectionUtils.isEmpty(mappings)) {
PanelLink panelLink = new PanelLink();
panelLink.setResourceId("error-resource-id");
return BASEURL + buildLinkParam(panelLink);
return BASEURL + buildLinkParam(panelLink, null);
}
PanelLinkMapping mapping = mappings.get(0);
String resourceId = mapping.getResourceId();
Long userId = mapping.getUserId();
PanelLink one = findOne(resourceId, userId);
return convertDto(one).getUri();
return convertDto(one, uuid).getUri();
}
}

View File

@ -1,9 +1,12 @@
ALTER TABLE `datasource`
ALTER TABLE `datasource`
ADD COLUMN `version` varchar(255) NULL COMMENT '版本' AFTER `status`;
ALTER TABLE `sys_auth`
MODIFY COLUMN `auth_details` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '授权明细' AFTER `auth_time`;
ALTER TABLE `sys_auth`
MODIFY COLUMN `auth_details` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '授权明细' AFTER `auth_time`;
ALTER TABLE `sys_auth_detail`
MODIFY COLUMN `privilege_type` int(6) NULL DEFAULT NULL COMMENT '权限类型1 使用/查看 3 导出/管理 5 仪表板管理 15 授权' AFTER `privilege_name`,
MODIFY COLUMN `privilege_value` int(6) NULL DEFAULT NULL COMMENT '权限值1 可用 0 不可用' AFTER `privilege_type`;
ALTER TABLE `sys_auth_detail`
MODIFY COLUMN `privilege_type` int(6) NULL DEFAULT NULL COMMENT '权限类型1 使用/查看 3 导出/管理 5 仪表板管理 15 授权' AFTER `privilege_name`,
MODIFY COLUMN `privilege_value` int(6) NULL DEFAULT NULL COMMENT '权限值1 可用 0 不可用' AFTER `privilege_type`;
ALTER TABLE `sys_task_email`
MODIFY COLUMN `groups` longtext NULL COMMENT '群聊' AFTER `view_data_range`;

View File

@ -1,6 +1,6 @@
{
"name": "dataease",
"version": "1.18.14",
"version": "1.18.15",
"description": "dataease front",
"private": true,
"scripts": {

View File

@ -9,7 +9,7 @@
v-if="isPublicLink"
ref="widget-div"
class="function-div"
:class="functionClass"
:class="[{['function-back-div']: backToTopBtn},functionClass]"
>
<el-button-group size="mini">
<el-button
@ -39,8 +39,8 @@
icon-class="link-down"
/>{{ $t('panel.down') }}</span></el-button>
<el-button
id="fullscreenElement"
v-if="isPcTerminal"
id="fullscreenElement"
size="mini"
@click="toggleFullscreen"
>
@ -48,15 +48,8 @@
style="width: 12px;height: 12px"
:icon-class="fullscreenState?'public_fullscreen_exit':'public_fullscreen'"
/>{{ fullscreenState?$t('panel.fullscreen_exit'): $t('panel.fullscreen_preview') }}</span></el-button>
<el-button
v-show="backToTopBtn"
size="mini"
type="warning"
@click="backToTop"
><i class="icon iconfont icon-back-top" />{{ $t('panel.back_to_top') }}</el-button>
</el-button-group>
</div>
<div
v-else-if="existLinkage || backToTopBtn"
class="bar-main-right"
@ -75,6 +68,16 @@
@click="backToTop"
><i class="icon iconfont icon-back-top" />{{ $t('panel.back_to_top') }}</el-button>
</div>
<div
v-show="isPublicLink && backToTopBtn"
class="link-public"
>
<el-button
size="mini"
type="warning"
@click="backToTop"
><i class="icon iconfont icon-back-top" />{{ $t('panel.back_to_top') }}</el-button>
</div>
</div>
</template>
@ -131,7 +134,7 @@ export default {
return this.$route.query.fromLink === 'true'
},
containerClass() {
return this.isPublicLink ? 'trans-pc' : 'bar-main'
return this.isPublicLink && this.isPcTerminal ? 'trans-pc' : 'bar-main'
},
...mapState([
'componentData'
@ -293,4 +296,14 @@ export default {
}
}
.link-public {
top: -49px;
right: 8px;
opacity: 0.8;
position: absolute;
}
.function-back-div {
right: 100px!important;
}
</style>

View File

@ -846,6 +846,7 @@ export default {
canvasScroll() {
// 100px
this.backToTopBtnShow = this.$refs[this.previewOutRefId].scrollTop > 200
console.log('top=' + this.$refs[this.previewOutRefId].scrollTop + ';this.backToTopBtnShow=' + this.backToTopBtnShow)
bus.$emit('onScroll')
},
initListen() {

View File

@ -175,7 +175,8 @@ export default {
const range = document.createRange()
const sel = window.getSelection()
if (myDiv.childNodes) {
range.setStart(myDiv.childNodes[myDiv.childNodes.length - 1], 1)
range.setStart(myDiv.childNodes[myDiv.childNodes.length - 1]
.childNodes[myDiv.childNodes[myDiv.childNodes.length - 1].childNodes.length - 1], 1)
range.collapse(false)
sel.removeAllRanges()
sel.addRange(range)

View File

@ -250,7 +250,9 @@ export default {
const range = document.createRange()
const sel = window.getSelection()
if (myDiv.childNodes) {
range.setStart(myDiv.childNodes[myDiv.childNodes.length - 1], 1)
range.setStart(myDiv.childNodes[myDiv.childNodes.length - 1]
.childNodes[myDiv.childNodes[myDiv.childNodes.length - 1].childNodes.length - 1],
myDiv.childNodes[myDiv.childNodes.length - 1].childNodes[myDiv.childNodes[myDiv.childNodes.length - 1].childNodes.length - 1].length)
range.collapse(false)
sel.removeAllRanges()
sel.addRange(range)

View File

@ -5,6 +5,7 @@
>
<de-main-container
v-show="showChartCanvas"
v-loading="exportLoading"
style="overflow: hidden"
:element-loading-text="$t('panel.data_loading')"
element-loading-spinner="el-icon-loading"

View File

@ -554,6 +554,7 @@ export default {
if (this.isCustomSortWidget && this.element.options.attrs?.sort?.sort === 'custom') {
tempData = mergeCustomSortOption(this.element.options.attrs.sort.list, tempData)
}
this.filterInvalidValue(tempData)
return tempData.map(item => {
return {
id: item,
@ -561,6 +562,20 @@ export default {
}
})
},
filterInvalidValue(data) {
if (this.value === null) {
return
}
if (!data.length) {
this.value = null
return
}
if (this.element.options.attrs.multiple) {
this.value = this.value.filter(item => data.includes(item))
} else {
this.value = data.includes(this.value) ? this.value : null
}
},
setOptionWidth(event) {
this.onFocus = true
//

View File

@ -55,9 +55,9 @@
<ul class="icon_lists dib-box">
<li class="dib">
<span class="icon iconfont">&#xe667;</span>
<span class="icon iconfont">&#xe63f;</span>
<div class="name">返回顶部</div>
<div class="code-name">&amp;#xe667;</div>
<div class="code-name">&amp;#xe63f;</div>
</li>
<li class="dib">
@ -828,9 +828,9 @@
<pre><code class="language-css"
>@font-face {
font-family: 'iconfont';
src: url('iconfont.woff2?t=1705486315942') format('woff2'),
url('iconfont.woff?t=1705486315942') format('woff'),
url('iconfont.ttf?t=1705486315942') format('truetype');
src: url('iconfont.woff2?t=1706079293312') format('woff2'),
url('iconfont.woff?t=1706079293312') format('woff'),
url('iconfont.ttf?t=1706079293312') format('truetype');
}
</code></pre>
<h3 id="-iconfont-">第二步:定义使用 iconfont 的样式</h3>

View File

@ -1,8 +1,8 @@
@font-face {
font-family: "iconfont"; /* Project id 2459092 */
src: url('iconfont.woff2?t=1705486315942') format('woff2'),
url('iconfont.woff?t=1705486315942') format('woff'),
url('iconfont.ttf?t=1705486315942') format('truetype');
src: url('iconfont.woff2?t=1706079293312') format('woff2'),
url('iconfont.woff?t=1706079293312') format('woff'),
url('iconfont.ttf?t=1706079293312') format('truetype');
}
.iconfont {
@ -14,7 +14,7 @@
}
.icon-back-top:before {
content: "\e667";
content: "\e63f";
}
.icon-adaptor:before {

File diff suppressed because one or more lines are too long

View File

@ -6,11 +6,11 @@
"description": "",
"glyphs": [
{
"icon_id": "831197",
"icon_id": "8224825",
"name": "返回顶部",
"font_class": "back-top",
"unicode": "e667",
"unicode_decimal": 58983
"unicode": "e63f",
"unicode_decimal": 58943
},
{
"icon_id": "34289857",

View File

@ -170,7 +170,7 @@ div:focus {
padding-right: 50px !important;
}
.de-tabs {
.de-tabs-component {
.el-tabs__header {
margin: 0 0 0 0 !important;
}
@ -1765,4 +1765,4 @@ div:focus {
.el-table__fixed-right::before {
display: none;
}
}

View File

@ -86,7 +86,7 @@
<el-form-item
:label="$t('system_parameter_setting.ds_sync_log_retention_time')"
prop="logTimeOut"
prop="dsSyncLogTimeOut"
>
<el-input
v-model="formInline.dsSyncLogTimeOut"

View File

@ -1,6 +1,6 @@
{
"name": "dataease-mobile",
"version": "1.18.14",
"version": "1.18.15",
"private": true,
"scripts": {
"serve": "npm run dev:h5",

View File

@ -9,7 +9,7 @@
<packaging>pom</packaging>
<properties>
<dataease.version>1.18.14</dataease.version>
<dataease.version>1.18.15</dataease.version>
</properties>
<name>dataease</name>

View File

@ -13,7 +13,7 @@ public enum DatasourceTypes {
StarRocks("StarRocks", "StarRocks", "`", "`", "'", "'", "characterEncoding=UTF-8&connectTimeout=5000&useSSL=false&allowPublicKeyRetrieval=true", true, DatasourceCalculationMode.DIRECT_AND_SYNC, null, null, true, DatabaseClassification.OLAP, ""),
ds_doris("ds_doris", "Doris", "`", "`", "'", "'", "characterEncoding=UTF-8&connectTimeout=5000&useSSL=false&allowPublicKeyRetrieval=true", true, DatasourceCalculationMode.DIRECT_AND_SYNC, null, null, true, DatabaseClassification.OLAP, ""),
pg("pg", "PostgreSQL", "\"", "\"", "\"", "\"", "", true, DatasourceCalculationMode.DIRECT_AND_SYNC, null, null, true, DatabaseClassification.OLTP, "12,13,14,15,16"),
sqlServer("sqlServer", "SQL Server", "\"", "\"", "\"", "\"", "", true, DatasourceCalculationMode.DIRECT_AND_SYNC, null, null, true, DatabaseClassification.OLTP, "13,14,15,16"),
sqlServer("sqlServer", "SQL Server", "\"", "\"", "\"", "\"", "", true, DatasourceCalculationMode.DIRECT_AND_SYNC, null, null, true, DatabaseClassification.OLTP, "10,13,14,15,16"),
oracle("oracle", "Oracle", "\"", "\"", "\"", "\"", "", true, DatasourceCalculationMode.DIRECT_AND_SYNC, Arrays.asList("Default", "GBK", "BIG5", "ISO-8859-1", "UTF-8", "UTF-16", "CP850", "EUC_JP", "EUC_KR", "US7ASCII", "AL32UTF8"), Arrays.asList("Default", "GBK", "UTF-8"), true, DatabaseClassification.OLTP, "8,9,10,11,12"),
mongo("mongo", "MongoDB", "`", "`", "\"", "\"", "rebuildschema=true&authSource=admin", true, DatasourceCalculationMode.DIRECT, null, null, true, DatabaseClassification.OLTP, "3,4"),
ck("ck", "ClickHouse", "`", "`", "", "", "", true, DatasourceCalculationMode.DIRECT, null, null, true, DatabaseClassification.OLAP, "18,19,20,21,22,23"),