提交 93c4167d authored 作者: 姚鑫国's avatar 姚鑫国
...@@ -32,24 +32,6 @@ export default class AffairPage extends React.Component { ...@@ -32,24 +32,6 @@ export default class AffairPage extends React.Component {
message.error('您的数据未同步,请联系管理员!'); message.error('您的数据未同步,请联系管理员!');
return false; return false;
} }
// window.addEventListener(
// 'message',
// (event) => {
// // 和Iframe页进行通迅
// if (event.data === 'returnList') {
// this.returnList(true);
// }
// if (event && event.data && event.data.indexOf && event.data.indexOf('iframeHeight') > -1) {
// let height = Number(event.data.split('-')[1]);
// const iframe = document.getElementById('applyIframeId');
// if (iframe) {
// iframe.height = height;
// }
// }
// },
// false,
// );
return true; return true;
} }
...@@ -89,26 +71,8 @@ export default class AffairPage extends React.Component { ...@@ -89,26 +71,8 @@ export default class AffairPage extends React.Component {
{...this.props} {...this.props}
id={workId} id={workId}
returnList={this.returnList} returnList={this.returnList}
init={encodeURIComponent(JSON.stringify(init))} init={init}
/> />
{/* <iframe
src={iframeUrl}
frameBorder={0}
id="applyIframeId"
name="applyIframe"
marginWidth="0"
marginHeight="0"
allowtransparency="yes"
seamless
scrolling={'auto'}
style={{
width: '100%',
minHeight: '800px',
overflowY: 'hidden',
backgroundColor: '#fff',
}}
/>*/}
: null
</div> </div>
</PageHeaderWrapper> </PageHeaderWrapper>
); );
......
...@@ -241,9 +241,9 @@ export default class ImportUtil extends React.PureComponent { ...@@ -241,9 +241,9 @@ export default class ImportUtil extends React.PureComponent {
fetch(transformApi, { fetch(transformApi, {
method: 'POST', method: 'POST',
body: FormdataWrapper(newParams.datas), body: FormdataWrapper(newParams.datas),
headers: { // headers: {
apis: headersApi, // apis: headersApi,
}, // },
}) })
.then((res) => { .then((res) => {
console.log(res.status); console.log(res.status);
......
...@@ -35,10 +35,11 @@ function giveKey(key, datas) { ...@@ -35,10 +35,11 @@ function giveKey(key, datas) {
} }
export async function countAllValues(datas, item) { export async function countAllValues(datas, item) {
// console.log(datas);
if (item.setNull) { if (item.setNull) {
datas.allValues = JSON.stringify({}); datas.allValues = JSON.stringify({});
} else { } else {
if (item.query) { if (item.query && !datas.isMeta) {
if (datas?.sqlKey.length < 13) { if (datas?.sqlKey.length < 13) {
const response = await apiRequest('/SqlManageEntityApi/findParamsKey', { const response = await apiRequest('/SqlManageEntityApi/findParamsKey', {
sqlKey: datas.sqlKey, sqlKey: datas.sqlKey,
......
...@@ -8,7 +8,8 @@ import { countAllValues } from '@/webPublic/one_stop_public/Base16/SplitBase16In ...@@ -8,7 +8,8 @@ import { countAllValues } from '@/webPublic/one_stop_public/Base16/SplitBase16In
import { getUrlInfo } from '@/webPublic/one_stop_public/DetailForAudit/utils'; import { getUrlInfo } from '@/webPublic/one_stop_public/DetailForAudit/utils';
import { getTransformApi } from '@/webPublic/one_stop_public/2022beidianke/localstorageTransform'; import { getTransformApi } from '@/webPublic/one_stop_public/2022beidianke/localstorageTransform';
import { strToBinary } from './strToBinary'; // 字符串转二进制 混淆代码 import { strToBinary } from './strToBinary'; // 字符串转二进制 混淆代码
import { binaryToStr } from './binaryToStr'; // 二进制字符串转JSON字符串 混淆代码 import { binaryToStr } from './binaryToStr';
import { getVisitorToken } from '@/webPublic/zyd_public/utils/getHeaders'; // 二进制字符串转JSON字符串 混淆代码
const test = !!(getUrlInfo().test); const test = !!(getUrlInfo().test);
...@@ -93,8 +94,8 @@ export async function requestFileInfo(url, datas) { ...@@ -93,8 +94,8 @@ export async function requestFileInfo(url, datas) {
// datas = await testPromise(datas); // datas = await testPromise(datas);
// } // }
const formData = new FormData(); const formData = new FormData();
if (getToken()) { if (getVisitorToken()) {
datas.token = getToken(); datas.token = getVisitorToken();
} }
for (let key in datas) { for (let key in datas) {
formData.append(key, datas[key]); formData.append(key, datas[key]);
...@@ -115,7 +116,7 @@ export async function requestFileInfo(url, datas) { ...@@ -115,7 +116,7 @@ export async function requestFileInfo(url, datas) {
headers: { headers: {
Accept: 'application/json', Accept: 'application/json',
...getHeaders(transformApi).headers, ...getHeaders(transformApi).headers,
apis: headersApi, // apis: headersApi,
// axxx: `select * from user123 where id = 1`, // axxx: `select * from user123 where id = 1`,
}, },
method: 'POST', method: 'POST',
......
...@@ -3,21 +3,21 @@ ...@@ -3,21 +3,21 @@
* 2019年9月19日 * 2019年9月19日
* 查看详情页面 * 查看详情页面
*/ */
import React, { Component, Fragment } from 'react'; import React, { Component, Fragment, useEffect, useState } from 'react';
import { import {
Row, Row,
Col, Col,
Timeline, Timeline,
Icon, Icon,
Form, Form,
Button, Button,
Spin, Spin,
Radio, Radio,
Popconfirm, Popconfirm,
Checkbox, Checkbox,
Switch, Switch,
InputNumber, InputNumber,
message, message,
} from 'antd'; } from 'antd';
import Card from './components/Card'; import Card from './components/Card';
import { getToken } from '@/webPublic/one_stop_public/utils/token'; import { getToken } from '@/webPublic/one_stop_public/utils/token';
...@@ -36,952 +36,983 @@ import styles from './styles.less'; ...@@ -36,952 +36,983 @@ import styles from './styles.less';
import TrunToDetail from './trunToDetail'; import TrunToDetail from './trunToDetail';
import Countersign from './components/Countersign'; import Countersign from './components/Countersign';
import ChildTaskModel from './ChildTaskModel'; import ChildTaskModel from './ChildTaskModel';
import { checkNeedFormValidateFieldsAndScroll, must, submitValues, checkNeedWriteAuditInfo } from './splitDetailSplit'; import {
checkNeedFormValidateFieldsAndScroll,
must,
submitValues,
checkNeedWriteAuditInfo,
} from './splitDetailSplit';
import { queryApiVersion, queryApiActionPath } from '@/webPublic/one_stop_public/utils/queryConfig'; import { queryApiVersion, queryApiActionPath } from '@/webPublic/one_stop_public/utils/queryConfig';
import { isJSON } from '@/webPublic/zyd_public/utils/utils'; import { isJSON } from '@/webPublic/zyd_public/utils/utils';
import HistoryFormList from '@/webPublic/one_stop_public/DetailForAudit/HistoryFormList'; import HistoryFormList from '@/webPublic/one_stop_public/DetailForAudit/HistoryFormList';
@connect() @connect()
class DetailSplit extends Component { class DetailSplit extends Component {
constructor() { constructor() {
super(); super();
this.state = { this.state = {
isTakeFlow: false, isTakeFlow: false,
data: {}, // 详情数据 data: {}, // 详情数据
stepFlow: [], stepFlow: [],
items: [], items: [],
obj: {}, obj: {},
isSecond: false, // 如果为true,表示重新发起 isSecond: false, // 如果为true,表示重新发起
selects: new Map(), selects: new Map(),
left: 0, left: 0,
top: 0, top: 0,
max: 4, max: 4,
width: 100, width: 100,
taskId: '', // 模型id taskId: '', // 模型id
appId: '', // 事务id appId: '', // 事务id
code: '', // 事务code 当前表单唯一值 code: '', // 事务code 当前表单唯一值
isHandle: false, // 判断用户是否有权限 isHandle: false, // 判断用户是否有权限
id: '', // 表单id id: '', // 表单id
btns: [], // 自定义按钮 btns: [], // 自定义按钮
taskFormKey: '', // 多表单显示的key taskFormKey: '', // 多表单显示的key
itemsOK: [], // 多表单显示的表单 itemsOK: [], // 多表单显示的表单
hisTaskFormKeys: {}, // 历史任务相关 hisTaskFormKeys: {}, // 历史任务相关
isLoading: false, // 请求状态 isLoading: false, // 请求状态
formColor: '', // 流程紧急度颜色 formColor: '', // 流程紧急度颜色
formLevel: '', // 流程文本 formLevel: '', // 流程文本
btnList: [], // 紧急度按钮返回数据 btnList: [], // 紧急度按钮返回数据
radiovalue: '', // 单选id radiovalue: '', // 单选id
isEnd: false, // 是否结束 isEnd: false, // 是否结束
isShowTitle: true, // 是否展示流程步骤几个字 isShowTitle: true, // 是否展示流程步骤几个字
isSumbitLoading: false, // 发起时触发 isSumbitLoading: false, // 发起时触发
isOpenTrunToModel: false, // 用户转办,回收弹框控制变量 isOpenTrunToModel: false, // 用户转办,回收弹框控制变量
trunToStatus: '转办', // 当前节点存在状态 trunToStatus: '转办', // 当前节点存在状态
trunData: '', // 转办当前选中数据 trunData: '', // 转办当前选中数据
isCloseUserDetail: false, // 是否展示用户基础详细信息 isCloseUserDetail: false, // 是否展示用户基础详细信息
checkedConfimList: [], // 用户选择打印元素 checkedConfimList: [], // 用户选择打印元素
checkListOptions: [], // 历史表单复选框存放值 checkListOptions: [], // 历史表单复选框存放值
isShowTitleTwo: true, // 历史表单展示状态 isShowTitleTwo: true, // 历史表单展示状态
paddingBottom: 0, paddingBottom: 0,
isSign: false, // 是否使用签名 isSign: false, // 是否使用签名
userInfo: '', // 得到用户数据 userInfo: '', // 得到用户数据
setData: '', // 配置的数据 setData: '', // 配置的数据
countersignModal: '', // 开启加签弹框函数 countersignModal: '', // 开启加签弹框函数
isAllPrint: false, isAllPrint: false,
closeAutoSign: false, // 28521 退役大学生评优管理/在校退役大学生评优审核,去掉审核签名 closeAutoSign: false, // 28521 退役大学生评优管理/在校退役大学生评优审核,去掉审核签名
}; };
window.callbackSubmitInfoZhiYong = undefined; window.callbackSubmitInfoZhiYong = undefined;
} }
/** /**
* @function 同步加签函数 * @function 同步加签函数
* @param { function } func 打开加签弹框函数 * @param { function } func 打开加签弹框函数
*/ */
updateCountersignModal = func => { updateCountersignModal = (func) => {
this.setState({ this.setState({
countersignModal: func, countersignModal: func,
}); });
}; };
/** /**
* 关闭转办,回收弹框 * 关闭转办,回收弹框
*/ */
handleTrunToModel = () => { handleTrunToModel = () => {
this.setState({ this.setState({
isOpenTrunToModel: false, isOpenTrunToModel: false,
trunData: '', trunData: '',
trunToStatus: '', trunToStatus: '',
}); });
}; };
/** /**
* 打开转办,回收弹框 * 打开转办,回收弹框
* @param { string } text 当前按钮状态 * @param { string } text 当前按钮状态
*/ */
showTrunToModel = (text, record) => { showTrunToModel = (text, record) => {
this.setState({ this.setState({
isOpenTrunToModel: true, isOpenTrunToModel: true,
trunToStatus: text, trunToStatus: text,
trunData: record, trunData: record,
}); });
}; };
examineFlow = (...ags) => { examineFlow = (...ags) => {
this.flowExamineModal.showModal(...ags); this.flowExamineModal.showModal(...ags);
}; };
componentDidMount() { componentDidMount() {
this.getInit(); this.getInit();
if (this.props.onRef) { if (this.props.onRef) {
this.props.onRef(this); this.props.onRef(this);
} }
} }
/** /**
* @function 默认请求 * @function 默认请求
*/ */
getInit = handleUser => { getInit = (handleUser) => {
const { dispatch } = this.props; const { dispatch, formPrepareData } = this.props;
const id = this.props.history.location.state && this.props.history.location.state.id; const id = this.props.history.location.state && this.props.history.location.state.id;
const code = this.props.history.location.state && this.props.history.location.state.code; const code = this.props.history.location.state && this.props.history.location.state.code;
const queryId = this.props.history.location.query && this.props.history.location.query.id; const queryId = this.props.history.location.query && this.props.history.location.query.id;
const taskId = this.props.history.location.state && this.props.history.location.state.taskId; const taskId = this.props.history.location.state && this.props.history.location.state.taskId;
if (!id && !code) { if (!id && !code) {
if (queryId) { if (queryId) {
} else { } else {
openToast('error', '数据已过期', '当前页面数据已过期,请重新进入'); openToast('error', '数据已过期', '当前页面数据已过期,请重新进入');
router.push('/portal/home'); router.push('/portal/home');
return; return;
} }
} }
const val = formPrepareData;
dispatch({ if (val) {
type: 'affair/getIdFormDetail', if (this.props.changeData) {
payload: { this.props.changeData(val);
id: queryId ? queryId : id, // 审批表Id }
code: code || null, // 表单值 const checkListOptions = [];
handleUser: handleUser || null, // 处理人 const checkedConfimList = [];
taskId, // 多任务流程会使用到,后续改为必须传入 if (val.hisTaskForm.formKeys) {
lite: true, val.hisTaskForm.formKeys.map((item) => {
}, checkListOptions.push({
callback: val => { label: item.taskName,
if (this.props.changeData) { value: item.formKey,
this.props.changeData(val); });
} });
const checkListOptions = []; }
const checkedConfimList = []; if (val && !val.taskInfo) {
if (val.hisTaskForm.formKeys) { permRequest('/UnifiedAppFormApi/getTaskInfos', {
val.hisTaskForm.formKeys.map(item => { // 获取每一步的审核人.
checkListOptions.push({ id: queryId ? queryId : id, // 审批表Id
label: item.taskName, code: code || null, // 表单值
value: item.formKey, }).then((res) => {
}); val.taskInfo = res.taskInfo;
}); this.setState(
} {
if (val && !val.taskInfo) { data: val,
permRequest('/UnifiedAppFormApi/getTaskInfos', { // 获取每一步的审核人. stepFlow: val.taskInfo,
id: queryId ? queryId : id, // 审批表Id obj: JSON.parse(val.content),
code: code || null, // 表单值 code: val.code,
}) taskId: val.taskId,
.then(res => { isSecond: val.isSecond ? val.isSecond : false,
val.taskInfo = res.taskInfo; appId: val.appId,
this.setState( code: val.code,
{ isHandle: val.isHandle,
data: val, id,
stepFlow: val.taskInfo, btns: val.btns,
obj: JSON.parse(val.content), taskFormKey: val.taskFormKey,
code: val.code, hisTaskFormKeys: val.hisTaskForm,
taskId: val.taskId, isLoading: true,
isSecond: val.isSecond ? val.isSecond : false, formColor: val.formColor,
appId: val.appId, formLevel: val.formLevel,
code: val.code, isEnd: val.isEnd,
isHandle: val.isHandle, checkListOptions,
id, checkedConfimList,
btns: val.btns, },
taskFormKey: val.taskFormKey, () => {
hisTaskFormKeys: val.hisTaskForm, if (val.isSecond) {
isLoading: true, this.props.dispatch({
formColor: val.formColor, type: 'urge/GetMyBtn',
formLevel: val.formLevel, payload: {},
isEnd: val.isEnd, callback: (arr) => {
checkListOptions, this.setState(
checkedConfimList, {
}, btnList: arr,
() => { radiovalue: val.formLevelId ? val.formLevelId : arr[arr.length - 1].id,
if (val.isSecond) { },
this.props.dispatch({ () => {
type: 'urge/GetMyBtn', // this.giveMessageTop();
payload: {}, },
callback: arr => { );
this.setState({ },
btnList: arr, });
radiovalue: val.formLevelId ? val.formLevelId : arr[arr.length - 1].id, } else {
}, () => { // this.giveMessageTop();
// this.giveMessageTop(); }
}); },
}, );
}); });
} else { }
// this.giveMessageTop(); }
} dispatch({
}, type: 'emailorphone/GetLogo',
); payload: {
configKeys: ['isCloseUserDetail', 'isCloseFlowPath', 'isAllPrint', 'closeAutoSign'],
}); },
} callback: (val) => {
const closeAutoSign = !!(val[3] && val[3].configValue === 'true');
this.setState({
}, isCloseUserDetail: !!(val[0] && val[0].configValue === 'true'),
}); isAllPrint: !!(val[2] && val[2].configValue === 'true'),
closeAutoSign,
dispatch({ });
type: 'emailorphone/GetLogo',
payload: { if (!closeAutoSign) {
configKeys: ['isCloseUserDetail', 'isCloseFlowPath', 'isAllPrint', 'closeAutoSign'], /**
}, * 获取设置的数据
callback: val => { */
const closeAutoSign = !!(val[3] && val[3].configValue === 'true'); this.props.dispatch({
this.setState({ type: 'UserSetCenterApi/queryUserSet',
isCloseUserDetail: !!(val[0] && val[0].configValue === 'true'), payload: {},
isAllPrint: !!(val[2] && val[2].configValue === 'true'), callback: (val) => {
closeAutoSign, this.setState({
}); setData: val,
});
if(!closeAutoSign){ },
/** });
* 获取设置的数据 }
*/
this.props.dispatch({ if (val[1]?.configValue) {
type: 'UserSetCenterApi/queryUserSet', sessionStorage.setItem(
payload: {}, 'isCloseFlowPath',
callback: val => { val[1]?.configValue === 'true' ? JSON.stringify(true) : JSON.stringify(false),
this.setState({ );
setData: val, }
}); },
}, });
}); if (getToken()) {
} const user = localStorage.getItem('user');
if (user && isJSON(user)) {
if (val[1]?.configValue) { this.setState({
sessionStorage.setItem( userInfo: JSON.parse(user),
'isCloseFlowPath', });
val[1]?.configValue === 'true' ? JSON.stringify(true) : JSON.stringify(false), }
); }
} };
},
}); /**
if (getToken()) { * @function 用户点击确认执行相应操作
const user = localStorage.getItem('user'); * @description: 注意 用户点击状态时在点击动态配置按钮时进行了保存,并在该函数中最终提交给后端
if (user && isJSON(user)) { * @param { string } oldkey 按钮状态
this.setState({ * @param { string } btnValue 按钮选中状态
userInfo: JSON.parse(user), * @param { string } value 审批理由
}); * @param { boolean } checked 加签状态
} * @param { function } callback 回调函数
} */
affairOk = (oldkey, btnValue, value, checked, callback) => {
}; const { dispatch } = this.props;
const { radiovalue, isSecond, userInfo, setData, data, btns, taskId, code } = this.state;
const { handleUser } = this.props.history.location.state;
/** const isCloseFlowPath = sessionStorage.getItem('isCloseFlowPath')
* @function 用户点击确认执行相应操作 ? JSON.parse(sessionStorage.getItem('isCloseFlowPath'))
* @description: 注意 用户点击状态时在点击动态配置按钮时进行了保存,并在该函数中最终提交给后端 : false;
* @param { string } oldkey 按钮状态 if (callback) {
* @param { string } btnValue 按钮选中状态 callback();
* @param { string } value 审批理由 }
* @param { boolean } checked 加签状态
* @param { function } callback 回调函数 let checkSumbitInfo = checkNeedFormValidateFieldsAndScroll({
*/ // 检查是否必填表单值
affairOk = (oldkey, btnValue, value, checked, callback) => { btns,
const { dispatch } = this.props; btnValue,
const { });
radiovalue,
isSecond, let needWriteAuditInfo = checkNeedWriteAuditInfo({
userInfo, // 检查是否必填审批理由
setData, btns,
data, btnValue,
btns, });
taskId, if (needWriteAuditInfo && !value) {
code, let d = document.getElementById('textarea_shen_pi_li_you');
} = this.state; if (d) {
const { handleUser } = this.props.history.location.state; message.warning('请输入审批理由');
const isCloseFlowPath = sessionStorage.getItem('isCloseFlowPath') return false;
? JSON.parse(sessionStorage.getItem('isCloseFlowPath')) }
: false; }
if (callback) { const argumentsSubmitValue = {
callback(); isCloseFlowPath,
} radiovalue,
isSecond,
let checkSumbitInfo = checkNeedFormValidateFieldsAndScroll({ // 检查是否必填表单值 taskId,
btns, code,
btnValue, btnValue,
}); oldkey,
value,
let needWriteAuditInfo = checkNeedWriteAuditInfo({ // 检查是否必填审批理由 checked,
btns, setData,
btnValue, data,
}); userInfo,
if (needWriteAuditInfo && !value) { btns,
let d = document.getElementById('textarea_shen_pi_li_you'); dispatch,
if (d) { that: this,
message.warning('请输入审批理由'); handleUser,
return false; };
}
} if (!checkSumbitInfo) {
const argumentsSubmitValue = { // 如果不需要校验 直接提交数据
isCloseFlowPath, const values = this.props.form.getFieldsValue();
radiovalue, argumentsSubmitValue.values = values;
isSecond, submitValues(argumentsSubmitValue);
taskId, } else {
code, this.props.form.validateFieldsAndScroll((err, values) => {
btnValue, // 校验是否填了必填字段
oldkey, if (!err) {
value, argumentsSubmitValue.values = values;
checked, submitValues(argumentsSubmitValue);
setData, }
data, });
userInfo, }
btns, };
dispatch,
that: this, onChange = (e) => {
handleUser, this.setState({
}; radiovalue: e.target.value,
});
if (!checkSumbitInfo) { // 如果不需要校验 直接提交数据 };
const values = this.props.form.getFieldsValue();
argumentsSubmitValue.values = values; /**
submitValues(argumentsSubmitValue); * @function 复选框状态函数
} else { * @event change
this.props.form.validateFieldsAndScroll((err, values) => { // 校验是否填了必填字段 */
if (!err) { onCheckChange = (checkedValues) => {
argumentsSubmitValue.values = values; this.setState({
submitValues(argumentsSubmitValue); checkedConfimList: checkedValues,
} });
}); };
} /**
* @function 加签点击函数
* @event click
}; */
onClickCountersign = () => {
onChange = e => { const { countersignModal } = this.state;
this.setState({ countersignModal();
radiovalue: e.target.value, };
}); /**
}; * @function 通过用户复选框选择拼装为对应打印页面
*/
/**
* @function 复选框状态函数 changeTake = (checked) => {
* @event change this.setState({ isTakeFlow: checked });
*/ };
onCheckChange = checkedValues => {
this.setState({ changePadding = (value) => {
checkedConfimList: checkedValues, this.setState({ paddingBottom: value });
}); };
};
/** render() {
* @function 加签点击函数 const {
* @event click stepFlow,
*/ isHandle,
onClickCountersign = () => { hisTaskFormKeys,
const { countersignModal } = this.state; id,
countersignModal(); appId,
}; code,
/** steps,
* @function 通过用户复选框选择拼装为对应打印页面 data,
*/ btns,
isSecond,
changeTake = checked => { isLoading,
this.setState({ isTakeFlow: checked }); formColor,
}; formLevel,
btnList,
changePadding = value => { radiovalue,
this.setState({ paddingBottom: value }); isEnd,
}; isShowTitle,
isSumbitLoading,
isOpenTrunToModel,
render() { trunToStatus,
const { trunData,
stepFlow, isCloseUserDetail,
isHandle, checkListOptions,
hisTaskFormKeys, checkedConfimList,
id, isTakeFlow,
appId, paddingBottom,
code, setData,
steps, isSign,
data, isAllPrint,
btns, closeAutoSign, // 28521 退役大学生评优管理/在校退役大学生评优审核,去掉审核签名
isSecond, } = this.state;
isLoading, const { showPrint } = this.props;
formColor, const isCloseFlowPath = sessionStorage.getItem('isCloseFlowPath')
formLevel, ? JSON.parse(sessionStorage.getItem('isCloseFlowPath'))
btnList, : false;
radiovalue, const isTrunTo = sessionStorage.getItem('isTrunTo')
isEnd, ? JSON.parse(sessionStorage.getItem('isTrunTo'))
isShowTitle, : false;
isSumbitLoading, const domainName = sessionStorage.getItem('domainName')
isOpenTrunToModel, ? sessionStorage.getItem('domainName')
trunToStatus, : '';
trunData, const routerState = {
isCloseUserDetail, history: this.props?.history,
checkListOptions, location: this.props?.location,
checkedConfimList, match: this.props?.match,
isTakeFlow, computedMatch: this.props?.computedMatch,
paddingBottom, route: this.props?.route,
setData, };
isSign,
isAllPrint, // console.log(data, isAllPrint);
closeAutoSign, // 28521 退役大学生评优管理/在校退役大学生评优审核,去掉审核签名 return (
} = this.state; <Fragment>
const { showPrint } = this.props; <div
const isCloseFlowPath = sessionStorage.getItem('isCloseFlowPath') style={{
? JSON.parse(sessionStorage.getItem('isCloseFlowPath')) width: '100%',
: false; display: 'flex',
const isTrunTo = sessionStorage.getItem('isTrunTo') justifyContent: 'center',
? JSON.parse(sessionStorage.getItem('isTrunTo')) }}>
: false; <div style={{ width: '100%' }}>
const domainName = sessionStorage.getItem('domainName') <div
? sessionStorage.getItem('domainName') className={styles.header}
: ''; style={{
const routerState = { position: 'relative',
history: this.props?.history, }}>
location: this.props?.location, {isCloseFlowPath ? null : ( // 关闭流程紧急度显示
match: this.props?.match, <span
computedMatch: this.props?.computedMatch, style={{
route: this.props?.route, position: 'absolute',
}; left: 0,
top: '30%',
// console.log(data, isAllPrint); }}>
return ( {isSecond ? (
<Fragment> <>
<div <span style={{ marginRight: 12 }}>
style={{ {must}
width: '100%', 流程紧急度
display: 'flex', </span>
justifyContent: 'center', <Radio.Group onChange={this.onChange} value={radiovalue}>
}} {btnList.length > 0
> ? btnList.map((item) => (
<div style={{ width: '100%' }}> <Radio key={item.id + Math.random()} value={item.id}>
<div <span style={{ color: item.color }}>{item.name}</span>
className={styles.header} </Radio>
style={{ ))
position: 'relative', : ''}
}} </Radio.Group>
> </>
{isCloseFlowPath ? null : ( // 关闭流程紧急度显示 ) : (
<span <>
style={{ 紧急程度:
position: 'absolute', <span
left: 0, style={{
top: '30%', color: formColor || '',
}} marginLeft: 21,
> }}>
{isSecond ? ( {formLevel || '暂无'}
<> </span>
<span style={{ marginRight: 12 }}>{must}流程紧急度</span> </>
<Radio.Group onChange={this.onChange} value={radiovalue}> )}
{btnList.length > 0 </span>
? btnList.map(item => ( )}
<Radio key={item.id + Math.random()} value={item.id}>
<span style={{ color: item.color }}>{item.name}</span> {data.appName ? data.appName : '当前表单'}
</Radio> {(isEnd || isAllPrint) && showPrint !== false ? (
)) <>
: ''} <Popconfirm
</Radio.Group> onConfirm={() => {
</> if (!checkedConfimList || !checkedConfimList.length) {
) : ( message.warning('请选择需要打印的表单');
<> return false;
紧急程度: }
<span if (domainName) {
style={{ window.open(
color: formColor || '', `${domainName}/protal/printRouter?id=${data.id}&list=${JSON.stringify(
marginLeft: 21, checkedConfimList,
}} )}&padding=${paddingBottom}&isTakeFlow=${isTakeFlow}&token=${getToken()}`,
> );
{formLevel || '暂无'} } else {
</span> openToast('warning', '未配置域名地址,请联系管理员');
</> }
)} }}
</span> title={
)} <div>
<div>
{data.appName ? data.appName : '当前表单'} 是否带流程:
{(isEnd || isAllPrint) && showPrint !== false ? ( <Switch checked={isTakeFlow} onChange={this.changeTake} />
<> </div>
<Popconfirm <div>
onConfirm={() => { 表单间距:
if (!checkedConfimList || !checkedConfimList.length) { <InputNumber
message.warning('请选择需要打印的表单'); min={0}
return false; size="small"
} value={paddingBottom}
if (domainName) { onChange={this.changePadding}
window.open( />
`${domainName}/protal/printRouter?id=${data.id}&list=${JSON.stringify( </div>
checkedConfimList, <div className={styles.history_form_title}>请选择需要打印的表单</div>
)}&padding=${paddingBottom}&isTakeFlow=${isTakeFlow}&token=${getToken()}`, <div className={styles.history_form_body_div}>
); <Checkbox.Group
} else { options={checkListOptions}
openToast('warning', '未配置域名地址,请联系管理员'); onChange={this.onCheckChange}
} defaultValue={checkedConfimList}
}} />
title={ </div>
<div> </div>
<div> }
是否带流程: okText="确定"
<Switch checked={isTakeFlow} onChange={this.changeTake} /> cancelText="取消">
</div> {(data.isPrint == null || data.isPrint || isAllPrint) && showPrint !== false ? (
<div> <Button
表单间距: style={{
<InputNumber position: 'absolute',
min={0} right: 200,
size='small' top: '30%',
value={paddingBottom} }}
onChange={this.changePadding} type="primary">
/> 打印预览
</div> </Button>
<div className={styles.history_form_title}>请选择需要打印的表单</div> ) : (
<div className={styles.history_form_body_div}> ''
<Checkbox.Group )}
options={checkListOptions} </Popconfirm>
onChange={this.onCheckChange} </>
defaultValue={checkedConfimList} ) : (
/> ''
</div> )}
</div> </div>
} </div>
okText='确定' </div>
cancelText='取消' {isLoading ? (
> <>
{(data.isPrint == null || data.isPrint || isAllPrint) && showPrint !== false ? ( <Card style={{ width: '100%' }}>
<Button {!isCloseUserDetail && (
style={{ <div className={styles.body_hea}>
position: 'absolute', <h3>发起人信息</h3>
right: 200, {data &&
top: '30%', (data.createTime ||
}} data.code ||
type='primary' data.userName ||
> data.userPosition ||
打印预览 data.userPhone ||
</Button> data.userSchool) && (
) : ( <Row className={styles.row}>
'' {data &&
)} data.code && (
</Popconfirm> <Col
</> style={{
) : ( marginBottom: 12,
'' }}
)} span={8}>
</div> <span className={styles.hea_title}>单号</span>
</div> <span className={styles.hew_content}>{data.code}</span>
</div> </Col>
{isLoading ? )}
( {data &&
<> data.userName && (
<Card style={{ width: '100%' }}> <Col
{!isCloseUserDetail && ( style={{
<div className={styles.body_hea}> marginBottom: 12,
<h3>发起人信息</h3> }}
{data && span={8}>
(data.createTime || <span className={styles.hea_title}>用户姓名</span>
data.code || <span className={styles.hew_content}>{data.userName}</span>
data.userName || </Col>
data.userPosition || )}
data.userPhone || {data &&
data.userSchool) && ( data.userPosition && (
<Row className={styles.row}> <Col
{data && data.code && ( style={{
<Col marginBottom: 12,
style={{ }}
marginBottom: 12, span={8}>
}} <span className={styles.hea_title}>职位</span>
span={8} <span className={styles.hew_content}>{data.userPosition}</span>
> </Col>
<span className={styles.hea_title}>单号</span> )}
<span className={styles.hew_content}>{data.code}</span> {data &&
</Col> data.userSchool && (
)} <Col
{data && data.userName && ( span={8}
<Col style={{
style={{ marginBottom: 12,
marginBottom: 12, }}>
}} <span className={styles.hea_title}>学院/单位</span>
span={8} <span className={styles.hew_content}>{data.userSchool}</span>
> </Col>
<span className={styles.hea_title}>用户姓名</span> )}
<span className={styles.hew_content}>{data.userName}</span> {data &&
</Col> data.userPhone && (
)} <Col
{data && data.userPosition && ( span={8}
<Col style={{
style={{ marginBottom: 12,
marginBottom: 12, }}>
}} <span className={styles.hea_title}>联系电话</span>
span={8} <span className={styles.hew_content}>{data.userPhone}</span>
> </Col>
<span className={styles.hea_title}>职位</span> )}
<span className={styles.hew_content}>{data.userPosition}</span> {data &&
</Col> data.createTime && (
)} <Col
{data && data.userSchool && ( style={{
<Col marginBottom: 12,
span={8} }}
style={{ span={8}>
marginBottom: 12, <span className={styles.hea_title}>申请时间</span>
}} <span className={styles.hew_content}>
> {moment(data.createTime).format('YYYY-MM-DD HH:mm')}
<span className={styles.hea_title}>学院/单位</span> </span>
<span className={styles.hew_content}>{data.userSchool}</span> </Col>
</Col> )}
)} </Row>
{data && data.userPhone && ( )}
<Col </div>
span={8} )}
style={{ <div
marginBottom: 12, className={styles.HistoryFormList}
}} id="card_table"
> ref={(el) => (this.componentRef = el)}
<span className={styles.hea_title}>联系电话</span> style={{ padding: !isShowTitle ? '50px' : '' }}>
<span className={styles.hew_content}>{data.userPhone}</span> <HistoryFormList
</Col> data={data}
)} formKeys={hisTaskFormKeys?.formKeys}
{data && data.createTime && ( isShowTitle={isShowTitle}
<Col routerState={routerState}
style={{ formData={hisTaskFormKeys?.formData}
marginBottom: 12, />
}} {isHandle === true &&
span={8} !!data.taskFormKey && (
> <>
<span className={styles.hea_title}>申请时间</span> {isShowTitle ? (
<span className={styles.hew_content}> <h3
{moment(data.createTime) style={{
.format('YYYY-MM-DD HH:mm')} display: 'flex',
</span> alignItems: 'center',
</Col> }}>
)} <SVG name="vertical" color="#999999" height="24" />
</Row> 当前流程
)} </h3>
</div> ) : (
)} ''
<div )}
className={styles.HistoryFormList} {isEmpty(data) === false ? (
id='card_table' <ZdyTable
ref={el => (this.componentRef = el)} key={data.taskFormKey}
style={{ padding: !isShowTitle ? '50px' : '' }} postData={data}
> get="web"
<HistoryFormList data={data} obj={hisTaskFormKeys.formData}
formKeys={hisTaskFormKeys?.formKeys} table="new"
isShowTitle={isShowTitle} form={this.props.form}
routerState={routerState} routerState={routerState}
formData={hisTaskFormKeys?.formData} />
/> ) : (
{isHandle === true && !!data.taskFormKey && ( ''
<> )}
{isShowTitle ? ( </>
<h3 )}
style={{ </div>
display: 'flex', </Card>
alignItems: 'center', <Card style={{ width: '100%' }}>
}} <div className={styles.body_content} style={{ minHeight: '300px' }}>
> <div id={'btnsModalMountDiv'} />
<SVG name='vertical' color='#999999' height='24' /> <h3>
当前流程 审批状态 <span onClick={this.examineFlow}>查看流程图</span>
</h3> </h3>
) : ( <div
'' ref={(el) => (this.componentTwoRef = el)}
)} style={{
{isEmpty(data) === false ? ( padding: !isShowTitle ? '0 50px 50px 50px' : '',
<ZdyTable }}>
key={data.taskFormKey} <Timeline>
postData={data} {stepFlow !== '' && steps !== ''
get='web' ? stepFlow.map((item, index) => {
obj={hisTaskFormKeys.formData} if (index === stepFlow.length - 1) {
table='new' // 最后一步流程
form={this.props.form} return (
routerState={routerState} <Timeline.Item
/> color={['处理中', '待处理'].includes(item.status) ? 'red' : '#ccc'}
) : ( dot={
'' <Icon
)} type={
</> ['处理中', '待处理'].includes(item.status)
)} ? 'clock-circle-o'
</div> : 'check-circle'
</Card> }
<Card style={{ width: '100%' }}> style={{ fontSize: '16px' }}
<div className={styles.body_content} style={{ minHeight: '300px' }}> />
<div id={'btnsModalMountDiv'}></div> }
<h3> className={styles.steps_step}
审批状态 <span onClick={this.examineFlow}>查看流程图</span> key={item.id}>
</h3> <p className={styles.steps_title}>
<div {item.assignee}
ref={el => (this.componentTwoRef = el)} <span>
style={{ {item.endTime
padding: !isShowTitle ? '0 50px 50px 50px' : '', ? moment(item.endTime).format('YYYY-MM-DD HH:mm')
}} : '处理中'}
> </span>
<Timeline> </p>
{stepFlow !== '' && steps !== '' {queryApiVersion() === '2.0' &&
? stepFlow.map((item, index) => { ['处理中', '待处理'].includes(item.status) &&
if (index === stepFlow.length - 1) { !!data.nextUsers && <p>审批人员: {data.nextUsers}</p>}
// 最后一步流程 {queryApiVersion() !== '2.0' &&
return ( ['处理中', '待处理'].includes(item.status) &&
<Timeline.Item !!item.nextUsers && <p>审批人员: {item.nextUsers}</p>}
color={['处理中', '待处理'].includes(item.status) ? 'red' : '#ccc'} <p>
dot={ 审批流程:
<Icon {item.name}
type={ </p>
['处理中', '待处理'].includes(item.status) ? 'clock-circle-o' : 'check-circle' <p className={styles.steps_body}>
} 审批状态:
style={{ fontSize: '16px' }} {item.status}
/> </p>
} {item.taskVariable?.reason ? (
className={styles.steps_step} <p>
key={item.id} 审批原因:
> {item.taskVariable?.reason}
<p className={styles.steps_title}> </p>
{item.assignee} ) : (
<span> ''
{item.endTime )}
? moment(item.endTime) {item.childTaskModel &&
.format('YYYY-MM-DD HH:mm') item.childTaskModel.length > 0 && (
: '处理中'} <ChildTaskModel data={item.childTaskModel} />
</span> )}
</p>
{ {(isSign || item.taskVariable?.sign) && !closeAutoSign ? (
queryApiVersion() === '2.0' && ['处理中', '待处理'].includes(item.status) && !!data.nextUsers && ( <img
<p>审批人员: {data.nextUsers}</p> style={{
) position: 'absolute',
} top: '50%',
{queryApiVersion() !== '2.0' && ['处理中', '待处理'].includes(item.status) && !!item.nextUsers && ( left: 200,
<p>审批人员: {item.nextUsers}</p> height: 50,
)} marginTop: -25,
<p>审批流程:{item.name}</p> border: item.taskVariable?.sign ? '1px solid #ccc' : '',
<p className={styles.steps_body}>审批状态:{item.status}</p> }}
{item.taskVariable?.reason ? ( src={
<p>审批原因:{item.taskVariable?.reason}</p> item.taskVariable?.sign
) : ( ? queryApiActionPath() + item.taskVariable?.sign
'' : ''
)} }
{item.childTaskModel && item.childTaskModel.length > 0 && ( alt=""
<ChildTaskModel data={item.childTaskModel} /> />
)} ) : (
''
{(isSign || item.taskVariable?.sign) && !closeAutoSign ? ( )}
<img {isTrunTo && +item.commentCount > 0 ? (
style={{ <TrunToDetail data={data} item={item} />
position: 'absolute', ) : null}
top: '50%', </Timeline.Item>
left: 200, );
height: 50, }
marginTop: -25, return (
border: item.taskVariable?.sign ? '1px solid #ccc' : '', <Timeline.Item
}} color={item.status === 0 ? 'gray' : 'green'}
src={ dot={
item.taskVariable?.sign item.status === 0 ? (
? queryApiActionPath() + item.taskVariable?.sign ''
: '' ) : (
} <Icon
alt='' type="check-circle"
/> theme="twoTone"
) : ( twoToneColor="#52c41a"
'' />
)} )
{isTrunTo && +item.commentCount > 0 ? ( }
<TrunToDetail data={data} item={item} /> className={styles.steps_step}
) : null} key={item.id}>
</Timeline.Item> <p className={styles.steps_title}>
); {item.assignee}
} <span>
return ( {item.endTime
<Timeline.Item ? moment(item.endTime).format('YYYY-MM-DD HH:mm')
color={item.status === 0 ? 'gray' : 'green'} : null}
dot={ </span>
item.status === 0 ? ( </p>
'' <p>
) : ( 审批流程:
<Icon {item.name}
type='check-circle' </p>
theme='twoTone' <p className={styles.steps_body}>
twoToneColor='#52c41a' 审批状态:
/> {item.status}
) </p>
} {item.taskVariable?.reason ? (
className={styles.steps_step} <p>
key={item.id} 审批原因:
> {item.taskVariable.reason}
<p className={styles.steps_title}> </p>
{item.assignee} ) : (
<span> ''
{item.endTime )}
? moment(item.endTime) {item.childTaskModel &&
.format('YYYY-MM-DD HH:mm') item.childTaskModel.length > 0 && (
: null} <ChildTaskModel data={item.childTaskModel} />
</span> )}
</p> {item.taskVariable?.sign ? (
<p>审批流程:{item.name}</p> <img
<p className={styles.steps_body}>审批状态:{item.status}</p> style={{
{item.taskVariable?.reason ? ( position: 'absolute',
<p>审批原因:{item.taskVariable.reason}</p> top: '50%',
) : ( left: 200,
'' height: 50,
)} marginTop: -25,
{item.childTaskModel && item.childTaskModel.length > 0 && ( border: item.taskVariable?.sign ? '1px solid #ccc' : '',
<ChildTaskModel data={item.childTaskModel} /> }}
)} src={
{item.taskVariable?.sign ? ( item.taskVariable?.sign
<img ? queryApiActionPath() + item.taskVariable?.sign
style={{ : ''
position: 'absolute', }
top: '50%', alt=""
left: 200, />
height: 50, ) : (
marginTop: -25, ''
border: item.taskVariable?.sign ? '1px solid #ccc' : '', )}
}} {isTrunTo && +item.commentCount > 0 ? (
src={ <TrunToDetail data={data} item={item} />
item.taskVariable?.sign ) : null}
? queryApiActionPath() + item.taskVariable?.sign </Timeline.Item>
: '' );
} })
alt='' : ''}
/> </Timeline>
) : ( </div>
'' </div>
)} </Card>
{isTrunTo && +item.commentCount > 0 ? ( <div className={styles.buttonList}>
<TrunToDetail data={data} item={item} /> {isHandle === true ? (
) : null} <>
</Timeline.Item> <BtnOk // 审批按钮和弹窗
); Sign={!!setData?.userSign}
}) isSumbitLoading={isSumbitLoading}
: ''} isSecond={isSecond}
</Timeline> affairOk={this.affairOk}
</div> form={this.props.form}
</div> btns={btns}
</Card> addition={
<div className={styles.buttonList}> <>
{isHandle === true ? ( {isTrunTo && data.isSecond !== true && isHandle ? (
<> <Button
<BtnOk // 审批按钮和弹窗 style={{
Sign={!!setData?.userSign} marginLeft: 16,
isSumbitLoading={isSumbitLoading} minHeight: 32,
isSecond={isSecond} minWidth: 90,
affairOk={this.affairOk} }}
form={this.props.form} onClick={() => {
btns={btns} this.showTrunToModel(
addition={ data.isHandle && data.isOwner
<> ? '转办'
{isTrunTo && data.isSecond !== true && isHandle ? ( : !data.isHandle && data.isOwner
<Button ? '撤回'
style={{ : '回退',
marginLeft: 16, data,
minHeight: 32, );
minWidth: 90, }}
}} type="primary">
onClick={() => { {data.isHandle && data.isOwner
this.showTrunToModel( ? '转办'
data.isHandle && data.isOwner : !data.isHandle && data.isOwner
? '转办' ? '撤回'
: !data.isHandle && data.isOwner : data.isHandle && !data.isOwner
? '撤回' ? '回退'
: '回退', : null}
data, </Button>
); ) : null}
}} {data.isCanSign && (
type='primary' <Button
> style={{
{data.isHandle && data.isOwner marginLeft: 16,
? '转办' minHeight: 32,
: !data.isHandle && data.isOwner minWidth: 90,
? '撤回' }}
: data.isHandle && !data.isOwner onClick={this.onClickCountersign}
? '回退' type="primary">
: null} 加签
</Button> </Button>
) : null} )}
{data.isCanSign && ( </>
<Button }
style={{ />
marginLeft: 16, </>
minHeight: 32, ) : (
minWidth: 90, ''
}} )}
onClick={this.onClickCountersign} {isTrunTo &&
type='primary' data.isSecond !== true &&
> !data.isHandle &&
加签 data.isOwner && (
</Button> <div
)} style={{
</> width: '100%',
} textAlign: 'center',
/> }}>
</> <Button
) : ( style={{
'' minHeight: 32,
)} minWidth: 90,
{isTrunTo && data.isSecond !== true && !data.isHandle && data.isOwner && ( margin: '0 auto',
<div }}
style={{ onClick={() => {
width: '100%', this.showTrunToModel('撤回', data);
textAlign: 'center', }}
}} type="primary">
> 撤回
<Button </Button>
style={{ </div>
minHeight: 32, )}
minWidth: 90, </div>
margin: '0 auto', </>
}} ) : (
onClick={() => { <div
this.showTrunToModel('撤回', data); style={{
}} width: '100%',
type='primary' height: 200,
> display: 'flex',
撤回 justifyContent: 'center',
</Button> alignItems: 'center',
</div> }}>
)} <Spin size="large" spinning={true} />
</div> </div>
</> )}
) : ( <PortalFlowExamineModal // 流程图
<div ref={(node) => (this.flowExamineModal = node)}
style={{ affairId={id}
width: '100%', id={appId}
height: 200, code={code}
display: 'flex', />
justifyContent: 'center', <TrunToModel //
alignItems: 'center', visible={isOpenTrunToModel}
}} handleCancel={this.handleTrunToModel}
> status={trunToStatus}
<Spin size='large' spinning={true} /> value={trunData}
</div> init={this.getInit}
)} />
<PortalFlowExamineModal // 流程图 {data?.appName && ( // 加签
ref={node => (this.flowExamineModal = node)} <Countersign
affairId={id} taskId={data.taskId}
id={appId} data={data}
code={code} getInit={this.getInit}
/> updateCountersignModal={this.updateCountersignModal}
<TrunToModel // />
visible={isOpenTrunToModel} )}
handleCancel={this.handleTrunToModel} </Fragment>
status={trunToStatus} );
value={trunData} }
init={this.getInit}
/>
{data?.appName && ( // 加签
<Countersign
taskId={data.taskId}
data={data}
getInit={this.getInit}
updateCountersignModal={this.updateCountersignModal}
/>
)}
</Fragment>
);
}
} }
export default function Index(props){ function Index(props) {
console.log(window.zdyTableTemplateWillMountProps?.formCreateOptions); const { dispatch, history } = props;
const DetailSplitFormNew = Form.create( const [prepare, setPrepare] = useState(false);
window.zdyTableTemplateWillMountProps?.formCreateOptions || undefined, useEffect(() => {
)(DetailSplit); const id = history.location.state && history.location.state.id;
return <DetailSplitFormNew {...props}/>; const code = history.location.state && history.location.state.code;
const queryId = history.location.query && history.location.query.id;
const taskId = history.location.state && history.location.state.taskId;
if (!id && !code) {
if (queryId) {
} else {
openToast('error', '数据已过期', '当前页面数据已过期,请重新进入');
return;
}
}
message.info('正在加载数据,请等待。');
dispatch({
type: 'affair/getIdFormDetail',
payload: {
id: queryId ? queryId : id, // 审批表Id
code: code || null, // 表单值
handleUser: null, // 处理人
taskId, // 多任务流程会使用到,后续改为必须传入
lite: true,
},
callback: (val) => {
if (val) {
setPrepare(val);
}
},
});
}, []);
if (!prepare) {
return <Spin size="large" spinning={true} />;
}
const DetailSplitFormNew = Form.create(
window.zdyTableTemplateWillMountProps?.formCreateOptions || undefined,
)(DetailSplit);
return <DetailSplitFormNew {...props} formPrepareData={prepare} />;
} }
export default connect(() => {
return {};
})(Index);
...@@ -49,7 +49,8 @@ export default class IframeForApply extends React.Component { ...@@ -49,7 +49,8 @@ export default class IframeForApply extends React.Component {
} = props; } = props;
this.state = { this.state = {
id, // 传入id id, // 传入id
init: init && isJSON(init) ? JSON.parse(decodeURIComponent(init)) : undefined, init: init || undefined,
// 2022年8月9日 发起页面的默认值可以通过这个init 传进来
value: '', // 紧急度选择 value: '', // 紧急度选择
btnList: [], // 紧急度按钮返回数据 btnList: [], // 紧急度按钮返回数据
noNeedApply, noNeedApply,
......
...@@ -19,6 +19,7 @@ import getActiveJson from '@/webPublic/one_stop_public/Table/getActiveJson'; ...@@ -19,6 +19,7 @@ import getActiveJson from '@/webPublic/one_stop_public/Table/getActiveJson';
export default class ZdyTable extends Component { export default class ZdyTable extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
console.log(props);
this.state = { this.state = {
objRealTime: {}, objRealTime: {},
isChange: false, isChange: false,
......
...@@ -796,9 +796,9 @@ export async function downloadFile(url, params, fileName = '导出文件', ext = ...@@ -796,9 +796,9 @@ export async function downloadFile(url, params, fileName = '导出文件', ext =
let headers = { let headers = {
Authorization: `bearer ${localStorage.getItem('antd-pro-token-onestop')}`, Authorization: `bearer ${localStorage.getItem('antd-pro-token-onestop')}`,
}; };
if(headersApi){ // if(headersApi){
headers.apis = headersApi; // headers.apis = headersApi;
} // }
fetch(transformApi, { fetch(transformApi, {
method: 'POST', method: 'POST',
body: FormdataWrapper(params), body: FormdataWrapper(params),
...@@ -840,9 +840,9 @@ export async function downloadFileAndShowModal(url, params, fileName = '导出 ...@@ -840,9 +840,9 @@ export async function downloadFileAndShowModal(url, params, fileName = '导出
let headers = { let headers = {
Authorization: `bearer ${localStorage.getItem('antd-pro-token-onestop')}`, Authorization: `bearer ${localStorage.getItem('antd-pro-token-onestop')}`,
}; };
if(headersApi){ // if(headersApi){
headers.apis = headersApi; // headers.apis = headersApi;
} // }
fetch(transformApi, { fetch(transformApi, {
method: 'POST', method: 'POST',
body: FormdataWrapper(params), body: FormdataWrapper(params),
......
import React from "react"; import React from 'react';
import { Button, message, Table, Tag } from "antd"; import { Button, message, Table, Tag } from 'antd';
import FormList from "./formList/index"; import FormList from './formList/index';
import { connect } from "dva"; import { connect } from 'dva';
import { getModal } from '@/webPublic/one_stop_public/utils/utils'; import { getModal } from '@/webPublic/one_stop_public/utils/utils';
import TableSelectNormal from '@/webPublic/one_stop_public/libs/Split/TableSelectNormal'; import TableSelectNormal from '@/webPublic/one_stop_public/libs/Split/TableSelectNormal';
import styles from './Split/styles.less'; import styles from './Split/styles.less';
const Modal = getModal(); const Modal = getModal();
@connect(({ DataColumn, SqlManageEntity, loading }) => ({ @connect(({
DataColumn, DataColumn,
SqlManageEntity, SqlManageEntity,
loading: loading.models.DataColumn || loading.models.SqlManageEntity, loading
}) => ({
DataColumn,
SqlManageEntity,
loading: loading.models.DataColumn || loading.models.SqlManageEntity,
})) }))
export default class TableSelect extends React.Component { export default class TableSelect extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
const value = props.value || {}; const value = props.value || {};
this.otherProps = {}; this.otherProps = {};
if (props.json.otherProps && props.json.otherProps.length) { if (props.json.otherProps && props.json.otherProps.length) {
try { try {
this.otherProps = new Function(props.json.otherProps)(); this.otherProps = new Function(props.json.otherProps)();
} catch (e) { } catch (e) {
console.log('TableSelect组件 otherProps 获取失败') console.log('TableSelect组件 otherProps 获取失败');
} }
} }
this.state = { this.state = {
selects: value.selects || {}, selects: value.selects || {},
visiable: value.visiable, visiable: value.visiable,
isAll: value.isAll != null ? value.isAll : false, isAll: value.isAll != null ? value.isAll : false,
querys: value.querys || [], querys: value.querys || [],
sql: value.sql, sql: value.sql,
}; };
} }
triggerChange = (changedValue) => {
// Should provide an event to pass value to Form.
const onChange = this.props.onChange;
if (onChange) {
// console.log('changedValue', changedValue);
onChange(Object.assign({}, this.state, changedValue));
}
};
triggerChange = (changedValue) => { componentWillReceiveProps(nextProps) {
// Should provide an event to pass value to Form. // Should be a controlled component.
const onChange = this.props.onChange; if ('value' in nextProps) {
if (onChange) { const value = nextProps.value;
// console.log('changedValue', changedValue);
onChange(Object.assign({}, this.state, changedValue));
}
};
componentWillReceiveProps(nextProps) { if (value != null && value instanceof Object) {
// Should be a controlled component. this.setState(value);
if ('value' in nextProps) { }
const value = nextProps.value; //
}
}
if (value != null && value instanceof Object) { remove = (rowKey) => {
this.setState(value); const { selects } = this.state;
} delete selects[rowKey];
// if (!('value' in this.props)) {
} this.setState({ selects });
} }
this.triggerChange({ selects });
};
remove = (rowKey) => { select = (obj) => {
const { selects } = this.state; var { selects } = this.state;
delete selects[rowKey]; const {
if (!('value' in this.props)) { json: {
this.setState({ selects }); isMultiple,
} optionType
this.triggerChange({ selects }); },
}; } = this.props;
let valueName = this.props.json.valueName;
select = (obj) => { if (optionType == 'reference' && this.props.dataColumn.referenceObjId) {
var { selects } = this.state; valueName = this.props.dataColumn.referenceCodeName;
const { }
json: { isMultiple, optionType },
} = this.props;
let valueName = this.props.json.valueName;
if (optionType == 'reference' && this.props.dataColumn.referenceObjId) { const kk = obj[valueName];
valueName = this.props.dataColumn.referenceCodeName; if (kk == null) {
} message.error('指定的取值字段不存在或者值为空');
return;
}
if (!isMultiple) {
selects = {
[kk]: {
...obj,
selectKey: kk
}
};
} else {
selects[kk] = obj;
selects[kk].selectKey = kk;
}
if (!('value' in this.props)) {
this.setState({ selects });
}
this.triggerChange({ selects });
};
selectAll = () => {
let { selects } = this.state;
const {
dataSource,
json
} = this.props;
let {
valueName,
optionType
} = json;
const { list } = dataSource;
if (optionType == 'reference' && this.props.dataColumn.referenceObjId) {
valueName = this.props.dataColumn.referenceCodeName;
}
if (list && Array.isArray(list)) {
for (let item of list) {
let kk = item[valueName];
selects[kk] = item;
selects[kk].selectKey = kk;
}
}
if (!('value' in this.props)) {
this.setState({ selects });
}
this.triggerChange({ selects });
};
const kk = obj[valueName]; cancelAll = () => {
if (kk == null) { let selects = {};
message.error('指定的取值字段不存在或者值为空'); if (!('value' in this.props)) {
return; this.setState({ selects });
} }
if (!isMultiple) { this.triggerChange({ selects });
selects = { [kk]: { ...obj, selectKey: kk } }; };
} else {
selects[kk] = obj;
selects[kk].selectKey = kk;
}
if (!('value' in this.props)) {
this.setState({ selects });
}
this.triggerChange({ selects });
};
selectAll = () => { close = (i) => {
let { selects } = this.state; var {
const { dataSource, json } = this.props; values,
let { valueName, optionType } = json; labels
const { list } = dataSource; } = this.state;
if (optionType == 'reference' && this.props.dataColumn.referenceObjId) { values.splice(i, 1);
valueName = this.props.dataColumn.referenceCodeName; labels.splice(i, 1);
} if (!('value' in this.props)) {
if (list && Array.isArray(list)) { this.setState({
for (let item of list) { values,
let kk = item[valueName]; labels
selects[kk] = item; });
selects[kk].selectKey = kk; }
} this.triggerChange({
} values,
if (!('value' in this.props)) { labels
this.setState({ selects }); });
} };
this.triggerChange({ selects });
};
cancelAll = () => { open = () => {
let selects = {}; if (!('value' in this.props)) {
if (!('value' in this.props)) { this.setState({ visiable: true });
this.setState({ selects }); }
} this.triggerChange({ visiable: true });
this.triggerChange({ selects }); };
};
close = (i) => { closeModal = () => {
var { values, labels } = this.state; if (!('value' in this.props)) {
values.splice(i, 1); this.setState({ visiable: false });
labels.splice(i, 1); }
if (!('value' in this.props)) { const { resetSearchText } = this.props;
this.setState({ values, labels }); resetSearchText && resetSearchText();
} this.triggerChange({ visiable: false });
this.triggerChange({ values, labels }); };
};
open = () => { cancelOne = (record) => {
if (!('value' in this.props)) { var { selects } = this.state;
this.setState({ visiable: true }); const {
} json: {
this.triggerChange({ visiable: true }); isMultiple,
}; optionType
},
} = this.props;
let valueName = this.props.json.valueName;
closeModal = () => { if (optionType == 'reference' && this.props.dataColumn.referenceObjId) {
if (!('value' in this.props)) { valueName = this.props.dataColumn.referenceCodeName;
this.setState({ visiable: false }); }
}
const { resetSearchText } = this.props;
resetSearchText && resetSearchText();
this.triggerChange({ visiable: false });
};
cancelOne = (record) => { const kk = record[valueName];
var { selects } = this.state; if (kk == null) {
const { message.error('指定的取值字段不存在或者值为空');
json: { isMultiple, optionType }, return;
} = this.props; }
let valueName = this.props.json.valueName; if (selects[kk]) {
delete selects[kk];
}
if (!('value' in this.props)) {
this.setState({ selects });
}
this.triggerChange({ selects });
};
if (optionType == 'reference' && this.props.dataColumn.referenceObjId) { render() {
valueName = this.props.dataColumn.referenceCodeName; const {
} json: {
isMultiple,
sql,
optionType,
showTable,
isShowQuanXuan
},
dataColumn: { referenceObjId },
sqlModel,
columns,
dataSource,
} = this.props;
let disabled = this.props.disabled || this.props.json.disabled; // 禅道 28713
const { cardSelectModalProps = {} } = this.otherProps;
const kk = record[valueName]; let {
if (kk == null) { valueName,
message.error('指定的取值字段不存在或者值为空'); labelName
return; } = this.props.json;
} if (optionType == 'reference' && referenceObjId) {
if (selects[kk]) { valueName = this.props.dataColumn.referenceCodeName;
delete selects[kk]; labelName = this.props.dataColumn.referenceNameName;
} }
if (!('value' in this.props)) { if (valueName == null || valueName == '') {
this.setState({ selects }); return <>请指定取值的列名</>;
} }
this.triggerChange({ selects }); const {
}; selects,
visiable,
labels
} = this.state;
const keys = [];
for (let i in selects) {
keys.push(selects[i][valueName]);
}
const columns2 = [
...columns,
];
if (!disabled) {
columns2.push({
title: '操作',
render: (val, record) => <a onClick={this.remove.bind(this, record.selectKey)}>移除</a>,
},);
}
const columns3 = [
...columns,
];
if (!disabled) {
columns3.push( {
title: '操作',
render: (val, record) =>
keys.includes(record[valueName]) ? (
<a
onClick={() => {
this.cancelOne(record);
}}>
已选择
</a>
) : (
<a onClick={this.select.bind(this, record)}>选择</a>
),
},);
}
render() {
const {
json: { isMultiple, sql, optionType, showTable, isShowQuanXuan },
dataColumn: { referenceObjId },
sqlModel,
columns,
dataSource,
disabled,
} = this.props;
const { cardSelectModalProps = {} } = this.otherProps;
let { valueName, labelName } = this.props.json; const custom = {
if (optionType == 'reference' && referenceObjId) { isAll: this.state.isAll,
valueName = this.props.dataColumn.referenceCodeName; querys: this.state.querys,
labelName = this.props.dataColumn.referenceNameName; sql: this.state.sql,
} };
if (valueName == null || valueName == '') { let allWidth = 0;
return <>请指定取值的列名</>; if (columns3) {
} columns3.map((item, index) => {
const { selects, visiable, labels } = this.state; if (index === columns3.length - 1) {
const keys = []; item.fixed = 'right';
for (let i in selects) { item.width = 90;
keys.push(selects[i][valueName]); allWidth += 90;
} return item;
const columns2 = [ }
...columns, if (index === columns3.length - 2) {
{ allWidth += 150;
title: '操作', } else {
render: (val, record) => <a onClick={this.remove.bind(this, record.selectKey)}>移除</a>, if (item.width) {
}, allWidth += item.width;
]; } else {
const columns3 = [ item.width = 180;
...columns, allWidth += 180;
{ }
title: '操作', }
render: (val, record) => return item;
keys.includes(record[valueName]) ? ( });
<a }
onClick={() => {
this.cancelOne(record);
}}>
已选择
</a>
) : (
<a onClick={this.select.bind(this, record)}>选择</a>
),
},
];
const custom = {
isAll: this.state.isAll,
querys: this.state.querys,
sql: this.state.sql,
};
let allWidth = 0;
if (columns3) {
columns3.map((item, index) => {
if (index === columns3.length - 1) {
item.fixed = 'right';
item.width = 90;
allWidth += 90;
return item;
}
if (index === columns3.length - 2) {
allWidth += 150;
} else {
if (item.width) {
allWidth += item.width;
} else {
item.width = 180;
allWidth += 180;
}
}
return item;
});
}
return ( return (
<div> <div>
{Object.keys(selects).length > 0 ? ( // 是否显示表格 {Object.keys(selects).length > 0 ? ( // 是否显示表格
showTable ? ( showTable ? (
<Table <Table
rowKey={valueName} rowKey={valueName}
size="small" size="small"
dataSource={Object.values(selects)} dataSource={Object.values(selects)}
columns={columns2} columns={columns2}
pagination={false} pagination={false}
/> />
) : ( ) : (
Object.keys(selects).map((k) => ( Object.keys(selects)
<Tag key={k} closable={!disabled} onClose={this.remove.bind(this, k)}> .map((k) => (
{selects[k][labelName]} <Tag key={k} closable={!disabled} onClose={this.remove.bind(this, k)}>
</Tag> {selects[k][labelName]}
)) </Tag>
) ))
) : ( )
'' ) : (
)} ''
{!disabled && ( )}
<Button type="primary" onClick={this.open}> {!disabled && (
选择 <Button type="primary" onClick={this.open}>
</Button> 选择
)} </Button>
)}
{visiable && ( {visiable && (
<Modal <Modal
className={styles.ModalDiy} className={styles.ModalDiy}
width={this.props.get === 'mobile' ? '100%' : '60%'} width={this.props.get === 'mobile' ? '100%' : '60%'}
maskClosable={false} maskClosable={false}
title={`请选择`} title={`请选择`}
visible={visiable} visible={visiable}
// footer={[ // footer={[
// <Button key="back" // <Button key="back"
// onClick={this.closeModal} // onClick={this.closeModal}
...@@ -290,42 +341,42 @@ export default class TableSelect extends React.Component { ...@@ -290,42 +341,42 @@ export default class TableSelect extends React.Component {
// 确定 // 确定
// </Button>, // </Button>,
// ]} // ]}
onOk={this.closeModal} onOk={this.closeModal}
onCancel={this.closeModal} onCancel={this.closeModal}
{...cardSelectModalProps} {...cardSelectModalProps}
> >
{optionType === 'reference' ? ( {optionType === 'reference' ? (
referenceObjId ? ( referenceObjId ? (
<FormList <FormList
rights={this.props.rights || []} rights={this.props.rights || []}
notShowBack={true} notShowBack={true}
value={custom} value={custom}
objId={referenceObjId} objId={referenceObjId}
isFormCom={true} isFormCom={true}
isSelect={true} isSelect={true}
selects={keys} selects={keys}
valueName={valueName} valueName={valueName}
callback={this.select} callback={this.select}
sql={sql} sql={sql}
/> />
) : ( ) : (
'未关联数据对象' '未关联数据对象'
) )
) : sqlModel.dataObjId ? ( ) : sqlModel.dataObjId ? (
<FormList <FormList
rights={this.props.rights || []} rights={this.props.rights || []}
notShowBack={true} notShowBack={true}
value={custom} value={custom}
objId={sqlModel.dataObjId} objId={sqlModel.dataObjId}
isFormCom={true} isFormCom={true}
isSelect={true} isSelect={true}
selects={keys} selects={keys}
valueName={valueName} valueName={valueName}
callback={this.select} callback={this.select}
sql={sql} sql={sql}
/> />
) : ( ) : (
<TableSelectNormal isMultiple={isMultiple} <TableSelectNormal isMultiple={isMultiple}
allWidth={allWidth} allWidth={allWidth}
cancelAll={this.cancelAll} cancelAll={this.cancelAll}
selectAll={this.selectAll} selectAll={this.selectAll}
...@@ -339,10 +390,10 @@ export default class TableSelect extends React.Component { ...@@ -339,10 +390,10 @@ export default class TableSelect extends React.Component {
callback={this.select} callback={this.select}
/> />
)} )}
</Modal> </Modal>
)} )}
</div> </div>
); );
} }
} }
...@@ -248,18 +248,7 @@ class TreeList extends React.Component { ...@@ -248,18 +248,7 @@ class TreeList extends React.Component {
}); });
}, },
}); });
// } else {
// router.push({
// pathname: '/admin/ddl/dataObj/formEdit',
// state: {
// id: this.state.objId,
// recordId: record[this.state.primaryKey],
// recordKey: this.state.primaryKey,
// isAdd: false,
// isView:false
// },
// });
// }
}; };
view = (record) => { view = (record) => {
...@@ -271,18 +260,7 @@ class TreeList extends React.Component { ...@@ -271,18 +260,7 @@ class TreeList extends React.Component {
isAdd: false, isAdd: false,
isView: true, isView: true,
}); });
// } else {
// router.push({
// pathname: '/admin/ddl/dataObj/formEdit',
// state: {
// id: this.state.objId,
// recordId: record[this.state.primaryKey],
// recordKey: this.state.primaryKey,
// isAdd: false,
// isView:true
// },
// });
// }
}; };
isJSON = (str) => { isJSON = (str) => {
......
...@@ -18,6 +18,9 @@ export default function giveVarcharRules({ ...@@ -18,6 +18,9 @@ export default function giveVarcharRules({
res.push({ res.push({
max: dataColumn.length, max: dataColumn.length,
message: `不能超过${dataColumn.length}个字符`, message: `不能超过${dataColumn.length}个字符`,
transform: function(value){
return value + '';
},
}); });
} }
return res; return res;
......
...@@ -20,6 +20,7 @@ import { getUrlInfo } from '@/webPublic/one_stop_public/DetailForAudit/utils'; ...@@ -20,6 +20,7 @@ import { getUrlInfo } from '@/webPublic/one_stop_public/DetailForAudit/utils';
import { getHeaders, getIsBei_Dian } from '@/webPublic/zyd_public/utils/utils'; import { getHeaders, getIsBei_Dian } from '@/webPublic/zyd_public/utils/utils';
import { proxyChangeUrl } from '@/webPublic/zyd_public/request/proxyChangeUrl'; import { proxyChangeUrl } from '@/webPublic/zyd_public/request/proxyChangeUrl';
import { getTransformApi } from '@/webPublic/one_stop_public/2022beidianke/localstorageTransform'; import { getTransformApi } from '@/webPublic/one_stop_public/2022beidianke/localstorageTransform';
import { getVisitorToken } from '@/webPublic/zyd_public/utils/getHeaders';
const codeMessage = { const codeMessage = {
200: '服务器成功返回请求的数据。', 200: '服务器成功返回请求的数据。',
...@@ -245,7 +246,7 @@ export async function requestOrigin(url, data, options = {}){ ...@@ -245,7 +246,7 @@ export async function requestOrigin(url, data, options = {}){
}); });
} else { } else {
const pp = { const pp = {
token: getToken(), // 部分接口 只需要传入假token 所以这里优先级是 data中的token > getToken; token: getVisitorToken(), // 部分接口 只需要传入假token 所以这里优先级是 data中的token > getToken;
...data, ...data,
version_: version, version_: version,
}; };
...@@ -260,10 +261,7 @@ export async function requestOrigin(url, data, options = {}){ ...@@ -260,10 +261,7 @@ export async function requestOrigin(url, data, options = {}){
// 由于自动添加前缀 这里暂时修改getUrl(url) // 由于自动添加前缀 这里暂时修改getUrl(url)
let fetchRequest = url.indexOf('UserApi/login') > -1 ? loginUmiRequest : umiRequest; let fetchRequest = url.indexOf('UserApi/login') > -1 ? loginUmiRequest : umiRequest;
if (process.env.NODE_ENV !== 'production' && url.indexOf('UserApi/login') > -1) {
url = '/UserApi/login'; // 通过 proxy代理 解决登录接口本地跨域问题
options.prefix = '';
}
if (getToken()) { if (getToken()) {
options.headers = getHeaders(url).headers; options.headers = getHeaders(url).headers;
} }
...@@ -273,11 +271,11 @@ export async function requestOrigin(url, data, options = {}){ ...@@ -273,11 +271,11 @@ export async function requestOrigin(url, data, options = {}){
if(options.headers){ if(options.headers){
options.headers = { options.headers = {
...options.headers, ...options.headers,
apis: headersApi, // apis: headersApi,
}; };
}else{ }else{
options.headers = { options.headers = {
apis: headersApi, // apis: headersApi,
}; };
} }
} }
......
...@@ -5,8 +5,18 @@ import { getUrlInfo } from '@/webPublic/one_stop_public/DetailForAudit/utils'; ...@@ -5,8 +5,18 @@ import { getUrlInfo } from '@/webPublic/one_stop_public/DetailForAudit/utils';
const isTest = getUrlInfo().test; const isTest = getUrlInfo().test;
export function getVisitorToken(){
let token = getToken();
const visitor_client = sessionStorage.getItem('visitor_client') === 'true' || !!getUrlInfo().visitor;
if(visitor_client && (token === 'null' || !token)){ // 访客token 欢哥喊加的
token = '704d693b-cc68-49a7-8888-4acc73b5ca73';
}
return token;
}
export function getHeaders(url = '', headersApi = undefined) { export function getHeaders(url = '', headersApi = undefined) {
const token = getToken(); let token = getVisitorToken();
const currentInfo = getCurrentUser() || {}; const currentInfo = getCurrentUser() || {};
const user = getUserInfo() || {}; const user = getUserInfo() || {};
const userId = user.id || currentInfo.xgUserId; const userId = user.id || currentInfo.xgUserId;
...@@ -16,6 +26,9 @@ export function getHeaders(url = '', headersApi = undefined) { ...@@ -16,6 +26,9 @@ export function getHeaders(url = '', headersApi = undefined) {
headers: {}, headers: {},
}; };
if(url && typeof url === 'string' && url.indexOf('oauthPub=true') > -1){ // 公共接口不需要token
return res;
}
if (!token || token === 'null') { if (!token || token === 'null') {
return res; return res;
} else { } else {
...@@ -26,9 +39,9 @@ export function getHeaders(url = '', headersApi = undefined) { ...@@ -26,9 +39,9 @@ export function getHeaders(url = '', headersApi = undefined) {
res.headers.Authorization = `bearer ${token}`; res.headers.Authorization = `bearer ${token}`;
res.headers.auth = gg5xxxxx(secretString); res.headers.auth = gg5xxxxx(secretString);
res.headers.timestamp = timestamp; res.headers.timestamp = timestamp;
if (headersApi) { // if (headersApi) {
res.headers.apis = headersApi; // res.headers.apis = headersApi;
} // }
} }
return res; return res;
} }
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论