Sfoglia il codice sorgente

Merge branch 'master' into dev1.0

fangmingyue 2 anni fa
parent
commit
dbd641ef66

+ 60
- 0
src/pages/answerRecord/fieldEvaluation/index.jsx Vedi File

@@ -0,0 +1,60 @@
1
+import React from 'react';
2
+import Page from '@/components/Page';
3
+import { useNavigate } from 'react-router-dom';
4
+import { queryTable } from "@/utils/request";
5
+import { ProTable } from "@ant-design/pro-components";
6
+import { Button } from "antd";
7
+
8
+export default (props) => {
9
+
10
+  const columns = [
11
+    {
12
+      title: "模拟测评名称",
13
+      dataIndex: "title",
14
+    },
15
+    {
16
+      title: "小区",
17
+    },
18
+    {
19
+      title: "点位名称",
20
+      dataIndex: "startDate",
21
+    },
22
+    {
23
+      title: "题干",
24
+      dataIndex: "endDate",
25
+    },
26
+    {
27
+      title: "答案",
28
+      dataIndex: "status",
29
+    },
30
+    {
31
+      title: "答题时间",
32
+      dataIndex: "status",
33
+    },
34
+    {
35
+      title: "答题人",
36
+      dataIndex: "status",
37
+    },
38
+    {
39
+      title: "详情",
40
+      dataIndex: "status",
41
+    }
42
+  ]
43
+
44
+  return (
45
+    <Page>
46
+      <ProTable
47
+        search={false}
48
+        columns={columns}
49
+        toolBarRender={() => [
50
+          <Button
51
+            key="1"
52
+            type="primary"
53
+          >
54
+            导出
55
+          </Button>,
56
+        ]}
57
+      />
58
+    </Page>
59
+  )
60
+}

+ 61
- 0
src/pages/answerRecord/quesInvestigation/index.jsx Vedi File

@@ -0,0 +1,61 @@
1
+import React from 'react';
2
+import Page from '@/components/Page';
3
+import { useNavigate } from 'react-router-dom';
4
+import { queryTable } from "@/utils/request";
5
+import { ProTable } from "@ant-design/pro-components";
6
+import { Button } from "antd";
7
+
8
+export default (props) => {
9
+
10
+  const columns = [
11
+    {
12
+      title: "模拟测评名称",
13
+      dataIndex: "title",
14
+    },
15
+    {
16
+      title: "小区",
17
+    },
18
+    {
19
+      title: "题干",
20
+      dataIndex: "startDate",
21
+    },
22
+    {
23
+      title: "答案",
24
+      dataIndex: "status",
25
+    },
26
+
27
+    {
28
+      title: "答题人",
29
+      dataIndex: "status",
30
+    },
31
+    {
32
+      title: "答题时间",
33
+      dataIndex: "status",
34
+    },
35
+    {
36
+      title: "受访者性别",
37
+      dataIndex: "status",
38
+    },
39
+    {
40
+      title: "年龄段",
41
+      dataIndex: "status",
42
+    }
43
+  ]
44
+
45
+  return (
46
+    <Page>
47
+      <ProTable
48
+        search={false}
49
+        columns={columns}
50
+        toolBarRender={() => [
51
+          <Button
52
+            key="1"
53
+            type="primary"
54
+          >
55
+            导出
56
+          </Button>,
57
+        ]}
58
+      />
59
+    </Page>
60
+  )
61
+}

+ 8
- 9
src/pages/home/components/AssignedCharts.jsx Vedi File

