feature/2.15.1.2407.01-薪资项目以及字段管理页面改造

This commit is contained in:
黎永顺 2024-08-20 15:27:03 +08:00
parent fdf82d883d
commit 673c2ba908
3 changed files with 159 additions and 14 deletions

View File

@ -3,6 +3,7 @@ import { dataTypeOptions, patternOptions, roundingModeOptions } from "./options"
const getLabel = WeaLocaleProvider.getLabel;
export const salaryItemConditions = [
{
items: [
@ -24,7 +25,7 @@ export const salaryItemConditions = [
label: "默认使用",
lanId: 111,
labelcol: 8,
value: "",
value: "0",
rules: "required|string",
tipLanId: 111,
tip: "提示:开启后,每个薪资方案都有该薪资项目,可在具体薪资方案中删除",
@ -37,7 +38,7 @@ export const salaryItemConditions = [
label: "核算时隐藏",
lanId: 111,
labelcol: 8,
value: "",
value: "0",
rules: "required|string",
tipLanId: 111,
tip: "提示:开启后,在薪资账套中添加该项目时,默认勾选隐藏且在核算时隐藏该薪资项目,可在具体薪资账套中设置是否隐藏",
@ -69,6 +70,131 @@ export const salaryItemConditions = [
viewAttr: 3,
hide: true
},
{
conditionType: "SELECT",
domkey: ["dataType"],
fieldcol: 14,
label: "字段类型",
lanId: 111,
labelcol: 8,
value: "",
options: [
{ key: "number", showname: "数值", lanId: 111, selected: true },
{ key: "string", showname: "字符", lanId: 111, selected: false }
],
rules: "required|string",
viewAttr: 3
},
{
conditionType: "SELECT",
domkey: ["roundingMode"],
fieldcol: 14,
label: "舍入规则",
lanId: 111,
labelcol: 8,
value: "",
options: [
{ key: "1", selected: true, showname: "原始数据", lanId: 111 },
{ key: "2", selected: false, showname: "四舍五入", lanId: 111 },
{ key: "3", selected: false, showname: "向上舍入", lanId: 111 },
{ key: "4", selected: false, showname: "向下舍入", lanId: 111 },
{ key: "5", selected: false, showname: "见分进角", lanId: 111 }
],
rules: "required|string",
viewAttr: 3
},
{
conditionType: "SELECT",
domkey: ["pattern"],
fieldcol: 14,
label: "保留小数位",
lanId: 111,
labelcol: 8,
value: "",
options: [
{ key: "0", selected: false, showname: "0" },
{ key: "1", selected: false, showname: "1" },
{ key: "2", selected: true, showname: "2" },
{ key: "3", selected: false, showname: "3" },
{ key: "4", selected: false, showname: "4" },
{ key: "5", selected: false, showname: "5" },
{ key: "6", selected: true, showname: "6" },
{ key: "7", selected: false, showname: "7" },
{ key: "8", selected: false, showname: "8" },
{ key: "9", selected: false, showname: "9" },
{ key: "10", selected: false, showname: "10" }
],
rules: "required|string",
viewAttr: 3
},
{
conditionType: "SELECT",
domkey: ["valueType"],
fieldcol: 14,
label: "取值方式",
lanId: 111,
labelcol: 8,
value: "",
detailType: 3,
options: [
{ key: "1", showname: "输入", selected: true, lanId: 111 },
{ key: "2", showname: "公式", selected: false, lanId: 111 },
{ key: "3", showname: "SQL", selected: false, lanId: 111 }
],
rules: "required|string",
viewAttr: 3
},
{
conditionType: "INPUT",
domkey: ["defaultValue"],
fieldcol: 14,
label: "默认值",
lanId: 111,
labelcol: 8,
value: "",
viewAttr: 2
},
{
conditionType: "INPUT",
domkey: ["formulaContent"],
fieldcol: 14,
label: "公式",
lanId: 111,
labelcol: 8,
value: "",
viewAttr: 2
},
{
conditionType: "INPUTNUMBER",
domkey: ["sortedIndex"],
fieldcol: 14,
label: "显示顺序",
lanId: 111,
labelcol: 8,
value: "",
viewAttr: 2
},
{
conditionType: "INPUTNUMBER",
domkey: ["width"],
fieldcol: 14,
label: "显示宽度",
lanId: 111,
labelcol: 8,
value: "",
viewAttr: 2
},
{
conditionType: "TEXTAREA",
domkey: ["description"],
fieldcol: 14,
label: "备注",
lanId: 111,
labelcol: 8,
value: "",
viewAttr: 2,
otherParams: { minRows: 3 }
}
],
title: "",
defaultshow: true

View File

@ -1,6 +1,6 @@
import React from "react";
import { inject, observer } from "mobx-react";
import { WeaFormItem, WeaHelpfulTip, WeaLocaleProvider, WeaSearchGroup, WeaSlideModal } from "ecCom";
import { WeaFormItem, WeaHelpfulTip, WeaLocaleProvider, WeaSearchGroup, WeaSlideModal, WeaTools } from "ecCom";
import { WeaSwitch } from "comsMobx";
import { salaryItemConditions } from "./columns";
// import FormalFormModal from "./formalFormModal";
@ -57,9 +57,19 @@ export default class CustomSalaryItemSlide extends React.Component {
conditions: _.map(salaryItemConditions, c => {
return {
...c, items: _.map(c.items, fields => {
return {
...fields, label: getLabel(fields.lanId, fields.label)
};
fields = { ...fields, label: getLabel(fields.lanId, fields.label) };
switch (getKey(fields)) {
case "dataType":
case "valueType":
case "roundingMode":
fields = {
...fields, options: _.map(fields.options, o => ({ ...o, showname: getLabel(o.lanId, o.showname) }))
};
break;
default:
break;
}
return fields;
})
};
})
@ -67,7 +77,8 @@ export default class CustomSalaryItemSlide extends React.Component {
props.salaryItemStore.itemsForm.initFormFields(this.state.conditions);
});
};
renderForm = (form) => {
renderForm = () => {
const { salaryItemStore: { itemsForm: form } } = this.props;
const { conditions } = this.state, { isFormInit } = form, formParams = form.getFormParams();
let group = [];
isFormInit && conditions.map(c => {
@ -80,7 +91,8 @@ export default class CustomSalaryItemSlide extends React.Component {
<WeaSwitch fieldConfig={fields} form={form} formParams={formParams}/>
{
fields.tip && <WeaHelpfulTip
width={350} title={getLabel(fields.tipLanId, fields.tip)} placement="topLeft"/>
style={{ marginLeft: 16 }} width={350} title={getLabel(fields.tipLanId, fields.tip)}
placement="topLeft"/>
}
</WeaFormItem>),
hide: fields.hide
@ -102,15 +114,14 @@ export default class CustomSalaryItemSlide extends React.Component {
};
render() {
const { request } = this.props;
const { valueType, dataType, formulaId } = request;
const { formalModalVisible, salaryItemName } = this.state;
const { request, onClose } = this.props;
// const { valueType, dataType, formulaId } = request;
// const { formalModalVisible, salaryItemName } = this.state;
return (<WeaSlideModal
className="custom_salaryItemSlide"{...this.props}
top={0} width={800} height={100} measureT="%" measureX="px" measureY="%"
direction="right" title={this.renderTitle()} onClose={this.handleClose}
content={<div className="form-dialog-layout">
</div>}/>
direction="right" title={this.renderTitle()} onClose={() => onClose()}
content={<div className="form-dialog-layout">{this.renderForm()}</div>}/>
// <div className="customSalaryItemSlide">
// <SalaryItemForm {...this.props} onChangeFieldsItem={this.handleChange} onShowFormal={this.handleShowFormal}/>

View File

@ -9,10 +9,18 @@
height: 100%;
}
}
.custom_salaryItemSlide {
.wea-slide-modal-title {
border-bottom: 1px solid #e5e5e5 !important;
}
.wea-slide-modal-content {
height: 100%;
background: #f6f6f6;
}
.titleDialog {
display: flex;
justify-content: space-between;