提交 dc429174 authored 作者: 徐立's avatar 徐立

合并

...@@ -23,6 +23,7 @@ export default function MyApplyList({ ...@@ -23,6 +23,7 @@ export default function MyApplyList({
fileSpan = defaultFieldSpan, fileSpan = defaultFieldSpan,
tableRowKey = 'buzinessId', tableRowKey = 'buzinessId',
columns = [], columns = [],
scroll,
}) { }) {
const pageSearch = { const pageSearch = {
search: { search: {
...@@ -39,6 +40,7 @@ export default function MyApplyList({ ...@@ -39,6 +40,7 @@ export default function MyApplyList({
nameSpan, nameSpan,
fileSpan, fileSpan,
}, },
scroll,
tableRowKey, tableRowKey,
columns, columns,
}; };
......
...@@ -11,11 +11,14 @@ import { Toast } from 'antd-mobile' ...@@ -11,11 +11,14 @@ import { Toast } from 'antd-mobile'
import router from 'umi/router' import router from 'umi/router'
import IsNewTable from './isNewMobileTable'; import IsNewTable from './isNewMobileTable';
import NewWebTable from './isNewWebTable'; import NewWebTable from './isNewWebTable';
import maintain from '../assets/maintain.png'
import moment from 'moment'
export default class ZdyTable extends Component { export default class ZdyTable extends Component {
constructor(props) { constructor(props) {
super(props) super(props)
this.state = { this.state = {
selects: new Map(), selects: new Map(),
left: 0, left: 0,
top: 0, top: 0,
...@@ -34,10 +37,11 @@ export default class ZdyTable extends Component { ...@@ -34,10 +37,11 @@ export default class ZdyTable extends Component {
isEdit: true, isEdit: true,
isReady: false, isReady: false,
formConfig: {}, formConfig: {},
} }
} }
componentDidMount(){ componentDidMount() {
let { let {
postData, // 数据源 postData, // 数据源
isCg, // 用户点击草稿页面进入 isCg, // 用户点击草稿页面进入
...@@ -356,7 +360,7 @@ export default class ZdyTable extends Component { ...@@ -356,7 +360,7 @@ export default class ZdyTable extends Component {
}) })
return max return max
} }
render() { render() {
let { let {
width, width,
...@@ -367,6 +371,7 @@ export default class ZdyTable extends Component { ...@@ -367,6 +371,7 @@ export default class ZdyTable extends Component {
defaultValues, defaultValues,
items, items,
init, init,
modalTitle,
currentFormKey, currentFormKey,
isEdit, isEdit,
datas, datas,
...@@ -383,6 +388,8 @@ export default class ZdyTable extends Component { ...@@ -383,6 +388,8 @@ export default class ZdyTable extends Component {
fatherCode, fatherCode,
routerState, // 场景设计器共享路由参数 routerState, // 场景设计器共享路由参数
messageData, // 场景设计器共享变量参数 设计器监听到参数发生变化后会重新渲染组件 messageData, // 场景设计器共享变量参数 设计器监听到参数发生变化后会重新渲染组件
postData,
modalInit,
} = this.props } = this.props
let style = {} let style = {}
if (formConfig.style != null) { if (formConfig.style != null) {
...@@ -416,33 +423,55 @@ export default class ZdyTable extends Component { ...@@ -416,33 +423,55 @@ export default class ZdyTable extends Component {
borderLeft: "1px solid gray", borderLeft: "1px solid gray",
borderTop: "1px solid gray" borderTop: "1px solid gray"
} }
let updateTime
const styleDiv = this.props.height ? { overflow: "auto", width: "100%", height: this.props.height } : { overflow: "auto", width: "100%" } const styleDiv = this.props.height ? { overflow: "auto", width: "100%", height: this.props.height } : { overflow: "auto", width: "100%" }
if (!isReady) return <></> if (!isReady) return <></>
if (this.props.postData?.isUpdate) {
updateTime = moment(+this.props.postData?.updateTime).format('llll')
}
switch (get) { switch (get) {
case 'web': case 'web':
return ( return (<>
<Form {this.props.postData?.isUpdate ?
className="login-form" > <div style={{ margin: '100px 24px 24px' }}>
{isEdit && defaultBinds ? Object.keys(defaultBinds).map((k) => { <div style={{ textAlign: 'center' }}>
const r = defaultBinds[k] <img style={{ marginRight: 30 }} src={maintain}></img>
if (r.columnIds == null || r.columnIds.length < 2 || r.sqls == null || r.sqls.length < 2) { </div>
return "" <p style={{
} textAlign: "center",
const name = r.columnIds[r.columnIds.length - 1] width: '100%',
const key = r.sqls[r.sqls.length - 1] fontSize: '16px',
const value = defaultValues[key] fontWeight: 'bold',
color: '#666666',
if (value == null) { }}
return "" >
} {updateTime !== 'Invalid date' ?
`升级维护中,预计${updateTime ?? '一万年'}恢复使用,请耐心等待。` :
return this.props.form.getFieldDecorator(name, { '请耐心等待'}
initialValue: value </p>
</div>
})(<Input type="hidden" />); :<Form
className="login-form" >
}) : ""} {isEdit && defaultBinds ? Object.keys(defaultBinds).map((k) => {
const r = defaultBinds[k]
if (r.columnIds == null || r.columnIds.length < 2 || r.sqls == null || r.sqls.length < 2) {
return ""
}
const name = r.columnIds[r.columnIds.length - 1]
const key = r.sqls[r.sqls.length - 1]
const value = defaultValues[key]
if (value == null) {
return ""
}
return this.props.form.getFieldDecorator(name, {
initialValue: value
})(<Input type="hidden" />);
}) : ""}
<Row> <Row>
<Col span={24}> <Col span={24}>
...@@ -567,22 +596,43 @@ export default class ZdyTable extends Component { ...@@ -567,22 +596,43 @@ export default class ZdyTable extends Component {
</Row> </Row>
</Form> </Form>
)
}</>)
case 'mobile': case 'mobile':
return ( return (<>
<Form {...formItemLayout} id='mobile_table' className="login-form"> {this.props.postData?.isUpdate ?
{defaultBinds ? Object.keys(defaultBinds).map((k) => { <div style={{ margin: '100px 24px 24px' }}>
const r = defaultBinds[k] <div style={{ textAlign: 'center' }}>
if (r.columnIds == null || r.columnIds.length < 2 || r.sqls == null || r.sqls.length < 2) { <img style={{ width: '100%' }} src={maintain}></img>
return "" </div>
} <p style={{
const name = r.columnIds[r.columnIds.length - 1] textAlign: "center",
const key = r.sqls[r.sqls.length - 1] width: '100%',
const value = defaultValues[key] fontSize: '16px',
fontWeight: 'bold',
if (value == null) { color: '#666666',
return "" }}
} >
{updateTime !== 'Invalid date' ?
`升级维护中,预计${updateTime ?? '一万年'}恢复使用,请耐心等待。` :
'请耐心等待'}
</p>
</div>
:
<Form {...formItemLayout} id='mobile_table' className="login-form">
{defaultBinds ? Object.keys(defaultBinds).map((k) => {
const r = defaultBinds[k]
if (r.columnIds == null || r.columnIds.length < 2 || r.sqls == null || r.sqls.length < 2) {
return ""
}
const name = r.columnIds[r.columnIds.length - 1]
const key = r.sqls[r.sqls.length - 1]
const value = defaultValues[key]
if (value == null) {
return ""
}
return this.props.form.getFieldDecorator(name, { return this.props.form.getFieldDecorator(name, {
initialValue: value initialValue: value
...@@ -661,7 +711,7 @@ export default class ZdyTable extends Component { ...@@ -661,7 +711,7 @@ export default class ZdyTable extends Component {
}) })
} */} } */}
</Form> </Form>
) }</>)
} }
} }
} }
import React, { Children } from "react";
import {Button, Form, Input, InputNumber, Modal, Select} from "antd";
export default class FormModal extends React.Component {
render() {
return (
<Modal
destroyOnClose
title={this.props.title}
maskClosable={false}
visible={this.props.visible}
footer={null}
onCancel={this.props.handleCancel}
>
{this.props.children}
</Modal>
);
}
}
\ No newline at end of file
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
*/ */
import React, { Component } from 'react'; import React, { Component } from 'react';
import md5 from 'js-md5'; import md5 from 'js-md5';
import FormModal from './FormModal'
import { import {
message, message,
Icon, Icon,
...@@ -140,14 +141,23 @@ export default class tableCom extends Component { ...@@ -140,14 +141,23 @@ export default class tableCom extends Component {
sqlModel: {}, sqlModel: {},
columns: [], columns: [],
sqlContent: null, sqlContent: null,
isShowModal:false,
modalTitle:"",
modalInit:{},
modalCode:null,
dataSource: { dataSource: {
list: [], list: [],
pagination: false pagination: false
}, },
}; };
excludeKeys = ["defaultValues", ""] excludeKeys = ["defaultValues", ""]
handleCancel=()=>{
this.setState({isShowModal:false})
}
showModal=(fk,title,data)=>{
this.setState({isShowModal:true,modalInit:data,modalTitle:title,modalCode:fk})
}
equal = (obj1, obj2, json, sqlContent, depth) => { equal = (obj1, obj2, json, sqlContent, depth) => {
...@@ -1111,11 +1121,13 @@ export default class tableCom extends Component { ...@@ -1111,11 +1121,13 @@ export default class tableCom extends Component {
} }
getFunctionValue = (fun, column, json, callback) => { getFunctionValue = (fun, column, json, callback) => {
/* if (!this.props.isEdit) { /* if (!this.props.isEdit) {
return return
} */ } */
const base52 = column.base52 const base52 = column.base52
/** /**
* 中台函数库注入 * 中台函数库注入
* 动态生成表单配置函数所使用 * 动态生成表单配置函数所使用
...@@ -1127,7 +1139,7 @@ export default class tableCom extends Component { ...@@ -1127,7 +1139,7 @@ export default class tableCom extends Component {
}) })
}) })
try { try {
var fun1 = new Function("obj","init", "defaultValues", "env", "index", "fatherCode", "utils","$","routerState",'shareData', fun); var fun1 = new Function("obj","init","modalInit", "defaultValues", "env", "index", "fatherCode", "utils","$","routerState",'shareData', fun);
let obj let obj
if(!this.props.isEdit&&this.props.fatherCode){ if(!this.props.isEdit&&this.props.fatherCode){
...@@ -1139,21 +1151,21 @@ export default class tableCom extends Component { ...@@ -1139,21 +1151,21 @@ export default class tableCom extends Component {
const value = fun1(obj, this.props.init, this.props.defaultValues, { clientType: this.props.get, formCode: this.props.formCode, formId: this.props.formId }, this.props.index, this.props.fatherCode, const value = fun1(obj, this.props.init,this.props.modalInit, this.props.defaultValues, { clientType: this.props.get, formCode: this.props.formCode, formId: this.props.formId }, this.props.index, this.props.fatherCode,
{ {
moment: moment, moment: moment,
sql: this.sqlUtil.bind(this, base52, json, callback), sql: this.sqlUtil.bind(this, base52, json, callback),
message: message, router: router, message: message, router: router,
setValues: this.setValues.bind(this, base52, json), setValues: this.setValues.bind(this, base52, json),
req: this.reqUtil.bind(this, base52, json, callback), req: this.reqUtil.bind(this, base52, json, callback),
md5: md5, md5: md5, showModal:this.showModal,
render:this.getRender,base64:getBase64, render:this.getRender,base64:getBase64,
}, },
functionObj, functionObj,
this.props.routerState, this.props.routerState,
this.props.messageData, this.props.messageData,
) )
if (base52) { if (base52) {
if (value != null && value == "norefeshxxxxxxxxxxxxxxxxxxxx") { if (value != null && value == "norefeshxxxxxxxxxxxxxxxxxxxx") {
...@@ -1180,7 +1192,9 @@ export default class tableCom extends Component { ...@@ -1180,7 +1192,9 @@ export default class tableCom extends Component {
this.setState({ option: value }) this.setState({ option: value })
} else { } else {
try { try {
this.props.form.setFieldsValue({ [base52]: value }) this.props.form.setFieldsValue({ [base52]: value })
} catch{ } catch{
console.log(`页面${this.props.formKey}${this.props.i + 1}行,第${this.props.j + 1}列:公式配置有误,函数内部错误,`, e) console.log(`页面${this.props.formKey}${this.props.i + 1}行,第${this.props.j + 1}列:公式配置有误,函数内部错误,`, e)
//message.error(`页面${this.props.formKey}第${this.props.i + 1}行,第${this.props.j + 1}列:公式配置有误,函数内部错误${e}`, 10) //message.error(`页面${this.props.formKey}第${this.props.i + 1}行,第${this.props.j + 1}列:公式配置有误,函数内部错误${e}`, 10)
...@@ -1471,7 +1485,7 @@ export default class tableCom extends Component { ...@@ -1471,7 +1485,7 @@ export default class tableCom extends Component {
* obj为查看详情用户输入值 * obj为查看详情用户输入值
*/ */
let { json, obj, mapData, init, sqlData, defaultValues, get, formKey, isEdit, datas } = this.props; let { json, obj, mapData, init, sqlData, defaultValues, get, formKey, isEdit, datas } = this.props;
const { options, labels, selectDis } = this.state; const { options, labels, selectDis,modalCode,modalTitle,isShowModal,modalInit } = this.state;
const { getFieldDecorator, getFieldError, getFieldProps } = this.props.form; const { getFieldDecorator, getFieldError, getFieldProps } = this.props.form;
const disabled = json != null ? json.disabled : false const disabled = json != null ? json.disabled : false
if (json == null) { if (json == null) {
...@@ -2289,6 +2303,7 @@ export default class tableCom extends Component { ...@@ -2289,6 +2303,7 @@ export default class tableCom extends Component {
})(<Input type="hidden" />); })(<Input type="hidden" />);
break; break;
case 'InputNumber': case 'InputNumber':
/* if (get === 'mobile') { /* if (get === 'mobile') {
cm = (<div className={styles.form}><MobileInputItem cm = (<div className={styles.form}><MobileInputItem
...@@ -2774,6 +2789,10 @@ export default class tableCom extends Component { ...@@ -2774,6 +2789,10 @@ export default class tableCom extends Component {
* 卡片类型 * 卡片类型
*/ */
return (<Card style={{ margin: 5, border: '1px solid #ccc' }}> return (<Card style={{ margin: 5, border: '1px solid #ccc' }}>
{modalCode?<FormModal visible={isShowModal} handleCancel={this.handleCancel} title={modalTitle}>
<ZdyTable modalInit={modalInit} key={modalCode} datas={datas} get={get} isChild={true} currentFormKey={modalCode} isEdit={isEdit} obj={obj} init={init} form={this.props.form} mapData={mapData} sqlData={sqlData} {...datas[modalCode]} defaultValues={defaultValues} />
</FormModal>:""}
<Card.Header title={<span style={{ fontSize: 14 }}>{title}:</span>} /> <Card.Header title={<span style={{ fontSize: 14 }}>{title}:</span>} />
<Card.Body> <Card.Body>
{cm} {cm}
...@@ -2831,30 +2850,45 @@ export default class tableCom extends Component { ...@@ -2831,30 +2850,45 @@ export default class tableCom extends Component {
> >
{cm} {cm}
</Col> </Col>
{modalCode?<FormModal visible={isShowModal} handleCancel={this.handleCancel} title={modalTitle}>
<ZdyTable modalInit={modalInit} key={modalCode} datas={datas} get={get} isChild={true} currentFormKey={modalCode} isEdit={isEdit} obj={obj} init={init} form={this.props.form} mapData={mapData} sqlData={sqlData} {...datas[modalCode]} defaultValues={defaultValues} />
</FormModal>:""}
</Row> </Row>
) )
} else { } else {
return ( return (
<>{modalCode?<FormModal visible={isShowModal} handleCancel={this.handleCancel} title={modalTitle}>
<ZdyTable modalInit={modalInit} key={modalCode} datas={datas} get={get} isChild={true} currentFormKey={modalCode} isEdit={isEdit} obj={obj} init={init} form={this.props.form} mapData={mapData} sqlData={sqlData} {...datas[modalCode]} defaultValues={defaultValues} />
</FormModal>:""}
<Form.Item <Form.Item
labelCol={{ span: json.labelSpan }} labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }} wrapperCol={{ span: json.wrapperSpan }}
label={title} label={title}
> >
{cm} {cm}
</Form.Item> </Form.Item></>
) )
} }
} else { } else {
return <>{modalCode?<FormModal visible={isShowModal} handleCancel={this.handleCancel} title={modalTitle}>
return cm <ZdyTable modalInit={modalInit} key={modalCode} datas={datas} get={get} isChild={true} currentFormKey={modalCode} isEdit={isEdit} obj={obj} init={init} form={this.props.form} mapData={mapData} sqlData={sqlData} {...datas[modalCode]} defaultValues={defaultValues} />
</FormModal>:""}{cm}</>
} }
} else { } else {
return ( return (
<>{modalCode?<FormModal visible={isShowModal} handleCancel={this.handleCancel} title={modalTitle}>
<ZdyTable modalInit={modalInit} key={modalCode} datas={datas} get={get} isChild={true} currentFormKey={modalCode} isEdit={isEdit} obj={obj} init={init} form={this.props.form} mapData={mapData} sqlData={sqlData} {...datas[modalCode]} defaultValues={defaultValues} />
</FormModal>:""}
<Form.Item <Form.Item
> >
{cm} {cm}
</Form.Item> </Form.Item></>
); );
} }
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论