Преглед на файлове

Merge branch 'dev1.0' of http://git.ycjcjy.com/civilized_city/pc-admin into dev1.0

Yansen преди 2 години
родител
ревизия
592a59b085

+ 18
- 15
src/pages/check/components/CheckForm.jsx Целия файл

@@ -4,8 +4,10 @@ import { EditOutlined } from '@ant-design/icons';
4 4
 import { Card, Tabs, Button, Form, Input, DatePicker } from 'antd';
5 5
 import { ModalForm } from '@ant-design/pro-components';
6 6
 import { postTaCheck, putTaCheck } from '@/service/tacheck';
7
+import { useNavigate } from "react-router-dom";
7 8
 
8 9
 export default (props) => {
10
+  const navigate = useNavigate();
9 11
   const { checkInfo, onChange, onTabChange } = props;
10 12
 
11 13
   const [open, setOpen] = React.useState(false);
@@ -47,16 +49,17 @@ export default (props) => {
47 49
   }, [checkInfo]);
48 50
 
49 51
   return (
50
-    <Card bodyStyle={{padding: 0}}>
51
-      <div style={{display: 'flex', padding: '1em', alignItems: 'center'}}>
52
-        <div style={{flex: 'none'}}><Button type="link" onClick={onEdit} icon={<EditOutlined />} /></div>
53
-        <div style={{flex: 'none', margin: '0 1em'}}>{dateStr}</div>
54
-        <div style={{flex: '1', fontSize: '1.6em'}}>{title}</div>
52
+    <Card bodyStyle={{ padding: 0 }}>
53
+      <div style={{ display: 'flex', padding: '1em', alignItems: 'center' }}>
54
+        <div style={{ flex: 'none' }}><Button type="link" onClick={onEdit} icon={<EditOutlined />} /></div>
55
+        <div style={{ flex: 'none', margin: '0 1em' }}>{dateStr}</div>
56
+        <div style={{ flex: '1', fontSize: '1.6em' }}>{title}</div>
57
+        <div style={{ flex: 'none', fontSize: '1.6em' }}><Button type="primary" onClick={() => navigate(-1)}>返回</Button></div>
55 58
       </div>
56 59
       <Tabs
57 60
         defaultActiveKey='1'
58 61
         onChange={onTabChange}
59
-        tabBarStyle={{margin: '0 2em'}}
62
+        tabBarStyle={{ margin: '0 2em' }}
60 63
         items={[
61 64
           {
62 65
             label: '实地测评',
@@ -69,15 +72,15 @@ export default (props) => {
69 72
         ]}
70 73
       />
71 74
       <ModalForm title="测评维护" open={open} width={480} form={form} onFinish={onFinish} onOpenChange={setOpen}>
72
-          <Form.Item name="title" label="测评名称" required>
73
-            <Input placeholder="请输入测评名称" />
74
-          </Form.Item>
75
-          <Form.Item name="startDate" label="开始时间" required>
76
-            <DatePicker placeholder="请选择" style={{ width: '100%' }} />
77
-          </Form.Item>
78
-          <Form.Item name="endDate" label="结束时间" required>
79
-            <DatePicker placeholder="请选择" style={{ width: '100%' }} />
80
-          </Form.Item>
75
+        <Form.Item name="title" label="测评名称" required>
76
+          <Input placeholder="请输入测评名称" />
77
+        </Form.Item>
78
+        <Form.Item name="startDate" label="开始时间" required>
79
+          <DatePicker placeholder="请选择" style={{ width: '100%' }} />
80
+        </Form.Item>
81
+        <Form.Item name="endDate" label="结束时间" required>
82
+          <DatePicker placeholder="请选择" style={{ width: '100%' }} />
83
+        </Form.Item>
81 84
       </ModalForm>
82 85
     </Card>
83 86
   )

+ 3
- 3
src/pages/check/components/LocTable.jsx Целия файл

@@ -31,7 +31,7 @@ export default (props) => {
31 31
       render: (_, row) => row.fullScore ? Number(row.fullScore / (row.num || 1)).toFixed(2) : '-',
32 32
     },
33 33
     {
34
-      title: '数',
34
+      title: '已收/计划数',
35 35
       dataIndex: 'num',
36 36
       key: 'num',
37 37
     },
@@ -74,7 +74,7 @@ export default (props) => {
74 74
   React.useEffect(() => {
75 75
     if (checkId) {
76 76
       startLoading();
77
-      getTaCheckItem({pageSize: 500, checkId, itemType: "loc"}).then(res => {
77
+      getTaCheckItem({ pageSize: 500, checkId, itemType: "loc" }).then(res => {
78 78
         setList(res.records || []);
79 79
         stopLoading();
80 80
       }).catch(() => {
@@ -82,7 +82,7 @@ export default (props) => {
82 82
       });
83 83
     }
84 84
   }, [checkId]);
85
-  
85
+
86 86
   return (
87 87
     <Row gutter={24}>
88 88
       <Col span={12}>

+ 76
- 54
src/pages/check/components/QuForm.jsx Целия файл

@@ -16,8 +16,9 @@ import { getTdQuestion } from '@/service/tdquestion';
16 16
 const queryQu = transformQuery(getTdQuestion, { searchKey: 'title', labelKey: 'title', valueKey: 'quId' });
17 17
 
18 18
 export default (props) => {
19
-  const {open, onOpenChange, quInfo, itemId, itemType, onChange} = props;
19
+  const { open, onOpenChange, quInfo, itemId, itemType, onChange } = props;
20 20
   const [form] = Form.useForm();
21
+  const [value, setValue] = React.useState();
21 22
 
22 23
   const onFinish = async (values) => {
23 24
     const data = {
@@ -54,6 +55,7 @@ export default (props) => {
54 55
     }
55 56
   }, [quInfo]);
56 57
 
58
+  // console.log('value', value);
57 59
   return (
58 60
     <DrawerForm
59 61
       title="问题维护"
@@ -66,16 +68,16 @@ export default (props) => {
66 68
         destroyOnClose: true,
67 69
         extra: (
68 70
           <>
69
-          {
70
-            itemType == 'survey' && (
71
-              <SearchSelect
72
-                placeholder="请输入题干搜索题库"
73
-                style={{width: '300px'}}
74
-                request={queryQu}
75
-                onChange={onTplChange}
76
-              />
77
-            )
78
-          }
71
+            {
72
+              itemType == 'survey' && (
73
+                <SearchSelect
74
+                  placeholder="请输入题干搜索题库"
75
+                  style={{ width: '300px' }}
76
+                  request={queryQu}
77
+                  onChange={onTplChange}
78
+                />
79
+              )
80
+            }
79 81
           </>
80 82
         )
81 83
       }}
@@ -166,7 +168,7 @@ export default (props) => {
166 168
         <Col span={12}>
167 169
           <ProFormDependency name={['quType']}>
168 170
             {
169
-              ({quType}) => (
171
+              ({ quType }) => (
170 172
                 quType != 'fill' ? null : (
171 173
                   <ProFormDigit
172 174
                     name="anScore"
@@ -188,7 +190,7 @@ export default (props) => {
188 190
         <Col span={12}>
189 191
           <ProFormDependency name={['quType']}>
190 192
             {
191
-              ({quType}) => (
193
+              ({ quType }) => (
192 194
                 quType != 'fill' ? null : (
193 195
                   <ProFormText
194 196
                     name="fillUnit"
@@ -225,54 +227,74 @@ export default (props) => {
225 227
           </Form.Item>
226 228
         )
227 229
       }
228
-      
230
+
229 231
       <ProFormDependency name={['quType']}>
230 232
         {
231
-          ({quType}) => (
233
+          ({ quType }) => (
232 234
             quType == 'fill' ? null : (
233 235
               <ProFormList
234 236
                 name="answerList"
235 237
                 label="选项列表"
236 238
                 copyIconProps={false}
237
-              >
238
-                <Row gutter={24} style={{ width: '730px' }}>
239
-                  <Col span={6}>
240
-                    <ProFormText
241
-                      name="answerCode"
242
-                      label="选项"
243
-                      help="类似 A, B, C, D"
244
-                    />
245
-                  </Col>
246
-                  <Col span={6}>
247
-                    <ProFormDigit
248
-                      name="score"
249
-                      label="计分"
250
-                      help="计分"
251
-                      min={0}
252
-                      fieldProps={{ precision: 2 }}
253
-                    />
254
-                  </Col>
255
-                  <Col span={6}>
256
-                    <ProFormSelect
257
-                      name="reportIssue"
258
-                      label="上报问题"
259
-                      help="上报问题"
260
-                      placeholder="是否上报问题"
261
-                      valueEnum={{
262
-                        0: '不上报',
263
-                        1: '上报',
264
-                      }}
265
-                    />
266
-                  </Col>
267
-                  <Col span={6}>
268
-                    <ProFormText
269
-                      name="answer"
270
-                      label="答案"
271
-                      help="答案"
272
-                      placeholder="具体选项内容"
273
-                    />
274
-                  </Col>
275
-                </Row>
239
+                creatorRecord={{ answerCode: value }}
240
+              >{(f, index) => {
241
+
242
+                // console.log('index', index == 0)
243
+                if (index == 0) {
244
+                  setValue('B')
245
+                } else if (index == 1) {
246
+                  setValue('C')
247
+                } else if (index == 2) {
248
+                  setValue('D')
249
+                } else if (index == 3) {
250
+                  setValue('E')
251
+                } else if (index == 4) {
252
+                  setValue('F')
253
+                }
254
+                return (
255
+                  <Row gutter={24} style={{ width: '730px' }}>
256
+                    <Col span={6}>
257
+                      <ProFormText
258
+                        name="answerCode"
259
+                        label="选项"
260
+                        help="类似 A, B, C, D"
261
+                        initialValue={'A'}
262
+                      />
263
+                    </Col>
264
+                    <Col span={6}>
265
+                      <ProFormDigit
266
+                        name="score"
267
+                        label="计分"
268
+                        help="计分"
269
+                        min={0}
270
+                        fieldProps={{ precision: 2 }}
271
+                      />
272
+                    </Col>
273
+                    <Col span={6}>
274
+                      <ProFormSelect
275
+                        name="reportIssue"
276
+                        label="上报问题"
277
+                        help="上报问题"
278
+                        placeholder="是否上报问题"
279
+                        valueEnum={{
280
+                          0: '不上报',
281
+                          1: '上报',
282
+                        }}
283
+                      />
284
+                    </Col>
285
+                    <Col span={6}>
286
+                      <ProFormText
287
+                        name="answer"
288
+                        label="答案"
289
+                        help="答案"
290
+                        placeholder="具体选项内容"
291
+                      />
292
+                    </Col>
293
+                  </Row>
294
+                )
295
+              }
296
+                }
297
+
276 298
               </ProFormList>
277 299
             )
278 300
           )

+ 0
- 1
src/pages/checkAnswer/loc/index.jsx Целия файл

@@ -54,7 +54,6 @@ export default (props) => {
54 54
     {
55 55
       title: "答题人",
56 56
       dataIndex: "userName",
57
-      hideInSearch: true,
58 57
     },
59 58
     {
60 59
       title: "得分",

+ 1
- 2
src/pages/checkAnswer/survey/index.jsx Целия файл

@@ -53,7 +53,6 @@ export default (props) => {
53 53
     {
54 54
       title: "答题人",
55 55
       dataIndex: "userName",
56
-      hideInSearch: true,
57 56
     },
58 57
     {
59 58
       title: "受访者性别",
@@ -81,7 +80,7 @@ export default (props) => {
81 80
       }
82 81
     }
83 82
   ]
84
-  
83
+
85 84
   const beforeSearchSubmit = (params) => {
86 85
     paramsRef.current = params;
87 86
     return params;