feat(web): 关联数据资源和确权状态
This commit is contained in:
@@ -87,17 +87,17 @@ export function permissionAddDialog() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function permissionDetailDialog() {
|
export function permissionDetailDialog(field = 'id') {
|
||||||
return {
|
return {
|
||||||
actionType: 'dialog',
|
actionType: 'dialog',
|
||||||
dialog: {
|
dialog: {
|
||||||
title: '新增确权申请',
|
title: '确权申请详情',
|
||||||
size: 'md',
|
size: 'md',
|
||||||
actions: [],
|
actions: [],
|
||||||
body: {
|
body: {
|
||||||
debug: true,
|
debug: true,
|
||||||
...detailForm(),
|
...detailForm(),
|
||||||
initApi: apiGet('${base}/confirmation/detail/${id}'),
|
initApi: apiGet(`\${base}/confirmation/detail/\${${field}}`),
|
||||||
static: true,
|
static: true,
|
||||||
data: {
|
data: {
|
||||||
detail: true,
|
detail: true,
|
||||||
|
|||||||
@@ -63,8 +63,9 @@ export function resourceList() {
|
|||||||
...resourceEditeDialog(),
|
...resourceEditeDialog(),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
disabledOn: '${confirmationId}',
|
||||||
type: 'action',
|
type: 'action',
|
||||||
label: '删除',
|
label: "${IF(confirmationId, '删除(确权中)', '删除')}",
|
||||||
confirmTitle: '确认删除',
|
confirmTitle: '确认删除',
|
||||||
confirmText: '确认删除名称为「${name}」的数据资源吗?',
|
confirmText: '确认删除名称为「${name}」的数据资源吗?',
|
||||||
actionType: 'ajax',
|
actionType: 'ajax',
|
||||||
|
|||||||
@@ -76,6 +76,9 @@ public class DataResourceController extends SimpleController<DataResource, DataR
|
|||||||
item.setDescription(dataResource.getDescription());
|
item.setDescription(dataResource.getDescription());
|
||||||
item.setType(dataResource.getType().getResourceType().name());
|
item.setType(dataResource.getType().getResourceType().name());
|
||||||
item.setFormat(dataResource.getFormat().getFormatType().name());
|
item.setFormat(dataResource.getFormat().getFormatType().name());
|
||||||
|
if (ObjectUtil.isNotNull(dataResource.getConfirmation())) {
|
||||||
|
item.setConfirmationId(dataResource.getConfirmation().getId());
|
||||||
|
}
|
||||||
item.setCreatedUser(dataResource.getCreatedUser().getUsername());
|
item.setCreatedUser(dataResource.getCreatedUser().getUsername());
|
||||||
item.setCreatedTime(dataResource.getCreatedTime());
|
item.setCreatedTime(dataResource.getCreatedTime());
|
||||||
return item;
|
return item;
|
||||||
@@ -250,6 +253,7 @@ public class DataResourceController extends SimpleController<DataResource, DataR
|
|||||||
private String description;
|
private String description;
|
||||||
private String type;
|
private String type;
|
||||||
private String format;
|
private String format;
|
||||||
|
private Long confirmationId;
|
||||||
private String createdUser;
|
private String createdUser;
|
||||||
private LocalDateTime createdTime;
|
private LocalDateTime createdTime;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.eshore.gringotts.web.domain.resource.entity;
|
|||||||
|
|
||||||
import com.eshore.gringotts.core.Constants;
|
import com.eshore.gringotts.core.Constants;
|
||||||
import com.eshore.gringotts.web.domain.base.entity.SimpleEntity;
|
import com.eshore.gringotts.web.domain.base.entity.SimpleEntity;
|
||||||
|
import com.eshore.gringotts.web.domain.confirmation.entity.Confirmation;
|
||||||
import com.eshore.gringotts.web.domain.resource.entity.format.ResourceFormat;
|
import com.eshore.gringotts.web.domain.resource.entity.format.ResourceFormat;
|
||||||
import com.eshore.gringotts.web.domain.resource.entity.type.ResourceType;
|
import com.eshore.gringotts.web.domain.resource.entity.type.ResourceType;
|
||||||
import com.eshore.gringotts.web.domain.upload.entity.DataFile;
|
import com.eshore.gringotts.web.domain.upload.entity.DataFile;
|
||||||
@@ -33,12 +34,14 @@ import org.springframework.data.jpa.domain.support.AuditingEntityListener;
|
|||||||
@NamedEntityGraph(name = "data_resource.list", attributeNodes = {
|
@NamedEntityGraph(name = "data_resource.list", attributeNodes = {
|
||||||
@NamedAttributeNode(value = "type"),
|
@NamedAttributeNode(value = "type"),
|
||||||
@NamedAttributeNode(value = "format"),
|
@NamedAttributeNode(value = "format"),
|
||||||
|
@NamedAttributeNode(value = "confirmation"),
|
||||||
@NamedAttributeNode(value = "createdUser"),
|
@NamedAttributeNode(value = "createdUser"),
|
||||||
})
|
})
|
||||||
@NamedEntityGraph(name = "data_resource.detail", attributeNodes = {
|
@NamedEntityGraph(name = "data_resource.detail", attributeNodes = {
|
||||||
@NamedAttributeNode(value = "type"),
|
@NamedAttributeNode(value = "type"),
|
||||||
@NamedAttributeNode(value = "format"),
|
@NamedAttributeNode(value = "format"),
|
||||||
@NamedAttributeNode(value = "example"),
|
@NamedAttributeNode(value = "example"),
|
||||||
|
@NamedAttributeNode(value = "confirmation"),
|
||||||
@NamedAttributeNode(value = "createdUser"),
|
@NamedAttributeNode(value = "createdUser"),
|
||||||
@NamedAttributeNode(value = "modifiedUser"),
|
@NamedAttributeNode(value = "modifiedUser"),
|
||||||
})
|
})
|
||||||
@@ -58,4 +61,7 @@ public class DataResource extends SimpleEntity {
|
|||||||
@JoinColumn(foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
|
@JoinColumn(foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
|
||||||
@ToString.Exclude
|
@ToString.Exclude
|
||||||
private DataFile example;
|
private DataFile example;
|
||||||
|
@OneToOne(cascade = CascadeType.REMOVE, fetch = FetchType.EAGER, mappedBy = "target")
|
||||||
|
@ToString.Exclude
|
||||||
|
private Confirmation confirmation;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user