提交 dffc1441 authored 作者: 钟是志's avatar 钟是志
......@@ -16,13 +16,14 @@ export default class AuditPage extends Component {
componentDidMount() {}
handleButtonSet = () => {
const { hasBatchAudit, batchAuditButtonName, noNeedForm } = this.props;
const { hasBatchAudit, batchAuditButtonName, noNeedForm, tab2Buttons = [] } = this.props;
return {
tab1: [
hasBatchAudit
? {
type: 'audit',
component: 'RenderComponent',
key: 'audit',
render: ({ selectRows, getPage }) => {
const disabled = !selectRows || !Array.isArray(selectRows) || !selectRows.length;
function handleClick(onShow) {
......@@ -42,9 +43,14 @@ export default class AuditPage extends Component {
onShow();
}
return (
<AuditModal selectRows={selectRows} getPage={getPage} noNeedForm={noNeedForm}>
<AuditModal selectRows={selectRows}
getPage={getPage}
noNeedForm={noNeedForm}
key={'audit'}
>
{({ onShow }) => (
<ButtonDiy
key={'audit'}
name={batchAuditButtonName || '批量审核'}
handleClick={() => handleClick(onShow)}
disabled={disabled}
......@@ -56,7 +62,7 @@ export default class AuditPage extends Component {
}
: false,
].filter((i) => i),
tab2: [],
tab2: tab2Buttons,
};
};
......
......@@ -4,19 +4,22 @@
* 钟是志
*
* */
import React, { Component } from 'react';
import React, { Component, useEffect, useState } from 'react';
import AuditPage from './index';
export default class BatchAudit extends Component {
constructor(props) {
super(props);
}
componentDidMount() {
}
render() {
return <AuditPage {...this.props} hasBatchAudit={true} />;
}
export default function BatchAudit(props) {
// const { workId } = props;
// const [show, setShow] = useState(true);
// useEffect(() => {
// if (workId) {
// setShow(false);
// setTimeout(() => {
// setShow(true);
// }, 100);
// }
// }, [workId]);
// if(!show){
// return null;
// }
return <AuditPage {...props} hasBatchAudit={true}/>;
}
......@@ -5,175 +5,207 @@
*
* */
import React from 'react';
import React, { useContext } from 'react';
import * as service from '../publicApiService';
import AuditPage from './AuditPage';
import * as destructionFunc from '../destruction';
import { Link } from 'dva/router';
import { CreateC } from '../../ExportComponent/ActiveMenuComponent';
export default class Index extends React.Component {
static defaultProps = {
hasBatchAudit: false, // 是否有批量审核按钮 默认关掉 如果有需要再在外面包一层 2020年5月6日 18:44:11 钟是志
batchAuditButtonName: '批量审核', // 如果需要批量审核 则直接用 BatchAudit.js 文件
};
class Index extends React.Component {
static defaultProps = {
hasBatchAudit: false, // 是否有批量审核按钮 默认关掉 如果有需要再在外面包一层 2020年5月6日 18:44:11 钟是志
batchAuditButtonName: '批量审核', // 如果需要批量审核 则直接用 BatchAudit.js 文件
};
constructor(props) {
super(props);
let pathname = this.props.location.pathname;
this.state = {
columns: [],
dataList: [],
headerInfo: [],
workId: this.props.workId || '',
searchCondition: [],
pathname,
dataBaseId: this.props.dataBaseId || '',
addCondition: [],
addFields: [], // 新增时填写的字段。
tableInfo: {}, // 表格配置属性
allConfigSetInfo: {}, // 返回的数据
};
constructor(props) {
super(props);
let pathname = this.props.location.pathname;
this.state = {
columns: [],
dataList: [],
headerInfo: [],
workId: this.props.workId || '',
searchCondition: [],
pathname,
dataBaseId: this.props.dataBaseId || '',
addCondition: [],
addFields: [], // 新增时填写的字段。
tableInfo: {}, // 表格配置属性
allConfigSetInfo: {}, // 返回的数据
};
window.callbackSubmitInfoZhiYong = undefined;
}
getFormDetail = (workId) => {
const { dataBaseId } = this.state;
service.getFormDetail(workId).then((response) => {
if (typeof response.unifiedServicePatternModel === 'undefined') {
return false;
}
destructionFunc.destructionGetDetail(response).then((x) => {
const { addFields, tableInfo, allConfigSetInfo, searchCondition } = x;
this.setState(
{
addFields,
tableInfo,
searchCondition,
allConfigSetInfo,
},
() => {
this.giveDetailColumns();
},
);
});
});
};
getFormDetail = (workId) => {
const { dataBaseId } = this.state;
service.getFormDetail(workId)
.then((response) => {
if (typeof response.unifiedServicePatternModel === 'undefined') {
return false;
}
destructionFunc.destructionGetDetail(response)
.then((x) => {
const {
addFields,
tableInfo,
allConfigSetInfo,
searchCondition
} = x;
this.setState(
{
addFields,
tableInfo,
searchCondition,
allConfigSetInfo,
},
() => {
this.giveDetailColumns();
},
);
});
});
};
giveDetailColumns = () => {
const { columns, workId, dataBaseId, addFields, tableInfo } = this.state;
const { showPrint } = this.props;
const process_status = columns.find((x) => {
return x.name === 'process_status';
});
if (process_status && process_status.dataIndex) {
process_status.render = (text, record) => {
return record.statusName || record[process_status.dataIndex];
};
}
columns.push({
dataIndex: 'operation',
title: '操作',
fixed: columns.length > 12 ? 'right' : false,
render: (text, record) => {
return (
<Link
to={{
pathname: './Detail',
state: {
workId,
dataBaseId,
record,
addFields,
tableInfo,
showPrint,
},
}}>
详情
</Link>
);
},
});
this.setState({
columns,
});
};
giveDetailColumns = () => {
const {
columns,
workId,
dataBaseId,
addFields,
tableInfo
} = this.state;
const { showPrint, routerConfig } = this.props;
const process_status = columns.find((x) => {
return x.name === 'process_status';
});
if (process_status && process_status.dataIndex) {
process_status.render = (text, record) => {
return record.statusName || record[process_status.dataIndex];
};
}
columns.push({
dataIndex: 'operation',
title: '操作',
fixed: columns.length > 12 ? 'right' : false,
render: (text, record) => {
return (
<Link
to={{
pathname: './Detail',
state: {
workId,
dataBaseId,
record,
addFields,
tableInfo,
showPrint: showPrint || routerConfig.showPrint === '1',
},
}}>
详情
</Link>
);
},
});
this.setState({
columns,
});
};
getColumn = () => {
const { workId } = this.state;
service.getColumns(workId).then((response) => {
if(!response || !Array.isArray(response)){
response = [];
}
response = response.filter((x) => {
return x.title !== '流程进度';
});
// for(let item of response){
// if(!item.width){
// // item.width = 90; // 给一个默认宽度
// }
// }
if (response && response.length) {
this.setState(
{
columns: response, // 表头
},
() => {
this.getFormDetail(workId);
},
);
}
});
};
getColumn = () => {
const { workId } = this.state;
service.getColumns(workId)
.then((response) => {
if (!response || !Array.isArray(response)) {
response = [];
}
for (let item of response) {
if (item.dataIndex === 'taskName' && !item.width) {
item.width = 200;
}
if (item.dataIndex === 'createTime' && !item.width) {
item.width = 200;
}
}
response = response.filter((x) => {
return x.title !== '流程进度';
});
if (response && response.length) {
this.setState(
{
columns: response, // 表头
},
() => {
this.getFormDetail(workId);
},
);
}
});
};
componentDidMount() {
const { pathname } = this.state;
const { workId } = this.state;
if (workId) {
this.getColumn();
} else {
service.getId(pathname).then((x) => {
this.setState(
{
workId: x.workId,
dataBaseId: x.dataBaseId,
},
() => {
this.getColumn();
},
);
});
}
}
componentDidMount() {
const { pathname } = this.state;
const { workId } = this.state;
if (workId) {
this.getColumn();
} else {
service.getId(pathname)
.then((x) => {
this.setState(
{
workId: x.workId,
dataBaseId: x.dataBaseId,
},
() => {
this.getColumn();
},
);
});
}
}
render() {
const {
workId,
dataBaseId,
columns,
searchCondition,
addFields,
allConfigSetInfo,
tableInfo,
} = this.state;
const { hasBatchAudit, batchAuditButtonName, showPrint, noNeedForm } = this.props;
if (!workId) {
return null;
}
return (
<AuditPage
hasBatchAudit={hasBatchAudit}
workId={workId}
dataBaseId={dataBaseId}
columns={columns}
addFields={addFields}
tableInfo={tableInfo}
allConfigSetInfo={allConfigSetInfo}
searchCondition={searchCondition}
batchAuditButtonName={batchAuditButtonName}
render() {
const {
workId,
dataBaseId,
columns,
searchCondition,
addFields,
allConfigSetInfo,
tableInfo,
} = this.state;
const {
hasBatchAudit,
batchAuditButtonName,
showPrint,
noNeedForm,
tab2Buttons = []
} = this.props;
if (!workId) {
return null;
}
return (
<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) {
const { routerConfig } = useContext(CreateC);
return (
<Index {...props} routerConfig={routerConfig}/>
);
}
......@@ -44,6 +44,7 @@ export default class Detail extends Component {
if (!id) {
id = getUrlInfo()?.id;
}
console.log(id);
this.state = {
id,
showAll: props.from !== 'onestopApp2.0'
......@@ -82,7 +83,6 @@ export default class Detail extends Component {
// 贵建把打印预览显示出来
showPrint = true;
}
console.log(showPrint);
let iframeUrl = `${url[0]}/#/IframeForDetail?id=${id}&token=${getToken()}`;
if (showPrint) {
iframeUrl = iframeUrl + '&showPrint=true';
......@@ -91,6 +91,7 @@ export default class Detail extends Component {
iframeUrl = config.gateWayPort + `/portal/#/showAuditIframe?id=${id}&hasSingle=false&token=${getToken()}&isPrint=false`;
}
// iframeUrl = `http://localhost:8000/onestop/IframeForDetail?id=${id}&token=${getToken()}`;
// console.log(showPrint);
return (
<PageHeaderWrapper title=''>
<Shell>
......
......@@ -3,7 +3,8 @@ import PageHeaderWrapper from '@/components/PageHeaderWrapper';
import Shell from '@/baseComponent/Shell';
import { getToken, setToken } from '@/utils/authority';
import config from '@/config/config';
import { getOneStopConfig } from '@/webPublic/zyd_public/utils/utils';
import { getOneStopConfig, isJSON } from '@/webPublic/zyd_public/utils/utils';
import router from 'umi/router';
const getUrlInfo = (param) => {
let url = window.document.location.href.toString();
......@@ -46,22 +47,45 @@ export default class Detail extends Component {
window.addEventListener(
'message',
(event) => {
if (event && event.data && event.data.indexOf && event.data.indexOf('iframeDetailHeight') > -1) {
let height = Number(event.data.split('-')[1]);
// console.log(height);
const iframe = document.getElementById('applyIframeId');
if (iframe && height > 950) {
iframe.height = height;
if (event && event.data && event.data.indexOf) {
if(event.data.indexOf('iframeDetailHeight') > -1){ // 高度修改事件
let height = Number(event.data.split('-')[1]);
// console.log(height);
const iframe = document.getElementById('applyIframeId');
if (iframe && height > 950) {
iframe.height = height;
}
}
if(event.data.indexOf('routerChange') > -1){ // 路由改变事件
let jsonData = event.data.split('-')[1];
if(isJSON(jsonData)){
let changeData = JSON.parse(jsonData);
router[changeData.type](changeData.arg);
console.log(changeData);
}
}
}
},
false,
);
}
render() {
// static getDerivedStateFromProps(nextProps, prevState) {
// if(nextProps.workId && prevState.id && nextProps.workId !== prevState.id){
// return {
// id: nextProps.workId,
// };
// }else{
// return null;
// }
// // ...
// }
render() {
const { id } = this.state;
let iframeUrl = `${config.gateWayPort}/portal/#/showSmartFormOnly?id=${id}&token=${getToken()}&isShow=true`;
let iframeUrl = `${config.gateWayPort}/portal/#/showSmartFormOnly?id=${id}&token=${getToken()}&isShow=true`;
// iframeUrl = `https://yx.bpi.edu.cn/portal/#/showSmartFormOnly?id=${id}&token=${getToken()}&isShow=true`;
// iframeUrl = `http://localhost:8022/portal/#/showSmartFormOnly?id=${id}&token=${getToken()}&isShow=true`;
return (
<PageHeaderWrapper title="">
......
......@@ -42,7 +42,6 @@ export default class Detail extends Component {
render() {
const { id, showAll } = this.state;
const url = config.onestopPC.split('/#/');
// console.log(url);
const iframeUrl = `${url[0]}/#/IFrameSnapshot?token=${getToken()}`;
// iframeUrl = `http://localhost:8000/onestop/IframeForDetail?id=${id}&token=${getToken()}`;
return (
......
......@@ -359,27 +359,31 @@ export function handleColumns(columns) {
if (isJSON(text)) {
text = JSON.parse(text);
}
if (item.extendType === 'qrCode' && text && typeof text === 'string') {
let url = text.replace('{window.location.origin}', config.gateWayPort);
console.log(url);
const clickUrl = () => {
Modal.info({
title: item.title,
content: <div className={styles.erweimaModal}>
<QRCode
bgColor="#FFFFFF"
fgColor="#000000"
level="Q"
size={200}
style={{
display: 'block',
margin: 'auto',
}}
value={url}
/></div>,
});
};
return (<a onClick={clickUrl}>查看</a>);
if (item.extendType === 'qrCode') {
if (text && typeof text === 'string' && text) {
let url = text.replace('{window.location.origin}', config.gateWayPort);
const clickUrl = () => {
Modal.info({
title: item.title,
content: <div className={styles.erweimaModal}>
<QRCode
bgColor="#FFFFFF"
fgColor="#000000"
level="Q"
size={200}
style={{
display: 'block',
margin: 'auto',
}}
value={url}
/></div>,
});
};
return (<a onClick={clickUrl}>查看</a>);
} else {
return <span>暂无</span>;
}
}
if (item.extendType === 'file' && typeof text === 'string') {
let url = text.includes('http') ? text : config.sqlFormsServer + text;
......@@ -406,7 +410,10 @@ export function handleColumns(columns) {
text.files.length
) {
return text.files.map((file, index) => {
let url = file.path.includes('http') ? file.path : config.sqlFormsServer + file.path;
if(typeof file.path !== 'string' ){
return null;
}
let url = file.path && file.path.includes('http') ? file.path : config.sqlFormsServer + file.path;
return (
<a href={url} target={'_blank'} key={file.name} style={{ marginRight: '10px' }}>
{file.name}
......@@ -422,7 +429,6 @@ export function handleColumns(columns) {
item.render = (text, record) => {
if (!isNaN(Number(text)) && Number(text) > 10000000) {
text = Number(text);
if (item.dataFormatStrWeb) {
......@@ -431,10 +437,10 @@ export function handleColumns(columns) {
}
return moment(text)
.format(format[item.dataType]);
}else if(typeof text === 'string' && text.length > 5){
return moment(text).format(item.dataFormatStrWeb || 'YYYY-MM-DD');
}
else {
} else if (typeof text === 'string' && text.length > 5) {
return moment(text)
.format(item.dataFormatStrWeb || 'YYYY-MM-DD');
} else {
return '';
}
};
......
......@@ -6,33 +6,46 @@
* callback 提交完成后执行回调函数
* form form表单控件
*/
import React, { useState } from "react";
import { Modal, message } from "antd";
import { preHandle } from "@/webPublic/one_stop_public/utils/myutils";
import { connect } from "dva";
import Btn from "./pagesBtn";
import styles from "./styles.less";
import ModalDiy from "@/baseComponent/ModalDiy";
import { callbackSubmitData } from "@/webPublic/one_stop_public/models/callbackExamineProcess";
import { getToken } from "@/utils/authority";
import { isJSON } from "@/webPublic/zyd_public/utils/utils";
import { uaaRequest } from "@/webPublic/one_stop_public/utils/request";
import React, { useState } from 'react';
import { Modal, message } from 'antd';
import { preHandle } from '@/webPublic/one_stop_public/utils/myutils';
import { connect } from 'dva';
import Btn from './pagesBtn';
import styles from './styles.less';
import ModalDiy from '@/baseComponent/ModalDiy';
import { callbackSubmitData } from '@/webPublic/one_stop_public/models/callbackExamineProcess';
import { getToken } from '@/utils/authority';
import { isJSON } from '@/webPublic/zyd_public/utils/utils';
import { uaaRequest } from '@/webPublic/one_stop_public/utils/request';
import AuditProcessOneByOne
from '@/webPublic/FormInsertDiy/AuditButton/pagesBtn/AuditProcessOneByOne';
function AuditButton(props) {
const [visible, setVisible] = useState(false);
const [modalContent, setModalContent] = useState("");
const [modalContent, setModalContent] = useState('');
const [isSubmitLoading, setSubmitLoading] = useState(false);
const [affairOkParams, setAffairParams] = useState({});
const [showProcessModal, setShowProcessModal] = useState(false); // 增加进度条 1条数据1条数据的调用接口
const { callback } = props;
function affairOk() {
// 有taskIds属性时,是批量审核,
const { dispatch, callback, data, form, taskIds, selectRows } = props;
const { oldKey, btnValue } = affairOkParams;
if (window.stuSigningAuditXueShengChu && btnValue === "0") {
const {
dispatch,
data,
form,
taskIds,
selectRows
} = props;
const {
oldKey,
btnValue
} = affairOkParams;
if (window.stuSigningAuditXueShengChu && btnValue === '0') {
// 黔南就业学生处批量审批签章 特殊处理 专门为黔南签章批量审核搞的函数
// 应该是点击同意才执行这个全局函数.
window.stuSigningAuditXueShengChu({
userNowInfo: (isJSON(localStorage.getItem("user")) && JSON.parse(localStorage.getItem("user"))) || {},
userNowInfo: (isJSON(localStorage.getItem('user')) && JSON.parse(localStorage.getItem('user'))) || {},
buttonInfo: data?.btns && data?.btns.length ? data?.btns.find((x) => x.value === btnValue) : {},
token: getToken(),
selectRows,
......@@ -51,14 +64,14 @@ function AuditButton(props) {
setVisible,
setSubmitLoading,
remark: {
setVisible: "关闭弹窗的方法",
setSubmitLoading: "显示为加载中",
path: " 代码在学工的这里面 src/webPublic/FormInsertDiy/AuditButton/index.js",
message: "蚂蚁金服的message 用来展示进度条. 不懂问我",
Modal: "蚂蚁金服的Modal 用来提示审核已完成",
callback: "执行完了的回调函数",
else: "其他参数打印出来自己看看",
uaaRequest: "调一站式的接口的方法"
setVisible: '关闭弹窗的方法',
setSubmitLoading: '显示为加载中',
path: ' 代码在学工的这里面 src/webPublic/FormInsertDiy/AuditButton/index.js',
message: '蚂蚁金服的message 用来展示进度条. 不懂问我',
Modal: '蚂蚁金服的Modal 用来提示审核已完成',
callback: '执行完了的回调函数',
else: '其他参数打印出来自己看看',
uaaRequest: '调一站式的接口的方法'
}
});
return true;
......@@ -69,6 +82,7 @@ function AuditButton(props) {
setSubmitLoading(true);
preHandle(values);
let payload = {
// 批量 和 单个审批 都用这段代码
taskIds: taskIds || [data.taskId], // 接口里面的taskId 任务Id
code: taskIds ? undefined : data.code,
// 审核相关内容
......@@ -81,13 +95,19 @@ function AuditButton(props) {
apiData: data,
taskFormKey: data?.taskFormKey,
userNowInfo:
(isJSON(localStorage.getItem("user")) && JSON.parse(localStorage.getItem("user"))) || {},
(isJSON(localStorage.getItem('user')) && JSON.parse(localStorage.getItem('user'))) || {},
buttonInfo,
token: getToken()
};
payload = callbackSubmitData(payload);
console.log(payload);
setVisible(false);
setShowProcessModal(payload);
return false;
dispatch({
type: "affair/getExamineProcess",
type: 'affair/getExamineProcess',
payload,
callback: (val) => {
setSubmitLoading(false);
......@@ -118,46 +138,55 @@ function AuditButton(props) {
* 根据不同值,返回对应样式
*/
function getStyle(key, value) {
if (key === "examine") {
if (key === 'examine') {
switch (value) {
case 1:
return [`${styles.btn_margin}`, `${styles.btn}`, `${styles.btn_reject}`].join(" ");
return [`${styles.btn_margin}`, `${styles.btn}`, `${styles.btn_reject}`].join(' ');
case 2:
return [`${styles.btn_margin}`, `${styles.btn}`, `${styles.btn_no}`].join(" ");
return [`${styles.btn_margin}`, `${styles.btn}`, `${styles.btn_no}`].join(' ');
case 0:
return "deafalut";
case "1":
return [`${styles.btn_margin}`, `${styles.btn}`, `${styles.btn_reject}`].join(" ");
case "2":
return [`${styles.btn_margin}`, `${styles.btn}`, `${styles.btn_no}`].join(" ");
case "0":
return "deafalut";
return 'deafalut';
case '1':
return [`${styles.btn_margin}`, `${styles.btn}`, `${styles.btn_reject}`].join(' ');
case '2':
return [`${styles.btn_margin}`, `${styles.btn}`, `${styles.btn_no}`].join(' ');
case '0':
return 'deafalut';
default:
return "deafalut";
return 'deafalut';
}
} else {
return "deafalut";
return 'deafalut';
}
}
function showModal(str, key, value) {
const { data, form } = props;
const {
data,
form
} = props;
const buttonInfo = data?.btns && data?.btns.length ? data?.btns.find((x) => x.value === value) : {};
const values = form.getFieldsValue();
if(buttonInfo?.documentation){
if (buttonInfo?.documentation) {
let needAuditInfo = isJSON(buttonInfo.documentation) && JSON.parse(buttonInfo.documentation)?.needAuditInfo;
if(needAuditInfo && !values.reason){
if (needAuditInfo && !values.reason) {
message.warning('请输入审批理由');
return ;
return;
}
}
setModalContent(`确定${str}吗?`);
setAffairParams({ oldKey: key, btnValue: value });
setAffairParams({
oldKey: key,
btnValue: value
});
setVisible(true);
}
const {
data: { isHandle, btns }
data: {
isHandle,
btns
}
} = props;
if (!isHandle || !Array.isArray(btns) || btns.length < 1) return null;
return (
......@@ -181,10 +210,23 @@ function AuditButton(props) {
handleCancel={hideModal}
handleOk={affairOk}
confirmLoading={isSubmitLoading}>
<div style={{ fontSize: 16, textAlign: "center", height: 150, lineHeight: "150px" }}>
<div style={{
fontSize: 16,
textAlign: 'center',
height: 150,
lineHeight: '150px'
}}>
{modalContent}
</div>
</ModalDiy>
{
showProcessModal &&
<AuditProcessOneByOne payloadData={showProcessModal}
callBack={callback}
setShowProcessModal={setShowProcessModal}
/>
}
</>
);
}
......
import React, { useState, useEffect, useRef } from 'react';
import { Modal, Progress,message } from 'antd';
import { uaaRequest } from '@/webPublic/one_stop_public/utils/request';
import styles from './styles.less';
export default function AuditProcessOneByOne({
payloadData = {},
callBack = () => {
},
setShowProcessModal,
}) {
if (!Array.isArray(payloadData?.taskIds) || !payloadData.taskIds.length) {
return null;
}
const [success, setS] = useState(0);
const [error, setE] = useState(0);
const resInfo = useRef();
const taskIds = payloadData.taskIds;
const total = taskIds.length;
async function getData(){
for (let g = 0; g < taskIds.length; g++) {
const res = await returnPromise({
...payloadData,
taskIds: [taskIds[g]],
});
if (res) {
setS((v) => v + 1);
} else {
setE((v) => v + 1);
}
resInfo.current = res;
}
}
useEffect(() => {
getData();
}, []);
useEffect(() => {
if (success + error === total) {
callBack(resInfo.current);
}
}, [success, error]);
const percent = Math.floor(((success + error) / total) * 100);
return (
<Modal title={'批量审核'}
visible={true}
width={1200}
footer={null}
onCancel={() => {
if(success + error !== total){
message.warning('审核正在进行中,请勿关闭');
}else{
setShowProcessModal(false);
}
}}
>
<div className={styles.juzhong}>
<Progress percent={percent}
type='circle'
status={error === total ? 'exception' : success + error === total ? 'success ' : ''}
strokeColor={{
'0%': '#108ee9',
'100%': '#87d068',
}}
/>
<div >
{
success + error === total ? `审核完成, 成功${success}条, 失败${error}条` : `正在进行审核 共${total}条数据, 成功${success}条, 失败${error}条`
}
</div>
</div>
</Modal>
);
}
let i = 0;
function returnPromise(data) {
// return new Promise((resolve, reject) => {
// i++;
// if (i % 2 > 0) {
// resolve(true);
// } else {
// resolve(false);
// }
// });
return uaaRequest('/UnifiedAppFormApi/examineProcess', data);
}
......@@ -20,4 +20,8 @@
color: #FF9B00;
border:1px solid #FF9B00;
}
}
\ No newline at end of file
}
.juzhong{
display: grid;
justify-items: center;
}
......@@ -14,13 +14,6 @@ function AuditModal({ form, selectRows, children, getPage, noNeedForm }) {
message.info(`提交${res ? '成功' : '失败'}!`);
setVisible(false);
getPage();
// 19684 优秀学生奖学金---班主任审核页面--弹框提醒优化处理 禅道bug
// ModalInfo(`提交${res ? '成功' : '失败'}!`, {
// onOk: () => {
// setVisible(false);
// getPage();
// },
// });
}
const [data, setData] = useState(null);
......@@ -82,6 +75,7 @@ function AuditModal({ form, selectRows, children, getPage, noNeedForm }) {
width={900}
visible={visible}
title="批量审核"
maskClosable={false}
footer={footer}
onCancel={() => setVisible(false)}>
<Spin spinning={loading}>
......
import React from "react";
import CheckRecord from "@/webPublic/FormInsertDiy/ExportComponent/CheckRecord"; // 查询类
import Apply from "@/webPublic/FormInsertDiy/AffairPage/ApplyPage"; // 申请
import BatchAudit from "@/webPublic/FormInsertDiy/AffairPage/AuditPage/BatchAudit"; // 批量审批
import Audit from "@/webPublic/FormInsertDiy/AffairPage/AuditPage/index.js"; // 审批
import Detail from "@/webPublic/FormInsertDiy/AffairPage/Detail"; //详情
import React, { useEffect, useState, createContext } from 'react';
import CheckRecord from '@/webPublic/FormInsertDiy/ExportComponent/CheckRecord'; // 查询类
import Apply from '@/webPublic/FormInsertDiy/AffairPage/ApplyPage'; // 申请
import BatchAudit from '@/webPublic/FormInsertDiy/AffairPage/AuditPage/BatchAudit'; // 批量审批
import Audit from '@/webPublic/FormInsertDiy/AffairPage/AuditPage/index.js'; // 审批
import Detail from '@/webPublic/FormInsertDiy/AffairPage/Detail'; //详情
import { Modal, message, notification, Popconfirm } from 'antd';
import { connect } from 'dva';
export const CreateC = createContext({
routerConfig: {},
});
window.iframeParentComponent = {
Modal,
message,
notification,
Popconfirm
Popconfirm,
};
export default function ActiveMenuComponent({
routerConfig,
...otherProps
}) {
const { component = "", appId } = routerConfig;
function ActiveMenuComponent({
routerConfig,
...otherProps
}) {
const {
component = '',
appId
} = routerConfig;
const { location } = otherProps;
const record = location?.state?.record;
const [show, setShow] = useState(false);
useEffect(
() => {
if (appId || record.id) {
setShow(false);
setTimeout(() => {
setShow(true);
}, 100);
}
},
[appId, record],
);
if (!show) {
return null;
}
let Res = <div>暂无此功能</div>;
switch (component) {
case "CheckRecord": // 查询类应用
return <CheckRecord workId={appId}
case 'CheckRecord': // 查询类应用
Res = <CheckRecord workId={appId}/>;
break;
case 'Apply': // 申请类
Res = <Apply workId={appId} {...otherProps} />;
break;
case 'Audit': // 审批类
Res = <Audit workId={appId} {...otherProps} />;
break;
case 'BatchAudit': // 批量审批
Res = <BatchAudit workId={appId}
{...otherProps}
/>;
case "Apply": // 申请类 详情是 iframe
return <Apply
workId={appId} {...otherProps}/>;
case "Audit": // 审批类 详情是 iframe
return <Audit
workId={appId} {...otherProps}/>;
case "BatchAudit": // 批量审批 详情是 iframe
return <BatchAudit
workId={appId} {...otherProps}/>;
case "Detail": // 详情 iframe
return <Detail
{...otherProps} {...otherProps}/>;
break;
case 'Detail': // 详情
Res = <Detail {...otherProps} />;
break;
default:
console.log(component, "没有找到此组件");
return <div>暂无此功能</div>;
break;
}
return (
<CreateC.Provider value={{
routerConfig,
}}>
{Res}
</CreateC.Provider>
);
}
export default connect(({}) => {
return {};
})(ActiveMenuComponent);
import React from "react";
import React, { useEffect, useState } from "react";
import CheckRecord2 from "@/webPublic/FormInsertDiy/AffairPage/IframeFor2.0"; // 2.0的 查询类 应用 直接iframe 嵌入
import Apply from "@/webPublic/FormInsertDiy/AffairPage/ApplyPage"; // 申请
import BatchAudit from "@/webPublic/FormInsertDiy/AffairPage/AuditPage/BatchAudit"; // 批量审批
......@@ -12,9 +12,24 @@ export default function ActiveMenuComponent2({
...otherProps
}) {
const { component = "", appId } = routerConfig;
const [show, setShow] = useState(true);
useEffect(() => {
if(appId){
setShow(false);
setTimeout(() => {
setShow(true);
}, 1000);
}
}, [appId]);
if(!show){
return null;
}
switch (component) {
case "CheckRecord": // 查询类应用
console.log(appId);
return <CheckRecord2 workId={appId} {...otherProps} />;
case "Apply": // 申请类
return <Apply
......
......@@ -15,6 +15,7 @@ function OtherCheckRecord({ workId, ...otherProps }) {
const id = workId || getOneStopConfig(pathname);
useEffect(() => {
setData(undefined);
console.log(id);
fetchTemplateById(id).then(res => {
if (res) setData({ ...res, content: '{}' });
});
......
......@@ -5,11 +5,13 @@ import ButtonDiy from '@/baseComponent/ButtonDiy';
import config from '@/config/config';
import { connect } from 'dva';
import { exportExcel } from 'xlsx-oc';
// import { exportExcel } from 'xlsx-oc';
import { getToken } from '@/utils/authority';
const Step = Steps.Step;
const TabPane = Tabs.TabPane;
const exportExcel = CLIENT_TYPE == 'mobile' ? null : require('xlsx-oc').exportExcel;
// const exportExcel = null;
@connect(({ DataObj, loading }) => ({
DataObj,
......@@ -181,6 +183,10 @@ export default class ImportUtil extends React.PureComponent {
this.setState({ currentKey: activeKey });
};
exportError = (column, dataSource) => {
if(!exportExcel){
message.info('暂不支持此功能');
return null;
}
var _headers = [];
for (var i = 0; i < column.length; i++) {
_headers.push({ k: column[i].dataIndex, v: column[i].title });
......
/**
* 判断是否为JSON文本
* @param {string} str 是否为json文本
*/
export function isJSON(str) {
if (typeof str == 'string') {
try {
JSON.parse(str);
if (typeof JSON.parse(str) === 'number') {
return false;
}
return true;
} catch (e) {
return false;
}
}
}
/**
* 2022年7月19日
* 钟是志
* 一站式接口为了应付北电科的鉴权 按欢哥搞的 把接口地址进行一次转换
* 禅道 28321 一站式接口越权处理
* */
import { getToken } from '@/webPublic/one_stop_public/utils/getToken';
import { isJSON } from '@/webPublic/one_stop_public/2022beidianke/isJSON';
import { strToBinary } from '@/webPublic/one_stop_public/Base16/strToBinary';
import { binaryToStr } from '@/webPublic/one_stop_public/Base16/binaryToStr';
import { getUrlInfo } from '@/webPublic/one_stop_public/DetailForAudit/utils';
import md5 from 'js-md5';
const urlInfo = getUrlInfo();
if(!!urlInfo.visitor){
sessionStorage.setItem('visitor_client', JSON.stringify(true));
}
const isTest = urlInfo.test;
const visitor_client = sessionStorage.getItem('visitor_client') === 'true';
function getApi(apiUrl) {
const token = getToken();
const data = {
url: apiUrl,
};
if((!token || token.length < 11) && visitor_client){
data.client = 'client_' + md5(navigator.appVersion); // 访客模式
}else{
data.token = token;
}
const datasCode = strToBinary(JSON.stringify(data));
let file = new File([datasCode], 'fileParams.jpeg', {
type: 'image/jpeg',
});
let datasTrue = {
fileParams: file,
bin: true,
rbin: true,
// token: getToken(),
};
const formData = new FormData();
for (let key in datasTrue) {
formData.append(key, datasTrue[key]);
}
return fetch(window.CONFIG.API_ACTION_PATH + '/safe/pub/getApis', {
headers: {
Accept: 'application/json',
},
method: 'POST',
credentials: 'omit',
mode: 'cors',
body: formData,
})
.then((res) => {
return res.json();
}).then((res) => {
if (res.rbin && isJSON(binaryToStr(res.rbin))) {
const u = JSON.parse(binaryToStr(res.rbin)).url;
const newUrl = window.CONFIG.API_ACTION_PATH + '/apis/' + md5(u);
setLocalStorageTransformApi(apiUrl, u); // 存入缓存
return {
transformApi: newUrl,
headersApi: u,
};
} else {
return false;
}
});
}
function getLocalStorageTransformApi(api = '') {
const storage = localStorage.getItem('oneStopTransformApi');
if (storage && isJSON(storage)) {
let d = JSON.parse(storage);
return d;
} else {
return {};
}
}
function setLocalStorageTransformApi(api = '', transformApi = '') {
let t = getToken();
// if((!t || t.length < 11) && visitor_client){
// t = md5(navigator.appVersion);
// }
let old = getLocalStorageTransformApi();
if (old[t]) {
old[t][api] = transformApi;
} else {
old = {};
old[t] = {};
old[t][api] = transformApi;
}
localStorage.setItem('oneStopTransformApi', JSON.stringify(old));
}
export async function getTransformApi(url) { //
let apiUrl = '';
let needTransform = true;
const t = getToken();
const TRANSFORM_BIN = window.CONFIG?.TRANSFORM_BIN;
if(!TRANSFORM_BIN){
needTransform = false;
}
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, '');
} else {
return new Promise((resolve, reject) => {
resolve({
transformApi: url,
headersApi: undefined,
});
});
}
if (!visitor_client && (!t || t.length < 11 || !needTransform)) { // 没有token 或者没有开启二进制加密 且不是访客模式 直接返回
return new Promise((resolve, reject) => {
resolve({
transformApi: url,
headersApi: undefined,
});
});
} else {
const storage = getLocalStorageTransformApi();
if(storage && storage[t] && storage[t][apiUrl]){
return new Promise((resolve) => {
const apis = storage[t][apiUrl];
resolve({
transformApi: window.CONFIG.API_ACTION_PATH + '/apis/' + md5(apis),
headersApi: apis,
})
});
}
return new Promise((resolve) => {
return getApi(apiUrl).then((g) => {
resolve({
transformApi: g.transformApi,
headersApi: g.headersApi,
});
});
});
}
}
......@@ -9,8 +9,10 @@ import { getToken } from '../../utils/token';
import config from '@/webPublic/one_stop_public/config';
import FormdataWrapper from '../../utils/object-to-formdata-custom';
import ButtonDiy from '../ButtonDiy/ButtonDiy';
import { giveFilePostData, giveFilePostDataInfoForTrue } from '@/webPublic/one_stop_public/Base16';
import { giveFilePostDataInfoForTrue } from '@/webPublic/one_stop_public/Base16';
import SelectModal from '@/webPublic/one_stop_public/App/ExportCurrentInfo/SelectModal';
import { getHeaders } from '@/webPublic/zyd_public/utils/utils';
import { getTransformApi } from '@/webPublic/one_stop_public/2022beidianke/localstorageTransform';
/**
*
* 2019/02/21 修改导出方式为fetch
......@@ -48,16 +50,14 @@ export default class ExportCurrentInfo extends React.Component {
}
exportData = () => {
let downloadUrl = config.httpServer + '/DataObjApi/exportCurrent?';
const token = getToken() != null && getToken() != 'null' ? getToken() : '0000';
downloadUrl = `${downloadUrl}token=${token}`;
let downloadUrl = config.httpServer + '/DataObjApi/exportCurrent';
let param = {
dataObjId: this.props.objId,
query: this.props.query,
custom: this.props.custom,
sql: this.props.sql,
index: this.props.index,
// token: getToken(),
};
if(this.props.openSelectFieldsModal){ // 26598 自定义数据导出---导出字段调整,,,注意数据权限
......@@ -72,13 +72,17 @@ export default class ExportCurrentInfo extends React.Component {
this.downloadFile(downloadUrl, param);
};
downloadFile(url, params) {
downloadFile = async (url, params) => {
this.setState({ confirmLoading: true });
let newApi = giveFilePostDataInfoForTrue(params, url);
fetch(newApi.url, {
if(newApi && newApi.datas){
newApi.datas.token = getToken();
}
const { transformApi, headersApi } = await getTransformApi(newApi.url);
fetch(transformApi, {
method: 'POST',
body: FormdataWrapper(newApi.datas,
),
body: FormdataWrapper(newApi.datas),
...getHeaders('', headersApi),
})
.then((res) => {
if (res.status != '200') {
......
......@@ -22,6 +22,7 @@ import OrderItem from './OrderItem';
import FormdataWrapper from '../utils/object-to-formdata-custom';
import ButtonDiy from './ButtonDiy/ButtonDiy';
import { getHeaders } from '@/webPublic/zyd_public/utils/utils';
const Option = Select.Option;
var keyX = 1;
......@@ -366,6 +367,7 @@ export default class ExportInfo extends React.Component {
fetch(url, {
method: 'POST',
body: FormdataWrapper(params),
...getHeaders()
})
.then((res) => {
if (res.status != '200') {
......
......@@ -22,6 +22,7 @@ import OrderItem from './OrderItem';
import FormdataWrapper from '../utils/object-to-formdata-custom';
import ButtonDiy from './ButtonDiy/ButtonDiy';
import { getHeaders } from '@/webPublic/zyd_public/utils/utils';
const Option = Select.Option;
var keyX = 1;
......@@ -293,6 +294,7 @@ export default class SearchInfo extends React.Component {
fetch(url, {
method: 'POST',
body: FormdataWrapper(params),
...getHeaders(),
})
.then((res) => {
if (res.status != '200') {
......
......@@ -8,6 +8,7 @@ import styles from '../Ability.css';
import FormdataWrapper from '../../utils/object-to-formdata-custom';
import ButtonDiy from '../ButtonDiy/ButtonDiy';
import { nameSpan, nameSpan3, nameSpan2 } from './config';
import { getHeaders } from '@/webPublic/zyd_public/utils/utils';
const Option = Select.Option;
const FormItem = Form.Item;
......@@ -277,7 +278,9 @@ export default class StatisticsInfo extends React.Component {
fetch(url, {
method: 'POST',
body: FormdataWrapper(params),
})
...getHeaders(),
})
.then((res) => {
if (res.status != '200') {
return res.json();
......
import { apiRequest } from '@/webPublic/one_stop_public/utils/request';
import { isJSON } from '@/webPublic/zyd_public/utils/utils';
import baseX from 'base-x';
import encryptApiList from '@/webPublic/one_stop_public/Base16/encryptApiList';
var BASE16 = '0123456789abcdef';
var bs16 = baseX(BASE16);
function checkOpenBase16() {
const is_open_base14 = sessionStorage.getItem('is_open_base16')
? JSON.parse(sessionStorage.getItem('is_open_base16'))
: false;
return is_open_base14;
}
export function Base16Encode(value) {
const is_open_base14 = checkOpenBase16();
if (is_open_base14) {
if (!value) {
return null;
} else {
let newV = new Buffer(value); // 快
const r = bs16.encode(newV); // 慢
return r;
}
}
return value;
}
function giveKey(key, datas) {
if (datas && datas[key]) {
datas[key] = Base16Encode(datas[key]);
}
return datas;
}
export async function countAllValues(datas, item) {
if (item.setNull) {
datas.allValues = JSON.stringify({});
} else {
if (item.query) {
if (datas?.sqlKey.length < 13) {
const response = await apiRequest('/SqlManageEntityApi/findParamsKey', {
sqlKey: datas.sqlKey,
});
if (!response || (Array.isArray(response) && response.length === 0)) {
datas.allValues = JSON.stringify({});
} else {
const x = (isJSON(datas.allValues) && JSON.parse(datas.allValues)) || {};
const y = {};
for (let i of response) {
if (x[i]) {
y[i] = x[i];
}
datas.allValues = JSON.stringify(y);
}
}
} else {
datas.allValues = JSON.stringify({});
}
}
}
return datas;
}
export async function giveBase16EncodeAsync(datas, url) {
if (!checkOpenBase16()) {
return datas;
}
if (url && typeof url === 'string') {
for (let item of encryptApiList) {
if (url.indexOf(item.api) > -1) {
for (let g of item.key) {
if (datas[g] && item.filterEmpty && item.filterEmpty.includes(g)) {
// 压缩代码功能暂时屏蔽
/***
// console.log(datas[g]);
// console.log('%c加密数据压缩前字段' + g + '= ', 'color: red;');
// console.log('%c'+ datas[g] , 'color: red;');
// datas[g] = datas[g].replace(/\r/g, ' ').replace(/\t/g, ' ').replace(/\n/g, ' ').replace(/\s\s+/g, ' ');
// console.log('%c加密数据压缩后字段' + g + '= ', 'color: orange;');
// console.log('%c'+ datas[g] , 'color: orange;');
***/
}
if (g === 'allValues' && typeof datas[g] !== 'undefined') {
datas = await countAllValues(datas, item); // 循环中 不要写await
datas = giveKey('allValues', datas);
} else {
// console.log(g, datas);
datas = giveKey(g, datas);
}
}
if (item.yinShe) {
// 映射参数字段.
datas.isBase = true;
for (let oldKey in item.yinShe) {
let newKey = item.yinShe[oldKey];
// if(typeof datas[oldKey] !== 'undefined'){
datas[newKey] = datas[oldKey];
delete datas[oldKey];
// }
}
}
return datas;
}
}
}
return datas;
}
import encryptApiList, { resBinaryApiList } from '@/webPublic/one_stop_public/Base16/encryptApiList';
import { getToken, getUserInfo } from '@/webPublic/one_stop_public/utils/token';
import { queryApiActionPath } from '@/webPublic/one_stop_public/utils/queryConfig';
import { qqCw } from '@/webPublic/one_stop_public/utils/request';
import { getHeaders, isJSON } from '@/webPublic/zyd_public/utils/utils';
import { deepCopy } from '@/webPublic/one_stop_public/utils/myutils';
import { countAllValues } from '@/webPublic/one_stop_public/Base16/SplitBase16Index';
import { getUrlInfo } from '@/webPublic/one_stop_public/DetailForAudit/utils';
import { getTransformApi } from '@/webPublic/one_stop_public/2022beidianke/localstorageTransform';
import { strToBinary } from './strToBinary'; // 字符串转二进制 混淆代码
import { binaryToStr } from './binaryToStr'; // 二进制字符串转JSON字符串 混淆代码
const test = !!(getUrlInfo().test);
function formatDatas(datas, url = '') {
let datasCode = JSON.stringify(datas);
const openIsBinary = window.CONFIG?.IS_BINARY;
if (test) {
console.log(url, datas);
}
if (openIsBinary) {
datasCode = strToBinary(datasCode);
}
let file = new File([datasCode], 'fileParams.jpeg', {
type: 'image/jpeg',
});
let datasTrue = {
fileParams: file,
};
if (openIsBinary) {
datasTrue.bin = true;
if (window.CONFIG?.ALL_R_BIN) {
datasTrue.rbin = true;
} else {
let findIndexA = resBinaryApiList.findIndex(g => {
return url.includes(g.api);
});
if (findIndexA >= 0) {
datasTrue.rbin = true;
}
}
}
return datasTrue;
}
export async function giveFilePostData(datas, url) {
for (let i in datas) {
if (
datas[i] === null ||
(Array.isArray(datas[i]) && datas[i].length === 0) ||
datas[i] === undefined
) {
delete datas[i];
}
}
if (url && typeof url === 'string') {
for (let item of encryptApiList) {
if ((window.CONFIG?.ALLBIN && url.indexOf('/onestop/') > -1) || url.indexOf(item.api) > -1) {
const roleGroup = getUserInfo().groupsId;
if (url.indexOf('http') > -1) {
url = url.replace('/onestop/', `/onestop/safe/${roleGroup}/`);
} else {
url = url.replace(url, `/safe/${roleGroup}/` + url);
url = url.replaceAll('//', '/');
}
datas = await countAllValues(datas, item);
return new Promise((resolve, reject) => {
resolve({
datas: formatDatas(datas, url),
url,
});
});
}
}
}
return new Promise((resolve, reject) => {
resolve(datas);
return datas;
});
}
function testPromise(d) {
return new Promise((resolve, reject) => {
resolve(d);
});
}
export async function requestFileInfo(url, datas) {
// for (let i = 0; i < 100; i++) {
// datas = await testPromise(datas);
// }
const formData = new FormData();
if (getToken()) {
datas.token = getToken();
}
for (let key in datas) {
formData.append(key, datas[key]);
}
if (!url || typeof url !== 'string') {
return false;
}
let trueUrl = url && url.indexOf('http') > -1 ? url : queryApiActionPath() + url;
if (test) {
console.log('转换前', trueUrl);
}
const {transformApi, headersApi } = await getTransformApi(trueUrl);
if (test) {
console.log('转换后' + transformApi, headersApi);
}
return fetch(transformApi, {
headers: {
Accept: 'application/json',
...getHeaders(transformApi).headers,
apis: headersApi,
// axxx: `select * from user123 where id = 1`,
},
method: 'POST',
credentials: 'omit',
mode: 'cors',
body: formData,
})
.then(res => {
if (res.status === 401) {
qqCw({
title: '登录过期401',
customErrMsg: '登录已过期,请重新登录',
});
return false;
}
if (res.status === 404) {
qqCw({
title: 'http404报错',
customErrMsg: '请联系系统管理员',
});
return false;
}
return res.json();
})
.then(res => {
if (res && typeof res === 'object' && res.rbin) {
res = binaryToStr(res.rbin);
if (isJSON(res)) {
res = JSON.parse(res);
}
}
if (res && res.errCode) {
qqCw({
msg: res.errMsg || res.message,
customErrMsg: res.customErrMsg,
});
return false;
}
if (test) {
console.log({
url,
res,
});
}
return res;
});
}
export function giveFilePostDataInfoForTrue(datas, url) {
if (!window.CONFIG?.IS_SAFE) {
return {
datas,
url,
};
}
datas = deepCopy(datas);
for (let i in datas) {
if (
datas[i] === null ||
(Array.isArray(datas[i]) && datas[i].length === 0) ||
datas[i] === undefined
) {
delete datas[i];
}
}
if (url) {
const roleGroup = getUserInfo().groupsId;
if (url.indexOf('http') > -1) {
url = url.replace('/onestop/', `/onestop/safe/${roleGroup}/`);
} else {
url = url.replace(url, `/safe/${roleGroup}/` + url);
url = url.replaceAll('//', '/');
}
return {
datas: formatDatas(datas, url),
url,
};
}
}
/**
* 二进制字符串转JSON字符串
* */
export function binaryToStr(binaryStr = '') {
let res = '';
if (binaryStr) {
binaryStr = binaryStr.replaceAll('.', '1');
binaryStr = binaryStr.replaceAll('-', '0');
let strListArr = binaryStr.split('_');
for (let i = 0; i < strListArr.length; i++) {
let item = strListArr[i];
res += String.fromCharCode(parseInt(item, 2));
}
}
return res;
}
......@@ -6,6 +6,9 @@ const encryptApiList = [
{
api: 'UnifiedServicePatternApi/updateForm',
},
{
api: 'getApis',
},
{
api: 'UnifiedServicePatternApi/getDetail',
},
......@@ -144,7 +147,10 @@ const resBinaryApiList = [
{
api: 'SqlManageEntityApi/find',
},
]
{
api: 'getApis',
},
];
export { resBinaryApiList };
......
import { queryApiActionPath } from '@/webPublic/one_stop_public/utils/queryConfig';
export default function getOneStopUploadUrl(){
return queryApiActionPath() + '/upload';
}
import baseX from 'base-x';
import { apiRequest, qqCw } from '../utils/request';
import { isJSON } from '@/webPublic/zyd_public/utils/utils';
import {
queryApiActionPath,
queryIsBinary,
queryIsSafe,
} from '@/webPublic/one_stop_public/utils/queryConfig';
import { getToken, getUserInfo } from '@/webPublic/one_stop_public/utils/token';
import encryptApiList, { resBinaryApiList } from './encryptApiList';
import { queryIsSafe } from '@/webPublic/one_stop_public/utils/queryConfig';
import { uploadFile } from '@/webPublic/one_stop_public/libs/PictureSignature/ShowItem';
import { deepCopy } from '@/webPublic/one_stop_public/utils/myutils';
var BASE16 = '0123456789abcdef';
var bs16 = baseX(BASE16);
function checkOpenBase16() {
const is_open_base14 = sessionStorage.getItem('is_open_base16')
? JSON.parse(sessionStorage.getItem('is_open_base16'))
: false;
return is_open_base14;
}
export function Base16Encode(value) {
const is_open_base14 = checkOpenBase16();
if (is_open_base14) {
if (!value) {
return null;
} else {
let newV = new Buffer(value); // 快
const r = bs16.encode(newV); // 慢
return r;
}
}
return value;
}
const giveKey = (key, datas) => {
if (datas && datas[key]) {
datas[key] = Base16Encode(datas[key]);
}
return datas;
};
const countAllValues = async (datas, item) => {
if (item.setNull) {
datas.allValues = JSON.stringify({});
} else {
if (item.query) {
if (datas?.sqlKey.length < 13) {
const response = await apiRequest('/SqlManageEntityApi/findParamsKey', {
sqlKey: datas.sqlKey,
});
if (!response || (Array.isArray(response) && response.length === 0)) {
datas.allValues = JSON.stringify({});
} else {
const x = (isJSON(datas.allValues) && JSON.parse(datas.allValues)) || {};
const y = {};
for (let i of response) {
if (x[i]) {
y[i] = x[i];
}
datas.allValues = JSON.stringify(y);
}
}
} else {
datas.allValues = JSON.stringify({});
}
}
}
return datas;
};
export function requestFileInfo(url, datas) {
const formData = new FormData();
if (getToken()) {
datas.token = getToken();
}
for (let key in datas) {
formData.append(key, datas[key]);
}
if (!url || typeof url !== 'string') {
console.log(url);
return false;
}
return fetch(url && url.indexOf('http') > -1 ? url : queryApiActionPath() + url, {
headers: {
Accept: 'application/json',
// Authorization: `bearer ${getToken()}`,
},
method: 'POST',
credentials: 'omit',
mode: 'cors',
body: formData,
})
.then(res => {
if (res.status === 401) {
qqCw({
title: '登录过期401',
customErrMsg: '登录已过期,请重新登录',
});
return false;
}
if (res.status === 404) {
qqCw({
title: 'http404报错',
customErrMsg: '请联系系统管理员',
});
return false;
}
// console.log(res.status);
return res.json();
})
.then(res => {
if (res && typeof res === 'object' && res.rbin) {
res = binaryToStr(res.rbin);
if (isJSON(res)) {
res = JSON.parse(res);
}
// console.log(res);
}
if (res && res.errCode) {
qqCw({
msg: res.errMsg || res.message,
customErrMsg: res.customErrMsg,
});
return false;
}
if(window.location.origin.indexOf('localhost') > -1){
console.log({
datas,
url,
res,
});
}
return res;
});
}
function formatDatas(datas, url = '') {
let datasCode = JSON.stringify(datas);
const openIsBinary = window.CONFIG?.IS_BINARY;
if (openIsBinary) {
datasCode = strToBinary(datasCode);
}
let file = new File([datasCode], 'fileParams.jpeg', {
type: 'image/jpeg',
});
let datasTrue = {
fileParams: file,
};
if (openIsBinary) {
datasTrue.bin = true;
if(window.CONFIG?.ALLBIN){
datasTrue.rbin = true;
}else{
let findIndexA = resBinaryApiList.findIndex(g => {
return url.includes(g.api);
});
if (findIndexA >= 0) {
datasTrue.rbin = true;
}
}
}
return datasTrue;
}
export function giveFilePostDataInfoForTrue(datas, url) {
if (!window.CONFIG?.IS_SAFE) {
return {
datas,
url,
};
}
datas = deepCopy(datas);
for (let i in datas) {
if (
datas[i] === null ||
(Array.isArray(datas[i]) && datas[i].length === 0) ||
datas[i] === undefined
) {
delete datas[i];
}
}
if (url) {
const roleGroup = getUserInfo().groupsId;
if (url.indexOf('http') > -1) {
url = url.replace('/onestop/', `/onestop/safe/${roleGroup}/`);
} else {
url = url.replace(url, `/safe/${roleGroup}/` + url);
url = url.replaceAll('//', '/');
}
return {
datas: formatDatas(datas, url),
url,
};
}
}
/**
* 字符串转二进制
* */
function strToBinary(str) {
let result = [];
let list = str.split('');
for (let i = 0; i < list.length; i++) {
if (i !== 0) {
result.push('_');
}
let item = list[i];
let binaryStr = item.charCodeAt()
.toString(2);
result.push(binaryStr);
}
let resultStr = result.join('');
resultStr = resultStr.replaceAll('0', '-').replaceAll('1', '.');
return resultStr;
}
/**
* 二进制字符串转JSON字符串
* */
function binaryToStr(binaryStr = '') {
let res = '';
if (binaryStr) {
binaryStr = binaryStr.replaceAll('.', '1');
binaryStr = binaryStr.replaceAll('-', '0');
let strListArr = binaryStr.split('_');
import {
Base16Encode,
giveBase16EncodeAsync,
} from './SplitBase16Index';
import { giveFilePostData, giveFilePostDataInfoForTrue, requestFileInfo } from './binaryEncode';
for (let i = 0; i < strListArr.length; i++) {
let item = strListArr[i];
res += String.fromCharCode(parseInt(item, 2));
}
}
return res;
}
function giveFilePostData(datas, url) {
for (let i in datas) {
if (
datas[i] === null ||
(Array.isArray(datas[i]) && datas[i].length === 0) ||
datas[i] === undefined
) {
delete datas[i];
}
}
if (url && typeof url === 'string') {
for (let item of encryptApiList) {
if (url.indexOf(item.api) > -1 || Window.CONFIG?.ALLBIN) {
const roleGroup = getUserInfo().groupsId;
if (url.indexOf('http') > -1) {
url = url.replace('/onestop/', `/onestop/safe/${roleGroup}/`);
} else {
url = url.replace(url, `/safe/${roleGroup}/` + url);
url = url.replaceAll('//', '/');
}
return new Promise((resolve, reject) => {
resolve({
datas: formatDatas(datas, url),
url,
});
});
}
}
}
return new Promise((resolve, reject) => {
resolve(datas);
return datas;
});
}
export { Base16Encode, requestFileInfo, giveFilePostDataInfoForTrue };
export async function giveBase16EnCode(datas, url) {
// 全局加解密函数.
if (queryIsSafe()) {
if (queryIsSafe() && url) {
return giveFilePostData(datas, url);
}
if (!checkOpenBase16()) {
return datas;
}
if (url && typeof url === 'string') {
for (let item of encryptApiList) {
if (url.indexOf(item.api) > -1) {
for (let g of item.key) {
if (datas[g] && item.filterEmpty && item.filterEmpty.includes(g)) {
// 压缩代码功能暂时屏蔽
/***
// console.log(datas[g]);
// console.log('%c加密数据压缩前字段' + g + '= ', 'color: red;');
// console.log('%c'+ datas[g] , 'color: red;');
// datas[g] = datas[g].replace(/\r/g, ' ').replace(/\t/g, ' ').replace(/\n/g, ' ').replace(/\s\s+/g, ' ');
// console.log('%c加密数据压缩后字段' + g + '= ', 'color: orange;');
// console.log('%c'+ datas[g] , 'color: orange;');
***/
}
if (g === 'allValues' && typeof datas[g] !== 'undefined') {
datas = await countAllValues(datas, item); // 循环中 不要写await
datas = giveKey('allValues', datas);
} else {
// console.log(g, datas);
datas = giveKey(g, datas);
}
}
if (item.yinShe) {
// 映射参数字段.
datas.isBase = true;
for (let oldKey in item.yinShe) {
let newKey = item.yinShe[oldKey];
// if(typeof datas[oldKey] !== 'undefined'){
datas[newKey] = datas[oldKey];
delete datas[oldKey];
// }
}
}
return datas;
}
}
}
return datas;
return giveBase16EncodeAsync(datas, url);
}
/**
* 字符串转二进制
* */
export function strToBinary(str) {
let result = [];
let list = str.split('');
for (let i = 0; i < list.length; i++) {
if (i !== 0) {
result.push('_');
}
let item = list[i];
let binaryStr = item.charCodeAt()
.toString(2);
result.push(binaryStr);
}
let resultStr = result.join('');
resultStr = resultStr.replaceAll('0', '-').replaceAll('1', '.');
return resultStr;
}
......@@ -41,9 +41,8 @@ import { queryApiVersion, queryApiActionPath } from '@/webPublic/one_stop_public
import { isJSON } from '@/webPublic/zyd_public/utils/utils';
import HistoryFormList from '@/webPublic/one_stop_public/DetailForAudit/HistoryFormList';
@Form.create()
@connect()
export default class DetailSplit extends Component {
class DetailSplit extends Component {
constructor() {
super();
this.state = {
......@@ -87,7 +86,6 @@ export default class DetailSplit extends Component {
userInfo: '', // 得到用户数据
setData: '', // 配置的数据
countersignModal: '', // 开启加签弹框函数
nextAuditInfo: {}, // 最新的节点的审核人信息
isAllPrint: false,
};
window.callbackSubmitInfoZhiYong = undefined;
......@@ -162,6 +160,7 @@ export default class DetailSplit extends Component {
code: code || null, // 表单值
handleUser: handleUser || null, // 处理人
taskId, // 多任务流程会使用到,后续改为必须传入
lite: true,
},
callback: val => {
if (this.props.changeData) {
......@@ -175,68 +174,59 @@ export default class DetailSplit extends Component {
label: item.taskName,
value: item.formKey,
});
// checkedConfimList.push(item.formKey);
});
}
if (val.code) {
permRequest('/UnifiedAppFormApi/getAll', {
keyWords: val.code,
pageNo: 1,
pageSize: 10,
if (val && !val.taskInfo) {
permRequest('/UnifiedAppFormApi/getTaskInfos', { // 获取每一步的审核人.
id: queryId ? queryId : id, // 审批表Id
})
.then(res => {
if (res && res.rows && res.rows.length) {
let thisAuditData = res.rows[0];
if (thisAuditData?.nextUsers?.endsWith(',')) {
thisAuditData.nextUsers = thisAuditData.nextUsers.slice(0, -1);
}
this.setState({
nextAuditInfo: thisAuditData,
});
}
});
}
this.setState(
{
data: val,
stepFlow: val.taskInfo,
obj: JSON.parse(val.content),
code: val.code,
taskId: val.taskId,
isSecond: val.isSecond ? val.isSecond : false,
appId: val.appId,
code: val.code,
isHandle: val.isHandle,
id,
btns: val.btns,
taskFormKey: val.taskFormKey,
hisTaskFormKeys: val.hisTaskForm,
isLoading: true,
formColor: val.formColor,
formLevel: val.formLevel,
isEnd: val.isEnd,
checkListOptions,
checkedConfimList,
},
() => {
if (val.isSecond) {
this.props.dispatch({
type: 'urge/GetMyBtn',
payload: {},
callback: arr => {
this.setState({
btnList: arr,
radiovalue: val.formLevelId ? val.formLevelId : arr[arr.length - 1].id,
}, () => {
val.taskInfo = res.taskInfo;
this.setState(
{
data: val,
stepFlow: val.taskInfo,
obj: JSON.parse(val.content),
code: val.code,
taskId: val.taskId,
isSecond: val.isSecond ? val.isSecond : false,
appId: val.appId,
code: val.code,
isHandle: val.isHandle,
id,
btns: val.btns,
taskFormKey: val.taskFormKey,
hisTaskFormKeys: val.hisTaskForm,
isLoading: true,
formColor: val.formColor,
formLevel: val.formLevel,
isEnd: val.isEnd,
checkListOptions,
checkedConfimList,
},
() => {
if (val.isSecond) {
this.props.dispatch({
type: 'urge/GetMyBtn',
payload: {},
callback: arr => {
this.setState({
btnList: arr,
radiovalue: val.formLevelId ? val.formLevelId : arr[arr.length - 1].id,
}, () => {
// this.giveMessageTop();
});
},
});
} else {
// this.giveMessageTop();
});
}
},
});
} else {
// this.giveMessageTop();
}
},
);
);
});
}
},
});
......@@ -315,12 +305,12 @@ export default class DetailSplit extends Component {
callback();
}
let checkSumbitInfo = checkNeedFormValidateFieldsAndScroll({
let checkSumbitInfo = checkNeedFormValidateFieldsAndScroll({ // 检查是否必填表单值
btns,
btnValue,
});
let needWriteAuditInfo = checkNeedWriteAuditInfo({
let needWriteAuditInfo = checkNeedWriteAuditInfo({ // 检查是否必填审批理由
btns,
btnValue,
});
......@@ -432,7 +422,6 @@ export default class DetailSplit extends Component {
paddingBottom,
setData,
isSign,
nextAuditInfo,
isAllPrint,
} = this.state;
const { showPrint } = this.props;
......@@ -576,7 +565,8 @@ export default class DetailSplit extends Component {
</div>
</div>
</div>
{isLoading ? (
{isLoading ?
(
<>
<Card style={{ width: '100%' }}>
{!isCloseUserDetail && (
......@@ -752,8 +742,8 @@ export default class DetailSplit extends Component {
<p>审批人员: {data.nextUsers}</p>
)
}
{queryApiVersion() !== '2.0' && ['处理中', '待处理'].includes(item.status) && !!nextAuditInfo.nextUsers && (
<p>审批人员: {nextAuditInfo.nextUsers}</p>
{queryApiVersion() !== '2.0' && ['处理中', '待处理'].includes(item.status) && !!item.nextUsers && (
<p>审批人员: {item.nextUsers}</p>
)}
<p>审批流程:{item.name}</p>
<p className={styles.steps_body}>审批状态:{item.status}</p>
......@@ -867,6 +857,7 @@ export default class DetailSplit extends Component {
isSumbitLoading={isSumbitLoading}
isSecond={isSecond}
affairOk={this.affairOk}
form={this.props.form}
btns={btns}
addition={
<>
......@@ -980,3 +971,11 @@ export default class DetailSplit extends Component {
);
}
}
export default function Index(props){
console.log(window.zdyTableTemplateWillMountProps?.formCreateOptions);
const DetailSplitFormNew = Form.create(
window.zdyTableTemplateWillMountProps?.formCreateOptions || undefined,
)(DetailSplit);
return <DetailSplitFormNew {...props}/>;
}
......@@ -35,7 +35,6 @@ export default class GetDetail extends Component {
render() {
const {id} = this.state;
console.log(this.props.showPrint);
const {
detailInfoDivStyle = {
backgroundColor: '#FFFFFF',
......
......@@ -11,7 +11,6 @@ import { openToast } from '@/webPublic/one_stop_public/DetailForAudit/components
import { connect } from 'dva';
import ZdyTable from '@/webPublic/one_stop_public/Table';
import { preHandle } from '@/webPublic/one_stop_public/utils/myutils';
import router from 'umi/router';
import { isEmpty } from 'lodash';
import { callbackApplyData } from '@/webPublic/one_stop_public/models/callbackExamineProcess';
import { isJSON } from '@/webPublic/one_stop_public/tableCompon/Split_Index/staticInfo';
......
......@@ -5,9 +5,31 @@
*/
import React, { Component } from 'react';
import SignatureCanvas from 'react-signature-canvas';
import { message, Button } from 'antd';
import { message, Button, Modal } from 'antd';
import config from '@/webPublic/one_stop_public/config';
import reqwest from 'reqwest';
import { getToken, getUserInfo } from '@/webPublic/one_stop_public/utils/token';
import { uaaRequest } from '@/webPublic/one_stop_public/utils/request';
import { getOneStopMyInfo } from '@/webPublic/one_stop_public/utils/utils';
import styles from './mobileSign.less';
// 保存签名 到用户基础信息上
function saveSign(url) {
if (typeof url !== 'string' || url.length < 15) {
return true;
}
const userInfo = getUserInfo();
uaaRequest('/UserApi/saveMySysBackgroundImage', {
username: userInfo.stuNo,
backgroundImageUrl: userInfo.backgroundImageUrl || 'fakeBackgroundImageUrl', // 假数据
isUseBackImage: userInfo.isUseBackImage || false,
userSign: url,
})
.then((g) => {
getOneStopMyInfo();
return true;
});
}
function dataURLtoBlob(toDataURL) {
var arr = toDataURL.split(','),
......@@ -27,17 +49,17 @@ function blobToFile(Blob, fileName) {
return Blob;
}
export default class Index extends Component {
export default class Signature extends Component {
constructor(props) {
super(props);
const value = props.value;
this.state = {
url: value,
url: value || getUserInfo().userSign,
showModal: false,
};
}
triggerChange = (changedValue) => {
// Should provide an event to pass value to Form.
const onChange = this.props.onChange;
if (onChange) {
onChange(changedValue);
......@@ -46,12 +68,11 @@ export default class Index extends Component {
componentWillReceiveProps(nextProps) {
// Should be a controlled component.
if ('value' in nextProps) {
if ('value' in nextProps && nextProps.value) {
const value = nextProps.value;
this.setState({ url: value });
//
if (value !== this.state.url) {
this.setState({ url: value });
}
}
}
......@@ -73,6 +94,7 @@ export default class Index extends Component {
this.triggerChange(null);
};
trim = () => {
message.info('正在保存签名,请等待');
const formData = new FormData();
const xx = dataURLtoBlob(this.sigCanvas.toDataURL('image/png'));
const file = blobToFile(xx, 'sign.png');
......@@ -80,95 +102,196 @@ export default class Index extends Component {
return;
}
formData.append('file', file, 'sign.png');
formData.append('token', getToken());
reqwest({
url: config.uploadUrl,
method: 'post',
processData: false,
data: formData,
success: (url) => {
if (!('value' in this.props)) {
this.setState({ url: url });
}
this.triggerChange(url);
/**
* 这里的成功 是走的下面的 error
* */
// console.log('22334455');
// if (!('value' in this.props)) {
// this.setState({ url: url });
// }
// this.triggerChange(url);
//
message.success('保存成功');
},
error: (e) => {
if (e.status == 200) {
if (e.status === 200) {
const urlP = e.response;
saveSign(urlP);
message.success('保存成功');
if (!('value' in this.props)) {
this.setState({ url: e.response });
}
this.changeShowModal();
this.triggerChange(e.response);
} else {
message.error('保存失败');
}
},
});
//let trimmedCanvas = this.sigCanvas.getTrimmedCanvas();
// this.setState({trimmedDataURL: this.sigCanvas.toDataURL('image/png')})
};
componentDidMount() {
if (!this.props.value && this.state.url) {
setTimeout(() => {
this.triggerChange(this.state.url);
}, 2000);
}
}
changeShowModal = () => {
this.setState({
showModal: !this.state.showModal,
});
};
// 移动端签名组件
MobileSign = () => {
const { url } = this.state;
if (url) {
return <div className={styles.mobileSign}>
<Button type={'primary'}
onClick={this.changeShowModal}
className={styles.reSign}
>
重新签名
</Button>
<img src={config.httpServer + url} style={{}}
/>
</div>;
} else {
return <div className={styles.mobileSign2}>
<Button type={'primary'} onClick={this.changeShowModal}>
点击开始签名
</Button>
</div>;
}
};
MobileModal = () => {
const { showModal } = this.state;
const height = 300;
const width = window.screen.width - 50;
return (
showModal && <Modal className={styles.mobileModal}
width={'100vw'}
onCancel={this.changeShowModal}
visible={true}
onOk={this.trim}
title={'签名'}
bodyStyle={{
minHeight: '350px',
padding: '24px 12px',
}}
>
<div className={styles.borderDiv}>
<SignatureCanvas
penColor="black"
ref={(ref) => {
this.sigCanvas = ref;
}}
canvasProps={{
width: width + 'px',
height: height + 'px',
className: 'sigCanvas',
}}
/>
</div>
</Modal>);
};
WebModal = () => {
const { showModal } = this.state;
const height = 300;
const width = 600;
return (
showModal && <Modal className={styles.mobileModal}
width={700}
onCancel={this.changeShowModal}
visible={true}
onOk={this.trim}
title={'签名'}
bodyStyle={{
minHeight: '350px',
padding: '24px 12px',
}}
>
<div className={styles.borderDiv}>
<SignatureCanvas
penColor="black"
ref={(ref) => {
this.sigCanvas = ref;
}}
canvasProps={{
width: width + 'px',
height: height + 'px',
className: 'sigCanvas',
}}
/>
</div>
</Modal>);
};
WebSign = () => {
const {
width,
height,
} = this.props;
// console.log(this.props);
const { url } = this.state;
if (url) {
return <div className={styles.webSign}>
<Button type={'primary'}
onClick={this.changeShowModal}
>
重新签名
</Button>
<img src={config.httpServer + url} style={{
height,
width,
}}
/>
</div>;
} else {
return <div className={styles.mobileSign2}>
<Button type={'primary'} onClick={this.changeShowModal}>
点击开始签名
</Button>
</div>;
}
return null;
};
render() {
// console.log('签名组件');
const {
width,
height,
get,
} = this.props;
const { url } = this.state;
return (
<div id='canvas_signature' style={{
width: '100%',
height: '100%',
marginLeft: 5,
}}>
<div
style={{
width: width,
textAlign: 'center',
height: height,
border: '1px dashed gray',
position: 'relative',
}}>
{url ? (
<img src={config.httpServer + url} style={{
width: width,
height: height,
}} />
) : (
<SignatureCanvas
penColor='black'
ref={(ref) => {
this.sigCanvas = ref;
}}
canvasProps={{
width: width || 400,
height: height || 200,
className: 'sigCanvas',
}}
/>
)}
<div style={{
position: 'absolute',
left: 5,
bottom: 5,
}}>
{url ? (
<Button type='danger' size='small' onClick={this.delete}>
重写
</Button>
) : (
<>
<Button style={{ marginLeft: 12 }} type='danger' size='small' onClick={this.clear}>
清除
</Button>
<Button style={{ marginLeft: 12 }} onClick={this.trim} size='small' type='primary'>
保存
</Button>
</>
)}
</div>
</div>
</div>
);
if (get === 'mobile') {
// const MobileSign = this.MobileSign;
// const MobileModal = this.MobileModal;
return <>
<this.MobileSign/>
<this.MobileModal/>
</>;
} else {
return <>
<this.WebSign/>
<this.WebModal/>
</>;
}
}
}
.mobileSign2{
text-align: center;
}
.mobileModal{
//width: 100vw;
min-height: 70vh;
}
.borderDiv{
border: 1px solid #555;
margin-top: 20px;
}
.mobileSign{
position: relative;
text-align: center;
img{
max-width: 85%;
max-height: 300px;
border: 1px solid #f2f2f2;
margin-top: 10px;
}
}
.webSign{
position: relative;
text-align: left;
margin-left: 20px;
img{
border: 1px solid #f2f2f2;
}
}
......@@ -388,20 +388,23 @@ export default class ZdyTable extends Component {
}
const data = datas[tr.key];
const all = [];
for (var i = 0; i < data.items.length; i++) {
const row = data.items[i];
const r = [];
for (var j = 0; j < row.length; j++) {
const col = row[j];
if (col.content?.comName == 'Excel') {
r.push(col.content.initialValue);
} else {
r.push('');
if(data && data.item){
for (var i = 0; i < data.items.length; i++) {
const row = data.items[i];
const r = [];
for (var j = 0; j < row.length; j++) {
const col = row[j];
if (col.content?.comName == 'Excel') {
r.push(col.content.initialValue);
} else {
r.push('');
}
}
all.push(r);
}
all.push(r);
}
sheetData[tr.title] = all;
};
configs;
......@@ -834,7 +837,7 @@ export default class ZdyTable extends Component {
<table
style={{
overflow: 'auto',
margin: max * width > 550 ? 'auto' : '',
margin: max * width > 550 ? '1px auto' : '', // 禅道 27868
marginBottom: isWebPrint ? (isWebPrintEnd ? '5px' : 0) : '1px',
...style,
}}
......@@ -852,11 +855,16 @@ export default class ZdyTable extends Component {
return;
}
if (cell.uuid) {
// debugger;
cell.content = {
...cell.content,
...getActiveJson(currentFormKey, cell.uuid),
};
if(cell.content){
cell.content = {
...cell.content,
...getActiveJson(currentFormKey, cell.uuid),
};
if(window.zdyTableTemplateWillMountProps?.allDisabled){
cell.content.disabled = true;
}
}
// 27282 双选会报名后管理员修改举办时间 但是单位申请信息么有随着更新
}
......
export default function getActiveJson(formKey = '', uuid = ''){
if(!formKey || !uuid){
return {};
return undefined;
}
if(window.smartFormGlobalProps?.activeJsonConfig && window.smartFormGlobalProps.activeJsonConfig[formKey]){
return window.smartFormGlobalProps.activeJsonConfig[formKey][uuid] || {};
return window.smartFormGlobalProps.activeJsonConfig[formKey][uuid] || undefined;
}
return {};
return undefined;
}
import React from 'react';
import moment from 'moment';
import { Modal, message, notification, Tooltip, Spin, Popover, Popconfirm } from 'antd';
import md5 from 'js-md5';
import { giveFilePostDataInfoForTrue } from '@/webPublic/one_stop_public/Base16';
import {
getSpanJson,
getColumns,
getColumnsDataRealize,
getColumnsSqlKeyRealize,
getWord,
renderContentAll,
renderContentRow,
getSpanJson,
getColumns,
getColumnsDataRealize,
getColumnsSqlKeyRealize,
getWord,
getFileAndShow,
renderContentAll,
renderContentRow, downloadFile, getListWord
} from './globalFunction';
import { getTransformApi } from '@/webPublic/one_stop_public/2022beidianke/localstorageTransform';
export function giveSmartFormGlobalProps({
fromStart = false,
hasSingle = false,
isHandle = false,
onlyRead = false, // 是否此表单所有组件只读
taskCells = [],
data = {},
nextUsers = {}, //
calculateFlowData = [], // 移动端使用 用于分块块 禅道 23933 移动端全表单后审核步骤的显示问题优化
}) {
window.smartFormGlobalProps = {
fromStart,
hasSingle,
isHandle,
taskCells,
data,
nextUsers,
calculateFlowData,
onlyRead,
apiList: {
giveFilePostDataInfoForTrue,
getSpanJson,
getColumns,
getColumnsDataRealize,
getColumnsSqlKeyRealize,
getWord,
renderContentAll,
renderContentRow,
remark: {
'giveFilePostDataInfoForTrue(params, url) ': `将接口参数 二进制文件化 并返回新的接口地址与参数';`,
'getSpanJson(mergeKey, data, eliminateStr)': `列表获取纵向合并数据 ;参数-> mergeKey : 需要合并的表头key data : 列表数据 eliminateStr : 需要忽略合并的数据`,
'getColumns(columns)': `获取ant表头的属性 ;参数->columns : ant的表头`,
'getColumnsDataRealize({data, mergeKey, columns, styles, defect, fileName, ext , eliminateStr})': `下载列表合并的数据;参数-> 前三个必填data, mergeKey, columns`,
'getColumnsSqlKeyRealize({sqlKey, columns, styles, fileName, ext})': `下载列表表头合并的数据;参数->前两个个必填sqlKey, columns`,
'getWord({templatePath,params, title, allValues, listConfig, ext})': `下载文档地址 ;参数->前五个必填 templatePath,params, title, allValues, listConfig`,
'renderContentAll(value, row, index, key, spanData, cloumnNames) ': `ant表头横向、纵向合并 ;参数->所有必填 value, row, index, key, spanData, cloumnNames 实例:render:(value, row, index)=>{return renderContentAll(value, row, index,"inst_name",spanData,cloumnNames)}`,
'renderContentRow(value, row, index, key, spanData, cloumnNames) ': `ant表头纵向合并 ;参数->所有必填 value, row, index, key, spanData, cloumnNames 实例:render:(value, row, index)=>{return renderContentRow(value, row, index,"inst_name",spanData,cloumnNames)}`,
},
},
activeJsonConfig: {
}, // 27282 双选会报名后管理员修改举办时间 但是单位申请信息么有随着更新
publicComponent: {
React,
Modal,
message,
notification,
Tooltip,
Spin,
Popover,
Popconfirm,
moment,
},
};
return true;
fromStart = false,
hasSingle = false,
isHandle = false,
onlyRead = false, // 是否此表单所有组件只读
taskCells = [],
data = {},
nextUsers = {}, //
calculateFlowData = [], // 移动端使用 用于分块块 禅道 23933 移动端全表单后审核步骤的显示问题优化
}) {
window.smartFormGlobalProps = {
fromStart,
hasSingle,
isHandle,
taskCells,
data,
nextUsers,
calculateFlowData,
onlyRead,
apiList: {
giveFilePostDataInfoForTrue,
getSpanJson,
getColumns,
getColumnsDataRealize,
getColumnsSqlKeyRealize,
getWord,
getFileAndShow,
getListWord,
downloadFile,
renderContentAll,
renderContentRow,
getTransformApi,
md5,
remark: {
downloadFile: '下载文件函数.',
'giveFilePostDataInfoForTrue(params, url) ':
`将接口参数 二进制文件化 并返回新的接口地址与参数';`,
'getSpanJson(mergeKey, data, eliminateStr)':
`列表获取纵向合并数据 ;参数-> mergeKey : 需要合并的表头key data : 列表数据 eliminateStr : 需要忽略合并的数据`,
'getColumns(columns)':
`获取ant表头的属性 ;参数->columns : ant的表头`,
'getColumnsDataRealize({data, mergeKey, columns, styles, defect, fileName, ext , eliminateStr})':
`下载列表合并的数据;参数-> 前三个必填data, mergeKey, columns`,
'getColumnsSqlKeyRealize({sqlKey, columns, styles, fileName, ext})':
`下载列表表头合并的数据;参数->前两个个必填sqlKey, columns`,
'getWord({templatePath,params, title, allValues, listConfig, ext})':
`下载文档地址 ;参数->前五个必填 templatePath,params, title, allValues, listConfig`,
'getFileAndShow({templatePath,params, title, allValues, listConfig, ext})':
`下载一个文件并直接展示出来地址 ;参数->前五个必填 templatePath,params, title, allValues, listConfig`,
'getListWord({templatePath,paramsList, title,sonTitleKey, allValuesKey, listConfig, ext,sonExt})':
`批量下载文档地址 ;参数->前五个必填 templatePath,paramsList, title,sonTitleKey, allValuesKey`,
'renderContentAll(value, row, index, key, spanData, cloumnNames) ':
`ant表头横向、纵向合并 ;参数->所有必填 value, row, index, key, spanData, cloumnNames 实例:render:(value, row, index)=>{return renderContentAll(value, row, index,"inst_name",spanData,cloumnNames)}`,
'renderContentRow(value, row, index, key, spanData, cloumnNames) ':
`ant表头纵向合并 ;参数->所有必填 value, row, index, key, spanData, cloumnNames 实例:render:(value, row, index)=>{return renderContentRow(value, row, index,"inst_name",spanData,cloumnNames)}`,
'getTransformApi': '接口转换函数用于一站式接口地址加密',
md5: 'md5加密函数',
},
},
activeJsonConfig: {}, // 27282 双选会报名后管理员修改举办时间 但是单位申请信息么有随着更新
publicComponent: {
React,
Modal,
message,
notification,
Tooltip,
Spin,
Popover,
Popconfirm,
moment,
},
};
return true;
}
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论