@yuku123/z-task-component 0.1.0 → 0.1.1
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/dist/index.js +390 -655
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,44 +1,45 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-z6PQ6F3d.js";
|
|
2
|
-
import { Card as
|
|
3
|
-
import { CheckCircleOutlined as
|
|
4
|
-
import { useState as
|
|
5
|
-
import { createRequest as
|
|
6
|
-
import {
|
|
7
|
-
|
|
2
|
+
import { Card as C, Space as w, Tag as v, Button as T, Table as Z, Select as M, Form as f, Empty as X, Spin as de, Descriptions as k, List as N, Drawer as xe, Input as A, message as b, Popconfirm as ue, Typography as je, Modal as he, DatePicker as be, Row as se, Col as U, Statistic as G, Progress as Ie } from "antd";
|
|
3
|
+
import { CheckCircleOutlined as Y, EditOutlined as J, DeleteOutlined as ee, PlusOutlined as pe, InboxOutlined as Te, CheckOutlined as te, UnorderedListOutlined as ke, EyeOutlined as ve, ProjectOutlined as we, ReloadOutlined as Pe, ClockCircleOutlined as me, RocketOutlined as ye } from "@ant-design/icons";
|
|
4
|
+
import { useState as h, useEffect as E } from "react";
|
|
5
|
+
import { createRequest as De, authRequest as Se } from "@yuku123/z-frontend-common";
|
|
6
|
+
import { PageHeader as ze, TableToolbar as Oe, ErrorState as le, EmptyState as Le } from "@yuku123/z-frontend-common/ui";
|
|
7
|
+
import { Routes as Ce, Route as q, Navigate as Me } from "react-router-dom";
|
|
8
|
+
const Re = {
|
|
8
9
|
high: { color: "red", text: "高" },
|
|
9
10
|
medium: { color: "orange", text: "中" },
|
|
10
11
|
low: { color: "green", text: "低" }
|
|
11
|
-
},
|
|
12
|
+
}, Be = {
|
|
12
13
|
pending: { color: "default", text: "待处理" },
|
|
13
14
|
in_progress: { color: "blue", text: "进行中" },
|
|
14
15
|
completed: { color: "green", text: "已完成" }
|
|
15
16
|
};
|
|
16
|
-
function
|
|
17
|
-
const
|
|
18
|
-
return /* @__PURE__ */ e.jsx(
|
|
19
|
-
|
|
20
|
-
/* @__PURE__ */ e.jsx(
|
|
21
|
-
] }), children: /* @__PURE__ */ e.jsxs(
|
|
17
|
+
function Ye({ task: s, onEdit: l, onComplete: o }) {
|
|
18
|
+
const i = Re[s.priority] || { color: "default", text: s.priority }, n = Be[s.status] || { color: "default", text: s.status };
|
|
19
|
+
return /* @__PURE__ */ e.jsx(C, { size: "small", title: s.title, extra: /* @__PURE__ */ e.jsxs(w, { children: [
|
|
20
|
+
s.status !== "completed" && /* @__PURE__ */ e.jsx(T, { size: "small", icon: /* @__PURE__ */ e.jsx(Y, {}), onClick: () => o == null ? void 0 : o(s), children: "完成" }),
|
|
21
|
+
/* @__PURE__ */ e.jsx(T, { size: "small", icon: /* @__PURE__ */ e.jsx(J, {}), onClick: () => l == null ? void 0 : l(s), children: "编辑" })
|
|
22
|
+
] }), children: /* @__PURE__ */ e.jsxs(w, { orientation: "vertical", style: { width: "100%" }, children: [
|
|
22
23
|
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
23
24
|
"项目:",
|
|
24
|
-
|
|
25
|
+
s.projectName
|
|
25
26
|
] }),
|
|
26
|
-
/* @__PURE__ */ e.jsxs(
|
|
27
|
-
/* @__PURE__ */ e.jsx(
|
|
28
|
-
/* @__PURE__ */ e.jsx(
|
|
27
|
+
/* @__PURE__ */ e.jsxs(w, { children: [
|
|
28
|
+
/* @__PURE__ */ e.jsx(v, { color: i.color, children: i.text }),
|
|
29
|
+
/* @__PURE__ */ e.jsx(v, { color: n.color, children: n.text })
|
|
29
30
|
] }),
|
|
30
|
-
|
|
31
|
+
s.dueDate && /* @__PURE__ */ e.jsxs("div", { children: [
|
|
31
32
|
"截止:",
|
|
32
|
-
|
|
33
|
+
s.dueDate
|
|
33
34
|
] })
|
|
34
35
|
] }) });
|
|
35
36
|
}
|
|
36
|
-
const
|
|
37
|
+
const Fe = { high: "red", medium: "orange", low: "green" }, Ae = {
|
|
37
38
|
pending: "default",
|
|
38
39
|
in_progress: "blue",
|
|
39
40
|
completed: "green"
|
|
40
41
|
};
|
|
41
|
-
function
|
|
42
|
+
function Je({ dataSource: s, loading: l, onEdit: o, onDelete: i, onComplete: n }) {
|
|
42
43
|
const r = [
|
|
43
44
|
{ title: "任务名称", dataIndex: "title", key: "title" },
|
|
44
45
|
{ title: "项目", dataIndex: "projectName", key: "projectName" },
|
|
@@ -46,140 +47,140 @@ function et({ dataSource: t, loading: l, onEdit: i, onDelete: n, onComplete: c }
|
|
|
46
47
|
title: "优先级",
|
|
47
48
|
dataIndex: "priority",
|
|
48
49
|
key: "priority",
|
|
49
|
-
render: (
|
|
50
|
+
render: (d) => /* @__PURE__ */ e.jsx(v, { color: Fe[d], children: d === "high" ? "高" : d === "medium" ? "中" : "低" })
|
|
50
51
|
},
|
|
51
52
|
{
|
|
52
53
|
title: "状态",
|
|
53
54
|
dataIndex: "status",
|
|
54
55
|
key: "status",
|
|
55
|
-
render: (
|
|
56
|
-
const
|
|
57
|
-
return /* @__PURE__ */ e.jsx(
|
|
56
|
+
render: (d) => {
|
|
57
|
+
const y = { pending: "待处理", in_progress: "进行中", completed: "已完成" };
|
|
58
|
+
return /* @__PURE__ */ e.jsx(v, { color: Ae[d], children: y[d] || d });
|
|
58
59
|
}
|
|
59
60
|
},
|
|
60
61
|
{ title: "截止日期", dataIndex: "dueDate", key: "dueDate" },
|
|
61
62
|
{
|
|
62
63
|
title: "操作",
|
|
63
64
|
key: "action",
|
|
64
|
-
render: (
|
|
65
|
-
|
|
66
|
-
/* @__PURE__ */ e.jsx(
|
|
67
|
-
/* @__PURE__ */ e.jsx(
|
|
65
|
+
render: (d, y) => /* @__PURE__ */ e.jsxs(w, { children: [
|
|
66
|
+
y.status !== "completed" && /* @__PURE__ */ e.jsx(T, { size: "small", icon: /* @__PURE__ */ e.jsx(Y, {}), onClick: () => n == null ? void 0 : n(y), children: "完成" }),
|
|
67
|
+
/* @__PURE__ */ e.jsx(T, { size: "small", icon: /* @__PURE__ */ e.jsx(J, {}), onClick: () => o == null ? void 0 : o(y), children: "编辑" }),
|
|
68
|
+
/* @__PURE__ */ e.jsx(T, { size: "small", danger: !0, icon: /* @__PURE__ */ e.jsx(ee, {}), onClick: () => i == null ? void 0 : i(y), children: "删除" })
|
|
68
69
|
] })
|
|
69
70
|
}
|
|
70
71
|
];
|
|
71
72
|
return /* @__PURE__ */ e.jsx(
|
|
72
|
-
|
|
73
|
+
Z,
|
|
73
74
|
{
|
|
74
75
|
columns: r,
|
|
75
|
-
dataSource:
|
|
76
|
+
dataSource: s,
|
|
76
77
|
loading: l,
|
|
77
78
|
rowKey: "id",
|
|
78
79
|
pagination: { pageSize: 10 }
|
|
79
80
|
}
|
|
80
81
|
);
|
|
81
82
|
}
|
|
82
|
-
function
|
|
83
|
+
function Qe({ value: s, onChange: l, projects: o = [] }) {
|
|
83
84
|
return /* @__PURE__ */ e.jsx(
|
|
84
|
-
|
|
85
|
+
M,
|
|
85
86
|
{
|
|
86
|
-
value:
|
|
87
|
+
value: s,
|
|
87
88
|
onChange: l,
|
|
88
89
|
placeholder: "请选择项目",
|
|
89
90
|
style: { width: 200 },
|
|
90
91
|
allowClear: !0,
|
|
91
|
-
children:
|
|
92
|
+
children: o.map((i) => /* @__PURE__ */ e.jsx(M.Option, { value: i.id, children: i.name }, i.id))
|
|
92
93
|
}
|
|
93
94
|
);
|
|
94
95
|
}
|
|
95
|
-
const
|
|
96
|
+
const L = De("task"), I = {
|
|
96
97
|
// === 项目 ===
|
|
97
|
-
listMyProjects: () =>
|
|
98
|
-
createProject: (
|
|
99
|
-
updateProject: (
|
|
100
|
-
archiveProject: (
|
|
98
|
+
listMyProjects: () => Se.get("/project/user/list"),
|
|
99
|
+
createProject: (s) => L.post("/project", s),
|
|
100
|
+
updateProject: (s, l) => L.put(`/project/${s}`, l),
|
|
101
|
+
archiveProject: (s) => L.put(`/project/${s}/archive`),
|
|
101
102
|
// === 任务 ===
|
|
102
|
-
listTasksByProject: (
|
|
103
|
-
listTasksByList: (
|
|
104
|
-
createTask: (
|
|
105
|
-
completeTask: (
|
|
106
|
-
moveTask: (
|
|
103
|
+
listTasksByProject: (s) => L.get("/task/project/list", { params: { projectId: s } }),
|
|
104
|
+
listTasksByList: (s) => L.get("/task/list", { params: { listId: s } }),
|
|
105
|
+
createTask: (s) => L.post("/task", s),
|
|
106
|
+
completeTask: (s) => L.post("/task/complete", null, { params: { taskId: s } }),
|
|
107
|
+
moveTask: (s, l, o) => L.put("/task/move", null, { params: { taskId: s, targetListId: l, position: o } }),
|
|
107
108
|
// === 任务详情 ===
|
|
108
|
-
getTaskDetail: (
|
|
109
|
-
updateTask: (
|
|
110
|
-
deleteTask: (
|
|
111
|
-
},
|
|
112
|
-
if (!
|
|
113
|
-
const l = String(
|
|
114
|
-
return
|
|
109
|
+
getTaskDetail: (s) => L.get(`/task/${s}`),
|
|
110
|
+
updateTask: (s, l) => L.put(`/task/${s}`, l),
|
|
111
|
+
deleteTask: (s) => L.delete(`/task/${s}`)
|
|
112
|
+
}, Q = (s) => {
|
|
113
|
+
if (!s) return "-";
|
|
114
|
+
const l = String(s), o = l.match(/^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2})/);
|
|
115
|
+
return o ? o[1] : l;
|
|
115
116
|
};
|
|
116
|
-
function re({ apiBaseURL:
|
|
117
|
-
const [l,
|
|
118
|
-
|
|
117
|
+
function re({ apiBaseURL: s }) {
|
|
118
|
+
const [l, o] = h([]), [i, n] = h(!1), [r, d] = h(!1), [y, j] = h(null), [u, D] = h(null), [S, z] = h([]), [g, F] = h(!1), [O] = f.useForm(), c = async () => {
|
|
119
|
+
n(!0);
|
|
119
120
|
try {
|
|
120
|
-
const
|
|
121
|
-
|
|
122
|
-
} catch (
|
|
123
|
-
|
|
121
|
+
const t = await I.listMyProjects();
|
|
122
|
+
o((t == null ? void 0 : t.data) || t || []);
|
|
123
|
+
} catch (t) {
|
|
124
|
+
b.error("加载项目失败: " + ((t == null ? void 0 : t.message) || t));
|
|
124
125
|
} finally {
|
|
125
|
-
|
|
126
|
+
n(!1);
|
|
126
127
|
}
|
|
127
128
|
};
|
|
128
|
-
|
|
129
|
-
|
|
129
|
+
E(() => {
|
|
130
|
+
c();
|
|
130
131
|
}, []);
|
|
131
|
-
const
|
|
132
|
-
|
|
132
|
+
const p = async (t) => {
|
|
133
|
+
D(t), F(!0);
|
|
133
134
|
try {
|
|
134
|
-
const
|
|
135
|
-
|
|
136
|
-
} catch (
|
|
137
|
-
|
|
135
|
+
const x = await I.listTasksByProject(t.id);
|
|
136
|
+
z((x == null ? void 0 : x.data) || x || []);
|
|
137
|
+
} catch (x) {
|
|
138
|
+
b.error("加载任务失败: " + ((x == null ? void 0 : x.message) || x));
|
|
138
139
|
} finally {
|
|
139
|
-
|
|
140
|
+
F(!1);
|
|
140
141
|
}
|
|
141
|
-
},
|
|
142
|
-
if (
|
|
142
|
+
}, P = async () => {
|
|
143
|
+
if (u)
|
|
143
144
|
try {
|
|
144
|
-
const
|
|
145
|
-
|
|
146
|
-
} catch (
|
|
147
|
-
|
|
145
|
+
const t = await I.listTasksByProject(u.id);
|
|
146
|
+
z((t == null ? void 0 : t.data) || t || []);
|
|
147
|
+
} catch (t) {
|
|
148
|
+
b.error("刷新任务失败: " + ((t == null ? void 0 : t.message) || t));
|
|
148
149
|
}
|
|
149
|
-
},
|
|
150
|
-
|
|
151
|
-
},
|
|
152
|
-
|
|
153
|
-
},
|
|
150
|
+
}, R = () => {
|
|
151
|
+
j(null), O.resetFields(), O.setFieldsValue({ status: 1 }), d(!0);
|
|
152
|
+
}, _ = (t) => {
|
|
153
|
+
j(t), O.setFieldsValue({ name: t.name, description: t.description, status: t.status ?? 1 }), d(!0);
|
|
154
|
+
}, V = async () => {
|
|
154
155
|
try {
|
|
155
|
-
const
|
|
156
|
-
|
|
157
|
-
} catch (
|
|
158
|
-
if (
|
|
159
|
-
|
|
156
|
+
const t = await O.validateFields();
|
|
157
|
+
y ? (await I.updateProject(y.id, t), b.success("项目已更新")) : (await I.createProject(t), b.success("项目已创建")), d(!1), c();
|
|
158
|
+
} catch (t) {
|
|
159
|
+
if (t != null && t.errorFields) return;
|
|
160
|
+
b.error("保存失败: " + ((t == null ? void 0 : t.message) || t));
|
|
160
161
|
}
|
|
161
|
-
},
|
|
162
|
+
}, $ = async (t) => {
|
|
162
163
|
try {
|
|
163
|
-
await
|
|
164
|
-
} catch (
|
|
165
|
-
|
|
164
|
+
await I.archiveProject(t), b.success("项目已归档"), c(), (u == null ? void 0 : u.id) === t && (D(null), z([]));
|
|
165
|
+
} catch (x) {
|
|
166
|
+
b.error("归档失败: " + ((x == null ? void 0 : x.message) || x));
|
|
166
167
|
}
|
|
167
|
-
},
|
|
168
|
+
}, H = async (t) => {
|
|
168
169
|
try {
|
|
169
|
-
await
|
|
170
|
-
} catch (
|
|
171
|
-
|
|
170
|
+
await I.completeTask(t), b.success("任务已完成"), P();
|
|
171
|
+
} catch (x) {
|
|
172
|
+
b.error("操作失败: " + ((x == null ? void 0 : x.message) || x));
|
|
172
173
|
}
|
|
173
|
-
},
|
|
174
|
+
}, B = [
|
|
174
175
|
{
|
|
175
176
|
title: "项目名称",
|
|
176
177
|
dataIndex: "name",
|
|
177
|
-
render: (
|
|
178
|
+
render: (t, x) => /* @__PURE__ */ e.jsx(
|
|
178
179
|
"a",
|
|
179
180
|
{
|
|
180
|
-
onClick: () =>
|
|
181
|
-
style: { fontWeight: (
|
|
182
|
-
children:
|
|
181
|
+
onClick: () => p(x),
|
|
182
|
+
style: { fontWeight: (u == null ? void 0 : u.id) === x.id ? 600 : 400 },
|
|
183
|
+
children: t
|
|
183
184
|
}
|
|
184
185
|
)
|
|
185
186
|
},
|
|
@@ -187,126 +188,126 @@ function re({ apiBaseURL: t }) {
|
|
|
187
188
|
title: "状态",
|
|
188
189
|
dataIndex: "status",
|
|
189
190
|
width: 80,
|
|
190
|
-
render: (
|
|
191
|
+
render: (t) => t === 1 ? /* @__PURE__ */ e.jsx(v, { color: "green", children: "进行中" }) : /* @__PURE__ */ e.jsx(v, { children: "已归档" })
|
|
191
192
|
},
|
|
192
|
-
{ title: "创建时间", dataIndex: "createdAt", width: 170, render:
|
|
193
|
+
{ title: "创建时间", dataIndex: "createdAt", width: 170, render: Q },
|
|
193
194
|
{
|
|
194
195
|
title: "操作",
|
|
195
196
|
width: 160,
|
|
196
197
|
fixed: "right",
|
|
197
|
-
render: (
|
|
198
|
-
/* @__PURE__ */ e.jsx(
|
|
199
|
-
/* @__PURE__ */ e.jsx(
|
|
198
|
+
render: (t, x) => /* @__PURE__ */ e.jsxs(w, { children: [
|
|
199
|
+
/* @__PURE__ */ e.jsx(T, { size: "small", icon: /* @__PURE__ */ e.jsx(J, {}), onClick: () => _(x), children: "编辑" }),
|
|
200
|
+
/* @__PURE__ */ e.jsx(ue, { title: "确定归档该项目?", onConfirm: () => $(x.id), children: /* @__PURE__ */ e.jsx(T, { size: "small", danger: !0, icon: /* @__PURE__ */ e.jsx(ee, {}), children: "归档" }) })
|
|
200
201
|
] })
|
|
201
202
|
}
|
|
202
|
-
],
|
|
203
|
-
const
|
|
203
|
+
], K = (t) => {
|
|
204
|
+
const W = {
|
|
204
205
|
0: { text: "待办", color: "default" },
|
|
205
206
|
1: { text: "进行中", color: "blue" },
|
|
206
207
|
2: { text: "已完成", color: "green" }
|
|
207
|
-
}[
|
|
208
|
-
return /* @__PURE__ */ e.jsx(
|
|
208
|
+
}[t] || { text: String(t), color: "default" };
|
|
209
|
+
return /* @__PURE__ */ e.jsx(v, { color: W.color, children: W.text });
|
|
209
210
|
};
|
|
210
211
|
return /* @__PURE__ */ e.jsxs("div", { children: [
|
|
211
|
-
/* @__PURE__ */ e.jsx("div", { style: { display: "flex", justifyContent: "flex-end", marginBottom: 12 }, children: /* @__PURE__ */ e.jsx(
|
|
212
|
+
/* @__PURE__ */ e.jsx("div", { style: { display: "flex", justifyContent: "flex-end", marginBottom: 12 }, children: /* @__PURE__ */ e.jsx(T, { type: "primary", icon: /* @__PURE__ */ e.jsx(pe, {}), onClick: R, children: "新建项目" }) }),
|
|
212
213
|
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", gap: 16, height: "calc(100vh - 220px)" }, children: [
|
|
213
214
|
/* @__PURE__ */ e.jsx(
|
|
214
|
-
|
|
215
|
+
C,
|
|
215
216
|
{
|
|
216
217
|
size: "small",
|
|
217
|
-
title: /* @__PURE__ */ e.jsxs(
|
|
218
|
-
/* @__PURE__ */ e.jsx(
|
|
218
|
+
title: /* @__PURE__ */ e.jsxs(w, { children: [
|
|
219
|
+
/* @__PURE__ */ e.jsx(Te, {}),
|
|
219
220
|
"项目管理"
|
|
220
221
|
] }),
|
|
221
222
|
style: { width: 520, flexShrink: 0 },
|
|
222
223
|
styles: { body: { padding: 8, overflow: "auto", height: "calc(100% - 40px)" } },
|
|
223
224
|
children: /* @__PURE__ */ e.jsx(
|
|
224
|
-
|
|
225
|
+
Z,
|
|
225
226
|
{
|
|
226
227
|
rowKey: "id",
|
|
227
|
-
columns:
|
|
228
|
+
columns: B,
|
|
228
229
|
dataSource: l,
|
|
229
|
-
loading:
|
|
230
|
+
loading: i,
|
|
230
231
|
pagination: { pageSize: 10, size: "small" },
|
|
231
232
|
size: "small",
|
|
232
|
-
rowClassName: (
|
|
233
|
-
onRow: (
|
|
233
|
+
rowClassName: (t) => (u == null ? void 0 : u.id) === t.id ? "ant-table-row-selected" : "",
|
|
234
|
+
onRow: (t) => ({ onClick: () => p(t), style: { cursor: "pointer" } }),
|
|
234
235
|
locale: { emptyText: "暂无项目" }
|
|
235
236
|
}
|
|
236
237
|
)
|
|
237
238
|
}
|
|
238
239
|
),
|
|
239
240
|
/* @__PURE__ */ e.jsx(
|
|
240
|
-
|
|
241
|
+
C,
|
|
241
242
|
{
|
|
242
243
|
size: "small",
|
|
243
244
|
style: { flex: 1, overflow: "auto" },
|
|
244
245
|
styles: { body: { padding: 16 } },
|
|
245
|
-
title:
|
|
246
|
-
/* @__PURE__ */ e.jsx(
|
|
247
|
-
|
|
246
|
+
title: u ? /* @__PURE__ */ e.jsxs(w, { children: [
|
|
247
|
+
/* @__PURE__ */ e.jsx(ke, {}),
|
|
248
|
+
u.name,
|
|
248
249
|
" · 任务列表"
|
|
249
250
|
] }) : "项目详情",
|
|
250
|
-
children:
|
|
251
|
-
/* @__PURE__ */ e.jsxs(
|
|
252
|
-
/* @__PURE__ */ e.jsx(
|
|
253
|
-
/* @__PURE__ */ e.jsx(
|
|
254
|
-
/* @__PURE__ */ e.jsx(
|
|
255
|
-
/* @__PURE__ */ e.jsx(
|
|
251
|
+
children: u ? /* @__PURE__ */ e.jsxs(de, { spinning: g, children: [
|
|
252
|
+
/* @__PURE__ */ e.jsxs(k, { size: "small", bordered: !0, column: 2, style: { marginBottom: 16 }, children: [
|
|
253
|
+
/* @__PURE__ */ e.jsx(k.Item, { label: "项目名称", span: 2, children: u.name }),
|
|
254
|
+
/* @__PURE__ */ e.jsx(k.Item, { label: "描述", span: 2, children: u.description || "无" }),
|
|
255
|
+
/* @__PURE__ */ e.jsx(k.Item, { label: "负责人", children: u.ownerId || "未指定" }),
|
|
256
|
+
/* @__PURE__ */ e.jsx(k.Item, { label: "状态", children: u.status === 1 ? /* @__PURE__ */ e.jsx(v, { color: "green", children: "进行中" }) : /* @__PURE__ */ e.jsx(v, { children: "已归档" }) }),
|
|
256
257
|
/* @__PURE__ */ e.jsx(
|
|
257
|
-
|
|
258
|
+
k.Item,
|
|
258
259
|
{
|
|
259
260
|
label: "创建时间",
|
|
260
|
-
children:
|
|
261
|
+
children: Q(u.createdAt)
|
|
261
262
|
}
|
|
262
263
|
),
|
|
263
|
-
/* @__PURE__ */ e.jsx(
|
|
264
|
+
/* @__PURE__ */ e.jsx(k.Item, { label: "项目ID", children: u.id })
|
|
264
265
|
] }),
|
|
265
266
|
/* @__PURE__ */ e.jsx(
|
|
266
|
-
|
|
267
|
+
N,
|
|
267
268
|
{
|
|
268
269
|
size: "small",
|
|
269
270
|
header: /* @__PURE__ */ e.jsxs("b", { children: [
|
|
270
271
|
"任务项 (",
|
|
271
|
-
|
|
272
|
+
S.length,
|
|
272
273
|
")"
|
|
273
274
|
] }),
|
|
274
275
|
bordered: !0,
|
|
275
|
-
dataSource:
|
|
276
|
+
dataSource: S,
|
|
276
277
|
locale: { emptyText: "该项目下暂无任务" },
|
|
277
|
-
renderItem: (
|
|
278
|
-
|
|
278
|
+
renderItem: (t) => /* @__PURE__ */ e.jsx(
|
|
279
|
+
N.Item,
|
|
279
280
|
{
|
|
280
281
|
actions: [
|
|
281
282
|
/* @__PURE__ */ e.jsx(
|
|
282
|
-
|
|
283
|
+
T,
|
|
283
284
|
{
|
|
284
285
|
size: "small",
|
|
285
286
|
type: "primary",
|
|
286
|
-
icon: /* @__PURE__ */ e.jsx(
|
|
287
|
-
disabled:
|
|
288
|
-
onClick: () =>
|
|
287
|
+
icon: /* @__PURE__ */ e.jsx(te, {}),
|
|
288
|
+
disabled: t.status === 2,
|
|
289
|
+
onClick: () => H(t.id),
|
|
289
290
|
children: "完成"
|
|
290
291
|
},
|
|
291
292
|
"complete"
|
|
292
293
|
)
|
|
293
294
|
],
|
|
294
295
|
children: /* @__PURE__ */ e.jsx(
|
|
295
|
-
|
|
296
|
+
N.Item.Meta,
|
|
296
297
|
{
|
|
297
|
-
title: /* @__PURE__ */ e.jsxs(
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
/* @__PURE__ */ e.jsxs(
|
|
298
|
+
title: /* @__PURE__ */ e.jsxs(w, { children: [
|
|
299
|
+
t.title,
|
|
300
|
+
K(t.status),
|
|
301
|
+
/* @__PURE__ */ e.jsxs(v, { children: [
|
|
301
302
|
"优先级 ",
|
|
302
|
-
|
|
303
|
+
t.priority ?? "-"
|
|
303
304
|
] })
|
|
304
305
|
] }),
|
|
305
306
|
description: /* @__PURE__ */ e.jsxs("span", { style: { color: "#888", fontSize: 12 }, children: [
|
|
306
307
|
"截止: ",
|
|
307
|
-
|
|
308
|
+
Q(t.dueDate),
|
|
308
309
|
" · ID: ",
|
|
309
|
-
|
|
310
|
+
t.id
|
|
310
311
|
] })
|
|
311
312
|
}
|
|
312
313
|
)
|
|
@@ -314,27 +315,27 @@ function re({ apiBaseURL: t }) {
|
|
|
314
315
|
)
|
|
315
316
|
}
|
|
316
317
|
)
|
|
317
|
-
] }) : /* @__PURE__ */ e.jsx(
|
|
318
|
+
] }) : /* @__PURE__ */ e.jsx(X, { description: "请从左侧选择一个项目", style: { marginTop: 80 } })
|
|
318
319
|
}
|
|
319
320
|
)
|
|
320
321
|
] }),
|
|
321
322
|
/* @__PURE__ */ e.jsx(
|
|
322
|
-
|
|
323
|
+
xe,
|
|
323
324
|
{
|
|
324
|
-
title:
|
|
325
|
+
title: y ? `编辑项目 - ${y.name}` : "新建项目",
|
|
325
326
|
size: "large",
|
|
326
327
|
open: r,
|
|
327
|
-
onClose: () =>
|
|
328
|
+
onClose: () => d(!1),
|
|
328
329
|
destroyOnHidden: !0,
|
|
329
|
-
extra: /* @__PURE__ */ e.jsxs(
|
|
330
|
-
/* @__PURE__ */ e.jsx(
|
|
331
|
-
/* @__PURE__ */ e.jsx(
|
|
330
|
+
extra: /* @__PURE__ */ e.jsxs(w, { children: [
|
|
331
|
+
/* @__PURE__ */ e.jsx(T, { onClick: () => d(!1), children: "取消" }),
|
|
332
|
+
/* @__PURE__ */ e.jsx(T, { type: "primary", onClick: V, children: "保存" })
|
|
332
333
|
] }),
|
|
333
|
-
children: /* @__PURE__ */ e.jsxs(
|
|
334
|
-
/* @__PURE__ */ e.jsx(
|
|
335
|
-
/* @__PURE__ */ e.jsx(
|
|
336
|
-
/* @__PURE__ */ e.jsx(
|
|
337
|
-
|
|
334
|
+
children: /* @__PURE__ */ e.jsxs(f, { form: O, layout: "vertical", preserve: !1, children: [
|
|
335
|
+
/* @__PURE__ */ e.jsx(f.Item, { name: "name", label: "项目名称", rules: [{ required: !0, message: "请输入项目名称" }], children: /* @__PURE__ */ e.jsx(A, { placeholder: "例如: 一人公司" }) }),
|
|
336
|
+
/* @__PURE__ */ e.jsx(f.Item, { name: "description", label: "项目描述", children: /* @__PURE__ */ e.jsx(A.TextArea, { rows: 3, placeholder: "可选" }) }),
|
|
337
|
+
/* @__PURE__ */ e.jsx(f.Item, { name: "status", label: "状态", initialValue: 1, children: /* @__PURE__ */ e.jsx(
|
|
338
|
+
M,
|
|
338
339
|
{
|
|
339
340
|
options: [
|
|
340
341
|
{ label: "进行中", value: 1 },
|
|
@@ -347,344 +348,78 @@ function re({ apiBaseURL: t }) {
|
|
|
347
348
|
)
|
|
348
349
|
] });
|
|
349
350
|
}
|
|
350
|
-
const
|
|
351
|
-
// 卡片表面
|
|
352
|
-
surfaceAlt: "#fafbfc",
|
|
353
|
-
// 次级表面 (表格 hover 等)
|
|
354
|
-
border: "#e5e7eb",
|
|
355
|
-
text: "#111827",
|
|
356
|
-
// 主文本
|
|
357
|
-
textMuted: "#6b7280"
|
|
358
|
-
}, Ie = {
|
|
359
|
-
md: 12
|
|
360
|
-
};
|
|
361
|
-
function Ee({
|
|
362
|
-
icon: t,
|
|
363
|
-
title: l = "暂无数据",
|
|
364
|
-
description: i,
|
|
365
|
-
actionText: n,
|
|
366
|
-
onAction: c,
|
|
367
|
-
size: r = "md",
|
|
368
|
-
style: u
|
|
369
|
-
}) {
|
|
370
|
-
const o = { sm: 24, md: 40, lg: 64 }, a = { sm: 14, md: 16, lg: 20 };
|
|
371
|
-
return /* @__PURE__ */ e.jsxs(
|
|
372
|
-
"div",
|
|
373
|
-
{
|
|
374
|
-
role: "status",
|
|
375
|
-
"aria-live": "polite",
|
|
376
|
-
style: {
|
|
377
|
-
padding: o[r] || o.md,
|
|
378
|
-
textAlign: "center",
|
|
379
|
-
background: "#ffffff",
|
|
380
|
-
borderRadius: Ie.md,
|
|
381
|
-
border: "1px dashed #e5e7eb",
|
|
382
|
-
...u
|
|
383
|
-
},
|
|
384
|
-
children: [
|
|
385
|
-
/* @__PURE__ */ e.jsx("div", { style: {
|
|
386
|
-
display: "inline-flex",
|
|
387
|
-
alignItems: "center",
|
|
388
|
-
justifyContent: "center",
|
|
389
|
-
width: 56,
|
|
390
|
-
height: 56,
|
|
391
|
-
borderRadius: "50%",
|
|
392
|
-
background: Y.surfaceAlt,
|
|
393
|
-
marginBottom: 16,
|
|
394
|
-
fontSize: 28,
|
|
395
|
-
color: "#9ca3af"
|
|
396
|
-
}, children: t || /* @__PURE__ */ e.jsx(fe, {}) }),
|
|
397
|
-
/* @__PURE__ */ e.jsx("div", { style: {
|
|
398
|
-
fontSize: a[r],
|
|
399
|
-
fontWeight: 600,
|
|
400
|
-
color: Y.text,
|
|
401
|
-
marginBottom: i ? 6 : 16
|
|
402
|
-
}, children: l }),
|
|
403
|
-
i && /* @__PURE__ */ e.jsx("div", { style: {
|
|
404
|
-
fontSize: 13,
|
|
405
|
-
color: Y.textMuted,
|
|
406
|
-
lineHeight: 1.6,
|
|
407
|
-
maxWidth: 360,
|
|
408
|
-
margin: "0 auto 16px"
|
|
409
|
-
}, children: i }),
|
|
410
|
-
n && c && /* @__PURE__ */ e.jsx(
|
|
411
|
-
b,
|
|
412
|
-
{
|
|
413
|
-
type: "primary",
|
|
414
|
-
onClick: c,
|
|
415
|
-
style: {
|
|
416
|
-
background: "linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%)",
|
|
417
|
-
border: "none",
|
|
418
|
-
minHeight: 36
|
|
419
|
-
},
|
|
420
|
-
children: n
|
|
421
|
-
}
|
|
422
|
-
)
|
|
423
|
-
]
|
|
424
|
-
}
|
|
425
|
-
);
|
|
426
|
-
}
|
|
427
|
-
function ie({
|
|
428
|
-
error: t,
|
|
429
|
-
title: l = "加载失败",
|
|
430
|
-
description: i,
|
|
431
|
-
onRetry: n,
|
|
432
|
-
retryText: c = "重新加载",
|
|
433
|
-
variant: r = "inline",
|
|
434
|
-
style: u
|
|
435
|
-
}) {
|
|
436
|
-
var o;
|
|
437
|
-
const a = r === "full", d = (o = t == null ? void 0 : t.response) == null ? void 0 : o.data, k = d && typeof d == "object" && (typeof d.message == "string" && d.message || typeof d.msg == "string" && d.msg) || null, P = k || (typeof t == "string" ? t : (t == null ? void 0 : t.message) || (t == null ? void 0 : t.msg) || (t ? String(t) : null)), S = i || (k ? `原因: ${k}` : P ? `原因: ${P}。请检查网络或稍后重试。` : "请检查网络或稍后重试。");
|
|
438
|
-
return /* @__PURE__ */ e.jsxs(
|
|
439
|
-
"div",
|
|
440
|
-
{
|
|
441
|
-
role: "alert",
|
|
442
|
-
"aria-live": "assertive",
|
|
443
|
-
style: {
|
|
444
|
-
padding: a ? "48px 24px" : "20px 24px",
|
|
445
|
-
background: a ? "#ffffff" : "#fef2f2",
|
|
446
|
-
border: a ? `1px dashed ${Y.border}` : "1px solid #fecaca",
|
|
447
|
-
borderRadius: Ie.md,
|
|
448
|
-
textAlign: a ? "center" : "left",
|
|
449
|
-
display: "flex",
|
|
450
|
-
flexDirection: a ? "column" : "row",
|
|
451
|
-
alignItems: a ? "center" : "flex-start",
|
|
452
|
-
gap: a ? 12 : 16,
|
|
453
|
-
...u
|
|
454
|
-
},
|
|
455
|
-
children: [
|
|
456
|
-
/* @__PURE__ */ e.jsx("div", { style: {
|
|
457
|
-
display: "inline-flex",
|
|
458
|
-
alignItems: "center",
|
|
459
|
-
justifyContent: "center",
|
|
460
|
-
width: a ? 56 : 36,
|
|
461
|
-
height: a ? 56 : 36,
|
|
462
|
-
borderRadius: "50%",
|
|
463
|
-
background: a ? "#fef2f2" : "#ffffff",
|
|
464
|
-
color: "#dc2626",
|
|
465
|
-
fontSize: a ? 28 : 18,
|
|
466
|
-
flexShrink: 0
|
|
467
|
-
}, children: /* @__PURE__ */ e.jsx(Se, {}) }),
|
|
468
|
-
/* @__PURE__ */ e.jsxs("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
469
|
-
/* @__PURE__ */ e.jsx("div", { style: {
|
|
470
|
-
fontSize: a ? 16 : 14,
|
|
471
|
-
fontWeight: 600,
|
|
472
|
-
color: "#991b1b",
|
|
473
|
-
marginBottom: 4
|
|
474
|
-
}, children: l }),
|
|
475
|
-
/* @__PURE__ */ e.jsx("div", { style: {
|
|
476
|
-
fontSize: 13,
|
|
477
|
-
color: "#7f1d1d",
|
|
478
|
-
lineHeight: 1.6,
|
|
479
|
-
wordBreak: "break-word"
|
|
480
|
-
}, children: S }),
|
|
481
|
-
n && /* @__PURE__ */ e.jsx(
|
|
482
|
-
b,
|
|
483
|
-
{
|
|
484
|
-
type: "primary",
|
|
485
|
-
danger: !0,
|
|
486
|
-
icon: /* @__PURE__ */ e.jsx(ye, {}),
|
|
487
|
-
onClick: n,
|
|
488
|
-
size: a ? "middle" : "small",
|
|
489
|
-
style: { marginTop: 12 },
|
|
490
|
-
children: c
|
|
491
|
-
}
|
|
492
|
-
)
|
|
493
|
-
] })
|
|
494
|
-
]
|
|
495
|
-
}
|
|
496
|
-
);
|
|
497
|
-
}
|
|
498
|
-
function _e({
|
|
499
|
-
title: t,
|
|
500
|
-
subtitle: l,
|
|
501
|
-
breadcrumb: i,
|
|
502
|
-
extra: n,
|
|
503
|
-
back: c,
|
|
504
|
-
onBack: r
|
|
505
|
-
}) {
|
|
506
|
-
const u = Re();
|
|
507
|
-
return /* @__PURE__ */ e.jsx("div", { style: {
|
|
508
|
-
marginBottom: 12,
|
|
509
|
-
paddingBottom: 10,
|
|
510
|
-
borderBottom: "1px solid #f1f5f9"
|
|
511
|
-
}, children: /* @__PURE__ */ e.jsxs("div", { style: {
|
|
512
|
-
display: "flex",
|
|
513
|
-
alignItems: "center",
|
|
514
|
-
justifyContent: "space-between",
|
|
515
|
-
gap: 12,
|
|
516
|
-
flexWrap: "wrap"
|
|
517
|
-
}, children: [
|
|
518
|
-
/* @__PURE__ */ e.jsxs("div", { style: {
|
|
519
|
-
display: "flex",
|
|
520
|
-
alignItems: "center",
|
|
521
|
-
gap: 10,
|
|
522
|
-
minWidth: 0,
|
|
523
|
-
flexWrap: "wrap"
|
|
524
|
-
}, children: [
|
|
525
|
-
c && /* @__PURE__ */ e.jsx(
|
|
526
|
-
"button",
|
|
527
|
-
{
|
|
528
|
-
onClick: () => {
|
|
529
|
-
r ? r() : u(-1);
|
|
530
|
-
},
|
|
531
|
-
"aria-label": "返回上一页",
|
|
532
|
-
style: {
|
|
533
|
-
width: 28,
|
|
534
|
-
height: 28,
|
|
535
|
-
borderRadius: 6,
|
|
536
|
-
border: "1px solid #e5e7eb",
|
|
537
|
-
background: "#ffffff",
|
|
538
|
-
color: "#6b7280",
|
|
539
|
-
cursor: "pointer",
|
|
540
|
-
display: "inline-flex",
|
|
541
|
-
alignItems: "center",
|
|
542
|
-
justifyContent: "center",
|
|
543
|
-
fontSize: 13,
|
|
544
|
-
transition: "all 150ms ease",
|
|
545
|
-
flexShrink: 0
|
|
546
|
-
},
|
|
547
|
-
onMouseEnter: (o) => {
|
|
548
|
-
o.currentTarget.style.background = "#f8fafc", o.currentTarget.style.color = "#111827", o.currentTarget.style.borderColor = "#7c3aed";
|
|
549
|
-
},
|
|
550
|
-
onMouseLeave: (o) => {
|
|
551
|
-
o.currentTarget.style.background = "#ffffff", o.currentTarget.style.color = "#6b7280", o.currentTarget.style.borderColor = "#e5e7eb";
|
|
552
|
-
},
|
|
553
|
-
children: "←"
|
|
554
|
-
}
|
|
555
|
-
),
|
|
556
|
-
i && i.length > 0 ? /* @__PURE__ */ e.jsx(
|
|
557
|
-
Te,
|
|
558
|
-
{
|
|
559
|
-
items: i.map((o, a) => {
|
|
560
|
-
const d = a === i.length - 1;
|
|
561
|
-
return {
|
|
562
|
-
title: o.href && !d ? /* @__PURE__ */ e.jsx("a", { onClick: (k) => {
|
|
563
|
-
k.preventDefault(), u(o.href);
|
|
564
|
-
}, children: o.label }) : /* @__PURE__ */ e.jsx("span", { style: d ? {
|
|
565
|
-
fontWeight: 600,
|
|
566
|
-
color: "#111827"
|
|
567
|
-
} : void 0, children: o.label })
|
|
568
|
-
};
|
|
569
|
-
})
|
|
570
|
-
}
|
|
571
|
-
) : t && /* @__PURE__ */ e.jsx("span", { role: "heading", "aria-level": 1, style: {
|
|
572
|
-
fontSize: 15,
|
|
573
|
-
fontWeight: 600,
|
|
574
|
-
color: "#111827",
|
|
575
|
-
lineHeight: 1.4
|
|
576
|
-
}, children: t }),
|
|
577
|
-
l && /* @__PURE__ */ e.jsx("span", { title: l, style: {
|
|
578
|
-
fontSize: 12,
|
|
579
|
-
color: "#94a3b8",
|
|
580
|
-
lineHeight: 1.4,
|
|
581
|
-
whiteSpace: "nowrap",
|
|
582
|
-
overflow: "hidden",
|
|
583
|
-
textOverflow: "ellipsis",
|
|
584
|
-
maxWidth: 360
|
|
585
|
-
}, children: l })
|
|
586
|
-
] }),
|
|
587
|
-
n && /* @__PURE__ */ e.jsx("div", { style: {
|
|
588
|
-
display: "flex",
|
|
589
|
-
gap: 8,
|
|
590
|
-
flexShrink: 0
|
|
591
|
-
}, children: n })
|
|
592
|
-
] }) });
|
|
593
|
-
}
|
|
594
|
-
function Ve({ left: t, right: l, extra: i }) {
|
|
595
|
-
return /* @__PURE__ */ e.jsxs(
|
|
596
|
-
"div",
|
|
597
|
-
{
|
|
598
|
-
style: {
|
|
599
|
-
display: "flex",
|
|
600
|
-
alignItems: "center",
|
|
601
|
-
justifyContent: "space-between",
|
|
602
|
-
gap: 12,
|
|
603
|
-
marginBottom: 12,
|
|
604
|
-
flexWrap: "wrap"
|
|
605
|
-
},
|
|
606
|
-
children: [
|
|
607
|
-
/* @__PURE__ */ e.jsx(T, { size: 8, wrap: !0, children: t }),
|
|
608
|
-
/* @__PURE__ */ e.jsxs(T, { size: 8, wrap: !0, children: [
|
|
609
|
-
l,
|
|
610
|
-
i
|
|
611
|
-
] })
|
|
612
|
-
]
|
|
613
|
-
}
|
|
614
|
-
);
|
|
615
|
-
}
|
|
616
|
-
const { Paragraph: qe } = he, ae = {
|
|
351
|
+
const { Paragraph: Ee } = je, ae = {
|
|
617
352
|
0: { label: "待办", color: "default" },
|
|
618
353
|
1: { label: "进行中", color: "blue" },
|
|
619
354
|
2: { label: "已完成", color: "green" }
|
|
620
|
-
},
|
|
355
|
+
}, ie = {
|
|
621
356
|
1: { label: "低", color: "default" },
|
|
622
357
|
2: { label: "中", color: "orange" },
|
|
623
358
|
3: { label: "高", color: "red" }
|
|
624
359
|
};
|
|
625
|
-
function
|
|
626
|
-
const [r,
|
|
627
|
-
|
|
628
|
-
!l || !
|
|
629
|
-
}, [l,
|
|
630
|
-
const
|
|
360
|
+
function _e({ taskId: s, open: l, onClose: o, onChanged: i, onEdit: n }) {
|
|
361
|
+
const [r, d] = h(null), [y, j] = h(!1);
|
|
362
|
+
E(() => {
|
|
363
|
+
!l || !s || (j(!0), I.getTaskDetail(s).then((g) => d((g == null ? void 0 : g.data) || g)).catch(() => d(null)).finally(() => j(!1)));
|
|
364
|
+
}, [l, s]);
|
|
365
|
+
const u = async () => {
|
|
631
366
|
try {
|
|
632
|
-
await
|
|
367
|
+
await I.completeTask(s), d((g) => ({ ...g, status: 2 })), i == null || i();
|
|
633
368
|
} catch {
|
|
634
369
|
}
|
|
635
|
-
},
|
|
370
|
+
}, D = async () => {
|
|
636
371
|
try {
|
|
637
|
-
await
|
|
372
|
+
await I.deleteTask(s), i == null || i(), o == null || o();
|
|
638
373
|
} catch {
|
|
639
374
|
}
|
|
640
|
-
},
|
|
375
|
+
}, S = ae[r == null ? void 0 : r.status] || ae[0], z = ie[r == null ? void 0 : r.priority] || ie[1];
|
|
641
376
|
return /* @__PURE__ */ e.jsx(
|
|
642
|
-
|
|
377
|
+
xe,
|
|
643
378
|
{
|
|
644
379
|
title: (r == null ? void 0 : r.title) || "任务详情",
|
|
645
380
|
size: "large",
|
|
646
381
|
open: l,
|
|
647
|
-
onClose:
|
|
648
|
-
loading:
|
|
382
|
+
onClose: o,
|
|
383
|
+
loading: y,
|
|
649
384
|
footer: /* @__PURE__ */ e.jsxs("div", { style: { display: "flex", justifyContent: "space-between" }, children: [
|
|
650
385
|
/* @__PURE__ */ e.jsx(
|
|
651
|
-
|
|
386
|
+
ue,
|
|
652
387
|
{
|
|
653
388
|
title: "确认删除此任务?",
|
|
654
|
-
onConfirm:
|
|
389
|
+
onConfirm: D,
|
|
655
390
|
okText: "删除",
|
|
656
391
|
cancelText: "取消",
|
|
657
392
|
okButtonProps: { danger: !0 },
|
|
658
|
-
children: /* @__PURE__ */ e.jsx(
|
|
393
|
+
children: /* @__PURE__ */ e.jsx(T, { danger: !0, icon: /* @__PURE__ */ e.jsx(ee, {}), children: "删除" })
|
|
659
394
|
}
|
|
660
395
|
),
|
|
661
|
-
/* @__PURE__ */ e.jsxs(
|
|
662
|
-
(r == null ? void 0 : r.status) !== 2 && /* @__PURE__ */ e.jsx(
|
|
663
|
-
/* @__PURE__ */ e.jsx(
|
|
396
|
+
/* @__PURE__ */ e.jsxs(w, { children: [
|
|
397
|
+
(r == null ? void 0 : r.status) !== 2 && /* @__PURE__ */ e.jsx(T, { type: "primary", icon: /* @__PURE__ */ e.jsx(te, {}), onClick: u, children: "完成任务" }),
|
|
398
|
+
/* @__PURE__ */ e.jsx(T, { icon: /* @__PURE__ */ e.jsx(J, {}), onClick: () => n == null ? void 0 : n(r), children: "编辑" })
|
|
664
399
|
] })
|
|
665
400
|
] }),
|
|
666
401
|
children: r && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
667
|
-
/* @__PURE__ */ e.jsxs(
|
|
668
|
-
/* @__PURE__ */ e.jsx(
|
|
669
|
-
/* @__PURE__ */ e.jsx(
|
|
670
|
-
/* @__PURE__ */ e.jsx(
|
|
671
|
-
/* @__PURE__ */ e.jsx(
|
|
672
|
-
/* @__PURE__ */ e.jsx(
|
|
673
|
-
/* @__PURE__ */ e.jsx(
|
|
674
|
-
/* @__PURE__ */ e.jsx(
|
|
402
|
+
/* @__PURE__ */ e.jsxs(k, { column: 2, bordered: !0, size: "small", style: { marginBottom: 24 }, children: [
|
|
403
|
+
/* @__PURE__ */ e.jsx(k.Item, { label: "状态", children: /* @__PURE__ */ e.jsx(v, { color: S.color, children: S.label }) }),
|
|
404
|
+
/* @__PURE__ */ e.jsx(k.Item, { label: "优先级", children: /* @__PURE__ */ e.jsx(v, { color: z.color, children: z.label }) }),
|
|
405
|
+
/* @__PURE__ */ e.jsx(k.Item, { label: "项目 ID", children: r.projectId }),
|
|
406
|
+
/* @__PURE__ */ e.jsx(k.Item, { label: "列表 ID", children: r.listId }),
|
|
407
|
+
/* @__PURE__ */ e.jsx(k.Item, { label: "截止时间", span: 2, children: r.dueDate || "未设置" }),
|
|
408
|
+
/* @__PURE__ */ e.jsx(k.Item, { label: "创建时间", children: r.createdAt || "-" }),
|
|
409
|
+
/* @__PURE__ */ e.jsx(k.Item, { label: "更新时间", children: r.updatedAt || "-" })
|
|
675
410
|
] }),
|
|
676
411
|
r.description && /* @__PURE__ */ e.jsxs("div", { style: { marginBottom: 24 }, children: [
|
|
677
412
|
/* @__PURE__ */ e.jsx("div", { style: { fontWeight: 600, marginBottom: 8 }, children: "描述" }),
|
|
678
|
-
/* @__PURE__ */ e.jsx(
|
|
413
|
+
/* @__PURE__ */ e.jsx(Ee, { style: { whiteSpace: "pre-wrap", color: "#595959" }, children: r.description })
|
|
679
414
|
] })
|
|
680
415
|
] })
|
|
681
416
|
}
|
|
682
417
|
);
|
|
683
418
|
}
|
|
684
|
-
function
|
|
685
|
-
const [r] =
|
|
686
|
-
|
|
687
|
-
|
|
419
|
+
function Ve({ open: s, task: l, projects: o, onClose: i, onSaved: n }) {
|
|
420
|
+
const [r] = f.useForm(), d = !!(l != null && l.id);
|
|
421
|
+
E(() => {
|
|
422
|
+
s && l ? r.setFieldsValue({
|
|
688
423
|
title: l.title,
|
|
689
424
|
description: l.description,
|
|
690
425
|
projectId: l.projectId,
|
|
@@ -692,59 +427,59 @@ function Ne({ open: t, task: l, projects: i, onClose: n, onSaved: c }) {
|
|
|
692
427
|
status: l.status,
|
|
693
428
|
priority: l.priority,
|
|
694
429
|
dueDate: l.dueDate
|
|
695
|
-
}) :
|
|
696
|
-
}, [
|
|
697
|
-
const
|
|
430
|
+
}) : s && r.resetFields();
|
|
431
|
+
}, [s, l, r]);
|
|
432
|
+
const y = async () => {
|
|
698
433
|
try {
|
|
699
|
-
const
|
|
700
|
-
|
|
701
|
-
} catch (
|
|
702
|
-
if (
|
|
703
|
-
|
|
434
|
+
const j = await r.validateFields();
|
|
435
|
+
d ? (await I.updateTask(l.id, j), b.success("任务已更新")) : (await I.createTask(j), b.success("任务已创建")), n == null || n(), i == null || i();
|
|
436
|
+
} catch (j) {
|
|
437
|
+
if (j != null && j.errorFields) return;
|
|
438
|
+
b.error("保存失败: " + ((j == null ? void 0 : j.message) || j));
|
|
704
439
|
}
|
|
705
440
|
};
|
|
706
441
|
return /* @__PURE__ */ e.jsx(
|
|
707
|
-
|
|
442
|
+
he,
|
|
708
443
|
{
|
|
709
|
-
title:
|
|
710
|
-
open:
|
|
711
|
-
onCancel:
|
|
712
|
-
onOk:
|
|
444
|
+
title: d ? "编辑任务" : "新建任务",
|
|
445
|
+
open: s,
|
|
446
|
+
onCancel: i,
|
|
447
|
+
onOk: y,
|
|
713
448
|
destroyOnHidden: !0,
|
|
714
449
|
size: "large",
|
|
715
|
-
children: /* @__PURE__ */ e.jsxs(
|
|
450
|
+
children: /* @__PURE__ */ e.jsxs(f, { form: r, layout: "vertical", preserve: !1, children: [
|
|
716
451
|
/* @__PURE__ */ e.jsx(
|
|
717
|
-
|
|
452
|
+
f.Item,
|
|
718
453
|
{
|
|
719
454
|
name: "title",
|
|
720
455
|
label: "任务标题",
|
|
721
456
|
rules: [{ required: !0, message: "请输入任务标题" }],
|
|
722
|
-
children: /* @__PURE__ */ e.jsx(
|
|
457
|
+
children: /* @__PURE__ */ e.jsx(A, { placeholder: "例如: 实现 xx 功能" })
|
|
723
458
|
}
|
|
724
459
|
),
|
|
725
|
-
/* @__PURE__ */ e.jsx(
|
|
460
|
+
/* @__PURE__ */ e.jsx(f.Item, { name: "description", label: "描述", children: /* @__PURE__ */ e.jsx(A.TextArea, { rows: 3, placeholder: "任务描述 (可选)" }) }),
|
|
726
461
|
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", gap: 16 }, children: [
|
|
727
462
|
/* @__PURE__ */ e.jsx(
|
|
728
|
-
|
|
463
|
+
f.Item,
|
|
729
464
|
{
|
|
730
465
|
name: "projectId",
|
|
731
466
|
label: "所属项目",
|
|
732
467
|
rules: [{ required: !0 }],
|
|
733
468
|
style: { flex: 1 },
|
|
734
469
|
children: /* @__PURE__ */ e.jsx(
|
|
735
|
-
|
|
470
|
+
M,
|
|
736
471
|
{
|
|
737
|
-
options:
|
|
472
|
+
options: o.map((j) => ({ label: j.name, value: j.id })),
|
|
738
473
|
placeholder: "选择项目"
|
|
739
474
|
}
|
|
740
475
|
)
|
|
741
476
|
}
|
|
742
477
|
),
|
|
743
|
-
/* @__PURE__ */ e.jsx(
|
|
478
|
+
/* @__PURE__ */ e.jsx(f.Item, { name: "listId", label: "列表 ID", style: { flex: 1 }, children: /* @__PURE__ */ e.jsx(A, { type: "number", placeholder: "默认 1" }) })
|
|
744
479
|
] }),
|
|
745
480
|
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", gap: 16 }, children: [
|
|
746
|
-
/* @__PURE__ */ e.jsx(
|
|
747
|
-
|
|
481
|
+
/* @__PURE__ */ e.jsx(f.Item, { name: "status", label: "状态", initialValue: 0, style: { flex: 1 }, children: /* @__PURE__ */ e.jsx(
|
|
482
|
+
M,
|
|
748
483
|
{
|
|
749
484
|
options: [
|
|
750
485
|
{ label: "待办", value: 0 },
|
|
@@ -753,8 +488,8 @@ function Ne({ open: t, task: l, projects: i, onClose: n, onSaved: c }) {
|
|
|
753
488
|
]
|
|
754
489
|
}
|
|
755
490
|
) }),
|
|
756
|
-
/* @__PURE__ */ e.jsx(
|
|
757
|
-
|
|
491
|
+
/* @__PURE__ */ e.jsx(f.Item, { name: "priority", label: "优先级", initialValue: 1, style: { flex: 1 }, children: /* @__PURE__ */ e.jsx(
|
|
492
|
+
M,
|
|
758
493
|
{
|
|
759
494
|
options: [
|
|
760
495
|
{ label: "低", value: 1 },
|
|
@@ -764,60 +499,60 @@ function Ne({ open: t, task: l, projects: i, onClose: n, onSaved: c }) {
|
|
|
764
499
|
}
|
|
765
500
|
) })
|
|
766
501
|
] }),
|
|
767
|
-
/* @__PURE__ */ e.jsx(
|
|
502
|
+
/* @__PURE__ */ e.jsx(f.Item, { name: "dueDate", label: "截止时间", children: /* @__PURE__ */ e.jsx(be, { style: { width: "100%" }, placeholder: "选择截止日期" }) })
|
|
768
503
|
] })
|
|
769
504
|
}
|
|
770
505
|
);
|
|
771
506
|
}
|
|
772
|
-
function
|
|
773
|
-
const [
|
|
507
|
+
function ne({ apiBaseURL: s, back: l }) {
|
|
508
|
+
const [o, i] = h([]), [n, r] = h(null), [d, y] = h([]), [j, u] = h(!1), [D, S] = h(null), [z, g] = h(null), [F, O] = h(!1), [c, p] = h(!1), [P, R] = h(!1), [_, V] = h(null), [$] = f.useForm(), H = async () => {
|
|
774
509
|
try {
|
|
775
|
-
const
|
|
776
|
-
|
|
777
|
-
} catch (
|
|
778
|
-
g((
|
|
510
|
+
const a = await I.listMyProjects(), m = (a == null ? void 0 : a.data) || a || [];
|
|
511
|
+
i(m), g(null), m.length > 0 && !n && r(m[0].id);
|
|
512
|
+
} catch (a) {
|
|
513
|
+
g((a == null ? void 0 : a.message) || "加载项目失败");
|
|
779
514
|
}
|
|
780
|
-
},
|
|
781
|
-
if (!
|
|
782
|
-
|
|
515
|
+
}, B = async (a) => {
|
|
516
|
+
if (!a) {
|
|
517
|
+
y([]);
|
|
783
518
|
return;
|
|
784
519
|
}
|
|
785
|
-
|
|
520
|
+
u(!0), S(null);
|
|
786
521
|
try {
|
|
787
|
-
const
|
|
788
|
-
|
|
789
|
-
} catch (
|
|
790
|
-
|
|
522
|
+
const m = await I.listTasksByProject(a);
|
|
523
|
+
y((m == null ? void 0 : m.data) || m || []);
|
|
524
|
+
} catch (m) {
|
|
525
|
+
S((m == null ? void 0 : m.message) || "加载任务失败");
|
|
791
526
|
} finally {
|
|
792
|
-
|
|
527
|
+
u(!1);
|
|
793
528
|
}
|
|
794
529
|
};
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
}, []),
|
|
798
|
-
|
|
799
|
-
}, [
|
|
800
|
-
const
|
|
801
|
-
if (!
|
|
802
|
-
|
|
530
|
+
E(() => {
|
|
531
|
+
H();
|
|
532
|
+
}, []), E(() => {
|
|
533
|
+
B(n);
|
|
534
|
+
}, [n]);
|
|
535
|
+
const K = () => {
|
|
536
|
+
if (!n) {
|
|
537
|
+
b.warning("请先选择项目");
|
|
803
538
|
return;
|
|
804
539
|
}
|
|
805
|
-
|
|
806
|
-
},
|
|
540
|
+
$.resetFields(), $.setFieldsValue({ projectId: n, listId: 1, status: 1, priority: 1 }), O(!0);
|
|
541
|
+
}, t = async () => {
|
|
807
542
|
try {
|
|
808
|
-
const
|
|
809
|
-
await
|
|
810
|
-
} catch (
|
|
811
|
-
if (
|
|
812
|
-
|
|
543
|
+
const a = await $.validateFields();
|
|
544
|
+
await I.createTask(a), b.success("任务已创建"), O(!1), B(n);
|
|
545
|
+
} catch (a) {
|
|
546
|
+
if (a != null && a.errorFields) return;
|
|
547
|
+
b.error("创建失败: " + ((a == null ? void 0 : a.message) || a));
|
|
813
548
|
}
|
|
814
|
-
},
|
|
549
|
+
}, x = async (a) => {
|
|
815
550
|
try {
|
|
816
|
-
await
|
|
817
|
-
} catch (
|
|
818
|
-
|
|
551
|
+
await I.completeTask(a), b.success("任务已完成"), B(n);
|
|
552
|
+
} catch (m) {
|
|
553
|
+
b.error("操作失败: " + ((m == null ? void 0 : m.message) || m));
|
|
819
554
|
}
|
|
820
|
-
},
|
|
555
|
+
}, W = [
|
|
821
556
|
{ title: "ID", dataIndex: "id", width: 60 },
|
|
822
557
|
{ title: "标题", dataIndex: "title" },
|
|
823
558
|
{ title: "项目ID", dataIndex: "projectId", width: 80 },
|
|
@@ -825,9 +560,9 @@ function oe({ apiBaseURL: t, back: l }) {
|
|
|
825
560
|
title: "状态",
|
|
826
561
|
dataIndex: "status",
|
|
827
562
|
width: 100,
|
|
828
|
-
render: (
|
|
829
|
-
const
|
|
830
|
-
return /* @__PURE__ */ e.jsx(
|
|
563
|
+
render: (a) => {
|
|
564
|
+
const m = { 0: "待办", 1: "进行中", 2: "已完成" }, ge = { 0: "default", 1: "blue", 2: "green" }[a] || "default";
|
|
565
|
+
return /* @__PURE__ */ e.jsx(v, { color: ge, children: m[a] || a });
|
|
831
566
|
}
|
|
832
567
|
},
|
|
833
568
|
{ title: "优先级", dataIndex: "priority", width: 80 },
|
|
@@ -836,35 +571,35 @@ function oe({ apiBaseURL: t, back: l }) {
|
|
|
836
571
|
title: "操作",
|
|
837
572
|
width: 200,
|
|
838
573
|
fixed: "right",
|
|
839
|
-
render: (
|
|
574
|
+
render: (a, m) => /* @__PURE__ */ e.jsxs(w, { children: [
|
|
840
575
|
/* @__PURE__ */ e.jsx(
|
|
841
|
-
|
|
576
|
+
T,
|
|
842
577
|
{
|
|
843
578
|
size: "small",
|
|
844
|
-
icon: /* @__PURE__ */ e.jsx(
|
|
579
|
+
icon: /* @__PURE__ */ e.jsx(ve, {}),
|
|
845
580
|
onClick: () => {
|
|
846
|
-
|
|
581
|
+
V(m), p(!0);
|
|
847
582
|
},
|
|
848
583
|
children: "查看"
|
|
849
584
|
}
|
|
850
585
|
),
|
|
851
586
|
/* @__PURE__ */ e.jsx(
|
|
852
|
-
|
|
587
|
+
T,
|
|
853
588
|
{
|
|
854
589
|
size: "small",
|
|
855
590
|
type: "primary",
|
|
856
|
-
icon: /* @__PURE__ */ e.jsx(
|
|
857
|
-
onClick: () =>
|
|
858
|
-
disabled:
|
|
591
|
+
icon: /* @__PURE__ */ e.jsx(te, {}),
|
|
592
|
+
onClick: () => x(m.id),
|
|
593
|
+
disabled: m.status === 2,
|
|
859
594
|
children: "完成"
|
|
860
595
|
}
|
|
861
596
|
)
|
|
862
597
|
] })
|
|
863
598
|
}
|
|
864
|
-
],
|
|
599
|
+
], fe = !j && !D && d.length === 0 && n;
|
|
865
600
|
return /* @__PURE__ */ e.jsxs("div", { children: [
|
|
866
601
|
/* @__PURE__ */ e.jsx(
|
|
867
|
-
|
|
602
|
+
ze,
|
|
868
603
|
{
|
|
869
604
|
title: "任务管理",
|
|
870
605
|
subtitle: "按项目维度组织任务, 支持新建、完成等操作",
|
|
@@ -873,248 +608,248 @@ function oe({ apiBaseURL: t, back: l }) {
|
|
|
873
608
|
}
|
|
874
609
|
),
|
|
875
610
|
/* @__PURE__ */ e.jsx(
|
|
876
|
-
|
|
611
|
+
Oe,
|
|
877
612
|
{
|
|
878
613
|
left: /* @__PURE__ */ e.jsx(
|
|
879
|
-
|
|
614
|
+
M,
|
|
880
615
|
{
|
|
881
|
-
value:
|
|
616
|
+
value: n,
|
|
882
617
|
onChange: r,
|
|
883
618
|
style: { width: 240 },
|
|
884
619
|
placeholder: "选择项目",
|
|
885
|
-
options:
|
|
620
|
+
options: o.map((a) => ({ label: a.name, value: a.id }))
|
|
886
621
|
}
|
|
887
622
|
),
|
|
888
|
-
right: /* @__PURE__ */ e.jsx(
|
|
623
|
+
right: /* @__PURE__ */ e.jsx(T, { type: "primary", icon: /* @__PURE__ */ e.jsx(pe, {}), onClick: K, children: "新建任务" })
|
|
889
624
|
}
|
|
890
625
|
),
|
|
891
|
-
|
|
892
|
-
|
|
626
|
+
z && /* @__PURE__ */ e.jsx("div", { style: { marginBottom: 16 }, children: /* @__PURE__ */ e.jsx(
|
|
627
|
+
le,
|
|
893
628
|
{
|
|
894
|
-
error:
|
|
895
|
-
onRetry:
|
|
629
|
+
error: z,
|
|
630
|
+
onRetry: H,
|
|
896
631
|
title: "加载项目列表失败"
|
|
897
632
|
}
|
|
898
633
|
) }),
|
|
899
|
-
|
|
634
|
+
D && /* @__PURE__ */ e.jsx("div", { style: { marginBottom: 16 }, children: /* @__PURE__ */ e.jsx(le, { error: D, onRetry: () => B(n) }) }),
|
|
900
635
|
/* @__PURE__ */ e.jsx("div", { style: {
|
|
901
636
|
background: "#ffffff",
|
|
902
637
|
borderRadius: 16,
|
|
903
638
|
padding: 20,
|
|
904
639
|
boxShadow: "0 1px 3px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.06)"
|
|
905
|
-
}, children:
|
|
906
|
-
|
|
640
|
+
}, children: fe ? /* @__PURE__ */ e.jsx(
|
|
641
|
+
Le,
|
|
907
642
|
{
|
|
908
643
|
title: "该项目下还没有任务",
|
|
909
644
|
description: "把目标拆解成可执行的任务, 一项项推进",
|
|
910
645
|
actionText: "新建第一个任务",
|
|
911
|
-
onAction:
|
|
646
|
+
onAction: K
|
|
912
647
|
}
|
|
913
648
|
) : /* @__PURE__ */ e.jsx(
|
|
914
|
-
|
|
649
|
+
Z,
|
|
915
650
|
{
|
|
916
651
|
rowKey: "id",
|
|
917
|
-
columns:
|
|
918
|
-
dataSource:
|
|
919
|
-
loading:
|
|
652
|
+
columns: W,
|
|
653
|
+
dataSource: d,
|
|
654
|
+
loading: j,
|
|
920
655
|
pagination: { pageSize: 10 }
|
|
921
656
|
}
|
|
922
657
|
) }),
|
|
923
658
|
/* @__PURE__ */ e.jsx(
|
|
924
|
-
|
|
659
|
+
he,
|
|
925
660
|
{
|
|
926
661
|
title: "新建任务",
|
|
927
|
-
open:
|
|
928
|
-
onCancel: () =>
|
|
929
|
-
onOk:
|
|
662
|
+
open: F,
|
|
663
|
+
onCancel: () => O(!1),
|
|
664
|
+
onOk: t,
|
|
930
665
|
destroyOnHidden: !0,
|
|
931
|
-
children: /* @__PURE__ */ e.jsxs(
|
|
932
|
-
/* @__PURE__ */ e.jsx(
|
|
933
|
-
/* @__PURE__ */ e.jsx(
|
|
934
|
-
|
|
666
|
+
children: /* @__PURE__ */ e.jsxs(f, { form: $, layout: "vertical", preserve: !1, children: [
|
|
667
|
+
/* @__PURE__ */ e.jsx(f.Item, { name: "title", label: "任务标题", rules: [{ required: !0, message: "请输入任务标题" }], children: /* @__PURE__ */ e.jsx(A, { placeholder: "例如: 实现 xx 功能" }) }),
|
|
668
|
+
/* @__PURE__ */ e.jsx(f.Item, { name: "projectId", label: "所属项目", rules: [{ required: !0 }], children: /* @__PURE__ */ e.jsx(
|
|
669
|
+
M,
|
|
935
670
|
{
|
|
936
|
-
options:
|
|
671
|
+
options: o.map((a) => ({ label: a.name, value: a.id })),
|
|
937
672
|
placeholder: "从数据库捞出的项目列表"
|
|
938
673
|
}
|
|
939
674
|
) }),
|
|
940
|
-
/* @__PURE__ */ e.jsx(
|
|
941
|
-
/* @__PURE__ */ e.jsx(
|
|
675
|
+
/* @__PURE__ */ e.jsx(f.Item, { name: "listId", label: "列表ID", rules: [{ required: !0 }], children: /* @__PURE__ */ e.jsx(A, { type: "number", placeholder: "默认 1" }) }),
|
|
676
|
+
/* @__PURE__ */ e.jsx(f.Item, { name: "priority", label: "优先级", initialValue: 1, children: /* @__PURE__ */ e.jsx(M, { options: [{ label: "低", value: 1 }, { label: "中", value: 2 }, { label: "高", value: 3 }] }) })
|
|
942
677
|
] })
|
|
943
678
|
}
|
|
944
679
|
),
|
|
945
680
|
/* @__PURE__ */ e.jsx(
|
|
946
|
-
|
|
681
|
+
_e,
|
|
947
682
|
{
|
|
948
|
-
taskId:
|
|
949
|
-
open:
|
|
683
|
+
taskId: _ == null ? void 0 : _.id,
|
|
684
|
+
open: c,
|
|
950
685
|
onClose: () => {
|
|
951
|
-
|
|
686
|
+
p(!1), V(null);
|
|
952
687
|
},
|
|
953
|
-
onChanged:
|
|
954
|
-
onEdit: (
|
|
955
|
-
|
|
688
|
+
onChanged: B,
|
|
689
|
+
onEdit: (a) => {
|
|
690
|
+
V(a), p(!1), R(!0);
|
|
956
691
|
}
|
|
957
692
|
}
|
|
958
693
|
),
|
|
959
694
|
/* @__PURE__ */ e.jsx(
|
|
960
|
-
|
|
695
|
+
Ve,
|
|
961
696
|
{
|
|
962
|
-
open:
|
|
963
|
-
task:
|
|
964
|
-
projects:
|
|
697
|
+
open: P,
|
|
698
|
+
task: _,
|
|
699
|
+
projects: o,
|
|
965
700
|
onClose: () => {
|
|
966
|
-
|
|
701
|
+
R(!1), V(null);
|
|
967
702
|
},
|
|
968
|
-
onSaved:
|
|
703
|
+
onSaved: B
|
|
969
704
|
}
|
|
970
705
|
)
|
|
971
706
|
] });
|
|
972
707
|
}
|
|
973
|
-
const { Text: ce, Title:
|
|
974
|
-
0: { text: "待办", color: "default", icon: /* @__PURE__ */ e.jsx(
|
|
975
|
-
1: { text: "进行中", color: "blue", icon: /* @__PURE__ */ e.jsx(
|
|
976
|
-
2: { text: "已完成", color: "green", icon: /* @__PURE__ */ e.jsx(
|
|
708
|
+
const { Text: ce, Title: Xe } = je, oe = {
|
|
709
|
+
0: { text: "待办", color: "default", icon: /* @__PURE__ */ e.jsx(me, {}) },
|
|
710
|
+
1: { text: "进行中", color: "blue", icon: /* @__PURE__ */ e.jsx(ye, {}) },
|
|
711
|
+
2: { text: "已完成", color: "green", icon: /* @__PURE__ */ e.jsx(Y, {}) }
|
|
977
712
|
};
|
|
978
|
-
function
|
|
979
|
-
const [l,
|
|
980
|
-
|
|
713
|
+
function $e({ apiBaseURL: s }) {
|
|
714
|
+
const [l, o] = h([]), [i, n] = h(null), [r, d] = h([]), [y, j] = h(!1), [u, D] = h(!1), S = async () => {
|
|
715
|
+
D(!0);
|
|
981
716
|
try {
|
|
982
|
-
const
|
|
983
|
-
|
|
717
|
+
const c = await I.listMyProjects(), p = (c == null ? void 0 : c.data) || c || [];
|
|
718
|
+
o(p), p.length > 0 && !i && n(p[0].id);
|
|
984
719
|
} catch {
|
|
985
|
-
|
|
720
|
+
o([]);
|
|
986
721
|
} finally {
|
|
987
|
-
|
|
722
|
+
D(!1);
|
|
988
723
|
}
|
|
989
|
-
},
|
|
990
|
-
if (!
|
|
991
|
-
|
|
724
|
+
}, z = async (c) => {
|
|
725
|
+
if (!c) {
|
|
726
|
+
d([]);
|
|
992
727
|
return;
|
|
993
728
|
}
|
|
994
|
-
|
|
729
|
+
j(!0);
|
|
995
730
|
try {
|
|
996
|
-
const
|
|
997
|
-
|
|
731
|
+
const p = await I.listTasksByProject(c);
|
|
732
|
+
d((p == null ? void 0 : p.data) || p || []);
|
|
998
733
|
} catch {
|
|
999
|
-
|
|
734
|
+
d([]);
|
|
1000
735
|
} finally {
|
|
1001
|
-
|
|
736
|
+
j(!1);
|
|
1002
737
|
}
|
|
1003
738
|
};
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
}, []),
|
|
1007
|
-
|
|
1008
|
-
}, [
|
|
1009
|
-
const g = r.reduce((
|
|
1010
|
-
|
|
1011
|
-
const
|
|
1012
|
-
return
|
|
1013
|
-
}, { total: 0, todo: 0, doing: 0, done: 0 }),
|
|
1014
|
-
priority:
|
|
1015
|
-
list: r.filter((
|
|
739
|
+
E(() => {
|
|
740
|
+
S();
|
|
741
|
+
}, []), E(() => {
|
|
742
|
+
z(i);
|
|
743
|
+
}, [i]);
|
|
744
|
+
const g = r.reduce((c, p) => {
|
|
745
|
+
c.total += 1;
|
|
746
|
+
const P = p.status ?? 0;
|
|
747
|
+
return P === 0 ? c.todo += 1 : P === 1 ? c.doing += 1 : P === 2 && (c.done += 1), c;
|
|
748
|
+
}, { total: 0, todo: 0, doing: 0, done: 0 }), F = g.total > 0 ? Math.round(g.done / g.total * 100) : 0, O = [1, 2, 3].map((c) => ({
|
|
749
|
+
priority: c,
|
|
750
|
+
list: r.filter((p) => (p.priority ?? 1) === c)
|
|
1016
751
|
}));
|
|
1017
752
|
return /* @__PURE__ */ e.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 16 }, children: [
|
|
1018
|
-
/* @__PURE__ */ e.jsx(
|
|
1019
|
-
/* @__PURE__ */ e.jsx(
|
|
753
|
+
/* @__PURE__ */ e.jsx(C, { children: /* @__PURE__ */ e.jsxs(w, { wrap: !0, children: [
|
|
754
|
+
/* @__PURE__ */ e.jsx(we, { style: { fontSize: 18, color: "#1677ff" } }),
|
|
1020
755
|
/* @__PURE__ */ e.jsx(ce, { strong: !0, children: "选择项目:" }),
|
|
1021
756
|
/* @__PURE__ */ e.jsx(
|
|
1022
|
-
|
|
757
|
+
M,
|
|
1023
758
|
{
|
|
1024
|
-
value:
|
|
1025
|
-
onChange:
|
|
759
|
+
value: i,
|
|
760
|
+
onChange: n,
|
|
1026
761
|
style: { width: 280 },
|
|
1027
|
-
loading:
|
|
762
|
+
loading: u,
|
|
1028
763
|
placeholder: "选择项目",
|
|
1029
|
-
options: l.map((
|
|
764
|
+
options: l.map((c) => ({ label: c.name, value: c.id }))
|
|
1030
765
|
}
|
|
1031
766
|
),
|
|
1032
|
-
/* @__PURE__ */ e.jsxs("a", { onClick: () =>
|
|
1033
|
-
/* @__PURE__ */ e.jsx(
|
|
767
|
+
/* @__PURE__ */ e.jsxs("a", { onClick: () => S(), children: [
|
|
768
|
+
/* @__PURE__ */ e.jsx(Pe, {}),
|
|
1034
769
|
" 刷新项目"
|
|
1035
770
|
] })
|
|
1036
771
|
] }) }),
|
|
1037
|
-
/* @__PURE__ */ e.jsxs(
|
|
1038
|
-
/* @__PURE__ */ e.jsxs(
|
|
1039
|
-
/* @__PURE__ */ e.jsx(
|
|
1040
|
-
/* @__PURE__ */ e.jsx(
|
|
772
|
+
/* @__PURE__ */ e.jsxs(de, { spinning: y, children: [
|
|
773
|
+
/* @__PURE__ */ e.jsxs(se, { gutter: 16, children: [
|
|
774
|
+
/* @__PURE__ */ e.jsx(U, { span: 6, children: /* @__PURE__ */ e.jsx(C, { children: /* @__PURE__ */ e.jsx(G, { title: "总任务数", value: g.total }) }) }),
|
|
775
|
+
/* @__PURE__ */ e.jsx(U, { span: 6, children: /* @__PURE__ */ e.jsx(C, { children: /* @__PURE__ */ e.jsx(
|
|
1041
776
|
G,
|
|
1042
777
|
{
|
|
1043
778
|
title: "待办",
|
|
1044
779
|
value: g.todo,
|
|
1045
780
|
styles: { content: { color: "#8c8c8c" } },
|
|
1046
|
-
prefix: /* @__PURE__ */ e.jsx(
|
|
781
|
+
prefix: /* @__PURE__ */ e.jsx(me, {})
|
|
1047
782
|
}
|
|
1048
783
|
) }) }),
|
|
1049
|
-
/* @__PURE__ */ e.jsx(
|
|
784
|
+
/* @__PURE__ */ e.jsx(U, { span: 6, children: /* @__PURE__ */ e.jsx(C, { children: /* @__PURE__ */ e.jsx(
|
|
1050
785
|
G,
|
|
1051
786
|
{
|
|
1052
787
|
title: "进行中",
|
|
1053
788
|
value: g.doing,
|
|
1054
789
|
styles: { content: { color: "#1677ff" } },
|
|
1055
|
-
prefix: /* @__PURE__ */ e.jsx(
|
|
790
|
+
prefix: /* @__PURE__ */ e.jsx(ye, {})
|
|
1056
791
|
}
|
|
1057
792
|
) }) }),
|
|
1058
|
-
/* @__PURE__ */ e.jsx(
|
|
793
|
+
/* @__PURE__ */ e.jsx(U, { span: 6, children: /* @__PURE__ */ e.jsx(C, { children: /* @__PURE__ */ e.jsx(
|
|
1059
794
|
G,
|
|
1060
795
|
{
|
|
1061
796
|
title: "已完成",
|
|
1062
797
|
value: g.done,
|
|
1063
798
|
styles: { content: { color: "#52c41a" } },
|
|
1064
|
-
prefix: /* @__PURE__ */ e.jsx(
|
|
799
|
+
prefix: /* @__PURE__ */ e.jsx(Y, {})
|
|
1065
800
|
}
|
|
1066
801
|
) }) })
|
|
1067
802
|
] }),
|
|
1068
|
-
/* @__PURE__ */ e.jsx(
|
|
1069
|
-
/* @__PURE__ */ e.jsx(
|
|
1070
|
-
/* @__PURE__ */ e.jsx(
|
|
803
|
+
/* @__PURE__ */ e.jsx(C, { style: { marginTop: 16 }, title: "完成率", children: /* @__PURE__ */ e.jsx(Ie, { percent: F, status: F === 100 ? "success" : "active" }) }),
|
|
804
|
+
/* @__PURE__ */ e.jsx(se, { gutter: 16, style: { marginTop: 16 }, children: O.map(({ priority: c, list: p }) => /* @__PURE__ */ e.jsx(U, { span: 8, children: /* @__PURE__ */ e.jsx(C, { size: "small", title: /* @__PURE__ */ e.jsxs(w, { children: [
|
|
805
|
+
/* @__PURE__ */ e.jsx(v, { color: c === 3 ? "red" : c === 2 ? "orange" : "default", children: c === 3 ? "高" : c === 2 ? "中" : "低" }),
|
|
1071
806
|
/* @__PURE__ */ e.jsxs("span", { children: [
|
|
1072
807
|
"优先级 (",
|
|
1073
|
-
|
|
808
|
+
p.length,
|
|
1074
809
|
")"
|
|
1075
810
|
] })
|
|
1076
|
-
] }), children:
|
|
1077
|
-
|
|
811
|
+
] }), children: p.length === 0 ? /* @__PURE__ */ e.jsx(X, { image: X.PRESENTED_IMAGE_SIMPLE, description: "无任务" }) : /* @__PURE__ */ e.jsx(
|
|
812
|
+
N,
|
|
1078
813
|
{
|
|
1079
814
|
size: "small",
|
|
1080
|
-
dataSource:
|
|
1081
|
-
renderItem: (
|
|
1082
|
-
const
|
|
1083
|
-
return /* @__PURE__ */ e.jsx(
|
|
1084
|
-
|
|
815
|
+
dataSource: p.slice(0, 8),
|
|
816
|
+
renderItem: (P) => {
|
|
817
|
+
const R = oe[P.status ?? 0] || oe[0];
|
|
818
|
+
return /* @__PURE__ */ e.jsx(N.Item, { children: /* @__PURE__ */ e.jsx(
|
|
819
|
+
N.Item.Meta,
|
|
1085
820
|
{
|
|
1086
|
-
avatar:
|
|
1087
|
-
title: /* @__PURE__ */ e.jsxs(
|
|
1088
|
-
/* @__PURE__ */ e.jsx(ce, { children:
|
|
1089
|
-
/* @__PURE__ */ e.jsx(
|
|
821
|
+
avatar: R.icon,
|
|
822
|
+
title: /* @__PURE__ */ e.jsxs(w, { children: [
|
|
823
|
+
/* @__PURE__ */ e.jsx(ce, { children: P.title }),
|
|
824
|
+
/* @__PURE__ */ e.jsx(v, { color: R.color, style: { margin: 0 }, children: R.text })
|
|
1090
825
|
] }),
|
|
1091
|
-
description:
|
|
826
|
+
description: P.dueDate ? `截止: ${P.dueDate}` : "无截止时间"
|
|
1092
827
|
}
|
|
1093
828
|
) });
|
|
1094
829
|
}
|
|
1095
830
|
}
|
|
1096
|
-
) }) },
|
|
831
|
+
) }) }, c)) })
|
|
1097
832
|
] })
|
|
1098
833
|
] });
|
|
1099
834
|
}
|
|
1100
|
-
function
|
|
1101
|
-
return /* @__PURE__ */ e.jsxs(
|
|
1102
|
-
/* @__PURE__ */ e.jsx(
|
|
1103
|
-
/* @__PURE__ */ e.jsx(
|
|
1104
|
-
/* @__PURE__ */ e.jsx(
|
|
1105
|
-
/* @__PURE__ */ e.jsx(
|
|
1106
|
-
/* @__PURE__ */ e.jsx(
|
|
1107
|
-
/* @__PURE__ */ e.jsx(
|
|
835
|
+
function Ze() {
|
|
836
|
+
return /* @__PURE__ */ e.jsxs(Ce, { children: [
|
|
837
|
+
/* @__PURE__ */ e.jsx(q, { index: !0, element: /* @__PURE__ */ e.jsx(Me, { to: "dashboard", replace: !0 }) }),
|
|
838
|
+
/* @__PURE__ */ e.jsx(q, { path: "dashboard", element: /* @__PURE__ */ e.jsx($e, {}) }),
|
|
839
|
+
/* @__PURE__ */ e.jsx(q, { path: "project", element: /* @__PURE__ */ e.jsx(re, {}) }),
|
|
840
|
+
/* @__PURE__ */ e.jsx(q, { path: "project/*", element: /* @__PURE__ */ e.jsx(re, {}) }),
|
|
841
|
+
/* @__PURE__ */ e.jsx(q, { path: "task", element: /* @__PURE__ */ e.jsx(ne, {}) }),
|
|
842
|
+
/* @__PURE__ */ e.jsx(q, { path: "task/*", element: /* @__PURE__ */ e.jsx(ne, {}) })
|
|
1108
843
|
] });
|
|
1109
844
|
}
|
|
1110
845
|
export {
|
|
1111
846
|
re as ProjectList,
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
847
|
+
Qe as ProjectSelect,
|
|
848
|
+
Ze as TaskApp,
|
|
849
|
+
Ye as TaskCard,
|
|
850
|
+
$e as TaskDashboard,
|
|
851
|
+
ne as TaskList,
|
|
852
|
+
Je as TaskTable,
|
|
853
|
+
I as api,
|
|
854
|
+
I as taskApi
|
|
1120
855
|
};
|