@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.
Files changed (2) hide show
  1. package/dist/index.js +390 -655
  2. 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 B, Space as T, Tag as z, Button as b, Table as ee, Select as R, Form as y, Empty as Z, Spin as xe, Descriptions as w, List as q, Drawer as ue, Input as F, message as I, Popconfirm as je, Breadcrumb as Te, Typography as he, Modal as pe, DatePicker as we, Row as le, Col as H, Statistic as G, Progress as ze } from "antd";
3
- import { CheckCircleOutlined as J, EditOutlined as Q, DeleteOutlined as te, PlusOutlined as me, InboxOutlined as fe, CheckOutlined as se, UnorderedListOutlined as Pe, ExclamationCircleOutlined as Se, ReloadOutlined as ye, EyeOutlined as De, ProjectOutlined as Ce, ClockCircleOutlined as ge, RocketOutlined as be } from "@ant-design/icons";
4
- import { useState as p, useEffect as W } from "react";
5
- import { createRequest as Oe, authRequest as Be } from "@yuku123/z-frontend-common";
6
- import { useNavigate as Re, Routes as Me, Route as V, Navigate as Ae } from "react-router-dom";
7
- const Le = {
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
- }, Fe = {
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 Ze({ task: t, onEdit: l, onComplete: i }) {
17
- const n = Le[t.priority] || { color: "default", text: t.priority }, c = Fe[t.status] || { color: "default", text: t.status };
18
- return /* @__PURE__ */ e.jsx(B, { size: "small", title: t.title, extra: /* @__PURE__ */ e.jsxs(T, { children: [
19
- t.status !== "completed" && /* @__PURE__ */ e.jsx(b, { size: "small", icon: /* @__PURE__ */ e.jsx(J, {}), onClick: () => i == null ? void 0 : i(t), children: "完成" }),
20
- /* @__PURE__ */ e.jsx(b, { size: "small", icon: /* @__PURE__ */ e.jsx(Q, {}), onClick: () => l == null ? void 0 : l(t), children: "编辑" })
21
- ] }), children: /* @__PURE__ */ e.jsxs(T, { orientation: "vertical", style: { width: "100%" }, children: [
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
- t.projectName
25
+ s.projectName
25
26
  ] }),
26
- /* @__PURE__ */ e.jsxs(T, { children: [
27
- /* @__PURE__ */ e.jsx(z, { color: n.color, children: n.text }),
28
- /* @__PURE__ */ e.jsx(z, { color: c.color, children: c.text })
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
- t.dueDate && /* @__PURE__ */ e.jsxs("div", { children: [
31
+ s.dueDate && /* @__PURE__ */ e.jsxs("div", { children: [
31
32
  "截止:",
32
- t.dueDate
33
+ s.dueDate
33
34
  ] })
34
35
  ] }) });
35
36
  }
36
- const We = { high: "red", medium: "orange", low: "green" }, $e = {
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 et({ dataSource: t, loading: l, onEdit: i, onDelete: n, onComplete: c }) {
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: (u) => /* @__PURE__ */ e.jsx(z, { color: We[u], children: u === "high" ? "高" : u === "medium" ? "中" : "低" })
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: (u) => {
56
- const o = { pending: "待处理", in_progress: "进行中", completed: "已完成" };
57
- return /* @__PURE__ */ e.jsx(z, { color: $e[u], children: o[u] || u });
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: (u, o) => /* @__PURE__ */ e.jsxs(T, { children: [
65
- o.status !== "completed" && /* @__PURE__ */ e.jsx(b, { size: "small", icon: /* @__PURE__ */ e.jsx(J, {}), onClick: () => c == null ? void 0 : c(o), children: "完成" }),
66
- /* @__PURE__ */ e.jsx(b, { size: "small", icon: /* @__PURE__ */ e.jsx(Q, {}), onClick: () => i == null ? void 0 : i(o), children: "编辑" }),
67
- /* @__PURE__ */ e.jsx(b, { size: "small", danger: !0, icon: /* @__PURE__ */ e.jsx(te, {}), onClick: () => n == null ? void 0 : n(o), children: "删除" })
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
- ee,
73
+ Z,
73
74
  {
74
75
  columns: r,
75
- dataSource: t,
76
+ dataSource: s,
76
77
  loading: l,
77
78
  rowKey: "id",
78
79
  pagination: { pageSize: 10 }
79
80
  }
80
81
  );
81
82
  }
82
- function tt({ value: t, onChange: l, projects: i = [] }) {
83
+ function Qe({ value: s, onChange: l, projects: o = [] }) {
83
84
  return /* @__PURE__ */ e.jsx(
84
- R,
85
+ M,
85
86
  {
86
- value: t,
87
+ value: s,
87
88
  onChange: l,
88
89
  placeholder: "请选择项目",
89
90
  style: { width: 200 },
90
91
  allowClear: !0,
91
- children: i.map((n) => /* @__PURE__ */ e.jsx(R.Option, { value: n.id, children: n.name }, n.id))
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 O = Oe("task"), v = {
96
+ const L = De("task"), I = {
96
97
  // === 项目 ===
97
- listMyProjects: () => Be.get("/project/user/list"),
98
- createProject: (t) => O.post("/project", t),
99
- updateProject: (t, l) => O.put(`/project/${t}`, l),
100
- archiveProject: (t) => O.put(`/project/${t}/archive`),
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: (t) => O.get("/task/project/list", { params: { projectId: t } }),
103
- listTasksByList: (t) => O.get("/task/list", { params: { listId: t } }),
104
- createTask: (t) => O.post("/task", t),
105
- completeTask: (t) => O.post("/task/complete", null, { params: { taskId: t } }),
106
- moveTask: (t, l, i) => O.put("/task/move", null, { params: { taskId: t, targetListId: l, position: i } }),
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: (t) => O.get(`/task/${t}`),
109
- updateTask: (t, l) => O.put(`/task/${t}`, l),
110
- deleteTask: (t) => O.delete(`/task/${t}`)
111
- }, X = (t) => {
112
- if (!t) return "-";
113
- const l = String(t), i = l.match(/^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2})/);
114
- return i ? i[1] : l;
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: t }) {
117
- const [l, i] = p([]), [n, c] = p(!1), [r, u] = p(!1), [o, a] = p(null), [d, k] = p(null), [P, S] = p([]), [g, L] = p(!1), [C] = y.useForm(), j = async () => {
118
- c(!0);
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 s = await v.listMyProjects();
121
- i((s == null ? void 0 : s.data) || s || []);
122
- } catch (s) {
123
- I.error("加载项目失败: " + ((s == null ? void 0 : s.message) || s));
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
- c(!1);
126
+ n(!1);
126
127
  }
127
128
  };
128
- W(() => {
129
- j();
129
+ E(() => {
130
+ c();
130
131
  }, []);
131
- const m = async (s) => {
132
- k(s), L(!0);
132
+ const p = async (t) => {
133
+ D(t), F(!0);
133
134
  try {
134
- const h = await v.listTasksByProject(s.id);
135
- S((h == null ? void 0 : h.data) || h || []);
136
- } catch (h) {
137
- I.error("加载任务失败: " + ((h == null ? void 0 : h.message) || h));
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
- L(!1);
140
+ F(!1);
140
141
  }
141
- }, D = async () => {
142
- if (d)
142
+ }, P = async () => {
143
+ if (u)
143
144
  try {
144
- const s = await v.listTasksByProject(d.id);
145
- S((s == null ? void 0 : s.data) || s || []);
146
- } catch (s) {
147
- I.error("刷新任务失败: " + ((s == null ? void 0 : s.message) || s));
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
- }, M = () => {
150
- a(null), C.resetFields(), C.setFieldsValue({ status: 1 }), u(!0);
151
- }, $ = (s) => {
152
- a(s), C.setFieldsValue({ name: s.name, description: s.description, status: s.status ?? 1 }), u(!0);
153
- }, E = async () => {
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 s = await C.validateFields();
156
- o ? (await v.updateProject(o.id, s), I.success("项目已更新")) : (await v.createProject(s), I.success("项目已创建")), u(!1), j();
157
- } catch (s) {
158
- if (s != null && s.errorFields) return;
159
- I.error("保存失败: " + ((s == null ? void 0 : s.message) || s));
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
- }, _ = async (s) => {
162
+ }, $ = async (t) => {
162
163
  try {
163
- await v.archiveProject(s), I.success("项目已归档"), j(), (d == null ? void 0 : d.id) === s && (k(null), S([]));
164
- } catch (h) {
165
- I.error("归档失败: " + ((h == null ? void 0 : h.message) || h));
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
- }, N = async (s) => {
168
+ }, H = async (t) => {
168
169
  try {
169
- await v.completeTask(s), I.success("任务已完成"), D();
170
- } catch (h) {
171
- I.error("操作失败: " + ((h == null ? void 0 : h.message) || h));
170
+ await I.completeTask(t), b.success("任务已完成"), P();
171
+ } catch (x) {
172
+ b.error("操作失败: " + ((x == null ? void 0 : x.message) || x));
172
173
  }
173
- }, A = [
174
+ }, B = [
174
175
  {
175
176
  title: "项目名称",
176
177
  dataIndex: "name",
177
- render: (s, h) => /* @__PURE__ */ e.jsx(
178
+ render: (t, x) => /* @__PURE__ */ e.jsx(
178
179
  "a",
179
180
  {
180
- onClick: () => m(h),
181
- style: { fontWeight: (d == null ? void 0 : d.id) === h.id ? 600 : 400 },
182
- children: s
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: (s) => s === 1 ? /* @__PURE__ */ e.jsx(z, { color: "green", children: "进行中" }) : /* @__PURE__ */ e.jsx(z, { children: "已归档" })
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: X },
193
+ { title: "创建时间", dataIndex: "createdAt", width: 170, render: Q },
193
194
  {
194
195
  title: "操作",
195
196
  width: 160,
196
197
  fixed: "right",
197
- render: (s, h) => /* @__PURE__ */ e.jsxs(T, { children: [
198
- /* @__PURE__ */ e.jsx(b, { size: "small", icon: /* @__PURE__ */ e.jsx(Q, {}), onClick: () => $(h), children: "编辑" }),
199
- /* @__PURE__ */ e.jsx(je, { title: "确定归档该项目?", onConfirm: () => _(h.id), children: /* @__PURE__ */ e.jsx(b, { size: "small", danger: !0, icon: /* @__PURE__ */ e.jsx(te, {}), children: "归档" }) })
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
- ], U = (s) => {
203
- const K = {
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
- }[s] || { text: String(s), color: "default" };
208
- return /* @__PURE__ */ e.jsx(z, { color: K.color, children: K.text });
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(b, { type: "primary", icon: /* @__PURE__ */ e.jsx(me, {}), onClick: M, children: "新建项目" }) }),
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
- B,
215
+ C,
215
216
  {
216
217
  size: "small",
217
- title: /* @__PURE__ */ e.jsxs(T, { children: [
218
- /* @__PURE__ */ e.jsx(fe, {}),
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
- ee,
225
+ Z,
225
226
  {
226
227
  rowKey: "id",
227
- columns: A,
228
+ columns: B,
228
229
  dataSource: l,
229
- loading: n,
230
+ loading: i,
230
231
  pagination: { pageSize: 10, size: "small" },
231
232
  size: "small",
232
- rowClassName: (s) => (d == null ? void 0 : d.id) === s.id ? "ant-table-row-selected" : "",
233
- onRow: (s) => ({ onClick: () => m(s), style: { cursor: "pointer" } }),
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
- B,
241
+ C,
241
242
  {
242
243
  size: "small",
243
244
  style: { flex: 1, overflow: "auto" },
244
245
  styles: { body: { padding: 16 } },
245
- title: d ? /* @__PURE__ */ e.jsxs(T, { children: [
246
- /* @__PURE__ */ e.jsx(Pe, {}),
247
- d.name,
246
+ title: u ? /* @__PURE__ */ e.jsxs(w, { children: [
247
+ /* @__PURE__ */ e.jsx(ke, {}),
248
+ u.name,
248
249
  " · 任务列表"
249
250
  ] }) : "项目详情",
250
- children: d ? /* @__PURE__ */ e.jsxs(xe, { spinning: g, children: [
251
- /* @__PURE__ */ e.jsxs(w, { size: "small", bordered: !0, column: 2, style: { marginBottom: 16 }, children: [
252
- /* @__PURE__ */ e.jsx(w.Item, { label: "项目名称", span: 2, children: d.name }),
253
- /* @__PURE__ */ e.jsx(w.Item, { label: "描述", span: 2, children: d.description || "无" }),
254
- /* @__PURE__ */ e.jsx(w.Item, { label: "负责人", children: d.ownerId || "未指定" }),
255
- /* @__PURE__ */ e.jsx(w.Item, { label: "状态", children: d.status === 1 ? /* @__PURE__ */ e.jsx(z, { color: "green", children: "进行中" }) : /* @__PURE__ */ e.jsx(z, { children: "已归档" }) }),
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
- w.Item,
258
+ k.Item,
258
259
  {
259
260
  label: "创建时间",
260
- children: X(d.createdAt)
261
+ children: Q(u.createdAt)
261
262
  }
262
263
  ),
263
- /* @__PURE__ */ e.jsx(w.Item, { label: "项目ID", children: d.id })
264
+ /* @__PURE__ */ e.jsx(k.Item, { label: "项目ID", children: u.id })
264
265
  ] }),
265
266
  /* @__PURE__ */ e.jsx(
266
- q,
267
+ N,
267
268
  {
268
269
  size: "small",
269
270
  header: /* @__PURE__ */ e.jsxs("b", { children: [
270
271
  "任务项 (",
271
- P.length,
272
+ S.length,
272
273
  ")"
273
274
  ] }),
274
275
  bordered: !0,
275
- dataSource: P,
276
+ dataSource: S,
276
277
  locale: { emptyText: "该项目下暂无任务" },
277
- renderItem: (s) => /* @__PURE__ */ e.jsx(
278
- q.Item,
278
+ renderItem: (t) => /* @__PURE__ */ e.jsx(
279
+ N.Item,
279
280
  {
280
281
  actions: [
281
282
  /* @__PURE__ */ e.jsx(
282
- b,
283
+ T,
283
284
  {
284
285
  size: "small",
285
286
  type: "primary",
286
- icon: /* @__PURE__ */ e.jsx(se, {}),
287
- disabled: s.status === 2,
288
- onClick: () => N(s.id),
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
- q.Item.Meta,
296
+ N.Item.Meta,
296
297
  {
297
- title: /* @__PURE__ */ e.jsxs(T, { children: [
298
- s.title,
299
- U(s.status),
300
- /* @__PURE__ */ e.jsxs(z, { children: [
298
+ title: /* @__PURE__ */ e.jsxs(w, { children: [
299
+ t.title,
300
+ K(t.status),
301
+ /* @__PURE__ */ e.jsxs(v, { children: [
301
302
  "优先级 ",
302
- s.priority ?? "-"
303
+ t.priority ?? "-"
303
304
  ] })
304
305
  ] }),
305
306
  description: /* @__PURE__ */ e.jsxs("span", { style: { color: "#888", fontSize: 12 }, children: [
306
307
  "截止: ",
307
- X(s.dueDate),
308
+ Q(t.dueDate),
308
309
  " · ID: ",
309
- s.id
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(Z, { description: "请从左侧选择一个项目", style: { marginTop: 80 } })
318
+ ] }) : /* @__PURE__ */ e.jsx(X, { description: "请从左侧选择一个项目", style: { marginTop: 80 } })
318
319
  }
319
320
  )
320
321
  ] }),
321
322
  /* @__PURE__ */ e.jsx(
322
- ue,
323
+ xe,
323
324
  {
324
- title: o ? `编辑项目 - ${o.name}` : "新建项目",
325
+ title: y ? `编辑项目 - ${y.name}` : "新建项目",
325
326
  size: "large",
326
327
  open: r,
327
- onClose: () => u(!1),
328
+ onClose: () => d(!1),
328
329
  destroyOnHidden: !0,
329
- extra: /* @__PURE__ */ e.jsxs(T, { children: [
330
- /* @__PURE__ */ e.jsx(b, { onClick: () => u(!1), children: "取消" }),
331
- /* @__PURE__ */ e.jsx(b, { type: "primary", onClick: E, children: "保存" })
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(y, { form: C, layout: "vertical", preserve: !1, children: [
334
- /* @__PURE__ */ e.jsx(y.Item, { name: "name", label: "项目名称", rules: [{ required: !0, message: "请输入项目名称" }], children: /* @__PURE__ */ e.jsx(F, { placeholder: "例如: 一人公司" }) }),
335
- /* @__PURE__ */ e.jsx(y.Item, { name: "description", label: "项目描述", children: /* @__PURE__ */ e.jsx(F.TextArea, { rows: 3, placeholder: "可选" }) }),
336
- /* @__PURE__ */ e.jsx(y.Item, { name: "status", label: "状态", initialValue: 1, children: /* @__PURE__ */ e.jsx(
337
- R,
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 Y = {
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
- }, ne = {
355
+ }, ie = {
621
356
  1: { label: "低", color: "default" },
622
357
  2: { label: "中", color: "orange" },
623
358
  3: { label: "高", color: "red" }
624
359
  };
625
- function He({ taskId: t, open: l, onClose: i, onChanged: n, onEdit: c }) {
626
- const [r, u] = p(null), [o, a] = p(!1);
627
- W(() => {
628
- !l || !t || (a(!0), v.getTaskDetail(t).then((g) => u((g == null ? void 0 : g.data) || g)).catch(() => u(null)).finally(() => a(!1)));
629
- }, [l, t]);
630
- const d = async () => {
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 v.completeTask(t), u((g) => ({ ...g, status: 2 })), n == null || n();
367
+ await I.completeTask(s), d((g) => ({ ...g, status: 2 })), i == null || i();
633
368
  } catch {
634
369
  }
635
- }, k = async () => {
370
+ }, D = async () => {
636
371
  try {
637
- await v.deleteTask(t), n == null || n(), i == null || i();
372
+ await I.deleteTask(s), i == null || i(), o == null || o();
638
373
  } catch {
639
374
  }
640
- }, P = ae[r == null ? void 0 : r.status] || ae[0], S = ne[r == null ? void 0 : r.priority] || ne[1];
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
- ue,
377
+ xe,
643
378
  {
644
379
  title: (r == null ? void 0 : r.title) || "任务详情",
645
380
  size: "large",
646
381
  open: l,
647
- onClose: i,
648
- loading: o,
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
- je,
386
+ ue,
652
387
  {
653
388
  title: "确认删除此任务?",
654
- onConfirm: k,
389
+ onConfirm: D,
655
390
  okText: "删除",
656
391
  cancelText: "取消",
657
392
  okButtonProps: { danger: !0 },
658
- children: /* @__PURE__ */ e.jsx(b, { danger: !0, icon: /* @__PURE__ */ e.jsx(te, {}), children: "删除" })
393
+ children: /* @__PURE__ */ e.jsx(T, { danger: !0, icon: /* @__PURE__ */ e.jsx(ee, {}), children: "删除" })
659
394
  }
660
395
  ),
661
- /* @__PURE__ */ e.jsxs(T, { children: [
662
- (r == null ? void 0 : r.status) !== 2 && /* @__PURE__ */ e.jsx(b, { type: "primary", icon: /* @__PURE__ */ e.jsx(se, {}), onClick: d, children: "完成任务" }),
663
- /* @__PURE__ */ e.jsx(b, { icon: /* @__PURE__ */ e.jsx(Q, {}), onClick: () => c == null ? void 0 : c(r), children: "编辑" })
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(w, { column: 2, bordered: !0, size: "small", style: { marginBottom: 24 }, children: [
668
- /* @__PURE__ */ e.jsx(w.Item, { label: "状态", children: /* @__PURE__ */ e.jsx(z, { color: P.color, children: P.label }) }),
669
- /* @__PURE__ */ e.jsx(w.Item, { label: "优先级", children: /* @__PURE__ */ e.jsx(z, { color: S.color, children: S.label }) }),
670
- /* @__PURE__ */ e.jsx(w.Item, { label: "项目 ID", children: r.projectId }),
671
- /* @__PURE__ */ e.jsx(w.Item, { label: "列表 ID", children: r.listId }),
672
- /* @__PURE__ */ e.jsx(w.Item, { label: "截止时间", span: 2, children: r.dueDate || "未设置" }),
673
- /* @__PURE__ */ e.jsx(w.Item, { label: "创建时间", children: r.createdAt || "-" }),
674
- /* @__PURE__ */ e.jsx(w.Item, { label: "更新时间", children: r.updatedAt || "-" })
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(qe, { style: { whiteSpace: "pre-wrap", color: "#595959" }, children: r.description })
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 Ne({ open: t, task: l, projects: i, onClose: n, onSaved: c }) {
685
- const [r] = y.useForm(), u = !!(l != null && l.id);
686
- W(() => {
687
- t && l ? r.setFieldsValue({
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
- }) : t && r.resetFields();
696
- }, [t, l, r]);
697
- const o = async () => {
430
+ }) : s && r.resetFields();
431
+ }, [s, l, r]);
432
+ const y = async () => {
698
433
  try {
699
- const a = await r.validateFields();
700
- u ? (await v.updateTask(l.id, a), I.success("任务已更新")) : (await v.createTask(a), I.success("任务已创建")), c == null || c(), n == null || n();
701
- } catch (a) {
702
- if (a != null && a.errorFields) return;
703
- I.error("保存失败: " + ((a == null ? void 0 : a.message) || a));
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
- pe,
442
+ he,
708
443
  {
709
- title: u ? "编辑任务" : "新建任务",
710
- open: t,
711
- onCancel: n,
712
- onOk: o,
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(y, { form: r, layout: "vertical", preserve: !1, children: [
450
+ children: /* @__PURE__ */ e.jsxs(f, { form: r, layout: "vertical", preserve: !1, children: [
716
451
  /* @__PURE__ */ e.jsx(
717
- y.Item,
452
+ f.Item,
718
453
  {
719
454
  name: "title",
720
455
  label: "任务标题",
721
456
  rules: [{ required: !0, message: "请输入任务标题" }],
722
- children: /* @__PURE__ */ e.jsx(F, { placeholder: "例如: 实现 xx 功能" })
457
+ children: /* @__PURE__ */ e.jsx(A, { placeholder: "例如: 实现 xx 功能" })
723
458
  }
724
459
  ),
725
- /* @__PURE__ */ e.jsx(y.Item, { name: "description", label: "描述", children: /* @__PURE__ */ e.jsx(F.TextArea, { rows: 3, placeholder: "任务描述 (可选)" }) }),
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
- y.Item,
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
- R,
470
+ M,
736
471
  {
737
- options: i.map((a) => ({ label: a.name, value: a.id })),
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(y.Item, { name: "listId", label: "列表 ID", style: { flex: 1 }, children: /* @__PURE__ */ e.jsx(F, { type: "number", placeholder: "默认 1" }) })
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(y.Item, { name: "status", label: "状态", initialValue: 0, style: { flex: 1 }, children: /* @__PURE__ */ e.jsx(
747
- R,
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(y.Item, { name: "priority", label: "优先级", initialValue: 1, style: { flex: 1 }, children: /* @__PURE__ */ e.jsx(
757
- R,
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(y.Item, { name: "dueDate", label: "截止时间", children: /* @__PURE__ */ e.jsx(we, { style: { width: "100%" }, placeholder: "选择截止日期" }) })
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 oe({ apiBaseURL: t, back: l }) {
773
- const [i, n] = p([]), [c, r] = p(null), [u, o] = p([]), [a, d] = p(!1), [k, P] = p(null), [S, g] = p(null), [L, C] = p(!1), [j, m] = p(!1), [D, M] = p(!1), [$, E] = p(null), [_] = y.useForm(), N = async () => {
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 x = await v.listMyProjects(), f = (x == null ? void 0 : x.data) || x || [];
776
- n(f), g(null), f.length > 0 && !c && r(f[0].id);
777
- } catch (x) {
778
- g((x == null ? void 0 : x.message) || "加载项目失败");
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
- }, A = async (x) => {
781
- if (!x) {
782
- o([]);
515
+ }, B = async (a) => {
516
+ if (!a) {
517
+ y([]);
783
518
  return;
784
519
  }
785
- d(!0), P(null);
520
+ u(!0), S(null);
786
521
  try {
787
- const f = await v.listTasksByProject(x);
788
- o((f == null ? void 0 : f.data) || f || []);
789
- } catch (f) {
790
- P((f == null ? void 0 : f.message) || "加载任务失败");
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
- d(!1);
527
+ u(!1);
793
528
  }
794
529
  };
795
- W(() => {
796
- N();
797
- }, []), W(() => {
798
- A(c);
799
- }, [c]);
800
- const U = () => {
801
- if (!c) {
802
- I.warning("请先选择项目");
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
- _.resetFields(), _.setFieldsValue({ projectId: c, listId: 1, status: 1, priority: 1 }), C(!0);
806
- }, s = async () => {
540
+ $.resetFields(), $.setFieldsValue({ projectId: n, listId: 1, status: 1, priority: 1 }), O(!0);
541
+ }, t = async () => {
807
542
  try {
808
- const x = await _.validateFields();
809
- await v.createTask(x), I.success("任务已创建"), C(!1), A(c);
810
- } catch (x) {
811
- if (x != null && x.errorFields) return;
812
- I.error("创建失败: " + ((x == null ? void 0 : x.message) || x));
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
- }, h = async (x) => {
549
+ }, x = async (a) => {
815
550
  try {
816
- await v.completeTask(x), I.success("任务已完成"), A(c);
817
- } catch (f) {
818
- I.error("操作失败: " + ((f == null ? void 0 : f.message) || f));
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
- }, K = [
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: (x) => {
829
- const f = { 0: "待办", 1: "进行中", 2: "已完成" }, ke = { 0: "default", 1: "blue", 2: "green" }[x] || "default";
830
- return /* @__PURE__ */ e.jsx(z, { color: ke, children: f[x] || x });
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: (x, f) => /* @__PURE__ */ e.jsxs(T, { children: [
574
+ render: (a, m) => /* @__PURE__ */ e.jsxs(w, { children: [
840
575
  /* @__PURE__ */ e.jsx(
841
- b,
576
+ T,
842
577
  {
843
578
  size: "small",
844
- icon: /* @__PURE__ */ e.jsx(De, {}),
579
+ icon: /* @__PURE__ */ e.jsx(ve, {}),
845
580
  onClick: () => {
846
- E(f), m(!0);
581
+ V(m), p(!0);
847
582
  },
848
583
  children: "查看"
849
584
  }
850
585
  ),
851
586
  /* @__PURE__ */ e.jsx(
852
- b,
587
+ T,
853
588
  {
854
589
  size: "small",
855
590
  type: "primary",
856
- icon: /* @__PURE__ */ e.jsx(se, {}),
857
- onClick: () => h(f.id),
858
- disabled: f.status === 2,
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
- ], ve = !a && !k && u.length === 0 && c;
599
+ ], fe = !j && !D && d.length === 0 && n;
865
600
  return /* @__PURE__ */ e.jsxs("div", { children: [
866
601
  /* @__PURE__ */ e.jsx(
867
- _e,
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
- Ve,
611
+ Oe,
877
612
  {
878
613
  left: /* @__PURE__ */ e.jsx(
879
- R,
614
+ M,
880
615
  {
881
- value: c,
616
+ value: n,
882
617
  onChange: r,
883
618
  style: { width: 240 },
884
619
  placeholder: "选择项目",
885
- options: i.map((x) => ({ label: x.name, value: x.id }))
620
+ options: o.map((a) => ({ label: a.name, value: a.id }))
886
621
  }
887
622
  ),
888
- right: /* @__PURE__ */ e.jsx(b, { type: "primary", icon: /* @__PURE__ */ e.jsx(me, {}), onClick: U, children: "新建任务" })
623
+ right: /* @__PURE__ */ e.jsx(T, { type: "primary", icon: /* @__PURE__ */ e.jsx(pe, {}), onClick: K, children: "新建任务" })
889
624
  }
890
625
  ),
891
- S && /* @__PURE__ */ e.jsx("div", { style: { marginBottom: 16 }, children: /* @__PURE__ */ e.jsx(
892
- ie,
626
+ z && /* @__PURE__ */ e.jsx("div", { style: { marginBottom: 16 }, children: /* @__PURE__ */ e.jsx(
627
+ le,
893
628
  {
894
- error: S,
895
- onRetry: N,
629
+ error: z,
630
+ onRetry: H,
896
631
  title: "加载项目列表失败"
897
632
  }
898
633
  ) }),
899
- k && /* @__PURE__ */ e.jsx("div", { style: { marginBottom: 16 }, children: /* @__PURE__ */ e.jsx(ie, { error: k, onRetry: () => A(c) }) }),
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: ve ? /* @__PURE__ */ e.jsx(
906
- Ee,
640
+ }, children: fe ? /* @__PURE__ */ e.jsx(
641
+ Le,
907
642
  {
908
643
  title: "该项目下还没有任务",
909
644
  description: "把目标拆解成可执行的任务, 一项项推进",
910
645
  actionText: "新建第一个任务",
911
- onAction: U
646
+ onAction: K
912
647
  }
913
648
  ) : /* @__PURE__ */ e.jsx(
914
- ee,
649
+ Z,
915
650
  {
916
651
  rowKey: "id",
917
- columns: K,
918
- dataSource: u,
919
- loading: a,
652
+ columns: W,
653
+ dataSource: d,
654
+ loading: j,
920
655
  pagination: { pageSize: 10 }
921
656
  }
922
657
  ) }),
923
658
  /* @__PURE__ */ e.jsx(
924
- pe,
659
+ he,
925
660
  {
926
661
  title: "新建任务",
927
- open: L,
928
- onCancel: () => C(!1),
929
- onOk: s,
662
+ open: F,
663
+ onCancel: () => O(!1),
664
+ onOk: t,
930
665
  destroyOnHidden: !0,
931
- children: /* @__PURE__ */ e.jsxs(y, { form: _, layout: "vertical", preserve: !1, children: [
932
- /* @__PURE__ */ e.jsx(y.Item, { name: "title", label: "任务标题", rules: [{ required: !0, message: "请输入任务标题" }], children: /* @__PURE__ */ e.jsx(F, { placeholder: "例如: 实现 xx 功能" }) }),
933
- /* @__PURE__ */ e.jsx(y.Item, { name: "projectId", label: "所属项目", rules: [{ required: !0 }], children: /* @__PURE__ */ e.jsx(
934
- R,
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: i.map((x) => ({ label: x.name, value: x.id })),
671
+ options: o.map((a) => ({ label: a.name, value: a.id })),
937
672
  placeholder: "从数据库捞出的项目列表"
938
673
  }
939
674
  ) }),
940
- /* @__PURE__ */ e.jsx(y.Item, { name: "listId", label: "列表ID", rules: [{ required: !0 }], children: /* @__PURE__ */ e.jsx(F, { type: "number", placeholder: "默认 1" }) }),
941
- /* @__PURE__ */ e.jsx(y.Item, { name: "priority", label: "优先级", initialValue: 1, children: /* @__PURE__ */ e.jsx(R, { options: [{ label: "低", value: 1 }, { label: "中", value: 2 }, { label: "高", value: 3 }] }) })
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
- He,
681
+ _e,
947
682
  {
948
- taskId: $ == null ? void 0 : $.id,
949
- open: j,
683
+ taskId: _ == null ? void 0 : _.id,
684
+ open: c,
950
685
  onClose: () => {
951
- m(!1), E(null);
686
+ p(!1), V(null);
952
687
  },
953
- onChanged: A,
954
- onEdit: (x) => {
955
- E(x), m(!1), M(!0);
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
- Ne,
695
+ Ve,
961
696
  {
962
- open: D,
963
- task: $,
964
- projects: i,
697
+ open: P,
698
+ task: _,
699
+ projects: o,
965
700
  onClose: () => {
966
- M(!1), E(null);
701
+ R(!1), V(null);
967
702
  },
968
- onSaved: A
703
+ onSaved: B
969
704
  }
970
705
  )
971
706
  ] });
972
707
  }
973
- const { Text: ce, Title: st } = he, de = {
974
- 0: { text: "待办", color: "default", icon: /* @__PURE__ */ e.jsx(ge, {}) },
975
- 1: { text: "进行中", color: "blue", icon: /* @__PURE__ */ e.jsx(be, {}) },
976
- 2: { text: "已完成", color: "green", icon: /* @__PURE__ */ e.jsx(J, {}) }
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 Ue({ apiBaseURL: t }) {
979
- const [l, i] = p([]), [n, c] = p(null), [r, u] = p([]), [o, a] = p(!1), [d, k] = p(!1), P = async () => {
980
- k(!0);
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 j = await v.listMyProjects(), m = (j == null ? void 0 : j.data) || j || [];
983
- i(m), m.length > 0 && !n && c(m[0].id);
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
- i([]);
720
+ o([]);
986
721
  } finally {
987
- k(!1);
722
+ D(!1);
988
723
  }
989
- }, S = async (j) => {
990
- if (!j) {
991
- u([]);
724
+ }, z = async (c) => {
725
+ if (!c) {
726
+ d([]);
992
727
  return;
993
728
  }
994
- a(!0);
729
+ j(!0);
995
730
  try {
996
- const m = await v.listTasksByProject(j);
997
- u((m == null ? void 0 : m.data) || m || []);
731
+ const p = await I.listTasksByProject(c);
732
+ d((p == null ? void 0 : p.data) || p || []);
998
733
  } catch {
999
- u([]);
734
+ d([]);
1000
735
  } finally {
1001
- a(!1);
736
+ j(!1);
1002
737
  }
1003
738
  };
1004
- W(() => {
1005
- P();
1006
- }, []), W(() => {
1007
- S(n);
1008
- }, [n]);
1009
- const g = r.reduce((j, m) => {
1010
- j.total += 1;
1011
- const D = m.status ?? 0;
1012
- return D === 0 ? j.todo += 1 : D === 1 ? j.doing += 1 : D === 2 && (j.done += 1), j;
1013
- }, { total: 0, todo: 0, doing: 0, done: 0 }), L = g.total > 0 ? Math.round(g.done / g.total * 100) : 0, C = [1, 2, 3].map((j) => ({
1014
- priority: j,
1015
- list: r.filter((m) => (m.priority ?? 1) === j)
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(B, { children: /* @__PURE__ */ e.jsxs(T, { wrap: !0, children: [
1019
- /* @__PURE__ */ e.jsx(Ce, { style: { fontSize: 18, color: "#1677ff" } }),
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
- R,
757
+ M,
1023
758
  {
1024
- value: n,
1025
- onChange: c,
759
+ value: i,
760
+ onChange: n,
1026
761
  style: { width: 280 },
1027
- loading: d,
762
+ loading: u,
1028
763
  placeholder: "选择项目",
1029
- options: l.map((j) => ({ label: j.name, value: j.id }))
764
+ options: l.map((c) => ({ label: c.name, value: c.id }))
1030
765
  }
1031
766
  ),
1032
- /* @__PURE__ */ e.jsxs("a", { onClick: () => P(), children: [
1033
- /* @__PURE__ */ e.jsx(ye, {}),
767
+ /* @__PURE__ */ e.jsxs("a", { onClick: () => S(), children: [
768
+ /* @__PURE__ */ e.jsx(Pe, {}),
1034
769
  " 刷新项目"
1035
770
  ] })
1036
771
  ] }) }),
1037
- /* @__PURE__ */ e.jsxs(xe, { spinning: o, children: [
1038
- /* @__PURE__ */ e.jsxs(le, { gutter: 16, children: [
1039
- /* @__PURE__ */ e.jsx(H, { span: 6, children: /* @__PURE__ */ e.jsx(B, { children: /* @__PURE__ */ e.jsx(G, { title: "总任务数", value: g.total }) }) }),
1040
- /* @__PURE__ */ e.jsx(H, { span: 6, children: /* @__PURE__ */ e.jsx(B, { children: /* @__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(ge, {})
781
+ prefix: /* @__PURE__ */ e.jsx(me, {})
1047
782
  }
1048
783
  ) }) }),
1049
- /* @__PURE__ */ e.jsx(H, { span: 6, children: /* @__PURE__ */ e.jsx(B, { children: /* @__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(be, {})
790
+ prefix: /* @__PURE__ */ e.jsx(ye, {})
1056
791
  }
1057
792
  ) }) }),
1058
- /* @__PURE__ */ e.jsx(H, { span: 6, children: /* @__PURE__ */ e.jsx(B, { children: /* @__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(J, {})
799
+ prefix: /* @__PURE__ */ e.jsx(Y, {})
1065
800
  }
1066
801
  ) }) })
1067
802
  ] }),
1068
- /* @__PURE__ */ e.jsx(B, { style: { marginTop: 16 }, title: "完成率", children: /* @__PURE__ */ e.jsx(ze, { percent: L, status: L === 100 ? "success" : "active" }) }),
1069
- /* @__PURE__ */ e.jsx(le, { gutter: 16, style: { marginTop: 16 }, children: C.map(({ priority: j, list: m }) => /* @__PURE__ */ e.jsx(H, { span: 8, children: /* @__PURE__ */ e.jsx(B, { size: "small", title: /* @__PURE__ */ e.jsxs(T, { children: [
1070
- /* @__PURE__ */ e.jsx(z, { color: j === 3 ? "red" : j === 2 ? "orange" : "default", children: j === 3 ? "高" : j === 2 ? "中" : "低" }),
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
- m.length,
808
+ p.length,
1074
809
  ")"
1075
810
  ] })
1076
- ] }), children: m.length === 0 ? /* @__PURE__ */ e.jsx(Z, { image: Z.PRESENTED_IMAGE_SIMPLE, description: "无任务" }) : /* @__PURE__ */ e.jsx(
1077
- q,
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: m.slice(0, 8),
1081
- renderItem: (D) => {
1082
- const M = de[D.status ?? 0] || de[0];
1083
- return /* @__PURE__ */ e.jsx(q.Item, { children: /* @__PURE__ */ e.jsx(
1084
- q.Item.Meta,
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: M.icon,
1087
- title: /* @__PURE__ */ e.jsxs(T, { children: [
1088
- /* @__PURE__ */ e.jsx(ce, { children: D.title }),
1089
- /* @__PURE__ */ e.jsx(z, { color: M.color, style: { margin: 0 }, children: M.text })
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: D.dueDate ? `截止: ${D.dueDate}` : "无截止时间"
826
+ description: P.dueDate ? `截止: ${P.dueDate}` : "无截止时间"
1092
827
  }
1093
828
  ) });
1094
829
  }
1095
830
  }
1096
- ) }) }, j)) })
831
+ ) }) }, c)) })
1097
832
  ] })
1098
833
  ] });
1099
834
  }
1100
- function lt() {
1101
- return /* @__PURE__ */ e.jsxs(Me, { children: [
1102
- /* @__PURE__ */ e.jsx(V, { index: !0, element: /* @__PURE__ */ e.jsx(Ae, { to: "dashboard", replace: !0 }) }),
1103
- /* @__PURE__ */ e.jsx(V, { path: "dashboard", element: /* @__PURE__ */ e.jsx(Ue, {}) }),
1104
- /* @__PURE__ */ e.jsx(V, { path: "project", element: /* @__PURE__ */ e.jsx(re, {}) }),
1105
- /* @__PURE__ */ e.jsx(V, { path: "project/*", element: /* @__PURE__ */ e.jsx(re, {}) }),
1106
- /* @__PURE__ */ e.jsx(V, { path: "task", element: /* @__PURE__ */ e.jsx(oe, {}) }),
1107
- /* @__PURE__ */ e.jsx(V, { path: "task/*", element: /* @__PURE__ */ e.jsx(oe, {}) })
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
- tt as ProjectSelect,
1113
- lt as TaskApp,
1114
- Ze as TaskCard,
1115
- Ue as TaskDashboard,
1116
- oe as TaskList,
1117
- et as TaskTable,
1118
- v as api,
1119
- v as taskApi
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
  };