删除门店的多银行账户列表
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { useEffect, useMemo, useRef, useState, type ReactNode } from 'react';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { useNavigate, useSearchParams } from 'react-router-dom';
|
||||
import {
|
||||
Alert,
|
||||
Button,
|
||||
@@ -159,6 +159,9 @@ function renderField(
|
||||
|
||||
export default function SystemSettingsPage() {
|
||||
const navigate = useNavigate();
|
||||
const [searchParams] = useSearchParams();
|
||||
const groupKey = searchParams.get('group')?.trim() || '';
|
||||
const [activeKeys, setActiveKeys] = useState<string[]>(() => (groupKey ? [groupKey] : []));
|
||||
const [form] = Form.useForm<Record<string, string>>();
|
||||
const [meta, setMeta] = useState<SystemConfigFormResponse | null>(null);
|
||||
const [profile, setProfile] = useState<HqProfile | null>(null);
|
||||
@@ -327,13 +330,30 @@ export default function SystemSettingsPage() {
|
||||
|
||||
return {
|
||||
key: group.key,
|
||||
label: group.label,
|
||||
label: <span id={`sys-setting-group-${group.key}`}>{group.label}</span>,
|
||||
forceRender: true,
|
||||
children,
|
||||
};
|
||||
});
|
||||
}, [meta, mockSmsEnabled, loading]);
|
||||
|
||||
useEffect(() => {
|
||||
if (groupKey) {
|
||||
setActiveKeys((prev) => (prev.includes(groupKey) ? prev : [...prev, groupKey]));
|
||||
}
|
||||
}, [groupKey]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!groupKey || loading) return;
|
||||
const timer = window.setTimeout(() => {
|
||||
document.getElementById(`sys-setting-group-${groupKey}`)?.scrollIntoView({
|
||||
behavior: 'smooth',
|
||||
block: 'start',
|
||||
});
|
||||
}, 80);
|
||||
return () => window.clearTimeout(timer);
|
||||
}, [groupKey, loading]);
|
||||
|
||||
async function onSave() {
|
||||
await form.validateFields();
|
||||
const values = form.getFieldsValue(true);
|
||||
@@ -432,7 +452,11 @@ export default function SystemSettingsPage() {
|
||||
|
||||
<Card loading={loading}>
|
||||
<Form form={form} layout="vertical" onValuesChange={() => setDirty(true)}>
|
||||
<Collapse defaultActiveKey={[]} items={collapseItems} />
|
||||
<Collapse
|
||||
activeKey={activeKeys}
|
||||
onChange={(keys) => setActiveKeys(Array.isArray(keys) ? keys : [keys])}
|
||||
items={collapseItems}
|
||||
/>
|
||||
</Form>
|
||||
{meta?.updatedAt ? (
|
||||
<Typography.Text type="secondary" style={{ display: 'block', marginTop: 16 }}>
|
||||
|
||||
Reference in New Issue
Block a user