提交 43b40668 authored 作者: 钟是志's avatar 钟是志
......@@ -4,14 +4,15 @@
* */
import { message } from 'antd';
import React, { Fragment } from 'react';
import React from 'react';
import { getToken } from '@/utils/authority';
import PageHeaderWrapper from '@/components/PageHeaderWrapper';
import ButtonDiy from '@/baseComponent/ButtonDiy';
import Shell from '@/baseComponent/Shell';
import config from '@/config/config';
import router from 'umi/router';
import ApplyForZyd from '@/webPublic/one_stop_public/ForZydApply/index';
export default class AffairPage extends React.Component {
constructor(props) {
......@@ -31,23 +32,23 @@ export default class AffairPage extends React.Component {
message.error('您的数据未同步,请联系管理员!');
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,
);
// 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;
}
......@@ -61,13 +62,6 @@ export default class AffairPage extends React.Component {
if (!workId) {
return null;
}
const url = config.onestopPC.split('/#/');
const params = `id=${workId}&token=${getToken()}&init=${encodeURIComponent(
JSON.stringify(init),
)}`;
let iframeUrl = `${url[0]}/#/IFrameForApply?${params}`;
console.log(iframeUrl);
// iframeUrl = `http://localhost:8001/onestop/IFrameForApply?${params}`;
return (
<PageHeaderWrapper title="">
<div
......@@ -91,7 +85,13 @@ export default class AffairPage extends React.Component {
/>
</div>
</Shell>
<iframe
<ApplyForZyd
{...this.props}
id={workId}
returnList={this.returnList}
init={encodeURIComponent(JSON.stringify(init))}
/>
{/* <iframe
src={iframeUrl}
frameBorder={0}
id="applyIframeId"
......@@ -107,7 +107,7 @@ export default class AffairPage extends React.Component {
overflowY: 'hidden',
backgroundColor: '#fff',
}}
/>
/>*/}
: null
</div>
</PageHeaderWrapper>
......
......@@ -237,6 +237,7 @@ export default class List extends Component {
}
}
}
// console.log(columns);
const tableProps = {
rowKey: pageSearch.tableRowKey || 'id',
selectedRows: selectRows,
......@@ -246,8 +247,9 @@ export default class List extends Component {
loading,
noSelectRow: !listConfig.selectRows,
onSelectRow: this.handleSelectRows,
scroll: { x: true },
scroll: { x: window.location.href.includes('Portal/#/') ? 'max-content' : true },
};
// console.log(tableProps);
if (!listConfig.paging) {
tableProps.data = { list: data, pagination: false };
}
......
......@@ -290,6 +290,7 @@ export default class List extends Component {
}
}
}
// console.log(columns);
const tableProps = {
rowKey: pageSearch.tableRowKey || 'id',
......
......@@ -31,6 +31,9 @@ export default class BatchAudit extends Component {
render() {
return <AuditPage {...this.props} hasBatchAudit={true} noNeedForm={true}/>;
return <AuditPage {...this.props}
hasBatchAudit={true}
noNeedForm={true} // 不需要填写审核表单
/>;
}
}
......@@ -102,6 +102,9 @@ export default class Index extends React.Component {
getColumn = () => {
const { workId } = this.state;
service.getColumns(workId).then((response) => {
if(!response || !Array.isArray(response)){
response = [];
}
response = response.filter((x) => {
return x.title !== '流程进度';
});
......
import React, { Fragment, Component } from 'react';
import React, { Component } from 'react';
import PageHeaderWrapper from '@/components/PageHeaderWrapper';
import Shell from '@/baseComponent/Shell';
import ButtonDiy from '@/baseComponent/ButtonDiy';
......@@ -7,6 +7,7 @@ import { getToken } from '@/utils/authority';
import config from '@/config/config';
import { message, Modal, notification, Popconfirm } from 'antd';
import DetailOneStop from '@/webPublic/one_stop_public/DetailForAudit/IframeForDetail';
import { getIsBei_Dian, getIsGui_Jian } from '@/webPublic/zyd_public/utils/utils';
window.iframeParentComponent = {
Modal,
......@@ -76,7 +77,12 @@ export default class Detail extends Component {
const { id, showAll } = this.state;
const url = config.onestopPC.split('/#/');
let showPrint = this.props.location?.state?.showPrint;
if(getIsGui_Jian() && !showPrint){
// 27590 寝室调整管理-寝室调整申请,详情的打印预览按钮不见了210301080119-122617
// 贵建把打印预览显示出来
showPrint = true;
}
console.log(showPrint);
let iframeUrl = `${url[0]}/#/IframeForDetail?id=${id}&token=${getToken()}`;
if (showPrint) {
iframeUrl = iframeUrl + '&showPrint=true';
......@@ -132,7 +138,7 @@ export default class Detail extends Component {
}}
/> :
<div id={'detailIframeId'}>
<DetailOneStop id={id} {...this.props} />
<DetailOneStop id={id} {...this.props} showPrint={showPrint || false}/>
</div>
}
......
import React, { Fragment, Component } from 'react';
import React, { Component } from 'react';
import PageHeaderWrapper from '@/components/PageHeaderWrapper';
import Shell from '@/baseComponent/Shell';
import ButtonDiy from '@/baseComponent/ButtonDiy';
import router from 'umi/router';
import { getToken, setToken } from '@/utils/authority';
import config from '@/config/config';
import { getOneStopConfig } from '@/webPublic/zyd_public/utils/utils';
......@@ -37,6 +35,7 @@ export default class Detail extends Component {
if(token){
setToken(token);
}
this.minHeight = document.body.clientHeight - 110;
this.state = {
id,
......@@ -66,7 +65,7 @@ export default class Detail extends Component {
// iframeUrl = `http://localhost:8022/portal/#/showSmartFormOnly?id=${id}&token=${getToken()}&isShow=true`;
return (
<PageHeaderWrapper title="">
<Shell>
<Shell styleShell={{ marginTop: '0px' }}>
<iframe
src={iframeUrl}
frameBorder={0}
......@@ -76,7 +75,7 @@ export default class Detail extends Component {
marginHeight="0"
allowtransparency="yes"
seamless
height={950}
height={this.minHeight}
scrolling={'no'}
style={{
width: '100%',
......
......@@ -27,6 +27,7 @@ import ReactQuill from 'react-quill';
import baseConfig from '@/config/config';
import 'react-quill/dist/quill.snow.css';
import ButtonUpload from './ButtonUpload';
import { getToken } from '@/webPublic/one_stop_public/utils/token';
const RadioGroup = Radio.Group;
const Option = Select.Option;
......@@ -486,6 +487,12 @@ export default class FormArray extends Component {
accept={info.accept}
multiple={info.multiple}
{...defaultProps}
headers={{
Authorization: `bearer ${getToken()}`,
}}
data={{
token: getToken(),
}}
defaultFileList={value[info.key]}
name="file"
onChange={({ fileList }) => {
......
......@@ -2,10 +2,12 @@ import { text, number, date, format, taskNode } from '../config/index';
import { isJSON } from '@/baseComponent/utils';
import { translateAddFields, getSearchCondition } from '../config/index';
import config from '@/config/config';
import { Tooltip } from 'antd';
import { Tooltip, Modal } from 'antd';
import moment from 'moment';
import React from 'react';
import { findListTaskDefinition } from '@/webPublic/FormInsertDiy/AffairPage/publicApiService';
import QRCode from 'qrcode.react';
import styles from './styles.less';
const handleSqlModels = (sqlModels, defaultValues) => {
if (typeof sqlModels === 'undefined' || !Array.isArray(sqlModels)) {
......@@ -70,7 +72,10 @@ const funcHandleFileds = (source, obj, fieldsColumns) => {
}
}
if (content.comName === 'PartForm') {
const { childFormKey, columnIds } = content;
const {
childFormKey,
columnIds
} = content;
if (childFormKey) {
let thisSource = (obj[childFormKey] && obj[childFormKey].items) || [];
let thisFields = funcHandleFileds(thisSource, obj, fieldsColumns);
......@@ -106,7 +111,10 @@ const funcHandleFileds = (source, obj, fieldsColumns) => {
if (content.enums) {
let options = isJSON(content.enums) ? JSON.parse(content.enums) : [];
options = options.map((x) => {
return { key: x.value, name: x.label };
return {
key: x.value,
name: x.label
};
});
oneFiled.options = options;
}
......@@ -126,7 +134,10 @@ const funcHandleFileds = (source, obj, fieldsColumns) => {
}
}
if (content.comName === 'ChildForm') {
const { childFormKey, columnIds } = content;
const {
childFormKey,
columnIds
} = content;
let thisSource = obj[childFormKey].items;
let thisFields = funcHandleFileds(thisSource, obj, fieldsColumns);
for (let i = 0; i < thisFields.length; i++) {
......@@ -289,7 +300,7 @@ export async function destructionGetDetail(response) {
let optProcess = await findListTaskDefinition({
appId: response.id,
});
if(optProcess){
if (optProcess) {
searchCondition.push({
key: 'taskDefKey',
name: '流程节点',
......@@ -305,7 +316,7 @@ export async function destructionGetDetail(response) {
}
return {
addFields: await translateAddFields(fileds, tableInfo),
addFields: [], // await translateAddFields(fileds, tableInfo),
tableInfo,
allConfigSetInfo: response,
searchCondition,
......@@ -348,6 +359,28 @@ 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 === 'file' && typeof text === 'string') {
let url = text.includes('http') ? text : config.sqlFormsServer + text;
return (
......@@ -387,13 +420,21 @@ export function handleColumns(columns) {
} else if (date.indexOf(item.dataType) > -1) {
// 日期类型字段
item.render = (text, record) => {
if (!isNaN(Number(text)) && Number(text) > 10000000) {
text = Number(text);
if (item.dataFormatStrWeb) {
return moment(text).format(item.dataFormatStrWeb);
return moment(text)
.format(item.dataFormatStrWeb);
}
return moment(text).format(format[item.dataType]);
} else {
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 {
return '';
}
};
......@@ -418,15 +459,7 @@ export function handleColumns(columns) {
}
};
}
/*if (columnsLength > 10 && item.title && !item.width) {
item.width = item.title.length * 30;
if (item.title === '学号') {
item.width = 140;
}
if (item.title.indexOf('时间') > -1) {
item.width = 150;
}
}*/
}
return columns;
}
......@@ -31,7 +31,6 @@ const giveValue = (x) => {
const getId = async (pathname) => {
// 获取流程引擎 事务workId 和表dataBaseId
let idObj = await getOneStopConfig(pathname);
console.log(idObj);
if (typeof idObj === 'undefined' || !idObj) {
console.error('没有找到对应的流程引擎id');
return false;
......@@ -53,9 +52,25 @@ const getPages = (info) => {
return apiRequest('/UnifiedAppFormApi/getWaitPage', info);
};
const filterHeaderColumns = (res, workId) => {
// 27355 门户---单位个人中心,,双选会申请,,不要营业执照字段
if(workId === '1366228504210833408' &&
window.location.href.indexOf('/CompanyCenter') > -1 && Array.isArray(res)
){
res = res.filter((g) => {
return g.dataIndex !== 'LfKUHjglHFM';
})
}
return res;
}
const getColumns = (workId) => {
// 获取表头 workId
return apiRequest('/UnifiedAppFormApi/getFormTitle', { id: workId });
return apiRequest('/UnifiedAppFormApi/getFormTitle', { id: workId }).then((res) => {
return filterHeaderColumns(res, workId);
});
};
const findListTaskDefinition = (params) => {
......
.erweimaModal{
display: grid;
align-items: center;
justify-items: center;
width: 230px;
height: 250px;
margin-left: 20px;
}
......@@ -98,7 +98,7 @@ function AuditButton(props) {
}
});
};
console.log(buttonInfo);
// console.log(buttonInfo);
if (buttonInfo?.isValidateForm === false) {
submitValues(form.getFieldsValue());
} else {
......@@ -141,6 +141,16 @@ function AuditButton(props) {
}
function showModal(str, key, value) {
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){
let needAuditInfo = isJSON(buttonInfo.documentation) && JSON.parse(buttonInfo.documentation)?.needAuditInfo;
if(needAuditInfo && !values.reason){
message.warning('请输入审批理由');
return ;
}
}
setModalContent(`确定${str}吗?`);
setAffairParams({ oldKey: key, btnValue: value });
setVisible(true);
......
......@@ -30,7 +30,7 @@ export default function ActiveMenuComponent({
return <Audit
workId={appId} {...otherProps}/>;
case "BatchAudit": // 批量审批 详情是 iframe
return <Audit
return <BatchAudit
workId={appId} {...otherProps}/>;
case "Detail": // 详情 iframe
return <Detail
......
......@@ -6,7 +6,6 @@ import Audit from "@/webPublic/FormInsertDiy/AffairPage/AuditPage/index.js"; //
import Detail from "@/webPublic/FormInsertDiy/AffairPage/Detail"; //详情
import { getToken } from "@/utils/authority";
import config from "@/config/config";
import { message, Modal, notification, Popconfirm } from "antd";
export default function ActiveMenuComponent2({
routerConfig,
......@@ -29,7 +28,7 @@ export default function ActiveMenuComponent2({
workId={appId}
{...otherProps} />;
case "BatchAudit": // 批量审批
return <Audit
return <BatchAudit
workId={appId}
{...otherProps} />;
case "Detail": // 详情
......
......@@ -2,13 +2,14 @@ import React from 'react';
import RenderForm from '@/webPublic/FormInsertDiy/RenderForm';
import { fetchTemplateById } from '@/webPublic/Services';
import { useState, useEffect } from 'react';
import { Form } from 'antd';
import { Form, Modal } from 'antd';
import { getOneStopConfig } from '@/webPublic/zyd_public/utils/utils';
// const id = '1234718972352397312';
// 考核汇总页面
function OtherCheckRecord({ workId, ...otherProps }) {
// console.log(workId, otherProps);
const pathname = otherProps?.location?.pathname;
const [data, setData] = useState();
const id = workId || getOneStopConfig(pathname);
......@@ -23,6 +24,17 @@ function OtherCheckRecord({ workId, ...otherProps }) {
if (!data) {
return null;
}
if (window.zdyTableTemplateWillMountProps?.showComponentType === 'ModalAndSmartForm') {
// 25841 学生资助管理/勤工助学-用工部门/学生申请岗位审核,2020010375 发送面试邀请后 学生没有收到 邀请信息
// 通过增加配置项 达到 弹窗中嵌入表单的效果.
const { ModalAndSmartForm_ModalProps } = window.zdyTableTemplateWillMountProps;
const FormNew = Form.create(window.zdyTableTemplateWillMountProps?.formCreateOptions || undefined)(RenderForm);
const { ModalAndSmartFormProps } = otherProps;
window.ModalAndSmartFormProps = ModalAndSmartFormProps;
return <Modal {...ModalAndSmartForm_ModalProps}>
<FormNew postData={data} style={{ padding: 0 }} />
</Modal>;
} else {
const FormNew = Form.create(window.zdyTableTemplateWillMountProps?.formCreateOptions || undefined)(RenderForm);
return <FormNew postData={data} style={{ padding: 0 }} />;
......
......@@ -6,6 +6,7 @@ import ButtonDiy from '@/baseComponent/ButtonDiy';
import config from '@/config/config';
import { connect } from 'dva';
import { exportExcel } from 'xlsx-oc';
import { getToken } from '@/utils/authority';
const Step = Steps.Step;
const TabPane = Tabs.TabPane;
......@@ -195,9 +196,12 @@ export default class ImportUtil extends React.PureComponent {
name: 'file',
action: config.sqlFormsServer + '/upload',
headers: {
authorization: 'authorization-text',
},
headers: {
Authorization: `bearer ${getToken()}`,
},
data: {
token: getToken(),
},
accept: '.xlsx',
showUploadList: false,
onChange: (info) => {
......
......@@ -4,42 +4,48 @@ import styles from './index.less';
import { fetchTemplateByCode, fetchTableItem } from '@/webPublic/Services';
import { isJSON } from '@/webPublic/zyd_public/utils/utils';
export default function RenderForm({ get = 'web', isCg = 'yes', style, ...rest }) {
let content = rest?.postData?.unifiedServicePatternModel?.content;
if (isJSON(content)) {
content = JSON.parse(content);
}
const tableRoot = useRef();
useEffect(() => {
const timerId = setTimeout(() => {
const div = tableRoot.current && tableRoot.current.root;
if (div) {
div.style.overflow = 'unset';
}
let new_element = document.createElement('style');
new_element.innerHTML = `main>div>#web_table .login-form>div>div>div{
export default function RenderForm({
get = 'web',
isCg = 'yes',
style,
...rest
}) {
let content = rest?.postData?.unifiedServicePatternModel?.content;
if (isJSON(content)) {
content = JSON.parse(content);
}
const tableRoot = useRef();
useEffect(() => {
const timerId = setTimeout(() => {
const div = tableRoot.current && tableRoot.current.root;
if (div) {
div.style.overflow = 'unset';
}
let new_element = document.createElement('style');
new_element.innerHTML = `main>div>#web_table .login-form>div>div>div{
overflow: inherit !important;
}`;
document.body.appendChild(new_element);
}, 0);
return () => {
clearTimeout(timerId);
};
}, []);
if (!content) {
return null;
}
return (
<div className={styles.zyd_onestop_style_class} style={style}>
<ZdyTable ref={tableRoot}
document.body.appendChild(new_element);
}, 0);
return () => {
clearTimeout(timerId);
};
}, []);
if (!content) {
return null;
}
return (
<div className={styles.zyd_onestop_style_class} style={style}>
<ZdyTable ref={tableRoot}
get={get}
{...rest}
isQuery={true}
init={undefined}
{...content}
/>
</div>
);
</div>
);
}
/**
......@@ -47,30 +53,37 @@ export default function RenderForm({ get = 'web', isCg = 'yes', style, ...rest }
* @param {Object} content 表单内容,传入对象
* @param {String} templateCode 表单模板
*/
export function RenderFormByContent({ content, templateCode, form, get, isCg }) {
const [formTemplate, setFormTemplate] = useState();
useEffect(
() => {
fetchTemplateByCode(templateCode).then((res) => {
if (res) {
setFormTemplate(res);
}
});
},
[templateCode],
);
export function RenderFormByContent({
content,
templateCode,
form,
get,
isCg
}) {
const [formTemplate, setFormTemplate] = useState();
useEffect(
() => {
fetchTemplateByCode(templateCode)
.then((res) => {
if (res) {
setFormTemplate(res);
}
});
},
[templateCode],
);
return formTemplate ? (
<RenderForm
get={get}
isCg={isCg}
postData={{
content: JSON.stringify(content),
unifiedServicePatternModel: formTemplate,
}}
form={form}
/>
) : null;
return formTemplate ? (
<RenderForm
get={get}
isCg={isCg}
postData={{
content: JSON.stringify(content),
unifiedServicePatternModel: formTemplate,
}}
form={form}
/>
) : null;
}
/**
......@@ -81,35 +94,40 @@ export function RenderFormByContent({ content, templateCode, form, get, isCg })
* @param {Function} onLoad 数据加载的回调函数
*/
export function RenderFormByObjId({
objId,
dataTypeKey,
dataTypeValue,
onLoad,
templateCode,
form,
get,
isCg,
}) {
const [content, setContent] = useState({});
useEffect(
() => {
fetchTableItem({ dataObjId: objId, key: dataTypeKey, value: dataTypeValue }).then((res) => {
setContent(res || {});
if (onLoad) {
onLoad(res);
}
});
},
[objId, dataTypeKey, dataTypeValue],
);
objId,
dataTypeKey,
dataTypeValue,
onLoad,
templateCode,
form,
get,
isCg,
}) {
const [content, setContent] = useState({});
useEffect(
() => {
fetchTableItem({
dataObjId: objId,
key: dataTypeKey,
value: dataTypeValue
})
.then((res) => {
setContent(res || {});
if (onLoad) {
onLoad(res);
}
});
},
[objId, dataTypeKey, dataTypeValue],
);
return (
<RenderFormByContent
get={get}
isCg={isCg}
content={content}
templateCode={templateCode}
form={form}
/>
);
return (
<RenderFormByContent
get={get}
isCg={isCg}
content={content}
templateCode={templateCode}
form={form}
/>
);
}
......@@ -6,7 +6,10 @@
:global{
.ant-form-item-children{
.ant-select{
width: 70% !important; //可能有问题
//width: 70% !important; // 可能有问题
// 这是2020年11月写的代码
// 26149 学籍管理-在校学生管理【包括跟读生管理】,每个页面查询框选择数据显示完整
// 把这个width: 70% 70% !important 屏蔽了. 如果有问题 到时候再说.
}
}
.ant-pagination-options .ant-select{
......
......@@ -171,7 +171,9 @@ const getSearchCondition = async (id, appId = undefined) => {
return res.filter((x) => {
return x.isShowQuery !== false && x.isHidden === false;
});
}
}else{
return [];
}
});
// console.log(JSON.stringify(searchHeaders));
for (let item of searchHeaders) { // H:\project\one_stop_front\src\pages\AdminSystem\pages\ddl\formList\index.js
......@@ -217,7 +219,6 @@ const getSearchCondition = async (id, appId = undefined) => {
}
const condition = getFormArrayConfig(searchHeaders);
console.log(condition);
condition.forEach((x) => {
x.required = false;
......
......@@ -11,6 +11,7 @@ import { setOneStopActiveMenusConfig, setOneStopConfig } from '@/webPublic/zyd_p
import { getOneStopConfigList } from '@/webPublic/one_stop_public/publicServices';
import prepareShow from '@/webPublic/one_stop_public/Table/prepareShow';
import { queryApiVersion } from '@/webPublic/one_stop_public/utils/queryConfig';
import { getOneStopMyInfo } from '@/webPublic/one_stop_public/utils/utils';
// 根据模板code查询模板数据
// 查询表格中某条数据
......@@ -132,7 +133,7 @@ export const getHistoryFormDetail = (params = {}) => {
if (res) {
// console.log(queryApiVersion());
if (queryApiVersion() === '2.0') { // 2.0的接口 流程日志单独获取
return api2_0_getTaskInfo(params)
return api2_0_getTaskInfo(params)
.then((res2) => {
return {
...res,
......@@ -145,7 +146,8 @@ export const getHistoryFormDetail = (params = {}) => {
} else {
return null;
}
}).then((g) => {
})
.then((g) => {
// console.log(g);
return g;
});
......@@ -190,10 +192,7 @@ export const getAppTypeList = () => {
export const getListByTreeList = (params = {}) => {
return uaaRequest('/UnifiedAppApi/getListByTree', params);
};
export const getOneStopMyInfo = (params = {}) => {
return uaaRequest('/UserApi/getMy', params);
};
export { getOneStopMyInfo };
export function getOneStopActiveMenus(key) {
return new Promise((resolve, reject) => {
......@@ -206,14 +205,6 @@ export function getOnestopKey(key = '', formKey = 'key_list', formValue = 'value
getOneStopActiveMenus()
.then((res) => {
});
getOneStopMyInfo({})
.then((res) => {
if (res) {
localStorage.setItem('user', JSON.stringify(res));
}
});
return fetchTableData({
dataObjId: config.onestopConfigDataObjId || '1248169933162938368',
pageNo: 1,
......
......@@ -182,7 +182,7 @@ export default class userButton extends Component {
<span style={{...stylesList.body_span, ...stylesList.body_span_1}}>
{isSecond ? '发起说明' : '审批说明'}
</span>
<span>
<span id={'textarea_shen_pi_li_you'}>
<TextArea
value={value}
onChange={this.onChange}
......
......@@ -27,6 +27,7 @@ import {
CompositeDecorator,
RichUtils,
} from 'draft-js';
import { getToken } from '@/webPublic/one_stop_public/utils/token';
const FormItem = Form.Item;
function getBlockStyle(block) {
......@@ -497,6 +498,12 @@ class AttrForm extends React.Component {
showUploadList={false}
name="file"
action={config.uploadUrl}
headers={{
Authorization: `bearer ${getToken()}`,
}}
data={{
token: getToken(),
}}
onChangemultiple={false}
style={{ padding: 0 }}>
{url ? (
......@@ -584,6 +591,12 @@ class VideoForm extends React.Component {
showUploadList={false}
name="file"
action={config.uploadUrl}
headers={{
Authorization: `bearer ${getToken()}`,
}}
data={{
token: getToken(),
}}
onChangemultiple={false}
style={{ padding: 0 }}>
{url ? (
......@@ -670,6 +683,12 @@ class PicForm extends React.Component {
name="file"
action={config.uploadUrl}
onChange={this.onChange}
headers={{
Authorization: `bearer ${getToken()}`,
}}
data={{
token: getToken(),
}}
multiple={false}
style={{ padding: 0 }}>
{url ? (
......
......@@ -501,6 +501,12 @@ class AttrForm extends React.Component {
showUploadList={false}
name="file"
action={config.uploadUrl}
headers={{
Authorization: `bearer ${getToken()}`,
}}
data={{
token: getToken(),
}}
onChangemultiple={false}
style={{ padding: 0 }}>
{url ? (
......@@ -589,6 +595,12 @@ class VideoForm extends React.Component {
name="file"
action={config.uploadUrl}
onChangemultiple={false}
headers={{
Authorization: `bearer ${getToken()}`,
}}
data={{
token: getToken(),
}}
style={{ padding: 0 }}>
{url ? (
<video src={config.httpServer + url} controls="controls">
......@@ -674,6 +686,12 @@ class PicForm extends React.Component {
name="file"
action={config.uploadUrl}
onChange={this.onChange}
headers={{
Authorization: `bearer ${getToken()}`,
}}
data={{
token: getToken(),
}}
multiple={false}
style={{ padding: 0 }}>
{url ? (
......
import fetch from 'dva/fetch';
import React from 'react';
import ReactDOM from 'react-dom';
import {
Select,
Button,
Modal,
Input,
Transfer,
Row,
Col,
Form,
message,
notification,
} from 'antd';
import { connect } from 'dva';
import { getToken } from '../utils/token';
import config from '@/webPublic/one_stop_public/config';
import QueryItem from './QueryItem';
import OrderItem from './OrderItem';
import FormdataWrapper from '../utils/object-to-formdata-custom';
import ButtonDiy from './ButtonDiy/ButtonDiy';
const Option = Select.Option;
var keyX = 1;
function swapArray(arr, index1, index2) {
arr[index1] = arr.splice(index2, 1, arr[index1])[0];
return arr;
}
/**
*
* 2019/02/21 修改导出方式为fetch
* 增加 props.fileName 设置导出文件名称
* mustQuerys 设置搜索条件 demo :
* mustQuerys={[{
hql: 'bean.adminStatus',
x: '=',
v: "pass",
c: 'com.zysoft.app.zydxl.entity.base.BaseImportantWatch$Status',
notes: 'com.zysoft.app.zydxl.entity.base.BaseImportantWatch$Status',
}]}
*/
const FormItem = Form.Item;
@connect(({ DataObj, loading }) => ({
DataObj,
loading: loading.models.DataObj,
}))
@Form.create()
export default class ExportCurrentInfo extends React.Component {
constructor(props) {
super(props);
this.state = {
confirmLoading: false,
};
}
exportData = () => {
let divElement = document.getElementById('downloadDiv');
let downloadUrl = config.httpServer + '/DataObjApi/exportCurrent?';
const token = getToken() != null && getToken() != 'null' ? getToken() : '0000';
downloadUrl = `${downloadUrl}token=${token}`;
let param = {
dataObjId: this.props.objId,
query: this.props.query,
custom: this.props.custom,
sql: this.props.sql,
index: this.props.index,
};
this.downloadFile(downloadUrl, param);
};
downloadFile(url, params) {
this.setState({ confirmLoading: true });
fetch(url, {
method: 'POST',
body: FormdataWrapper(params),
})
.then((res) => {
if (res.status != '200') {
return res.json();
} else {
return res.blob();
}
})
.then((data) => {
if (data instanceof Blob) {
let a = document.createElement('a');
let url = window.URL.createObjectURL(data);
let filename =
(this.props.fileName ? this.props.fileName : '导出文件.') + (this.props.ext || 'xlsx');
a.href = url;
a.download = filename;
a.click();
window.URL.revokeObjectURL(url);
a = null;
} else {
notification.error({
message: `文件导出错误`,
description: data.errMsg,
});
}
})
.catch((err) => {
notification.error({
message: `网络请求超时`,
});
})
.finally(() => {
this.setState({ confirmLoading: false });
});
}
render() {
const btn = {
name: '导出',
type: 'default',
className: 'defaultBlue',
...(this.props.btn ? this.props.btn : {}),
};
return (
<span>
<ButtonDiy {...btn} loading={this.state.confirmLoading} handleClick={this.exportData} />
<div id="downloadDiv" style={{ display: 'none' }} />
</span>
);
}
}
/**
* 钟是志
* 2022年5月25日
* openSelectFieldsModal 弹窗
*/
import React, { useEffect, useState } from 'react';
import { isJSON } from '@/webPublic/one_stop_public/copy';
import { Checkbox, Col, Modal, Row, message } from 'antd';
import ButtonDiy from '@/webPublic/one_stop_public/App/ButtonDiy/ButtonDiy';
import styles from './style.less';
export default function SelectModal({
custom,
index,
show,
changeShow,
downloadFile,
}) {
const [fields, setFields] = useState([]);
const [buttonName, setButtonName] = useState('全部选中');
const [strInput, setStrInput] = useState([]);
const [inputDisable, setInputDisable] = useState(false); // 点击全部选中整族失效
useEffect(() => {
if (isJSON(custom)) {
let exportConfig = JSON.parse(custom)?.exportConfig;
if (exportConfig && exportConfig.length > index && index >= 0) {
setFields(exportConfig[index].fields);
}
}
}, [custom]);
const arrayChange = (checkedValues) => {
setStrInput(checkedValues);
};
const selectAllAndCancelAll = () => {
const all = fields.map(item => item.k);
if (strInput.length === all.length) {
setStrInput([]);
setButtonName('全部选中');
} else {
setStrInput(all);
setButtonName('全部取消');
}
};
const handleOk = () => {
if (!strInput || !strInput.length) {
message.warning('请选择导出的列');
return false;
}
const newFileds = fields.filter((item) => {
return strInput.includes(item.k);
});
if (!newFileds || !newFileds.length) {
changeShow();
return false;
}
const newCustom = JSON.parse(custom);
newCustom.exportConfig[index].fields = newFileds;
const newParams = {
...show.param,
custom: JSON.stringify(newCustom),
};
downloadFile(show.downloadUrl, newParams);
};
return !!show && <Modal
title={'请选择导出列'}
visible={true}
onOk={handleOk}
onCancel={changeShow}
width={900}
>
<Row>
<Col span={4}>导出列数据
<Col>
<ButtonDiy
name={buttonName}
handleClick={selectAllAndCancelAll}
/>
</Col>
</Col>
<Col span={20}>
<div className={styles.formbody}>
<Checkbox.Group
options={fields.map((g) => {
return {
label: g.n,
value: g.k,
};
})}
onChange={arrayChange}
value={strInput}
disabled={inputDisable}
/>
</div>
</Col>
</Row>
</Modal>;
}
import fetch from 'dva/fetch';
import React from 'react';
import {
Form,
notification,
} from 'antd';
import { connect } from 'dva';
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 SelectModal from '@/webPublic/one_stop_public/App/ExportCurrentInfo/SelectModal';
/**
*
* 2019/02/21 修改导出方式为fetch
* 增加 props.fileName 设置导出文件名称
* mustQuerys 设置搜索条件 demo :
* mustQuerys={[{
hql: 'bean.adminStatus',
x: '=',
v: "pass",
c: 'com.zysoft.app.zydxl.entity.base.BaseImportantWatch$Status',
notes: 'com.zysoft.app.zydxl.entity.base.BaseImportantWatch$Status',
}]}
*/
@connect(({ DataObj, loading }) => ({
DataObj,
loading: loading.models.DataObj,
}))
@Form.create()
export default class ExportCurrentInfo extends React.Component {
constructor(props) {
super(props);
this.state = {
confirmLoading: false,
showSelectModal: false,
};
}
changeShowSelectModal = () => {
this.setState({
showSelectModal: !this.state.showSelectModal,
})
}
exportData = () => {
let downloadUrl = config.httpServer + '/DataObjApi/exportCurrent?';
const token = getToken() != null && getToken() != 'null' ? getToken() : '0000';
downloadUrl = `${downloadUrl}token=${token}`;
let param = {
dataObjId: this.props.objId,
query: this.props.query,
custom: this.props.custom,
sql: this.props.sql,
index: this.props.index,
};
if(this.props.openSelectFieldsModal){ // 26598 自定义数据导出---导出字段调整,,,注意数据权限
this.setState({
showSelectModal: {
param,
downloadUrl,
}
});
return false;
}
this.downloadFile(downloadUrl, param);
};
downloadFile(url, params) {
this.setState({ confirmLoading: true });
let newApi = giveFilePostDataInfoForTrue(params, url);
fetch(newApi.url, {
method: 'POST',
body: FormdataWrapper(newApi.datas,
),
})
.then((res) => {
if (res.status != '200') {
return res.json();
} else {
return res.blob();
}
})
.then((data) => {
if (data instanceof Blob) {
let a = document.createElement('a');
let url = window.URL.createObjectURL(data);
let filename =
(this.props.fileName ? this.props.fileName : '导出文件.') + (this.props.ext || 'xlsx');
a.href = url;
a.download = filename;
a.click();
window.URL.revokeObjectURL(url);
a = null;
} else {
notification.error({
message: `文件导出错误`,
description: data.errMsg,
});
}
})
.catch((err) => {
notification.error({
message: `网络请求超时`,
});
})
.finally(() => {
this.setState({ confirmLoading: false });
});
}
render() {
const btn = {
name: '导出',
type: 'default',
className: 'defaultBlue',
...(this.props.btn ? this.props.btn : {}),
};
const { custom, index, openSelectFieldsModal } = this.props;
const { showSelectModal } = this.state;
return (
<span>
<ButtonDiy {...btn} loading={this.state.confirmLoading} handleClick={this.exportData} />
{
openSelectFieldsModal &&
<SelectModal custom={custom}
index={index}
changeShow={this.changeShowSelectModal}
show={showSelectModal}
downloadFile={this.downloadFile.bind(this)}
/>
}
<div id="downloadDiv" style={{ display: 'none' }} />
</span>
);
}
}
.formbody{
display: flex;
flex-wrap: wrap;
height: 450px;
overflow: auto;
label{
width: 30%;
box-sizing: border-box;
}
}
......@@ -7,6 +7,7 @@ import FormdataWrapper from '../utils/object-to-formdata-custom';
import config from '@/webPublic/one_stop_public/config';
import { connect } from 'dva';
import { getMessage, getModal } from '@/webPublic/one_stop_public/utils/utils';
import { giveFilePostDataInfoForTrue } from '@/webPublic/one_stop_public/Base16';
const Modal = getModal();
const message = getMessage();
......@@ -52,6 +53,13 @@ export default class ImportUtil extends React.PureComponent {
showModal = () => {
this.setState({
sucData: [],
errData: [],
column: [],
current: 0,
isShow: true,
isNextDisabled: false,
filekey: '',
visible: true,
});
};
......@@ -218,9 +226,11 @@ export default class ImportUtil extends React.PureComponent {
fileName,
token: getToken(),
};
fetch(`${config.httpServer}/DataObjApi/importTemplateDownload`, {
let url = `${config.httpServer}/DataObjApi/importTemplateDownload`;
let newParams = giveFilePostDataInfoForTrue(params, url);
fetch(newParams.url, {
method: 'POST',
body: FormdataWrapper(params),
body: FormdataWrapper(newParams.datas),
})
.then((res) => {
if (res.status != '200') {
......@@ -256,9 +266,11 @@ export default class ImportUtil extends React.PureComponent {
const props = {
name: 'file',
action: config.uploadUrl,
headers: {
authorization: 'authorization-text',
Authorization: `bearer ${getToken()}`,
},
data: {
token: getToken(),
},
accept: '.xlsx',
showUploadList: false,
......
const encryptApiList = [
{
api: 'DataColumnApi/getOptions',
key: ['filterSql'],
},
{
api: 'UnifiedServicePatternApi/updateForm',
},
{
api: 'UnifiedServicePatternApi/getDetail',
},
{
api: 'SqlManageEntityApi/add',
},
{
api: 'SqlManageEntityApi/find',
},
{
api: 'DataObjApi/addFormData',
},
{
api: 'DataColumnApi/add',
},
{
api: 'UnifiedAppApi/getDetail',
},
{
api: 'UnifiedServiceApi/getDetail',
},
{
api: 'UnifiedAppFormApi/getFormDetail',
},
{
api: '/CmsApi/',
},
{
api: 'DataColumnApi/getLabels',
key: ['allValues'],
filterEmpty: ['allValues'],
setNull: true, // 置空这个字段
},
{
api: 'DataColumnApi/getSqlOptions',
key: ['allValues', 'sqlKey'],
filterEmpty: ['allValues'],
query: true, // 调另外一个接口查询这个的替换值
},
{
api: 'DataColumnApi/getSqlLabels',
key: ['allValues'],
filterEmpty: ['allValues'],
query: true,
},
{
api: 'DataColumnApi/getSqlData',
key: ['allValues', 'sqlKey'],
filterEmpty: ['sqlKey'],
query: true,
},
{
api: 'DataColumnApi/getSqlColumn',
key: ['json'],
},
{
api: 'DataRightApi/add',
key: ['filterSql'],
// filterEmpty: ['filterSql'],
},
{
api: 'DataRightApi/addBatch',
key: ['filterSql'],
},
{
api: 'DataObjApi/add',
key: ['sqlScript'],
},
{
api: 'DataObjApi/getFormDataList',
key: ['custom'],
},
{
api: 'DataObjApi/exportWord',
key: ['params'],
},
{
api: 'DataObjApi/getFormDataPage',
key: ['sql', 'custom'],
filterEmpty: ['sql', 'custom'],
yinShe: {
sql: 's',
query: 'chaxun',
querys: 'chaxuns',
sorter: 'paixu',
orders: 'paixus',
},
},
{
api: 'UserApi/getPage',
key: ['addSignSql'],
},
{
api: 'UnifiedAppFormApi/examineProcess',
key: ['taskForm'],
},
{
api: 'UnifiedAppFormApi/saveDraft',
key: ['content'],
},
{
api: 'UnifiedAppFormApi/startProcess',
key: ['content'],
},
{
api: 'UnifiedAppFormApi/startProcessByService',
key: ['content'],
},
{
api: 'UnifiedAppFormApi/getHandleUser',
key: ['content'],
},
{
api: 'SqlManageEntityApi/findParamsKey',
key: ['sqlKey'],
},
{
api: 'UnifiedServiceApi/config', // 禅道 25034 宿舍管理/宿舍维修审核,2021030576L 加个字段 做个字段排序
key: ['config'],
},
];
const resBinaryApiList = [
{
api: 'UnifiedAppApi/getDetail',
},
{
api: 'UnifiedServiceApi/getDetail',
},
{
api: 'UnifiedAppFormApi/getFormDetail',
},
{
api: 'UnifiedServicePatternApi/getDetail',
},
{
api: 'SqlManageEntityApi/find',
},
]
export { resBinaryApiList };
export default encryptApiList;
......@@ -36,13 +36,14 @@ import styles from './styles.less';
import TrunToDetail from './trunToDetail';
import Countersign from './components/Countersign';
import ChildTaskModel from './ChildTaskModel';
import { checkNeedFormValidateFieldsAndScroll, must, submitValues } from './splitDetailSplit';
import { checkNeedFormValidateFieldsAndScroll, must, submitValues, checkNeedWriteAuditInfo } from './splitDetailSplit';
import { queryApiVersion, queryApiActionPath } from '@/webPublic/one_stop_public/utils/queryConfig';
import { isJSON } from '@/webPublic/zyd_public/utils/utils';
import HistoryFormList from '@/webPublic/one_stop_public/DetailForAudit/HistoryFormList';
@Form.create()
@connect()
export default class GetDetail extends Component {
export default class DetailSplit extends Component {
constructor() {
super();
this.state = {
......@@ -264,7 +265,7 @@ export default class GetDetail extends Component {
});
if (getToken()) {
const user = localStorage.getItem('user');
if(user && isJSON(user)){
if (user && isJSON(user)) {
this.setState({
userInfo: JSON.parse(user),
});
......@@ -319,6 +320,17 @@ export default class GetDetail extends Component {
btnValue,
});
let needWriteAuditInfo = checkNeedWriteAuditInfo({
btns,
btnValue,
});
if (needWriteAuditInfo && !value) {
let d = document.getElementById('textarea_shen_pi_li_you');
if (d) {
message.warning('请输入审批理由');
return false;
}
}
const argumentsSubmitValue = {
isCloseFlowPath,
radiovalue,
......@@ -338,12 +350,12 @@ export default class GetDetail extends Component {
handleUser,
};
if (!checkSumbitInfo) {
if (!checkSumbitInfo) { // 如果不需要校验 直接提交数据
const values = this.props.form.getFieldsValue();
argumentsSubmitValue.values = values;
submitValues(argumentsSubmitValue);
} else {
this.props.form.validateFieldsAndScroll((err, values) => {
this.props.form.validateFieldsAndScroll((err, values) => { // 校验是否填了必填字段
if (!err) {
argumentsSubmitValue.values = values;
submitValues(argumentsSubmitValue);
......@@ -388,39 +400,7 @@ export default class GetDetail extends Component {
changePadding = value => {
this.setState({ paddingBottom: value });
};
/**
* @function 历史表单展示
* @description: 历史表单二次封装,独立form主要防止新表单进行输入时会同步刷新历史表单问题
* @param {string} key 模板key值
* @param { any } postData 参数
* @param { any } obj 默认值
* @param { any } form form控件
* @param { any } routerState 路由参数
* @return: 渲染组件
*/
OldFromZdy = Form.create()(function name({
key,
postData,
obj,
taskId,
form,
formKey,
routerState,
}) {
return (
<ZdyTable
key={key}
get='web'
postData={postData}
taskId={taskId}
obj={obj}
form={form}
formKey={formKey}
routerState={routerState}
/>
);
});
render() {
const {
......@@ -472,6 +452,8 @@ export default class GetDetail extends Component {
computedMatch: this.props?.computedMatch,
route: this.props?.route,
};
// console.log(data, isAllPrint);
return (
<Fragment>
<div
......@@ -526,7 +508,7 @@ export default class GetDetail extends Component {
)}
{data.appName ? data.appName : '当前表单'}
{isEnd || isAllPrint || showPrint ? (
{(isEnd || isAllPrint) && showPrint !== false ? (
<>
<Popconfirm
onConfirm={() => {
......@@ -572,7 +554,7 @@ export default class GetDetail extends Component {
okText='确定'
cancelText='取消'
>
{data.isPrint == null || data.isPrint || isAllPrint || showPrint ? (
{(data.isPrint == null || data.isPrint || isAllPrint) && showPrint !== false ? (
<Button
style={{
position: 'absolute',
......@@ -596,7 +578,7 @@ export default class GetDetail extends Component {
</div>
{isLoading ? (
<>
<Card style={{width: '100%'}}>
<Card style={{ width: '100%' }}>
{!isCloseUserDetail && (
<div className={styles.body_hea}>
<h3>发起人信息</h3>
......@@ -681,58 +663,19 @@ export default class GetDetail extends Component {
)}
</div>
)}
<div
className={styles.HistoryFormList}
id='card_table'
ref={el => (this.componentRef = el)}
style={{ padding: !isShowTitle ? '50px' : '' }}
>
{hisTaskFormKeys.formKeys && hisTaskFormKeys.formKeys.length > 0
? hisTaskFormKeys.formKeys.map((item, index) => (
<Fragment key={item.taskName}>
{isShowTitle ? (
<h3
style={{
display: 'flex',
alignItems: 'center',
}}
>
<SVG name='vertical' color='#999999' height='24' />
{item?.taskName ?? '历史流程表单'}
</h3>
) : (
''
)}
{!data ? (
<div
style={{
width: '100%',
height: 200,
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
}}
>
<Spin size='large' spinning={true}/>
</div>
) : (
/* <div>
123临时注释
</div>*/
<this.OldFromZdy
key={item.formKey}
get='web'
taskId={data.taskId}
postData={data}
obj={data && data.isMultiple ? item.taskForm : hisTaskFormKeys.formData}
formKey={item.formKey}
routerState={routerState}
/>
)}
</Fragment>
))
: ''}
{isHandle === true && !!data.taskFormKey ? (
<HistoryFormList data={data}
formKeys={hisTaskFormKeys?.formKeys}
isShowTitle={isShowTitle}
routerState={routerState}
formData={hisTaskFormKeys?.formData}
/>
{isHandle === true && !!data.taskFormKey && (
<>
{isShowTitle ? (
<h3
......@@ -761,12 +704,10 @@ export default class GetDetail extends Component {
''
)}
</>
) : (
''
)}
</div>
</Card>
<Card style={{width: '100%'}}>
<Card style={{ width: '100%' }}>
<div className={styles.body_content} style={{ minHeight: '300px' }}>
<div id={'btnsModalMountDiv'}></div>
<h3>
......@@ -921,7 +862,7 @@ export default class GetDetail extends Component {
<div className={styles.buttonList}>
{isHandle === true ? (
<>
<BtnOk
<BtnOk // 审批按钮和弹窗
Sign={!!setData?.userSign}
isSumbitLoading={isSumbitLoading}
isSecond={isSecond}
......@@ -1011,7 +952,7 @@ export default class GetDetail extends Component {
alignItems: 'center',
}}
>
<Spin size='large' spinning={true}/>
<Spin size='large' spinning={true} />
</div>
)}
<PortalFlowExamineModal // 流程图
......@@ -1027,7 +968,7 @@ export default class GetDetail extends Component {
value={trunData}
init={this.getInit}
/>
{data?.appName && (
{data?.appName && ( // 加签
<Countersign
taskId={data.taskId}
data={data}
......
/**
* 钟是志
* 拆分流程详情页面
* 解决禅道bug 26569 审核详情中信息显示重复了
* 2022年5月21日
* 配置方法 在模板挂载前运行公式中返回
* window.zdyTableTemplateWillMountProps.detailCollapseProps = {
defaultActiveKey: ['24a3dfc0-1829-4b0c-a7cc-a74baf20c89e'],
* };
* */
import React, { useRef, useState, useEffect, Fragment } from 'react';
import SVG from '@/webPublic/one_stop_public/DetailForAudit/components/SVG';
import { Form, Spin, Collapse, Icon } from 'antd';
import styles from './styles.less';
import ZdyTable from '@/webPublic/one_stop_public/Table';
const { Panel } = Collapse;
const customPanelStyle = {
background: '#fff',
borderRadius: 4,
marginBottom: 24,
border: 0,
overflow: 'hidden',
};
export default function HistoryFormList({
// isShowTitle = false,
formKeys = [],
data = {},
routerState = {},
formData,
}) {
if (!formKeys || !formKeys.length) {
return null;
}
const detailCollapseProps = window.zdyTableTemplateWillMountProps?.detailCollapseProps || {};
return (
<Collapse bordered={false}
defaultActiveKey={formKeys.map((g) => g.formKey)}
expandIcon={({ isActive }) => <Icon type='caret-right' rotate={isActive ? 90 : 0} />}
style={customPanelStyle}
{...detailCollapseProps}
>
{Array.isArray(formKeys) && formKeys.length > 0 &&
formKeys.map((item, index) => {
return (
<Panel header={<h3 className={styles.h3}
>
<SVG name='vertical' color='#999999' height='24' />
{item?.taskName ?? '历史流程表单'}
</h3>} key={item.formKey}>
{!data ? (
<div className={styles.div1}>
<Spin size='large' spinning={true} />
</div>
) : (
<OldFromZdy
key={item.formKey}
get='web'
taskId={data.taskId}
postData={data}
// obj={data && data.isMultiple ? item.taskForm : hisTaskFormKeys.formData}
obj={data && data.isMultiple ? item.taskForm : formData}
formKey={item.formKey}
routerState={routerState}
/>
)}
</Panel>
);
})
}
</Collapse>
);
}
/**
* @function 历史表单展示
* @description: 历史表单二次封装,独立form主要防止新表单进行输入时会同步刷新历史表单问题
* @param {string} key 模板key值
* @param { any } postData 参数
* @param { any } obj 默认值
* @param { any } form form控件
* @param { any } routerState 路由参数
* @return: 渲染组件
*/
const OldFromZdy = Form.create()(function name({
key,
postData,
obj,
taskId,
form,
formKey,
routerState,
}) {
return (
<ZdyTable
key={key}
get='web'
postData={postData}
taskId={taskId}
obj={obj}
form={form}
formKey={formKey}
routerState={routerState}
/>
);
});
......@@ -35,6 +35,7 @@ export default class GetDetail extends Component {
render() {
const {id} = this.state;
console.log(this.props.showPrint);
const {
detailInfoDivStyle = {
backgroundColor: '#FFFFFF',
......@@ -58,7 +59,7 @@ export default class GetDetail extends Component {
style={detailInfoDivStyle}
>
<DetailSplit history={{...this.props.history, location}}
showPrint={getUrlInfo().showPrint === 'true'}
showPrint={this.props.showPrint || false}
/>
</div>
);
......
......@@ -7,7 +7,7 @@ import React from 'react'
import { notification,Modal } from 'antd';
/**
*
*
* @param {string} type 'success 成功 info 注意 warning 警告 error 错误'
* @param {string} title '提示标题'
* @param {string} content '主要内容'
......@@ -105,4 +105,6 @@ export const confirm = (title:string,content:any,handleOk:()=>{},handleCancel:()
onOk:handleOk,
onCancel:handleCancel,
});
}
\ No newline at end of file
}
export default notification;
......@@ -4,6 +4,8 @@ import { preHandle } from '@/webPublic/one_stop_public/utils/myutils';
import { getToken } from '@/webPublic/one_stop_public/utils/token';
import { callbackSubmitData } from '@/webPublic/one_stop_public/models/callbackExamineProcess';
import { getModal } from '@/webPublic/one_stop_public/utils/utils';
import { isJSON } from '@/webPublic/one_stop_public/copy';
import beforeAuditSubmit from '@/webPublic/one_stop_public/utils/beforeAuditSubmit';
const Modal = getModal();
......@@ -33,6 +35,23 @@ const checkNeedFormValidateFieldsAndScroll = ({
return checkSumbitInfo;
};
// 校验是否该按钮需要填写审批意见
const checkNeedWriteAuditInfo = ({
btns,
btnValue,
}) => {
let btnInfo = btns.find(g => g.value + '' === btnValue + '');
let needWrite = false;
if (btnInfo && isJSON(btnInfo?.documentation)) {
let documentation = JSON.parse(btnInfo.documentation);
if (documentation.needAuditInfo) {
needWrite = true; // 26589 毕业生毕业去向中签约和改签审核拒绝必须要填审批说明
}
}
return needWrite;
};
const submitValues = ({
values,
isCloseFlowPath,
......@@ -53,8 +72,7 @@ const submitValues = ({
handleUser,
}) => {
if (isCloseFlowPath) {
}
else if (!radiovalue && isSecond) {
} else if (!radiovalue && isSecond) {
openToast('success', '请选择紧急度');
return;
}
......@@ -91,35 +109,44 @@ const submitValues = ({
token: getToken(),
};
payload = callbackSubmitData(payload);
dispatch({
type: 'affair/getExamineProcess',
payload,
callback: val => {
if (val) {
that.getInit();
that.setState({
isHandle: false,
isSumbitLoading: false,
isSign: checked,
});
Modal.success({
title: '操作成功',
content: (
<div>
<p>操作成功,点击确认刷新页面!</p>
</div>
),
onOk: () => {
that.getInit();
beforeAuditSubmit(payload)
.then(resParams => {
if (!resParams) {
return false;
} else {
dispatch({
type: 'affair/getExamineProcess',
payload: resParams,
callback: val => {
if (val) {
that.getInit();
that.setState({
isHandle: false,
isSumbitLoading: false,
isSign: checked,
});
Modal.success({
title: '操作成功',
content: (
<div>
<p>操作成功,点击确认刷新页面!</p>
</div>
),
onOk: () => {
that.getInit();
},
okText: '确认',
});
} else {
openToast('error', '失败', '请稍后重试');
}
},
okText: '确认',
});
} else {
openToast('error', '失败', '请稍后重试');
}
},
});
});
},
);
};
export { must, checkNeedFormValidateFieldsAndScroll, submitValues };
export { must, checkNeedFormValidateFieldsAndScroll, submitValues, checkNeedWriteAuditInfo };
......@@ -190,3 +190,17 @@
margin-bottom: 24px;
min-height: 50px;
}
.HistoryFormList{
.h3{
display: flex;
align-items: center;
font-weight: bold;
}
.div1{
width: 100%;
height: 200px;
display: flex;
justify-content: center;
align-items: center;
}
}
export function getUrlInfo(){
let url = window.document.location.href.toString();
export function getUrlInfo(urlString = ''){
let url = urlString || window.document.location.href.toString();
let u = url.split("?");
if (typeof(u[1]) == "string") {
u = u[1].split("&");
......
/**
* 徐立
* 2019年9月19日
* 事务发起提交多次弹框
*/
import React, {Component} from 'react';
import { getModal } from '@/webPublic/one_stop_public/utils/utils';
const Modal = getModal();
export default class AddModal extends Component {
constructor(props) {
super(props);
}
render() {
let {visible, handleCancel, handleOk, loading} = this.props;
return (
<Modal
title="提交申请"
visible={visible}
onOk={handleOk}
confirmLoading={loading}
onCancel={handleCancel}
width={400}
>
<p style={{width: '100%', textAlign: 'center', fontSize: 14, color: '#666666'}}>确定要提交申请吗?</p>
</Modal>
)
}
}
/*表单样式*/
.form{
padding: 60px 0;
width: 100%;
padding-top: 0px;
text-align: center;
.form_input{
width: 100%;
display: flex;
justify-content: center;
align-items: center;
.form_span{
float: right;
margin-bottom: 24px;
margin-right: 15px;
color: #666666;
font-size: 14px;
}
.icon_div{
margin-left: -117px;
}
}
.form_people{
width: 100%;
display: flex;
justify-content: center;
span{
float: right;
margin-bottom: 24px;
margin-right: 19px;
color: #666666;
font-size: 14px;
}
.form_people_div{
margin-left: -10px;
>div{
margin-top: -12px;
width: 380px;
height: 100%;
display: flex;
flex-wrap: wrap;
}
.add_people_add_img{
margin-top: 12px;
width: 20%;
height: 68px;
text-align: center;
img{
width: 36px;
height: 36px;
}
}
}
}
}
/*添加任务list组件样式*/
.list_div{
height: 89px;
width: 25%;
margin-top: 12px;
display: flex;
text-align: center;
>div:nth-child(1){
>div{
width: 100%;
height: 36px;
position: relative;
img{
width: 36px;
height: 100%;
}
.img_remove{
width: 12px;
height: 12px;
position: absolute;
right: 12px;
top:0px;
}
}
>p:nth-child(2){
font-size: 12px;
color: #333333;
font-weight: 400;
}
>p:nth-child(3){
font-size: 11px;
color: #cccccc;
font-weight: 400;
}
}
>div:nth-child(2){
margin:0 4px;
flex:1;
color:#cccccc;
}
}
.body_hea{
h3{
font-weight: bold;
color: #333333;
font-size: 16px;
margin-bottom: 28px;
text-align: left;
margin-left: 24px;
}
.hea_title{
font-size: 14px;
color: #666666;
margin-left: 41px;
width: 20%;
text-align: right;
display: inline-block;
}
.hew_content{
color: #333333;
font-size: 14px;
margin-left: 23px;
}
/*事项理由样式*/
.title{
text-align: right;
font-size: 14px;
color: #666666;
}
.body{
padding-left:24px;
color: #333333;
font-size: 14px;
}
/*附件样式*/
.file{
margin-bottom: 16px;
img{
width: 14px;
height: 16px;
margin-right: 9px;
margin-top: -5px;
}
}
.row{
margin-bottom: 28px;
}
}
.header{
width: 100%;
text-align: center;
font-size: 20px;
font-weight: bold;
color: #333333;
padding: 32px 0 32px 0;
}
\ No newline at end of file
/**
钟是志
学工里面的流程申请页面不再使用iframe
2022年5月26日 13:41:08
* */
import React from 'react';
import classNames from 'classnames/bind';
import { connect } from 'dva';
import SponsorForm from './SponsorForm/index';
import { isJSON } from '@/webPublic/one_stop_public/copy';
import { getUrlInfo } from '@/webPublic/one_stop_public/DetailForAudit/utils';
import { setToken } from '@/webPublic/one_stop_public/utils/token';
import { Button } from 'antd';
const names = classNames.bind(require('./style.less'));
/**
* props:{
* id, // 流程id
init, // 表单的初始化数据 用于发起时传入默认值 需要转码 详见 constructor
noNeedApply, // 不需要申请提交按钮
noNeedTitle, // 不需要标题
* }
* */
@connect(({
affair,
modileHome,
}) => ({
affair,
modileHome,
}))
export default class IframeForApply extends React.Component {
constructor(props) {
super(props);
const { token } = getUrlInfo();
if (token) {
setToken(token);
}
const {
id,
init,
noNeedApply,
noNeedTitle,
} = props;
this.state = {
id, // 传入id
init: init && isJSON(init) ? JSON.parse(decodeURIComponent(init)) : undefined,
value: '', // 紧急度选择
btnList: [], // 紧急度按钮返回数据
noNeedApply,
noNeedTitle,
};
this.nodeChild = null;
}
componentDidMount() {
this.props.dispatch({
type: 'urge/GetMyBtn',
payload: {},
callback: val => {
this.setState({
btnList: val,
value: val[val.length - 1].id,
});
},
});
// document.getElementById('root').style.backgroundColor = '#fff';
}
onChange = e => {
this.setState({
value: e.target.value,
});
};
setRadio = value => {
this.setState({
value,
});
};
testGoBack = () => {
this.props.returnList(true);
}
render() {
const {
id,
value,
init,
noNeedApply,
noNeedTitle,
} = this.state;
const { modileHome, returnList } = this.props;
return (
<div
className={names('warp IframeDiy')}
id='tabsTableFromIframe'
style={{
overflowY: 'auto',
height: '100%',
}}
>
{!noNeedTitle && (
<h1 style={{
fontWeight: 'bold',
textAlign: 'center',
}}>
{modileHome?.affair?.name ? modileHome?.affair.name : modileHome?.affair?.appName}
</h1>
)}
{/*<Button onClick={this.testGoBack}>123</Button>*/}
<div className={names('content-container')}>
<div style={{ padding: '0 24px 24px' }}>
<div style={{ minHeight: 569 }}>
<SponsorForm
id={id}
setRadio={this.setRadio}
returnList={returnList}
radioValue={value}
noNeedApplyButton={noNeedApply}
init={init} // 表单的初始化数据 用于发起时传入默认值
history={{
...this.props.history,
location: {
...this.props.history.location,
state: {
id,
noNeedCaoGao: true,
app: {},
},
},
}}
/>
</div>
</div>
</div>
</div>
);
}
}
.warp {
padding: 0 24px 60px;
.breadcrumb-row {
padding: 16px 0;
& > div {
display: inline;
}
}
.content-container {
width: 1200px;
margin: 0 auto;
background: #ffffff;
.top-border{
height: 4px;
background: @primary-color;
}
h1{
text-align: center;
font-size: 20px;
line-height: 108px;
}
}
}
.top-radio-div{
position: relative;
.radio-check{
position: absolute;
left:20px;
top:76%;
}
}
.content {
height: 400px;
margin: 130px 24px 24px 24px;
div{
text-align: center;
img{
margin: 0 30px 0 0;
}
}
>.fostSizeP{
text-align: center;
width: 100%;
font-size: 16px;
font-weight: bold;
color: #666666;
}
}
.IframeDiy{
:global(.antd-pro-pages-portal-pages-sponsor-style-content-container) {
width: 100% !important;
}
}
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论