1.1.0
parent
4715cd4a86
commit
498bd97f99
|
|
@ -61,3 +61,7 @@ backend/uploads/
|
||||||
.idea/
|
.idea/
|
||||||
*.swp
|
*.swp
|
||||||
*.swo
|
*.swo
|
||||||
|
|
||||||
|
# Vibe Coding
|
||||||
|
.memsearch
|
||||||
|
/frontend/.memsearch
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import {
|
||||||
Button,
|
Button,
|
||||||
Input,
|
Input,
|
||||||
Space,
|
Space,
|
||||||
Modal,
|
Drawer,
|
||||||
Form,
|
Form,
|
||||||
Select,
|
Select,
|
||||||
App,
|
App,
|
||||||
|
|
@ -34,11 +34,11 @@ import {
|
||||||
CloudUploadOutlined,
|
CloudUploadOutlined,
|
||||||
CheckCircleOutlined,
|
CheckCircleOutlined,
|
||||||
RocketOutlined,
|
RocketOutlined,
|
||||||
|
SaveOutlined,
|
||||||
} from '@ant-design/icons';
|
} from '@ant-design/icons';
|
||||||
import apiClient from '../utils/apiClient';
|
import apiClient from '../utils/apiClient';
|
||||||
import { buildApiUrl, API_ENDPOINTS } from '../config/api';
|
import { buildApiUrl, API_ENDPOINTS } from '../config/api';
|
||||||
import AdminModuleShell from '../components/AdminModuleShell';
|
import AdminModuleShell from '../components/AdminModuleShell';
|
||||||
import StatusTag from '../components/StatusTag';
|
|
||||||
|
|
||||||
const { Text } = Typography;
|
const { Text } = Typography;
|
||||||
const { TextArea } = Input;
|
const { TextArea } = Input;
|
||||||
|
|
@ -65,7 +65,7 @@ const ClientManagement = () => {
|
||||||
|
|
||||||
const [clients, setClients] = useState([]);
|
const [clients, setClients] = useState([]);
|
||||||
const [loading, setLoading] = useState(true);
|
const [loading, setLoading] = useState(true);
|
||||||
const [showModal, setShowModal] = useState(false);
|
const [showDrawer, setShowDrawer] = useState(false);
|
||||||
const [isEditing, setIsEditing] = useState(false);
|
const [isEditing, setIsEditing] = useState(false);
|
||||||
const [selectedClient, setSelectedClient] = useState(null);
|
const [selectedClient, setSelectedClient] = useState(null);
|
||||||
const [searchQuery, setSearchQuery] = useState('');
|
const [searchQuery, setSearchQuery] = useState('');
|
||||||
|
|
@ -136,7 +136,7 @@ const ClientManagement = () => {
|
||||||
is_latest: false,
|
is_latest: false,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
setShowModal(true);
|
setShowDrawer(true);
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleSave = async () => {
|
const handleSave = async () => {
|
||||||
|
|
@ -166,7 +166,7 @@ const ClientManagement = () => {
|
||||||
message.success('版本创建成功');
|
message.success('版本创建成功');
|
||||||
}
|
}
|
||||||
|
|
||||||
setShowModal(false);
|
setShowDrawer(false);
|
||||||
fetchClients();
|
fetchClients();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (!error?.errorFields) {
|
if (!error?.errorFields) {
|
||||||
|
|
@ -336,20 +336,16 @@ const ClientManagement = () => {
|
||||||
{
|
{
|
||||||
title: '发布状态',
|
title: '发布状态',
|
||||||
key: 'status',
|
key: 'status',
|
||||||
width: 170,
|
width: 140,
|
||||||
render: (_, record) => (
|
render: (_, record) => (
|
||||||
<Space direction="vertical" size={4}>
|
<Space direction="vertical" size={4}>
|
||||||
<Switch
|
<Switch
|
||||||
|
size="small"
|
||||||
checked={isTruthy(record.is_active)}
|
checked={isTruthy(record.is_active)}
|
||||||
loading={updatingStatusId === record.id}
|
loading={updatingStatusId === record.id}
|
||||||
checkedChildren="启用"
|
|
||||||
unCheckedChildren="停用"
|
|
||||||
onChange={(checked) => handleToggleActive(record, checked)}
|
onChange={(checked) => handleToggleActive(record, checked)}
|
||||||
/>
|
/>
|
||||||
<Space size={6}>
|
{isTruthy(record.is_latest) ? <Badge status="success" text="最新版本" /> : <Badge status="default" text="历史版本" />}
|
||||||
<StatusTag active={record.is_active} compact />
|
|
||||||
{isTruthy(record.is_latest) ? <Badge status="success" text="最新版本" /> : <Badge status="default" text="历史版本" />}
|
|
||||||
</Space>
|
|
||||||
</Space>
|
</Space>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
|
@ -368,13 +364,13 @@ const ClientManagement = () => {
|
||||||
render: (_, record) => (
|
render: (_, record) => (
|
||||||
<Space size="middle">
|
<Space size="middle">
|
||||||
<Tooltip title="编辑">
|
<Tooltip title="编辑">
|
||||||
<Button type="text" icon={<EditOutlined />} onClick={() => openModal(record)} />
|
<Button type="text" className="btn-text-edit" icon={<EditOutlined />} onClick={() => openModal(record)} />
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
<Tooltip title="下载">
|
<Tooltip title="下载">
|
||||||
<Button type="text" icon={<DownloadOutlined />} href={record.download_url} target="_blank" />
|
<Button type="text" className="btn-text-view" icon={<DownloadOutlined />} href={record.download_url} target="_blank" />
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
<Tooltip title="删除">
|
<Tooltip title="删除">
|
||||||
<Button type="text" danger icon={<DeleteOutlined />} onClick={() => handleDelete(record)} />
|
<Button type="text" danger className="btn-text-delete" icon={<DeleteOutlined />} onClick={() => handleDelete(record)} />
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</Space>
|
</Space>
|
||||||
),
|
),
|
||||||
|
|
@ -389,7 +385,7 @@ const ClientManagement = () => {
|
||||||
subtitle="统一维护移动端、桌面端与专用终端的版本发布、安装包上传、启停控制与最新版本标记。"
|
subtitle="统一维护移动端、桌面端与专用终端的版本发布、安装包上传、启停控制与最新版本标记。"
|
||||||
rightActions={(
|
rightActions={(
|
||||||
<Space>
|
<Space>
|
||||||
<Button icon={<ReloadOutlined />} onClick={fetchClients} loading={loading}>刷新</Button>
|
<Button icon={<ReloadOutlined />} className="btn-soft-blue" onClick={fetchClients} loading={loading}>刷新</Button>
|
||||||
<Button type="primary" icon={<PlusOutlined />} onClick={() => openModal()}>新增发布</Button>
|
<Button type="primary" icon={<PlusOutlined />} onClick={() => openModal()}>新增发布</Button>
|
||||||
</Space>
|
</Space>
|
||||||
)}
|
)}
|
||||||
|
|
@ -462,13 +458,20 @@ const ClientManagement = () => {
|
||||||
</div>
|
</div>
|
||||||
</AdminModuleShell>
|
</AdminModuleShell>
|
||||||
|
|
||||||
<Modal
|
<Drawer
|
||||||
open={showModal}
|
open={showDrawer}
|
||||||
title={isEditing ? '编辑客户端版本' : '发布新版本'}
|
title={isEditing ? '编辑客户端版本' : '发布新版本'}
|
||||||
onCancel={() => setShowModal(false)}
|
placement="right"
|
||||||
onOk={handleSave}
|
width={760}
|
||||||
width={720}
|
onClose={() => setShowDrawer(false)}
|
||||||
destroyOnHidden
|
destroyOnClose
|
||||||
|
extra={(
|
||||||
|
<Space>
|
||||||
|
<Button type="primary" icon={<SaveOutlined />} onClick={handleSave}>
|
||||||
|
{isEditing ? '保存修改' : '发布版本'}
|
||||||
|
</Button>
|
||||||
|
</Space>
|
||||||
|
)}
|
||||||
>
|
>
|
||||||
<Form form={form} layout="vertical" style={{ marginTop: 20 }}>
|
<Form form={form} layout="vertical" style={{ marginTop: 20 }}>
|
||||||
<Row gutter={16}>
|
<Row gutter={16}>
|
||||||
|
|
@ -550,7 +553,7 @@ const ClientManagement = () => {
|
||||||
</Space>
|
</Space>
|
||||||
</div>
|
</div>
|
||||||
</Form>
|
</Form>
|
||||||
</Modal>
|
</Drawer>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,6 @@ import {
|
||||||
Segmented,
|
Segmented,
|
||||||
Select,
|
Select,
|
||||||
Space,
|
Space,
|
||||||
Switch,
|
|
||||||
Tag,
|
Tag,
|
||||||
Tooltip,
|
Tooltip,
|
||||||
Typography,
|
Typography,
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import {
|
||||||
Button,
|
Button,
|
||||||
Input,
|
Input,
|
||||||
Space,
|
Space,
|
||||||
Modal,
|
Drawer,
|
||||||
Form,
|
Form,
|
||||||
Select,
|
Select,
|
||||||
App,
|
App,
|
||||||
|
|
@ -20,6 +20,7 @@ import {
|
||||||
} from 'antd';
|
} from 'antd';
|
||||||
import {
|
import {
|
||||||
PlusOutlined,
|
PlusOutlined,
|
||||||
|
SaveOutlined,
|
||||||
DeleteOutlined,
|
DeleteOutlined,
|
||||||
EditOutlined,
|
EditOutlined,
|
||||||
SearchOutlined,
|
SearchOutlined,
|
||||||
|
|
@ -37,7 +38,6 @@ import {
|
||||||
import apiClient from '../../utils/apiClient';
|
import apiClient from '../../utils/apiClient';
|
||||||
import { buildApiUrl, API_ENDPOINTS } from '../../config/api';
|
import { buildApiUrl, API_ENDPOINTS } from '../../config/api';
|
||||||
import AdminModuleShell from '../../components/AdminModuleShell';
|
import AdminModuleShell from '../../components/AdminModuleShell';
|
||||||
import StatusTag from '../../components/StatusTag';
|
|
||||||
|
|
||||||
const { Text } = Typography;
|
const { Text } = Typography;
|
||||||
const { TextArea } = Input;
|
const { TextArea } = Input;
|
||||||
|
|
@ -76,7 +76,7 @@ const ExternalAppManagement = () => {
|
||||||
|
|
||||||
const [apps, setApps] = useState([]);
|
const [apps, setApps] = useState([]);
|
||||||
const [loading, setLoading] = useState(true);
|
const [loading, setLoading] = useState(true);
|
||||||
const [showModal, setShowModal] = useState(false);
|
const [showDrawer, setShowDrawer] = useState(false);
|
||||||
const [isEditing, setIsEditing] = useState(false);
|
const [isEditing, setIsEditing] = useState(false);
|
||||||
const [selectedApp, setSelectedApp] = useState(null);
|
const [selectedApp, setSelectedApp] = useState(null);
|
||||||
const [filterAppType, setFilterAppType] = useState('all');
|
const [filterAppType, setFilterAppType] = useState('all');
|
||||||
|
|
@ -122,7 +122,7 @@ const ExternalAppManagement = () => {
|
||||||
app_info: {},
|
app_info: {},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
setShowModal(true);
|
setShowDrawer(true);
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleSave = async () => {
|
const handleSave = async () => {
|
||||||
|
|
@ -142,7 +142,7 @@ const ExternalAppManagement = () => {
|
||||||
message.success('应用创建成功');
|
message.success('应用创建成功');
|
||||||
}
|
}
|
||||||
|
|
||||||
setShowModal(false);
|
setShowDrawer(false);
|
||||||
fetchApps();
|
fetchApps();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (!error.errorFields) {
|
if (!error.errorFields) {
|
||||||
|
|
@ -308,16 +308,13 @@ const ExternalAppManagement = () => {
|
||||||
{
|
{
|
||||||
title: '状态',
|
title: '状态',
|
||||||
key: 'status',
|
key: 'status',
|
||||||
width: 140,
|
width: 110,
|
||||||
render: (_, record) => (
|
render: (_, record) => (
|
||||||
<Space direction="vertical" size={4}>
|
<Switch
|
||||||
<Switch
|
size="small"
|
||||||
size="small"
|
checked={record.is_active === 1 || record.is_active === true}
|
||||||
checked={record.is_active === 1 || record.is_active === true}
|
onChange={(checked) => handleToggleStatus(record, checked)}
|
||||||
onChange={(checked) => handleToggleStatus(record, checked)}
|
/>
|
||||||
/>
|
|
||||||
<StatusTag active={record.is_active} compact />
|
|
||||||
</Space>
|
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -337,6 +334,7 @@ const ExternalAppManagement = () => {
|
||||||
<Tooltip title="打开入口">
|
<Tooltip title="打开入口">
|
||||||
<Button
|
<Button
|
||||||
type="text"
|
type="text"
|
||||||
|
className="btn-text-view"
|
||||||
icon={<ExportOutlined />}
|
icon={<ExportOutlined />}
|
||||||
href={getAppEntryUrl(record)}
|
href={getAppEntryUrl(record)}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
|
|
@ -344,10 +342,10 @@ const ExternalAppManagement = () => {
|
||||||
/>
|
/>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
<Tooltip title="编辑">
|
<Tooltip title="编辑">
|
||||||
<Button type="text" icon={<EditOutlined />} onClick={() => handleOpenModal(record)} />
|
<Button type="text" className="btn-text-edit" icon={<EditOutlined />} onClick={() => handleOpenModal(record)} />
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
<Tooltip title="删除">
|
<Tooltip title="删除">
|
||||||
<Button type="text" danger icon={<DeleteOutlined />} onClick={() => handleDelete(record)} />
|
<Button type="text" danger className="btn-text-delete" icon={<DeleteOutlined />} onClick={() => handleDelete(record)} />
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</Space>
|
</Space>
|
||||||
),
|
),
|
||||||
|
|
@ -362,7 +360,7 @@ const ExternalAppManagement = () => {
|
||||||
subtitle="统一维护原生应用与 Web 应用入口,支持 APK 自动解析、图标上传和状态治理。"
|
subtitle="统一维护原生应用与 Web 应用入口,支持 APK 自动解析、图标上传和状态治理。"
|
||||||
rightActions={(
|
rightActions={(
|
||||||
<Space>
|
<Space>
|
||||||
<Button icon={<ReloadOutlined />} onClick={fetchApps} loading={loading}>刷新</Button>
|
<Button icon={<ReloadOutlined />} className="btn-soft-blue" onClick={fetchApps} loading={loading}>刷新</Button>
|
||||||
<Button type="primary" icon={<PlusOutlined />} onClick={() => handleOpenModal()}>添加应用</Button>
|
<Button type="primary" icon={<PlusOutlined />} onClick={() => handleOpenModal()}>添加应用</Button>
|
||||||
</Space>
|
</Space>
|
||||||
)}
|
)}
|
||||||
|
|
@ -430,13 +428,20 @@ const ExternalAppManagement = () => {
|
||||||
</div>
|
</div>
|
||||||
</AdminModuleShell>
|
</AdminModuleShell>
|
||||||
|
|
||||||
<Modal
|
<Drawer
|
||||||
open={showModal}
|
open={showDrawer}
|
||||||
title={isEditing ? '编辑外部应用' : '添加外部应用'}
|
title={isEditing ? '编辑外部应用' : '添加外部应用'}
|
||||||
onCancel={() => setShowModal(false)}
|
placement="right"
|
||||||
onOk={() => form.submit()}
|
|
||||||
width={680}
|
width={680}
|
||||||
destroyOnHidden
|
onClose={() => setShowDrawer(false)}
|
||||||
|
destroyOnClose
|
||||||
|
extra={(
|
||||||
|
<Space>
|
||||||
|
<Button type="primary" icon={<SaveOutlined />} onClick={() => form.submit()}>
|
||||||
|
{isEditing ? '保存修改' : '创建应用'}
|
||||||
|
</Button>
|
||||||
|
</Space>
|
||||||
|
)}
|
||||||
>
|
>
|
||||||
<Form form={form} layout="vertical" style={{ marginTop: 20 }} onFinish={handleSave}>
|
<Form form={form} layout="vertical" style={{ marginTop: 20 }} onFinish={handleSave}>
|
||||||
<Form.Item name="app_type" label="应用类型" rules={[{ required: true, message: '请选择应用类型' }]}>
|
<Form.Item name="app_type" label="应用类型" rules={[{ required: true, message: '请选择应用类型' }]}>
|
||||||
|
|
@ -554,12 +559,12 @@ const ExternalAppManagement = () => {
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={12}>
|
<Col span={12}>
|
||||||
<Form.Item name="is_active" label="状态" valuePropName="checked">
|
<Form.Item name="is_active" label="状态" valuePropName="checked">
|
||||||
<Switch checkedChildren="启用" unCheckedChildren="停用" />
|
<Switch />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
</Form>
|
</Form>
|
||||||
</Modal>
|
</Drawer>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -486,7 +486,7 @@ const HotWordManagement = () => {
|
||||||
<Input.TextArea rows={2} placeholder="可选描述" />
|
<Input.TextArea rows={2} placeholder="可选描述" />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item name="status" label="启用" valuePropName="checked">
|
<Form.Item name="status" label="启用" valuePropName="checked">
|
||||||
<Switch checkedChildren="启用" unCheckedChildren="停用" />
|
<Switch />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</Form>
|
</Form>
|
||||||
</Drawer>
|
</Drawer>
|
||||||
|
|
@ -516,7 +516,7 @@ const HotWordManagement = () => {
|
||||||
<Select options={languageOptions.filter((o) => o.value !== 'all')} />
|
<Select options={languageOptions.filter((o) => o.value !== 'all')} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item name="status" label="是否启用" valuePropName="checked">
|
<Form.Item name="status" label="是否启用" valuePropName="checked">
|
||||||
<Switch checkedChildren="启用" unCheckedChildren="停用" />
|
<Switch />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</Form>
|
</Form>
|
||||||
</Drawer>
|
</Drawer>
|
||||||
|
|
|
||||||
|
|
@ -178,7 +178,7 @@ const ParameterManagement = () => {
|
||||||
<Input.TextArea rows={2} />
|
<Input.TextArea rows={2} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item name="is_active" label="启用状态" valuePropName="checked">
|
<Form.Item name="is_active" label="启用状态" valuePropName="checked">
|
||||||
<Switch checkedChildren="启用" unCheckedChildren="停用" />
|
<Switch />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</Form>
|
</Form>
|
||||||
</Drawer>
|
</Drawer>
|
||||||
|
|
|
||||||
|
|
@ -1044,7 +1044,7 @@ const PermissionManagement = () => {
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={12}>
|
<Col span={12}>
|
||||||
<Form.Item label="启用状态" name="is_active" valuePropName="checked">
|
<Form.Item label="启用状态" name="is_active" valuePropName="checked">
|
||||||
<Switch checkedChildren="启用" unCheckedChildren="停用" disabled={menuPanelMode === 'view'} />
|
<Switch disabled={menuPanelMode === 'view'} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
|
|
|
||||||
|
|
@ -195,7 +195,7 @@ const PromptManagement = () => {
|
||||||
</Space>
|
</Space>
|
||||||
<Space>
|
<Space>
|
||||||
<Text type="secondary">状态:</Text>
|
<Text type="secondary">状态:</Text>
|
||||||
<Switch size="small" checked={editingPrompt.is_active === 1} onChange={v => handleEditChange('is_active', v ? 1 : 0)} />
|
<Switch checked={editingPrompt.is_active === 1} onChange={v => handleEditChange('is_active', v ? 1 : 0)} />
|
||||||
</Space>
|
</Space>
|
||||||
</Space>
|
</Space>
|
||||||
</Card>
|
</Card>
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import {
|
||||||
Button,
|
Button,
|
||||||
Input,
|
Input,
|
||||||
Space,
|
Space,
|
||||||
Modal,
|
Drawer,
|
||||||
Form,
|
Form,
|
||||||
Select,
|
Select,
|
||||||
App,
|
App,
|
||||||
|
|
@ -18,6 +18,7 @@ import {
|
||||||
} from 'antd';
|
} from 'antd';
|
||||||
import {
|
import {
|
||||||
PlusOutlined,
|
PlusOutlined,
|
||||||
|
SaveOutlined,
|
||||||
DeleteOutlined,
|
DeleteOutlined,
|
||||||
EditOutlined,
|
EditOutlined,
|
||||||
SearchOutlined,
|
SearchOutlined,
|
||||||
|
|
@ -32,7 +33,6 @@ import {
|
||||||
import apiClient from '../../utils/apiClient';
|
import apiClient from '../../utils/apiClient';
|
||||||
import { buildApiUrl, API_ENDPOINTS } from '../../config/api';
|
import { buildApiUrl, API_ENDPOINTS } from '../../config/api';
|
||||||
import AdminModuleShell from '../../components/AdminModuleShell';
|
import AdminModuleShell from '../../components/AdminModuleShell';
|
||||||
import StatusTag from '../../components/StatusTag';
|
|
||||||
|
|
||||||
const { Text } = Typography;
|
const { Text } = Typography;
|
||||||
const { TextArea } = Input;
|
const { TextArea } = Input;
|
||||||
|
|
@ -52,7 +52,7 @@ const TerminalManagement = () => {
|
||||||
const [filterStatus, setFilterStatus] = useState('all');
|
const [filterStatus, setFilterStatus] = useState('all');
|
||||||
const [filterActivation, setFilterActivation] = useState('all');
|
const [filterActivation, setFilterActivation] = useState('all');
|
||||||
|
|
||||||
const [showModal, setShowModal] = useState(false);
|
const [showDrawer, setShowDrawer] = useState(false);
|
||||||
const [isEditing, setIsEditing] = useState(false);
|
const [isEditing, setIsEditing] = useState(false);
|
||||||
const [selectedTerminal, setSelectedTerminal] = useState(null);
|
const [selectedTerminal, setSelectedTerminal] = useState(null);
|
||||||
|
|
||||||
|
|
@ -107,7 +107,7 @@ const TerminalManagement = () => {
|
||||||
status: true,
|
status: true,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
setShowModal(true);
|
setShowDrawer(true);
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleSave = async () => {
|
const handleSave = async () => {
|
||||||
|
|
@ -126,7 +126,7 @@ const TerminalManagement = () => {
|
||||||
message.success('终端创建成功');
|
message.success('终端创建成功');
|
||||||
}
|
}
|
||||||
|
|
||||||
setShowModal(false);
|
setShowDrawer(false);
|
||||||
fetchTerminals();
|
fetchTerminals();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (!error.errorFields) {
|
if (!error.errorFields) {
|
||||||
|
|
@ -266,16 +266,13 @@ const TerminalManagement = () => {
|
||||||
{
|
{
|
||||||
title: '状态',
|
title: '状态',
|
||||||
key: 'status',
|
key: 'status',
|
||||||
width: 140,
|
width: 110,
|
||||||
render: (_, record) => (
|
render: (_, record) => (
|
||||||
<Space direction="vertical" size={4}>
|
<Switch
|
||||||
<Switch
|
size="small"
|
||||||
size="small"
|
checked={record.status === 1}
|
||||||
checked={record.status === 1}
|
onChange={(checked) => handleToggleStatus(record, checked)}
|
||||||
onChange={(checked) => handleToggleStatus(record, checked)}
|
/>
|
||||||
/>
|
|
||||||
<StatusTag active={record.status} compact />
|
|
||||||
</Space>
|
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -304,10 +301,10 @@ const TerminalManagement = () => {
|
||||||
render: (_, record) => (
|
render: (_, record) => (
|
||||||
<Space size="middle">
|
<Space size="middle">
|
||||||
<Tooltip title="编辑">
|
<Tooltip title="编辑">
|
||||||
<Button type="text" icon={<EditOutlined />} onClick={() => handleOpenModal(record)} />
|
<Button type="text" className="btn-text-edit" icon={<EditOutlined />} onClick={() => handleOpenModal(record)} />
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
<Tooltip title="删除">
|
<Tooltip title="删除">
|
||||||
<Button type="text" danger icon={<DeleteOutlined />} onClick={() => handleDelete(record)} />
|
<Button type="text" danger className="btn-text-delete" icon={<DeleteOutlined />} onClick={() => handleDelete(record)} />
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</Space>
|
</Space>
|
||||||
),
|
),
|
||||||
|
|
@ -322,7 +319,7 @@ const TerminalManagement = () => {
|
||||||
subtitle="维护终端设备全生命周期:注册、绑定、激活、启停与在线状态监控。"
|
subtitle="维护终端设备全生命周期:注册、绑定、激活、启停与在线状态监控。"
|
||||||
rightActions={(
|
rightActions={(
|
||||||
<Space>
|
<Space>
|
||||||
<Button icon={<ReloadOutlined />} onClick={fetchTerminals} loading={loading}>刷新</Button>
|
<Button icon={<ReloadOutlined />} className="btn-soft-blue" onClick={fetchTerminals} loading={loading}>刷新</Button>
|
||||||
<Button type="primary" icon={<PlusOutlined />} onClick={() => handleOpenModal()}>添加终端</Button>
|
<Button type="primary" icon={<PlusOutlined />} onClick={() => handleOpenModal()}>添加终端</Button>
|
||||||
</Space>
|
</Space>
|
||||||
)}
|
)}
|
||||||
|
|
@ -385,7 +382,7 @@ const TerminalManagement = () => {
|
||||||
<Select.Option value="pending">未激活</Select.Option>
|
<Select.Option value="pending">未激活</Select.Option>
|
||||||
</Select>
|
</Select>
|
||||||
<Tooltip title={`最近 ${ONLINE_MINUTES} 分钟内有心跳即视为在线`}>
|
<Tooltip title={`最近 ${ONLINE_MINUTES} 分钟内有心跳即视为在线`}>
|
||||||
<Button icon={<SyncOutlined />} onClick={fetchTerminals} loading={loading} />
|
<Button icon={<SyncOutlined />} className="btn-soft-blue" onClick={fetchTerminals} loading={loading} />
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</Space>
|
</Space>
|
||||||
)}
|
)}
|
||||||
|
|
@ -402,14 +399,20 @@ const TerminalManagement = () => {
|
||||||
</div>
|
</div>
|
||||||
</AdminModuleShell>
|
</AdminModuleShell>
|
||||||
|
|
||||||
<Modal
|
<Drawer
|
||||||
open={showModal}
|
open={showDrawer}
|
||||||
title={isEditing ? '编辑终端' : '添加终端'}
|
title={isEditing ? '编辑终端' : '添加终端'}
|
||||||
onCancel={() => setShowModal(false)}
|
placement="right"
|
||||||
onOk={handleSave}
|
|
||||||
okText={isEditing ? '保存修改' : '创建终端'}
|
|
||||||
width={720}
|
width={720}
|
||||||
destroyOnHidden
|
onClose={() => setShowDrawer(false)}
|
||||||
|
destroyOnClose
|
||||||
|
extra={(
|
||||||
|
<Space>
|
||||||
|
<Button type="primary" icon={<SaveOutlined />} onClick={handleSave}>
|
||||||
|
{isEditing ? '保存修改' : '创建终端'}
|
||||||
|
</Button>
|
||||||
|
</Space>
|
||||||
|
)}
|
||||||
>
|
>
|
||||||
<Form form={form} layout="vertical" style={{ marginTop: 20 }}>
|
<Form form={form} layout="vertical" style={{ marginTop: 20 }}>
|
||||||
<Row gutter={16}>
|
<Row gutter={16}>
|
||||||
|
|
@ -452,7 +455,7 @@ const TerminalManagement = () => {
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={12}>
|
<Col span={12}>
|
||||||
<Form.Item name="status" label="启用状态" valuePropName="checked">
|
<Form.Item name="status" label="启用状态" valuePropName="checked">
|
||||||
<Switch checkedChildren="启用" unCheckedChildren="停用" />
|
<Switch />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
|
|
@ -461,7 +464,7 @@ const TerminalManagement = () => {
|
||||||
<TextArea rows={3} placeholder="记录设备部署位置、资产编号或特殊说明" />
|
<TextArea rows={3} placeholder="记录设备部署位置、资产编号或特殊说明" />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</Form>
|
</Form>
|
||||||
</Modal>
|
</Drawer>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,7 @@
|
||||||
import React, { useEffect, useMemo, useState } from 'react';
|
import React, { useEffect, useMemo, useState } from 'react';
|
||||||
import { Table, Button, Input, Space, Modal, Form, Select, App, Tooltip, Tag } from 'antd';
|
import { Table, Button, Input, Space, Drawer, Form, Select, App, Tooltip, Tag } from 'antd';
|
||||||
import {
|
import {
|
||||||
PlusOutlined,
|
PlusOutlined,
|
||||||
CloseOutlined,
|
|
||||||
EditOutlined,
|
EditOutlined,
|
||||||
DeleteOutlined,
|
DeleteOutlined,
|
||||||
KeyOutlined,
|
KeyOutlined,
|
||||||
|
|
@ -27,7 +26,7 @@ const UserManagement = () => {
|
||||||
const [page, setPage] = useState(1);
|
const [page, setPage] = useState(1);
|
||||||
const [pageSize, setPageSize] = useState(10);
|
const [pageSize, setPageSize] = useState(10);
|
||||||
const [loading, setLoading] = useState(true);
|
const [loading, setLoading] = useState(true);
|
||||||
const [showUserModal, setShowUserModal] = useState(false);
|
const [showUserDrawer, setShowUserDrawer] = useState(false);
|
||||||
const [isEditing, setIsEditing] = useState(false);
|
const [isEditing, setIsEditing] = useState(false);
|
||||||
const [currentUser, setCurrentUser] = useState(null);
|
const [currentUser, setCurrentUser] = useState(null);
|
||||||
const [roles, setRoles] = useState([]);
|
const [roles, setRoles] = useState([]);
|
||||||
|
|
@ -95,7 +94,7 @@ const UserManagement = () => {
|
||||||
form.resetFields();
|
form.resetFields();
|
||||||
form.setFieldsValue({ role_id: 2 });
|
form.setFieldsValue({ role_id: 2 });
|
||||||
}
|
}
|
||||||
setShowUserModal(true);
|
setShowUserDrawer(true);
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleSave = async () => {
|
const handleSave = async () => {
|
||||||
|
|
@ -108,7 +107,7 @@ const UserManagement = () => {
|
||||||
await apiClient.post(buildApiUrl(API_ENDPOINTS.USERS.CREATE), values);
|
await apiClient.post(buildApiUrl(API_ENDPOINTS.USERS.CREATE), values);
|
||||||
message.success('用户添加成功');
|
message.success('用户添加成功');
|
||||||
}
|
}
|
||||||
setShowUserModal(false);
|
setShowUserDrawer(false);
|
||||||
fetchUsers();
|
fetchUsers();
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (err.response) {
|
if (err.response) {
|
||||||
|
|
@ -258,15 +257,20 @@ const UserManagement = () => {
|
||||||
</div>
|
</div>
|
||||||
</AdminModuleShell>
|
</AdminModuleShell>
|
||||||
|
|
||||||
<Modal
|
<Drawer
|
||||||
open={showUserModal}
|
open={showUserDrawer}
|
||||||
title={isEditing ? '编辑用户' : '新增用户'}
|
title={isEditing ? '编辑用户' : '新增用户'}
|
||||||
onCancel={() => setShowUserModal(false)}
|
placement="right"
|
||||||
onOk={handleSave}
|
width={520}
|
||||||
okText={isEditing ? '保存修改' : '创建用户'}
|
onClose={() => setShowUserDrawer(false)}
|
||||||
okButtonProps={{ icon: <SaveOutlined /> }}
|
destroyOnClose
|
||||||
cancelButtonProps={{ icon: <CloseOutlined /> }}
|
extra={(
|
||||||
destroyOnHidden
|
<Space>
|
||||||
|
<Button type="primary" icon={<SaveOutlined />} onClick={handleSave}>
|
||||||
|
{isEditing ? '保存修改' : '创建用户'}
|
||||||
|
</Button>
|
||||||
|
</Space>
|
||||||
|
)}
|
||||||
>
|
>
|
||||||
<Form form={form} layout="vertical" style={{ marginTop: 20 }} initialValues={{ role_id: 2 }}>
|
<Form form={form} layout="vertical" style={{ marginTop: 20 }} initialValues={{ role_id: 2 }}>
|
||||||
<Form.Item name="username" label="用户名" rules={[{ required: true, message: '请输入用户名' }]}>
|
<Form.Item name="username" label="用户名" rules={[{ required: true, message: '请输入用户名' }]}>
|
||||||
|
|
@ -299,7 +303,7 @@ const UserManagement = () => {
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</Form>
|
</Form>
|
||||||
</Modal>
|
</Drawer>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue