2023-01-05 18:02:33 +08:00
|
|
|
import {
|
|
|
|
|
observer
|
|
|
|
|
} from 'mobx-react';
|
|
|
|
|
import {
|
|
|
|
|
WeaDialog,
|
2023-01-11 18:22:30 +08:00
|
|
|
WeaFormItem,
|
|
|
|
|
WeaInput
|
2023-01-05 18:02:33 +08:00
|
|
|
} from 'ecCom';
|
2023-01-06 18:01:46 +08:00
|
|
|
import Customization from './Customization';
|
2023-01-10 18:23:25 +08:00
|
|
|
import {
|
|
|
|
|
Spin,
|
2023-01-11 18:22:30 +08:00
|
|
|
Button,Modal
|
2023-01-10 18:23:25 +08:00
|
|
|
} from 'antd'
|
2023-01-11 18:22:30 +08:00
|
|
|
import {
|
|
|
|
|
i18n
|
|
|
|
|
} from '../../public/i18n';
|
|
|
|
|
const confirm = Modal.confirm;
|
2023-01-05 18:02:33 +08:00
|
|
|
|
|
|
|
|
@observer
|
|
|
|
|
export default class SearchCustomDialog extends React.Component {
|
|
|
|
|
constructor(props) {
|
|
|
|
|
super(props);
|
|
|
|
|
}
|
|
|
|
|
|
2023-01-11 18:22:30 +08:00
|
|
|
|
|
|
|
|
saveCustomTemplate() {
|
|
|
|
|
const {
|
|
|
|
|
store
|
|
|
|
|
} = this.props, {
|
|
|
|
|
customTemplateName
|
|
|
|
|
} = store;
|
|
|
|
|
|
|
|
|
|
confirm({
|
|
|
|
|
title: "存为模板",
|
|
|
|
|
content:
|
|
|
|
|
<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@62kt85`}
|
|
|
|
|
label="列定制模板名称"
|
|
|
|
|
labelCol={{ span: 10 }}
|
|
|
|
|
wrapperCol={{ span: 14 }}>
|
|
|
|
|
<WeaInput ecId={`${this && this.props && this.props.ecId || ''}_WeaInput@j9bmvw`} viewAttr="3" value={customTemplateName} {...window.inputType} onChange={v => store.customTemplateName = v} />
|
|
|
|
|
</WeaFormItem>,
|
|
|
|
|
okText: i18n.button.save(),
|
|
|
|
|
cancelText: i18n.button.cancel(),
|
|
|
|
|
onOk() {
|
|
|
|
|
store.saveCustomTemplate();
|
|
|
|
|
},
|
|
|
|
|
onCancel() {
|
|
|
|
|
return false;
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2023-01-05 18:02:33 +08:00
|
|
|
render() {
|
|
|
|
|
const {
|
2023-01-11 18:22:30 +08:00
|
|
|
store,
|
2023-01-06 18:01:46 +08:00
|
|
|
} = this.props, {
|
|
|
|
|
SEARCHDIALOG,
|
2023-01-10 18:23:25 +08:00
|
|
|
searchDialog,
|
2023-01-11 18:22:30 +08:00
|
|
|
search,
|
|
|
|
|
searchTemplateName
|
2023-01-06 18:01:46 +08:00
|
|
|
} = store;
|
2023-01-10 18:23:25 +08:00
|
|
|
const buttons = [
|
2023-01-13 14:37:03 +08:00
|
|
|
<Button type='primary' onClick={()=> search ? store.saveHrmSearchUserDefine() : store.saveCustomDefine()}>保存</Button>,
|
2023-01-11 18:22:30 +08:00
|
|
|
<Button type='primary' onClick={()=> this.saveCustomTemplate()}>存为模板</Button>,
|
|
|
|
|
<Button type='primary' onClick={()=> store.getEditTable()}>模板管理</Button>
|
2023-01-10 18:23:25 +08:00
|
|
|
]
|
|
|
|
|
|
2023-01-05 18:02:33 +08:00
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<WeaDialog
|
2023-01-06 18:01:46 +08:00
|
|
|
{...SEARCHDIALOG}
|
|
|
|
|
{...searchDialog}
|
2023-01-10 18:23:25 +08:00
|
|
|
buttons={search ? buttons.slice(0, 1) : buttons}
|
2023-01-06 18:01:46 +08:00
|
|
|
initLoadCss
|
2023-01-10 18:23:25 +08:00
|
|
|
title={search ? '常用条件定制':'列定制'}
|
2023-01-05 18:02:33 +08:00
|
|
|
>
|
2023-01-06 18:01:46 +08:00
|
|
|
<Customization store={store}/>
|
2023-01-05 18:02:33 +08:00
|
|
|
</WeaDialog>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|