trunk/pc4mobx/organization/components/resource/SearchCustomDialog.js

83 lines
2.3 KiB
JavaScript
Raw Normal View History

2023-01-05 18:02:33 +08:00
import {
observer
} from 'mobx-react';
import {
WeaDialog,
2023-01-11 18:22:30 +08:00
WeaFormItem,
2024-06-14 16:25:07 +08:00
WeaInput,
WeaLocaleProvider
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;
2024-06-14 16:25:07 +08:00
const getLabel = WeaLocaleProvider.getLabel;
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({
2024-06-14 16:25:07 +08:00
title: getLabel(547548,'存为模板'),
2023-01-11 18:22:30 +08:00
content:
<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@62kt85`}
2024-06-14 16:25:07 +08:00
label= {getLabel(547581,'列定制模板名称')}
2023-01-11 18:22:30 +08:00
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 = [
2024-06-14 16:25:07 +08:00
<Button type='primary' onClick={()=> search ? store.saveHrmSearchUserDefine() : store.saveCustomDefine()}>{getLabel(547360,'保存')}</Button>,
<Button type='primary' onClick={()=> this.saveCustomTemplate()}>{getLabel(547548,'存为模板')}</Button>,
<Button type='primary' onClick={()=> store.getEditTable()}>{getLabel(547582,'模板管理')}</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
2024-06-14 16:25:07 +08:00
title={search ? getLabel(547549,'常用条件定制') : getLabel(547136,'显示列定制')}
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>
);
}
}