张涛 2 anni fa
parent
commit
f870e59f06

+ 2
- 1
src/pages/check/components/SurveyForm.jsx Vedi File

2
 import { Link } from 'react-router-dom';
2
 import { Link } from 'react-router-dom';
3
 import { Button, Tabs, Form, Space } from 'antd';
3
 import { Button, Tabs, Form, Space } from 'antd';
4
 import { EditOutlined } from '@ant-design/icons';
4
 import { EditOutlined } from '@ant-design/icons';
5
-import { ModalForm, ProFormDigit, ProFormDependency } from '@ant-design/pro-components';
5
+import { ModalForm, ProFormDigit, ProFormText } from '@ant-design/pro-components';
6
 import { getTaCheckItem, postTaCheckItem } from '@/service/tacheckitem';
6
 import { getTaCheckItem, postTaCheckItem } from '@/service/tacheckitem';
7
 
7
 
8
 const itemType = 'survey';
8
 const itemType = 'survey';
86
       )}
86
       )}
87
     >
87
     >
88
       <ProFormDigit label="预收数量" name="num" min={1} fieldProps={{precision: 0}} />
88
       <ProFormDigit label="预收数量" name="num" min={1} fieldProps={{precision: 0}} />
89
+      <ProFormText label="文明用语" name="cultureTerm"  fieldProps={{precision: 0}} />
89
     </ModalForm>
90
     </ModalForm>
90
   )
91
   )
91
 }
92
 }

+ 50
- 45
src/pages/checkAnswer/survey/index.jsx Vedi File

1
-import React from 'react';
2
-import Page from '@/components/Page';
3
-import { useNavigate, useSearchParams } from 'react-router-dom';
1
+import React from "react";
2
+import Page from "@/components/Page";
3
+import { useNavigate, useSearchParams } from "react-router-dom";
4
 import { queryTable, queryDict } from "@/utils/request";
4
 import { queryTable, queryDict } from "@/utils/request";
5
 import { ProTable } from "@ant-design/pro-components";
5
 import { ProTable } from "@ant-design/pro-components";
6
 import { Button, notification } from "antd";
6
 import { Button, notification } from "antd";
7
-import { getTaCheck } from '@/service/tacheck';
8
-import { getTaCheckAnswer, exportTaCheckAnswer } from '@/service/tacheckanswer';
9
-import useBool from '@/utils/hooks/useBool';
10
-import TargetLink from '@/components/TargetLink';
7
+import { getTaCheck } from "@/service/tacheck";
8
+import { getTaCheckAnswer, exportTaCheckAnswer } from "@/service/tacheckanswer";
9
+import useBool from "@/utils/hooks/useBool";
10
+import TargetLink from "@/components/TargetLink";
11
 
11
 
12
-const getCheck = queryDict(getTaCheck, { labelKey: 'title', valueKey: 'checkId' });
12
+const getCheck = queryDict(getTaCheck, {
13
+  labelKey: "title",
14
+  valueKey: "checkId",
15
+});
13
 const getAnswer = queryTable(getTaCheckAnswer);
16
 const getAnswer = queryTable(getTaCheckAnswer);
14
 
17
 
15
-const addOnParams = { itemType: 'survey' };
18
+const addOnParams = { itemType: "survey" };
16
 
19
 
