提交 1edf9e12 authored 作者: 钟是志's avatar 钟是志

8350 活动申报-报名时间和活动时间没有限制关系

上级 76d6c137
...@@ -9,8 +9,7 @@ import { message } from 'antd'; ...@@ -9,8 +9,7 @@ import { message } from 'antd';
import React, { Fragment } from 'react'; import React, { Fragment } from 'react';
import * as service from '../publicApiService'; import * as service from '../publicApiService';
import * as destructionFunc from '../destruction'; import * as destructionFunc from '../destruction';
import { Link, hashHistory } from 'dva/router'; import { Link } from 'dva/router';
import { getDefaultValues } from '../destruction';
import { getApplyPage } from '../publicApiService'; import { getApplyPage } from '../publicApiService';
import { getHuanGeToken } from '@/utils/authority'; import { getHuanGeToken } from '@/utils/authority';
...@@ -20,12 +19,11 @@ import pageSetting from './pageSetting'; ...@@ -20,12 +19,11 @@ import pageSetting from './pageSetting';
import ButtonDiy from '@/baseComponent/ButtonDiy'; import ButtonDiy from '@/baseComponent/ButtonDiy';
import Shell from '@/baseComponent/Shell'; import Shell from '@/baseComponent/Shell';
import config from '@/config/config'; import config from '@/config/config';
// import test from './2333';
export default class AffairPage extends React.Component { export default class AffairPage extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
// const idObj = service.getId(); const idObj = service.getId();
if (!idObj) { if (!idObj) {
message.error('没有配置数据id,无法使用该功能'); message.error('没有配置数据id,无法使用该功能');
} }
...@@ -145,7 +143,7 @@ export default class AffairPage extends React.Component { ...@@ -145,7 +143,7 @@ export default class AffairPage extends React.Component {
this.ListComponent.getPage(); this.ListComponent.getPage();
}); });
} }
if(event.data.indexOf('iframeHeight') > -1){ if (event.data.indexOf('iframeHeight') > -1) {
let height = Number(event.data.split('-')[1]); let height = Number(event.data.split('-')[1]);
document.getElementById('applyIframeId').height = height; document.getElementById('applyIframeId').height = height;
} }
...@@ -158,7 +156,7 @@ export default class AffairPage extends React.Component { ...@@ -158,7 +156,7 @@ export default class AffairPage extends React.Component {
const { workId, dataBaseId, addFields, showIframe } = this.state; const { workId, dataBaseId, addFields, showIframe } = this.state;
const url = config.onestopPC.split('/#/'); const url = config.onestopPC.split('/#/');
let iframeUrl = `${url[0]}/#/IFrameForApply?id=${workId}&token=${getHuanGeToken()}`; let iframeUrl = `${url[0]}/#/IFrameForApply?id=${workId}&token=${getHuanGeToken()}`;
// iframeUrl = `http://localhost:8000/onestop/IFrameForApply?id=${workId}&token=${getHuanGeToken()}`; // iframeUrl = `http://localhost:8000/onestop/IFrameForApply?id=${workId}&token=${getHuanGeToken()}`;
return ( return (
<PageHeaderWrapper title=""> <PageHeaderWrapper title="">
<div style={{ <div style={{
......
...@@ -11,11 +11,10 @@ import ButtonDiy from '@/baseComponent/ButtonDiy'; ...@@ -11,11 +11,10 @@ import ButtonDiy from '@/baseComponent/ButtonDiy';
import ModalDiy from '@/baseComponent/ModalDiy'; import ModalDiy from '@/baseComponent/ModalDiy';
import React, { Component, Fragment } from 'react'; import React, { Component, Fragment } from 'react';
import { deepCopy, } from '@/baseComponent/utils'; import { deepCopy, } from '@/baseComponent/utils';
import { mustHaveValue } from '../../config/index'; import { mustHaveValue, transLateTimeTOUnix } from '../../config/index';
import { message } from 'antd'; import { message } from 'antd';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { startProcess } from '../publicApiService'; import { startProcess } from '../publicApiService';
import { transLateTimeTOUnix } from '@/pages/App/FormInsertDiy/config';
import FormArray from '../component/FormArray'; import FormArray from '../component/FormArray';
export default class ModalForm extends Component { export default class ModalForm extends Component {
......
import ButtonDiy from '@/baseComponent/ButtonDiy'; import ButtonDiy from '@/baseComponent/ButtonDiy';
import React, { Component, Fragment } from 'react'; import React, { Component, Fragment } from 'react';
/*
import ExportInfo from '@/components/App/ExportInfo';
import ImportUtil from '@/components/App/ImportUtil';
import ModalDelete from './ModalDelete';
import ModalConfirm from './ModalConfirm';
*/
import ModalBatch from './ModalBatch'; import ModalBatch from './ModalBatch';
import ModalForm from './ModalForm'; import ModalForm from './ModalForm';
...@@ -24,31 +18,6 @@ export default class ButtonListDom extends Component { ...@@ -24,31 +18,6 @@ export default class ButtonListDom extends Component {
getPage={getPage} getPage={getPage}
selectRows={selectRows} selectRows={selectRows}
/>; />;
/* case 'ModalDelete': // 删除按钮
return <ModalDelete {...item}
key={item.type}
getPage={getPage}
selectRows={selectRows}
/>;
case 'ImportUtil': // 导入
return <ImportUtil {...item.props}
key={item.type}
callback={() => getPage()}
/>;
case 'ExportInfo': // 导出
return <ExportInfo {...item.props}
key={item.type}
/>;
case 'ModalConfirm': // 一般按钮 点击后弹出是否确定的 Modal Info
return <ModalConfirm key={item.type}
{...item}
getPage={getPage}
listData={listData}
formValues={formValues}
search={search}
selectRows={selectRows}/>;
*/
case 'ModalBatch': // 一般按钮 点击后弹出 填写一些类似 审核理由 意见之类的信息 case 'ModalBatch': // 一般按钮 点击后弹出 填写一些类似 审核理由 意见之类的信息
return <ModalBatch key={item.type} return <ModalBatch key={item.type}
{...item} {...item}
......
...@@ -43,10 +43,15 @@ const getOtherToken = () => { ...@@ -43,10 +43,15 @@ const getOtherToken = () => {
}; };
const getId = () => { // 获取流程引擎 事务workId 和表dataBaseId const getId = () => { // 获取流程引擎 事务workId 和表dataBaseId
return {
dataBaseId: '1243131275393368064',
workId: '1243131275393368064',
};
let path = window.location.href; let path = window.location.href;
path = path.split('/'); path = path.split('/');
// let idObj = config[path.pop()]; console.log(path.pop());
let idObj; /// let idObj = config[path.pop()];
debugger;
if (typeof idObj === 'undefined') { if (typeof idObj === 'undefined') {
console.error('没有找到对应的流程引擎id'); console.error('没有找到对应的流程引擎id');
return false; return false;
......
import React, { Fragment } from 'react'; // import React, { Fragment } from 'react';
import { // import {
Button, // Button,
Card, Col, // Card, Col,
Form, message, Row, // Form, message, Row,
} from 'antd'; // } from 'antd';
import { connect } from 'dva'; // import { connect } from 'dva';
import PageHeaderWrapper from '@/components/PageHeaderWrapper'; // import PageHeaderWrapper from '@/components/PageHeaderWrapper';
import moment from 'moment'; // import moment from 'moment';
import router from 'umi/router'; // import router from 'umi/router';
import { text, number, date, getFormArrayConfig } from '../config/index'; // import { text, number, date, getFormArrayConfig } from '../config/index';
import FormArray from '../AffairPage/component/FormArray'; // import FormArray from '../AffairPage/component/FormArray';
import ButtonDiy from '@/baseComponent/ButtonDiy'; // import ButtonDiy from '@/baseComponent/ButtonDiy';
import Shell from '../Shell'; // import Shell from '../Shell';
//
//
@connect(({ formList, loading }) => ({ // @connect(({ formList, loading }) => ({
formList, // formList,
})) // }))
@Form.create() // @Form.create()
class Edit extends React.Component { // class Edit extends React.Component {
//
state = { // state = {
modalVisible: false, // modalVisible: false,
formData: {}, // formData: {},
formItem: [], // formItem: [],
isAdd: false, // isAdd: false,
objId: this.props.id, // objId: this.props.id,
recordId: this.props.recordId, // recordId: this.props.recordId,
recordKey: this.props.recordKey, // recordKey: this.props.recordKey,
}; // };
columns = []; // columns = [];
//
//渲染值 // //渲染值
componentDidMount() { // componentDidMount() {
const { dispatch } = this.props; // const { dispatch } = this.props;
const { objId, recordKey, recordId } = this.state; // const { objId, recordKey, recordId } = this.state;
dispatch({ // dispatch({
type: 'formList/getHead', // type: 'formList/getHead',
payload: { dataObjId: objId }, // payload: { dataObjId: objId },
callback: (dates) => { // callback: (dates) => {
if (dates) { // if (dates) {
this.setState({ // this.setState({
formItem: dates, // formItem: dates,
}); // });
} // }
}, // },
}); // });
//渲染表单字段 // //渲染表单字段
if (recordId != null) { // if (recordId != null) {
dispatch({ // dispatch({
type: 'formList/getDetail', // type: 'formList/getDetail',
payload: { // payload: {
dataObjId: objId, // dataObjId: objId,
key: recordKey, // key: recordKey,
value: recordId, // value: recordId,
}, // },
callback: (res) => { // callback: (res) => {
if (res) { // if (res) {
this.setState({ // this.setState({
formData: res, // formData: res,
}); // });
} // }
}, // },
}); // });
this.setState({ // this.setState({
isAdd: false, // isAdd: false,
}) // })
}else{ // }else{
this.setState({ // this.setState({
isAdd: true, // isAdd: true,
}) // })
} // }
} // }
//
onSubmit = () => { // onSubmit = () => {
//router.goBack(); // //router.goBack();
const { isAdd, objId, formData } = this.state; // const { isAdd, objId, formData } = this.state;
let payload = { // let payload = {
params: {...formData}, // params: {...formData},
objId, // objId,
isAdd, // isAdd,
}; // };
this.props.dispatch({ // this.props.dispatch({
type: 'formList/add', // type: 'formList/add',
payload, // payload,
callback: () => { // callback: () => {
message.success('操作成功'); // message.success('操作成功');
this.props.returnThis(); // this.props.returnThis();
}, // },
}); // });
}; // };
//
goBack = () => { // goBack = () => {
this.props.returnThis(); // this.props.returnThis();
}; // };
//
changeFormData = (value, key) => { // changeFormData = (value, key) => {
let oldValue = this.state.formData; // let oldValue = this.state.formData;
oldValue[key] = value; // oldValue[key] = value;
this.setState({ // this.setState({
formData: oldValue, // formData: oldValue,
}); // });
}; // };
//
render() { // render() {
let { formItem, formData } = this.state; // let { formItem, formData } = this.state;
let formConfig = getFormArrayConfig(formItem); // let formConfig = getFormArrayConfig(formItem);
return ( // return (
<Shell> // <Shell>
<Row> // <Row>
<FormArray // <FormArray
config={formConfig} // config={formConfig}
nameSpan={{ big: 10, small: 12 }} // nameSpan={{ big: 10, small: 12 }}
fileSpan={{ big: 4, small: 3 }} // fileSpan={{ big: 4, small: 3 }}
value={formData} // value={formData}
changeValue={this.changeFormData} // changeValue={this.changeFormData}
/> // />
<Col span={24} // <Col span={24}
style={{ textAlign: 'center', paddingTop: '200px', paddingBottom: '50px' }}> // style={{ textAlign: 'center', paddingTop: '200px', paddingBottom: '50px' }}>
//
<ButtonDiy // <ButtonDiy
className={'primaryBlue'} // className={'primaryBlue'}
handleClick={this.onSubmit} // handleClick={this.onSubmit}
name={'保存'} // name={'保存'}
/> // />
<ButtonDiy // <ButtonDiy
className={'defaultRed'} // className={'defaultRed'}
handleClick={this.goBack} // handleClick={this.goBack}
name={'返回'} // name={'返回'}
/> // />
</Col> // </Col>
</Row> // </Row>
</Shell> // </Shell>
); // );
} // }
} // }
//
export default Edit; // export default Edit;
.nomal{ //.nomal{
background: #fff; // background: #fff;
padding: 10px; // padding: 10px;
} //}
.title{ //.title{
display: flex; // display: flex;
margin-bottom: 20px; // margin-bottom: 20px;
} //}
.info{ //.info{
text-align: center; // text-align: center;
font-weight: bold; // font-weight: bold;
font-size: 18px; // font-size: 18px;
} //}
.detail{ //.detail{
text-align: center; // text-align: center;
margin:30px auto; // margin:30px auto;
} //}
.detail img{ //.detail img{
margin: auto 10px; // margin: auto 10px;
} //}
.button{ //.button{
display: -webkit-box; /* 老版本语法: Safari, iOS, Android browser, older WebKit browsers. */ // display: -webkit-box; /* 老版本语法: Safari, iOS, Android browser, older WebKit browsers. */
display: -moz-box; /* 老版本语法: Firefox (buggy) */ // display: -moz-box; /* 老版本语法: Firefox (buggy) */
display: -ms-flexbox; /* 混合版本语法: IE 10 */ // display: -ms-flexbox; /* 混合版本语法: IE 10 */
display: -webkit-flex; /* 新版本语法: Chrome 21+ */ // display: -webkit-flex; /* 新版本语法: Chrome 21+ */
display: -moz-flex; // display: -moz-flex;
display: flex; // display: flex;
-moz-box-pack: center; /*Firefox*/ // -moz-box-pack: center; /*Firefox*/
-webkit-box-pack: center; /*Safari,Opera,Chrome*/ // -webkit-box-pack: center; /*Safari,Opera,Chrome*/
box-pack: center; // box-pack: center;
-moz-justify-content: center; // -moz-justify-content: center;
-webkit-justify-content: center; // -webkit-justify-content: center;
justify-content: center; // justify-content: center;
} //}
.operation{ //.operation{
display: -webkit-box; /* 老版本语法: Safari, iOS, Android browser, older WebKit browsers. */ // display: -webkit-box; /* 老版本语法: Safari, iOS, Android browser, older WebKit browsers. */
display: -moz-box; /* 老版本语法: Firefox (buggy) */ // display: -moz-box; /* 老版本语法: Firefox (buggy) */
display: -ms-flexbox; /* 混合版本语法: IE 10 */ // display: -ms-flexbox; /* 混合版本语法: IE 10 */
display: -webkit-flex; /* 新版本语法: Chrome 21+ */ // display: -webkit-flex; /* 新版本语法: Chrome 21+ */
display: -moz-flex; // display: -moz-flex;
display: flex; // display: flex;
-moz-box-pack: center; /*Firefox*/ // -moz-box-pack: center; /*Firefox*/
-webkit-box-pack: center; /*Safari,Opera,Chrome*/ // -webkit-box-pack: center; /*Safari,Opera,Chrome*/
box-pack: center; // box-pack: center;
-moz-justify-content: center; // -moz-justify-content: center;
-webkit-justify-content: center; // -webkit-justify-content: center;
justify-content: center; // justify-content: center;
} //}
.button Button{ //.button Button{
margin: auto 10px; // margin: auto 10px;
//
} //}
.titleInfo p span{ //.titleInfo p span{
font-weight: bold; // font-weight: bold;
} //}
.import{ //.import{
color: #6ca3c9; // color: #6ca3c9;
font-size: 16px; // font-size: 16px;
} //}
.button{ //.button{
// background: #eff3f8; // // background: #eff3f8;
text-align: center; // text-align: center;
padding:20px; // padding:20px;
margin-top: 20px; // margin-top: 20px;
} //}
.tip{ //.tip{
margin:20px auto; // margin:20px auto;
padding:10px; // padding:10px;
border-top: 1px solid #ccc; // border-top: 1px solid #ccc;
} //}
.tip span{ //.tip span{
display: block; // display: block;
margin:10px; // margin:10px;
font-size: 16px; // font-size: 16px;
} //}
.tip::after{ //.tip::after{
content: ''; // content: '';
position: absolute; // position: absolute;
width: 5px; // width: 5px;
height: 57px; // height: 57px;
background: #e5eaf1; // background: #e5eaf1;
margin-top: -141px; // margin-top: -141px;
margin-left: -13px; // margin-left: -13px;
} //}
.select button{ //.select button{
color: #fff; // color: #fff;
padding:10px; // padding:10px;
background: #abbac3; // background: #abbac3;
border: none; // border: none;
margin: 10px; // margin: 10px;
} //}
.attentionItem{ //.attentionItem{
background: #f4f5f4; // background: #f4f5f4;
padding: 10px; // padding: 10px;
box-shadow: 1px 1px 1px #ccc; // box-shadow: 1px 1px 1px #ccc;
} //}
.attentionItem p:nth-child(1){ //.attentionItem p:nth-child(1){
font-size: 16px; // font-size: 16px;
margin-left: 0; // margin-left: 0;
} //}
.attentionItem p{ //.attentionItem p{
font-size: 14px; // font-size: 14px;
margin-left: 45px; // margin-left: 45px;
} //}
.submitButtons{ //.submitButtons{
margin-left: 34px; // margin-left: 34px;
} //}
.contentTable{ //.contentTable{
display: -webkit-box; /* 老版本语法: Safari, iOS, Android browser, older WebKit browsers. */ // display: -webkit-box; /* 老版本语法: Safari, iOS, Android browser, older WebKit browsers. */
display: -moz-box; /* 老版本语法: Firefox (buggy) */ // display: -moz-box; /* 老版本语法: Firefox (buggy) */
display: -ms-flexbox; /* 混合版本语法: IE 10 */ // display: -ms-flexbox; /* 混合版本语法: IE 10 */
display: -webkit-flex; /* 新版本语法: Chrome 21+ */ // display: -webkit-flex; /* 新版本语法: Chrome 21+ */
display: -moz-flex; // display: -moz-flex;
display: flex; // display: flex;
-moz-box-pack: justify; /*Firefox*/ // -moz-box-pack: justify; /*Firefox*/
-webkit-box-pack:justify; /*Safari,Opera,Chrome*/ // -webkit-box-pack:justify; /*Safari,Opera,Chrome*/
box-pack: justify; // box-pack: justify;
-moz-justify-content: space-between; // -moz-justify-content: space-between;
-webkit-justify-content: space-between; // -webkit-justify-content: space-between;
justify-content: space-between; // justify-content: space-between;
margin-top: 20px; // margin-top: 20px;
} //}
.left{ //.left{
width: 50%; // width: 50%;
} //}
.right{ //.right{
width: 50%; // width: 50%;
border-left: 1px solid #317ecc; // border-left: 1px solid #317ecc;
} //}
.error p{ //.error p{
color: #fff; // color: #fff;
background: #317ecc; // background: #317ecc;
// margin: 10px auto; // // margin: 10px auto;
text-align: left; // text-align: left;
font-size: 18px; // font-size: 18px;
} //}
.download{ //.download{
background: #f5f5f5; // background: #f5f5f5;
padding: 5px; // padding: 5px;
margin-top: -16px; // margin-top: -16px;
} //}
.download img{ //.download img{
margin-top: -2px; // margin-top: -2px;
margin-right: 5px; // margin-right: 5px;
} //}
.download button{ //.download button{
border: none; // border: none;
background: #f5f5f5 // background: #f5f5f5
} //}
.download button:nth-child(1){ //.download button:nth-child(1){
border-right: 1px solid #ccc; // border-right: 1px solid #ccc;
} //}
.download button:nth-child(2){ //.download button:nth-child(2){
border-right: 1px solid #ccc; // border-right: 1px solid #ccc;
} //}
.buttonDown{ //.buttonDown{
display: -webkit-box; /* 老版本语法: Safari, iOS, Android browser, older WebKit browsers. */ // display: -webkit-box; /* 老版本语法: Safari, iOS, Android browser, older WebKit browsers. */
display: -moz-box; /* 老版本语法: Firefox (buggy) */ // display: -moz-box; /* 老版本语法: Firefox (buggy) */
display: -ms-flexbox; /* 混合版本语法: IE 10 */ // display: -ms-flexbox; /* 混合版本语法: IE 10 */
display: -webkit-flex; /* 新版本语法: Chrome 21+ */ // display: -webkit-flex; /* 新版本语法: Chrome 21+ */
display: -moz-flex; // display: -moz-flex;
display: flex; // display: flex;
-moz-box-pack: start; /*Firefox*/ // -moz-box-pack: start; /*Firefox*/
-webkit-box-pack: start; /*Safari,Opera,Chrome*/ // -webkit-box-pack: start; /*Safari,Opera,Chrome*/
box-pack: start; // box-pack: start;
-moz-justify-content: flex-start; // -moz-justify-content: flex-start;
-webkit-justify-content: flex-start; // -webkit-justify-content: flex-start;
justify-content: flex-start; // justify-content: flex-start;
margin-bottom: 20px; // margin-bottom: 20px;
} //}
.buttonDown>button{ //.buttonDown>button{
margin-left: 10px; // margin-left: 10px;
background: #abbac3; // background: #abbac3;
border: none; // border: none;
color: #fff; // color: #fff;
padding: 5px 12px; // padding: 5px 12px;
border-radius: 5px; // border-radius: 5px;
} //}
\ No newline at end of file
...@@ -2,13 +2,13 @@ import React, { Fragment } from 'react'; ...@@ -2,13 +2,13 @@ import React, { Fragment } from 'react';
import { Divider, message, Modal, Popconfirm } from 'antd'; import { Divider, message, Modal, Popconfirm } from 'antd';
import moment from 'moment'; import moment from 'moment';
import router from 'umi/router'; import router from 'umi/router';
import ExportInfo from '../Export/index'; // import ExportInfo from '../Export/index';
import { text, number, date, getFormArrayConfig } from '../config/index'; import { text, number, date, getFormArrayConfig } from '../config/index';
import ButtonDiy from '@/baseComponent/ButtonDiy'; import ButtonDiy from '@/baseComponent/ButtonDiy';
import Shell from '../Shell'; import Shell from '../Shell';
import FormArray from '../AffairPage/component/FormArray'; import FormArray from '../AffairPage/component/FormArray';
import Edit from '../Edit/index'; import Edit from '../Edit/index';
import ImportUtil from '../ImportUtil/ImportUtil'; // import ImportUtil from '../ImportUtil/ImportUtil';
import SearchDom from '@/highOrderComponent/SearchDom'; import SearchDom from '@/highOrderComponent/SearchDom';
import StandardTable from '@/components/StandardTable'; import StandardTable from '@/components/StandardTable';
import { getHead, fetchData, deleteItem, add } from './services'; import { getHead, fetchData, deleteItem, add } from './services';
...@@ -344,8 +344,8 @@ class FormList extends React.Component { ...@@ -344,8 +344,8 @@ class FormList extends React.Component {
<Shell> <Shell>
<div style={{ paddingLeft: '10px', marginTop: '20px' }}> <div style={{ paddingLeft: '10px', marginTop: '20px' }}>
<ButtonDiy icon="plus" className="primaryBlue" handleClick={this.add} name="新建" /> <ButtonDiy icon="plus" className="primaryBlue" handleClick={this.add} name="新建" />
{hasImport && <ImportUtil objId={objId} />} {/* {hasImport && <ImportUtil objId={objId} />}
{hasExport && <ExportInfo objId={objId} />} {hasExport && <ExportInfo objId={objId} />}*/}
<ButtonDiy handleClick={this.batchDelete} name="批量删除" /> <ButtonDiy handleClick={this.batchDelete} name="批量删除" />
</div> </div>
<StandardTable <StandardTable
......
import { apiRequest } from '../request';
const api="/DataObjApi";
export default {
namespace: 'DataObj',
state: {
list: [],
data:{
list: [],
pagination: {},
},
code:{
list: [],
pagination: {},
}
},
effects: {
*getExportInfo({ payload, callback }, { call, put }) {
const response = yield call(apiRequest,api+"/getExportInfo" ,payload);
if(!response){yield put({type: 'nom'});return }
yield put({
type: 'nom',
payload: response,
});
if (callback) callback(response);
},
*changeCatalogue({ payload, callback }, { call, put }) {
const response = yield call(apiRequest,api+"/changeCatalogue" ,payload);
if(!response){yield put({type: 'nom'});return }
yield put({
type: 'nom',
payload: response,
});
if (callback) callback(response);
},
*find({ payload, callback }, { call, put }) {
const response = yield call(apiRequest,api+"/find" ,payload);
if(!response){yield put({type: 'nom'});return }
yield put({
type: 'nom',
payload: response,
});
if (callback) callback(response);
},
*add({ payload, callback }, { call, put }) {
const response = yield call(apiRequest,api+"/add" ,payload);
if(!response){yield put({type: 'nom'});return }
yield put({
type: 'nom',
payload: response,
});
if (callback) callback(response);
},*fetch({ payload, callback }, { call, put }) {
const response = yield call(apiRequest,api+"/getPage" ,payload);
if(!response){yield put({type: 'nom'});return }
yield put({
type: 'page',
payload: {...response,isMain:payload.isMain},
});
},*remove({ payload, callback }, { call, put }) {
const response = yield call(apiRequest,api+"/remove" ,payload);
if(!response){yield put({type: 'nom'});return }
yield put({
type: 'nom',
payload: response,
});
if(callback){
callback()
}
},*open({ payload, callback }, { call, put }) {
const response = yield call(apiRequest,api+"/open" ,payload);
if(!response){yield put({type: 'nom'});return }
yield put({
type: 'nom',
payload: response,
});
if(callback){
callback()
}
},
*createTabel({payload,callback},{call,put}){
const response = yield call(apiRequest,api+"/createTable",payload);
if(!response){yield put({type: 'nom'});return }
yield put({
type: 'nom',
payload: response,
});
if(callback){
callback()
}
}
},
reducers: {
list(state, action) {
return {
...state,
list: action.payload,
};
},
page(state, { payload }) {
if(payload.isMain){
return {
...state,
data:{
list: payload.rows,
pagination: {
current:payload.pageNo,
pageSize:payload.pageSize,
total:payload.total,
},
}
};
}else{
return {
...state,
code:{
list: payload.rows,
pagination: {
current:payload.pageNo,
pageSize:payload.pageSize,
total:payload.total,
},
}
};
}
},
nom(state, action) {
return {...state };
},
},
};
import { uaaRequest } from '../../one_stop_public/utils/request';
const api = '/DataObjApi';
export default {
namespace: 'formList',
state: {
list: [],
data: {
list: [],
pagination: {},
},
},
effects: {
* clear({ payload, callback }, { call, put }) {
yield put({
type: 'clearAll',
payload: {},
});
},
* getHead({ payload, callback }, { call, put }) {
console.log('getHead',);
const response = yield call(uaaRequest, '/DataColumnApi/getHeaderList', payload);
console.log(' header response', response);
if (!response) {
yield put({ type: 'nom' });
return;
}
if (callback) callback(response);
},
* fetch({ payload, callback }, { call, put }) {
const response = yield call(uaaRequest, '/DataObjApi/getFormDataPage', payload);
if (!response) {
yield put({ type: 'nom' });
return;
}
/* yield put({
type: 'page',
payload: {
...response,
},
});*/
if (callback) callback(response);
},
* add({ payload, callback }, { call, put }) {
const response = yield call(apiRequest, api + '/addFormData',
{
data: JSON.stringify(payload.params),
isAdd: payload.isAdd,
objId: payload.objId,
});
if (!response) {
yield put({ type: 'nom' });
return;
}
if (callback) callback(response);
},
* delete({ payload, callback }, { call, put }) {
const response = yield call(apiRequest, api + '/deleteFormData', payload);
if (!response) {
yield put({ type: 'nom' });
return;
}
if (callback) callback(response);
},
* getDetail({ payload, callback }, { call, put }) {
const response = yield call(apiRequest, api + '/getFormData', payload);
if (!response) {
yield put({ type: 'nom' });
return;
}
if (callback) callback(response);
},
},
reducers: {
clearAll(state, action) {
return {
...state,
data: {
list: [],
pagination: {},
},
};
},
list(state, action) {
return {
...state,
list: action.payload,
};
},
page(state, { payload }) {
return {
...state,
data: {
list: payload.rows,
pagination: {
current: payload.pageNo,
pageSize: payload.pageSize,
total: Number(payload.total),
},
},
};
},
nom(state, action) {
return { ...state };
},
},
};
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论