Merge pull request 'feature/cl' (#30) from feature/cl into dev
Reviewed-on: http://221.226.25.34:3000/liang.cheng/trunk/pulls/30
This commit is contained in:
commit
8df95c873e
|
|
@ -15,3 +15,15 @@ export const getPersonnelResume = (params) => {
|
||||||
export const getAdvanceSearchCondition = (params) => {
|
export const getAdvanceSearchCondition = (params) => {
|
||||||
return WeaTools.callApi('/api/bs/hrmorganization/personnelresume/personnelScreening', 'GET', params);
|
return WeaTools.callApi('/api/bs/hrmorganization/personnelresume/personnelScreening', 'GET', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const downloadPerResume = (type) => {
|
||||||
|
fetch(`/api/bs/hrmorganization/personnelresume/downloadPerResume?type=${type}`).then(res => res.blob().then(blob => {
|
||||||
|
var filename= type == 0 ? `人员简历合并导出.docx` : `全部简历.zip`
|
||||||
|
var a = document.createElement('a');
|
||||||
|
var url = window.URL.createObjectURL(blob);
|
||||||
|
a.href = url;
|
||||||
|
a.download = filename;
|
||||||
|
a.click();
|
||||||
|
window.URL.revokeObjectURL(url);
|
||||||
|
}))
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,43 @@
|
||||||
|
import {
|
||||||
|
observer
|
||||||
|
} from 'mobx-react';
|
||||||
|
import {
|
||||||
|
WeaTransfer,
|
||||||
|
} from 'ecCom';
|
||||||
|
import {
|
||||||
|
toJS
|
||||||
|
} from 'mobx';
|
||||||
|
import isEmpty from 'lodash/isEmpty'
|
||||||
|
|
||||||
|
@observer
|
||||||
|
export default class Customization extends React.Component {
|
||||||
|
constructor(props) {
|
||||||
|
super(props);
|
||||||
|
}
|
||||||
|
|
||||||
|
render() {
|
||||||
|
const {
|
||||||
|
store
|
||||||
|
} = this.props, {
|
||||||
|
TRANSFER,
|
||||||
|
transfer,
|
||||||
|
leftHeader,
|
||||||
|
rightHeader,
|
||||||
|
} = store, {
|
||||||
|
transferDatas,
|
||||||
|
transferKeys
|
||||||
|
} = transfer;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className='customization' style={{padding: 20}}>
|
||||||
|
<WeaTransfer
|
||||||
|
{...TRANSFER}
|
||||||
|
data={toJS(transferDatas)}
|
||||||
|
selectedKeys={toJS(transferKeys)}
|
||||||
|
leftHeader={leftHeader}
|
||||||
|
rightHeader={rightHeader}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -193,6 +193,7 @@ export default class PersonnelResume extends React.Component {
|
||||||
this[item.menuFun] && this[item.menuFun]();
|
this[item.menuFun] && this[item.menuFun]();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//模板修改
|
||||||
handleChange(value) {
|
handleChange(value) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -268,6 +269,22 @@ export default class PersonnelResume extends React.Component {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//合并导出
|
||||||
|
mergeExport() {
|
||||||
|
const {
|
||||||
|
personnelResume
|
||||||
|
} = this.props;
|
||||||
|
personnelResume.downloadPerResume(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
//全部导出
|
||||||
|
allExport() {
|
||||||
|
const {
|
||||||
|
personnelResume
|
||||||
|
} = this.props;
|
||||||
|
personnelResume.downloadPerResume(1);
|
||||||
|
}
|
||||||
|
|
||||||
isEmptyObject(obj) {
|
isEmptyObject(obj) {
|
||||||
for (let key in obj) {
|
for (let key in obj) {
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -413,7 +430,7 @@ export default class PersonnelResume extends React.Component {
|
||||||
form={form}
|
form={form}
|
||||||
isFormInit={form.isFormInit}
|
isFormInit={form.isFormInit}
|
||||||
loading={dialogLoading}
|
loading={dialogLoading}
|
||||||
height={200}
|
height={120}
|
||||||
conditionLen={1}
|
conditionLen={1}
|
||||||
search={() => this.onSelect()}
|
search={() => this.onSelect()}
|
||||||
onCancel={() => personnelResume.show = ! show}
|
onCancel={() => personnelResume.show = ! show}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,33 @@
|
||||||
|
import {
|
||||||
|
observer
|
||||||
|
} from 'mobx-react';
|
||||||
|
import {
|
||||||
|
WeaDialog,
|
||||||
|
} from 'ecCom';
|
||||||
|
import Customization from './Customization';
|
||||||
|
|
||||||
|
@observer
|
||||||
|
export default class SearchCustomDialog extends React.Component {
|
||||||
|
constructor(props) {
|
||||||
|
super(props);
|
||||||
|
}
|
||||||
|
|
||||||
|
render() {
|
||||||
|
const {
|
||||||
|
store
|
||||||
|
} = this.props, {
|
||||||
|
SEARCHDIALOG,
|
||||||
|
searchDialog
|
||||||
|
} = store;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<WeaDialog
|
||||||
|
{...SEARCHDIALOG}
|
||||||
|
{...searchDialog}
|
||||||
|
initLoadCss
|
||||||
|
>
|
||||||
|
<Customization store={store}/>
|
||||||
|
</WeaDialog>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -11,7 +11,9 @@ import {
|
||||||
WeaRightMenu,
|
WeaRightMenu,
|
||||||
WeaLeftRightLayout,
|
WeaLeftRightLayout,
|
||||||
WeaOrgTree,
|
WeaOrgTree,
|
||||||
WeaDropdown
|
WeaDropdown,
|
||||||
|
WeaSelect,
|
||||||
|
WeaSearchGroup
|
||||||
} from 'ecCom'
|
} from 'ecCom'
|
||||||
import {
|
import {
|
||||||
Row,
|
Row,
|
||||||
|
|
@ -21,6 +23,7 @@ import {
|
||||||
Button,
|
Button,
|
||||||
message,
|
message,
|
||||||
Switch,
|
Switch,
|
||||||
|
Select,
|
||||||
Menu, Dropdown, Icon
|
Menu, Dropdown, Icon
|
||||||
} from 'antd'
|
} from 'antd'
|
||||||
import {
|
import {
|
||||||
|
|
@ -36,6 +39,7 @@ import '../../style/common.less';
|
||||||
import NewAndEditDialog from '../NewAndEditDialog';
|
import NewAndEditDialog from '../NewAndEditDialog';
|
||||||
import { renderNoright } from '../../util';
|
import { renderNoright } from '../../util';
|
||||||
import DatasImport from '../import/datasImport';
|
import DatasImport from '../import/datasImport';
|
||||||
|
import SearchCustomDialog from './SearchCustomDialog';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -74,14 +78,14 @@ export default class Resource extends React.Component {
|
||||||
resource
|
resource
|
||||||
} = this.props;
|
} = this.props;
|
||||||
resource.getHasRight();
|
resource.getHasRight();
|
||||||
let {hash} = window.location;
|
let { hash } = window.location;
|
||||||
hash = hash.split("?")[1].split("&");
|
hash = hash.split("?")[1].split("&");
|
||||||
if(hash.length >= 2) {
|
if (hash.length >= 2) {
|
||||||
let params = {};
|
let params = {};
|
||||||
let arr = hash[0].split("=");
|
let arr = hash[0].split("=");
|
||||||
params[arr[0]] = arr[1];
|
params[arr[0]] = arr[1];
|
||||||
resource.doSearch(params);
|
resource.doSearch(params);
|
||||||
}else {
|
} else {
|
||||||
resource.getTableInfo();
|
resource.getTableInfo();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -189,11 +193,11 @@ export default class Resource extends React.Component {
|
||||||
if (key == "1") {
|
if (key == "1") {
|
||||||
resource.export();
|
resource.export();
|
||||||
}
|
}
|
||||||
if(key == "2") {
|
if (key == "2") {
|
||||||
tableStore.selectedRowKeys.length > 0 ? resource.export() : message.error("请选择需要导出的数据")
|
tableStore.selectedRowKeys.length > 0 ? resource.export() : message.error("请选择需要导出的数据")
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
menuOnClick={(key, e) => key == '1' ? tableStore.selectedRowKeys = []: ''}
|
menuOnClick={(key, e) => key == '1' ? tableStore.selectedRowKeys = [] : ''}
|
||||||
/>)
|
/>)
|
||||||
|
|
||||||
return btns;
|
return btns;
|
||||||
|
|
@ -228,7 +232,7 @@ export default class Resource extends React.Component {
|
||||||
// resource.setIsNew(true);
|
// resource.setIsNew(true);
|
||||||
// resource.setVisible(true);
|
// resource.setVisible(true);
|
||||||
// resource.getForm();
|
// resource.getForm();
|
||||||
window.open("/spa/hrm/index_mobx.html#/main/hrm/add","_blank")
|
window.open("/spa/hrm/index_mobx.html#/main/hrm/add", "_blank")
|
||||||
}
|
}
|
||||||
|
|
||||||
import() {
|
import() {
|
||||||
|
|
@ -286,7 +290,9 @@ export default class Resource extends React.Component {
|
||||||
|
|
||||||
const btn = [
|
const btn = [
|
||||||
(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@bx87i8`} type="primary" onClick={() => { resource.getTableInfo(); resource.setPanelStatus(false) }}>{i18n.button.search()}</Button>),
|
(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@bx87i8`} type="primary" onClick={() => { resource.getTableInfo(); resource.setPanelStatus(false) }}>{i18n.button.search()}</Button>),
|
||||||
(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@218ju6`} onClick={() => form2.reset()}>{i18n.button.reset()}</Button>),
|
(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@218ju6`} type="primary" onClick={() => resource.openSearchDialog()}>{i18n.button.saveTemplate()}</Button>),
|
||||||
|
(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@218ju7`} type="primary" onClick={() => resource.openSearchDialog()}>{i18n.button.conditionSet()}</Button>),
|
||||||
|
(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@218ju8`} onClick={() => form2.reset()}>{i18n.button.reset()}</Button>),
|
||||||
(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@5u9mfz`} onClick={() => resource.setPanelStatus(false)}>{i18n.button.cancel()}</Button>),
|
(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@5u9mfz`} onClick={() => resource.setPanelStatus(false)}>{i18n.button.cancel()}</Button>),
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
@ -372,7 +378,8 @@ export default class Resource extends React.Component {
|
||||||
!isNew && resource.edit();
|
!isNew && resource.edit();
|
||||||
}
|
}
|
||||||
|
|
||||||
handleSaveAndSetting() {
|
//高级搜索模板修改
|
||||||
|
handleTemplateChange() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -381,9 +388,10 @@ export default class Resource extends React.Component {
|
||||||
resource
|
resource
|
||||||
} = this.props;
|
} = this.props;
|
||||||
const {
|
const {
|
||||||
searchCondition,
|
defaultCondition,
|
||||||
form2,
|
form2,
|
||||||
searchConditionLoading
|
searchConditionLoading,
|
||||||
|
templates
|
||||||
} = resource;
|
} = resource;
|
||||||
|
|
||||||
let arr = [];
|
let arr = [];
|
||||||
|
|
@ -392,21 +400,39 @@ export default class Resource extends React.Component {
|
||||||
isFormInit
|
isFormInit
|
||||||
} = form2;
|
} = form2;
|
||||||
|
|
||||||
isFormInit && searchCondition.map(c => {
|
|
||||||
|
arr.push(<Row style={{ marginTop: 20 }}>
|
||||||
|
<Col offset={1} span={2}><span style={{ "lineHeight": "30px", "color": "red" }}>选择过滤模板</span></Col>
|
||||||
|
<Col span={6} offset={1}>
|
||||||
|
<WeaSelect
|
||||||
|
style={{ width: "100%" }}
|
||||||
|
options={templates}
|
||||||
|
onChange={v => {
|
||||||
|
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
<Col offset={1} span={2}><Button onClick={() => console.log(11)}>删除模板</Button></Col>
|
||||||
|
</Row>)
|
||||||
|
|
||||||
|
isFormInit && defaultCondition.map((c, i) => {
|
||||||
|
let _arr = [];
|
||||||
c.items.map((field, index) => {
|
c.items.map((field, index) => {
|
||||||
arr.push(<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@4cc308@${index}`} span={(index % 2 == 0) ? 10 : 11} offset={1}>
|
_arr.push({
|
||||||
<div style={{ marginTop: 20 }}>
|
com: (
|
||||||
<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@u6ex85@${index}`}
|
<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@u6ex85@${index}`}
|
||||||
label={`${field.label}`}
|
label={`${field.label}`}
|
||||||
labelCol={{ span: `${field.labelcol}` }}
|
labelCol={{ span: `${field.labelcol}` }}
|
||||||
wrapperCol={{ span: `${field.fieldcol}` }}>
|
wrapperCol={{ span: `${field.fieldcol}` }}>
|
||||||
{<WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@p7d3td@${index}`} fieldConfig={field} form={form2} formParams={formParams} />}
|
{<WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@p7d3td@${index}`} fieldConfig={field} form={form2} formParams={formParams} />}
|
||||||
</WeaFormItem>
|
</WeaFormItem>
|
||||||
</div>
|
),
|
||||||
</Col>)
|
})
|
||||||
})
|
})
|
||||||
|
arr.push(<WeaSearchGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaSearchGroup@qaih5l@${i}`} needTigger={true} title={c.title} showGroup={c.defaultshow} items={_arr} col={2} />)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
if (searchConditionLoading) {
|
if (searchConditionLoading) {
|
||||||
return (
|
return (
|
||||||
<div className='hrm-loading-center-small' style={{ top: '25%' }}>
|
<div className='hrm-loading-center-small' style={{ top: '25%' }}>
|
||||||
|
|
@ -414,12 +440,12 @@ export default class Resource extends React.Component {
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
return <Row ecId={`${this && this.props && this.props.ecId || ''}_Row@ppeb6z`} onKeyDown={(e) => {
|
return <div onKeyDown={(e) => {
|
||||||
if (e.keyCode == 13 && e.target.tagName === "INPUT") {
|
if (e.keyCode == 13 && e.target.tagName === "INPUT") {
|
||||||
resource.getTableInfo();
|
rankScheme.getTableInfo();
|
||||||
resource.setPanelStatus(false)
|
rankScheme.setPanelStatus(false)
|
||||||
}
|
}
|
||||||
}}>{arr}</Row>
|
}}>{arr}</div>
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -435,7 +461,8 @@ export default class Resource extends React.Component {
|
||||||
render() {
|
render() {
|
||||||
|
|
||||||
const {
|
const {
|
||||||
resource
|
resource,
|
||||||
|
resource: store
|
||||||
} = this.props;
|
} = this.props;
|
||||||
const {
|
const {
|
||||||
isPanelShow, form2, lastName, conditionNum, tableStore, nEdialogTitle, visible, condition,
|
isPanelShow, form2, lastName, conditionNum, tableStore, nEdialogTitle, visible, condition,
|
||||||
|
|
@ -499,9 +526,10 @@ export default class Resource extends React.Component {
|
||||||
conditionLen={2}
|
conditionLen={2}
|
||||||
save={() => this.handleSave()}
|
save={() => this.handleSave()}
|
||||||
onCancel={() => resource.setVisible(false)}
|
onCancel={() => resource.setVisible(false)}
|
||||||
// saveAndSetting={() => this.handleSaveAndSetting()}
|
|
||||||
/>
|
/>
|
||||||
<DatasImport ecId={`${this && this.props && this.props.ecId || ''}_DatasImport@q4rrwm`} />
|
<DatasImport ecId={`${this && this.props && this.props.ecId || ''}_DatasImport@q4rrwm`} />
|
||||||
|
<SearchCustomDialog ecId={`${this && this.props && this.props.ecId || ''}_SearchCustomDialog@q4rrwm`}
|
||||||
|
store={store} />
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -875,6 +875,8 @@ export const i18n = {
|
||||||
editTypeInfo: () => getLabel(32732, '编辑类型'),
|
editTypeInfo: () => getLabel(32732, '编辑类型'),
|
||||||
nextStep:() => getLabel(30131, '下一步'),
|
nextStep:() => getLabel(30131, '下一步'),
|
||||||
version:() => getLabel(30131, '查看历史版本'),
|
version:() => getLabel(30131, '查看历史版本'),
|
||||||
|
saveTemplate:() => getLabel(30131, '存为模板'),
|
||||||
|
conditionSet:() => getLabel(30131, '常用条件定制'),
|
||||||
|
|
||||||
batchOpen: () => getLabel(534249, '批量解锁'),
|
batchOpen: () => getLabel(534249, '批量解锁'),
|
||||||
collect: () => getLabel(28111, '收藏'),
|
collect: () => getLabel(28111, '收藏'),
|
||||||
|
|
|
||||||
|
|
@ -305,6 +305,10 @@ export class PersonnelResumeStore {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@action("合并导出和全部导出") downloadPerResume(type) {
|
||||||
|
Api.downloadPerResume(type);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
setCondition(condition) {
|
setCondition(condition) {
|
||||||
this.condition = condition;
|
this.condition = condition;
|
||||||
|
|
|
||||||
|
|
@ -1,23 +1,30 @@
|
||||||
import {
|
import {
|
||||||
observable,
|
observable,
|
||||||
action
|
action,
|
||||||
|
computed
|
||||||
} from 'mobx';
|
} from 'mobx';
|
||||||
import * as mobx from 'mobx';
|
import * as mobx from 'mobx';
|
||||||
import * as Api from '../apis/resource'; // 引入API接口文件
|
import * as Api from '../apis/resource'; // 引入API接口文件
|
||||||
import {
|
import {
|
||||||
WeaForm
|
WeaForm,WeaTableNew
|
||||||
} from 'comsMobx';
|
|
||||||
import {
|
|
||||||
WeaTableNew
|
|
||||||
} from 'comsMobx';
|
} from 'comsMobx';
|
||||||
import {
|
import {
|
||||||
Modal,
|
Modal,
|
||||||
message,
|
message,
|
||||||
|
Button
|
||||||
} from 'antd'
|
} from 'antd'
|
||||||
|
import {
|
||||||
|
WeaSelect,
|
||||||
|
WeaInputSearch,
|
||||||
|
WeaLocaleProvider,
|
||||||
|
} from 'ecCom';
|
||||||
import {
|
import {
|
||||||
i18n
|
i18n
|
||||||
} from '../public/i18n';
|
} from '../public/i18n';
|
||||||
|
import trim from 'lodash/trim';
|
||||||
import {getSecondPath} from '../util/index'
|
import {getSecondPath} from '../util/index'
|
||||||
|
import cloneDeep from 'lodash/cloneDeep';
|
||||||
|
|
||||||
|
|
||||||
const toJS = mobx.toJS;
|
const toJS = mobx.toJS;
|
||||||
const {
|
const {
|
||||||
|
|
@ -31,6 +38,8 @@ const {
|
||||||
@observable rightMenu = [];
|
@observable rightMenu = [];
|
||||||
@observable condition = [];
|
@observable condition = [];
|
||||||
@observable searchCondition = [];
|
@observable searchCondition = [];
|
||||||
|
@observable defaultCondition = [];
|
||||||
|
@observable templates=[];
|
||||||
@observable isEdit = true;
|
@observable isEdit = true;
|
||||||
@observable isNew = true;
|
@observable isNew = true;
|
||||||
@observable isPanelShow = false; //高级搜索面板
|
@observable isPanelShow = false; //高级搜索面板
|
||||||
|
|
@ -53,7 +62,7 @@ const {
|
||||||
@observable selectTreeNodeInfo;
|
@observable selectTreeNodeInfo;
|
||||||
|
|
||||||
|
|
||||||
@action getTableInfo() {
|
@action("列表") getTableInfo() {
|
||||||
let params;
|
let params;
|
||||||
this.tableStore = new TableStore();
|
this.tableStore = new TableStore();
|
||||||
if (this.isEmptyObject(this.form2.getFormParams())) {
|
if (this.isEmptyObject(this.form2.getFormParams())) {
|
||||||
|
|
@ -83,7 +92,7 @@ const {
|
||||||
this.getTableInfo();
|
this.getTableInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
save() {
|
@action("保存") save() {
|
||||||
let params = {
|
let params = {
|
||||||
...this.form.getFormParams()
|
...this.form.getFormParams()
|
||||||
};
|
};
|
||||||
|
|
@ -109,7 +118,7 @@ const {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
getForm() {
|
@action("新增表单") getForm() {
|
||||||
let params = this.isNew ? {} : {
|
let params = this.isNew ? {} : {
|
||||||
id: this.userId
|
id: this.userId
|
||||||
}
|
}
|
||||||
|
|
@ -129,13 +138,18 @@ const {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
getSearchCondition() {
|
@action("高级搜索表单") getSearchCondition() {
|
||||||
this.setScLoadingStatus(false);
|
this.setScLoadingStatus(true);
|
||||||
Api.getAdvanceSearchCondition().then(res => {
|
const params = {
|
||||||
|
selectKeys:this.transfer.transferKeys
|
||||||
|
}
|
||||||
|
Api.getAdvanceSearchCondition(params).then(res => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
this.setScLoadingStatus(false);
|
this.setScLoadingStatus(false);
|
||||||
res.data.conditions && this.setSearchCondition(res.data.conditions);
|
res.data.conditions && this.setSearchCondition(res.data.conditions);
|
||||||
res.data.conditions && this.form2.initFormFields(res.data.conditions);
|
res.data.defaultcondition && this.setDefaultCondition(res.data.defaultcondition);
|
||||||
|
res.data.defaultcondition && this.form2.initFormFields(res.data.defaultcondition);
|
||||||
|
res.data.templates && this.setTemplates(res.data.templates);
|
||||||
} else {
|
} else {
|
||||||
message.warning(res.msg);
|
message.warning(res.msg);
|
||||||
}
|
}
|
||||||
|
|
@ -145,7 +159,7 @@ const {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@action getHasRight() {
|
@action("顶部按钮") getHasRight() {
|
||||||
Api.getHasRight().then(res => {
|
Api.getHasRight().then(res => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
this.setHasRight(res.data.hasRight);
|
this.setHasRight(res.data.hasRight);
|
||||||
|
|
@ -159,7 +173,7 @@ const {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@action export(){
|
@action("导出") export(){
|
||||||
const params = {
|
const params = {
|
||||||
...this.form.getFormParams()
|
...this.form.getFormParams()
|
||||||
}
|
}
|
||||||
|
|
@ -177,7 +191,204 @@ const {
|
||||||
}, error => {
|
}, error => {
|
||||||
message.warning(error.msg);
|
message.warning(error.msg);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/** ====================================================================================== */
|
||||||
|
@observable searchDialog = {
|
||||||
|
visible: false,
|
||||||
|
title: '常用条件定制',
|
||||||
|
}
|
||||||
|
|
||||||
|
SEARCHDIALOG = {
|
||||||
|
hasScroll: false,
|
||||||
|
icon: 'icon-coms-hrm',
|
||||||
|
iconBgcolor: '#217346',
|
||||||
|
onCancel: () => this.closeSearchDialog(),
|
||||||
|
style: {
|
||||||
|
width: 700,
|
||||||
|
height: 450
|
||||||
|
},
|
||||||
|
moreBtn: {
|
||||||
|
datas: []
|
||||||
|
},
|
||||||
|
buttons: [<Button type='primary' onClick={()=>this.saveHrmSearchUserDefine()}>保存</Button>],
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
TRANSFER = {
|
||||||
|
height: 350,
|
||||||
|
renderItem: (items) => this.renderItem(items),
|
||||||
|
filterLeft: (items) => this.filterLeft(items),
|
||||||
|
filterRight: (items) => this.filterRight(items),
|
||||||
|
onChange: (v) => this.updateTransferKeys(v)
|
||||||
|
}
|
||||||
|
|
||||||
|
@observable transfer = {
|
||||||
|
transferDatas: [],
|
||||||
|
transferKeys: [],
|
||||||
|
transferOptions: [],
|
||||||
|
transferSelectedKey: '0',
|
||||||
|
transferleftIptVal: '',
|
||||||
|
transferRightIptVal: ''
|
||||||
|
}
|
||||||
|
|
||||||
|
@action("常用条件定制保存") saveHrmSearchUserDefine = () => {
|
||||||
|
this.closeSearchDialog();
|
||||||
|
this.getSearchCondition();
|
||||||
|
}
|
||||||
|
|
||||||
|
@action("常用条件定制") formatTransfer = () => {
|
||||||
|
const transferDatas = []
|
||||||
|
const transferKeys = []
|
||||||
|
const transferOptions = [{
|
||||||
|
key: "",
|
||||||
|
showname: ""
|
||||||
|
}]
|
||||||
|
this.transfer.transferSelectedKey = '0';
|
||||||
|
this.transfer.transferleftIptVal = '';
|
||||||
|
this.transfer.transferRightIptVal = '';
|
||||||
|
this.searchCondition.forEach((c, idx) => {
|
||||||
|
transferOptions.push({
|
||||||
|
key: `${idx}`,
|
||||||
|
showname: c.title,
|
||||||
|
})
|
||||||
|
c.items.forEach((i) => {
|
||||||
|
transferDatas.push({
|
||||||
|
id: i.domkey[0],
|
||||||
|
label: i.label,
|
||||||
|
title: c.title,
|
||||||
|
idx: `${idx}`
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
this.defaultCondition.forEach((c, idx) => {
|
||||||
|
c.items.forEach((i) => {
|
||||||
|
transferKeys.push(i.domkey[0]);
|
||||||
|
})
|
||||||
|
})
|
||||||
|
this.transfer.transferDatas = transferDatas;
|
||||||
|
this.transfer.transferKeys = transferKeys;
|
||||||
|
this.transfer.transferOptions = transferOptions;
|
||||||
|
}
|
||||||
|
|
||||||
|
inputSearchStyle = {
|
||||||
|
width:"105px",
|
||||||
|
float:"right",
|
||||||
|
marginTop:"5px",
|
||||||
|
marginLeft:"10px"
|
||||||
|
}
|
||||||
|
selectStyle={
|
||||||
|
marginTop:"-1px",
|
||||||
|
width:"85px",
|
||||||
|
float:"right"
|
||||||
|
}
|
||||||
|
@computed get leftHeader() {
|
||||||
|
const {
|
||||||
|
transferleftIptVal,
|
||||||
|
transferOptions,
|
||||||
|
transferSelectedKey
|
||||||
|
} = this.transfer;
|
||||||
|
return (
|
||||||
|
<div className="trasfer-header">
|
||||||
|
<span>待选</span>
|
||||||
|
<WeaInputSearch
|
||||||
|
style={this.inputSearchStyle}
|
||||||
|
value={transferleftIptVal}
|
||||||
|
onSearchChange={this.updateTransferleftIptVal}
|
||||||
|
/>
|
||||||
|
<WeaSelect
|
||||||
|
style={this.selectStyle}
|
||||||
|
options={transferOptions}
|
||||||
|
value={transferSelectedKey}
|
||||||
|
onChange={this.updateTransferSelectedKey}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
@computed get rightHeader() {
|
||||||
|
const {
|
||||||
|
transferRightIptVal
|
||||||
|
} = this.transfer;
|
||||||
|
return (
|
||||||
|
<div className="trasfer-header">
|
||||||
|
<span>已选</span>
|
||||||
|
<WeaInputSearch
|
||||||
|
style={this.inputSearchStyle}
|
||||||
|
value={transferRightIptVal}
|
||||||
|
onSearchChange={ this.updateTransferRightptVal}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
renderItem = (item) => {
|
||||||
|
const {
|
||||||
|
label,
|
||||||
|
title
|
||||||
|
} = item;
|
||||||
|
return (<div className="trasfer-list-item" style={{"padding":"10px 20px","borderBottom":"1px solid #ddd"}}>
|
||||||
|
<div className="top text-overflow" style={{"marginBottom":"4px"}} title={label}>{label}</div>
|
||||||
|
<div className="bottom text-overflow" style={{"color":"#999"}} title={title}>{title}</div>
|
||||||
|
</div>)
|
||||||
|
};
|
||||||
|
|
||||||
|
filterLeft = (items) => {
|
||||||
|
let leftItems = cloneDeep(items);
|
||||||
|
const {
|
||||||
|
transferleftIptVal,
|
||||||
|
transferSelectedKey
|
||||||
|
} = this.transfer;
|
||||||
|
if (transferSelectedKey) {
|
||||||
|
leftItems = leftItems.filter((item) => item.idx == transferSelectedKey)
|
||||||
|
}
|
||||||
|
if (trim(transferleftIptVal)) {
|
||||||
|
leftItems = leftItems.filter((item) => item.label.indexOf(trim(transferleftIptVal)) > -1)
|
||||||
|
}
|
||||||
|
return leftItems
|
||||||
|
}
|
||||||
|
|
||||||
|
filterRight = (items) => {
|
||||||
|
let rightItems = cloneDeep(items);
|
||||||
|
const {
|
||||||
|
transferRightIptVal
|
||||||
|
} = this.transfer;
|
||||||
|
if (trim(transferRightIptVal)) {
|
||||||
|
rightItems = rightItems.filter((item) => item.label.indexOf(trim(transferRightIptVal)) > -1)
|
||||||
|
}
|
||||||
|
return rightItems
|
||||||
|
}
|
||||||
|
|
||||||
|
@action("穿梭框变化回调") updateTransferKeys = (v) => {
|
||||||
|
this.transfer.transferKeys = v;
|
||||||
|
}
|
||||||
|
|
||||||
|
@action updateTransferleftIptVal = (v) => {
|
||||||
|
this.transfer.transferleftIptVal = v;
|
||||||
|
}
|
||||||
|
|
||||||
|
@action updateTransferSelectedKey = (v) => {
|
||||||
|
this.transfer.transferSelectedKey = v;
|
||||||
|
}
|
||||||
|
|
||||||
|
@action updateTransferRightptVal = (v) => {
|
||||||
|
this.transfer.transferRightIptVal = v;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@action openSearchDialog = () => {
|
||||||
|
this.searchDialog.visible = true;
|
||||||
|
this.formatTransfer();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@action closeSearchDialog = () => {
|
||||||
|
this.searchDialog.visible = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
updateFields(val) {
|
updateFields(val) {
|
||||||
this.form2.updateFields({
|
this.form2.updateFields({
|
||||||
|
|
@ -191,6 +402,14 @@ const {
|
||||||
this.searchCondition = condition;
|
this.searchCondition = condition;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setDefaultCondition(defaultcondition) {
|
||||||
|
this.defaultCondition = defaultcondition;
|
||||||
|
}
|
||||||
|
|
||||||
|
setTemplates(templates) {
|
||||||
|
this.templates = templates;
|
||||||
|
}
|
||||||
|
|
||||||
setScLoadingStatus(bool) {
|
setScLoadingStatus(bool) {
|
||||||
this.searchConditionLoading = bool;
|
this.searchConditionLoading = bool;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -95,3 +95,18 @@
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
white-space: nowrap;overflow: hidden;
|
white-space: nowrap;overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//列定制
|
||||||
|
// .trasfer-header{
|
||||||
|
// .wea-input-focus {
|
||||||
|
// width: 105px;
|
||||||
|
// float: right;
|
||||||
|
// margin-top: 5px;
|
||||||
|
// margin-left: 10px;
|
||||||
|
// }
|
||||||
|
// .wea-select{
|
||||||
|
// margin-top: -1px;
|
||||||
|
// width: 85px;
|
||||||
|
// float: right;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
Loading…
Reference in New Issue