feat(web): 增加确权信息新增、查看接口和适配
This commit is contained in:
@@ -1,9 +1,30 @@
|
|||||||
import './dialog-permission.css'
|
import './dialog-permission.css'
|
||||||
import {apiPost, horizontalFormOptions} from "../constants.js";
|
import {apiGet, apiPost, horizontalFormOptions, inputFileFormItemCommonOptions, size100MB} from "../constants.js";
|
||||||
|
import {resourceList} from "../../pages/index/tab-data.js";
|
||||||
|
|
||||||
|
function inputFileFormItemUpdateFieldOptions(target) {
|
||||||
|
let value = {}
|
||||||
|
value[target] = '${event.data.value}'
|
||||||
|
return {
|
||||||
|
onEvent: {
|
||||||
|
success: {
|
||||||
|
actions: [
|
||||||
|
// {
|
||||||
|
// actionType: 'setValue',
|
||||||
|
// componentId: 'permission_form',
|
||||||
|
// args: {
|
||||||
|
// value: value
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function detailForm() {
|
function detailForm() {
|
||||||
return {
|
return {
|
||||||
id: 'resource_data_form',
|
id: 'permission_form',
|
||||||
type: 'form',
|
type: 'form',
|
||||||
...horizontalFormOptions(),
|
...horizontalFormOptions(),
|
||||||
horizontal: {
|
horizontal: {
|
||||||
@@ -14,10 +35,33 @@ function detailForm() {
|
|||||||
type: 'hidden',
|
type: 'hidden',
|
||||||
name: 'id',
|
name: 'id',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
type: 'picker',
|
||||||
|
name: 'targetId',
|
||||||
|
label: '数据资源',
|
||||||
|
required: true,
|
||||||
|
multiple: false,
|
||||||
|
size: 'lg',
|
||||||
|
valueField: 'id',
|
||||||
|
labelField: 'name',
|
||||||
|
source: apiGet('${base}/data_resource/list'),
|
||||||
|
pickerSchema: {
|
||||||
|
...resourceList(),
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
type: 'textarea',
|
type: 'textarea',
|
||||||
label: '确权说明',
|
label: '确权说明',
|
||||||
name: 'description',
|
name: 'description',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'input-file',
|
||||||
|
label: '相关材料',
|
||||||
|
name: 'evidenceIds',
|
||||||
|
multiple: true,
|
||||||
|
required: true,
|
||||||
|
extractValue: true,
|
||||||
|
...inputFileFormItemCommonOptions(undefined, size100MB),
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -51,3 +95,23 @@ export function permissionAddDialog() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function permissionDetailDialog() {
|
||||||
|
return {
|
||||||
|
actionType: 'dialog',
|
||||||
|
dialog: {
|
||||||
|
title: '新增确权申请',
|
||||||
|
size: 'md',
|
||||||
|
actions: [],
|
||||||
|
body: {
|
||||||
|
debug: true,
|
||||||
|
...detailForm(),
|
||||||
|
initApi: apiGet('${base}/confirmation/detail/${id}'),
|
||||||
|
static: true,
|
||||||
|
data: {
|
||||||
|
detail: true,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -5,17 +5,10 @@ import {
|
|||||||
} from "../../components/resource/dialog-resource.js";
|
} from "../../components/resource/dialog-resource.js";
|
||||||
import {apiGet, crudCommonOptions, userOnly} from "../../components/constants.js";
|
import {apiGet, crudCommonOptions, userOnly} from "../../components/constants.js";
|
||||||
|
|
||||||
export function tabData() {
|
export function resourceList() {
|
||||||
return {
|
return {
|
||||||
visibleOn: userOnly,
|
|
||||||
title: '数据资源',
|
|
||||||
icon: 'fa fa-database',
|
|
||||||
body: [
|
|
||||||
{
|
|
||||||
type: 'crud',
|
type: 'crud',
|
||||||
api: {
|
api: apiGet('${base}/data_resource/list'),
|
||||||
...apiGet('${base}/data_resource/list')
|
|
||||||
},
|
|
||||||
...crudCommonOptions(),
|
...crudCommonOptions(),
|
||||||
headerToolbar: [
|
headerToolbar: [
|
||||||
'reload',
|
'reload',
|
||||||
@@ -52,16 +45,10 @@ export function tabData() {
|
|||||||
buttons: [
|
buttons: [
|
||||||
{
|
{
|
||||||
type: 'action',
|
type: 'action',
|
||||||
label: '查看',
|
label: '详情',
|
||||||
level: 'link',
|
level: 'link',
|
||||||
...resourceDetailDialog(),
|
...resourceDetailDialog(),
|
||||||
},
|
},
|
||||||
{
|
|
||||||
type: 'action',
|
|
||||||
label: '编辑',
|
|
||||||
level: 'link',
|
|
||||||
...resourceEditeDialog(),
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
type: 'dropdown-button',
|
type: 'dropdown-button',
|
||||||
level: 'link',
|
level: 'link',
|
||||||
@@ -71,8 +58,9 @@ export function tabData() {
|
|||||||
buttons: [
|
buttons: [
|
||||||
{
|
{
|
||||||
type: 'action',
|
type: 'action',
|
||||||
label: '申请确权',
|
label: '编辑',
|
||||||
level: 'link',
|
level: 'link',
|
||||||
|
...resourceEditeDialog(),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'action',
|
type: 'action',
|
||||||
@@ -88,6 +76,13 @@ export function tabData() {
|
|||||||
},
|
},
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
}
|
||||||
|
|
||||||
|
export function tabData() {
|
||||||
|
return {
|
||||||
|
visibleOn: userOnly,
|
||||||
|
title: '数据资源',
|
||||||
|
icon: 'fa fa-database',
|
||||||
|
body: resourceList(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import {apiGet, crudCommonOptions, providerOnly, userOnly} from "../../components/constants.js";
|
import {apiGet, crudCommonOptions, providerOnly, userOnly} from "../../components/constants.js";
|
||||||
import {permissionAddDialog} from "../../components/permission/dialog-permission.js";
|
import {permissionAddDialog, permissionDetailDialog} from "../../components/permission/dialog-permission.js";
|
||||||
|
|
||||||
export function tabPermissions() {
|
export function tabPermissions() {
|
||||||
return {
|
return {
|
||||||
@@ -55,6 +55,7 @@ export function tabPermissions() {
|
|||||||
type: 'action',
|
type: 'action',
|
||||||
label: '查看',
|
label: '查看',
|
||||||
level: 'link',
|
level: 'link',
|
||||||
|
...permissionDetailDialog(),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'action',
|
type: 'action',
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.eshore.gringotts.web.domain.base.entity;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public final class FileInfo {
|
||||||
|
private Long id;
|
||||||
|
private String name;
|
||||||
|
private String filename;
|
||||||
|
private Long value;
|
||||||
|
private String state;
|
||||||
|
}
|
||||||
@@ -1,12 +1,13 @@
|
|||||||
package com.eshore.gringotts.web.domain.confirmation.controller;
|
package com.eshore.gringotts.web.domain.confirmation.controller;
|
||||||
|
|
||||||
import com.eshore.gringotts.web.domain.base.controller.SimpleController;
|
import com.eshore.gringotts.web.domain.base.controller.SimpleController;
|
||||||
|
import com.eshore.gringotts.web.domain.base.entity.FileInfo;
|
||||||
|
import com.eshore.gringotts.web.domain.base.entity.SimpleDetailItem;
|
||||||
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.confirmation.entity.Confirmation;
|
||||||
import com.eshore.gringotts.web.domain.confirmation.service.ConfirmationService;
|
import com.eshore.gringotts.web.domain.confirmation.service.ConfirmationService;
|
||||||
import com.eshore.gringotts.web.domain.resource.service.DataResourceService;
|
import com.eshore.gringotts.web.domain.resource.service.DataResourceService;
|
||||||
import com.eshore.gringotts.web.domain.upload.entity.DataFile;
|
|
||||||
import com.eshore.gringotts.web.domain.upload.service.DataFileService;
|
import com.eshore.gringotts.web.domain.upload.service.DataFileService;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
@@ -76,11 +77,27 @@ public class ConfirmationController extends SimpleController<Confirmation, Confi
|
|||||||
|
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
public static final class DetailItem extends SaveItem {
|
public static final class DetailItem extends SimpleDetailItem<Confirmation> {
|
||||||
|
private Long targetId;
|
||||||
|
private String targetName;
|
||||||
|
private String description;
|
||||||
|
private ImmutableSet<FileInfo> evidenceIds;
|
||||||
|
|
||||||
public DetailItem(Confirmation confirmation) {
|
public DetailItem(Confirmation confirmation) {
|
||||||
this.setId(confirmation.getId());
|
this.setId(confirmation.getId());
|
||||||
|
this.setTargetId(confirmation.getTarget().getId());
|
||||||
|
this.setTargetName(confirmation.getTarget().getName());
|
||||||
this.setDescription(confirmation.getDescription());
|
this.setDescription(confirmation.getDescription());
|
||||||
this.setEvidenceIds(Sets.immutable.ofAll(confirmation.getEvidences()).collect(DataFile::getId));
|
this.setEvidenceIds(
|
||||||
|
Sets.immutable.ofAll(confirmation.getEvidences())
|
||||||
|
.collect(file -> new FileInfo(
|
||||||
|
file.getId(),
|
||||||
|
file.getFilename(),
|
||||||
|
file.getFilename(),
|
||||||
|
file.getId(),
|
||||||
|
"uploaded"
|
||||||
|
))
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,4 +34,4 @@ logging:
|
|||||||
EventSubscribeImp: error
|
EventSubscribeImp: error
|
||||||
gringotts:
|
gringotts:
|
||||||
upload:
|
upload:
|
||||||
upload-path: /Users/lanyuanxiaoyao/Project/IdeaProjects/gringotts/gringotts-web/target/upload
|
upload-path: C:\Users\lanyuanxiaoyao\Projects\gringotts\gringotts-web\target
|
||||||
Reference in New Issue
Block a user