提交 0c24becd authored 作者: 钟是志's avatar 钟是志

禅道 32366 二级学院审核,所有二级学院审核后在已处理中加导出功能 103152

上级 736022d4
...@@ -5,6 +5,7 @@ import { message } from 'antd'; ...@@ -5,6 +5,7 @@ import { message } from 'antd';
import React from 'react'; import React from 'react';
import { downloadFile } from '@/webPublic/one_stop_public/Table/globalFunction'; import { downloadFile } from '@/webPublic/one_stop_public/Table/globalFunction';
import { getToken } from '@/webPublic/one_stop_public/utils/token'; import { getToken } from '@/webPublic/one_stop_public/utils/token';
import { giveBase16EnCode, requestFileInfo } from '@/webPublic/one_stop_public/Base16';
export default function exportHandledInfo({ export default function exportHandledInfo({
columns = [], columns = [],
...@@ -13,28 +14,37 @@ export default function exportHandledInfo({ ...@@ -13,28 +14,37 @@ export default function exportHandledInfo({
}) { }) {
const headers = columns.filter((g) => { const headers = columns.filter((g) => {
return g.dataIndex !== 'operationDiy'; return g.dataIndex !== 'operationDiy';
}).map((g) => { })
if(g.title === '流程审核状态'){ .map((g) => {
if (g.title === '流程审核状态') {
return {
key: 'formStatusName',
title: g.title,
};
}
return { return {
key: 'formStatusName', key: g.dataIndex,
title: g.title, title: g.title,
}; };
} });
return {
key: g.dataIndex,
title: g.title,
};
});
const data = { const data = {
appId, appId,
type, type,
headers: JSON.stringify(headers), headers: JSON.stringify(headers),
token: getToken(), token: getToken(),
}; };
if(appId){ if (appId) {
message.info('正在导出文件,请耐心等待'); message.info('正在导出文件,请耐心等待');
let url = window.CONFIG.OAUTH_ACTION_PATH + '/UnifiedAppFormApi/exportData'; let url = window.CONFIG.OAUTH_ACTION_PATH + '/UnifiedAppFormApi/exportData';
downloadFile(url, data); giveBase16EnCode(data, url)
} .then((newData) => {
if (typeof newData === 'object' && newData.url && newData.datas) {
// newData.datas.rbin = true;
newData.datas.token = getToken();
return downloadFile(newData.url, newData.datas);
}
// downloadFile(url, data);
});
}
} }
...@@ -11,7 +11,6 @@ import AuditPage from './AuditPage'; ...@@ -11,7 +11,6 @@ import AuditPage from './AuditPage';
import * as destructionFunc from '../destruction'; import * as destructionFunc from '../destruction';
import { Link } from 'dva/router'; import { Link } from 'dva/router';
import CreateC from '../../ExportComponent/ContextCreate'; import CreateC from '../../ExportComponent/ContextCreate';
import prepareShow from '@/webPublic/one_stop_public/Table/prepareShow';
import exportHandledInfo from '@/webPublic/FormInsertDiy/AffairPage/AuditPage/exportHandledInfo'; import exportHandledInfo from '@/webPublic/FormInsertDiy/AffairPage/AuditPage/exportHandledInfo';
class Index extends React.Component { class Index extends React.Component {
...@@ -46,6 +45,9 @@ class Index extends React.Component { ...@@ -46,6 +45,9 @@ class Index extends React.Component {
if (typeof response.unifiedServicePatternModel === 'undefined') { if (typeof response.unifiedServicePatternModel === 'undefined') {
return false; return false;
} }
this.setState({
smartFormData: response,
});
destructionFunc.destructionGetDetail(response, workId).then((x) => { destructionFunc.destructionGetDetail(response, workId).then((x) => {
const { addFields, tableInfo, allConfigSetInfo, searchCondition } = x; const { addFields, tableInfo, allConfigSetInfo, searchCondition } = x;
this.setState( this.setState(
...@@ -162,9 +164,10 @@ class Index extends React.Component { ...@@ -162,9 +164,10 @@ class Index extends React.Component {
addFields, addFields,
allConfigSetInfo, allConfigSetInfo,
tableInfo, tableInfo,
smartFormData,
} = this.state; } = this.state;
const { hasBatchAudit, batchAuditButtonName, showPrint, noNeedForm } = this.props; const { hasBatchAudit, batchAuditButtonName, showPrint, noNeedForm } = this.props;
if (!workId) { if (!workId || !smartFormData) {
return null; return null;
} }
const tab2Buttons = []; const tab2Buttons = [];
......
...@@ -143,7 +143,9 @@ const getFormDetail = (id) => { ...@@ -143,7 +143,9 @@ const getFormDetail = (id) => {
return {}; return {};
} }
}).then((res) => { }).then((res) => {
return prepareShow(res); return prepareShow(res).then((x) => {
return res;
});
}); });
}; };
......
...@@ -12,13 +12,10 @@ import Detail from '@/webPublic/FormInsertDiy/AffairPage/Detail'; //详情 ...@@ -12,13 +12,10 @@ import Detail from '@/webPublic/FormInsertDiy/AffairPage/Detail'; //详情
import { Modal, message, notification, Popconfirm } from 'antd'; import { Modal, message, notification, Popconfirm } from 'antd';
import { connect } from 'dva'; import { connect } from 'dva';
import router from 'umi/router'; import router from 'umi/router';
import { getIsQian_Nan } from '@/webPublic/zyd_public/utils/getSchoolType';
import exportHandledInfo from '@/webPublic/FormInsertDiy/AffairPage/AuditPage/exportHandledInfo';
import ApplyMerge from './ApplyMerge'; // merge import ApplyMerge from './ApplyMerge'; // merge
import AuditMerge from './AuditMerge'; import AuditMerge from './AuditMerge';
import CheckRecordMerge from './CheckRecordMerge'; import CheckRecordMerge from './CheckRecordMerge';
import CreateC from './ContextCreate'; import CreateC from './ContextCreate';
import DiyModal from './DiyModal/index';
window.iframeParentComponent = { window.iframeParentComponent = {
Modal, Modal,
...@@ -88,25 +85,7 @@ function ActiveMenuComponent({ routerConfig, ...otherProps }) { ...@@ -88,25 +85,7 @@ function ActiveMenuComponent({ routerConfig, ...otherProps }) {
Res = <Audit workId={appId} {...otherProps} />; Res = <Audit workId={appId} {...otherProps} />;
break; break;
case 'BatchAudit': // 批量审批 case 'BatchAudit': // 批量审批
// if(appId === '1492048888356405248' && getIsQian_Nan() || process.env.NODE_ENV === 'development'){
// // 禅道30031
// otherProps.tab2Buttons = [
// {
// type: 'export',
// name: '导出',
// component: 'Normal',
// handleClick: (selectRows, formValues, getPage, search, columns) => {
// exportHandledInfo({
// columns,
// appId,
// handled: 'handled',
// });
// },
// },
// ];
// }
Res = <BatchAudit workId={appId} {...otherProps} Res = <BatchAudit workId={appId} {...otherProps}
workId={'1492048888356405248'}
/>; />;
break; break;
case 'AuditMerage': // 审核页面聚合 多个流程的审核页面放在一起 case 'AuditMerage': // 审核页面聚合 多个流程的审核页面放在一起
......
...@@ -108,7 +108,7 @@ export async function getTransformApi(url) { // ...@@ -108,7 +108,7 @@ export async function getTransformApi(url) { //
if(!TRANSFORM_BIN){ if(!TRANSFORM_BIN){
needTransform = false; needTransform = false;
} }
if (needTransform && url && typeof url === 'string' && url.indexOf('/onestop') > -1 && url.includes(window.CONFIG.API_ACTION_PATH)) { if (needTransform && url && typeof url === 'string' && url.indexOf('/onestop') > -1 && url.includes(window.CONFIG.API_ACTION_PATH)) {
apiUrl = url.replace(window.CONFIG.API_ACTION_PATH, ''); apiUrl = url.replace(window.CONFIG.API_ACTION_PATH, '');
} else { } else {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
......
...@@ -153,6 +153,9 @@ const encryptApiList = [ ...@@ -153,6 +153,9 @@ const encryptApiList = [
api: 'UnifiedServiceApi/config', // 禅道 25034 宿舍管理/宿舍维修审核,2021030576L 加个字段 做个字段排序 api: 'UnifiedServiceApi/config', // 禅道 25034 宿舍管理/宿舍维修审核,2021030576L 加个字段 做个字段排序
key: ['config'], key: ['config'],
}, },
{
api: 'UnifiedAppFormApi/exportData',
},
]; ];
const resBinaryApiList = [ const resBinaryApiList = [
...@@ -183,6 +186,7 @@ const resBinaryApiList = [ ...@@ -183,6 +186,7 @@ const resBinaryApiList = [
{ {
api: 'UnifiedWebPatternApi/getDetail', api: 'UnifiedWebPatternApi/getDetail',
}, },
]; ];
export { resBinaryApiList }; export { resBinaryApiList };
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论