Commit 7948067a authored by mayongxin's avatar mayongxin

perf:新增消息方案管理

parent 98495357
Pipeline #25320 skipped with stages
import React,{Component} from 'react'
class RoleSelect extends Component {
state = {
}
render(){
return(
<div>
<div>选择角色</div>
</div>
)
}
}
export default RoleSelect;
\ No newline at end of file
...@@ -17,12 +17,12 @@ const HostManager = () => { ...@@ -17,12 +17,12 @@ const HostManager = () => {
return ( return (
<PageContainer> <PageContainer>
<Tabs onChange={callback} type="card"> <Tabs onChange={callback} type="card">
<TabPane tab="推送模板配置" key="1">
<TemplateManage/>
</TabPane>
<TabPane tab="推送方案配置" key="2"> <TabPane tab="推送方案配置" key="2">
<ProjectManage/> <ProjectManage/>
</TabPane> </TabPane>
<TabPane tab="推送模板配置" key="1">
<TemplateManage/>
</TabPane>
</Tabs> </Tabs>
</PageContainer> </PageContainer>
) )
......
import React, { useState } from 'react' import React, { useEffect, useState } from 'react'
import { import {
// Tree, // Tree,
Table, Table,
...@@ -13,7 +13,8 @@ import { PlusCircleOutlined } from '@ant-design/icons'; ...@@ -13,7 +13,8 @@ import { PlusCircleOutlined } from '@ant-design/icons';
const { Search } = Input; const { Search } = Input;
const { Option } = Select; const { Option } = Select;
import EditModal from './components/EditModal' import EditModal from './components/EditModal'
import VisibleRoleModal from './components/VisibleRoleModal' import VisibleRoleModal from './components/RolseSelect/VisibleRoleModal'
import { GetMessageConfigList, UpdateMessageConfig, InsertMessageConfig, DeleteMessageConfig } from '@/services/platform/messagemanage'
import styles from './ProjectManage.less' import styles from './ProjectManage.less'
const ProjectManage = () => { const ProjectManage = () => {
...@@ -27,6 +28,10 @@ const ProjectManage = () => { ...@@ -27,6 +28,10 @@ const ProjectManage = () => {
checkBoxLoading: false, checkBoxLoading: false,
}); });
const [currentTemplate, setCurrentTempalte] = useState({}); const [currentTemplate, setCurrentTempalte] = useState({});
const [flag, setFlag] = useState(0)
const [pageIndex,setPageIndex] = useState(0)
const [pageSize,setPageSize] = useState(10)
const [dataList,setDataList] = useState([])
const columns = [ const columns = [
{ {
title: '方案名称', title: '方案名称',
...@@ -80,7 +85,7 @@ const ProjectManage = () => { ...@@ -80,7 +85,7 @@ const ProjectManage = () => {
> >
编辑 编辑
</Button> </Button>
<div onClick={e => e.stopPropagation()}> <div onClick={e => e.stopPropagation()}>
<Popconfirm <Popconfirm
title="是否删除该连接的历史记录?" title="是否删除该连接的历史记录?"
...@@ -234,12 +239,35 @@ const ProjectManage = () => { ...@@ -234,12 +239,35 @@ const ProjectManage = () => {
} }
useEffect(() => {
GetMessageConfigList({
pageIndex:pageIndex,
pageSize:10,
}).then(
res => {
let mesList = []
if(res.code === 0){
res.MessageConfigModels.map((item)=>{
mesList.push({
name:item.ThemeName,
type:item.MesType,
send_pattern:item.PushMode,
receive_person:item.Pusher,
is_use:item.IsStarted
})
})
setDataList(mesList)
}
}
)
}, [flag])
return ( return (
<div className={styles.project_container}> <div className={styles.project_container}>
<div className={styles.operate_bar}> <div className={styles.operate_bar}>
<div className={styles.template_type}> <div className={styles.template_type}>
<div className={styles.title}>方案类型</div> <div className={styles.title}>方案类型</div>
<Select placeholder="请选择方案类型!" defaultValue="0" style={{width:"150px"}}> <Select placeholder="请选择方案类型!" defaultValue="0" style={{ width: "150px" }}>
<Option value="0">全部</Option> <Option value="0">全部</Option>
<Option value="1">监控报警</Option> <Option value="1">监控报警</Option>
<Option value="2">工单办理</Option> <Option value="2">工单办理</Option>
...@@ -249,7 +277,7 @@ const ProjectManage = () => { ...@@ -249,7 +277,7 @@ const ProjectManage = () => {
</div> </div>
<div className={styles.template_type}> <div className={styles.template_type}>
<div className={styles.title}>方案名称</div> <div className={styles.title}>方案名称</div>
<Select placeholder="请选择方案名称!" defaultValue="0" style={{width:"150px"}}> <Select placeholder="请选择方案名称!" defaultValue="0" style={{ width: "150px" }}>
<Option value="0">全部</Option> <Option value="0">全部</Option>
<Option value="1">GCK简报</Option> <Option value="1">GCK简报</Option>
<Option value="2">GCK运行日报</Option> <Option value="2">GCK运行日报</Option>
......
.editModal_container{
height: 600px;
overflow-y: scroll;
display: flex;
flex-direction: column;
.push_trench{
width: 100%;
height: fit-content;
display: flex;
flex-direction:row;
flex-wrap: wrap;
.trench_card{
width: 500px;
margin: 20px;
border-width: 1px;
border-color: #EEEEEE;
border-style: solid;
border-radius: 5px;
display: flex;
flex-direction: column;
justify-content: space-around;
align-items: center;
.card_title{
border-bottom-style: solid;
border-bottom-width: 1px;
border-bottom-color:#F6F7F9;
height:50px;
width: 100%;
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: center;
.lable{
font-size: large;
margin-left: 10px;
}
}
.card_body{
margin-top: 10px;
width: 100%;
padding: 10px;
}
}
}
}
\ No newline at end of file
import React, { useEffect, useState } from 'react'
import { Radio, Checkbox, Row, Col } from 'antd'
const DayOfWeekSelect = props => {
const [selectValues, setSelectValues] = useState([])
const {onChange} = props
const hours = [
{ name: "星期一", value: '1' },
{ name: "星期二", value: '2' },
{ name: "星期三", value: '3' },
{ name: "星期四", value: '4' },
{ name: "星期五", value: '5' },
{ name: "星期六", value: '6' },
{ name: "星期天", value: '7' },
]
const onTypeChange = e => {
let values = []
switch (e.target.value) {
case 0:
values = ["1","2","3","4","5","6","7"]
break
case 1:
values = []
break
case 2:
values = ["1","2","3","4","5"]
break
case 3:
values = ["6","7"]
break
}
setSelectValues(values)
onChange&&onChange(values)
}
const onCheckChange = (value)=>{
setSelectValues(value)
onChange&&onChange(values)
}
return (
<div >
<Radio.Group onChange={onTypeChange}>
<Radio value={0}>全选</Radio>
<Radio value={1}>反选</Radio>
<Radio value={2}>工作日</Radio>
<Radio value={3}>周末</Radio>
</Radio.Group>
<Checkbox.Group value={selectValues} onChange={onCheckChange}>
<Row>
{
hours.map((item, idx) => {
return (
<Col span={4}>
<Checkbox value={item.value}>{item.name}</Checkbox>
</Col>
)
})
}
</Row>
</Checkbox.Group>
</div>
)
}
export default DayOfWeekSelect;
\ No newline at end of file
import React, { useEffect, useState } from 'react'
import { Radio, Checkbox, Row, Col } from 'antd'
import styles from './HourOfDaySelect.less'
const HourOfDaySelect = props => {
const [selectValues, setSelectValues] = useState([])
const {onChange} = props
const hours = [
{ name: "0:00", value: '0' },
{ name: "1:00", value: '1' },
{ name: "2:00", value: '2' },
{ name: "3:00", value: '3' },
{ name: "4:00", value: '4' },
{ name: "5:00", value: '5' },
{ name: "6:00", value: '6' },
{ name: "7:00", value: '7' },
{ name: "8:00", value: '8' },
{ name: "9:00", value: '9' },
{ name: "10:00", value: '10' },
{ name: "11:00", value: '11' },
{ name: "12:00", value: '12' },
{ name: "13:00", value: '13' },
{ name: "14:00", value: '14' },
{ name: "15:00", value: '15' },
{ name: "16:00", value: '16' },
{ name: "17:00", value: '17' },
{ name: "18:00", value: '18' },
{ name: "19:00", value: '19' },
{ name: "20:00", value: '20' },
{ name: "21:00", value: '21' },
{ name: "22:00", value: '22' },
{ name: "23:00", value: '23' },
]
const onTypeChange = e => {
let values = []
switch (e.target.value) {
case 0:
values = ["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23",]
case 1:
values = []
case 2:
values = ["6","8"]
case 3:
values = ["0","8","16"]
case 4:
values = ["0","6","12","18"]
}
onChange&&onChange(value)
}
const onCheckChange = (value)=>{
setSelectValues(value)
onChange&&onChange(value)
}
return (
<div className={styles.hourOfDay_container}>
<Radio.Group onChange={onTypeChange}>
<Radio value={0}>全选</Radio>
<Radio value={1}>反选</Radio>
<Radio value={2}>一天两次</Radio>
<Radio value={3}>一天三次</Radio>
<Radio value={4}>一天四次</Radio>
</Radio.Group>
<Checkbox.Group value={selectValues} onChange={onCheckChange}>
<Row>
{
hours.map((item, idx) => {
return (
<Col span={4}>
<Checkbox value={item.value}>{item.name}</Checkbox>
</Col>
)
})
}
</Row>
</Checkbox.Group>
</div>
)
}
export default HourOfDaySelect;
\ No newline at end of file
.hourOfDay_container{
display: flex;
flex-direction: column;
}
\ No newline at end of file
import React, { useEffect, useState } from 'react'
import SiteModal from '@/components/Modal/SiteModa';
import { Checkbox, Input, Button, Modal, Form, Radio, DatePicker, Switch } from 'antd'
import HourOfDaySelect from './HourOfDaySelect'
import DayOfWeekSelect from './DayOfWeekSelect'
import styles from './VisibleIISAgentConfig.less'
const { Item } = Form;
const VisibleIISAgentConfig = props => {
const [loading, setLoading] = useState(false);
const [previewVisible, setPreviewVisible] = useState(false)
const [selectRole, setSelectRole] = useState([])
const [isReentrant,setIsReentrant] = useState(false)
const [form] = Form.useForm();
const onSubmit = () => {
}
const handleCancel = () => {
setPreviewVisible(false)
}
const handleOk = () => {
setPreviewVisible(false)
}
const handleClick = () => {
setPreviewVisible(true)
}
const onPostChange = (value) => {
setIsReentrant(value)
}
return (
<div>
<div onClick={handleClick}>选择推送组</div>
<div>{selectRole}</div>
<SiteModal
{...props}
title="编辑定时任务"
bodyStyle={{ width: '100%', minHeight: '100px' }}
style={{ top: 200, borderRadius: '20px' }}
width="800px"
destroyOnClose
cancelText="取消"
okText="确认"
onOk={() => handleOk()}
confirmLoading={loading}
visible={previewVisible}
onCancel={handleCancel}
>
<div className={styles.IISAgent_container}>
<Form form={form} labelCol={{ span: 4 }}>
<Item
label="计划名称"
name="name"
>
<Input placeholder="请输入计划名称" />
</Item>
<Item
label="路径类型"
name="url_type"
>
<Radio.Group value={false}>
<Radio value={false}>相对路径</Radio>
<Radio value={true}>绝对路径</Radio>
</Radio.Group>
</Item>
<Item
label="URL路径"
name="url_path"
>
<Input placeholder="请输入URL名称" />
</Item>
<Item
label="请求头"
name="request_header"
>
<Input placeholder="请输入URL名称" />
</Item>
<Item
label="计划类型"
name="plan_type"
>
<Radio.Group value={1} buttonStyle='outline'>
<Radio value={1}>重复执行</Radio>
<Radio value={0}>执行一次</Radio>
</Radio.Group>
</Item>
<Item
label="开始时间"
name="start_time"
>
<DatePicker showTime />
</Item>
<Item
label="结束时间"
name="end_time"
>
<DatePicker showTime />
</Item>
<Item
label="执行方式"
name="loopMode"
>
<Radio.Group value={false}>
<Radio value={0}>循环</Radio>
<Radio value={1}>每天</Radio>
<Radio value={2}>每周</Radio>
</Radio.Group>
</Item>
<Item
label="循环周期"
name="interval"
>
<Input placeholder="请输入循环周期" />
</Item>
<Item
label="循环单位"
name="loop_unit"
>
<Input placeholder="请输入循环单位" />
</Item>
<Item
label="日循环"
name="hour_of_day"
>
<HourOfDaySelect />
</Item>
<Item
label="周循环"
name="day_of_week"
>
<DayOfWeekSelect />
</Item>
<Item
label="超时时间"
name="time_out"
>
<Input />
</Item>
<Item
label="POST状态"
name="post_state"
>
<Switch checkedChildren="开启" unCheckedChildren="关闭" onChange={onPostChange} />
</Item>
<Item
label="允许并发"
name="reentrant"
>
<Switch checkedChildren="开启" unCheckedChildren="关闭" disabled={isReentrant}/>
</Item>
<Item
label="开启日志"
name="enable_log"
>
<Switch checkedChildren="开启" unCheckedChildren="关闭" />
</Item>
</Form>
</div>
</SiteModal>
</div>
)
}
export default VisibleIISAgentConfig;
\ No newline at end of file
.IISAgent_container{
overflow-y: scroll;
height: 500px;
}
\ No newline at end of file
...@@ -3,18 +3,17 @@ export const data = ...@@ -3,18 +3,17 @@ export const data =
{ {
id: '1', id: '1',
name: "CS", name: "CS",
isChecked:true,
children: [ children: [
{ {
id: '2', id: '2',
name: "cs管理员", name: "cs管理员",
isChecked:true, isChecked:false,
children:[] children:[]
}, },
{ {
id: '3', id: '3',
name: "cs管理员1", name: "cs管理员1",
isChecked:true, isChecked:false,
children:[] children:[]
}, },
] ]
...@@ -37,5 +36,24 @@ export const data = ...@@ -37,5 +36,24 @@ export const data =
}, },
] ]
} }
,
{
id: '7',
name: "AS",
children: [
{
id: '8',
name: "as管理员",
isChecked:false,
children:[]
},
{
id: '9',
name: "as管理员1",
isChecked:false,
children:[]
},
]
}
] ]
import React, { useEffect, useState } from 'react' import React, { useEffect, useState } from 'react'
import SiteModal from '@/components/Modal/SiteModa'; import SiteModal from '@/components/Modal/SiteModa';
import { Checkbox, Input, Button } from 'antd' import { Checkbox, Input, Button, Modal } from 'antd'
import { data } from './Mock' import { data } from '../Mock'
import _ from 'lodash'; import _ from 'lodash';
import classnames from 'classnames'; import classnames from 'classnames';
import styles from './VisibleRoleModal.less' import styles from './VisibleRoleModal.less'
import { ManOutlined } from '@ant-design/icons';
const checkIsGroup = node => const checkIsGroup = node =>
...@@ -16,25 +17,50 @@ const VisibleRoleModal = props => { ...@@ -16,25 +17,50 @@ const VisibleRoleModal = props => {
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
const [previewVisible, setPreviewVisible] = useState(false)
const onSubmit = () => { } const [selectRole,setSelectRole] = useState([])
const onSubmit = () => {
}
const handleCancel = () => {
setPreviewVisible(false)
}
const handleOk = () => {
setPreviewVisible(false)
}
const handleClick = () => {
setPreviewVisible(true)
}
const onChange2 = (value)=>{
console.log(value)
setSelectRole(value.toString())
}
return ( return (
<SiteModal
{...props} <div>
title="编辑推送方案" <div onClick={handleClick}>选择推送组</div>
bodyStyle={{ width: '100%', minHeight: '100px' }} <div>{selectRole}</div>
style={{ top: 200, borderRadius: '20px' }} <SiteModal
width="800px" {...props}
destroyOnClose title="编辑推送方案"
cancelText="取消" bodyStyle={{ width: '100%', minHeight: '100px' }}
okText="确认" style={{ top: 200, borderRadius: '20px' }}
onOk={() => onSubmit()} width="800px"
confirmLoading={loading} destroyOnClose
> cancelText="取消"
<div> okText="确认"
<ListCard /> onOk={() => handleOk()}
</div> confirmLoading={loading}
</SiteModal> visible={previewVisible}
onCancel={handleCancel}
>
<div>
<ListCard {...props} onChange2={onChange2}/>
</div>
</SiteModal>
</div>
) )
} }
const checkChildrenByCondition = ( const checkChildrenByCondition = (
...@@ -54,7 +80,7 @@ const checkChildrenByCondition = ( ...@@ -54,7 +80,7 @@ const checkChildrenByCondition = (
const ListCard = props => { const ListCard = props => {
const { onChange } = props const { onChange,onChange2 } = props
const [changedItem, setChangedItem] = useState({ item: {} }); const [changedItem, setChangedItem] = useState({ item: {} });
const [valueList, setValueList] = useState([]); const [valueList, setValueList] = useState([]);
...@@ -64,10 +90,12 @@ const ListCard = props => { ...@@ -64,10 +90,12 @@ const ListCard = props => {
setValueList(result); setValueList(result);
// eslint-disable-next-line no-unused-expressions // eslint-disable-next-line no-unused-expressions
onChange && onChange(result); onChange && onChange(result);
onChange2 && onChange2(result);
} else { } else {
setValueList([]); setValueList([]);
// eslint-disable-next-line no-unused-expressions // eslint-disable-next-line no-unused-expressions
onChange && onChange([]); onChange && onChange([]);
onChange2 && onChange2(result);
} }
}; };
...@@ -92,6 +120,7 @@ const ListCard = props => { ...@@ -92,6 +120,7 @@ const ListCard = props => {
if (sourceItem) setChangedItem(sourceItem); if (sourceItem) setChangedItem(sourceItem);
// eslint-disable-next-line no-unused-expressions // eslint-disable-next-line no-unused-expressions
onChange && onChange(result); onChange && onChange(result);
onChange2 && onChange2(result);
} }
useEffect(() => { useEffect(() => {
......
import { get, post, PUBLISH_SERVICE, CITY_SERVICE } from '@/services/index'; import { get, post, PUBLISH_SERVICE, CITY_SERVICE } from '@/services/index';
//模板管理接口
export const GetMessageTemplate = param => export const GetMessageTemplate = param =>
get(`${PUBLISH_SERVICE}/MessageTemplate/GetMessageTemplate`, param); get(`${PUBLISH_SERVICE}/MessageTemplate/GetMessageTemplate`, param);
export const InsertMessageTemplate = param => export const InsertMessageTemplate = param =>
...@@ -8,4 +10,25 @@ export const UpdateMessageTemplate = param => ...@@ -8,4 +10,25 @@ export const UpdateMessageTemplate = param =>
export const DeleteMessageTemplate = param => export const DeleteMessageTemplate = param =>
get(`${PUBLISH_SERVICE}/MessageTemplate/DeleteMessageTemplate`, param); get(`${PUBLISH_SERVICE}/MessageTemplate/DeleteMessageTemplate`, param);
export const GetThirdpartyTemplates = param => export const GetThirdpartyTemplates = param =>
get(`${PUBLISH_SERVICE}/MessageTemplate/GetThirdpartyTemplates`, param); get(`${PUBLISH_SERVICE}/MessageTemplate/GetThirdpartyTemplates`, param);
\ No newline at end of file //方案管理接口
export const GetMessageConfigList = param =>
get(`${PUBLISH_SERVICE}/MessageConfig/GetMessageConfigList`, param);
export const InsertMessageConfig = param =>
get(`${PUBLISH_SERVICE}/MessageConfig/InsertMessageConfig`, param);
export const UpdateMessageConfig = param =>
get(`${PUBLISH_SERVICE}/MessageConfig/UpdateMessageConfig`, param);
export const DeleteMessageConfig = param =>
get(`${PUBLISH_SERVICE}/MessageConfig/DeleteMessageConfig`, param);
export const GetMessageVersion = param =>
get(`${PUBLISH_SERVICE}/MessageConfig/GetMessageVersion`, param);
export const GetMsgTypeList = param =>
get(`${PUBLISH_SERVICE}/MessageConfig/GetMsgTypeList`, param);
export const TestPush = param =>
get(`${PUBLISH_SERVICE}/MessageConfig/TestPush`, param);
export const AddIISAgentConfig = param =>
get(`${PUBLISH_SERVICE}/MessageConfig/AddIISAgentConfig`, param);
export const DeleteIISAgentConfig = param =>
get(`${PUBLISH_SERVICE}/MessageConfig/DeleteIISAgentConfig`, param);
export const GetIISAgentConfig = param =>
get(`${PUBLISH_SERVICE}/MessageConfig/GetIISAgentConfig`, param);
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment