Commit 6ed0615d authored by 皮倩雯's avatar 皮倩雯

fix: '平台中心功能模块优化'

parent 8fa4e3c8
Pipeline #46498 passed with stages
in 7 minutes 19 seconds
/* eslint-disable react/jsx-boolean-value */
import React, { useState, useEffect } from 'react';
import { Form, Modal, Space, Table, Button, Popconfirm, Spin, notification, Tooltip } from 'antd';
import {
......@@ -401,8 +402,11 @@ const AddModal = props => {
expandable={{ expandedRowRender }}
size="small"
rowKey="id"
expandedRowKeys={chooseLine} // 展开的行
defaultExpandedRowKeys={[0]} // 展开的行
defaultExpandAllRows={true}
// expandedRowKeys={chooseLine} // 展开的行
// defaultExpandedRowKeys={[0]} // 展开的行
expandedRowKeys={select.map(item => item.key)} // 展开的行
// defaultExpandedRowKeys={0}
expandRowByClick
pagination={false}
scroll={{ y: 'calc(100vh - 186px)' }}
......
/* eslint-disable jsx-a11y/alt-text */
import React, { useEffect, useState } from 'react';
import { Card, Form, Input, Button, Switch, message, Divider, Row, Col, Spin } from 'antd';
import {
Card,
Form,
Input,
Button,
Switch,
message,
Divider,
Row,
Col,
Spin,
notification,
} from 'antd';
import styles from './ProxyConfig.less';
import {
GetNginxConfigInfo,
......@@ -61,39 +74,61 @@ const ProxyConfig = () => {
};
// 开启Nginx
const OperateStartNginx = () => {
setLoading(true);
StartNginx().then(res => {
setLoading(false);
if (res.code === 0) {
message.success('开启成功');
// message.success('开启成功');
notification.success({
message: '提示',
duration: 15,
description: '开启成功',
});
setFlag(flag + 1);
} else {
message.error('开启失败');
// message.error('开启失败');
notification.error({
message: '提示',
duration: 15,
description: res.msg,
});
}
});
};
// 停止Nginx
const OperateStopNginx = () => {
setLoading(true);
StopNginx().then(res => {
setLoading(false);
if (res.code === 0) {
message.success('关闭成功');
setFlag(flag + 1);
} else {
message.error('关闭失败');
}
});
};
// 开启/关闭缓存
const OperateNginxCache = isOpen => {
NginxCache({
isOpen: isOpen ? 1 : 0,
}).then(res => {
if (res.code === 0) {
notification.success({
message: '提示',
duration: 15,
description: '关闭成功',
});
setFlag(flag + 1);
message.success(isOpen ? '开启成功' : '关闭成功');
} else {
message.error(res.msg);
notification.error({
message: '提示',
duration: 15,
description: res.msg,
});
}
});
};
// // 开启/关闭缓存
// const OperateNginxCache = isOpen => {
// NginxCache({
// isOpen: isOpen ? 1 : 0,
// }).then(res => {
// if (res.code === 0) {
// setFlag(flag + 1);
// message.success(isOpen ? '开启成功' : '关闭成功');
// } else {
// message.error(res.msg);
// }
// });
// };
// 开启/关闭日志
const OperateNginxLog = isOpen => {
NginxLog({
......@@ -176,7 +211,7 @@ const ProxyConfig = () => {
>
<div style={{ display: 'flex', alignItems: 'center', marginTop: '10px' }}>
<img src={configuration} style={{ height: '16px' }} />
<span style={{ marginLeft: '10px', fontWeight: 'bold' }}>配置文件管理</span>
<span style={{ marginLeft: '10px', fontWeight: 'bold' }}>Nginx配置文件管理</span>
</div>
<Divider />
<Form.Item
......@@ -239,7 +274,7 @@ const ProxyConfig = () => {
<div style={{ display: 'flex', alignItems: 'center', marginTop: '40px' }}>
<img src={configuration} style={{ height: '16px' }} />
<span style={{ marginLeft: '10px', fontWeight: 'bold' }}>服务管理</span>
<span style={{ marginLeft: '10px', fontWeight: 'bold' }}>Nginx服务管理</span>
</div>
<Divider />
<div className={styles.operate_container}>
......@@ -264,7 +299,7 @@ const ProxyConfig = () => {
style={{ marginLeft: '35px' }}
/>
</div>
<div style={{ marginLeft: '35px', marginTop: '20px' }}>
{/* <div style={{ marginLeft: '35px', marginTop: '20px' }}>
服务缓存
<Switch
checkedChildren="开启"
......@@ -274,7 +309,7 @@ const ProxyConfig = () => {
disabled={currentConfig.IsStartNginx > 0 ? 0 : 1}
style={{ marginLeft: '35px' }}
/>
</div>
</div> */}
<div style={{ marginLeft: '35px', marginTop: '20px' }}>
服务重载
<Button
......
......@@ -66,11 +66,12 @@ const ProjectManage = props => {
{
title: '方案名称',
dataIndex: 'name',
align: 'center',
key: 'name',
render: (text, record) => (
<div>
{record.type === '定时推送' ? (
<div style={{ display: 'flex', alignItems: 'center' }}>
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
<Tooltip title={text}>
<FieldTimeOutlined
style={{
......@@ -83,7 +84,7 @@ const ProjectManage = props => {
{searchStyle(text)}
</div>
) : (
<div style={{ display: 'flex', alignItems: 'center' }}>
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
<Tooltip title={text}>
<AlertTwoTone style={{ fontSize: '16px', marginRight: '0.1rem' }} />
</Tooltip>
......@@ -96,28 +97,75 @@ const ProjectManage = props => {
{
title: '方案类型',
dataIndex: 'type',
align: 'center',
key: 'type',
render: (text, record) => <div>{text === null ? '-' : text}</div>,
},
{
title: '推送方式',
dataIndex: 'send_pattern',
key: 'send_pattern',
align: 'center',
onCell: () => ({
style: {
maxWidth: 150,
overflow: 'hidden',
whiteSpace: 'nowrap',
textOverflow: 'ellipsis',
cursor: 'pointer',
},
}),
render: (text, record) => (
<span>
{text === null ? (
'-'
) : (
<Tooltip placement="topLeft" title={text}>
{text}
</Tooltip>
)}
</span>
),
},
{
title: '推送组',
dataIndex: 'receive_person',
key: 'receive_person',
align: 'center',
ellipsis: true,
onCell: () => ({
style: {
maxWidth: 150,
overflow: 'hidden',
whiteSpace: 'nowrap',
textOverflow: 'ellipsis',
cursor: 'pointer',
},
}),
render: (text, record) => (
<span>
{text === null ? (
'-'
) : (
<Tooltip placement="topLeft" title={text}>
{text}
</Tooltip>
)}
</span>
),
},
{
title: '是否启用',
dataIndex: 'is_use',
align: 'center',
key: 'is_use',
width: '100px',
render: (text, record) => <div>{text === '0' ? '否' : '是'}</div>,
},
{
title: '操作',
width: 250,
align: 'center',
ellipsis: true,
render: (text, record) => (
<Space>
......@@ -321,8 +369,8 @@ const ProjectManage = props => {
mesList.push({
name: item.MessageConfig.MsgType,
type: item.MessageConfig.ThemeName,
send_pattern: item.MessageConfig.PushMode || '-',
receive_person: item.MessageConfig.PushGroup || '-',
send_pattern: item.MessageConfig.PushMode,
receive_person: item.MessageConfig.PushGroup,
is_use: item.MessageConfig.IsStarted,
...item.MessageConfig,
item,
......
import React, { useState, useEffect, useCallback } from 'react';
import { Modal, Input, Button, message, Spin, Pagination } from 'antd';
import { Modal, Input, Button, message, Spin, Pagination, Table } from 'antd';
import { GetGroupUserTree, TestPush } from '@/services/messagemanage/messagemanage';
import styles from './PushTest.less';
import DragTable from '@/components/DragTable/DragTable';
......@@ -39,6 +39,8 @@ const PushTest = props => {
};
// 提交勾选的测试人员
const onFinish = () => {
console.log(pushTestMsg);
console.log(pushTestMsg.item.AgentConfig);
TestPush({
theme: pushTestMsg.ThemeName,
msgType: pushTestMsg.MsgType,
......@@ -183,21 +185,9 @@ const PushTest = props => {
))}
</div>
</Spin>
{/* 分页 */}
<Pagination
total={total}
showTotal={(totals, range) => `第${range[0]}-${range[1]} 条/共 ${totals} 条`}
defaultPageSize={pageSize}
defaultCurrent={1}
current={currentPage}
onChange={paginationChange}
style={{ marginBottom: '10px', width: '500px' }}
size="small"
showQuickJumper
/>
</div>
<div className={styles.tableRight}>
<DragTable
<Table
bordered
style={{ width: '350px', overflowX: 'hidden' }}
rowKey={record => record.value}
......@@ -211,6 +201,21 @@ const PushTest = props => {
/>
</div>
</div>
<div>
{/* 分页 */}
<Pagination
total={total}
showTotal={(totals, range) => `共 ${totals} 条`}
defaultPageSize={pageSize}
defaultCurrent={1}
current={currentPage}
onChange={paginationChange}
style={{ width: '100%' }}
size="small"
showQuickJumper
showSizeChanger
/>
</div>
</Modal>
</>
);
......
......@@ -29,6 +29,7 @@ import {
DeleteMessageTemplate,
InsertMessageTemplate,
GetThirdpartyTemplates,
GetMessageVersion,
} from '@/services/messagemanage/messagemanage';
import styles from './TemplateManage.less';
......@@ -50,12 +51,20 @@ const TemplateManage = () => {
const [showSearchStyle, setShowSearchStyle] = useState(false); // 是否显示模糊查询样式
const [value, setValue] = useState('');
const [currentType, setCurrentType] = useState('全部');
const [messageVersion, setMessageVersion] = useState('');
useEffect(() => {
getTemplateList();
selectFocus();
getMessageVersion();
}, [flag]);
const getMessageVersion = () => {
GetMessageVersion().then(res => {
console.log(res.data);
setMessageVersion(res.data);
});
};
const getTemplateList = obj => {
setTreeLoading(true);
GetMessageTemplate(obj)
......@@ -69,13 +78,13 @@ const TemplateManage = () => {
Id: item.Id,
name: item.LikeName,
type: item.Type,
third_name: item.Name || '-',
third_id: item.No || '-',
template_params2: item.ParsingParams || '-', //模板参数2.0
template_params1: item.TParameters || '-', //模板参数1.0
analysis_params: item.ParsingRules || '-', //模板解析
desc: item.ParsingDescription || '-', //模板参数说明
weixin: item.WorkWeiXinId || '-', //企业微信ID
third_name: item.Name,
third_id: item.No,
template_params2: item.ParsingParams, //模板参数2.0
template_params1: item.TParameters, //模板参数1.0
analysis_params: item.ParsingRules, //模板解析
desc: item.ParsingDescription, //模板参数说明
weixin: item.WorkWeiXinId, //企业微信ID
});
});
setData(list);
......@@ -96,7 +105,7 @@ const TemplateManage = () => {
notification.error({
message: '提示',
duration: 15,
description: res.message,
description: res.msg,
});
}
})
......@@ -126,18 +135,40 @@ const TemplateManage = () => {
dataIndex: 'type',
key: 'type',
align: 'center',
render: text => <span>{text == null ? '-' : text}</span>,
},
{
title: '第三方模板名称',
dataIndex: 'third_name',
key: 'third_name',
align: 'center',
render: text => <span>{text == null ? '-' : text}</span>,
},
{
title: '企业微信ID',
dataIndex: 'weixin',
key: 'weixin',
align: 'center',
onCell: () => ({
style: {
maxWidth: 150,
overflow: 'hidden',
whiteSpace: 'nowrap',
textOverflow: 'ellipsis',
cursor: 'pointer',
},
}),
render: (text, record) => (
<span>
{text === null ? (
'-'
) : (
<Tooltip placement="topLeft" title={text}>
{text}
</Tooltip>
)}
</span>
),
},
{
title: '第三方模版编号',
......@@ -154,10 +185,16 @@ const TemplateManage = () => {
cursor: 'pointer',
},
}),
render: record => (
<Tooltip placement="topLeft" title={record}>
{record}
</Tooltip>
render: (text, record) => (
<span>
{text === null ? (
'-'
) : (
<Tooltip placement="topLeft" title={text}>
{text}
</Tooltip>
)}
</span>
),
},
{
......@@ -165,18 +202,78 @@ const TemplateManage = () => {
dataIndex: 'template_params1',
key: 'template_params1',
align: 'center',
onCell: () => ({
style: {
maxWidth: 150,
overflow: 'hidden',
whiteSpace: 'nowrap',
textOverflow: 'ellipsis',
cursor: 'pointer',
},
}),
render: (text, record) => (
<span>
{text === null ? (
'-'
) : (
<Tooltip placement="topLeft" title={text}>
{text}
</Tooltip>
)}
</span>
),
},
{
title: '解析参数',
dataIndex: 'template_params2',
key: 'template_params2',
align: 'center',
onCell: () => ({
style: {
maxWidth: 150,
overflow: 'hidden',
whiteSpace: 'nowrap',
textOverflow: 'ellipsis',
cursor: 'pointer',
},
}),
render: (text, record) => (
<span>
{text === null ? (
'-'
) : (
<Tooltip placement="topLeft" title={text}>
{text}
</Tooltip>
)}
</span>
),
},
{
title: '模板参数说明',
dataIndex: 'desc',
key: 'desc',
align: 'center',
onCell: () => ({
style: {
maxWidth: 150,
overflow: 'hidden',
whiteSpace: 'nowrap',
textOverflow: 'ellipsis',
cursor: 'pointer',
},
}),
render: (text, record) => (
<span>
{text === null ? (
'-'
) : (
<Tooltip placement="topLeft" title={text}>
{text}
</Tooltip>
)}
</span>
),
},
{
title: '解析规则',
......@@ -193,10 +290,16 @@ const TemplateManage = () => {
cursor: 'pointer',
},
}),
render: record => (
<Tooltip placement="topLeft" title={record}>
{record}
</Tooltip>
render: (text, record) => (
<span>
{text === null ? (
'-'
) : (
<Tooltip placement="topLeft" title={text}>
{text}
</Tooltip>
)}
</span>
),
},
{
......@@ -246,7 +349,6 @@ const TemplateManage = () => {
} else {
n = val;
}
console.log(n);
return <div dangerouslySetInnerHTML={{ __html: n }} />;
};
......@@ -463,6 +565,7 @@ const TemplateManage = () => {
option={option}
confirmModal={editModal}
onSubmit={onSubmit}
messageVersion={messageVersion}
/>
<AddModal
visible={visibleParams.addVisible}
......@@ -471,6 +574,7 @@ const TemplateManage = () => {
option={option}
confirmModal={addModal}
onSubmit={onAddSubmit}
messageVersion={messageVersion}
/>
</Spin>
</div>
......
......@@ -6,7 +6,7 @@ const { Item } = Form;
const { TextArea } = Input;
const AddModal = props => {
const { option } = props;
const { option, messageVersion } = props;
const [form] = Form.useForm();
const [loading, setLoading] = useState(false);
......@@ -222,7 +222,16 @@ const AddModal = props => {
placeholder="first: 标题信息|Second: 展示内容|Third: 时间|Four: 备注信息"
/>
</Item>
<Item label="解析规则(仅限1.0)" name="analysis_params" labelCol={{ span: 6 }}>
<Item
label={
<>
<span>当前解析规则版本</span>
<span>{messageVersion}</span>
</>
}
name="analysis_params"
labelCol={{ span: 6 }}
>
<TextArea rows={2} style={{ width: '95%' }} placeholder="param1|param2|param3|param4" />
</Item>
</Form>
......
......@@ -5,7 +5,7 @@ import { Form, Input, notification, Select, Row, Col } from 'antd';
const { Item } = Form;
const { TextArea } = Input;
const EditModal = props => {
const { option, visible } = props;
const { option, visible, messageVersion } = props;
const [form] = Form.useForm();
const [templateName, setTemplateName] = useState([]);
......@@ -238,7 +238,16 @@ const EditModal = props => {
placeholder="first: 标题信息|Second: 展示内容|Third: 时间|Four: 备注信息"
/>
</Item>
<Item label="解析规则" labelCol={{ span: 6 }} name="analysis_params">
<Item
label={
<>
<span>当前解析规则版本</span>
<span>{messageVersion}</span>
</>
}
labelCol={{ span: 6 }}
name="analysis_params"
>
<TextArea style={{ width: '95%' }} rows={2} placeholder="param1|param2|param3|param4" />
</Item>
</Form>
......
......@@ -335,7 +335,12 @@ const SiteManage = () => {
i.key = i.roleID;
i.subSystemValue = item.visibleValue;
i.group = itemRole.visibleTitle;
i.icon = <UserOutlined />;
console.log(i.BuiltInRole);
if (i.BuiltInRole === true) {
i.icon = <UserOutlined style={{ color: '#dfb14b' }} />;
} else {
i.icon = <UserOutlined />;
}
if (roleID && roleID === i.roleID) {
setItemObj(i);
// setCurrentSelectId(roleID);
......@@ -343,10 +348,15 @@ const SiteManage = () => {
});
itemRole.children = itemRole.roleList;
} else {
console.log(itemRole.BuiltInRole);
itemRole.title = itemRole.roleName;
itemRole.key = itemRole.roleID;
itemRole.subSystemValue = item.visibleValue;
itemRole.icon = <UserOutlined />;
if (itemRole.BuiltInRole === true) {
itemRole.icon = <UserOutlined style={{ color: '#dfb14b' }} />;
} else {
itemRole.icon = <UserOutlined />;
}
if (roleID && roleID === itemRole.roleID) {
setItemObj(itemRole);
// setCurrentSelectId(roleID);
......@@ -848,25 +858,24 @@ const SiteManage = () => {
<Col span={3} />
</Row>
</Card>
<Card
className={classnames({
[styles.boxH]: mulu,
[styles.cardBoxR]: true,
})}
>
<Card>
{roleID ? (
<ListCard
roleID={roleID}
loading={loading}
checkList={valueList}
dataList={dataList}
searchWord={searchWord}
onCommit={handleCommit}
btnLoading={btnLoading}
hasData={hasData}
/>
<div className={styles.cardBoxR}>
<ListCard
roleID={roleID}
loading={loading}
checkList={valueList}
dataList={dataList}
searchWord={searchWord}
onCommit={handleCommit}
btnLoading={btnLoading}
hasData={hasData}
/>
</div>
) : (
<Empty image={Empty.PRESENTED_IMAGE_SIMPLE} description={descrip} />
<div className={styles.cardBoxH}>
<Empty image={Empty.PRESENTED_IMAGE_SIMPLE} description={descrip} />
</div>
)}
</Card>
</div>
......
......@@ -55,8 +55,12 @@
align-items: center;
}
.cardBoxR {
min-height: calc(100vh - 140px);
max-height: calc(100vh - 140px);
height: calc(100vh - 182px);
min-width: 870px;
overflow-y: scroll;
}
.cardBoxH {
height: calc(100vh - 151px);
min-width: 870px;
overflow-y: scroll;
}
......
......@@ -13,8 +13,6 @@ import {
Card,
Button,
Spin,
Row,
Col,
Empty,
Pagination,
Checkbox,
......@@ -62,6 +60,7 @@ const SiteManageV2 = () => {
const [treeDataCopy, setTreeDataCopy] = useState([]); // 机构树数据备份,用于更改机构
const [treeState, setTreeState] = useState(true); // 树第一次加载
const [treeLoading, setTreeLoading] = useState(false);
const [checkLoading, setCheckLoading] = useState(false);
const [currentStation, setCurrentStation] = useState(''); // 当前选中站点
const [currentStationMsg, setCurrentStationMsg] = useState({}); // 当前编辑节点信息
const [dataList, setdataList] = useState([]); // 当前站点对应的分页用户列表
......@@ -204,8 +203,10 @@ const SiteManageV2 = () => {
PageSize: +page.pageSize,
};
if (name) params = { ...params, key: name };
setCheckLoading(true);
getGroupUserTree(params).then(res => {
if (res.code === 0 && res.data) {
setCheckLoading(false);
setShowSearchStyle(true);
let list = res.data.data;
// 还原选择的数据
......@@ -230,6 +231,7 @@ const SiteManageV2 = () => {
setdataList(lodash.cloneDeep(list));
setTotal(res.data.count);
} else {
setCheckLoading(false);
handleShowModal('loading', false);
setdataList(lodash.cloneDeep([]));
}
......@@ -664,53 +666,55 @@ const SiteManageV2 = () => {
return (
<PageContainer className={styles.siteManageContainer}>
<div className={styles.contentContainer}>
<Card
className={classnames({
[styles.orgContainer]: true,
[styles.orgContainerHide]: !treeVisible,
})}
>
<span style={{ margin: '0 180px 0 10px' }}>站点列表</span>
<Tooltip title="添加顶级站点">
<PlusOutlined
onClick={() => addTopStation()}
style={{
color: '#1890FF',
fontSize: '18px',
verticalAlign: '0.04em',
}}
/>
</Tooltip>
{treeData.length > 0 && (
<div style={{ height: 'calc(100vh - 120px)', overflowY: 'scroll' }}>
<Tree
showIcon="true"
showLine={{ showLeafIcon: false }}
blockNode
autoExpandParent
selectedKeys={[currentStation]}
onSelect={onSelect}
treeData={treeData.map(t => mapTree(t))}
expandedKeys={treeData[0].id}
draggable
onDrop={handleDrop}
keepTree={keepTree}
<Spin spinning={treeLoading} tip="loading...">
<Card
className={classnames({
[styles.orgContainer]: true,
[styles.orgContainerHide]: !treeVisible,
})}
>
<span style={{ margin: '0 190px 0 10px' }}>站点列表</span>
<Tooltip title="添加顶级站点">
<PlusOutlined
onClick={() => addTopStation()}
style={{
color: '#1890FF',
fontSize: '18px',
verticalAlign: '0.04em',
}}
/>
</div>
)}
<div className={styles.switcher}>
{treeVisible && (
<Tooltip title="隐藏站点列表">
<DoubleLeftOutlined onClick={() => setTreeVisible(false)} />
</Tooltip>
)}
{!treeVisible && (
<Tooltip title="显示站点列表">
<DoubleRightOutlined onClick={() => setTreeVisible(true)} />
</Tooltip>
</Tooltip>
{treeData.length > 0 && (
<div style={{ height: 'calc(100vh - 120px)', overflowY: 'scroll' }}>
<Tree
showIcon="true"
showLine={{ showLeafIcon: false }}
blockNode
autoExpandParent
selectedKeys={[currentStation]}
onSelect={onSelect}
treeData={treeData.map(t => mapTree(t))}
expandedKeys={treeData[0].id}
draggable
onDrop={handleDrop}
keepTree={keepTree}
/>
</div>
)}
</div>
</Card>
<div className={styles.switcher}>
{treeVisible && (
<Tooltip title="隐藏站点列表">
<DoubleLeftOutlined onClick={() => setTreeVisible(false)} />
</Tooltip>
)}
{!treeVisible && (
<Tooltip title="显示站点列表">
<DoubleRightOutlined onClick={() => setTreeVisible(true)} />
</Tooltip>
)}
</div>
</Card>
</Spin>
{/* 右侧用户表 */}
<div
className={classnames({
......@@ -843,7 +847,7 @@ const SiteManageV2 = () => {
flexGrow: '1',
}}
>
<Spin spinning={visibleParams.loading}>
<Spin spinning={checkLoading} tip="loading...">
{dataList.map((item, index) => (
<Panels
{...item}
......
......@@ -126,7 +126,7 @@
.orgContainer {
height: calc(100vh - 74px);
width: 407px;
width: 320px;
padding-right: 10px;
left: 0;
top: 0;
......
/*
* @Description:
* @Author: leizhe
* @Date: 2022-01-13 17:26:14
* @LastEditTime: 2022-03-23 10:46:01
* @LastEditors: leizhe
*/
import { get, post, PUBLISH_SERVICE, CITY_SERVICE } from '@/services/index';
// 模板管理接口
......
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