Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
njgzx
dataease
Commits
4a865366
提交
4a865366
authored
11月 02, 2021
作者:
taojinlong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: 更新数据源,左侧树状结构保持不变
上级
bbe2c961
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
51 行增加
和
15 行删除
+51
-15
ExcelXlsReader.java
...c/main/java/io/dataease/commons/utils/ExcelXlsReader.java
+4
-1
DatasourceController.java
.../dataease/controller/datasource/DatasourceController.java
+8
-1
DatasourceService.java
...ava/io/dataease/service/datasource/DatasourceService.java
+1
-1
datasource.js
frontend/src/api/system/datasource.js
+7
-0
DsMain.vue
frontend/src/views/system/datasource/DsMain.vue
+6
-4
DsTree.vue
frontend/src/views/system/datasource/DsTree.vue
+21
-3
form.vue
frontend/src/views/system/datasource/form.vue
+4
-5
没有找到文件。
backend/src/main/java/io/dataease/commons/utils/ExcelXlsReader.java
浏览文件 @
4a865366
...
...
@@ -331,7 +331,10 @@ public class ExcelXlsReader implements HSSFListener {
totalSheets
.
add
(
excelSheetData
);
}
else
{
List
<
String
>
tmp
=
new
ArrayList
<>(
cellList
);
totalSheets
.
stream
().
filter
(
s
->
s
.
getExcelLable
().
equalsIgnoreCase
(
sheetName
)).
collect
(
Collectors
.
toList
()).
get
(
0
).
getData
().
add
(
tmp
);
if
(
totalSheets
.
stream
().
filter
(
s
->
s
.
getExcelLable
().
equalsIgnoreCase
(
sheetName
)).
collect
(
Collectors
.
toList
()).
get
(
0
).
getData
().
size
()
<
100
){
totalSheets
.
stream
().
filter
(
s
->
s
.
getExcelLable
().
equalsIgnoreCase
(
sheetName
)).
collect
(
Collectors
.
toList
()).
get
(
0
).
getData
().
add
(
tmp
);
}
totalRows
++;
}
}
...
...
backend/src/main/java/io/dataease/controller/datasource/DatasourceController.java
浏览文件 @
4a865366
...
...
@@ -20,6 +20,7 @@ import springfox.documentation.annotations.ApiIgnore;
import
javax.annotation.Resource
;
import
java.util.List
;
import
java.util.stream.Collectors
;
@Api
(
tags
=
"数据源:数据源管理"
)
@ApiSupport
(
order
=
30
)
...
...
@@ -32,7 +33,7 @@ public class DatasourceController {
@ApiOperation
(
"新增数据源"
)
@PostMapping
(
"/add"
)
public
Datasource
addDatasource
(
@RequestBody
Datasource
datasource
)
{
public
Datasource
addDatasource
(
@RequestBody
Datasource
datasource
)
throws
Exception
{
return
datasourceService
.
addDatasource
(
datasource
);
}
...
...
@@ -57,6 +58,12 @@ public class DatasourceController {
return
datasourceService
.
getDatasourceList
(
request
);
}
@ApiOperation
(
"查询当前用户数据源"
)
@GetMapping
(
"/list/{type}"
)
public
List
<
DatasourceDTO
>
getDatasourceListByType
(
@PathVariable
String
type
)
throws
Exception
{
return
getDatasourceList
().
stream
().
filter
(
datasourceDTO
->
datasourceDTO
.
getType
().
equalsIgnoreCase
(
type
)).
collect
(
Collectors
.
toList
());
}
@ApiIgnore
@PostMapping
(
"/list/{goPage}/{pageSize}"
)
public
Pager
<
List
<
DatasourceDTO
>>
getDatasourceList
(
@RequestBody
BaseGridRequest
request
,
@PathVariable
int
goPage
,
@PathVariable
int
pageSize
)
throws
Exception
{
...
...
backend/src/main/java/io/dataease/service/datasource/DatasourceService.java
浏览文件 @
4a865366
...
...
@@ -57,7 +57,7 @@ public class DatasourceService {
@Resource
private
CommonThreadPool
commonThreadPool
;
public
Datasource
addDatasource
(
Datasource
datasource
)
{
public
Datasource
addDatasource
(
Datasource
datasource
)
throws
Exception
{
checkName
(
datasource
);
long
currentTimeMillis
=
System
.
currentTimeMillis
();
datasource
.
setId
(
UUID
.
randomUUID
().
toString
());
...
...
frontend/src/api/system/datasource.js
浏览文件 @
4a865366
...
...
@@ -15,6 +15,13 @@ export function listDatasource() {
method
:
'get'
})
}
export
function
listDatasourceByType
(
type
)
{
return
request
({
url
:
'/datasource/list/'
+
type
,
loading
:
true
,
method
:
'get'
})
}
export
function
addDs
(
data
)
{
return
request
({
url
:
'datasource/add/'
,
...
...
frontend/src/views/system/datasource/DsMain.vue
浏览文件 @
4a865366
<
template
>
<de-container
v-loading=
"$store.getters.loadingMap[$store.getters.currentPath]"
>
<de-aside-container
style=
"padding: 0 0;"
>
<ds-tree
ref=
"dsTree"
@
switch-main=
"switchMain"
/>
<ds-tree
ref=
"dsTree"
:datasource=
"datasource"
@
switch-main=
"switchMain"
/>
</de-aside-container>
<de-main-container>
<component
:is=
"component"
v-if=
"!!component"
:params=
"param"
@
refresh-left-tree=
"refreshTre
e"
@
switch-component=
"switchMain"
/>
<component
:is=
"component"
v-if=
"!!component"
:params=
"param"
@
refresh-type=
"refreshTyp
e"
@
switch-component=
"switchMain"
/>
</de-main-container>
</de-container>
</
template
>
...
...
@@ -22,6 +22,7 @@ export default {
data
()
{
return
{
component
:
DataHome
,
datasource
:
{},
param
:
null
}
},
...
...
@@ -53,8 +54,9 @@ export default {
}
})
},
refreshTree
()
{
this
.
$refs
.
dsTree
&&
this
.
$refs
.
dsTree
.
queryTreeDatas
()
refreshType
(
datasource
)
{
this
.
datasource
=
datasource
;
this
.
$refs
.
dsTree
&&
this
.
$refs
.
dsTree
.
refreshType
(
datasource
)
},
msg2Current
(
sourceParam
)
{
this
.
$refs
.
dsTree
&&
this
.
$refs
.
dsTree
.
markInvalid
(
sourceParam
)
...
...
frontend/src/views/system/datasource/DsTree.vue
浏览文件 @
4a865366
...
...
@@ -87,10 +87,16 @@
</el-col>
</
template
>
<
script
>
import
{
listDatasource
,
delDs
}
from
'@/api/system/datasource'
import
{
listDatasource
,
listDatasourceByType
,
delDs
}
from
'@/api/system/datasource'
export
default
{
name
:
'DsTree'
,
props
:
{
datasource
:
{
type
:
Object
,
default
:
null
}
},
data
()
{
return
{
expandedArray
:
[],
...
...
@@ -106,7 +112,6 @@ export default {
},
mounted
()
{
this
.
queryTreeDatas
()
// console.log('permis:' + JSON.stringify(this.$store.getters.permissions))
},
methods
:
{
filterNode
(
value
,
data
)
{
...
...
@@ -124,6 +129,19 @@ export default {
listDatasource
().
then
(
res
=>
{
this
.
tData
=
this
.
buildTree
(
res
.
data
)
})
},
refreshType
(
datasource
)
{
let
typeData
=
[]
listDatasourceByType
(
datasource
.
type
).
then
(
res
=>
{
typeData
=
this
.
buildTree
(
res
.
data
)
for
(
let
index
=
0
;
index
<
this
.
tData
.
length
;
index
++
)
{
if
(
typeData
[
0
].
id
===
this
.
tData
[
index
].
id
){
this
.
tData
[
index
].
children
=
typeData
[
0
].
children
}
}
})
},
buildTree
(
array
)
{
const
types
=
{}
...
...
@@ -212,7 +230,7 @@ export default {
}).
then
(()
=>
{
delDs
(
datasource
.
id
).
then
(
res
=>
{
this
.
$success
(
this
.
$t
(
'commons.delete_success'
))
this
.
queryTreeDatas
(
)
this
.
refreshType
(
datasource
)
})
}).
catch
(()
=>
{
this
.
$message
({
...
...
frontend/src/views/system/datasource/form.vue
浏览文件 @
4a865366
...
...
@@ -235,14 +235,14 @@ export default {
$confirm
(
this
.
$t
(
'datasource.edit_datasource_msg'
),
()
=>
{
method
(
form
).
then
(
res
=>
{
this
.
$success
(
this
.
$t
(
'commons.save_success'
))
this
.
refreshT
ree
(
)
this
.
refreshT
ype
(
form
)
this
.
backToList
()
})
})
}
else
{
method
(
form
).
then
(
res
=>
{
this
.
$success
(
this
.
$t
(
'commons.save_success'
))
this
.
refreshT
ree
(
)
this
.
refreshT
ype
(
form
)
this
.
backToList
()
})
}
...
...
@@ -315,10 +315,9 @@ export default {
},
backToList
()
{
this
.
$emit
(
'switch-component'
,
{
})
// this.$router.push({ name: 'datasource' })
},
refreshT
ree
(
)
{
this
.
$emit
(
'refresh-
left-tree'
)
refreshT
ype
(
form
)
{
this
.
$emit
(
'refresh-
type'
,
form
)
}
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论