feat(*): 对齐兑换码与渠道表格,统一兑换码侧栏窗并固定消费记录首尾列
This commit is contained in:
@@ -10,6 +10,38 @@
|
|||||||
|
|
||||||
## 2026-11-25
|
## 2026-11-25
|
||||||
|
|
||||||
|
### 优化 · 消费记录固定首尾列
|
||||||
|
|
||||||
|
- **范围**:用户中心 `/user-center/usage-record` 的消费记录调用明细。
|
||||||
|
- **变更**:时间列固定在左侧,操作列显示时固定在右侧。
|
||||||
|
- **影响**:横向滚动中间字段时,仍可读取时间并打开账单详情。
|
||||||
|
- **回滚**:还原消费记录时间列和操作列的固定配置。
|
||||||
|
- **关联**:`src/components/table/usage-logs/`、`docs/ui/USER_CENTER_SPEC.md`。
|
||||||
|
|
||||||
|
### 优化 · 兑换码编辑侧栏窗
|
||||||
|
|
||||||
|
- **范围**:控制台 `/console/redemption` 编辑入口。
|
||||||
|
- **变更**:编辑兑换码信息与添加兑换码共用右侧侧栏窗。
|
||||||
|
- **影响**:两种表单使用相同的宽度、关闭方式和页脚,编辑继续回填当前记录。
|
||||||
|
- **回滚**:还原兑换码编辑表单的独立弹窗。
|
||||||
|
- **关联**:`src/components/table/redemptions/modals/EditRedemptionModal.jsx`、`docs/ui/CONSOLE_SPEC.md`。
|
||||||
|
|
||||||
|
### 优化 · 兑换码列表行内操作
|
||||||
|
|
||||||
|
- **范围**:控制台 `/console/redemption` 表格操作列。
|
||||||
|
- **变更**:「查看详情」入口简化为「查看」,启用、禁用和删除从更多菜单移至行内,按钮单行排列并随操作列固定在右侧。
|
||||||
|
- **影响**:桌面与窄屏均可直接使用行操作,启停权限和删除确认沿用原规则。
|
||||||
|
- **回滚**:还原兑换码操作列按钮、宽度和换行样式。
|
||||||
|
- **关联**:`src/components/table/redemptions/`、`docs/ui/CONSOLE_SPEC.md`。
|
||||||
|
|
||||||
|
### 优化 · 兑换码列表与表单
|
||||||
|
|
||||||
|
- **范围**:控制台 `/console/redemption` 与 `/console/channel` 的表头。
|
||||||
|
- **变更**:沿用渠道列表的表格与行内操作样式,提升两页表头文字对比度,固定兑换码操作列,新增同页详情弹窗,统一添加侧栏窗与编辑弹窗的表单及页脚。
|
||||||
|
- **影响**:可在详情弹窗查看与复制原码,批量复制随选中态启用,清除失效操作保留二次确认。
|
||||||
|
- **回滚**:还原兑换码列表、表单、详情弹窗和对应样式与文案。
|
||||||
|
- **关联**:`src/components/table/redemptions/`、`docs/ui/CONSOLE_SPEC.md`。
|
||||||
|
|
||||||
### 修复 · 控制台数据看板持续加载
|
### 修复 · 控制台数据看板持续加载
|
||||||
|
|
||||||
- **范围**:控制台 `/console/analytics` 运营看板、创作作品详情抽屉及公共 API 的只读请求。
|
- **范围**:控制台 `/console/analytics` 运营看板、创作作品详情抽屉及公共 API 的只读请求。
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# 控制台 UI 规范(/console/\*)
|
# 控制台 UI 规范(/console/\*)
|
||||||
|
|
||||||
> 状态:有效 · 适用:antd 6.7.0 · 更新:2026-11-18 · 版本:v2.4
|
> 状态:有效 · 适用:antd 6.7.0 · 更新:2026-11-25 · 版本:v2.7
|
||||||
|
|
||||||
管理控制台 `/console/*` 的规范:统一页头、控制台原语与差异样式。
|
管理控制台 `/console/*` 的规范:统一页头、控制台原语与差异样式。
|
||||||
|
|
||||||
@@ -58,6 +58,8 @@
|
|||||||
- 提示栏:控制台内的 `Banner` / `Alert` 统一走 `ConsoleAlert`,内边距 12px 16px、正文 14 / 22px、图标 16px,颜色取对应语义 token。
|
- 提示栏:控制台内的 `Banner` / `Alert` 统一走 `ConsoleAlert`,内边距 12px 16px、正文 14 / 22px、图标 16px,颜色取对应语义 token。
|
||||||
- 系统设置(`page.key === 'setting'`):表单统一纵向布局、8px 标签间距、24px 栅格、控件等宽,校验信息预留高度;弹窗页脚按钮高 34px、间距 8px、右对齐。规则限定在 `.settings-page` / `.settings-form-dialog`。
|
- 系统设置(`page.key === 'setting'`):表单统一纵向布局、8px 标签间距、24px 栅格、控件等宽,校验信息预留高度;弹窗页脚按钮高 34px、间距 8px、右对齐。规则限定在 `.settings-page` / `.settings-form-dialog`。
|
||||||
- 控制台上下文中 `CompactModeToggle` 不渲染,表格密度状态保留;其他模块仍可使用紧凑模式。
|
- 控制台上下文中 `CompactModeToggle` 不渲染,表格密度状态保留;其他模块仍可使用紧凑模式。
|
||||||
|
- 兑换码列表沿用渠道列表的行内链接按钮、右侧固定操作列和底部分页。「查看、复制、编辑、禁用/启用、删除」在同一行直接显示,保留既有权限和状态限制,删除仍需确认。窄屏横向滚动时操作列不换行。批量复制在选中兑换码后可用,清除失效兑换码由独立的危险操作确认承载。
|
||||||
|
- 添加兑换码与编辑兑换码信息共用右侧侧栏窗、表单样式及页脚。查看详情使用弹窗,优先展示兑换码和状态,再列出额度、时间与兑换人信息。
|
||||||
- 平台 Skill 中心的分类标签区域与搜索工具栏同宽、左对齐,不保留独立的最大宽度和自动居中;窄屏按原间距自然换行。
|
- 平台 Skill 中心的分类标签区域与搜索工具栏同宽、左对齐,不保留独立的最大宽度和自动居中;窄屏按原间距自然换行。
|
||||||
- 平台 Skill 详情的审核工作台仅由抽屉正文纵向滚动,技能原文不设置独立滚动区;审核操作进入抽屉固定页脚,按钮右对齐、间距 8px,仅在审核页签展示。
|
- 平台 Skill 详情的审核工作台仅由抽屉正文纵向滚动,技能原文不设置独立滚动区;审核操作进入抽屉固定页脚,按钮右对齐、间距 8px,仅在审核页签展示。
|
||||||
- 官网文章抽屉允许点击遮罩关闭,X、取消、遮罩共用同一未保存内容确认流程。
|
- 官网文章抽屉允许点击遮罩关闭,X、取消、遮罩共用同一未保存内容确认流程。
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# 用户中心 UI 规范(/user-center/\*)
|
# 用户中心 UI 规范(/user-center/\*)
|
||||||
|
|
||||||
> 状态:有效 · 适用:antd 6.7.0 · 更新:2026-11-18 · 版本:v2.4
|
> 状态:有效 · 适用:antd 6.7.0 · 更新:2026-11-25 · 版本:v2.5
|
||||||
|
|
||||||
个人登录后用户中心页面的规范,只记录与公共规范不同的部分;密钥管理、服务监控见各自规范。
|
个人登录后用户中心页面的规范,只记录与公共规范不同的部分;密钥管理、服务监控见各自规范。
|
||||||
|
|
||||||
@@ -78,7 +78,7 @@
|
|||||||
- 页签:纯文字页签(公共列表页签样式),与下方 20px,URL `?tab=` 同步并懒挂载。
|
- 页签:纯文字页签(公共列表页签样式),与下方 20px,URL `?tab=` 同步并懒挂载。
|
||||||
- 筛选卡:5 列栅格,时间范围跨 2 列;背景使用 `--surface-card` 纯色(浅色为白色、深色为主题卡片色);操作“重置 / 搜索”右下。
|
- 筛选卡:5 列栅格,时间范围跨 2 列;背景使用 `--surface-card` 纯色(浅色为白色、深色为主题卡片色);操作“重置 / 搜索”右下。
|
||||||
- 列表卡:标题 15px / 600,导出、列设置位于卡头右侧;表头字重 400(公共标准为 500,待收敛)。
|
- 列表卡:标题 15px / 600,导出、列设置位于卡头右侧;表头字重 400(公共标准为 500,待收敛)。
|
||||||
- 消费记录调用明细为固定列宽宽表,时间分两行(日期 11px、时间 15px / 600),操作列文字“查看”,固定在右侧;横向滚动条保留 Ant Design 官方固定列表格行为,固定列兼容规则遵循公共规范第 5.2 节。
|
- 消费记录调用明细为固定列宽宽表,横向滚动时“时间”列固定在左侧,“操作”列显示时固定在右侧,中间列可滚动。时间分两行(日期 11px、时间 15px / 600),固定列兼容规则遵循公共规范第 5.2 节。
|
||||||
- 消费记录“用时 / 首字”列宽 190px,总用时、首字耗时与流式状态分别用 antd 默认带描边 `Tag` 展示,保留主题算法生成的浅底 / 文字 / 边框。总用时对 `use_time` 取整数秒,`<101s` 用 `green`、`101–299s` 用 `gold`、`≥300s` 用 `magenta`;首字耗时取 `other.frt / 1000`,先保留一位小数再判色,`<3s` 用 `cyan`、`3–<10s` 用 `orange`、`≥10s` 用 `red`。流式显示三枚标签(状态为蓝色“流”),非流式仅显示总用时与中性“非流”;零值正常展示,缺失、非数值或负耗时显示中性破折号。
|
- 消费记录“用时 / 首字”列宽 190px,总用时、首字耗时与流式状态分别用 antd 默认带描边 `Tag` 展示,保留主题算法生成的浅底 / 文字 / 边框。总用时对 `use_time` 取整数秒,`<101s` 用 `green`、`101–299s` 用 `gold`、`≥300s` 用 `magenta`;首字耗时取 `other.frt / 1000`,先保留一位小数再判色,`<3s` 用 `cyan`、`3–<10s` 用 `orange`、`≥10s` 用 `red`。流式显示三枚标签(状态为蓝色“流”),非流式仅显示总用时与中性“非流”;零值正常展示,缺失、非数值或负耗时显示中性破折号。
|
||||||
- 绘图与视频:三张统计卡(高 70px、间距 15px)+ 任务记录表。
|
- 绘图与视频:三张统计卡(高 70px、间距 15px)+ 任务记录表。
|
||||||
- Webhook 示例为 `<pre class='ui-notify-code'>` +“复制”链接,复制提示沿用原文案。
|
- Webhook 示例为 `<pre class='ui-notify-code'>` +“复制”链接,复制提示沿用原文案。
|
||||||
|
|||||||
@@ -59,6 +59,7 @@
|
|||||||
|
|
||||||
.console-page:is(
|
.console-page:is(
|
||||||
[data-console-page='channel'],
|
[data-console-page='channel'],
|
||||||
|
[data-console-page='redemption'],
|
||||||
[data-console-page='models'],
|
[data-console-page='models'],
|
||||||
[data-console-page='user'],
|
[data-console-page='user'],
|
||||||
[data-console-page='organizations'],
|
[data-console-page='organizations'],
|
||||||
@@ -73,6 +74,17 @@
|
|||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.console-page:is(
|
||||||
|
[data-console-page='channel'],
|
||||||
|
[data-console-page='redemption']
|
||||||
|
)
|
||||||
|
.console-table.ant-table-wrapper
|
||||||
|
.ant-table-thead
|
||||||
|
> tr
|
||||||
|
> th {
|
||||||
|
color: var(--console-text);
|
||||||
|
}
|
||||||
|
|
||||||
.console-model-drawer .ant-drawer-title > .ant-space {
|
.console-model-drawer .ant-drawer-title > .ant-space {
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,17 +1,28 @@
|
|||||||
import React from 'react';
|
import React, { useState } from 'react';
|
||||||
|
import { Button } from 'antd';
|
||||||
import { Copy, Plus, Trash2 } from '@/components/common/icons/ActionIcons';
|
import { Copy, Plus, Trash2 } from '@/components/common/icons/ActionIcons';
|
||||||
import { Button } from '@/components/ui';
|
|
||||||
import { isAdmin } from '../../../helpers';
|
import { isAdmin } from '../../../helpers';
|
||||||
|
|
||||||
const RedemptionsActions = ({
|
const RedemptionsActions = ({
|
||||||
selectedKeys,
|
selectedKeys,
|
||||||
|
busy,
|
||||||
setEditingRedemption,
|
setEditingRedemption,
|
||||||
setShowEdit,
|
setShowEdit,
|
||||||
batchCopyRedemptions,
|
batchCopyRedemptions,
|
||||||
batchDeleteRedemptions,
|
batchDeleteRedemptions,
|
||||||
t,
|
t,
|
||||||
}) => {
|
}) => {
|
||||||
// Add new redemption code
|
const [copying, setCopying] = useState(false);
|
||||||
|
|
||||||
|
const handleCopy = async () => {
|
||||||
|
setCopying(true);
|
||||||
|
try {
|
||||||
|
await batchCopyRedemptions();
|
||||||
|
} finally {
|
||||||
|
setCopying(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const handleAddRedemption = () => {
|
const handleAddRedemption = () => {
|
||||||
setEditingRedemption({
|
setEditingRedemption({
|
||||||
id: undefined,
|
id: undefined,
|
||||||
@@ -21,14 +32,21 @@ const RedemptionsActions = ({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='console-list-tool-actions'>
|
<div className='console-list-tool-actions'>
|
||||||
<Button icon={<Copy size={16} />} onClick={batchCopyRedemptions}>
|
<Button
|
||||||
|
icon={<Copy size={16} aria-hidden />}
|
||||||
|
disabled={busy || selectedKeys.length === 0}
|
||||||
|
loading={copying}
|
||||||
|
onClick={handleCopy}
|
||||||
|
>
|
||||||
{t('复制所选兑换码到剪贴板')}
|
{t('复制所选兑换码到剪贴板')}
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
{isAdmin() && (
|
{isAdmin() && (
|
||||||
<Button
|
<Button
|
||||||
type='danger'
|
danger
|
||||||
icon={<Trash2 size={16} />}
|
className='redemption-invalid-action'
|
||||||
|
disabled={busy}
|
||||||
|
icon={<Trash2 size={16} aria-hidden />}
|
||||||
onClick={batchDeleteRedemptions}
|
onClick={batchDeleteRedemptions}
|
||||||
>
|
>
|
||||||
{t('清除失效兑换码')}
|
{t('清除失效兑换码')}
|
||||||
@@ -37,7 +55,8 @@ const RedemptionsActions = ({
|
|||||||
{isAdmin() && (
|
{isAdmin() && (
|
||||||
<Button
|
<Button
|
||||||
type='primary'
|
type='primary'
|
||||||
icon={<Plus size={16} />}
|
className='console-create-action'
|
||||||
|
icon={<Plus size={16} aria-hidden />}
|
||||||
onClick={handleAddRedemption}
|
onClick={handleAddRedemption}
|
||||||
>
|
>
|
||||||
{t('添加兑换码')}
|
{t('添加兑换码')}
|
||||||
|
|||||||
@@ -1,12 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Tag, Button, Space, Popover, Dropdown } from '@/components/ui';
|
import { Button, Tag, Tooltip } from 'antd';
|
||||||
import { IconMore } from '@/components/ui/icons';
|
import { renderQuota, timestamp2string, isAdmin } from '../../../helpers';
|
||||||
import {
|
|
||||||
renderQuota,
|
|
||||||
timestamp2string,
|
|
||||||
isAdmin,
|
|
||||||
hoverOrClickTrigger,
|
|
||||||
} from '../../../helpers';
|
|
||||||
import {
|
import {
|
||||||
REDEMPTION_STATUS,
|
REDEMPTION_STATUS,
|
||||||
REDEMPTION_STATUS_MAP,
|
REDEMPTION_STATUS_MAP,
|
||||||
@@ -27,36 +21,23 @@ export const isExpired = (record) => {
|
|||||||
/**
|
/**
|
||||||
* Render timestamp
|
* Render timestamp
|
||||||
*/
|
*/
|
||||||
const renderTimestamp = (timestamp) => {
|
export const formatRedemptionExpiry = (timestamp, t) =>
|
||||||
return <>{timestamp2string(timestamp)}</>;
|
timestamp === 0 ? t('永不过期') : timestamp2string(timestamp);
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Render redemption code status
|
* Render redemption code status
|
||||||
*/
|
*/
|
||||||
const renderStatus = (status, record, t) => {
|
export const renderRedemptionStatus = (status, record, t) => {
|
||||||
if (isExpired(record)) {
|
if (isExpired(record)) {
|
||||||
return (
|
return <Tag color='warning'>{t('已过期')}</Tag>;
|
||||||
<Tag color='orange' shape='circle'>
|
|
||||||
{t('已过期')}
|
|
||||||
</Tag>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const statusConfig = REDEMPTION_STATUS_MAP[status];
|
const statusConfig = REDEMPTION_STATUS_MAP[status];
|
||||||
if (statusConfig) {
|
if (statusConfig) {
|
||||||
return (
|
return <Tag color={statusConfig.color}>{t(statusConfig.text)}</Tag>;
|
||||||
<Tag color={statusConfig.color} shape='circle'>
|
|
||||||
{t(statusConfig.text)}
|
|
||||||
</Tag>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return <Tag>{t('未知状态')}</Tag>;
|
||||||
<Tag color='black' shape='circle'>
|
|
||||||
{t('未知状态')}
|
|
||||||
</Tag>
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -68,115 +49,75 @@ export const getRedemptionsColumns = ({
|
|||||||
copyText,
|
copyText,
|
||||||
setEditingRedemption,
|
setEditingRedemption,
|
||||||
setShowEdit,
|
setShowEdit,
|
||||||
refresh,
|
showDetails,
|
||||||
redemptions,
|
|
||||||
activePage,
|
|
||||||
showDeleteRedemptionModal,
|
showDeleteRedemptionModal,
|
||||||
}) => {
|
}) => {
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
title: t('ID'),
|
title: t('ID'),
|
||||||
dataIndex: 'id',
|
dataIndex: 'id',
|
||||||
|
width: 72,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('名称'),
|
title: t('名称'),
|
||||||
dataIndex: 'name',
|
dataIndex: 'name',
|
||||||
|
width: 224,
|
||||||
|
ellipsis: { showTitle: false },
|
||||||
|
render: (name) => (
|
||||||
|
<Tooltip title={name}>
|
||||||
|
<span>{name}</span>
|
||||||
|
</Tooltip>
|
||||||
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('状态'),
|
title: t('状态'),
|
||||||
dataIndex: 'status',
|
dataIndex: 'status',
|
||||||
key: 'status',
|
width: 120,
|
||||||
render: (text, record) => {
|
render: (status, record) => renderRedemptionStatus(status, record, t),
|
||||||
return <div>{renderStatus(text, record, t)}</div>;
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('额度'),
|
title: t('额度'),
|
||||||
dataIndex: 'quota',
|
dataIndex: 'quota',
|
||||||
render: (text) => {
|
width: 128,
|
||||||
return (
|
align: 'right',
|
||||||
<div>
|
render: (quota) => renderQuota(parseInt(quota)),
|
||||||
<Tag color='grey' shape='circle'>
|
|
||||||
{renderQuota(parseInt(text))}
|
|
||||||
</Tag>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('创建时间'),
|
title: t('创建时间'),
|
||||||
dataIndex: 'created_time',
|
dataIndex: 'created_time',
|
||||||
render: (text) => {
|
width: 180,
|
||||||
return <div>{renderTimestamp(text)}</div>;
|
render: (timestamp) => timestamp2string(timestamp),
|
||||||
},
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('过期时间'),
|
title: t('过期时间'),
|
||||||
dataIndex: 'expired_time',
|
dataIndex: 'expired_time',
|
||||||
render: (text) => {
|
width: 180,
|
||||||
return <div>{text === 0 ? t('永不过期') : renderTimestamp(text)}</div>;
|
render: (timestamp) => formatRedemptionExpiry(timestamp, t),
|
||||||
},
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('兑换人ID'),
|
title: t('兑换人ID'),
|
||||||
dataIndex: 'used_user_id',
|
dataIndex: 'used_user_id',
|
||||||
render: (text) => {
|
width: 128,
|
||||||
return <div>{text === 0 ? t('无') : text}</div>;
|
render: (id) => (id === 0 ? t('无') : id),
|
||||||
},
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('操作'),
|
title: t('操作'),
|
||||||
dataIndex: 'operate',
|
dataIndex: 'operate',
|
||||||
fixed: 'right',
|
fixed: 'right',
|
||||||
width: 205,
|
|
||||||
render: (text, record) => {
|
render: (text, record) => {
|
||||||
// Create dropdown menu items for more operations
|
const isUnused = record.status === REDEMPTION_STATUS.UNUSED;
|
||||||
const moreMenuItems = [
|
|
||||||
{
|
|
||||||
node: 'item',
|
|
||||||
name: t('删除'),
|
|
||||||
type: 'danger',
|
|
||||||
onClick: () => {
|
|
||||||
showDeleteRedemptionModal(record);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
if (record.status === REDEMPTION_STATUS.UNUSED && !isExpired(record)) {
|
|
||||||
moreMenuItems.push({
|
|
||||||
node: 'item',
|
|
||||||
name: t('禁用'),
|
|
||||||
type: 'warning',
|
|
||||||
onClick: () => {
|
|
||||||
manageRedemption(record.id, REDEMPTION_ACTIONS.DISABLE, record);
|
|
||||||
},
|
|
||||||
});
|
|
||||||
} else if (!isExpired(record)) {
|
|
||||||
moreMenuItems.push({
|
|
||||||
node: 'item',
|
|
||||||
name: t('启用'),
|
|
||||||
type: 'secondary',
|
|
||||||
onClick: () => {
|
|
||||||
manageRedemption(record.id, REDEMPTION_ACTIONS.ENABLE, record);
|
|
||||||
},
|
|
||||||
disabled: record.status === REDEMPTION_STATUS.USED,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Space>
|
<div className='console-module-row-actions redemption-row-actions'>
|
||||||
<Popover
|
|
||||||
// 触屏必须 click:这是查看兑换码明文的唯一入口
|
|
||||||
trigger={hoverOrClickTrigger()}
|
|
||||||
content={record.key}
|
|
||||||
style={{ padding: 20 }}
|
|
||||||
position='top'
|
|
||||||
>
|
|
||||||
<Button type='tertiary' size='small'>
|
|
||||||
{t('查看')}
|
|
||||||
</Button>
|
|
||||||
</Popover>
|
|
||||||
<Button
|
<Button
|
||||||
|
type='link'
|
||||||
|
size='small'
|
||||||
|
onClick={() => showDetails(record)}
|
||||||
|
>
|
||||||
|
{t('查看')}
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
type='link'
|
||||||
size='small'
|
size='small'
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
await copyText(record.key);
|
await copyText(record.key);
|
||||||
@@ -187,26 +128,45 @@ export const getRedemptionsColumns = ({
|
|||||||
{isAdmin() && (
|
{isAdmin() && (
|
||||||
<>
|
<>
|
||||||
<Button
|
<Button
|
||||||
type='tertiary'
|
type='link'
|
||||||
size='small'
|
size='small'
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setEditingRedemption(record);
|
setEditingRedemption(record);
|
||||||
setShowEdit(true);
|
setShowEdit(true);
|
||||||
}}
|
}}
|
||||||
disabled={record.status !== REDEMPTION_STATUS.UNUSED}
|
disabled={!isUnused}
|
||||||
>
|
>
|
||||||
{t('编辑')}
|
{t('编辑')}
|
||||||
</Button>
|
</Button>
|
||||||
<Dropdown
|
{!isExpired(record) && (
|
||||||
trigger='click'
|
<Button
|
||||||
position='bottomRight'
|
type='link'
|
||||||
menu={moreMenuItems}
|
size='small'
|
||||||
|
disabled={record.status === REDEMPTION_STATUS.USED}
|
||||||
|
onClick={() =>
|
||||||
|
manageRedemption(
|
||||||
|
record.id,
|
||||||
|
isUnused
|
||||||
|
? REDEMPTION_ACTIONS.DISABLE
|
||||||
|
: REDEMPTION_ACTIONS.ENABLE,
|
||||||
|
record,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
>
|
||||||
|
{isUnused ? t('禁用') : t('启用')}
|
||||||
|
</Button>
|
||||||
|
)}
|
||||||
|
<Button
|
||||||
|
type='link'
|
||||||
|
size='small'
|
||||||
|
danger
|
||||||
|
onClick={() => showDeleteRedemptionModal(record)}
|
||||||
>
|
>
|
||||||
<Button type='tertiary' size='small' icon={<IconMore />} />
|
{t('删除')}
|
||||||
</Dropdown>
|
</Button>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</Space>
|
</div>
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,20 +1,19 @@
|
|||||||
import React, { useMemo, useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import TableEmpty from '../../common/table/TableEmpty';
|
import TableEmpty from '../../common/table/TableEmpty';
|
||||||
import CardTable from '../../common/ui/CardTable';
|
import CardTable from '../../common/ui/CardTable';
|
||||||
import { getRedemptionsColumns } from './RedemptionsColumnDefs';
|
import { getRedemptionsColumns } from './RedemptionsColumnDefs';
|
||||||
import DeleteRedemptionModal from './modals/DeleteRedemptionModal';
|
import DeleteRedemptionModal from './modals/DeleteRedemptionModal';
|
||||||
|
import RedemptionDetailsModal from './modals/RedemptionDetailsModal';
|
||||||
|
|
||||||
|
const SELECTION_COLUMN_WIDTH = 34;
|
||||||
|
|
||||||
const RedemptionsTable = (redemptionsData) => {
|
const RedemptionsTable = (redemptionsData) => {
|
||||||
const {
|
const {
|
||||||
redemptions,
|
redemptions,
|
||||||
loading,
|
loading,
|
||||||
|
searching,
|
||||||
activePage,
|
activePage,
|
||||||
pageSize,
|
|
||||||
tokenCount,
|
|
||||||
compactMode,
|
|
||||||
handlePageChange,
|
|
||||||
rowSelection,
|
rowSelection,
|
||||||
handleRow,
|
|
||||||
manageRedemption,
|
manageRedemption,
|
||||||
copyText,
|
copyText,
|
||||||
setEditingRedemption,
|
setEditingRedemption,
|
||||||
@@ -26,6 +25,7 @@ const RedemptionsTable = (redemptionsData) => {
|
|||||||
// Modal states
|
// Modal states
|
||||||
const [showDeleteModal, setShowDeleteModal] = useState(false);
|
const [showDeleteModal, setShowDeleteModal] = useState(false);
|
||||||
const [deletingRecord, setDeletingRecord] = useState(null);
|
const [deletingRecord, setDeletingRecord] = useState(null);
|
||||||
|
const [detailRecord, setDetailRecord] = useState(null);
|
||||||
|
|
||||||
// Handle show delete modal
|
// Handle show delete modal
|
||||||
const showDeleteRedemptionModal = (record) => {
|
const showDeleteRedemptionModal = (record) => {
|
||||||
@@ -40,49 +40,36 @@ const RedemptionsTable = (redemptionsData) => {
|
|||||||
copyText,
|
copyText,
|
||||||
setEditingRedemption,
|
setEditingRedemption,
|
||||||
setShowEdit,
|
setShowEdit,
|
||||||
refresh,
|
showDetails: setDetailRecord,
|
||||||
redemptions,
|
|
||||||
activePage,
|
|
||||||
showDeleteRedemptionModal,
|
showDeleteRedemptionModal,
|
||||||
});
|
});
|
||||||
|
|
||||||
// Handle compact mode by removing fixed positioning
|
|
||||||
const tableColumns = useMemo(() => {
|
|
||||||
return compactMode
|
|
||||||
? columns.map((col) => {
|
|
||||||
if (col.dataIndex === 'operate') {
|
|
||||||
const { fixed, ...rest } = col;
|
|
||||||
return rest;
|
|
||||||
}
|
|
||||||
return col;
|
|
||||||
})
|
|
||||||
: columns;
|
|
||||||
}, [compactMode, columns]);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<CardTable
|
<CardTable
|
||||||
columns={tableColumns}
|
columns={columns}
|
||||||
|
minScrollableWidth={SELECTION_COLUMN_WIDTH * 2}
|
||||||
dataSource={redemptions}
|
dataSource={redemptions}
|
||||||
scroll={compactMode ? undefined : { x: 'max-content' }}
|
scroll={{ x: 'max-content' }}
|
||||||
pagination={{
|
|
||||||
currentPage: activePage,
|
|
||||||
pageSize: pageSize,
|
|
||||||
total: tokenCount,
|
|
||||||
showSizeChanger: true,
|
|
||||||
pageSizeOptions: [10, 20, 50, 100],
|
|
||||||
onPageSizeChange: redemptionsData.handlePageSizeChange,
|
|
||||||
onPageChange: handlePageChange,
|
|
||||||
}}
|
|
||||||
hidePagination={true}
|
hidePagination={true}
|
||||||
loading={loading}
|
loading={loading || searching}
|
||||||
rowSelection={rowSelection}
|
rowSelection={{
|
||||||
onRow={handleRow}
|
...rowSelection,
|
||||||
|
fixed: true,
|
||||||
|
columnWidth: SELECTION_COLUMN_WIDTH,
|
||||||
|
}}
|
||||||
empty={<TableEmpty />}
|
empty={<TableEmpty />}
|
||||||
className='console-list-table overflow-hidden'
|
className='rounded-xl overflow-hidden'
|
||||||
size='middle'
|
size='middle'
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<RedemptionDetailsModal
|
||||||
|
record={detailRecord}
|
||||||
|
onClose={() => setDetailRecord(null)}
|
||||||
|
copyText={copyText}
|
||||||
|
t={t}
|
||||||
|
/>
|
||||||
|
|
||||||
<DeleteRedemptionModal
|
<DeleteRedemptionModal
|
||||||
visible={showDeleteModal}
|
visible={showDeleteModal}
|
||||||
onCancel={() => setShowDeleteModal(false)}
|
onCancel={() => setShowDeleteModal(false)}
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ import EditRedemptionModal from './modals/EditRedemptionModal';
|
|||||||
import { useRedemptionsData } from '../../../hooks/redemptions/useRedemptionsData';
|
import { useRedemptionsData } from '../../../hooks/redemptions/useRedemptionsData';
|
||||||
import { useIsMobile } from '../../../hooks/common/useIsMobile';
|
import { useIsMobile } from '../../../hooks/common/useIsMobile';
|
||||||
import { createCardProPagination } from '../../../helpers/utils';
|
import { createCardProPagination } from '../../../helpers/utils';
|
||||||
|
import '../../console/module-alignment.css';
|
||||||
|
import './redemptions.css';
|
||||||
|
|
||||||
const RedemptionsPage = () => {
|
const RedemptionsPage = () => {
|
||||||
const redemptionsData = useRedemptionsData();
|
const redemptionsData = useRedemptionsData();
|
||||||
@@ -47,11 +49,12 @@ const RedemptionsPage = () => {
|
|||||||
<EditRedemptionModal
|
<EditRedemptionModal
|
||||||
refresh={refresh}
|
refresh={refresh}
|
||||||
editingRedemption={editingRedemption}
|
editingRedemption={editingRedemption}
|
||||||
visiable={showEdit}
|
visible={showEdit}
|
||||||
handleClose={closeEdit}
|
handleClose={closeEdit}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<CardPro
|
<CardPro
|
||||||
|
tableTitle={t('兑换码列表')}
|
||||||
searchArea={
|
searchArea={
|
||||||
<RedemptionsFilters
|
<RedemptionsFilters
|
||||||
formInitValues={formInitValues}
|
formInitValues={formInitValues}
|
||||||
@@ -65,25 +68,27 @@ const RedemptionsPage = () => {
|
|||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
type='type1'
|
type='type1'
|
||||||
actionsArea={
|
descriptionArea={
|
||||||
<div className='console-list-tools'>
|
<RedemptionsDescription
|
||||||
<RedemptionsDescription
|
compactMode={compactMode}
|
||||||
compactMode={compactMode}
|
setCompactMode={setCompactMode}
|
||||||
setCompactMode={setCompactMode}
|
t={t}
|
||||||
t={t}
|
/>
|
||||||
/>
|
}
|
||||||
<RedemptionsActions
|
tableActions={
|
||||||
selectedKeys={selectedKeys}
|
<RedemptionsActions
|
||||||
setEditingRedemption={setEditingRedemption}
|
selectedKeys={selectedKeys}
|
||||||
setShowEdit={setShowEdit}
|
busy={loading || searching}
|
||||||
batchCopyRedemptions={batchCopyRedemptions}
|
setEditingRedemption={setEditingRedemption}
|
||||||
batchDeleteRedemptions={batchDeleteRedemptions}
|
setShowEdit={setShowEdit}
|
||||||
t={t}
|
batchCopyRedemptions={batchCopyRedemptions}
|
||||||
/>
|
batchDeleteRedemptions={batchDeleteRedemptions}
|
||||||
</div>
|
t={t}
|
||||||
|
/>
|
||||||
}
|
}
|
||||||
paginationArea={createCardProPagination({
|
paginationArea={createCardProPagination({
|
||||||
preservePage: true,
|
preservePage: true,
|
||||||
|
showRange: false,
|
||||||
currentPage: redemptionsData.activePage,
|
currentPage: redemptionsData.activePage,
|
||||||
pageSize: redemptionsData.pageSize,
|
pageSize: redemptionsData.pageSize,
|
||||||
total: redemptionsData.tokenCount,
|
total: redemptionsData.tokenCount,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { useEffectEvent } from '../../../../hooks/common/useEffectEvent';
|
import React, { useEffect, useId, useRef, useState } from 'react';
|
||||||
import React, { useEffect, useState, useRef } from 'react';
|
import { Button, Card, Col, Row, Spin } from 'antd';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import {
|
import {
|
||||||
API,
|
API,
|
||||||
@@ -7,324 +7,238 @@ import {
|
|||||||
showError,
|
showError,
|
||||||
showSuccess,
|
showSuccess,
|
||||||
renderQuota,
|
renderQuota,
|
||||||
} from '../../../../helpers';
|
} from '@/helpers';
|
||||||
import { FormQuotaInput } from '../../../common/ui/QuotaInput';
|
import { FormQuotaInput } from '../../../common/ui/QuotaInput';
|
||||||
import { useIsMobile } from '../../../../hooks/common/useIsMobile';
|
import { useIsMobile } from '../../../../hooks/common/useIsMobile';
|
||||||
import {
|
import { Form, Modal, SideSheet } from '@/components/ui';
|
||||||
Button,
|
|
||||||
Modal,
|
|
||||||
SideSheet,
|
|
||||||
Space,
|
|
||||||
Spin,
|
|
||||||
Typography,
|
|
||||||
Card,
|
|
||||||
Tag,
|
|
||||||
Form,
|
|
||||||
Avatar,
|
|
||||||
Row,
|
|
||||||
Col,
|
|
||||||
} from '@/components/ui';
|
|
||||||
import {
|
|
||||||
IconCreditCard,
|
|
||||||
IconSave,
|
|
||||||
IconClose,
|
|
||||||
IconGift,
|
|
||||||
} from '@/components/ui/icons';
|
|
||||||
|
|
||||||
const { Text, Title } = Typography;
|
const initialValues = {
|
||||||
|
name: '',
|
||||||
|
quota: 100000,
|
||||||
|
count: 1,
|
||||||
|
expired_time: null,
|
||||||
|
is_gift: false,
|
||||||
|
};
|
||||||
|
|
||||||
const EditRedemptionModal = (props) => {
|
const EditRedemptionModal = ({
|
||||||
|
editingRedemption,
|
||||||
|
visible,
|
||||||
|
refresh,
|
||||||
|
handleClose,
|
||||||
|
}) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const isEdit = props.editingRedemption.id !== undefined;
|
const { id } = editingRedemption;
|
||||||
const [loading, setLoading] = useState(isEdit);
|
const isEdit = id !== undefined;
|
||||||
const isMobile = useIsMobile();
|
const isMobile = useIsMobile();
|
||||||
const formApiRef = useRef(null);
|
const formApi = useRef(null);
|
||||||
|
const formId = useId();
|
||||||
|
const [loading, setLoading] = useState(false);
|
||||||
|
const [loadedId, setLoadedId] = useState(null);
|
||||||
|
const [submitting, setSubmitting] = useState(false);
|
||||||
|
const pending = useRef(false);
|
||||||
|
const formDisabled = loading || submitting || (isEdit && loadedId !== id);
|
||||||
|
|
||||||
const getInitValues = () => ({
|
useEffect(() => {
|
||||||
name: '',
|
if (!visible) return;
|
||||||
quota: 100000,
|
|
||||||
count: 1,
|
|
||||||
expired_time: null,
|
|
||||||
is_gift: false,
|
|
||||||
});
|
|
||||||
|
|
||||||
const handleCancel = () => {
|
formApi.current?.reset();
|
||||||
props.handleClose();
|
setLoadedId(null);
|
||||||
};
|
setLoading(isEdit);
|
||||||
|
if (!isEdit) return;
|
||||||
|
|
||||||
const loadRedemption = async () => {
|
let active = true;
|
||||||
setLoading(true);
|
async function loadRedemption() {
|
||||||
let res = await API.get(`/api/redemption/${props.editingRedemption.id}`);
|
try {
|
||||||
const { success, message, data } = res.data;
|
const { data: result } = await API.get(`/api/redemption/${id}`);
|
||||||
if (success) {
|
if (!active) return;
|
||||||
if (data.expired_time === 0) {
|
if (result.success) {
|
||||||
data.expired_time = null;
|
const { expired_time, ...data } = result.data;
|
||||||
} else {
|
formApi.current?.setValues({
|
||||||
data.expired_time = new Date(data.expired_time * 1000);
|
...initialValues,
|
||||||
}
|
...data,
|
||||||
formApiRef.current?.setValues({ ...getInitValues(), ...data });
|
expired_time:
|
||||||
} else {
|
expired_time === 0 ? null : new Date(expired_time * 1000),
|
||||||
showError(message);
|
});
|
||||||
}
|
setLoadedId(id);
|
||||||
setLoading(false);
|
} else {
|
||||||
};
|
showError(result.message);
|
||||||
|
}
|
||||||
const onScopeChange = useEffectEvent(() => {
|
} catch (error) {
|
||||||
if (formApiRef.current) {
|
if (active && !error.isAxiosError) showError(error.message);
|
||||||
if (isEdit) {
|
} finally {
|
||||||
loadRedemption();
|
if (active) setLoading(false);
|
||||||
} else {
|
|
||||||
formApiRef.current.setValues(getInitValues());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
void loadRedemption();
|
||||||
useEffect(() => onScopeChange(), [onScopeChange, props.editingRedemption.id]);
|
return () => {
|
||||||
|
active = false;
|
||||||
|
};
|
||||||
|
}, [id, isEdit, visible]);
|
||||||
|
|
||||||
const submit = async (values) => {
|
const submit = async (values) => {
|
||||||
let name = values.name;
|
if (formDisabled || pending.current) return;
|
||||||
if (!isEdit && (!name || name === '')) {
|
pending.current = true;
|
||||||
name = renderQuota(values.quota);
|
setSubmitting(true);
|
||||||
}
|
try {
|
||||||
setLoading(true);
|
const payload = {
|
||||||
let localInputs = { ...values };
|
...values,
|
||||||
localInputs.count = parseInt(localInputs.count) || 0;
|
name: !isEdit && !values.name ? renderQuota(values.quota) : values.name,
|
||||||
localInputs.quota = parseInt(localInputs.quota) || 0;
|
count: parseInt(values.count) || 0,
|
||||||
localInputs.name = name;
|
quota: parseInt(values.quota) || 0,
|
||||||
if (!localInputs.expired_time) {
|
expired_time: values.expired_time
|
||||||
localInputs.expired_time = 0;
|
? Math.floor(values.expired_time.getTime() / 1000)
|
||||||
} else {
|
: 0,
|
||||||
localInputs.expired_time = Math.floor(
|
};
|
||||||
localInputs.expired_time.getTime() / 1000,
|
const res = isEdit
|
||||||
);
|
? await API.put('/api/redemption/', { ...payload, id: parseInt(id) })
|
||||||
}
|
: await API.post('/api/redemption/', payload);
|
||||||
let res;
|
const { success, message, data } = res.data;
|
||||||
if (isEdit) {
|
|
||||||
res = await API.put(`/api/redemption/`, {
|
if (success) {
|
||||||
...localInputs,
|
showSuccess(isEdit ? t('兑换码更新成功!') : t('兑换码创建成功!'));
|
||||||
id: parseInt(props.editingRedemption.id),
|
refresh();
|
||||||
});
|
handleClose();
|
||||||
} else {
|
|
||||||
res = await API.post(`/api/redemption/`, {
|
|
||||||
...localInputs,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
const { success, message, data } = res.data;
|
|
||||||
if (success) {
|
|
||||||
if (isEdit) {
|
|
||||||
showSuccess(t('兑换码更新成功!'));
|
|
||||||
props.refresh();
|
|
||||||
props.handleClose();
|
|
||||||
} else {
|
} else {
|
||||||
showSuccess(t('兑换码创建成功!'));
|
showError(message);
|
||||||
props.refresh();
|
|
||||||
formApiRef.current?.setValues(getInitValues());
|
|
||||||
props.handleClose();
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
showError(message);
|
if (!isEdit && data) {
|
||||||
}
|
let text = '';
|
||||||
if (!isEdit && data) {
|
for (let index = 0; index < data.length; index++) {
|
||||||
let text = '';
|
text += data[index] + '\n';
|
||||||
for (let i = 0; i < data.length; i++) {
|
}
|
||||||
text += data[i] + '\n';
|
Modal.confirm({
|
||||||
|
title: t('兑换码创建成功'),
|
||||||
|
content: (
|
||||||
|
<div>
|
||||||
|
<p>{t('兑换码创建成功,是否下载兑换码?')}</p>
|
||||||
|
<p>{t('兑换码将以文本文件的形式下载,文件名为兑换码的名称。')}</p>
|
||||||
|
</div>
|
||||||
|
),
|
||||||
|
onOk: () => downloadTextAsFile(text, `${payload.name}.txt`),
|
||||||
|
});
|
||||||
}
|
}
|
||||||
Modal.confirm({
|
} catch (error) {
|
||||||
title: t('兑换码创建成功'),
|
if (!error.isAxiosError) showError(error.message);
|
||||||
content: (
|
} finally {
|
||||||
<div>
|
pending.current = false;
|
||||||
<p>{t('兑换码创建成功,是否下载兑换码?')}</p>
|
setSubmitting(false);
|
||||||
<p>{t('兑换码将以文本文件的形式下载,文件名为兑换码的名称。')}</p>
|
|
||||||
</div>
|
|
||||||
),
|
|
||||||
onOk: () => {
|
|
||||||
downloadTextAsFile(text, `${localInputs.name}.txt`);
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
setLoading(false);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
const handleCancel = () => {
|
||||||
<>
|
if (!pending.current) handleClose();
|
||||||
<SideSheet
|
};
|
||||||
placement={isEdit ? 'right' : 'left'}
|
const footer = (
|
||||||
title={
|
<div className='console-dialog-actions redemption-form-actions'>
|
||||||
<Space>
|
<Button disabled={submitting} onClick={handleCancel}>
|
||||||
{isEdit ? (
|
{t('取消')}
|
||||||
<Tag color='blue' shape='circle'>
|
</Button>
|
||||||
{t('更新')}
|
<Button
|
||||||
</Tag>
|
type='primary'
|
||||||
) : (
|
htmlType='submit'
|
||||||
<Tag color='green' shape='circle'>
|
form={formId}
|
||||||
{t('新建')}
|
disabled={formDisabled}
|
||||||
</Tag>
|
loading={submitting}
|
||||||
)}
|
|
||||||
<Title heading={4} className='m-0'>
|
|
||||||
{isEdit ? t('更新兑换码信息') : t('创建新的兑换码')}
|
|
||||||
</Title>
|
|
||||||
</Space>
|
|
||||||
}
|
|
||||||
bodyStyle={{ padding: '0' }}
|
|
||||||
visible={props.visiable}
|
|
||||||
width={isMobile ? '100%' : 600}
|
|
||||||
footer={
|
|
||||||
<div className='flex justify-end'>
|
|
||||||
<Space>
|
|
||||||
<Button
|
|
||||||
theme='solid'
|
|
||||||
onClick={() => formApiRef.current?.submitForm()}
|
|
||||||
icon={<IconSave />}
|
|
||||||
loading={loading}
|
|
||||||
>
|
|
||||||
{t('提交')}
|
|
||||||
</Button>
|
|
||||||
<Button
|
|
||||||
theme='light'
|
|
||||||
type='primary'
|
|
||||||
onClick={handleCancel}
|
|
||||||
icon={<IconClose />}
|
|
||||||
>
|
|
||||||
{t('取消')}
|
|
||||||
</Button>
|
|
||||||
</Space>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
closeIcon={null}
|
|
||||||
onCancel={() => handleCancel()}
|
|
||||||
>
|
>
|
||||||
<Spin spinning={loading}>
|
{t('提交')}
|
||||||
<Form
|
</Button>
|
||||||
initValues={getInitValues()}
|
</div>
|
||||||
getFormApi={(api) => (formApiRef.current = api)}
|
);
|
||||||
onSubmit={submit}
|
const form = (
|
||||||
>
|
<Spin spinning={loading}>
|
||||||
{({ values }) => (
|
<Form
|
||||||
<div className='p-2'>
|
id={formId}
|
||||||
<Card className='!rounded-2xl shadow-sm border-0 mb-6'>
|
name={formId}
|
||||||
{/* Header: Basic Info */}
|
ref={formApi}
|
||||||
<div className='flex items-center mb-2'>
|
className='redemption-form'
|
||||||
<Avatar
|
initValues={initialValues}
|
||||||
size='small'
|
disabled={formDisabled}
|
||||||
color='blue'
|
onSubmit={submit}
|
||||||
className='mr-2 shadow-md'
|
onSubmitFail={() => formApi.current?.scrollToError()}
|
||||||
>
|
>
|
||||||
<IconGift size={16} />
|
<Card size='small' title={t('基本信息')}>
|
||||||
</Avatar>
|
<Form.Input
|
||||||
<div>
|
field='name'
|
||||||
<Text className='text-lg font-medium'>
|
label={t('名称')}
|
||||||
{t('基本信息')}
|
placeholder={t('请输入名称')}
|
||||||
</Text>
|
rules={isEdit ? [{ required: true, message: t('请输入名称') }] : []}
|
||||||
<div className='text-xs text-gray-600'>
|
className={isEdit ? 'redemption-validated-field' : undefined}
|
||||||
{t('设置兑换码的基本信息')}
|
showClear
|
||||||
</div>
|
/>
|
||||||
</div>
|
<Form.DatePicker
|
||||||
</div>
|
field='expired_time'
|
||||||
|
label={t('过期时间')}
|
||||||
<Row gutter={12}>
|
type='dateTime'
|
||||||
<Col span={24}>
|
placeholder={t('选择过期时间(可选,留空为永久)')}
|
||||||
<Form.Input
|
showClear
|
||||||
field='name'
|
/>
|
||||||
label={t('名称')}
|
</Card>
|
||||||
placeholder={t('请输入名称')}
|
<Card size='small' title={t('额度设置')}>
|
||||||
style={{ width: '100%' }}
|
<Row gutter={16}>
|
||||||
rules={
|
<Col xs={24} sm={isEdit ? 24 : 12}>
|
||||||
!isEdit
|
<FormQuotaInput
|
||||||
? []
|
field='quota'
|
||||||
: [{ required: true, message: t('请输入名称') }]
|
label={t('额度')}
|
||||||
}
|
className='redemption-validated-field'
|
||||||
showClear
|
rules={[
|
||||||
/>
|
{ required: true, message: t('请输入额度') },
|
||||||
</Col>
|
{
|
||||||
<Col span={24}>
|
validator: (rule, value) =>
|
||||||
<Form.DatePicker
|
parseInt(value, 10) > 0
|
||||||
field='expired_time'
|
? Promise.resolve()
|
||||||
label={t('过期时间')}
|
: Promise.reject(t('额度必须大于0')),
|
||||||
type='dateTime'
|
},
|
||||||
placeholder={t('选择过期时间(可选,留空为永久)')}
|
]}
|
||||||
style={{ width: '100%' }}
|
showClear
|
||||||
showClear
|
/>
|
||||||
/>
|
</Col>
|
||||||
</Col>
|
{!isEdit && (
|
||||||
</Row>
|
<Col xs={24} sm={12}>
|
||||||
</Card>
|
<Form.InputNumber
|
||||||
|
field='count'
|
||||||
<Card className='!rounded-2xl shadow-sm border-0'>
|
label={t('生成数量')}
|
||||||
{/* Header: Quota Settings */}
|
className='redemption-validated-field'
|
||||||
<div className='flex items-center mb-2'>
|
min={1}
|
||||||
<Avatar
|
rules={[
|
||||||
size='small'
|
{ required: true, message: t('请输入生成数量') },
|
||||||
color='green'
|
{
|
||||||
className='mr-2 shadow-md'
|
validator: (rule, value) =>
|
||||||
>
|
parseInt(value, 10) > 0
|
||||||
<IconCreditCard size={16} />
|
? Promise.resolve()
|
||||||
</Avatar>
|
: Promise.reject(t('生成数量必须大于0')),
|
||||||
<div>
|
},
|
||||||
<Text className='text-lg font-medium'>
|
]}
|
||||||
{t('额度设置')}
|
showClear
|
||||||
</Text>
|
/>
|
||||||
<div className='text-xs text-gray-600'>
|
</Col>
|
||||||
{t('设置兑换码的额度和数量')}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<Row gutter={12}>
|
|
||||||
<Col span={12}>
|
|
||||||
<FormQuotaInput
|
|
||||||
field='quota'
|
|
||||||
label={t('额度')}
|
|
||||||
style={{ width: '100%' }}
|
|
||||||
rules={[
|
|
||||||
{ required: true, message: t('请输入额度') },
|
|
||||||
{
|
|
||||||
validator: (rule, v) => {
|
|
||||||
const num = parseInt(v, 10);
|
|
||||||
return num > 0
|
|
||||||
? Promise.resolve()
|
|
||||||
: Promise.reject(t('额度必须大于0'));
|
|
||||||
},
|
|
||||||
},
|
|
||||||
]}
|
|
||||||
showClear
|
|
||||||
/>
|
|
||||||
</Col>
|
|
||||||
{!isEdit && (
|
|
||||||
<Col span={12}>
|
|
||||||
<Form.InputNumber
|
|
||||||
field='count'
|
|
||||||
label={t('生成数量')}
|
|
||||||
min={1}
|
|
||||||
rules={[
|
|
||||||
{ required: true, message: t('请输入生成数量') },
|
|
||||||
{
|
|
||||||
validator: (rule, v) => {
|
|
||||||
const num = parseInt(v, 10);
|
|
||||||
return num > 0
|
|
||||||
? Promise.resolve()
|
|
||||||
: Promise.reject(t('生成数量必须大于0'));
|
|
||||||
},
|
|
||||||
},
|
|
||||||
]}
|
|
||||||
style={{ width: '100%' }}
|
|
||||||
showClear
|
|
||||||
/>
|
|
||||||
</Col>
|
|
||||||
)}
|
|
||||||
</Row>
|
|
||||||
<Form.Switch
|
|
||||||
field='is_gift'
|
|
||||||
label={t('赠送码')}
|
|
||||||
extraText={t(
|
|
||||||
'开启后兑换额度进入用户赠送钱包(运营赠送性质,计入分佣净消耗剔除);关闭则视为充值性质卡密,进入主余额',
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
</Card>
|
|
||||||
</div>
|
|
||||||
)}
|
)}
|
||||||
</Form>
|
</Row>
|
||||||
</Spin>
|
<Form.Switch
|
||||||
</SideSheet>
|
field='is_gift'
|
||||||
</>
|
label={t('赠送码')}
|
||||||
|
extraText={t(
|
||||||
|
'开启后兑换额度进入用户赠送钱包(运营赠送性质,计入分佣净消耗剔除);关闭则视为充值性质卡密,进入主余额',
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
</Card>
|
||||||
|
</Form>
|
||||||
|
</Spin>
|
||||||
|
);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<SideSheet
|
||||||
|
placement='right'
|
||||||
|
forceRender
|
||||||
|
visible={visible}
|
||||||
|
width={isMobile ? '100%' : 560}
|
||||||
|
title={isEdit ? t('编辑兑换码信息') : t('添加兑换码')}
|
||||||
|
footer={footer}
|
||||||
|
onCancel={handleCancel}
|
||||||
|
closable={!submitting}
|
||||||
|
>
|
||||||
|
{form}
|
||||||
|
</SideSheet>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,67 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import { Button } from 'antd';
|
||||||
|
import { Copy } from '@/components/common/icons/ActionIcons';
|
||||||
|
import { Modal } from '@/components/ui';
|
||||||
|
import { renderQuota, timestamp2string } from '@/helpers';
|
||||||
|
import {
|
||||||
|
formatRedemptionExpiry,
|
||||||
|
renderRedemptionStatus,
|
||||||
|
} from '../RedemptionsColumnDefs';
|
||||||
|
|
||||||
|
export default function RedemptionDetailsModal({
|
||||||
|
record,
|
||||||
|
onClose,
|
||||||
|
copyText,
|
||||||
|
t,
|
||||||
|
}) {
|
||||||
|
const fields = record
|
||||||
|
? [
|
||||||
|
[t('ID'), record.id],
|
||||||
|
[t('额度'), renderQuota(parseInt(record.quota))],
|
||||||
|
[t('创建时间'), timestamp2string(record.created_time)],
|
||||||
|
[t('过期时间'), formatRedemptionExpiry(record.expired_time, t)],
|
||||||
|
[t('兑换人ID'), record.used_user_id || t('无')],
|
||||||
|
]
|
||||||
|
: [];
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Modal
|
||||||
|
centered
|
||||||
|
visible={Boolean(record)}
|
||||||
|
title={t('查看详情')}
|
||||||
|
onCancel={onClose}
|
||||||
|
footer={<Button onClick={onClose}>{t('关闭')}</Button>}
|
||||||
|
destroyOnHidden
|
||||||
|
>
|
||||||
|
{record && (
|
||||||
|
<div className='redemption-details'>
|
||||||
|
<div className='redemption-details-heading'>
|
||||||
|
<h3>{record.name}</h3>
|
||||||
|
{renderRedemptionStatus(record.status, record, t)}
|
||||||
|
</div>
|
||||||
|
<div className='redemption-code'>
|
||||||
|
<div className='redemption-code-header'>
|
||||||
|
<span>{t('兑换码')}</span>
|
||||||
|
<Button
|
||||||
|
icon={<Copy size={16} aria-hidden />}
|
||||||
|
size='small'
|
||||||
|
onClick={() => copyText(record.key)}
|
||||||
|
>
|
||||||
|
{t('复制')}
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
<code>{record.key}</code>
|
||||||
|
</div>
|
||||||
|
<dl className='redemption-details-fields'>
|
||||||
|
{fields.map(([label, value]) => (
|
||||||
|
<div key={label}>
|
||||||
|
<dt>{label}</dt>
|
||||||
|
<dd>{value}</dd>
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
</dl>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</Modal>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,148 @@
|
|||||||
|
.console-page[data-console-page='redemption']
|
||||||
|
.console-table
|
||||||
|
.ant-table-tbody
|
||||||
|
> .ant-table-row
|
||||||
|
> .ant-table-cell {
|
||||||
|
height: 51px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.redemption-form {
|
||||||
|
display: grid;
|
||||||
|
gap: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.redemption-form .ant-card-small > .ant-card-head,
|
||||||
|
.redemption-form .ant-card-small > .ant-card-body {
|
||||||
|
padding-inline: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.redemption-form .ant-card-small > .ant-card-body {
|
||||||
|
padding-block: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.redemption-form.console-form .ant-form-item {
|
||||||
|
margin-bottom: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.redemption-form.console-form .ant-card-body > .ant-form-item:last-child {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.redemption-form.console-form .ant-form-item-label > label {
|
||||||
|
color: var(--console-text, var(--ui-color-text-0));
|
||||||
|
}
|
||||||
|
|
||||||
|
.redemption-form,
|
||||||
|
.redemption-invalid-action {
|
||||||
|
--redemption-error-text: color-mix(
|
||||||
|
in srgb,
|
||||||
|
var(--ui-color-danger) 65%,
|
||||||
|
var(--console-text, var(--ui-color-text-0))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
.redemption-form .ant-form-item .ant-form-item-explain-error,
|
||||||
|
.redemption-form .ant-form-item-label > .ant-form-item-required::before,
|
||||||
|
.console-page .redemption-invalid-action.ant-btn-dangerous:not(:disabled) {
|
||||||
|
color: var(--redemption-error-text);
|
||||||
|
}
|
||||||
|
|
||||||
|
.redemption-form :is(.ant-input-number, .ant-picker) {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.redemption-validated-field .ant-form-item-control {
|
||||||
|
min-block-size: 56px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.redemption-form-actions .ant-btn {
|
||||||
|
min-inline-size: 72px;
|
||||||
|
min-block-size: 34px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.redemption-details {
|
||||||
|
display: grid;
|
||||||
|
gap: 16px;
|
||||||
|
padding-block: 8px;
|
||||||
|
color: var(--console-text, var(--ui-color-text-0));
|
||||||
|
}
|
||||||
|
|
||||||
|
.redemption-details-heading,
|
||||||
|
.redemption-code-header {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px 16px;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.redemption-details-heading h3 {
|
||||||
|
margin: 0;
|
||||||
|
font-size: 18px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: var(--console-heading, var(--ui-color-text-0));
|
||||||
|
overflow-wrap: anywhere;
|
||||||
|
}
|
||||||
|
|
||||||
|
.redemption-details-heading .ant-tag {
|
||||||
|
margin-inline-end: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.redemption-code {
|
||||||
|
display: grid;
|
||||||
|
gap: 8px;
|
||||||
|
padding: 12px 16px;
|
||||||
|
border: 1px solid var(--console-border, var(--ui-color-border));
|
||||||
|
border-radius: 8px;
|
||||||
|
background: var(--console-fill, var(--ui-color-fill-0));
|
||||||
|
}
|
||||||
|
|
||||||
|
.redemption-code code {
|
||||||
|
overflow-wrap: anywhere;
|
||||||
|
user-select: all;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.redemption-details-fields {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||||
|
gap: 12px 20px;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.redemption-details dt,
|
||||||
|
.redemption-code-header > span {
|
||||||
|
color: var(--console-text, var(--ui-color-text-0));
|
||||||
|
font-size: 13px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.redemption-details dd {
|
||||||
|
margin: 4px 0 0;
|
||||||
|
overflow-wrap: anywhere;
|
||||||
|
font-variant-numeric: tabular-nums;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 575px) {
|
||||||
|
.redemption-details-fields {
|
||||||
|
grid-template-columns: 1fr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.center-action-table .center-action-cell .redemption-row-actions {
|
||||||
|
flex-wrap: nowrap;
|
||||||
|
vertical-align: middle;
|
||||||
|
overflow-x: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.redemption-row-actions .ant-btn {
|
||||||
|
flex: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 575px) {
|
||||||
|
.center-action-table .center-action-cell .redemption-row-actions {
|
||||||
|
gap: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.redemption-row-actions.console-module-row-actions .ant-btn-link {
|
||||||
|
padding-inline: 2px;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -265,7 +265,11 @@ const applyUsageRecordPresentation = (
|
|||||||
};
|
};
|
||||||
switch (column.key) {
|
switch (column.key) {
|
||||||
case COLUMN_KEYS.TIME:
|
case COLUMN_KEYS.TIME:
|
||||||
return { ...column, render: (text) => renderRecordTime(text) };
|
return {
|
||||||
|
...column,
|
||||||
|
fixed: 'left',
|
||||||
|
render: (text) => renderRecordTime(text),
|
||||||
|
};
|
||||||
case COLUMN_KEYS.USERNAME:
|
case COLUMN_KEYS.USERNAME:
|
||||||
return {
|
return {
|
||||||
...column,
|
...column,
|
||||||
|
|||||||
@@ -390,16 +390,17 @@ const LogsTable = (logsData) => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
const tableColumns = useMemo(() => {
|
const tableColumns = useMemo(() => {
|
||||||
const baseColumns = compactMode
|
const baseColumns =
|
||||||
? visibleColumnsList.map(({ fixed, ...rest }) => rest)
|
compactMode && !usageRecordMode
|
||||||
: visibleColumnsList;
|
? visibleColumnsList.map(({ fixed, ...rest }) => rest)
|
||||||
|
: visibleColumnsList;
|
||||||
if (!hasExpandableRows()) return baseColumns;
|
if (!hasExpandableRows()) return baseColumns;
|
||||||
return [
|
return [
|
||||||
...baseColumns,
|
...baseColumns,
|
||||||
{
|
{
|
||||||
title: usageRecordMode ? t('操作') : t('计费详情'),
|
title: usageRecordMode ? t('操作') : t('计费详情'),
|
||||||
key: 'billingDetailAction',
|
key: 'billingDetailAction',
|
||||||
fixed: compactMode || usageRecordMode ? undefined : 'right',
|
fixed: usageRecordMode || !compactMode ? 'right' : undefined,
|
||||||
width: 120,
|
width: 120,
|
||||||
render: (_, record) => {
|
render: (_, record) => {
|
||||||
const canView =
|
const canView =
|
||||||
@@ -452,7 +453,9 @@ const LogsTable = (logsData) => {
|
|||||||
dataSource={logs}
|
dataSource={logs}
|
||||||
rowKey='key'
|
rowKey='key'
|
||||||
loading={loading}
|
loading={loading}
|
||||||
scroll={compactMode ? undefined : { x: 'max-content' }}
|
scroll={
|
||||||
|
usageRecordMode || !compactMode ? { x: 'max-content' } : undefined
|
||||||
|
}
|
||||||
className={
|
className={
|
||||||
usageRecordMode
|
usageRecordMode
|
||||||
? 'usage-logs-table usage-record-table'
|
? 'usage-logs-table usage-record-table'
|
||||||
|
|||||||
@@ -7,15 +7,15 @@ export const REDEMPTION_STATUS = {
|
|||||||
// Redemption code status display mapping
|
// Redemption code status display mapping
|
||||||
export const REDEMPTION_STATUS_MAP = {
|
export const REDEMPTION_STATUS_MAP = {
|
||||||
[REDEMPTION_STATUS.UNUSED]: {
|
[REDEMPTION_STATUS.UNUSED]: {
|
||||||
color: 'green',
|
color: 'success',
|
||||||
text: '未使用',
|
text: '未使用',
|
||||||
},
|
},
|
||||||
[REDEMPTION_STATUS.DISABLED]: {
|
[REDEMPTION_STATUS.DISABLED]: {
|
||||||
color: 'red',
|
color: 'error',
|
||||||
text: '已禁用',
|
text: '已禁用',
|
||||||
},
|
},
|
||||||
[REDEMPTION_STATUS.USED]: {
|
[REDEMPTION_STATUS.USED]: {
|
||||||
color: 'grey',
|
color: 'default',
|
||||||
text: '已使用',
|
text: '已使用',
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import {
|
|||||||
REDEMPTION_STATUS,
|
REDEMPTION_STATUS,
|
||||||
} from '../../constants/redemption.constants';
|
} from '../../constants/redemption.constants';
|
||||||
import { Modal } from '@/components/ui';
|
import { Modal } from '@/components/ui';
|
||||||
|
import { confirmTableAction } from '@/components/common/table/confirmTableAction';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { useTableCompactMode } from '../common/useTableCompactMode';
|
import { useTableCompactMode } from '../common/useTableCompactMode';
|
||||||
|
|
||||||
@@ -185,28 +186,6 @@ export const useRedemptionsData = () => {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
// Row style handling - using isExpired function
|
|
||||||
const handleRow = (record, index) => {
|
|
||||||
// Local isExpired function
|
|
||||||
const isExpired = (rec) => {
|
|
||||||
return (
|
|
||||||
rec.status === REDEMPTION_STATUS.UNUSED &&
|
|
||||||
rec.expired_time !== 0 &&
|
|
||||||
rec.expired_time < Math.floor(Date.now() / 1000)
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
if (record.status !== REDEMPTION_STATUS.UNUSED || isExpired(record)) {
|
|
||||||
return {
|
|
||||||
style: {
|
|
||||||
background: 'var(--ui-color-disabled-border)',
|
|
||||||
},
|
|
||||||
};
|
|
||||||
} else {
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// Copy text
|
// Copy text
|
||||||
const copyText = async (text) => {
|
const copyText = async (text) => {
|
||||||
if (await copy(text)) {
|
if (await copy(text)) {
|
||||||
@@ -235,21 +214,28 @@ export const useRedemptionsData = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Batch delete redemption codes (clear invalid)
|
// Batch delete redemption codes (clear invalid)
|
||||||
const batchDeleteRedemptions = async () => {
|
const batchDeleteRedemptions = () => {
|
||||||
Modal.confirm({
|
confirmTableAction({
|
||||||
title: t('确定清除所有失效兑换码?'),
|
title: t('确定清除所有失效兑换码?'),
|
||||||
content: t('将删除已使用、已禁用及过期的兑换码,此操作不可撤销。'),
|
content: t('将删除已使用、已禁用及过期的兑换码,此操作不可撤销。'),
|
||||||
|
focusable: { autoFocusButton: 'cancel' },
|
||||||
onOk: async () => {
|
onOk: async () => {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
const res = await API.delete('/api/redemption/invalid');
|
try {
|
||||||
const { success, message, data } = res.data;
|
const res = await API.delete('/api/redemption/invalid');
|
||||||
if (success) {
|
const { success, message, data } = res.data;
|
||||||
|
if (!success) {
|
||||||
|
showError(message);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
showSuccess(t('已删除 {{count}} 条失效兑换码', { count: data }));
|
showSuccess(t('已删除 {{count}} 条失效兑换码', { count: data }));
|
||||||
await refresh();
|
await refresh();
|
||||||
} else {
|
} catch (error) {
|
||||||
showError(message);
|
if (!error.isAxiosError) showError(error.message);
|
||||||
|
return false;
|
||||||
|
} finally {
|
||||||
|
setLoading(false);
|
||||||
}
|
}
|
||||||
setLoading(false);
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@@ -324,7 +310,6 @@ export const useRedemptionsData = () => {
|
|||||||
handlePageChange,
|
handlePageChange,
|
||||||
handlePageSizeChange,
|
handlePageSizeChange,
|
||||||
rowSelection,
|
rowSelection,
|
||||||
handleRow,
|
|
||||||
closeEdit,
|
closeEdit,
|
||||||
getFormValues,
|
getFormValues,
|
||||||
|
|
||||||
|
|||||||
@@ -1560,6 +1560,9 @@
|
|||||||
"兑换": "Redeem",
|
"兑换": "Redeem",
|
||||||
"兑换成功!": "Redemption successful!",
|
"兑换成功!": "Redemption successful!",
|
||||||
"兑换额度": "Redeem",
|
"兑换额度": "Redeem",
|
||||||
|
"兑换码": "Redemption code",
|
||||||
|
"兑换码列表": "Redemption codes",
|
||||||
|
"编辑兑换码信息": "Edit redemption code",
|
||||||
"兑换码充值": "Redemption code recharge",
|
"兑换码充值": "Redemption code recharge",
|
||||||
"兑换码创建成功": "Redemption Code Created",
|
"兑换码创建成功": "Redemption Code Created",
|
||||||
"兑换码创建成功,是否下载兑换码?": "Redemption code created successfully. Do you want to download it?",
|
"兑换码创建成功,是否下载兑换码?": "Redemption code created successfully. Do you want to download it?",
|
||||||
|
|||||||
@@ -1512,6 +1512,9 @@
|
|||||||
"兑换": "échange",
|
"兑换": "échange",
|
||||||
"兑换成功!": "Échange réussi !",
|
"兑换成功!": "Échange réussi !",
|
||||||
"兑换额度": "Utiliser",
|
"兑换额度": "Utiliser",
|
||||||
|
"兑换码": "Code d’échange",
|
||||||
|
"兑换码列表": "Codes d’échange",
|
||||||
|
"编辑兑换码信息": "Modifier les informations du code d’échange",
|
||||||
"兑换码充值": "Recharge par code d'échange",
|
"兑换码充值": "Recharge par code d'échange",
|
||||||
"兑换码创建成功": "Code d'échange créé",
|
"兑换码创建成功": "Code d'échange créé",
|
||||||
"兑换码创建成功,是否下载兑换码?": "Code d'échange créé avec succès. Voulez-vous le télécharger ?",
|
"兑换码创建成功,是否下载兑换码?": "Code d'échange créé avec succès. Voulez-vous le télécharger ?",
|
||||||
|
|||||||
@@ -1560,6 +1560,9 @@
|
|||||||
"兑换": "引き換え",
|
"兑换": "引き換え",
|
||||||
"兑换成功!": "引き換えに成功しました",
|
"兑换成功!": "引き換えに成功しました",
|
||||||
"兑换额度": "引き換え",
|
"兑换额度": "引き換え",
|
||||||
|
"兑换码": "引き換えコード",
|
||||||
|
"兑换码列表": "引き換えコード一覧",
|
||||||
|
"编辑兑换码信息": "引き換えコード情報を編集",
|
||||||
"兑换码充值": "引き換えコードによるチャージ",
|
"兑换码充值": "引き換えコードによるチャージ",
|
||||||
"兑换码创建成功": "引き換えコードの作成に成功しました",
|
"兑换码创建成功": "引き換えコードの作成に成功しました",
|
||||||
"兑换码创建成功,是否下载兑换码?": "引き換えコードの作成に成功しました。ダウンロードしますか?",
|
"兑换码创建成功,是否下载兑换码?": "引き換えコードの作成に成功しました。ダウンロードしますか?",
|
||||||
|
|||||||
@@ -1560,6 +1560,9 @@
|
|||||||
"兑换": "교환",
|
"兑换": "교환",
|
||||||
"兑换成功!": "교환되었습니다!",
|
"兑换成功!": "교환되었습니다!",
|
||||||
"兑换额度": "할당량 교환",
|
"兑换额度": "할당량 교환",
|
||||||
|
"兑换码": "교환 코드",
|
||||||
|
"兑换码列表": "교환 코드 목록",
|
||||||
|
"编辑兑换码信息": "교환 코드 정보 편집",
|
||||||
"兑换码充值": "교환 코드 충전",
|
"兑换码充值": "교환 코드 충전",
|
||||||
"兑换码创建成功": "교환 코드가 생성되었습니다",
|
"兑换码创建成功": "교환 코드가 생성되었습니다",
|
||||||
"兑换码创建成功,是否下载兑换码?": "교환 코드가 생성되었습니다. 내려받으시겠습니까?",
|
"兑换码创建成功,是否下载兑换码?": "교환 코드가 생성되었습니다. 내려받으시겠습니까?",
|
||||||
|
|||||||
@@ -1532,6 +1532,9 @@
|
|||||||
"兑换": "Обмен валюты",
|
"兑换": "Обмен валюты",
|
||||||
"兑换成功!": "Обмен успешен!",
|
"兑换成功!": "Обмен успешен!",
|
||||||
"兑换额度": "Обменять квоту",
|
"兑换额度": "Обменять квоту",
|
||||||
|
"兑换码": "Код активации",
|
||||||
|
"兑换码列表": "Список кодов активации",
|
||||||
|
"编辑兑换码信息": "Редактировать данные кода активации",
|
||||||
"兑换码充值": "Пополнение кодом купона",
|
"兑换码充值": "Пополнение кодом купона",
|
||||||
"兑换码创建成功": "Код купона успешно создан",
|
"兑换码创建成功": "Код купона успешно создан",
|
||||||
"兑换码创建成功,是否下载兑换码?": "Код купона успешно создан, скачать код купона?",
|
"兑换码创建成功,是否下载兑换码?": "Код купона успешно создан, скачать код купона?",
|
||||||
|
|||||||
@@ -1560,6 +1560,9 @@
|
|||||||
"兑换": "แลก",
|
"兑换": "แลก",
|
||||||
"兑换成功!": "แลกสำเร็จ!",
|
"兑换成功!": "แลกสำเร็จ!",
|
||||||
"兑换额度": "แลก",
|
"兑换额度": "แลก",
|
||||||
|
"兑换码": "รหัสแลก",
|
||||||
|
"兑换码列表": "รายการรหัสแลก",
|
||||||
|
"编辑兑换码信息": "แก้ไขข้อมูลรหัสแลก",
|
||||||
"兑换码充值": "เติมเงินด้วยรหัสแลก",
|
"兑换码充值": "เติมเงินด้วยรหัสแลก",
|
||||||
"兑换码创建成功": "สร้างรหัสแลกแล้ว",
|
"兑换码创建成功": "สร้างรหัสแลกแล้ว",
|
||||||
"兑换码创建成功,是否下载兑换码?": "สร้างรหัสแลกสำเร็จ ต้องการดาวน์โหลดหรือไม่?",
|
"兑换码创建成功,是否下载兑换码?": "สร้างรหัสแลกสำเร็จ ต้องการดาวน์โหลดหรือไม่?",
|
||||||
|
|||||||
@@ -1560,6 +1560,9 @@
|
|||||||
"兑换": "Đổi",
|
"兑换": "Đổi",
|
||||||
"兑换成功!": "Đổi thành công!",
|
"兑换成功!": "Đổi thành công!",
|
||||||
"兑换额度": "Đổi",
|
"兑换额度": "Đổi",
|
||||||
|
"兑换码": "Mã đổi thưởng",
|
||||||
|
"兑换码列表": "Danh sách mã đổi thưởng",
|
||||||
|
"编辑兑换码信息": "Chỉnh sửa thông tin mã đổi thưởng",
|
||||||
"兑换码充值": "Nạp tiền bằng mã đổi thưởng",
|
"兑换码充值": "Nạp tiền bằng mã đổi thưởng",
|
||||||
"兑换码创建成功": "Đã tạo mã đổi thưởng",
|
"兑换码创建成功": "Đã tạo mã đổi thưởng",
|
||||||
"兑换码创建成功,是否下载兑换码?": "Tạo mã đổi thưởng thành công. Bạn có muốn tải xuống không?",
|
"兑换码创建成功,是否下载兑换码?": "Tạo mã đổi thưởng thành công. Bạn có muốn tải xuống không?",
|
||||||
|
|||||||
@@ -1560,6 +1560,9 @@
|
|||||||
"兑换": "兌換",
|
"兑换": "兌換",
|
||||||
"兑换成功!": "兌換成功!",
|
"兑换成功!": "兌換成功!",
|
||||||
"兑换额度": "兌換額度",
|
"兑换额度": "兌換額度",
|
||||||
|
"兑换码": "兌換碼",
|
||||||
|
"兑换码列表": "兌換碼清單",
|
||||||
|
"编辑兑换码信息": "編輯兌換碼資訊",
|
||||||
"兑换码充值": "兌換碼儲值",
|
"兑换码充值": "兌換碼儲值",
|
||||||
"兑换码创建成功": "兌換碼建立成功",
|
"兑换码创建成功": "兌換碼建立成功",
|
||||||
"兑换码创建成功,是否下载兑换码?": "兌換碼建立成功,是否下載兌換碼?",
|
"兑换码创建成功,是否下载兑换码?": "兌換碼建立成功,是否下載兌換碼?",
|
||||||
|
|||||||
@@ -1532,6 +1532,9 @@
|
|||||||
"兑换": "兑换",
|
"兑换": "兑换",
|
||||||
"兑换成功!": "兑换成功!",
|
"兑换成功!": "兑换成功!",
|
||||||
"兑换额度": "兑换额度",
|
"兑换额度": "兑换额度",
|
||||||
|
"兑换码": "兑换码",
|
||||||
|
"兑换码列表": "兑换码列表",
|
||||||
|
"编辑兑换码信息": "编辑兑换码信息",
|
||||||
"兑换码充值": "兑换码充值",
|
"兑换码充值": "兑换码充值",
|
||||||
"兑换码创建成功": "兑换码创建成功",
|
"兑换码创建成功": "兑换码创建成功",
|
||||||
"兑换码创建成功,是否下载兑换码?": "兑换码创建成功,是否下载兑换码?",
|
"兑换码创建成功,是否下载兑换码?": "兑换码创建成功,是否下载兑换码?",
|
||||||
|
|||||||
Reference in New Issue
Block a user