Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
zhu
dataease
Commits
26b9b12a
Unverified
提交
26b9b12a
authored
5月 31, 2022
作者:
王嘉豪
提交者:
GitHub
5月 31, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #2361 from dataease/dev
Dev
上级
38300c4a
edc98783
隐藏空白字符变更
内嵌
并排
正在显示
20 个修改的文件
包含
248 行增加
和
168 行删除
+248
-168
DeCleanerAnnotationHandler.java
...java/io/dataease/auth/aop/DeCleanerAnnotationHandler.java
+8
-83
PanelGroupController.java
...va/io/dataease/controller/panel/PanelGroupController.java
+18
-6
ExtChartViewMapper.xml
backend/src/main/java/io/dataease/ext/ExtChartViewMapper.xml
+2
-0
JdbcProvider.java
...in/java/io/dataease/provider/datasource/JdbcProvider.java
+5
-2
DriverService.java
...in/java/io/dataease/service/datasource/DriverService.java
+21
-9
DeCatchProcess.java
...main/java/io/dataease/service/decatch/DeCatchProcess.java
+97
-0
PanelGroupService.java
...ain/java/io/dataease/service/panel/PanelGroupService.java
+16
-24
messages_en_US.properties
backend/src/main/resources/i18n/messages_en_US.properties
+3
-2
messages_zh_CN.properties
backend/src/main/resources/i18n/messages_zh_CN.properties
+1
-0
messages_zh_TW.properties
backend/src/main/resources/i18n/messages_zh_TW.properties
+3
-2
panel.js
frontend/src/api/panel/panel.js
+10
-0
Preview.vue
frontend/src/components/canvas/components/Editor/Preview.vue
+5
-4
Toolbar.vue
frontend/src/components/canvas/components/Toolbar.vue
+2
-2
UserView.vue
frontend/src/components/canvas/custom-component/UserView.vue
+16
-9
component-list.js
.../src/components/canvas/custom-component/component-list.js
+1
-2
gauge.js
frontend/src/views/chart/chart/gauge/gauge.js
+1
-1
LabelNormalText.vue
...end/src/views/chart/components/normal/LabelNormalText.vue
+1
-1
ChartEdit.vue
frontend/src/views/chart/view/ChartEdit.vue
+10
-7
index.vue
frontend/src/views/panel/list/EditPanel/index.vue
+26
-12
PanelList.vue
frontend/src/views/panel/list/PanelList.vue
+2
-2
没有找到文件。
backend/src/main/java/io/dataease/auth/aop/DeCleanerAnnotationHandler.java
浏览文件 @
26b9b12a
package
io
.
dataease
.
auth
.
aop
;
import
io.dataease.auth.annotation.DeCleaner
;
import
io.dataease.auth.api.dto.CurrentUserDto
;
import
io.dataease.commons.constants.AuthConstants
;
import
io.dataease.commons.constants.DePermissionType
;
import
io.dataease.commons.model.AuthURD
;
import
io.dataease.commons.utils.AopUtils
;
import
io.dataease.commons.utils.
AuthUtils
;
import
io.dataease.commons.utils.
CommonBeanFactory
;
import
io.dataease.commons.utils.LogUtil
;
import
io.dataease.listener.util.CacheUtils
;
import
org.apache.commons.collections4.CollectionUtils
;
import
io.dataease.service.decatch.DeCatchProcess
;
import
org.apache.commons.lang3.ArrayUtils
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.aspectj.lang.JoinPoint
;
import
org.aspectj.lang.annotation.AfterReturning
;
import
org.aspectj.lang.annotation.Aspect
;
...
...
@@ -20,9 +15,6 @@ import org.aspectj.lang.reflect.MethodSignature;
import
org.springframework.stereotype.Component
;
import
java.lang.reflect.Method
;
import
java.util.List
;
import
java.util.Optional
;
@Aspect
@Component
public
class
DeCleanerAnnotationHandler
{
...
...
@@ -43,15 +35,16 @@ public class DeCleanerAnnotationHandler {
paramValue
=
AopUtils
.
getParamValue
(
arg
,
key
,
0
);
}
switch
(
type
.
name
())
{
case
"DATASOURCE"
:
cleanDataSource
(
paramValue
);
c
atchProcess
().
c
leanDataSource
(
paramValue
);
break
;
case
"DATASET"
:
cleanDataSet
(
paramValue
);
c
atchProcess
().
c
leanDataSet
(
paramValue
);
break
;
default
:
cleanPanel
(
paramValue
);
c
atchProcess
().
c
leanPanel
(
paramValue
);
break
;
}
}
catch
(
Throwable
e
)
{
...
...
@@ -60,78 +53,10 @@ public class DeCleanerAnnotationHandler {
}
}
private
void
cleanCacheParent
(
String
pid
,
String
type
)
{
if
(
StringUtils
.
isBlank
(
pid
)
||
StringUtils
.
isBlank
(
type
))
{
return
;
}
CurrentUserDto
user
=
AuthUtils
.
getUser
();
List
<
String
>
resourceIds
=
AuthUtils
.
parentResources
(
pid
.
toString
(),
type
);
if
(
CollectionUtils
.
isEmpty
(
resourceIds
))
return
;
resourceIds
.
forEach
(
resourceId
->
{
AuthURD
authURD
=
AuthUtils
.
authURDR
(
resourceId
);
Optional
.
ofNullable
(
authURD
.
getUserIds
()).
ifPresent
(
ids
->
{
ids
.
forEach
(
id
->
{
CacheUtils
.
remove
(
"user_"
+
type
,
"user"
+
id
);
});
});
Optional
.
ofNullable
(
authURD
.
getRoleIds
()).
ifPresent
(
ids
->
{
ids
.
forEach
(
id
->
{
CacheUtils
.
remove
(
"role_"
+
type
,
"role"
+
id
);
});
});
Optional
.
ofNullable
(
authURD
.
getDeptIds
()).
ifPresent
(
ids
->
{
ids
.
forEach
(
id
->
{
List
<
String
>
depts
=
AuthUtils
.
getAuthModels
(
id
.
toString
(),
"dept"
,
user
.
getUserId
(),
user
.
getIsAdmin
());
depts
.
forEach
(
deptId
->
{
CacheUtils
.
remove
(
"dept_"
+
type
,
"dept"
+
deptId
);
});
});
});
});
public
DeCatchProcess
catchProcess
()
{
return
CommonBeanFactory
.
getBean
(
DeCatchProcess
.
class
);
}
public
void
cleanPanel
(
Object
pid
)
{
CurrentUserDto
user
=
AuthUtils
.
getUser
();
CacheUtils
.
remove
(
AuthConstants
.
USER_PANEL_NAME
,
"user"
+
user
.
getUserId
());
CacheUtils
.
remove
(
AuthConstants
.
DEPT_PANEL_NAME
,
"dept"
+
user
.
getDeptId
());
user
.
getRoles
().
forEach
(
role
->
{
CacheUtils
.
remove
(
AuthConstants
.
ROLE_PANEL_NAME
,
"role"
+
role
.
getId
());
});
Optional
.
ofNullable
(
pid
).
ifPresent
(
resourceId
->
{
cleanCacheParent
(
resourceId
.
toString
(),
"panel"
);
});
}
public
void
cleanDataSet
(
Object
pid
)
{
CurrentUserDto
user
=
AuthUtils
.
getUser
();
CacheUtils
.
remove
(
AuthConstants
.
USER_DATASET_NAME
,
"user"
+
user
.
getUserId
());
CacheUtils
.
remove
(
AuthConstants
.
DEPT_DATASET_NAME
,
"dept"
+
user
.
getDeptId
());
user
.
getRoles
().
forEach
(
role
->
{
CacheUtils
.
remove
(
AuthConstants
.
ROLE_DATASET_NAME
,
"role"
+
role
.
getId
());
});
Optional
.
ofNullable
(
pid
).
ifPresent
(
resourceId
->
{
cleanCacheParent
(
resourceId
.
toString
(),
"dataset"
);
});
}
public
void
cleanDataSource
(
Object
pid
)
{
CurrentUserDto
user
=
AuthUtils
.
getUser
();
CacheUtils
.
remove
(
AuthConstants
.
USER_LINK_NAME
,
"user"
+
user
.
getUserId
());
CacheUtils
.
remove
(
AuthConstants
.
DEPT_LINK_NAME
,
"dept"
+
user
.
getDeptId
());
user
.
getRoles
().
forEach
(
role
->
{
CacheUtils
.
remove
(
AuthConstants
.
ROLE_LINK_NAME
,
"role"
+
role
.
getId
());
});
Optional
.
ofNullable
(
pid
).
ifPresent
(
resourceId
->
{
cleanCacheParent
(
resourceId
.
toString
(),
"link"
);
});
}
}
backend/src/main/java/io/dataease/controller/panel/PanelGroupController.java
浏览文件 @
26b9b12a
...
...
@@ -62,8 +62,20 @@ public class PanelGroupController {
@DePermission
(
type
=
DePermissionType
.
PANEL
,
value
=
"pid"
,
level
=
ResourceAuthLevel
.
PANNEL_LEVEL_MANAGE
)
},
logical
=
Logical
.
AND
)
@I18n
public
PanelGroup
saveOrUpdate
(
@RequestBody
PanelGroupRequest
request
)
{
return
panelGroupService
.
saveOrUpdate
(
request
);
public
PanelGroup
save
(
@RequestBody
PanelGroupRequest
request
)
throws
Exception
{
String
panelId
=
panelGroupService
.
save
(
request
);
return
findOne
(
panelId
);
}
@ApiOperation
(
"更新"
)
@PostMapping
(
"/update"
)
@DePermissions
(
value
=
{
@DePermission
(
type
=
DePermissionType
.
PANEL
,
value
=
"id"
),
@DePermission
(
type
=
DePermissionType
.
PANEL
,
value
=
"pid"
,
level
=
ResourceAuthLevel
.
PANNEL_LEVEL_MANAGE
)
},
logical
=
Logical
.
AND
)
@I18n
public
String
update
(
@RequestBody
PanelGroupRequest
request
)
{
return
panelGroupService
.
update
(
request
);
}
@ApiOperation
(
"删除"
)
...
...
@@ -107,7 +119,7 @@ public class PanelGroupController {
@ApiOperation
(
"仪表板组件信息"
)
@GetMapping
(
"/queryPanelComponents/{id}"
)
@I18n
public
Map
queryPanelComponents
(
@PathVariable
String
id
){
public
Map
queryPanelComponents
(
@PathVariable
String
id
)
{
return
panelGroupService
.
queryPanelComponents
(
id
);
}
...
...
@@ -115,15 +127,15 @@ public class PanelGroupController {
@PostMapping
(
"/exportDetails"
)
@I18n
public
void
exportDetails
(
@RequestBody
PanelViewDetailsRequest
request
,
HttpServletResponse
response
)
throws
IOException
{
panelGroupService
.
exportPanelViewDetails
(
request
,
response
);
panelGroupService
.
exportPanelViewDetails
(
request
,
response
);
}
@ApiOperation
(
"更新仪表板状态"
)
@PostMapping
(
"/updatePanelStatus/{panelId}"
)
@I18n
@DePermission
(
type
=
DePermissionType
.
PANEL
,
level
=
ResourceAuthLevel
.
PANNEL_LEVEL_MANAGE
)
public
void
updatePanelStatus
(
@PathVariable
String
panelId
,
@RequestBody
PanelGroupBaseInfoRequest
request
)
{
panelGroupService
.
updatePanelStatus
(
panelId
,
request
);
public
void
updatePanelStatus
(
@PathVariable
String
panelId
,
@RequestBody
PanelGroupBaseInfoRequest
request
)
{
panelGroupService
.
updatePanelStatus
(
panelId
,
request
);
}
}
backend/src/main/java/io/dataease/ext/ExtChartViewMapper.xml
浏览文件 @
26b9b12a
...
...
@@ -365,6 +365,7 @@
custom_filter,
drill_fields,
SNAPSHOT,
senior,
data_from)
SELECT pv_copy.chart_view_id AS id,
`name`,
...
...
@@ -392,6 +393,7 @@
custom_filter,
drill_fields,
SNAPSHOT,
senior,
data_from
FROM (
SELECT panel_id,
...
...
backend/src/main/java/io/dataease/provider/datasource/JdbcProvider.java
浏览文件 @
26b9b12a
...
...
@@ -79,8 +79,11 @@ public class JdbcProvider extends DefaultJdbcProvider {
List
<
TableField
>
list
=
new
LinkedList
<>();
try
(
Connection
connection
=
getConnectionFromPool
(
datasourceRequest
))
{
if
(
datasourceRequest
.
getDatasource
().
getType
().
equalsIgnoreCase
(
"oracle"
))
{
Method
setRemarksReporting
=
extendedJdbcClassLoader
.
loadClass
(
"oracle.jdbc.driver.OracleConnection"
).
getMethod
(
"setRemarksReporting"
,
boolean
.
class
);
setRemarksReporting
.
invoke
(((
DruidPooledConnection
)
connection
).
getConnection
(),
true
);
OracleConfiguration
oracleConfiguration
=
new
Gson
().
fromJson
(
datasourceRequest
.
getDatasource
().
getConfiguration
(),
OracleConfiguration
.
class
);
if
(
isDefaultClassLoader
(
oracleConfiguration
.
getCustomDriver
()))
{
Method
setRemarksReporting
=
extendedJdbcClassLoader
.
loadClass
(
"oracle.jdbc.driver.OracleConnection"
).
getMethod
(
"setRemarksReporting"
,
boolean
.
class
);
setRemarksReporting
.
invoke
(((
DruidPooledConnection
)
connection
).
getConnection
(),
true
);
}
}
DatabaseMetaData
databaseMetaData
=
connection
.
getMetaData
();
ResultSet
resultSet
=
databaseMetaData
.
getColumns
(
null
,
"%"
,
datasourceRequest
.
getTable
(),
"%"
);
...
...
backend/src/main/java/io/dataease/service/datasource/DriverService.java
浏览文件 @
26b9b12a
package
io
.
dataease
.
service
.
datasource
;
import
cn.hutool.core.collection.CollectionUtil
;
import
com.google.gson.Gson
;
import
io.dataease.commons.constants.SysLogConstants
;
import
io.dataease.commons.utils.BeanUtils
;
...
...
@@ -8,14 +9,13 @@ import io.dataease.commons.utils.DeLogUtils;
import
io.dataease.dto.DriverDTO
;
import
io.dataease.dto.SysLogDTO
;
import
io.dataease.i18n.Translator
;
import
io.dataease.plugins.common.base.domain.Datasource
;
import
io.dataease.plugins.common.base.domain.DeDriver
;
import
io.dataease.plugins.common.base.domain.DeDriverDetails
;
import
io.dataease.plugins.common.base.domain.DeDriverDetailsExample
;
import
io.dataease.plugins.common.base.domain.*
;
import
io.dataease.plugins.common.base.mapper.DeDriverDetailsMapper
;
import
io.dataease.plugins.common.base.mapper.DeDriverMapper
;
import
io.dataease.plugins.datasource.entity.JdbcConfiguration
;
import
io.dataease.plugins.datasource.provider.DefaultJdbcProvider
;
import
io.dataease.plugins.datasource.provider.ExtendedJdbcClassLoader
;
import
io.dataease.provider.ProviderFactory
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
...
...
@@ -27,10 +27,7 @@ import java.io.FileOutputStream;
import
java.io.IOException
;
import
java.lang.reflect.Modifier
;
import
java.net.URL
;
import
java.util.ArrayList
;
import
java.util.Enumeration
;
import
java.util.List
;
import
java.util.UUID
;
import
java.util.*
;
import
java.util.jar.JarEntry
;
import
java.util.jar.JarFile
;
...
...
@@ -78,6 +75,15 @@ public class DriverService {
}
public
DeDriver
save
(
DeDriver
deDriver
)
{
if
(
StringUtils
.
isEmpty
(
deDriver
.
getName
())
||
StringUtils
.
isEmpty
(
deDriver
.
getType
())){
throw
new
RuntimeException
(
"Name or Type cannot be empty."
);
}
DeDriverExample
example
=
new
DeDriverExample
();
example
.
createCriteria
().
andNameEqualTo
(
deDriver
.
getName
());
if
(
CollectionUtil
.
isNotEmpty
(
deDriverMapper
.
selectByExample
(
example
))){
throw
new
RuntimeException
(
Translator
.
get
(
"I18N_DRIVER_REPEAT_NAME"
));
}
deDriver
.
setCreateTime
(
System
.
currentTimeMillis
());
deDriver
.
setId
(
UUID
.
randomUUID
().
toString
());
deDriverMapper
.
insert
(
deDriver
);
...
...
@@ -96,12 +102,15 @@ public class DriverService {
return
deDriverDetailsMapper
.
selectByExampleWithBLOBs
(
example
);
}
public
void
deleteDriverFile
(
String
driverFileId
)
{
public
void
deleteDriverFile
(
String
driverFileId
)
throws
Exception
{
DeDriverDetails
deDriverDetails
=
deDriverDetailsMapper
.
selectByPrimaryKey
(
driverFileId
);
DeDriver
deDriver
=
deDriverMapper
.
selectByPrimaryKey
(
deDriverDetails
.
getDeDriverId
());
DeFileUtils
.
deleteFile
(
DRIVER_PATH
+
deDriverDetails
.
getDeDriverId
()
+
"/"
+
deDriverDetails
.
getFileName
());
SysLogDTO
sysLogDTO
=
DeLogUtils
.
buildLog
(
SysLogConstants
.
OPERATE_TYPE
.
DELETE
,
SysLogConstants
.
SOURCE_TYPE
.
DRIVER_FILE
,
deDriverDetails
.
getId
(),
deDriverDetails
.
getDeDriverId
(),
null
,
null
);
DeLogUtils
.
save
(
sysLogDTO
);
deDriverDetailsMapper
.
deleteByPrimaryKey
(
driverFileId
);
DefaultJdbcProvider
defaultJdbcProvider
=
(
DefaultJdbcProvider
)
ProviderFactory
.
getProvider
(
deDriver
.
getType
());
defaultJdbcProvider
.
reloadCustomJdbcClassLoader
(
deDriver
);
}
public
DeDriverDetails
saveJar
(
MultipartFile
file
,
String
driverId
)
throws
Exception
{
...
...
@@ -129,6 +138,9 @@ public class DriverService {
deDriverDetailsMapper
.
insert
(
deDriverDetails
);
SysLogDTO
sysLogDTO
=
DeLogUtils
.
buildLog
(
SysLogConstants
.
OPERATE_TYPE
.
UPLOADFILE
,
SysLogConstants
.
SOURCE_TYPE
.
DRIVER_FILE
,
deDriverDetails
.
getId
(),
driverId
,
null
,
null
);
DeLogUtils
.
save
(
sysLogDTO
);
DeDriver
deDriver
=
deDriverMapper
.
selectByPrimaryKey
(
driverId
);
DefaultJdbcProvider
defaultJdbcProvider
=
(
DefaultJdbcProvider
)
ProviderFactory
.
getProvider
(
deDriver
.
getType
());
defaultJdbcProvider
.
reloadCustomJdbcClassLoader
(
deDriver
);
return
deDriverDetails
;
}
...
...
backend/src/main/java/io/dataease/service/decatch/DeCatchProcess.java
0 → 100644
浏览文件 @
26b9b12a
package
io
.
dataease
.
service
.
decatch
;
import
io.dataease.auth.api.dto.CurrentUserDto
;
import
io.dataease.commons.constants.AuthConstants
;
import
io.dataease.commons.model.AuthURD
;
import
io.dataease.commons.utils.AuthUtils
;
import
io.dataease.listener.util.CacheUtils
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
import
java.util.Optional
;
/**
* Author: wangjiahao
* Date: 2022/5/31
* Description:
*/
@Service
public
class
DeCatchProcess
{
@Async
(
"taskExecutor"
)
public
void
cleanPanel
(
Object
pid
)
{
CurrentUserDto
user
=
AuthUtils
.
getUser
();
CacheUtils
.
remove
(
AuthConstants
.
USER_PANEL_NAME
,
"user"
+
user
.
getUserId
());
CacheUtils
.
remove
(
AuthConstants
.
DEPT_PANEL_NAME
,
"dept"
+
user
.
getDeptId
());
user
.
getRoles
().
forEach
(
role
->
{
CacheUtils
.
remove
(
AuthConstants
.
ROLE_PANEL_NAME
,
"role"
+
role
.
getId
());
});
Optional
.
ofNullable
(
pid
).
ifPresent
(
resourceId
->
{
cleanCacheParent
(
resourceId
.
toString
(),
"panel"
);
});
}
@Async
(
"taskExecutor"
)
public
void
cleanDataSet
(
Object
pid
)
{
CurrentUserDto
user
=
AuthUtils
.
getUser
();
CacheUtils
.
remove
(
AuthConstants
.
USER_DATASET_NAME
,
"user"
+
user
.
getUserId
());
CacheUtils
.
remove
(
AuthConstants
.
DEPT_DATASET_NAME
,
"dept"
+
user
.
getDeptId
());
user
.
getRoles
().
forEach
(
role
->
{
CacheUtils
.
remove
(
AuthConstants
.
ROLE_DATASET_NAME
,
"role"
+
role
.
getId
());
});
Optional
.
ofNullable
(
pid
).
ifPresent
(
resourceId
->
{
cleanCacheParent
(
resourceId
.
toString
(),
"dataset"
);
});
}
@Async
(
"taskExecutor"
)
public
void
cleanDataSource
(
Object
pid
)
{
CurrentUserDto
user
=
AuthUtils
.
getUser
();
CacheUtils
.
remove
(
AuthConstants
.
USER_LINK_NAME
,
"user"
+
user
.
getUserId
());
CacheUtils
.
remove
(
AuthConstants
.
DEPT_LINK_NAME
,
"dept"
+
user
.
getDeptId
());
user
.
getRoles
().
forEach
(
role
->
{
CacheUtils
.
remove
(
AuthConstants
.
ROLE_LINK_NAME
,
"role"
+
role
.
getId
());
});
Optional
.
ofNullable
(
pid
).
ifPresent
(
resourceId
->
{
cleanCacheParent
(
resourceId
.
toString
(),
"link"
);
});
}
private
void
cleanCacheParent
(
String
pid
,
String
type
)
{
if
(
StringUtils
.
isBlank
(
pid
)
||
StringUtils
.
isBlank
(
type
))
{
return
;
}
CurrentUserDto
user
=
AuthUtils
.
getUser
();
List
<
String
>
resourceIds
=
AuthUtils
.
parentResources
(
pid
.
toString
(),
type
);
if
(
CollectionUtils
.
isEmpty
(
resourceIds
))
return
;
resourceIds
.
forEach
(
resourceId
->
{
AuthURD
authURD
=
AuthUtils
.
authURDR
(
resourceId
);
Optional
.
ofNullable
(
authURD
.
getUserIds
()).
ifPresent
(
ids
->
{
ids
.
forEach
(
id
->
{
CacheUtils
.
remove
(
"user_"
+
type
,
"user"
+
id
);
});
});
Optional
.
ofNullable
(
authURD
.
getRoleIds
()).
ifPresent
(
ids
->
{
ids
.
forEach
(
id
->
{
CacheUtils
.
remove
(
"role_"
+
type
,
"role"
+
id
);
});
});
Optional
.
ofNullable
(
authURD
.
getDeptIds
()).
ifPresent
(
ids
->
{
ids
.
forEach
(
id
->
{
List
<
String
>
depts
=
AuthUtils
.
getAuthModels
(
id
.
toString
(),
"dept"
,
user
.
getUserId
(),
user
.
getIsAdmin
());
depts
.
forEach
(
deptId
->
{
CacheUtils
.
remove
(
"dept_"
+
type
,
"dept"
+
deptId
);
});
});
});
});
}
}
backend/src/main/java/io/dataease/service/panel/PanelGroupService.java
浏览文件 @
26b9b12a
...
...
@@ -121,20 +121,22 @@ public class PanelGroupService {
}
@DeCleaner
(
value
=
DePermissionType
.
PANEL
,
key
=
"pid"
)
public
PanelGroup
saveOrUpdate
(
PanelGroupRequest
request
)
{
public
String
save
(
PanelGroupRequest
request
)
{
checkPanelName
(
request
.
getName
(),
request
.
getPid
(),
PanelConstants
.
OPT_TYPE_INSERT
,
null
,
request
.
getNodeType
());
String
panelId
=
newPanel
(
request
);
panelGroupMapper
.
insertSelective
(
request
);
// 清理权限缓存
clearPermissionCache
();
sysAuthService
.
copyAuth
(
panelId
,
SysAuthConstants
.
AUTH_SOURCE_TYPE_PANEL
);
DeLogUtils
.
save
(
SysLogConstants
.
OPERATE_TYPE
.
CREATE
,
sourceType
,
panelId
,
request
.
getPid
(),
null
,
null
);
return
panelId
;
}
public
String
update
(
PanelGroupRequest
request
)
{
String
panelId
=
request
.
getId
();
if
(
StringUtils
.
isNotEmpty
(
panelId
))
{
panelViewService
.
syncPanelViews
(
request
);
}
if
(
StringUtils
.
isEmpty
(
panelId
))
{
// 新建
checkPanelName
(
request
.
getName
(),
request
.
getPid
(),
PanelConstants
.
OPT_TYPE_INSERT
,
null
,
request
.
getNodeType
());
panelId
=
newPanel
(
request
);
panelGroupMapper
.
insertSelective
(
request
);
// 清理权限缓存
clearPermissionCache
();
sysAuthService
.
copyAuth
(
panelId
,
SysAuthConstants
.
AUTH_SOURCE_TYPE_PANEL
);
DeLogUtils
.
save
(
SysLogConstants
.
OPERATE_TYPE
.
CREATE
,
sourceType
,
panelId
,
request
.
getPid
(),
null
,
null
);
}
else
if
(
"toDefaultPanel"
.
equals
(
request
.
getOptType
()))
{
// 转存为默认仪表板
panelViewService
.
syncPanelViews
(
request
);
if
(
"toDefaultPanel"
.
equals
(
request
.
getOptType
()))
{
// 转存为默认仪表板
panelId
=
UUID
.
randomUUID
().
toString
();
PanelGroupWithBLOBs
newDefaultPanel
=
panelGroupMapper
.
selectByPrimaryKey
(
request
.
getId
());
newDefaultPanel
.
setPanelType
(
PanelConstants
.
PANEL_TYPE
.
SYSTEM
);
...
...
@@ -191,19 +193,9 @@ public class PanelGroupService {
request
.
setPid
(
panel
.
getPid
());
}
}
DeLogUtils
.
save
(
SysLogConstants
.
OPERATE_TYPE
.
MODIFY
,
sourceType
,
request
.
getId
(),
request
.
getPid
(),
null
,
sourceType
);
}
//带有权限的返回
PanelGroupRequest
authRequest
=
new
PanelGroupRequest
();
authRequest
.
setId
(
panelId
);
authRequest
.
setUserId
(
String
.
valueOf
(
AuthUtils
.
getUser
().
getUserId
()));
List
<
PanelGroupDTO
>
panelGroupDTOList
=
extPanelGroupMapper
.
panelGroupList
(
authRequest
);
if
(!
CollectionUtils
.
isNotEmpty
(
panelGroupDTOList
))
{
DataEaseException
.
throwException
(
"未查询到用户对应的资源权限,请尝试刷新重新保存"
);
}
return
panelGroupDTOList
.
get
(
0
);
return
panelId
;
}
...
...
backend/src/main/resources/i18n/messages_en_US.properties
浏览文件 @
26b9b12a
...
...
@@ -154,4 +154,5 @@ SOURCE_TYPE_DRIVER=DRIVER
SOURCE_TYPE_DRIVER_FILE
=
DRIVER FILE
SOURCE_TYPE_MENU
=
MENU
I18N_DRIVER_NOT_DELETE
=
Drivers in use cannot be deleted
\ No newline at end of file
I18N_DRIVER_NOT_DELETE
=
Drivers in use cannot be deleted
I18N_DRIVER_REPEAT_NAME
=
Driver name cannot be same.
\ No newline at end of file
backend/src/main/resources/i18n/messages_zh_CN.properties
浏览文件 @
26b9b12a
...
...
@@ -158,3 +158,4 @@ I18N_USER=操作人
I18N_TIME
=
操作时间
I18N_DRIVER_NOT_DELETE
=
使用中的驱动不允许删除
I18N_DRIVER_REPEAT_NAME
=
名称重复
backend/src/main/resources/i18n/messages_zh_TW.properties
浏览文件 @
26b9b12a
...
...
@@ -153,4 +153,5 @@ SOURCE_TYPE_DRIVER=驅動
SOURCE_TYPE_DRIVER_FILE
=
驅動文件
SOURCE_TYPE_MENU
=
菜單
I18N_DRIVER_NOT_DELETE
=
使用中的驅動不允許删除
\ No newline at end of file
I18N_DRIVER_NOT_DELETE
=
使用中的驅動不允許删除
I18N_DRIVER_REPEAT_NAME
=
名稱重複
\ No newline at end of file
frontend/src/api/panel/panel.js
浏览文件 @
26b9b12a
...
...
@@ -72,6 +72,16 @@ export function panelSave(data) {
data
})
}
export
function
panelUpdate
(
data
)
{
return
request
({
url
:
'panel/group/update'
,
method
:
'post'
,
loading
:
true
,
data
})
}
export
function
findOne
(
id
)
{
return
request
({
url
:
'panel/group/findOne/'
+
id
,
...
...
frontend/src/components/canvas/components/Editor/Preview.vue
浏览文件 @
26b9b12a
...
...
@@ -2,10 +2,11 @@
<div
class=
"bg"
:style=
"customStyle"
@
scroll=
"canvasScroll"
>
<div
id=
"canvasInfoMain"
ref=
"canvasInfoMain"
:style=
"canvasInfoMainStyle"
>
<el-row
v-if=
"showUnpublishedArea"
class=
"custom-position"
>
<pre>
<svg-icon
icon-class=
"unpublished"
style=
"font-size: 75px"
/>
{{
$t
(
'panel.panel_off'
)
}}
</pre>
<div
style=
"text-align: center"
>
<svg-icon
icon-class=
"unpublished"
style=
"font-size: 75px"
/>
<br>
<span>
{{
$t
(
'panel.panel_off'
)
}}
</span>
</div>
</el-row>
<el-row
v-else-if=
"componentDataShow.length===0"
class=
"custom-position"
>
{{
$t
(
'panel.panelNull'
)
}}
...
...
frontend/src/components/canvas/components/Toolbar.vue
浏览文件 @
26b9b12a
...
...
@@ -87,7 +87,7 @@ import { mapState } from 'vuex'
import
{
commonStyle
,
commonAttr
}
from
'@/components/canvas/custom-component/component-list'
import
eventBus
from
'@/components/canvas/utils/eventBus'
import
{
deepCopy
,
mobile2MainCanvas
}
from
'@/components/canvas/utils/utils'
import
{
panel
Sav
e
}
from
'@/api/panel/panel'
import
{
panel
Updat
e
}
from
'@/api/panel/panel'
import
{
saveLinkage
,
getPanelAllLinkageInfo
}
from
'@/api/panel/linkage'
import
bus
from
'@/utils/bus'
import
{
...
...
@@ -295,7 +295,7 @@ export default {
})
// 无需保存条件
requestInfo
.
panelData
=
JSON
.
stringify
(
components
)
panel
Sav
e
(
requestInfo
).
then
(
response
=>
{
panel
Updat
e
(
requestInfo
).
then
(
response
=>
{
this
.
$store
.
commit
(
'refreshSaveStatus'
)
this
.
$message
({
message
:
this
.
$t
(
'commons.save_success'
),
...
...
frontend/src/components/canvas/custom-component/UserView.vue
浏览文件 @
26b9b12a
...
...
@@ -549,14 +549,7 @@ export default {
// 将视图传入echart组件
if
(
response
.
success
)
{
this
.
chart
=
response
.
data
if
(
this
.
isEdit
)
{
this
.
componentViewsData
[
this
.
chart
.
id
]
=
{
'title'
:
this
.
chart
.
title
,
'render'
:
this
.
chart
.
render
,
'type'
:
this
.
chart
.
type
,
'isPlugin'
:
this
.
chart
.
isPlugin
}
}
this
.
getDataOnly
(
response
.
data
)
this
.
chart
[
'position'
]
=
this
.
inTab
?
'tab'
:
'panel'
// 记录当前数据
this
.
panelViewDetailsInfo
[
id
]
=
JSON
.
stringify
(
this
.
chart
)
...
...
@@ -613,7 +606,6 @@ export default {
tableChart
.
customStyle
=
JSON
.
stringify
(
tableChart
.
customStyle
)
eventBus
.
$emit
(
'openChartDetailsDialog'
,
{
chart
:
this
.
chart
,
tableChart
:
tableChart
})
},
chartClick
(
param
)
{
if
(
this
.
drillClickDimensionList
.
length
<
this
.
chart
.
drillFields
.
length
-
1
)
{
(
this
.
chart
.
type
===
'map'
||
this
.
chart
.
type
===
'buddle-map'
)
&&
this
.
sendToChildren
(
param
)
...
...
@@ -867,6 +859,21 @@ export default {
}
this
.
mergeScale
()
}
},
getDataOnly
(
sourceResponseData
)
{
if
(
this
.
isEdit
)
{
if
((
this
.
filter
.
filter
&&
this
.
filter
.
filter
.
length
)
||
(
this
.
filter
.
linkageFilters
&&
this
.
filter
.
linkageFilters
.
length
))
{
viewData
(
this
.
chart
.
id
,
this
.
panelInfo
.
id
,
{
filter
:
[],
drill
:
[],
queryFrom
:
'panel'
}).
then
(
response
=>
{
this
.
componentViewsData
[
this
.
chart
.
id
]
=
response
.
data
})
}
else
{
this
.
componentViewsData
[
this
.
chart
.
id
]
=
sourceResponseData
}
}
}
}
}
...
...
frontend/src/components/canvas/custom-component/component-list.js
浏览文件 @
26b9b12a
...
...
@@ -411,8 +411,7 @@ const list = [
verticalAlign
:
'middle'
,
borderStyle
:
'solid'
,
borderColor
:
'#000000'
,
time_margin
:
0
,
padding
:
10
time_margin
:
0
},
formatInfo
:
{
openMode
:
'0'
,
...
...
frontend/src/views/chart/chart/gauge/gauge.js
浏览文件 @
26b9b12a
...
...
@@ -130,7 +130,7 @@ export function baseGaugeOption(chart_option, chart, scale = 1) {
}
}
}
console
.
log
(
chart_option
.
series
[
0
])
//
console.log(chart_option.series[0])
// console.log(chart_option);
componentStyle
(
chart_option
,
chart
)
return
chart_option
...
...
frontend/src/views/chart/components/normal/LabelNormalText.vue
浏览文件 @
26b9b12a
<
template
>
<div
ref=
"tableContainer"
:style=
"bg_class"
style=
"
padding: 8px;
width: 100%;height: 100%;overflow: hidden;"
>
<div
ref=
"tableContainer"
:style=
"bg_class"
style=
"width: 100%;height: 100%;overflow: hidden;"
>
<view-track-bar
ref=
"viewTrack"
:track-menu=
"trackMenu"
class=
"track-bar"
:style=
"trackBarStyleTime"
@
trackClick=
"trackClick"
/>
<p
v-show=
"title_show"
ref=
"title"
:style=
"title_class"
>
{{
chart
.
title
}}
</p>
<div
...
...
frontend/src/views/chart/view/ChartEdit.vue
浏览文件 @
26b9b12a
...
...
@@ -1191,7 +1191,7 @@ export default {
return
this
.
chartConfig
?
this
.
chartConfig
.
propertyInner
:
null
},
chartType
()
{
return
this
.
chart
.
type
return
this
.
chart
?
this
.
chart
.
type
:
null
},
panelInfo
()
{
return
this
.
$store
.
state
.
panel
.
panelInfo
...
...
@@ -1199,7 +1199,8 @@ export default {
...
mapState
([
'curComponent'
,
'panelViewEditInfo'
,
'allViewRender'
'allViewRender'
,
'componentViewsData'
])
/* pluginRenderOptions() {
const plugins = localStorage.getItem('plugin-views') && JSON.parse(localStorage.getItem('plugin-views')) || []
...
...
@@ -1238,6 +1239,9 @@ export default {
}
},
created
()
{
this
.
bindPluginEvent
()
this
.
initFromPanel
()
this
.
chartInit
()
const
plugins
=
localStorage
.
getItem
(
'plugin-views'
)
&&
JSON
.
parse
(
localStorage
.
getItem
(
'plugin-views'
))
if
(
plugins
)
{
this
.
loadPluginType
()
...
...
@@ -1253,9 +1257,6 @@ export default {
}
},
mounted
()
{
this
.
bindPluginEvent
()
this
.
initFromPanel
()
this
.
chartInit
()
},
activated
()
{
},
...
...
@@ -1282,7 +1283,9 @@ export default {
this
.
resetDrill
()
this
.
initFromPanel
()
this
.
getChart
(
this
.
param
.
id
)
this
.
getData
(
this
.
param
.
id
)
if
(
this
.
componentViewsData
[
this
.
param
.
id
])
{
this
.
chart
=
this
.
componentViewsData
[
this
.
param
.
id
]
}
},
bindPluginEvent
()
{
bus
.
$on
(
'show-dimension-edit-filter'
,
this
.
showDimensionEditFilter
)
...
...
@@ -1599,7 +1602,7 @@ export default {
const
view
=
this
.
buildParam
(
true
,
'chart'
,
false
,
switchType
)
if
(
!
view
)
return
viewEditSave
(
this
.
panelInfo
.
id
,
view
).
then
(()
=>
{
this
.
getData
(
this
.
param
.
id
)
//
this.getData(this.param.id)
bus
.
$emit
(
'view-in-cache'
,
{
type
:
'propChange'
,
viewId
:
this
.
param
.
id
})
})
},
...
...
frontend/src/views/panel/list/EditPanel/index.vue
浏览文件 @
26b9b12a
...
...
@@ -23,7 +23,7 @@
</el-col>
<el-col
:span=
"16"
:style=
"classBackground"
class=
"preview-show"
/>
</el-row>
<el-row
v-if=
"inputType==='new_outer_template'"
class=
"preview"
:style=
"classBackground"
/>
<el-row
v-if=
"inputType==='new_outer_template'"
class=
"preview"
:style=
"classBackground"
/>
<el-row
class=
"root-class"
>
<el-button
size=
"mini"
@
click=
"cancel()"
>
{{
$t
(
'commons.cancel'
)
}}
</el-button>
<el-button
type=
"primary"
size=
"mini"
@
click=
"save()"
>
{{
$t
(
'commons.confirm'
)
}}
</el-button>
...
...
@@ -32,7 +32,7 @@
</
template
>
<
script
>
import
{
panelSave
}
from
'@/api/panel/panel'
import
{
panelSave
,
panelUpdate
}
from
'@/api/panel/panel'
import
{
showTemplateList
}
from
'@/api/system/template'
import
TemplateAllList
from
'./TemplateAllList'
import
{
deepCopy
}
from
'@/components/canvas/utils/utils'
...
...
@@ -147,17 +147,31 @@ export default {
}
this
.
editPanel
.
panelInfo
[
'newFrom'
]
=
this
.
inputType
this
.
loading
=
true
panelSave
(
this
.
editPanel
.
panelInfo
).
then
(
response
=>
{
this
.
$message
({
message
:
this
.
$t
(
'commons.save_success'
),
type
:
'success'
,
showClose
:
true
if
(
this
.
editPanel
.
optType
===
'new'
)
{
panelSave
(
this
.
editPanel
.
panelInfo
).
then
(
response
=>
{
this
.
$message
({
message
:
this
.
$t
(
'commons.save_success'
),
type
:
'success'
,
showClose
:
true
})
this
.
loading
=
false
this
.
$emit
(
'closeEditPanelDialog'
,
response
.
data
)
}).
catch
(()
=>
{
this
.
loading
=
false
})
this
.
loading
=
false
this
.
$emit
(
'closeEditPanelDialog'
,
response
.
data
)
}).
catch
(()
=>
{
this
.
loading
=
false
})
}
else
{
panelUpdate
(
this
.
editPanel
.
panelInfo
).
then
(
response
=>
{
this
.
$message
({
message
:
this
.
$t
(
'commons.save_success'
),
type
:
'success'
,
showClose
:
true
})
this
.
loading
=
false
this
.
$emit
(
'closeEditPanelDialog'
,
response
.
data
)
}).
catch
(()
=>
{
this
.
loading
=
false
})
}
},
handleFileChange
(
e
)
{
const
file
=
e
.
target
.
files
[
0
]
...
...
frontend/src/views/panel/list/PanelList.vue
浏览文件 @
26b9b12a
...
...
@@ -228,7 +228,7 @@ import LinkGenerate from '@/views/link/generate'
import
{
uuid
}
from
'vue-uuid'
import
bus
from
'@/utils/bus'
import
EditPanel
from
'./EditPanel'
import
{
addGroup
,
delGroup
,
groupTree
,
defaultTree
,
panelSave
,
initPanelData
}
from
'@/api/panel/panel'
import
{
addGroup
,
delGroup
,
groupTree
,
defaultTree
,
panelSave
,
initPanelData
,
panelUpdate
}
from
'@/api/panel/panel'
import
{
mapState
}
from
'vuex'
import
{
DEFAULT_COMMON_CANVAS_STYLE_STRING
...
...
@@ -779,7 +779,7 @@ export default {
saveMoveGroup
()
{
this
.
moveInfo
.
pid
=
this
.
tGroup
.
id
this
.
moveInfo
[
'optType'
]
=
'move'
panel
Sav
e
(
this
.
moveInfo
).
then
(
response
=>
{
panel
Updat
e
(
this
.
moveInfo
).
then
(
response
=>
{
this
.
tree
()
this
.
closeMoveGroup
()
})
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论