Merge branch 'feature/2.8.3-2308-智能算薪' into feature/v2-对接e10个税扣缴义务人设置-1121

This commit is contained in:
黎永顺 2023-08-09 11:47:37 +08:00
commit c2eb4400c4
17 changed files with 435 additions and 93 deletions

View File

@ -0,0 +1,15 @@
import { WeaTools } from "ecCom";
import { postFetch } from "../util/request";
//智能算薪-计费配置编辑表单
export const apiflowBillingConfigGet = (params) => {
return WeaTools.callApi("/api/bs/hrmsalary/taxdeclaration/apiflow/billing/config/get", "GET", params);
};
//智能算薪-计费配置保存
export const apiflowBillingConfigSave = (params) => {
return postFetch("/api/bs/hrmsalary/taxdeclaration/apiflow/billing/config/save", params);
};
//智能算薪-计费配置开关
export const apiflowBillingConfigEnable = (params) => {
return postFetch("/api/bs/hrmsalary/taxdeclaration/apiflow/billing/config/enable", params);
};

View File

@ -5,6 +5,7 @@
border-radius: 0px 0px 5px 5px;
width: 100%;
overflow: hidden;
.titleWrapper {
width: 100%;
line-height: 19.2px;
@ -12,22 +13,26 @@
border-bottom: 1px solid #e2ecf2;
background-color: #f7fbfe;
}
.tipContentWrapper {
padding: 10px;
background: #FFF;
}
.tipContentItem {
line-height: 20px;
padding: 0px 16px;
padding-top: 10px;
padding: 10px 16px 0px;
color: rgb(153, 153, 153);
}
.tipContentItem:first {
padding-top: 0px;
.tipContentItem:first-child {
padding-top: 0;
}
.formLabel {
font-size: 14px;
}
.contentWrapper {
width: 100%;
overflow: hidden;

View File

@ -123,10 +123,10 @@ class CodeAction extends Component {
<div className="excel-codeAction">
<div className="excel-codeAction-item">
<div className="excel-codeAction-header">
<div className="excel-codeAction-header-title">{getLabel(111, "变量")}</div>
<div className="excel-codeAction-header-title">{getLabel(33748, "变量")}</div>
</div>
<div className="excel-codeAction-content">
<WeaInputSearch value={variableText} placeholder={getLabel(111, "请输入变量名称")}
<WeaInputSearch value={variableText} placeholder={getLabel(125864, "请输入变量名称")}
className="variableOuterInput"
onChange={variableText => this.setState({ variableText })}/>
<Tree className="variableTree" showLine expandedKeys={variableExpandedKeys}
@ -146,7 +146,7 @@ class CodeAction extends Component {
title={
<WeaInputSearch
value={variItemText}
placeholder={getLabel(111, "请输入变量名称")}
placeholder={getLabel(125864, "请输入变量名称")}
onChange={variItemText => this.setState({ variItemText })}
/>
}
@ -166,10 +166,10 @@ class CodeAction extends Component {
<React.Fragment>
<div className="excel-codeAction-item">
<div className="excel-codeAction-header">
<div className="excel-codeAction-header-title">{getLabel(111, "函数")}</div>
<div className="excel-codeAction-header-title">{getLabel(30686, "函数")}</div>
</div>
<div className="excel-codeAction-content">
<WeaInputSearch value={funcText} placeholder={getLabel(111, "请输入函数名称")}
<WeaInputSearch value={funcText} placeholder={getLabel(543713, "请输入函数名称")}
className="variableOuterInput"
onChange={funcText => this.setState({ funcText })}/>
<Tree className="variableTree" showLine expandedKeys={funcExpandedKeys}
@ -207,7 +207,7 @@ class CodeAction extends Component {
<div className="excel-codeAction-item">
<div className="excel-codeAction-header">
<div className="excel-codeAction-header-title">
{!_.isEmpty(funcHoverItem) ? funcHoverItem.name : getLabel(111, "提示")}
{!_.isEmpty(funcHoverItem) ? funcHoverItem.name : getLabel(558, "提示")}
</div>
</div>
<div className="excel-codeAction-content"><TipList tips={funcHoverItem}/></div>
@ -232,12 +232,12 @@ const TipList = (props) => {
</div>
</div> : <div className="code-action-list">
<div className="code-action-tips">
<div className="code-action-tips-title">{getLabel(111, "语法")}</div>
<div className="code-action-tips-title">{getLabel(543403, "语法")}</div>
<div className="code-action-tips-info">
<div>{formatString}</div>
<div>{description}</div>
</div>
<div className="code-action-tips-title">{getLabel(111, "参数")}</div>
<div className="code-action-tips-title">{getLabel(561, "参数")}</div>
{
_.map(paramDescs, it => {
return <div className="code-action-tips-info">
@ -246,9 +246,9 @@ const TipList = (props) => {
</div>;
})
}
<div className="code-action-tips-title">{getLabel(111, "示例")}</div>
<div className="code-action-tips-title">{getLabel(82159, "示例")}</div>
<span className="code-action-tips-info">{example}</span>
<div className="code-action-tips-title">{getLabel(111, "结果")}</div>
<div className="code-action-tips-title">{getLabel(356, "结果")}</div>
<span className="code-action-tips-info">{result}</span>
</div>
</div>;

View File

@ -157,7 +157,7 @@ class ExcelEditor extends Component {
</div>
<Button type="ghost"
onClick={() => this.setState({ isFormter: !isFormter }, () => this.autoFormatSelection())}>
{!isFormter ? getLabel(111, "格式美化") : getLabel(111, "格式还原")}
{!isFormter ? getLabel(543711, "格式美化") : getLabel(543712, "格式还原")}
</Button>
</div>
}

View File

@ -38,6 +38,7 @@ import EmployeeList from "./pages/employeeView";
import ReportView from "./pages/reportView";
import MySalaryView from "./pages/mySalary/mySalaryView";
import WatermarkPreview from "./pages/payroll/watermarkPreview";
import IntelligentCalculateSalarySettings from "./pages/intelligentCalculateSalarySettings";
import stores from "./stores";
import "./style/index";
@ -87,6 +88,7 @@ const DataAcquisition = (props) => props.children;
// fieldManagement 字段管理
// analysisOfSalaryStatistics 薪酬统计分析
// reportView 薪酬报表查看
// intelligentCalculateSalarySettings 智能算薪
const Routes = (
<Route
@ -165,6 +167,8 @@ const Routes = (
<Route key="analysisOfSalaryStatistics" path="analysisOfSalaryStatistics" component={AnalysisOfSalaryStatistics}/>
<Route key="analysisOfSalaryStatisticsId" path="analysisOfSalaryStatistics/:employeeId" component={EmployeeList}/>
<Route key="reportView" path="reportView" component={ReportView}/>
<Route key="intelligentCalculateSalarySettings" path="intelligentCalculateSalarySettings"
component={IntelligentCalculateSalarySettings}/>
</Route>
);

View File

@ -11,7 +11,7 @@ export const condition = [
conditionType: "SELECT",
domkey: ["dimType"],
fieldcol: 14,
label: getLabel(111, "维度类型"),
label: getLabel(389137, "维度类型"),
labelcol: 6,
options: [],
detailtype: 3,
@ -23,7 +23,7 @@ export const condition = [
conditionType: "SELECT",
domkey: ["setting4Qualitative"],
fieldcol: 14,
label: getLabel(111, "统计维度"),
label: getLabel(506800, "统计维度"),
labelcol: 6,
options: [],
rules: "required|string",
@ -34,7 +34,7 @@ export const condition = [
conditionType: "INPUT",
domkey: ["dimName"],
fieldcol: 14,
label: getLabel(111, "统计维度名称"),
label: getLabel(543321, "统计维度名称"),
labelcol: 6,
value: "",
rules: "required|string",
@ -45,7 +45,7 @@ export const condition = [
conditionType: "SELECT",
domkey: ["dimCode"],
fieldcol: 14,
label: getLabel(111, "分组所属字段"),
label: getLabel(543322, "分组所属字段"),
labelcol: 6,
options: [],
viewAttr: 2,
@ -57,13 +57,13 @@ export const condition = [
conditionType: "TEXTAREA",
domkey: ["remark"],
fieldcol: 14,
label: getLabel(111, "描述"),
label: getLabel(433, "描述"),
labelcol: 6,
value: "",
viewAttr: 2
}
],
title: getLabel(111, "基础设置"),
title: getLabel(82751, "基础设置"),
defaultshow: true
}
];
@ -75,7 +75,7 @@ export const reportCondition = [
conditionType: "INPUT",
domkey: ["reportName"],
fieldcol: 14,
label: getLabel(111, "报表名称"),
label: getLabel(15517, "报表名称"),
labelcol: 6,
value: "",
rules: "required|string",
@ -86,7 +86,7 @@ export const reportCondition = [
conditionType: "SELECT",
domkey: ["dimensionIds"],
fieldcol: 14,
label: getLabel(111, "统计维度"),
label: getLabel(506800, "统计维度"),
labelcol: 6,
options: [],
rules: "required|string",

View File

@ -89,8 +89,8 @@ class DimensionSlide extends Component {
if (dimType === "QUALITATIVE") {
if (!setting4Qualitative || !extraParams.dimName) {
Modal.warning({
title: getLabel(111, "信息确认"),
content: getLabel(111, "必要信息不完整,红色*为必填项!")
title: getLabel(131329, "信息确认"),
content: getLabel(383779, "必要信息不完整,红色*为必填项!")
});
return;
}
@ -100,8 +100,8 @@ class DimensionSlide extends Component {
} else {
if (!extraParams.dimName) {
Modal.warning({
title: getLabel(111, "信息确认"),
content: getLabel(111, "必要信息不完整,红色*为必填项!")
title: getLabel(131329, "信息确认"),
content: getLabel(383779, "必要信息不完整,红色*为必填项!")
});
return;
}
@ -109,7 +109,7 @@ class DimensionSlide extends Component {
const { setting4RationGroupSpacing } = this.state;
const bool = _.every(setting4RationGroupSpacing, it => it.startValue !== "" && it.endValue !== "" && it.startValue <= it.endValue);
if (_.isEmpty(setting4RationGroupSpacing) || !bool) {
message.warning(getLabel(111, "请完善分组设置相关数据!分组设置不能为空,起始值结束值必填,且起始值需小于结束值!"));
message.warning(getLabel(543318, "请完善分组设置相关数据!分组设置不能为空,起始值结束值必填,且起始值需小于结束值!"));
return;
} else {
payload = {
@ -127,7 +127,7 @@ class DimensionSlide extends Component {
const { setting4RationGroupIndividual } = this.state;
const bool = _.every(setting4RationGroupIndividual, it => it.value !== "");
if (_.isEmpty(setting4RationGroupIndividual) || !bool) {
message.warning(getLabel(111, "请完善分组设置相关数据!分组设置不能为空,且数值必填"));
message.warning(getLabel(543319, "请完善分组设置相关数据!分组设置不能为空,且数值必填"));
return;
} else {
payload = {
@ -141,11 +141,11 @@ class DimensionSlide extends Component {
dimensionSave(payload).then(({ status, errormsg }) => {
this.setState({ loading: false });
if (status) {
message.success(getLabel(111, "保存成功"));
message.success(getLabel(22619, "保存成功"));
onCancel(true);
this.props.form.resetForm();
} else {
message.error(errormsg || getLabel(111, "保存失败"));
message.error(errormsg || getLabel(22620, "保存失败"));
}
}).catch(() => this.setState({ loading: false }));
};
@ -176,15 +176,15 @@ class DimensionSlide extends Component {
className="dimensionSlideWrapper"
title={
<div className="dimensionTitle">
<span>{formId ? getLabel(111, "编辑统计维度") : getLabel(111, "新建统计维度")}</span>
<Button type="primary" onClick={this.handleSave} loading={loading}>{getLabel(111, "保存")}</Button>
<span>{formId ? getLabel(543407, "编辑统计维度") : getLabel(543314, "新建统计维度")}</span>
<Button type="primary" onClick={this.handleSave} loading={loading}>{getLabel(537558, "保存")}</Button>
</div>
}
>
{getSearchs(form, condition, 1, false, this.formItemChange)}
{
dimType !== "QUALITATIVE" &&
<WeaSearchGroup title={getLabel(111, "分组设置")} showGroup>
<WeaSearchGroup title={getLabel(34105, "分组设置")} showGroup>
{
dimType === "RATION_GROUP_SPACING" &&
<GroupSpacingEditTable onChange={this.handleConvertGroupDatasource}

View File

@ -47,15 +47,15 @@ class DimensionTable extends Component {
};
dimensionDelete = (payload) => {
Modal.confirm({
title: getLabel(111, "信息确认"),
content: getLabel(111, "确认要删除吗?"),
title: getLabel(131329, "信息确认"),
content: getLabel(388758, "确认要删除吗?"),
onOk: () => {
dimensionDelete(payload).then(({ status, errormsg }) => {
if (status) {
message.success(getLabel(111, "删除成功"));
message.success(getLabel(502230, "删除成功"));
this.dimensionList();
} else {
message.error(errormsg || getLabel(111, "删除失败"));
message.error(errormsg || getLabel(20462, "删除失败"));
}
});
}
@ -67,7 +67,7 @@ class DimensionTable extends Component {
const { onEdit } = this.props;
const pagination = {
...pageInfo,
showTotal: total => `${getLabel(111, "共")} ${total} ${getLabel(111, "条")}`,
showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`,
showQuickJumper: true,
showSizeChanger: true,
pageSizeOptions: ["10", "20", "50", "100"],
@ -83,22 +83,22 @@ class DimensionTable extends Component {
}
};
const columns = [
{ dataIndex: "dimName", title: getLabel(111, "统计维度") },
{ dataIndex: "remark", title: getLabel(111, "描述") },
{ dataIndex: "dimType", title: getLabel(111, "维度类型") },
{ dataIndex: "dimName", title: getLabel(506800, "统计维度") },
{ dataIndex: "remark", title: getLabel(433, "描述") },
{ dataIndex: "dimType", title: getLabel(389137, "维度类型") },
{
dataIndex: "operate", title: getLabel(111, "操作"),
dataIndex: "operate", title: getLabel(30585, "操作"),
render: (_, record) => {
return (
<span className="space10">
{
record.canEdit &&
<a href="javascript: void(0);" onClick={() => onEdit(record.id)}>{getLabel(111, "编辑")}</a>
<a href="javascript: void(0);" onClick={() => onEdit(record.id)}>{getLabel(501169, "编辑")}</a>
}
{
record.canDelete &&
<a href="javascript: void(0);"
onClick={() => this.dimensionDelete([record.id])}>{getLabel(111, "删除")}</a>
onClick={() => this.dimensionDelete([record.id])}>{getLabel(535052, "删除")}</a>
}
</span>
);

View File

@ -55,7 +55,7 @@ class EmployeeDetails extends Component {
width: 80,
render: (_, record) => {
return <a target="_blank"
href={`${window.location.origin}/spa/hrmSalary/static/index.html#/main/hrmSalary/analysisOfSalaryStatistics/${record.id}?name=${record.name}&dept=${record.department || ""}`}>{getLabel(111, "查看")}</a>;
href={`${window.location.origin}/spa/hrmSalary/static/index.html#/main/hrmSalary/analysisOfSalaryStatistics/${record.id}?name=${record.name}&dept=${record.department || ""}`}>{getLabel(33564, "查看")}</a>;
}
}]
});
@ -67,7 +67,7 @@ class EmployeeDetails extends Component {
const { dataSource, loading, columns, pageInfo } = this.state;
const pagination = {
...pageInfo,
showTotal: total => `${getLabel(111, "共")} ${total} ${getLabel(111, "条")}`,
showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`,
showQuickJumper: true,
showSizeChanger: true,
pageSizeOptions: ["10", "20", "50", "100"],

View File

@ -32,7 +32,7 @@ class GroupIndividualEditTable extends Component {
const { dataSource } = this.state;
const columns = [
{
title: getLabel(111, "分组设置值"),
title: getLabel(543320, "分组设置值"),
dataIndex: "value",
key: "value",
com: [

View File

@ -39,7 +39,7 @@ class GroupSpacingEditTable extends Component {
const { dataSource } = this.state;
const columns = [
{
title: getLabel(111, "起始值"),
title: getLabel(541412, "起始值"),
dataIndex: "startValue",
key: "startValue",
com: [
@ -47,19 +47,19 @@ class GroupSpacingEditTable extends Component {
]
},
{
title: getLabel(111, "含"),
title: getLabel(33864, "含"),
dataIndex: "includeStart",
key: "includeStart",
com: [
{
type: "CHECKBOX",
key: "includeStart",
otherParams: { content: getLabel(111, "含") }
otherParams: { content: getLabel(33864, "含") }
}
]
},
{
title: getLabel(111, "至"),
title: getLabel(15322, "至"),
dataIndex: "to",
key: "to",
com: [
@ -67,7 +67,7 @@ class GroupSpacingEditTable extends Component {
]
},
{
title: getLabel(111, "结束值"),
title: getLabel(508931, "结束值"),
dataIndex: "endValue",
key: "endValue",
com: [
@ -75,14 +75,14 @@ class GroupSpacingEditTable extends Component {
]
},
{
title: getLabel(111, "含"),
title: getLabel(33864, "含"),
dataIndex: "includeEnd",
key: "includeEnd",
com: [
{
type: "CHECKBOX",
key: "includeEnd",
otherParams: { content: getLabel(111, "含") }
otherParams: { content: getLabel(33864, "含") }
}
]
}
@ -90,7 +90,7 @@ class GroupSpacingEditTable extends Component {
return (
<WeaTableEdit
draggable={true} deleteConfirm columns={columns}
datas={_.map(dataSource, item => ({ ...item, to: getLabel(111, "至") }))}
datas={_.map(dataSource, item => ({ ...item, to: getLabel(15322, "至") }))}
showCopy={false} onChange={this.handleChangeTableData}
/>
);

View File

@ -34,16 +34,16 @@ class ReportList extends Component {
};
reportStatisticsReportDelete = (payload) => {
Modal.confirm({
title: getLabel(111, "信息确认"),
content: getLabel(111, "确认删除本条数据吗?"),
title: getLabel(131329, "信息确认"),
content: getLabel(543231, "确认删除本条数据吗?"),
onOk: () => {
const { reportName = "" } = this.props;
reportStatisticsReportDelete(payload).then(({ status, errormsg }) => {
if (status) {
message.success(getLabel(111, "删除成功"));
message.success(getLabel(502230, "删除成功"));
this.reportStatisticsReportList({ reportName });
} else {
message.error(errormsg || getLabel(111, "删除失败"));
message.error(errormsg || getLabel(20462, "删除失败"));
}
});
}
@ -71,7 +71,7 @@ class ReportList extends Component {
return (
<Row gutter={16} className="reportRow">
{
_.isEmpty(dataSource) ? <div className="empty">{getLabel(111, "暂无数据")}</div> :
_.isEmpty(dataSource) ? <div className="empty">{getLabel(83553, "暂无数据")}</div> :
_.map(dataSource, it => {
const { reportName, dimension, id, dimensionId } = it;
return <Col className="gutter-row" span={6} onClick={() => this.handleGoReportView(id)}>
@ -80,15 +80,15 @@ class ReportList extends Component {
<div className="cardCenter">
<span className="reportName">{reportName}</span>
<div className="dimension">
<div className="label">{getLabel(111, "统计维度")}</div>
<div className="label">{getLabel(506800, "统计维度")}</div>
<div className="value">{dimension}</div>
</div>
</div>
<div className="cardRight">
<Dropdown overlay={
<Menu onClick={e => this.handleOptsClick(e, id, dimensionId)}>
<Menu.Item key="edit">{getLabel(111, "编辑")}</Menu.Item>
<Menu.Item key="delete">{getLabel(111, "删除")}</Menu.Item>
<Menu.Item key="edit">{getLabel(501169, "编辑")}</Menu.Item>
<Menu.Item key="delete">{getLabel(535052, "删除")}</Menu.Item>
</Menu>
}>
<Button type="ghost"><i className="icon-coms-more"/></Button>

View File

@ -31,15 +31,15 @@ class StatisticsModal extends Component {
this.setState({ loading: false });
if (status) {
onCancel(true);
message.success(getLabel(111, "保存成功"));
message.success(getLabel(22619, "保存成功"));
form.resetForm();
} else {
message.error(errormsg || getLabel(111, "保存失败"));
message.error(errormsg || getLabel(22620, "保存失败"));
}
}).catch(() => this.setState({ loading: false }));
} else {
Modal.warning({
title: getLabel(111, "信息确认"),
title: getLabel(131329, "信息确认"),
content: getLabel(111, "必要信息不完整,红色*为必填项!")
});
}

View File

@ -0,0 +1,150 @@
/*
* Author: 黎永顺
* name: 启用设置
* Description:
* Date: 2023/7/19
*/
import React, { Component } from "react";
import { Button, Col, Input, message, Modal, Row } from "antd";
import TipLabel from "../../../components/TipLabel";
import { WeaCheckbox, WeaFormItem, WeaLocaleProvider, WeaSearchGroup } from "ecCom";
import {
apiflowBillingConfigEnable,
apiflowBillingConfigGet,
apiflowBillingConfigSave
} from "../../../apis/intelligentCalculateSalarySettings";
import "./index.less";
const getLabel = WeaLocaleProvider.getLabel;
class EnableSettings extends Component {
constructor(props) {
super(props);
this.state = {
enable: "1", id: "",
appKey: "", appSecret: "",
loading: false
};
}
componentDidMount() {
this.apiflowBillingConfigGet();
}
apiflowBillingConfigGet = () => {
apiflowBillingConfigGet().then(({ status, data }) => {
if (status) {
const { id, appKey, appSecret, enable } = data;
this.setState({
appKey, appSecret, enable: enable ? "1" : "0", id
});
}
});
};
apiflowBillingConfigEnable = (enable) => {
apiflowBillingConfigEnable({ enable }).then(({ status, errormsg }) => {
if (status) {
message.success(enable === "OFF" ? getLabel(111, "关闭成功!") : getLabel(111, "开启成功!"));
enable === "OFF" && this.setState({ enable: "0" });
} else {
message.error(errormsg || (enable === "OFF" ? getLabel(111, "关闭失败!") : getLabel(111, "开启失败!")));
this.setState({ enable: this.state.enable });
}
});
};
apiflowBillingConfigSave = () => {
const { enable, id, appKey, appSecret } = this.state;
const payload = {
id, appKey, appSecret,
enable: enable === "1" ? "ON" : "OFF"
};
this.setState({ loading: true });
apiflowBillingConfigSave(payload).then(({ status, errormsg }) => {
this.setState({ loading: false });
if (status) {
message.success(getLabel(384521, "设置成功!"));
} else {
message.error(errormsg || getLabel(384522, "设置失败!"));
}
}).catch(() => this.setState({ loading: false }));
};
handleEnale = (enable) => {
if (enable === "1") {
this.setState({ enable }, () => this.apiflowBillingConfigEnable("ON"));
} else {
Modal.confirm({
title: getLabel(131329, "信息确认"),
content: getLabel(544344, "确定要关闭智能算薪功能吗?关闭后,将无法使用在线报送人员信息、在线获取专项附加扣除数据、在线个税申报等功能!"),
onOk: () => this.apiflowBillingConfigEnable("OFF"),
onCancel: () => {
this.setState({ enable: this.state.enable });
}
});
}
};
handleChangeInput = (key, val) => this.setState({ [key]: val });
render() {
const { enable, appKey, appSecret, loading } = this.state;
const tipList = [
getLabel(544282, "1、智能算薪默认是开启的若购买了智能算薪请先配置账号密码在购买的流量足够的前提下即可正常使用"),
getLabel(544283, "2、您可在【接口流量统计】中查看接口流量使用情况"),
getLabel(544284, "3、您可以设置【流量不足提醒】提前提醒可以避免次月要用时因流量不足无法使用的情况。"),
getLabel(544285, "4、如您需了解您购买的流量的使用明细可查看【流量使用记录】")
];
const InputAccount = label => {
return (
<WeaFormItem label={label} labelCol={{ span: 4 }} wrapperCol={{ span: 18 }}>
<Input
value={appKey} autoComplete="new-password" placeholder={getLabel(83869, "请输入")}
onChange={e => this.handleChangeInput("appKey", e.target.value)}
/>
</WeaFormItem>
);
};
const InputPassword = label => {
return (
<WeaFormItem label={label} labelCol={{ span: 4 }} wrapperCol={{ span: 18 }}>
<Input
value={appSecret} type="password" autoComplete="new-password" placeholder={getLabel(83869, "请输入")}
onChange={e => this.handleChangeInput("appSecret", e.target.value)}
/>
</WeaFormItem>
);
};
return (
<Row className="enable-settings" gutter={16}>
<Col span={16}>
<div className="swith-area">
<div className="left">
<div className="title">{getLabel(111, "智能算薪")}</div>
<div
className="info">{getLabel(111, "开启智能算薪并输入正确的账号密码,且购买了智能算薪流量,才能正常使用智能算薪功能。")}</div>
</div>
<div className="right"><WeaCheckbox display="switch" value={enable} onChange={this.handleEnale}/></div>
</div>
<div className="userinfo">
<div className="left">
<WeaSearchGroup
showGroup needTigger={false} col={3}
items={[
{ com: InputAccount(getLabel(83594, "账号")) },
{ com: InputPassword(getLabel(33150, "密码")) }
]}
/>
</div>
<div className="right">
<Button type="primary" onClick={this.apiflowBillingConfigSave}
loading={loading}>{getLabel(725, "提交")}</Button>
</div>
</div>
</Col>
<Col span={8}>
<TipLabel tipList={tipList}/>
</Col>
</Row>
);
}
}
export default EnableSettings;

View File

@ -0,0 +1,58 @@
.enable-settings {
.swith-area, .userinfo {
display: flex;
align-items: center;
justify-content: space-between;
padding: 10px 16px;
background-color: #fff;
box-sizing: border-box;
height: 80px;
border: 2px solid #e5e5e5;
border-left-color: #5d9cec;
.left {
padding: 10px 0;
display: flex;
flex-direction: column;
justify-content: space-around;
.title {
font-size: 14px;
margin-bottom: 4px;
}
.info {
font-size: 12px;
color: #999;
}
}
}
.userinfo {
margin-top: 16px;
.left {
flex: 1 !important;
.wea-search-group, .wea-form-cell {
padding: 0;
}
}
}
}
.insufficientAlertWrapper {
background: #fff;
padding: 0;
border: 1px solid #f2f2f2;
border-bottom: none;
.wea-content {
padding: 0;
.wea-form-item {
padding: 5px 12px;
border-bottom: 1px solid #f2f2f2;
}
}
}

View File

@ -0,0 +1,57 @@
/*
* Author: 黎永顺
* name:流量不足提醒
* Description:
* Date: 2023/7/19
*/
import React, { Component } from "react";
import { WeaCheckbox, WeaFormItem, WeaHelpfulTip, WeaLocaleProvider, WeaSearchGroup } from "ecCom";
import "./index.less";
const getLabel = WeaLocaleProvider.getLabel;
class InsufficientTrafficAlert extends Component {
constructor(props) {
super(props);
this.state = {
remind: "0"
};
}
render() {
const { remind } = this.state;
return (
<WeaSearchGroup showGroup needTigger={false} className="insufficientAlertWrapper">
<WeaFormItem label={getLabel(501480, "提醒")} labelCol={{ span: 4 }} wrapperCol={{ span: 20 }}>
<WeaCheckbox display="switch" value={remind} onChange={remind => this.setState({ remind })}/>
</WeaFormItem>
{
remind === "1" &&
<React.Fragment>
<WeaFormItem
label={getLabel(544288, "提醒规则")}
labelCol={{ span: 4 }} wrapperCol={{ span: 20 }}
>
<WeaCheckbox display="switch"/>
</WeaFormItem>
<WeaFormItem
label={getLabel(544287, "提醒推送方式")}
labelCol={{ span: 4 }} wrapperCol={{ span: 20 }}
>
<WeaCheckbox display="switch"/>
<WeaHelpfulTip
width={200} style={{ marginLeft: 10 }}
title={getLabel(544286, "使用云桥之前,请先确认企业微信是否绑定云桥。\n" +
"使用邮箱之前,请先确认是否设置邮件提醒账号。\n" +
"使用短信之前,请先确认是否新建签名。")}
placement="topLeft"
/>
</WeaFormItem>
</React.Fragment>
}
</WeaSearchGroup>
);
}
}
export default InsufficientTrafficAlert;

View File

@ -0,0 +1,53 @@
import React, { Component } from "react";
import { WeaLocaleProvider, WeaReqTop } from "ecCom";
import EnableSettings from "./components/enableSettings";
import InsufficientTrafficAlert from "./components/insufficientTrafficAlert";
const getLabel = WeaLocaleProvider.getLabel;
const tabs = [
{ key: "ENABLE_SETTINGS", title: getLabel(111, "启用设置") },
{ key: "INTERFACE_FLOW_STATISTICS", title: getLabel(111, "接口流量统计") },
{ key: "INSUFFICIENT_TRAFFIC_ALERT", title: getLabel(111, "流量不足提醒") },
{ key: "TRAFFIC_USAGE_RECORD", title: getLabel(111, "流量使用记录") }
];
class Index extends Component {
constructor(props) {
super(props);
this.state = {
selectedKey: "ENABLE_SETTINGS"
};
}
renderChildren = () => {
const { selectedKey } = this.state;
let CurrentDom = null;
switch (selectedKey) {
case "ENABLE_SETTINGS":
CurrentDom = <EnableSettings/>;
break;
case "INSUFFICIENT_TRAFFIC_ALERT":
CurrentDom = <InsufficientTrafficAlert/>;
break;
default:
CurrentDom = null;
break;
}
return CurrentDom;
};
render() {
const { selectedKey } = this.state;
return (
<WeaReqTop
title={getLabel(111, "智能算薪")} selectedKey={selectedKey}
icon={<i className="icon-coms-fa"/>} iconBgcolor="#F14A2D"
tabDatas={tabs} onChange={selectedKey => this.setState({ selectedKey })}
>
<div style={{ height: "100%", background: "#f6f6f6", padding: 16 }}>{this.renderChildren()}</div>
</WeaReqTop>
);
}
}
export default Index;