feat: 自行开发设计 ui样式优化 超管端-控制台 相关的页面
This commit is contained in:
@@ -161,6 +161,7 @@ const PartnerCodeChip = ({ code, t }) => (
|
||||
type='button'
|
||||
onClick={async () => {
|
||||
if (await copy(code)) showSuccess(t('伙伴编号已复制'));
|
||||
else showError(t('复制失败,请手动复制'));
|
||||
}}
|
||||
className='flex items-center gap-1.5 px-2.5 py-1 rounded-md bg-brand/10 text-brand-deep hover:bg-brand/20 transition-colors text-xs font-mono font-semibold cursor-pointer border-none'
|
||||
title={t('点击复制')}
|
||||
@@ -361,6 +362,7 @@ function Overview({ dashboard, t, onGoto }) {
|
||||
|
||||
function Leads({ t, readOnly, canSubmit }) {
|
||||
const [rows, setRows] = useState([]);
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [total, setTotal] = useState(0);
|
||||
const [page, setPage] = useState(1);
|
||||
const [showSubmit, setShowSubmit] = useState(false);
|
||||
@@ -368,11 +370,20 @@ function Leads({ t, readOnly, canSubmit }) {
|
||||
const [extendTarget, setExtendTarget] = useState(null);
|
||||
|
||||
const load = useCallback(async (p = 1) => {
|
||||
const res = await API.get(`/api/partner/leads?p=${p - 1}`);
|
||||
if (res.data.success) {
|
||||
setRows(res.data.data.items || []);
|
||||
setTotal(res.data.data.total || 0);
|
||||
setPage(p);
|
||||
setLoading(true);
|
||||
try {
|
||||
const res = await API.get(`/api/partner/leads?p=${p - 1}`);
|
||||
if (res.data.success) {
|
||||
setRows(res.data.data.items || []);
|
||||
setTotal(res.data.data.total || 0);
|
||||
setPage(p);
|
||||
} else {
|
||||
showError(res.data.message);
|
||||
}
|
||||
} catch (err) {
|
||||
showError(err.message);
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
}, []);
|
||||
|
||||
@@ -476,6 +487,7 @@ function Leads({ t, readOnly, canSubmit }) {
|
||||
<Table
|
||||
columns={columns}
|
||||
dataSource={rows}
|
||||
loading={loading}
|
||||
rowKey='id'
|
||||
scroll={{ x: 'max-content' }}
|
||||
empty={
|
||||
@@ -608,16 +620,26 @@ function Leads({ t, readOnly, canSubmit }) {
|
||||
|
||||
function Customers({ t, readOnly }) {
|
||||
const [rows, setRows] = useState([]);
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [total, setTotal] = useState(0);
|
||||
const [page, setPage] = useState(1);
|
||||
const [serviceTarget, setServiceTarget] = useState(null);
|
||||
|
||||
const load = useCallback(async (p = 1) => {
|
||||
const res = await API.get(`/api/partner/customers?p=${p - 1}`);
|
||||
if (res.data.success) {
|
||||
setRows(res.data.data.items || []);
|
||||
setTotal(res.data.data.total || 0);
|
||||
setPage(p);
|
||||
setLoading(true);
|
||||
try {
|
||||
const res = await API.get(`/api/partner/customers?p=${p - 1}`);
|
||||
if (res.data.success) {
|
||||
setRows(res.data.data.items || []);
|
||||
setTotal(res.data.data.total || 0);
|
||||
setPage(p);
|
||||
} else {
|
||||
showError(res.data.message);
|
||||
}
|
||||
} catch (err) {
|
||||
showError(err.message);
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
}, []);
|
||||
|
||||
@@ -700,6 +722,7 @@ function Customers({ t, readOnly }) {
|
||||
<Table
|
||||
columns={columns}
|
||||
dataSource={rows}
|
||||
loading={loading}
|
||||
rowKey='id'
|
||||
scroll={{ x: 'max-content' }}
|
||||
empty={<Empty description={t('暂无归属客户')} />}
|
||||
|
||||
Reference in New Issue
Block a user