PageSourceSearch

https://doloffer.com/assets/chunks/chunk-DxVOM4oL.js

js doloffer.com collected 2026-09-25 20:37:31 UTC 16,187 bytes, 165 lines download raw bytes

1import { j as e, r as p } from "./chunk-DC5fQwvS.js";
2import { P as B, e as w, m as Y, ag as G, F as f, ar as E, bf as _, t as F, bH as V, bw as $, bg as K, bM as W, bh as z, by as O, h as m, bi as H, bj as Q, bk as J } from "../entries/pages_spa.C5xTuQKw.js";
3import { P as X, F as Z } from "./chunk-CimNaWrp.js";
4import { M as D, P as ee } from "./chunk-D7mJxAL8.js";
5import { b7 as P } from "./chunk-DWeE5Y0G.js";
6import { T as R } from "./chunk-CN1nTDko.js";
7import { W as L } from "./chunk-q7V8PexN.js";
8import { F as te } from "./chunk-CUIfgONQ.js";
9import { h as A } from "./chunk-C5S46NFB.js";
10import { D as se, a as ae } from "./chunk-CNXfRHoR.js";
11import { M as re } from "./chunk-BoEeXXS-.js";
12import { D as oe } from "./chunk-aoo6eNB8.js";
13import { b as ne, c as de, a as ie, g as le } from "./chunk-DmrBpjKS.js";
14import "./chunk-0x1gBMBx.js";
15import "./chunk-BArghIwn.js";
16import "./chunk-C0TFbFtH.js";
17import "./chunk-BKApCE6t.js";
18import "./chunk-C5iOjZdu.js";
19import "./chunk-DwPmycG5.js";
20import "./chunk-Dxqvi9v3.js";
21import "./chunk-D6a_qL3c.js";
22const U = ({ hideStatus: r }) => {
23  const s = w();
24  return e.jsx(e.Fragment, { children: e.jsxs(B.Group, { children: [e.jsx(L, { rules: [{ required: true }], width: "md", label: s.formatMessage({ id: "todo.type" }), name: "type", valueEnum: { processed: { text: s.formatMessage({ id: "todo.processed" }) }, unprocessed: { text: s.formatMessage({ id: "todo.unprocessed" }) } } }), !r && e.jsx(L, { rules: [{ required: true }], width: "md", label: s.formatMessage({ id: "todo.status" }), name: "status", valueEnum: { changePassword: { text: s.formatMessage({ id: "todo.changePassword" }) }, manualRemoval: { text: s.formatMessage({ id: "todo.manualRemoval" }) }, inviteLink: { text: s.formatMessage({ id: "todo.inviteLink" }) } } })] }) });
25}, ce = (r) => {
26  var _a;
27  const s = w(), { updateModalOpen: d, onCancel: i, onSubmit: x, values: M } = r;
28  return e.jsxs(D, { title: s.formatMessage({ id: "modify" }), width: "50%", modalProps: { destroyOnClose: true, maskClosable: false }, open: d, onOpenChange: i, onFinish: x, initialValues: { ...M, roleIds: (_a = M.roles) == null ? void 0 : _a.map((g) => g.id) }, children: [e.jsx(U, { hideStatus: true, hideOrderNumber: true }), e.jsx(Y.Item, { name: "_id", label: false, children: e.jsx(G, { type: "hidden" }) })] });
29}, ue = (r) => {
30  const s = w(), { open: d, onOpenChange: i, onFinish: x } = r;
31  return e.jsx(D, { title: s.formatMessage({ id: "new" }), width: "50%", open: d, onOpenChange: i, modalProps: { destroyOnClose: true, maskClosable: false }, onFinish: x, children: e.jsx(U, { newRecord: true }) });
32}, me = (r) => {
33  var _a, _b;
34  const { onClose: s, open: d, currentRow: i, columns: x, handleUpdateModalOpen: M, setCurrentRow: g } = r, n = w(), [I, b] = p.useState(((_b = (_a = i == null ? void 0 : i.order) == null ? void 0 : _a.account) == null ? void 0 : _b.salesRecords) || []), [S, l] = p.useState(false), T = x.filter((c) => c.dataIndex !== "option"), y = async () => {
35    var _a2, _b2, _c;
36    l(true);
37    try {
38      const c = await F(`/todoLists/${i == null ? void 0 : i._id}`, {}, {});
39      if (console.log("API Response:", c), c == null ? void 0 : c.success) {
40        const u = ((_c = (_b2 = (_a2 = c == null ? void 0 : c.data) == null ? void 0 : _a2.order) == null ? void 0 : _b2.account) == null ? void 0 : _c.salesRecords) || [];
41        b(u);
42      }
43    } catch (c) {
44      console.error("Query error:", c);
45    } finally {
46      l(false);
47    }
48  };
49  p.useEffect(() => {
50    i && (b([]), y().catch(console.error));
51  }, [i]);
52  const h = [{ title: n.formatMessage({ id: "SaddleNumber" }), dataIndex: "salesId", width: "5%" }, { title: e.jsx(f, { id: "customer", defaultMessage: "customer" }), dataIndex: ["customer", "email"], width: "15%", render: (c, u) => {
53    var _a2;
54    return console.log("record in render:", u), ((_a2 = u == null ? void 0 : u.customer) == null ? void 0 : _a2.email) ? e.jsx(e.Fragment, { children: u.customer.email }) : null;
55  } }, { title: n.formatMessage({ id: "status_title" }), width: "10%", dataIndex: ["order", "status"], hideInSearch: true, valueEnum: { active: { text: n.formatMessage({ id: "orders.active" }) }, completed: { text: n.formatMessage({ id: "orders.completed" }) }, refunding: { text: n.formatMessage({ id: "orders.refunding" }) }, refunded: { text: n.formatMessage({ id: "orders.refunded" }) }, unpaid: { text: n.formatMessage({ id: "payment.unpaid" }) }, expired: { text: n.formatMessage({ id: "payments.expired" }) } } }, { title: n.formatMessage({ id: "ValidityPeriod", defaultMessage: "ValidityPeriod" }), dataIndex: "drivingTime", width: "15%", hideInSearch: true, render: (c, u) => {
56    const C = A(u.createdAt), a = u.order ? A(u.order.expirationTime) : A();
57    return `${C.format("YYYY-MM-DD")} ~ ${a.format("YYYY-MM-DD")}`;
58  } }, { title: e.jsx(f, { id: "creation_time", defaultMessage: "Created At" }), dataIndex: "createdAt", valueType: "dateTime", width: "10%" }], j = [{ title: e.jsx(f, { id: "todo.type", defaultMessage: "Type" }), dataIndex: "type", width: 100, valueEnum: { unprocessed: { text: n.formatMessage({ id: "todo.unprocessed" }) }, processed: { text: n.formatMessage({ id: "todo.processed" }) } } }, { title: e.jsx(f, { id: "todo.status", defaultMessage: "Status" }), dataIndex: "status", width: 100, valueEnum: { changePassword: { text: n.formatMessage({ id: "todo.changePassword" }) }, manualRemoval: { text: n.formatMessage({ id: "todo.manualRemoval" }) }, inviteLink: { text: n.formatMessage({ id: "todo.inviteLink" }) } } }, { title: e.jsx(f, { id: "todo.createdAt", defaultMessage: "Created At" }), dataIndex: "createdAt", width: 150, valueType: "dateTime" }, { title: e.jsx(f, { id: "todo.processedAt", defaultMessage: "Processed At" }), dataIndex: "processedAt", width: 150, valueType: "dateTime" }], v = () => {
59    M(true), g(i);
60  };
61  return e.jsxs(E, { open: d, onCancel: s, footer: [e.jsx(P, { type: "primary", onClick: v, style: { marginRight: 8 }, children: e.jsx(f, { id: "process", defaultMessage: "Process" }) }, "process"), e.jsx(P, { onClick: s, children: e.jsx(f, { id: "platform.close", defaultMessage: "Close" }) }, "close")], width: "60%", centered: true, className: "rounded-lg overflow-hidden", children: [(i == null ? void 0 : i.listId) && e.jsx(_, { column: 2, title: e.jsx(f, { id: "menu.customer-service.todo", defaultMessage: "To-do List" }), request: async () => ({ data: i || {} }), params: { id: i == null ? void 0 : i.listId }, columns: T, style: { marginTop: "20px" }, bordered: true, labelStyle: { width: "13%", justifyContent: "flex-end", padding: "8px 16px", backgroundColor: ae, color: se }, contentStyle: { width: "30%", padding: "8px 16px" }, size: "small", className: "custom-descriptions" }), e.jsx(_, { column: 4, title: "\u5F85\u529E\u660E\u7EC6", request: async () => ({ data: i || {} }), params: { id: i == null ? void 0 : i._id }, columns: j, style: { marginTop: "20px", marginLeft: "22px" } }), e.jsx(te, { rowKey: "_id", headerTitle: e.jsx("b", { children: "\u5F53\u524D\u8F66\u5EA7" }), maxLength: 5, scroll: { x: 960 }
61, recordCreatorProps: false, loading: S, columns: h, value: I })] });
62}, pe = async (r) => {
63  var _a, _b;
64  const s = m.loading("\u6B63\u5728\u6DFB\u52A0...");
65  try {
66    return await Q("/todoLists", { ...r }), s(), m.success("\u6DFB\u52A0\u6210\u529F"), true;
67  } catch (d) {
68    return s(), m.error(((_b = (_a = d == null ? void 0 : d.response) == null ? void 0 : _a.data) == null ? void 0 : _b.message) ?? "\u6DFB\u52A0\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5"), false;
69  }
70}, fe = async (r) => {
71  var _a, _b;
72  const s = m.loading("\u6B63\u5728\u66F4\u65B0...");
73  try {
74    return await J(`/todoLists/${r._id}`, r), s(), m.success("\u66F4\u65B0\u6210\u529F"), true;
75  } catch (d) {
76    return s(), m.error(((_b = (_a = d == null ? void 0 : d.response) == null ? void 0 : _a.data) == null ? void 0 : _b.message) ?? "\u66F4\u65B0\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5"), false;
77  }
78}, he = async (r) => {
79  var _a, _b;
80  const s = m.loading("\u6B63\u5728\u6279\u91CF\u5904\u7406...");
81  try {
82    return await O("/todoLists/batchProcess", { method: "POST", data: { ids: r } }), s(), m.success("\u6279\u91CF\u5904\u7406\u6210\u529F"), true;
83  } catch (d) {
84    return s(), m.error(((_b = (_a = d == null ? void 0 : d.response) == null ? void 0 : _a.data) == null ? void 0 : _b.message) ?? "\u6279\u91CF\u5904\u7406\u5931\u8D25"), false;
85  }
86}, k = async (r) => {
87  var _a, _b;
88  const s = m.loading("\u6B63\u5728\u5220\u9664...");
89  if (!r) return true;
90  try {
91    return await H("/todoLists", { ids: r }), s(), m.success("\u5220\u9664\u6210\u529F"), true;
92  } catch (d) {
93    return s(), m.error(((_b = (_a = d == null ? void 0 : d.response) == null ? void 0 : _a.data) == null ? void 0 : _b.message) ?? "\u5220\u9664\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5"), false;
94  }
95}, Ne = () => {
96  const r = w(), s = V(), d = $(), x = new URLSearchParams(s.search).get("type") || "", [M, g] = p.useState(false), [n, I] = p.useState(false), [b, S] = p.useState(false), l = p.useRef(), [T, y] = p.useState(), [h, j] = p.useState([]), v = K(), [c, u] = p.useState(x);
97  p.useEffect(() => {
98    const t = new URLSearchParams(s.search).get("type");
99    t && (u(t), l.current && l.current.reload());
100  }, [s.search]);
101  const C = [{ title: "ID", dataIndex: "listId", valueType: "text", hideInSearch: false }, { title: "SPU", dataIndex: "platform", valueType: "select", fieldProps: { showSearch: true, optionFilterProp: "label" }, request: async () => (await O("/platforms/getAllPlatforms", { method: "GET" })).data.map((t) => ({ label: t.name, value: t._id })), render: (a, t) => {
102    var _a, _b, _c;
103    return ((_a = t.order) == null ? void 0 : _a.displayNameSnapshot) || ((_c = (_b = t.order) == null ? void 0 : _b.platform) == null ? void 0 : _c.name) || "-";
104  } }, { title: "\u5730\u533A", dataIndex: "region", hideInSearch: true, render: (a, t) => {
105    var _a, _b;
106    return ((_b = (_a = t.order) == null ? void 0 : _a.region) == null ? void 0 : _b.name) || "\u4E0D\u9650\u5730\u533A";
107  } }, { title: "\u4E0A\u7EBF\u72B6\u6001", dataIndex: "usageStatus", valueType: "select", valueEnum: ne, render: (a, t) => {
108    var _a, _b;
109    const o = ie[(_b = (_a = t.order) == null ? void 0 : _a.account) == null ? void 0 : _b.usageStatus];
110    return o ? e.jsx(R, { color: o.color, children: o.text }) : "-";
111  } }, { title: "\u5BA2\u6237", dataIndex: "email", render: (a, t) => {
112    var _a, _b, _c;
113    return ((_a = t.order) == null ? void 0 : _a.customer) && e.jsx(e.Fragment, { children: (_c = (_b = t.order) == null ? void 0 : _b.customer) == null ? void 0 : _c.email });
114  } }, { title: "\u8F66\u7F16\u53F7", dataIndex: "cardId", sorter: true, render: (a, t) => {
115    var _a, _b;
116    const o = (_b = (_a = t == null ? void 0 : t.order) == null ? void 0 : _a.account) == null ? void 0 : _b.cardSecretNumber;
117    return o ? e.jsx("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: e.jsx("a", { onClick: () => {
118      d("/user-management/car-detail", { state: { cardId: o } });
119    }, children: o }) }) : "-";
120  } }, { title: "\u8F66\u8D26\u53F7", dataIndex: "accountNumber", render: (a, t) => {
121    var _a, _b;
122    const o = (_b = (_a = t == null ? void 0 : t.order) == null ? void 0 : _a.account) == null ? void 0 : _b.accountNumber;
123    return o ? e.jsx("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: o }) : "-";
124  } }, { title: "\u8F66\u72B6\u6001", dataIndex: "carStatus", valueType: "select", valueEnum: de, render: (a, t) => {
125    var _a;
126    const o = (_a = t == null ? void 0 : t.order) == null ? void 0 : _a.account;
127    if (!o) return "-";
128    const { text: N, color: q } = le(o);
129    return e.jsx(R, { color: q, children: N });
130  } }, { title: "\u8BA2\u5355\u7F16\u53F7", dataIndex: "order", render: (a, t) => {
131    var _a;
132    const o = ((_a = t == null ? void 0 : t.order) == null ? void 0 : _a._id) ?? "";
133    return e.jsx("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: o });
134  } }, { title: "\u8BA2\u5355\u72B6\u6001", dataIndex: ["order", "status"], valueEnum: { completed: "\u5DF2\u5230\u671F", refunded: "\u5DF2\u9000\u6B3E" }, hideInSearch: true }, { title: "\u5F85\u529E\u64CD\u4F5C", dataIndex: ["order", "platform", "deliveryMethod"], valueEnum: { 1: "\u4FEE\u6539\u5BC6\u7801", 2: "\u624B\u52A8\u79FB\u9
134664", "2-uid": "\u624B\u52A8\u79FB\u9664", 3: "\u5145\u503C\u65E0\u9700\u64CD\u4F5C", 4: "\u8865\u5F55\u5151\u6362\u7801" } }, { title: "\u5904\u7406\u72B6\u6001", dataIndex: "type", valueType: "select", valueEnum: { unprocessed: { text: "\u672A\u5904\u7406" }, processed: { text: "\u5DF2\u5904\u7406" } }, hideInSearch: true }, { title: "\u521B\u5EFA\u65F6\u95F4", dataIndex: "createdAt", valueType: "dateTime", hideInSearch: true }, { title: "\u5904\u7406\u65F6\u95F4", dataIndex: "processedAt", valueType: "dateTime", hideInSearch: true }, { title: "\u64CD\u4F5C", dataIndex: "option", valueType: "option", fixed: "right", hideInSearch: true, render: (a, t) => [e.jsx(re, { items: [{ key: "detail", label: "\u8BE6\u60C5", onClick: () => {
135    y(t), S(true);
136  } }, { key: "edit", label: "\u7F16\u8F91", onClick: () => {
137    I(true), y(t);
138  } }, ...v.canSuperAdmin ? [{ key: "delete", label: "\u5220\u9664", danger: true, onClick: () => E.confirm({ title: "\u786E\u8BA4\u5220\u9664\uFF1F", content: "\u5220\u9664\u540E\u65E0\u6CD5\u6062\u590D", okText: "\u786E\u8BA4", cancelText: "\u53D6\u6D88", okButtonProps: { danger: true }, onOk: async () => {
139    var _a, _b;
140    await k([t._id]), j([]), (_b = (_a = l.current) == null ? void 0 : _a.reloadAndRest) == null ? void 0 : _b.call(_a);
141  } }) }] : []] }, "more")] }];
142  return e.jsxs(X, { children: [e.jsx(ee, { headerTitle: r.formatMessage({ id: "list" }), actionRef: l, rowKey: "_id", search: { collapsed: false, persist: false }, preserve: false, toolBarRender: () => [e.jsx(W, { title: "\u786E\u8BA4\u6279\u91CF\u5904\u7406\uFF1F", description: `\u786E\u8BA4\u5904\u7406\u9009\u4E2D\u7684 ${h.length} \u6761\u5F85\u529E\u5417\uFF1F`, okText: "\u786E\u8BA4", cancelText: "\u53D6\u6D88", disabled: h.length === 0, onConfirm: async () => {
143    var _a, _b;
144    const a = h.map((o) => o._id).filter(Boolean);
145    await he(a) && (j([]), (_b = (_a = l.current) == null ? void 0 : _a.reloadAndRest) == null ? void 0 : _b.call(_a));
146  }, children: e.jsx(P, { type: "primary", disabled: h.length === 0, children: "\u4E00\u952E\u5904\u7406" }) }, "batchProcessConfirm"), v.canAdmin && e.jsxs(P, { type: "primary", onClick: () => {
147    g(true);
148  }, children: [e.jsx(z, {}), " ", e.jsx(f, { id: "pages.searchTable.new", defaultMessage: "New" })] }, "primary")], request: async (a, t, o) => F("/todoLists", { ...a, type: c }, t, o), toolbar: { menu: { type: "tab", activeKey: c, items: [{ label: r.formatMessage({ id: "platform.all", defaultMessage: "All" }), key: "" }, { label: r.formatMessage({ id: "todo.unprocessed", defaultMessage: "Unprocessed" }), key: "unprocessed" }, { label: r.formatMessage({ id: "todo.processed", defaultMessage: "Processed" }), key: "processed" }], onChange: (a) => {
149    u(a), l.current && l.current.reload();
150  } } }, columns: C, rowSelection: { onChange: (a, t) => {
151    j(t);
152  } } }), (h == null ? void 0 : h.length) > 0 && e.jsx(Z, { extra: e.jsxs("div", { children: ["\u5DF2\u9009\u62E9 ", e.jsx("a", { style: { fontWeight: 600 }, children: h.length }), " \u6761"] }), children: v.canSuperAdmin && e.jsx(oe, { onOk: async () => {
153    var _a, _b;
154    await k(h == null ? void 0 : h.map((a) => a._id)), j([]), (_b = (_a = l.current) == null ? void 0 : _a.reloadAndRest) == null ? void 0 : _b.call(_a);
155  } }) }), e.jsx(ue, { open: M, onOpenChange: g, onFinish: async (a) => {
156    await pe(a) && (g(false), l.current && l.current.reload());
157  } }), e.jsx(ce, { onSubmit: async (a) => {
158    await fe(a) && (I(false), y(void 0), l.current && l.current.reload());
159  }, onCancel: I, updateModalOpen: n, values: T || {} }), e.jsx(me, { open: b, currentRow: T, columns: C, onClose: () => {
160    y(void 0), S(false);
161  }, handleUpdateModalOpen: I, setCurrentRow: y })] });
162};
163export {
164  Ne as default
165};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.