Merge pull request 'feature/cl' (#54) from feature/cl into dev

Reviewed-on: http://221.226.25.34:3000/liang.cheng/trunk/pulls/54
This commit is contained in:
liang.cheng 2024-07-15 17:03:48 +08:00
commit 6865e26793
7 changed files with 46 additions and 33 deletions

View File

@ -548,7 +548,7 @@ export default class Company extends React.Component {
return ( return (
hasRight && <div ref='page' style={{ height: '100%' }}> hasRight && <div ref='page' style={{ height: '100%' }} className = 'organization-scrollable-table'>
<WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@k6oc4u`} <WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@k6oc4u`}
datas={this.getDropMenuDatas()} datas={this.getDropMenuDatas()}
onClick={key => this.handleMenuClick(key)} onClick={key => this.handleMenuClick(key)}

View File

@ -660,7 +660,7 @@ export default class Department extends React.Component {
return ( return (
hasRight && <div ref='page' style={{ height: '100%' }}> hasRight && <div ref='page' style={{ height: '100%' }} className = 'organization-scrollable-table'>
<WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@k6oc4u`} <WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@k6oc4u`}
datas={this.getDropMenuDatas()} datas={this.getDropMenuDatas()}
onClick={key => this.handleMenuClick(key)} onClick={key => this.handleMenuClick(key)}

View File

@ -608,7 +608,7 @@ export default class Job extends React.Component {
return ( return (
hasRight && <div ref='page' style={{ height: '100%' }}> hasRight && <div ref='page' style={{ height: '100%' }} className = 'organization-scrollable-table'>
<WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@k6oc4u`} <WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@k6oc4u`}
datas={this.getDropMenuDatas()} datas={this.getDropMenuDatas()}
onClick={key => this.handleMenuClick(key)} onClick={key => this.handleMenuClick(key)}

View File

@ -442,6 +442,20 @@ export default class Resource extends React.Component {
} = form2; } = form2;
isFormInit && templates.length > 0 && defaultCondition.map((c, i) => {
let _arr = [];
c.items.map((field, index) => {
_arr.push({
com: (
<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@u6ex85@${index}`}
label={`${field.label}`}
labelCol={{ span: `${field.labelcol}` }}
wrapperCol={{ span: `${field.fieldcol}` }}>
{<WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@p7d3td@${index}`} fieldConfig={field} form={form2} formParams={formParams} />}
</WeaFormItem>
),
})
})
arr.push(<Row style={{ marginTop: 20 }}> arr.push(<Row style={{ marginTop: 20 }}>
<Col offset={1} span={2}><span style={{ "lineHeight": "30px", "color": "red" }}>{getLabel(547655,'模板选择')}</span></Col> <Col offset={1} span={2}><span style={{ "lineHeight": "30px", "color": "red" }}>{getLabel(547655,'模板选择')}</span></Col>
<Col span={6} offset={1}> <Col span={6} offset={1}>
@ -457,20 +471,6 @@ export default class Resource extends React.Component {
<Col offset={1} span={2}><Button onClick={() => resource.deleteSearchTemplate()}>{getLabel(547656,'删除模板 ')}</Button></Col> <Col offset={1} span={2}><Button onClick={() => resource.deleteSearchTemplate()}>{getLabel(547656,'删除模板 ')}</Button></Col>
</Row>) </Row>)
isFormInit && defaultCondition.map((c, i) => {
let _arr = [];
c.items.map((field, index) => {
_arr.push({
com: (
<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@u6ex85@${index}`}
label={`${field.label}`}
labelCol={{ span: `${field.labelcol}` }}
wrapperCol={{ span: `${field.fieldcol}` }}>
{<WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@p7d3td@${index}`} fieldConfig={field} form={form2} formParams={formParams} />}
</WeaFormItem>
),
})
})
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} />) 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} />)
}) })
@ -499,6 +499,15 @@ export default class Resource extends React.Component {
return true; return true;
} }
getTableWidth = (columns) => {
const columnLength = columns.filter((col)=>col.display === 'true').length;
if(columnLength>10){
return columnLength*150;
}else{
return '100%'
}
}
render() { render() {
@ -513,7 +522,7 @@ export default class Resource extends React.Component {
if (hasRight === false) { if (hasRight === false) {
return renderNoright(); return renderNoright();
} }
const width = tableStore.columns.filter(c => c.display === "true").length * 50;
return ( return (
hasRight && <div ref='page' style={{ height: '100%' }}> hasRight && <div ref='page' style={{ height: '100%' }}>
<WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@k6oc4u`} <WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@k6oc4u`}
@ -555,7 +564,7 @@ export default class Resource extends React.Component {
needScroll={true} needScroll={true}
getColumns={c => this.reRenderColumns(c)} getColumns={c => this.reRenderColumns(c)}
onOperatesClick={(record, index, operate) => this.onOperatesClick(record, index, operate)} onOperatesClick={(record, index, operate) => this.onOperatesClick(record, index, operate)}
tableWidth={width} tableWidth={this.getTableWidth}
/> />
</WeaLeftRightLayout> </WeaLeftRightLayout>
</WeaTop> </WeaTop>

View File

@ -12,7 +12,6 @@ export const i18n = {
subCompanyFieldDef: () => getLabel(81876, '分部字段定义'), subCompanyFieldDef: () => getLabel(81876, '分部字段定义'),
departmentFieldDef: () => getLabel(81877, '部门字段定义'), departmentFieldDef: () => getLabel(81877, '部门字段定义'),
resourceFieldDef: () => getLabel(81878, '人员卡片字段定义'), resourceFieldDef: () => getLabel(81878, '人员卡片字段定义'),
jobFieldDef: () => getLabel(81878, '岗位字段定义'),
roleSetting: () => getLabel(16527, '角色设置'), roleSetting: () => getLabel(16527, '角色设置'),
batchMaintenance: () => getLabel(33923, '批量维护'), batchMaintenance: () => getLabel(33923, '批量维护'),
batchAdjustSubCompany: () => getLabel(385879, '批量调整分部信息'), batchAdjustSubCompany: () => getLabel(385879, '批量调整分部信息'),
@ -108,6 +107,8 @@ export const i18n = {
unitSetting: () => getLabel(16511, '单位设置'), unitSetting: () => getLabel(16511, '单位设置'),
recruitLibrary: () => getLabel(16251, '应聘库'), recruitLibrary: () => getLabel(16251, '应聘库'),
loginFailLog: () => getLabel('391172', "人员登入失败日志"), loginFailLog: () => getLabel('391172', "人员登入失败日志"),
jobFieldDef: () => getLabel(547353, '岗位字段定义'),
}, },
label: { label: {
//新增 //新增

View File

@ -290,7 +290,7 @@ export class ResourceStore {
@observable templates = []; @observable templates = [];
@observable customTemplates = []; @observable customTemplates = [];
@observable searchTemplateName = ''; @observable searchTemplateName = '';
@observable searchTemplateId = '-1'; @observable searchTemplateId = "-1";
@observable customTemplateName = ''; @observable customTemplateName = '';
@observable customTemplateId = '-1'; @observable customTemplateId = '-1';
@ -436,6 +436,7 @@ export class ResourceStore {
}).then(data => { }).then(data => {
if (data.code === 200) { if (data.code === 200) {
this.searchTemplateId = data.data; this.searchTemplateId = data.data;
this.templates = [];
this.setPanelStatus(true); this.setPanelStatus(true);
} else { } else {
message.warning(data.msg); message.warning(data.msg);
@ -460,7 +461,7 @@ export class ResourceStore {
}).then(data => { }).then(data => {
if (data.code === 200) { if (data.code === 200) {
this.customTemplateId = data.data; this.customTemplateId = data.data;
this.getSearchTemplate(false); // this.getSearchTemplate(false);
this.customization(); this.customization();
message.success(data.msg); message.success(data.msg);
} else { } else {
@ -484,6 +485,7 @@ export class ResourceStore {
if (data.code === 200) { if (data.code === 200) {
message.success(data.msg); message.success(data.msg);
this.searchTemplateId = '-1'; this.searchTemplateId = '-1';
this.templates = [];
this.setPanelStatus(true); this.setPanelStatus(true);
} else { } else {
message.warning(data.msg); message.warning(data.msg);
@ -594,12 +596,11 @@ export class ResourceStore {
} }
@action("模板") getSearchTemplate = (bool) => { @action("模板") getSearchTemplate = (bool) => {
Api.getSearchTemplate({ type: bool ? 'search' : 'custom' }).then(res => {
Api.getSearchTemplate({ type: bool ? 'search' : 'custom',id: bool ? this.searchTemplateId : this.customTemplateId}).then(res => {
if (res.code === 200) { if (res.code === 200) {
if (res.data.templateId) {
this.customTemplateId = res.data.templateId;
}
bool ? this.setTemplates(res.data.templates) : this.setCustomTemplates(res.data.templates); bool ? this.setTemplates(res.data.templates) : this.setCustomTemplates(res.data.templates);
} else { } else {
message.warning(res.msg); message.warning(res.msg);
} }
@ -668,6 +669,8 @@ export class ResourceStore {
let { code, msg } = res; let { code, msg } = res;
if (code === 200) { if (code === 200) {
message.success(msg || getLabel(30700,'操作成功')); message.success(msg || getLabel(30700,'操作成功'));
//返回默认模板
this.customTemplateId = '-1';
this.getEditTable(); this.getEditTable();
this.customization(); this.customization();
} else { } else {
@ -728,7 +731,6 @@ export class ResourceStore {
this.searchDialog.loading = true; this.searchDialog.loading = true;
this.getSearchTemplate(bool); this.getSearchTemplate(bool);
this.getCustomTransferData(); this.getCustomTransferData();
} }
@action closeSearchDialog = () => { @action closeSearchDialog = () => {
@ -784,11 +786,11 @@ export class ResourceStore {
this.defaultCondition = defaultcondition; this.defaultCondition = defaultcondition;
} }
setTemplates(datas) { @action setTemplates(datas) {
this.templates = datas; this.templates = datas;
} }
setCustomTemplates(datas) { @action setCustomTemplates(datas) {
this.customTemplates = datas; this.customTemplates = datas;
} }

View File

@ -28,7 +28,8 @@
margin-top: 10px; margin-top: 10px;
} }
.wea-left-right-layout-right { //分部 部门 岗位
.organization-scrollable-table .wea-left-right-layout-right{
overflow: scroll !important; overflow: scroll !important;
} }