2 Commits

Auteur SHA1 Bericht Datum
  lisenzhou 411235b2f6 Merge branch 'dev1.0' of http://git.ycjcjy.com/civilized_city/pc-admin into dev1.0 2 jaren geleden
  lisenzhou eb823b41e6 fix 2 jaren geleden
6 gewijzigde bestanden met toevoegingen van 3880 en 253 verwijderingen
  1. 3667
    12
      package-lock.json
  2. 78
    0
      src/pages/checkStand/edit/index.jsx
  3. 0
    74
      src/pages/checkStand/index.jsx
  4. 18
    44
      src/pages/checkStand/list/index.jsx
  5. 106
    108
      src/routes/routes.jsx
  6. 11
    15
      vite.config.js

+ 3667
- 12
package-lock.json
Diff onderdrukt omdat het te groot bestand
Bestand weergeven


+ 78
- 0
src/pages/checkStand/edit/index.jsx Bestand weergeven

@@ -0,0 +1,78 @@
1
+import React from "react";
2
+import { Button, Card, Popconfirm } from "antd";
3
+import { useSearchParams } from "react-router-dom";
4
+import Page from "@/components/Page";
5
+import Wangeditor from "@/components/Wangeditor";
6
+import { getTaCheckStandById, putTaCheckStand } from "@/service/tacheckstand";
7
+
8
+export default (props) => {
9
+  const [loading, setLoading] = React.useState(false);
10
+  const [editable, setEditAble] = React.useState(false);
11
+  const [detail, setDetail] = React.useState(false);
12
+
13
+  const [searchParams] = useSearchParams();
14
+  const id = searchParams.get("id");
15
+
16
+  const onChange = (e) => {
17
+    setDetail({
18
+      ...(detail || {}),
19
+      content: e,
20
+    });
21
+  };
22
+
23
+  const onSubmit = (e) => {
24
+    setLoading(true);
25
+    putTaCheckStand(id, detail)
26
+      .then(() => {
27
+        setLoading(false);
28
+      })
29
+      .catch(() => {
30
+        setLoading(false);
31
+      });
32
+  };
33
+
34
+  React.useEffect(() => {
35
+    setLoading(true);
36
+    getTaCheckStandById(id)
37
+      .then((res) => {
38
+        setDetail(res);
39
+        setLoading(false);
40
+      })
41
+      .catch(() => {
42
+        setLoading(false);
43
+      });
44
+  }, []);
45
+
46
+  return (
47
+    <Page>
48
+      <Card
49
+        loading={loading}
50
+        extra={
51
+          <Button type="primary" onClick={onSubmit}>
52
+            提交
53
+          </Button>
54
+        }
55
+      >
56
+        <Wangeditor
57
+          value={detail?.content}
58
+          toolbarConfig={{
59
+            toolbarKeys: [
60
+              "headerSelect",
61
+              "blockquote",
62
+              "|",
63
+              "bold",
64
+              "underline",
65
+              "italic",
66
+              "color",
67
+              "fontSize",
68
+              "|",
69
+              "bulletedList",
70
+              "numberedList",
71
+            ],
72
+          }}
73
+          onChange={onChange}
74
+        />
75
+      </Card>
76
+    </Page>
77
+  );
78
+};

+ 0
- 74
src/pages/checkStand/index.jsx Bestand weergeven

