feature/2.9.42310.01-社保档案操作日志

This commit is contained in:
黎永顺 2023-10-23 18:06:09 +08:00
parent 8b7bb221e2
commit 510e46045e
3 changed files with 59 additions and 9 deletions

View File

@ -1,3 +1,10 @@
import { WeaSwitch } from "comsMobx";
import { Button } from "antd";
import { WeaFormItem, WeaLocaleProvider, WeaSearchGroup, WeaTools } from "ecCom";
const getKey = WeaTools.getKey;
const getLabel = WeaLocaleProvider.getLabel;
export const tabCondition = [
{
color: "#000000",
@ -61,10 +68,10 @@ export const logConditions = [
type: "1"
},
domkey: ["employeeId"],
fieldcol: 10,
fieldcol: 17,
label: "对象",
lanId: 106,
labelcol: 4,
labelcol: 7,
value: ""
},
{
@ -90,13 +97,42 @@ export const logConditions = [
type: "1"
},
domkey: ["operator"],
fieldcol: 10,
fieldcol: 17,
label: "操作人",
lanId: 111,
labelcol: 4,
labelcol: 7,
value: ""
}
],
defaultshow: true
}
];
export const getLogSearchsForm = (form, condition, onSearch = () => void (0)) => {
const { isFormInit } = form;
const formParams = form.getFormParams();
let group = [];
isFormInit && condition && condition.map(c => {
let items = [];
c.items.map(fields => {
items.push({
com: (
<WeaFormItem
label={`${fields.label}`} labelCol={{ span: `${fields.labelcol}` }}
wrapperCol={{ span: `${fields.fieldcol}` }} error={form.getError(fields)}
tipPosition="bottom"
>
<WeaSwitch fieldConfig={fields} form={form} formParams={formParams}/>
{
getKey(fields) === "operator" &&
<Button type="primary" onClick={onSearch} style={{ position: "absolute", right: "-70px", top: "0" }}>{getLabel(388113, "搜索")}</Button>
}
</WeaFormItem>),
colSpan: 1
});
});
group.push(
<WeaSearchGroup col={4} needTigger={true} title={c.title} showGroup={c.defaultshow} items={items} center={false}
/>);
});
return group;
};

View File

@ -99,6 +99,20 @@
width: 100%;
height: 100%;
.wea-search-group {
padding: 0;
margin-bottom: 10px;
background: #FFF;
.wea-form-cell {
padding: 0;
.wea-form-item {
padding: 10px;
}
}
}
.logTable {
background: #FFFFFF;
}

View File

@ -8,8 +8,7 @@ import React, { Component } from "react";
import { inject, observer } from "mobx-react";
import { WeaDialog, WeaLocaleProvider, WeaTable } from "ecCom";
import { getAdjustHistoryList } from "../../../../apis/archive";
import { logConditions } from "../config";
import { getSearchs } from "../../../../util";
import { getLogSearchsForm, logConditions } from "../config";
import moment from "moment";
const getLabel = WeaLocaleProvider.getLabel;
@ -46,7 +45,8 @@ class Index extends Component {
getAdjustHistoryList = () => {
const { pageInfo } = this.state;
const payload = { ...pageInfo };
const { archivesStore: { logForm } } = this.props;
const payload = { ...pageInfo, ...logForm.getFormParams() };
this.setState({ loading: true });
getAdjustHistoryList(payload).then(({ status, data }) => {
this.setState({ loading: false });
@ -86,7 +86,7 @@ class Index extends Component {
}, () => this.getAdjustHistoryList());
}
};
const scrollHeight = this.logRef ? this.logRef.state.height - 135 : 606.6;
const scrollHeight = this.logRef ? this.logRef.state.height - 210 : 606.6;
return (
<WeaDialog
{...this.props} title={getLabel(111, "操作日志")}
@ -103,7 +103,7 @@ class Index extends Component {
}}
>
<div className="logDialogContent">
{getSearchs(logForm, conditions, 4, false)}
{getLogSearchsForm(logForm, conditions, () => this.getAdjustHistoryList())}
<WeaTable
columns={columns} dataSource={dataSource}
loading={loading} className="logTable"