From 673c2ba908323ece7a9b35799b37f84415fb6870 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Tue, 20 Aug 2024 15:27:03 +0800 Subject: [PATCH] =?UTF-8?q?feature/2.15.1.2407.01-=E8=96=AA=E8=B5=84?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E4=BB=A5=E5=8F=8A=E5=AD=97=E6=AE=B5=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E9=A1=B5=E9=9D=A2=E6=94=B9=E9=80=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/pages/salaryItem/columns.js | 130 +++++++++++++++++- .../pages/salaryItem/customSalaryItemSlide.js | 35 +++-- pc4mobx/hrmSalary/pages/salaryItem/index.less | 8 ++ 3 files changed, 159 insertions(+), 14 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/salaryItem/columns.js b/pc4mobx/hrmSalary/pages/salaryItem/columns.js index f93b0b71..a478b454 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/columns.js +++ b/pc4mobx/hrmSalary/pages/salaryItem/columns.js @@ -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 diff --git a/pc4mobx/hrmSalary/pages/salaryItem/customSalaryItemSlide.js b/pc4mobx/hrmSalary/pages/salaryItem/customSalaryItemSlide.js index f615f0e6..dc2a1e81 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/customSalaryItemSlide.js +++ b/pc4mobx/hrmSalary/pages/salaryItem/customSalaryItemSlide.js @@ -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 { { fields.tip && + style={{ marginLeft: 16 }} width={350} title={getLabel(fields.tipLanId, fields.tip)} + placement="topLeft"/> } ), 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 ( - }/> + direction="right" title={this.renderTitle()} onClose={() => onClose()} + content={
{this.renderForm()}
}/> //
// diff --git a/pc4mobx/hrmSalary/pages/salaryItem/index.less b/pc4mobx/hrmSalary/pages/salaryItem/index.less index e12fed2b..b80727e6 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/index.less +++ b/pc4mobx/hrmSalary/pages/salaryItem/index.less @@ -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;