fangmingyue 2 anos atrás
pai
commit
5ea6d2e482

+ 4
- 4
src/pages/check/components/QuForm.jsx Ver arquivo

@@ -8,12 +8,12 @@ import {
8 8
 } from '@ant-design/pro-components';
9 9
 import { Form, Row, Col } from 'antd';
10 10
 import WangEditor from '@/components/Wangeditor';
11
-import { postTaCheckItemQu } from '@/service/tdlocquestion';
11
+import { postTaCheckItemQu } from '@/service/tdquestion';
12 12
 
13 13
 export default (props) => {
14
-  const {open, onOpenChange, quInfo, itemId, onChange} = props;
14
+  const { open, onOpenChange, quInfo, itemId, onChange } = props;
15 15
   const [form] = Form.useForm();
16
-  
16
+
17 17
   const onFinish = async (values) => {
18 18
     const data = {
19 19
       ...(quInfo || {}),
@@ -168,7 +168,7 @@ export default (props) => {
168 168
         label="选项列表"
169 169
         copyIconProps={false}
170 170
       >
171
-        <Row gutter={24} style={{width: '730px'}}>
171
+        <Row gutter={24} style={{ width: '730px' }}>
172 172
           <Col span={6}>
173 173
             <ProFormText
174 174
               name="answerCode"

+ 4
- 4
src/pages/check/components/QuList.jsx Ver arquivo

@@ -1,7 +1,7 @@
1 1
 import React from 'react';
2 2
 import { Button, Card, Table, Space, Popconfirm } from 'antd';
3 3
 import useBool from '@/utils/hooks/useBool';
4
-import { getTaCheckItemQu } from '@/service/tdlocquestion';
4
+import { getTaCheckItemQu } from '@/service/tdquestion';
5 5
 import { deleteTaCheckItemQu } from '@/service/tacheckitemqu';
6 6
 import QuForm from './QuForm';
7 7
 
@@ -62,7 +62,7 @@ export default (props) => {
62 62
     setCurItem();
63 63
     setOpen(true);
64 64
   }
65
-  
65
+
66 66
   const onEdit = (qu) => {
67 67
     setCurItem(qu);
68 68
     setOpen(true);
@@ -77,7 +77,7 @@ export default (props) => {
77 77
       setList(list.filter(x => x.quId !== qu.quId));
78 78
     }
79 79
   }
80
-  
80
+
81 81
   const onFinish = (res) => {
82 82
     let found = false;
83 83
     const newList = list.map(item => {
@@ -99,7 +99,7 @@ export default (props) => {
99 99
   React.useEffect(() => {
100 100
     if (itemId) {
101 101
       startLoading();
102
-      getTaCheckItemQu({pageSize: 500, itemId}).then((res) => {
102
+      getTaCheckItemQu({ pageSize: 500, itemId }).then((res) => {
103 103
         stopLoading();
104 104
         setList(res.records);
105 105
       }).catch(() => {

+ 5
- 5
src/pages/question/list/index.jsx Ver arquivo

@@ -7,7 +7,7 @@ import {
7 7
   ProFormList,
8 8
   PageContainer
9 9
 } from '@ant-design/pro-components';
10
-import { postTdLocQuestion, getTdLocQuestion, deleteTdLocQuestion, getTdLocQuestionById } from '@/service/tdlocquestion';
10
+import { postTdQuestion, getTdQuestion, deleteTdQuestion, getTdQuestionById } from '@/service/tdquestion';
11 11
 
12 12
 const QuItem = (props) => {
13 13
   const { qu, onEdit, onDelete } = props;
@@ -70,7 +70,7 @@ export default React.forwardRef((props, ref) => {
70 70
 
71 71
   const onFinish = async (values) => {
72 72
     const data = { ...(quInfo || {}), ...values, itemId };
73
-    const res = await postTdLocQuestion(data).then(x => x);
73
+    const res = await postTdQuestion(data).then(x => x);
74 74
     let found = false;
75 75
     const newList = list.map(item => {
76 76
       if (item.quId === res.quId) {
@@ -98,7 +98,7 @@ export default React.forwardRef((props, ref) => {
98 98
 
99 99
   const onDeleteQu = (qu) => {
100 100
     if (qu?.quId) {
101
-      deleteTdLocQuestion(qu.quId).then(() => {
101
+      deleteTdQuestion(qu.quId).then(() => {
102 102
         setList(list.filter(x => x.quId !== qu.quId));
103 103
       })
104 104
     } else {
@@ -114,7 +114,7 @@ export default React.forwardRef((props, ref) => {
114 114
 
115 115
   // React.useEffect(() => {
116 116
   //   if (itemId) {
117
-  //     getTdLocQuestion({ pageSize: 500, itemId }).then((res) => {
117
+  //     getTdQuestion({ pageSize: 500, itemId }).then((res) => {
118 118
   //       setList(res.records);
119 119
   //     });
120 120
   //   }
@@ -122,7 +122,7 @@ export default React.forwardRef((props, ref) => {
122 122
 
123 123
   React.useEffect(() => {
124 124
     if (itemId) {
125
-      getTdLocQuestionById({ pageSize: 500, itemId }).then((res) => {
125
+      getTdQuestionById({ pageSize: 500, itemId }).then((res) => {
126 126
         setList(res.records);
127 127
       });
128 128
     }

+ 0
- 26
src/service/tdlocquanswer.js Ver arquivo

@@ -1,26 +0,0 @@
1
-import request from '@/utils/request';
2
-
3
-/*
4
- * 分页查询
5
- */
6
-export const getTdLocQuAnswer = (params) => request('/api/tdLocQuAnswer', { params });
7
-
8
-/*
9
- * 新增数据
10
- */
11
-export const postTdLocQuAnswer = (data) => request('/api/tdLocQuAnswer', { data, method: 'post' });
12
-
13
-/*
14
- * 通过ID查询单条数据
15
- */
16
-export const getTdLocQuAnswerById = (id) => request(`/api/tdLocQuAnswer/${id}`);
17
-
18
-/*
19
- * 更新数据
20
- */
21
-export const putTdLocQuAnswer = (id, data) => request(`/api/tdLocQuAnswer/${id}`, { data, method: 'put' });
22
-
23
-/*
24
- * 通过主键删除数据
25
- */
26
-export const deleteTdLocQuAnswer = (id) => request(`/api/tdLocQuAnswer/${id}`, { method: 'delete' });

+ 26
- 0
src/service/tdquanswer.js Ver arquivo

@@ -0,0 +1,26 @@
1
+import request from '@/utils/request';
2
+
3
+/*
4
+ * 分页查询
5
+ */
6
+export const getTdQuAnswer = (params) => request('/api/tdQuAnswer', { params });
7
+
8
+/*
9
+ * 新增数据
10
+ */
11
+export const postTdQuAnswer = (data) => request('/api/tdQuAnswer', { data, method: 'post' });
12
+
13
+/*
14
+ * 通过ID查询单条数据
15
+ */
16
+export const getTdQuAnswerById = (id) => request(`/api/tdQuAnswer/${id}`);
17
+
18
+/*
19
+ * 更新数据
20
+ */
21
+export const putTdQuAnswer = (id, data) => request(`/api/tdQuAnswer/${id}`, { data, method: 'put' });
22
+
23
+/*
24
+ * 通过主键删除数据
25
+ */
26
+export const deleteTdQuAnswer = (id) => request(`/api/tdQuAnswer/${id}`, { method: 'delete' });

src/service/tdlocquestion.js → src/service/tdquestion.js Ver arquivo

@@ -28,24 +28,24 @@ export const deleteTaCheckItemQu = (id) => request(`/api/taCheckItemQu/${id}`, {
28 28
 /*
29 29
  * 分页查询
30 30
  */
31
-export const getTdLocQuestion = (params) => request('/api/tdLocQuestion', { params });
31
+export const getTdQuestion = (params) => request('/api/tdQuestion', { params });
32 32
 
33 33
 /*
34 34
  * 新增数据
35 35
  */
36
-export const postTdLocQuestion = (data) => request('/api/tdLocQuestion', { data, method: 'post' });
36
+export const postTdQuestion = (data) => request('/api/tdQuestion', { data, method: 'post' });
37 37
 
38 38
 /*
39 39
  * 通过ID查询单条数据
40 40
  */
41
-export const getTdLocQuestionById = (id) => request(`/api/tdLocQuestion/${id}`);
41
+export const getTdQuestionById = (id) => request(`/api/tdQuestion/${id}`);
42 42
 
43 43
 /*
44 44
  * 更新数据
45 45
  */
46
-export const putTdLocQuestion = (id, data) => request(`/api/tdLocQuestion/${id}`, { data, method: 'put' });
46
+export const putTdQuestion = (id, data) => request(`/api/tdQuestion/${id}`, { data, method: 'put' });
47 47
 
48 48
 /*
49 49
  * 通过主键删除数据
50 50
  */
51
-export const deleteTdLocQuestion = (id) => request(`/api/tdLocQuestion/${id}`, { method: 'delete' });
51
+export const deleteTdQuestion = (id) => request(`/api/tdQuestion/${id}`, { method: 'delete' });