应用设置页面新增修改项
This commit is contained in:
parent
e24078ba1c
commit
69961a6c15
|
|
@ -5,16 +5,28 @@
|
|||
* Date: 2022-09-27 18:17:02
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaCheckbox, WeaDatePicker, WeaFormItem, WeaSearchGroup, WeaTop } from "ecCom";
|
||||
import { WeaCheckbox, WeaDatePicker, WeaFormItem, WeaInput, WeaSearchGroup, WeaTop } from "ecCom";
|
||||
import * as API from "../../apis/ruleconfig";
|
||||
import { Button, message } from "antd";
|
||||
|
||||
const Input = (props) => {
|
||||
const { label, value } = props;
|
||||
return (
|
||||
<WeaFormItem label={label} labelCol={{ span: 8 }} wrapperCol={{ span: 16 }}>
|
||||
<WeaInput viewAttr={1} value={value}/>
|
||||
</WeaFormItem>
|
||||
);
|
||||
};
|
||||
|
||||
class AppConfig extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
openAcctResultSum: "0",
|
||||
displayEmpInfoReport: "0",
|
||||
isLog: "0",
|
||||
openFormulaForcedEditing: "0",
|
||||
version: "",
|
||||
loading: false
|
||||
};
|
||||
}
|
||||
|
|
@ -26,8 +38,13 @@ class AppConfig extends Component {
|
|||
queryAppsetting = () => {
|
||||
API.queryAppsetting().then(({ status, data }) => {
|
||||
if (status) {
|
||||
const { openAcctResultSum, displayEmpInfoReport } = data;
|
||||
this.setState({ openAcctResultSum, displayEmpInfoReport });
|
||||
const { openAcctResultSum, displayEmpInfoReport, isLog, openFormulaForcedEditing, version } = data;
|
||||
this.setState({
|
||||
openAcctResultSum, displayEmpInfoReport,
|
||||
isLog: isLog === "true" ? "1" : "0",
|
||||
openFormulaForcedEditing: openFormulaForcedEditing === "true" ? "1" : "0",
|
||||
version
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
@ -46,9 +63,15 @@ class AppConfig extends Component {
|
|||
};
|
||||
|
||||
render() {
|
||||
const { openAcctResultSum, displayEmpInfoReport, loading } = this.state;
|
||||
const { openAcctResultSum, displayEmpInfoReport, loading, openFormulaForcedEditing, isLog, version } = this.state;
|
||||
const btns = [<Button type="primary" loading={loading} onClick={this.appSettingSave}>保存</Button>];
|
||||
const items = [
|
||||
{
|
||||
com: Input({
|
||||
label: "版本号",
|
||||
value: version
|
||||
})
|
||||
},
|
||||
{
|
||||
com: CheckBox({
|
||||
label: "显示薪资核算结果合计列",
|
||||
|
|
@ -66,6 +89,20 @@ class AppConfig extends Component {
|
|||
this.setState({ displayEmpInfoReport });
|
||||
}
|
||||
})
|
||||
},
|
||||
{
|
||||
com: CheckBox({
|
||||
label: "是否输出日志",
|
||||
disabled: true,
|
||||
value: isLog
|
||||
})
|
||||
},
|
||||
{
|
||||
com: CheckBox({
|
||||
label: "是否可编辑系统公式",
|
||||
disabled: true,
|
||||
value: openFormulaForcedEditing
|
||||
})
|
||||
}
|
||||
];
|
||||
return (
|
||||
|
|
@ -85,10 +122,10 @@ class AppConfig extends Component {
|
|||
export default AppConfig;
|
||||
|
||||
export const CheckBox = payload => {
|
||||
const { label, onChange, value } = payload;
|
||||
const { label, onChange, value, disabled = false } = payload;
|
||||
return (
|
||||
<WeaFormItem label={label} labelCol={{ span: 8 }} wrapperCol={{ span: 16 }}>
|
||||
<WeaCheckbox display="switch" value={value} onChange={onChange}/>
|
||||
<WeaCheckbox display="switch" disabled={disabled} value={value} onChange={onChange}/>
|
||||
</WeaFormItem>
|
||||
);
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue