提交 52b082dd authored 作者: 钟是志's avatar 钟是志

团委评奖评优开发

上级 1edf9e12
......@@ -11,7 +11,7 @@ import * as service from '../publicApiService';
import * as destructionFunc from '../destruction';
import { Link } from 'dva/router';
import { getApplyPage } from '../publicApiService';
import { getHuanGeToken } from '@/utils/authority';
import { getToken } from '@/utils/authority';
import PageHeaderWrapper from '@/components/PageHeaderWrapper';
import List from './List';
......@@ -23,7 +23,8 @@ import config from '@/config/config';
export default class AffairPage extends React.Component {
constructor(props) {
super(props);
const idObj = service.getId();
let pathname = this.props.location.pathname;
const idObj = service.getId(pathname);
if (!idObj) {
message.error('没有配置数据id,无法使用该功能');
}
......@@ -120,7 +121,7 @@ export default class AffairPage extends React.Component {
};
componentDidMount() {
if (!getHuanGeToken()) {
if (!getToken()) {
message.error('您的数据未同步,请联系管理员!');
return false;
}
......@@ -155,7 +156,7 @@ export default class AffairPage extends React.Component {
render() {
const { workId, dataBaseId, addFields, showIframe } = this.state;
const url = config.onestopPC.split('/#/');
let iframeUrl = `${url[0]}/#/IFrameForApply?id=${workId}&token=${getHuanGeToken()}`;
let iframeUrl = `${url[0]}/#/IFrameForApply?id=${workId}&token=${getToken()}`;
// iframeUrl = `http://localhost:8000/onestop/IFrameForApply?id=${workId}&token=${getHuanGeToken()}`;
return (
<PageHeaderWrapper title="">
......
......@@ -6,7 +6,7 @@ import PageHeaderWrapper from '@/components/PageHeaderWrapper';
import List from '../ApplyPage/List';
import ListTab from './ListTab';
import { deepCopy } from '@/baseComponent/utils';
import { getApplyPage, getHandledPage, getWaitPage } from '@/pages/App/FormInsertDiy/AffairPage/publicApiService';
import { getApplyPage, getHandledPage, getWaitPage } from '../publicApiService';
export default class AuditPage extends Component {
constructor(props) {
......
......@@ -7,9 +7,9 @@ import * as services from '@/highOrderComponent/Service';
import StandardTable from '@/components/StandardTable';
import PropTypes from 'prop-types';
import { deepCopy } from '@/baseComponent/utils';
import { date, format, text } from '@/pages/App/FormInsertDiy/config';
import { date, format, text } from '../../config';
import moment from 'moment';
import { handleAudit } from '@/pages/App/FormInsertDiy/AffairPage/publicApiService';
import { handleAudit } from '../publicApiService';
import { Tooltip } from 'antd';
export default class List extends Component {
......
......@@ -15,7 +15,8 @@ import { Link ,hashHistory} from 'dva/router';
export default class Index extends React.Component {
constructor(props) {
super(props);
// const idObj = service.getId();
let pathname = this.props.location.pathname;
const idObj = service.getId(pathname);
if (!idObj) {
message.error('没有配置数据id,无法使用该功能');
}
......
import React, { Fragment, Component } from 'react';
import PageHeaderWrapper from '@/components/PageHeaderWrapper';
import Shell from '@/baseComponent/Shell';
import BlockTitle from '@/baseComponent/BlockTitle';
import ButtonDiy from '@/baseComponent/ButtonDiy';
import router from 'umi/router';
import FormArray from './component/FormArray';
import { getDetailInfo, handleAudit } from '@/pages/App/FormInsertDiy/AffairPage/publicApiService';
import { isJSON } from '@/baseComponent/utils';
import { Col, Row, Timeline, Icon, Tabs } from 'antd';
import ModalBatch from './ButtonListDom/ModalBatch';
import FlowImg from './component/FlowImg';
import { getHuanGeToken } from '@/utils/authority';
import { getToken } from '@/utils/authority';
import config from '@/config/config';
const { TabPane } = Tabs;
/*
export default class Detail extends Component {
/!**
* workId,dataBaseId,record,addFields
* *!/
constructor(props) {
super(props);
this.state = {
detailInfo: {
content: {},
taskInfo: [],
},
show: false,
};
}
componentDidMount() {
const { state } = this.props.location;
const { record } = state;
getDetailInfo(record.id).then((x) => {
if (x) {
if (isJSON(x.content)) {
x.content = JSON.parse(x.content);
}
if(typeof x.content === 'object' && x.content.defaultValues){
for(let z in x.content.defaultValues){
x.content = {
...x.content,
...x.content.defaultValues[z],
}
} }
this.setState({
detailInfo: x,
show: true,
});
}
});
}
buttonDom = () => {
const { detailInfo } = this.state;
const { btns } = detailInfo;
let res = [];
if(typeof btns !== 'undefined' && Array.isArray(btns)){
for(let z of btns){
res.push(
{
type: z.name,
name: z.name,
component: 'ModalBatch',
className: z.name !== '通过' ? 'defaultRed' : 'defaultBlue',
nameSpan: { big: 4, small: 5 },
fileSpan: { big: 1, small: 1 },
values: {
[z.key]: z.value,
},
fields: [
{
key: 'reason',
name: '审核意见',
type: 'textarea',
},
],
beforeSubmit: (props, formValues) => {
return {
taskForm : {},
examineMap: JSON.stringify(formValues),
};
},
sourceKey: 'taskId',
postKey: 'taskIds',
apiServiceApi: handleAudit,
}
)
}
return res;
}
return [];
};
render() {
const { state } = this.props.location;
const { record, addFields, workId } = state;
const { detailInfo, show } = this.state;
const Btns = this.buttonDom();
const dot1 = <Icon type={'check-circle'}
style={{ fontSize: '16px', color: 'rgb(82, 196, 26)' }}/>;
const dot2 = <Icon type={'clock-circle-o'}
style={{ fontSize: '16px', color: 'red' }}/>;
if(!show){
return null;
}
return (<PageHeaderWrapper title="">
<Shell>
<div style={{ height: '54px', padding: '12px 0 12px 12px' }}>
<ButtonDiy name="返回"
className="defaultBlue"
icon="arrow-left"
handleClick={() => {
router.goBack();
}}
/>
{
Btns.map((item)=>{
return <ModalBatch key={item.type}
{...item}
handleSelectRows={()=>{console.log('清空')}}
getPage={()=>{router.goBack()}}
selectRows={[record]}/>
})
}
</div>
</Shell>
<Shell>
<BlockTitle
isSmall={true}
title={'申请信息'}
/>
<Row>
<Col span={20}>
<FormArray config={addFields}
value={detailInfo.content}
changeValue={() => {
console.log(xxx);
}}
disabled={true}
readOnly={true}
fileSpan={{ big: 2, small: 2 }}
nameSpan={{ big: 6, small: 7 }}
/>
</Col>
</Row>
</Shell>
<Shell>
<Tabs>
<TabPane tab={'审批状态'} key={'1'}>
<Row>
<Col span={16} offset={2} style={{paddingTop: '30px', paddingBottom: '30px'}}>
<Timeline>
{
detailInfo.taskInfo.map((item) => {
let reason = item.respdesc;
if(item.taskVariable && item.taskVariable.reason){
reason = item.taskVariable.reason;
}
return (
<Timeline.Item dot={item.endTime ? dot1 : dot2}
key={item.id}
>
{item.assignee ? <p><b>{item.assignee}</b></p> : <p>&nbsp; </p>}
<p>审批流程: {item.name}</p>
<p>审批状态: {item.status}</p>
<p>审批原因: {reason}</p>
</Timeline.Item>
);
})
}
</Timeline>
</Col>
</Row>
</TabPane>
<TabPane tab={'流程图'} key={'2'}>
<FlowImg id={workId}/>
</TabPane>
</Tabs>
</Shell>
</PageHeaderWrapper>)
;
}
}*/
export default class Detail extends Component{
constructor(props){
......@@ -221,7 +39,7 @@ export default class Detail extends Component{
render(){
const { id, showAll } = this.state;
const url = config.onestopPC.split('/#/');
let iframeUrl = `${url[0]}/#/IframeForDetail?id=${id}&token=${getHuanGeToken()}`;
let iframeUrl = `${url[0]}/#/IframeForDetail?id=${id}&token=${getToken()}`;
// iframeUrl = `http://localhost:8000/onestop/IframeForDetail?id=${id}&token=${getHuanGeToken()}`;
return (
<PageHeaderWrapper title="">
......
......@@ -9,7 +9,7 @@ import { apiRequest } from '../request';
import { getFormArrayConfig } from '../config/index';
import { setHuanGeToken } from '@/utils/authority';
import { isJSON } from '@/baseComponent/utils';
import config from '@/config/config';
const giveValue = (x) => {
if(x && x.rows){
......@@ -42,24 +42,15 @@ const getOtherToken = () => {
}
};
const getId = () => { // 获取流程引擎 事务workId 和表dataBaseId
return {
dataBaseId: '1243131275393368064',
workId: '1243131275393368064',
};
let path = window.location.href;
path = path.split('/');
console.log(path.pop());
/// let idObj = config[path.pop()];
debugger;
const getId = (pathname) => { // 获取流程引擎 事务workId 和表dataBaseId
let idObj = config.twOneStopConfig[pathname]; // 路由 /tw/Pjpy/YXTYSBB/Apply
if (typeof idObj === 'undefined') {
console.error('没有找到对应的流程引擎id');
return false;
} else {
const { dataBaseId, workId } = idObj;
return {
dataBaseId,
workId,
dataBaseId: idObj.id,
workId: idObj.id,
};
}
};
......
......@@ -5,7 +5,7 @@
import {extend} from 'umi-request';
import {notification} from 'antd';
import FormdataWrapper from "@/utils/object-to-formdata-custom";
import { getHuanGeToken } from '@/utils/authority';
import { getToken } from '@/utils/authority';
import { offline } from './Toast';
import systemConfig from '@/config/config';
......@@ -70,7 +70,7 @@ const umiRequest = extend({
});
export const request = (url, data, options = {}) => {
const pp = {...data,token: getHuanGeToken()}
const pp = {...data,token: getToken()}
const requestParams = FormdataWrapper(pp)
// 由于自动添加前缀 这里暂时修改getUrl(url)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论