提交 17294f9c authored 作者: 钟是志's avatar 钟是志

30041 学籍管理--班级信息,,,点击空白

上级 ca3a6264
...@@ -13,184 +13,214 @@ import { Link } from 'dva/router'; ...@@ -13,184 +13,214 @@ import { Link } from 'dva/router';
import { CreateC } from '../../ExportComponent/ActiveMenuComponent'; import { CreateC } from '../../ExportComponent/ActiveMenuComponent';
class Index extends React.Component { class Index extends React.Component {
static defaultProps = { static defaultProps = {
hasBatchAudit: false, // 是否有批量审核按钮 默认关掉 如果有需要再在外面包一层 2020年5月6日 18:44:11 钟是志 hasBatchAudit: false, // 是否有批量审核按钮 默认关掉 如果有需要再在外面包一层 2020年5月6日 18:44:11 钟是志
batchAuditButtonName: '批量审核', // 如果需要批量审核 则直接用 BatchAudit.js 文件 batchAuditButtonName: '批量审核', // 如果需要批量审核 则直接用 BatchAudit.js 文件
}; };
constructor(props) { constructor(props) {
super(props); super(props);
let pathname = this.props.location.pathname; let pathname = this.props.location.pathname;
this.state = { this.state = {
columns: [], columns: [],
dataList: [], dataList: [],
headerInfo: [], headerInfo: [],
workId: this.props.workId || '', workId: this.props.workId || '',
searchCondition: [], searchCondition: [],
pathname, pathname,
dataBaseId: this.props.dataBaseId || '', dataBaseId: this.props.dataBaseId || '',
addCondition: [], addCondition: [],
addFields: [], // 新增时填写的字段。 addFields: [], // 新增时填写的字段。
tableInfo: {}, // 表格配置属性 tableInfo: {}, // 表格配置属性
allConfigSetInfo: {}, // 返回的数据 allConfigSetInfo: {}, // 返回的数据
}; };
window.callbackSubmitInfoZhiYong = undefined; window.callbackSubmitInfoZhiYong = undefined;
} }
getFormDetail = (workId) => { getFormDetail = (workId) => {
const { dataBaseId } = this.state; const { dataBaseId } = this.state;
service.getFormDetail(workId).then((response) => { service.getFormDetail(workId)
if (typeof response.unifiedServicePatternModel === 'undefined') { .then((response) => {
return false; if (typeof response.unifiedServicePatternModel === 'undefined') {
} return false;
destructionFunc.destructionGetDetail(response).then((x) => { }
const { addFields, tableInfo, allConfigSetInfo, searchCondition } = x; destructionFunc.destructionGetDetail(response)
this.setState( .then((x) => {
{ const {
addFields, addFields,
tableInfo, tableInfo,
searchCondition, allConfigSetInfo,
allConfigSetInfo, searchCondition
}, } = x;
() => { this.setState(
this.giveDetailColumns(); {
}, addFields,
); tableInfo,
}); searchCondition,
}); allConfigSetInfo,
}; },
() => {
this.giveDetailColumns();
},
);
});
});
};
giveDetailColumns = () => { giveDetailColumns = () => {
const { columns, workId, dataBaseId, addFields, tableInfo } = this.state; const {
const { showPrint, routerConfig } = this.props; columns,
const process_status = columns.find((x) => { workId,
return x.name === 'process_status'; dataBaseId,
}); addFields,
if (process_status && process_status.dataIndex) { tableInfo
process_status.render = (text, record) => { } = this.state;
return record.statusName || record[process_status.dataIndex]; const {
}; showPrint,
} routerConfig
columns.push({ } = this.props;
dataIndex: 'operationDiy', const process_status = columns.find((x) => {
title: '操作', return x.name === 'process_status';
fixed: 'right', });
render: (text, record) => { if (process_status && process_status.dataIndex) {
return ( process_status.render = (text, record) => {
<Link return record.statusName || record[process_status.dataIndex];
to={{ };
pathname: './Detail', }
state: { columns.push({
workId, dataIndex: 'operationDiy',
dataBaseId, title: '操作',
record, fixed: 'right',
addFields, render: (text, record) => {
tableInfo, return (
showPrint: showPrint || routerConfig.showPrint === '1', <Link
}, to={{
}}> pathname: './Detail',
state: {
workId,
dataBaseId,
record,
addFields,
tableInfo,
showPrint: showPrint || routerConfig.showPrint === '1',
},
}}>
{text || '详情'} {text || '详情'}
</Link> </Link>
); );
}, },
}); });
this.setState({ this.setState({
columns, columns,
}); });
}; };
getColumn = () => { getColumn = () => {
const { workId } = this.state; const { workId } = this.state;
service.getColumns(workId).then((response) => { service.getColumns(workId)
if (!response || !Array.isArray(response)) { .then((response) => {
response = []; if (!response || !Array.isArray(response)) {
} response = [];
// console.log('columns', response); }
for (let item of response) { // console.log('columns', response);
if (item.dataIndex === 'taskName' && !item.width) { for (let item of response) {
item.width = 150; // 29213 资助事务管理/国家三金/国家奖学金审核(高职),界面排版(100661,bdk@2022*$) if (item.dataIndex === 'taskName' && !item.width) {
} item.width = 150; // 29213 资助事务管理/国家三金/国家奖学金审核(高职),界面排版(100661,bdk@2022*$)
if (item.dataIndex === 'createTime' && !item.width) { }
item.width = 150; // 29213 资助事务管理/国家三金/国家奖学金审核(高职),界面排版(100661,bdk@2022*$) if (item.dataIndex === 'createTime' && !item.width) {
} item.width = 150; // 29213 资助事务管理/国家三金/国家奖学金审核(高职),界面排版(100661,bdk@2022*$)
} }
response = response.filter((x) => { }
return x.title !== '流程进度'; response = response.filter((x) => {
}); return x.title !== '流程进度';
console.log(response); });
if (response && response.length) { console.log(response);
this.setState( if (response && response.length) {
{ this.setState(
columns: response, // 表头 {
}, columns: response, // 表头
() => { },
this.getFormDetail(workId); () => {
}, this.getFormDetail(workId);
); },
} );
}); }
}; });
};
componentDidMount() { componentDidMount() {
const { pathname } = this.state; const { pathname } = this.state;
const { workId } = this.state; const { workId } = this.state;
if (workId) { if (workId) {
this.getColumn(); this.getColumn();
} else { } else {
service.getId(pathname).then((x) => { service.getId(pathname)
this.setState( .then((x) => {
{ this.setState(
workId: x.workId, {
dataBaseId: x.dataBaseId, workId: x.workId,
}, dataBaseId: x.dataBaseId,
() => { },
this.getColumn(); () => {
}, this.getColumn();
); },
}); );
} });
} }
}
render() { render() {
const { const {
workId, workId,
dataBaseId, dataBaseId,
columns, columns,
searchCondition, searchCondition,
addFields, addFields,
allConfigSetInfo, allConfigSetInfo,
tableInfo, tableInfo,
} = this.state; } = this.state;
const { const {
hasBatchAudit, hasBatchAudit,
batchAuditButtonName, batchAuditButtonName,
showPrint, showPrint,
noNeedForm, noNeedForm,
tab2Buttons = [], tab2Buttons = [],
} = this.props; } = this.props;
if (!workId) { if (!workId) {
return null; return null;
} }
return ( if (Array.isArray(columns)){
<AuditPage let d = [];
hasBatchAudit={hasBatchAudit} for (let item of columns) {
workId={workId} if (item.dataIndex !== 'operationDiy') {
dataBaseId={dataBaseId} d.push({
columns={columns} key: item.dataIndex,
addFields={addFields} title: item.title,
tableInfo={tableInfo} });
allConfigSetInfo={allConfigSetInfo} }
searchCondition={searchCondition} }
batchAuditButtonName={batchAuditButtonName} console.log(JSON.stringify(d));
showPrint={showPrint} }
noNeedForm={noNeedForm} return (
tab2Buttons={tab2Buttons} <AuditPage
/> hasBatchAudit={hasBatchAudit}
); workId={workId}
} dataBaseId={dataBaseId}
columns={columns}
addFields={addFields}
tableInfo={tableInfo}
allConfigSetInfo={allConfigSetInfo}
searchCondition={searchCondition}
batchAuditButtonName={batchAuditButtonName}
showPrint={showPrint}
noNeedForm={noNeedForm}
tab2Buttons={tab2Buttons}
/>
);
}
} }
export default function Pr(props) { export default function Pr(props) {
const { routerConfig } = useContext(CreateC); const { routerConfig } = useContext(CreateC);
return <Index {...props} routerConfig={routerConfig} />; return <Index {...props} routerConfig={routerConfig}/>;
} }
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论