import React from 'react'; import { connect } from 'dva'; import { Button, Row, Col, Form, Input, Select, DatePicker, Modal, Transfer, Spin, Table, Tabs, Popconfirm, message } from 'antd'; import { extend, extendRule, initFilter, initQueryFilter, getOnlyPropertyData, extendInclude, getDataFieldValue, guid, initFilterGroup, extendGroupRule } from "../../../utils/common"; import moment from 'moment' import FormPage from '../../FormPage'; import storage from "../../../utils/storage"; import config from "../../../config.js"; const FormItem = Form.Item; const Option = Select.Option; const TabPane = Tabs.TabPane; const { TextArea } = Input; class FormConfigSqlPage extends React.Component { constructor(props) { super(props); this.state = { data: {}, btns: [], title: '流程审核', historyData: [], remark: '', }; }; componentDidMount() { this.props.form.resetFields(); this.loadData(); this.props.dispatch({ type: 'custom/save', payload: { formConfigSqlClick: false }, }); } componentWillReceiveProps(NextProps) { if (NextProps.custom.formConfigSqlClick) { this.props.form.resetFields(); this.loadData(); this.props.dispatch({ type: 'custom/save', payload: { formConfigSqlClick: false }, }); } } loadData = () => { this.setState({ sqls: '', data: { FormType: 1, DataBaseType: 1, DstOrgId: storage('lacal').getItem('formConfigSqlDstOrgId' + this.props.login.userId).val, DstFormConfigVersion: '', SqlType: "0", StartTime: null, loadSqlFileUrl: null, dbConnStr: storage('lacal').getItem('formConfigSqlDbConnStr' + this.props.login.userId).val, formCode: '' } }) }; getSqlsByFormId = () => { const { data } = this.props; const { ids } = data ? data : {}; if (!this.state.data.FormType) { message.error('请选择导出类型'); return; } if (!this.state.data.DataBaseType) { message.error('请选择数据库类型'); return; } // if(!this.state.data.DstOrgId) { // message.error('请输入目标组织ID'); // return; // } if (!ids && !this.state.data.StartTime && !this.state.data.formCode) { message.error('为了效率考虑,请选择表单记录或者选择开始时间'); return; } storage('lacal').setItem(('formConfigSqlDstOrgId' + this.props.login.userId), this.state.data.DstOrgId); storage('lacal').setItem(('formConfigSqlDbConnStr' + this.props.login.userId), this.state.data.dbConnStr); var json = initFilter(this.props.login.OrgId); json['Keyword'] = ids; json['Parameter1'] = this.state.data.DataBaseType; json['Parameter2'] = this.state.data.DstOrgId; json['Parameter3'] = this.state.data.DstFormConfigVersion; json['Parameter4'] = this.state.data.SqlType; json['Parameter5'] = this.state.data.StartTime; json['Parameter7'] = this.state.data.formConfigSqlType; json['Parameter8'] = this.state.data.dbConnStr; json['Parameter9'] = true; json['Parameter10'] = this.state.data.FormType; json['Parameter11'] = this.state.data.formCode; this.props.dispatch({ type: 'PFForm/getSqlsByFormId', payload: json, onComplete: (ret) => { if (this.state.data.formConfigSqlType === 1 || this.state.data.formConfigSqlType === '1') { this.setState({ loadSqlFileUrl: ret, sqls: ret ? "请正在下载文件" : "无任何配置信息" }, () => { if (ret) { this.aRef.click(); } }) } else { this.setState({ sqls: ret, loadSqlFileUrl: null, }) } } }); } handleLoadSqlFile = () => { } render() { const formItemLayout = { labelCol: { span: 6 }, wrapperCol: { span: 14 }, }; return (
{ const data = { ...this.state.data }; data.StartTime = dataStr; this.setState({ data, }) }} /> {/* { const data={...this.state.data}; data.DstOrgId=e.target.value; this.setState({ data, }) }} /> */} { const data = { ...this.state.data }; data.DstFormConfigVersion = e.target.value; this.setState({ data, }) }} /> { const data = { ...this.state.data }; data.dbConnStr = e.target.value; this.setState({ data, }) }} /> { const data = { ...this.state.data }; data.formCode = e.target.value; this.setState({ data, }) }} />
  • 行洛坑    b043b28b-bbc3-c452-6052-4fba1457abfa
  • 洛阳豫鹭 d9871ba8-0eec-9e4a-bb87-7d5a540d8913
  • 都昌金鼎 8b3c41aa-51b1-7ce9-1879-248a038c1b5c
  • 龙岩稀土 8f1cf418-8bf3-ea3f-7a6d-fc5d61247008
  • 广西博白 3EFD5276-632B-E379-9FF3-7A7546591FCA
  • demo8 88888888-8888-8888-8888-888888888888
  • SMS         A3DCE14A-13D9-D879-D9AB-821D4A3F1F93
  • 连城锰矿 11111111-1111-1111-1111-111111111111
this.aRef = ref} download />