fix(web): 增加ware的归档信息格式
This commit is contained in:
@@ -2,89 +2,97 @@ import {useAmis} from "../../components/constants.js";
|
|||||||
|
|
||||||
useAmis((information) => {
|
useAmis((information) => {
|
||||||
return {
|
return {
|
||||||
"type": "wrapper",
|
|
||||||
"size": "none",
|
|
||||||
"body": [
|
|
||||||
{
|
|
||||||
"type": "wrapper",
|
"type": "wrapper",
|
||||||
"body": [
|
"body": [
|
||||||
{
|
{
|
||||||
|
"type": "property",
|
||||||
"items": [
|
"items": [
|
||||||
{
|
{
|
||||||
"label": "资源名称",
|
"content": "API资源",
|
||||||
"span": 3,
|
"label": "名称"
|
||||||
"content": "文件资源"
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"content": "FIle",
|
"label": "标签",
|
||||||
"span": 3,
|
"span": 2,
|
||||||
"label": "资源描述"
|
"content": [
|
||||||
|
{
|
||||||
|
"type": "tag",
|
||||||
|
"label": "API"
|
||||||
}
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "简介",
|
||||||
|
"span": 3,
|
||||||
|
"content": "API 资源"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"span": 3,
|
||||||
|
"content": "<p>这是API<strong>资源</strong></p>",
|
||||||
|
"label": "内容"
|
||||||
|
},
|
||||||
],
|
],
|
||||||
"type": "property"
|
"title": "商品信息"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "divider"
|
"type": "divider"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"title": "资源类型定义",
|
"type": "wrapper",
|
||||||
|
"body": [
|
||||||
|
{
|
||||||
"type": "property",
|
"type": "property",
|
||||||
"items": [
|
"items": [
|
||||||
{
|
{
|
||||||
|
"label": "资源名称",
|
||||||
"span": 3,
|
"span": 3,
|
||||||
"label": "资源类型",
|
"content": "API资源"
|
||||||
"content": "文件"
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"span": 3,
|
"span": 3,
|
||||||
"content": {
|
"label": "资源描述",
|
||||||
"type": "flex",
|
"content": "这是API资源"
|
||||||
"alignItems": "start",
|
|
||||||
"items": [
|
|
||||||
{
|
|
||||||
"label": "arthas-bin.zip",
|
|
||||||
"api": {
|
|
||||||
"method": "get",
|
|
||||||
"url": "${base}/upload/download/3557040775256064",
|
|
||||||
"headers": {
|
|
||||||
"token": "${token|default:undefined}"
|
|
||||||
},
|
|
||||||
"responseType": "blob"
|
|
||||||
},
|
|
||||||
"actionType": "ajax",
|
|
||||||
"type": "action",
|
|
||||||
"level": "link"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"direction": "column"
|
|
||||||
},
|
|
||||||
"label": "文件"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '格式详情',
|
|
||||||
content: {
|
|
||||||
type: 'editor',
|
|
||||||
language: 'json',
|
|
||||||
value: {
|
|
||||||
"name": "arthas-bin.zip",
|
|
||||||
"size": 1024,
|
|
||||||
"type": "application/zip",
|
|
||||||
"lastModified": 1673920000000,
|
|
||||||
"lastModifiedDate": "2023-01-14T14:40:00.000Z",
|
|
||||||
"webkitRelativePath": ""
|
|
||||||
}
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "divider"
|
"type": "divider"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"items": [
|
||||||
|
{
|
||||||
|
"span": 3,
|
||||||
|
"content": "API",
|
||||||
|
"label": "资源类型"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"span": 1,
|
||||||
|
"content": "administrator@eshore.com",
|
||||||
|
"label": "用户名"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "密码",
|
||||||
|
"content": "bLiN+,qAss,uo'nxoH_:d@HEdD*WdZWAudq$J'a$5Z#aS>K-*dWN5L-i<m:w/U,R",
|
||||||
|
"span": 2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"span": 3,
|
||||||
|
"content": "http://baidu.com",
|
||||||
|
"label": "地址"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"title": "资源类型定义",
|
||||||
|
"type": "property"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "divider"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"items": [
|
"items": [
|
||||||
{
|
{
|
||||||
"label": "格式类型",
|
"label": "格式类型",
|
||||||
"content": "Json"
|
"span": 3,
|
||||||
|
"content": "文件"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"type": "property",
|
"type": "property",
|
||||||
@@ -97,6 +105,7 @@ useAmis((information) => {
|
|||||||
"type": "divider"
|
"type": "divider"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"type": "property",
|
||||||
"items": [
|
"items": [
|
||||||
{
|
{
|
||||||
"label": "创建人",
|
"label": "创建人",
|
||||||
@@ -104,8 +113,8 @@ useAmis((information) => {
|
|||||||
"content": "administrator@eshore.com"
|
"content": "administrator@eshore.com"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"content": "2025-01-14 14:41:56",
|
"label": "创建时间",
|
||||||
"label": "创建时间"
|
"content": "2025-01-23 14:24:15"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"span": 2,
|
"span": 2,
|
||||||
@@ -113,12 +122,12 @@ useAmis((information) => {
|
|||||||
"label": "修改人"
|
"label": "修改人"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"content": "2025-01-14 14:41:56",
|
"label": "修改时间",
|
||||||
"label": "修改时间"
|
"content": "2025-01-23 14:24:15"
|
||||||
}
|
|
||||||
],
|
|
||||||
"type": "property"
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
],
|
||||||
|
"size": "none"
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -2,10 +2,12 @@ package com.eshore.gringotts.web.domain.service;
|
|||||||
|
|
||||||
import cn.hutool.core.map.MapUtil;
|
import cn.hutool.core.map.MapUtil;
|
||||||
import com.eshore.gringotts.web.domain.base.service.CheckingService;
|
import com.eshore.gringotts.web.domain.base.service.CheckingService;
|
||||||
|
import com.eshore.gringotts.web.domain.entity.DataResource;
|
||||||
import com.eshore.gringotts.web.domain.entity.User;
|
import com.eshore.gringotts.web.domain.entity.User;
|
||||||
import com.eshore.gringotts.web.domain.entity.Ware;
|
import com.eshore.gringotts.web.domain.entity.Ware;
|
||||||
import com.eshore.gringotts.web.domain.flowable.UserAssessor;
|
import com.eshore.gringotts.web.domain.flowable.UserAssessor;
|
||||||
import com.eshore.gringotts.web.domain.repository.WareRepository;
|
import com.eshore.gringotts.web.domain.repository.WareRepository;
|
||||||
|
import com.eshore.gringotts.web.helper.AmisHelper;
|
||||||
import com.lanyuanxiaoyao.flowable.core.model.FlowableAction;
|
import com.lanyuanxiaoyao.flowable.core.model.FlowableAction;
|
||||||
import com.lanyuanxiaoyao.flowable.core.model.FlowableInstance;
|
import com.lanyuanxiaoyao.flowable.core.model.FlowableInstance;
|
||||||
import com.lanyuanxiaoyao.flowable.core.model.FlowableListener;
|
import com.lanyuanxiaoyao.flowable.core.model.FlowableListener;
|
||||||
@@ -13,6 +15,7 @@ import com.lanyuanxiaoyao.flowable.core.model.FlowableMetadata;
|
|||||||
import com.lanyuanxiaoyao.flowable.core.model.FlowableNode;
|
import com.lanyuanxiaoyao.flowable.core.model.FlowableNode;
|
||||||
import com.lanyuanxiaoyao.flowable.jpa.SpringFlowableManager;
|
import com.lanyuanxiaoyao.flowable.jpa.SpringFlowableManager;
|
||||||
import javax.persistence.EntityManager;
|
import javax.persistence.EntityManager;
|
||||||
|
import lombok.SneakyThrows;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.eclipse.collections.api.factory.Lists;
|
import org.eclipse.collections.api.factory.Lists;
|
||||||
import org.eclipse.collections.api.list.ImmutableList;
|
import org.eclipse.collections.api.list.ImmutableList;
|
||||||
@@ -54,6 +57,7 @@ public class WareService extends CheckingService<Ware> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SneakyThrows
|
||||||
@Override
|
@Override
|
||||||
public void submit(Long id) {
|
public void submit(Long id) {
|
||||||
User user = userService.currentLoginUser();
|
User user = userService.currentLoginUser();
|
||||||
@@ -63,6 +67,7 @@ public class WareService extends CheckingService<Ware> {
|
|||||||
MapUtil.<String, Object>builder()
|
MapUtil.<String, Object>builder()
|
||||||
.put("wareId", id)
|
.put("wareId", id)
|
||||||
.put("type", "WARE")
|
.put("type", "WARE")
|
||||||
|
.put("snapshot", archive(ware))
|
||||||
.put("createdUsername", user.getUsername())
|
.put("createdUsername", user.getUsername())
|
||||||
.put("modifiedUsername", user.getUsername())
|
.put("modifiedUsername", user.getUsername())
|
||||||
.put(UserAssessor.KEY, ware.getResource().getCreatedUser().getId())
|
.put(UserAssessor.KEY, ware.getResource().getCreatedUser().getId())
|
||||||
@@ -81,7 +86,23 @@ public class WareService extends CheckingService<Ware> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Object archive(Ware entity) {
|
protected Object archive(Ware entity) {
|
||||||
return "";
|
DataResource resource = entity.getResource();
|
||||||
|
return AmisHelper.wrapper(
|
||||||
|
AmisHelper.property(
|
||||||
|
"商品信息",
|
||||||
|
AmisHelper.propertyItem("名称", entity.getName()),
|
||||||
|
AmisHelper.propertyItem(
|
||||||
|
"标签",
|
||||||
|
Lists.immutable.ofAll(entity.getTags()).collect(AmisHelper::tag)
|
||||||
|
),
|
||||||
|
AmisHelper.propertyItem("简介", entity.getDescription(), 3),
|
||||||
|
AmisHelper.propertyItem("内容", entity.getContent(), 3)
|
||||||
|
),
|
||||||
|
AmisHelper.divider(),
|
||||||
|
AmisHelper.property(resource),
|
||||||
|
AmisHelper.divider(),
|
||||||
|
AmisHelper.property(entity)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
|
|||||||
@@ -202,6 +202,13 @@ public class AmisHelper {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static ImmutableMap<Object, Object> tag(String value) {
|
||||||
|
return Maps.immutable.ofMap(MapUtil.builder()
|
||||||
|
.put("type", "tag")
|
||||||
|
.put("label", value)
|
||||||
|
.build());
|
||||||
|
}
|
||||||
|
|
||||||
public static ImmutableMap<Object, Object> editor(String language, String value) {
|
public static ImmutableMap<Object, Object> editor(String language, String value) {
|
||||||
return Maps.immutable.ofMap(MapUtil.builder()
|
return Maps.immutable.ofMap(MapUtil.builder()
|
||||||
.put("disabled", true)
|
.put("disabled", true)
|
||||||
|
|||||||
Reference in New Issue
Block a user