Commit f12f5277 authored by 邓超's avatar 邓超

fix: 修改消息平台卡片样式,修改用户管理权限问题

parent dcbbb04c
Pipeline #39814 passed with stages
in 21 minutes 12 seconds
...@@ -20,6 +20,8 @@ const ListCardItem = props => { ...@@ -20,6 +20,8 @@ const ListCardItem = props => {
const [checkList, setCheckList] = useState([]); // 复选框列表选中的值 const [checkList, setCheckList] = useState([]); // 复选框列表选中的值
const [defaultList, setDefaultList] = useState([]); // 默认的选项 const [defaultList, setDefaultList] = useState([]); // 默认的选项
const [submitArr, setSubmitArr] = useState([]); // 提交的数组 const [submitArr, setSubmitArr] = useState([]); // 提交的数组
const authority = JSON.parse(localStorage.getItem('panda-oms-authority'));
// const submitArr = []; // const submitArr = [];
useEffect(() => { useEffect(() => {
...@@ -136,7 +138,12 @@ const ListCardItem = props => { ...@@ -136,7 +138,12 @@ const ListCardItem = props => {
return null; return null;
} }
return ( return (
<> <div
style={{
display:
OUName === '运维管理' && authority[1] !== 'super' ? 'none' : 'block',
}}
>
<div className={`${styles.divBox}`}> <div className={`${styles.divBox}`}>
<div className={styles.topCheckbox}> <div className={styles.topCheckbox}>
<Checkbox <Checkbox
...@@ -162,7 +169,7 @@ const ListCardItem = props => { ...@@ -162,7 +169,7 @@ const ListCardItem = props => {
)} )}
</div> </div>
</div> </div>
</> </div>
); );
}; };
......
...@@ -119,7 +119,7 @@ const AddModal = props => { ...@@ -119,7 +119,7 @@ const AddModal = props => {
Group: pramData.Group || '', Group: pramData.Group || '',
Shape, Shape,
ExceptionEvent: pramData.ExceptionEvent || '', ExceptionEvent: pramData.ExceptionEvent || '',
RowSpan: pramData.RowSpan || 0, RowSpan: Number(pramData.RowSpan) || 0,
ColSpan: pramData.ColSpan || 0, ColSpan: pramData.ColSpan || 0,
ReadOnly: pramData.ReadOnly || false, ReadOnly: pramData.ReadOnly || false,
EditableLater: pramData.EditableLater || false, EditableLater: pramData.EditableLater || false,
......
...@@ -319,7 +319,7 @@ const ProjectManage = () => { ...@@ -319,7 +319,7 @@ const ProjectManage = () => {
}; };
const pagenation = { const pagenation = {
showTotal: (total, range) => `共 ${total} 条`, showTotal: (total, range) => `${range[0]}-${range[1]} 条/${total} 条`,
pageSizeOptions: [10, 20, 50, 100], pageSizeOptions: [10, 20, 50, 100],
defaultPageSize: 10, defaultPageSize: 10,
showQuickJumper: true, showQuickJumper: true,
...@@ -407,6 +407,7 @@ const ProjectManage = () => { ...@@ -407,6 +407,7 @@ const ProjectManage = () => {
onCancel={() => handleShowModal('addVisible', false)} onCancel={() => handleShowModal('addVisible', false)}
confirmModal={bddModal} confirmModal={bddModal}
/> />
{/* 推送测试模块 */}
<PushTest <PushTest
visible={visibleParams.pushTestVisible} visible={visibleParams.pushTestVisible}
onCancel={() => handleShowModal('pushTestVisible', false)} onCancel={() => handleShowModal('pushTestVisible', false)}
......
...@@ -13,7 +13,7 @@ const CardCheck = props => { ...@@ -13,7 +13,7 @@ const CardCheck = props => {
return ref.current; return ref.current;
}; };
const { cardMsg, callback, checkList } = props; const { cardMsg, callback, checkList } = props;
const [checkedList, setCheckedList] = useState([]); const [checkedList, setCheckedList] = useState([]); // 选中列表
const [indeterminate, setIndeterminate] = useState(false); const [indeterminate, setIndeterminate] = useState(false);
const [checkAll, setCheckAll] = useState(false); const [checkAll, setCheckAll] = useState(false);
const [plainOptions, setPlainOptions] = useState([]); const [plainOptions, setPlainOptions] = useState([]);
...@@ -61,11 +61,13 @@ const CardCheck = props => { ...@@ -61,11 +61,13 @@ const CardCheck = props => {
callback(checkedList, newCheckList); callback(checkedList, newCheckList);
} }
}, [checkedList]); }, [checkedList]);
// 单选监听
const onChange = list => { const onChange = list => {
setCheckedList(list); setCheckedList(list);
setIndeterminate(!!list.length && list.length < plainOptions.length); setIndeterminate(!!list.length && list.length < plainOptions.length);
setCheckAll(list.length === plainOptions.length); setCheckAll(list.length === plainOptions.length);
}; };
// 全选监听
const onCheckAllChange = e => { const onCheckAllChange = e => {
setCheckedList( setCheckedList(
e.target.checked ? plainOptions.map(item => item.value) : [], e.target.checked ? plainOptions.map(item => item.value) : [],
...@@ -74,7 +76,7 @@ const CardCheck = props => { ...@@ -74,7 +76,7 @@ const CardCheck = props => {
setCheckAll(e.target.checked); setCheckAll(e.target.checked);
}; };
return ( return (
<div className={styles.divBox}> <div className={styles.checkContent}>
<div className={styles.topCheckbox}> <div className={styles.topCheckbox}>
<Checkbox <Checkbox
indeterminate={indeterminate} indeterminate={indeterminate}
...@@ -84,7 +86,7 @@ const CardCheck = props => { ...@@ -84,7 +86,7 @@ const CardCheck = props => {
{cardMsg.groupName} {cardMsg.groupName}
</Checkbox> </Checkbox>
</div> </div>
<div className={styles.bottomCheckbox} style={{ marginTop: '10px' }}> <div className={styles.bottomCheckbox}>
<CheckboxGroup <CheckboxGroup
options={plainOptions} options={plainOptions}
value={checkedList} value={checkedList}
......
...@@ -32,14 +32,12 @@ const PushTest = props => { ...@@ -32,14 +32,12 @@ const PushTest = props => {
}); });
// 监听分页 // 监听分页
const paginationChange = (page, pageSizes) => { const paginationChange = (page, pageSizes) => {
// 分页时清空复选框
setCurrentPage(page); setCurrentPage(page);
setPageSize(pageSizes); setPageSize(pageSizes);
let username = form.getFieldValue('username'); let username = form.getFieldValue('username');
getData(username, page, pageSizes); getData(username, page, pageSizes);
}; };
const onFinish = () => { const onFinish = () => {
if (pushTestMsg.ThemeName)
TestPush({ TestPush({
theme: pushTestMsg.ThemeName, theme: pushTestMsg.ThemeName,
msgType: pushTestMsg.MsgType, msgType: pushTestMsg.MsgType,
...@@ -48,28 +46,44 @@ const PushTest = props => { ...@@ -48,28 +46,44 @@ const PushTest = props => {
? pushTestMsg.item.AgentConfig.Url ? pushTestMsg.item.AgentConfig.Url
: '', : '',
msgTypeId: pushTestMsg.ID.toString(), msgTypeId: pushTestMsg.ID.toString(),
}).then(res => { })
.then(res => {
if (res.code === 0) { if (res.code === 0) {
confirmModal(); confirmModal();
message.success('测试推送成功'); message.success('测试推送成功');
} else { } else {
message.error(res.msg); message.error(res.msg);
} }
})
.catch(() => {
message.error('网络异常,请稍后再试');
}); });
}; };
// 搜索
const onSearch = () => { const onSearch = () => {
let username = form.getFieldValue('username'); let username = form.getFieldValue('username');
setCurrentPage(1); setCurrentPage(1);
getData(username, 1, pageSize); getData(username, 1, pageSize);
}; };
// 重置
const onReset = () => {
setCurrentPage(1);
getData('', 1, pageSize);
form.setFieldsValue({ username: '' });
};
// 获取数据
const getData = (username, page, pageSizes) => { const getData = (username, page, pageSizes) => {
setLoading(true); setLoading(true);
GetGroupUserTree({ GetGroupUserTree({
key: username, key: username,
pageSize: pageSizes, pageSize: pageSizes,
PageIndex: page, PageIndex: page,
}).then(res => { })
.then(res => {
setLoading(false);
if (res.code === 0) {
setTotal(res.data.count); setTotal(res.data.count);
// 数据处理成checkbox组件需要得形式
let list = res.data.data.map(item => { let list = res.data.data.map(item => {
let indeterminate = false; let indeterminate = false;
let checkedList = []; let checkedList = [];
...@@ -89,7 +103,10 @@ const PushTest = props => { ...@@ -89,7 +103,10 @@ const PushTest = props => {
console.log(checkList, '所有选择得列表'); console.log(checkList, '所有选择得列表');
console.log(checkedList, '当前组件勾选'); console.log(checkedList, '当前组件勾选');
if (checkedList.length === options.length && checkedList.length > 0) { if (
checkedList.length === options.length &&
checkedList.length > 0
) {
checkAll = true; checkAll = true;
} }
if (checkedList.length < options.length && checkedList.length > 0) { if (checkedList.length < options.length && checkedList.length > 0) {
...@@ -105,7 +122,13 @@ const PushTest = props => { ...@@ -105,7 +122,13 @@ const PushTest = props => {
}; };
}); });
setAllist(list); setAllist(list);
} else {
message.error(res.msg);
}
})
.catch(() => {
setLoading(false); setLoading(false);
message.error('网络异常,请稍后再试');
}); });
}; };
return ( return (
...@@ -120,12 +143,12 @@ const PushTest = props => { ...@@ -120,12 +143,12 @@ const PushTest = props => {
destroyOnClose destroyOnClose
centered centered
> >
<div className="searchHeader"> {/* 头部搜索框 */}
<div className={styles.searchHeader}>
<Form form={form} layout="inline"> <Form form={form} layout="inline">
<Form.Item name="username"> <Form.Item name="username">
<Input placeholder="请输入用户名称" /> <Input placeholder="请输入用户名称" />
</Form.Item> </Form.Item>
<Form.Item> <Form.Item>
<Button <Button
type="primary" type="primary"
...@@ -135,40 +158,35 @@ const PushTest = props => { ...@@ -135,40 +158,35 @@ const PushTest = props => {
> >
搜索 搜索
</Button> </Button>
<Button <Button type="primary" htmlType="submit" onClick={onReset}>
type="primary"
htmlType="submit"
onClick={() => {
setCurrentPage(1);
getData('', 1, pageSize);
form.setFieldsValue({ username: '' });
}}
>
重置 重置
</Button> </Button>
</Form.Item> </Form.Item>
</Form> </Form>
</div> </div>
{/* 复选框模块 */}
<Spin spinning={loading}> <Spin spinning={loading}>
<div <div className={styles.checkContainer}>
className="checkContainer"
style={{ height: '500px', overflowY: 'scroll', margin: '20px 0' }}
>
{allList.map((item, index) => ( {allList.map((item, index) => (
<div className={styles.checkBoxContent} key={item.groupId}> <div className={styles.checkBoxContent} key={item.groupId}>
<CardCheck <CardCheck
cardMsg={item} cardMsg={item}
cardIndex={index} cardIndex={index}
callback={(val, i) => checkCallBack(val, i)} callback={(val, newCheckList) =>
checkCallBack(val, newCheckList)
}
checkList={checkList} checkList={checkList}
/> />
</div> </div>
))} ))}
</div> </div>
</Spin> </Spin>
{/* 分页 */}
<Pagination <Pagination
total={total} total={total}
showTotal={item => `共 ${item} 条`} showTotal={(totals, range) =>
`第${range[0]}-${range[1]} 条/共 ${totals} 条`
}
defaultPageSize={pageSize} defaultPageSize={pageSize}
defaultCurrent={1} defaultCurrent={1}
current={currentPage} current={currentPage}
......
.divBox { .checkContainer {
height: 500px;
overflow-y: scroll;
margin: 20px 0;
padding-right: 5px;
}
.checkContent {
display: flex; display: flex;
width: 100%; width: 100%;
flex-direction: column; flex-direction: column;
...@@ -20,6 +26,7 @@ ...@@ -20,6 +26,7 @@
font-weight: 600; font-weight: 600;
} }
.bottomCheckbox { .bottomCheckbox {
margin-top: 10px;
.ant-checkbox-group-item { .ant-checkbox-group-item {
min-width: 150px !important; min-width: 150px !important;
} }
......
...@@ -472,7 +472,7 @@ const EditModal = props => { ...@@ -472,7 +472,7 @@ const EditModal = props => {
label="模板" label="模板"
labelAlign="left" labelAlign="left"
name="app_template" name="app_template"
labelCol={{ span: 2 }} labelCol={{ span: 3 }}
> >
<Select <Select
style={{ width: '97%' }} style={{ width: '97%' }}
...@@ -489,7 +489,7 @@ const EditModal = props => { ...@@ -489,7 +489,7 @@ const EditModal = props => {
label="功能路径" label="功能路径"
name="app_path" name="app_path"
labelAlign="left" labelAlign="left"
labelCol={{ span: 2 }} labelCol={{ span: 3 }}
> >
<TextArea <TextArea
rows={4} rows={4}
...@@ -515,7 +515,7 @@ const EditModal = props => { ...@@ -515,7 +515,7 @@ const EditModal = props => {
label="模板" label="模板"
name="wx_template" name="wx_template"
labelAlign="left" labelAlign="left"
labelCol={{ span: 3 }} labelCol={{ span: 4 }}
> >
<Select <Select
style={{ width: '97%' }} style={{ width: '97%' }}
...@@ -532,7 +532,7 @@ const EditModal = props => { ...@@ -532,7 +532,7 @@ const EditModal = props => {
label="H5路由" label="H5路由"
name="h5_path" name="h5_path"
labelAlign="left" labelAlign="left"
labelCol={{ span: 3 }} labelCol={{ span: 4 }}
> >
<Input <Input
style={{ width: '97%' }} style={{ width: '97%' }}
...@@ -544,7 +544,7 @@ const EditModal = props => { ...@@ -544,7 +544,7 @@ const EditModal = props => {
label="小程序路由" label="小程序路由"
name="miniprogram_path" name="miniprogram_path"
labelAlign="left" labelAlign="left"
labelCol={{ span: 3 }} labelCol={{ span: 4 }}
> >
<Input <Input
style={{ width: '97%' }} style={{ width: '97%' }}
...@@ -568,7 +568,7 @@ const EditModal = props => { ...@@ -568,7 +568,7 @@ const EditModal = props => {
<Item <Item
label="模板" label="模板"
name="web_template" name="web_template"
labelCol={{ span: 2 }} labelCol={{ span: 3 }}
labelAlign="left" labelAlign="left"
> >
<Select <Select
...@@ -586,7 +586,7 @@ const EditModal = props => { ...@@ -586,7 +586,7 @@ const EditModal = props => {
label="功能路径" label="功能路径"
name="web_path" name="web_path"
labelAlign="left" labelAlign="left"
labelCol={{ span: 2 }} labelCol={{ span: 3 }}
> >
<TextArea <TextArea
rows={4} rows={4}
......
...@@ -34,10 +34,11 @@ ...@@ -34,10 +34,11 @@
display: flex; display: flex;
flex-direction:row; flex-direction:row;
flex-wrap: wrap; flex-wrap: wrap;
justify-content: space-between; justify-content: flex-start;
.trench_card{ .trench_card{
margin-top: 1rem; margin-top: 1rem;
width: 49.2%; margin-right: 0.5rem;
width: 32%;
border-width: 1px; border-width: 1px;
border-color: #EEEEEE; border-color: #EEEEEE;
border-style: solid; border-style: solid;
......
...@@ -312,7 +312,7 @@ const UserManage = () => { ...@@ -312,7 +312,7 @@ const UserManage = () => {
</Tooltip> </Tooltip>
</> </>
)} )}
<Tooltip title="用户鉴权"> {/* <Tooltip title="用户鉴权">
<Popconfirm <Popconfirm
placement="bottomRight" placement="bottomRight"
title={ title={
...@@ -340,7 +340,7 @@ const UserManage = () => { ...@@ -340,7 +340,7 @@ const UserManage = () => {
style={{ fontSize: '16px', color: '#1890ff' }} style={{ fontSize: '16px', color: '#1890ff' }}
/> />
</Popconfirm> </Popconfirm>
</Tooltip> </Tooltip> */}
<Tooltip title="删除用户"> <Tooltip title="删除用户">
<Popconfirm <Popconfirm
placement="bottomRight" placement="bottomRight"
......
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