17
 export default (props) => {
20
 export default (props) => {
18
   const [loading, startLoading, stopLoading] = useBool();
21
   const [loading, startLoading, stopLoading] = useBool();
20
   const [notificationApi, contextHolder] = notification.useNotification();
23
   const [notificationApi, contextHolder] = notification.useNotification();
21
   const navigate = useNavigate();
24
   const navigate = useNavigate();
22
   const [searchParams] = useSearchParams();
25
   const [searchParams] = useSearchParams();
23
-  
26
+
24
   const initialValues = React.useMemo(() => {
27
   const initialValues = React.useMemo(() => {
25
-    const checkId = searchParams.get('checkId');
26
-  
28
+    const checkId = searchParams.get("checkId");
29
+
27
     return {
30
     return {
28
       checkId,
31
       checkId,
29
-    }
32
+    };
30
   }, []);
33
   }, []);
31
 
34
 
32
   const goToDetail = (row) => {
35
   const goToDetail = (row) => {
33
-    navigate(`/checkAnswer/survey/detail?answerId=${row.answerId}&itemType=survey`)
34
-  }
36
+    navigate(
37
+      `/checkAnswer/survey/detail?answerId=${row.answerId}&itemType=survey`
38
+    );
39
+  };
35
 
40
 
36
   const columns = [
41
   const columns = [
37
     {
42
     {
38
       title: "模拟测评",
43
       title: "模拟测评",
39
       dataIndex: "checkId",
44
       dataIndex: "checkId",
40
-      valueType: 'select',
45
+      valueType: "select",
41
       request: getCheck,
46
       request: getCheck,
42
       hideInTable: true,
47
       hideInTable: true,
43
       formItemProps: {
48
       formItemProps: {
44
-        rules: [
45
-          { required: true, message: '请选择模拟测评' }
46
-        ]
47
-      }
49
+        rules: [{ required: true, message: "请选择模拟测评" }],
50
+      },
48
     },
51
     },
49
     {
52
     {
50
       title: "答题时间",
53
       title: "答题时间",
51
       dataIndex: "createDate",
54
       dataIndex: "createDate",
52
-      valueType: 'date',
55
+      valueType: "date",
53
       hideInSearch: true,
56
       hideInSearch: true,
54
     },
57
     },
55
     {
58
     {
80
       hideInSearch: true,
83
       hideInSearch: true,
81
     },
84
     },
82
     {
85
     {
83
-      title: '操作',
86
+      title: "操作",
84
       hideInSearch: true,
87
       hideInSearch: true,
85
-      key: 'options',
88
+      key: "options",
86
       render: (_, row) => {
89
       render: (_, row) => {
87
         return (
90
         return (
91
+          // <a target="_blank" onClick={(row, e) => jumpPage(row, e)}>
92
+          //   详情
93
+          // </a>
88
           <TargetLink to={`/checkAnswer/survey/detail?answerId=${row.answerId}&itemType=survey`}>详情</TargetLink>
94
           <TargetLink to={`/checkAnswer/survey/detail?answerId=${row.answerId}&itemType=survey`}>详情</TargetLink>
89
-        )
90
-      }
91
-    }
92
-  ]
93
-
95
+        );
96
+      },
97
+    },
98
+  ];
99
+  const jumpPage = (row, e) => {
100
+    e.target.href = `/checkAnswer/survey/detail?answerId=${row.answerId}&itemType=survey`;
101
+  };
94
   const beforeSearchSubmit = (params) => {
102
   const beforeSearchSubmit = (params) => {
95
     paramsRef.current = params;
103
     paramsRef.current = params;
96
     return params;
104
     return params;
97
-  }
105
+  };
98
 
106
 
99
   const onExport = () => {
107
   const onExport = () => {
100
     if (!paramsRef.current) {
108
     if (!paramsRef.current) {
101
-      notificationApi.warning({ message: '请先进行条件查询' });
102
-      return
109
+      notificationApi.warning({ message: "请先进行条件查询" });
110
+      return;
103
     }
111
     }
104
 
112
 
105
     startLoading();
113
     startLoading();
106
     exportTaCheckAnswer({
114
     exportTaCheckAnswer({
107
       ...paramsRef.current,
115
       ...paramsRef.current,
108
       ...addOnParams,
116
       ...addOnParams,
109
-    }).then(() => {
110
-      stopLoading();
111
-    }).catch(() => {
112
-      stopLoading();
113
-    });
114
-  }
117
+    })
118
+      .then(() => {
119
+        stopLoading();
120
+      })
121
+      .catch(() => {
122
+        stopLoading();
123
+      });
124
+  };
115
 
125
 
116
   return (
126
   return (
117
     <Page>
127
     <Page>
125
         beforeSearchSubmit={beforeSearchSubmit}
135
         beforeSearchSubmit={beforeSearchSubmit}
126
         form={{ ignoreRules: false, initialValues }}
136
         form={{ ignoreRules: false, initialValues }}
127
         toolBarRender={() => [
137
         toolBarRender={() => [
128
-          <Button
129
-            key="1"
130
-            type="primary"
131
-            loading={loading}
132
-            onClick={onExport}
133
-          >
138
+          <Button key="1" type="primary" loading={loading} onClick={onExport}>
134
             导出
139
             导出
135
           </Button>,
140
           </Button>,
136
         ]}
141
         ]}
137
       />
142
       />
138
     </Page>
143
     </Page>
139
-  )
140
-}
144
+  );
145
+};

+ 37
- 3
src/pages/issue/index.jsx Vedi File

1
 // 此页面包含两个接口  后端需要注意
1
 // 此页面包含两个接口  后端需要注意
2
 import React from "react";
