fix: complete first version issue remediation

This commit is contained in:
hectorzhao
2026-07-11 10:14:37 +08:00
parent 709ac97764
commit 208a6c23f8
73 changed files with 1549 additions and 245 deletions
@@ -1,6 +1,7 @@
import { useEffect, useMemo, useState } from 'react';
import { Edit3, Eye, Plus, Search, Trash2 } from 'lucide-react';
import { adminApi, type ClientSmsApplication, type ClientSmsSignature, type ClientSmsTemplate, type TenantOption } from '@/api/adminApi';
import { formatDateTime } from '@/utils/dateTime';
import { Breadcrumb, Button, Input, Modal, Select, Table, Tabs, Tag, Textarea, type TableColumn } from '@/components/ui';
type TemplateFormState = {
@@ -41,7 +42,7 @@ function extractVariables(content: string): TemplateVariable[] {
}
function formatDate(value?: string) {
return value ? new Date(value).toLocaleString('zh-CN') : '-';
return formatDateTime(value);
}
function statusTone(status: string) {
@@ -51,6 +52,14 @@ function statusTone(status: string) {
return 'info';
}
const auditStatusLabel: Record<string, string> = {
approved: '已通过',
draft: '草稿',
pending: '审核中',
rejected: '已驳回',
deleted: '已删除',
};
function billingUnits(content: string) {
if (!content) {
return 1;
@@ -324,7 +333,7 @@ export function AdminEnterpriseTemplatesPage() {
{ key: 'signature', title: '签名', width: '160px', render: (record) => record.signature?.name ?? '-' },
{ key: 'content', title: '模板内容', width: '420px', render: (record) => <span className="table-long-text table-long-text--sms-template">{record.content}</span> },
{ key: 'variables', title: '变量', width: '120px', render: (record) => `${record.variables?.length ?? 0}` },
{ key: 'status', title: '审核状态', width: '130px', render: (record) => <Tag tone={statusTone(record.auditStatus)}>{record.auditStatus}</Tag> },
{ key: 'status', title: '审核状态', width: '130px', render: (record) => <Tag tone={statusTone(record.auditStatus)}>{auditStatusLabel[record.auditStatus] ?? record.auditStatus}</Tag> },
{ key: 'updatedAt', title: '更新时间', width: '170px', render: (record) => formatDate(record.updatedAt) },
{
key: 'actions',