diff --git a/src/baseComponents/TableBaseComponent/index.js b/src/baseComponents/TableBaseComponent/index.js index 5ad9591..2116723 100644 --- a/src/baseComponents/TableBaseComponent/index.js +++ b/src/baseComponents/TableBaseComponent/index.js @@ -1819,7 +1819,8 @@ class TableBaseComponent extends ComponentBase { config={{ type: 'listPage/getTableData', payload: loadParamJson || {}, - url: tableConfig.api + url: tableConfig.api, + customParams:btnConfig.customParams//wyw 添加 参数到导出功能 url }} /> ) diff --git a/src/components/CustomPages/BI/BI056Dilg1_1.js b/src/components/CustomPages/BI/BI056Dilg1_1.js index 38310cb..4491b3f 100644 --- a/src/components/CustomPages/BI/BI056Dilg1_1.js +++ b/src/components/CustomPages/BI/BI056Dilg1_1.js @@ -13,7 +13,7 @@ class BI056Dilg1_1 extends React.Component { var isShowbtn2 = false var isShowbtn3 = false var isShowbtn4 = false - + switch (month) { case 4: case 5: @@ -39,7 +39,7 @@ class BI056Dilg1_1 extends React.Component { } this.state = { - ColorShow: ["#c02e30", "#f7aa52", "#fbe06a", "#5185f3", "#EF9494", "#51b5f3"], + ColorShow: this.props.data.ColorShow,// ["#c02e30", "#f7aa52", "#fbe06a", "#5185f3", "#EF9494", "#51b5f3"], month: month, barWidth: this.props.data.barWidth, seasonIndex: selectSeason, @@ -53,74 +53,74 @@ class BI056Dilg1_1 extends React.Component { formCode: "", title: "", }, - ret: { - IsSuccessful: true, - Data: { - checkMineType: { - legendName: ["公司级", "部门级", "车间级", "班组级"], - axisLabelMonth: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"], + Data: { + legendName: ["公司级", "部门级", "车间级", "班组级"], + axisLabelMonth: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"], + mineTypeName: ["露天矿", "选矿厂", "尾矿库", "职能部门"], + checkCountMonth: [ + //有几月的数据就统计到几月 时间不到不统计 也不能放入0 + // 公司级 、 部门级 车间级 班组级 各一个数组 + // [公司级露天矿1月数据,公司级选矿厂1月数据,公司级尾矿库1月数据,公司级职能部门1月数据 ,公司级露天矿2月数据,公司级选矿厂2月数据,公司级尾矿库2月数据,公司级职能部门2月数据] - mineTypeName: ["露天矿", "选矿厂", "尾矿库", "职能部门"], - checkCountMonth: [ - //有几月的数据就统计到几月 时间不到不统计 也不能放入0 - // 公司级 、 部门级 车间级 班组级 各一个数组 - // [公司级露天矿1月数据,公司级选矿厂1月数据,公司级尾矿库1月数据,公司级职能部门1月数据 ,公司级露天矿2月数据,公司级选矿厂2月数据,公司级尾矿库2月数据,公司级职能部门2月数据] - - // 公司级 - [1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9, 10, 10, 10, 10, 11, 11, 11, 11, 12, 12, 12, 12], - // 部门级 - [4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5], - // 车间级 - [28, 29, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30], - // 班组级 - [55, 56, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60] - - // // 2个月的数据如下图 - // [1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4], - // // 部门级 - // [5, 5, 5, 5, 5, 5, 5, 5, 7, 7, 7, 7, 8, 8, 8, 8], - // // 车间级 - // [30, 30, 30, 30, 30, 30, 30, 30, 9, 9, 9, 9, 4, 4, 4, 4], - // // 班组级 - // [60, 60, 60, 60, 60, 60, 60, 60, 10, 10, 10, 10, 11, 11, 10, 11] - - ] - }, - } + // 公司级 + [1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9, 10, 10, 10, 10, 11, 11, 11, 11, 12, 12, 12, 12], + // 部门级 + [4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5], + // 车间级 + [28, 29, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30], + // 班组级 + [55, 56, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60] + ] } } } componenthidMount() { - this.getBaseInfoData(); + // this.getBaseInfoData(); + this.getBaseInfoDataOnline(); } componentDidMount() { - this.getBaseInfoData(); + // this.getBaseInfoData(); + this.getBaseInfoDataOnline(); } //获取数据 - getBaseInfoDataOnline = (mineType) => { - const json2 = initFilter(this.props.login.OrgId); - extendOrder(json2, "CREATE_TIME", 1); - json2.Parameter1 = mineType; + getBaseInfoDataOnline = (mineType, seasonIndex) => { + const json = initFilter(this.props.login.OrgId); + // extendOrder(json, "CREATE_TIME", 1); + json.Parameter1 = mineType; + json.Keyword = (seasonIndex == undefined ? this.state.seasonIndex : seasonIndex) this.props.dispatch({ type: "app/getDataByPost", - url: "BI/BIController/getRiskPerformanceData", - payload: json2, + url: "BI/BISafe/GetBI056_1_1", + payload: json, onlyData: false, onComplete: (ret) => { - this.this.state.CheckCount(ret?.Data.checkMineType); + if (ret && ret.IsSuccessful) { + this.setState({ //设置setState全局变量 + Data: { + legendName: ret.Data.lisLevelOrder,// ["公司级", "部门级", "车间级", "班组级"], + axisLabelMonth: this.state.Data.axisLabelMonth,// ret.Data.lisMineTypeOrder,//["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"], + mineTypeName: ret.Data.lisMineTypeOrder,//["露天矿", "选矿厂", "尾矿库", "职能部门"], + checkCountMonth: ret.Data.Count,// [ + }, //将ret对象赋值给data, data供页面调用 + }) + this.CheckCount(this.state.Data, this.state.seasonIndex - 1); + } else { + message.error("获取信息失败,请刷新后再试!"); + } }, }); }; getBaseInfoData = (mineType) => { - this.CheckCount(this.state.ret.Data.checkMineType, this.state.seasonIndex - 1); + this.CheckCount(this.state.Data, this.state.seasonIndex - 1); }; onSelectChange(seasonIndex) { - this.CheckCount(this.state.ret.Data.checkMineType, seasonIndex - 1); + // this.CheckCount(this.state.Data, seasonIndex - 1); + this.getBaseInfoDataOnline(null, seasonIndex) }; // seasonIndex 从0开始 @@ -134,11 +134,10 @@ class BI056Dilg1_1 extends React.Component { for (let i = 0; i < 3; i++) { axisLabelMonth.push((i + 1 + seasonIndex * 3) + '月'); } - var xAxisName = [] for (let i = 0; i < 3; i++) { for (let j = 0; j < Data.mineTypeName.length; j++) { - xAxisName.push((i + 1 + seasonIndex * 3) + '月 ' + Data.mineTypeName[i])//3个月一图表 + xAxisName.push((i + 1 + seasonIndex * 3) + '月 ' + Data.mineTypeName[j])//3个月一图表 } } @@ -155,6 +154,7 @@ class BI056Dilg1_1 extends React.Component { var month = this.state.month var seriesShow = [] + for (let i = 0; i < Data.mineTypeName.length; i++) { var seriesData = []//数据 在每组数据中获取 Data.checkCountMonth[i] @@ -174,11 +174,12 @@ class BI056Dilg1_1 extends React.Component { } } - for (let j = dateIndexMin; j < dateIndexMax; j++) { - if (Data.checkCountMonth[i].length > j) { - seriesData.push(Data.checkCountMonth[i][j]) - } - } + // for (let j = dateIndexMin; j < dateIndexMax; j++) { + // if (Data.checkCountMonth[i].length > j) { + // seriesData.push(Data.checkCountMonth[i][j]) + // } + // } + seriesData = Data.checkCountMonth[i] seriesShow.push({ name: Data.legendName[i], @@ -276,12 +277,12 @@ class BI056Dilg1_1 extends React.Component { render() { return ( -
+
{/* 第一行 */} - - - + + {/* */} +