forked from github/dataease
commit
65d8dd5dce
@ -63,12 +63,13 @@ public class ShiroServiceImpl implements ShiroService {
|
|||||||
filterChainDefinitionMap.put("/tokenExpired", ANON);
|
filterChainDefinitionMap.put("/tokenExpired", ANON);
|
||||||
filterChainDefinitionMap.put("/downline", ANON);
|
filterChainDefinitionMap.put("/downline", ANON);
|
||||||
filterChainDefinitionMap.put("/common-files/**", ANON);
|
filterChainDefinitionMap.put("/common-files/**", ANON);
|
||||||
|
filterChainDefinitionMap.put("/linkage/getPanelAllLinkageInfo/**", ANON);
|
||||||
filterChainDefinitionMap.put("/api/auth/logout", "logout");
|
filterChainDefinitionMap.put("/api/auth/logout", "logout");
|
||||||
|
|
||||||
filterChainDefinitionMap.put("/api/link/resourceDetail/**", "link");
|
filterChainDefinitionMap.put("/api/link/resourceDetail/**", "link");
|
||||||
filterChainDefinitionMap.put("/api/link/viewDetail/**", "link");
|
filterChainDefinitionMap.put("/api/link/viewDetail/**", "link");
|
||||||
|
|
||||||
|
|
||||||
filterChainDefinitionMap.put("/**", "authc");
|
filterChainDefinitionMap.put("/**", "authc");
|
||||||
|
|
||||||
filterChainDefinitionMap.put("/**", "jwt");
|
filterChainDefinitionMap.put("/**", "jwt");
|
||||||
|
@ -12,8 +12,39 @@
|
|||||||
<select id="search" resultMap="BaseResultMapDTO">
|
<select id="search" resultMap="BaseResultMapDTO">
|
||||||
select
|
select
|
||||||
id, `name`, ifnull(pid,0) as pid, `level`, `type`, create_by, create_time,`name` as label,
|
id, `name`, ifnull(pid,0) as pid, `level`, `type`, create_by, create_time,`name` as label,
|
||||||
get_auths(id,'chart',#{userId}) as `privileges`
|
authInfo.privileges as `privileges`
|
||||||
from (select GET_V_AUTH_MODEL_ID_P_USE (#{userId}, 'chart') cids) t,chart_group
|
from (select GET_V_AUTH_MODEL_ID_P_USE (#{userId}, 'chart') cids) t,chart_group
|
||||||
|
left join (
|
||||||
|
SELECT
|
||||||
|
auth_source,
|
||||||
|
group_concat( DISTINCT sys_auth_detail.privilege_extend ) as `privileges`
|
||||||
|
FROM
|
||||||
|
(
|
||||||
|
`sys_auth`
|
||||||
|
LEFT JOIN `sys_auth_detail` ON ((
|
||||||
|
`sys_auth`.`id` = `sys_auth_detail`.`auth_id`
|
||||||
|
)))
|
||||||
|
WHERE
|
||||||
|
sys_auth_detail.privilege_value = 1
|
||||||
|
AND sys_auth.auth_source_type = 'chart'
|
||||||
|
AND (
|
||||||
|
(
|
||||||
|
sys_auth.auth_target_type = 'dept'
|
||||||
|
AND sys_auth.auth_target IN ( SELECT dept_id FROM sys_user WHERE user_id = #{userId} )
|
||||||
|
)
|
||||||
|
OR (
|
||||||
|
sys_auth.auth_target_type = 'user'
|
||||||
|
AND sys_auth.auth_target = #{userId}
|
||||||
|
)
|
||||||
|
OR (
|
||||||
|
sys_auth.auth_target_type = 'role'
|
||||||
|
AND sys_auth.auth_target IN ( SELECT role_id FROM sys_users_roles WHERE user_id = #{userId} )
|
||||||
|
)
|
||||||
|
)
|
||||||
|
GROUP BY
|
||||||
|
`sys_auth`.`auth_source`
|
||||||
|
) authInfo
|
||||||
|
on chart_group.id = authInfo.auth_source
|
||||||
<where>
|
<where>
|
||||||
FIND_IN_SET(chart_group.id,cids)
|
FIND_IN_SET(chart_group.id,cids)
|
||||||
<if test="id != null">
|
<if test="id != null">
|
||||||
|
@ -32,8 +32,39 @@
|
|||||||
select
|
select
|
||||||
id, `name`, scene_id, table_id, `type`, title, create_by, create_time, update_time,
|
id, `name`, scene_id, table_id, `type`, title, create_by, create_time, update_time,
|
||||||
style_priority,x_axis, y_axis, custom_attr, custom_style, custom_filter, snapshot,
|
style_priority,x_axis, y_axis, custom_attr, custom_style, custom_filter, snapshot,
|
||||||
get_auths(id,'chart',#{userId}) as `privileges`
|
authInfo.privileges as `privileges`
|
||||||
from (select GET_V_AUTH_MODEL_ID_P_USE (#{userId}, 'chart') cids) t,chart_view
|
from (select GET_V_AUTH_MODEL_ID_P_USE (#{userId}, 'chart') cids) t,chart_view
|
||||||
|
left join (
|
||||||
|
SELECT
|
||||||
|
auth_source,
|
||||||
|
group_concat( DISTINCT sys_auth_detail.privilege_extend ) as `privileges`
|
||||||
|
FROM
|
||||||
|
(
|
||||||
|
`sys_auth`
|
||||||
|
LEFT JOIN `sys_auth_detail` ON ((
|
||||||
|
`sys_auth`.`id` = `sys_auth_detail`.`auth_id`
|
||||||
|
)))
|
||||||
|
WHERE
|
||||||
|
sys_auth_detail.privilege_value = 1
|
||||||
|
AND sys_auth.auth_source_type = 'chart'
|
||||||
|
AND (
|
||||||
|
(
|
||||||
|
sys_auth.auth_target_type = 'dept'
|
||||||
|
AND sys_auth.auth_target IN ( SELECT dept_id FROM sys_user WHERE user_id = #{userId} )
|
||||||
|
)
|
||||||
|
OR (
|
||||||
|
sys_auth.auth_target_type = 'user'
|
||||||
|
AND sys_auth.auth_target = #{userId}
|
||||||
|
)
|
||||||
|
OR (
|
||||||
|
sys_auth.auth_target_type = 'role'
|
||||||
|
AND sys_auth.auth_target IN ( SELECT role_id FROM sys_users_roles WHERE user_id = #{userId} )
|
||||||
|
)
|
||||||
|
)
|
||||||
|
GROUP BY
|
||||||
|
`sys_auth`.`auth_source`
|
||||||
|
) authInfo
|
||||||
|
on chart_view.id = authInfo.auth_source
|
||||||
<where>
|
<where>
|
||||||
FIND_IN_SET(chart_view.id,cids)
|
FIND_IN_SET(chart_view.id,cids)
|
||||||
<if test="sceneId != null">
|
<if test="sceneId != null">
|
||||||
|
@ -12,8 +12,39 @@
|
|||||||
<select id="search" resultMap="BaseResultMapDTO">
|
<select id="search" resultMap="BaseResultMapDTO">
|
||||||
select
|
select
|
||||||
id, `name`, ifnull(pid,0) as pid, `level`, `type`, create_by, create_time,`name` as label,
|
id, `name`, ifnull(pid,0) as pid, `level`, `type`, create_by, create_time,`name` as label,
|
||||||
get_auths(id,'dataset',#{userId}) as `privileges`
|
authInfo.privileges as `privileges`
|
||||||
from (select GET_V_AUTH_MODEL_ID_P_USE (#{userId}, 'dataset') cids) t,dataset_group
|
from (select GET_V_AUTH_MODEL_ID_P_USE (#{userId}, 'dataset') cids) t,dataset_group
|
||||||
|
left join (
|
||||||
|
SELECT
|
||||||
|
auth_source,
|
||||||
|
group_concat( DISTINCT sys_auth_detail.privilege_extend ) as `privileges`
|
||||||
|
FROM
|
||||||
|
(
|
||||||
|
`sys_auth`
|
||||||
|
LEFT JOIN `sys_auth_detail` ON ((
|
||||||
|
`sys_auth`.`id` = `sys_auth_detail`.`auth_id`
|
||||||
|
)))
|
||||||
|
WHERE
|
||||||
|
sys_auth_detail.privilege_value = 1
|
||||||
|
AND sys_auth.auth_source_type = 'dataset'
|
||||||
|
AND (
|
||||||
|
(
|
||||||
|
sys_auth.auth_target_type = 'dept'
|
||||||
|
AND sys_auth.auth_target IN ( SELECT dept_id FROM sys_user WHERE user_id = #{userId} )
|
||||||
|
)
|
||||||
|
OR (
|
||||||
|
sys_auth.auth_target_type = 'user'
|
||||||
|
AND sys_auth.auth_target = #{userId}
|
||||||
|
)
|
||||||
|
OR (
|
||||||
|
sys_auth.auth_target_type = 'role'
|
||||||
|
AND sys_auth.auth_target IN ( SELECT role_id FROM sys_users_roles WHERE user_id = #{userId} )
|
||||||
|
)
|
||||||
|
)
|
||||||
|
GROUP BY
|
||||||
|
`sys_auth`.`auth_source`
|
||||||
|
) authInfo
|
||||||
|
on dataset_group.id = authInfo.auth_source
|
||||||
<where>
|
<where>
|
||||||
FIND_IN_SET(dataset_group.id,cids)
|
FIND_IN_SET(dataset_group.id,cids)
|
||||||
<if test="id != null">
|
<if test="id != null">
|
||||||
|
@ -38,8 +38,39 @@
|
|||||||
<select id="search" resultMap="BaseResultMapDTO">
|
<select id="search" resultMap="BaseResultMapDTO">
|
||||||
select
|
select
|
||||||
id, `name`, scene_id, data_source_id, `type`, `mode`,`info`, create_by, create_time,
|
id, `name`, scene_id, data_source_id, `type`, `mode`,`info`, create_by, create_time,
|
||||||
get_auths(id,'dataset',#{userId}) as `privileges`
|
authInfo.privileges as `privileges`
|
||||||
from (select GET_V_AUTH_MODEL_ID_P_USE (#{userId}, 'dataset') cids) t,dataset_table
|
from (select GET_V_AUTH_MODEL_ID_P_USE (#{userId}, 'dataset') cids) t,dataset_table
|
||||||
|
left join (
|
||||||
|
SELECT
|
||||||
|
auth_source,
|
||||||
|
group_concat( DISTINCT sys_auth_detail.privilege_extend ) as `privileges`
|
||||||
|
FROM
|
||||||
|
(
|
||||||
|
`sys_auth`
|
||||||
|
LEFT JOIN `sys_auth_detail` ON ((
|
||||||
|
`sys_auth`.`id` = `sys_auth_detail`.`auth_id`
|
||||||
|
)))
|
||||||
|
WHERE
|
||||||
|
sys_auth_detail.privilege_value = 1
|
||||||
|
AND sys_auth.auth_source_type = 'dataset'
|
||||||
|
AND (
|
||||||
|
(
|
||||||
|
sys_auth.auth_target_type = 'dept'
|
||||||
|
AND sys_auth.auth_target IN ( SELECT dept_id FROM sys_user WHERE user_id = #{userId} )
|
||||||
|
)
|
||||||
|
OR (
|
||||||
|
sys_auth.auth_target_type = 'user'
|
||||||
|
AND sys_auth.auth_target = #{userId}
|
||||||
|
)
|
||||||
|
OR (
|
||||||
|
sys_auth.auth_target_type = 'role'
|
||||||
|
AND sys_auth.auth_target IN ( SELECT role_id FROM sys_users_roles WHERE user_id = #{userId} )
|
||||||
|
)
|
||||||
|
)
|
||||||
|
GROUP BY
|
||||||
|
`sys_auth`.`auth_source`
|
||||||
|
) authInfo
|
||||||
|
on dataset_table.id = authInfo.auth_source
|
||||||
<where>
|
<where>
|
||||||
FIND_IN_SET(dataset_table.id,cids)
|
FIND_IN_SET(dataset_table.id,cids)
|
||||||
<if test="sceneId != null">
|
<if test="sceneId != null">
|
||||||
|
@ -9,8 +9,39 @@
|
|||||||
|
|
||||||
<select id="query" parameterType="io.dataease.base.mapper.ext.query.GridExample" resultMap="BaseResultMapDTO">
|
<select id="query" parameterType="io.dataease.base.mapper.ext.query.GridExample" resultMap="BaseResultMapDTO">
|
||||||
select id , name , `desc` ,`type` , configuration ,create_time ,update_time,
|
select id , name , `desc` ,`type` , configuration ,create_time ,update_time,
|
||||||
get_auths(id,'link',#{extendCondition}) as `privileges`
|
authInfo.privileges as `privileges`
|
||||||
from (select GET_V_AUTH_MODEL_ID_P_USE (#{extendCondition}, 'link') cids) t,datasource
|
from (select GET_V_AUTH_MODEL_ID_P_USE (#{extendCondition}, 'link') cids) t,datasource
|
||||||
|
left join (
|
||||||
|
SELECT
|
||||||
|
auth_source,
|
||||||
|
group_concat( DISTINCT sys_auth_detail.privilege_extend ) as `privileges`
|
||||||
|
FROM
|
||||||
|
(
|
||||||
|
`sys_auth`
|
||||||
|
LEFT JOIN `sys_auth_detail` ON ((
|
||||||
|
`sys_auth`.`id` = `sys_auth_detail`.`auth_id`
|
||||||
|
)))
|
||||||
|
WHERE
|
||||||
|
sys_auth_detail.privilege_value = 1
|
||||||
|
AND sys_auth.auth_source_type = 'link'
|
||||||
|
AND (
|
||||||
|
(
|
||||||
|
sys_auth.auth_target_type = 'dept'
|
||||||
|
AND sys_auth.auth_target IN ( SELECT dept_id FROM sys_user WHERE user_id = #{extendCondition} )
|
||||||
|
)
|
||||||
|
OR (
|
||||||
|
sys_auth.auth_target_type = 'user'
|
||||||
|
AND sys_auth.auth_target = #{extendCondition}
|
||||||
|
)
|
||||||
|
OR (
|
||||||
|
sys_auth.auth_target_type = 'role'
|
||||||
|
AND sys_auth.auth_target IN ( SELECT role_id FROM sys_users_roles WHERE user_id = #{extendCondition} )
|
||||||
|
)
|
||||||
|
)
|
||||||
|
GROUP BY
|
||||||
|
`sys_auth`.`auth_source`
|
||||||
|
) authInfo
|
||||||
|
on datasource.id = authInfo.auth_source
|
||||||
<if test="_parameter != null">
|
<if test="_parameter != null">
|
||||||
<include refid="io.dataease.base.mapper.ext.query.GridSql.gridCondition" />
|
<include refid="io.dataease.base.mapper.ext.query.GridSql.gridCondition" />
|
||||||
</if>
|
</if>
|
||||||
@ -25,8 +56,39 @@
|
|||||||
|
|
||||||
<select id="queryUnion" resultMap="BaseResultMapDTO">
|
<select id="queryUnion" resultMap="BaseResultMapDTO">
|
||||||
select id , name , `desc` ,`type` , configuration ,create_time ,update_time, status,
|
select id , name , `desc` ,`type` , configuration ,create_time ,update_time, status,
|
||||||
get_auths(id,'link',#{userId}) as `privileges`
|
authInfo.privileges as `privileges`
|
||||||
from (select GET_V_AUTH_MODEL_ID_P_USE (#{userId}, 'link') cids) t,datasource
|
from (select GET_V_AUTH_MODEL_ID_P_USE (#{userId}, 'link') cids) t,datasource
|
||||||
|
left join (
|
||||||
|
SELECT
|
||||||
|
auth_source,
|
||||||
|
group_concat( DISTINCT sys_auth_detail.privilege_extend ) as `privileges`
|
||||||
|
FROM
|
||||||
|
(
|
||||||
|
`sys_auth`
|
||||||
|
LEFT JOIN `sys_auth_detail` ON ((
|
||||||
|
`sys_auth`.`id` = `sys_auth_detail`.`auth_id`
|
||||||
|
)))
|
||||||
|
WHERE
|
||||||
|
sys_auth_detail.privilege_value = 1
|
||||||
|
AND sys_auth.auth_source_type = 'chart'
|
||||||
|
AND (
|
||||||
|
(
|
||||||
|
sys_auth.auth_target_type = 'dept'
|
||||||
|
AND sys_auth.auth_target IN ( SELECT dept_id FROM sys_user WHERE user_id = #{userId} )
|
||||||
|
)
|
||||||
|
OR (
|
||||||
|
sys_auth.auth_target_type = 'user'
|
||||||
|
AND sys_auth.auth_target = #{userId}
|
||||||
|
)
|
||||||
|
OR (
|
||||||
|
sys_auth.auth_target_type = 'role'
|
||||||
|
AND sys_auth.auth_target IN ( SELECT role_id FROM sys_users_roles WHERE user_id = #{userId} )
|
||||||
|
)
|
||||||
|
)
|
||||||
|
GROUP BY
|
||||||
|
`sys_auth`.`auth_source`
|
||||||
|
) authInfo
|
||||||
|
on datasource.id = authInfo.auth_source
|
||||||
<where>
|
<where>
|
||||||
FIND_IN_SET(datasource.id,cids)
|
FIND_IN_SET(datasource.id,cids)
|
||||||
<if test="id != null">
|
<if test="id != null">
|
||||||
|
@ -30,10 +30,41 @@
|
|||||||
panel_group.`source`,
|
panel_group.`source`,
|
||||||
panel_group.`panel_type`,
|
panel_group.`panel_type`,
|
||||||
sourcePanelGroup.`name` as source_panel_name,
|
sourcePanelGroup.`name` as source_panel_name,
|
||||||
get_auths(panel_group.id,'panel',#{userId}) as `privileges`
|
authInfo.privileges as `privileges`
|
||||||
from (select GET_V_AUTH_MODEL_ID_P_USE (#{userId}, 'panel') cids) t,panel_group
|
from (select GET_V_AUTH_MODEL_ID_P_USE (#{userId}, 'panel') cids) t,panel_group
|
||||||
LEFT JOIN (select id,`name` from panel_group) sourcePanelGroup
|
LEFT JOIN panel_group sourcePanelGroup
|
||||||
on sourcePanelGroup.id=panel_group.source
|
on sourcePanelGroup.id=panel_group.source
|
||||||
|
left join (
|
||||||
|
SELECT
|
||||||
|
auth_source,
|
||||||
|
group_concat( DISTINCT sys_auth_detail.privilege_extend ) as `privileges`
|
||||||
|
FROM
|
||||||
|
(
|
||||||
|
`sys_auth`
|
||||||
|
LEFT JOIN `sys_auth_detail` ON ((
|
||||||
|
`sys_auth`.`id` = `sys_auth_detail`.`auth_id`
|
||||||
|
)))
|
||||||
|
WHERE
|
||||||
|
sys_auth_detail.privilege_value = 1
|
||||||
|
AND sys_auth.auth_source_type = 'panel'
|
||||||
|
AND (
|
||||||
|
(
|
||||||
|
sys_auth.auth_target_type = 'dept'
|
||||||
|
AND sys_auth.auth_target IN ( SELECT dept_id FROM sys_user WHERE user_id = #{userId} )
|
||||||
|
)
|
||||||
|
OR (
|
||||||
|
sys_auth.auth_target_type = 'user'
|
||||||
|
AND sys_auth.auth_target = #{userId}
|
||||||
|
)
|
||||||
|
OR (
|
||||||
|
sys_auth.auth_target_type = 'role'
|
||||||
|
AND sys_auth.auth_target IN ( SELECT role_id FROM sys_users_roles WHERE user_id = #{userId} )
|
||||||
|
)
|
||||||
|
)
|
||||||
|
GROUP BY
|
||||||
|
`sys_auth`.`auth_source`
|
||||||
|
) authInfo
|
||||||
|
on panel_group.id = authInfo.auth_source
|
||||||
<where>
|
<where>
|
||||||
FIND_IN_SET(panel_group.id,cids)
|
FIND_IN_SET(panel_group.id,cids)
|
||||||
<if test="name != null">
|
<if test="name != null">
|
||||||
@ -78,10 +109,41 @@
|
|||||||
(case when ISNULL(defaultPanelGroup.id) then false else true end) is_default,
|
(case when ISNULL(defaultPanelGroup.id) then false else true end) is_default,
|
||||||
defaultPanelGroup.id as default_panel_id,
|
defaultPanelGroup.id as default_panel_id,
|
||||||
defaultPanelGroup.`name` as default_panel_name,
|
defaultPanelGroup.`name` as default_panel_name,
|
||||||
get_auths(panel_group.id,'panel',#{userId}) as `privileges`
|
authInfo.privileges as `privileges`
|
||||||
from (select GET_V_AUTH_MODEL_ID_P_USE (#{userId}, 'panel') cids) t,panel_group
|
from (select GET_V_AUTH_MODEL_ID_P_USE (#{userId}, 'panel') cids) t,panel_group
|
||||||
LEFT JOIN (select source,id,`name` from panel_group where source is not null) defaultPanelGroup
|
LEFT JOIN panel_group defaultPanelGroup
|
||||||
on defaultPanelGroup.source=panel_group.id
|
on defaultPanelGroup.source=panel_group.id and defaultPanelGroup.source is not null
|
||||||
|
left join (
|
||||||
|
SELECT
|
||||||
|
auth_source,
|
||||||
|
group_concat( DISTINCT sys_auth_detail.privilege_extend ) as `privileges`
|
||||||
|
FROM
|
||||||
|
(
|
||||||
|
`sys_auth`
|
||||||
|
LEFT JOIN `sys_auth_detail` ON ((
|
||||||
|
`sys_auth`.`id` = `sys_auth_detail`.`auth_id`
|
||||||
|
)))
|
||||||
|
WHERE
|
||||||
|
sys_auth_detail.privilege_value = 1
|
||||||
|
AND sys_auth.auth_source_type = 'panel'
|
||||||
|
AND (
|
||||||
|
(
|
||||||
|
sys_auth.auth_target_type = 'dept'
|
||||||
|
AND sys_auth.auth_target IN ( SELECT dept_id FROM sys_user WHERE user_id = #{userId} )
|
||||||
|
)
|
||||||
|
OR (
|
||||||
|
sys_auth.auth_target_type = 'user'
|
||||||
|
AND sys_auth.auth_target = #{userId}
|
||||||
|
)
|
||||||
|
OR (
|
||||||
|
sys_auth.auth_target_type = 'role'
|
||||||
|
AND sys_auth.auth_target IN ( SELECT role_id FROM sys_users_roles WHERE user_id = #{userId} )
|
||||||
|
)
|
||||||
|
)
|
||||||
|
GROUP BY
|
||||||
|
`sys_auth`.`auth_source`
|
||||||
|
) authInfo
|
||||||
|
on panel_group.id = authInfo.auth_source
|
||||||
<where>
|
<where>
|
||||||
FIND_IN_SET(panel_group.id,cids)
|
FIND_IN_SET(panel_group.id,cids)
|
||||||
<if test="name != null">
|
<if test="name != null">
|
||||||
|
@ -7,6 +7,7 @@ import io.dataease.base.domain.Datasource;
|
|||||||
import io.dataease.commons.utils.AuthUtils;
|
import io.dataease.commons.utils.AuthUtils;
|
||||||
import io.dataease.commons.utils.PageUtils;
|
import io.dataease.commons.utils.PageUtils;
|
||||||
import io.dataease.commons.utils.Pager;
|
import io.dataease.commons.utils.Pager;
|
||||||
|
import io.dataease.controller.ResultHolder;
|
||||||
import io.dataease.controller.request.DatasourceUnionRequest;
|
import io.dataease.controller.request.DatasourceUnionRequest;
|
||||||
import io.dataease.controller.sys.base.BaseGridRequest;
|
import io.dataease.controller.sys.base.BaseGridRequest;
|
||||||
import io.dataease.datasource.dto.DBTableDTO;
|
import io.dataease.datasource.dto.DBTableDTO;
|
||||||
@ -37,10 +38,17 @@ public class DatasourceController {
|
|||||||
|
|
||||||
@ApiOperation("验证数据源")
|
@ApiOperation("验证数据源")
|
||||||
@PostMapping("/validate")
|
@PostMapping("/validate")
|
||||||
public void validate(@RequestBody Datasource datasource) throws Exception {
|
public ResultHolder validate(@RequestBody Datasource datasource) throws Exception {
|
||||||
datasourceService.validate(datasource);
|
return datasourceService.validate(datasource);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation("验证数据源")
|
||||||
|
@GetMapping("/validate/{datasourceId}")
|
||||||
|
public ResultHolder validate(@PathVariable String datasourceId) {
|
||||||
|
return datasourceService.validate(datasourceId);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@ApiOperation("查询当前用户数据源")
|
@ApiOperation("查询当前用户数据源")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public List<DatasourceDTO> getDatasourceList() throws Exception {
|
public List<DatasourceDTO> getDatasourceList() throws Exception {
|
||||||
|
@ -9,6 +9,7 @@ import io.dataease.commons.exception.DEException;
|
|||||||
import io.dataease.commons.utils.AuthUtils;
|
import io.dataease.commons.utils.AuthUtils;
|
||||||
import io.dataease.commons.utils.CommonThreadPool;
|
import io.dataease.commons.utils.CommonThreadPool;
|
||||||
import io.dataease.commons.utils.LogUtil;
|
import io.dataease.commons.utils.LogUtil;
|
||||||
|
import io.dataease.controller.ResultHolder;
|
||||||
import io.dataease.controller.request.DatasourceUnionRequest;
|
import io.dataease.controller.request.DatasourceUnionRequest;
|
||||||
import io.dataease.controller.sys.base.BaseGridRequest;
|
import io.dataease.controller.sys.base.BaseGridRequest;
|
||||||
import io.dataease.controller.sys.base.ConditionEntity;
|
import io.dataease.controller.sys.base.ConditionEntity;
|
||||||
@ -119,20 +120,39 @@ public class DatasourceService {
|
|||||||
checkAndUpdateDatasourceStatus(datasource);
|
checkAndUpdateDatasourceStatus(datasource);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void validate(Datasource datasource) throws Exception {
|
public ResultHolder validate(Datasource datasource) throws Exception {
|
||||||
|
try {
|
||||||
DatasourceProvider datasourceProvider = ProviderFactory.getProvider(datasource.getType());
|
DatasourceProvider datasourceProvider = ProviderFactory.getProvider(datasource.getType());
|
||||||
DatasourceRequest datasourceRequest = new DatasourceRequest();
|
DatasourceRequest datasourceRequest = new DatasourceRequest();
|
||||||
datasourceRequest.setDatasource(datasource);
|
datasourceRequest.setDatasource(datasource);
|
||||||
datasourceProvider.checkStatus(datasourceRequest);
|
datasourceProvider.checkStatus(datasourceRequest);
|
||||||
|
return ResultHolder.success("Success");
|
||||||
|
}catch (Exception e){
|
||||||
|
return ResultHolder.error("Datasource is invalid: " + e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void validate(String datasourceId) throws Exception {
|
|
||||||
if(StringUtils.isEmpty(datasourceId)){
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ResultHolder validate(String datasourceId) {
|
||||||
Datasource datasource = datasourceMapper.selectByPrimaryKey(datasourceId);
|
Datasource datasource = datasourceMapper.selectByPrimaryKey(datasourceId);
|
||||||
validate(datasource);
|
if(datasource == null){
|
||||||
|
return ResultHolder.error("Can not find datasource: "+ datasourceId);
|
||||||
}
|
}
|
||||||
|
try {
|
||||||
|
DatasourceProvider datasourceProvider = ProviderFactory.getProvider(datasource.getType());
|
||||||
|
DatasourceRequest datasourceRequest = new DatasourceRequest();
|
||||||
|
datasourceRequest.setDatasource(datasource);
|
||||||
|
datasourceProvider.checkStatus(datasourceRequest);
|
||||||
|
datasource.setStatus("Success");
|
||||||
|
return ResultHolder.success("Success");
|
||||||
|
}catch (Exception e){
|
||||||
|
datasource.setStatus("Error");
|
||||||
|
return ResultHolder.error("Datasource is invalid: " + e.getMessage());
|
||||||
|
}finally {
|
||||||
|
datasourceMapper.updateByPrimaryKey(datasource);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public List<String> getSchema(Datasource datasource) throws Exception {
|
public List<String> getSchema(Datasource datasource) throws Exception {
|
||||||
DatasourceProvider datasourceProvider = ProviderFactory.getProvider(datasource.getType());
|
DatasourceProvider datasourceProvider = ProviderFactory.getProvider(datasource.getType());
|
||||||
DatasourceRequest datasourceRequest = new DatasourceRequest();
|
DatasourceRequest datasourceRequest = new DatasourceRequest();
|
||||||
|
@ -464,6 +464,7 @@ public class ExtractDataService {
|
|||||||
Column_Fields = Column_Fields + "varchar(lenth)".replace("lenth", String.valueOf(size)) + ",`";
|
Column_Fields = Column_Fields + "varchar(lenth)".replace("lenth", String.valueOf(size)) + ",`";
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
|
size = size < 50? 50 : size;
|
||||||
Column_Fields = Column_Fields + "varchar(lenth)".replace("lenth", String.valueOf(size)) + ",`";
|
Column_Fields = Column_Fields + "varchar(lenth)".replace("lenth", String.valueOf(size)) + ",`";
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
@ -571,7 +572,9 @@ public class ExtractDataService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void extractData(DatasetTable datasetTable, String extractType) throws Exception {
|
private void extractData(DatasetTable datasetTable, String extractType) throws Exception {
|
||||||
|
if(StringUtils.isNotEmpty(datasetTable.getDataSourceId())){
|
||||||
datasourceService.validate(datasetTable.getDataSourceId());
|
datasourceService.validate(datasetTable.getDataSourceId());
|
||||||
|
}
|
||||||
KettleFileRepository repository = CommonBeanFactory.getBean(KettleFileRepository.class);
|
KettleFileRepository repository = CommonBeanFactory.getBean(KettleFileRepository.class);
|
||||||
RepositoryDirectoryInterface repositoryDirectoryInterface = repository.loadRepositoryDirectoryTree();
|
RepositoryDirectoryInterface repositoryDirectoryInterface = repository.loadRepositoryDirectoryTree();
|
||||||
TransMeta transMeta = null;
|
TransMeta transMeta = null;
|
||||||
|
@ -50,6 +50,14 @@ export function validateDs(data) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function validateDsById(datasourceId) {
|
||||||
|
return request({
|
||||||
|
url: 'datasource/validate/' + datasourceId,
|
||||||
|
method: 'get',
|
||||||
|
loading: true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
export function getSchema(data) {
|
export function getSchema(data) {
|
||||||
return request({
|
return request({
|
||||||
url: 'datasource/getSchema/',
|
url: 'datasource/getSchema/',
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
@mouseenter="enter"
|
@mouseenter="enter"
|
||||||
@mouseleave="leave"
|
@mouseleave="leave"
|
||||||
>
|
>
|
||||||
<edit-bar v-if="active||linkageSettingStatus" :active-model="'edit'" :element="element" @showViewDetails="showViewDetails" />
|
<edit-bar style="transform: translateZ(10px)" v-if="active||linkageSettingStatus" :active-model="'edit'" :element="element" @showViewDetails="showViewDetails" />
|
||||||
<div
|
<div
|
||||||
v-for="(handlei, indexi) in actualHandles"
|
v-for="(handlei, indexi) in actualHandles"
|
||||||
:key="indexi"
|
:key="indexi"
|
||||||
@ -1566,6 +1566,7 @@ export default {
|
|||||||
.vdr {
|
.vdr {
|
||||||
touch-action: none;
|
touch-action: none;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
transform-style:preserve-3d;
|
||||||
border: 1px
|
border: 1px
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -84,7 +84,7 @@ export default {
|
|||||||
componentDataShow: [],
|
componentDataShow: [],
|
||||||
mainWidth: '100%',
|
mainWidth: '100%',
|
||||||
mainHeight: '100%',
|
mainHeight: '100%',
|
||||||
searchCount: -1,
|
searchCount: 0,
|
||||||
chartDetailsVisible: false,
|
chartDetailsVisible: false,
|
||||||
showChartInfo: {},
|
showChartInfo: {},
|
||||||
showChartTableInfo: {}
|
showChartTableInfo: {}
|
||||||
|
@ -3,7 +3,12 @@
|
|||||||
v-if="showDrag"
|
v-if="showDrag"
|
||||||
id="editor"
|
id="editor"
|
||||||
class="editor"
|
class="editor"
|
||||||
:class="{ edit: isEdit }"
|
:class="[
|
||||||
|
{
|
||||||
|
['edit']: isEdit ,
|
||||||
|
['parent_transform']:!chartDetailsVisible
|
||||||
|
}
|
||||||
|
]"
|
||||||
:style="customStyle"
|
:style="customStyle"
|
||||||
@mousedown="handleMouseDown"
|
@mousedown="handleMouseDown"
|
||||||
>
|
>
|
||||||
@ -167,6 +172,7 @@ export default {
|
|||||||
props: {
|
props: {
|
||||||
isEdit: {
|
isEdit: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
|
require: false,
|
||||||
default: true
|
default: true
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -637,11 +643,16 @@ export default {
|
|||||||
/*background: #fff;*/
|
/*background: #fff;*/
|
||||||
margin: auto;
|
margin: auto;
|
||||||
background-size:100% 100% !important;
|
background-size:100% 100% !important;
|
||||||
|
/*transform-style:preserve-3d;*/
|
||||||
.lock {
|
.lock {
|
||||||
opacity: .5;
|
opacity: .5;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.parent_transform {
|
||||||
|
//transform transform 会使z-index 失效;为了使编辑仪表板时 按钮一直在上面 采用transform-style 的方式
|
||||||
|
// transform-style 会导致 dialog 遮罩有问题 此处暂时用这个样式做控制
|
||||||
|
transform-style:preserve-3d;
|
||||||
|
}
|
||||||
.edit {
|
.edit {
|
||||||
outline: 1px solid gainsboro;
|
outline: 1px solid gainsboro;
|
||||||
.component {
|
.component {
|
||||||
|
@ -847,7 +847,8 @@ export default {
|
|||||||
height: 'Height',
|
height: 'Height',
|
||||||
system_case: 'System',
|
system_case: 'System',
|
||||||
custom_case: 'Custom',
|
custom_case: 'Custom',
|
||||||
last_layer: 'This Is The Last Layer'
|
last_layer: 'This Is The Last Layer',
|
||||||
|
radar_size: 'Size'
|
||||||
},
|
},
|
||||||
dataset: {
|
dataset: {
|
||||||
sheet_warn: 'There are multiple sheet pages, and the first one is extracted by default',
|
sheet_warn: 'There are multiple sheet pages, and the first one is extracted by default',
|
||||||
@ -1217,7 +1218,8 @@ export default {
|
|||||||
remove_all_linkage: 'Remove All Linkage',
|
remove_all_linkage: 'Remove All Linkage',
|
||||||
exit_un_march_linkage_field: 'Exit Un March Linkage Field',
|
exit_un_march_linkage_field: 'Exit Un March Linkage Field',
|
||||||
details: 'Details',
|
details: 'Details',
|
||||||
setting: 'Setting'
|
setting: 'Setting',
|
||||||
|
no_drill_field: 'Miss relation field'
|
||||||
},
|
},
|
||||||
plugin: {
|
plugin: {
|
||||||
local_install: 'Local installation',
|
local_install: 'Local installation',
|
||||||
|
@ -717,8 +717,8 @@ export default {
|
|||||||
area_mode: '面積',
|
area_mode: '面積',
|
||||||
rose_radius: '園角',
|
rose_radius: '園角',
|
||||||
view_name: '視圖標題',
|
view_name: '視圖標題',
|
||||||
belong_group: '所属分组',
|
belong_group: '所屬分組',
|
||||||
select_group: '选择分组',
|
select_group: '選擇分組',
|
||||||
name_can_not_empty: '名稱不能為空',
|
name_can_not_empty: '名稱不能為空',
|
||||||
template_can_not_empty: '請選擇儀表板',
|
template_can_not_empty: '請選擇儀表板',
|
||||||
custom_count: '記錄數',
|
custom_count: '記錄數',
|
||||||
@ -812,8 +812,8 @@ export default {
|
|||||||
color_red: '火紅',
|
color_red: '火紅',
|
||||||
color_fast: '輕快',
|
color_fast: '輕快',
|
||||||
color_spiritual: '靈動',
|
color_spiritual: '靈動',
|
||||||
chart_details: '视图明细',
|
chart_details: '視圖明細',
|
||||||
export_details: '导出明细',
|
export_details: '導出明細',
|
||||||
chart_data: '數據',
|
chart_data: '數據',
|
||||||
chart_style: '樣式',
|
chart_style: '樣式',
|
||||||
drag_block_type_axis: '類別軸',
|
drag_block_type_axis: '類別軸',
|
||||||
@ -846,7 +846,8 @@ export default {
|
|||||||
height: '高度',
|
height: '高度',
|
||||||
system_case: '系統方案',
|
system_case: '系統方案',
|
||||||
custom_case: '自定義',
|
custom_case: '自定義',
|
||||||
last_layer: '当前已经是最后一级'
|
last_layer: '當前已經是最後一級',
|
||||||
|
radar_size: '大小'
|
||||||
},
|
},
|
||||||
dataset: {
|
dataset: {
|
||||||
sheet_warn: '有多個sheet頁面,默認抽取第一個',
|
sheet_warn: '有多個sheet頁面,默認抽取第一個',
|
||||||
@ -988,7 +989,7 @@ export default {
|
|||||||
dataset: '數據集',
|
dataset: '數據集',
|
||||||
search_by_name: '根據名稱搜索',
|
search_by_name: '根據名稱搜索',
|
||||||
underway: '等待執行',
|
underway: '等待執行',
|
||||||
stopped: '執行结束',
|
stopped: '執行結束',
|
||||||
pending: '暫停',
|
pending: '暫停',
|
||||||
exec: '執行一次',
|
exec: '執行一次',
|
||||||
confirm_exec: '手動觸發執行?',
|
confirm_exec: '手動觸發執行?',
|
||||||
@ -1003,7 +1004,7 @@ export default {
|
|||||||
can_not_union_diff_datasource: '被關聯數據集必須與當前數據集的數據源一致',
|
can_not_union_diff_datasource: '被關聯數據集必須與當前數據集的數據源一致',
|
||||||
operator: '操作',
|
operator: '操作',
|
||||||
d_q_trans: '維度/指標轉換',
|
d_q_trans: '維度/指標轉換',
|
||||||
add_calc_field: '新建计算字段',
|
add_calc_field: '新建計算字段',
|
||||||
input_name: '請輸入名稱',
|
input_name: '請輸入名稱',
|
||||||
field_exp: '字段表達式',
|
field_exp: '字段表達式',
|
||||||
data_type: '數據類型',
|
data_type: '數據類型',
|
||||||
@ -1168,7 +1169,7 @@ export default {
|
|||||||
bottomComponent: '置底',
|
bottomComponent: '置底',
|
||||||
upComponent: '上移',
|
upComponent: '上移',
|
||||||
downComponent: '下移',
|
downComponent: '下移',
|
||||||
linkage_setting: '联动设置',
|
linkage_setting: '聯動設置',
|
||||||
open_aided_design: '打開組件輔助設計',
|
open_aided_design: '打開組件輔助設計',
|
||||||
close_aided_design: '關閉組件輔助設計',
|
close_aided_design: '關閉組件輔助設計',
|
||||||
open_style_design: '打開樣式設計',
|
open_style_design: '打開樣式設計',
|
||||||
@ -1206,17 +1207,18 @@ export default {
|
|||||||
source_panel_name: '原儀表板名稱',
|
source_panel_name: '原儀表板名稱',
|
||||||
content_style: '內容樣式',
|
content_style: '內容樣式',
|
||||||
canvas_self_adaption: '自適應畫布區域',
|
canvas_self_adaption: '自適應畫布區域',
|
||||||
panel_save_tips: '仪表板已变动,是否保存?',
|
panel_save_tips: '儀表板已變動,是否保存?',
|
||||||
panel_save_warn_tips: '如果未保存,你对仪表板做的变更将会丢失!',
|
panel_save_warn_tips: '如果未保存,你對儀表板做的變更將會丟失!',
|
||||||
do_not_save: '不保存',
|
do_not_save: '不保存',
|
||||||
save: '保存',
|
save: '保存',
|
||||||
drill: '下钻',
|
drill: '下鑽',
|
||||||
linkage: '联动',
|
linkage: '聯動',
|
||||||
cancel_linkage: '取消联动',
|
cancel_linkage: '取消聯動',
|
||||||
remove_all_linkage: '清除所有联动',
|
remove_all_linkage: '清除所有聯動',
|
||||||
exit_un_march_linkage_field: '存在未匹配联动关系的字段',
|
exit_un_march_linkage_field: '存在未匹配聯動關系的字段',
|
||||||
details: '详情',
|
details: '詳情',
|
||||||
setting: '设置'
|
setting: '設置',
|
||||||
|
no_drill_field: '缺少關聯字段'
|
||||||
},
|
},
|
||||||
plugin: {
|
plugin: {
|
||||||
local_install: '本地安裝',
|
local_install: '本地安裝',
|
||||||
@ -1323,7 +1325,7 @@ export default {
|
|||||||
week_start: '從星期',
|
week_start: '從星期',
|
||||||
week_end: '至星期',
|
week_end: '至星期',
|
||||||
every_year: '每年',
|
every_year: '每年',
|
||||||
week_tips: '说明:1-7 分别对应 周日-周六',
|
week_tips: '說明:1-7 分別對應 周日-周六',
|
||||||
minute_limit: '分鐘不能小於1,大於59',
|
minute_limit: '分鐘不能小於1,大於59',
|
||||||
hour_limit: '小時不能小於1,大於523',
|
hour_limit: '小時不能小於1,大於523',
|
||||||
day_limit: '天不能小於1,大於531'
|
day_limit: '天不能小於1,大於531'
|
||||||
@ -1408,3 +1410,4 @@ export default {
|
|||||||
placeholder: '請選擇年份'
|
placeholder: '請選擇年份'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -846,7 +846,8 @@ export default {
|
|||||||
height: '高度',
|
height: '高度',
|
||||||
system_case: '系统方案',
|
system_case: '系统方案',
|
||||||
custom_case: '自定义',
|
custom_case: '自定义',
|
||||||
last_layer: '当前已经是最后一级'
|
last_layer: '当前已经是最后一级',
|
||||||
|
radar_size: '大小'
|
||||||
},
|
},
|
||||||
dataset: {
|
dataset: {
|
||||||
sheet_warn: '有多个 Sheet 页,默认抽取第一个',
|
sheet_warn: '有多个 Sheet 页,默认抽取第一个',
|
||||||
@ -1218,7 +1219,8 @@ export default {
|
|||||||
remove_all_linkage: '清除所有联动',
|
remove_all_linkage: '清除所有联动',
|
||||||
exit_un_march_linkage_field: '存在未匹配联动关系的字段',
|
exit_un_march_linkage_field: '存在未匹配联动关系的字段',
|
||||||
details: '详情',
|
details: '详情',
|
||||||
setting: '设置'
|
setting: '设置',
|
||||||
|
no_drill_field: '缺少关联字段'
|
||||||
},
|
},
|
||||||
plugin: {
|
plugin: {
|
||||||
local_install: '本地安装',
|
local_install: '本地安装',
|
||||||
|
@ -243,7 +243,7 @@ const data = {
|
|||||||
item.linkageFilters.splice(0, item.linkageFilters.length)
|
item.linkageFilters.splice(0, item.linkageFilters.length)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
state.styleChangeTimes++
|
// state.styleChangeTimes++
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
modules: {
|
modules: {
|
||||||
|
@ -25,6 +25,7 @@ export const DEFAULT_SIZE = {
|
|||||||
pieRoseRadius: 5,
|
pieRoseRadius: 5,
|
||||||
funnelWidth: 80,
|
funnelWidth: 80,
|
||||||
radarShape: 'polygon',
|
radarShape: 'polygon',
|
||||||
|
radarSize: 80,
|
||||||
tableTitleFontSize: 12,
|
tableTitleFontSize: 12,
|
||||||
tableItemFontSize: 12,
|
tableItemFontSize: 12,
|
||||||
tableTitleHeight: 36,
|
tableTitleHeight: 36,
|
||||||
|
@ -12,6 +12,7 @@ export function baseRadarOption(chart_option, chart) {
|
|||||||
// size
|
// size
|
||||||
if (customAttr.size) {
|
if (customAttr.size) {
|
||||||
chart_option.radar.shape = customAttr.size.radarShape
|
chart_option.radar.shape = customAttr.size.radarShape
|
||||||
|
chart_option.radar.radius = (customAttr.size.radarSize ? customAttr.size.radarSize : 80) + '%'
|
||||||
}
|
}
|
||||||
// tooltip
|
// tooltip
|
||||||
if (customAttr.tooltip) {
|
if (customAttr.tooltip) {
|
||||||
|
@ -216,6 +216,11 @@ export default {
|
|||||||
chart.resize()
|
chart.resize()
|
||||||
},
|
},
|
||||||
trackClick(trackAction) {
|
trackClick(trackAction) {
|
||||||
|
const param = this.pointParam
|
||||||
|
if (!param || !param.data || !param.data.dimensionList) {
|
||||||
|
this.$warning(this.$t('panel.no_drill_field'))
|
||||||
|
return
|
||||||
|
}
|
||||||
const linkageParam = {
|
const linkageParam = {
|
||||||
viewId: this.chart.id,
|
viewId: this.chart.id,
|
||||||
dimensionList: this.pointParam.data.dimensionList,
|
dimensionList: this.pointParam.data.dimensionList,
|
||||||
|
@ -78,6 +78,9 @@
|
|||||||
<el-radio-button label="circle">{{ $t('chart.circle') }}</el-radio-button>
|
<el-radio-button label="circle">{{ $t('chart.circle') }}</el-radio-button>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item :label="$t('chart.radar_size')" class="form-item form-item-slider">
|
||||||
|
<el-slider v-model="sizeForm.radarSize" show-input :show-input-controls="false" input-size="mini" :min="0" :max="100" @change="changeBarSizeCase" />
|
||||||
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<el-form v-show="chart.type && chart.type.includes('table')" ref="sizeFormPie" :disabled="param && !hasDataPermission('manage',param.privileges)" :model="sizeForm" label-width="100px" size="mini">
|
<el-form v-show="chart.type && chart.type.includes('table')" ref="sizeFormPie" :disabled="param && !hasDataPermission('manage',param.privileges)" :model="sizeForm" label-width="100px" size="mini">
|
||||||
@ -220,6 +223,7 @@ export default {
|
|||||||
this.sizeForm = customAttr.size
|
this.sizeForm = customAttr.size
|
||||||
this.sizeForm.treemapWidth = this.sizeForm.treemapWidth ? this.sizeForm.treemapWidth : 80
|
this.sizeForm.treemapWidth = this.sizeForm.treemapWidth ? this.sizeForm.treemapWidth : 80
|
||||||
this.sizeForm.treemapHeight = this.sizeForm.treemapHeight ? this.sizeForm.treemapHeight : 80
|
this.sizeForm.treemapHeight = this.sizeForm.treemapHeight ? this.sizeForm.treemapHeight : 80
|
||||||
|
this.sizeForm.radarSize = this.sizeForm.radarSize ? this.sizeForm.radarSize : 80
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -100,7 +100,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import LayoutContent from '@/components/business/LayoutContent'
|
import LayoutContent from '@/components/business/LayoutContent'
|
||||||
import { addDs, editDs, getSchema, validateDs } from '@/api/system/datasource'
|
import { addDs, editDs, getSchema, validateDs, validateDsById } from '@/api/system/datasource'
|
||||||
import { $confirm } from '@/utils/message'
|
import { $confirm } from '@/utils/message'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@ -276,9 +276,29 @@ export default {
|
|||||||
if (valid) {
|
if (valid) {
|
||||||
const data = JSON.parse(JSON.stringify(this.form))
|
const data = JSON.parse(JSON.stringify(this.form))
|
||||||
data.configuration = JSON.stringify(data.configuration)
|
data.configuration = JSON.stringify(data.configuration)
|
||||||
validateDs(data).then(res => {
|
if(data.showModel === 'show' && !this.canEdit){
|
||||||
|
validateDsById(data.id).then(res => {
|
||||||
|
if(res.success){
|
||||||
this.$success(this.$t('datasource.validate_success'))
|
this.$success(this.$t('datasource.validate_success'))
|
||||||
|
}else {
|
||||||
|
this.$error(this.$t(res.message))
|
||||||
|
}
|
||||||
|
this.refreshTree()
|
||||||
|
}).catch(res => {
|
||||||
|
this.$error(res.message)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
}else {
|
||||||
|
validateDs(data).then(res => {
|
||||||
|
if(res.success){
|
||||||
|
this.$success(this.$t('datasource.validate_success'))
|
||||||
|
}else {
|
||||||
|
this.$error(this.$t(res.message))
|
||||||
|
}
|
||||||
|
}).catch(res => {
|
||||||
|
this.$error(res.message)
|
||||||
|
})
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
@ -45,6 +45,7 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="$t('commons.role')" prop="roleIds">
|
<el-form-item :label="$t('commons.role')" prop="roleIds">
|
||||||
<el-select
|
<el-select
|
||||||
|
ref="roleSelect"
|
||||||
v-model="form.roleIds"
|
v-model="form.roleIds"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
:disabled="formType !== 'add' && form.isAdmin"
|
:disabled="formType !== 'add' && form.isAdmin"
|
||||||
@ -298,6 +299,7 @@ export default {
|
|||||||
this.$router.push({ name: 'system-user' })
|
this.$router.push({ name: 'system-user' })
|
||||||
},
|
},
|
||||||
filterData(instanceId) {
|
filterData(instanceId) {
|
||||||
|
this.$refs.roleSelect && this.$refs.roleSelect.blur && this.$refs.roleSelect.blur()
|
||||||
if (!this.depts) {
|
if (!this.depts) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user