|
@@ -6,7 +6,7 @@ import { deleteTaCheckItemQu } from '@/service/tacheckitemqu';
|
6
|
6
|
import QuForm from './QuForm';
|
7
|
7
|
|
8
|
8
|
export default (props) => {
|
9
|
|
- const { itemId } = props;
|
|
9
|
+ const { itemId, itemType = 'loc' } = props;
|
10
|
10
|
|
11
|
11
|
const [open, setOpen] = React.useState(false);
|
12
|
12
|
const [list, setList] = React.useState([]);
|
|
@@ -18,7 +18,14 @@ export default (props) => {
|
18
|
18
|
title: '序号',
|
19
|
19
|
dataIndex: 'sortNo',
|
20
|
20
|
key: 'sortNo',
|
21
|
|
- width: 100,
|
|
21
|
+ width: itemType === 'loc' ? 100 : undefined,
|
|
22
|
+ },
|
|
23
|
+ itemType !== 'loc' &&
|
|
24
|
+ {
|
|
25
|
+ title: '题型',
|
|
26
|
+ dataIndex: 'quType',
|
|
27
|
+ key: 'quType',
|
|
28
|
+ render: t => !t ? '-' : (t == 'radio' ? '选择' : '填空'),
|
22
|
29
|
},
|
23
|
30
|
{
|
24
|
31
|
title: '题干',
|
|
@@ -27,14 +34,14 @@ export default (props) => {
|
27
|
34
|
},
|
28
|
35
|
{
|
29
|
36
|
title: '分值',
|
30
|
|
- dataIndex: 'anScore',
|
31
|
|
- key: 'anScore',
|
32
|
|
- width: 100,
|
|
37
|
+ dataIndex: 'maxScore',
|
|
38
|
+ key: 'maxScore',
|
|
39
|
+ width: itemType === 'loc' ? 100 : undefined,
|
33
|
40
|
},
|
34
|
41
|
{
|
35
|
42
|
title: '操作',
|
36
|
43
|
key: 'options',
|
37
|
|
- width: 100,
|
|
44
|
+ width: itemType === 'loc' ? 100 : 200,
|
38
|
45
|
render: (_, row) => {
|
39
|
46
|
return (
|
40
|
47
|
<Space>
|
|
@@ -49,7 +56,7 @@ export default (props) => {
|
49
|
56
|
)
|
50
|
57
|
}
|
51
|
58
|
},
|
52
|
|
- ]
|
|
59
|
+ ].filter(Boolean)
|
53
|
60
|
|
54
|
61
|
const onAdd = () => {
|
55
|
62
|
setCurItem();
|
|
@@ -86,7 +93,7 @@ export default (props) => {
|
86
|
93
|
newList.push(res);
|
87
|
94
|
}
|
88
|
95
|
|
89
|
|
- setList(list);
|
|
96
|
+ setList(newList);
|
90
|
97
|
}
|
91
|
98
|
|
92
|
99
|
React.useEffect(() => {
|
|
@@ -102,7 +109,14 @@ export default (props) => {
|
102
|
109
|
}, [itemId]);
|
103
|
110
|
|
104
|
111
|
return (
|
105
|
|
- <Card title="试题列表" extra={<Button type="link" disabled={!itemId} onClick={onAdd}>新增</Button>}>
|
|
112
|
+ <Card
|
|
113
|
+ title="试题列表"
|
|
114
|
+ extra={
|
|
115
|
+ itemType == 'loc' ?
|
|
116
|
+ <Button type="link" disabled={!itemId} onClick={onAdd}>新增</Button> :
|
|
117
|
+ <Button type="primary" ghost disabled={!itemId} onClick={onAdd}>新增</Button>
|
|
118
|
+ }
|
|
119
|
+ >
|
106
|
120
|
<Table
|
107
|
121
|
rowKey="quId"
|
108
|
122
|
loading={loading}
|