Merge branch 'dev' into pr@dev@feat_panel-default

This commit is contained in:
王嘉豪 2022-11-18 15:43:37 +08:00 committed by GitHub
commit 9e608844a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
24 changed files with 524 additions and 283 deletions

View File

@ -16,10 +16,16 @@ import io.dataease.controller.response.DatasetTableField4Type;
import io.dataease.i18n.Translator;
import io.dataease.plugins.common.base.domain.DatasetTable;
import io.dataease.plugins.common.base.domain.DatasetTableField;
import io.dataease.plugins.common.base.domain.Datasource;
import io.dataease.plugins.datasource.entity.Dateformat;
import io.dataease.plugins.datasource.query.QueryProvider;
import io.dataease.provider.ProviderFactory;
import io.dataease.service.dataset.DataSetFieldService;
import io.dataease.service.dataset.DataSetTableFieldsService;
import io.dataease.service.dataset.DataSetTableService;
import io.dataease.service.dataset.PermissionService;
import io.dataease.service.datasource.DatasourceService;
import io.dataease.service.engine.EngineService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.ObjectUtils;
@ -46,14 +52,16 @@ import java.util.stream.Collectors;
public class DataSetTableFieldController {
@Resource
private DataSetTableFieldsService dataSetTableFieldsService;
@Autowired
private DataSetFieldService dataSetFieldService;
@Resource
private DataSetTableService dataSetTableService;
@Resource
private PermissionService permissionService;
@Resource
private EngineService engineService;
@Resource
private DatasourceService datasourceService;
@DePermission(type = DePermissionType.DATASET)
@ApiOperation("查询表下属字段")
@ -208,4 +216,14 @@ public class DataSetTableFieldController {
ArrayList::new));
return list;
}
@DePermission(type = DePermissionType.DATASET)
@ApiOperation("时间格式")
@PostMapping("dateformats/{tableId}")
public List<Dateformat> dateformats(@PathVariable String tableId) throws Exception{
DatasetTable datasetTable = dataSetTableService.get(tableId);
Datasource ds = datasetTable.getMode() == 0 ? datasourceService.get(datasetTable.getDataSourceId()) : engineService.getDeEngine();
QueryProvider qp = ProviderFactory.getQueryProvider(ds.getType());
return qp.dateformat();
}
}

View File

@ -1,5 +1,6 @@
package io.dataease.provider.engine.doris;
import com.alibaba.fastjson.JSONArray;
import io.dataease.plugins.common.base.domain.ChartViewWithBLOBs;
import io.dataease.plugins.common.base.domain.DatasetTableField;
import io.dataease.plugins.common.base.domain.DatasetTableFieldExample;
@ -16,6 +17,7 @@ import io.dataease.plugins.common.dto.sqlObj.SQLObj;
import io.dataease.plugins.common.request.chart.ChartExtFilterRequest;
import io.dataease.plugins.common.request.permission.DataSetRowPermissionsTreeDTO;
import io.dataease.plugins.common.request.permission.DatasetRowPermissionsTreeItem;
import io.dataease.plugins.datasource.entity.Dateformat;
import io.dataease.plugins.datasource.query.QueryProvider;
import io.dataease.plugins.datasource.query.Utils;
import org.apache.commons.collections4.CollectionUtils;
@ -1311,4 +1313,15 @@ public class DorisQueryProvider extends QueryProvider {
return sql;
}
}
public List<Dateformat> dateformat() {
return JSONArray.parseArray("[\n" +
"{\"dateformat\": \"%Y-%m-%d\"},\n" +
"{\"dateformat\": \"%Y/%m/%d\"},\n" +
"{\"dateformat\": \"%Y%m%d\"},\n" +
"{\"dateformat\": \"%Y-%m-%d %H:%i:%S\"},\n" +
"{\"dateformat\": \"%Y/%m/%d %H:%i:%S\"},\n" +
"{\"dateformat\": \"%Y%m%d %H:%i:%S\"}\n" +
"]", Dateformat.class);
}
}

View File

@ -1,5 +1,6 @@
package io.dataease.provider.engine.mysql;
import com.alibaba.fastjson.JSONArray;
import io.dataease.plugins.common.base.domain.ChartViewWithBLOBs;
import io.dataease.plugins.common.base.domain.DatasetTableField;
import io.dataease.plugins.common.base.domain.DatasetTableFieldExample;
@ -16,6 +17,7 @@ import io.dataease.plugins.common.dto.sqlObj.SQLObj;
import io.dataease.plugins.common.request.chart.ChartExtFilterRequest;
import io.dataease.plugins.common.request.permission.DataSetRowPermissionsTreeDTO;
import io.dataease.plugins.common.request.permission.DatasetRowPermissionsTreeItem;
import io.dataease.plugins.datasource.entity.Dateformat;
import io.dataease.plugins.datasource.query.QueryProvider;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
@ -1312,4 +1314,15 @@ public class MysqlQueryProvider extends QueryProvider {
return sql;
}
}
public List<Dateformat> dateformat() {
return JSONArray.parseArray("[\n" +
"{\"dateformat\": \"%Y-%m-%d\"},\n" +
"{\"dateformat\": \"%Y/%m/%d\"},\n" +
"{\"dateformat\": \"%Y%m%d\"},\n" +
"{\"dateformat\": \"%Y-%m-%d %H:%i:%S\"},\n" +
"{\"dateformat\": \"%Y/%m/%d %H:%i:%S\"},\n" +
"{\"dateformat\": \"%Y%m%d %H:%i:%S\"}\n" +
"]", Dateformat.class);
}
}

View File

