feature/2.9.42309.01-薪酬统计报表分享报表

This commit is contained in:
黎永顺 2023-09-21 10:17:06 +08:00
parent d664ad2769
commit 96032b5f1c
5 changed files with 40 additions and 27 deletions

View File

@ -269,7 +269,7 @@ class CustomStatisticsItemsModal extends Component {
render() { render() {
const { loading, columns, dataSource, formData } = this.state; const { loading, columns, dataSource, formData } = this.state;
const { itemName, itemValue, itemValueSpan } = formData; const { itemName, itemValue, itemValueSpan } = formData;
const { statisticsItemId } = this.props; const { statisticsItemId, isShare } = this.props;
const cols = _.map(columns, it => { const cols = _.map(columns, it => {
const { text, column } = it; const { text, column } = it;
if (column === "ruleName" || column === "ratio" || column === "m2m" || column === "y2y") { if (column === "ruleName" || column === "ratio" || column === "m2m" || column === "y2y") {
@ -278,6 +278,7 @@ class CustomStatisticsItemsModal extends Component {
...it, ...it,
title: <span> title: <span>
<WeaCheckbox <WeaCheckbox
disabled={isShare}
value={_.every(dataSource, child => !!child[`${key}Value`])} value={_.every(dataSource, child => !!child[`${key}Value`])}
onChange={val => this.handleChangeColumnAllChecked(`${key}Value`, val)} onChange={val => this.handleChangeColumnAllChecked(`${key}Value`, val)}
/> />
@ -286,6 +287,7 @@ class CustomStatisticsItemsModal extends Component {
render: (txt, record) => { render: (txt, record) => {
return <span> return <span>
<WeaCheckbox <WeaCheckbox
disabled={isShare}
value={record[`${key}Value`].toString()} value={record[`${key}Value`].toString()}
onChange={val => this.handleChangeColumnCheckBox(`${key}Value`, val, record.id)} onChange={val => this.handleChangeColumnCheckBox(`${key}Value`, val, record.id)}
/> />
@ -305,6 +307,7 @@ class CustomStatisticsItemsModal extends Component {
</span>, </span>,
render: (txt, record) => { render: (txt, record) => {
return !!record["m2mValue"] && <IntervalSettingsComp return !!record["m2mValue"] && <IntervalSettingsComp
isShare={isShare}
LowerLimit={record[`${column.replace("Limit", "")}LowerLimit`]} LowerLimit={record[`${column.replace("Limit", "")}LowerLimit`]}
UpperLimit={record[`${column.replace("Limit", "")}UpperLimit`]} UpperLimit={record[`${column.replace("Limit", "")}UpperLimit`]}
onChange={(type, val) => this.handleChangeColumnM2MValue(`${column.replace("Limit", "")}${type === "min" ? "LowerLimit" : "UpperLimit"}`, val, record.id)} onChange={(type, val) => this.handleChangeColumnM2MValue(`${column.replace("Limit", "")}${type === "min" ? "LowerLimit" : "UpperLimit"}`, val, record.id)}
@ -321,6 +324,7 @@ class CustomStatisticsItemsModal extends Component {
</span>, </span>,
render: (txt, record) => { render: (txt, record) => {
return !!record["y2yValue"] && <IntervalSettingsComp return !!record["y2yValue"] && <IntervalSettingsComp
isShare={isShare}
LowerLimit={record[`${column.replace("Limit", "")}LowerLimit`]} LowerLimit={record[`${column.replace("Limit", "")}LowerLimit`]}
UpperLimit={record[`${column.replace("Limit", "")}UpperLimit`]} UpperLimit={record[`${column.replace("Limit", "")}UpperLimit`]}
onChange={(type, val) => this.handleChangeColumnM2MValue(`${column.replace("Limit", "")}${type === "min" ? "LowerLimit" : "UpperLimit"}`, val, record.id)} onChange={(type, val) => this.handleChangeColumnM2MValue(`${column.replace("Limit", "")}${type === "min" ? "LowerLimit" : "UpperLimit"}`, val, record.id)}
@ -335,8 +339,10 @@ class CustomStatisticsItemsModal extends Component {
title={ title={
<div className="itemsTitle"> <div className="itemsTitle">
<span>{statisticsItemId ? getLabel(111, "编辑自定义统计项目") : getLabel(111, "新建自定义统计项目")}</span> <span>{statisticsItemId ? getLabel(111, "编辑自定义统计项目") : getLabel(111, "新建自定义统计项目")}</span>
<Button type="primary" loading={loading} {
onClick={this.handleSaveStatisticalItems}>{getLabel(111, "保存")}</Button> !isShare && <Button type="primary" loading={loading}
onClick={this.handleSaveStatisticalItems}>{getLabel(111, "保存")}</Button>
}
</div> </div>
} }
style={{ width: 900, height: 450 }} style={{ width: 900, height: 450 }}
@ -348,7 +354,7 @@ class CustomStatisticsItemsModal extends Component {
<WeaBrowser <WeaBrowser
title={getLabel(111, "统计项目")} title={getLabel(111, "统计项目")}
type={162} type={162}
viewAttr={3} viewAttr={!isShare ? 3 : 1}
isSingle={false} isSingle={false}
value={itemValue} value={itemValue}
replaceDatas={itemValue ? _.map(itemValue.split(","), (it, idx) => ({ replaceDatas={itemValue ? _.map(itemValue.split(","), (it, idx) => ({
@ -381,7 +387,7 @@ class CustomStatisticsItemsModal extends Component {
</WeaFormItem> </WeaFormItem>
<WeaFormItem label={getLabel(111, "统计项名称")} labelCol={{ span: 6 }} wrapperCol={{ span: 18 }}> <WeaFormItem label={getLabel(111, "统计项名称")} labelCol={{ span: 6 }} wrapperCol={{ span: 18 }}>
<WeaError tipPosition="bottom" ref="nameError" error={getLabel(111, "此项必填")}> <WeaError tipPosition="bottom" ref="nameError" error={getLabel(111, "此项必填")}>
<WeaInput value={itemName} viewAttr={3} <WeaInput value={itemName} viewAttr={!isShare ? 3 : 1}
onChange={itemName => this.setState({ formData: { ...formData, itemName } })}/> onChange={itemName => this.setState({ formData: { ...formData, itemName } })}/>
</WeaError> </WeaError>
</WeaFormItem> </WeaFormItem>
@ -406,11 +412,11 @@ export default CustomStatisticsItemsModal;
* Date: 2023/4/23 * Date: 2023/4/23
*/ */
const IntervalSettingsComp = (props) => { const IntervalSettingsComp = (props) => {
const { LowerLimit, UpperLimit, onChange } = props; const { LowerLimit, UpperLimit, onChange, isShare } = props;
return <div className="intervalSettingsCompWrapper"> return <div className="intervalSettingsCompWrapper">
<WeaInputNumber value={LowerLimit} precision={2} onChange={val => onChange("min", val)}/> <WeaInputNumber value={LowerLimit} precision={2} onChange={val => onChange("min", val)} disabled={isShare}/>
<span className="increaseTitle">{`% <${getLabel(111, "增幅")}<`}</span> <span className="increaseTitle">{`% <${getLabel(111, "增幅")}<`}</span>
<WeaInputNumber value={UpperLimit} precision={2} onChange={val => onChange("max", val)}/> <WeaInputNumber value={UpperLimit} precision={2} onChange={val => onChange("max", val)} disabled={isShare}/>
<span className="pecentTitle">%</span> <span className="pecentTitle">%</span>
</div>; </div>;
}; };

View File

@ -35,8 +35,8 @@ class PovitpivotChartModal extends Component {
componentWillReceiveProps(nextProps, nextContext) { componentWillReceiveProps(nextProps, nextContext) {
if (nextProps.visible !== this.props.visible && nextProps.visible) { if (nextProps.visible !== this.props.visible && nextProps.visible) {
const { id, dimensionId, dimensionValue } = nextProps; const { id, dimensionId, dimensionValue, isShare } = nextProps;
this.getDataPerspective({ id, dimensionId, dimensionValue }); this.getDataPerspective({ id, dimensionId, dimensionValue, isShare });
} else { } else {
this.setState({ this.setState({
dataSource: [], dataSource: [],
@ -63,13 +63,11 @@ class PovitpivotChartModal extends Component {
}); });
} else if (type === "turn") { } else if (type === "turn") {
if (id === "PAGEINFO") { if (id === "PAGEINFO") {
const { id, dimensionId, dimensionValue } = this.props; const { id, dimensionId, dimensionValue, isShare } = this.props;
const { pageNum: current, size: pageSize } = params; const { pageNum: current, size: pageSize } = params;
this.setState({ pageInfo: { ...pageInfo, current, pageSize } }, () => this.setState({ pageInfo: { ...pageInfo, current, pageSize } }, () =>
this.getDataPerspective({ this.getDataPerspective({
id, id, dimensionId, dimensionValue, isShare
dimensionId,
dimensionValue
})); }));
} }
} }

View File

@ -26,7 +26,7 @@ class ReportContent extends Component {
chartsType: "0", chartsType: "0",
chartsInfo: {}, chartsInfo: {},
povitView: { povitView: {
visible: false, id: "", visible: false, id: "", isShare: false,
dimensionId: "", dimensionValue: "" dimensionId: "", dimensionValue: ""
}, },
rangSet: { rangSet: {
@ -66,10 +66,9 @@ class ReportContent extends Component {
const { record } = params; const { record } = params;
const { dimension: dimensionValue } = record; const { dimension: dimensionValue } = record;
const { id: pivotId, dimensionId, isShare } = this.props.report; const { id: pivotId, dimensionId, isShare } = this.props.report;
if (isShare) return;
this.setState({ this.setState({
povitView: { povitView: {
visible: true, id: pivotId, dimensionId, dimensionValue visible: true, id: pivotId, dimensionId, dimensionValue, isShare
} }
}); });
} }
@ -262,7 +261,8 @@ class ReportContent extends Component {
{...povitView} {...povitView}
onCancel={() => this.setState({ onCancel={() => this.setState({
povitView: { povitView: {
visible: false, id: "", dimensionId: "", dimensionValue: "" visible: false, id: "", dimensionId: "", dimensionValue: "",
isShare: false
} }
})} })}
/> />

View File

@ -49,7 +49,7 @@ class StatisticalMicroSettingsSlide extends Component {
salaryMonth: [], salaryMonth: [],
statisticalItemPayload: { statisticalItemPayload: {
visible: false, id: "", dimension: "", visible: false, id: "", dimension: "",
statisticsItemId: "" statisticsItemId: "", isShare: false
} }
}; };
} }
@ -67,7 +67,7 @@ class StatisticalMicroSettingsSlide extends Component {
} }
getTaxAgentSelectList = (props) => { getTaxAgentSelectList = (props) => {
getTaxAgentSelectList(true).then(({ status, data }) => { getTaxAgentSelectList(props.isShare).then(({ status, data }) => {
if (status) { if (status) {
const conditions = _.map(condition, item => { const conditions = _.map(condition, item => {
return { return {
@ -221,7 +221,7 @@ class StatisticalMicroSettingsSlide extends Component {
onClick={() => this.setState({ onClick={() => this.setState({
statisticalItemPayload: { statisticalItemPayload: {
visible: true, id, dimension, visible: true, id, dimension,
statisticsItemId: "" statisticsItemId: "", isShare
} }
})} })}
/> />
@ -243,9 +243,8 @@ class StatisticalMicroSettingsSlide extends Component {
render: (txt, record) => { render: (txt, record) => {
return ( return (
<a href="javascript: void(0);" onClick={() => { <a href="javascript: void(0);" onClick={() => {
if (isShare) return;
this.setState({ this.setState({
statisticalItemPayload: { visible: true, id, dimension, statisticsItemId: record.id } statisticalItemPayload: { visible: true, id, dimension, statisticsItemId: record.id, isShare }
}); });
}}>{txt}</a> }}>{txt}</a>
); );
@ -315,10 +314,8 @@ class StatisticalMicroSettingsSlide extends Component {
{...statisticalItemPayload} {...statisticalItemPayload}
onCancel={(isRefresh) => this.setState({ onCancel={(isRefresh) => this.setState({
statisticalItemPayload: { statisticalItemPayload: {
visible: false, visible: false, id: "", dimension: "",
id: "", statisticsItemId: "", isShare: false
dimension: "",
statisticsItemId: ""
} }
}, () => isRefresh && this.statisticsItemList(this.props.id))} }, () => isRefresh && this.statisticsItemList(this.props.id))}
/> />

View File

@ -204,6 +204,18 @@
.microSlideWrapper { .microSlideWrapper {
z-index: 999; z-index: 999;
.wea-form-item-wrapper {
display: flex !important;
.wea-browser {
width: 100%;
}
}
.wea-form-item .wea-form-item-wrapper .wea-field-readonly {
white-space: pre-wrap !important;
}
.wea-slide-modal-title { .wea-slide-modal-title {
height: auto !important; height: auto !important;
line-height: normal !important; line-height: normal !important;