custom/大成
This commit is contained in:
parent
4a386102ef
commit
85cdbbe8b2
|
|
@ -19,7 +19,8 @@ import {
|
||||||
WeaSelect,
|
WeaSelect,
|
||||||
WeaTab,
|
WeaTab,
|
||||||
WeaTable,
|
WeaTable,
|
||||||
WeaTextarea
|
WeaTextarea,
|
||||||
|
WeaTools
|
||||||
} from "ecCom";
|
} from "ecCom";
|
||||||
import { commonEnumList } from "../../../../apis/archive";
|
import { commonEnumList } from "../../../../apis/archive";
|
||||||
import EditRoleDialog from "./editRoleDialog";
|
import EditRoleDialog from "./editRoleDialog";
|
||||||
|
|
@ -32,6 +33,7 @@ import { roleConditions } from "../conditions";
|
||||||
import { getSearchs } from "../../../../util";
|
import { getSearchs } from "../../../../util";
|
||||||
|
|
||||||
const getLabel = WeaLocaleProvider.getLabel;
|
const getLabel = WeaLocaleProvider.getLabel;
|
||||||
|
const getKey = WeaTools.getKey;
|
||||||
const APIFOX = {
|
const APIFOX = {
|
||||||
"auth.MemberTargetTypeEnum": API.authMemberList,
|
"auth.MemberTargetTypeEnum": API.authMemberList,
|
||||||
"save.auth.MemberTargetTypeEnum": API.saveAuthMember,
|
"save.auth.MemberTargetTypeEnum": API.saveAuthMember,
|
||||||
|
|
@ -72,12 +74,33 @@ class Index extends Component {
|
||||||
getRole = (id) => {
|
getRole = (id) => {
|
||||||
API.getRole({ id }).then(({ status, data }) => {
|
API.getRole({ id }).then(({ status, data }) => {
|
||||||
if (status) {
|
if (status) {
|
||||||
console.log(data);
|
|
||||||
this.setState({
|
this.setState({
|
||||||
conditions: _.map(roleConditions, item => ({
|
conditions: _.map(roleConditions, item => ({
|
||||||
...item, items: _.map(item.items, o => ({ ...o, label: getLabel(o.lanId, o.label) }))
|
...item, items: _.map(item.items, o => {
|
||||||
}))
|
if (getKey(o) === "taxAgentIds" || getKey(o) === "sobIds") {
|
||||||
}, () => this.props.taxAgentStore.roleForm.initFormFields(this.state.conditions));
|
return {
|
||||||
|
...o, label: getLabel(o.lanId, o.label),
|
||||||
|
value: _.map(data[getKey(o)], i => String(i.id)).join(","),
|
||||||
|
browserConditionParam: {
|
||||||
|
...o.browserConditionParam,
|
||||||
|
replaceDatas: _.map(data[getKey(o)], i => ({ id: String(i.id), name: i.name }))
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return { ...o, label: getLabel(o.lanId, o.label) };
|
||||||
|
})
|
||||||
|
})),
|
||||||
|
formData: {
|
||||||
|
taxAgentIds: _.map(data["taxAgentIds"], i => ({ id: String(i.id), name: i.name })),
|
||||||
|
sobIds: _.map(data["sobIds"], i => ({ id: String(i.id), name: i.name }))
|
||||||
|
}
|
||||||
|
}, () => {
|
||||||
|
this.props.taxAgentStore.roleForm.initFormFields(this.state.conditions);
|
||||||
|
this.props.taxAgentStore.roleForm.updateFields({
|
||||||
|
name: { value: data.name },
|
||||||
|
description: { value: data.description }
|
||||||
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
@ -206,6 +229,7 @@ class Index extends Component {
|
||||||
this.setState({ loading: { ...this.state.loading, set: false } });
|
this.setState({ loading: { ...this.state.loading, set: false } });
|
||||||
if (status) {
|
if (status) {
|
||||||
message.success(getLabel(111, "操作成功!"));
|
message.success(getLabel(111, "操作成功!"));
|
||||||
|
this.props.onSearch && this.props.onSearch();
|
||||||
} else {
|
} else {
|
||||||
message.error(errormsg);
|
message.error(errormsg);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@
|
||||||
* @description:
|
* @description:
|
||||||
*/
|
*/
|
||||||
import React, { Component } from "react";
|
import React, { Component } from "react";
|
||||||
|
import { inject, observer } from "mobx-react";
|
||||||
import { WeaInputSearch, WeaLocaleProvider, WeaTable, WeaTop } from "ecCom";
|
import { WeaInputSearch, WeaLocaleProvider, WeaTable, WeaTop } from "ecCom";
|
||||||
import { Button, message, Modal } from "antd";
|
import { Button, message, Modal } from "antd";
|
||||||
import * as API from "../../apis/taxAgent";
|
import * as API from "../../apis/taxAgent";
|
||||||
|
|
@ -17,6 +18,8 @@ import RoleDetailSetDialog from "./components/roleDetailSetDialog";
|
||||||
|
|
||||||
const getLabel = WeaLocaleProvider.getLabel;
|
const getLabel = WeaLocaleProvider.getLabel;
|
||||||
|
|
||||||
|
@inject("taxAgentStore")
|
||||||
|
@observer
|
||||||
class Index extends Component {
|
class Index extends Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
|
|
@ -122,7 +125,10 @@ class Index extends Component {
|
||||||
<RoleDetailSetDialog {...roleSetDialog} onSearch={this.getRoleList}
|
<RoleDetailSetDialog {...roleSetDialog} onSearch={this.getRoleList}
|
||||||
onCancel={callback => this.setState({
|
onCancel={callback => this.setState({
|
||||||
roleSetDialog: { ...roleSetDialog, visible: false }
|
roleSetDialog: { ...roleSetDialog, visible: false }
|
||||||
}, () => callback && callback())}/>
|
}, () => {
|
||||||
|
this.props.taxAgentStore.initRoleForm();
|
||||||
|
callback && callback();
|
||||||
|
})}/>
|
||||||
</div>
|
</div>
|
||||||
</WeaTop>
|
</WeaTop>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue