提交 0240d3ec authored 作者: 钟是志's avatar 钟是志

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

上级 382fb19f
import React, { useEffect, useState, useRef, useMemo, Fragment } from 'react';
import styles from './styles.less';
import React, { useMemo, Fragment } from 'react';
import { connect } from 'dva';
import { Modal, Button } from 'antd';
import ImportUtilBatchAudit from '@/webPublic/one_stop_public/App/ImportUtilBatchAudit';
import { isJSON } from '@/webPublic/one_stop_public/2022beidianke/isJSON';
function Index(props) {
const {
auditPageData: { searchCondition, searchParams },
appId,
} = props;
console.log('🚀 ~ file:index method:Index line:7 -----', searchParams, searchCondition);
console.log("🚀 ~ file:index method:Index line:11 -----", props, "props");
const formPropertConfig = useMemo(
() => {
if (searchParams && searchParams.taskDefKey) {
......@@ -28,21 +28,45 @@ function Index(props) {
[searchParams],
);
const disabled = useMemo(
() => {
if (formPropertConfig && formPropertConfig.id === 'ImportReview') {
return false;
const componentProps = useMemo(() => {
if(!formPropertConfig || !formPropertConfig.variable){
return null;
}
return true;
const disabled = !(formPropertConfig && formPropertConfig.id === 'ImportReview');
const taskDefName = searchCondition.find((x) => x.key === 'taskDefKey').options.find((x) => x.key === searchParams.taskDefKey).name;
const variable = formPropertConfig && isJSON(formPropertConfig.variable) ? JSON.parse(formPropertConfig.variable) : {};
return {
btn: {
disabled,
name: variable?.btn?.name || '导入审批',
type: 'primary',
},
[searchParams],
);
importConfig: formPropertConfig && isJSON(formPropertConfig.variable) ? JSON.parse(formPropertConfig.variable) : {},
importParams: {
...searchParams,
taskDefName: taskDefName,
appId,
},
};
}, [formPropertConfig, searchParams]);
console.log({
formPropertConfig,
searchParams,
searchCondition,
componentProps,
});
if(!componentProps){
return null;
}
return (
<Fragment key={'ssddd'}>
<Button type={'primary'} disabled={disabled}>
批量导入审批
</Button>
<ImportUtilBatchAudit {...componentProps}
callback={() => {
props.getPage();
}}
/>
</Fragment>
);
}
......
......@@ -248,13 +248,13 @@ class Index extends React.Component {
},
}); // 解决禅道 32366 二级学院审核,所有二级学院审核后在已处理中加导出功能 103152
}
if(JSON.stringify(auditPageData.searchCondition).includes('ImportReview') && false){ // TODO 未完成.
if(JSON.stringify(auditPageData.searchCondition).includes('ImportReview')){
tab1Buttons.push({
type: 'importBatchAudit',
name: '批量导入审批',
component: 'RenderComponent',
render: (props) => {
return <ImportBatchAudit {...props}/>
return <ImportBatchAudit {...props} appId={workId} key={'asdasd'}/>;
},
});
}
......
......@@ -251,6 +251,7 @@ export default class ImportUtil extends React.PureComponent {
fileName,
importParams,
importConfig,
downloadTemplateUrl,
} = this.props;
const { trueObjId } = this.state;
const params = {
......@@ -259,7 +260,7 @@ export default class ImportUtil extends React.PureComponent {
objId: trueObjId || objId,
fileName,
};
let url = `${config.httpServer}/DataObjApi/importTemplateDownload`;
let url = downloadTemplateUrl || `${config.httpServer}/DataObjApi/importTemplateDownload`;
let newParams = giveFilePostDataInfoForTrue(params, url);
if (newParams && newParams.datas) {
newParams.datas.token = getToken();
......
差异被折叠。
......@@ -7,6 +7,7 @@ import { importProcessApi } from '../Services/apiConfig';
function ProgressDiy(props) {
const {
importProcessUrl = '',
fileCacheKey,
changeOpenProgress = () => {
},
......@@ -15,7 +16,7 @@ function ProgressDiy(props) {
const [speedData, setData] = useState({ ...props });
useEffect(() => {
interv.current = setInterval(() => {
getServicesNomal(importProcessApi, {
getServicesNomal(importProcessUrl || importProcessApi, {
cacheKey: fileCacheKey,
}).then(res => {
setData(res);
......
......@@ -34,6 +34,15 @@ export const importExecute = (params) => {
});
};
export const importExecute2 = (params) => {
return apiRequest('/UnifiedAppFormApi/importExecute', {
...params,
customErrMsg:
'导入的文件中可能存在字段不一致、字段类型不匹配、唯一性字段冲突,请检查或联系系统管理员',// 自定义errMsg
});
};
export const decodeObjKey = (code) => {
return apiRequest('/SnowflakeUtilApi/decode', {
code,
......
/**
* 2019年9月22日
* TODO 钟是志 2021年10月20日
* 钟是志 2021年10月20日
* 动态表格组件返回对应的组件
*/
import React, { Component, lazy, Suspense } from 'react';
......
......@@ -339,7 +339,7 @@ export default class ViewPrint extends Component {
name={'字段位置设置(实施)'}
handleClick={() => {
router.push({
//pathname: '/xg/xg_hard/AwardSet/printSetting', // 中医大这里也要改 TODO
//pathname: '/xg/xg_hard/AwardSet/printSetting', // 中医大这里也要改
pathname: '/jc/setting/printSetting',
state: { code: templateInfo.code },
});
......
......@@ -53,7 +53,7 @@ function EditDrawer(props) {
setLowCodeEdit(newCodeEdit);
};
// TODO localStorage 事件中获取的state 不是最新的.
// localStorage 事件中获取的state 不是最新的.
const handleLocalStorageSave = (e) => {
if (e.key === 'save-low-code-local') {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论