feat(web): 增加数据资源确权状态显示
This commit is contained in:
@@ -175,6 +175,7 @@ export const userStateMapping = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
export const confirmationStateMapping = [
|
export const confirmationStateMapping = [
|
||||||
|
mappingItem('未确权', 'NONE'),
|
||||||
mappingItem('草稿', 'DRAFT', 'bg-primary'),
|
mappingItem('草稿', 'DRAFT', 'bg-primary'),
|
||||||
mappingItem('审查中', 'CHECKING', 'bg-warning'),
|
mappingItem('审查中', 'CHECKING', 'bg-warning'),
|
||||||
mappingItem('通过', 'NORMAL', 'bg-success'),
|
mappingItem('通过', 'NORMAL', 'bg-success'),
|
||||||
@@ -199,6 +200,21 @@ export function apiPost(url) {
|
|||||||
return api('post', url)
|
return api('post', url)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function arrayInCheck(array, field) {
|
||||||
|
return `\${ARRAYINCLUDES(['${array.join("','")}'], ${field})}`
|
||||||
|
}
|
||||||
|
|
||||||
|
export function arrayOutCheck(array, field) {
|
||||||
|
return `\${!ARRAYINCLUDES(['${array.join("','")}'], ${field})}`
|
||||||
|
}
|
||||||
|
|
||||||
|
export const confirmationState = {
|
||||||
|
none: 'NONE',
|
||||||
|
draft: 'DRAFT',
|
||||||
|
checking: 'CHECKING',
|
||||||
|
normal: 'NORMAL',
|
||||||
|
}
|
||||||
|
|
||||||
export function roleCheck(roles) {
|
export function roleCheck(roles) {
|
||||||
return `\${ARRAYINCLUDES(['${roles.join("','")}'], role)}`
|
return `\${ARRAYINCLUDES(['${roles.join("','")}'], role)}`
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,8 +59,8 @@ useAmis(information => {
|
|||||||
tabs: [
|
tabs: [
|
||||||
// tabOverview(),
|
// tabOverview(),
|
||||||
// tabMarket(),
|
// tabMarket(),
|
||||||
tabCheck(),
|
|
||||||
tabData(),
|
tabData(),
|
||||||
|
tabCheck(),
|
||||||
tabPermissions(),
|
tabPermissions(),
|
||||||
tabUser(),
|
tabUser(),
|
||||||
tabSettings(),
|
tabSettings(),
|
||||||
|
|||||||
@@ -3,7 +3,16 @@ import {
|
|||||||
resourceDetailDialog,
|
resourceDetailDialog,
|
||||||
resourceEditeDialog
|
resourceEditeDialog
|
||||||
} from "../../components/resource/dialog-resource.js";
|
} from "../../components/resource/dialog-resource.js";
|
||||||
import {apiGet, crudCommonOptions, userOnly} from "../../components/constants.js";
|
import {
|
||||||
|
apiGet,
|
||||||
|
arrayInCheck,
|
||||||
|
arrayOutCheck,
|
||||||
|
confirmationState,
|
||||||
|
confirmationStateMapping,
|
||||||
|
crudCommonOptions,
|
||||||
|
mappingField,
|
||||||
|
userOnly
|
||||||
|
} from "../../components/constants.js";
|
||||||
|
|
||||||
export function resourceList() {
|
export function resourceList() {
|
||||||
return {
|
return {
|
||||||
@@ -23,12 +32,18 @@ export function resourceList() {
|
|||||||
{
|
{
|
||||||
label: '名称',
|
label: '名称',
|
||||||
name: 'name',
|
name: 'name',
|
||||||
width: 200,
|
width: 150,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '描述',
|
label: '描述',
|
||||||
name: 'description',
|
name: 'description',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: '确权状态',
|
||||||
|
width: 80,
|
||||||
|
align: 'center',
|
||||||
|
...mappingField('confirmationState', confirmationStateMapping)
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: '创建时间',
|
label: '创建时间',
|
||||||
width: 150,
|
width: 150,
|
||||||
@@ -57,14 +72,18 @@ export function resourceList() {
|
|||||||
trigger: 'hover',
|
trigger: 'hover',
|
||||||
buttons: [
|
buttons: [
|
||||||
{
|
{
|
||||||
disabledOn: '${confirmationId}',
|
disabledOn: arrayOutCheck([confirmationState.none, confirmationState.draft], 'confirmationState'),
|
||||||
|
disabledTip: '审查或确权成功后无法编辑',
|
||||||
|
tooltipPlacement: 'top',
|
||||||
type: 'action',
|
type: 'action',
|
||||||
label: '编辑',
|
label: '编辑',
|
||||||
level: 'link',
|
level: 'link',
|
||||||
...resourceEditeDialog(),
|
...resourceEditeDialog(),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
disabledOn: '${confirmationId}',
|
disabledOn: arrayInCheck([confirmationState.checking], 'confirmationState'),
|
||||||
|
disabledTip: '审查中无法删除',
|
||||||
|
tooltipPlacement: 'bottom',
|
||||||
type: 'action',
|
type: 'action',
|
||||||
label: "删除",
|
label: "删除",
|
||||||
confirmTitle: '确认删除',
|
confirmTitle: '确认删除',
|
||||||
|
|||||||
@@ -64,6 +64,10 @@ public class Confirmation extends SimpleEntity {
|
|||||||
private State state = State.DRAFT;
|
private State state = State.DRAFT;
|
||||||
|
|
||||||
public enum State {
|
public enum State {
|
||||||
|
/**
|
||||||
|
* 无确权
|
||||||
|
*/
|
||||||
|
NONE,
|
||||||
/**
|
/**
|
||||||
* 草稿
|
* 草稿
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import com.eshore.gringotts.web.domain.base.controller.SimpleControllerSupport;
|
|||||||
import com.eshore.gringotts.web.domain.base.entity.FileInfo;
|
import com.eshore.gringotts.web.domain.base.entity.FileInfo;
|
||||||
import com.eshore.gringotts.web.domain.base.entity.SimpleListItem;
|
import com.eshore.gringotts.web.domain.base.entity.SimpleListItem;
|
||||||
import com.eshore.gringotts.web.domain.base.entity.SimpleSaveItem;
|
import com.eshore.gringotts.web.domain.base.entity.SimpleSaveItem;
|
||||||
|
import com.eshore.gringotts.web.domain.confirmation.entity.Confirmation;
|
||||||
import com.eshore.gringotts.web.domain.resource.entity.DataResource;
|
import com.eshore.gringotts.web.domain.resource.entity.DataResource;
|
||||||
import com.eshore.gringotts.web.domain.resource.entity.format.CsvResourceFormat;
|
import com.eshore.gringotts.web.domain.resource.entity.format.CsvResourceFormat;
|
||||||
import com.eshore.gringotts.web.domain.resource.entity.format.JsonLineResourceFormat;
|
import com.eshore.gringotts.web.domain.resource.entity.format.JsonLineResourceFormat;
|
||||||
@@ -78,6 +79,9 @@ public class DataResourceController extends SimpleControllerSupport<DataResource
|
|||||||
item.setFormat(dataResource.getFormat().getFormatType().name());
|
item.setFormat(dataResource.getFormat().getFormatType().name());
|
||||||
if (ObjectUtil.isNotNull(dataResource.getConfirmation())) {
|
if (ObjectUtil.isNotNull(dataResource.getConfirmation())) {
|
||||||
item.setConfirmationId(dataResource.getConfirmation().getId());
|
item.setConfirmationId(dataResource.getConfirmation().getId());
|
||||||
|
item.setConfirmationState(dataResource.getConfirmation().getState());
|
||||||
|
} else {
|
||||||
|
item.setConfirmationState(Confirmation.State.NONE);
|
||||||
}
|
}
|
||||||
item.setCreatedUser(dataResource.getCreatedUser().getUsername());
|
item.setCreatedUser(dataResource.getCreatedUser().getUsername());
|
||||||
item.setCreatedTime(dataResource.getCreatedTime());
|
item.setCreatedTime(dataResource.getCreatedTime());
|
||||||
@@ -250,6 +254,7 @@ public class DataResourceController extends SimpleControllerSupport<DataResource
|
|||||||
private String type;
|
private String type;
|
||||||
private String format;
|
private String format;
|
||||||
private Long confirmationId;
|
private Long confirmationId;
|
||||||
|
private Confirmation.State confirmationState;
|
||||||
private String createdUser;
|
private String createdUser;
|
||||||
private LocalDateTime createdTime;
|
private LocalDateTime createdTime;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user