Compare commits

...

2 Commits

2 changed files with 52 additions and 2 deletions

View File

@ -59,6 +59,8 @@ class FullScreen extends React.Component {
MonthRecordCount: [],
MonthPersonCount: [],
},
trainingSubIDCard: {},
trainingSubBSType: {},
// 新增:当前选择的月份
selectedMonth: new Date().getMonth() + 1, // 默认当前月份1-12
};
@ -128,6 +130,8 @@ class FullScreen extends React.Component {
if (name === '安全培训') {
this.getHomeSESubYearData();
this.getHomeSESubYearMonthData();
this.getHomeSESubIDCardData();
this.getBSTypeMonthData();
}
};
@ -266,6 +270,52 @@ class FullScreen extends React.Component {
},
});
};
getHomeSESubIDCardData = () => {
const orgId = storage('lacal').getItem('webOrgId')?.val;
const json = initFilter(orgId);
const currentDate = new Date();
const year = currentDate.getFullYear();
const month = String(currentDate.getMonth() + 1).padStart(2, '0');
const day = String(currentDate.getDate()).padStart(2, '0');
const currentDateStr = `${year}-${month}-${day}`; // 例如2024-06-15
json.Parameter1 = currentDateStr; // 设置为当前日期
this.props.dispatch({
type: 'app/getDataByPost',
payload: json,
url: 'BI/BIHeadSE/SubCertificateType',
onComplete: (ret) => {
if (ret && !this.isUnmounted) {
this.setState({
trainingSubIDCard: ret,
});
}
},
});
};
getBSTypeMonthData = () => {
const orgId = storage('lacal').getItem('webOrgId')?.val;
const json = initFilter(orgId);
const currentDate = new Date();
const year = currentDate.getFullYear();
const month = String(currentDate.getMonth() + 1).padStart(2, '0');
const day = String(currentDate.getDate()).padStart(2, '0');
const currentDateStr = `${year}-${month}-${day}`; // 例如2024-06-15
json.Parameter1 = currentDateStr; // 设置为当前日期
this.props.dispatch({
type: 'app/getDataByPost',
payload: json,
url: 'BI/BIHeadSE/SubTypeMonth',
onComplete: (ret) => {
if (ret && !this.isUnmounted) {
this.setState({
trainingSubBSType: ret,
});
}
},
});
};
renderOtherTabContent = () => {
const { activeTab, trainingData, trainingSubData, trainingSubDataMonth, selectedMonth } = this.state;

View File

@ -652,8 +652,8 @@
align-items: center;
background: rgba(255, 255, 255, 0.9);
padding: 4px 12px;
border-radius: 20px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
// border-radius: 20px;
// box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.monthSelectorLabel {