2
 import React from "react";
3
-import { Button, Badge } from "antd";
3
+import { Button, Badge, Popconfirm } from "antd";
4
 import { useNavigate } from "react-router-dom";
4
 import { useNavigate } from "react-router-dom";
5
 import List from "@/components/Page/List";
5
 import List from "@/components/Page/List";
6
 import {
6
 import {
8
   getTaOrgIssue,
8
   getTaOrgIssue,
9
   exportTaIssue,
9
   exportTaIssue,
10
   exportTaOrgIssue,
10
   exportTaOrgIssue,
11
+  deleteTaOrgIssue,
11
 } from "@/service/taissue";
12
 } from "@/service/taissue";
12
 import { getTdIssueType } from "@/service/tdissuetype";
13
 import { getTdIssueType } from "@/service/tdissuetype";
13
 
14
 
32
 
33
 
33
 const yestoday = dayjs().subtract(1, "day").format("YYYY-MM-DD");
34
 const yestoday = dayjs().subtract(1, "day").format("YYYY-MM-DD");
34
 export default (props) => {
35
 export default (props) => {
36
+  const issueIdRef = React.useRef();
37
+
35
   const [loading, startLoading, stopLoading] = useBool();
38
   const [loading, startLoading, stopLoading] = useBool();
36
   const [loading1, startLoading1, stopLoading1] = useBool();
39
   const [loading1, startLoading1, stopLoading1] = useBool();
37
   const navigate = useNavigate();
40
   const navigate = useNavigate();
59
         return <span>{row.typeName}</span>;
62
         return <span>{row.typeName}</span>;
60
       },
63
       },
61
     },
64
     },
65
+    {
66
+      title: "问题来源",
67
+      dataIndex: "sourceType2",
68
+      valueType: "select",
69
+      valueEnum: {
70
+        'check': "实地测评",
71
+        'feedback': "市民上报",
72
+        'inspector': "日常督查",
73
+      },
74
+    },
62
     {
75
     {
63
       title: "创建时间",
76
       title: "创建时间",
64
       dataIndex: "createdAt",
77
       dataIndex: "createdAt",
186
     };
199
     };
187
     return params;
200
     return params;
188
   };
201
   };
189
-
202
+  const handleDelete = (row) => {
203
+    console.log(row);
204
+    deleteTaOrgIssue(row.issueId).then(() => {
205
+      issueIdRef.current.reload();
206
+    });
207
+  };
190
   return (
208
   return (
191
     <List
209
     <List
210
+      ref={issueIdRef}
192
       rowKey="issueId"
211
       rowKey="issueId"
193
       request={request}
212
       request={request}
194
       columns={columns}
213
       columns={columns}
195
       params={params}
214
       params={params}
196
       beforeSearchSubmit={beforeSearchSubmit}
215
       beforeSearchSubmit={beforeSearchSubmit}
197
       optionRender={(_, row) => [
216
       optionRender={(_, row) => [
198
-        <TargetLink key="detail" to={`/issue/detail?id=${row.issueId}`}>详情</TargetLink>,
217
+        <>
218
+          <TargetLink key="detail" to={`/issue/detail?id=${row.issueId}`}>
219
+            详情
220
+          </TargetLink>
221
+          <Popconfirm
222
+            key="delete"
223
+            title="您是否确认删除 ?"
224
+            onConfirm={() => handleDelete(row)}
225
+            okText="确定"
226
+            cancelText="取消"
227
+          >
228
+            <Button style={{ padding: 0 }} danger type="link">
229
+              删除
230
+            </Button>
231
+          </Popconfirm>
232
+        </>,
199
       ]}
233
       ]}
200
       toolBarRender={() => [
234
       toolBarRender={() => [
201
         <Button key="1" type="primary" loading={loading} onClick={onExport}>
235
         <Button key="1" type="primary" loading={loading} onClick={onExport}>

+ 2
- 0
src/service/taissue.js Vedi File

34
  * 通过主键删除数据
34
  * 通过主键删除数据
35
  */
35
  */
36
 export const deleteTaIssue = (id) => request(`/api/taIssue/${id}`, { method: 'delete' });
36
 export const deleteTaIssue = (id) => request(`/api/taIssue/${id}`, { method: 'delete' });
37
+export const deleteTaOrgIssue = (id) => request(`/api/taOrgIssue/${id}`, { method: 'delete' });
38
+
37
 
39
 
38
 /*
40
 /*
39
  * 导出
41
  * 导出