This commit is contained in:
何美荣 2026-05-13 11:33:31 +08:00
commit 5196bd88ee
16 changed files with 154 additions and 120 deletions

View File

@ -417,7 +417,6 @@ class TableBaseComponent extends ComponentBase {
实际加载表数据
*/
doLoadTableData = (loadParamJson, tableCode, onComplete, onLoadData) => {
console.log('调用查询实际过程', 6);
const payloadJson = this.getLoadTableDataParams(loadParamJson, tableCode);
if (!payloadJson) return;
@ -426,7 +425,6 @@ class TableBaseComponent extends ComponentBase {
}
const tableConfig = this.getTableConfig({ tableCode });
const { api } = tableConfig ? tableConfig : {};
console.log('调用查询实际过程', 7, api);
this.props.dispatch({
type: 'listPage/getTableData',

View File

@ -511,8 +511,8 @@ class SE001EditPage extends React.Component {
ANSWER: value
});
}}>
<Option value={1}></Option>
<Option value={2}></Option>
<Option value={1}>正确</Option>
<Option value={2}>错误</Option>
</Select>
)
}

View File

@ -1,6 +1,6 @@
import { Button, Descriptions, Modal, Popconfirm, Row, Col, Form, Input, Select, Table, Icon } from 'antd';
import React from 'react';
import { initFilter, extendRule, extendInclude, setDataFieldValue, showApprove, guid, initQueryFilter, GetFileModel, showFiles } from '../../../utils/common';
import { initFilter, extendRule, extendInclude, setDataFieldValue, showApprove, guid, initQueryFilter, GetFileModel, showFiles, getArryPropShow } from '../../../utils/common';
import ReactToPrint from 'react-to-print';
import { ExportToExcel } from '@woowalker/feui'
import XLSX from 'xlsx';
@ -103,6 +103,7 @@ class SE061ShowPrint extends React.Component {
extendInclude(json, 'Nav_Department')
extendInclude(json, 'Nav_User')
extendInclude(json, 'Nav_Content')
extendInclude(json, 'Nav_Teachers.Nav_User')
extendInclude(json, 'Nav_Files.Nav_ImgFile')
extendInclude(json, 'Nav_NewUserDetail.Nav_User')
extendInclude(json, 'Nav_NewUserDetail.Nav_Department')
@ -140,7 +141,7 @@ class SE061ShowPrint extends React.Component {
<div ref={el => (this.componentRef = el)} style={{ padding: '20px', paddingTop: '20px' }} id={'tableId' + this.props.data.id}>
<h1 className={styles.showPrintHead}>三级安全教育记录</h1>
{
data ? <div style={{ width: '95%' }}>
data ? <div>
<Descriptions title='' size='middle' bordered>
<Descriptions.Item label="发起部门">{data.Nav_Department.NAME}</Descriptions.Item>
<Descriptions.Item label="发起人">{data.Nav_User.NAME}</Descriptions.Item>
@ -149,10 +150,10 @@ class SE061ShowPrint extends React.Component {
<Descriptions.Item label="截止时间">{data.END_TIME}</Descriptions.Item>
<Descriptions.Item label="培训学时">{data.TRAINNING_TIME}</Descriptions.Item>
<Descriptions.Item label="培训地点">{data.TAINNING_ADDR}</Descriptions.Item>
<Descriptions.Item label="培训老师">{data.TEACHER}</Descriptions.Item>
<Descriptions.Item label="培训形式">{data ? this.returnModel(data.TRAIN_MODEL) : null}</Descriptions.Item>
<Descriptions.Item label="培训老师">{getArryPropShow(data.Nav_Teachers, "Nav_User.NAME")}</Descriptions.Item>
<Descriptions.Item label="培训形式">{enums.TrainType.enums[data.TRAINTYPE]}</Descriptions.Item>
<Descriptions.Item label="培训内容" span="3">{data.Nav_Content.NAME}</Descriptions.Item>
<Descriptions.Item label="附件">{showFiles(data.Nav_Files, config.picServerHost, this)}</Descriptions.Item>
<Descriptions.Item label="附件" span="2">{showFiles(data.Nav_Files, config.picServerHost, this)}</Descriptions.Item>
<Descriptions.Item label="是否触发考试">{data.IS_CREATETEST ? "是" : "否"}</Descriptions.Item>
</Descriptions>
</div> : null
@ -169,26 +170,28 @@ class SE061ShowPrint extends React.Component {
<td>姓名</td>
<td>身份证号</td>
<td>入职时间</td>
<td>分数</td>
<td>部门</td>
<td>岗位</td>
<td>分数</td>
<td>考核结果</td>
<td style={{ display: this.state.isShow1 }}>查看试卷</td>
<td style={{ display: this.state.isShow2 }}>附件</td>
</tr>
{data?.Nav_NewUserDetail?.map((item, i) => {
return <tr>
<td>{item.CODE} </td>
<td>{item.Nav_User?.NAME} </td>
<td>{item.ID_CARD_NUMBER} </td>
<td>{moment(item.IN_TIME).format('YYYY-MM-DD')} </td>
<td>{item.SCORE} </td>
<td>{item.Nav_Department?.NAME} </td>
<td>{item.Nav_Post?.NAME} </td>
<td>{enums.SEExaminationResultsEnum.enums[item.EXAMINATION_RESULTS]} </td>
<td style={{ display: this.state.isShow1 }}><div onClick={() => this.showDetailModal(item.ID)}><Icon type="eye" style={{ color: "#005b9b", cursor: "pointer" }} /></div></td>
<td style={{ display: this.state.isShow2 }}>{showFiles(item.Nav_Files, config.picServerHost, this)} </td>
</tr>
if (item.IS_DELETED == null || item.IS_DELETED == false) {
return <tr>
<td>{item.CODE} </td>
<td>{item.Nav_User?.NAME} </td>
<td>{item.ID_CARD_NUMBER} </td>
<td>{moment(item.IN_TIME).format('YYYY-MM-DD')} </td>
<td>{item.Nav_Department?.NAME} </td>
<td>{item.Nav_Post?.NAME} </td>
<td>{item.SCORE} </td>
<td>{enums.SEExaminationResultsEnum.enums[item.EXAMINATION_RESULTS]} </td>
<td style={{ display: this.state.isShow1 }}><div onClick={() => this.showDetailModal(item.ID)}><Icon type="eye" style={{ color: "#005b9b", cursor: "pointer" }} /></div></td>
<td style={{ display: this.state.isShow2 }}>{showFiles(item.Nav_Files, config.picServerHost, this)} </td>
</tr>
}
})}
</tbody>
</table>

View File

@ -297,7 +297,6 @@ class AdvanceSearch extends Component {
*/
handleSearch = (self = true) => {
if (this.setShareIns(self)) return
console.log('调用查询开始', 1)
const { onSearch } = this.props
onSearch instanceof Function && onSearch()
}

View File

@ -38,7 +38,12 @@ export default {
onBlur={(editorState) => {
const htmlContent = editorState.toHTML();
if (params.record.TITLE != htmlContent) {
params.setFieldValue('TITLE', htmlContent);
var plainText = htmlContent.replace(/<[^>]+>/g, '');
const temps = [];
temps.push({ field: 'TITLE', value: htmlContent })
temps.push({ field: 'TITLE_SHOW', value: plainText })
params.setFieldValueByBatch(temps);
// params.setFieldValue('TITLE', htmlContent);
}
}}
placeholder={placeholder}

View File

@ -1,3 +1,4 @@
import { message } from "antd/lib/index";
import React, { useState } from 'react';
import { Form, Col } from 'antd'
import { extendInclude, extendRule, initFilter } from "../../utils/common";
@ -9,12 +10,29 @@ import 'braft-editor/dist/index.css';
*/
export default {
onBeforeEdit: ({ isNew, login, stateData }) => {
onBeforeEdit: ({ isNew, login, stateData, setFieldValue }) => {
if (isNew) {
stateData.STATUS = 0
setFieldValue('V_ISSHOWCONTROL', true);
}
},
onBeforeSaveHandleRecord(params) {
params.record.STATUS = params.customParams
},
onChange: ({ value, colInfo, getFieldValue, setFieldVisible, setFieldValue, setFieldEditable, stateData }) => {
if (colInfo.FIELD_NAME == 'V_ISAUTO') {
if (value == true) {
setFieldValue('V_ISSILENT', true);
setFieldEditable('V_ISSILENT', false);
} else {
setFieldEditable('V_ISSILENT', true);
}
} else if (colInfo.FIELD_NAME == 'V_ISSHOWCONTROL') {
if (value == false) {
if (stateData.V_ISAUTO == undefined || stateData.V_ISAUTO == false) {
message.warn("必须自动才能不显示控制器");
}
}
}
}
};

View File

@ -161,4 +161,27 @@ export default {
}
}
},
//向下同步培训组织 单选
btnSyncRole: ({ stateData, saveRowRecord }) => {
var totalCount = stateData.Nav_ListPlanDetail.length
if (totalCount < 2) {
return
}
var ApproveRole = {}
for (var i = 1; i < totalCount; i++) {
//本行数据 如果为空 取上一行的 APPROVAL_ROLE_ID Nav_ApproveRole
if ((stateData.Nav_ListPlanDetail[i].APPROVAL_ROLE_ID == null || stateData.Nav_ListPlanDetail[i].APPROVAL_ROLE_ID == undefined) && stateData.Nav_ListPlanDetail[i - 1].APPROVAL_ROLE_ID) {
ApproveRole = {
ID: stateData.Nav_ListPlanDetail[i - 1].APPROVAL_ROLE_ID,
NAME: stateData.Nav_ListPlanDetail[i - 1].Nav_ApproveRole.NAME
}
if (ApproveRole.ID != null && ApproveRole.ID != undefined) {
let iRow = { ...stateData.Nav_ListPlanDetail[i] };
iRow.APPROVAL_ROLE_ID = ApproveRole.ID
iRow.Nav_ApproveRole = ApproveRole
saveRowRecord({ record: iRow, editCode: "T_SE_TRAIN_PLAN_DETAIL" })
}
}
}
},
}

View File

@ -85,4 +85,10 @@ app.router(require('./router').default);
// 5. Start
app.start('#root');
window.g_app = app;
window.g_app = app;
const { localStorage } = window
for (let i = 0; i < localStorage.length; i++) {
const key = localStorage.key(i)
key.indexOf('_requestKey') > -1 && localStorage.removeItem(key)
}

View File

@ -70,8 +70,8 @@ class ClassBuild extends React.Component {
}
// 注意:数据结构是 { companyName: '邦泰', rate: '52%' }
const companyNames = companyList.map((item) => item.companyName);
const rates = companyList.map((item) => {
const companyNames = companyList?.map((item) => item.companyName);
const rates = companyList?.map((item) => {
// 处理 rate 可能是字符串带百分号的情况
const rateValue = typeof item.rate === 'string' ? parseFloat(item.rate.replace('%', '')) : item.rate;
return isNaN(rateValue) ? 0 : rateValue;

View File

@ -102,7 +102,18 @@ class DangerJob extends React.Component {
companyName = selectedCompanyObj?.NAME || '';
}
return (
<div style={{ textAlign: 'center', padding: '50px', color: '#999' }}>
<div
style={{
textAlign: 'center',
padding: '50px',
color: '#999',
fontSize: '26px',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
flex: 1,
}}
>
{selectedCompany ? `${companyName}暂无危险作业数据` : '暂无危险作业数据'}
</div>
);

View File

@ -122,18 +122,17 @@ class HiddenSolve extends React.Component {
},
legend: {
data: ['重大隐患', '一般隐患'],
orient: 'vertical',
right: '3%',
top: '5%',
itemGap: 16,
itemWidth: 18,
itemHeight: 12,
textStyle: { color: '#000', fontSize: 14 },
top: '10%',
itemGap: 12,
itemWidth: 16,
itemHeight: 10,
textStyle: { color: '#000', fontSize: 12 },
},
grid: {
left: '8%',
right: '5%',
top: '18%',
top: '28%',
bottom: '8%',
containLabel: true,
},
@ -251,9 +250,9 @@ class HiddenSolve extends React.Component {
const companyNames = hiddenRectifyList.map((item) => item.companyName);
const majorTotal = hiddenRectifyList.map((item) => item.majorCount);
const majorRectified = hiddenRectifyList.map((item) => (item.majorCount || 0) - (item.majorCountNo || 0));
const majorRectified = hiddenRectifyList.map((item) => item.majorCountNo);
const generalTotal = hiddenRectifyList.map((item) => item.generalCount);
const generalRectified = hiddenRectifyList.map((item) => (item.generalCount || 0) - (item.generalCountNo || 0));
const generalRectified = hiddenRectifyList.map((item) => item.generalCountNo);
const option = {
title: {
@ -275,18 +274,17 @@ class HiddenSolve extends React.Component {
},
legend: {
data: ['重大隐患量', '重大隐患未整改量', '一般隐患量', '一般隐患未整改量'],
orient: 'vertical',
right: '3%',
top: '5%',
top: '10%',
itemGap: 12,
itemWidth: 18,
itemHeight: 12,
itemWidth: 16,
itemHeight: 10,
textStyle: { color: '#000', fontSize: 12 },
},
grid: {
left: '8%',
right: '5%',
top: '18%',
top: '28%',
bottom: '8%',
containLabel: true,
},

View File

@ -7,7 +7,8 @@ import echarts from 'echarts';
import configc from '../../config';
import 'slick-carousel/slick/slick.css';
import 'slick-carousel/slick/slick-theme.css';
import { extendRule } from '../../utils/common';
import { extendRule, showFileModal, showFiles, GetFileModel } from '../../utils/common';
import FormPage from '../../components/FormPage';
class HomeContent extends React.Component {
constructor(props) {
@ -22,6 +23,12 @@ class HomeContent extends React.Component {
this.chartResizeHandlers = {};
this.isUnmounted = false;
this.autoplayTimer = null;
this.state = {
fileForm: {
title: '',
visible: false,
},
};
}
waitForElement = (elementId, maxRetries = 10) => {
@ -92,7 +99,7 @@ class HomeContent extends React.Component {
label: {
show: true,
position: 'inside',
formatter: '{a|{b}{c}}\n\n\n{e|({d}%)}', // 添加 \n 换行符
formatter: '{d}%', // 添加 \n 换行符
color: '#000',
textBorderWidth: 0,
rich: {
@ -194,7 +201,7 @@ class HomeContent extends React.Component {
},
legend: {
data: legendData,
right: 0,
right: '3%',
top: '10%',
itemGap: 12,
itemWidth: 16,
@ -367,6 +374,7 @@ class HomeContent extends React.Component {
},
label: { show: true, position: 'top', textStyle: { color: '#000', fontSize: 12 }, formatter: '{c}' },
barWidth: '60%',
barMaxWidth: 40,
},
],
};
@ -405,7 +413,7 @@ class HomeContent extends React.Component {
this.echartsInstances.backLogChart = echarts.init(backLogCharts);
this.echartsInstances.backLogChart.setOption({
title: {
text: '当月工作培训统计数量',
text: '当月培训统计数量',
x: 'center',
y: '25%',
textStyle: { fontSize: 16, color: '#999' },
@ -428,7 +436,7 @@ class HomeContent extends React.Component {
const option = {
title: {
text: '当月工作培训统计数量',
text: '当月培训统计数量',
x: 'center',
y: '5%',
textStyle: { fontSize: 16, color: '#000' },
@ -446,18 +454,17 @@ class HomeContent extends React.Component {
},
legend: {
data: ['培训人次', '培训场次'],
orient: 'vertical',
right: 0,
top: 'middle',
itemGap: 16,
itemWidth: 18,
itemHeight: 12,
textStyle: { color: '#000', fontSize: 14 },
right: '3%',
top: '10%',
itemGap: 12,
itemWidth: 16,
itemHeight: 10,
textStyle: { color: '#000', fontSize: 12 },
},
grid: {
left: '5%',
right: '5%',
top: '18%',
top: '28%',
bottom: '5%',
containLabel: true,
},
@ -704,7 +711,7 @@ class HomeContent extends React.Component {
if (!currentAnnouncement) return null;
const { TITLE, ABSTRACT, START, END, CONTENT, Nav_Files = [] } = currentAnnouncement;
const { TITLE, ABSTRACT, START, END, CONTENT, CREATE_USER_NAME, Nav_Files = [] } = currentAnnouncement;
return (
<div>
@ -729,7 +736,8 @@ class HomeContent extends React.Component {
{/* 日期 */}
<div style={{ fontSize: '12px', color: '#999', marginBottom: '16px', textAlign: 'center' }}>
{START} {END}
{START ? START : '--'} {END ? END : '--'}
<span style={{ marginLeft: '20px' }}>{CREATE_USER_NAME ? CREATE_USER_NAME : ''}</span>
</div>
{/* 分割线 */}
@ -753,46 +761,9 @@ class HomeContent extends React.Component {
<div style={{ fontWeight: 'bold', marginBottom: '12px', fontSize: '14px', color: '#333' }}>
附件 ({Nav_Files.length})
</div>
<div style={{ display: 'flex', flexDirection: 'column', gap: '8px' }}>
{Nav_Files.map((file, index) => (
<div
key={file.ID || index}
style={{
display: 'flex',
alignItems: 'center',
justifyContent: 'space-between',
padding: '8px 12px',
backgroundColor: '#f5f5f5',
borderRadius: '4px',
}}
>
<span style={{ fontSize: '14px', color: '#333', flex: 1 }}>
<Icon type="paper-clip" style={{ marginRight: '8px', color: '#1890ff' }} />
{file.Nav_ImgFile?.FILE_NAME || '未知文件'}
</span>
<div>
<Button
type="link"
size="small"
onClick={() => this.handlePreview(file)}
style={{ padding: '0 8px' }}
>
<Icon type="eye" />
预览
</Button>
<Button
type="link"
size="small"
onClick={() => this.handleDownload(file)}
style={{ padding: '0 8px' }}
>
<Icon type="download" />
下载
</Button>
</div>
</div>
))}
</div>
{showFiles(Nav_Files, configc.picServerHost, this)}
{GetFileModel(Modal, FormPage, this, this.state.fileForm.visible)}
<FormPage {...this.state.tmpData} />
</div>
)}
</div>
@ -862,7 +833,7 @@ class HomeContent extends React.Component {
<Col span={8} className={styles.hiddenStatsCol}>
<div className={styles.hiddenTitle}>年度隐患数据</div>
<div className={styles.hiddenStatItem}>
<div className={styles.hiddenStatName}>年度重大隐患数</div>
<div className={styles.hiddenStatName}>年度重大隐患数</div>
<div className={styles.hiddenStatValue}>{hiddenSummary.majorQty}</div>
</div>
<div className={styles.hiddenStatItem}>

View File

@ -96,18 +96,17 @@ class RiskControl extends React.Component {
},
legend: {
data: ['重大风险', '较大风险', '一般风险', '低风险'],
orient: 'vertical',
right: '3%',
top: '5%',
itemGap: 16,
itemWidth: 18,
itemHeight: 12,
textStyle: { color: '#000', fontSize: 14 },
top: '10%',
itemGap: 12,
itemWidth: 16,
itemHeight: 10,
textStyle: { color: '#000', fontSize: 12 },
},
grid: {
left: '8%',
right: '5%',
top: '18%',
top: '28%',
bottom: '8%',
containLabel: true,
},
@ -281,7 +280,7 @@ class RiskControl extends React.Component {
axisTick: { show: false },
axisLabel: {
textStyle: { color: '#000' },
// rotate: typeNames.length > 4 ? 15 : 0,
rotate: typeNames.length > 4 ? 15 : 0,
interval: 0,
fontSize: 12,
},

View File

@ -98,7 +98,7 @@ class TrainingContent extends React.Component {
legend: {
data: ['培训人次', '培训场次'],
right: '3%', // 靠右
top: '5%', // 垂直居中
top: '10%', // 垂直居中
itemGap: 16,
itemWidth: 18,
itemHeight: 12,
@ -107,7 +107,7 @@ class TrainingContent extends React.Component {
grid: {
left: '5%',
right: '5%', // 为右侧垂直图例留出空间
top: '18%',
top: '28%',
bottom: '8%',
containLabel: true,
},
@ -267,7 +267,7 @@ class TrainingContent extends React.Component {
legend: {
data: ['培训人次', '培训场次'],
right: '3%', // 靠右
top: '5%', // 垂直居中
top: '10%', // 垂直居中
itemGap: 16,
itemWidth: 18,
itemHeight: 12,
@ -276,7 +276,7 @@ class TrainingContent extends React.Component {
grid: {
left: '5%',
right: '5%', // 为右侧垂直图例留出空间
top: '18%',
top: '28%',
bottom: '8%',
containLabel: true,
},
@ -416,7 +416,7 @@ class TrainingContent extends React.Component {
legend: {
data: ['培训人次', '培训场次'],
right: '3%', // 靠右
top: '5%', // 垂直居中
top: '10%', // 垂直居中
itemGap: 16,
itemWidth: 18,
itemHeight: 12,
@ -425,7 +425,7 @@ class TrainingContent extends React.Component {
grid: {
left: '5%',
right: '5%', // 为右侧垂直图例留出空间
top: '18%',
top: '28%',
bottom: '8%',
containLabel: true,
},
@ -512,6 +512,8 @@ class TrainingContent extends React.Component {
const headers = trainingSubIDCard[0] || [];
// 数据行(从第二行开始)
const dataRows = trainingSubIDCard.slice(1);
// 生成稳定的 key当数据变化时强制重新创建表格
const tableKey = `${headers.join('-')}-${dataRows.length}`;
// 计算每列的最小宽度(根据表头文字长度)
const getColumnWidth = (header) => {
const chineseCharWidth = 14; // 中文字符宽度(px)
@ -530,7 +532,7 @@ class TrainingContent extends React.Component {
key: `col${index}`,
align: 'center',
width: getColumnWidth(header),
fixed: index === 0 ? 'left' : index === headers.length - 1 ? 'right' : undefined,
fixed: index === 0 ? 'left' : undefined,
render: (text) => {
if (header === '小计') {
return <strong style={{ color: '#4285f4' }}>{text}</strong>;
@ -553,11 +555,12 @@ class TrainingContent extends React.Component {
});
// 横向滚动配置(当列数过多时)
const scrollConfig = columns.length > 10 ? { x: columns.length * 100, y: 380 } : { y: 380 };
const scrollConfig = { x: columns.length * 100, y: 380 };
return (
<div style={{ height: '100%', overflow: 'hidden', padding: '10px' }}>
<Table
key={tableKey} // 添加 key 属性,数据变化时强制重新渲染
columns={columns}
dataSource={tableData}
pagination={false}
@ -617,6 +620,9 @@ class TrainingContent extends React.Component {
componentDidUpdate(prevProps) {
// 当 trainingSubData 或 trainingSubDataMonth 变化时重新渲染图表
if (prevProps.trainingSubData !== this.props.trainingSubData) {
this.renderChart1();
}
if (
prevProps.trainingSubDataMonth !== this.props.trainingSubDataMonth ||
prevProps.selectedMonth !== this.props.selectedMonth

View File

@ -75,7 +75,7 @@ class FullScreen extends React.Component {
// 其他页面数据
riskSubData: {},
classSubData: {},
classSubData: [],
dangerSubData: {},
dangerCompanyData: [],
selectedDangerCompany: '',
@ -170,7 +170,7 @@ class FullScreen extends React.Component {
this.props.dispatch({
type: 'app/getDataByPost',
payload: json,
url: 'PF/Annourcement/Get',
url: 'PF/PFAnnourcement/Get',
onComplete: (ret) => {
if (ret && !this.isUnmounted) {
this.setState({

View File

@ -22,11 +22,8 @@ export default {
return ret
},
*getTableData ({ payload, url, onComplete }, { call, put }) {
console.log('执行前',appService.getTableData)
const ret = yield call(appService.getTableData, { payload, url })
console.log('执行后')
if (typeof onComplete === 'function') {
console.log('执行后',ret)
onComplete(ret)
}
return ret