Przeglądaj źródła

Merge branch 'master' into dev1.0

fangmingyue 2 lat temu
rodzic
commit
dbd641ef66

+ 60
- 0
src/pages/answerRecord/fieldEvaluation/index.jsx Wyświetl plik

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 Wyświetl plik

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 Wyświetl plik

13
 
13
 
14
   React.useEffect(() => {
14
   React.useEffect(() => {
15
     if (!condition) return;
15
     if (!condition) return;
16
-
17
     getStatIssue(condition).then((res) => {
16
     getStatIssue(condition).then((res) => {
18
       setOption({
17
       setOption({
19
         tooltip: {
18
         tooltip: {
77
     })
76
     })
78
   }, [condition]);
77
   }, [condition]);
79
 
78
 
79
+  //子组件通过点击或自定义传过来的值变成参数条件set给condition
80
   const onChange = (dt, typ) => {
80
   const onChange = (dt, typ) => {
81
     if (typ == 1) {
81
     if (typ == 1) {
82
       setCondition({
82
       setCondition({
100
         endDate: dt[1].format('YYYY-MM'),
100
         endDate: dt[1].format('YYYY-MM'),
101
       })
101
       })
102
     } else {
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
   return (
114
   return (

+ 10
- 5
src/pages/home/components/EscalationCharts.jsx Wyświetl plik

7
 
7
 
8
 export default (props) => {
8
 export default (props) => {
9
   const [option, setOption] = useState({});
9
   const [option, setOption] = useState({});
10
-  // const [id, setId] = useState({});
11
   const [orgList, setOrgList] = useState([]);
10
   const [orgList, setOrgList] = useState([]);
12
   const [orgId, setOrgId] = useState();
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
   React.useEffect(() => {
20
   React.useEffect(() => {
16
     getSysOrg({ pageSize: 500 }).then((res) => {
21
     getSysOrg({ pageSize: 500 }).then((res) => {
19
   }, []);
24
   }, []);
20
 
25
 
21
   React.useEffect(() => {
26
   React.useEffect(() => {
22
-    getStatEscalation({ orgId: orgId }).then((res) => {
27
+    getStatEscalation(condition).then((res) => {
23
       setOption({
28
       setOption({
24
         tooltip: {
29
         tooltip: {
25
           trigger: 'axis',
30
           trigger: 'axis',
71
         ]
76
         ]
72
       })
77
       })
73
     })
78
     })
74
-  }, [orgId]);
79
+  }, []);
75
 
80
 
76
   return (
81
   return (
77
     <Card
82
     <Card
78
       title="交办统计"
83
       title="交办统计"
79
       extra={
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
             orgList.map((item) => (
87
             orgList.map((item) => (
83
               <Select.Option key={item.orgId} value={item.orgId}>
88
               <Select.Option key={item.orgId} value={item.orgId}>

+ 5
- 2
src/pages/home/components/RangeDate.jsx Wyświetl plik

14
   const dtTypeRef = React.useRef(dtType);
14
   const dtTypeRef = React.useRef(dtType);
15
 
15
 
16
   const onRadioChange = e => {
16
   const onRadioChange = e => {
17
+    //本周 本月 本年的value 1 2 3
17
     const value = e.target.value;
18
     const value = e.target.value;
18
     setDtType(value);
19
     setDtType(value);
20
+    //获取最新的dtType
19
     dtTypeRef.current = value;
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
   const onPickerChange = e => {
26
   const onPickerChange = e => {
25
     setPickerValue(e);
27
     setPickerValue(e);
26
   }
28
   }
27
 
29
 
30
+  //按钮点击判断 本周 本月 本年的值set给pickerValue
28
   React.useEffect(() => {
31
   React.useEffect(() => {
29
     if (dtType == 1) {
32
     if (dtType == 1) {
30
       setPickerValue(
33
       setPickerValue(

+ 33
- 2
src/routes/routes.jsx Wyświetl plik

10
   BranchesOutlined,
10
   BranchesOutlined,
11
   NodeIndexOutlined,
11
   NodeIndexOutlined,
12
   NotificationOutlined,
12
   NotificationOutlined,
13
-  ScheduleOutlined
13
+  ScheduleOutlined,
14
+  FileTextOutlined,
15
+  HddOutlined
14
 } from '@ant-design/icons';
16
 } from '@ant-design/icons';
15
 import { Outlet } from 'react-router-dom';
17
 import { Outlet } from 'react-router-dom';
16
 import AuthLayout from "@/layouts/AuthLayout";
18
 import AuthLayout from "@/layouts/AuthLayout";
36
 import IssueDetail from '@/pages/issue/detail';
38
 import IssueDetail from '@/pages/issue/detail';
37
 import Notice from '@/pages/notice';
39
 import Notice from '@/pages/notice';
38
 import CheckStand from '@/pages/checkStand';
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
  * meta 用来扩展自定义数据数据
45
  * meta 用来扩展自定义数据数据
95
           title: '模拟测评',
99
           title: '模拟测评',
96
           icon: <ProjectOutlined />,
100
           icon: <ProjectOutlined />,
97
           permission: 'check',
101
           permission: 'check',
98
-        }
102
+        },
99
       },
103
       },
100
       {
104
       {
101
         path: "check/edit",
105
         path: "check/edit",
107
           permission: 'check.edit',
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
   {