提交 6eda67d8 authored 作者: 钟是志's avatar 钟是志

3764 多人串行 【一站式新增功能】新增同一个流程同一节点可以导入数据进行审批

上级 01d92f04
......@@ -189,6 +189,7 @@ class AuditPage extends Component {
render() {
const { workId, dataBaseId, addFields, searchCondition } = this.props;
return (
<PageHeaderWrapper title="">
<ListTab
......
import React, { useEffect, useState, useRef, useMemo, Fragment } from 'react';
import styles from './styles.less';
import { connect } from 'dva';
import { Modal, Button } from 'antd';
function Index(props) {
const {
auditPageData: { searchCondition, searchParams },
} = props;
console.log('🚀 ~ file:index method:Index line:7 -----', searchParams, searchCondition);
const formPropertConfig = useMemo(
() => {
if (searchParams && searchParams.taskDefKey) {
const configOption = searchCondition.find((x) => x.key === 'taskDefKey').options;
if (configOption && configOption.length > 0) {
const formProperties = configOption.find((x) => x.key === searchParams.taskDefKey)
.formProperties;
if (formProperties && formProperties.length) {
return formProperties.find((g) => g.id === 'ImportReview');
}
} else {
return null;
}
}
return null;
},
[searchParams],
);
const disabled = useMemo(
() => {
if (formPropertConfig && formPropertConfig.id === 'ImportReview') {
return false;
}
return true;
},
[searchParams],
);
return (
<Fragment key={'ssddd'}>
<Button type={'primary'} disabled={disabled}>
批量导入审批
</Button>
</Fragment>
);
}
export default connect(({ auditPageData }) => {
return {
auditPageData: auditPageData,
};
})(Index);
......@@ -7,7 +7,13 @@ import PropTypes from 'prop-types';
import { deepCopy } from '@/baseComponent/utils';
import { handleAudit } from '../publicApiService';
import { handleColumns } from '@/webPublic/FormInsertDiy/AffairPage/destruction';
import { connect } from 'dva';
@connect(({ auditPageData }) => {
return {
auditPageData,
}
})
export default class List extends Component {
constructor(props) {
super(props);
......@@ -113,7 +119,10 @@ export default class List extends Component {
this.trueSearchParams = { ...data };
delete this.trueSearchParams.pageNo;
delete this.trueSearchParams.pageSize;
console.log("🚀 ~ file:List method:getPage line:116 -----", this.trueSearchParams, "this.trueSearchParams");
this.props.dispatch({
type: 'auditPageData/setSearchParams',
payload: this.trueSearchParams,
});
search.getPageService({ ...data, appId: workId }).then((response) => {
this.setState({
loading: false,
......
......@@ -13,9 +13,11 @@ import CreateC from '../../ExportComponent/ContextCreate';
import exportHandledInfo from '@/webPublic/FormInsertDiy/AffairPage/AuditPage/exportHandledInfo';
import { connect } from 'dva';
import router from 'umi/router';
import ImportBatchAudit from './ImportBatchAudit/index';
@connect(({ keepAlive }) => ({
@connect(({ keepAlive, auditPageData }) => ({
keepAlive,
auditPageData,
}))
class Index extends React.Component {
static defaultProps = {
......@@ -53,6 +55,7 @@ class Index extends React.Component {
getFormDetail = (workId) => {
const { dataBaseId } = this.state;
const { dispatch } = this.props;
service.getFormDetail(workId).then((response) => {
if (typeof response.unifiedServicePatternModel === 'undefined') {
return false;
......@@ -62,6 +65,10 @@ class Index extends React.Component {
});
destructionFunc.destructionGetDetail(response, workId).then((x) => {
const { addFields, tableInfo, allConfigSetInfo, searchCondition } = x;
dispatch({
type: 'auditPageData/setSearchCondition',
payload: searchCondition,
});
this.setState(
{
addFields,
......@@ -162,6 +169,10 @@ class Index extends React.Component {
};
componentDidMount() {
this.props.dispatch({
type: 'auditPageData/setInitData',
payload: {},
});
const { pathname } = this.state;
const { workId } = this.state;
if (workId) {
......@@ -200,6 +211,7 @@ class Index extends React.Component {
routerConfig: {
isExport = '0', // 解决禅道 32898 在路由中增加配置项 如果 = '1' 表示 开启已处理数据的导出
},
auditPageData,
} = this.props;
if (!workId || !smartFormData) {
return null;
......@@ -236,6 +248,16 @@ class Index extends React.Component {
},
}); // 解决禅道 32366 二级学院审核,所有二级学院审核后在已处理中加导出功能 103152
}
if(JSON.stringify(auditPageData.searchCondition).includes('ImportReview')){
tab1Buttons.push({
type: 'importBatchAudit',
name: '批量导入审批',
component: 'RenderComponent',
render: (props) => {
return <ImportBatchAudit {...props}/>
},
});
}
if (Array.isArray(columns)) {
let d = [];
......
......@@ -298,12 +298,13 @@ export async function destructionGetDetail(response, workId) {
}
const searchCondition = await getSearchCondition(basicPatternModel?.dataObjModels[0]?.id, workId); // ,response.id),
if (response.isShowWaitTaskDef || response.isShowHandledTaskDef) {
let optProcess = await findListTaskDefinition({
const optProcess = await findListTaskDefinition({
appId: response.id,
});
if (optProcess) {
searchCondition.push({
searchCondition.unshift({
key: 'taskDefKey',
name: '流程节点',
type: 'select',
......@@ -311,6 +312,7 @@ export async function destructionGetDetail(response, workId) {
return {
key: g.id,
name: g.name,
formProperties: g.formProperties,
};
}),
});
......
export default {
namespace: 'auditPageData',
state: {
searchCondition: [],
searchParams: {},
},
effects: {},
reducers: {
setSearchCondition(state, { payload }) {
return {
...state,
searchCondition: payload,
};
},
setSearchParams(state, { payload }) {
return {
...state,
searchParams: payload,
};
},
setInitData(state, { payload }) {
return {
searchCondition: {},
searchParams: {},
};
},
},
};
import { routerRedux } from 'dva/router';
export default {
namespace: 'keepAlive',
state: {
AuditPageData: {
// 审批审核页面数据
'/path': {
pageCurrent: '',
searchFormValues: {},
activeKey: '',
},
},
parentData: {
'/path': {
activeTab: '', // 多页签审核页面 激活的tab 解决禅道bug http://scjoyedu.eicp.net:57400/zentao/task-view-3779.html
},
},
},
effects: {},
reducers: {
setAuditPageData(state, { payload }) {
const { path, value } = payload;
const AuditPageDataNew = state.AuditPageData;
AuditPageDataNew[path] = value;
return {
...state,
AuditPageData: AuditPageDataNew,
};
},
setParentData(state, { payload }) {
const { path, value } = payload;
const AuditPageDataNew = state.parentData;
AuditPageDataNew[path] = value;
return {
...state,
parentData: AuditPageDataNew,
};
},
},
};
......@@ -4058,7 +4058,6 @@ ${obj[dataColumn.base52]}
{modalCode ? (
<FormModal
{...modalProps}
// visible={this.props.DataColumn.isShowModal[modalCode + modalTitle]}
modalCode={modalCode}
handleCancel={this.closeModal.bind(this, modalCode)}
title={modalTitle}
......@@ -4146,7 +4145,6 @@ ${obj[dataColumn.base52]}
{modalCode ? (
<FormModal
{...modalProps}
// visible={this.props.DataColumn.isShowModal[modalCode + modalTitle]}
modalCode={modalCode}
handleCancel={this.closeModal.bind(this, modalCode)}
title={modalTitle}
......@@ -4185,7 +4183,6 @@ ${obj[dataColumn.base52]}
{modalCode ? (
<FormModal
{...modalProps}
// visible={this.props.DataColumn.isShowModal[modalCode + modalTitle]}
modalCode={modalCode}
handleCancel={this.closeModal.bind(this, modalCode)}
title={modalTitle}
......@@ -4233,7 +4230,6 @@ ${obj[dataColumn.base52]}
{modalCode ? (
<FormModal
{...modalProps}
// visible={this.props.DataColumn.isShowModal[modalCode + modalTitle]}
modalCode={modalCode}
handleCancel={this.closeModal.bind(this, modalCode)}
title={modalTitle}
......@@ -4274,7 +4270,6 @@ ${obj[dataColumn.base52]}
{modalCode ? (
<FormModal
{...modalProps}
// visible={this.props.DataColumn.isShowModal[modalCode + modalTitle]}
modalCode={modalCode}
handleCancel={this.closeModal.bind(this, modalCode)}
title={modalTitle}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论