产品-多语言系统
This commit is contained in:
parent
d326b84031
commit
9ace8c8813
|
|
@ -37,12 +37,12 @@ import stores from "./stores";
|
|||
import "./style/index";
|
||||
|
||||
// 读取系统多语言配置
|
||||
let getLocaleLabel = WeaLocaleProvider.getLocaleLabel.bind(this, "hrmSalary");
|
||||
let getLocaleLabel = WeaLocaleProvider.getLocaleLabel.bind(this, "HRM");
|
||||
|
||||
// 不需要读取系统多语言
|
||||
getLocaleLabel = function (nextState, replace, callback) {
|
||||
callback();
|
||||
};
|
||||
// getLocaleLabel = function (nextState, replace, callback) {
|
||||
// callback();
|
||||
// };
|
||||
|
||||
const Home = (props) => props.children;
|
||||
|
||||
|
|
@ -105,6 +105,8 @@ const Routes = (
|
|||
/>
|
||||
</Route>
|
||||
<Route key="salaryItem" path="salaryItem" component={SalaryItem}/>
|
||||
|
||||
{/*系统语言改造截止处*/}
|
||||
<Route key="salaryFile" path="salaryFile" component={PayrollFiles}/>
|
||||
<Route
|
||||
key="dataAcquisition"
|
||||
|
|
|
|||
|
|
@ -1,64 +1,67 @@
|
|||
import { WeaLocaleProvider } from "ecCom";
|
||||
import { dataTypeOptions, patternOptions, roundingModeOptions } from "./options";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
export const columns = [
|
||||
{
|
||||
title: "名称",
|
||||
title: getLabel(111, "名称"),
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "属性",
|
||||
title: getLabel(111, "属性"),
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "类型",
|
||||
title: getLabel(111, "类型"),
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "薪资档案引用",
|
||||
title: getLabel(111, "薪资档案引用"),
|
||||
dataIndex: "refere",
|
||||
key: "refere"
|
||||
},
|
||||
{
|
||||
title: "默认使用",
|
||||
title: getLabel(111, "默认使用"),
|
||||
dataIndex: "refere",
|
||||
key: "refere"
|
||||
},
|
||||
{
|
||||
title: "进位规则",
|
||||
title: getLabel(111, "进位规则"),
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "保留小数位",
|
||||
title: getLabel(111, "保留小数位"),
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "取值方式",
|
||||
title: getLabel(111, "取值方式"),
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "备注",
|
||||
title: getLabel(111, "备注"),
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
title: getLabel(111, "操作"),
|
||||
dataIndex: "cz",
|
||||
key: "cz"
|
||||
}
|
||||
];
|
||||
export const salaryItemFields = [
|
||||
{
|
||||
key: 'name',
|
||||
label: '名称',
|
||||
type: 'INPUT',
|
||||
key: "name",
|
||||
label: getLabel(111, "名称"),
|
||||
type: "INPUT",
|
||||
viewAttr: 3,
|
||||
tip: ''
|
||||
tip: ""
|
||||
},
|
||||
// {
|
||||
// key: 'useInEmployeeSalary',
|
||||
|
|
@ -68,77 +71,77 @@ export const salaryItemFields = [
|
|||
// tip: '提示:开启后,该薪资项目不可删除或设为无效,取值方式会默认置为输入'
|
||||
// },
|
||||
{
|
||||
key: 'useDefault',
|
||||
label: '默认使用',
|
||||
type: 'SWITCH',
|
||||
key: "useDefault",
|
||||
label: getLabel(111, "默认使用"),
|
||||
type: "SWITCH",
|
||||
viewAttr: 2,
|
||||
tip: '提示:开启后,每个薪资方案都有该薪资项目,可在具体薪资方案中删除'
|
||||
tip: getLabel(111, "提示:开启后,每个薪资方案都有该薪资项目,可在具体薪资方案中删除")
|
||||
},
|
||||
{
|
||||
key: 'sharedType',
|
||||
label: '可见性',
|
||||
type: 'SELECT',
|
||||
key: "sharedType",
|
||||
label: getLabel(111, "可见性"),
|
||||
type: "SELECT",
|
||||
viewAttr: 2,
|
||||
tip: ''
|
||||
tip: ""
|
||||
},
|
||||
{
|
||||
key: 'taxAgentIds',
|
||||
label: '可见性范围',
|
||||
type: 'SELECT',
|
||||
key: "taxAgentIds",
|
||||
label: getLabel(111, "可见性范围"),
|
||||
type: "SELECT",
|
||||
viewAttr: 3,
|
||||
tip: ''
|
||||
tip: ""
|
||||
},
|
||||
{
|
||||
key: 'dataType',
|
||||
label: '字段类型',
|
||||
type: 'SELECT',
|
||||
key: "dataType",
|
||||
label: getLabel(111, "字段类型"),
|
||||
type: "SELECT",
|
||||
viewAttr: 3,
|
||||
options: dataTypeOptions,
|
||||
tip: ''
|
||||
tip: ""
|
||||
},
|
||||
{
|
||||
key: 'roundingMode',
|
||||
label: '舍入规则',
|
||||
type: 'SELECT',
|
||||
key: "roundingMode",
|
||||
label: getLabel(111, "舍入规则"),
|
||||
type: "SELECT",
|
||||
viewAttr: 2,
|
||||
options: roundingModeOptions,
|
||||
tip: ''
|
||||
tip: ""
|
||||
},
|
||||
{
|
||||
key: 'pattern',
|
||||
label: '保留小数位',
|
||||
type: 'SELECT',
|
||||
key: "pattern",
|
||||
label: getLabel(111, "保留小数位"),
|
||||
type: "SELECT",
|
||||
viewAttr: 2,
|
||||
options: patternOptions,
|
||||
tip: ''
|
||||
tip: ""
|
||||
},
|
||||
{
|
||||
key: 'valueType',
|
||||
label: '取值方式',
|
||||
type: 'RADIO',
|
||||
key: "valueType",
|
||||
label: getLabel(111, "取值方式"),
|
||||
type: "RADIO",
|
||||
viewAttr: 2,
|
||||
tip: ''
|
||||
tip: ""
|
||||
},
|
||||
{
|
||||
key: 'formulaContent',
|
||||
label: '公式',
|
||||
type: 'INPUT',
|
||||
key: "formulaContent",
|
||||
label: getLabel(111, "公式"),
|
||||
type: "INPUT",
|
||||
viewAttr: 2,
|
||||
tip: ''
|
||||
tip: ""
|
||||
},
|
||||
{
|
||||
key: 'description',
|
||||
label: '备注',
|
||||
type: 'TEXTAREA',
|
||||
key: "description",
|
||||
label: getLabel(111, "备注"),
|
||||
type: "TEXTAREA",
|
||||
viewAttr: 2,
|
||||
tip: ''
|
||||
},
|
||||
tip: ""
|
||||
}
|
||||
];
|
||||
export const valTakeOptions = [
|
||||
{ key: "1", showname: getLabel(111, "输入") },
|
||||
{ key: "2", showname: getLabel(111, "公式") },
|
||||
{ key: "3", showname: "SQL" }
|
||||
];
|
||||
export const valTakeOptions=[
|
||||
{key: "1", showname: '输入'},
|
||||
{key: "2", showname: '公式'},
|
||||
{key: "3", showname: 'SQL'},
|
||||
]
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import React from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { Button, Dropdown, Menu, message, Modal, Switch } from "antd";
|
||||
import { WeaInputSearch, WeaNewScroll, WeaSlideModal, WeaTop } from "ecCom";
|
||||
import { WeaInputSearch, WeaLocaleProvider, WeaNewScroll, WeaSlideModal, WeaTop } from "ecCom";
|
||||
import { renderLoading } from "../../util";
|
||||
import CustomTab from "../../components/customTab";
|
||||
import SystemSalaryItemModal from "./systemSalaryItemModal";
|
||||
|
|
@ -11,6 +11,7 @@ import CustomSalaryItemSlide from "./customSalaryItemSlide";
|
|||
import CustomPaginationTable from "../../components/customPaginationTable";
|
||||
import "../socialSecurityBenefits/programme/index.less";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
@inject("salaryItemStore", "taxAgentStore", "salaryFileStore")
|
||||
@observer
|
||||
export default class SalaryItem extends React.Component {
|
||||
|
|
@ -36,8 +37,8 @@ export default class SalaryItem extends React.Component {
|
|||
} else if (item.dataIndex == "cz") {
|
||||
item.render = () => {
|
||||
return (<div>
|
||||
<a style={{ marginRight: "10px" }}>编辑</a>
|
||||
<a style={{ marginRight: "10px" }}>删除</a>
|
||||
<a style={{ marginRight: "10px" }}>{getLabel(111, "编辑")}</a>
|
||||
<a style={{ marginRight: "10px" }}>{getLabel(111, "删除")}</a>
|
||||
{/* <a>操作日志</a> */}
|
||||
</div>);
|
||||
};
|
||||
|
|
@ -80,8 +81,8 @@ export default class SalaryItem extends React.Component {
|
|||
handleDeleteItem(record) {
|
||||
const { salaryItemStore: { deleteItemRequest, getTableDatas } } = this.props;
|
||||
Modal.confirm({
|
||||
title: "信息确认",
|
||||
content: "确认删除该条数据吗?",
|
||||
title: getLabel(111, "信息确认"),
|
||||
content: `${getLabel(111, "确认删除该条数据吗")}?`,
|
||||
onOk: () => {
|
||||
deleteItemRequest([record.id]).then(() => {
|
||||
getTableDatas({ ...this.state.searchParams }).then(res => {
|
||||
|
|
@ -123,12 +124,12 @@ export default class SalaryItem extends React.Component {
|
|||
});
|
||||
columns.push({
|
||||
key: "operate",
|
||||
title: "操作",
|
||||
title: getLabel(111, "操作"),
|
||||
render: (text, record) => {
|
||||
return (
|
||||
<a onClick={() => {
|
||||
this.onEditItem(record, true);
|
||||
}}>{(showSalaryItemBtn || showOperateBtn) ? "编辑" : "查看"}</a>
|
||||
}}>{(showSalaryItemBtn || showOperateBtn) ? getLabel(111, "编辑") : getLabel(111, "查看")}</a>
|
||||
);
|
||||
}
|
||||
});
|
||||
|
|
@ -143,7 +144,7 @@ export default class SalaryItem extends React.Component {
|
|||
<Menu.Item>
|
||||
<a href="javascript: void(0);" onClick={() => {
|
||||
this.handleDeleteItem(record);
|
||||
}}>删除</a>
|
||||
}}>{getLabel(111, "删除")}</a>
|
||||
</Menu.Item>
|
||||
</Menu>}>
|
||||
<a href="javascript:void(0)" style={{ textDecoration: "none" }}><i className="icon-coms-more"
|
||||
|
|
@ -236,8 +237,8 @@ export default class SalaryItem extends React.Component {
|
|||
|
||||
const menu = (
|
||||
<Menu onClick={handleMenuClick}>
|
||||
<Menu.Item key="1">系统薪资项</Menu.Item>
|
||||
<Menu.Item key="2">自定义薪资项</Menu.Item>
|
||||
<Menu.Item key="1">{getLabel(111, "系统薪资项")}</Menu.Item>
|
||||
<Menu.Item key="2">{getLabel(111, "自定义薪资项")}</Menu.Item>
|
||||
</Menu>
|
||||
|
||||
);
|
||||
|
|
@ -246,7 +247,8 @@ export default class SalaryItem extends React.Component {
|
|||
return (<div style={{ display: "inline-block" }}>
|
||||
{
|
||||
(showOperateBtn || showSalaryItemBtn) &&
|
||||
<Dropdown.Button overlay={menu} type="primary" style={{ marginRight: "10px" }}>新增</Dropdown.Button>
|
||||
<Dropdown.Button overlay={menu} type="primary"
|
||||
style={{ marginRight: "10px" }}>{getLabel(111, "新增")}</Dropdown.Button>
|
||||
}
|
||||
{
|
||||
(showOperateBtn || showSalaryItemBtn) &&
|
||||
|
|
@ -255,12 +257,12 @@ export default class SalaryItem extends React.Component {
|
|||
style={{ marginRight: "10px" }}
|
||||
onClick={() => {
|
||||
if (!selectedRowKeys.length) {
|
||||
message.info("未选中任何数据!");
|
||||
message.info(getLabel(111, "未选中任何数据"));
|
||||
return;
|
||||
}
|
||||
Modal.confirm({
|
||||
title: "信息确认",
|
||||
content: `确定要将所选的薪资项(共${selectedRowKeys.length}条数据)删除吗?`,
|
||||
title: getLabel(111, "信息确认"),
|
||||
content: `${getLabel(111, "确定要将所选的薪资项")}(${getLabel(111, "共")}${selectedRowKeys.length})${getLabel(111, "条数据")}${getLabel(111, "删除吗")}?`,
|
||||
onOk: () => {
|
||||
deleteItemRequest(selectedRowKeys).then(() => {
|
||||
getTableDatas({ ...this.state.searchParams }).then(res => {
|
||||
|
|
@ -275,9 +277,9 @@ export default class SalaryItem extends React.Component {
|
|||
});
|
||||
}
|
||||
});
|
||||
}}>批量删除薪资项</Button>
|
||||
}}>{getLabel(111, "批量删除薪资项")}</Button>
|
||||
}
|
||||
<WeaInputSearch value={this.state.searchValue} placeholder={"请输入名称"} onChange={(value) => {
|
||||
<WeaInputSearch value={this.state.searchValue} placeholder={getLabel(111, "请输入名称")} onChange={(value) => {
|
||||
this.setState({ searchValue: value });
|
||||
}} onSearch={(value) => {
|
||||
this.handleSearch(value);
|
||||
|
|
@ -292,8 +294,8 @@ export default class SalaryItem extends React.Component {
|
|||
const { name, sharedType, taxAgentIds } = request;
|
||||
if (!name || (sharedType === "1" && !taxAgentIds)) {
|
||||
Modal.warning({
|
||||
title: "信息确认",
|
||||
content: "必要信息不完整,红色*为必填项!"
|
||||
title: getLabel(111, "信息确认"),
|
||||
content: `${getLabel(111, "必要信息不完整,红色*为必填项")}!`
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
|
@ -315,16 +317,16 @@ export default class SalaryItem extends React.Component {
|
|||
arrList = [
|
||||
<Button type="primary" onClick={() => {
|
||||
handleSlideSave(false);
|
||||
}}>保存</Button>,
|
||||
}}>{getLabel(111, "保存")}</Button>,
|
||||
<Button type="default" onClick={() => {
|
||||
handleSlideSave(true);
|
||||
}}>保存并继续创建</Button>
|
||||
}}>{getLabel(111, "保存并继续创建")}</Button>
|
||||
];
|
||||
} else if (this.state.editable) {
|
||||
arrList = [
|
||||
<Button type="primary" onClick={() => {
|
||||
handleSlideSave(false);
|
||||
}}>保存</Button>
|
||||
}}>{getLabel(111, "保存")}</Button>
|
||||
];
|
||||
}
|
||||
return arrList;
|
||||
|
|
@ -344,7 +346,7 @@ export default class SalaryItem extends React.Component {
|
|||
return (
|
||||
<div className="mySalaryBenefitsWrapper">
|
||||
<WeaTop
|
||||
title="薪资项目管理"
|
||||
title={getLabel(111, "薪资项目管理")}
|
||||
icon={<i className="icon-coms-fa"/>}
|
||||
iconBgcolor="#F14A2D"
|
||||
showDropIcon={false}
|
||||
|
|
@ -399,7 +401,7 @@ export default class SalaryItem extends React.Component {
|
|||
direction={"right"}
|
||||
title={
|
||||
<SlideModalTitle
|
||||
subtitle={(this.state.isAdd ? "新建" : "修改") + "自定义薪资项目"}
|
||||
subtitle={(this.state.isAdd ? getLabel(111, "新建") : getLabel(111, "修改")) + getLabel(111, "自定义薪资项目")}
|
||||
editable={false}
|
||||
showOperateBtn={(showSalaryItemBtn || showOperateBtn)}
|
||||
customOperate={(showSalaryItemBtn || showOperateBtn) ? renderCustomOperate() : []}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,12 @@
|
|||
import React from "react";
|
||||
import { WeaDialog, WeaInputSearch } from "ecCom";
|
||||
import { WeaDialog, WeaInputSearch, WeaLocaleProvider } from "ecCom";
|
||||
import { Button } from "antd";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { WeaTableNew } from "comsMobx";
|
||||
import "./index.less";
|
||||
|
||||
const WeaTable = WeaTableNew.WeaTable;
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
@inject("salaryItemStore")
|
||||
@observer
|
||||
|
|
@ -41,7 +42,7 @@ export default class SystemSalaryItemModal extends React.Component {
|
|||
|
||||
return (
|
||||
<WeaDialog
|
||||
title="添加系统薪资项目"
|
||||
title={getLabel(111, "添加系统薪资项目")}
|
||||
initLoadCss
|
||||
className="sys-salary-wrapper"
|
||||
visible={this.props.visible}
|
||||
|
|
@ -56,13 +57,13 @@ export default class SystemSalaryItemModal extends React.Component {
|
|||
onClick={() => {
|
||||
handleAdd();
|
||||
}}
|
||||
>添加</Button>
|
||||
>{getLabel(111, "添加")}</Button>
|
||||
]}
|
||||
>
|
||||
<div className="headerSearchWrapper">
|
||||
<WeaInputSearch
|
||||
value={searchValue}
|
||||
placeholder="请输入名称"
|
||||
placeholder={getLabel(111, "请输入名称")}
|
||||
onChange={(value) => {
|
||||
this.handleSearchChange(value);
|
||||
}}
|
||||
|
|
|
|||
|
|
@ -462,7 +462,7 @@ export default class StandingBook extends React.Component {
|
|||
return (
|
||||
<div className="standingbookWrapper">
|
||||
<WeaTop
|
||||
title={getLabel(111, "社保福利台账")} // 文字
|
||||
title={getLabel(542170, "社保福利台账")} // 文字
|
||||
icon={<i className="icon-coms-fa"/>} // 左侧图标
|
||||
iconBgcolor="#F14A2D" // 左侧图标背景色
|
||||
buttons={showOperateBtn ? rightBtns : []}
|
||||
|
|
|
|||
Loading…
Reference in New Issue