Merge branch 'dev-v2' into pr@dev-v2@fixDS
@ -31,7 +31,9 @@ public class StackMixHandler extends MixHandler {
|
||||
axisMap.put(ChartAxis.yAxisExt, view.getYAxisExt());
|
||||
//去除除了x轴以外的排序
|
||||
axisMap.forEach((k, v) -> {
|
||||
v.forEach(x -> x.setSort("none"));
|
||||
if (!ChartAxis.extStack.equals(k)) {
|
||||
v.forEach(x -> x.setSort("none"));
|
||||
}
|
||||
});
|
||||
axisMap.put(ChartAxis.extLabel, view.getExtLabel());
|
||||
axisMap.put(ChartAxis.extTooltip, view.getExtTooltip());
|
||||
|
@ -1,7 +1,23 @@
|
||||
package io.dataease.chart.charts.impl.numeric;
|
||||
|
||||
import io.dataease.chart.utils.ChartDataBuild;
|
||||
import io.dataease.engine.sql.SQLProvider;
|
||||
import io.dataease.engine.trans.Dimension2SQLObj;
|
||||
import io.dataease.engine.trans.Quota2SQLObj;
|
||||
import io.dataease.engine.utils.Utils;
|
||||
import io.dataease.extensions.datasource.dto.DatasourceRequest;
|
||||
import io.dataease.extensions.datasource.dto.DatasourceSchemaDTO;
|
||||
import io.dataease.extensions.datasource.model.SQLMeta;
|
||||
import io.dataease.extensions.datasource.provider.Provider;
|
||||
import io.dataease.extensions.view.dto.*;
|
||||
import io.dataease.extensions.view.util.FieldUtil;
|
||||
import lombok.Getter;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Component
|
||||
public class IndicatorHandler extends NumericalChartHandler {
|
||||
@ -9,4 +25,58 @@ public class IndicatorHandler extends NumericalChartHandler {
|
||||
private String render = "custom";
|
||||
@Getter
|
||||
private String type = "indicator";
|
||||
|
||||
@Override
|
||||
public <T extends ChartCalcDataResult> T calcChartResult(ChartViewDTO view, AxisFormatResult formatResult, CustomFilterResult filterResult, Map<String, Object> sqlMap, SQLMeta sqlMeta, Provider provider) {
|
||||
var dsMap = (Map<Long, DatasourceSchemaDTO>) sqlMap.get("dsMap");
|
||||
List<String> dsList = new ArrayList<>();
|
||||
for (Map.Entry<Long, DatasourceSchemaDTO> next : dsMap.entrySet()) {
|
||||
dsList.add(next.getValue().getType());
|
||||
}
|
||||
boolean needOrder = Utils.isNeedOrder(dsList);
|
||||
boolean crossDs = Utils.isCrossDs(dsMap);
|
||||
DatasourceRequest datasourceRequest = new DatasourceRequest();
|
||||
datasourceRequest.setDsList(dsMap);
|
||||
var xAxis = formatResult.getAxisMap().get(ChartAxis.xAxis);
|
||||
var yAxis = formatResult.getAxisMap().get(ChartAxis.yAxis);
|
||||
var allFields = (List<ChartViewFieldDTO>) filterResult.getContext().get("allFields");
|
||||
ChartViewFieldDTO chartViewFieldDTO = yAxis.get(0);
|
||||
ChartFieldCompareDTO compareCalc = chartViewFieldDTO.getCompareCalc();
|
||||
boolean isYoy = org.apache.commons.lang3.StringUtils.isNotEmpty(compareCalc.getType())
|
||||
&& !org.apache.commons.lang3.StringUtils.equalsIgnoreCase(compareCalc.getType(), "none");
|
||||
if (isYoy) {
|
||||
xAxis.clear();
|
||||
// 设置维度字段,从同环比中获取用户选择的字段
|
||||
xAxis.addAll(allFields.stream().filter(i-> StringUtils.endsWithIgnoreCase(i.getId().toString(),yAxis.get(0).getCompareCalc().getField().toString())).toList());
|
||||
xAxis.get(0).setSort("desc");
|
||||
if(StringUtils.endsWithIgnoreCase("month_mom",compareCalc.getType())){
|
||||
xAxis.get(0).setDateStyle("y_M");
|
||||
}
|
||||
if(StringUtils.endsWithIgnoreCase("day_mom",compareCalc.getType())){
|
||||
xAxis.get(0).setDateStyle("y_M_d");
|
||||
}
|
||||
if(StringUtils.endsWithIgnoreCase("year_mom",compareCalc.getType())){
|
||||
xAxis.get(0).setDateStyle("y");
|
||||
}
|
||||
}
|
||||
Dimension2SQLObj.dimension2sqlObj(sqlMeta, xAxis, FieldUtil.transFields(allFields), crossDs, dsMap, Utils.getParams(FieldUtil.transFields(allFields)), view.getCalParams());
|
||||
Quota2SQLObj.quota2sqlObj(sqlMeta, yAxis, FieldUtil.transFields(allFields), crossDs, dsMap, Utils.getParams(FieldUtil.transFields(allFields)), view.getCalParams());
|
||||
String querySql = SQLProvider.createQuerySQL(sqlMeta, true, needOrder, view);
|
||||
querySql = provider.rebuildSQL(querySql, sqlMeta, crossDs, dsMap);
|
||||
datasourceRequest.setQuery(querySql);
|
||||
logger.debug("indicator chart sql: " + querySql);
|
||||
List<String[]> data = (List<String[]>) provider.fetchResultField(datasourceRequest).get("data");
|
||||
boolean isdrill = filterResult
|
||||
.getFilterList()
|
||||
.stream()
|
||||
.anyMatch(ele -> ele.getFilterType() == 1);
|
||||
quickCalc(xAxis, yAxis, data);
|
||||
Map<String, Object> result = ChartDataBuild.transNormalChartData(xAxis, yAxis, view, data, isdrill);
|
||||
T calcResult = (T) new ChartCalcDataResult();
|
||||
calcResult.setData(result);
|
||||
calcResult.setContext(filterResult.getContext());
|
||||
calcResult.setQuerySql(querySql);
|
||||
calcResult.setOriginData(data);
|
||||
return calcResult;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,43 @@
|
||||
package io.dataease.chart.dao.ext.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class ChartBasePO implements Serializable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 183064537525500481L;
|
||||
|
||||
private Long chartId;
|
||||
|
||||
private String chartType;
|
||||
|
||||
private String chartName;
|
||||
|
||||
private Long resourceId;
|
||||
|
||||
private String resourceType;
|
||||
|
||||
private String resourceName;
|
||||
|
||||
private Long tableId;
|
||||
|
||||
private String xAxis;
|
||||
|
||||
|
||||
private String xAxisExt;
|
||||
|
||||
|
||||
private String yAxis;
|
||||
|
||||
|
||||
private String yAxisExt;
|
||||
|
||||
|
||||
private String extStack;
|
||||
|
||||
|
||||
private String extBubble;
|
||||
}
|
@ -1,6 +1,7 @@
|
||||
package io.dataease.chart.dao.ext.mapper;
|
||||
|
||||
import io.dataease.api.chart.vo.ViewSelectorVO;
|
||||
import io.dataease.chart.dao.ext.entity.ChartBasePO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
@ -14,4 +15,25 @@ public interface ExtChartViewMapper {
|
||||
select id, scene_id as pid, title, type from core_chart_view where type != 'VQuery' and scene_id = #{resourceId}
|
||||
""")
|
||||
List<ViewSelectorVO> queryViewOption(@Param("resourceId") Long resourceId);
|
||||
|
||||
@Select("""
|
||||
select
|
||||
ccv.id as chart_id,
|
||||
ccv.title as chart_name,
|
||||
ccv.type as chart_type,
|
||||
ccv.table_id,
|
||||
dvi.id as resource_id,
|
||||
dvi.name as resource_name,
|
||||
dvi.type as resource_type,
|
||||
ccv.x_axis,
|
||||
ccv.x_axis_ext,
|
||||
ccv.y_axis,
|
||||
ccv.y_axis_ext,
|
||||
ccv.ext_stack,
|
||||
ccv.ext_bubble
|
||||
from core_chart_view ccv
|
||||
left join data_visualization_info dvi on dvi.id = ccv.scene_id
|
||||
where ccv.id = #{id}
|
||||
""")
|
||||
ChartBasePO queryChart(@Param("id") Long id);
|
||||
}
|
||||
|
@ -4,12 +4,15 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import io.dataease.api.chart.vo.ChartBaseVO;
|
||||
import io.dataease.api.chart.vo.ViewSelectorVO;
|
||||
import io.dataease.chart.dao.auto.entity.CoreChartView;
|
||||
import io.dataease.chart.dao.auto.mapper.CoreChartViewMapper;
|
||||
import io.dataease.chart.dao.ext.entity.ChartBasePO;
|
||||
import io.dataease.chart.dao.ext.mapper.ExtChartViewMapper;
|
||||
import io.dataease.dataset.dao.auto.entity.CoreDatasetTableField;
|
||||
import io.dataease.dataset.dao.auto.mapper.CoreDatasetTableFieldMapper;
|
||||
import io.dataease.dataset.manage.DatasetTableFieldManage;
|
||||
import io.dataease.dataset.manage.PermissionManage;
|
||||
import io.dataease.dataset.utils.TableUtils;
|
||||
import io.dataease.engine.constant.ExtFieldConstant;
|
||||
@ -57,6 +60,9 @@ public class ChartViewManege {
|
||||
@Resource
|
||||
private ExtChartViewMapper extChartViewMapper;
|
||||
|
||||
@Resource
|
||||
private DatasetTableFieldManage datasetTableFieldManage;
|
||||
|
||||
private ObjectMapper objectMapper = new ObjectMapper();
|
||||
|
||||
@Transactional
|
||||
@ -111,7 +117,14 @@ public class ChartViewManege {
|
||||
public List<ChartViewDTO> listBySceneId(Long sceneId) {
|
||||
QueryWrapper<CoreChartView> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("scene_id", sceneId);
|
||||
return transChart(coreChartViewMapper.selectList(wrapper));
|
||||
List<ChartViewDTO> chartViewDTOS = transChart(coreChartViewMapper.selectList(wrapper));
|
||||
for (ChartViewDTO dto : chartViewDTOS) {
|
||||
QueryWrapper<CoreDatasetTableField> wp = new QueryWrapper<>();
|
||||
wp.eq("dataset_group_id", dto.getTableId());
|
||||
List<CoreDatasetTableField> coreDatasetTableFields = coreDatasetTableFieldMapper.selectList(wp);
|
||||
dto.setCalParams(Utils.getParams(datasetTableFieldManage.transDTO(coreDatasetTableFields)));
|
||||
}
|
||||
return chartViewDTOS;
|
||||
}
|
||||
|
||||
public List<ChartViewDTO> transChart(List<CoreChartView> list) {
|
||||
@ -233,6 +246,19 @@ public class ChartViewManege {
|
||||
coreDatasetTableFieldMapper.delete(queryWrapper);
|
||||
}
|
||||
|
||||
public ChartBaseVO chartBaseInfo(Long id) {
|
||||
ChartBasePO po = extChartViewMapper.queryChart(id);
|
||||
ChartBaseVO vo = BeanUtils.copyBean(new ChartBaseVO(), po);
|
||||
TypeReference<List<ChartViewFieldDTO>> tokenType = new TypeReference<>() {};
|
||||
vo.setXAxis(JsonUtil.parseList(po.getXAxis(), tokenType));
|
||||
vo.setXAxisExt(JsonUtil.parseList(po.getXAxisExt(), tokenType));
|
||||
vo.setYAxis(JsonUtil.parseList(po.getYAxis(), tokenType));
|
||||
vo.setYAxisExt(JsonUtil.parseList(po.getYAxisExt(), tokenType));
|
||||
vo.setExtStack(JsonUtil.parseList(po.getExtStack(), tokenType));
|
||||
vo.setExtBubble(JsonUtil.parseList(po.getExtBubble(), tokenType));
|
||||
return vo;
|
||||
}
|
||||
|
||||
public DatasetTableFieldDTO createCountField(Long id) {
|
||||
DatasetTableFieldDTO dto = new DatasetTableFieldDTO();
|
||||
dto.setId(-1L);
|
||||
@ -258,7 +284,7 @@ public class ChartViewManege {
|
||||
dto.setDatePattern("date_sub");
|
||||
dto.setChartType("bar");
|
||||
|
||||
if (dto.getId() == -1L || dto.getDeType() == 0 || dto.getDeType() == 1) {
|
||||
if (dto.getId() == -1L || dto.getDeType() == 0 || dto.getDeType() == 1 || dto.getDeType() == 7) {
|
||||
dto.setSummary("count");
|
||||
} else {
|
||||
dto.setSummary("sum");
|
||||
|
@ -0,0 +1,94 @@
|
||||
package io.dataease.chart.manage;
|
||||
|
||||
import io.dataease.dataset.manage.DatasetTableFieldManage;
|
||||
import io.dataease.extensions.datasource.dto.DatasetTableFieldDTO;
|
||||
import io.dataease.extensions.view.filter.FilterTreeItem;
|
||||
import io.dataease.extensions.view.filter.FilterTreeObj;
|
||||
import io.dataease.utils.JsonUtil;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Component("chartViewThresholdManage")
|
||||
public class ChartViewThresholdManage {
|
||||
|
||||
@Resource
|
||||
private DatasetTableFieldManage datasetTableFieldManage;
|
||||
|
||||
public String convertThresholdRules(Long tableId, String thresholdRules) {
|
||||
List<DatasetTableFieldDTO> fieldList = datasetTableFieldManage.selectByDatasetGroupId(tableId);
|
||||
FilterTreeObj filterTreeObj = JsonUtil.parseObject(thresholdRules, FilterTreeObj.class);
|
||||
Map<String, DatasetTableFieldDTO> fieldMap = fieldList.stream().collect(Collectors.toMap(item -> item.getId().toString(), item -> item));
|
||||
return convertTree(filterTreeObj, fieldMap);
|
||||
}
|
||||
|
||||
private String convertTree(FilterTreeObj filterTreeObj, Map<String, DatasetTableFieldDTO> fieldMap) {
|
||||
String logic = filterTreeObj.getLogic();
|
||||
String logicText = translateLogic(logic);
|
||||
List<FilterTreeItem> items = filterTreeObj.getItems();
|
||||
|
||||
StringBuilder result = new StringBuilder();
|
||||
for (FilterTreeItem item : items) {
|
||||
String type = item.getType();
|
||||
if (StringUtils.equals("tree", type) && ObjectUtils.isNotEmpty(item.getSubTree())) {
|
||||
String childResult = convertTree(item.getSubTree(), fieldMap);
|
||||
result.append(childResult);
|
||||
} else {
|
||||
String itemResult = convertItem(item, fieldMap);
|
||||
result.append(itemResult);
|
||||
}
|
||||
result.append(logicText);
|
||||
}
|
||||
int lastIndex = -1;
|
||||
if ((!result.isEmpty()) && (lastIndex = result.lastIndexOf(logicText)) > 0) {
|
||||
return result.substring(0, lastIndex);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private String convertItem(FilterTreeItem item, Map<String, DatasetTableFieldDTO> fieldMap) {
|
||||
String filterType = item.getFilterType();
|
||||
Long fieldId = item.getFieldId();
|
||||
DatasetTableFieldDTO map = fieldMap.get(fieldId.toString());
|
||||
String fieldName = map.getName();
|
||||
if (StringUtils.equals(filterType, "enum")) {
|
||||
List<String> enumValue = item.getEnumValue();
|
||||
String enumValueText = String.join(",", enumValue);
|
||||
return fieldName + " 包括 " + "( " + enumValueText + " )";
|
||||
} else {
|
||||
return fieldName + " " + translateTerm(item.getTerm()) + " " + item.getValue();
|
||||
}
|
||||
}
|
||||
|
||||
private String translateTerm(String term) {
|
||||
return switch (term) {
|
||||
case "eq" -> "等于";
|
||||
case "not_eq" -> "不等于";
|
||||
case "lt" -> "小于";
|
||||
case "le" -> "小于等于";
|
||||
case "gt" -> "大于";
|
||||
case "ge" -> "大于等于";
|
||||
case "in" -> "包括";
|
||||
case "not in" -> "不包括";
|
||||
case "like" -> "包含";
|
||||
case "not like" -> "不包含";
|
||||
case "null" -> "为空";
|
||||
case "not null" -> "不为空";
|
||||
case "empty" -> "空字符串";
|
||||
case "not empty" -> "非字符串";
|
||||
case "between" -> "范围是";
|
||||
default -> " 等于 ";
|
||||
};
|
||||
}
|
||||
|
||||
private String translateLogic(String logic) {
|
||||
if (StringUtils.equals(logic, "and")) return " 且 ";
|
||||
return " 或 ";
|
||||
}
|
||||
}
|
@ -1,6 +1,7 @@
|
||||
package io.dataease.chart.server;
|
||||
|
||||
import io.dataease.api.chart.ChartViewApi;
|
||||
import io.dataease.api.chart.vo.ChartBaseVO;
|
||||
import io.dataease.extensions.view.dto.ChartViewDTO;
|
||||
import io.dataease.extensions.view.dto.ChartViewFieldDTO;
|
||||
import io.dataease.api.chart.vo.ViewSelectorVO;
|
||||
@ -72,4 +73,9 @@ public class ChartViewServer implements ChartViewApi {
|
||||
public void deleteFieldByChart(Long chartId) {
|
||||
chartViewManege.deleteFieldByChartId(chartId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ChartBaseVO chartBaseInfo(Long id) {
|
||||
return chartViewManege.chartBaseInfo(id);
|
||||
}
|
||||
}
|
||||
|
@ -1305,7 +1305,7 @@ public class ChartDataBuild {
|
||||
}
|
||||
if (i == ele.length) break;
|
||||
ChartViewFieldDTO chartViewFieldDTO = fields.get(i);
|
||||
if (chartViewFieldDTO.getDeType() == 0 || chartViewFieldDTO.getDeType() == 1 || chartViewFieldDTO.getDeType() == 5) {
|
||||
if (chartViewFieldDTO.getDeType() == 0 || chartViewFieldDTO.getDeType() == 1 || chartViewFieldDTO.getDeType() == 5 || chartViewFieldDTO.getDeType() == 7) {
|
||||
d.put(fields.get(i).getDataeaseName(), StringUtils.isEmpty(ele[i]) ? "" : ele[i]);
|
||||
} else if (chartViewFieldDTO.getDeType() == 2 || chartViewFieldDTO.getDeType() == 3 || chartViewFieldDTO.getDeType() == 4) {
|
||||
d.put(fields.get(i).getDataeaseName(), StringUtils.isEmpty(ele[i]) ? null : new BigDecimal(ele[i]).setScale(8, RoundingMode.HALF_UP));
|
||||
|
@ -1,7 +1,7 @@
|
||||
package io.dataease.config;
|
||||
|
||||
import com.fit2cloud.autoconfigure.QuartzAutoConfiguration;
|
||||
import io.dataease.commons.utils.CommonThreadPool;
|
||||
import io.dataease.utils.CommonThreadPool;
|
||||
import org.springframework.boot.autoconfigure.AutoConfigureBefore;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
@ -81,7 +81,7 @@ public class DatasetDataManage {
|
||||
|
||||
private static Logger logger = LoggerFactory.getLogger(DatasetDataManage.class);
|
||||
|
||||
private static final List<String> notFullDs = List.of("mysql", "mariadb", "Excel", "API");
|
||||
public static final List<String> notFullDs = List.of("mysql", "mariadb", "Excel", "API");
|
||||
|
||||
public List<DatasetTableFieldDTO> getTableFields(DatasetTableDTO datasetTableDTO) throws Exception {
|
||||
List<DatasetTableFieldDTO> list = null;
|
||||
|
@ -5,6 +5,7 @@ import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import io.dataease.api.dataset.union.DatasetGroupInfoDTO;
|
||||
import io.dataease.api.dataset.union.UnionDTO;
|
||||
import io.dataease.api.dataset.vo.DataSetBarVO;
|
||||
import io.dataease.api.permissions.relation.api.RelationApi;
|
||||
import io.dataease.commons.constants.OptConstants;
|
||||
import io.dataease.dataset.dao.auto.entity.CoreDatasetGroup;
|
||||
import io.dataease.dataset.dao.auto.entity.CoreDatasetTable;
|
||||
@ -35,6 +36,7 @@ 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.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@ -43,6 +45,8 @@ import java.util.concurrent.locks.Lock;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static io.dataease.result.ResultCode.DV_RESOURCE_UNCHECKED;
|
||||
|
||||
/**
|
||||
* @Author Junjun
|
||||
*/
|
||||
@ -75,6 +79,9 @@ public class DatasetGroupManage {
|
||||
@Resource
|
||||
private CoreOptRecentManage coreOptRecentManage;
|
||||
|
||||
@Autowired(required = false)
|
||||
private RelationApi relationManage;
|
||||
|
||||
private static final String leafType = "dataset";
|
||||
|
||||
private Lock lock = new ReentrantLock();
|
||||
@ -176,6 +183,21 @@ public class DatasetGroupManage {
|
||||
return datasetGroupInfoDTO;
|
||||
}
|
||||
|
||||
public boolean perDelete(Long id) {
|
||||
if (LicenseUtil.licenseValid()) {
|
||||
try {
|
||||
relationManage.checkAuth();
|
||||
} catch (Exception e) {
|
||||
return false;
|
||||
}
|
||||
Long count = relationManage.getDatasetResource(id);
|
||||
if (count > 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@XpackInteract(value = "authResourceTree", before = false)
|
||||
public void delete(Long id) {
|
||||
CoreDatasetGroup coreDatasetGroup = coreDatasetGroupMapper.selectById(id);
|
||||
@ -537,7 +559,7 @@ public class DatasetGroupManage {
|
||||
}
|
||||
}
|
||||
|
||||
private void geFullName(Long pid, List<String> fullName) {
|
||||
public void geFullName(Long pid, List<String> fullName) {
|
||||
CoreDatasetGroup parent = coreDatasetGroupMapper.selectById(pid);// 查找父级folder
|
||||
fullName.add(parent.getName());
|
||||
if (parent.getPid() != null && parent.getPid() != 0) {
|
||||
|
@ -1,12 +1,15 @@
|
||||
package io.dataease.dataset.server;
|
||||
|
||||
import io.dataease.api.dataset.DatasetTreeApi;
|
||||
import io.dataease.api.dataset.dto.DataSetExportRequest;
|
||||
import io.dataease.api.dataset.dto.DatasetNodeDTO;
|
||||
import io.dataease.api.dataset.union.DatasetGroupInfoDTO;
|
||||
import io.dataease.api.dataset.vo.DataSetBarVO;
|
||||
import io.dataease.constant.LogOT;
|
||||
import io.dataease.constant.LogST;
|
||||
import io.dataease.dataset.manage.DatasetGroupManage;
|
||||
import io.dataease.exportCenter.manage.ExportCenterManage;
|
||||
import io.dataease.exportCenter.server.ExportCenterServer;
|
||||
import io.dataease.extensions.datasource.dto.DatasetTableDTO;
|
||||
import io.dataease.extensions.view.dto.SqlVariableDetails;
|
||||
import io.dataease.log.DeLog;
|
||||
@ -23,6 +26,8 @@ import java.util.List;
|
||||
public class DatasetTreeServer implements DatasetTreeApi {
|
||||
@Resource
|
||||
private DatasetGroupManage datasetGroupManage;
|
||||
@Resource
|
||||
private ExportCenterManage exportCenterManage;
|
||||
|
||||
|
||||
@DeLog(id = "#p0.id", ot = LogOT.MODIFY, st = LogST.DATASET)
|
||||
@ -49,6 +54,11 @@ public class DatasetTreeServer implements DatasetTreeApi {
|
||||
return datasetGroupManage.move(dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean perDelete(Long id) {
|
||||
return datasetGroupManage.perDelete(id);
|
||||
}
|
||||
|
||||
@DeLog(id = "#p0", ot = LogOT.DELETE, st = LogST.DATASET)
|
||||
@Override
|
||||
public void delete(Long id) {
|
||||
@ -90,4 +100,9 @@ public class DatasetTreeServer implements DatasetTreeApi {
|
||||
return datasetGroupManage.getDetailWithPerm(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void exportDataset(DataSetExportRequest request) throws Exception {
|
||||
exportCenterManage.addTask(request.getId(), "dataset", request);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -87,7 +87,7 @@ public class DataSourceManage {
|
||||
public void checkName(DatasourceDTO dto) {
|
||||
QueryWrapper<CoreDatasource> wrapper = new QueryWrapper<>();
|
||||
if (ObjectUtils.isNotEmpty(dto.getPid())) {
|
||||
wrapper.eq("pid", dto.getPid());
|
||||
wrapper.eq("pid", dto.getPid().equals(0L) ? AuthUtils.getUser().getDefaultOid() : dto.getPid());
|
||||
}
|
||||
if (StringUtils.isNotEmpty(dto.getName())) {
|
||||
wrapper.eq("name", dto.getName());
|
||||
|
@ -1,7 +1,6 @@
|
||||
package io.dataease.datasource.provider;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import io.dataease.commons.utils.CommonThreadPool;
|
||||
import io.dataease.dataset.utils.FieldUtils;
|
||||
import io.dataease.datasource.dao.auto.entity.CoreDatasource;
|
||||
import io.dataease.datasource.dao.auto.entity.CoreDriver;
|
||||
@ -16,10 +15,7 @@ import io.dataease.extensions.datasource.provider.ExtendedJdbcClassLoader;
|
||||
import io.dataease.extensions.datasource.provider.Provider;
|
||||
import io.dataease.extensions.datasource.vo.DatasourceConfiguration;
|
||||
import io.dataease.i18n.Translator;
|
||||
import io.dataease.utils.BeanUtils;
|
||||
import io.dataease.utils.CommonBeanFactory;
|
||||
import io.dataease.utils.JsonUtil;
|
||||
import io.dataease.utils.LogUtil;
|
||||
import io.dataease.utils.*;
|
||||
import jakarta.annotation.PostConstruct;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.apache.calcite.adapter.jdbc.JdbcSchema;
|
||||
|
@ -13,8 +13,8 @@ import io.dataease.api.ds.vo.ApiDefinition;
|
||||
import io.dataease.api.ds.vo.CoreDatasourceTaskLogDTO;
|
||||
import io.dataease.api.ds.vo.ExcelFileData;
|
||||
import io.dataease.api.ds.vo.ExcelSheetData;
|
||||
import io.dataease.api.permissions.relation.api.RelationApi;
|
||||
import io.dataease.commons.constants.TaskStatus;
|
||||
import io.dataease.commons.utils.CommonThreadPool;
|
||||
import io.dataease.constant.LogOT;
|
||||
import io.dataease.constant.LogST;
|
||||
import io.dataease.dataset.manage.DatasetDataManage;
|
||||
@ -70,6 +70,7 @@ import java.util.stream.Collectors;
|
||||
|
||||
import static io.dataease.datasource.server.DatasourceTaskServer.ScheduleType.MANUAL;
|
||||
import static io.dataease.datasource.server.DatasourceTaskServer.ScheduleType.RIGHTNOW;
|
||||
import static io.dataease.result.ResultCode.DS_RESOURCE_UNCHECKED;
|
||||
|
||||
|
||||
@RestController
|
||||
@ -107,6 +108,8 @@ public class DatasourceServer implements DatasourceApi {
|
||||
|
||||
@Autowired(required = false)
|
||||
private PluginManageApi pluginManage;
|
||||
@Autowired(required = false)
|
||||
private RelationApi relationManage;
|
||||
|
||||
@Override
|
||||
public List<DatasourceDTO> query(String keyWord) {
|
||||
@ -628,6 +631,22 @@ public class DatasourceServer implements DatasourceApi {
|
||||
return datasourceDTO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean perDelete(Long id) {
|
||||
if (LicenseUtil.licenseValid()) {
|
||||
try {
|
||||
relationManage.checkAuth();
|
||||
} catch (Exception e) {
|
||||
return false;
|
||||
}
|
||||
Long count = relationManage.getDsResource(id);
|
||||
if (count > 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@DeLog(id = "#p0", ot = LogOT.DELETE, st = LogST.DATASOURCE)
|
||||
@Override
|
||||
|
@ -94,4 +94,6 @@ public class SQLConstants {
|
||||
public static final String QUARTER = "QUARTER(%s)";
|
||||
|
||||
public static final String EMPTY_SIGN = "_empty_$";
|
||||
|
||||
public static final String CONCAT = "CONCAT(%s, %s)";
|
||||
}
|
||||
|
@ -104,6 +104,14 @@ public class CustomWhere2Str {
|
||||
whereName = String.format(SQLConstants.FROM_UNIXTIME, cast, SQLConstants.DEFAULT_DATE_FORMAT);
|
||||
}
|
||||
if (field.getDeExtractType() == 1) {
|
||||
// 如果都是时间类型,把date和time类型进行字符串拼接
|
||||
if (isCross) {
|
||||
if (StringUtils.equalsIgnoreCase(field.getType(), "date")) {
|
||||
originName = String.format(SQLConstants.DE_STR_TO_DATE, String.format(SQLConstants.CONCAT, originName, "' 00:00:00'"), SQLConstants.DEFAULT_DATE_FORMAT);
|
||||
} else if (StringUtils.equalsIgnoreCase(field.getType(), "time")) {
|
||||
originName = String.format(SQLConstants.DE_STR_TO_DATE, String.format(SQLConstants.CONCAT, "'1970-01-01 '", originName), SQLConstants.DEFAULT_DATE_FORMAT);
|
||||
}
|
||||
}
|
||||
// 此处获取标准格式的日期
|
||||
whereName = originName;
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ public class Dimension2SQLObj {
|
||||
}
|
||||
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
|
||||
// 处理横轴字段
|
||||
xFields.add(getXFields(x, originField, fieldAlias));
|
||||
xFields.add(getXFields(x, originField, fieldAlias, isCross));
|
||||
|
||||
// 处理横轴排序
|
||||
if (StringUtils.isNotEmpty(x.getSort()) && Utils.joinSort(x.getSort())) {
|
||||
@ -69,12 +69,20 @@ public class Dimension2SQLObj {
|
||||
meta.setXFieldsDialect(fieldsDialect);
|
||||
}
|
||||
|
||||
public static SQLObj getXFields(ChartViewFieldDTO x, String originField, String fieldAlias) {
|
||||
public static SQLObj getXFields(ChartViewFieldDTO x, String originField, String fieldAlias, boolean isCross) {
|
||||
String fieldName = "";
|
||||
if (Objects.equals(x.getDeExtractType(), DeTypeConstants.DE_TIME)) {
|
||||
if (Objects.equals(x.getDeType(), DeTypeConstants.DE_INT) || Objects.equals(x.getDeType(), DeTypeConstants.DE_FLOAT)) {
|
||||
fieldName = String.format(SQLConstants.UNIX_TIMESTAMP, originField);
|
||||
} else if (Objects.equals(x.getDeType(), DeTypeConstants.DE_TIME)) {
|
||||
// 如果都是时间类型,把date和time类型进行字符串拼接
|
||||
if (isCross) {
|
||||
if (StringUtils.equalsIgnoreCase(x.getType(), "date")) {
|
||||
originField = String.format(SQLConstants.DE_STR_TO_DATE, String.format(SQLConstants.CONCAT, originField, "' 00:00:00'"), SQLConstants.DEFAULT_DATE_FORMAT);
|
||||
} else if (StringUtils.equalsIgnoreCase(x.getType(), "time")) {
|
||||
originField = String.format(SQLConstants.DE_STR_TO_DATE, String.format(SQLConstants.CONCAT, "'1970-01-01 '", originField), SQLConstants.DEFAULT_DATE_FORMAT);
|
||||
}
|
||||
}
|
||||
String format = Utils.transDateFormat(x.getDateStyle(), x.getDatePattern());
|
||||
if (StringUtils.equalsIgnoreCase(x.getDateStyle(), "y_Q")) {
|
||||
fieldName = String.format(format,
|
||||
|
@ -76,6 +76,14 @@ public class ExtWhere2Str {
|
||||
whereName = String.format(SQLConstants.UNIX_TIMESTAMP, whereName);
|
||||
}
|
||||
if (field.getDeExtractType() == 1) {
|
||||
// 如果都是时间类型,把date和time类型进行字符串拼接
|
||||
if (isCross) {
|
||||
if (StringUtils.equalsIgnoreCase(field.getType(), "date")) {
|
||||
originName = String.format(SQLConstants.DE_STR_TO_DATE, String.format(SQLConstants.CONCAT, originName, "' 00:00:00'"), SQLConstants.DEFAULT_DATE_FORMAT);
|
||||
} else if (StringUtils.equalsIgnoreCase(field.getType(), "time")) {
|
||||
originName = String.format(SQLConstants.DE_STR_TO_DATE, String.format(SQLConstants.CONCAT, "'1970-01-01 '", originName), SQLConstants.DEFAULT_DATE_FORMAT);
|
||||
}
|
||||
}
|
||||
// 此处获取标准格式的日期
|
||||
whereName = originName;
|
||||
}
|
||||
|
@ -56,14 +56,14 @@ public class Field2SQLObj {
|
||||
}
|
||||
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
|
||||
// 处理横轴字段
|
||||
xFields.add(getXFields(x, originField, fieldAlias));
|
||||
xFields.add(getXFields(x, originField, fieldAlias, isCross));
|
||||
}
|
||||
}
|
||||
meta.setXFields(xFields);
|
||||
meta.setXFieldsDialect(fieldsDialect);
|
||||
}
|
||||
|
||||
public static SQLObj getXFields(DatasetTableFieldDTO f, String originField, String fieldAlias) {
|
||||
public static SQLObj getXFields(DatasetTableFieldDTO f, String originField, String fieldAlias, boolean isCross) {
|
||||
String fieldName = "";
|
||||
if (originField != null) {
|
||||
// 处理横轴字段
|
||||
@ -71,6 +71,14 @@ public class Field2SQLObj {
|
||||
if (Objects.equals(f.getDeType(), DeTypeConstants.DE_INT) || Objects.equals(f.getDeType(), DeTypeConstants.DE_FLOAT)) {
|
||||
fieldName = String.format(SQLConstants.UNIX_TIMESTAMP, originField);
|
||||
} else {
|
||||
// 如果都是时间类型,把date和time类型进行字符串拼接
|
||||
if (isCross) {
|
||||
if (StringUtils.equalsIgnoreCase(f.getType(), "date")) {
|
||||
originField = String.format(SQLConstants.DE_STR_TO_DATE, String.format(SQLConstants.CONCAT, originField, "' 00:00:00'"), SQLConstants.DEFAULT_DATE_FORMAT);
|
||||
} else if (StringUtils.equalsIgnoreCase(f.getType(), "time")) {
|
||||
originField = String.format(SQLConstants.DE_STR_TO_DATE, String.format(SQLConstants.CONCAT, "'1970-01-01 '", originField), SQLConstants.DEFAULT_DATE_FORMAT);
|
||||
}
|
||||
}
|
||||
fieldName = originField;
|
||||
}
|
||||
} else if (Objects.equals(f.getDeExtractType(), DeTypeConstants.DE_STRING)) {
|
||||
|
@ -1,13 +1,13 @@
|
||||
package io.dataease.engine.trans;
|
||||
|
||||
import io.dataease.api.chart.dto.DeSortField;
|
||||
import io.dataease.extensions.datasource.dto.CalParam;
|
||||
import io.dataease.extensions.datasource.dto.DatasourceSchemaDTO;
|
||||
import io.dataease.extensions.datasource.dto.DatasetTableFieldDTO;
|
||||
import io.dataease.engine.constant.DeTypeConstants;
|
||||
import io.dataease.engine.constant.ExtFieldConstant;
|
||||
import io.dataease.engine.constant.SQLConstants;
|
||||
import io.dataease.engine.utils.Utils;
|
||||
import io.dataease.extensions.datasource.dto.CalParam;
|
||||
import io.dataease.extensions.datasource.dto.DatasetTableFieldDTO;
|
||||
import io.dataease.extensions.datasource.dto.DatasourceSchemaDTO;
|
||||
import io.dataease.extensions.datasource.model.SQLMeta;
|
||||
import io.dataease.extensions.datasource.model.SQLObj;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
@ -58,6 +58,14 @@ public class Order2SQLObj {
|
||||
if (Objects.equals(f.getDeType(), DeTypeConstants.DE_INT) || Objects.equals(f.getDeType(), DeTypeConstants.DE_FLOAT)) {
|
||||
fieldName = String.format(SQLConstants.UNIX_TIMESTAMP, originField);
|
||||
} else {
|
||||
// 如果都是时间类型,把date和time类型进行字符串拼接
|
||||
if (isCross) {
|
||||
if (StringUtils.equalsIgnoreCase(f.getType(), "date")) {
|
||||
originField = String.format(SQLConstants.DE_STR_TO_DATE, String.format(SQLConstants.CONCAT, originField, "' 00:00:00'"), SQLConstants.DEFAULT_DATE_FORMAT);
|
||||
} else if (StringUtils.equalsIgnoreCase(f.getType(), "time")) {
|
||||
originField = String.format(SQLConstants.DE_STR_TO_DATE, String.format(SQLConstants.CONCAT, "'1970-01-01 '", originField), SQLConstants.DEFAULT_DATE_FORMAT);
|
||||
}
|
||||
}
|
||||
fieldName = originField;
|
||||
}
|
||||
} else if (Objects.equals(f.getDeExtractType(), DeTypeConstants.DE_STRING)) {
|
||||
|
@ -54,7 +54,7 @@ public class Quota2SQLObj {
|
||||
// 处理纵轴字段
|
||||
SQLObj ySQLObj = getYFields(y, originField, fieldAlias);
|
||||
if (StringUtils.equalsIgnoreCase("bar-range", meta.getChartType()) && StringUtils.equalsIgnoreCase(y.getGroupType(), "d") && y.getDeType() == 1) {
|
||||
yFields.add(Dimension2SQLObj.getXFields(y, ySQLObj.getFieldName(), fieldAlias));
|
||||
yFields.add(Dimension2SQLObj.getXFields(y, ySQLObj.getFieldName(), fieldAlias, isCross));
|
||||
} else {
|
||||
yFields.add(ySQLObj);
|
||||
}
|
||||
|
@ -107,6 +107,14 @@ public class WhereTree2Str {
|
||||
whereName = String.format(SQLConstants.FROM_UNIXTIME, cast, SQLConstants.DEFAULT_DATE_FORMAT);
|
||||
}
|
||||
if (field.getDeExtractType() == 1) {
|
||||
// 如果都是时间类型,把date和time类型进行字符串拼接
|
||||
if (isCross) {
|
||||
if (StringUtils.equalsIgnoreCase(field.getType(), "date")) {
|
||||
originName = String.format(SQLConstants.DE_STR_TO_DATE, String.format(SQLConstants.CONCAT, originName, "' 00:00:00'"), SQLConstants.DEFAULT_DATE_FORMAT);
|
||||
} else if (StringUtils.equalsIgnoreCase(field.getType(), "time")) {
|
||||
originName = String.format(SQLConstants.DE_STR_TO_DATE, String.format(SQLConstants.CONCAT, "'1970-01-01 '", originName), SQLConstants.DEFAULT_DATE_FORMAT);
|
||||
}
|
||||
}
|
||||
whereName = originName;
|
||||
}
|
||||
} else if (field.getDeType() == 2 || field.getDeType() == 3) {
|
||||
|
@ -2,17 +2,42 @@ package io.dataease.exportCenter.manage;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import io.dataease.api.chart.dto.ViewDetailField;
|
||||
import io.dataease.api.chart.request.ChartExcelRequest;
|
||||
import io.dataease.api.chart.request.ChartExcelRequestInner;
|
||||
import io.dataease.api.exportCenter.vo.ExportTaskDTO;
|
||||
import io.dataease.api.dataset.dto.DataSetExportRequest;
|
||||
import io.dataease.api.dataset.union.DatasetGroupInfoDTO;
|
||||
import io.dataease.api.dataset.union.UnionDTO;
|
||||
import io.dataease.model.ExportTaskDTO;
|
||||
import io.dataease.api.permissions.dataset.dto.DataSetRowPermissionsTreeDTO;
|
||||
import io.dataease.auth.bo.TokenUserBO;
|
||||
import io.dataease.chart.dao.auto.mapper.CoreChartViewMapper;
|
||||
import io.dataease.chart.server.ChartDataServer;
|
||||
import io.dataease.dataset.dao.auto.entity.CoreDatasetGroup;
|
||||
import io.dataease.dataset.dao.auto.mapper.CoreDatasetGroupMapper;
|
||||
import io.dataease.dataset.manage.*;
|
||||
import io.dataease.datasource.utils.DatasourceUtils;
|
||||
import io.dataease.engine.constant.DeTypeConstants;
|
||||
import io.dataease.engine.sql.SQLProvider;
|
||||
import io.dataease.engine.trans.Field2SQLObj;
|
||||
import io.dataease.engine.trans.Order2SQLObj;
|
||||
import io.dataease.engine.trans.Table2SQLObj;
|
||||
import io.dataease.engine.trans.WhereTree2Str;
|
||||
import io.dataease.engine.utils.Utils;
|
||||
import io.dataease.exception.DEException;
|
||||
import io.dataease.exportCenter.dao.auto.entity.CoreExportTask;
|
||||
import io.dataease.exportCenter.dao.auto.mapper.CoreExportTaskMapper;
|
||||
import io.dataease.extensions.datasource.dto.DatasetTableFieldDTO;
|
||||
import io.dataease.extensions.datasource.dto.DatasourceRequest;
|
||||
import io.dataease.extensions.datasource.dto.DatasourceSchemaDTO;
|
||||
import io.dataease.extensions.datasource.factory.ProviderFactory;
|
||||
import io.dataease.extensions.datasource.model.SQLMeta;
|
||||
import io.dataease.extensions.datasource.provider.Provider;
|
||||
import io.dataease.extensions.view.dto.ColumnPermissionItem;
|
||||
import io.dataease.i18n.Translator;
|
||||
import io.dataease.license.config.XpackInteract;
|
||||
import io.dataease.system.manage.CoreUserManage;
|
||||
import io.dataease.system.manage.SysParameterManage;
|
||||
import io.dataease.utils.*;
|
||||
import io.dataease.visualization.server.DataVisualizationServer;
|
||||
@ -22,6 +47,7 @@ import jakarta.annotation.PostConstruct;
|
||||
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.StringUtils;
|
||||
import org.apache.poi.ss.usermodel.*;
|
||||
import org.apache.poi.xssf.streaming.SXSSFWorkbook;
|
||||
@ -33,10 +59,12 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.io.*;
|
||||
import java.net.InetAddress;
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.Future;
|
||||
import java.util.concurrent.ScheduledThreadPoolExecutor;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Component
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@ -44,6 +72,8 @@ public class ExportCenterManage {
|
||||
@Resource
|
||||
private CoreExportTaskMapper exportTaskMapper;
|
||||
@Resource
|
||||
private DatasetGroupManage datasetGroupManage;
|
||||
@Resource
|
||||
DataVisualizationServer dataVisualizationServer;
|
||||
@Resource
|
||||
private CoreChartViewMapper coreChartViewMapper;
|
||||
@ -68,6 +98,18 @@ public class ExportCenterManage {
|
||||
private Map<String, Future> Running_Task = new HashMap<>();
|
||||
@Resource
|
||||
private ChartDataServer chartDataServer;
|
||||
@Resource
|
||||
private CoreDatasetGroupMapper coreDatasetGroupMapper;
|
||||
@Resource
|
||||
private CoreUserManage coreUserManage;
|
||||
@Resource
|
||||
private DatasetSQLManage datasetSQLManage;
|
||||
@Resource
|
||||
private PermissionManage permissionManage;
|
||||
@Resource
|
||||
private DatasetTableFieldManage datasetTableFieldManage;
|
||||
@Resource
|
||||
private DatasetDataManage datasetDataManage;
|
||||
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
@ -158,7 +200,7 @@ public class ExportCenterManage {
|
||||
|
||||
public void retry(String id) {
|
||||
CoreExportTask exportTask = exportTaskMapper.selectById(id);
|
||||
if(!exportTask.getExportStatus().equalsIgnoreCase("FAILED")){
|
||||
if (!exportTask.getExportStatus().equalsIgnoreCase("FAILED")) {
|
||||
DEException.throwException("正在导出中!");
|
||||
}
|
||||
exportTask.setExportStatus("PENDING");
|
||||
@ -198,7 +240,8 @@ public class ExportCenterManage {
|
||||
}
|
||||
|
||||
@XpackInteract(value = "exportCenter", before = false)
|
||||
public void setOrg(ExportTaskDTO exportTaskDTO) {}
|
||||
public void setOrg(ExportTaskDTO exportTaskDTO) {
|
||||
}
|
||||
|
||||
private ExportCenterManage proxy() {
|
||||
return CommonBeanFactory.getBean(ExportCenterManage.class);
|
||||
@ -208,6 +251,13 @@ public class ExportCenterManage {
|
||||
if (exportTaskDTO.getExportFromType().equalsIgnoreCase("chart")) {
|
||||
exportTaskDTO.setExportFromName(dataVisualizationServer.getAbsPath(exportTaskDTO.getExportFrom()));
|
||||
}
|
||||
if (exportTaskDTO.getExportFromType().equalsIgnoreCase("dataset")) {
|
||||
List<String> fullName = new ArrayList<>();
|
||||
datasetGroupManage.geFullName(Long.valueOf(exportTaskDTO.getExportFrom()), fullName);
|
||||
Collections.reverse(fullName);
|
||||
List<String> finalFullName = fullName;
|
||||
exportTaskDTO.setExportFromName(String.join("/", finalFullName));
|
||||
}
|
||||
}
|
||||
|
||||
private void setExportFromName(ExportTaskDTO exportTaskDTO) {
|
||||
@ -243,6 +293,216 @@ public class ExportCenterManage {
|
||||
startViewTask(exportTask, request);
|
||||
}
|
||||
|
||||
public void addTask(Long exportFrom, String exportFromType, DataSetExportRequest request) {
|
||||
CoreExportTask exportTask = new CoreExportTask();
|
||||
exportTask.setId(UUID.randomUUID().toString());
|
||||
exportTask.setUserId(AuthUtils.getUser().getUserId());
|
||||
exportTask.setExportFrom(String.valueOf(exportFrom));
|
||||
exportTask.setExportFromType(exportFromType);
|
||||
exportTask.setExportStatus("PENDING");
|
||||
exportTask.setFileName(request.getFilename() + ".xlsx");
|
||||
exportTask.setExportProgress("0");
|
||||
exportTask.setExportTime(System.currentTimeMillis());
|
||||
exportTask.setParams(JsonUtil.toJSONString(request).toString());
|
||||
exportTask.setExportMachineName(hostName());
|
||||
exportTaskMapper.insert(exportTask);
|
||||
startDatasetTask(exportTask, request);
|
||||
}
|
||||
|
||||
private void startDatasetTask(CoreExportTask exportTask, DataSetExportRequest request) {
|
||||
String dataPath = exportData_path + exportTask.getId();
|
||||
File directory = new File(dataPath);
|
||||
boolean isCreated = directory.mkdir();
|
||||
|
||||
TokenUserBO tokenUserBO = AuthUtils.getUser();
|
||||
Future future = scheduledThreadPoolExecutor.submit(() -> {
|
||||
AuthUtils.setUser(tokenUserBO);
|
||||
try {
|
||||
exportTask.setExportStatus("IN_PROGRESS");
|
||||
exportTaskMapper.updateById(exportTask);
|
||||
CoreDatasetGroup coreDatasetGroup = coreDatasetGroupMapper.selectById(exportTask.getExportFrom());
|
||||
if (coreDatasetGroup == null) {
|
||||
throw new Exception("Not found dataset group: " + exportTask.getExportFrom());
|
||||
}
|
||||
DatasetGroupInfoDTO dto = new DatasetGroupInfoDTO();
|
||||
BeanUtils.copyBean(dto, coreDatasetGroup);
|
||||
dto.setUnionSql(null);
|
||||
List<UnionDTO> unionDTOList = JsonUtil.parseList(coreDatasetGroup.getInfo(), new TypeReference<>() {
|
||||
});
|
||||
dto.setUnion(unionDTOList);
|
||||
List<DatasetTableFieldDTO> dsFields = datasetTableFieldManage.selectByDatasetGroupId(Long.valueOf(exportTask.getExportFrom()));
|
||||
List<DatasetTableFieldDTO> allFields = dsFields.stream().map(ele -> {
|
||||
DatasetTableFieldDTO datasetTableFieldDTO = new DatasetTableFieldDTO();
|
||||
BeanUtils.copyBean(datasetTableFieldDTO, ele);
|
||||
datasetTableFieldDTO.setFieldShortName(ele.getDataeaseName());
|
||||
return datasetTableFieldDTO;
|
||||
}).collect(Collectors.toList());
|
||||
dto.setAllFields(allFields);
|
||||
Map<String, Object> sqlMap = datasetSQLManage.getUnionSQLForEdit(dto, null);
|
||||
String sql = (String) sqlMap.get("sql");
|
||||
if (ObjectUtils.isEmpty(allFields)) {
|
||||
DEException.throwException(Translator.get("i18n_no_fields"));
|
||||
}
|
||||
Map<String, ColumnPermissionItem> desensitizationList = new HashMap<>();
|
||||
allFields = permissionManage.filterColumnPermissions(allFields, desensitizationList, dto.getId(), null);
|
||||
if (ObjectUtils.isEmpty(allFields)) {
|
||||
DEException.throwException(Translator.get("i18n_no_column_permission"));
|
||||
}
|
||||
datasetDataManage.buildFieldName(sqlMap, allFields);
|
||||
Map<Long, DatasourceSchemaDTO> dsMap = (Map<Long, DatasourceSchemaDTO>) sqlMap.get("dsMap");
|
||||
DatasourceUtils.checkDsStatus(dsMap);
|
||||
List<String> dsList = new ArrayList<>();
|
||||
for (Map.Entry<Long, DatasourceSchemaDTO> next : dsMap.entrySet()) {
|
||||
dsList.add(next.getValue().getType());
|
||||
}
|
||||
boolean needOrder = Utils.isNeedOrder(dsList);
|
||||
boolean crossDs = Utils.isCrossDs(dsMap);
|
||||
if (!crossDs) {
|
||||
if (datasetDataManage.notFullDs.contains(dsMap.entrySet().iterator().next().getValue().getType()) && (boolean) sqlMap.get("isFullJoin")) {
|
||||
DEException.throwException(Translator.get("i18n_not_full"));
|
||||
}
|
||||
sql = Utils.replaceSchemaAlias(sql, dsMap);
|
||||
}
|
||||
|
||||
List<DataSetRowPermissionsTreeDTO> rowPermissionsTree = new ArrayList<>();
|
||||
TokenUserBO user = AuthUtils.getUser();
|
||||
if (user != null) {
|
||||
rowPermissionsTree = permissionManage.getRowPermissionsTree(dto.getId(), user.getUserId());
|
||||
}
|
||||
|
||||
Provider provider;
|
||||
if (crossDs) {
|
||||
provider = ProviderFactory.getDefaultProvider();
|
||||
} else {
|
||||
provider = ProviderFactory.getProvider(dsList.getFirst());
|
||||
}
|
||||
SQLMeta sqlMeta = new SQLMeta();
|
||||
Table2SQLObj.table2sqlobj(sqlMeta, null, "(" + sql + ")", crossDs);
|
||||
Field2SQLObj.field2sqlObj(sqlMeta, allFields, allFields, crossDs, dsMap, Utils.getParams(allFields), null);
|
||||
WhereTree2Str.transFilterTrees(sqlMeta, rowPermissionsTree, allFields, crossDs, dsMap, Utils.getParams(allFields), null);
|
||||
Order2SQLObj.getOrders(sqlMeta, dto.getSortFields(), allFields, crossDs, dsMap, Utils.getParams(allFields), null);
|
||||
String replaceSql = provider.rebuildSQL(SQLProvider.createQuerySQL(sqlMeta, false, false, false), sqlMeta, crossDs, dsMap);
|
||||
Long totalCount = datasetDataManage.getDatasetTotal(dto, replaceSql, null);
|
||||
totalCount = totalCount > limit ? limit : totalCount;
|
||||
Long totalPage = (totalCount / extractPageSize) + (totalCount % extractPageSize > 0 ? 1 : 0);
|
||||
|
||||
|
||||
Workbook wb = new SXSSFWorkbook();
|
||||
FileOutputStream fileOutputStream = new FileOutputStream(dataPath + "/" + request.getFilename() + ".xlsx");
|
||||
Sheet detailsSheet = wb.createSheet("数据");
|
||||
|
||||
for (Integer p = 0; p < totalPage; p++) {
|
||||
String querySQL = SQLProvider.createQuerySQLWithLimit(sqlMeta, false, needOrder, false, p * extractPageSize, p * extractPageSize + extractPageSize);
|
||||
querySQL = provider.rebuildSQL(querySQL, sqlMeta, crossDs, dsMap);
|
||||
DatasourceRequest datasourceRequest = new DatasourceRequest();
|
||||
datasourceRequest.setQuery(querySQL);
|
||||
datasourceRequest.setDsList(dsMap);
|
||||
Map<String, Object> previewData = datasetDataManage.buildPreviewData(provider.fetchResultField(datasourceRequest), allFields, desensitizationList);
|
||||
List<Map<String, Object>> data = (List<Map<String, Object>>) previewData.get("data");
|
||||
if (p == 1L) {
|
||||
CellStyle cellStyle = wb.createCellStyle();
|
||||
Font font = wb.createFont();
|
||||
font.setFontHeightInPoints((short) 12);
|
||||
font.setBold(true);
|
||||
cellStyle.setFont(font);
|
||||
cellStyle.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.getIndex());
|
||||
cellStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND);
|
||||
List<String> header = new ArrayList<>();
|
||||
for (DatasetTableFieldDTO field : allFields) {
|
||||
header.add(field.getName());
|
||||
}
|
||||
List<List<String>> details = new ArrayList<>();
|
||||
details.add(header);
|
||||
for (Map<String, Object> obj : data) {
|
||||
List<String> row = new ArrayList<>();
|
||||
for (DatasetTableFieldDTO field : allFields) {
|
||||
String string = (String) obj.get(field.getDataeaseName());
|
||||
row.add(string);
|
||||
}
|
||||
details.add(row);
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(details)) {
|
||||
for (int i = 0; i < details.size(); i++) {
|
||||
Row row = detailsSheet.createRow(i);
|
||||
List<String> rowData = details.get(i);
|
||||
if (rowData != null) {
|
||||
for (int j = 0; j < rowData.size(); j++) {
|
||||
Cell cell = row.createCell(j);
|
||||
if (i == 0) {
|
||||
cell.setCellValue(rowData.get(j));
|
||||
cell.setCellStyle(cellStyle);
|
||||
detailsSheet.setColumnWidth(j, 255 * 20);
|
||||
} else {
|
||||
if ((allFields.get(j).getDeType().equals(DeTypeConstants.DE_INT) || allFields.get(j).getDeType() == DeTypeConstants.DE_FLOAT) && StringUtils.isNotEmpty(rowData.get(j))) {
|
||||
try {
|
||||
cell.setCellValue(Double.valueOf(rowData.get(j)));
|
||||
} catch (Exception e) {
|
||||
LogUtil.warn("export excel data transform error");
|
||||
}
|
||||
} else {
|
||||
cell.setCellValue(rowData.get(j));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
List<List<String>> details = new ArrayList<>();
|
||||
for (Map<String, Object> obj : data) {
|
||||
List<String> row = new ArrayList<>();
|
||||
for (DatasetTableFieldDTO field : allFields) {
|
||||
String string = (String) obj.get(field.getDataeaseName());
|
||||
row.add(string);
|
||||
}
|
||||
details.add(row);
|
||||
}
|
||||
int lastNum = detailsSheet.getLastRowNum();
|
||||
for (int i = 0; i < details.size(); i++) {
|
||||
Row row = detailsSheet.createRow(i + lastNum + 1);
|
||||
List<String> rowData = details.get(i);
|
||||
if (rowData != null) {
|
||||
for (int j = 0; j < rowData.size(); j++) {
|
||||
Cell cell = row.createCell(j);
|
||||
if ((allFields.get(j).getDeType().equals(DeTypeConstants.DE_INT) || allFields.get(j).getDeType() == DeTypeConstants.DE_FLOAT) && StringUtils.isNotEmpty(rowData.get(j))) {
|
||||
try {
|
||||
cell.setCellValue(Double.valueOf(rowData.get(j)));
|
||||
} catch (Exception e) {
|
||||
LogUtil.warn("export excel data transform error");
|
||||
}
|
||||
} else {
|
||||
cell.setCellValue(rowData.get(j));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
exportTask.setExportStatus("IN_PROGRESS");
|
||||
double exportRogress = (double) ((double) p / (double) totalPage);
|
||||
DecimalFormat df = new DecimalFormat("#.##");
|
||||
String formattedResult = df.format(exportRogress * 100);
|
||||
exportTask.setExportProgress(formattedResult);
|
||||
exportTaskMapper.updateById(exportTask);
|
||||
}
|
||||
wb.write(fileOutputStream);
|
||||
fileOutputStream.flush();
|
||||
fileOutputStream.close();
|
||||
wb.close();
|
||||
exportTask.setExportProgress("100");
|
||||
exportTask.setExportStatus("SUCCESS");
|
||||
setFileSize(dataPath + "/" + request.getFilename() + ".xlsx", exportTask);
|
||||
|
||||
} catch (Exception e) {
|
||||
LogUtil.error("Failed to export data", e);
|
||||
exportTask.setMsg(e.getMessage());
|
||||
exportTask.setExportStatus("FAILED");
|
||||
} finally {
|
||||
exportTaskMapper.updateById(exportTask);
|
||||
}
|
||||
});
|
||||
Running_Task.put(exportTask.getId(), future);
|
||||
}
|
||||
|
||||
private void startViewTask(CoreExportTask exportTask, ChartExcelRequest request) {
|
||||
String dataPath = exportData_path + exportTask.getId();
|
||||
File directory = new File(dataPath);
|
||||
|
@ -1,7 +1,7 @@
|
||||
package io.dataease.exportCenter.server;
|
||||
|
||||
import io.dataease.api.exportCenter.ExportCenterApi;
|
||||
import io.dataease.api.exportCenter.vo.ExportTaskDTO;
|
||||
import io.dataease.model.ExportTaskDTO;
|
||||
import io.dataease.exportCenter.manage.ExportCenterManage;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
@ -22,6 +22,8 @@ public class DeTaskExecutor {
|
||||
private static final String RETRY_JOB_GROUP = "RETRY_REPORT_TASK";
|
||||
private static final String TEMP_JOB_GROUP = "TEMP_REPORT_TASK";
|
||||
|
||||
private static final String THRESHOLD_JOB_GROUP = "THRESHOLD_TASK";
|
||||
|
||||
@Resource
|
||||
private ScheduleManager scheduleManager;
|
||||
|
||||
@ -34,6 +36,20 @@ public class DeTaskExecutor {
|
||||
public void init() {
|
||||
}
|
||||
|
||||
public void addThresholdTask(Long taskId, String cron, Long startTime, Long endTime) {
|
||||
String key = taskId.toString();
|
||||
JobKey jobKey = new JobKey(key, THRESHOLD_JOB_GROUP);
|
||||
TriggerKey triggerKey = new TriggerKey(key, THRESHOLD_JOB_GROUP);
|
||||
JobDataMap jobDataMap = new JobDataMap();
|
||||
jobDataMap.put("taskId", taskId);
|
||||
jobDataMap.put("threshold", taskId);
|
||||
Date end = null;
|
||||
if (ObjectUtils.isNotEmpty(endTime)) end = new Date(endTime);
|
||||
Date startDate = new Date();
|
||||
if (ObjectUtils.isNotEmpty(startTime)) startDate = new Date(startTime);
|
||||
scheduleManager.addOrUpdateCronJob(jobKey, triggerKey, DeXpackScheduleJob.class, cron, startDate, end, jobDataMap);
|
||||
}
|
||||
|
||||
public void addOrUpdateTask(Long taskId, String cron, Long startTime, Long endTime) {
|
||||
if (CronUtils.taskExpire(endTime)) {
|
||||
return;
|
||||
@ -106,6 +122,13 @@ public class DeTaskExecutor {
|
||||
scheduleManager.removeJob(jobKey, triggerKey);
|
||||
}
|
||||
|
||||
public void removeThresholdTask(Long taskId) {
|
||||
String key = taskId.toString();
|
||||
JobKey jobKey = new JobKey(key, THRESHOLD_JOB_GROUP);
|
||||
TriggerKey triggerKey = new TriggerKey(key, THRESHOLD_JOB_GROUP);
|
||||
scheduleManager.removeJob(jobKey, triggerKey);
|
||||
}
|
||||
|
||||
public void clearRetryTask() throws Exception {
|
||||
scheduleManager.clearByGroup(RETRY_JOB_GROUP);
|
||||
}
|
||||
|
@ -14,6 +14,7 @@ import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
@ -31,7 +32,8 @@ public class MenuManage {
|
||||
|
||||
@XpackInteract(value = "menuApi")
|
||||
public List<MenuVO> query(List<CoreMenu> coreMenus) {
|
||||
List<MenuTreeNode> menuTreeNodes = coreMenus.stream().map(menu -> BeanUtils.copyBean(new MenuTreeNode(), menu)).toList();
|
||||
List<MenuTreeNode> menuTreeNodes = new ArrayList<>(coreMenus.stream().map(menu -> BeanUtils.copyBean(new MenuTreeNode(), menu)).toList());
|
||||
menuTreeNodes.sort(Comparator.comparing(MenuTreeNode::getMenuSort));
|
||||
List<MenuTreeNode> treeNodes = buildPOTree(menuTreeNodes);
|
||||
return convertTree(treeNodes);
|
||||
}
|
||||
|
@ -136,7 +136,7 @@ CREATE TABLE `core_dataset_table_field`
|
||||
`group_type` varchar(50) DEFAULT NULL COMMENT '维度/指标标识 d:维度,q:指标',
|
||||
`type` varchar(255) NOT NULL COMMENT '原始字段类型',
|
||||
`size` int DEFAULT NULL,
|
||||
`de_type` int NOT NULL COMMENT 'dataease字段类型:0-文本,1-时间,2-整型数值,3-浮点数值,4-布尔,5-地理位置,6-二进制',
|
||||
`de_type` int NOT NULL COMMENT 'dataease字段类型:0-文本,1-时间,2-整型数值,3-浮点数值,4-布尔,5-地理位置,6-二进制,7-URL',
|
||||
`de_extract_type` int NOT NULL COMMENT 'de记录的原始类型',
|
||||
`ext_field` int DEFAULT NULL COMMENT '是否扩展字段 0原始 1复制 2计算字段...',
|
||||
`checked` tinyint(1) DEFAULT '1' COMMENT '是否选中',
|
||||
|
@ -138,7 +138,7 @@ CREATE TABLE `core_dataset_table_field`
|
||||
`group_type` varchar(50) DEFAULT NULL COMMENT '维度/指标标识 d:维度,q:指标',
|
||||
`type` varchar(255) NOT NULL COMMENT '原始字段类型',
|
||||
`size` int DEFAULT NULL,
|
||||
`de_type` int NOT NULL COMMENT 'dataease字段类型:0-文本,1-时间,2-整型数值,3-浮点数值,4-布尔,5-地理位置,6-二进制',
|
||||
`de_type` int NOT NULL COMMENT 'dataease字段类型:0-文本,1-时间,2-整型数值,3-浮点数值,4-布尔,5-地理位置,6-二进制,7-URL',
|
||||
`de_extract_type` int NOT NULL COMMENT 'de记录的原始类型',
|
||||
`ext_field` int DEFAULT NULL COMMENT '是否扩展字段 0原始 1复制 2计算字段...',
|
||||
`checked` tinyint(1) DEFAULT NULL DEFAULT '1' COMMENT '是否选中',
|
||||
|
@ -1,8 +1,59 @@
|
||||
BEGIN;
|
||||
INSERT INTO `core_sys_startup_job` VALUES ('chartFilterDynamic', 'chartFilterDynamic', 'ready');
|
||||
INSERT INTO `core_sys_startup_job`
|
||||
VALUES ('chartFilterDynamic', 'chartFilterDynamic', 'ready');
|
||||
COMMIT;
|
||||
|
||||
alter table `core_dataset_table_field` add params text null comment '计算字段参数';
|
||||
alter table `core_dataset_table_field`
|
||||
add params text null comment '计算字段参数';
|
||||
|
||||
alter table `core_datasource`
|
||||
add `enable_data_fill` tinyint default 0 null comment '启用数据填报功能';
|
||||
|
||||
INSERT INTO `core_menu`
|
||||
VALUES (64, 15, 2, 'font', 'system/font', 10, 'icon_font', '/font', 0, 1, 0);
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `xpack_threshold_info`;
|
||||
CREATE TABLE `xpack_threshold_info`
|
||||
(
|
||||
`id` bigint NOT NULL,
|
||||
`name` varchar(255) NOT NULL COMMENT '告警名称',
|
||||
`enable` tinyint(1) NOT NULL COMMENT '是否启用',
|
||||
`rate_type` int NOT NULL COMMENT '频率类型',
|
||||
`rate_value` varchar(255) NOT NULL COMMENT '频率值',
|
||||
`resource_type` varchar(50) NOT NULL COMMENT '资源类型',
|
||||
`resource_id` bigint NOT NULL COMMENT '资源ID',
|
||||
`chart_type` varchar(255) NOT NULL COMMENT '图表类型',
|
||||
`chart_id` bigint NOT NULL COMMENT '图表ID',
|
||||
`threshold_rules` longtext COMMENT '告警规则',
|
||||
`recisetting` varchar(50) NOT NULL DEFAULT '0' COMMENT '消息渠道',
|
||||
`reci_users` longtext COMMENT '接收人',
|
||||
`reci_roles` longtext COMMENT '接收角色',
|
||||
`reci_emails` longtext COMMENT '接收邮箱',
|
||||
`reci_lark_groups` longtext COMMENT '飞书群聊',
|
||||
`reci_webhooks` longtext COMMENT 'Web hooks',
|
||||
`msg_title` varchar(255) NOT NULL COMMENT '消息标题',
|
||||
`msg_type` int NOT NULL DEFAULT '0' COMMENT '消息类型',
|
||||
`msg_content` longtext COMMENT '消息内容',
|
||||
`repeat_send` tinyint(1) NOT NULL DEFAULT '1' COMMENT '是否重复发送',
|
||||
`status` tinyint(1) NOT NULL DEFAULT '0' COMMENT '数据状态',
|
||||
`creator` bigint NOT NULL COMMENT '创建者ID',
|
||||
`creator_name` varchar(255) NOT NULL COMMENT '创建人名称',
|
||||
`create_time` bigint NOT NULL COMMENT '创建时间',
|
||||
`oid` bigint NOT NULL COMMENT '所属组织',
|
||||
PRIMARY KEY (`id`)
|
||||
);
|
||||
|
||||
DROP TABLE IF EXISTS `xpack_threshold_instance`;
|
||||
CREATE TABLE `xpack_threshold_instance`
|
||||
(
|
||||
`id` bigint NOT NULL,
|
||||
`task_id` bigint NOT NULL COMMENT '阈值信息ID',
|
||||
`exec_time` bigint NOT NULL COMMENT '检测时间',
|
||||
`status` tinyint(1) NOT NULL DEFAULT '0' COMMENT '数据状态',
|
||||
`content` longtext COMMENT '通知内容',
|
||||
`msg` longtext COMMENT '报错信息',
|
||||
PRIMARY KEY (`id`)
|
||||
);
|
||||
|
||||
|
||||
|
@ -21,6 +21,8 @@ i18n_menu.org=\u7EC4\u7EC7\u7BA1\u7406
|
||||
i18n_menu.auth=\u6743\u9650\u914D\u7F6E
|
||||
i18n_menu.report=\u5B9A\u65F6\u62A5\u544A
|
||||
i18n_menu.sync=\u540C\u6B65\u7BA1\u7406
|
||||
i18n_menu.association=\u8840\u7F18\u5206\u6790
|
||||
i18n_menu.threshold=\u544A\u8B66\u7BA1\u7406
|
||||
i18n_menu.summary=\u6982\u89C8
|
||||
i18n_menu.ds=\u6570\u636E\u8FDE\u63A5\u7BA1\u7406
|
||||
i18n_menu.task=\u4EFB\u52A1\u7BA1\u7406
|
||||
@ -29,7 +31,8 @@ i18n_menu.plugin=\u63D2\u4EF6\u7BA1\u7406
|
||||
i18n_menu.platform=\u5E73\u53F0\u5BF9\u63A5
|
||||
i18n_menu.appearance=\u5916\u89C2\u914D\u7F6E
|
||||
i18n_menu.sysVariable=\u7CFB\u7EDF\u53D8\u91CF
|
||||
i18n_menu.sysTypeface=\u5b57\u4f53\u7ba1\u7406
|
||||
i18n_menu.sysTypeface=\u5B57\u4F53\u7BA1\u7406
|
||||
i18n_menu.font=\u5B57\u4F53\u7BA1\u7406
|
||||
i18n_field_name_repeat=\u6709\u91CD\u590D\u5B57\u6BB5\u540D\uFF1A
|
||||
i18n_pid_not_eq_id=\u79FB\u52A8\u76EE\u6807\u4E0D\u80FD\u662F\u81EA\u5DF1\u6216\u5B50\u76EE\u5F55
|
||||
i18n_ds_name_exists=\u8BE5\u5206\u7EC4\u4E0B\u540D\u79F0\u91CD\u590D
|
||||
|
@ -28,6 +28,7 @@
|
||||
"axios": "^1.3.3",
|
||||
"crypto-js": "^4.1.1",
|
||||
"dayjs": "^1.11.9",
|
||||
"echarts": "^5.5.1",
|
||||
"element-plus-secondary": "^0.6.1",
|
||||
"element-resize-detector": "^1.2.4",
|
||||
"exceljs": "^4.4.0",
|
||||
|
3
core/core-frontend/public/svg/icon_app_outlined.svg
Normal file
@ -0,0 +1,3 @@
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M1 7.64384C1 7.2517 1.2292 6.89575 1.5862 6.73348L11.5862 2.18802C11.8491 2.06851 12.1509 2.06851 12.4138 2.18802L22.4138 6.73348C22.7708 6.89575 23 7.2517 23 7.64384V17.3819C23 17.7607 22.786 18.1069 22.4472 18.2763L12.4472 23.2763C12.1657 23.4171 11.8343 23.4171 11.5528 23.2763L1.55279 18.2763C1.214 18.1069 1 17.7607 1 17.3819V7.64384ZM19.2178 7.47768L12 4.19685L4.7432 7.49539L11.96 10.6042L19.2178 7.47768ZM13 12.3338V20.7639L21 16.7639V8.88765L13 12.3338ZM3 8.92215V16.7639L11 20.7639V12.3683L3 8.92215Z"/>
|
||||
</svg>
|
After Width: | Height: | Size: 614 B |
@ -0,0 +1,3 @@
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M2.5 20V11.5455C2.5 10.9681 2.97969 10.5 3.57143 10.5H8V3.05263C8 2.47128 8.51167 2 9.14286 2H14.8571C15.4883 2 16 2.47128 16 3.05263V8H20.4286C21.0203 8 21.5 8.44772 21.5 9V20H22C22.2761 20 22.5 20.2239 22.5 20.5V21.5C22.5 21.7761 22.2761 22 22 22H2C1.72386 22 1.5 21.7761 1.5 21.5V20.5C1.5 20.2239 1.72386 20 2 20H2.5ZM19.5 20V10H16V20H19.5ZM14 20V4H10V20H14ZM8 20V12.5H4.5V20H8Z"/>
|
||||
</svg>
|
After Width: | Height: | Size: 485 B |
3
core/core-frontend/public/svg/icon_database_outlined.svg
Normal file
@ -0,0 +1,3 @@
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M20.9117 19.9531C21.4811 19.5044 22 18.8519 22 18V6C22 5.14805 21.4811 4.49559 20.9117 4.04685C20.331 3.58923 19.5528 3.22085 18.6802 2.93C16.9246 2.3448 14.5629 2 12 2C9.43715 2 7.07541 2.3448 5.31981 2.93C4.44724 3.22085 3.66896 3.58923 3.08829 4.04685C2.51889 4.49559 2 5.14805 2 6V18C2 18.8519 2.51889 19.5044 3.08829 19.9531C3.66896 20.4108 4.44724 20.7791 5.31981 21.07C7.07541 21.6552 9.43715 22 12 22C14.5629 22 16.9246 21.6552 18.6802 21.07C19.5528 20.7791 20.331 20.4108 20.9117 19.9531ZM4 5.99973C4.00058 4.89529 7.58208 4 12 4C16.4183 4 20 4.89543 20 6C20 7.10457 16.4183 8 12 8C7.58172 8 4 7.10457 4 6C4 5.99998 4 5.99996 4 5.99994C4 5.99987 4 5.9998 4 5.99973ZM18.6802 9.07C19.1533 8.91229 19.5988 8.73177 20 8.5266V12.0002C20 12.0014 19.9999 12.0057 19.9969 12.0153C19.9935 12.0264 19.9852 12.0485 19.9649 12.0814C19.9225 12.1506 19.8359 12.2545 19.6738 12.3823C19.3436 12.6425 18.8038 12.9206 18.0477 13.1726C16.546 13.6732 14.4077 14 12 14C9.59229 14 7.45402 13.6732 5.95227 13.1726C5.19616 12.9206 4.65642 12.6425 4.32624 12.3823C4.16408 12.2545 4.07752 12.1506 4.03507 12.0814C4.01483 12.0485 4.00645 12.0264 4.00305 12.0153C4.00016 12.0058 4.00001 12.0012 4 12V8.5266C4.40123 8.73177 4.84666 8.91229 5.31981 9.07C7.07541 9.6552 9.43715 10 12 10C14.5629 10 16.9246 9.6552 18.6802 9.07ZM18.6802 15.07C19.1533 14.9123 19.5988 14.7318 20 14.5266V18.0001C20 18.001 20 18.0052 19.9969 18.0153C19.9935 18.0264 19.9852 18.0485 19.9649 18.0814C19.9225 18.1506 19.8359 18.2545 19.6738 18.3823C19.3436 18.6425 18.8038 18.9206 18.0477 19.1726C16.546 19.6732 14.4077 20 12 20C9.59229 20 7.45402 19.6732 5.95227 19.1726C5.19616 18.9206 4.65642 18.6425 4.32624 18.3823C4.16408 18.2545 4.07752 18.1506 4.03507 18.0814C4.01483 18.0485 4.00645 18.0264 4.00305 18.0153C3.99998 18.0052 4 18.0009 4 18V14.5266C4.40123 14.7318 4.84666 14.9123 5.31981 15.07C7.07541 15.6552 9.43715 16 12 16C14.5629 16 16.9246 15.6552 18.6802 15.07Z"/>
|
||||
</svg>
|
After Width: | Height: | Size: 2.0 KiB |
@ -0,0 +1,5 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 14 14" >
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M2.33329 2.33332V9.33332H11.6666V2.33332H2.33329ZM1.16663 1.74999C1.16663 1.4277 1.42913 1.16666 1.74996 1.16666H12.25C12.5708 1.16666 12.8333 1.4277 12.8333 1.74999V9.91666C12.8333 10.2389 12.5708 10.5 12.25 10.5H1.74996C1.42913 10.5 1.16663 10.2389 1.16663 9.91666V1.74999Z" />
|
||||
<path d="M9.00573 3.96255L9.83057 4.78739L7.06848 7.54947L5.72157 6.20285L4.78736 7.13735L3.96252 6.31222L5.72157 4.55318L7.06819 5.89981L9.00573 3.96255Z" />
|
||||
<path d="M9.91671 11.6667H4.08337V12.8333H9.91671V11.6667Z" />
|
||||
</svg>
|
After Width: | Height: | Size: 648 B |
@ -1,226 +0,0 @@
|
||||
import request from '@/config/axios'
|
||||
import dayjs from 'dayjs'
|
||||
|
||||
export function formatDate(value, dateType) {
|
||||
if (!value) {
|
||||
return value
|
||||
}
|
||||
switch (dateType) {
|
||||
case 'year':
|
||||
return dayjs(value).format('YYYY')
|
||||
case 'month':
|
||||
case 'monthrange':
|
||||
return dayjs(value).format('YYYY-MM')
|
||||
case 'datetime':
|
||||
case 'datetimerange':
|
||||
return dayjs(value).format('YYYY-MM-DD HH:mm:ss')
|
||||
default:
|
||||
return dayjs(value).format('YYYY-MM-DD')
|
||||
}
|
||||
}
|
||||
export interface ColumnItem {
|
||||
props: string
|
||||
label: string
|
||||
date: boolean
|
||||
dateType?: string
|
||||
type: string
|
||||
multiple: boolean
|
||||
rangeIndex?: number
|
||||
disabled?: boolean
|
||||
}
|
||||
export interface DataFillingOrFolder {
|
||||
name: string
|
||||
action?: string
|
||||
id?: number | string
|
||||
pid?: number | string
|
||||
nodeType: 'folder' | 'data-filling'
|
||||
union?: Array<{}>
|
||||
allFields?: Array<{}>
|
||||
}
|
||||
|
||||
export interface Tree {
|
||||
name: string
|
||||
value?: string | number
|
||||
id: string | number
|
||||
nodeType: string
|
||||
createBy?: string
|
||||
level: number
|
||||
leaf?: boolean
|
||||
pid: string | number
|
||||
type?: string
|
||||
createTime: number
|
||||
children?: Tree[]
|
||||
request: any
|
||||
}
|
||||
|
||||
export interface DfFormSetting {
|
||||
id?: string
|
||||
name?: string
|
||||
pid?: string
|
||||
datasource?: string
|
||||
tableName?: string
|
||||
forms: Array<DfFormItem>
|
||||
createIndex: boolean
|
||||
tableIndexes: Array<any>
|
||||
|
||||
creator?: string
|
||||
updater?: string
|
||||
createTime?: number
|
||||
updateTime?: number
|
||||
weight?: number
|
||||
}
|
||||
|
||||
export interface DfFormItem {
|
||||
type: string
|
||||
typeName: string
|
||||
icon: string
|
||||
order?: number
|
||||
value?: any
|
||||
id?: string
|
||||
settings: FormItemSetting
|
||||
old?: boolean
|
||||
removed?: boolean
|
||||
}
|
||||
|
||||
export interface FormItemSetting {
|
||||
name?: string
|
||||
placeholder?: string
|
||||
required?: boolean
|
||||
unique?: boolean
|
||||
inputType?: string
|
||||
optionSourceType?: 1 | 2
|
||||
optionDatasource?: number
|
||||
optionTable?: string
|
||||
optionColumn?: string
|
||||
optionOrder?: string
|
||||
multiple?: boolean
|
||||
dateType?: 'date' | 'daterange'
|
||||
rangeSeparator?: string
|
||||
startPlaceholder?: string
|
||||
endPlaceholder?: string
|
||||
options?: Array<FormItemSettingOptions>
|
||||
mapping: {
|
||||
columnName?: string
|
||||
columnName1?: string
|
||||
columnName2?: string
|
||||
type?: string
|
||||
}
|
||||
}
|
||||
|
||||
export interface FormItemSettingOptions {
|
||||
name: string
|
||||
value: string
|
||||
}
|
||||
|
||||
export interface SimpleDatasource {
|
||||
id: string
|
||||
pid: string
|
||||
name: string
|
||||
type: string
|
||||
typeAlias: string
|
||||
status: string
|
||||
enableDataFill: boolean
|
||||
}
|
||||
|
||||
export const listDataFillingForms = async (data): Promise<any> => {
|
||||
return request
|
||||
.post({ url: '/data-filling/tree', data: { ...data, ...{ busiFlag: 'data-filling' } } })
|
||||
.then(res => {
|
||||
return res?.data
|
||||
})
|
||||
}
|
||||
|
||||
export const createFolder = (data = {}): Promise<any> => {
|
||||
return request
|
||||
.post({ url: '/data-filling/save', data: { ...data, nodeType: 'folder' } })
|
||||
.then(res => {
|
||||
return res?.data
|
||||
})
|
||||
}
|
||||
export const save = (data = {}): Promise<any> => {
|
||||
return request.post({ url: '/data-filling/save', data }).then(res => {
|
||||
return res?.data
|
||||
})
|
||||
}
|
||||
|
||||
export const move = (data = {}): Promise<any> => {
|
||||
return request.post({ url: '/data-filling/move', data }).then(res => {
|
||||
return res?.data
|
||||
})
|
||||
}
|
||||
|
||||
export const reName = (data = {}): Promise<any> => {
|
||||
return request.post({ url: '/data-filling/rename', data }).then(res => {
|
||||
return res?.data
|
||||
})
|
||||
}
|
||||
export const listDatasourceList = (): Promise<Array<SimpleDatasource>> => {
|
||||
return request.get({ url: '/data-filling/datasource/list' }).then(res => {
|
||||
return res?.data
|
||||
})
|
||||
}
|
||||
|
||||
export const getDataFilling = async (id: string): Promise<any> => {
|
||||
return request.get({ url: `/data-filling/get/${id}` }).then(res => {
|
||||
return res?.data
|
||||
})
|
||||
}
|
||||
|
||||
export const deleteById = (id: string): Promise<any> => {
|
||||
return request.get({ url: '/data-filling/delete/' + id })
|
||||
}
|
||||
|
||||
export const deleteRowData = (formId: string, id: number): Promise<any> => {
|
||||
return request.get({ url: `/data-filling/form/${formId}/delete/${id}` })
|
||||
}
|
||||
|
||||
export const batchDeleteRowData = (formId: string, data: Array<any>): Promise<any> => {
|
||||
return request.post({ url: `/data-filling/form/${formId}/batch-delete`, data })
|
||||
}
|
||||
|
||||
export const getTableColumnData = (
|
||||
optionDatasource,
|
||||
optionTable,
|
||||
optionColumn,
|
||||
optionOrder
|
||||
): Promise<any> => {
|
||||
return request.post({
|
||||
url: `/data-filling/form/${optionDatasource}/options`,
|
||||
data: {
|
||||
optionTable: optionTable,
|
||||
optionColumn: optionColumn,
|
||||
optionOrder: optionOrder
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
export const searchTable = (id, data): Promise<any> => {
|
||||
return request.post({
|
||||
url: '/data-filling/form/' + id + '/tableData',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export const saveFormRowData = (formId, data): Promise<any> => {
|
||||
return request
|
||||
.post({
|
||||
url: '/data-filling/form/' + formId + '/rowData/save',
|
||||
data
|
||||
})
|
||||
.then(res => {
|
||||
return res?.data
|
||||
})
|
||||
}
|
||||
|
||||
export const saveTask = (data): Promise<any> => {
|
||||
return request.post({
|
||||
url: `/data-filling/task/save`,
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export const getTaskInfo = (taskId): Promise<any> => {
|
||||
return request.get({
|
||||
url: `/data-filling/task/info/${taskId}`
|
||||
})
|
||||
}
|
@ -120,6 +120,22 @@ export const delDatasetTree = async (id): Promise<IResponse> => {
|
||||
})
|
||||
}
|
||||
|
||||
export const exportDatasetData = async (data): Promise<IResponse> => {
|
||||
return request.post({
|
||||
url: '/datasetTree/exportDataset',
|
||||
method: 'post',
|
||||
data: data,
|
||||
loading: true,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
|
||||
export const perDelete = async (id): Promise<boolean> => {
|
||||
return request.post({ url: `/datasetTree/perDelete/${id}`, data: {} }).then(res => {
|
||||
return res?.data
|
||||
})
|
||||
}
|
||||
|
||||
export const getDatasourceList = async (): Promise<IResponse> => {
|
||||
return request.post({ url: '/datasource/tree', data: { busiFlag: 'datasource' } }).then(res => {
|
||||
return res?.data
|
||||
|
@ -91,6 +91,12 @@ export const save = async (data = {}): Promise<Dataset> => {
|
||||
})
|
||||
}
|
||||
|
||||
export const perDeleteDatasource = async (id): Promise<boolean> => {
|
||||
return request.post({ url: `/datasource//perDelete/${id}`, data: {} }).then(res => {
|
||||
return res?.data
|
||||
})
|
||||
}
|
||||
|
||||
export const update = async (data = {}): Promise<Dataset> => {
|
||||
return request.post({ url: '/datasource/update', data }).then(res => {
|
||||
return res?.data
|
||||
|
19
core/core-frontend/src/api/relation/index.ts
Normal file
@ -0,0 +1,19 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export function getDatasourceRelationship(id) {
|
||||
return request.post({
|
||||
url: `/relation/datasource/${id}`
|
||||
})
|
||||
}
|
||||
|
||||
export function getDatasetRelationship(id) {
|
||||
return request.post({
|
||||
url: `/relation/dataset/${id}`
|
||||
})
|
||||
}
|
||||
|
||||
export function getPanelRelationship(id) {
|
||||
return request.post({
|
||||
url: `/relation/dv/${id}`
|
||||
})
|
||||
}
|
@ -109,6 +109,7 @@ export interface ITarget {
|
||||
property: ITargetProperty
|
||||
incrementSync: string
|
||||
incrementField: string
|
||||
incrementFieldType: string
|
||||
}
|
||||
|
||||
export class ITaskInfoRes {
|
||||
|
6
core/core-frontend/src/assets/svg/association.svg
Normal file
@ -0,0 +1,6 @@
|
||||
<svg width="18" height="18" viewBox="0 0 18 18" fill="" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M3.55055 8.44446C4.20381 7.54988 4.78204 5.96571 5.35886 3.66363C5.68818 2.34934 6.08868 1.7778 6.43613 1.7778C6.74295 1.7778 6.99168 1.52907 6.99168 1.22224C6.99168 0.915418 6.74295 0.666687 6.43613 0.666687C5.39921 0.666687 4.72228 1.63271 4.28107 3.39357C3.78639 5.36783 3.28341 6.7504 2.84258 7.51417C2.65364 7.39943 2.43186 7.33335 2.19466 7.33335H1.36133C0.670972 7.33335 0.111328 7.893 0.111328 8.58335V9.41669C0.111328 10.107 0.670972 10.6667 1.36133 10.6667H2.19466C2.4011 10.6667 2.59585 10.6166 2.76745 10.528C3.17348 11.3576 3.6237 12.6971 4.06629 14.5236C4.50649 16.3404 5.17939 17.3334 6.22238 17.3334C6.52921 17.3334 6.77794 17.0846 6.77794 16.7778C6.77794 16.471 6.52921 16.2222 6.22238 16.2222C5.88102 16.2222 5.47648 15.6253 5.14615 14.262C4.61474 12.0688 4.08324 10.5087 3.49219 9.55558H7.08353C7.2216 9.55558 7.33353 9.44365 7.33353 9.30558V8.69446C7.33353 8.55639 7.2216 8.44446 7.08353 8.44446H3.55055Z" fill=""/>
|
||||
<path d="M9.00024 1.63891C9.00024 1.40879 9.18679 1.22224 9.41691 1.22224H17.4725C17.7026 1.22224 17.8891 1.40879 17.8891 1.63891V3.0278C17.8891 3.25792 17.7026 3.44447 17.4725 3.44447H9.41691C9.18679 3.44447 9.00024 3.25792 9.00024 3.0278V1.63891Z" fill=""/>
|
||||
<path d="M9.41691 7.88891C9.18679 7.88891 9.00024 8.07546 9.00024 8.30558V9.69447C9.00024 9.92458 9.18679 10.1111 9.41691 10.1111H17.4725C17.7026 10.1111 17.8891 9.92458 17.8891 9.69446V8.30558C17.8891 8.07546 17.7026 7.88891 17.4725 7.88891H9.41691Z" fill=""/>
|
||||
<path d="M9.00024 14.9722C9.00024 14.7421 9.18679 14.5556 9.41691 14.5556H17.4725C17.7026 14.5556 17.8891 14.7421 17.8891 14.9722V16.3611C17.8891 16.5913 17.7026 16.7778 17.4725 16.7778H9.41691C9.18679 16.7778 9.00024 16.5913 9.00024 16.3611V14.9722Z" fill=""/>
|
||||
</svg>
|
After Width: | Height: | Size: 1.8 KiB |
4
core/core-frontend/src/assets/svg/clock.svg
Normal file
@ -0,0 +1,4 @@
|
||||
<svg width="15" height="14" viewBox="0 0 15 14" fill="" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M14.9334 6.99998C14.9334 10.6819 11.9486 13.6666 8.2667 13.6666C6.14687 13.6666 4.25813 12.6773 3.03706 11.1351L4.09643 10.325C5.07368 11.549 6.5786 12.3333 8.2667 12.3333C11.2122 12.3333 13.6 9.9455 13.6 6.99998C13.6 4.05446 11.2122 1.66665 8.2667 1.66665C5.62404 1.66665 3.43029 3.58868 3.00711 6.11109H3.47752C3.7615 6.11109 3.93088 6.42759 3.77336 6.66387L2.65994 8.334C2.5192 8.5451 2.209 8.5451 2.06826 8.334L0.954845 6.66387C0.79732 6.42759 0.966704 6.11109 1.25068 6.11109H1.65878C2.09335 2.84944 4.88619 0.333313 8.2667 0.333313C11.9486 0.333313 14.9334 3.31808 14.9334 6.99998Z" fill=""/>
|
||||
<path d="M8.6667 6.77776V4.68887C8.6667 4.4925 8.50751 4.33331 8.31115 4.33331H7.68892C7.49256 4.33331 7.33337 4.4925 7.33337 4.68887V7.75554C7.33337 7.9519 7.49256 8.11109 7.68892 8.11109H10.5334C10.7297 8.11109 10.8889 7.9519 10.8889 7.75554V7.13331C10.8889 6.93695 10.7297 6.77776 10.5334 6.77776H8.6667Z" fill=""/>
|
||||
</svg>
|
After Width: | Height: | Size: 1.0 KiB |
4
core/core-frontend/src/assets/svg/dataset_params.svg
Normal file
@ -0,0 +1,4 @@
|
||||
<svg t="1723180281609" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4283" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200">
|
||||
<path d="M 729.088 534.323 c 13.5168 0 24.576 -11.0592 24.576 -24.576 v -348.16 c 0 -13.5168 -11.0592 -24.576 -24.576 -24.576 s -24.576 11.0592 -24.576 24.576 v 348.16 c 0 13.5168 11.0592 24.576 24.576 24.576 Z M 282.624 653.107 v -491.52 c 0 -13.5168 -11.0592 -24.576 -24.576 -24.576 s -24.576 11.0592 -24.576 24.576 v 491.52 c -35.4304 10.6496 -61.44 43.2128 -61.44 81.92 s 26.0096 71.2704 61.44 81.92 v 81.92 c 0 13.5168 11.0592 24.576 24.576 24.576 s 24.576 -11.0592 24.576 -24.576 v -81.92 c 35.4304 -10.6496 61.44 -43.2128 61.44 -81.92 s -26.0096 -71.2704 -61.44 -81.92 Z m -24.576 118.784 c -20.2752 0 -36.864 -16.5888 -36.864 -36.864 s 16.5888 -36.864 36.864 -36.864 s 36.864 16.5888 36.864 36.864 s -16.5888 36.864 -36.864 36.864 Z M 579.584 325.427 c 0 -38.912 -26.0096 -71.2704 -61.44 -81.92 v -81.92 c 0 -13.5168 -11.0592 -24.576 -24.576 -24.576 s -24.576 11.0592 -24.576 24.576 v 81.92 c -35.4304 10.6496 -61.44 43.2128 -61.44 81.92 s 26.0096 71.2704 61.44 81.92 v 491.52 c 0 13.5168 11.0592 24.576 24.576 24.576 s 24.576 -11.0592 24.576 -24.576 v -491.52 c 35.4304 -10.4448 61.44 -43.008 61.44 -81.92 Z m -122.88 0 c 0 -20.2752 16.5888 -36.864 36.864 -36.864 s 36.864 16.5888 36.864 36.864 s -16.5888 36.864 -36.864 36.864 s -36.864 -16.5888 -36.864 -36.864 Z M 876.544 683.213 c -5.9392 -3.072 -13.312 -10.24 -15.1552 -13.7216 c -1.2288 -2.2528 -2.2528 -4.5056 -3.4816 -6.5536 c -1.2288 -2.2528 -2.6624 -4.3008 -3.8912 -6.3488 c -2.2528 -3.4816 -4.7104 -13.312 -4.3008 -20.0704 a 59.8016 59.8016 0 0 0 -29.9008 -55.0912 c -19.8656 -11.4688 -44.8512 -10.4448 -63.8976 2.4576 c -5.7344 3.8912 -12.4928 5.7344 -20.0704 5.5296 c -4.096 -0.2048 -8.3968 -0.2048 -12.4928 0 c -7.5776 0.2048 -14.9504 -1.6384 -21.0944 -5.9392 a 59.945 59.945 0 0 0 -92.7744 53.4528 c 0.4096 7.5776 -1.4336 14.9504 -5.5296 21.2992 c -2.2528 3.4816 -4.3008 7.168 -6.144 10.8544 c -3.4816 6.5536 -8.6016 11.4688 -14.7456 14.5408 a 60.5389 60.5389 0 0 0 -34.2016 54.0672 c 0 22.528 12.4928 43.008 32.768 53.4528 c 5.9392 3.072 13.312 10.24 15.1552 13.7216 c 1.2288 2.2528 2.2528 4.5056 3.4816 6.5536 c 1.2288 2.2528 2.6624 4.3008 3.8912 6.3488 c 2.2528 3.4816 4.7104 13.312 4.3008 20.0704 a 59.8016 59.8016 0 0 0 59.8016 63.0784 c 11.8784 0 23.9616 -3.4816 33.9968 -10.4448 c 5.7344 -3.8912 12.9024 -5.7344 20.0704 -5.5296 c 4.3008 0.2048 8.6016 0.2048 12.9024 0 c 7.5776 -0.2048 14.5408 1.6384 20.8896 5.5296 c 19.0464 12.0832 43.008 12.6976 62.2592 1.4336 c 19.456 -11.264 30.9248 -32.1536 29.9008 -54.6816 c -0.4096 -7.3728 1.6384 -14.5408 5.5296 -20.8896 c 2.2528 -3.6864 4.5056 -7.3728 6.5536 -11.264 c 3.4816 -6.5536 8.6016 -11.6736 14.9504 -14.5408 a 60.5389 60.5389 0 0 0 34.2016 -54.0672 a 60.4365 60.4365 0 0 0 -32.9728 -53.248 Z m -19.0464 70.656 c -14.336 6.9632 -25.8048 18.2272 -33.3824 32.5632 c -1.4336 2.8672 -3.072 5.5296 -4.7104 8.192 c -8.6016 13.312 -12.6976 28.8768 -11.8784 44.6464 c 0.4096 7.168 -3.2768 13.9264 -9.4208 17.408 c -6.3488 3.4816 -13.9264 3.2768 -19.8656 -0.6144 c -13.312 -8.6016 -28.8768 -12.9024 -44.6464 -12.0832 c -3.072 0.2048 -6.3488 0.2048 -9.4208 0 c -16.1792 -0.6144 -31.744 3.6864 -44.8512 12.6976 c -6.144 4.096 -14.1312 4.5056 -20.2752 0.8192 c -6.144 -3.4816 -9.8304 -10.24 -9.4208 -17.6128 c 0.6144 -12.288 -2.4576 -31.5392 -10.8544 -44.2368 c -1.024 -1.4336 -1.8432 -3.072 -2.8672 -4.7104 c -0.8192 -1.6384 -1.8432 -3.072 -2.4576 -4.7104 c -6.9632 -13.7216 -21.9136 -26.0096 -32.9728 -31.5392 a 18.8416 18.8416 0 0 1 -10.4448 -16.9984 c 0 -7.168 4.3008 -13.9264 11.0592 -17.2032 c 14.336 -6.9632 25.8048 -18.2272 33.3824 -32.5632 c 1.4336 -2.6624 2.8672 -5.3248 4.5056 -7.7824 c 8.6016 -13.7216 12.6976 -29.2864 11.8784 -45.4656 c -0.4096 -7.3728 3.2768 -14.1312 9.4208 -17.6128 a 19.0464 19.0464 0 0 1 20.0704 0.8192 c 13.5168 8.8064 29.2864 13.1072 45.2608 12.4928 c 3.072 -0.2048 5.9392 -0.2048 9.0112 0 c 16.384 0.6144 31.744 -3.6864 44.8512 -12.6976 c 6.144 -4.096 14.1312 -4.5056 20.48 -0.8192 c 6.144 3.4816 9.8304 10.24 9.4208 17.6128 c -0.6144 12.288 2.4576 31.5392 10.8544 44.2368 c 1.024 1.4336 1.8432 3.072 2.8672 4.7104 c 0.8192 1.6384 1.8432 3.072 2.4576 4.7104 c 6.9632 13.7216 21.9136 26.0096 32.9728 31.5392 c 6.5536 3.2768 10.4448 9.8304 10.4448 16.9984 c -0.6144 7.168 -4.9152 13.9264 -11.4688 17.2032 Z" p-id="4284"></path><path d="M 696.525 681.165 c -30.9248 17.8176 -41.3696 57.344 -23.552 88.2688 a 64.7782 64.7782 0 0 0 88.2688 23.7568 c 30.72 -17.8176 41.3696 -57.344 23.552 -88.2688 a 64.471 64.471 0 0 0 -88.2688 -23.7568 Z m 55.0912 61.8496 c -1.6384 6.144 -5.5296 11.264 -11.0592 14.336 s -11.8784 3.8912 -17.8176 2.4576 c -6.144 -1.6384 -11.264 -5.5296 -14.336 -11.0592 s -3.8912 -11.8784 -2.4576 -17.8176 c 1.6384 -6.144 5.5296 -11.264 11.0592 -14.336 a 23.6954 23.6954 0 0 1 34.6112 26.4192 Z" p-id="4285">
|
||||
</path>
|
||||
</svg>
|
After Width: | Height: | Size: 4.9 KiB |
1
core/core-frontend/src/assets/svg/field_url.svg
Normal file
@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1723456468440" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1514" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M578.133 675.627c-3.306-3.307-8.746-3.307-12.053 0L442.133 799.573c-57.386 57.387-154.24 63.467-217.6 0-63.466-63.466-57.386-160.213 0-217.6L348.48 458.027c3.307-3.307 3.307-8.747 0-12.054l-42.453-42.453c-3.307-3.307-8.747-3.307-12.054 0L170.027 527.467c-90.24 90.24-90.24 236.266 0 326.4s236.266 90.24 326.4 0L620.373 729.92c3.307-3.307 3.307-8.747 0-12.053l-42.24-42.24z m275.84-505.6c-90.24-90.24-236.266-90.24-326.4 0L403.52 293.973c-3.307 3.307-3.307 8.747 0 12.054l42.347 42.346c3.306 3.307 8.746 3.307 12.053 0l123.947-123.946c57.386-57.387 154.24-63.467 217.6 0 63.466 63.466 57.386 160.213 0 217.6L675.52 565.973c-3.307 3.307-3.307 8.747 0 12.054l42.453 42.453c3.307 3.307 8.747 3.307 12.054 0l123.946-123.947c90.134-90.24 90.134-236.266 0-326.506z" p-id="1515"></path><path d="M616.64 362.987c-3.307-3.307-8.747-3.307-12.053 0l-241.6 241.493c-3.307 3.307-3.307 8.747 0 12.053l42.24 42.24c3.306 3.307 8.746 3.307 12.053 0L658.773 417.28c3.307-3.307 3.307-8.747 0-12.053l-42.133-42.24z" p-id="1516"></path></svg>
|
After Width: | Height: | Size: 1.3 KiB |
@ -0,0 +1,6 @@
|
||||
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M0 3C0 1.34315 1.59845 0 3.57025 0H14.4298C16.4015 0 18 1.34315 18 3V15C18 16.6569 16.4015 18 14.4298 18H3.57025C1.59845 18 0 16.6569 0 15V3Z" fill="#00D6B9"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M5 5V11H13V5H5ZM4 4.5C4 4.22375 4.225 4 4.5 4H13.5C13.775 4 14 4.22375 14 4.5V11.5C14 11.7763 13.775 12 13.5 12H4.5C4.225 12 4 11.7763 4 11.5V4.5Z" fill="white"/>
|
||||
<path d="M10.7192 6.39648L11.4262 7.10348L9.05873 9.47098L7.90423 8.31673L7.10348 9.11773L6.39648 8.41048L7.90423 6.90273L9.05849 8.05698L10.7192 6.39648Z" fill="white"/>
|
||||
<path d="M11.5 13H6.5V14H11.5V13Z" fill="white"/>
|
||||
</svg>
|
After Width: | Height: | Size: 705 B |
@ -0,0 +1,5 @@
|
||||
<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M6.66669 4.16667C6.66669 3.24619 7.41288 2.5 8.33335 2.5H24.6548C24.8759 2.5 25.0878 2.5878 25.2441 2.74408L33.0893 10.5893C33.2456 10.7455 33.3334 10.9575 33.3334 11.1785V35.8333C33.3334 36.7538 32.5872 37.5 31.6667 37.5H8.33335C7.41288 37.5 6.66669 36.7538 6.66669 35.8333V4.16667Z" fill="#8F959E"/>
|
||||
<path d="M25 2.57495C25.09 2.6159 25.1728 2.67292 25.2441 2.74418L33.0893 10.5894C33.1605 10.6606 33.2175 10.7434 33.2585 10.8334H26.6667C25.7462 10.8334 25 10.0872 25 9.16677V2.57495Z" fill="#646A73"/>
|
||||
<path d="M17.5356 24.1H22.3756L19.9956 17.44H19.9556L17.5356 24.1ZM18.9556 15.72H21.0556L26.6356 30H24.5356L22.9756 25.7H16.9356L15.3356 30H13.3956L18.9556 15.72Z" fill="white"/>
|
||||
</svg>
|
After Width: | Height: | Size: 796 B |
4
core/core-frontend/src/assets/svg/icon_font.svg
Normal file
@ -0,0 +1,4 @@
|
||||
<svg width="18" height="18" viewBox="0 0 18 18" fill="" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M9.83333 4.83335H12.75C12.9801 4.83335 13.1667 5.0199 13.1667 5.25002V6.08335C13.1667 6.31347 12.9801 6.50002 12.75 6.50002H9.83333V12.75C9.83333 12.9801 9.64678 13.1667 9.41667 13.1667H8.58333C8.35321 13.1667 8.16667 12.9801 8.16667 12.75V6.50002H5.25C5.01988 6.50002 4.83333 6.31347 4.83333 6.08335V5.25002C4.83333 5.0199 5.01988 4.83335 5.25 4.83335H8.16667C8.16667 4.83335 9.83333 4.85696 9.83333 4.83335Z" fill=""/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M0.666666 1.50002C0.666666 1.03978 1.03976 0.666687 1.5 0.666687H16.5C16.9602 0.666687 17.3333 1.03978 17.3333 1.50002V16.5C17.3333 16.9603 16.9602 17.3334 16.5 17.3334H1.5C1.03976 17.3334 0.666666 16.9603 0.666666 16.5V1.50002ZM2.33333 15.6667V2.33335H15.6667V15.6667H2.33333Z" fill=""/>
|
||||
</svg>
|
After Width: | Height: | Size: 867 B |
@ -0,0 +1,3 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M6.66683 1.84V1.33333C6.66683 1.24493 6.70195 1.16014 6.76446 1.09763C6.82697 1.03512 6.91176 1 7.00016 1H9.00016C9.08857 1 9.17335 1.03512 9.23587 1.09763C9.29838 1.16014 9.3335 1.24493 9.3335 1.33333V1.84C11.6335 2.45133 13.3335 4.60667 13.3335 7.172V11H14.3335C14.3773 11 14.4206 11.0086 14.4611 11.0254C14.5015 11.0421 14.5382 11.0667 14.5692 11.0976C14.6002 11.1286 14.6247 11.1653 14.6415 11.2058C14.6582 11.2462 14.6668 11.2896 14.6668 11.3333V12C14.6668 12.0438 14.6582 12.0871 14.6415 12.1276C14.6247 12.168 14.6002 12.2048 14.5692 12.2357C14.5382 12.2667 14.5015 12.2912 14.4611 12.308C14.4206 12.3247 14.3773 12.3333 14.3335 12.3333H1.66683C1.62306 12.3333 1.57971 12.3247 1.53927 12.308C1.49883 12.2912 1.46208 12.2667 1.43113 12.2357C1.40017 12.2048 1.37562 12.168 1.35887 12.1276C1.34212 12.0871 1.3335 12.0438 1.3335 12V11.3333C1.3335 11.2896 1.34212 11.2462 1.35887 11.2058C1.37562 11.1653 1.40017 11.1286 1.43113 11.0976C1.46208 11.0667 1.49883 11.0421 1.53927 11.0254C1.57971 11.0086 1.62306 11 1.66683 11H2.66683V7.172C2.66683 4.60667 4.36683 2.45133 6.66683 1.84ZM6.3335 13.3333H9.66683C9.7106 13.3333 9.75395 13.342 9.79439 13.3587C9.83483 13.3755 9.87158 13.4 9.90253 13.431C9.93349 13.4619 9.95804 13.4987 9.97479 13.5391C9.99154 13.5795 10.0002 13.6229 10.0002 13.6667V14.3333C10.0002 14.3771 9.99154 14.4205 9.97479 14.4609C9.95804 14.5013 9.93349 14.5381 9.90253 14.569C9.87158 14.6 9.83483 14.6245 9.79439 14.6413C9.75395 14.658 9.7106 14.6667 9.66683 14.6667H6.3335C6.28972 14.6667 6.24638 14.658 6.20594 14.6413C6.16549 14.6245 6.12875 14.6 6.09779 14.569C6.06684 14.5381 6.04229 14.5013 6.02554 14.4609C6.00879 14.4205 6.00016 14.3771 6.00016 14.3333V13.6667C6.00016 13.6229 6.00879 13.5795 6.02554 13.5391C6.04229 13.4987 6.06684 13.4619 6.09779 13.431C6.12875 13.4 6.16549 13.3755 6.20594 13.3587C6.24638 13.342 6.28972 13.3333 6.3335 13.3333Z"/>
|
||||
</svg>
|
After Width: | Height: | Size: 1.9 KiB |
1
core/core-frontend/src/assets/svg/icon_url_outlined.svg
Normal file
@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1723456468440" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1514" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M578.133 675.627c-3.306-3.307-8.746-3.307-12.053 0L442.133 799.573c-57.386 57.387-154.24 63.467-217.6 0-63.466-63.466-57.386-160.213 0-217.6L348.48 458.027c3.307-3.307 3.307-8.747 0-12.054l-42.453-42.453c-3.307-3.307-8.747-3.307-12.054 0L170.027 527.467c-90.24 90.24-90.24 236.266 0 326.4s236.266 90.24 326.4 0L620.373 729.92c3.307-3.307 3.307-8.747 0-12.053l-42.24-42.24z m275.84-505.6c-90.24-90.24-236.266-90.24-326.4 0L403.52 293.973c-3.307 3.307-3.307 8.747 0 12.054l42.347 42.346c3.306 3.307 8.746 3.307 12.053 0l123.947-123.946c57.386-57.387 154.24-63.467 217.6 0 63.466 63.466 57.386 160.213 0 217.6L675.52 565.973c-3.307 3.307-3.307 8.747 0 12.054l42.453 42.453c3.307 3.307 8.747 3.307 12.054 0l123.946-123.947c90.134-90.24 90.134-236.266 0-326.506z" p-id="1515"></path><path d="M616.64 362.987c-3.307-3.307-8.747-3.307-12.053 0l-241.6 241.493c-3.307 3.307-3.307 8.747 0 12.053l42.24 42.24c3.306 3.307 8.746 3.307 12.053 0L658.773 417.28c3.307-3.307 3.307-8.747 0-12.053l-42.133-42.24z" p-id="1516"></path></svg>
|
After Width: | Height: | Size: 1.3 KiB |
@ -1,3 +1,3 @@
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M8.50002 3H21.5C21.5657 3 21.6307 3.01293 21.6913 3.03805C21.752 3.06318 21.8071 3.10001 21.8536 3.14644C21.9 3.19286 21.9368 3.24798 21.962 3.30865C21.9871 3.36931 22 3.43433 22 3.49999V4.5C22 4.56566 21.9871 4.63068 21.962 4.69134C21.9368 4.75201 21.9 4.80713 21.8536 4.85356C21.8071 4.89999 21.752 4.93681 21.6913 4.96194C21.6307 4.98706 21.5657 5 21.5 4.99999H8.50002C8.43435 5 8.36933 4.98706 8.30867 4.96194C8.248 4.93681 8.19288 4.89999 8.14645 4.85356C8.10002 4.80713 8.06319 4.75201 8.03806 4.69134C8.01293 4.63068 8 4.56566 8 4.5V3.49999C8 3.43433 8.01293 3.36931 8.03806 3.30865C8.06319 3.24798 8.10002 3.19286 8.14645 3.14644C8.19288 3.10001 8.248 3.06318 8.30867 3.03805C8.36933 3.01293 8.43435 3 8.50002 3V3ZM8.50002 11H21.5C21.5657 11 21.6307 11.0129 21.6914 11.038C21.752 11.0632 21.8071 11.1 21.8536 11.1464C21.9 11.1929 21.9368 11.248 21.962 11.3087C21.9871 11.3693 22 11.4343 22 11.5V12.5C22 12.5657 21.9871 12.6307 21.962 12.6913C21.9368 12.752 21.9 12.8071 21.8536 12.8536C21.8071 12.9 21.752 12.9368 21.6914 12.962C21.6307 12.9871 21.5657 13 21.5 13H8.50002C8.43435 13 8.36933 12.9871 8.30866 12.962C8.248 12.9368 8.19288 12.9 8.14644 12.8536C8.10001 12.8071 8.06318 12.752 8.03806 12.6913C8.01293 12.6307 8 12.5657 8 12.5V11.5C8 11.4343 8.01293 11.3693 8.03806 11.3087C8.06318 11.248 8.10001 11.1929 8.14644 11.1464C8.19288 11.1 8.248 11.0632 8.30866 11.038C8.36933 11.0129 8.43435 11 8.50002 11V11ZM2.50002 11H5.50002C5.56568 11 5.6307 11.0129 5.69136 11.0381C5.75202 11.0632 5.80714 11.1 5.85357 11.1464C5.9 11.1929 5.93683 11.248 5.96195 11.3087C5.98708 11.3693 6.00001 11.4343 6.00001 11.5V12.5C6.00001 12.5657 5.98708 12.6307 5.96195 12.6913C5.93683 12.752 5.9 12.8071 5.85357 12.8536C5.80714 12.9 5.75202 12.9368 5.69136 12.9619C5.6307 12.9871 5.56568 13 5.50002 13H2.50002C2.43435 13 2.36933 12.9871 2.30866 12.962C2.248 12.9368 2.19288 12.9 2.14644 12.8536C2.10001 12.8071 2.06318 12.752 2.03806 12.6913C2.01293 12.6307 2 12.5657 2 12.5V11.5C2 11.4343 2.01293 11.3693 2.03806 11.3087C2.06318 11.248 2.10001 11.1929 2.14644 11.1464C2.19288 11.1 2.248 11.0632 2.30866 11.038C2.36933 11.0129 2.43435 11 2.50002 11V11ZM2.50002 3H5.50002C5.56568 3 5.63069 3.01293 5.69135 3.03806C5.75202 3.06319 5.80714 3.10002 5.85356 3.14644C5.89999 3.19287 5.93682 3.24799 5.96195 3.30865C5.98708 3.36932 6.00001 3.43433 6.00001 3.49999V4.5C6.00001 4.63261 5.94733 4.75978 5.85356 4.85355C5.7598 4.94731 5.63262 4.99999 5.50002 4.99999H2.50002C2.43435 5 2.36933 4.98706 2.30867 4.96194C2.24801 4.93681 2.19288 4.89999 2.14645 4.85356C2.10002 4.80713 2.06319 4.75201 2.03806 4.69134C2.01293 4.63068 2 4.56566 2 4.5V3.49999C2 3.43433 2.01293 3.36931 2.03806 3.30865C2.06319 3.24798 2.10002 3.19286 2.14645 3.14644C2.19288 3.10001 2.24801 3.06318 2.30867 3.03805C2.36933 3.01293 2.43435 3 2.50002 3ZM2.50002 19H5.50002C5.56568 19 5.63069 19.0129 5.69135 19.0381C5.75202 19.0632 5.80714 19.1 5.85356 19.1465C5.89999 19.1929 5.93682 19.248 5.96195 19.3087C5.98708 19.3693 6.00001 19.4343 6.00001 19.5V20.5C6.00001 20.6326 5.94733 20.7598 5.85356 20.8536C5.7598 20.9473 5.63262 21 5.50002 21H2.50002C2.43435 21 2.36933 20.9871 2.30867 20.9619C2.24801 20.9368 2.19288 20.9 2.14645 20.8536C2.10002 20.8071 2.06319 20.752 2.03806 20.6914C2.01293 20.6307 2 20.5657 2 20.5V19.5C2 19.4343 2.01293 19.3693 2.03806 19.3087C2.06319 19.248 2.10002 19.1929 2.14645 19.1464C2.19288 19.1 2.24801 19.0632 2.30867 19.0381C2.36933 19.0129 2.43435 19 2.50002 19ZM8.50002 19H21.5C21.5657 19 21.6307 19.0129 21.6913 19.0381C21.752 19.0632 21.8071 19.1 21.8536 19.1464C21.9 19.1929 21.9368 19.248 21.962 19.3087C21.9871 19.3693 22 19.4343 22 19.5V20.5C22 20.5657 21.9871 20.6307 21.962 20.6914C21.9368 20.752 21.9 20.8071 21.8536 20.8536C21.8071 20.9 21.752 20.9368 21.6913 20.9619C21.6307 20.9871 21.5657 21 21.5 21H8.50002C8.43435 21 8.36933 20.9871 8.30867 20.9619C8.248 20.9368 8.19288 20.9 8.14645 20.8536C8.10002 20.8071 8.06319 20.752 8.03806 20.6914C8.01293 20.6307 8 20.5657 8 20.5V19.5C8 19.4343 8.01293 19.3693 8.03806 19.3087C8.06319 19.248 8.10002 19.1929 8.14645 19.1464C8.19288 19.1 8.248 19.0632 8.30867 19.0381C8.36933 19.0129 8.43435 19 8.50002 19Z" fill="#1F2329"/>
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M8.50002 3H21.5C21.5657 3 21.6307 3.01293 21.6913 3.03805C21.752 3.06318 21.8071 3.10001 21.8536 3.14644C21.9 3.19286 21.9368 3.24798 21.962 3.30865C21.9871 3.36931 22 3.43433 22 3.49999V4.5C22 4.56566 21.9871 4.63068 21.962 4.69134C21.9368 4.75201 21.9 4.80713 21.8536 4.85356C21.8071 4.89999 21.752 4.93681 21.6913 4.96194C21.6307 4.98706 21.5657 5 21.5 4.99999H8.50002C8.43435 5 8.36933 4.98706 8.30867 4.96194C8.248 4.93681 8.19288 4.89999 8.14645 4.85356C8.10002 4.80713 8.06319 4.75201 8.03806 4.69134C8.01293 4.63068 8 4.56566 8 4.5V3.49999C8 3.43433 8.01293 3.36931 8.03806 3.30865C8.06319 3.24798 8.10002 3.19286 8.14645 3.14644C8.19288 3.10001 8.248 3.06318 8.30867 3.03805C8.36933 3.01293 8.43435 3 8.50002 3V3ZM8.50002 11H21.5C21.5657 11 21.6307 11.0129 21.6914 11.038C21.752 11.0632 21.8071 11.1 21.8536 11.1464C21.9 11.1929 21.9368 11.248 21.962 11.3087C21.9871 11.3693 22 11.4343 22 11.5V12.5C22 12.5657 21.9871 12.6307 21.962 12.6913C21.9368 12.752 21.9 12.8071 21.8536 12.8536C21.8071 12.9 21.752 12.9368 21.6914 12.962C21.6307 12.9871 21.5657 13 21.5 13H8.50002C8.43435 13 8.36933 12.9871 8.30866 12.962C8.248 12.9368 8.19288 12.9 8.14644 12.8536C8.10001 12.8071 8.06318 12.752 8.03806 12.6913C8.01293 12.6307 8 12.5657 8 12.5V11.5C8 11.4343 8.01293 11.3693 8.03806 11.3087C8.06318 11.248 8.10001 11.1929 8.14644 11.1464C8.19288 11.1 8.248 11.0632 8.30866 11.038C8.36933 11.0129 8.43435 11 8.50002 11V11ZM2.50002 11H5.50002C5.56568 11 5.6307 11.0129 5.69136 11.0381C5.75202 11.0632 5.80714 11.1 5.85357 11.1464C5.9 11.1929 5.93683 11.248 5.96195 11.3087C5.98708 11.3693 6.00001 11.4343 6.00001 11.5V12.5C6.00001 12.5657 5.98708 12.6307 5.96195 12.6913C5.93683 12.752 5.9 12.8071 5.85357 12.8536C5.80714 12.9 5.75202 12.9368 5.69136 12.9619C5.6307 12.9871 5.56568 13 5.50002 13H2.50002C2.43435 13 2.36933 12.9871 2.30866 12.962C2.248 12.9368 2.19288 12.9 2.14644 12.8536C2.10001 12.8071 2.06318 12.752 2.03806 12.6913C2.01293 12.6307 2 12.5657 2 12.5V11.5C2 11.4343 2.01293 11.3693 2.03806 11.3087C2.06318 11.248 2.10001 11.1929 2.14644 11.1464C2.19288 11.1 2.248 11.0632 2.30866 11.038C2.36933 11.0129 2.43435 11 2.50002 11V11ZM2.50002 3H5.50002C5.56568 3 5.63069 3.01293 5.69135 3.03806C5.75202 3.06319 5.80714 3.10002 5.85356 3.14644C5.89999 3.19287 5.93682 3.24799 5.96195 3.30865C5.98708 3.36932 6.00001 3.43433 6.00001 3.49999V4.5C6.00001 4.63261 5.94733 4.75978 5.85356 4.85355C5.7598 4.94731 5.63262 4.99999 5.50002 4.99999H2.50002C2.43435 5 2.36933 4.98706 2.30867 4.96194C2.24801 4.93681 2.19288 4.89999 2.14645 4.85356C2.10002 4.80713 2.06319 4.75201 2.03806 4.69134C2.01293 4.63068 2 4.56566 2 4.5V3.49999C2 3.43433 2.01293 3.36931 2.03806 3.30865C2.06319 3.24798 2.10002 3.19286 2.14645 3.14644C2.19288 3.10001 2.24801 3.06318 2.30867 3.03805C2.36933 3.01293 2.43435 3 2.50002 3ZM2.50002 19H5.50002C5.56568 19 5.63069 19.0129 5.69135 19.0381C5.75202 19.0632 5.80714 19.1 5.85356 19.1465C5.89999 19.1929 5.93682 19.248 5.96195 19.3087C5.98708 19.3693 6.00001 19.4343 6.00001 19.5V20.5C6.00001 20.6326 5.94733 20.7598 5.85356 20.8536C5.7598 20.9473 5.63262 21 5.50002 21H2.50002C2.43435 21 2.36933 20.9871 2.30867 20.9619C2.24801 20.9368 2.19288 20.9 2.14645 20.8536C2.10002 20.8071 2.06319 20.752 2.03806 20.6914C2.01293 20.6307 2 20.5657 2 20.5V19.5C2 19.4343 2.01293 19.3693 2.03806 19.3087C2.06319 19.248 2.10002 19.1929 2.14645 19.1464C2.19288 19.1 2.24801 19.0632 2.30867 19.0381C2.36933 19.0129 2.43435 19 2.50002 19ZM8.50002 19H21.5C21.5657 19 21.6307 19.0129 21.6913 19.0381C21.752 19.0632 21.8071 19.1 21.8536 19.1464C21.9 19.1929 21.9368 19.248 21.962 19.3087C21.9871 19.3693 22 19.4343 22 19.5V20.5C22 20.5657 21.9871 20.6307 21.962 20.6914C21.9368 20.752 21.9 20.8071 21.8536 20.8536C21.8071 20.9 21.752 20.9368 21.6913 20.9619C21.6307 20.9871 21.5657 21 21.5 21H8.50002C8.43435 21 8.36933 20.9871 8.30867 20.9619C8.248 20.9368 8.19288 20.9 8.14645 20.8536C8.10002 20.8071 8.06319 20.752 8.03806 20.6914C8.01293 20.6307 8 20.5657 8 20.5V19.5C8 19.4343 8.01293 19.3693 8.03806 19.3087C8.06319 19.248 8.10002 19.1929 8.14645 19.1464C8.19288 19.1 8.248 19.0632 8.30867 19.0381C8.36933 19.0129 8.43435 19 8.50002 19Z" />
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.2 KiB |
@ -0,0 +1,3 @@
|
||||
<svg viewBox="0 0 10 10" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M4.76 7.79272L1.11625 3.25001C1.01687 3.12626 1.01687 2.92543 1.11625 2.80148C1.16395 2.74189 1.22875 2.70856 1.29603 2.70856H8.70417C8.84458 2.70856 8.95854 2.85064 8.95854 3.02584C8.95854 3.11001 8.93167 3.19043 8.88395 3.25001L5.2402 7.79293C5.1077 7.95814 4.8927 7.95814 4.7602 7.79293L4.76 7.79272Z" fill="#646A73"/>
|
||||
</svg>
|
After Width: | Height: | Size: 411 B |
3
core/core-frontend/src/assets/svg/threshold.svg
Normal file
@ -0,0 +1,3 @@
|
||||
<svg width="20" height="20" viewBox="0 0 20 20" fill="" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M10.4163 0.833313H9.58299C9.35287 0.833313 9.16632 1.01986 9.16632 1.24998V2.91665C9.16632 3.14676 9.35287 3.33331 9.58299 3.33331H10.4163C10.6464 3.33331 10.833 3.14676 10.833 2.91665V1.24998C10.833 1.01986 10.6464 0.833313 10.4163 0.833313ZM5.92675 2.41117L5.89112 2.35693C5.72517 2.13369 5.41458 2.06537 5.16784 2.20782L4.73046 2.46035L4.67622 2.49598C4.45298 2.66192 4.38466 2.97251 4.52711 3.21925L5.18368 4.35645L5.21931 4.4107C5.38525 4.63393 5.69584 4.70226 5.94258 4.5598L6.37997 4.30728L6.43421 4.27165C6.65744 4.1057 6.72577 3.79511 6.58331 3.54837L5.92675 2.41117ZM2.67934 5.45788L2.73732 5.48704L3.52461 5.94158C3.77135 6.08403 3.86748 6.38718 3.75712 6.64251L3.72796 6.70048L3.47544 7.13787C3.33298 7.38461 3.02984 7.48073 2.77451 7.37038L2.71653 7.34122L1.92924 6.88667C1.6825 6.74422 1.58638 6.44107 1.69673 6.18575L1.72589 6.12777L1.97842 5.69038C2.12087 5.44364 2.42401 5.34752 2.67934 5.45788ZM18.0209 5.69038L18.2734 6.12777C18.4268 6.39349 18.3358 6.73326 18.0701 6.88667L17.2828 7.34122C17.0171 7.49463 16.6773 7.40359 16.5239 7.13787L16.2713 6.70048C16.1179 6.43477 16.209 6.09499 16.4747 5.94158L17.262 5.48704C17.5277 5.33362 17.8675 5.42466 18.0209 5.69038ZM14.8315 2.20782L15.2688 2.46035C15.5346 2.61376 15.6256 2.95353 15.4722 3.21925L14.8156 4.35645C14.6622 4.62217 14.3224 4.71321 14.0567 4.5598L13.6193 4.30728C13.3536 4.15386 13.2626 3.81409 13.416 3.54837L14.0726 2.41117C14.226 2.14545 14.5657 2.05441 14.8315 2.20782ZM16.6668 10.6313C16.6668 7.06097 13.5895 4.16665 9.99965 4.16665C6.4098 4.16665 3.34009 7.06097 3.34009 10.6313L3.34004 17.5H2.08446C1.77596 17.5 1.66632 17.6128 1.66632 17.9197V18.7521C1.66632 19.0589 1.77552 19.1666 2.08403 19.1666H17.918C18.2265 19.1666 18.333 19.0589 18.333 18.7521V17.9197C18.333 17.6177 18.2298 17.5036 17.9324 17.5001L17.918 17.5H17.9157H16.6663L16.6668 10.6313ZM14.9997 17.4999L15.0001 10.6313C15 8.04424 12.733 5.83331 9.99965 5.83331C7.26873 5.83331 5.00676 8.04181 5.00676 10.6313L5.00671 17.5L14.9997 17.4999ZM7.91632 9.99998H7.08299C6.85287 9.99998 6.66632 10.1865 6.66632 10.4166V12.0833C6.66632 12.3134 6.85287 12.5 7.08299 12.5H7.91632C8.14644 12.5 8.33299 12.3134 8.33299 12.0833V10.4166C8.33299 10.1865 8.14644 9.99998 7.91632 9.99998Z" fill=""/>
|
||||
</svg>
|
After Width: | Height: | Size: 2.3 KiB |
8
core/core-frontend/src/assets/svg/threshold_full.svg
Normal file
@ -0,0 +1,8 @@
|
||||
<svg width="14" height="16" viewBox="0 0 14 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M12.3336 8.50507C12.3336 5.64881 9.8718 3.33335 6.99992 3.33335C4.12804 3.33335 1.67227 5.64881 1.67227 8.50507L1.67223 14H0.667415C0.420612 14 0.333251 14.0903 0.333251 14.3358V15.0017C0.333251 15.2472 0.420612 15.3334 0.667415 15.3334H13.3346C13.5814 15.3334 13.6666 15.2472 13.6666 15.0017V14.3358C13.6666 14.0903 13.5814 14 13.3346 14H12.3333L12.3336 8.50507ZM4.66659 8.00002H5.33325C5.51735 8.00002 5.66659 8.14926 5.66659 8.33335V9.66669C5.66659 9.85078 5.51735 10 5.33325 10H4.66659C4.48249 10 4.33325 9.85078 4.33325 9.66669V8.33335C4.33325 8.14926 4.48249 8.00002 4.66659 8.00002Z" fill="#F54A45"/>
|
||||
<path d="M1.19005 4.38966L1.14367 4.36634C0.939405 4.27805 0.696891 4.35495 0.582928 4.55234L0.380908 4.90225L0.357581 4.94863C0.269295 5.1529 0.346195 5.39541 0.543586 5.50937L1.17342 5.87301L1.2198 5.89634C1.42407 5.98462 1.66658 5.90772 1.78054 5.71033L1.98256 5.36042L2.00589 5.31404C2.09418 5.10978 2.01728 4.86726 1.81989 4.7533L1.19005 4.38966Z" fill="#F54A45"/>
|
||||
<path d="M13.6189 4.90225L13.4169 4.55234C13.2942 4.33977 13.0224 4.26693 12.8098 4.38966L12.18 4.7533C11.9674 4.87603 11.8945 5.14785 12.0173 5.36042L12.2193 5.71033C12.342 5.92291 12.6138 5.99574 12.8264 5.87301L13.4563 5.50937C13.6688 5.38664 13.7417 5.11483 13.6189 4.90225Z" fill="#F54A45"/>
|
||||
<path d="M3.74159 1.92897L3.71309 1.88558C3.58033 1.70699 3.33186 1.65233 3.13447 1.76629L2.78456 1.96831L2.74117 1.99682C2.56258 2.12957 2.50792 2.37805 2.62188 2.57544L3.14714 3.4852L3.17564 3.52859C3.30839 3.70718 3.55687 3.76184 3.75426 3.64788L4.10417 3.44586L4.14756 3.41735C4.32615 3.2846 4.38081 3.03613 4.26685 2.83874L3.74159 1.92897Z" fill="#F54A45"/>
|
||||
<path d="M11.2153 1.96831L10.8654 1.76629C10.6528 1.64356 10.381 1.7164 10.2582 1.92897L9.73299 2.83874C9.61026 3.05131 9.68309 3.32313 9.89567 3.44586L10.2456 3.64788C10.4582 3.77061 10.73 3.69778 10.8527 3.4852L11.378 2.57544C11.5007 2.36286 11.4278 2.09104 11.2153 1.96831Z" fill="#F54A45"/>
|
||||
<path d="M7.33325 0.666687H6.66658C6.48249 0.666687 6.33325 0.815925 6.33325 1.00002V2.33335C6.33325 2.51745 6.48249 2.66669 6.66658 2.66669H7.33325C7.51735 2.66669 7.66658 2.51745 7.66658 2.33335V1.00002C7.66658 0.815925 7.51735 0.666687 7.33325 0.666687Z" fill="#F54A45"/>
|
||||
</svg>
|
After Width: | Height: | Size: 2.3 KiB |
@ -3,7 +3,7 @@ import { dvMainStoreWithOut } from '@/store/modules/data-visualization/dvMain'
|
||||
import { snapshotStoreWithOut } from '@/store/modules/data-visualization/snapshot'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { nextTick, onMounted, ref } from 'vue'
|
||||
import { ElFormItem } from 'element-plus-secondary'
|
||||
import { ElFormItem, ElIcon } from 'element-plus-secondary'
|
||||
|
||||
import { merge, cloneDeep } from 'lodash-es'
|
||||
import { useEmitt } from '@/hooks/web/useEmitt'
|
||||
@ -11,12 +11,20 @@ import ComponentColorSelector from '@/components/dashboard/subject-setting/dashb
|
||||
import OverallSetting from '@/components/dashboard/subject-setting/dashboard-style/OverallSetting.vue'
|
||||
import CanvasBackground from '@/components/visualization/component-background/CanvasBackground.vue'
|
||||
import SeniorStyleSetting from '@/components/dashboard/subject-setting/dashboard-style/SeniorStyleSetting.vue'
|
||||
import Icon from '../icon-custom/src/Icon.vue'
|
||||
import CanvasBaseSetting from '@/components/visualization/CanvasBaseSetting.vue'
|
||||
const dvMainStore = dvMainStoreWithOut()
|
||||
const snapshotStore = snapshotStoreWithOut()
|
||||
const { canvasStyleData, canvasViewInfo } = storeToRefs(dvMainStore)
|
||||
let canvasAttrInit = false
|
||||
|
||||
const canvasAttrActiveNames = ref(['size', 'background', 'color'])
|
||||
const canvasAttrActiveNames = ref(['size', 'baseSetting', 'background', 'color'])
|
||||
|
||||
const screenAdaptorList = [
|
||||
{ label: '宽度优先', value: 'widthFirst' },
|
||||
{ label: '高度优先', value: 'heightFirst' },
|
||||
{ label: '铺满全屏', value: 'full' }
|
||||
]
|
||||
const init = () => {
|
||||
nextTick(() => {
|
||||
canvasAttrInit = true
|
||||
@ -27,6 +35,10 @@ const onColorChange = val => {
|
||||
themeAttrChange('customAttr', 'color', val)
|
||||
}
|
||||
|
||||
const onStyleChange = () => {
|
||||
snapshotStore.recordSnapshotCache('renderChart')
|
||||
}
|
||||
|
||||
const onBaseChange = () => {
|
||||
snapshotStore.recordSnapshotCache('renderChart')
|
||||
useEmitt().emitter.emit('initScroll')
|
||||
@ -105,8 +117,39 @@ onMounted(() => {
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row v-if="canvasStyleData.screenAdaptor">
|
||||
<el-form-item style="margin-top: 16px">
|
||||
<span class="form-item-scroll"> 缩放方式 </span>
|
||||
<el-tooltip class="item" effect="dark" placement="top">
|
||||
<template #content>
|
||||
<div>预览时生效</div>
|
||||
</template>
|
||||
<el-icon class="hint-icon--dark">
|
||||
<Icon name="icon_info_outlined" />
|
||||
</el-icon>
|
||||
</el-tooltip>
|
||||
<el-select
|
||||
style="margin: 0 0 0 8px; flex: 1"
|
||||
effect="dark"
|
||||
v-model="canvasStyleData.screenAdaptor"
|
||||
@change="onStyleChange"
|
||||
size="small"
|
||||
>
|
||||
<el-option
|
||||
v-for="option in screenAdaptorList"
|
||||
size="small"
|
||||
:key="option.value"
|
||||
:label="option.label"
|
||||
:value="option.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-collapse-item>
|
||||
<el-collapse-item effect="dark" title="基础配置" name="baseSetting">
|
||||
<canvas-base-setting themes="dark"></canvas-base-setting>
|
||||
</el-collapse-item>
|
||||
<el-collapse-item effect="dark" title="背景" name="background">
|
||||
<canvas-background themes="dark"></canvas-background>
|
||||
</el-collapse-item>
|
||||
@ -129,6 +172,10 @@ onMounted(() => {
|
||||
</template>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.form-item-scroll {
|
||||
font-size: 12px;
|
||||
color: @canvas-main-font-color-dark;
|
||||
}
|
||||
:deep(.ed-collapse-item) {
|
||||
&:first-child {
|
||||
.ed-collapse-item__header {
|
||||
@ -358,4 +405,8 @@ onMounted(() => {
|
||||
border-bottom: none;
|
||||
}
|
||||
}
|
||||
|
||||
.hint-icon--dark {
|
||||
color: #a6a6a6;
|
||||
}
|
||||
</style>
|
||||
|
@ -28,6 +28,7 @@ import DeFullscreen from '@/components/visualization/common/DeFullscreen.vue'
|
||||
import DeAppApply from '@/views/common/DeAppApply.vue'
|
||||
import { useEmitt } from '@/hooks/web/useEmitt'
|
||||
import { useUserStoreWithOut } from '@/store/modules/user'
|
||||
import TabsGroup from '@/custom-component/component-group/TabsGroup.vue'
|
||||
let nameEdit = ref(false)
|
||||
let inputName = ref('')
|
||||
let nameInput = ref(null)
|
||||
@ -332,6 +333,9 @@ const fullScreenPreview = () => {
|
||||
>
|
||||
<media-group></media-group>
|
||||
</component-group>
|
||||
<component-group is-label :base-width="115" icon-name="dv-tab" title="Tab">
|
||||
<tabs-group :dv-model="dvModel"></tabs-group>
|
||||
</component-group>
|
||||
<component-group is-label :base-width="215" icon-name="dv-more-com" title="更多">
|
||||
<more-com-group></more-com-group>
|
||||
</component-group>
|
||||
|
@ -29,7 +29,7 @@ import {
|
||||
findDragComponent,
|
||||
findNewComponent,
|
||||
isDashboard,
|
||||
isGroupCanvas,
|
||||
isGroupOrTabCanvas,
|
||||
isMainCanvas,
|
||||
isSameCanvas
|
||||
} from '@/utils/canvasUtils'
|
||||
@ -42,9 +42,9 @@ 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'
|
||||
import { activeWatermarkCheckUser } from '@/components/watermark/watermark'
|
||||
import PopArea from '@/custom-component/pop-area/Component.vue'
|
||||
import DatasetParamsComponent from '@/components/visualization/DatasetParamsComponent.vue'
|
||||
|
||||
const snapshotStore = snapshotStoreWithOut()
|
||||
const dvMainStore = dvMainStoreWithOut()
|
||||
@ -202,7 +202,20 @@ const height = ref(0)
|
||||
const isShowArea = ref(false)
|
||||
const svgFilterAttrs = ['width', 'height', 'top', 'left', 'rotate', 'backgroundColor']
|
||||
const commonFilterAttrs = ['width', 'height', 'top', 'left', 'rotate']
|
||||
const commonFilterAttrsFilterBorder = [
|
||||
'width',
|
||||
'height',
|
||||
'top',
|
||||
'left',
|
||||
'rotate',
|
||||
'borderActive',
|
||||
'borderWidth',
|
||||
'borderRadius',
|
||||
'borderStyle',
|
||||
'borderColor'
|
||||
]
|
||||
const userViewEnlargeRef = ref(null)
|
||||
const customDatasetParamsRef = ref(null)
|
||||
const linkJumpRef = ref(null)
|
||||
const linkageRef = ref(null)
|
||||
const mainDomId = ref('editor-' + canvasId.value)
|
||||
@ -239,32 +252,7 @@ const initWatermark = (waterDomId = 'editor-canvas-main') => {
|
||||
dvInfo.value.watermarkInfo.settingContent &&
|
||||
isMainCanvas(canvasId.value)
|
||||
) {
|
||||
const scale = dashboardActive.value ? 1 : curScale.value
|
||||
if (userInfo.value && userInfo.value.model !== 'lose') {
|
||||
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
|
||||
if (userInfo.value && userInfo.value.model !== 'lose') {
|
||||
activeWatermark(
|
||||
dvInfo.value.watermarkInfo.settingContent,
|
||||
userInfo.value,
|
||||
waterDomId,
|
||||
canvasId.value,
|
||||
dvInfo.value.selfWatermarkStatus,
|
||||
scale
|
||||
)
|
||||
}
|
||||
})
|
||||
}
|
||||
activeWatermarkCheckUser(waterDomId, canvasId.value, curScale.value)
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn('Watermarks are not supported!')
|
||||
@ -539,7 +527,7 @@ const handleContextMenu = e => {
|
||||
}
|
||||
|
||||
const getComponentStyle = style => {
|
||||
return getStyle(style, commonFilterAttrs)
|
||||
return getStyle(style, style.borderActive ? commonFilterAttrs : commonFilterAttrsFilterBorder)
|
||||
}
|
||||
|
||||
const getSvgComponentStyle = style => {
|
||||
@ -551,7 +539,8 @@ const getShapeItemShowStyle = item => {
|
||||
dvModel: dvInfo.value.type,
|
||||
cellWidth: cellWidth.value,
|
||||
cellHeight: cellHeight.value,
|
||||
curGap: curGap.value
|
||||
curGap: curGap.value,
|
||||
showPosition: 'edit'
|
||||
})
|
||||
}
|
||||
|
||||
@ -581,14 +570,14 @@ const getTextareaHeight = (element, text) => {
|
||||
}
|
||||
|
||||
const editStyle = computed(() => {
|
||||
if (dashboardActive.value || isGroupCanvas(canvasId.value)) {
|
||||
if (dashboardActive.value || isGroupOrTabCanvas(canvasId.value)) {
|
||||
return {
|
||||
width: '100%',
|
||||
height: '100%'
|
||||
}
|
||||
} else {
|
||||
const result = {
|
||||
...getCanvasStyle(canvasStyleData.value),
|
||||
...getCanvasStyle(canvasStyleData.value, canvasId.value),
|
||||
width: changeStyleWithScale(canvasStyleData.value.width) + 'px',
|
||||
height: changeStyleWithScale(canvasStyleData.value.height) + 'px'
|
||||
}
|
||||
@ -1342,10 +1331,15 @@ const userViewEnlargeOpen = (opt, item) => {
|
||||
canvasStyleData.value,
|
||||
canvasViewInfo.value[item.id],
|
||||
item,
|
||||
opt
|
||||
opt,
|
||||
{ scale: curBaseScale.value }
|
||||
)
|
||||
}
|
||||
|
||||
const datasetParamsInit = item => {
|
||||
customDatasetParamsRef.value?.optInit(item)
|
||||
}
|
||||
|
||||
const initSnapshotTimer = () => {
|
||||
snapshotTimer.value = setInterval(() => {
|
||||
snapshotStore.snapshotCatchToStore()
|
||||
@ -1531,6 +1525,7 @@ defineExpose({
|
||||
@onDragging="onDragging($event, item, index)"
|
||||
@onResizing="onResizing($event, item, index)"
|
||||
@userViewEnlargeOpen="userViewEnlargeOpen($event, item)"
|
||||
@datasetParamsInit="datasetParamsInit(item)"
|
||||
@linkJumpSetOpen="linkJumpSetOpen(item)"
|
||||
@linkageSetOpen="linkageSetOpen(item)"
|
||||
>
|
||||
@ -1596,6 +1591,7 @@ defineExpose({
|
||||
<user-view-enlarge ref="userViewEnlargeRef"></user-view-enlarge>
|
||||
<link-jump-set ref="linkJumpRef"></link-jump-set>
|
||||
<linkage-set ref="linkageRef"></linkage-set>
|
||||
<dataset-params-component ref="customDatasetParamsRef"></dataset-params-component>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -3,16 +3,32 @@ import { getStyle } from '@/utils/style'
|
||||
import eventBus from '@/utils/eventBus'
|
||||
import { ref, onMounted, toRefs, getCurrentInstance, computed, nextTick } from 'vue'
|
||||
import findComponent from '@/utils/components'
|
||||
import { downloadCanvas, imgUrlTrans } from '@/utils/imgUtils'
|
||||
import { downloadCanvas2, imgUrlTrans } from '@/utils/imgUtils'
|
||||
import ComponentEditBar from '@/components/visualization/ComponentEditBar.vue'
|
||||
import ComponentSelector from '@/components/visualization/ComponentSelector.vue'
|
||||
import { useEmitt } from '@/hooks/web/useEmitt'
|
||||
import Board from '@/components/de-board/Board.vue'
|
||||
import { dvMainStoreWithOut } from '@/store/modules/data-visualization/dvMain'
|
||||
import { activeWatermarkCheckUser, removeActiveWatermark } from '@/components/watermark/watermark'
|
||||
|
||||
const componentWrapperInnerRef = ref(null)
|
||||
const componentEditBarRef = ref(null)
|
||||
const dvMainStore = dvMainStoreWithOut()
|
||||
const downLoading = ref(false)
|
||||
|
||||
const commonFilterAttrs = ['width', 'height', 'top', 'left', 'rotate']
|
||||
const commonFilterAttrsFilterBorder = [
|
||||
'width',
|
||||
'height',
|
||||
'top',
|
||||
'left',
|
||||
'rotate',
|
||||
'borderActive',
|
||||
'borderWidth',
|
||||
'borderRadius',
|
||||
'borderStyle',
|
||||
'borderColor'
|
||||
]
|
||||
|
||||
const props = defineProps({
|
||||
active: {
|
||||
@ -90,12 +106,19 @@ const { config, showPosition, index, canvasStyleData, canvasViewInfo, dvInfo, se
|
||||
toRefs(props)
|
||||
let currentInstance
|
||||
const component = ref(null)
|
||||
const emits = defineEmits(['userViewEnlargeOpen', 'onPointClick'])
|
||||
const emits = defineEmits(['userViewEnlargeOpen', 'datasetParamsInit', 'onPointClick'])
|
||||
|
||||
const viewDemoInnerId = computed(() => 'enlarge-inner-content-' + config.value.id)
|
||||
const htmlToImage = () => {
|
||||
downLoading.value = true
|
||||
setTimeout(() => {
|
||||
const vueDom = componentWrapperInnerRef.value
|
||||
downloadCanvas('img', vueDom, '图表')
|
||||
activeWatermarkCheckUser(viewDemoInnerId.value, 'canvas-main', scale.value / 100)
|
||||
downloadCanvas2('img', vueDom, '图表', () => {
|
||||
// do callback
|
||||
removeActiveWatermark(viewDemoInnerId.value)
|
||||
downLoading.value = false
|
||||
})
|
||||
}, 200)
|
||||
}
|
||||
|
||||
@ -135,7 +158,7 @@ const getComponentStyleDefault = style => {
|
||||
if (config.value.component.includes('Svg')) {
|
||||
return getStyle(style, ['top', 'left', 'width', 'height', 'rotate', 'backgroundColor'])
|
||||
} else {
|
||||
return getStyle(style, ['top', 'left', 'width', 'height', 'rotate'])
|
||||
return getStyle(style, style.borderActive ? commonFilterAttrs : commonFilterAttrsFilterBorder)
|
||||
}
|
||||
}
|
||||
|
||||
@ -209,12 +232,12 @@ const onPointClick = param => {
|
||||
|
||||
const eventEnable = computed(
|
||||
() =>
|
||||
(['Picture', 'CanvasIcon', 'CircleShape', 'SvgTriangle', 'RectShape', 'ScrollText'].includes(
|
||||
['Picture', 'CanvasIcon', 'CircleShape', 'SvgTriangle', 'RectShape', 'ScrollText'].includes(
|
||||
config.value.component
|
||||
) ||
|
||||
config.value.innerType === 'rich-text') &&
|
||||
config.value.events &&
|
||||
config.value.events.checked
|
||||
(['indicator', 'rich-text'].includes(config.value.innerType) &&
|
||||
config.value.events &&
|
||||
config.value.events.checked)
|
||||
)
|
||||
|
||||
const onWrapperClick = e => {
|
||||
@ -243,17 +266,21 @@ const deepScale = computed(() => scale.value / 100)
|
||||
:class="showPosition + '-' + config.component"
|
||||
@mousedown="handleInnerMouseDown"
|
||||
@mouseenter="onMouseEnter"
|
||||
v-loading="downLoading"
|
||||
element-loading-text="导出中..."
|
||||
element-loading-background="rgba(255, 255, 255, 1)"
|
||||
>
|
||||
<component-edit-bar
|
||||
v-if="!showPosition.includes('canvas') && dvInfo.type === 'dashboard' && !props.isSelector"
|
||||
class="wrapper-edit-bar"
|
||||
ref="componentEditBarRef"
|
||||
:class="{ 'wrapper-edit-bar-active': active }"
|
||||
:canvas-id="canvasId"
|
||||
:index="index"
|
||||
:element="config"
|
||||
:show-position="showPosition"
|
||||
:class="{ 'wrapper-edit-bar-active': active }"
|
||||
@userViewEnlargeOpen="opt => emits('userViewEnlargeOpen', opt)"
|
||||
@datasetParamsInit="() => emits('datasetParamsInit')"
|
||||
></component-edit-bar>
|
||||
<component-selector
|
||||
v-if="
|
||||
@ -263,7 +290,12 @@ const deepScale = computed(() => scale.value / 100)
|
||||
"
|
||||
:resource-id="config.id"
|
||||
/>
|
||||
<div class="wrapper-inner" ref="componentWrapperInnerRef" :style="componentBackgroundStyle">
|
||||
<div
|
||||
class="wrapper-inner"
|
||||
ref="componentWrapperInnerRef"
|
||||
:id="viewDemoInnerId"
|
||||
:style="componentBackgroundStyle"
|
||||
>
|
||||
<!--边框背景-->
|
||||
<Board
|
||||
v-if="svgInnerEnable"
|
||||
|
@ -3,23 +3,25 @@ import { getCanvasStyle, getShapeItemStyle } from '@/utils/style'
|
||||
import ComponentWrapper from './ComponentWrapper.vue'
|
||||
import { changeStyleWithScale } from '@/utils/translate'
|
||||
import { computed, nextTick, ref, toRefs, watch, onBeforeUnmount, onMounted } from 'vue'
|
||||
import { changeRefComponentsSizeWithScale } from '@/utils/changeComponentsSizeWithScale'
|
||||
import { changeRefComponentsSizeWithScalePoint } from '@/utils/changeComponentsSizeWithScale'
|
||||
import { dvMainStoreWithOut } from '@/store/modules/data-visualization/dvMain'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import elementResizeDetectorMaker from 'element-resize-detector'
|
||||
import UserViewEnlarge from '@/components/visualization/UserViewEnlarge.vue'
|
||||
import CanvasOptBar from '@/components/visualization/CanvasOptBar.vue'
|
||||
import { isDashboard, isMainCanvas, refreshOtherComponent } from '@/utils/canvasUtils'
|
||||
import { activeWatermark } from '@/components/watermark/watermark'
|
||||
import { personInfoApi } from '@/api/user'
|
||||
import { activeWatermarkCheckUser } from '@/components/watermark/watermark'
|
||||
import router from '@/router'
|
||||
import { XpackComponent } from '@/components/plugin'
|
||||
import PopArea from '@/custom-component/pop-area/Component.vue'
|
||||
import CanvasFilterBtn from '@/custom-component/canvas-filter-btn/Component.vue'
|
||||
import { useEmitt } from '@/hooks/web/useEmitt'
|
||||
import DatasetParamsComponent from '@/components/visualization/DatasetParamsComponent.vue'
|
||||
const dvMainStore = dvMainStoreWithOut()
|
||||
const { pcMatrixCount, curComponent, mobileInPc, canvasState } = storeToRefs(dvMainStore)
|
||||
const openHandler = ref(null)
|
||||
const customDatasetParamsRef = ref(null)
|
||||
const emits = defineEmits(['onResetLayout'])
|
||||
|
||||
const props = defineProps({
|
||||
canvasStyleData: {
|
||||
@ -83,8 +85,8 @@ const {
|
||||
outerScale
|
||||
} = toRefs(props)
|
||||
const domId = 'preview-' + canvasId.value
|
||||
const scaleWidth = ref(100)
|
||||
const scaleHeight = ref(100)
|
||||
const scaleWidthPoint = ref(100)
|
||||
const scaleHeightPoint = ref(100)
|
||||
const scaleMin = ref(100)
|
||||
const previewCanvas = ref(null)
|
||||
const cellWidth = ref(10)
|
||||
@ -92,11 +94,15 @@ const cellHeight = ref(10)
|
||||
const userViewEnlargeRef = ref(null)
|
||||
const searchCount = ref(0)
|
||||
const refreshTimer = ref(null)
|
||||
const userInfo = ref(null)
|
||||
|
||||
const renderReady = ref(false)
|
||||
const dashboardActive = computed(() => {
|
||||
return dvInfo.value.type === 'dashboard'
|
||||
})
|
||||
|
||||
// 大屏是否保持宽高比例 非全屏 full 都需要保持宽高比例
|
||||
const dataVKeepRadio = computed(() => {
|
||||
return canvasStyleData.value.screenAdaptor !== 'full'
|
||||
})
|
||||
const isReport = computed(() => {
|
||||
return !!router.currentRoute.value.query?.report
|
||||
})
|
||||
@ -117,8 +123,15 @@ const canvasStyle = computed(() => {
|
||||
? downloadStatus.value
|
||||
? getDownloadStatusMainHeight()
|
||||
: '100%'
|
||||
: changeStyleWithScale(canvasStyleData.value?.height, scaleMin.value) + 'px'
|
||||
: !canvasStyleData.value?.screenAdaptor ||
|
||||
canvasStyleData.value?.screenAdaptor === 'widthFirst'
|
||||
? changeStyleWithScale(canvasStyleData.value?.height, scaleMin.value) + 'px'
|
||||
: '100%'
|
||||
}
|
||||
style['width'] =
|
||||
!dashboardActive.value && canvasStyleData.value?.screenAdaptor === 'heightFirst'
|
||||
? changeStyleWithScale(canvasStyleData.value?.width, scaleHeightPoint.value) + 'px'
|
||||
: '100%'
|
||||
}
|
||||
if (!dashboardActive.value) {
|
||||
style['overflow-y'] = 'hidden'
|
||||
@ -179,11 +192,11 @@ const resetLayout = () => {
|
||||
//div容器获取tableBox.value.clientWidth
|
||||
let canvasWidth = previewCanvas.value.clientWidth
|
||||
let canvasHeight = previewCanvas.value.clientHeight
|
||||
scaleWidth.value = Math.floor((canvasWidth * 100) / canvasStyleData.value.width)
|
||||
scaleHeight.value = Math.floor((canvasHeight * 100) / canvasStyleData.value.height)
|
||||
scaleWidthPoint.value = (canvasWidth * 100) / canvasStyleData.value.width
|
||||
scaleHeightPoint.value = (canvasHeight * 100) / canvasStyleData.value.height
|
||||
scaleMin.value = isDashboard()
|
||||
? Math.min(scaleWidth.value, scaleHeight.value)
|
||||
: (canvasWidth * 100) / canvasStyleData.value.width
|
||||
? Math.floor(Math.min(scaleWidthPoint.value, scaleHeightPoint.value))
|
||||
: scaleWidthPoint.value
|
||||
if (dashboardActive.value) {
|
||||
cellWidth.value = canvasWidth / pcMatrixCount.value.x
|
||||
cellHeight.value = canvasHeight / pcMatrixCount.value.y
|
||||
@ -191,12 +204,18 @@ const resetLayout = () => {
|
||||
? scaleMin.value * 1.2
|
||||
: outerScale.value * 100
|
||||
} else {
|
||||
changeRefComponentsSizeWithScale(
|
||||
// 需要保持宽高比例时 高度伸缩和宽度伸缩保持一致 否则 高度伸缩单独计算
|
||||
const scaleMinHeight = dataVKeepRadio.value ? scaleMin.value : scaleHeightPoint.value
|
||||
changeRefComponentsSizeWithScalePoint(
|
||||
baseComponentData.value,
|
||||
canvasStyleData.value,
|
||||
scaleMin.value
|
||||
scaleMin.value,
|
||||
scaleMinHeight
|
||||
)
|
||||
scaleMin.value = isMainCanvas(canvasId.value) ? scaleMin.value : outerScale.value * 100
|
||||
}
|
||||
renderReady.value = true
|
||||
emits('onResetLayout')
|
||||
}
|
||||
})
|
||||
}
|
||||
@ -250,31 +269,7 @@ const refreshDataV = () => {
|
||||
|
||||
const initWatermark = (waterDomId = 'preview-canvas-main') => {
|
||||
if (dvInfo.value.watermarkInfo && isMainCanvas(canvasId.value)) {
|
||||
if (userInfo.value && userInfo.value.model !== 'lose') {
|
||||
activeWatermark(
|
||||
dvInfo.value.watermarkInfo.settingContent,
|
||||
userInfo.value,
|
||||
waterDomId,
|
||||
canvasId.value,
|
||||
dvInfo.value.selfWatermarkStatus,
|
||||
scaleMin.value / 100
|
||||
)
|
||||
} else {
|
||||
const method = personInfoApi
|
||||
method().then(res => {
|
||||
userInfo.value = res.data
|
||||
if (userInfo.value && userInfo.value.model !== 'lose') {
|
||||
activeWatermark(
|
||||
dvInfo.value.watermarkInfo.settingContent,
|
||||
userInfo.value,
|
||||
waterDomId,
|
||||
canvasId.value,
|
||||
dvInfo.value.selfWatermarkStatus,
|
||||
scaleMin.value / 100
|
||||
)
|
||||
}
|
||||
})
|
||||
}
|
||||
activeWatermarkCheckUser(waterDomId, canvasId.value, scaleMin.value / 100)
|
||||
}
|
||||
}
|
||||
|
||||
@ -318,7 +313,8 @@ const userViewEnlargeOpen = (opt, item) => {
|
||||
canvasStyleData.value,
|
||||
canvasViewInfo.value[item.id],
|
||||
item,
|
||||
opt
|
||||
opt,
|
||||
{ scale: scaleMin.value / 100 }
|
||||
)
|
||||
}
|
||||
const handleMouseDown = () => {
|
||||
@ -360,8 +356,15 @@ const popAreaAvailable = computed(
|
||||
)
|
||||
|
||||
const filterBtnShow = computed(
|
||||
() => popAreaAvailable.value && popComponentData.value && popComponentData.value.length > 0
|
||||
() =>
|
||||
popAreaAvailable.value &&
|
||||
popComponentData.value &&
|
||||
popComponentData.value.length > 0 &&
|
||||
canvasStyleData.value.popupButtonAvailable
|
||||
)
|
||||
const datasetParamsInit = item => {
|
||||
customDatasetParamsRef.value?.optInit(item)
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
restore
|
||||
@ -396,27 +399,31 @@ defineExpose({
|
||||
:canvas-style-data="canvasStyleData"
|
||||
:component-data="baseComponentData"
|
||||
></canvas-opt-bar>
|
||||
<ComponentWrapper
|
||||
v-for="(item, index) in baseComponentData"
|
||||
v-show="item.isShow"
|
||||
:active="item.id === (curComponent || {})['id']"
|
||||
:canvas-id="canvasId"
|
||||
:canvas-style-data="canvasStyleData"
|
||||
:dv-info="dvInfo"
|
||||
:canvas-view-info="canvasViewInfo"
|
||||
:view-info="canvasViewInfo[item.id]"
|
||||
:key="index"
|
||||
:config="item"
|
||||
:style="getShapeItemShowStyle(item)"
|
||||
:show-position="showPosition"
|
||||
:search-count="searchCount"
|
||||
:scale="mobileInPc ? 100 : scaleMin"
|
||||
:is-selector="props.isSelector"
|
||||
@userViewEnlargeOpen="userViewEnlargeOpen($event, item)"
|
||||
@onPointClick="onPointClick"
|
||||
/>
|
||||
<template v-if="renderReady">
|
||||
<ComponentWrapper
|
||||
v-for="(item, index) in baseComponentData"
|
||||
v-show="item.isShow"
|
||||
:active="item.id === (curComponent || {})['id']"
|
||||
:canvas-id="canvasId"
|
||||
:canvas-style-data="canvasStyleData"
|
||||
:dv-info="dvInfo"
|
||||
:canvas-view-info="canvasViewInfo"
|
||||
:view-info="canvasViewInfo[item.id]"
|
||||
:key="index"
|
||||
:config="item"
|
||||
:style="getShapeItemShowStyle(item)"
|
||||
:show-position="showPosition"
|
||||
:search-count="searchCount"
|
||||
:scale="mobileInPc ? 100 : scaleMin"
|
||||
:is-selector="props.isSelector"
|
||||
@userViewEnlargeOpen="userViewEnlargeOpen($event, item)"
|
||||
@datasetParamsInit="datasetParamsInit(item)"
|
||||
@onPointClick="onPointClick"
|
||||
/>
|
||||
</template>
|
||||
<user-view-enlarge ref="userViewEnlargeRef"></user-view-enlarge>
|
||||
</div>
|
||||
<dataset-params-component ref="customDatasetParamsRef"></dataset-params-component>
|
||||
<XpackComponent ref="openHandler" jsname="L2NvbXBvbmVudC9lbWJlZGRlZC1pZnJhbWUvT3BlbkhhbmRsZXI=" />
|
||||
</template>
|
||||
|
||||
|
@ -4,6 +4,9 @@
|
||||
:class="{ 'shape-group-area': isGroupArea }"
|
||||
ref="shapeInnerRef"
|
||||
:id="domId"
|
||||
v-loading="downLoading"
|
||||
element-loading-text="导出中..."
|
||||
element-loading-background="rgba(255, 255, 255, 1)"
|
||||
@dblclick="handleDbClick"
|
||||
>
|
||||
<div v-if="showCheck" class="del-from-mobile" @click="delFromMobile">
|
||||
@ -31,12 +34,14 @@
|
||||
:show-position="showPosition"
|
||||
:canvas-id="canvasId"
|
||||
@userViewEnlargeOpen="userViewEnlargeOpen"
|
||||
@datasetParamsInit="datasetParamsInit"
|
||||
@linkJumpSetOpen="linkJumpSetOpen"
|
||||
@linkageSetOpen="linkageSetOpen"
|
||||
></component-edit-bar>
|
||||
<div
|
||||
class="shape-inner"
|
||||
ref="componentInnerRef"
|
||||
:id="viewDemoInnerId"
|
||||
:style="componentBackgroundStyle"
|
||||
@click="selectCurComponent"
|
||||
@mousedown="handleInnerMouseDownOnShape"
|
||||
@ -59,7 +64,11 @@
|
||||
:style="getPointStyle(item)"
|
||||
@mousedown="handleMouseDownOnPoint(item, $event)"
|
||||
></div>
|
||||
<div class="shape-shadow" v-show="batchOptFlag" @mousedown="batchSelected"></div>
|
||||
<div
|
||||
class="shape-shadow"
|
||||
v-show="batchOptFlag && element.component !== 'DeTabs'"
|
||||
@mousedown="batchSelected"
|
||||
></div>
|
||||
<template v-if="boardMoveActive">
|
||||
<div
|
||||
v-show="!element.editing"
|
||||
@ -100,14 +109,15 @@ import { snapshotStoreWithOut } from '@/store/modules/data-visualization/snapsho
|
||||
import { contextmenuStoreWithOut } from '@/store/modules/data-visualization/contextmenu'
|
||||
import { composeStoreWithOut } from '@/store/modules/data-visualization/compose'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { downloadCanvas, imgUrlTrans } from '@/utils/imgUtils'
|
||||
import { downloadCanvas2, imgUrlTrans } from '@/utils/imgUtils'
|
||||
import Icon from '@/components/icon-custom/src/Icon.vue'
|
||||
import ComponentEditBar from '@/components/visualization/ComponentEditBar.vue'
|
||||
import { useEmitt } from '@/hooks/web/useEmitt'
|
||||
import ComposeShow from '@/components/data-visualization/canvas/ComposeShow.vue'
|
||||
import { groupSizeStyleAdaptor, groupStyleRevert } from '@/utils/style'
|
||||
import { isGroupCanvas, isMainCanvas } from '@/utils/canvasUtils'
|
||||
import { isDashboard, isGroupCanvas, isMainCanvas, isTabCanvas } from '@/utils/canvasUtils'
|
||||
import Board from '@/components/de-board/Board.vue'
|
||||
import { activeWatermarkCheckUser, removeActiveWatermark } from '@/components/watermark/watermark'
|
||||
const dvMainStore = dvMainStoreWithOut()
|
||||
const snapshotStore = snapshotStoreWithOut()
|
||||
const contextmenuStore = contextmenuStoreWithOut()
|
||||
@ -116,6 +126,8 @@ const parentNode = ref(null)
|
||||
const shapeInnerRef = ref(null)
|
||||
const componentInnerRef = ref(null)
|
||||
const componentEditBarRef = ref(null)
|
||||
const downLoading = ref(false)
|
||||
const viewDemoInnerId = computed(() => 'enlarge-inner-shape-' + element.value.id)
|
||||
|
||||
const {
|
||||
curComponent,
|
||||
@ -132,6 +144,7 @@ const {
|
||||
const { editorMap, areaData, isCtrlOrCmdDown } = storeToRefs(composeStore)
|
||||
const emit = defineEmits([
|
||||
'userViewEnlargeOpen',
|
||||
'datasetParamsInit',
|
||||
'onStartResize',
|
||||
'onStartMove',
|
||||
'onDragging',
|
||||
@ -324,6 +337,10 @@ const userViewEnlargeOpen = opt => {
|
||||
emit('userViewEnlargeOpen', opt)
|
||||
}
|
||||
|
||||
const datasetParamsInit = opt => {
|
||||
emit('datasetParamsInit', opt)
|
||||
}
|
||||
|
||||
const getPointStyle = point => {
|
||||
let { width, height } = defaultStyle.value
|
||||
const { sizeX, sizeY } = element.value
|
||||
@ -428,12 +445,7 @@ const handleInnerMouseDownOnShape = e => {
|
||||
if (!canvasActive.value) {
|
||||
return
|
||||
}
|
||||
if (batchOptFlag.value) {
|
||||
componentEditBarRef.value.batchOptCheckOut()
|
||||
e.stopPropagation()
|
||||
e.preventDefault()
|
||||
return
|
||||
}
|
||||
batchSelected(e)
|
||||
// ctrl or command 按下时 鼠标点击为选择需要组合的组件(取消需要组合的组件在ComposeShow组件中)
|
||||
if (isCtrlOrCmdDown.value && !areaData.value.components.includes(element)) {
|
||||
areaDataPush(element.value)
|
||||
@ -477,6 +489,10 @@ const handleMouseDownOnShape = e => {
|
||||
const pos = { ...defaultStyle.value }
|
||||
const startY = e.clientY
|
||||
const startX = e.clientX
|
||||
|
||||
const offsetY = e.offsetY
|
||||
const offsetX = e.offsetX
|
||||
|
||||
// 如果直接修改属性,值的类型会变为字符串,所以要转为数值型
|
||||
const startTop = Number(pos['top'])
|
||||
const startLeft = Number(pos['left'])
|
||||
@ -490,6 +506,10 @@ const handleMouseDownOnShape = e => {
|
||||
//当前组件宽高 定位
|
||||
const componentWidth = shapeInnerRef.value.offsetWidth
|
||||
const componentHeight = shapeInnerRef.value.offsetHeight
|
||||
let outerTabDom = isTabCanvas(canvasId.value)
|
||||
? document.getElementById('shape-id-' + canvasId.value.split('--')[0])
|
||||
: null
|
||||
const curDom = document.getElementById(domId.value)
|
||||
const move = moveEvent => {
|
||||
hasMove = true
|
||||
const curX = moveEvent.clientX
|
||||
@ -499,6 +519,7 @@ const handleMouseDownOnShape = e => {
|
||||
pos['top'] = top
|
||||
pos['left'] = left
|
||||
// 非主画布非分组画布的情况 需要检测是否从Tab中移除组件(向左移除30px 或者向右移除30px)
|
||||
// 大屏和仪表板暂时做位置算法区分 仪表板暂时使用curX 因为缩放的影响 大屏使用 tab位置 + 组件位置(相对内部画布)+初始触发点
|
||||
if (
|
||||
!isMainCanvas(canvasId.value) &&
|
||||
!isGroupCanvas(canvasId.value) &&
|
||||
@ -506,8 +527,14 @@ const handleMouseDownOnShape = e => {
|
||||
) {
|
||||
contentDisplay.value = false
|
||||
dvMainStore.setMousePointShadowMap({
|
||||
mouseX: curX,
|
||||
mouseY: curY,
|
||||
mouseX:
|
||||
!isDashboard() && outerTabDom
|
||||
? outerTabDom.offsetLeft + curDom.offsetLeft + offsetX
|
||||
: curX,
|
||||
mouseY:
|
||||
!isDashboard() && outerTabDom
|
||||
? outerTabDom.offsetTop + curDom.offsetTop + offsetY + 100
|
||||
: curY,
|
||||
width: componentWidth,
|
||||
height: componentHeight
|
||||
})
|
||||
@ -518,7 +545,7 @@ const handleMouseDownOnShape = e => {
|
||||
contentDisplay.value = true
|
||||
}
|
||||
// 仪表板进行Tab碰撞检查
|
||||
dashboardActive.value && tabMoveInCheck()
|
||||
tabMoveInCheck()
|
||||
// 仪表板模式 会造成移动现象 当检测组件正在碰撞有效区内或者移入有效区内 则周边组件不进行移动
|
||||
if (
|
||||
dashboardActive.value &&
|
||||
@ -529,15 +556,16 @@ const handleMouseDownOnShape = e => {
|
||||
}
|
||||
|
||||
//如果当前组件是Group分组 则要进行内部组件深度计算
|
||||
element.value.component === 'Group' && groupSizeStyleAdaptor(element.value)
|
||||
if (['DeTabs', 'Group'].includes(element.value.component)) {
|
||||
groupSizeStyleAdaptor(element.value)
|
||||
}
|
||||
//如果当前画布是Group内部画布 则对应组件定位在resize时要还原到groupStyle中
|
||||
if (isGroupCanvas(canvasId.value)) {
|
||||
if (isGroupCanvas(canvasId.value) || isTabCanvas(canvasId.value)) {
|
||||
groupStyleRevert(element.value, {
|
||||
width: parentNode.value.offsetWidth,
|
||||
height: parentNode.value.offsetHeight
|
||||
})
|
||||
}
|
||||
|
||||
// 防止首次组件在tab旁边无法触发矩阵移动
|
||||
if (isFirst) {
|
||||
isFirst = false
|
||||
@ -718,10 +746,12 @@ const handleMouseDownOnPoint = (point, e) => {
|
||||
// 矩阵逻辑 如果当前是仪表板(矩阵模式)则要进行矩阵重排
|
||||
dashboardActive.value && emit('onResizing', moveEvent)
|
||||
element.value['resizing'] = true
|
||||
//如果当前组件是Group分组 则要进行内部组件深度计算
|
||||
element.value.component === 'Group' && groupSizeStyleAdaptor(element.value)
|
||||
//如果当前组件是Group分组或者Tab 则要进行内部组件深度计算
|
||||
if (['DeTabs', 'Group'].includes(element.value.component)) {
|
||||
groupSizeStyleAdaptor(element.value)
|
||||
}
|
||||
//如果当前画布是Group内部画布 则对应组件定位在resize时要还原到groupStyle中
|
||||
if (isGroupCanvas(canvasId.value)) {
|
||||
if (isGroupCanvas(canvasId.value) || isTabCanvas(canvasId.value)) {
|
||||
groupStyleRevert(element.value, {
|
||||
width: parentNode.value.offsetWidth,
|
||||
height: parentNode.value.offsetHeight
|
||||
@ -947,8 +977,14 @@ const dragCollision = computed(() => {
|
||||
})
|
||||
|
||||
const htmlToImage = () => {
|
||||
downLoading.value = true
|
||||
setTimeout(() => {
|
||||
downloadCanvas('img', componentInnerRef.value, '图表')
|
||||
activeWatermarkCheckUser(viewDemoInnerId.value, 'canvas-main', scale.value)
|
||||
downloadCanvas2('img', componentInnerRef.value, '图表', () => {
|
||||
// do callback
|
||||
removeActiveWatermark(viewDemoInnerId.value)
|
||||
downLoading.value = false
|
||||
})
|
||||
}, 200)
|
||||
}
|
||||
|
||||
|
@ -35,6 +35,9 @@ const handleListeners = () => {
|
||||
const toggleRowSelection = row => {
|
||||
table.value.toggleRowSelection(row, true)
|
||||
}
|
||||
const toggleAllSelection = () => {
|
||||
table.value.toggleAllSelection()
|
||||
}
|
||||
const clearSelection = () => {
|
||||
table.value.clearSelection()
|
||||
}
|
||||
@ -111,6 +114,7 @@ watch(
|
||||
defineExpose({
|
||||
toggleRowSelection,
|
||||
clearSelection,
|
||||
toggleAllSelection,
|
||||
multipleSelectionAll
|
||||
})
|
||||
</script>
|
||||
|
@ -3,11 +3,16 @@ import { computed } from 'vue'
|
||||
import { propTypes } from '@/utils/propTypes'
|
||||
|
||||
import _401 from '@/assets/svg/401.svg'
|
||||
import icon_file_font_colorful from '@/assets/svg/icon_file-font_colorful.svg'
|
||||
import relation_arrow_icon from '@/assets/svg/relation_arrow_icon.svg'
|
||||
import icon_data_visualization from '@/assets/svg/icon_data-visualization.svg'
|
||||
import icon_notification_filled from '@/assets/svg/icon_notification_filled.svg'
|
||||
import calculate from '@/assets/svg/calculate.svg'
|
||||
import _403 from '@/assets/svg/403.svg'
|
||||
import APIDs from '@/assets/svg/API-ds.svg'
|
||||
import Apache_Hive from '@/assets/svg/Apache Hive.svg'
|
||||
import Checkbox from '@/assets/svg/Checkbox.svg'
|
||||
import clock from '@/assets/svg/clock.svg'
|
||||
import DM from '@/assets/svg/DM.svg'
|
||||
import DataEase from '@/assets/svg/DataEase.svg'
|
||||
import Elasticsearch from '@/assets/svg/Elasticsearch.svg'
|
||||
@ -219,6 +224,9 @@ import editIn from '@/assets/svg/edit-in.svg'
|
||||
import edit from '@/assets/svg/edit.svg'
|
||||
import emailTask from '@/assets/svg/email-task.svg'
|
||||
import embedded from '@/assets/svg/embedded.svg'
|
||||
import association from '@/assets/svg/association.svg'
|
||||
import threshold from '@/assets/svg/threshold.svg'
|
||||
import threshold_full from '@/assets/svg/threshold_full.svg'
|
||||
import example from '@/assets/svg/example.svg'
|
||||
import exclamationmark from '@/assets/svg/exclamationmark.svg'
|
||||
import exclamationmark2 from '@/assets/svg/exclamationmark2.svg'
|
||||
@ -229,6 +237,7 @@ import field_location from '@/assets/svg/field_location.svg'
|
||||
import field_text from '@/assets/svg/field_text.svg'
|
||||
import field_time from '@/assets/svg/field_time.svg'
|
||||
import field_value from '@/assets/svg/field_value.svg'
|
||||
import field_url from '@/assets/svg/field_url.svg'
|
||||
import filterCenter from '@/assets/svg/filter-center.svg'
|
||||
import filterHCenter from '@/assets/svg/filter-h-center.svg'
|
||||
import filterHLeft from '@/assets/svg/filter-h-left.svg'
|
||||
@ -377,6 +386,7 @@ import icon_moreVertical_outlined from '@/assets/svg/icon_more-vertical_outlined
|
||||
import icon_more_outlined from '@/assets/svg/icon_more_outlined.svg'
|
||||
import icon_newItem_outlined from '@/assets/svg/icon_new-item_outlined.svg'
|
||||
import icon_number_outlined from '@/assets/svg/icon_number_outlined.svg'
|
||||
import icon_url_outlined from '@/assets/svg/icon_url_outlined.svg'
|
||||
import icon_operationAnalysis_outlined from '@/assets/svg/icon_operation-analysis_outlined.svg'
|
||||
import icon_ordeList_outlined from '@/assets/svg/icon_orde-list_outlined.svg'
|
||||
import icon_organization_outlined from '@/assets/svg/icon_organization_outlined.svg'
|
||||
@ -667,8 +677,13 @@ import icon_radio_outlined from '@/assets/svg/icon_radio_outlined.svg'
|
||||
import icon_single_line_outlined from '@/assets/svg/icon_single-line_outlined.svg'
|
||||
import icon_todo_outlined from '@/assets/svg/icon_todo_outlined.svg'
|
||||
import icon_file_doc_colorful from '@/assets/svg/icon_file-doc_colorful.svg'
|
||||
import icon_font from '@/assets/svg/icon_font.svg'
|
||||
const iconMap = {
|
||||
'401': _401,
|
||||
icon_file_font_colorful,
|
||||
relation_arrow_icon,
|
||||
icon_data_visualization,
|
||||
icon_notification_filled,
|
||||
'403': _403,
|
||||
'API-ds': APIDs,
|
||||
'Apache Hive': Apache_Hive,
|
||||
@ -884,6 +899,9 @@ const iconMap = {
|
||||
edit: edit,
|
||||
'email-task': emailTask,
|
||||
embedded: embedded,
|
||||
association: association,
|
||||
threshold: threshold,
|
||||
threshold_full,
|
||||
example: example,
|
||||
exclamationmark: exclamationmark,
|
||||
exclamationmark2: exclamationmark2,
|
||||
@ -894,6 +912,7 @@ const iconMap = {
|
||||
field_text: field_text,
|
||||
field_time: field_time,
|
||||
field_value: field_value,
|
||||
field_url: field_url,
|
||||
'filter-center': filterCenter,
|
||||
'filter-h-center': filterHCenter,
|
||||
'filter-h-left': filterHLeft,
|
||||
@ -1042,6 +1061,7 @@ const iconMap = {
|
||||
icon_more_outlined: icon_more_outlined,
|
||||
'icon_new-item_outlined': icon_newItem_outlined,
|
||||
icon_number_outlined: icon_number_outlined,
|
||||
icon_url_outlined: icon_url_outlined,
|
||||
'icon_operation-analysis_outlined': icon_operationAnalysis_outlined,
|
||||
'icon_orde-list_outlined': icon_ordeList_outlined,
|
||||
icon_organization_outlined: icon_organization_outlined,
|
||||
@ -1332,7 +1352,9 @@ const iconMap = {
|
||||
'word-cloud-origin': wordCloudOrigin,
|
||||
'word-cloud': wordCloud,
|
||||
calculate,
|
||||
'icon_file-doc_colorful': icon_file_doc_colorful
|
||||
'icon_file-doc_colorful': icon_file_doc_colorful,
|
||||
icon_font,
|
||||
clock
|
||||
}
|
||||
|
||||
const props = defineProps({
|
||||
|
127
core/core-frontend/src/components/relation-chart/index.vue
Normal file
@ -0,0 +1,127 @@
|
||||
<script lang="ts" setup>
|
||||
import { ref, reactive, nextTick } from 'vue'
|
||||
import { XpackComponent } from '@/components/plugin'
|
||||
import { cloneDeep } from 'lodash-es'
|
||||
import {
|
||||
getDatasourceRelationship as getDatasourceRelation,
|
||||
getDatasetRelationship as getDatasetRelation
|
||||
} from '@/api/relation/index'
|
||||
const relationDrawer = ref(false)
|
||||
const chartSize = reactive({
|
||||
height: 0,
|
||||
width: 0
|
||||
})
|
||||
const getChartSize = () => {
|
||||
const dom = document.querySelector('.relation-drawer_content')
|
||||
if (!dom) return
|
||||
Object.assign(chartSize, {
|
||||
height: dom.offsetHeight + 'px',
|
||||
width: dom.offsetWidth + 'px'
|
||||
})
|
||||
}
|
||||
|
||||
const consanguinity = ref()
|
||||
let resRef = null
|
||||
const getDatasourceRelationship = id => {
|
||||
getDatasourceRelation(id)
|
||||
.then(res => {
|
||||
resRef = cloneDeep(res || {})
|
||||
})
|
||||
.finally(() => {
|
||||
tableLoading.value = false
|
||||
nextTick(() => {
|
||||
consanguinity.value.invokeMethod({
|
||||
methodName: 'getChartData',
|
||||
args: {
|
||||
info: current,
|
||||
res: resRef
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
}
|
||||
const getDatasetRelationship = id => {
|
||||
getDatasetRelation(id)
|
||||
.then(res => {
|
||||
resRef = cloneDeep(res || {})
|
||||
})
|
||||
.finally(() => {
|
||||
tableLoading.value = false
|
||||
nextTick(() => {
|
||||
consanguinity.value.invokeMethod({
|
||||
methodName: 'getChartData',
|
||||
args: {
|
||||
info: current,
|
||||
res: resRef
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
const current = {
|
||||
queryType: '',
|
||||
num: '',
|
||||
label: ''
|
||||
}
|
||||
const tableLoading = ref(false)
|
||||
const getChartData = obj => {
|
||||
Object.assign(current, obj || {})
|
||||
const { queryType, num } = current
|
||||
tableLoading.value = true
|
||||
relationDrawer.value = true
|
||||
nextTick(() => {
|
||||
getChartSize()
|
||||
switch (queryType) {
|
||||
case 'datasource':
|
||||
getDatasourceRelationship(num)
|
||||
break
|
||||
case 'dataset':
|
||||
getDatasetRelationship(num)
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
getChartData
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<el-drawer
|
||||
title="血缘关系图"
|
||||
v-model="relationDrawer"
|
||||
custom-class="de-relation-drawer"
|
||||
size="1200px"
|
||||
direction="rtl"
|
||||
>
|
||||
<div v-loading="tableLoading" class="relation-drawer_content">
|
||||
<XpackComponent
|
||||
ref="consanguinity"
|
||||
:chart-size="chartSize"
|
||||
:current="current"
|
||||
detailDisabled
|
||||
jsname="L21lbnUvc3lzdGVtL2Fzc29jaWF0aW9uL0NoYXJ0"
|
||||
/>
|
||||
</div>
|
||||
</el-drawer>
|
||||
</template>
|
||||
|
||||
<style lang="less">
|
||||
.de-relation-drawer {
|
||||
.ed-drawer__body {
|
||||
padding-bottom: 24px;
|
||||
}
|
||||
.relation-drawer_content {
|
||||
border: 1px solid #dee0e3;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: #f5f6f7;
|
||||
border-radius: 4px;
|
||||
position: relative;
|
||||
}
|
||||
}
|
||||
</style>
|
@ -0,0 +1,227 @@
|
||||
<template>
|
||||
<div class="de-tinymce-container_alarm ed-textarea__inner">
|
||||
<editor class="de-tinymce-content_alarm" v-model="myValue" :id="tinymceId" :init="init" />
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { ref, toRefs, watch, onMounted, onBeforeUnmount } from 'vue'
|
||||
import { useEmitt } from '@/hooks/web/useEmitt'
|
||||
import { formatDataEaseBi } from '@/utils/url'
|
||||
import tinymce from 'tinymce/tinymce' // tinymce默认hidden,不引入不显示
|
||||
import Editor from '@tinymce/tinymce-vue' // 编辑器引入
|
||||
import 'tinymce/themes/silver/theme' // 编辑器主题
|
||||
import 'tinymce/icons/default' // 引入编辑器图标icon,不引入则不显示对应图标
|
||||
// 引入编辑器插件(基本免费插件都在这儿了)
|
||||
import 'tinymce/plugins/advlist' // 高级列表
|
||||
import 'tinymce/plugins/autolink' // 自动链接
|
||||
import 'tinymce/plugins/link' // 超链接
|
||||
import 'tinymce/plugins/image' // 插入编辑图片
|
||||
import 'tinymce/plugins/lists' // 列表插件
|
||||
import 'tinymce/plugins/charmap' // 特殊字符
|
||||
import 'tinymce/plugins/media' // 插入编辑媒体
|
||||
import 'tinymce/plugins/wordcount' // 字数统计
|
||||
import 'tinymce/plugins/table' // 表格
|
||||
import 'tinymce/plugins/contextmenu' // contextmenu
|
||||
import 'tinymce/plugins/directionality'
|
||||
import 'tinymce/plugins/nonbreaking'
|
||||
import 'tinymce/plugins/pagebreak'
|
||||
import { propTypes } from '@/utils/propTypes'
|
||||
const props = defineProps({
|
||||
modelValue: String,
|
||||
fieldList: propTypes.arrayOf(
|
||||
propTypes.shape({
|
||||
deType: propTypes.number,
|
||||
id: propTypes.string,
|
||||
name: propTypes.string,
|
||||
groupType: propTypes.string
|
||||
})
|
||||
)
|
||||
})
|
||||
const myValue = ref()
|
||||
const { modelValue } = toRefs(props)
|
||||
myValue.value = modelValue
|
||||
watch(
|
||||
() => props.modelValue,
|
||||
newValue => {
|
||||
myValue.value = newValue
|
||||
}
|
||||
)
|
||||
|
||||
const emits = defineEmits(['update:modelValue', 'change'])
|
||||
watch(
|
||||
() => myValue.value,
|
||||
newValue => {
|
||||
emits('update:modelValue', newValue)
|
||||
emits('change', newValue)
|
||||
}
|
||||
)
|
||||
|
||||
const tinymceId = 'tinymce-view-alarm'
|
||||
const init = ref({
|
||||
selector: '#' + tinymceId,
|
||||
toolbar_items_size: 'small',
|
||||
language_url: formatDataEaseBi('./tinymce-dataease-private/langs/zh_CN.js'), // 汉化路径是自定义的,一般放在public或static里面
|
||||
language: 'zh_CN',
|
||||
skin_url: formatDataEaseBi('./tinymce-dataease-private/skins/ui/oxide'), // 皮肤
|
||||
content_css: formatDataEaseBi('./tinymce-dataease-private/skins/content/default/content.css'),
|
||||
plugins:
|
||||
'advlist autolink link image lists charmap media wordcount table contextmenu directionality pagebreak', // 插件
|
||||
// 工具栏
|
||||
toolbar:
|
||||
'undo redo |fontselect fontsizeselect |forecolor backcolor bold italic |underline strikethrough | splitDateButton lineheight| formatselect |' +
|
||||
'alignleft aligncenter alignright | bullist numlist |' +
|
||||
' blockquote subscript superscript removeformat | table image media link',
|
||||
toolbar_location: '/',
|
||||
font_formats:
|
||||
'阿里巴巴普惠体=阿里巴巴普惠体 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: '',
|
||||
outer_placeholder: '双击输入文字',
|
||||
inline: false,
|
||||
branding: true,
|
||||
setup: editor => {
|
||||
const emoticons = `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none">
|
||||
<path d="M8.66683 4.66671H11.0002C11.1843 4.66671 11.3335 4.81595 11.3335 5.00004V5.66671C11.3335 5.8508 11.1843 6.00004 11.0002 6.00004H8.66683V11C8.66683 11.1841 8.51759 11.3334 8.3335 11.3334H7.66683C7.48273 11.3334 7.3335 11.1841 7.3335 11V6.00004H5.00016C4.81607 6.00004 4.66683 5.8508 4.66683 5.66671V5.00004C4.66683 4.81595 4.81607 4.66671 5.00016 4.66671H7.3335C7.3335 4.66671 8.66683 4.68559 8.66683 4.66671Z" fill="#1F2329"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M1.3335 2.00004C1.3335 1.63185 1.63197 1.33337 2.00016 1.33337H14.0002C14.3684 1.33337 14.6668 1.63185 14.6668 2.00004V14C14.6668 14.3682 14.3684 14.6667 14.0002 14.6667H2.00016C1.63197 14.6667 1.3335 14.3682 1.3335 14V2.00004ZM2.66683 13.3334V2.66671H13.3335V13.3334H2.66683Z" fill="#1F2329"/>
|
||||
</svg>`
|
||||
|
||||
const icon_text_outlined = `<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M13 5V20.5C13 20.5657 12.9871 20.6307 12.9619 20.6913C12.9368 20.752 12.9 20.8071 12.8536 20.8536C12.8071 20.9 12.752 20.9368 12.6913 20.9619C12.6307 20.9871 12.5657 21 12.5 21H11.5C11.4343 21 11.3693 20.9871 11.3087 20.9619C11.248 20.9368 11.1929 20.9 11.1464 20.8536C11.1 20.8071 11.0632 20.752 11.0381 20.6913C11.0129 20.6307 11 20.5657 11 20.5V5H3.5C3.43434 5 3.36932 4.98707 3.30866 4.96194C3.248 4.93681 3.19288 4.89998 3.14645 4.85355C3.10002 4.80712 3.06319 4.752 3.03806 4.69134C3.01293 4.63068 3 4.56566 3 4.5V3.5C3 3.43434 3.01293 3.36932 3.03806 3.30866C3.06319 3.248 3.10002 3.19288 3.14645 3.14645C3.19288 3.10002 3.248 3.06319 3.30866 3.03806C3.36932 3.01293 3.43434 3 3.5 3H20.5C20.5657 3 20.6307 3.01293 20.6913 3.03806C20.752 3.06319 20.8071 3.10002 20.8536 3.14645C20.9 3.19288 20.9368 3.248 20.9619 3.30866C20.9871 3.36932 21 3.43434 21 3.5V4.5C21 4.63261 20.9473 4.75979 20.8536 4.85355C20.7598 4.94732 20.6326 5 20.5 5H13Z" fill="#3370FF"/>
|
||||
</svg>
|
||||
`
|
||||
|
||||
const icon_calendar_outlined = `<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M4.83301 1.33398C5.10915 1.33398 5.33301 1.55784 5.33301 1.83398V2.00065H10.6663V1.83398C10.6663 1.55784 10.8902 1.33398 11.1663 1.33398H11.4997C11.7758 1.33398 11.9997 1.55784 11.9997 1.83398V2.00065H13.9997C14.3679 2.00065 14.6663 2.29913 14.6663 2.66732V14.0007C14.6663 14.3688 14.3679 14.6673 13.9997 14.6673H1.99967C1.63148 14.6673 1.33301 14.3688 1.33301 14.0007L1.33301 2.66732C1.33301 2.29913 1.63148 2.00065 1.99967 2.00065H3.99967V1.83398C3.99967 1.55784 4.22353 1.33398 4.49967 1.33398H4.83301ZM10.6663 3.33398H5.33301V3.50065C5.33301 3.77679 5.10915 4.00065 4.83301 4.00065H4.49967C4.22353 4.00065 3.99967 3.77679 3.99967 3.50065V3.33398H2.66634V13.334H13.333V3.33398H11.9997V3.50065C11.9997 3.77679 11.7758 4.00065 11.4997 4.00065H11.1663C10.8902 4.00065 10.6663 3.77679 10.6663 3.50065V3.33398ZM5.99967 6.83398C5.99967 6.55784 5.77582 6.33398 5.49967 6.33398H4.49967C4.22353 6.33398 3.99967 6.55784 3.99967 6.83398V7.83398C3.99967 8.11013 4.22353 8.33398 4.49967 8.33398H5.49967C5.77582 8.33398 5.99967 8.11013 5.99967 7.83398V6.83398ZM6.99967 6.83398C6.99967 6.55784 7.22353 6.33398 7.49967 6.33398H8.49967C8.77582 6.33398 8.99967 6.55784 8.99967 6.83398V7.83398C8.99967 8.11013 8.77582 8.33398 8.49967 8.33398H7.49967C7.22353 8.33398 6.99967 8.11013 6.99967 7.83398V6.83398ZM5.99967 9.83398C5.99967 9.55784 5.77582 9.33398 5.49967 9.33398H4.49967C4.22353 9.33398 3.99967 9.55784 3.99967 9.83398V10.834C3.99967 11.1101 4.22353 11.334 4.49967 11.334H5.49967C5.77582 11.334 5.99967 11.1101 5.99967 10.834V9.83398ZM6.99967 9.83398C6.99967 9.55784 7.22353 9.33398 7.49967 9.33398H8.49967C8.77582 9.33398 8.99967 9.55784 8.99967 9.83398V10.834C8.99967 11.1101 8.77582 11.334 8.49967 11.334H7.49967C7.22353 11.334 6.99967 11.1101 6.99967 10.834V9.83398ZM11.9997 6.83398C11.9997 6.55784 11.7758 6.33398 11.4997 6.33398H10.4997C10.2235 6.33398 9.99967 6.55784 9.99967 6.83398V7.83398C9.99967 8.11013 10.2235 8.33398 10.4997 8.33398H11.4997C11.7758 8.33398 11.9997 8.11013 11.9997 7.83398V6.83398Z" fill="#3370FF"/>
|
||||
<path d="M11.9997 9.83398C11.9997 9.55784 11.7758 9.33398 11.4997 9.33398H10.4997C10.2235 9.33398 9.99967 9.55784 9.99967 9.83398V10.834C9.99967 11.1101 10.2235 11.334 10.4997 11.334H11.4997C11.7758 11.334 11.9997 11.1101 11.9997 10.834V9.83398Z" fill="#3370FF" />
|
||||
</svg>
|
||||
`
|
||||
const icon_number_outlined = `<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M8.70351 2C8.94543 2 9.13197 2.21307 9.1 2.45287L8.67565 5.63553H15.9457L16.3842 2.34714C16.4107 2.14841 16.5802 2 16.7807 2H18.0359C18.2778 2 18.4643 2.21307 18.4324 2.45287L18.008 5.63553H21.7283C21.9492 5.63553 22.1283 5.81461 22.1283 6.03553V7.29781C22.1283 7.51872 21.9492 7.69781 21.7283 7.69781H17.733L16.7636 14.9689H20.3949C20.6158 14.9689 20.7949 15.1479 20.7949 15.3689V16.6311C20.7949 16.8521 20.6158 17.0311 20.3949 17.0311H16.4886L15.8724 21.6529C15.8459 21.8516 15.6763 22 15.4759 22H14.2207C13.9787 22 13.7922 21.7869 13.8242 21.5471L14.4263 17.0311H7.15623L6.54 21.6529C6.5135 21.8516 6.34399 22 6.14351 22H4.88831C4.64639 22 4.45985 21.7869 4.49182 21.5471L5.09395 17.0311H1.19493C0.974016 17.0311 0.794929 16.8521 0.794929 16.6311V15.3689C0.794929 15.1479 0.974015 14.9689 1.19493 14.9689H5.36892L6.3384 7.69781H2.52826C2.30735 7.69781 2.12826 7.51872 2.12826 7.29781V6.03553C2.12826 5.81461 2.30735 5.63553 2.52826 5.63553H6.61337L7.05182 2.34714C7.07831 2.14841 7.24783 2 7.44831 2H8.70351ZM14.7013 14.9689L15.6707 7.69781H8.40067L7.4312 14.9689H14.7013Z" fill="#04B49C"/>
|
||||
</svg>
|
||||
`
|
||||
editor.ui.registry.addIcon('emoticons', emoticons)
|
||||
editor.ui.registry.addIcon('icon_calendar_outlined', icon_calendar_outlined)
|
||||
editor.ui.registry.addIcon('icon_number_outlined', icon_number_outlined)
|
||||
editor.ui.registry.addIcon('icon_text_outlined', icon_text_outlined)
|
||||
|
||||
const iconMap = [
|
||||
'icon_text_outlined',
|
||||
'icon_calendar_outlined',
|
||||
'icon_number_outlined',
|
||||
'icon_number_outlined',
|
||||
'icon_number_outlined'
|
||||
]
|
||||
|
||||
editor.ui.registry.addSplitButton('splitDateButton', {
|
||||
icon: 'emoticons',
|
||||
tooltip: '图表选中字段',
|
||||
onAction: _ => () => {
|
||||
editor.insertContent('')
|
||||
},
|
||||
onItemAction: (_, value) => {
|
||||
fieldSelect(value)
|
||||
},
|
||||
fetch: callback => {
|
||||
const items = props.fieldList.map(ele => {
|
||||
return {
|
||||
id: ele.id,
|
||||
icon: iconMap[ele.deType],
|
||||
type: 'choiceitem',
|
||||
text: ele.name,
|
||||
value: ele.name
|
||||
}
|
||||
})
|
||||
callback(items)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
const viewInit = () => {
|
||||
tinymce.init({})
|
||||
}
|
||||
const fieldSelect = name => {
|
||||
const ed = tinymce.editors[tinymceId]
|
||||
const obj = props.fieldList.find(ele => ele.name === name)
|
||||
const field = {
|
||||
id: obj.id,
|
||||
name: obj.name,
|
||||
backgroundColor: obj.groupType === 'd' ? '#3370FF33' : '#00D6B933',
|
||||
color: obj.groupType === 'd' ? '#2B5FD9' : '#04B49C'
|
||||
}
|
||||
const fieldId = 'changeText-' + field.id || ''
|
||||
const value =
|
||||
`<span style="background: ${field.backgroundColor};color: ${field.color}" id="` +
|
||||
fieldId +
|
||||
'"><span class="mceNonEditable" contenteditable="false" data-mce-content="[' +
|
||||
field.name +
|
||||
']">[' +
|
||||
field.name +
|
||||
']</span></span>'
|
||||
const attachValue = '<span id="attachValue"> </span>'
|
||||
ed.insertContent(value)
|
||||
ed.insertContent(attachValue)
|
||||
}
|
||||
const moreBarElementClick = () => {
|
||||
if (!moreBarElement) return
|
||||
if (!document.querySelector('.tox.tox-tinymce-aux')?.children.length) return
|
||||
moreBarElement.nextSibling.querySelector('.tox-tbtn').click()
|
||||
}
|
||||
|
||||
useEmitt({
|
||||
name: 'moreBarElementClick',
|
||||
callback: moreBarElementClick
|
||||
})
|
||||
|
||||
let moreBarElement = null
|
||||
onMounted(() => {
|
||||
setTimeout(() => {
|
||||
moreBarElement = document.querySelectorAll(
|
||||
'.de-tinymce-container_alarm .tox-toolbar__primary .tox-toolbar__group'
|
||||
)[4]
|
||||
}, 1000)
|
||||
})
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
moreBarElement = null
|
||||
})
|
||||
|
||||
defineExpose({
|
||||
viewInit
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
.de-tinymce-container_alarm {
|
||||
--ed-input-text-color: var(--ed-text-color-regular);
|
||||
--ed-input-border: var(--ed-border);
|
||||
--ed-input-hover-border: var(--ed-border-color-hover);
|
||||
--ed-input-focus-border: var(--ed-color-primary);
|
||||
--ed-input-transparent-border: 0 0 0 1px transparent inset;
|
||||
--ed-input-border-color: var(--ed-border-color);
|
||||
--ed-input-border-radius: var(--ed-border-radius-base);
|
||||
--ed-input-bg-color: var(--ed-fill-color-blank);
|
||||
--ed-input-icon-color: var(--ed-text-color-placeholder);
|
||||
--ed-input-placeholder-color: var(--ed-text-color-placeholder);
|
||||
--ed-input-hover-border-color: var(--ed-border-color-hover);
|
||||
--ed-input-clear-hover-color: var(--ed-text-color-secondary);
|
||||
--ed-input-focus-border-color: var(--ed-color-primary);
|
||||
--ed-input-width: 100%;
|
||||
height: fit-content;
|
||||
max-height: 300px;
|
||||
overflow-y: scroll;
|
||||
padding: 0;
|
||||
.tox-statusbar {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.tox-split-button {
|
||||
height: 24px !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<style>
|
||||
.tox {
|
||||
z-index: 2213 !important;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,67 @@
|
||||
<template>
|
||||
<div style="width: 100%" ref="bgForm">
|
||||
<el-form label-position="top" style="width: 100%; margin-bottom: 16px">
|
||||
<el-form-item class="form-item no-margin-bottom" :class="'form-item-' + themes">
|
||||
<el-checkbox
|
||||
size="small"
|
||||
:effect="themes"
|
||||
v-model="canvasStyleData.popupButtonAvailable"
|
||||
@change="onPopButtonChange"
|
||||
>
|
||||
<div style="display: flex; line-height: 14px">
|
||||
显示弹窗区筛选按钮
|
||||
<el-tooltip class="item" :effect="themes" placement="bottom">
|
||||
<template #content>
|
||||
<div>预览时启用</div>
|
||||
</template>
|
||||
<el-icon class="hint-icon" :class="{ 'hint-icon--dark': themes === 'dark' }">
|
||||
<Icon name="icon_info_outlined" />
|
||||
</el-icon>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
</el-checkbox>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { snapshotStoreWithOut } from '@/store/modules/data-visualization/snapshot'
|
||||
import { dvMainStoreWithOut } from '@/store/modules/data-visualization/dvMain'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { ElIcon } from 'element-plus-secondary'
|
||||
import Icon from '../icon-custom/src/Icon.vue'
|
||||
const snapshotStore = snapshotStoreWithOut()
|
||||
|
||||
const dvMainStore = dvMainStoreWithOut()
|
||||
const { canvasStyleData } = storeToRefs(dvMainStore)
|
||||
|
||||
const onPopButtonChange = () => {
|
||||
snapshotStore.recordSnapshotCache()
|
||||
}
|
||||
|
||||
withDefaults(
|
||||
defineProps<{
|
||||
themes?: EditorTheme
|
||||
}>(),
|
||||
{
|
||||
themes: 'dark'
|
||||
}
|
||||
)
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.hint-icon {
|
||||
cursor: pointer;
|
||||
font-size: 14px;
|
||||
color: #646a73;
|
||||
|
||||
&.hint-icon--dark {
|
||||
color: #a6a6a6;
|
||||
}
|
||||
}
|
||||
:deep(.ed-form-item) {
|
||||
display: block;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
</style>
|
@ -56,6 +56,18 @@
|
||||
</el-icon>
|
||||
</span>
|
||||
</el-tooltip>
|
||||
<el-tooltip
|
||||
effect="dark"
|
||||
placement="top"
|
||||
content="输入计算数据"
|
||||
v-if="barShowCheck('datasetParams') && datasetParamsSetShow"
|
||||
>
|
||||
<span>
|
||||
<el-icon class="bar-base-icon" @click="datasetParamsInit">
|
||||
<Icon name="icon_params_setting"></Icon>
|
||||
</el-icon>
|
||||
</span>
|
||||
</el-tooltip>
|
||||
|
||||
<div v-if="barShowCheck('multiplexing')" class="bar-checkbox-area">
|
||||
<el-checkbox
|
||||
@ -130,7 +142,10 @@
|
||||
</el-dropdown>
|
||||
</el-dropdown-item>
|
||||
</template>
|
||||
<xpack-component jsname="L2NvbXBvbmVudC90aHJlc2hvbGQtd2FybmluZy9FZGl0QmFySGFuZGxlcg==" />
|
||||
<xpack-component
|
||||
:chart="element"
|
||||
jsname="L2NvbXBvbmVudC90aHJlc2hvbGQtd2FybmluZy9FZGl0QmFySGFuZGxlcg=="
|
||||
/>
|
||||
<el-dropdown-item divided @click="deleteComponent" v-if="barShowCheck('delete')"
|
||||
>删除</el-dropdown-item
|
||||
>
|
||||
@ -161,7 +176,6 @@
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
|
||||
<el-popover v-if="selectFieldShow" width="200" trigger="click" @mousedown="fieldsAreaDown">
|
||||
<template #reference>
|
||||
<el-icon class="bar-base-icon"> <Icon name="database"></Icon></el-icon>
|
||||
@ -188,6 +202,7 @@ import { ElMessage, ElTooltip, ElButton } from 'element-plus-secondary'
|
||||
import CustomTabsSort from '@/custom-component/de-tabs/CustomTabsSort.vue'
|
||||
import { exportPivotExcel } from '@/views/chart/components/js/panel/common/common_table'
|
||||
import { XpackComponent } from '@/components/plugin'
|
||||
import DatasetParamsComponent from '@/components/visualization/DatasetParamsComponent.vue'
|
||||
const dvMainStore = dvMainStoreWithOut()
|
||||
const snapshotStore = snapshotStoreWithOut()
|
||||
const copyStore = copyStoreWithOut()
|
||||
@ -195,6 +210,7 @@ const customTabsSortRef = ref(null)
|
||||
const authShow = computed(() => !dvInfo.value.weight || dvInfo.value.weight > 3)
|
||||
const emits = defineEmits([
|
||||
'userViewEnlargeOpen',
|
||||
'datasetParamsInit',
|
||||
'closePreview',
|
||||
'showViewDetails',
|
||||
'amRemoveItem',
|
||||
@ -206,6 +222,7 @@ const { emitter } = useEmitt()
|
||||
// bar所在位置可以显示的功能按钮
|
||||
const positionBarShow = {
|
||||
canvas: [
|
||||
'datasetParams',
|
||||
'enlarge',
|
||||
'details',
|
||||
'setting',
|
||||
@ -216,7 +233,7 @@ const positionBarShow = {
|
||||
'linkageSetting',
|
||||
'linkJumpSetting'
|
||||
],
|
||||
preview: ['enlarge', 'details', 'download', 'unLinkage', 'previewDownload'],
|
||||
preview: ['enlarge', 'details', 'download', 'unLinkage', 'previewDownload', 'datasetParams'],
|
||||
multiplexing: ['multiplexing'],
|
||||
batchOpt: ['batchOpt'],
|
||||
linkage: ['linkage']
|
||||
@ -225,6 +242,7 @@ const positionBarShow = {
|
||||
// bar所属组件类型可以显示的功能按钮
|
||||
const componentTypeBarShow = {
|
||||
UserView: [
|
||||
'datasetParams',
|
||||
'enlarge',
|
||||
'details',
|
||||
'setting',
|
||||
@ -419,6 +437,11 @@ const deleteComponent = () => {
|
||||
snapshotStore.recordSnapshotCache()
|
||||
}
|
||||
|
||||
const datasetParamsInit = () => {
|
||||
// do init
|
||||
emits('datasetParamsInit')
|
||||
}
|
||||
|
||||
const copyComponent = () => {
|
||||
copyStore.copy()
|
||||
copyStore.paste(false)
|
||||
@ -545,6 +568,10 @@ const initCurFields = () => {
|
||||
}
|
||||
// 富文本-End
|
||||
|
||||
const datasetParamsSetShow = computed(() => {
|
||||
return canvasViewInfo.value[element.value.id]?.calParams?.length > 0
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
if (element.value.component === 'UserView') {
|
||||
eventBus.on('initCurFields-' + element.value.id, initCurFields)
|
||||
|
@ -0,0 +1,153 @@
|
||||
<script lang="ts" setup>
|
||||
import { computed, reactive, ref } from 'vue'
|
||||
import { useI18n } from '@/hooks/web/useI18n'
|
||||
import { deepCopy } from '@/utils/utils'
|
||||
import { useEmitt } from '@/hooks/web/useEmitt'
|
||||
import { dvMainStoreWithOut } from '@/store/modules/data-visualization/dvMain'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { ElMessage } from 'element-plus-secondary'
|
||||
const { t } = useI18n()
|
||||
const loading = ref(false)
|
||||
const subject = ref()
|
||||
const subjectDialogShow = ref(false)
|
||||
const dvMainStore = dvMainStoreWithOut()
|
||||
const { canvasViewInfo } = storeToRefs(dvMainStore)
|
||||
|
||||
const state = reactive({
|
||||
viewId: null
|
||||
})
|
||||
const curDataSetParamsInfo = ref([])
|
||||
|
||||
const resetForm = () => {
|
||||
subject.value.clearValidate()
|
||||
subjectDialogShow.value = false
|
||||
}
|
||||
const subjectForm = ref(null)
|
||||
const rules = ref({})
|
||||
|
||||
const optInit = item => {
|
||||
if (item) {
|
||||
state.viewId = item.id
|
||||
const chartInfo = canvasViewInfo.value[state.viewId]
|
||||
curDataSetParamsInfo.value = deepCopy(chartInfo.calParams)
|
||||
subjectDialogShow.value = true
|
||||
}
|
||||
}
|
||||
|
||||
const saveSubject = () => {
|
||||
if (disabledCheck.value) {
|
||||
ElMessage.error('请输入正确参数')
|
||||
return
|
||||
}
|
||||
canvasViewInfo.value[state.viewId]['calParams'] = curDataSetParamsInfo.value
|
||||
useEmitt().emitter.emit('calcData-' + state.viewId, canvasViewInfo.value[state.viewId])
|
||||
resetForm()
|
||||
}
|
||||
|
||||
const disabledCheck = computed(() => {
|
||||
return (
|
||||
!curDataSetParamsInfo.value ||
|
||||
(curDataSetParamsInfo.value &&
|
||||
curDataSetParamsInfo.value.filter(item => item.value === null || item.value === undefined)
|
||||
.length > 0)
|
||||
)
|
||||
})
|
||||
|
||||
const statesCheck = () => {
|
||||
return subjectDialogShow.value
|
||||
}
|
||||
|
||||
const handleDialogClick = e => {
|
||||
e.preventDefault()
|
||||
e.stopPropagation()
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
optInit,
|
||||
statesCheck,
|
||||
resetForm
|
||||
})
|
||||
|
||||
const emits = defineEmits(['finish'])
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<el-dialog
|
||||
v-loading="loading"
|
||||
title="计算参数输入"
|
||||
v-model="subjectDialogShow"
|
||||
width="400px"
|
||||
:before-close="resetForm"
|
||||
@click="handleDialogClick"
|
||||
>
|
||||
<el-form
|
||||
v-if="subjectDialogShow"
|
||||
label-position="top"
|
||||
ref="subject"
|
||||
:model="subjectForm"
|
||||
:rules="rules"
|
||||
>
|
||||
<el-form-item
|
||||
v-for="paramsItem in curDataSetParamsInfo"
|
||||
:key="paramsItem"
|
||||
class="form-item"
|
||||
:prop="'value_' + paramsItem.name"
|
||||
>
|
||||
<template #label>
|
||||
<label class="m-label">
|
||||
计算字段[{{ paramsItem.name }}] <span style="color: red">*</span>
|
||||
</label>
|
||||
</template>
|
||||
<el-input-number
|
||||
style="width: 100%"
|
||||
v-model="paramsItem.value"
|
||||
placeholder="请输入一个数字"
|
||||
controls-position="right"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button secondary @click="resetForm()">取消</el-button>
|
||||
<el-button type="primary" @click="saveSubject()">确认</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<style lang="less" scoped>
|
||||
:deep(.ed-dialog__header) {
|
||||
text-align: left;
|
||||
}
|
||||
.m-label {
|
||||
color: #1f2329;
|
||||
font-size: 14px;
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
line-height: 14px;
|
||||
display: inline-block;
|
||||
}
|
||||
.form-item {
|
||||
margin-bottom: 16px;
|
||||
:deep(.ed-form-item__label) {
|
||||
line-height: 14px !important;
|
||||
}
|
||||
|
||||
:deep(.ed-input__inner) {
|
||||
font-size: 14px !important;
|
||||
}
|
||||
|
||||
:deep(.ed-form-item__error) {
|
||||
top: 88%;
|
||||
}
|
||||
.ed-input {
|
||||
--ed-input-height: 32px !important;
|
||||
}
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
:deep(.avatar-uploader-container) {
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
}
|
||||
</style>
|
@ -0,0 +1,110 @@
|
||||
<template>
|
||||
<el-row>
|
||||
<el-form ref="form" size="mini" label-width="70px">
|
||||
<el-form-item :label="t('visualization.enable_jump')">
|
||||
<el-switch v-model="state.linkInfo.enable" size="mini" />
|
||||
<span v-show="state.linkInfo.enable" class="tips-area">
|
||||
Tips:{{ t('visualization.link_open_tips') }}
|
||||
</span>
|
||||
</el-form-item>
|
||||
<el-form-item :label="t('visualization.open_mode')">
|
||||
<el-radio-group v-model="state.linkInfo.openMode" :disabled="!state.linkInfo.enable">
|
||||
<el-radio label="_blank">{{ t('visualization.new_window') }}</el-radio>
|
||||
<el-radio label="_self">{{ t('visualization.now_window') }}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item :label="t('visualization.hyperLinks')">
|
||||
<el-input v-model="state.linkInfo.content" :disabled="!state.linkInfo.enable" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="onSubmit">{{ t('visualization.confirm') }}</el-button>
|
||||
<el-button @click="onClose">{{ t('visualization.cancel') }}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { reactive } from 'vue'
|
||||
import { dvMainStoreWithOut } from '@/store/modules/data-visualization/dvMain'
|
||||
import { snapshotStoreWithOut } from '@/store/modules/data-visualization/snapshot'
|
||||
import { checkAddHttp, deepCopy } from '@/utils/utils'
|
||||
import { useI18n } from '@/hooks/web/useI18n'
|
||||
const { t } = useI18n()
|
||||
const snapshotStore = snapshotStoreWithOut()
|
||||
const emits = defineEmits(['onClose'])
|
||||
const props = defineProps({
|
||||
linkInfo: {
|
||||
type: Object,
|
||||
required: true
|
||||
}
|
||||
})
|
||||
|
||||
const state = reactive({
|
||||
componentType: null,
|
||||
linkInfo: deepCopy(props.linkInfo),
|
||||
linkageActiveStatus: false
|
||||
})
|
||||
|
||||
const dvMainStore = dvMainStoreWithOut()
|
||||
|
||||
const onSubmit = () => {
|
||||
state.linkInfo.content = checkAddHttp(state.linkInfo.content)
|
||||
dvMainStore.curComponent.hyperlinks = deepCopy(state.linkInfo)
|
||||
snapshotStore.recordSnapshotCache()
|
||||
onClose()
|
||||
}
|
||||
|
||||
const onClose = () => {
|
||||
emits('onClose')
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.tips-area {
|
||||
color: #909399;
|
||||
font-size: 8px;
|
||||
margin-left: 3px;
|
||||
}
|
||||
.slot-class {
|
||||
color: white;
|
||||
}
|
||||
|
||||
.bottom {
|
||||
margin-top: 20px;
|
||||
text-align: center;
|
||||
}
|
||||
.ellipsis-area {
|
||||
margin-left: 10px;
|
||||
margin-right: 10px;
|
||||
overflow: hidden; /*超出部分隐藏*/
|
||||
white-space: nowrap; /*不换行*/
|
||||
text-overflow: ellipsis; /*超出部分文字以...显示*/
|
||||
background-color: #f7f8fa;
|
||||
color: #3d4d66;
|
||||
font-size: 12px;
|
||||
line-height: 24px;
|
||||
height: 24px;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.select-filed {
|
||||
margin-left: 10px;
|
||||
margin-right: 10px;
|
||||
overflow: hidden; /*超出部分隐藏*/
|
||||
white-space: nowrap; /*不换行*/
|
||||
text-overflow: ellipsis; /*超出部分文字以...显示*/
|
||||
color: #3d4d66;
|
||||
font-size: 12px;
|
||||
line-height: 35px;
|
||||
height: 35px;
|
||||
border-radius: 3px;
|
||||
}
|
||||
:deep(.el-popover) {
|
||||
height: 200px;
|
||||
overflow: auto;
|
||||
}
|
||||
.icon-font {
|
||||
color: white;
|
||||
}
|
||||
</style>
|
@ -130,7 +130,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import ComponentWrapper from '@/components/data-visualization/canvas/ComponentWrapper.vue'
|
||||
import { computed, h, nextTick, ref } from 'vue'
|
||||
import { computed, h, nextTick, reactive, ref } from 'vue'
|
||||
import { toPng } from 'html-to-image'
|
||||
import { useI18n } from '@/hooks/web/useI18n'
|
||||
import { deepCopy } from '@/utils/utils'
|
||||
@ -145,8 +145,7 @@ import { ElMessage, ElButton } from 'element-plus-secondary'
|
||||
import { exportPivotExcel } from '@/views/chart/components/js/panel/common/common_table'
|
||||
import { useRequestStoreWithOut } from '@/store/modules/request'
|
||||
import { usePermissionStoreWithOut } from '@/store/modules/permission'
|
||||
import { activeWatermark } from '@/components/watermark/watermark'
|
||||
import { personInfoApi } from '@/api/user'
|
||||
import { activeWatermarkCheckUser } from '@/components/watermark/watermark'
|
||||
const downLoading = ref(false)
|
||||
const dvMainStore = dvMainStoreWithOut()
|
||||
const dialogShow = ref(false)
|
||||
@ -190,14 +189,20 @@ const DETAIL_CHART_ATTR: DeepPartial<ChartObj> = {
|
||||
scrollCfg: {
|
||||
open: false
|
||||
}
|
||||
}
|
||||
},
|
||||
showPosition: 'dialog'
|
||||
}
|
||||
|
||||
const state = reactive({
|
||||
scale: 0.5
|
||||
})
|
||||
const DETAIL_TABLE_ATTR: DeepPartial<ChartObj> = {
|
||||
senior: {
|
||||
scrollCfg: {
|
||||
open: false
|
||||
}
|
||||
}
|
||||
},
|
||||
showPosition: 'dialog'
|
||||
}
|
||||
|
||||
const authShow = computed(() => editMode.value === 'edit' || dvInfo.value.weight > 3)
|
||||
@ -252,7 +257,8 @@ const pixelOptions = [
|
||||
]
|
||||
}
|
||||
]
|
||||
const dialogInit = (canvasStyle, view, item, opt) => {
|
||||
const dialogInit = (canvasStyle, view, item, opt, params = { scale: 0.5 }) => {
|
||||
state.scale = params.scale
|
||||
sourceViewType.value = view.type
|
||||
optType.value = opt
|
||||
dialogShow.value = true
|
||||
@ -385,32 +391,7 @@ const htmlToImage = () => {
|
||||
}
|
||||
|
||||
const initWatermark = () => {
|
||||
if (dvInfo.value.watermarkInfo) {
|
||||
if (userInfo.value && userInfo.value.model !== 'lose') {
|
||||
activeWatermark(
|
||||
dvInfo.value.watermarkInfo.settingContent,
|
||||
userInfo.value,
|
||||
'enlarge-inner-content',
|
||||
'canvas-main',
|
||||
dvInfo.value.selfWatermarkStatus,
|
||||
0.5
|
||||
)
|
||||
} else {
|
||||
personInfoApi().then(res => {
|
||||
userInfo.value = res.data
|
||||
if (userInfo.value && userInfo.value.model !== 'lose') {
|
||||
activeWatermark(
|
||||
dvInfo.value.watermarkInfo.settingContent,
|
||||
userInfo.value,
|
||||
'enlarge-inner-content',
|
||||
'canvas-main',
|
||||
dvInfo.value.selfWatermarkStatus,
|
||||
0.5
|
||||
)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
activeWatermarkCheckUser('enlarge-inner-content', 'canvas-main', state.scale)
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
|
@ -35,7 +35,8 @@ const state = reactive({
|
||||
drill: t('visualization.drill'),
|
||||
linkage: t('visualization.linkage'),
|
||||
linkageAndDrill: t('visualization.linkage_and_drill'),
|
||||
jump: t('visualization.jump')
|
||||
jump: t('visualization.jump'),
|
||||
enlarge: t('visualization.enlarge')
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -160,8 +160,8 @@ const onPositionChange = key => {
|
||||
)
|
||||
}
|
||||
|
||||
if (curComponent.value.component === 'Group') {
|
||||
//如果当前组件是Group分组 则要进行内部组件深度计算
|
||||
if (['Group', 'DeTabs'].includes(curComponent.value.component)) {
|
||||
//如果当前组件是Group分组或者Tab 则要进行内部组件深度计算
|
||||
groupSizeStyleAdaptor(curComponent.value)
|
||||
}
|
||||
|
||||
|
@ -21,7 +21,7 @@ const props = defineProps({
|
||||
default: 'preview'
|
||||
}
|
||||
})
|
||||
const { themes, componentType } = toRefs(props)
|
||||
const { themes } = toRefs(props)
|
||||
|
||||
const fullscreenChange = () => {
|
||||
if (screenfull.isEnabled) {
|
||||
|
@ -1,5 +1,12 @@
|
||||
// 动态创建水印元素的封装函数
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { dvMainStoreWithOut } from '@/store/modules/data-visualization/dvMain'
|
||||
import { ref } from 'vue'
|
||||
import { personInfoApi } from '@/api/user'
|
||||
const dvMainStore = dvMainStoreWithOut()
|
||||
|
||||
const { dvInfo } = storeToRefs(dvMainStore)
|
||||
const userInfo = ref(null)
|
||||
export function watermark(settings, domId) {
|
||||
const watermarkDom = document.getElementById(domId)
|
||||
// 默认设置
|
||||
@ -144,6 +151,41 @@ export function getNow() {
|
||||
const time = year + '-' + month + '-' + day + ' ' + hour + ':' + minute
|
||||
return time
|
||||
}
|
||||
export function activeWatermarkCheckUser(domId, canvasId, scale = 1) {
|
||||
if (dvInfo.value.watermarkInfo) {
|
||||
if (userInfo.value && userInfo.value.model !== 'lose') {
|
||||
activeWatermark(
|
||||
dvInfo.value.watermarkInfo.settingContent,
|
||||
userInfo.value,
|
||||
domId,
|
||||
canvasId,
|
||||
dvInfo.value.selfWatermarkStatus,
|
||||
scale
|
||||
)
|
||||
} else {
|
||||
personInfoApi().then(res => {
|
||||
userInfo.value = res.data
|
||||
if (userInfo.value && userInfo.value.model !== 'lose') {
|
||||
activeWatermark(
|
||||
dvInfo.value.watermarkInfo.settingContent,
|
||||
userInfo.value,
|
||||
domId,
|
||||
canvasId,
|
||||
dvInfo.value.selfWatermarkStatus,
|
||||
scale
|
||||
)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export function removeActiveWatermark(domId) {
|
||||
const historyWatermarkDom = document.getElementById(domId + '-de-watermark-server')
|
||||
if (historyWatermarkDom) {
|
||||
historyWatermarkDom.remove()
|
||||
}
|
||||
}
|
||||
|
||||
export function activeWatermark(
|
||||
watermarkForm,
|
||||
@ -154,10 +196,7 @@ export function activeWatermark(
|
||||
scale = 1
|
||||
) {
|
||||
// 清理历史水印
|
||||
const historyWatermarkDom = document.getElementById(domId + '-de-watermark-server')
|
||||
if (historyWatermarkDom) {
|
||||
historyWatermarkDom.remove()
|
||||
}
|
||||
removeActiveWatermark(domId)
|
||||
if (
|
||||
!(
|
||||
canvasId === 'canvas-main' &&
|
||||
|
@ -2,7 +2,7 @@
|
||||
import { computed, nextTick, onMounted, ref, toRefs } from 'vue'
|
||||
import { dvMainStoreWithOut } from '@/store/modules/data-visualization/dvMain'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { styleData, selectKey, optionMap, horizontalPosition } from '@/utils/attr'
|
||||
import { styleData } from '@/utils/attr'
|
||||
import ComponentPosition from '@/components/visualization/common/ComponentPosition.vue'
|
||||
import BackgroundOverallCommon from '@/components/visualization/component-background/BackgroundOverallCommon.vue'
|
||||
import { useI18n } from '@/hooks/web/useI18n'
|
||||
@ -10,6 +10,9 @@ import elementResizeDetectorMaker from 'element-resize-detector'
|
||||
import { snapshotStoreWithOut } from '@/store/modules/data-visualization/snapshot'
|
||||
import CommonStyleSet from '@/custom-component/common/CommonStyleSet.vue'
|
||||
import CommonEvent from '@/custom-component/common/CommonEvent.vue'
|
||||
import TabCarouselSetting from '@/custom-component/common/TabCarouselSetting.vue'
|
||||
import CommonBorderSetting from '@/custom-component/common/CommonBorderSetting.vue'
|
||||
import CollapseSwitchItem from '../../components/collapse-switch-item/src/CollapseSwitchItem.vue'
|
||||
const snapshotStore = snapshotStoreWithOut()
|
||||
|
||||
const { t } = useI18n()
|
||||
@ -93,6 +96,10 @@ const colorPickerWidth = computed(() => {
|
||||
}
|
||||
})
|
||||
|
||||
const borderSettingShow = computed(() => {
|
||||
return !!element.value.style['borderStyle']
|
||||
})
|
||||
|
||||
// 暂时关闭
|
||||
const eventsShow = computed(() => {
|
||||
return (
|
||||
@ -102,6 +109,10 @@ const eventsShow = computed(() => {
|
||||
)
|
||||
})
|
||||
|
||||
const carouselShow = computed(() => {
|
||||
return element.value.component === 'DeTabs' && element.value.carousel
|
||||
})
|
||||
|
||||
const backgroundCustomShow = computed(() => {
|
||||
return (
|
||||
dashboardActive.value ||
|
||||
@ -173,6 +184,26 @@ const stopEvent = e => {
|
||||
>
|
||||
<common-event :themes="themes" :events-info="element.events"></common-event>
|
||||
</el-collapse-item>
|
||||
<collapse-switch-item
|
||||
v-if="element && borderSettingShow"
|
||||
v-model="element.style.borderActive"
|
||||
@modelChange="val => onStyleAttrChange({ key: 'borderActive', value: val })"
|
||||
:themes="themes"
|
||||
title="边框"
|
||||
name="borderSetting"
|
||||
class="common-style-area"
|
||||
>
|
||||
<common-border-setting
|
||||
:style-info="element.style"
|
||||
:themes="themes"
|
||||
@onStyleAttrChange="onStyleAttrChange"
|
||||
></common-border-setting>
|
||||
</collapse-switch-item>
|
||||
<TabCarouselSetting
|
||||
v-if="carouselShow"
|
||||
:element="element"
|
||||
:themes="themes"
|
||||
></TabCarouselSetting>
|
||||
</el-collapse>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -0,0 +1,164 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, reactive, ref, toRefs, watch } from 'vue'
|
||||
import { ElFormItem, ElInputNumber } from 'element-plus-secondary'
|
||||
import { snapshotStoreWithOut } from '@/store/modules/data-visualization/snapshot'
|
||||
import { dvMainStoreWithOut } from '@/store/modules/data-visualization/dvMain'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { COLOR_PANEL } from '@/views/chart/components/editor/util/chart'
|
||||
const dvMainStore = dvMainStoreWithOut()
|
||||
|
||||
const snapshotStore = snapshotStoreWithOut()
|
||||
const { canvasStyleData } = storeToRefs(dvMainStore)
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
themes?: EditorTheme
|
||||
styleInfo: any
|
||||
}>(),
|
||||
{
|
||||
themes: 'dark'
|
||||
}
|
||||
)
|
||||
const emits = defineEmits(['onStyleAttrChange'])
|
||||
const { themes, styleInfo } = toRefs(props)
|
||||
const state = reactive({
|
||||
fontSize: [],
|
||||
isSetting: false,
|
||||
predefineColors: COLOR_PANEL
|
||||
})
|
||||
const styleMounted = ref({
|
||||
borderWidth: 0,
|
||||
borderRadius: 5
|
||||
})
|
||||
|
||||
const borderStyleList = [
|
||||
{ name: '实线', value: 'solid' },
|
||||
{ name: '虚线', value: 'dashed' },
|
||||
{ name: '点线', value: 'dotted' }
|
||||
]
|
||||
|
||||
const styleInit = () => {
|
||||
if (styleInfo.value) {
|
||||
Object.keys(styleMounted.value).forEach(key => {
|
||||
styleMounted.value[key] = Math.round(
|
||||
(styleInfo.value[key] * 100) / canvasStyleData.value.scale
|
||||
)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
const styleForm = computed<any>(() => styleInfo.value)
|
||||
|
||||
const changeStyle = params => {
|
||||
snapshotStore.recordSnapshotCache()
|
||||
emits('onStyleAttrChange', params)
|
||||
}
|
||||
|
||||
const changeStylePre = key => {
|
||||
changeStyle({ key: key, value: styleInfo.value[key] })
|
||||
}
|
||||
|
||||
const sizeChange = key => {
|
||||
styleInfo.value[key] = (styleMounted.value[key] * canvasStyleData.value.scale) / 100
|
||||
changeStyle({ key: key, value: styleInfo.value[key] })
|
||||
}
|
||||
|
||||
watch(
|
||||
() => styleInfo.value,
|
||||
() => {
|
||||
styleInit()
|
||||
},
|
||||
{
|
||||
deep: true,
|
||||
immediate: true
|
||||
}
|
||||
)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<el-row class="custom-row">
|
||||
<el-form label-position="top">
|
||||
<el-row style="display: flex">
|
||||
<el-form-item
|
||||
style="width: 70px"
|
||||
label="颜色"
|
||||
class="form-item"
|
||||
:class="'form-item-' + themes"
|
||||
>
|
||||
<el-color-picker
|
||||
title="颜色"
|
||||
v-model="styleForm.borderColor"
|
||||
class="color-picker-style"
|
||||
:triggerWidth="65"
|
||||
is-custom
|
||||
:predefine="state.predefineColors"
|
||||
@change="changeStylePre('borderColor')"
|
||||
>
|
||||
</el-color-picker>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
style="width: 150px"
|
||||
label="圆角"
|
||||
class="form-item"
|
||||
:class="'form-item-' + themes"
|
||||
>
|
||||
<el-input-number
|
||||
title="圆角"
|
||||
:effect="themes"
|
||||
:min="0"
|
||||
:max="200"
|
||||
controls-position="right"
|
||||
v-model="styleMounted.borderRadius"
|
||||
class="color-picker-style"
|
||||
@change="sizeChange('borderRadius')"
|
||||
>
|
||||
</el-input-number>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
<el-row style="display: flex">
|
||||
<el-form-item
|
||||
style="width: 70px"
|
||||
label="样式"
|
||||
class="form-item"
|
||||
:class="'form-item-' + themes"
|
||||
>
|
||||
<el-select
|
||||
:effect="themes"
|
||||
v-model="styleForm.borderStyle"
|
||||
size="small"
|
||||
style="width: 65px"
|
||||
@change="changeStylePre('borderStyle')"
|
||||
>
|
||||
<el-option
|
||||
class="custom-style-option"
|
||||
v-for="option in borderStyleList"
|
||||
:key="option.value"
|
||||
:label="option.name"
|
||||
:value="option.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
style="width: 150px"
|
||||
label="线宽"
|
||||
class="form-item"
|
||||
:class="'form-item-' + themes"
|
||||
>
|
||||
<el-input-number
|
||||
title="线宽"
|
||||
:min="0"
|
||||
:max="50"
|
||||
:effect="themes"
|
||||
controls-position="right"
|
||||
v-model="styleMounted.borderWidth"
|
||||
class="color-picker-style"
|
||||
@change="sizeChange('borderWidth')"
|
||||
>
|
||||
</el-input-number>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<style scoped lang="less"></style>
|
@ -1,8 +1,10 @@
|
||||
<script setup lang="ts">
|
||||
import { toRefs } from 'vue'
|
||||
import { computed, toRefs } from 'vue'
|
||||
import { ElFormItem, ElIcon } from 'element-plus-secondary'
|
||||
import { snapshotStoreWithOut } from '@/store/modules/data-visualization/snapshot'
|
||||
import Icon from '../../components/icon-custom/src/Icon.vue'
|
||||
import { dvMainStoreWithOut } from '@/store/modules/data-visualization/dvMain'
|
||||
const dvMainStore = dvMainStoreWithOut()
|
||||
|
||||
const snapshotStore = snapshotStoreWithOut()
|
||||
|
||||
@ -16,9 +18,15 @@ const props = withDefaults(
|
||||
}
|
||||
)
|
||||
const { themes, eventsInfo } = toRefs(props)
|
||||
const isDashboard = dvMainStore.dvInfo.type === 'dashboard'
|
||||
|
||||
const curSupportEvents = ['jump', 'showHidden', 'refreshDataV']
|
||||
|
||||
const curSupportEvents = computed(() => {
|
||||
if (isDashboard) {
|
||||
return ['jump', 'refreshDataV']
|
||||
} else {
|
||||
return ['jump', 'showHidden', 'refreshDataV']
|
||||
}
|
||||
})
|
||||
const onEventChange = () => {
|
||||
snapshotStore.recordSnapshotCache('renderChart')
|
||||
}
|
||||
|
@ -350,7 +350,6 @@ const state = reactive({
|
||||
|
||||
const styleColorKeyArray = [
|
||||
{ value: 'color', label: '颜色', width: 90, icon: 'dv-style-color' },
|
||||
{ value: 'borderColor', label: '边框颜色', width: 90, icon: 'dv-style-borderColor' },
|
||||
{
|
||||
value: 'headFontColor',
|
||||
label: '头部字体颜色',
|
||||
@ -388,34 +387,6 @@ const fontSizeList = computed(() => {
|
||||
return arr
|
||||
})
|
||||
|
||||
const borderWidthList = computed(() => {
|
||||
const arr = []
|
||||
for (let i = 0; i <= 20; i = i + 1) {
|
||||
arr.push({
|
||||
name: i + '',
|
||||
value: i
|
||||
})
|
||||
}
|
||||
return arr
|
||||
})
|
||||
|
||||
const borderRadiusList = computed(() => {
|
||||
const arr = []
|
||||
for (let i = 0; i <= 50; i = i + 1) {
|
||||
arr.push({
|
||||
name: i + '',
|
||||
value: i
|
||||
})
|
||||
}
|
||||
return arr
|
||||
})
|
||||
|
||||
const borderStyleList = [
|
||||
{ name: '实线', value: 'solid' },
|
||||
{ name: '虚线', value: 'dashed' },
|
||||
{ name: '点线', value: 'dotted' }
|
||||
]
|
||||
|
||||
const styleOptionKeyArrayPre = [
|
||||
{
|
||||
value: 'fontFamily',
|
||||
@ -466,27 +437,6 @@ const styleOptionKeyArray = [
|
||||
customOption: opacitySizeList,
|
||||
width: '90px',
|
||||
icon: 'dv-style-opacity'
|
||||
},
|
||||
{
|
||||
value: 'borderWidth',
|
||||
label: '边框宽度',
|
||||
customOption: borderWidthList.value,
|
||||
width: '90px',
|
||||
icon: 'dv-style-borderSize'
|
||||
},
|
||||
{
|
||||
value: 'borderRadius',
|
||||
label: '圆角',
|
||||
customOption: borderRadiusList.value,
|
||||
width: '90px',
|
||||
icon: 'dv-style-borderRadius'
|
||||
},
|
||||
{
|
||||
value: 'borderStyle',
|
||||
label: '边框样式',
|
||||
customOption: borderStyleList,
|
||||
width: '90px',
|
||||
icon: 'dv-style-borderStyle'
|
||||
}
|
||||
]
|
||||
|
||||
|
@ -32,7 +32,7 @@ const onSettingChange = () => {
|
||||
:themes="themes"
|
||||
v-model="carouselInfo.enable"
|
||||
name="carouselInfo"
|
||||
title="轮询"
|
||||
title="轮播"
|
||||
>
|
||||
<el-row class="custom-row">
|
||||
<el-form label-position="top">
|
||||
@ -41,10 +41,10 @@ const onSettingChange = () => {
|
||||
:class="'form-item-' + themes"
|
||||
style="width: 50%; margin-bottom: 8px"
|
||||
>
|
||||
<span style="font-size: 12px">轮询时间</span>
|
||||
<span style="font-size: 12px">轮播时间</span>
|
||||
<el-tooltip class="item" :effect="themes" placement="top">
|
||||
<template #content>
|
||||
<div>Tab轮询退出编辑模式才开生效</div>
|
||||
<div>Tab轮播退出编辑模式才开生效</div>
|
||||
</template>
|
||||
<el-icon class="hint-icon" :class="{ 'hint-icon--dark': themes === 'dark' }">
|
||||
<Icon name="icon_info_outlined" />
|
||||
|
@ -5,7 +5,12 @@ import { getViewConfig } from '@/views/chart/components/editor/util/chart'
|
||||
|
||||
export const commonStyle = {
|
||||
rotate: 0,
|
||||
opacity: 1
|
||||
opacity: 1,
|
||||
borderActive: false,
|
||||
borderWidth: 1,
|
||||
borderRadius: 5,
|
||||
borderStyle: 'solid',
|
||||
borderColor: '#cccccc'
|
||||
}
|
||||
|
||||
// 轮询设置
|
||||
@ -22,7 +27,7 @@ export const BASE_EVENTS = {
|
||||
{ key: 'jump', label: '跳转' },
|
||||
{ key: 'download', label: '下载' },
|
||||
{ key: 'share', label: '分享' },
|
||||
{ key: 'showHidden', label: '弹框区域' },
|
||||
{ key: 'showHidden', label: '弹窗区域' },
|
||||
{ key: 'refreshDataV', label: '刷新' },
|
||||
{ key: 'refreshView', label: '刷新图表' }
|
||||
],
|
||||
@ -224,7 +229,9 @@ export const commonAttr = {
|
||||
'picture',
|
||||
'frameLinks',
|
||||
'videoLinks',
|
||||
'streamLinks'
|
||||
'streamLinks',
|
||||
'carouselInfo',
|
||||
'events'
|
||||
], // 编辑组件时记录当前使用的是哪个折叠面板,再次回来时恢复上次打开的折叠面板,优化用户体验
|
||||
linkage: {
|
||||
duration: 0, // 过渡持续时间
|
||||
@ -464,11 +471,8 @@ const list = [
|
||||
style: {
|
||||
width: 200,
|
||||
height: 200,
|
||||
borderWidth: 1,
|
||||
borderRadius: 5,
|
||||
borderStyle: 'solid',
|
||||
borderColor: '#cccccc',
|
||||
backgroundColor: 'rgba(236,231,231,0.1)'
|
||||
backgroundColor: 'rgba(236,231,231,0.1)',
|
||||
borderActive: true
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -3,7 +3,6 @@ import CommonAttr from '@/custom-component/common/CommonAttr.vue'
|
||||
import { toRefs } from 'vue'
|
||||
import { dvMainStoreWithOut } from '@/store/modules/data-visualization/dvMain'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import TabCarouselSetting from '@/custom-component/common/TabCarouselSetting.vue'
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
@ -27,11 +26,6 @@ const { curComponent } = storeToRefs(dvMainStore)
|
||||
:background-color-picker-width="197"
|
||||
:background-border-select-width="197"
|
||||
>
|
||||
<TabCarouselSetting
|
||||
v-if="curComponent && curComponent.carousel"
|
||||
:element="curComponent"
|
||||
:themes="themes"
|
||||
></TabCarouselSetting>
|
||||
</CommonAttr>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -2,7 +2,7 @@
|
||||
<div
|
||||
v-if="state.tabShow"
|
||||
style="width: 100%; height: 100%"
|
||||
:class="headClass"
|
||||
:class="[headClass, `ed-tabs-${curThemes}`]"
|
||||
class="custom-tabs-head"
|
||||
ref="tabComponentRef"
|
||||
>
|
||||
@ -26,6 +26,7 @@
|
||||
<span :style="titleStyle(tabItem.name)">{{ tabItem.title }}</span>
|
||||
<el-dropdown
|
||||
v-if="isEditMode"
|
||||
:effect="curThemes"
|
||||
style="line-height: 4 !important"
|
||||
trigger="click"
|
||||
@command="handleCommand"
|
||||
@ -116,11 +117,12 @@ import { dvMainStoreWithOut } from '@/store/modules/data-visualization/dvMain'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { guid } from '@/views/visualized/data/dataset/form/util'
|
||||
import eventBus from '@/utils/eventBus'
|
||||
import { canvasChangeAdaptor, findComponentIndexById } from '@/utils/canvasUtils'
|
||||
import { canvasChangeAdaptor, findComponentIndexById, isDashboard } from '@/utils/canvasUtils'
|
||||
import DeCustomTab from '@/custom-component/de-tabs/DeCustomTab.vue'
|
||||
import DePreview from '@/components/data-visualization/canvas/DePreview.vue'
|
||||
import { useEmitt } from '@/hooks/web/useEmitt'
|
||||
import { getPanelAllLinkageInfo } from '@/api/visualization/linkage'
|
||||
import { dataVTabComponentAdd, groupSizeStyleAdaptor } from '@/utils/style'
|
||||
const dvMainStore = dvMainStoreWithOut()
|
||||
const { tabMoveInActiveId, bashMatrixInfo, editMode, mobileInPc } = storeToRefs(dvMainStore)
|
||||
const tabComponentRef = ref(null)
|
||||
@ -180,7 +182,7 @@ const noBorderColor = ref('none')
|
||||
let currentInstance
|
||||
|
||||
const isEditMode = computed(() => editMode.value === 'edit' && isEdit.value && !mobileInPc.value)
|
||||
|
||||
const curThemes = isDashboard() ? 'light' : 'dark'
|
||||
const calcTabLength = () => {
|
||||
setTimeout(() => {
|
||||
if (element.value.propValue.length > 1) {
|
||||
@ -274,21 +276,31 @@ const componentMoveIn = component => {
|
||||
//获取主画布当前组件的index
|
||||
const curIndex = findComponentIndexById(component.id)
|
||||
// 从主画布中移除
|
||||
eventBus.emit('removeMatrixItem-canvas-main', curIndex)
|
||||
dvMainStore.setCurComponent({ component: null, index: null })
|
||||
component.canvasId = element.value.id + '--' + tabItem.name
|
||||
const refInstance = currentInstance.refs['tabCanvas_' + index][0]
|
||||
if (refInstance) {
|
||||
const matrixBase = refInstance.getBaseMatrixSize() //矩阵基础大小
|
||||
canvasChangeAdaptor(component, matrixBase)
|
||||
tabItem.componentData.push(component)
|
||||
nextTick(() => {
|
||||
if (isDashboard()) {
|
||||
eventBus.emit('removeMatrixItem-canvas-main', curIndex)
|
||||
dvMainStore.setCurComponent({ component: null, index: null })
|
||||
component.canvasId = element.value.id + '--' + tabItem.name
|
||||
const refInstance = currentInstance.refs['tabCanvas_' + index][0]
|
||||
if (refInstance) {
|
||||
const matrixBase = refInstance.getBaseMatrixSize() //矩阵基础大小
|
||||
canvasChangeAdaptor(component, matrixBase)
|
||||
component.x = 1
|
||||
component.y = 1
|
||||
component.y = 200
|
||||
component.style.left = 0
|
||||
component.style.top = 0
|
||||
refInstance.addItemBox(component) //在适当的时候初始化布局组件
|
||||
})
|
||||
tabItem.componentData.push(component)
|
||||
if (isDashboard()) {
|
||||
nextTick(() => {
|
||||
refInstance.addItemBox(component) //在适当的时候初始化布局组件
|
||||
})
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// 从主画布删除
|
||||
dvMainStore.deleteComponent(curIndex)
|
||||
dvMainStore.setCurComponent({ component: null, index: null })
|
||||
component.canvasId = element.value.id + '--' + tabItem.name
|
||||
dataVTabComponentAdd(component, element.value.style)
|
||||
}
|
||||
}
|
||||
})
|
||||
@ -302,10 +314,23 @@ const componentMoveOut = component => {
|
||||
eventBus.emit('removeMatrixItemById-' + component.canvasId, component.id)
|
||||
dvMainStore.setCurComponent({ component: null, index: null })
|
||||
// 主画布中添加
|
||||
eventBus.emit('moveOutFromTab-canvas-main', component)
|
||||
if (isDashboard()) {
|
||||
eventBus.emit('moveOutFromTab-canvas-main', component)
|
||||
} else {
|
||||
addToMain(component)
|
||||
}
|
||||
reloadLinkage()
|
||||
}
|
||||
|
||||
const addToMain = component => {
|
||||
component.canvasId = 'canvas-main'
|
||||
dvMainStore.addComponent({
|
||||
component,
|
||||
index: undefined,
|
||||
isFromGroup: true
|
||||
})
|
||||
}
|
||||
|
||||
const moveActive = computed(() => {
|
||||
return tabMoveInActiveId.value && tabMoveInActiveId.value === element.value.id
|
||||
})
|
||||
@ -369,6 +394,12 @@ const borderActiveColor = computed(() => {
|
||||
}
|
||||
})
|
||||
|
||||
const onResetLayout = () => {
|
||||
if (!isDashboard()) {
|
||||
groupSizeStyleAdaptor(element.value)
|
||||
}
|
||||
}
|
||||
|
||||
const titleValid = computed(() => {
|
||||
return !!state.textarea && !!state.textarea.trim()
|
||||
})
|
||||
@ -438,6 +469,9 @@ onMounted(() => {
|
||||
eventBus.on('onTabSortChange-' + element.value.id, reShow)
|
||||
currentInstance = getCurrentInstance()
|
||||
initCarousel()
|
||||
nextTick(() => {
|
||||
groupSizeStyleAdaptor(element.value)
|
||||
})
|
||||
})
|
||||
|
||||
onBeforeMount(() => {
|
||||
@ -454,9 +488,20 @@ onBeforeMount(() => {
|
||||
:deep(.ed-tabs__content) {
|
||||
height: calc(100% - 46px) !important;
|
||||
}
|
||||
:deep(.ed-tabs__new-tab) {
|
||||
margin-right: 25px;
|
||||
background-color: #fff;
|
||||
.ed-tabs-dark {
|
||||
:deep(.ed-tabs__new-tab) {
|
||||
margin-right: 25px;
|
||||
color: #fff;
|
||||
}
|
||||
:deep(.el-dropdown-link) {
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
.ed-tabs-light {
|
||||
:deep(.ed-tabs__new-tab) {
|
||||
margin-right: 25px;
|
||||
background-color: #fff;
|
||||
}
|
||||
}
|
||||
.el-tab-pane-custom {
|
||||
width: 100%;
|
||||
|
@ -0,0 +1,523 @@
|
||||
<template>
|
||||
<div
|
||||
v-if="state.tabShow"
|
||||
style="width: 100%; height: 100%"
|
||||
:class="[headClass, `ed-tabs-${curThemes}`]"
|
||||
class="custom-tabs-head"
|
||||
ref="tabComponentRef"
|
||||
>
|
||||
<de-custom-tab
|
||||
v-model="editableTabsValue"
|
||||
@tab-add="addTab"
|
||||
:addable="isEditMode"
|
||||
:font-color="fontColor"
|
||||
:active-color="activeColor"
|
||||
:border-color="noBorderColor"
|
||||
:border-active-color="borderActiveColor"
|
||||
>
|
||||
<template :key="tabItem.name" v-for="(tabItem, index) in element.propValue">
|
||||
<el-tab-pane
|
||||
class="el-tab-pane-custom"
|
||||
:lazy="isEditMode"
|
||||
:label="tabItem.title"
|
||||
:name="tabItem.name"
|
||||
>
|
||||
<template #label>
|
||||
<span :style="titleStyle(tabItem.name)">{{ tabItem.title }}</span>
|
||||
<el-dropdown
|
||||
v-if="isEditMode"
|
||||
:effect="curThemes"
|
||||
style="line-height: 4 !important"
|
||||
trigger="click"
|
||||
@command="handleCommand"
|
||||
>
|
||||
<span class="el-dropdown-link">
|
||||
<el-icon v-if="isEdit"><ArrowDown /></el-icon>
|
||||
</span>
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<el-dropdown-item :command="beforeHandleCommand('editTitle', tabItem)">
|
||||
编辑标题
|
||||
</el-dropdown-item>
|
||||
|
||||
<el-dropdown-item
|
||||
v-if="element.propValue.length > 1"
|
||||
:command="beforeHandleCommand('deleteCur', tabItem)"
|
||||
>
|
||||
删除
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
</template>
|
||||
<de-canvas
|
||||
v-if="isEdit && !mobileInPc"
|
||||
:ref="'tabCanvas_' + index"
|
||||
:component-data="tabItem.componentData"
|
||||
:canvas-style-data="canvasStyleData"
|
||||
:canvas-view-info="canvasViewInfo"
|
||||
:canvas-id="element.id + '--' + tabItem.name"
|
||||
:class="moveActive ? 'canvas-move-in' : ''"
|
||||
:canvas-active="editableTabsValue === tabItem.name"
|
||||
></de-canvas>
|
||||
<de-preview
|
||||
v-else
|
||||
:ref="'dashboardPreview'"
|
||||
:dv-info="dvInfo"
|
||||
:cur-gap="curPreviewGap"
|
||||
:component-data="tabItem.componentData"
|
||||
:canvas-style-data="canvasStyleData"
|
||||
:canvas-view-info="canvasViewInfo"
|
||||
:canvas-id="element.id + '--' + tabItem.name"
|
||||
:preview-active="editableTabsValue === tabItem.name"
|
||||
:show-position="showPosition"
|
||||
:outer-scale="scale"
|
||||
></de-preview>
|
||||
</el-tab-pane>
|
||||
</template>
|
||||
</de-custom-tab>
|
||||
<el-dialog
|
||||
title="编辑标题"
|
||||
:append-to-body="true"
|
||||
v-model="state.dialogVisible"
|
||||
width="30%"
|
||||
:show-close="false"
|
||||
:close-on-click-modal="false"
|
||||
center
|
||||
>
|
||||
<el-input
|
||||
v-model="state.textarea"
|
||||
maxlength="50"
|
||||
:placeholder="$t('dataset.input_content')"
|
||||
/>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="state.dialogVisible = false">取消</el-button>
|
||||
<el-button :disabled="!titleValid" type="primary" @click="sureCurTitle">确认</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import {
|
||||
computed,
|
||||
getCurrentInstance,
|
||||
nextTick,
|
||||
onBeforeMount,
|
||||
onMounted,
|
||||
reactive,
|
||||
ref,
|
||||
toRefs,
|
||||
watch
|
||||
} from 'vue'
|
||||
import DeCanvas from '@/views/canvas/DeCanvas.vue'
|
||||
import { dvMainStoreWithOut } from '@/store/modules/data-visualization/dvMain'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { guid } from '@/views/visualized/data/dataset/form/util'
|
||||
import eventBus from '@/utils/eventBus'
|
||||
import { canvasChangeAdaptor, findComponentIndexById, isDashboard } from '@/utils/canvasUtils'
|
||||
import DeCustomTab from '@/custom-component/de-tabs/DeCustomTab.vue'
|
||||
import DePreview from '@/components/data-visualization/canvas/DePreview.vue'
|
||||
import { useEmitt } from '@/hooks/web/useEmitt'
|
||||
import { getPanelAllLinkageInfo } from '@/api/visualization/linkage'
|
||||
import { dataVTabComponentAdd, groupSizeStyleAdaptor } from '@/utils/style'
|
||||
const dvMainStore = dvMainStoreWithOut()
|
||||
const { tabMoveInActiveId, bashMatrixInfo, editMode, mobileInPc } = storeToRefs(dvMainStore)
|
||||
const tabComponentRef = ref(null)
|
||||
let carouselTimer = null
|
||||
|
||||
const props = defineProps({
|
||||
canvasStyleData: {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
canvasViewInfo: {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
dvInfo: {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
element: {
|
||||
type: Object,
|
||||
default() {
|
||||
return {
|
||||
propValue: []
|
||||
}
|
||||
}
|
||||
},
|
||||
isEdit: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
showPosition: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: 'canvas'
|
||||
},
|
||||
scale: {
|
||||
type: Number,
|
||||
required: false,
|
||||
default: 1
|
||||
}
|
||||
})
|
||||
const { element, isEdit, showPosition, canvasStyleData, canvasViewInfo, dvInfo, scale } =
|
||||
toRefs(props)
|
||||
|
||||
const state = reactive({
|
||||
activeTabName: '',
|
||||
curItem: {},
|
||||
textarea: '',
|
||||
dialogVisible: false,
|
||||
tabShow: true
|
||||
})
|
||||
const tabsAreaScroll = ref(false)
|
||||
const editableTabsValue = ref(null)
|
||||
|
||||
// 无边框
|
||||
const noBorderColor = ref('none')
|
||||
let currentInstance
|
||||
|
||||
const isEditMode = computed(() => editMode.value === 'edit' && isEdit.value && !mobileInPc.value)
|
||||
const curThemes = isDashboard() ? 'light' : 'dark'
|
||||
const calcTabLength = () => {
|
||||
setTimeout(() => {
|
||||
if (element.value.propValue.length > 1) {
|
||||
const containerDom = document.getElementById(
|
||||
'tab-' + element.value.propValue[element.value.propValue.length - 1].name
|
||||
)
|
||||
tabsAreaScroll.value =
|
||||
containerDom.parentNode.clientWidth > tabComponentRef.value.clientWidth - 100
|
||||
} else {
|
||||
tabsAreaScroll.value = false
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const beforeHandleCommand = (item, param) => {
|
||||
return {
|
||||
command: item,
|
||||
param: param
|
||||
}
|
||||
}
|
||||
const curPreviewGap = computed(() =>
|
||||
dvInfo.value.type === 'dashboard' && canvasStyleData.value['dashboard'].gap === 'yes'
|
||||
? canvasStyleData.value['dashboard'].gapSize
|
||||
: 0
|
||||
)
|
||||
|
||||
function sureCurTitle() {
|
||||
state.curItem.title = state.textarea
|
||||
state.dialogVisible = false
|
||||
}
|
||||
|
||||
function addTab() {
|
||||
const newName = guid()
|
||||
const newTab = {
|
||||
name: newName,
|
||||
title: '新建Tab',
|
||||
componentData: [],
|
||||
closable: true
|
||||
}
|
||||
element.value.propValue.push(newTab)
|
||||
editableTabsValue.value = newTab.name
|
||||
}
|
||||
|
||||
function deleteCur(param) {
|
||||
state.curItem = param
|
||||
let len = element.value.propValue.length
|
||||
while (len--) {
|
||||
if (element.value.propValue[len].name === param.name) {
|
||||
element.value.propValue.splice(len, 1)
|
||||
const activeIndex =
|
||||
(len - 1 + element.value.propValue.length) % element.value.propValue.length
|
||||
editableTabsValue.value = element.value.propValue[activeIndex].name
|
||||
state.tabShow = false
|
||||
nextTick(() => {
|
||||
state.tabShow = true
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function editCurTitle(param) {
|
||||
state.activeTabName = param.name
|
||||
state.curItem = param
|
||||
state.textarea = param.title
|
||||
state.dialogVisible = true
|
||||
}
|
||||
|
||||
function handleCommand(command) {
|
||||
switch (command.command) {
|
||||
case 'editTitle':
|
||||
editCurTitle(command.param)
|
||||
break
|
||||
case 'deleteCur':
|
||||
deleteCur(command.param)
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
const reloadLinkage = () => {
|
||||
// 刷新联动信息
|
||||
if (dvInfo.value.id) {
|
||||
getPanelAllLinkageInfo(dvInfo.value.id).then(rsp => {
|
||||
dvMainStore.setNowPanelTrackInfo(rsp.data)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
const componentMoveIn = component => {
|
||||
element.value.propValue.forEach((tabItem, index) => {
|
||||
if (editableTabsValue.value === tabItem.name) {
|
||||
//获取主画布当前组件的index
|
||||
const curIndex = findComponentIndexById(component.id)
|
||||
// 从主画布中移除
|
||||
if (isDashboard()) {
|
||||
eventBus.emit('removeMatrixItem-canvas-main', curIndex)
|
||||
dvMainStore.setCurComponent({ component: null, index: null })
|
||||
component.canvasId = element.value.id + '--' + tabItem.name
|
||||
const refInstance = currentInstance.refs['tabCanvas_' + index][0]
|
||||
if (refInstance) {
|
||||
const matrixBase = refInstance.getBaseMatrixSize() //矩阵基础大小
|
||||
canvasChangeAdaptor(component, matrixBase)
|
||||
component.x = 1
|
||||
component.y = 200
|
||||
component.style.left = 0
|
||||
component.style.top = 0
|
||||
tabItem.componentData.push(component)
|
||||
if (isDashboard()) {
|
||||
nextTick(() => {
|
||||
refInstance.addItemBox(component) //在适当的时候初始化布局组件
|
||||
})
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// 从主画布删除
|
||||
dvMainStore.deleteComponent(curIndex)
|
||||
dvMainStore.setCurComponent({ component: null, index: null })
|
||||
component.canvasId = element.value.id + '--' + tabItem.name
|
||||
dataVTabComponentAdd(component, element.value.style)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
reloadLinkage()
|
||||
}
|
||||
|
||||
const componentMoveOut = component => {
|
||||
canvasChangeAdaptor(component, bashMatrixInfo.value, true)
|
||||
// 从Tab画布中移除
|
||||
eventBus.emit('removeMatrixItemById-' + component.canvasId, component.id)
|
||||
dvMainStore.setCurComponent({ component: null, index: null })
|
||||
// 主画布中添加
|
||||
if (isDashboard()) {
|
||||
eventBus.emit('moveOutFromTab-canvas-main', component)
|
||||
} else {
|
||||
addToMain(component)
|
||||
}
|
||||
reloadLinkage()
|
||||
}
|
||||
|
||||
const addToMain = component => {
|
||||
component.canvasId = 'canvas-main'
|
||||
dvMainStore.addComponent({
|
||||
component,
|
||||
index: undefined,
|
||||
isFromGroup: true
|
||||
})
|
||||
}
|
||||
|
||||
const moveActive = computed(() => {
|
||||
return tabMoveInActiveId.value && tabMoveInActiveId.value === element.value.id
|
||||
})
|
||||
|
||||
const headClass = computed(() => {
|
||||
if (tabsAreaScroll.value) {
|
||||
return 'tab-head-left'
|
||||
} else {
|
||||
return 'tab-head-' + element.value.style.headHorizontalPosition
|
||||
}
|
||||
})
|
||||
|
||||
const titleStyle = itemName => {
|
||||
if (editableTabsValue.value === itemName) {
|
||||
return {
|
||||
fontSize: (element.value.style.activeFontSize || 18) * scale.value + 'px'
|
||||
}
|
||||
} else {
|
||||
return {
|
||||
fontSize: (element.value.style.fontSize || 16) * scale.value + 'px'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const fontColor = computed(() => {
|
||||
if (
|
||||
element.value &&
|
||||
element.value.style &&
|
||||
element.value.style.headFontColor &&
|
||||
typeof element.value.style.headFontColor === 'string'
|
||||
) {
|
||||
return element.value.style.headFontColor
|
||||
} else {
|
||||
return 'none'
|
||||
}
|
||||
})
|
||||
|
||||
const activeColor = computed(() => {
|
||||
if (
|
||||
element.value &&
|
||||
element.value.style &&
|
||||
element.value.style.headFontActiveColor &&
|
||||
typeof element.value.style.headFontActiveColor === 'string'
|
||||
) {
|
||||
return element.value.style.headFontActiveColor
|
||||
} else {
|
||||
return 'none'
|
||||
}
|
||||
})
|
||||
|
||||
const borderActiveColor = computed(() => {
|
||||
if (
|
||||
element.value &&
|
||||
element.value.style &&
|
||||
element.value.style.headBorderActiveColor &&
|
||||
typeof element.value.style.headBorderActiveColor === 'string'
|
||||
) {
|
||||
return element.value.style.headBorderActiveColor
|
||||
} else {
|
||||
return 'none'
|
||||
}
|
||||
})
|
||||
|
||||
const titleValid = computed(() => {
|
||||
return !!state.textarea && !!state.textarea.trim()
|
||||
})
|
||||
|
||||
watch(
|
||||
() => element.value,
|
||||
() => {
|
||||
calcTabLength()
|
||||
},
|
||||
{ deep: true }
|
||||
)
|
||||
|
||||
watch(
|
||||
() => editableTabsValue.value,
|
||||
() => {
|
||||
nextTick(() => {
|
||||
useEmitt().emitter.emit('tabCanvasChange-' + activeCanvasId.value)
|
||||
})
|
||||
},
|
||||
{ deep: true }
|
||||
)
|
||||
|
||||
const activeCanvasId = computed(() => {
|
||||
return element.value.id + '--' + editableTabsValue.value
|
||||
})
|
||||
|
||||
const reShow = () => {
|
||||
state.tabShow = false
|
||||
nextTick(() => {
|
||||
state.tabShow = true
|
||||
})
|
||||
}
|
||||
|
||||
watch(
|
||||
() => isEditMode.value,
|
||||
() => {
|
||||
initCarousel()
|
||||
}
|
||||
)
|
||||
|
||||
const initCarousel = () => {
|
||||
carouselTimer && clearInterval(carouselTimer)
|
||||
carouselTimer = null
|
||||
if (!isEditMode.value) {
|
||||
if (element.value.carousel?.enable) {
|
||||
const switchTime = (element.value.carousel.time || 5) * 1000
|
||||
let switchCount = 1
|
||||
// 轮播定时器
|
||||
carouselTimer = setInterval(() => {
|
||||
const nowIndex = switchCount % element.value.propValue.length
|
||||
switchCount++
|
||||
nextTick(() => {
|
||||
editableTabsValue.value = element.value.propValue[nowIndex].name
|
||||
})
|
||||
}, switchTime)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
if (element.value.propValue.length > 0) {
|
||||
editableTabsValue.value = element.value.propValue[0].name
|
||||
}
|
||||
calcTabLength()
|
||||
eventBus.on('onTabMoveIn-' + element.value.id, componentMoveIn)
|
||||
eventBus.on('onTabMoveOut-' + element.value.id, componentMoveOut)
|
||||
eventBus.on('onTabSortChange-' + element.value.id, reShow)
|
||||
currentInstance = getCurrentInstance()
|
||||
initCarousel()
|
||||
nextTick(() => {
|
||||
groupSizeStyleAdaptor(element.value)
|
||||
})
|
||||
})
|
||||
|
||||
onBeforeMount(() => {
|
||||
eventBus.off('onTabMoveIn-' + element.value.id, componentMoveIn)
|
||||
eventBus.off('onTabMoveOut-' + element.value.id, componentMoveOut)
|
||||
eventBus.off('onTabSortChange-' + element.value.id, reShow)
|
||||
if (carouselTimer) {
|
||||
clearInterval(carouselTimer)
|
||||
carouselTimer = null
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
:deep(.ed-tabs__content) {
|
||||
height: calc(100% - 46px) !important;
|
||||
}
|
||||
.ed-tabs-dark {
|
||||
:deep(.ed-tabs__new-tab) {
|
||||
margin-right: 25px;
|
||||
color: #fff;
|
||||
}
|
||||
:deep(.el-dropdown-link) {
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
.ed-tabs-light {
|
||||
:deep(.ed-tabs__new-tab) {
|
||||
margin-right: 25px;
|
||||
background-color: #fff;
|
||||
}
|
||||
}
|
||||
.el-tab-pane-custom {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.canvas-move-in {
|
||||
border: 2px dotted transparent;
|
||||
border-color: blueviolet;
|
||||
}
|
||||
|
||||
.tab-head-left :deep(.ed-tabs__nav-scroll) {
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
}
|
||||
|
||||
.tab-head-right :deep(.ed-tabs__nav-scroll) {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.tab-head-center :deep(.ed-tabs__nav-scroll) {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
</style>
|
@ -361,7 +361,7 @@ const calcData = (view, callback) => {
|
||||
chartData.value = res?.data as Partial<Chart['data']>
|
||||
emit('onDrillFilters', res?.drillFilters)
|
||||
|
||||
dvMainStore.setViewDataDetails(view.id, chartData.value)
|
||||
dvMainStore.setViewDataDetails(view.id, res)
|
||||
renderChart(res)
|
||||
}
|
||||
callback?.()
|
||||
|
@ -355,7 +355,7 @@ const editCursor = () => {
|
||||
plugins: 'table',
|
||||
setup: function (editor) {
|
||||
editor.on('init', function () {
|
||||
console.log('====init====')
|
||||
console.info('====init====')
|
||||
})
|
||||
}
|
||||
})
|
||||
@ -377,7 +377,7 @@ const calcData = (view: Chart, callback) => {
|
||||
state.totalItems = res?.totalItems
|
||||
const curViewInfo = canvasViewInfo.value[element.value.id]
|
||||
curViewInfo['curFields'] = res.data.fields
|
||||
dvMainStore.setViewDataDetails(element.value.id, state.data)
|
||||
dvMainStore.setViewDataDetails(element.value.id, res)
|
||||
initReady.value = true
|
||||
initCurFields(res)
|
||||
}
|
||||
@ -397,10 +397,13 @@ const calcData = (view: Chart, callback) => {
|
||||
state.viewDataInfo = {}
|
||||
state.totalItems = 0
|
||||
const curViewInfo = canvasViewInfo.value[element.value.id]
|
||||
curViewInfo['curFields'] = []
|
||||
dvMainStore.setViewDataDetails(element.value.id, state.data)
|
||||
if (curViewInfo) {
|
||||
curViewInfo['curFields'] = []
|
||||
dvMainStore.setViewDataDetails(element.value.id, state.viewDataInfo)
|
||||
initReady.value = true
|
||||
initCurFields(curViewInfo)
|
||||
}
|
||||
initReady.value = true
|
||||
initCurFields(curViewInfo)
|
||||
callback?.()
|
||||
nextTick(() => {
|
||||
initReady.value = true
|
||||
|
@ -91,8 +91,6 @@ watch(
|
||||
)
|
||||
|
||||
const init = () => {
|
||||
console.log('relativeToCurrentRange')
|
||||
|
||||
const {
|
||||
timeNum,
|
||||
relativeToCurrentType,
|
||||
|
@ -1536,7 +1536,7 @@ defineExpose({
|
||||
v-model="curComponent.checkedFields"
|
||||
@change="handleCheckedFieldsChangeTree"
|
||||
>
|
||||
<div v-for="field in fields" :key="field.componentId" class="list-item">
|
||||
<div v-for="field in fields" :key="field.componentId" class="list-item_field_de">
|
||||
<el-checkbox :label="field.componentId"
|
||||
><el-icon class="component-type">
|
||||
<Icon :name="canvasViewInfo[field.componentId].type"></Icon> </el-icon
|
||||
@ -2261,7 +2261,7 @@ defineExpose({
|
||||
font-size: 20px;
|
||||
color: var(--ed-color-primary);
|
||||
}
|
||||
.list-item {
|
||||
.list-item_field_de {
|
||||
height: 32px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
@ -376,6 +376,7 @@ export default {
|
||||
commit_time: 'Commit Time',
|
||||
confirm_delete: 'Confirm delete?',
|
||||
add_data: 'Add Data',
|
||||
batch_upload: 'Upload Data',
|
||||
download_template: 'Download Template',
|
||||
insert_data: 'Insert Data',
|
||||
update_data: 'Update Data',
|
||||
@ -438,7 +439,7 @@ export default {
|
||||
assigned_task: 'Assigned Task',
|
||||
task_finish_in: 'Task Finished in ',
|
||||
task_finish_in_suffix: '',
|
||||
open_sub_task: 'Open Sub Tasks'
|
||||
open_sub_task: 'Open Assigned Tasks'
|
||||
},
|
||||
on_the_left: 'Please select a form on the left',
|
||||
search_by_commit_name: 'Search by operator name'
|
||||
|
@ -277,6 +277,7 @@ export default {
|
||||
commit_time: '提交時間',
|
||||
confirm_delete: '確認刪除?',
|
||||
add_data: '添加數據',
|
||||
batch_upload: '批量上傳',
|
||||
download_template: '下載模板',
|
||||
insert_data: '插入數據',
|
||||
update_data: '更新數據',
|
||||
@ -339,7 +340,7 @@ export default {
|
||||
assigned_task: '已下發任務',
|
||||
task_finish_in: '在任務下發',
|
||||
task_finish_in_suffix: '內完成填報',
|
||||
open_sub_task: '查看子任務'
|
||||
open_sub_task: '查看已下發任務'
|
||||
},
|
||||
on_the_left: '請在左側選擇表單',
|
||||
search_by_commit_name: '根據操作人名稱搜索'
|
||||
|
@ -2707,6 +2707,7 @@ export default {
|
||||
commit_time: '提交时间',
|
||||
confirm_delete: '确认删除?',
|
||||
add_data: '添加数据',
|
||||
batch_upload: '批量上传',
|
||||
download_template: '下载模板',
|
||||
insert_data: '插入数据',
|
||||
update_data: '更新数据',
|
||||
@ -2769,7 +2770,7 @@ export default {
|
||||
assigned_task: '已下发任务',
|
||||
task_finish_in: '在任务下发',
|
||||
task_finish_in_suffix: '内完成填报',
|
||||
open_sub_task: '查看子任务'
|
||||
open_sub_task: '查看已下发任务'
|
||||
},
|
||||
on_the_left: '请在左侧选择表单',
|
||||
search_by_commit_name: '根据操作人名称搜索'
|
||||
@ -2780,6 +2781,9 @@ export default {
|
||||
status: '数据状态',
|
||||
base_setting: '基本设置',
|
||||
threshold_setting: '告警设置',
|
||||
name: '告警名称'
|
||||
name: '告警名称',
|
||||
grid_title: '告警管理',
|
||||
grid: '告警列表',
|
||||
record: '告警记录'
|
||||
}
|
||||
}
|
||||
|
@ -705,6 +705,28 @@ declare interface ChartMiscAttr {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 词云图轴值配置
|
||||
*/
|
||||
wordCloudAxisValueRange: {
|
||||
/**
|
||||
* 自动轴值
|
||||
*/
|
||||
auto: boolean
|
||||
/**
|
||||
* 最小值
|
||||
*/
|
||||
min: number
|
||||
/**
|
||||
* 最大值
|
||||
*/
|
||||
max: number
|
||||
/**
|
||||
* 轴值字段
|
||||
*/
|
||||
fieldId: string
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 动态极值配置
|
||||
@ -813,6 +835,11 @@ declare interface ChartLabelAttr {
|
||||
* 显示极值
|
||||
*/
|
||||
showExtremum?: boolean
|
||||
|
||||
/**
|
||||
* 转化率标签
|
||||
*/
|
||||
conversionTag: ConversionTagAtt
|
||||
}
|
||||
/**
|
||||
* 提示设置
|
||||
@ -858,6 +885,11 @@ declare interface ChartTooltipAttr {
|
||||
* 自定义显示内容
|
||||
*/
|
||||
customContent?: string
|
||||
|
||||
/**
|
||||
* 轮播设置
|
||||
*/
|
||||
carousel: CarouselAttr
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1057,3 +1089,36 @@ declare interface ChartIndicatorNameStyle {
|
||||
*/
|
||||
nameValueSpacing: number
|
||||
}
|
||||
|
||||
/**
|
||||
* 轮播属性
|
||||
*/
|
||||
declare interface CarouselAttr {
|
||||
/**
|
||||
* 是否启用
|
||||
*/
|
||||
enable: boolean
|
||||
/**
|
||||
* 停留时间 秒
|
||||
*/
|
||||
stayTime: number
|
||||
/**
|
||||
* 轮播间隔时间 秒
|
||||
*/
|
||||
intervalTime: number
|
||||
}
|
||||
|
||||
declare interface ConversionTagAtt {
|
||||
/**
|
||||
* 是否显示
|
||||
*/
|
||||
show: boolean
|
||||
/**
|
||||
* 文本
|
||||
*/
|
||||
text: string
|
||||
/**
|
||||
* 精度
|
||||
*/
|
||||
precision: number
|
||||
}
|
||||
|
@ -67,6 +67,7 @@ declare interface Chart {
|
||||
seriesFieldObjs?: any[]
|
||||
flowMapStartName?: Axis[]
|
||||
flowMapEndName?: Axis[]
|
||||
showPosition: string
|
||||
}
|
||||
declare type CustomAttr = DeepPartial<ChartAttr> | JSONString<DeepPartial<ChartAttr>>
|
||||
declare type CustomStyle = DeepPartial<ChartStyle> | JSONString<DeepPartial<ChartStyle>>
|
||||
|
@ -1,5 +1,6 @@
|
||||
declare type EditorProperty =
|
||||
| 'background-overall-component'
|
||||
| 'border-style'
|
||||
| 'basic-style-selector'
|
||||
| 'dual-basic-style-selector'
|
||||
| 'label-selector'
|
||||
|
@ -168,20 +168,14 @@ class DataEaseBi {
|
||||
}
|
||||
|
||||
destroy() {
|
||||
import('@/store/modules/user').then(res => {
|
||||
const userStore = res.userStore()
|
||||
userStore.setUser()
|
||||
})
|
||||
const embeddedStore = useEmbedded()
|
||||
embeddedStore.setType(null)
|
||||
embeddedStore.setBusiFlag(null)
|
||||
embeddedStore.setOuterParams(null)
|
||||
embeddedStore.setToken(null)
|
||||
embeddedStore.setBaseUrl(null)
|
||||
embeddedStore.setDvId(null)
|
||||
embeddedStore.setPid(null)
|
||||
embeddedStore.setChartId(null)
|
||||
embeddedStore.setResourceId(null)
|
||||
embeddedStore.clearState()
|
||||
this.vm.unmount()
|
||||
this.type = null
|
||||
this.token = null
|
||||
|
@ -13,6 +13,7 @@ const dvMainStore = dvMainStoreWithOut()
|
||||
const composeStore = composeStoreWithOut()
|
||||
const contextmenuStore = contextmenuStoreWithOut()
|
||||
const {
|
||||
multiplexingStyleAdapt,
|
||||
curComponent,
|
||||
curComponentIndex,
|
||||
curMultiplexingComponents,
|
||||
@ -52,13 +53,17 @@ export const copyStore = defineStore('copy', {
|
||||
// dashboard 平铺2个
|
||||
const xPositionOffset = index % 2
|
||||
const yPositionOffset = index % 2
|
||||
newComponent.sizeX = pcMatrixCount.value.x / 2
|
||||
newComponent.sizeY = 14
|
||||
if (!(copyFrom === 'multiplexing' && !multiplexingStyleAdapt.value)) {
|
||||
newComponent.sizeX = pcMatrixCount.value.x / 2
|
||||
newComponent.sizeY = 14
|
||||
// dataV 数据大屏
|
||||
newComponent.style.width = ((canvasStyleData.value.width / 3) * scale) / 100
|
||||
newComponent.style.height = ((canvasStyleData.value.height / 3) * scale) / 100
|
||||
}
|
||||
// dataV 数据大屏
|
||||
newComponent.x = newComponent.sizeX * xPositionOffset + 1
|
||||
newComponent.y = 200
|
||||
// dataV 数据大屏
|
||||
newComponent.style.width = (width * scale) / 400
|
||||
newComponent.style.height = (height * scale) / 400
|
||||
newComponent.style.left = 0
|
||||
newComponent.style.top = 0
|
||||
}
|
||||
|
@ -539,7 +539,6 @@ export const dvMainStore = defineStore('dataVisualization', {
|
||||
if (item.linkageFilters && item.linkageFilters.length > 0) {
|
||||
const historyLinkageFiltersLength = item.linkageFilters.length
|
||||
const newList = item.linkageFilters.filter(linkage => linkage.sourceViewId !== viewId)
|
||||
console.log('===newList= ' + JSON.stringify(newList))
|
||||
item.linkageFilters.splice(0, item.linkageFilters.length)
|
||||
// 重新push 可保证数组指针不变 可以watch到
|
||||
if (newList.length > 0) {
|
||||
@ -1189,8 +1188,23 @@ export const dvMainStore = defineStore('dataVisualization', {
|
||||
mobileLayout: false
|
||||
}
|
||||
},
|
||||
setViewDataDetails(viewId, dataInfo) {
|
||||
this.canvasViewDataInfo[viewId] = dataInfo
|
||||
setViewDataDetails(viewId, chartDataInfo) {
|
||||
this.canvasViewDataInfo[viewId] = chartDataInfo.data
|
||||
const viewInfo = this.canvasViewInfo[viewId]
|
||||
const oldCalParams = viewInfo.calParams
|
||||
? viewInfo.calParams.reduce((map, params) => {
|
||||
map[params.id] = params.value
|
||||
return map
|
||||
}, {})
|
||||
: {}
|
||||
if (chartDataInfo.calParams) {
|
||||
chartDataInfo.calParams.forEach(paramsItem => {
|
||||
if (oldCalParams[paramsItem.id]) {
|
||||
paramsItem.value = oldCalParams[paramsItem.id]
|
||||
}
|
||||
})
|
||||
}
|
||||
this.canvasViewInfo[viewId]['calParams'] = chartDataInfo.calParams || null
|
||||
},
|
||||
getViewDataDetails(viewId) {
|
||||
return this.canvasViewDataInfo[viewId]
|
||||
|
@ -7,7 +7,6 @@ import type { BusiTreeRequest, BusiTreeNode } from '@/models/tree/TreeNode'
|
||||
import { pathValid } from '@/store/modules/permission'
|
||||
import { useCache } from '@/hooks/web/useCache'
|
||||
import { useAppStoreWithOut } from '@/store/modules/app'
|
||||
import { listDataFillingForms } from '@/api/data-filling'
|
||||
const appStore = useAppStoreWithOut()
|
||||
const { wsCache } = useCache()
|
||||
export interface InnerInteractive {
|
||||
@ -22,9 +21,9 @@ interface InteractiveState {
|
||||
data: Record<number, InnerInteractive>
|
||||
}
|
||||
|
||||
const apiMap = [queryTreeApi, queryTreeApi, getDatasetTree, listDatasources, listDataFillingForms]
|
||||
const apiMap = [queryTreeApi, queryTreeApi, getDatasetTree, listDatasources]
|
||||
|
||||
const busiFlagMap = ['dashboard', 'dataV', 'dataset', 'datasource', 'data-filling']
|
||||
const busiFlagMap = ['dashboard', 'dataV', 'dataset', 'datasource']
|
||||
|
||||
export const interactiveStore = defineStore('interactive', {
|
||||
state: (): InteractiveState => ({
|
||||
|
@ -152,6 +152,9 @@ body {
|
||||
.field-icon-red {
|
||||
color: #f54a45;
|
||||
}
|
||||
.field-icon-url {
|
||||
color: #3370ff;
|
||||
}
|
||||
|
||||
.field-icon-sort {
|
||||
font-size: 10px;
|
||||
@ -516,3 +519,25 @@ strong {
|
||||
overflow: hidden;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.preview-content-inner-full {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow-x: hidden;
|
||||
overflow-y: hidden;
|
||||
}
|
||||
|
||||
.preview-content-inner-width-first {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.preview-content-inner-height-first {
|
||||
width: auto;
|
||||
height: 100%;
|
||||
overflow-x: auto;
|
||||
overflow-y: hidden;
|
||||
}
|
||||
|
@ -99,8 +99,17 @@ export const selectKey = ['textAlign', 'borderStyle', 'verticalAlign']
|
||||
|
||||
export const horizontalPosition = ['headHorizontalPosition']
|
||||
|
||||
export const fieldType = ['text', 'time', 'value', 'value', 'value', 'location']
|
||||
export const fieldTypeText = ['文本', '时间', '数值', '数值(小数)', '数值', '地理位置']
|
||||
export const fieldType = ['text', 'time', 'value', 'value', 'value', 'location', 'binary', 'url']
|
||||
export const fieldTypeText = [
|
||||
'文本',
|
||||
'时间',
|
||||
'数值',
|
||||
'数值(小数)',
|
||||
'数值',
|
||||
'地理位置',
|
||||
'文件',
|
||||
'URL'
|
||||
]
|
||||
|
||||
export const optionMap = {
|
||||
textAlign: textAlignOptions,
|
||||
|
@ -318,29 +318,32 @@ export function recursionTransObj(template, infoObj, scale, terminal) {
|
||||
for (const templateKey in template) {
|
||||
// 如果是数组 进行赋值计算
|
||||
if (template[templateKey] instanceof Array) {
|
||||
template[templateKey].forEach(templateProp => {
|
||||
if (
|
||||
infoObj[templateKey] &&
|
||||
(infoObj[templateKey][templateProp] || infoObj[templateKey].length)
|
||||
) {
|
||||
// 移动端特殊属性值设置
|
||||
if (terminal === 'mobile' && mobileSpecialProps[templateProp] !== undefined) {
|
||||
infoObj[templateKey][templateProp] = mobileSpecialProps[templateProp]
|
||||
} else {
|
||||
// 数组依次设置
|
||||
if (infoObj[templateKey] instanceof Array) {
|
||||
infoObj[templateKey].forEach(v => {
|
||||
v[templateProp] = getScaleValue(v[templateProp], scale)
|
||||
})
|
||||
// 词云图的大小区间,不需要缩放
|
||||
template[templateKey]
|
||||
.filter(field => field !== 'wordSizeRange')
|
||||
.forEach(templateProp => {
|
||||
if (
|
||||
infoObj[templateKey] &&
|
||||
(infoObj[templateKey][templateProp] || infoObj[templateKey].length)
|
||||
) {
|
||||
// 移动端特殊属性值设置
|
||||
if (terminal === 'mobile' && mobileSpecialProps[templateProp] !== undefined) {
|
||||
infoObj[templateKey][templateProp] = mobileSpecialProps[templateProp]
|
||||
} else {
|
||||
infoObj[templateKey][templateProp] = getScaleValue(
|
||||
infoObj[templateKey][templateProp],
|
||||
scale
|
||||
)
|
||||
// 数组依次设置
|
||||
if (infoObj[templateKey] instanceof Array) {
|
||||
infoObj[templateKey].forEach(v => {
|
||||
v[templateProp] = getScaleValue(v[templateProp], scale)
|
||||
})
|
||||
} else {
|
||||
infoObj[templateKey][templateProp] = getScaleValue(
|
||||
infoObj[templateKey][templateProp],
|
||||
scale
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
} else if (typeof template[templateKey] === 'string') {
|
||||
// 一级字段为字符串直接赋值
|
||||
infoObj[templateKey] = getScaleValue(infoObj[templateKey], scale)
|
||||
|
@ -120,6 +120,68 @@ function matrixAdaptor(componentItem) {
|
||||
}
|
||||
}
|
||||
|
||||
export function historyItemAdaptor(
|
||||
componentItem,
|
||||
reportFilterInfo,
|
||||
attachInfo,
|
||||
canvasVersion,
|
||||
canvasInfo
|
||||
) {
|
||||
componentItem['canvasActive'] = false
|
||||
// 定时报告过滤组件适配 如果当前是定时报告默认切有设置对应的过滤组件默认值,则替换过滤组件
|
||||
if (
|
||||
componentItem.component === 'VQuery' &&
|
||||
attachInfo.source === 'report' &&
|
||||
!!reportFilterInfo
|
||||
) {
|
||||
componentItem.propValue.forEach((filterItem, index) => {
|
||||
if (reportFilterInfo[filterItem.id]) {
|
||||
componentItem.propValue[index] = JSON.parse(reportFilterInfo[filterItem.id].filterInfo)
|
||||
}
|
||||
})
|
||||
}
|
||||
if (componentItem.component === 'Group') {
|
||||
componentItem.expand = componentItem.expand || false
|
||||
}
|
||||
|
||||
if (componentItem.component === 'Picture') {
|
||||
componentItem.style['adaptation'] = componentItem.style['adaptation'] || 'adaptation'
|
||||
}
|
||||
// public
|
||||
componentItem['maintainRadio'] = componentItem['maintainRadio'] || false
|
||||
componentItem['multiDimensional'] =
|
||||
componentItem['multiDimensional'] || deepCopy(MULTI_DIMENSIONAL)
|
||||
componentItem['carousel'] = componentItem['carousel'] || deepCopy(BASE_CAROUSEL)
|
||||
componentItem['aspectRatio'] = componentItem['aspectRatio'] || 1
|
||||
if (componentItem.component === 'UserView') {
|
||||
componentItem.actionSelection = componentItem.actionSelection || deepCopy(ACTION_SELECTION)
|
||||
}
|
||||
// 2 为基础版本 此处需要增加仪表板矩阵密度
|
||||
if ((!canvasVersion || canvasVersion === 2) && canvasInfo.type === 'dashboard') {
|
||||
matrixAdaptor(componentItem)
|
||||
}
|
||||
// 组件事件适配
|
||||
componentItem.events =
|
||||
componentItem.events &&
|
||||
componentItem.events.checked !== undefined &&
|
||||
componentItem.events.type !== 'displayChange'
|
||||
? componentItem.events
|
||||
: deepCopy(BASE_EVENTS)
|
||||
componentItem['category'] = componentItem['category'] || 'base'
|
||||
|
||||
if (componentItem.component === 'DeTabs') {
|
||||
componentItem.propValue.forEach(tabItem => {
|
||||
tabItem.componentData.forEach(tabComponent => {
|
||||
historyItemAdaptor(tabComponent, reportFilterInfo, attachInfo, canvasVersion, canvasInfo)
|
||||
})
|
||||
})
|
||||
} else if (componentItem.component === 'Group') {
|
||||
componentItem.propValue.forEach(groupItem => {
|
||||
historyItemAdaptor(groupItem, reportFilterInfo, attachInfo, canvasVersion, canvasInfo)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export function historyAdaptor(
|
||||
canvasStyleResult,
|
||||
canvasDataResult,
|
||||
@ -130,49 +192,19 @@ export function historyAdaptor(
|
||||
//历史字段适配
|
||||
canvasStyleResult.component['seniorStyleSetting'] =
|
||||
canvasStyleResult.component['seniorStyleSetting'] || deepCopy(SENIOR_STYLE_SETTING_LIGHT)
|
||||
canvasStyleResult['screenAdaptor'] = canvasStyleResult['screenAdaptor'] || 'widthFirst'
|
||||
// 同步宽高比例(大屏使用)
|
||||
canvasStyleResult['scaleWidth'] = canvasStyleResult['scale']
|
||||
canvasStyleResult['scaleHeight'] = canvasStyleResult['scale']
|
||||
canvasStyleResult['popupAvailable'] =
|
||||
canvasStyleResult['popupAvailable'] === undefined ? true : canvasStyleResult['popupAvailable'] //兼容弹框区域开关
|
||||
canvasStyleResult['popupButtonAvailable'] =
|
||||
canvasStyleResult['popupButtonAvailable'] === undefined
|
||||
? true
|
||||
: canvasStyleResult['popupButtonAvailable'] //兼容弹框区域按钮开关
|
||||
const reportFilterInfo = canvasInfo.reportFilterInfo
|
||||
canvasDataResult.forEach(componentItem => {
|
||||
componentItem['canvasActive'] = false
|
||||
// 定时报告过滤组件适配 如果当前是定时报告默认切有设置对应的过滤组件默认值,则替换过滤组件
|
||||
if (
|
||||
componentItem.component === 'VQuery' &&
|
||||
attachInfo.source === 'report' &&
|
||||
!!reportFilterInfo
|
||||
) {
|
||||
componentItem.propValue.forEach((filterItem, index) => {
|
||||
if (reportFilterInfo[filterItem.id]) {
|
||||
componentItem.propValue[index] = JSON.parse(reportFilterInfo[filterItem.id].filterInfo)
|
||||
}
|
||||
})
|
||||
}
|
||||
if (componentItem.component === 'Group') {
|
||||
componentItem.expand = componentItem.expand || false
|
||||
}
|
||||
|
||||
if (componentItem.component === 'Picture') {
|
||||
componentItem.style['adaptation'] = componentItem.style['adaptation'] || 'adaptation'
|
||||
}
|
||||
// public
|
||||
componentItem['maintainRadio'] = componentItem['maintainRadio'] || false
|
||||
componentItem['multiDimensional'] =
|
||||
componentItem['multiDimensional'] || deepCopy(MULTI_DIMENSIONAL)
|
||||
componentItem['carousel'] = componentItem['carousel'] || deepCopy(BASE_CAROUSEL)
|
||||
componentItem['aspectRatio'] = componentItem['aspectRatio'] || 1
|
||||
if (componentItem.component === 'UserView') {
|
||||
componentItem.actionSelection = componentItem.actionSelection || deepCopy(ACTION_SELECTION)
|
||||
}
|
||||
// 2 为基础版本 此处需要增加仪表板矩阵密度
|
||||
if ((!canvasVersion || canvasVersion === 2) && canvasInfo.type === 'dashboard') {
|
||||
matrixAdaptor(componentItem)
|
||||
}
|
||||
// 组件事件适配
|
||||
componentItem.events =
|
||||
componentItem.events && componentItem.events.checked !== undefined
|
||||
? componentItem.events
|
||||
: deepCopy(BASE_EVENTS)
|
||||
componentItem['category'] = componentItem['category'] || 'base'
|
||||
historyItemAdaptor(componentItem, reportFilterInfo, attachInfo, canvasVersion, canvasInfo)
|
||||
})
|
||||
}
|
||||
|
||||
@ -457,10 +489,18 @@ export function isSameCanvas(item, canvasId) {
|
||||
return item.canvasId === canvasId
|
||||
}
|
||||
|
||||
export function isGroupOrTabCanvas(canvasId) {
|
||||
return isGroupCanvas(canvasId) || isTabCanvas(canvasId)
|
||||
}
|
||||
|
||||
export function isGroupCanvas(canvasId) {
|
||||
return canvasId && canvasId.includes('Group')
|
||||
}
|
||||
|
||||
export function isTabCanvas(canvasId) {
|
||||
return canvasId && canvasId.includes('tab')
|
||||
}
|
||||
|
||||
export function findComponentIndexById(componentId, componentDataMatch = componentData.value) {
|
||||
let indexResult = -1
|
||||
componentDataMatch.forEach((component, index) => {
|
||||
|