|
@@ -8,13 +8,15 @@ import {
|
8
|
8
|
} from "@ant-design/pro-components";
|
9
|
9
|
import { Button, Form, message } from "antd";
|
10
|
10
|
// import { getPostsFilesList, savePostsFiles } from "@/services/posts";
|
11
|
|
-import {
|
12
|
|
- getEvaluateList,
|
13
|
|
- saveEvaluate
|
14
|
|
-} from "@/services/evaluate";
|
|
11
|
+import { getEvaluateList, saveEvaluate } from "@/services/evaluate";
|
15
|
12
|
import EvaluateItem from "@/components/evaluateItem";
|
16
|
13
|
|
17
|
|
-export default ({ taskId, onsuccess = () => {} }) => {
|
|
14
|
+export default ({
|
|
15
|
+ taskId,
|
|
16
|
+ onsuccess = () => {},
|
|
17
|
+ buttonText = "新增",
|
|
18
|
+ buttonProps,
|
|
19
|
+}) => {
|
18
|
20
|
const [form] = Form.useForm();
|
19
|
21
|
|
20
|
22
|
const onFinish = async (values) => {
|
|
@@ -52,11 +54,15 @@ export default ({ taskId, onsuccess = () => {} }) => {
|
52
|
54
|
label: "军供文化",
|
53
|
55
|
},
|
54
|
56
|
];
|
55
|
|
-
|
|
57
|
+
|
56
|
58
|
return (
|
57
|
59
|
<ModalForm
|
58
|
60
|
title="评价"
|
59
|
|
- trigger={<Button type="primary">新增</Button>}
|
|
61
|
+ trigger={
|
|
62
|
+ <Button type="primary" {...buttonProps}>
|
|
63
|
+ {buttonText}
|
|
64
|
+ </Button>
|
|
65
|
+ }
|
60
|
66
|
form={form}
|
61
|
67
|
// open={true}
|
62
|
68
|
layout={"horizontal"}
|
|
@@ -78,14 +84,16 @@ export default ({ taskId, onsuccess = () => {} }) => {
|
78
|
84
|
hidden={true}
|
79
|
85
|
/>
|
80
|
86
|
{itemList?.map((x) => {
|
81
|
|
- return <ProForm.Item
|
82
|
|
- key={x.name}
|
83
|
|
- name={x.name}
|
84
|
|
- label={x.label}
|
85
|
|
- rules={[{ required: true, message: "请选择评价" }]}
|
86
|
|
- >
|
87
|
|
- <EvaluateItem></EvaluateItem>
|
88
|
|
- </ProForm.Item>;
|
|
87
|
+ return (
|
|
88
|
+ <ProForm.Item
|
|
89
|
+ key={x.name}
|
|
90
|
+ name={x.name}
|
|
91
|
+ label={x.label}
|
|
92
|
+ rules={[{ required: true, message: "请选择评价" }]}
|
|
93
|
+ >
|
|
94
|
+ <EvaluateItem></EvaluateItem>
|
|
95
|
+ </ProForm.Item>
|
|
96
|
+ );
|
89
|
97
|
})}
|
90
|
98
|
</ModalForm>
|
91
|
99
|
);
|