提交 15cfbaae authored 作者: junjie's avatar junjie

feat: 字段支持公式计算

上级 de5022a1
......@@ -42,4 +42,6 @@ public class ChartViewFieldDTO implements Serializable {
private String dateStyle;
private String datePattern;
private Integer extField;
}
......@@ -11,8 +11,8 @@ import io.dataease.base.mapper.ext.UtilMapper;
import io.dataease.commons.constants.JobStatus;
import io.dataease.commons.constants.ScheduleType;
import io.dataease.commons.constants.TaskStatus;
import io.dataease.commons.exception.DEException;
import io.dataease.commons.utils.*;
import io.dataease.controller.request.chart.ChartGroupRequest;
import io.dataease.controller.request.dataset.DataSetGroupRequest;
import io.dataease.controller.request.dataset.DataSetTableRequest;
import io.dataease.controller.request.dataset.DataSetTaskRequest;
......@@ -383,12 +383,14 @@ public class DataSetTableService {
data.addAll(datasourceProvider.getData(datasourceRequest));
} catch (Exception e) {
e.printStackTrace();
DEException.throwException(e.getMessage());
}
try {
datasourceRequest.setQuery(qp.createQueryTableWithLimit(table, fields, Integer.valueOf(dataSetTableRequest.getRow()), false));
dataSetPreviewPage.setTotal(datasourceProvider.getData(datasourceRequest).size());
} catch (Exception e) {
e.printStackTrace();
DEException.throwException(e.getMessage());
}
} else {
// check doris table
......@@ -407,12 +409,14 @@ public class DataSetTableService {
data.addAll(jdbcProvider.getData(datasourceRequest));
} catch (Exception e) {
e.printStackTrace();
DEException.throwException(e.getMessage());
}
try {
datasourceRequest.setQuery(qp.createQueryTableWithLimit(table, fields, Integer.valueOf(dataSetTableRequest.getRow()), false));
dataSetPreviewPage.setTotal(jdbcProvider.getData(datasourceRequest).size());
} catch (Exception e) {
e.printStackTrace();
DEException.throwException(e.getMessage());
}
}
......@@ -434,12 +438,14 @@ public class DataSetTableService {
data.addAll(datasourceProvider.getData(datasourceRequest));
} catch (Exception e) {
e.printStackTrace();
DEException.throwException(e.getMessage());
}
try {
datasourceRequest.setQuery(qp.createQuerySqlWithLimit(sql, fields, Integer.valueOf(dataSetTableRequest.getRow()), false));
dataSetPreviewPage.setTotal(datasourceProvider.getData(datasourceRequest).size());
} catch (Exception e) {
e.printStackTrace();
DEException.throwException(e.getMessage());
}
} else {
// check doris table
......@@ -458,12 +464,14 @@ public class DataSetTableService {
data.addAll(jdbcProvider.getData(datasourceRequest));
} catch (Exception e) {
e.printStackTrace();
DEException.throwException(e.getMessage());
}
try {
datasourceRequest.setQuery(qp.createQueryTableWithLimit(table, fields, Integer.valueOf(dataSetTableRequest.getRow()), false));
dataSetPreviewPage.setTotal(jdbcProvider.getData(datasourceRequest).size());
} catch (Exception e) {
e.printStackTrace();
DEException.throwException(e.getMessage());
}
}
} else if (StringUtils.equalsIgnoreCase(datasetTable.getType(), "excel")) {
......@@ -483,12 +491,14 @@ public class DataSetTableService {
data.addAll(jdbcProvider.getData(datasourceRequest));
} catch (Exception e) {
e.printStackTrace();
DEException.throwException(e.getMessage());
}
try {
datasourceRequest.setQuery(qp.createQueryTableWithLimit(table, fields, Integer.valueOf(dataSetTableRequest.getRow()), false));
dataSetPreviewPage.setTotal(jdbcProvider.getData(datasourceRequest).size());
} catch (Exception e) {
e.printStackTrace();
DEException.throwException(e.getMessage());
}
} else if (StringUtils.equalsIgnoreCase(datasetTable.getType(), "custom")) {
if (datasetTable.getMode() == 0) {
......@@ -511,12 +521,14 @@ public class DataSetTableService {
data.addAll(datasourceProvider.getData(datasourceRequest));
} catch (Exception e) {
e.printStackTrace();
DEException.throwException(e.getMessage());
}
try {
datasourceRequest.setQuery(qp.createQuerySqlWithLimit(sql, fields, Integer.valueOf(dataSetTableRequest.getRow()), false));
dataSetPreviewPage.setTotal(datasourceProvider.getData(datasourceRequest).size());
} catch (Exception e) {
e.printStackTrace();
DEException.throwException(e.getMessage());
}
} else {
Datasource ds = (Datasource) CommonBeanFactory.getBean("DorisDatasource");
......@@ -531,6 +543,7 @@ public class DataSetTableService {
data.addAll(jdbcProvider.getData(datasourceRequest));
} catch (Exception e) {
e.printStackTrace();
DEException.throwException(e.getMessage());
}
try {
......@@ -538,6 +551,7 @@ public class DataSetTableService {
dataSetPreviewPage.setTotal(jdbcProvider.getData(datasourceRequest).size());
} catch (Exception e) {
e.printStackTrace();
DEException.throwException(e.getMessage());
}
}
}
......
......@@ -990,7 +990,8 @@ export default {
click_ref_function: 'Click Quote Function',
field_manage: 'Field Manage',
edit_calc_field: 'Edit calc field',
calc_field: 'Calc Field'
calc_field: 'Calc Field',
show_sql: 'Show SQL'
},
datasource: {
datasource: 'Data Source',
......
......@@ -990,7 +990,8 @@ export default {
click_ref_function: '點擊引用函數',
field_manage: '字段管理',
edit_calc_field: '編輯計算字段',
calc_field: '計算字段'
calc_field: '計算字段',
show_sql: '顯示SQL'
},
datasource: {
datasource: '數據源',
......
......@@ -990,7 +990,8 @@ export default {
click_ref_function: '点击引用函数',
field_manage: '字段管理',
edit_calc_field: '编辑计算字段',
calc_field: '计算字段'
calc_field: '计算字段',
show_sql: '显示SQL'
},
datasource: {
datasource: '数据源',
......
......@@ -315,7 +315,6 @@
<script>
import { post, chartGroupTree } from '@/api/chart/chart'
import { authModel } from '@/api/system/sysAuth'
import TableSelector from '../view/TableSelector'
import GroupMoveSelector from '../components/TreeSelector/GroupMoveSelector'
import ChartMoveSelector from '../components/TreeSelector/ChartMoveSelector'
......@@ -563,7 +562,7 @@ export default {
// this.chartTree()
this.refreshNodeBy(view.sceneId)
// this.$router.push('/chart/home')
this.$emit('switchComponent', { name: '' })
// this.$emit('switchComponent', { name: '' })
this.$store.dispatch('chart/setTable', null)
})
} else {
......
......@@ -341,8 +341,7 @@
</template>
<script>
import { loadTable, getScene, addGroup, delGroup, addTable, delTable, post , isKettleRunning} from '@/api/dataset/dataset'
import { authModel } from '@/api/system/sysAuth'
import { loadTable, getScene, addGroup, delGroup, addTable, delTable, post, isKettleRunning} from '@/api/dataset/dataset'
import GroupMoveSelector from './GroupMoveSelector'
import DsMoveSelector from './DsMoveSelector'
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论