|
@@ -3,7 +3,7 @@ import Page from '@/components/Page';
|
3
|
3
|
import { useNavigate, Link } from 'react-router-dom';
|
4
|
4
|
import { queryTable } from "@/utils/request";
|
5
|
5
|
import { ProTable } from "@ant-design/pro-components";
|
6
|
|
-import { Button, message, Popconfirm } from "antd";
|
|
6
|
+import { Button, message, Popconfirm, Input, Modal } from "antd";
|
7
|
7
|
import { getTaCheck, deleteTaCheck, putTaCheck, calcScoreTaCheck } from '@/service/tacheck';
|
8
|
8
|
|
9
|
9
|
const queryList = queryTable(getTaCheck);
|
|
@@ -13,6 +13,8 @@ export default (props) => {
|
13
|
13
|
const navigate = useNavigate();
|
14
|
14
|
const actionRef = React.useRef();
|
15
|
15
|
const [messageApi, contextHolder] = message.useMessage();
|
|
16
|
+ const [open, setOpen] = React.useState(false);
|
|
17
|
+ const [check, setCheck] = React.useState({});
|
16
|
18
|
|
17
|
19
|
const onDelete = (item) => {
|
18
|
20
|
deleteTaCheck(item.checkId).then(() => {
|
|
@@ -21,7 +23,7 @@ export default (props) => {
|
21
|
23
|
}
|
22
|
24
|
|
23
|
25
|
const onUpdateStatus = (item) => {
|
24
|
|
- putTaCheck(item.checkId, {...item, status: Math.abs(item.status - 1)}).then(() => {
|
|
26
|
+ putTaCheck(item.checkId, { ...item, status: Math.abs(item.status - 1) }).then(() => {
|
25
|
27
|
actionRef.current.reload();
|
26
|
28
|
})
|
27
|
29
|
}
|
|
@@ -40,6 +42,11 @@ export default (props) => {
|
40
|
42
|
});
|
41
|
43
|
}
|
42
|
44
|
|
|
45
|
+ const onOpen = (record) => {
|
|
46
|
+ setCheck(record);
|
|
47
|
+ setOpen(true)
|
|
48
|
+ }
|
|
49
|
+
|
43
|
50
|
const columns = [
|
44
|
51
|
{
|
45
|
52
|
title: "测评名称",
|
|
@@ -81,7 +88,7 @@ export default (props) => {
|
81
|
88
|
title: "调查问卷得分",
|
82
|
89
|
dataIndex: "surveyScore",
|
83
|
90
|
hideInSearch: true,
|
84
|
|
- render: (_, row) => {
|
|
91
|
+ render: (_, row) => {
|
85
|
92
|
const origin = row.surveyScore || 0;
|
86
|
93
|
const percent = row.surveyScorePercent || 0;
|
87
|
94
|
const score = Number(origin * percent).toFixed(2);
|
|
@@ -109,6 +116,7 @@ export default (props) => {
|
109
|
116
|
valueType: "option",
|
110
|
117
|
width: 240,
|
111
|
118
|
render: (_, record) => [
|
|
119
|
+ console.log('record', record),
|
112
|
120
|
// <Button
|
113
|
121
|
// key={1}
|
114
|
122
|
// style={{ padding: 0 }}
|
|
@@ -143,6 +151,7 @@ export default (props) => {
|
143
|
151
|
计算分数
|
144
|
152
|
</Button>
|
145
|
153
|
</Popconfirm>,
|
|
154
|
+ <Button type="link" key={5} onClick={() => { onOpen(record) }}>复制</Button>,
|
146
|
155
|
],
|
147
|
156
|
},
|
148
|
157
|
]
|
|
@@ -150,6 +159,14 @@ export default (props) => {
|
150
|
159
|
return (
|
151
|
160
|
<Page>
|
152
|
161
|
{contextHolder}
|
|
162
|
+ <Modal
|
|
163
|
+ title="复制"
|
|
164
|
+ open={open}
|
|
165
|
+ onCancel={() => setOpen(false)}
|
|
166
|
+ >
|
|
167
|
+ 测评名称:
|
|
168
|
+ <Input placeholder="请输入" value={check.title + '-复制'} />
|
|
169
|
+ </Modal>
|
153
|
170
|
<ProTable
|
154
|
171
|
actionRef={actionRef}
|
155
|
172
|
rowKey="checkId"
|