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

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

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