Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
njgzx
dataease
Commits
b3352c07
提交
b3352c07
authored
12月 22, 2021
作者:
junjie
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: 数据集入口适配
上级
0eca3858
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
92 行增加
和
20 行删除
+92
-20
SystemParameterController.java
...io/dataease/controller/sys/SystemParameterController.java
+19
-11
DatasetCheckListener.java
.../main/java/io/dataease/listener/DatasetCheckListener.java
+39
-0
dataset.js
frontend/src/api/dataset/dataset.js
+9
-1
getters.js
frontend/src/store/getters.js
+1
-0
dataset.js
frontend/src/store/modules/dataset.js
+8
-1
ViewTable.vue
frontend/src/views/dataset/data/ViewTable.vue
+5
-6
Group.vue
frontend/src/views/dataset/group/Group.vue
+4
-1
index.vue
frontend/src/views/dataset/index.vue
+7
-0
没有找到文件。
backend/src/main/java/io/dataease/controller/sys/SystemParameterController.java
浏览文件 @
b3352c07
...
@@ -5,6 +5,8 @@ import io.dataease.commons.constants.ParamConstants;
...
@@ -5,6 +5,8 @@ import io.dataease.commons.constants.ParamConstants;
import
io.dataease.controller.sys.response.BasicInfo
;
import
io.dataease.controller.sys.response.BasicInfo
;
import
io.dataease.controller.sys.response.MailInfo
;
import
io.dataease.controller.sys.response.MailInfo
;
import
io.dataease.dto.SystemParameterDTO
;
import
io.dataease.dto.SystemParameterDTO
;
import
io.dataease.listener.DatasetCheckListener
;
import
io.dataease.listener.util.CacheUtils
;
import
io.dataease.service.FileService
;
import
io.dataease.service.FileService
;
import
io.dataease.service.system.EmailService
;
import
io.dataease.service.system.EmailService
;
import
io.dataease.service.system.SystemParameterService
;
import
io.dataease.service.system.SystemParameterService
;
...
@@ -16,6 +18,7 @@ import org.springframework.http.ResponseEntity;
...
@@ -16,6 +18,7 @@ import org.springframework.http.ResponseEntity;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.multipart.MultipartFile
;
import
springfox.documentation.annotations.ApiIgnore
;
import
springfox.documentation.annotations.ApiIgnore
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.util.HashMap
;
import
java.util.HashMap
;
...
@@ -45,7 +48,7 @@ public class SystemParameterController {
...
@@ -45,7 +48,7 @@ public class SystemParameterController {
public
BasicInfo
basicInfo
()
{
public
BasicInfo
basicInfo
()
{
return
systemParameterService
.
basicInfo
();
return
systemParameterService
.
basicInfo
();
}
}
@GetMapping
(
"/requestTimeOut"
)
@GetMapping
(
"/requestTimeOut"
)
public
Integer
RequestTimeOut
()
{
public
Integer
RequestTimeOut
()
{
BasicInfo
basicInfo
=
systemParameterService
.
basicInfo
();
BasicInfo
basicInfo
=
systemParameterService
.
basicInfo
();
...
@@ -73,19 +76,17 @@ public class SystemParameterController {
...
@@ -73,19 +76,17 @@ public class SystemParameterController {
}
}
@GetMapping
(
"/base/info"
)
@GetMapping
(
"/base/info"
)
public
List
<
SystemParameterDTO
>
getBaseInfo
()
{
public
List
<
SystemParameterDTO
>
getBaseInfo
()
{
return
systemParameterService
.
getSystemParameterInfo
(
ParamConstants
.
Classify
.
BASE
.
getValue
());
return
systemParameterService
.
getSystemParameterInfo
(
ParamConstants
.
Classify
.
BASE
.
getValue
());
}
}
@GetMapping
(
"/ui/info"
)
@GetMapping
(
"/ui/info"
)
public
List
<
SystemParameterDTO
>
getDisplayInfo
()
{
public
List
<
SystemParameterDTO
>
getDisplayInfo
()
{
return
systemParameterService
.
getSystemParameterInfo
(
ParamConstants
.
Classify
.
UI
.
getValue
());
return
systemParameterService
.
getSystemParameterInfo
(
ParamConstants
.
Classify
.
UI
.
getValue
());
}
}
@GetMapping
(
value
=
"/ui/image/{imageId}"
,
produces
=
{
MediaType
.
IMAGE_JPEG_VALUE
,
MediaType
.
IMAGE_PNG_VALUE
})
@GetMapping
(
value
=
"/ui/image/{imageId}"
,
produces
=
{
MediaType
.
IMAGE_JPEG_VALUE
,
MediaType
.
IMAGE_PNG_VALUE
})
public
ResponseEntity
<
byte
[]>
image
(
@PathVariable
(
"imageId"
)
String
imageId
)
{
public
ResponseEntity
<
byte
[]>
image
(
@PathVariable
(
"imageId"
)
String
imageId
)
{
byte
[]
bytes
=
fileService
.
loadFileAsBytes
(
imageId
);
byte
[]
bytes
=
fileService
.
loadFileAsBytes
(
imageId
);
final
HttpHeaders
headers
=
new
HttpHeaders
();
final
HttpHeaders
headers
=
new
HttpHeaders
();
...
@@ -93,12 +94,19 @@ public class SystemParameterController {
...
@@ -93,12 +94,19 @@ public class SystemParameterController {
return
new
ResponseEntity
<>(
bytes
,
headers
,
HttpStatus
.
OK
);
return
new
ResponseEntity
<>(
bytes
,
headers
,
HttpStatus
.
OK
);
}
}
@PostMapping
(
value
=
"/save/ui"
,
consumes
=
{
"multipart/form-data"
})
@PostMapping
(
value
=
"/save/ui"
,
consumes
=
{
"multipart/form-data"
})
public
void
saveUIInfo
(
@RequestPart
(
"request"
)
Map
<
String
,
List
<
SystemParameterDTO
>>
systemParameterMap
,
@RequestPart
(
value
=
"files"
,
required
=
false
)
List
<
MultipartFile
>
bodyFiles
)
throws
IOException
{
public
void
saveUIInfo
(
@RequestPart
(
"request"
)
Map
<
String
,
List
<
SystemParameterDTO
>>
systemParameterMap
,
@RequestPart
(
value
=
"files"
,
required
=
false
)
List
<
MultipartFile
>
bodyFiles
)
throws
IOException
{
systemParameterService
.
saveUIInfo
(
systemParameterMap
,
bodyFiles
);
systemParameterService
.
saveUIInfo
(
systemParameterMap
,
bodyFiles
);
}
}
@PostMapping
(
value
=
"/checkCustomDs"
)
public
boolean
checkCustomDs
()
throws
IOException
{
try
{
Object
cache
=
CacheUtils
.
get
(
DatasetCheckListener
.
CACHE_NAME
,
DatasetCheckListener
.
CACHE_KEY
);
return
cache
!=
null
&&
(
boolean
)
cache
;
}
catch
(
Exception
e
)
{
return
false
;
}
}
}
}
backend/src/main/java/io/dataease/listener/DatasetCheckListener.java
0 → 100644
浏览文件 @
b3352c07
package
io
.
dataease
.
listener
;
import
io.dataease.base.domain.DatasetTable
;
import
io.dataease.base.domain.DatasetTableExample
;
import
io.dataease.base.mapper.DatasetTableMapper
;
import
io.dataease.listener.util.CacheUtils
;
import
io.dataease.plugins.loader.ClassloaderResponsity
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.boot.context.event.ApplicationReadyEvent
;
import
org.springframework.context.ApplicationListener
;
import
org.springframework.stereotype.Component
;
import
javax.annotation.Resource
;
import
java.util.List
;
/**
* @Author gin
* @Date 2021/12/22 10:01 上午
*/
@Component
public
class
DatasetCheckListener
implements
ApplicationListener
<
ApplicationReadyEvent
>
{
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
ClassloaderResponsity
.
class
);
public
static
final
String
CACHE_NAME
=
"check_ds"
;
public
static
final
String
CACHE_KEY
=
"hide_custom_ds"
;
@Resource
private
DatasetTableMapper
datasetTableMapper
;
@Override
public
void
onApplicationEvent
(
ApplicationReadyEvent
applicationReadyEvent
)
{
logger
.
info
(
"Start check custom dataset"
);
// 项目启动查找是否有'自定义数据集'
DatasetTableExample
datasetTableExample
=
new
DatasetTableExample
();
datasetTableExample
.
createCriteria
().
andTypeEqualTo
(
"custom"
);
List
<
DatasetTable
>
datasetTables
=
datasetTableMapper
.
selectByExampleWithBLOBs
(
datasetTableExample
);
CacheUtils
.
put
(
CACHE_NAME
,
CACHE_KEY
,
CollectionUtils
.
isEmpty
(
datasetTables
),
null
,
null
);
}
}
frontend/src/api/dataset/dataset.js
浏览文件 @
b3352c07
...
@@ -182,4 +182,12 @@ export function datasetRowPermissionsList(datasetId, page, size, data, loading)
...
@@ -182,4 +182,12 @@ export function datasetRowPermissionsList(datasetId, page, size, data, loading)
})
})
}
}
export
default
{
loadTable
,
getScene
,
addGroup
,
delGroup
,
addTable
,
delTable
,
groupTree
}
export
function
checkCustomDs
()
{
return
request
({
url
:
'/system/checkCustomDs'
,
method
:
'post'
,
loading
:
true
})
}
export
default
{
loadTable
,
getScene
,
addGroup
,
delGroup
,
addTable
,
delTable
,
groupTree
,
checkCustomDs
}
frontend/src/store/getters.js
浏览文件 @
b3352c07
...
@@ -16,6 +16,7 @@ const getters = {
...
@@ -16,6 +16,7 @@ const getters = {
errorLogs
:
state
=>
state
.
errorLog
.
logs
,
errorLogs
:
state
=>
state
.
errorLog
.
logs
,
sceneData
:
state
=>
state
.
dataset
.
sceneData
,
sceneData
:
state
=>
state
.
dataset
.
sceneData
,
table
:
state
=>
state
.
dataset
.
table
,
table
:
state
=>
state
.
dataset
.
table
,
hideCustomDs
:
state
=>
state
.
dataset
.
hideCustomDs
,
loadingMap
:
state
=>
state
.
request
.
loadingMap
,
loadingMap
:
state
=>
state
.
request
.
loadingMap
,
currentPath
:
state
=>
state
.
permission
.
currentPath
,
currentPath
:
state
=>
state
.
permission
.
currentPath
,
permissions
:
state
=>
state
.
user
.
permissions
,
permissions
:
state
=>
state
.
user
.
permissions
,
...
...
frontend/src/store/modules/dataset.js
浏览文件 @
b3352c07
...
@@ -2,7 +2,8 @@
...
@@ -2,7 +2,8 @@
const
getDefaultState
=
()
=>
{
const
getDefaultState
=
()
=>
{
return
{
return
{
sceneData
:
{},
sceneData
:
{},
table
:
{}
table
:
{},
hideCustomDs
:
false
}
}
}
}
...
@@ -14,6 +15,9 @@ const mutations = {
...
@@ -14,6 +15,9 @@ const mutations = {
},
},
setTable
:
(
state
,
table
)
=>
{
setTable
:
(
state
,
table
)
=>
{
state
.
table
=
table
state
.
table
=
table
},
setHideCustomDs
:
(
state
,
hideCustomDs
)
=>
{
state
.
hideCustomDs
=
hideCustomDs
}
}
}
}
...
@@ -23,6 +27,9 @@ const actions = {
...
@@ -23,6 +27,9 @@ const actions = {
},
},
setTable
({
commit
},
table
)
{
setTable
({
commit
},
table
)
{
commit
(
'setTable'
,
table
)
commit
(
'setTable'
,
table
)
},
setHideCustomDs
({
commit
},
hideCustomDs
)
{
commit
(
'setHideCustomDs'
,
hideCustomDs
)
}
}
}
}
...
...
frontend/src/views/dataset/data/ViewTable.vue
浏览文件 @
b3352c07
...
@@ -56,7 +56,7 @@
...
@@ -56,7 +56,7 @@
<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 !== 'union' && table.type !== 'custom' && !(table.type === 'sql' && table.mode === 0)"
:label=
"$t('dataset.join_view')"
name=
"joinView"
>
<el-tab-pane
v-if=
"
!hideCustomDs &&
table.type !== 'union' && table.type !== 'custom' && !(table.type === 'sql' && table.mode === 0)"
:label=
"$t('dataset.join_view')"
name=
"joinView"
>
<union-view
:param=
"param"
:table=
"table"
/>
<union-view
:param=
"param"
:table=
"table"
/>
</el-tab-pane>
</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"
>
...
@@ -76,7 +76,7 @@ import FieldEdit from './FieldEdit'
...
@@ -76,7 +76,7 @@ import FieldEdit from './FieldEdit'
export
default
{
export
default
{
name
:
'ViewTable'
,
name
:
'ViewTable'
,
components
:
{
FieldEdit
,
UnionView
,
DatasetChartDetail
,
UpdateInfo
,
TabDataPreview
},
components
:
{
FieldEdit
,
UnionView
,
DatasetChartDetail
,
UpdateInfo
,
TabDataPreview
},
props
:
{
props
:
{
param
:
{
param
:
{
type
:
Object
,
type
:
Object
,
...
@@ -103,10 +103,9 @@ export default {
...
@@ -103,10 +103,9 @@ export default {
}
}
},
},
computed
:
{
computed
:
{
// tableRefresh() {
hideCustomDs
:
function
()
{
// this.initTable(this.param)
return
this
.
$store
.
getters
.
hideCustomDs
// return this.$store.state.dataset.table
}
// }
},
},
watch
:
{
watch
:
{
'param'
:
function
()
{
'param'
:
function
()
{
...
...
frontend/src/views/dataset/group/Group.vue
浏览文件 @
b3352c07
...
@@ -91,7 +91,7 @@
...
@@ -91,7 +91,7 @@
<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
v-show=
"!hideCustomDs"
:command=
"beforeClickAddData('custom',data)"
>
<svg-icon
icon-class=
"ds-custom"
class=
"ds-icon-custom"
/>
<svg-icon
icon-class=
"ds-custom"
class=
"ds-icon-custom"
/>
{{
$t
(
'dataset.custom_data'
)
}}
{{
$t
(
'dataset.custom_data'
)
}}
</el-dropdown-item>
</el-dropdown-item>
...
@@ -309,6 +309,9 @@ export default {
...
@@ -309,6 +309,9 @@ export default {
}
}
},
},
computed
:
{
computed
:
{
hideCustomDs
:
function
()
{
return
this
.
$store
.
getters
.
hideCustomDs
}
},
},
watch
:
{
watch
:
{
saveStatus
()
{
saveStatus
()
{
...
...
frontend/src/views/dataset/index.vue
浏览文件 @
b3352c07
...
@@ -26,6 +26,7 @@ import AddCustom from './add/AddCustom'
...
@@ -26,6 +26,7 @@ import AddCustom from './add/AddCustom'
import
AddUnion
from
'@/views/dataset/add/AddUnion'
import
AddUnion
from
'@/views/dataset/add/AddUnion'
import
FieldEdit
from
'./data/FieldEdit'
import
FieldEdit
from
'./data/FieldEdit'
import
{
removeClass
}
from
'@/utils'
import
{
removeClass
}
from
'@/utils'
import
{
checkCustomDs
}
from
'@/api/dataset/dataset'
export
default
{
export
default
{
name
:
'DataSet'
,
name
:
'DataSet'
,
components
:
{
DeMainContainer
,
DeContainer
,
DeAsideContainer
,
Group
,
DataHome
,
ViewTable
,
AddDB
,
AddSQL
,
AddExcel
,
AddCustom
},
components
:
{
DeMainContainer
,
DeContainer
,
DeAsideContainer
,
Group
,
DataHome
,
ViewTable
,
AddDB
,
AddSQL
,
AddExcel
,
AddCustom
},
...
@@ -40,11 +41,17 @@ export default {
...
@@ -40,11 +41,17 @@ export default {
removeClass
(
document
.
body
,
'showRightPanel'
)
removeClass
(
document
.
body
,
'showRightPanel'
)
},
},
created
()
{
created
()
{
this
.
initDs
()
this
.
$store
.
dispatch
(
'app/toggleSideBarHide'
,
true
)
this
.
$store
.
dispatch
(
'app/toggleSideBarHide'
,
true
)
const
routerParam
=
this
.
$router
.
currentRoute
.
params
const
routerParam
=
this
.
$router
.
currentRoute
.
params
this
.
toMsgShare
(
routerParam
)
this
.
toMsgShare
(
routerParam
)
},
},
methods
:
{
methods
:
{
initDs
()
{
checkCustomDs
().
then
(
res
=>
{
this
.
$store
.
dispatch
(
'dataset/setHideCustomDs'
,
res
.
data
)
})
},
switchComponent
(
c
)
{
switchComponent
(
c
)
{
this
.
param
=
c
.
param
this
.
param
=
c
.
param
switch
(
c
.
name
)
{
switch
(
c
.
name
)
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论