提交 6baf1953 authored 作者: taojinlong's avatar taojinlong

Merge branch 'v1.1' of github.com:dataease/dataease into v1.1

...@@ -37,6 +37,12 @@ ...@@ -37,6 +37,12 @@
<if test="createTime != null"> <if test="createTime != null">
and chart_group.create_time = #{createTime,jdbcType=BIGINT} and chart_group.create_time = #{createTime,jdbcType=BIGINT}
</if> </if>
<if test="ids != null and ids.size() > 0">
and id in
<foreach collection="ids" item="item" separator="," open="(" close=")">
#{item}
</foreach>
</if>
</where> </where>
<if test="sort != null"> <if test="sort != null">
order by ${sort} order by ${sort}
......
...@@ -39,6 +39,9 @@ ...@@ -39,6 +39,9 @@
<if test="sceneId != null"> <if test="sceneId != null">
and scene_id = #{sceneId,jdbcType=VARCHAR} and scene_id = #{sceneId,jdbcType=VARCHAR}
</if> </if>
<if test="name != null">
and name like CONCAT('%', #{name},'%')
</if>
</where> </where>
<if test="sort != null"> <if test="sort != null">
order by ${sort} order by ${sort}
......
...@@ -37,6 +37,12 @@ ...@@ -37,6 +37,12 @@
<if test="createTime != null"> <if test="createTime != null">
and dataset_group.create_time = #{createTime,jdbcType=BIGINT} and dataset_group.create_time = #{createTime,jdbcType=BIGINT}
</if> </if>
<if test="ids != null and ids.size() > 0">
and id in
<foreach collection="ids" item="item" separator="," open="(" close=")">
#{item}
</foreach>
</if>
</where> </where>
<if test="sort != null"> <if test="sort != null">
order by ${sort} order by ${sort}
......
...@@ -45,6 +45,9 @@ ...@@ -45,6 +45,9 @@
<if test="sceneId != null"> <if test="sceneId != null">
and scene_id = #{sceneId,jdbcType=VARCHAR} and scene_id = #{sceneId,jdbcType=VARCHAR}
</if> </if>
<if test="name != null">
and name like CONCAT('%', #{name},'%')
</if>
<if test="mode != null"> <if test="mode != null">
and mode = #{mode,jdbcType=INTEGER} and mode = #{mode,jdbcType=INTEGER}
</if> </if>
......
...@@ -4,7 +4,9 @@ import io.dataease.base.domain.ChartViewWithBLOBs; ...@@ -4,7 +4,9 @@ import io.dataease.base.domain.ChartViewWithBLOBs;
import io.dataease.commons.utils.AuthUtils; import io.dataease.commons.utils.AuthUtils;
import io.dataease.controller.request.chart.ChartExtRequest; import io.dataease.controller.request.chart.ChartExtRequest;
import io.dataease.controller.request.chart.ChartViewRequest; import io.dataease.controller.request.chart.ChartViewRequest;
import io.dataease.controller.request.dataset.DataSetTableRequest;
import io.dataease.dto.chart.ChartViewDTO; import io.dataease.dto.chart.ChartViewDTO;
import io.dataease.dto.dataset.DataSetTableDTO;
import io.dataease.service.chart.ChartViewService; import io.dataease.service.chart.ChartViewService;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -63,7 +65,7 @@ public class ChartViewController { ...@@ -63,7 +65,7 @@ public class ChartViewController {
} }
@GetMapping("searchAdviceSceneId/{panelId}") @GetMapping("searchAdviceSceneId/{panelId}")
public String searchAdviceSceneId(@PathVariable String panelId){ public String searchAdviceSceneId(@PathVariable String panelId) {
return chartViewService.searchAdviceSceneId(panelId); return chartViewService.searchAdviceSceneId(panelId);
} }
...@@ -71,10 +73,16 @@ public class ChartViewController { ...@@ -71,10 +73,16 @@ public class ChartViewController {
public ChartViewDTO getOneWithPermission(@PathVariable String id, @RequestBody ChartExtRequest requestList) throws Exception { public ChartViewDTO getOneWithPermission(@PathVariable String id, @RequestBody ChartExtRequest requestList) throws Exception {
//如果能获取用户 则添加对应的权限 //如果能获取用户 则添加对应的权限
ChartViewDTO dto = chartViewService.getData(id, requestList); ChartViewDTO dto = chartViewService.getData(id, requestList);
if(dto!=null && AuthUtils.getUser()!=null){ if (dto != null && AuthUtils.getUser() != null) {
ChartViewDTO permissionDto = chartViewService.getOneWithPermission(dto.getId()); ChartViewDTO permissionDto = chartViewService.getOneWithPermission(dto.getId());
dto.setPrivileges(permissionDto.getPrivileges()); dto.setPrivileges(permissionDto.getPrivileges());
} }
return dto; return dto;
} }
@PostMapping("search")
public List<ChartViewDTO> search(@RequestBody ChartViewRequest chartViewRequest) {
return chartViewService.search(chartViewRequest);
}
} }
...@@ -108,4 +108,9 @@ public class DataSetTableController { ...@@ -108,4 +108,9 @@ public class DataSetTableController {
public Boolean checkDorisTableIsExists(@PathVariable String id) throws Exception { public Boolean checkDorisTableIsExists(@PathVariable String id) throws Exception {
return dataSetTableService.checkDorisTableIsExists(id); return dataSetTableService.checkDorisTableIsExists(id);
} }
@PostMapping("search")
public List<DataSetTableDTO> search(@RequestBody DataSetTableRequest dataSetTableRequest) {
return dataSetTableService.search(dataSetTableRequest);
}
} }
...@@ -3,9 +3,12 @@ package io.dataease.controller.request.chart; ...@@ -3,9 +3,12 @@ package io.dataease.controller.request.chart;
import io.dataease.base.domain.ChartGroup; import io.dataease.base.domain.ChartGroup;
import lombok.Data; import lombok.Data;
import java.util.Set;
@Data @Data
public class ChartGroupRequest extends ChartGroup { public class ChartGroupRequest extends ChartGroup {
private String sort; private String sort;
private String userId; private String userId;
private Set<String> ids;
} }
...@@ -3,6 +3,9 @@ package io.dataease.controller.request.dataset; ...@@ -3,6 +3,9 @@ package io.dataease.controller.request.dataset;
import io.dataease.base.domain.DatasetGroup; import io.dataease.base.domain.DatasetGroup;
import lombok.Data; import lombok.Data;
import java.util.List;
import java.util.Set;
/** /**
* @Author gin * @Author gin
* @Date 2021/2/22 1:30 下午 * @Date 2021/2/22 1:30 下午
...@@ -12,4 +15,6 @@ public class DataSetGroupRequest extends DatasetGroup { ...@@ -12,4 +15,6 @@ public class DataSetGroupRequest extends DatasetGroup {
private String sort; private String sort;
private String userId; private String userId;
private Set<String> ids;
} }
...@@ -41,4 +41,6 @@ public class DorisConstants extends SQLConstants { ...@@ -41,4 +41,6 @@ public class DorisConstants extends SQLConstants {
public static final String BRACKETS = "(%s)"; public static final String BRACKETS = "(%s)";
public static final String ROUND = "ROUND(%s,%s)"; public static final String ROUND = "ROUND(%s,%s)";
public static final String VARCHAR = "VARCHAR";
} }
...@@ -421,6 +421,8 @@ public class DorisQueryProvider extends QueryProvider { ...@@ -421,6 +421,8 @@ public class DorisQueryProvider extends QueryProvider {
if (field.getDeType() == 1 && field.getDeExtractType() != 1) { if (field.getDeType() == 1 && field.getDeExtractType() != 1) {
String cast = String.format(DorisConstants.CAST, originName, DorisConstants.DEFAULT_INT_FORMAT) + "/1000"; String cast = String.format(DorisConstants.CAST, originName, DorisConstants.DEFAULT_INT_FORMAT) + "/1000";
whereName = String.format(DorisConstants.FROM_UNIXTIME, cast, DorisConstants.DEFAULT_DATE_FORMAT); whereName = String.format(DorisConstants.FROM_UNIXTIME, cast, DorisConstants.DEFAULT_DATE_FORMAT);
} else if (field.getDeType() == 0) {
whereName = String.format(DorisConstants.CAST, originName, DorisConstants.VARCHAR);
} else { } else {
whereName = originName; whereName = originName;
} }
...@@ -462,6 +464,8 @@ public class DorisQueryProvider extends QueryProvider { ...@@ -462,6 +464,8 @@ public class DorisQueryProvider extends QueryProvider {
if (field.getDeType() == 1 && field.getDeExtractType() != 1) { if (field.getDeType() == 1 && field.getDeExtractType() != 1) {
String cast = String.format(DorisConstants.CAST, originName, DorisConstants.DEFAULT_INT_FORMAT) + "/1000"; String cast = String.format(DorisConstants.CAST, originName, DorisConstants.DEFAULT_INT_FORMAT) + "/1000";
whereName = String.format(DorisConstants.FROM_UNIXTIME, cast, DorisConstants.DEFAULT_DATE_FORMAT); whereName = String.format(DorisConstants.FROM_UNIXTIME, cast, DorisConstants.DEFAULT_DATE_FORMAT);
} else if (field.getDeType() == 0) {
whereName = String.format(DorisConstants.CAST, originName, DorisConstants.VARCHAR);
} else { } else {
whereName = originName; whereName = originName;
} }
...@@ -534,6 +538,8 @@ public class DorisQueryProvider extends QueryProvider { ...@@ -534,6 +538,8 @@ public class DorisQueryProvider extends QueryProvider {
String from_unixtime = String.format(DorisConstants.FROM_UNIXTIME, cast, DorisConstants.DEFAULT_DATE_FORMAT); String from_unixtime = String.format(DorisConstants.FROM_UNIXTIME, cast, DorisConstants.DEFAULT_DATE_FORMAT);
fieldName = String.format(DorisConstants.DATE_FORMAT, from_unixtime, format); fieldName = String.format(DorisConstants.DATE_FORMAT, from_unixtime, format);
} }
} else if (x.getDeType() == 0) {
fieldName = String.format(DorisConstants.CAST, originField, DorisConstants.VARCHAR);
} else { } else {
fieldName = originField; fieldName = originField;
} }
......
...@@ -15,11 +15,15 @@ import io.dataease.controller.request.chart.ChartExtFilterRequest; ...@@ -15,11 +15,15 @@ import io.dataease.controller.request.chart.ChartExtFilterRequest;
import io.dataease.controller.request.chart.ChartExtRequest; import io.dataease.controller.request.chart.ChartExtRequest;
import io.dataease.controller.request.chart.ChartGroupRequest; import io.dataease.controller.request.chart.ChartGroupRequest;
import io.dataease.controller.request.chart.ChartViewRequest; import io.dataease.controller.request.chart.ChartViewRequest;
import io.dataease.controller.request.dataset.DataSetGroupRequest;
import io.dataease.controller.request.dataset.DataSetTableRequest;
import io.dataease.datasource.provider.DatasourceProvider; import io.dataease.datasource.provider.DatasourceProvider;
import io.dataease.datasource.provider.ProviderFactory; import io.dataease.datasource.provider.ProviderFactory;
import io.dataease.datasource.request.DatasourceRequest; import io.dataease.datasource.request.DatasourceRequest;
import io.dataease.datasource.service.DatasourceService; import io.dataease.datasource.service.DatasourceService;
import io.dataease.dto.chart.*; import io.dataease.dto.chart.*;
import io.dataease.dto.dataset.DataSetGroupDTO;
import io.dataease.dto.dataset.DataSetTableDTO;
import io.dataease.dto.dataset.DataSetTableUnionDTO; import io.dataease.dto.dataset.DataSetTableUnionDTO;
import io.dataease.dto.dataset.DataTableInfoDTO; import io.dataease.dto.dataset.DataTableInfoDTO;
import io.dataease.i18n.Translator; import io.dataease.i18n.Translator;
...@@ -110,6 +114,53 @@ public class ChartViewService { ...@@ -110,6 +114,53 @@ public class ChartViewService {
return group; return group;
} }
public List<ChartViewDTO> search(ChartViewRequest chartViewRequest) {
String userId = String.valueOf(AuthUtils.getUser().getUserId());
chartViewRequest.setUserId(userId);
chartViewRequest.setSort("name asc");
List<ChartViewDTO> ds = extChartViewMapper.search(chartViewRequest);
if (CollectionUtils.isEmpty(ds)) {
return ds;
}
TreeSet<String> ids = new TreeSet<>();
ds.forEach(ele -> {
ele.setIsLeaf(true);
ele.setPid(ele.getSceneId());
ids.add(ele.getPid());
});
List<ChartViewDTO> group = new ArrayList<>();
ChartGroupRequest chartGroupRequest = new ChartGroupRequest();
chartGroupRequest.setUserId(userId);
chartGroupRequest.setIds(ids);
List<ChartGroupDTO> search = extChartGroupMapper.search(chartGroupRequest);
while (CollectionUtils.isNotEmpty(search)) {
ids.clear();
search.forEach(ele -> {
ChartViewDTO dto = new ChartViewDTO();
BeanUtils.copyBean(dto, ele);
dto.setIsLeaf(false);
dto.setType("group");
group.add(dto);
ids.add(ele.getPid());
});
chartGroupRequest.setIds(ids);
search = extChartGroupMapper.search(chartGroupRequest);
}
List<ChartViewDTO> res = new ArrayList<>();
Map<String, ChartViewDTO> map = new TreeMap<>();
group.forEach(ele -> map.put(ele.getId(), ele));
Iterator<Map.Entry<String, ChartViewDTO>> iterator = map.entrySet().iterator();
while (iterator.hasNext()) {
res.add(iterator.next().getValue());
}
res.sort(Comparator.comparing(ChartViewDTO::getName));
res.addAll(ds);
return res;
}
public ChartViewWithBLOBs get(String id) { public ChartViewWithBLOBs get(String id) {
return chartViewMapper.selectByPrimaryKey(id); return chartViewMapper.selectByPrimaryKey(id);
} }
...@@ -188,7 +239,7 @@ public class ChartViewService { ...@@ -188,7 +239,7 @@ public class ChartViewService {
// 获取数据集 // 获取数据集
DatasetTable table = dataSetTableService.get(view.getTableId()); DatasetTable table = dataSetTableService.get(view.getTableId());
if (ObjectUtils.isEmpty(table)) { if (ObjectUtils.isEmpty(table)) {
throw new RuntimeException(Translator.get("i18n_dataset_delete")); throw new RuntimeException(Translator.get("i18n_dataset_delete_or_no_permission"));
} }
// 判断连接方式,直连或者定时抽取 table.mode // 判断连接方式,直连或者定时抽取 table.mode
DatasourceRequest datasourceRequest = new DatasourceRequest(); DatasourceRequest datasourceRequest = new DatasourceRequest();
......
...@@ -12,6 +12,7 @@ import io.dataease.commons.constants.JobStatus; ...@@ -12,6 +12,7 @@ import io.dataease.commons.constants.JobStatus;
import io.dataease.commons.constants.ScheduleType; import io.dataease.commons.constants.ScheduleType;
import io.dataease.commons.constants.TaskStatus; import io.dataease.commons.constants.TaskStatus;
import io.dataease.commons.utils.*; 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.DataSetGroupRequest;
import io.dataease.controller.request.dataset.DataSetTableRequest; import io.dataease.controller.request.dataset.DataSetTableRequest;
import io.dataease.controller.request.dataset.DataSetTaskRequest; import io.dataease.controller.request.dataset.DataSetTaskRequest;
...@@ -232,6 +233,53 @@ public class DataSetTableService { ...@@ -232,6 +233,53 @@ public class DataSetTableService {
return group; return group;
} }
public List<DataSetTableDTO> search(DataSetTableRequest dataSetTableRequest) {
String userId = String.valueOf(AuthUtils.getUser().getUserId());
dataSetTableRequest.setUserId(userId);
dataSetTableRequest.setSort("name asc");
List<DataSetTableDTO> ds = extDataSetTableMapper.search(dataSetTableRequest);
if (CollectionUtils.isEmpty(ds)) {
return ds;
}
TreeSet<String> ids = new TreeSet<>();
ds.forEach(ele -> {
ele.setIsLeaf(true);
ele.setPid(ele.getSceneId());
ids.add(ele.getPid());
});
List<DataSetTableDTO> group = new ArrayList<>();
DataSetGroupRequest dataSetGroupRequest = new DataSetGroupRequest();
dataSetGroupRequest.setUserId(userId);
dataSetGroupRequest.setIds(ids);
List<DataSetGroupDTO> search = extDataSetGroupMapper.search(dataSetGroupRequest);
while (CollectionUtils.isNotEmpty(search)) {
ids.clear();
search.forEach(ele -> {
DataSetTableDTO dto = new DataSetTableDTO();
BeanUtils.copyBean(dto, ele);
dto.setIsLeaf(false);
dto.setType("group");
group.add(dto);
ids.add(ele.getPid());
});
dataSetGroupRequest.setIds(ids);
search = extDataSetGroupMapper.search(dataSetGroupRequest);
}
List<DataSetTableDTO> res = new ArrayList<>();
Map<String, DataSetTableDTO> map = new TreeMap<>();
group.forEach(ele -> map.put(ele.getId(), ele));
Iterator<Map.Entry<String, DataSetTableDTO>> iterator = map.entrySet().iterator();
while (iterator.hasNext()) {
res.add(iterator.next().getValue());
}
res.sort(Comparator.comparing(DatasetTable::getName));
res.addAll(ds);
return res;
}
public DatasetTable get(String id) { public DatasetTable get(String id) {
return datasetTableMapper.selectByPrimaryKey(id); return datasetTableMapper.selectByPrimaryKey(id);
} }
...@@ -1416,7 +1464,7 @@ public class DataSetTableService { ...@@ -1416,7 +1464,7 @@ public class DataSetTableService {
public static boolean checkIsRepeat(String[] array) { public static boolean checkIsRepeat(String[] array) {
HashSet<String> hashSet = new HashSet<String>(); HashSet<String> hashSet = new HashSet<String>();
for (int i = 0; i < array.length; i++) { for (int i = 0; i < array.length; i++) {
if(StringUtils.isEmpty(array[i])){ if (StringUtils.isEmpty(array[i])) {
throw new RuntimeException(Translator.get("i18n_excel_empty_column")); throw new RuntimeException(Translator.get("i18n_excel_empty_column"));
} }
hashSet.add(array[i]); hashSet.add(array[i]);
......
...@@ -103,11 +103,12 @@ export function batchEdit(data) { ...@@ -103,11 +103,12 @@ export function batchEdit(data) {
}) })
} }
export function post(url, data, showLoading = true) { export function post(url, data, showLoading = true, timeout = 10000) {
return request({ return request({
url: url, url: url,
method: 'post', method: 'post',
loading: showLoading, loading: showLoading,
timeout: timeout,
data data
}) })
} }
......
...@@ -4,12 +4,14 @@ export function save(data) { ...@@ -4,12 +4,14 @@ export function save(data) {
return request({ return request({
url: '/template/save', url: '/template/save',
data: data, data: data,
timeout: 60000,
method: 'post' method: 'post'
}) })
} }
export function templateDelete(id) { export function templateDelete(id) {
return request({ return request({
url: '/template/delete/' + id, url: '/template/delete/' + id,
timeout: 60000,
method: 'delete' method: 'delete'
}) })
} }
...@@ -17,6 +19,7 @@ export function templateDelete(id) { ...@@ -17,6 +19,7 @@ export function templateDelete(id) {
export function showTemplateList(data) { export function showTemplateList(data) {
return request({ return request({
url: '/template/templateList', url: '/template/templateList',
timeout: 60000,
data: data, data: data,
method: 'post' method: 'post'
}) })
...@@ -25,6 +28,7 @@ export function showTemplateList(data) { ...@@ -25,6 +28,7 @@ export function showTemplateList(data) {
export function findOne(id) { export function findOne(id) {
return request({ return request({
url: '/template/findOne/' + id, url: '/template/findOne/' + id,
timeout: 60000,
method: 'get' method: 'get'
}) })
} }
...@@ -32,6 +36,7 @@ export function findOne(id) { ...@@ -32,6 +36,7 @@ export function findOne(id) {
export function find(data) { export function find(data) {
return request({ return request({
url: '/template/find', url: '/template/find',
timeout: 60000,
data: data, data: data,
method: 'post' method: 'post'
}) })
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
<br> <br>
不同图表类型下的 {a},{b},{c},{d} 含义不一样。 其中变量{a}, {b}, {c}, {d}在不同图表类型下代表数据含义为: 不同图表类型下的 {a},{b},{c},{d} 含义不一样。 其中变量{a}, {b}, {c}, {d}在不同图表类型下代表数据含义为:
<br><br> <br><br>
折线(区域)图、柱状(条形)图、仪表盘、雷达图 : {a}(系列名称),{b}(类目值),{c}(数值), {d}(无) 折线(区域)图、柱状(条形)图、仪表盘、雷达图 : {a}(系列名称),{b}(类目值),{c}(数值)
<!-- <br>--> <!-- <br>-->
<!-- 散点图(气泡)图 : {a}(系列名称),{b}(数据名称),{c}(数值数组), {d}(无)--> <!-- 散点图(气泡)图 : {a}(系列名称),{b}(数据名称),{c}(数值数组), {d}(无)-->
<!-- <br>--> <!-- <br>-->
......
...@@ -269,4 +269,8 @@ export default { ...@@ -269,4 +269,8 @@ export default {
.table-class>>>.body--wrapper{ .table-class>>>.body--wrapper{
background: rgba(1,1,1,0); background: rgba(1,1,1,0);
} }
.table-class>>>.elx-cell{
max-height: none!important;
line-height: normal!important;
}
</style> </style>
...@@ -535,7 +535,8 @@ export default { ...@@ -535,7 +535,8 @@ export default {
type: 'success', type: 'success',
showClose: true showClose: true
}) })
this.treeNode(this.groupForm) // this.treeNode(this.groupForm)
this.refreshNodeBy(group.pid)
}) })
} else { } else {
// this.$message({ // this.$message({
...@@ -588,7 +589,8 @@ export default { ...@@ -588,7 +589,8 @@ export default {
message: this.$t('chart.delete_success'), message: this.$t('chart.delete_success'),
showClose: true showClose: true
}) })
this.treeNode(this.groupForm) // this.treeNode(this.groupForm)
this.refreshNodeBy(data.pid)
}) })
}).catch(() => { }).catch(() => {
}) })
...@@ -886,14 +888,18 @@ export default { ...@@ -886,14 +888,18 @@ export default {
searchTree(val) { searchTree(val) {
const queryCondition = { const queryCondition = {
withExtend: 'parent', // withExtend: 'parent',
modelType: 'chart', // modelType: 'chart',
name: val name: val
} }
authModel(queryCondition).then(res => { // authModel(queryCondition).then(res => {
// this.highlights(res.data) // // this.highlights(res.data)
// this.tData = this.buildTree(res.data)
// // console.log(this.tData)
// })
post('/chart/view/search', queryCondition).then(res => {
this.tData = this.buildTree(res.data) this.tData = this.buildTree(res.data)
// console.log(this.tData)
}) })
}, },
...@@ -905,8 +911,8 @@ export default { ...@@ -905,8 +911,8 @@ export default {
const roots = [] const roots = []
arrs.forEach(el => { arrs.forEach(el => {
// 判断根节点 ### // 判断根节点 ###
el.type = el.modelInnerType // el.type = el.modelInnerType
el.isLeaf = el.leaf // el.isLeaf = el.leaf
if (el[this.treeProps.parentId] === null || el[this.treeProps.parentId] === 0 || el[this.treeProps.parentId] === '0') { if (el[this.treeProps.parentId] === null || el[this.treeProps.parentId] === 0 || el[this.treeProps.parentId] === '0') {
roots.push(el) roots.push(el)
return return
......
...@@ -72,7 +72,7 @@ export default { ...@@ -72,7 +72,7 @@ export default {
if (this.table.id) { if (this.table.id) {
this.dataLoading = true this.dataLoading = true
this.table.row = 100 this.table.row = 100
post('/dataset/table/getPreviewData/1/100', this.table, false).then(response => { post('/dataset/table/getPreviewData/1/100', this.table, false, 30000).then(response => {
this.fields = response.data.fields this.fields = response.data.fields
this.data = response.data.data this.data = response.data.data
const datas = this.data const datas = this.data
......
...@@ -130,7 +130,7 @@ export default { ...@@ -130,7 +130,7 @@ export default {
initPreviewData(page) { initPreviewData(page) {
if (this.table.id) { if (this.table.id) {
this.table.row = this.tableViewRowForm.row this.table.row = this.tableViewRowForm.row
post('/dataset/table/getPreviewData/' + page.page + '/' + page.pageSize, this.table).then(response => { post('/dataset/table/getPreviewData/' + page.page + '/' + page.pageSize, this.table, true, 30000).then(response => {
this.fields = response.data.fields this.fields = response.data.fields
this.data = response.data.data this.data = response.data.data
this.page = response.data.page this.page = response.data.page
......
...@@ -341,7 +341,7 @@ ...@@ -341,7 +341,7 @@
</template> </template>
<script> <script>
import { loadTable, getScene, addGroup, delGroup, addTable, delTable, post , isKettleRunning} from '@/api/dataset/dataset' import { loadTable, getScene, addGroup, delGroup, addTable, delTable, post, isKettleRunning } from '@/api/dataset/dataset'
import { authModel } from '@/api/system/sysAuth' import { authModel } from '@/api/system/sysAuth'
import GroupMoveSelector from './GroupMoveSelector' import GroupMoveSelector from './GroupMoveSelector'
import DsMoveSelector from './DsMoveSelector' import DsMoveSelector from './DsMoveSelector'
...@@ -427,9 +427,6 @@ export default { ...@@ -427,9 +427,6 @@ export default {
// return this.$store.state.dataset.sceneData // return this.$store.state.dataset.sceneData
// } // }
}, },
created() {
this.kettleState()
},
watch: { watch: {
search(val) { search(val) {
// if (val && val !== '') { // if (val && val !== '') {
...@@ -451,6 +448,9 @@ export default { ...@@ -451,6 +448,9 @@ export default {
this.refreshNodeBy(this.saveStatus.sceneId) this.refreshNodeBy(this.saveStatus.sceneId)
} }
}, },
created() {
this.kettleState()
},
mounted() { mounted() {
this.treeNode(this.groupForm) this.treeNode(this.groupForm)
this.refresh() this.refresh()
...@@ -856,14 +856,18 @@ export default { ...@@ -856,14 +856,18 @@ export default {
searchTree(val) { searchTree(val) {
const queryCondition = { const queryCondition = {
withExtend: 'parent', // withExtend: 'parent',
modelType: 'dataset', // modelType: 'dataset',
name: val name: val
} }
authModel(queryCondition).then(res => { // authModel(queryCondition).then(res => {
// this.highlights(res.data) // // this.highlights(res.data)
// this.tData = this.buildTree(res.data)
// // console.log(this.tData)
// })
post('/dataset/table/search', queryCondition).then(res => {
this.tData = this.buildTree(res.data) this.tData = this.buildTree(res.data)
// console.log(this.tData)
}) })
}, },
...@@ -875,8 +879,8 @@ export default { ...@@ -875,8 +879,8 @@ export default {
const roots = [] const roots = []
arrs.forEach(el => { arrs.forEach(el => {
// 判断根节点 ### // 判断根节点 ###
el.type = el.modelInnerType // el.type = el.modelInnerType
el.isLeaf = el.leaf // el.isLeaf = el.leaf
if (el[this.treeProps.parentId] === null || el[this.treeProps.parentId] === 0 || el[this.treeProps.parentId] === '0') { if (el[this.treeProps.parentId] === null || el[this.treeProps.parentId] === 0 || el[this.treeProps.parentId] === '0') {
roots.push(el) roots.push(el)
return return
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论