diff --git a/src/pages/Application/ModelManagement/ModelForms/BehaviorRecommendForm.tsx b/src/pages/Application/ModelManagement/ModelForms/BehaviorRecommendForm.tsx
new file mode 100644
index 0000000..75dde59
--- /dev/null
+++ b/src/pages/Application/ModelManagement/ModelForms/BehaviorRecommendForm.tsx
@@ -0,0 +1,41 @@
+import React from 'react';
+import { Form, Row, Col, Card, Slider } from 'antd';
+
+const BehaviorRecommendForm: React.FC = () => {
+ return (
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ );
+};
+
+export default BehaviorRecommendForm;
diff --git a/src/pages/Application/ModelManagement/ModelForms/CompetitivenessForm.tsx b/src/pages/Application/ModelManagement/ModelForms/CompetitivenessForm.tsx
new file mode 100644
index 0000000..951e6ac
--- /dev/null
+++ b/src/pages/Application/ModelManagement/ModelForms/CompetitivenessForm.tsx
@@ -0,0 +1,66 @@
+import React from 'react';
+import { Form, Row, Col, Card, Slider } from 'antd';
+
+const CompetitivenessForm: React.FC = () => {
+ return (
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ );
+};
+
+export default CompetitivenessForm;
diff --git a/src/pages/Application/ModelManagement/ModelForms/LocationMatchForm.tsx b/src/pages/Application/ModelManagement/ModelForms/LocationMatchForm.tsx
new file mode 100644
index 0000000..6a5d687
--- /dev/null
+++ b/src/pages/Application/ModelManagement/ModelForms/LocationMatchForm.tsx
@@ -0,0 +1,71 @@
+import React from 'react';
+import { Form, Row, Col, Card, InputNumber, Select } from 'antd';
+
+const { Option } = Select;
+
+const LocationMatchForm: React.FC = () => {
+ return (
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ );
+};
+
+export default LocationMatchForm;
diff --git a/src/pages/Application/ModelManagement/ModelForms/MatchDegreeForm.tsx b/src/pages/Application/ModelManagement/ModelForms/MatchDegreeForm.tsx
new file mode 100644
index 0000000..415df69
--- /dev/null
+++ b/src/pages/Application/ModelManagement/ModelForms/MatchDegreeForm.tsx
@@ -0,0 +1,66 @@
+import React from 'react';
+import { Form, Row, Col, Card, Slider } from 'antd';
+
+const MatchDegreeForm: React.FC = () => {
+ return (
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ );
+};
+
+export default MatchDegreeForm;
diff --git a/src/pages/Application/ModelManagement/ModelForms/PreciseMatchForm.tsx b/src/pages/Application/ModelManagement/ModelForms/PreciseMatchForm.tsx
new file mode 100644
index 0000000..ce55c9d
--- /dev/null
+++ b/src/pages/Application/ModelManagement/ModelForms/PreciseMatchForm.tsx
@@ -0,0 +1,105 @@
+import React from 'react';
+import { Form, Row, Col, Card, Divider, InputNumber, Slider } from 'antd';
+
+const PreciseMatchForm: React.FC = () => {
+ return (
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ );
+};
+
+export default PreciseMatchForm;
diff --git a/src/pages/Application/ModelManagement/index.tsx b/src/pages/Application/ModelManagement/index.tsx
index 3432866..8a0e133 100644
--- a/src/pages/Application/ModelManagement/index.tsx
+++ b/src/pages/Application/ModelManagement/index.tsx
@@ -1,22 +1,7 @@
import React, { Fragment, useState, useEffect } from 'react';
import { useAccess } from '@umijs/max';
import { getModelConfig, saveModelConfig } from '@/services/application/modelManagement';
-import {
- Card,
- Row,
- Col,
- Form,
- InputNumber,
- Slider,
- Button,
- message,
- Divider,
- Menu,
- Space,
- Typography,
- Select,
- Modal,
-} from 'antd';
+import { Card, Row, Col, Form, Button, message, Menu, Space, Modal } from 'antd';
import {
SaveOutlined,
ReloadOutlined,
@@ -28,8 +13,12 @@ import {
EnvironmentOutlined,
} from '@ant-design/icons';
-const { Title, Text } = Typography;
-const { Option } = Select;
+// 导入表单组件
+import PreciseMatchForm from './ModelForms/PreciseMatchForm'; //人岗精准匹配模型
+import MatchDegreeForm from './ModelForms/MatchDegreeForm'; //人岗匹配度计算模型
+import BehaviorRecommendForm from './ModelForms/BehaviorRecommendForm'; //基于求职者行为的推荐模型
+import CompetitivenessForm from './ModelForms/CompetitivenessForm'; //竞争力计算模型
+import LocationMatchForm from './ModelForms/LocationMatchForm'; //位置匹配模型
function ModelManagement() {
const access = useAccess();
@@ -104,14 +93,12 @@ function ModelManagement() {
const weights = weightConfigs[modelKey] || [];
const total = weights.reduce((sum: number, key: string) => {
const value = formValues[key] || 0;
-
return sum + Math.round(value * 100);
}, 0);
setTotalWeight(total / 100);
};
- //
const handleFormChange = (changedValues: any, allValues: any) => {
calculateTotalWeight(selectedModel, allValues);
};
@@ -187,7 +174,6 @@ function ModelManagement() {
calculateTotalWeight(modelKey, values);
};
-
const handleSaveConfig = async (values: any) => {
setLoading(true);
try {
@@ -208,7 +194,7 @@ function ModelManagement() {
}
};
-
+ // 重置
const handleResetConfig = async () => {
Modal.confirm({
title: '重置确认',
@@ -221,26 +207,44 @@ function ModelManagement() {
});
};
-
+ // 模型切换
const handleModelChange = (key: string) => {
setSelectedModel(key);
loadConfigData(key);
};
-
+ //颜色
const getWeightColor = () => {
if (totalWeight == 1) return '#52c41a';
if (totalWeight > 1) return '#ff4d4f';
return '#faad14';
};
-
+ // 状态文本
const getWeightStatusText = () => {
if (totalWeight == 1) return '权重分配合理';
if (totalWeight > 1) return '权重超出范围';
return '权重分配不足';
};
+ // 渲染表单组件
+ const renderFormComponent = () => {
+ switch (selectedModel) {
+ case 'preciseMatch':
+ return ;
+ case 'matchDegree':
+ return ;
+ case 'behaviorRecommend':
+ return ;
+ case 'competitiveness':
+ return ;
+ case 'locationMatch':
+ return ;
+ default:
+ return null;
+ }
+ };
+
useEffect(() => {
loadConfigData(selectedModel);
}, []);
@@ -366,471 +370,7 @@ function ModelManagement() {
onValuesChange={handleFormChange}
style={{ height: '100%' }}
>
- {/* 人岗精准匹配模型 */}
- {selectedModel === 'preciseMatch' && (
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- )}
-
- {/* 人岗匹配度计算模型 */}
- {selectedModel === 'matchDegree' && (
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- )}
-
- {/* 基于求职者行为的推荐模型 */}
- {selectedModel === 'behaviorRecommend' && (
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- )}
-
- {/* 竞争力计算模型 */}
- {selectedModel === 'competitiveness' && (
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- )}
-
- {/* 位置匹配模型 */}
- {selectedModel === 'locationMatch' && (
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- )}
+ {renderFormComponent()}
diff --git a/src/pages/Application/ModelManagement/modelStyle.less b/src/pages/Application/ModelManagement/modelStyle.less
deleted file mode 100644
index 69239ab..0000000
--- a/src/pages/Application/ModelManagement/modelStyle.less
+++ /dev/null
@@ -1,19 +0,0 @@
-.cards {
- display: grid;
- grid-template-columns: repeat(4, 1fr);
- grid-row-gap: 30px;
-
- .card {
- display: flex;
- align-items: center;
- margin-right: 80px;
-
- .label {
- margin-right: 10px;
- white-space: nowrap;
- }
-
- .input {
- }
- }
-}