Browse Source

Merge branch 'dev1.0' of http://git.ycjcjy.com/civilized_city/pc-admin into dev1.0

Yansen 2 years ago
parent
commit
7a896b4800

+ 26
- 26
src/pages/checkStand/index.jsx View File

@@ -1,5 +1,5 @@
1 1
 import React from 'react';
2
-import { Button, Card } from 'antd';
2
+import { Button, Card, Popconfirm } from 'antd';
3 3
 import Page from '@/components/Page';
4 4
 import Wangeditor from '@/components/Wangeditor';
5 5
 import { getTaCheckStandById, putTaCheckStand } from '@/service/tacheckstand';
@@ -43,31 +43,31 @@ export default (props) => {
43 43
         editable ? <Button type="primary" onClick={onSubmit}>提交</Button>
44 44
           : <Button type="primary" onClick={() => setEditAble(true)}>编辑</Button>
45 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
-      }
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 71
       </Card>
72 72
     </Page>
73 73
   )

+ 109
- 0
src/pages/checkStand/list/index.jsx View File

@@ -0,0 +1,109 @@
1
+import React from "react";
2
+import { useNavigate } from "react-router-dom";
3
+import { queryTable } from "@/utils/request";
4
+import { ProTable } from "@ant-design/pro-components";
5
+import { Button, message, Popconfirm } from "antd";
6
+import { getTdLocType, deleteTdLocType } from "@/service/tdloctype";
7
+
8
+const queryTdLocTypeList = queryTable(getTdLocType);
9
+
10
+export default (props) => {
11
+  const actionRef = React.useRef();
12
+  const navigate = useNavigate();
13
+
14
+  // const updateStatus = (user) => {
15
+  //   const status = user.status === 1 ? 0 : 1;
16
+  //   const hide = message.loading("请稍候...", 0);
17
+  //   updateUserStatus(user.id, status)
18
+  //     .then((res) => {
19
+  //       hide();
20
+  //       actionRef.current.reload();
21
+  //     })
22
+  //     .catch(() => {
23
+  //       hide();
24
+  //     });
25
+  // };
26
+  const handleDelete = (id) => {
27
+    if (id) {
28
+      deleteTdLocType(id).then((res) => {
29
+        actionRef.current.reload();
30
+      });
31
+    }
32
+  };
33
+
34
+  const columns = [
35
+    {
36
+      title: "分类名称",
37
+      dataIndex: "name",
38
+    },
39
+    {
40
+      title: "分类描述",
41
+      dataIndex: "desc",
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
+    },
57
+    {
58
+      title: "操作",
59
+      valueType: "option",
60
+      width: 200,
61
+      render: (_, record) => [
62
+        <Button
63
+          key={2}
64
+          style={{ padding: 0 }}
65
+          type="link"
66
+          onClick={() => {
67
+            console.log(record, "]]");
68
+            navigate(`/dict/locType/edit?id=${record.typeId}`);
69
+          }}
70
+        >
71
+          编辑
72
+        </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
+      ],
86
+    },
87
+  ];
88
+
89
+  return (
90
+    <ProTable
91
+      actionRef={actionRef}
92
+      rowKey="typeId"
93
+      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}
106
+      columns={columns}
107
+    />
108
+  );
109
+};

+ 33
- 1
src/pages/home/components/ProblemCharts.jsx View File

@@ -53,10 +53,42 @@ export default (props) => {
53 53
               color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
54 54
                 { offset: 0, color: '#FB9900' },
55 55
                 { offset: 1, color: '#FFD38F' }
56
-              ])
56
+              ]),
57
+              // barBorderRadius: [8, 0, 0, 0]
57 58
             },
58 59
             data: res.map(x => x.value),
59 60
           }
