lisenzhou 2 лет назад
Родитель
Сommit
eb823b41e6
6 измененных файлов: 3880 добавлений и 253 удалений
  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
Разница между файлами не показана из-за своего большого размера
Просмотреть файл


+ 78
- 0
src/pages/checkStand/edit/index.jsx Просмотреть файл

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 Просмотреть файл

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 Просмотреть файл

3
 import { queryTable } from "@/utils/request";
3
 import { queryTable } from "@/utils/request";
4
 import { ProTable } from "@ant-design/pro-components";
4
 import { ProTable } from "@ant-design/pro-components";
5
 import { Button, message, Popconfirm } from "antd";
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
 export default (props) => {
10
 export default (props) => {
11
   const actionRef = React.useRef();
11
   const actionRef = React.useRef();
34
   const columns = [
34
   const columns = [
35
     {
35
     {
36
       title: "分类名称",
36
       title: "分类名称",
37
-      dataIndex: "name",
37
+      dataIndex: "locName",
38
     },
38
     },
39
     {
39
     {
40
       title: "分类描述",
40
       title: "分类描述",
41
       dataIndex: "desc",
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
       title: "操作",
45
       title: "操作",
59
       valueType: "option",
46
       valueType: "option",
64
           style={{ padding: 0 }}
51
           style={{ padding: 0 }}
65
           type="link"
52
           type="link"
66
           onClick={() => {
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
         </Button>,
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
   return (
63
   return (
90
     <ProTable
64
     <ProTable
91
       actionRef={actionRef}
65
       actionRef={actionRef}
92
-      rowKey="typeId"
66
+      rowKey="statndId"
93
       search={false}
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
       columns={columns}
80
       columns={columns}
107
     />
81
     />
108
   );
82
   );

+ 106
- 108
src/routes/routes.jsx Просмотреть файл

12
   NotificationOutlined,
12
   NotificationOutlined,
13
   ScheduleOutlined,
13
   ScheduleOutlined,
14
   FileTextOutlined,
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
 import AuthLayout from "@/layouts/AuthLayout";
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
 import OrgList from "@/pages/org/index";
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
 import PositionList from "@/pages/position/list";
30
 import PositionList from "@/pages/position/list";
31
 import PositionEdit from "@/pages/position/edit";
31
 import PositionEdit from "@/pages/position/edit";
34
 import IssueTypeList from "@/pages/issueType/list";
34
 import IssueTypeList from "@/pages/issueType/list";
35
 import IssueTypeEdit from "@/pages/issueType/edit";
35
 import IssueTypeEdit from "@/pages/issueType/edit";
36
 import QuestionList from "@/pages/question/list";
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
  * meta 用来扩展自定义数据数据
47
  * meta 用来扩展自定义数据数据
61
     path: "",
62
     path: "",
62
     element: <Outlet />,
63
     element: <Outlet />,
63
     meta: {
64
     meta: {
64
-      title: '业务管理',
65
-      menuType: 'group',
66
-      permission: 'biz',
65
+      title: "业务管理",
66
+      menuType: "group",
67
+      permission: "biz",
67
     },
68
     },
68
     children: [
69
     children: [
69
       {
70
       {
70
         path: "notice",
71
         path: "notice",
71
         element: <Notice />,
72
         element: <Notice />,
72
         meta: {
73
         meta: {
73
-          title: '通知公告',
74
+          title: "通知公告",
74
           icon: <NotificationOutlined />,
75
           icon: <NotificationOutlined />,
75
-          permission: 'notice',
76
-        }
76
+          permission: "notice",
77
+        },
77
       },
78
       },
78
       {
79
       {
79
         path: "issue",
80
         path: "issue",
80
         element: <IssueList />,
81
         element: <IssueList />,
81
         meta: {
82
         meta: {
82
-          title: '问 题 单',
83
+          title: "问 题 单",
83
           icon: <CommentOutlined />,
84
           icon: <CommentOutlined />,
84
-          permission: 'issue',
85
-        }
85
+          permission: "issue",
86
+        },
86
       },
87
       },
87
       {
88
       {
88
         path: "issue/detail",
89
         path: "issue/detail",
89
         element: <IssueDetail />,
90
         element: <IssueDetail />,
90
         meta: {
91
         meta: {
91
-          title: '问题单详情',
92
+          title: "问题单详情",
92
           hideInMenu: true,
93
           hideInMenu: true,
93
-          permission: 'issue.detail',
94
-        }
94
+          permission: "issue.detail",
95
+        },
95
       },
96
       },
96
       {
97
       {
97
         path: "check",
98
         path: "check",
98
         element: <CheckList />,
99
         element: <CheckList />,
99
         meta: {
100
         meta: {
100
-          title: '模拟测评',
101
+          title: "模拟测评",
101
           icon: <ProjectOutlined />,
102
           icon: <ProjectOutlined />,
102
-          permission: 'check',
103
+          permission: "check",
103
         },
104
         },
104
       },
105
       },
105
       {
106
       {
107
         element: <CheckEdit />,
108
         element: <CheckEdit />,
108
         meta: {
109
         meta: {
109
           hideInMenu: true,
110
           hideInMenu: true,
110
-          title: '模拟测评维护',
111
+          title: "模拟测评维护",
111
           icon: <ProjectOutlined />,
112
           icon: <ProjectOutlined />,
112
-          permission: 'check.edit',
113
-        }
113
+          permission: "check.edit",
114
+        },
114
       },
115
       },
115
       {
116
       {
116
         path: "answerRecord",
117
         path: "answerRecord",
117
         element: <Outlet />,
118
         element: <Outlet />,
118
         meta: {
119
         meta: {
119
-          title: '答题记录',
120
+          title: "答题记录",
120
           icon: <FileTextOutlined />,
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
     path: "dict",
145
     path: "dict",
146
     element: <Outlet />,
146
     element: <Outlet />,
147
     meta: {
147
     meta: {
148
-      title: '基础字典',
148
+      title: "基础字典",
149
       icon: <ProjectOutlined />,
149
       icon: <ProjectOutlined />,
150
-      menuType: 'group',
151
-      permission: 'dict',
150
+      menuType: "group",
151
+      permission: "dict",
152
     },
152
     },
153
     children: [
153
     children: [
154
       {
154
       {
155
         path: "locType/list",
155
         path: "locType/list",
156
         element: <LocTypeList />,
156
         element: <LocTypeList />,
157
         meta: {
157
         meta: {
158
-          title: '点位分类',
158
+          title: "点位分类",
159
           icon: <EnvironmentOutlined />,
159
           icon: <EnvironmentOutlined />,
160
-          permission: 'locType',
160
+          permission: "locType",
161
         },
161
         },
162
       },
162
       },
163
       {
163
       {
165
         element: <LocTypeEdit />,
165
         element: <LocTypeEdit />,
166
         meta: {
166
         meta: {
167
           hideInMenu: true,
167
           hideInMenu: true,
168
-          title: '点位分类编辑',
168
+          title: "点位分类编辑",
169
           // icon: <AppstoreOutlined />,
169
           // icon: <AppstoreOutlined />,
170
-          permission: 'locType.edit',
170
+          permission: "locType.edit",
171
         },
171
         },
172
       },
172
       },
173
 
173
 
175
         path: "issueType/list",
175
         path: "issueType/list",
176
         element: <IssueTypeList />,
176
         element: <IssueTypeList />,
177
         meta: {
177
         meta: {
178
-          title: '问题分类',
178
+          title: "问题分类",
179
           icon: <BranchesOutlined />,
179
           icon: <BranchesOutlined />,
180
-          permission: 'issueType',
180
+          permission: "issueType",
181
         },
181
         },
182
       },
182
       },
183
       {
183
       {
185
         element: <IssueTypeEdit />,
185
         element: <IssueTypeEdit />,
186
         meta: {
186
         meta: {
187
           hideInMenu: true,
187
           hideInMenu: true,
188
-          title: '问题分类编辑',
188
+          title: "问题分类编辑",
189
           // icon: <AppstoreOutlined />,
189
           // icon: <AppstoreOutlined />,
190
-          permission: 'issueType.edit',
190
+          permission: "issueType.edit",
191
         },
191
         },
192
       },
192
       },
193
       {
193
       {
194
         path: "question/list",
194
         path: "question/list",
195
         element: <QuestionList />,
195
         element: <QuestionList />,
196
         meta: {
196
         meta: {
197
-          title: '题库管理',
197
+          title: "题库管理",
198
           icon: <NodeIndexOutlined />,
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
         meta: {
205
         meta: {
206
-          title: '测评标准',
206
+          title: "测评标准",
207
           icon: <ScheduleOutlined />,
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
     path: "system",
223
     path: "system",
226
     element: <Outlet />,
224
     element: <Outlet />,
227
     meta: {
225
     meta: {
228
-      title: '系统管理',
226
+      title: "系统管理",
229
       icon: <SettingOutlined />,
227
       icon: <SettingOutlined />,
230
-      menuType: 'group',
231
-      permission: 'system',
228
+      menuType: "group",
229
+      permission: "system",
232
     },
230
     },
233
     children: [
231
     children: [
234
       {
232
       {
235
         path: "user",
233
         path: "user",
236
         element: <User />,
234
         element: <User />,
237
         meta: {
235
         meta: {
238
-          title: '人员管理',
236
+          title: "人员管理",
239
           icon: <TeamOutlined />,
237
           icon: <TeamOutlined />,
240
-          permission: 'user',
238
+          permission: "user",
241
         },
239
         },
242
       },
240
       },
243
       {
241
       {
244
         path: "user/edit",
242
         path: "user/edit",
245
         element: <UserEdit />,
243
         element: <UserEdit />,
246
         meta: {
244
         meta: {
247
-          title: '人员维护',
245
+          title: "人员维护",
248
           hideInMenu: true,
246
           hideInMenu: true,
249
           // icon: <AppstoreOutlined />,
247
           // icon: <AppstoreOutlined />,
250
-          permission: 'user.edit',
248
+          permission: "user.edit",
251
         },
249
         },
252
       },
250
       },
253
       {
251
       {
254
         path: "role",
252
         path: "role",
255
         element: <Role />,
253
         element: <Role />,
256
         meta: {
254
         meta: {
257
-          title: '角色管理',
255
+          title: "角色管理",
258
           icon: <UsergroupAddOutlined />,
256
           icon: <UsergroupAddOutlined />,
259
-          permission: 'role',
257
+          permission: "role",
260
         },
258
         },
261
       },
259
       },
262
       {
260
       {
263
         path: "org",
261
         path: "org",
264
         element: <OrgList />,
262
         element: <OrgList />,
265
         meta: {
263
         meta: {
266
-          title: '机构管理',
264
+          title: "机构管理",
267
           icon: <BankOutlined />,
265
           icon: <BankOutlined />,
268
-          permission: 'org',
266
+          permission: "org",
269
         },
267
         },
270
       },
268
       },
271
       {
269
       {
272
         path: "position/list",
270
         path: "position/list",
273
         element: <PositionList />,
271
         element: <PositionList />,
274
         meta: {
272
         meta: {
275
-          title: '岗位管理',
273
+          title: "岗位管理",
276
           icon: <GoldOutlined />,
274
           icon: <GoldOutlined />,
277
-          permission: 'position',
275
+          permission: "position",
278
         },
276
         },
279
       },
277
       },
280
       {
278
       {
282
         element: <PositionEdit />,
280
         element: <PositionEdit />,
283
         meta: {
281
         meta: {
284
           hideInMenu: true,
282
           hideInMenu: true,
285
-          title: '岗位管理编辑',
283
+          title: "岗位管理编辑",
286
           // icon: <AppstoreOutlined />,
284
           // icon: <AppstoreOutlined />,
287
-          permission: 'position.edit',
285
+          permission: "position.edit",
288
         },
286
         },
289
       },
287
       },
290
-    ]
288
+    ],
291
   },
289
   },
292
 ];
290
 ];
293
 
291
 
301
         element: <Index />,
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
     element: <Login />,
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
   const r = r1.slice();
318
   const r = r1.slice();
321
   const children = r1[0].children.slice();
319
   const children = r1[0].children.slice();
322
   r[0].children = children.concat(r2);
320
   r[0].children = children.concat(r2);
325
 
323
 
326
 // 全部路由
324
 // 全部路由
327
 export const routes = mergeAuthRoutes(defaultRoutes, authRoutes);
325
 export const routes = mergeAuthRoutes(defaultRoutes, authRoutes);
328
-function getPath (parent = "/", current = "") {
326
+function getPath(parent = "/", current = "") {
329
   if (current.indexOf("/") === 0 || current.indexOf("http") === 0)
327
   if (current.indexOf("/") === 0 || current.indexOf("http") === 0)
330
     return current;
328
     return current;
331
   return `${parent}/${current}`.replace(/\/\//g, "/");
329
   return `${parent}/${current}`.replace(/\/\//g, "/");

+ 11
- 15
vite.config.js Просмотреть файл

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