Explorar el Código

Merge branch 'master' of http://git.ycjcjy.com/civilized_city/pc-admin

fangmingyue hace 2 años
padre
commit
a5329291b9

+ 2
- 2
index.html Ver fichero

@@ -2,9 +2,9 @@
2 2
 <html lang="en">
3 3
   <head>
4 4
     <meta charset="UTF-8" />
5
-    <link rel="icon" type="image/svg+xml" href="/vite.svg" />
5
+    <link rel="icon" type="image/x-icon" href="favicon.ico" />
6 6
     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
-    <title>Vite + React</title>
7
+    <title>文明霍山</title>
8 8
   </head>
9 9
   <body>
10 10
     <div id="root"></div>

BIN
public/favicon.ico Ver fichero


BIN
public/logo.png Ver fichero


+ 0
- 1
public/vite.svg Ver fichero

@@ -1 +0,0 @@
1
-<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>

+ 89
- 0
src/pages/issue/detail/components/ApplyInfo.jsx Ver fichero

@@ -0,0 +1,89 @@
1
+import React from 'react';
2
+import { ProTable } from '@ant-design/pro-components';
3
+import { Card } from 'antd';
4
+import { getTaIssueApply } from '@/service/taissueapply';
5
+import { getSysOrg } from '@/service/sysorg';
6
+import { queryTable, queryDict } from '@/utils/request';
7
+import useBool from '@/utils/hooks/useBool';
8
+
9
+const fetchOrg = queryDict(getSysOrg, { labelKey: 'orgId', valueKey: 'name' });
10
+const fetchData = queryTable(getTaIssueApply);
11
+
12
+export default (props) => {
13
+  const { issueId } = props;
14
+  
15
+  const columns = [
16
+    {
17
+      title: "申请日期",
18
+      dataIndex: "createDate",
19
+      valueType: 'date',
20
+    },
21
+    {
22
+      title: "申请类别",
23
+      dataIndex: "applyType",
24
+      valueEnum: {
25
+        verify: {
26
+          text: '问题单审核',
27
+        },
28
+        reject: {
29
+          text: '驳回申请',
30
+        },
31
+        delay: {
32
+          text: '延期申请',
33
+        },
34
+        end: {
35
+          text: '销单申请',
36
+        },
37
+      }
38
+    },
39
+    {
40
+      title: "申请人",
41
+      dataIndex: "createUserName",
42
+    },
43
+    {
44
+      title: "审批日期",
45
+      dataIndex: "verifyDate",
46
+      valueType: 'date',
47
+    },
48
+    {
49
+      title: "审批人",
50
+      dataIndex: "verifyUserName",
51
+    },
52
+    {
53
+      title: "审批结果",
54
+      dataIndex: "verifyStatus",
55
+      valueEnum: {
56
+        pass: {
57
+          text: '通过',
58
+          status: 'Success',
59
+        },
60
+        reject: {
61
+          text: '驳回',
62
+          status: 'Error',
63
+        },
64
+      }
65
+    },
66
+    {
67
+      title: "审批意见",
68
+      dataIndex: "verifyDesc",
69
+    },
70
+    {
71
+      title: "申请单位",
72
+      dataIndex: "orgId",
73
+      request: fetchOrg
74
+    }
75
+  ]
76
+
77
+  return (
78
+    <Card title="申请流程">
79
+      <ProTable
80
+        rowKey="verifyId"
81
+        search={false}
82
+        params={{issueId}}
83
+        columns={columns}
84
+        request={fetchData}
85
+        toolBarRender={false}
86
+      />
87
+    </Card>
88
+  )
89
+}

+ 23
- 0
src/pages/issue/detail/components/AttachList.jsx Ver fichero

@@ -0,0 +1,23 @@
1
+import React from 'react';
2
+import { Image } from 'antd';
3
+import styles from './style.module.less';
4
+
5
+export default (props) => {
6
+  const { attachList } = props;
7
+
8
+  return (
9
+    <div className={styles['attach-list-box']}>
10
+    {
11
+      (attachList || []).map(attach => (
12
+        <div key={attach.attachId}>
13
+          {
14
+            !attach.fileType || attach.fileType == 'image' ?
15
+              <Image style={{width: '100%', height: '100%'}} src={attach.url} /> :
16
+              <video controls style={{width: '100%', height: '100%'}} src={attach.url}></video>
17
+          }
18
+        </div>
19
+      ))
20
+    }
21
+    </div>
22
+  )
23
+}