@@ -13,7 +13,6 @@ export default React.forwardRef((props, ref) => {
13 13
 
14 14
   React.useEffect(() => {
15 15
     if (!condition) return;
16
-
17 16
     getStatIssue(condition).then((res) => {
18 17
       setOption({
19 18
         tooltip: {
@@ -77,6 +76,7 @@ export default React.forwardRef((props, ref) => {
77 76
     })
78 77
   }, [condition]);
79 78
 
79
+  //子组件通过点击或自定义传过来的值变成参数条件set给condition
80 80
   const onChange = (dt, typ) => {
81 81
     if (typ == 1) {
82 82
       setCondition({
@@ -100,16 +100,15 @@ export default React.forwardRef((props, ref) => {
100 100
         endDate: dt[1].format('YYYY-MM'),
101 101
       })
102 102
     } else {
103
-      // setCondition({
104
-      //   num: dt[0].daysInMonth(),
105
-      //   statType: 'issue_daily',
106
-      //   startDate: dt[0].format('YYYY-MM-DD'),
107
-      //   endDate: dt[1].format('YYYY-MM-DD'),
108
-      // })
103
+      setCondition({
104
+        num: dayjs(dt[1]).diff(dt[0], 'day'),
105
+        statType: 'issue_daily',
106
+        startDate: dt[0].format('YYYY-MM-DD'),
107
+        endDate: dt[1].format('YYYY-MM-DD'),
108
+      })
109 109
     }
110 110
 
111
-    // console.log('dt天数', dt[0].format('MM-DD'));
112
-    // console.log('dt,typ', dt, typ);
111
+    // console.log('dt天数', dayjs(dt[1]).diff(dt[0], 'day'));
113 112
   }
114 113
 
115 114
   return (

+ 10
- 5
src/pages/home/components/EscalationCharts.jsx Vedi File

@@ -7,10 +7,15 @@ import { getSysOrg } from "@/service/sysorg";
7 7
 
8 8
 export default (props) => {
9 9
   const [option, setOption] = useState({});
10
-  // const [id, setId] = useState({});
11 10
   const [orgList, setOrgList] = useState([]);
12 11
   const [orgId, setOrgId] = useState();
13
-  console.log('orgList', orgList[0]);
12
+  const [condition, setCondition] = useState();
13
+
14
+  const onChange = e => {
15
+    setCondition({ orgId: e })
16
+    setOrgId(e)
17
+  }
18
+  console.log('orgId', orgId);
14 19
 
15 20
   React.useEffect(() => {
16 21
     getSysOrg({ pageSize: 500 }).then((res) => {
@@ -19,7 +24,7 @@ export default (props) => {
19 24
   }, []);
20 25
 
21 26
   React.useEffect(() => {
22
-    getStatEscalation({ orgId: orgId }).then((res) => {
27
+    getStatEscalation(condition).then((res) => {
23 28
       setOption({
24 29
         tooltip: {
25 30
           trigger: 'axis',
@@ -71,13 +76,13 @@ export default (props) => {
71 76
         ]
72 77
       })
73 78
     })
74
-  }, [orgId]);
79
+  }, []);
75 80
 
76 81
   return (
77 82
     <Card
78 83
       title="交办统计"
79 84
       extra={
80
-        <Select style={{ width: "200px" }} placeholder="请选择单位" value={orgId} onChange={e => setOrgId(e)}>
85
+        <Select style={{ width: "200px" }} value={orgId} placeholder="请选择单位" onChange={onChange}>
81 86
           {
82 87
             orgList.map((item) => (
83 88
               <Select.Option key={item.orgId} value={item.orgId}>

+ 5
- 2
src/pages/home/components/RangeDate.jsx Vedi File

@@ -14,17 +14,20 @@ export default (props) => {
14 14
   const dtTypeRef = React.useRef(dtType);
15 15
 
16 16
   const onRadioChange = e => {
17
+    //本周 本月 本年的value 1 2 3
17 18
     const value = e.target.value;
18 19
     setDtType(value);
20
+    //获取最新的dtType
19 21
     dtTypeRef.current = value;
20
-    console.log('dtTypeRef.current', dtTypeRef.current)
22
+    // console.log('dtTypeRef.current', dtTypeRef.current)
21 23
   }
22 24
 
23
-
25
+  //将日期数组的值set给pickerValue
24 26
   const onPickerChange = e => {
25 27
     setPickerValue(e);
26 28
   }
27 29
 
30
+  //按钮点击判断 本周 本月 本年的值set给pickerValue
28 31
   React.useEffect(() => {
29 32
     if (dtType == 1) {
30 33
       setPickerValue(

+ 33
- 2
src/routes/routes.jsx Vedi File

@@ -10,7 +10,9 @@ import {
10 10
   BranchesOutlined,
11 11
   NodeIndexOutlined,
12 12
   NotificationOutlined,
13
-  ScheduleOutlined
13
+  ScheduleOutlined,
14
+  FileTextOutlined,
15
+  HddOutlined
14 16
 } from '@ant-design/icons';
15 17
 import { Outlet } from 'react-router-dom';
16 18
 import AuthLayout from "@/layouts/AuthLayout";
@@ -36,6 +38,8 @@ import IssueList from '@/pages/issue';
36 38
 import IssueDetail from '@/pages/issue/detail';
37 39
 import Notice from '@/pages/notice';
38 40
 import CheckStand from '@/pages/checkStand';
41
+import FieldEvaluation from '@/pages/answerRecord/fieldEvaluation';
42
+import QuesInvestigation from '@/pages/answerRecord/QuesInvestigation';
39 43
 
40 44
 /**
41 45
  * meta 用来扩展自定义数据数据
@@ -95,7 +99,7 @@ export const authRoutes = [
95 99
           title: '模拟测评',
96 100
           icon: <ProjectOutlined />,
97 101
           permission: 'check',
98
-        }
102
+        },
99 103
       },
100 104
       {
101 105
         path: "check/edit",
@@ -107,6 +111,33 @@ export const authRoutes = [
107 111
           permission: 'check.edit',
108 112
         }
109 113
       },
114
+      {
115
+        path: "answerRecord",
116
+        element: <Outlet />,
117
+        meta: {
118
+          title: '答题记录',
119
+          icon: <FileTextOutlined />,
120
+        },
121
+        children:
122
+          [
123
+            {
124
+              path: "answerRecord/fieldEvaluation",
125
+              element: <FieldEvaluation />,
126
+              meta: {
127
+                title: '实地测评',
128
+                icon: <HddOutlined />,
129
+              }
130
+            },
131
+            {
132
+              path: "answerRecord/quesInvestigation",
133
+              element: <QuesInvestigation />,
134
+              meta: {
135
+                title: '问卷调查',
136
+                icon: <HddOutlined />,
137
+              }
138
+            },
139
+          ]
140
+      },
110 141
     ],
111 142
   },
112 143
   {