61
+          // {
62
+          //   type: 'bar',
63
+          //   barWidth: '4%',
64
+          //   itemStyle: {
65
+          //     normal: {
66
+          //       color: new echarts.graphic.LinearGradient(0, 1, 0, 0, [{
67
+          //         offset: 0,
68
+          //         color: "#FCA319" // 0% 处的颜色
69
+          //       }, {
70
+          //         offset: 1,
71
+          //         color: "#ED8224" // 100% 处的颜色
72
+          //       }], false),
73
+          //       barBorderRadius: [0, 0, 100, 0]
74
+          //     }
75
+          //   },
76
+          //   barGap: 0,
77
+          //   data: res.map(x => x.value)
78
+          // }, {
79
+          //   type: 'pictorialBar',
80
+          //   itemStyle: {
81
+          //     borderWidth: '20%',
82
+          //     color: '#FEC05F'
83
+          //   },
84
+          //   symbol: 'path://M 0,0 l 120,0 l -30,60 l -120,0 z',
85
+          //   symbolSize: ['34%', '8'],
86
+          //   symbolOffset: ['-1', '-1'], // 左右 ,上下
87
+          //   symbolRotate: 0,
88
+          //   symbolPosition: 'end',
89
+          //   data: res.map(x => x.value),
90
+          //   z: 3
91
+          // }
60 92
         ]
61 93
       });
62 94
     }).catch(console.error);

+ 22
- 18
src/pages/locType/list/index.jsx View File

@@ -4,6 +4,7 @@ import { queryTable } from "@/utils/request";
4 4
 import { ProTable } from "@ant-design/pro-components";
5 5
 import { Button, message, Popconfirm } from "antd";
6 6
 import { getTdLocType, deleteTdLocType } from "@/service/tdloctype";
7
+import Page from "@/components/Page";
7 8
 
8 9
 const queryTdLocTypeList = queryTable(getTdLocType);
9 10
 
@@ -87,23 +88,26 @@ export default (props) => {
87 88
   ];
88 89
 
89 90
   return (
90
-    <ProTable
91
-      actionRef={actionRef}
92
-      rowKey="typeId"
93
-      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}
106
-      columns={columns}
107
-    />
91
+    <Page>
92
+      <ProTable
93
+        actionRef={actionRef}
94
+        rowKey="typeId"
95
+        search={false}
96
+        toolBarRender={() => [
97
+          <Button
98
+            key="1"
99
+            type="primary"
100
+            onClick={() => {
101
+              navigate("/dict/locType/edit");
102
+            }}
103
+          >
104
+            新增
105
+          </Button>,
106
+        ]}
107
+        request={queryTdLocTypeList}
108
+        columns={columns}
109
+      />
110
+    </Page>
111
+
108 112
   );
109 113
 };

+ 13
- 1
src/routes/routes.jsx View File

@@ -37,7 +37,8 @@ import QuestionList from "@/pages/question/list";
37 37
 import IssueList from '@/pages/issue';
38 38
 import IssueDetail from '@/pages/issue/detail';
39 39
 import Notice from '@/pages/notice';
40
-import CheckStand from '@/pages/checkStand';
40
+import CheckStand from '@/pages/checkStand/index';
41
+import CheckStandList from '@/pages/checkStand/list';
41 42
 import FieldEvaluation from '@/pages/answerRecord/fieldEvaluation';
42 43
 import QuesInvestigation from '@/pages/answerRecord/QuesInvestigation';
43 44
 
@@ -206,6 +207,17 @@ export const authRoutes = [
206 207
           icon: <ScheduleOutlined />,
207 208
           permission: 'checkStand',
208 209
         },
210
+        childer: [
211
+          {
212
+            path: "checkStand/list",
213
+            element: <CheckStandList />,
214
+            meta: {
215
+              title: '测评标准列表',
216
+              icon: <NodeIndexOutlined />,
217
+              permission: 'question',
218
+            },
219
+          },
220
+        ]
209 221
       },
210 222
     ]
211 223
   },

+ 1
- 1
vite.config.js View File

@@ -10,7 +10,7 @@ export default defineConfig({
10 10
     host: '0.0.0.0',
11 11
     proxy: {
12 12
       '/api': {
13
-        target: 'http://127.0.0.1:9087',
13
+        target: 'http://192.168.89.147:9087',
14 14
         // target: 'http://t.njyz.tech',
15 15
         changeOrigin: true,
16 16
       },