|
|
|
@ -80,7 +80,7 @@ const AlgorithmSetting: React.FC = () => {
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
title: (
|
|
|
|
|
<FormattedMessage id="device.device_group.table.list.createTime" defaultMessage="$$$" />
|
|
|
|
|
<FormattedMessage id="device.device_group.table.list.createTime" defaultMessage="$$$" />
|
|
|
|
|
),
|
|
|
|
|
dataIndex: 'createTime',
|
|
|
|
|
sorter: true,
|
|
|
|
@ -90,7 +90,7 @@ const AlgorithmSetting: React.FC = () => {
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
title: (
|
|
|
|
|
<FormattedMessage id="device.device_group.table.list.updateTime" defaultMessage="$$$" />
|
|
|
|
|
<FormattedMessage id="device.device_group.table.list.updateTime" defaultMessage="$$$" />
|
|
|
|
|
),
|
|
|
|
|
dataIndex: 'updateTime',
|
|
|
|
|
sorter: true,
|
|
|
|
@ -126,38 +126,38 @@ const AlgorithmSetting: React.FC = () => {
|
|
|
|
|
console.log(resp.data.list);
|
|
|
|
|
let model_data = ([...v?.models] || []).map((item: any) => ({
|
|
|
|
|
content: (
|
|
|
|
|
<ProCard
|
|
|
|
|
style={{ backgroundColor: 'rgba(21, 91, 212, 0.03)' }}
|
|
|
|
|
bodyStyle={{ margin: 0, padding: 0 }}
|
|
|
|
|
>
|
|
|
|
|
<div
|
|
|
|
|
style={{
|
|
|
|
|
display: 'flex',
|
|
|
|
|
alignItems: 'center',
|
|
|
|
|
padding: 15,
|
|
|
|
|
justifyContent: 'space-between',
|
|
|
|
|
}}
|
|
|
|
|
<ProCard
|
|
|
|
|
style={{ backgroundColor: 'rgba(21, 91, 212, 0.03)' }}
|
|
|
|
|
bodyStyle={{ margin: 0, padding: 0 }}
|
|
|
|
|
>
|
|
|
|
|
<div>
|
|
|
|
|
<img src="/images/icons/logo.svg" alt="" style={{ width: '64px' }} />
|
|
|
|
|
</div>
|
|
|
|
|
<Button
|
|
|
|
|
type="link"
|
|
|
|
|
size="small"
|
|
|
|
|
key={item.configId}
|
|
|
|
|
style={{ padding: 0, fontWeight: 700 }}
|
|
|
|
|
onClick={() => {
|
|
|
|
|
setProjectData(item);
|
|
|
|
|
console.log(item, 'setProjectData_item', projectData);
|
|
|
|
|
setProjectConfigId(item.configId);
|
|
|
|
|
handleUpdateModal();
|
|
|
|
|
}}
|
|
|
|
|
<div
|
|
|
|
|
style={{
|
|
|
|
|
display: 'flex',
|
|
|
|
|
alignItems: 'center',
|
|
|
|
|
padding: 15,
|
|
|
|
|
justifyContent: 'space-between',
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
配置参数
|
|
|
|
|
</Button>
|
|
|
|
|
</div>
|
|
|
|
|
<ProjectCard info={item}></ProjectCard>
|
|
|
|
|
</ProCard>
|
|
|
|
|
<div>
|
|
|
|
|
<img src="/images/icons/logo.svg" alt="" style={{ width: '64px' }} />
|
|
|
|
|
</div>
|
|
|
|
|
<Button
|
|
|
|
|
type="link"
|
|
|
|
|
size="small"
|
|
|
|
|
key={item.configId}
|
|
|
|
|
style={{ padding: 0, fontWeight: 700 }}
|
|
|
|
|
onClick={() => {
|
|
|
|
|
setProjectData(item);
|
|
|
|
|
console.log(item, 'setProjectData_item', projectData);
|
|
|
|
|
setProjectConfigId(item.configId);
|
|
|
|
|
handleUpdateModal();
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
配置参数
|
|
|
|
|
</Button>
|
|
|
|
|
</div>
|
|
|
|
|
<ProjectCard info={item}></ProjectCard>
|
|
|
|
|
</ProCard>
|
|
|
|
|
),
|
|
|
|
|
}));
|
|
|
|
|
setModelData(model_data);
|
|
|
|
@ -184,34 +184,34 @@ const AlgorithmSetting: React.FC = () => {
|
|
|
|
|
subTitle: <Tag color="#5BD8A6">经典算法</Tag>,
|
|
|
|
|
avatar: 'https://gw.alipayobjects.com/zos/antfincdn/UCSiy1j6jx/xingzhuang.svg',
|
|
|
|
|
content: (
|
|
|
|
|
<ProCard bodyStyle={{ margin: 0, padding: 0 }}>
|
|
|
|
|
<div
|
|
|
|
|
style={{
|
|
|
|
|
display: 'flex',
|
|
|
|
|
alignItems: 'center',
|
|
|
|
|
padding: 15,
|
|
|
|
|
justifyContent: 'space-between',
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
<div>
|
|
|
|
|
<div>{JSON.stringify(item.configId)}</div>
|
|
|
|
|
<img src="/images/model.png" alt="" style={{ width: '64px' }} />
|
|
|
|
|
</div>
|
|
|
|
|
<Button
|
|
|
|
|
type="link"
|
|
|
|
|
size="small"
|
|
|
|
|
key={item.configId}
|
|
|
|
|
style={{ padding: 0 }}
|
|
|
|
|
onClick={() => {
|
|
|
|
|
setProjectConfigId(item.configId);
|
|
|
|
|
handleUpdateModal();
|
|
|
|
|
}}
|
|
|
|
|
<ProCard bodyStyle={{ margin: 0, padding: 0 }}>
|
|
|
|
|
<div
|
|
|
|
|
style={{
|
|
|
|
|
display: 'flex',
|
|
|
|
|
alignItems: 'center',
|
|
|
|
|
padding: 15,
|
|
|
|
|
justifyContent: 'space-between',
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
配置
|
|
|
|
|
</Button>
|
|
|
|
|
</div>
|
|
|
|
|
<ProjectCard info={item}></ProjectCard>
|
|
|
|
|
</ProCard>
|
|
|
|
|
<div>
|
|
|
|
|
<div>{JSON.stringify(item.configId)}</div>
|
|
|
|
|
<img src="/images/model.png" alt="" style={{ width: '64px' }} />
|
|
|
|
|
</div>
|
|
|
|
|
<Button
|
|
|
|
|
type="link"
|
|
|
|
|
size="small"
|
|
|
|
|
key={item.configId}
|
|
|
|
|
style={{ padding: 0 }}
|
|
|
|
|
onClick={() => {
|
|
|
|
|
setProjectConfigId(item.configId);
|
|
|
|
|
handleUpdateModal();
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
配置
|
|
|
|
|
</Button>
|
|
|
|
|
</div>
|
|
|
|
|
<ProjectCard info={item}></ProjectCard>
|
|
|
|
|
</ProCard>
|
|
|
|
|
),
|
|
|
|
|
};
|
|
|
|
|
});
|
|
|
|
@ -227,180 +227,175 @@ const AlgorithmSetting: React.FC = () => {
|
|
|
|
|
}
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
postDeviceGroupGetDeviceGroupTree()
|
|
|
|
|
.then((resp) => {
|
|
|
|
|
setNodeTreeData(resp.data.tree);
|
|
|
|
|
setHasInit(true);
|
|
|
|
|
})
|
|
|
|
|
.catch(() => {
|
|
|
|
|
message.error(intl.formatMessage({ id: 'common.failure', defaultMessage: '$$$' }));
|
|
|
|
|
});
|
|
|
|
|
.then((resp) => {
|
|
|
|
|
setNodeTreeData(resp.data.tree);
|
|
|
|
|
setHasInit(true);
|
|
|
|
|
})
|
|
|
|
|
.catch(() => {
|
|
|
|
|
message.error(intl.formatMessage({ id: 'common.failure', defaultMessage: '$$$' }));
|
|
|
|
|
});
|
|
|
|
|
}, []);
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<PageContainer className="algorithmSetting_project_box gn">
|
|
|
|
|
<TreeAndTableList
|
|
|
|
|
leftCard={
|
|
|
|
|
{
|
|
|
|
|
title: '网点选择',
|
|
|
|
|
} as ProCardTypeProps
|
|
|
|
|
}
|
|
|
|
|
leftDom={
|
|
|
|
|
hasInit && (
|
|
|
|
|
<Tree
|
|
|
|
|
checkable={false}
|
|
|
|
|
defaultExpandAll={true}
|
|
|
|
|
selectedKeys={selectNodes}
|
|
|
|
|
treeData={nodeTreeData}
|
|
|
|
|
onSelect={(selectKeys, info) => {
|
|
|
|
|
// TODO_1 此处接口需要重新联调
|
|
|
|
|
console.log(info.node, 'onSelect_info');
|
|
|
|
|
setSelectNodes(selectKeys);
|
|
|
|
|
fetchProjectInfoByGroupId(info?.node);
|
|
|
|
|
fetchProjectByGroupId(info?.node);
|
|
|
|
|
actionRef.current?.reload();
|
|
|
|
|
}}
|
|
|
|
|
checkStrictly={false}
|
|
|
|
|
/>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
rightDom={
|
|
|
|
|
<>
|
|
|
|
|
<ProCard
|
|
|
|
|
title="网点详细信息"
|
|
|
|
|
headStyle={{ borderBottom: '1px solid #E0E0E0', padding: '0px 16px 16px' }}
|
|
|
|
|
style={{ background: 'transparent', paddingTop: 16 }}
|
|
|
|
|
bodyStyle={{ padding: '16px 16px 0px' }}
|
|
|
|
|
colSpan="80%"
|
|
|
|
|
>
|
|
|
|
|
<ProDescriptions
|
|
|
|
|
column={3}
|
|
|
|
|
dataSource={currentRow}
|
|
|
|
|
columns={columns}
|
|
|
|
|
></ProDescriptions>
|
|
|
|
|
</ProCard>
|
|
|
|
|
{tabs?.length ? (
|
|
|
|
|
<PageContainer className="algorithmSetting_project_box gn">
|
|
|
|
|
<TreeAndTableList
|
|
|
|
|
leftCard={
|
|
|
|
|
{
|
|
|
|
|
title: '网点选择',
|
|
|
|
|
} as ProCardTypeProps
|
|
|
|
|
}
|
|
|
|
|
leftDom={
|
|
|
|
|
hasInit && (
|
|
|
|
|
<Tree
|
|
|
|
|
checkable={false}
|
|
|
|
|
defaultExpandAll={true}
|
|
|
|
|
selectedKeys={selectNodes}
|
|
|
|
|
treeData={nodeTreeData}
|
|
|
|
|
onSelect={(selectKeys, info) => {
|
|
|
|
|
// TODO_1 此处接口需要重新联调
|
|
|
|
|
console.log(info.node, 'onSelect_info');
|
|
|
|
|
setSelectNodes(selectKeys);
|
|
|
|
|
fetchProjectInfoByGroupId(info?.node);
|
|
|
|
|
fetchProjectByGroupId(info?.node);
|
|
|
|
|
actionRef.current?.reload();
|
|
|
|
|
}}
|
|
|
|
|
checkStrictly={false}
|
|
|
|
|
/>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
rightDom={
|
|
|
|
|
<>
|
|
|
|
|
<Tabs
|
|
|
|
|
activeKey={tab}
|
|
|
|
|
items={tabs}
|
|
|
|
|
onChange={(key) => {
|
|
|
|
|
setActiveMode('1'); // 重置到项目详情
|
|
|
|
|
changeProjectTab(key);
|
|
|
|
|
}}
|
|
|
|
|
></Tabs>
|
|
|
|
|
<ProCard bodyStyle={{ padding: 0, margin: 0 }} style={{ padding: 0, margin: 0 }}>
|
|
|
|
|
<ul
|
|
|
|
|
className="algorithmSetting_mode_box"
|
|
|
|
|
style={{ display: 'flex', padding: '0 16px', margin: 0 }}
|
|
|
|
|
>
|
|
|
|
|
{tabModeList.map((item) => {
|
|
|
|
|
// TODO 统一使用button默认效果 'primary' : 'default'
|
|
|
|
|
return (
|
|
|
|
|
<li
|
|
|
|
|
key={item.value}
|
|
|
|
|
className={item.value === activeMode ? 'active' : ''}
|
|
|
|
|
onClick={() => changeMode(item)}
|
|
|
|
|
style={{
|
|
|
|
|
padding: '16px 12px 0 0',
|
|
|
|
|
<ProCard
|
|
|
|
|
title="网点详细信息"
|
|
|
|
|
headStyle={{ borderBottom: '1px solid #E0E0E0', padding: '0px 16px 16px' }}
|
|
|
|
|
style={{ background: 'transparent', paddingTop: 16 }}
|
|
|
|
|
bodyStyle={{ padding: '16px 16px 0px' }}
|
|
|
|
|
colSpan="80%"
|
|
|
|
|
>
|
|
|
|
|
<ProDescriptions
|
|
|
|
|
column={3}
|
|
|
|
|
dataSource={currentRow}
|
|
|
|
|
columns={columns}
|
|
|
|
|
></ProDescriptions>
|
|
|
|
|
</ProCard>
|
|
|
|
|
{tabs?.length ? (
|
|
|
|
|
<>
|
|
|
|
|
<Tabs
|
|
|
|
|
activeKey={tab}
|
|
|
|
|
items={tabs}
|
|
|
|
|
onChange={(key) => {
|
|
|
|
|
setActiveMode('1'); // 重置到项目详情
|
|
|
|
|
changeProjectTab(key);
|
|
|
|
|
}}
|
|
|
|
|
></Tabs>
|
|
|
|
|
<ProCard bodyStyle={{ padding: 0, margin: 0 }} style={{ padding: 0, margin: 0 }}>
|
|
|
|
|
<ul
|
|
|
|
|
className="algorithmSetting_mode_box"
|
|
|
|
|
style={{ display: 'flex', padding: '0 16px', margin: 0 }}
|
|
|
|
|
>
|
|
|
|
|
<Button type="default">{item.label}</Button>
|
|
|
|
|
</li>
|
|
|
|
|
);
|
|
|
|
|
})}
|
|
|
|
|
</ul>
|
|
|
|
|
{tabModeList.map((item) => {
|
|
|
|
|
return (
|
|
|
|
|
<li
|
|
|
|
|
key={item.value}
|
|
|
|
|
className={item.value === activeMode ? 'active' : ''}
|
|
|
|
|
onClick={() => changeMode(item)}
|
|
|
|
|
style={{
|
|
|
|
|
padding: '16px 12px 0 0',
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
<Button type="default">{item.label}</Button>
|
|
|
|
|
</li>
|
|
|
|
|
);
|
|
|
|
|
})}
|
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
{/* 项目 */}
|
|
|
|
|
{activeMode === '1' ? (
|
|
|
|
|
<>
|
|
|
|
|
<div
|
|
|
|
|
style={{
|
|
|
|
|
display: 'flex',
|
|
|
|
|
alignItems: 'center',
|
|
|
|
|
justifyContent: 'space-between',
|
|
|
|
|
padding: '16px 16px 3px',
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
<span style={{ fontSize: 16, fontWeight: 700 }}>模型列表</span>
|
|
|
|
|
{/* // TODO 需要对接接口 */}
|
|
|
|
|
{false ? (
|
|
|
|
|
<Button type="primary" danger>
|
|
|
|
|
<PauseOutlined style={{ fontSize: 14, lineHeight: 1.5 }} />
|
|
|
|
|
结束运行
|
|
|
|
|
</Button>
|
|
|
|
|
{/* 项目 */}
|
|
|
|
|
{activeMode === '1' ? (
|
|
|
|
|
<>
|
|
|
|
|
<div
|
|
|
|
|
style={{
|
|
|
|
|
display: 'flex',
|
|
|
|
|
alignItems: 'center',
|
|
|
|
|
justifyContent: 'space-between',
|
|
|
|
|
padding: '16px 16px 3px',
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
<span style={{ fontSize: 16, fontWeight: 700 }}>模型列表</span>
|
|
|
|
|
{/* // TODO 需要对接接口 */}
|
|
|
|
|
{(
|
|
|
|
|
<Button type="primary">
|
|
|
|
|
<CaretRightOutlined style={{fontSize: 14, lineHeight: 1.5}}/>
|
|
|
|
|
开始运行
|
|
|
|
|
</Button>
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
|
|
|
|
<ProList<any>
|
|
|
|
|
actionRef={actionRef}
|
|
|
|
|
style={{
|
|
|
|
|
padding: '0px 16px 16px',
|
|
|
|
|
}}
|
|
|
|
|
className="gn"
|
|
|
|
|
ghost={true}
|
|
|
|
|
itemCardProps={{
|
|
|
|
|
ghost: true,
|
|
|
|
|
bodyStyle: { padding: 0, margin: 0 },
|
|
|
|
|
}}
|
|
|
|
|
pagination={{
|
|
|
|
|
defaultPageSize: 6,
|
|
|
|
|
showSizeChanger: false,
|
|
|
|
|
}}
|
|
|
|
|
showActions="hover"
|
|
|
|
|
grid={{ gutter: 8, xs: 1, md: 2, xl: 3, xxl: 4 }}
|
|
|
|
|
metas={{
|
|
|
|
|
type: {},
|
|
|
|
|
content: {},
|
|
|
|
|
actions: {
|
|
|
|
|
cardActionProps: 'extra',
|
|
|
|
|
},
|
|
|
|
|
}}
|
|
|
|
|
dataSource={modelData}
|
|
|
|
|
/>
|
|
|
|
|
</>
|
|
|
|
|
) : (
|
|
|
|
|
<Button type="primary">
|
|
|
|
|
<CaretRightOutlined style={{ fontSize: 14, lineHeight: 1.5 }} />
|
|
|
|
|
开始运行
|
|
|
|
|
</Button>
|
|
|
|
|
<div style={{ padding: 16 }}>
|
|
|
|
|
<AlarmSetForm
|
|
|
|
|
currentRow={{
|
|
|
|
|
type: '2',
|
|
|
|
|
ways: [
|
|
|
|
|
{
|
|
|
|
|
label: '短信',
|
|
|
|
|
value: [],
|
|
|
|
|
isChecked: [],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '邮件',
|
|
|
|
|
value: [],
|
|
|
|
|
isChecked: [],
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
}}
|
|
|
|
|
></AlarmSetForm>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
|
|
|
|
<ProList<any>
|
|
|
|
|
style={{
|
|
|
|
|
padding: '0px 16px 16px',
|
|
|
|
|
}}
|
|
|
|
|
className="gn"
|
|
|
|
|
ghost={true}
|
|
|
|
|
itemCardProps={{
|
|
|
|
|
ghost: true,
|
|
|
|
|
bodyStyle: { padding: 0, margin: 0 },
|
|
|
|
|
}}
|
|
|
|
|
pagination={{
|
|
|
|
|
defaultPageSize: 6,
|
|
|
|
|
showSizeChanger: false,
|
|
|
|
|
}}
|
|
|
|
|
showActions="hover"
|
|
|
|
|
grid={{ gutter: 8, xs: 1, md: 2, xl: 3, xxl: 4 }}
|
|
|
|
|
metas={{
|
|
|
|
|
type: {},
|
|
|
|
|
content: {},
|
|
|
|
|
actions: {
|
|
|
|
|
cardActionProps: 'extra',
|
|
|
|
|
},
|
|
|
|
|
}}
|
|
|
|
|
dataSource={modelData}
|
|
|
|
|
/>
|
|
|
|
|
</ProCard>
|
|
|
|
|
</>
|
|
|
|
|
) : (
|
|
|
|
|
<div style={{ padding: 16 }}>
|
|
|
|
|
<AlarmSetForm
|
|
|
|
|
currentRow={{
|
|
|
|
|
type: '2',
|
|
|
|
|
ways: [
|
|
|
|
|
{
|
|
|
|
|
label: '短信',
|
|
|
|
|
value: [],
|
|
|
|
|
isChecked: [],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '邮件',
|
|
|
|
|
value: [],
|
|
|
|
|
isChecked: [],
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
}}
|
|
|
|
|
></AlarmSetForm>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
</ProCard>
|
|
|
|
|
</>
|
|
|
|
|
) : (
|
|
|
|
|
<>
|
|
|
|
|
<Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />
|
|
|
|
|
) : (
|
|
|
|
|
<>
|
|
|
|
|
<Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />
|
|
|
|
|
</>
|
|
|
|
|
)}
|
|
|
|
|
</>
|
|
|
|
|
)}
|
|
|
|
|
</>
|
|
|
|
|
}
|
|
|
|
|
></TreeAndTableList>
|
|
|
|
|
<UpdateForm
|
|
|
|
|
projectData={projectData as Record<string, any>}
|
|
|
|
|
updateModalOpen={updateModalOpen}
|
|
|
|
|
handleModal={handleUpdateModal}
|
|
|
|
|
groupId={currentRow?.id || 0}
|
|
|
|
|
reload={actionRef.current?.reload}
|
|
|
|
|
projectModelConfigId={projectConfigId}
|
|
|
|
|
/>
|
|
|
|
|
</PageContainer>
|
|
|
|
|
}
|
|
|
|
|
></TreeAndTableList>
|
|
|
|
|
<UpdateForm
|
|
|
|
|
projectData={projectData as Record<string, any>}
|
|
|
|
|
updateModalOpen={updateModalOpen}
|
|
|
|
|
handleModal={handleUpdateModal}
|
|
|
|
|
groupId={currentRow?.id || 0}
|
|
|
|
|
reload={actionRef.current?.reload}
|
|
|
|
|
projectModelConfigId={projectConfigId}
|
|
|
|
|
/>
|
|
|
|
|
</PageContainer>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|