forked from github/dataease
fix: 新建视图后权限问题
This commit is contained in:
parent
ce1cd9131c
commit
c6fd782d39
@ -12,6 +12,8 @@ import java.util.List;
|
|||||||
public interface ExtChartViewMapper {
|
public interface ExtChartViewMapper {
|
||||||
List<ChartViewDTO> search(ChartViewRequest request);
|
List<ChartViewDTO> search(ChartViewRequest request);
|
||||||
|
|
||||||
|
ChartViewDTO searchOne(ChartViewRequest request);
|
||||||
|
|
||||||
void chartCopy(@Param("newChartId")String newChartId,@Param("oldChartId")String oldChartId);
|
void chartCopy(@Param("newChartId")String newChartId,@Param("oldChartId")String oldChartId);
|
||||||
|
|
||||||
@Select("select id from chart_view where table_id = #{tableId}")
|
@Select("select id from chart_view where table_id = #{tableId}")
|
||||||
|
@ -8,6 +8,25 @@
|
|||||||
<result column="privileges" property="privileges"/>
|
<result column="privileges" property="privileges"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
|
<select id="searchOne" resultMap="BaseResultMapDTO">
|
||||||
|
select
|
||||||
|
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,
|
||||||
|
get_auths(id,'chart',#{userId}) as `privileges`
|
||||||
|
from (select GET_V_AUTH_MODEL_ID_P_USE (#{userId}, 'chart') cids) t,chart_view
|
||||||
|
<where>
|
||||||
|
FIND_IN_SET(chart_view.id,cids)
|
||||||
|
<if test="sceneId != null">
|
||||||
|
and scene_id = #{sceneId,jdbcType=VARCHAR}
|
||||||
|
</if>
|
||||||
|
<if test="id != null">
|
||||||
|
and id = #{id,jdbcType=VARCHAR}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
<if test="sort != null">
|
||||||
|
order by ${sort}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
<select id="search" resultMap="BaseResultMapDTO">
|
<select id="search" resultMap="BaseResultMapDTO">
|
||||||
select
|
select
|
||||||
|
@ -79,8 +79,7 @@ public class ChartViewService {
|
|||||||
Optional.ofNullable(chartView.getId()).ifPresent(id -> {
|
Optional.ofNullable(chartView.getId()).ifPresent(id -> {
|
||||||
CacheUtils.remove(JdbcConstants.VIEW_CACHE_KEY, id);
|
CacheUtils.remove(JdbcConstants.VIEW_CACHE_KEY, id);
|
||||||
});
|
});
|
||||||
|
return getOneWithPermission(chartView.getId());
|
||||||
return chartView;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<ChartViewDTO> list(ChartViewRequest chartViewRequest) {
|
public List<ChartViewDTO> list(ChartViewRequest chartViewRequest) {
|
||||||
@ -115,6 +114,13 @@ public class ChartViewService {
|
|||||||
return chartViewMapper.selectByPrimaryKey(id);
|
return chartViewMapper.selectByPrimaryKey(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ChartViewDTO getOneWithPermission(String id) {
|
||||||
|
ChartViewRequest chartViewRequest = new ChartViewRequest();
|
||||||
|
chartViewRequest.setId(id);
|
||||||
|
chartViewRequest.setUserId(String.valueOf(AuthUtils.getUser().getUserId()));
|
||||||
|
return extChartViewMapper.searchOne(chartViewRequest);
|
||||||
|
}
|
||||||
|
|
||||||
public void delete(String id) {
|
public void delete(String id) {
|
||||||
chartViewMapper.deleteByPrimaryKey(id);
|
chartViewMapper.deleteByPrimaryKey(id);
|
||||||
}
|
}
|
||||||
|
@ -679,7 +679,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
sceneClick(data, node) {
|
sceneClick(data, node) {
|
||||||
this.$emit('switchComponent', { name: 'ChartEdit', param: { 'id': data.id }})
|
this.$emit('switchComponent', { name: 'ChartEdit', param: data })
|
||||||
},
|
},
|
||||||
reviewChartList() {
|
reviewChartList() {
|
||||||
if (this.$store.state.chart.chartSceneData) {
|
if (this.$store.state.chart.chartSceneData) {
|
||||||
@ -753,7 +753,7 @@ export default {
|
|||||||
if (this.optFrom === 'panel') {
|
if (this.optFrom === 'panel') {
|
||||||
this.$emit('newViewInfo', { 'id': response.data.id })
|
this.$emit('newViewInfo', { 'id': response.data.id })
|
||||||
} else {
|
} else {
|
||||||
this.$emit('switchComponent', { name: 'ChartEdit', param: { 'id': response.data.id }})
|
this.$emit('switchComponent', { name: 'ChartEdit', param: response.data })
|
||||||
// this.$store.dispatch('chart/setViewId', response.data.id)
|
// this.$store.dispatch('chart/setViewId', response.data.id)
|
||||||
// this.chartTree()
|
// this.chartTree()
|
||||||
this.refreshNodeBy(view.sceneId)
|
this.refreshNodeBy(view.sceneId)
|
||||||
|
Loading…
Reference in New Issue
Block a user