@yuku123/z-frontend-common 0.2.9 → 1.1.0
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/LICENSE +25 -0
- package/README.md +55 -42
- package/dist/PagedTable-DyjNokXN.js +1211 -0
- package/dist/index.js +310 -0
- package/dist/ui.js +27 -0
- package/package.json +52 -44
- package/src/components/ErrorBoundary/index.jsx +24 -77
- package/src/components/Layout/index.jsx +141 -38
- package/src/components/LoginPage/index.jsx +47 -21
- package/src/components/StatusTag/index.jsx +14 -12
- package/src/components/ui/CategoryDot.jsx +38 -0
- package/src/components/ui/DarkBanner.jsx +142 -0
- package/src/components/ui/EChartsChart.jsx +82 -0
- package/src/components/ui/EmptyState.jsx +94 -0
- package/src/components/ui/ErrorState.jsx +114 -0
- package/src/components/ui/FeatureCard.jsx +205 -0
- package/src/components/ui/GradientStatCard.jsx +196 -0
- package/src/components/ui/LoadingState.jsx +116 -0
- package/src/components/ui/PageHeader.jsx +143 -0
- package/src/components/ui/PagedTable.jsx +83 -0
- package/src/components/ui/SearchInput.jsx +111 -0
- package/src/components/ui/SectionHeader.jsx +76 -0
- package/src/components/ui/StatusBadge.jsx +66 -0
- package/src/components/ui/TableToolbar.jsx +58 -0
- package/src/components/ui/index.js +36 -0
- package/src/components/ui/tokens.js +224 -0
- package/src/index.js +33 -37
- package/src/services/request.js +74 -4
- package/dist/z-frontend-common.css +0 -1
- package/dist/z-frontend-common.es.js +0 -51275
- package/dist/z-frontend-common.umd.js +0 -459
- package/src/components/Ctc/Layout.jsx +0 -330
- package/src/components/Ctc/Layout.module.css +0 -145
- package/src/components/Ctc/agentTeam/index.tsx +0 -308
- package/src/components/Ctc/login/AuthPage.module.css +0 -26
- package/src/components/Ctc/login/AuthPage.tsx +0 -235
- package/src/components/Ctc/login/index.less +0 -49
- package/src/components/Ctc/login/index.tsx +0 -142
- package/src/components/Ctc/uc/UCLogin.tsx +0 -31
- package/src/components/Ctc/uc/UCPhoneLogin.tsx +0 -62
- package/src/components/Ctc/uc/UCRegister.tsx +0 -37
- package/src/components/Ctc/uc/UCResetPassword.tsx +0 -69
- package/src/components/Ctc/uc/index.tsx +0 -15
- package/src/components/Ctc/userPanel/index.tsx +0 -999
- package/src/components/Ctc/webide/index.tsx +0 -272
- package/src/components/LowCode/LowCodeModel.jsx +0 -962
- package/src/components/LowCode/LowCodePage.jsx +0 -31
- package/src/components/LowCode/LowCodeRuntime.jsx +0 -335
- package/src/components/LowCode/MaterializePage.jsx +0 -235
- package/src/components/LowCode/index.js +0 -1
- package/src/components/MockPlatform/CurlImportModal.jsx +0 -362
- package/src/components/MockPlatform/EndpointsTab.jsx +0 -509
- package/src/components/MockPlatform/EnvironmentsTab.jsx +0 -212
- package/src/components/MockPlatform/MockTemplateHelper.jsx +0 -200
- package/src/components/MockPlatform/OpenApiImportModal.jsx +0 -305
- package/src/components/MockPlatform/RecordingsTab.jsx +0 -397
- package/src/components/MockPlatform/RequestLogsTab.jsx +0 -239
- package/src/components/MockPlatform/ScenariosTab.jsx +0 -236
- package/src/components/MockPlatform/TestCasesTab.jsx +0 -462
- package/src/components/MockPlatform/index.jsx +0 -127
- package/src/components/Overview.jsx +0 -74
- package/src/dev.jsx +0 -28
- package/src/services/agentTeam.js +0 -7
- package/src/services/api.js +0 -84
- package/src/services/ctcAc.js +0 -7
- package/src/services/ctcAcDomain.js +0 -7
- package/src/services/ctcAuthorization.js +0 -7
- package/src/services/ctcSurl.js +0 -7
- package/src/services/ctcUser.js +0 -7
- package/src/services/job.js +0 -7
- package/src/services/metaApp.js +0 -7
- package/src/services/privateConfig.js +0 -7
- package/src/services/webide.js +0 -6
- package/src/services/workspace.js +0 -21
- package/src/utils/request.ts +0 -102
package/LICENSE
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
<<<<<<< HEAD
|
|
4
|
+
Copyright (c) 2026 z-opc-foundation
|
|
5
|
+
=======
|
|
6
|
+
Copyright (c) 2026 z-opc-foundation
|
|
7
|
+
>>>>>>> 037d896 (feat: z-frontend-common 独立仓首版 1.0.0(lead 008 §1-§16 唯一承载仓))
|
|
8
|
+
|
|
9
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
10
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
11
|
+
in the Software without restriction, including without limitation the rights
|
|
12
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
13
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
14
|
+
furnished to do so, subject to the following conditions:
|
|
15
|
+
|
|
16
|
+
The above copyright notice and this permission notice shall be included in all
|
|
17
|
+
copies or substantial portions of the Software.
|
|
18
|
+
|
|
19
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
20
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
21
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
22
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
23
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
24
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
25
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,59 +1,72 @@
|
|
|
1
|
-
#
|
|
1
|
+
# z-frontend-common
|
|
2
2
|
|
|
3
|
-
> z-opc
|
|
3
|
+
> z-opc-foundation 全仓共享前端基座 —— lead 008《前端开发规范》§1-§16 的唯一承载仓。
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
40+ 个 `z-*` 产品仓的 suit 通过同一份 AppLayout / LoginPage 获得一致的
|
|
6
|
+
左菜单架子、登录流程与右上角用户组件;21 个 `<repo>-component` 的 services
|
|
7
|
+
层消费同一份 axios 拦截器工厂。**改一处,全仓同步**。
|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
npm install @yuku123/z-frontend-common
|
|
9
|
-
# 国内用户加速
|
|
10
|
-
# .npmrc: @yuku1231:registry=https://registry.npmmirror.com/
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
## 导出能力
|
|
9
|
+
---
|
|
14
10
|
|
|
15
|
-
|
|
16
|
-
- `AppLayout` — 统一布局(Sider + Header + Content)
|
|
17
|
-
- `StatusTag` — 状态标签
|
|
18
|
-
- `LoginPage` — 统一登录页
|
|
19
|
-
- `ErrorBoundary` — React 错误边界
|
|
11
|
+
## 基本信息
|
|
20
12
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
13
|
+
| 字段 | 值 |
|
|
14
|
+
|------|-----|
|
|
15
|
+
| 仓 | `z-opc-foundation/z-frontend-common`(本仓) |
|
|
16
|
+
| npm 包 | `@yuku123/z-frontend-common`(scope 沿用 yuku123,与 0.1.x/0.2.x 旧线连续) |
|
|
17
|
+
| 当前版本 | `1.0.0` —— 1.0 语义:§1-§16 规范化起点。0.1.x 是 pre-§16 形态;0.2.x 内嵌 react-dom 已废弃 |
|
|
18
|
+
| 技术栈 | React 19 + antd 6 + react-router-dom 7 + Vite 6(lead 005 §3.0 版本线单一尺子) |
|
|
19
|
+
| 产物 | ESM 单文件 `dist/index.js`;react / antd / @ant-design/icons / react-router-dom 全部 external |
|
|
20
|
+
| axios | `dependencies` 内联(`_shared/` vendoring 时期的决策保留:避免消费方从无 node_modules 的目录解析 axios) |
|
|
26
21
|
|
|
27
|
-
##
|
|
28
|
-
|
|
29
|
-
```jsx
|
|
30
|
-
import { AppLayout, LoginPage, request } from '@yuku123/z-frontend-common'
|
|
22
|
+
## 对外 API(与 0.1.1 完全兼容 + 三处升级)
|
|
31
23
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
24
|
+
| 导出 | 说明 |
|
|
25
|
+
|------|------|
|
|
26
|
+
| `AppLayout` | **升级**:§1 sider 双模式品牌区(暗主题显式白字 / 折叠 36×36 圆角图标 + Tooltip)、§11 selectedKey 最长菜单前缀、§12 sider 顶 `产品名@版本`、§15 Header 48px + 1px 下边线、§16 `appUser` 右上角下拉(profile + 退出登录,`loginPath` 按 `menuItems[0].key` 自动推导可覆盖) |
|
|
27
|
+
| `LoginPage` | **升级**:`mockAuth` 双模式 —— 传 `{username, password, user}` 走纯前端校验(CTC/SSO 接入前短期形态);缺省走 `loginApi` 真实端点 |
|
|
28
|
+
| `EmptyState`(占位) | 目录已建,组件下一波随 §2 列表页规范收口时进 |
|
|
29
|
+
| `StatusTag` / `defaultStatusMap` | 0.1.1 契约原样保留 |
|
|
30
|
+
| `ErrorBoundary` | 0.1.1 契约原样保留(antd Result 形态重绘) |
|
|
31
|
+
| `createRequest(options)` | axios 实例工厂:`{baseURL='/api', timeout=10000, tokenKey, userInfoKey, unauthorizedRedirect}`;21 个 component 仓 services 层消费 |
|
|
32
|
+
| `request` / `authRequest` | 预建实例(`createRequest()` 双份,0.1.1 契约) |
|
|
33
|
+
| `setupInterceptors` | 拦截器装配(Bearer token 注入 + 401 清凭跳登录 + 响应解包) |
|
|
34
|
+
| `unwrapResponse` | **新增显式导出**:`{code, data}` 包装解包 / 裸数据透传(z-opc Spring MVC 统一返回体兼容) |
|
|
35
|
+
| `default`(桶) | `{AppLayout, StatusTag, defaultStatusMap, LoginPage, ErrorBoundary, request, authRequest, createRequest}` —— 0.1.1 形状原样 |
|
|
37
36
|
|
|
38
|
-
##
|
|
37
|
+
## AppLayout props
|
|
39
38
|
|
|
40
|
-
```
|
|
41
|
-
|
|
39
|
+
```jsx
|
|
40
|
+
<AppLayout
|
|
41
|
+
menuItems={menuConfig} // antd Menu items,每项必须带 icon(§10)
|
|
42
|
+
appTitle="z-vector" // sider 展开态文字
|
|
43
|
+
appShort="ZV" // 无 appIcon 时折叠态缩写
|
|
44
|
+
appVersion="1.0.5" // §12:展开态渲染 z-vector@1.0.5(不要 "v" 前缀)
|
|
45
|
+
appIcon={{icon, color, label}} // §1:折叠态 36×36 圆角色板 + Tooltip
|
|
46
|
+
appUser={{name, role}} // §16:右上角 Avatar+name+DownOutlined 下拉
|
|
47
|
+
loginPath="/z-vector/login" // 可选,缺省按 menuItems[0].key 自动推导 /<产品>/login
|
|
48
|
+
headerExtra={<.../>} // Header 右侧追加内容(版本号别放这,§12)
|
|
49
|
+
loading={false} // 菜单区 loading 占位
|
|
50
|
+
/>
|
|
42
51
|
```
|
|
43
52
|
|
|
44
|
-
|
|
45
|
-
- 其他 code → reject
|
|
46
|
-
- 响应无 `code` 字段 → pass-through 透传
|
|
53
|
+
## suit 接入模板(lead 008 §16)
|
|
47
54
|
|
|
48
|
-
|
|
55
|
+
```jsx
|
|
56
|
+
import { AppLayout, LoginPage, ErrorBoundary } from '@yuku123/z-frontend-common'
|
|
57
|
+
import { menuConfig, routes, appMeta } from '@yuku123/<repo>-component/pages'
|
|
49
58
|
|
|
50
|
-
|
|
51
|
-
- 业务侧 `res.data.xxx` 写法统一
|
|
59
|
+
const MOCK_AUTH = { username: 'admin', password: '123456', user: { name: 'admin', role: '管理员' } }
|
|
52
60
|
|
|
53
|
-
|
|
61
|
+
// <Route path="/<repo>/login" element={<LoginPage title="<repo> 管理台" mockAuth={MOCK_AUTH} redirectUrl="/<repo>/home" />} />
|
|
62
|
+
// <Route element={<ProtectedShell/>}> 内挂 <AppLayout menuItems={menuConfig} appTitle={appMeta.title} appVersion="…" appUser={user} />
|
|
63
|
+
```
|
|
54
64
|
|
|
55
|
-
|
|
65
|
+
完整模板见 lead 008 §16;出厂自检清单见 §9。
|
|
56
66
|
|
|
57
|
-
##
|
|
67
|
+
## 历史
|
|
58
68
|
|
|
59
|
-
|
|
69
|
+
- `0.1.0 – 0.1.6`:早期形态(pre-§16),源码曾位于 `yuku123/z-opc` 仓的 `z-frontend-common/` 子目录
|
|
70
|
+
- `0.2.x`:内嵌 react-dom 的失败尝试线,已废弃
|
|
71
|
+
- 应急过渡:`z-opc-foundation/_shared/z-frontend-common-local/` vendoring(不入 git,1.0.0 发版后退役)
|
|
72
|
+
- `1.0.0`:独立仓首版 —— 源码自 vendoring 迁入,API 契约兼容 0.1.1,AppLayout/LoginPage 升级 §1-§16 规范版
|