提交 a951c1f3 authored 作者: wanyielin's avatar wanyielin

上传判断

上级 cc906839
......@@ -10,6 +10,8 @@ import TableCom from '../tableCompon'
import { Toast } from 'antd-mobile'
import router from 'umi/router'
import IsNewTable from './isNewTable';
import maintain from '@/assets/maintain.png'
import moment from 'moment'
export default class ZdyTable extends Component {
constructor(props) {
super(props)
......@@ -36,7 +38,7 @@ export default class ZdyTable extends Component {
}
}
componentDidMount(){
componentDidMount() {
let {
postData, // 数据源
isCg, // 用户点击草稿页面进入
......@@ -357,8 +359,30 @@ export default class ZdyTable extends Component {
}
render() {
let { width, isBorder, sqlData, mapData, defaultBinds, defaultValues, items, init, currentFormKey, isEdit, datas, isReady, formConfig, formCode, formId } = this.state
let { border, get, obj, index, fatherCode,routerState } = this.props
let { width,
isBorder,
sqlData,
mapData,
defaultBinds,
defaultValues,
items,
init,
currentFormKey,
isEdit,
datas,
isReady,
formConfig,
formCode,
formId
} = this.state
let { border,
get,
obj,
index,
fatherCode,
routerState,
postData,
} = this.props
let style = {}
if (formConfig.style != null) {
try {
......@@ -381,17 +405,42 @@ export default class ZdyTable extends Component {
};
const max = this.countMax(items)
const borderStyle = {
borderRight: "1px solid gray", borderTop: "1px solid gray", borderLeft: "1px solid gray", borderBottom: "1px solid gray"
borderRight: "1px solid gray",
borderTop: "1px solid gray",
borderLeft: "1px solid gray",
borderBottom: "1px solid gray"
}
const borderStyleTwo = { // 处理隐藏组件边框样式问题
borderRight: "1px solid gray", borderLeft: "1px solid gray"
}
let updateTime
const styleDiv = this.props.height ? { overflow: "auto", width: "100%", height: this.props.height } : { overflow: "auto", width: "100%" }
if (!isReady) return <></>
if (this.props.postData?.isUpdate) {
updateTime = moment(+this.props.postData?.updateTime).format('llll')
}
switch (get) {
case 'web':
return (
return (<>
{this.props.postData?.isUpdate ?
<div style={{ margin: '100px 24px 24px' }}>
<div style={{ textAlign: 'center' }}>
<img style={{ marginRight: 30 }} src={maintain}></img>
</div>
<p style={{
textAlign: "center",
width: '100%',
fontSize: '16px',
fontWeight: 'bold',
color: '#666666',
}}
>
{updateTime !== 'Invalid date' ?
`升级维护中,预计${updateTime ?? '一万年'}恢复使用,请耐心等待。` :
'请耐心等待'}
</p>
</div>
:
<Form
className="login-form" >
{isEdit && defaultBinds ? Object.keys(defaultBinds).map((k) => {
......@@ -500,10 +549,30 @@ export default class ZdyTable extends Component {
</Col>
</Row>
</Form>
</Form>}
</>
)
case 'mobile':
return (
return (<>
{this.props.postData?.isUpdate ?
<div style={{ margin: '100px 24px 24px' }}>
<div style={{ textAlign: 'center' }}>
<img style={{ width: '100%' }} src={maintain}></img>
</div>
<p style={{
textAlign: "center",
width: '100%',
fontSize: '16px',
fontWeight: 'bold',
color: '#666666',
}}
>
{updateTime !== 'Invalid date' ?
`升级维护中,预计${updateTime ?? '一万年'}恢复使用,请耐心等待。` :
'请耐心等待'}
</p>
</div>
:
<Form {...formItemLayout} id='mobile_table' className="login-form">
{defaultBinds ? Object.keys(defaultBinds).map((k) => {
const r = defaultBinds[k]
......@@ -567,7 +636,8 @@ export default class ZdyTable extends Component {
</div>)
})
}
</Form>
</Form>}
</>
)
}
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论