From 3a8dd06e3c6760f8d811fc14cd6b08ac77c89c47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Fri, 30 Jun 2023 10:17:23 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E4=BA=A7=E5=93=81-=E5=B7=A5=E8=B5=84?= =?UTF-8?q?=E5=8D=95=E6=B0=B4=E5=8D=B0=E9=A2=84=E8=A7=88=E5=92=8C=E6=9F=A5?= =?UTF-8?q?=E7=9C=8B=E4=B8=8D=E4=B8=80=E8=87=B4=E7=9A=84=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E5=A4=84=E7=90=86=EF=BC=8C=E8=B4=A6=E5=A5=97=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E9=A2=84=E8=A7=88=E9=9A=90=E8=97=8F=E5=88=86=E7=BB=84=E6=9C=AA?= =?UTF-8?q?=E5=AE=9E=E7=8E=B0=EF=BC=8C=C2=A0=E6=95=B0=E6=8D=AE=E9=87=87?= =?UTF-8?q?=E9=9B=86=E6=9F=A5=E7=9C=8B=E6=98=8E=E7=BB=86=E6=97=B6=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E6=98=BE=E7=A4=BA=E4=B8=8D=E5=AF=B9=E9=BD=90=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/dataAcquisition/components/index.less | 6 +++--- .../dataAcquisition/components/tableRecord.js | 15 +++++++++++++-- pc4mobx/hrmSalary/pages/ledger/slideBaseForm.js | 2 +- .../ledgerPage/components/ledgerBaseSetting.js | 2 +- .../components/ledgerSalaryItemPreviewModal.js | 2 +- .../hrmSalary/pages/payroll/watermarkPreview.js | 2 +- 6 files changed, 20 insertions(+), 9 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/components/index.less b/pc4mobx/hrmSalary/pages/dataAcquisition/components/index.less index 80d08cf2..4d16b78a 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/components/index.less +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/components/index.less @@ -2,12 +2,12 @@ .accumulated { .wea-form-cell-wrapper { & > div:first-child { - width: 10% !important; + height: 46px !important; line-height: 46px; } & > div:nth-child(2) { - width: 40% !important; + //width: 40% !important; .wea-form-item-wrapper { display: flex !important; @@ -20,7 +20,7 @@ } & > div:last-child { - width: 40% !important; + //width: 40% !important; } } } diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/components/tableRecord.js b/pc4mobx/hrmSalary/pages/dataAcquisition/components/tableRecord.js index f3c9e716..9db08fac 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/components/tableRecord.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/components/tableRecord.js @@ -18,6 +18,7 @@ class TableRecord extends Component { loading: { query: false }, + width: 0, dataSource: [], columns: [], selectedRowKeys: [], @@ -37,13 +38,23 @@ class TableRecord extends Component { } componentDidMount() { + this.setState({ width: window.innerWidth }); this.convertData(this.props); + window.addEventListener("resize", this.resizeWidth); + } + + componentWillUnmount() { + window.removeEventListener("resize", this.resizeWidth); } componentWillReceiveProps(nextProps, nextContext) { this.convertData(nextProps); } + resizeWidth = (e) => { + this.setState({ width: e.target.innerWidth }); + }; + convertData = (props) => { const { recordPayload } = this.state; const { record, screenParams } = props; @@ -116,7 +127,7 @@ class TableRecord extends Component { render() { const { className, screenParams, taxAgentOption, record } = this.props; - const { columns, dataSource, loading, selectedRowKeys, pageInfo, recordPayload } = this.state; + const { columns, dataSource, loading, selectedRowKeys, pageInfo, recordPayload, width } = this.state; const rowSelection = { selectedRowKeys, onChange: (selectedRowKeys) => this.setState({ selectedRowKeys }) @@ -172,7 +183,7 @@ class TableRecord extends Component {
{ !_.isEmpty(screenParams) && - + 1280 ? 3 : 2}/> } diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerBaseSetting.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerBaseSetting.js index 2da6a2ac..cc89cd8a 100644 --- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerBaseSetting.js +++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerBaseSetting.js @@ -184,7 +184,7 @@ class LedgerBaseSetting extends Component { type === "CHECKBOX" ? + content="【起薪日期≤薪资周期止】且【最后发薪日期≥薪资周期起】"/> : type === "SELECT" ? diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemPreviewModal.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemPreviewModal.js index 09c1df43..1ce016da 100644 --- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemPreviewModal.js +++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemPreviewModal.js @@ -23,7 +23,7 @@ export default class LedgerSalaryItemPreviewModal extends React.Component { }; }) }; - columns.push(columnItem); + columnItem.children.length > 0 && columns.push(columnItem); }); return { columns }; }; diff --git a/pc4mobx/hrmSalary/pages/payroll/watermarkPreview.js b/pc4mobx/hrmSalary/pages/payroll/watermarkPreview.js index 4ea21411..a6bd6564 100644 --- a/pc4mobx/hrmSalary/pages/payroll/watermarkPreview.js +++ b/pc4mobx/hrmSalary/pages/payroll/watermarkPreview.js @@ -19,7 +19,7 @@ class WatermarkPreview extends Component { salaryBillBaseSetPreviewWaterMark = (payload) => { salaryBillBaseSetPreviewWaterMark(payload).then(({ status, data }) => { if (status) { - const { wmHeight: height, wmWidth: width, wmNoTransparent, wmRotate } = payload; + const { wmSetting: { wmHeight: height, wmWidth: width, wmNoTransparent, wmRotate } } = payload; watermark({ text: data, src: "", From a623679975ae24e153509768a789eea9386a6212 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Mon, 3 Jul 2023 17:29:53 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E4=BA=A7=E5=93=81-=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=87=87=E9=9B=86=E9=A1=B5=E9=9D=A2=E7=BC=96=E8=BE=91=E6=A1=86?= =?UTF-8?q?=E6=8D=A2=E6=88=90=E6=95=B0=E5=AD=97=E8=BE=93=E5=85=A5=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dataAcquisition/cumDeduct/columns.js | 21 +++++--- .../dataAcquisition/cumSituation/columns.js | 51 ++++++++++++------- .../dataAcquisition/otherDeduct/columns.js | 15 ++++-- .../components/condition.js | 21 +++++--- 4 files changed, 72 insertions(+), 36 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/columns.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/columns.js index 9d6b6831..9956585a 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/columns.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/columns.js @@ -399,66 +399,73 @@ export const dataCollectCondition = [ { items: [ { - conditionType: "INPUT", + conditionType: "INPUTNUMBER", domkey: ["addUpChildEducation"], fieldcol: 14, label: "累计子女教育", labelcol: 8, value: "", + precision: 2, viewAttr: 2 }, { - conditionType: "INPUT", + conditionType: "INPUTNUMBER", domkey: ["addUpContinuingEducation"], fieldcol: 14, label: "累计继续教育", labelcol: 8, value: "", + precision: 2, viewAttr: 2 }, { - conditionType: "INPUT", + conditionType: "INPUTNUMBER", domkey: ["addUpHousingLoanInterest"], fieldcol: 14, label: "累计住房贷款利息", labelcol: 8, value: "", + precision: 2, viewAttr: 2 }, { - conditionType: "INPUT", + conditionType: "INPUTNUMBER", domkey: ["addUpHousingRent"], fieldcol: 14, label: "累计住房租金", labelcol: 8, value: "", + precision: 2, viewAttr: 2 }, { - conditionType: "INPUT", + conditionType: "INPUTNUMBER", domkey: ["addUpSupportElderly"], fieldcol: 14, label: "累计赡养老人", labelcol: 8, value: "", + precision: 2, viewAttr: 2 }, { - conditionType: "INPUT", + conditionType: "INPUTNUMBER", domkey: ["addUpIllnessMedical"], fieldcol: 14, label: "累计大病医疗", labelcol: 8, value: "", + precision: 2, viewAttr: 2 }, { - conditionType: "INPUT", + conditionType: "INPUTNUMBER", domkey: ["addUpInfantCare"], fieldcol: 14, label: "累计婴幼儿照护", labelcol: 8, value: "", + precision: 2, viewAttr: 2 } ], diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/columns.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/columns.js index 689db6a4..ae006af6 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/columns.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/columns.js @@ -69,156 +69,173 @@ export const dataCollectCondition = [ { items: [ { - conditionType: "INPUT", + conditionType: "INPUTNUMBER", domkey: ["addUpIncome"], fieldcol: 14, label: "累计收入额", labelcol: 8, value: "", + precision: 2, viewAttr: 2 }, { - conditionType: "INPUT", + conditionType: "INPUTNUMBER", domkey: ["addUpSubtraction"], fieldcol: 14, label: "累计减除费用", labelcol: 8, value: "", + precision: 2, viewAttr: 2 }, { - conditionType: "INPUT", + conditionType: "INPUTNUMBER", domkey: ["addUpSocialSecurityTotal"], fieldcol: 14, label: "累计社保个人合计", labelcol: 8, value: "", + precision: 2, viewAttr: 2 }, { - conditionType: "INPUT", + conditionType: "INPUTNUMBER", domkey: ["addUpAccumulationFundTotal"], fieldcol: 14, label: "累计公积金个人合计", labelcol: 8, value: "", + precision: 2, viewAttr: 2 }, { - conditionType: "INPUT", + conditionType: "INPUTNUMBER", domkey: ["addUpChildEducation"], fieldcol: 14, label: "累计子女教育", labelcol: 8, value: "", + precision: 2, viewAttr: 2 }, { - conditionType: "INPUT", + conditionType: "INPUTNUMBER", domkey: ["addUpContinuingEducation"], fieldcol: 14, label: "累计继续教育", labelcol: 8, value: "", + precision: 2, viewAttr: 2 }, { - conditionType: "INPUT", + conditionType: "INPUTNUMBER", domkey: ["addUpHousingLoanInterest"], fieldcol: 14, label: "累计住房贷款利息", labelcol: 8, value: "", + precision: 2, viewAttr: 2 }, { - conditionType: "INPUT", + conditionType: "INPUTNUMBER", domkey: ["addUpHousingRent"], fieldcol: 14, label: "累计住房租金", labelcol: 8, value: "", + precision: 2, viewAttr: 2 }, { - conditionType: "INPUT", + conditionType: "INPUTNUMBER", domkey: ["addUpSupportElderly"], fieldcol: 14, label: "累计赡养老人", labelcol: 8, value: "", + precision: 2, viewAttr: 2 }, { - conditionType: "INPUT", + conditionType: "INPUTNUMBER", domkey: ["addUpIllnessMedical"], fieldcol: 14, label: "累计大病医疗", labelcol: 8, value: "", + precision: 2, viewAttr: 2 }, { - conditionType: "INPUT", + conditionType: "INPUTNUMBER", domkey: ["addUpEnterpriseAndOther"], fieldcol: 14, label: "累计企业(职业)年金及其他福利", labelcol: 8, value: "", + precision: 2, viewAttr: 2 }, { - conditionType: "INPUT", + conditionType: "INPUTNUMBER", domkey: ["addUpOtherDeduction"], fieldcol: 14, label: "累计其他免税扣除", labelcol: 8, value: "", + precision: 2, viewAttr: 2 }, { - conditionType: "INPUT", + conditionType: "INPUTNUMBER", domkey: ["addUpTaxExemptIncome"], fieldcol: 14, label: "累计免税收入", labelcol: 8, value: "", + precision: 2, viewAttr: 2 }, { - conditionType: "INPUT", + conditionType: "INPUTNUMBER", domkey: ["addUpAllowedDonation"], fieldcol: 14, label: "累计准予扣除的捐赠额", labelcol: 8, value: "", + precision: 2, viewAttr: 2 }, { - conditionType: "INPUT", + conditionType: "INPUTNUMBER", domkey: ["addUpTaxSavings"], fieldcol: 14, label: "累计减免税额", labelcol: 8, value: "", + precision: 2, viewAttr: 2 }, { - conditionType: "INPUT", + conditionType: "INPUTNUMBER", domkey: ["addUpAdvanceTax"], fieldcol: 14, label: "累计已预扣预缴税额", labelcol: 8, value: "", + precision: 2, viewAttr: 2 }, { - conditionType: "INPUT", + conditionType: "INPUTNUMBER", domkey: ["addUpInfantCare"], fieldcol: 14, label: "累计婴幼儿照护", labelcol: 8, value: "", + precision: 2, viewAttr: 2 } ], diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/columns.js b/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/columns.js index 6f542381..a4b80c9c 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/columns.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/columns.js @@ -69,48 +69,53 @@ export const dataCollectCondition = [ { items: [ { - conditionType: "INPUT", + conditionType: "INPUTNUMBER", domkey: ["businessHealthyInsurance"], fieldcol: 14, label: "商业健康保险", labelcol: 8, value: "", + precision: 2, viewAttr: 2 }, { - conditionType: "INPUT", + conditionType: "INPUTNUMBER", domkey: ["taxDelayEndowmentInsurance"], fieldcol: 14, label: "税延养老保险", labelcol: 8, value: "", + precision: 2, viewAttr: 2 }, { - conditionType: "INPUT", + conditionType: "INPUTNUMBER", domkey: ["otherDeduction"], fieldcol: 14, label: "其他", labelcol: 8, value: "", + precision: 2, viewAttr: 2 }, { - conditionType: "INPUT", + conditionType: "INPUTNUMBER", domkey: ["deductionAllowedDonation"], fieldcol: 14, label: "准予扣除的捐赠额", labelcol: 8, value: "", + precision: 2, viewAttr: 2 }, { - conditionType: "INPUT", + conditionType: "INPUTNUMBER", domkey: ["privatePension"], fieldcol: 14, label: "个人养老金", labelcol: 8, value: "", + precision: 2, viewAttr: 2 } ], diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/components/condition.js b/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/components/condition.js index aec25fae..68495cc9 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/components/condition.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/components/condition.js @@ -2,66 +2,73 @@ export const condition = [ { items: [ { - conditionType: "INPUT", + conditionType: "INPUTNUMBER", domkey: ["childrenEducation"], fieldcol: 14, label: "子女教育", labelcol: 8, value: "", + precision: 2, viewAttr: 2 }, { - conditionType: "INPUT", + conditionType: "INPUTNUMBER", domkey: ["continuingEducation"], fieldcol: 14, label: "继续教育", labelcol: 8, value: "", + precision: 2, viewAttr: 2 }, { - conditionType: "INPUT", + conditionType: "INPUTNUMBER", domkey: ["housingLoanInterest"], fieldcol: 14, label: "住房贷款利息", labelcol: 8, value: "", + precision: 2, viewAttr: 2 }, { - conditionType: "INPUT", + conditionType: "INPUTNUMBER", domkey: ["housingRent"], fieldcol: 14, label: "住房租金", labelcol: 8, value: "", + precision: 2, viewAttr: 2 }, { - conditionType: "INPUT", + conditionType: "INPUTNUMBER", domkey: ["supportingElder"], fieldcol: 14, label: "赡养老人", labelcol: 8, value: "", + precision: 2, viewAttr: 2 }, { - conditionType: "INPUT", + conditionType: "INPUTNUMBER", domkey: ["seriousIllnessTreatment"], fieldcol: 14, label: "大病医疗", labelcol: 8, value: "", + precision: 2, viewAttr: 2 }, { - conditionType: "INPUT", + conditionType: "INPUTNUMBER", domkey: ["infantCare"], fieldcol: 14, label: "婴幼儿照护", labelcol: 8, value: "", + precision: 2, viewAttr: 2 } ], From 61ebfdf9f1c90f965fc33788dd60162134d37b6e 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, 4 Jul 2023 15:42:39 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E4=BA=A7=E5=93=81-=E8=96=AA=E9=85=AC?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E6=8A=A5=E8=A1=A8=E5=9B=BE=E8=A1=A8=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/reportView/components/condition.js | 149 +++++++++++------- 1 file changed, 89 insertions(+), 60 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/reportView/components/condition.js b/pc4mobx/hrmSalary/pages/reportView/components/condition.js index c8422666..fba734b3 100644 --- a/pc4mobx/hrmSalary/pages/reportView/components/condition.js +++ b/pc4mobx/hrmSalary/pages/reportView/components/condition.js @@ -153,7 +153,11 @@ export const condition = [ } ]; -const colorList = ["#709DF7", "#73DEB3", "#7585A2", "#F7C739", "#5FC3E3", "#AEE279", "#FF7F81"]; +const colorList = [ + "#709DF7", "#73DEB3", "#7585A2", "#F7C739", "#5FC3E3", "#AEE279", "#FF7F81", "#709DF7", "#73DEB3", "#7585A2", "#F7C739", "#5FC3E3", "#AEE279", "#FF7F81", + "#709DF7", "#73DEB3", "#7585A2", "#F7C739", "#5FC3E3", "#AEE279", "#FF7F81", "#709DF7", "#73DEB3", "#7585A2", "#F7C739", "#5FC3E3", "#AEE279", "#FF7F81", + "#709DF7", "#73DEB3", "#7585A2", "#F7C739", "#5FC3E3", "#AEE279", "#FF7F81", "#709DF7", "#73DEB3", "#7585A2", "#F7C739", "#5FC3E3", "#AEE279", "#FF7F81" +]; export const mapBarOptions = (params) => ({ tooltip: { trigger: "axis", @@ -176,6 +180,7 @@ export const mapBarOptions = (params) => ({ } }, legend: { + type: "scroll", icon: "rect", top: "0%", right: "center", @@ -188,27 +193,33 @@ export const mapBarOptions = (params) => ({ grid: { top: "10%", right: "0%", - left: "2%", + left: "5%", bottom: "0%", containLabel: true }, - xAxis: { - type: "category", - axisTick: { - alignWithLabel: true, - show: false - }, - data: params.xAxis, - axisLabel: { - interval: 0, - margin: 10, - textStyle: { - fontSize: 11 + xAxis: params.xAxis.map((item, index) => { + const data = Array(params.xAxis.length).fill(""); + data[index] = item; + return { + type: "category", + position: "bottom", + data: data, + axisTick: { + alignWithLabel: true, + show: false + }, + axisLabel: { + interval: 0, + margin: 10, + textStyle: { + fontSize: 11 + } } - } - }, + }; + }), yAxis: { name: params.name, + type: "value", axisLabel: { padding: [3, 0, 0, 0], formatter: "{value}", @@ -237,50 +248,9 @@ export const mapBarOptions = (params) => ({ } } }, - series: _.map(params.data, (item, index) => { - return { - name: item.name, - barWidth: "32", - data: _.map(item.data, (it) => it.replace(/,/g, "")), - type: "bar", - itemStyle: { - normal: { - color: function (params) { - return colorList[params.seriesIndex] || colorList[Math.floor((Math.random() * colorList.length))]; - } - } - }, - label: { - show: true, - position: "insideBottom", - distance: 15, - align: "left", - verticalAlign: "middle", - rotate: "90", - formatter: function (params) { - if (parseInt(params.value) === 0) { - return ``; - } else { - return [ - `{a|${format_with_regex(params.value)}} {b|${params.seriesName}}` - ]; - } - }, - rich: { - a: { - fontWeight: "bold", - fontSize: 14, - color: "#333", - marginRight: 10 - }, - b: { - fontSize: 12, - color: "#333" - } - } - } - }; - }) + series: params.data.map(item => { + return [...dealBar(_.map(item.data, (it) => parseFloat(it.replace(/,/g, ""))), item.name)]; + }).reduce((acc, cur) => acc.concat(cur), []) }); export const mapLineOptions = (params) => ({ tooltip: { @@ -292,6 +262,7 @@ export const mapLineOptions = (params) => ({ } }, legend: { + type: "scroll", icon: "circle", top: "0%", right: "center", @@ -385,6 +356,7 @@ export const mapPieOptions = (params) => ({ } }, legend: { + type: "scroll", icon: "rect", top: "0%", left: "2%", @@ -420,3 +392,60 @@ export const mapPieOptions = (params) => ({ }; }) }); + +const dealBar = (arr, name) => { + const bar = []; + arr.forEach((item, index) => { + const data = []; + for (let i = 0; i < index; i++) { + data.push(""); + } + if (item) { + data.push(item); + bar.push({ + name, + type: "bar", + xAxisIndex: index, + barWidth: 32, + data, + itemStyle: { + normal: { + color: function (params) { + return colorList[params.seriesIndex] || colorList[Math.floor((Math.random() * colorList.length))]; + } + } + }, + label: { + show: true, + position: "insideBottom", + distance: 15, + align: "left", + verticalAlign: "middle", + rotate: "90", + formatter: function (params) { + if (parseInt(params.value) === 0) { + return ``; + } else { + return [ + `{a|${format_with_regex(params.value)}} {b|${params.seriesName}}` + ]; + } + }, + rich: { + a: { + fontWeight: "bold", + fontSize: 14, + color: "#333", + marginRight: 10 + }, + b: { + fontSize: 12, + color: "#333" + } + } + } + }); + } + }); + return bar; +}; From d984a105fd2d404e30aa1d18c96112731743c2ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Mon, 10 Jul 2023 11:00:47 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E4=BA=A7=E5=93=81-=E5=A4=9A=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E5=88=97=E8=A1=A8=E6=9F=A5=E8=AF=A2=E4=BA=BA=E5=91=98?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E4=BC=A0=E5=8F=82=E7=BB=9F=E4=B8=80=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=E6=95=B0=E7=BB=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hrmSalary/pages/calculateDetail/index.js | 17 ++++++++++------- .../pages/calculateDetail/userSure.js | 17 ++++++++++------- pc4mobx/hrmSalary/pages/payrollFiles/index.js | 18 ++++++++---------- pc4mobx/hrmSalary/stores/payrollFiles.js | 5 +++-- 4 files changed, 31 insertions(+), 26 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/index.js b/pc4mobx/hrmSalary/pages/calculateDetail/index.js index da39bb6c..1bc1e55a 100644 --- a/pc4mobx/hrmSalary/pages/calculateDetail/index.js +++ b/pc4mobx/hrmSalary/pages/calculateDetail/index.js @@ -26,7 +26,7 @@ export default class CalculateDetail extends React.Component { departmentIds: "", positionIds: "", subcompanyIds: "", - status: "", + statuses: "", consolidatedTaxation: "0" }, selectedKey: "0", @@ -115,7 +115,7 @@ export default class CalculateDetail extends React.Component { ); }; Select = (value, key) => { - const { status } = this.state.searchItemsValue; + const { statuses } = this.state.searchItemsValue; return ( this.setState({ searchItemsValue: { ...this.state.searchItemsValue, [key]: val } })}/> @@ -338,7 +341,7 @@ export default class CalculateDetail extends React.Component { workcode: "", departmentIds: "", positionIds: "", - status: "", + statuses: "", consolidatedTaxation: "0" } })}> @@ -356,7 +359,7 @@ export default class CalculateDetail extends React.Component { { com: this.Browser("分部", "subcompanyIds") }, { com: this.Browser("部门", "departmentIds") }, { com: this.Browser("岗位", "positionIds") }, - { com: this.Select("状态", "status") }, + { com: this.Select("状态", "statuses") }, { com: this.Checkbox("合并计税", "consolidatedTaxation") } ]; return ; diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/userSure.js b/pc4mobx/hrmSalary/pages/calculateDetail/userSure.js index b67558e1..6ef24cbb 100644 --- a/pc4mobx/hrmSalary/pages/calculateDetail/userSure.js +++ b/pc4mobx/hrmSalary/pages/calculateDetail/userSure.js @@ -17,7 +17,7 @@ export default class UserSure extends React.Component { workcode: "", departmentIds: "", positionIds: "", - status: "" + statuses: "" }, selectedKey: "0", selectedRowKeys: [], // table 选中项 @@ -78,7 +78,7 @@ export default class UserSure extends React.Component { ); }; Select = (value, key) => { - const { status } = this.state.searchItemsValue; + const { statuses } = this.state.searchItemsValue; return ( this.setState({ searchItemsValue: { ...this.state.searchItemsValue, [key]: val } })}/> @@ -342,7 +345,7 @@ export default class UserSure extends React.Component { employeeName: "", departmentIds: "", positionIds: "", - status: "" + statuses: "" } })}> 重置 @@ -358,7 +361,7 @@ export default class UserSure extends React.Component { { com: this.Input("工号", "workcode") }, { com: this.Browser("部门", "departmentIds") }, { com: this.Browser("岗位", "positionIds") }, - { com: this.Select("状态", "status") } + { com: this.Select("状态", "statuses") } ]; return ; }; diff --git a/pc4mobx/hrmSalary/pages/payrollFiles/index.js b/pc4mobx/hrmSalary/pages/payrollFiles/index.js index f094e5b0..61d0c031 100644 --- a/pc4mobx/hrmSalary/pages/payrollFiles/index.js +++ b/pc4mobx/hrmSalary/pages/payrollFiles/index.js @@ -68,7 +68,7 @@ class Index extends Component { workcode: "", departmentIds: "", positionIds: "", - userstatus: "", + statuses: "", // archiveStatus: "EFFICIENT", taxAgentId: "", subcompanyIds: "" @@ -125,7 +125,7 @@ class Index extends Component { }; Select = (value, key) => { const { taxAgentStore } = this.props; - const { userstatus, archiveStatus, taxAgentId } = this.state.searchItemsValue; + const { statuses, archiveStatus, taxAgentId } = this.state.searchItemsValue; const { archiveStatusList, userStatusList } = this.state; const { taxAgentAdminOption } = taxAgentStore; return ( @@ -135,8 +135,9 @@ class Index extends Component { wrapperCol={{ span: 18 }} > ({ + userStatusList: [..._.map(userStatusList, it => ({ key: String(it.value), showname: it.defaultLabel }))] @@ -666,7 +664,7 @@ class Index extends Component { { com: this.Browser("分部", "subcompanyIds") }, { com: this.Browser("部门", "departmentIds") }, { com: this.Browser("岗位", "positionIds") }, - { com: this.Select("人员状态", "userstatus") }, + { com: this.Select("人员状态", "statuses") }, // { com: this.Select("档案状态", "archiveStatus") }, { com: this.Select("个税扣缴义务人", "taxAgentId") }, { com: this.Input("工号", "workcode") } @@ -691,7 +689,7 @@ class Index extends Component { workcode: "", departmentIds: "", positionIds: "", - userstatus: "", + statuses: "", archiveStatus: "" } })}> 重置 , diff --git a/pc4mobx/hrmSalary/stores/payrollFiles.js b/pc4mobx/hrmSalary/stores/payrollFiles.js index 7efc0dd2..70088da8 100644 --- a/pc4mobx/hrmSalary/stores/payrollFiles.js +++ b/pc4mobx/hrmSalary/stores/payrollFiles.js @@ -1,7 +1,7 @@ import { action, observable } from "mobx"; import { WeaTableNew } from "comsMobx"; import * as API from "../apis/payrollFiles"; -import { statisticsEmployeeDetailList, getDataPerspective } from "../apis/statistics"; +import { getDataPerspective, statisticsEmployeeDetailList } from "../apis/statistics"; const { TableStore } = WeaTableNew; @@ -14,11 +14,12 @@ export class PayrollFilesStore { @action("薪资档案-列表查询") queryList = (payload = {}, searchItemsValue = {}, url = "") => { return new Promise((resolve, reject) => { - const { departmentIds, positionIds, subcompanyIds, ...extra } = searchItemsValue; + const { departmentIds, positionIds, subcompanyIds, statuses, ...extra } = searchItemsValue; API.queryList({ departmentIds: departmentIds ? departmentIds.split(",") : [], positionIds: positionIds ? positionIds.split(",") : [], subcompanyIds: subcompanyIds ? subcompanyIds.split(",") : [], + statuses: statuses ? statuses.split(",") : [], ...payload, ...extra, url }).then(res => { const { data, status } = res; From cc4cccf1114adaf0cd128234a7c142e1e946a278 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Mon, 10 Jul 2023 11:39:36 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E4=BA=A7=E5=93=81-=E5=A4=9A=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E5=88=97=E8=A1=A8=E6=9F=A5=E8=AF=A2=E4=BA=BA=E5=91=98?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E4=BC=A0=E5=8F=82=E7=BB=9F=E4=B8=80=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=E6=95=B0=E7=BB=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/socialSecurityBenefits/archives/index.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js index 3a8ad7ab..3e28be10 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js @@ -14,6 +14,7 @@ import * as API from "../../../apis/welfareArchive"; import ImportModal from "../../../components/importModal"; import TipLabel from "../../../components/TipLabel"; import UnifiedTable from "../../../components/UnifiedTable"; +import { convertToUrlString } from "../../../util/url"; import "./index.less"; @inject("archivesStore", "taxAgentStore") @@ -548,16 +549,16 @@ export default class Archives extends React.Component { let url = `${window.location.origin}/api/bs/hrmsalary/scheme/export?ids=`; switch (selectedKey) { case "pending": - url = `${url}&runStatuses=1`; + url = `${url}&runStatuses=1&${convertToUrlString(form.getFormParams())}`; break; case "fixed": - url = `${url}&runStatuses=2,3`; + url = `${url}&runStatuses=2,3&${convertToUrlString(form.getFormParams())}`; break; case "suspend": - url = `${url}&runStatuses=3`; + url = `${url}&runStatuses=3&${convertToUrlString(form.getFormParams())}`; break; default: - url = `${url}&runStatuses=4,5`; + url = `${url}&runStatuses=4,5&${convertToUrlString(form.getFormParams())}`; break; } window.open(url, "_self"); From c8fe01dfdaecd119bba7e71248473d608270700d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Mon, 10 Jul 2023 15:52:25 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E4=BA=A7=E5=93=81-=E8=96=AA=E9=85=AC?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E6=8A=A5=E8=A1=A8echarts=E5=9B=BE=E6=A0=87?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E5=B0=81=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../condition-柱状图数据为0不占位.js | 451 ++++++++++++++++++ .../pages/reportView/components/condition.js | 160 +++---- 2 files changed, 524 insertions(+), 87 deletions(-) create mode 100644 pc4mobx/hrmSalary/pages/reportView/components/condition-柱状图数据为0不占位.js diff --git a/pc4mobx/hrmSalary/pages/reportView/components/condition-柱状图数据为0不占位.js b/pc4mobx/hrmSalary/pages/reportView/components/condition-柱状图数据为0不占位.js new file mode 100644 index 00000000..fba734b3 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/reportView/components/condition-柱状图数据为0不占位.js @@ -0,0 +1,451 @@ +import { WeaLocaleProvider } from "ecCom"; +import { format_with_regex } from "../../../util"; + +const { getLabel } = WeaLocaleProvider; +export const condition = [ + { + items: [ + { + colSpan: 2, + checkbox: false, + checkboxValue: false, + conditionType: "SELECT", + domkey: ["taxAgent"], + fieldcol: 18, + label: getLabel(111, "个税扣缴义务人"), + labelcol: 6, + options: [], + multiple: true, + viewAttr: 2 + }, + { + browserConditionParam: { + completeParams: {}, + conditionDataParams: {}, + dataParams: {}, + destDataParams: {}, + hasAddBtn: false, + hasAdvanceSerach: true, + idSeparator: ",", + isAutoComplete: 1, + isDetail: 0, + isMultCheckbox: false, + isSingle: false, + linkUrl: "", + pageSize: 10, + quickSearchName: "", + replaceDatas: [], + title: getLabel(111, "分部"), + type: "164", + viewAttr: 2 + }, + colSpan: 2, + conditionType: "BROWSER", + domkey: ["subCompany"], + fieldcol: 18, + isQuickSearch: false, + label: getLabel(111, "分部"), + labelcol: 6, + viewAttr: 2 + }, + { + browserConditionParam: { + completeParams: {}, + conditionDataParams: {}, + dataParams: {}, + destDataParams: {}, + hasAddBtn: false, + hasAdvanceSerach: true, + idSeparator: ",", + isAutoComplete: 1, + isDetail: 0, + isMultCheckbox: false, + isSingle: false, + linkUrl: "", + pageSize: 10, + quickSearchName: "", + replaceDatas: [], + title: getLabel(111, "部门"), + type: "57", + viewAttr: 2 + }, + colSpan: 2, + conditionType: "BROWSER", + domkey: ["department"], + fieldcol: 18, + isQuickSearch: false, + label: getLabel(111, "部门"), + labelcol: 6, + viewAttr: 2 + }, + // { + // browserConditionParam: { + // completeParams: {}, + // conditionDataParams: {}, + // dataParams: {}, + // destDataParams: {}, + // hasAddBtn: false, + // hasAdvanceSerach: true, + // idSeparator: ",", + // isAutoComplete: 1, + // isDetail: 0, + // isMultCheckbox: false, + // isSingle: false, + // linkUrl: "", + // pageSize: 10, + // quickSearchName: "", + // replaceDatas: [], + // title: getLabel(111, "岗位"), + // type: "278", + // viewAttr: 2 + // }, + // colSpan: 2, + // conditionType: "BROWSER", + // domkey: ["position"], + // fieldcol: 18, + // isQuickSearch: false, + // label: getLabel(111, "岗位"), + // labelcol: 6, + // viewAttr: 2 + // }, + { + browserConditionParam: { + completeParams: {}, + conditionDataParams: {}, + dataParams: {}, + destDataParams: {}, + hasAddBtn: false, + hasAdvanceSerach: true, + idSeparator: ",", + isAutoComplete: 1, + isDetail: 0, + isMultCheckbox: false, + isSingle: false, + linkUrl: "", + pageSize: 10, + quickSearchName: "", + replaceDatas: [], + title: getLabel(111, "人员"), + type: "17", + viewAttr: 2 + }, + colSpan: 2, + conditionType: "BROWSER", + domkey: ["employee"], + fieldcol: 18, + isQuickSearch: false, + label: getLabel(111, "人员"), + labelcol: 6, + viewAttr: 2 + }, + { + colSpan: 2, + conditionType: "RANGEPICKER", + domkey: ["hiredate1", "hiredate2"], + fieldcol: 18, + label: getLabel(111, "入职日期"), + labelcol: 6, + viewAttr: 2 + } + ], + title: "", + defaultshow: true + } +]; + +const colorList = [ + "#709DF7", "#73DEB3", "#7585A2", "#F7C739", "#5FC3E3", "#AEE279", "#FF7F81", "#709DF7", "#73DEB3", "#7585A2", "#F7C739", "#5FC3E3", "#AEE279", "#FF7F81", + "#709DF7", "#73DEB3", "#7585A2", "#F7C739", "#5FC3E3", "#AEE279", "#FF7F81", "#709DF7", "#73DEB3", "#7585A2", "#F7C739", "#5FC3E3", "#AEE279", "#FF7F81", + "#709DF7", "#73DEB3", "#7585A2", "#F7C739", "#5FC3E3", "#AEE279", "#FF7F81", "#709DF7", "#73DEB3", "#7585A2", "#F7C739", "#5FC3E3", "#AEE279", "#FF7F81" +]; +export const mapBarOptions = (params) => ({ + tooltip: { + trigger: "axis", + axisPointer: { + type: "shadow" + }, + backgroundColor: "#FFF", + borderColor: "#FFF", + borderWidth: "1", + borderRadius: "5", + textStyle: { + color: "#333" + }, + formatter: function (params) { + let str = params[0].axisValue + "
"; + for (let item of params) { + str += `
${item.marker}${item.seriesName}${format_with_regex(item.value)}
`; + } + return str; + } + }, + legend: { + type: "scroll", + icon: "rect", + top: "0%", + right: "center", + itemGap: 10, + textStyle: { + fontSize: 12,//字体大小 + color: "#B8B8B8"//字体颜色 + } + }, + grid: { + top: "10%", + right: "0%", + left: "5%", + bottom: "0%", + containLabel: true + }, + xAxis: params.xAxis.map((item, index) => { + const data = Array(params.xAxis.length).fill(""); + data[index] = item; + return { + type: "category", + position: "bottom", + data: data, + axisTick: { + alignWithLabel: true, + show: false + }, + axisLabel: { + interval: 0, + margin: 10, + textStyle: { + fontSize: 11 + } + } + }; + }), + yAxis: { + name: params.name, + type: "value", + axisLabel: { + padding: [3, 0, 0, 0], + formatter: "{value}", + color: "#666", + textStyle: { + fontSize: 11 + } + }, + nameTextStyle: { + color: "#787E95", + fontSize: 12 + }, + axisLine: { + show: true, + lineStyle: { + color: "transparent" + } + }, + axisTick: { + show: false // 不显示坐标轴刻度线 + }, + splitLine: { + show: false, + lineStyle: { + color: "rgba(66, 192, 255, 0.1)" + } + } + }, + series: params.data.map(item => { + return [...dealBar(_.map(item.data, (it) => parseFloat(it.replace(/,/g, ""))), item.name)]; + }).reduce((acc, cur) => acc.concat(cur), []) +}); +export const mapLineOptions = (params) => ({ + tooltip: { + // 坐标轴指示器,坐标轴触发有效 + trigger: "axis", + axisPointer: { + // 默认为直线,可选为:'line' | 'shadow' + type: "line" + } + }, + legend: { + type: "scroll", + icon: "circle", + top: "0%", + right: "center", + itemGap: 20, + textStyle: { + fontSize: 12,//字体大小 + color: "#787E95"//字体颜色 + } + }, + grid: { + top: "10%", + left: "3%", + right: "2%", + bottom: "3%", + containLabel: true + }, + xAxis: [ + { + type: "category", + boundaryGap: false, + data: params.xAxis, + axisTick: { + alignWithLabel: true, + show: false + }, + // 修改坐标值样式 + axisLabel: { + color: "#B8B8B8", + fontSize: 12, + show: true + }, + axisLine: { + show: false + } + } + ], + yAxis: [ + { + type: "value", + // 修改坐标值样式 + axisLabel: { + color: "#787E95", + fontSize: 14 + }, + nameTextStyle: { + color: "#787E95", + fontSize: 16 + }, + // 修改坐标轴线样式 + axisLine: { + show: true, + lineStyle: { + color: "transparent" + } + }, + axisTick: { + show: false // 不显示坐标轴刻度线 + }, + splitLine: { + lineStyle: { + color: "rgba(93,126,158,1)" + } + } + } + ], + series: _.map(params.data, (item, index) => { + return { + name: item.name, + data: _.map(item.data, (it) => it.replace(/,/g, "")), + type: "line", + itemStyle: { + normal: { + color: function (params) { + return colorList[params.seriesIndex] || colorList[Math.floor((Math.random() * colorList.length))]; + }, + lineStyle: { + color: colorList[index] || colorList[Math.floor((Math.random() * colorList.length))] + } + } + } + }; + }) +}); +export const mapPieOptions = (params) => ({ + tooltip: { + show: true, + formatter: function (params) { + let str = params.seriesName + "
"; + str += params.marker + params.name + ":" + format_with_regex(params.value) + "(" + params.percent + "%" + ")" + "
"; + return str; + } + }, + legend: { + type: "scroll", + icon: "rect", + top: "0%", + left: "2%", + orient: "vertical", + itemGap: 10, + textStyle: { + fontSize: 12,//字体大小 + color: "#787E95"//字体颜色 + } + }, + series: _.map(params.data, item => { + return { + name: item.name, + data: _.map(item.data, (it) => ({ ...it, value: it.value.replace(/,/g, "") })), + type: "pie", + radius: "60%", + avoidLabelOverlap: true, + animation: false, + labelLine: { + show: true, + normal: { + length: 5, + align: "center" + } + }, + itemStyle: { + normal: { + color: function (colors) { + return colorList[colors.dataIndex] || colorList[Math.floor((Math.random() * colorList.length))]; + } + } + } + }; + }) +}); + +const dealBar = (arr, name) => { + const bar = []; + arr.forEach((item, index) => { + const data = []; + for (let i = 0; i < index; i++) { + data.push(""); + } + if (item) { + data.push(item); + bar.push({ + name, + type: "bar", + xAxisIndex: index, + barWidth: 32, + data, + itemStyle: { + normal: { + color: function (params) { + return colorList[params.seriesIndex] || colorList[Math.floor((Math.random() * colorList.length))]; + } + } + }, + label: { + show: true, + position: "insideBottom", + distance: 15, + align: "left", + verticalAlign: "middle", + rotate: "90", + formatter: function (params) { + if (parseInt(params.value) === 0) { + return ``; + } else { + return [ + `{a|${format_with_regex(params.value)}} {b|${params.seriesName}}` + ]; + } + }, + rich: { + a: { + fontWeight: "bold", + fontSize: 14, + color: "#333", + marginRight: 10 + }, + b: { + fontSize: 12, + color: "#333" + } + } + } + }); + } + }); + return bar; +}; diff --git a/pc4mobx/hrmSalary/pages/reportView/components/condition.js b/pc4mobx/hrmSalary/pages/reportView/components/condition.js index fba734b3..103793c3 100644 --- a/pc4mobx/hrmSalary/pages/reportView/components/condition.js +++ b/pc4mobx/hrmSalary/pages/reportView/components/condition.js @@ -153,11 +153,7 @@ export const condition = [ } ]; -const colorList = [ - "#709DF7", "#73DEB3", "#7585A2", "#F7C739", "#5FC3E3", "#AEE279", "#FF7F81", "#709DF7", "#73DEB3", "#7585A2", "#F7C739", "#5FC3E3", "#AEE279", "#FF7F81", - "#709DF7", "#73DEB3", "#7585A2", "#F7C739", "#5FC3E3", "#AEE279", "#FF7F81", "#709DF7", "#73DEB3", "#7585A2", "#F7C739", "#5FC3E3", "#AEE279", "#FF7F81", - "#709DF7", "#73DEB3", "#7585A2", "#F7C739", "#5FC3E3", "#AEE279", "#FF7F81", "#709DF7", "#73DEB3", "#7585A2", "#F7C739", "#5FC3E3", "#AEE279", "#FF7F81" -]; +const colorList = ["#709DF7", "#73DEB3", "#7585A2", "#F7C739", "#5FC3E3", "#AEE279", "#FF7F81"]; export const mapBarOptions = (params) => ({ tooltip: { trigger: "axis", @@ -194,29 +190,24 @@ export const mapBarOptions = (params) => ({ top: "10%", right: "0%", left: "5%", - bottom: "0%", + bottom: "10%", containLabel: true }, - xAxis: params.xAxis.map((item, index) => { - const data = Array(params.xAxis.length).fill(""); - data[index] = item; - return { - type: "category", - position: "bottom", - data: data, - axisTick: { - alignWithLabel: true, - show: false - }, - axisLabel: { - interval: 0, - margin: 10, - textStyle: { - fontSize: 11 - } + xAxis: { + type: "category", + axisTick: { + alignWithLabel: true, + show: false + }, + data: params.xAxis, + axisLabel: { + interval: 0, + margin: 10, + textStyle: { + fontSize: 11 } - }; - }), + } + }, yAxis: { name: params.name, type: "value", @@ -248,9 +239,62 @@ export const mapBarOptions = (params) => ({ } } }, - series: params.data.map(item => { - return [...dealBar(_.map(item.data, (it) => parseFloat(it.replace(/,/g, ""))), item.name)]; - }).reduce((acc, cur) => acc.concat(cur), []) + series: _.map(params.data, (item, index) => { + return { + name: item.name, + barWidth: "32", + barGap: "0%", + data: _.map(item.data, (it) => it.replace(/,/g, "")), + type: "bar", + itemStyle: { + normal: { + color: function (params) { + return colorList[params.seriesIndex] || colorList[Math.floor((Math.random() * colorList.length))]; + } + } + }, + label: { + show: true, + position: "insideBottom", + distance: 15, + align: "left", + verticalAlign: "middle", + rotate: "90", + formatter: function (params) { + if (parseInt(params.value) === 0) { + return ``; + } else { + return [ + `{a|${format_with_regex(params.value)}} {b|${params.seriesName}}` + ]; + } + }, + rich: { + a: { + fontWeight: "bold", + fontSize: 14, + color: "#333", + marginRight: 10 + }, + b: { + fontSize: 12, + color: "#333" + } + } + } + }; + }), + dataZoom: [ + { + type: "inside" + + }, + { + type: "slider", + show: true, + bottom: 20, + } + ] }); export const mapLineOptions = (params) => ({ tooltip: { @@ -262,7 +306,6 @@ export const mapLineOptions = (params) => ({ } }, legend: { - type: "scroll", icon: "circle", top: "0%", right: "center", @@ -331,7 +374,7 @@ export const mapLineOptions = (params) => ({ series: _.map(params.data, (item, index) => { return { name: item.name, - data: _.map(item.data, (it) => it.replace(/,/g, "")), + data: _.map(item.data, (it) => parseFloat(it.replace(/,/g, ""))), type: "line", itemStyle: { normal: { @@ -392,60 +435,3 @@ export const mapPieOptions = (params) => ({ }; }) }); - -const dealBar = (arr, name) => { - const bar = []; - arr.forEach((item, index) => { - const data = []; - for (let i = 0; i < index; i++) { - data.push(""); - } - if (item) { - data.push(item); - bar.push({ - name, - type: "bar", - xAxisIndex: index, - barWidth: 32, - data, - itemStyle: { - normal: { - color: function (params) { - return colorList[params.seriesIndex] || colorList[Math.floor((Math.random() * colorList.length))]; - } - } - }, - label: { - show: true, - position: "insideBottom", - distance: 15, - align: "left", - verticalAlign: "middle", - rotate: "90", - formatter: function (params) { - if (parseInt(params.value) === 0) { - return ``; - } else { - return [ - `{a|${format_with_regex(params.value)}} {b|${params.seriesName}}` - ]; - } - }, - rich: { - a: { - fontWeight: "bold", - fontSize: 14, - color: "#333", - marginRight: 10 - }, - b: { - fontSize: 12, - color: "#333" - } - } - } - }); - } - }); - return bar; -};