forked from github/dataease
Merge branch 'dev-v2' into pr@dev-v2_dzz
This commit is contained in:
commit
2198955bff
@ -13,10 +13,11 @@ WORKDIR /opt/apps
|
||||
ADD core/core-backend/target/CoreApplication.jar /opt/apps/app.jar
|
||||
ADD de-xpack/xpack-permissions/target/xpack-permissions-$IMAGE_TAG.jar /opt/apps/xpack-permission.jar
|
||||
ADD de-xpack/xpack-base/target/xpack-base-$IMAGE_TAG.jar /opt/apps/xpack-base.jar
|
||||
ADD de-xpack/xpack-sync/target/xpack-sync-$IMAGE_TAG.jar /opt/apps/xpack-sync.jar
|
||||
|
||||
ENV JAVA_APP_JAR=/opt/apps/app.jar
|
||||
|
||||
HEALTHCHECK --interval=15s --timeout=5s --retries=20 --start-period=30s CMD curl -f 127.0.0.1:8100
|
||||
|
||||
|
||||
CMD java -Xmx1024m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/opt/dataease2.0/logs/dump.hprof -Dloader.path=/opt/apps/xpack-permission.jar,/opt/apps/xpack-base.jar -jar /opt/apps/app.jar
|
||||
CMD java -Xmx1024m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/opt/dataease2.0/logs/dump.hprof -Dloader.path=/opt/apps/xpack-permission.jar,/opt/apps/xpack-base.jar,/opt/apps/xpack-sync.jar -jar /opt/apps/app.jar
|
||||
|
@ -23,6 +23,11 @@
|
||||
<artifactId>api-permissions</artifactId>
|
||||
<version>${dataease.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.dataease</groupId>
|
||||
<artifactId>api-sync</artifactId>
|
||||
<version>${dataease.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.mysql</groupId>
|
||||
<artifactId>mysql-connector-j</artifactId>
|
||||
|
@ -21,11 +21,11 @@ public class MybatisPlusGenerator {
|
||||
/**
|
||||
* 业务模块例如datasource,dataset,panel等
|
||||
*/
|
||||
private static final String busi = "visualization";
|
||||
private static final String busi = "template";
|
||||
/**
|
||||
* 这是要生成代码的表名称
|
||||
*/
|
||||
private static final String TABLE_NAME = "visualization_watermark";
|
||||
private static final String TABLE_NAME = "visualization_template";
|
||||
|
||||
/**
|
||||
* 下面两个配置基本上不用动
|
||||
|
@ -1,6 +1,5 @@
|
||||
package io.dataease.chart.manage;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import io.dataease.api.chart.dto.*;
|
||||
import io.dataease.api.chart.request.ChartDrillRequest;
|
||||
import io.dataease.api.chart.request.ChartExtRequest;
|
||||
@ -32,12 +31,13 @@ import io.dataease.system.manage.CorePermissionManage;
|
||||
import io.dataease.utils.BeanUtils;
|
||||
import io.dataease.utils.JsonUtil;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.collections4.MapUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
@ -246,7 +246,7 @@ public class ChartDataManage {
|
||||
|
||||
boolean hasParameters = false;
|
||||
List<SqlVariableDetails> sqlVariables = datasetGroupManage.getSqlParams(Arrays.asList(view.getTableId()));
|
||||
if (CollectionUtil.isNotEmpty(sqlVariables)) {
|
||||
if (CollectionUtils.isNotEmpty(sqlVariables)) {
|
||||
for (SqlVariableDetails parameter : Optional.ofNullable(request.getParameters()).orElse(new ArrayList<>())) {
|
||||
String parameterId = StringUtils.endsWith(parameter.getId(), START_END_SEPARATOR) ? parameter.getId().split(START_END_SEPARATOR)[0] : parameter.getId();
|
||||
if (sqlVariables.stream().map(SqlVariableDetails::getId).collect(Collectors.toList()).contains(parameterId)) {
|
||||
@ -1146,8 +1146,8 @@ public class ChartDataManage {
|
||||
getIndex += xAxis.size();
|
||||
}
|
||||
if (StringUtils.equalsIgnoreCase(fieldType, "extStack")) {
|
||||
int xAxisSize = CollectionUtil.size(view.getXAxis());
|
||||
int extSize = CollectionUtil.size(view.getXAxisExt());
|
||||
int xAxisSize = CollectionUtils.size(view.getXAxis());
|
||||
int extSize = CollectionUtils.size(view.getXAxisExt());
|
||||
index += xAxisSize + extSize;
|
||||
getIndex += xAxisSize + extSize;
|
||||
}
|
||||
@ -1326,7 +1326,7 @@ public class ChartDataManage {
|
||||
}
|
||||
|
||||
public void saveChartViewFromVisualization(String checkData, Long sceneId, Map<Long, ChartViewDTO> chartViewsInfo) {
|
||||
if (!CollectionUtils.isEmpty(chartViewsInfo)) {
|
||||
if (!MapUtils.isEmpty(chartViewsInfo)) {
|
||||
chartViewsInfo.forEach((key, chartViewDTO) -> {
|
||||
if (checkData.indexOf(chartViewDTO.getId() + "") > -1) {
|
||||
try {
|
||||
|
@ -1,6 +1,5 @@
|
||||
package io.dataease.chart.server;
|
||||
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import io.dataease.api.chart.ChartDataApi;
|
||||
import io.dataease.api.chart.dto.ChartViewDTO;
|
||||
import io.dataease.api.chart.dto.ViewDetailField;
|
||||
@ -15,18 +14,14 @@ import io.dataease.visualization.manage.VisualizationTemplateExtendDataManage;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.hssf.usermodel.HSSFClientAnchor;
|
||||
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
||||
import org.apache.poi.ss.usermodel.*;
|
||||
import org.apache.poi.ss.util.CellRangeAddress;
|
||||
import org.apache.poi.xssf.streaming.SXSSFWorkbook;
|
||||
import org.springframework.util.Base64Utils;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
@ -50,9 +45,9 @@ public class ChartDataServer implements ChartDataApi {
|
||||
public ChartViewDTO getData(ChartViewDTO chartViewDTO) throws Exception {
|
||||
try {
|
||||
// 从模板数据获取
|
||||
if(CommonConstants.VIEW_DATA_FROM.TEMPLATE.equalsIgnoreCase(chartViewDTO.getDataFrom())){
|
||||
return extendDataManage.getChartDataInfo(chartViewDTO.getId(),chartViewDTO);
|
||||
}else{
|
||||
if (CommonConstants.VIEW_DATA_FROM.TEMPLATE.equalsIgnoreCase(chartViewDTO.getDataFrom())) {
|
||||
return extendDataManage.getChartDataInfo(chartViewDTO.getId(), chartViewDTO);
|
||||
} else {
|
||||
return chartDataManage.calcData(chartViewDTO);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
@ -85,7 +80,7 @@ public class ChartDataServer implements ChartDataApi {
|
||||
|
||||
@Override
|
||||
public void innerExportDetails(ChartExcelRequest request, HttpServletResponse response) throws Exception {
|
||||
OutputStream outputStream = response.getOutputStream();
|
||||
OutputStream outputStream = response.getOutputStream();
|
||||
try {
|
||||
findExcelData(request);
|
||||
List<Object[]> details = request.getDetails();
|
||||
@ -114,7 +109,7 @@ public class ChartDataServer implements ChartDataApi {
|
||||
|
||||
Boolean mergeHead = false;
|
||||
ViewDetailField[] detailFields = request.getDetailFields();
|
||||
if (ArrayUtil.isNotEmpty(detailFields)) {
|
||||
if (ArrayUtils.isNotEmpty(detailFields)) {
|
||||
cellStyle.setBorderTop(BorderStyle.THIN);
|
||||
cellStyle.setBorderRight(BorderStyle.THIN);
|
||||
cellStyle.setBorderBottom(BorderStyle.THIN);
|
||||
@ -199,7 +194,7 @@ public class ChartDataServer implements ChartDataApi {
|
||||
} else if (cellValObj != null) {
|
||||
try {
|
||||
// with DataType
|
||||
if ((excelTypes[j].equals(DeTypeConstants.DE_INT) || excelTypes[j] .equals(DeTypeConstants.DE_FLOAT) ) && StringUtils.isNotEmpty(cellValObj.toString())) {
|
||||
if ((excelTypes[j].equals(DeTypeConstants.DE_INT) || excelTypes[j].equals(DeTypeConstants.DE_FLOAT)) && StringUtils.isNotEmpty(cellValObj.toString())) {
|
||||
cell.setCellValue(Double.valueOf(cellValObj.toString()));
|
||||
} else {
|
||||
cell.setCellValue(cellValObj.toString());
|
||||
|
@ -1,8 +1,8 @@
|
||||
package io.dataease.chart.utils;
|
||||
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import io.dataease.api.chart.dto.*;
|
||||
import io.dataease.utils.IDUtils;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
@ -1004,7 +1004,7 @@ public class ChartDataBuild {
|
||||
Map<String, Object> map = transTableNormal(fields, null, data, desensitizationList);
|
||||
List<Map<String, Object>> tableRow = (List<Map<String, Object>>) map.get("tableRow");
|
||||
final int xEndIndex = detailIndex;
|
||||
Map<String, List<String[]>> groupDataList = detailData.stream().collect(Collectors.groupingBy(item -> ArrayUtil.join(ArrayUtil.sub(item, 0, xEndIndex), "-de-", "(", ")")));
|
||||
Map<String, List<String[]>> groupDataList = detailData.stream().collect(Collectors.groupingBy(item -> "(" + StringUtils.join(ArrayUtils.subarray(item, 0, xEndIndex), "-de-") + ")"));
|
||||
|
||||
tableRow.forEach(row -> {
|
||||
String key = xAxis.stream().map(x -> String.format(format, row.get(x.getDataeaseName()).toString())).collect(Collectors.joining("-de-"));
|
||||
|
@ -60,12 +60,13 @@ public class SqlparserUtils {
|
||||
}
|
||||
|
||||
private static void getDependencies(SqlNode sqlNode, Boolean fromOrJoin) {
|
||||
|
||||
if (sqlNode == null) {
|
||||
return;
|
||||
}
|
||||
if (sqlNode.getKind() == JOIN) {
|
||||
SqlJoin sqlKind = (SqlJoin) sqlNode;
|
||||
|
||||
} else if (sqlNode.getKind() == IDENTIFIER) {
|
||||
|
||||
} else if (sqlNode.getKind() == AS) {
|
||||
SqlBasicCall sqlKind = (SqlBasicCall) sqlNode;
|
||||
} else if (sqlNode.getKind() == SELECT) {
|
||||
@ -80,9 +81,19 @@ public class SqlparserUtils {
|
||||
SqlNode newWhere = sqlKind.getWhere().accept(getSqlShuttle());
|
||||
sqlKind.setWhere(newWhere);
|
||||
}
|
||||
|
||||
} else {
|
||||
// TODO 这里可根据需求拓展处理其他类型的 sqlNode
|
||||
} else if (sqlNode.getKind() == ORDER_BY) {
|
||||
SqlOrderBy sqlKind = (SqlOrderBy) sqlNode;
|
||||
List<SqlNode> operandList = sqlKind.getOperandList();
|
||||
for (int i = 0; i < operandList.size(); i++) {
|
||||
getDependencies(operandList.get(i), false);
|
||||
}
|
||||
} else if (sqlNode.getKind() == UNION) {
|
||||
SqlBasicCall sqlKind = (SqlBasicCall) sqlNode;
|
||||
if (sqlKind.getOperandList().size() >= 2) {
|
||||
for (int i = 0; i < sqlKind.getOperandList().size(); i++) {
|
||||
getDependencies(sqlKind.getOperandList().get(i), false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
package io.dataease.dataset.manage;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import io.dataease.api.dataset.dto.DatasetTableDTO;
|
||||
@ -32,6 +31,7 @@ import io.dataease.operation.manage.CoreOptRecentManage;
|
||||
import io.dataease.system.manage.CoreUserManage;
|
||||
import io.dataease.utils.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Component;
|
||||
@ -211,7 +211,7 @@ public class DatasetGroupManage {
|
||||
List<DataSetNodeBO> nodes = new ArrayList<>();
|
||||
if (ObjectUtils.isEmpty(request.getLeaf()) || !request.getLeaf()) nodes.add(rootNode());
|
||||
List<DataSetNodeBO> bos = pos.stream().map(this::convert).toList();
|
||||
if (CollectionUtil.isNotEmpty(bos)) {
|
||||
if (CollectionUtils.isNotEmpty(bos)) {
|
||||
nodes.addAll(bos);
|
||||
}
|
||||
return TreeUtils.mergeTree(nodes, BusiNodeVO.class, false);
|
||||
@ -449,10 +449,11 @@ public class DatasetGroupManage {
|
||||
for (CoreDatasetTable datasetTable : datasetTables) {
|
||||
if (StringUtils.isNotEmpty(datasetTable.getSqlVariableDetails())) {
|
||||
List<SqlVariableDetails> defaultsSqlVariableDetails = JsonUtil.parseList(datasetTable.getSqlVariableDetails(), listTypeReference);
|
||||
if (CollectionUtil.isNotEmpty(defaultsSqlVariableDetails)) {
|
||||
if (CollectionUtils.isNotEmpty(defaultsSqlVariableDetails)) {
|
||||
List<String> fullName = new ArrayList<>();
|
||||
geFullName(id, fullName);
|
||||
List<String> finalFullName = CollectionUtil.reverse(fullName);
|
||||
Collections.reverse(fullName);
|
||||
List<String> finalFullName = fullName;
|
||||
defaultsSqlVariableDetails.forEach(sqlVariableDetails -> {
|
||||
sqlVariableDetails.setDatasetGroupId(id);
|
||||
sqlVariableDetails.setDatasetTableId(datasetTable.getId());
|
||||
@ -500,13 +501,13 @@ public class DatasetGroupManage {
|
||||
|
||||
public List<DatasetTableDTO> getDetailWithPerm(List<Long> ids) {
|
||||
var result = new ArrayList<DatasetTableDTO>();
|
||||
if (CollectionUtil.isNotEmpty(ids)) {
|
||||
if (CollectionUtils.isNotEmpty(ids)) {
|
||||
var dsList = coreDatasetGroupMapper.selectBatchIds(ids);
|
||||
if (CollectionUtil.isNotEmpty(dsList)) {
|
||||
if (CollectionUtils.isNotEmpty(dsList)) {
|
||||
dsList.forEach(ds -> {
|
||||
DatasetTableDTO dto = new DatasetTableDTO();
|
||||
BeanUtils.copyBean(dto, ds);
|
||||
var fields = datasetTableFieldManage.listFieldsWithPermissions(ds.getId());
|
||||
var fields = datasetTableFieldManage.listFieldsWithPermissions(ds.getId());
|
||||
List<DatasetTableFieldDTO> dimensionList = fields.stream().filter(ele -> StringUtils.equalsIgnoreCase(ele.getGroupType(), "d")).toList();
|
||||
List<DatasetTableFieldDTO> quotaList = fields.stream().filter(ele -> StringUtils.equalsIgnoreCase(ele.getGroupType(), "q")).toList();
|
||||
Map<String, List<DatasetTableFieldDTO>> map = new LinkedHashMap<>();
|
||||
|
@ -1,9 +1,7 @@
|
||||
package io.dataease.dataset.manage;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import io.dataease.api.chart.dto.ColumnPermissionItem;
|
||||
import io.dataease.auth.bo.TokenUserBO;
|
||||
import io.dataease.dataset.dao.auto.entity.CoreDatasetTableField;
|
||||
import io.dataease.dataset.dao.auto.mapper.CoreDatasetGroupMapper;
|
||||
import io.dataease.dataset.dao.auto.mapper.CoreDatasetTableFieldMapper;
|
||||
|
@ -1,6 +1,5 @@
|
||||
package io.dataease.datasource.manage;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import io.dataease.api.ds.vo.DatasourceDTO;
|
||||
@ -19,6 +18,7 @@ import io.dataease.operation.manage.CoreOptRecentManage;
|
||||
import io.dataease.utils.AuthUtils;
|
||||
import io.dataease.utils.TreeUtils;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Component;
|
||||
@ -65,7 +65,7 @@ public class DataSourceManage {
|
||||
List<DatasourceNodeBO> nodes = new ArrayList<>();
|
||||
List<DataSourceNodePO> pos = dataSourceExtMapper.selectList(queryWrapper);
|
||||
if (ObjectUtils.isEmpty(request.getLeaf()) || !request.getLeaf()) nodes.add(rootNode());
|
||||
if (CollectionUtil.isNotEmpty(pos)) {
|
||||
if (CollectionUtils.isNotEmpty(pos)) {
|
||||
nodes.addAll(pos.stream().map(this::convert).toList());
|
||||
}
|
||||
return TreeUtils.mergeTree(nodes, BusiNodeVO.class, false);
|
||||
|
@ -173,7 +173,7 @@ public class CalciteProvider {
|
||||
datasetTableFields.add(tableField);
|
||||
}
|
||||
list = getDataResult(resultSet);
|
||||
} catch (Exception e) {
|
||||
} catch (Exception | AssertionError e) {
|
||||
DEException.throwException(Translator.get("i18n_fetch_error") + e.getMessage());
|
||||
} finally {
|
||||
try {
|
||||
@ -255,7 +255,7 @@ public class CalciteProvider {
|
||||
DatasourceConfiguration configuration = null;
|
||||
DatasourceType datasourceType = DatasourceType.valueOf(ds.getType());
|
||||
try {
|
||||
if(rootSchema.getSubSchema(ds.getSchemaAlias()) != null){
|
||||
if (rootSchema.getSubSchema(ds.getSchemaAlias()) != null) {
|
||||
JdbcSchema jdbcSchema = rootSchema.getSubSchema(ds.getSchemaAlias()).unwrap(JdbcSchema.class);
|
||||
BasicDataSource basicDataSource = (BasicDataSource) jdbcSchema.getDataSource();
|
||||
basicDataSource.close();
|
||||
|
@ -1,6 +1,5 @@
|
||||
package io.dataease.datasource.server;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
@ -42,13 +41,13 @@ import io.dataease.system.dao.auto.entity.CoreSysSetting;
|
||||
import io.dataease.system.manage.CoreUserManage;
|
||||
import io.dataease.utils.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.quartz.JobDataMap;
|
||||
import org.quartz.JobKey;
|
||||
import org.quartz.TriggerKey;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
@ -137,6 +136,9 @@ public class DatasourceServer implements DatasourceApi {
|
||||
dataSourceManage.move(dataSourceDTO);
|
||||
}
|
||||
case "rename" -> {
|
||||
if(StringUtils.isEmpty(dataSourceDTO.getName())){
|
||||
DEException.throwException("名称不能为空!");
|
||||
}
|
||||
CoreDatasource datasource = datasourceMapper.selectById(dataSourceDTO.getId());
|
||||
datasource.setName(dataSourceDTO.getName());
|
||||
dataSourceManage.innerEdit(datasource);
|
||||
@ -168,7 +170,7 @@ public class DatasourceServer implements DatasourceApi {
|
||||
ids.add(busiNodeVO.getId());
|
||||
}
|
||||
}
|
||||
if (CollectionUtil.isNotEmpty(busiNodeVO.getChildren())) {
|
||||
if (CollectionUtils.isNotEmpty(busiNodeVO.getChildren())) {
|
||||
filterDs(busiNodeVO.getChildren(), ids, type, id);
|
||||
}
|
||||
}
|
||||
@ -184,14 +186,14 @@ public class DatasourceServer implements DatasourceApi {
|
||||
List<Long> ids = new ArrayList<>();
|
||||
filterDs(busiNodeVOS, ids, dataSourceDTO.getType(), dataSourceDTO.getId());
|
||||
|
||||
if (CollectionUtil.isEmpty(ids)) {
|
||||
if (CollectionUtils.isEmpty(ids)) {
|
||||
return false;
|
||||
}
|
||||
QueryWrapper<CoreDatasource> wrapper = new QueryWrapper<>();
|
||||
wrapper.in("id", ids);
|
||||
|
||||
List<CoreDatasource> datasources = datasourceMapper.selectList(wrapper);
|
||||
if (CollectionUtil.isEmpty(datasources)) {
|
||||
if (CollectionUtils.isEmpty(datasources)) {
|
||||
return false;
|
||||
}
|
||||
dataSourceDTO.setConfiguration(new String(Base64.getDecoder().decode(dataSourceDTO.getConfiguration())));
|
||||
@ -465,8 +467,9 @@ public class DatasourceServer implements DatasourceApi {
|
||||
CoreDatasource coreDatasource = new CoreDatasource();
|
||||
BeanUtils.copyBean(coreDatasource, dataSourceDTO);
|
||||
checkDatasourceStatus(coreDatasource);
|
||||
dataSourceDTO.setStatus(coreDatasource.getStatus());
|
||||
return dataSourceDTO;
|
||||
DatasourceDTO result = new DatasourceDTO();
|
||||
result.setStatus(coreDatasource.getStatus());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1,7 +1,5 @@
|
||||
package io.dataease.map.manage;
|
||||
|
||||
import cn.hutool.core.collection.ListUtil;
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import io.dataease.api.map.dto.GeometryNodeCreator;
|
||||
import io.dataease.api.map.vo.AreaNode;
|
||||
@ -14,6 +12,7 @@ import io.dataease.map.dao.ext.entity.CoreAreaCustom;
|
||||
import io.dataease.map.dao.ext.mapper.CoreAreaCustomMapper;
|
||||
import io.dataease.utils.BeanUtils;
|
||||
import io.dataease.utils.CommonBeanFactory;
|
||||
import io.dataease.utils.FileUtils;
|
||||
import io.dataease.utils.LogUtil;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
@ -32,7 +31,6 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import static io.dataease.constant.CacheConstant.CommonCacheConstant.WORLD_MAP_CACHE;
|
||||
|
||||
@ -114,7 +112,8 @@ public class MapManage {
|
||||
if (ObjectUtils.isEmpty(file) || file.isEmpty()) {
|
||||
DEException.throwException("geometry file is require");
|
||||
}
|
||||
String suffix = FileUtil.getSuffix(file.getOriginalFilename());
|
||||
|
||||
String suffix = FileUtils.getExtensionName(file.getOriginalFilename());
|
||||
if (!StringUtils.equalsIgnoreCase("json", suffix)) {
|
||||
DEException.throwException("仅支持json格式文件");
|
||||
}
|
||||
@ -164,7 +163,7 @@ public class MapManage {
|
||||
}
|
||||
List<String> codeResultList = new ArrayList<>();
|
||||
codeResultList.add(code);
|
||||
childTreeIdList(ListUtil.of(code), codeResultList);
|
||||
childTreeIdList(List.of(code), codeResultList);
|
||||
coreAreaCustomMapper.deleteBatchIds(codeResultList);
|
||||
codeResultList.forEach(id -> {
|
||||
File file = buildGeoFile(id);
|
||||
|
@ -1,6 +1,5 @@
|
||||
package io.dataease.menu.manage;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import io.dataease.api.menu.vo.MenuMeta;
|
||||
import io.dataease.api.menu.vo.MenuVO;
|
||||
@ -10,6 +9,7 @@ import io.dataease.menu.dao.auto.entity.CoreMenu;
|
||||
import io.dataease.menu.dao.auto.mapper.CoreMenuMapper;
|
||||
import io.dataease.utils.BeanUtils;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@ -61,10 +61,10 @@ public class MenuManage {
|
||||
for (MenuTreeNode menuTreeNode : roots) {
|
||||
MenuVO vo = convert(menuTreeNode);
|
||||
List<MenuTreeNode> children = null;
|
||||
if (CollectionUtil.isNotEmpty(children = menuTreeNode.getChildren())) {
|
||||
if (CollectionUtils.isNotEmpty(children = menuTreeNode.getChildren())) {
|
||||
vo.setChildren(convertTree(children));
|
||||
}
|
||||
if (CollectionUtil.isNotEmpty(vo.getChildren()) || menuTreeNode.getType() != 1) {
|
||||
if (CollectionUtils.isNotEmpty(vo.getChildren()) || menuTreeNode.getType() != 1) {
|
||||
result.add(vo);
|
||||
}
|
||||
}
|
||||
|
@ -1,12 +1,12 @@
|
||||
package io.dataease.operation.manage;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import io.dataease.commons.constants.OptConstants;
|
||||
import io.dataease.operation.dao.auto.entity.CoreOptRecent;
|
||||
import io.dataease.operation.dao.auto.mapper.CoreOptRecentMapper;
|
||||
import io.dataease.utils.AuthUtils;
|
||||
import io.dataease.utils.IDUtils;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
@ -64,7 +64,7 @@ public class CoreOptRecentManage {
|
||||
queryWrapper.eq("resource_type", OptConstants.OPT_RESOURCE_TYPE.TEMPLATE);
|
||||
queryWrapper.eq("uid", uid);
|
||||
List<CoreOptRecent> result = coreStoreMapper.selectList(queryWrapper);
|
||||
if (CollectionUtil.isNotEmpty(result)) {
|
||||
if (CollectionUtils.isNotEmpty(result)) {
|
||||
return result.stream().collect(Collectors.toMap(CoreOptRecent::getResourceName, CoreOptRecent::getTime));
|
||||
} else {
|
||||
return new HashMap<>();
|
||||
|
@ -0,0 +1,12 @@
|
||||
package io.dataease.rmonitor.bo;
|
||||
|
||||
import lombok.Data;
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class PerMonitorCheckBO implements Serializable {
|
||||
|
||||
private boolean valid;
|
||||
|
||||
private boolean emptyPermission;
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package io.dataease.rmonitor.bo;
|
||||
|
||||
import io.dataease.model.TreeBaseModel;
|
||||
import io.dataease.model.TreeResultModel;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class PerMonitorNodeBO implements TreeBaseModel<PerMonitorNodeBO>, TreeResultModel<PerMonitorNodeBO>, Serializable {
|
||||
|
||||
private Long id;
|
||||
|
||||
private String name;
|
||||
|
||||
private Long pid;
|
||||
|
||||
private boolean leaf;
|
||||
|
||||
private int extraFlag;
|
||||
|
||||
private List<PerMonitorNodeBO> children;
|
||||
}
|
@ -0,0 +1,118 @@
|
||||
package io.dataease.rmonitor.manage;
|
||||
|
||||
import io.dataease.exception.DEException;
|
||||
import io.dataease.rmonitor.bo.PerMonitorCheckBO;
|
||||
import io.dataease.rmonitor.bo.PerMonitorNodeBO;
|
||||
import io.dataease.rmonitor.mapper.ResourceMonitorMapper;
|
||||
import io.dataease.rmonitor.mapper.entity.DatasetFreeResource;
|
||||
import io.dataease.rmonitor.mapper.entity.DsFreeResource;
|
||||
import io.dataease.rmonitor.mapper.entity.VisualFreeResource;
|
||||
import io.dataease.utils.BeanUtils;
|
||||
import io.dataease.utils.TreeUtils;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.collections4.MapUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Component("resourceMonitorManage")
|
||||
public class ResourceMonitorManage {
|
||||
|
||||
|
||||
@Resource(name = "resourceMonitorSyncManage")
|
||||
private ResourceMonitorSyncManage resourceMonitorSyncManage;
|
||||
|
||||
@Resource
|
||||
private ResourceMonitorMapper resourceMonitorMapper;
|
||||
|
||||
|
||||
private boolean existFreeResource() {
|
||||
int rCount = resourceMonitorMapper.dsCount() + resourceMonitorMapper.datasetCount() + resourceMonitorMapper.vCount();
|
||||
return rCount > 0;
|
||||
}
|
||||
|
||||
private Map<String, List<PerMonitorNodeBO>> freeResource() {
|
||||
Map<String, List<PerMonitorNodeBO>> result = new HashMap<>();
|
||||
|
||||
List<DsFreeResource> dsFreeResources = resourceMonitorMapper.queryFreeDs();
|
||||
if (CollectionUtils.isNotEmpty(dsFreeResources)) {
|
||||
List<PerMonitorNodeBO> dsBos = dsFreeResources.stream().map(node -> {
|
||||
PerMonitorNodeBO bo = BeanUtils.copyBean(new PerMonitorNodeBO(), node);
|
||||
bo.setLeaf(StringUtils.equals("folder", node.getType()));
|
||||
return bo;
|
||||
}).collect(Collectors.toList());
|
||||
List<PerMonitorNodeBO> dsTree = TreeUtils.mergeTree(dsBos, PerMonitorNodeBO.class, false);
|
||||
result.put("datasource", dsTree);
|
||||
}
|
||||
|
||||
List<DatasetFreeResource> datasetFreeResources = resourceMonitorMapper.queryFreeDataset();
|
||||
if (CollectionUtils.isNotEmpty(datasetFreeResources)) {
|
||||
List<PerMonitorNodeBO> datasetBos = datasetFreeResources.stream().map(node -> {
|
||||
PerMonitorNodeBO bo = BeanUtils.copyBean(new PerMonitorNodeBO(), node);
|
||||
bo.setLeaf(StringUtils.equals("folder", node.getNodeType()));
|
||||
return bo;
|
||||
}).collect(Collectors.toList());
|
||||
List<PerMonitorNodeBO> datasetTree = TreeUtils.mergeTree(datasetBos, PerMonitorNodeBO.class, false);
|
||||
result.put("dataset", datasetTree);
|
||||
}
|
||||
|
||||
List<VisualFreeResource> visualFreeResources = resourceMonitorMapper.queryFreeVusial();
|
||||
if (CollectionUtils.isNotEmpty(visualFreeResources)) {
|
||||
Map<String, List<VisualFreeResource>> baseMap = visualFreeResources.stream().collect(Collectors.groupingBy(VisualFreeResource::getType));
|
||||
for (Map.Entry<String, List<VisualFreeResource>> entry : baseMap.entrySet()) {
|
||||
List<VisualFreeResource> freeResource = entry.getValue();
|
||||
List<PerMonitorNodeBO> visualBos = freeResource.stream().map(node -> {
|
||||
PerMonitorNodeBO bo = BeanUtils.copyBean(new PerMonitorNodeBO(), node);
|
||||
bo.setLeaf(StringUtils.equals("folder", node.getNodeType()));
|
||||
return bo;
|
||||
}).collect(Collectors.toList());
|
||||
result.put(convertBusiFlag(entry.getKey()), TreeUtils.mergeTree(visualBos, PerMonitorNodeBO.class, false));
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private String convertBusiFlag(String key) {
|
||||
if (StringUtils.equals("dashboard", key)){
|
||||
return "panel";
|
||||
} else if (StringUtils.equals("dataV", key)) {
|
||||
return "screen";
|
||||
} else return key;
|
||||
}
|
||||
|
||||
public boolean check() {
|
||||
PerMonitorCheckBO checkBO = resourceMonitorSyncManage.checkXpackResource();
|
||||
return checkBO.isValid() && checkBO.isEmptyPermission() && existFreeResource();
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public void delete() {
|
||||
boolean existFree = existFreeResource();
|
||||
if (!existFree) DEException.throwException("无未同步资源!");
|
||||
resourceMonitorMapper.delFreeDs();
|
||||
resourceMonitorMapper.delFreeDataset();
|
||||
resourceMonitorMapper.delFreeVisual();
|
||||
}
|
||||
|
||||
public void sync() {
|
||||
//1、从xpack获取资源 如果xpack不存在 或者资源不为空 则直接返回 并且抛出异常“仅支持首次导入lic同步”
|
||||
//2、从core获取资源
|
||||
//3、根据类型分组 并组织成树形结构
|
||||
//4、分别遍历每一棵树 从上到下 同步到权限体系 给默认组织
|
||||
PerMonitorCheckBO checkBO = resourceMonitorSyncManage.checkXpackResource();
|
||||
if (!checkBO.isValid()) DEException.throwException("缺少许可证");
|
||||
if (!checkBO.isEmptyPermission()) DEException.throwException("仅支持license首次导入同步");
|
||||
Map<String, List<PerMonitorNodeBO>> freeResourceMap = freeResource();
|
||||
if (MapUtils.isEmpty(freeResourceMap)) DEException.throwException("无未同步资源!");
|
||||
for (Map.Entry<String, List<PerMonitorNodeBO>> entry : freeResourceMap.entrySet()) {
|
||||
resourceMonitorSyncManage.sync(entry.getKey(), entry.getValue());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package io.dataease.rmonitor.manage;
|
||||
|
||||
import io.dataease.exception.DEException;
|
||||
import io.dataease.license.config.XpackInteract;
|
||||
import io.dataease.rmonitor.bo.PerMonitorCheckBO;
|
||||
import io.dataease.rmonitor.bo.PerMonitorNodeBO;
|
||||
import io.dataease.rmonitor.mapper.ResourceMonitorMapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Component("resourceMonitorSyncManage")
|
||||
public class ResourceMonitorSyncManage {
|
||||
|
||||
@Resource(name = "resourceMonitorMapper")
|
||||
private ResourceMonitorMapper resourceMonitorMapper;
|
||||
|
||||
@XpackInteract(value = "resourceMonitorSyncManage", replace = true)
|
||||
public void sync(String flag, List<PerMonitorNodeBO> treeNodes) {
|
||||
DEException.throwException("缺失许可证");
|
||||
}
|
||||
|
||||
@XpackInteract(value = "resourceMonitorSyncManage", replace = true)
|
||||
public PerMonitorCheckBO checkXpackResource() {
|
||||
return new PerMonitorCheckBO();
|
||||
}
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
package io.dataease.rmonitor.mapper;
|
||||
|
||||
import io.dataease.rmonitor.mapper.entity.DatasetFreeResource;
|
||||
import io.dataease.rmonitor.mapper.entity.DsFreeResource;
|
||||
import io.dataease.rmonitor.mapper.entity.VisualFreeResource;
|
||||
import org.apache.ibatis.annotations.Delete;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface ResourceMonitorMapper {
|
||||
|
||||
@Select("select count(id) from core_datasource")
|
||||
int dsCount();
|
||||
|
||||
@Select("select count(id) from core_dataset_group")
|
||||
int datasetCount();
|
||||
|
||||
@Select("select count(id) from data_visualization_info")
|
||||
int vCount();
|
||||
|
||||
@Select("select id, name, pid, type, status from core_datasource")
|
||||
List<DsFreeResource> queryFreeDs();
|
||||
|
||||
@Select("select id, name, pid, node_type from core_dataset_group")
|
||||
List<DatasetFreeResource> queryFreeDataset();
|
||||
|
||||
@Select("select id, name, pid, node_type, type from data_visualization_info")
|
||||
List<VisualFreeResource> queryFreeVusial();
|
||||
|
||||
@Delete("delete from core_datasource")
|
||||
void delFreeDs();
|
||||
|
||||
@Delete("delete from core_dataset_group")
|
||||
void delFreeDataset();
|
||||
@Delete("delete from data_visualization_info")
|
||||
void delFreeVisual();
|
||||
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package io.dataease.rmonitor.mapper.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class BaseFreeResource implements Serializable {
|
||||
|
||||
private Long id;
|
||||
|
||||
private String name;
|
||||
|
||||
private Long pid;
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package io.dataease.rmonitor.mapper.entity;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class DatasetFreeResource extends BaseFreeResource implements Serializable {
|
||||
|
||||
private String nodeType;
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package io.dataease.rmonitor.mapper.entity;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class DsFreeResource extends BaseFreeResource implements Serializable {
|
||||
|
||||
private String type;
|
||||
|
||||
private String status;
|
||||
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package io.dataease.rmonitor.mapper.entity;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class VisualFreeResource extends BaseFreeResource implements Serializable {
|
||||
|
||||
private String nodeType;
|
||||
|
||||
private String type;
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package io.dataease.rmonitor.server;
|
||||
|
||||
import io.dataease.api.rmonitor.ResourceMonitorApi;
|
||||
import io.dataease.rmonitor.manage.ResourceMonitorManage;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/rmonitor")
|
||||
public class ResourceMonitorServer implements ResourceMonitorApi {
|
||||
|
||||
@Resource(name = "resourceMonitorManage")
|
||||
private ResourceMonitorManage resourceMonitorManage;
|
||||
|
||||
@Override
|
||||
public boolean existFree() {
|
||||
return resourceMonitorManage.check();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delete() {
|
||||
resourceMonitorManage.delete();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sync() {
|
||||
resourceMonitorManage.sync();
|
||||
}
|
||||
}
|
@ -0,0 +1,150 @@
|
||||
package io.dataease.share.dao.auto.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author fit2cloud
|
||||
* @since 2023-09-22
|
||||
*/
|
||||
@TableName("xpack_share")
|
||||
public class XpackShare implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private Long creator;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Long time;
|
||||
|
||||
/**
|
||||
* 过期时间
|
||||
*/
|
||||
private Long exp;
|
||||
|
||||
/**
|
||||
* uuid
|
||||
*/
|
||||
private String uuid;
|
||||
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
private String pwd;
|
||||
|
||||
/**
|
||||
* 资源ID
|
||||
*/
|
||||
private Long resourceId;
|
||||
|
||||
/**
|
||||
* 组织ID
|
||||
*/
|
||||
private Long oid;
|
||||
|
||||
/**
|
||||
* 业务类型
|
||||
*/
|
||||
private Integer type;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getCreator() {
|
||||
return creator;
|
||||
}
|
||||
|
||||
public void setCreator(Long creator) {
|
||||
this.creator = creator;
|
||||
}
|
||||
|
||||
public Long getTime() {
|
||||
return time;
|
||||
}
|
||||
|
||||
public void setTime(Long time) {
|
||||
this.time = time;
|
||||
}
|
||||
|
||||
public Long getExp() {
|
||||
return exp;
|
||||
}
|
||||
|
||||
public void setExp(Long exp) {
|
||||
this.exp = exp;
|
||||
}
|
||||
|
||||
public String getUuid() {
|
||||
return uuid;
|
||||
}
|
||||
|
||||
public void setUuid(String uuid) {
|
||||
this.uuid = uuid;
|
||||
}
|
||||
|
||||
public String getPwd() {
|
||||
return pwd;
|
||||
}
|
||||
|
||||
public void setPwd(String pwd) {
|
||||
this.pwd = pwd;
|
||||
}
|
||||
|
||||
public Long getResourceId() {
|
||||
return resourceId;
|
||||
}
|
||||
|
||||
public void setResourceId(Long resourceId) {
|
||||
this.resourceId = resourceId;
|
||||
}
|
||||
|
||||
public Long getOid() {
|
||||
return oid;
|
||||
}
|
||||
|
||||
public void setOid(Long oid) {
|
||||
this.oid = oid;
|
||||
}
|
||||
|
||||
public Integer getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(Integer type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "XpackShare{" +
|
||||
"id = " + id +
|
||||
", creator = " + creator +
|
||||
", time = " + time +
|
||||
", exp = " + exp +
|
||||
", uuid = " + uuid +
|
||||
", pwd = " + pwd +
|
||||
", resourceId = " + resourceId +
|
||||
", oid = " + oid +
|
||||
", type = " + type +
|
||||
"}";
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package io.dataease.share.dao.auto.mapper;
|
||||
|
||||
import io.dataease.share.dao.auto.entity.XpackShare;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author fit2cloud
|
||||
* @since 2023-09-22
|
||||
*/
|
||||
@Mapper
|
||||
public interface XpackShareMapper extends BaseMapper<XpackShare> {
|
||||
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package io.dataease.share.dao.ext.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.dataease.share.dao.ext.po.XpackSharePO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
@Mapper
|
||||
public interface XpackShareExtMapper {
|
||||
|
||||
@Select("""
|
||||
select
|
||||
s.id as share_id,
|
||||
v.id as resource_id,
|
||||
v.type,
|
||||
s.creator,
|
||||
s.time,
|
||||
s.exp,
|
||||
v.name
|
||||
from xpack_share s
|
||||
left join data_visualization_info v on s.resource_id = v.id
|
||||
${ew.customSqlSegment}
|
||||
""")
|
||||
IPage<XpackSharePO> query(IPage<XpackSharePO> page, @Param("ew") QueryWrapper<Object> ew);
|
||||
|
||||
@Select("select type from data_visualization_info where id = #{id}")
|
||||
String visualizationType(@Param("id") Long id);
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package io.dataease.share.dao.ext.po;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class XpackSharePO implements Serializable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 7929343371768885789L;
|
||||
|
||||
private Long shareId;
|
||||
|
||||
private Long resourceId;
|
||||
|
||||
private String name;
|
||||
|
||||
private String type;
|
||||
|
||||
private Long creator;
|
||||
|
||||
private Long time;
|
||||
|
||||
private Long exp;
|
||||
|
||||
}
|
@ -0,0 +1,201 @@
|
||||
package io.dataease.share.manage;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.dataease.api.visualization.request.VisualizationWorkbranchQueryRequest;
|
||||
import io.dataease.api.xpack.share.request.XpackShareProxyRequest;
|
||||
import io.dataease.api.xpack.share.request.XpackSharePwdValidator;
|
||||
import io.dataease.api.xpack.share.vo.XpackShareGridVO;
|
||||
import io.dataease.api.xpack.share.vo.XpackShareProxyVO;
|
||||
import io.dataease.auth.bo.TokenUserBO;
|
||||
import io.dataease.constant.AuthConstant;
|
||||
import io.dataease.constant.BusiResourceEnum;
|
||||
import io.dataease.exception.DEException;
|
||||
import io.dataease.license.config.XpackInteract;
|
||||
import io.dataease.share.dao.auto.mapper.XpackShareMapper;
|
||||
import io.dataease.utils.*;
|
||||
import io.dataease.share.dao.auto.entity.XpackShare;
|
||||
import io.dataease.share.dao.ext.mapper.XpackShareExtMapper;
|
||||
import io.dataease.share.dao.ext.po.XpackSharePO;
|
||||
import io.dataease.share.util.LinkTokenUtil;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.RandomStringUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Component("xpackShareManage")
|
||||
public class XpackShareManage {
|
||||
|
||||
@Resource(name = "xpackShareMapper")
|
||||
private XpackShareMapper xpackShareMapper;
|
||||
|
||||
@Resource(name = "xpackShareExtMapper")
|
||||
private XpackShareExtMapper xpackShareExtMapper;
|
||||
|
||||
public XpackShare queryByResource(Long resourceId) {
|
||||
Long userId = AuthUtils.getUser().getUserId();
|
||||
QueryWrapper<XpackShare> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("creator", userId);
|
||||
queryWrapper.eq("resource_id", resourceId);
|
||||
return xpackShareMapper.selectOne(queryWrapper);
|
||||
}
|
||||
|
||||
public void switcher(Long resourceId) {
|
||||
XpackShare originData = queryByResource(resourceId);
|
||||
if (ObjectUtils.isNotEmpty(originData)) {
|
||||
xpackShareMapper.deleteById(originData.getId());
|
||||
return;
|
||||
}
|
||||
TokenUserBO user = AuthUtils.getUser();
|
||||
Long userId = user.getUserId();
|
||||
XpackShare xpackShare = new XpackShare();
|
||||
xpackShare.setId(IDUtils.snowID());
|
||||
xpackShare.setCreator(userId);
|
||||
xpackShare.setTime(System.currentTimeMillis());
|
||||
xpackShare.setResourceId(resourceId);
|
||||
xpackShare.setUuid(RandomStringUtils.randomAlphanumeric(8));
|
||||
xpackShare.setOid(user.getDefaultOid());
|
||||
String dType = xpackShareExtMapper.visualizationType(resourceId);
|
||||
xpackShare.setType(StringUtils.equalsIgnoreCase("dataV", dType) ? 2 : 1);
|
||||
xpackShareMapper.insert(xpackShare);
|
||||
}
|
||||
|
||||
public void editExp(Long resourceId, Long exp) {
|
||||
XpackShare originData = queryByResource(resourceId);
|
||||
if (ObjectUtils.isEmpty(originData)) {
|
||||
DEException.throwException("share instance not exist");
|
||||
}
|
||||
originData.setExp(exp);
|
||||
if (ObjectUtils.isEmpty(exp)) {
|
||||
originData.setExp(0L);
|
||||
}
|
||||
xpackShareMapper.updateById(originData);
|
||||
}
|
||||
|
||||
public void editPwd(Long resourceId, String pwd) {
|
||||
XpackShare originData = queryByResource(resourceId);
|
||||
if (ObjectUtils.isEmpty(originData)) {
|
||||
DEException.throwException("share instance not exist");
|
||||
}
|
||||
originData.setPwd(pwd);
|
||||
xpackShareMapper.updateById(originData);
|
||||
}
|
||||
|
||||
public IPage<XpackSharePO> querySharePage(int goPage, int pageSize, VisualizationWorkbranchQueryRequest request) {
|
||||
Long uid = AuthUtils.getUser().getUserId();
|
||||
QueryWrapper<Object> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("s.creator", uid);
|
||||
if (StringUtils.isNotBlank(request.getType())) {
|
||||
BusiResourceEnum busiResourceEnum = BusiResourceEnum.valueOf(request.getType().toUpperCase());
|
||||
if (ObjectUtils.isEmpty(busiResourceEnum)) {
|
||||
DEException.throwException("type is invalid");
|
||||
}
|
||||
String resourceType = convertResourceType(request.getType());
|
||||
if (StringUtils.isNotBlank(resourceType)) {
|
||||
queryWrapper.eq("v.type", resourceType);
|
||||
}
|
||||
}
|
||||
if (StringUtils.isNotBlank(request.getKeyword())) {
|
||||
queryWrapper.like("v.name", request.getKeyword());
|
||||
}
|
||||
queryWrapper.orderBy(true, request.isAsc(), "s.time");
|
||||
Page<XpackSharePO> page = new Page<>(goPage, pageSize);
|
||||
return xpackShareExtMapper.query(page, queryWrapper);
|
||||
}
|
||||
|
||||
private String convertResourceType(String busiFlag) {
|
||||
return switch (busiFlag) {
|
||||
case "panel" -> "dashboard";
|
||||
case "screen" -> "dataV";
|
||||
default -> null;
|
||||
};
|
||||
}
|
||||
|
||||
@XpackInteract(value = "perFilterShareManage", recursion = true)
|
||||
public IPage<XpackShareGridVO> query(int pageNum, int pageSize, VisualizationWorkbranchQueryRequest request) {
|
||||
IPage<XpackSharePO> poiPage = proxy().querySharePage(pageNum, pageSize, request);
|
||||
List<XpackShareGridVO> vos = proxy().formatResult(poiPage.getRecords());
|
||||
IPage<XpackShareGridVO> ipage = new Page<>();
|
||||
ipage.setSize(poiPage.getSize());
|
||||
ipage.setCurrent(poiPage.getCurrent());
|
||||
ipage.setPages(poiPage.getPages());
|
||||
ipage.setTotal(poiPage.getTotal());
|
||||
ipage.setRecords(vos);
|
||||
return ipage;
|
||||
}
|
||||
|
||||
public List<XpackShareGridVO> formatResult(List<XpackSharePO> pos) {
|
||||
if (CollectionUtils.isEmpty(pos)) return new ArrayList<>();
|
||||
return pos.stream().map(po ->
|
||||
new XpackShareGridVO(
|
||||
po.getShareId(), po.getResourceId(), po.getName(), po.getCreator().toString(),
|
||||
po.getTime(), po.getExp(), 9)).toList();
|
||||
}
|
||||
|
||||
private XpackShareManage proxy() {
|
||||
return CommonBeanFactory.getBean(this.getClass());
|
||||
}
|
||||
|
||||
public XpackShareProxyVO proxyInfo(XpackShareProxyRequest request) {
|
||||
QueryWrapper<XpackShare> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("uuid", request.getUuid());
|
||||
XpackShare xpackShare = xpackShareMapper.selectOne(queryWrapper);
|
||||
if (ObjectUtils.isEmpty(xpackShare))
|
||||
return null;
|
||||
String linkToken = LinkTokenUtil.generate(xpackShare.getCreator(), xpackShare.getResourceId(), xpackShare.getExp(), xpackShare.getPwd(), xpackShare.getOid());
|
||||
HttpServletResponse response = ServletUtils.response();
|
||||
response.addHeader(AuthConstant.LINK_TOKEN_KEY, linkToken);
|
||||
Integer type = xpackShare.getType();
|
||||
String typeText = (ObjectUtils.isNotEmpty(type) && type == 1) ? "dashboard" : "dataV";
|
||||
return new XpackShareProxyVO(xpackShare.getResourceId(), xpackShare.getCreator(), linkExp(xpackShare), pwdValid(xpackShare, request.getCiphertext()), typeText);
|
||||
}
|
||||
|
||||
private boolean linkExp(XpackShare xpackShare) {
|
||||
if (ObjectUtils.isEmpty(xpackShare.getExp()) || xpackShare.getExp().equals(0L)) return false;
|
||||
return System.currentTimeMillis() > xpackShare.getExp();
|
||||
}
|
||||
|
||||
private boolean pwdValid(XpackShare xpackShare, String ciphertext) {
|
||||
if (StringUtils.isBlank(xpackShare.getPwd())) return true;
|
||||
if (StringUtils.isBlank(ciphertext)) return false;
|
||||
String text = RsaUtils.decryptStr(ciphertext);
|
||||
int len = text.length();
|
||||
int splitIndex = len - 4;
|
||||
String pwd = text.substring(splitIndex);
|
||||
String uuid = text.substring(0, splitIndex);
|
||||
return StringUtils.equals(xpackShare.getUuid(), uuid) && StringUtils.equals(xpackShare.getPwd(), pwd);
|
||||
}
|
||||
|
||||
public boolean validatePwd(XpackSharePwdValidator validator) {
|
||||
String ciphertext = RsaUtils.decryptStr(validator.getCiphertext());
|
||||
int len = ciphertext.length();
|
||||
int splitIndex = len - 4;
|
||||
String pwd = ciphertext.substring(splitIndex);
|
||||
String uuid = ciphertext.substring(0, splitIndex);
|
||||
QueryWrapper<XpackShare> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("uuid", uuid);
|
||||
XpackShare xpackShare = xpackShareMapper.selectOne(queryWrapper);
|
||||
return StringUtils.equals(xpackShare.getUuid(), uuid) && StringUtils.equals(xpackShare.getPwd(), pwd);
|
||||
}
|
||||
|
||||
public Map<String, String> queryRelationByUserId(Long uid) {
|
||||
QueryWrapper<XpackShare> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("creator", uid);
|
||||
List<XpackShare> result = xpackShareMapper.selectList(queryWrapper);
|
||||
if (CollectionUtils.isNotEmpty(result)) {
|
||||
return result.stream()
|
||||
.collect(Collectors.toMap(xpackShare -> String.valueOf(xpackShare.getResourceId()), XpackShare::getUuid));
|
||||
}
|
||||
return new HashMap<>();
|
||||
}
|
||||
}
|
@ -0,0 +1,76 @@
|
||||
package io.dataease.share.server;
|
||||
|
||||
import io.dataease.api.visualization.request.VisualizationWorkbranchQueryRequest;
|
||||
import io.dataease.api.xpack.share.XpackShareApi;
|
||||
import io.dataease.api.xpack.share.request.XpackShareExpRequest;
|
||||
import io.dataease.api.xpack.share.request.XpackShareProxyRequest;
|
||||
import io.dataease.api.xpack.share.request.XpackSharePwdRequest;
|
||||
import io.dataease.api.xpack.share.request.XpackSharePwdValidator;
|
||||
import io.dataease.api.xpack.share.vo.XpackShareGridVO;
|
||||
import io.dataease.api.xpack.share.vo.XpackShareProxyVO;
|
||||
import io.dataease.api.xpack.share.vo.XpackShareVO;
|
||||
import io.dataease.utils.BeanUtils;
|
||||
import io.dataease.share.dao.auto.entity.XpackShare;
|
||||
import io.dataease.share.manage.XpackShareManage;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@RequestMapping("/share")
|
||||
@RestController
|
||||
public class XpackShareServer implements XpackShareApi {
|
||||
|
||||
@Resource(name = "xpackShareManage")
|
||||
private XpackShareManage xpackShareManage;
|
||||
@Override
|
||||
public boolean status(Long resourceId) {
|
||||
return ObjectUtils.isNotEmpty(xpackShareManage.queryByResource(resourceId));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void switcher(Long resourceId) {
|
||||
xpackShareManage.switcher(resourceId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void editExp(XpackShareExpRequest request) {
|
||||
xpackShareManage.editExp(request.getResourceId(), request.getExp());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void editPwd(XpackSharePwdRequest request) {
|
||||
xpackShareManage.editPwd(request.getResourceId(), request.getPwd());
|
||||
}
|
||||
|
||||
@Override
|
||||
public XpackShareVO detail(Long resourceId) {
|
||||
XpackShare xpackShare = xpackShareManage.queryByResource(resourceId);
|
||||
if (ObjectUtils.isEmpty(xpackShare)) return null;
|
||||
return BeanUtils.copyBean(new XpackShareVO(), xpackShare);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<XpackShareGridVO> query(VisualizationWorkbranchQueryRequest request) {
|
||||
return xpackShareManage.query(1, 20, request).getRecords();
|
||||
}
|
||||
|
||||
@Override
|
||||
public XpackShareProxyVO proxyInfo(XpackShareProxyRequest request) {
|
||||
return xpackShareManage.proxyInfo(request);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean validatePwd(XpackSharePwdValidator validator) {
|
||||
return xpackShareManage.validatePwd(validator);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, String> queryRelationByUserId(@PathVariable("uid") Long uid) {
|
||||
return xpackShareManage.queryRelationByUserId(uid);
|
||||
}
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package io.dataease.share.util;
|
||||
|
||||
import com.auth0.jwt.JWT;
|
||||
import com.auth0.jwt.JWTCreator;
|
||||
import com.auth0.jwt.algorithms.Algorithm;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class LinkTokenUtil {
|
||||
private static final String defaultPwd = "link-pwd-fit2cloud";
|
||||
public static String generate(Long uid, Long resourceId, Long exp, String pwd, Long oid) {
|
||||
pwd = StringUtils.isBlank(pwd) ? defaultPwd : pwd;
|
||||
Algorithm algorithm = Algorithm.HMAC256(pwd);
|
||||
JWTCreator.Builder builder = JWT.create();
|
||||
builder.withClaim("uid", uid).withClaim("resourceId", resourceId).withClaim("oid", oid);
|
||||
if (ObjectUtils.isNotEmpty(exp) && !exp.equals(0L)) {
|
||||
builder = builder.withExpiresAt(new Date(exp));
|
||||
}
|
||||
return builder.sign(algorithm);
|
||||
}
|
||||
}
|
@ -3,10 +3,12 @@ package io.dataease.system.server;
|
||||
import io.dataease.api.system.SysParameterApi;
|
||||
import io.dataease.api.system.request.OnlineMapEditor;
|
||||
import io.dataease.api.system.vo.SettingItemVO;
|
||||
import io.dataease.constant.XpackSettingConstants;
|
||||
import io.dataease.system.dao.auto.entity.CoreSysSetting;
|
||||
import io.dataease.system.manage.SysParameterManage;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@ -18,6 +20,7 @@ public class SysParameterServer implements SysParameterApi {
|
||||
|
||||
@Resource
|
||||
private SysParameterManage sysParameterManage;
|
||||
|
||||
@Override
|
||||
public String singleVal(String key) {
|
||||
return sysParameterManage.singleVal(key);
|
||||
@ -45,4 +48,17 @@ public class SysParameterServer implements SysParameterApi {
|
||||
public void saveBasicSetting(List<SettingItemVO> settingItemVOS) {
|
||||
sysParameterManage.saveBasic(settingItemVOS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer RequestTimeOut() {
|
||||
Integer frontTimeOut = 60;
|
||||
List<SettingItemVO> settingItemVOS = queryBasicSetting();
|
||||
for (int i = 0; i < settingItemVOS.size(); i++) {
|
||||
SettingItemVO settingItemVO = settingItemVOS.get(i);
|
||||
if (StringUtils.isNotBlank(settingItemVO.getPkey()) && settingItemVO.getPkey().equalsIgnoreCase(XpackSettingConstants.Front_Time_Out) && StringUtils.isNotBlank(settingItemVO.getPval())) {
|
||||
frontTimeOut = Integer.parseInt(settingItemVO.getPval());
|
||||
}
|
||||
}
|
||||
return frontTimeOut;
|
||||
}
|
||||
}
|
||||
|
@ -5,11 +5,11 @@ import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 仪表板模板表
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author fit2cloud
|
||||
* @since 2023-11-06
|
||||
* @since 2024-01-16
|
||||
*/
|
||||
@TableName("visualization_template")
|
||||
public class VisualizationTemplate implements Serializable {
|
||||
@ -37,7 +37,7 @@ public class VisualizationTemplate implements Serializable {
|
||||
private Integer level;
|
||||
|
||||
/**
|
||||
* 模板种类 dataV or dashboard 目录或者文件夹
|
||||
* 模版种类 dataV or dashboard 目录或者文件夹
|
||||
*/
|
||||
private String dvType;
|
||||
|
||||
@ -62,7 +62,7 @@ public class VisualizationTemplate implements Serializable {
|
||||
private String snapshot;
|
||||
|
||||
/**
|
||||
* 模板类型 system 系统内置 self 用户自建
|
||||
* 模版类型 system 系统内置 self 用户自建
|
||||
*/
|
||||
private String templateType;
|
||||
|
||||
@ -81,6 +81,11 @@ public class VisualizationTemplate implements Serializable {
|
||||
*/
|
||||
private String dynamicData;
|
||||
|
||||
/**
|
||||
* 使用次数
|
||||
*/
|
||||
private Integer useCount;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
@ -185,6 +190,14 @@ public class VisualizationTemplate implements Serializable {
|
||||
this.dynamicData = dynamicData;
|
||||
}
|
||||
|
||||
public Integer getUseCount() {
|
||||
return useCount;
|
||||
}
|
||||
|
||||
public void setUseCount(Integer useCount) {
|
||||
this.useCount = useCount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "VisualizationTemplate{" +
|
||||
@ -201,6 +214,7 @@ public class VisualizationTemplate implements Serializable {
|
||||
", templateStyle = " + templateStyle +
|
||||
", templateData = " + templateData +
|
||||
", dynamicData = " + dynamicData +
|
||||
", useCount = " + useCount +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
|
@ -6,11 +6,11 @@ import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 仪表板模板表 Mapper 接口
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author fit2cloud
|
||||
* @since 2023-11-06
|
||||
* @since 2024-01-16
|
||||
*/
|
||||
@Mapper
|
||||
public interface VisualizationTemplateMapper extends BaseMapper<VisualizationTemplate> {
|
||||
|
@ -121,13 +121,17 @@ public class TemplateCenterManage {
|
||||
|
||||
|
||||
public MarketBaseResponse searchTemplateRecommend() {
|
||||
MarketTemplateV2BaseResponse v2BaseResponse = null;
|
||||
Map<String, String> templateParams = sysParameterManage.groupVal("template.");
|
||||
// 模版市场推荐
|
||||
try {
|
||||
Map<String, String> templateParams = sysParameterManage.groupVal("template.");
|
||||
return baseResponseV2TransRecommend(templateQuery(templateParams), templateParams.get("template.url"));
|
||||
v2BaseResponse = templateQuery(templateParams);
|
||||
} catch (Exception e) {
|
||||
DEException.throwException(e);
|
||||
}
|
||||
return null;
|
||||
// 模版管理使用次数推荐
|
||||
List<TemplateMarketDTO> manage = searchTemplateFromManage();
|
||||
return baseResponseV2TransRecommend(v2BaseResponse, manage, templateParams.get("template.url"));
|
||||
}
|
||||
|
||||
public MarketPreviewBaseResponse searchTemplatePreview() {
|
||||
@ -161,7 +165,7 @@ public class TemplateCenterManage {
|
||||
}
|
||||
}
|
||||
|
||||
private MarketBaseResponse baseResponseV2TransRecommend(MarketTemplateV2BaseResponse v2BaseResponse, String url) {
|
||||
private MarketBaseResponse baseResponseV2TransRecommend(MarketTemplateV2BaseResponse v2BaseResponse,List<TemplateMarketDTO> templateManages, String url) {
|
||||
Map<String, Long> useTime = coreOptRecentManage.findTemplateRecentUseTime();
|
||||
List<MarketMetaDataVO> categoryVO = getCategoriesV2().stream().filter(node -> !"全部".equalsIgnoreCase(node.getLabel())).collect(Collectors.toList());
|
||||
Map<String, String> categoriesMap = categoryVO.stream()
|
||||
@ -177,6 +181,22 @@ public class TemplateCenterManage {
|
||||
}
|
||||
// 最近使用排序
|
||||
Collections.sort(contents);
|
||||
Long countDataV = contents.stream().filter(item -> "PANEL".equals(item.getTemplateType())).count();
|
||||
Long countDashboard = contents.stream().filter(item -> "SCREEN".equals(item.getTemplateType())).count();
|
||||
List<TemplateMarketDTO> templateDataV = templateManages.stream().filter(item -> "PANEL".equals(item.getTemplateType())).collect(Collectors.toList());
|
||||
List<TemplateMarketDTO> templateDashboard = templateManages.stream().filter(item -> "SCREEN".equals(item.getTemplateType())).collect(Collectors.toList());
|
||||
if(countDataV<10){
|
||||
Long addItemCount = 10 -countDataV;
|
||||
Long addIndex = templateDataV.size()<addItemCount? templateDataV.size() :addItemCount;
|
||||
contents.addAll(templateDataV.subList(0,addIndex.intValue()));
|
||||
}
|
||||
|
||||
if(countDashboard<10){
|
||||
Long addItemCount = 10 -countDashboard;
|
||||
Long addIndex = templateDashboard.size()<addItemCount? templateDashboard.size() :addItemCount;
|
||||
contents.addAll(templateDashboard.subList(0,addIndex.intValue()));
|
||||
}
|
||||
|
||||
return new MarketBaseResponse(url, categoryVO, contents);
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
package io.dataease.visualization.manage;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
@ -24,6 +23,7 @@ import io.dataease.visualization.dao.ext.po.VisualizationNodePO;
|
||||
import io.dataease.visualization.dao.ext.po.VisualizationResourcePO;
|
||||
import io.dataease.visualization.dto.VisualizationNodeBO;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Component;
|
||||
@ -56,12 +56,12 @@ public class CoreVisualizationManage {
|
||||
}
|
||||
QueryWrapper<Object> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("delete_flag", false);
|
||||
queryWrapper.ne("pid",-1);
|
||||
queryWrapper.ne("pid", -1);
|
||||
queryWrapper.eq(ObjectUtils.isNotEmpty(request.getLeaf()), "node_type", ObjectUtils.isNotEmpty(request.getLeaf()) && request.getLeaf() ? "leaf" : "folder");
|
||||
queryWrapper.eq("type", request.getBusiFlag());
|
||||
queryWrapper.orderByDesc("create_time");
|
||||
List<VisualizationNodePO> pos = extMapper.queryNodes(queryWrapper);
|
||||
if (CollectionUtil.isNotEmpty(pos)) {
|
||||
if (CollectionUtils.isNotEmpty(pos)) {
|
||||
nodes.addAll(pos.stream().map(this::convert).toList());
|
||||
}
|
||||
return TreeUtils.mergeTree(nodes, BusiNodeVO.class, false);
|
||||
@ -81,7 +81,7 @@ public class CoreVisualizationManage {
|
||||
if (isTopNode(tempPid)) continue;
|
||||
delIds.add(tempPid);
|
||||
List<Long> childrenIdList = extMapper.queryChildrenId(tempPid);
|
||||
if (CollectionUtil.isNotEmpty(childrenIdList)) {
|
||||
if (CollectionUtils.isNotEmpty(childrenIdList)) {
|
||||
childrenIdList.forEach(kid -> {
|
||||
if (!delIds.contains(kid)) {
|
||||
stack.add(kid);
|
||||
@ -112,7 +112,7 @@ public class CoreVisualizationManage {
|
||||
return preInnerSave(visualizationInfo);
|
||||
}
|
||||
|
||||
public Long preInnerSave(DataVisualizationInfo visualizationInfo){
|
||||
public Long preInnerSave(DataVisualizationInfo visualizationInfo) {
|
||||
if (visualizationInfo.getId() == null) {
|
||||
Long id = IDUtils.snowID();
|
||||
visualizationInfo.setId(id);
|
||||
@ -169,7 +169,7 @@ public class CoreVisualizationManage {
|
||||
}
|
||||
|
||||
List<VisualizationResourceVO> formatResult(List<VisualizationResourcePO> pos) {
|
||||
if (CollectionUtil.isEmpty(pos)) {
|
||||
if (CollectionUtils.isEmpty(pos)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
return pos.stream().map(po ->
|
||||
|
@ -1,6 +1,5 @@
|
||||
package io.dataease.visualization.manage;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
@ -18,6 +17,7 @@ import io.dataease.visualization.dao.auto.mapper.CoreStoreMapper;
|
||||
import io.dataease.visualization.dao.ext.mapper.CoreStoreExtMapper;
|
||||
import io.dataease.visualization.dao.ext.po.StorePO;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Component;
|
||||
@ -84,7 +84,7 @@ public class VisualizationStoreManage {
|
||||
}
|
||||
|
||||
public List<VisualizationStoreVO> formatResult(List<StorePO> pos) {
|
||||
if (CollectionUtil.isEmpty(pos)) return new ArrayList<>();
|
||||
if (CollectionUtils.isEmpty(pos)) return new ArrayList<>();
|
||||
return pos.stream().map(po ->
|
||||
new VisualizationStoreVO(
|
||||
po.getStoreId(), po.getResourceId(), po.getName(),
|
||||
|
@ -102,7 +102,7 @@ public class DataVisualizationServer implements DataVisualizationApi {
|
||||
}
|
||||
VisualizationWatermark watermark = watermarkMapper.selectById("system_default");
|
||||
VisualizationWatermarkVO watermarkVO = new VisualizationWatermarkVO();
|
||||
BeanUtils.copyBean(watermarkVO,watermark);
|
||||
BeanUtils.copyBean(watermarkVO, watermark);
|
||||
result.setWatermarkInfo(watermarkVO);
|
||||
return result;
|
||||
} else {
|
||||
@ -117,6 +117,11 @@ public class DataVisualizationServer implements DataVisualizationApi {
|
||||
DataVisualizationInfo visualizationInfo = new DataVisualizationInfo();
|
||||
BeanUtils.copyBean(visualizationInfo, request);
|
||||
visualizationInfo.setNodeType(request.getNodeType() == null ? DataVisualizationConstants.NODE_TYPE.LEAF : request.getNodeType());
|
||||
if (request.getSelfWatermarkStatus() != null && request.getSelfWatermarkStatus()) {
|
||||
visualizationInfo.setSelfWatermarkStatus(1);
|
||||
} else {
|
||||
visualizationInfo.setSelfWatermarkStatus(0);
|
||||
}
|
||||
Long newDvId = coreVisualizationManage.innerSave(visualizationInfo);
|
||||
//保存视图信
|
||||
chartDataManage.saveChartViewFromVisualization(request.getComponentData(), newDvId, request.getCanvasViewInfo());
|
||||
@ -132,12 +137,17 @@ public class DataVisualizationServer implements DataVisualizationApi {
|
||||
}
|
||||
DataVisualizationInfo visualizationInfo = new DataVisualizationInfo();
|
||||
BeanUtils.copyBean(visualizationInfo, request);
|
||||
if(DataVisualizationConstants.RESOURCE_OPT_TYPE.COPY.equals(request.getOptType())){
|
||||
if (request.getSelfWatermarkStatus() != null && request.getSelfWatermarkStatus()) {
|
||||
visualizationInfo.setSelfWatermarkStatus(1);
|
||||
} else {
|
||||
visualizationInfo.setSelfWatermarkStatus(0);
|
||||
}
|
||||
if (DataVisualizationConstants.RESOURCE_OPT_TYPE.COPY.equals(request.getOptType())) {
|
||||
// 复制更新 新建权限插入
|
||||
visualizationInfoMapper.deleteById(dvId);
|
||||
visualizationInfo.setNodeType(DataVisualizationConstants.NODE_TYPE.LEAF);
|
||||
coreVisualizationManage.innerSave(visualizationInfo);
|
||||
}else{
|
||||
} else {
|
||||
// 检查当前节点的pid是否一致如果不一致 需要调用move 接口(预存 可能会出现pid =-1的情况)
|
||||
if (request.getPid() != -1) {
|
||||
QueryWrapper<DataVisualizationInfo> queryWrapper = new QueryWrapper<>();
|
||||
@ -231,7 +241,7 @@ public class DataVisualizationServer implements DataVisualizationApi {
|
||||
extDataVisualizationMapper.copyLinkJumpInfo(copyId);
|
||||
extDataVisualizationMapper.copyLinkJumpTargetInfo(copyId);
|
||||
DataVisualizationInfo visualizationInfoTarget = new DataVisualizationInfo();
|
||||
BeanUtils.copyBean(visualizationInfoTarget,newDv);
|
||||
BeanUtils.copyBean(visualizationInfoTarget, newDv);
|
||||
visualizationInfoTarget.setPid(-1L);
|
||||
coreVisualizationManage.preInnerSave(visualizationInfoTarget);
|
||||
return String.valueOf(newDvId);
|
||||
@ -261,7 +271,11 @@ public class DataVisualizationServer implements DataVisualizationApi {
|
||||
name = visualizationTemplate.getName();
|
||||
dvType = visualizationTemplate.getDvType();
|
||||
// 模板市场记录
|
||||
coreOptRecentManage.saveOpt(request.getTemplateId(), OptConstants.OPT_RESOURCE_TYPE.TEMPLATE,OptConstants.OPT_TYPE.NEW);
|
||||
coreOptRecentManage.saveOpt(request.getTemplateId(), OptConstants.OPT_RESOURCE_TYPE.TEMPLATE, OptConstants.OPT_TYPE.NEW);
|
||||
VisualizationTemplate visualizationTemplateUpdate = new VisualizationTemplate();
|
||||
visualizationTemplateUpdate.setId(visualizationTemplate.getId());
|
||||
visualizationTemplateUpdate.setUseCount(visualizationTemplate.getUseCount() == null ? 0 : visualizationTemplate.getUseCount() + 1);
|
||||
templateMapper.updateById(visualizationTemplateUpdate);
|
||||
} else if (DataVisualizationConstants.NEW_PANEL_FROM.NEW_OUTER_TEMPLATE.equals(newFrom)) {
|
||||
templateStyle = request.getCanvasStyleData();
|
||||
templateData = request.getComponentData();
|
||||
@ -281,7 +295,7 @@ public class DataVisualizationServer implements DataVisualizationApi {
|
||||
name = templateFileInfo.getName();
|
||||
dvType = templateFileInfo.getDvType();
|
||||
// 模板市场记录
|
||||
coreOptRecentManage.saveOpt(request.getResourceName(), OptConstants.OPT_RESOURCE_TYPE.TEMPLATE,OptConstants.OPT_TYPE.NEW);
|
||||
coreOptRecentManage.saveOpt(request.getResourceName(), OptConstants.OPT_RESOURCE_TYPE.TEMPLATE, OptConstants.OPT_TYPE.NEW);
|
||||
}
|
||||
// 解析动态数据
|
||||
Map<String, String> dynamicDataMap = JsonUtil.parseObject(dynamicData, Map.class);
|
||||
@ -292,7 +306,7 @@ public class DataVisualizationServer implements DataVisualizationApi {
|
||||
String originViewId = entry.getKey();
|
||||
String originViewData = JsonUtil.toJSONString(entry.getValue()).toString();
|
||||
ChartViewDTO chartView = JsonUtil.parseObject(originViewData, ChartViewDTO.class);
|
||||
if(chartView == null){
|
||||
if (chartView == null) {
|
||||
continue;
|
||||
}
|
||||
Long newViewId = IDUtils.snowID();
|
||||
|
@ -1,8 +1,6 @@
|
||||
package io.dataease.visualization.server;
|
||||
|
||||
|
||||
import cn.hutool.core.codec.Base64Decoder;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import io.dataease.api.visualization.StaticResourceApi;
|
||||
import io.dataease.api.visualization.request.StaticResourceRequest;
|
||||
import io.dataease.exception.DEException;
|
||||
@ -10,8 +8,10 @@ import io.dataease.utils.FileUtils;
|
||||
import io.dataease.utils.JsonUtil;
|
||||
import io.dataease.utils.LogUtil;
|
||||
import io.dataease.utils.StaticResourceUtils;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.Base64Utils;
|
||||
import org.springframework.util.FileCopyUtils;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
@ -89,17 +89,18 @@ public class StaticResourceServer implements StaticResourceApi {
|
||||
} else {
|
||||
if (StringUtils.isNotEmpty(content)) {
|
||||
Files.createFile(uploadPath);
|
||||
FileCopyUtils.copy(Base64Decoder.decode(content), Files.newOutputStream(uploadPath));
|
||||
FileCopyUtils.copy(Base64Utils.decodeFromString(content), Files.newOutputStream(uploadPath));
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
LogUtil.error("template static resource save error" + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, String> findResourceAsBase64(StaticResourceRequest resourceRequest) {
|
||||
Map<String, String> result = new HashMap<>();
|
||||
if (CollectionUtil.isNotEmpty(resourceRequest.getResourcePathList())) {
|
||||
if (CollectionUtils.isNotEmpty(resourceRequest.getResourcePathList())) {
|
||||
for (String path : resourceRequest.getResourcePathList()) {
|
||||
String value = StaticResourceUtils.getImgFileToBase64(path.substring(path.lastIndexOf("/") + 1, path.length()));
|
||||
result.put(path, value);
|
||||
|
@ -46,6 +46,7 @@ quartz:
|
||||
|
||||
dataease:
|
||||
version: '@project.version@'
|
||||
origin-list: http://192.168.2.70:9080
|
||||
apisix-api:
|
||||
domain: http://192.168.0.121:9180
|
||||
key: edd1c9f034335f136f87ad84b625c8f1
|
||||
|
@ -1,19 +1,4 @@
|
||||
DROP TABLE IF EXISTS `visualization_template`;
|
||||
CREATE TABLE `visualization_template` (
|
||||
`id` varchar(50) NOT NULL COMMENT '主键',
|
||||
`name` varchar(255) DEFAULT NULL COMMENT '名称',
|
||||
`pid` varchar(255) DEFAULT NULL COMMENT '父级id',
|
||||
`level` int DEFAULT NULL COMMENT '层级',
|
||||
`dv_type` varchar(255) DEFAULT NULL COMMENT '模板种类 dataV or dashboard 目录或者文件夹',
|
||||
`node_type` varchar(255) DEFAULT NULL COMMENT '节点类型 folder or panel 目录或者文件夹',
|
||||
`create_by` varchar(255) DEFAULT NULL COMMENT '创建人',
|
||||
`create_time` bigint DEFAULT NULL COMMENT '创建时间',
|
||||
`snapshot` longtext COMMENT '缩略图',
|
||||
`template_type` varchar(255) DEFAULT NULL COMMENT '模板类型 system 系统内置 self 用户自建 ',
|
||||
`template_style` longtext COMMENT 'template 样式',
|
||||
`template_data` longtext COMMENT 'template 数据',
|
||||
`dynamic_data` longtext COMMENT '预存数据',
|
||||
PRIMARY KEY (`id`)
|
||||
CREATE TABLE `visualization_template`
|
||||
(
|
||||
`id` varchar(50) NOT NULL COMMENT '主键',
|
||||
@ -85,7 +70,8 @@ VALUES (30, 0, 1, 'toolbox', null, 7, 'icon_template', '/toolbox', 1, 1, 0);
|
||||
INSERT INTO `core_menu`
|
||||
VALUES (31, 30, 2, 'template-setting', 'toolbox/template-setting', 1, 'icon_template', '/template-setting', 0, 1, 1);
|
||||
|
||||
ALTER TABLE core_opt_recent ADD `resource_name` varchar(255) NULL COMMENT '资源名称';
|
||||
ALTER TABLE core_opt_recent
|
||||
ADD `resource_name` varchar(255) NULL COMMENT '资源名称';
|
||||
|
||||
DROP TABLE IF EXISTS `core_area_custom`;
|
||||
CREATE TABLE `core_area_custom`
|
||||
|
@ -1,177 +1,211 @@
|
||||
ALTER TABLE `QRTZ_BLOB_TRIGGERS` COMMENT = '自定义触发器存储(开源作业调度框架Quartz)';
|
||||
ALTER TABLE `QRTZ_CALENDARS` COMMENT = 'Quartz日历(开源作业调度框架Quartz)';
|
||||
ALTER TABLE `QRTZ_CRON_TRIGGERS` COMMENT = 'CronTrigger存储(开源作业调度框架Quartz)';
|
||||
ALTER TABLE `QRTZ_FIRED_TRIGGERS` COMMENT = '存储已经触发的trigger相关信息(开源作业调度框架Quartz)';
|
||||
ALTER TABLE `QRTZ_JOB_DETAILS` COMMENT = '存储jobDetails信息(开源作业调度框架Quartz)';
|
||||
ALTER TABLE `QRTZ_LOCKS` COMMENT = 'Quartz锁表,为多个节点调度提供分布式锁(开源作业调度框架Quartz)';
|
||||
ALTER TABLE `QRTZ_PAUSED_TRIGGER_GRPS` COMMENT = '存放暂停掉的触发器(开源作业调度框架Quartz)';
|
||||
ALTER TABLE `QRTZ_SCHEDULER_STATE` COMMENT = '存储所有节点的scheduler(开源作业调度框架Quartz)';
|
||||
ALTER TABLE `QRTZ_SIMPLE_TRIGGERS` COMMENT = 'SimpleTrigger存储(开源作业调度框架Quartz)';
|
||||
ALTER TABLE `QRTZ_SIMPROP_TRIGGERS` COMMENT = '存储CalendarIntervalTrigger和DailyTimeIntervalTrigger两种类型的触发器(开源作业调度框架Quartz)';
|
||||
ALTER TABLE `QRTZ_TRIGGERS` COMMENT = '存储定义的trigger(开源作业调度框架Quartz)';
|
||||
ALTER TABLE `area` COMMENT = '地图区域表';
|
||||
ALTER TABLE `core_area_custom` COMMENT = '自定义地图区域信息表';
|
||||
ALTER TABLE `core_chart_view` COMMENT = '组件视图表';
|
||||
ALTER TABLE `core_dataset_group` COMMENT = '数据集分组表';
|
||||
ALTER TABLE `core_dataset_table` COMMENT = 'table数据集';
|
||||
ALTER TABLE `core_dataset_table_field` COMMENT = 'table数据集表字段';
|
||||
ALTER TABLE `core_dataset_table_sql_log` COMMENT = 'table数据集查询sql日志';
|
||||
ALTER TABLE `core_datasource` COMMENT = '数据源表';
|
||||
ALTER TABLE `core_datasource_task` COMMENT = '数据源定时同步任务';
|
||||
ALTER TABLE `core_datasource_task_log` COMMENT = '数据源定时同步任务执行日志';
|
||||
ALTER TABLE `core_de_engine` COMMENT = '数据引擎';
|
||||
ALTER TABLE `core_driver` COMMENT = '驱动';
|
||||
ALTER TABLE `core_driver_jar` COMMENT = '驱动详情';
|
||||
ALTER TABLE `core_menu` COMMENT = '路由菜单';
|
||||
ALTER TABLE `core_opt_recent` COMMENT = '可视化资源表';
|
||||
ALTER TABLE `core_rsa` COMMENT = 'rsa 密钥表';
|
||||
ALTER TABLE `core_store` COMMENT = '用户收藏表';
|
||||
ALTER TABLE `core_sys_setting` COMMENT = '系统设置表';
|
||||
ALTER TABLE `data_visualization_info` COMMENT = '可视化大屏信息表';
|
||||
ALTER TABLE `de_standalone_version` COMMENT = '数据库版本变更记录表';
|
||||
ALTER TABLE `license` COMMENT = '企业版许可证信息表';
|
||||
ALTER TABLE `per_api_key` COMMENT = 'API Key 密钥表';
|
||||
ALTER TABLE `per_auth_busi_role` COMMENT = '角色资源权限配置';
|
||||
ALTER TABLE `per_auth_busi_user` COMMENT = '用户资源权限配置';
|
||||
ALTER TABLE `per_auth_menu` COMMENT = '菜单资源权限配置';
|
||||
ALTER TABLE `per_busi_resource` COMMENT = '企业资源';
|
||||
ALTER TABLE `per_dataset_column_permissions` COMMENT = '数据集列权限';
|
||||
ALTER TABLE `per_dataset_row_permissions_tree` COMMENT = '数据集行权限';
|
||||
ALTER TABLE `per_embedded_instance` COMMENT = '嵌入式应用';
|
||||
ALTER TABLE `per_menu_resource` COMMENT = '菜单资源';
|
||||
ALTER TABLE `per_org` COMMENT = '组织机构';
|
||||
ALTER TABLE `per_role` COMMENT = '角色';
|
||||
ALTER TABLE `per_sys_setting` COMMENT = '系统设置表';
|
||||
ALTER TABLE `per_user` COMMENT = '用户表';
|
||||
ALTER TABLE `per_user_role` COMMENT = '用户角色表';
|
||||
ALTER TABLE `visualization_background` COMMENT = '边框背景表';
|
||||
ALTER TABLE `visualization_background_image` COMMENT = '背景图';
|
||||
ALTER TABLE `visualization_link_jump` COMMENT = '跳转记录表';
|
||||
ALTER TABLE `visualization_link_jump_info` COMMENT = '跳转配置表';
|
||||
ALTER TABLE `visualization_link_jump_target_view_info` COMMENT = '跳转目标仪表板视图字段配置表';
|
||||
ALTER TABLE `visualization_linkage` COMMENT = '联动记录表';
|
||||
ALTER TABLE `visualization_linkage_field` COMMENT = '联动字段';
|
||||
ALTER TABLE `visualization_subject` COMMENT = '主题表';
|
||||
ALTER TABLE `visualization_template_extend_data` COMMENT = '模板视图明细信息表';
|
||||
ALTER TABLE `xpack_setting_authentication` COMMENT = '认证设置';
|
||||
ALTER TABLE `xpack_share` COMMENT = '公共链接';
|
||||
COMMENT ON TABLE `QRTZ_BLOB_TRIGGERS`
|
||||
IS '自定义触发器存储(开源作业调度框架Quartz)';
|
||||
COMMENT ON TABLE `QRTZ_CALENDARS`
|
||||
IS 'Quartz日历(开源作业调度框架Quartz)';
|
||||
COMMENT ON TABLE `QRTZ_CRON_TRIGGERS`
|
||||
IS 'CronTrigger存储(开源作业调度框架Quartz)';
|
||||
COMMENT ON TABLE `QRTZ_FIRED_TRIGGERS`
|
||||
IS '存储已经触发的trigger相关信息(开源作业调度框架Quartz)';
|
||||
COMMENT ON TABLE `QRTZ_JOB_DETAILS`
|
||||
IS '存储jobDetails信息(开源作业调度框架Quartz)';
|
||||
COMMENT ON TABLE `QRTZ_LOCKS`
|
||||
IS 'Quartz锁表,为多个节点调度提供分布式锁(开源作业调度框架Quartz)';
|
||||
COMMENT ON TABLE `QRTZ_PAUSED_TRIGGER_GRPS`
|
||||
IS '存放暂停掉的触发器(开源作业调度框架Quartz)';
|
||||
COMMENT ON TABLE `QRTZ_SCHEDULER_STATE`
|
||||
IS '存储所有节点的scheduler(开源作业调度框架Quartz)';
|
||||
COMMENT ON TABLE `QRTZ_SIMPLE_TRIGGERS`
|
||||
IS 'SimpleTrigger存储(开源作业调度框架Quartz)';
|
||||
COMMENT ON TABLE `QRTZ_SIMPROP_TRIGGERS`
|
||||
IS '存储CalendarIntervalTrigger和DailyTimeIntervalTrigger两种类型的触发器(开源作业调度框架Quartz)';
|
||||
COMMENT ON TABLE `QRTZ_TRIGGERS`
|
||||
IS '存储定义的trigger(开源作业调度框架Quartz)';
|
||||
COMMENT ON TABLE `area`
|
||||
IS '地图区域表';
|
||||
COMMENT ON TABLE `core_area_custom`
|
||||
IS '自定义地图区域信息表';
|
||||
COMMENT ON TABLE `core_chart_view`
|
||||
IS '组件视图表';
|
||||
COMMENT ON TABLE `core_dataset_group`
|
||||
IS '数据集分组表';
|
||||
COMMENT ON TABLE `core_dataset_table`
|
||||
IS 'table数据集';
|
||||
COMMENT ON TABLE `core_dataset_table_field`
|
||||
IS 'table数据集表字段';
|
||||
COMMENT ON TABLE `core_dataset_table_sql_log`
|
||||
IS 'table数据集查询sql日志';
|
||||
COMMENT ON TABLE `core_datasource`
|
||||
IS '数据源表';
|
||||
COMMENT ON TABLE `core_datasource_task`
|
||||
IS '数据源定时同步任务';
|
||||
COMMENT ON TABLE `core_datasource_task_log`
|
||||
IS '数据源定时同步任务执行日志';
|
||||
COMMENT ON TABLE `core_de_engine`
|
||||
IS '数据引擎';
|
||||
COMMENT ON TABLE `core_driver`
|
||||
IS '驱动';
|
||||
COMMENT ON TABLE `core_driver_jar`
|
||||
IS '驱动详情';
|
||||
COMMENT ON TABLE `core_menu`
|
||||
IS '路由菜单';
|
||||
COMMENT ON TABLE `core_opt_recent`
|
||||
IS '可视化资源表';
|
||||
COMMENT ON TABLE `core_rsa`
|
||||
IS 'rsa 密钥表';
|
||||
COMMENT ON TABLE `core_store`
|
||||
IS '用户收藏表';
|
||||
COMMENT ON TABLE `core_sys_setting`
|
||||
IS '系统设置表';
|
||||
COMMENT ON TABLE `data_visualization_info`
|
||||
IS '可视化大屏信息表';
|
||||
|
||||
COMMENT ON TABLE `visualization_background`
|
||||
IS '边框背景表';
|
||||
COMMENT ON TABLE `visualization_background_image`
|
||||
IS '背景图';
|
||||
COMMENT ON TABLE `visualization_link_jump`
|
||||
IS '跳转记录表';
|
||||
COMMENT ON TABLE `visualization_link_jump_info`
|
||||
IS '跳转配置表';
|
||||
COMMENT ON TABLE `visualization_link_jump_target_view_info`
|
||||
IS '跳转目标仪表板视图字段配置表';
|
||||
COMMENT ON TABLE `visualization_linkage`
|
||||
IS '联动记录表';
|
||||
COMMENT ON TABLE `visualization_linkage_field`
|
||||
IS '联动字段';
|
||||
COMMENT ON TABLE `visualization_subject`
|
||||
IS '主题表';
|
||||
COMMENT ON TABLE `visualization_template_extend_data`
|
||||
IS '模板视图明细信息表';
|
||||
|
||||
ALTER TABLE `core_dataset_group`
|
||||
MODIFY COLUMN `qrtz_instance` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT 'Quartz 实例 ID' AFTER `create_time`;
|
||||
MODIFY COLUMN `qrtz_instance` varchar(1024) NULL DEFAULT NULL COMMENT 'Quartz 实例 ID';
|
||||
|
||||
ALTER TABLE `core_dataset_table_field`
|
||||
MODIFY COLUMN `size` int(0) NULL DEFAULT NULL COMMENT '字段长度(允许为空,默认0)' AFTER `type`,
|
||||
MODIFY COLUMN `date_format` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '时间字段类型' AFTER `accuracy`;
|
||||
MODIFY COLUMN `size` int(0) NULL DEFAULT NULL COMMENT '字段长度(允许为空,默认0)';
|
||||
ALTER TABLE `core_dataset_table_field`
|
||||
MODIFY COLUMN `date_format` varchar(255) NULL DEFAULT NULL COMMENT '时间字段类型';
|
||||
|
||||
ALTER TABLE `core_datasource_task`
|
||||
MODIFY COLUMN `extra_data` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '额外数据' AFTER `last_exec_status`;
|
||||
MODIFY COLUMN `extra_data` longtext NULL COMMENT '额外数据';
|
||||
|
||||
ALTER TABLE `core_datasource_task_log`
|
||||
MODIFY COLUMN `trigger_type` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '更新频率类型' AFTER `create_time`;
|
||||
MODIFY COLUMN `trigger_type` varchar(45) NULL DEFAULT NULL COMMENT '更新频率类型';
|
||||
|
||||
ALTER TABLE `core_driver_jar`
|
||||
MODIFY COLUMN `trans_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '替换后的 jar 包名称' AFTER `driver_class`,
|
||||
MODIFY COLUMN `is_trans_name` tinyint(1) NULL DEFAULT NULL COMMENT '是否将上传 jar 包替换了名称(1-是,0-否)' AFTER `trans_name`;
|
||||
MODIFY COLUMN `trans_name` varchar(255) NULL DEFAULT NULL COMMENT '替换后的 jar 包名称';
|
||||
ALTER TABLE `core_driver_jar`
|
||||
MODIFY COLUMN `is_trans_name` tinyint(1) NULL DEFAULT NULL COMMENT '是否将上传 jar 包替换了名称(1-是,0-否)';
|
||||
|
||||
ALTER TABLE `core_rsa`
|
||||
MODIFY COLUMN `aes_key` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT 'AES 加密算法的 key' AFTER `create_time`;
|
||||
MODIFY COLUMN `aes_key` text NOT NULL COMMENT 'AES 加密算法的 key';
|
||||
|
||||
ALTER TABLE `data_visualization_info`
|
||||
MODIFY COLUMN `id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '主键' FIRST;
|
||||
|
||||
ALTER TABLE `de_standalone_version`
|
||||
MODIFY COLUMN `installed_rank` int(0) NOT NULL COMMENT '执行顺序(主键)' FIRST,
|
||||
MODIFY COLUMN `version` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '版本' AFTER `installed_rank`,
|
||||
MODIFY COLUMN `description` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '描述' AFTER `version`,
|
||||
MODIFY COLUMN `type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '类型' AFTER `description`,
|
||||
MODIFY COLUMN `script` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '脚本名称' AFTER `type`,
|
||||
MODIFY COLUMN `checksum` int(0) NULL DEFAULT NULL COMMENT '脚本内容一致性校验码' AFTER `script`,
|
||||
MODIFY COLUMN `installed_by` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '执行用户' AFTER `checksum`,
|
||||
MODIFY COLUMN `installed_on` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '执行时间' AFTER `installed_by`,
|
||||
MODIFY COLUMN `execution_time` int(0) NOT NULL COMMENT '执行时长' AFTER `installed_on`,
|
||||
MODIFY COLUMN `success` tinyint(1) NOT NULL COMMENT '状态(1-成功,0-失败)' AFTER `execution_time`;
|
||||
|
||||
ALTER TABLE `license`
|
||||
MODIFY COLUMN `id` bigint(0) NOT NULL COMMENT '主键' FIRST,
|
||||
MODIFY COLUMN `update_time` bigint(0) NULL DEFAULT NULL COMMENT '更新时间' AFTER `id`,
|
||||
MODIFY COLUMN `license` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT 'license' AFTER `update_time`,
|
||||
MODIFY COLUMN `f2c_license` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT 'F2C License' AFTER `license`;
|
||||
|
||||
ALTER TABLE `per_dataset_column_permissions`
|
||||
MODIFY COLUMN `update_time` bigint(0) NULL DEFAULT NULL COMMENT '更新时间' AFTER `white_list_user`;
|
||||
|
||||
ALTER TABLE `per_dataset_row_permissions_tree`
|
||||
MODIFY COLUMN `update_time` bigint(0) NULL DEFAULT NULL COMMENT '更新时间' AFTER `white_list_dept`;
|
||||
|
||||
ALTER TABLE `per_user`
|
||||
MODIFY COLUMN `pwd` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '密码' AFTER `account`;
|
||||
MODIFY COLUMN `id` varchar(50) NOT NULL COMMENT '主键';
|
||||
|
||||
ALTER TABLE `visualization_background`
|
||||
MODIFY COLUMN `id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '主键' FIRST,
|
||||
MODIFY COLUMN `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '名称' AFTER `id`,
|
||||
MODIFY COLUMN `classification` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '分类名' AFTER `name`,
|
||||
MODIFY COLUMN `content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '内容' AFTER `classification`,
|
||||
MODIFY COLUMN `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '备注' AFTER `content`,
|
||||
MODIFY COLUMN `sort` int(0) NULL DEFAULT NULL COMMENT '排序' AFTER `remark`,
|
||||
MODIFY COLUMN `upload_time` bigint(0) NULL DEFAULT NULL COMMENT '上传时间' AFTER `sort`,
|
||||
MODIFY COLUMN `base_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '所在目录地址' AFTER `upload_time`,
|
||||
MODIFY COLUMN `url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '图片url' AFTER `base_url`;
|
||||
MODIFY COLUMN `id` varchar(64) NOT NULL COMMENT '主键';
|
||||
ALTER TABLE `visualization_background`
|
||||
MODIFY COLUMN `name` varchar(255) NULL DEFAULT NULL COMMENT '名称';
|
||||
ALTER TABLE `visualization_background`
|
||||
MODIFY COLUMN `classification` varchar(255) NOT NULL COMMENT '分类名';
|
||||
ALTER TABLE `visualization_background`
|
||||
MODIFY COLUMN `content` longtext NULL COMMENT '内容';
|
||||
ALTER TABLE `visualization_background`
|
||||
MODIFY COLUMN `remark` varchar(255) NULL DEFAULT NULL COMMENT '备注';
|
||||
ALTER TABLE `visualization_background`
|
||||
MODIFY COLUMN `sort` int(0) NULL DEFAULT NULL COMMENT '排序';
|
||||
ALTER TABLE `visualization_background`
|
||||
MODIFY COLUMN `upload_time` bigint(0) NULL DEFAULT NULL COMMENT '上传时间';
|
||||
ALTER TABLE `visualization_background`
|
||||
MODIFY COLUMN `base_url` varchar(255) NULL DEFAULT NULL COMMENT '所在目录地址';
|
||||
ALTER TABLE `visualization_background`
|
||||
MODIFY COLUMN `url` varchar(255) NULL DEFAULT NULL COMMENT '图片url';
|
||||
|
||||
ALTER TABLE `visualization_background_image`
|
||||
MODIFY COLUMN `id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '主键' FIRST,
|
||||
MODIFY COLUMN `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '名称' AFTER `id`,
|
||||
MODIFY COLUMN `classification` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '分类名' AFTER `name`,
|
||||
MODIFY COLUMN `content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '内容' AFTER `classification`,
|
||||
MODIFY COLUMN `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '备注' AFTER `content`,
|
||||
MODIFY COLUMN `sort` int(0) NULL DEFAULT NULL COMMENT '排序' AFTER `remark`,
|
||||
MODIFY COLUMN `upload_time` bigint(0) NULL DEFAULT NULL COMMENT '上传时间' AFTER `sort`,
|
||||
MODIFY COLUMN `base_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '所在目录地址' AFTER `upload_time`,
|
||||
MODIFY COLUMN `url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '图片url' AFTER `base_url`;
|
||||
MODIFY COLUMN `id` varchar(64) NOT NULL COMMENT '主键';
|
||||
ALTER TABLE `visualization_background_image`
|
||||
MODIFY COLUMN `name` varchar(255) NULL DEFAULT NULL COMMENT '名称';
|
||||
ALTER TABLE `visualization_background_image`
|
||||
MODIFY COLUMN `classification` varchar(255) NOT NULL COMMENT '分类名';
|
||||
ALTER TABLE `visualization_background_image`
|
||||
MODIFY COLUMN `content` longtext NULL COMMENT '内容';
|
||||
ALTER TABLE `visualization_background_image`
|
||||
MODIFY COLUMN `remark` varchar(255) NULL DEFAULT NULL COMMENT '备注';
|
||||
ALTER TABLE `visualization_background_image`
|
||||
MODIFY COLUMN `sort` int(0) NULL DEFAULT NULL COMMENT '排序';
|
||||
ALTER TABLE `visualization_background_image`
|
||||
MODIFY COLUMN `upload_time` bigint(0) NULL DEFAULT NULL COMMENT '上传时间';
|
||||
ALTER TABLE `visualization_background_image`
|
||||
MODIFY COLUMN `base_url` varchar(255) NULL DEFAULT NULL COMMENT '所在目录地址';
|
||||
ALTER TABLE `visualization_background_image`
|
||||
MODIFY COLUMN `url` varchar(255) NULL DEFAULT NULL COMMENT '图片url';
|
||||
|
||||
ALTER TABLE `visualization_link_jump`
|
||||
MODIFY COLUMN `id` bigint(0) NOT NULL COMMENT '主键' FIRST,
|
||||
MODIFY COLUMN `copy_from` bigint(0) NULL DEFAULT NULL COMMENT '复制来源' AFTER `checked`,
|
||||
MODIFY COLUMN `copy_id` bigint(0) NULL DEFAULT NULL COMMENT '复制来源ID' AFTER `copy_from`;
|
||||
MODIFY COLUMN `id` bigint(0) NOT NULL COMMENT '主键';
|
||||
ALTER TABLE `visualization_link_jump`
|
||||
MODIFY COLUMN `copy_from` bigint(0) NULL DEFAULT NULL COMMENT '复制来源';
|
||||
ALTER TABLE `visualization_link_jump`
|
||||
MODIFY COLUMN `copy_id` bigint(0) NULL DEFAULT NULL COMMENT '复制来源ID';
|
||||
|
||||
ALTER TABLE `visualization_link_jump_info`
|
||||
MODIFY COLUMN `id` bigint(0) NOT NULL COMMENT '主键' FIRST,
|
||||
MODIFY COLUMN `copy_from` bigint(0) NULL DEFAULT NULL COMMENT '复制来源' AFTER `attach_params`,
|
||||
MODIFY COLUMN `copy_id` bigint(0) NULL DEFAULT NULL COMMENT '复制来源ID' AFTER `copy_from`;
|
||||
MODIFY COLUMN `id` bigint(0) NOT NULL COMMENT '主键';
|
||||
ALTER TABLE `visualization_link_jump_info`
|
||||
MODIFY COLUMN `copy_from` bigint(0) NULL DEFAULT NULL COMMENT '复制来源';
|
||||
ALTER TABLE `visualization_link_jump_info`
|
||||
MODIFY COLUMN `copy_id` bigint(0) NULL DEFAULT NULL COMMENT '复制来源ID';
|
||||
|
||||
ALTER TABLE `visualization_link_jump_target_view_info`
|
||||
MODIFY COLUMN `target_id` bigint(0) NOT NULL COMMENT '主键' FIRST,
|
||||
MODIFY COLUMN `link_jump_info_id` bigint(0) NULL DEFAULT NULL COMMENT 'visualization_link_jump_info 表的 ID' AFTER `target_id`,
|
||||
MODIFY COLUMN `target_view_id` bigint(0) NULL DEFAULT NULL COMMENT '目标视图ID' AFTER `source_field_active_id`,
|
||||
MODIFY COLUMN `target_field_id` bigint(0) NULL DEFAULT NULL COMMENT '目标字段ID' AFTER `target_view_id`,
|
||||
MODIFY COLUMN `copy_from` bigint(0) NULL DEFAULT NULL COMMENT '复制来源' AFTER `target_field_id`,
|
||||
MODIFY COLUMN `copy_id` bigint(0) NULL DEFAULT NULL COMMENT '复制来源ID' AFTER `copy_from`;
|
||||
MODIFY COLUMN `target_id` bigint(0) NOT NULL COMMENT '主键';
|
||||
ALTER TABLE `visualization_link_jump_target_view_info`
|
||||
MODIFY COLUMN `link_jump_info_id` bigint(0) NULL DEFAULT NULL COMMENT 'visualization_link_jump_info 表的 ID';
|
||||
ALTER TABLE `visualization_link_jump_target_view_info`
|
||||
MODIFY COLUMN `target_view_id` bigint(0) NULL DEFAULT NULL COMMENT '目标视图ID';
|
||||
ALTER TABLE `visualization_link_jump_target_view_info`
|
||||
MODIFY COLUMN `target_field_id` bigint(0) NULL DEFAULT NULL COMMENT '目标字段ID';
|
||||
ALTER TABLE `visualization_link_jump_target_view_info`
|
||||
MODIFY COLUMN `copy_from` bigint(0) NULL DEFAULT NULL COMMENT '复制来源';
|
||||
ALTER TABLE `visualization_link_jump_target_view_info`
|
||||
MODIFY COLUMN `copy_id` bigint(0) NULL DEFAULT NULL COMMENT '复制来源ID';
|
||||
|
||||
ALTER TABLE `visualization_linkage`
|
||||
MODIFY COLUMN `id` bigint(0) NOT NULL COMMENT '主键' FIRST,
|
||||
MODIFY COLUMN `dv_id` bigint(0) NULL DEFAULT NULL COMMENT '联动大屏/仪表板ID' AFTER `id`,
|
||||
MODIFY COLUMN `ext1` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '扩展字段1' AFTER `linkage_active`,
|
||||
MODIFY COLUMN `ext2` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '扩展字段2' AFTER `ext1`,
|
||||
MODIFY COLUMN `copy_from` bigint(0) NULL DEFAULT NULL COMMENT '复制来源' AFTER `ext2`,
|
||||
MODIFY COLUMN `copy_id` bigint(0) NULL DEFAULT NULL COMMENT '复制来源ID' AFTER `copy_from`;
|
||||
MODIFY COLUMN `id` bigint(0) NOT NULL COMMENT '主键';
|
||||
ALTER TABLE `visualization_linkage`
|
||||
MODIFY COLUMN `dv_id` bigint(0) NULL DEFAULT NULL COMMENT '联动大屏/仪表板ID';
|
||||
ALTER TABLE `visualization_linkage`
|
||||
MODIFY COLUMN `ext1` varchar(2000) NULL DEFAULT NULL COMMENT '扩展字段1';
|
||||
ALTER TABLE `visualization_linkage`
|
||||
MODIFY COLUMN `ext2` varchar(2000) NULL DEFAULT NULL COMMENT '扩展字段2';
|
||||
ALTER TABLE `visualization_linkage`
|
||||
MODIFY COLUMN `copy_from` bigint(0) NULL DEFAULT NULL COMMENT '复制来源';
|
||||
ALTER TABLE `visualization_linkage`
|
||||
MODIFY COLUMN `copy_id` bigint(0) NULL DEFAULT NULL COMMENT '复制来源ID';
|
||||
|
||||
ALTER TABLE `visualization_linkage_field`
|
||||
MODIFY COLUMN `id` bigint(0) NOT NULL COMMENT '主键' FIRST,
|
||||
MODIFY COLUMN `copy_from` bigint(0) NULL DEFAULT NULL COMMENT '复制来源' AFTER `update_time`,
|
||||
MODIFY COLUMN `copy_id` bigint(0) NULL DEFAULT NULL COMMENT '复制来源ID' AFTER `copy_from`;
|
||||
MODIFY COLUMN `id` bigint(0) NOT NULL COMMENT '主键';
|
||||
ALTER TABLE `visualization_linkage_field`
|
||||
MODIFY COLUMN `copy_from` bigint(0) NULL DEFAULT NULL COMMENT '复制来源';
|
||||
ALTER TABLE `visualization_linkage_field`
|
||||
MODIFY COLUMN `copy_id` bigint(0) NULL DEFAULT NULL COMMENT '复制来源ID';
|
||||
|
||||
ALTER TABLE `visualization_subject`
|
||||
MODIFY COLUMN `create_num` int(0) NOT NULL DEFAULT 0 COMMENT '创建序号' AFTER `cover_url`;
|
||||
MODIFY COLUMN `create_num` int(0) NOT NULL DEFAULT 0 COMMENT '创建序号';
|
||||
|
||||
ALTER TABLE `visualization_template_category`
|
||||
MODIFY COLUMN `template_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '模版类型 system 系统内置 self 用户自建' AFTER `snapshot`;
|
||||
MODIFY COLUMN `template_type` varchar(255) NULL DEFAULT NULL COMMENT '模版类型 system 系统内置 self 用户自建';
|
||||
|
||||
ALTER TABLE `visualization_template_extend_data`
|
||||
MODIFY COLUMN `id` bigint(0) NOT NULL COMMENT '主键' FIRST,
|
||||
MODIFY COLUMN `dv_id` bigint(0) NULL DEFAULT NULL COMMENT '模板ID' AFTER `id`,
|
||||
MODIFY COLUMN `view_id` bigint(0) NULL DEFAULT NULL COMMENT '视图ID' AFTER `dv_id`,
|
||||
MODIFY COLUMN `view_details` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '视图详情' AFTER `view_id`,
|
||||
MODIFY COLUMN `copy_from` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '复制来源' AFTER `view_details`,
|
||||
MODIFY COLUMN `copy_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '复制来源ID' AFTER `copy_from`;
|
||||
MODIFY COLUMN `id` bigint(0) NOT NULL COMMENT '主键';
|
||||
ALTER TABLE `visualization_template_extend_data`
|
||||
MODIFY COLUMN `dv_id` bigint(0) NULL DEFAULT NULL COMMENT '模板ID';
|
||||
ALTER TABLE `visualization_template_extend_data`
|
||||
MODIFY COLUMN `view_id` bigint(0) NULL DEFAULT NULL COMMENT '视图ID';
|
||||
ALTER TABLE `visualization_template_extend_data`
|
||||
MODIFY COLUMN `view_details` longtext NULL COMMENT '视图详情';
|
||||
ALTER TABLE `visualization_template_extend_data`
|
||||
MODIFY COLUMN `copy_from` varchar(255) NULL DEFAULT NULL COMMENT '复制来源';
|
||||
ALTER TABLE `visualization_template_extend_data`
|
||||
MODIFY COLUMN `copy_id` varchar(255) NULL DEFAULT NULL COMMENT '复制来源ID';
|
||||
|
||||
ALTER TABLE `core_opt_recent`
|
||||
MODIFY COLUMN `resource_type` int(0) NOT NULL COMMENT '资源类型 1-可视化资源 2-仪表板 3-数据大屏 4-数据集 5-数据源 6-模板' AFTER `uid`;
|
||||
MODIFY COLUMN `resource_type` int(0) NOT NULL COMMENT '资源类型 1-可视化资源 2-仪表板 3-数据大屏 4-数据集 5-数据源 6-模板';
|
||||
|
@ -1,12 +1,25 @@
|
||||
|
||||
DROP TABLE IF EXISTS `visualization_watermark`;
|
||||
CREATE TABLE `visualization_watermark` (
|
||||
`id` varchar(50) NOT NULL COMMENT '主键',
|
||||
`version` varchar(255) DEFAULT NULL COMMENT '版本号',
|
||||
`setting_content` longtext COMMENT '设置内容',
|
||||
`create_by` varchar(255) DEFAULT NULL COMMENT '创建人',
|
||||
`create_time` bigint(13) DEFAULT NULL COMMENT '创建时间',
|
||||
PRIMARY KEY (`id`)
|
||||
) COMMENT='仪表板水印设置表';
|
||||
CREATE TABLE `visualization_watermark`
|
||||
(
|
||||
`id` varchar(50) NOT NULL COMMENT '主键',
|
||||
`version` varchar(255) DEFAULT NULL COMMENT '版本号',
|
||||
`setting_content` longtext COMMENT '设置内容',
|
||||
`create_by` varchar(255) DEFAULT NULL COMMENT '创建人',
|
||||
`create_time` bigint(13) DEFAULT NULL COMMENT '创建时间',
|
||||
PRIMARY KEY (`id`)
|
||||
) COMMENT ='仪表板水印设置表';
|
||||
|
||||
INSERT INTO `visualization_watermark` (`id`, `version`, `setting_content`, `create_by`, `create_time`)
|
||||
VALUES ('system_default', '1.0',
|
||||
'{\"enable\":false,\"enablePanelCustom\":true,\"type\":\"custom\",\"content\":\"水印\",\"watermark_color\":\"#DD1010\",\"watermark_x_space\":12,\"watermark_y_space\":36,\"watermark_fontsize\":15}',
|
||||
'admin', NULL);
|
||||
|
||||
|
||||
INSERT INTO `core_sys_setting` (`id`, `pkey`, `pval`, `type`, `sort`)
|
||||
VALUES (9, 'basic.frontTimeOut', '60', 'text', 1);
|
||||
|
||||
ALTER TABLE `visualization_template`
|
||||
ADD COLUMN `use_count` int NULL DEFAULT 0 COMMENT '使用次数';
|
||||
|
||||
update visualization_template set use_count = 0;
|
||||
|
||||
INSERT INTO `visualization_watermark` (`id`, `version`, `setting_content`, `create_by`, `create_time`) VALUES ('system_default', '1.0', '{\"enable\":false,\"enablePanelCustom\":true,\"type\":\"custom\",\"content\":\"水印\",\"watermark_color\":\"#DD1010\",\"watermark_x_space\":12,\"watermark_y_space\":36,\"watermark_fontsize\":15}', 'admin', NULL);
|
||||
|
@ -1,132 +1,142 @@
|
||||
ALTER TABLE `QRTZ_BLOB_TRIGGERS` COMMENT = '自定义触发器存储(开源作业调度框架Quartz)';
|
||||
ALTER TABLE `QRTZ_CALENDARS` COMMENT = 'Quartz日历(开源作业调度框架Quartz)';
|
||||
ALTER TABLE `QRTZ_CRON_TRIGGERS` COMMENT = 'CronTrigger存储(开源作业调度框架Quartz)';
|
||||
ALTER TABLE `QRTZ_FIRED_TRIGGERS` COMMENT = '存储已经触发的trigger相关信息(开源作业调度框架Quartz)';
|
||||
ALTER TABLE `QRTZ_JOB_DETAILS` COMMENT = '存储jobDetails信息(开源作业调度框架Quartz)';
|
||||
ALTER TABLE `QRTZ_LOCKS` COMMENT = 'Quartz锁表,为多个节点调度提供分布式锁(开源作业调度框架Quartz)';
|
||||
ALTER TABLE `QRTZ_PAUSED_TRIGGER_GRPS` COMMENT = '存放暂停掉的触发器(开源作业调度框架Quartz)';
|
||||
ALTER TABLE `QRTZ_SCHEDULER_STATE` COMMENT = '存储所有节点的scheduler(开源作业调度框架Quartz)';
|
||||
ALTER TABLE `QRTZ_SIMPLE_TRIGGERS` COMMENT = 'SimpleTrigger存储(开源作业调度框架Quartz)';
|
||||
ALTER TABLE `QRTZ_SIMPROP_TRIGGERS` COMMENT = '存储CalendarIntervalTrigger和DailyTimeIntervalTrigger两种类型的触发器(开源作业调度框架Quartz)';
|
||||
ALTER TABLE `QRTZ_TRIGGERS` COMMENT = '存储定义的trigger(开源作业调度框架Quartz)';
|
||||
ALTER TABLE `area` COMMENT = '地图区域表';
|
||||
ALTER TABLE `core_area_custom` COMMENT = '自定义地图区域信息表';
|
||||
ALTER TABLE `core_chart_view` COMMENT = '组件视图表';
|
||||
ALTER TABLE `core_dataset_group` COMMENT = '数据集分组表';
|
||||
ALTER TABLE `core_dataset_table` COMMENT = 'table数据集';
|
||||
ALTER TABLE `core_dataset_table_field` COMMENT = 'table数据集表字段';
|
||||
ALTER TABLE `core_dataset_table_sql_log` COMMENT = 'table数据集查询sql日志';
|
||||
ALTER TABLE `core_datasource` COMMENT = '数据源表';
|
||||
ALTER TABLE `core_datasource_task` COMMENT = '数据源定时同步任务';
|
||||
ALTER TABLE `core_datasource_task_log` COMMENT = '数据源定时同步任务执行日志';
|
||||
ALTER TABLE `core_de_engine` COMMENT = '数据引擎';
|
||||
ALTER TABLE `core_driver` COMMENT = '驱动';
|
||||
ALTER TABLE `core_driver_jar` COMMENT = '驱动详情';
|
||||
ALTER TABLE `core_menu` COMMENT = '路由菜单';
|
||||
ALTER TABLE `core_opt_recent` COMMENT = '可视化资源表';
|
||||
ALTER TABLE `core_rsa` COMMENT = 'rsa 密钥表';
|
||||
ALTER TABLE `core_store` COMMENT = '用户收藏表';
|
||||
ALTER TABLE `core_sys_setting` COMMENT = '系统设置表';
|
||||
ALTER TABLE `data_visualization_info` COMMENT = '可视化大屏信息表';
|
||||
ALTER TABLE `de_standalone_version` COMMENT = '数据库版本变更记录表';
|
||||
ALTER TABLE `license` COMMENT = '企业版许可证信息表';
|
||||
ALTER TABLE `per_api_key` COMMENT = 'API Key 密钥表';
|
||||
ALTER TABLE `per_auth_busi_role` COMMENT = '角色资源权限配置';
|
||||
ALTER TABLE `per_auth_busi_user` COMMENT = '用户资源权限配置';
|
||||
ALTER TABLE `per_auth_menu` COMMENT = '菜单资源权限配置';
|
||||
ALTER TABLE `per_busi_resource` COMMENT = '企业资源';
|
||||
ALTER TABLE `per_dataset_column_permissions` COMMENT = '数据集列权限';
|
||||
ALTER TABLE `per_dataset_row_permissions_tree` COMMENT = '数据集行权限';
|
||||
ALTER TABLE `per_embedded_instance` COMMENT = '嵌入式应用';
|
||||
ALTER TABLE `per_menu_resource` COMMENT = '菜单资源';
|
||||
ALTER TABLE `per_org` COMMENT = '组织机构';
|
||||
ALTER TABLE `per_role` COMMENT = '角色';
|
||||
ALTER TABLE `per_sys_setting` COMMENT = '系统设置表';
|
||||
ALTER TABLE `per_user` COMMENT = '用户表';
|
||||
ALTER TABLE `per_user_role` COMMENT = '用户角色表';
|
||||
ALTER TABLE `visualization_background` COMMENT = '边框背景表';
|
||||
ALTER TABLE `visualization_background_image` COMMENT = '背景图';
|
||||
ALTER TABLE `visualization_link_jump` COMMENT = '跳转记录表';
|
||||
ALTER TABLE `visualization_link_jump_info` COMMENT = '跳转配置表';
|
||||
ALTER TABLE `visualization_link_jump_target_view_info` COMMENT = '跳转目标仪表板视图字段配置表';
|
||||
ALTER TABLE `visualization_linkage` COMMENT = '联动记录表';
|
||||
ALTER TABLE `visualization_linkage_field` COMMENT = '联动字段';
|
||||
ALTER TABLE `visualization_subject` COMMENT = '主题表';
|
||||
ALTER TABLE `visualization_template_extend_data` COMMENT = '模板视图明细信息表';
|
||||
ALTER TABLE `xpack_setting_authentication` COMMENT = '认证设置';
|
||||
ALTER TABLE `xpack_share` COMMENT = '公共链接';
|
||||
ALTER TABLE `QRTZ_BLOB_TRIGGERS`
|
||||
COMMENT = '自定义触发器存储(开源作业调度框架Quartz)';
|
||||
ALTER TABLE `QRTZ_CALENDARS`
|
||||
COMMENT = 'Quartz日历(开源作业调度框架Quartz)';
|
||||
ALTER TABLE `QRTZ_CRON_TRIGGERS`
|
||||
COMMENT = 'CronTrigger存储(开源作业调度框架Quartz)';
|
||||
ALTER TABLE `QRTZ_FIRED_TRIGGERS`
|
||||
COMMENT = '存储已经触发的trigger相关信息(开源作业调度框架Quartz)';
|
||||
ALTER TABLE `QRTZ_JOB_DETAILS`
|
||||
COMMENT = '存储jobDetails信息(开源作业调度框架Quartz)';
|
||||
ALTER TABLE `QRTZ_LOCKS`
|
||||
COMMENT = 'Quartz锁表,为多个节点调度提供分布式锁(开源作业调度框架Quartz)';
|
||||
ALTER TABLE `QRTZ_PAUSED_TRIGGER_GRPS`
|
||||
COMMENT = '存放暂停掉的触发器(开源作业调度框架Quartz)';
|
||||
ALTER TABLE `QRTZ_SCHEDULER_STATE`
|
||||
COMMENT = '存储所有节点的scheduler(开源作业调度框架Quartz)';
|
||||
ALTER TABLE `QRTZ_SIMPLE_TRIGGERS`
|
||||
COMMENT = 'SimpleTrigger存储(开源作业调度框架Quartz)';
|
||||
ALTER TABLE `QRTZ_SIMPROP_TRIGGERS`
|
||||
COMMENT = '存储CalendarIntervalTrigger和DailyTimeIntervalTrigger两种类型的触发器(开源作业调度框架Quartz)';
|
||||
ALTER TABLE `QRTZ_TRIGGERS`
|
||||
COMMENT = '存储定义的trigger(开源作业调度框架Quartz)';
|
||||
ALTER TABLE `area`
|
||||
COMMENT = '地图区域表';
|
||||
ALTER TABLE `core_area_custom`
|
||||
COMMENT = '自定义地图区域信息表';
|
||||
ALTER TABLE `core_chart_view`
|
||||
COMMENT = '组件视图表';
|
||||
ALTER TABLE `core_dataset_group`
|
||||
COMMENT = '数据集分组表';
|
||||
ALTER TABLE `core_dataset_table`
|
||||
COMMENT = 'table数据集';
|
||||
ALTER TABLE `core_dataset_table_field`
|
||||
COMMENT = 'table数据集表字段';
|
||||
ALTER TABLE `core_dataset_table_sql_log`
|
||||
COMMENT = 'table数据集查询sql日志';
|
||||
ALTER TABLE `core_datasource`
|
||||
COMMENT = '数据源表';
|
||||
ALTER TABLE `core_datasource_task`
|
||||
COMMENT = '数据源定时同步任务';
|
||||
ALTER TABLE `core_datasource_task_log`
|
||||
COMMENT = '数据源定时同步任务执行日志';
|
||||
ALTER TABLE `core_de_engine`
|
||||
COMMENT = '数据引擎';
|
||||
ALTER TABLE `core_driver`
|
||||
COMMENT = '驱动';
|
||||
ALTER TABLE `core_driver_jar`
|
||||
COMMENT = '驱动详情';
|
||||
ALTER TABLE `core_menu`
|
||||
COMMENT = '路由菜单';
|
||||
ALTER TABLE `core_opt_recent`
|
||||
COMMENT = '可视化资源表';
|
||||
ALTER TABLE `core_rsa`
|
||||
COMMENT = 'rsa 密钥表';
|
||||
ALTER TABLE `core_store`
|
||||
COMMENT = '用户收藏表';
|
||||
ALTER TABLE `core_sys_setting`
|
||||
COMMENT = '系统设置表';
|
||||
ALTER TABLE `data_visualization_info`
|
||||
COMMENT = '可视化大屏信息表';
|
||||
ALTER TABLE `de_standalone_version`
|
||||
COMMENT = '数据库版本变更记录表';
|
||||
|
||||
ALTER TABLE `visualization_background`
|
||||
COMMENT = '边框背景表';
|
||||
ALTER TABLE `visualization_background_image`
|
||||
COMMENT = '背景图';
|
||||
ALTER TABLE `visualization_link_jump`
|
||||
COMMENT = '跳转记录表';
|
||||
ALTER TABLE `visualization_link_jump_info`
|
||||
COMMENT = '跳转配置表';
|
||||
ALTER TABLE `visualization_link_jump_target_view_info`
|
||||
COMMENT = '跳转目标仪表板视图字段配置表';
|
||||
ALTER TABLE `visualization_linkage`
|
||||
COMMENT = '联动记录表';
|
||||
ALTER TABLE `visualization_linkage_field`
|
||||
COMMENT = '联动字段';
|
||||
ALTER TABLE `visualization_subject`
|
||||
COMMENT = '主题表';
|
||||
ALTER TABLE `visualization_template_extend_data`
|
||||
COMMENT = '模板视图明细信息表';
|
||||
|
||||
ALTER TABLE `core_dataset_group`
|
||||
MODIFY COLUMN `qrtz_instance` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT 'Quartz 实例 ID' AFTER `create_time`;
|
||||
MODIFY COLUMN `qrtz_instance` varchar(1024) NULL DEFAULT NULL COMMENT 'Quartz 实例 ID' AFTER `create_time`;
|
||||
|
||||
ALTER TABLE `core_dataset_table_field`
|
||||
MODIFY COLUMN `size` int(0) NULL DEFAULT NULL COMMENT '字段长度(允许为空,默认0)' AFTER `type`,
|
||||
MODIFY COLUMN `date_format` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '时间字段类型' AFTER `accuracy`;
|
||||
MODIFY COLUMN `date_format` varchar(255) NULL DEFAULT NULL COMMENT '时间字段类型' AFTER `accuracy`;
|
||||
|
||||
ALTER TABLE `core_datasource_task`
|
||||
MODIFY COLUMN `extra_data` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '额外数据' AFTER `last_exec_status`;
|
||||
MODIFY COLUMN `extra_data` longtext NULL COMMENT '额外数据' AFTER `last_exec_status`;
|
||||
|
||||
ALTER TABLE `core_datasource_task_log`
|
||||
MODIFY COLUMN `trigger_type` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '更新频率类型' AFTER `create_time`;
|
||||
MODIFY COLUMN `trigger_type` varchar(45) NULL DEFAULT NULL COMMENT '更新频率类型' AFTER `create_time`;
|
||||
|
||||
ALTER TABLE `core_driver_jar`
|
||||
MODIFY COLUMN `trans_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '替换后的 jar 包名称' AFTER `driver_class`,
|
||||
MODIFY COLUMN `trans_name` varchar(255) NULL DEFAULT NULL COMMENT '替换后的 jar 包名称' AFTER `driver_class`,
|
||||
MODIFY COLUMN `is_trans_name` tinyint(1) NULL DEFAULT NULL COMMENT '是否将上传 jar 包替换了名称(1-是,0-否)' AFTER `trans_name`;
|
||||
|
||||
ALTER TABLE `core_rsa`
|
||||
MODIFY COLUMN `aes_key` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT 'AES 加密算法的 key' AFTER `create_time`;
|
||||
MODIFY COLUMN `aes_key` text NOT NULL COMMENT 'AES 加密算法的 key' AFTER `create_time`;
|
||||
|
||||
ALTER TABLE `data_visualization_info`
|
||||
MODIFY COLUMN `id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '主键' FIRST;
|
||||
MODIFY COLUMN `id` varchar(50) NOT NULL COMMENT '主键' FIRST;
|
||||
|
||||
ALTER TABLE `de_standalone_version`
|
||||
MODIFY COLUMN `installed_rank` int(0) NOT NULL COMMENT '执行顺序(主键)' FIRST,
|
||||
MODIFY COLUMN `version` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '版本' AFTER `installed_rank`,
|
||||
MODIFY COLUMN `description` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '描述' AFTER `version`,
|
||||
MODIFY COLUMN `type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '类型' AFTER `description`,
|
||||
MODIFY COLUMN `script` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '脚本名称' AFTER `type`,
|
||||
MODIFY COLUMN `version` varchar(50) NULL DEFAULT NULL COMMENT '版本' AFTER `installed_rank`,
|
||||
MODIFY COLUMN `description` varchar(200) NOT NULL COMMENT '描述' AFTER `version`,
|
||||
MODIFY COLUMN `type` varchar(20) NOT NULL COMMENT '类型' AFTER `description`,
|
||||
MODIFY COLUMN `script` varchar(1000) NOT NULL COMMENT '脚本名称' AFTER `type`,
|
||||
MODIFY COLUMN `checksum` int(0) NULL DEFAULT NULL COMMENT '脚本内容一致性校验码' AFTER `script`,
|
||||
MODIFY COLUMN `installed_by` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '执行用户' AFTER `checksum`,
|
||||
MODIFY COLUMN `installed_by` varchar(100) NOT NULL COMMENT '执行用户' AFTER `checksum`,
|
||||
MODIFY COLUMN `installed_on` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '执行时间' AFTER `installed_by`,
|
||||
MODIFY COLUMN `execution_time` int(0) NOT NULL COMMENT '执行时长' AFTER `installed_on`,
|
||||
MODIFY COLUMN `success` tinyint(1) NOT NULL COMMENT '状态(1-成功,0-失败)' AFTER `execution_time`;
|
||||
|
||||
ALTER TABLE `license`
|
||||
MODIFY COLUMN `id` bigint(0) NOT NULL COMMENT '主键' FIRST,
|
||||
MODIFY COLUMN `update_time` bigint(0) NULL DEFAULT NULL COMMENT '更新时间' AFTER `id`,
|
||||
MODIFY COLUMN `license` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT 'license' AFTER `update_time`,
|
||||
MODIFY COLUMN `f2c_license` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT 'F2C License' AFTER `license`;
|
||||
|
||||
ALTER TABLE `per_dataset_column_permissions`
|
||||
MODIFY COLUMN `update_time` bigint(0) NULL DEFAULT NULL COMMENT '更新时间' AFTER `white_list_user`;
|
||||
|
||||
ALTER TABLE `per_dataset_row_permissions_tree`
|
||||
MODIFY COLUMN `update_time` bigint(0) NULL DEFAULT NULL COMMENT '更新时间' AFTER `white_list_dept`;
|
||||
|
||||
ALTER TABLE `per_user`
|
||||
MODIFY COLUMN `pwd` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '密码' AFTER `account`;
|
||||
|
||||
ALTER TABLE `visualization_background`
|
||||
MODIFY COLUMN `id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '主键' FIRST,
|
||||
MODIFY COLUMN `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '名称' AFTER `id`,
|
||||
MODIFY COLUMN `classification` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '分类名' AFTER `name`,
|
||||
MODIFY COLUMN `content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '内容' AFTER `classification`,
|
||||
MODIFY COLUMN `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '备注' AFTER `content`,
|
||||
MODIFY COLUMN `id` varchar(64) NOT NULL COMMENT '主键' FIRST,
|
||||
MODIFY COLUMN `name` varchar(255) NULL DEFAULT NULL COMMENT '名称' AFTER `id`,
|
||||
MODIFY COLUMN `classification` varchar(255) NOT NULL COMMENT '分类名' AFTER `name`,
|
||||
MODIFY COLUMN `content` longtext NULL COMMENT '内容' AFTER `classification`,
|
||||
MODIFY COLUMN `remark` varchar(255) NULL DEFAULT NULL COMMENT '备注' AFTER `content`,
|
||||
MODIFY COLUMN `sort` int(0) NULL DEFAULT NULL COMMENT '排序' AFTER `remark`,
|
||||
MODIFY COLUMN `upload_time` bigint(0) NULL DEFAULT NULL COMMENT '上传时间' AFTER `sort`,
|
||||
MODIFY COLUMN `base_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '所在目录地址' AFTER `upload_time`,
|
||||
MODIFY COLUMN `url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '图片url' AFTER `base_url`;
|
||||
MODIFY COLUMN `base_url` varchar(255) NULL DEFAULT NULL COMMENT '所在目录地址' AFTER `upload_time`,
|
||||
MODIFY COLUMN `url` varchar(255) NULL DEFAULT NULL COMMENT '图片url' AFTER `base_url`;
|
||||
|
||||
ALTER TABLE `visualization_background_image`
|
||||
MODIFY COLUMN `id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '主键' FIRST,
|
||||
MODIFY COLUMN `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '名称' AFTER `id`,
|
||||
MODIFY COLUMN `classification` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '分类名' AFTER `name`,
|
||||
MODIFY COLUMN `content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '内容' AFTER `classification`,
|
||||
MODIFY COLUMN `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '备注' AFTER `content`,
|
||||
MODIFY COLUMN `id` varchar(64) NOT NULL COMMENT '主键' FIRST,
|
||||
MODIFY COLUMN `name` varchar(255) NULL DEFAULT NULL COMMENT '名称' AFTER `id`,
|
||||
MODIFY COLUMN `classification` varchar(255) NOT NULL COMMENT '分类名' AFTER `name`,
|
||||
MODIFY COLUMN `content` longtext NULL COMMENT '内容' AFTER `classification`,
|
||||
MODIFY COLUMN `remark` varchar(255) NULL DEFAULT NULL COMMENT '备注' AFTER `content`,
|
||||
MODIFY COLUMN `sort` int(0) NULL DEFAULT NULL COMMENT '排序' AFTER `remark`,
|
||||
MODIFY COLUMN `upload_time` bigint(0) NULL DEFAULT NULL COMMENT '上传时间' AFTER `sort`,
|
||||
MODIFY COLUMN `base_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '所在目录地址' AFTER `upload_time`,
|
||||
MODIFY COLUMN `url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '图片url' AFTER `base_url`;
|
||||
MODIFY COLUMN `base_url` varchar(255) NULL DEFAULT NULL COMMENT '所在目录地址' AFTER `upload_time`,
|
||||
MODIFY COLUMN `url` varchar(255) NULL DEFAULT NULL COMMENT '图片url' AFTER `base_url`;
|
||||
|
||||
ALTER TABLE `visualization_link_jump`
|
||||
MODIFY COLUMN `id` bigint(0) NOT NULL COMMENT '主键' FIRST,
|
||||
@ -149,8 +159,8 @@ ALTER TABLE `visualization_link_jump_target_view_info`
|
||||
ALTER TABLE `visualization_linkage`
|
||||
MODIFY COLUMN `id` bigint(0) NOT NULL COMMENT '主键' FIRST,
|
||||
MODIFY COLUMN `dv_id` bigint(0) NULL DEFAULT NULL COMMENT '联动大屏/仪表板ID' AFTER `id`,
|
||||
MODIFY COLUMN `ext1` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '扩展字段1' AFTER `linkage_active`,
|
||||
MODIFY COLUMN `ext2` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '扩展字段2' AFTER `ext1`,
|
||||
MODIFY COLUMN `ext1` varchar(2000) NULL DEFAULT NULL COMMENT '扩展字段1' AFTER `linkage_active`,
|
||||
MODIFY COLUMN `ext2` varchar(2000) NULL DEFAULT NULL COMMENT '扩展字段2' AFTER `ext1`,
|
||||
MODIFY COLUMN `copy_from` bigint(0) NULL DEFAULT NULL COMMENT '复制来源' AFTER `ext2`,
|
||||
MODIFY COLUMN `copy_id` bigint(0) NULL DEFAULT NULL COMMENT '复制来源ID' AFTER `copy_from`;
|
||||
|
||||
@ -163,15 +173,15 @@ ALTER TABLE `visualization_subject`
|
||||
MODIFY COLUMN `create_num` int(0) NOT NULL DEFAULT 0 COMMENT '创建序号' AFTER `cover_url`;
|
||||
|
||||
ALTER TABLE `visualization_template_category`
|
||||
MODIFY COLUMN `template_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '模版类型 system 系统内置 self 用户自建' AFTER `snapshot`;
|
||||
MODIFY COLUMN `template_type` varchar(255) NULL DEFAULT NULL COMMENT '模版类型 system 系统内置 self 用户自建' AFTER `snapshot`;
|
||||
|
||||
ALTER TABLE `visualization_template_extend_data`
|
||||
MODIFY COLUMN `id` bigint(0) NOT NULL COMMENT '主键' FIRST,
|
||||
MODIFY COLUMN `dv_id` bigint(0) NULL DEFAULT NULL COMMENT '模板ID' AFTER `id`,
|
||||
MODIFY COLUMN `view_id` bigint(0) NULL DEFAULT NULL COMMENT '视图ID' AFTER `dv_id`,
|
||||
MODIFY COLUMN `view_details` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '视图详情' AFTER `view_id`,
|
||||
MODIFY COLUMN `copy_from` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '复制来源' AFTER `view_details`,
|
||||
MODIFY COLUMN `copy_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '复制来源ID' AFTER `copy_from`;
|
||||
MODIFY COLUMN `view_details` longtext NULL COMMENT '视图详情' AFTER `view_id`,
|
||||
MODIFY COLUMN `copy_from` varchar(255) NULL DEFAULT NULL COMMENT '复制来源' AFTER `view_details`,
|
||||
MODIFY COLUMN `copy_id` varchar(255) NULL DEFAULT NULL COMMENT '复制来源ID' AFTER `copy_from`;
|
||||
|
||||
ALTER TABLE `core_opt_recent`
|
||||
MODIFY COLUMN `resource_type` int(0) NOT NULL COMMENT '资源类型 1-可视化资源 2-仪表板 3-数据大屏 4-数据集 5-数据源 6-模板' AFTER `uid`;
|
||||
|
@ -10,3 +10,9 @@ CREATE TABLE `visualization_watermark` (
|
||||
) COMMENT='仪表板水印设置表';
|
||||
|
||||
INSERT INTO `visualization_watermark` (`id`, `version`, `setting_content`, `create_by`, `create_time`) VALUES ('system_default', '1.0', '{\"enable\":false,\"enablePanelCustom\":true,\"type\":\"custom\",\"content\":\"水印\",\"watermark_color\":\"#DD1010\",\"watermark_x_space\":12,\"watermark_y_space\":36,\"watermark_fontsize\":15}', 'admin', NULL);
|
||||
|
||||
ALTER TABLE `visualization_template`
|
||||
ADD COLUMN `use_count` int NULL DEFAULT 0 COMMENT '使用次数' AFTER `dynamic_data`;
|
||||
|
||||
update visualization_template set use_count = 0;
|
||||
INSERT INTO `core_sys_setting` (`id`, `pkey`, `pval`, `type`, `sort`) VALUES (9, 'basic.frontTimeOut', '60', 'text', 1);
|
||||
|
@ -20,7 +20,7 @@ i18n_menu.org=\u7EC4\u7EC7\u7BA1\u7406
|
||||
i18n_menu.auth=\u6743\u9650\u914D\u7F6E
|
||||
i18n_menu.sync=\u540C\u6B65\u7BA1\u7406
|
||||
i18n_menu.summary=\u6982\u89C8
|
||||
i18n_menu.ds=\u6570\u636E\u6E90\u7BA1\u7406
|
||||
i18n_menu.ds=\u6570\u636e\u8fde\u63a5\u7ba1\u7406
|
||||
i18n_menu.task=\u4EFB\u52A1\u7BA1\u7406
|
||||
i18n_menu.embedded=\u5D4C\u5165\u5F0F\u7BA1\u7406
|
||||
i18n_menu.platform=\u5E73\u53F0\u5BF9\u63A5
|
||||
|
@ -53,12 +53,13 @@
|
||||
vt.create_time,
|
||||
vt.template_type,
|
||||
vt.SNAPSHOT,
|
||||
vt.use_count,
|
||||
vtcm.category_id,
|
||||
cor.time as 'recent_use_time'
|
||||
FROM visualization_template vt
|
||||
LEFT JOIN visualization_template_category_map vtcm ON vt.id = vtcm.template_id
|
||||
left JOIN core_opt_recent cor on cor.resource_type = 6 and vt.id = cor.resource_name
|
||||
ORDER BY vt.create_time DESC
|
||||
ORDER BY vt.use_count ,vt.create_time DESC
|
||||
</select>
|
||||
|
||||
<select id="findCategories" resultMap="BaseResultMapDTO">
|
||||
|
@ -3,3 +3,7 @@ import request from '@/config/axios'
|
||||
export const validateApi = data => request.post({ url: '/license/validate', data })
|
||||
export const buildVersionApi = () => request.get({ url: '/license/version' })
|
||||
export const updateInfoApi = data => request.post({ url: '/license/update', data })
|
||||
|
||||
export const checkFreeApi = () => request.get({ url: '/rmonitor/existFree' })
|
||||
export const syncFreeApi = () => request.post({ url: '/rmonitor/sync' })
|
||||
export const delFreeApi = () => request.post({ url: '/rmonitor/delete' })
|
||||
|
@ -111,6 +111,14 @@ export const getDatasetTree = async (data = {}): Promise<IResponse> => {
|
||||
})
|
||||
}
|
||||
|
||||
export const getDsTree = async (data = {}): Promise<IResponse> => {
|
||||
return request
|
||||
.post({ url: '/datasource/tree', data: { ...data, ...{ busiFlag: 'datasource' } } })
|
||||
.then(res => {
|
||||
return res?.data
|
||||
})
|
||||
}
|
||||
|
||||
export const deleteById = (id: number) => request.get({ url: '/datasource/delete/' + id })
|
||||
|
||||
export const getById = (id: number) => request.get({ url: '/datasource/get/' + id })
|
||||
|
47
core/core-frontend/src/api/sync/syncDatasource.ts
Normal file
47
core/core-frontend/src/api/sync/syncDatasource.ts
Normal file
@ -0,0 +1,47 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export const sourceDsPageApi = (page: number, limit: number, data) => {
|
||||
return request.post({ url: `/sync/datasource/source/pager/${page}/${limit}`, data })
|
||||
}
|
||||
|
||||
export const targetDsPageApi = (page: number, limit: number, data) => {
|
||||
return request.post({ url: `/sync/datasource/target/pager/${page}/${limit}`, data })
|
||||
}
|
||||
export const latestUseApi = () => {
|
||||
return request.post({ url: '/sync/datasource/latestUse', data: {} })
|
||||
}
|
||||
|
||||
export const validateApi = data => {
|
||||
return request.post({ url: '/sync/datasource/validate', data })
|
||||
}
|
||||
|
||||
export const getSchemaApi = data => {
|
||||
return request.post({ url: '/sync/datasource/getSchema', data })
|
||||
}
|
||||
|
||||
export const saveApi = data => {
|
||||
return request.post({ url: '/sync/datasource/save', data })
|
||||
}
|
||||
|
||||
export const getByIdApi = (id: string) => {
|
||||
return request.get({ url: `/sync/datasource/get/${id}` })
|
||||
}
|
||||
|
||||
export const updateApi = data => {
|
||||
return request.post({ url: '/sync/datasource/update', data })
|
||||
}
|
||||
|
||||
export const deleteByIdApi = (id: string) => {
|
||||
return request.post({ url: `/sync/datasource/delete/${id}` })
|
||||
}
|
||||
|
||||
export const batchDelApi = (ids: string[]) => {
|
||||
return request.post({ url: `/sync/datasource/batchDel`, data: ids })
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取源数据库字段集合以及目标数据库数据类型集合
|
||||
*/
|
||||
export const getFieldListApi = data => {
|
||||
return request.post({ url: `/sync/datasource/fields`, data })
|
||||
}
|
26
core/core-frontend/src/api/sync/syncSummary.ts
Normal file
26
core/core-frontend/src/api/sync/syncSummary.ts
Normal file
@ -0,0 +1,26 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
interface IResourceCount {
|
||||
jobCount: number
|
||||
datasourceCount: number
|
||||
jobLogCount: number
|
||||
}
|
||||
|
||||
export const getResourceCount = () => {
|
||||
return request
|
||||
.get({
|
||||
url: 'sync/summary/resourceCount',
|
||||
method: 'get'
|
||||
})
|
||||
.then(res => {
|
||||
return res.data as IResourceCount
|
||||
})
|
||||
}
|
||||
|
||||
export const getJobLogLienChartInfo = () => {
|
||||
return request.post({
|
||||
url: '/sync/summary/logChartData',
|
||||
method: 'post',
|
||||
data: ''
|
||||
})
|
||||
}
|
225
core/core-frontend/src/api/sync/syncTask.ts
Normal file
225
core/core-frontend/src/api/sync/syncTask.ts
Normal file
@ -0,0 +1,225 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface IGetTaskInfoReq {
|
||||
id?: string
|
||||
name?: string
|
||||
}
|
||||
|
||||
export interface ITaskInfoInsertReq {
|
||||
[key: string]: any
|
||||
}
|
||||
|
||||
export interface ISchedulerOption {
|
||||
interval: number
|
||||
unit: string
|
||||
}
|
||||
|
||||
export interface ISource {
|
||||
type: string
|
||||
query: string
|
||||
tables: string
|
||||
datasourceId: string
|
||||
tableExtract: string
|
||||
dsTableList?: IDsTable[]
|
||||
dsList?: []
|
||||
fieldList?: ITableField[]
|
||||
targetFieldTypeList?: string[]
|
||||
incrementCheckbox?: string
|
||||
incrementField?: string
|
||||
}
|
||||
|
||||
export interface ITableField {
|
||||
id: string
|
||||
fieldSource: string
|
||||
fieldName: string
|
||||
fieldType: string
|
||||
remarks: string
|
||||
fieldSize: number
|
||||
fieldPrecision: number
|
||||
fieldPk: boolean
|
||||
fieldIndex: boolean
|
||||
}
|
||||
|
||||
export interface ITargetProperty {
|
||||
/**
|
||||
* 启用分区on
|
||||
*/
|
||||
partitionEnable: string
|
||||
/**
|
||||
* 分区类型
|
||||
* DateRange 日期
|
||||
* NumberRange 数值
|
||||
* List 列
|
||||
*/
|
||||
partitionType: string
|
||||
/**
|
||||
* 启用动态分区on
|
||||
*/
|
||||
dynamicPartitionEnable: string
|
||||
/**
|
||||
* 动态分区结束偏移量
|
||||
*/
|
||||
dynamicPartitionEnd: number
|
||||
/**
|
||||
* 动态分区间隔单位
|
||||
* HOUR WEEK DAY MONTH YEAR
|
||||
*/
|
||||
dynamicPartitionTimeUnit: string
|
||||
/**
|
||||
* 手动分区列值
|
||||
* 多个以','隔开
|
||||
*/
|
||||
manualPartitionColumnValue: string
|
||||
/**
|
||||
* 手动分区数值区间开始值
|
||||
*/
|
||||
manualPartitionStart: number
|
||||
/**
|
||||
* 手动分区数值区间结束值
|
||||
*/
|
||||
manualPartitionEnd: number
|
||||
/**
|
||||
* 手动分区数值区间间隔
|
||||
*/
|
||||
manualPartitionInterval: number
|
||||
/**
|
||||
* 手动分区日期区间
|
||||
* 2023-09-08 - 2023-09-15
|
||||
*/
|
||||
manualPartitionTimeRange: string
|
||||
/**
|
||||
* 手动分区日期区间间隔单位
|
||||
*/
|
||||
manualPartitionTimeUnit: string
|
||||
/**
|
||||
* 分区字段
|
||||
*/
|
||||
partitionColumn: string
|
||||
}
|
||||
|
||||
export interface ITarget {
|
||||
createTable?: string
|
||||
type: string
|
||||
fieldList: ITableField[]
|
||||
tableName: string
|
||||
datasourceId: string
|
||||
targetProperty: string
|
||||
dsList?: []
|
||||
multipleSelection?: ITableField[]
|
||||
property: ITargetProperty
|
||||
}
|
||||
|
||||
export class ITaskInfoRes {
|
||||
id: string
|
||||
|
||||
name: string
|
||||
|
||||
schedulerType: string
|
||||
|
||||
schedulerConf: string
|
||||
|
||||
schedulerOption: ISchedulerOption
|
||||
|
||||
taskKey: string
|
||||
|
||||
desc: string
|
||||
|
||||
executorTimeout: number
|
||||
|
||||
executorFailRetryCount: number
|
||||
|
||||
source: ISource
|
||||
|
||||
target: ITarget
|
||||
|
||||
status: string
|
||||
startTime: string
|
||||
stopTime: string
|
||||
|
||||
constructor(
|
||||
id: string,
|
||||
name: string,
|
||||
schedulerType: string,
|
||||
schedulerConf: string,
|
||||
taskKey: string,
|
||||
desc: string,
|
||||
executorTimeout: number,
|
||||
executorFailRetryCount: number,
|
||||
source: ISource,
|
||||
target: ITarget,
|
||||
status: string,
|
||||
startTime: string,
|
||||
stopTime: string,
|
||||
schedulerOption: ISchedulerOption
|
||||
) {
|
||||
this.id = id
|
||||
this.name = name
|
||||
this.schedulerType = schedulerType
|
||||
this.schedulerConf = schedulerConf
|
||||
this.taskKey = taskKey
|
||||
this.desc = desc
|
||||
this.executorTimeout = executorTimeout
|
||||
this.executorFailRetryCount = executorFailRetryCount
|
||||
this.source = source
|
||||
this.target = target
|
||||
this.status = status
|
||||
this.startTime = startTime
|
||||
this.stopTime = stopTime
|
||||
this.schedulerOption = schedulerOption
|
||||
}
|
||||
}
|
||||
|
||||
export interface ITaskInfoUpdateReq {
|
||||
[key: string]: any
|
||||
}
|
||||
|
||||
export interface IDsTable {
|
||||
datasourceId: string
|
||||
name: string
|
||||
remark: string
|
||||
enableCheck: string
|
||||
datasetPath: string
|
||||
}
|
||||
|
||||
export const getDatasourceListByTypeApi = (type: string) => {
|
||||
return request.get({ url: `/sync/datasource/list/${type}` })
|
||||
}
|
||||
export const getTaskInfoListApi = (current: number, size: number, data) => {
|
||||
return request.post({ url: `/sync/task/pager/${current}/${size}`, data: data })
|
||||
}
|
||||
|
||||
export const executeOneApi = (id: string) => {
|
||||
return request.get({ url: `/sync/task/execute/${id}` })
|
||||
}
|
||||
|
||||
export const startTaskApi = (id: string) => {
|
||||
return request.get({ url: `/sync/task/start/${id}` })
|
||||
}
|
||||
|
||||
export const stopTaskApi = (id: string) => {
|
||||
return request.get({ url: `/sync/task/stop/${id}` })
|
||||
}
|
||||
|
||||
export const addApi = (data: ITaskInfoInsertReq) => {
|
||||
return request.post({ url: `/sync/task/add`, data: data })
|
||||
}
|
||||
|
||||
export const removeApi = (taskId: string) => {
|
||||
return request.delete({ url: `/sync/task/remove/${taskId}` })
|
||||
}
|
||||
|
||||
export const batchRemoveApi = (taskIds: string[]) => {
|
||||
return request.post({ url: `/sync/task/batch/del`, data: taskIds })
|
||||
}
|
||||
|
||||
export const modifyApi = (data: ITaskInfoUpdateReq) => {
|
||||
return request.post({ url: `/sync/task/update`, data: data })
|
||||
}
|
||||
|
||||
export const findTaskInfoByIdApi = (taskId: string) => {
|
||||
return request.get({ url: `/sync/task/get/${taskId}` })
|
||||
}
|
||||
|
||||
export const getDatasourceTableListApi = (dsId: string) => {
|
||||
return request.get({ url: `/sync/datasource/table/list/${dsId}` })
|
||||
}
|
20
core/core-frontend/src/api/sync/syncTaskLog.ts
Normal file
20
core/core-frontend/src/api/sync/syncTaskLog.ts
Normal file
@ -0,0 +1,20 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export const getTaskLogListApi = (current: number, size: number, data: any) => {
|
||||
return request.post({
|
||||
url: `/sync/task/log/pager/${current}/${size}`,
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export const removeApi = (logId: string) => {
|
||||
return request.delete({ url: `/sync/task/log/delete/${logId}` })
|
||||
}
|
||||
|
||||
export const getTaskLogDetailApi = (logId: string, fromLineNum: number) => {
|
||||
return request.get({ url: `/sync/task/log/detail/${logId}/${fromLineNum}` })
|
||||
}
|
||||
|
||||
export const clear = (clearData: {}) => {
|
||||
return request.post({ url: `/sync/task/log/clear`, data: clearData })
|
||||
}
|
@ -2,4 +2,4 @@ import request from '@/config/axios'
|
||||
|
||||
export const watermarkSave = params => request.post({ url: '/watermark/save', data: params })
|
||||
|
||||
export const watermarkFind = () => request.get({ url: 'watermark/find' })
|
||||
export const watermarkFind = async () => request.get({ url: 'watermark/find' })
|
||||
|
@ -0,0 +1,3 @@
|
||||
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M9.95219 8.73169L15.5501 3.13376C15.7128 2.97104 15.9767 2.97104 16.1394 3.13376L16.7286 3.72301C16.8913 3.88573 16.8913 4.14955 16.7286 4.31227L11.1307 9.9102L16.7286 15.5081C16.8913 15.6708 16.8913 15.9347 16.7286 16.0974L16.1394 16.6866C15.9767 16.8494 15.7128 16.8494 15.5501 16.6866L9.95219 11.0887L4.35426 16.6866C4.19154 16.8494 3.92772 16.8494 3.76501 16.6866L3.17575 16.0974C3.01303 15.9347 3.01303 15.6708 3.17575 15.5081L8.77368 9.9102L3.17575 4.31227C3.01303 4.14955 3.01303 3.88573 3.17575 3.72301L3.76501 3.13376C3.92772 2.97104 4.19154 2.97104 4.35426 3.13376L9.95219 8.73169Z" fill="#646A73"/>
|
||||
</svg>
|
After Width: | Height: | Size: 724 B |
16
core/core-frontend/src/assets/svg/icon_sync_datasource.svg
Normal file
16
core/core-frontend/src/assets/svg/icon_sync_datasource.svg
Normal file
@ -0,0 +1,16 @@
|
||||
<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<g clip-path="url(#clip0_10054_936)">
|
||||
<path d="M0 6.66667C0 2.98477 3.25611 0 7.27273 0H32.7273C36.7439 0 40 2.98477 40 6.66667V33.3333C40 37.0152 36.7439 40 32.7273 40H7.27273C3.25611 40 0 37.0152 0 33.3333V6.66667Z" fill="#EBF1FF"/>
|
||||
<g clip-path="url(#clip1_10054_936)">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M29.9019 28.8369C30.5346 28.3383 31.1111 27.6133 31.1111 26.6667V13.3334C31.1111 12.3868 30.5346 11.6618 29.9019 11.1632C29.2567 10.6547 28.392 10.2454 27.4225 9.92225C25.4718 9.27202 22.8476 8.88892 20 8.88892C17.1524 8.88892 14.5283 9.27202 12.5776 9.92225C11.6081 10.2454 10.7433 10.6547 10.0981 11.1632C9.46546 11.6618 8.88892 12.3868 8.88892 13.3334V26.6667C8.88892 27.6133 9.46546 28.3383 10.0981 28.8369C10.7433 29.3453 11.6081 29.7546 12.5776 30.0778C14.5283 30.728 17.1524 31.1111 20 31.1111C22.8476 31.1111 25.4718 30.728 27.4225 30.0778C28.392 29.7546 29.2567 29.3453 29.9019 28.8369ZM11.1111 13.3331C11.1118 12.1059 15.0912 11.1111 20 11.1111C24.9092 11.1111 28.8889 12.1061 28.8889 13.3334C28.8889 14.5607 24.9092 15.5556 20 15.5556C15.0908 15.5556 11.1111 14.5607 11.1111 13.3334C11.1111 13.3333 11.1111 13.3333 11.1111 13.3333C11.1111 13.3332 11.1111 13.3331 11.1111 13.3331ZM27.4225 16.7445C27.9482 16.5692 28.4431 16.3687 28.8889 16.1407V20.0003C28.8889 20.0016 28.8888 20.0064 28.8855 20.017C28.8818 20.0294 28.8724 20.0539 28.8499 20.0905C28.8028 20.1673 28.7066 20.2828 28.5264 20.4248C28.1596 20.714 27.5598 21.0229 26.7197 21.303C25.0511 21.8592 22.6753 22.2222 20 22.2222C17.3248 22.2222 14.9489 21.8592 13.2803 21.303C12.4402 21.0229 11.8405 20.714 11.4736 20.4248C11.2934 20.2828 11.1973 20.1673 11.1501 20.0905C11.1276 20.0539 11.1183 20.0294 11.1145 20.017C11.1113 20.0065 11.1111 20.0014 11.1111 20V16.1407C11.5569 16.3687 12.0519 16.5692 12.5776 16.7445C14.5283 17.3947 17.1524 17.7778 20 17.7778C22.8476 17.7778 25.4718 17.3947 27.4225 16.7445ZM27.4225 23.4111C27.9482 23.2359 28.4431 23.0353 28.8889 22.8074V26.6668C28.8889 26.6678 28.8889 26.6725 28.8855 26.6837C28.8818 26.6961 28.8724 26.7205 28.8499 26.7572C28.8028 26.834 28.7066 26.9495 28.5264 27.0915C28.1596 27.3806 27.5598 27.6896 26.7197 27.9696C25.0511 28.5258 22.6753 28.8889 20 28.8889C17.3248 28.8889 14.9489 28.5258 13.2803 27.9696C12.4402 27.6896 11.8405 27.3806 11.4736 27.0915C11.2934 26.9495 11.1973 26.834 11.1501 26.7572C11.1276 26.7205 11.1183 26.6961 11.1145 26.6837C11.1111 26.6725 11.1111 26.6677 11.1111 26.6667V22.8074C11.5569 23.0353 12.0519 23.2359 12.5776 23.4111C14.5283 24.0614 17.1524 24.4445 20 24.4445C22.8476 24.4445 25.4718 24.0614 27.4225 23.4111Z" fill="#3370FF"/>
|
||||
</g>
|
||||
</g>
|
||||
<defs>
|
||||
<clipPath id="clip0_10054_936">
|
||||
<rect width="40" height="40" fill="white"/>
|
||||
</clipPath>
|
||||
<clipPath id="clip1_10054_936">
|
||||
<rect width="26.6667" height="26.6667" fill="white" transform="translate(6.66675 6.66669)"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
After Width: | Height: | Size: 2.9 KiB |
17
core/core-frontend/src/assets/svg/icon_sync_log_number.svg
Normal file
17
core/core-frontend/src/assets/svg/icon_sync_log_number.svg
Normal file
@ -0,0 +1,17 @@
|
||||
<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<g clip-path="url(#clip0_10054_2080)">
|
||||
<path d="M0 6.66667C0 2.98477 3.25611 0 7.27273 0H32.7273C36.7439 0 40 2.98477 40 6.66667V33.3333C40 37.0152 36.7439 40 32.7273 40H7.27273C3.25611 40 0 37.0152 0 33.3333V6.66667Z" fill="#E5FBF8"/>
|
||||
<g clip-path="url(#clip1_10054_2080)">
|
||||
<path d="M18.0958 25.682L25.7858 20.8437C25.928 20.7535 26.0452 20.6289 26.1264 20.4814C26.2075 20.3339 26.2501 20.1682 26.2501 19.9998C26.2501 19.8315 26.2075 19.6658 26.1264 19.5183C26.0452 19.3707 25.928 19.2461 25.7858 19.156L18.0962 14.318C17.9388 14.219 17.7575 14.1667 17.5722 14.1667C17.4419 14.1671 17.3131 14.1932 17.1929 14.2434C17.0728 14.2937 16.9637 14.3671 16.8719 14.4595C16.7801 14.5519 16.7075 14.6614 16.658 14.7819C16.6086 14.9024 16.5834 15.0314 16.5838 15.1617V24.8387C16.5839 25.0248 16.636 25.2072 16.7342 25.3653C16.8024 25.4759 16.8919 25.5719 16.9974 25.6478C17.1029 25.7236 17.2225 25.7778 17.349 25.8073C17.4756 25.8367 17.6068 25.8408 17.7349 25.8193C17.8631 25.7978 17.9858 25.7511 18.0958 25.682Z" fill="#00D6B9"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M19.9998 7.77771C26.7498 7.77771 32.222 13.2499 32.222 19.9999C32.222 26.7499 26.7498 32.2222 19.9998 32.2222C13.2498 32.2222 7.77759 26.7499 7.77759 19.9999C7.77759 13.2499 13.2498 7.77771 19.9998 7.77771ZM19.9998 9.44438C25.8293 9.44438 30.5554 14.1704 30.5554 19.9999C30.5554 25.8295 25.8293 30.5555 19.9998 30.5555C14.1703 30.5555 9.44425 25.8295 9.44425 19.9999C9.44425 14.1704 14.1703 9.44438 19.9998 9.44438Z" fill="#00D6B9"/>
|
||||
</g>
|
||||
</g>
|
||||
<defs>
|
||||
<clipPath id="clip0_10054_2080">
|
||||
<rect width="40" height="40" fill="white"/>
|
||||
</clipPath>
|
||||
<clipPath id="clip1_10054_2080">
|
||||
<rect width="26.6667" height="26.6667" fill="white" transform="translate(6.66675 6.66669)"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
After Width: | Height: | Size: 1.9 KiB |
@ -0,0 +1,3 @@
|
||||
<svg width="12" height="16" viewBox="0 0 12 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M8.66667 2.00033H1.33333V14.0003H10.6667V4.01333H9C8.91159 4.01333 8.82681 3.97821 8.7643 3.91569C8.70179 3.85318 8.66667 3.7684 8.66667 3.67999V2.00033ZM0.666667 0.666992H9.39033C9.47793 0.666967 9.56467 0.684205 9.64561 0.717722C9.72654 0.751238 9.80007 0.800376 9.862 0.862326L11.805 2.80599C11.9299 2.93104 12.0001 3.10058 12 3.27733V14.667C12 14.8438 11.9298 15.0134 11.8047 15.1384C11.6797 15.2634 11.5101 15.3337 11.3333 15.3337H0.666667C0.489856 15.3337 0.320286 15.2634 0.195262 15.1384C0.0702379 15.0134 4.14401e-09 14.8438 0 14.667V1.33366C4.14401e-09 1.15685 0.0702379 0.987279 0.195262 0.862254C0.320286 0.73723 0.489856 0.666992 0.666667 0.666992ZM3.33333 6.66699H8.66667C8.75507 6.66699 8.83986 6.70211 8.90237 6.76462C8.96488 6.82714 9 6.91192 9 7.00033V7.66699C9 7.7554 8.96488 7.84018 8.90237 7.90269C8.83986 7.96521 8.75507 8.00033 8.66667 8.00033H3.33333C3.24493 8.00033 3.16014 7.96521 3.09763 7.90269C3.03512 7.84018 3 7.7554 3 7.66699V7.00033C3 6.91192 3.03512 6.82714 3.09763 6.76462C3.16014 6.70211 3.24493 6.66699 3.33333 6.66699ZM3.33333 10.0003H6.33333C6.37711 10.0003 6.42045 10.0089 6.46089 10.0257C6.50134 10.0424 6.53808 10.067 6.56904 10.098C6.59999 10.1289 6.62454 10.1657 6.64129 10.2061C6.65805 10.2465 6.66667 10.2899 6.66667 10.3337V11.0003C6.66667 11.0441 6.65805 11.0874 6.64129 11.1279C6.62454 11.1683 6.59999 11.2051 6.56904 11.236C6.53808 11.267 6.50134 11.2915 6.46089 11.3083C6.42045 11.325 6.37711 11.3337 6.33333 11.3337H3.33333C3.24493 11.3337 3.16014 11.2985 3.09763 11.236C3.03512 11.1735 3 11.0887 3 11.0003V10.3337C3 10.2453 3.03512 10.1605 3.09763 10.098C3.16014 10.0354 3.24493 10.0003 3.33333 10.0003Z" fill="#3370FF"/>
|
||||
</svg>
|
After Width: | Height: | Size: 1.7 KiB |
@ -0,0 +1,3 @@
|
||||
<svg width="16" height="14" viewBox="0 0 16 14" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M8.66666 12.0002H5.66666C2.90523 12.0002 0.666656 9.76164 0.666656 7.00022C0.666656 5.02373 1.81347 3.3151 3.47799 2.50343L4.14705 3.66228C2.8804 4.23986 1.99999 5.51723 1.99999 7.00022C1.99999 9.02526 3.64161 10.6669 5.66666 10.6669H8.66666V9.77154C8.66666 9.57824 8.82336 9.42154 9.01666 9.42154C9.10143 9.42154 9.18333 9.45231 9.24713 9.50814L11.0323 11.0702C11.1778 11.1974 11.1925 11.4186 11.0652 11.564C11.055 11.5757 11.044 11.5867 11.0323 11.597L9.24713 13.159C9.10166 13.2863 8.88054 13.2715 8.75325 13.126C8.69743 13.0622 8.66666 12.9803 8.66666 12.8956V12.0002ZM7.33333 3.33356V4.22891C7.33333 4.31369 7.30256 4.39559 7.24673 4.45939C7.11944 4.60486 6.89832 4.6196 6.75285 4.49231L4.96769 2.9303C4.956 2.92007 4.945 2.90907 4.93477 2.89737C4.80748 2.7519 4.82222 2.53078 4.96769 2.4035L6.75285 0.841481C6.81665 0.785654 6.89855 0.754883 6.98333 0.754883C7.17663 0.754883 7.33333 0.911583 7.33333 1.10488V2.00023H10.3333C13.0947 2.00023 15.3333 4.23881 15.3333 7.00023C15.3333 8.96233 14.2031 10.6605 12.5583 11.4791L11.8897 10.3212C13.1366 9.73578 14 8.46883 14 7.00023C14 4.97519 12.3584 3.33356 10.3333 3.33356H7.33333Z" fill="#3370FF"/>
|
||||
</svg>
|
After Width: | Height: | Size: 1.2 KiB |
17
core/core-frontend/src/assets/svg/icon_sync_task_number.svg
Normal file
17
core/core-frontend/src/assets/svg/icon_sync_task_number.svg
Normal file
@ -0,0 +1,17 @@
|
||||
<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<g clip-path="url(#clip0_7277_272394)">
|
||||
<path d="M0 6.66667C0 2.98477 3.25611 0 7.27273 0H32.7273C36.7439 0 40 2.98477 40 6.66667V33.3333C40 37.0152 36.7439 40 32.7273 40H7.27273C3.25611 40 0 37.0152 0 33.3333V6.66667Z" fill="#FFF3E5"/>
|
||||
<g clip-path="url(#clip1_7277_272394)">
|
||||
<path d="M14.7474 21.6382C14.7785 21.7131 14.824 21.7812 14.8814 21.8385L18.3726 25.3304L18.4311 25.3822C18.6733 25.5696 19.0237 25.5526 19.2459 25.3304L25.3563 19.2193C25.472 19.1035 25.537 18.9466 25.537 18.783C25.537 18.6193 25.472 18.4624 25.3563 18.3467L24.4837 17.4733C24.4264 17.4159 24.3583 17.3704 24.2834 17.3393C24.2084 17.3082 24.1281 17.2923 24.047 17.2923C23.9659 17.2923 23.8856 17.3082 23.8106 17.3393C23.7357 17.3704 23.6676 17.4159 23.6103 17.4733L18.8096 22.2748L16.6266 20.0926C16.5109 19.9769 16.354 19.9119 16.1903 19.9119C16.0267 19.9119 15.8697 19.9769 15.754 20.0926L14.8814 20.9652C14.824 21.0225 14.7785 21.0906 14.7474 21.1655C14.7164 21.2404 14.7004 21.3207 14.7004 21.4019C14.7004 21.483 14.7164 21.5633 14.7474 21.6382Z" fill="#FF8800"/>
|
||||
<path d="M24.4442 7.77777H15.5553C14.8739 7.77777 14.4442 8.2074 14.4442 8.88888V9.99999H11.1111C10.3489 9.99999 10 10.4296 10 11.1111V31.1111C10 31.7933 10.3489 32.2222 11.1111 32.2222L28.8889 32.2222C29.6511 32.2222 30 31.7926 30 31.1111V11.1111C30 10.4289 29.6511 9.99996 28.8889 9.99996L25.5556 9.99999V12.2222H27.7778V30H12.2222V12.2222H14.4442V13.3333C14.4442 14.0148 14.8739 14.4444 15.5553 14.4444H24.4442C25.1257 14.4444 25.5553 14.0148 25.5553 13.3333V8.88888C25.5553 8.20666 25.1257 7.77777 24.4442 7.77777ZM16.6664 12.2222V9.99999H23.3331V12.2222H16.6664Z" fill="#FF8800"/>
|
||||
</g>
|
||||
</g>
|
||||
<defs>
|
||||
<clipPath id="clip0_7277_272394">
|
||||
<rect width="40" height="40" fill="white"/>
|
||||
</clipPath>
|
||||
<clipPath id="clip1_7277_272394">
|
||||
<rect width="26.6667" height="26.6667" fill="white" transform="translate(6.66675 6.66669)"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
After Width: | Height: | Size: 2.0 KiB |
@ -54,16 +54,20 @@ const themeAttrChange = (custom, property, value) => {
|
||||
if (canvasAttrInit) {
|
||||
Object.keys(canvasViewInfo.value).forEach(function (viewId) {
|
||||
const viewInfo = canvasViewInfo.value[viewId]
|
||||
if (custom === 'customAttr') {
|
||||
merge(viewInfo['customAttr'], value)
|
||||
} else {
|
||||
Object.keys(value).forEach(function (key) {
|
||||
if (viewInfo[custom][property][key] !== undefined) {
|
||||
viewInfo[custom][property][key] = value[key]
|
||||
}
|
||||
})
|
||||
try {
|
||||
if (custom === 'customAttr') {
|
||||
merge(viewInfo['customAttr'], value)
|
||||
} else {
|
||||
Object.keys(value).forEach(function (key) {
|
||||
if (viewInfo[custom][property][key] !== undefined) {
|
||||
viewInfo[custom][property][key] = value[key]
|
||||
}
|
||||
})
|
||||
}
|
||||
useEmitt().emitter.emit('renderChart-' + viewId, viewInfo)
|
||||
} catch (e) {
|
||||
console.warn('themeAttrChange-error')
|
||||
}
|
||||
useEmitt().emitter.emit('renderChart-' + viewId, viewInfo)
|
||||
})
|
||||
snapshotStore.recordSnapshotCache('renderChart')
|
||||
}
|
||||
|
@ -33,17 +33,21 @@ const onBaseChange = () => {
|
||||
const themeAttrChange = (custom, property, value) => {
|
||||
if (canvasAttrInit) {
|
||||
Object.keys(canvasViewInfo.value).forEach(function (viewId) {
|
||||
const viewInfo = canvasViewInfo.value[viewId]
|
||||
if (custom === 'customAttr') {
|
||||
merge(viewInfo['customAttr'], value)
|
||||
} else {
|
||||
Object.keys(value).forEach(function (key) {
|
||||
if (viewInfo[custom][property][key] !== undefined) {
|
||||
viewInfo[custom][property][key] = value[key]
|
||||
}
|
||||
})
|
||||
try {
|
||||
const viewInfo = canvasViewInfo.value[viewId]
|
||||
if (custom === 'customAttr') {
|
||||
merge(viewInfo['customAttr'], value)
|
||||
} else {
|
||||
Object.keys(value).forEach(function (key) {
|
||||
if (viewInfo[custom][property][key] !== undefined) {
|
||||
viewInfo[custom][property][key] = value[key]
|
||||
}
|
||||
})
|
||||
}
|
||||
useEmitt().emitter.emit('renderChart-' + viewId, viewInfo)
|
||||
} catch (e) {
|
||||
console.warn('themeAttrChange-error')
|
||||
}
|
||||
useEmitt().emitter.emit('renderChart-' + viewId, viewInfo)
|
||||
})
|
||||
snapshotStore.recordSnapshotCache('renderChart')
|
||||
}
|
||||
@ -66,7 +70,7 @@ onMounted(() => {
|
||||
effect="dark"
|
||||
size="middle"
|
||||
:min="600"
|
||||
:max="4096"
|
||||
:max="50000"
|
||||
v-model="canvasStyleData.width"
|
||||
@change="onBaseChange"
|
||||
controls-position="right"
|
||||
@ -79,7 +83,7 @@ onMounted(() => {
|
||||
effect="dark"
|
||||
size="middle"
|
||||
:min="600"
|
||||
:max="4096"
|
||||
:max="50000"
|
||||
v-model="canvasStyleData.height"
|
||||
@change="onBaseChange"
|
||||
controls-position="right"
|
||||
|
@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { dvMainStoreWithOut } from '@/store/modules/data-visualization/dvMain'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { ref, onMounted, onUnmounted } from 'vue'
|
||||
import { ref, onMounted, onUnmounted, nextTick } from 'vue'
|
||||
import { snapshotStoreWithOut } from '@/store/modules/data-visualization/snapshot'
|
||||
import { changeSizeWithScale } from '@/utils/changeComponentsSizeWithScale'
|
||||
import { useEmitt } from '@/hooks/web/useEmitt'
|
||||
@ -71,6 +71,9 @@ onMounted(() => {
|
||||
window.addEventListener('mousewheel', handleMouseWheel, { passive: false })
|
||||
setTimeout(() => {
|
||||
scale.value = canvasStyleData.value.scale
|
||||
nextTick(() => {
|
||||
useEmitt().emitter.emit('initScroll')
|
||||
})
|
||||
}, 1000)
|
||||
})
|
||||
|
||||
|
@ -15,7 +15,7 @@ import MarkLine from './MarkLine.vue'
|
||||
import Area from './Area.vue'
|
||||
import eventBus from '@/utils/eventBus'
|
||||
import { changeStyleWithScale } from '@/utils/translate'
|
||||
import { ref, onMounted, computed, toRefs, nextTick, onBeforeUnmount } from 'vue'
|
||||
import { ref, onMounted, computed, toRefs, nextTick, onBeforeUnmount, watch } from 'vue'
|
||||
import { dvMainStoreWithOut } from '@/store/modules/data-visualization/dvMain'
|
||||
import { composeStoreWithOut } from '@/store/modules/data-visualization/compose'
|
||||
import { contextmenuStoreWithOut } from '@/store/modules/data-visualization/contextmenu'
|
||||
@ -39,6 +39,8 @@ import { adaptCurThemeCommonStyle } from '@/utils/canvasStyle'
|
||||
import LinkageSet from '@/components/visualization/LinkageSet.vue'
|
||||
import PointShadow from '@/components/data-visualization/canvas/PointShadow.vue'
|
||||
import DragInfo from '@/components/visualization/common/DragInfo.vue'
|
||||
import { activeWatermark } from '@/components/watermark/watermark'
|
||||
import { personInfoApi } from '@/api/user'
|
||||
const snapshotStore = snapshotStoreWithOut()
|
||||
const dvMainStore = dvMainStoreWithOut()
|
||||
const composeStore = composeStoreWithOut()
|
||||
@ -155,6 +157,7 @@ const props = defineProps({
|
||||
default: true
|
||||
}
|
||||
})
|
||||
const userInfo = ref(null)
|
||||
|
||||
const {
|
||||
baseWidth,
|
||||
@ -192,6 +195,55 @@ const linkJumpRef = ref(null)
|
||||
const linkageRef = ref(null)
|
||||
const mainDomId = ref('editor-' + canvasId.value)
|
||||
|
||||
watch(
|
||||
() => dvInfo.value,
|
||||
() => {
|
||||
initWatermark()
|
||||
},
|
||||
{ deep: true }
|
||||
)
|
||||
|
||||
watch(
|
||||
() => canvasStyleData.value,
|
||||
() => {
|
||||
initWatermark()
|
||||
},
|
||||
{ deep: true }
|
||||
)
|
||||
|
||||
const initWatermark = (waterDomId = 'editor-canvas-main') => {
|
||||
if (
|
||||
dvInfo.value.watermarkInfo &&
|
||||
dvInfo.value.watermarkInfo.settingContent &&
|
||||
isMainCanvas(canvasId.value)
|
||||
) {
|
||||
const scale = dashboardActive.value ? 1 : curScale.value
|
||||
if (userInfo.value) {
|
||||
activeWatermark(
|
||||
dvInfo.value.watermarkInfo.settingContent,
|
||||
userInfo.value,
|
||||
waterDomId,
|
||||
canvasId.value,
|
||||
dvInfo.value.selfWatermarkStatus,
|
||||
scale
|
||||
)
|
||||
} else {
|
||||
const method = personInfoApi
|
||||
method().then(res => {
|
||||
userInfo.value = res.data
|
||||
activeWatermark(
|
||||
dvInfo.value.watermarkInfo.settingContent,
|
||||
userInfo.value,
|
||||
waterDomId,
|
||||
canvasId.value,
|
||||
dvInfo.value.selfWatermarkStatus,
|
||||
scale
|
||||
)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const dragInfoShow = computed(() => {
|
||||
return (
|
||||
dvInfo.value.type === 'dashboard' &&
|
||||
@ -445,6 +497,10 @@ const handleContextMenu = e => {
|
||||
// 组件处于编辑状态的时候 如富文本 不弹出右键菜单
|
||||
if (!curComponent.value || (curComponent.value && !curComponent.value.editing)) {
|
||||
contextmenuStore.showContextMenu({ top, left, position: 'canvasCore' })
|
||||
const iconDom = document.getElementById('close-button')
|
||||
if (iconDom) {
|
||||
iconDom.click()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -553,6 +609,50 @@ function resetPositionBox() {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查找位置盒子
|
||||
*/
|
||||
function findPositionX(item) {
|
||||
const width = item.sizeX
|
||||
let resultX = 1
|
||||
let checkPointYIndex = -1 // -1 没有占用任何Y方向画布
|
||||
// 组件宽度
|
||||
let pb = positionBox.value
|
||||
if (width <= 0) return
|
||||
// 查找组件最高位置索引 component 规则 y最新为1
|
||||
componentData.value.forEach((component, index) => {
|
||||
const componentYIndex = component.y + component.sizeY - 2
|
||||
if (checkPointYIndex < componentYIndex) {
|
||||
checkPointYIndex = componentYIndex
|
||||
}
|
||||
})
|
||||
|
||||
if (checkPointYIndex < 0) {
|
||||
return 1
|
||||
} else {
|
||||
// 获取最后一列X方向数组
|
||||
const pbX = pb[checkPointYIndex]
|
||||
// 从X i位置索引开始检查 ;
|
||||
// 检查宽度为组件宽度width 检查索引终点为checkEndIndex = i + width - 1 ;
|
||||
// 退出检查条件为索引终点checkEndIndex 越界 pbX终点索引;
|
||||
for (let i = 0, checkEndIndex = width - 1; checkEndIndex < pbX.length; i++, checkEndIndex++) {
|
||||
let adaptorCount = 0
|
||||
// 定位最后一列占位位置
|
||||
for (let k = 0; k < width; k++) {
|
||||
// pbX[i + k].el === false 表示当前矩阵点位未被占用,当连续未被占用的矩阵点位宽度为width时 表示改起始点位i可用
|
||||
if (!pbX[i + k].el) {
|
||||
adaptorCount++
|
||||
}
|
||||
}
|
||||
if (adaptorCount === width) {
|
||||
resultX = i + 1
|
||||
break
|
||||
}
|
||||
}
|
||||
return resultX
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 填充位置盒子
|
||||
*/
|
||||
@ -942,6 +1042,9 @@ const cellInit = () => {
|
||||
}
|
||||
|
||||
const canvasSizeInit = () => {
|
||||
if (isMainCanvas(canvasId.value)) {
|
||||
initWatermark()
|
||||
}
|
||||
cellInit()
|
||||
reCalcCellWidth()
|
||||
}
|
||||
@ -1233,6 +1336,7 @@ const markLineShow = computed(() => isMainCanvas(canvasId.value))
|
||||
onMounted(() => {
|
||||
if (isMainCanvas(canvasId.value)) {
|
||||
initSnapshotTimer()
|
||||
initWatermark()
|
||||
}
|
||||
// 获取编辑器元素
|
||||
composeStore.getEditor(canvasId.value)
|
||||
@ -1269,7 +1373,8 @@ defineExpose({
|
||||
handleDragOver,
|
||||
getMoveItem,
|
||||
handleMouseUp,
|
||||
handleMouseDown
|
||||
handleMouseDown,
|
||||
findPositionX
|
||||
})
|
||||
</script>
|
||||
|
||||
|
@ -53,8 +53,12 @@ const menuOpt = optName => {
|
||||
}
|
||||
|
||||
const cut = () => {
|
||||
const curInfo = getCurInfo()
|
||||
copyStore.cut(curInfo.componentData)
|
||||
if (curComponent.value) {
|
||||
const curInfo = getCurInfo()
|
||||
copyStore.cut(curInfo.componentData)
|
||||
} else if (areaData.value.components.length) {
|
||||
copyStore.cut()
|
||||
}
|
||||
menuOpt('cut')
|
||||
}
|
||||
|
||||
@ -135,6 +139,11 @@ const decompose = () => {
|
||||
menuOpt('decompose')
|
||||
}
|
||||
|
||||
const alignment = params => {
|
||||
composeStore.alignment(params)
|
||||
snapshotStore.recordSnapshotCache('decompose')
|
||||
}
|
||||
|
||||
// 阻止事件向父级组件传播调用父级的handleMouseDown 导致areaData 被隐藏
|
||||
const handleComposeMouseDown = e => {
|
||||
e.preventDefault()
|
||||
@ -147,10 +156,33 @@ const composeDivider = computed(() => {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="context-menu-details" @mousedown="handleComposeMouseDown">
|
||||
<div class="context-menu-base context-menu-details" @mousedown="handleComposeMouseDown">
|
||||
<ul @mouseup="handleMouseUp">
|
||||
<template v-if="areaData.components.length">
|
||||
<li @mousedown="handleComposeMouseDown" @click="componentCompose">组合</li>
|
||||
<el-dropdown
|
||||
style="width: 100%"
|
||||
trigger="hover"
|
||||
effect="dark"
|
||||
placement="right-start"
|
||||
popper-class="context-menu-details"
|
||||
>
|
||||
<li>对齐</li>
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<el-dropdown-item style="width: 118px" @click="alignment('left')"
|
||||
>左对齐</el-dropdown-item
|
||||
>
|
||||
<el-dropdown-item style="width: 118px" @click="alignment('right')"
|
||||
>右对齐</el-dropdown-item
|
||||
>
|
||||
<el-dropdown-item @click="alignment('top')">上对齐</el-dropdown-item>
|
||||
<el-dropdown-item @click="alignment('bottom')">下对齐</el-dropdown-item>
|
||||
<el-dropdown-item @click="alignment('transverse')">水平居中</el-dropdown-item>
|
||||
<el-dropdown-item @click="alignment('direction')">垂直居中</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
<el-divider class="custom-divider" />
|
||||
<li @click="copy">复制</li>
|
||||
<li @click="paste">粘贴</li>
|
||||
@ -190,11 +222,13 @@ const composeDivider = computed(() => {
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="less" scoped>
|
||||
<style lang="less">
|
||||
.context-menu-base {
|
||||
width: 220px;
|
||||
}
|
||||
.context-menu-details {
|
||||
z-index: 1000;
|
||||
border: #434343 1px solid;
|
||||
width: 220px;
|
||||
ul {
|
||||
padding: 4px 0;
|
||||
background-color: #292929;
|
||||
@ -205,6 +239,7 @@ const composeDivider = computed(() => {
|
||||
}
|
||||
|
||||
li {
|
||||
width: 100%;
|
||||
font-size: 14px;
|
||||
padding: 0 12px;
|
||||
position: relative;
|
||||
@ -225,7 +260,7 @@ const composeDivider = computed(() => {
|
||||
}
|
||||
|
||||
&:hover {
|
||||
background-color: #333;
|
||||
background-color: #333 !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -53,6 +53,11 @@ const props = defineProps({
|
||||
userId: {
|
||||
type: String,
|
||||
require: false
|
||||
},
|
||||
outerScale: {
|
||||
type: Number,
|
||||
required: false,
|
||||
default: 1
|
||||
}
|
||||
})
|
||||
|
||||
@ -65,6 +70,7 @@ const {
|
||||
showPosition,
|
||||
previewActive,
|
||||
downloadStatus,
|
||||
outerScale,
|
||||
userId
|
||||
} = toRefs(props)
|
||||
const domId = 'preview-' + canvasId.value
|
||||
@ -134,7 +140,9 @@ const restore = () => {
|
||||
if (dashboardActive.value) {
|
||||
cellWidth.value = canvasWidth / pcMatrixCount.value.x
|
||||
cellHeight.value = canvasHeight / pcMatrixCount.value.y
|
||||
scaleWidth.value = scaleWidth.value * 1.5
|
||||
scaleWidth.value = isMainCanvas(canvasId.value)
|
||||
? scaleWidth.value * 1.5
|
||||
: outerScale.value * 100
|
||||
} else {
|
||||
changeRefComponentsSizeWithScale(
|
||||
componentData.value,
|
||||
@ -188,7 +196,8 @@ const initWatermark = (waterDomId = 'preview-canvas-main') => {
|
||||
userInfo.value,
|
||||
waterDomId,
|
||||
canvasId.value,
|
||||
dvInfo.value.watermarkOpen
|
||||
dvInfo.value.selfWatermarkStatus,
|
||||
scaleWidth.value / 100
|
||||
)
|
||||
} else {
|
||||
const method = personInfoApi
|
||||
@ -199,7 +208,8 @@ const initWatermark = (waterDomId = 'preview-canvas-main') => {
|
||||
userInfo.value,
|
||||
waterDomId,
|
||||
canvasId.value,
|
||||
dvInfo.value.watermarkOpen
|
||||
dvInfo.value.selfWatermarkStatus,
|
||||
scaleWidth.value / 100
|
||||
)
|
||||
})
|
||||
}
|
||||
@ -213,8 +223,8 @@ onMounted(() => {
|
||||
const erd = elementResizeDetectorMaker()
|
||||
erd.listenTo(document.getElementById(domId), () => {
|
||||
restore()
|
||||
initWatermark()
|
||||
})
|
||||
initWatermark()
|
||||
})
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
|
@ -1,46 +1,66 @@
|
||||
<script setup lang="ts">
|
||||
import { propTypes } from '@/utils/propTypes'
|
||||
import { ElSelect, ElPopover, ElOption, ElIcon } from 'element-plus-secondary'
|
||||
import { computed, reactive, nextTick, ref } from 'vue'
|
||||
import { Icon } from '@/components/icon-custom'
|
||||
import { computed, PropType, reactive, toRefs } from 'vue'
|
||||
import { useI18n } from '@/hooks/web/useI18n'
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
interface Config {
|
||||
// 显示类型
|
||||
showType: string
|
||||
// 日期分隔符
|
||||
rangeSeparator: string
|
||||
// 前缀图标
|
||||
prefixIcon: string
|
||||
// 开始日期label
|
||||
startPlaceholder: string
|
||||
// 结束日期label
|
||||
endPlaceholder: string
|
||||
// 日期格式
|
||||
format: string
|
||||
// 日期值格式
|
||||
valueFormat: string
|
||||
// 尺寸
|
||||
size: string
|
||||
// 弹出位置
|
||||
placement: string
|
||||
}
|
||||
|
||||
const props = defineProps({
|
||||
statusList: propTypes.arrayOf(
|
||||
propTypes.shape({
|
||||
id: propTypes.string,
|
||||
name: propTypes.string
|
||||
})
|
||||
),
|
||||
property: Object as PropType<Config>,
|
||||
title: propTypes.string
|
||||
})
|
||||
|
||||
const { property } = toRefs(props)
|
||||
const timeConfig = computed(() => {
|
||||
let obj = Object.assign(
|
||||
{
|
||||
showType: 'datetime',
|
||||
rangeSeparator: '-',
|
||||
prefixIcon: 'Calendar',
|
||||
startPlaceholder: t('datasource.start_time'),
|
||||
endPlaceholder: t('datasource.end_time'),
|
||||
format: 'YYYY-MM-DD HH:mm:ss',
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
size: 'default',
|
||||
placement: 'bottom-end'
|
||||
},
|
||||
property.value
|
||||
)
|
||||
return obj
|
||||
})
|
||||
const state = reactive({
|
||||
currentStatus: [],
|
||||
activeStatus: []
|
||||
modelValue: []
|
||||
})
|
||||
|
||||
const elPopoverU = ref(null)
|
||||
const more = ref(null)
|
||||
|
||||
const statusChange = (id: string | number) => {
|
||||
state.activeStatus = state.activeStatus.filter(ele => ele.id !== id)
|
||||
const emits = defineEmits(['filter-change'])
|
||||
const onChange = () => {
|
||||
emits('filter-change', state.modelValue)
|
||||
}
|
||||
const selectStatus = ids => {
|
||||
const [item] = ids
|
||||
state.activeStatus.push(item)
|
||||
state.currentStatus = []
|
||||
nextTick(() => {
|
||||
elPopoverU.value.hide()
|
||||
more.value.click()
|
||||
})
|
||||
const clear = () => {
|
||||
state.modelValue = []
|
||||
}
|
||||
|
||||
const statusListNotSelect = computed(() => {
|
||||
return props.statusList.filter(ele => !state.activeStatus.map(t => t.id).includes(ele.id))
|
||||
})
|
||||
|
||||
defineExpose({
|
||||
activeStatus: state.activeStatus
|
||||
clear
|
||||
})
|
||||
</script>
|
||||
|
||||
@ -48,108 +68,42 @@ defineExpose({
|
||||
<div class="filter">
|
||||
<span>{{ title }}</span>
|
||||
<div class="filter-item">
|
||||
<span
|
||||
v-for="ele in state.activeStatus"
|
||||
:key="ele.id"
|
||||
class="item active"
|
||||
@click="statusChange(ele.id)"
|
||||
>{{ $t(ele.name) }}</span
|
||||
>
|
||||
<slot v-if="!!statusListNotSelect.length">
|
||||
<el-popover
|
||||
:show-arrow="false"
|
||||
ref="elPopoverU"
|
||||
placement="bottom"
|
||||
popper-class="filter-popper"
|
||||
width="200"
|
||||
trigger="click"
|
||||
>
|
||||
<el-select
|
||||
:teleported="false"
|
||||
style="width: 100%"
|
||||
v-model="state.currentStatus"
|
||||
value-key="id"
|
||||
filterable
|
||||
multiple
|
||||
@change="selectStatus"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in statusListNotSelect"
|
||||
:key="item.name"
|
||||
:label="item.name"
|
||||
:value="item"
|
||||
/>
|
||||
</el-select>
|
||||
<template #reference>
|
||||
<span ref="more" class="more">
|
||||
<el-icon>
|
||||
<Icon name="icon_add_outlined"> </Icon>
|
||||
</el-icon>
|
||||
更多
|
||||
</span>
|
||||
</template>
|
||||
</el-popover>
|
||||
</slot>
|
||||
<el-date-picker
|
||||
v-model="state.modelValue"
|
||||
:type="timeConfig.showType"
|
||||
:range-separator="timeConfig.rangeSeparator"
|
||||
:prefix-icon="timeConfig.prefixIcon"
|
||||
:start-placeholder="timeConfig.startPlaceholder"
|
||||
:end-placeholder="timeConfig.endPlaceholder"
|
||||
:format="timeConfig.format"
|
||||
:value-format="timeConfig.valueFormat"
|
||||
key="drawer-time-filt"
|
||||
:size="timeConfig.size"
|
||||
@change="onChange"
|
||||
:placement="timeConfig.placement"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<style lang="less" scope>
|
||||
.filter {
|
||||
display: flex;
|
||||
min-height: 46px;
|
||||
min-height: 32px;
|
||||
|
||||
> :nth-child(1) {
|
||||
color: var(--deTextSecondary, #1f2329);
|
||||
font-family: '阿里巴巴普惠体 3.0 55 Regular L3';
|
||||
font-family: 'PingFang SC';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
font-size: 14px;
|
||||
line-height: 24px;
|
||||
white-space: nowrap;
|
||||
width: 116px;
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.filter-item {
|
||||
flex: 1;
|
||||
|
||||
.item,
|
||||
.more {
|
||||
font-family: '阿里巴巴普惠体 3.0 55 Regular L3';
|
||||
white-space: nowrap;
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
line-height: 24px;
|
||||
margin-right: 12px;
|
||||
text-align: center;
|
||||
padding: 1px 6px;
|
||||
background: var(--deTextPrimary5, #f5f6f7);
|
||||
color: var(--deTextPrimary, #1f2329);
|
||||
border-radius: 2px;
|
||||
cursor: pointer;
|
||||
display: inline-block;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.active,
|
||||
.more:hover {
|
||||
background: var(--primary10, rgba(51, 112, 255, 0.1));
|
||||
color: var(--primaryselect, #0c296e);
|
||||
}
|
||||
|
||||
.more {
|
||||
white-space: nowrap;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
i {
|
||||
margin-right: 5px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<style lang="less">
|
||||
.filter-popper {
|
||||
padding: 0 !important;
|
||||
background: #fff !important;
|
||||
}
|
||||
</style>
|
||||
|
@ -14,7 +14,8 @@ const props = defineProps({
|
||||
type: propTypes.string,
|
||||
field: propTypes.string,
|
||||
option: propTypes.array,
|
||||
title: propTypes.string
|
||||
title: propTypes.string,
|
||||
property: propTypes.shape({})
|
||||
})
|
||||
),
|
||||
title: propTypes.string
|
||||
@ -126,7 +127,8 @@ defineExpose({
|
||||
:ref="el => (myRefs[index] = el)"
|
||||
v-if="component.type === 'time'"
|
||||
:title="component.title"
|
||||
@filter-change="v => filterChange(v, component.field, 'eq')"
|
||||
:property="component.property"
|
||||
@filter-change="v => filterChange(v, component.field, component.operator)"
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
@ -3,7 +3,7 @@ import { Icon } from '@/components/icon-custom'
|
||||
import { propTypes } from '@/utils/propTypes'
|
||||
import type { Placement } from 'element-plus-secondary'
|
||||
import { ref, PropType } from 'vue'
|
||||
import { XpackComponent } from '@/components/plugin'
|
||||
import ShareHandler from '@/views/share/share/ShareHandler.vue'
|
||||
export interface Menu {
|
||||
svgName?: string
|
||||
label?: string
|
||||
@ -44,7 +44,8 @@ const menus = ref([
|
||||
])
|
||||
const handleCommand = (command: string | number | object) => {
|
||||
if (command === 'share') {
|
||||
shareComponent.value.invokeMethod({ methodName: 'execute' })
|
||||
// shareComponent.value.invokeMethod({ methodName: 'execute' })
|
||||
shareComponent.value.execute()
|
||||
return
|
||||
}
|
||||
emit('handleCommand', command)
|
||||
@ -85,9 +86,8 @@ const emit = defineEmits(['handleCommand'])
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
<XpackComponent
|
||||
<ShareHandler
|
||||
ref="shareComponent"
|
||||
jsname="c2hhcmUtaGFuZGxlcg=="
|
||||
:resource-id="props.node.id"
|
||||
:resource-type="props.resourceType"
|
||||
:weight="node.weight"
|
||||
|
@ -10,8 +10,8 @@
|
||||
:min="min"
|
||||
:max="max"
|
||||
:step="step"
|
||||
v-model="curComponent.style[key]"
|
||||
@change="onPositionChange"
|
||||
v-model="positionMounted[key]"
|
||||
@change="onPositionChange(key)"
|
||||
controls-position="right"
|
||||
/>
|
||||
</el-form-item>
|
||||
@ -21,7 +21,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue'
|
||||
import { computed, ref, watch } from 'vue'
|
||||
import { positionData } from '@/utils/attr'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { dvMainStoreWithOut } from '@/store/modules/data-visualization/dvMain'
|
||||
@ -30,7 +30,13 @@ import { snapshotStoreWithOut } from '@/store/modules/data-visualization/snapsho
|
||||
const snapshotStore = snapshotStoreWithOut()
|
||||
|
||||
const dvMainStore = dvMainStoreWithOut()
|
||||
const { curComponent } = storeToRefs(dvMainStore)
|
||||
const { curComponent, canvasStyleData } = storeToRefs(dvMainStore)
|
||||
const positionMounted = ref({
|
||||
width: 0,
|
||||
height: 0,
|
||||
top: 0,
|
||||
left: 0
|
||||
})
|
||||
|
||||
withDefaults(
|
||||
defineProps<{
|
||||
@ -60,9 +66,36 @@ const positionKeysGroup = computed(() => {
|
||||
return _list
|
||||
})
|
||||
|
||||
const onPositionChange = () => {
|
||||
const onPositionChange = key => {
|
||||
if (!positionMounted.value[key]) {
|
||||
positionMounted.value[key] = 0
|
||||
}
|
||||
curComponent.value.style[key] = Math.round(
|
||||
(positionMounted.value[key] * canvasStyleData.value.scale) / 100
|
||||
)
|
||||
snapshotStore.recordSnapshotCache()
|
||||
}
|
||||
|
||||
const positionInit = () => {
|
||||
if (curComponent.value) {
|
||||
Object.keys(positionMounted.value).forEach(key => {
|
||||
positionMounted.value[key] = Math.round(
|
||||
(curComponent.value.style[key] * 100) / canvasStyleData.value.scale
|
||||
)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
watch(
|
||||
() => curComponent.value,
|
||||
() => {
|
||||
positionInit()
|
||||
},
|
||||
{
|
||||
deep: true,
|
||||
immediate: true
|
||||
}
|
||||
)
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
|
@ -14,6 +14,16 @@
|
||||
@change="reUpload"
|
||||
/>
|
||||
<el-form label-position="top" style="width: 100%; margin-bottom: 16px">
|
||||
<el-form-item class="form-item" :class="'form-item-' + themes" v-if="showWatermarkSetting">
|
||||
<el-checkbox
|
||||
size="small"
|
||||
:effect="themes"
|
||||
v-model="dvInfo.selfWatermarkStatus"
|
||||
@change="onBackgroundChange"
|
||||
>
|
||||
水印
|
||||
</el-checkbox>
|
||||
</el-form-item>
|
||||
<el-form-item class="form-item no-margin-bottom" :class="'form-item-' + themes">
|
||||
<el-checkbox
|
||||
size="small"
|
||||
@ -108,7 +118,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { COLOR_PANEL } from '@/views/chart/components/editor/util/chart'
|
||||
import { onMounted, reactive, ref, watch } from 'vue'
|
||||
import { computed, onMounted, reactive, ref, watch } from 'vue'
|
||||
import { imgUrlTrans } from '@/utils/imgUtils'
|
||||
import { snapshotStoreWithOut } from '@/store/modules/data-visualization/snapshot'
|
||||
import { beforeUploadCheck, uploadFileResult } from '@/api/staticResource'
|
||||
@ -123,7 +133,7 @@ const files = ref(null)
|
||||
const maxImageSize = 15000000
|
||||
|
||||
const dvMainStore = dvMainStoreWithOut()
|
||||
const { canvasStyleData } = storeToRefs(dvMainStore)
|
||||
const { canvasStyleData, dvInfo } = storeToRefs(dvMainStore)
|
||||
|
||||
withDefaults(
|
||||
defineProps<{
|
||||
@ -145,6 +155,14 @@ const state = reactive({
|
||||
predefineColors: COLOR_PANEL
|
||||
})
|
||||
|
||||
const showWatermarkSetting = computed(() => {
|
||||
return (
|
||||
dvInfo.value.watermarkInfo &&
|
||||
dvInfo.value.watermarkInfo?.settingContent?.enable &&
|
||||
dvInfo.value.watermarkInfo?.settingContent?.enablePanelCustom
|
||||
)
|
||||
})
|
||||
|
||||
const goFile = () => {
|
||||
files.value.click()
|
||||
}
|
||||
|
@ -145,7 +145,14 @@ export function getNow() {
|
||||
return time
|
||||
}
|
||||
|
||||
export function activeWatermark(watermarkForm, userLoginInfo, domId, canvasId, watermarkOpen) {
|
||||
export function activeWatermark(
|
||||
watermarkForm,
|
||||
userLoginInfo,
|
||||
domId,
|
||||
canvasId,
|
||||
selfWatermarkStatus,
|
||||
scale = 1
|
||||
) {
|
||||
// 清理历史水印
|
||||
const historyWatermarkDom = document.getElementById('de-watermark-server')
|
||||
if (historyWatermarkDom) {
|
||||
@ -155,7 +162,7 @@ export function activeWatermark(watermarkForm, userLoginInfo, domId, canvasId, w
|
||||
!(
|
||||
canvasId === 'canvas-main' &&
|
||||
((watermarkForm.enable && !watermarkForm.enablePanelCustom) ||
|
||||
(watermarkForm.enable && watermarkOpen))
|
||||
(watermarkForm.enable && selfWatermarkStatus))
|
||||
)
|
||||
) {
|
||||
return
|
||||
@ -183,11 +190,11 @@ export function activeWatermark(watermarkForm, userLoginInfo, domId, canvasId, w
|
||||
}
|
||||
const settings = {
|
||||
watermark_txt: watermark_txt,
|
||||
watermark_width: watermark_width,
|
||||
watermark_width: watermark_width * scale,
|
||||
watermark_color: watermarkForm.watermark_color,
|
||||
watermark_x_space: watermarkForm.watermark_x_space,
|
||||
watermark_y_space: watermarkForm.watermark_y_space,
|
||||
watermark_fontsize: watermarkForm.watermark_fontsize + 'px'
|
||||
watermark_x_space: watermarkForm.watermark_x_space * scale,
|
||||
watermark_y_space: watermarkForm.watermark_y_space * scale,
|
||||
watermark_fontsize: watermarkForm.watermark_fontsize * scale + 'px'
|
||||
}
|
||||
watermark(settings, domId)
|
||||
}
|
||||
|
@ -13,6 +13,7 @@ import { usePermissionStoreWithOut } from '@/store/modules/permission'
|
||||
import { useLinkStoreWithOut } from '@/store/modules/link'
|
||||
import { config } from './config'
|
||||
import { configHandler } from './refresh'
|
||||
|
||||
type AxiosErrorWidthLoading<T> = T & {
|
||||
config: {
|
||||
loading?: boolean
|
||||
@ -25,8 +26,10 @@ type InternalAxiosRequestConfigWidthLoading<T> = T & {
|
||||
|
||||
import { ElMessage, ElMessageBox } from 'element-plus-secondary'
|
||||
import router from '@/router'
|
||||
|
||||
const { result_code } = config
|
||||
import { useCache } from '@/hooks/web/useCache'
|
||||
|
||||
const { wsCache } = useCache()
|
||||
|
||||
export const PATH_URL = window.DataEaseBi
|
||||
@ -38,10 +41,41 @@ export interface AxiosInstanceWithLoading extends AxiosInstance {
|
||||
config: AxiosRequestConfig<D> & { loading?: boolean }
|
||||
): Promise<R>
|
||||
}
|
||||
|
||||
const getTimeOut = () => {
|
||||
let time = 100
|
||||
const url = PATH_URL + '/sysParameter/requestTimeOut'
|
||||
const xhr = new XMLHttpRequest()
|
||||
xhr.onreadystatechange = () => {
|
||||
if (xhr.readyState === 4 && xhr.status === 200) {
|
||||
if (xhr.responseText) {
|
||||
try {
|
||||
const response = JSON.parse(xhr.responseText)
|
||||
if (response.code === 0) {
|
||||
time = response.data
|
||||
} else {
|
||||
ElMessage.error('系统异常,请联系管理员')
|
||||
}
|
||||
} catch (e) {
|
||||
ElMessage.error('系统异常,请联系管理员')
|
||||
}
|
||||
} else {
|
||||
ElMessage.error('网络异常,请联系网管')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
xhr.open('get', url, false)
|
||||
xhr.send()
|
||||
console.log(time)
|
||||
return time
|
||||
}
|
||||
|
||||
// 创建axios实例
|
||||
const time = getTimeOut()
|
||||
const service: AxiosInstanceWithLoading = axios.create({
|
||||
baseURL: PATH_URL, // api 的 base_url
|
||||
timeout: config.request_timeout // 请求超时时间
|
||||
timeout: time ? time * 1000 : config.request_timeout // 请求超时时间
|
||||
})
|
||||
const mapping = {
|
||||
'zh-CN': 'zh-CN',
|
||||
|
@ -70,6 +70,7 @@
|
||||
:canvas-id="element.id + '--' + tabItem.name"
|
||||
:preview-active="editableTabsValue === tabItem.name"
|
||||
:show-position="showPosition"
|
||||
:outer-scale="scale"
|
||||
></de-preview>
|
||||
</el-tab-pane>
|
||||
</de-custom-tab>
|
||||
@ -84,7 +85,7 @@
|
||||
>
|
||||
<el-input
|
||||
v-model="state.textarea"
|
||||
maxlength="10"
|
||||
maxlength="50"
|
||||
:placeholder="$t('dataset.input_content')"
|
||||
/>
|
||||
<template #footer>
|
||||
@ -150,6 +151,11 @@ const props = defineProps({
|
||||
type: String,
|
||||
required: false,
|
||||
default: 'canvas'
|
||||
},
|
||||
scale: {
|
||||
type: Number,
|
||||
required: false,
|
||||
default: 1
|
||||
}
|
||||
})
|
||||
const { element, isEdit, showPosition, canvasStyleData, canvasViewInfo, dvInfo } = toRefs(props)
|
||||
|
@ -127,7 +127,7 @@ const init = ref({
|
||||
'| bdmap indent2em lineheight formatpainter axupimgs',
|
||||
toolbar_location: '/',
|
||||
font_formats:
|
||||
'微软雅黑=Microsoft YaHei;宋体=SimSun;黑体=SimHei;仿宋=FangSong;华文黑体=STHeiti;华文楷体=STKaiti;华文宋体=STSong;华文仿宋=STFangsong;Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings',
|
||||
'阿里巴巴普惠体=阿里巴巴普惠体 3.0 55 Regular L3;微软雅黑=Microsoft YaHei;宋体=SimSun;黑体=SimHei;仿宋=FangSong;华文黑体=STHeiti;华文楷体=STKaiti;华文宋体=STSong;华文仿宋=STFangsong;Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings',
|
||||
fontsize_formats: '12px 14px 16px 18px 20px 22px 24px 28px 32px 36px 48px 56px 72px', // 字体大小
|
||||
menubar: false,
|
||||
placeholder: '',
|
||||
@ -271,8 +271,16 @@ const showPlaceHolder = computed<boolean>(() => {
|
||||
)
|
||||
})
|
||||
|
||||
const editActive = computed<boolean>(() => {
|
||||
if (element.value.canvasId.includes('Group') && !active.value) {
|
||||
return false
|
||||
} else {
|
||||
return true
|
||||
}
|
||||
})
|
||||
|
||||
const setEdit = () => {
|
||||
if (computedCanEdit.value) {
|
||||
if (computedCanEdit.value && editActive.value) {
|
||||
canEdit.value = true
|
||||
element.value['editing'] = true
|
||||
myValue.value = element.value.propValue.textValue
|
||||
|
@ -40,4 +40,7 @@ const menuSelect = (index: string, indexPath: string[]) => {
|
||||
width: 100%;
|
||||
min-height: 400px;
|
||||
}
|
||||
.ed-menu {
|
||||
border: none;
|
||||
}
|
||||
</style>
|
||||
|
@ -2126,12 +2126,64 @@ export default {
|
||||
setting_basic: {
|
||||
autoCreateUser: '第三方自动创建用户',
|
||||
dsIntervalTime: '数据源检测时间间隔',
|
||||
dsExecuteTime: '数据源检测频率'
|
||||
dsExecuteTime: '数据源检测频率',
|
||||
frontTimeOut: '请求超时时间(秒)'
|
||||
},
|
||||
template_manage: {
|
||||
name_already_exists_type: '分类名称已存在',
|
||||
the_same_category: '同一分类下,该模板名称已存在'
|
||||
},
|
||||
sync_manage: {
|
||||
title: '同步管理',
|
||||
ds_search_placeholder: '搜索名称,描述'
|
||||
},
|
||||
sync_datasource: {
|
||||
title: '数据连接管理',
|
||||
source_ds: '源数据源',
|
||||
target_ds: '目标数据源',
|
||||
add_source_ds: '@:common.add@:sync_datasource.source_ds',
|
||||
add_target_ds: '@:common.add@:sync_datasource.target_ds',
|
||||
name: '名称',
|
||||
desc: '描述',
|
||||
type: '类型',
|
||||
status: '状态',
|
||||
create_time: '创建时间',
|
||||
update_time: '更新时间',
|
||||
operation: '操作',
|
||||
edit: '编辑',
|
||||
delete: '删除',
|
||||
confirm_batch_delete_target_ds: '确定删除{0}个目标数据源吗?',
|
||||
confirm_batch_delete_source_ds: '确定删除{0}个源数据源吗?'
|
||||
},
|
||||
sync_task: {
|
||||
title: '任务管理',
|
||||
list: '任务列表',
|
||||
log_list: '任务日志',
|
||||
add_task: '添加任务',
|
||||
name: '名称',
|
||||
desc: '描述',
|
||||
status: '状态',
|
||||
create_time: '创建时间',
|
||||
update_time: '更新时间',
|
||||
operation: '操作',
|
||||
edit: '编辑',
|
||||
delete: '删除',
|
||||
start: '启动',
|
||||
stop: '停止',
|
||||
trigger_last_time: '上次执行时间',
|
||||
trigger_next_time: '下次执行时间',
|
||||
status_success: '成功',
|
||||
status_running: '执行中',
|
||||
status_failed: '失败',
|
||||
status_stopped: '已停止',
|
||||
status_waiting: '等待执行',
|
||||
status_done: '执行结束',
|
||||
status_suspend: '暂停',
|
||||
running_one: '执行一次',
|
||||
keep_going: '继续',
|
||||
log: '日志',
|
||||
show_log: '查看日志'
|
||||
},
|
||||
watermark: {
|
||||
support_params: '当前支持的参数:',
|
||||
enable: '启用水印',
|
||||
|
@ -18,7 +18,7 @@ const { start, done } = useNProgress()
|
||||
|
||||
const { loadStart, loadDone } = usePageLoading()
|
||||
|
||||
const whiteList = ['/login', '/de-link'] // 不重定向白名单
|
||||
const whiteList = ['/login', '/de-link', '/chart-view'] // 不重定向白名单
|
||||
|
||||
router.beforeEach(async (to, from, next) => {
|
||||
start()
|
||||
|
@ -112,6 +112,13 @@ export const routes: AppRouteRecordRaw[] = [
|
||||
meta: { hidden: true }
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/chart-view',
|
||||
name: 'chart-view',
|
||||
hidden: true,
|
||||
meta: {},
|
||||
component: () => import('@/views/chart/ChartView.vue')
|
||||
}
|
||||
]
|
||||
|
||||
|
@ -56,6 +56,46 @@ export const composeStore = defineStore('compose', {
|
||||
// do updateGroupBorder
|
||||
},
|
||||
|
||||
alignment: function (params) {
|
||||
const { areaData } = this
|
||||
if (areaData.components.length === 1) {
|
||||
// 一个组件不进行组合直接释放
|
||||
areaData.components = []
|
||||
return
|
||||
}
|
||||
if (areaData.components.length > 0 && areaData.style.width === 0) {
|
||||
// 计算组合区域
|
||||
this.calcComposeArea()
|
||||
}
|
||||
const { left, top, width, height } = areaData.style
|
||||
const areaRight = left + width
|
||||
const areaTransverseCenter = left + width / 2 // 横向中心点
|
||||
const areaBottom = top + height
|
||||
const areaDirectionCenter = top + height / 2 // 纵向中心点
|
||||
|
||||
areaData.components.forEach(component => {
|
||||
if (params === 'left') {
|
||||
// 居左
|
||||
component.style.left = left
|
||||
} else if (params === 'right') {
|
||||
// 居右
|
||||
component.style.left = areaRight - component.style.width
|
||||
} else if (params === 'top') {
|
||||
// 居上
|
||||
component.style.top = top
|
||||
} else if (params === 'bottom') {
|
||||
// 居下
|
||||
component.style.top = areaBottom - component.style.height
|
||||
} else if (params === 'transverse') {
|
||||
// 横向居中
|
||||
component.style.left = areaTransverseCenter - component.style.width / 2
|
||||
} else if (params === 'direction') {
|
||||
// 纵向
|
||||
component.style.top = areaDirectionCenter - component.style.height / 2
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
compose: function (canvasId = 'canvas-main') {
|
||||
const editor = this.editorMap[canvasId]
|
||||
const { areaData } = this
|
||||
|
@ -129,6 +129,15 @@ export const copyStore = defineStore('copy', {
|
||||
composeStore.areaData.components.forEach(component => {
|
||||
dvMainStore.deleteComponentById(component.id)
|
||||
})
|
||||
composeStore.setAreaData({
|
||||
style: {
|
||||
left: 0,
|
||||
top: 0,
|
||||
width: 0,
|
||||
height: 0
|
||||
},
|
||||
components: []
|
||||
})
|
||||
}
|
||||
snapshotStore.recordSnapshotCache()
|
||||
this.isCut = true
|
||||
|
@ -58,6 +58,7 @@ export const dvMainStore = defineStore('dataVisualization', {
|
||||
pid: null,
|
||||
status: null,
|
||||
selfWatermarkStatus: null,
|
||||
watermarkInfo: {},
|
||||
type: null
|
||||
},
|
||||
// 图表信息
|
||||
@ -861,8 +862,8 @@ export const dvMainStore = defineStore('dataVisualization', {
|
||||
pid: null,
|
||||
status: null,
|
||||
selfWatermarkStatus: null,
|
||||
type: null,
|
||||
watermarkInfo: null
|
||||
watermarkInfo: {},
|
||||
type: null
|
||||
}
|
||||
},
|
||||
setViewDataDetails(viewId, dataInfo) {
|
||||
@ -889,7 +890,7 @@ export const dvMainStore = defineStore('dataVisualization', {
|
||||
}
|
||||
}
|
||||
},
|
||||
createInit(dvType, resourceId?, pid?) {
|
||||
createInit(dvType, resourceId?, pid?, watermarkInfo?) {
|
||||
const optName = dvType === 'dashboard' ? '新建仪表板' : '新建数据大屏'
|
||||
this.dvInfo = {
|
||||
dataState: 'prepare',
|
||||
@ -899,7 +900,8 @@ export const dvMainStore = defineStore('dataVisualization', {
|
||||
pid: pid,
|
||||
type: dvType,
|
||||
status: 1,
|
||||
selfWatermarkStatus: 0
|
||||
selfWatermarkStatus: true,
|
||||
watermarkInfo: watermarkInfo
|
||||
}
|
||||
const canvasStyleDataNew =
|
||||
dvType === 'dashboard'
|
||||
@ -921,6 +923,7 @@ export const dvMainStore = defineStore('dataVisualization', {
|
||||
pid: null,
|
||||
status: null,
|
||||
selfWatermarkStatus: null,
|
||||
watermarkInfo: {},
|
||||
type: null
|
||||
}
|
||||
this.canvasStyleData = { ...deepCopy(DEFAULT_CANVAS_STYLE_DATA_DARK), backgroundColor: null }
|
||||
|
@ -90,7 +90,7 @@ export function initCanvasDataPrepare(dvId, busiFlag, callBack) {
|
||||
name: canvasInfo.name,
|
||||
pid: canvasInfo.pid,
|
||||
status: canvasInfo.status,
|
||||
watermarkOpen: canvasInfo.selfWatermarkStatus,
|
||||
selfWatermarkStatus: canvasInfo.selfWatermarkStatus,
|
||||
type: canvasInfo.type,
|
||||
creatorName: canvasInfo.creatorName,
|
||||
updateName: canvasInfo.updateName,
|
||||
|
@ -83,6 +83,9 @@ function format(value, scale) {
|
||||
return multiply(value, divide(parseFloat(scale), 100))
|
||||
}
|
||||
|
||||
function getOriginStyle(value, scale) {
|
||||
function getOriginStyle(value = 0, scale) {
|
||||
if (!value) {
|
||||
value = 0
|
||||
}
|
||||
return divide(value, divide(parseFloat(scale), 100))
|
||||
}
|
||||
|
@ -1,10 +1,17 @@
|
||||
<script lang="ts" setup>
|
||||
import aboutBg from '@/assets/img/about-bg.png'
|
||||
import { ref, reactive, onMounted } from 'vue'
|
||||
import { ref, reactive, onMounted, h } from 'vue'
|
||||
import { useUserStoreWithOut } from '@/store/modules/user'
|
||||
import { F2CLicense } from './index'
|
||||
import { validateApi, buildVersionApi, updateInfoApi } from '@/api/about'
|
||||
import { ElMessage } from 'element-plus-secondary'
|
||||
import {
|
||||
validateApi,
|
||||
buildVersionApi,
|
||||
updateInfoApi,
|
||||
checkFreeApi,
|
||||
syncFreeApi,
|
||||
delFreeApi
|
||||
} from '@/api/about'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus-secondary'
|
||||
import { useI18n } from '@/hooks/web/useI18n'
|
||||
import { useEmitt } from '@/hooks/web/useEmitt'
|
||||
const dialogVisible = ref(false)
|
||||
@ -113,11 +120,54 @@ const update = (licKey: string) => {
|
||||
ElMessage.success(t('about.update_success'))
|
||||
const info = getLicense(response.data)
|
||||
setLicense(info)
|
||||
checkFree()
|
||||
} else {
|
||||
ElMessage.warning(response.data.message)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const checkFree = () => {
|
||||
checkFreeApi().then(res => {
|
||||
if (res.data) {
|
||||
// do something
|
||||
const title = '存在未同步的资源数据,请谨慎操作!'
|
||||
const childrenDomList = [h('strong', null, title)]
|
||||
ElMessageBox.confirm('', {
|
||||
confirmButtonType: 'primary',
|
||||
type: 'warning',
|
||||
autofocus: false,
|
||||
dangerouslyUseHTMLString: true,
|
||||
message: h('div', { class: 'free-sync-tip-box' }, childrenDomList),
|
||||
showClose: false,
|
||||
cancelButtonText: '删除',
|
||||
confirmButtonText: '同步'
|
||||
})
|
||||
.then(() => {
|
||||
syncFree()
|
||||
})
|
||||
.catch(() => {
|
||||
delFree()
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const delFree = () => {
|
||||
delFreeApi().then(res => {
|
||||
if (!res.code && !res.msg) {
|
||||
ElMessage.success(t('common.delete_success'))
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const syncFree = () => {
|
||||
syncFreeApi().then(res => {
|
||||
if (!res.code && !res.msg) {
|
||||
ElMessage.success('同步成功')
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
@ -42,10 +42,11 @@ const domId = ref('de-canvas-' + canvasId.value)
|
||||
|
||||
const dvMainStore = dvMainStoreWithOut()
|
||||
const snapshotStore = snapshotStoreWithOut()
|
||||
const { pcMatrixCount, curOriginThemes } = storeToRefs(dvMainStore)
|
||||
const { pcMatrixCount, curOriginThemes, dvInfo } = storeToRefs(dvMainStore)
|
||||
const canvasOut = ref(null)
|
||||
const canvasInner = ref(null)
|
||||
const canvasInitStatus = ref(false)
|
||||
const userInfo = ref(null)
|
||||
|
||||
const state = reactive({
|
||||
screenWidth: 1920,
|
||||
@ -59,6 +60,7 @@ const renderState = ref(false) // 仪表板默认
|
||||
const baseMarginLeft = ref(0)
|
||||
const baseMarginTop = ref(0)
|
||||
const cyGridster = ref(null)
|
||||
const editDomId = ref('edit-' + canvasId.value)
|
||||
|
||||
const editStyle = computed(() => {
|
||||
if (canvasStyleData.value && isMainCanvas(canvasId.value)) {
|
||||
@ -78,6 +80,7 @@ const handleNewFromCanvasMain = newComponentInfo => {
|
||||
syncShapeItemStyle(component, baseWidth.value, baseHeight.value)
|
||||
component.id = guid()
|
||||
component.y = 200
|
||||
component.x = cyGridster.value.findPositionX(component)
|
||||
dvMainStore.addComponent({
|
||||
component: component,
|
||||
index: undefined,
|
||||
@ -242,7 +245,7 @@ defineExpose({
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div ref="canvasOut" class="content" :class="{ 'render-active': renderState }">
|
||||
<div ref="canvasOut" :id="editDomId" class="content" :class="{ 'render-active': renderState }">
|
||||
<canvas-opt-bar
|
||||
:canvas-style-data="canvasStyleData"
|
||||
:component-data="componentData"
|
||||
|
29
core/core-frontend/src/views/chart/ChartView.vue
Normal file
29
core/core-frontend/src/views/chart/ChartView.vue
Normal file
@ -0,0 +1,29 @@
|
||||
<script lang="ts" setup>
|
||||
import ViewWrapper from '@/pages/panel/ViewWrapper.vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { onBeforeMount } from 'vue'
|
||||
const route = useRoute()
|
||||
const init = () => {
|
||||
const busiFlag = route.query.busiFlag
|
||||
const dvId = route.query.dvId
|
||||
const chartId = route.query.chartId
|
||||
const embeddedToken = route.query.embeddedToken
|
||||
console.log(busiFlag)
|
||||
console.log(dvId)
|
||||
console.log(chartId)
|
||||
console.log(embeddedToken)
|
||||
window.DataEaseBi = {
|
||||
token: embeddedToken,
|
||||
chartId: chartId,
|
||||
dvId: dvId,
|
||||
busiFlag: busiFlag
|
||||
}
|
||||
}
|
||||
onBeforeMount(() => {
|
||||
init()
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<view-wrapper />
|
||||
</template>
|
@ -17,6 +17,7 @@ import { check, compareStorage } from '@/utils/CrossPermission'
|
||||
import { useCache } from '@/hooks/web/useCache'
|
||||
import { snapshotStoreWithOut } from '@/store/modules/data-visualization/snapshot'
|
||||
import { interactiveStoreWithOut } from '@/store/modules/interactive'
|
||||
import { watermarkFind } from '@/api/watermark'
|
||||
const interactiveStore = interactiveStoreWithOut()
|
||||
const { wsCache } = useCache()
|
||||
const eventCheck = e => {
|
||||
@ -93,8 +94,17 @@ onMounted(async () => {
|
||||
})
|
||||
} else if (opt && opt === 'create') {
|
||||
dataInitState.value = false
|
||||
let watermarkBaseInfo
|
||||
try {
|
||||
await watermarkFind().then(rsp => {
|
||||
watermarkBaseInfo = rsp.data
|
||||
watermarkBaseInfo.settingContent = JSON.parse(watermarkBaseInfo.settingContent)
|
||||
})
|
||||
} catch (e) {
|
||||
console.error('can not find watermark info')
|
||||
}
|
||||
nextTick(() => {
|
||||
dvMainStore.createInit('dashboard', null, pid)
|
||||
dvMainStore.createInit('dashboard', null, pid, watermarkBaseInfo)
|
||||
// 从模板新建
|
||||
if (createType === 'template') {
|
||||
const deTemplateDataStr = wsCache.get(`de-template-data`)
|
||||
|
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<XpackComponent jsname="bGluaw==" :error-tips="true" />
|
||||
<link-index :error-tips="true" />
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { XpackComponent } from '@/components/plugin'
|
||||
import LinkIndex from '@/views/share/link/index.vue'
|
||||
</script>
|
||||
|
@ -6,7 +6,7 @@ import { useAppStoreWithOut } from '@/store/modules/app'
|
||||
import DvDetailInfo from '@/views/common/DvDetailInfo.vue'
|
||||
import { storeApi, storeStatusApi } from '@/api/visualization/dataVisualization'
|
||||
import { ref, watch, computed } from 'vue'
|
||||
import { XpackComponent } from '@/components/plugin'
|
||||
import ShareVisualHead from '@/views/share/share/ShareVisualHead.vue'
|
||||
const dvMainStore = dvMainStoreWithOut()
|
||||
const appStore = useAppStoreWithOut()
|
||||
const { dvInfo } = storeToRefs(dvMainStore)
|
||||
@ -94,8 +94,7 @@ watch(
|
||||
</template>
|
||||
预览</el-button
|
||||
>
|
||||
<XpackComponent
|
||||
jsname="L2NvbXBvbmVudC9zaGFyZS9TaGFyZVZpc3VhbEhlYWQ="
|
||||
<ShareVisualHead
|
||||
:resource-id="dvInfo.id"
|
||||
:weight="dvInfo.weight"
|
||||
:resource-type="dvInfo.type"
|
||||
|
@ -26,6 +26,7 @@ import { check, compareStorage } from '@/utils/CrossPermission'
|
||||
import { useCache } from '@/hooks/web/useCache'
|
||||
import RealTimeListTree from '@/components/data-visualization/RealTimeListTree.vue'
|
||||
import { interactiveStoreWithOut } from '@/store/modules/interactive'
|
||||
import { watermarkFind } from '@/api/watermark'
|
||||
const interactiveStore = interactiveStoreWithOut()
|
||||
const { wsCache } = useCache()
|
||||
const eventCheck = e => {
|
||||
@ -221,7 +222,17 @@ onMounted(async () => {
|
||||
})
|
||||
} else if (opt && opt === 'create') {
|
||||
state.canvasInitStatus = false
|
||||
dvMainStore.createInit('dataV', null, pid)
|
||||
let watermarkBaseInfo
|
||||
try {
|
||||
await watermarkFind().then(rsp => {
|
||||
watermarkBaseInfo = rsp.data
|
||||
watermarkBaseInfo.settingContent = JSON.parse(watermarkBaseInfo.settingContent)
|
||||
})
|
||||
} catch (e) {
|
||||
console.error('can not find watermark info')
|
||||
}
|
||||
|
||||
dvMainStore.createInit('dataV', null, pid, watermarkBaseInfo)
|
||||
nextTick(() => {
|
||||
state.canvasInitStatus = true
|
||||
dvMainStore.setDataPrepareState(true)
|
||||
|
@ -173,7 +173,8 @@ const showLoginErrorMsg = () => {
|
||||
onMounted(() => {
|
||||
checkPlatform()
|
||||
if (localStorage.getItem('DE-GATEWAY-FLAG')) {
|
||||
loginErrorMsg.value = localStorage.getItem('DE-GATEWAY-FLAG')
|
||||
const msg = localStorage.getItem('DE-GATEWAY-FLAG')
|
||||
loginErrorMsg.value = decodeURIComponent(msg)
|
||||
showLoginErrorMsg()
|
||||
localStorage.removeItem('DE-GATEWAY-FLAG')
|
||||
logoutHandler(true)
|
||||
|
42
core/core-frontend/src/views/share/link/ShareProxy.ts
Normal file
42
core/core-frontend/src/views/share/link/ShareProxy.ts
Normal file
@ -0,0 +1,42 @@
|
||||
import request from '@/config/axios'
|
||||
import { useCache } from '@/hooks/web/useCache'
|
||||
const { wsCache } = useCache()
|
||||
export interface ProxyInfo {
|
||||
resourceId: string
|
||||
uid: string
|
||||
exp?: boolean
|
||||
pwdValid?: boolean
|
||||
type: string
|
||||
}
|
||||
class ShareProxy {
|
||||
uuid: string
|
||||
constructor() {
|
||||
this.uuid = ''
|
||||
}
|
||||
setUuid() {
|
||||
const curLocation = window.location.href
|
||||
const uuidObj = curLocation.substring(
|
||||
curLocation.lastIndexOf('de-link/') + 8,
|
||||
curLocation.lastIndexOf('?') > 0 ? curLocation.lastIndexOf('?') : curLocation.length
|
||||
)
|
||||
this.uuid = uuidObj
|
||||
}
|
||||
async loadProxy() {
|
||||
this.setUuid()
|
||||
if (!this.uuid) {
|
||||
return null
|
||||
}
|
||||
const uuid = this.uuid
|
||||
const url = '/share/proxyInfo'
|
||||
const param = { uuid, ciphertext: null }
|
||||
const ciphertext = wsCache.get(`link-${uuid}`)
|
||||
if (ciphertext) {
|
||||
param['ciphertext'] = ciphertext
|
||||
}
|
||||
const res = await request.post({ url, data: param })
|
||||
const proxyInfo: ProxyInfo = res.data as ProxyInfo
|
||||
return proxyInfo
|
||||
}
|
||||
}
|
||||
|
||||
export const shareProxy = new ShareProxy()
|
6
core/core-frontend/src/views/share/link/error.vue
Normal file
6
core/core-frontend/src/views/share/link/error.vue
Normal file
@ -0,0 +1,6 @@
|
||||
<script lang="ts" setup>
|
||||
import EmptyBackground from '@/components/empty-background/src/EmptyBackground.vue'
|
||||
</script>
|
||||
<template>
|
||||
<EmptyBackground img-type="noneWhite" description="链接不存在" />
|
||||
</template>
|
6
core/core-frontend/src/views/share/link/exp.vue
Normal file
6
core/core-frontend/src/views/share/link/exp.vue
Normal file
@ -0,0 +1,6 @@
|
||||
<script lang="ts" setup>
|
||||
import EmptyBackground from '@/components/empty-background/src/EmptyBackground.vue'
|
||||
</script>
|
||||
<template>
|
||||
<EmptyBackground img-type="noneWhite" description="链接已过期" />
|
||||
</template>
|
55
core/core-frontend/src/views/share/link/index.vue
Normal file
55
core/core-frontend/src/views/share/link/index.vue
Normal file
@ -0,0 +1,55 @@
|
||||
<template>
|
||||
<div class="link-container" v-loading="loading">
|
||||
<LinkError v-if="!loading && !linkExist" />
|
||||
<Exp v-else-if="!loading && linkExp" />
|
||||
<PwdTips v-else-if="!loading && !pwdValid" />
|
||||
<PreviewCanvas
|
||||
v-else
|
||||
:class="{ 'hidden-link': loading }"
|
||||
ref="pcanvas"
|
||||
public-link-status="true"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { onMounted, nextTick, ref } from 'vue'
|
||||
import PreviewCanvas from '@/views/data-visualization/PreviewCanvas.vue'
|
||||
import { ProxyInfo, shareProxy } from './ShareProxy'
|
||||
import Exp from './exp.vue'
|
||||
import LinkError from './error.vue'
|
||||
import PwdTips from './pwd.vue'
|
||||
const pcanvas = ref(null)
|
||||
const linkExist = ref(false)
|
||||
const loading = ref(true)
|
||||
const linkExp = ref(false)
|
||||
const pwdValid = ref(false)
|
||||
onMounted(async () => {
|
||||
const proxyInfo = (await shareProxy.loadProxy()) as ProxyInfo
|
||||
if (!proxyInfo?.resourceId) {
|
||||
loading.value = false
|
||||
return
|
||||
}
|
||||
linkExist.value = true
|
||||
linkExp.value = !!proxyInfo.exp
|
||||
pwdValid.value = !!proxyInfo.pwdValid
|
||||
nextTick(() => {
|
||||
const method = pcanvas?.value?.loadCanvasDataAsync
|
||||
if (method) {
|
||||
method(proxyInfo.resourceId, proxyInfo.type, null)
|
||||
}
|
||||
loading.value = false
|
||||
})
|
||||
})
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.link-container {
|
||||
position: absolute !important;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
}
|
||||
.hidden-link {
|
||||
display: none !important;
|
||||
}
|
||||
</style>
|
218
core/core-frontend/src/views/share/link/pwd.vue
Normal file
218
core/core-frontend/src/views/share/link/pwd.vue
Normal file
@ -0,0 +1,218 @@
|
||||
<template>
|
||||
<div class="pwd-body" v-loading="loading">
|
||||
<div class="pwd-wrapper">
|
||||
<div class="pwd-content">
|
||||
<div class="span-header">
|
||||
<div class="bi-text">
|
||||
<span style="text-align: center">{{ t('pblink.key_pwd') }} </span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="input-layout">
|
||||
<div class="input-main">
|
||||
<div class="div-input">
|
||||
<el-form ref="pwdForm" :model="form" :rules="rule" size="small" @submit.stop.prevent>
|
||||
<el-form-item label="" prop="password">
|
||||
<CustomPassword
|
||||
v-model="form.password"
|
||||
maxlength="4"
|
||||
show-password
|
||||
class="real-input"
|
||||
:placeholder="t('pblink.input_placeholder')"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="abs-input">
|
||||
<div class="input-text">{{ msg }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="auth-root-class">
|
||||
<el-button size="small" type="primary" @click="refresh">{{
|
||||
t('pblink.sure_bt')
|
||||
}}</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, reactive, onMounted } from 'vue'
|
||||
import { useI18n } from '@/hooks/web/useI18n'
|
||||
import type { FormInstance, FormRules } from 'element-plus-secondary'
|
||||
import request from '@/config/axios'
|
||||
import { useAppStoreWithOut } from '@/store/modules/app'
|
||||
import { rsaEncryp } from '@/utils/encryption'
|
||||
import { useCache } from '@/hooks/web/useCache'
|
||||
import { queryDekey } from '@/api/login'
|
||||
import { CustomPassword } from '@/components/custom-password'
|
||||
const { wsCache } = useCache()
|
||||
const appStore = useAppStoreWithOut()
|
||||
|
||||
const { t } = useI18n()
|
||||
const msg = ref('')
|
||||
const loading = ref(true)
|
||||
const pwdForm = ref<FormInstance>()
|
||||
const form = ref({
|
||||
password: ''
|
||||
})
|
||||
const rule = reactive<FormRules>({
|
||||
password: [
|
||||
{ required: true, message: t('pblink.key_pwd'), trigger: 'blur' },
|
||||
{
|
||||
required: true,
|
||||
pattern: /^[a-zA-Z0-9]{4}$/,
|
||||
message: t('pblink.pwd_format_error'),
|
||||
trigger: 'blur'
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
const refresh = () => {
|
||||
const curLocation = window.location.href
|
||||
const paramIndex = curLocation.indexOf('?')
|
||||
const uuidIndex = curLocation.indexOf('de-link/') + 8
|
||||
const uuid = curLocation.substring(uuidIndex, paramIndex !== -1 ? paramIndex : curLocation.length)
|
||||
const pwd = form.value.password
|
||||
const text = uuid + pwd
|
||||
const ciphertext = rsaEncryp(text)
|
||||
request.post({ url: '/share/validate', data: { ciphertext } }).then(res => {
|
||||
if (res.data) {
|
||||
wsCache.set(`link-${uuid}`, ciphertext)
|
||||
window.location.reload()
|
||||
} else {
|
||||
msg.value = '密码错误'
|
||||
}
|
||||
})
|
||||
}
|
||||
onMounted(() => {
|
||||
if (!wsCache.get(appStore.getDekey)) {
|
||||
queryDekey()
|
||||
.then(res => {
|
||||
wsCache.set(appStore.getDekey, res.data)
|
||||
})
|
||||
.finally(() => {
|
||||
loading.value = false
|
||||
})
|
||||
}
|
||||
loading.value = false
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.pwd-body {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
top: 0;
|
||||
left: 0;
|
||||
background-repeat: repeat;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
-o-user-select: none;
|
||||
user-select: none;
|
||||
color: #3d4d66;
|
||||
// font: normal 12px Helvetica Neue,Arial,PingFang SC,Hiragino Sans GB,Microsoft YaHei,微软雅黑,Heiti,黑体,sans-serif;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
text-decoration: none;
|
||||
-kthml-user-focus: normal;
|
||||
-moz-user-focus: normal;
|
||||
-moz-outline: 0 none;
|
||||
outline: 0 none;
|
||||
height: 100%;
|
||||
display: block;
|
||||
}
|
||||
.pwd-wrapper {
|
||||
background-color: #f7f8fa;
|
||||
height: 100%;
|
||||
justify-content: center !important;
|
||||
align-items: center !important;
|
||||
min-height: 25px;
|
||||
display: flex;
|
||||
-moz-flex-direction: row;
|
||||
-o-flex-direction: row;
|
||||
flex-direction: row;
|
||||
-moz-justify-content: flex-start;
|
||||
-ms-justify-content: flex-start;
|
||||
-o-justify-content: flex-start;
|
||||
justify-content: flex-start;
|
||||
-moz-align-items: flex-start;
|
||||
-ms-align-items: flex-start;
|
||||
-o-align-items: flex-start;
|
||||
align-items: flex-start;
|
||||
-o-flex-wrap: nowrap;
|
||||
flex-wrap: nowrap;
|
||||
}
|
||||
.pwd-content {
|
||||
width: 450px;
|
||||
height: 250px;
|
||||
position: relative;
|
||||
flex-shrink: 0;
|
||||
background-color: #ffffff;
|
||||
display: block;
|
||||
}
|
||||
.span-header {
|
||||
position: relative;
|
||||
margin: 57px auto 0px;
|
||||
justify-content: center !important;
|
||||
align-items: center !important;
|
||||
}
|
||||
.bi-text {
|
||||
max-width: 100%;
|
||||
text-align: center;
|
||||
white-space: pre;
|
||||
text-overflow: ellipsis;
|
||||
position: relative;
|
||||
flex-shrink: 0;
|
||||
box-sizing: border-box;
|
||||
overflow: hidden;
|
||||
overflow-x: hidden;
|
||||
overflow-y: hidden;
|
||||
word-break: break-all;
|
||||
display: block;
|
||||
}
|
||||
.input-layout {
|
||||
width: 200px;
|
||||
position: relative;
|
||||
margin: 0px auto;
|
||||
padding: 0;
|
||||
display: block;
|
||||
}
|
||||
.input-main {
|
||||
width: 192px;
|
||||
height: 35px;
|
||||
position: relative;
|
||||
margin-top: 30px;
|
||||
// border: 1px solid #e8eaed;
|
||||
display: block;
|
||||
}
|
||||
.abs-input {
|
||||
height: 20px;
|
||||
position: relative;
|
||||
margin-top: 5px;
|
||||
display: block;
|
||||
}
|
||||
.input-text {
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
text-align: center;
|
||||
white-space: pre;
|
||||
text-overflow: ellipsis;
|
||||
left: 0px;
|
||||
top: 0px;
|
||||
bottom: 0px;
|
||||
position: absolute;
|
||||
color: #e65251;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.auth-root-class {
|
||||
margin: 15px 0px 5px;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
267
core/core-frontend/src/views/share/share/ShareGrid.vue
Normal file
267
core/core-frontend/src/views/share/share/ShareGrid.vue
Normal file
@ -0,0 +1,267 @@
|
||||
<script lang="ts" setup>
|
||||
import { useI18n } from '@/hooks/web/useI18n'
|
||||
import { ref, reactive, watch, computed } from 'vue'
|
||||
import GridTable from '@/components/grid-table/src/GridTable.vue'
|
||||
import request from '@/config/axios'
|
||||
import dayjs from 'dayjs'
|
||||
import { propTypes } from '@/utils/propTypes'
|
||||
import ShareHandler from './ShareHandler.vue'
|
||||
import { interactiveStoreWithOut } from '@/store/modules/interactive'
|
||||
const props = defineProps({
|
||||
activeName: propTypes.string.def('')
|
||||
})
|
||||
|
||||
const { t } = useI18n()
|
||||
const interactiveStore = interactiveStoreWithOut()
|
||||
|
||||
const busiDataMap = computed(() => interactiveStore.getData)
|
||||
const panelKeyword = ref()
|
||||
const userAddPopper = ref(false)
|
||||
const activeCommand = ref('all_types')
|
||||
const state = reactive({
|
||||
tableData: [],
|
||||
curTypeList: ['all_types', 'panel', 'screen'],
|
||||
tableColumn: [
|
||||
{ field: 'creator', label: '分享人' },
|
||||
{ field: 'time', label: '分享时间', type: 'time' },
|
||||
{ field: 'exp', label: '有效期', type: 'time' }
|
||||
]
|
||||
})
|
||||
|
||||
const handleVisibleChange = (val: boolean) => {
|
||||
userAddPopper.value = val
|
||||
}
|
||||
|
||||
const handleCommand = (command: string) => {
|
||||
activeCommand.value = command
|
||||
loadTableData()
|
||||
}
|
||||
|
||||
const triggerFilterPanel = () => {
|
||||
loadTableData()
|
||||
}
|
||||
const preview = id => {
|
||||
const routeUrl = `/#/preview?dvId=${id}`
|
||||
window.open(routeUrl, '_blank')
|
||||
}
|
||||
const formatterTime = (_, _column, cellValue) => {
|
||||
if (!cellValue) {
|
||||
return '-'
|
||||
}
|
||||
return dayjs(new Date(cellValue)).format('YYYY-MM-DD HH:mm:ss')
|
||||
}
|
||||
|
||||
const showLoading = () => {
|
||||
emits('setLoading', true)
|
||||
}
|
||||
const closeLoading = () => {
|
||||
emits('setLoading', false)
|
||||
}
|
||||
const emits = defineEmits(['setLoading'])
|
||||
const loadTableData = () => {
|
||||
showLoading()
|
||||
const queryType = activeCommand.value === 'all_types' ? '' : activeCommand.value
|
||||
request
|
||||
.post({
|
||||
url: '/share/query',
|
||||
data: { type: queryType, keyword: panelKeyword.value, asc: !orderDesc.value }
|
||||
})
|
||||
.then(res => {
|
||||
state.tableData = res.data
|
||||
})
|
||||
.finally(() => {
|
||||
imgType.value = getEmptyImg()
|
||||
emptyDesc.value = getEmptyDesc()
|
||||
closeLoading()
|
||||
})
|
||||
}
|
||||
const orderDesc = ref(true)
|
||||
const sortChange = param => {
|
||||
orderDesc.value = true
|
||||
const type = param.order.substring(0, param.order.indexOf('ending'))
|
||||
orderDesc.value = type === 'desc'
|
||||
loadTableData()
|
||||
}
|
||||
const getBusiListWithPermission = () => {
|
||||
const baseFlagList: string[] = ['panel', 'screen']
|
||||
const busiFlagList: string[] = []
|
||||
for (const key in busiDataMap.value) {
|
||||
if (busiDataMap.value[key].menuAuth) {
|
||||
busiFlagList.push(baseFlagList[parseInt(key)])
|
||||
}
|
||||
}
|
||||
return busiFlagList
|
||||
}
|
||||
const busiAuthList: string[] = getBusiListWithPermission()
|
||||
|
||||
const imgType = ref()
|
||||
const emptyDesc = ref('')
|
||||
const getEmptyImg = (): string => {
|
||||
if (panelKeyword.value) {
|
||||
return 'tree'
|
||||
}
|
||||
return 'noneWhite'
|
||||
}
|
||||
|
||||
const getEmptyDesc = (): string => {
|
||||
if (panelKeyword.value) {
|
||||
return '没有找到相关内容'
|
||||
}
|
||||
|
||||
return ''
|
||||
}
|
||||
watch(
|
||||
() => props.activeName,
|
||||
() => {
|
||||
if (props.activeName === 'share') {
|
||||
loadTableData()
|
||||
}
|
||||
},
|
||||
{
|
||||
immediate: true
|
||||
}
|
||||
)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<el-row v-if="props.activeName === 'share'">
|
||||
<el-col :span="12">
|
||||
<el-dropdown
|
||||
placement="bottom-start"
|
||||
@visible-change="handleVisibleChange"
|
||||
popper-class="menu-panel-select_popper"
|
||||
@command="handleCommand"
|
||||
trigger="click"
|
||||
>
|
||||
<el-button secondary>
|
||||
{{ t(`auth.${activeCommand}`) }}
|
||||
<el-icon style="margin-left: 4px">
|
||||
<arrow-up v-if="userAddPopper" />
|
||||
<arrow-down v-else />
|
||||
</el-icon>
|
||||
</el-button>
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<el-dropdown-item
|
||||
:class="activeCommand === ele && 'active'"
|
||||
v-for="ele in state.curTypeList.filter(
|
||||
busi => busi === 'all_types' || busiAuthList.includes(busi)
|
||||
)"
|
||||
:command="ele"
|
||||
:key="ele"
|
||||
>
|
||||
{{ t(`auth.${ele}`) }}
|
||||
<el-icon v-if="activeCommand === ele">
|
||||
<Icon name="icon_done_outlined"></Icon>
|
||||
</el-icon>
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
</el-col>
|
||||
<el-col class="search" :span="12">
|
||||
<el-input
|
||||
v-model="panelKeyword"
|
||||
clearable
|
||||
@change="triggerFilterPanel"
|
||||
placeholder="搜索关键词"
|
||||
>
|
||||
<template #prefix>
|
||||
<el-icon>
|
||||
<Icon name="icon_search-outline_outlined"></Icon>
|
||||
</el-icon>
|
||||
</template>
|
||||
</el-input>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div v-if="props.activeName === 'share'" class="panel-table">
|
||||
<GridTable
|
||||
:show-pagination="false"
|
||||
:table-data="state.tableData"
|
||||
@sort-change="sortChange"
|
||||
:empty-desc="emptyDesc"
|
||||
:empty-img="imgType"
|
||||
class="workbranch-grid"
|
||||
>
|
||||
<el-table-column key="name" width="280" prop="name" :label="t('common.name')">
|
||||
<template v-slot:default="scope">
|
||||
<div class="name-content">
|
||||
<el-icon class="main-color"> <Icon name="icon_dashboard_outlined" /> </el-icon>
|
||||
<el-tooltip placement="top">
|
||||
<template #content>{{ scope.row.name }}</template>
|
||||
<span class="ellipsis" style="max-width: 250px">{{ scope.row.name }}</span>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-for="item in state.tableColumn"
|
||||
:key="item.label"
|
||||
prop="name"
|
||||
show-overflow-tooltip
|
||||
:label="item.label"
|
||||
:sortable="item.type === 'time' && item.field === 'time'"
|
||||
>
|
||||
<template #default="scope">
|
||||
<span v-if="item.type && item.type === 'time'">{{
|
||||
formatterTime(null, null, scope.row[item.field])
|
||||
}}</span>
|
||||
<span v-else>{{ scope.row[item.field] }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column width="96" fixed="right" key="_operation" :label="t('common.operate')">
|
||||
<template #default="scope">
|
||||
<el-tooltip effect="dark" content="新页面预览" placement="top">
|
||||
<el-icon class="hover-icon hover-icon-in-table" @click="preview(scope.row.resourceId)">
|
||||
<Icon name="icon_pc_outlined"></Icon>
|
||||
</el-icon>
|
||||
</el-tooltip>
|
||||
<ShareHandler
|
||||
:in-grid="true"
|
||||
:resource-id="scope.row.resourceId"
|
||||
:weight="scope.row.weight"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</GridTable>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.search {
|
||||
text-align: right;
|
||||
.ed-input {
|
||||
width: 240px;
|
||||
}
|
||||
}
|
||||
|
||||
.panel-table {
|
||||
margin-top: 16px;
|
||||
height: calc(100% - 110px);
|
||||
|
||||
.name-content {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.main-color {
|
||||
font-size: 21.33px;
|
||||
padding: 5.33px;
|
||||
margin-right: 12px;
|
||||
border-radius: 4px;
|
||||
color: #fff;
|
||||
background: #3370ff;
|
||||
}
|
||||
.name-star {
|
||||
font-size: 15px;
|
||||
padding-left: 5px;
|
||||
}
|
||||
}
|
||||
.workbranch-grid :deep(.ed-empty) {
|
||||
padding: 80px 0 !important;
|
||||
.ed-empty__description {
|
||||
margin-top: 0px;
|
||||
line-height: 20px !important;
|
||||
}
|
||||
}
|
||||
</style>
|
370
core/core-frontend/src/views/share/share/ShareHandler.vue
Normal file
370
core/core-frontend/src/views/share/share/ShareHandler.vue
Normal file
@ -0,0 +1,370 @@
|
||||
<template>
|
||||
<el-tooltip
|
||||
v-if="props.weight >= 7 && props.inGrid"
|
||||
effect="dark"
|
||||
:content="t('visualization.share')"
|
||||
placement="top"
|
||||
>
|
||||
<el-icon class="hover-icon hover-icon-in-table share-button-icon" @click="share">
|
||||
<Icon name="icon_share-label_outlined"></Icon>
|
||||
</el-icon>
|
||||
</el-tooltip>
|
||||
<el-button v-if="props.weight >= 7 && props.isButton" @click="share" icon="Share">{{
|
||||
t('visualization.share')
|
||||
}}</el-button>
|
||||
|
||||
<el-dialog
|
||||
v-if="dialogVisible && props.weight >= 7"
|
||||
class="copy-link_dialog"
|
||||
:class="{ 'hidden-footer': !shareEnable }"
|
||||
v-model="dialogVisible"
|
||||
:close-on-click-modal="true"
|
||||
:append-to-body="true"
|
||||
title="公共链接分享"
|
||||
width="480px"
|
||||
:show-close="false"
|
||||
>
|
||||
<div class="share-dialog-container">
|
||||
<div class="copy-link">
|
||||
<div class="open-share flex-align-center">
|
||||
<el-switch size="small" v-model="shareEnable" @change="enableSwitcher" />
|
||||
{{ shareTips }}
|
||||
</div>
|
||||
<div v-if="shareEnable" class="text">{{ linkAddr }}</div>
|
||||
<div v-if="shareEnable" class="exp-container">
|
||||
<el-checkbox
|
||||
:disabled="!shareEnable"
|
||||
v-model="overTimeEnable"
|
||||
@change="expEnableSwitcher"
|
||||
:label="t('visualization.over_time')"
|
||||
/>
|
||||
<div class="inline-share-item-picker">
|
||||
<el-date-picker
|
||||
:clearable="false"
|
||||
size="small"
|
||||
v-if="state.detailInfo.exp"
|
||||
class="share-exp-picker"
|
||||
v-model="state.detailInfo.exp"
|
||||
type="datetime"
|
||||
placeholder=""
|
||||
:shortcuts="shortcuts"
|
||||
@change="expChangeHandler"
|
||||
:disabled-date="disabledDate"
|
||||
value-format="x"
|
||||
/>
|
||||
<span v-if="expError" class="exp-error">必须大于当前时间</span>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="shareEnable" class="pwd-container">
|
||||
<el-checkbox
|
||||
:disabled="!shareEnable"
|
||||
v-model="passwdEnable"
|
||||
@change="pwdEnableSwitcher"
|
||||
:label="t('visualization.passwd_protect')"
|
||||
/>
|
||||
|
||||
<div class="inline-share-item" v-if="state.detailInfo.pwd">
|
||||
<el-input v-model="state.detailInfo.pwd" readonly size="small">
|
||||
<template #append>
|
||||
<div @click="resetPwd" class="share-reset-container">
|
||||
<span>{{ t('commons.reset') }}</span>
|
||||
</div>
|
||||
</template>
|
||||
</el-input>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button :disabled="!shareEnable || expError" type="primary" @click="copyInfo">
|
||||
{{ t('visualization.copy_link') }}
|
||||
</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { useI18n } from '@/hooks/web/useI18n'
|
||||
import { ref, reactive, onMounted, computed } from 'vue'
|
||||
import request from '@/config/axios'
|
||||
import { propTypes } from '@/utils/propTypes'
|
||||
import { ShareInfo, SHARE_BASE, shortcuts } from './option'
|
||||
import { ElMessage, ElLoading } from 'element-plus-secondary'
|
||||
import useClipboard from 'vue-clipboard3'
|
||||
const { toClipboard } = useClipboard()
|
||||
const { t } = useI18n()
|
||||
const props = defineProps({
|
||||
inGrid: propTypes.bool.def(false),
|
||||
resourceId: propTypes.string.def(''),
|
||||
resourceType: propTypes.string.def(''),
|
||||
weight: propTypes.number.def(0),
|
||||
isButton: propTypes.bool.def(false)
|
||||
})
|
||||
const loadingInstance = ref<any>(null)
|
||||
const dialogVisible = ref(false)
|
||||
const overTimeEnable = ref(false)
|
||||
const passwdEnable = ref(false)
|
||||
const shareEnable = ref(false)
|
||||
const linkAddr = ref('')
|
||||
const expError = ref(false)
|
||||
const state = reactive({
|
||||
detailInfo: {
|
||||
id: '',
|
||||
uuid: '',
|
||||
pwd: '',
|
||||
exp: 0
|
||||
} as ShareInfo
|
||||
})
|
||||
const emits = defineEmits(['loaded'])
|
||||
const shareTips = computed(
|
||||
() =>
|
||||
`开启后,用户可以通过该链接访问${props.resourceType === 'dashboard' ? '仪表板' : '数据大屏'}`
|
||||
)
|
||||
|
||||
const copyInfo = async () => {
|
||||
if (shareEnable.value) {
|
||||
try {
|
||||
await toClipboard(linkAddr.value)
|
||||
ElMessage.success(t('common.copy_success'))
|
||||
} catch (e) {
|
||||
ElMessage.warning(t('common.copy_unsupported'))
|
||||
}
|
||||
} else {
|
||||
ElMessage.warning(t('common.copy_unsupported'))
|
||||
}
|
||||
dialogVisible.value = false
|
||||
}
|
||||
|
||||
const disabledDate = date => {
|
||||
return date.getTime() < new Date().getTime()
|
||||
}
|
||||
|
||||
const showLoading = () => {
|
||||
loadingInstance.value = ElLoading.service({ target: '.share-dialog-container' })
|
||||
}
|
||||
const closeLoading = () => {
|
||||
loadingInstance.value?.close()
|
||||
}
|
||||
|
||||
const share = () => {
|
||||
dialogVisible.value = true
|
||||
loadShareInfo()
|
||||
}
|
||||
|
||||
const loadShareInfo = () => {
|
||||
showLoading()
|
||||
const resourceId = props.resourceId
|
||||
const url = `/share/detail/${resourceId}`
|
||||
request
|
||||
.get({ url })
|
||||
.then(res => {
|
||||
state.detailInfo = { ...res.data }
|
||||
setPageInfo()
|
||||
})
|
||||
.finally(() => {
|
||||
closeLoading()
|
||||
})
|
||||
}
|
||||
|
||||
const setPageInfo = () => {
|
||||
if (state.detailInfo.id && state.detailInfo.uuid) {
|
||||
shareEnable.value = true
|
||||
formatLinkAddr()
|
||||
}
|
||||
passwdEnable.value = !!state.detailInfo.pwd
|
||||
overTimeEnable.value = !!state.detailInfo.exp
|
||||
}
|
||||
|
||||
const enableSwitcher = () => {
|
||||
const resourceId = props.resourceId
|
||||
const url = `/share/switcher/${resourceId}`
|
||||
request.post({ url }).then(() => {
|
||||
loadShareInfo()
|
||||
})
|
||||
}
|
||||
|
||||
const formatLinkAddr = () => {
|
||||
const href = window.location.href
|
||||
const prefix = href.substring(0, href.indexOf('#') + 1)
|
||||
linkAddr.value = prefix + SHARE_BASE + state.detailInfo.uuid
|
||||
}
|
||||
|
||||
const expEnableSwitcher = val => {
|
||||
let exp = 0
|
||||
if (val) {
|
||||
const now = new Date()
|
||||
now.setTime(now.getTime() + 3600 * 1000)
|
||||
exp = now.getTime()
|
||||
state.detailInfo.exp = exp
|
||||
}
|
||||
expChangeHandler(exp)
|
||||
}
|
||||
|
||||
const expChangeHandler = exp => {
|
||||
if (overTimeEnable.value && exp < new Date().getTime()) {
|
||||
expError.value = true
|
||||
return
|
||||
}
|
||||
expError.value = false
|
||||
const resourceId = props.resourceId
|
||||
const url = '/share/editExp'
|
||||
const data = { resourceId, exp }
|
||||
request.post({ url, data }).then(() => {
|
||||
loadShareInfo()
|
||||
})
|
||||
}
|
||||
|
||||
const pwdEnableSwitcher = val => {
|
||||
let pwd = ''
|
||||
if (val) {
|
||||
pwd = getUuid()
|
||||
}
|
||||
resetPwdHandler(pwd)
|
||||
}
|
||||
const resetPwd = () => {
|
||||
const pwd = getUuid()
|
||||
resetPwdHandler(pwd)
|
||||
}
|
||||
const resetPwdHandler = (pwd?: string) => {
|
||||
const resourceId = props.resourceId
|
||||
const url = '/share/editPwd'
|
||||
const data = { resourceId, pwd }
|
||||
request.post({ url, data }).then(() => {
|
||||
loadShareInfo()
|
||||
})
|
||||
}
|
||||
|
||||
const getUuid = () => {
|
||||
return 'xyxy'.replace(/[xy]/g, function (c) {
|
||||
var r = (Math.random() * 16) | 0,
|
||||
v = c == 'x' ? r : (r & 0x3) | 0x8
|
||||
return v.toString(16)
|
||||
})
|
||||
}
|
||||
|
||||
const execute = () => {
|
||||
share()
|
||||
}
|
||||
defineExpose({
|
||||
execute
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
if (!props.inGrid && props.weight >= 7) {
|
||||
const commandInfo = {
|
||||
label: '分享',
|
||||
command: 'share',
|
||||
svgName: 'dv-share'
|
||||
}
|
||||
emits('loaded', commandInfo)
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<style lang="less">
|
||||
.copy-link_dialog {
|
||||
.ed-dialog__header {
|
||||
padding: 16px 16px 10px !important;
|
||||
.ed-dialog__title {
|
||||
font-size: 14px !important;
|
||||
}
|
||||
}
|
||||
.ed-dialog__body {
|
||||
padding: 16px !important;
|
||||
}
|
||||
.ed-dialog__footer {
|
||||
border-top: 1px solid #1f232926;
|
||||
padding: 12px 16px 16px;
|
||||
}
|
||||
}
|
||||
.hidden-footer {
|
||||
.ed-dialog__footer {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<style lang="less" scoped>
|
||||
.share-button-icon {
|
||||
margin-left: 4px;
|
||||
}
|
||||
.copy-link_dialog {
|
||||
.exp-container {
|
||||
.ed-checkbox {
|
||||
margin-right: 10px;
|
||||
}
|
||||
.inline-share-item-picker {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
:deep(.share-exp-picker) {
|
||||
margin-left: 25px !important;
|
||||
.ed-input__wrapper {
|
||||
width: 200px !important;
|
||||
}
|
||||
}
|
||||
.exp-error {
|
||||
color: var(--ed-color-danger);
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.pwd-container {
|
||||
.ed-checkbox {
|
||||
margin-right: 10px;
|
||||
}
|
||||
.inline-share-item {
|
||||
margin-left: 25px;
|
||||
width: 220px;
|
||||
|
||||
:deep(.ed-input-group__append) {
|
||||
width: 45px !important;
|
||||
background: none;
|
||||
color: #1f2329;
|
||||
padding: 0px 0px !important;
|
||||
.share-reset-container {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
&:hover {
|
||||
cursor: pointer;
|
||||
background-color: #f5f6f7;
|
||||
}
|
||||
&:active {
|
||||
cursor: pointer;
|
||||
background-color: #eff0f1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.copy-link {
|
||||
font-weight: 400;
|
||||
font-family: PingFang SC;
|
||||
|
||||
.open-share {
|
||||
margin: -18px 0 8px 0;
|
||||
color: #646a73;
|
||||
font-size: 12px;
|
||||
font-style: normal;
|
||||
line-height: 20px;
|
||||
.ed-switch {
|
||||
margin-right: 8px;
|
||||
}
|
||||
}
|
||||
|
||||
.text {
|
||||
border-radius: 4px;
|
||||
border: 1px solid #bbbfc4;
|
||||
background: #eff0f1;
|
||||
margin-bottom: 16px;
|
||||
height: 32px;
|
||||
padding: 5px 12px;
|
||||
color: #8f959e;
|
||||
font-size: 14px;
|
||||
font-style: normal;
|
||||
line-height: 22px;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user