提交 a5fccc34 authored 作者: taojinlong's avatar taojinlong

Merge branch 'v1.1' of github.com:dataease/dataease into v1.1

......@@ -12,6 +12,8 @@ import java.util.List;
public interface ExtChartViewMapper {
List<ChartViewDTO> search(ChartViewRequest request);
ChartViewDTO searchOne(ChartViewRequest request);
void chartCopy(@Param("newChartId")String newChartId,@Param("oldChartId")String oldChartId);
@Select("select id from chart_view where table_id = #{tableId}")
......
......@@ -8,6 +8,25 @@
<result column="privileges" property="privileges"/>
</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
......
......@@ -79,8 +79,7 @@ public class ChartViewService {
Optional.ofNullable(chartView.getId()).ifPresent(id -> {
CacheUtils.remove(JdbcConstants.VIEW_CACHE_KEY, id);
});
return chartView;
return getOneWithPermission(chartView.getId());
}
public List<ChartViewDTO> list(ChartViewRequest chartViewRequest) {
......@@ -115,6 +114,13 @@ public class ChartViewService {
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) {
chartViewMapper.deleteByPrimaryKey(id);
}
......
......@@ -138,6 +138,7 @@ export default {
methods: {
close() {
this.clearCanvas()
this.$emit('close-left-panel')
this.$nextTick(() => {
bus.$emit('PanelSwitchComponent', { name: 'PanelMain' })
......
......@@ -679,7 +679,7 @@ export default {
}
},
sceneClick(data, node) {
this.$emit('switchComponent', { name: 'ChartEdit', param: { 'id': data.id }})
this.$emit('switchComponent', { name: 'ChartEdit', param: data })
},
reviewChartList() {
if (this.$store.state.chart.chartSceneData) {
......@@ -750,7 +750,7 @@ export default {
if (this.optFrom === 'panel') {
this.$emit('newViewInfo', { 'id': response.data.id })
} 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.chartTree()
this.refreshNodeBy(view.sceneId)
......
......@@ -249,10 +249,8 @@ export default {
this.table = {}
this.checkedList = []
this.unionData = []
this.height = 500
this.data = []
this.fields = []
this.customType = ['db', 'sql', 'excel']
}
}
......
......@@ -307,16 +307,12 @@ export default {
resetComponent() {
this.dataSource = ''
this.options = []
this.name = ''
this.sql = ''
this.data = []
this.fields = []
this.mode = '0'
this.syncType = 'sync_now'
this.height = 500
this.kettleRunning = false
this.$refs.plxTable.reloadData(this.data)
}
}
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论