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