Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new feature: quickly add records by copying on the /config/pluginhandle page #324

Merged
merged 2 commits into from
Aug 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,15 @@ body,
.close {
color: #ff586d;
}

.optionParts {
display: flex;
justify-content: center;

div:first-child {
margin-right: 16px;
}
}
}

:global(.ant-layout) {
Expand Down
1 change: 1 addition & 0 deletions src/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"SHENYU.COMMON.SYN": "Synchronous",
"SHENYU.COMMON.ADD.RULE": "Add",
"SHENYU.COMMON.ADD": "Add",
"SHENYU.COMMON.COPY": "Copy",
"SHENYU.COMMON.INPUTNAME": "InputName",
"SHENYU.COMMON.TYPE": "Type",
"SHENYU.COMMON.INPUTTYPE": "InputType",
Expand Down
1 change: 1 addition & 0 deletions src/locales/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"SHENYU.COMMON.SYN": "同步自定义",
"SHENYU.COMMON.ADD.RULE": "添加规则",
"SHENYU.COMMON.ADD": "新增",
"SHENYU.COMMON.COPY": "复制",
"SHENYU.COMMON.INPUTNAME": "请输入名称",
"SHENYU.COMMON.TYPE": "类型",
"SHENYU.COMMON.INPUTTYPE": "请输入类型",
Expand Down
3 changes: 1 addition & 2 deletions src/routes/System/Plugin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import AddModal from "./AddModal";
import { getCurrentLocale, getIntlContent } from "../../../utils/IntlUtils";
import AuthButton from "../../../utils/AuthButton";
import { resetAuthMenuCache } from "../../../utils/AuthRoute";
import styles from "./index.less";

const { Text } = Typography;

Expand Down Expand Up @@ -452,7 +451,7 @@ export default class Plugin extends Component {
fixed: "right",
render: (text, record) => {
return (
<div className={styles.optionParts}>
<div className="optionParts">
<AuthButton perms="system:plugin:edit">
<div
className="edit"
Expand Down
8 changes: 0 additions & 8 deletions src/routes/System/Plugin/index.less

This file was deleted.

66 changes: 41 additions & 25 deletions src/routes/System/PluginHandle/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export default class PluginHandle extends Component {
this.setState({ currentPage: 1}, this.query);
};

editClick = record => {
editClick = (record, copy) => {
const { dispatch } = this.props;
const { currentPage,pageSize } = this.state;
this.loadPluginDict()
Expand Down Expand Up @@ -154,21 +154,25 @@ export default class PluginHandle extends Component {
'rule':rule || ""
})
}
let payload = {
field,
label,
id,
pluginId,
dataType,
type,
sort,
defaultValue,
placeholder,
rule,
extObj
};
if (copy) {
delete payload.id;
}
dispatch({
type: "pluginHandle/update",
payload: {
field,
label,
id,
pluginId,
dataType,
type,
sort,
defaultValue,
placeholder,
rule,
extObj
},
type: `pluginHandle/${copy ? 'add' : 'update'}`,
payload,
fetchValue: {
currentPage,
pageSize
Expand Down Expand Up @@ -425,16 +429,28 @@ export default class PluginHandle extends Component {
width: 100,
render: (text, record) => {
return (
<AuthButton perms="system:pluginHandler:edit">
<div
className="edit"
onClick={() => {
this.editClick(record);
}}
>
{getIntlContent("SHENYU.SYSTEM.EDITOR")}
</div>
</AuthButton>
<div className="optionParts">
<AuthButton perms="system:pluginHandler:edit">
<div
className="edit"
onClick={() => {
this.editClick(record);
}}
>
{getIntlContent("SHENYU.SYSTEM.EDITOR")}
</div>
</AuthButton>
<AuthButton perms="system:pluginHandler:add">
<div
className="edit"
onClick={() => {
this.editClick(record, true);
}}
>
{getIntlContent("SHENYU.COMMON.COPY")}
</div>
</AuthButton>
</div>
);
}
}
Expand Down
Loading