Commit c10dfd99 authored by 邓超's avatar 邓超

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

parent 4bd8784e
Pipeline #60976 passed with stages
......@@ -422,12 +422,6 @@ const TableView = props => {
};
// 添加字段
const handleAdd = () => {
// let box = document.getElementById('box');
// let v = document.getElementsByClassName('ant-table-body')[0];
// if (v) {
// v.scrollTop = 500;
// }
scrollToAnchor();
const newData = {
keyIndex: count,
Name: '',
......@@ -438,13 +432,12 @@ const TableView = props => {
};
setDataSource([...dataSource, newData]);
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 = () => {
if (selectedRowKeys.length === 0) {
......
......@@ -27,6 +27,8 @@ const AddUserModal = props => {
if (visible) {
addUserForm.resetFields();
getEmptyRoleList();
} else {
setPasswordLevel('');
}
}, [orgID, visible]);
......@@ -247,9 +249,20 @@ const AddUserModal = props => {
{ 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>
<div
style={{ right: '70px' }}
className={classNames(styles.tipsText, {
[styles.tipsRed]: passwordLevel === '弱',
[styles.tipsOrange]: passwordLevel === '中',
......
......@@ -8,7 +8,9 @@
.formBox {
position: relative;
.ant-input-password-icon {
margin-top: 6px;
}
.tipsText {
position: absolute;
right: 40px;
......
......@@ -19,6 +19,9 @@ const ChangePasswordModal = props => {
newPassword: '',
passwordConfirm: '',
});
} else {
setNewPasswordLevel('');
setPasswordConfirmLevel('');
}
}, [visible]);
......@@ -144,8 +147,6 @@ const ChangePasswordModal = props => {
newPassword: '',
passwordConfirm: '',
});
setNewPasswordLevel('');
setPasswordConfirmLevel('');
onCancel();
}}
okText="确认"
......@@ -168,7 +169,18 @@ const ChangePasswordModal = props => {
{ 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>
<div
className={classNames(styles.tipsText, {
......@@ -192,7 +204,18 @@ const ChangePasswordModal = props => {
{ 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>
<div
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