Merge pull request 'v3.5.9版本迭代列表优化' (#48) from dev_jacy into dev
CI / verify (pull_request) Waiting to run
CI / verify (pull_request) Waiting to run
Reviewed-on: https://git.yqidian.com/jacy/dukang/pulls/48
This commit was merged in pull request #48.
This commit is contained in:
@@ -46,6 +46,34 @@ body,
|
|||||||
text-overflow: clip;
|
text-overflow: clip;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 拖表头分割线改列宽 */
|
||||||
|
.admin-layout .ant-table-thead > tr > th.admin-th-resizable {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.admin-col-resize-handle {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
width: 10px;
|
||||||
|
cursor: col-resize;
|
||||||
|
z-index: 3;
|
||||||
|
user-select: none;
|
||||||
|
touch-action: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.admin-col-resize-handle:hover,
|
||||||
|
.admin-col-resizing .admin-col-resize-handle {
|
||||||
|
background: rgba(22, 119, 255, 0.18);
|
||||||
|
}
|
||||||
|
|
||||||
|
body.admin-col-resizing,
|
||||||
|
body.admin-col-resizing * {
|
||||||
|
cursor: col-resize !important;
|
||||||
|
user-select: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
/* 操作列保持可见 */
|
/* 操作列保持可见 */
|
||||||
.admin-layout .ant-table-cell:has(.ant-btn),
|
.admin-layout .ant-table-cell:has(.ant-btn),
|
||||||
.ant-drawer .ant-table-cell:has(.ant-btn),
|
.ant-drawer .ant-table-cell:has(.ant-btn),
|
||||||
@@ -81,6 +109,23 @@ body,
|
|||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.admin-primary-link {
|
||||||
|
display: inline;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
border: 0;
|
||||||
|
background: none;
|
||||||
|
font: inherit;
|
||||||
|
color: inherit;
|
||||||
|
text-decoration: underline;
|
||||||
|
text-underline-offset: 3px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.admin-primary-link:hover {
|
||||||
|
color: #1677ff;
|
||||||
|
}
|
||||||
|
|
||||||
.admin-table-nowrap .ant-table-cell,
|
.admin-table-nowrap .ant-table-cell,
|
||||||
.admin-table-nowrap .ant-table-cell-ellipsis {
|
.admin-table-nowrap .ant-table-cell-ellipsis {
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
import type { MouseEvent, ReactNode } from 'react';
|
||||||
|
|
||||||
|
/** HQ 主列表主展示列:下划线,点击进入编辑或详情 */
|
||||||
|
export function AdminPrimaryLink({
|
||||||
|
children,
|
||||||
|
onClick,
|
||||||
|
}: {
|
||||||
|
children?: ReactNode;
|
||||||
|
onClick: (e?: MouseEvent) => void;
|
||||||
|
}) {
|
||||||
|
const empty = children == null || children === '';
|
||||||
|
return (
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className="admin-primary-link"
|
||||||
|
onClick={(e) => {
|
||||||
|
e.preventDefault();
|
||||||
|
e.stopPropagation();
|
||||||
|
onClick(e);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{empty ? '—' : children}
|
||||||
|
</button>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -35,7 +35,11 @@ export function ListColumnPrefsProvider({
|
|||||||
`/admin/me/list-columns/${listKey}`,
|
`/admin/me/list-columns/${listKey}`,
|
||||||
{
|
{
|
||||||
method: 'PUT',
|
method: 'PUT',
|
||||||
body: JSON.stringify(next ? { order: next.order, hidden: next.hidden } : { reset: true }),
|
body: JSON.stringify(
|
||||||
|
next
|
||||||
|
? { order: next.order, hidden: next.hidden, widths: next.widths }
|
||||||
|
: { reset: true },
|
||||||
|
),
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
setPrefs(res.listColumnPrefs ?? {});
|
setPrefs(res.listColumnPrefs ?? {});
|
||||||
|
|||||||
@@ -202,6 +202,7 @@ export type AdminOrderRow = {
|
|||||||
productName?: string;
|
productName?: string;
|
||||||
productSpec?: string;
|
productSpec?: string;
|
||||||
quantity?: number;
|
quantity?: number;
|
||||||
|
saleUnit?: string;
|
||||||
receiverName: string;
|
receiverName: string;
|
||||||
receiverPhone: string;
|
receiverPhone: string;
|
||||||
receiverProvince?: string;
|
receiverProvince?: string;
|
||||||
|
|||||||
@@ -0,0 +1,67 @@
|
|||||||
|
import type { MouseEvent, ReactNode } from 'react';
|
||||||
|
import type { ColumnType } from 'antd/es/table';
|
||||||
|
|
||||||
|
export const MIN_COL_WIDTH = 48;
|
||||||
|
export const MAX_COL_WIDTH = 960;
|
||||||
|
|
||||||
|
export function clampColWidth(n: number): number {
|
||||||
|
return Math.min(MAX_COL_WIDTH, Math.max(MIN_COL_WIDTH, Math.round(n)));
|
||||||
|
}
|
||||||
|
|
||||||
|
export function beginColumnResize(
|
||||||
|
e: MouseEvent,
|
||||||
|
startWidth: number,
|
||||||
|
onMove: (width: number) => void,
|
||||||
|
onEnd: (width: number) => void,
|
||||||
|
) {
|
||||||
|
e.preventDefault();
|
||||||
|
e.stopPropagation();
|
||||||
|
const startX = e.clientX;
|
||||||
|
let latest = clampColWidth(startWidth);
|
||||||
|
let moved = false;
|
||||||
|
document.body.classList.add('admin-col-resizing');
|
||||||
|
|
||||||
|
const onMouseMove = (ev: globalThis.MouseEvent) => {
|
||||||
|
moved = true;
|
||||||
|
latest = clampColWidth(startWidth + ev.clientX - startX);
|
||||||
|
onMove(latest);
|
||||||
|
};
|
||||||
|
const onMouseUp = () => {
|
||||||
|
document.removeEventListener('mousemove', onMouseMove);
|
||||||
|
document.removeEventListener('mouseup', onMouseUp);
|
||||||
|
document.body.classList.remove('admin-col-resizing');
|
||||||
|
if (moved) onEnd(latest);
|
||||||
|
};
|
||||||
|
document.addEventListener('mousemove', onMouseMove);
|
||||||
|
document.addEventListener('mouseup', onMouseUp);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function withResizeTitle<T>(
|
||||||
|
title: ColumnType<T>['title'],
|
||||||
|
onMouseDown: (e: MouseEvent) => void,
|
||||||
|
): ColumnType<T>['title'] {
|
||||||
|
const handle: ReactNode = (
|
||||||
|
<span
|
||||||
|
role="separator"
|
||||||
|
aria-orientation="vertical"
|
||||||
|
aria-label="拖动调整列宽"
|
||||||
|
className="admin-col-resize-handle"
|
||||||
|
onClick={(ev) => ev.stopPropagation()}
|
||||||
|
onMouseDown={onMouseDown}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
if (typeof title === 'function') {
|
||||||
|
return (props) => (
|
||||||
|
<>
|
||||||
|
{title(props)}
|
||||||
|
{handle}
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
{title}
|
||||||
|
{handle}
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -7,6 +7,12 @@ export const DELIVERY_PROVIDER_LABELS: Record<string, string> = {
|
|||||||
MANUAL: '手动',
|
MANUAL: '手动',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const DELIVERY_TYPE_LABELS: Record<string, string> = {
|
||||||
|
LOCAL: '同城',
|
||||||
|
CROSS_CITY: '跨城',
|
||||||
|
ON_SITE_PICKUP: '现场提货',
|
||||||
|
};
|
||||||
|
|
||||||
export const ORDER_STATUS_LABELS: Record<string, string> = {
|
export const ORDER_STATUS_LABELS: Record<string, string> = {
|
||||||
PENDING_PAY: '待付款',
|
PENDING_PAY: '待付款',
|
||||||
PENDING_SHIP: '待发货',
|
PENDING_SHIP: '待发货',
|
||||||
|
|||||||
@@ -55,7 +55,20 @@ export function applyColumnPrefs<T>(
|
|||||||
const visible = new Set(visibleColumnKeys(defaultKeys, pref));
|
const visible = new Set(visibleColumnKeys(defaultKeys, pref));
|
||||||
const orderedKeys = mergeColumnOrder(defaultKeys, pref).filter((k) => visible.has(k));
|
const orderedKeys = mergeColumnOrder(defaultKeys, pref).filter((k) => visible.has(k));
|
||||||
const byKey = new Map(configurable.map((c) => [c.key, c.col]));
|
const byKey = new Map(configurable.map((c) => [c.key, c.col]));
|
||||||
return [...orderedKeys.map((k) => byKey.get(k)!).filter(Boolean), ...actions.map((c) => c.col)];
|
return [
|
||||||
|
...orderedKeys
|
||||||
|
.map((k) => {
|
||||||
|
const col = byKey.get(k);
|
||||||
|
if (!col) return null;
|
||||||
|
const w = pref?.widths?.[k];
|
||||||
|
return w != null ? { ...col, width: w } : col;
|
||||||
|
})
|
||||||
|
.filter((c): c is ColumnType<T> => !!c),
|
||||||
|
...actions.map((c) => {
|
||||||
|
const w = pref?.widths?.[c.key];
|
||||||
|
return w != null ? { ...c.col, width: w } : c.col;
|
||||||
|
}),
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ListColumnSettingItem = {
|
export type ListColumnSettingItem = {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { useMemo, useState } from 'react';
|
import { useCallback, useMemo, useRef, useState } from 'react';
|
||||||
import { Button, message } from 'antd';
|
import { Button, message } from 'antd';
|
||||||
import { SettingOutlined } from '@ant-design/icons';
|
import { SettingOutlined } from '@ant-design/icons';
|
||||||
import type { ColumnsType, ColumnType } from 'antd/es/table';
|
import type { ColumnsType, ColumnType } from 'antd/es/table';
|
||||||
@@ -9,9 +9,11 @@ import {
|
|||||||
ACTIONS_COLUMN_KEY,
|
ACTIONS_COLUMN_KEY,
|
||||||
SERIAL_COLUMN_KEY,
|
SERIAL_COLUMN_KEY,
|
||||||
applyColumnPrefs,
|
applyColumnPrefs,
|
||||||
|
columnKey,
|
||||||
settingItems,
|
settingItems,
|
||||||
type ListColumnSettingItem,
|
type ListColumnSettingItem,
|
||||||
} from './list-column-prefs';
|
} from './list-column-prefs';
|
||||||
|
import { beginColumnResize, withResizeTitle } from './column-resize';
|
||||||
|
|
||||||
type Options = {
|
type Options = {
|
||||||
page?: number;
|
page?: number;
|
||||||
@@ -27,7 +29,13 @@ export function useAdminListColumns<T>(
|
|||||||
const { prefs, save } = useListColumnPrefs();
|
const { prefs, save } = useListColumnPrefs();
|
||||||
const [open, setOpen] = useState(false);
|
const [open, setOpen] = useState(false);
|
||||||
const [saving, setSaving] = useState(false);
|
const [saving, setSaving] = useState(false);
|
||||||
|
const [localWidths, setLocalWidths] = useState<Record<string, number>>({});
|
||||||
const pref = prefs[listKey];
|
const pref = prefs[listKey];
|
||||||
|
const prefRef = useRef(pref);
|
||||||
|
prefRef.current = pref;
|
||||||
|
const localWidthsRef = useRef(localWidths);
|
||||||
|
localWidthsRef.current = localWidths;
|
||||||
|
const itemsRef = useRef<ListColumnSettingItem[]>([]);
|
||||||
|
|
||||||
const configured = useMemo(
|
const configured = useMemo(
|
||||||
() => applyColumnPrefs(allColumns as ColumnType<T>[], pref),
|
() => applyColumnPrefs(allColumns as ColumnType<T>[], pref),
|
||||||
@@ -38,6 +46,7 @@ export function useAdminListColumns<T>(
|
|||||||
() => settingItems(allColumns as ColumnType<T>[], pref),
|
() => settingItems(allColumns as ColumnType<T>[], pref),
|
||||||
[allColumns, pref],
|
[allColumns, pref],
|
||||||
);
|
);
|
||||||
|
itemsRef.current = items;
|
||||||
|
|
||||||
const serialCol: ColumnType<T> = useMemo(
|
const serialCol: ColumnType<T> = useMemo(
|
||||||
() => ({
|
() => ({
|
||||||
@@ -50,27 +59,30 @@ export function useAdminListColumns<T>(
|
|||||||
[page, pageSize],
|
[page, pageSize],
|
||||||
);
|
);
|
||||||
|
|
||||||
const columns = useMemo<ColumnsType<T>>(
|
const persistPref = useCallback(
|
||||||
() => [
|
async (next: { order: string[]; hidden: string[]; widths?: Record<string, number> } | null) => {
|
||||||
serialCol,
|
if (!next) {
|
||||||
...configured.map((col) =>
|
setLocalWidths({});
|
||||||
col.title === '操作' || col.key === ACTIONS_COLUMN_KEY || col.key === 'actions'
|
await save(listKey, null);
|
||||||
? { ...col, key: col.key ?? ACTIONS_COLUMN_KEY }
|
return;
|
||||||
: col,
|
}
|
||||||
),
|
await save(listKey, next);
|
||||||
],
|
},
|
||||||
[configured, serialCol],
|
[listKey, save],
|
||||||
);
|
);
|
||||||
|
|
||||||
async function persist(next: ListColumnSettingItem[] | null) {
|
const persist = useCallback(
|
||||||
|
async (next: ListColumnSettingItem[] | null) => {
|
||||||
setSaving(true);
|
setSaving(true);
|
||||||
try {
|
try {
|
||||||
if (!next) {
|
if (!next) {
|
||||||
await save(listKey, null);
|
await persistPref(null);
|
||||||
} else {
|
} else {
|
||||||
await save(listKey, {
|
const widths = { ...(prefRef.current?.widths ?? {}), ...localWidthsRef.current };
|
||||||
|
await persistPref({
|
||||||
order: next.map((i) => i.key),
|
order: next.map((i) => i.key),
|
||||||
hidden: next.filter((i) => !i.visible).map((i) => i.key),
|
hidden: next.filter((i) => !i.visible).map((i) => i.key),
|
||||||
|
...(Object.keys(widths).length ? { widths } : {}),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
setOpen(false);
|
setOpen(false);
|
||||||
@@ -80,7 +92,65 @@ export function useAdminListColumns<T>(
|
|||||||
} finally {
|
} finally {
|
||||||
setSaving(false);
|
setSaving(false);
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
[persistPref],
|
||||||
|
);
|
||||||
|
|
||||||
|
const persistWidth = useCallback(
|
||||||
|
async (key: string, width: number) => {
|
||||||
|
const current = prefRef.current;
|
||||||
|
const prevW = current?.widths?.[key];
|
||||||
|
if (prevW === width) return;
|
||||||
|
const order = current?.order?.length ? current.order : itemsRef.current.map((i) => i.key);
|
||||||
|
const hidden = current?.hidden ?? [];
|
||||||
|
const widths = { ...(current?.widths ?? {}), ...localWidthsRef.current, [key]: width };
|
||||||
|
try {
|
||||||
|
await persistPref({ order, hidden, widths });
|
||||||
|
} catch (e) {
|
||||||
|
message.error(e instanceof Error ? e.message : '列宽保存失败');
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
[persistPref],
|
||||||
|
);
|
||||||
|
|
||||||
|
const columns = useMemo<ColumnsType<T>>(() => {
|
||||||
|
const merged: ColumnType<T>[] = [
|
||||||
|
serialCol,
|
||||||
|
...configured.map((col) =>
|
||||||
|
col.title === '操作' || col.key === ACTIONS_COLUMN_KEY || col.key === 'actions'
|
||||||
|
? { ...col, key: col.key ?? ACTIONS_COLUMN_KEY }
|
||||||
|
: col,
|
||||||
|
),
|
||||||
|
];
|
||||||
|
const widths = { ...(pref?.widths ?? {}), ...localWidths };
|
||||||
|
return merged.map((col, i) => {
|
||||||
|
const key = columnKey(col, i);
|
||||||
|
const width = widths[key] ?? (typeof col.width === 'number' ? col.width : undefined);
|
||||||
|
const prevHeader = col.onHeaderCell;
|
||||||
|
return {
|
||||||
|
...col,
|
||||||
|
key,
|
||||||
|
width,
|
||||||
|
title: withResizeTitle(col.title, (e) => {
|
||||||
|
const th = (e.currentTarget as HTMLElement).closest('th');
|
||||||
|
const startWidth = width ?? th?.getBoundingClientRect().width ?? 120;
|
||||||
|
beginColumnResize(
|
||||||
|
e,
|
||||||
|
startWidth,
|
||||||
|
(next) => setLocalWidths((prev) => ({ ...prev, [key]: next })),
|
||||||
|
(next) => void persistWidth(key, next),
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
onHeaderCell: (column) => {
|
||||||
|
const extra = typeof prevHeader === 'function' ? prevHeader(column) : {};
|
||||||
|
return {
|
||||||
|
...extra,
|
||||||
|
className: [extra.className, 'admin-th-resizable'].filter(Boolean).join(' '),
|
||||||
|
};
|
||||||
|
},
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}, [configured, serialCol, pref?.widths, localWidths, persistWidth]);
|
||||||
|
|
||||||
const settingsButton = (
|
const settingsButton = (
|
||||||
<Button icon={<SettingOutlined />} onClick={() => setOpen(true)}>
|
<Button icon={<SettingOutlined />} onClick={() => setOpen(true)}>
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
|
import { useNavigate } from 'react-router-dom';
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
Descriptions,
|
Descriptions,
|
||||||
@@ -9,6 +10,7 @@ import {
|
|||||||
Modal,
|
Modal,
|
||||||
Popconfirm,
|
Popconfirm,
|
||||||
Select,
|
Select,
|
||||||
|
Space,
|
||||||
Table,
|
Table,
|
||||||
Tag,
|
Tag,
|
||||||
Typography,
|
Typography,
|
||||||
@@ -17,11 +19,22 @@ import {
|
|||||||
import type { ColumnsType } from 'antd/es/table';
|
import type { ColumnsType } from 'antd/es/table';
|
||||||
import type { AdminBenefitGrantRequest } from '@dukang/shared-types';
|
import type { AdminBenefitGrantRequest } from '@dukang/shared-types';
|
||||||
import { request } from '../lib/api';
|
import { request } from '../lib/api';
|
||||||
import { COUPON_STATUS_LABELS, fmtTime } from '../lib/constants';
|
import { COUPON_STATUS_LABELS, DELIVERY_TYPE_LABELS, fmtTime } from '../lib/constants';
|
||||||
import RedeemRecordDetailDescriptions from '../components/RedeemRecordDetailDescriptions';
|
import RedeemRecordDetailDescriptions from '../components/RedeemRecordDetailDescriptions';
|
||||||
import { useAdminList } from '../lib/useAdminList';
|
import { useAdminList } from '../lib/useAdminList';
|
||||||
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
||||||
|
import { AdminPrimaryLink } from '../components/AdminPrimaryLink';
|
||||||
|
|
||||||
|
type CouponOrder = {
|
||||||
|
id?: string;
|
||||||
|
orderNo?: string;
|
||||||
|
productName?: string | null;
|
||||||
|
productSpec?: string | null;
|
||||||
|
quantity?: number | null;
|
||||||
|
saleUnit?: string | null;
|
||||||
|
deliveryType?: string | null;
|
||||||
|
payAmount?: number | string | null;
|
||||||
|
};
|
||||||
|
|
||||||
type Row = {
|
type Row = {
|
||||||
id: string;
|
id: string;
|
||||||
@@ -32,10 +45,43 @@ type Row = {
|
|||||||
status: string;
|
status: string;
|
||||||
sourceProduct: string;
|
sourceProduct: string;
|
||||||
createdAt: string;
|
createdAt: string;
|
||||||
user?: { userNo: string; phone: string | null };
|
user?: { id?: string; userNo: string; phone: string | null };
|
||||||
order?: { orderNo: string } | null;
|
order?: CouponOrder | null;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
function saleUnitLabel(unit?: string | null) {
|
||||||
|
if (unit === 'BOX') return '箱';
|
||||||
|
if (unit === 'BOTTLE') return '瓶';
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
function formatPayAmount(v?: number | string | null) {
|
||||||
|
if (v == null || v === '') return '';
|
||||||
|
const n = Number(v);
|
||||||
|
return Number.isFinite(n) ? `¥${n.toFixed(2)}` : '';
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 来源:有订单时展示商品名、规格、数量、配送方式、金额;手动发放沿用 sourceProduct */
|
||||||
|
function formatCouponSource(row: { sourceProduct?: string; order?: CouponOrder | null }) {
|
||||||
|
const order = row.order;
|
||||||
|
if (!order?.orderNo && !order?.productName) {
|
||||||
|
return row.sourceProduct || '—';
|
||||||
|
}
|
||||||
|
const unit = saleUnitLabel(order.saleUnit);
|
||||||
|
const qty =
|
||||||
|
order.quantity != null ? `${order.quantity}${unit}` : '';
|
||||||
|
const delivery = DELIVERY_TYPE_LABELS[order.deliveryType ?? ''] || order.deliveryType || '';
|
||||||
|
const amount = formatPayAmount(order.payAmount);
|
||||||
|
const parts = [
|
||||||
|
order.productName || row.sourceProduct,
|
||||||
|
order.productSpec,
|
||||||
|
qty,
|
||||||
|
delivery,
|
||||||
|
amount,
|
||||||
|
].filter((p) => p != null && String(p).trim() !== '');
|
||||||
|
return parts.join(' / ') || row.sourceProduct || '—';
|
||||||
|
}
|
||||||
|
|
||||||
type CouponRedeemRecord = {
|
type CouponRedeemRecord = {
|
||||||
id: string;
|
id: string;
|
||||||
redeemNo: string;
|
redeemNo: string;
|
||||||
@@ -60,11 +106,10 @@ type CouponRedeemSummary = {
|
|||||||
type CouponDetail = Row & {
|
type CouponDetail = Row & {
|
||||||
redeemSummary?: CouponRedeemSummary | null;
|
redeemSummary?: CouponRedeemSummary | null;
|
||||||
redeemRecords?: CouponRedeemRecord[];
|
redeemRecords?: CouponRedeemRecord[];
|
||||||
user?: { userNo?: string; phone?: string | null };
|
|
||||||
order?: { orderNo?: string } | null;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function BenefitCouponsPage() {
|
export default function BenefitCouponsPage() {
|
||||||
|
const navigate = useNavigate();
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
const [grantForm] = Form.useForm<AdminBenefitGrantRequest>();
|
const [grantForm] = Form.useForm<AdminBenefitGrantRequest>();
|
||||||
const [filters, setFilters] = useState<Record<string, string>>({});
|
const [filters, setFilters] = useState<Record<string, string>>({});
|
||||||
@@ -102,20 +147,61 @@ export default function BenefitCouponsPage() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const baseColumns: ColumnsType<Row> = [
|
const baseColumns: ColumnsType<Row> = [
|
||||||
{ title: '券号', dataIndex: 'couponNo', width: 200, ellipsis: false },
|
{
|
||||||
{ title: '用户', dataIndex: ['user', 'userNo'], width: 120, ellipsis: false },
|
title: '券号',
|
||||||
|
dataIndex: 'couponNo',
|
||||||
|
width: 200,
|
||||||
|
ellipsis: false,
|
||||||
|
render: (v, row) => (
|
||||||
|
<AdminPrimaryLink
|
||||||
|
onClick={async () => {
|
||||||
|
setDetail(await request(`/admin/benefit/coupons/${row.id}`));
|
||||||
|
setDrawerOpen(true);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{v}
|
||||||
|
</AdminPrimaryLink>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '用户',
|
||||||
|
dataIndex: ['user', 'userNo'],
|
||||||
|
width: 120,
|
||||||
|
ellipsis: false,
|
||||||
|
render: (v: string | undefined, row) =>
|
||||||
|
row.user?.id ? (
|
||||||
|
<AdminPrimaryLink onClick={() => navigate('/users', { state: { openUserId: String(row.user!.id) } })}>
|
||||||
|
{v}
|
||||||
|
</AdminPrimaryLink>
|
||||||
|
) : (
|
||||||
|
v || '—'
|
||||||
|
),
|
||||||
|
},
|
||||||
{ title: '手机号', dataIndex: ['user', 'phone'], width: 120, render: (v) => v || '—' },
|
{ title: '手机号', dataIndex: ['user', 'phone'], width: 120, render: (v) => v || '—' },
|
||||||
{
|
{
|
||||||
title: '订单',
|
title: '订单',
|
||||||
dataIndex: ['order', 'orderNo'],
|
dataIndex: ['order', 'orderNo'],
|
||||||
width: 180,
|
width: 180,
|
||||||
ellipsis: false,
|
ellipsis: false,
|
||||||
render: (v) => v || '—',
|
render: (v: string | undefined) =>
|
||||||
|
v ? (
|
||||||
|
<AdminPrimaryLink onClick={() => navigate(`/orders?orderNo=${encodeURIComponent(v)}`)}>
|
||||||
|
{v}
|
||||||
|
</AdminPrimaryLink>
|
||||||
|
) : (
|
||||||
|
'—'
|
||||||
|
),
|
||||||
},
|
},
|
||||||
{ title: '总额', dataIndex: 'totalAmount', width: 80, render: (v) => `¥${v}` },
|
{ title: '总额', dataIndex: 'totalAmount', width: 80, render: (v) => `¥${v}` },
|
||||||
{ title: '余额', dataIndex: 'balance', width: 80, render: (v) => `¥${v}` },
|
{ title: '余额', dataIndex: 'balance', width: 80, render: (v) => `¥${v}` },
|
||||||
{ title: '状态', dataIndex: 'status', width: 90, render: (s) => <Tag>{COUPON_STATUS_LABELS[s] || s}</Tag> },
|
{ title: '状态', dataIndex: 'status', width: 90, render: (s) => <Tag>{COUPON_STATUS_LABELS[s] || s}</Tag> },
|
||||||
{ title: '来源', dataIndex: 'sourceProduct' },
|
{
|
||||||
|
title: '来源',
|
||||||
|
dataIndex: 'sourceProduct',
|
||||||
|
width: 360,
|
||||||
|
ellipsis: false,
|
||||||
|
render: (_: string, row) => formatCouponSource(row),
|
||||||
|
},
|
||||||
{ title: '创建', dataIndex: 'createdAt', width: 160, render: fmtTime },
|
{ title: '创建', dataIndex: 'createdAt', width: 160, render: fmtTime },
|
||||||
{
|
{
|
||||||
title: '操作',
|
title: '操作',
|
||||||
@@ -276,15 +362,37 @@ export default function BenefitCouponsPage() {
|
|||||||
<>
|
<>
|
||||||
<Descriptions column={1} bordered size="small">
|
<Descriptions column={1} bordered size="small">
|
||||||
<Descriptions.Item label="券号">{detail.couponNo}</Descriptions.Item>
|
<Descriptions.Item label="券号">{detail.couponNo}</Descriptions.Item>
|
||||||
<Descriptions.Item label="用户">{detail.user?.userNo ?? '—'}</Descriptions.Item>
|
<Descriptions.Item label="用户">
|
||||||
|
{detail.user?.id ? (
|
||||||
|
<AdminPrimaryLink
|
||||||
|
onClick={() => navigate('/users', { state: { openUserId: String(detail.user!.id) } })}
|
||||||
|
>
|
||||||
|
{detail.user?.userNo}
|
||||||
|
</AdminPrimaryLink>
|
||||||
|
) : (
|
||||||
|
(detail.user?.userNo ?? '—')
|
||||||
|
)}
|
||||||
|
</Descriptions.Item>
|
||||||
<Descriptions.Item label="手机号">{detail.user?.phone ?? '—'}</Descriptions.Item>
|
<Descriptions.Item label="手机号">{detail.user?.phone ?? '—'}</Descriptions.Item>
|
||||||
<Descriptions.Item label="关联订单">{detail.order?.orderNo ?? '—'}</Descriptions.Item>
|
<Descriptions.Item label="关联订单">
|
||||||
|
{detail.order?.orderNo ? (
|
||||||
|
<AdminPrimaryLink
|
||||||
|
onClick={() =>
|
||||||
|
navigate(`/orders?orderNo=${encodeURIComponent(detail.order!.orderNo!)}`)
|
||||||
|
}
|
||||||
|
>
|
||||||
|
{detail.order.orderNo}
|
||||||
|
</AdminPrimaryLink>
|
||||||
|
) : (
|
||||||
|
'—'
|
||||||
|
)}
|
||||||
|
</Descriptions.Item>
|
||||||
<Descriptions.Item label="总额">¥{Number(detail.totalAmount).toFixed(2)}</Descriptions.Item>
|
<Descriptions.Item label="总额">¥{Number(detail.totalAmount).toFixed(2)}</Descriptions.Item>
|
||||||
<Descriptions.Item label="余额">¥{Number(detail.balance).toFixed(2)}</Descriptions.Item>
|
<Descriptions.Item label="余额">¥{Number(detail.balance).toFixed(2)}</Descriptions.Item>
|
||||||
<Descriptions.Item label="状态">
|
<Descriptions.Item label="状态">
|
||||||
{COUPON_STATUS_LABELS[detail.status] || detail.status}
|
{COUPON_STATUS_LABELS[detail.status] || detail.status}
|
||||||
</Descriptions.Item>
|
</Descriptions.Item>
|
||||||
<Descriptions.Item label="来源">{detail.sourceProduct}</Descriptions.Item>
|
<Descriptions.Item label="来源">{formatCouponSource(detail)}</Descriptions.Item>
|
||||||
</Descriptions>
|
</Descriptions>
|
||||||
|
|
||||||
<Typography.Title level={5} style={{ marginTop: 16, marginBottom: 8 }}>
|
<Typography.Title level={5} style={{ marginTop: 16, marginBottom: 8 }}>
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ import { useAdminList } from '../lib/useAdminList';
|
|||||||
import CityPartnersPanel from '../components/CityPartnersPanel';
|
import CityPartnersPanel from '../components/CityPartnersPanel';
|
||||||
import ChinaProvinceCityCascader from '../components/ChinaProvinceCityCascader';
|
import ChinaProvinceCityCascader from '../components/ChinaProvinceCityCascader';
|
||||||
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
||||||
|
import { AdminPrimaryLink } from '../components/AdminPrimaryLink';
|
||||||
|
|
||||||
|
|
||||||
type WarehouseRow = {
|
type WarehouseRow = {
|
||||||
@@ -227,7 +228,14 @@ export default function CitiesPage() {
|
|||||||
|
|
||||||
const baseColumns: ColumnsType<Row> = [
|
const baseColumns: ColumnsType<Row> = [
|
||||||
{ title: '编码', dataIndex: 'code', width: 90 },
|
{ title: '编码', dataIndex: 'code', width: 90 },
|
||||||
{ title: '城市', dataIndex: 'name', width: 100 },
|
{
|
||||||
|
title: '城市',
|
||||||
|
dataIndex: 'name',
|
||||||
|
width: 100,
|
||||||
|
render: (v, row) => (
|
||||||
|
<AdminPrimaryLink onClick={() => void openDetail(row)}>{v}</AdminPrimaryLink>
|
||||||
|
),
|
||||||
|
},
|
||||||
{ title: '省份', dataIndex: 'province', width: 90 },
|
{ title: '省份', dataIndex: 'province', width: 90 },
|
||||||
{ title: '状态', dataIndex: 'status', width: 90, render: (s) => <Tag>{CITY_STATUS_LABELS[s] || s}</Tag> },
|
{ title: '状态', dataIndex: 'status', width: 90, render: (s) => <Tag>{CITY_STATUS_LABELS[s] || s}</Tag> },
|
||||||
{ title: '合伙人', dataIndex: 'partnerBindingCount', width: 90 },
|
{ title: '合伙人', dataIndex: 'partnerBindingCount', width: 90 },
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ import { useAdminList } from '../lib/useAdminList';
|
|||||||
import CityDistrictMultiSelect from '../components/CityDistrictMultiSelect';
|
import CityDistrictMultiSelect from '../components/CityDistrictMultiSelect';
|
||||||
import PartnerSubAccountList, { type PartnerSubAccountRow } from '../components/PartnerSubAccountList';
|
import PartnerSubAccountList, { type PartnerSubAccountRow } from '../components/PartnerSubAccountList';
|
||||||
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
||||||
|
import { AdminPrimaryLink } from '../components/AdminPrimaryLink';
|
||||||
|
|
||||||
|
|
||||||
type SubRow = PartnerSubAccountRow;
|
type SubRow = PartnerSubAccountRow;
|
||||||
@@ -272,7 +273,14 @@ export default function CityPartnersPage() {
|
|||||||
render: (codes: string[] | null | undefined, row) =>
|
render: (codes: string[] | null | undefined, row) =>
|
||||||
row.scopeType === CityPartnerScopeType.CITY_WIDE ? '全城' : formatDistrictLabels(codes),
|
row.scopeType === CityPartnerScopeType.CITY_WIDE ? '全城' : formatDistrictLabels(codes),
|
||||||
},
|
},
|
||||||
},
|
{
|
||||||
|
title: '公司名',
|
||||||
|
dataIndex: 'companyName',
|
||||||
|
width: 140,
|
||||||
|
render: (v, row) => (
|
||||||
|
<AdminPrimaryLink onClick={() => void openPartner(row.id)}>{v}</AdminPrimaryLink>
|
||||||
|
),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: '主账号姓名',
|
title: '主账号姓名',
|
||||||
dataIndex: 'name',
|
dataIndex: 'name',
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ import { request, type Paginated } from '../lib/api';
|
|||||||
import { ADMIN_OPTIONS_PAGE_SIZE, fmtTime } from '../lib/constants';
|
import { ADMIN_OPTIONS_PAGE_SIZE, fmtTime } from '../lib/constants';
|
||||||
import { useAdminList } from '../lib/useAdminList';
|
import { useAdminList } from '../lib/useAdminList';
|
||||||
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
||||||
|
import { AdminPrimaryLink } from '../components/AdminPrimaryLink';
|
||||||
|
|
||||||
|
|
||||||
type Row = {
|
type Row = {
|
||||||
@@ -232,7 +233,14 @@ export default function CityWarehousesPage() {
|
|||||||
</span>
|
</span>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{ title: '仓库', dataIndex: 'name', width: 140 },
|
{
|
||||||
|
title: '仓库',
|
||||||
|
dataIndex: 'name',
|
||||||
|
width: 140,
|
||||||
|
render: (v, row) => (
|
||||||
|
<AdminPrimaryLink onClick={() => void openEdit(row)}>{v}</AdminPrimaryLink>
|
||||||
|
),
|
||||||
|
},
|
||||||
{ title: '地址', dataIndex: 'address', width: 180 },
|
{ title: '地址', dataIndex: 'address', width: 180 },
|
||||||
{ title: '联系人', dataIndex: 'contactName', width: 90 },
|
{ title: '联系人', dataIndex: 'contactName', width: 90 },
|
||||||
{ title: '电话', dataIndex: 'contactPhone', width: 120 },
|
{ title: '电话', dataIndex: 'contactPhone', width: 120 },
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import { request } from '../lib/api';
|
|||||||
import { ORDER_STATUS_LABELS, fmtTime } from '../lib/constants';
|
import { ORDER_STATUS_LABELS, fmtTime } from '../lib/constants';
|
||||||
import { useAdminList } from '../lib/useAdminList';
|
import { useAdminList } from '../lib/useAdminList';
|
||||||
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
||||||
|
import { AdminPrimaryLink } from '../components/AdminPrimaryLink';
|
||||||
|
|
||||||
|
|
||||||
type Row = {
|
type Row = {
|
||||||
@@ -62,7 +63,23 @@ export default function DeliveriesPage() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const baseColumns: ColumnsType<Row> = [
|
const baseColumns: ColumnsType<Row> = [
|
||||||
{ title: '订单号', dataIndex: ['order', 'orderNo'], width: 170 },
|
{
|
||||||
|
title: '订单号',
|
||||||
|
dataIndex: ['order', 'orderNo'],
|
||||||
|
width: 170,
|
||||||
|
render: (v, row) => (
|
||||||
|
<AdminPrimaryLink
|
||||||
|
onClick={async () => {
|
||||||
|
const d = await request<Row>(`/admin/deliveries/${row.id}`);
|
||||||
|
setDetail(d);
|
||||||
|
editForm.setFieldsValue({ provider: d.provider, trackingNo: d.trackingNo, providerOrderNo: d.providerOrderNo });
|
||||||
|
setDrawerOpen(true);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{v}
|
||||||
|
</AdminPrimaryLink>
|
||||||
|
),
|
||||||
|
},
|
||||||
{ title: 'provider', dataIndex: 'provider', width: 90 },
|
{ title: 'provider', dataIndex: 'provider', width: 90 },
|
||||||
{ title: '运单号', dataIndex: 'trackingNo', width: 140, render: (v) => v || '—' },
|
{ title: '运单号', dataIndex: 'trackingNo', width: 140, render: (v) => v || '—' },
|
||||||
{ title: '第三方单号', dataIndex: 'providerOrderNo', width: 140, render: (v) => v || '—' },
|
{ title: '第三方单号', dataIndex: 'providerOrderNo', width: 140, render: (v) => v || '—' },
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ import { downloadBase64File } from '../lib/exportExcel';
|
|||||||
import { useAdminList } from '../lib/useAdminList';
|
import { useAdminList } from '../lib/useAdminList';
|
||||||
import OssUpload from '../components/OssUpload';
|
import OssUpload from '../components/OssUpload';
|
||||||
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
||||||
|
import { AdminPrimaryLink } from '../components/AdminPrimaryLink';
|
||||||
|
|
||||||
|
|
||||||
const TYPE_OPTIONS = (Object.keys(DEV_PLAN_TASK_TYPE_LABELS) as DevPlanTaskTypeDto[]).map((v) => ({
|
const TYPE_OPTIONS = (Object.keys(DEV_PLAN_TASK_TYPE_LABELS) as DevPlanTaskTypeDto[]).map((v) => ({
|
||||||
@@ -243,7 +244,14 @@ export default function DevPlanTasksPage() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const baseColumns: ColumnsType<DevPlanTaskDto> = [
|
const baseColumns: ColumnsType<DevPlanTaskDto> = [
|
||||||
{ title: '任务号', dataIndex: 'taskNo', width: 160 },
|
{
|
||||||
|
title: '任务号',
|
||||||
|
dataIndex: 'taskNo',
|
||||||
|
width: 160,
|
||||||
|
render: (v, row) => (
|
||||||
|
<AdminPrimaryLink onClick={() => openEdit(row)}>{v}</AdminPrimaryLink>
|
||||||
|
),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: '类型',
|
title: '类型',
|
||||||
dataIndex: 'type',
|
dataIndex: 'type',
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ import { request } from '../lib/api';
|
|||||||
import { fmtTime } from '../lib/constants';
|
import { fmtTime } from '../lib/constants';
|
||||||
import { useAdminList } from '../lib/useAdminList';
|
import { useAdminList } from '../lib/useAdminList';
|
||||||
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
||||||
|
import { AdminPrimaryLink } from '../components/AdminPrimaryLink';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -122,7 +123,9 @@ export default function DevPlanVersionsPage() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const baseColumns: ColumnsType<DevPlanVersionDto> = [
|
const baseColumns: ColumnsType<DevPlanVersionDto> = [
|
||||||
{ title: '版本号', dataIndex: 'versionNo', width: 120 },
|
{ title: '版本号', dataIndex: 'versionNo', width: 120, render: (v, row) => (
|
||||||
|
<AdminPrimaryLink onClick={() => void openEdit(row)}>{v}</AdminPrimaryLink>
|
||||||
|
) },
|
||||||
{
|
{
|
||||||
title: '状态',
|
title: '状态',
|
||||||
dataIndex: 'status',
|
dataIndex: 'status',
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import type { ColumnsType } from 'antd/es/table';
|
|||||||
import { request } from '../lib/api';
|
import { request } from '../lib/api';
|
||||||
import { fmtTime } from '../lib/constants';
|
import { fmtTime } from '../lib/constants';
|
||||||
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
||||||
|
import { AdminPrimaryLink } from '../components/AdminPrimaryLink';
|
||||||
|
|
||||||
|
|
||||||
type Row = {
|
type Row = {
|
||||||
@@ -59,7 +60,20 @@ export default function DomainEventsPage() {
|
|||||||
|
|
||||||
const baseColumns: ColumnsType<Row> = [
|
const baseColumns: ColumnsType<Row> = [
|
||||||
{ title: '时间', dataIndex: 'createdAt', width: 170, render: (v) => fmtTime(v) },
|
{ title: '时间', dataIndex: 'createdAt', width: 170, render: (v) => fmtTime(v) },
|
||||||
{ title: '类型', dataIndex: 'eventType', width: 130, render: (v) => <Tag>{v}</Tag> },
|
{
|
||||||
|
title: '类型',
|
||||||
|
dataIndex: 'eventType',
|
||||||
|
width: 130,
|
||||||
|
render: (v, r) => (
|
||||||
|
<AdminPrimaryLink
|
||||||
|
onClick={async () => {
|
||||||
|
setDetail(await request<Row>(`/admin/logs/domain-events/${r.id}`));
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Tag>{v}</Tag>
|
||||||
|
</AdminPrimaryLink>
|
||||||
|
),
|
||||||
|
},
|
||||||
{ title: '关联', render: (_, r) => `${r.refType} #${r.refId}` },
|
{ title: '关联', render: (_, r) => `${r.refType} #${r.refId}` },
|
||||||
{ title: '状态', dataIndex: 'status', width: 100 },
|
{ title: '状态', dataIndex: 'status', width: 100 },
|
||||||
{ title: '摘要', render: (_, r) => r.param1 || r.remark || '—' },
|
{ title: '摘要', render: (_, r) => r.param1 || r.remark || '—' },
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ import {
|
|||||||
import { request } from '../lib/api';
|
import { request } from '../lib/api';
|
||||||
import { fmtTime } from '../lib/constants';
|
import { fmtTime } from '../lib/constants';
|
||||||
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
||||||
|
import { AdminPrimaryLink } from '../components/AdminPrimaryLink';
|
||||||
|
|
||||||
|
|
||||||
const TYPE_OPTIONS = Object.entries(FULFILLMENT_PROVIDER_TYPE_LABELS).map(([value, label]) => ({
|
const TYPE_OPTIONS = Object.entries(FULFILLMENT_PROVIDER_TYPE_LABELS).map(([value, label]) => ({
|
||||||
@@ -177,7 +178,13 @@ export default function FulfillmentProvidersPage() {
|
|||||||
|
|
||||||
const baseColumns: ColumnsType<FulfillmentProviderDto> = [
|
const baseColumns: ColumnsType<FulfillmentProviderDto> = [
|
||||||
{ title: '编码', dataIndex: 'code', width: 100 },
|
{ title: '编码', dataIndex: 'code', width: 100 },
|
||||||
{ title: '名称', dataIndex: 'name' },
|
{
|
||||||
|
title: '名称',
|
||||||
|
dataIndex: 'name',
|
||||||
|
render: (v, row) => (
|
||||||
|
<AdminPrimaryLink onClick={() => openEdit(row)}>{v}</AdminPrimaryLink>
|
||||||
|
),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: '类型',
|
title: '类型',
|
||||||
dataIndex: 'type',
|
dataIndex: 'type',
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import { request, type HqProfile, type Paginated } from '../lib/api';
|
|||||||
import { ACCOUNT_STATUS_LABELS, ADMIN_OPTIONS_PAGE_SIZE, fmtTime } from '../lib/constants';
|
import { ACCOUNT_STATUS_LABELS, ADMIN_OPTIONS_PAGE_SIZE, fmtTime } from '../lib/constants';
|
||||||
import { useAdminList } from '../lib/useAdminList';
|
import { useAdminList } from '../lib/useAdminList';
|
||||||
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
||||||
|
import { AdminPrimaryLink } from '../components/AdminPrimaryLink';
|
||||||
|
|
||||||
|
|
||||||
type Row = {
|
type Row = {
|
||||||
@@ -69,7 +70,31 @@ export default function HqAccountsPage() {
|
|||||||
const cityOptions = cities.map((c) => ({ value: c.id, label: c.name }));
|
const cityOptions = cities.map((c) => ({ value: c.id, label: c.name }));
|
||||||
|
|
||||||
const baseColumns: ColumnsType<Row> = [
|
const baseColumns: ColumnsType<Row> = [
|
||||||
{ title: '姓名', dataIndex: 'name' },
|
{
|
||||||
|
title: '姓名',
|
||||||
|
dataIndex: 'name',
|
||||||
|
render: (v, row) =>
|
||||||
|
isSuperAdmin ? (
|
||||||
|
<AdminPrimaryLink
|
||||||
|
onClick={() => {
|
||||||
|
setDetail(row);
|
||||||
|
editForm.setFieldsValue({
|
||||||
|
name: row.name,
|
||||||
|
phone: row.phone,
|
||||||
|
loginName: row.loginName,
|
||||||
|
adminRole: row.adminRole,
|
||||||
|
status: row.status,
|
||||||
|
cityIds: row.cityIds ?? [],
|
||||||
|
});
|
||||||
|
setDrawerOpen(true);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{v}
|
||||||
|
</AdminPrimaryLink>
|
||||||
|
) : (
|
||||||
|
v
|
||||||
|
),
|
||||||
|
},
|
||||||
{ title: '用户名', dataIndex: 'loginName', width: 120, render: (v) => v || '—' },
|
{ title: '用户名', dataIndex: 'loginName', width: 120, render: (v) => v || '—' },
|
||||||
{ title: '手机', dataIndex: 'phone', width: 130 },
|
{ title: '手机', dataIndex: 'phone', width: 130 },
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import { fmtTime } from '../lib/constants';
|
|||||||
import { HQ_OPERATION_ACTION_OPTIONS, resolveHqOperationLabel } from '../lib/hq-log';
|
import { HQ_OPERATION_ACTION_OPTIONS, resolveHqOperationLabel } from '../lib/hq-log';
|
||||||
import { useAdminList } from '../lib/useAdminList';
|
import { useAdminList } from '../lib/useAdminList';
|
||||||
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
||||||
|
import { AdminPrimaryLink } from '../components/AdminPrimaryLink';
|
||||||
|
|
||||||
|
|
||||||
type Row = {
|
type Row = {
|
||||||
@@ -70,7 +71,17 @@ export default function HqLogsPage() {
|
|||||||
title: '行为',
|
title: '行为',
|
||||||
dataIndex: 'actionLabel',
|
dataIndex: 'actionLabel',
|
||||||
width: 160,
|
width: 160,
|
||||||
width: 160,
|
render: (v, r) => (
|
||||||
|
<AdminPrimaryLink
|
||||||
|
onClick={async () => {
|
||||||
|
const res = await request<Row>(`/admin/logs/hq/${r.id}`);
|
||||||
|
setDetail(res);
|
||||||
|
setDrawerOpen(true);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Tag color="blue">{v || resolveHqOperationLabel(r.action)}</Tag>
|
||||||
|
</AdminPrimaryLink>
|
||||||
|
),
|
||||||
},
|
},
|
||||||
{ title: '对象类型', dataIndex: 'refType', width: 120, render: (v) => v || '—' },
|
{ title: '对象类型', dataIndex: 'refType', width: 120, render: (v) => v || '—' },
|
||||||
{ title: '对象 ID', dataIndex: 'refId', width: 100, render: (v) => v || '—' },
|
{ title: '对象 ID', dataIndex: 'refId', width: 100, render: (v) => v || '—' },
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ import { fmtTime } from '../lib/constants';
|
|||||||
import { useAdminList } from '../lib/useAdminList';
|
import { useAdminList } from '../lib/useAdminList';
|
||||||
import { uploadFileToOss } from '../lib/upload';
|
import { uploadFileToOss } from '../lib/upload';
|
||||||
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
||||||
|
import { AdminPrimaryLink } from '../components/AdminPrimaryLink';
|
||||||
|
|
||||||
|
|
||||||
type Row = {
|
type Row = {
|
||||||
@@ -204,7 +205,13 @@ export default function InvoicesPage() {
|
|||||||
? INVOICE_CATEGORY_LABELS[r.invoiceCategory] ?? r.invoiceCategory
|
? INVOICE_CATEGORY_LABELS[r.invoiceCategory] ?? r.invoiceCategory
|
||||||
: '—',
|
: '—',
|
||||||
},
|
},
|
||||||
{ title: '名称', dataIndex: 'titleName' },
|
{
|
||||||
|
title: '名称',
|
||||||
|
dataIndex: 'titleName',
|
||||||
|
render: (v, row) => (
|
||||||
|
<AdminPrimaryLink onClick={() => openDetail(row.id)}>{v}</AdminPrimaryLink>
|
||||||
|
),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: '状态',
|
title: '状态',
|
||||||
width: 110,
|
width: 110,
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ import { fmtTime } from '../lib/constants';
|
|||||||
import { useAdminList } from '../lib/useAdminList';
|
import { useAdminList } from '../lib/useAdminList';
|
||||||
import { uploadFileToOss } from '../lib/upload';
|
import { uploadFileToOss } from '../lib/upload';
|
||||||
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
||||||
|
import { AdminPrimaryLink } from '../components/AdminPrimaryLink';
|
||||||
|
|
||||||
|
|
||||||
type FormValues = {
|
type FormValues = {
|
||||||
@@ -127,7 +128,13 @@ export default function KnowledgeBasesPage() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const baseColumns: ColumnsType<KnowledgeBaseDto> = [
|
const baseColumns: ColumnsType<KnowledgeBaseDto> = [
|
||||||
{ title: '名称', dataIndex: 'name' },
|
{
|
||||||
|
title: '名称',
|
||||||
|
dataIndex: 'name',
|
||||||
|
render: (v, row) => (
|
||||||
|
<AdminPrimaryLink onClick={() => openEdit(row)}>{v}</AdminPrimaryLink>
|
||||||
|
),
|
||||||
|
},
|
||||||
{ title: '说明', dataIndex: 'description' },
|
{ title: '说明', dataIndex: 'description' },
|
||||||
{ title: '文档数', dataIndex: 'documentCount', width: 90 },
|
{ title: '文档数', dataIndex: 'documentCount', width: 90 },
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ import { request } from '../lib/api';
|
|||||||
import { fmtTime } from '../lib/constants';
|
import { fmtTime } from '../lib/constants';
|
||||||
import { useAdminList } from '../lib/useAdminList';
|
import { useAdminList } from '../lib/useAdminList';
|
||||||
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
||||||
|
import { AdminPrimaryLink } from '../components/AdminPrimaryLink';
|
||||||
|
|
||||||
|
|
||||||
type FormValues = {
|
type FormValues = {
|
||||||
@@ -156,7 +157,13 @@ export default function LlmConfigsPage() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const baseColumns: ColumnsType<LlmApiConfigDto> = [
|
const baseColumns: ColumnsType<LlmApiConfigDto> = [
|
||||||
{ title: '名称', dataIndex: 'name' },
|
{
|
||||||
|
title: '名称',
|
||||||
|
dataIndex: 'name',
|
||||||
|
render: (v, row) => (
|
||||||
|
<AdminPrimaryLink onClick={() => openEdit(row)}>{v}</AdminPrimaryLink>
|
||||||
|
),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: '提供商',
|
title: '提供商',
|
||||||
dataIndex: 'provider',
|
dataIndex: 'provider',
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ import { downloadExcelCsv } from '../lib/exportExcel';
|
|||||||
import { request } from '../lib/api';
|
import { request } from '../lib/api';
|
||||||
import { useAdminList } from '../lib/useAdminList';
|
import { useAdminList } from '../lib/useAdminList';
|
||||||
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
||||||
|
import { AdminPrimaryLink } from '../components/AdminPrimaryLink';
|
||||||
|
|
||||||
type BillRow = {
|
type BillRow = {
|
||||||
id: string;
|
id: string;
|
||||||
@@ -246,7 +247,14 @@ export default function LogisticsBillsPage() {
|
|||||||
const selectedAmount = selectedRows.reduce((s, r) => s + Number(r.logisticsAmount), 0);
|
const selectedAmount = selectedRows.reduce((s, r) => s + Number(r.logisticsAmount), 0);
|
||||||
|
|
||||||
const billColumns: ColumnsType<BillRow> = [
|
const billColumns: ColumnsType<BillRow> = [
|
||||||
{ title: '账单号', dataIndex: 'billNo', width: 170 },
|
{
|
||||||
|
title: '账单号',
|
||||||
|
dataIndex: 'billNo',
|
||||||
|
width: 170,
|
||||||
|
render: (v, row) => (
|
||||||
|
<AdminPrimaryLink onClick={() => void openDetail(row.id)}>{v}</AdminPrimaryLink>
|
||||||
|
),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: '承运商',
|
title: '承运商',
|
||||||
width: 140,
|
width: 140,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
||||||
import { Link, useSearchParams } from 'react-router-dom';
|
import { Link, useNavigate, useSearchParams } from 'react-router-dom';
|
||||||
import {
|
import {
|
||||||
Alert,
|
Alert,
|
||||||
Button,
|
Button,
|
||||||
@@ -27,10 +27,12 @@ import dayjs, { type Dayjs } from 'dayjs';
|
|||||||
import { ORDER_TYPE_LABELS } from '@dukang/shared-types';
|
import { ORDER_TYPE_LABELS } from '@dukang/shared-types';
|
||||||
import { request, type AdminOrderItem, type AdminOrderRow, type HqProfile, type Paginated } from '../lib/api';
|
import { request, type AdminOrderItem, type AdminOrderRow, type HqProfile, type Paginated } from '../lib/api';
|
||||||
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
||||||
|
import { AdminPrimaryLink } from '../components/AdminPrimaryLink';
|
||||||
import { downloadBase64File } from '../lib/exportExcel';
|
import { downloadBase64File } from '../lib/exportExcel';
|
||||||
import {
|
import {
|
||||||
ADMIN_OPTIONS_PAGE_SIZE,
|
ADMIN_OPTIONS_PAGE_SIZE,
|
||||||
DELIVERY_PROVIDER_LABELS,
|
DELIVERY_PROVIDER_LABELS,
|
||||||
|
DELIVERY_TYPE_LABELS,
|
||||||
ORDER_STATUS_COLORS,
|
ORDER_STATUS_COLORS,
|
||||||
ORDER_STATUS_LABELS,
|
ORDER_STATUS_LABELS,
|
||||||
ORDER_STATUS_OPERATOR_LABELS,
|
ORDER_STATUS_OPERATOR_LABELS,
|
||||||
@@ -273,6 +275,7 @@ function warehouseToDefaults(wh: WarehouseOption, base?: ShipDefaults | null): S
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default function OrdersPage() {
|
export default function OrdersPage() {
|
||||||
|
const navigate = useNavigate();
|
||||||
const [searchParams] = useSearchParams();
|
const [searchParams] = useSearchParams();
|
||||||
const initialOrderNo = searchParams.get('orderNo')?.trim() || '';
|
const initialOrderNo = searchParams.get('orderNo')?.trim() || '';
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
@@ -592,64 +595,99 @@ export default function OrdersPage() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const baseColumns: ColumnsType<AdminOrderRow> = [
|
const baseColumns: ColumnsType<AdminOrderRow> = [
|
||||||
|
{
|
||||||
|
title: '订单号',
|
||||||
|
dataIndex: 'orderNo',
|
||||||
|
width: 180,
|
||||||
|
render: (v, row) => (
|
||||||
|
<Space size={4}>
|
||||||
|
<AdminPrimaryLink onClick={() => openDetail(row.id)}>{v}</AdminPrimaryLink>
|
||||||
|
{row.isTest ? <Tag color="orange">测试</Tag> : null}
|
||||||
|
</Space>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '用户',
|
||||||
|
key: 'user',
|
||||||
|
width: 120,
|
||||||
|
render: (_, row) =>
|
||||||
|
row.user?.id ? (
|
||||||
|
<AdminPrimaryLink onClick={() => navigate('/users', { state: { openUserId: String(row.user!.id) } })}>
|
||||||
|
{row.user.userNo}
|
||||||
|
</AdminPrimaryLink>
|
||||||
|
) : (
|
||||||
|
(row.user?.userNo || '—')
|
||||||
|
),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: '商品',
|
title: '商品',
|
||||||
width: 240,
|
key: 'productName',
|
||||||
|
width: 180,
|
||||||
render: (_, row) => (
|
render: (_, row) => (
|
||||||
<div>
|
|
||||||
<Space size={4} wrap>
|
<Space size={4} wrap>
|
||||||
<span>{row.productName || '—'}</span>
|
<span>{row.productName || '—'}</span>
|
||||||
{row.isTest ? <Tag color="orange">测试</Tag> : null}
|
|
||||||
{row.fulfillmentHold ? <Tag color="orange">大单</Tag> : null}
|
{row.fulfillmentHold ? <Tag color="orange">大单</Tag> : null}
|
||||||
{row.orderType === 'PROXY' || row.isProxyOrder ? (
|
{row.orderType === 'PROXY' || row.isProxyOrder ? (
|
||||||
<Tag color="purple">代下单</Tag>
|
<Tag color="purple">代下单</Tag>
|
||||||
) : null}
|
) : null}
|
||||||
</Space>
|
</Space>
|
||||||
<div>
|
|
||||||
<Typography.Text type="secondary" style={{ fontSize: 12 }}>
|
|
||||||
{[row.productSpec, row.quantity != null ? `×${row.quantity}` : null]
|
|
||||||
.filter(Boolean)
|
|
||||||
.join(' ')}
|
|
||||||
</Typography.Text>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '状态 / 实付',
|
title: '规格',
|
||||||
width: 130,
|
dataIndex: 'productSpec',
|
||||||
render: (_, row) => (
|
width: 140,
|
||||||
<div>
|
render: (v: string | undefined) => v || '—',
|
||||||
<Tag color={ORDER_STATUS_COLORS[row.status] || 'default'}>
|
},
|
||||||
{ORDER_STATUS_LABELS[row.status] || row.status}
|
{
|
||||||
</Tag>
|
title: '数量',
|
||||||
<div>¥{row.payAmount}</div>
|
dataIndex: 'quantity',
|
||||||
</div>
|
width: 80,
|
||||||
|
render: (v: number | undefined, row) =>
|
||||||
|
v == null ? '—' : `${v}${row.saleUnit === 'BOX' ? '箱' : '瓶'}`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '配送方式',
|
||||||
|
dataIndex: 'deliveryType',
|
||||||
|
width: 100,
|
||||||
|
render: (v: string | undefined) => DELIVERY_TYPE_LABELS[v ?? ''] || v || '—',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '状态',
|
||||||
|
dataIndex: 'status',
|
||||||
|
width: 100,
|
||||||
|
render: (s: string) => (
|
||||||
|
<Tag color={ORDER_STATUS_COLORS[s] || 'default'}>{ORDER_STATUS_LABELS[s] || s}</Tag>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: '实付',
|
||||||
|
dataIndex: 'payAmount',
|
||||||
|
width: 90,
|
||||||
|
render: (v: number) => `¥${v}`,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: '好客权益',
|
title: '好客权益',
|
||||||
width: 200,
|
width: 200,
|
||||||
render: (_, row) => formatBenefitBrief(row),
|
render: (_, row) => formatBenefitBrief(row),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '收货信息',
|
title: '收货人',
|
||||||
width: 240,
|
dataIndex: 'receiverName',
|
||||||
render: (_, row) => {
|
width: 90,
|
||||||
const address = formatReceiverAddress(row);
|
render: (v: string | undefined) => v || '—',
|
||||||
return (
|
|
||||||
<div>
|
|
||||||
<div>
|
|
||||||
{row.receiverName || '—'} {row.receiverPhone || ''}
|
|
||||||
</div>
|
|
||||||
{address ? (
|
|
||||||
<Typography.Text type="secondary" style={{ fontSize: 12 }}>
|
|
||||||
{address}
|
|
||||||
</Typography.Text>
|
|
||||||
) : null}
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: '电话',
|
||||||
|
dataIndex: 'receiverPhone',
|
||||||
|
width: 120,
|
||||||
|
render: (v: string | undefined) => v || '—',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '地址',
|
||||||
|
key: 'receiverAddress',
|
||||||
|
width: 260,
|
||||||
|
render: (_, row) => formatReceiverAddress(row) || '—',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '下单时间',
|
title: '下单时间',
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import {
|
|||||||
import type { ColumnsType } from 'antd/es/table';
|
import type { ColumnsType } from 'antd/es/table';
|
||||||
import { PARTNER_PERMISSION_KEYS, PARTNER_PERMISSION_LABELS, PARTNER_STAFF_ROLE_LABELS, type PartnerPermissionKey } from '@dukang/shared-types';
|
import { PARTNER_PERMISSION_KEYS, PARTNER_PERMISSION_LABELS, PARTNER_STAFF_ROLE_LABELS, type PartnerPermissionKey } from '@dukang/shared-types';
|
||||||
import { request, type Paginated } from '../lib/api';
|
import { request, type Paginated } from '../lib/api';
|
||||||
import { AdminCellLine } from '../components/AdminCellLine';
|
import { AdminPrimaryLink } from '../components/AdminPrimaryLink';
|
||||||
import { ACCOUNT_STATUS_LABELS, ADMIN_OPTIONS_PAGE_SIZE, ORDER_STATUS_LABELS, PARTNER_BILL_STATUS_LABELS, fmtTime } from '../lib/constants';
|
import { ACCOUNT_STATUS_LABELS, ADMIN_OPTIONS_PAGE_SIZE, ORDER_STATUS_LABELS, PARTNER_BILL_STATUS_LABELS, fmtTime } from '../lib/constants';
|
||||||
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
||||||
|
|
||||||
@@ -176,14 +176,13 @@ export default function PartnerAccountsPage() {
|
|||||||
title: '姓名 / 类型',
|
title: '姓名 / 类型',
|
||||||
width: 200,
|
width: 200,
|
||||||
render: (_, row) => (
|
render: (_, row) => (
|
||||||
<AdminCellLine
|
<span className="admin-cell-line">
|
||||||
primary={row.name}
|
<AdminPrimaryLink onClick={() => void openAccount(row.id)}>{row.name}</AdminPrimaryLink>
|
||||||
secondary={
|
<span className="admin-cell-line-secondary">
|
||||||
row.parentAccountId
|
{' · '}
|
||||||
? `子账号 · ${staffRoleLabel(row.staffRole)}`
|
{row.parentAccountId ? `子账号 · ${staffRoleLabel(row.staffRole)}` : '主账号'}
|
||||||
: '主账号'
|
</span>
|
||||||
}
|
</span>
|
||||||
/>
|
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{ title: '手机', dataIndex: 'phone', width: 120 },
|
{ title: '手机', dataIndex: 'phone', width: 120 },
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ import { ADMIN_OPTIONS_PAGE_SIZE, fmtTime } from '../lib/constants';
|
|||||||
import { downloadExcelCsv } from '../lib/exportExcel';
|
import { downloadExcelCsv } from '../lib/exportExcel';
|
||||||
import { useAdminList } from '../lib/useAdminList';
|
import { useAdminList } from '../lib/useAdminList';
|
||||||
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
||||||
|
import { AdminPrimaryLink } from '../components/AdminPrimaryLink';
|
||||||
|
|
||||||
|
|
||||||
type Row = {
|
type Row = {
|
||||||
@@ -247,7 +248,14 @@ export default function PartnerBillsPage() {
|
|||||||
const payAmount = canPay.reduce((s, r) => s + Number(r.totalAmount), 0);
|
const payAmount = canPay.reduce((s, r) => s + Number(r.totalAmount), 0);
|
||||||
|
|
||||||
const baseColumns: ColumnsType<Row> = [
|
const baseColumns: ColumnsType<Row> = [
|
||||||
{ title: '账单号', dataIndex: 'billNo', width: 180 },
|
{
|
||||||
|
title: '账单号',
|
||||||
|
dataIndex: 'billNo',
|
||||||
|
width: 180,
|
||||||
|
render: (v, row) => (
|
||||||
|
<AdminPrimaryLink onClick={() => void openDetail(row.id)}>{v}</AdminPrimaryLink>
|
||||||
|
),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: '合伙人',
|
title: '合伙人',
|
||||||
width: 160,
|
width: 160,
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import { AdminCellLine } from '../components/AdminCellLine';
|
|||||||
import { fmtTime } from '../lib/constants';
|
import { fmtTime } from '../lib/constants';
|
||||||
import { useAdminList } from '../lib/useAdminList';
|
import { useAdminList } from '../lib/useAdminList';
|
||||||
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
||||||
|
import { AdminPrimaryLink } from '../components/AdminPrimaryLink';
|
||||||
|
|
||||||
|
|
||||||
type Row = {
|
type Row = {
|
||||||
@@ -108,7 +109,21 @@ export default function PartnerLogsPage() {
|
|||||||
<Tag>{PARTNER_LOG_CATEGORY_LABELS[v ?? ''] || resolvePartnerLogCategory(r.eventName) || '其他'}</Tag>
|
<Tag>{PARTNER_LOG_CATEGORY_LABELS[v ?? ''] || resolvePartnerLogCategory(r.eventName) || '其他'}</Tag>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
),
|
{
|
||||||
|
title: '事件',
|
||||||
|
dataIndex: 'eventName',
|
||||||
|
width: 180,
|
||||||
|
render: (v, row) => (
|
||||||
|
<AdminPrimaryLink
|
||||||
|
onClick={async () => {
|
||||||
|
setDetail(await request(`/admin/logs/partners/${row.id}`));
|
||||||
|
setDrawerOpen(true);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{v}
|
||||||
|
</AdminPrimaryLink>
|
||||||
|
),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: '关联',
|
title: '关联',
|
||||||
width: 120,
|
width: 120,
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ import { ADMIN_OPTIONS_PAGE_SIZE, fmtTime } from '../lib/constants';
|
|||||||
import { useAdminList } from '../lib/useAdminList';
|
import { useAdminList } from '../lib/useAdminList';
|
||||||
import CityDistrictMultiSelect from '../components/CityDistrictMultiSelect';
|
import CityDistrictMultiSelect from '../components/CityDistrictMultiSelect';
|
||||||
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
||||||
|
import { AdminPrimaryLink } from '../components/AdminPrimaryLink';
|
||||||
|
|
||||||
|
|
||||||
type Row = {
|
type Row = {
|
||||||
@@ -184,7 +185,13 @@ export default function PartnersPage() {
|
|||||||
render: (codes: string[] | null | undefined, row) =>
|
render: (codes: string[] | null | undefined, row) =>
|
||||||
row.scopeType === CityPartnerScopeType.CITY_WIDE ? '全城' : formatDistrictLabels(codes),
|
row.scopeType === CityPartnerScopeType.CITY_WIDE ? '全城' : formatDistrictLabels(codes),
|
||||||
},
|
},
|
||||||
},
|
{
|
||||||
|
title: '公司名',
|
||||||
|
dataIndex: 'companyName',
|
||||||
|
render: (v, row) => (
|
||||||
|
<AdminPrimaryLink onClick={() => void openPartner(row.id)}>{v}</AdminPrimaryLink>
|
||||||
|
),
|
||||||
|
},
|
||||||
{ title: '主账号', dataIndex: 'phone', width: 130 },
|
{ title: '主账号', dataIndex: 'phone', width: 130 },
|
||||||
{
|
{
|
||||||
title: '管辖',
|
title: '管辖',
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ import { request } from '../lib/api';
|
|||||||
import { fmtTime } from '../lib/constants';
|
import { fmtTime } from '../lib/constants';
|
||||||
import { useAdminList } from '../lib/useAdminList';
|
import { useAdminList } from '../lib/useAdminList';
|
||||||
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
||||||
|
import { AdminPrimaryLink } from '../components/AdminPrimaryLink';
|
||||||
|
|
||||||
|
|
||||||
const STATUS_COLOR: Record<RedeemPendingStatus, string> = {
|
const STATUS_COLOR: Record<RedeemPendingStatus, string> = {
|
||||||
@@ -97,7 +98,14 @@ export default function PendingRedeemPage() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const baseColumns: ColumnsType<RedeemPendingItem> = [
|
const baseColumns: ColumnsType<RedeemPendingItem> = [
|
||||||
{ title: '待处理单号', dataIndex: 'pendingNo', width: 170 },
|
{
|
||||||
|
title: '待处理单号',
|
||||||
|
dataIndex: 'pendingNo',
|
||||||
|
width: 170,
|
||||||
|
render: (v, row) => (
|
||||||
|
<AdminPrimaryLink onClick={() => void openDetail(row.id)}>{v}</AdminPrimaryLink>
|
||||||
|
),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: '核销码 ID',
|
title: '核销码 ID',
|
||||||
dataIndex: 'redeemToken',
|
dataIndex: 'redeemToken',
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import DetailImageUrlList from '../components/DetailImageUrlList';
|
|||||||
import type { ProductDetailTemplateDto } from '../lib/product-detail-templates';
|
import type { ProductDetailTemplateDto } from '../lib/product-detail-templates';
|
||||||
import { TEMPLATE_MAX_DETAIL_IMAGES } from '../lib/product-detail-templates';
|
import { TEMPLATE_MAX_DETAIL_IMAGES } from '../lib/product-detail-templates';
|
||||||
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
||||||
|
import { AdminPrimaryLink } from '../components/AdminPrimaryLink';
|
||||||
|
|
||||||
|
|
||||||
type Row = ProductDetailTemplateDto;
|
type Row = ProductDetailTemplateDto;
|
||||||
@@ -140,7 +141,23 @@ export default function ProductDetailTemplatesPage() {
|
|||||||
|
|
||||||
const baseColumns: ColumnsType<Row> = [
|
const baseColumns: ColumnsType<Row> = [
|
||||||
{ title: '编码', dataIndex: 'code', width: 120 },
|
{ title: '编码', dataIndex: 'code', width: 120 },
|
||||||
{ title: '名称', dataIndex: 'name', width: 120 },
|
{
|
||||||
|
title: '名称',
|
||||||
|
dataIndex: 'name',
|
||||||
|
width: 120,
|
||||||
|
render: (v, row) => (
|
||||||
|
<AdminPrimaryLink
|
||||||
|
onClick={async () => {
|
||||||
|
const d = await request<Record<string, unknown>>(`/admin/product-detail-templates/${row.id}`);
|
||||||
|
setDetail(d);
|
||||||
|
editForm.setFieldsValue(mapToForm(d));
|
||||||
|
setDrawerOpen(true);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{v}
|
||||||
|
</AdminPrimaryLink>
|
||||||
|
),
|
||||||
|
},
|
||||||
{ title: '说明', dataIndex: 'description', width: 200 },
|
{ title: '说明', dataIndex: 'description', width: 200 },
|
||||||
{ title: '香型', dataIndex: 'aromaType', width: 90, render: (v) => (v ? AROMA_TYPE_LABELS[v] || v : '—') },
|
{ title: '香型', dataIndex: 'aromaType', width: 90, render: (v) => (v ? AROMA_TYPE_LABELS[v] || v : '—') },
|
||||||
{ title: '详情图', dataIndex: 'detailImageUrls', width: 80, render: (v: string[] | undefined) => v?.length ?? 0 },
|
{ title: '详情图', dataIndex: 'detailImageUrls', width: 80, render: (v: string[] | undefined) => v?.length ?? 0 },
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import ProductDetailTemplatePicker from '../components/ProductDetailTemplatePick
|
|||||||
import ProductSpecsEditor from '../components/ProductSpecsEditor';
|
import ProductSpecsEditor from '../components/ProductSpecsEditor';
|
||||||
import type { FormInstance } from 'antd/es/form';
|
import type { FormInstance } from 'antd/es/form';
|
||||||
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
||||||
|
import { AdminPrimaryLink } from '../components/AdminPrimaryLink';
|
||||||
|
|
||||||
|
|
||||||
type ProductDetailContentDto = {
|
type ProductDetailContentDto = {
|
||||||
@@ -391,7 +392,14 @@ export default function ProductsPage() {
|
|||||||
|
|
||||||
const baseColumns: ColumnsType<Row> = useMemo(() => [
|
const baseColumns: ColumnsType<Row> = useMemo(() => [
|
||||||
{ title: '香型', dataIndex: 'aromaType', width: 80, render: (v) => AROMA_TYPE_LABELS[v] || v },
|
{ title: '香型', dataIndex: 'aromaType', width: 80, render: (v) => AROMA_TYPE_LABELS[v] || v },
|
||||||
{ title: '品名', dataIndex: 'name', width: 200 },
|
{ title: '品名', dataIndex: 'name', width: 200, render: (v, row) => (
|
||||||
|
<AdminPrimaryLink onClick={async () => {
|
||||||
|
const d = await request<Record<string, unknown>>(`/admin/products/${row.id}`);
|
||||||
|
setDetail(d);
|
||||||
|
editForm.setFieldsValue(mapDetailToForm(d));
|
||||||
|
setDrawerOpen(true);
|
||||||
|
}}>{v}</AdminPrimaryLink>
|
||||||
|
) },
|
||||||
{
|
{
|
||||||
title: '累计销售',
|
title: '累计销售',
|
||||||
dataIndex: 'soldBottles',
|
dataIndex: 'soldBottles',
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import { request } from '../lib/api';
|
|||||||
import { fmtTime } from '../lib/constants';
|
import { fmtTime } from '../lib/constants';
|
||||||
import { useAdminList } from '../lib/useAdminList';
|
import { useAdminList } from '../lib/useAdminList';
|
||||||
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
||||||
|
import { AdminPrimaryLink } from '../components/AdminPrimaryLink';
|
||||||
|
|
||||||
|
|
||||||
type Row = PromoCodeItem;
|
type Row = PromoCodeItem;
|
||||||
@@ -77,7 +78,14 @@ export default function PromoCodesPage() {
|
|||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const baseColumns: ColumnsType<Row> = [
|
const baseColumns: ColumnsType<Row> = [
|
||||||
{ title: '名称', dataIndex: 'name', width: 160 },
|
{
|
||||||
|
title: '名称',
|
||||||
|
dataIndex: 'name',
|
||||||
|
width: 160,
|
||||||
|
render: (v, row) => (
|
||||||
|
<AdminPrimaryLink onClick={() => navigate(`/promo-codes/${row.id}`)}>{v}</AdminPrimaryLink>
|
||||||
|
),
|
||||||
|
},
|
||||||
{ title: '码值', dataIndex: 'code', width: 110 },
|
{ title: '码值', dataIndex: 'code', width: 110 },
|
||||||
{
|
{
|
||||||
title: '场景',
|
title: '场景',
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import { request } from '../lib/api';
|
|||||||
import { fmtTime } from '../lib/constants';
|
import { fmtTime } from '../lib/constants';
|
||||||
import { useAdminList } from '../lib/useAdminList';
|
import { useAdminList } from '../lib/useAdminList';
|
||||||
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
||||||
|
import { AdminPrimaryLink } from '../components/AdminPrimaryLink';
|
||||||
|
|
||||||
|
|
||||||
type Row = {
|
type Row = {
|
||||||
@@ -84,7 +85,7 @@ export default function RedeemRecordsPage() {
|
|||||||
width: 200,
|
width: 200,
|
||||||
render: (v, row) => (
|
render: (v, row) => (
|
||||||
<span>
|
<span>
|
||||||
{v}
|
<AdminPrimaryLink onClick={() => void openDetail(row.id)}>{v}</AdminPrimaryLink>
|
||||||
{row.isTest ? (
|
{row.isTest ? (
|
||||||
<Tag color="orange" style={{ marginLeft: 6 }}>
|
<Tag color="orange" style={{ marginLeft: 6 }}>
|
||||||
测试
|
测试
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import { request, type Paginated } from '../lib/api';
|
|||||||
import { ACCOUNT_STATUS_LABELS, ADMIN_OPTIONS_PAGE_SIZE, STORE_STATUS_LABELS, fmtTime } from '../lib/constants';
|
import { ACCOUNT_STATUS_LABELS, ADMIN_OPTIONS_PAGE_SIZE, STORE_STATUS_LABELS, fmtTime } from '../lib/constants';
|
||||||
import { useAdminList } from '../lib/useAdminList';
|
import { useAdminList } from '../lib/useAdminList';
|
||||||
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
||||||
|
import { AdminPrimaryLink } from '../components/AdminPrimaryLink';
|
||||||
|
|
||||||
|
|
||||||
type StoreBrief = { id: string; name: string; status: string; cityName?: string };
|
type StoreBrief = { id: string; name: string; status: string; cityName?: string };
|
||||||
@@ -83,7 +84,14 @@ export default function StoreAccountsPage() {
|
|||||||
width: 120,
|
width: 120,
|
||||||
render: (v, row) => (
|
render: (v, row) => (
|
||||||
<Space size={4}>
|
<Space size={4}>
|
||||||
<span>{v}</span>
|
<AdminPrimaryLink
|
||||||
|
onClick={async () => {
|
||||||
|
setDetail(await request(`/admin/store-accounts/${row.id}`));
|
||||||
|
setDrawerOpen(true);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{v}
|
||||||
|
</AdminPrimaryLink>
|
||||||
{row.isTest ? <Tag color="orange">测试</Tag> : null}
|
{row.isTest ? <Tag color="orange">测试</Tag> : null}
|
||||||
</Space>
|
</Space>
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ import { ADMIN_OPTIONS_PAGE_SIZE, fmtTime } from '../lib/constants';
|
|||||||
import { downloadExcelCsv } from '../lib/exportExcel';
|
import { downloadExcelCsv } from '../lib/exportExcel';
|
||||||
import { useAdminList } from '../lib/useAdminList';
|
import { useAdminList } from '../lib/useAdminList';
|
||||||
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
||||||
|
import { AdminPrimaryLink } from '../components/AdminPrimaryLink';
|
||||||
|
|
||||||
|
|
||||||
type Row = {
|
type Row = {
|
||||||
@@ -286,7 +287,7 @@ export default function StoreBillsPage() {
|
|||||||
width: 180,
|
width: 180,
|
||||||
render: (v, row) => (
|
render: (v, row) => (
|
||||||
<Space>
|
<Space>
|
||||||
<Space>
|
<AdminPrimaryLink onClick={() => void openDetail(row)}>{v}</AdminPrimaryLink>
|
||||||
{row.overdue ? <Tag color="magenta">超时</Tag> : null}
|
{row.overdue ? <Tag color="magenta">超时</Tag> : null}
|
||||||
</Space>
|
</Space>
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import {
|
|||||||
import type { ColumnsType } from 'antd/es/table';
|
import type { ColumnsType } from 'antd/es/table';
|
||||||
import { request, type HqProfile } from '../lib/api';
|
import { request, type HqProfile } from '../lib/api';
|
||||||
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
||||||
|
import { AdminPrimaryLink } from '../components/AdminPrimaryLink';
|
||||||
|
|
||||||
|
|
||||||
type CategoryNode = {
|
type CategoryNode = {
|
||||||
@@ -130,7 +131,7 @@ export default function StoreCategoriesPage() {
|
|||||||
render: (name, row) => (
|
render: (name, row) => (
|
||||||
<span style={{ paddingLeft: row.level === 2 ? 24 : 0 }}>
|
<span style={{ paddingLeft: row.level === 2 ? 24 : 0 }}>
|
||||||
{row.level === 2 ? `${row.parentName || ''} / ` : ''}
|
{row.level === 2 ? `${row.parentName || ''} / ` : ''}
|
||||||
{name}
|
<AdminPrimaryLink onClick={() => openEdit(row)}>{name}</AdminPrimaryLink>
|
||||||
</span>
|
</span>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import { AdminCellLine } from '../components/AdminCellLine';
|
|||||||
import { fmtTime } from '../lib/constants';
|
import { fmtTime } from '../lib/constants';
|
||||||
import { useAdminList } from '../lib/useAdminList';
|
import { useAdminList } from '../lib/useAdminList';
|
||||||
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
||||||
|
import { AdminPrimaryLink } from '../components/AdminPrimaryLink';
|
||||||
|
|
||||||
|
|
||||||
type Row = {
|
type Row = {
|
||||||
@@ -103,7 +104,23 @@ export default function StoreLogsPage() {
|
|||||||
<Tag>{STORE_LOG_CATEGORY_LABELS[v ?? ''] || resolveStoreLogCategory(r.eventName) || '其他'}</Tag>
|
<Tag>{STORE_LOG_CATEGORY_LABELS[v ?? ''] || resolveStoreLogCategory(r.eventName) || '其他'}</Tag>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{ title: '事件', dataIndex: 'eventName', width: 160 },
|
{
|
||||||
|
title: '事件',
|
||||||
|
dataIndex: 'eventName',
|
||||||
|
width: 160,
|
||||||
|
render: (v, row) => (
|
||||||
|
<AdminPrimaryLink
|
||||||
|
onClick={async () => {
|
||||||
|
const parsed = parseCompositeId(row.id);
|
||||||
|
if (!parsed) return;
|
||||||
|
setDetail(await request(`/admin/logs/stores/${parsed.source}/${parsed.rawId}`));
|
||||||
|
setDrawerOpen(true);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{v}
|
||||||
|
</AdminPrimaryLink>
|
||||||
|
),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: '来源', dataIndex: 'source', width: 100,
|
title: '来源', dataIndex: 'source', width: 100,
|
||||||
render: (v: Row['source']) => SOURCE_LABELS[v] || v,
|
render: (v: Row['source']) => SOURCE_LABELS[v] || v,
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import { ADMIN_OPTIONS_PAGE_SIZE, MEDIA_TYPE_LABELS, fmtTime } from '../lib/cons
|
|||||||
import { useAdminList } from '../lib/useAdminList';
|
import { useAdminList } from '../lib/useAdminList';
|
||||||
import OssUpload from '../components/OssUpload';
|
import OssUpload from '../components/OssUpload';
|
||||||
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
||||||
|
import { AdminPrimaryLink } from '../components/AdminPrimaryLink';
|
||||||
|
|
||||||
|
|
||||||
type Row = {
|
type Row = {
|
||||||
@@ -43,7 +44,22 @@ export default function StoreMediaPage() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const baseColumns: ColumnsType<Row> = [
|
const baseColumns: ColumnsType<Row> = [
|
||||||
{ title: '门店', dataIndex: ['store', 'name'], width: 140 },
|
{
|
||||||
|
title: '门店',
|
||||||
|
dataIndex: ['store', 'name'],
|
||||||
|
width: 140,
|
||||||
|
render: (v, row) => (
|
||||||
|
<AdminPrimaryLink
|
||||||
|
onClick={() => {
|
||||||
|
setEditing(row);
|
||||||
|
editForm.setFieldsValue(row);
|
||||||
|
setEditOpen(true);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{v}
|
||||||
|
</AdminPrimaryLink>
|
||||||
|
),
|
||||||
|
},
|
||||||
{ title: '类型', dataIndex: 'mediaType', width: 80, render: (t) => <Tag>{MEDIA_TYPE_LABELS[t] || t}</Tag> },
|
{ title: '类型', dataIndex: 'mediaType', width: 80, render: (t) => <Tag>{MEDIA_TYPE_LABELS[t] || t}</Tag> },
|
||||||
{
|
{
|
||||||
title: '预览', dataIndex: 'url', width: 100,
|
title: '预览', dataIndex: 'url', width: 100,
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ import { notifyPackageAuditChanged } from '../lib/admin-events';
|
|||||||
import { fmtTime } from '../lib/constants';
|
import { fmtTime } from '../lib/constants';
|
||||||
import StorePackageAuditPanel from '../components/StorePackageAuditPanel';
|
import StorePackageAuditPanel from '../components/StorePackageAuditPanel';
|
||||||
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
||||||
|
import { AdminPrimaryLink } from '../components/AdminPrimaryLink';
|
||||||
|
|
||||||
const HQ_PACKAGE_STATUS_LABELS: Record<StorePackageChangeStatus, string> = {
|
const HQ_PACKAGE_STATUS_LABELS: Record<StorePackageChangeStatus, string> = {
|
||||||
PENDING: '待审核',
|
PENDING: '待审核',
|
||||||
@@ -199,7 +200,15 @@ function InfoChangeAuditPanel({
|
|||||||
}
|
}
|
||||||
|
|
||||||
const columns: ColumnsType<StoreInfoChangeRequestDto> = [
|
const columns: ColumnsType<StoreInfoChangeRequestDto> = [
|
||||||
{ title: '门店', dataIndex: 'storeName', render: (_, row) => row.storeName || row.storeId },
|
{
|
||||||
|
title: '门店',
|
||||||
|
dataIndex: 'storeName',
|
||||||
|
render: (_, row) => (
|
||||||
|
<AdminPrimaryLink onClick={() => void openDetail(row.id)}>
|
||||||
|
{row.storeName || row.storeId}
|
||||||
|
</AdminPrimaryLink>
|
||||||
|
),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: '状态',
|
title: '状态',
|
||||||
dataIndex: 'status',
|
dataIndex: 'status',
|
||||||
@@ -471,7 +480,15 @@ export default function StorePackageAuditsPage() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const baseColumns: ColumnsType<StorePackageChangeRequestDto> = [
|
const baseColumns: ColumnsType<StorePackageChangeRequestDto> = [
|
||||||
{ title: '门店', dataIndex: 'storeName', render: (_, row) => row.storeName || row.storeId },
|
{
|
||||||
|
title: '门店',
|
||||||
|
dataIndex: 'storeName',
|
||||||
|
render: (_, row) => (
|
||||||
|
<AdminPrimaryLink onClick={() => void openDetail(row.id)}>
|
||||||
|
{row.storeName || row.storeId}
|
||||||
|
</AdminPrimaryLink>
|
||||||
|
),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: '状态',
|
title: '状态',
|
||||||
dataIndex: 'status',
|
dataIndex: 'status',
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import { request, type Paginated } from '../lib/api';
|
|||||||
import { ADMIN_OPTIONS_PAGE_SIZE, fmtTime } from '../lib/constants';
|
import { ADMIN_OPTIONS_PAGE_SIZE, fmtTime } from '../lib/constants';
|
||||||
import { useAdminList } from '../lib/useAdminList';
|
import { useAdminList } from '../lib/useAdminList';
|
||||||
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
||||||
|
import { AdminPrimaryLink } from '../components/AdminPrimaryLink';
|
||||||
|
|
||||||
|
|
||||||
type Row = {
|
type Row = {
|
||||||
@@ -156,7 +157,7 @@ export default function StoreWithdrawalsPage() {
|
|||||||
width: 180,
|
width: 180,
|
||||||
render: (v, row) => (
|
render: (v, row) => (
|
||||||
<Space>
|
<Space>
|
||||||
<Typography.Link onClick={() => void openDetail(row.id)}>{v}</Typography.Link>
|
<AdminPrimaryLink onClick={() => void openDetail(row.id)}>{v}</AdminPrimaryLink>
|
||||||
{row.overdue ? <Tag color="magenta">超时</Tag> : null}
|
{row.overdue ? <Tag color="magenta">超时</Tag> : null}
|
||||||
</Space>
|
</Space>
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ import {
|
|||||||
} from '../lib/storeCreate';
|
} from '../lib/storeCreate';
|
||||||
import { useAdminList } from '../lib/useAdminList';
|
import { useAdminList } from '../lib/useAdminList';
|
||||||
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
||||||
|
import { AdminPrimaryLink } from '../components/AdminPrimaryLink';
|
||||||
import { resolveRegionBinding } from '../lib/china-region';
|
import { resolveRegionBinding } from '../lib/china-region';
|
||||||
import ChinaRegionCascader from '../components/ChinaRegionCascader';
|
import ChinaRegionCascader from '../components/ChinaRegionCascader';
|
||||||
import OssUpload from '../components/OssUpload';
|
import OssUpload from '../components/OssUpload';
|
||||||
@@ -739,7 +740,7 @@ export default function StoresPage() {
|
|||||||
const name = v || '—';
|
const name = v || '—';
|
||||||
return (
|
return (
|
||||||
<Space size={4} wrap={false}>
|
<Space size={4} wrap={false}>
|
||||||
<span>{name}</span>
|
<AdminPrimaryLink onClick={() => void openStoreDetail(row)}>{name === '—' ? '' : name}</AdminPrimaryLink>
|
||||||
{row.isTest ? <Tag color="orange">测试</Tag> : null}
|
{row.isTest ? <Tag color="orange">测试</Tag> : null}
|
||||||
</Space>
|
</Space>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ import { fmtTime } from '../lib/constants';
|
|||||||
import { useAdminList } from '../lib/useAdminList';
|
import { useAdminList } from '../lib/useAdminList';
|
||||||
import OssUpload from '../components/OssUpload';
|
import OssUpload from '../components/OssUpload';
|
||||||
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
||||||
|
import { AdminPrimaryLink } from '../components/AdminPrimaryLink';
|
||||||
|
|
||||||
|
|
||||||
const DISPATCH_WECOM_STORAGE_KEY = 'support_ticket_dispatch_wecom';
|
const DISPATCH_WECOM_STORAGE_KEY = 'support_ticket_dispatch_wecom';
|
||||||
@@ -505,7 +506,13 @@ export default function SupportTicketsPage() {
|
|||||||
</Space>
|
</Space>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{ title: '标题', dataIndex: 'title' },
|
{
|
||||||
|
title: '标题',
|
||||||
|
dataIndex: 'title',
|
||||||
|
render: (v, row) => (
|
||||||
|
<AdminPrimaryLink onClick={() => void openDetail(String(row.id))}>{v}</AdminPrimaryLink>
|
||||||
|
),
|
||||||
|
},
|
||||||
{ title: '创建人', dataIndex: 'creatorName', width: 100 },
|
{ title: '创建人', dataIndex: 'creatorName', width: 100 },
|
||||||
{ title: '时间', dataIndex: 'createdAt', width: 160, render: fmtTime },
|
{ title: '时间', dataIndex: 'createdAt', width: 160, render: fmtTime },
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import type { ColumnsType } from 'antd/es/table';
|
|||||||
import { request, type Paginated } from '../lib/api';
|
import { request, type Paginated } from '../lib/api';
|
||||||
import { fmtTime } from '../lib/constants';
|
import { fmtTime } from '../lib/constants';
|
||||||
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
||||||
|
import { AdminPrimaryLink } from '../components/AdminPrimaryLink';
|
||||||
|
|
||||||
const MOCK_KEYS = ['MOCK_SMS', 'MOCK_WECHAT', 'MOCK_PAY'] as const;
|
const MOCK_KEYS = ['MOCK_SMS', 'MOCK_WECHAT', 'MOCK_PAY'] as const;
|
||||||
|
|
||||||
@@ -254,7 +255,22 @@ export default function TestWhitelistPage() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const phoneColumns: ColumnsType<PhoneRow> = [
|
const phoneColumns: ColumnsType<PhoneRow> = [
|
||||||
{ title: '手机号', dataIndex: 'phone', width: 140 },
|
{
|
||||||
|
title: '手机号',
|
||||||
|
dataIndex: 'phone',
|
||||||
|
width: 140,
|
||||||
|
render: (v, row) => (
|
||||||
|
<AdminPrimaryLink
|
||||||
|
onClick={() => {
|
||||||
|
setEditRow(row);
|
||||||
|
editForm.setFieldsValue({ note: row.note ?? '' });
|
||||||
|
setEditOpen(true);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{v}
|
||||||
|
</AdminPrimaryLink>
|
||||||
|
),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: '备注',
|
title: '备注',
|
||||||
dataIndex: 'note',
|
dataIndex: 'note',
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import { request } from '../lib/api';
|
|||||||
import { fmtTime } from '../lib/constants';
|
import { fmtTime } from '../lib/constants';
|
||||||
import { useAdminList } from '../lib/useAdminList';
|
import { useAdminList } from '../lib/useAdminList';
|
||||||
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
||||||
|
import { AdminPrimaryLink } from '../components/AdminPrimaryLink';
|
||||||
|
|
||||||
|
|
||||||
type Row = {
|
type Row = {
|
||||||
@@ -95,7 +96,21 @@ export default function ThirdPartyLogsPage() {
|
|||||||
title: '请求摘要',
|
title: '请求摘要',
|
||||||
render: (_, r) => summarizeJson(r.requestBody),
|
render: (_, r) => summarizeJson(r.requestBody),
|
||||||
},
|
},
|
||||||
{ title: '外部单号', dataIndex: 'externalNo', width: 140, render: (v) => v || '—' },
|
{
|
||||||
|
title: '外部单号',
|
||||||
|
dataIndex: 'externalNo',
|
||||||
|
width: 140,
|
||||||
|
render: (v, row) => (
|
||||||
|
<AdminPrimaryLink
|
||||||
|
onClick={async () => {
|
||||||
|
setDetail(await request(`/common/third-party-logs/${row.id}`));
|
||||||
|
setDrawerOpen(true);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{v}
|
||||||
|
</AdminPrimaryLink>
|
||||||
|
),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: '操作',
|
title: '操作',
|
||||||
width: 80,
|
width: 80,
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ import { request } from '../lib/api';
|
|||||||
import { fmtTime } from '../lib/constants';
|
import { fmtTime } from '../lib/constants';
|
||||||
import { useAdminList } from '../lib/useAdminList';
|
import { useAdminList } from '../lib/useAdminList';
|
||||||
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
||||||
|
import { AdminPrimaryLink } from '../components/AdminPrimaryLink';
|
||||||
|
|
||||||
|
|
||||||
type Row = {
|
type Row = {
|
||||||
@@ -118,7 +119,21 @@ export default function TicketsPage() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const baseColumns: ColumnsType<Row> = [
|
const baseColumns: ColumnsType<Row> = [
|
||||||
{ title: '工单号', dataIndex: 'ticketNo', width: 180 },
|
{
|
||||||
|
title: '工单号',
|
||||||
|
dataIndex: 'ticketNo',
|
||||||
|
width: 180,
|
||||||
|
render: (v, row) => (
|
||||||
|
<AdminPrimaryLink
|
||||||
|
onClick={async () => {
|
||||||
|
setDetail(await request(`/admin/tickets/${row.id}`));
|
||||||
|
setDrawerOpen(true);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{v}
|
||||||
|
</AdminPrimaryLink>
|
||||||
|
),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: '类型',
|
title: '类型',
|
||||||
dataIndex: 'ticketType',
|
dataIndex: 'ticketType',
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import { AdminCellLine } from '../components/AdminCellLine';
|
|||||||
import { fmtTime } from '../lib/constants';
|
import { fmtTime } from '../lib/constants';
|
||||||
import { useAdminList } from '../lib/useAdminList';
|
import { useAdminList } from '../lib/useAdminList';
|
||||||
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
||||||
|
import { AdminPrimaryLink } from '../components/AdminPrimaryLink';
|
||||||
|
|
||||||
|
|
||||||
type Row = {
|
type Row = {
|
||||||
@@ -80,7 +81,21 @@ export default function UserLogsPage() {
|
|||||||
<Tag>{CATEGORY_LABELS[v ?? ''] || resolveUserLogCategory(r.eventName) || '其他'}</Tag>
|
<Tag>{CATEGORY_LABELS[v ?? ''] || resolveUserLogCategory(r.eventName) || '其他'}</Tag>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{ title: '事件', dataIndex: 'eventName', width: 160 },
|
{
|
||||||
|
title: '事件',
|
||||||
|
dataIndex: 'eventName',
|
||||||
|
width: 160,
|
||||||
|
render: (v, row) => (
|
||||||
|
<AdminPrimaryLink
|
||||||
|
onClick={async () => {
|
||||||
|
setDetail(await request(`/admin/logs/users/${row.id}`));
|
||||||
|
setDrawerOpen(true);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{v}
|
||||||
|
</AdminPrimaryLink>
|
||||||
|
),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: '关联', width: 120,
|
title: '关联', width: 120,
|
||||||
render: (_, r) => (r.refType && r.refId ? `${r.refType}#${r.refId}` : '—'),
|
render: (_, r) => (r.refType && r.refId ? `${r.refType}#${r.refId}` : '—'),
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import type { ColumnsType } from 'antd/es/table';
|
|||||||
import { USER_SOURCE_TYPE_LABELS, resolveUserLogCategory, type UserSourceType } from '@dukang/shared-types';
|
import { USER_SOURCE_TYPE_LABELS, resolveUserLogCategory, type UserSourceType } from '@dukang/shared-types';
|
||||||
import { request, type AdminUserRow, type HqProfile, type Paginated } from '../lib/api';
|
import { request, type AdminUserRow, type HqProfile, type Paginated } from '../lib/api';
|
||||||
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
||||||
|
import { AdminPrimaryLink } from '../components/AdminPrimaryLink';
|
||||||
import { ORDER_STATUS_LABELS, fmtTime, maskPhone } from '../lib/constants';
|
import { ORDER_STATUS_LABELS, fmtTime, maskPhone } from '../lib/constants';
|
||||||
|
|
||||||
type UserOrderRow = {
|
type UserOrderRow = {
|
||||||
@@ -332,7 +333,9 @@ export default function UsersPage() {
|
|||||||
title: '昵称',
|
title: '昵称',
|
||||||
dataIndex: 'nickname',
|
dataIndex: 'nickname',
|
||||||
width: 140,
|
width: 140,
|
||||||
render: (v: string | null) => v || '—',
|
render: (v: string | null, row) => (
|
||||||
|
<AdminPrimaryLink onClick={() => void openDetail(row.id)}>{v}</AdminPrimaryLink>
|
||||||
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '备注',
|
title: '备注',
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import { AdminCellLine } from '../components/AdminCellLine';
|
|||||||
import { fmtTime, maskPhone } from '../lib/constants';
|
import { fmtTime, maskPhone } from '../lib/constants';
|
||||||
import { useAdminList } from '../lib/useAdminList';
|
import { useAdminList } from '../lib/useAdminList';
|
||||||
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
||||||
|
import { AdminPrimaryLink } from '../components/AdminPrimaryLink';
|
||||||
|
|
||||||
|
|
||||||
type ActorType = 'USER' | 'STORE' | 'PARTNER' | 'HQ';
|
type ActorType = 'USER' | 'STORE' | 'PARTNER' | 'HQ';
|
||||||
@@ -120,7 +121,9 @@ export default function WechatBindingsPage() {
|
|||||||
title: '手机号',
|
title: '手机号',
|
||||||
dataIndex: 'primaryPhone',
|
dataIndex: 'primaryPhone',
|
||||||
width: 140,
|
width: 140,
|
||||||
width: 140,
|
render: (v, row) => (
|
||||||
|
<AdminPrimaryLink onClick={() => void openDetail(row)}>{maskPhone(v)}</AdminPrimaryLink>
|
||||||
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '身份摘要',
|
title: '身份摘要',
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import { request } from '../lib/api';
|
|||||||
import { fmtTime } from '../lib/constants';
|
import { fmtTime } from '../lib/constants';
|
||||||
import type { WecomBotLogDto } from '@dukang/shared-types';
|
import type { WecomBotLogDto } from '@dukang/shared-types';
|
||||||
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
||||||
|
import { AdminPrimaryLink } from '../components/AdminPrimaryLink';
|
||||||
|
|
||||||
|
|
||||||
export default function WecomBotLogsPage() {
|
export default function WecomBotLogsPage() {
|
||||||
@@ -28,7 +29,14 @@ export default function WecomBotLogsPage() {
|
|||||||
|
|
||||||
const baseColumns: ColumnsType<WecomBotLogDto> = [
|
const baseColumns: ColumnsType<WecomBotLogDto> = [
|
||||||
{ title: '时间', dataIndex: 'createdAt', width: 160, render: fmtTime },
|
{ title: '时间', dataIndex: 'createdAt', width: 160, render: fmtTime },
|
||||||
{ title: '机器人', dataIndex: 'botName', width: 120, render: (v, r) => v || r.botKey || '—' },
|
{
|
||||||
|
title: '机器人',
|
||||||
|
dataIndex: 'botName',
|
||||||
|
width: 120,
|
||||||
|
render: (v, r) => (
|
||||||
|
<AdminPrimaryLink onClick={() => setDetail(r)}>{v || r.botKey || ''}</AdminPrimaryLink>
|
||||||
|
),
|
||||||
|
},
|
||||||
{ title: '企微用户', dataIndex: 'wecomUserId', width: 120 },
|
{ title: '企微用户', dataIndex: 'wecomUserId', width: 120 },
|
||||||
{ title: '动作', dataIndex: 'action', width: 160 },
|
{ title: '动作', dataIndex: 'action', width: 160 },
|
||||||
{ title: '权限', dataIndex: 'permission', width: 140, render: (v) => v || '—' },
|
{ title: '权限', dataIndex: 'permission', width: 140, render: (v) => v || '—' },
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ import { fmtTime } from '../lib/constants';
|
|||||||
import { useAdminList } from '../lib/useAdminList';
|
import { useAdminList } from '../lib/useAdminList';
|
||||||
import OssUpload from '../components/OssUpload';
|
import OssUpload from '../components/OssUpload';
|
||||||
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
||||||
|
import { AdminPrimaryLink } from '../components/AdminPrimaryLink';
|
||||||
|
|
||||||
|
|
||||||
type FormValues = {
|
type FormValues = {
|
||||||
@@ -293,7 +294,14 @@ export default function WecomBotsPage() {
|
|||||||
</Avatar>
|
</Avatar>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{ title: '名称', dataIndex: 'name', width: 140 },
|
{
|
||||||
|
title: '名称',
|
||||||
|
dataIndex: 'name',
|
||||||
|
width: 140,
|
||||||
|
render: (v, row) => (
|
||||||
|
<AdminPrimaryLink onClick={() => void openEdit(row)}>{v}</AdminPrimaryLink>
|
||||||
|
),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: '角色',
|
title: '角色',
|
||||||
dataIndex: 'role',
|
dataIndex: 'role',
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ import { fmtTime } from '../lib/constants';
|
|||||||
import { useAdminList } from '../lib/useAdminList';
|
import { useAdminList } from '../lib/useAdminList';
|
||||||
import OssUpload from '../components/OssUpload';
|
import OssUpload from '../components/OssUpload';
|
||||||
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
||||||
|
import { AdminPrimaryLink } from '../components/AdminPrimaryLink';
|
||||||
|
|
||||||
|
|
||||||
type FormValues = {
|
type FormValues = {
|
||||||
@@ -202,7 +203,7 @@ function PushRoutesTab() {
|
|||||||
render: (name: string, row) => (
|
render: (name: string, row) => (
|
||||||
<Space>
|
<Space>
|
||||||
<Avatar src={row.avatarUrl ?? undefined}>{name.slice(0, 1)}</Avatar>
|
<Avatar src={row.avatarUrl ?? undefined}>{name.slice(0, 1)}</Avatar>
|
||||||
<span>{name}</span>
|
<AdminPrimaryLink onClick={() => openEdit(row)}>{name}</AdminPrimaryLink>
|
||||||
</Space>
|
</Space>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ import { downloadExcelCsv } from '../lib/exportExcel';
|
|||||||
import { request, type HqProfile } from '../lib/api';
|
import { request, type HqProfile } from '../lib/api';
|
||||||
import { useAdminList } from '../lib/useAdminList';
|
import { useAdminList } from '../lib/useAdminList';
|
||||||
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
import { useAdminListColumns } from '../lib/useAdminListColumns';
|
||||||
|
import { AdminPrimaryLink } from '../components/AdminPrimaryLink';
|
||||||
|
|
||||||
|
|
||||||
type Row = {
|
type Row = {
|
||||||
@@ -238,7 +239,14 @@ export default function WineryBillsPage() {
|
|||||||
const selectedAmount = selectedRows.reduce((s, r) => s + Number(r.wineryAmount), 0);
|
const selectedAmount = selectedRows.reduce((s, r) => s + Number(r.wineryAmount), 0);
|
||||||
|
|
||||||
const baseColumns: ColumnsType<Row> = [
|
const baseColumns: ColumnsType<Row> = [
|
||||||
{ title: '账单号', dataIndex: 'billNo', width: 170 },
|
{
|
||||||
|
title: '账单号',
|
||||||
|
dataIndex: 'billNo',
|
||||||
|
width: 170,
|
||||||
|
render: (v, row) => (
|
||||||
|
<AdminPrimaryLink onClick={() => void openDetail(row.id)}>{v}</AdminPrimaryLink>
|
||||||
|
),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: '账单日',
|
title: '账单日',
|
||||||
dataIndex: 'billDate',
|
dataIndex: 'billDate',
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import { fmtTime } from '../../lib/constants';
|
|||||||
import { useAdminList } from '../../lib/useAdminList';
|
import { useAdminList } from '../../lib/useAdminList';
|
||||||
import type { PromoCodeDetailContext } from './PromoCodeDetailLayout';
|
import type { PromoCodeDetailContext } from './PromoCodeDetailLayout';
|
||||||
import { useAdminListColumns } from '../../lib/useAdminListColumns';
|
import { useAdminListColumns } from '../../lib/useAdminListColumns';
|
||||||
|
import { AdminPrimaryLink } from '../../components/AdminPrimaryLink';
|
||||||
|
|
||||||
|
|
||||||
export default function PromoCodeUsersPage() {
|
export default function PromoCodeUsersPage() {
|
||||||
@@ -25,7 +26,16 @@ export default function PromoCodeUsersPage() {
|
|||||||
|
|
||||||
const baseColumns: ColumnsType<PromoCodeAttributedUser> = [
|
const baseColumns: ColumnsType<PromoCodeAttributedUser> = [
|
||||||
{ title: '用户编号', dataIndex: 'userNo', width: 120 },
|
{ title: '用户编号', dataIndex: 'userNo', width: 120 },
|
||||||
{ title: '昵称', dataIndex: 'nickname', width: 100, render: (v) => v || '—' },
|
{
|
||||||
|
title: '昵称',
|
||||||
|
dataIndex: 'nickname',
|
||||||
|
width: 100,
|
||||||
|
render: (v, row) => (
|
||||||
|
<AdminPrimaryLink onClick={() => navigate('/users', { state: { openUserId: row.id } })}>
|
||||||
|
{v}
|
||||||
|
</AdminPrimaryLink>
|
||||||
|
),
|
||||||
|
},
|
||||||
{ title: '手机', dataIndex: 'phone', width: 120, render: (v) => v || '—' },
|
{ title: '手机', dataIndex: 'phone', width: 120, render: (v) => v || '—' },
|
||||||
{
|
{
|
||||||
title: '验手机',
|
title: '验手机',
|
||||||
|
|||||||
+2
-2
@@ -28,7 +28,7 @@
|
|||||||
| 3.5.6 | 08-23 | HQ 任务导出;核销/财务银行信息;工单图片入任务;运营去调试;门店审核全屏 | [`v3.5.6`](./杜康好客-v3.5.6-开发文档.md) |
|
| 3.5.6 | 08-23 | HQ 任务导出;核销/财务银行信息;工单图片入任务;运营去调试;门店审核全屏 | [`v3.5.6`](./杜康好客-v3.5.6-开发文档.md) |
|
||||||
| 3.5.7 | 08-23 | 门店端核销记录时间显示秒;首页「今日核销金额」文案 | [`v3.5.7`](./杜康好客-v3.5.7-开发文档.md) |
|
| 3.5.7 | 08-23 | 门店端核销记录时间显示秒;首页「今日核销金额」文案 | [`v3.5.7`](./杜康好客-v3.5.7-开发文档.md) |
|
||||||
| 3.5.8 | 08-24 | HQ 单账号追加/撤销权限;运营改客服修复;城市门店服务+城市范围 | [`v3.5.8`](./杜康好客-v3.5.8-开发文档.md) |
|
| 3.5.8 | 08-24 | HQ 单账号追加/撤销权限;运营改客服修复;城市门店服务+城市范围 | [`v3.5.8`](./杜康好客-v3.5.8-开发文档.md) |
|
||||||
| 3.5.9 | 08-25 | 门店累计核销好客权益;HQ 表格去省略号;序号列 + 列设置;用户备注 / 手机号不脱敏 | [`v3.5.9`](./杜康好客-v3.5.9-开发文档.md) |
|
| 3.5.9 | 08-25 | 门店累计核销好客权益;HQ 表格去省略号;序号列 + 列设置 + 拖表头改列宽;用户备注 / 手机号不脱敏 | [`v3.5.9`](./杜康好客-v3.5.9-开发文档.md) |
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -137,7 +137,7 @@
|
|||||||
- **不**再因客户端 `validation_error` 自动创建技术支持工单。
|
- **不**再因客户端 `validation_error` 自动创建技术支持工单。
|
||||||
- 合伙人入驻提交前须展示 HQ 可配企微客服二维码,并确认已添加客服。
|
- 合伙人入驻提交前须展示 HQ 可配企微客服二维码,并确认已添加客服。
|
||||||
- HQ 门店列表:店名完整展示、操作列右固定、表过宽可横向滚动(v3.5.9 去掉省略号)。
|
- HQ 门店列表:店名完整展示、操作列右固定、表过宽可横向滚动(v3.5.9 去掉省略号)。
|
||||||
- HQ 主列表:最左序号;「列设置」控制显示列与顺序,偏好挂当前 HQ 账号。
|
- HQ 主列表:最左序号;「列设置」控制显示列与顺序;可拖表头分割线改列宽;主展示列下划线点击进编辑/详情;偏好挂当前 HQ 账号。
|
||||||
- 门店列表展示「累计核销好客权益」(该店核销券面额合计)。
|
- 门店列表展示「累计核销好客权益」(该店核销券面额合计)。
|
||||||
- HQ 用户列表:昵称只读;双击「备注」离开即保存(`hq_remark`);列表手机号不脱敏(详情仍脱敏)。
|
- HQ 用户列表:昵称只读;双击「备注」离开即保存(`hq_remark`);列表手机号不脱敏(详情仍脱敏)。
|
||||||
- 详 [`v3.4.16`](./杜康好客-v3.4.16-门店联系电话与体验优化.md)、[`v3.5.9`](./杜康好客-v3.5.9-开发文档.md)。
|
- 详 [`v3.4.16`](./杜康好客-v3.4.16-门店联系电话与体验优化.md)、[`v3.5.9`](./杜康好客-v3.5.9-开发文档.md)。
|
||||||
|
|||||||
@@ -67,7 +67,7 @@
|
|||||||
|
|
||||||
| 日期 | 说明 |
|
| 日期 | 说明 |
|
||||||
|------|------|
|
|------|------|
|
||||||
| 2026-08-25 | v3.5.9:门店列表累计核销好客权益;HQ 表格去省略号;主列表序号 + 列设置存 HQ 账号;用户列表备注(不改昵称)、手机号不脱敏 |
|
| 2026-08-25 | v3.5.9:门店列表累计核销好客权益;HQ 表格去省略号;主列表序号 + 列设置/列宽存 HQ 账号;用户列表备注(不改昵称)、手机号不脱敏 |
|
||||||
| 2026-08-24 | v3.5.8:HQ 单账号追加/撤销权限;运营改客服;城市门店服务与城市范围;分类删除权限与概览按权限/城市裁剪 |
|
| 2026-08-24 | v3.5.8:HQ 单账号追加/撤销权限;运营改客服;城市门店服务与城市范围;分类删除权限与概览按权限/城市裁剪 |
|
||||||
| 2026-08-23 | v3.5.7:门店核销记录时间显示秒;首页「今日到账金额」→「今日核销金额」 |
|
| 2026-08-23 | v3.5.7:门店核销记录时间显示秒;首页「今日到账金额」→「今日核销金额」 |
|
||||||
| 2026-08-23 | v3.5.6:开发计划任务导出;核销/财务银行信息与打款凭证;工单图片入任务;运营去调试;门店审核全屏 |
|
| 2026-08-23 | v3.5.6:开发计划任务导出;核销/财务银行信息与打款凭证;工单图片入任务;运营去调试;门店审核全屏 |
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
1. **门店列表**增加「累计核销好客权益」:该店历史核销券面额合计。
|
1. **门店列表**增加「累计核销好客权益」:该店历史核销券面额合计。
|
||||||
2. **全 HQ 表格**去掉 `...` 截断,长文本完整展示,横向滚动。
|
2. **全 HQ 表格**去掉 `...` 截断,长文本完整展示,横向滚动。
|
||||||
3. 每张 **主列表**:最左序号(跨页连续);「列设置」弹窗控制显示列与顺序,偏好存当前 HQ 账号。
|
3. 每张 **主列表**:最左序号(跨页连续);「列设置」弹窗控制显示列与顺序;可拖表头分割线改列宽。偏好(含列宽)存当前 HQ 账号。主展示列(名称 / 单号 / 昵称等)带下划线,点击进入编辑或详情。
|
||||||
4. **用户列表**:昵称只读(用户自己的);新增「备注」列,双击编辑 HQ 标记,离开即写入 `user_user.hq_remark`;手机号列表明文,不脱敏。
|
4. **用户列表**:昵称只读(用户自己的);新增「备注」列,双击编辑 HQ 标记,离开即写入 `user_user.hq_remark`;手机号列表明文,不脱敏。
|
||||||
|
|
||||||
**不做**:C 端 / 合伙人 / 门店端;详情 Drawer 内嵌表不加列设置。
|
**不做**:C 端 / 合伙人 / 门店端;详情 Drawer 内嵌表不加列设置。
|
||||||
@@ -38,10 +38,11 @@
|
|||||||
| 序号 | `(page-1)*pageSize+index+1`,锁定最左,不可隐藏 |
|
| 序号 | `(page-1)*pageSize+index+1`,锁定最左,不可隐藏 |
|
||||||
| 操作列 | 锁定最右,不可隐藏 |
|
| 操作列 | 锁定最右,不可隐藏 |
|
||||||
| 弹窗 | 勾选显示、拖拽/上下移排序、重置默认 |
|
| 弹窗 | 勾选显示、拖拽/上下移排序、重置默认 |
|
||||||
|
| 主列 | 名称/单号/昵称等下划线,点击同「编辑」或「详情」 |
|
||||||
| 存储 | `hq_account.list_column_prefs` JSON,按 `listKey` |
|
| 存储 | `hq_account.list_column_prefs` JSON,按 `listKey` |
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
{ stores: { order: ["name", "cityName"], hidden: ["intro"] } }
|
{ stores: { order: ["name", "cityName"], hidden: ["intro"], widths: { name: 180 } } }
|
||||||
```
|
```
|
||||||
|
|
||||||
新列按默认位置插入且默认显示;未知 key 忽略。重置即删除该 `listKey`。
|
新列按默认位置插入且默认显示;未知 key 忽略。重置即删除该 `listKey`。
|
||||||
@@ -113,7 +114,17 @@
|
|||||||
- [ ] HQ 主表长字段不再 `...`,可横向滑完
|
- [ ] HQ 主表长字段不再 `...`,可横向滑完
|
||||||
- [ ] 主列表最左序号跨页连续
|
- [ ] 主列表最左序号跨页连续
|
||||||
- [ ] 列设置可隐藏/排序;保存后刷新仍在;重置恢复默认
|
- [ ] 列设置可隐藏/排序;保存后刷新仍在;重置恢复默认
|
||||||
|
- [ ] 主展示列带下划线,点击进入对应编辑或详情
|
||||||
- [ ] 序号、操作列不能在弹窗关掉或拖走
|
- [ ] 序号、操作列不能在弹窗关掉或拖走
|
||||||
- [ ] 详情描述列表仍可省略
|
- [ ] 详情描述列表仍可省略
|
||||||
- [ ] 用户列表昵称只读;双击「备注」可改,离开编辑后 `user_user.hq_remark` 已更新;C 端看不到该字段
|
- [ ] 用户列表昵称只读;双击「备注」可改,离开编辑后 `user_user.hq_remark` 已更新;C 端看不到该字段
|
||||||
- [ ] 用户列表手机号完整可见(详情仍脱敏)
|
- [ ] 用户列表手机号完整可见(详情仍脱敏)
|
||||||
|
- [ ] 权益券列表:用户编号、订单号可点进对应用户/订单详情;来源含商品名、规格、数量、配送方式、实付金额
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 10. 权益券列表快链与来源
|
||||||
|
|
||||||
|
- **用户**、**订单**列(及券详情)用主列下划线,分别打开用户详情抽屉、订单详情抽屉。
|
||||||
|
- **来源**:关联订单时拼 `商品名 / 规格 / 数量(瓶或箱) / 配送方式 / ¥实付`;无订单仍用 `sourceProduct`(如总部手动发放)。
|
||||||
|
- 列表接口 `order` 增补 `productName`、`productSpec`、`quantity`、`saleUnit`、`deliveryType`、`payAmount`。
|
||||||
|
|||||||
+1
-1
@@ -43,7 +43,7 @@ C 端购酒核销 · 门店扫码核销+打款 · 合伙人拓店履约 · WebAd
|
|||||||
|
|
||||||
**HQ 权限(v3.5.8)**:生效 =(角色 ∪ 追加)− 撤销。城市范围绑在账号上(空=全国;「城市门店服务」必须勾城)。门店 API 按 `cityIds` 强制过滤。城市门店服务可新增分类、不可删除;概览按权限与城市范围裁剪。
|
**HQ 权限(v3.5.8)**:生效 =(角色 ∪ 追加)− 撤销。城市范围绑在账号上(空=全国;「城市门店服务」必须勾城)。门店 API 按 `cityIds` 强制过滤。城市门店服务可新增分类、不可删除;概览按权限与城市范围裁剪。
|
||||||
|
|
||||||
**HQ 列表(v3.5.9)**:主表不省略号、可横滑;最左序号;列设置(显隐/顺序)存 `hq_account.list_column_prefs`。门店列表「累计核销好客权益」= 该店 `RedeemRecord.amount` 合计。用户列表昵称只读;双击「备注」离开即保存(`hq_remark`);列表手机号不脱敏。
|
**HQ 列表(v3.5.9)**:主表不省略号、可横滑;最左序号;列设置(显隐/顺序)与列宽(拖表头)存 `hq_account.list_column_prefs`。主展示列下划线,点击进编辑或详情。门店列表「累计核销好客权益」= 该店 `RedeemRecord.amount` 合计。用户列表昵称只读(点击进详情);双击「备注」离开即保存(`hq_remark`);列表手机号不脱敏。
|
||||||
|
|
||||||
## 5. 验收用例(必过)
|
## 5. 验收用例(必过)
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -92,7 +92,7 @@
|
|||||||
| 交易 | 订单、权益券、核销记录、推广码+metrics |
|
| 交易 | 订单、权益券、核销记录、推广码+metrics |
|
||||||
| 财务 | 门店/合伙人/酒厂/物流账单;打款确认 |
|
| 财务 | 门店/合伙人/酒厂/物流账单;打款确认 |
|
||||||
| 工单 | 售后四类型 + 技术支持(ST) + 开发计划 |
|
| 工单 | 售后四类型 + 技术支持(ST) + 开发计划 |
|
||||||
| 系统 | 账号权限、客户端配置、企微机器人/消息推送;列表「列设置」按账号保存 |
|
| 系统 | 账号权限、客户端配置、企微机器人/消息推送;列表「列设置」与列宽按账号保存 |
|
||||||
| 日志 | HQ/用户/门店/合伙人/企微 |
|
| 日志 | HQ/用户/门店/合伙人/企微 |
|
||||||
|
|
||||||
## 6. 商品与模板
|
## 6. 商品与模板
|
||||||
|
|||||||
@@ -60,6 +60,8 @@ export function isHqListColumnKey(value: string): value is HqListColumnKey {
|
|||||||
export type HqListColumnPref = {
|
export type HqListColumnPref = {
|
||||||
order: string[];
|
order: string[];
|
||||||
hidden: string[];
|
hidden: string[];
|
||||||
|
/** 列宽(px);未出现的 key 用列默认 width */
|
||||||
|
widths?: Record<string, number>;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type HqListColumnPrefsMap = Partial<Record<HqListColumnKey, HqListColumnPref>>;
|
export type HqListColumnPrefsMap = Partial<Record<HqListColumnKey, HqListColumnPref>>;
|
||||||
@@ -68,4 +70,5 @@ export type SaveHqListColumnPrefsRequest = {
|
|||||||
reset?: boolean;
|
reset?: boolean;
|
||||||
order?: string[];
|
order?: string[];
|
||||||
hidden?: string[];
|
hidden?: string[];
|
||||||
|
widths?: Record<string, number>;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -55,15 +55,29 @@ type UserRow = Pick<
|
|||||||
avatar?: { url: string } | null;
|
avatar?: { url: string } | null;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
function parseColumnWidths(raw: unknown): Record<string, number> | undefined {
|
||||||
|
if (!raw || typeof raw !== 'object' || Array.isArray(raw)) return undefined;
|
||||||
|
const out: Record<string, number> = {};
|
||||||
|
for (const [key, value] of Object.entries(raw as Record<string, unknown>)) {
|
||||||
|
if (!key.trim()) continue;
|
||||||
|
const n = typeof value === 'number' ? value : Number(value);
|
||||||
|
if (!Number.isFinite(n)) continue;
|
||||||
|
out[key] = Math.min(960, Math.max(48, Math.round(n)));
|
||||||
|
}
|
||||||
|
return Object.keys(out).length ? out : undefined;
|
||||||
|
}
|
||||||
|
|
||||||
function parseListColumnPrefs(raw: unknown): HqListColumnPrefsMap {
|
function parseListColumnPrefs(raw: unknown): HqListColumnPrefsMap {
|
||||||
if (!raw || typeof raw !== 'object' || Array.isArray(raw)) return {};
|
if (!raw || typeof raw !== 'object' || Array.isArray(raw)) return {};
|
||||||
const out: HqListColumnPrefsMap = {};
|
const out: HqListColumnPrefsMap = {};
|
||||||
for (const [key, value] of Object.entries(raw as Record<string, unknown>)) {
|
for (const [key, value] of Object.entries(raw as Record<string, unknown>)) {
|
||||||
if (!isHqListColumnKey(key) || !value || typeof value !== 'object' || Array.isArray(value)) continue;
|
if (!isHqListColumnKey(key) || !value || typeof value !== 'object' || Array.isArray(value)) continue;
|
||||||
const row = value as { order?: unknown; hidden?: unknown };
|
const row = value as { order?: unknown; hidden?: unknown; widths?: unknown };
|
||||||
|
const widths = parseColumnWidths(row.widths);
|
||||||
out[key] = {
|
out[key] = {
|
||||||
order: Array.isArray(row.order) ? row.order.filter((v): v is string => typeof v === 'string') : [],
|
order: Array.isArray(row.order) ? row.order.filter((v): v is string => typeof v === 'string') : [],
|
||||||
hidden: Array.isArray(row.hidden) ? row.hidden.filter((v): v is string => typeof v === 'string') : [],
|
hidden: Array.isArray(row.hidden) ? row.hidden.filter((v): v is string => typeof v === 'string') : [],
|
||||||
|
...(widths ? { widths } : {}),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
return out;
|
return out;
|
||||||
@@ -1238,7 +1252,7 @@ export class AuthService {
|
|||||||
actorType: string,
|
actorType: string,
|
||||||
actorId: bigint,
|
actorId: bigint,
|
||||||
listKey: string,
|
listKey: string,
|
||||||
dto: { reset?: boolean; order?: string[]; hidden?: string[] },
|
dto: { reset?: boolean; order?: string[]; hidden?: string[]; widths?: Record<string, number> },
|
||||||
) {
|
) {
|
||||||
if (actorType !== 'HQ') throw new ForbiddenException('仅总部账号可保存列表列设置');
|
if (actorType !== 'HQ') throw new ForbiddenException('仅总部账号可保存列表列设置');
|
||||||
if (!isHqListColumnKey(listKey)) throw new BadRequestException('未知列表');
|
if (!isHqListColumnKey(listKey)) throw new BadRequestException('未知列表');
|
||||||
@@ -1251,9 +1265,19 @@ export class AuthService {
|
|||||||
if (dto.reset) {
|
if (dto.reset) {
|
||||||
delete current[listKey];
|
delete current[listKey];
|
||||||
} else {
|
} else {
|
||||||
|
const prev = current[listKey];
|
||||||
|
const widths =
|
||||||
|
dto.widths !== undefined ? parseColumnWidths(dto.widths) : prev?.widths;
|
||||||
current[listKey] = {
|
current[listKey] = {
|
||||||
order: (dto.order ?? []).filter((k) => typeof k === 'string' && k.trim()),
|
order:
|
||||||
hidden: (dto.hidden ?? []).filter((k) => typeof k === 'string' && k.trim()),
|
dto.order !== undefined
|
||||||
|
? dto.order.filter((k) => typeof k === 'string' && k.trim())
|
||||||
|
: (prev?.order ?? []),
|
||||||
|
hidden:
|
||||||
|
dto.hidden !== undefined
|
||||||
|
? dto.hidden.filter((k) => typeof k === 'string' && k.trim())
|
||||||
|
: (prev?.hidden ?? []),
|
||||||
|
...(widths && Object.keys(widths).length ? { widths } : {}),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
const updated = await this.prisma.hqAccount.update({
|
const updated = await this.prisma.hqAccount.update({
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { IsArray, IsBoolean, IsIn, IsNotEmpty, IsOptional, IsString } from 'class-validator';
|
import { IsArray, IsBoolean, IsIn, IsNotEmpty, IsObject, IsOptional, IsString } from 'class-validator';
|
||||||
import { SmsScene } from '@dukang/shared-types';
|
import { SmsScene } from '@dukang/shared-types';
|
||||||
|
|
||||||
export class SendSmsDto {
|
export class SendSmsDto {
|
||||||
@@ -144,4 +144,8 @@ export class SaveHqListColumnPrefsDto {
|
|||||||
@IsArray()
|
@IsArray()
|
||||||
@IsString({ each: true })
|
@IsString({ each: true })
|
||||||
hidden?: string[];
|
hidden?: string[];
|
||||||
|
|
||||||
|
@IsOptional()
|
||||||
|
@IsObject()
|
||||||
|
widths?: Record<string, number>;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,7 +33,20 @@ export class AdminBenefitService {
|
|||||||
take: pageSize,
|
take: pageSize,
|
||||||
include: {
|
include: {
|
||||||
user: { select: { id: true, userNo: true, phone: true, nickname: true } },
|
user: { select: { id: true, userNo: true, phone: true, nickname: true } },
|
||||||
order: { select: { id: true, orderNo: true, status: true } },
|
order: {
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
orderNo: true,
|
||||||
|
status: true,
|
||||||
|
productName: true,
|
||||||
|
productSpec: true,
|
||||||
|
quantity: true,
|
||||||
|
saleUnit: true,
|
||||||
|
deliveryType: true,
|
||||||
|
payAmount: true,
|
||||||
|
benefitAmount: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
this.prisma.benefitCoupon.count({ where }),
|
this.prisma.benefitCoupon.count({ where }),
|
||||||
@@ -46,7 +59,20 @@ export class AdminBenefitService {
|
|||||||
where: { id },
|
where: { id },
|
||||||
include: {
|
include: {
|
||||||
user: { select: { id: true, userNo: true, phone: true, nickname: true } },
|
user: { select: { id: true, userNo: true, phone: true, nickname: true } },
|
||||||
order: { select: { id: true, orderNo: true, status: true, payAmount: true } },
|
order: {
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
orderNo: true,
|
||||||
|
status: true,
|
||||||
|
payAmount: true,
|
||||||
|
productName: true,
|
||||||
|
productSpec: true,
|
||||||
|
quantity: true,
|
||||||
|
saleUnit: true,
|
||||||
|
deliveryType: true,
|
||||||
|
benefitAmount: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
if (!coupon) throw new NotFoundException('权益券不存在');
|
if (!coupon) throw new NotFoundException('权益券不存在');
|
||||||
|
|||||||
Reference in New Issue
Block a user