diff --git a/gringotts-frontend/components/constants.js b/gringotts-frontend/components/constants.js
index 47be294..784aad4 100644
--- a/gringotts-frontend/components/constants.js
+++ b/gringotts-frontend/components/constants.js
@@ -1,5 +1,5 @@
const information = {
- debug: false,
+ debug: true,
// baseUrl: '',
baseUrl: 'http://127.0.0.1:20080',
title: '可信供给中心',
diff --git a/gringotts-frontend/components/permission/dialog-permission.js b/gringotts-frontend/components/permission/dialog-permission.js
index 7d973af..53352e5 100644
--- a/gringotts-frontend/components/permission/dialog-permission.js
+++ b/gringotts-frontend/components/permission/dialog-permission.js
@@ -10,6 +10,7 @@ import {
size100MB
} from "../constants.js";
import {resourceList} from "../../pages/index/tab-data.js";
+import {resourceDetailDialog} from "../resource/dialog-resource.js";
function detailForm(showCreatedUserAndModifiedUser = false) {
return {
@@ -36,6 +37,20 @@ function detailForm(showCreatedUserAndModifiedUser = false) {
source: apiGet('${base}/data_resource/list'),
pickerSchema: {
...resourceList(),
+ },
+ staticSchema: {
+ type: 'tpl',
+ tpl: "${targetName}",
+ onEvent: {
+ click: {
+ actions: [
+ {
+ actionType: 'dialog',
+ ...resourceDetailDialog('targetId'),
+ }
+ ]
+ }
+ }
}
},
{
@@ -88,13 +103,13 @@ export function permissionAddDialog() {
}
}
-export function permissionDetailDialog(field = 'id') {
+export function permissionDetailDialog(field = 'id', actions = []) {
return {
actionType: 'dialog',
dialog: {
title: '确权申请详情',
size: 'md',
- actions: [],
+ actions: actions,
body: {
...detailForm(true),
initApi: apiGet(`\${base}/confirmation/detail/\${${field}}`),
diff --git a/gringotts-frontend/components/resource/dialog-resource.js b/gringotts-frontend/components/resource/dialog-resource.js
index 33fd40f..7ccfdc6 100644
--- a/gringotts-frontend/components/resource/dialog-resource.js
+++ b/gringotts-frontend/components/resource/dialog-resource.js
@@ -327,7 +327,7 @@ export function resourceAddDialog() {
}
}
-export function resourceDetailDialog() {
+export function resourceDetailDialog(field = 'id') {
return {
actionType: 'dialog',
dialog: {
@@ -337,7 +337,7 @@ export function resourceDetailDialog() {
body: {
...detailForm(true),
static: true,
- initApi: apiGet('${base}/data_resource/detail/${id}'),
+ initApi: apiGet(`\${base}/data_resource/detail/\${${field}}`),
data: {
detail: true,
}
diff --git a/gringotts-frontend/pages/index/main.js b/gringotts-frontend/pages/index/main.js
index 84f0bbd..54c098f 100644
--- a/gringotts-frontend/pages/index/main.js
+++ b/gringotts-frontend/pages/index/main.js
@@ -59,9 +59,9 @@ useAmis(information => {
tabs: [
// tabOverview(),
// tabMarket(),
+ tabCheck(),
tabData(),
tabPermissions(),
- tabCheck(),
tabUser(),
tabSettings(),
]
diff --git a/gringotts-frontend/pages/index/tab-check.js b/gringotts-frontend/pages/index/tab-check.js
index 7584aa5..159a66a 100644
--- a/gringotts-frontend/pages/index/tab-check.js
+++ b/gringotts-frontend/pages/index/tab-check.js
@@ -1,4 +1,5 @@
-import {checkerOnly} from "../../components/constants.js";
+import {apiGet, apiPost, checkerOnly, crudCommonOptions} from "../../components/constants.js";
+import {permissionDetailDialog} from "../../components/permission/dialog-permission.js";
export function tabCheck() {
return {
@@ -6,7 +7,53 @@ export function tabCheck() {
title: '审核审查',
icon: 'fa fa-shield-halved',
body: [
- 'hello world'
+ {
+ type: 'crud',
+ api: apiGet('${base}/check/list'),
+ ...crudCommonOptions(),
+ headerToolbar: [
+ 'reload',
+ ],
+ columns: [
+ {
+ name: 'name',
+ label: '描述',
+ },
+ {
+ label: '操作',
+ width: 100,
+ type: 'operation',
+ fixed: 'right',
+ className: 'nowrap',
+ buttons: [
+ {
+ type: 'action',
+ label: '查看',
+ level: 'link',
+ ...permissionDetailDialog(
+ 'parameters.confirmationId',
+ [
+ {
+ type: 'each',
+ name: 'operations',
+ items: {
+ type: 'action',
+ label: '${item.name}',
+ level: '${item.level}',
+ actionType: 'ajax',
+ api: {
+ ...apiPost('${base}/check/operation/${item.operation}'),
+ data: '${parameters}'
+ }
+ }
+ },
+ ]
+ ),
+ },
+ ]
+ }
+ ]
+ }
]
}
}
\ No newline at end of file
diff --git a/gringotts-web/src/main/java/com/eshore/gringotts/web/domain/base/service/CheckingService.java b/gringotts-web/src/main/java/com/eshore/gringotts/web/domain/base/service/CheckingService.java
new file mode 100644
index 0000000..41fc773
--- /dev/null
+++ b/gringotts-web/src/main/java/com/eshore/gringotts/web/domain/base/service/CheckingService.java
@@ -0,0 +1,45 @@
+package com.eshore.gringotts.web.domain.base.service;
+
+import lombok.Data;
+import lombok.Value;
+import org.eclipse.collections.api.list.ImmutableList;
+import org.eclipse.collections.api.map.ImmutableMap;
+
+/**
+ * 需要审查
+ *
+ * @author lanyuanxiaoyao
+ * @date 2024-11-28
+ */
+public interface CheckingService {
+ ImmutableList checkingList();
+
+ void onChecked(String operation, ImmutableMap parameters);
+
+ @Value
+ class CheckOrder {
+ String name;
+ ImmutableList operations;
+ ImmutableMap parameters;
+ }
+
+ @Data
+ class CheckOperation {
+ /**
+ * 全局唯一
+ */
+ private final String operation;
+ private final String name;
+ private final String level;
+
+ public CheckOperation(String operation, String name) {
+ this(operation, name, "default");
+ }
+
+ public CheckOperation(String operation, String name, String level) {
+ this.operation = operation;
+ this.name = name;
+ this.level = level;
+ }
+ }
+}
diff --git a/gringotts-web/src/main/java/com/eshore/gringotts/web/domain/check/controller/CheckController.java b/gringotts-web/src/main/java/com/eshore/gringotts/web/domain/check/controller/CheckController.java
new file mode 100644
index 0000000..6f73c7b
--- /dev/null
+++ b/gringotts-web/src/main/java/com/eshore/gringotts/web/domain/check/controller/CheckController.java
@@ -0,0 +1,61 @@
+package com.eshore.gringotts.web.domain.check.controller;
+
+import cn.hutool.core.util.ObjectUtil;
+import com.eshore.gringotts.web.configuration.amis.AmisResponse;
+import com.eshore.gringotts.web.domain.base.controller.ListController;
+import com.eshore.gringotts.web.domain.base.service.CheckingService;
+import lombok.extern.slf4j.Slf4j;
+import org.eclipse.collections.api.factory.Lists;
+import org.eclipse.collections.api.factory.Maps;
+import org.eclipse.collections.api.list.ImmutableList;
+import org.eclipse.collections.api.map.ImmutableMap;
+import org.eclipse.collections.api.map.MutableMap;
+import org.springframework.context.ApplicationContext;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * 监管
+ *
+ * @author lanyuanxiaoyao
+ * @date 2024-11-28
+ */
+@Slf4j
+@RestController
+@RequestMapping("check")
+public class CheckController implements ListController {
+ private final ImmutableList checkingServices;
+ private final MutableMap serviceMap = Maps.mutable.empty().asSynchronized();
+
+ public CheckController(ApplicationContext applicationContext) {
+ this.checkingServices = Lists.immutable.ofAll(applicationContext.getBeansOfType(CheckingService.class).values());
+ }
+
+ @GetMapping("/list")
+ @Override
+ public AmisResponse> list() throws Exception {
+ return AmisResponse.responseSuccess(
+ checkingServices.flatCollect(checkingService -> {
+ ImmutableList orders = checkingService.checkingList();
+ orders.flatCollect(CheckingService.CheckOrder::getOperations)
+ .forEach(operation -> serviceMap.put(operation.getOperation(), checkingService));
+ return orders;
+ })
+ );
+ }
+
+ @PostMapping("/operation/{operation}")
+ public AmisResponse