Merge pull request #3265 from dataease/pr@dev@refactor_dataset-info
refactor(数据集): 数据集信息界面创建人显示为别名
This commit is contained in:
commit
cfbce4f4bc
@ -1,5 +1,6 @@
|
||||
package io.dataease.controller.response;
|
||||
|
||||
import io.dataease.dto.dataset.DataSetTableDTO;
|
||||
import io.dataease.plugins.common.base.domain.DatasetTable;
|
||||
import io.dataease.plugins.common.base.domain.Datasource;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
@ -8,7 +9,7 @@ import lombok.Data;
|
||||
@Data
|
||||
public class DataSetDetail {
|
||||
@ApiModelProperty("数据集")
|
||||
private DatasetTable table;
|
||||
private DataSetTableDTO table;
|
||||
@ApiModelProperty("数据源")
|
||||
private Datasource datasource;
|
||||
}
|
||||
|
||||
@ -22,4 +22,6 @@ public class DataSetTableDTO extends DatasetTable {
|
||||
private Boolean isLeaf;
|
||||
@ApiModelProperty("父ID")
|
||||
private String pid;
|
||||
@ApiModelProperty("创建者姓名")
|
||||
private String creatorName;
|
||||
}
|
||||
|
||||
@ -17,6 +17,8 @@ import java.util.Map;
|
||||
public class PanelGroupDTO extends PanelGroupWithBLOBs implements ITreeBase<PanelGroupDTO> {
|
||||
@ApiModelProperty("创建用户名")
|
||||
private String creatorName;
|
||||
@ApiModelProperty("更新用户名")
|
||||
private String updateName;
|
||||
@ApiModelProperty("标签")
|
||||
private String label;
|
||||
@ApiModelProperty("是否叶子节点")
|
||||
|
||||
@ -11,7 +11,7 @@ public interface ExtDataSetTableMapper {
|
||||
List<DataSetTableDTO> search(DataSetTableRequest request);
|
||||
|
||||
DataSetTableDTO searchOne(DataSetTableRequest request);
|
||||
|
||||
DataSetTableDTO findOneDetails(@Param("datasetTableId") String datasetTableId);
|
||||
List<DataSetTableDTO> searchDataSetTableWithPanelId(@Param("panelId") String panelId, @Param("userId") String userId);
|
||||
List<DatasetTable> findByPanelId(@Param("panelId") String panelId);
|
||||
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
extends="io.dataease.plugins.common.base.mapper.DatasetTableMapper.BaseResultMap">
|
||||
<result column="privileges" property="privileges"/>
|
||||
<result column="sql_variable_details" property="sqlVariableDetails"/>
|
||||
<result column="creator_name" property="creatorName"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
@ -14,9 +15,25 @@
|
||||
<result property="name" column="name"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="findOneDetails" resultMap="BaseResultMapDTO">
|
||||
select id,
|
||||
`name`,
|
||||
scene_id,
|
||||
data_source_id,
|
||||
`type`,
|
||||
`mode`,
|
||||
`info`,
|
||||
create_by,
|
||||
create_time,
|
||||
( SELECT nick_name FROM sys_user WHERE sys_user.username = dataset_table.create_by ) AS creator_name
|
||||
from dataset_table
|
||||
where id = #{datasetTableId}
|
||||
</select>
|
||||
|
||||
<select id="searchOne" resultMap="BaseResultMapDTO">
|
||||
select
|
||||
id, `name`, scene_id, data_source_id, `type`, `mode`,`info`, create_by, create_time,
|
||||
( SELECT nick_name FROM sys_user WHERE sys_user.username = dataset_table.create_by ) AS creator_name,
|
||||
get_auths(id,'dataset',#{userId}) as `privileges`, scene_id as pid, sql_variable_details
|
||||
from dataset_table
|
||||
<where>
|
||||
@ -103,45 +120,31 @@
|
||||
|
||||
|
||||
<select id="searchDataSetTableWithPanelId" resultMap="BaseResultMapDTO">
|
||||
select
|
||||
id, `name`, scene_id, data_source_id, `type`, `mode`,`info`, create_by, create_time,
|
||||
get_auths(id,'dataset',#{userId}) as `privileges`
|
||||
select id,
|
||||
`name`,
|
||||
scene_id,
|
||||
data_source_id,
|
||||
`type`,
|
||||
`mode`,
|
||||
`info`,
|
||||
create_by,
|
||||
create_time,
|
||||
get_auths(id, 'dataset', #{userId}) as `privileges`
|
||||
from dataset_table
|
||||
where id in (
|
||||
SELECT
|
||||
table_id
|
||||
FROM
|
||||
chart_view
|
||||
WHERE
|
||||
id IN (
|
||||
SELECT
|
||||
chart_view_id
|
||||
FROM
|
||||
panel_view
|
||||
WHERE
|
||||
panel_id = #{panelId}
|
||||
)
|
||||
)
|
||||
where id in (SELECT table_id
|
||||
FROM chart_view
|
||||
WHERE id IN (SELECT chart_view_id
|
||||
FROM panel_view
|
||||
WHERE panel_id = #{panelId}))
|
||||
</select>
|
||||
|
||||
<select id="findByPanelId" resultMap="BaseResultMapDTO">
|
||||
select
|
||||
dataset_table.*
|
||||
select dataset_table.*
|
||||
from dataset_table
|
||||
where id in (
|
||||
SELECT
|
||||
table_id
|
||||
FROM
|
||||
chart_view
|
||||
WHERE
|
||||
id IN (
|
||||
SELECT
|
||||
chart_view_id
|
||||
FROM
|
||||
panel_view
|
||||
WHERE
|
||||
panel_id = #{panelId}
|
||||
)
|
||||
)
|
||||
where id in (SELECT table_id
|
||||
FROM chart_view
|
||||
WHERE id IN (SELECT chart_view_id
|
||||
FROM panel_view
|
||||
WHERE panel_id = #{panelId}))
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@ -10,6 +10,7 @@
|
||||
<result column="default_panel_name" jdbcType="VARCHAR" property="defaultPanelName"/>
|
||||
<result column="source_panel_name" jdbcType="VARCHAR" property="sourcePanelName"/>
|
||||
<result column="creator_name" jdbcType="VARCHAR" property="creatorName"/>
|
||||
<result column="update_name" jdbcType="VARCHAR" property="updateName"/>
|
||||
<result column="is_default" property="isDefault"/>
|
||||
</resultMap>
|
||||
|
||||
@ -17,6 +18,7 @@
|
||||
select panel_group.*,
|
||||
panel_group.name as label,
|
||||
(select nick_name from sys_user where username = panel_group.create_by) as creator_name,
|
||||
(select nick_name from sys_user where username = panel_group.update_by) as update_name,
|
||||
get_auths(panel_group.id, 'panel', #{userId}) as `privileges`
|
||||
from panel_group
|
||||
where id = #{panelId}
|
||||
|
||||
@ -2190,7 +2190,7 @@ public class DataSetTableService {
|
||||
|
||||
public DataSetDetail getDatasetDetail(String id) {
|
||||
DataSetDetail dataSetDetail = new DataSetDetail();
|
||||
DatasetTable table = datasetTableMapper.selectByPrimaryKey(id);
|
||||
DataSetTableDTO table = extDataSetTableMapper.findOneDetails(id);
|
||||
dataSetDetail.setTable(table);
|
||||
if (ObjectUtils.isNotEmpty(table)) {
|
||||
Datasource datasource = datasourceMapper.selectByPrimaryKey(table.getDataSourceId());
|
||||
|
||||
@ -170,6 +170,7 @@ export function initPanelData(panelId, useCache = false, callback) {
|
||||
createTime: response.data.createTime,
|
||||
creatorName: response.data.creatorName,
|
||||
updateBy: response.data.updateBy,
|
||||
updateName: response.data.updateName,
|
||||
updateTime: response.data.updateTime
|
||||
})
|
||||
// 刷新联动信息
|
||||
|
||||
@ -77,7 +77,7 @@
|
||||
</div>
|
||||
<div class="info-item">
|
||||
<p class="info-title">{{ $t('dataset.create_by') }}</p>
|
||||
<p class="info-content">{{ detail.table.createBy }}</p>
|
||||
<p class="info-content">{{ detail.table.creatorName || 'N/A' }}</p>
|
||||
</div>
|
||||
<div class="info-item">
|
||||
<p class="info-title">{{ $t('dataset.create_time') }}</p>
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
</span>
|
||||
<el-divider direction="vertical"></el-divider>
|
||||
<span class="create-by">{{ $t('dataset.create_by') }}</span>
|
||||
<span class="create-by">:{{ table.createBy }}</span>
|
||||
<span class="create-by">:{{ table.creatorName || 'N/A' }}</span>
|
||||
<el-popover
|
||||
placement="bottom"
|
||||
width="420"
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
</el-col>
|
||||
<el-col class="info-item">
|
||||
<p class="info-title">{{ $t('panel.update_by') }}</p>
|
||||
<p class="info-content">{{ panelInfo.updateBy || 'N/A' }}</p>
|
||||
<p class="info-content">{{ panelInfo.updateName || 'N/A' }}</p>
|
||||
</el-col>
|
||||
<el-col class="info-item">
|
||||
<p class="info-title">{{ $t('panel.update_time') }}</p>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user