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

Merge remote-tracking branch 'origin/master'

...@@ -13,7 +13,6 @@ import styles from './index.less'; ...@@ -13,7 +13,6 @@ import styles from './index.less';
export default function HistoryForm(props) { export default function HistoryForm(props) {
const { data, isNewForm } = props; const { data, isNewForm } = props;
console.log(data,isNewForm)
return ( return (
<div> <div>
{data.hisTaskForm.formKeys && data.hisTaskForm.formKeys.length > 0 {data.hisTaskForm.formKeys && data.hisTaskForm.formKeys.length > 0
......
...@@ -4,9 +4,12 @@ import Shell from '@/baseComponent/Shell'; ...@@ -4,9 +4,12 @@ import Shell from '@/baseComponent/Shell';
import HistoryForm from '@/webPublic/FormInsertDiy/HistoryForm'; import HistoryForm from '@/webPublic/FormInsertDiy/HistoryForm';
import { getHistoryFormDetail } from '../../Services'; import { getHistoryFormDetail } from '../../Services';
import withGoBack from '@/highOrderComponent/withGoBack'; import withGoBack from '@/highOrderComponent/withGoBack';
import SubmitButton from '@/webPublic/one_stop_public/AffairButton/SumbitButton';
import { ModalInfo } from '@/baseComponent/Modal';
import { router } from 'umi';
// 查看详情, 传申报数据的code // 查看详情, 传申报数据的code
let DetailPage = ({ form, code }) => { let DetailPage = ({ form, code, appId }) => {
const [data, setData] = useState(null); const [data, setData] = useState(null);
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
...@@ -20,15 +23,27 @@ let DetailPage = ({ form, code }) => { ...@@ -20,15 +23,27 @@ let DetailPage = ({ form, code }) => {
} }
}); });
}, []); }, []);
function submitCb(res) {
ModalInfo(`提交${res ? '成功' : '失败'}!`, { onOk: () => router.goBack() });
}
return ( return (
<Shell styleShell={{ marginTop: 0 }}> <Shell styleShell={{ marginTop: 0 }}>
<Spin spinning={loading}> <Spin spinning={loading}>
{data && ( {data && (
<HistoryForm <>
data={data} // 'affair/getIdFormDetail' 接口返回数据 <HistoryForm
form={form} // form控件 data={data} // 'affair/getIdFormDetail' 接口返回数据
isNewForm={data.isSecond??false} // 是否渲染需要当前用户填写的审核表单 为false只会渲染历史回显表单 form={form} // form控件
/> isNewForm={data.isSecond ?? false} // 是否渲染需要当前用户填写的审核表单 为false只会渲染历史回显表单
/>
{data.isSecond && (
<div style={{ padding: 16, textAlign: 'center' }}>
<SubmitButton form={form} appId={appId} text="提交" callback={submitCb} />
</div>
)}
</>
)} )}
</Spin> </Spin>
</Shell> </Shell>
......
...@@ -400,7 +400,9 @@ export default class ZdyTable extends Component { ...@@ -400,7 +400,9 @@ export default class ZdyTable extends Component {
case 'web': case 'web':
return ( return (
<Form {...formItemLayout} className="login-form" > <Form
{...formItemLayout}
className="login-form" >
{isEdit&&defaultBinds ? Object.keys(defaultBinds).map((k) => { {isEdit&&defaultBinds ? Object.keys(defaultBinds).map((k) => {
const r = defaultBinds[k] const r = defaultBinds[k]
if (r.columnIds == null || r.columnIds.length < 2 || r.sqls == null || r.sqls.length < 2) { if (r.columnIds == null || r.columnIds.length < 2 || r.sqls == null || r.sqls.length < 2) {
...@@ -423,9 +425,18 @@ export default class ZdyTable extends Component { ...@@ -423,9 +425,18 @@ export default class ZdyTable extends Component {
<Row> <Row>
<Col span={24}> <Col span={24}>
<div style={styleDiv} ref={ref => { this.root = ref }} <div
style={styleDiv}
ref={ref => { this.root = ref }}
> >
<table style={{ overflow: "auto", margin: max * width > 550 ? "auto" : '',...style }} border={border} cellSpacing="0" cellPadding="0" > <table
style={{
overflow: "auto",
margin: max * width > 550 ? "auto" : '',
...style }}
border={border}
cellSpacing="0"
cellPadding="0" >
<tbody> <tbody>
{items.map((row, i) => { {items.map((row, i) => {
const allhidden = this.checkAllHidden(row) const allhidden = this.checkAllHidden(row)
...@@ -440,15 +451,43 @@ export default class ZdyTable extends Component { ...@@ -440,15 +451,43 @@ export default class ZdyTable extends Component {
console.log(`第${i}行第${j}列样式配置有误,${e}`) console.log(`第${i}行第${j}列样式配置有误,${e}`)
} }
} }
return !allhidden && cell.hidden ? "" : <td width={i==0?((cell.content!=null&&cell.content.cwidth!=null?cell.content.cwidth:width) * (cell.col ? cell.col : 1)) :width * (cell.col ? cell.col : 1)} rowSpan={cell.row} colSpan={cell.col} key={j} style={{ return !allhidden && cell.hidden ?
overflow: "auto", ""
textAlign: cell.content&&cell.content.calign?cell.content.calign:"left", : <td
...isBorder?(cell.content.comName=="InputHidden"||!cell?.content?.comName?{}:borderStyle):{}, width={
i==0?
...styles ((cell.content!=null&&cell.content.cwidth!=null?cell.content.cwidth:width) * (cell.col ? cell.col : 1))
}} > :width * (cell.col ? cell.col : 1)}
rowSpan={cell.row}
<TableCom formCode={formCode} formId={formId} i={i} j={j} fatherCode={fatherCode} index={index} datas={datas} uuid={cell.uuid} isEdit={isEdit} formKey={currentFormKey} init={init} get={get} json={cell.content} obj={ obj||{}} mapData={mapData} form={this.props.form} sqlData={sqlData} defaultValues={defaultValues || {}} /> colSpan={cell.col}
key={j}
style={{
overflow: "auto",
textAlign: cell.content&&cell.content.calign?cell.content.calign:"left",
...isBorder?(cell?.content?.comName=="InputHidden"||!cell?.content?.comName?{}:borderStyle):{},
...styles
}} >
<TableCom
formCode={formCode} // 当前表单code
formId={formId} // 当前表单Id
i={i} // 当前组件下标
j={j} // 当前行数下班
fatherCode={fatherCode}
index={index}
datas={datas}
uuid={cell.uuid}
isEdit={isEdit}
formKey={currentFormKey}
init={init}
get={get} // 区分移动端或wen端
json={cell.content}
obj={ obj||{}} // 是否存在默认值
mapData={mapData}
form={this.props.form} // antd form控件
sqlData={sqlData}
defaultValues={defaultValues || {}} // 接口中的默认值
/>
</td>} </td>}
) )
...@@ -493,11 +532,38 @@ export default class ZdyTable extends Component { ...@@ -493,11 +532,38 @@ export default class ZdyTable extends Component {
{ {
items.map((item, i) => { items.map((item, i) => {
const allhidden = this.checkAllHidden(items) const allhidden = this.checkAllHidden(items)
return (<div key={i} style={{ marginTop: 0, background: '#ffffff', paddingLeft:12, width: '100%',flexWrap:'wrap',...style }}> return (<div
key={i}
style={{
marginTop: 0,
background: '#ffffff',
paddingLeft:12,
width: '100%',
flexWrap:'wrap',
...style }}>
{ {
item.map((ary, j) => { item.map((ary, j) => {
return !allhidden && ary.hidden ? "" return !allhidden && ary.hidden ? ""
: <><TableCom formCode={formCode} formId={formId} i={i} j={j} index={index} fatherCode={fatherCode} datas={datas} isEdit={isEdit} formKey={currentFormKey} init={init} get={get} key={j} sqlData={sqlData} obj={ obj||{}} form={this.props.form} mapData={mapData} json={ary.content} uuid={ary.uuid} defaultValues={defaultValues || {}} /></> : <><TableCom
formCode={formCode}
formId={formId}
i={i}
j={j}
index={index}
fatherCode={fatherCode}
datas={datas}
isEdit={isEdit}
formKey={currentFormKey}
init={init}
get={get}
key={j}
sqlData={sqlData}
obj={ obj||{}}
form={this.props.form}
mapData={mapData}
json={ary.content}
uuid={ary.uuid}
defaultValues={defaultValues || {}} /></>
}) })
} }
</div>) </div>)
......
...@@ -104,14 +104,23 @@ const CreateForm = Form.create()(props => { ...@@ -104,14 +104,23 @@ const CreateForm = Form.create()(props => {
handleAdd(params, isAdd); handleAdd(params, isAdd);
}); });
}; };
console.log("isView",isView)
//需要获取动态表单 //需要获取动态表单
return ( return (
<Modal <Modal
width="700px" width="700px"
maskClosable={false} maskClosable={false}
destroyOnClose destroyOnClose
title={isAdd ? '新增' : '编辑'} title={isView?"查看详情":(isAdd ? '新增' : '编辑')}
visible={modalVisible} visible={modalVisible}
footer={isView?null:[
<Button key="back" onClick={() => handleModalVisible()}>
取消
</Button>,
<Button key="submit" type="primary" onClick={okHandle}>
确定
</Button>
]}
onOk={okHandle} onOk={okHandle}
onCancel={() => handleModalVisible()} onCancel={() => handleModalVisible()}
> >
...@@ -872,6 +881,7 @@ class FormList extends React.Component { ...@@ -872,6 +881,7 @@ class FormList extends React.Component {
} = this.props; } = this.props;
const { const {
showMobileDiv, showMobileDiv,
isView
} = this.state } = this.state
...@@ -890,7 +900,7 @@ class FormList extends React.Component { ...@@ -890,7 +900,7 @@ class FormList extends React.Component {
formItem: this.state.formItem, formItem: this.state.formItem,
isAdd: this.state.isAdd, isAdd: this.state.isAdd,
getItem: this.getItem, getItem: this.getItem,
isView:isView,
}; };
...@@ -908,8 +918,6 @@ class FormList extends React.Component { ...@@ -908,8 +918,6 @@ class FormList extends React.Component {
} }
if(this.columns.length>0&&this.columns[this.columns.length-1].title=="操作"){ if(this.columns.length>0&&this.columns[this.columns.length-1].title=="操作"){
this.columns[this.columns.length-1]=column; this.columns[this.columns.length-1]=column;
}else{
this.columns.push(column);
} }
}else{ }else{
const column = { const column = {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论