@@ -1,74 +0,0 @@
1
-import React from 'react';
2
-import { Button, Card, Popconfirm } from 'antd';
3
-import Page from '@/components/Page';
4
-import Wangeditor from '@/components/Wangeditor';
5
-import { getTaCheckStandById, putTaCheckStand } from '@/service/tacheckstand';
6
-
7
-export default (props) => {
8
-
9
-  const [loading, setLoading] = React.useState(false);
10
-  const [editable, setEditAble] = React.useState(false);
11
-  const [detail, setDetail] = React.useState(false);
12
-
13
-  const onChange = (e) => {
14
-    setDetail({
15
-      ...detail || {},
16
-      content: e,
17
-    })
18
-  }
19
-
20
-  const onSubmit = (e) => {
21
-    setLoading(true);
22
-    putTaCheckStand(1, detail).then(() => {
23
-      setLoading(false);
24
-      setEditAble(false);
25
-    }).catch(() => {
26
-      setLoading(false);
27
-    })
28
-  }
29
-
30
-  React.useEffect(() => {
31
-    setLoading(true);
32
-    getTaCheckStandById(1).then((res) => {
33
-      setDetail(res);
34
-      setLoading(false);
35
-    }).catch(() => {
36
-      setLoading(false);
37
-    })
38
-  }, []);
39
-
40
-  return (
41
-    <Page>
42
-      <Card loading={loading} extra={(
43
-        editable ? <Button type="primary" onClick={onSubmit}>提交</Button>
44
-          : <Button type="primary" onClick={() => setEditAble(true)}>编辑</Button>
45
-      )}>
46
-        {
47
-          editable ? (
48
-            <Wangeditor
49
-              value={detail?.content}
50
-              toolbarConfig={{
51
-                toolbarKeys: [
52
-                  'headerSelect',
53
-                  'blockquote',
54
-                  '|',
55
-                  'bold',
56
-                  'underline',
57
-                  'italic',
58
-                  'color',
59
-                  'fontSize',
60
-                  '|',
61
-                  'bulletedList',
62
-                  'numberedList',
63
-                ]
64
-              }}
65
-              onChange={onChange}
66
-            />
67
-          ) : (
68
-            <div dangerouslySetInnerHTML={{ __html: detail?.content }}></div>
69
-          )
70
-        }
71
-      </Card>
72
-    </Page>
73
-  )
74
-}

+ 18
- 44
src/pages/checkStand/list/index.jsx Bestand weergeven

@@ -3,9 +3,9 @@ import { useNavigate } from "react-router-dom";
3 3
 import { queryTable } from "@/utils/request";
4 4
 import { ProTable } from "@ant-design/pro-components";
5 5
 import { Button, message, Popconfirm } from "antd";
6
-import { getTdLocType, deleteTdLocType } from "@/service/tdloctype";
6
+import { getTaCheckStand } from "@/service/tacheckstand";
7 7
 
8
-const queryTdLocTypeList = queryTable(getTdLocType);
8
+const queryTaCheckStandList = queryTable(getTaCheckStand);
9 9
 
