diff --git a/web/client/assets/fonts/DINExp.ttf b/web/client/assets/fonts/DINExp.ttf new file mode 100644 index 0000000..0a83634 Binary files /dev/null and b/web/client/assets/fonts/DINExp.ttf differ diff --git a/web/client/assets/images/install/cardBackground.png b/web/client/assets/images/install/cardBackground.png new file mode 100644 index 0000000..4a88691 Binary files /dev/null and b/web/client/assets/images/install/cardBackground.png differ diff --git a/web/client/assets/images/install/greyBackground.png b/web/client/assets/images/install/greyBackground.png new file mode 100644 index 0000000..177fe0a Binary files /dev/null and b/web/client/assets/images/install/greyBackground.png differ diff --git a/web/client/assets/images/install/icon_detele.png b/web/client/assets/images/install/icon_detele.png new file mode 100644 index 0000000..7b61ee8 Binary files /dev/null and b/web/client/assets/images/install/icon_detele.png differ diff --git a/web/client/assets/images/install/icon_edit.png b/web/client/assets/images/install/icon_edit.png new file mode 100644 index 0000000..965dd66 Binary files /dev/null and b/web/client/assets/images/install/icon_edit.png differ diff --git a/web/client/assets/images/install/icon_haveAuthority.png b/web/client/assets/images/install/icon_haveAuthority.png new file mode 100644 index 0000000..e684407 Binary files /dev/null and b/web/client/assets/images/install/icon_haveAuthority.png differ diff --git a/web/client/assets/images/install/icon_noPermission.png b/web/client/assets/images/install/icon_noPermission.png new file mode 100644 index 0000000..6ab8e35 Binary files /dev/null and b/web/client/assets/images/install/icon_noPermission.png differ diff --git a/web/client/assets/images/install/roleAdd.png b/web/client/assets/images/install/roleAdd.png new file mode 100644 index 0000000..43ccad4 Binary files /dev/null and b/web/client/assets/images/install/roleAdd.png differ diff --git a/web/client/assets/images/install/setPermissions.png b/web/client/assets/images/install/setPermissions.png new file mode 100644 index 0000000..4844d7c Binary files /dev/null and b/web/client/assets/images/install/setPermissions.png differ diff --git a/web/client/assets/images/install/table_question.png b/web/client/assets/images/install/table_question.png new file mode 100644 index 0000000..5e3f55d Binary files /dev/null and b/web/client/assets/images/install/table_question.png differ diff --git a/web/client/index.html b/web/client/index.html index 43369d7..30f34fb 100644 --- a/web/client/index.html +++ b/web/client/index.html @@ -10,7 +10,7 @@ - + diff --git a/web/client/src/app.jsx b/web/client/src/app.jsx index e1a94b4..a091d81 100644 --- a/web/client/src/app.jsx +++ b/web/client/src/app.jsx @@ -4,7 +4,7 @@ import React, { useEffect } from 'react'; import Layout from './layout'; import Auth from './sections/auth'; import Example from './sections/example'; -import Example1 from './sections/example1'; +import Install from './sections/install'; import Problem from './sections/problem'; import NoMatch from './sections/noMatch'; import Console from './sections/console'; @@ -33,7 +33,7 @@ const App = props => { diff --git a/web/client/src/index.less b/web/client/src/index.less index fdbafbc..ea81c19 100644 --- a/web/client/src/index.less +++ b/web/client/src/index.less @@ -71,4 +71,8 @@ body { @font-face { font-family: 'YouSheBiaoTiHei'; //这个可以任意取,但是应与后面相对应eg:yxingguang src: url('/assets/fonts/YouSheBiaoTiHei-2.ttf'); -} \ No newline at end of file +} +@font-face { + font-family: 'DINExp'; //这个可以任意取,但是应与后面相对应eg:yxingguang + src: url('/assets/fonts/DINExp.ttf'); + } \ No newline at end of file diff --git a/web/client/src/layout/containers/layout/index.jsx b/web/client/src/layout/containers/layout/index.jsx index dcf46dc..51bc314 100644 --- a/web/client/src/layout/containers/layout/index.jsx +++ b/web/client/src/layout/containers/layout/index.jsx @@ -251,7 +251,6 @@ const LayoutContainer = props => { ) : ('')}
basicAction({ -// type: 'get', -// dispatch: dispatch, -// actionType: 'GET_MEMBERS', -// url: `${ApiTable.getEnterprisesMembers.replace('{enterpriseId}', orgId)}`, -// msg: { error: '获取用户列表失败' }, -// reducer: { name: 'members' } -// }); -// } diff --git a/web/client/src/sections/example1/actions/index.js b/web/client/src/sections/example1/actions/index.js deleted file mode 100644 index 090c73f..0000000 --- a/web/client/src/sections/example1/actions/index.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -import * as example from './example' - -export default { - ...example -} \ No newline at end of file diff --git a/web/client/src/sections/example1/containers/example.jsx b/web/client/src/sections/example1/containers/example.jsx deleted file mode 100644 index 47fbace..0000000 --- a/web/client/src/sections/example1/containers/example.jsx +++ /dev/null @@ -1,60 +0,0 @@ -import React, { useEffect } from 'react'; -import { connect } from 'react-redux'; -import { Spin, Card } from '@douyinfe/semi-ui'; -import '../style.less' -const { Meta } = Card; - -const Example = (props) => { - const { dispatch, actions, user, loading, socket } = props - - useEffect(() => { - // ACTION 示例 - // dispatch(actions.example.getMembers(user.orgId)) - }, []) - - // websocket 使用测试 -// useEffect(() => { -// console.log(socket) -// if (socket) { -// socket.on('TEST', function (msg) { -// console.info(msg); -// }); -// return () => { -// socket.off("TEST"); -// } -// } - -// }, [socket]) - - return ( - -
-

STYLE EXAMPLE

-
- {/* - } - > - - */} -
- ) -} - -function mapStateToProps (state) { - const { auth, global, members, webSocket } = state; - return { - // loading: members.isRequesting, - // user: auth.user, - // actions: global.actions, - // members: members.data, - // socket: webSocket.socket - }; -} - -export default connect(mapStateToProps)(Example); diff --git a/web/client/src/sections/example1/containers/index.js b/web/client/src/sections/example1/containers/index.js deleted file mode 100644 index 19e6695..0000000 --- a/web/client/src/sections/example1/containers/index.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -import Example from './example'; - -export { Example }; \ No newline at end of file diff --git a/web/client/src/sections/example1/nav-item.jsx b/web/client/src/sections/example1/nav-item.jsx deleted file mode 100644 index e48fafb..0000000 --- a/web/client/src/sections/example1/nav-item.jsx +++ /dev/null @@ -1,33 +0,0 @@ -import React from 'react'; -import { IconCode } from '@douyinfe/semi-icons'; - -export function getNavItem (user, dispatch) { - return ( - [ - { - itemKey: 'example1', - text: '举个栗子1', - icon: , - items: [ - { - itemKey: 'e3', - text: '举个棒子3', - icon: , - to: '/example/e3/c3', - items: [{ - itemKey: 'c3', to: '/example/e3/c3', text: '举个锤子3' - }] - }, { - itemKey: 'e4', - text: '举个棒子4', - icon: , - to: '/example/e4/c4', - items: [{ - itemKey: 'c4', to: '/example/e4/c4', text: '举个锤子4' - }] - }, - ] - }, - ] - ); -} \ No newline at end of file diff --git a/web/client/src/sections/example1/routes.js b/web/client/src/sections/example1/routes.js deleted file mode 100644 index bbf2f1a..0000000 --- a/web/client/src/sections/example1/routes.js +++ /dev/null @@ -1,35 +0,0 @@ -'use strict'; -import { Example, } from './containers'; - -export default [{ - type: 'inner', - route: { - path: '/example1', - key: 'example1', - breadcrumb: '栗子1', - // 不设置 component 则面包屑禁止跳转 - childRoutes: [{ - path: '/e3', - key: 'e3', - // component: Example, - breadcrumb: '棒子3', - childRoutes:[{ - path: '/c3', - key: 'c3', - component: Example, - breadcrumb: '锤子3', - }] - },{ - path: '/e4', - key: 'e4', - // component: Example, - breadcrumb: '棒子4', - childRoutes:[{ - path: '/c4', - key: 'c4', - component: Example, - breadcrumb: '锤子4', - }] - }] - } -}]; \ No newline at end of file diff --git a/web/client/src/sections/example1/style.less b/web/client/src/sections/example1/style.less deleted file mode 100644 index 75ecdb6..0000000 --- a/web/client/src/sections/example1/style.less +++ /dev/null @@ -1,7 +0,0 @@ -#example { - box-shadow: 3px 3px 2px black; -} - -#example:hover { - color: yellowgreen; -} \ No newline at end of file diff --git a/web/client/src/sections/install/actions/index.js b/web/client/src/sections/install/actions/index.js new file mode 100644 index 0000000..932eed2 --- /dev/null +++ b/web/client/src/sections/install/actions/index.js @@ -0,0 +1,7 @@ +'use strict'; + +import * as roles from './roles' + +export default { + ...roles +} \ No newline at end of file diff --git a/web/client/src/sections/install/actions/roles.js b/web/client/src/sections/install/actions/roles.js new file mode 100644 index 0000000..91d559a --- /dev/null +++ b/web/client/src/sections/install/actions/roles.js @@ -0,0 +1,43 @@ +'use strict'; + +import { ApiTable, basicAction } from '$utils' + +export function getOrganizationDeps (query) {//获取项企(PEP)全部部门及其下用户 + return (dispatch) => basicAction({ + type: "get", + dispatch: dispatch, + actionType: "GET_ORGANIZATIONDEPS", + query: query, + url: `${ApiTable.getOrganizationDeps}`, + msg: { option: "获取项企(PEP)全部部门及其下用户" }, + reducer: { name: "OrganizationDeps", params: { noClear: true } }, + }); +} + +export function getOrganizationUser (query) {//获取成员列表 + return (dispatch) => basicAction({ + type: "get", + dispatch: dispatch, + actionType: "GET_ORGANIZATIONUSER", + query: query, + url: `${ApiTable.getOrganizationUser}`, + msg: { option: "获取成员列表" }, + reducer: { name: "OrganizationUser", params: { noClear: true } }, + }); +} +export function putOrganizationUser(data) {//更新成员状态 + let pomsUserId='' + if(data){ + pomsUserId = data.pomsUserId + } + return (dispatch) => + basicAction({ + type: "put", + dispatch: dispatch, + data, + actionType: "PUT_ORGANIZATIONUSER", + url: `${ApiTable.putOrganizationUser.replace("{pomsUserId}", pomsUserId)}`, + msg: { option: "更新成员状态" }, //更新成员状态 + reducer: {}, + }); + } diff --git a/web/client/src/sections/install/components/adminModal.jsx b/web/client/src/sections/install/components/adminModal.jsx new file mode 100644 index 0000000..b788c8c --- /dev/null +++ b/web/client/src/sections/install/components/adminModal.jsx @@ -0,0 +1,61 @@ +import React, { useState, useRef, useEffect } from "react"; +import { connect } from "react-redux"; +import { Modal, Spin,Input } from "@douyinfe/semi-ui"; + +function remarksModal (props) { + const { + close, + visible, + dispatch, + actions, + } = props; + const { equipmentWarehouse } = actions; + //初始化 + useEffect(() => { + + }, []); + + function handleOk () { + //点击弹框确定 右边按钮 + // dispatch( + // equipmentWarehouse.postCameraRemark({ + // cameraId:rowId, + // remark:showScrollList + // }) + // ).then((res) => { + // close(); + // }) + } + function handleCancel () { + close(); + //点击弹框取消 左边按钮 + } + return ( + <> + +
+ +
+
+ + ); +} +function mapStateToProps (state) { + const { auth, global, members } = state; + return { + // loading: members.isRequesting, + user: auth.user, + actions: global.actions, + // members: members.data, + }; +} + +export default connect(mapStateToProps)(remarksModal); diff --git a/web/client/src/sections/install/containers/index.js b/web/client/src/sections/install/containers/index.js new file mode 100644 index 0000000..6f93c06 --- /dev/null +++ b/web/client/src/sections/install/containers/index.js @@ -0,0 +1,5 @@ +'use strict'; + +import Roles from './roles'; +import System from './system'; +export { Roles,System }; \ No newline at end of file diff --git a/web/client/src/sections/install/containers/roles.jsx b/web/client/src/sections/install/containers/roles.jsx new file mode 100644 index 0000000..5db4d4b --- /dev/null +++ b/web/client/src/sections/install/containers/roles.jsx @@ -0,0 +1,464 @@ +import React, { useEffect, useState, useRef } from 'react'; +import { connect } from 'react-redux'; +import { Skeleton, Table, RadioGroup, Radio, Button, Pagination, Popconfirm, Tooltip } from '@douyinfe/semi-ui'; +import { SkeletonScreen, } from "$components"; +import AdminModal from '../components/adminModal'; +import '../style.less' + +const Roles = (props) => { + const { dispatch, actions, user, loading, socket } = props + const { install } = actions; + const [roleAssignment, setRoleAssignment] = useState([])//角色分配 + const [notCreated, setNotCreated] = useState([])//角色未分配 + const [roleChoose, setRoleChoose] = useState('')//角色选择 + const [query, setQuery] = useState({ limit: 10, page: 0 }); //页码信息 + const [adminModal, setAdminModal] = useState(false); + const [columns, setColumns] = useState([ + { + title: '成员', + render: (_, row) => { + return ( + 'text' + ) + } + }, + { + title: '项目名称', + render: (_, row) => { + return ( + 'name' + ) + } + }, + { + title: ( +
+ 数据分析师 + + + +
+ ), + render: (_, row) => { + let rolearr = row.role + return ( +
+ { + rolearr.indexOf('data_analyst') != -1 ? ( +
+
+ +
+
有权限
+
+ ) : ( +
+
+ +
+
无权限
+
+ ) + } +
+ ); + } + }, { + title: ( +
+ 售后运维 + + + +
+ ), + render: (_, row) => { + let rolearr = row.role + return ( +
+ { + rolearr.indexOf('after_sale') != -1 ? ( +
+
+ +
+
有权限
+
+ ) : ( +
+
+ +
+
无权限
+
+ ) + } +
+ ); + } + }, { + title: ( +
+ 资源管理员 + + + +
+ ), + render: (_, row) => { + let rolearr = row.role + return ( +
+ { + rolearr.indexOf('resource_manage') != -1 ? ( +
+
+ +
+
有权限
+
+ ) : ( +
+
+ +
+
无权限
+
+ ) + } +
+ ); + } + }, { + title: ( +
+ 客户服务 + + + +
+ ), + render: (_, row) => { + let rolearr = row.role + return ( +
+ { + rolearr.indexOf('customer_service') != -1 ? ( +
+
+ +
+
有权限
+
+ ) : ( +
+
+ +
+
无权限
+
+ ) + } +
+ ); + } + }, + { + title: "管理", + width: "20%", + dataIndex: "", + render: (_, row) => { + return ( +
+ {row?.disabled ? ( + + ) : ( + { + dispatch(install.putOrganizationUser({ pomsUserId: row?.id, disabled: !row?.disabled })).then(() => { + getUserList(); + }) + }} + > + + + )} + + { + dispatch(install.putOrganizationUser({ pomsUserId: row?.id, disabled: !row?.disabled })).then(() => { + if (page.current > 0 && limits.current < 2) { + setQuery({ limit: 10, page: page.current - 1 }) + } else { + setQuery({ limit: 10, page: page.current }) + } + }) + }} + > + + +
+ ); + }, + }, + ]) + const [data, setdata] = useState([]) + const page = useRef(query.page); + const limits = useRef(); //每页实际条数 + useEffect(() => { + getUserList(); + }, [query, roleChoose]); + useEffect(() => { + dispatch(install.getOrganizationDeps()).then((res)=>{//获取项企(PEP)全部部门及其下用户 + console.log('resresres',res.payload.data); + }) + getUserList() + }, []) + function getUserList () { + let searchData = { ...query, role: roleChoose } + dispatch(install.getOrganizationUser(searchData)).then((res) => {//获取成员列表 + setdata(res.payload.data.users.rows); + setRoleAssignment(res.payload.data.admin) + let notCreatedArr = [] + let notCreatedNum = 5 - res.payload.data.admin.length + for (let i = 0; i < notCreatedNum; i++) { + notCreatedArr.push('') + } + setNotCreated(notCreatedArr) + limits.current = res.payload.data.users.count + }) + } + function handleRow (record, index) {//斑马条纹 + // 给偶数行设置斑马纹 + if (index % 2 === 0) { + return { + style: { + background: '#FAFCFF', + } + }; + } else { + return {}; + } + } + function roleOnChange (e) {//角色选择 + setRoleChoose(e.target.value); + } + return ( + <> +
+
+
+
管理员设置
+
ADMINISTRATOR SETTING
+
+
+
+ { + roleAssignment.map((item, index) => { + return ( +
+
+ {'系统管理员0' + (index + 1)} +
+
+
+
+
行业服务部-刘昊然
+
+ +
+
+ +
+
+
角色说明:拥有全平台的权限
+
+
+ +
+
+
+ ) + }) + } + { + notCreated.map((item, index) => { + return ( + //
+ //
+ // + //
+ //
+ // 添加新的管理员 + //
+ //
+
+
+ {'系统管理员0' + (index + 1)} +
+
+
+
+
虚席以待
+
{setAdminModal(true)}}> + +
+
+
角色说明:拥有全平台的权限
+
+
+ +
+
+
+ ) + }) + } +
+
+
+
+
+
+
成员管理
+
MANAGEMENT OF MEMBERS
+
+
+
平台有4种类型的成员角色,分别是数据分析师、售后运维、资源管理者和客户服务,每名项目成员可拥有多种成员角色;
+
+
+ + 全部 + 数据分析师 + 售后运维 + 资源管理者 + 客户服务 + +
+
+ +
+
+
+ + + +
+ + 共{limits.current}条信息 + + { + setQuery({ limit: pageSize, page: currentPage - 1 }); + page.current = currentPage - 1 + }} + /> +
+ + { + adminModal ? + { + setAdminModal(false); + // equipmentGetCamera(); + }} > + : '' + } + + ) +} + +function mapStateToProps (state) { + const { auth, global, members } = state; + return { + // loading: members.isRequesting, + user: auth.user, + actions: global.actions, + // members: members.data, + }; +} +export default connect(mapStateToProps)(Roles); diff --git a/web/client/src/sections/install/containers/system.jsx b/web/client/src/sections/install/containers/system.jsx new file mode 100644 index 0000000..fc6618b --- /dev/null +++ b/web/client/src/sections/install/containers/system.jsx @@ -0,0 +1,34 @@ +import React, { useEffect } from 'react'; +import { connect } from 'react-redux'; +import { Spin, Card } from '@douyinfe/semi-ui'; +import '../style.less' + +const Example = (props) => { + const { dispatch, actions, user, loading, socket } = props + + useEffect(() => { + // dispatch(actions.example.getMembers(user.orgId)) + }, []) + + + return ( + <> +
+ 2222222222222 +
+ + ) +} + +function mapStateToProps (state) { + const { auth, global, members, webSocket } = state; + return { + // loading: members.isRequesting, + // user: auth.user, + // actions: global.actions, + // members: members.data, + // socket: webSocket.socket + }; +} + +export default connect(mapStateToProps)(Example); diff --git a/web/client/src/sections/example1/index.js b/web/client/src/sections/install/index.js similarity index 84% rename from web/client/src/sections/example1/index.js rename to web/client/src/sections/install/index.js index 92c4b45..37a6cb2 100644 --- a/web/client/src/sections/example1/index.js +++ b/web/client/src/sections/install/index.js @@ -6,8 +6,8 @@ import actions from './actions'; import { getNavItem } from './nav-item'; export default { - key: 'example', - name: '书写示例', + key: 'install', + name: '设置', reducers: reducers, routes: routes, actions: actions, diff --git a/web/client/src/sections/install/nav-item.jsx b/web/client/src/sections/install/nav-item.jsx new file mode 100644 index 0000000..fc55919 --- /dev/null +++ b/web/client/src/sections/install/nav-item.jsx @@ -0,0 +1,33 @@ +import React from 'react'; +import { IconCode } from '@douyinfe/semi-icons'; + +export function getNavItem (user, dispatch) { + return ( + [ + { + itemKey: 'install', + text: '设置', + icon: , + items: [ + { + itemKey: 'authentication', + text: '鉴权管理', + icon: , + to: '/install/authentication/roles', + items: [{ + itemKey: 'roles', to: '/install/authentication/roles', text: '人员及角色' + }] + }, { + itemKey: 'mapping', + text: '关系映射', + icon: , + to: '/install/mapping/system', + items: [{ + itemKey: 'system', to: '/install/mapping/system', text: '系统映射' + }] + }, + ] + }, + ] + ); +} \ No newline at end of file diff --git a/web/client/src/sections/example1/reducers/index.js b/web/client/src/sections/install/reducers/index.js similarity index 100% rename from web/client/src/sections/example1/reducers/index.js rename to web/client/src/sections/install/reducers/index.js diff --git a/web/client/src/sections/install/routes.js b/web/client/src/sections/install/routes.js new file mode 100644 index 0000000..f596dcc --- /dev/null +++ b/web/client/src/sections/install/routes.js @@ -0,0 +1,33 @@ +'use strict'; +import { Roles,System } from './containers'; + +export default [{ + type: 'inner', + route: { + path: '/install', + key: 'install', + breadcrumb: '设置', + // 不设置 component 则面包屑禁止跳转 + childRoutes: [{ + path: '/authentication', + key: 'authentication', + breadcrumb: '鉴权管理', + childRoutes:[{ + path: '/roles', + key: 'roles', + component: Roles, + breadcrumb: '人员及角色', + }] + },{ + path: '/mapping', + key: 'mapping', + breadcrumb: '关系映射', + childRoutes:[{ + path: '/system', + key: 'system', + component: System, + breadcrumb: '系统映射', + }] + }] + } +}]; \ No newline at end of file diff --git a/web/client/src/sections/install/style.less b/web/client/src/sections/install/style.less new file mode 100644 index 0000000..3c0376c --- /dev/null +++ b/web/client/src/sections/install/style.less @@ -0,0 +1,16 @@ +.roleRadio{ + .semi-radio{ + margin-right: 40px; + font-size: 13px; + } +} +.roleBottom{ + .semi-table{ + .semi-table-row:first-child{ + .semi-table-row-head{ + background: #F2F3F5; + color: #4A4A4A; + } + } + } +} diff --git a/web/client/src/utils/webapi.js b/web/client/src/utils/webapi.js index f7969d1..683f344 100644 --- a/web/client/src/utils/webapi.js +++ b/web/client/src/utils/webapi.js @@ -15,6 +15,10 @@ export { export const ApiTable = { login: "login", logout: "logout", + + getOrganizationDeps:'organization/deps',//获取项企(PEP)全部部门及其下用户 + getOrganizationUser:'organization/user',//获取成员列表 + putOrganizationUser:'organization/user/{pomsUserId}',//更新成员状态 }; export const RouteTable = { apiRoot: "/api/root",