提交 ba1a5ebc authored 作者: liqiufan's avatar liqiufan

2072 开发需求 1228

上级 6ee393d4
...@@ -21,6 +21,8 @@ import OrderItem from './OrderItem'; ...@@ -21,6 +21,8 @@ import OrderItem from './OrderItem';
import ButtonDiy from '@/baseComponent/ButtonDiy'; import ButtonDiy from '@/baseComponent/ButtonDiy';
import FormdataWrapper from '@/utils/object-to-formdata-custom'; import FormdataWrapper from '@/utils/object-to-formdata-custom';
import { getServicesNomal } from '@/webPublic/one_stop_public/Services/services';
import { getExportInfoApi } from '@/webPublic/one_stop_public/Services/apiConfig';
const Option = Select.Option; const Option = Select.Option;
let keyX = 1; let keyX = 1;
...@@ -82,13 +84,9 @@ export default class Index extends React.Component { ...@@ -82,13 +84,9 @@ export default class Index extends React.Component {
this.setState({ groups }); this.setState({ groups });
}; };
open = () => { open = () => {
const { dispatch } = this.props; getServicesNomal(getExportInfoApi, {
dispatch({
type: 'DataObj/getExportInfo',
payload: {
objId: this.props.objId, objId: this.props.objId,
}, }).then(infos => {
callback: (infos) => {
const mockData = []; const mockData = [];
const qs = []; const qs = [];
const gs = []; const gs = [];
...@@ -119,7 +117,6 @@ export default class Index extends React.Component { ...@@ -119,7 +117,6 @@ export default class Index extends React.Component {
gs, gs,
os, os,
}); });
},
}); });
}; };
onCancle = () => { onCancle = () => {
......
...@@ -11,6 +11,9 @@ import { ...@@ -11,6 +11,9 @@ import {
getSassApiHeader, getSassApiHeader,
getSysCode getSysCode
} from '@/webPublic/one_stop_public/2023yunshangguizhou/utils'; } from '@/webPublic/one_stop_public/2023yunshangguizhou/utils';
import { getServicesNomal, importExecute } from '../../one_stop_public/Services/services';
import { importAnalyseApi } from '../../one_stop_public/Services/apiConfig';
const Step = Steps.Step; const Step = Steps.Step;
const TabPane = Tabs.TabPane; const TabPane = Tabs.TabPane;
...@@ -95,16 +98,13 @@ export default class ImportUtil extends React.PureComponent { ...@@ -95,16 +98,13 @@ export default class ImportUtil extends React.PureComponent {
} }
import() { import() {
const { dispatch, importParams } = this.props; const { importParams } = this.props;
dispatch({ importExecute({
type: 'DataObj/importExecute',
payload: {
...(importParams || {}), ...(importParams || {}),
cacheKey: this.state.filekey, cacheKey: this.state.filekey,
objId: this.props.objId, objId: this.props.objId,
}, }).then(() => {
callback: (res) => {
this.next(); this.next();
message.success('导入成功'); message.success('导入成功');
...@@ -116,38 +116,30 @@ export default class ImportUtil extends React.PureComponent { ...@@ -116,38 +116,30 @@ export default class ImportUtil extends React.PureComponent {
if (this.props.callback) { if (this.props.callback) {
this.props.callback(); this.props.callback();
} }
},
}); });
} }
getCachKey = (filePath) => { getCachKey = (filePath) => {
const { dispatch, importParams } = this.props; const { importParams } = this.props;
dispatch({ getServicesNomal(importAnalyseApi, {
type: 'DataObj/importAnalyse',
payload: {
...(importParams || {}), ...(importParams || {}),
isLocal: false, isLocal: false,
filePath, filePath,
objId: this.props.objId, objId: this.props.objId,
}, }).then(res => {
callback: (res) => {
this.setState({ this.setState({
filekey: res.cacheKey, filekey: res.cacheKey,
}); });
this.queryFile(res.cacheKey); this.queryFile(res.cacheKey);
},
}); });
}; };
queryFile = (cacheKey) => { queryFile = (cacheKey) => {
const { dispatch, importParams } = this.props; const { importParams } = this.props;
dispatch({ getServicesNomal(importDataQueryApi, {
type: 'DataObj/importDataQuery',
payload: {
...(importParams || {}), ...(importParams || {}),
cacheKey, cacheKey,
objId: this.props.objId, objId: this.props.objId,
}, }).then(res => {
callback: (res) => {
this.setState({ this.setState({
current: 1, current: 1,
isShow: false, isShow: false,
...@@ -180,7 +172,6 @@ export default class ImportUtil extends React.PureComponent { ...@@ -180,7 +172,6 @@ export default class ImportUtil extends React.PureComponent {
isNextDisabled: true, isNextDisabled: true,
}); });
} }
},
}); });
}; };
changePane = (activeKey) => { changePane = (activeKey) => {
......
...@@ -22,6 +22,8 @@ import OrderItem from './OrderItem'; ...@@ -22,6 +22,8 @@ import OrderItem from './OrderItem';
import FormdataWrapper from '../utils/object-to-formdata-custom'; import FormdataWrapper from '../utils/object-to-formdata-custom';
import ButtonDiy from './ButtonDiy/ButtonDiy'; import ButtonDiy from './ButtonDiy/ButtonDiy';
import { getHeaders } from '@/webPublic/zyd_public/utils/utils'; import { getHeaders } from '@/webPublic/zyd_public/utils/utils';
import { getServicesNomal } from '../Services/services';
import { getExportInfoApi } from '../Services/apiConfig';
const Option = Select.Option; const Option = Select.Option;
var keyX = 1; var keyX = 1;
...@@ -97,13 +99,9 @@ export default class ExportInfo extends React.Component { ...@@ -97,13 +99,9 @@ export default class ExportInfo extends React.Component {
this.setState({ groups }); this.setState({ groups });
}; };
open = () => { open = () => {
const { dispatch } = this.props; getServicesNomal(getExportInfoApi, {
dispatch({
type: 'DataObj/getExportInfo',
payload: {
objId: this.props.objId, objId: this.props.objId,
}, }).then(infos => {
callback: (infos) => {
const mockData = []; const mockData = [];
const qs = []; const qs = [];
const gs = []; const gs = [];
...@@ -134,7 +132,6 @@ export default class ExportInfo extends React.Component { ...@@ -134,7 +132,6 @@ export default class ExportInfo extends React.Component {
gs, gs,
os, os,
}); });
},
}); });
}; };
onCancle = () => { onCancle = () => {
......
...@@ -14,6 +14,8 @@ import { ...@@ -14,6 +14,8 @@ import {
getSassApiHeader, getSassApiHeader,
getSysCode getSysCode
} from '@/webPublic/one_stop_public/2023yunshangguizhou/utils'; } from '@/webPublic/one_stop_public/2023yunshangguizhou/utils';
import { getServicesNomal, importExecute } from '../Services/services';
import { importDataQueryApi, importAnalyseApi } from '../Services/apiConfig';
const Modal = getModal(); const Modal = getModal();
const message = getMessage(); const message = getMessage();
...@@ -126,17 +128,13 @@ export default class ImportUtil extends React.PureComponent { ...@@ -126,17 +128,13 @@ export default class ImportUtil extends React.PureComponent {
import() { import() {
const { const {
dispatch,
importParams, importParams,
} = this.props; } = this.props;
dispatch({ importExecute({
type: 'DataObj/importExecute',
payload: {
...(importParams || {}), ...(importParams || {}),
cacheKey: this.state.fileCacheKey, cacheKey: this.state.fileCacheKey,
objId: this.props.objId, objId: this.props.objId,
}, }).then(res => {
callback: (res) => {
if (res && res.sync === false && res.total) { if (res && res.sync === false && res.total) {
// 23013 学生事务/学生医保管理/学生平安险/保险办理,2001010248 高职界面已购买 导入 报错【接口超时】 // 23013 学生事务/学生医保管理/学生平安险/保险办理,2001010248 高职界面已购买 导入 报错【接口超时】
this.setState({ this.setState({
...@@ -152,48 +150,37 @@ export default class ImportUtil extends React.PureComponent { ...@@ -152,48 +150,37 @@ export default class ImportUtil extends React.PureComponent {
isShow: true, isShow: true,
visible: false, visible: false,
}); });
},
}); });
} }
getCachKey = (filePath) => { getCachKey = (filePath) => {
const { const {
dispatch,
importParams, importParams,
importConfig, importConfig,
} = this.props; } = this.props;
dispatch({ getServicesNomal(importAnalyseApi, {
type: 'DataObj/importAnalyse',
payload: {
...(importParams || {}), ...(importParams || {}),
isLocal: false, isLocal: false,
filePath, filePath,
importConfig: importConfig ? JSON.stringify(importConfig) : null, importConfig: importConfig ? JSON.stringify(importConfig) : null,
objId: this.props.objId, objId: this.props.objId,
}, }).then(res => {
callback: (res) => {
this.setState({ this.setState({
fileCacheKey: res.cacheKey, fileCacheKey: res.cacheKey,
}); });
this.queryFile(res.cacheKey); this.queryFile(res.cacheKey);
},
}); });
}; };
queryFile = (cacheKey) => { queryFile = (cacheKey) => {
const { const {
dispatch,
importParams, importParams,
} = this.props; } = this.props;
dispatch({ getServicesNomal(importDataQueryApi, {
type: 'DataObj/importDataQuery',
payload: {
...(importParams || {}), ...(importParams || {}),
cacheKey, cacheKey,
objId: this.props.objId, objId: this.props.objId,
}, }).then(res => {
callback: (res) => {
this.setState({ this.setState({
current: 1, current: 1,
isShow: false, isShow: false,
...@@ -226,7 +213,6 @@ export default class ImportUtil extends React.PureComponent { ...@@ -226,7 +213,6 @@ export default class ImportUtil extends React.PureComponent {
isNextDisabled: true, isNextDisabled: true,
}); });
} }
},
}); });
}; };
......
...@@ -2,11 +2,12 @@ import React, { useEffect, useState, useRef, useMemo } from 'react'; ...@@ -2,11 +2,12 @@ import React, { useEffect, useState, useRef, useMemo } from 'react';
import { Progress, message } from 'antd'; import { Progress, message } from 'antd';
import styles from './ImportUtil.less'; import styles from './ImportUtil.less';
import { connect } from 'dva'; import { connect } from 'dva';
import { getServicesNomal } from '../Services/services';
import { importProcessApi } from '../Services/apiConfig';
function ProgressDiy(props) { function ProgressDiy(props) {
const { const {
fileCacheKey, fileCacheKey,
dispatch,
changeOpenProgress = () => { changeOpenProgress = () => {
}, },
} = props; } = props;
...@@ -14,20 +15,15 @@ function ProgressDiy(props) { ...@@ -14,20 +15,15 @@ function ProgressDiy(props) {
const [speedData, setData] = useState({ ...props }); const [speedData, setData] = useState({ ...props });
useEffect(() => { useEffect(() => {
interv.current = setInterval(() => { interv.current = setInterval(() => {
dispatch({ getServicesNomal(importProcessApi, {
type: 'DataObj/importProcess',
payload: {
cacheKey: fileCacheKey, cacheKey: fileCacheKey,
}, }).then(res => {
callback: res => {
console.log(res);
setData(res); setData(res);
if (res.finished) { if (res.finished) {
clearInterval(interv.current); clearInterval(interv.current);
// message.success('导入完成'); // message.success('导入完成');
changeOpenProgress(false); // 导入成功 changeOpenProgress(false); // 导入成功
} }
},
}); });
}, 1000); }, 1000);
}, []); }, []);
......
...@@ -23,6 +23,7 @@ import OrderItem from './OrderItem'; ...@@ -23,6 +23,7 @@ import OrderItem from './OrderItem';
import FormdataWrapper from '../utils/object-to-formdata-custom'; import FormdataWrapper from '../utils/object-to-formdata-custom';
import ButtonDiy from './ButtonDiy/ButtonDiy'; import ButtonDiy from './ButtonDiy/ButtonDiy';
import { getHeaders } from '@/webPublic/zyd_public/utils/utils'; import { getHeaders } from '@/webPublic/zyd_public/utils/utils';
import { getServicesNomal } from '../Services/services';
const Option = Select.Option; const Option = Select.Option;
var keyX = 1; var keyX = 1;
...@@ -98,13 +99,9 @@ export default class SearchInfo extends React.Component { ...@@ -98,13 +99,9 @@ export default class SearchInfo extends React.Component {
this.setState({ groups }); this.setState({ groups });
}; };
open = () => { open = () => {
const { dispatch } = this.props; getServicesNomal(getExportInfoApi, {
dispatch({
type: 'DataObj/getExportInfo',
payload: {
objId: this.props.objId, objId: this.props.objId,
}, }).then(infos => {
callback: (infos) => {
const mockData = []; const mockData = [];
const qs = []; const qs = [];
const gs = []; const gs = [];
...@@ -135,8 +132,7 @@ export default class SearchInfo extends React.Component { ...@@ -135,8 +132,7 @@ export default class SearchInfo extends React.Component {
gs, gs,
os, os,
}); });
}, })
});
}; };
onCancle = () => { onCancle = () => {
this.setState({ visiable: false }); this.setState({ visiable: false });
......
...@@ -9,6 +9,8 @@ import FormdataWrapper from '../../utils/object-to-formdata-custom'; ...@@ -9,6 +9,8 @@ import FormdataWrapper from '../../utils/object-to-formdata-custom';
import ButtonDiy from '../ButtonDiy/ButtonDiy'; import ButtonDiy from '../ButtonDiy/ButtonDiy';
import { nameSpan, nameSpan3, nameSpan2 } from './config'; import { nameSpan, nameSpan3, nameSpan2 } from './config';
import { getHeaders } from '@/webPublic/zyd_public/utils/utils'; import { getHeaders } from '@/webPublic/zyd_public/utils/utils';
import { getServicesNomal } from '../../Services/services';
import { getExportInfoApi, getStatisticsApi } from '../../Services/apiConfig';
const Option = Select.Option; const Option = Select.Option;
const FormItem = Form.Item; const FormItem = Form.Item;
...@@ -79,13 +81,9 @@ export default class StatisticsInfo extends React.Component { ...@@ -79,13 +81,9 @@ export default class StatisticsInfo extends React.Component {
); );
}; };
open = () => { open = () => {
const { dispatch } = this.props; getServicesNomal(getExportInfoApi, {
dispatch({ objId: THIS.props.objId,
type: 'DataObj/getExportInfo', }).then(infos => {
payload: {
objId: this.props.objId,
},
callback: (infos) => {
const filterXZKeys = this.props.filterXZKeys; const filterXZKeys = this.props.filterXZKeys;
const mockData = []; const mockData = [];
const mockXZData = []; const mockXZData = [];
...@@ -127,7 +125,6 @@ export default class StatisticsInfo extends React.Component { ...@@ -127,7 +125,6 @@ export default class StatisticsInfo extends React.Component {
os.push(x); os.push(x);
} }
} }
this.setState({ this.setState({
mockData, mockData,
mockXZData, mockXZData,
...@@ -137,7 +134,6 @@ export default class StatisticsInfo extends React.Component { ...@@ -137,7 +134,6 @@ export default class StatisticsInfo extends React.Component {
gs, gs,
os, os,
}); });
},
}); });
}; };
onCancle = () => { onCancle = () => {
...@@ -184,7 +180,7 @@ export default class StatisticsInfo extends React.Component { ...@@ -184,7 +180,7 @@ export default class StatisticsInfo extends React.Component {
this.setState({ querys, queryVisiable: false, currentQueryKey: null }); this.setState({ querys, queryVisiable: false, currentQueryKey: null });
}; };
finish = () => { finish = () => {
const { dispatch, objId } = this.props; const { objId } = this.props;
const { x, y, z, infos, XxX, currentKey, groups } = this.state; const { x, y, z, infos, XxX, currentKey, groups } = this.state;
if (x == null) { if (x == null) {
...@@ -254,9 +250,7 @@ export default class StatisticsInfo extends React.Component { ...@@ -254,9 +250,7 @@ export default class StatisticsInfo extends React.Component {
ttz = infos[z].hql; ttz = infos[z].hql;
} }
} }
dispatch({ getServicesNomal(getStatisticsApi, {
type: 'DataObj/getStatistics',
payload: {
x: ttx, x: ttx,
y: tty, y: tty,
z: ttz, z: ttz,
...@@ -265,10 +259,8 @@ export default class StatisticsInfo extends React.Component { ...@@ -265,10 +259,8 @@ export default class StatisticsInfo extends React.Component {
hql: currentKey && infos[currentKey] ? infos[currentKey].hql : null, hql: currentKey && infos[currentKey] ? infos[currentKey].hql : null,
querys: JSON.stringify(qqs), querys: JSON.stringify(qqs),
groups: JSON.stringify(ggs), groups: JSON.stringify(ggs),
}, }).then(data => {
callback: (data) => {
this.setState({ dataSource: data.dataSource, columns: data.columns }); this.setState({ dataSource: data.dataSource, columns: data.columns });
},
}); });
}); });
}; };
...@@ -316,7 +308,7 @@ export default class StatisticsInfo extends React.Component { ...@@ -316,7 +308,7 @@ export default class StatisticsInfo extends React.Component {
} }
export = () => { export = () => {
const { dispatch, objId } = this.props; const { objId } = this.props;
const { x, y, z, infos, XxX, currentKey, groups } = this.state; const { x, y, z, infos, XxX, currentKey, groups } = this.state;
if (x == null) { if (x == null) {
......
...@@ -49,6 +49,8 @@ import { ...@@ -49,6 +49,8 @@ import {
} from '@/webPublic/one_stop_public/utils/queryConfig'; } from '@/webPublic/one_stop_public/utils/queryConfig';
import { getIsGui_Jian, isJSON } from '@/webPublic/zyd_public/utils/utils'; import { getIsGui_Jian, 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';
import { getServicesNomal, getUaaServicesNomal } from '../Services/services';
import { getAllApi, getDetailsApi, queryUserSetApi } from '../Services/apiConfig';
@connect() @connect()
class DetailSplit extends Component { class DetailSplit extends Component {
...@@ -176,7 +178,7 @@ class DetailSplit extends Component { ...@@ -176,7 +178,7 @@ class DetailSplit extends Component {
* @function 默认请求 * @function 默认请求
*/ */
getInit = (handleUser) => { getInit = (handleUser) => {
const { dispatch, formPrepareData } = this.props; const { 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;
...@@ -232,10 +234,7 @@ class DetailSplit extends Component { ...@@ -232,10 +234,7 @@ class DetailSplit extends Component {
}, },
() => { () => {
if (val.isSecond) { if (val.isSecond) {
this.props.dispatch({ getUaaServicesNomal(getAllApi, {}).then(arr => {
type: 'urge/GetMyBtn',
payload: {},
callback: (arr) => {
this.setState( this.setState(
{ {
btnList: arr, btnList: arr,
...@@ -245,8 +244,7 @@ class DetailSplit extends Component { ...@@ -245,8 +244,7 @@ class DetailSplit extends Component {
// this.giveMessageTop(); // this.giveMessageTop();
}, },
); );
}, })
});
} else { } else {
// this.giveMessageTop(); // this.giveMessageTop();
} }
...@@ -255,31 +253,23 @@ class DetailSplit extends Component { ...@@ -255,31 +253,23 @@ class DetailSplit extends Component {
}); });
} }
} }
dispatch({ getUaaServicesNomal(getDetailsApi, {
type: 'emailorphone/GetLogo',
payload: {
configKeys: ['isCloseUserDetail', 'isCloseFlowPath', 'isAllPrint', 'closeAutoSign'], configKeys: ['isCloseUserDetail', 'isCloseFlowPath', 'isAllPrint', 'closeAutoSign'],
}, }).then(val => {
callback: (val) => {
const closeAutoSign = !!(val[3] && val[3].configValue === 'true'); const closeAutoSign = !!(val[3] && val[3].configValue === 'true');
this.setState({ this.setState({
isCloseUserDetail: !!(val[0] && val[0].configValue === 'true'), isCloseUserDetail: !!(val[0] && val[0].configValue === 'true'),
isAllPrint: !!(val[2] && val[2].configValue === 'true'), isAllPrint: !!(val[2] && val[2].configValue === 'true'),
closeAutoSign, closeAutoSign,
}); });
if (!closeAutoSign) { if (!closeAutoSign) {
/** /**
* 获取设置的数据 * 获取设置的数据
*/ */
this.props.dispatch({ getServicesNomal(queryUserSetApi, {}).then(val => {
type: 'UserSetCenterApi/queryUserSet',
payload: {},
callback: (val) => {
this.setState({ this.setState({
setData: val, setData: val,
}); });
},
}); });
} }
...@@ -289,7 +279,6 @@ class DetailSplit extends Component { ...@@ -289,7 +279,6 @@ class DetailSplit extends Component {
val[1]?.configValue === 'true' ? JSON.stringify(true) : JSON.stringify(false), val[1]?.configValue === 'true' ? JSON.stringify(true) : JSON.stringify(false),
); );
} }
},
}); });
if (getToken()) { if (getToken()) {
const user = localStorage.getItem('user'); const user = localStorage.getItem('user');
......
...@@ -6,6 +6,8 @@ import { Modal, Input, Table, Row, Col, Tooltip, Spin, Tag } from 'antd'; ...@@ -6,6 +6,8 @@ import { Modal, Input, Table, Row, Col, Tooltip, Spin, Tag } from 'antd';
import styles from './style.less'; import styles from './style.less';
import { openToast } from '../Notification'; import { openToast } from '../Notification';
import { connect } from 'dva'; import { connect } from 'dva';
import { getUaaServicesNomal } from '../../../Services/services';
import { addSignsApi } from '../../../Services/apiConfig';
const { Search } = Input; const { Search } = Input;
...@@ -126,13 +128,6 @@ export default class Countersign extends Component { ...@@ -126,13 +128,6 @@ export default class Countersign extends Component {
}); });
}; };
getInit = async () => { getInit = async () => {
const {
dispatch,
data: {
addSignSql,
id,
},
} = this.props;
// 用户名列表 // 用户名列表
this.getData(); this.getData();
await this.setState({ await this.setState({
...@@ -166,7 +161,6 @@ export default class Countersign extends Component { ...@@ -166,7 +161,6 @@ export default class Countersign extends Component {
}; };
userPaginationChange = value => { userPaginationChange = value => {
const { dispatch } = this.props;
const { const {
realname, realname,
username, username,
...@@ -183,7 +177,6 @@ export default class Countersign extends Component { ...@@ -183,7 +177,6 @@ export default class Countersign extends Component {
* @param { string } value 用户输入值 * @param { string } value 用户输入值
*/ */
searchNameChange = value => { searchNameChange = value => {
const { dispatch } = this.props;
this.getData({ this.getData({
realname: value, realname: value,
pageNo: 1, pageNo: 1,
...@@ -206,7 +199,6 @@ export default class Countersign extends Component { ...@@ -206,7 +199,6 @@ export default class Countersign extends Component {
* @param { stirng } value 用户输入值 * @param { stirng } value 用户输入值
*/ */
serachStuNoChange = value => { serachStuNoChange = value => {
const { dispatch } = this.props;
this.setState({ this.setState({
username: value, username: value,
}); });
...@@ -234,7 +226,6 @@ export default class Countersign extends Component { ...@@ -234,7 +226,6 @@ export default class Countersign extends Component {
handleOk = e => { handleOk = e => {
const { selectUserData } = this.state; const { selectUserData } = this.state;
const { dispatch } = this.props;
let ary = []; let ary = [];
selectUserData.map(item => { selectUserData.map(item => {
ary.push(item.id); ary.push(item.id);
...@@ -248,21 +239,32 @@ export default class Countersign extends Component { ...@@ -248,21 +239,32 @@ export default class Countersign extends Component {
btnLoading: true, btnLoading: true,
}, },
() => { () => {
dispatch({ getUaaServicesNomal(addSignsApi, {
type: 'countersign/countersignHandle',
payload: {
taskId: this.props.taskId, taskId: this.props.taskId,
userIds: ary, userIds: ary,
}, }).then(() => {
callback: () => {
openToast('success', '加签成功'); openToast('success', '加签成功');
this.props.getInit(); this.props.getInit();
this.setState({ this.setState({
visible: false, visible: false,
btnLoading: false, btnLoading: false,
}); });
},
}); });
// dispatch({
// type: 'countersign/countersignHandle',
// payload: {
// taskId: this.props.taskId,
// userIds: ary,
// },
// callback: () => {
// openToast('success', '加签成功');
// this.props.getInit();
// this.setState({
// visible: false,
// btnLoading: false,
// });
// },
// });
}, },
); );
}; };
......
...@@ -3,6 +3,8 @@ import Loading from '../loadThree'; ...@@ -3,6 +3,8 @@ import Loading from '../loadThree';
import { Slider, Row, Col } from 'antd'; import { Slider, Row, Col } from 'antd';
import { connect } from 'dva'; import { connect } from 'dva';
import classNames from 'classnames/bind'; import classNames from 'classnames/bind';
import { getUaaServicesNomal } from '../../../Services/services';
import { getDetailsApi } from '../../../Services/apiConfig';
const names = classNames.bind(require('./style.less')); const names = classNames.bind(require('./style.less'));
...@@ -73,17 +75,13 @@ export default class PortalFlowExamineModalImage extends React.Component { ...@@ -73,17 +75,13 @@ export default class PortalFlowExamineModalImage extends React.Component {
}); });
}, },
}); });
this.props.dispatch({
// 获取配置信息 // 获取配置信息
type: 'emailorphone/GetLogo', getUaaServicesNomal(getDetailsApi, {
payload: {
configKeys: 'IsOldFlow', configKeys: 'IsOldFlow',
}, }).then(val => {
callback: val => {
this.setState({ this.setState({
configValue: val[0].configValue == 'true', configValue: val[0].configValue == 'true',
}); });
},
}); });
}; };
......
...@@ -15,6 +15,8 @@ import Recycle from './recycle'; ...@@ -15,6 +15,8 @@ import Recycle from './recycle';
import styles from './style.less'; import styles from './style.less';
import { confirm,openToast } from '../Notification'; import { confirm,openToast } from '../Notification';
import { connect } from 'dva'; import { connect } from 'dva';
import { getUaaServicesNomal } from '../../../Services/services';
import { refuseProcessApi, resetProcessApi, turnsProcessApi } from '../../../Services/apiConfig';
@connect() @connect()
export default class TurnToModel extends Component { export default class TurnToModel extends Component {
constructor(props){ constructor(props){
...@@ -55,39 +57,31 @@ export default class TurnToModel extends Component { ...@@ -55,39 +57,31 @@ export default class TurnToModel extends Component {
if(status === '转办'){ // 发起转办提交处理 if(status === '转办'){ // 发起转办提交处理
const { user } = this.state const { user } = this.state
if(user){ if(user){
dispatch({ getUaaServicesNomal(turnsProcessApi, {
type:'trunTo/turnsProcess',
payload: {
taskIds:[value.taskId], taskIds:[value.taskId],
reason, reason,
turnsUserCode: user.stuNo turnsUserCode: user.stuNo
}, }).then(() => {
callback: (val) => {
openToast('success', '成功','当前流程已成功移交') openToast('success', '成功','当前流程已成功移交')
this.props.init() this.props.init()
this.setState({ this.setState({
loading: false loading: false
}) })
}
}) })
} else { } else {
openToast('info','错误','请选择移交人员') openToast('info','错误','请选择移交人员')
} }
} else if(status === '回退') { // 发起回退提交处理 } else if(status === '回退') { // 发起回退提交处理
dispatch({ getUaaServicesNomal(refuseProcessApi, {
type: 'trunTo/refuseProcess',
payload: {
taskIds:[value.taskId], taskIds:[value.taskId],
reason reason
}, }).then(() => {
callback: (val) => {
openToast('success', '回退','当前流程已成功回退') openToast('success', '回退','当前流程已成功回退')
this.props.init() this.props.init()
this.setState({ this.setState({
loading: false loading: false
}) })
} });
})
} else { } else {
console.log('缺乏匹配字段提交方法') console.log('缺乏匹配字段提交方法')
} }
...@@ -96,16 +90,12 @@ export default class TurnToModel extends Component { ...@@ -96,16 +90,12 @@ export default class TurnToModel extends Component {
recallConfim = () => { recallConfim = () => {
const { status,dispatch,value } = this.props const { status,dispatch,value } = this.props
confirm('撤回','是否撤回当前转办流程',()=>{ confirm('撤回','是否撤回当前转办流程',()=>{
dispatch({ getUaaServicesNomal(resetProcessApi, {
type:'trunTo/resetProcess',
payload:{
taskIds:[value.taskId], taskIds:[value.taskId],
}, }).then(() => {
callback:(val) => {
openToast('success','成功','该转办流程已成功撤回') openToast('success','成功','该转办流程已成功撤回')
this.props.init() this.props.init()
} });
})
this.props.handleCancel() this.props.handleCancel()
},()=>{ },()=>{
this.props.handleCancel() this.props.handleCancel()
......
...@@ -8,6 +8,8 @@ import React, { Component } from 'react' ...@@ -8,6 +8,8 @@ import React, { Component } from 'react'
import styles from '../style.less'; import styles from '../style.less';
import { Row, Col,Input,Spin } from 'antd'; import { Row, Col,Input,Spin } from 'antd';
import { connect } from 'dva'; import { connect } from 'dva';
import { getUaaServicesNomal } from '../../../../Services/services';
import { getListApi } from '../../../../Services/services';
const { TextArea } = Input; const { TextArea } = Input;
@connect() @connect()
export default class index extends Component { export default class index extends Component {
...@@ -24,18 +26,14 @@ export default class index extends Component { ...@@ -24,18 +26,14 @@ export default class index extends Component {
this.setState({ this.setState({
isLoading: true isLoading: true
}) })
await dispatch({ await getUaaServicesNomal(getListApi, {
type: 'trunTo/detailProcess',
payload: {
taskId:value.taskId, taskId:value.taskId,
}, }).then(val => {
callback: (val) => {
this.setState({ this.setState({
data:Array.isArray(val)&&val?.length>0?val[val.length-1]:'', data:Array.isArray(val)&&val?.length>0?val[val.length-1]:'',
isLoading: false, isLoading: false,
}) })
} });
})
} }
/** /**
* 多行文本输入 * 多行文本输入
......
...@@ -9,6 +9,8 @@ import React, { Component } from 'react'; ...@@ -9,6 +9,8 @@ import React, { Component } from 'react';
import { Input, Table, Row, Col, Tooltip, Spin } from 'antd'; import { Input, Table, Row, Col, Tooltip, Spin } from 'antd';
import styles from '../style.less'; import styles from '../style.less';
import { connect } from 'dva'; import { connect } from 'dva';
import { getUaaServicesNomal } from '../../../../Services/services';
import { getListApi } from '../../../../Services/apiConfig';
const { Search } = Input; const { Search } = Input;
const { TextArea } = Input; const { TextArea } = Input;
@connect() @connect()
...@@ -91,16 +93,12 @@ export default class index extends Component { ...@@ -91,16 +93,12 @@ export default class index extends Component {
}); });
}, },
}); });
await dispatch({ await getUaaServicesNomal(getListApi, {
type: 'trunTo/detailProcess',
payload: {
taskId: value.taskId, taskId: value.taskId,
}, }).then(val => {
callback: val => {
this.setState({ this.setState({
userData: Array.isArray(val) && val?.length > 0 ? val[val.length - 1] : '', userData: Array.isArray(val) && val?.length > 0 ? val[val.length - 1] : '',
}); });
},
}); });
await this.setState({ await this.setState({
isLoading: false, isLoading: false,
......
...@@ -11,6 +11,8 @@ import SVG from './components/SVG'; ...@@ -11,6 +11,8 @@ import SVG from './components/SVG';
import { Spin, Timeline,Icon } from 'antd'; import { Spin, Timeline,Icon } from 'antd';
import { connect } from 'dva'; import { connect } from 'dva';
import moment from 'moment'; import moment from 'moment';
import { getUaaServicesNomal } from '../Services/services';
import { getListApi } from '../Services/apiConfig';
@connect() @connect()
export default class trunToDetail extends Component { export default class trunToDetail extends Component {
constructor(props){ constructor(props){
...@@ -35,18 +37,12 @@ export default class trunToDetail extends Component { ...@@ -35,18 +37,12 @@ export default class trunToDetail extends Component {
isLoading: true, isLoading: true,
}) })
// 发起请求获取数据 // 发起请求获取数据
dispatch({ getUaaServicesNomal(getListApi, { taskId: item.id }).then(val => {
type: 'trunTo/detailProcess',
payload: {
taskId: item.id,
},
callback: (val) => {
this.setState({ this.setState({
isLoading: false, isLoading: false,
trunToData: val trunToData: val
}) });
} });
})
} else { // 为关闭状态清空数据 } else { // 为关闭状态清空数据
this.setState({ this.setState({
trunToData: '' trunToData: ''
......
...@@ -9,10 +9,10 @@ import React from 'react'; ...@@ -9,10 +9,10 @@ import React from 'react';
import classNames from 'classnames/bind'; import classNames from 'classnames/bind';
import { connect } from 'dva'; import { connect } from 'dva';
import SponsorForm from './SponsorForm/index'; import SponsorForm from './SponsorForm/index';
import { isJSON } from '@/webPublic/one_stop_public/copy';
import { getUrlInfo } from '@/webPublic/one_stop_public/DetailForAudit/utils'; import { getUrlInfo } from '@/webPublic/one_stop_public/DetailForAudit/utils';
import { setToken } from '@/webPublic/one_stop_public/utils/token'; import { setToken } from '@/webPublic/one_stop_public/utils/token';
import { Button } from 'antd'; import { getUaaServicesNomal } from '../Services/services';
import { getAllApi } from '../Services/apiConfig';
const names = classNames.bind(require('./style.less')); const names = classNames.bind(require('./style.less'));
...@@ -60,15 +60,11 @@ export default class IframeForApply extends React.Component { ...@@ -60,15 +60,11 @@ export default class IframeForApply extends React.Component {
} }
componentDidMount() { componentDidMount() {
this.props.dispatch({ getUaaServicesNomal(getAllApi, {}).then(val => {
type: 'urge/GetMyBtn',
payload: {},
callback: val => {
this.setState({ this.setState({
btnList: val, btnList: val,
value: val[val.length - 1].id, value: val[val.length - 1].id,
}); });
},
}); });
// document.getElementById('root').style.backgroundColor = '#fff'; // document.getElementById('root').style.backgroundColor = '#fff';
} }
......
// 请求地址
const DataObjApi = '/DataObjApi';
const DataColumnApi = "/DataColumnApi";
const SqlManageEntityApi = '/SqlManageEntityApi';
const UnifiedAppFormApi = '/UnifiedAppFormApi';
// formList model层相关api
export const getFormDataPageApi = DataObjApi + '/getFormDataPage'
export const getHeaderListApi = DataColumnApi + '/getHeaderList';
export const getBatchOptionsApi = DataColumnApi + '/getBatchOptions';
export const getFormDataApi = DataObjApi + '/getFormData';
export const deleteFormDataApi = DataObjApi + '/deleteFormData';
export const getDetailByCodeApi = UnifiedAppFormApi + '/getDetailByCode';
export const getDetailApi = DataObjApi + '/getDetail';
export const addFormDataApi = DataObjApi + '/addFormData';
export const getGroupListApi = DataColumnApi + '/getGroupList';
export const getFormDataListApi = DataObjApi + '/getFormDataList';
// DataColumn model层相关api
export const getSqlDataApi = DataColumnApi + '/getSqlData';
export const getSqlOptionsApi = DataColumnApi + '/getSqlOptions';
export const getSqlLabelsApi = DataColumnApi + '/getSqlLabels';
export const getLabelsApi = DataColumnApi + '/getLabels';
export const getOptionsApi = DataColumnApi + '/getOptions';
// SqlManageEntity model层相关api
export const findApi = SqlManageEntityApi + '/find'
// DataObj model层相关api
export const getExportInfoApi = DataObjApi + '/getExportInfo'
export const importExecuteApi = DataObjApi + '/importExecute'
export const importAnalyseApi = DataObjApi + '/importAnalyse'
export const importDataQueryApi = DataObjApi + '/importDataQuery'
export const importProcessApi = DataObjApi + '/importProcess'
export const getStatisticsApi = DataObjApi + '/getStatistics'
export const findByCodeApi = DataObjApi + '/findByCode';
// countersign model层相关api
export const addSignsApi = UnifiedAppFormApi + "/addSigns"
// emailorphone model层相关api
export const getDetailsApi = '/ConfigApi/getDetails'
// UserSetCenterApi model层相关api
export const queryUserSetApi = '/UserSetCenterApi/queryUserSet'
// trunTo model层相关api
export const turnsProcessApi = '/ActCommentApi/turnsProcess'
export const refuseProcessApi = '/ActCommentApi/refuseProcess'
export const resetProcessApi = '/ActCommentApi/resetProcess'
export const getListApi = '/ActCommentApi/getList'
// urge model层相关api
export const getAllApi = '/UnifiedAppFormLevelApi/getAll'
\ No newline at end of file
import { apiRequest, uaaRequest } from '../utils/request';
import { importExecuteApi, getFormDataPageApi } from './apiConfig'
// apiRequest
export const getServicesNomal = (apiAddress, params) => {
return apiRequest(apiAddress, params);
};
// uaaRequest
export const getUaaServicesNomal = (apiAddress, params) => {
return uaaRequest(apiAddress, params);
};
export const getFormDataPage = (params) => {
return apiRequest(getFormDataPageApi, params).then((response) => {
if (response) {
return {
list: response.rows,
pagination: {
current: response.pageNo,
pageSize: response.pageSize,
total: response.total,
},
};
}
});
};
export const importExecute = (params) => {
return apiRequest(importExecuteApi, {
...params,
customErrMsg:
'导入的文件中可能存在字段不一致、字段类型不匹配、唯一性字段冲突,请检查或联系系统管理员',// 自定义errMsg
});
};
...@@ -33,6 +33,19 @@ import FilePreview from '@/webPublic/one_stop_public/filePreview'; ...@@ -33,6 +33,19 @@ import FilePreview from '@/webPublic/one_stop_public/filePreview';
import { queryApiActionPath, queryFileUrl } from '@/webPublic/one_stop_public/utils/queryConfig'; import { queryApiActionPath, queryFileUrl } from '@/webPublic/one_stop_public/utils/queryConfig';
import UploadCom from '@/webPublic/one_stop_public/libs/UploadCom'; import UploadCom from '@/webPublic/one_stop_public/libs/UploadCom';
import { getModal, getPopconfirm } from '@/webPublic/one_stop_public/utils/utils'; import { getModal, getPopconfirm } from '@/webPublic/one_stop_public/utils/utils';
import { getServicesNomal } from '../../Services/services';
import {
getFormDataListApi,
getBatchOptionsApi,
getFormDataApi,
deleteFormDataApi,
getDetailByCodeApi,
findByCodeApi,
getDetailApi,
getHeaderListApi,
getGroupListApi,
addFormDataApi,
} from '../../Services/apiConfig';
const Popconfirm = getPopconfirm(); const Popconfirm = getPopconfirm();
const Modal = getModal(); const Modal = getModal();
...@@ -197,58 +210,42 @@ class TreeList extends React.Component { ...@@ -197,58 +210,42 @@ class TreeList extends React.Component {
} }
if (refIds.length > 0) { if (refIds.length > 0) {
dispatch({ getServicesNomal(getBatchOptionsApi, { ids: refIds }).then(options => {
type: 'formList/getBatchOptions',
payload: { ids: refIds },
callback: (options) => {
this.setState({ options: { ...this.state.options, ...options } }); this.setState({ options: { ...this.state.options, ...options } });
},
}); });
} }
}; };
getList = (values, callback, isFirst) => { getList = (values, callback, isFirst) => {
const { const { json: { treeParentIdName, ctgFilterSql } } = this.props;
dispatch,
json: { treeParentIdName, ctgFilterSql },
} = this.props;
if (!values) { if (!values) {
values = this.state.formValues; values = this.state.formValues;
} }
getServicesNomal(getFormDataListApi, {
dispatch({
type: 'formList/tree',
payload: {
...values, ...values,
ctgFilterSql: ctgFilterSql, ctgFilterSql: ctgFilterSql,
parentIdName: treeParentIdName, parentIdName: treeParentIdName,
dataObjId: this.state.objId, dataObjId: this.state.objId,
}, }).then(res => {
callback: callback, callback()
}); })
}; };
modify = (record) => { modify = (record) => {
// if (this.state.formItem.length < 10) { // if (this.state.formItem.length < 10) {
this.getOptions(); this.getOptions();
getServicesNomal(getFormDataApi, {
this.props.dispatch({
type: 'formList/getDetail',
payload: {
dataObjId: this.state.objId, dataObjId: this.state.objId,
key: this.state.primaryKey, key: this.state.primaryKey,
value: record[this.state.primaryKey], value: record[this.state.primaryKey],
isBase: false, isBase: false,
}, }).then(record2 => {
callback: (record2) => {
this.setState({ this.setState({
formData: record2, formData: record2,
modalVisible: true, modalVisible: true,
isAdd: false, isAdd: false,
isView: false, isView: false,
}); });
},
}); });
}; };
view = (record) => { view = (record) => {
...@@ -284,13 +281,10 @@ class TreeList extends React.Component { ...@@ -284,13 +281,10 @@ class TreeList extends React.Component {
//找出主键 //找出主键
let Keys = {}; let Keys = {};
Keys[this.state.primaryKey] = record[this.state.primaryKey]; Keys[this.state.primaryKey] = record[this.state.primaryKey];
this.props.dispatch({ getServicesNomal(deleteFormDataApi, {
type: 'formList/delete',
payload: {
keys: JSON.stringify(Keys), keys: JSON.stringify(Keys),
objId: this.state.objId, objId: this.state.objId,
}, }).then(() => {
callback: () => {
this.getPage({ parentId: this.state.parentId }, null, null, (list) => { this.getPage({ parentId: this.state.parentId }, null, null, (list) => {
const treeData = this.refesh(this.state.parentId, list, this.state.treeData); const treeData = this.refesh(this.state.parentId, list, this.state.treeData);
this.setState({ this.setState({
...@@ -298,20 +292,12 @@ class TreeList extends React.Component { ...@@ -298,20 +292,12 @@ class TreeList extends React.Component {
treeData, treeData,
}); });
}); });
},
}); });
}; };
viewProcess = (record) => { viewProcess = (record) => {
const { dispatch } = this.props; getServicesNomal(getDetailByCodeApi, { code: record.process_biz_key }).then(data => {
dispatch({
type: 'formList/getAppId',
payload: {
code: record.process_biz_key,
},
callback: (data) => {
router.push({ pathname: '/portal/serviceCentre/getdetail', state: { id: data.id } }); router.push({ pathname: '/portal/serviceCentre/getdetail', state: { id: data.id } });
},
}); });
}; };
...@@ -335,77 +321,24 @@ class TreeList extends React.Component { ...@@ -335,77 +321,24 @@ class TreeList extends React.Component {
//渲染值 //渲染值
componentDidMount() { componentDidMount() {
const { dispatch, isFormCom, isSelect, callback, valueName } = this.props;
window.addEventListener('resize', this.resize); window.addEventListener('resize', this.resize);
if (this.props.objCode) { if (this.props.objCode) {
const { dispatch, objCode, sql } = this.props; const { objCode } = this.props;
if (objCode == 1 || objCode == '1') { if (objCode == 1 || objCode == '1') {
this.initColumn(); this.initColumn();
} else { } else {
dispatch({ getServicesNomal(findByCodeApi, { objCode: this.props.objCode }).then(dataObj => {
type: 'DataObj/findByCode',
payload: { objCode: this.props.objCode },
callback: (dataObj) => {
this.setState({ objId: dataObj.id, isTable: data.isTable }, () => { this.setState({ objId: dataObj.id, isTable: data.isTable }, () => {
/**
* 2022年10月27日
* 欢哥说这个权限功能没用了 在一站式后台元数据管理-数据授权里面修改 实际已经废弃了
* 问了姚新国也说没用了. 有问题就还原回来
* */
this.initColumn(); this.initColumn();
// dispatch({
// type: 'DataRight/getUserRight',
// payload: { objId: this.state.objId },
// callback: (data) => {
// if (!this.props.rights) {
// this.setState({ rights: data });
// }
// dispatch({
// type: 'DataRight/getUserColumnRight',
// payload: { objId: this.state.objId },
// callback: (data) => {
// this.setState({ columnRights: data });
// this.initColumn();
// },
// });
// },
// });
}); });
},
}); });
} }
} else { } else {
dispatch({ getServicesNomal(getDetailApi, { id: this.state.objId }).then(data => {
type: 'formList/getObjDetail',
payload: { id: this.state.objId },
callback: (data) => {
this.setState({ isTable: data.isTable }); this.setState({ isTable: data.isTable });
},
}); });
/**
* 2022年10月27日
* 欢哥说这个权限功能没用了 在一站式后台元数据管理-数据授权里面修改 实际已经废弃了
* 问了姚新国也说没用了. 有问题就还原回来
* */
this.initColumn(); this.initColumn();
// dispatch({
// type: 'DataRight/getUserRight',
// payload: { objId: this.state.objId },
// callback: (data) => {
// if (!this.props.rights) {
// this.setState({ rights: data });
// }
// dispatch({
// type: 'DataRight/getUserColumnRight',
// payload: { objId: this.state.objId },
// callback: (data) => {
// this.setState({ columnRights: data });
// this.initColumn();
// },
// });
// },
// });
} }
} }
...@@ -447,9 +380,7 @@ class TreeList extends React.Component { ...@@ -447,9 +380,7 @@ class TreeList extends React.Component {
} }
initColumn = () => { initColumn = () => {
const { dispatch, isFormCom, isSelect, callback, valueName } = this.props; const { columnRights } = this.state;
const { rights, columnRights } = this.state;
if (this.props.value && this.props.value.columns) { if (this.props.value && this.props.value.columns) {
this.columns = this.props.value.columns; this.columns = this.props.value.columns;
this.getPage(); this.getPage();
...@@ -457,10 +388,7 @@ class TreeList extends React.Component { ...@@ -457,10 +388,7 @@ class TreeList extends React.Component {
} }
if (this.props.objCode == 1 || this.props.objCode == '1') { if (this.props.objCode == 1 || this.props.objCode == '1') {
} else { } else {
dispatch({ getServicesNomal(getHeaderListApi, { dataObjId: this.state.objId }).then(datas => {
type: 'formList/getHead',
payload: { dataObjId: this.state.objId },
callback: (datas) => {
const querys = []; const querys = [];
const refIds = []; const refIds = [];
const groups = {}; const groups = {};
...@@ -547,13 +475,9 @@ class TreeList extends React.Component { ...@@ -547,13 +475,9 @@ class TreeList extends React.Component {
refIds.push(datas[t].id); refIds.push(datas[t].id);
} }
if (datas[t].isGroupQuery != null) { if (datas[t].isGroupQuery != null) {
dispatch({ getServicesNomal(getGroupListApi, { columnId: datas[t].id }).then(gourp => {
type: 'formList/getGroupList',
payload: { columnId: datas[t].id },
callback: (gourp) => {
groups[datas[t].id] = gourp; groups[datas[t].id] = gourp;
this.setState({ groups }); this.setState({ groups });
},
}); });
} }
} }
...@@ -562,19 +486,14 @@ class TreeList extends React.Component { ...@@ -562,19 +486,14 @@ class TreeList extends React.Component {
if (querys.length > 0) { if (querys.length > 0) {
this.setState({ querys }); this.setState({ querys });
if (refIds.length > 0) { if (refIds.length > 0) {
dispatch({ getServicesNomal(getBatchOptionsApi, { ids: refIds }).then(options => {
type: 'formList/getBatchOptions',
payload: { ids: refIds },
callback: (options) => {
this.setState({ options }); this.setState({ options });
}, })
});
} }
} }
this.getPage(); this.getPage();
} }
},
}); });
} }
}; };
...@@ -584,7 +503,6 @@ class TreeList extends React.Component { ...@@ -584,7 +503,6 @@ class TreeList extends React.Component {
return; return;
} }
const { const {
dispatch,
json: { treeParentIdName }, json: { treeParentIdName },
} = this.props; } = this.props;
const pagination = this.state.data.pagination; const pagination = this.state.data.pagination;
...@@ -616,16 +534,13 @@ class TreeList extends React.Component { ...@@ -616,16 +534,13 @@ class TreeList extends React.Component {
}); });
} }
} else { } else {
dispatch({ getServicesNomal(getFormDataListApi, {
type: 'formList/tree',
payload: {
custom: this.custom, custom: this.custom,
...params, ...params,
parentIdName: treeParentIdName, parentIdName: treeParentIdName,
sql: this.sqlBs16, sql: this.sqlBs16,
dataObjId: this.state.objId, dataObjId: this.state.objId,
}, }).then((list) => {
callback: (list) => {
const data = { const data = {
list: list, list: list,
pagination: false, pagination: false,
...@@ -640,7 +555,6 @@ class TreeList extends React.Component { ...@@ -640,7 +555,6 @@ class TreeList extends React.Component {
if (callback) callback(list); if (callback) callback(list);
}); });
} }
},
}); });
} }
}; };
...@@ -672,18 +586,14 @@ class TreeList extends React.Component { ...@@ -672,18 +586,14 @@ class TreeList extends React.Component {
...fields, ...fields,
}; };
params[treeParentIdName] = this.state.parentId; params[treeParentIdName] = this.state.parentId;
this.props.dispatch({ getServicesNomal(addFormDataApi, {
type: 'formList/add',
payload: {
params: params, params: params,
objId: this.state.objId, objId: this.state.objId,
isAdd: isAdd, isAdd: isAdd,
isSelf: true, isSelf: true,
isView: false, isView: false,
}, }).then(() => {
callback: () => {
message.success('操作成功'); message.success('操作成功');
this.getPage({ parentId: this.state.parentId }, null, null, (list) => { this.getPage({ parentId: this.state.parentId }, null, null, (list) => {
const treeData = this.refesh(this.state.parentId, list, this.state.treeData); const treeData = this.refesh(this.state.parentId, list, this.state.treeData);
this.setState({ this.setState({
...@@ -691,7 +601,6 @@ class TreeList extends React.Component { ...@@ -691,7 +601,6 @@ class TreeList extends React.Component {
treeData, treeData,
}); });
}); });
},
}); });
}; };
...@@ -723,7 +632,6 @@ class TreeList extends React.Component { ...@@ -723,7 +632,6 @@ class TreeList extends React.Component {
}; };
batchDelete = (e) => { batchDelete = (e) => {
const { dispatch } = this.props;
const { selectedRows } = this.state; const { selectedRows } = this.state;
if (!selectedRows) return; if (!selectedRows) return;
...@@ -737,19 +645,15 @@ class TreeList extends React.Component { ...@@ -737,19 +645,15 @@ class TreeList extends React.Component {
Keys[columns[i].name] = selectedRows.map((row) => row[columns[i].name]).join(','); Keys[columns[i].name] = selectedRows.map((row) => row[columns[i].name]).join(',');
} }
} }
this.props.dispatch({ getServicesNomal(deleteFormDataApi, {
type: 'formList/delete',
payload: {
keys: JSON.stringify(Keys), keys: JSON.stringify(Keys),
objId: this.state.objId, objId: this.state.objId,
isSelf: true, isSelf: true,
}, }).then(() => {
callback: () => {
this.setState({ this.setState({
selectedRows: [], selectedRows: [],
}); });
this.getPage(); this.getPage();
},
}); });
}; };
...@@ -759,7 +663,7 @@ class TreeList extends React.Component { ...@@ -759,7 +663,7 @@ class TreeList extends React.Component {
handleSearch = (e) => { handleSearch = (e) => {
e.preventDefault(); e.preventDefault();
const { dispatch, form } = this.props; const { form } = this.props;
const { formValues } = this.state; const { formValues } = this.state;
...@@ -806,7 +710,7 @@ class TreeList extends React.Component { ...@@ -806,7 +710,7 @@ class TreeList extends React.Component {
this.getPage(params); this.getPage(params);
}; };
handleFormReset = () => { handleFormReset = () => {
const { form, dispatch } = this.props; const { form } = this.props;
form.resetFields(); form.resetFields();
this.setState( this.setState(
{ {
......
import React, { Fragment } from 'react'; import React from 'react';
import { Button, Card, Col, DatePicker, Form, Input, InputNumber, message, Row } from 'antd'; import { Col, Form, message, Row } from 'antd';
import { connect } from 'dva'; import { connect } from 'dva';
import PageHeaderWrapper from './PageHeaderWrapper'; import PageHeaderWrapper from './PageHeaderWrapper';
import router from 'umi/router'; import router from 'umi/router';
...@@ -7,6 +7,13 @@ import { getFormArrayConfig } from './config/index'; ...@@ -7,6 +7,13 @@ import { getFormArrayConfig } from './config/index';
import FormArray from '../../App/ButtonDiy/FormArray'; import FormArray from '../../App/ButtonDiy/FormArray';
import ButtonDiy from '../../App/ButtonDiy/ButtonDiy'; import ButtonDiy from '../../App/ButtonDiy/ButtonDiy';
import Shell from './Shell'; import Shell from './Shell';
import { getServicesNomal } from '../../Services/services';
import {
getBatchOptionsApi,
getFormDataApi,
getHeaderListApi,
addFormDataApi,
} from '../../Services/apiConfig';
@connect(({ formEdit, formList, loading }) => ({ @connect(({ formEdit, formList, loading }) => ({
formEdit, formEdit,
...@@ -29,12 +36,8 @@ class FormEdit extends React.Component { ...@@ -29,12 +36,8 @@ class FormEdit extends React.Component {
//渲染值 //渲染值
componentDidMount() { componentDidMount() {
const { dispatch } = this.props;
const { objId, recordKey, recordId } = this.state; const { objId, recordKey, recordId } = this.state;
dispatch({ getServicesNomal(getHeaderListApi, { dataObjId: objId }).then(dates => {
type: 'formList/getHead',
payload: { dataObjId: objId },
callback: (dates) => {
if (dates) { if (dates) {
this.state.formItem = dates; this.state.formItem = dates;
const refIds = []; const refIds = [];
...@@ -48,31 +51,22 @@ class FormEdit extends React.Component { ...@@ -48,31 +51,22 @@ class FormEdit extends React.Component {
} }
if (refIds.length > 0) { if (refIds.length > 0) {
dispatch({ getServicesNomal(getBatchOptionsApi, { ids: refIds }).then(options => {
type: 'formList/getBatchOptions',
payload: { ids: refIds },
callback: (options) => {
this.setState({ options }); this.setState({ options });
},
}); });
} }
} }
},
}); });
//渲染表单字段 //渲染表单字段
if (recordId != null) { if (recordId != null) {
dispatch({ getServicesNomal(getFormDataApi, {
type: 'formList/getDetail',
payload: {
dataObjId: objId, dataObjId: objId,
key: recordKey, key: recordKey,
value: recordId, value: recordId,
}, }).then(date => {
callback: (date) => {
if (date) { if (date) {
this.state.formData = date; this.state.formData = date;
} }
},
}); });
} }
} }
...@@ -85,13 +79,9 @@ class FormEdit extends React.Component { ...@@ -85,13 +79,9 @@ class FormEdit extends React.Component {
isAdd, isAdd,
isSelf: true, isSelf: true,
}; };
this.props.dispatch({ getServicesNomal(addFormDataApi, payload).then(() => {
type: 'formList/add',
payload,
callback: () => {
message.success('操作成功'); message.success('操作成功');
router.goBack(); router.goBack();
},
}); });
}; };
......
...@@ -36,6 +36,18 @@ import { getPopconfirm, getModal } from '@/webPublic/one_stop_public/utils/utils ...@@ -36,6 +36,18 @@ import { getPopconfirm, getModal } from '@/webPublic/one_stop_public/utils/utils
import { text, number, date } from '@/webPublic/one_stop_public/libs/formList/config'; import { text, number, date } from '@/webPublic/one_stop_public/libs/formList/config';
import { FormListButtons } from '@/webPublic/one_stop_public/libs/formList/FormListButtons'; import { FormListButtons } from '@/webPublic/one_stop_public/libs/formList/FormListButtons';
import countWidth from '@/webPublic/one_stop_public/libs/formList/countWidth'; import countWidth from '@/webPublic/one_stop_public/libs/formList/countWidth';
import { getFormDataPage, getServicesNomal } from '../../Services/services';
import {
getHeaderListApi,
getBatchOptionsApi,
getFormDataApi,
deleteFormDataApi,
getDetailByCodeApi,
findByCodeApi,
getDetailApi,
addFormDataApi,
getGroupListApi
} from '../../Services/apiConfig';
const FormItem = Form.Item; const FormItem = Form.Item;
const Popconfirm = getPopconfirm(); const Popconfirm = getPopconfirm();
...@@ -119,19 +131,19 @@ const CreateForm = Form.create()((props) => { ...@@ -119,19 +131,19 @@ const CreateForm = Form.create()((props) => {
); );
}); });
@connect(({ // @connect(({
formList, // formList,
DataColumn, // DataColumn,
DataObj // DataObj
}) => ({ // }) => ({
formList, // formList,
DataColumn, // DataColumn,
DataObj, // DataObj,
// loading: loading.models.formList || loading.models.DataColumn || loading.models.DataObj, // // loading: loading.models.formList || loading.models.DataColumn || loading.models.DataObj,
// loading: loading.models.formList, // // loading: loading.models.formList,
// 解决 禅道 28100 查询下拉选择后界面会刷新一次 // // 解决 禅道 28100 查询下拉选择后界面会刷新一次
// https://blog.csdn.net/m0_37148591/article/details/103685339 dva-loading // // https://blog.csdn.net/m0_37148591/article/details/103685339 dva-loading
})) // }))
@Form.create() @Form.create()
class FormList extends React.Component { class FormList extends React.Component {
state = { state = {
...@@ -177,34 +189,26 @@ class FormList extends React.Component { ...@@ -177,34 +189,26 @@ class FormList extends React.Component {
} }
if (refIds.length > 0) { if (refIds.length > 0) {
this.props.dispatch({ getServicesNomal(getBatchOptionsApi, { ids: refIds }).then(options => {
type: 'formList/getBatchOptions',
payload: { ids: refIds },
callback: (options) => {
this.setState({ options: { ...this.state.options, ...options } }); this.setState({ options: { ...this.state.options, ...options } });
},
}); });
} }
}; };
modify = (record) => { modify = (record) => {
// if (this.state.formItem.length < 10) { // if (this.state.formItem.length < 10) {
this.getOptions(); this.getOptions();
this.props.dispatch({ getServicesNomal(getFormDataApi, {
type: 'formList/getDetail',
payload: {
dataObjId: this.state.objId, dataObjId: this.state.objId,
key: this.state.primaryKey, key: this.state.primaryKey,
value: record[this.state.primaryKey], value: record[this.state.primaryKey],
isBase: false, isBase: false,
}, }).then(record2 => {
callback: (record2) => {
this.setState({ this.setState({
formData: record2, formData: record2,
modalVisible: true, modalVisible: true,
isAdd: false, isAdd: false,
isView: false, isView: false,
}); });
},
}); });
}; };
...@@ -239,33 +243,22 @@ class FormList extends React.Component { ...@@ -239,33 +243,22 @@ class FormList extends React.Component {
//找出主键 //找出主键
let Keys = {}; let Keys = {};
Keys[this.state.primaryKey] = record[this.state.primaryKey]; Keys[this.state.primaryKey] = record[this.state.primaryKey];
this.props.dispatch({ getServicesNomal(deleteFormDataApi, {
type: 'formList/delete',
payload: {
keys: JSON.stringify(Keys), keys: JSON.stringify(Keys),
objId: this.state.objId, objId: this.state.objId,
}, }).then(res => {
callback: () => {
this.getPage(); this.getPage();
},
}); });
}; };
viewProcess = (record) => { viewProcess = (record) => {
const { dispatch } = this.props; getServicesNomal(getDetailByCodeApi, { code: record.process_biz_key }).then(data => {
dispatch({
type: 'formList/getAppId',
payload: {
code: record.process_biz_key,
},
callback: (data) => {
const domainName = sessionStorage.getItem('domainName') const domainName = sessionStorage.getItem('domainName')
? sessionStorage.getItem('domainName') ? sessionStorage.getItem('domainName')
: ''; : '';
window.open(domainName + '/portal/serviceCentre/getdetail?id=' + data.id, '_blank'); window.open(domainName + '/portal/serviceCentre/getdetail?id=' + data.id, '_blank');
//router.push({ pathname: '/portal/serviceCentre/getdetail', state: { id: data.id } }); //router.push({ pathname: '/portal/serviceCentre/getdetail', state: { id: data.id } });
},
}); });
}; };
...@@ -289,12 +282,10 @@ class FormList extends React.Component { ...@@ -289,12 +282,10 @@ class FormList extends React.Component {
//渲染值 //渲染值
componentDidMount() { componentDidMount() {
const { dispatch } = this.props;
window.addEventListener('resize', this.resize); window.addEventListener('resize', this.resize);
if (this.props.objCode) { if (this.props.objCode) {
const { const {
dispatch,
objCode, objCode,
sql sql
} = this.props; } = this.props;
...@@ -302,11 +293,8 @@ class FormList extends React.Component { ...@@ -302,11 +293,8 @@ class FormList extends React.Component {
if (Number(objCode) === 1) { if (Number(objCode) === 1) {
this.initColumn(); this.initColumn();
} else { } else {
// console.log('componentDidMount-296'); // DataObj models层中的数据
dispatch({ getServicesNomal(findByCodeApi, { objCode: this.props.objCode }).then(dataObj => {
type: 'DataObj/findByCode',
payload: { objCode: this.props.objCode },
callback: (dataObj) => {
this.setState( this.setState(
{ {
objId: dataObj.id, objId: dataObj.id,
...@@ -314,40 +302,12 @@ class FormList extends React.Component { ...@@ -314,40 +302,12 @@ class FormList extends React.Component {
}, },
() => { () => {
this.initColumn(); this.initColumn();
/** })
* 2022年10月27日
* 欢哥说这个权限功能没用了 在一站式后台元数据管理-数据授权里面修改 实际已经废弃了
* 问了姚新国也说没用了. 有问题就还原回来
* */
// dispatch({
// type: 'DataRight/getUserRight',
// payload: { objId: this.state.objId },
// callback: (data) => {
// if (!this.props.rights) {
// this.setState({ rights: data });
// }
// dispatch({
// type: 'DataRight/getUserColumnRight',
// payload: { objId: this.state.objId },
// callback: (data) => {
// this.setState({ columnRights: data });
// this.initColumn();
// },
// });
// },
// });
},
);
},
}); });
} }
} else { } else {
dispatch({ getServicesNomal(getDetailApi, { id: this.state.objId }).then(data => {
type: 'formList/getObjDetail',
payload: { id: this.state.objId },
callback: (data) => {
this.setState({ isTable: data.isTable }); this.setState({ isTable: data.isTable });
},
}); });
/** /**
* 2022年10月27日 * 2022年10月27日
...@@ -355,23 +315,6 @@ class FormList extends React.Component { ...@@ -355,23 +315,6 @@ class FormList extends React.Component {
* 问了姚新国也说没用了 * 问了姚新国也说没用了
* */ * */
this.initColumn(); this.initColumn();
// dispatch({
// type: 'DataRight/getUserRight',
// payload: { objId: this.state.objId },
// callback: (data) => {
// if (!this.props.rights) {
// this.setState({ rights: data });
// }
// dispatch({
// type: 'DataRight/getUserColumnRight',
// payload: { objId: this.state.objId },
// callback: (data) => {
// this.setState({ columnRights: data });
// this.initColumn();
// },
// });
// },
// });
} }
} }
...@@ -424,7 +367,6 @@ class FormList extends React.Component { ...@@ -424,7 +367,6 @@ class FormList extends React.Component {
initColumn = () => { initColumn = () => {
const { const {
dispatch,
value, value,
objCode objCode
} = this.props; } = this.props;
...@@ -462,10 +404,7 @@ class FormList extends React.Component { ...@@ -462,10 +404,7 @@ class FormList extends React.Component {
this.getPage(); this.getPage();
return undefined; return undefined;
} }
dispatch({ getServicesNomal(getHeaderListApi, { dataObjId: this.state.objId }).then(datas => {
type: 'formList/getHead',
payload: { dataObjId: this.state.objId },
callback: (datas) => {
this.state.formItem = datas; this.state.formItem = datas;
const querys = []; const querys = [];
const groups = {}; const groups = {};
...@@ -478,13 +417,9 @@ class FormList extends React.Component { ...@@ -478,13 +417,9 @@ class FormList extends React.Component {
refIds.push(datas[t].id); refIds.push(datas[t].id);
} }
if (datas[t].isGroupQuery != null) { if (datas[t].isGroupQuery != null) {
dispatch({ getServicesNomal(getGroupListApi, { columnId: datas[t].id }).then(gourp => {
type: 'formList/getGroupList',
payload: { columnId: datas[t].id },
callback: (gourp) => {
groups[datas[t].id] = gourp; groups[datas[t].id] = gourp;
this.setState({ groups }); this.setState({ groups });
},
}); });
} }
} }
...@@ -492,17 +427,12 @@ class FormList extends React.Component { ...@@ -492,17 +427,12 @@ class FormList extends React.Component {
if (querys.length > 0) { if (querys.length > 0) {
this.setState({ querys }); this.setState({ querys });
if (refIds.length > 0) { if (refIds.length > 0) {
dispatch({ getServicesNomal(getBatchOptionsApi, { ids: refIds }).then(options => {
type: 'formList/getBatchOptions',
payload: { ids: refIds },
callback: (options) => {
this.setState({ options }); this.setState({ options });
},
}); });
} }
} }
this.getPage(); this.getPage();
},
}); });
} }
return; return;
...@@ -517,10 +447,7 @@ class FormList extends React.Component { ...@@ -517,10 +447,7 @@ class FormList extends React.Component {
this.getPage(); this.getPage();
return undefined; return undefined;
} }
dispatch({ getServicesNomal(getHeaderListApi, { dataObjId: this.state.objId }).then(datas => {
type: 'formList/getHead',
payload: { dataObjId: this.state.objId },
callback: (datas) => {
const querys = []; const querys = [];
const refIds = []; const refIds = [];
const groups = {}; const groups = {};
...@@ -626,13 +553,9 @@ class FormList extends React.Component { ...@@ -626,13 +553,9 @@ class FormList extends React.Component {
refIds.push(datas[t].id); refIds.push(datas[t].id);
} }
if (datas[t].isGroupQuery != null) { if (datas[t].isGroupQuery != null) {
dispatch({ getServicesNomal(getGroupListApi, { columnId: datas[t].id }).then(gourp => {
type: 'formList/getGroupList',
payload: { columnId: datas[t].id },
callback: (gourp) => {
groups[datas[t].id] = gourp; groups[datas[t].id] = gourp;
this.setState({ groups }); this.setState({ groups });
},
}); });
} }
} }
...@@ -641,19 +564,14 @@ class FormList extends React.Component { ...@@ -641,19 +564,14 @@ class FormList extends React.Component {
if (querys.length > 0) { if (querys.length > 0) {
this.setState({ querys }); this.setState({ querys });
if (refIds.length > 0) { if (refIds.length > 0) {
dispatch({ getServicesNomal(getBatchOptionsApi, { ids: refIds }).then(options => {
type: 'formList/getBatchOptions',
payload: { ids: refIds },
callback: (options) => {
this.setState({ options }); this.setState({ options });
}, })
});
} }
} }
this.getPage(); this.getPage();
} }
},
}); });
} }
}; };
...@@ -664,7 +582,6 @@ class FormList extends React.Component { ...@@ -664,7 +582,6 @@ class FormList extends React.Component {
if (!this.columns || !Array.isArray(this.columns) || this.columns.length === 0) { if (!this.columns || !Array.isArray(this.columns) || this.columns.length === 0) {
return; return;
} }
const { dispatch } = this.props;
const pagination = this.state.data.pagination; const pagination = this.state.data.pagination;
if (params == null) { if (params == null) {
...@@ -705,16 +622,12 @@ class FormList extends React.Component { ...@@ -705,16 +622,12 @@ class FormList extends React.Component {
this.setState({ this.setState({
loading: true, loading: true,
}); });
dispatch({ getFormDataPage({
type: 'formList/fetch',
payload: {
custom: this.custom, custom: this.custom,
...params, ...params,
sql: this.sqlBs16, sql: this.sqlBs16,
dataObjId: this.state.objId, dataObjId: this.state.objId,
}, }).then(data => {
callback: (data) => {
this.setState({ this.setState({
loading: false, loading: false,
}); });
...@@ -730,7 +643,6 @@ class FormList extends React.Component { ...@@ -730,7 +643,6 @@ class FormList extends React.Component {
selectedRows: [], // 姚鑫国说的 调了分页接口以后需要 把这个选择的行数据 清空 selectedRows: [], // 姚鑫国说的 调了分页接口以后需要 把这个选择的行数据 清空
}); });
} }
},
}); });
} }
}; };
...@@ -759,22 +671,18 @@ class FormList extends React.Component { ...@@ -759,22 +671,18 @@ class FormList extends React.Component {
let params = { let params = {
...fields, ...fields,
}; };
this.props.dispatch({ getServicesNomal(addFormDataApi, {
type: 'formList/add',
payload: {
params: params, params: params,
objId: this.state.objId, objId: this.state.objId,
isAdd: isAdd, isAdd: isAdd,
isSelf: true, isSelf: true,
isView: false, isView: false,
}, }).then(() => {
callback: () => {
message.success('操作成功'); message.success('操作成功');
this.setState({ this.setState({
modalVisible: false, modalVisible: false,
}); });
this.getPage(); this.getPage();
},
}); });
}; };
...@@ -813,7 +721,6 @@ class FormList extends React.Component { ...@@ -813,7 +721,6 @@ class FormList extends React.Component {
}; };
batchDelete = (e) => { batchDelete = (e) => {
const { dispatch } = this.props;
const { selectedRows } = this.state; const { selectedRows } = this.state;
if (!selectedRows) return; if (!selectedRows) return;
...@@ -828,19 +735,15 @@ class FormList extends React.Component { ...@@ -828,19 +735,15 @@ class FormList extends React.Component {
.join(','); .join(',');
} }
} }
this.props.dispatch({ getServicesNomal(deleteFormDataApi, {
type: 'formList/delete',
payload: {
keys: JSON.stringify(Keys), keys: JSON.stringify(Keys),
objId: this.state.objId, objId: this.state.objId,
// isSelf: true, // isSelf: true,
}, }).then(res => {
callback: () => {
this.setState({ this.setState({
selectedRows: [], selectedRows: [],
}); });
this.getPage(); this.getPage();
},
}); });
}; };
...@@ -851,7 +754,6 @@ class FormList extends React.Component { ...@@ -851,7 +754,6 @@ class FormList extends React.Component {
e.preventDefault(); e.preventDefault();
const { const {
dispatch,
form form
} = this.props; } = this.props;
...@@ -894,7 +796,7 @@ class FormList extends React.Component { ...@@ -894,7 +796,7 @@ class FormList extends React.Component {
}; };
hanldeHighSearch = (e) => { hanldeHighSearch = (e) => {
const pagination = this.props.formList.data.pagination; const pagination = this.state.data.pagination;
let params = { let params = {
pageNo: pagination.current ? pagination.current : 1, pageNo: pagination.current ? pagination.current : 1,
pageSize: pagination.pageSize ? pagination.pageSize : this.props.pageSize || 10, pageSize: pagination.pageSize ? pagination.pageSize : this.props.pageSize || 10,
...@@ -904,10 +806,7 @@ class FormList extends React.Component { ...@@ -904,10 +806,7 @@ class FormList extends React.Component {
this.getPage(params); this.getPage(params);
}; };
handleFormReset = () => { handleFormReset = () => {
const { const { form } = this.props;
form,
dispatch
} = this.props;
form.resetFields(); form.resetFields();
this.setState( this.setState(
{ {
......
...@@ -84,7 +84,16 @@ import giveVarcharRules from '@/webPublic/one_stop_public/tableCompon/Split_Inde ...@@ -84,7 +84,16 @@ import giveVarcharRules from '@/webPublic/one_stop_public/tableCompon/Split_Inde
import getPopupContainer from '@/webPublic/one_stop_public/tableCompon/Split_Index/getPopupContainer'; import getPopupContainer from '@/webPublic/one_stop_public/tableCompon/Split_Index/getPopupContainer';
import StepDiy from '@/webPublic/one_stop_public/tableCompon/Split_Index/StepDiy'; import StepDiy from '@/webPublic/one_stop_public/tableCompon/Split_Index/StepDiy';
import EchartsDiy from '@/webPublic/one_stop_public/tableCompon/Split_Index/EchartsDiy'; import EchartsDiy from '@/webPublic/one_stop_public/tableCompon/Split_Index/EchartsDiy';
import { getServicesNomal } from '../Services/services';
import {
getHeaderListApi,
getSqlDataApi,
findApi,
getSqlOptionsApi,
getSqlLabelsApi,
getLabelsApi,
getOptionsApi,
} from '../Services/apiConfig';
/** /**
* 日期组件antd3.x有bug 详情见禅道 27152 毕业跟踪调查管理 毕业时间改为年级筛选 * 日期组件antd3.x有bug 详情见禅道 27152 毕业跟踪调查管理 毕业时间改为年级筛选
*/ */
...@@ -447,19 +456,12 @@ export default class TableCom extends Component { ...@@ -447,19 +456,12 @@ export default class TableCom extends Component {
preHandle(allValues); preHandle(allValues);
allValues = JSON.stringify(allValues); allValues = JSON.stringify(allValues);
if (json.comName === 'TableSelect') { if (json.comName === 'TableSelect') {
const { dispatch } = this.props;
const { sqlKey, optionType } = json; const { sqlKey, optionType } = json;
if (optionType === 'sql') { if (optionType === 'sql') {
dispatch({ getServicesNomal(findApi, { sqlKey }).then(sqlModel => {
type: 'SqlManageEntity/find',
payload: { sqlKey },
callback: sqlModel => {
this.setState({ sqlModel }); this.setState({ sqlModel });
if (sqlModel.dataObjId) { if (sqlModel.dataObjId) {
dispatch({ getServicesNomal(getHeaderListApi, { dataObjId: sqlModel.dataObjId }).then(datas => {
type: 'formList/getHead',
payload: { dataObjId: sqlModel.dataObjId },
callback: datas => {
if (datas) { if (datas) {
const columns = []; const columns = [];
for (var i = 0; i < datas.length; i++) { for (var i = 0; i < datas.length; i++) {
...@@ -482,7 +484,6 @@ export default class TableCom extends Component { ...@@ -482,7 +484,6 @@ export default class TableCom extends Component {
} }
this.setState({ columns }); this.setState({ columns });
} }
},
}); });
} else { } else {
const cols = sqlModel.cols; const cols = sqlModel.cols;
...@@ -522,29 +523,21 @@ export default class TableCom extends Component { ...@@ -522,29 +523,21 @@ export default class TableCom extends Component {
} }
this.setState({ columns }); this.setState({ columns });
} }
dispatch({ getServicesNomal(getSqlDataApi, {
type: 'DataColumn/getSqlData',
payload: {
sqlKey, sqlKey,
allValues, allValues,
isCache: this.otherProps?.isCache || false, isCache: this.otherProps?.isCache || false,
}, }).then(list => {
callback: list => {
const x = { const x = {
list: list, list: list,
pagination: false, pagination: false,
}; };
this.setState({ dataSource: x }); this.setState({ dataSource: x });
},
}); });
} }
},
}); });
} else if (optionType == 'reference' && dataColumn.referenceObjId) { } else if (optionType == 'reference' && dataColumn.referenceObjId) {
dispatch({ getServicesNomal(getHeaderListApi, { dataObjId: dataColumn.referenceObjId }).then(datas => {
type: 'formList/getHead',
payload: { dataObjId: dataColumn.referenceObjId },
callback: datas => {
if (datas) { if (datas) {
const columns = []; const columns = [];
for (var i = 0; i < datas.length; i++) { for (var i = 0; i < datas.length; i++) {
...@@ -563,7 +556,6 @@ export default class TableCom extends Component { ...@@ -563,7 +556,6 @@ export default class TableCom extends Component {
} }
this.setState({ columns }); this.setState({ columns });
} }
},
}); });
} }
} }
...@@ -1270,14 +1262,9 @@ export default class TableCom extends Component { ...@@ -1270,14 +1262,9 @@ export default class TableCom extends Component {
return; return;
} }
if (json.sqlKey != null && json.sqlKey !== '') { if (json.sqlKey != null && json.sqlKey !== '') {
const { dispatch } = this.props; getServicesNomal(findApi, { sqlKey: json.sqlKey }).then(res => {
dispatch({
type: 'SqlManageEntity/find',
payload: { sqlKey: json.sqlKey },
callback: res => {
this.setState({ sqlContent: res.sql }); this.setState({ sqlContent: res.sql });
}, })
});
} }
const bindObj = this.getColumn('c1'); const bindObj = this.getColumn('c1');
...@@ -1325,7 +1312,6 @@ export default class TableCom extends Component { ...@@ -1325,7 +1312,6 @@ export default class TableCom extends Component {
// 解决禅道bug 28017 // 解决禅道bug 28017
allValues = {}; allValues = {};
} }
const { dispatch } = this.props;
if (init != null && Object.keys(init).length > 0) { if (init != null && Object.keys(init).length > 0) {
const params = { const params = {
sqlKey, sqlKey,
...@@ -1341,11 +1327,7 @@ export default class TableCom extends Component { ...@@ -1341,11 +1327,7 @@ export default class TableCom extends Component {
getServicesNomal(getSqlOptionsApi, params).then(options => {
dispatch({
type: 'DataColumn/getSqlOptions',
payload: params,
callback: options => {
const optionsx = []; const optionsx = [];
let base52 = dataColumn.base52; let base52 = dataColumn.base52;
let vl = this.props.form.getFieldsValue()[base52]; let vl = this.props.form.getFieldsValue()[base52];
...@@ -1369,7 +1351,6 @@ export default class TableCom extends Component { ...@@ -1369,7 +1351,6 @@ export default class TableCom extends Component {
options: optionsx, options: optionsx,
selectDis: false, selectDis: false,
}); });
},
}); });
} else if (!this.props.isEdit && Object.keys(obj).length > 0) { } else if (!this.props.isEdit && Object.keys(obj).length > 0) {
let base52 = dataColumn.base52; let base52 = dataColumn.base52;
...@@ -1394,17 +1375,13 @@ export default class TableCom extends Component { ...@@ -1394,17 +1375,13 @@ export default class TableCom extends Component {
} }
if (obj[base52]) { if (obj[base52]) {
dispatch({ getServicesNomal(getSqlLabelsApi, params).then(labels => {
type: 'DataColumn/getSqlLabels',
payload: params,
callback: labels => {
this.setState({ this.setState({
getSqlOptionsCache, getSqlOptionsCache,
labels, labels,
selectDis: false, selectDis: false,
}); });
}, })
});
} }
} else { } else {
const params = { const params = {
...@@ -1423,11 +1400,7 @@ export default class TableCom extends Component { ...@@ -1423,11 +1400,7 @@ export default class TableCom extends Component {
// if(params.sqlKey === 'KFRvOyGdyvU'){ // if(params.sqlKey === 'KFRvOyGdyvU'){
// console.log(params); // console.log(params);
// } // }
dispatch({ getServicesNomal(getSqlOptionsApi, params).then(options => {
type: 'DataColumn/getSqlOptions',
payload: params,
callback: options => {
// console.log(options);
let base52 = dataColumn.base52; let base52 = dataColumn.base52;
let vl = this.props.form.getFieldsValue()[base52]; let vl = this.props.form.getFieldsValue()[base52];
const optionsx = []; const optionsx = [];
...@@ -1447,8 +1420,6 @@ export default class TableCom extends Component { ...@@ -1447,8 +1420,6 @@ export default class TableCom extends Component {
} }
if (!isExist && vl != null && options.length > 0) { if (!isExist && vl != null && options.length > 0) {
//console.log("isExist",optionsx,vl,isExist)
// console.log(1186, base52);
this.props.form.setFieldsValue({ [base52]: null }); this.props.form.setFieldsValue({ [base52]: null });
} }
...@@ -1457,8 +1428,7 @@ export default class TableCom extends Component { ...@@ -1457,8 +1428,7 @@ export default class TableCom extends Component {
options: optionsx, options: optionsx,
selectDis: false, selectDis: false,
}); });
}, })
});
} }
}; };
changeEnum = (obj, dataColumn, options) => { changeEnum = (obj, dataColumn, options) => {
...@@ -1499,17 +1469,13 @@ export default class TableCom extends Component { ...@@ -1499,17 +1469,13 @@ export default class TableCom extends Component {
} }
}; };
fetchData = (obj, dataColumn, init, filterSql, allValues) => { fetchData = (obj, dataColumn, init, filterSql, allValues) => {
const { dispatch } = this.props;
if (init != null && Object.keys(init).length > 0) { if (init != null && Object.keys(init).length > 0) {
dispatch({ getServicesNomal(getSqlOptionsApi, {
type: 'DataColumn/getOptions',
payload: {
id: dataColumn.id, id: dataColumn.id,
filterSql, filterSql,
allValues, allValues,
}, }).then(options => {
callback: options => {
const optionsx = []; const optionsx = [];
for (var i = 0; i < options.length; i++) { for (var i = 0; i < options.length; i++) {
optionsx.push({ optionsx.push({
...@@ -1521,35 +1487,27 @@ export default class TableCom extends Component { ...@@ -1521,35 +1487,27 @@ export default class TableCom extends Component {
options: optionsx, options: optionsx,
selectDis: false, selectDis: false,
}); });
},
}); });
} else if (!this.props.isEdit && Object.keys(obj).length > 0) { } else if (!this.props.isEdit && Object.keys(obj).length > 0) {
if (obj[dataColumn.base52]) { if (obj[dataColumn.base52]) {
dispatch({ getServicesNomal(getLabelsApi, {
type: 'DataColumn/getLabels',
payload: {
id: dataColumn.id, id: dataColumn.id,
values: obj[dataColumn.base52], values: obj[dataColumn.base52],
filterSql, filterSql,
allValues, allValues,
}, }).then(labels => {
callback: labels => {
this.setState({ this.setState({
labels, labels,
selectDis: false, selectDis: false,
}); });
},
}); });
} }
} else { } else {
dispatch({ getServicesNomal(getOptionsApi, {
type: 'DataColumn/getOptions',
payload: {
id: dataColumn.id, id: dataColumn.id,
filterSql, filterSql,
allValues, allValues,
}, }).then(options => {
callback: options => {
const optionsx = []; const optionsx = [];
for (var i = 0; i < options.length; i++) { for (var i = 0; i < options.length; i++) {
optionsx.push({ optionsx.push({
...@@ -1561,7 +1519,6 @@ export default class TableCom extends Component { ...@@ -1561,7 +1519,6 @@ export default class TableCom extends Component {
options: optionsx, options: optionsx,
selectDis: false, selectDis: false,
}); });
},
}); });
} }
}; };
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论