forked from github/dataease
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
6618e5ca5b
@ -0,0 +1,26 @@
|
||||
package io.dataease.commons.utils;
|
||||
|
||||
import io.dataease.dto.dataset.union.UnionDTO;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Author: wangjiahao
|
||||
* Date: 2022/11/28
|
||||
* Description:
|
||||
*/
|
||||
public class DatasetUtils {
|
||||
|
||||
public static void getUnionTable(List<String> tableIdList, List<UnionDTO> childrenDs) {
|
||||
if (CollectionUtils.isNotEmpty(childrenDs)) {
|
||||
for (UnionDTO unionDTO : childrenDs) {
|
||||
String tableId = unionDTO.getCurrentDs().getId();
|
||||
tableIdList.add(tableId);
|
||||
if (CollectionUtils.isNotEmpty(unionDTO.getChildrenDs())) {
|
||||
getUnionTable(tableIdList, unionDTO.getChildrenDs());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -8,4 +8,6 @@ import java.util.List;
|
||||
public interface ExtDataSetTableFieldMapper {
|
||||
List<DatasetTableField> findByPanelId(@Param("panelId") String panelId);
|
||||
|
||||
List<DatasetTableField> findByTableIds(@Param("tableIds") List<String> tableIds);
|
||||
|
||||
}
|
||||
|
@ -7,23 +7,22 @@
|
||||
</resultMap>
|
||||
|
||||
<select id="findByPanelId" resultMap="BaseResultMapDTO">
|
||||
select
|
||||
dataset_table_field.*
|
||||
select dataset_table_field.*
|
||||
from dataset_table_field
|
||||
where table_id in (
|
||||
SELECT
|
||||
table_id
|
||||
FROM
|
||||
chart_view
|
||||
WHERE
|
||||
id IN (
|
||||
SELECT
|
||||
chart_view_id
|
||||
FROM
|
||||
panel_view
|
||||
WHERE
|
||||
panel_id = #{panelId}
|
||||
)
|
||||
)
|
||||
where table_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="findByTableIds" resultMap="BaseResultMapDTO">
|
||||
select
|
||||
dataset_table_field.*
|
||||
from dataset_table_field
|
||||
where dataset_table_field.table_id in
|
||||
<foreach collection="tableIds" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
</mapper>
|
||||
|
@ -11,8 +11,13 @@ 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);
|
||||
|
||||
List<DatasetTable> findByTableIds(@Param("tableIds") List<String> tableIds);
|
||||
|
||||
}
|
||||
|
@ -25,7 +25,7 @@
|
||||
`info`,
|
||||
create_by,
|
||||
create_time,
|
||||
( SELECT nick_name FROM sys_user WHERE sys_user.username = dataset_table.create_by ) AS creator_name
|
||||
(SELECT nick_name FROM sys_user WHERE sys_user.username = dataset_table.create_by) AS creator_name
|
||||
from dataset_table
|
||||
where id = #{datasetTableId}
|
||||
</select>
|
||||
@ -147,4 +147,13 @@
|
||||
FROM panel_view
|
||||
WHERE panel_id = #{panelId}))
|
||||
</select>
|
||||
|
||||
<select id="findByTableIds" resultMap="BaseResultMapDTO">
|
||||
select dataset_table.*
|
||||
from dataset_table
|
||||
where dataset_table.id in
|
||||
<foreach collection="tableIds" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
</mapper>
|
||||
|
@ -1,8 +1,8 @@
|
||||
package io.dataease.ext;
|
||||
|
||||
import io.dataease.ext.query.GridExample;
|
||||
import io.dataease.dto.dataset.DataSetTaskDTO;
|
||||
import io.dataease.dto.dataset.DataSetTaskLogDTO;
|
||||
import io.dataease.ext.query.GridExample;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@ -25,4 +25,6 @@ public interface ExtDataSetTaskMapper {
|
||||
List<DataSetTaskDTO> taskWithTriggers(GridExample example);
|
||||
|
||||
List<DataSetTaskDTO> findByPanelId(@Param("panelId") String panelId);
|
||||
|
||||
List<DataSetTaskDTO> findByTableIds(@Param("tableIds") List tableIds);
|
||||
}
|
||||
|
@ -8,19 +8,21 @@
|
||||
<result column="dataset_name" jdbcType="VARCHAR" property="datasetName"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="TaskResult" type="io.dataease.dto.dataset.DataSetTaskDTO" extends="io.dataease.plugins.common.base.mapper.DatasetTableTaskMapper.BaseResultMap">
|
||||
<resultMap id="TaskResult" type="io.dataease.dto.dataset.DataSetTaskDTO"
|
||||
extends="io.dataease.plugins.common.base.mapper.DatasetTableTaskMapper.BaseResultMap">
|
||||
<result column="table_name" jdbcType="VARCHAR" property="datasetName"/>
|
||||
<result column="privileges" jdbcType="VARCHAR" property="privileges"/>
|
||||
<result column="NEXT_FIRE_TIME" jdbcType="BIGINT" property="nextExecTime"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="listTaskLog" resultMap="BaseResult" parameterType="io.dataease.plugins.common.base.domain.DatasetTableTaskLog">
|
||||
<select id="listTaskLog" resultMap="BaseResult"
|
||||
parameterType="io.dataease.plugins.common.base.domain.DatasetTableTaskLog">
|
||||
SELECT dataset_table_task_log.*, dataset_table_task.name, dataset_table.name as dataset_name
|
||||
FROM dataset_table_task_log
|
||||
LEFT JOIN dataset_table_task ON dataset_table_task_log.task_id = dataset_table_task.id
|
||||
LEFT JOIN dataset_table ON dataset_table_task_log.table_id = dataset_table.id
|
||||
<if test="_parameter != null">
|
||||
<include refid="io.dataease.ext.query.GridSql.gridCondition" />
|
||||
<include refid="io.dataease.ext.query.GridSql.gridCondition"/>
|
||||
</if>
|
||||
<if test="orderByClause != null">
|
||||
order by ${orderByClause}
|
||||
@ -30,13 +32,14 @@
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="listUserTaskLog" resultMap="BaseResult" parameterType="io.dataease.plugins.common.base.domain.DatasetTableTaskLog">
|
||||
<select id="listUserTaskLog" resultMap="BaseResult"
|
||||
parameterType="io.dataease.plugins.common.base.domain.DatasetTableTaskLog">
|
||||
SELECT dataset_table_task_log.*, dataset_table_task.name, dataset_table.name as dataset_name
|
||||
FROM dataset_table_task_log
|
||||
LEFT JOIN dataset_table_task ON dataset_table_task_log.task_id = dataset_table_task.id
|
||||
LEFT JOIN dataset_table ON dataset_table_task_log.table_id = dataset_table.id
|
||||
<if test="_parameter != null">
|
||||
<include refid="io.dataease.ext.query.GridSql.taskListGridCondition" />
|
||||
<include refid="io.dataease.ext.query.GridSql.taskListGridCondition"/>
|
||||
</if>
|
||||
<if test="orderByClause != null">
|
||||
order by ${orderByClause}
|
||||
@ -47,12 +50,13 @@
|
||||
</select>
|
||||
|
||||
<select id="taskList" resultMap="TaskResult" parameterType="io.dataease.ext.query.GridExample">
|
||||
SELECT dataset_table.name as table_name, 'grant,manage,use' as `privileges`,dataset_table_task.* , qrtz_triggers.NEXT_FIRE_TIME
|
||||
SELECT dataset_table.name as table_name, 'grant,manage,use' as `privileges`,dataset_table_task.* ,
|
||||
qrtz_triggers.NEXT_FIRE_TIME
|
||||
FROM dataset_table_task
|
||||
left join dataset_table on dataset_table.id=dataset_table_task.table_id
|
||||
left join qrtz_triggers on dataset_table_task.id=qrtz_triggers.TRIGGER_NAME
|
||||
<if test="_parameter != null">
|
||||
<include refid="io.dataease.ext.query.GridSql.gridCondition" />
|
||||
<include refid="io.dataease.ext.query.GridSql.gridCondition"/>
|
||||
</if>
|
||||
<if test="orderByClause != null">
|
||||
order by ${orderByClause}
|
||||
@ -63,12 +67,13 @@
|
||||
</select>
|
||||
|
||||
<select id="userTaskList" resultMap="TaskResult" parameterType="io.dataease.ext.query.GridExample">
|
||||
SELECT dataset_table.name as table_name, get_auths(dataset_table_task.table_id,'dataset', #{extendCondition}) as `privileges`,dataset_table_task.* , qrtz_triggers.NEXT_FIRE_TIME
|
||||
SELECT dataset_table.name as table_name, get_auths(dataset_table_task.table_id,'dataset', #{extendCondition}) as
|
||||
`privileges`,dataset_table_task.* , qrtz_triggers.NEXT_FIRE_TIME
|
||||
FROM dataset_table_task
|
||||
left join dataset_table on dataset_table.id=dataset_table_task.table_id
|
||||
left join qrtz_triggers on dataset_table_task.id=qrtz_triggers.TRIGGER_NAME
|
||||
<if test="_parameter != null">
|
||||
<include refid="io.dataease.ext.query.GridSql.taskListGridCondition" />
|
||||
<include refid="io.dataease.ext.query.GridSql.taskListGridCondition"/>
|
||||
</if>
|
||||
<if test="orderByClause != null">
|
||||
order by ${orderByClause}
|
||||
@ -79,12 +84,13 @@
|
||||
</select>
|
||||
|
||||
<select id="taskWithTriggers" resultMap="TaskResult" parameterType="io.dataease.ext.query.GridExample">
|
||||
SELECT dataset_table.name as table_name, get_auths(dataset_table_task.table_id,'dataset', #{extendCondition}) as `privileges`,dataset_table_task.* , qrtz_triggers.NEXT_FIRE_TIME
|
||||
SELECT dataset_table.name as table_name, get_auths(dataset_table_task.table_id,'dataset', #{extendCondition}) as
|
||||
`privileges`,dataset_table_task.* , qrtz_triggers.NEXT_FIRE_TIME
|
||||
FROM dataset_table_task
|
||||
left join dataset_table on dataset_table.id=dataset_table_task.table_id
|
||||
left join qrtz_triggers on dataset_table_task.id=qrtz_triggers.TRIGGER_NAME
|
||||
<if test="_parameter != null">
|
||||
<include refid="io.dataease.ext.query.GridSql.gridCondition" />
|
||||
<include refid="io.dataease.ext.query.GridSql.gridCondition"/>
|
||||
</if>
|
||||
<if test="orderByClause != null">
|
||||
order by ${orderByClause}
|
||||
@ -95,26 +101,23 @@
|
||||
</select>
|
||||
|
||||
<select id="findByPanelId" resultMap="TaskResult">
|
||||
select
|
||||
dataset_table_task.*
|
||||
select dataset_table_task.*
|
||||
from dataset_table_task
|
||||
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="findByTableIds" resultMap="TaskResult">
|
||||
select dataset_table_task.*
|
||||
from dataset_table_task
|
||||
where dataset_table_task.table_id in
|
||||
<foreach collection="tableIds" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
</mapper>
|
||||
|
@ -1,8 +1,8 @@
|
||||
package io.dataease.ext;
|
||||
|
||||
import io.dataease.ext.query.GridExample;
|
||||
import io.dataease.controller.request.DatasourceUnionRequest;
|
||||
import io.dataease.dto.DatasourceDTO;
|
||||
import io.dataease.ext.query.GridExample;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
@ -15,7 +15,9 @@ public interface ExtDataSourceMapper {
|
||||
|
||||
List<DatasourceDTO> findByPanelId(@Param("panelId") String panelId);
|
||||
|
||||
DatasourceDTO queryDetails(@Param("datasourceId") String datasourceId,@Param("userId") String userId);
|
||||
List<DatasourceDTO> findByTableIds(@Param("tableIds") List<String> tableIds);
|
||||
|
||||
DatasourceDTO queryDetails(@Param("datasourceId") String datasourceId, @Param("userId") String userId);
|
||||
|
||||
|
||||
}
|
||||
|
@ -130,6 +130,19 @@
|
||||
WHERE panel_view.panel_id = #{panelId}
|
||||
</select>
|
||||
|
||||
<select id="findByTableIds" resultMap="BaseResultMapDTO">
|
||||
SELECT DISTINCT datasource.id,
|
||||
datasource.`name`,
|
||||
datasource.DESC,
|
||||
datasource.type
|
||||
FROM dataset_table
|
||||
INNER JOIN datasource ON dataset_table.data_source_id = datasource.id
|
||||
WHERE dataset_table.id in
|
||||
<foreach collection="tableIds" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<select id="queryDetails" resultMap="BaseResultMapDTO">
|
||||
select datasource.*,
|
||||
get_auths(id, 'link', #{userId}) as `privileges`
|
||||
|
@ -1011,7 +1011,7 @@ public class ChartDataBuild {
|
||||
} else {
|
||||
switch (columnPermissionItem.getDesensitizationRule().getCustomBuiltInRule()) {
|
||||
case RetainBeforeMAndAfterN:
|
||||
if (StringUtils.isEmpty(originStr) || originStr.length() < columnPermissionItem.getDesensitizationRule().getM() + columnPermissionItem.getDesensitizationRule().getN() + 1) {
|
||||
if (StringUtils.isEmpty(originStr) || originStr.length() <= columnPermissionItem.getDesensitizationRule().getM() + columnPermissionItem.getDesensitizationRule().getN() + 1) {
|
||||
desensitizationStr = String.join("", Collections.nCopies(columnPermissionItem.getDesensitizationRule().getM(), "X")) + "***" + String.join("", Collections.nCopies(columnPermissionItem.getDesensitizationRule().getN(), "X"));
|
||||
} else {
|
||||
desensitizationStr = StringUtils.substring(originStr, 0, columnPermissionItem.getDesensitizationRule().getM() - 1) + "***" + StringUtils.substring(originStr, originStr.length() - columnPermissionItem.getDesensitizationRule().getN(), originStr.length() - 1);
|
||||
|
@ -116,4 +116,8 @@ public class DataSetTableFieldsService {
|
||||
public void delete(String id) {
|
||||
datasetTableFieldMapper.deleteByPrimaryKey(id);
|
||||
}
|
||||
|
||||
public void updateByPrimaryKeySelective(DatasetTableField request) {
|
||||
datasetTableFieldMapper.updateByPrimaryKeySelective(request);
|
||||
}
|
||||
}
|
||||
|
@ -13,6 +13,7 @@ import io.dataease.plugins.common.dto.chart.ChartCustomFilterItemDTO;
|
||||
import io.dataease.plugins.common.dto.chart.ChartFieldCustomFilterDTO;
|
||||
import io.dataease.plugins.config.SpringContextUtil;
|
||||
import io.dataease.plugins.xpack.auth.dto.request.*;
|
||||
import io.dataease.plugins.xpack.auth.dto.response.Item;
|
||||
import io.dataease.plugins.xpack.auth.service.ColumnPermissionService;
|
||||
import io.dataease.plugins.xpack.auth.service.RowPermissionService;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
@ -112,14 +113,14 @@ public class PermissionService {
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(fieldRoleColumnPermissionItems)) {
|
||||
if (fieldRoleColumnPermissionItems.stream().map(ColumnPermissionItem::getOpt).collect(Collectors.toList()).contains(ColumnPermissionConstants.Desensitization)) {
|
||||
desensitizationList.put(field.getDataeaseName(), fieldUserColumnPermissionItems.get(0));
|
||||
desensitizationList.put(field.getDataeaseName(), fieldRoleColumnPermissionItems.get(0));
|
||||
result.add(field);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(fieldDeptColumnPermissionItems)) {
|
||||
if (fieldDeptColumnPermissionItems.stream().map(ColumnPermissionItem::getOpt).collect(Collectors.toList()).contains(ColumnPermissionConstants.Desensitization)) {
|
||||
desensitizationList.put(field.getDataeaseName(), fieldUserColumnPermissionItems.get(0));
|
||||
desensitizationList.put(field.getDataeaseName(), fieldDeptColumnPermissionItems.get(0));
|
||||
result.add(field);
|
||||
}
|
||||
return;
|
||||
@ -209,34 +210,46 @@ public class PermissionService {
|
||||
dataSetColumnPermissionsDTO.setAuthTargetType("user");
|
||||
datasetColumnPermissions.addAll(columnPermissionService.searchPermissions(dataSetColumnPermissionsDTO));
|
||||
if (CollectionUtils.isNotEmpty(roleIds)) {
|
||||
dataSetColumnPermissionsDTO.setAuthTargetIds(roleIds);
|
||||
dataSetColumnPermissionsDTO.setAuthTargetType("role");
|
||||
List<DataSetColumnPermissionsDTO> roleColumnPermissionsDTOS = new ArrayList<>();
|
||||
for (DataSetColumnPermissionsDTO columnPermissionsDTO : columnPermissionService.searchPermissions(dataSetColumnPermissionsDTO)) {
|
||||
columnPermissionsDTO.getWhiteListUser();
|
||||
List<Long> userIdList = new Gson().fromJson(columnPermissionsDTO.getWhiteListUser(), new TypeToken<List<Long>>() {
|
||||
}.getType());
|
||||
if (CollectionUtils.isEmpty(userIdList) || !userIdList.contains(userId)) {
|
||||
roleColumnPermissionsDTOS.add(columnPermissionsDTO);
|
||||
DataSetColumnPermissionsDTO request = new DataSetColumnPermissionsDTO();
|
||||
request.setDatasetId(datasetId);
|
||||
request.setAuthTargetType("role");
|
||||
List<Item> items = (List<Item>)columnPermissionService.authObjs(request);
|
||||
roleIds = roleIds.stream().filter(id -> {return items.stream().map(Item::getId).collect(Collectors.toList()).contains(id);}).collect(Collectors.toList());
|
||||
if(CollectionUtils.isNotEmpty(roleIds)){
|
||||
dataSetColumnPermissionsDTO.setAuthTargetIds(roleIds);
|
||||
dataSetColumnPermissionsDTO.setAuthTargetType("role");
|
||||
List<DataSetColumnPermissionsDTO> roleColumnPermissionsDTOS = new ArrayList<>();
|
||||
for (DataSetColumnPermissionsDTO columnPermissionsDTO : columnPermissionService.searchPermissions(dataSetColumnPermissionsDTO)) {
|
||||
columnPermissionsDTO.getWhiteListUser();
|
||||
List<Long> userIdList = new Gson().fromJson(columnPermissionsDTO.getWhiteListUser(), new TypeToken<List<Long>>() {
|
||||
}.getType());
|
||||
if (CollectionUtils.isEmpty(userIdList) || !userIdList.contains(userId)) {
|
||||
roleColumnPermissionsDTOS.add(columnPermissionsDTO);
|
||||
}
|
||||
}
|
||||
datasetColumnPermissions.addAll(roleColumnPermissionsDTOS);
|
||||
}
|
||||
datasetColumnPermissions.addAll(roleColumnPermissionsDTOS);
|
||||
}
|
||||
|
||||
if (deptId != null) {
|
||||
dataSetColumnPermissionsDTO.setAuthTargetIds(Collections.singletonList(deptId));
|
||||
dataSetColumnPermissionsDTO.setAuthTargetType("dept");
|
||||
List<DataSetColumnPermissionsDTO> deptColumnPermissionsDTOS = new ArrayList<>();
|
||||
for (DataSetColumnPermissionsDTO columnPermissionsDTO : columnPermissionService.searchPermissions(dataSetColumnPermissionsDTO)) {
|
||||
List<Long> userIdList = new Gson().fromJson(columnPermissionsDTO.getWhiteListUser(), new TypeToken<List<Long>>() {
|
||||
}.getType());
|
||||
if (CollectionUtils.isEmpty(userIdList) || !userIdList.contains(userId)) {
|
||||
deptColumnPermissionsDTOS.add(columnPermissionsDTO);
|
||||
DataSetColumnPermissionsDTO request = new DataSetColumnPermissionsDTO();
|
||||
request.setDatasetId(datasetId);
|
||||
request.setAuthTargetType("dept");
|
||||
List<Item> items = (List<Item>)columnPermissionService.authObjs(request);
|
||||
if(items.stream().map(Item::getId).collect(Collectors.toList()).contains(deptId)){
|
||||
dataSetColumnPermissionsDTO.setAuthTargetIds(Collections.singletonList(deptId));
|
||||
dataSetColumnPermissionsDTO.setAuthTargetType("dept");
|
||||
List<DataSetColumnPermissionsDTO> deptColumnPermissionsDTOS = new ArrayList<>();
|
||||
for (DataSetColumnPermissionsDTO columnPermissionsDTO : columnPermissionService.searchPermissions(dataSetColumnPermissionsDTO)) {
|
||||
List<Long> userIdList = new Gson().fromJson(columnPermissionsDTO.getWhiteListUser(), new TypeToken<List<Long>>() {
|
||||
}.getType());
|
||||
if (CollectionUtils.isEmpty(userIdList) || !userIdList.contains(userId)) {
|
||||
deptColumnPermissionsDTOS.add(columnPermissionsDTO);
|
||||
}
|
||||
}
|
||||
datasetColumnPermissions.addAll(deptColumnPermissionsDTOS);
|
||||
}
|
||||
datasetColumnPermissions.addAll(deptColumnPermissionsDTOS);
|
||||
}
|
||||
|
||||
return datasetColumnPermissions;
|
||||
}
|
||||
|
||||
|
@ -5,6 +5,7 @@ import io.dataease.commons.constants.CommonConstants;
|
||||
import io.dataease.commons.constants.PanelConstants;
|
||||
import io.dataease.commons.utils.AuthUtils;
|
||||
import io.dataease.commons.utils.BeanUtils;
|
||||
import io.dataease.commons.utils.TableUtils;
|
||||
import io.dataease.controller.datasource.request.UpdataDsRequest;
|
||||
import io.dataease.controller.request.dataset.DataSetTableRequest;
|
||||
import io.dataease.controller.request.panel.PanelAppTemplateApplyRequest;
|
||||
@ -197,28 +198,44 @@ public class PanelAppTemplateService {
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Map<String, String> applyDatasetField(List<DatasetTableField> datasetTableFieldsInfo, Map<String, String> datasetsRealMap) {
|
||||
public Map<String, String> applyDatasetField(List<DatasetTableField> datasetTableFieldsInfo, Map<String, String> datasetsRealMap, Map<String, String> datasetTypeRealMap, Map<String, String> datasetFieldsMd5FormatRealMap) {
|
||||
Map<String, String> datasetFieldsRealMap = new HashMap<>();
|
||||
for (DatasetTableField datasetTableField : datasetTableFieldsInfo) {
|
||||
if (datasetTableField.getExtField() != 2) {
|
||||
String oldId = datasetTableField.getId();
|
||||
datasetTableField.setTableId(datasetsRealMap.get(datasetTableField.getTableId()));
|
||||
String oldTableId = datasetTableField.getTableId();
|
||||
datasetTableField.setTableId(datasetsRealMap.get(oldTableId));
|
||||
datasetTableField.setId(null);
|
||||
DatasetTableField newTableField = dataSetTableFieldsService.save(datasetTableField);
|
||||
datasetFieldsRealMap.put(oldId, newTableField.getId());
|
||||
datasetFieldsMd5FormatRealMap.put(TableUtils.fieldNameShort(oldTableId + "_" + datasetTableField.getOriginName()), TableUtils.fieldNameShort(newTableField.getTableId() + "_" + datasetTableField.getOriginName()));
|
||||
System.out.println();
|
||||
}
|
||||
}
|
||||
//数据集计算字段替换
|
||||
for (DatasetTableField datasetTableField : datasetTableFieldsInfo) {
|
||||
if (datasetTableField.getExtField() == 2) {
|
||||
String oldId = datasetTableField.getId();
|
||||
datasetTableField.setTableId(datasetsRealMap.get(datasetTableField.getTableId()));
|
||||
String oldTableId = datasetTableField.getTableId();
|
||||
String oldOriginName = datasetTableField.getOriginName();
|
||||
datasetTableField.setTableId(datasetsRealMap.get(oldTableId));
|
||||
datasetTableField.setId(null);
|
||||
datasetFieldsRealMap.forEach((k, v) -> {
|
||||
datasetTableField.setOriginName(datasetTableField.getOriginName().replaceAll(k, v));
|
||||
});
|
||||
DatasetTableField newTableField = dataSetTableFieldsService.save(datasetTableField);
|
||||
datasetFieldsRealMap.put(oldId, newTableField.getId());
|
||||
datasetFieldsMd5FormatRealMap.put(TableUtils.fieldNameShort(oldTableId + "_" + oldOriginName), TableUtils.fieldNameShort(newTableField.getTableId() + "_" + datasetTableField.getOriginName()));
|
||||
}
|
||||
}
|
||||
|
||||
//custom 和 union originName替换
|
||||
for (DatasetTableField datasetTableField : datasetTableFieldsInfo) {
|
||||
if (DatasetType.UNION.name().equalsIgnoreCase(datasetTypeRealMap.get(datasetTableField.getTableId())) || DatasetType.CUSTOM.name().equalsIgnoreCase(datasetTypeRealMap.get(datasetTableField.getTableId()))) {
|
||||
DatasetTableField updateField = new DatasetTableField();
|
||||
updateField.setId(datasetTableField.getId());
|
||||
updateField.setOriginName(datasetFieldsMd5FormatRealMap.get(datasetTableField.getOriginName()));
|
||||
dataSetTableFieldsService.updateByPrimaryKeySelective(updateField);
|
||||
}
|
||||
}
|
||||
return datasetFieldsRealMap;
|
||||
@ -248,7 +265,7 @@ public class PanelAppTemplateService {
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Map<String, String> applyViews(List<ChartViewWithBLOBs> chartViewsInfo, Map<String, String> datasetsRealMap, Map<String, String> datasetFieldsRealMap, String sceneId) throws Exception {
|
||||
public Map<String, String> applyViews(List<ChartViewWithBLOBs> chartViewsInfo, Map<String, String> datasetsRealMap, Map<String, String> datasetFieldsRealMap, Map<String, String> datasetFieldsMd5FormatRealMap, String sceneId) throws Exception {
|
||||
Map<String, String> chartViewsRealMap = new HashMap<>();
|
||||
for (ChartViewWithBLOBs chartView : chartViewsInfo) {
|
||||
String oldViewId = chartView.getId();
|
||||
@ -279,6 +296,19 @@ public class PanelAppTemplateService {
|
||||
chartView.setCustomFilter(chartView.getCustomFilter().replaceAll(k, v));
|
||||
chartView.setDrillFields(chartView.getDrillFields().replaceAll(k, v));
|
||||
});
|
||||
//替换originName
|
||||
datasetFieldsMd5FormatRealMap.forEach((k, v) -> {
|
||||
chartView.setXAxis(chartView.getXAxis().replaceAll(k, v));
|
||||
chartView.setXAxisExt(chartView.getXAxisExt().replaceAll(k, v));
|
||||
chartView.setYAxis(chartView.getYAxis().replaceAll(k, v));
|
||||
chartView.setYAxisExt(chartView.getYAxisExt().replaceAll(k, v));
|
||||
chartView.setExtStack(chartView.getExtStack().replaceAll(k, v));
|
||||
chartView.setExtBubble(chartView.getExtBubble().replaceAll(k, v));
|
||||
chartView.setCustomAttr(chartView.getCustomAttr().replaceAll(k, v));
|
||||
chartView.setCustomStyle(chartView.getCustomStyle().replaceAll(k, v));
|
||||
chartView.setCustomFilter(chartView.getCustomFilter().replaceAll(k, v));
|
||||
chartView.setDrillFields(chartView.getDrillFields().replaceAll(k, v));
|
||||
});
|
||||
chartView.setId(null);
|
||||
chartView.setSceneId(sceneId);
|
||||
ChartViewWithBLOBs newOne = chartViewService.newOne(chartView);
|
||||
|
@ -18,6 +18,7 @@ import io.dataease.dto.chart.ChartViewDTO;
|
||||
import io.dataease.dto.dataset.DataSetGroupDTO;
|
||||
import io.dataease.dto.dataset.DataSetTableDTO;
|
||||
import io.dataease.dto.dataset.DataSetTaskDTO;
|
||||
import io.dataease.dto.dataset.DataTableInfoDTO;
|
||||
import io.dataease.dto.panel.PanelExport2App;
|
||||
import io.dataease.dto.panel.PanelGroupDTO;
|
||||
import io.dataease.dto.panel.PanelTemplateFileDTO;
|
||||
@ -808,12 +809,42 @@ public class PanelGroupService {
|
||||
List<ChartViewField> chartViewFieldsInfo = extChartViewFieldMapper.findByPanelId(panelId);
|
||||
//3.获取所有数据集信息
|
||||
List<DatasetTable> datasetTablesInfo = extDataSetTableMapper.findByPanelId(panelId);
|
||||
List<String> attachTableIds = new ArrayList<>();
|
||||
if (CollectionUtils.isNotEmpty(datasetTablesInfo)) {
|
||||
for (DatasetTable datasetTable : datasetTablesInfo) {
|
||||
if ("union".equals(datasetTable.getType()) && StringUtils.isNotEmpty(datasetTable.getInfo())) {
|
||||
DataTableInfoDTO dt = gson.fromJson(datasetTable.getInfo(), DataTableInfoDTO.class);
|
||||
DatasetUtils.getUnionTable(attachTableIds, dt.getUnion());
|
||||
} else if ("custom".equals(datasetTable.getType()) && StringUtils.isNotEmpty(datasetTable.getInfo())) {
|
||||
Map result = gson.fromJson(datasetTable.getInfo(), Map.class);
|
||||
List<Map> list = (List<Map>) result.get("list");
|
||||
if (CollectionUtils.isNotEmpty(list)) {
|
||||
for (Map details : list) {
|
||||
attachTableIds.add(String.valueOf(details.get("tableId")));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(attachTableIds)) {
|
||||
List<DatasetTable> attachDatasetTables = extDataSetTableMapper.findByTableIds(attachTableIds);
|
||||
if (CollectionUtils.isNotEmpty(attachDatasetTables)) {
|
||||
datasetTablesInfo.addAll(attachDatasetTables);
|
||||
}
|
||||
}
|
||||
}
|
||||
// dataset check
|
||||
if (CollectionUtils.isEmpty(datasetTablesInfo)) {
|
||||
return new PanelExport2App(Translator.get("I18N_APP_NO_DATASET_ERROR"));
|
||||
} else if (datasetTablesInfo.stream().filter(datasetTable -> datasetTable.getType().equals("excel") || datasetTable.getType().equals("api")).collect(Collectors.toList()).size() > 0) {
|
||||
return new PanelExport2App(Translator.get("I18N_APP_ERROR_DATASET"));
|
||||
}
|
||||
List<String> allTableIds = datasetTablesInfo.stream().map(DatasetTable::getId).collect(Collectors.toList());
|
||||
//4.获取所有数据集字段信息
|
||||
List<DatasetTableField> datasetTableFieldsInfo = extDataSetTableFieldMapper.findByPanelId(panelId);
|
||||
List<DatasetTableField> datasetTableFieldsInfo = extDataSetTableFieldMapper.findByTableIds(allTableIds);
|
||||
//5.获取所有任务信息
|
||||
List<DataSetTaskDTO> dataSetTasksInfo = extDataSetTaskMapper.findByPanelId(panelId);
|
||||
List<DataSetTaskDTO> dataSetTasksInfo = extDataSetTaskMapper.findByTableIds(allTableIds);
|
||||
//6.获取所有数据源信息
|
||||
List<DatasourceDTO> datasourceDTOS = extDataSourceMapper.findByPanelId(panelId);
|
||||
List<DatasourceDTO> datasourceDTOS = extDataSourceMapper.findByTableIds(allTableIds);
|
||||
|
||||
List<PanelView> panelViews = panelViewService.findPanelViewsByPanelId(panelId);
|
||||
|
||||
@ -825,13 +856,6 @@ public class PanelGroupService {
|
||||
return new PanelExport2App(Translator.get("I18N_APP_TEMPLATE_VIEW_ERROR"));
|
||||
}
|
||||
|
||||
// dataset check
|
||||
if (CollectionUtils.isEmpty(datasetTablesInfo)) {
|
||||
return new PanelExport2App(Translator.get("I18N_APP_NO_DATASET_ERROR"));
|
||||
} else if (datasetTablesInfo.stream().filter(datasetTable -> datasetTable.getType().equals("excel") || datasetTable.getType().equals("api")).collect(Collectors.toList()).size() > 0) {
|
||||
return new PanelExport2App(Translator.get("I18N_APP_ERROR_DATASET"));
|
||||
}
|
||||
|
||||
//datasource check
|
||||
if (CollectionUtils.isEmpty(datasourceDTOS)) {
|
||||
return new PanelExport2App(Translator.get("I18N_APP_NO_DATASOURCE"));
|
||||
@ -885,11 +909,15 @@ public class PanelGroupService {
|
||||
|
||||
Map<String, String> datasetsRealMap = panelAppTemplateService.applyDataset(datasetTablesInfo, datasourceRealMap, asideDatasetGroupId);
|
||||
|
||||
Map<String, String> datasetFieldsRealMap = panelAppTemplateService.applyDatasetField(datasetTableFieldsInfo, datasetsRealMap);
|
||||
Map<String, String> datasetTypeRealMap = datasetTablesInfo.stream().collect(Collectors.toMap(DatasetTable::getId, DatasetTable::getType));
|
||||
|
||||
Map<String, String> datasetFieldsMd5FormatRealMap = new HashMap<>();
|
||||
|
||||
Map<String, String> datasetFieldsRealMap = panelAppTemplateService.applyDatasetField(datasetTableFieldsInfo, datasetsRealMap, datasetTypeRealMap, datasetFieldsMd5FormatRealMap);
|
||||
|
||||
panelAppTemplateService.resetCustomAndUnionDataset(datasetTablesInfo, datasetsRealMap, datasetFieldsRealMap);
|
||||
|
||||
Map<String, String> chartViewsRealMap = panelAppTemplateService.applyViews(chartViewsInfo, datasetsRealMap, datasetFieldsRealMap, newPanelId);
|
||||
Map<String, String> chartViewsRealMap = panelAppTemplateService.applyViews(chartViewsInfo, datasetsRealMap, datasetFieldsRealMap, datasetFieldsMd5FormatRealMap, newPanelId);
|
||||
|
||||
panelAppTemplateService.applyViewsField(chartViewFieldsInfo, chartViewsRealMap, datasetsRealMap, datasetFieldsRealMap);
|
||||
|
||||
|
@ -73,28 +73,7 @@ dataease.sqlinjection.whitelists=/dataset/table/sqlPreview,/dataset/table/update
|
||||
server.compression.enabled=true
|
||||
server.compression.mime-types=application/javascript,text/css,application/json,application/xml,text/html,text/xml,text/plain
|
||||
server.compression.min-response-size=1024
|
||||
#\u4E0B\u9762\u7684\u914D\u7F6E\u65B0\u589E\u5230/opt/dataease/conf/dataease/properties
|
||||
#\u7F13\u5B58\u7C7B\u578B
|
||||
##spring.cache.type=redis
|
||||
#spring.cache.type=ehcache
|
||||
#redis\u516C\u5171\u914D\u7F6E
|
||||
#spring.redis.timeout=10000
|
||||
#spring.redis.lettuce.pool.max-active=8
|
||||
#spring.redis.lettuce.pool.max-wait=-1
|
||||
#spring.redis.lettuce.pool.max-idle=8
|
||||
#\u5355\u673A\u6A21\u5F0Fredis\u914D\u7F6E
|
||||
#spring.redis.database=0
|
||||
#spring.redis.host=192.168.0.110
|
||||
#spring.redis.port=6379
|
||||
#spring.redis.password=DataEase_ZNB@REDIS
|
||||
#\u54E8\u5175\u6A21\u5F0Fredis\u914D\u7F6E
|
||||
#spring.redis.sentinel.master=mymaster
|
||||
#spring.redis.sentinel.nodes=192.168.0.110:26379,192.168.0.110:26380,192.168.0.110:26381
|
||||
#spring.redis.sentinel.password=
|
||||
#cluster\u6A21\u5F0Fredis\u914D\u7F6E
|
||||
#spring.redis.cluster.nodes=192.168.0.110:7001,192.168.0.110:7002,192.168.0.110:7003,192.168.0.110:7004,192.168.0.110:7005,192.168.0.110:7006
|
||||
#spring.redis.cluster.max-redirects=3
|
||||
#spring.redis.password=DataEase_ZNB@REDIS
|
||||
|
||||
server.servlet.context-parameters.configurationStrategy=SYSTEM_PROPERTIES
|
||||
server.servlet.session.cookie.http-only=true
|
||||
server.servlet.session.tracking-modes=cookie
|
||||
|
@ -136,7 +136,7 @@
|
||||
key="__operation"
|
||||
:label="$t('commons.operating')"
|
||||
fixed="right"
|
||||
min-width="100"
|
||||
min-width="180"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
@ -147,6 +147,15 @@
|
||||
>{{
|
||||
$t(disableEdit(scope.row) ? 'auth.view' : 'commons.edit')
|
||||
}}</el-button>
|
||||
|
||||
<el-button
|
||||
class="de-text-btn mar3 mar6"
|
||||
:disabled="disableExec(scope.row)"
|
||||
type="text"
|
||||
@click="execTask(scope.row)"
|
||||
>{{ $t("emailtask.execute_now") }}
|
||||
</el-button>
|
||||
|
||||
<el-dropdown
|
||||
size="medium"
|
||||
trigger="click"
|
||||
@ -164,12 +173,6 @@
|
||||
<template
|
||||
v-if="!['Exec'].includes(scope.row.status)"
|
||||
>
|
||||
<el-dropdown-item
|
||||
:disabled="disableExec(scope.row)"
|
||||
command="exec"
|
||||
>
|
||||
{{ $t('components.run_once') }}
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item
|
||||
v-if="scope.row.status === 'Pending'"
|
||||
command="continue"
|
||||
@ -858,8 +861,7 @@ export default {
|
||||
},
|
||||
disableExec(task) {
|
||||
return (
|
||||
task.status === 'Pending' ||
|
||||
!hasDataPermission('manage', task.privileges)
|
||||
task.status === 'Pending' || task.status ==='Exec' || !hasDataPermission('manage', task.privileges)
|
||||
)
|
||||
},
|
||||
disableDelete(task) {
|
||||
|
@ -462,11 +462,7 @@ export default {
|
||||
|
||||
tabClick() {
|
||||
if (this.tabActive === 'dataPreview') {
|
||||
const reload = localStorage.getItem('reloadDsData')
|
||||
if (reload === 'true') {
|
||||
localStorage.setItem('reloadDsData', 'false')
|
||||
this.initTable(this.param.id)
|
||||
}
|
||||
this.initTable(this.param.id)
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -385,8 +385,8 @@ export default {
|
||||
desc: [
|
||||
{
|
||||
min: 0,
|
||||
max: 200,
|
||||
message: i18n.t('datasource.input_limit', { num: '0~200' }),
|
||||
max: 50,
|
||||
message: i18n.t('datasource.input_limit', { num: '0~50' }),
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
|
@ -6,12 +6,14 @@
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
@click="() => selectDataset()"
|
||||
>{{ $t("dataset.add_task") }}</deBtn>
|
||||
>{{ $t("dataset.add_task") }}
|
||||
</deBtn>
|
||||
<deBtn
|
||||
:disabled="!multipleSelection.length"
|
||||
secondary
|
||||
@click="confirmDelete"
|
||||
>{{ $t("organization.delete") }}</deBtn>
|
||||
>{{ $t("organization.delete") }}
|
||||
</deBtn>
|
||||
</el-col>
|
||||
<el-col
|
||||
:span="14"
|
||||
@ -33,10 +35,12 @@
|
||||
:plain="!!filterTexts.length"
|
||||
icon="iconfont icon-icon-filter"
|
||||
@click="filterShow"
|
||||
>{{ $t("user.filter")
|
||||
}}<template v-if="filterTexts.length">
|
||||
({{ filterTexts.length }})
|
||||
</template>
|
||||
>{{
|
||||
$t("user.filter")
|
||||
}}
|
||||
<template v-if="filterTexts.length">
|
||||
({{ filterTexts.length }})
|
||||
</template>
|
||||
</deBtn>
|
||||
<el-dropdown
|
||||
trigger="click"
|
||||
@ -45,7 +49,8 @@
|
||||
<deBtn
|
||||
secondary
|
||||
icon="el-icon-setting"
|
||||
>{{ $t("user.list") }}</deBtn>
|
||||
>{{ $t("user.list") }}
|
||||
</deBtn>
|
||||
<el-dropdown-menu
|
||||
slot="dropdown"
|
||||
class="list-columns-select"
|
||||
@ -55,7 +60,8 @@
|
||||
v-model="checkAll"
|
||||
:indeterminate="isIndeterminate"
|
||||
@change="handleCheckAllChange"
|
||||
>{{ $t("dataset.check_all") }}</el-checkbox>
|
||||
>{{ $t("dataset.check_all") }}
|
||||
</el-checkbox>
|
||||
<el-checkbox-group
|
||||
v-model="checkedColumnNames"
|
||||
@change="handleCheckedColumnNamesChange"
|
||||
@ -64,7 +70,8 @@
|
||||
v-for="column in columnNames"
|
||||
:key="column.props"
|
||||
:label="column.props"
|
||||
>{{ $t(column.label) }}</el-checkbox>
|
||||
>{{ $t(column.label) }}
|
||||
</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
@ -76,7 +83,7 @@
|
||||
>
|
||||
<span class="sum">{{ paginationConfig.total }}</span>
|
||||
<span class="title">{{ $t("user.result_one") }}</span>
|
||||
<el-divider direction="vertical" />
|
||||
<el-divider direction="vertical"/>
|
||||
<i
|
||||
v-if="showScroll"
|
||||
class="el-icon-arrow-left arrow-filter"
|
||||
@ -89,9 +96,9 @@
|
||||
class="text"
|
||||
>
|
||||
{{ ele }} <i
|
||||
class="el-icon-close"
|
||||
@click="clearOneFilter(index)"
|
||||
/>
|
||||
class="el-icon-close"
|
||||
@click="clearOneFilter(index)"
|
||||
/>
|
||||
</p>
|
||||
</div>
|
||||
<i
|
||||
@ -104,7 +111,8 @@
|
||||
class="clear-btn"
|
||||
icon="el-icon-delete"
|
||||
@click="clearFilter"
|
||||
>{{ $t("user.clear_filter") }}</el-button>
|
||||
>{{ $t("user.clear_filter") }}
|
||||
</el-button>
|
||||
</div>
|
||||
<div
|
||||
id="resize-for-filter"
|
||||
@ -154,14 +162,14 @@
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.rate === 'SIMPLE'">{{
|
||||
$t("dataset.execute_once")
|
||||
}}</span>
|
||||
$t("dataset.execute_once")
|
||||
}}</span>
|
||||
<span v-if="scope.row.rate === 'CRON'">{{
|
||||
$t("dataset.cron_config")
|
||||
}}</span>
|
||||
$t("dataset.cron_config")
|
||||
}}</span>
|
||||
<span v-if="scope.row.rate === 'SIMPLE_CRON'">{{
|
||||
$t("dataset.simple_cron")
|
||||
}}</span>
|
||||
$t("dataset.simple_cron")
|
||||
}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
@ -189,8 +197,8 @@
|
||||
v-if="scope.row.lastExecStatus"
|
||||
:class="[`de-${scope.row.lastExecStatus}-pre`, 'de-status']"
|
||||
>{{
|
||||
$t(`dataset.${scope.row.lastExecStatus.toLocaleLowerCase()}`)
|
||||
}}
|
||||
$t(`dataset.${scope.row.lastExecStatus.toLocaleLowerCase()}`)
|
||||
}}
|
||||
<svg-icon
|
||||
v-if="scope.row.lastExecStatus === 'Error'"
|
||||
style="cursor: pointer;"
|
||||
@ -244,16 +252,22 @@
|
||||
key="__operation"
|
||||
:label="$t('commons.operating')"
|
||||
fixed="right"
|
||||
width="100"
|
||||
width="160"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
class="de-text-btn mar3 mar6"
|
||||
type="text"
|
||||
@click="selectDataset(scope.row)"
|
||||
>{{
|
||||
$t(disableEdit(scope.row) ? "auth.view" : "commons.edit")
|
||||
}}</el-button>
|
||||
>{{ $t(disableEdit(scope.row) ? "auth.view" : "commons.edit") }}
|
||||
</el-button>
|
||||
<el-button
|
||||
class="de-text-btn mar3 mar6"
|
||||
:disabled="disableExec(scope.row)"
|
||||
type="text"
|
||||
@click="execTask(scope.row)"
|
||||
>{{ $t("emailtask.execute_now") }}
|
||||
</el-button>
|
||||
<el-dropdown
|
||||
size="medium"
|
||||
trigger="click"
|
||||
@ -270,12 +284,6 @@
|
||||
<template
|
||||
v-if="!['Exec'].includes(scope.row.status)"
|
||||
>
|
||||
<el-dropdown-item
|
||||
:disabled="disableExec(scope.row)"
|
||||
command="exec"
|
||||
>
|
||||
{{ $t("components.run_once") }}
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item
|
||||
v-if="scope.row.status === 'Pending'"
|
||||
command="continue"
|
||||
@ -325,18 +333,18 @@
|
||||
secondary
|
||||
@click="show_error_massage = false"
|
||||
>{{
|
||||
$t("dataset.close")
|
||||
}}</deBtn>
|
||||
$t("dataset.close")
|
||||
}}</deBtn>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { columnOptions } from './options'
|
||||
import { formatOrders } from '@/utils/index'
|
||||
import { datasetTaskList, post } from '@/api/dataset/dataset'
|
||||
import { hasDataPermission } from '@/utils/permission'
|
||||
import {columnOptions} from './options'
|
||||
import {formatOrders} from '@/utils/index'
|
||||
import {datasetTaskList, post} from '@/api/dataset/dataset'
|
||||
import {hasDataPermission} from '@/utils/permission'
|
||||
import GridTable from '@/components/gridTable/index.vue'
|
||||
import filterUser from './FilterUser.vue'
|
||||
import msgCfm from '@/components/msgCfm/index'
|
||||
@ -345,12 +353,13 @@ import keyEnter from '@/components/msgCfm/keyEnter.js'
|
||||
|
||||
export default {
|
||||
name: 'DatasetTaskList',
|
||||
components: { GridTable, filterUser },
|
||||
components: {GridTable, filterUser},
|
||||
mixins: [msgCfm, keyEnter],
|
||||
props: {
|
||||
transCondition: {
|
||||
type: Object,
|
||||
default: () => {}
|
||||
default: () => {
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@ -387,7 +396,7 @@ export default {
|
||||
}
|
||||
},
|
||||
created() {
|
||||
const { taskId, name } = this.transCondition
|
||||
const {taskId, name} = this.transCondition
|
||||
if (taskId) {
|
||||
this.nickName = name
|
||||
}
|
||||
@ -418,7 +427,7 @@ export default {
|
||||
document.querySelector('#resize-for-filter')
|
||||
)
|
||||
},
|
||||
layoutResize: _.debounce(function() {
|
||||
layoutResize: _.debounce(function () {
|
||||
this.getScrollStatus()
|
||||
}, 200),
|
||||
scrollPre() {
|
||||
@ -492,7 +501,7 @@ export default {
|
||||
this.handleCurrentChange(1)
|
||||
},
|
||||
search(showLoading = true) {
|
||||
const { taskId, name } = this.transCondition
|
||||
const {taskId, name} = this.transCondition
|
||||
const param = {
|
||||
orders: formatOrders(this.orderConditions),
|
||||
conditions: [...this.cacheCondition]
|
||||
@ -511,7 +520,7 @@ export default {
|
||||
field: 'dataset_table_task.id'
|
||||
})
|
||||
}
|
||||
const { currentPage, pageSize } = this.paginationConfig
|
||||
const {currentPage, pageSize} = this.paginationConfig
|
||||
datasetTaskList(currentPage, pageSize, param, showLoading).then(
|
||||
(response) => {
|
||||
const multipleSelection = this.multipleSelection.map(ele => ele.id)
|
||||
@ -559,7 +568,7 @@ export default {
|
||||
})
|
||||
},
|
||||
changeTaskStatus(task) {
|
||||
const { status } = task
|
||||
const {status} = task
|
||||
if (!['Pending', 'Underway'].includes(status)) {
|
||||
return
|
||||
}
|
||||
@ -599,11 +608,12 @@ export default {
|
||||
this.initSearch(true)
|
||||
})
|
||||
})
|
||||
.catch(() => {})
|
||||
.catch(() => {
|
||||
})
|
||||
},
|
||||
selectDataset(row) {
|
||||
if (row) {
|
||||
const { datasetName, id, tableId } = row
|
||||
const {datasetName, id, tableId} = row
|
||||
this.$router.push({
|
||||
path: '/task-ds-form',
|
||||
query: {
|
||||
@ -624,9 +634,7 @@ export default {
|
||||
)
|
||||
},
|
||||
disableExec(task) {
|
||||
return (task.status === 'Pending' ||
|
||||
!hasDataPermission('manage', task.privileges)
|
||||
)
|
||||
return (task.status === 'Pending' || task.status ==='Exec' || !hasDataPermission('manage', task.privileges))
|
||||
},
|
||||
disableDelete(task) {
|
||||
return false
|
||||
@ -661,6 +669,7 @@ export default {
|
||||
height: 100px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.codemirror ::v-deep .CodeMirror-scroll {
|
||||
height: 100px;
|
||||
overflow-y: auto;
|
||||
@ -708,6 +717,7 @@ export default {
|
||||
border-radius: 4px;
|
||||
}
|
||||
}
|
||||
|
||||
.table-container {
|
||||
height: calc(100% - 50px);
|
||||
|
||||
@ -744,8 +754,10 @@ export default {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.de-card-dropdown {
|
||||
margin-top: 0 !important;
|
||||
|
||||
.popper__arrow {
|
||||
display: none !important;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user