Commit 0b30e293 authored by mayongxin's avatar mayongxin

fix:站点管理全勾选,人员错乱修复

parent 1a0d2d26
Pipeline #25058 passed with stages
in 28 minutes 39 seconds
# PUBLIC_PATH = reactOMS, 默认转发 /cityinterface
PROXY=/Cityinterface:http://192.168.12.46:8086;/Publish:http://192.168.12.46:8086;/Web4:http://192.168.10.150:8777;/CityTemp:http://192.168.10.150:8777
PROXY=/Cityinterface:http://192.168.10.150:8777;/Publish:http://192.168.10.150:8777;/Web4:http://192.168.10.150:8777;/CityTemp:http://192.168.10.150:8777
# 可设置第二个代理,test为转发前缀,后面为代理转发的地址
# PROXY2 = test : http://localhost:8006/
......
import React, { useState, useEffect } from 'react';
import { Tabs } from 'antd';
import PageContainer from '@/components/BasePageContainer';
import TemplateManage from '../messageManage/templateManage/TemplateManage'
import ProjectManage from '../messageManage/projectManage/ProjectManage'
const { TabPane } = Tabs;
const HostManager = () => {
const callback = () => {
}
return (
<PageContainer>
<Tabs onChange={callback} type="card">
<TabPane tab="推送模板配置" key="1">
<TemplateManage/>
</TabPane>
<TabPane tab="推送方案配置" key="2">
<ProjectManage/>
</TabPane>
</Tabs>
</PageContainer>
)
}
export default HostManager;
\ No newline at end of file
import React, { useState } from 'react'
import {
// Tree,
Table,
Space,
Input,
Button,
Select,
Popconfirm
} from 'antd';
import { PlusCircleOutlined } from '@ant-design/icons';
const { Search } = Input;
const { Option } = Select;
import EditModal from './components/EditModal'
import VisibleRoleModal from './components/VisibleRoleModal'
import styles from './ProjectManage.less'
const ProjectManage = () => {
const [visibleParams, setvisibleParams] = useState({
modalVisible: false, // 新增弹窗
delVisible: false, // 删除弹窗
editVisible: false, // 修改弹窗
spinLoading: false, // 加载弹窗
btnLoading: false,
loading: false,
checkBoxLoading: false,
});
const [currentTemplate, setCurrentTempalte] = useState({});
const columns = [
{
title: '方案名称',
dataIndex: 'name',
key: 'name',
render: text => <a>{text}</a>,
},
{
title: '方案类型',
dataIndex: 'type',
key: 'type',
},
{
title: '推送方式',
dataIndex: 'send_pattern',
key: 'send_pattern',
},
{
title: '推送组',
dataIndex: 'receive_person',
key: 'receive_person',
},
{
title: '是否启用',
dataIndex: 'is_use',
key: 'is_use',
},
{
title: '操作',
dataIndex: 'action',
key: 'action',
width: 250,
ellipsis: true,
render: (text, record) => (
<Space>
<Button
type="primary"
size="small"
onClick={() => {
TestDesc(record);
}}
>
测试
</Button>
<Button
type="primary"
size="small"
onClick={() => {
changeDesc(record);
}}
>
编辑
</Button>
<div onClick={e => e.stopPropagation()}>
<Popconfirm
title="是否删除该连接的历史记录?"
okText="确认"
cancelText="取消"
onConfirm={() => {
//delConfirm(record);
}}
>
<Button size="small" danger>
删除
</Button>
</Popconfirm>
</div>
</Space>
),
},
];
const data = [
{
key: '1',
name: "工单提醒",
type: "工单办理",
send_pattern: "平台弹框",
receive_person: "推送组",
is_use: "是"
},
{
key: '2',
name: "工单提醒",
type: "工单办理",
send_pattern: "平台弹框",
receive_person: "推送组",
is_use: "是"
},
{
key: '3',
name: "工单提醒",
type: "工单办理",
send_pattern: "平台弹框",
receive_person: "推送组",
is_use: "是"
},
{
key: '4',
name: "工单提醒",
type: "工单办理",
send_pattern: "平台弹框",
receive_person: "推送组",
is_use: "是"
},
{
key: '5',
name: "工单提醒",
type: "工单办理",
send_pattern: "平台弹框",
receive_person: "推送组",
is_use: "是"
},
{
key: '6',
name: "工单提醒",
type: "工单办理",
send_pattern: "平台弹框",
receive_person: "推送组",
is_use: "是"
},
{
key: '7',
name: "工单提醒",
type: "工单办理",
send_pattern: "平台弹框",
receive_person: "推送组",
is_use: "是"
},
{
key: '8',
name: "工单提醒",
type: "工单办理",
send_pattern: "平台弹框",
receive_person: "推送组",
is_use: "是"
},
{
key: '9',
name: "工单提醒",
type: "工单办理",
send_pattern: "平台弹框",
receive_person: "推送组",
is_use: "是"
},
{
key: '10',
name: "工单提醒",
type: "工单办理",
send_pattern: "平台弹框",
receive_person: "推送组",
is_use: "是"
},
{
key: '11',
name: "工单提醒",
type: "工单办理",
send_pattern: "平台弹框",
receive_person: "推送组",
is_use: "是"
},
{
key: '12',
name: "工单提醒",
type: "工单办理",
send_pattern: "平台弹框",
receive_person: "推送组",
is_use: "是"
},
{
key: '13',
name: "工单提醒",
type: "工单办理",
send_pattern: "平台弹框",
receive_person: "推送组",
is_use: "是"
},
]
const placeholder = '请输入方案名称'
const handleSearch = () => {
}
const changeDesc = (record) => {
setCurrentTempalte(record)
handleShowModal("editVisible", true)
}
const TestDesc = (record) => {
// setCurrentTempalte(record)
// handleShowModal("editVisible", true)
}
// 弹出模态框
const handleShowModal = (key, value) => {
setvisibleParams({ ...visibleParams, [key]: value });
};
const editModal = () => {
}
return (
<div className={styles.project_container}>
<div className={styles.operate_bar}>
<div className={styles.template_type}>
<div className={styles.title}>方案类型</div>
<Select placeholder="请选择方案类型!" defaultValue="0" style={{width:"150px"}}>
<Option value="0">全部</Option>
<Option value="1">监控报警</Option>
<Option value="2">工单办理</Option>
<Option value="3">平台公告</Option>
<Option value="4">定时推送</Option>
</Select>
</div>
<div className={styles.template_type}>
<div className={styles.title}>方案名称</div>
<Select placeholder="请选择方案名称!" defaultValue="0" style={{width:"150px"}}>
<Option value="0">全部</Option>
<Option value="1">GCK简报</Option>
<Option value="2">GCK运行日报</Option>
<Option value="3">二供简报</Option>
<Option value="4">消息提醒</Option>
</Select>
</div>
<div className={styles.fast_search}>
<div className={styles.title}>快速检索</div>
<Search
allowClear
placeholder={placeholder}
onSearch={handleSearch}
// onChange={handleChange}
enterButton
style={{ width: "300px" }}
/>
</div>
<Button type="primary">重置</Button>
<Button type="primary" style={{ marginLeft: "10px" }} icon={<PlusCircleOutlined />}>新增</Button>
</div>
<div className={styles.list_view}>
<Table columns={columns} dataSource={data} pagination={{ pageSize: '10' }} />
</div>
<EditModal
visible={visibleParams.editVisible}
template={currentTemplate}
onCancel={() => handleShowModal('editVisible', false)}
confirmModal={editModal}
/>
{/* <VisibleRoleModal
visible={true}
template={currentTemplate}
onCancel={() => handleShowModal('editVisible', false)}
confirmModal={editModal}
/> */}
</div>
)
}
export default ProjectManage;
\ No newline at end of file
.project_container{
width: 100%;
height: calc(100vh - 124px);
.operate_bar{
width: 100%;
height: 60px;
background-color: white;
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: center;
.template_type{
height: 60px;
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: center;
.title{
margin-left: 5px;
margin-right: 5px;
}
}
.fast_search{
height: 60px;
margin-right: 10px;
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: center;
.title{
margin-left: 20px;
margin-right: 5px;
}
}
}
.list_view{
width: 100%;
height: calc(100vh - 184px);
background-color: white;
display: flex;
flex-direction: column;
justify-content: flex-start;
}
}
\ No newline at end of file
import React, { useState, useEffect, useRef } from 'react'
import SiteModal from '@/components/Modal/SiteModa';
import { Form, Input, notification, Select } from 'antd'
import BaseForm from '@/components/BaseForm/index';
const { Item } = Form;
const EditModal = props => {
const [form] = Form.useForm();
const [loading, setLoading] = useState(false);
const formEntity = useRef(null);
const onSubmit = () => { }
const handleGetForm = form => {
formEntity.current = form;
};
const items = [
{
label: '主题名称',
dataIndex: '主题名称',
rules: [
{
required: true,
message: '请输入主题名称',
},
],
formType: 'INPUT',
},
{
label: '消息类型',
dataIndex: '消息类型',
rules: [
{
required: true,
message: '请输入消息类型',
},
],
formType: 'INPUT',
},
{
label: '推送计划',
dataIndex: '推送计划',
rules: [
{
required: true,
message: '请输入计划名称',
},
],
formType: 'INPUT',
},
{
label: '推送组',
dataIndex: '推送组',
rules: [
{
required: true,
message: '请输入推送组名称',
},
],
formType: 'INPUT',
},
{
label: '推送方式',
dataIndex: '推送方式',
rules: [
{
required: true,
message: '请输入推送方式',
},
],
formType: 'INPUT',
},
{
label: '是否启动',
dataIndex: '是否启动',
rules: [
{
required: true,
message: '请输入主题名称',
},
],
formType: 'INPUT',
},
{
label: 'APP功能路径',
dataIndex: 'APP功能路径',
rules: [
{
required: true,
message: '请输入主题名称',
},
],
formType: 'INPUT',
},
{
label: 'APP模板ID',
dataIndex: 'APP模板ID',
rules: [
{
required: true,
message: '请输入主题名称',
},
],
formType: 'INPUT',
},
{
label: 'WEB功能路径',
dataIndex: 'WEB功能路径',
rules: [
{
required: true,
message: '请输入主题名称',
},
],
formType: 'INPUT',
},
{
label: 'WEB模板ID',
dataIndex: 'WEB模板ID',
rules: [
{
required: true,
message: '请输入主题名称',
},
],
formType: 'INPUT',
},
{
label: '公众号模板ID',
dataIndex: '公众号路径',
rules: [
{
required: true,
message: '请输入主题名称',
},
],
formType: 'INPUT',
},
{
label: '小程序路由',
dataIndex: '小程序路由',
rules: [
{
required: true,
message: '请输入主题名称',
},
],
formType: 'INPUT',
},
{
label: '短信模板ID',
dataIndex: '短信模板ID',
rules: [
{
required: true,
message: '请输入主题名称',
},
],
formType: 'INPUT',
},
{
label: '录入时间',
dataIndex: '录入时间',
rules: [
{
required: true,
message: '请输入主题名称',
},
],
formType: 'INPUT',
},
];
return (
<SiteModal
{...props}
title="编辑推送方案"
bodyStyle={{ width: '100%', minHeight: '100px' }}
style={{ top: 200, borderRadius: '20px' }}
width="800px"
destroyOnClose
cancelText="取消"
okText="确认"
onOk={() => onSubmit()}
confirmLoading={loading}
>
<div style={{height:'500px',overflow:'scroll'}}>
<BaseForm items={items} getForm={handleGetForm} />
</div>
</SiteModal>
)
}
export default EditModal;
\ No newline at end of file
export const data =
[
{
id: '1',
name: "CS",
isChecked:true,
children: [
{
id: '2',
name: "cs管理员",
isChecked:true,
children:[]
},
{
id: '3',
name: "cs管理员1",
isChecked:true,
children:[]
},
]
},
{
id: '4',
name: "BS",
children: [
{
id: '5',
name: "cs管理员",
isChecked:false,
children:[]
},
{
id: '6',
name: "cs管理员1",
isChecked:false,
children:[]
},
]
}
]
import React, { useEffect, useState } from 'react'
import SiteModal from '@/components/Modal/SiteModa';
import { Checkbox, Input, Button } from 'antd'
import { data } from './Mock'
import _ from 'lodash';
import classnames from 'classnames';
import styles from './VisibleRoleModal.less'
const checkIsGroup = node =>
node.children?.length > 0;
const getId = item =>
item.userID || item.roleID || item.stationID || item.id;
const VisibleRoleModal = props => {
const [loading, setLoading] = useState(false);
const onSubmit = () => { }
return (
<SiteModal
{...props}
title="编辑推送方案"
bodyStyle={{ width: '100%', minHeight: '100px' }}
style={{ top: 200, borderRadius: '20px' }}
width="800px"
destroyOnClose
cancelText="取消"
okText="确认"
onOk={() => onSubmit()}
confirmLoading={loading}
>
<div>
<ListCard />
</div>
</SiteModal>
)
}
const checkChildrenByCondition = (
item,
fn,
withGroup = true,
method = 'every',
) => {
if (item.children && item.children.length > 0) {
return fn(item);
}
const childrenResults = item.children[method](t =>
checkChildrenByCondition(t, fn, withGroup, method),
);
return withGroup ? [fn(item), ...childrenResults] : [...childrenResults];
};
const ListCard = props => {
const { onChange } = props
const [changedItem, setChangedItem] = useState({ item: {} });
const [valueList, setValueList] = useState([]);
const checkAll = e => {
if (e.target.checked) {
const result = data.map(item => getAllID(item)).flat(Infinity);
setValueList(result);
// eslint-disable-next-line no-unused-expressions
onChange && onChange(result);
} else {
setValueList([]);
// eslint-disable-next-line no-unused-expressions
onChange && onChange([]);
}
};
const getAllID = item => {
let result = [];
const haveChildren =
Array.isArray(item.children) && item.children.length > 0;
// 统一使用 getId
result.push(getId(item));
if (haveChildren) {
// 每次递归result被置空,所以要另外保存
result = [...item.children.map(i => getAllID(i)), ...result];
}
return result;
};
const updateValueList = (checkedKeys, childrenKeys, sourceItem) => {
const removekeys = _.difference(childrenKeys, checkedKeys);
let result = _.uniq(_.union(checkedKeys, valueList));
_.remove(result, v => removekeys.includes(v));
setValueList(result);
if (sourceItem) setChangedItem(sourceItem);
// eslint-disable-next-line no-unused-expressions
onChange && onChange(result);
}
useEffect(() => {
setValueList(['1', '2', '3'])
}, [])
return (
<div>
<Checkbox onChange={checkAll}>全选/全不选</Checkbox>
{
data.map((item, i) => {
return <ListCardItem
key={i}
item={item}
updateValueList={updateValueList}
valueList={valueList}
changedItem={changedItem}
{...props}
/>
})
}
</div>
)
}
const ListCardItem = props => {
const {
item,
valueList,
updateValueList,
changedItem
} = props;
const id = item.id;
// 当前组件是否是分组id
const isGroup = item.children && item.children.length > 0;
const [indeterminate, setIndeterminate] = useState(!isGroup);
const [childrenKeys, setChildrenKeys] = useState([]);
useEffect(() => {
if (isGroup) {
const keys = item.children
.map(child =>
checkChildrenByCondition(child, c => c.id, true, 'map'),
)
.flat(Infinity);
setChildrenKeys(keys);
} else {
//
}
}, [item]);
useEffect(() => {
// 子节点勾选状态变化时
if (
isGroup &&
changedItem.item !== item &&
!checkIsGroup(changedItem.item) &&
childrenKeys.includes(getId(changedItem.item))
) {
if (changedItem.value && childrenKeys.every(c => valueList.includes(c))) {
// 全选
updateValueList([id], [id]);
setIndeterminate(false);
} else if (childrenKeys.some(c => valueList.includes(c))) {
// 半选
// eslint-disable-next-line no-unused-expressions
valueList.includes(id) && updateValueList([], [id]);
setIndeterminate(true);
} else {
// 零选
// eslint-disable-next-line no-unused-expressions
valueList.includes(id) && updateValueList([], [id]);
setIndeterminate(false);
}
}
}, [changedItem.item, changedItem.value]);
const handleChecked = e => {
const { checked: v } = e.target;
if (isGroup) {
const result = [...childrenKeys, id];
updateValueList(v ? result : [], result, { item, value: v });
setIndeterminate(false);
} else {
updateValueList(v ? [id] : [], [id], { item, value: v });
}
}
const renderChild = () =>
item.children &&
item.children.map((c, i) => (
<ListCardItem
item={c}
key={`item${i}key`}
updateValueList={updateValueList}
valueList={valueList}
changedItem={changedItem}
/>
));
return (
<div className={classnames({
[styles.divBox]: isGroup,
[styles.divSingle]: !isGroup,
})}>
<div className={styles.topCheckbox}>
<Checkbox
indeterminate={isGroup ? indeterminate : false}
checked={valueList.includes(id)}
onChange={handleChecked} >
{item.name}
</Checkbox>
<div style={{ width: '100%' }} className={styles.checkdiv}>
{
renderChild()
}
</div>
</div>
</div>
)
}
export default VisibleRoleModal
\ No newline at end of file
.divBox {
// display: flex;
width: 100%;
flex-wrap: wrap;
border: 1px solid #c2cdfd;
border-radius: 5px;
margin-top: 20px;
min-height: 50px;
padding: 0 10px 10px 20px;
.ant-checkbox-wrapper{
background-color: #fff;
}
.topCheckbox{
height: 20px;
margin: -10px 0 0 0px;
line-height: 20px;
}
.topCheckbox>label :hover{
font-weight: 600;
}
.checkdiv {
display: flex;
flex-wrap: wrap;
// margin-left: 20px;
// justify-content: space-between;
}
}
.divSingle{
border: none;
margin-top: 20px;
min-width: 180px;
flex-grow: 0;
flex-shrink: 0;
// flex:0 0 auto;
// flex-basis: auto;
margin-right: 10px;
background: transparent;
}
.isSearch{
color: red;
background-color: yellow;
}
.boldLabel{
font-size: 15px;
font-weight: bold;
background-color: #fff;
}
.btnBox{
position: sticky;
bottom: 0px;
right: 0px;
background-color: #fff;
width: 100%;
height: 80px;
padding: 0 20px;
display: flex;
justify-content: flex-end;
align-items: center;
}
\ No newline at end of file
import React, { useState } from 'react'
import {
// Tree,
Table,
Space,
Input,
Button,
Select,
Popconfirm
} from 'antd';
import { PlusCircleOutlined } from '@ant-design/icons';
const { Search } = Input;
const { Option } = Select;
import EditModal from './components/EditModal'
import styles from './TemplateManage.less'
const TemplateManage = () => {
const [visibleParams, setvisibleParams] = useState({
modalVisible: false, // 新增弹窗
delVisible: false, // 删除弹窗
editVisible: false, // 修改弹窗
spinLoading: false, // 加载弹窗
btnLoading: false,
loading: false,
checkBoxLoading: false,
});
const [currentTemplate, setCurrentTempalte] = useState({});
const columns = [
{
title: '模板名称',
dataIndex: 'name',
key: 'name',
render: text => <a>{text}</a>,
},
{
title: '模板类型',
dataIndex: 'type',
key: 'type',
},
{
title: '第三方模板名称',
dataIndex: 'third_name',
key: 'third_name',
},
{
title: '第三方模版编号',
dataIndex: 'third_id',
key: 'third_id',
},
{
title: '模板参数',
dataIndex: 'template_params',
key: 'template_params',
},
{
title: '解析参数',
dataIndex: 'analysis_params',
key: 'analysis_params',
},
{
title: '参数说明',
dataIndex: 'desc',
key: 'desc',
},
{
title: '操作',
dataIndex: 'action',
key: 'action',
width: 250,
ellipsis: true,
render: (text, record) => (
<Space>
<Button
type="primary"
size="small"
onClick={() => {
changeDesc(record);
}}
>
编辑
</Button>
<div onClick={e => e.stopPropagation()}>
<Popconfirm
title="是否删除该连接的历史记录?"
okText="确认"
cancelText="取消"
onConfirm={() => {
//delConfirm(record);
}}
>
<Button size="small" danger>
删除
</Button>
</Popconfirm>
</div>
</Space>
),
},
];
const data = [
{
key: '1',
name: "节水报表通知",
type: "节水报表通知",
third_name: "节水报表通知",
third_id: "节水报表通知",
template_params: "节水报表通知",
analysis_params: "节水报表通知",
desc: "节水报表通知"
},
{
key: '2',
name: "节水报表通知",
type: "节水报表通知",
third_name: "节水报表通知",
third_id: "节水报表通知",
template_params: "节水报表通知",
analysis_params: "节水报表通知",
desc: "节水报表通知"
},
{
key: '3',
name: "节水报表通知",
type: "节水报表通知",
third_name: "节水报表通知",
third_id: "节水报表通知",
template_params: "节水报表通知",
analysis_params: "节水报表通知",
desc: "节水报表通知"
},
{
key: '4',
name: "节水报表通知",
type: "节水报表通知",
third_name: "节水报表通知",
third_id: "节水报表通知",
template_params: "节水报表通知",
analysis_params: "节水报表通知",
desc: "节水报表通知"
},
{
key: '5',
name: "节水报表通知",
type: "节水报表通知",
third_name: "节水报表通知",
third_id: "节水报表通知",
template_params: "节水报表通知",
analysis_params: "节水报表通知",
desc: "节水报表通知"
},
{
key: '6',
name: "节水报表通知",
type: "节水报表通知",
third_name: "节水报表通知",
third_id: "节水报表通知",
template_params: "节水报表通知",
analysis_params: "节水报表通知",
desc: "节水报表通知"
},
{
key: '7',
name: "节水报表通知",
type: "节水报表通知",
third_name: "节水报表通知",
third_id: "节水报表通知",
template_params: "节水报表通知",
analysis_params: "节水报表通知",
desc: "节水报表通知"
},
{
key: '8',
name: "节水报表通知",
type: "节水报表通知",
third_name: "节水报表通知",
third_id: "节水报表通知",
template_params: "节水报表通知",
analysis_params: "节水报表通知",
desc: "节水报表通知"
},
{
key: '9',
name: "节水报表通知",
type: "节水报表通知",
third_name: "节水报表通知",
third_id: "节水报表通知",
template_params: "节水报表通知",
analysis_params: "节水报表通知",
desc: "节水报表通知"
},
{
key: '10',
name: "节水报表通知",
type: "节水报表通知",
third_name: "节水报表通知",
third_id: "节水报表通知",
template_params: "节水报表通知",
analysis_params: "节水报表通知",
desc: "节水报表通知"
},
{
key: '11',
name: "节水报表通知",
type: "节水报表通知",
third_name: "节水报表通知",
third_id: "节水报表通知",
template_params: "节水报表通知",
analysis_params: "节水报表通知",
desc: "节水报表通知"
},
{
key: '12',
name: "节水报表通知",
type: "节水报表通知",
third_name: "节水报表通知",
third_id: "节水报表通知",
template_params: "节水报表通知",
analysis_params: "节水报表通知",
desc: "节水报表通知"
},
{
key: '13',
name: "节水报表通知",
type: "节水报表通知",
third_name: "节水报表通知",
third_id: "节水报表通知",
template_params: "节水报表通知",
analysis_params: "节水报表通知",
desc: "节水报表通知"
},
]
const placeholder = '请输入模板名称'
const handleSearch = () => {
}
const changeDesc = (record)=>{
setCurrentTempalte(record)
handleShowModal("editVisible",true)
}
// 弹出模态框
const handleShowModal = (key, value) => {
setvisibleParams({ ...visibleParams, [key]: value });
};
const editModal = () => {
}
return (
<div className={styles.template_container}>
<div className={styles.operate_bar}>
<div className={styles.template_type}>
<div className={styles.title}>模板类型</div>
<Select placeholder="请选择是否!" defaultValue="0">
<Option value="0">全部</Option>
<Option value="1">公众号</Option>
<Option value="2">短信</Option>
<Option value="3">APP</Option>
<Option value="4">WEB</Option>
</Select>
</div>
<div className={styles.fast_search}>
<div className={styles.title}>快速检索</div>
<Search
allowClear
placeholder={placeholder}
onSearch={handleSearch}
// onChange={handleChange}
enterButton
style={{ width: "300px" }}
/>
</div>
<Button type="primary">重置</Button>
<Button type="primary" style={{ marginLeft: "10px" }} icon={<PlusCircleOutlined />}>新增</Button>
</div>
<div className={styles.list_view}>
<Table columns={columns} dataSource={data} pagination={{ pageSize: '10' }} />
</div>
<EditModal
visible={visibleParams.editVisible}
template={currentTemplate}
onCancel={() => handleShowModal('editVisible', false)}
confirmModal={editModal}
/>
</div>
)
}
export default TemplateManage;
\ No newline at end of file
.template_container{
width: 100%;
height: calc(100vh - 124px);
.operate_bar{
width: 100%;
height: 60px;
background-color: white;
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: center;
.template_type{
height: 60px;
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: center;
.title{
margin-left: 5px;
margin-right: 5px;
}
}
.fast_search{
height: 60px;
margin-right: 10px;
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: center;
.title{
margin-left: 20px;
margin-right: 5px;
}
}
}
.list_view{
width: 100%;
height: calc(100vh - 184px);
background-color: white;
display: flex;
flex-direction: column;
justify-content: flex-start;
}
}
\ No newline at end of file
import React, {useState,useEffect } from 'react'
import SiteModal from '@/components/Modal/SiteModa';
import { Form, Input, notification, Select } from 'antd'
const { Item } = Form;
const EditModal = props => {
const [form] = Form.useForm();
const [loading, setLoading] = useState(false);
const onSubmit = () => { }
return (
<SiteModal
{...props}
title="编辑站点"
bodyStyle={{ width: '100%', minHeight: '100px' }}
style={{ top: 200, borderRadius: '20px' }}
width="800px"
destroyOnClose
cancelText="取消"
okText="确认"
onOk={() => onSubmit()}
confirmLoading={loading}
>
<Form form={form} labelCol={{ span: 4 }}>
<Item
label="模板名称"
name="name"
rules={[
{
required: true,
message: '请输入模板名称',
},
]}
>
<Input placeholder="请输入模板名称" />
</Item>
<Item
label="模板类型"
name="type"
rules={[
{
required: true,
message: '请选择模板类型',
},
]}
>
<Select >
<Option value="1">公众号</Option>
<Option value="2">短信</Option>
</Select>
</Item>
<Item
label="第三方模板名称"
name="third_name"
rules={[
{
required: true,
message: '请输入第三方模板名称',
},
]}
>
<Input placeholder="请输入模板名称" />
</Item>
<Item
label="第三方模板编号"
name="third_id"
rules={[
{
required: true,
message: '请输入第三方模板编号',
},
]}
>
<Input placeholder="请输入模板名称" />
</Item>
<Item
label="模板参数"
name="params"
rules={[
{
required: true,
message: '请输入模板参数',
},
]}
>
<Input placeholder="请输入模板参数" />
</Item>
<Item
label="参数说明"
name="desc"
rules={[
{
required: true,
message: '请输入参数说明',
},
]}
>
<Input placeholder="请输入参数说明" />
</Item>
<Item
label="参数解析"
name="analysis_params"
rules={[
{
required: true,
message: '请输入参数解析',
},
]}
>
<Input placeholder="请输入参数解析" />
</Item>
</Form>
</SiteModal>
)
}
export default EditModal;
\ No newline at end of file
......@@ -142,7 +142,8 @@ const SiteManageV2 = () => {
//切换站点,提交时触发已勾选列表更新
useEffect(() => {
if (!currentStation) return;
getAllcheckList();
//getAllcheckList();
getAllCheckListNew()
}, [currentStation, updateCheck]);
//获取当前站点可编辑用户(已勾选和未勾选)分页展示
......@@ -219,6 +220,31 @@ const SiteManageV2 = () => {
setUpdatePageUser(updatePageUser + 1)
}
}
//获取当前站点所有已经勾选的用户新接口
const getAllCheckListNew = () => {
getStationUsers({
stationId:currentStation
}).then(
res => {
let list = []
if (res.data.length > 0) {
res.data.map((item, index) => {
list.push({
GroupId: +item.OUID,
GroupName: item.OUName,
userName: item.userName,
userID: item.userID,
});
})
}
setSelectList(lodash.cloneDeep(list));
setUpdatePageUser(updatePageUser + 1)
}
)
}
//选中某个站点
const onSelect = (props, e) => {
if (!props[0]) {
......@@ -251,7 +277,7 @@ const SiteManageV2 = () => {
handleShowModal('editVisible', false);
setFlag(flag + 1);
};
const addChildModal = ()=>{
const addChildModal = () => {
handleShowModal('addChildVisible', false);
setFlag(flag + 1);
}
......@@ -351,11 +377,11 @@ const SiteManageV2 = () => {
obj[item.GroupId] = [item.userID];
}
});
dataList.forEach(item => {
if (obj[item.GroupId] && item.Users.length === obj[item.GroupId].length) {
obj[item.GroupId].push(item.GroupId);
}
});
// dataList.forEach(item => {
// if (obj[item.GroupId] && item.Users.length === obj[item.GroupId].length) {
// obj[item.GroupId].push(item.GroupId);
// }
// });
result = Object.values(obj);
// 数据处理成后台需要的格式
if (result.length === 0)
......
......@@ -37,6 +37,7 @@ import { USER_MODE } from '@/utils/constants';
import BaseFrameContainer from '@/components/BaseFrameContainer';
import JumpContainer from '@/components/JumpContainer';
import HostManager from '@/pages/platformCenter/hostmanager'
import MessageManager from '@/pages/platformCenter/messageManage'
// import ColConen from '@/components/Colophon/colContent';
const iconStyle = { verticalAlign: '0.125em' };
......@@ -188,19 +189,8 @@ export default {
{
path: '/platformCenter/notify',
name: '消息平台',
component: BaseFrameContainer,
tabs: [
{
tabName: '推送方案配置',
url:
'/web4/?widget=product/oms/MessageConfig/MessageConfig|hideMap=true',
},
{
tabName: '推送模板配置',
url:
'/web4/?widget=product/oms/MessageTem/MessageTem|hideMap=true&state=scan',
},
],
component: MessageManager,
},
{
path: '/platformCenter/emq',
......
......@@ -39,19 +39,19 @@ export const NginxCache = param =>
export const ReloadNginx = param =>
get(`${PUBLISH_SERVICE}/HostManager/ReloadNginx`, param);
//代理服务老接口
export const GetNginxConfigInfoOLD = param =>
//代理服务老接口
export const GetNginxConfigInfoOLD = param =>
get(`${CITY_SERVICE}/MessagePlatform.svc/MessageManage/GetNginxConfigInfo`, param);
export const InsertNginxConfigOLD = param =>
export const InsertNginxConfigOLD = param =>
post(`${CITY_SERVICE}/MessagePlatform.svc/MessageManage/InsertNginxConfig`, param);
export const StartNginxOLD = param =>
export const StartNginxOLD = param =>
post(`${CITY_SERVICE}/MessagePlatform.svc/MessageManage/StartNginx`, param);
export const StopNginxOLD = param =>
export const StopNginxOLD = param =>
post(`${CITY_SERVICE}/MessagePlatform.svc/MessageManage/StopNginx`, param);
export const NginxLogOLD = param =>
export const NginxLogOLD = param =>
post(`${CITY_SERVICE}/MessagePlatform.svc/MessageManage/NginxLog`, param);
export const NginxCacheOLD = param =>
export const NginxCacheOLD = param =>
post(`${CITY_SERVICE}/MessagePlatform.svc/MessageManage/NginxCache`, param);
export const ReloadNginxOLD = param =>
export const ReloadNginxOLD = param =>
post(`${CITY_SERVICE}/MessagePlatform.svc/MessageManage/ReloadNginx`, param);
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