@appthen/cli 1.2.10 → 1.2.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.gitignore +1 -0
- package/bin/main.js +92 -0
- package/dist/index.js +7014 -14988
- package/package.json +8 -1
- package/tests/test-app/.appthen/shadow-space-100001-test-app-e99876b1.json +1862 -0
- package/tests/test-app/.appthen/space-config.json +8 -0
- package/tests/test-app/docs/AI-Workflow.flow +112 -0
- package/tests/test-app/docs/Logic-1.flow +16 -0
- package/tests/test-app/docs/Logic.flow +16 -0
- package/tests/test-app/docs/Project-Blueprint-1.flow +119 -0
- package/tests/test-app/docs/Project-Blueprint.flow +119 -0
- package/tests/test-app/docs/README.md +3 -0
- package/tests/test-app/docs/claude.md +194 -0
- package/tests/test-app/docs/page_requirement_analysis.md +149 -0
- package/tests/test-app/docs//345/267/245/345/215/225/347/256/241/347/220/206/347/263/273/347/273/237/350/257/246/347/273/206/350/256/276/350/256/241.md +377 -0
- package/tests/test-app/src/apis/AddTodoPost.api.ts +42 -0
- package/tests/test-app/src/apis/DeleteTodoPost.api.ts +32 -0
- package/tests/test-app/src/apis/GetListPost.api.ts +38 -0
- package/tests/test-app/src/apis/TicketAttachmentUploadPost.api.ts +42 -0
- package/tests/test-app/src/apis/UpdateTodoPost.api.ts +46 -0
- package/tests/test-app/src/app.css +15 -0
- package/tests/test-app/src/cloud_functions/ticket|attachment|upload.node.ts +86 -0
- package/tests/test-app/src/cloud_functions/ticket|comment|add.node.ts +65 -0
- package/tests/test-app/src/cloud_functions/types|entity|Ticket.node.ts +88 -0
- package/tests/test-app/src/cloud_functions/types|entity|TicketAttachment.node.ts +70 -0
- package/tests/test-app/src/cloud_functions/types|entity|TicketCategory.node.ts +56 -0
- package/tests/test-app/src/cloud_functions/types|entity|TicketComment.node.ts +62 -0
- package/tests/test-app/src/cloud_functions/types|entity|TicketHistory.node.ts +74 -0
- package/tests/test-app/src/cloud_functions/types|entity|TicketPriority.node.ts +68 -0
- package/tests/test-app/src/cloud_functions/types|entity|TicketStatus.node.ts +63 -0
- package/tests/test-app/src/cloud_functions/types|models|CreateTicketParams.node.ts +20 -0
- package/tests/test-app/src/cloud_functions/types|models|TicketListParams.node.ts +30 -0
- package/tests/test-app/src/cloud_functions/types|models|UpdateTicketParams.node.ts +22 -0
- package/tests/test-app/src/components/Button.js +11 -0
- package/tests/test-app/src/components/MessageCenter.tsx +506 -0
- package/tests/test-app/src/components/MouduleDemoNzp.tsx +40 -0
- package/tests/test-app/src/components/Timeline.tsx +145 -0
- package/tests/test-app/src/index.ts +2 -0
- package/tests/test-app/src/modules/work_order_module/apis/TicketCommentAddPost.api.ts +48 -0
- package/tests/test-app/src/modules/work_order_module/apis/TicketCreatePost.api.ts +52 -0
- package/tests/test-app/src/modules/work_order_module/apis/TicketDeleteDelete.api.ts +39 -0
- package/tests/test-app/src/modules/work_order_module/apis/TicketDetailGet.api.ts +39 -0
- package/tests/test-app/src/modules/work_order_module/apis/TicketListGet.api.ts +61 -0
- package/tests/test-app/src/modules/work_order_module/apis/TicketUpdatePut.api.ts +57 -0
- package/tests/test-app/src/modules/work_order_module/apis/TrainDoorFaultListGet.ts +76 -0
- package/tests/test-app/src/modules/work_order_module/apis/TrainDoorListGet.ts +76 -0
- package/tests/test-app/src/modules/work_order_module/apis/TrainDoorOperationRecordsGet.ts +284 -0
- package/tests/test-app/src/modules/work_order_module/apis/TrainDoorStatisticsGet.ts +96 -0
- package/tests/test-app/src/modules/work_order_module/cloud_function/category|list.node.ts +40 -0
- package/tests/test-app/src/modules/work_order_module/cloud_function/priority|list.node.ts +26 -0
- package/tests/test-app/src/modules/work_order_module/cloud_function/status|list.node.ts +26 -0
- package/tests/test-app/src/modules/work_order_module/cloud_function/ticket|create.node.ts +54 -0
- package/tests/test-app/src/modules/work_order_module/cloud_function/ticket|delete.node.ts +55 -0
- package/tests/test-app/src/modules/work_order_module/cloud_function/ticket|detail.node.ts +65 -0
- package/tests/test-app/src/modules/work_order_module/cloud_function/ticket|list.node.ts +85 -0
- package/tests/test-app/src/modules/work_order_module/cloud_function/ticket|update.node.ts +73 -0
- package/tests/test-app/src/modules/work_order_module/data_model/Ticket.m.ts +85 -0
- package/tests/test-app/src/modules/work_order_module/data_model/TicketCategory.m.ts +53 -0
- package/tests/test-app/src/modules/work_order_module/data_model/TicketStatus.m.ts +60 -0
- package/tests/test-app/src/modules/work_order_module//345/267/245/345/215/225/347/263/273/347/273/237/344/272/247/345/223/201/350/256/276/350/256/241/346/226/207/346/241/243.md +301 -0
- package/tests/test-app/src/modules/work_order_module//345/267/245/345/215/225/347/263/273/347/273/237/345/274/200/345/217/221/344/273/273/345/212/241/345/210/206/345/267/245/346/226/207/346/241/243.md +345 -0
- package/tests/test-app/src/pages/CustomerManagement.tsx +535 -0
- package/tests/test-app/src/pages/CyberpunkDashboard.tsx +348 -0
- package/tests/test-app/src/pages/CyberpunkProductManagement.tsx +637 -0
- package/tests/test-app/src/pages/CyberpunkUserList.tsx +316 -0
- package/tests/test-app/src/pages/DashboardV2.tsx +334 -0
- package/tests/test-app/src/pages/DataReport.tsx +298 -0
- package/tests/test-app/src/pages/DataStatistics.tsx +317 -0
- package/tests/test-app/src/pages/DepartmentManagement.tsx +503 -0
- package/tests/test-app/src/pages/FileExplorer.tsx +441 -0
- package/tests/test-app/src/pages/OrderDetail.tsx +393 -0
- package/tests/test-app/src/pages/ProductManagement.tsx +521 -0
- package/tests/test-app/src/pages/ProjectTimeline.tsx +395 -0
- package/tests/test-app/src/pages/RoleManagement.tsx +523 -0
- package/tests/test-app/src/pages/SLAManagement.tsx +668 -0
- package/tests/test-app/src/pages/StaticCyberpunkDashboard.tsx +462 -0
- package/tests/test-app/src/pages/StaticCyberpunkUserList.tsx +567 -0
- package/tests/test-app/src/pages/StudentWeaknessList.tsx +547 -0
- package/tests/test-app/src/pages/SystemSettings.tsx +422 -0
- package/tests/test-app/src/pages/TaskManagement.tsx +467 -0
- package/tests/test-app/src/pages/TicketCreate.tsx +27 -0
- package/tests/test-app/src/pages/TicketDetail.tsx +27 -0
- package/tests/test-app/src/pages/TicketList.tsx +27 -0
- package/tests/test-app/src/pages/TicketManagement.tsx +402 -0
- package/tests/test-app/src/pages/TicketManagementPage.tsx +1238 -0
- package/tests/test-app/src/pages/UserProfile.tsx +404 -0
- package/tests/test-app/src/pages/VisualAIIDEUpgrade.tsx +245 -0
- package/tests/test-app/src/pages/WorkflowDesigner.tsx +434 -0
- package/tests/test-app/src/pages/admin/dashboard.tsx +591 -0
- package/tests/test-app/src/pages/appthen_guide/ComponentTreeUnderstanding.tsx +26 -0
- package/tests/test-app/src/pages/appthen_guide/DataBindingLearning.tsx +26 -0
- package/tests/test-app/src/pages/article-list.tsx +222 -0
- package/tests/test-app/src/pages/babyProductRecommendationPage.tsx +168 -0
- package/tests/test-app/src/pages/back-end/adminRootLayout.tsx +155 -0
- package/tests/test-app/src/pages/back-end/adminRootLayout10.tsx +157 -0
- package/tests/test-app/src/pages/back-end/adminRootLayout2.tsx +156 -0
- package/tests/test-app/src/pages/back-end/adminRootLayout3.tsx +156 -0
- package/tests/test-app/src/pages/back-end/adminRootLayout4.tsx +157 -0
- package/tests/test-app/src/pages/back-end/adminRootLayout5.tsx +157 -0
- package/tests/test-app/src/pages/back-end/adminRootLayout6.tsx +157 -0
- package/tests/test-app/src/pages/back-end/adminRootLayout7.tsx +157 -0
- package/tests/test-app/src/pages/back-end/adminRootLayout8.tsx +157 -0
- package/tests/test-app/src/pages/back-end/adminRootLayout9.tsx +157 -0
- package/tests/test-app/src/pages/back-end/backgroundManagementSystem.css +5 -0
- package/tests/test-app/src/pages/back-end/backgroundManagementSystem.tsx +1745 -0
- package/tests/test-app/src/pages/category-list.tsx +179 -0
- package/tests/test-app/src/pages/comment-list.tsx +194 -0
- package/tests/test-app/src/pages/component/WorkOrderCard.tsx +140 -0
- package/tests/test-app/src/pages/cover.tsx +42 -0
- package/tests/test-app/src/pages/cyberpunk/cyberpunkCRMPage.tsx +1299 -0
- package/tests/test-app/src/pages/data-analytics.tsx +1872 -0
- package/tests/test-app/src/pages/data-overview.tsx +600 -0
- package/tests/test-app/src/pages/data_dashboard/blueBrightGreenTechnologyWind.css +181 -0
- package/tests/test-app/src/pages/data_dashboard/blueBrightGreenTechnologyWind.tsx +225 -0
- package/tests/test-app/src/pages/data_dashboard/blueLargeScreen.css +181 -0
- package/tests/test-app/src/pages/data_dashboard/blueLargeScreen.tsx +138 -0
- package/tests/test-app/src/pages/data_dashboard/component_library/BlueBrightGreenBorder.tsx +47 -0
- package/tests/test-app/src/pages/data_dashboard/component_library/FullScreenContainer.tsx +133 -0
- package/tests/test-app/src/pages/demo-error-page.tsx +119 -0
- package/tests/test-app/src/pages/department-list.tsx +183 -0
- package/tests/test-app/src/pages/description_of_mock_interface.md +32 -0
- package/tests/test-app/src/pages/digitalLargeScreen.css +181 -0
- package/tests/test-app/src/pages/digitalLargeScreen.tsx +1417 -0
- package/tests/test-app/src/pages/goods-list.tsx +233 -0
- package/tests/test-app/src/pages/housekeeping/adminDashboardPage.tsx +880 -0
- package/tests/test-app/src/pages/mobile_terminal/PersonalCenter.css +3 -0
- package/tests/test-app/src/pages/mobile_terminal/PersonalCenter.tsx +362 -0
- package/tests/test-app/src/pages/mobile_terminal/WorkOrderHomepage.tsx +337 -0
- package/tests/test-app/src/pages/mobile_terminal/newWorkOrder.tsx +224 -0
- package/tests/test-app/src/pages/mobile_terminal/tabbar.tsx +67 -0
- package/tests/test-app/src/pages/mobile_terminal/uiHandsOnPractice.tsx +638 -0
- package/tests/test-app/src/pages/mobile_terminal/workOrderDetails.tsx +346 -0
- package/tests/test-app/src/pages/mobile_terminal/workOrderPage.tsx +345 -0
- package/tests/test-app/src/pages/notice-list.tsx +217 -0
- package/tests/test-app/src/pages/order-detail.tsx +330 -0
- package/tests/test-app/src/pages/order-list.tsx +195 -0
- package/tests/test-app/src/pages/order-management.tsx +563 -0
- package/tests/test-app/src/pages/page/OrderList.tsx +230 -0
- package/tests/test-app/src/pages/role-list.tsx +184 -0
- package/tests/test-app/src/pages/simple/simplePage.tsx +92 -0
- package/tests/test-app/src/pages/simple-page.tsx +43 -0
- package/tests/test-app/src/pages/test-destructure.tsx +44 -0
- package/tests/test-app/src/pages/test-error-page.tsx +75 -0
- package/tests/test-app/src/pages/test-page-with-errors.tsx +51 -0
- package/tests/test-app/src/pages/test-page.tsx +101 -0
- package/tests/test-app/src/pages/test-render.tsx +52 -0
- package/tests/test-app/src/pages/test-return-type.tsx +41 -0
- package/tests/test-app/src/pages/test-type-assertion.tsx +37 -0
- package/tests/test-app/src/pages/testPage.css +3 -0
- package/tests/test-app/src/pages/testPage.tsx +158 -0
- package/tests/test-app/src/pages/ui/styleSelectorPage.tsx +1554 -0
- package/tests/test-app/src/pages/user-list.tsx +212 -0
- package/tests/test-app/src/pages/web_version/website.css +205 -0
- package/tests/test-app/src/pages/web_version/website.tsx +1066 -0
- package/tests/test-app/src/pages/wrong-page.tsx +50 -0
- package/tests/test-app/src/pages//345/276/205/345/212/236.apidoc.json +336 -0
- package/tests/test-app/src/project.json +1120 -0
- package/tests/test-app/src/store/global.store.ts +10 -0
- package/tests/test-app/src/types/CreateTicketParams.m.ts +20 -0
- package/tests/test-app/src/types/SLAPolicy.ts +50 -0
- package/tests/test-app/src/types/Ticket.ts +68 -0
- package/tests/test-app/src/types/TicketAttachment.m.ts +67 -0
- package/tests/test-app/src/types/TicketComment.m.ts +59 -0
- package/tests/test-app/src/types/TicketEvaluation.ts +44 -0
- package/tests/test-app/src/types/TicketHistory.m.ts +71 -0
- package/tests/test-app/src/types/TicketListParams.m.ts +30 -0
- package/tests/test-app/src/types/TicketPriority.m.ts +65 -0
- package/tests/test-app/src/types/TicketRecord.ts +47 -0
- package/tests/test-app/src/types/TrainDoor.ts +284 -0
- package/tests/test-app/src/types/UpdateTicketParams.m.ts +22 -0
- package/tests/test-app/src/utils/__afterRequest.util.ts +3 -0
- package/tests/test-app/src/utils/__beforeRequest.util.ts +10 -0
- package/tests/test-app/src/utils/testGlobalAction.util.ts +7 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 创建工单参数
|
|
3
|
+
* 用于创建新工单时的参数定义
|
|
4
|
+
*/
|
|
5
|
+
export class CreateTicketParams {
|
|
6
|
+
/* 工单标题 */
|
|
7
|
+
title: string = "";
|
|
8
|
+
/* 工单描述 */
|
|
9
|
+
description?: string = "";
|
|
10
|
+
/* 分类ID */
|
|
11
|
+
categoryId: number;
|
|
12
|
+
/* 优先级ID */
|
|
13
|
+
priorityId: number;
|
|
14
|
+
/* 标签 */
|
|
15
|
+
tags?: string[] = [];
|
|
16
|
+
/* 截止日期 */
|
|
17
|
+
dueDate?: Date = new Date();
|
|
18
|
+
/* 附件列表 */
|
|
19
|
+
attachments?: string[] = [];
|
|
20
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 工单列表查询参数
|
|
3
|
+
* 用于查询工单列表时的参数定义
|
|
4
|
+
*/
|
|
5
|
+
export class TicketListParams {
|
|
6
|
+
/* 页码 */
|
|
7
|
+
page?: number = 1;
|
|
8
|
+
/* 每页数量 */
|
|
9
|
+
pageSize?: number = 10;
|
|
10
|
+
/* 工单状态 */
|
|
11
|
+
statusId?: number = 0;
|
|
12
|
+
/* 优先级 */
|
|
13
|
+
priorityId?: number = 0;
|
|
14
|
+
/* 分类 */
|
|
15
|
+
categoryId?: number = 0;
|
|
16
|
+
/* 创建人ID */
|
|
17
|
+
creatorId?: string = "";
|
|
18
|
+
/* 处理人ID */
|
|
19
|
+
assigneeId?: string = "";
|
|
20
|
+
/* 关键词搜索 */
|
|
21
|
+
keyword?: string = "";
|
|
22
|
+
/* 开始时间 */
|
|
23
|
+
startDate?: Date = new Date();
|
|
24
|
+
/* 结束时间 */
|
|
25
|
+
endDate?: Date = new Date();
|
|
26
|
+
/* 排序字段 */
|
|
27
|
+
sortBy?: string = "createdAt";
|
|
28
|
+
/* 排序方式 */
|
|
29
|
+
sortOrder?: string = "DESC";
|
|
30
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 更新工单参数
|
|
3
|
+
* 用于更新工单信息时的参数定义
|
|
4
|
+
*/
|
|
5
|
+
export class UpdateTicketParams {
|
|
6
|
+
/* 工单标题 */
|
|
7
|
+
title?: string = "";
|
|
8
|
+
/* 工单描述 */
|
|
9
|
+
description?: string = "";
|
|
10
|
+
/* 分类ID */
|
|
11
|
+
categoryId?: number = 0;
|
|
12
|
+
/* 优先级ID */
|
|
13
|
+
priorityId?: number = 0;
|
|
14
|
+
/* 处理人ID */
|
|
15
|
+
assigneeId?: string = "";
|
|
16
|
+
/* 状态ID */
|
|
17
|
+
statusId?: number = 0;
|
|
18
|
+
/* 标签 */
|
|
19
|
+
tags?: string[] = [];
|
|
20
|
+
/* 截止日期 */
|
|
21
|
+
dueDate?: Date = new Date();
|
|
22
|
+
}
|
|
@@ -0,0 +1,506 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 消息中心
|
|
3
|
+
* 系统消息和通知管理
|
|
4
|
+
*
|
|
5
|
+
* @type Page
|
|
6
|
+
* @route /messages
|
|
7
|
+
* @screen 800x800 #fff
|
|
8
|
+
* @frames web
|
|
9
|
+
*/
|
|
10
|
+
import React from 'react';
|
|
11
|
+
import { AtIcon, Component, Text, View } from '@appthen/react';
|
|
12
|
+
import { Button, Pagination, Tabs } from '@appthen/antd';
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class IProps {
|
|
16
|
+
userId?: number;
|
|
17
|
+
messageType?: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/*
|
|
21
|
+
* 数据与接口请求定义
|
|
22
|
+
*/
|
|
23
|
+
class IState {
|
|
24
|
+
messages?: {
|
|
25
|
+
/* @example 1 */id?: number,
|
|
26
|
+
/* @example system */type?: string,
|
|
27
|
+
/* @example 系统升级通知 */title?: string,
|
|
28
|
+
/* @example 系统将于今晚22:00进行升级维护 */content?: string,
|
|
29
|
+
/* @example 2024-01-15 10:30 */time?: string,
|
|
30
|
+
/* @example false */read?: boolean,
|
|
31
|
+
/* @example high */priority?: string,
|
|
32
|
+
/* @example 系统管理员 */sender?: string,
|
|
33
|
+
}[];
|
|
34
|
+
loading?: boolean;
|
|
35
|
+
activeTab?: string;
|
|
36
|
+
@Form({
|
|
37
|
+
setter: "JsonSetter"
|
|
38
|
+
})
|
|
39
|
+
selectedIds?: string[];
|
|
40
|
+
searchKeyword?: string;
|
|
41
|
+
showUnreadOnly?: boolean;
|
|
42
|
+
totalCount?: number;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
class Document extends React.Component<IProps, IState> {
|
|
46
|
+
state = {
|
|
47
|
+
messages: [
|
|
48
|
+
{
|
|
49
|
+
id: 1,
|
|
50
|
+
type: 'system',
|
|
51
|
+
title: '系统升级通知',
|
|
52
|
+
content: '系统将于今晚22:00进行升级维护',
|
|
53
|
+
time: '2024-01-15 10:30',
|
|
54
|
+
read: false,
|
|
55
|
+
priority: 'high',
|
|
56
|
+
sender: '系统管理员',
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
id: 2,
|
|
60
|
+
type: 'system',
|
|
61
|
+
title: '安全提醒',
|
|
62
|
+
content: '检测到您的账号在异地登录',
|
|
63
|
+
time: '2024-01-14 15:20',
|
|
64
|
+
read: false,
|
|
65
|
+
priority: 'high',
|
|
66
|
+
sender: '安全中心',
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
id: 3,
|
|
70
|
+
type: 'notice',
|
|
71
|
+
title: '新功能上线',
|
|
72
|
+
content: '数据分析模块已上线,欢迎体验',
|
|
73
|
+
time: '2024-01-13 09:00',
|
|
74
|
+
read: true,
|
|
75
|
+
priority: 'normal',
|
|
76
|
+
sender: '产品团队',
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
id: 4,
|
|
80
|
+
type: 'notice',
|
|
81
|
+
title: '活动通知',
|
|
82
|
+
content: '新春特惠活动即将开始',
|
|
83
|
+
time: '2024-01-12 16:45',
|
|
84
|
+
read: false,
|
|
85
|
+
priority: 'normal',
|
|
86
|
+
sender: '运营团队',
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
id: 5,
|
|
90
|
+
type: 'todo',
|
|
91
|
+
title: '待办任务',
|
|
92
|
+
content: '请完成本月的数据报表',
|
|
93
|
+
time: '2024-01-11 11:30',
|
|
94
|
+
read: true,
|
|
95
|
+
priority: 'low',
|
|
96
|
+
sender: '系统',
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
id: 6,
|
|
100
|
+
type: 'todo',
|
|
101
|
+
title: '审核待办',
|
|
102
|
+
content: '有3个订单需要审核',
|
|
103
|
+
time: '2024-01-10 14:20',
|
|
104
|
+
read: true,
|
|
105
|
+
priority: 'medium',
|
|
106
|
+
sender: '系统',
|
|
107
|
+
},
|
|
108
|
+
],
|
|
109
|
+
loading: false,
|
|
110
|
+
activeTab: 'all',
|
|
111
|
+
selectedIds: [],
|
|
112
|
+
searchKeyword: '',
|
|
113
|
+
showUnreadOnly: false,
|
|
114
|
+
totalCount: 6,
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
handleTabChange(key) {
|
|
118
|
+
this.setState({
|
|
119
|
+
activeTab: key,
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
handleSearch(value) {
|
|
124
|
+
this.setState({
|
|
125
|
+
searchKeyword: value,
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
toggleShowUnread(checked) {
|
|
130
|
+
this.setState({
|
|
131
|
+
showUnreadOnly: checked,
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
handleSelectAll(checked) {
|
|
136
|
+
if (checked) {
|
|
137
|
+
this.setState({
|
|
138
|
+
selectedIds: this.state.messages.map(m => m.id),
|
|
139
|
+
});
|
|
140
|
+
} else {
|
|
141
|
+
this.setState({
|
|
142
|
+
selectedIds: [],
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
handleSelectMessage(id, checked) {
|
|
148
|
+
if (checked) {
|
|
149
|
+
this.setState({
|
|
150
|
+
selectedIds: [...this.state.selectedIds, id],
|
|
151
|
+
});
|
|
152
|
+
} else {
|
|
153
|
+
this.setState({
|
|
154
|
+
selectedIds: this.state.selectedIds.filter(id => id !== id),
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
markAsRead(id) {
|
|
160
|
+
this.setState({
|
|
161
|
+
messages: this.state.messages.map(m => {
|
|
162
|
+
if (m.id === id) {
|
|
163
|
+
return {
|
|
164
|
+
...m,
|
|
165
|
+
read: true,
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
return m;
|
|
169
|
+
}),
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
markAllAsRead() {
|
|
174
|
+
this.setState({
|
|
175
|
+
messages: this.state.messages.map(m => ({
|
|
176
|
+
...m,
|
|
177
|
+
read: true,
|
|
178
|
+
})),
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
deleteMessage(id) {
|
|
183
|
+
this.setState({
|
|
184
|
+
messages: this.state.messages.filter(m => m.id !== id),
|
|
185
|
+
totalCount: this.state.totalCount - 1,
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
batchDelete() {
|
|
190
|
+
this.setState({
|
|
191
|
+
messages: this.state.messages.filter(
|
|
192
|
+
m => !this.state.selectedIds.includes(m.id)
|
|
193
|
+
),
|
|
194
|
+
selectedIds: [],
|
|
195
|
+
totalCount: this.state.totalCount - this.state.selectedIds.length,
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
refreshMessages() {
|
|
200
|
+
this.setState({
|
|
201
|
+
loading: true,
|
|
202
|
+
});
|
|
203
|
+
setTimeout(() => {
|
|
204
|
+
this.setState({
|
|
205
|
+
loading: false,
|
|
206
|
+
});
|
|
207
|
+
}, 1000);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
render() {
|
|
211
|
+
const messages = this.state.messages;
|
|
212
|
+
const loading = this.state.loading;
|
|
213
|
+
const activeTab = this.state.activeTab;
|
|
214
|
+
const selectedIds = this.state.selectedIds;
|
|
215
|
+
const searchKeyword = this.state.searchKeyword;
|
|
216
|
+
const showUnreadOnly = this.state.showUnreadOnly;
|
|
217
|
+
const unreadCount = messages.filter(m => !m.read).length;
|
|
218
|
+
const filteredMessages = messages.filter(message => {
|
|
219
|
+
const matchTab = activeTab === 'all' || message.type === activeTab;
|
|
220
|
+
const matchSearch =
|
|
221
|
+
message.title.includes(searchKeyword) ||
|
|
222
|
+
message.content.includes(searchKeyword);
|
|
223
|
+
const matchUnread = !showUnreadOnly || !message.read;
|
|
224
|
+
return matchTab && matchSearch && matchUnread;
|
|
225
|
+
});
|
|
226
|
+
const priorityColors = {
|
|
227
|
+
high: 'red',
|
|
228
|
+
medium: 'orange',
|
|
229
|
+
normal: 'blue',
|
|
230
|
+
low: 'gray',
|
|
231
|
+
};
|
|
232
|
+
const typeLabels = {
|
|
233
|
+
system: '系统消息',
|
|
234
|
+
notice: '通知公告',
|
|
235
|
+
todo: '待办事项',
|
|
236
|
+
};
|
|
237
|
+
const messageCard = message => (
|
|
238
|
+
<Card
|
|
239
|
+
key={message.id}
|
|
240
|
+
className={`mb-3 ${message.read ? 'bg-gray-50' : 'bg-white'}`}
|
|
241
|
+
extra={
|
|
242
|
+
<View className="flex items-center gap-2">
|
|
243
|
+
<Switch
|
|
244
|
+
checked={selectedIds.includes(message.id)}
|
|
245
|
+
onChange={checked =>
|
|
246
|
+
this.handleSelectMessage(message.id, checked)
|
|
247
|
+
}
|
|
248
|
+
size="small"
|
|
249
|
+
/>
|
|
250
|
+
{!message.read && <Badge status="processing" />}
|
|
251
|
+
</View>
|
|
252
|
+
}
|
|
253
|
+
>
|
|
254
|
+
<View className="flex items-start gap-3">
|
|
255
|
+
<Avatar size={40}>{message.sender.charAt(0)}</Avatar>
|
|
256
|
+
<View className="flex-1">
|
|
257
|
+
<View className="flex justify-between items-start">
|
|
258
|
+
<View>
|
|
259
|
+
<Text className="font-bold">{message.title}</Text>
|
|
260
|
+
<View className="flex items-center gap-2 mt-1">
|
|
261
|
+
<Tag color={priorityColors[message.priority]}>
|
|
262
|
+
{message.priority}
|
|
263
|
+
</Tag>
|
|
264
|
+
<Tag>{typeLabels[message.type]}</Tag>
|
|
265
|
+
</View>
|
|
266
|
+
</View>
|
|
267
|
+
<Text className="text-gray-400 text-sm">{message.time}</Text>
|
|
268
|
+
</View>
|
|
269
|
+
<Text className="text-gray-600 mt-2">{message.content}</Text>
|
|
270
|
+
<View className="flex gap-2 mt-3">
|
|
271
|
+
{!message.read && (
|
|
272
|
+
<Button
|
|
273
|
+
type="link"
|
|
274
|
+
size="small"
|
|
275
|
+
onClick={() => this.markAsRead(message.id)}
|
|
276
|
+
>
|
|
277
|
+
标为已读
|
|
278
|
+
</Button>
|
|
279
|
+
)}
|
|
280
|
+
<Popconfirm
|
|
281
|
+
title="确认删除"
|
|
282
|
+
description="删除后无法恢复,确认删除吗?"
|
|
283
|
+
onConfirm={() => this.deleteMessage(message.id)}
|
|
284
|
+
>
|
|
285
|
+
<Button type="link" size="small" danger>
|
|
286
|
+
删除
|
|
287
|
+
</Button>
|
|
288
|
+
</Popconfirm>
|
|
289
|
+
</View>
|
|
290
|
+
</View>
|
|
291
|
+
</View>
|
|
292
|
+
</Card>
|
|
293
|
+
);
|
|
294
|
+
return (
|
|
295
|
+
<Page className="p-[24px] bg-[var(--gray-50)] min-h-screen">
|
|
296
|
+
<View className="mb-[24px]">
|
|
297
|
+
<Text className="text-2xl font-bold text-[#1f2937]">消息中心</Text>
|
|
298
|
+
<Text className="text-[#6b7280] text-sm mt-[4px]">
|
|
299
|
+
系统消息和通知管理
|
|
300
|
+
</Text>
|
|
301
|
+
</View>
|
|
302
|
+
<Card className="mb-[24px]">
|
|
303
|
+
<Row gutter={16}>
|
|
304
|
+
<Col span={6}>
|
|
305
|
+
<Badge count={unreadCount} showZero={true}>
|
|
306
|
+
<Statistic title="未读消息" value={unreadCount} suffix="条" />
|
|
307
|
+
</Badge>
|
|
308
|
+
</Col>
|
|
309
|
+
<Col span={6}>
|
|
310
|
+
<Statistic title="总消息" value={totalCount} suffix="条" />
|
|
311
|
+
</Col>
|
|
312
|
+
<Col span={6}>
|
|
313
|
+
<Statistic
|
|
314
|
+
title="系统消息"
|
|
315
|
+
value={
|
|
316
|
+
messages.filter(function (m) {
|
|
317
|
+
return m.type === 'system';
|
|
318
|
+
}).length
|
|
319
|
+
}
|
|
320
|
+
suffix="条"
|
|
321
|
+
/>
|
|
322
|
+
</Col>
|
|
323
|
+
<Col span={6}>
|
|
324
|
+
<Statistic
|
|
325
|
+
title="待办事项"
|
|
326
|
+
value={
|
|
327
|
+
messages.filter(function (m) {
|
|
328
|
+
return m.type === 'todo';
|
|
329
|
+
}).length
|
|
330
|
+
}
|
|
331
|
+
suffix="条"
|
|
332
|
+
/>
|
|
333
|
+
</Col>
|
|
334
|
+
</Row>
|
|
335
|
+
</Card>
|
|
336
|
+
<Card className="mb-[24px]">
|
|
337
|
+
<View className="flex items-center justify-between">
|
|
338
|
+
<View className="gap-4 flex items-center">
|
|
339
|
+
<Input
|
|
340
|
+
placeholder="搜索消息"
|
|
341
|
+
value={searchKeyword}
|
|
342
|
+
onChange={e => this.handleSearch(e.target.value)}
|
|
343
|
+
className=""
|
|
344
|
+
/>
|
|
345
|
+
<View className="gap-2 flex items-center">
|
|
346
|
+
<Text>只看未读:</Text>
|
|
347
|
+
<Switch
|
|
348
|
+
checked={showUnreadOnly}
|
|
349
|
+
onChange={checked => this.toggleShowUnread(checked)}
|
|
350
|
+
/>
|
|
351
|
+
</View>
|
|
352
|
+
</View>
|
|
353
|
+
<View className="gap-2 flex items-center">
|
|
354
|
+
<Switch
|
|
355
|
+
checked={
|
|
356
|
+
selectedIds.length > 0 &&
|
|
357
|
+
selectedIds.length === filteredMessages.length
|
|
358
|
+
}
|
|
359
|
+
onChange={checked => this.handleSelectAll(checked)}
|
|
360
|
+
/>
|
|
361
|
+
<Text>全选</Text>
|
|
362
|
+
{!!(selectedIds.length > 0) && (
|
|
363
|
+
<Button
|
|
364
|
+
type="primary"
|
|
365
|
+
danger={true}
|
|
366
|
+
onClick={() => this.batchDelete()}
|
|
367
|
+
>{`批量删除 (${selectedIds.length})`}</Button>
|
|
368
|
+
)}
|
|
369
|
+
<Button onClick={() => this.markAllAsRead()}>全部标为已读</Button>
|
|
370
|
+
<Button onClick={() => this.refreshMessages()}>刷新</Button>
|
|
371
|
+
</View>
|
|
372
|
+
</View>
|
|
373
|
+
</Card>
|
|
374
|
+
<Card>
|
|
375
|
+
<Tabs
|
|
376
|
+
activeKey={activeTab}
|
|
377
|
+
onChange={key => this.handleTabChange(key)}
|
|
378
|
+
>
|
|
379
|
+
<Tabs.TabPane tab={`全部 (${messages.length})`} key="all">
|
|
380
|
+
{!!(filteredMessages.length === 0) && (
|
|
381
|
+
<Empty description="暂无消息" />
|
|
382
|
+
)}
|
|
383
|
+
{!(filteredMessages.length === 0) && (
|
|
384
|
+
<Text>
|
|
385
|
+
{filteredMessages.map(function (message) {
|
|
386
|
+
return messageCard(message);
|
|
387
|
+
})}
|
|
388
|
+
</Text>
|
|
389
|
+
)}
|
|
390
|
+
</Tabs.TabPane>
|
|
391
|
+
<Tabs.TabPane
|
|
392
|
+
tab={
|
|
393
|
+
<Badge
|
|
394
|
+
count={
|
|
395
|
+
messages.filter(function (m) {
|
|
396
|
+
return m.type === 'system' && !m.read;
|
|
397
|
+
}).length
|
|
398
|
+
}
|
|
399
|
+
overflowCount={99}
|
|
400
|
+
>
|
|
401
|
+
系统消息
|
|
402
|
+
</Badge>
|
|
403
|
+
}
|
|
404
|
+
key="system"
|
|
405
|
+
>
|
|
406
|
+
{!!(
|
|
407
|
+
filteredMessages.filter(function (m) {
|
|
408
|
+
return m.type === 'system';
|
|
409
|
+
}).length === 0
|
|
410
|
+
) && <Empty description="暂无系统消息" />}
|
|
411
|
+
{!(
|
|
412
|
+
filteredMessages.filter(function (m) {
|
|
413
|
+
return m.type === 'system';
|
|
414
|
+
}).length === 0
|
|
415
|
+
) && (
|
|
416
|
+
<Text>
|
|
417
|
+
{filteredMessages
|
|
418
|
+
.filter(function (m) {
|
|
419
|
+
return m.type === 'system';
|
|
420
|
+
})
|
|
421
|
+
.map(function (message) {
|
|
422
|
+
return messageCard(message);
|
|
423
|
+
})}
|
|
424
|
+
</Text>
|
|
425
|
+
)}
|
|
426
|
+
</Tabs.TabPane>
|
|
427
|
+
<Tabs.TabPane
|
|
428
|
+
tab={
|
|
429
|
+
<Badge
|
|
430
|
+
count={
|
|
431
|
+
messages.filter(function (m) {
|
|
432
|
+
return m.type === 'notice' && !m.read;
|
|
433
|
+
}).length
|
|
434
|
+
}
|
|
435
|
+
overflowCount={99}
|
|
436
|
+
>
|
|
437
|
+
通知公告
|
|
438
|
+
</Badge>
|
|
439
|
+
}
|
|
440
|
+
key="notice"
|
|
441
|
+
>
|
|
442
|
+
{!!(
|
|
443
|
+
filteredMessages.filter(function (m) {
|
|
444
|
+
return m.type === 'notice';
|
|
445
|
+
}).length === 0
|
|
446
|
+
) && <Empty description="暂无通知公告" />}
|
|
447
|
+
{!(
|
|
448
|
+
filteredMessages.filter(function (m) {
|
|
449
|
+
return m.type === 'notice';
|
|
450
|
+
}).length === 0
|
|
451
|
+
) && (
|
|
452
|
+
<Text>
|
|
453
|
+
{filteredMessages
|
|
454
|
+
.filter(function (m) {
|
|
455
|
+
return m.type === 'notice';
|
|
456
|
+
})
|
|
457
|
+
.map(function (message) {
|
|
458
|
+
return messageCard(message);
|
|
459
|
+
})}
|
|
460
|
+
</Text>
|
|
461
|
+
)}
|
|
462
|
+
</Tabs.TabPane>
|
|
463
|
+
<Tabs.TabPane
|
|
464
|
+
tab={
|
|
465
|
+
<Badge
|
|
466
|
+
count={
|
|
467
|
+
messages.filter(function (m) {
|
|
468
|
+
return m.type === 'todo' && !m.read;
|
|
469
|
+
}).length
|
|
470
|
+
}
|
|
471
|
+
overflowCount={99}
|
|
472
|
+
>
|
|
473
|
+
待办事项
|
|
474
|
+
</Badge>
|
|
475
|
+
}
|
|
476
|
+
key="todo"
|
|
477
|
+
>
|
|
478
|
+
{!!(
|
|
479
|
+
filteredMessages.filter(function (m) {
|
|
480
|
+
return m.type === 'todo';
|
|
481
|
+
}).length === 0
|
|
482
|
+
) && <Empty description="暂无待办事项" />}
|
|
483
|
+
{!(
|
|
484
|
+
filteredMessages.filter(function (m) {
|
|
485
|
+
return m.type === 'todo';
|
|
486
|
+
}).length === 0
|
|
487
|
+
) && (
|
|
488
|
+
<Text>
|
|
489
|
+
{filteredMessages
|
|
490
|
+
.filter(function (m) {
|
|
491
|
+
return m.type === 'todo';
|
|
492
|
+
})
|
|
493
|
+
.map(function (message) {
|
|
494
|
+
return messageCard(message);
|
|
495
|
+
})}
|
|
496
|
+
</Text>
|
|
497
|
+
)}
|
|
498
|
+
</Tabs.TabPane>
|
|
499
|
+
</Tabs>
|
|
500
|
+
</Card>
|
|
501
|
+
</Page>
|
|
502
|
+
);
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
export default Document;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* moudule_demo_nzp
|
|
3
|
+
* @type Component
|
|
4
|
+
* @screen 936x718 #2c2c2c
|
|
5
|
+
* @frames web
|
|
6
|
+
* @portal true
|
|
7
|
+
*/
|
|
8
|
+
import React from 'react';
|
|
9
|
+
import { Image, Text, View } from '@appthen/react';
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class IProps {}
|
|
13
|
+
|
|
14
|
+
/*
|
|
15
|
+
* 数据与接口请求定义
|
|
16
|
+
*/
|
|
17
|
+
class IState {}
|
|
18
|
+
|
|
19
|
+
class Document extends React.Component<IProps, IState> {
|
|
20
|
+
state = {};
|
|
21
|
+
|
|
22
|
+
render() {
|
|
23
|
+
return (
|
|
24
|
+
<React.Fragment>
|
|
25
|
+
<View className="p-[16px] flex flex-col h-full">
|
|
26
|
+
<Text className="text-lg font-bold text-[#ffffff] mb-[16px]">
|
|
27
|
+
标题
|
|
28
|
+
</Text>
|
|
29
|
+
<View className="mt-[16px] grid grid-cols-1 gap-4" />
|
|
30
|
+
<Image
|
|
31
|
+
src="https://cdn.appthen.com/FmHUnzL95CR5amtVjtYFdKlL82OQ?imageView2/0/w/1000"
|
|
32
|
+
className="w-[432.5px] h-[482.5px]"
|
|
33
|
+
/>
|
|
34
|
+
</View>
|
|
35
|
+
</React.Fragment>
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export default Document;
|