Commit c10dfd99 authored by 邓超's avatar 邓超

fix: 动态建表添加字段自动滚动到最下面、密码填写改成默认不显示

parent 4bd8784e
Pipeline #60976 passed with stages
...@@ -422,12 +422,6 @@ const TableView = props => { ...@@ -422,12 +422,6 @@ const TableView = props => {
}; };
// 添加字段 // 添加字段
const handleAdd = () => { const handleAdd = () => {
// let box = document.getElementById('box');
// let v = document.getElementsByClassName('ant-table-body')[0];
// if (v) {
// v.scrollTop = 500;
// }
scrollToAnchor();
const newData = { const newData = {
keyIndex: count, keyIndex: count,
Name: '', Name: '',
...@@ -438,13 +432,12 @@ const TableView = props => { ...@@ -438,13 +432,12 @@ const TableView = props => {
}; };
setDataSource([...dataSource, newData]); setDataSource([...dataSource, newData]);
setCount(count + 1); setCount(count + 1);
setTimeout(() => {
let tableEl = document.querySelector(`.${styles.content} .ant-table-body`);
tableEl.scrollTop = tableEl.scrollHeight;
}, 10);
}; };
const scrollToAnchor = () => {
// const anchorElement = document.getElementById('page-bottom');
// console.log(anchorElement);
// anchorElement.scrollIntoView(false);
};
// 批量删除字段 // 批量删除字段
const deleteFilleds = () => { const deleteFilleds = () => {
if (selectedRowKeys.length === 0) { if (selectedRowKeys.length === 0) {
......
...@@ -27,6 +27,8 @@ const AddUserModal = props => { ...@@ -27,6 +27,8 @@ const AddUserModal = props => {
if (visible) { if (visible) {
addUserForm.resetFields(); addUserForm.resetFields();
getEmptyRoleList(); getEmptyRoleList();
} else {
setPasswordLevel('');
} }
}, [orgID, visible]); }, [orgID, visible]);
...@@ -247,9 +249,20 @@ const AddUserModal = props => { ...@@ -247,9 +249,20 @@ const AddUserModal = props => {
{ required: true }, { required: true },
]} ]}
> >
<Input placeholder="请输入账号密码(6~16位)" maxlength="16" /> <Input.Password
placeholder="请输入账号密码(6~16位)"
maxLength="16"
onCopy={e => {
e.preventDefault();
}}
onPaste={e => {
// 禁止粘贴
e.preventDefault();
}}
/>
</Form.Item> </Form.Item>
<div <div
style={{ right: '70px' }}
className={classNames(styles.tipsText, { className={classNames(styles.tipsText, {
[styles.tipsRed]: passwordLevel === '弱', [styles.tipsRed]: passwordLevel === '弱',
[styles.tipsOrange]: passwordLevel === '中', [styles.tipsOrange]: passwordLevel === '中',
......
...@@ -8,7 +8,9 @@ ...@@ -8,7 +8,9 @@
.formBox { .formBox {
position: relative; position: relative;
.ant-input-password-icon {
margin-top: 6px;
}
.tipsText { .tipsText {
position: absolute; position: absolute;
right: 40px; right: 40px;
......
...@@ -19,6 +19,9 @@ const ChangePasswordModal = props => { ...@@ -19,6 +19,9 @@ const ChangePasswordModal = props => {
newPassword: '', newPassword: '',
passwordConfirm: '', passwordConfirm: '',
}); });
} else {
setNewPasswordLevel('');
setPasswordConfirmLevel('');
} }
}, [visible]); }, [visible]);
...@@ -144,8 +147,6 @@ const ChangePasswordModal = props => { ...@@ -144,8 +147,6 @@ const ChangePasswordModal = props => {
newPassword: '', newPassword: '',
passwordConfirm: '', passwordConfirm: '',
}); });
setNewPasswordLevel('');
setPasswordConfirmLevel('');
onCancel(); onCancel();
}} }}
okText="确认" okText="确认"
...@@ -168,7 +169,18 @@ const ChangePasswordModal = props => { ...@@ -168,7 +169,18 @@ const ChangePasswordModal = props => {
{ required: true }, { required: true },
]} ]}
> >
<Input placeholder="请输入新密码" autoComplete="off" maxLength="16" /> <Input.Password
placeholder="请输入新密码"
autoComplete="off"
maxLength="16"
onCopy={e => {
e.preventDefault();
}}
onPaste={e => {
// 禁止粘贴
e.preventDefault();
}}
/>
</Form.Item> </Form.Item>
<div <div
className={classNames(styles.tipsText, { className={classNames(styles.tipsText, {
...@@ -192,7 +204,18 @@ const ChangePasswordModal = props => { ...@@ -192,7 +204,18 @@ const ChangePasswordModal = props => {
{ required: true }, { required: true },
]} ]}
> >
<Input placeholder="再次确认新密码" autoComplete="off" maxLength="16" /> <Input.Password
placeholder="再次确认新密码"
autoComplete="off"
maxLength="16"
onCopy={e => {
e.preventDefault();
}}
onPaste={e => {
// 禁止粘贴
e.preventDefault();
}}
/>
</Form.Item> </Form.Item>
<div <div
className={classNames(styles.tipsText, { className={classNames(styles.tipsText, {
......
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