@ -1,5 +1,6 @@
package io.dataease.provider.query.mysql;
import com.alibaba.fastjson.JSONArray;
import io.dataease.plugins.common.base.domain.ChartViewWithBLOBs;
import io.dataease.plugins.common.base.domain.DatasetTableField;
import io.dataease.plugins.common.base.domain.DatasetTableFieldExample;
@ -17,7 +18,7 @@ import io.dataease.plugins.common.dto.sqlObj.SQLObj;
import io.dataease.plugins.common.request.chart.ChartExtFilterRequest;
import io.dataease.plugins.common.request.permission.DataSetRowPermissionsTreeDTO;
import io.dataease.plugins.common.request.permission.DatasetRowPermissionsTreeItem;
import io.dataease.plugins.datasource.entity.PageInfo;
import io.dataease.plugins.datasource.entity.Dateformat;
import io.dataease.plugins.datasource.query.QueryProvider;
import io.dataease.plugins.datasource.query.Utils;
import org.apache.commons.collections4.CollectionUtils;
@ -374,20 +375,6 @@ public class MysqlQueryProvider extends QueryProvider {
@Override
public String getSQLTableInfo(String table, List<ChartViewFieldDTO> xAxis, List<ChartFieldCustomFilterDTO> fieldCustomFilter, List<DataSetRowPermissionsTreeDTO> rowPermissionsTree, List<ChartExtFilterRequest> extFilterRequestList, Datasource ds, ChartViewWithBLOBs view) {
return sqlLimit(originalTableInfo(table, xAxis, fieldCustomFilter, rowPermissionsTree, extFilterRequestList, ds, view), view);
}
@Override
public String getSQLWithPage(boolean isTable, String table, List<ChartViewFieldDTO> xAxis, List<ChartFieldCustomFilterDTO> fieldCustomFilter, List<DataSetRowPermissionsTreeDTO> rowPermissionsTree, List<ChartExtFilterRequest> extFilterRequestList, Datasource ds, ChartViewWithBLOBs view, PageInfo pageInfo) {
String limit = ((pageInfo.getGoPage() != null && pageInfo.getPageSize() != null) ? " LIMIT " + (pageInfo.getGoPage() - 1) * pageInfo.getPageSize() + "," + pageInfo.getPageSize() : "");
if (isTable) {
return originalTableInfo(table, xAxis, fieldCustomFilter, rowPermissionsTree, extFilterRequestList, ds, view) + limit;
} else {
return originalTableInfo("(" + sqlFix(table) + ")", xAxis, fieldCustomFilter, rowPermissionsTree, extFilterRequestList, ds, view) + limit;
}
}
private String originalTableInfo(String table, List<ChartViewFieldDTO> xAxis, List<ChartFieldCustomFilterDTO> fieldCustomFilter, List<DataSetRowPermissionsTreeDTO> rowPermissionsTree, List<ChartExtFilterRequest> extFilterRequestList, Datasource ds, ChartViewWithBLOBs view) {
SQLObj tableObj = SQLObj.builder()
.tableName((table.startsWith("(") && table.endsWith(")")) ? table : String.format(MySQLConstants.KEYWORD_TABLE, table))
.tableAlias(String.format(TABLE_ALIAS_PREFIX, 0))
@ -458,7 +445,7 @@ public class MysqlQueryProvider extends QueryProvider {
.build();
if (CollectionUtils.isNotEmpty(orders)) st.add("orders", orders);
if (ObjectUtils.isNotEmpty(tableSQL)) st.add("table", tableSQL);
return st.render();
return sqlLimit(st.render(), view);
}
@Override
@ -1333,4 +1320,15 @@ public class MysqlQueryProvider extends QueryProvider {
public String sqlForPreview(String table, Datasource ds) {
return "SELECT * FROM " + String.format(MySQLConstants.KEYWORD_TABLE, table);
}
public List<Dateformat> dateformat() {
return JSONArray.parseArray("[\n" +
"{\"dateformat\": \"%Y-%m-%d\"},\n" +
"{\"dateformat\": \"%Y/%m/%d\"},\n" +
"{\"dateformat\": \"%Y%m%d\"},\n" +
"{\"dateformat\": \"%Y-%m-%d %H:%i:%S\"},\n" +
"{\"dateformat\": \"%Y/%m/%d %H:%i:%S\"},\n" +
"{\"dateformat\": \"%Y%m%d %H:%i:%S\"}\n" +
"]", Dateformat.class);
}
}

View File

@ -1,5 +1,7 @@
package io.dataease.provider.query.sqlserver;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.google.gson.Gson;
import io.dataease.plugins.common.base.domain.ChartViewWithBLOBs;
import io.dataease.plugins.common.base.domain.DatasetTableField;
@ -17,6 +19,7 @@ import io.dataease.plugins.common.dto.sqlObj.SQLObj;
import io.dataease.plugins.common.request.chart.ChartExtFilterRequest;
import io.dataease.plugins.common.request.permission.DataSetRowPermissionsTreeDTO;
import io.dataease.plugins.common.request.permission.DatasetRowPermissionsTreeItem;
import io.dataease.plugins.datasource.entity.Dateformat;
import io.dataease.plugins.datasource.entity.JdbcConfiguration;
import io.dataease.plugins.datasource.query.QueryProvider;
import io.dataease.plugins.datasource.query.Utils;
@ -1331,4 +1334,13 @@ public class SqlserverQueryProvider extends QueryProvider {
schema = String.format(SqlServerSQLConstants.KEYWORD_TABLE, schema);
return "SELECT * FROM " + schema + "." + String.format(SqlServerSQLConstants.KEYWORD_TABLE, table);
}
public List<Dateformat> dateformat() {
return JSONArray.parseArray("[\n" +
"{\"dateformat\": \"102\", \"desc\": \"yyyy.mm.dd\"},\n" +
"{\"dateformat\": \"23\", \"desc\": \"yyyy-mm-dd\"},\n" +
"{\"dateformat\": \"111\", \"desc\": \"yyyy/mm/dd\"},\n" +
"{\"dateformat\": \"120\", \"desc\": \"yyyy-mm-dd hh:mi:ss\"}\n" +
"]", Dateformat.class);
}
}

View File

@ -578,8 +578,8 @@ public class ChartViewService {
List<ChartViewFieldDTO> xAxis = gson.fromJson(view.getXAxis(), tokenType);
List<ChartViewFieldDTO> xAxisExt = gson.fromJson(view.getXAxisExt(), tokenType);
if (StringUtils.equalsIgnoreCase(view.getType(), "table-pivot")
|| StringUtils.containsIgnoreCase(view.getType(), "group")
|| ("antv".equalsIgnoreCase(view.getRender()) && "line".equalsIgnoreCase(view.getType()))) {
|| StringUtils.containsIgnoreCase(view.getType(), "group")
|| ("antv".equalsIgnoreCase(view.getRender()) && "line".equalsIgnoreCase(view.getType()))) {
xAxis.addAll(xAxisExt);
}
List<ChartViewFieldDTO> yAxis = gson.fromJson(view.getYAxis(), tokenType);
@ -596,6 +596,12 @@ public class ChartViewService {
List<ChartFieldCustomFilterDTO> fieldCustomFilter = gson.fromJson(view.getCustomFilter(), filterTokenType);
List<ChartViewFieldDTO> drill = gson.fromJson(view.getDrillFields(), tokenType);
// 视图计算字段用dataeaseName作为唯一标识
ChartViewField chartViewField = new ChartViewField();
chartViewField.setChartId(view.getId());
List<ChartViewField> chartViewFields = chartViewFieldService.list(chartViewField);
List<String> chartViewFieldNameList = chartViewFields.stream().map(ChartViewField::getDataeaseName).collect(Collectors.toList());
DatasetTableField datasetTableFieldObj = DatasetTableField.builder().tableId(view.getTableId()).checked(Boolean.TRUE).build();
List<DatasetTableField> fields = dataSetTableFieldsService.list(datasetTableFieldObj);
@ -609,11 +615,10 @@ public class ChartViewService {
//将没有权限的列删掉
List<String> dataeaseNames = columnPermissionFields.stream().map(DatasetTableField::getDataeaseName).collect(Collectors.toList());
dataeaseNames.add("*");
fieldCustomFilter = fieldCustomFilter.stream().filter(item -> StringUtils.isNotEmpty(item.getChartId()) || (!desensitizationList.contains(item.getDataeaseName()) && dataeaseNames.contains(item.getDataeaseName()))).collect(Collectors.toList());
extStack = extStack.stream().filter(item -> StringUtils.isNotEmpty(item.getChartId()) || (!desensitizationList.contains(item.getDataeaseName()) && dataeaseNames.contains(item.getDataeaseName()))).collect(Collectors.toList());
extBubble = extBubble.stream().filter(item -> StringUtils.isNotEmpty(item.getChartId()) || (!desensitizationList.contains(item.getDataeaseName()) && dataeaseNames.contains(item.getDataeaseName()))).collect(Collectors.toList());
drill = drill.stream().filter(item -> StringUtils.isNotEmpty(item.getChartId()) || (!desensitizationList.contains(item.getDataeaseName()) && dataeaseNames.contains(item.getDataeaseName()))).collect(Collectors.toList());
fieldCustomFilter = fieldCustomFilter.stream().filter(item -> chartViewFieldNameList.contains(item.getDataeaseName()) || (!desensitizationList.contains(item.getDataeaseName()) && dataeaseNames.contains(item.getDataeaseName()))).collect(Collectors.toList());
extStack = extStack.stream().filter(item -> chartViewFieldNameList.contains(item.getDataeaseName()) || (!desensitizationList.contains(item.getDataeaseName()) && dataeaseNames.contains(item.getDataeaseName()))).collect(Collectors.toList());
extBubble = extBubble.stream().filter(item -> chartViewFieldNameList.contains(item.getDataeaseName()) || (!desensitizationList.contains(item.getDataeaseName()) && dataeaseNames.contains(item.getDataeaseName()))).collect(Collectors.toList());
drill = drill.stream().filter(item -> chartViewFieldNameList.contains(item.getDataeaseName()) || (!desensitizationList.contains(item.getDataeaseName()) && dataeaseNames.contains(item.getDataeaseName()))).collect(Collectors.toList());
//行权限
List<DataSetRowPermissionsTreeDTO> rowPermissionsTree = permissionsTreeService.getRowPermissionsTree(fields, table, chartExtRequest.getUser());
@ -644,7 +649,7 @@ public class ChartViewService {
switch (view.getType()) {
case "label":
xAxis = xAxis.stream().filter(item -> StringUtils.isNotEmpty(item.getChartId()) || (!desensitizationList.contains(item.getDataeaseName()) && dataeaseNames.contains(item.getDataeaseName()))).collect(Collectors.toList());
xAxis = xAxis.stream().filter(item -> chartViewFieldNameList.contains(item.getDataeaseName()) || (!desensitizationList.contains(item.getDataeaseName()) && dataeaseNames.contains(item.getDataeaseName()))).collect(Collectors.toList());
yAxis = new ArrayList<>();
if (CollectionUtils.isEmpty(xAxis)) {
return emptyChartViewDTO(view);
@ -654,32 +659,32 @@ public class ChartViewService {
case "gauge":
case "liquid":
xAxis = new ArrayList<>();
yAxis = yAxis.stream().filter(item -> StringUtils.isNotEmpty(item.getChartId()) || (!desensitizationList.contains(item.getDataeaseName()) && dataeaseNames.contains(item.getDataeaseName()))).collect(Collectors.toList());
yAxis = yAxis.stream().filter(item -> chartViewFieldNameList.contains(item.getDataeaseName()) || (!desensitizationList.contains(item.getDataeaseName()) && dataeaseNames.contains(item.getDataeaseName()))).collect(Collectors.toList());
if (CollectionUtils.isEmpty(yAxis)) {
return emptyChartViewDTO(view);
}
break;
case "table-info":
yAxis = new ArrayList<>();
xAxis = xAxis.stream().filter(item -> StringUtils.isNotEmpty(item.getChartId()) || dataeaseNames.contains(item.getDataeaseName())).collect(Collectors.toList());
xAxis = xAxis.stream().filter(item -> chartViewFieldNameList.contains(item.getDataeaseName()) || dataeaseNames.contains(item.getDataeaseName())).collect(Collectors.toList());
if (CollectionUtils.isEmpty(xAxis)) {
return emptyChartViewDTO(view);
}
break;
case "table-normal":
xAxis = xAxis.stream().filter(item -> StringUtils.isNotEmpty(item.getChartId()) || dataeaseNames.contains(item.getDataeaseName())).collect(Collectors.toList());
yAxis = yAxis.stream().filter(item -> StringUtils.isNotEmpty(item.getChartId()) || dataeaseNames.contains(item.getDataeaseName())).collect(Collectors.toList());
xAxis = xAxis.stream().filter(item -> chartViewFieldNameList.contains(item.getDataeaseName()) || dataeaseNames.contains(item.getDataeaseName())).collect(Collectors.toList());
yAxis = yAxis.stream().filter(item -> chartViewFieldNameList.contains(item.getDataeaseName()) || dataeaseNames.contains(item.getDataeaseName())).collect(Collectors.toList());
break;
case "bar-group":
case "bar-group-stack":
xAxis = xAxis.stream().filter(item -> StringUtils.isNotEmpty(item.getChartId()) || (!desensitizationList.contains(item.getDataeaseName()) && dataeaseNames.contains(item.getDataeaseName()))).collect(Collectors.toList());
yAxis = yAxis.stream().filter(item -> StringUtils.isNotEmpty(item.getChartId()) || (!desensitizationList.contains(item.getDataeaseName()) && dataeaseNames.contains(item.getDataeaseName()))).collect(Collectors.toList());
xAxisBase = xAxisBase.stream().filter(item -> StringUtils.isNotEmpty(item.getChartId()) || (!desensitizationList.contains(item.getDataeaseName()) && dataeaseNames.contains(item.getDataeaseName()))).collect(Collectors.toList());
xAxisExt = xAxisExt.stream().filter(item -> StringUtils.isNotEmpty(item.getChartId()) || (!desensitizationList.contains(item.getDataeaseName()) && dataeaseNames.contains(item.getDataeaseName()))).collect(Collectors.toList());
xAxis = xAxis.stream().filter(item -> chartViewFieldNameList.contains(item.getDataeaseName()) || (!desensitizationList.contains(item.getDataeaseName()) && dataeaseNames.contains(item.getDataeaseName()))).collect(Collectors.toList());
yAxis = yAxis.stream().filter(item -> chartViewFieldNameList.contains(item.getDataeaseName()) || (!desensitizationList.contains(item.getDataeaseName()) && dataeaseNames.contains(item.getDataeaseName()))).collect(Collectors.toList());
xAxisBase = xAxisBase.stream().filter(item -> chartViewFieldNameList.contains(item.getDataeaseName()) || (!desensitizationList.contains(item.getDataeaseName()) && dataeaseNames.contains(item.getDataeaseName()))).collect(Collectors.toList());
xAxisExt = xAxisExt.stream().filter(item -> chartViewFieldNameList.contains(item.getDataeaseName()) || (!desensitizationList.contains(item.getDataeaseName()) && dataeaseNames.contains(item.getDataeaseName()))).collect(Collectors.toList());
break;
default:
xAxis = xAxis.stream().filter(item -> StringUtils.isNotEmpty(item.getChartId()) || (!desensitizationList.contains(item.getDataeaseName()) && dataeaseNames.contains(item.getDataeaseName()))).collect(Collectors.toList());
yAxis = yAxis.stream().filter(item -> StringUtils.isNotEmpty(item.getChartId()) || (!desensitizationList.contains(item.getDataeaseName()) && dataeaseNames.contains(item.getDataeaseName()))).collect(Collectors.toList());
xAxis = xAxis.stream().filter(item -> chartViewFieldNameList.contains(item.getDataeaseName()) || (!desensitizationList.contains(item.getDataeaseName()) && dataeaseNames.contains(item.getDataeaseName()))).collect(Collectors.toList());
yAxis = yAxis.stream().filter(item -> chartViewFieldNameList.contains(item.getDataeaseName()) || (!desensitizationList.contains(item.getDataeaseName()) && dataeaseNames.contains(item.getDataeaseName()))).collect(Collectors.toList());
}
// 过滤来自仪表板的条件
@ -701,8 +706,8 @@ public class ChartViewService {
hasParameters = true;
}
if (parameter.contains("|DE|")
&& table.getId().equals(parameter.split("\\|DE\\|")[0])
&& sqlVariables
&& table.getId().equals(parameter.split("\\|DE\\|")[0])
&& sqlVariables
.stream()
.map(SqlVariableDetails::getVariableName)
.collect(Collectors.toList())
@ -1160,7 +1165,7 @@ public class ChartViewService {
mapChart = ChartDataBuild.transChartData(xAxis, yAxis, view, data, isDrill);
}
} else if (StringUtils.equalsIgnoreCase(view.getRender(), "antv")) {
if (StringUtils.equalsAnyIgnoreCase(view.getType(), "bar-group","line")) {
if (StringUtils.equalsAnyIgnoreCase(view.getType(), "bar-group", "line")) {
mapChart = ChartDataBuild.transBaseGroupDataAntV(xAxisBase, xAxis, xAxisExt, yAxis, view, data, isDrill);
} else if (StringUtils.equalsIgnoreCase(view.getType(), "bar-group-stack")) {
mapChart = ChartDataBuild.transGroupStackDataAntV(xAxisBase, xAxis, xAxisExt, yAxis, extStack, data, view, isDrill);

View File

@ -2242,6 +2242,13 @@ public class DataSetTableService {
if (ObjectUtils.isNotEmpty(table)) {
Datasource datasource = datasourceMapper.selectByPrimaryKey(table.getDataSourceId());
Optional.ofNullable(datasource).orElse(new Datasource()).setConfiguration(null);
Collection<DataSourceType> types = datasourceService.types();
for (DataSourceType type : types) {
if (ObjectUtils.isNotEmpty(datasource) && StringUtils.equalsIgnoreCase(datasource.getType(), type.getType())) {
datasource.setType(type.getName());
break;
}
}
dataSetDetail.setDatasource(datasource);
}
return dataSetDetail;

View File

@ -136,6 +136,14 @@ export function fieldListDQ(id, showLoading = true) {
})
}
export function dateformats(id, showLoading = true) {
return request({
url: '/dataset/field/dateformats/' + id,
loading: showLoading,
method: 'post'
})
}
export function batchEdit(data) {
return request({
url: '/dataset/field/batchEdit',

View File

@ -6,6 +6,7 @@
<div
v-if="isPublicLink"
ref="widget-div"
class="function-div"
>
<el-button-group size="mini">
@ -13,7 +14,10 @@
v-if="!isNewBlank"
size="mini"
@click="back2Last"
><i class="icon iconfont el-icon-back" />{{ $t('chart.back') }}</el-button>
><span><svg-icon
style="width: 12px;height: 12px"
icon-class="link-back"
/>{{ $t('pblink.back_parent') }}</span></el-button>
<el-button
v-if="existLinkage"
size="mini"
@ -22,7 +26,11 @@
<el-button
size="mini"
@click="exportPDF"
><i class="icon iconfont el-icon-download" />{{ $t('panel.down') }}</el-button>
>
<span><svg-icon
style="width: 12px;height: 12px"
icon-class="link-down"
/>{{ $t('panel.down') }}</span></el-button>
</el-button-group>
</div>
@ -77,6 +85,14 @@ export default {
},
exportPDF() {
this.$emit('link-export-pdf')
},
setWidgetStatus() {
if (!this.isPublicLink || !this.$refs['widget-div']) {
return
}
const val = this.$refs['widget-div'].style.display
this.$refs['widget-div'].style.display = val ? '' : 'block'
}
}
}
@ -114,7 +130,7 @@ export default {
width: 60px;
right: 0;
top: 0;
border-top: 60px solid rgba(245, 74, 69, 0.2);
border-top: 60px solid rgba(245, 74, 69, 0);
border-left: 60px solid transparent;
cursor: pointer;
z-index: 999;
@ -126,10 +142,16 @@ export default {
width: max-content;
text-align: end;
z-index: 999;
::v-deep button:hover {
background-color: rgba(31, 35, 41, 0.1);
color: #1F2329;
font-weight: bold;
border-color: rgba(31, 35, 41, 0.1)
}
}
&:hover {
border-top: 60px solid rgba(245, 74, 69, 0.8);;
border-top: 60px solid rgba(245, 74, 69, 0);;
.function-div {
display: block;
}

View File

@ -9,7 +9,10 @@
:style="customStyle"
@scroll="canvasScroll"
>
<canvas-opt-bar @link-export-pdf="downloadAsPDF"/>
<canvas-opt-bar
ref="canvas-opt-bar"
@link-export-pdf="downloadAsPDF"
/>
<div
:id="previewDomId"
:ref="previewRefId"
@ -563,6 +566,9 @@ export default {
deselectCurComponent(e) {
if (!this.isClickComponent) {
this.$store.commit('setCurComponent', { component: null, index: null })
if (this.$refs?.['canvas-opt-bar']) {
this.$refs['canvas-opt-bar'].setWidgetStatus()
}
}
},
handleMouseDown() {

View File

@ -0,0 +1,4 @@
<svg width="8" height="14" viewBox="0 0 8 14" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M2.09092 7.00066L7.51207 12.4218C7.64225 12.552 7.64225 12.763 7.51207 12.8932L7.04067 13.3646C6.91049 13.4948 6.69944 13.4948 6.56926 13.3646L0.676707 7.47206C0.416358 7.21171 0.416358 6.7896 0.676707 6.52925L6.56926 0.636694C6.69944 0.506519 6.91049 0.506519 7.04067 0.636694L7.51207 1.1081C7.64225 1.23827 7.64225 1.44933 7.51207 1.5795L2.09092 7.00066Z" fill="#1F2329" />
</svg>

After

Width:  |  Height:  |  Size: 490 B

View File

@ -0,0 +1,4 @@
<svg width="12" height="14" viewBox="0 0 12 14" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M12 11.3327V12.9994C12 13.3675 11.7015 13.666 11.3333 13.666H0.666667C0.298477 13.666 0 13.3675 0 12.9994V11.3327C0 11.1486 0.149238 10.9994 0.333333 10.9994H1C1.18409 10.9994 1.33333 11.1486 1.33333 11.3327V12.3327H10.6667V11.3327C10.6667 11.1486 10.8159 10.9994 11 10.9994H11.6667C11.8508 10.9994 12 11.1486 12 11.3327ZM6.66667 8.35649L8.67365 6.34952C8.80382 6.21934 9.01488 6.21934 9.14505 6.34952L9.61646 6.82092C9.74663 6.95109 9.74663 7.16215 9.61646 7.29232L6.31663 10.5922C6.25154 10.6572 6.16623 10.6898 6.08092 10.6898C5.99562 10.6898 5.91031 10.6572 5.84522 10.5922L2.54539 7.29232C2.41521 7.16215 2.41521 6.95109 2.54539 6.82092L3.01679 6.34952C3.14697 6.21934 3.35802 6.21934 3.4882 6.34952L5.33334 8.19465V0.999349C5.33334 0.815254 5.48257 0.666016 5.66667 0.666016H6.33334C6.51743 0.666016 6.66667 0.815254 6.66667 0.999349V8.35649Z" fill="#1F2329" />
</svg>

After

Width:  |  Height:  |  Size: 984 B

View File

@ -1441,7 +1441,12 @@ export default {
proportion: 'Proportion',
label_content: 'Label Content',
percent: 'Percent',
table_index_desc: 'Index Header Name'
table_index_desc: 'Index Header Name',
total_sort: 'Total Sort',
total_sort_none: 'None',
total_sort_asc: 'ASC',
total_sort_desc: 'DESC',
total_sort_field: 'Sort Field'
},
dataset: {
spend_time: 'Spend',
@ -1862,7 +1867,8 @@ export default {
input_placeholder: 'Please enter the 4-digits-letters',
pwd_error: 'Wrong password',
pwd_format_error: 'Please enter the 4-digits-letters',
sure_bt: 'Confirm'
sure_bt: 'Confirm',
back_parent: 'Back to previous'
},
panel: {
to_top: 'To Top',

View File

@ -1441,7 +1441,12 @@ export default {
proportion: '佔比',
label_content: '標籤展示',
percent: '占比',
table_index_desc: '表頭名稱'
table_index_desc: '表頭名稱',
total_sort: '總計排序',
total_sort_none: '無',
total_sort_asc: '升序',
total_sort_desc: '降序',
total_sort_field: '排序字段'
},
dataset: {
spend_time: '耗時',
@ -1862,7 +1867,8 @@ export default {
input_placeholder: '請輸入4位數字或字母',
pwd_error: '密碼錯誤',
pwd_format_error: '請輸入4位數字或字母',
sure_bt: '確定'
sure_bt: '確定',
back_parent: '返回上一級'
},
panel: {
to_top: '置頂',

View File

@ -1440,7 +1440,12 @@ export default {
proportion: '占比',
label_content: '标签展示',
percent: '占比',
table_index_desc: '表头名称'
table_index_desc: '表头名称',
total_sort: '总计排序',
total_sort_none: '无',
total_sort_asc: '升序',
total_sort_desc: '降序',
total_sort_field: '排序字段'
},
dataset: {
spend_time: '耗时',
@ -1862,7 +1867,8 @@ export default {
input_placeholder: '请输入4位数字或字母',
pwd_error: '密码错误',
pwd_format_error: '请输入4位数字或字母',
sure_bt: '确定'
sure_bt: '确定',
back_parent: '返回上一级'
},
panel: {
to_top: '置顶',

View File

@ -172,7 +172,9 @@ export const DEFAULT_TOTAL = {
},
calcSubTotals: {
aggregation: 'SUM'
}
},
totalSort: 'none', // asc,desc
totalSortField: ''
},
col: {
showGrandTotals: true,
@ -187,7 +189,9 @@ export const DEFAULT_TOTAL = {
},
calcSubTotals: {
aggregation: 'SUM'
}
},
totalSort: 'none', // asc,desc
totalSortField: ''
}
}
export const DEFAULT_TITLE_STYLE = {

View File

@ -1,4 +1,4 @@
import { TableSheet, S2Event, PivotSheet, DataCell } from '@antv/s2'
import { TableSheet, S2Event, PivotSheet, DataCell, EXTRA_FIELD, TOTAL_VALUE } from '@antv/s2'
import { getCustomTheme, getSize } from '@/views/chart/chart/common/common_table'
import { DEFAULT_COLOR_CASE, DEFAULT_TOTAL } from '@/views/chart/chart/chart'
import { formatterItem, valueFormatter } from '@/views/chart/chart/formatter'
@ -403,17 +403,6 @@ export function baseTablePivot(s2, container, chart, action, tableData) {
})
}
// data config
const s2DataConfig = {
fields: {
rows: r,
columns: c,
values: v
},
meta: meta,
data: tableData
}
// total config
let totalCfg = {}
const chartObj = JSON.parse(JSON.stringify(chart))
@ -433,6 +422,43 @@ export function baseTablePivot(s2, container, chart, action, tableData) {
totalCfg.row.subTotalsDimensions = r
totalCfg.col.subTotalsDimensions = c
// 解析合计、小计排序
const sortParams = []
if (totalCfg.row.totalSort && totalCfg.row.totalSort !== 'none' && c.length > 0) {
const sort = {
sortFieldId: c[0],
sortMethod: totalCfg.row.totalSort.toUpperCase(),
sortByMeasure: TOTAL_VALUE,
query: {
[EXTRA_FIELD]: totalCfg.row.totalSortField
}
}
sortParams.push(sort)
}
if (totalCfg.col.totalSort && totalCfg.col.totalSort !== 'none' && r.length > 0) {
const sort = {
sortFieldId: r[0],
sortMethod: totalCfg.col.totalSort.toUpperCase(),
sortByMeasure: TOTAL_VALUE,
query: {
[EXTRA_FIELD]: totalCfg.col.totalSortField
}
}
sortParams.push(sort)
}
// data config
const s2DataConfig = {
fields: {
rows: r,
columns: c,
values: v
},
meta: meta,
data: tableData,
sortParams: sortParams
}
// options
const s2Options = {
width: containerDom.offsetWidth,

View File

@ -354,8 +354,14 @@ export const TYPE_CONFIGS = [
value: 'richTextView',
title: 'chart.rich_text_view',
icon: 'richTextView',
properties: [],
propertyInner: {}
properties: [
'title-selector-ant-v'
],
propertyInner: {
'title-selector-ant-v': [
'title'
]
}
},
{
render: 'antv',

View File

@ -15,9 +15,10 @@
<el-checkbox
v-model="titleForm.show"
@change="changeTitleStyle('show')"
>{{ $t('chart.show') }}</el-checkbox>
>{{ $t('chart.show') }}
</el-checkbox>
</el-form-item>
<div v-show="showProperty('show') && titleForm.show">
<div v-show="titleForm.show">
<el-form-item
v-show="showProperty('title')"
v-if="!batchOptStatus"
@ -105,11 +106,13 @@
<el-checkbox
v-model="titleForm.isItalic"
@change="changeTitleStyle('isItalic')"
>{{ $t('chart.italic') }}</el-checkbox>
>{{ $t('chart.italic') }}
</el-checkbox>
<el-checkbox
v-model="titleForm.isBolder"
@change="changeTitleStyle('isBolder')"
>{{ $t('chart.bolder') }}</el-checkbox>
>{{ $t('chart.bolder') }}
</el-checkbox>
</el-form-item>
<el-form-item
v-show="showProperty('letterSpace')"
@ -137,7 +140,8 @@
<el-checkbox
v-model="titleForm.fontShadow"
@change="changeTitleStyle('fontShadow')"
>{{ $t('chart.font_shadow') }}</el-checkbox>
>{{ $t('chart.font_shadow') }}
</el-checkbox>
</el-form-item>
<el-form-item
@ -148,7 +152,8 @@
<el-checkbox
v-model="titleForm.remarkShow"
@change="changeTitleStyle('remarkShow')"
>{{ $t('chart.show') }}</el-checkbox>
>{{ $t('chart.show') }}
</el-checkbox>
</el-form-item>
<span v-show="titleForm.remarkShow">
<el-form-item
@ -204,12 +209,14 @@
<el-button
size="mini"
@click="closeRemark"
>{{ $t('chart.cancel') }}</el-button>
>{{ $t('chart.cancel') }}
</el-button>
<el-button
type="primary"
size="mini"
@click="changeRemark"
>{{ $t('chart.confirm') }}</el-button>
>{{ $t('chart.confirm') }}
</el-button>
</div>
</el-dialog>
</div>
@ -350,7 +357,7 @@ export default {
</script>
<style scoped>
.shape-item{
.shape-item {
padding: 6px;
border: none;
width: 100%;
@ -358,29 +365,35 @@ export default {
justify-content: space-between;
align-items: center;
}
.form-item-slider ::v-deep .el-form-item__label{
.form-item-slider ::v-deep .el-form-item__label {
font-size: 12px;
line-height: 38px;
}
.form-item ::v-deep .el-form-item__label{
.form-item ::v-deep .el-form-item__label {
font-size: 12px;
}
.el-select-dropdown__item{
.el-select-dropdown__item {
padding: 0 20px;
}
span{
span {
font-size: 12px
}
.el-form-item{
.el-form-item {
margin-bottom: 6px;
}
.switch-style{
.switch-style {
position: absolute;
right: 10px;
margin-top: -4px;
}
.color-picker-style{
.color-picker-style {
cursor: pointer;
z-index: 1003;
}

View File

@ -67,6 +67,40 @@
/>
</el-select>
</el-form-item>
<el-form-item
v-if="chart.type === 'table-pivot'"
:label="$t('chart.total_sort')"
class="form-item"
>
<el-radio-group
v-model="totalForm.row.totalSort"
@change="changeTotalCfg('row')"
>
<el-radio label="none">{{ $t('chart.total_sort_none') }}</el-radio>
<el-radio label="asc">{{ $t('chart.total_sort_asc') }}</el-radio>
<el-radio label="desc">{{ $t('chart.total_sort_desc') }}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item
v-if="chart.type === 'table-pivot' && totalForm.row.totalSort !== 'none'"
:label="$t('chart.total_sort_field')"
class="form-item"
>
<el-select
v-model="totalForm.row.totalSortField"
class="form-item-select"
:placeholder="$t('chart.total_sort_field')"
size="mini"
@change="changeTotalCfg('row')"
>
<el-option
v-for="option in totalSortFields"
:key="option.dataeaseName"
:label="option.name"
:value="option.dataeaseName"
/>
</el-select>
</el-form-item>
</div>
<el-form-item
@ -190,6 +224,40 @@
/>
</el-select>
</el-form-item>
<el-form-item
v-if="chart.type === 'table-pivot'"
:label="$t('chart.total_sort')"
class="form-item"
>
<el-radio-group
v-model="totalForm.col.totalSort"
@change="changeTotalCfg('col')"
>
<el-radio label="none">{{ $t('chart.total_sort_none') }}</el-radio>
<el-radio label="asc">{{ $t('chart.total_sort_asc') }}</el-radio>
<el-radio label="desc">{{ $t('chart.total_sort_desc') }}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item
v-if="chart.type === 'table-pivot' && totalForm.col.totalSort !== 'none'"
:label="$t('chart.total_sort_field')"
class="form-item"
>
<el-select
v-model="totalForm.col.totalSortField"
class="form-item-select"
:placeholder="$t('chart.total_sort_field')"
size="mini"
@change="changeTotalCfg('col')"
>
<el-option
v-for="option in totalSortFields"
:key="option.dataeaseName"
:label="option.name"
:value="option.dataeaseName"
/>
</el-select>
</el-form-item>
</div>
<el-form-item
@ -283,7 +351,8 @@ export default {
{ name: this.$t('chart.avg'), value: 'AVG' },
{ name: this.$t('chart.max'), value: 'MAX' },
{ name: this.$t('chart.min'), value: 'MIN' }
]
],
totalSortFields: []
}
},
computed: {
@ -339,6 +408,27 @@ export default {
} else {
this.totalForm = JSON.parse(JSON.stringify(DEFAULT_TOTAL))
}
this.totalForm.row.totalSort = this.totalForm.row.totalSort ? this.totalForm.row.totalSort : DEFAULT_TOTAL.row.totalSort
this.totalForm.row.totalSortField = this.totalForm.row.totalSortField ? this.totalForm.row.totalSortField : DEFAULT_TOTAL.row.totalSortField
this.totalForm.col.totalSort = this.totalForm.col.totalSort ? this.totalForm.col.totalSort : DEFAULT_TOTAL.col.totalSort
this.totalForm.col.totalSortField = this.totalForm.col.totalSortField ? this.totalForm.col.totalSortField : DEFAULT_TOTAL.col.totalSortField
}
//
if (chart.yaxis) {
if (Object.prototype.toString.call(chart.yaxis) === '[object Array]') {
this.totalSortFields = JSON.parse(JSON.stringify(chart.yaxis))
} else {
this.totalSortFields = JSON.parse(chart.yaxis)
}
if (this.totalSortFields.length > 0) {
if (this.totalForm.row.totalSortField === '') {
this.totalForm.row.totalSortField = this.totalSortFields[0].dataeaseName
}
if (this.totalForm.col.totalSortField === '') {
this.totalForm.col.totalSortField = this.totalSortFields[0].dataeaseName
}
}
}
},
changeTotalCfg(modifyName) {

View File

@ -2790,6 +2790,8 @@ export default {
closeEditChartField() {
this.showEditChartField = false
this.initTableField(this.table.id)
//
this.calcData()
},
// drag
@ -2879,6 +2881,7 @@ export default {
}
}
}
this.view.customFilter[e.newDraggableIndex].filter = []
this.dragMoveDuplicate(this.view.customFilter, e)
this.dragRemoveChartField(this.view.customFilter, e)
this.calcData(true)

View File

@ -18,7 +18,14 @@
style="overflow:auto;border-right: 1px solid #e6e6e6;height: 100%;width: 100%;padding-right: 6px"
class="attr-style theme-border-class"
>
<el-row class="de-collapse-style">
<el-row
v-show="showPropertiesCollapse([
'color-selector','size-selector','size-selector-ant-v',
'label-selector','label-selector-ant-v',
'tooltip-selector','tooltip-selector-ant-v',
'total-cfg','suspension-selector'])"
class="de-collapse-style"
>
<span class="padding-lr">{{ $t('chart.shape_attr') }}</span>
<el-collapse
v-model="attrActiveNames"
@ -496,7 +503,7 @@ export default {
}
</script>
<style lang='scss' scoped>
<style lang="scss" scoped>
.de-collapse-style {
::v-deep.el-collapse-item__header {
height: 34px !important;
@ -506,190 +513,193 @@ export default {
font-weight: 400 !important;
}
}
.padding-lr {
padding: 0 6px;
}
.col {
width: 40%;
flex: 1;
padding: 10px;
border: solid 1px #eee;
border-radius: 5px;
float: left;
}
.col + .col {
margin-left: 10px;
}
.padding-lr {
padding: 0 6px;
}
.view-panel {
display: flex;
height: 100%;
background-color: #f7f8fa;
}
.col {
width: 40%;
flex: 1;
padding: 10px;
border: solid 1px #eee;
border-radius: 5px;
float: left;
}
.blackTheme .view-panel {
background-color: var(--MainBG);
}
.col + .col {
margin-left: 10px;
}
.el-form-item {
margin-bottom: 0;
}
.view-panel {
display: flex;
height: 100%;
background-color: #f7f8fa;
}
span {
font-size: 12px;
}
.blackTheme .view-panel {
background-color: var(--MainBG);
}
.tab-header ::v-deep .el-tabs__header {
border-top: solid 1px #eee;
border-right: solid 1px #eee;
}
.el-form-item {
margin-bottom: 0;
}
.tab-header ::v-deep .el-tabs__item {
font-size: 12px;
padding: 0 20px !important;
}
span {
font-size: 12px;
}
.blackTheme .tab-header ::v-deep .el-tabs__item {
background-color: var(--MainBG);
}
.tab-header ::v-deep .el-tabs__header {
border-top: solid 1px #eee;
border-right: solid 1px #eee;
}
.tab-header ::v-deep .el-tabs__nav-scroll {
padding-left: 0 !important;
}
.tab-header ::v-deep .el-tabs__item {
font-size: 12px;
padding: 0 20px !important;
}
.tab-header ::v-deep .el-tabs__header {
margin: 0 !important;
}
.blackTheme .tab-header ::v-deep .el-tabs__item {
background-color: var(--MainBG);
}
.tab-header ::v-deep .el-tabs__content {
height: calc(100% - 40px);
}
.tab-header ::v-deep .el-tabs__nav-scroll {
padding-left: 0 !important;
}
.chart-icon {
width: 20px;
height: 20px;
}
.tab-header ::v-deep .el-tabs__header {
margin: 0 !important;
}
.el-radio {
margin: 5px;
}
.tab-header ::v-deep .el-tabs__content {
height: calc(100% - 40px);
}
.el-radio ::v-deep .el-radio__label {
padding-left: 0;
}
.chart-icon {
width: 20px;
height: 20px;
}
.attr-style {
height: calc(100vh - 56px - 60px - 40px - 40px);
}
.el-radio {
margin: 5px;
}
.blackTheme .attr-style {
color: var(--TextPrimary);
}
.el-radio ::v-deep .el-radio__label {
padding-left: 0;
}
.attr-selector {
width: 100%;
height: 100%;
margin: 6px 0;
padding: 0 4px;
display: flex;
align-items: center;
background-color: white
}
.attr-style {
height: calc(100vh - 56px - 60px - 40px - 40px);
}
.blackTheme .attr-selector {
.blackTheme .attr-style {
color: var(--TextPrimary);
}
background-color: var(--MainBG)
}
.attr-selector {
width: 100%;
height: 100%;
margin: 6px 0;
padding: 0 4px;
display: flex;
align-items: center;
background-color: white
}
.dialog-css ::v-deep .el-dialog__title {
font-size: 14px;
}
.blackTheme .attr-selector {
.dialog-css ::v-deep .el-dialog__header {
padding: 20px 20px 0;
}
background-color: var(--MainBG)
}
.dialog-css ::v-deep .el-dialog__body {
padding: 10px 20px 20px;
}
.dialog-css ::v-deep .el-dialog__title {
font-size: 14px;
}
.blackTheme .theme-border-class {
color: var(--TextPrimary) !important;
background-color: var(--ContentBG);
}
.dialog-css ::v-deep .el-dialog__header {
padding: 20px 20px 0;
}
.blackTheme .padding-lr {
border-color: var(--TableBorderColor) !important;
}
.dialog-css ::v-deep .el-dialog__body {
padding: 10px 20px 20px;
}
.blackTheme .theme-item-class {
background-color: var(--MainBG) !important;
border-color: var(--TableBorderColor) !important;
}
.blackTheme .theme-border-class {
color: var(--TextPrimary) !important;
background-color: var(--ContentBG);
}
.icon-class {
color: #6c6c6c;
}
.blackTheme .padding-lr {
border-color: var(--TableBorderColor) !important;
}
.blackTheme .icon-class {
color: #cccccc;
}
.blackTheme .theme-item-class {
background-color: var(--MainBG) !important;
border-color: var(--TableBorderColor) !important;
}
.radio-span ::v-deep .el-radio__label {
margin-left: 4px;
}
.icon-class {
color: #6c6c6c;
}
.view-title-name {
display: -moz-inline-box;
display: inline-block;
width: 130px;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
margin-left: 45px;
}
.blackTheme .icon-class {
color: #cccccc;
}
::v-deep .item-axis {
width: 128px !important;
}
.radio-span ::v-deep .el-radio__label {
margin-left: 4px;
}
::v-deep .el-slider__input {
width: 80px !important;
}
.view-title-name {
display: -moz-inline-box;
display: inline-block;
width: 130px;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
margin-left: 45px;
}
::v-deep .el-input-number--mini {
width: 100px !important;
}
::v-deep .item-axis {
width: 128px !important;
}
::v-deep .el-slider__runway.show-input{
width: 80px!important;
}
::v-deep .el-slider__input {
width: 80px !important;
}
.no-senior {
width: 100%;
text-align: center;
font-size: 12px;
padding-top: 40px;
overflow: auto;
border-right: 1px solid #e6e6e6;
height: 100%;
}
::v-deep .el-input-number--mini {
width: 100px !important;
}
.form-item-slider ::v-deep .el-form-item__label{
font-size: 12px;
line-height: 38px;
}
.form-item ::v-deep .el-form-item__label{
font-size: 12px;
}
::v-deep .el-slider__runway.show-input {
width: 80px !important;
}
.no-properties {
width: 100%;
text-align: center;
font-size: 12px;
padding-top: 40px;
overflow: auto;
height: 100%;
}
</style>
.no-senior {
width: 100%;
text-align: center;
font-size: 12px;
padding-top: 40px;
overflow: auto;
border-right: 1px solid #e6e6e6;
height: 100%;
}
.form-item-slider ::v-deep .el-form-item__label {
font-size: 12px;
line-height: 38px;
}
.form-item ::v-deep .el-form-item__label {
font-size: 12px;
}
.no-properties {
width: 100%;
text-align: center;
font-size: 12px;
padding-top: 40px;
overflow: auto;
height: 100%;
}
</style>

View File

@ -27,7 +27,7 @@
</el-col>
<el-col class="info-item">
<p class="info-title">{{ $t('chart.title') }}</p>
<p class="info-content">{{ detail.chart.title || 'N/A' }}</p>
<p class="info-content">{{ detail.chart.title || '-' }}</p>
</el-col>
<el-col class="info-item">
<p class="info-title">{{ $t('dataset.create_by') }}</p>
@ -113,54 +113,11 @@
</el-col>
<el-col class="info-item">
<p class="info-title">{{ $t('commons.description') }}</p>
<p class="info-content">{{ detail.datasource.desc || 'N/A' }}</p>
<p class="info-content">{{ detail.datasource.desc || '-' }}</p>
</el-col>
<el-col class="info-item">
<p class="info-title">{{ $t('datasource.type') }}</p>
<p
v-if="detail.datasource.type === 'mysql'"
class="info-content"
>MySQL</p>
<p
v-if="detail.datasource.type === 'sqlServer'"
class="info-content"
>SQL Server</p>
<p
v-if="detail.datasource.type === 'oracle'"
class="info-content"
>Oracle</p>
<p
v-if="detail.datasource.type === 'hive'"
class="info-content"
>Apache Hive</p>
<p
v-if="detail.datasource.type === 'pg'"
class="info-content"
>PostgreSQL</p>
<p
v-if="detail.datasource.type === 'es'"
class="info-content"
>Elasticsearch</p>
<p
v-if="detail.datasource.type === 'mariadb'"
class="info-content"
>MariaDB</p>
<p
v-if="detail.datasource.type === 'ds_doris'"
class="info-content"
>Doris</p>
<p
v-if="detail.datasource.type === 'ck'"
class="info-content"
>ClickHouse</p>
<p
v-if="detail.datasource.type === 'redshift'"
class="info-content"
>AWS Redshift</p>
<p
v-if="detail.datasource.type === 'mongo'"
class="info-content"
>MongoDB</p>
<p class="info-content">{{ detail.datasource.type }}</p>
</el-col>
<el-col class="info-item">
<p class="info-title">{{ $t('dataset.create_time') }}</p>

View File

@ -736,7 +736,7 @@
</template>
<script>
import { post, fieldListDQ, batchEdit } from '@/api/dataset/dataset'
import { post, fieldListDQ, batchEdit, dateformats } from '@/api/dataset/dataset'
import CalcFieldEdit from './CalcFieldEdit'
import { getFieldName } from '@/views/dataset/data/utils'
import msgCfm from '@/components/msgCfm/index'
@ -757,6 +757,7 @@ export default {
},
data() {
return {
dateFormats: [],
maxHeight: 'auto',
tableFields: {
dimensionList: [],
@ -823,6 +824,9 @@ export default {
this.dimensionChange()
this.quotaChange()
})
dateformats(this.param.id).then((response) => {
this.dateFormats = response.data
})
},
saveEdit(item) {
if (item.name && item.name.length > 50) {