@appthen/cli 1.2.11 → 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/bin/main.js +47 -0
- package/dist/index.js +6165 -14980
- package/package.json +8 -1
- package/tests/test-app/.appthen/shadow-space-100001-test-app-e99876b1.json +1197 -741
- package/tests/test-app/.appthen/space-config.json +2 -2
- package/tests/test-app/src/components/MessageCenter.tsx +506 -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/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/TicketManagement.tsx +402 -0
- package/tests/test-app/src/pages/UserProfile.tsx +404 -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/article-list.tsx +222 -0
- package/tests/test-app/src/pages/babyProductRecommendationPage.tsx +168 -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/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/demo-error-page.tsx +119 -0
- package/tests/test-app/src/pages/department-list.tsx +183 -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/uiHandsOnPractice.tsx +1 -1
- 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/ui/styleSelectorPage.tsx +1554 -0
- package/tests/test-app/src/pages/user-list.tsx +212 -0
- package/tests/test-app/src/pages/wrong-page.tsx +50 -0
- package/tests/test-app/.appthen/shadow-space-unknown-user-test-app-e99876b1.json +0 -1060
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 测试页面 - 包含错误的示例
|
|
3
|
+
* @type Page
|
|
4
|
+
* @screen 1920w
|
|
5
|
+
* @frames web
|
|
6
|
+
*/
|
|
7
|
+
import React from 'react';
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class IProps {
|
|
12
|
+
title?: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/*
|
|
16
|
+
* 数据与接口请求定义
|
|
17
|
+
*/
|
|
18
|
+
class IState {
|
|
19
|
+
users?: string[];
|
|
20
|
+
loading?: boolean;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
class Document extends React.Component<IProps, IState> {
|
|
24
|
+
state = { users: [], loading: false };
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* 已修复:移除方法参数类型注解
|
|
28
|
+
*/
|
|
29
|
+
handleClick(event) {
|
|
30
|
+
console.log('Clicked', event);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* 已修复:移除方法返回类型注解
|
|
35
|
+
*/
|
|
36
|
+
getUserCount() {
|
|
37
|
+
return this.state.users?.length || 0;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
render() {
|
|
41
|
+
return (
|
|
42
|
+
<Page className="p-[24px]">
|
|
43
|
+
<h1>{this.props.title}</h1>
|
|
44
|
+
<p>用户数量:{0}</p>
|
|
45
|
+
<button onClick={() => this.handleClick()}>点击我</button>
|
|
46
|
+
</Page>
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export default Document;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 测试页面 - 演示TSX规范错误和修复
|
|
3
|
+
* @type Page
|
|
4
|
+
* @route /test
|
|
5
|
+
* @screen 1920w
|
|
6
|
+
* @frames web
|
|
7
|
+
*/
|
|
8
|
+
import React from 'react';
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class IProps {
|
|
13
|
+
title?: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/*
|
|
17
|
+
* 数据与接口请求定义
|
|
18
|
+
*/
|
|
19
|
+
class IState {
|
|
20
|
+
users?: {
|
|
21
|
+
/* @example 1 */id?: number,
|
|
22
|
+
/* @example 张三 */name?: string,
|
|
23
|
+
/* @example zhangsan@example.com */email?: string,
|
|
24
|
+
}[];
|
|
25
|
+
loading?: boolean;
|
|
26
|
+
selectedUser?: any;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
class Document extends React.Component<IProps, IState> {
|
|
30
|
+
state = {
|
|
31
|
+
users: [
|
|
32
|
+
{ id: 1, name: '张三', email: 'zhangsan@example.com' },
|
|
33
|
+
{ id: 2, name: '李四', email: 'lisi@example.com' },
|
|
34
|
+
],
|
|
35
|
+
loading: false,
|
|
36
|
+
selectedUser: null,
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
handleSelectUser(user) {
|
|
40
|
+
this.setState({
|
|
41
|
+
selectedUser: user,
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
isUserActive() {
|
|
46
|
+
return this.state.selectedUser?.active || false;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
handleLoadData(page, size) {
|
|
50
|
+
return new Promise(resolve => {
|
|
51
|
+
this.setState({
|
|
52
|
+
loading: true,
|
|
53
|
+
});
|
|
54
|
+
setTimeout(() => {
|
|
55
|
+
this.setState({
|
|
56
|
+
loading: false,
|
|
57
|
+
});
|
|
58
|
+
resolve();
|
|
59
|
+
}, 1000);
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
render() {
|
|
64
|
+
return (
|
|
65
|
+
<Page className="p-[24px]">
|
|
66
|
+
<h1>{this.props.title}</h1>
|
|
67
|
+
{!!this.state.selectedUser && (
|
|
68
|
+
<p>已选择用户:{this.state.selectedUser?.name}</p>
|
|
69
|
+
)}
|
|
70
|
+
<Button type="primary" onClick={() => this.handleLoadData(1, 10)}>
|
|
71
|
+
加载数据
|
|
72
|
+
</Button>
|
|
73
|
+
<Table
|
|
74
|
+
columns={[
|
|
75
|
+
{ title: '姓名', dataIndex: 'name', key: 'name' },
|
|
76
|
+
{
|
|
77
|
+
title: '邮箱',
|
|
78
|
+
dataIndex: 'email',
|
|
79
|
+
render: text => <Text>{text}</Text>,
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
title: '操作',
|
|
83
|
+
render: record => (
|
|
84
|
+
<Button
|
|
85
|
+
size="small"
|
|
86
|
+
onClick={() => this.handleSelectUser(record)}
|
|
87
|
+
>
|
|
88
|
+
选择
|
|
89
|
+
</Button>
|
|
90
|
+
),
|
|
91
|
+
},
|
|
92
|
+
]}
|
|
93
|
+
dataSource={this.state.users}
|
|
94
|
+
loading={this.state.loading}
|
|
95
|
+
/>
|
|
96
|
+
</Page>
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export default Document;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 测试render方法
|
|
3
|
+
* @type Page
|
|
4
|
+
* @route /test-render
|
|
5
|
+
* @screen 1920w
|
|
6
|
+
* @frames web
|
|
7
|
+
*/
|
|
8
|
+
import React from 'react';
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class IProps {}
|
|
13
|
+
|
|
14
|
+
/*
|
|
15
|
+
* 数据与接口请求定义
|
|
16
|
+
*/
|
|
17
|
+
class IState {
|
|
18
|
+
count?: number;
|
|
19
|
+
loading?: boolean;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
class Document extends React.Component<IProps, IState> {
|
|
23
|
+
state = { count: 0, loading: false };
|
|
24
|
+
|
|
25
|
+
handleClick() {
|
|
26
|
+
this.setState({
|
|
27
|
+
count: this.state.count + 1,
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
render() {
|
|
32
|
+
// ❌ 违反规范:render() 中有变量声明
|
|
33
|
+
const count = this.state.count;
|
|
34
|
+
|
|
35
|
+
// ❌ 违反规范:render() 中有逻辑语句
|
|
36
|
+
// ❌ 违反规范:render() 中有逻辑语句
|
|
37
|
+
// ❌ 违反规范:render() 中有逻辑语句
|
|
38
|
+
// ❌ 违反规范:render() 中有逻辑语句
|
|
39
|
+
if (this.state.loading) {
|
|
40
|
+
return <div>加载中...</div>;
|
|
41
|
+
}
|
|
42
|
+
return (
|
|
43
|
+
<Page className="p-[24px]">
|
|
44
|
+
<h1>测试 render 方法</h1>
|
|
45
|
+
<p>计数:{count}</p>
|
|
46
|
+
<Button onClick={() => this.handleClick()}>点击</Button>
|
|
47
|
+
</Page>
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export default Document;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 测试返回类型
|
|
3
|
+
* @type Page
|
|
4
|
+
* @route /test-return-type
|
|
5
|
+
* @screen 1920w
|
|
6
|
+
* @frames web
|
|
7
|
+
*/
|
|
8
|
+
import React from 'react';
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class IProps {}
|
|
13
|
+
|
|
14
|
+
/*
|
|
15
|
+
* 数据与接口请求定义
|
|
16
|
+
*/
|
|
17
|
+
class IState {
|
|
18
|
+
count?: number;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
class Document extends React.Component<IProps, IState> {
|
|
22
|
+
state = { count: 0 };
|
|
23
|
+
|
|
24
|
+
handleClick() {
|
|
25
|
+
this.setState({
|
|
26
|
+
count: this.state.count + 1,
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
render() {
|
|
31
|
+
return (
|
|
32
|
+
<Page className="p-[24px]">
|
|
33
|
+
<h1>测试返回类型</h1>
|
|
34
|
+
<p>计数:{this.state.count}</p>
|
|
35
|
+
<Button onClick={() => this.handleClick()}>点击</Button>
|
|
36
|
+
</Page>
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export default Document;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 测试类型断言
|
|
3
|
+
* @type Page
|
|
4
|
+
* @route /test-type-assertion
|
|
5
|
+
* @screen 1920w
|
|
6
|
+
* @frames web
|
|
7
|
+
*/
|
|
8
|
+
import React from 'react';
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class IProps {}
|
|
13
|
+
|
|
14
|
+
/*
|
|
15
|
+
* 数据与接口请求定义
|
|
16
|
+
*/
|
|
17
|
+
class IState {
|
|
18
|
+
user?: any;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class Document extends React.Component<IProps, IState> {
|
|
23
|
+
state = {"user": null}
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
handleClick() {
|
|
27
|
+
// ❌ 违反规范:使用类型断言 as any
|
|
28
|
+
const data = this.state.user as any;
|
|
29
|
+
console.log(data.name);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
render() {
|
|
33
|
+
return (<Page className="p-[24px]"><h1>测试类型断言</h1><Button onClick={() => this.handleClick()}>点击</Button></Page>);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export default Document;
|