Unverified 提交 dec22613 authored 作者: 王嘉豪's avatar 王嘉豪 提交者: GitHub

Merge pull request #2197 from dataease/dev

Dev
...@@ -68,7 +68,7 @@ curl -sSL https://github.com/dataease/dataease/releases/latest/download/quick_st ...@@ -68,7 +68,7 @@ curl -sSL https://github.com/dataease/dataease/releases/latest/download/quick_st
``` ```
- [在线文档](https://dataease.io/docs/) - [在线文档](https://dataease.io/docs/)
- [演示视频](https://www.bilibili.com/video/BV1UB4y1K7jA) - [演示视频](https://www.bilibili.com/video/BV1i34y1v7hq/)
## 微信群 ## 微信群
......
...@@ -5,10 +5,7 @@ import io.dataease.auth.annotation.DePermission; ...@@ -5,10 +5,7 @@ import io.dataease.auth.annotation.DePermission;
import io.dataease.auth.annotation.DePermissionProxy; import io.dataease.auth.annotation.DePermissionProxy;
import io.dataease.commons.constants.DePermissionType; import io.dataease.commons.constants.DePermissionType;
import io.dataease.commons.constants.ResourceAuthLevel; import io.dataease.commons.constants.ResourceAuthLevel;
import io.dataease.controller.request.chart.ChartCalRequest; import io.dataease.controller.request.chart.*;
import io.dataease.controller.request.chart.ChartExtRequest;
import io.dataease.controller.request.chart.ChartViewCacheRequest;
import io.dataease.controller.request.chart.ChartViewRequest;
import io.dataease.controller.response.ChartDetail; import io.dataease.controller.response.ChartDetail;
import io.dataease.dto.chart.ChartViewDTO; import io.dataease.dto.chart.ChartViewDTO;
import io.dataease.plugins.common.base.domain.ChartViewCacheWithBLOBs; import io.dataease.plugins.common.base.domain.ChartViewCacheWithBLOBs;
...@@ -23,6 +20,7 @@ import springfox.documentation.annotations.ApiIgnore; ...@@ -23,6 +20,7 @@ import springfox.documentation.annotations.ApiIgnore;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* @Author gin * @Author gin
...@@ -112,6 +110,13 @@ public class ChartViewController { ...@@ -112,6 +110,13 @@ public class ChartViewController {
return chartViewService.chartCopy(id, panelId); return chartViewService.chartCopy(id, panelId);
} }
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANNEL_LEVEL_MANAGE, paramIndex = 1)
@ApiOperation("批量复制")
@PostMapping("chartBatchCopy/{panelId}")
public Map<String,String> chartBatchCopy(@RequestBody ChartCopyBatchRequest request, @PathVariable String panelId) {
return chartViewService.chartBatchCopy(request,panelId);
}
@ApiIgnore @ApiIgnore
@GetMapping("searchAdviceSceneId/{panelId}") @GetMapping("searchAdviceSceneId/{panelId}")
public String searchAdviceSceneId(@PathVariable String panelId) { public String searchAdviceSceneId(@PathVariable String panelId) {
......
package io.dataease.controller.request.chart;
import lombok.Data;
import java.util.HashMap;
import java.util.Map;
/**
* Author: wangjiahao
* Date: 2022/4/26
* Description:
*/
@Data
public class ChartCopyBatchRequest {
private String panelId;
private Map<String,String> sourceAndTargetIds;
}
package io.dataease.service.chart; package io.dataease.service.chart;
import cn.hutool.core.lang.Assert;
import com.google.gson.Gson; import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken; import com.google.gson.reflect.TypeToken;
import io.dataease.auth.entity.SysUserEntity; import io.dataease.auth.entity.SysUserEntity;
...@@ -1024,13 +1025,35 @@ public class ChartViewService { ...@@ -1024,13 +1025,35 @@ public class ChartViewService {
return chartViewMapper.selectByPrimaryKey(id); return chartViewMapper.selectByPrimaryKey(id);
} }
public String chartCopy(String id, String panelId) { public String chartCopy(String sourceViewId,String newViewId, String panelId) {
extChartViewMapper.chartCopy(newViewId, sourceViewId, panelId);
extChartViewMapper.copyCache(sourceViewId, newViewId);
extPanelGroupExtendDataMapper.copyExtendData(sourceViewId, newViewId, panelId);
chartViewCacheService.refreshCache(newViewId);
return newViewId;
}
public String chartCopy(String sourceViewId, String panelId) {
String newChartId = UUID.randomUUID().toString(); String newChartId = UUID.randomUUID().toString();
extChartViewMapper.chartCopy(newChartId, id, panelId); return chartCopy(sourceViewId,newChartId,panelId);
extChartViewMapper.copyCache(id, newChartId); }
extPanelGroupExtendDataMapper.copyExtendData(id, newChartId, panelId);
chartViewCacheService.refreshCache(newChartId);
return newChartId; /**
* @Description Copy a set of views with a given source ID and target ID
* @param request
* @param panelId
* @return
*/
public Map<String,String> chartBatchCopy(ChartCopyBatchRequest request,String panelId){
Assert.notNull(panelId,"panelId should not be null");
Map<String,String> sourceAndTargetIds = request.getSourceAndTargetIds();
if(sourceAndTargetIds != null && !sourceAndTargetIds.isEmpty()){
for(Map.Entry<String,String> entry:sourceAndTargetIds.entrySet()){
chartCopy(entry.getKey(),entry.getValue(),panelId);
}
}
return request.getSourceAndTargetIds();
} }
public String searchAdviceSceneId(String panelId) { public String searchAdviceSceneId(String panelId) {
......
...@@ -120,6 +120,19 @@ public class ExtractDataService { ...@@ -120,6 +120,19 @@ public class ExtractDataService {
" exit 1\n" + " exit 1\n" +
"fi\n"; "fi\n";
private static final String shellScriptForDeleteFile = "result=`curl --location-trusted -u %s:%s -H \"label:%s\" -H \"column_separator:%s\" -H \"columns:%s\" -H \"merge_type: %s\" -T %s -XPUT http://%s:%s/api/%s/%s/_stream_load`\n" +
"rm -rf %s \n" +
"if [ $? -eq 0 ] ; then\n" +
" failstatus=$(echo $result | grep '\"Status\": \"Fail\"')\n" +
" if [ \"x${failstatus}\" != \"x\" ];then" +
" echo $result\n" +
" exit 1\n" +
" fi\n" +
"else\n" +
" echo $result\n" +
" exit 1\n" +
"fi\n";
public synchronized boolean existSyncTask(DatasetTable datasetTable, DatasetTableTask datasetTableTask, Long startTime) { public synchronized boolean existSyncTask(DatasetTable datasetTable, DatasetTableTask datasetTableTask, Long startTime) {
datasetTable.setSyncStatus(JobStatus.Underway.name()); datasetTable.setSyncStatus(JobStatus.Underway.name());
DatasetTableExample example = new DatasetTableExample(); DatasetTableExample example = new DatasetTableExample();
...@@ -445,14 +458,20 @@ public class ExtractDataService { ...@@ -445,14 +458,20 @@ public class ExtractDataService {
String dataFile = null; String dataFile = null;
String script = null; String script = null;
String streamLoadScript = "";
if(kettleFilesKeep){
streamLoadScript = shellScript;
}else {
streamLoadScript = shellScriptForDeleteFile;
}
switch (extractType) { switch (extractType) {
case "all_scope": case "all_scope":
dataFile = root_path + TableUtils.tmpName(TableUtils.tableName(datasetTable.getId())) + "." + extention; dataFile = root_path + TableUtils.tmpName(TableUtils.tableName(datasetTable.getId())) + "." + extention;
script = String.format(shellScript, dorisConfiguration.getUsername(), dorisConfiguration.getPassword(), System.currentTimeMillis(), separator, columns, "APPEND", dataFile, dorisConfiguration.getHost(), dorisConfiguration.getHttpPort(), dorisConfiguration.getDataBase(), TableUtils.tmpName(TableUtils.tableName(datasetTable.getId()))); script = String.format(streamLoadScript, dorisConfiguration.getUsername(), dorisConfiguration.getPassword(), System.currentTimeMillis(), separator, columns, "APPEND", dataFile, dorisConfiguration.getHost(), dorisConfiguration.getHttpPort(), dorisConfiguration.getDataBase(), TableUtils.tmpName(TableUtils.tableName(datasetTable.getId())));
break; break;
default: default:
dataFile = root_path + TableUtils.addName(TableUtils.tableName(datasetTable.getId())) + "." + extention; dataFile = root_path + TableUtils.addName(TableUtils.tableName(datasetTable.getId())) + "." + extention;
script = String.format(shellScript, dorisConfiguration.getUsername(), dorisConfiguration.getPassword(), System.currentTimeMillis(), separator, columns, "APPEND", dataFile, dorisConfiguration.getHost(), dorisConfiguration.getHttpPort(), dorisConfiguration.getDataBase(), TableUtils.tableName(datasetTable.getId())); script = String.format(streamLoadScript, dorisConfiguration.getUsername(), dorisConfiguration.getPassword(), System.currentTimeMillis(), separator, columns, "APPEND", dataFile, dorisConfiguration.getHost(), dorisConfiguration.getHttpPort(), dorisConfiguration.getDataBase(), TableUtils.tableName(datasetTable.getId()));
break; break;
} }
...@@ -744,7 +763,6 @@ public class ExtractDataService { ...@@ -744,7 +763,6 @@ public class ExtractDataService {
DataEaseException.throwException(transStatus.getLoggingString()); DataEaseException.throwException(transStatus.getLoggingString());
return; return;
} }
executing = true; executing = true;
String lastCarteObjectId = Job.sendToSlaveServer(jobMeta, jobExecutionConfiguration, repository, null); String lastCarteObjectId = Job.sendToSlaveServer(jobMeta, jobExecutionConfiguration, repository, null);
SlaveServerJobStatus jobStatus = null; SlaveServerJobStatus jobStatus = null;
...@@ -759,7 +777,7 @@ public class ExtractDataService { ...@@ -759,7 +777,7 @@ public class ExtractDataService {
if (jobStatus.getStatusDescription().equals("Finished")) { if (jobStatus.getStatusDescription().equals("Finished")) {
return; return;
} else { } else {
DataEaseException.throwException((jobStatus.getLoggingString())); DataEaseException.throwException(jobStatus.getLoggingString());
} }
} }
...@@ -773,20 +791,26 @@ public class ExtractDataService { ...@@ -773,20 +791,26 @@ public class ExtractDataService {
Datasource dorisDatasource = engineService.getDeEngine(); Datasource dorisDatasource = engineService.getDeEngine();
DorisConfiguration dorisConfiguration = new Gson().fromJson(dorisDatasource.getConfiguration(), DorisConfiguration.class); DorisConfiguration dorisConfiguration = new Gson().fromJson(dorisDatasource.getConfiguration(), DorisConfiguration.class);
String columns = columnFields + ",dataease_uuid"; String columns = columnFields + ",dataease_uuid";
String streamLoadScript = "";
if(kettleFilesKeep){
streamLoadScript = shellScript;
}else {
streamLoadScript = shellScriptForDeleteFile;
}
switch (extractType) { switch (extractType) {
case "all_scope": case "all_scope":
outFile = TableUtils.tmpName(TableUtils.tableName(datasetTable.getId())); outFile = TableUtils.tmpName(TableUtils.tableName(datasetTable.getId()));
jobName = "job_" + TableUtils.tableName(datasetTable.getId()); jobName = "job_" + TableUtils.tableName(datasetTable.getId());
script = String.format(shellScript, dorisConfiguration.getUsername(), dorisConfiguration.getPassword(), System.currentTimeMillis(), separator, columns, "APPEND", root_path + outFile + "." + extention, dorisConfiguration.getHost(), dorisConfiguration.getHttpPort(), dorisConfiguration.getDataBase(), TableUtils.tmpName(TableUtils.tableName(datasetTable.getId())), root_path + outFile + "." + extention); script = String.format(streamLoadScript, dorisConfiguration.getUsername(), dorisConfiguration.getPassword(), datasetTable.getId() + System.currentTimeMillis(), separator, columns, "APPEND", root_path + outFile + "." + extention, dorisConfiguration.getHost(), dorisConfiguration.getHttpPort(), dorisConfiguration.getDataBase(), TableUtils.tmpName(TableUtils.tableName(datasetTable.getId())), root_path + outFile + "." + extention);
break; break;
case "incremental_add": case "incremental_add":
outFile = TableUtils.addName(datasetTable.getId()); outFile = TableUtils.addName(datasetTable.getId());
jobName = "job_add_" + TableUtils.tableName(datasetTable.getId()); jobName = "job_add_" + TableUtils.tableName(datasetTable.getId());
script = String.format(shellScript, dorisConfiguration.getUsername(), dorisConfiguration.getPassword(), System.currentTimeMillis(), separator, columns, "APPEND", root_path + outFile + "." + extention, dorisConfiguration.getHost(), dorisConfiguration.getHttpPort(), dorisConfiguration.getDataBase(), TableUtils.tableName(datasetTable.getId()), root_path + outFile + "." + extention); script = String.format(streamLoadScript, dorisConfiguration.getUsername(), dorisConfiguration.getPassword(), datasetTable.getId() + System.currentTimeMillis(), separator, columns, "APPEND", root_path + outFile + "." + extention, dorisConfiguration.getHost(), dorisConfiguration.getHttpPort(), dorisConfiguration.getDataBase(), TableUtils.tableName(datasetTable.getId()), root_path + outFile + "." + extention);
break; break;
case "incremental_delete": case "incremental_delete":
outFile = TableUtils.deleteName(TableUtils.tableName(datasetTable.getId())); outFile = TableUtils.deleteName(TableUtils.tableName(datasetTable.getId()));
script = String.format(shellScript, dorisConfiguration.getUsername(), dorisConfiguration.getPassword(), System.currentTimeMillis(), separator, columns, "DELETE", root_path + outFile + "." + extention, dorisConfiguration.getHost(), dorisConfiguration.getHttpPort(), dorisConfiguration.getDataBase(), TableUtils.tableName(datasetTable.getId()), root_path + outFile + "." + extention); script = String.format(streamLoadScript, dorisConfiguration.getUsername(), dorisConfiguration.getPassword(), datasetTable.getId() + System.currentTimeMillis(), separator, columns, "DELETE", root_path + outFile + "." + extention, dorisConfiguration.getHost(), dorisConfiguration.getHttpPort(), dorisConfiguration.getDataBase(), TableUtils.tableName(datasetTable.getId()), root_path + outFile + "." + extention);
jobName = "job_delete_" + TableUtils.tableName(datasetTable.getId()); jobName = "job_delete_" + TableUtils.tableName(datasetTable.getId());
break; break;
default: default:
......
...@@ -115,6 +115,9 @@ public class DatasourceService { ...@@ -115,6 +115,9 @@ public class DatasourceService {
datasourceDTO.setCalculationMode(dataSourceType.getCalculationMode()); datasourceDTO.setCalculationMode(dataSourceType.getCalculationMode());
} }
}); });
if(datasourceDTO.getType().equalsIgnoreCase(DatasourceTypes.mysql.toString())){
datasourceDTO.setConfiguration(JSONObject.toJSONString(new Gson().fromJson(datasourceDTO.getConfiguration(), MysqlConfiguration.class)) );
}
if(datasourceDTO.getType().equalsIgnoreCase(DatasourceTypes.api.toString())){ if(datasourceDTO.getType().equalsIgnoreCase(DatasourceTypes.api.toString())){
JSONArray apiDefinitionList = JSONObject.parseArray(datasourceDTO.getConfiguration()); JSONArray apiDefinitionList = JSONObject.parseArray(datasourceDTO.getConfiguration());
JSONArray apiDefinitionListWithStatus = new JSONArray(); JSONArray apiDefinitionListWithStatus = new JSONArray();
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -27,6 +27,14 @@ export function chartCopy(id, panelId) { ...@@ -27,6 +27,14 @@ export function chartCopy(id, panelId) {
loading: false loading: false
}) })
} }
export function chartBatchCopy(params, panelId) {
return request({
url: '/chart/view/chartBatchCopy/' + panelId,
method: 'post',
data: params,
loading: false
})
}
export function chartGroupTree(data) { export function chartGroupTree(data) {
return request({ return request({
url: '/chart/group/tree', url: '/chart/group/tree',
......
...@@ -2,7 +2,7 @@ import store from '@/store/index' ...@@ -2,7 +2,7 @@ import store from '@/store/index'
import toast from '@/components/canvas/utils/toast' import toast from '@/components/canvas/utils/toast'
import generateID from '@/components/canvas/utils/generateID' import generateID from '@/components/canvas/utils/generateID'
import { deepCopy } from '@/components/canvas/utils/utils' import { deepCopy } from '@/components/canvas/utils/utils'
import { chartCopy } from '@/api/chart/chart' import { chartBatchCopy, chartCopy } from '@/api/chart/chart'
import { uuid } from 'vue-uuid' import { uuid } from 'vue-uuid'
export default { export default {
...@@ -53,6 +53,19 @@ export default { ...@@ -53,6 +53,19 @@ export default {
newView.propValue.viewId = res.data newView.propValue.viewId = res.data
store.commit('addComponent', { component: newView }) store.commit('addComponent', { component: newView })
}) })
} if (data.type === 'de-tabs') {
const sourceAndTargetIds = {}
const newCop = deepCopy(data)
newCop.options.tabList.forEach((item) => {
if (item.content && item.content.type === 'view') {
const newViewId = uuid.v1()
sourceAndTargetIds[item.content.propValue.viewId] = newViewId
item.content.propValue.viewId = newViewId
}
})
chartBatchCopy({ 'sourceAndTargetIds': sourceAndTargetIds }, state.panel.panelInfo.id).then((rsp) => {
store.commit('addComponent', { component: newCop })
})
} else { } else {
const newCop = deepCopy(data) const newCop = deepCopy(data)
newCop.id = uuid.v1() newCop.id = uuid.v1()
......
...@@ -227,7 +227,8 @@ export default { ...@@ -227,7 +227,8 @@ export default {
this.onFocus = true this.onFocus = true
// 下拉框弹出时,设置弹框的宽度 // 下拉框弹出时,设置弹框的宽度
this.$nextTick(() => { this.$nextTick(() => {
this.selectOptionWidth = event.srcElement.offsetWidth + 'px' // this.selectOptionWidth = event.srcElement.offsetWidth + 'px'
this.selectOptionWidth = event.srcElement.parentElement.parentElement.offsetWidth + 'px'
}) })
} }
......
...@@ -110,6 +110,7 @@ import { mapState } from 'vuex' ...@@ -110,6 +110,7 @@ import { mapState } from 'vuex'
import { deepCopy } from '@/components/canvas/utils/utils' import { deepCopy } from '@/components/canvas/utils/utils'
import { COLOR_PANEL } from '@/views/chart/chart/chart' import { COLOR_PANEL } from '@/views/chart/chart/chart'
import { uploadFileResult } from '@/api/staticResource/staticResource' import { uploadFileResult } from '@/api/staticResource/staticResource'
import { COMMON_BACKGROUND_NONE } from '@/components/canvas/custom-component/component-list'
export default { export default {
name: 'Background', name: 'Background',
...@@ -144,7 +145,7 @@ export default { ...@@ -144,7 +145,7 @@ export default {
if (this.curComponent && this.curComponent.commonBackground && this.curComponent.commonBackground.outerImage && typeof (this.curComponent.commonBackground.outerImage) === 'string') { if (this.curComponent && this.curComponent.commonBackground && this.curComponent.commonBackground.outerImage && typeof (this.curComponent.commonBackground.outerImage) === 'string') {
this.fileList.push({ url: this.curComponent.commonBackground.outerImage }) this.fileList.push({ url: this.curComponent.commonBackground.outerImage })
} }
this.backgroundOrigin = deepCopy(this.curComponent.commonBackground) this.backgroundOrigin = deepCopy(this.curComponent.commonBackground ? this.curComponent.commonBackground : COMMON_BACKGROUND_NONE)
this.queryBackground() this.queryBackground()
}, },
queryBackground() { queryBackground() {
......
...@@ -674,8 +674,7 @@ export const BASE_CHART_STRING = { ...@@ -674,8 +674,7 @@ export const BASE_CHART_STRING = {
legend: DEFAULT_LEGEND_STYLE, legend: DEFAULT_LEGEND_STYLE,
xAxis: DEFAULT_XAXIS_STYLE, xAxis: DEFAULT_XAXIS_STYLE,
yAxis: DEFAULT_YAXIS_STYLE, yAxis: DEFAULT_YAXIS_STYLE,
yAxisExt: DEFAULT_YAXIS_EXT_STYLE, yAxisExt: DEFAULT_YAXIS_EXT_STYLE
background: DEFAULT_BACKGROUND_COLOR
}), }),
customFilter: '[]' customFilter: '[]'
} }
...@@ -698,8 +697,7 @@ export const BASE_CHART = { ...@@ -698,8 +697,7 @@ export const BASE_CHART = {
legend: DEFAULT_LEGEND_STYLE, legend: DEFAULT_LEGEND_STYLE,
xAxis: DEFAULT_XAXIS_STYLE, xAxis: DEFAULT_XAXIS_STYLE,
yAxis: DEFAULT_YAXIS_STYLE, yAxis: DEFAULT_YAXIS_STYLE,
yAxisExt: DEFAULT_YAXIS_EXT_STYLE, yAxisExt: DEFAULT_YAXIS_EXT_STYLE
background: DEFAULT_BACKGROUND_COLOR
}, },
customFilter: [] customFilter: []
} }
......
...@@ -215,7 +215,7 @@ export default { ...@@ -215,7 +215,7 @@ export default {
} else if (chart.type === 'radar') { } else if (chart.type === 'radar') {
chart_option = baseRadarOption(JSON.parse(JSON.stringify(BASE_RADAR)), chart) chart_option = baseRadarOption(JSON.parse(JSON.stringify(BASE_RADAR)), chart)
} else if (chart.type === 'gauge') { } else if (chart.type === 'gauge') {
chart_option = baseGaugeOption(JSON.parse(JSON.stringify(BASE_GAUGE)), chart, this.scale) chart_option = baseGaugeOption(JSON.parse(JSON.stringify(BASE_GAUGE)), chart, this.terminalType === 'pc' ? this.scale : '0.7')
} else if (chart.type === 'scatter') { } else if (chart.type === 'scatter') {
chart_option = baseScatterOption(JSON.parse(JSON.stringify(BASE_SCATTER)), chart, this.terminalType) chart_option = baseScatterOption(JSON.parse(JSON.stringify(BASE_SCATTER)), chart, this.terminalType)
} else if (chart.type === 'treemap') { } else if (chart.type === 'treemap') {
......
export function getItemType(dimensionData, quotaData, item) { export function getItemType(dimensionData, quotaData, item) {
// Check whether the current view is in template status
// ( dimensionData and quotaData have no data). If yes, return 'success' directly
if (dimensionData.length === 0 && quotaData.length === 0) {
return 'success'
}
// 将item的字段在数据集维度、指标字段中查询一遍,如果遇到id不存在、字段类型不一致、维度指标不一致,则提示 // 将item的字段在数据集维度、指标字段中查询一遍,如果遇到id不存在、字段类型不一致、维度指标不一致,则提示
const status = item.groupType const status = item.groupType
let checked = false let checked = false
......
...@@ -1178,7 +1178,6 @@ import bus from '@/utils/bus' ...@@ -1178,7 +1178,6 @@ import bus from '@/utils/bus'
import DatasetChartDetail from '../../dataset/common/DatasetChartDetail' import DatasetChartDetail from '../../dataset/common/DatasetChartDetail'
// shape attr,component style // shape attr,component style
import { import {
DEFAULT_BACKGROUND_COLOR,
DEFAULT_COLOR_CASE, DEFAULT_COLOR_CASE,
DEFAULT_FUNCTION_CFG, DEFAULT_FUNCTION_CFG,
DEFAULT_LABEL, DEFAULT_LABEL,
...@@ -1333,7 +1332,6 @@ export default { ...@@ -1333,7 +1332,6 @@ export default {
xAxis: DEFAULT_XAXIS_STYLE, xAxis: DEFAULT_XAXIS_STYLE,
yAxis: DEFAULT_YAXIS_STYLE, yAxis: DEFAULT_YAXIS_STYLE,
yAxisExt: DEFAULT_YAXIS_EXT_STYLE, yAxisExt: DEFAULT_YAXIS_EXT_STYLE,
background: DEFAULT_BACKGROUND_COLOR,
split: DEFAULT_SPLIT split: DEFAULT_SPLIT
}, },
senior: { senior: {
...@@ -1472,7 +1470,8 @@ export default { ...@@ -1472,7 +1470,8 @@ export default {
}) })
this.pluginRenderOptions = [...this.renderOptions, ...pluginOptions] this.pluginRenderOptions = [...this.renderOptions, ...pluginOptions]
}, },
emptyTableData() { emptyTableData(id) {
console.log('emptyTableData:' + id)
this.table = {} this.table = {}
this.dimension = [] this.dimension = []
this.quota = [] this.quota = []
...@@ -1500,8 +1499,11 @@ export default { ...@@ -1500,8 +1499,11 @@ export default {
initTableData(id, optType) { initTableData(id, optType) {
if (id != null) { if (id != null) {
post('/dataset/table/getWithPermission/' + id, null).then(response => { post('/dataset/table/getWithPermission/' + id, null).then(response => {
// If click too fast on the panel, the data here may be inconsistent, so make a verification
if (this.view.tableId === id) {
this.table = response.data this.table = response.data
this.initTableField(id, optType) this.initTableField(id, optType)
}
}).catch(err => { }).catch(err => {
this.table = null this.table = null
this.resetDatasetField() this.resetDatasetField()
...@@ -1514,6 +1516,8 @@ export default { ...@@ -1514,6 +1516,8 @@ export default {
initTableField(id, optType) { initTableField(id, optType) {
if (this.table) { if (this.table) {
post('/dataset/table/getFieldsFromDE', this.table).then(response => { post('/dataset/table/getFieldsFromDE', this.table).then(response => {
// If click too fast on the panel, the data here may be inconsistent, so make a verification
if (this.view.tableId === id) {
this.dimension = response.data.dimension this.dimension = response.data.dimension
this.quota = response.data.quota this.quota = response.data.quota
this.dimensionData = JSON.parse(JSON.stringify(this.dimension)) this.dimensionData = JSON.parse(JSON.stringify(this.dimension))
...@@ -1526,6 +1530,7 @@ export default { ...@@ -1526,6 +1530,7 @@ export default {
this.calcData() this.calcData()
}) })
} }
}
}).catch(err => { }).catch(err => {
console.log(err) console.log(err)
this.resetView() this.resetView()
...@@ -1911,8 +1916,10 @@ export default { ...@@ -1911,8 +1916,10 @@ export default {
getChart(id, queryFrom = 'panel_edit') { getChart(id, queryFrom = 'panel_edit') {
if (id) { if (id) {
getChartDetails(id, this.panelInfo.id, { queryFrom: queryFrom }).then(response => { getChartDetails(id, this.panelInfo.id, { queryFrom: queryFrom }).then(response => {
// If click too fast on the panel, the data here may be inconsistent, so make a verification
if (response.data.id === this.param.id) {
if (response.data.dataFrom === 'template') { if (response.data.dataFrom === 'template') {
this.emptyTableData() this.emptyTableData(response.data.id)
} else { } else {
this.initTableData(response.data.tableId) this.initTableData(response.data.tableId)
} }
...@@ -1932,6 +1939,7 @@ export default { ...@@ -1932,6 +1939,7 @@ export default {
// 将视图传入echart组件 // 将视图传入echart组件
this.chart = response.data this.chart = response.data
this.data = response.data.data this.data = response.data.data
}
}).catch(err => { }).catch(err => {
this.httpRequest.status = err.response.data.success this.httpRequest.status = err.response.data.success
this.httpRequest.msg = err.response.data.message this.httpRequest.msg = err.response.data.message
......
...@@ -23,16 +23,16 @@ ...@@ -23,16 +23,16 @@
<panel-view-result class="attr-selector" /> <panel-view-result class="attr-selector" />
</el-row> </el-row>
</el-collapse-item> </el-collapse-item>
<el-collapse-item :title="$t('chart.module_style')" name="component"> <!-- <el-collapse-item :title="$t('chart.module_style')" name="component">-->
<el-row class="selector-div"> <!-- <el-row class="selector-div">-->
<panel-background-color-selector <!-- <panel-background-color-selector-->
v-if="chart" <!-- v-if="chart"-->
class="attr-selector" <!-- class="attr-selector"-->
:chart="chart" <!-- :chart="chart"-->
@onChangeBackgroundForm="onChangeBackgroundForm" <!-- @onChangeBackgroundForm="onChangeBackgroundForm"-->
/> <!-- />-->
</el-row> <!-- </el-row>-->
</el-collapse-item> <!-- </el-collapse-item>-->
<el-collapse-item :title="$t('chart.shape_attr')" name="graphical"> <el-collapse-item :title="$t('chart.shape_attr')" name="graphical">
<el-row class="selector-div"> <el-row class="selector-div">
<panel-color-selector <panel-color-selector
......
...@@ -949,6 +949,7 @@ export default { ...@@ -949,6 +949,7 @@ export default {
hyperlinks: HYPERLINKS, hyperlinks: HYPERLINKS,
mobileStyle: BASE_MOBILE_STYLE, mobileStyle: BASE_MOBILE_STYLE,
propValue: fileResult, propValue: fileResult,
commonBackground: deepCopy(COMMON_BACKGROUND),
style: { style: {
...commonStyle ...commonStyle
} }
......
...@@ -277,6 +277,7 @@ export default { ...@@ -277,6 +277,7 @@ export default {
this.form = JSON.parse(JSON.stringify(row)) this.form = JSON.parse(JSON.stringify(row))
this.originConfiguration = this.form.configuration this.originConfiguration = this.form.configuration
if (row.type === 'api') { if (row.type === 'api') {
} else { } else {
this.form.configuration = JSON.parse(this.form.configuration) this.form.configuration = JSON.parse(this.form.configuration)
} }
...@@ -320,6 +321,7 @@ export default { ...@@ -320,6 +321,7 @@ export default {
case 'ck': case 'ck':
case 'mongo': case 'mongo':
case 'mariadb': case 'mariadb':
case 'impala':
if (configuration.host == this.form.configuration.host && configuration.dataBase == this.form.configuration.dataBase && configuration.port == this.form.configuration.port) { if (configuration.host == this.form.configuration.host && configuration.dataBase == this.form.configuration.dataBase && configuration.port == this.form.configuration.port) {
repeat = true repeat = true
repeatDsName.push(child.name) repeatDsName.push(child.name)
...@@ -493,7 +495,9 @@ export default { ...@@ -493,7 +495,9 @@ export default {
changeType() { changeType() {
for (let i = 0; i < this.dsTypes.length; i++) { for (let i = 0; i < this.dsTypes.length; i++) {
if (this.dsTypes[i].type === this.form.type) { if (this.dsTypes[i].type === this.form.type) {
if(row.type !== 'api'){
this.form.configuration.extraParams = this.dsTypes[i].extraParams this.form.configuration.extraParams = this.dsTypes[i].extraParams
}
this.datasourceType = this.dsTypes[i] this.datasourceType = this.dsTypes[i]
} }
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<el-row class="demo_main"> <el-row class="demo_main">
<div class="demo_title" /> <div class="demo_title" />
<div class="demo_content"> <div class="demo_content">
<a href="https://www.bilibili.com/video/BV1UB4y1K7jA" target="_blank">{{ $t('wizard.demo_video_hint') }}</a> <a href="https://www.bilibili.com/video/BV1i34y1v7hq/" target="_blank">{{ $t('wizard.demo_video_hint') }}</a>
</div> </div>
</el-row> </el-row>
</template> </template>
......
...@@ -43,7 +43,7 @@ export default { ...@@ -43,7 +43,7 @@ export default {
head: this.$t('wizard.quick_start'), head: this.$t('wizard.quick_start'),
content: this.$t('wizard.demo_video_hint'), content: this.$t('wizard.demo_video_hint'),
bottom: '', bottom: '',
href: 'https://www.bilibili.com/video/BV1UB4y1K7jA', href: 'https://www.bilibili.com/video/BV1i34y1v7hq/',
component: 'CardDetail' component: 'CardDetail'
}, },
{ {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论