Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
njgzx
dataease
Commits
408a796e
Unverified
提交
408a796e
authored
12月 02, 2021
作者:
XiaJunjie2020
提交者:
GitHub
12月 02, 2021
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1373 from dataease/pr@dev@feat_unon_ds
feat(数据集): 关联数据集
上级
70cdd22f
acb54573
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
18 个修改的文件
包含
237 行增加
和
28 行删除
+237
-28
DorisTableUtils.java
.../main/java/io/dataease/commons/utils/DorisTableUtils.java
+4
-0
DataSetTableController.java
...o/dataease/controller/dataset/DataSetTableController.java
+9
-3
DataTableInfoDTO.java
...c/main/java/io/dataease/dto/dataset/DataTableInfoDTO.java
+3
-1
UnionDTO.java
...src/main/java/io/dataease/dto/dataset/union/UnionDTO.java
+19
-0
UnionItemDTO.java
...main/java/io/dataease/dto/dataset/union/UnionItemDTO.java
+14
-0
UnionParamDTO.java
...ain/java/io/dataease/dto/dataset/union/UnionParamDTO.java
+15
-0
ChartViewService.java
...main/java/io/dataease/service/chart/ChartViewService.java
+23
-6
DataSetTableService.java
...java/io/dataease/service/dataset/DataSetTableService.java
+0
-0
en.js
frontend/src/lang/en.js
+2
-1
tw.js
frontend/src/lang/tw.js
+2
-1
zh.js
frontend/src/lang/zh.js
+2
-1
AddUnion.vue
frontend/src/views/dataset/add/AddUnion.vue
+42
-5
UnionPreview.vue
frontend/src/views/dataset/add/union/UnionPreview.vue
+94
-0
DatasetGroupSelectorTree.vue
...end/src/views/dataset/common/DatasetGroupSelectorTree.vue
+1
-0
FieldEdit.vue
frontend/src/views/dataset/data/FieldEdit.vue
+3
-3
TabDataPreview.vue
frontend/src/views/dataset/data/TabDataPreview.vue
+1
-1
ViewTable.vue
frontend/src/views/dataset/data/ViewTable.vue
+0
-3
Group.vue
frontend/src/views/dataset/group/Group.vue
+3
-3
没有找到文件。
backend/src/main/java/io/dataease/commons/utils/DorisTableUtils.java
浏览文件 @
408a796e
...
@@ -22,6 +22,10 @@ public class DorisTableUtils {
...
@@ -22,6 +22,10 @@ public class DorisTableUtils {
return
"f_"
+
Md5Utils
.
md5
(
dorisName
);
return
"f_"
+
Md5Utils
.
md5
(
dorisName
);
}
}
public
static
String
dorisFieldNameShort
(
String
dorisName
)
{
return
"f_"
+
Md5Utils
.
md5
(
dorisName
).
substring
(
8
,
24
);
}
public
static
String
columnName
(
String
filedName
)
{
public
static
String
columnName
(
String
filedName
)
{
return
"C_"
+
Md5Utils
.
md5
(
filedName
);
return
"C_"
+
Md5Utils
.
md5
(
filedName
);
}
}
...
...
backend/src/main/java/io/dataease/controller/dataset/DataSetTableController.java
浏览文件 @
408a796e
...
@@ -133,9 +133,9 @@ public class DataSetTableController {
...
@@ -133,9 +133,9 @@ public class DataSetTableController {
@ApiOperation
(
"excel上传"
)
@ApiOperation
(
"excel上传"
)
@PostMapping
(
"excel/upload"
)
@PostMapping
(
"excel/upload"
)
@ApiImplicitParams
({
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"file"
,
value
=
"文件"
,
required
=
true
,
dataType
=
"MultipartFile"
),
@ApiImplicitParam
(
name
=
"file"
,
value
=
"文件"
,
required
=
true
,
dataType
=
"MultipartFile"
),
@ApiImplicitParam
(
name
=
"tableId"
,
value
=
"数据表ID"
,
required
=
true
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"tableId"
,
value
=
"数据表ID"
,
required
=
true
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"editType"
,
value
=
"编辑类型"
,
required
=
true
,
dataType
=
"Integer"
)
@ApiImplicitParam
(
name
=
"editType"
,
value
=
"编辑类型"
,
required
=
true
,
dataType
=
"Integer"
)
})
})
public
ExcelFileData
excelUpload
(
@RequestParam
(
"file"
)
MultipartFile
file
,
@RequestParam
(
"tableId"
)
String
tableId
,
@RequestParam
(
"editType"
)
Integer
editType
)
throws
Exception
{
public
ExcelFileData
excelUpload
(
@RequestParam
(
"file"
)
MultipartFile
file
,
@RequestParam
(
"tableId"
)
String
tableId
,
@RequestParam
(
"editType"
)
Integer
editType
)
throws
Exception
{
return
dataSetTableService
.
excelSaveAndParse
(
file
,
tableId
,
editType
);
return
dataSetTableService
.
excelSaveAndParse
(
file
,
tableId
,
editType
);
...
@@ -158,4 +158,10 @@ public class DataSetTableController {
...
@@ -158,4 +158,10 @@ public class DataSetTableController {
public
DatasetTable
syncDatasetTableField
(
@PathVariable
String
id
)
throws
Exception
{
public
DatasetTable
syncDatasetTableField
(
@PathVariable
String
id
)
throws
Exception
{
return
dataSetTableService
.
syncDatasetTableField
(
id
);
return
dataSetTableService
.
syncDatasetTableField
(
id
);
}
}
@ApiOperation
(
"关联数据集预览数据"
)
@PostMapping
(
"unionPreview"
)
public
Map
<
String
,
Object
>
unionPreview
(
@RequestBody
DataSetTableRequest
dataSetTableRequest
)
throws
Exception
{
return
dataSetTableService
.
getUnionPreview
(
dataSetTableRequest
);
}
}
}
backend/src/main/java/io/dataease/dto/dataset/DataTableInfoDTO.java
浏览文件 @
408a796e
package
io
.
dataease
.
dto
.
dataset
;
package
io
.
dataease
.
dto
.
dataset
;
import
io.dataease.dto.dataset.union.UnionDTO
;
import
lombok.Getter
;
import
lombok.Getter
;
import
lombok.Setter
;
import
lombok.Setter
;
...
@@ -16,5 +17,6 @@ public class DataTableInfoDTO {
...
@@ -16,5 +17,6 @@ public class DataTableInfoDTO {
private
String
sql
;
private
String
sql
;
private
List
<
ExcelSheetData
>
excelSheetDataList
;
private
List
<
ExcelSheetData
>
excelSheetDataList
;
private
String
data
;
// file path
private
String
data
;
// file path
private
List
<
DataTableInfoCustomUnion
>
list
;
private
List
<
DataTableInfoCustomUnion
>
list
;
// 自定义数据集
private
List
<
UnionDTO
>
union
;
// 关联数据集
}
}
backend/src/main/java/io/dataease/dto/dataset/union/UnionDTO.java
0 → 100644
浏览文件 @
408a796e
package
io
.
dataease
.
dto
.
dataset
.
union
;
import
io.dataease.base.domain.DatasetTable
;
import
lombok.Data
;
import
java.util.List
;
/**
* @Author gin
* @Date 2021/12/1 3:48 下午
*/
@Data
public
class
UnionDTO
{
private
DatasetTable
currentDs
;
private
List
<
String
>
currentDsField
;
private
List
<
UnionDTO
>
childrenDs
;
private
UnionParamDTO
unionToParent
;
private
int
allChildCount
;
}
backend/src/main/java/io/dataease/dto/dataset/union/UnionItemDTO.java
0 → 100644
浏览文件 @
408a796e
package
io
.
dataease
.
dto
.
dataset
.
union
;
import
io.dataease.base.domain.DatasetTableField
;
import
lombok.Data
;
/**
* @Author gin
* @Date 2021/12/1 3:54 下午
*/
@Data
public
class
UnionItemDTO
{
private
DatasetTableField
parentField
;
private
DatasetTableField
currentField
;
}
backend/src/main/java/io/dataease/dto/dataset/union/UnionParamDTO.java
0 → 100644
浏览文件 @
408a796e
package
io
.
dataease
.
dto
.
dataset
.
union
;
import
lombok.Data
;
import
java.util.List
;
/**
* @Author gin
* @Date 2021/12/1 3:53 下午
*/
@Data
public
class
UnionParamDTO
{
private
String
unionType
;
private
List
<
UnionItemDTO
>
unionFields
;
}
backend/src/main/java/io/dataease/service/chart/ChartViewService.java
浏览文件 @
408a796e
...
@@ -13,21 +13,21 @@ import io.dataease.commons.utils.BeanUtils;
...
@@ -13,21 +13,21 @@ import io.dataease.commons.utils.BeanUtils;
import
io.dataease.commons.utils.CommonBeanFactory
;
import
io.dataease.commons.utils.CommonBeanFactory
;
import
io.dataease.commons.utils.LogUtil
;
import
io.dataease.commons.utils.LogUtil
;
import
io.dataease.controller.request.chart.*
;
import
io.dataease.controller.request.chart.*
;
import
io.dataease.controller.request.datasource.DatasourceRequest
;
import
io.dataease.controller.response.ChartDetail
;
import
io.dataease.controller.response.ChartDetail
;
import
io.dataease.controller.response.DataSetDetail
;
import
io.dataease.controller.response.DataSetDetail
;
import
io.dataease.provider.datasource.DatasourceProvider
;
import
io.dataease.provider.ProviderFactory
;
import
io.dataease.controller.request.datasource.DatasourceRequest
;
import
io.dataease.service.datasource.DatasourceService
;
import
io.dataease.dto.chart.*
;
import
io.dataease.dto.chart.*
;
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
;
import
io.dataease.listener.util.CacheUtils
;
import
io.dataease.listener.util.CacheUtils
;
import
io.dataease.provider.ProviderFactory
;
import
io.dataease.provider.datasource.DatasourceProvider
;
import
io.dataease.provider.query.QueryProvider
;
import
io.dataease.provider.query.QueryProvider
;
import
io.dataease.service.dataset.DataSetTableFieldsService
;
import
io.dataease.service.dataset.DataSetTableFieldsService
;
import
io.dataease.service.dataset.DataSetTableService
;
import
io.dataease.service.dataset.DataSetTableService
;
import
io.dataease.service.dataset.DataSetTableUnionService
;
import
io.dataease.service.dataset.DataSetTableUnionService
;
import
io.dataease.service.datasource.DatasourceService
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
...
@@ -162,9 +162,10 @@ public class ChartViewService {
...
@@ -162,9 +162,10 @@ public class ChartViewService {
}
}
public
ChartViewDTO
getOneWithPermission
(
String
id
)
{
public
ChartViewDTO
getOneWithPermission
(
String
id
)
{
String
userId
=
AuthUtils
.
getUser
()
!=
null
?
String
.
valueOf
(
AuthUtils
.
getUser
().
getUserId
()):
"NONE"
;
String
userId
=
AuthUtils
.
getUser
()
!=
null
?
String
.
valueOf
(
AuthUtils
.
getUser
().
getUserId
())
:
"NONE"
;
return
extChartViewMapper
.
searchOneWithPrivileges
(
userId
,
id
);
return
extChartViewMapper
.
searchOneWithPrivileges
(
userId
,
id
);
}
}
public
void
delete
(
String
id
)
{
public
void
delete
(
String
id
)
{
chartViewMapper
.
deleteByPrimaryKey
(
id
);
chartViewMapper
.
deleteByPrimaryKey
(
id
);
}
}
...
@@ -365,6 +366,22 @@ public class ChartViewService {
...
@@ -365,6 +366,22 @@ public class ChartViewService {
DataTableInfoDTO
dt
=
new
Gson
().
fromJson
(
table
.
getInfo
(),
DataTableInfoDTO
.
class
);
DataTableInfoDTO
dt
=
new
Gson
().
fromJson
(
table
.
getInfo
(),
DataTableInfoDTO
.
class
);
List
<
DataSetTableUnionDTO
>
list
=
dataSetTableUnionService
.
listByTableId
(
dt
.
getList
().
get
(
0
).
getTableId
());
List
<
DataSetTableUnionDTO
>
list
=
dataSetTableUnionService
.
listByTableId
(
dt
.
getList
().
get
(
0
).
getTableId
());
String
sql
=
dataSetTableService
.
getCustomSQLDatasource
(
dt
,
list
,
ds
);
String
sql
=
dataSetTableService
.
getCustomSQLDatasource
(
dt
,
list
,
ds
);
if
(
StringUtils
.
equalsIgnoreCase
(
"text"
,
view
.
getType
())
||
StringUtils
.
equalsIgnoreCase
(
"gauge"
,
view
.
getType
())
||
StringUtils
.
equalsIgnoreCase
(
"liquid"
,
view
.
getType
()))
{
datasourceRequest
.
setQuery
(
qp
.
getSQLSummaryAsTmp
(
sql
,
yAxis
,
customFilter
,
extFilterList
,
view
));
}
else
if
(
StringUtils
.
containsIgnoreCase
(
view
.
getType
(),
"stack"
))
{
datasourceRequest
.
setQuery
(
qp
.
getSQLAsTmpStack
(
sql
,
xAxis
,
yAxis
,
customFilter
,
extFilterList
,
extStack
,
view
));
}
else
if
(
StringUtils
.
containsIgnoreCase
(
view
.
getType
(),
"scatter"
))
{
datasourceRequest
.
setQuery
(
qp
.
getSQLAsTmpScatter
(
sql
,
xAxis
,
yAxis
,
customFilter
,
extFilterList
,
extBubble
,
view
));
}
else
if
(
StringUtils
.
equalsIgnoreCase
(
"table-info"
,
view
.
getType
()))
{
datasourceRequest
.
setQuery
(
qp
.
getSQLAsTmpTableInfo
(
sql
,
xAxis
,
customFilter
,
extFilterList
,
ds
,
view
));
}
else
{
datasourceRequest
.
setQuery
(
qp
.
getSQLAsTmp
(
sql
,
xAxis
,
yAxis
,
customFilter
,
extFilterList
,
view
));
}
}
else
if
(
StringUtils
.
equalsIgnoreCase
(
table
.
getType
(),
"union"
))
{
DataTableInfoDTO
dt
=
new
Gson
().
fromJson
(
table
.
getInfo
(),
DataTableInfoDTO
.
class
);
Map
<
String
,
Object
>
sqlMap
=
dataSetTableService
.
getUnionSQLDatasource
(
dt
,
ds
);
String
sql
=
(
String
)
sqlMap
.
get
(
"sql"
);
if
(
StringUtils
.
equalsIgnoreCase
(
"text"
,
view
.
getType
())
||
StringUtils
.
equalsIgnoreCase
(
"gauge"
,
view
.
getType
())
||
StringUtils
.
equalsIgnoreCase
(
"liquid"
,
view
.
getType
()))
{
if
(
StringUtils
.
equalsIgnoreCase
(
"text"
,
view
.
getType
())
||
StringUtils
.
equalsIgnoreCase
(
"gauge"
,
view
.
getType
())
||
StringUtils
.
equalsIgnoreCase
(
"liquid"
,
view
.
getType
()))
{
datasourceRequest
.
setQuery
(
qp
.
getSQLSummaryAsTmp
(
sql
,
yAxis
,
customFilter
,
extFilterList
,
view
));
datasourceRequest
.
setQuery
(
qp
.
getSQLSummaryAsTmp
(
sql
,
yAxis
,
customFilter
,
extFilterList
,
view
));
}
else
if
(
StringUtils
.
containsIgnoreCase
(
view
.
getType
(),
"stack"
))
{
}
else
if
(
StringUtils
.
containsIgnoreCase
(
view
.
getType
(),
"stack"
))
{
...
...
backend/src/main/java/io/dataease/service/dataset/DataSetTableService.java
浏览文件 @
408a796e
差异被折叠。
点击展开。
frontend/src/lang/en.js
浏览文件 @
408a796e
...
@@ -1163,7 +1163,8 @@ export default {
...
@@ -1163,7 +1163,8 @@ export default {
field_select
:
'Select Field'
,
field_select
:
'Select Field'
,
add_union_field
:
'Add Union Field'
,
add_union_field
:
'Add Union Field'
,
union_error
:
'Union relation and field can not be empty'
,
union_error
:
'Union relation and field can not be empty'
,
union_repeat
:
'This dataset is already union,do not union repeat'
union_repeat
:
'This dataset is already union,do not union repeat'
,
preview_result
:
'Preview'
},
},
datasource
:
{
datasource
:
{
datasource
:
'Data Source'
,
datasource
:
'Data Source'
,
...
...
frontend/src/lang/tw.js
浏览文件 @
408a796e
...
@@ -1164,7 +1164,8 @@ export default {
...
@@ -1164,7 +1164,8 @@ export default {
field_select
:
'字段選擇'
,
field_select
:
'字段選擇'
,
add_union_field
:
'添加關聯字段'
,
add_union_field
:
'添加關聯字段'
,
union_error
:
'關聯關系與關聯字段不能為空'
,
union_error
:
'關聯關系與關聯字段不能為空'
,
union_repeat
:
'當前數據集已被關聯,請勿重復關聯'
union_repeat
:
'當前數據集已被關聯,請勿重復關聯'
,
preview_result
:
'預覽結果'
},
},
datasource
:
{
datasource
:
{
datasource
:
'數據源'
,
datasource
:
'數據源'
,
...
...
frontend/src/lang/zh.js
浏览文件 @
408a796e
...
@@ -1166,7 +1166,8 @@ export default {
...
@@ -1166,7 +1166,8 @@ export default {
field_select
:
'字段选择'
,
field_select
:
'字段选择'
,
add_union_field
:
'添加关联字段'
,
add_union_field
:
'添加关联字段'
,
union_error
:
'关联关系与关联字段不能为空'
,
union_error
:
'关联关系与关联字段不能为空'
,
union_repeat
:
'当前数据集已被关联,请勿重复关联'
union_repeat
:
'当前数据集已被关联,请勿重复关联'
,
preview_result
:
'预览结果'
},
},
datasource
:
{
datasource
:
{
datasource
:
'数据源'
,
datasource
:
'数据源'
,
...
...
frontend/src/views/dataset/add/AddUnion.vue
浏览文件 @
408a796e
...
@@ -15,10 +15,15 @@
...
@@ -15,10 +15,15 @@
</el-row>
</el-row>
<el-divider
/>
<el-divider
/>
<div>
<div>
<el-form
:inline=
"true"
>
<el-form
:inline=
"true"
style=
"display: flex;align-items: center;justify-content: space-between;"
>
<el-form-item
class=
"form-item"
>
<el-form-item
class=
"form-item"
>
<el-input
v-model=
"name"
size=
"mini"
:placeholder=
"$t('commons.name')"
clearable
/>
<el-input
v-model=
"name"
size=
"mini"
:placeholder=
"$t('commons.name')"
clearable
/>
</el-form-item>
</el-form-item>
<el-form-item
class=
"form-item"
>
<el-button
size=
"mini"
@
click=
"previewData"
>
{{
$t
(
'dataset.preview_result'
)
}}
</el-button>
</el-form-item>
</el-form>
</el-form>
<!--添加第一个数据集按钮-->
<!--添加第一个数据集按钮-->
<div
v-if=
"dataset.length === 0"
>
<div
v-if=
"dataset.length === 0"
>
...
@@ -70,6 +75,11 @@
...
@@ -70,6 +75,11 @@
<el-button
type=
"primary"
size=
"mini"
@
click=
"confirmEditUnion()"
>
{{
$t
(
'dataset.confirm'
)
}}
</el-button>
<el-button
type=
"primary"
size=
"mini"
@
click=
"confirmEditUnion()"
>
{{
$t
(
'dataset.confirm'
)
}}
</el-button>
</div>
</div>
</el-dialog>
</el-dialog>
<!--数据预览界面-->
<el-drawer
v-if=
"showPreview"
:title=
"$t('dataset.preview_result')"
:visible
.
sync=
"showPreview"
direction=
"btt"
class=
"preview-style"
>
<union-preview
:table=
"previewTable"
:dataset=
"dataset"
/>
</el-drawer>
</el-row>
</el-row>
</
template
>
</
template
>
...
@@ -79,9 +89,10 @@ import NodeItem from '@/views/dataset/add/union/NodeItem'
...
@@ -79,9 +89,10 @@ import NodeItem from '@/views/dataset/add/union/NodeItem'
import
DatasetGroupSelectorTree
from
'@/views/dataset/common/DatasetGroupSelectorTree'
import
DatasetGroupSelectorTree
from
'@/views/dataset/common/DatasetGroupSelectorTree'
import
UnionEdit
from
'@/views/dataset/add/union/UnionEdit'
import
UnionEdit
from
'@/views/dataset/add/union/UnionEdit'
import
{
getTable
,
post
}
from
'@/api/dataset/dataset'
import
{
getTable
,
post
}
from
'@/api/dataset/dataset'
import
UnionPreview
from
'@/views/dataset/add/union/UnionPreview'
export
default
{
export
default
{
name
:
'AddUnion'
,
name
:
'AddUnion'
,
components
:
{
UnionEdit
,
DatasetGroupSelectorTree
,
NodeItem
,
UnionNode
},
components
:
{
Union
Preview
,
Union
Edit
,
DatasetGroupSelectorTree
,
NodeItem
,
UnionNode
},
props
:
{
props
:
{
param
:
{
param
:
{
type
:
Object
,
type
:
Object
,
...
@@ -133,7 +144,9 @@ export default {
...
@@ -133,7 +144,9 @@ export default {
// 弹框临时选中的数据集
// 弹框临时选中的数据集
tempDs
:
{},
tempDs
:
{},
editUnion
:
false
,
editUnion
:
false
,
unionParam
:
{}
unionParam
:
{},
showPreview
:
false
,
previewTable
:
{}
}
}
},
},
watch
:
{
watch
:
{
...
@@ -169,7 +182,7 @@ export default {
...
@@ -169,7 +182,7 @@ export default {
dataSourceId
:
this
.
dataset
[
0
].
currentDs
.
dataSourceId
,
dataSourceId
:
this
.
dataset
[
0
].
currentDs
.
dataSourceId
,
type
:
'union'
,
type
:
'union'
,
mode
:
this
.
dataset
[
0
].
currentDs
.
mode
,
mode
:
this
.
dataset
[
0
].
currentDs
.
mode
,
info
:
'{"
list
":'
+
JSON
.
stringify
(
this
.
dataset
)
+
'}'
info
:
'{"
union
":'
+
JSON
.
stringify
(
this
.
dataset
)
+
'}'
}
}
post
(
'/dataset/table/update'
,
table
).
then
(
response
=>
{
post
(
'/dataset/table/update'
,
table
).
then
(
response
=>
{
this
.
$emit
(
'saveSuccess'
,
table
)
this
.
$emit
(
'saveSuccess'
,
table
)
...
@@ -270,9 +283,22 @@ export default {
...
@@ -270,9 +283,22 @@ export default {
getTable
(
this
.
param
.
tableId
).
then
(
response
=>
{
getTable
(
this
.
param
.
tableId
).
then
(
response
=>
{
const
table
=
JSON
.
parse
(
JSON
.
stringify
(
response
.
data
))
const
table
=
JSON
.
parse
(
JSON
.
stringify
(
response
.
data
))
this
.
name
=
table
.
name
this
.
name
=
table
.
name
this
.
dataset
=
JSON
.
parse
(
table
.
info
).
list
this
.
dataset
=
JSON
.
parse
(
table
.
info
).
union
})
})
}
}
},
previewData
()
{
this
.
previewTable
=
{
id
:
this
.
param
.
tableId
,
name
:
this
.
name
,
sceneId
:
this
.
param
.
id
,
dataSourceId
:
this
.
dataset
[
0
].
currentDs
.
dataSourceId
,
type
:
'union'
,
mode
:
this
.
dataset
[
0
].
currentDs
.
mode
,
info
:
'{"union":'
+
JSON
.
stringify
(
this
.
dataset
)
+
'}'
}
this
.
showPreview
=
true
}
}
}
}
}
}
...
@@ -294,4 +320,15 @@ export default {
...
@@ -294,4 +320,15 @@ export default {
.dialog-css
>>>
.el-dialog__body
{
.dialog-css
>>>
.el-dialog__body
{
padding
:
0
20px
;
padding
:
0
20px
;
}
}
.preview-style
>>>
.el-drawer
{
height
:
50%
!important
;
}
.preview-style
>>>
.el-drawer
.el-drawer__header
{
margin-bottom
:
10px
!important
;
padding
:
10px
16px
0
!important
;
font-size
:
14px
;
}
.preview-style
>>>
.el-drawer
.el-drawer__body
{
padding
:
0
16px
10px
!important
;
}
</
style
>
</
style
>
frontend/src/views/dataset/add/union/UnionPreview.vue
0 → 100644
浏览文件 @
408a796e
<
template
>
<div>
<div
class=
"text item"
>
<ux-grid
ref=
"plxTable"
size=
"mini"
style=
"width: 100%;"
:height=
"height"
:checkbox-config=
"
{highlight: true}"
:width-resize="true"
>
<ux-table-column
v-for=
"field in fields"
:key=
"field.fieldName"
min-width=
"200px"
:field=
"field.fieldName"
:title=
"field.remarks"
:resizable=
"true"
/>
</ux-grid>
</div>
<span
class=
"table-count"
>
{{
$t
(
'dataset.preview_show'
)
}}
<span
class=
"span-number"
>
1000
</span>
{{
$t
(
'dataset.preview_item'
)
}}
</span>
</div>
</
template
>
<
script
>
import
{
post
}
from
'@/api/dataset/dataset'
export
default
{
name
:
'UnionPreview'
,
props
:
{
table
:
{
type
:
Object
,
required
:
true
},
dataset
:
{
type
:
Array
,
required
:
true
}
},
data
()
{
return
{
height
:
'auto'
,
fields
:
[],
data
:
[]
}
},
watch
:
{
'table'
:
function
()
{
this
.
initPreview
()
}
},
mounted
()
{
this
.
initHeight
()
this
.
initPreview
()
},
methods
:
{
initHeight
()
{
this
.
height
=
(
document
.
getElementsByClassName
(
'el-drawer__body'
)[
0
].
clientHeight
-
40
)
+
'px'
},
initPreview
()
{
if
(
this
.
dataset
&&
this
.
dataset
.
length
>
0
)
{
post
(
'/dataset/table/unionPreview'
,
this
.
table
).
then
(
response
=>
{
this
.
fields
=
response
.
data
.
fields
this
.
data
=
response
.
data
.
data
const
datas
=
this
.
data
this
.
$refs
.
plxTable
.
reloadData
(
datas
)
})
}
else
{
this
.
fields
=
[]
this
.
data
=
[]
const
datas
=
this
.
data
this
.
$refs
.
plxTable
.
reloadData
(
datas
)
}
}
}
}
</
script
>
<
style
scoped
>
.span-number
{
color
:
#0a7be0
;
}
.table-count
{
color
:
#606266
;
}
span
{
font-size
:
12px
;
}
</
style
>
frontend/src/views/dataset/common/DatasetGroupSelectorTree.vue
浏览文件 @
408a796e
...
@@ -61,6 +61,7 @@
...
@@ -61,6 +61,7 @@
<svg-icon
v-if=
"data.modelInnerType === 'sql'"
icon-class=
"ds-sql"
class=
"ds-icon-sql"
/>
<svg-icon
v-if=
"data.modelInnerType === 'sql'"
icon-class=
"ds-sql"
class=
"ds-icon-sql"
/>
<svg-icon
v-if=
"data.modelInnerType === 'excel'"
icon-class=
"ds-excel"
class=
"ds-icon-excel"
/>
<svg-icon
v-if=
"data.modelInnerType === 'excel'"
icon-class=
"ds-excel"
class=
"ds-icon-excel"
/>
<svg-icon
v-if=
"data.modelInnerType === 'custom'"
icon-class=
"ds-custom"
class=
"ds-icon-custom"
/>
<svg-icon
v-if=
"data.modelInnerType === 'custom'"
icon-class=
"ds-custom"
class=
"ds-icon-custom"
/>
<svg-icon
v-if=
"data.modelInnerType === 'union'"
icon-class=
"ds-union"
class=
"ds-icon-union"
/>
</span>
</span>
<span
v-if=
"data.modelInnerType === 'db' || data.modelInnerType === 'sql'"
>
<span
v-if=
"data.modelInnerType === 'db' || data.modelInnerType === 'sql'"
>
<span
v-if=
"data.mode === 0"
style=
"margin-left: 6px"
><i
class=
"el-icon-s-operation"
/></span>
<span
v-if=
"data.mode === 0"
style=
"margin-left: 6px"
><i
class=
"el-icon-s-operation"
/></span>
...
...
frontend/src/views/dataset/data/FieldEdit.vue
浏览文件 @
408a796e
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
<el-form
:inline=
"true"
>
<el-form
:inline=
"true"
>
<el-form-item
class=
"form-item"
>
<el-form-item
class=
"form-item"
>
<el-button
v-if=
"hasDataPermission('manage',param.privileges)"
size=
"mini"
icon=
"el-icon-circle-plus-outline"
@
click=
"addCalcField"
>
{{
$t
(
'dataset.add_calc_field'
)
}}
</el-button>
<el-button
v-if=
"hasDataPermission('manage',param.privileges)"
size=
"mini"
icon=
"el-icon-circle-plus-outline"
@
click=
"addCalcField"
>
{{
$t
(
'dataset.add_calc_field'
)
}}
</el-button>
<el-button
v-if=
"hasDataPermission('manage',param.privileges) && table.type !== 'excel' && table.type !== 'custom'"
size=
"mini"
:loading=
"isSyncField"
icon=
"el-icon-refresh-left"
@
click=
"syncField"
>
{{
$t
(
'dataset.sync_field'
)
}}
</el-button>
<el-button
v-if=
"hasDataPermission('manage',param.privileges) && table.type !== 'excel' && table.type !== 'custom'
&& table.type !== 'union'
"
size=
"mini"
:loading=
"isSyncField"
icon=
"el-icon-refresh-left"
@
click=
"syncField"
>
{{
$t
(
'dataset.sync_field'
)
}}
</el-button>
</el-form-item>
</el-form-item>
<el-form-item
class=
"form-item"
style=
"float: right;margin-right: 0;"
>
<el-form-item
class=
"form-item"
style=
"float: right;margin-right: 0;"
>
<el-input
<el-input
...
@@ -43,7 +43,7 @@
...
@@ -43,7 +43,7 @@
<el-input
v-model=
"scope.row.name"
size=
"mini"
:disabled=
"!hasDataPermission('manage',param.privileges)"
@
blur=
"saveEdit(scope.row)"
@
keyup
.
enter
.
native=
"saveEdit(scope.row)"
/>
<el-input
v-model=
"scope.row.name"
size=
"mini"
:disabled=
"!hasDataPermission('manage',param.privileges)"
@
blur=
"saveEdit(scope.row)"
@
keyup
.
enter
.
native=
"saveEdit(scope.row)"
/>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
v-if=
"!(
param.mode === 0 && param.type === 'custom'
)"
property=
"originName"
:label=
"$t('dataset.field_origin_name')"
width=
"100"
>
<el-table-column
v-if=
"!(
table.mode === 0 && (table.type === 'custom' || table.type === 'union')
)"
property=
"originName"
:label=
"$t('dataset.field_origin_name')"
width=
"100"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<span
v-if=
"scope.row.extField === 0"
:title=
"scope.row.originName"
class=
"field-class"
style=
"width: 100%;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;"
>
<span
v-if=
"scope.row.extField === 0"
:title=
"scope.row.originName"
class=
"field-class"
style=
"width: 100%;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;"
>
<span
style=
"font-size: 12px;"
>
{{
scope
.
row
.
originName
}}
</span>
<span
style=
"font-size: 12px;"
>
{{
scope
.
row
.
originName
}}
</span>
...
@@ -149,7 +149,7 @@
...
@@ -149,7 +149,7 @@
<el-input
v-model=
"scope.row.name"
size=
"mini"
:disabled=
"!hasDataPermission('manage',param.privileges)"
@
blur=
"saveEdit(scope.row)"
@
keyup
.
enter
.
native=
"saveEdit(scope.row)"
/>
<el-input
v-model=
"scope.row.name"
size=
"mini"
:disabled=
"!hasDataPermission('manage',param.privileges)"
@
blur=
"saveEdit(scope.row)"
@
keyup
.
enter
.
native=
"saveEdit(scope.row)"
/>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
v-if=
"!(
param.mode === 0 && param.type === 'custom'
)"
property=
"originName"
:label=
"$t('dataset.field_origin_name')"
width=
"100"
>
<el-table-column
v-if=
"!(
table.mode === 0 && (table.type === 'custom' || table.type === 'union')
)"
property=
"originName"
:label=
"$t('dataset.field_origin_name')"
width=
"100"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<span
v-if=
"scope.row.extField === 0"
:title=
"scope.row.originName"
class=
"field-class"
style=
"width: 100%;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;"
>
<span
v-if=
"scope.row.extField === 0"
:title=
"scope.row.originName"
class=
"field-class"
style=
"width: 100%;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;"
>
<span
style=
"font-size: 12px;"
>
{{
scope
.
row
.
originName
}}
</span>
<span
style=
"font-size: 12px;"
>
{{
scope
.
row
.
originName
}}
</span>
...
...
frontend/src/views/dataset/data/TabDataPreview.vue
浏览文件 @
408a796e
...
@@ -37,7 +37,7 @@
...
@@ -37,7 +37,7 @@
</ux-table-column>
</ux-table-column>
</ux-grid>
</ux-grid>
<el-row
style=
"margin-top: 4px;"
>
<el-row
style=
"margin-top: 4px;"
>
<span
v-if=
"table.type === 'excel' || table.type === 'custom'"
class=
"table-count"
>
<span
v-if=
"table.type === 'excel' || table.type === 'custom'
|| table.type === 'union'
"
class=
"table-count"
>
<span
v-if=
"page.total <= currentPage.show"
>
<span
v-if=
"page.total <= currentPage.show"
>
{{ $t('dataset.preview_total') }}
{{ $t('dataset.preview_total') }}
<span
class=
"span-number"
>
{{ page.total }}
</span>
<span
class=
"span-number"
>
{{ page.total }}
</span>
...
...
frontend/src/views/dataset/data/ViewTable.vue
浏览文件 @
408a796e
...
@@ -56,9 +56,6 @@
...
@@ -56,9 +56,6 @@
<el-tab-pane
:label=
"$t('dataset.field_manage')"
name=
"fieldEdit"
>
<el-tab-pane
:label=
"$t('dataset.field_manage')"
name=
"fieldEdit"
>
<field-edit
:param=
"param"
:table=
"table"
/>
<field-edit
:param=
"param"
:table=
"table"
/>
</el-tab-pane>
</el-tab-pane>
<el-tab-pane
v-if=
"table.type !== 'custom' && !(table.type === 'sql' && table.mode === 0)"
:label=
"$t('dataset.join_view')"
name=
"joinView"
>
<union-view
:param=
"param"
:table=
"table"
/>
</el-tab-pane>
<el-tab-pane
v-if=
"table.mode === 1 && (table.type === 'excel' || table.type === 'db' || table.type === 'sql')"
:label=
"$t('dataset.update_info')"
name=
"updateInfo"
>
<el-tab-pane
v-if=
"table.mode === 1 && (table.type === 'excel' || table.type === 'db' || table.type === 'sql')"
:label=
"$t('dataset.update_info')"
name=
"updateInfo"
>
<update-info
v-if=
"tabActive=='updateInfo'"
:param=
"param"
:table=
"table"
/>
<update-info
v-if=
"tabActive=='updateInfo'"
:param=
"param"
:table=
"table"
/>
</el-tab-pane>
</el-tab-pane>
...
...
frontend/src/views/dataset/group/Group.vue
浏览文件 @
408a796e
...
@@ -89,9 +89,9 @@
...
@@ -89,9 +89,9 @@
<svg-icon
icon-class=
"ds-excel"
class=
"ds-icon-excel"
/>
<svg-icon
icon-class=
"ds-excel"
class=
"ds-icon-excel"
/>
{{
$t
(
'dataset.excel_data'
)
}}
{{
$t
(
'dataset.excel_data'
)
}}
</el-dropdown-item>
</el-dropdown-item>
<el-dropdown-item
:command=
"beforeClickAddData('
custom
',data)"
>
<el-dropdown-item
:command=
"beforeClickAddData('
union
',data)"
>
<svg-icon
icon-class=
"ds-
custom"
class=
"ds-icon-custom
"
/>
<svg-icon
icon-class=
"ds-
union"
class=
"ds-icon-union
"
/>
{{
$t
(
'dataset.
custom
_data'
)
}}
{{
$t
(
'dataset.
union
_data'
)
}}
</el-dropdown-item>
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown-menu>
</el-dropdown>
</el-dropdown>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论