@appthen/cli 1.2.10 → 1.2.11
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 +45 -0
- package/dist/index.js +1108 -267
- package/package.json +1 -1
- package/tests/test-app/.appthen/shadow-space-100001-test-app-e99876b1.json +1406 -0
- package/tests/test-app/.appthen/shadow-space-unknown-user-test-app-e99876b1.json +1060 -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/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/SLAManagement.tsx +668 -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/TicketManagementPage.tsx +1238 -0
- package/tests/test-app/src/pages/VisualAIIDEUpgrade.tsx +245 -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/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/component/WorkOrderCard.tsx +140 -0
- package/tests/test-app/src/pages/cover.tsx +42 -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/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/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/testPage.css +3 -0
- package/tests/test-app/src/pages/testPage.tsx +158 -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//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,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 获取工单详情
|
|
3
|
+
* 包含完整信息和关联数据
|
|
4
|
+
*
|
|
5
|
+
* @methods GET
|
|
6
|
+
*/
|
|
7
|
+
import cloud from '@lafjs/cloud';
|
|
8
|
+
import { DataSource } from 'typeorm';
|
|
9
|
+
import { Response } from '@/utils/func';
|
|
10
|
+
import { Ticket } from '@/types/entity/Ticket';
|
|
11
|
+
import { TicketComment } from '@/types/entity/TicketComment';
|
|
12
|
+
import { TicketAttachment } from '@/types/entity/TicketAttachment';
|
|
13
|
+
import { TicketHistory } from '@/types/entity/TicketHistory';
|
|
14
|
+
|
|
15
|
+
export default async function (ctx: FunctionContext) {
|
|
16
|
+
const { id } = ctx.query;
|
|
17
|
+
|
|
18
|
+
if (!id) {
|
|
19
|
+
return Response.failed('工单ID不能为空');
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
try {
|
|
23
|
+
const dataSource: DataSource = cloud.datasource.default;
|
|
24
|
+
const ticketRepository = dataSource.getRepository(Ticket);
|
|
25
|
+
const commentRepository = dataSource.getRepository(TicketComment);
|
|
26
|
+
const attachmentRepository = dataSource.getRepository(TicketAttachment);
|
|
27
|
+
const historyRepository = dataSource.getRepository(TicketHistory);
|
|
28
|
+
|
|
29
|
+
// 查询工单基本信息
|
|
30
|
+
const ticket = await ticketRepository.findOne({
|
|
31
|
+
where: { id: parseInt(id) },
|
|
32
|
+
relations: ['category', 'status', 'priority']
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
if (!ticket) {
|
|
36
|
+
return Response.failed('工单不存在');
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// 查询关联数据
|
|
40
|
+
const comments = await commentRepository.find({
|
|
41
|
+
where: { ticketId: parseInt(id) },
|
|
42
|
+
order: { createdAt: 'ASC' }
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
const attachments = await attachmentRepository.find({
|
|
46
|
+
where: { ticketId: parseInt(id) },
|
|
47
|
+
order: { createdAt: 'DESC' }
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
const histories = await historyRepository.find({
|
|
51
|
+
where: { ticketId: parseInt(id) },
|
|
52
|
+
order: { createdAt: 'DESC' }
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
return Response.ok({
|
|
56
|
+
...ticket,
|
|
57
|
+
comments,
|
|
58
|
+
attachments,
|
|
59
|
+
histories
|
|
60
|
+
});
|
|
61
|
+
} catch (error) {
|
|
62
|
+
console.error('查询工单详情失败:', error);
|
|
63
|
+
return Response.failed('查询失败,请稍后重试');
|
|
64
|
+
}
|
|
65
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 获取工单列表
|
|
3
|
+
* 支持分页、筛选、排序等功能
|
|
4
|
+
*
|
|
5
|
+
* @methods GET, POST
|
|
6
|
+
*/
|
|
7
|
+
import cloud from '@lafjs/cloud';
|
|
8
|
+
import { DataSource, Like } from 'typeorm';
|
|
9
|
+
import { Response } from '@/utils/func';
|
|
10
|
+
import { Ticket } from '@/types/entity/Ticket';
|
|
11
|
+
import { TicketListParams } from '@/types/models/TicketListParams';
|
|
12
|
+
|
|
13
|
+
export default async function (ctx: FunctionContext) {
|
|
14
|
+
const { query, body } = ctx;
|
|
15
|
+
const params: TicketListParams = { ...query, ...body };
|
|
16
|
+
|
|
17
|
+
try {
|
|
18
|
+
const dataSource: DataSource = cloud.datasource.default;
|
|
19
|
+
const ticketRepository = dataSource.getRepository(Ticket);
|
|
20
|
+
|
|
21
|
+
// 构建查询条件
|
|
22
|
+
const whereConditions: any = {};
|
|
23
|
+
|
|
24
|
+
if (params.statusId) {
|
|
25
|
+
whereConditions.statusId = params.statusId;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
if (params.priorityId) {
|
|
29
|
+
whereConditions.priorityId = params.priorityId;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if (params.categoryId) {
|
|
33
|
+
whereConditions.categoryId = params.categoryId;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
if (params.creatorId) {
|
|
37
|
+
whereConditions.creatorId = params.creatorId;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
if (params.assigneeId) {
|
|
41
|
+
whereConditions.assigneeId = params.assigneeId;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
if (params.keyword) {
|
|
45
|
+
whereConditions.title = Like(`%${params.keyword}%`);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
if (params.startDate && params.endDate) {
|
|
49
|
+
whereConditions.createdAt = {
|
|
50
|
+
$gte: new Date(params.startDate),
|
|
51
|
+
$lte: new Date(params.endDate)
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// 分页参数
|
|
56
|
+
const page = Math.max(1, params.page || 1);
|
|
57
|
+
const pageSize = Math.max(1, Math.min(100, params.pageSize || 10));
|
|
58
|
+
const skip = (page - 1) * pageSize;
|
|
59
|
+
|
|
60
|
+
// 排序
|
|
61
|
+
const order = {
|
|
62
|
+
[params.sortBy || 'createdAt']: params.sortOrder || 'DESC'
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
// 查询数据
|
|
66
|
+
const [tickets, total] = await ticketRepository.findAndCount({
|
|
67
|
+
where: whereConditions,
|
|
68
|
+
order,
|
|
69
|
+
skip,
|
|
70
|
+
take: pageSize,
|
|
71
|
+
relations: ['category', 'status', 'priority', 'comments', 'attachments']
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
return Response.ok({
|
|
75
|
+
list: tickets,
|
|
76
|
+
total,
|
|
77
|
+
page,
|
|
78
|
+
pageSize,
|
|
79
|
+
totalPages: Math.ceil(total / pageSize)
|
|
80
|
+
});
|
|
81
|
+
} catch (error) {
|
|
82
|
+
console.error('查询工单列表失败:', error);
|
|
83
|
+
return Response.failed('查询失败,请稍后重试');
|
|
84
|
+
}
|
|
85
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 更新工单
|
|
3
|
+
* 支持部分字段更新和状态变更
|
|
4
|
+
*
|
|
5
|
+
* @methods PUT
|
|
6
|
+
*/
|
|
7
|
+
import cloud from '@lafjs/cloud';
|
|
8
|
+
import { DataSource } from 'typeorm';
|
|
9
|
+
import { Response } from '@/utils/func';
|
|
10
|
+
import { Ticket } from '@/types/entity/Ticket';
|
|
11
|
+
import { UpdateTicketParams } from '@/types/models/UpdateTicketParams';
|
|
12
|
+
import { TicketHistory } from '@/types/entity/TicketHistory';
|
|
13
|
+
|
|
14
|
+
export default async function (ctx: FunctionContext) {
|
|
15
|
+
const { id } = ctx.query;
|
|
16
|
+
const params: UpdateTicketParams = ctx.body;
|
|
17
|
+
|
|
18
|
+
if (!id) {
|
|
19
|
+
return Response.failed('工单ID不能为空');
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
try {
|
|
23
|
+
const dataSource: DataSource = cloud.datasource.default;
|
|
24
|
+
const ticketRepository = dataSource.getRepository(Ticket);
|
|
25
|
+
const historyRepository = dataSource.getRepository(TicketHistory);
|
|
26
|
+
|
|
27
|
+
// 查询原工单
|
|
28
|
+
const ticket = await ticketRepository.findOne({
|
|
29
|
+
where: { id: parseInt(id) }
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
if (!ticket) {
|
|
33
|
+
return Response.failed('工单不存在');
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// 记录变更历史
|
|
37
|
+
const changes: any = {};
|
|
38
|
+
Object.keys(params).forEach(key => {
|
|
39
|
+
if (params[key as keyof UpdateTicketParams] !== undefined) {
|
|
40
|
+
changes[key] = {
|
|
41
|
+
old: ticket[key as keyof Ticket],
|
|
42
|
+
new: params[key as keyof UpdateTicketParams]
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
// 更新工单
|
|
48
|
+
const updatedTicket = await ticketRepository.save({
|
|
49
|
+
...ticket,
|
|
50
|
+
...params,
|
|
51
|
+
updatedAt: new Date()
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
// 记录历史
|
|
55
|
+
if (Object.keys(changes).length > 0) {
|
|
56
|
+
const history = historyRepository.create({
|
|
57
|
+
ticketId: parseInt(id),
|
|
58
|
+
userId: ctx.user?._id || 'system',
|
|
59
|
+
action: 'UPDATE',
|
|
60
|
+
description: '更新工单信息',
|
|
61
|
+
oldValue: changes,
|
|
62
|
+
newValue: params,
|
|
63
|
+
createdAt: new Date()
|
|
64
|
+
});
|
|
65
|
+
await historyRepository.save(history);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
return Response.ok(updatedTicket);
|
|
69
|
+
} catch (error) {
|
|
70
|
+
console.error('更新工单失败:', error);
|
|
71
|
+
return Response.failed('更新失败,请稍后重试');
|
|
72
|
+
}
|
|
73
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { Entity, Column } from 'typeorm';
|
|
2
|
+
/**
|
|
3
|
+
* 工单实体
|
|
4
|
+
* 用于存储工单的基本信息和状态
|
|
5
|
+
*/
|
|
6
|
+
@Entity({
|
|
7
|
+
name: "tickets"
|
|
8
|
+
})
|
|
9
|
+
export class Ticket {
|
|
10
|
+
id?: number;
|
|
11
|
+
/* 工单标题 */
|
|
12
|
+
@Column({
|
|
13
|
+
type: "varchar",
|
|
14
|
+
length: 200,
|
|
15
|
+
nullable: false
|
|
16
|
+
})
|
|
17
|
+
title?: string = "";
|
|
18
|
+
/* 工单描述 */
|
|
19
|
+
@Column({
|
|
20
|
+
type: "text",
|
|
21
|
+
nullable: true
|
|
22
|
+
})
|
|
23
|
+
description: string = "";
|
|
24
|
+
/* 工单编号 */
|
|
25
|
+
@Column({
|
|
26
|
+
type: "varchar",
|
|
27
|
+
length: 50,
|
|
28
|
+
nullable: false
|
|
29
|
+
})
|
|
30
|
+
ticketNumber?: string = "";
|
|
31
|
+
/* 创建人ID */
|
|
32
|
+
@Column({
|
|
33
|
+
type: "varchar",
|
|
34
|
+
length: 50,
|
|
35
|
+
nullable: false
|
|
36
|
+
})
|
|
37
|
+
creatorId?: string = "";
|
|
38
|
+
/* 处理人ID */
|
|
39
|
+
@Column({
|
|
40
|
+
type: "varchar",
|
|
41
|
+
length: 50,
|
|
42
|
+
nullable: true
|
|
43
|
+
})
|
|
44
|
+
assigneeId: string = "";
|
|
45
|
+
/* 分类ID */
|
|
46
|
+
@Column({
|
|
47
|
+
type: "int",
|
|
48
|
+
nullable: false
|
|
49
|
+
})
|
|
50
|
+
categoryId?: number;
|
|
51
|
+
/* 优先级ID */
|
|
52
|
+
@Column({
|
|
53
|
+
type: "int",
|
|
54
|
+
nullable: false
|
|
55
|
+
})
|
|
56
|
+
priorityId?: number;
|
|
57
|
+
/* 状态ID */
|
|
58
|
+
@Column({
|
|
59
|
+
type: "int",
|
|
60
|
+
nullable: false
|
|
61
|
+
})
|
|
62
|
+
statusId?: number;
|
|
63
|
+
/* 截止日期 */
|
|
64
|
+
@Column({
|
|
65
|
+
type: "timestamp",
|
|
66
|
+
nullable: true
|
|
67
|
+
})
|
|
68
|
+
dueDate: Date = new Date();
|
|
69
|
+
/* 标签 */
|
|
70
|
+
@Column({
|
|
71
|
+
type: "simple-array",
|
|
72
|
+
nullable: true
|
|
73
|
+
})
|
|
74
|
+
tags: string[] = [];
|
|
75
|
+
/* 创建时间 */
|
|
76
|
+
createdAt?: Date = new Date();
|
|
77
|
+
/* 更新时间 */
|
|
78
|
+
updatedAt?: Date = new Date();
|
|
79
|
+
/* 删除时间 */
|
|
80
|
+
@Column({
|
|
81
|
+
type: "timestamp",
|
|
82
|
+
nullable: true
|
|
83
|
+
})
|
|
84
|
+
deletedAt: Date = new Date();
|
|
85
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Entity, Column } from 'typeorm';
|
|
2
|
+
/**
|
|
3
|
+
* 工单分类实体
|
|
4
|
+
* 用于管理工单的分类信息
|
|
5
|
+
*/
|
|
6
|
+
@Entity({
|
|
7
|
+
name: "ticket_categories"
|
|
8
|
+
})
|
|
9
|
+
export class TicketCategory {
|
|
10
|
+
id?: number;
|
|
11
|
+
/* 分类名称 */
|
|
12
|
+
@Column({
|
|
13
|
+
type: "varchar",
|
|
14
|
+
length: 100,
|
|
15
|
+
nullable: false
|
|
16
|
+
})
|
|
17
|
+
name?: string = "";
|
|
18
|
+
/* 分类描述 */
|
|
19
|
+
@Column({
|
|
20
|
+
type: "text",
|
|
21
|
+
nullable: true
|
|
22
|
+
})
|
|
23
|
+
description: string = "";
|
|
24
|
+
/* 父分类ID */
|
|
25
|
+
@Column({
|
|
26
|
+
type: "int",
|
|
27
|
+
nullable: true
|
|
28
|
+
})
|
|
29
|
+
parentId: number = 0;
|
|
30
|
+
/* 排序 */
|
|
31
|
+
@Column({
|
|
32
|
+
type: "int",
|
|
33
|
+
default: 0
|
|
34
|
+
})
|
|
35
|
+
sortOrder?: number;
|
|
36
|
+
/* 是否启用 */
|
|
37
|
+
@Column({
|
|
38
|
+
type: "boolean",
|
|
39
|
+
default: true
|
|
40
|
+
})
|
|
41
|
+
isActive?: boolean = true;
|
|
42
|
+
/* 图标 */
|
|
43
|
+
@Column({
|
|
44
|
+
type: "varchar",
|
|
45
|
+
length: 100,
|
|
46
|
+
nullable: true
|
|
47
|
+
})
|
|
48
|
+
icon: string = "";
|
|
49
|
+
/* 创建时间 */
|
|
50
|
+
createdAt?: Date = new Date();
|
|
51
|
+
/* 更新时间 */
|
|
52
|
+
updatedAt?: Date = new Date();
|
|
53
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { Entity, Column } from 'typeorm';
|
|
2
|
+
/**
|
|
3
|
+
* 工单状态实体
|
|
4
|
+
* 用于管理工单的各种状态
|
|
5
|
+
*/
|
|
6
|
+
@Entity({
|
|
7
|
+
name: "ticket_statuses"
|
|
8
|
+
})
|
|
9
|
+
export class TicketStatus {
|
|
10
|
+
id?: number;
|
|
11
|
+
/* 状态名称 */
|
|
12
|
+
@Column({
|
|
13
|
+
type: "varchar",
|
|
14
|
+
length: 50,
|
|
15
|
+
nullable: false
|
|
16
|
+
})
|
|
17
|
+
name?: string = "";
|
|
18
|
+
/* 状态描述 */
|
|
19
|
+
@Column({
|
|
20
|
+
type: "text",
|
|
21
|
+
nullable: true
|
|
22
|
+
})
|
|
23
|
+
description: string = "";
|
|
24
|
+
/* 状态颜色 */
|
|
25
|
+
@Column({
|
|
26
|
+
type: "varchar",
|
|
27
|
+
length: 20,
|
|
28
|
+
nullable: false
|
|
29
|
+
})
|
|
30
|
+
color?: string = "";
|
|
31
|
+
/* 状态类型 */
|
|
32
|
+
@Column({
|
|
33
|
+
type: "varchar",
|
|
34
|
+
length: 20,
|
|
35
|
+
nullable: false
|
|
36
|
+
})
|
|
37
|
+
type?: string = "";
|
|
38
|
+
/* 排序 */
|
|
39
|
+
@Column({
|
|
40
|
+
type: "int",
|
|
41
|
+
default: 0
|
|
42
|
+
})
|
|
43
|
+
sortOrder?: number;
|
|
44
|
+
/* 是否启用 */
|
|
45
|
+
@Column({
|
|
46
|
+
type: "boolean",
|
|
47
|
+
default: true
|
|
48
|
+
})
|
|
49
|
+
isActive?: boolean = true;
|
|
50
|
+
/* 是否为默认状态 */
|
|
51
|
+
@Column({
|
|
52
|
+
type: "boolean",
|
|
53
|
+
default: false
|
|
54
|
+
})
|
|
55
|
+
isDefault?: boolean;
|
|
56
|
+
/* 创建时间 */
|
|
57
|
+
createdAt?: Date = new Date();
|
|
58
|
+
/* 更新时间 */
|
|
59
|
+
updatedAt?: Date = new Date();
|
|
60
|
+
}
|