职务分类新增和编辑成功列表查询失败的bug,以及新增时表单接口的调整
This commit is contained in:
parent
6e152af3a2
commit
b5334c6830
|
|
@ -67,16 +67,13 @@ class LeftTree extends Component {
|
|||
this.setState({ rightClickNodeTreeItem: null });
|
||||
};
|
||||
onSelect = node => {
|
||||
const [postId] = node;
|
||||
const { officeManageStore } = this.props;
|
||||
officeManageStore.setOfficeClassifyId(
|
||||
!postId
|
||||
? officeManageStore.officeClassifyId
|
||||
: postId !== "-1" ? postId : ""
|
||||
);
|
||||
officeManageStore.getPostInfoTable(!postId
|
||||
const [postId] = node;
|
||||
const officeId = !postId
|
||||
? officeManageStore.officeClassifyId
|
||||
: postId !== "-1" ? postId : "");
|
||||
: postId !== "-1" ? postId : "";
|
||||
officeManageStore.setOfficeClassifyId(officeId);
|
||||
officeManageStore.getPostInfoTable(officeId);
|
||||
this.setState({
|
||||
rightClickNodeTreeItem: null
|
||||
});
|
||||
|
|
|
|||
|
|
@ -56,11 +56,11 @@ export default class OfficeManage extends Component {
|
|||
|
||||
handleMenuClick = key => {
|
||||
const { officeManageStore } = this.props;
|
||||
const { isPanelShow, tableStore } = officeManageStore;
|
||||
const { isPanelShow, tableStore, officeClassifyId } = officeManageStore;
|
||||
isPanelShow && officeManageStore.setPanelStatus(false);
|
||||
switch (key) {
|
||||
case "new":
|
||||
officeManageStore.getPostInfoForm();
|
||||
officeManageStore.getPostInfoForm({ planId: officeClassifyId });
|
||||
officeManageStore.setVisible(true);
|
||||
officeManageStore.setNeDialogTitle(i18n.label.newOfficeName());
|
||||
break;
|
||||
|
|
@ -137,7 +137,7 @@ export default class OfficeManage extends Component {
|
|||
if (item.menuFun == "new") {
|
||||
officeManageStore.isPanelShow &&
|
||||
officeManageStore.setPanelStatus(false);
|
||||
officeManageStore.getPostInfoForm();
|
||||
officeManageStore.getPostInfoForm({ planId: officeClassifyId });
|
||||
officeManageStore.setVisible(true);
|
||||
officeManageStore.setNeDialogTitle(i18n.label.newOfficeName());
|
||||
} else if (
|
||||
|
|
@ -223,7 +223,7 @@ export default class OfficeManage extends Component {
|
|||
deletePostinfoByIds({ ids }).then(({ code, msg }) => {
|
||||
if (code === 200) {
|
||||
message.success("删除成功");
|
||||
officeManageStore.getPostInfoTable();
|
||||
officeManageStore.getPostInfoTable(officeManageStore.officeClassifyId);
|
||||
} else {
|
||||
message.error(msg || "删除失败");
|
||||
}
|
||||
|
|
@ -268,7 +268,7 @@ export default class OfficeManage extends Component {
|
|||
updateForbiddenTagById(payload).then(({ code, msg }) => {
|
||||
if (code === 200) {
|
||||
message.success("操作成功");
|
||||
officeManageStore.getPostInfoTable();
|
||||
officeManageStore.getPostInfoTable(officeManageStore.officeClassifyId);
|
||||
} else {
|
||||
message.error(msg || "操作失败");
|
||||
}
|
||||
|
|
@ -283,7 +283,7 @@ export default class OfficeManage extends Component {
|
|||
this.setState({ editId });
|
||||
const { officeManageStore } = this.props;
|
||||
officeManageStore.isPanelShow && officeManageStore.setPanelStatus(false);
|
||||
officeManageStore.getPostInfoForm(editId);
|
||||
officeManageStore.getPostInfoForm({ id: editId });
|
||||
officeManageStore.setVisible(true);
|
||||
officeManageStore.setNeDialogTitle(i18n.label.editOfficeName());
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,8 +1,6 @@
|
|||
import { observable, action, toJS } from "mobx";
|
||||
import { WeaForm } from "comsMobx";
|
||||
import { WeaTableNew } from "comsMobx";
|
||||
import { Modal, message } from "antd";
|
||||
import { i18n } from "../public/i18n";
|
||||
import { action, observable } from "mobx";
|
||||
import { WeaForm, WeaTableNew } from "comsMobx";
|
||||
import { message } from "antd";
|
||||
import * as API from "../apis/officeManage";
|
||||
import _ from "lodash";
|
||||
|
||||
|
|
@ -69,13 +67,12 @@ export class OfficeManageStore {
|
|||
}
|
||||
|
||||
@action("获取新增/编辑表单")
|
||||
getPostInfoForm(id) {
|
||||
getPostInfoForm(params) {
|
||||
this.setDialogLoadingStatus(true);
|
||||
API.getPostInfoForm({ id }).then(res => {
|
||||
API.getPostInfoForm(params).then(res => {
|
||||
this.setDialogLoadingStatus(false);
|
||||
const { code, data, msg } = res;
|
||||
if (code === 200) {
|
||||
console.log();
|
||||
data.condition && this.setCondition(data.condition);
|
||||
data.condition && this.form.initFormFields(data.condition);
|
||||
} else {
|
||||
|
|
@ -83,6 +80,7 @@ export class OfficeManageStore {
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
@action("获取表格数据")
|
||||
getPostInfoTable(postId) {
|
||||
let params;
|
||||
|
|
@ -95,8 +93,8 @@ export class OfficeManageStore {
|
|||
};
|
||||
} else {
|
||||
params = {
|
||||
postId,
|
||||
...this.form2.getFormParams()
|
||||
...this.form2.getFormParams(),
|
||||
postId
|
||||
};
|
||||
}
|
||||
API.getPostInfoTable(params).then(res => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue