forked from github/dataease
Merge remote-tracking branch 'origin/main' into main
This commit is contained in:
commit
36ec45baf7
@ -49,7 +49,7 @@ public class DatasourceController {
|
||||
}
|
||||
|
||||
@PostMapping("/delete/{datasourceID}")
|
||||
public void deleteDatasource(@PathVariable(value = "datasourceID") String datasourceID) {
|
||||
public void deleteDatasource(@PathVariable(value = "datasourceID") String datasourceID) throws Exception {
|
||||
datasourceService.deleteDatasource(datasourceID);
|
||||
}
|
||||
|
||||
|
@ -77,7 +77,13 @@ public class DatasourceService {
|
||||
return extDataSourceMapper.query(gridExample);
|
||||
}
|
||||
|
||||
public void deleteDatasource(String datasourceId) {
|
||||
public void deleteDatasource(String datasourceId) throws Exception {
|
||||
DatasetTableExample example = new DatasetTableExample();
|
||||
example.createCriteria().andDataSourceIdEqualTo(datasourceId);
|
||||
List<DatasetTable> datasetTables = datasetTableMapper.selectByExample(example);
|
||||
if(CollectionUtils.isNotEmpty(datasetTables)){
|
||||
throw new Exception(datasetTables.size() + Translator.get("i18n_datasource_not_allow_delete_msg"));
|
||||
}
|
||||
datasourceMapper.deleteByPrimaryKey(datasourceId);
|
||||
}
|
||||
|
||||
|
@ -84,11 +84,11 @@ public class DorisQueryProvider extends QueryProvider {
|
||||
}
|
||||
} else if (f.getDeExtractType() == 0) {
|
||||
if (f.getDeType() == 2) {
|
||||
stringBuilder.append("cast(").append(f.getOriginName()).append(" as decimal(20,0)) as ").append(f.getOriginName());
|
||||
stringBuilder.append("cast(").append(f.getDataeaseName()).append(" as decimal(20,0)) as ").append(f.getDataeaseName());
|
||||
} else if (f.getDeType() == 3) {
|
||||
stringBuilder.append("cast(").append(f.getOriginName()).append(" as decimal(20,2)) as ").append(f.getOriginName());
|
||||
stringBuilder.append("cast(").append(f.getDataeaseName()).append(" as decimal(20,2)) as ").append(f.getDataeaseName());
|
||||
} else {
|
||||
stringBuilder.append(f.getOriginName());
|
||||
stringBuilder.append(f.getDataeaseName());
|
||||
}
|
||||
} else {
|
||||
if (f.getDeType() == 1) {
|
||||
|
@ -88,6 +88,9 @@ public class ChartViewService {
|
||||
|
||||
public ChartViewDTO getData(String id, ChartExtRequest requestList) throws Exception {
|
||||
ChartViewWithBLOBs view = chartViewMapper.selectByPrimaryKey(id);
|
||||
if (ObjectUtils.isEmpty(view)) {
|
||||
throw new RuntimeException(Translator.get("i18n_chart_delete"));
|
||||
}
|
||||
List<ChartViewFieldDTO> xAxis = new Gson().fromJson(view.getXAxis(), new TypeToken<List<ChartViewFieldDTO>>() {
|
||||
}.getType());
|
||||
List<ChartViewFieldDTO> yAxis = new Gson().fromJson(view.getYAxis(), new TypeToken<List<ChartViewFieldDTO>>() {
|
||||
@ -122,10 +125,16 @@ public class ChartViewService {
|
||||
|
||||
// 获取数据集
|
||||
DatasetTable table = dataSetTableService.get(view.getTableId());
|
||||
if (ObjectUtils.isEmpty(table)) {
|
||||
throw new RuntimeException(Translator.get("i18n_dataset_delete"));
|
||||
}
|
||||
// 判断连接方式,直连或者定时抽取 table.mode
|
||||
List<String[]> data = new ArrayList<>();
|
||||
if (table.getMode() == 0) {// 直连
|
||||
Datasource ds = datasourceService.get(table.getDataSourceId());
|
||||
if (ObjectUtils.isEmpty(ds)) {
|
||||
throw new RuntimeException(Translator.get("i18n_datasource_delete"));
|
||||
}
|
||||
DatasourceProvider datasourceProvider = ProviderFactory.getProvider(ds.getType());
|
||||
DatasourceRequest datasourceRequest = new DatasourceRequest();
|
||||
datasourceRequest.setDatasource(ds);
|
||||
|
@ -238,6 +238,9 @@ public class DataSetTableService {
|
||||
}
|
||||
if (StringUtils.equalsIgnoreCase(datasetTable.getType(), "db")) {
|
||||
Datasource ds = datasourceMapper.selectByPrimaryKey(dataSetTableRequest.getDataSourceId());
|
||||
if (ObjectUtils.isEmpty(ds)) {
|
||||
throw new RuntimeException(Translator.get("i18n_datasource_delete"));
|
||||
}
|
||||
DatasourceProvider datasourceProvider = ProviderFactory.getProvider(ds.getType());
|
||||
DatasourceRequest datasourceRequest = new DatasourceRequest();
|
||||
datasourceRequest.setDatasource(ds);
|
||||
@ -258,6 +261,9 @@ public class DataSetTableService {
|
||||
}
|
||||
} else if (StringUtils.equalsIgnoreCase(datasetTable.getType(), "sql")) {
|
||||
Datasource ds = datasourceMapper.selectByPrimaryKey(dataSetTableRequest.getDataSourceId());
|
||||
if (ObjectUtils.isEmpty(ds)) {
|
||||
throw new RuntimeException(Translator.get("i18n_datasource_delete"));
|
||||
}
|
||||
DatasourceProvider datasourceProvider = ProviderFactory.getProvider(ds.getType());
|
||||
DatasourceRequest datasourceRequest = new DatasourceRequest();
|
||||
datasourceRequest.setDatasource(ds);
|
||||
@ -813,6 +819,7 @@ public class DataSetTableService {
|
||||
if (cellTypeEnum.equals(CellType.STRING)) {
|
||||
if (cellType) {
|
||||
tableFiled.setFieldType("TEXT");
|
||||
tableFiled.setFieldSize(65533);
|
||||
}
|
||||
return cell.getStringCellValue();
|
||||
}
|
||||
|
@ -63,7 +63,7 @@ public class DataSetTableTaskService {
|
||||
if (datasetTableTask.getRate().equalsIgnoreCase(ScheduleType.SIMPLE.toString())) {
|
||||
if (extractDataService.updateSyncStatus(dataSetTableService.get(datasetTableTask.getTableId()))) {
|
||||
throw new Exception(Translator.get("i18n_sync_job_exists"));
|
||||
} else {
|
||||
}else {
|
||||
//write log
|
||||
DatasetTableTaskLog datasetTableTaskLog = new DatasetTableTaskLog();
|
||||
datasetTableTaskLog.setTableId(datasetTableTask.getTableId());
|
||||
|
@ -689,6 +689,7 @@ public class ExtractDataService {
|
||||
String tmp_code = code.replace("alterColumnTypeCode", needToChangeColumnType).replace("Column_Fields", String.join(",", datasetTableFields.stream().map(DatasetTableField::getOriginName).collect(Collectors.toList())));
|
||||
if(isExcel){
|
||||
tmp_code = tmp_code.replace("handleExcelIntColumn", handleExcelIntColumn);
|
||||
tmp_code = tmp_code.replace("handleExcelWraps", handleExcelWraps);
|
||||
}else {
|
||||
tmp_code = tmp_code.replace("handleExcelIntColumn", "");
|
||||
}
|
||||
@ -746,6 +747,14 @@ public class ExtractDataService {
|
||||
" }catch (Exception e){}\n" +
|
||||
" }";
|
||||
|
||||
private static String handleExcelWraps = " \n" +
|
||||
" if(tmp != null ){\n" +
|
||||
" tmp = tmp.trim();\n" +
|
||||
" tmp = tmp.replaceAll(\"\\r\",\" \");\n" +
|
||||
" tmp = tmp.replaceAll(\"\\n\",\" \");\n" +
|
||||
" get(Fields.Out, filed).setValue(r, tmp);\n" +
|
||||
" }";
|
||||
|
||||
private static String code = "import org.pentaho.di.core.row.ValueMetaInterface;\n" +
|
||||
"import java.util.List;\n" +
|
||||
"import java.io.File;\n" +
|
||||
@ -775,6 +784,7 @@ public class ExtractDataService {
|
||||
" List<String> fileds = Arrays.asList(\"Column_Fields\".split(\",\"));\n" +
|
||||
" for (String filed : fileds) {\n" +
|
||||
" String tmp = get(Fields.In, filed).getString(r);\n" +
|
||||
"handleExcelWraps \n" +
|
||||
"alterColumnTypeCode \n" +
|
||||
"handleExcelIntColumn \n" +
|
||||
" str = str + tmp;\n" +
|
||||
|
@ -246,5 +246,9 @@ i18n_sync_job_exists=There is already a synchronization task running, please try
|
||||
i18n_datasource_check_fail=Invalid,please check config
|
||||
i18n_not_find_user=Can not find user.
|
||||
i18n_sql_not_empty=SQL can not be empty.
|
||||
i18n_datasource_not_allow_delete_msg= datasets are using this data source and cannot be deleted
|
||||
i18n_task_name_repeat=Name is used in same data set
|
||||
i18n_id_or_pwd_error=Invalid ID or password
|
||||
i18n_id_or_pwd_error=Invalid ID or password
|
||||
i18n_datasource_delete=Data source is delete
|
||||
i18n_dataset_delete=Data set is delete
|
||||
i18n_chart_delete=Chart is delete
|
||||
|
@ -159,7 +159,6 @@ quota_duration_excess_organization=压测时长超过组织限额
|
||||
import_xmind_count_error=思维导图导入用例数量不能超过 500 条
|
||||
license_valid_license_error=授权认证失败
|
||||
import_xmind_not_found=未找到测试用例
|
||||
|
||||
test_review_task_notice=测试评审任务通知
|
||||
test_track.length_less_than=标题过长,字数必须小于
|
||||
# check owner
|
||||
@ -185,7 +184,6 @@ automation_exec_info=没有测试步骤,无法执行
|
||||
authsource_name_already_exists=认证源名称已经存在
|
||||
authsource_name_is_null=认证源名称不能为空
|
||||
authsource_configuration_is_null=认证源配置不能为空
|
||||
|
||||
个人信息=个人信息
|
||||
仪表板=仪表板
|
||||
修改密码=修改密码
|
||||
@ -248,5 +246,9 @@ i18n_sync_job_exists=已经有同步任务在运行,稍后重试
|
||||
i18n_datasource_check_fail=校验失败,请检查配置信息
|
||||
i18n_not_find_user=未找到用户
|
||||
i18n_sql_not_empty=SQL 不能为空
|
||||
i18n_datasource_not_allow_delete_msg= 个数据集正在使用此数据源,无法删除
|
||||
i18n_task_name_repeat=同一数据集下任务名称已被使用
|
||||
i18n_id_or_pwd_error=无效的ID或密码
|
||||
i18n_id_or_pwd_error=无效的ID或密码
|
||||
i18n_datasource_delete=当前用到的数据源已被删除
|
||||
i18n_dataset_delete=当前用到的数据集已被删除
|
||||
i18n_chart_delete=当前用到的视图已被删除
|
||||
|
@ -248,5 +248,9 @@ i18n_sync_job_exists=已經有同步任務在運行,稍後重試
|
||||
i18n_datasource_check_fail=校驗失敗,請檢查配置信息
|
||||
i18n_not_find_user=未找到用戶
|
||||
i18n_sql_not_empty=SQL 不能為空
|
||||
i18n_datasource_not_allow_delete_msg= 個數據集正在使用此數據源,無法刪除
|
||||
i18n_task_name_repeat=同一數據集下任務名稱已被使用
|
||||
i18n_id_or_pwd_error=無效的ID或密碼
|
||||
i18n_id_or_pwd_error=無效的ID或密碼
|
||||
i18n_datasource_delete=當前用到的數據源已被刪除
|
||||
i18n_dataset_delete=當前用到的數據集已被刪除
|
||||
i18n_chart_delete=當前用到的視圖已被刪除
|
||||
|
@ -89,6 +89,7 @@ export default {
|
||||
if (this.curComponent) {
|
||||
this.cursors = this.getCursor() // 根据旋转角度获取光标位置
|
||||
}
|
||||
this.element.type === 'custom' && (this.pointList = ['l', 'r'])
|
||||
|
||||
eventBus.$on('runAnimation', () => {
|
||||
if (this.element === this.curComponent) {
|
||||
@ -221,7 +222,7 @@ export default {
|
||||
|
||||
handleMouseDownOnShape(e) {
|
||||
this.$store.commit('setClickComponentStatus', true)
|
||||
if (this.element.component !== 'v-text' && this.element.component !== 'rect-shape') {
|
||||
if (this.element.component !== 'v-text' && this.element.component !== 'rect-shape' && this.element.component !== 'de-input-search') {
|
||||
e.preventDefault()
|
||||
}
|
||||
|
||||
|
@ -1,9 +1,10 @@
|
||||
<template>
|
||||
<div v-loading="requestStatus==='waiting'" class="rect-shape">
|
||||
<div v-if="requestStatus==='error'" style=";width: 100%;height: 100%;background-color: #ece7e7; text-align: center">
|
||||
<div style="font-size: 12px; color: #9ea6b2;">
|
||||
{{ $t('panel.error_data') }}<br>
|
||||
{{ message }}
|
||||
<div v-if="requestStatus==='error'" class="chart-error-class">
|
||||
<div style="font-size: 12px; color: #9ea6b2;height: 100%;display: flex;align-items: center;justify-content: center;">
|
||||
{{ message.response.data.message }},{{ $t('chart.chart_show_error') }}
|
||||
<br>
|
||||
{{ $t('chart.chart_error_tips') }}
|
||||
</div>
|
||||
</div>
|
||||
<chart-component v-if="requestStatus==='success'&&chart.type && !chart.type.includes('table') && !chart.type.includes('text')" :ref="element.propValue.id" class="chart-class" :chart="chart" />
|
||||
@ -189,4 +190,12 @@ export default {
|
||||
.table-class{
|
||||
height: 100%;
|
||||
}
|
||||
.chart-error-class{
|
||||
text-align: center;
|
||||
height: calc(100% - 84px);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background-color: #ece7e7;
|
||||
}
|
||||
</style>
|
||||
|
@ -3,9 +3,10 @@
|
||||
<el-input
|
||||
v-if="options!== null && options.attrs!==null"
|
||||
v-model="options.value"
|
||||
style="width: 260px"
|
||||
resize="vertical"
|
||||
:placeholder="options.attrs.placeholder"
|
||||
@keyup.enter.native="search"
|
||||
@dblclick="setEdit"
|
||||
>
|
||||
|
||||
<el-button slot="append" icon="el-icon-search" @click="search" />
|
||||
@ -30,7 +31,8 @@ export default {
|
||||
return {
|
||||
options: null,
|
||||
operator: 'like',
|
||||
values: null
|
||||
values: null,
|
||||
canEdit: false
|
||||
}
|
||||
},
|
||||
created() {
|
||||
@ -48,6 +50,9 @@ export default {
|
||||
operator: this.operator
|
||||
}
|
||||
this.inDraw && this.$store.dispatch('conditions/add', param)
|
||||
},
|
||||
setEdit() {
|
||||
this.canEdit = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ const drawPanel = {
|
||||
type: 'custom',
|
||||
style: {
|
||||
width: 300,
|
||||
height: 47,
|
||||
height: 45.5,
|
||||
fontSize: 14,
|
||||
fontWeight: 500,
|
||||
lineHeight: '',
|
||||
|
@ -713,7 +713,9 @@ export default {
|
||||
y_M_d_H_m_s: 'Year Month Day Hour Minute Second',
|
||||
date_sub: 'yyyy-MM-dd',
|
||||
date_split: 'yyyy/MM/dd',
|
||||
chartName: 'New Chart'
|
||||
chartName: 'New Chart',
|
||||
chart_show_error: 'can not show normal',
|
||||
chart_error_tips: 'Please contact admin '
|
||||
},
|
||||
dataset: {
|
||||
sheet_warn: 'There are multiple sheet pages, and the first one is extracted by default',
|
||||
|
@ -713,7 +713,9 @@ export default {
|
||||
y_M_d_H_m_s: '年月日時分秒',
|
||||
date_sub: 'yyyy-MM-dd',
|
||||
date_split: 'yyyy/MM/dd',
|
||||
chartName: '新建視圖'
|
||||
chartName: '新建視圖',
|
||||
chart_show_error: '無法正常顯示',
|
||||
chart_error_tips: '如有疑問請聯系管理員'
|
||||
},
|
||||
dataset: {
|
||||
sheet_warn: '有多個sheet頁面,默認抽取第一個',
|
||||
|
@ -713,7 +713,9 @@ export default {
|
||||
y_M_d_H_m_s: '年月日时分秒',
|
||||
date_sub: 'yyyy-MM-dd',
|
||||
date_split: 'yyyy/MM/dd',
|
||||
chartName: '新建视图'
|
||||
chartName: '新建视图',
|
||||
chart_show_error: '无法正常显示',
|
||||
chart_error_tips: '如有疑问请联系管理员'
|
||||
},
|
||||
dataset: {
|
||||
sheet_warn: '有多个Sheet页,默认抽取第一个',
|
||||
|
@ -187,6 +187,9 @@ div:focus {
|
||||
|
||||
.custom-component-class {
|
||||
width: 100%;
|
||||
div.el-input-group__append {
|
||||
width: 10% !important;
|
||||
}
|
||||
div {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
@ -264,8 +264,9 @@
|
||||
<label-normal v-if="httpRequest.status && chart.type && chart.type.includes('text')" :chart="chart" class="table-class" />
|
||||
<div v-if="!httpRequest.status" class="chart-error-class">
|
||||
<div style="font-size: 12px; color: #9ea6b2;height: 100%;display: flex;align-items: center;justify-content: center;">
|
||||
{{ $t('panel.error_data') }}<br>
|
||||
{{ httpRequest.msg }}
|
||||
{{ httpRequest.msg }},{{ $t('chart.chart_show_error') }}
|
||||
<br>
|
||||
{{ $t('chart.chart_error_tips') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -464,8 +465,8 @@ export default {
|
||||
this.initTableField(id)
|
||||
}).catch(err => {
|
||||
this.resetView()
|
||||
this.httpRequest.status = false
|
||||
this.httpRequest.msg = err
|
||||
this.httpRequest.status = err.response.data.success
|
||||
this.httpRequest.msg = err.response.data.message
|
||||
return true
|
||||
})
|
||||
}
|
||||
@ -476,8 +477,8 @@ export default {
|
||||
this.quota = response.data.quota
|
||||
}).catch(err => {
|
||||
this.resetView()
|
||||
this.httpRequest.status = false
|
||||
this.httpRequest.msg = err
|
||||
this.httpRequest.status = err.response.data.success
|
||||
this.httpRequest.msg = err.response.data.message
|
||||
return true
|
||||
})
|
||||
},
|
||||
@ -643,8 +644,8 @@ export default {
|
||||
this.httpRequest.status = true
|
||||
}).catch(err => {
|
||||
this.resetView()
|
||||
this.httpRequest.status = false
|
||||
this.httpRequest.msg = err
|
||||
this.httpRequest.status = err.response.data.success
|
||||
this.httpRequest.msg = err.response.data.message
|
||||
return true
|
||||
})
|
||||
} else {
|
||||
@ -668,8 +669,8 @@ export default {
|
||||
this.httpRequest.status = true
|
||||
}).catch(err => {
|
||||
this.resetView()
|
||||
this.httpRequest.status = false
|
||||
this.httpRequest.msg = err
|
||||
this.httpRequest.status = err.response.data.success
|
||||
this.httpRequest.msg = err.response.data.message
|
||||
return true
|
||||
})
|
||||
} else {
|
||||
|
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
|
||||
<de-container class="de-dialog-container">
|
||||
<de-container v-loading="$store.getters.loadingMap[$store.getters.currentPath]" class="de-dialog-container">
|
||||
<de-aside-container :show-drag-bar="false" class="ms-aside-container">
|
||||
<el-tabs v-model="activeName" class="filter-dialog-tabs">
|
||||
<el-tab-pane :lazy="true" class="de-tab" :label="$t('panel.select_by_table')" name="dataset">
|
||||
@ -43,6 +43,7 @@
|
||||
<div v-else-if="showDomType === 'field'">
|
||||
<draggable
|
||||
v-model="fieldDatas"
|
||||
:disabled="selectField.length !== 0"
|
||||
:options="{group:{name: 'dimension',pull:'clone'},sort: true}"
|
||||
animation="300"
|
||||
:move="onMove"
|
||||
@ -93,6 +94,7 @@
|
||||
<div v-else-if="comShowDomType === 'field'">
|
||||
<draggable
|
||||
v-model="comFieldDatas"
|
||||
:disabled="selectField.length !== 0"
|
||||
:options="{group:{name: 'dimension',pull:'clone'},sort: true}"
|
||||
animation="300"
|
||||
:move="onMove"
|
||||
@ -119,9 +121,9 @@
|
||||
<el-col :span="24">
|
||||
<div class="filter-field">
|
||||
<div class="field-content">
|
||||
<div class="field-content-left">
|
||||
<!-- <div class="field-content-left">
|
||||
<div class="field-content-text">{{ $t('panel.field') }} </div>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<div class="field-content-right">
|
||||
<el-row style="display:flex;height: 32px;">
|
||||
|
Loading…
Reference in New Issue
Block a user