Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
zhu
dataease
Commits
75e9537a
提交
75e9537a
authored
2月 22, 2021
作者:
junjie
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: 数据集 分组 场景
上级
2b909be5
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
17 个修改的文件
包含
248 行增加
和
286 行删除
+248
-286
DatasetGroup.java
...d/src/main/java/io/dataease/base/domain/DatasetGroup.java
+2
-0
DatasetGroupExample.java
...ain/java/io/dataease/base/domain/DatasetGroupExample.java
+70
-0
DatasetScene.java
...d/src/main/java/io/dataease/base/domain/DatasetScene.java
+0
-20
DatasetSceneExample.java
...ain/java/io/dataease/base/domain/DatasetSceneExample.java
+0
-0
DatasetGroupMapper.xml
.../main/java/io/dataease/base/mapper/DatasetGroupMapper.xml
+20
-5
DatasetSceneMapper.java
...main/java/io/dataease/base/mapper/DatasetSceneMapper.java
+0
-31
DatasetSceneMapper.xml
.../main/java/io/dataease/base/mapper/DatasetSceneMapper.xml
+0
-212
DataSetGroupController.java
...o/dataease/controller/dataset/DataSetGroupController.java
+13
-4
DataSetGroupRequest.java
...aease/controller/request/dataset/DataSetGroupRequest.java
+13
-0
DataSetGroupDTO.java
...rc/main/java/io/dataease/dto/dataset/DataSetGroupDTO.java
+3
-0
DataSetGroupService.java
...java/io/dataease/service/dataset/DataSetGroupService.java
+79
-0
V2__metersphere_ddl.sql
...d/src/main/resources/db/migration/V2__metersphere_ddl.sql
+1
-9
DataSet.vue
frontend/src/business/components/dataset/DataSet.vue
+2
-2
Group.vue
frontend/src/business/components/dataset/group/Group.vue
+0
-0
en-US.js
frontend/src/i18n/en-US.js
+15
-1
zh-CN.js
frontend/src/i18n/zh-CN.js
+15
-1
zh-TW.js
frontend/src/i18n/zh-TW.js
+15
-1
没有找到文件。
backend/src/main/java/io/dataease/base/domain/DatasetGroup.java
浏览文件 @
75e9537a
...
...
@@ -13,6 +13,8 @@ public class DatasetGroup implements Serializable {
private
Integer
level
;
private
String
type
;
private
String
createBy
;
private
Long
createTime
;
...
...
backend/src/main/java/io/dataease/base/domain/DatasetGroupExample.java
浏览文件 @
75e9537a
...
...
@@ -374,6 +374,76 @@ public class DatasetGroupExample {
return
(
Criteria
)
this
;
}
public
Criteria
andTypeIsNull
()
{
addCriterion
(
"`type` is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTypeIsNotNull
()
{
addCriterion
(
"`type` is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTypeEqualTo
(
String
value
)
{
addCriterion
(
"`type` ="
,
value
,
"type"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTypeNotEqualTo
(
String
value
)
{
addCriterion
(
"`type` <>"
,
value
,
"type"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTypeGreaterThan
(
String
value
)
{
addCriterion
(
"`type` >"
,
value
,
"type"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTypeGreaterThanOrEqualTo
(
String
value
)
{
addCriterion
(
"`type` >="
,
value
,
"type"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTypeLessThan
(
String
value
)
{
addCriterion
(
"`type` <"
,
value
,
"type"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTypeLessThanOrEqualTo
(
String
value
)
{
addCriterion
(
"`type` <="
,
value
,
"type"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTypeLike
(
String
value
)
{
addCriterion
(
"`type` like"
,
value
,
"type"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTypeNotLike
(
String
value
)
{
addCriterion
(
"`type` not like"
,
value
,
"type"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTypeIn
(
List
<
String
>
values
)
{
addCriterion
(
"`type` in"
,
values
,
"type"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTypeNotIn
(
List
<
String
>
values
)
{
addCriterion
(
"`type` not in"
,
values
,
"type"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTypeBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"`type` between"
,
value1
,
value2
,
"type"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTypeNotBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"`type` not between"
,
value1
,
value2
,
"type"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateByIsNull
()
{
addCriterion
(
"create_by is null"
);
return
(
Criteria
)
this
;
...
...
backend/src/main/java/io/dataease/base/domain/DatasetScene.java
deleted
100644 → 0
浏览文件 @
2b909be5
package
io
.
dataease
.
base
.
domain
;
import
java.io.Serializable
;
import
lombok.Data
;
@Data
public
class
DatasetScene
implements
Serializable
{
private
String
id
;
private
String
name
;
private
String
groupId
;
private
String
createBy
;
private
Long
createTime
;
private
static
final
long
serialVersionUID
=
1L
;
}
\ No newline at end of file
backend/src/main/java/io/dataease/base/domain/DatasetSceneExample.java
deleted
100644 → 0
浏览文件 @
2b909be5
差异被折叠。
点击展开。
backend/src/main/java/io/dataease/base/mapper/DatasetGroupMapper.xml
浏览文件 @
75e9537a
...
...
@@ -6,6 +6,7 @@
<result
column=
"name"
jdbcType=
"VARCHAR"
property=
"name"
/>
<result
column=
"pid"
jdbcType=
"VARCHAR"
property=
"pid"
/>
<result
column=
"level"
jdbcType=
"INTEGER"
property=
"level"
/>
<result
column=
"type"
jdbcType=
"VARCHAR"
property=
"type"
/>
<result
column=
"create_by"
jdbcType=
"VARCHAR"
property=
"createBy"
/>
<result
column=
"create_time"
jdbcType=
"BIGINT"
property=
"createTime"
/>
</resultMap>
...
...
@@ -68,7 +69,7 @@
</where>
</sql>
<sql
id=
"Base_Column_List"
>
id, `name`, pid, `level`, create_by, create_time
id, `name`, pid, `level`,
`type`,
create_by, create_time
</sql>
<select
id=
"selectByExample"
parameterType=
"io.dataease.base.domain.DatasetGroupExample"
resultMap=
"BaseResultMap"
>
select
...
...
@@ -102,11 +103,11 @@
</delete>
<insert
id=
"insert"
parameterType=
"io.dataease.base.domain.DatasetGroup"
>
insert into dataset_group (id, `name`, pid,
`level`,
create_by, create_time
)
`level`,
`type`, create_by,
create_time
)
values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR},
#{level,jdbcType=INTEGER}, #{
createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}
)
#{level,jdbcType=INTEGER}, #{
type,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR},
#{createTime,jdbcType=BIGINT}
)
</insert>
<insert
id=
"insertSelective"
parameterType=
"io.dataease.base.domain.DatasetGroup"
>
insert into dataset_group
...
...
@@ -123,6 +124,9 @@
<if
test=
"level != null"
>
`level`,
</if>
<if
test=
"type != null"
>
`type`,
</if>
<if
test=
"createBy != null"
>
create_by,
</if>
...
...
@@ -143,6 +147,9 @@
<if
test=
"level != null"
>
#{level,jdbcType=INTEGER},
</if>
<if
test=
"type != null"
>
#{type,jdbcType=VARCHAR},
</if>
<if
test=
"createBy != null"
>
#{createBy,jdbcType=VARCHAR},
</if>
...
...
@@ -172,6 +179,9 @@
<if
test=
"record.level != null"
>
`level` = #{record.level,jdbcType=INTEGER},
</if>
<if
test=
"record.type != null"
>
`type` = #{record.type,jdbcType=VARCHAR},
</if>
<if
test=
"record.createBy != null"
>
create_by = #{record.createBy,jdbcType=VARCHAR},
</if>
...
...
@@ -189,6 +199,7 @@
`name` = #{record.name,jdbcType=VARCHAR},
pid = #{record.pid,jdbcType=VARCHAR},
`level` = #{record.level,jdbcType=INTEGER},
`type` = #{record.type,jdbcType=VARCHAR},
create_by = #{record.createBy,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT}
<if
test=
"_parameter != null"
>
...
...
@@ -207,6 +218,9 @@
<if
test=
"level != null"
>
`level` = #{level,jdbcType=INTEGER},
</if>
<if
test=
"type != null"
>
`type` = #{type,jdbcType=VARCHAR},
</if>
<if
test=
"createBy != null"
>
create_by = #{createBy,jdbcType=VARCHAR},
</if>
...
...
@@ -221,6 +235,7 @@
set `name` = #{name,jdbcType=VARCHAR},
pid = #{pid,jdbcType=VARCHAR},
`level` = #{level,jdbcType=INTEGER},
`type` = #{type,jdbcType=VARCHAR},
create_by = #{createBy,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT}
where id = #{id,jdbcType=VARCHAR}
...
...
backend/src/main/java/io/dataease/base/mapper/DatasetSceneMapper.java
deleted
100644 → 0
浏览文件 @
2b909be5
package
io
.
dataease
.
base
.
mapper
;
import
io.dataease.base.domain.DatasetScene
;
import
io.dataease.base.domain.DatasetSceneExample
;
import
java.util.List
;
import
org.apache.ibatis.annotations.Param
;
public
interface
DatasetSceneMapper
{
long
countByExample
(
DatasetSceneExample
example
);
int
deleteByExample
(
DatasetSceneExample
example
);
int
deleteByPrimaryKey
(
String
id
);
int
insert
(
DatasetScene
record
);
int
insertSelective
(
DatasetScene
record
);
List
<
DatasetScene
>
selectByExample
(
DatasetSceneExample
example
);
DatasetScene
selectByPrimaryKey
(
String
id
);
int
updateByExampleSelective
(
@Param
(
"record"
)
DatasetScene
record
,
@Param
(
"example"
)
DatasetSceneExample
example
);
int
updateByExample
(
@Param
(
"record"
)
DatasetScene
record
,
@Param
(
"example"
)
DatasetSceneExample
example
);
int
updateByPrimaryKeySelective
(
DatasetScene
record
);
int
updateByPrimaryKey
(
DatasetScene
record
);
}
\ No newline at end of file
backend/src/main/java/io/dataease/base/mapper/DatasetSceneMapper.xml
deleted
100644 → 0
浏览文件 @
2b909be5
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"io.dataease.base.mapper.DatasetSceneMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"io.dataease.base.domain.DatasetScene"
>
<id
column=
"id"
jdbcType=
"VARCHAR"
property=
"id"
/>
<result
column=
"name"
jdbcType=
"VARCHAR"
property=
"name"
/>
<result
column=
"group_id"
jdbcType=
"VARCHAR"
property=
"groupId"
/>
<result
column=
"create_by"
jdbcType=
"VARCHAR"
property=
"createBy"
/>
<result
column=
"create_time"
jdbcType=
"BIGINT"
property=
"createTime"
/>
</resultMap>
<sql
id=
"Example_Where_Clause"
>
<where>
<foreach
collection=
"oredCriteria"
item=
"criteria"
separator=
"or"
>
<if
test=
"criteria.valid"
>
<trim
prefix=
"("
prefixOverrides=
"and"
suffix=
")"
>
<foreach
collection=
"criteria.criteria"
item=
"criterion"
>
<choose>
<when
test=
"criterion.noValue"
>
and ${criterion.condition}
</when>
<when
test=
"criterion.singleValue"
>
and ${criterion.condition} #{criterion.value}
</when>
<when
test=
"criterion.betweenValue"
>
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when
test=
"criterion.listValue"
>
and ${criterion.condition}
<foreach
close=
")"
collection=
"criterion.value"
item=
"listItem"
open=
"("
separator=
","
>
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql
id=
"Update_By_Example_Where_Clause"
>
<where>
<foreach
collection=
"example.oredCriteria"
item=
"criteria"
separator=
"or"
>
<if
test=
"criteria.valid"
>
<trim
prefix=
"("
prefixOverrides=
"and"
suffix=
")"
>
<foreach
collection=
"criteria.criteria"
item=
"criterion"
>
<choose>
<when
test=
"criterion.noValue"
>
and ${criterion.condition}
</when>
<when
test=
"criterion.singleValue"
>
and ${criterion.condition} #{criterion.value}
</when>
<when
test=
"criterion.betweenValue"
>
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when
test=
"criterion.listValue"
>
and ${criterion.condition}
<foreach
close=
")"
collection=
"criterion.value"
item=
"listItem"
open=
"("
separator=
","
>
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql
id=
"Base_Column_List"
>
id, `name`, group_id, create_by, create_time
</sql>
<select
id=
"selectByExample"
parameterType=
"io.dataease.base.domain.DatasetSceneExample"
resultMap=
"BaseResultMap"
>
select
<if
test=
"distinct"
>
distinct
</if>
<include
refid=
"Base_Column_List"
/>
from dataset_scene
<if
test=
"_parameter != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
<if
test=
"orderByClause != null"
>
order by ${orderByClause}
</if>
</select>
<select
id=
"selectByPrimaryKey"
parameterType=
"java.lang.String"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from dataset_scene
where id = #{id,jdbcType=VARCHAR}
</select>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.String"
>
delete from dataset_scene
where id = #{id,jdbcType=VARCHAR}
</delete>
<delete
id=
"deleteByExample"
parameterType=
"io.dataease.base.domain.DatasetSceneExample"
>
delete from dataset_scene
<if
test=
"_parameter != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
</delete>
<insert
id=
"insert"
parameterType=
"io.dataease.base.domain.DatasetScene"
>
insert into dataset_scene (id, `name`, group_id,
create_by, create_time)
values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{groupId,jdbcType=VARCHAR},
#{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT})
</insert>
<insert
id=
"insertSelective"
parameterType=
"io.dataease.base.domain.DatasetScene"
>
insert into dataset_scene
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
id,
</if>
<if
test=
"name != null"
>
`name`,
</if>
<if
test=
"groupId != null"
>
group_id,
</if>
<if
test=
"createBy != null"
>
create_by,
</if>
<if
test=
"createTime != null"
>
create_time,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
#{id,jdbcType=VARCHAR},
</if>
<if
test=
"name != null"
>
#{name,jdbcType=VARCHAR},
</if>
<if
test=
"groupId != null"
>
#{groupId,jdbcType=VARCHAR},
</if>
<if
test=
"createBy != null"
>
#{createBy,jdbcType=VARCHAR},
</if>
<if
test=
"createTime != null"
>
#{createTime,jdbcType=BIGINT},
</if>
</trim>
</insert>
<select
id=
"countByExample"
parameterType=
"io.dataease.base.domain.DatasetSceneExample"
resultType=
"java.lang.Long"
>
select count(*) from dataset_scene
<if
test=
"_parameter != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
</select>
<update
id=
"updateByExampleSelective"
parameterType=
"map"
>
update dataset_scene
<set>
<if
test=
"record.id != null"
>
id = #{record.id,jdbcType=VARCHAR},
</if>
<if
test=
"record.name != null"
>
`name` = #{record.name,jdbcType=VARCHAR},
</if>
<if
test=
"record.groupId != null"
>
group_id = #{record.groupId,jdbcType=VARCHAR},
</if>
<if
test=
"record.createBy != null"
>
create_by = #{record.createBy,jdbcType=VARCHAR},
</if>
<if
test=
"record.createTime != null"
>
create_time = #{record.createTime,jdbcType=BIGINT},
</if>
</set>
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
</if>
</update>
<update
id=
"updateByExample"
parameterType=
"map"
>
update dataset_scene
set id = #{record.id,jdbcType=VARCHAR},
`name` = #{record.name,jdbcType=VARCHAR},
group_id = #{record.groupId,jdbcType=VARCHAR},
create_by = #{record.createBy,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT}
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
</if>
</update>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"io.dataease.base.domain.DatasetScene"
>
update dataset_scene
<set>
<if
test=
"name != null"
>
`name` = #{name,jdbcType=VARCHAR},
</if>
<if
test=
"groupId != null"
>
group_id = #{groupId,jdbcType=VARCHAR},
</if>
<if
test=
"createBy != null"
>
create_by = #{createBy,jdbcType=VARCHAR},
</if>
<if
test=
"createTime != null"
>
create_time = #{createTime,jdbcType=BIGINT},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
<update
id=
"updateByPrimaryKey"
parameterType=
"io.dataease.base.domain.DatasetScene"
>
update dataset_scene
set `name` = #{name,jdbcType=VARCHAR},
group_id = #{groupId,jdbcType=VARCHAR},
create_by = #{createBy,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT}
where id = #{id,jdbcType=VARCHAR}
</update>
</mapper>
\ No newline at end of file
backend/src/main/java/io/dataease/controller/dataset/DataSetGroupController.java
浏览文件 @
75e9537a
package
io
.
dataease
.
controller
.
dataset
;
import
io.dataease.base.domain.DatasetGroup
;
import
io.dataease.controller.request.dataset.DataSetGroupRequest
;
import
io.dataease.dto.dataset.DataSetGroupDTO
;
import
io.dataease.service.dataset.DataSetGroupService
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.*
;
import
javax.annotation.Resource
;
import
java.util.List
;
/**
* @Author gin
...
...
@@ -24,4 +23,14 @@ public class DataSetGroupController {
public
DataSetGroupDTO
save
(
@RequestBody
DatasetGroup
datasetGroup
)
{
return
dataSetGroupService
.
save
(
datasetGroup
);
}
@PostMapping
(
"/tree"
)
public
List
<
DataSetGroupDTO
>
tree
(
@RequestBody
DataSetGroupRequest
datasetGroup
)
{
return
dataSetGroupService
.
tree
(
datasetGroup
);
}
@PostMapping
(
"/delete/{id}"
)
public
void
tree
(
@PathVariable
String
id
)
{
dataSetGroupService
.
delete
(
id
);
}
}
backend/src/main/java/io/dataease/controller/request/dataset/DataSetGroupRequest.java
0 → 100644
浏览文件 @
75e9537a
package
io
.
dataease
.
controller
.
request
.
dataset
;
import
io.dataease.base.domain.DatasetGroup
;
import
lombok.Data
;
/**
* @Author gin
* @Date 2021/2/22 1:30 下午
*/
@Data
public
class
DataSetGroupRequest
extends
DatasetGroup
{
private
String
sort
;
}
backend/src/main/java/io/dataease/dto/dataset/DataSetGroupDTO.java
浏览文件 @
75e9537a
...
...
@@ -3,6 +3,8 @@ package io.dataease.dto.dataset;
import
io.dataease.base.domain.DatasetGroup
;
import
lombok.Data
;
import
java.util.List
;
/**
* @Author gin
* @Date 2021/2/20 8:17 下午
...
...
@@ -10,4 +12,5 @@ import lombok.Data;
@Data
public
class
DataSetGroupDTO
extends
DatasetGroup
{
private
String
label
;
private
List
<
DataSetGroupDTO
>
children
;
}
backend/src/main/java/io/dataease/service/dataset/DataSetGroupService.java
浏览文件 @
75e9537a
...
...
@@ -2,13 +2,19 @@ package io.dataease.service.dataset;
import
com.alibaba.nacos.common.util.UuidUtils
;
import
io.dataease.base.domain.DatasetGroup
;
import
io.dataease.base.domain.DatasetGroupExample
;
import
io.dataease.base.mapper.DatasetGroupMapper
;
import
io.dataease.commons.utils.BeanUtils
;
import
io.dataease.controller.request.dataset.DataSetGroupRequest
;
import
io.dataease.dto.dataset.DataSetGroupDTO
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
* @Author gin
...
...
@@ -32,4 +38,77 @@ public class DataSetGroupService {
dataSetGroupDTO
.
setLabel
(
dataSetGroupDTO
.
getName
());
return
dataSetGroupDTO
;
}
public
void
delete
(
String
id
)
{
DataSetGroupRequest
datasetGroup
=
new
DataSetGroupRequest
();
datasetGroup
.
setId
(
id
);
List
<
DataSetGroupDTO
>
tree
=
tree
(
datasetGroup
);
List
<
String
>
ids
=
new
ArrayList
<>();
getAllId
(
tree
,
ids
);
DatasetGroupExample
datasetGroupExample
=
new
DatasetGroupExample
();
datasetGroupExample
.
createCriteria
().
andIdIn
(
ids
);
datasetGroupMapper
.
deleteByExample
(
datasetGroupExample
);
}
public
List
<
DataSetGroupDTO
>
tree
(
DataSetGroupRequest
datasetGroup
)
{
DatasetGroupExample
datasetGroupExample
=
new
DatasetGroupExample
();
DatasetGroupExample
.
Criteria
criteria
=
datasetGroupExample
.
createCriteria
();
if
(
StringUtils
.
isNotEmpty
(
datasetGroup
.
getName
()))
{
criteria
.
andNameLike
(
"%"
+
datasetGroup
.
getName
()
+
"%"
);
}
if
(
StringUtils
.
isNotEmpty
(
datasetGroup
.
getType
()))
{
criteria
.
andTypeEqualTo
(
datasetGroup
.
getType
());
}
if
(
StringUtils
.
isNotEmpty
(
datasetGroup
.
getId
()))
{
criteria
.
andIdEqualTo
(
datasetGroup
.
getId
());
}
else
{
criteria
.
andLevelEqualTo
(
0
);
}
datasetGroupExample
.
setOrderByClause
(
datasetGroup
.
getSort
());
List
<
DatasetGroup
>
datasetGroups
=
datasetGroupMapper
.
selectByExample
(
datasetGroupExample
);
List
<
DataSetGroupDTO
>
DTOs
=
datasetGroups
.
stream
().
map
(
ele
->
{
DataSetGroupDTO
dto
=
new
DataSetGroupDTO
();
BeanUtils
.
copyBean
(
dto
,
ele
);
dto
.
setLabel
(
ele
.
getName
());
return
dto
;
}).
collect
(
Collectors
.
toList
());
getAll
(
DTOs
,
datasetGroup
);
return
DTOs
;
}
public
void
getAll
(
List
<
DataSetGroupDTO
>
list
,
DataSetGroupRequest
datasetGroup
)
{
for
(
DataSetGroupDTO
obj
:
list
)
{
DatasetGroupExample
datasetGroupExample
=
new
DatasetGroupExample
();
DatasetGroupExample
.
Criteria
criteria
=
datasetGroupExample
.
createCriteria
();
if
(
StringUtils
.
isNotEmpty
(
datasetGroup
.
getName
()))
{
criteria
.
andNameLike
(
"%"
+
datasetGroup
.
getName
()
+
"%"
);
}
if
(
StringUtils
.
isNotEmpty
(
datasetGroup
.
getType
()))
{
criteria
.
andTypeEqualTo
(
datasetGroup
.
getType
());
}
criteria
.
andPidEqualTo
(
obj
.
getId
());
datasetGroupExample
.
setOrderByClause
(
datasetGroup
.
getSort
());
List
<
DatasetGroup
>
datasetGroups
=
datasetGroupMapper
.
selectByExample
(
datasetGroupExample
);
List
<
DataSetGroupDTO
>
DTOs
=
datasetGroups
.
stream
().
map
(
ele
->
{
DataSetGroupDTO
dto
=
new
DataSetGroupDTO
();
BeanUtils
.
copyBean
(
dto
,
ele
);
dto
.
setLabel
(
ele
.
getName
());
return
dto
;
}).
collect
(
Collectors
.
toList
());
obj
.
setChildren
(
DTOs
);
if
(
CollectionUtils
.
isNotEmpty
(
DTOs
))
{
getAll
(
DTOs
,
datasetGroup
);
}
}
}
public
List
<
String
>
getAllId
(
List
<
DataSetGroupDTO
>
list
,
List
<
String
>
ids
)
{
for
(
DataSetGroupDTO
dto
:
list
)
{
ids
.
add
(
dto
.
getId
());
if
(
CollectionUtils
.
isNotEmpty
(
dto
.
getChildren
()))
{
getAllId
(
dto
.
getChildren
(),
ids
);
}
}
return
ids
;
}
}
backend/src/main/resources/db/migration/V2__metersphere_ddl.sql
浏览文件 @
75e9537a
...
...
@@ -340,19 +340,11 @@ CREATE TABLE IF NOT EXISTS `dataset_group` (
`name`
varchar
(
64
)
NOT
NULL
COMMENT
'名称'
,
`pid`
varchar
(
50
)
COMMENT
'父级ID'
,
`level`
int
(
10
)
COMMENT
'当前分组处于第几级'
,
`type`
varchar
(
50
)
COMMENT
'group or scene'
,
`create_by`
varchar
(
50
)
COMMENT
'创建人ID'
,
`create_time`
bigint
(
13
)
COMMENT
'创建时间'
,
PRIMARY
KEY
(
`id`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
;
CREATE
TABLE
IF
NOT
EXISTS
`dataset_scene`
(
`id`
varchar
(
50
)
NOT
NULL
COMMENT
'ID'
,
`name`
varchar
(
64
)
NOT
NULL
COMMENT
'名称'
,
`group_id`
varchar
(
50
)
COMMENT
'DataSet Group ID'
,
`create_by`
varchar
(
50
)
COMMENT
'创建人ID'
,
`create_time`
bigint
(
13
)
COMMENT
'创建时间'
,
PRIMARY
KEY
(
`id`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
;
-- dataset end
frontend/src/business/components/dataset/DataSet.vue
浏览文件 @
75e9537a
...
...
@@ -34,8 +34,8 @@
.ms-aside-container
{
height
:
calc
(
100vh
-
40px
);
padding
:
20px
;
min-width
:
26
0px
;
max-width
:
46
0px
;
min-width
:
30
0px
;
max-width
:
50
0px
;
}
.ms-main-container
{
...
...
frontend/src/business/components/dataset/group/Group.vue
浏览文件 @
75e9537a
差异被折叠。
点击展开。
frontend/src/i18n/en-US.js
浏览文件 @
75e9537a
...
...
@@ -1523,6 +1523,20 @@ export default {
datalist
:
'Data List'
,
add_group
:
'Add Group'
,
add_scene
:
'Add Scene'
,
group
:
'DataSet Group'
group
:
'Group'
,
scene
:
'Scene'
,
delete
:
'Delete'
,
move_to
:
'Move'
,
rename
:
'Rename'
,
tips
:
'Tips'
,
confirm_delete
:
'Confirm Delete'
,
delete_success
:
'Delete Success'
,
confirm
:
'Confirm'
,
cancel
:
'Cancel'
,
search
:
'Search'
,
back
:
'Back'
,
add_table
:
'Add Table'
,
process
:
'Process'
,
update
:
'Update'
}
};
frontend/src/i18n/zh-CN.js
浏览文件 @
75e9537a
...
...
@@ -1526,6 +1526,20 @@ export default {
datalist
:
'数据列表'
,
add_group
:
'添加分组'
,
add_scene
:
'添加场景'
,
group
:
'分组'
group
:
'分组'
,
scene
:
'场景'
,
delete
:
'删除'
,
move_to
:
'移动到'
,
rename
:
'重命名'
,
tips
:
'提示'
,
confirm_delete
:
'确认删除'
,
delete_success
:
'删除成功'
,
confirm
:
'确认'
,
cancel
:
'取消'
,
search
:
'搜索'
,
back
:
'返回'
,
add_table
:
'添加表'
,
process
:
'进度'
,
update
:
'更新'
}
};
frontend/src/i18n/zh-TW.js
浏览文件 @
75e9537a
...
...
@@ -1524,6 +1524,20 @@ export default {
datalist
:
'數據列表'
,
add_group
:
'添加分組'
,
add_scene
:
'添加場景'
,
group
:
'分組'
group
:
'分組'
,
scene
:
'場景'
,
delete
:
'刪除'
,
move_to
:
'移動到'
,
rename
:
'重命名'
,
tips
:
'提示'
,
confirm_delete
:
'確認刪除'
,
delete_success
:
'刪除成功'
,
confirm
:
'確認'
,
cancel
:
'取消'
,
search
:
'搜索'
,
back
:
'返回'
,
add_table
:
'添加表'
,
process
:
'進度'
,
update
:
'更新'
}
};
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论