diff --git a/src/components/CustomPages/BI/BI064FormRunAnalysis.js b/src/components/CustomPages/BI/BI064FormRunAnalysis.js index 2e2f744..4be82a9 100644 --- a/src/components/CustomPages/BI/BI064FormRunAnalysis.js +++ b/src/components/CustomPages/BI/BI064FormRunAnalysis.js @@ -1,14 +1,14 @@ import React from 'react'; import { connect } from 'dva'; import { initFilter } from '../../../utils/common'; -import { Table, Row, Spin, Card, Modal,Col ,Button,Form} from 'antd'; -import DropDownPagination from '../../common/DropDownPaginationEx' +import { Table, Row, Spin, Card, Modal, Col, Button, Form } from 'antd'; +import DropDownPagination from '../../common/DropDownPaginationEx'; class BI064FormRunAnalysis extends React.Component { constructor(props) { super(props); this.state = { depart: {}, - inputText:'', + inputText: '', retData: [], // 表单运行数据 companyData: [], // 公司数据 loading: true, @@ -73,17 +73,16 @@ class BI064FormRunAnalysis extends React.Component { // 加载数据 loadData = () => { this.getBaseData(); - }; - handleSearch = ({data, record}) => { + handleSearch = ({ data, record }) => { this.setState({ depart: { ...this.state.depart, ID: data[0], - NAME:record?.NAME, + NAME: record?.NAME, }, - inputText:record? record?.NAME:this.state.inputText, - }) + inputText: record ? record?.NAME : this.state.inputText, + }); }; // 获取公司数据 getBaseData = () => { @@ -96,12 +95,11 @@ class BI064FormRunAnalysis extends React.Component { onlyData: false, onComplete: (ret) => { if (ret && ret.Data) { - let keyword = ret.Data[0]?.NAME - if(this.props.login.OrgId ==="00300000-0000-0000-0000-000000000000") - { - keyword = ret.Data.filter(t=>t.ID == this.props.login.OrgId)[0]?.NAME + let keyword = ret.Data[0]?.NAME; + if (this.props.login.OrgId === '00300000-0000-0000-0000-000000000000') { + keyword = ret.Data.filter((t) => t.ID == this.props.login.OrgId)[0]?.NAME; } - this.setState({ companyData: ret.Data,inputText:keyword}, () => { + this.setState({ companyData: ret.Data, inputText: keyword }, () => { this.getrealData(); // this.processData(); }); @@ -113,7 +111,7 @@ class BI064FormRunAnalysis extends React.Component { // 获取表单运行数据 getrealData = () => { // const json = initFilter(this.props.login.OrgId); - let json = initFilter("00300000-0000-0000-0000-000000000000",this.state.inputText); + let json = initFilter('00300000-0000-0000-0000-000000000000', this.state.inputText); this.props.dispatch({ type: 'app/getDataByPost', url: 'BI/BIStatiscialAnalysisController/GetTaskViewInfo', @@ -133,9 +131,9 @@ class BI064FormRunAnalysis extends React.Component { // 处理数据,生成表格所需格式 processData = () => { - const { retData, companyData ,inputText} = this.state; + const { retData, companyData, inputText } = this.state; if (!retData.length || !companyData.length) return; - let companyDataTemp=companyData.filter(t=>t.NAME === inputText) + let companyDataTemp = companyData.filter((t) => t.NAME === inputText); // 获取所有模块和表单的列表 const modules = [...new Set(retData.map((item) => item.MOULD_NAME))]; const forms = []; @@ -266,15 +264,21 @@ class BI064FormRunAnalysis extends React.Component { }; // 动态生成表格列 - generateColumns = (companyData) => {debugger + generateColumns = (companyData) => { const baseColumns = [ { - width: '150px', + // width: '150px', title: '模块', dataIndex: 'module', key: 'module', - fixed: 'left', + // fixed: 'left', align: 'center', + onCell: (record) => ({ + style: { + minWidth: '150px', // 设置最小宽度 + whiteSpace: 'nowrap', // 防止换行 + }, + }), render: (value, row, index) => { const obj = { children: value, @@ -290,12 +294,18 @@ class BI064FormRunAnalysis extends React.Component { }, }, { - width: '200px', + // width: '200px', title: '表单', dataIndex: 'form', key: 'form', - fixed: 'left', + // fixed: 'left', align: 'center', + onCell: () => ({ + style: { + minWidth: '200px', + whiteSpace: 'nowrap', + }, + }), }, ]; @@ -311,7 +321,7 @@ class BI064FormRunAnalysis extends React.Component { title: '总任务数', dataIndex: `${companyDataKey}_total`, key: `${companyDataKey}_total`, - width: '80px', + width: '150px', align: 'center', render: (text, record) => ( @@ -323,7 +333,7 @@ class BI064FormRunAnalysis extends React.Component { title: '正常完成', dataIndex: `${companyDataKey}_normal`, key: `${companyDataKey}_normal`, - width: '80px', + width: '150px', align: 'center', render: (text, record) => ( @@ -335,7 +345,7 @@ class BI064FormRunAnalysis extends React.Component { title: '超时完成', dataIndex: `${companyDataKey}_overtime`, key: `${companyDataKey}_overtime`, - width: '80px', + width: '150px', align: 'center', render: (text, record) => ( @@ -347,7 +357,7 @@ class BI064FormRunAnalysis extends React.Component { title: '进行中', dataIndex: `${companyDataKey}_doing`, key: `${companyDataKey}_doing`, - width: '80px', + width: '150px', align: 'center', render: (text, record) => ( @@ -359,7 +369,7 @@ class BI064FormRunAnalysis extends React.Component { title: '超期未完成', dataIndex: `${companyDataKey}_overUnfinish`, key: `${companyDataKey}_overUnfinish`, - width: '80px', + width: '150px', align: 'center', render: (text, record) => ( @@ -373,7 +383,7 @@ class BI064FormRunAnalysis extends React.Component { title: '完成率', dataIndex: `${companyDataKey}_finishRate`, key: `${companyDataKey}_finishRate`, - width: '80px', + width: '150px', align: 'center', render: (text) => {text}%, }, @@ -381,8 +391,8 @@ class BI064FormRunAnalysis extends React.Component { title: '及时率', dataIndex: `${companyDataKey}_normalRate`, key: `${companyDataKey}_normalRate`, - width: '80px', align: 'center', + width: '150px', render: (text) => {text}%, }, ], @@ -390,6 +400,7 @@ class BI064FormRunAnalysis extends React.Component { baseColumns.push(companyColumns); }); + console.log('生成的列:', baseColumns); return baseColumns; }; @@ -447,7 +458,7 @@ class BI064FormRunAnalysis extends React.Component { const formItemLayout = { labelCol: { span: 8 }, wrapperCol: { span: 16 }, - } + }; return (
系统运行情况统计分析 - - - - - { - params.OrderType = 1 - params.OrgId = this.props.login.OrgId - }} /> - - - + + + + { + params.OrderType = 1; + params.OrgId = this.props.login.OrgId; + }} + /> + + + + + @@ -514,7 +530,7 @@ class BI064FormRunAnalysis extends React.Component { width: '100%', textAlign: 'center', }} - scroll={{ x: 'max-content', y: 600 }} + scroll={{ x: 1500, y: 600 }} dataSource={tableData} columns={columns} pagination={false} @@ -522,22 +538,6 @@ class BI064FormRunAnalysis extends React.Component { size="middle" bordered rowKey="key" - summary={() => ( - - - - 汇总 - - {columns.slice(2).map((col, index) => ( - - {col.title === '总任务数' && ( - {tableData.reduce((sum, row) => sum + (row[col.dataIndex] || 0), 0)} - )} - - ))} - - - )} /> {/* */} diff --git a/src/components/CustomPages/SE/SE018PaperPage.js b/src/components/CustomPages/SE/SE018PaperPage.js index 8811f65..68bba33 100644 --- a/src/components/CustomPages/SE/SE018PaperPage.js +++ b/src/components/CustomPages/SE/SE018PaperPage.js @@ -1,7 +1,7 @@ import { message } from "antd/lib/index"; import { Button, Popconfirm, Row, Col, Checkbox, Radio, Form, Input, Select, Table, Upload, Icon, PageHeader, Modal, Spin } from 'antd'; import React from 'react'; -import { initFilter, extendRule, extendInclude, setDataFieldValue, guid, initQueryFilter, showFiles, getFileShow } from "../../../utils/common"; +import { initFilter, extendRule, extendInclude, setDataFieldValue, guid, initQueryFilter, GetFileModel, showFiles, getFileShow } from "../../../utils/common"; import ReactToPrint from "react-to-print"; import styles from '../../CustomPages/HI/StepForm.css'; import SEstyles from './SE.css'; @@ -9,6 +9,7 @@ import XLSX from 'xlsx'; import { connect } from 'dva'; import moment from 'moment'; import configc from "../../../config.js"; +import FormPage from '../../../components/FormPage' const Option = Select.Option; const answer = { @@ -46,7 +47,12 @@ class SE018PaperPage extends React.Component { btnText: '提交问卷', //'下一题' perPaper: [], //每次的答题 wyw 20260306 listPath: [], - indexCour: -1 //课件 + indexCour: -1, //课件, + fileData: [], + fileForm: { + title: "", + visible: false, + }, }; }; componentDidMount() { @@ -511,6 +517,7 @@ class SE018PaperPage extends React.Component { ) }
+
(this.componentRef = el)} id={'tableId' + this.props.data.id}>

培训在线答题

@@ -685,6 +692,9 @@ class SE018PaperPage extends React.Component {
+ { + GetFileModel(Modal, FormPage, this, this.state.fileForm.visible) + }
} } diff --git a/src/utils/common.js b/src/utils/common.js index dc3384f..6e573ac 100644 --- a/src/utils/common.js +++ b/src/utils/common.js @@ -1546,6 +1546,7 @@ export function getFileShow(FILE_PATH, FILE_NAME) { Nav_ImgFile: { FILE_PATH: FILE_PATH, FILE_NAME: FILE_NAME, + FILE_TYPE:'' } }) return result;