+ 68
- 0
src/pages/issue/detail/components/BasicProfile.jsx Ver fichero

@@ -0,0 +1,68 @@
1
+import React from 'react';
2
+import { Card, Descriptions, Image } from 'antd';
3
+import dayjs from 'dayjs';
4
+import useBool from '@/utils/hooks/useBool';
5
+import { getTaIssueById } from '@/service/taissue';
6
+import { getSysOrgById } from '@/service/sysorg';
7
+import AttachList from './AttachList';
8
+
9
+const fmDate = dt => !dt ? '-' : dayjs(dt).format('YYYY-MM-DD');
10
+const getStatusLabel = status => ({start: '待交办', assigned: '处理中', end: '已办结'})[status];
11
+
12
+export default (props) => {
13
+
14
+  const { issueId, onIssueChange } = props;
15
+
16
+  const [loading, startLoading, stopLoading] = useBool();
17
+  const [detail, setDetail] = React.useState();
18
+
19
+  React.useEffect(() => {
20
+    if (issueId) {
21
+      startLoading();
22
+      getTaIssueById(issueId).then((res) => {
23
+        if (onIssueChange) {
24
+          onIssueChange(res);
25
+        }
26
+
27
+        if (res.orgId) {
28
+          getSysOrgById(res.orgId).then(r => {
29
+            stopLoading();
30
+            setDetail({
31
+              ...res,
32
+              orgName: r.name
33
+            });
34
+          }).catch(() => {
35
+            stopLoading();
36
+            setDetail(res);
37
+          });
38
+        } else {
39
+          stopLoading();
40
+          setDetail(res);
41
+        }
42
+      }).catch(er => {
43
+        stopLoading();
44
+      });
45
+    }
46
+  }, [issueId]);
47
+
48
+  return (
49
+    <Card title="基础信息" loading={loading}>
50
+      <Descriptions layout="vertical" column={3} bordered>
51
+        <Descriptions.Item label="点位">{detail?.locName}</Descriptions.Item>
52
+        <Descriptions.Item label="地址">{detail?.addr}</Descriptions.Item>
53
+        <Descriptions.Item label="上报时间">{fmDate(detail?.createDate)}</Descriptions.Item>
54
+        <Descriptions.Item label="上报人">{detail?.userName}</Descriptions.Item>
55
+        <Descriptions.Item label="问题类型">{detail?.typeName}</Descriptions.Item>
56
+        <Descriptions.Item label="流程状态">{getStatusLabel(detail?.processNode)}</Descriptions.Item>
57
+        <Descriptions.Item label="截止日期">{fmDate(detail?.expireDate)}</Descriptions.Item>
58
+        <Descriptions.Item label="责任单位" span={2}>{detail?.orgName}</Descriptions.Item>
59
+        <Descriptions.Item label="问题描述" span={3}>
60
+          <div dangerouslySetInnerHTML={{__html: detail?.content}}></div>  
61
+        </Descriptions.Item>
62
+        <Descriptions.Item label="图片列表" span={3}>
63
+          <AttachList attachList={detail?.attachList} />
64
+        </Descriptions.Item>
65
+      </Descriptions>
66
+    </Card>
67
+  )
68
+}

+ 33
- 0
src/pages/issue/detail/components/OrgIssue.jsx Ver fichero

@@ -0,0 +1,33 @@
1
+import React from 'react';
2
+import { Card, Space } from 'antd';
3
+import useBool from '@/utils/hooks/useBool';
4
+import AttachList from './AttachList';
5
+import { getTaOrgIssueById } from '@/service/taissue';
6
+
7
+export default (props) => {
8
+  const { issueId } = props;
9
+
10
+  const [loading, startLoading, stopLoading] = useBool();
11
+  const [detail, setDetail] = React.useState();
12
+
13
+  React.useEffect(() => {
14
+    if (issueId) {
15
+      startLoading();
16
+      getTaOrgIssueById(issueId).then((res) => {
17
+        stopLoading();
18
+        setDetail(res);
19
+      }).catch(() => {
20
+        stopLoading();
21
+      });
22
+    }
23
+  }, [issueId]);
24
+
25
+  return (
26
+    <Card title="处理结果" loading={loading}>
27
+      <Space direction="vertical"  size="middle" style={{ width: '100%' }}>
28
+        <div dangerouslySetInnerHTML={{__html: detail?.result}}></div>
29
+        <AttachList attachList={detail?.attachList} />
30
+      </Space>
31
+    </Card>
32
+  )
33
+}