10 10
 export default (props) => {
11 11
   const actionRef = React.useRef();
@@ -34,26 +34,13 @@ export default (props) => {
34 34
   const columns = [
35 35
     {
36 36
       title: "分类名称",
37
-      dataIndex: "name",
37
+      dataIndex: "locName",
38 38
     },
39 39
     {
40 40
       title: "分类描述",
41 41
       dataIndex: "desc",
42 42
     },
43
-    {
44
-      title: "状态",
45
-      dataIndex: "status",
46
-      valueEnum: {
47
-        1: {
48
-          text: "正常",
49
-          status: "Processing",
50
-        },
51
-        0: {
52
-          text: "禁用",
53
-          status: "Error",
54
-        },
55
-      },
56
-    },
43
+
57 44
     {
58 45
       title: "操作",
59 46
       valueType: "option",
@@ -64,24 +51,11 @@ export default (props) => {
64 51
           style={{ padding: 0 }}
65 52
           type="link"
66 53
           onClick={() => {
67
-            console.log(record, "]]");
68
-            navigate(`/dict/locType/edit?id=${record.typeId}`);
54
+            navigate(`/dict/checkStand/edit?id=${record.statndId}`);
69 55
           }}
70 56
         >
71 57
           编辑
72 58
         </Button>,
73
-        <Popconfirm
74
-          key={3}
75
-          title="您是否确认删除 ?"
76
-          onConfirm={() => handleDelete(record.typeId)}
77
-          okText="确定"
78
-          cancelText="取消"
79
-        >
80
-          {/* manualPush */}
81
-          <Button style={{ padding: 0 }} type="link">
82
-            删除
83
-          </Button>
84
-        </Popconfirm>,
85 59
       ],
86 60
     },
87 61
   ];
@@ -89,20 +63,20 @@ export default (props) => {
89 63
   return (
90 64
     <ProTable
91 65
       actionRef={actionRef}
92
-      rowKey="typeId"
66
+      rowKey="statndId"
93 67
       search={false}
94
-      toolBarRender={() => [
95
-        <Button
96
-          key="1"
97
-          type="primary"
98
-          onClick={() => {
99
-            navigate("/dict/locType/edit");
100
-          }}
101
-        >
102
-          新增
103
-        </Button>,
104
-      ]}
105
-      request={queryTdLocTypeList}
68
+      // toolBarRender={() => [
69
+      //   <Button
70
+      //     key="1"
71
+      //     type="primary"
72
+      //     onClick={() => {
73
+      //       navigate("/dict/locType/edit");
74
+      //     }}
75
+      //   >
76
+      //     新增
77
+      //   </Button>,
78
+      // ]}
79
+      request={queryTaCheckStandList}
106 80
       columns={columns}
107 81
     />
108 82
   );

+ 106
- 108
src/routes/routes.jsx Bestand weergeven

@@ -12,20 +12,20 @@ import {
12 12
   NotificationOutlined,
13 13
   ScheduleOutlined,
14 14
   FileTextOutlined,
15
-  HddOutlined
16
-} from '@ant-design/icons';
17
-import { Outlet } from 'react-router-dom';
15
+  HddOutlined,
16
+} from "@ant-design/icons";
17
+import { Outlet } from "react-router-dom";
18 18
 import AuthLayout from "@/layouts/AuthLayout";
19
-import Login from '@/pages/login';
20
-import Page404 from '@/pages/404';
21
-import Role from '@/pages/role/index';
22
-import User from '@/pages/user/index';
23
-import UserEdit from '@/pages/user/Edit';
24
-import CheckList from '@/pages/check';
25
-import CheckEdit from '@/pages/check/Edit';
19
+import Login from "@/pages/login";
20
+import Page404 from "@/pages/404";
21
+import Role from "@/pages/role/index";
22
+import User from "@/pages/user/index";
23
+import UserEdit from "@/pages/user/Edit";
24
+import CheckList from "@/pages/check";
25
+import CheckEdit from "@/pages/check/Edit";
26 26
 import OrgList from "@/pages/org/index";
27 27
 
28
-import Index from '@/pages/home/index';
28
+import Index from "@/pages/home/index";
29 29
 
30 30
 import PositionList from "@/pages/position/list";
31 31
 import PositionEdit from "@/pages/position/edit";
@@ -34,13 +34,14 @@ import LocTypeEdit from "@/pages/locType/edit";
34 34
 import IssueTypeList from "@/pages/issueType/list";
35 35
 import IssueTypeEdit from "@/pages/issueType/edit";
36 36
 import QuestionList from "@/pages/question/list";
37
-import IssueList from '@/pages/issue';
38
-import IssueDetail from '@/pages/issue/detail';
39
-import Notice from '@/pages/notice';
40
-import CheckStand from '@/pages/checkStand/index';
41
-import CheckStandList from '@/pages/checkStand/list';
42
-import FieldEvaluation from '@/pages/answerRecord/fieldEvaluation';
43
-import QuesInvestigation from '@/pages/answerRecord/QuesInvestigation';
37
+import IssueList from "@/pages/issue";
38
+import IssueDetail from "@/pages/issue/detail";
39
+import Notice from "@/pages/notice";
40
+
41
+import CheckStandList from "@/pages/checkStand/list";
42
+import CheckStandEdit from "@/pages/checkStand/edit";
43
+import FieldEvaluation from "@/pages/answerRecord/fieldEvaluation";
44
+import QuesInvestigation from "@/pages/answerRecord/QuesInvestigation";
44 45
 
45 46
 /**
46 47
  * meta 用来扩展自定义数据数据
@@ -61,45 +62,45 @@ export const authRoutes = [
61 62
     path: "",
62 63
     element: <Outlet />,
63 64
     meta: {
64
-      title: '业务管理',
65
-      menuType: 'group',
66
-      permission: 'biz',
65
+      title: "业务管理",
66
+      menuType: "group",
67
+      permission: "biz",
67 68
     },
68 69
     children: [
69 70
       {
70 71
         path: "notice",
71 72
         element: <Notice />,
72 73
         meta: {
73
-          title: '通知公告',
74
+          title: "通知公告",
74 75
           icon: <NotificationOutlined />,
75
-          permission: 'notice',
76
-        }
76
+          permission: "notice",
77
+        },
77 78
       },
78 79
       {
79 80
         path: "issue",
80 81
         element: <IssueList />,
81 82
         meta: {
82
-          title: '问 题 单',
83
+          title: "问 题 单",
83 84
           icon: <CommentOutlined />,
84
-          permission: 'issue',
85
-        }
85
+          permission: "issue",
86
+        },
86 87
       },
87 88
       {
88 89
         path: "issue/detail",
89 90
         element: <IssueDetail />,
90 91
         meta: {
91
-          title: '问题单详情',
92
+          title: "问题单详情",
92 93
           hideInMenu: true,
93
-          permission: 'issue.detail',
94
-        }
94
+          permission: "issue.detail",
95
+        },
95 96
       },
96 97
       {
97 98
         path: "check",
98 99
         element: <CheckList />,
99 100
         meta: {
100
-          title: '模拟测评',
101
+          title: "模拟测评",
101 102
           icon: <ProjectOutlined />,
102
-          permission: 'check',
103
+          permission: "check",
103 104
         },
104 105
       },
105 106
       {
@@ -107,37 +108,36 @@ export const authRoutes = [
107 108
         element: <CheckEdit />,
108 109
         meta: {
109 110
           hideInMenu: true,
110
-          title: '模拟测评维护',
111
+          title: "模拟测评维护",
111 112
           icon: <ProjectOutlined />,
112
-          permission: 'check.edit',
113
-        }
113
+          permission: "check.edit",
114
+        },
114 115
       },
115 116
       {
116 117
         path: "answerRecord",
117 118
         element: <Outlet />,
118 119
         meta: {
119
-          title: '答题记录',
120
+          title: "答题记录",
120 121
           icon: <FileTextOutlined />,
121 122
         },
122
-        children:
123
-          [
124
-            {
125
-              path: "answerRecord/fieldEvaluation",
126
-              element: <FieldEvaluation />,
127
-              meta: {
128
-                title: '实地测评',
129
-                icon: <HddOutlined />,
130
-              }
123
+        children: [
124
+          {
125
+            path: "answerRecord/fieldEvaluation",
126
+            element: <FieldEvaluation />,
127
+            meta: {
128
+              title: "实地测评",
129
+              icon: <HddOutlined />,
131 130
             },
132
-            {
133
-              path: "answerRecord/quesInvestigation",
134
-              element: <QuesInvestigation />,
135
-              meta: {
136
-                title: '问卷调查',
137
-                icon: <HddOutlined />,
138
-              }
131
+          },
132
+          {
133
+            path: "answerRecord/quesInvestigation",
134
+            element: <QuesInvestigation />,
135
+            meta: {
136
+              title: "问卷调查",
137
+              icon: <HddOutlined />,
139 138
             },
140
-          ]
139
+          },
140
+        ],
141 141
       },
142 142
     ],
143 143
   },
@@ -145,19 +145,19 @@ export const authRoutes = [
145 145
     path: "dict",
146 146
     element: <Outlet />,
147 147
     meta: {
148
-      title: '基础字典',
148
+      title: "基础字典",
149 149
       icon: <ProjectOutlined />,
150
-      menuType: 'group',
151
-      permission: 'dict',
150
+      menuType: "group",
151
+      permission: "dict",
152 152
     },
153 153
     children: [
154 154
       {
155 155
         path: "locType/list",
156 156
         element: <LocTypeList />,
157 157
         meta: {
158
-          title: '点位分类',
158
+          title: "点位分类",
159 159
           icon: <EnvironmentOutlined />,
160
-          permission: 'locType',
160
+          permission: "locType",
161 161
         },
162 162
       },
163 163
       {
@@ -165,9 +165,9 @@ export const authRoutes = [
165 165
         element: <LocTypeEdit />,
166 166
         meta: {
167 167
           hideInMenu: true,
168
-          title: '点位分类编辑',
168
+          title: "点位分类编辑",
169 169
           // icon: <AppstoreOutlined />,
170
-          permission: 'locType.edit',
170
+          permission: "locType.edit",
171 171
         },
172 172
       },
173 173
 
@@ -175,9 +175,9 @@ export const authRoutes = [
175 175
         path: "issueType/list",
176 176
         element: <IssueTypeList />,
177 177
         meta: {
178
-          title: '问题分类',
178
+          title: "问题分类",
179 179
           icon: <BranchesOutlined />,
180
-          permission: 'issueType',
180
+          permission: "issueType",
181 181
         },
182 182
       },
183 183
       {
@@ -185,96 +185,94 @@ export const authRoutes = [
185 185
         element: <IssueTypeEdit />,
186 186
         meta: {
187 187
           hideInMenu: true,
188
-          title: '问题分类编辑',
188
+          title: "问题分类编辑",
189 189
           // icon: <AppstoreOutlined />,
190
-          permission: 'issueType.edit',
190
+          permission: "issueType.edit",
191 191
         },
192 192
       },
193 193
       {
194 194
         path: "question/list",
195 195
         element: <QuestionList />,
196 196
         meta: {
197
-          title: '题库管理',
197
+          title: "题库管理",
198 198
           icon: <NodeIndexOutlined />,
199
-          permission: 'question',
199
+          permission: "question",
200 200
         },
201 201
       },
202 202
       {
203
-        path: "checkStand",
204
-        element: <CheckStand />,
203
+        path: "checkStand/list",
204
+        element: <CheckStandList />,
205 205
         meta: {
206
-          title: '测评标准',
206
+          title: "测评标准",
207 207
           icon: <ScheduleOutlined />,
208
-          permission: 'checkStand',
208
+          permission: "checkStand",
209
+        },
210
+      },
211
+      {
212
+        path: "checkStand/edit",
213
+        element: <CheckStandEdit />,
214
+        meta: {
215
+          title: "测评标准",
216
+          hideInMenu: true,
217
+          permission: "checkStand",
209 218
         },
210
-        childer: [
211
-          {
212
-            path: "checkStand/list",
213
-            element: <CheckStandList />,
214
-            meta: {
215
-              title: '测评标准列表',
216
-              icon: <NodeIndexOutlined />,
217
-              permission: 'question',
218
-            },
219
-          },
220
-        ]
221 219
       },
222
-    ]
220
+    ],
223 221
   },
224 222
   {
225 223
     path: "system",
226 224
     element: <Outlet />,
227 225
     meta: {
228
-      title: '系统管理',
226
+      title: "系统管理",
229 227
       icon: <SettingOutlined />,
230
-      menuType: 'group',
231
-      permission: 'system',
228
+      menuType: "group",
229
+      permission: "system",
232 230
     },
233 231
     children: [
234 232
       {
235 233
         path: "user",
236 234
         element: <User />,
237 235
         meta: {
238
-          title: '人员管理',
236
+          title: "人员管理",
239 237
           icon: <TeamOutlined />,
240
-          permission: 'user',
238
+          permission: "user",
241 239
         },
242 240
       },
243 241
       {
244 242
         path: "user/edit",
245 243
         element: <UserEdit />,
246 244
         meta: {
247
-          title: '人员维护',
245
+          title: "人员维护",
248 246
           hideInMenu: true,
249 247
           // icon: <AppstoreOutlined />,
250
-          permission: 'user.edit',
248
+          permission: "user.edit",
251 249
         },
252 250
       },
253 251
       {
254 252
         path: "role",
255 253
         element: <Role />,
256 254
         meta: {
257
-          title: '角色管理',
255
+          title: "角色管理",
258 256
           icon: <UsergroupAddOutlined />,
259
-          permission: 'role',
257
+          permission: "role",
260 258
         },
261 259
       },
262 260
       {
263 261
         path: "org",
264 262
         element: <OrgList />,
265 263
         meta: {
266
-          title: '机构管理',
264
+          title: "机构管理",
267 265
           icon: <BankOutlined />,
268
-          permission: 'org',
266
+          permission: "org",
269 267
         },
270 268
       },
271 269
       {
272 270
         path: "position/list",
273 271
         element: <PositionList />,
274 272
         meta: {
275
-          title: '岗位管理',
273
+          title: "岗位管理",
276 274
           icon: <GoldOutlined />,
277
-          permission: 'position',
275
+          permission: "position",
278 276
         },
279 277
       },
280 278
       {
@@ -282,12 +280,12 @@ export const authRoutes = [
282 280
         element: <PositionEdit />,
283 281
         meta: {
284 282
           hideInMenu: true,
285
-          title: '岗位管理编辑',
283
+          title: "岗位管理编辑",
286 284
           // icon: <AppstoreOutlined />,
287
-          permission: 'position.edit',
285
+          permission: "position.edit",
288 286
         },
289 287
       },
290
-    ]
288
+    ],
291 289
   },
292 290
 ];
293 291
 
@@ -301,22 +299,22 @@ export const defaultRoutes = [
301 299
         element: <Index />,
302 300
       },
303 301
       {
304
-        path: '*',
305
-        element: <Page404 />
306
-      }
302
+        path: "*",
303
+        element: <Page404 />,
304
+      },
307 305
     ],
308 306
   },
309 307
   {
310
-    path: '/login',
308
+    path: "/login",
311 309
     element: <Login />,
312 310
   },
313 311
   {
314
-    path: '*',
315
-    element: <Page404 />
316
-  }
317
-]
312
+    path: "*",
313
+    element: <Page404 />,
314
+  },
315
+];
318 316
 
319
-export function mergeAuthRoutes (r1, r2) {
317
+export function mergeAuthRoutes(r1, r2) {
320 318
   const r = r1.slice();
321 319
   const children = r1[0].children.slice();
322 320
   r[0].children = children.concat(r2);
@@ -325,7 +323,7 @@ export function mergeAuthRoutes (r1, r2) {
325 323
 
326 324
 // 全部路由
327 325
 export const routes = mergeAuthRoutes(defaultRoutes, authRoutes);
328
-function getPath (parent = "/", current = "") {
326
+function getPath(parent = "/", current = "") {
329 327
   if (current.indexOf("/") === 0 || current.indexOf("http") === 0)
330 328
     return current;
331 329
   return `${parent}/${current}`.replace(/\/\//g, "/");

+ 11
- 15
vite.config.js Bestand weergeven

@@ -1,28 +1,24 @@
1
-import { defineConfig } from 'vite'
2
-import path from "path"
3
-import react from '@vitejs/plugin-react'
1
+import { defineConfig } from "vite";
2
+import path from "path";
3
+import react from "@vitejs/plugin-react";
4 4
 
5 5
 // https://vitejs.dev/config/
6 6
 export default defineConfig({
7
-  base: '',
7
+  base: "",
8 8
   server: {
9 9
     port: 3001,
10
-    host: '0.0.0.0',
10
+    host: "0.0.0.0",
11 11
     proxy: {
12
-      '/api': {
13
-        target: 'http://192.168.89.147:9087',
12
+      "/api": {
13
+        target: "http://192.168.89.147:9087",
14 14
         // target: 'http://t.njyz.tech',
15 15
         changeOrigin: true,
16 16
       },
17
-    }
17
+    },
18 18
   },
19
-  plugins: [
20
-    react(),
21
-  ],
19
+  plugins: [react()],
22 20
   resolve: {
23
-    alias: [
24
-      { find: '@', replacement: path.resolve(__dirname, 'src') },
25
-    ],
21
+    alias: [{ find: "@", replacement: path.resolve(__dirname, "src") }],
26 22
   },
27 23
   css: {
28 24
     preprocessorOptions: {
@@ -32,4 +28,4 @@ export default defineConfig({
32 28
       },
33 29
     },
34 30
   },
35
-})
31
+});