@yuku123/z-frontend-common 1.1.0 → 1.1.2
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/README.md +22 -10
- package/dist/ComponentDoc-C4XFElke.js +1657 -0
- package/dist/index.js +160 -154
- package/dist/ui-echarts.js +54 -0
- package/dist/ui.js +19 -19
- package/package.json +6 -2
- package/src/components/ui/ComponentDoc.jsx +890 -0
- package/src/components/ui/echarts.js +8 -0
- package/src/components/ui/index.js +3 -2
- package/src/index.js +19 -2
- package/src/services/request.js +19 -5
- package/dist/PagedTable-DyjNokXN.js +0 -1211
package/dist/index.js
CHANGED
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
import { C as
|
|
1
|
+
import { C as be, a as we, D as ke, E as Ie, b as Ce, F as Re, G as ve, L as ze, P as Me, c as Be, R as Le, S as Oe, d as je, e as Ee, T as Te, f as $e, g as Ke, h as De, l as Pe, n as qe, p as Fe, r as He, s as We, i as Ne } from "./ComponentDoc-C4XFElke.js";
|
|
2
2
|
import { jsxs as h, jsx as r } from "react/jsx-runtime";
|
|
3
|
-
import { Layout as
|
|
4
|
-
import { MenuUnfoldOutlined as
|
|
3
|
+
import { Layout as k, Spin as E, Menu as T, Dropdown as $, Avatar as K, Button as I, Tooltip as D, Card as P, Alert as q, Form as x, Input as z, message as S, Tag as F, Result as H } from "antd";
|
|
4
|
+
import { MenuUnfoldOutlined as W, MenuFoldOutlined as N, DownOutlined as G, LoginOutlined as J, UserOutlined as Q, LockOutlined as V } from "@ant-design/icons";
|
|
5
5
|
import { useNavigate as X, useLocation as Y, Outlet as Z } from "react-router-dom";
|
|
6
|
-
import { useState as
|
|
6
|
+
import { useState as B, Component as _ } from "react";
|
|
7
7
|
import U from "axios";
|
|
8
|
-
const { Header:
|
|
9
|
-
function
|
|
10
|
-
const
|
|
11
|
-
if (!
|
|
12
|
-
const d = parseInt(
|
|
13
|
-
return "#" + (
|
|
8
|
+
const { Header: A, Sider: ee, Content: te } = k;
|
|
9
|
+
function re(e, t = 0.85) {
|
|
10
|
+
const s = /^#?([0-9a-f]{6})$/i.exec(e || "");
|
|
11
|
+
if (!s) return e;
|
|
12
|
+
const d = parseInt(s[1], 16), f = Math.max(0, Math.min(255, Math.round((d >> 16 & 255) * t))), n = Math.max(0, Math.min(255, Math.round((d >> 8 & 255) * t))), i = Math.max(0, Math.min(255, Math.round((d & 255) * t)));
|
|
13
|
+
return "#" + (f << 16 | n << 8 | i).toString(16).padStart(6, "0");
|
|
14
14
|
}
|
|
15
|
-
function
|
|
16
|
-
menuItems:
|
|
17
|
-
appTitle:
|
|
18
|
-
appShort:
|
|
15
|
+
function ne({
|
|
16
|
+
menuItems: e = [],
|
|
17
|
+
appTitle: t = "One Company",
|
|
18
|
+
appShort: s = "OC",
|
|
19
19
|
appVersion: d,
|
|
20
|
-
appIcon:
|
|
20
|
+
appIcon: f,
|
|
21
21
|
appUser: n,
|
|
22
|
-
loginPath:
|
|
23
|
-
headerExtra:
|
|
24
|
-
loading:
|
|
22
|
+
loginPath: i,
|
|
23
|
+
headerExtra: p,
|
|
24
|
+
loading: m = !1
|
|
25
25
|
}) {
|
|
26
|
-
const [
|
|
27
|
-
y(
|
|
28
|
-
},
|
|
29
|
-
if (
|
|
30
|
-
const
|
|
26
|
+
const [o, g] = B(!1), y = X(), c = Y(), O = ({ key: u }) => {
|
|
27
|
+
y(u);
|
|
28
|
+
}, R = () => {
|
|
29
|
+
if (i) return i;
|
|
30
|
+
const u = e && e[0], l = u && u.key;
|
|
31
31
|
return typeof l == "string" && l.endsWith("/home") ? l.slice(0, -4) + "login" : "/login";
|
|
32
|
-
},
|
|
33
|
-
for (const
|
|
34
|
-
|
|
32
|
+
}, v = (u, l = []) => {
|
|
33
|
+
for (const a of u || [])
|
|
34
|
+
a != null && a.key && l.push(a.key), a != null && a.children && v(a.children, l);
|
|
35
35
|
return l;
|
|
36
|
-
},
|
|
37
|
-
const
|
|
38
|
-
return
|
|
36
|
+
}, j = (() => {
|
|
37
|
+
const u = v(e), l = c.pathname;
|
|
38
|
+
return u.filter((a) => l === a || l.startsWith(a + "/")).sort((a, w) => w.length - a.length)[0] || l;
|
|
39
39
|
})();
|
|
40
|
-
return /* @__PURE__ */ h(
|
|
41
|
-
/* @__PURE__ */ h(
|
|
40
|
+
return /* @__PURE__ */ h(k, { style: { minHeight: "100vh" }, children: [
|
|
41
|
+
/* @__PURE__ */ h(ee, { trigger: null, collapsible: !0, collapsed: o, children: [
|
|
42
42
|
/* @__PURE__ */ r("div", { style: {
|
|
43
43
|
height: 64,
|
|
44
44
|
display: "flex",
|
|
45
45
|
alignItems: "center",
|
|
46
46
|
justifyContent: "center"
|
|
47
47
|
}, children: (() => {
|
|
48
|
-
if (
|
|
49
|
-
if (
|
|
50
|
-
const { icon:
|
|
48
|
+
if (o) {
|
|
49
|
+
if (f) {
|
|
50
|
+
const { icon: u, color: l = "#7c3aed", label: a = t } = f, w = /* @__PURE__ */ r("div", { style: {
|
|
51
51
|
width: 36,
|
|
52
52
|
height: 36,
|
|
53
53
|
borderRadius: 9,
|
|
54
|
-
background: `linear-gradient(135deg, ${l}, ${
|
|
54
|
+
background: `linear-gradient(135deg, ${l}, ${re(l, 0.7)})`,
|
|
55
55
|
display: "flex",
|
|
56
56
|
alignItems: "center",
|
|
57
57
|
justifyContent: "center",
|
|
@@ -59,13 +59,13 @@ function re({
|
|
|
59
59
|
fontSize: 20,
|
|
60
60
|
boxShadow: "0 2px 6px rgba(0,0,0,0.25)",
|
|
61
61
|
overflow: "hidden"
|
|
62
|
-
}, children:
|
|
63
|
-
return /* @__PURE__ */ r(
|
|
62
|
+
}, children: u });
|
|
63
|
+
return /* @__PURE__ */ r(D, { title: a, placement: "right", children: w });
|
|
64
64
|
}
|
|
65
|
-
return
|
|
65
|
+
return s;
|
|
66
66
|
}
|
|
67
67
|
return /* @__PURE__ */ h("span", { style: { color: "#fff", fontWeight: 600, fontSize: 16, whiteSpace: "nowrap" }, children: [
|
|
68
|
-
|
|
68
|
+
t,
|
|
69
69
|
d && /* @__PURE__ */ h("span", { style: {
|
|
70
70
|
color: "rgba(255,255,255,0.55)",
|
|
71
71
|
fontWeight: 400,
|
|
@@ -77,19 +77,19 @@ function re({
|
|
|
77
77
|
] })
|
|
78
78
|
] });
|
|
79
79
|
})() }),
|
|
80
|
-
|
|
81
|
-
|
|
80
|
+
m ? /* @__PURE__ */ r("div", { style: { padding: 16, textAlign: "center" }, children: /* @__PURE__ */ r(E, { size: "small" }) }) : /* @__PURE__ */ r(
|
|
81
|
+
T,
|
|
82
82
|
{
|
|
83
83
|
theme: "dark",
|
|
84
84
|
mode: "inline",
|
|
85
|
-
selectedKeys: [
|
|
86
|
-
items:
|
|
87
|
-
onClick:
|
|
85
|
+
selectedKeys: [j],
|
|
86
|
+
items: e,
|
|
87
|
+
onClick: O
|
|
88
88
|
}
|
|
89
89
|
)
|
|
90
90
|
] }),
|
|
91
|
-
/* @__PURE__ */ h(
|
|
92
|
-
/* @__PURE__ */ h(
|
|
91
|
+
/* @__PURE__ */ h(k, { children: [
|
|
92
|
+
/* @__PURE__ */ h(A, { style: {
|
|
93
93
|
height: 48,
|
|
94
94
|
lineHeight: "48px",
|
|
95
95
|
padding: "0 16px",
|
|
@@ -99,10 +99,10 @@ function re({
|
|
|
99
99
|
justifyContent: "space-between",
|
|
100
100
|
borderBottom: "1px solid #f1f5f9"
|
|
101
101
|
}, children: [
|
|
102
|
-
/* @__PURE__ */ r("span", { onClick: () =>
|
|
102
|
+
/* @__PURE__ */ r("span", { onClick: () => g(!o), style: { fontSize: 18, cursor: "pointer" }, children: o ? /* @__PURE__ */ r(W, {}) : /* @__PURE__ */ r(N, {}) }),
|
|
103
103
|
/* @__PURE__ */ h("div", { style: { display: "flex", alignItems: "center", gap: 12 }, children: [
|
|
104
104
|
n && /* @__PURE__ */ r(
|
|
105
|
-
|
|
105
|
+
$,
|
|
106
106
|
{
|
|
107
107
|
menu: {
|
|
108
108
|
items: [
|
|
@@ -112,7 +112,7 @@ function re({
|
|
|
112
112
|
key: "logout",
|
|
113
113
|
label: "退出登录",
|
|
114
114
|
onClick: () => {
|
|
115
|
-
localStorage.removeItem("token"), localStorage.removeItem("userInfo"), window.location.href =
|
|
115
|
+
localStorage.removeItem("token"), localStorage.removeItem("userInfo"), window.location.href = R();
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
118
|
]
|
|
@@ -121,85 +121,89 @@ function re({
|
|
|
121
121
|
children: /* @__PURE__ */ h("span", { style: { cursor: "pointer", display: "inline-flex", alignItems: "center", gap: 6 }, children: [
|
|
122
122
|
/* @__PURE__ */ r(K, { size: 28, style: { background: "#7c3aed" }, children: (n.name || "?").slice(0, 1).toUpperCase() }),
|
|
123
123
|
/* @__PURE__ */ r("span", { style: { fontSize: 13, color: "#0f172a" }, children: n.name }),
|
|
124
|
-
/* @__PURE__ */ r(
|
|
124
|
+
/* @__PURE__ */ r(G, { style: { fontSize: 10, color: "#94a3b8" } })
|
|
125
125
|
] })
|
|
126
126
|
}
|
|
127
127
|
),
|
|
128
128
|
!n && /* @__PURE__ */ r(
|
|
129
|
-
|
|
129
|
+
I,
|
|
130
130
|
{
|
|
131
131
|
type: "primary",
|
|
132
132
|
size: "small",
|
|
133
|
-
icon: /* @__PURE__ */ r(
|
|
133
|
+
icon: /* @__PURE__ */ r(J, {}),
|
|
134
134
|
onClick: () => {
|
|
135
|
-
window.location.href =
|
|
135
|
+
window.location.href = R();
|
|
136
136
|
},
|
|
137
137
|
children: "登录"
|
|
138
138
|
}
|
|
139
139
|
),
|
|
140
|
-
|
|
140
|
+
p
|
|
141
141
|
] })
|
|
142
142
|
] }),
|
|
143
|
-
/* @__PURE__ */ r(
|
|
143
|
+
/* @__PURE__ */ r(te, { style: { margin: 16, padding: 24, background: "#fff", minHeight: 280 }, children: /* @__PURE__ */ r(Z, {}) })
|
|
144
144
|
] })
|
|
145
145
|
] });
|
|
146
146
|
}
|
|
147
|
-
function
|
|
148
|
-
return
|
|
147
|
+
function oe(e) {
|
|
148
|
+
return e && typeof e == "object" && "code" in e && "data" in e ? e.code !== 200 ? Promise.reject(new Error(e.message || "请求失败")) : e.data : e;
|
|
149
149
|
}
|
|
150
|
-
function
|
|
150
|
+
function se(e, t = {}) {
|
|
151
151
|
const {
|
|
152
|
-
tokenKey:
|
|
152
|
+
tokenKey: s = "token",
|
|
153
153
|
userInfoKey: d = "userInfo",
|
|
154
|
-
unauthorizedRedirect:
|
|
155
|
-
} =
|
|
156
|
-
return
|
|
157
|
-
const
|
|
158
|
-
return
|
|
159
|
-
}),
|
|
160
|
-
(n) =>
|
|
154
|
+
unauthorizedRedirect: f = "/login"
|
|
155
|
+
} = t;
|
|
156
|
+
return e.interceptors.request.use((n) => {
|
|
157
|
+
const i = localStorage.getItem(s);
|
|
158
|
+
return i && (n.headers.Authorization = `Bearer ${i}`), n;
|
|
159
|
+
}), e.interceptors.response.use(
|
|
160
|
+
(n) => oe(n.data),
|
|
161
161
|
(n) => {
|
|
162
|
-
var
|
|
163
|
-
const
|
|
164
|
-
|
|
162
|
+
var p, m, o;
|
|
163
|
+
const i = (p = n.response) == null ? void 0 : p.status;
|
|
164
|
+
if (i === 401) {
|
|
165
|
+
const g = (m = n.response) == null ? void 0 : m.data;
|
|
166
|
+
!!(g && typeof g == "object" && g.errorCode) ? console.warn(`[401] 业务鉴权失败(不是会话过期,不跳登录): ${(o = n.config) == null ? void 0 : o.url} → ${g.errorCode}`) : (localStorage.removeItem(s), localStorage.removeItem(d), window.location.href = f);
|
|
167
|
+
} else i === 403 ? console.error("没有权限访问该资源") : i === 500 && console.error("服务器内部错误");
|
|
168
|
+
return Promise.reject(n);
|
|
165
169
|
}
|
|
166
|
-
),
|
|
170
|
+
), e;
|
|
167
171
|
}
|
|
168
|
-
function C(
|
|
169
|
-
const
|
|
170
|
-
baseURL:
|
|
171
|
-
timeout:
|
|
172
|
+
function C(e = {}) {
|
|
173
|
+
const t = U.create({
|
|
174
|
+
baseURL: e.baseURL ?? "/api",
|
|
175
|
+
timeout: e.timeout ?? 1e4
|
|
172
176
|
});
|
|
173
|
-
return
|
|
174
|
-
tokenKey:
|
|
175
|
-
userInfoKey:
|
|
176
|
-
unauthorizedRedirect:
|
|
177
|
+
return se(t, {
|
|
178
|
+
tokenKey: e.tokenKey,
|
|
179
|
+
userInfoKey: e.userInfoKey,
|
|
180
|
+
unauthorizedRedirect: e.unauthorizedRedirect
|
|
177
181
|
});
|
|
178
182
|
}
|
|
179
|
-
const
|
|
180
|
-
function
|
|
181
|
-
title:
|
|
182
|
-
mockAuth:
|
|
183
|
-
loginApi:
|
|
183
|
+
const b = C(), ae = C();
|
|
184
|
+
function ie({
|
|
185
|
+
title: e = "统一管理平台",
|
|
186
|
+
mockAuth: t,
|
|
187
|
+
loginApi: s = "/auth/login",
|
|
184
188
|
redirectUrl: d = "/",
|
|
185
|
-
onSuccess:
|
|
189
|
+
onSuccess: f
|
|
186
190
|
}) {
|
|
187
|
-
const [n,
|
|
188
|
-
localStorage.setItem("token",
|
|
189
|
-
},
|
|
190
|
-
var
|
|
191
|
-
|
|
191
|
+
const [n, i] = B(!1), p = (o) => {
|
|
192
|
+
localStorage.setItem("token", t ? "mock-" + t.username : (o == null ? void 0 : o.token) || "token"), localStorage.setItem("userInfo", JSON.stringify(o || {})), S.success("登录成功" + (t ? "(mock 模式,待 CTC/SSO 接入)" : "")), f ? f(o) : window.location.href = d;
|
|
193
|
+
}, m = async (o) => {
|
|
194
|
+
var g, y;
|
|
195
|
+
i(!0);
|
|
192
196
|
try {
|
|
193
|
-
if (
|
|
194
|
-
|
|
197
|
+
if (t) {
|
|
198
|
+
o.username === t.username && o.password === t.password ? p(t.user) : S.error("用户名或密码错误");
|
|
195
199
|
return;
|
|
196
200
|
}
|
|
197
|
-
const c = await
|
|
198
|
-
c != null && c.token ? (localStorage.setItem("token", c.token), localStorage.setItem("userInfo", JSON.stringify(c.user || c)),
|
|
201
|
+
const c = await b.post(s, o);
|
|
202
|
+
c != null && c.token ? (localStorage.setItem("token", c.token), localStorage.setItem("userInfo", JSON.stringify(c.user || c)), S.success("登录成功"), f ? f(c) : window.location.href = d) : S.error("登录失败:未获取到 token");
|
|
199
203
|
} catch (c) {
|
|
200
|
-
|
|
204
|
+
S.error(((y = (g = c.response) == null ? void 0 : g.data) == null ? void 0 : y.message) || c.message || "登录失败");
|
|
201
205
|
} finally {
|
|
202
|
-
|
|
206
|
+
i(!1);
|
|
203
207
|
}
|
|
204
208
|
};
|
|
205
209
|
return /* @__PURE__ */ r("div", { style: {
|
|
@@ -208,20 +212,20 @@ function ae({
|
|
|
208
212
|
justifyContent: "center",
|
|
209
213
|
alignItems: "center",
|
|
210
214
|
background: "#f0f2f5"
|
|
211
|
-
}, children: /* @__PURE__ */ h(
|
|
212
|
-
|
|
213
|
-
|
|
215
|
+
}, children: /* @__PURE__ */ h(P, { title: e, style: { width: 400 }, children: [
|
|
216
|
+
t && /* @__PURE__ */ r(
|
|
217
|
+
q,
|
|
214
218
|
{
|
|
215
219
|
type: "info",
|
|
216
220
|
showIcon: !0,
|
|
217
221
|
style: { marginBottom: 16 },
|
|
218
|
-
message: `Mock 模式:用户名 ${
|
|
222
|
+
message: `Mock 模式:用户名 ${t.username} / 密码 ${t.password}`
|
|
219
223
|
}
|
|
220
224
|
),
|
|
221
|
-
/* @__PURE__ */ h(
|
|
222
|
-
/* @__PURE__ */ r(
|
|
223
|
-
/* @__PURE__ */ r(
|
|
224
|
-
/* @__PURE__ */ r(
|
|
225
|
+
/* @__PURE__ */ h(x, { onFinish: m, size: "large", children: [
|
|
226
|
+
/* @__PURE__ */ r(x.Item, { name: "username", rules: [{ required: !0, message: "请输入用户名" }], children: /* @__PURE__ */ r(z, { prefix: /* @__PURE__ */ r(Q, {}), placeholder: "用户名" }) }),
|
|
227
|
+
/* @__PURE__ */ r(x.Item, { name: "password", rules: [{ required: !0, message: "请输入密码" }], children: /* @__PURE__ */ r(z.Password, { prefix: /* @__PURE__ */ r(V, {}), placeholder: "密码" }) }),
|
|
228
|
+
/* @__PURE__ */ r(x.Item, { children: /* @__PURE__ */ r(I, { type: "primary", htmlType: "submit", loading: n, block: !0, children: "登 录" }) })
|
|
225
229
|
] })
|
|
226
230
|
] }) });
|
|
227
231
|
}
|
|
@@ -232,79 +236,81 @@ const L = {
|
|
|
232
236
|
approved: { color: "blue", text: "已通过" },
|
|
233
237
|
rejected: { color: "red", text: "已拒绝" }
|
|
234
238
|
};
|
|
235
|
-
function
|
|
236
|
-
const
|
|
237
|
-
return /* @__PURE__ */ r(
|
|
239
|
+
function le({ status: e, map: t }) {
|
|
240
|
+
const s = (t == null ? void 0 : t[e]) || L[e] || { color: "default", text: String(e) };
|
|
241
|
+
return /* @__PURE__ */ r(F, { color: s.color, children: s.text });
|
|
238
242
|
}
|
|
239
|
-
class
|
|
240
|
-
constructor(
|
|
241
|
-
super(
|
|
243
|
+
class ce extends _ {
|
|
244
|
+
constructor(t) {
|
|
245
|
+
super(t), this.state = { hasError: !1, error: null, errorInfo: null }, this.handleReset = () => {
|
|
242
246
|
this.setState({ hasError: !1, error: null, errorInfo: null }), typeof this.props.onReset == "function" && this.props.onReset();
|
|
243
247
|
};
|
|
244
248
|
}
|
|
245
|
-
static getDerivedStateFromError(
|
|
246
|
-
return { hasError: !0, error:
|
|
249
|
+
static getDerivedStateFromError(t) {
|
|
250
|
+
return { hasError: !0, error: t };
|
|
247
251
|
}
|
|
248
|
-
componentDidCatch(
|
|
249
|
-
console.error("[ErrorBoundary] caught error:",
|
|
252
|
+
componentDidCatch(t, s) {
|
|
253
|
+
console.error("[ErrorBoundary] caught error:", t, s), this.setState({ errorInfo: s });
|
|
250
254
|
}
|
|
251
255
|
render() {
|
|
252
|
-
var
|
|
256
|
+
var t;
|
|
253
257
|
return this.state.hasError ? /* @__PURE__ */ r(
|
|
254
|
-
|
|
258
|
+
H,
|
|
255
259
|
{
|
|
256
260
|
status: "error",
|
|
257
261
|
title: "页面出错了",
|
|
258
|
-
subTitle: String(((
|
|
259
|
-
extra: /* @__PURE__ */ r(
|
|
262
|
+
subTitle: String(((t = this.state.error) == null ? void 0 : t.message) || this.state.error),
|
|
263
|
+
extra: /* @__PURE__ */ r(I, { type: "primary", onClick: this.handleReset, children: "重试" })
|
|
260
264
|
}
|
|
261
265
|
) : this.props.children;
|
|
262
266
|
}
|
|
263
267
|
}
|
|
264
|
-
const
|
|
265
|
-
AppLayout:
|
|
266
|
-
StatusTag:
|
|
268
|
+
const de = ["get", "post", "put", "patch", "delete", "head", "options"], M = {
|
|
269
|
+
AppLayout: ne,
|
|
270
|
+
StatusTag: le,
|
|
267
271
|
defaultStatusMap: L,
|
|
268
|
-
LoginPage:
|
|
269
|
-
ErrorBoundary:
|
|
270
|
-
request:
|
|
271
|
-
authRequest:
|
|
272
|
+
LoginPage: ie,
|
|
273
|
+
ErrorBoundary: ce,
|
|
274
|
+
request: b,
|
|
275
|
+
authRequest: ae,
|
|
272
276
|
createRequest: C
|
|
273
277
|
};
|
|
278
|
+
for (const e of de)
|
|
279
|
+
typeof b[e] == "function" && !(e in M) && (M[e] = (...t) => b[e](...t));
|
|
274
280
|
export {
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
we as
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
+
ne as AppLayout,
|
|
282
|
+
be as CategoryDot,
|
|
283
|
+
we as ComponentDoc,
|
|
284
|
+
ke as DarkBanner,
|
|
285
|
+
Ie as EmptyState,
|
|
286
|
+
ce as ErrorBoundary,
|
|
281
287
|
Ce as ErrorState,
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
+
Re as FeatureCard,
|
|
289
|
+
ve as GradientStatCard,
|
|
290
|
+
ze as LoadingState,
|
|
291
|
+
ie as LoginPage,
|
|
292
|
+
Me as PageHeader,
|
|
293
|
+
Be as PagedTable,
|
|
288
294
|
Le as RefreshButton,
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
295
|
+
Oe as SearchInput,
|
|
296
|
+
je as SectionHeader,
|
|
297
|
+
Ee as StatusBadge,
|
|
298
|
+
le as StatusTag,
|
|
299
|
+
Te as TableToolbar,
|
|
300
|
+
$e as antdTheme,
|
|
301
|
+
ae as authRequest,
|
|
296
302
|
Ke as brand,
|
|
297
303
|
C as createRequest,
|
|
298
|
-
|
|
304
|
+
M as default,
|
|
299
305
|
L as defaultStatusMap,
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
306
|
+
De as fontSize,
|
|
307
|
+
Pe as lift,
|
|
308
|
+
qe as neutral,
|
|
309
|
+
Fe as palette,
|
|
310
|
+
He as radius,
|
|
311
|
+
b as request,
|
|
312
|
+
se as setupInterceptors,
|
|
313
|
+
We as shadow,
|
|
314
|
+
Ne as space,
|
|
315
|
+
oe as unwrapResponse
|
|
310
316
|
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as s, useEffect as u } from "react";
|
|
3
|
+
import * as c from "echarts/core";
|
|
4
|
+
import { LineChart as d, PieChart as p, BarChart as v } from "echarts/charts";
|
|
5
|
+
import { GridComponent as C, TooltipComponent as h, LegendComponent as z, TitleComponent as R } from "echarts/components";
|
|
6
|
+
import { CanvasRenderer as w } from "echarts/renderers";
|
|
7
|
+
c.use([
|
|
8
|
+
d,
|
|
9
|
+
p,
|
|
10
|
+
v,
|
|
11
|
+
C,
|
|
12
|
+
h,
|
|
13
|
+
z,
|
|
14
|
+
R,
|
|
15
|
+
w
|
|
16
|
+
]);
|
|
17
|
+
function x({
|
|
18
|
+
option: t,
|
|
19
|
+
height: f = 300,
|
|
20
|
+
className: a,
|
|
21
|
+
style: m
|
|
22
|
+
}) {
|
|
23
|
+
const r = s(null), e = s(null);
|
|
24
|
+
return u(() => {
|
|
25
|
+
if (!r.current) return;
|
|
26
|
+
e.current = c.init(r.current, null, { renderer: "canvas" });
|
|
27
|
+
let n;
|
|
28
|
+
const i = () => {
|
|
29
|
+
var o;
|
|
30
|
+
return (o = e.current) == null ? void 0 : o.resize();
|
|
31
|
+
};
|
|
32
|
+
return typeof ResizeObserver < "u" ? (n = new ResizeObserver(i), n.observe(r.current)) : window.addEventListener("resize", i), () => {
|
|
33
|
+
n ? n.disconnect() : window.removeEventListener("resize", i), e.current && (e.current.dispose(), e.current = null);
|
|
34
|
+
};
|
|
35
|
+
}, []), u(() => {
|
|
36
|
+
e.current && t && e.current.setOption(t, { notMerge: !0 });
|
|
37
|
+
}, [t]), /* @__PURE__ */ l(
|
|
38
|
+
"div",
|
|
39
|
+
{
|
|
40
|
+
ref: r,
|
|
41
|
+
className: a,
|
|
42
|
+
role: "img",
|
|
43
|
+
"aria-label": "数据可视化图表",
|
|
44
|
+
style: {
|
|
45
|
+
width: "100%",
|
|
46
|
+
height: f,
|
|
47
|
+
...m
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
export {
|
|
53
|
+
x as EChartsChart
|
|
54
|
+
};
|
package/dist/ui.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { C as
|
|
1
|
+
import { C as s, a as t, D as r, E as o, b as n, F as d, G as S, L as i, P as l, c as p, R as g, S as u, d as b, e as c, T as f, f as h, g as C, h as T, l as m, n as D, p as B, r as E, s as P, i as y } from "./ComponentDoc-C4XFElke.js";
|
|
2
2
|
export {
|
|
3
|
-
|
|
4
|
-
t as
|
|
5
|
-
r as
|
|
6
|
-
|
|
3
|
+
s as CategoryDot,
|
|
4
|
+
t as ComponentDoc,
|
|
5
|
+
r as DarkBanner,
|
|
6
|
+
o as EmptyState,
|
|
7
7
|
n as ErrorState,
|
|
8
|
-
|
|
8
|
+
d as FeatureCard,
|
|
9
9
|
S as GradientStatCard,
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
i as LoadingState,
|
|
11
|
+
l as PageHeader,
|
|
12
|
+
p as PagedTable,
|
|
13
13
|
g as RefreshButton,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
14
|
+
u as SearchInput,
|
|
15
|
+
b as SectionHeader,
|
|
16
|
+
c as StatusBadge,
|
|
17
|
+
f as TableToolbar,
|
|
18
|
+
h as antdTheme,
|
|
19
|
+
C as brand,
|
|
20
|
+
T as fontSize,
|
|
21
|
+
m as lift,
|
|
22
|
+
D as neutral,
|
|
23
23
|
B as palette,
|
|
24
|
-
|
|
24
|
+
E as radius,
|
|
25
25
|
P as shadow,
|
|
26
26
|
y as space
|
|
27
27
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yuku123/z-frontend-common",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"description": "z-opc 全仓共享前端基座 — AppLayout(§1/§11/§12/§15/§16) + LoginPage(mockAuth 双模式) + EmptyState/StatusTag/ErrorBoundary + createRequest 工厂。lead 008 前端开发规范唯一承载仓",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -11,6 +11,9 @@
|
|
|
11
11
|
"types": "./dist/index.d.ts",
|
|
12
12
|
"default": "./dist/index.js"
|
|
13
13
|
},
|
|
14
|
+
"./ui/echarts": {
|
|
15
|
+
"default": "./dist/ui-echarts.js"
|
|
16
|
+
},
|
|
14
17
|
"./ui": {
|
|
15
18
|
"default": "./dist/ui.js"
|
|
16
19
|
}
|
|
@@ -22,7 +25,8 @@
|
|
|
22
25
|
"scripts": {
|
|
23
26
|
"build": "vite build",
|
|
24
27
|
"dev": "vite build --watch",
|
|
25
|
-
"prepublishOnly": "vite build"
|
|
28
|
+
"prepublishOnly": "vite build",
|
|
29
|
+
"test": "node --test test/"
|
|
26
30
|
},
|
|
27
31
|
"dependencies": {
|
|
28
32
|
"axios": "^1.16.1"
|