Commit 7b571f25 authored by Maofei94's avatar Maofei94

perf: 角色管理优化

parent 08e9235e
......@@ -9,7 +9,7 @@ module.exports = options => ({
output: Object.assign(
{
path: path.resolve(process.cwd(), 'build'),
publicPath: process.env.PUBLIC_PATH || '/CivManage',
publicPath: process.env.PUBLIC_PATH || '/CivManage/',
},
options.output,
), // Merge with env dependent settings
......
......@@ -83,7 +83,7 @@ const arr = [
</div>
),
},
// CivManage后增加/ 2020-12-22
// {
// key: '2',
// label: '1.0.20201218',
......
......@@ -29,6 +29,7 @@ const dataArr = [
component: <MySQLTable />,
},
];
const Hr = () => <hr style={{ width: 'calc( 100% - 40px)' }} />;
const DatabaseConnectConfig = props => {
const [flag, setFlag] = useState(false);
const [active, setActive] = useState('0');
......@@ -37,16 +38,28 @@ const DatabaseConnectConfig = props => {
console.log(e);
setActive(e);
};
return (
<PageContainer>
<Card>
<Tabs activeKey={active} onChange={e => handleChange(e)}>
{/* <Tabs activeKey={active} onChange={e => handleChange(e)}>
{dataArr.map(item => (
<TabPane tab={item.title} key={item.key}>
{active === item.key && item.component}
</TabPane>
))}
</Tabs>
</Tabs> */}
<Hr />
<SQLServerTable />
<br />
<Hr />
<OracleTable />
<br />
<Hr />
<MongDBTable />
<br />
<Hr />
<MySQLTable />
</Card>
</PageContainer>
);
......
......@@ -214,6 +214,7 @@ const AddModal = props => {
onChange={e => {
handleChange(e);
}}
disabled
>
{typeList.map(item => (
<Option value={item.value} key={item.key}>
......
......@@ -52,7 +52,7 @@ const SiteManage = () => {
const [saveTreeId, setSaveTreeId] = useState(''); // 保存点击回调的roleid
const [modalVisible, setModalVisible] = useState(false); // 新增弹窗
const [flag, setFlag] = useState(1);
const [itemObj, setItemObj] = useState({}); // 选择的角色item
const [itemObj, setItemObj] = useState(''); // 选择的角色item
const [delVisible, setDelVisible] = useState(false); // 删除弹窗
const [editVisible, setEditVisible] = useState(false); // 修改弹窗
const [subList, setSubList] = useState([]); // 选中的数组
......@@ -103,7 +103,7 @@ const SiteManage = () => {
}
});
return () => {
setItemObj({});
setItemObj('');
};
}, [flag]);
......@@ -229,7 +229,9 @@ const SiteManage = () => {
i.group = itemRole.visibleTitle;
i.icon = <UserOutlined />;
if (roleID && roleID === i.roleID) {
console.log(roleID, typeof roleID, 'roleID');
setItemObj(i);
// setCurrentSelectId(roleID);
}
});
......@@ -240,7 +242,9 @@ const SiteManage = () => {
itemRole.subSystemValue = item.visibleValue;
itemRole.icon = <UserOutlined />;
if (roleID && roleID === itemRole.roleID) {
console.log(roleID, typeof roleID, 'roleID');
setItemObj(itemRole);
// setCurrentSelectId(roleID);
}
}
return itemRole;
......@@ -251,18 +255,16 @@ const SiteManage = () => {
});
return arr3;
};
// 获取搜索框的值
const handleSearch = value => {
setSearchWord(value);
};
const handleChange = e => {
const { value } = e.target;
setSearchWord(value);
};
// 确认回调
const confirmModal = e => {
console.log(e, 'e');
console.log(e, typeof e, 'e');
setModalVisible(false);
setRoleID(`${e}`);
setCurrentSelectId([`${e}`]);
setFlag(flag + 1);
setItemObj('');
};
......@@ -417,7 +419,7 @@ const SiteManage = () => {
<Search
allowClear
placeholder={placeholder}
onSearch={handleSearch}
// onSearch={handleSearch}
onChange={handleChange}
enterButton
/>
......@@ -430,7 +432,7 @@ const SiteManage = () => {
onClick={() => {
handleAdd();
}}
disabled={itemObj.roleID}
disabled={!itemObj || (itemObj && itemObj.roleID)}
>
新增角色
</Button>
......
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