fix(ui): 统一表格筛选分页和用量明细,升级 ESLint
This commit is contained in:
-106
@@ -1,106 +0,0 @@
|
||||
module.exports = {
|
||||
root: true,
|
||||
env: { browser: true, es2021: true, node: true },
|
||||
parserOptions: {
|
||||
ecmaVersion: 2022,
|
||||
sourceType: 'module',
|
||||
ecmaFeatures: { jsx: true },
|
||||
},
|
||||
settings: {
|
||||
react: { version: 'detect' },
|
||||
},
|
||||
plugins: ['header', 'react-hooks', 'react', 'unused-imports'],
|
||||
ignorePatterns: [
|
||||
'dist/**',
|
||||
'node_modules/**',
|
||||
'logs/**',
|
||||
'report/**',
|
||||
'playwright-report/**',
|
||||
'test-results/**',
|
||||
'blob-report/**',
|
||||
'src/assets/brand-icons/*.js',
|
||||
],
|
||||
overrides: [
|
||||
{
|
||||
files: ['**/*.{js,jsx}'],
|
||||
rules: {
|
||||
'no-restricted-imports': [
|
||||
'error',
|
||||
{
|
||||
patterns: [
|
||||
{
|
||||
group: [
|
||||
'@radix-ui/*',
|
||||
'@floating-ui/*',
|
||||
'@lobehub/ui',
|
||||
'@lobehub/ui/*',
|
||||
'@lobehub/icons',
|
||||
'@lobehub/icons/*',
|
||||
'@douyinfe/semi-*',
|
||||
'@headlessui/*',
|
||||
'@mui/*',
|
||||
'@chakra-ui/*',
|
||||
'leva',
|
||||
'leva/*',
|
||||
'antd-style',
|
||||
'react-layout-kit',
|
||||
],
|
||||
message:
|
||||
'Use antd public APIs or the audited local brand SVG assets. Preserve legacy components/ui callback contracts.',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
'header/header': [
|
||||
2,
|
||||
'block',
|
||||
[
|
||||
'',
|
||||
'Copyright (C) 2025 QuantumNous',
|
||||
'',
|
||||
'This program is free software: you can redistribute it and/or modify',
|
||||
'it under the terms of the GNU Affero General Public License as',
|
||||
'published by the Free Software Foundation, either version 3 of the',
|
||||
'License, or (at your option) any later version.',
|
||||
'',
|
||||
'This program is distributed in the hope that it will be useful,',
|
||||
'but WITHOUT ANY WARRANTY; without even the implied warranty of',
|
||||
'MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the',
|
||||
'GNU Affero General Public License for more details.',
|
||||
'',
|
||||
'You should have received a copy of the GNU Affero General Public License',
|
||||
'along with this program. If not, see <https://www.gnu.org/licenses/>.',
|
||||
'',
|
||||
'For commercial licensing, please contact support@quantumnous.com',
|
||||
'',
|
||||
],
|
||||
],
|
||||
'no-multiple-empty-lines': ['error', { max: 1 }],
|
||||
|
||||
// ===== 防线:杜绝“用了未定义/未导入标识符”导致的运行时崩溃(本次线上事故根因)=====
|
||||
// 让规则识别 JSX 中使用到的组件/React,避免误报。
|
||||
'react/jsx-uses-vars': 'error',
|
||||
'react/jsx-uses-react': 'error',
|
||||
// 未定义标识符 = 直接报错(构建/CI 即拦截)。
|
||||
'no-undef': 'error',
|
||||
// 未使用的 import = error 且可 --fix 自动移除(含 JSX/副作用识别);
|
||||
// 未使用的变量 = warn(不阻断,下划线前缀豁免)。
|
||||
'no-unused-vars': 'off',
|
||||
'unused-imports/no-unused-imports': 'error',
|
||||
'unused-imports/no-unused-vars': [
|
||||
'warn',
|
||||
{
|
||||
vars: 'all',
|
||||
varsIgnorePattern: '^_',
|
||||
args: 'none',
|
||||
argsIgnorePattern: '^_',
|
||||
ignoreRestSiblings: true,
|
||||
},
|
||||
],
|
||||
// React Hooks 规则。
|
||||
'react-hooks/rules-of-hooks': 'error',
|
||||
'react-hooks/exhaustive-deps': 'warn',
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
@@ -55,7 +55,7 @@ npm run dev
|
||||
/api /v1 /v1beta /mj /pg /dashboard /kling /jimeng /suno
|
||||
```
|
||||
|
||||
切换联调后端时修改 `.env.development.local` 中的 `DEV_PROXY_TARGET` 并重启服务;该变量只供 Vite 代理使用,不会暴露给浏览器。生产环境需由 Nginx 或网关配置同源反向代理,`package.json` 中的 `proxy` 字段不生效。
|
||||
切换联调后端时修改 `.env.development.local` 中的 `DEV_PROXY_TARGET` 并重启服务;该变量只供 Vite 代理使用,不会暴露给浏览器。生产环境需由 Nginx 或网关配置同源反向代理,Vite 开发代理不会进入生产产物。
|
||||
|
||||
### 可选:直接访问独立后端域名
|
||||
|
||||
|
||||
@@ -10,6 +10,54 @@
|
||||
|
||||
## 2026-11-19
|
||||
|
||||
### 更新 · ESLint 9
|
||||
|
||||
- **范围**:JavaScript / JSX 静态检查与 UI 依赖审计。
|
||||
- **变更**:升级至 ESLint 9.39.5 并迁移为扁平配置,保留原有检查规则。
|
||||
- **影响**:不改变应用运行时依赖。
|
||||
- **回滚**:同步还原配置、依赖锁文件和 UI 审计脚本的本条差异。
|
||||
- **关联**:`eslint.config.cjs`、`scripts/check-ui-dependencies.mjs`。
|
||||
|
||||
### 调整 · 对齐操作审计筛选栏
|
||||
|
||||
- **范围**:企业审计日志的「操作审计」页签。
|
||||
- **变更**:复用用户中心密钥管理的筛选表单布局、按钮与移动端折叠。
|
||||
- **影响**:保留操作类型、选择即筛选、重置、搜索和刷新逻辑;不影响「提示词记录」。
|
||||
- **回滚**:仅还原本条涉及的操作审计筛选栏改动。
|
||||
- **关联**:`src/pages/Organization/OrgAudit.jsx`。
|
||||
|
||||
### 调整 · 收窄表格「更多」菜单的使用范围
|
||||
|
||||
- **范围**:此前接入公共行操作菜单的表格。
|
||||
- **变更**:仅用户列表与合作伙伴列表保留新版「更多」,其他列表恢复原操作入口。
|
||||
- **影响**:保留现有权限、业务回调、筛选、分页及空态。
|
||||
- **回滚**:仅还原本条菜单差异,不覆盖其他页面改动。
|
||||
- **关联**:`src/components/common/table/TableToolbar.jsx`、`docs/standards/UI_COMPONENT_STANDARDS.md`。
|
||||
|
||||
### 调整 · 企业表格分页与用量明细对齐
|
||||
|
||||
- **范围**:企业中心表格、企业密钥列表、用户中心调用明细及控制台使用明细。
|
||||
- **变更**:企业表格统一底部分页;密钥表按可见列宽度滚动;两端共用「用时 / 首字」标签和居中样式,调用明细与使用明细的操作入口均显示「详情」。
|
||||
- **影响**:前端分页不追加请求,接口分页沿用原有查询,树形数据保留父子关系。
|
||||
- **回滚**:只还原本条涉及的企业列表、分页适配和用量明细改动。
|
||||
- **关联**:`docs/ui/ORG_CENTER_SPEC.md`、`src/components/table/usage-logs/UsageLogsColumnDefs.jsx`。
|
||||
|
||||
### 调整 · 列表筛选、工具栏及分页对齐密钥管理
|
||||
|
||||
- **范围**:平台、企业、个人分佣,兑换码、会员卡、发票和用户中心密钥管理,含页签及明细表格。
|
||||
- **变更**:共享搜索按钮、筛选栅格和工具栏布局,统一分页总数、每页条数与切换行为。
|
||||
- **影响**:保留现有权限、接口用途和即时筛选;分佣档位每页条数传入列表请求,导出仍读取完整结果。
|
||||
- **回滚**:只还原本条所列的组件、分页和规范改动。
|
||||
- **关联**:`docs/standards/UI_COMPONENT_STANDARDS.md`、`src/components/console/ConsoleCollection.jsx`。
|
||||
|
||||
### 清理 · 移除无效的旧代理配置
|
||||
|
||||
- **范围**:前端包配置与联调说明。
|
||||
- **变更**:删除 `package.json` 中 Vite 不读取的 `proxy` 字段。
|
||||
- **影响**:不改变依赖、锁文件、本地联调后端或生产网关。
|
||||
- **回滚**:仅还原本条涉及的包配置与文档。
|
||||
- **关联**:`package.json`、`vite.config.js`、`README.md`。
|
||||
|
||||
### 修复 · 并发请求失败与会话过期提示
|
||||
|
||||
- **范围**:统一请求工具、登录入口及企业预算的关联查询。
|
||||
|
||||
@@ -132,7 +132,9 @@ html.dark .km-page {
|
||||
- 行为:搜索与重置都回到第 1 页;重置 = 清空表单 + 以默认条件重新查询;只切换筛选的页签放在筛选卡上方。
|
||||
- 移动端:用户中心与控制台默认收起,通过“显示 / 隐藏操作项”或“筛选”按钮展开;列设置入口不随筛选收起。
|
||||
- 控制台使用 `ConsoleSearchBar` + `ConsoleSearchActions`,企业中心使用 `OrgFilterCard`,不要另写网格。
|
||||
- 控制台标准列表以 `/console/token` 为参考:使用 `ConsoleCollection`(或通过 `CardPro` 接入),控件走共享筛选栅格(三列、≤ 1100px 两列、≤ 768px 单列),在列表卡内单列工具栏;快捷筛选在左,批量、刷新、新建等列表动作在右。不要把列表动作插进搜索字段区,也不要为了对齐而新增无业务语义的按钮。
|
||||
- 标准列表以 `/console/token` 为参考,覆盖控制台分佣、兑换码、会员卡和发票,企业及个人分佣,以及用户中心密钥管理(含各自子页、页签和详情列表)。使用 `ConsoleCollection`(或通过 `CardPro` 接入);独立列表可用 `ConsoleCollectionSearch` + `ConsoleFilterGrid`。筛选栅格为三列、≤ 1100px 两列、≤ 768px 单列。
|
||||
- 搜索操作在筛选卡右下,先默认样式“重置”(无图标),再带放大镜的主按钮“搜索”;点击和回车共用同一个提交入口。保留原有即时筛选及请求方式,移动端统一通过“显示/隐藏操作项”切换。
|
||||
- 工具栏在列表卡内、表格上方:列表标题、计数或快捷筛选在左;已有的批量、导出、刷新、列设置、新建等动作在右,主操作尽量靠右,使用公共操作图标和清晰文案。窗口变窄时自然换行。只读明细若没有筛选或业务动作,不新增占位按钮。
|
||||
|
||||
## 5. 表格
|
||||
|
||||
@@ -150,7 +152,7 @@ html.dark .km-page {
|
||||
|
||||
- 每列显式 `width`,长文本 `ellipsis` 并配 `Tooltip`;金额与数量右对齐;时间统一格式,必要时日期与时间分两行。
|
||||
- 状态列用 `Tag` 或 `Switch`(见第 11 节);启停开关请求中禁用,失败恢复原状态。
|
||||
- 操作列放在最后,标题固定为“操作”,按钮为 `type='link' size='small'`,同一行操作间距 8px;用户中心、企业中心、控制台(含系统设置)的操作列统一 `fixed: 'right'`。多操作列表以 `/console/commission?view=partners` 为参考:使用 `TableRowActions`,直出 1–2 个高频动作(如“详情”“编辑”),其余放进带下箭头的文字“更多”菜单。菜单点击打开、右对齐,无有效菜单项时不渲染入口;危险项置末、标记 `danger` 并保留业务确认。现有权限、状态限制、禁用项和回调不得因收纳而改变,方向键、Enter、Escape 可操作菜单。
|
||||
- 操作列放在最后,标题固定为“操作”,按钮为 `type='link' size='small'`,同一行操作间距 8px;用户中心、企业中心、控制台(含系统设置)的操作列统一 `fixed: 'right'`。`/console/user` 的用户列表和 `/console/commission?view=partners` 的合作伙伴列表使用 `TableRowActions`:直出高频动作,其余放进带下箭头的文字“更多”菜单。其他列表沿用既有操作呈现方式,不批量套用此菜单。菜单点击打开、右对齐,无有效菜单项时不渲染入口;危险项置末、标记 `danger` 并保留业务确认。现有权限、状态限制、禁用项和回调不得因收纳而改变,方向键、Enter、Escape 可操作菜单。
|
||||
- 三中心表格通过 `CenterActionTable` 统一处理,最后一列存在创建、查看、编辑、测试、详情、删除、添加、设置、配置、弹窗 / 抽屉或请求交互时,列头统一显示“操作”并固定右侧,宽度按按钮 / 交互数量计算。没有操作列但估算列宽超出容器时,从右侧固定末 4 列,列数不足时降为 3、2、1 列。固定列使用不透明底色并保持表头层级;横向滚动条遵循 Ant Design 官方固定列表格行为,允许鼠标、触控板、触屏和键盘滚动,不隐藏滚动条。
|
||||
- 列显隐只在已有列设置的表格中提供,统一使用 `ColumnSettings`(见 `docs/ui/TABLE_COLUMN_SETTINGS_SPEC.md`)。
|
||||
- 三中心表头背景统一由 `center-table.css` 绘制:页面通过 `--center-table-head-bg` 提供色调,公共层在不透明的容器底色上叠加同色填充,普通列与固定列保持一致;页面不再直接覆盖表头 `background`。固定列使用 antd 6 的 `.ant-table-cell-fix` 与原生动态层级,不写死 `z-index`,不使用旧版 `fix-left` / `fix-right` 类名补丁;表头不换行,表头与正文沿用同一列宽和对齐方式。
|
||||
@@ -168,8 +170,8 @@ html.dark .km-page {
|
||||
|
||||
- 位置:列表卡底部右对齐,上距 16px;移动端换行显示并提供快速跳页。
|
||||
- 外观:小尺寸,可切换每页条数 `[10, 20, 50, 100]`,总数文案 `t('共 {{total}} 条', { total })`。
|
||||
- 用法:分页列表使用 `@/components/ui` 的 `Table` / `Pagination`,传 `currentPage`、`pageSize`、`total`、`onPageChange(page)`、`onPageSizeChange(size)`。`/console`、`/org` 下由封装自动统一外观与回调;其他路由需显式传 `showSizeChanger`、`pageSizeOpts`、`showTotal`,并设置 `preventPageChangeOnPageSizeChange: true`,避免改页容量时请求两次。
|
||||
- 删除当前页最后一条后回到上一页;前端分页的列表在筛选或数据变化时回到第 1 页。
|
||||
- 用法:分页列表使用 `@/components/ui` 的 `Table` / `Pagination`。第 4 节的标准列表及其明细分页均沿用密钥管理:表格底部右对齐、小尺寸,依次显示“共 N 条”、上一页/页码/下一页、每页条数(10、20、50、100),移动端保留跳页。已加载的明细可本地分页;服务端分页传 `currentPage`、`pageSize`、`total` 以及分页回调,切换每页条数回到第 1 页,只发一次请求。导出仍作用于原有结果范围,不受当前页条数影响。
|
||||
- 删除当前页最后一条后回到上一页;前端分页的列表在筛选或数据变化时回到第 1 页。`/org/*` 的独立表格、页签和下钻明细均用此分页规则;已加载的树形表格按根节点分页,子节点不拆散;接口已分页时沿用原查询与总数。
|
||||
|
||||
## 7. 表单项
|
||||
|
||||
@@ -243,7 +245,7 @@ html.dark .km-page {
|
||||
|
||||
组件分层(antd 原生、中心封装、契约封装、专用组件)及选用方式见 `DEV_STANDARDS.md` 2.1、2.2 节。`src/components/ui/*` 只做视图映射,不放请求、权限与业务状态。
|
||||
|
||||
- 禁止导入:`@lobehub/*`、Radix UI、Floating UI、Semi、MUI、Chakra、Headless UI、leva、antd-style、react-layout-kit(`.eslintrc.cjs` 的 `no-restricted-imports`)。
|
||||
- 禁止导入:`@lobehub/*`、Radix UI、Floating UI、Semi、MUI、Chakra、Headless UI、leva、antd-style、react-layout-kit(`eslint.config.cjs` 的 `no-restricted-imports`)。
|
||||
- `npm run check:ui` 审计源码导入、完整 lock 图与品牌图标资产 hash,已包含在 `npm run check` 中。
|
||||
- `antd` 与 `@ant-design/icons` 精确锁定版本;`src/components/ui/antd-v5-compat.css` 统一标签间距、分页选择器宽度与必填标记字体,页面样式可以覆盖。
|
||||
- 当前版本 API 约定:Card 用 `variant`,Drawer 用 `size`,弹层遮罩用 `mask` 配置,Alert 标题用 `title`;样式选择器使用 `.ant-modal-container`、`.ant-alert-title`、`.ant-collapse-body`。聊天消息列表使用 `List`(antd 已标记弃用),替换前需先建立该区域的视觉基线。
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
- 视觉依据:在线原型 `http://192.168.0.161:8888` 顶栏“企业中心”(深色用“切换至暗色主题”),只作视觉依据,不作业务、路由、数据依据。
|
||||
- 只对齐背景、字体、图标、表格、表单、卡片、页签、搜索条件、操作列、弹窗、按钮、颜色、文字、间距与已有交互反馈;不改请求、载荷、状态、路由、权限与触发条件。
|
||||
- 原型有而系统无的功能不补建:员工筛选卡、CSV 导出、尺寸切换分页、新建员工 / 分配角色 / 离职、角色管理、在职 / 离职筛选、订单号搜索、分组列、发票入口。例外:企业密钥管理的分组列与列设置已按需求实现。
|
||||
- 原型有而系统无的功能不补建:员工筛选卡、CSV 导出、新建员工 / 分配角色 / 离职、角色管理、在职 / 离职筛选、订单号搜索、分组列、发票入口。例外:企业密钥管理的分组列与列设置已按需求实现。
|
||||
|
||||
## 2. 作用域与变量
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
通用卡片、筛选栏、表格、分页、弹层、页签、标签样式按 `UI_COMPONENT_STANDARDS.md`;企业中心的差异如下。
|
||||
|
||||
- **页头**:`OrgPageHeader`(内部复用 `UserCenterPageHeader`),规格见 `GLOBAL_UI_BASELINE.md` 4.4;页头不放操作按钮,操作移入列表卡头。面包屑分组见 4.4 第 3 条。
|
||||
- **列表卡 `OrgListCard`**:卡头与表格间距 20px;表格为紧凑变体(正文 13px,表头 12px / 500、底色 `--oc-soft`,行上下内边距 17px);分页不提供每页条数切换。
|
||||
- **列表卡 `OrgListCard`**:卡头与表格间距 20px;表格为紧凑变体(正文 13px,表头 12px / 500、底色 `--oc-soft`,行上下内边距 17px);分页按公共组件规范,覆盖页签及表格明细。
|
||||
- **筛选卡 `OrgFilterCard`**:固定 3 列;筛选取值与生效时机沿用原页面(审计日志为“选择即筛选”,“搜索”以当前条件重新查询)。
|
||||
- **行操作 `OrgRowActions`**:link 按钮 13 / 24px、无内边距、间距 10px,不带图标。
|
||||
- **列表页签 `.oc-list-tabs`**:导航高 44px,页签内边距 12px 0,选中与悬停色为 `--oc-brand`;只切换筛选时加 `.oc-tabs-nav-only`。
|
||||
@@ -66,9 +66,9 @@
|
||||
| 数据看板 | `oc-dash-*` hero(健康提示“企业运行正常”、企业名、企业额度、组织概况)+ `OrgAnalyticsPanel`(汇总条、趋势 `Segmented`、分布、明细页签) | 时间范围 7 / 30 / 90 天;企业名来自 `orgInfo.name`,无值时隐藏 |
|
||||
| 员工管理 | 页签(员工权限 / 员工账号)+ 列表卡;首列与操作列固定;备注独立列;状态 `Switch` | 无筛选卡与在职 / 离职页签 |
|
||||
| 项目管理 | `OrgListCard` + link 操作(模型 / 分组 / 成员 / 密钥 / 编辑);状态开关 | 操作列不再显示“停用” |
|
||||
| 预算中心 | `.oc-policy` 固定说明条;列宽 300 / 110 / 260 / 120 / 120 / 130;状态开关 | 无分页 |
|
||||
| 预算中心 | `.oc-policy` 固定说明条;列宽 300 / 110 / 260 / 120 / 120 / 130;状态开关 | 已加载数据前端分页 |
|
||||
| 审批中心 | 状态页签(回调 `setStatusFilter`)+ 申请列表卡;拒绝弹窗竖排表单项 | — |
|
||||
| 密钥管理 | 密钥框 + 显隐 / 复制、可用模型 link、分组列、状态开关、绝对时间;列设置用共享组件;创建 / 编辑为 560px `OrgSideSheet` | 列设置只在当前页面生效 |
|
||||
| 密钥管理 | 密钥框 + 显隐 / 复制、可用模型 link、分组列、状态开关、绝对时间;列设置用共享组件;创建 / 编辑为 560px `OrgSideSheet` | 列设置只在当前页面生效;非操作列整体横向滚动,仅在可见列宽度超过容器时显示滚动条 |
|
||||
| 企业充值 | 企业钱包 + 充值工作区(额度卡 / 自定义 / 支付方式)+ 订单卡 + 记录;订单“立即充值”与支付方式点击同为 `handlePreTopUp` | 档位与折扣来自后台配置;无订单号搜索与发票入口 |
|
||||
| 消耗明细 | 统计卡 + 页签(明细日志 / 成员排行 / 绘图与视频)+ 三列筛选卡 + 列表卡;查询按钮为“搜索”(`handleSearch`) | 见第 5 节 |
|
||||
| 审计日志 | 页签 + 筛选卡(操作类型)+ 操作记录卡;“提示词记录”页签沿用原显隐 | — |
|
||||
@@ -79,18 +79,18 @@
|
||||
|
||||
- 剩余额度提示按未取整占比判定:> 20% 为“可用额度充足”(`#438568`),0 < 占比 ≤ 20% 为“可用额度偏低”(`#9c6b25`),≤ 0 为“可用额度已用尽”(`#b34c4c`);数据无效时隐藏,仅作提示,不影响计费或拦截。
|
||||
- 多维用量分析工具组用原生 `Select` / `Button`:维度 132px、时间 86px、刷新 34px,高 34px、间距 8px。
|
||||
- 模型明细使用已加载数据做前端分页(每页 10 条),翻页不请求接口,维度、时间或数据变化时回到第一页;表格随页面自然展开,仅窄屏横向滚动。
|
||||
- 模型明细使用已加载数据做前端分页(默认每页 10 条),翻页不请求接口,维度、时间或数据变化时回到第一页;表格随页面自然展开,仅窄屏横向滚动。
|
||||
|
||||
## 5. 消耗明细(/org/logs)
|
||||
|
||||
- 绘图与视频由 `components/OrgTaskRecords.jsx` 呈现,复用 `useTaskLogsData({ organizationMode: true })`、`TaskLogsFilters`、`getTaskLogsColumns`、`exportTaskLogsPageCsv`、`ColumnSelectorModal`、`ContentModal`;结构为筛选卡 + “任务记录”列表卡(导出本页 / 刷新 / 列设置),不渲染“本页统计”区块,移动端筛选直接展开。
|
||||
- 任务表列宽 185 / 185 / 110 / 110 / 250 / 330 / 110 / 155 / 145 / 150;模型为行内胶囊,费用主色右对齐;分页 10 / 20 / 50,“共 N 条”。“刷新”与“搜索”调用同一 `refresh`。
|
||||
- 任务表列宽 185 / 185 / 110 / 110 / 250 / 330 / 110 / 155 / 145 / 150;模型为行内胶囊,费用主色右对齐;分页沿用公共规范。“刷新”与“搜索”调用同一 `refresh`。
|
||||
- 时间范围为本页签自有的可编辑字段(默认最近 7 天,含快捷预设),与“明细日志”筛选互不影响;起止颠倒沿用原提示。
|
||||
- 末列“操作”不固定:视频任务显示“点击预览视频”,失败任务保留失败原因查看,其余显示“-”。
|
||||
- 预览视频沿用 `ContentModal`:标题栏“视频预览”与关闭按钮、16:9 播放区、加载态、播放失败或无地址时 `Empty` 空态、页脚复制链接 / 新标签页打开 / 关闭;关闭时暂停视频,重开同一视频不残留加载指示。
|
||||
- 成员排行行键使用 `user_id-名次序号`,避免后端同一成员多行时出现重复 key。
|
||||
- 明细日志查询不写 URL;绘图与视频筛选沿用原有 URL 同步。
|
||||
- 保留差异:明细日志无列设置、分组列、操作列与尺寸切换;任务表无渠道 / 用户 ID 筛选、平台列、排序与任务 ID 复制。
|
||||
- 保留差异:明细日志无列设置、分组列、操作列;任务表无渠道 / 用户 ID 筛选、平台列、排序与任务 ID 复制。
|
||||
|
||||
## 6. 验收要点
|
||||
|
||||
|
||||
@@ -0,0 +1,133 @@
|
||||
const globals = require('globals');
|
||||
const { rules: headerRules } = require('eslint-plugin-header');
|
||||
const react = require('eslint-plugin-react');
|
||||
const reactHooks = require('eslint-plugin-react-hooks');
|
||||
const unusedImports = require('eslint-plugin-unused-imports');
|
||||
|
||||
const headerRule = headerRules.header;
|
||||
const header = {
|
||||
rules: {
|
||||
header: {
|
||||
...headerRule,
|
||||
meta: {
|
||||
...headerRule.meta,
|
||||
schema: [
|
||||
{ enum: ['block', 'line'] },
|
||||
{ type: 'array', items: { type: 'string' } },
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
module.exports = [
|
||||
{
|
||||
ignores: [
|
||||
'**/.*',
|
||||
'dist/**',
|
||||
'node_modules/**',
|
||||
'logs/**',
|
||||
'report/**',
|
||||
'playwright-report/**',
|
||||
'test-results/**',
|
||||
'blob-report/**',
|
||||
'src/assets/brand-icons/*.js',
|
||||
],
|
||||
},
|
||||
{
|
||||
files: ['**/*.{js,jsx}'],
|
||||
linterOptions: { reportUnusedDisableDirectives: 'off' },
|
||||
languageOptions: {
|
||||
ecmaVersion: 2022,
|
||||
sourceType: 'module',
|
||||
parserOptions: { ecmaFeatures: { jsx: true } },
|
||||
globals: { ...globals.browser, ...globals.node, ...globals.es2021 },
|
||||
},
|
||||
settings: { react: { version: 'detect' } },
|
||||
plugins: {
|
||||
header,
|
||||
react,
|
||||
'react-hooks': reactHooks,
|
||||
'unused-imports': unusedImports,
|
||||
},
|
||||
rules: {
|
||||
'no-restricted-imports': [
|
||||
'error',
|
||||
{
|
||||
patterns: [
|
||||
{
|
||||
group: [
|
||||
'@radix-ui/*',
|
||||
'@floating-ui/*',
|
||||
'@lobehub/ui',
|
||||
'@lobehub/ui/*',
|
||||
'@lobehub/icons',
|
||||
'@lobehub/icons/*',
|
||||
'@douyinfe/semi-*',
|
||||
'@headlessui/*',
|
||||
'@mui/*',
|
||||
'@chakra-ui/*',
|
||||
'leva',
|
||||
'leva/*',
|
||||
'antd-style',
|
||||
'react-layout-kit',
|
||||
],
|
||||
message:
|
||||
'Use antd public APIs or the audited local brand SVG assets. Preserve legacy components/ui callback contracts.',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
'header/header': [
|
||||
2,
|
||||
'block',
|
||||
[
|
||||
'',
|
||||
'Copyright (C) 2025 QuantumNous',
|
||||
'',
|
||||
'This program is free software: you can redistribute it and/or modify',
|
||||
'it under the terms of the GNU Affero General Public License as',
|
||||
'published by the Free Software Foundation, either version 3 of the',
|
||||
'License, or (at your option) any later version.',
|
||||
'',
|
||||
'This program is distributed in the hope that it will be useful,',
|
||||
'but WITHOUT ANY WARRANTY; without even the implied warranty of',
|
||||
'MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the',
|
||||
'GNU Affero General Public License for more details.',
|
||||
'',
|
||||
'You should have received a copy of the GNU Affero General Public License',
|
||||
'along with this program. If not, see <https://www.gnu.org/licenses/>.',
|
||||
'',
|
||||
'For commercial licensing, please contact support@quantumnous.com',
|
||||
'',
|
||||
],
|
||||
],
|
||||
'no-multiple-empty-lines': ['error', { max: 1 }],
|
||||
|
||||
// ===== 防线:杜绝“用了未定义/未导入标识符”导致的运行时崩溃(本次线上事故根因)=====
|
||||
// 让规则识别 JSX 中使用到的组件/React,避免误报。
|
||||
'react/jsx-uses-vars': 'error',
|
||||
'react/jsx-uses-react': 'error',
|
||||
// 未定义标识符 = 直接报错(构建/CI 即拦截)。
|
||||
'no-undef': 'error',
|
||||
// 未使用的 import = error 且可 --fix 自动移除(含 JSX/副作用识别);
|
||||
// 未使用的变量 = warn(不阻断,下划线前缀豁免)。
|
||||
'no-unused-vars': 'off',
|
||||
'unused-imports/no-unused-imports': 'error',
|
||||
'unused-imports/no-unused-vars': [
|
||||
'warn',
|
||||
{
|
||||
vars: 'all',
|
||||
varsIgnorePattern: '^_',
|
||||
args: 'none',
|
||||
caughtErrors: 'none',
|
||||
argsIgnorePattern: '^_',
|
||||
ignoreRestSiblings: true,
|
||||
},
|
||||
],
|
||||
// React Hooks 规则。
|
||||
'react-hooks/rules-of-hooks': 'error',
|
||||
'react-hooks/exhaustive-deps': 'warn',
|
||||
},
|
||||
},
|
||||
];
|
||||
Generated
+238
-246
@@ -1,11 +1,11 @@
|
||||
{
|
||||
"name": "react-template",
|
||||
"name": "monkey-ai-web",
|
||||
"version": "0.1.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "react-template",
|
||||
"name": "monkey-ai-web",
|
||||
"version": "0.1.0",
|
||||
"dependencies": {
|
||||
"@ant-design/icons": "6.3.4",
|
||||
@@ -56,11 +56,12 @@
|
||||
"@vitejs/plugin-react": "^4.2.1",
|
||||
"autoprefixer": "^10.4.21",
|
||||
"esbuild": "0.21.5",
|
||||
"eslint": "8.57.0",
|
||||
"eslint": "9.39.5",
|
||||
"eslint-plugin-header": "^3.1.1",
|
||||
"eslint-plugin-react": "^7.37.5",
|
||||
"eslint-plugin-react-hooks": "^5.2.0",
|
||||
"eslint-plugin-unused-imports": "^3.2.0",
|
||||
"eslint-plugin-unused-imports": "4.4.1",
|
||||
"globals": "16.5.0",
|
||||
"i18next-cli": "^1.10.3",
|
||||
"postcss": "^8.5.3",
|
||||
"prettier": "^3.0.0",
|
||||
@@ -961,38 +962,119 @@
|
||||
"node": "^12.0.0 || ^14.0.0 || >=16.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@eslint/config-array": {
|
||||
"version": "0.21.2",
|
||||
"resolved": "https://registry.npmmirror.com/@eslint/config-array/-/config-array-0.21.2.tgz",
|
||||
"integrity": "sha512-nJl2KGTlrf9GjLimgIru+V/mzgSK0ABCDQRvxw5BjURL7WfH5uoWmizbH7QB6MmnMBd8cIC9uceWnezL1VZWWw==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@eslint/object-schema": "^2.1.7",
|
||||
"debug": "^4.3.1",
|
||||
"minimatch": "^3.1.5"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@eslint/config-helpers": {
|
||||
"version": "0.4.2",
|
||||
"resolved": "https://registry.npmmirror.com/@eslint/config-helpers/-/config-helpers-0.4.2.tgz",
|
||||
"integrity": "sha512-gBrxN88gOIf3R7ja5K9slwNayVcZgK6SOUORm2uBzTeIEfeVaIhOpCtTox3P6R7o2jLFwLFTLnC7kU/RGcYEgw==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@eslint/core": "^0.17.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@eslint/core": {
|
||||
"version": "0.17.0",
|
||||
"resolved": "https://registry.npmmirror.com/@eslint/core/-/core-0.17.0.tgz",
|
||||
"integrity": "sha512-yL/sLrpmtDaFEiUj1osRP4TI2MDz1AddJL+jZ7KSqvBuliN4xqYY54IfdN8qD8Toa6g1iloph1fxQNkjOxrrpQ==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@types/json-schema": "^7.0.15"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@eslint/eslintrc": {
|
||||
"version": "2.1.4",
|
||||
"resolved": "https://registry.npmmirror.com/@eslint/eslintrc/-/eslintrc-2.1.4.tgz",
|
||||
"integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==",
|
||||
"version": "3.3.7",
|
||||
"resolved": "https://registry.npmmirror.com/@eslint/eslintrc/-/eslintrc-3.3.7.tgz",
|
||||
"integrity": "sha512-F42g89Qd5oAWtp0k0nnSrjziAKza7w8SVT4mStc18LZMaRb4J1HQAHLCalEtDCxrTuksx7NU9qsmeLwpOfPqWw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"ajv": "^6.12.4",
|
||||
"ajv": "^6.14.0",
|
||||
"debug": "^4.3.2",
|
||||
"espree": "^9.6.0",
|
||||
"globals": "^13.19.0",
|
||||
"espree": "^10.0.1",
|
||||
"globals": "^14.0.0",
|
||||
"ignore": "^5.2.0",
|
||||
"import-fresh": "^3.2.1",
|
||||
"js-yaml": "^4.1.0",
|
||||
"minimatch": "^3.1.2",
|
||||
"js-yaml": "^4.3.2",
|
||||
"minimatch": "^3.1.5",
|
||||
"strip-json-comments": "^3.1.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
|
||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://opencollective.com/eslint"
|
||||
}
|
||||
},
|
||||
"node_modules/@eslint/js": {
|
||||
"version": "8.57.0",
|
||||
"resolved": "https://registry.npmmirror.com/@eslint/js/-/js-8.57.0.tgz",
|
||||
"integrity": "sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==",
|
||||
"node_modules/@eslint/eslintrc/node_modules/globals": {
|
||||
"version": "14.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/globals/-/globals-14.0.0.tgz",
|
||||
"integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
|
||||
"node": ">=18"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/@eslint/js": {
|
||||
"version": "9.39.5",
|
||||
"resolved": "https://registry.npmmirror.com/@eslint/js/-/js-9.39.5.tgz",
|
||||
"integrity": "sha512-QywQuszQh77pIXCsq998c8hbhSTI/azTty1Z6N53dmAudKHhy573j3yvRLsX2BSp8YpLtoCEG8E9DJe+8zUh4A==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://eslint.org/donate"
|
||||
}
|
||||
},
|
||||
"node_modules/@eslint/object-schema": {
|
||||
"version": "2.1.7",
|
||||
"resolved": "https://registry.npmmirror.com/@eslint/object-schema/-/object-schema-2.1.7.tgz",
|
||||
"integrity": "sha512-VtAOaymWVfZcmZbp6E2mympDIHvyjXs/12LqWYjVw6qjrfF+VK+fyG33kChz3nnK+SU5/NeHOqrTEHS8sXO3OA==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"engines": {
|
||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@eslint/plugin-kit": {
|
||||
"version": "0.4.1",
|
||||
"resolved": "https://registry.npmmirror.com/@eslint/plugin-kit/-/plugin-kit-0.4.1.tgz",
|
||||
"integrity": "sha512-43/qtrDUokr7LJqoF2c3+RInu/t4zfrpYdoSDfYyhg52rwLV6TnOvdG4fXm7IkSB3wErkcmJS9iEhjVtOSEjjA==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@eslint/core": "^0.17.0",
|
||||
"levn": "^0.4.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@formatjs/icu-messageformat-parser": {
|
||||
@@ -1018,20 +1100,42 @@
|
||||
"integrity": "sha512-I7xWjLs2YSVMc5gGx1Z3ZG1lgFpITPndpi8Ku55GeEIKpACCPQNS/OTqQbxgTCfq0Ncvcc+CrFov96itVh6Qvw==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@humanwhocodes/config-array": {
|
||||
"version": "0.11.14",
|
||||
"resolved": "https://registry.npmmirror.com/@humanwhocodes/config-array/-/config-array-0.11.14.tgz",
|
||||
"integrity": "sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==",
|
||||
"deprecated": "Use @eslint/config-array instead",
|
||||
"node_modules/@humanfs/core": {
|
||||
"version": "0.19.2",
|
||||
"resolved": "https://registry.npmmirror.com/@humanfs/core/-/core-0.19.2.tgz",
|
||||
"integrity": "sha512-UhXNm+CFMWcbChXywFwkmhqjs3PRCmcSa/hfBgLIb7oQ5HNb1wS0icWsGtSAUNgefHeI+eBrA8I1fxmbHsGdvA==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@humanwhocodes/object-schema": "^2.0.2",
|
||||
"debug": "^4.3.1",
|
||||
"minimatch": "^3.0.5"
|
||||
"@humanfs/types": "^0.15.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10.10.0"
|
||||
"node": ">=18.18.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@humanfs/node": {
|
||||
"version": "0.16.8",
|
||||
"resolved": "https://registry.npmmirror.com/@humanfs/node/-/node-0.16.8.tgz",
|
||||
"integrity": "sha512-gE1eQNZ3R++kTzFUpdGlpmy8kDZD/MLyHqDwqjkVQI0JMdI1D51sy1H958PNXYkM2rAac7e5/CnIKZrHtPh3BQ==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@humanfs/core": "^0.19.2",
|
||||
"@humanfs/types": "^0.15.0",
|
||||
"@humanwhocodes/retry": "^0.4.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18.18.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@humanfs/types": {
|
||||
"version": "0.15.0",
|
||||
"resolved": "https://registry.npmmirror.com/@humanfs/types/-/types-0.15.0.tgz",
|
||||
"integrity": "sha512-ZZ1w0aoQkwuUuC7Yf+7sdeaNfqQiiLcSRbfI08oAxqLtpXQr9AIVX7Ay7HLDuiLYAaFPu8oBYNq/QIi9URHJ3Q==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"engines": {
|
||||
"node": ">=18.18.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@humanwhocodes/module-importer": {
|
||||
@@ -1048,13 +1152,19 @@
|
||||
"url": "https://github.com/sponsors/nzakas"
|
||||
}
|
||||
},
|
||||
"node_modules/@humanwhocodes/object-schema": {
|
||||
"version": "2.0.3",
|
||||
"resolved": "https://registry.npmmirror.com/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz",
|
||||
"integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==",
|
||||
"deprecated": "Use @eslint/object-schema instead",
|
||||
"node_modules/@humanwhocodes/retry": {
|
||||
"version": "0.4.3",
|
||||
"resolved": "https://registry.npmmirror.com/@humanwhocodes/retry/-/retry-0.4.3.tgz",
|
||||
"integrity": "sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==",
|
||||
"dev": true,
|
||||
"license": "BSD-3-Clause"
|
||||
"license": "Apache-2.0",
|
||||
"engines": {
|
||||
"node": ">=18.18"
|
||||
},
|
||||
"funding": {
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/nzakas"
|
||||
}
|
||||
},
|
||||
"node_modules/@iconify/types": {
|
||||
"version": "2.0.0",
|
||||
@@ -3369,6 +3479,13 @@
|
||||
"@types/unist": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/json-schema": {
|
||||
"version": "7.0.15",
|
||||
"resolved": "https://registry.npmmirror.com/@types/json-schema/-/json-schema-7.0.15.tgz",
|
||||
"integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@types/katex": {
|
||||
"version": "0.16.8",
|
||||
"resolved": "https://registry.npmmirror.com/@types/katex/-/katex-0.16.8.tgz",
|
||||
@@ -5438,19 +5555,6 @@
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/doctrine": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/doctrine/-/doctrine-3.0.0.tgz",
|
||||
"integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"esutils": "^2.0.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/docx": {
|
||||
"version": "9.15.3",
|
||||
"resolved": "https://registry.npmmirror.com/docx/-/docx-9.15.3.tgz",
|
||||
@@ -5783,60 +5887,64 @@
|
||||
}
|
||||
},
|
||||
"node_modules/eslint": {
|
||||
"version": "8.57.0",
|
||||
"resolved": "https://registry.npmmirror.com/eslint/-/eslint-8.57.0.tgz",
|
||||
"integrity": "sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==",
|
||||
"version": "9.39.5",
|
||||
"resolved": "https://registry.npmmirror.com/eslint/-/eslint-9.39.5.tgz",
|
||||
"integrity": "sha512-DgZS62aPLXKlnxILS/AYCoRvHaZeXceIzlXPkkGGzJWSow1aEk0lbTlxUSlyjC8jcaKxAdOnTDz+o1JFSBsyjw==",
|
||||
"deprecated": "This version is no longer supported. Please see https://eslint.org/version-support for other options.",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@eslint-community/eslint-utils": "^4.2.0",
|
||||
"@eslint-community/regexpp": "^4.6.1",
|
||||
"@eslint/eslintrc": "^2.1.4",
|
||||
"@eslint/js": "8.57.0",
|
||||
"@humanwhocodes/config-array": "^0.11.14",
|
||||
"@eslint-community/eslint-utils": "^4.8.0",
|
||||
"@eslint-community/regexpp": "^4.12.1",
|
||||
"@eslint/config-array": "^0.21.2",
|
||||
"@eslint/config-helpers": "^0.4.2",
|
||||
"@eslint/core": "^0.17.0",
|
||||
"@eslint/eslintrc": "^3.3.6",
|
||||
"@eslint/js": "9.39.5",
|
||||
"@eslint/plugin-kit": "^0.4.1",
|
||||
"@humanfs/node": "^0.16.6",
|
||||
"@humanwhocodes/module-importer": "^1.0.1",
|
||||
"@nodelib/fs.walk": "^1.2.8",
|
||||
"@ungap/structured-clone": "^1.2.0",
|
||||
"ajv": "^6.12.4",
|
||||
"@humanwhocodes/retry": "^0.4.2",
|
||||
"@types/estree": "^1.0.6",
|
||||
"ajv": "^6.14.0",
|
||||
"chalk": "^4.0.0",
|
||||
"cross-spawn": "^7.0.2",
|
||||
"cross-spawn": "^7.0.6",
|
||||
"debug": "^4.3.2",
|
||||
"doctrine": "^3.0.0",
|
||||
"escape-string-regexp": "^4.0.0",
|
||||
"eslint-scope": "^7.2.2",
|
||||
"eslint-visitor-keys": "^3.4.3",
|
||||
"espree": "^9.6.1",
|
||||
"esquery": "^1.4.2",
|
||||
"eslint-scope": "^8.4.0",
|
||||
"eslint-visitor-keys": "^4.2.1",
|
||||
"espree": "^10.4.0",
|
||||
"esquery": "^1.5.0",
|
||||
"esutils": "^2.0.2",
|
||||
"fast-deep-equal": "^3.1.3",
|
||||
"file-entry-cache": "^6.0.1",
|
||||
"file-entry-cache": "^8.0.0",
|
||||
"find-up": "^5.0.0",
|
||||
"glob-parent": "^6.0.2",
|
||||
"globals": "^13.19.0",
|
||||
"graphemer": "^1.4.0",
|
||||
"ignore": "^5.2.0",
|
||||
"imurmurhash": "^0.1.4",
|
||||
"is-glob": "^4.0.0",
|
||||
"is-path-inside": "^3.0.3",
|
||||
"js-yaml": "^4.1.0",
|
||||
"json-stable-stringify-without-jsonify": "^1.0.1",
|
||||
"levn": "^0.4.1",
|
||||
"lodash.merge": "^4.6.2",
|
||||
"minimatch": "^3.1.2",
|
||||
"minimatch": "^3.1.5",
|
||||
"natural-compare": "^1.4.0",
|
||||
"optionator": "^0.9.3",
|
||||
"strip-ansi": "^6.0.1",
|
||||
"text-table": "^0.2.0"
|
||||
"optionator": "^0.9.3"
|
||||
},
|
||||
"bin": {
|
||||
"eslint": "bin/eslint.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
|
||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://opencollective.com/eslint"
|
||||
"url": "https://eslint.org/donate"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"jiti": "*"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"jiti": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/eslint-plugin-header": {
|
||||
@@ -5909,20 +6017,14 @@
|
||||
}
|
||||
},
|
||||
"node_modules/eslint-plugin-unused-imports": {
|
||||
"version": "3.2.0",
|
||||
"resolved": "https://registry.npmmirror.com/eslint-plugin-unused-imports/-/eslint-plugin-unused-imports-3.2.0.tgz",
|
||||
"integrity": "sha512-6uXyn6xdINEpxE1MtDjxQsyXB37lfyO2yKGVVgtD7WEWQGORSOZjgrD6hBhvGv4/SO+TOlS+UnC6JppRqbuwGQ==",
|
||||
"version": "4.4.1",
|
||||
"resolved": "https://registry.npmmirror.com/eslint-plugin-unused-imports/-/eslint-plugin-unused-imports-4.4.1.tgz",
|
||||
"integrity": "sha512-oZGYUz1X3sRMGUB+0cZyK2VcvRX5lm/vB56PgNNcU+7ficUCKm66oZWKUubXWnOuPjQ8PvmXtCViXBMONPe7tQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"eslint-rule-composer": "^0.3.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@typescript-eslint/eslint-plugin": "6 - 7",
|
||||
"eslint": "8"
|
||||
"@typescript-eslint/eslint-plugin": "^8.0.0-0 || ^7.0.0 || ^6.0.0 || ^5.0.0",
|
||||
"eslint": "^10.0.0 || ^9.0.0 || ^8.0.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"@typescript-eslint/eslint-plugin": {
|
||||
@@ -5930,20 +6032,10 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/eslint-rule-composer": {
|
||||
"version": "0.3.0",
|
||||
"resolved": "https://registry.npmmirror.com/eslint-rule-composer/-/eslint-rule-composer-0.3.0.tgz",
|
||||
"integrity": "sha512-bt+Sh8CtDmn2OajxvNO+BX7Wn4CIWMpTRm3MaiKPCQcnnlm0CS2mhui6QaoeQugs+3Kj2ESKEEGJUdVafwhiCg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=4.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/eslint-scope": {
|
||||
"version": "7.2.2",
|
||||
"resolved": "https://registry.npmmirror.com/eslint-scope/-/eslint-scope-7.2.2.tgz",
|
||||
"integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==",
|
||||
"version": "8.4.0",
|
||||
"resolved": "https://registry.npmmirror.com/eslint-scope/-/eslint-scope-8.4.0.tgz",
|
||||
"integrity": "sha512-sNXOfKCn74rt8RICKMvJS7XKV/Xk9kA7DyJr8mJik3S7Cwgy3qlkkmyS2uQB3jiJg6VNdZd/pDBJu0nvG2NlTg==",
|
||||
"dev": true,
|
||||
"license": "BSD-2-Clause",
|
||||
"dependencies": {
|
||||
@@ -5951,7 +6043,7 @@
|
||||
"estraverse": "^5.2.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
|
||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://opencollective.com/eslint"
|
||||
@@ -5970,19 +6062,45 @@
|
||||
"url": "https://opencollective.com/eslint"
|
||||
}
|
||||
},
|
||||
"node_modules/eslint/node_modules/eslint-visitor-keys": {
|
||||
"version": "4.2.1",
|
||||
"resolved": "https://registry.npmmirror.com/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz",
|
||||
"integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"engines": {
|
||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://opencollective.com/eslint"
|
||||
}
|
||||
},
|
||||
"node_modules/espree": {
|
||||
"version": "9.6.1",
|
||||
"resolved": "https://registry.npmmirror.com/espree/-/espree-9.6.1.tgz",
|
||||
"integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==",
|
||||
"version": "10.4.0",
|
||||
"resolved": "https://registry.npmmirror.com/espree/-/espree-10.4.0.tgz",
|
||||
"integrity": "sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ==",
|
||||
"dev": true,
|
||||
"license": "BSD-2-Clause",
|
||||
"dependencies": {
|
||||
"acorn": "^8.9.0",
|
||||
"acorn": "^8.15.0",
|
||||
"acorn-jsx": "^5.3.2",
|
||||
"eslint-visitor-keys": "^3.4.1"
|
||||
"eslint-visitor-keys": "^4.2.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
|
||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://opencollective.com/eslint"
|
||||
}
|
||||
},
|
||||
"node_modules/espree/node_modules/eslint-visitor-keys": {
|
||||
"version": "4.2.1",
|
||||
"resolved": "https://registry.npmmirror.com/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz",
|
||||
"integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"engines": {
|
||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://opencollective.com/eslint"
|
||||
@@ -6166,16 +6284,16 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/file-entry-cache": {
|
||||
"version": "6.0.1",
|
||||
"resolved": "https://registry.npmmirror.com/file-entry-cache/-/file-entry-cache-6.0.1.tgz",
|
||||
"integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==",
|
||||
"version": "8.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/file-entry-cache/-/file-entry-cache-8.0.0.tgz",
|
||||
"integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"flat-cache": "^3.0.4"
|
||||
"flat-cache": "^4.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^10.12.0 || >=12.0.0"
|
||||
"node": ">=16.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/file-source": {
|
||||
@@ -6218,18 +6336,17 @@
|
||||
}
|
||||
},
|
||||
"node_modules/flat-cache": {
|
||||
"version": "3.2.0",
|
||||
"resolved": "https://registry.npmmirror.com/flat-cache/-/flat-cache-3.2.0.tgz",
|
||||
"integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==",
|
||||
"version": "4.0.1",
|
||||
"resolved": "https://registry.npmmirror.com/flat-cache/-/flat-cache-4.0.1.tgz",
|
||||
"integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"flatted": "^3.2.9",
|
||||
"keyv": "^4.5.3",
|
||||
"rimraf": "^3.0.2"
|
||||
"keyv": "^4.5.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^10.12.0 || >=12.0.0"
|
||||
"node": ">=16"
|
||||
}
|
||||
},
|
||||
"node_modules/flatted": {
|
||||
@@ -6314,13 +6431,6 @@
|
||||
"url": "https://github.com/sponsors/rawify"
|
||||
}
|
||||
},
|
||||
"node_modules/fs.realpath": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/fs.realpath/-/fs.realpath-1.0.0.tgz",
|
||||
"integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==",
|
||||
"dev": true,
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/fsevents": {
|
||||
"version": "2.3.3",
|
||||
"resolved": "https://registry.npmmirror.com/fsevents/-/fsevents-2.3.3.tgz",
|
||||
@@ -6598,16 +6708,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/globals": {
|
||||
"version": "13.24.0",
|
||||
"resolved": "https://registry.npmmirror.com/globals/-/globals-13.24.0.tgz",
|
||||
"integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==",
|
||||
"version": "16.5.0",
|
||||
"resolved": "https://registry.npmmirror.com/globals/-/globals-16.5.0.tgz",
|
||||
"integrity": "sha512-c/c15i26VrJ4IRt5Z89DnIzCGDn9EcebibhAOjw5ibqEHsE1wLUgkPn9RDmNcUKyU87GeaL633nyJ+pplFR2ZQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"type-fest": "^0.20.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
"node": ">=18"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
@@ -6642,13 +6749,6 @@
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/graphemer": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmmirror.com/graphemer/-/graphemer-1.4.0.tgz",
|
||||
"integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/hachure-fill": {
|
||||
"version": "0.5.2",
|
||||
"resolved": "https://registry.npmmirror.com/hachure-fill/-/hachure-fill-0.5.2.tgz",
|
||||
@@ -7221,18 +7321,6 @@
|
||||
"node": ">=0.8.19"
|
||||
}
|
||||
},
|
||||
"node_modules/inflight": {
|
||||
"version": "1.0.6",
|
||||
"resolved": "https://registry.npmmirror.com/inflight/-/inflight-1.0.6.tgz",
|
||||
"integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==",
|
||||
"deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"once": "^1.3.0",
|
||||
"wrappy": "1"
|
||||
}
|
||||
},
|
||||
"node_modules/inherits": {
|
||||
"version": "2.0.4",
|
||||
"resolved": "https://registry.npmmirror.com/inherits/-/inherits-2.0.4.tgz",
|
||||
@@ -7610,16 +7698,6 @@
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/is-path-inside": {
|
||||
"version": "3.0.3",
|
||||
"resolved": "https://registry.npmmirror.com/is-path-inside/-/is-path-inside-3.0.3.tgz",
|
||||
"integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/is-plain-obj": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmmirror.com/is-plain-obj/-/is-plain-obj-4.1.0.tgz",
|
||||
@@ -9436,16 +9514,6 @@
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/once": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmmirror.com/once/-/once-1.4.0.tgz",
|
||||
"integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"wrappy": "1"
|
||||
}
|
||||
},
|
||||
"node_modules/optionator": {
|
||||
"version": "0.9.4",
|
||||
"resolved": "https://registry.npmmirror.com/optionator/-/optionator-0.9.4.tgz",
|
||||
@@ -9625,16 +9693,6 @@
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/path-is-absolute": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmmirror.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
|
||||
"integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/path-key": {
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmmirror.com/path-key/-/path-key-3.1.1.tgz",
|
||||
@@ -10716,45 +10774,6 @@
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/rimraf": {
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmmirror.com/rimraf/-/rimraf-3.0.2.tgz",
|
||||
"integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==",
|
||||
"deprecated": "Rimraf versions prior to v4 are no longer supported",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"glob": "^7.1.3"
|
||||
},
|
||||
"bin": {
|
||||
"rimraf": "bin.js"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/isaacs"
|
||||
}
|
||||
},
|
||||
"node_modules/rimraf/node_modules/glob": {
|
||||
"version": "7.2.3",
|
||||
"resolved": "https://registry.npmmirror.com/glob/-/glob-7.2.3.tgz",
|
||||
"integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==",
|
||||
"deprecated": "Glob versions prior to v9 are no longer supported",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"fs.realpath": "^1.0.0",
|
||||
"inflight": "^1.0.4",
|
||||
"inherits": "2",
|
||||
"minimatch": "^3.1.1",
|
||||
"once": "^1.3.0",
|
||||
"path-is-absolute": "^1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "*"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/isaacs"
|
||||
}
|
||||
},
|
||||
"node_modules/robust-predicates": {
|
||||
"version": "3.0.3",
|
||||
"resolved": "https://registry.npmmirror.com/robust-predicates/-/robust-predicates-3.0.3.tgz",
|
||||
@@ -11674,13 +11693,6 @@
|
||||
"deprecated": "no longer maintained",
|
||||
"license": "Unlicense"
|
||||
},
|
||||
"node_modules/text-table": {
|
||||
"version": "0.2.0",
|
||||
"resolved": "https://registry.npmmirror.com/text-table/-/text-table-0.2.0.tgz",
|
||||
"integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/thenify": {
|
||||
"version": "3.3.1",
|
||||
"resolved": "https://registry.npmmirror.com/thenify/-/thenify-3.3.1.tgz",
|
||||
@@ -11868,19 +11880,6 @@
|
||||
"node": ">= 0.8.0"
|
||||
}
|
||||
},
|
||||
"node_modules/type-fest": {
|
||||
"version": "0.20.2",
|
||||
"resolved": "https://registry.npmmirror.com/type-fest/-/type-fest-0.20.2.tgz",
|
||||
"integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==",
|
||||
"dev": true,
|
||||
"license": "(MIT OR CC0-1.0)",
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/typed-array-buffer": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmmirror.com/typed-array-buffer/-/typed-array-buffer-1.0.3.tgz",
|
||||
@@ -12452,13 +12451,6 @@
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/wrappy": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmmirror.com/wrappy/-/wrappy-1.0.2.tgz",
|
||||
"integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==",
|
||||
"dev": true,
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/xlsx": {
|
||||
"version": "0.18.5",
|
||||
"resolved": "https://registry.npmmirror.com/xlsx/-/xlsx-0.18.5.tgz",
|
||||
|
||||
+4
-4
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "react-template",
|
||||
"name": "monkey-ai-web",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
@@ -90,18 +90,18 @@
|
||||
"@vitejs/plugin-react": "^4.2.1",
|
||||
"autoprefixer": "^10.4.21",
|
||||
"esbuild": "0.21.5",
|
||||
"eslint": "8.57.0",
|
||||
"eslint": "9.39.5",
|
||||
"eslint-plugin-header": "^3.1.1",
|
||||
"eslint-plugin-react": "^7.37.5",
|
||||
"eslint-plugin-react-hooks": "^5.2.0",
|
||||
"eslint-plugin-unused-imports": "^3.2.0",
|
||||
"eslint-plugin-unused-imports": "4.4.1",
|
||||
"globals": "16.5.0",
|
||||
"i18next-cli": "^1.10.3",
|
||||
"postcss": "^8.5.3",
|
||||
"prettier": "^3.0.0",
|
||||
"tailwindcss": "^3",
|
||||
"vite": "5.4.21"
|
||||
},
|
||||
"proxy": "http://localhost:3000",
|
||||
"engines": {
|
||||
"node": ">=22.13.0",
|
||||
"npm": ">=10"
|
||||
|
||||
@@ -42,7 +42,7 @@ export function auditManifest(manifest, lock) {
|
||||
}
|
||||
|
||||
export function auditSource(source, filename) {
|
||||
const linter = new Linter();
|
||||
const linter = new Linter({ configType: 'eslintrc' });
|
||||
linter.defineRule('ui-dependencies', {
|
||||
create(context) {
|
||||
const inspect = (node) => {
|
||||
|
||||
@@ -24,6 +24,27 @@ import { useIsMobile } from '../../hooks/common/useIsMobile';
|
||||
import { ConsoleCard, ConsoleSearchBar } from './ConsolePrimitives';
|
||||
import { TableTitle } from '../common/table/TableToolbar';
|
||||
|
||||
export function ConsoleCollectionSearch({ children, className }) {
|
||||
const { t } = useTranslation();
|
||||
const isMobile = useIsMobile();
|
||||
const [expanded, setExpanded] = useState(false);
|
||||
return (
|
||||
<>
|
||||
{isMobile && (
|
||||
<Button
|
||||
onClick={() => setExpanded((value) => !value)}
|
||||
aria-expanded={expanded}
|
||||
>
|
||||
{t(expanded ? '隐藏操作项' : '显示操作项')}
|
||||
</Button>
|
||||
)}
|
||||
<ConsoleSearchBar className={className} hidden={isMobile && !expanded}>
|
||||
{children}
|
||||
</ConsoleSearchBar>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
export default function ConsoleCollection({
|
||||
children,
|
||||
statsArea,
|
||||
@@ -36,27 +57,13 @@ export default function ConsoleCollection({
|
||||
tableActionsOffset = false,
|
||||
paginationArea,
|
||||
}) {
|
||||
const { t } = useTranslation();
|
||||
const isMobile = useIsMobile();
|
||||
const [expanded, setExpanded] = useState(false);
|
||||
const showSearch = !isMobile || expanded;
|
||||
return (
|
||||
<div className='console-collection'>
|
||||
{statsArea && (
|
||||
<ConsoleCard className='console-stats'>{statsArea}</ConsoleCard>
|
||||
)}
|
||||
{searchArea && (
|
||||
<>
|
||||
{isMobile && (
|
||||
<Button
|
||||
onClick={() => setExpanded(!expanded)}
|
||||
aria-expanded={expanded}
|
||||
>
|
||||
{t(expanded ? '隐藏操作项' : '显示操作项')}
|
||||
</Button>
|
||||
)}
|
||||
<ConsoleSearchBar hidden={!showSearch}>{searchArea}</ConsoleSearchBar>
|
||||
</>
|
||||
<ConsoleCollectionSearch>{searchArea}</ConsoleCollectionSearch>
|
||||
)}
|
||||
<ConsoleCard>
|
||||
{tabsArea && <div className='console-list-tabs'>{tabsArea}</div>}
|
||||
|
||||
@@ -32,6 +32,8 @@ import {
|
||||
} from 'antd';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import TableEmpty from '../common/table/TableEmpty';
|
||||
import FilterSearchButton from '../common/table/FilterSearchButton';
|
||||
import './console.css';
|
||||
import {
|
||||
ConsoleSearchContext,
|
||||
useConsolePage,
|
||||
@@ -96,38 +98,32 @@ export function ConsoleSearchBar({ children, className, formProps, ...props }) {
|
||||
);
|
||||
}
|
||||
|
||||
export function ConsoleSearchActions({
|
||||
onReset,
|
||||
onSearch,
|
||||
loading,
|
||||
searchLabel = '搜索',
|
||||
}) {
|
||||
export function ConsoleSearchActions({ onReset, loading }) {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<div className='console-search-actions'>
|
||||
{onReset && <Button onClick={onReset}>{t('重置')}</Button>}
|
||||
<Button
|
||||
type='primary'
|
||||
htmlType={onSearch ? 'button' : 'submit'}
|
||||
onClick={onSearch}
|
||||
loading={loading}
|
||||
>
|
||||
{t(searchLabel)}
|
||||
</Button>
|
||||
{onReset && (
|
||||
<Button htmlType='button' onClick={onReset}>
|
||||
{t('重置')}
|
||||
</Button>
|
||||
)}
|
||||
<FilterSearchButton loading={loading} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export function ConsoleFilterGrid({ children, onReset, onSearch, loading }) {
|
||||
return (
|
||||
<div className='console-filter-panel'>
|
||||
<form
|
||||
className='console-filter-panel'
|
||||
onSubmit={(event) => {
|
||||
event.preventDefault();
|
||||
onSearch();
|
||||
}}
|
||||
>
|
||||
<div className='console-filter-grid'>{children}</div>
|
||||
<ConsoleSearchActions
|
||||
onReset={onReset}
|
||||
onSearch={onSearch}
|
||||
loading={loading}
|
||||
/>
|
||||
</div>
|
||||
<ConsoleSearchActions onReset={onReset} loading={loading} />
|
||||
</form>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -230,7 +230,7 @@
|
||||
justify-content: flex-end;
|
||||
flex: 0 0 auto;
|
||||
flex-wrap: wrap;
|
||||
gap: var(--console-space-1);
|
||||
gap: var(--console-space-1, 8px);
|
||||
margin-inline-start: auto;
|
||||
}
|
||||
.console-filter-panel {
|
||||
@@ -253,7 +253,7 @@
|
||||
}
|
||||
.console-filter-field > label,
|
||||
.console-page .console-filter-grid .ant-form-item-label > label {
|
||||
color: var(--console-muted);
|
||||
color: var(--console-muted, var(--ui-color-text-2));
|
||||
font-size: 13px;
|
||||
}
|
||||
.console-filter-field > :is(.ant-input-number, .ant-picker) {
|
||||
|
||||
@@ -21,7 +21,6 @@ import {
|
||||
Plus as ActionPlus,
|
||||
Upload as ActionUpload,
|
||||
} from '@/components/common/icons/ActionIcons';
|
||||
import { TableRowActions } from '@/components/common/table/TableToolbar';
|
||||
import React, { useState, useEffect, useCallback } from 'react';
|
||||
import {
|
||||
Card,
|
||||
@@ -32,6 +31,7 @@ import {
|
||||
Select,
|
||||
Tag,
|
||||
Avatar,
|
||||
Popconfirm,
|
||||
Typography,
|
||||
Space,
|
||||
Banner,
|
||||
@@ -307,34 +307,28 @@ const CustomerServiceSetting = () => {
|
||||
title: t('操作'),
|
||||
dataIndex: 'action',
|
||||
render: (_, record) => (
|
||||
<TableRowActions
|
||||
items={[
|
||||
{
|
||||
key: 'status',
|
||||
label: record.status === 1 ? t('下线') : t('上线'),
|
||||
onClick: () => handleToggleStatus(record),
|
||||
danger: (record.status === 1 ? 'danger' : 'primary') === 'danger',
|
||||
},
|
||||
{
|
||||
key: 'delete',
|
||||
label: t('删除'),
|
||||
danger: true,
|
||||
onClick: () =>
|
||||
Modal.confirm({
|
||||
title: t('确认删除'),
|
||||
content: t('确定要删除这个客服吗?'),
|
||||
okText: t('确认'),
|
||||
cancelText: t('取消'),
|
||||
okButtonProps: { danger: true },
|
||||
onOk: () => handleDelete(record.id),
|
||||
}),
|
||||
},
|
||||
]}
|
||||
>
|
||||
<Space>
|
||||
<Button
|
||||
onClick={() => handleToggleStatus(record)}
|
||||
type='link'
|
||||
size='small'
|
||||
danger={(record.status === 1 ? 'danger' : 'primary') === 'danger'}
|
||||
>
|
||||
{record.status === 1 ? t('下线') : t('上线')}
|
||||
</Button>
|
||||
<Button onClick={() => openModal(record)} type='link' size='small'>
|
||||
{t('编辑')}
|
||||
</Button>
|
||||
</TableRowActions>
|
||||
<Popconfirm
|
||||
title={t('确认删除')}
|
||||
content={t('确定要删除这个客服吗?')}
|
||||
onConfirm={() => handleDelete(record.id)}
|
||||
>
|
||||
<Button type='link' size='small' danger>
|
||||
{t('删除')}
|
||||
</Button>
|
||||
</Popconfirm>
|
||||
</Space>
|
||||
),
|
||||
},
|
||||
];
|
||||
|
||||
@@ -24,7 +24,6 @@ import {
|
||||
ChevronDown as ActionChevronDown,
|
||||
ChevronRight as ActionChevronRight,
|
||||
} from '@/components/common/icons/ActionIcons';
|
||||
import { TableRowActions } from '@/components/common/table/TableToolbar';
|
||||
import React, { useState, useEffect, useCallback, useMemo } from 'react';
|
||||
import {
|
||||
Card,
|
||||
@@ -990,31 +989,7 @@ const LevelPolicySetting = () => {
|
||||
title: t('操作'),
|
||||
width: 260,
|
||||
render: (_, r) => (
|
||||
<TableRowActions
|
||||
items={[
|
||||
{
|
||||
key: 'copy',
|
||||
label: t('复制'),
|
||||
onClick: () => duplicateLevel(type, r.code),
|
||||
title: t('以该等级为模板新建'),
|
||||
},
|
||||
{
|
||||
key: 'delete',
|
||||
label: t('删除'),
|
||||
disabled: deletingCode === `${type}/${r.code}`,
|
||||
danger: true,
|
||||
onClick: () =>
|
||||
Modal.confirm({
|
||||
title: t('确认删除该等级?'),
|
||||
content: t('被用户/企业/默认等级引用时会被拒绝'),
|
||||
okText: t('确认'),
|
||||
cancelText: t('取消'),
|
||||
okButtonProps: { danger: true },
|
||||
onOk: () => deleteLevel(type, r.code),
|
||||
}),
|
||||
},
|
||||
]}
|
||||
>
|
||||
<Space>
|
||||
<Button
|
||||
onClick={() => openEditor(type, r.code)}
|
||||
type='link'
|
||||
@@ -1022,7 +997,30 @@ const LevelPolicySetting = () => {
|
||||
>
|
||||
{t('编辑')}
|
||||
</Button>
|
||||
</TableRowActions>
|
||||
<Tooltip content={t('以该等级为模板新建')}>
|
||||
<Button
|
||||
onClick={() => duplicateLevel(type, r.code)}
|
||||
type='link'
|
||||
size='small'
|
||||
>
|
||||
{t('复制')}
|
||||
</Button>
|
||||
</Tooltip>
|
||||
<Popconfirm
|
||||
title={t('确认删除该等级?')}
|
||||
content={t('被用户/企业/默认等级引用时会被拒绝')}
|
||||
onConfirm={() => deleteLevel(type, r.code)}
|
||||
>
|
||||
<Button
|
||||
loading={deletingCode === `${type}/${r.code}`}
|
||||
type='link'
|
||||
size='small'
|
||||
danger
|
||||
>
|
||||
{t('删除')}
|
||||
</Button>
|
||||
</Popconfirm>
|
||||
</Space>
|
||||
),
|
||||
},
|
||||
];
|
||||
|
||||
@@ -18,7 +18,6 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
|
||||
import { useEffectEvent } from '../../hooks/common/useEffectEvent';
|
||||
import { TableRowActions } from '@/components/common/table/TableToolbar';
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import {
|
||||
@@ -28,6 +27,7 @@ import {
|
||||
Modal,
|
||||
Form,
|
||||
Toast,
|
||||
Popconfirm,
|
||||
Switch,
|
||||
Tag,
|
||||
Progress,
|
||||
@@ -262,29 +262,7 @@ const TutorialVideoSetting = () => {
|
||||
title: t('操作'),
|
||||
width: 180,
|
||||
render: (_, record) => (
|
||||
<TableRowActions
|
||||
items={[
|
||||
{
|
||||
key: 'edit',
|
||||
label: t('编辑'),
|
||||
onClick: () => handleEdit(record),
|
||||
},
|
||||
{
|
||||
key: 'delete',
|
||||
label: t('删除'),
|
||||
danger: true,
|
||||
onClick: () =>
|
||||
Modal.confirm({
|
||||
title: t('确定删除这个视频吗?'),
|
||||
content: t('删除后将无法恢复'),
|
||||
okText: t('确认'),
|
||||
cancelText: t('取消'),
|
||||
okButtonProps: { danger: true },
|
||||
onOk: () => handleDelete(record.id),
|
||||
}),
|
||||
},
|
||||
]}
|
||||
>
|
||||
<div style={{ display: 'flex', gap: 8 }}>
|
||||
<Button
|
||||
onClick={() => handlePreview(record)}
|
||||
type='link'
|
||||
@@ -292,7 +270,19 @@ const TutorialVideoSetting = () => {
|
||||
>
|
||||
{t('预览')}
|
||||
</Button>
|
||||
</TableRowActions>
|
||||
<Button onClick={() => handleEdit(record)} type='link' size='small'>
|
||||
{t('编辑')}
|
||||
</Button>
|
||||
<Popconfirm
|
||||
title={t('确定删除这个视频吗?')}
|
||||
content={t('删除后将无法恢复')}
|
||||
onConfirm={() => handleDelete(record.id)}
|
||||
>
|
||||
<Button type='link' size='small' danger>
|
||||
{t('删除')}
|
||||
</Button>
|
||||
</Popconfirm>
|
||||
</div>
|
||||
),
|
||||
},
|
||||
];
|
||||
|
||||
@@ -30,6 +30,7 @@ const DecisionTable = ({ mode, orgId }) => {
|
||||
const { t } = useTranslation();
|
||||
const [data, setData] = useState({ items: [], total: 0 });
|
||||
const [page, setPage] = useState(1);
|
||||
const [pageSize, setPageSize] = useState(20);
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [error, setError] = useState('');
|
||||
|
||||
@@ -38,7 +39,10 @@ const DecisionTable = ({ mode, orgId }) => {
|
||||
setError('');
|
||||
try {
|
||||
setData(
|
||||
(await listDecisions(mode, orgId, { p: page, page_size: 20 })) || {
|
||||
(await listDecisions(mode, orgId, {
|
||||
p: page,
|
||||
page_size: pageSize,
|
||||
})) || {
|
||||
items: [],
|
||||
total: 0,
|
||||
},
|
||||
@@ -48,7 +52,7 @@ const DecisionTable = ({ mode, orgId }) => {
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
}, [mode, orgId, page, t]);
|
||||
}, [mode, orgId, page, pageSize, t]);
|
||||
|
||||
useEffect(() => {
|
||||
load();
|
||||
@@ -147,12 +151,18 @@ const DecisionTable = ({ mode, orgId }) => {
|
||||
/>
|
||||
}
|
||||
pagination={{
|
||||
// 接口固定 page_size=20,不提供每页条数切换
|
||||
current: page,
|
||||
pageSize: 20,
|
||||
pageSize,
|
||||
total: data.total || 0,
|
||||
size: 'small',
|
||||
showSizeChanger: false,
|
||||
showSizeChanger: mode === 'org',
|
||||
onPageSizeChange:
|
||||
mode === 'org'
|
||||
? (size) => {
|
||||
setPage(1);
|
||||
setPageSize(size);
|
||||
}
|
||||
: undefined,
|
||||
showTotal: (total) => t('共 {{total}} 条', { total }),
|
||||
onChange: setPage,
|
||||
}}
|
||||
|
||||
@@ -19,8 +19,7 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
|
||||
import React, { useCallback, useEffect, useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Button, Empty, Modal, Space, Tag, Typography } from 'antd';
|
||||
import { TableRowActions } from '@/components/common/table/TableToolbar';
|
||||
import { Button, Empty, Popconfirm, Space, Tag, Typography } from 'antd';
|
||||
import { Table } from '@/components/ui';
|
||||
import { ConsoleAlert as Alert } from '../console/ConsolePrimitives';
|
||||
import { Plus } from '../common/icons/ActionIcons';
|
||||
@@ -149,37 +148,7 @@ const ProfileTable = ({ mode, orgId, canWrite = true, emptyHint }) => {
|
||||
fixed: 'right',
|
||||
width: 180,
|
||||
render: (_, r) => (
|
||||
<TableRowActions
|
||||
items={[
|
||||
canWrite && {
|
||||
key: 'edit',
|
||||
label: t('编辑'),
|
||||
onClick: () => setEditing(r),
|
||||
},
|
||||
canWrite && {
|
||||
key: 'delete',
|
||||
label: t('删除'),
|
||||
danger: true,
|
||||
onClick: () =>
|
||||
Modal.confirm({
|
||||
title: t('确认删除该集合?'),
|
||||
content: t('使用该虚拟模型名的请求将返回"模型不存在"。'),
|
||||
okText: t('确认'),
|
||||
cancelText: t('取消'),
|
||||
okButtonProps: { danger: true },
|
||||
onOk: async () => {
|
||||
try {
|
||||
await deleteProfile(mode, orgId, r.id);
|
||||
showSuccess(t('已删除'));
|
||||
load();
|
||||
} catch (e) {
|
||||
if (e?.message) showError(e.message);
|
||||
}
|
||||
},
|
||||
}),
|
||||
},
|
||||
]}
|
||||
>
|
||||
<Space size={8} wrap>
|
||||
<Button
|
||||
type='link'
|
||||
size='small'
|
||||
@@ -188,7 +157,32 @@ const ProfileTable = ({ mode, orgId, canWrite = true, emptyHint }) => {
|
||||
>
|
||||
{t('试路由')}
|
||||
</Button>
|
||||
</TableRowActions>
|
||||
{canWrite && (
|
||||
<>
|
||||
<Button type='link' size='small' onClick={() => setEditing(r)}>
|
||||
{t('编辑')}
|
||||
</Button>
|
||||
<Popconfirm
|
||||
title={t('确认删除该集合?')}
|
||||
description={t('使用该虚拟模型名的请求将返回"模型不存在"。')}
|
||||
okButtonProps={{ danger: true }}
|
||||
onConfirm={async () => {
|
||||
try {
|
||||
await deleteProfile(mode, orgId, r.id);
|
||||
showSuccess(t('已删除'));
|
||||
load();
|
||||
} catch (e) {
|
||||
if (e?.message) showError(e.message);
|
||||
}
|
||||
}}
|
||||
>
|
||||
<Button type='link' size='small' danger>
|
||||
{t('删除')}
|
||||
</Button>
|
||||
</Popconfirm>
|
||||
</>
|
||||
)}
|
||||
</Space>
|
||||
),
|
||||
},
|
||||
];
|
||||
@@ -227,7 +221,7 @@ const ProfileTable = ({ mode, orgId, canWrite = true, emptyHint }) => {
|
||||
loading={loading}
|
||||
columns={columns}
|
||||
dataSource={list}
|
||||
pagination={false}
|
||||
pagination={mode === 'org' ? { resetOnDataChange: true } : false}
|
||||
scroll={{ x: 'max-content' }}
|
||||
empty={
|
||||
<Empty
|
||||
|
||||
@@ -18,9 +18,9 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
|
||||
import React, { useRef } from 'react';
|
||||
import { Form, Button } from '@/components/ui';
|
||||
import { Form } from '@/components/ui';
|
||||
import { IconSearch } from '@/components/ui/icons';
|
||||
import FilterSearchButton from '../../common/table/FilterSearchButton';
|
||||
import { ConsoleSearchActions } from '../../console/ConsolePrimitives';
|
||||
import { useFilterSearch } from '../../../hooks/common/useFilterSearch';
|
||||
|
||||
const AdminTokensFilters = ({
|
||||
@@ -67,93 +67,85 @@ const AdminTokensFilters = ({
|
||||
autoComplete='off'
|
||||
layout='vertical'
|
||||
trigger='change'
|
||||
className='admin-tokens-filter-form'
|
||||
className='console-filter-panel'
|
||||
>
|
||||
<div className='admin-tokens-filter-grid'>
|
||||
<div className='admin-tokens-filter-field'>
|
||||
<Form.Input
|
||||
field='keyword'
|
||||
label={t('密钥名称 / Key 片段')}
|
||||
prefix={<IconSearch />}
|
||||
placeholder={t('密钥名称 / Key 片段')}
|
||||
showClear
|
||||
/>
|
||||
</div>
|
||||
<div className='admin-tokens-filter-field'>
|
||||
<Form.Input
|
||||
field='user_keyword'
|
||||
label={t('用户名/昵称')}
|
||||
placeholder={t('用户名/昵称')}
|
||||
showClear
|
||||
/>
|
||||
</div>
|
||||
<div className='admin-tokens-filter-field'>
|
||||
<Form.Input
|
||||
field='user_id'
|
||||
label={t('用户ID')}
|
||||
placeholder={t('用户ID')}
|
||||
type='number'
|
||||
showClear
|
||||
/>
|
||||
</div>
|
||||
<div className='admin-tokens-filter-field'>
|
||||
<Form.Select
|
||||
field='statuses'
|
||||
label={t('状态')}
|
||||
placeholder={t('状态(多选)')}
|
||||
multiple
|
||||
optionList={[
|
||||
{ label: t('已启用'), value: 1 },
|
||||
{ label: t('已禁用'), value: 2 },
|
||||
{ label: t('已过期'), value: 3 },
|
||||
{ label: t('已耗尽'), value: 4 },
|
||||
]}
|
||||
showClear
|
||||
className='w-full'
|
||||
/>
|
||||
</div>
|
||||
<div className='admin-tokens-filter-field'>
|
||||
<Form.Select
|
||||
field='group'
|
||||
label={t('分组')}
|
||||
placeholder={t('分组')}
|
||||
optionList={groupOptions}
|
||||
showClear
|
||||
className='w-full'
|
||||
/>
|
||||
</div>
|
||||
<div className='admin-tokens-filter-field'>
|
||||
<Form.Select
|
||||
field='unlimited'
|
||||
label={t('剩余额度')}
|
||||
placeholder={t('剩余额度')}
|
||||
optionList={[
|
||||
{ label: t('无限额度'), value: true },
|
||||
{ label: t('有限额度'), value: false },
|
||||
]}
|
||||
showClear
|
||||
className='w-full'
|
||||
/>
|
||||
</div>
|
||||
<div className='admin-tokens-filter-field'>
|
||||
<Form.Select
|
||||
field='org_scope'
|
||||
label={t('归属')}
|
||||
placeholder={t('归属')}
|
||||
optionList={[
|
||||
{ label: t('全部'), value: 'all' },
|
||||
{ label: t('个人'), value: 'personal' },
|
||||
{ label: t('企业'), value: 'org' },
|
||||
]}
|
||||
showClear={false}
|
||||
className='w-full'
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className='admin-tokens-filter-actions'>
|
||||
<Button onClick={handleReset}>{t('重置')}</Button>
|
||||
<FilterSearchButton loading={loading || searching} />
|
||||
<div className='console-filter-grid'>
|
||||
<Form.Input
|
||||
field='keyword'
|
||||
label={t('密钥名称 / Key 片段')}
|
||||
prefix={<IconSearch />}
|
||||
placeholder={t('密钥名称 / Key 片段')}
|
||||
showClear
|
||||
/>
|
||||
|
||||
<Form.Input
|
||||
field='user_keyword'
|
||||
label={t('用户名/昵称')}
|
||||
placeholder={t('用户名/昵称')}
|
||||
showClear
|
||||
/>
|
||||
|
||||
<Form.Input
|
||||
field='user_id'
|
||||
label={t('用户ID')}
|
||||
placeholder={t('用户ID')}
|
||||
type='number'
|
||||
showClear
|
||||
/>
|
||||
|
||||
<Form.Select
|
||||
field='statuses'
|
||||
label={t('状态')}
|
||||
placeholder={t('状态(多选)')}
|
||||
multiple
|
||||
optionList={[
|
||||
{ label: t('已启用'), value: 1 },
|
||||
{ label: t('已禁用'), value: 2 },
|
||||
{ label: t('已过期'), value: 3 },
|
||||
{ label: t('已耗尽'), value: 4 },
|
||||
]}
|
||||
showClear
|
||||
className='w-full'
|
||||
/>
|
||||
|
||||
<Form.Select
|
||||
field='group'
|
||||
label={t('分组')}
|
||||
placeholder={t('分组')}
|
||||
optionList={groupOptions}
|
||||
showClear
|
||||
className='w-full'
|
||||
/>
|
||||
|
||||
<Form.Select
|
||||
field='unlimited'
|
||||
label={t('剩余额度')}
|
||||
placeholder={t('剩余额度')}
|
||||
optionList={[
|
||||
{ label: t('无限额度'), value: true },
|
||||
{ label: t('有限额度'), value: false },
|
||||
]}
|
||||
showClear
|
||||
className='w-full'
|
||||
/>
|
||||
|
||||
<Form.Select
|
||||
field='org_scope'
|
||||
label={t('归属')}
|
||||
placeholder={t('归属')}
|
||||
optionList={[
|
||||
{ label: t('全部'), value: 'all' },
|
||||
{ label: t('个人'), value: 'personal' },
|
||||
{ label: t('企业'), value: 'org' },
|
||||
]}
|
||||
showClear={false}
|
||||
className='w-full'
|
||||
/>
|
||||
</div>
|
||||
<ConsoleSearchActions
|
||||
onReset={handleReset}
|
||||
loading={loading || searching}
|
||||
/>
|
||||
</Form>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -1,32 +1,3 @@
|
||||
.console-page .console-search-card .admin-tokens-filter-form {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.admin-tokens-filter-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, minmax(0, 1fr));
|
||||
gap: 1rem;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.console-page .admin-tokens-filter-grid .ant-form-item-label > label {
|
||||
color: var(--console-muted);
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.admin-tokens-filter-actions,
|
||||
.admin-tokens-tools {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
.admin-tokens-filter-actions {
|
||||
margin-top: 1rem;
|
||||
}
|
||||
|
||||
.admin-tokens-toolbar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -39,6 +10,11 @@
|
||||
|
||||
.admin-tokens-tools {
|
||||
margin-inline-start: auto;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
flex-wrap: wrap;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.console-page .console-table.admin-tokens-table .ant-table-thead > tr > th {
|
||||
@@ -78,15 +54,3 @@
|
||||
padding: 0 4px;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
@media (max-width: 1100px) {
|
||||
.admin-tokens-filter-grid {
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.admin-tokens-filter-grid {
|
||||
grid-template-columns: minmax(0, 1fr);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
|
||||
import { writeClipboardText } from '../../../helpers/clipboard';
|
||||
import { TableRowActions } from '@/components/common/table/TableToolbar';
|
||||
import React, { useState } from 'react';
|
||||
import { Switch } from 'antd';
|
||||
import {
|
||||
@@ -730,110 +729,142 @@ export const getChannelsColumns = ({
|
||||
dataIndex: 'operate',
|
||||
fixed: 'right',
|
||||
render: (text, record, index) => {
|
||||
if (!isRoot()) return null;
|
||||
if (record.children !== undefined) {
|
||||
if (record.children === undefined) {
|
||||
const moreMenuItems = [
|
||||
{
|
||||
node: 'item',
|
||||
name: t('删除'),
|
||||
type: 'danger',
|
||||
onClick: async () => {
|
||||
const content = await buildDeleteConfirmContent(record.id, t);
|
||||
Modal.confirm({
|
||||
title: t('确定是否要删除此渠道?'),
|
||||
content,
|
||||
onOk: () => {
|
||||
(async () => {
|
||||
await manageChannel(record.id, 'delete', record);
|
||||
await refresh();
|
||||
setTimeout(() => {
|
||||
if (channels.length === 0 && activePage > 1) {
|
||||
refresh(activePage - 1);
|
||||
}
|
||||
}, 100);
|
||||
})();
|
||||
},
|
||||
});
|
||||
},
|
||||
},
|
||||
{
|
||||
node: 'item',
|
||||
name: t('复制'),
|
||||
type: 'tertiary',
|
||||
onClick: () => {
|
||||
Modal.confirm({
|
||||
title: t('确定是否要复制此渠道?'),
|
||||
content: t('复制渠道的所有信息'),
|
||||
onOk: () => copySelectedChannel(record),
|
||||
});
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
<TableRowActions
|
||||
items={[
|
||||
{
|
||||
key: 'enable',
|
||||
label: t('启用全部'),
|
||||
onClick: () => manageTag(record.key, 'enable'),
|
||||
},
|
||||
{
|
||||
key: 'disable',
|
||||
label: t('禁用全部'),
|
||||
onClick: () => manageTag(record.key, 'disable'),
|
||||
},
|
||||
]}
|
||||
>
|
||||
<Button
|
||||
type='link'
|
||||
size='small'
|
||||
onClick={() => {
|
||||
setShowEditTag(true);
|
||||
setEditingTag(record.key);
|
||||
}}
|
||||
>
|
||||
{t('编辑')}
|
||||
</Button>
|
||||
</TableRowActions>
|
||||
<Space wrap className='console-module-row-actions'>
|
||||
{isRoot() && (
|
||||
<>
|
||||
<Button
|
||||
type='link'
|
||||
size='small'
|
||||
onClick={() => testChannel(record, '')}
|
||||
>
|
||||
{t('测试')}
|
||||
</Button>
|
||||
<Button
|
||||
type='link'
|
||||
size='small'
|
||||
onClick={() => {
|
||||
setCurrentTestChannel(record);
|
||||
setShowModelTestModal(true);
|
||||
}}
|
||||
>
|
||||
{t('批量测试')}
|
||||
</Button>
|
||||
<Button
|
||||
type='link'
|
||||
size='small'
|
||||
onClick={() => {
|
||||
setEditingChannel(record);
|
||||
setShowEdit(true);
|
||||
}}
|
||||
>
|
||||
{t('编辑')}
|
||||
</Button>
|
||||
<Button
|
||||
type='link'
|
||||
danger
|
||||
size='small'
|
||||
onClick={moreMenuItems[0].onClick}
|
||||
>
|
||||
{t('删除')}
|
||||
</Button>
|
||||
<Button
|
||||
type='link'
|
||||
size='small'
|
||||
onClick={moreMenuItems[1].onClick}
|
||||
>
|
||||
{t('复制')}
|
||||
</Button>
|
||||
{record.channel_info?.is_multi_key && (
|
||||
<Button
|
||||
type='link'
|
||||
size='small'
|
||||
onClick={() => {
|
||||
setCurrentMultiKeyChannel(record);
|
||||
setShowMultiKeyManageModal(true);
|
||||
}}
|
||||
>
|
||||
{t('多密钥管理')}
|
||||
</Button>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
</Space>
|
||||
);
|
||||
} else {
|
||||
// 标签操作按钮
|
||||
return (
|
||||
<Space wrap>
|
||||
{isRoot() && (
|
||||
<>
|
||||
<Button
|
||||
type='link'
|
||||
size='small'
|
||||
onClick={() => manageTag(record.key, 'enable')}
|
||||
>
|
||||
{t('启用全部')}
|
||||
</Button>
|
||||
<Button
|
||||
type='link'
|
||||
size='small'
|
||||
onClick={() => manageTag(record.key, 'disable')}
|
||||
>
|
||||
{t('禁用全部')}
|
||||
</Button>
|
||||
<Button
|
||||
type='link'
|
||||
size='small'
|
||||
onClick={() => {
|
||||
setShowEditTag(true);
|
||||
setEditingTag(record.key);
|
||||
}}
|
||||
>
|
||||
{t('编辑')}
|
||||
</Button>
|
||||
</>
|
||||
)}
|
||||
</Space>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<TableRowActions
|
||||
items={[
|
||||
{
|
||||
key: 'batch-test',
|
||||
label: t('批量测试'),
|
||||
onClick: () => {
|
||||
setCurrentTestChannel(record);
|
||||
setShowModelTestModal(true);
|
||||
},
|
||||
},
|
||||
record.channel_info?.is_multi_key && {
|
||||
key: 'multi-key',
|
||||
label: t('多密钥管理'),
|
||||
onClick: () => {
|
||||
setCurrentMultiKeyChannel(record);
|
||||
setShowMultiKeyManageModal(true);
|
||||
},
|
||||
},
|
||||
{
|
||||
key: 'copy',
|
||||
label: t('复制'),
|
||||
onClick: () => {
|
||||
Modal.confirm({
|
||||
title: t('确定是否要复制此渠道?'),
|
||||
content: t('复制渠道的所有信息'),
|
||||
onOk: () => copySelectedChannel(record),
|
||||
});
|
||||
},
|
||||
},
|
||||
{
|
||||
key: 'delete',
|
||||
label: t('删除'),
|
||||
danger: true,
|
||||
onClick: async () => {
|
||||
const content = await buildDeleteConfirmContent(record.id, t);
|
||||
Modal.confirm({
|
||||
title: t('确定是否要删除此渠道?'),
|
||||
content,
|
||||
onOk: () => {
|
||||
(async () => {
|
||||
await manageChannel(record.id, 'delete', record);
|
||||
await refresh();
|
||||
setTimeout(() => {
|
||||
if (channels.length === 0 && activePage > 1) {
|
||||
refresh(activePage - 1);
|
||||
}
|
||||
}, 100);
|
||||
})();
|
||||
},
|
||||
});
|
||||
},
|
||||
},
|
||||
]}
|
||||
>
|
||||
<Button
|
||||
type='link'
|
||||
size='small'
|
||||
onClick={() => testChannel(record, '')}
|
||||
>
|
||||
{t('测试')}
|
||||
</Button>
|
||||
<Button
|
||||
type='link'
|
||||
size='small'
|
||||
onClick={() => {
|
||||
setEditingChannel(record);
|
||||
setShowEdit(true);
|
||||
}}
|
||||
>
|
||||
{t('编辑')}
|
||||
</Button>
|
||||
</TableRowActions>
|
||||
);
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
@@ -18,10 +18,9 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
|
||||
import { Copy as ActionCopy } from '@/components/common/icons/ActionIcons';
|
||||
import { TableRowActions } from '@/components/common/table/TableToolbar';
|
||||
import React from 'react';
|
||||
import { Button as AntButton, Tooltip as AntTooltip } from 'antd';
|
||||
import { Button, Tag, Modal, Tooltip } from '@/components/ui';
|
||||
import { Button, Space, Tag, Modal, Tooltip } from '@/components/ui';
|
||||
import {
|
||||
timestamp2string,
|
||||
getLobeHubIcon,
|
||||
@@ -240,57 +239,64 @@ const renderOperations = (
|
||||
setDetailModel,
|
||||
) => {
|
||||
return (
|
||||
<TableRowActions
|
||||
items={
|
||||
isRoot()
|
||||
? [
|
||||
{
|
||||
key: 'toggle-status',
|
||||
label: record.status === 1 ? t('禁用') : t('启用'),
|
||||
onClick: () =>
|
||||
manageModel(
|
||||
record.id,
|
||||
record.status === 1 ? 'disable' : 'enable',
|
||||
record,
|
||||
),
|
||||
},
|
||||
{
|
||||
key: 'delete',
|
||||
label: t('删除'),
|
||||
danger: true,
|
||||
onClick: () => {
|
||||
Modal.confirm({
|
||||
title: t('确定是否要删除此模型?'),
|
||||
content: t('此修改将不可逆'),
|
||||
onOk: () => {
|
||||
(async () => {
|
||||
await manageModel(record.id, 'delete', record);
|
||||
await refresh();
|
||||
})();
|
||||
},
|
||||
});
|
||||
},
|
||||
},
|
||||
]
|
||||
: []
|
||||
}
|
||||
>
|
||||
<Space wrap className='console-module-row-actions'>
|
||||
<Button type='link' size='small' onClick={() => setDetailModel(record)}>
|
||||
{t('详情')}
|
||||
</Button>
|
||||
{isRoot() && (
|
||||
<Button
|
||||
type='link'
|
||||
size='small'
|
||||
onClick={() => {
|
||||
setEditingModel(record);
|
||||
setShowEdit(true);
|
||||
}}
|
||||
>
|
||||
{t('编辑')}
|
||||
</Button>
|
||||
<>
|
||||
{record.status === 1 ? (
|
||||
<Button
|
||||
type='link'
|
||||
danger
|
||||
size='small'
|
||||
onClick={() => manageModel(record.id, 'disable', record)}
|
||||
>
|
||||
{t('禁用')}
|
||||
</Button>
|
||||
) : (
|
||||
<Button
|
||||
type='link'
|
||||
size='small'
|
||||
onClick={() => manageModel(record.id, 'enable', record)}
|
||||
>
|
||||
{t('启用')}
|
||||
</Button>
|
||||
)}
|
||||
|
||||
<Button
|
||||
type='link'
|
||||
size='small'
|
||||
onClick={() => {
|
||||
setEditingModel(record);
|
||||
setShowEdit(true);
|
||||
}}
|
||||
>
|
||||
{t('编辑')}
|
||||
</Button>
|
||||
|
||||
<Button
|
||||
type='link'
|
||||
danger
|
||||
size='small'
|
||||
onClick={() => {
|
||||
Modal.confirm({
|
||||
title: t('确定是否要删除此模型?'),
|
||||
content: t('此修改将不可逆'),
|
||||
onOk: () => {
|
||||
(async () => {
|
||||
await manageModel(record.id, 'delete', record);
|
||||
await refresh();
|
||||
})();
|
||||
},
|
||||
});
|
||||
}}
|
||||
>
|
||||
{t('删除')}
|
||||
</Button>
|
||||
</>
|
||||
)}
|
||||
</TableRowActions>
|
||||
</Space>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { Copy, Plus, Trash2 } from '@/components/common/icons/ActionIcons';
|
||||
import { Button } from '@/components/ui';
|
||||
import { isAdmin } from '../../../helpers';
|
||||
|
||||
@@ -39,17 +40,25 @@ const RedemptionsActions = ({
|
||||
|
||||
return (
|
||||
<div className='console-list-tool-actions'>
|
||||
<Button onClick={batchCopyRedemptions}>
|
||||
<Button icon={<Copy size={16} />} onClick={batchCopyRedemptions}>
|
||||
{t('复制所选兑换码到剪贴板')}
|
||||
</Button>
|
||||
|
||||
{isAdmin() && (
|
||||
<Button type='danger' onClick={batchDeleteRedemptions}>
|
||||
<Button
|
||||
type='danger'
|
||||
icon={<Trash2 size={16} />}
|
||||
onClick={batchDeleteRedemptions}
|
||||
>
|
||||
{t('清除失效兑换码')}
|
||||
</Button>
|
||||
)}
|
||||
{isAdmin() && (
|
||||
<Button type='primary' onClick={handleAddRedemption}>
|
||||
<Button
|
||||
type='primary'
|
||||
icon={<Plus size={16} />}
|
||||
onClick={handleAddRedemption}
|
||||
>
|
||||
{t('添加兑换码')}
|
||||
</Button>
|
||||
)}
|
||||
|
||||
@@ -18,8 +18,8 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { Tag, Button, Popover } from '@/components/ui';
|
||||
import { TableRowActions } from '@/components/common/table/TableToolbar';
|
||||
import { Tag, Button, Space, Popover, Dropdown } from '@/components/ui';
|
||||
import { IconMore } from '@/components/ui/icons';
|
||||
import {
|
||||
renderQuota,
|
||||
timestamp2string,
|
||||
@@ -147,39 +147,43 @@ export const getRedemptionsColumns = ({
|
||||
title: t('操作'),
|
||||
dataIndex: 'operate',
|
||||
fixed: 'right',
|
||||
width: 215,
|
||||
width: 205,
|
||||
render: (text, record) => {
|
||||
const moreMenuItems = [];
|
||||
if (isAdmin() && !isExpired(record)) {
|
||||
const unused = record.status === REDEMPTION_STATUS.UNUSED;
|
||||
// Create dropdown menu items for more operations
|
||||
const moreMenuItems = [
|
||||
{
|
||||
node: 'item',
|
||||
name: t('删除'),
|
||||
type: 'danger',
|
||||
onClick: () => {
|
||||
showDeleteRedemptionModal(record);
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
if (record.status === REDEMPTION_STATUS.UNUSED && !isExpired(record)) {
|
||||
moreMenuItems.push({
|
||||
key: 'toggle-status',
|
||||
label: unused ? t('禁用') : t('启用'),
|
||||
disabled: record.status === REDEMPTION_STATUS.USED,
|
||||
onClick: () =>
|
||||
manageRedemption(
|
||||
record.id,
|
||||
unused ? REDEMPTION_ACTIONS.DISABLE : REDEMPTION_ACTIONS.ENABLE,
|
||||
record,
|
||||
),
|
||||
node: 'item',
|
||||
name: t('禁用'),
|
||||
type: 'warning',
|
||||
onClick: () => {
|
||||
manageRedemption(record.id, REDEMPTION_ACTIONS.DISABLE, record);
|
||||
},
|
||||
});
|
||||
}
|
||||
moreMenuItems.unshift({
|
||||
key: 'copy',
|
||||
label: t('复制'),
|
||||
onClick: () => copyText(record.key),
|
||||
});
|
||||
if (isAdmin()) {
|
||||
} else if (!isExpired(record)) {
|
||||
moreMenuItems.push({
|
||||
key: 'delete',
|
||||
label: t('删除'),
|
||||
danger: true,
|
||||
onClick: () => showDeleteRedemptionModal(record),
|
||||
node: 'item',
|
||||
name: t('启用'),
|
||||
type: 'secondary',
|
||||
onClick: () => {
|
||||
manageRedemption(record.id, REDEMPTION_ACTIONS.ENABLE, record);
|
||||
},
|
||||
disabled: record.status === REDEMPTION_STATUS.USED,
|
||||
});
|
||||
}
|
||||
|
||||
return (
|
||||
<TableRowActions items={moreMenuItems}>
|
||||
<Space>
|
||||
<Popover
|
||||
// 触屏必须 click:这是查看兑换码明文的唯一入口
|
||||
trigger={hoverOrClickTrigger()}
|
||||
@@ -187,24 +191,41 @@ export const getRedemptionsColumns = ({
|
||||
style={{ padding: 20 }}
|
||||
position='top'
|
||||
>
|
||||
<Button type='link' size='small'>
|
||||
<Button type='tertiary' size='small'>
|
||||
{t('查看')}
|
||||
</Button>
|
||||
</Popover>
|
||||
<Button
|
||||
size='small'
|
||||
onClick={async () => {
|
||||
await copyText(record.key);
|
||||
}}
|
||||
>
|
||||
{t('复制')}
|
||||
</Button>
|
||||
{isAdmin() && (
|
||||
<Button
|
||||
type='link'
|
||||
size='small'
|
||||
onClick={() => {
|
||||
setEditingRedemption(record);
|
||||
setShowEdit(true);
|
||||
}}
|
||||
disabled={record.status !== REDEMPTION_STATUS.UNUSED}
|
||||
>
|
||||
{t('编辑')}
|
||||
</Button>
|
||||
<>
|
||||
<Button
|
||||
type='tertiary'
|
||||
size='small'
|
||||
onClick={() => {
|
||||
setEditingRedemption(record);
|
||||
setShowEdit(true);
|
||||
}}
|
||||
disabled={record.status !== REDEMPTION_STATUS.UNUSED}
|
||||
>
|
||||
{t('编辑')}
|
||||
</Button>
|
||||
<Dropdown
|
||||
trigger='click'
|
||||
position='bottomRight'
|
||||
menu={moreMenuItems}
|
||||
>
|
||||
<Button type='tertiary' size='small' icon={<IconMore />} />
|
||||
</Dropdown>
|
||||
</>
|
||||
)}
|
||||
</TableRowActions>
|
||||
</Space>
|
||||
);
|
||||
},
|
||||
},
|
||||
|
||||
@@ -18,10 +18,11 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { TableRowActions } from '@/components/common/table/TableToolbar';
|
||||
import {
|
||||
Button,
|
||||
Dropdown,
|
||||
Space,
|
||||
SplitButtonGroup,
|
||||
Tag,
|
||||
AvatarGroup,
|
||||
Avatar,
|
||||
@@ -39,7 +40,12 @@ import {
|
||||
getModelCategories,
|
||||
showError,
|
||||
} from '../../../helpers';
|
||||
import { IconCopy, IconEyeOpened, IconEyeClosed } from '@/components/ui/icons';
|
||||
import {
|
||||
IconTreeTriangleDown,
|
||||
IconCopy,
|
||||
IconEyeOpened,
|
||||
IconEyeClosed,
|
||||
} from '@/components/ui/icons';
|
||||
|
||||
// progress color helper
|
||||
const getProgressColor = (pct) => {
|
||||
@@ -321,6 +327,7 @@ const renderOperations = (
|
||||
const name = Object.keys(item)[0];
|
||||
if (!name) continue;
|
||||
chatsArray.push({
|
||||
node: 'item',
|
||||
key: i,
|
||||
name,
|
||||
value: item[name],
|
||||
@@ -333,70 +340,87 @@ const renderOperations = (
|
||||
}
|
||||
|
||||
return (
|
||||
<TableRowActions
|
||||
items={[
|
||||
chatsArray.length > 0 && {
|
||||
key: 'chat-links',
|
||||
label: t('聊天链接'),
|
||||
children: chatsArray.map((item) => ({
|
||||
key: `chat-${item.key}`,
|
||||
label: item.name,
|
||||
onClick: item.onClick,
|
||||
})),
|
||||
},
|
||||
{
|
||||
key: 'status',
|
||||
label: record.status === 1 ? t('禁用') : t('启用'),
|
||||
danger: record.status === 1,
|
||||
onClick: async () => {
|
||||
await manageToken(
|
||||
record.id,
|
||||
record.status === 1 ? 'disable' : 'enable',
|
||||
record,
|
||||
);
|
||||
<Space wrap>
|
||||
<SplitButtonGroup
|
||||
className='overflow-hidden'
|
||||
aria-label={t('项目操作按钮组')}
|
||||
>
|
||||
<Button
|
||||
size='small'
|
||||
type='tertiary'
|
||||
onClick={() => {
|
||||
if (chatsArray.length === 0) {
|
||||
showError(t('请联系管理员配置聊天链接'));
|
||||
} else {
|
||||
const first = chatsArray[0];
|
||||
onOpenLink(first.name, first.value, record);
|
||||
}
|
||||
}}
|
||||
>
|
||||
{t('聊天')}
|
||||
</Button>
|
||||
<Dropdown trigger='click' position='bottomRight' menu={chatsArray}>
|
||||
<Button
|
||||
type='tertiary'
|
||||
icon={<IconTreeTriangleDown />}
|
||||
size='small'
|
||||
></Button>
|
||||
</Dropdown>
|
||||
</SplitButtonGroup>
|
||||
|
||||
{record.status === 1 ? (
|
||||
<Button
|
||||
type='danger'
|
||||
size='small'
|
||||
onClick={async () => {
|
||||
await manageToken(record.id, 'disable', record);
|
||||
await refresh();
|
||||
},
|
||||
},
|
||||
{
|
||||
key: 'edit',
|
||||
label: t('编辑'),
|
||||
onClick: () => {
|
||||
setEditingToken(record);
|
||||
setShowEdit(true);
|
||||
},
|
||||
},
|
||||
{
|
||||
key: 'delete',
|
||||
label: t('删除'),
|
||||
danger: true,
|
||||
onClick: () =>
|
||||
Modal.confirm({
|
||||
title: t('确定是否要删除此密钥?'),
|
||||
content: t('此修改将不可逆'),
|
||||
okButtonProps: { danger: true },
|
||||
onOk: async () => {
|
||||
await manageToken(record.id, 'delete', record);
|
||||
await refresh();
|
||||
},
|
||||
}),
|
||||
},
|
||||
]}
|
||||
>
|
||||
}}
|
||||
>
|
||||
{t('禁用')}
|
||||
</Button>
|
||||
) : (
|
||||
<Button
|
||||
size='small'
|
||||
onClick={async () => {
|
||||
await manageToken(record.id, 'enable', record);
|
||||
await refresh();
|
||||
}}
|
||||
>
|
||||
{t('启用')}
|
||||
</Button>
|
||||
)}
|
||||
|
||||
<Button
|
||||
type='tertiary'
|
||||
size='small'
|
||||
type='link'
|
||||
onClick={() => {
|
||||
if (chatsArray.length === 0) {
|
||||
showError(t('请联系管理员配置聊天链接'));
|
||||
} else {
|
||||
const first = chatsArray[0];
|
||||
onOpenLink(first.name, first.value, record);
|
||||
}
|
||||
setEditingToken(record);
|
||||
setShowEdit(true);
|
||||
}}
|
||||
>
|
||||
{t('聊天')}
|
||||
{t('编辑')}
|
||||
</Button>
|
||||
</TableRowActions>
|
||||
|
||||
<Button
|
||||
type='danger'
|
||||
size='small'
|
||||
onClick={() => {
|
||||
Modal.confirm({
|
||||
title: t('确定是否要删除此密钥?'),
|
||||
content: t('此修改将不可逆'),
|
||||
onOk: () => {
|
||||
(async () => {
|
||||
await manageToken(record.id, 'delete', record);
|
||||
await refresh();
|
||||
})();
|
||||
},
|
||||
});
|
||||
}}
|
||||
>
|
||||
{t('删除')}
|
||||
</Button>
|
||||
</Space>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -33,6 +33,29 @@
|
||||
color: var(--ui-color-primary);
|
||||
}
|
||||
|
||||
.usage-logs-table .ant-table-cell.usage-record-cell-use_time {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.usage-record-use-time {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
vertical-align: middle;
|
||||
gap: 6px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.usage-logs-table .usage-record-use-time .ant-tag {
|
||||
margin-inline-end: 0;
|
||||
padding: 0 6px;
|
||||
border-radius: 6px;
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
font-variant-numeric: tabular-nums;
|
||||
line-height: 22px;
|
||||
}
|
||||
|
||||
.usage-logs-table-shell {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
@@ -130,93 +130,6 @@ function renderType(type, t) {
|
||||
);
|
||||
}
|
||||
|
||||
function renderIsStream(bool, t) {
|
||||
if (bool) {
|
||||
return (
|
||||
<span className='inline-flex items-center gap-1 px-2 py-0.5 rounded-md text-xs font-medium bg-blue-50 dark:bg-blue-950/30 text-blue-600 dark:text-blue-400 border border-blue-200/50 dark:border-blue-800/50'>
|
||||
<span className='w-1 h-1 rounded-full bg-blue-500 animate-pulse' />
|
||||
{t('流')}
|
||||
</span>
|
||||
);
|
||||
} else {
|
||||
return (
|
||||
<span className='inline-flex items-center px-2 py-0.5 rounded-md text-xs font-medium bg-gray-50 dark:bg-gray-900/30 text-gray-500 dark:text-gray-400 border border-gray-200/50 dark:border-gray-700/50'>
|
||||
{t('非流')}
|
||||
</span>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
function renderUseTime(type, t) {
|
||||
const time = parseInt(type);
|
||||
let colorConfig;
|
||||
|
||||
if (time < 101) {
|
||||
colorConfig = {
|
||||
bg: 'bg-emerald-50 dark:bg-emerald-950/30',
|
||||
text: 'text-emerald-600 dark:text-emerald-400',
|
||||
border: 'border-emerald-200/50 dark:border-emerald-800/50',
|
||||
dot: 'bg-emerald-500',
|
||||
};
|
||||
} else if (time < 300) {
|
||||
colorConfig = {
|
||||
bg: 'bg-amber-50 dark:bg-amber-950/30',
|
||||
text: 'text-amber-600 dark:text-amber-400',
|
||||
border: 'border-amber-200/50 dark:border-amber-800/50',
|
||||
dot: 'bg-amber-500',
|
||||
};
|
||||
} else {
|
||||
colorConfig = {
|
||||
bg: 'bg-rose-50 dark:bg-rose-950/30',
|
||||
text: 'text-rose-600 dark:text-rose-400',
|
||||
border: 'border-rose-200/50 dark:border-rose-800/50',
|
||||
dot: 'bg-rose-500',
|
||||
};
|
||||
}
|
||||
|
||||
return (
|
||||
<span
|
||||
className={`inline-flex items-center gap-1 px-2 py-0.5 rounded-md text-xs font-medium ${colorConfig.bg} ${colorConfig.text} border ${colorConfig.border}`}
|
||||
>
|
||||
{time}s
|
||||
</span>
|
||||
);
|
||||
}
|
||||
|
||||
function renderFirstUseTime(type, t) {
|
||||
let time = parseFloat(type) / 1000.0;
|
||||
time = time.toFixed(1);
|
||||
let colorConfig;
|
||||
|
||||
if (time < 3) {
|
||||
colorConfig = {
|
||||
bg: 'bg-teal-50 dark:bg-teal-950/30',
|
||||
text: 'text-teal-600 dark:text-teal-400',
|
||||
border: 'border-teal-200/50 dark:border-teal-800/50',
|
||||
};
|
||||
} else if (time < 10) {
|
||||
colorConfig = {
|
||||
bg: 'bg-orange-50 dark:bg-orange-950/30',
|
||||
text: 'text-orange-600 dark:text-orange-400',
|
||||
border: 'border-orange-200/50 dark:border-orange-800/50',
|
||||
};
|
||||
} else {
|
||||
colorConfig = {
|
||||
bg: 'bg-red-50 dark:bg-red-950/30',
|
||||
text: 'text-red-600 dark:text-red-400',
|
||||
border: 'border-red-200/50 dark:border-red-800/50',
|
||||
};
|
||||
}
|
||||
|
||||
return (
|
||||
<span
|
||||
className={`inline-flex items-center px-2 py-0.5 rounded-md text-xs font-medium ${colorConfig.bg} ${colorConfig.text} border ${colorConfig.border}`}
|
||||
>
|
||||
{time}s
|
||||
</span>
|
||||
);
|
||||
}
|
||||
|
||||
function renderModelName(record, copyText, t, isRootUser) {
|
||||
let other = getLogOther(record.other);
|
||||
let modelMapped =
|
||||
@@ -384,7 +297,7 @@ const applyUsageRecordPresentation = (
|
||||
...baseColumn,
|
||||
width: RECORD_COLUMN_WIDTHS[baseColumn.key],
|
||||
fixed: undefined,
|
||||
className: `usage-record-cell-${baseColumn.key}`,
|
||||
className: baseColumn.className ?? `usage-record-cell-${baseColumn.key}`,
|
||||
};
|
||||
switch (column.key) {
|
||||
case COLUMN_KEYS.TIME:
|
||||
@@ -449,15 +362,6 @@ const applyUsageRecordPresentation = (
|
||||
</button>
|
||||
) : null,
|
||||
};
|
||||
case COLUMN_KEYS.USE_TIME:
|
||||
return {
|
||||
...column,
|
||||
title: t('用时/首字').replace('/', ' / '),
|
||||
render: (text, record) =>
|
||||
record.type === 2 || record.type === 5
|
||||
? renderRecordUseTime(record, t)
|
||||
: null,
|
||||
};
|
||||
case COLUMN_KEYS.PROMPT:
|
||||
case COLUMN_KEYS.COMPLETION:
|
||||
return {
|
||||
@@ -693,34 +597,14 @@ export const getLogsColumns = ({
|
||||
},
|
||||
{
|
||||
key: COLUMN_KEYS.USE_TIME,
|
||||
title: t('用时/首字'),
|
||||
title: t('用时/首字').replace('/', ' / '),
|
||||
dataIndex: 'use_time',
|
||||
render: (text, record, index) => {
|
||||
if (!(record.type === 2 || record.type === 5)) {
|
||||
return <></>;
|
||||
}
|
||||
if (record.is_stream) {
|
||||
let other = getLogOther(record.other);
|
||||
return (
|
||||
<>
|
||||
<Space>
|
||||
{renderUseTime(text, t)}
|
||||
{renderFirstUseTime(other?.frt, t)}
|
||||
{renderIsStream(record.is_stream, t)}
|
||||
</Space>
|
||||
</>
|
||||
);
|
||||
} else {
|
||||
return (
|
||||
<>
|
||||
<Space>
|
||||
{renderUseTime(text, t)}
|
||||
{renderIsStream(record.is_stream, t)}
|
||||
</Space>
|
||||
</>
|
||||
);
|
||||
}
|
||||
},
|
||||
align: 'center',
|
||||
className: 'usage-record-cell-use_time',
|
||||
render: (_, record) =>
|
||||
record.type === 2 || record.type === 5
|
||||
? renderRecordUseTime(record, t)
|
||||
: null,
|
||||
},
|
||||
{
|
||||
key: COLUMN_KEYS.PROMPT,
|
||||
|
||||
@@ -435,7 +435,7 @@ const LogsTable = (logsData) => {
|
||||
if (canView) setDetailRecord(record);
|
||||
}}
|
||||
>
|
||||
{t('查看')}
|
||||
{t('详情')}
|
||||
</AntButton>
|
||||
);
|
||||
}
|
||||
@@ -449,7 +449,7 @@ const LogsTable = (logsData) => {
|
||||
if (canView) setDetailRecord(record);
|
||||
}}
|
||||
>
|
||||
{t('查看')}
|
||||
{t('详情')}
|
||||
</AntButton>
|
||||
);
|
||||
},
|
||||
|
||||
@@ -288,6 +288,7 @@ export function Table({
|
||||
expandedRowKeys,
|
||||
onExpand,
|
||||
expandRowByClick,
|
||||
expandable: nativeExpandable,
|
||||
pagination,
|
||||
size,
|
||||
onChange,
|
||||
@@ -305,7 +306,7 @@ export function Table({
|
||||
onExpand,
|
||||
expandRowByClick,
|
||||
}
|
||||
: undefined;
|
||||
: nativeExpandable;
|
||||
return (
|
||||
<Component
|
||||
{...props}
|
||||
@@ -348,10 +349,15 @@ function CenterPaginatedTable({
|
||||
...props
|
||||
}) {
|
||||
const isMobile = useIsMobile();
|
||||
const config = legacyPagination;
|
||||
const { resetOnDataChange, ...config } = legacyPagination;
|
||||
const local = config.total === undefined;
|
||||
const [localPage, setLocalPage] = React.useState(config.currentPage ?? 1);
|
||||
const [localSize, setLocalSize] = React.useState(config.pageSize ?? 10);
|
||||
const resetLocalPage = local && resetOnDataChange;
|
||||
const resetSource = resetLocalPage ? props.dataSource : undefined;
|
||||
React.useEffect(() => {
|
||||
if (resetLocalPage) setLocalPage(1);
|
||||
}, [resetLocalPage, resetSource]);
|
||||
const pageSize =
|
||||
local && !config.onPageSizeChange ? localSize : (config.pageSize ?? 10);
|
||||
const total = config.total ?? props.dataSource?.length ?? 0;
|
||||
|
||||
@@ -21,7 +21,9 @@ import i18next from 'i18next';
|
||||
|
||||
export const isCenterPaginationScope = () =>
|
||||
typeof window !== 'undefined' &&
|
||||
/^\/(console|org)(\/|$)/.test(window.location?.pathname || '');
|
||||
/^\/(?:console|org|user-center\/key-management)(?:\/|$)/.test(
|
||||
window.location?.pathname || '',
|
||||
);
|
||||
|
||||
export const centerPaginationOptions = (config, isMobile = false) => ({
|
||||
...config,
|
||||
|
||||
@@ -25,7 +25,6 @@ import {
|
||||
ConsoleListTable,
|
||||
} from '../../components/console/ConsolePrimitives';
|
||||
import ConsoleCollection from '../../components/console/ConsoleCollection';
|
||||
import { TableRowActions } from '../../components/common/table/TableToolbar';
|
||||
import { useIsMobile } from '../../hooks/common/useIsMobile';
|
||||
import { createCardProPagination } from '../../helpers/utils';
|
||||
import React, { useEffect, useState, useCallback } from 'react';
|
||||
@@ -40,7 +39,14 @@ import {
|
||||
Spin,
|
||||
Typography,
|
||||
} from '@/components/ui';
|
||||
import { Search } from 'lucide-react';
|
||||
import {
|
||||
Search,
|
||||
Eye as ActionEye,
|
||||
Check as ActionCheck,
|
||||
X as ActionX,
|
||||
Ban as ActionBan,
|
||||
RotateCw as ActionRotateCw,
|
||||
} from '@/components/common/icons/ActionIcons';
|
||||
import { API, showError, showSuccess } from '../../helpers';
|
||||
import {
|
||||
INVOICE_STATUS,
|
||||
@@ -307,53 +313,78 @@ const AdminInvoice = () => {
|
||||
{
|
||||
title: t('操作'),
|
||||
key: 'actions',
|
||||
width: 140,
|
||||
width: 200,
|
||||
fixed: 'right',
|
||||
render: (_, record) => (
|
||||
<TableRowActions
|
||||
items={[
|
||||
record.status === INVOICE_STATUS.PENDING && {
|
||||
key: 'approve',
|
||||
label: t('通过'),
|
||||
onClick: () => {
|
||||
setApproveId(record.id);
|
||||
setApproveVisible(true);
|
||||
},
|
||||
},
|
||||
record.status === INVOICE_STATUS.PENDING && {
|
||||
key: 'reject',
|
||||
label: t('拒绝'),
|
||||
danger: true,
|
||||
onClick: () => {
|
||||
setRejectId(record.id);
|
||||
setRejectVisible(true);
|
||||
},
|
||||
},
|
||||
record.status === INVOICE_STATUS.FAILED && {
|
||||
key: 'retry',
|
||||
label: t('重试'),
|
||||
onClick: () => handleRetry(record.id),
|
||||
},
|
||||
[
|
||||
INVOICE_STATUS.APPROVED,
|
||||
INVOICE_STATUS.INVOICING,
|
||||
INVOICE_STATUS.FAILED,
|
||||
].includes(record.status) && {
|
||||
key: 'cancel',
|
||||
label: t('取消'),
|
||||
danger: true,
|
||||
onClick: () => handleFailCancel(record.id),
|
||||
},
|
||||
]}
|
||||
>
|
||||
<div className='flex items-center gap-1 flex-wrap'>
|
||||
<Button
|
||||
type='link'
|
||||
size='small'
|
||||
theme='borderless'
|
||||
icon={<ActionEye size={14} />}
|
||||
onClick={() => handleViewDetail(record.id)}
|
||||
>
|
||||
{t('详情')}
|
||||
</Button>
|
||||
</TableRowActions>
|
||||
/>
|
||||
{record.status === INVOICE_STATUS.PENDING && (
|
||||
<>
|
||||
<Button
|
||||
size='small'
|
||||
theme='borderless'
|
||||
type='primary'
|
||||
icon={<ActionCheck size={14} />}
|
||||
onClick={() => {
|
||||
setApproveId(record.id);
|
||||
setApproveVisible(true);
|
||||
}}
|
||||
>
|
||||
{t('通过')}
|
||||
</Button>
|
||||
<Button
|
||||
size='small'
|
||||
theme='borderless'
|
||||
type='danger'
|
||||
icon={<ActionX size={14} />}
|
||||
onClick={() => {
|
||||
setRejectId(record.id);
|
||||
setRejectVisible(true);
|
||||
}}
|
||||
>
|
||||
{t('拒绝')}
|
||||
</Button>
|
||||
</>
|
||||
)}
|
||||
{(record.status === INVOICE_STATUS.APPROVED ||
|
||||
record.status === INVOICE_STATUS.INVOICING) && (
|
||||
<Button
|
||||
size='small'
|
||||
theme='borderless'
|
||||
type='danger'
|
||||
icon={<ActionBan size={14} />}
|
||||
onClick={() => handleFailCancel(record.id)}
|
||||
>
|
||||
{t('取消')}
|
||||
</Button>
|
||||
)}
|
||||
{record.status === INVOICE_STATUS.FAILED && (
|
||||
<>
|
||||
<Button
|
||||
size='small'
|
||||
theme='borderless'
|
||||
icon={<ActionRotateCw size={14} />}
|
||||
onClick={() => handleRetry(record.id)}
|
||||
>
|
||||
{t('重试')}
|
||||
</Button>
|
||||
<Button
|
||||
size='small'
|
||||
theme='borderless'
|
||||
type='danger'
|
||||
icon={<ActionBan size={14} />}
|
||||
onClick={() => handleFailCancel(record.id)}
|
||||
>
|
||||
{t('取消')}
|
||||
</Button>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
),
|
||||
},
|
||||
];
|
||||
@@ -374,7 +405,6 @@ const AdminInvoice = () => {
|
||||
placeholder={t('搜索抬头/税号/订单号/用户')}
|
||||
value={keyword}
|
||||
onChange={setKeyword}
|
||||
onEnterPress={handleSearch}
|
||||
/>
|
||||
</ConsoleFilterField>
|
||||
<ConsoleFilterField label={t('状态')} id='invoice-status'>
|
||||
@@ -576,10 +606,10 @@ const AdminInvoice = () => {
|
||||
}}
|
||||
/>
|
||||
</Text>
|
||||
<Table
|
||||
<ConsoleListTable
|
||||
dataSource={detailData.topup_list}
|
||||
rowKey='id'
|
||||
pagination={false}
|
||||
pagination={{ pageSize: 10 }}
|
||||
size='small'
|
||||
columns={[
|
||||
{ title: 'ID', dataIndex: 'id', width: 60 },
|
||||
|
||||
@@ -17,7 +17,6 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
|
||||
import { TableRowActions } from '@/components/common/table/TableToolbar';
|
||||
import {
|
||||
ExternalLink as ActionExternalLink,
|
||||
BarChart3 as ActionBarChart3,
|
||||
@@ -854,70 +853,96 @@ const AdminOrganizations = () => {
|
||||
{
|
||||
title: t('操作'),
|
||||
key: 'actions',
|
||||
width: 140,
|
||||
width: 380,
|
||||
fixed: 'right',
|
||||
render: (_, record) =>
|
||||
isAdmin() ? (
|
||||
<TableRowActions
|
||||
items={[
|
||||
{
|
||||
key: 'quota',
|
||||
label: t('调额'),
|
||||
onClick: () => {
|
||||
render: (_, record) => (
|
||||
<div className='console-module-row-actions'>
|
||||
{isAdmin() && (
|
||||
<>
|
||||
<Button
|
||||
type='link'
|
||||
size='small'
|
||||
onClick={() => openEditModal(record)}
|
||||
>
|
||||
{t('编辑')}
|
||||
</Button>
|
||||
<Button
|
||||
type='link'
|
||||
size='small'
|
||||
onClick={() => {
|
||||
setQuotaOrgId(record.id);
|
||||
setQuotaAmount(0);
|
||||
setQuotaModalVisible(true);
|
||||
},
|
||||
},
|
||||
{
|
||||
key: 'features',
|
||||
label: t('功能开关'),
|
||||
onClick: () => openFeatureModal(record),
|
||||
},
|
||||
{
|
||||
key: 'status',
|
||||
label:
|
||||
record.status === 4
|
||||
? t('激活')
|
||||
: record.status === 1
|
||||
? t('冻结')
|
||||
: t('解冻'),
|
||||
onClick: () =>
|
||||
record.status === 4
|
||||
? handleActivate(record.id)
|
||||
: handleStatusChange(
|
||||
record.id,
|
||||
record.status === 1 ? 2 : 1,
|
||||
),
|
||||
},
|
||||
isRoot() && {
|
||||
key: 'notifications',
|
||||
disabled: alertToggleLoading === record.id,
|
||||
label: alertExcludedIds.has(record.id)
|
||||
? t('恢复通知')
|
||||
: t('屏蔽通知'),
|
||||
title: alertExcludedIds.has(record.id)
|
||||
? t('已屏蔽预警,点击恢复')
|
||||
: t('屏蔽该企业的预警通知'),
|
||||
onClick: () => toggleAlertExclude(record),
|
||||
},
|
||||
{
|
||||
key: 'delete',
|
||||
label: t('删除'),
|
||||
danger: true,
|
||||
onClick: () => handleDelete(record.id),
|
||||
},
|
||||
]}
|
||||
>
|
||||
<Button
|
||||
type='link'
|
||||
size='small'
|
||||
onClick={() => openEditModal(record)}
|
||||
>
|
||||
{t('编辑')}
|
||||
</Button>
|
||||
</TableRowActions>
|
||||
) : null,
|
||||
}}
|
||||
>
|
||||
{t('调额')}
|
||||
</Button>
|
||||
<Button
|
||||
type='link'
|
||||
size='small'
|
||||
onClick={() => openFeatureModal(record)}
|
||||
>
|
||||
{t('功能开关')}
|
||||
</Button>
|
||||
{record.status === 4 ? (
|
||||
<Button
|
||||
size='small'
|
||||
type='link'
|
||||
onClick={() => handleActivate(record.id)}
|
||||
>
|
||||
{t('激活')}
|
||||
</Button>
|
||||
) : record.status === 1 ? (
|
||||
<Button
|
||||
size='small'
|
||||
type='link'
|
||||
onClick={() => handleStatusChange(record.id, 2)}
|
||||
>
|
||||
{t('冻结')}
|
||||
</Button>
|
||||
) : (
|
||||
<Button
|
||||
size='small'
|
||||
type='link'
|
||||
onClick={() => handleStatusChange(record.id, 1)}
|
||||
>
|
||||
{t('解冻')}
|
||||
</Button>
|
||||
)}
|
||||
<Button
|
||||
type='link'
|
||||
size='small'
|
||||
danger
|
||||
onClick={() => handleDelete(record.id)}
|
||||
>
|
||||
{t('删除')}
|
||||
</Button>
|
||||
{isRoot() && (
|
||||
<Button
|
||||
size='small'
|
||||
type='link'
|
||||
loading={alertToggleLoading === record.id}
|
||||
title={
|
||||
alertExcludedIds.has(record.id)
|
||||
? t('已屏蔽预警,点击恢复')
|
||||
: t('屏蔽该企业的预警通知')
|
||||
}
|
||||
aria-label={
|
||||
alertExcludedIds.has(record.id)
|
||||
? t('恢复该企业的预警')
|
||||
: t('屏蔽该企业的预警')
|
||||
}
|
||||
onClick={() => toggleAlertExclude(record)}
|
||||
>
|
||||
{alertExcludedIds.has(record.id)
|
||||
? t('恢复通知')
|
||||
: t('屏蔽通知')}
|
||||
</Button>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
),
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@ export default function LatestTierPanel({
|
||||
columns,
|
||||
onExport,
|
||||
refreshToken,
|
||||
toolbarActions,
|
||||
}) {
|
||||
const { t } = useTranslation();
|
||||
const generation = useRef(0);
|
||||
@@ -42,7 +43,7 @@ export default function LatestTierPanel({
|
||||
const activeContext = useRef(context);
|
||||
activeContext.current = context;
|
||||
const exportRequest = useRef(null);
|
||||
const [query, setQuery] = useState({ status: 'all', page: 1 });
|
||||
const [query, setQuery] = useState({ status: 'all', page: 1, pageSize: 10 });
|
||||
const [state, setState] = useState({
|
||||
items: [],
|
||||
total: 0,
|
||||
@@ -142,16 +143,21 @@ export default function LatestTierPanel({
|
||||
partners={[]}
|
||||
searchableText={() => ''}
|
||||
onExport={exportAll}
|
||||
toolbarActions={toolbarActions}
|
||||
server={{
|
||||
...visible,
|
||||
page: query.page,
|
||||
pageSize: query.pageSize,
|
||||
exporting,
|
||||
onChange: (next) => {
|
||||
generation.current++;
|
||||
exportRequest.current = null;
|
||||
setExporting(false);
|
||||
setState((old) => ({ ...old, items: [], busy: true, error: '' }));
|
||||
setQuery(next);
|
||||
setQuery((current) => ({
|
||||
...next,
|
||||
pageSize: next.pageSize ?? current.pageSize,
|
||||
}));
|
||||
},
|
||||
}}
|
||||
/>
|
||||
|
||||
@@ -21,13 +21,13 @@ import React, { useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Button, Empty, Input, Select } from 'antd';
|
||||
import { Table } from '@/components/ui';
|
||||
import { Search } from '@/components/common/icons/ActionIcons';
|
||||
import { Download, Search } from '@/components/common/icons/ActionIcons';
|
||||
import {
|
||||
ConsoleCard,
|
||||
ConsoleSearchBar,
|
||||
ConsoleSearchActions,
|
||||
ConsoleFilterGrid,
|
||||
ConsoleTabs,
|
||||
} from '../../components/console/ConsolePrimitives';
|
||||
import { ConsoleCollectionSearch } from '../../components/console/ConsoleCollection';
|
||||
import { filterCommissionRows, matchesStatus } from './listFilters';
|
||||
|
||||
export default function ListPanel({
|
||||
@@ -37,6 +37,7 @@ export default function ListPanel({
|
||||
partners,
|
||||
searchableText,
|
||||
onExport,
|
||||
toolbarActions,
|
||||
context,
|
||||
server,
|
||||
}) {
|
||||
@@ -46,6 +47,7 @@ export default function ListPanel({
|
||||
const [scopedIds, setScopedIds] = useState(context?.ids || null);
|
||||
const [status, setStatus] = useState('all');
|
||||
const [page, setPage] = useState(1);
|
||||
const [pageSize, setPageSize] = useState(10);
|
||||
const set = (key, value) =>
|
||||
setDraft((current) => ({ ...current, [key]: value }));
|
||||
const tabSets = {
|
||||
@@ -130,7 +132,6 @@ export default function ListPanel({
|
||||
setScopedIds(null);
|
||||
setPage(1);
|
||||
};
|
||||
const [filtersOpen, setFiltersOpen] = useState(false);
|
||||
return (
|
||||
<div className={`commission-list commission-list--${section}`}>
|
||||
{tabSets[section] && (
|
||||
@@ -175,124 +176,107 @@ export default function ListPanel({
|
||||
</Button>
|
||||
</div>
|
||||
)}
|
||||
<Button
|
||||
className='commission-filter-toggle'
|
||||
aria-expanded={filtersOpen}
|
||||
onClick={() => setFiltersOpen((value) => !value)}
|
||||
>
|
||||
{t(filtersOpen ? '隐藏操作项' : '显示操作项')}
|
||||
</Button>
|
||||
<ConsoleSearchBar
|
||||
className={`commission-filter-card${filtersOpen ? ' is-open' : ''}`}
|
||||
>
|
||||
<form
|
||||
onSubmit={(event) => {
|
||||
event.preventDefault();
|
||||
query();
|
||||
}}
|
||||
<ConsoleCollectionSearch className='commission-filter-card'>
|
||||
<ConsoleFilterGrid
|
||||
onReset={reset}
|
||||
onSearch={query}
|
||||
loading={server?.busy}
|
||||
>
|
||||
<div className='console-search-fields'>
|
||||
<label className='console-search-field commission-search-field'>
|
||||
<span>{t('搜索')}</span>
|
||||
<Input
|
||||
prefix={<Search size={16} aria-hidden />}
|
||||
value={draft.query}
|
||||
onChange={(event) => set('query', event.target.value)}
|
||||
allowClear
|
||||
placeholder={t(placeholders[section])}
|
||||
aria-label={t(placeholders[section])}
|
||||
/>
|
||||
</label>
|
||||
{typeOptions && (
|
||||
<label className='console-search-field commission-search-field'>
|
||||
<span>{t('搜索')}</span>
|
||||
<Input
|
||||
prefix={<Search size={16} aria-hidden />}
|
||||
value={draft.query}
|
||||
onChange={(event) => set('query', event.target.value)}
|
||||
allowClear
|
||||
placeholder={t(placeholders[section])}
|
||||
aria-label={t(placeholders[section])}
|
||||
<span>{t('类型筛选')}</span>
|
||||
<Select
|
||||
aria-label={t('类型筛选')}
|
||||
value={draft.type}
|
||||
onChange={(value) => set('type', value)}
|
||||
options={[
|
||||
{
|
||||
value: '',
|
||||
label: t(
|
||||
section === 'assignments'
|
||||
? '全部客户类型'
|
||||
: section === 'tiers'
|
||||
? '全部来源'
|
||||
: '全部类型',
|
||||
),
|
||||
},
|
||||
...typeOptions.map(([value, label]) => ({
|
||||
value,
|
||||
label: t(label),
|
||||
})),
|
||||
]}
|
||||
/>
|
||||
</label>
|
||||
{typeOptions && (
|
||||
<label className='console-search-field commission-search-field'>
|
||||
<span>{t('类型筛选')}</span>
|
||||
<Select
|
||||
aria-label={t('类型筛选')}
|
||||
value={draft.type}
|
||||
onChange={(value) => set('type', value)}
|
||||
options={[
|
||||
{
|
||||
value: '',
|
||||
label: t(
|
||||
section === 'assignments'
|
||||
? '全部客户类型'
|
||||
: section === 'tiers'
|
||||
? '全部来源'
|
||||
: '全部类型',
|
||||
),
|
||||
},
|
||||
...typeOptions.map(([value, label]) => ({
|
||||
value,
|
||||
label: t(label),
|
||||
})),
|
||||
]}
|
||||
/>
|
||||
</label>
|
||||
)}
|
||||
{section === 'partners' && (
|
||||
<label className='console-search-field commission-search-field'>
|
||||
<span>{t('状态筛选')}</span>
|
||||
<Select
|
||||
aria-label={t('状态筛选')}
|
||||
value={draft.status || ''}
|
||||
onChange={(value) => set('status', value)}
|
||||
options={[
|
||||
'',
|
||||
'draft',
|
||||
'active',
|
||||
'suspended',
|
||||
'terminated',
|
||||
].map((value, i) => ({
|
||||
)}
|
||||
{section === 'partners' && (
|
||||
<label className='console-search-field commission-search-field'>
|
||||
<span>{t('状态筛选')}</span>
|
||||
<Select
|
||||
aria-label={t('状态筛选')}
|
||||
value={draft.status || ''}
|
||||
onChange={(value) => set('status', value)}
|
||||
options={['', 'draft', 'active', 'suspended', 'terminated'].map(
|
||||
(value, i) => ({
|
||||
value,
|
||||
label: t(
|
||||
['全部状态', '草稿', '生效中', '已暂停', '已终止'][i],
|
||||
),
|
||||
}))}
|
||||
/>
|
||||
</label>
|
||||
)}
|
||||
{['assignments', 'bills', 'adjustments'].includes(section) && (
|
||||
<label className='console-search-field commission-search-field'>
|
||||
<span>{t('合作伙伴筛选')}</span>
|
||||
<Select
|
||||
aria-label={t('合作伙伴筛选')}
|
||||
showSearch={{ optionFilterProp: 'label' }}
|
||||
value={draft.partner}
|
||||
onChange={(value) => set('partner', value)}
|
||||
options={[
|
||||
{ value: '', label: t('全部合作伙伴') },
|
||||
...partners.map((row) => ({
|
||||
value: row.id,
|
||||
label: row.name,
|
||||
})),
|
||||
]}
|
||||
/>
|
||||
</label>
|
||||
)}
|
||||
</div>
|
||||
<ConsoleSearchActions
|
||||
onReset={reset}
|
||||
searchLabel='查询'
|
||||
loading={server?.busy}
|
||||
/>
|
||||
</form>
|
||||
</ConsoleSearchBar>
|
||||
}),
|
||||
)}
|
||||
/>
|
||||
</label>
|
||||
)}
|
||||
{['assignments', 'bills', 'adjustments'].includes(section) && (
|
||||
<label className='console-search-field commission-search-field'>
|
||||
<span>{t('合作伙伴筛选')}</span>
|
||||
<Select
|
||||
aria-label={t('合作伙伴筛选')}
|
||||
showSearch={{ optionFilterProp: 'label' }}
|
||||
value={draft.partner}
|
||||
onChange={(value) => set('partner', value)}
|
||||
options={[
|
||||
{ value: '', label: t('全部合作伙伴') },
|
||||
...partners.map((row) => ({
|
||||
value: row.id,
|
||||
label: row.name,
|
||||
})),
|
||||
]}
|
||||
/>
|
||||
</label>
|
||||
)}
|
||||
</ConsoleFilterGrid>
|
||||
</ConsoleCollectionSearch>
|
||||
<ConsoleCard className='commission-card commission-list-card'>
|
||||
<div className='commission-filter-end'>
|
||||
<div className='console-list-tools commission-filter-end'>
|
||||
<span>
|
||||
{t('共 {{count}} 条', {
|
||||
count: server ? server.total : filtered.length,
|
||||
})}
|
||||
</span>
|
||||
{onExport && (
|
||||
<Button
|
||||
loading={server?.exporting}
|
||||
disabled={!!server?.busy}
|
||||
onClick={() => onExport(filtered)}
|
||||
>
|
||||
{t('导出')}
|
||||
</Button>
|
||||
)}
|
||||
<div className='console-list-tool-actions'>
|
||||
{onExport && (
|
||||
<Button
|
||||
icon={<Download size={16} />}
|
||||
loading={server?.exporting}
|
||||
disabled={!!server?.busy}
|
||||
onClick={() => onExport(filtered)}
|
||||
>
|
||||
{t('导出')}
|
||||
</Button>
|
||||
)}
|
||||
{toolbarActions}
|
||||
</div>
|
||||
</div>
|
||||
<Table
|
||||
rowKey='id'
|
||||
@@ -309,18 +293,30 @@ export default function ListPanel({
|
||||
dataSource={filtered}
|
||||
size='middle'
|
||||
scroll={{ x: 'max-content' }}
|
||||
pagination={{
|
||||
size: 'small',
|
||||
pageSize: server ? 100 : 10,
|
||||
total: server ? server.total : filtered.length,
|
||||
current: server ? server.page : page,
|
||||
onChange: (next) => {
|
||||
setPage(next);
|
||||
server?.onChange({ ...filters, status, page: next });
|
||||
},
|
||||
showSizeChanger: false,
|
||||
showTotal: (total) => t('共 {{total}} 条', { total }),
|
||||
}}
|
||||
pagination={
|
||||
(server ? server.total : filtered.length)
|
||||
? {
|
||||
size: 'small',
|
||||
pageSize: server ? server.pageSize : pageSize,
|
||||
total: server ? server.total : filtered.length,
|
||||
currentPage: server ? server.page : page,
|
||||
onPageChange: (next) => {
|
||||
setPage(next);
|
||||
server?.onChange({ ...filters, status, page: next });
|
||||
},
|
||||
onPageSizeChange: (nextSize) => {
|
||||
setPage(1);
|
||||
setPageSize(nextSize);
|
||||
server?.onChange({
|
||||
...filters,
|
||||
status,
|
||||
page: 1,
|
||||
pageSize: nextSize,
|
||||
});
|
||||
},
|
||||
}
|
||||
: false
|
||||
}
|
||||
empty={
|
||||
<Empty
|
||||
image={Empty.PRESENTED_IMAGE_SIMPLE}
|
||||
|
||||
@@ -147,7 +147,7 @@ export default function PartnerDetail({
|
||||
dataSource={assignments.filter(
|
||||
(item) => item.partner_id === row.id,
|
||||
)}
|
||||
pagination={{ pageSize: 5, size: 'small' }}
|
||||
pagination={{ pageSize: 10 }}
|
||||
columns={[
|
||||
{
|
||||
title: t('客户'),
|
||||
|
||||
@@ -18,7 +18,11 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
import { formatIdReference } from '../../helpers/safeDisplay';
|
||||
|
||||
import { TableRowActions } from '@/components/common/table/TableToolbar';
|
||||
import { ConsoleCollectionSearch } from '@/components/console/ConsoleCollection';
|
||||
import {
|
||||
ConsoleFilterField,
|
||||
ConsoleFilterGrid,
|
||||
} from '@/components/console/ConsolePrimitives';
|
||||
import React, {
|
||||
useCallback,
|
||||
useEffect,
|
||||
@@ -44,6 +48,8 @@ import {
|
||||
} from '@/components/ui';
|
||||
import {
|
||||
ArrowLeft as ActionArrowLeft,
|
||||
Download,
|
||||
Search,
|
||||
RefreshCw as ActionRefresh,
|
||||
} from '@/components/common/icons/ActionIcons';
|
||||
import {
|
||||
@@ -148,6 +154,9 @@ export default function PartnerPortal({
|
||||
const [customerStatus, setCustomerStatus] = useState('all');
|
||||
const [billMonth, setBillMonth] = useState('all');
|
||||
const [billStatus, setBillStatus] = useState('all');
|
||||
const [billPage, setBillPage] = useState(1);
|
||||
const [customerPage, setCustomerPage] = useState(1);
|
||||
const [detailPage, setDetailPage] = useState(1);
|
||||
const loadVersion = useRef(0);
|
||||
const detailVersion = useRef(0);
|
||||
const selectedId = useRef(null);
|
||||
@@ -252,6 +261,7 @@ export default function PartnerPortal({
|
||||
setDetailLoading(true);
|
||||
setError('');
|
||||
setQuery('');
|
||||
setDetailPage(1);
|
||||
setAction(null);
|
||||
setReason('');
|
||||
setActionError('');
|
||||
@@ -496,25 +506,9 @@ export default function PartnerPortal({
|
||||
},
|
||||
{
|
||||
title: t('操作'),
|
||||
width: 175,
|
||||
width: 230,
|
||||
render: (_, row) => (
|
||||
<TableRowActions
|
||||
items={[
|
||||
{
|
||||
key: 'export',
|
||||
label: t('导出'),
|
||||
disabled: exportingId !== null || mutationLoading,
|
||||
onClick: () => exportStatement(row),
|
||||
},
|
||||
row.status === 'pending_confirmation' && {
|
||||
key: 'reject',
|
||||
label: t('驳回'),
|
||||
danger: true,
|
||||
disabled: mutationLoading,
|
||||
onClick: () => open(row, 'reject'),
|
||||
},
|
||||
]}
|
||||
>
|
||||
<div className='partner-portal-row-actions'>
|
||||
<Button
|
||||
type='link'
|
||||
size='small'
|
||||
@@ -524,57 +518,119 @@ export default function PartnerPortal({
|
||||
{t('查看')}
|
||||
</Button>
|
||||
{row.status === 'pending_confirmation' && (
|
||||
<Button
|
||||
type='link'
|
||||
size='small'
|
||||
disabled={mutationLoading}
|
||||
onClick={() => open(row, 'confirm')}
|
||||
>
|
||||
{t('确认')}
|
||||
</Button>
|
||||
<>
|
||||
<Button
|
||||
type='link'
|
||||
size='small'
|
||||
disabled={mutationLoading}
|
||||
onClick={() => open(row, 'confirm')}
|
||||
>
|
||||
{t('确认')}
|
||||
</Button>
|
||||
<Button
|
||||
type='link'
|
||||
size='small'
|
||||
danger
|
||||
disabled={mutationLoading}
|
||||
onClick={() => open(row, 'reject')}
|
||||
>
|
||||
{t('驳回')}
|
||||
</Button>
|
||||
</>
|
||||
)}
|
||||
</TableRowActions>
|
||||
<Button
|
||||
type='link'
|
||||
size='small'
|
||||
disabled={exportingId !== null || mutationLoading}
|
||||
loading={exportingId === row.id}
|
||||
onClick={() => exportStatement(row)}
|
||||
>
|
||||
{t('导出')}
|
||||
</Button>
|
||||
</div>
|
||||
),
|
||||
},
|
||||
];
|
||||
|
||||
const refreshButton = (
|
||||
<Button
|
||||
icon={<ActionRefresh size={16} />}
|
||||
disabled={mutationLoading || detailLoading}
|
||||
loading={loading}
|
||||
onClick={() => {
|
||||
load();
|
||||
if (selected) open(selected);
|
||||
}}
|
||||
>
|
||||
{t('刷新')}
|
||||
</Button>
|
||||
);
|
||||
|
||||
const renderBills = () => (
|
||||
<>
|
||||
<ConsoleCollectionSearch>
|
||||
<ConsoleFilterGrid
|
||||
onReset={() => {
|
||||
setBillMonth('all');
|
||||
setBillStatus('all');
|
||||
setBillPage(1);
|
||||
}}
|
||||
onSearch={() => setBillPage(1)}
|
||||
>
|
||||
<ConsoleFilterField label={t('账期')} id='partner-bill-month'>
|
||||
<Select
|
||||
id='partner-bill-month'
|
||||
value={billMonth}
|
||||
onChange={(value) => {
|
||||
setBillMonth(value);
|
||||
setBillPage(1);
|
||||
}}
|
||||
optionList={[
|
||||
{ value: 'all', label: t('全部账期') },
|
||||
...Array.from(new Set(rows.map((row) => row.statement_month)))
|
||||
.sort()
|
||||
.reverse()
|
||||
.map((value) => ({ value, label: value })),
|
||||
]}
|
||||
/>
|
||||
</ConsoleFilterField>
|
||||
<ConsoleFilterField label={t('状态')} id='partner-bill-status'>
|
||||
<Select
|
||||
id='partner-bill-status'
|
||||
value={billStatus}
|
||||
onChange={(value) => {
|
||||
setBillStatus(value);
|
||||
setBillPage(1);
|
||||
}}
|
||||
optionList={[
|
||||
{ value: 'all', label: t('全部状态') },
|
||||
...Array.from(new Set(rows.map((row) => row.status))).map(
|
||||
(value) => ({
|
||||
value,
|
||||
label: commissionLabel(t, 'status', value),
|
||||
}),
|
||||
),
|
||||
]}
|
||||
/>
|
||||
</ConsoleFilterField>
|
||||
</ConsoleFilterGrid>
|
||||
</ConsoleCollectionSearch>
|
||||
<Card className='commission-card partner-portal-card'>
|
||||
<div className='partner-portal-filters'>
|
||||
<Select
|
||||
value={billMonth}
|
||||
onChange={setBillMonth}
|
||||
optionList={[
|
||||
{ value: 'all', label: t('全部账期') },
|
||||
...Array.from(new Set(rows.map((row) => row.statement_month)))
|
||||
.sort()
|
||||
.reverse()
|
||||
.map((value) => ({ value, label: value })),
|
||||
]}
|
||||
/>
|
||||
<Select
|
||||
value={billStatus}
|
||||
onChange={setBillStatus}
|
||||
optionList={[
|
||||
{ value: 'all', label: t('全部状态') },
|
||||
...Array.from(new Set(rows.map((row) => row.status))).map(
|
||||
(value) => ({
|
||||
value,
|
||||
label: commissionLabel(t, 'status', value),
|
||||
}),
|
||||
),
|
||||
]}
|
||||
/>
|
||||
<div className='console-list-tools commission-filter-end'>
|
||||
<Text type='secondary'>
|
||||
{t('共 {{count}} 张账单', { count: visibleBills.length })}
|
||||
</Text>
|
||||
<div className='console-list-tool-actions'>{refreshButton}</div>
|
||||
</div>
|
||||
<Table
|
||||
rowKey='id'
|
||||
dataSource={visibleBills}
|
||||
columns={billColumns}
|
||||
pagination={visibleBills.length > 0 ? { pageSize: 10 } : false}
|
||||
pagination={
|
||||
visibleBills.length > 0
|
||||
? { pageSize: 10, current: billPage, onChange: setBillPage }
|
||||
: false
|
||||
}
|
||||
scroll={{ x: 1120 }}
|
||||
empty={
|
||||
<Empty
|
||||
@@ -697,19 +753,46 @@ export default function PartnerPortal({
|
||||
<Card className='commission-card partner-portal-card'>
|
||||
<Tabs defaultActiveKey='usage' key={selected.id}>
|
||||
<Tabs.TabPane tab={t('单笔消耗明细')} itemKey='usage'>
|
||||
<Input
|
||||
className='partner-portal-detail-search'
|
||||
value={query}
|
||||
onChange={setQuery}
|
||||
placeholder={t('搜索客户、模型、计费记录或档位')}
|
||||
showClear
|
||||
/>
|
||||
<ConsoleCollectionSearch>
|
||||
<ConsoleFilterGrid
|
||||
onReset={() => {
|
||||
setQuery('');
|
||||
setDetailPage(1);
|
||||
}}
|
||||
onSearch={() => setDetailPage(1)}
|
||||
>
|
||||
<ConsoleFilterField
|
||||
label={t('搜索关键字')}
|
||||
id='partner-bill-detail-query'
|
||||
>
|
||||
<Input
|
||||
id='partner-bill-detail-query'
|
||||
prefix={<Search size={16} />}
|
||||
value={query}
|
||||
onChange={(value) => {
|
||||
setQuery(value);
|
||||
setDetailPage(1);
|
||||
}}
|
||||
placeholder={t('搜索客户、模型、计费记录或档位')}
|
||||
showClear
|
||||
/>
|
||||
</ConsoleFilterField>
|
||||
</ConsoleFilterGrid>
|
||||
</ConsoleCollectionSearch>
|
||||
<Table
|
||||
rowKey='id'
|
||||
dataSource={detailItems}
|
||||
columns={BillingColumns(t, money, formatDateTime)}
|
||||
scroll={{ x: 1800 }}
|
||||
pagination={detailItems.length > 0 ? { pageSize: 10 } : false}
|
||||
pagination={
|
||||
detailItems.length > 0
|
||||
? {
|
||||
pageSize: 10,
|
||||
current: detailPage,
|
||||
onChange: setDetailPage,
|
||||
}
|
||||
: false
|
||||
}
|
||||
empty={
|
||||
<Empty
|
||||
image={Empty.PRESENTED_IMAGE_SIMPLE}
|
||||
@@ -922,96 +1005,136 @@ export default function PartnerPortal({
|
||||
);
|
||||
|
||||
const renderCustomers = () => (
|
||||
<Card className='commission-card partner-portal-card'>
|
||||
<Alert
|
||||
showIcon
|
||||
type='info'
|
||||
description={t(
|
||||
'仅展示本伙伴保护期及正式归属期间的信息。转移或终止后的客户消费不在可见范围内。',
|
||||
)}
|
||||
/>
|
||||
<div className='partner-portal-filters'>
|
||||
<Input
|
||||
value={customerQuery}
|
||||
onChange={setCustomerQuery}
|
||||
showClear
|
||||
placeholder={t('搜索客户名称或编号')}
|
||||
<>
|
||||
<Card className='commission-card partner-portal-card'>
|
||||
<Alert
|
||||
showIcon
|
||||
type='info'
|
||||
description={t(
|
||||
'仅展示本伙伴保护期及正式归属期间的信息。转移或终止后的客户消费不在可见范围内。',
|
||||
)}
|
||||
/>
|
||||
<Select
|
||||
value={customerStatus}
|
||||
onChange={setCustomerStatus}
|
||||
optionList={[
|
||||
{ value: 'all', label: t('全部状态') },
|
||||
...Array.from(new Set(customers.map((row) => row.status))).map(
|
||||
(value) => ({
|
||||
value,
|
||||
label: commissionLabel(t, 'status', value),
|
||||
}),
|
||||
),
|
||||
</Card>
|
||||
<ConsoleCollectionSearch>
|
||||
<ConsoleFilterGrid
|
||||
onReset={() => {
|
||||
setCustomerQuery('');
|
||||
setCustomerStatus('all');
|
||||
setCustomerPage(1);
|
||||
}}
|
||||
onSearch={() => setCustomerPage(1)}
|
||||
>
|
||||
<ConsoleFilterField
|
||||
label={t('搜索关键字')}
|
||||
id='partner-customer-query'
|
||||
>
|
||||
<Input
|
||||
id='partner-customer-query'
|
||||
prefix={<Search size={16} />}
|
||||
value={customerQuery}
|
||||
onChange={(value) => {
|
||||
setCustomerQuery(value);
|
||||
setCustomerPage(1);
|
||||
}}
|
||||
showClear
|
||||
placeholder={t('搜索客户名称或编号')}
|
||||
/>
|
||||
</ConsoleFilterField>
|
||||
<ConsoleFilterField label={t('状态')} id='partner-customer-status'>
|
||||
<Select
|
||||
id='partner-customer-status'
|
||||
value={customerStatus}
|
||||
onChange={(value) => {
|
||||
setCustomerStatus(value);
|
||||
setCustomerPage(1);
|
||||
}}
|
||||
optionList={[
|
||||
{ value: 'all', label: t('全部状态') },
|
||||
...Array.from(new Set(customers.map((row) => row.status))).map(
|
||||
(value) => ({
|
||||
value,
|
||||
label: commissionLabel(t, 'status', value),
|
||||
}),
|
||||
),
|
||||
]}
|
||||
/>
|
||||
</ConsoleFilterField>
|
||||
</ConsoleFilterGrid>
|
||||
</ConsoleCollectionSearch>
|
||||
<Card className='commission-card partner-portal-card'>
|
||||
<div className='console-list-tools commission-filter-end'>
|
||||
<Text type='secondary'>
|
||||
{t('共 {{count}} 条归属记录', { count: visibleCustomers.length })}
|
||||
</Text>
|
||||
<div className='console-list-tool-actions'>{refreshButton}</div>
|
||||
</div>
|
||||
<Table
|
||||
rowKey='id'
|
||||
dataSource={visibleCustomers}
|
||||
pagination={
|
||||
visibleCustomers.length > 0
|
||||
? {
|
||||
pageSize: 10,
|
||||
current: customerPage,
|
||||
onChange: setCustomerPage,
|
||||
}
|
||||
: false
|
||||
}
|
||||
scroll={{ x: 1100 }}
|
||||
empty={
|
||||
<Empty
|
||||
image={Empty.PRESENTED_IMAGE_SIMPLE}
|
||||
description={t('暂无客户')}
|
||||
/>
|
||||
}
|
||||
columns={[
|
||||
{
|
||||
title: t('客户'),
|
||||
render: (_, row) => (
|
||||
<b>
|
||||
{row.customer_name ||
|
||||
row.subject_name ||
|
||||
`${commissionLabel(t, 'subjectType', row.subject_type)} #${row.subject_id}`}
|
||||
</b>
|
||||
),
|
||||
},
|
||||
{
|
||||
title: t('类型'),
|
||||
dataIndex: 'subject_type',
|
||||
render: (value) => commissionLabel(t, 'subjectType', value),
|
||||
},
|
||||
{ title: t('归属状态'), dataIndex: 'status', render: tag },
|
||||
{
|
||||
title: t('正式归属起点'),
|
||||
dataIndex: 'formal_at',
|
||||
render: formatDateTime,
|
||||
},
|
||||
{ title: t('保护期开始'), dataIndex: 'started_at', render: date },
|
||||
{
|
||||
title: t('保护期至'),
|
||||
render: (_, row) => date(protectionUntil(row)),
|
||||
},
|
||||
{
|
||||
title: t('保护期剩余天数'),
|
||||
render: (_, row) =>
|
||||
PROTECTED.includes(row.status)
|
||||
? Math.max(
|
||||
0,
|
||||
Math.ceil(
|
||||
(protectionUntil(row) - Date.now() / 1000) / 86400,
|
||||
),
|
||||
)
|
||||
: '—',
|
||||
},
|
||||
{
|
||||
title: t('归属结束'),
|
||||
dataIndex: 'ended_at',
|
||||
render: formatDateTime,
|
||||
},
|
||||
]}
|
||||
/>
|
||||
<Text type='secondary'>
|
||||
{t('共 {{count}} 条归属记录', { count: visibleCustomers.length })}
|
||||
</Text>
|
||||
</div>
|
||||
<Table
|
||||
rowKey='id'
|
||||
dataSource={visibleCustomers}
|
||||
pagination={visibleCustomers.length > 0 ? { pageSize: 10 } : false}
|
||||
scroll={{ x: 1100 }}
|
||||
empty={
|
||||
<Empty
|
||||
image={Empty.PRESENTED_IMAGE_SIMPLE}
|
||||
description={t('暂无客户')}
|
||||
/>
|
||||
}
|
||||
columns={[
|
||||
{
|
||||
title: t('客户'),
|
||||
render: (_, row) => (
|
||||
<b>
|
||||
{row.customer_name ||
|
||||
row.subject_name ||
|
||||
`${commissionLabel(t, 'subjectType', row.subject_type)} #${row.subject_id}`}
|
||||
</b>
|
||||
),
|
||||
},
|
||||
{
|
||||
title: t('类型'),
|
||||
dataIndex: 'subject_type',
|
||||
render: (value) => commissionLabel(t, 'subjectType', value),
|
||||
},
|
||||
{ title: t('归属状态'), dataIndex: 'status', render: tag },
|
||||
{
|
||||
title: t('正式归属起点'),
|
||||
dataIndex: 'formal_at',
|
||||
render: formatDateTime,
|
||||
},
|
||||
{ title: t('保护期开始'), dataIndex: 'started_at', render: date },
|
||||
{
|
||||
title: t('保护期至'),
|
||||
render: (_, row) => date(protectionUntil(row)),
|
||||
},
|
||||
{
|
||||
title: t('保护期剩余天数'),
|
||||
render: (_, row) =>
|
||||
PROTECTED.includes(row.status)
|
||||
? Math.max(
|
||||
0,
|
||||
Math.ceil(
|
||||
(protectionUntil(row) - Date.now() / 1000) / 86400,
|
||||
),
|
||||
)
|
||||
: '—',
|
||||
},
|
||||
{
|
||||
title: t('归属结束'),
|
||||
dataIndex: 'ended_at',
|
||||
render: formatDateTime,
|
||||
},
|
||||
]}
|
||||
/>
|
||||
</Card>
|
||||
</Card>
|
||||
</>
|
||||
);
|
||||
|
||||
const renderEstimate = () => (
|
||||
@@ -1055,7 +1178,7 @@ export default function PartnerPortal({
|
||||
className='partner-portal-estimate-table'
|
||||
rowKey='statement_month'
|
||||
dataSource={realtime}
|
||||
pagination={false}
|
||||
pagination={realtime.length ? { pageSize: 10 } : false}
|
||||
empty={
|
||||
<Empty
|
||||
image={Empty.PRESENTED_IMAGE_SIMPLE}
|
||||
@@ -1266,6 +1389,7 @@ export default function PartnerPortal({
|
||||
{selected && (
|
||||
<>
|
||||
<Button
|
||||
icon={<Download size={16} />}
|
||||
disabled={detailLoading || mutationLoading}
|
||||
onClick={() =>
|
||||
exportDetails(items, adjustments, selected, t)
|
||||
@@ -1301,17 +1425,10 @@ export default function PartnerPortal({
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
<Button
|
||||
icon={<ActionRefresh size={16} />}
|
||||
disabled={mutationLoading || detailLoading}
|
||||
loading={loading}
|
||||
onClick={() => {
|
||||
load();
|
||||
if (selected) open(selected);
|
||||
}}
|
||||
>
|
||||
{t('刷新')}
|
||||
</Button>
|
||||
{(selected ||
|
||||
!loaded ||
|
||||
!['bills', 'customers'].includes(active)) &&
|
||||
refreshButton}
|
||||
</div>
|
||||
</div>
|
||||
{error && <Alert showIcon type='error' description={error} />}
|
||||
|
||||
+174
-131
@@ -67,7 +67,13 @@ import { partnerScope, createPartnerTransport } from './partnerScope';
|
||||
import { tierStatus } from './listFilters';
|
||||
import { Button, DatePicker, Empty, Select, Spin, Tag, Typography } from 'antd';
|
||||
import dayjs from 'dayjs';
|
||||
import { Plus, RefreshCw } from '../../components/common/icons/ActionIcons';
|
||||
import {
|
||||
Download,
|
||||
History,
|
||||
Link,
|
||||
Plus,
|
||||
RefreshCw,
|
||||
} from '../../components/common/icons/ActionIcons';
|
||||
import { API } from '../../helpers';
|
||||
import * as XLSX from 'xlsx';
|
||||
import { TableRowActions } from '@/components/common/table/TableToolbar';
|
||||
@@ -208,7 +214,7 @@ function TierSummary({ items }) {
|
||||
rowKey='id'
|
||||
size='small'
|
||||
dataSource={groups}
|
||||
pagination={false}
|
||||
pagination={groups.length ? { pageSize: 10 } : false}
|
||||
columns={[
|
||||
{ title: t('客户'), dataIndex: 'customer' },
|
||||
{ title: t('分佣档位'), dataIndex: 'tier' },
|
||||
@@ -232,7 +238,7 @@ function PaymentTable({ payments, admin = false }) {
|
||||
<Table
|
||||
rowKey='id'
|
||||
dataSource={payments}
|
||||
pagination={false}
|
||||
pagination={payments.length ? { pageSize: 10 } : false}
|
||||
empty={emptyState(t('暂无付款记录'))}
|
||||
columns={[
|
||||
{ title: t('打款日期'), dataIndex: 'paid_at', render: formatDateTime },
|
||||
@@ -280,7 +286,7 @@ function AdminStatementDetail({
|
||||
<Button onClick={onBack} type='text'>
|
||||
{t('返回账单列表')}
|
||||
</Button>
|
||||
<div className='commission-detail-actions'>
|
||||
<div className='commission-detail-actions console-list-tool-actions'>
|
||||
{(status === 'estimated' || status === 'checking') && (
|
||||
<Button
|
||||
icon={<RefreshCw size={16} />}
|
||||
@@ -297,7 +303,9 @@ function AdminStatementDetail({
|
||||
(status === 'estimated' || status === 'checking') && (
|
||||
<Button onClick={onFee}>{t('录入手续费')}</Button>
|
||||
)}
|
||||
<Button onClick={onExport}>{t('导出明细')}</Button>
|
||||
<Button icon={<Download size={16} />} onClick={onExport}>
|
||||
{t('导出明细')}
|
||||
</Button>
|
||||
{status === 'pending_confirmation' && (
|
||||
<Button onClick={onDeadline}>{t('修改确认截止日期')}</Button>
|
||||
)}
|
||||
@@ -440,9 +448,7 @@ function AdminStatementDetail({
|
||||
rowKey='id'
|
||||
columns={itemColumns}
|
||||
dataSource={items}
|
||||
pagination={{
|
||||
pageSize: 10,
|
||||
}}
|
||||
pagination={items.length ? { pageSize: 10 } : false}
|
||||
scroll={{ x: 1800 }}
|
||||
empty={emptyState(t('暂无计费明细'))}
|
||||
/>
|
||||
@@ -458,7 +464,7 @@ function AdminStatementDetail({
|
||||
<Table
|
||||
rowKey='id'
|
||||
dataSource={operations}
|
||||
pagination={false}
|
||||
pagination={operations.length ? { pageSize: 10 } : false}
|
||||
empty={emptyState(t('暂无操作记录'))}
|
||||
columns={[
|
||||
{
|
||||
@@ -514,7 +520,7 @@ function AdminStatementDetail({
|
||||
<Table
|
||||
rowKey='id'
|
||||
dataSource={adjustments}
|
||||
pagination={false}
|
||||
pagination={adjustments.length ? { pageSize: 10 } : false}
|
||||
empty={emptyState(t('暂无调整单'))}
|
||||
columns={[
|
||||
...AdjustmentColumns(t, money),
|
||||
@@ -886,7 +892,7 @@ function AdminPage() {
|
||||
type='link'
|
||||
size='small'
|
||||
>
|
||||
{t('查看详情')}
|
||||
{t('详情')}
|
||||
</Button>
|
||||
),
|
||||
},
|
||||
@@ -1151,62 +1157,84 @@ function AdminPage() {
|
||||
},
|
||||
{
|
||||
title: t('操作'),
|
||||
width: 155,
|
||||
width: 300,
|
||||
render: (_, row) => (
|
||||
<TableRowActions
|
||||
items={[
|
||||
row.status === 'protected' && {
|
||||
key: 'extend',
|
||||
label: t('延期'),
|
||||
onClick: () =>
|
||||
setOperation({ kind: 'assignment-extend', row }),
|
||||
},
|
||||
[
|
||||
'protected',
|
||||
'protected_extended',
|
||||
'pending_conversion',
|
||||
].includes(row.status) && {
|
||||
key: 'convert',
|
||||
label: t('转正'),
|
||||
onClick: () =>
|
||||
setOperation({ kind: 'assignment-convert', row }),
|
||||
},
|
||||
row.status === 'pending_conversion' && {
|
||||
key: 'reject',
|
||||
label: t('驳回'),
|
||||
onClick: () =>
|
||||
setOperation({ kind: 'assignment-reject', row }),
|
||||
},
|
||||
row.status === 'formal' && {
|
||||
key: 'transfer',
|
||||
label: t('转移'),
|
||||
onClick: () =>
|
||||
setOperation({ kind: 'assignment-transfer', row }),
|
||||
},
|
||||
[
|
||||
'formal',
|
||||
'protected',
|
||||
'protected_extended',
|
||||
'pending_conversion',
|
||||
].includes(row.status) && {
|
||||
key: 'terminate',
|
||||
label: t('终止'),
|
||||
danger: true,
|
||||
onClick: () =>
|
||||
setOperation({ kind: 'assignment-terminate', row }),
|
||||
},
|
||||
]}
|
||||
>
|
||||
<div className='commission-row-actions'>
|
||||
<Button
|
||||
type='link'
|
||||
size='small'
|
||||
onClick={() =>
|
||||
setOperation({ kind: 'assignment-history', row })
|
||||
}
|
||||
type='link'
|
||||
size='small'
|
||||
>
|
||||
{t('历史')}
|
||||
</Button>
|
||||
</TableRowActions>
|
||||
{row.status === 'protected' && (
|
||||
<Button
|
||||
onClick={() =>
|
||||
setOperation({ kind: 'assignment-extend', row })
|
||||
}
|
||||
type='link'
|
||||
size='small'
|
||||
>
|
||||
{t('延期')}
|
||||
</Button>
|
||||
)}
|
||||
{[
|
||||
'protected',
|
||||
'protected_extended',
|
||||
'pending_conversion',
|
||||
].includes(row.status) && (
|
||||
<Button
|
||||
onClick={() =>
|
||||
setOperation({ kind: 'assignment-convert', row })
|
||||
}
|
||||
type='link'
|
||||
size='small'
|
||||
>
|
||||
{t('转正')}
|
||||
</Button>
|
||||
)}
|
||||
{row.status === 'pending_conversion' && (
|
||||
<Button
|
||||
onClick={() =>
|
||||
setOperation({ kind: 'assignment-reject', row })
|
||||
}
|
||||
type='link'
|
||||
size='small'
|
||||
>
|
||||
{t('驳回')}
|
||||
</Button>
|
||||
)}
|
||||
{row.status === 'formal' && (
|
||||
<Button
|
||||
onClick={() =>
|
||||
setOperation({ kind: 'assignment-transfer', row })
|
||||
}
|
||||
type='link'
|
||||
size='small'
|
||||
>
|
||||
{t('转移')}
|
||||
</Button>
|
||||
)}
|
||||
{[
|
||||
'formal',
|
||||
'protected',
|
||||
'protected_extended',
|
||||
'pending_conversion',
|
||||
].includes(row.status) && (
|
||||
<Button
|
||||
onClick={() =>
|
||||
setOperation({ kind: 'assignment-terminate', row })
|
||||
}
|
||||
type='link'
|
||||
size='small'
|
||||
danger
|
||||
>
|
||||
{t('终止')}
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
),
|
||||
},
|
||||
],
|
||||
@@ -1472,6 +1500,88 @@ function AdminPage() {
|
||||
);
|
||||
XLSX.writeFile(workbook, `commission-${key}-${month}.xlsx`);
|
||||
};
|
||||
const listToolbarActions = (
|
||||
<>
|
||||
<Button icon={<RefreshCw size={16} />} onClick={load}>
|
||||
{t('刷新')}
|
||||
</Button>
|
||||
{active === 'partners' && (
|
||||
<Button
|
||||
icon={<Plus size={16} />}
|
||||
onClick={(event) => {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
setOperation({ kind: 'partner-create' });
|
||||
setError('');
|
||||
}}
|
||||
type='primary'
|
||||
>
|
||||
{t('新建伙伴档案')}
|
||||
</Button>
|
||||
)}
|
||||
{active === 'assignments' && (
|
||||
<Button
|
||||
icon={<Plus size={16} />}
|
||||
onClick={(event) => {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
setOperation({ kind: 'assignment-create' });
|
||||
setError('');
|
||||
}}
|
||||
type='primary'
|
||||
>
|
||||
{t('建立保护归属')}
|
||||
</Button>
|
||||
)}
|
||||
{active === 'tiers' && (
|
||||
<Button
|
||||
icon={<Plus size={16} />}
|
||||
onClick={(event) => {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
setOperation({ kind: 'tier-create' });
|
||||
setError('');
|
||||
}}
|
||||
type='primary'
|
||||
>
|
||||
{t('新增档位')}
|
||||
</Button>
|
||||
)}
|
||||
{active === 'adjustments' && (
|
||||
<Button
|
||||
icon={<Plus size={16} />}
|
||||
onClick={() => {
|
||||
setAdjustmentStatementId(null);
|
||||
setAdjustmentPicker(true);
|
||||
}}
|
||||
type='primary'
|
||||
>
|
||||
{t('新增调整单')}
|
||||
</Button>
|
||||
)}
|
||||
{active === 'tiers' && (
|
||||
<>
|
||||
<Button
|
||||
icon={<Link size={16} />}
|
||||
onClick={() => setOperation({ kind: 'tier-binding' })}
|
||||
>
|
||||
{t('绑定等级档位')}
|
||||
</Button>
|
||||
<Button
|
||||
icon={<History size={16} />}
|
||||
onClick={() => setOperation({ kind: 'tier-history' })}
|
||||
>
|
||||
{t('绑定历史')}
|
||||
</Button>
|
||||
</>
|
||||
)}
|
||||
{active === 'bills' && (
|
||||
<Button icon={<Download size={16} />} onClick={exportStatements}>
|
||||
{t('导出 Excel')}
|
||||
</Button>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
const tableFor = (key) =>
|
||||
key === 'tiers' ? (
|
||||
<LatestTierPanel
|
||||
@@ -1479,6 +1589,7 @@ function AdminPage() {
|
||||
columns={columns.tiers}
|
||||
onExport={(rows) => exportRows('tiers', rows)}
|
||||
refreshToken={data}
|
||||
toolbarActions={listToolbarActions}
|
||||
/>
|
||||
) : (
|
||||
<ListPanel
|
||||
@@ -1490,6 +1601,7 @@ function AdminPage() {
|
||||
searchableText={rowText}
|
||||
onExport={(rows) => exportRows(key, rows)}
|
||||
context={listContext}
|
||||
toolbarActions={listToolbarActions}
|
||||
/>
|
||||
);
|
||||
return (
|
||||
@@ -1532,80 +1644,11 @@ function AdminPage() {
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
<Button icon={<RefreshCw size={16} />} onClick={load}>
|
||||
{t('刷新')}
|
||||
</Button>
|
||||
{active === 'partners' && (
|
||||
<Button
|
||||
icon={<Plus size={16} />}
|
||||
onClick={(event) => {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
setOperation({ kind: 'partner-create' });
|
||||
setError('');
|
||||
}}
|
||||
type='primary'
|
||||
>
|
||||
{t('新建伙伴档案')}
|
||||
{(active === 'overview' || selectedStatement) && (
|
||||
<Button icon={<RefreshCw size={16} />} onClick={load}>
|
||||
{t('刷新')}
|
||||
</Button>
|
||||
)}
|
||||
{active === 'assignments' && (
|
||||
<Button
|
||||
icon={<Plus size={16} />}
|
||||
onClick={(event) => {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
setOperation({ kind: 'assignment-create' });
|
||||
setError('');
|
||||
}}
|
||||
type='primary'
|
||||
>
|
||||
{t('建立保护归属')}
|
||||
</Button>
|
||||
)}
|
||||
{active === 'tiers' && (
|
||||
<Button
|
||||
icon={<Plus size={16} />}
|
||||
onClick={(event) => {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
setOperation({ kind: 'tier-create' });
|
||||
setError('');
|
||||
}}
|
||||
type='primary'
|
||||
>
|
||||
{t('新增档位')}
|
||||
</Button>
|
||||
)}
|
||||
{active === 'adjustments' && (
|
||||
<Button
|
||||
icon={<Plus size={16} />}
|
||||
onClick={() => {
|
||||
setAdjustmentStatementId(null);
|
||||
setAdjustmentPicker(true);
|
||||
}}
|
||||
type='primary'
|
||||
>
|
||||
{t('新增调整单')}
|
||||
</Button>
|
||||
)}
|
||||
{active === 'tiers' && (
|
||||
<>
|
||||
<Button
|
||||
onClick={() => setOperation({ kind: 'tier-binding' })}
|
||||
>
|
||||
{t('绑定等级档位')}
|
||||
</Button>
|
||||
<Button
|
||||
onClick={() => setOperation({ kind: 'tier-history' })}
|
||||
>
|
||||
{t('绑定历史')}
|
||||
</Button>
|
||||
</>
|
||||
)}
|
||||
{active === 'bills' && !selectedStatement && (
|
||||
<Button onClick={exportStatements}>{t('导出 Excel')}</Button>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
{error && (
|
||||
|
||||
@@ -20,7 +20,7 @@ export function latestTierURL(filters = {}, page = 1, snapshot = {}) {
|
||||
const params = new URLSearchParams({
|
||||
view: 'latest',
|
||||
p: String(page),
|
||||
page_size: '100',
|
||||
page_size: String(filters.pageSize ?? 100),
|
||||
});
|
||||
if (filters.query?.trim()) params.set('q', filters.query.trim());
|
||||
if (filters.type) params.set('source_type', filters.type);
|
||||
@@ -39,7 +39,9 @@ export async function fetchAllLatestTiers(fetchJSON, filters = {}) {
|
||||
let snapshot;
|
||||
let total;
|
||||
for (let page = 1; ; page++) {
|
||||
const result = await fetchJSON(latestTierURL(filters, page, snapshot));
|
||||
const result = await fetchJSON(
|
||||
latestTierURL({ ...filters, pageSize: 100 }, page, snapshot),
|
||||
);
|
||||
if (!snapshot) {
|
||||
snapshot = { as_of: result.as_of, revision: result.revision };
|
||||
total = result.total;
|
||||
|
||||
@@ -57,6 +57,9 @@ test('latest all status is omitted and export pins server snapshot across all pa
|
||||
),
|
||||
false,
|
||||
);
|
||||
const listURL = new URL(latestTierURL({ pageSize: 20 }, 2), 'http://local');
|
||||
assert.equal(listURL.searchParams.get('page_size'), '20');
|
||||
assert.equal(listURL.searchParams.get('p'), '2');
|
||||
const urls = [];
|
||||
const rows = await fetchAllLatestTiers(
|
||||
async (url) => {
|
||||
@@ -69,9 +72,10 @@ test('latest all status is omitted and export pins server snapshot across all pa
|
||||
revision: 7,
|
||||
};
|
||||
},
|
||||
{ query: '中文', type: 'level' },
|
||||
{ query: '中文', type: 'level', pageSize: 20 },
|
||||
);
|
||||
assert.equal(rows.length, 2);
|
||||
assert.ok(urls.every((url) => /page_size=100/.test(url)));
|
||||
assert.match(urls[1], /as_of=123/);
|
||||
assert.match(urls[1], /revision=7/);
|
||||
});
|
||||
|
||||
@@ -975,7 +975,7 @@ export function OperationsDialog({
|
||||
<Table
|
||||
rowKey='id'
|
||||
dataSource={history}
|
||||
pagination={{ pageSize: 10, showTotal: true }}
|
||||
pagination={{ pageSize: 10 }}
|
||||
empty={
|
||||
<Empty
|
||||
image={Empty.PRESENTED_IMAGE_SIMPLE}
|
||||
|
||||
@@ -905,8 +905,7 @@
|
||||
margin-top: 18px;
|
||||
}
|
||||
.commission-filter-end {
|
||||
justify-content: flex-end;
|
||||
margin-bottom: 18px;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
.commission-search-field {
|
||||
display: flex;
|
||||
@@ -919,17 +918,6 @@
|
||||
.commission-search-field .ant-select {
|
||||
width: 100%;
|
||||
}
|
||||
.commission-filter-card .console-search-fields {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, minmax(0, 1fr));
|
||||
gap: 16px;
|
||||
}
|
||||
.commission-filter-card .console-search-actions {
|
||||
margin-top: 16px;
|
||||
}
|
||||
.commission-filter-toggle.ant-btn {
|
||||
display: none;
|
||||
}
|
||||
.commission-detail-tabs {
|
||||
margin-top: 18px;
|
||||
padding: 8px 24px 24px;
|
||||
@@ -948,19 +936,9 @@
|
||||
outline-offset: 2px;
|
||||
}
|
||||
@media (max-width: 768px) {
|
||||
.commission-filter-card .console-search-fields {
|
||||
grid-template-columns: minmax(0, 1fr);
|
||||
}
|
||||
.commission-card > .ant-card-body {
|
||||
padding: 16px;
|
||||
}
|
||||
.commission-filter-toggle.ant-btn {
|
||||
display: inline-flex;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
.commission-filter-card:not(.is-open) {
|
||||
display: none;
|
||||
}
|
||||
.commission-page-header {
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
|
||||
@@ -24,7 +24,6 @@ import {
|
||||
Trash2 as ActionTrash2,
|
||||
AlertCircle as ActionAlertCircle,
|
||||
} from '@/components/common/icons/ActionIcons';
|
||||
import { TableRowActions } from '@/components/common/table/TableToolbar';
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import {
|
||||
Table,
|
||||
@@ -240,63 +239,69 @@ const VideoTaskQueue = ({
|
||||
{
|
||||
title: t('操作'),
|
||||
dataIndex: 'operate',
|
||||
width: 168,
|
||||
width: !isCompact ? 220 : 180,
|
||||
fixed: 'right',
|
||||
render: (text, record) => {
|
||||
const normalizedStatus = normalizeVideoTaskStatus(record.status);
|
||||
|
||||
return (
|
||||
<TableRowActions
|
||||
items={[
|
||||
normalizedStatus === 'success' && {
|
||||
key: 'download',
|
||||
label: t('下载'),
|
||||
onClick: () => onDownload(record),
|
||||
icon: <ActionDownload size={14} />,
|
||||
},
|
||||
(normalizedStatus === 'success' ||
|
||||
normalizedStatus === 'failure') &&
|
||||
canRegenerateVideoTask(record) && {
|
||||
key: 'regenerate',
|
||||
label: t('再生成'),
|
||||
onClick: () => onRegenerate && onRegenerate(record),
|
||||
icon: <ActionRefreshCw size={14} />,
|
||||
},
|
||||
{
|
||||
key: 'delete',
|
||||
label: t('删除'),
|
||||
onClick: () => {
|
||||
Modal.warning({
|
||||
title: t('确定删除此任务?'),
|
||||
content: t('删除后将无法恢复'),
|
||||
icon: (
|
||||
<ActionAlertCircle
|
||||
size={24}
|
||||
style={{ color: '#f59e0b' }}
|
||||
/>
|
||||
),
|
||||
okText: t('确定'),
|
||||
cancelText: t('取消'),
|
||||
onOk: () => onDelete(record.task_id),
|
||||
centered: true,
|
||||
okButtonProps: { type: 'danger' },
|
||||
});
|
||||
},
|
||||
icon: <ActionTrash2 size={14} />,
|
||||
danger: true,
|
||||
},
|
||||
]}
|
||||
>
|
||||
<Space>
|
||||
{/* 播放和下载按钮:仅根据状态显示,视频URL在点击时才获取 */}
|
||||
{normalizedStatus === 'success' && (
|
||||
<Button
|
||||
size='small'
|
||||
type='tertiary'
|
||||
icon={<ActionPlay size={14} />}
|
||||
onClick={() => onPlay && onPlay(record)}
|
||||
>
|
||||
{t('播放')}
|
||||
</Button>
|
||||
<>
|
||||
<Button
|
||||
size='small'
|
||||
type='tertiary'
|
||||
icon={<ActionPlay size={14} />}
|
||||
onClick={() => onPlay && onPlay(record)}
|
||||
>
|
||||
{!isCompact ? t('播放') : ''}
|
||||
</Button>
|
||||
<Button
|
||||
size='small'
|
||||
type='tertiary'
|
||||
icon={<ActionDownload size={14} />}
|
||||
onClick={() => onDownload(record)}
|
||||
>
|
||||
{!isCompact ? t('下载') : ''}
|
||||
</Button>
|
||||
</>
|
||||
)}
|
||||
</TableRowActions>
|
||||
{/* 再生成按钮 - 对所有已完成或失败的任务显示 */}
|
||||
{(normalizedStatus === 'success' ||
|
||||
normalizedStatus === 'failure') &&
|
||||
canRegenerateVideoTask(record) && (
|
||||
<Button
|
||||
size='small'
|
||||
type='primary'
|
||||
icon={<ActionRefreshCw size={14} />}
|
||||
onClick={() => onRegenerate && onRegenerate(record)}
|
||||
>
|
||||
{!isCompact ? t('再生成') : ''}
|
||||
</Button>
|
||||
)}
|
||||
<Button
|
||||
size='small'
|
||||
type='danger'
|
||||
icon={<ActionTrash2 size={14} />}
|
||||
onClick={() => {
|
||||
Modal.warning({
|
||||
title: t('确定删除此任务?'),
|
||||
content: t('删除后将无法恢复'),
|
||||
icon: (
|
||||
<ActionAlertCircle size={24} style={{ color: '#f59e0b' }} />
|
||||
),
|
||||
okText: t('确定'),
|
||||
cancelText: t('取消'),
|
||||
onOk: () => onDelete(record.task_id),
|
||||
centered: true,
|
||||
okButtonProps: { type: 'danger' },
|
||||
});
|
||||
}}
|
||||
>
|
||||
{!isCompact ? t('删除') : ''}
|
||||
</Button>
|
||||
</Space>
|
||||
);
|
||||
},
|
||||
},
|
||||
|
||||
@@ -24,10 +24,15 @@ import {
|
||||
Copy as ActionCopy,
|
||||
BookOpen as ActionBookOpen,
|
||||
HelpCircle as ActionHelpCircle,
|
||||
Search as ActionSearch,
|
||||
Plus as ActionPlus,
|
||||
Search as ActionSearch,
|
||||
} from '@/components/common/icons/ActionIcons';
|
||||
import { writeClipboardText } from '../../helpers/clipboard';
|
||||
import { ConsoleCollectionSearch } from '../../components/console/ConsoleCollection';
|
||||
import {
|
||||
ConsoleFilterField,
|
||||
ConsoleFilterGrid,
|
||||
} from '../../components/console/ConsolePrimitives';
|
||||
import TableEmpty from '../../components/common/table/TableEmpty';
|
||||
import React, { useState, useRef, useEffect, useContext } from 'react';
|
||||
import Table from '../../components/ui/CenterActionTable';
|
||||
@@ -892,35 +897,28 @@ const KeyManagement = ({ embedded = false }) => {
|
||||
<DesensitizeNotice t={t} />
|
||||
|
||||
<div className='km-panels'>
|
||||
<Card className='km-card km-search-card tour-search-input'>
|
||||
<label className='km-search-label' htmlFor='km-search-input'>
|
||||
{t('密钥查询')}
|
||||
</label>
|
||||
<div className='km-search-row'>
|
||||
<Input
|
||||
id='km-search-input'
|
||||
className='km-search-input'
|
||||
placeholder={t('搜索密钥名称、Key 或分组')}
|
||||
value={searchValue}
|
||||
onChange={(event) => setSearchValue(event.target.value)}
|
||||
onPressEnter={() => setSearchValue(searchValue)}
|
||||
allowClear
|
||||
/>
|
||||
<Button onClick={() => setSearchValue('')}>{t('重置')}</Button>
|
||||
<Button
|
||||
type='primary'
|
||||
icon={<ActionSearch size={14} />}
|
||||
onClick={() => setSearchValue(searchValue)}
|
||||
>
|
||||
{t('搜索')}
|
||||
</Button>
|
||||
</div>
|
||||
</Card>
|
||||
<ConsoleCollectionSearch className='km-card km-search-card tour-search-input'>
|
||||
<ConsoleFilterGrid
|
||||
onReset={() => setSearchValue('')}
|
||||
onSearch={() => setSearchValue(searchValue.trim())}
|
||||
>
|
||||
<ConsoleFilterField label={t('密钥查询')} id='km-search-input'>
|
||||
<Input
|
||||
id='km-search-input'
|
||||
prefix={<ActionSearch size={14} />}
|
||||
placeholder={t('搜索密钥名称、Key 或分组')}
|
||||
value={searchValue}
|
||||
onChange={(event) => setSearchValue(event.target.value)}
|
||||
allowClear
|
||||
/>
|
||||
</ConsoleFilterField>
|
||||
</ConsoleFilterGrid>
|
||||
</ConsoleCollectionSearch>
|
||||
|
||||
<Card className='km-card km-list-card'>
|
||||
<div className='km-list-head'>
|
||||
<div className='km-list-head console-list-tools'>
|
||||
<h2>{t('密钥列表')}</h2>
|
||||
<div className='km-list-actions'>
|
||||
<div className='km-list-actions console-list-tool-actions'>
|
||||
<Button
|
||||
type='link'
|
||||
className='km-contact-link'
|
||||
@@ -928,14 +926,6 @@ const KeyManagement = ({ embedded = false }) => {
|
||||
>
|
||||
{t('创建密钥后不知道怎么用?联系客服')}
|
||||
</Button>
|
||||
<Button
|
||||
type='primary'
|
||||
icon={<ActionPlus size={16} />}
|
||||
className='tour-create-btn'
|
||||
onClick={handleCreate}
|
||||
>
|
||||
{t('创建密钥')}
|
||||
</Button>
|
||||
<TableColumnSettings
|
||||
columns={COLUMN_OPTIONS.map((option) => ({
|
||||
key: option.value,
|
||||
@@ -945,6 +935,14 @@ const KeyManagement = ({ embedded = false }) => {
|
||||
defaultValue={COLUMN_OPTIONS.map((option) => option.value)}
|
||||
onChange={setVisibleColumns}
|
||||
/>
|
||||
<Button
|
||||
type='primary'
|
||||
icon={<ActionPlus size={16} />}
|
||||
className='tour-create-btn'
|
||||
onClick={handleCreate}
|
||||
>
|
||||
{t('创建密钥')}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
.km-page {
|
||||
--km-page-bg: #f8fafc;
|
||||
--km-text: rgba(0, 0, 0, 0.88);
|
||||
--km-label: #6b7789;
|
||||
--km-search-border: #f0f0f0;
|
||||
--km-card-border: #e6e9ef;
|
||||
--km-card-shadow: 0 4px 24px rgba(15, 23, 42, 0.02);
|
||||
@@ -24,7 +23,6 @@
|
||||
html.dark .km-page {
|
||||
--km-page-bg: var(--surface-bg-base);
|
||||
--km-text: var(--uc-heading);
|
||||
--km-label: var(--text-secondary);
|
||||
--km-search-border: var(--border-subtle);
|
||||
--km-card-border: var(--border-subtle);
|
||||
--km-card-shadow: none;
|
||||
@@ -71,28 +69,6 @@ html.dark .km-page {
|
||||
box-shadow: var(--km-card-shadow);
|
||||
}
|
||||
|
||||
/* 查询标签与消费记录筛选标签一致;输入 620px,输入与按钮 16px,按钮间 8px。 */
|
||||
.km-search-label {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 21px;
|
||||
margin-bottom: 8px;
|
||||
color: var(--km-label);
|
||||
font-size: 13px;
|
||||
line-height: 1.5714285714285714;
|
||||
}
|
||||
.km-search-row {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
.km-search-row .km-search-input {
|
||||
width: 620px;
|
||||
max-width: 100%;
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
/* 列表卡头:标题 15px/600,与表格 18px(同使用记录表格卡) */
|
||||
.km-list-head {
|
||||
display: flex;
|
||||
@@ -328,10 +304,6 @@ html.dark .km-edit-drawer {
|
||||
.km-page-standalone .km-content.uc-page {
|
||||
padding-top: 80px;
|
||||
}
|
||||
.km-search-row .km-search-input {
|
||||
width: 100%;
|
||||
margin-right: 0;
|
||||
}
|
||||
.km-list-head {
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
@@ -17,21 +17,23 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
import { formatUserReference } from '../../helpers/safeDisplay';
|
||||
import {
|
||||
Search as ActionSearch,
|
||||
RefreshCw as ActionRefreshCw,
|
||||
} from '@/components/common/icons/ActionIcons';
|
||||
import { RefreshCw as ActionRefreshCw } from '@/components/common/icons/ActionIcons';
|
||||
import TableEmpty from '../../components/common/table/TableEmpty';
|
||||
import { ConsoleCollectionSearch } from '@/components/console/ConsoleCollection';
|
||||
import {
|
||||
ConsoleFilterField,
|
||||
ConsoleFilterGrid,
|
||||
} from '@/components/console/ConsolePrimitives';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { getQuotaPerUnit } from '../../helpers';
|
||||
import { timestamp2string } from '../../helpers/utils';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Form as AntForm, Tabs as AntTabs } from 'antd';
|
||||
import { Tabs as AntTabs } from 'antd';
|
||||
import { Table, Select, Button, Tag, Tooltip } from '@/components/ui';
|
||||
import { API } from '../../helpers/api';
|
||||
import { useOrgAuditLogs } from '../../hooks/org/useOrgData';
|
||||
import OrgPageHeader from './components/OrgPageHeader';
|
||||
import { OrgFilterCard, OrgListCard } from './components/OrgListCard';
|
||||
import { OrgListCard } from './components/OrgListCard';
|
||||
import OrgPromptRecords from './OrgPromptRecords';
|
||||
import {
|
||||
formatQuotaAsCNY,
|
||||
@@ -402,35 +404,20 @@ const OrgAudit = ({ orgId }) => {
|
||||
|
||||
const operations = (
|
||||
<>
|
||||
<OrgFilterCard
|
||||
className='oc-audit-filter'
|
||||
actions={
|
||||
<>
|
||||
{/* 重置 = 选择“全部操作”;搜索 = 以当前筛选重新查询(同“刷新”) */}
|
||||
<Button onClick={() => applyAction('')}>{t('重置')}</Button>
|
||||
<Button
|
||||
type='primary'
|
||||
icon={<ActionSearch size={16} />}
|
||||
onClick={refresh}
|
||||
>
|
||||
{t('搜索')}
|
||||
</Button>
|
||||
</>
|
||||
}
|
||||
>
|
||||
<AntForm layout='vertical' requiredMark={false} component='div'>
|
||||
<AntForm.Item label={t('操作类型')}>
|
||||
<ConsoleCollectionSearch className='oc-audit-filter'>
|
||||
<ConsoleFilterGrid onReset={() => applyAction('')} onSearch={refresh}>
|
||||
<ConsoleFilterField label={t('操作类型')} id='org-audit-action-type'>
|
||||
<Select
|
||||
id='org-audit-action-type'
|
||||
value={actionFilter}
|
||||
onChange={applyAction}
|
||||
optionList={actionOptions}
|
||||
style={{ width: '100%' }}
|
||||
placeholder={t('全部操作')}
|
||||
filter
|
||||
/>
|
||||
</AntForm.Item>
|
||||
</AntForm>
|
||||
</OrgFilterCard>
|
||||
</ConsoleFilterField>
|
||||
</ConsoleFilterGrid>
|
||||
</ConsoleCollectionSearch>
|
||||
|
||||
<OrgListCard
|
||||
title={t('操作记录')}
|
||||
@@ -453,7 +440,6 @@ const OrgAudit = ({ orgId }) => {
|
||||
pagination={{
|
||||
currentPage: page,
|
||||
pageSize,
|
||||
showSizeChanger: false,
|
||||
total,
|
||||
onPageChange: setPage,
|
||||
onPageSizeChange: (size) => {
|
||||
|
||||
@@ -482,7 +482,7 @@ const OrgBudgets = ({ orgId, featureFlags }) => {
|
||||
columns={columns}
|
||||
dataSource={list}
|
||||
loading={loading}
|
||||
pagination={false}
|
||||
pagination={{ resetOnDataChange: true }}
|
||||
rowKey='id'
|
||||
scroll={{ x: 1040 }}
|
||||
/>
|
||||
|
||||
@@ -335,21 +335,17 @@ const MemberUsageSheet = ({ visible, onClose, member, orgId, t }) => {
|
||||
rowKey='id'
|
||||
size='small'
|
||||
loading={loading}
|
||||
pagination={
|
||||
total > pageSize || pageSize !== 20
|
||||
? {
|
||||
currentPage: page,
|
||||
pageSize,
|
||||
total,
|
||||
onPageChange: (p) => fetchLogs(p),
|
||||
onPageSizeChange: (size) => {
|
||||
pageSizeRef.current = size;
|
||||
setPageSize(size);
|
||||
fetchLogs(1, appliedFilters, size);
|
||||
},
|
||||
}
|
||||
: false
|
||||
}
|
||||
pagination={{
|
||||
currentPage: page,
|
||||
pageSize,
|
||||
total,
|
||||
onPageChange: (p) => fetchLogs(p),
|
||||
onPageSizeChange: (size) => {
|
||||
pageSizeRef.current = size;
|
||||
setPageSize(size);
|
||||
fetchLogs(1, appliedFilters, size);
|
||||
},
|
||||
}}
|
||||
empty={
|
||||
<div className='py-8 text-center'>
|
||||
<div className='inline-flex p-3 rounded-full bg-gray-100 dark:bg-neutral-800 mb-2'>
|
||||
@@ -384,10 +380,6 @@ const renderBudgetAmount = (quota) => {
|
||||
};
|
||||
|
||||
const OrgDashboard = ({ orgId, orgRole, orgName, featureFlags }) => {
|
||||
const quotaPaginationSizeRef = useRef(null);
|
||||
useEffect(() => {
|
||||
quotaPaginationSizeRef.current = null;
|
||||
}, [orgId]);
|
||||
const { t } = useTranslation();
|
||||
const navigate = useNavigate();
|
||||
const [statusState] = useContext(StatusContext);
|
||||
@@ -615,23 +607,16 @@ const OrgDashboard = ({ orgId, orgRole, orgName, featureFlags }) => {
|
||||
loading={quotaLoading}
|
||||
rowKey='member_id'
|
||||
scroll={{ x: 860 }}
|
||||
pagination={
|
||||
memberQuotaTotal > memberQuotaPageSize ||
|
||||
quotaPaginationSizeRef.current !== null
|
||||
? {
|
||||
currentPage: memberQuotaPage,
|
||||
pageSize: memberQuotaPageSize,
|
||||
total: memberQuotaTotal,
|
||||
showSizeChanger: false,
|
||||
onPageChange: (page) => fetchQuota(page, memberQuotaPageSize),
|
||||
onPageSizeChange: (size) => {
|
||||
quotaPaginationSizeRef.current = size;
|
||||
fetchQuota(1, size);
|
||||
},
|
||||
showTotal: (n) => t('共 {{total}} 条', { total: n }),
|
||||
}
|
||||
: false
|
||||
}
|
||||
pagination={{
|
||||
currentPage: memberQuotaPage,
|
||||
pageSize: memberQuotaPageSize,
|
||||
total: memberQuotaTotal,
|
||||
onPageChange: (page) => fetchQuota(page, memberQuotaPageSize),
|
||||
onPageSizeChange: (size) => {
|
||||
fetchQuota(1, size);
|
||||
},
|
||||
showTotal: (n) => t('共 {{total}} 条', { total: n }),
|
||||
}}
|
||||
empty={<OrgStateBlock icon={Users} title={t('暂无成员数据')} />}
|
||||
/>
|
||||
{memberQuotaRows.length > 0 && (
|
||||
|
||||
@@ -368,7 +368,7 @@ const OrgDeptManage = ({ orgId, featureFlags }) => {
|
||||
dataSource={members}
|
||||
loading={membersLoading}
|
||||
rowKey='id'
|
||||
pagination={false}
|
||||
pagination={{ resetOnDataChange: true }}
|
||||
empty={<Empty description={t('暂无成员')} />}
|
||||
/>
|
||||
</TabPane>
|
||||
@@ -407,7 +407,7 @@ const OrgDeptManage = ({ orgId, featureFlags }) => {
|
||||
columns={rankColumns}
|
||||
dataSource={ranking}
|
||||
rowKey='user_id'
|
||||
pagination={false}
|
||||
pagination={{ resetOnDataChange: true }}
|
||||
empty={<Empty description={t('暂无用量数据')} />}
|
||||
/>
|
||||
</>
|
||||
|
||||
@@ -408,7 +408,7 @@ const OrgEffectiveness = ({ orgId, canManagePolicy, canManageSkills }) => {
|
||||
</Text>
|
||||
<Table
|
||||
size='small'
|
||||
pagination={false}
|
||||
pagination={{ resetOnDataChange: true }}
|
||||
dataSource={directUsage}
|
||||
rowKey='skill_id'
|
||||
columns={[
|
||||
@@ -489,7 +489,7 @@ const OrgEffectiveness = ({ orgId, canManagePolicy, canManageSkills }) => {
|
||||
) : (
|
||||
<Table
|
||||
size='small'
|
||||
pagination={false}
|
||||
pagination={{ resetOnDataChange: true }}
|
||||
dataSource={data.alerts || []}
|
||||
columns={[
|
||||
{ title: t('Skill'), dataIndex: 'dimension_id' },
|
||||
@@ -572,7 +572,7 @@ const OrgEffectiveness = ({ orgId, canManagePolicy, canManageSkills }) => {
|
||||
</div>
|
||||
) : (
|
||||
<Table
|
||||
pagination={false}
|
||||
pagination={{ resetOnDataChange: true }}
|
||||
dataSource={comparison}
|
||||
columns={[
|
||||
{ title: t('版本'), dataIndex: 'version_id' },
|
||||
@@ -670,7 +670,7 @@ const OrgEffectiveness = ({ orgId, canManagePolicy, canManageSkills }) => {
|
||||
</div>
|
||||
) : (
|
||||
<Table
|
||||
pagination={false}
|
||||
pagination={{ resetOnDataChange: true }}
|
||||
dataSource={experiments}
|
||||
columns={[
|
||||
{ title: t('实验'), dataIndex: 'name' },
|
||||
|
||||
@@ -942,7 +942,7 @@ const OrgLogs = ({ orgId, orgRole, isDeptManager = false }) => {
|
||||
dataSource={rankingRows}
|
||||
loading={rankingLoading}
|
||||
rowKey='rank_row_key'
|
||||
pagination={false}
|
||||
pagination={{ resetOnDataChange: true }}
|
||||
scroll={{ x: 790 }}
|
||||
empty={<TableEmpty />}
|
||||
/>
|
||||
@@ -957,7 +957,6 @@ const OrgLogs = ({ orgId, orgRole, isDeptManager = false }) => {
|
||||
currentPage: page,
|
||||
pageSize,
|
||||
total,
|
||||
showSizeChanger: false,
|
||||
onPageChange: (p) => doPageFetch(p),
|
||||
onPageSizeChange: (size) => {
|
||||
setPage(1);
|
||||
|
||||
@@ -32,7 +32,7 @@ import {
|
||||
Form,
|
||||
Toast,
|
||||
Tag,
|
||||
Modal,
|
||||
Popconfirm,
|
||||
Banner,
|
||||
Typography,
|
||||
Tooltip,
|
||||
@@ -42,8 +42,7 @@ import { API } from '../../helpers/api';
|
||||
import { showError, collectPagedItems } from '../../helpers';
|
||||
import OrgPageHeader from './components/OrgPageHeader';
|
||||
import OrgPanel from './components/OrgPanel';
|
||||
import { TableRowActions } from '@/components/common/table/TableToolbar';
|
||||
import { OrgListCard } from './components/OrgListCard';
|
||||
import { OrgListCard, OrgRowActions } from './components/OrgListCard';
|
||||
import OrgModal from './components/OrgModal';
|
||||
import DeptTreeSelect from './components/DeptTreeSelect';
|
||||
import {
|
||||
@@ -391,7 +390,7 @@ const OrgMemberAccounts = ({
|
||||
},
|
||||
{
|
||||
title: t('操作'),
|
||||
width: 110,
|
||||
width: 260,
|
||||
render: (_, r) => {
|
||||
const managed = r.created_by_org_id === r.organization_id;
|
||||
// 与后端 model.ResetManagedMemberPassword 的分级拦截保持一致
|
||||
@@ -405,53 +404,53 @@ const OrgMemberAccounts = ({
|
||||
}
|
||||
const canReset = !resetBlockedReason;
|
||||
return (
|
||||
<TableRowActions
|
||||
items={[
|
||||
deptEnabled && {
|
||||
key: 'department',
|
||||
label: t('分配部门'),
|
||||
onClick: () => {
|
||||
<OrgRowActions>
|
||||
{deptEnabled && (
|
||||
<Button
|
||||
type='link'
|
||||
onClick={() => {
|
||||
setDeptAssignFor(r);
|
||||
setDeptAssignVal(r.department_id || 0);
|
||||
},
|
||||
},
|
||||
{
|
||||
key: 'reset-password',
|
||||
label: t('重置密码'),
|
||||
disabled: !canReset,
|
||||
title: resetBlockedReason || undefined,
|
||||
onClick: () =>
|
||||
Modal.confirm({
|
||||
title: t('重置该账号密码?'),
|
||||
content: managed
|
||||
? t('将生成一次性临时密码,并要求首次登录改密')
|
||||
: t(
|
||||
'该成员为个人平台账号,重置后其平台登录密码同步失效,请将临时密码安全告知本人',
|
||||
),
|
||||
okText: t('确认'),
|
||||
cancelText: t('取消'),
|
||||
onOk: () => resetPassword(r),
|
||||
}),
|
||||
},
|
||||
r.status === 1 &&
|
||||
r.role !== 'owner' && {
|
||||
key: 'offboard',
|
||||
label: t('离职回收'),
|
||||
danger: true,
|
||||
onClick: () =>
|
||||
Modal.confirm({
|
||||
title: t('确认离职回收该成员?'),
|
||||
content: t(
|
||||
'将禁用其企业成员身份与全部企业 Token,保留历史,不删除用户',
|
||||
),
|
||||
okText: t('确认'),
|
||||
cancelText: t('取消'),
|
||||
okButtonProps: { danger: true },
|
||||
onOk: () => offboard(r.id),
|
||||
}),
|
||||
},
|
||||
]}
|
||||
/>
|
||||
}}
|
||||
>
|
||||
{t('分配部门')}
|
||||
</Button>
|
||||
)}
|
||||
{canReset ? (
|
||||
<Popconfirm
|
||||
title={t('重置该账号密码?')}
|
||||
content={
|
||||
managed
|
||||
? t('将生成一次性临时密码,并要求首次登录改密')
|
||||
: t(
|
||||
'该成员为个人平台账号,重置后其平台登录密码同步失效,请将临时密码安全告知本人',
|
||||
)
|
||||
}
|
||||
onConfirm={() => resetPassword(r)}
|
||||
>
|
||||
<Button type='link'>{t('重置密码')}</Button>
|
||||
</Popconfirm>
|
||||
) : (
|
||||
<Tooltip content={resetBlockedReason}>
|
||||
<Button type='link' disabled>
|
||||
{t('重置密码')}
|
||||
</Button>
|
||||
</Tooltip>
|
||||
)}
|
||||
{r.status === 1 && r.role !== 'owner' && (
|
||||
<Popconfirm
|
||||
title={t('确认离职回收该成员?')}
|
||||
content={t(
|
||||
'将禁用其企业成员身份与全部企业 Token,保留历史,不删除用户',
|
||||
)}
|
||||
onConfirm={() => offboard(r.id)}
|
||||
>
|
||||
<Button type='link' danger>
|
||||
{t('离职回收')}
|
||||
</Button>
|
||||
</Popconfirm>
|
||||
)}
|
||||
</OrgRowActions>
|
||||
);
|
||||
},
|
||||
},
|
||||
@@ -512,8 +511,7 @@ const OrgMemberAccounts = ({
|
||||
dataSource={members}
|
||||
loading={loading}
|
||||
pagination={{
|
||||
pageSize: 15,
|
||||
showSizeChanger: false,
|
||||
resetOnDataChange: true,
|
||||
showTotal: (n) => t('共 {{total}} 条', { total: n }),
|
||||
}}
|
||||
rowKey='id'
|
||||
@@ -525,7 +523,7 @@ const OrgMemberAccounts = ({
|
||||
columns={columns}
|
||||
dataSource={members}
|
||||
loading={loading}
|
||||
pagination={{ pageSize: 15, showSizeChanger: false }}
|
||||
pagination={{ resetOnDataChange: true }}
|
||||
rowKey='id'
|
||||
/>
|
||||
</OrgPanel>
|
||||
@@ -711,7 +709,7 @@ const OrgMemberAccounts = ({
|
||||
/>
|
||||
<Table
|
||||
size='small'
|
||||
pagination={false}
|
||||
pagination={{ resetOnDataChange: true }}
|
||||
rowKey={(r) => `${r.row}`}
|
||||
dataSource={importResult.details || []}
|
||||
columns={[
|
||||
|
||||
@@ -30,7 +30,7 @@ import {
|
||||
Input,
|
||||
Select,
|
||||
Tag,
|
||||
Modal,
|
||||
Popconfirm,
|
||||
Toast,
|
||||
Tooltip,
|
||||
Switch,
|
||||
@@ -42,8 +42,7 @@ import QuotaInput from '../../components/common/ui/QuotaInput';
|
||||
import OrgPageHeader from './components/OrgPageHeader';
|
||||
import OrgPanel from './components/OrgPanel';
|
||||
import { Alert as AntAlert, Tabs as AntTabs } from 'antd';
|
||||
import { TableRowActions } from '@/components/common/table/TableToolbar';
|
||||
import { OrgListCard } from './components/OrgListCard';
|
||||
import { OrgListCard, OrgRowActions } from './components/OrgListCard';
|
||||
import OrgModal from './components/OrgModal';
|
||||
import OrgMemberAccounts from './OrgMemberAccounts';
|
||||
|
||||
@@ -573,7 +572,7 @@ const OrgMembers = ({
|
||||
if (canWrite) {
|
||||
memberColumns.push({
|
||||
title: t('操作'),
|
||||
width: 110,
|
||||
width: 260,
|
||||
fixed: 'right',
|
||||
render: (_, record) => {
|
||||
if (record.role === 'owner') {
|
||||
@@ -581,13 +580,11 @@ const OrgMembers = ({
|
||||
}
|
||||
const isSelf = Number(record.user_id) === currentUserId;
|
||||
return (
|
||||
<TableRowActions
|
||||
items={[
|
||||
{
|
||||
key: 'quota',
|
||||
label: t('配额'),
|
||||
title: t('设置该成员的个人额度上限'),
|
||||
onClick: () => {
|
||||
<OrgRowActions>
|
||||
<Tooltip content={t('设置该成员的个人额度上限')}>
|
||||
<Button
|
||||
type='link'
|
||||
onClick={() => {
|
||||
setQuotaMemberId(record.id);
|
||||
setQuotaMemberName(
|
||||
record.display_name || record.username || '',
|
||||
@@ -595,13 +592,15 @@ const OrgMembers = ({
|
||||
setQuotaLimit(record.quota_limit || 0);
|
||||
setQuotaPeriod(record.quota_period || 'none');
|
||||
setQuotaModalVisible(true);
|
||||
},
|
||||
},
|
||||
{
|
||||
key: 'models',
|
||||
label: t('模型'),
|
||||
title: t('设置该成员可用的模型范围'),
|
||||
onClick: async () => {
|
||||
}}
|
||||
>
|
||||
{t('配额')}
|
||||
</Button>
|
||||
</Tooltip>
|
||||
<Tooltip content={t('设置该成员可用的模型范围')}>
|
||||
<Button
|
||||
type='link'
|
||||
onClick={async () => {
|
||||
setModelLimitsMemberId(record.id);
|
||||
setModelLimitsMemberName(
|
||||
record.display_name || record.username || '',
|
||||
@@ -630,15 +629,22 @@ const OrgMembers = ({
|
||||
/* ignore */
|
||||
}
|
||||
setLoadingOrgModels(false);
|
||||
},
|
||||
},
|
||||
{
|
||||
key: 'groups',
|
||||
label: t('分组'),
|
||||
title: isSelf
|
||||
}}
|
||||
>
|
||||
{t('模型')}
|
||||
</Button>
|
||||
</Tooltip>
|
||||
<Tooltip
|
||||
content={
|
||||
isSelf
|
||||
? t('不能修改自己的可调用分组')
|
||||
: t('设置该成员可调用的分组'),
|
||||
onClick: () => {
|
||||
: t('设置该成员可调用的分组')
|
||||
}
|
||||
>
|
||||
<Button
|
||||
type='link'
|
||||
disabled={isSelf}
|
||||
onClick={() => {
|
||||
if (isSelf) return;
|
||||
setGroupsMemberId(record.id);
|
||||
setGroupsMemberName(
|
||||
@@ -646,15 +652,16 @@ const OrgMembers = ({
|
||||
);
|
||||
setSelectedMemberGroups(parseMemberGroups(record));
|
||||
setGroupsModalVisible(true);
|
||||
},
|
||||
disabled: isSelf,
|
||||
},
|
||||
orgRole === 'owner' &&
|
||||
record.role === 'admin' && {
|
||||
key: 'permissions',
|
||||
label: t('权限'),
|
||||
title: t('设置该管理员的细粒度权限'),
|
||||
onClick: () => {
|
||||
}}
|
||||
>
|
||||
{t('分组')}
|
||||
</Button>
|
||||
</Tooltip>
|
||||
{orgRole === 'owner' && record.role === 'admin' && (
|
||||
<Tooltip content={t('设置该管理员的细粒度权限')}>
|
||||
<Button
|
||||
type='link'
|
||||
onClick={() => {
|
||||
setPermMemberId(record.id);
|
||||
setPermMemberName(
|
||||
record.display_name || record.username || '',
|
||||
@@ -678,25 +685,23 @@ const OrgMembers = ({
|
||||
smart_router_manage: !!perms.smart_router_manage,
|
||||
});
|
||||
setPermModalVisible(true);
|
||||
},
|
||||
},
|
||||
{
|
||||
key: 'remove',
|
||||
label: t('移除'),
|
||||
danger: true,
|
||||
onClick: () =>
|
||||
Modal.confirm({
|
||||
title: t(
|
||||
'确定移除该成员?移除后该成员将失去企业访问权限。',
|
||||
),
|
||||
okText: t('确认'),
|
||||
cancelText: t('取消'),
|
||||
okButtonProps: { danger: true },
|
||||
onOk: () => handleRemove(record.id),
|
||||
}),
|
||||
},
|
||||
]}
|
||||
/>
|
||||
}}
|
||||
>
|
||||
{t('权限')}
|
||||
</Button>
|
||||
</Tooltip>
|
||||
)}
|
||||
<Tooltip content={t('从企业中移除该成员')}>
|
||||
<Popconfirm
|
||||
title={t('确定移除该成员?移除后该成员将失去企业访问权限。')}
|
||||
onConfirm={() => handleRemove(record.id)}
|
||||
>
|
||||
<Button type='link' danger>
|
||||
{t('移除')}
|
||||
</Button>
|
||||
</Popconfirm>
|
||||
</Tooltip>
|
||||
</OrgRowActions>
|
||||
);
|
||||
},
|
||||
});
|
||||
|
||||
@@ -24,7 +24,6 @@ import {
|
||||
OctagonX as ActionOctagonX,
|
||||
Code2 as ActionCode2,
|
||||
} from '@/components/common/icons/ActionIcons';
|
||||
import { TableRowActions } from '@/components/common/table/TableToolbar';
|
||||
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
||||
import {
|
||||
Button,
|
||||
@@ -218,115 +217,118 @@ const OrgPrivateSkills = ({ orgId }) => {
|
||||
currentUserId > 0 && Number(row.version?.created_by) === currentUserId;
|
||||
const isReviewer =
|
||||
currentUserId > 0 && Number(row.review?.reviewer_id) === currentUserId;
|
||||
const [primaryAction, ...moreActions] = [
|
||||
{
|
||||
key: 'new-version',
|
||||
label: t('新版本'),
|
||||
onClick: () => {
|
||||
setEditingSkill(row.definition);
|
||||
setForm({
|
||||
...blankSkill,
|
||||
canonical_id: row.definition.canonical_id,
|
||||
});
|
||||
setEditorVisible(true);
|
||||
},
|
||||
disabled: row.definition.emergency_stopped,
|
||||
},
|
||||
{
|
||||
key: 'history',
|
||||
label: t('历史版本'),
|
||||
onClick: () => openHistory(row.definition),
|
||||
},
|
||||
{
|
||||
key: 'runtime',
|
||||
label: t('执行模型实测'),
|
||||
onClick: () => {
|
||||
// Clear residue from a previous version's test before reopening.
|
||||
setEvidence({ model: '', input: '' });
|
||||
setEvidenceVersion(versionId);
|
||||
},
|
||||
disabled: !versionId,
|
||||
},
|
||||
{
|
||||
key: 'claim',
|
||||
label:
|
||||
isAuthor && row.review?.status === 'pending'
|
||||
? t('待他人审核')
|
||||
: t('领取审核'),
|
||||
onClick: () =>
|
||||
action(`/api/org/skills/private/versions/${versionId}/review/start`),
|
||||
disabled: !versionId || row.review?.status !== 'pending' || isAuthor,
|
||||
},
|
||||
{
|
||||
key: 'approve',
|
||||
label: t('通过'),
|
||||
onClick: () =>
|
||||
action(
|
||||
`/api/org/skills/private/versions/${versionId}/review/decision`,
|
||||
{ approved: true, conclusion: { decision: 'approved' } },
|
||||
),
|
||||
disabled:
|
||||
!versionId || row.review?.status !== 'reviewing' || !isReviewer,
|
||||
icon: <ActionFileCheck2 size={14} />,
|
||||
},
|
||||
{
|
||||
key: 'reject',
|
||||
label: t('驳回'),
|
||||
onClick: () =>
|
||||
action(
|
||||
`/api/org/skills/private/versions/${versionId}/review/decision`,
|
||||
{ approved: false, conclusion: { decision: 'rejected' } },
|
||||
),
|
||||
disabled:
|
||||
!versionId || row.review?.status !== 'reviewing' || !isReviewer,
|
||||
danger: true,
|
||||
},
|
||||
{
|
||||
key: 'publish',
|
||||
label: t('发布'),
|
||||
onClick: () =>
|
||||
action(`/api/org/skills/private/versions/${versionId}/publish`),
|
||||
disabled: !versionId || row.review?.status !== 'approved',
|
||||
},
|
||||
{
|
||||
key: 'rollback',
|
||||
label: t('回滚'),
|
||||
onClick: () =>
|
||||
askReason(t('回滚到当前列表版本'), (reason) =>
|
||||
action(
|
||||
`/api/org/skills/private/${row.definition.id}/versions/${versionId}/rollback`,
|
||||
{ reason },
|
||||
),
|
||||
),
|
||||
disabled: !versionId,
|
||||
icon: <ActionRotateCcw size={14} />,
|
||||
},
|
||||
{
|
||||
key: 'stop',
|
||||
label: t('紧急停用'),
|
||||
onClick: () =>
|
||||
askReason(t('紧急停用 Skill'), (reason) =>
|
||||
action(
|
||||
`/api/org/skills/private/${row.definition.id}/emergency-stop`,
|
||||
{ reason },
|
||||
),
|
||||
),
|
||||
disabled: row.definition.emergency_stopped,
|
||||
icon: <ActionOctagonX size={14} />,
|
||||
danger: true,
|
||||
},
|
||||
];
|
||||
return (
|
||||
<TableRowActions items={moreActions}>
|
||||
<div className='flex flex-wrap gap-2'>
|
||||
<Button
|
||||
size='small'
|
||||
type='link'
|
||||
disabled={primaryAction.disabled}
|
||||
onClick={primaryAction.onClick}
|
||||
disabled={row.definition.emergency_stopped}
|
||||
onClick={() => {
|
||||
setEditingSkill(row.definition);
|
||||
setForm({
|
||||
...blankSkill,
|
||||
canonical_id: row.definition.canonical_id,
|
||||
});
|
||||
setEditorVisible(true);
|
||||
}}
|
||||
>
|
||||
{primaryAction.label}
|
||||
{t('新版本')}
|
||||
</Button>
|
||||
</TableRowActions>
|
||||
<Button size='small' onClick={() => openHistory(row.definition)}>
|
||||
{t('历史版本')}
|
||||
</Button>
|
||||
<Button
|
||||
size='small'
|
||||
disabled={!versionId}
|
||||
onClick={() => {
|
||||
// Clear residue from a previous version's test before reopening.
|
||||
setEvidence({ model: '', input: '' });
|
||||
setEvidenceVersion(versionId);
|
||||
}}
|
||||
>
|
||||
{t('执行模型实测')}
|
||||
</Button>
|
||||
<Button
|
||||
size='small'
|
||||
disabled={!versionId || row.review?.status !== 'pending' || isAuthor}
|
||||
onClick={() =>
|
||||
action(`/api/org/skills/private/versions/${versionId}/review/start`)
|
||||
}
|
||||
>
|
||||
{isAuthor && row.review?.status === 'pending'
|
||||
? t('待他人审核')
|
||||
: t('领取审核')}
|
||||
</Button>
|
||||
<Button
|
||||
size='small'
|
||||
icon={<ActionFileCheck2 size={14} />}
|
||||
disabled={
|
||||
!versionId || row.review?.status !== 'reviewing' || !isReviewer
|
||||
}
|
||||
onClick={() =>
|
||||
action(
|
||||
`/api/org/skills/private/versions/${versionId}/review/decision`,
|
||||
{ approved: true, conclusion: { decision: 'approved' } },
|
||||
)
|
||||
}
|
||||
>
|
||||
{t('通过')}
|
||||
</Button>
|
||||
<Button
|
||||
size='small'
|
||||
type='danger'
|
||||
disabled={
|
||||
!versionId || row.review?.status !== 'reviewing' || !isReviewer
|
||||
}
|
||||
onClick={() =>
|
||||
action(
|
||||
`/api/org/skills/private/versions/${versionId}/review/decision`,
|
||||
{ approved: false, conclusion: { decision: 'rejected' } },
|
||||
)
|
||||
}
|
||||
>
|
||||
{t('驳回')}
|
||||
</Button>
|
||||
<Button
|
||||
size='small'
|
||||
disabled={!versionId || row.review?.status !== 'approved'}
|
||||
onClick={() =>
|
||||
action(`/api/org/skills/private/versions/${versionId}/publish`)
|
||||
}
|
||||
>
|
||||
{t('发布')}
|
||||
</Button>
|
||||
<Button
|
||||
size='small'
|
||||
icon={<ActionRotateCcw size={14} />}
|
||||
disabled={!versionId}
|
||||
onClick={() =>
|
||||
askReason(t('回滚到当前列表版本'), (reason) =>
|
||||
action(
|
||||
`/api/org/skills/private/${row.definition.id}/versions/${versionId}/rollback`,
|
||||
{ reason },
|
||||
),
|
||||
)
|
||||
}
|
||||
>
|
||||
{t('回滚')}
|
||||
</Button>
|
||||
<Button
|
||||
size='small'
|
||||
type='danger'
|
||||
icon={<ActionOctagonX size={14} />}
|
||||
disabled={row.definition.emergency_stopped}
|
||||
onClick={() =>
|
||||
askReason(t('紧急停用 Skill'), (reason) =>
|
||||
action(
|
||||
`/api/org/skills/private/${row.definition.id}/emergency-stop`,
|
||||
{ reason },
|
||||
),
|
||||
)
|
||||
}
|
||||
>
|
||||
{t('紧急停用')}
|
||||
</Button>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
const openCreateEditor = () => {
|
||||
@@ -458,7 +460,7 @@ const OrgPrivateSkills = ({ orgId }) => {
|
||||
</div>
|
||||
) : (
|
||||
<Table
|
||||
pagination={false}
|
||||
pagination={{ resetOnDataChange: true }}
|
||||
dataSource={items}
|
||||
rowKey={(row) => row.definition.id}
|
||||
columns={[
|
||||
@@ -498,7 +500,7 @@ const OrgPrivateSkills = ({ orgId }) => {
|
||||
},
|
||||
{
|
||||
title: t('操作'),
|
||||
width: 170,
|
||||
width: 430,
|
||||
render: (_, row) => renderSkillActions(row),
|
||||
},
|
||||
]}
|
||||
@@ -613,7 +615,7 @@ const OrgPrivateSkills = ({ orgId }) => {
|
||||
</div>
|
||||
) : (
|
||||
<Table
|
||||
pagination={false}
|
||||
pagination={{ resetOnDataChange: true }}
|
||||
dataSource={history}
|
||||
rowKey={(row) => row.version.id}
|
||||
columns={[
|
||||
|
||||
@@ -293,7 +293,7 @@ const OrgProjectManage = ({ orgId }) => {
|
||||
dataSource={members}
|
||||
loading={loading}
|
||||
rowKey='org_member_id'
|
||||
pagination={false}
|
||||
pagination={{ resetOnDataChange: true }}
|
||||
empty={<Empty description={t('暂无项目成员')} />}
|
||||
/>
|
||||
</OrgPanel>
|
||||
|
||||
@@ -37,8 +37,7 @@ import {
|
||||
import { API } from '../../helpers/api';
|
||||
import { showError, collectPagedItems } from '../../helpers';
|
||||
import OrgPageHeader from './components/OrgPageHeader';
|
||||
import { TableRowActions } from '@/components/common/table/TableToolbar';
|
||||
import { OrgListCard } from './components/OrgListCard';
|
||||
import { OrgListCard, OrgRowActions } from './components/OrgListCard';
|
||||
import OrgModal from './components/OrgModal';
|
||||
import OrgScopedLimitButtons from './components/OrgScopedLimitButtons';
|
||||
|
||||
@@ -310,6 +309,7 @@ const OrgProjects = ({ orgId }) => {
|
||||
}));
|
||||
}, [members, projectMembers]);
|
||||
|
||||
// 列宽与渲染对齐原型 EnterpriseProjects(150/350/120/140/300,scroll.x 1060);
|
||||
const columns = [
|
||||
{
|
||||
title: t('项目编码'),
|
||||
@@ -352,36 +352,27 @@ const OrgProjects = ({ orgId }) => {
|
||||
},
|
||||
{
|
||||
title: t('操作'),
|
||||
width: 168,
|
||||
width: 300,
|
||||
render: (_, record) => (
|
||||
<OrgScopedLimitButtons
|
||||
orgId={orgId}
|
||||
record={record}
|
||||
apiBase='/api/org/project'
|
||||
scopeLabel='项目'
|
||||
onSaved={fetchList}
|
||||
renderActions={(limitItems) => (
|
||||
<TableRowActions
|
||||
items={[
|
||||
...limitItems,
|
||||
{
|
||||
key: 'members',
|
||||
label: t('成员'),
|
||||
onClick: () => openMembers(record),
|
||||
},
|
||||
{
|
||||
key: 'tokens',
|
||||
label: t('密钥'),
|
||||
onClick: () => openTokens(record),
|
||||
},
|
||||
]}
|
||||
>
|
||||
<Button type='link' size='small' onClick={() => openEdit(record)}>
|
||||
{t('编辑')}
|
||||
</Button>
|
||||
</TableRowActions>
|
||||
)}
|
||||
/>
|
||||
<OrgRowActions>
|
||||
<OrgScopedLimitButtons
|
||||
orgId={orgId}
|
||||
record={record}
|
||||
apiBase='/api/org/project'
|
||||
scopeLabel='项目'
|
||||
onSaved={fetchList}
|
||||
variant='link'
|
||||
/>
|
||||
<Button type='link' onClick={() => openMembers(record)}>
|
||||
{t('成员')}
|
||||
</Button>
|
||||
<Button type='link' onClick={() => openTokens(record)}>
|
||||
{t('密钥')}
|
||||
</Button>
|
||||
<Button type='link' onClick={() => openEdit(record)}>
|
||||
{t('编辑')}
|
||||
</Button>
|
||||
</OrgRowActions>
|
||||
),
|
||||
},
|
||||
];
|
||||
@@ -416,8 +407,7 @@ const OrgProjects = ({ orgId }) => {
|
||||
dataSource={list}
|
||||
loading={loading}
|
||||
pagination={{
|
||||
pageSize: 15,
|
||||
showSizeChanger: false,
|
||||
resetOnDataChange: true,
|
||||
showTotal: (total) => t('共 {{total}} 条', { total }),
|
||||
}}
|
||||
rowKey='id'
|
||||
@@ -529,7 +519,7 @@ const OrgProjects = ({ orgId }) => {
|
||||
},
|
||||
]}
|
||||
dataSource={projectMembers}
|
||||
pagination={false}
|
||||
pagination={{ resetOnDataChange: true }}
|
||||
rowKey='org_member_id'
|
||||
size='small'
|
||||
/>
|
||||
@@ -589,7 +579,7 @@ const OrgProjects = ({ orgId }) => {
|
||||
},
|
||||
]}
|
||||
dataSource={orgTokens}
|
||||
pagination={false}
|
||||
pagination={{ resetOnDataChange: true }}
|
||||
rowKey='id'
|
||||
size='small'
|
||||
/>
|
||||
|
||||
@@ -29,6 +29,7 @@ import i18next from 'i18next';
|
||||
import { Database, MessageSquareText, SlidersHorizontal } from 'lucide-react';
|
||||
import {
|
||||
Table,
|
||||
Pagination,
|
||||
Button,
|
||||
Input,
|
||||
Select,
|
||||
@@ -61,6 +62,8 @@ const PromptCallDetails = ({ orgId, groupKey }) => {
|
||||
const quotaPerUnit = getQuotaPerUnit();
|
||||
const [calls, setCalls] = useState(null); // null = 加载中
|
||||
const [error, setError] = useState('');
|
||||
const [page, setPage] = useState(1);
|
||||
const [pageSize, setPageSize] = useState(10);
|
||||
|
||||
useEffect(() => {
|
||||
let cancelled = false;
|
||||
@@ -89,6 +92,10 @@ const PromptCallDetails = ({ orgId, groupKey }) => {
|
||||
};
|
||||
}, [orgId, groupKey, t]);
|
||||
|
||||
useEffect(() => {
|
||||
setPage(1);
|
||||
}, [calls]);
|
||||
|
||||
if (calls === null) {
|
||||
return (
|
||||
<div className='text-xs text-gray-400 dark:text-gray-500 mt-2'>
|
||||
@@ -134,7 +141,7 @@ const PromptCallDetails = ({ orgId, groupKey }) => {
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{calls.map((log) => (
|
||||
{calls.slice((page - 1) * pageSize, page * pageSize).map((log) => (
|
||||
<tr
|
||||
key={log.id}
|
||||
className='border-t border-gray-100 dark:border-white/[0.06]'
|
||||
@@ -160,6 +167,18 @@ const PromptCallDetails = ({ orgId, groupKey }) => {
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<Pagination
|
||||
className='mt-4'
|
||||
align='end'
|
||||
currentPage={page}
|
||||
pageSize={pageSize}
|
||||
total={calls.length}
|
||||
onPageChange={setPage}
|
||||
onPageSizeChange={(size) => {
|
||||
setPage(1);
|
||||
setPageSize(size);
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -271,8 +271,7 @@ const OrgRequests = ({ orgId, orgRole, featureFlags }) => {
|
||||
loading={loading}
|
||||
empty={<TableEmpty />}
|
||||
pagination={{
|
||||
pageSize: 15,
|
||||
showSizeChanger: false,
|
||||
resetOnDataChange: true,
|
||||
showTotal: (total) => t('共 {{total}} 条', { total }),
|
||||
}}
|
||||
rowKey='id'
|
||||
|
||||
@@ -309,7 +309,7 @@ const OrgSkillAssignments = ({ orgId, orgRole = '' }) => {
|
||||
columns={columns}
|
||||
dataSource={items}
|
||||
rowKey='id'
|
||||
pagination={false}
|
||||
pagination={{ resetOnDataChange: true }}
|
||||
/>
|
||||
)}
|
||||
</OrgPanel>
|
||||
|
||||
@@ -52,7 +52,6 @@ import {
|
||||
TextArea,
|
||||
} from '@/components/ui';
|
||||
import { useOrgTokens } from '../../hooks/org/useOrgData';
|
||||
import { useIsMobile } from '../../hooks/common/useIsMobile';
|
||||
import {
|
||||
API,
|
||||
copy,
|
||||
@@ -145,9 +144,6 @@ const OrgTokens = ({ orgId, orgRole }) => {
|
||||
fetchTokenKey,
|
||||
} = useOrgTokens(orgId);
|
||||
const [page, setPage] = useState(1);
|
||||
// 窄屏下两侧固定列(名称+操作≈400px)会占满可视宽度,中间列无处可显示,故仅桌面端固定
|
||||
const isMobile = useIsMobile();
|
||||
const fixedSide = (side) => (isMobile ? undefined : side);
|
||||
const [pageSize, setPageSize] = useState(20);
|
||||
const [visibleColumns, setVisibleColumns] = useState([
|
||||
'name',
|
||||
@@ -307,9 +303,7 @@ const OrgTokens = ({ orgId, orgRole }) => {
|
||||
title: t('名称'),
|
||||
key: 'name',
|
||||
dataIndex: 'name',
|
||||
width: 230,
|
||||
// 列数较多,常规桌面宽度也会横向滚动:名称与操作列固定在两侧,滚动时始终可见
|
||||
fixed: fixedSide('left'),
|
||||
width: 150,
|
||||
ellipsis: { showTitle: false },
|
||||
render: (name, record) => (
|
||||
<Tooltip content={name} position='topLeft'>
|
||||
@@ -333,7 +327,7 @@ const OrgTokens = ({ orgId, orgRole }) => {
|
||||
title: t('密钥'),
|
||||
key: 'key',
|
||||
dataIndex: 'key',
|
||||
width: 335,
|
||||
width: 300,
|
||||
render: (key, record) => {
|
||||
// key 为后端脱敏值(前 4 + **** + 后 4)
|
||||
const fullKey = revealedKeys[record.id];
|
||||
@@ -529,7 +523,6 @@ const OrgTokens = ({ orgId, orgRole }) => {
|
||||
title: t('操作'),
|
||||
key: 'actions',
|
||||
width: 90,
|
||||
fixed: fixedSide('right'),
|
||||
render: (_, record) => {
|
||||
// 管理员/超管可操作所有Token,普通成员只能操作自己创建的。
|
||||
if (!canOperateRow(record)) return '-';
|
||||
|
||||
@@ -179,11 +179,6 @@ const OrgAnalyticsPanel = ({
|
||||
const [trendRows, setTrendRows] = useState([]);
|
||||
const [prevRows, setPrevRows] = useState([]);
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [detailPage, setDetailPage] = useState(1);
|
||||
|
||||
useEffect(() => {
|
||||
setDetailPage(1);
|
||||
}, [breakdownRows, dimension, rangeDays]);
|
||||
|
||||
useEffect(() => {
|
||||
initVChartTheme({ isWatchingThemeSwitch: true });
|
||||
@@ -513,16 +508,7 @@ const OrgAnalyticsPanel = ({
|
||||
dataSource={breakdownRows}
|
||||
rowKey='key'
|
||||
scroll={{ x: 880 }}
|
||||
pagination={{
|
||||
currentPage: Math.min(
|
||||
detailPage,
|
||||
Math.max(1, Math.ceil(breakdownRows.length / 10)),
|
||||
),
|
||||
pageSize: 10,
|
||||
showSizeChanger: false,
|
||||
onPageChange: setDetailPage,
|
||||
showTotal: (n) => t('共 {{total}} 条', { total: n }),
|
||||
}}
|
||||
pagination={{ resetOnDataChange: true }}
|
||||
/>
|
||||
)}
|
||||
</AntCard>
|
||||
|
||||
@@ -59,7 +59,7 @@ const OrgScopedLimitButtons = ({
|
||||
apiBase,
|
||||
scopeLabel,
|
||||
onSaved,
|
||||
renderActions,
|
||||
variant = 'default',
|
||||
}) => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
@@ -171,47 +171,46 @@ const OrgScopedLimitButtons = ({
|
||||
|
||||
return (
|
||||
<>
|
||||
{renderActions ? (
|
||||
renderActions([
|
||||
{ key: 'models', label: t('模型'), onClick: openModelModal },
|
||||
{ key: 'groups', label: t('分组'), onClick: openGroupsModal },
|
||||
])
|
||||
) : (
|
||||
<>
|
||||
<Tooltip
|
||||
content={t(
|
||||
'设置该{{scope}}成员默认可用的模型范围(与成员/项目/部门限制取交集)',
|
||||
{ scope: t(scopeLabel) },
|
||||
)}
|
||||
>
|
||||
<Button
|
||||
size='small'
|
||||
theme='light'
|
||||
type={modelConfigured ? 'primary' : 'tertiary'}
|
||||
icon={<ActionLayers size={14} />}
|
||||
onClick={openModelModal}
|
||||
>
|
||||
{t('模型')}
|
||||
</Button>
|
||||
</Tooltip>
|
||||
<Tooltip
|
||||
content={t(
|
||||
'设置该{{scope}}成员默认可调用的分组(与成员/项目/部门限制取交集)',
|
||||
{ scope: t(scopeLabel) },
|
||||
)}
|
||||
>
|
||||
<Button
|
||||
size='small'
|
||||
theme='light'
|
||||
type={groupConfigured ? 'primary' : 'tertiary'}
|
||||
icon={<ActionLayers size={14} />}
|
||||
onClick={openGroupsModal}
|
||||
>
|
||||
{t('分组')}
|
||||
</Button>
|
||||
</Tooltip>
|
||||
</>
|
||||
)}
|
||||
<Tooltip
|
||||
content={t(
|
||||
'设置该{{scope}}成员默认可用的模型范围(与成员/项目/部门限制取交集)',
|
||||
{ scope: t(scopeLabel) },
|
||||
)}
|
||||
>
|
||||
<Button
|
||||
{...(variant === 'link'
|
||||
? { type: 'link' }
|
||||
: {
|
||||
size: 'small',
|
||||
theme: 'light',
|
||||
type: modelConfigured ? 'primary' : 'tertiary',
|
||||
icon: <ActionLayers size={14} />,
|
||||
})}
|
||||
onClick={openModelModal}
|
||||
>
|
||||
{t('模型')}
|
||||
</Button>
|
||||
</Tooltip>
|
||||
<Tooltip
|
||||
content={t(
|
||||
'设置该{{scope}}成员默认可调用的分组(与成员/项目/部门限制取交集)',
|
||||
{ scope: t(scopeLabel) },
|
||||
)}
|
||||
>
|
||||
<Button
|
||||
{...(variant === 'link'
|
||||
? { type: 'link' }
|
||||
: {
|
||||
size: 'small',
|
||||
theme: 'light',
|
||||
type: groupConfigured ? 'primary' : 'tertiary',
|
||||
icon: <ActionLayers size={14} />,
|
||||
})}
|
||||
onClick={openGroupsModal}
|
||||
>
|
||||
{t('分组')}
|
||||
</Button>
|
||||
</Tooltip>
|
||||
|
||||
{/* 模型限制 Modal */}
|
||||
<OrgModal
|
||||
|
||||
@@ -23,12 +23,10 @@ import {
|
||||
} from '@/components/common/icons/ActionIcons';
|
||||
import TableEmpty from '../../../components/common/table/TableEmpty';
|
||||
import React, { useMemo } from 'react';
|
||||
import Table from '../../../components/ui/CenterActionTable';
|
||||
import { Card, Tag } from 'antd';
|
||||
import { Clock } from 'lucide-react';
|
||||
import { Button, Pagination } from '@/components/ui';
|
||||
import { Button, Table } from '@/components/ui';
|
||||
import { useTaskLogsData } from '../../../hooks/task-logs/useTaskLogsData';
|
||||
import { useIsMobile } from '../../../hooks/common/useIsMobile';
|
||||
import { timestamp2string } from '../../../helpers';
|
||||
import { getTaskLogsColumns } from '../../../components/table/task-logs/TaskLogsColumnDefs';
|
||||
import TaskLogsFilters from '../../../components/table/task-logs/TaskLogsFilters';
|
||||
@@ -76,7 +74,6 @@ const OrgTaskRecords = () => {
|
||||
openVideoModal,
|
||||
visibleColumns,
|
||||
} = taskLogsData;
|
||||
const isMobile = useIsMobile();
|
||||
// 仅用于“实时更新中”提示(存在进行中任务时轮询);原型无“本页统计”区块,不渲染
|
||||
const pageStats = useTaskPageStats(logs);
|
||||
|
||||
@@ -257,26 +254,16 @@ const OrgTaskRecords = () => {
|
||||
dataSource={logs}
|
||||
rowKey='key'
|
||||
loading={loading}
|
||||
pagination={false}
|
||||
scroll={{ x: scrollX }}
|
||||
locale={{
|
||||
emptyText: <TableEmpty />,
|
||||
pagination={{
|
||||
currentPage: taskLogsData.activePage,
|
||||
pageSize: taskLogsData.pageSize,
|
||||
total: taskLogsData.logCount,
|
||||
onPageSizeChange: taskLogsData.handlePageSizeChange,
|
||||
onPageChange: taskLogsData.handlePageChange,
|
||||
}}
|
||||
scroll={{ x: scrollX }}
|
||||
empty={<TableEmpty />}
|
||||
/>
|
||||
{taskLogsData.logCount > 0 && (
|
||||
<Pagination
|
||||
currentPage={taskLogsData.activePage}
|
||||
pageSize={taskLogsData.pageSize}
|
||||
total={taskLogsData.logCount}
|
||||
pageSizeOpts={[10, 20, 50]}
|
||||
showSizeChanger
|
||||
onPageSizeChange={taskLogsData.handlePageSizeChange}
|
||||
onPageChange={taskLogsData.handlePageChange}
|
||||
preventPageChangeOnPageSizeChange={false}
|
||||
showQuickJumper={isMobile}
|
||||
showTotal={(total) => t('共 {{total}} 条', { total })}
|
||||
/>
|
||||
)}
|
||||
</OrgListCard>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -296,7 +296,7 @@ const OrgDsRules = ({ orgId, isSuperAdmin }) => {
|
||||
<Table
|
||||
columns={customColumns}
|
||||
dataSource={customRules}
|
||||
pagination={false}
|
||||
pagination={{ resetOnDataChange: true }}
|
||||
rowKey='id'
|
||||
size='small'
|
||||
scroll={{ x: 'max(100%, 900px)' }}
|
||||
@@ -320,7 +320,7 @@ const OrgDsRules = ({ orgId, isSuperAdmin }) => {
|
||||
<Table
|
||||
columns={platformColumns}
|
||||
dataSource={platformRules.map((r, i) => ({ ...r, _key: i }))}
|
||||
pagination={false}
|
||||
pagination={{ resetOnDataChange: true }}
|
||||
rowKey='_key'
|
||||
size='small'
|
||||
scroll={{ x: 'max(100%, 640px)' }}
|
||||
|
||||
@@ -26,7 +26,7 @@ import React, {
|
||||
} from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Alert, Button, Tag, Typography } from 'antd';
|
||||
import Table from '../../../components/ui/CenterActionTable';
|
||||
import { Table } from '@/components/ui';
|
||||
// 流水入口:ActionIcons 无 ScrollText,使用账本语义的 ReceiptText
|
||||
import { ReceiptText as ScrollText } from '@/components/common/icons/ActionIcons';
|
||||
import {
|
||||
@@ -38,7 +38,7 @@ import {
|
||||
} from 'lucide-react';
|
||||
import OrgStatCard from '../components/OrgStatCard';
|
||||
import OrgStateBlock from '../components/OrgStateBlock';
|
||||
import { TableRowActions } from '@/components/common/table/TableToolbar';
|
||||
import { OrgRowActions } from '../components/OrgListCard';
|
||||
import { renderQuota } from '../../../helpers/render';
|
||||
import { deptFundApi } from './fundApi';
|
||||
import { FUND_STATE, buildFundTree } from './fundFormat';
|
||||
@@ -193,39 +193,30 @@ const DeptFundsPanel = ({ orgId, deptId, deptName, refreshKey }) => {
|
||||
},
|
||||
{
|
||||
title: t('操作'),
|
||||
width: 168,
|
||||
width: 210,
|
||||
fixed: 'right',
|
||||
render: (_, r) => (
|
||||
<TableRowActions
|
||||
items={
|
||||
canTransfer
|
||||
? [
|
||||
r.account && {
|
||||
key: 'ledger',
|
||||
label: t('流水'),
|
||||
onClick: () =>
|
||||
setLedgerAccount({ id: r.account.id, name: r.name }),
|
||||
},
|
||||
{
|
||||
key: 'recall',
|
||||
label: t('回收'),
|
||||
onClick: () => setTransfer({ mode: 'recall', row: r }),
|
||||
},
|
||||
]
|
||||
: []
|
||||
}
|
||||
>
|
||||
<OrgRowActions>
|
||||
{canTransfer && (
|
||||
<Button
|
||||
size='small'
|
||||
type='link'
|
||||
disabled={centerDisabled || r.dept_status === 2}
|
||||
onClick={() => setTransfer({ mode: 'allocate', row: r })}
|
||||
>
|
||||
{t('分配')}
|
||||
</Button>
|
||||
<>
|
||||
<Button
|
||||
size='small'
|
||||
type='link'
|
||||
disabled={centerDisabled || r.dept_status === 2}
|
||||
onClick={() => setTransfer({ mode: 'allocate', row: r })}
|
||||
>
|
||||
{t('分配')}
|
||||
</Button>
|
||||
<Button
|
||||
size='small'
|
||||
type='link'
|
||||
onClick={() => setTransfer({ mode: 'recall', row: r })}
|
||||
>
|
||||
{t('回收')}
|
||||
</Button>
|
||||
</>
|
||||
)}
|
||||
{!canTransfer && r.account && (
|
||||
{r.account && (
|
||||
<Button
|
||||
size='small'
|
||||
type='link'
|
||||
@@ -236,7 +227,7 @@ const DeptFundsPanel = ({ orgId, deptId, deptName, refreshKey }) => {
|
||||
{t('流水')}
|
||||
</Button>
|
||||
)}
|
||||
</TableRowActions>
|
||||
</OrgRowActions>
|
||||
),
|
||||
},
|
||||
];
|
||||
@@ -349,7 +340,7 @@ const DeptFundsPanel = ({ orgId, deptId, deptName, refreshKey }) => {
|
||||
dataSource={tree}
|
||||
loading={loading}
|
||||
rowKey='key'
|
||||
pagination={false}
|
||||
pagination={{ resetOnDataChange: true }}
|
||||
expandable={{ defaultExpandAllRows: true }}
|
||||
size='middle'
|
||||
scroll={{ x: 860 }}
|
||||
|
||||
@@ -34,7 +34,7 @@ import {
|
||||
fundEntryLabel,
|
||||
} from './fundFormat';
|
||||
|
||||
const PAGE_SIZE = 20;
|
||||
const DEFAULT_PAGE_SIZE = 20;
|
||||
const defaultRange = () => {
|
||||
const end = new Date();
|
||||
return [new Date(end.getTime() - 30 * 24 * 3600 * 1000), end];
|
||||
@@ -51,6 +51,7 @@ const FundLedgerSheet = ({ visible, account, fetchLedger, onClose }) => {
|
||||
const [range, setRange] = useState(defaultRange);
|
||||
const [types, setTypes] = useState([]);
|
||||
const [page, setPage] = useState(1);
|
||||
const [pageSize, setPageSize] = useState(DEFAULT_PAGE_SIZE);
|
||||
const [items, setItems] = useState([]);
|
||||
const [total, setTotal] = useState(0);
|
||||
const [loading, setLoading] = useState(false);
|
||||
@@ -77,7 +78,7 @@ const FundLedgerSheet = ({ visible, account, fetchLedger, onClose }) => {
|
||||
end_timestamp: end ? Math.floor(end.getTime() / 1000) : undefined,
|
||||
type: types.length ? types.join(',') : undefined,
|
||||
p: page,
|
||||
page_size: PAGE_SIZE,
|
||||
page_size: pageSize,
|
||||
});
|
||||
if (seq !== seqRef.current) return;
|
||||
if (res?.data?.success) {
|
||||
@@ -92,7 +93,7 @@ const FundLedgerSheet = ({ visible, account, fetchLedger, onClose }) => {
|
||||
} finally {
|
||||
if (seq === seqRef.current) setLoading(false);
|
||||
}
|
||||
}, [visible, account?.id, range, types, page, fetchLedger, t]);
|
||||
}, [visible, account?.id, range, types, page, pageSize, fetchLedger, t]);
|
||||
|
||||
useEffect(() => {
|
||||
load();
|
||||
@@ -263,8 +264,11 @@ const FundLedgerSheet = ({ visible, account, fetchLedger, onClose }) => {
|
||||
scroll={{ x: 'max-content' }}
|
||||
pagination={{
|
||||
currentPage: page,
|
||||
pageSize: PAGE_SIZE,
|
||||
showSizeChanger: false,
|
||||
pageSize,
|
||||
onPageSizeChange: (size) => {
|
||||
setPage(1);
|
||||
setPageSize(size);
|
||||
},
|
||||
total,
|
||||
onPageChange: setPage,
|
||||
showTotal: (n) => t('共 {{total}} 条', { total: n }),
|
||||
|
||||
@@ -28,14 +28,14 @@ import { useTranslation } from 'react-i18next';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { Alert, Button, Switch, Tag, Typography } from 'antd';
|
||||
import { Building2, Layers, PiggyBank, Power, Wallet } from 'lucide-react';
|
||||
import Table from '../../../components/ui/CenterActionTable';
|
||||
import { Table } from '@/components/ui';
|
||||
// 流水入口:ActionIcons 无 ScrollText,使用账本语义的 ReceiptText
|
||||
import { ReceiptText as ScrollText } from '@/components/common/icons/ActionIcons';
|
||||
import OrgPanel from '../components/OrgPanel';
|
||||
import OrgStatCard from '../components/OrgStatCard';
|
||||
import OrgStateBlock from '../components/OrgStateBlock';
|
||||
import OrgModal from '../components/OrgModal';
|
||||
import { TableRowActions } from '@/components/common/table/TableToolbar';
|
||||
import { OrgRowActions } from '../components/OrgListCard';
|
||||
import { showError, showSuccess } from '../../../helpers/utils';
|
||||
import { renderQuota } from '../../../helpers/render';
|
||||
import { orgFundApi } from './fundApi';
|
||||
@@ -279,41 +279,32 @@ const OrgDeptFunds = ({ orgId }) => {
|
||||
},
|
||||
{
|
||||
title: t('操作'),
|
||||
width: 168,
|
||||
width: 220,
|
||||
fixed: 'right',
|
||||
render: (_, r) => {
|
||||
const isArchived = r.account?.status === FUND_ACCOUNT_STATUS.ARCHIVED;
|
||||
return (
|
||||
<TableRowActions
|
||||
items={
|
||||
canTransfer && !isArchived
|
||||
? [
|
||||
r.account && {
|
||||
key: 'ledger',
|
||||
label: t('流水'),
|
||||
onClick: () =>
|
||||
setLedgerAccount({ id: r.account.id, name: r.name }),
|
||||
},
|
||||
{
|
||||
key: 'recall',
|
||||
label: t('回收'),
|
||||
onClick: () => setTransfer({ mode: 'recall', row: r }),
|
||||
},
|
||||
]
|
||||
: []
|
||||
}
|
||||
>
|
||||
<OrgRowActions>
|
||||
{canTransfer && !isArchived && (
|
||||
<Button
|
||||
size='small'
|
||||
type='link'
|
||||
disabled={r.dept_status === 2}
|
||||
onClick={() => setTransfer({ mode: 'allocate', row: r })}
|
||||
>
|
||||
{t('分配')}
|
||||
</Button>
|
||||
<>
|
||||
<Button
|
||||
size='small'
|
||||
type='link'
|
||||
disabled={r.dept_status === 2}
|
||||
onClick={() => setTransfer({ mode: 'allocate', row: r })}
|
||||
>
|
||||
{t('分配')}
|
||||
</Button>
|
||||
<Button
|
||||
size='small'
|
||||
type='link'
|
||||
onClick={() => setTransfer({ mode: 'recall', row: r })}
|
||||
>
|
||||
{t('回收')}
|
||||
</Button>
|
||||
</>
|
||||
)}
|
||||
{(!canTransfer || isArchived) && r.account && (
|
||||
{r.account && (
|
||||
<Button
|
||||
size='small'
|
||||
type='link'
|
||||
@@ -324,7 +315,7 @@ const OrgDeptFunds = ({ orgId }) => {
|
||||
{t('流水')}
|
||||
</Button>
|
||||
)}
|
||||
</TableRowActions>
|
||||
</OrgRowActions>
|
||||
);
|
||||
},
|
||||
},
|
||||
@@ -495,7 +486,7 @@ const OrgDeptFunds = ({ orgId }) => {
|
||||
dataSource={[...tree, ...(includeArchived ? archivedRows : [])]}
|
||||
loading={loading}
|
||||
rowKey='key'
|
||||
pagination={false}
|
||||
pagination={{ resetOnDataChange: true }}
|
||||
expandable={{ defaultExpandAllRows: true }}
|
||||
size='middle'
|
||||
scroll={{ x: 900 }}
|
||||
|
||||
@@ -18,7 +18,6 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
|
||||
import { Trans } from 'react-i18next';
|
||||
import { TableRowActions } from '@/components/common/table/TableToolbar';
|
||||
import React, {
|
||||
useCallback,
|
||||
useEffect,
|
||||
@@ -594,40 +593,7 @@ export default function SettingsPaymentGatewayPayPal(props) {
|
||||
{
|
||||
title: t('操作'),
|
||||
render: (_, row) => (
|
||||
<TableRowActions
|
||||
items={[
|
||||
{
|
||||
key: 'reconcile',
|
||||
label: t('触发对账'),
|
||||
onClick: () => reconcileOperationOrder(row.trade_no),
|
||||
disabled: !row.third_trade_no,
|
||||
},
|
||||
{
|
||||
key: 'expire',
|
||||
label: t('确认未付款并过期'),
|
||||
onClick: () => {
|
||||
setExpireOrder(row);
|
||||
setForceExpire(false);
|
||||
setForceExpireConfirmed(false);
|
||||
setExpireReason(t('确认该订单未完成 PayPal 支付'));
|
||||
},
|
||||
danger: true,
|
||||
},
|
||||
{
|
||||
key: 'force-expire',
|
||||
label: t('强制过期'),
|
||||
onClick: () => {
|
||||
setExpireOrder(row);
|
||||
setForceExpire(true);
|
||||
setForceExpireConfirmed(false);
|
||||
setExpireReason(
|
||||
t('管理员确认远端状态无法核验,强制关闭该 PayPal 订单'),
|
||||
);
|
||||
},
|
||||
danger: true,
|
||||
},
|
||||
]}
|
||||
>
|
||||
<div className='flex flex-wrap gap-2'>
|
||||
<Button
|
||||
htmlType='button'
|
||||
onClick={() => inspectOperationOrder(row.trade_no)}
|
||||
@@ -636,7 +602,45 @@ export default function SettingsPaymentGatewayPayPal(props) {
|
||||
>
|
||||
{t('查询远端状态')}
|
||||
</Button>
|
||||
</TableRowActions>
|
||||
<Button
|
||||
htmlType='button'
|
||||
onClick={() => reconcileOperationOrder(row.trade_no)}
|
||||
disabled={!row.third_trade_no}
|
||||
type='link'
|
||||
size='small'
|
||||
>
|
||||
{t('触发对账')}
|
||||
</Button>
|
||||
<Button
|
||||
htmlType='button'
|
||||
onClick={() => {
|
||||
setExpireOrder(row);
|
||||
setForceExpire(false);
|
||||
setForceExpireConfirmed(false);
|
||||
setExpireReason(t('确认该订单未完成 PayPal 支付'));
|
||||
}}
|
||||
type='link'
|
||||
size='small'
|
||||
danger
|
||||
>
|
||||
{t('确认未付款并过期')}
|
||||
</Button>
|
||||
<Button
|
||||
htmlType='button'
|
||||
onClick={() => {
|
||||
setExpireOrder(row);
|
||||
setForceExpire(true);
|
||||
setForceExpireConfirmed(false);
|
||||
setExpireReason(
|
||||
t('管理员确认远端状态无法核验,强制关闭该 PayPal 订单'),
|
||||
);
|
||||
}}
|
||||
type='link'
|
||||
size='small'
|
||||
>
|
||||
{t('强制过期')}
|
||||
</Button>
|
||||
</div>
|
||||
),
|
||||
},
|
||||
],
|
||||
|
||||
@@ -23,14 +23,14 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
// root 和被下放了「WeyAi」页签的管理员都能用。
|
||||
|
||||
import { Trans } from 'react-i18next';
|
||||
import { TableRowActions } from '@/components/common/table/TableToolbar';
|
||||
import React, { useCallback, useEffect, useState } from 'react';
|
||||
import {
|
||||
Banner,
|
||||
Button,
|
||||
Card,
|
||||
Modal,
|
||||
Popconfirm,
|
||||
Select,
|
||||
Space,
|
||||
Spin,
|
||||
Table,
|
||||
Tag,
|
||||
@@ -264,48 +264,7 @@ const SettingsWeyAiContent = () => {
|
||||
title: t('操作'),
|
||||
width: 300,
|
||||
render: (_, item, index) => (
|
||||
<TableRowActions
|
||||
items={[
|
||||
item.status === 'published' && {
|
||||
key: 'offline',
|
||||
label: t('下架'),
|
||||
onClick: () => setStatus(item, 'offline'),
|
||||
disabled: busyId === item.id,
|
||||
},
|
||||
item.status !== 'published' && {
|
||||
key: 'publish',
|
||||
label: t('发布'),
|
||||
onClick: () => setStatus(item, 'published'),
|
||||
disabled: busyId === item.id,
|
||||
},
|
||||
{
|
||||
key: 'up',
|
||||
label: t('上移'),
|
||||
onClick: () => move(index, -1),
|
||||
disabled: index === 0,
|
||||
},
|
||||
{
|
||||
key: 'down',
|
||||
label: t('下移'),
|
||||
onClick: () => move(index, 1),
|
||||
disabled: index === items.length - 1,
|
||||
},
|
||||
{
|
||||
key: 'delete',
|
||||
label: t('删除'),
|
||||
danger: true,
|
||||
onClick: () =>
|
||||
Modal.confirm({
|
||||
title: t('确定删除这个条目?'),
|
||||
content: t('删除后客户端不再显示;它的文件 7 天后清理'),
|
||||
okText: t('确认'),
|
||||
cancelText: t('取消'),
|
||||
okButtonProps: { danger: true },
|
||||
onOk: () => remove(item),
|
||||
}),
|
||||
},
|
||||
]}
|
||||
>
|
||||
<Space wrap>
|
||||
<Button
|
||||
onClick={() => setEditor({ visible: true, item })}
|
||||
type='link'
|
||||
@@ -313,7 +272,53 @@ const SettingsWeyAiContent = () => {
|
||||
>
|
||||
{t('编辑')}
|
||||
</Button>
|
||||
</TableRowActions>
|
||||
{item.status === 'published' ? (
|
||||
<Button
|
||||
loading={busyId === item.id}
|
||||
onClick={() => setStatus(item, 'offline')}
|
||||
type='link'
|
||||
size='small'
|
||||
>
|
||||
{t('下架')}
|
||||
</Button>
|
||||
) : (
|
||||
<Button
|
||||
loading={busyId === item.id}
|
||||
onClick={() => setStatus(item, 'published')}
|
||||
type='link'
|
||||
size='small'
|
||||
>
|
||||
{t('发布')}
|
||||
</Button>
|
||||
)}
|
||||
<Button
|
||||
disabled={index === 0}
|
||||
aria-label={t('上移')}
|
||||
onClick={() => move(index, -1)}
|
||||
type='link'
|
||||
size='small'
|
||||
>
|
||||
{t('上移')}
|
||||
</Button>
|
||||
<Button
|
||||
disabled={index === items.length - 1}
|
||||
aria-label={t('下移')}
|
||||
onClick={() => move(index, 1)}
|
||||
type='link'
|
||||
size='small'
|
||||
>
|
||||
{t('下移')}
|
||||
</Button>
|
||||
<Popconfirm
|
||||
title={t('确定删除这个条目?')}
|
||||
content={t('删除后客户端不再显示;它的文件 7 天后清理')}
|
||||
onConfirm={() => remove(item)}
|
||||
>
|
||||
<Button type='link' size='small' danger>
|
||||
{t('删除')}
|
||||
</Button>
|
||||
</Popconfirm>
|
||||
</Space>
|
||||
),
|
||||
},
|
||||
];
|
||||
|
||||
@@ -22,7 +22,6 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
// 也会带上这里写的内容。客户端读公开接口 GET /api/weyai/desktop/release-notes,
|
||||
// 未登录也能看到;草稿只在这里可见。root 和被下放了「WeyAi」页签的管理员都能用。
|
||||
|
||||
import { TableRowActions } from '@/components/common/table/TableToolbar';
|
||||
import React, { useCallback, useEffect, useState } from 'react';
|
||||
import {
|
||||
Banner,
|
||||
@@ -31,6 +30,7 @@ import {
|
||||
Empty,
|
||||
Input,
|
||||
Modal,
|
||||
Popconfirm,
|
||||
Space,
|
||||
Switch,
|
||||
Table,
|
||||
@@ -197,37 +197,7 @@ const SettingsWeyAiReleaseNotes = () => {
|
||||
title: t('操作'),
|
||||
width: 240,
|
||||
render: (_, note) => (
|
||||
<TableRowActions
|
||||
items={[
|
||||
note.status === 'published' && {
|
||||
key: 'withdraw',
|
||||
label: t('撤回'),
|
||||
onClick: () => setStatus(note, 'draft'),
|
||||
disabled: busyId === note.id,
|
||||
},
|
||||
note.status !== 'published' && {
|
||||
key: 'publish',
|
||||
label: t('发布'),
|
||||
onClick: () => setStatus(note, 'published'),
|
||||
disabled: busyId === note.id,
|
||||
},
|
||||
{
|
||||
key: 'delete',
|
||||
label: t('删除'),
|
||||
disabled: busyId === note.id,
|
||||
danger: true,
|
||||
onClick: () =>
|
||||
Modal.confirm({
|
||||
title: t('确定删除这条版本说明吗?'),
|
||||
content: t('删除后客户端不再显示这个版本的说明'),
|
||||
okText: t('确认'),
|
||||
cancelText: t('取消'),
|
||||
okButtonProps: { danger: true },
|
||||
onOk: () => remove(note),
|
||||
}),
|
||||
},
|
||||
]}
|
||||
>
|
||||
<Space>
|
||||
<Button
|
||||
onClick={() => setDraft({ ...note })}
|
||||
type='link'
|
||||
@@ -235,7 +205,40 @@ const SettingsWeyAiReleaseNotes = () => {
|
||||
>
|
||||
{t('编辑')}
|
||||
</Button>
|
||||
</TableRowActions>
|
||||
{note.status === 'published' ? (
|
||||
<Button
|
||||
loading={busyId === note.id}
|
||||
onClick={() => setStatus(note, 'draft')}
|
||||
type='link'
|
||||
size='small'
|
||||
>
|
||||
{t('撤回')}
|
||||
</Button>
|
||||
) : (
|
||||
<Button
|
||||
loading={busyId === note.id}
|
||||
onClick={() => setStatus(note, 'published')}
|
||||
type='link'
|
||||
size='small'
|
||||
>
|
||||
{t('发布')}
|
||||
</Button>
|
||||
)}
|
||||
<Popconfirm
|
||||
title={t('确定删除这条版本说明吗?')}
|
||||
content={t('删除后客户端不再显示这个版本的说明')}
|
||||
onConfirm={() => remove(note)}
|
||||
>
|
||||
<Button
|
||||
disabled={busyId === note.id}
|
||||
type='link'
|
||||
size='small'
|
||||
danger
|
||||
>
|
||||
{t('删除')}
|
||||
</Button>
|
||||
</Popconfirm>
|
||||
</Space>
|
||||
),
|
||||
},
|
||||
];
|
||||
|
||||
@@ -20,6 +20,10 @@ import { formatUserReference } from '../../helpers/safeDisplay';
|
||||
|
||||
import { Trans } from 'react-i18next';
|
||||
import {
|
||||
Ban as ActionBan,
|
||||
ShieldCheck as ActionShieldCheck,
|
||||
CalendarClock as ActionCalendarClock,
|
||||
Pencil as ActionPencil,
|
||||
Plus as ActionPlus,
|
||||
CreditCard as ActionCreditCard,
|
||||
} from '@/components/common/icons/ActionIcons';
|
||||
@@ -29,7 +33,6 @@ import {
|
||||
ConsoleListTable,
|
||||
} from '../../components/console/ConsolePrimitives';
|
||||
import ConsoleCollection from '../../components/console/ConsoleCollection';
|
||||
import { TableRowActions } from '../../components/common/table/TableToolbar';
|
||||
import { useIsMobile } from '../../hooks/common/useIsMobile';
|
||||
import { createCardProPagination } from '../../helpers/utils';
|
||||
import { Button as AntButton } from 'antd';
|
||||
@@ -46,6 +49,7 @@ import {
|
||||
Input,
|
||||
InputNumber,
|
||||
Modal,
|
||||
Popconfirm,
|
||||
Select,
|
||||
Space,
|
||||
Tag,
|
||||
@@ -424,52 +428,70 @@ const Subscription = () => {
|
||||
{
|
||||
title: t('操作'),
|
||||
key: 'actions',
|
||||
width: 140,
|
||||
width: 300,
|
||||
fixed: 'right',
|
||||
render: (_, r) => (
|
||||
<TableRowActions
|
||||
items={[
|
||||
admin && {
|
||||
key: 'edit',
|
||||
label: t('编辑'),
|
||||
onClick: () => openEdit(r),
|
||||
},
|
||||
admin &&
|
||||
r.status !== 'canceled' &&
|
||||
r.status !== 'banned' && {
|
||||
key: 'extend',
|
||||
label: t('延长'),
|
||||
onClick: () => openExtend(r),
|
||||
},
|
||||
admin &&
|
||||
r.status === 'active' && {
|
||||
key: 'grant',
|
||||
label: t('补发'),
|
||||
onClick: () =>
|
||||
Modal.confirm({
|
||||
title: t('确认手动补发今日额度?'),
|
||||
onOk: () => doGrant(r),
|
||||
}),
|
||||
},
|
||||
admin &&
|
||||
r.status === 'banned' && {
|
||||
key: 'unban',
|
||||
label: t('解封'),
|
||||
onClick: () => openUnban(r),
|
||||
},
|
||||
admin &&
|
||||
r.status !== 'banned' && {
|
||||
key: 'ban',
|
||||
label: t('封禁'),
|
||||
danger: true,
|
||||
onClick: () => openBan(r),
|
||||
},
|
||||
]}
|
||||
>
|
||||
<Button type='link' size='small' onClick={() => openDetail(r)}>
|
||||
<Space spacing={4} wrap>
|
||||
<Button size='small' theme='borderless' onClick={() => openDetail(r)}>
|
||||
{t('详情')}
|
||||
</Button>
|
||||
</TableRowActions>
|
||||
{admin && r.status !== 'banned' && (
|
||||
<Button
|
||||
size='small'
|
||||
theme='borderless'
|
||||
type='danger'
|
||||
icon={<ActionBan size={12} />}
|
||||
onClick={() => openBan(r)}
|
||||
>
|
||||
{t('封禁')}
|
||||
</Button>
|
||||
)}
|
||||
{admin && r.status === 'banned' && (
|
||||
<Button
|
||||
size='small'
|
||||
theme='borderless'
|
||||
type='primary'
|
||||
icon={<ActionShieldCheck size={12} />}
|
||||
onClick={() => openUnban(r)}
|
||||
>
|
||||
{t('解封')}
|
||||
</Button>
|
||||
)}
|
||||
{admin && r.status !== 'canceled' && r.status !== 'banned' && (
|
||||
<Button
|
||||
size='small'
|
||||
theme='borderless'
|
||||
icon={<ActionCalendarClock size={12} />}
|
||||
onClick={() => openExtend(r)}
|
||||
>
|
||||
{t('延长')}
|
||||
</Button>
|
||||
)}
|
||||
{admin && (
|
||||
<Button
|
||||
size='small'
|
||||
theme='borderless'
|
||||
icon={<ActionPencil size={12} />}
|
||||
onClick={() => openEdit(r)}
|
||||
>
|
||||
{t('编辑')}
|
||||
</Button>
|
||||
)}
|
||||
{admin && r.status === 'active' && (
|
||||
<Popconfirm
|
||||
title={t('确认手动补发今日额度?')}
|
||||
onConfirm={() => doGrant(r)}
|
||||
>
|
||||
<Button
|
||||
size='small'
|
||||
theme='borderless'
|
||||
icon={<Sparkles size={12} />}
|
||||
>
|
||||
{t('补发')}
|
||||
</Button>
|
||||
</Popconfirm>
|
||||
)}
|
||||
</Space>
|
||||
),
|
||||
},
|
||||
];
|
||||
@@ -493,7 +515,6 @@ const Subscription = () => {
|
||||
placeholder={t('搜索用户名/昵称/订单号')}
|
||||
value={keyword}
|
||||
onChange={setKeyword}
|
||||
onEnterPress={handleSearch}
|
||||
/>
|
||||
</ConsoleFilterField>
|
||||
<ConsoleFilterField label={t('用户ID')} id='subscription-user-id'>
|
||||
@@ -609,14 +630,14 @@ const Subscription = () => {
|
||||
{admin && (
|
||||
<div className='console-list-tool-actions'>
|
||||
<Button
|
||||
icon={<ActionCreditCard size={14} />}
|
||||
icon={<ActionCreditCard size={16} />}
|
||||
onClick={() => navigate('/console/setting?tab=membership')}
|
||||
>
|
||||
{t('会员管理')}
|
||||
</Button>
|
||||
<Button
|
||||
type='primary'
|
||||
icon={<ActionPlus size={14} />}
|
||||
icon={<ActionPlus size={16} />}
|
||||
onClick={openCreate}
|
||||
>
|
||||
{t('新建会员')}
|
||||
@@ -634,7 +655,6 @@ const Subscription = () => {
|
||||
setPage(1);
|
||||
setPageSize(size);
|
||||
},
|
||||
showSizeChanger: false,
|
||||
isMobile,
|
||||
t,
|
||||
})}
|
||||
|
||||
@@ -243,14 +243,6 @@ html.dark .usage-record-consume-card {
|
||||
background: var(--ur-consume-neutral-bg);
|
||||
color: var(--ur-text);
|
||||
}
|
||||
.usage-logs-table.usage-record-table .usage-record-use-time .ant-tag {
|
||||
margin-inline-end: 0;
|
||||
padding: 0 6px;
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
font-variant-numeric: tabular-nums;
|
||||
line-height: 22px;
|
||||
}
|
||||
.usage-logs-table.usage-record-table .usage-record-cost {
|
||||
color: var(--ur-cost);
|
||||
}
|
||||
@@ -306,12 +298,6 @@ html.dark .usage-record-consume-card {
|
||||
font-family: var(--ui-font-family-mono);
|
||||
font-size: 11px;
|
||||
}
|
||||
.usage-record-use-time {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.usage-record-cost {
|
||||
color: var(--ur-cost);
|
||||
font-weight: 600;
|
||||
|
||||
@@ -17,7 +17,6 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
|
||||
import { TableRowActions } from '@/components/common/table/TableToolbar';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import TableEmpty from '../../components/common/table/TableEmpty';
|
||||
import TableToolbar from '../../components/common/table/TableToolbar';
|
||||
@@ -184,32 +183,7 @@ export default function InsightsPanel({ value, onChange, disabled, error }) {
|
||||
const index = value.articles.findIndex((a) => a.id === item.id);
|
||||
const move = (offset) => onChange(moveArticle(value, item.id, offset));
|
||||
return (
|
||||
<TableRowActions
|
||||
items={[
|
||||
{
|
||||
key: 'up',
|
||||
label: t('上移'),
|
||||
title: sortable ? undefined : '请在全部分类且无搜索时调整顺序',
|
||||
disabled: disabled || !sortable || index <= 0,
|
||||
onClick: () => move(-1),
|
||||
},
|
||||
{
|
||||
key: 'down',
|
||||
label: t('下移'),
|
||||
title: sortable ? undefined : '请在全部分类且无搜索时调整顺序',
|
||||
disabled:
|
||||
disabled || !sortable || index >= value.articles.length - 1,
|
||||
onClick: () => move(1),
|
||||
},
|
||||
{
|
||||
key: 'delete',
|
||||
label: t('删除'),
|
||||
danger: true,
|
||||
disabled,
|
||||
onClick: () => deleteArticle(item),
|
||||
},
|
||||
]}
|
||||
>
|
||||
<div className='website-insights-row-actions'>
|
||||
<Button
|
||||
type='link'
|
||||
size='small'
|
||||
@@ -220,7 +194,38 @@ export default function InsightsPanel({ value, onChange, disabled, error }) {
|
||||
>
|
||||
{t('编辑')}
|
||||
</Button>
|
||||
</TableRowActions>
|
||||
<Button
|
||||
type='link'
|
||||
size='small'
|
||||
aria-label={`上移${item.title}`}
|
||||
title={sortable ? undefined : '请在全部分类且无搜索时调整顺序'}
|
||||
disabled={disabled || !sortable || index <= 0}
|
||||
onClick={() => move(-1)}
|
||||
>
|
||||
{t('上移')}
|
||||
</Button>
|
||||
<Button
|
||||
type='link'
|
||||
size='small'
|
||||
aria-label={`下移${item.title}`}
|
||||
title={sortable ? undefined : '请在全部分类且无搜索时调整顺序'}
|
||||
disabled={
|
||||
disabled || !sortable || index >= value.articles.length - 1
|
||||
}
|
||||
onClick={() => move(1)}
|
||||
>
|
||||
{t('下移')}
|
||||
</Button>
|
||||
<Button
|
||||
type='link'
|
||||
size='small'
|
||||
danger
|
||||
disabled={disabled}
|
||||
onClick={() => deleteArticle(item)}
|
||||
>
|
||||
{t('删除')}
|
||||
</Button>
|
||||
</div>
|
||||
);
|
||||
},
|
||||
},
|
||||
|
||||
@@ -458,8 +458,8 @@ html.dark .org-center .oc-page {
|
||||
}
|
||||
|
||||
/* ---------- 审计日志(原型 EnterpriseAudit .eau-*) ---------- */
|
||||
.org-center .oc-page .oc-audit-filter .oc-filter-grid {
|
||||
grid-template-columns: minmax(0, 1fr);
|
||||
.org-center .oc-page .oc-audit-filter > .ant-card-body {
|
||||
padding-block: 22px;
|
||||
}
|
||||
|
||||
.org-center .oc-page .oc-audit-detail {
|
||||
|
||||
@@ -1,16 +1,5 @@
|
||||
{
|
||||
"src/pages/AdminOrganizations/index.jsx": 1,
|
||||
"src/pages/AdminInvoice/index.jsx": 2,
|
||||
"src/components/settings/DataSecuritySetting.jsx": 4,
|
||||
"src/pages/Organization/OrgPrivateSkills.jsx": 2,
|
||||
"src/pages/Organization/OrgSkillAssignments.jsx": 1,
|
||||
"src/pages/Organization/OrgEffectiveness.jsx": 4,
|
||||
"src/pages/Organization/OrgMemberAccounts.jsx": 1,
|
||||
"src/pages/Organization/OrgDeptManage.jsx": 2,
|
||||
"src/pages/Organization/OrgProjectManage.jsx": 1,
|
||||
"src/pages/Organization/OrgProjects.jsx": 2,
|
||||
"src/pages/Organization/OrgBudgets.jsx": 1,
|
||||
"src/pages/Organization/OrgLogs.jsx": 1,
|
||||
"src/pages/Organization/components/OrgTaskRecords.jsx": 1,
|
||||
"src/pages/Organization/datasecurity/OrgDsRules.jsx": 2
|
||||
"src/pages/AdminInvoice/index.jsx": 1,
|
||||
"src/components/settings/DataSecuritySetting.jsx": 4
|
||||
}
|
||||
|
||||
@@ -475,7 +475,7 @@ test('Existing unpaginated tables keep pagination disabled after other UI edits'
|
||||
assert.equal(actual, count, file + ': unpaginated table count');
|
||||
compared += actual;
|
||||
}
|
||||
assert.ok(compared > 20, 'Covers the original unpaginated tables');
|
||||
assert.equal(compared, 6, 'Covers the intentionally unpaginated tables');
|
||||
});
|
||||
|
||||
test('Visual model editor keeps frontend filtering and supports size reset', async () => {
|
||||
|
||||
@@ -53,6 +53,8 @@ const mocks = {
|
||||
'react-i18next': {},
|
||||
'../ui/CenterActionTable': 'table',
|
||||
'../common/table/TableEmpty': () => null,
|
||||
'../common/table/FilterSearchButton': () => null,
|
||||
'./console.css': {},
|
||||
'./ConsoleContext': { useConsolePage: () => ({ page: { key: pageKey } }) },
|
||||
};
|
||||
new Function('require', 'module', 'exports', code)(
|
||||
|
||||
@@ -42,6 +42,8 @@ test('settings tables share the log empty state while other console routes retai
|
||||
'react-i18next': { useTranslation: () => ({ t: (value) => value }) },
|
||||
'../ui/CenterActionTable': Ant.Table,
|
||||
'../common/table/TableEmpty': TableEmpty,
|
||||
'../common/table/FilterSearchButton': () => null,
|
||||
'./console.css': {},
|
||||
'./ConsoleContext': { useConsolePage: () => ({ page: { key } }) },
|
||||
},
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user