Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx-web
/
achievements-system-front
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit b6f7380a
authored
Jun 13, 2023
by
杨明
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fixed
1 parent
bc8d34ba
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
3 deletions
src/api/request/index.ts
src/views/Classify/components/Edit.tsx
src/api/request/index.ts
View file @
b6f7380
import
HttpRequest
from
"./request"
;
import
HttpRequest
from
"./request"
;
const
config
=
{
const
config
=
{
baseUrl
:
{
baseUrl
:
{
dev
:
"http://
achievements-system-backend.test.glsx.com.cn
"
,
dev
:
"http://
192.168.1.127:8001
"
,
prod
:
"http://achievements-system-backend.test.glsx.com.cn"
,
//test环境
prod
:
"http://achievements-system-backend.test.glsx.com.cn"
,
//test环境
},
},
};
};
...
...
src/views/Classify/components/Edit.tsx
View file @
b6f7380
...
@@ -65,6 +65,9 @@ const Edit: React.FC<IProps> = (props) => {
...
@@ -65,6 +65,9 @@ const Edit: React.FC<IProps> = (props) => {
setTargetList(res.data.rows);
setTargetList(res.data.rows);
};
};
const handleSubmit = (values: any) => {
const handleSubmit = (values: any) => {
if (values.min_score > values.max_score) {
return message.error("分数范围输入错误");
}
values.targetName = targetList.find(
values.targetName = targetList.find(
(item) => item.id == values.targetId
(item) => item.id == values.targetId
)?.name;
)?.name;
...
@@ -194,11 +197,43 @@ const Edit: React.FC<IProps> = (props) => {
...
@@ -194,11 +197,43 @@ const Edit: React.FC<IProps> = (props) => {
</Form.Item> */}
</Form.Item> */}
<Form.Item label="分数范围">
<Form.Item label="分数范围">
<Space align="start">
<Space align="start">
<Form.Item name="min_score">
<Form.Item
name="min_score"
rules={[
{
required: true,
message: "请输入分数最小值",
},
// () => ({
// validator(_, value) {
// if (value < form.getFieldValue("max_score")) {
// return Promise.resolve();
// }
// return Promise.reject(new Error("请输入正确的最小值"));
// },
// }),
]}
>
<InputNumber />
<InputNumber />
</Form.Item>
</Form.Item>
{"-"}
{"-"}
<Form.Item name="max_score">
<Form.Item
name="max_score"
rules={[
{
required: true,
message: "请输入分数最大值",
},
// () => ({
// validator(_, value) {
// if (value > form.getFieldValue("min_score")) {
// return Promise.resolve();
// }
// return Promise.reject(new Error("请输入正确的最大值"));
// },
// }),
]}
>
<InputNumber />
<InputNumber />
</Form.Item>
</Form.Item>
</Space>
</Space>
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment