修复转移页面

This commit is contained in:
Chengliang 2022-06-07 09:34:25 +08:00
parent 2b34890e6d
commit 772f0b66ee
3 changed files with 41 additions and 23 deletions

View File

@ -23,38 +23,61 @@ export default class NewPopconfirm extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
padding: "20px" value: '0'
} }
} }
renderComponent(field, index,form) {
return <WeaFormItem style={{ margin: "10px" }} ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@jacv6v@${index}`}
label={`${field.label}`}
labelCol={{ span: `${field.labelcol}` }}
error={form.getError(field)}
tipPosition="bottom"
wrapperCol={{ span: `${field.fieldcol}` }}>
{<WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@7vxyfr@${index}`} fieldConfig={field} form={form} formParams={form.getFormParams()}
onChange={this.onChange} />}
</WeaFormItem>
}
getForm() { getForm() {
const { const {
condition, condition,
form, form,
isFormInit, isFormInit,
} = this.props; isMerge
} = this.props, {
value
} = this.state;
let arr = []; let arr = [];
isFormInit && condition.map(c => { isFormInit && condition.map(c => {
c.items.map((field, index) => { c.items.map((field, index) => {
arr.push(<WeaFormItem style={{ margin: "10px" }} ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@jacv6v@${index}`} if(!isMerge){
label={`${field.label}`} if (field.domkey[0] !== 'company' && field.domkey[0] !== 'department') {
labelCol={{ span: `${field.labelcol}` }} arr.push(
error={form.getError(field)} this.renderComponent(field,index,form)
tipPosition="bottom" )
wrapperCol={{ span: `${field.fieldcol}` }}> }
{<WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@7vxyfr@${index}`} fieldConfig={field} form={form} formParams={form.getFormParams()} value === '0' && field.domkey[0] === 'company' && arr.push(
onChange={this.onChange} />} this.renderComponent(field,index,form)
</WeaFormItem>) )
value === '1' && field.domkey[0] === 'department' && arr.push(
this.renderComponent(field,index,form)
)
}else{
arr.push(
this.renderComponent(field,index,form))
}
}) })
}) })
return <div className="wea-form-item-group">{arr}</div> return <div className="wea-form-item-group">{arr}</div>
} }
onChange = data => { onChange = data => {
debugger data.moveType && this.setState({
value:data.moveType.value
})
}; };
render() { render() {
@ -66,9 +89,7 @@ export default class NewPopconfirm extends React.Component {
loading, loading,
height, height,
width width
} = this.props, { } = this.props
padding
} = this.state;
const buttons = [ const buttons = [
(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@jd6baw`} type="primary" onClick={() => save()} disabled={loading}>{i18n.button.ok()}</Button>), (<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@jd6baw`} type="primary" onClick={() => save()} disabled={loading}>{i18n.button.ok()}</Button>),

View File

@ -1,7 +1,7 @@
/** /**
* @Author: 程亮 * @Author: 程亮
* @Date: 2022-06-02 09:19:37 * @Date: 2022-06-02 09:19:37
* @LastEditTime: 2022-06-06 16:40:18 * @LastEditTime: 2022-06-06 19:32:11
* @Description: * @Description:
* @FilePath: /trunk/src4js/pc4mobx/organization/components/department/department.js * @FilePath: /trunk/src4js/pc4mobx/organization/components/department/department.js
*/ */
@ -640,7 +640,7 @@
form={form1} form={form1}
isFormInit={form1.isFormInit} isFormInit={form1.isFormInit}
loading={confirmLoading} loading={confirmLoading}
height={isMerge ? 100 : 140} height={100}
width={400} width={400}
isMerge={isMerge} isMerge={isMerge}
save={() => this.PopconfirmSave()} save={() => this.PopconfirmSave()}

View File

@ -113,9 +113,7 @@ export class DepartmentStore {
let params = { let params = {
parentDept: id parentDept: id
} }
Api.getPostionTable(params).then(response => { Api.getPostionTable(params).then(res => {
return response.json()
}).then(res => {
if (res.code === 200) { if (res.code === 200) {
res.data.list && this.setPostionDataSource(res.data.list); res.data.list && this.setPostionDataSource(res.data.list);
res.data.columns && this.setPostionColumns(res.data.columns); res.data.columns && this.setPostionColumns(res.data.columns);
@ -123,7 +121,7 @@ export class DepartmentStore {
} else { } else {
message.warning(res.msg); message.warning(res.msg);
} }
}).catch(error => { },error => {
message.warning(error.msg); message.warning(error.msg);
}) })
} }
@ -343,7 +341,6 @@ export class DepartmentStore {
if (data.code === 200) { if (data.code === 200) {
message.success(data.msg); message.success(data.msg);
this.getTableInfo(); this.getTableInfo();
this.form2 = new WeaForm();
this.setSelectedRowKeys(''); this.setSelectedRowKeys('');
} else { } else {
message.error(data.msg); message.error(data.msg);