+ 58
- 0
src/pages/issue/detail/components/Process.jsx Ver fichero

@@ -0,0 +1,58 @@
1
+import React from 'react';
2
+import dayjs from 'dayjs';
3
+import { Card, Steps } from 'antd';
4
+import useBool from '@/utils/hooks/useBool';
5
+import { getTaIssueProcess } from '@/service/taissueprocess';
6
+
7
+const fmDt = dt => !dt ? '-' : dayjs(dt).format('YYYY-MM-DD');
8
+
9
+export default (props) => {
10
+
11
+  const { issueId } = props;
12
+
13
+  const [loading, startLoading, stopLoading] = useBool();
14
+  const [items, setItems] = React.useState([
15
+    { title: '待交办' },
16
+    { title: '处理中' },
17
+    { title: '已办结' },
18
+  ]);
19
+
20
+  const [current, setCurrent] = React.useState(0);
21
+
22
+  React.useEffect(() => {
23
+    if (issueId) {
24
+      startLoading();
25
+      getTaIssueProcess({ pageSize: 100, issueId }).then(res => {
26
+        stopLoading();
27
+        const records = res.records || [];
28
+
29
+        const startRec = records.filter(x => x.processNode == 'start')[0];
30
+        const assignedRec = records.filter(x => x.processNode == 'assigned')[0];
31
+        const endRec = records.filter(x => x.processNode == 'end')[0];
32
+
33
+        setItems([
34
+          { title: '待交办', description: fmDt(startRec?.createDate) },
35
+          { title: '处理中', description: fmDt(assignedRec?.createDate) },
36
+          { title: '已办结', description: fmDt(endRec?.createDate) },
37
+        ]);
38
+
39
+        if (endRec) {
40
+          setCurrent(2);
41
+        } else if (assignedRec) {
42
+          setCurrent(1);
43
+        } else {
44
+          setCurrent(0);
45
+        }
46
+
47
+      }).catch(() => {
48
+        stopLoading();
49
+      });
50
+    }
51
+  }, [issueId]);
52
+
53
+  return (
54
+    <Card loading={loading}>
55
+      <Steps current={current} items={items}/>
56
+    </Card>
57
+  )
58
+}

+ 16
- 0
src/pages/issue/detail/components/style.module.less Ver fichero

@@ -0,0 +1,16 @@
1
+
2
+.attach-list-box {
3
+  display: grid;
4
+  grid-template-columns: repeat(auto-fill, 200px);
5
+  grid-auto-rows: 200px;
6
+  grid-gap: 24px;
7
+  place-items: center;
8
+
9
+  & > div {
10
+    width: 200px;
11
+    height: 200px;
12
+    display: grid;
13
+    place-items: center;
14
+    overflow: hidden;
15
+  }
16
+}

+ 25
- 0
src/pages/issue/detail/index.jsx Ver fichero

@@ -0,0 +1,25 @@
1
+import React from 'react';
2
+import { useSearchParams } from 'react-router-dom';
3
+import { Space } from 'antd';
4
+import Page from '@/components/Page';
5
+import Process from './components/Process';
6
+import BasicProfile from './components/BasicProfile';
7
+import ApplyInfo from './components/ApplyInfo';
8
+import OrgIssue from './components/OrgIssue';
9
+
10
+export default (props) => {
11
+
12
+  const [params] = useSearchParams();
13
+  const id = params.get("id");
14
+
15
+  return (
16
+    <Page>
17
+      <Space direction="vertical"  size="middle" style={{ width: '100%' }}>
18
+        <Process issueId={id} />
19
+        <BasicProfile issueId={id} />
20
+        <ApplyInfo issueId={id} />
21
+        <OrgIssue issueId={id} />
22
+      </Space>
23
+    </Page>
24
+  )
25
+}

+ 4
- 1
src/pages/issue/index.jsx Ver fichero

@@ -1,5 +1,6 @@
1 1
 import React from 'react';
2 2
 import { Button, Badge } from 'antd';
3
+import { useNavigate } from 'react-router-dom';
3 4
 import List from '@/components/Page/List';
4 5
 import { getTaIssue } from '@/service/taissue';
5 6
 import { getTdLocType } from '@/service/tdloctype';
@@ -13,6 +14,8 @@ const today = (new Date()).toJSON().substring(0, 10);
13 14
 
14 15
 export default (props) => {
15 16
 
17
+  const navigate = useNavigate();
18
+
16 19
   const columns = [
17 20
     {
18 21
       title: "上报日期",
@@ -103,7 +106,7 @@ export default (props) => {
103 106
       request={getTaIssue}
104 107
       columns={columns}
105 108
       optionRender={(_, row) => [
106
-        <Button key="detail" type="link">详情</Button>
109
+        <Button key="detail" type="link" onClick={() => navigate(`/issue/detail?id=${row.issueId}`)}>详情</Button>
107 110
       ]}
108 111
     />
109 112
   )

+ 29
- 15
src/routes/routes.jsx Ver fichero

@@ -33,6 +33,7 @@ import IssueTypeList from "@/pages/issueType/list";
33 33
 import IssueTypeEdit from "@/pages/issueType/edit";
34 34
 import QuestionList from "@/pages/question/list";
35 35
 import IssueList from '@/pages/issue';
36
+import IssueDetail from '@/pages/issue/detail';
36 37
 import Notice from '@/pages/notice';
37 38
 import CheckStand from '@/pages/checkStand';
38 39
 
@@ -57,6 +58,7 @@ export const authRoutes = [
57 58
     meta: {
58 59
       title: '业务管理',
59 60
       menuType: 'group',
61
+      permission: 'biz',
60 62
     },
61 63
     children: [
62 64
       {
@@ -65,6 +67,7 @@ export const authRoutes = [
65 67
         meta: {
66 68
           title: '通知公告',
67 69
           icon: <NotificationOutlined />,
70
+          permission: 'notice',
68 71
         }
69 72
       },
70 73
       {
@@ -73,6 +76,16 @@ export const authRoutes = [
73 76
         meta: {
74 77
           title: '问 题 单',
75 78
           icon: <CommentOutlined />,
79
+          permission: 'issue',
80
+        }
81
+      },
82
+      {
83
+        path: "issue/detail",
84
+        element: <IssueDetail />,
85
+        meta: {
86
+          title: '问题单详情',
87
+          hideInMenu: true,
88
+          permission: 'issue.detail',
76 89
         }
77 90
       },
78 91
       {
@@ -81,6 +94,7 @@ export const authRoutes = [
81 94
         meta: {
82 95
           title: '模拟测评',
83 96
           icon: <ProjectOutlined />,
97
+          permission: 'check',
84 98
         }
85 99
       },
86 100
       {
@@ -90,6 +104,7 @@ export const authRoutes = [
90 104
           hideInMenu: true,
91 105
           title: '模拟测评维护',
92 106
           icon: <ProjectOutlined />,
107
+          permission: 'check.edit',
93 108
         }
94 109
       },
95 110
     ],
@@ -101,17 +116,16 @@ export const authRoutes = [
101 116
       title: '基础字典',
102 117
       icon: <ProjectOutlined />,
103 118
       menuType: 'group',
104
-      // permission: 'form',
119
+      permission: 'dict',
105 120
     },
106 121
     children: [
107
-
108 122
       {
109 123
         path: "locType/list",
110 124
         element: <LocTypeList />,
111 125
         meta: {
112 126
           title: '点位分类',
113 127
           icon: <EnvironmentOutlined />,
114
-          // permission: 'form',
128
+          permission: 'locType',
115 129
         },
116 130
       },
117 131
       {
@@ -121,7 +135,7 @@ export const authRoutes = [
121 135
           hideInMenu: true,
122 136
           title: '点位分类编辑',
123 137
           // icon: <AppstoreOutlined />,
124
-          // permission: 'form',
138
+          permission: 'locType.edit',
125 139
         },
126 140
       },
127 141
 
@@ -131,7 +145,7 @@ export const authRoutes = [
131 145
         meta: {
132 146
           title: '问题分类',
133 147
           icon: <BranchesOutlined />,
134
-          // permission: 'form',
148
+          permission: 'issueType',
135 149
         },
136 150
       },
137 151
       {
@@ -141,7 +155,7 @@ export const authRoutes = [
141 155
           hideInMenu: true,
142 156
           title: '问题分类编辑',
143 157
           // icon: <AppstoreOutlined />,
144
-          // permission: 'form',
158
+          permission: 'issueType.edit',
145 159
         },
146 160
       },
147 161
       {
@@ -150,7 +164,7 @@ export const authRoutes = [
150 164
         meta: {
151 165
           title: '题库管理',
152 166
           icon: <NodeIndexOutlined />,
153
-          // permission: 'form',
167
+          permission: 'question',
154 168
         },
155 169
       },
156 170
       {
@@ -159,7 +173,7 @@ export const authRoutes = [
159 173
         meta: {
160 174
           title: '测评标准',
161 175
           icon: <ScheduleOutlined />,
162
-          // permission: 'form',
176
+          permission: 'checkStand',
163 177
         },
164 178
       },
165 179
     ]
@@ -171,7 +185,7 @@ export const authRoutes = [
171 185
       title: '系统管理',
172 186
       icon: <SettingOutlined />,
173 187
       menuType: 'group',
174
-      // permission: 'form',
188
+      permission: 'system',
175 189
     },
176 190
     children: [
177 191
       {
@@ -180,7 +194,7 @@ export const authRoutes = [
180 194
         meta: {
181 195
           title: '人员管理',
182 196
           icon: <TeamOutlined />,
183
-          // permission: 'form',
197
+          permission: 'user',
184 198
         },
185 199
       },
186 200
       {
@@ -190,7 +204,7 @@ export const authRoutes = [
190 204
           title: '人员维护',
191 205
           hideInMenu: true,
192 206
           // icon: <AppstoreOutlined />,
193
-          // permission: 'form',
207
+          permission: 'user.edit',
194 208
         },
195 209
       },
196 210
       {
@@ -199,7 +213,7 @@ export const authRoutes = [
199 213
         meta: {
200 214
           title: '角色管理',
201 215
           icon: <UsergroupAddOutlined />,
202
-          // permission: 'form',
216
+          permission: 'role',
203 217
         },
204 218
       },
205 219
       {
@@ -208,7 +222,7 @@ export const authRoutes = [
208 222
         meta: {
209 223
           title: '机构管理',
210 224
           icon: <BankOutlined />,
211
-          // permission: 'form',
225
+          permission: 'org',
212 226
         },
213 227
       },
214 228
       {
@@ -217,7 +231,7 @@ export const authRoutes = [
217 231
         meta: {
218 232
           title: '岗位管理',
219 233
           icon: <GoldOutlined />,
220
-          // permission: 'form',
234
+          permission: 'position',
221 235
         },
222 236
       },
223 237
       {
@@ -227,7 +241,7 @@ export const authRoutes = [
227 241
           hideInMenu: true,
228 242
           title: '岗位管理编辑',
229 243
           // icon: <AppstoreOutlined />,
230
-          // permission: 'form',
244
+          permission: 'position.edit',
231 245
         },
232 246
       },
233 247
     ]

+ 5
- 0
src/service/taissue.js Ver fichero

@@ -15,6 +15,11 @@ export const postTaIssue = (data) => request('/api/taIssue', { data, method: 'po
15 15
  */
16 16
 export const getTaIssueById = (id) => request(`/api/taIssue/${id}`);
17 17
 
18
+/*
19
+ * 通过ID查询单条数据
20
+ */
21
+export const getTaOrgIssueById = (id) => request(`/api/taIssue/${id}/orgIssue`);
22
+
18 23
 /*
19 24
  * 更新数据
20 25
  */

+ 26
- 0
src/service/taissueapply.js Ver fichero

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

+ 2
- 2
src/store/models/system.js Ver fichero

@@ -10,8 +10,8 @@ export default function useSystem() {
10 10
 
11 11
   // 其他配置
12 12
   const [app, setApp] = useState({
13
-    fullName: '云致科技信息管理系统',
14
-    shorName: '云致科技',
13
+    fullName: '文明创城信息管理系统',
14
+    shorName: '文明霍山',
15 15
     company: '云致科技'
16 16
   });
17 17
 

+ 1
- 1
src/store/models/user.js Ver fichero

@@ -11,7 +11,7 @@ export default function useUser() {
11 11
 
12 12
   const getCurrentUser = () => new Promise((resolve, reject) => {
13 13
     currentUser().then(res => {
14
-      const permissions = (res.resourcesList || []).map(x => x.code);
14
+      const permissions = (res.resourcesList || []).map(x => x.resourceCode);
15 15
 
16 16
       // authRoutes 是所有待验证授权的路由
17 17
       // authedRoutes 是已经被授权的路由