After Width: | Height: | Size: 21 KiB |
After Width: | Height: | Size: 27 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 619 B |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 24 KiB |
After Width: | Height: | Size: 25 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 2.6 KiB |
After Width: | Height: | Size: 694 B |
After Width: | Height: | Size: 924 B |
@ -1,5 +1,6 @@ |
|||||
'use strict'; |
'use strict'; |
||||
|
|
||||
import Console from './console'; |
import Console from './console'; |
||||
|
import UserCenter from './userCenter'; |
||||
|
|
||||
export { Console }; |
export { Console, UserCenter }; |
@ -0,0 +1,82 @@ |
|||||
|
import React, { useEffect, useState } from 'react'; |
||||
|
import { connect } from 'react-redux'; |
||||
|
import { Avatar, Card, Button } from '@douyinfe/semi-ui'; |
||||
|
import { push } from 'react-router-redux'; |
||||
|
import '../style.less' |
||||
|
import PerfectScrollbar from "perfect-scrollbar"; |
||||
|
const { Meta } = Card; |
||||
|
|
||||
|
const UserCenter = (props) => { |
||||
|
const { dispatch, actions, user, loading, socket } = props |
||||
|
useEffect(() => { |
||||
|
console.log('user',user); |
||||
|
// ACTION 示例 |
||||
|
// dispatch(actions.example.getMembers(user.orgId)) |
||||
|
}, []) |
||||
|
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 ( |
||||
|
<> |
||||
|
<div style={{ padding: '0px 40px' }}> |
||||
|
{/* 头部 */} |
||||
|
<div style={{ margin: '4px 0px 14px', display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}> |
||||
|
<div style={{ display: 'flex', alignItems: 'center' }}> |
||||
|
<div style={{ color: '#4A4A4A', fontSize: 14 }}> |
||||
|
HI,欢迎回来,行业服务部 |
||||
|
</div> |
||||
|
<div style={{ fontFamily: 'YouSheBiaoTiHei', fontSize: 20, color: '#005ABD', marginLeft: 4 }}> |
||||
|
刘昊然! |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
{/* 主体 */} |
||||
|
<div style={{ background: '#FFFFFF', boxShadow: '0px 0px 12px 2px rgba(220,222,224,0.2)', borderRadius: 2, paddingTop: 20, paddingLeft: 24 }}> |
||||
|
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}> |
||||
|
<div style={{ display: 'flex', alignItems: 'center' }}> |
||||
|
<div style={{ width: 0, height: 20, borderLeft: '3px solid #005ABD', borderTop: '3px solid transparent', borderBottom: '3px solid transparent' }}></div> |
||||
|
<div style={{ fontFamily: "YouSheBiaoTiHei", fontSize: 24, color: '#101531', marginLeft: 8 }}>用户中心</div> |
||||
|
<div style={{ marginLeft: 6, fontSize: 12, color: '#969799', fontFamily: "DINExp", }}>USER CENTER</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div style={{ marginTop: 42,marginLeft:70 }}> |
||||
|
<Avatar size="large" style={{ margin: 4,cursor:'default' }} color="light-blue" alt='User'> |
||||
|
{user.name.split('')[0]} |
||||
|
</Avatar> |
||||
|
</div> |
||||
|
</div> |
||||
|
{/* moment(row.createTime).format("YYYY-MM-DD HH:mm:ss") */} |
||||
|
</div> |
||||
|
</> |
||||
|
) |
||||
|
} |
||||
|
|
||||
|
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)(UserCenter); |
@ -1,7 +1,18 @@ |
|||||
#example { |
.even{ |
||||
box-shadow: 3px 3px 2px black; |
.semi-timeline-item-head-default{ |
||||
|
background-color: #005ABD; |
||||
|
} |
||||
} |
} |
||||
|
.odd{ |
||||
#example:hover { |
.semi-timeline-item-head-default{ |
||||
color: yellowgreen; |
background-color: #FFFFFF; |
||||
|
border: 1px solid #A4CFFF; |
||||
|
} |
||||
|
} |
||||
|
.semi-timeline-item-content-time{ |
||||
|
font-size: 14px; |
||||
|
} |
||||
|
.semi-timeline-item-content{ |
||||
|
font-size: 12px; |
||||
|
width: calc(59% - 14px) !important; |
||||
} |
} |
@ -0,0 +1,14 @@ |
|||||
|
'use strict'; |
||||
|
|
||||
|
import { ApiTable, basicAction } from '$utils' |
||||
|
|
||||
|
export function getPush () { //获取推送配置列表 |
||||
|
return dispatch => basicAction({ |
||||
|
type: 'get', |
||||
|
dispatch: dispatch, |
||||
|
actionType: 'GET_PUSH', |
||||
|
url: `${ApiTable.getPush}`, |
||||
|
msg: { error: '获取推送配置列表失败' }, |
||||
|
reducer: { name: '' } |
||||
|
}); |
||||
|
} |
@ -1,2 +1,7 @@ |
|||||
'use strict'; |
'use strict'; |
||||
|
|
||||
|
import * as emPush from './emPush' |
||||
|
|
||||
|
export default { |
||||
|
...emPush |
||||
|
} |
@ -0,0 +1,171 @@ |
|||||
|
import React, { useState, useRef, useEffect } from "react"; |
||||
|
import { connect } from "react-redux"; |
||||
|
import { Modal, Form } from "@douyinfe/semi-ui"; |
||||
|
import { IconAlertCircle } from '@douyinfe/semi-icons'; |
||||
|
|
||||
|
|
||||
|
function pushModal (props) { |
||||
|
const { |
||||
|
close, |
||||
|
cancel, |
||||
|
visible, |
||||
|
dispatch, |
||||
|
pepList, |
||||
|
actions, |
||||
|
adminEdit,//是否是编辑 |
||||
|
editObj, |
||||
|
} = props; |
||||
|
const { install } = actions; |
||||
|
const form = useRef();//表单 |
||||
|
const [disablePeople, setDisablePeople] = useState(true); //页码信息 |
||||
|
const [peopleList, setPeopleList] = useState([]); //人员List |
||||
|
const [departmentId, setDepartmentId] = useState(); //部门id |
||||
|
const [peopleId, setPeopleId] = useState(); //人员id |
||||
|
//初始化 |
||||
|
useEffect(() => { |
||||
|
if (editObj.id) { |
||||
|
let departmentList = [] |
||||
|
for (let i = 0; i < pepList.length; i++) { |
||||
|
if (pepList[i].id == editObj.departments[0].id) { |
||||
|
departmentList = pepList[i].users |
||||
|
} |
||||
|
} |
||||
|
setPeopleList(departmentList) |
||||
|
setDepartmentId(editObj.departments[0].id) |
||||
|
setPeopleId(editObj.pepUserId) |
||||
|
setDisablePeople(false) |
||||
|
} |
||||
|
}, []); |
||||
|
|
||||
|
function handleOk () { |
||||
|
//点击弹框确定 右边按钮 |
||||
|
form.current |
||||
|
.validate() |
||||
|
.then((values) => { |
||||
|
if (adminEdit) { |
||||
|
dispatch(install.deteleOrganizationAdmin({id:editObj.id,msg:''})).then( |
||||
|
dispatch(install.postOrganizationUser({ role: ['admin'], pepUserId: values.pepUserId, msg: '修改管理员' })).then((res) => {//获取项企(PEP)全部部门及其下用户 |
||||
|
if (res.success) { |
||||
|
close(); |
||||
|
} |
||||
|
}) |
||||
|
) |
||||
|
} |
||||
|
else { |
||||
|
dispatch(install.postOrganizationUser({ role: ['admin'], pepUserId: values.pepUserId, msg: '新增管理员' })).then((res) => {//获取项企(PEP)全部部门及其下用户 |
||||
|
if (res.success) { |
||||
|
close(); |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
function handleCancel () { |
||||
|
cancel(); |
||||
|
//点击弹框取消 左边按钮 |
||||
|
} |
||||
|
return ( |
||||
|
<> |
||||
|
<Modal |
||||
|
title="管理员设置" |
||||
|
okText="确定" |
||||
|
cancelText="取消" |
||||
|
visible={visible} |
||||
|
onOk={handleOk} |
||||
|
width={607} |
||||
|
onCancel={handleCancel} |
||||
|
> |
||||
|
<div style={{ margin: "0px 25px" }}> |
||||
|
<div style={{ width: '100%', height: 32, background: '#F4F8FF', borderRadius: 2, border: '1px solid #C7E1FF', display: 'flex', alignItems: 'center' }}> |
||||
|
<div style={{ display: 'flex', alignItems: 'center', marginLeft: 12 }}><IconAlertCircle style={{ color: '#0F7EFB' }} /></div> |
||||
|
<div style={{ color: '#0F7EFB', fontSize: 12, marginLeft: 8 }}>成员成为管理员后,拥有平台所有权限和项目,成员的普通角色会被禁用。</div> |
||||
|
</div> |
||||
|
<Form |
||||
|
allowEmpty |
||||
|
labelPosition="left" |
||||
|
labelAlign="right" |
||||
|
labelWidth="90px" |
||||
|
onValueChange={(values, field) => { |
||||
|
for (var key in field) { |
||||
|
if (key == 'department') { |
||||
|
if (values.department >= 0) { |
||||
|
let departmentList = [] |
||||
|
for (let i = 0; i < pepList.length; i++) { |
||||
|
if (pepList[i].id == values.department) { |
||||
|
departmentList = pepList[i].users |
||||
|
} |
||||
|
} |
||||
|
setPeopleList(departmentList) |
||||
|
setDisablePeople(false) |
||||
|
form.current.setValue('pepUserId', undefined); |
||||
|
} |
||||
|
else { |
||||
|
setPeopleList([]) |
||||
|
setDisablePeople(true) |
||||
|
form.current.setValue('pepUserId', undefined); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
}} |
||||
|
getFormApi={(formApi) => (form.current = formApi)} |
||||
|
> |
||||
|
<div> |
||||
|
<Form.Select |
||||
|
label="选择部门:" |
||||
|
field="department" |
||||
|
placeholder="请选择部门" |
||||
|
style={{ width: 417 }} |
||||
|
rules={[{ required: true, message: "请选择部门" }]} |
||||
|
initValue={departmentId || ""} |
||||
|
showClear |
||||
|
> |
||||
|
{ |
||||
|
pepList.map((item, index) => { |
||||
|
return ( |
||||
|
<Form.Select.Option key={index} value={item.id}> |
||||
|
{item.name} |
||||
|
</Form.Select.Option> |
||||
|
) |
||||
|
}) |
||||
|
} |
||||
|
</Form.Select> |
||||
|
</div> |
||||
|
<div> |
||||
|
<Form.Select |
||||
|
label="选择人员:" |
||||
|
field="pepUserId" |
||||
|
placeholder="请选择人员" |
||||
|
style={{ width: 417 }} |
||||
|
rules={[{ required: true, message: "请选择人员" }]} |
||||
|
initValue={peopleId || ""} |
||||
|
showClear |
||||
|
disabled={disablePeople} |
||||
|
> |
||||
|
{ |
||||
|
peopleList.map((item, index) => { |
||||
|
return ( |
||||
|
<Form.Select.Option key={item.id} value={item.id}> |
||||
|
{item.name} |
||||
|
</Form.Select.Option> |
||||
|
) |
||||
|
}) |
||||
|
} |
||||
|
</Form.Select> |
||||
|
</div> |
||||
|
</Form> |
||||
|
</div> |
||||
|
</Modal> |
||||
|
</> |
||||
|
); |
||||
|
} |
||||
|
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)(pushModal); |
@ -1,34 +1,498 @@ |
|||||
import React, { useEffect } from 'react'; |
import React, { useEffect, useRef, useState } from 'react'; |
||||
import { connect } from 'react-redux'; |
import { connect } from 'react-redux'; |
||||
|
import { Skeleton, Button, Pagination, Form, Popconfirm, Table } from '@douyinfe/semi-ui'; |
||||
|
import { SkeletonScreen, } from "$components"; |
||||
|
import moment from "moment"; |
||||
|
import pushModal from '../components/pushModal' |
||||
|
import '../style.less' |
||||
|
import { Setup } from "$components"; |
||||
|
// import { set } from 'nprogress'; |
||||
|
|
||||
|
const EmPush = (props) => { |
||||
|
const form = useRef();//表单 |
||||
|
const { dispatch, actions, user, loading, socket } = props |
||||
|
const { service } = actions; |
||||
|
const [setup, setSetup] = useState(false); //表格设置是否显现 |
||||
|
const [setupp, setSetupp] = useState([]);//实际显示的表格列表 |
||||
|
const [tableSetup, setTableSetup] = useState([]); //单一表格设置信息 |
||||
|
const [query, setQuery] = useState({ limit: 10, page: 0 }); //页码信息 |
||||
|
const [limits, setLimits] = useState()//每页实际条数 |
||||
|
const mylimits = useRef(); //每页实际条数 |
||||
|
const [selected, setSelected] = useState([]) //表格被勾选项 |
||||
|
const [pushModal, setPushModal] = useState(false) //信鸽弹框 |
||||
|
const [systemEdit, setSystemEdit] = useState(false) //是否是修改 |
||||
|
const [anxincloudList, setAnxincloudList] = useState([]) //安心云列表 |
||||
|
const [peplist, setPeplist] = useState([]) //PEP项目管理项目列表 |
||||
|
const [appList, setAppList] = useState([]) //应用列表 |
||||
|
const [pepProjectId, setPepProjectId] = useState() //修改时项企id |
||||
|
const [anxincloudArr, setAnxincloudArr] = useState([]) //修改时已经选择的安心云列表 |
||||
|
const [pepname, setPepname] = useState() //修改时自定义项目名称 |
||||
|
const [anxinDelete, setAnxinDelete] = useState([]) //修改时安心云项目有删除,显示提示信息 |
||||
|
const [appArr, setAppArr] = useState([]) //修改时添加应用 |
||||
|
const [bindId, setBindId] = useState() //修改时绑定的id |
||||
|
const [tableKey, setTableKey] = useState([]) //修改时绑定的id |
||||
|
const page = useRef(query.page);//哪一页 |
||||
|
const EMPUSH = "empush"; |
||||
|
const tableList = [//表格属性 |
||||
|
{ |
||||
|
title: '推送信息', |
||||
|
list: [ |
||||
|
{ name: "策略类型", value: "pushWay" }, |
||||
|
{ name: "推送机制", value: "noticeWay" }, |
||||
|
{ name: "监听设备数量", value: "monitorCount" }, |
||||
|
{ name: "累计推送次数", value: "logCount" }, |
||||
|
] |
||||
|
}, |
||||
|
]; |
||||
|
|
||||
|
|
||||
const Server = (props) => { |
|
||||
const { dispatch, actions, user, loading, socket } = props |
|
||||
|
|
||||
useEffect(() => { |
function handleRow (record, index) {//斑马条纹 |
||||
|
// 给偶数行设置斑马纹 |
||||
|
if (index % 2 === 0) { |
||||
|
return { |
||||
|
style: { |
||||
|
background: '#FAFCFF', |
||||
|
} |
||||
|
}; |
||||
|
} else { |
||||
|
return {}; |
||||
|
} |
||||
|
} |
||||
|
|
||||
}, []) |
const [tableData, setTableData] = useState([]) //表格数据 |
||||
|
|
||||
|
useEffect(() => { |
||||
|
attribute(); |
||||
|
dispatch(service.getPush(query)).then((res) => {//获取推送配置列表 |
||||
|
console.log('res.payload.datares.payload.data',res.payload.data); |
||||
|
// setAnxincloudList(res.payload.data) |
||||
|
}) |
||||
|
// dispatch(install.getProjectPmanage(query)).then((res) => {//获取PEP项目管理项目 |
||||
|
// setPeplist(res.payload.data) |
||||
|
// }) |
||||
|
// dispatch(install.getProjectAppList(query)).then((res) => {//获取应用列表 |
||||
|
// setAppList(res.payload.data) |
||||
|
// }) |
||||
|
localStorage.getItem(EMPUSH) == null |
||||
|
? localStorage.setItem( |
||||
|
EMPUSH, |
||||
|
JSON.stringify(['pushWay','noticeWay','logCount','monitorCount']) |
||||
|
) |
||||
|
: ""; |
||||
|
}, []) |
||||
|
useEffect(() => { |
||||
|
// getProjectPomsList(); |
||||
|
}, [query]); |
||||
|
|
||||
return ( |
function getProjectPomsList () { |
||||
<> |
// dispatch(install.getProjectPoms(query)).then((res) => {//获取已绑定项目 |
||||
<div> |
// if (res.success) { |
||||
<img src="/assets/images/install/watting.png" alt="" style={{ width: 'calc(100% + 16px)', position: "relative", top: -12, left: -8, }} /> |
// let mytableData = JSON.parse(JSON.stringify(res.payload.data.rows)); |
||||
</div> |
// let mytableKey = [] |
||||
</> |
// for (let index = 0; index < mytableData.length; index++) { |
||||
) |
// mytableData[index].key = mytableData[index].id |
||||
|
// mytableKey.push(mytableData[index].id) |
||||
|
// } |
||||
|
// setTableKey(mytableKey) |
||||
|
// setTableData(mytableData) |
||||
|
// setLimits(res.payload.data.count) |
||||
|
// mylimits.current = res.payload.data.rows.length |
||||
|
// } |
||||
|
// }) |
||||
|
} |
||||
|
const [columns, setColumns] = useState([//表格属性 |
||||
|
{ |
||||
|
title: "策略编号", |
||||
|
dataIndex: "index", |
||||
|
key: 'index', |
||||
|
render: (text, r, index) => { |
||||
|
return index + 1; |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
title: '策略名称', |
||||
|
dataIndex: "pepProjectName", |
||||
|
key: 'pepProjectName', |
||||
|
render: (_, row) => { |
||||
|
return row.pepProjectName |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
title: "操作", |
||||
|
width: "20%", |
||||
|
dataIndex: "text", |
||||
|
key: 'text', |
||||
|
render: (_, row) => { |
||||
|
return ( |
||||
|
<div style={{ display: "flex" }}> |
||||
|
<Button |
||||
|
theme="borderless" |
||||
|
// disabled={row.pepProjectIsDelete == 1} |
||||
|
// onClick={() => { |
||||
|
// setPushModal(true); |
||||
|
// setPepname(row.name) |
||||
|
// if (!row.name) { |
||||
|
// setPepProjectId(row.pepProjectId) |
||||
|
// } |
||||
|
// else { |
||||
|
// setPepProjectId() |
||||
|
// } |
||||
|
// let myanxinArr = [] |
||||
|
// let anxinErrorList = [] |
||||
|
// for (let i = 0; i < row.anxinProject.length; i++) { |
||||
|
// if (row.anxinProject[i].projectState !== -1) { |
||||
|
// myanxinArr.push(row.anxinProject[i].id) |
||||
|
// } |
||||
|
// else { |
||||
|
// anxinErrorList.push(row.anxinProject[i].name) |
||||
|
// } |
||||
|
// } |
||||
|
// setAnxinDelete(anxinErrorList) |
||||
|
// let myapparr = [] |
||||
|
// let myarrarrList = JSON.parse(JSON.stringify(row.apps)) |
||||
|
// for (let j = 0; j < row.apps.length; j++) { |
||||
|
// delete myarrarrList[j].projectApp |
||||
|
// myapparr.push(JSON.stringify(myarrarrList[j])) |
||||
|
// } |
||||
|
// setAppArr(myapparr) |
||||
|
// setAnxincloudArr(myanxinArr) |
||||
|
// setBindId(row.id) |
||||
|
// setSystemEdit(true) |
||||
|
// }} |
||||
|
> |
||||
|
修改 |
||||
|
</Button> |
||||
|
<Button theme="borderless">禁用</Button> |
||||
|
<Popconfirm |
||||
|
title="删除后对应的项目全局将无法进入和显示,对应的信鸽服务也会被禁用" |
||||
|
arrowPointAtCenter={false} |
||||
|
showArrow={true} |
||||
|
position="topRight" |
||||
|
onConfirm={() => { |
||||
|
// dispatch(install.deleteProjectBind({ bindId: row?.id, msg: '删除安心云、项目管理项目绑定关系' })).then(() => { |
||||
|
// if (page.current > 0 && mylimits.current < 2) { |
||||
|
// setQuery({ limit: 10, page: page.current - 1 }) |
||||
|
// } else { |
||||
|
// setQuery({ limit: 10, page: page.current }) |
||||
|
// } |
||||
|
// }) |
||||
|
}} |
||||
|
> |
||||
|
<Button theme="borderless">删除</Button> |
||||
|
</Popconfirm> |
||||
|
</div> |
||||
|
); |
||||
|
}, |
||||
|
}, |
||||
|
]) |
||||
|
const rowSelection = { |
||||
|
selectedRowKeys: selected, |
||||
|
onChange: (selectedRowKeys, selectedRows) => { |
||||
|
setSelected(selectedRows.map(v => v.key)) |
||||
|
}, |
||||
|
} |
||||
|
//获取表格属性设置 |
||||
|
function attribute () { |
||||
|
const arr = localStorage.getItem(EMPUSH) |
||||
|
? JSON.parse(localStorage.getItem(EMPUSH)) |
||||
|
: []; |
||||
|
|
||||
|
const column = [ |
||||
|
{ |
||||
|
title: "关联项目", |
||||
|
dataIndex: "noticeWay", |
||||
|
key: "noticeWay", |
||||
|
render: (_, r, index) => { |
||||
|
return r.noticeWay; |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
title: "创建时间", |
||||
|
dataIndex: "logCount", |
||||
|
key: "logCount", |
||||
|
render: (_, r, index) => { |
||||
|
return (r.logCount + '次') |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
title: "接收人", |
||||
|
dataIndex: "monitorCount", |
||||
|
key: "monitorCount", |
||||
|
render: (_, r, index) => { |
||||
|
return r.monitorCount |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
title: "监听问题", |
||||
|
dataIndex: "pushWay", |
||||
|
key: "pushWay", |
||||
|
render: (_, r, index) => { |
||||
|
return r.pushWay=='email' ? '邮件通知' : '短信通知'; |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
title: "通知时效", |
||||
|
dataIndex: "text1", |
||||
|
key: "text1", |
||||
|
render: (_, r, index) => { |
||||
|
return r.text1 |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
title: "启用状态", |
||||
|
dataIndex: "text2", |
||||
|
key: "text2", |
||||
|
render: (_, r, index) => { |
||||
|
return r.text2 |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
title: "推送次数", |
||||
|
dataIndex: "time", |
||||
|
key: "time", |
||||
|
render: (_, r, index) => { |
||||
|
return r.time |
||||
|
}, |
||||
|
}, |
||||
|
]; |
||||
|
for (let i = 0; i < arr.length; i++) { |
||||
|
let colum = column.filter((item) => { |
||||
|
return item.key === arr[i]; |
||||
|
}); |
||||
|
columns.splice(i + 2, 0, colum[0]); |
||||
|
} |
||||
|
setSetupp(columns); |
||||
|
} |
||||
|
return ( |
||||
|
<> |
||||
|
<div style={{ background: '#FFFFFF', margin: '8px 12px', padding: '20px 20px 0px 20px' }}> |
||||
|
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}> |
||||
|
<div style={{ display: 'flex', alignItems: 'center' }}> |
||||
|
<div style={{ width: 0, height: 20, borderLeft: '3px solid #005ABD', borderTop: '3px solid transparent', borderBottom: '3px solid transparent' }}></div> |
||||
|
<div style={{ fontFamily: "YouSheBiaoTiHei", fontSize: 24, color: '#101531', marginLeft: 8 }}>EM推送</div> |
||||
|
<div style={{ marginLeft: 6, fontSize: 12, color: '#969799', fontFamily: "DINExp", }}>Em push</div> |
||||
|
</div> |
||||
|
<div style={{ marginRight: 20, display: 'flex', alignItems: 'center' }} className='empush'> |
||||
|
<Form |
||||
|
onSubmit={(values) => console.log(values)} |
||||
|
// onValueChange={values=>console.log(values)} |
||||
|
getFormApi={(formApi) => (form.current = formApi)} |
||||
|
layout="horizontal" |
||||
|
style={{ position: "relative", width: "100%", flex: 1 }} |
||||
|
> |
||||
|
<Form.Input |
||||
|
label='搜索:' |
||||
|
field='seacth' |
||||
|
maxLength="16" |
||||
|
placeholder="搜项目、结构物或推送策略名" |
||||
|
labelPosition="left" |
||||
|
style={{ width: 292, marginRight: 10, marginBottom: 16 }} |
||||
|
/> |
||||
|
<Form.Select |
||||
|
label='推送类型:' |
||||
|
labelPosition="left" |
||||
|
field='pushType' |
||||
|
style={{ width: 116, marginRight: 10, color: "#F9F9F9", }} |
||||
|
placeholder="全部" |
||||
|
filter |
||||
|
showClear |
||||
|
> |
||||
|
{/* {.map((item) => { |
||||
|
return ( |
||||
|
<Form.Select.Option key={item.value} value={item.value}> |
||||
|
{item.name} |
||||
|
</Form.Select.Option> |
||||
|
); |
||||
|
})} */} |
||||
|
</Form.Select> |
||||
|
<Form.Select |
||||
|
label='启用状态:' |
||||
|
labelPosition="left" |
||||
|
field='enableType' |
||||
|
style={{ width: 116, marginRight: 10, color: "#F9F9F9", }} |
||||
|
placeholder="全部" |
||||
|
filter |
||||
|
showClear |
||||
|
> |
||||
|
{/* {.map((item) => { |
||||
|
return ( |
||||
|
<Form.Select.Option key={item.value} value={item.value}> |
||||
|
{item.name} |
||||
|
</Form.Select.Option> |
||||
|
); |
||||
|
})} */} |
||||
|
</Form.Select> |
||||
|
</Form> |
||||
|
<Button |
||||
|
theme="solid" |
||||
|
type="primary" |
||||
|
style={{ |
||||
|
width: 80, |
||||
|
height: 32, |
||||
|
borderRadius: 2, |
||||
|
marginRight: 32, |
||||
|
background:'#FFFFFF', |
||||
|
color:'#005ABD', |
||||
|
border:'1px solid #005ABD' |
||||
|
}} |
||||
|
// onClick={() => { }} |
||||
|
> |
||||
|
查询 |
||||
|
</Button> |
||||
|
<div style={{display: 'flex', alignItems: 'center'}}> |
||||
|
<img title='设置' src="/assets/images/problem/setup.png" style={{ width: 18, height: 18, cursor: "pointer" }} onClick={() => setSetup(true)} /> |
||||
|
</div> |
||||
|
<Button |
||||
|
theme="solid" |
||||
|
type="primary" |
||||
|
style={{ |
||||
|
width: 136, |
||||
|
height: 32, |
||||
|
borderRadius: 2, |
||||
|
marginLeft: 32 |
||||
|
}} |
||||
|
onClick={() => { |
||||
|
setPushModal(true); |
||||
|
setSystemEdit(false) |
||||
|
setPepProjectId() |
||||
|
setPepname() |
||||
|
setAnxinDelete([]) |
||||
|
setAppArr([]) |
||||
|
setAnxincloudArr() |
||||
|
setBindId() |
||||
|
}} |
||||
|
> |
||||
|
添加推送策略 |
||||
|
</Button> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: 20, marginTop: 5 }}> |
||||
|
<div style={{ fontSize: 12, color: '#8B8B8B' }}>预留预留预留预留预留预留预留预留预留预留预留预留预留预留预留预留预留预留预留预留预留预留</div> |
||||
|
</div> |
||||
|
<div style={{ marginTop: 20 }}> |
||||
|
<Skeleton |
||||
|
// loading={loading} |
||||
|
loading={false} |
||||
|
active={true} |
||||
|
placeholder={SkeletonScreen()} |
||||
|
> |
||||
|
<Table |
||||
|
columns={setupp.filter((s) => s)} |
||||
|
dataSource={tableData} |
||||
|
bordered={false} |
||||
|
empty="暂无数据" |
||||
|
pagination={false} |
||||
|
onRow={handleRow} |
||||
|
rowSelection={rowSelection} |
||||
|
/> |
||||
|
</Skeleton> |
||||
|
<div |
||||
|
style={{ |
||||
|
display: "flex", |
||||
|
justifyContent: "space-between", |
||||
|
padding: "20px 20px", |
||||
|
}} |
||||
|
> |
||||
|
<div> |
||||
|
<div style={{ display: 'inline-block', lineHeight: '30px', fontSize: 13, color: 'gray' }}>勾选<span style={{ fontWeight: 400, color: '#0F7EFB', }}> {selected.length}条 </span>信息</div> |
||||
|
<Button onClick={() => { |
||||
|
if (selected.length == tableKey.length) { |
||||
|
setSelected([]) |
||||
|
} |
||||
|
else { |
||||
|
setSelected(tableKey) |
||||
|
} |
||||
|
}} style={{ fontSize: 13, width: 93, height: 24, borderRadius: '1px', background: '#FFFFFF', border: '1px solid #0F7EFB', color: '#0F7EFB', fontWeight: 400, margin: '0 10px' }}> |
||||
|
{mylimits.current == selected.length ? '取消全选' : '全选'} |
||||
|
</Button> |
||||
|
<Popconfirm |
||||
|
title="删除后对应的项目全局将无法进入和显示,对应的信鸽服务也会被禁用" |
||||
|
arrowPointAtCenter={false} |
||||
|
showArrow={true} |
||||
|
position="topRight" |
||||
|
onConfirm={() => { |
||||
|
// dispatch(install.deleteProjectBind({ bindId: selected.join(','), msg: '删除安心云、项目管理项目绑定关系' })).then(() => { |
||||
|
// if (page.current > 0 && mylimits.current == selected.length) { |
||||
|
// setQuery({ limit: 10, page: page.current - 1 }) |
||||
|
// } else { |
||||
|
// setQuery({ limit: 10, page: page.current }) |
||||
|
// } |
||||
|
// setSelected([]) |
||||
|
// }) |
||||
|
}} |
||||
|
> |
||||
|
<Button type='primary' theme='solid' style={{ fontSize: 13, width: 93, height: 24, borderRadius: '1px', border: '1px solid #0F7EFB', color: '#FFFFFF', fontWeight: 400, }}>批量删除</Button> |
||||
|
</Popconfirm> |
||||
|
</div> |
||||
|
<div style={{ display: 'flex', }}> |
||||
|
<span style={{ lineHeight: "30px", fontSize: 13, color: 'rgba(0,90,189,0.8)' }}> |
||||
|
共{limits}条信息 |
||||
|
</span> |
||||
|
<Pagination |
||||
|
className="22" |
||||
|
total={limits} |
||||
|
showSizeChanger |
||||
|
currentPage={query.page + 1} |
||||
|
pageSizeOpts={[10, 20, 30, 40]} |
||||
|
onChange={(currentPage, pageSize) => { |
||||
|
setQuery({ limit: pageSize, page: currentPage - 1 }); |
||||
|
page.current = currentPage - 1 |
||||
|
setSelected([]) |
||||
|
}} |
||||
|
/> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
{/* {//映射关系弹框 |
||||
|
pushModal ? |
||||
|
<PushModal |
||||
|
visible={true} |
||||
|
anxincloudList={anxincloudList} |
||||
|
systemEdit={systemEdit} |
||||
|
peplist={peplist} |
||||
|
appList={appList} |
||||
|
pepname={pepname} |
||||
|
anxincloudArr={anxincloudArr} |
||||
|
pepProjectId={pepProjectId} |
||||
|
anxinDelete={anxinDelete} |
||||
|
appArr={appArr} |
||||
|
bindId={bindId} |
||||
|
cancel={() => { |
||||
|
setPushModal(false); |
||||
|
}} |
||||
|
close={() => { |
||||
|
setPushModal(false); |
||||
|
getProjectPomsList() |
||||
|
}} > |
||||
|
</PushModal> : '' |
||||
|
} */} |
||||
|
{setup ? ( |
||||
|
<Setup |
||||
|
tableType={EMPUSH} |
||||
|
tableList={tableList} |
||||
|
close={() => { |
||||
|
setSetup(false); |
||||
|
attribute(); |
||||
|
// setcameraSetup(false); |
||||
|
}} |
||||
|
/> |
||||
|
) : ( |
||||
|
"" |
||||
|
)} |
||||
|
</> |
||||
|
) |
||||
} |
} |
||||
|
|
||||
function mapStateToProps (state) { |
function mapStateToProps (state) { |
||||
const { auth, global, members, webSocket } = state; |
const { auth, global, ProjectPoms } = state; |
||||
return { |
return { |
||||
// loading: members.isRequesting, |
// loading: ProjectPoms.isRequesting, |
||||
// user: auth.user, |
user: auth.user, |
||||
// actions: global.actions, |
actions: global.actions, |
||||
// members: members.data, |
// members: members.data, |
||||
// socket: webSocket.socket |
}; |
||||
}; |
|
||||
} |
} |
||||
|
|
||||
export default connect(mapStateToProps)(Server); |
export default connect(mapStateToProps)(EmPush); |
||||
|
@ -1,7 +1,5 @@ |
|||||
#example { |
.empush{ |
||||
box-shadow: 3px 3px 2px black; |
.semi-input-wrapper{ |
||||
} |
margin-bottom: 0px !important; |
||||
|
} |
||||
#example:hover { |
|
||||
color: yellowgreen; |
|
||||
} |
} |