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

Merge remote-tracking branch 'origin/master'

......@@ -13,7 +13,6 @@ import styles from './index.less';
export default function HistoryForm(props) {
const { data, isNewForm } = props;
console.log(data,isNewForm)
return (
<div>
{data.hisTaskForm.formKeys && data.hisTaskForm.formKeys.length > 0
......
......@@ -4,9 +4,12 @@ import Shell from '@/baseComponent/Shell';
import HistoryForm from '@/webPublic/FormInsertDiy/HistoryForm';
import { getHistoryFormDetail } from '../../Services';
import withGoBack from '@/highOrderComponent/withGoBack';
import SubmitButton from '@/webPublic/one_stop_public/AffairButton/SumbitButton';
import { ModalInfo } from '@/baseComponent/Modal';
import { router } from 'umi';
// 查看详情, 传申报数据的code
let DetailPage = ({ form, code }) => {
let DetailPage = ({ form, code, appId }) => {
const [data, setData] = useState(null);
const [loading, setLoading] = useState(false);
......@@ -20,15 +23,27 @@ let DetailPage = ({ form, code }) => {
}
});
}, []);
function submitCb(res) {
ModalInfo(`提交${res ? '成功' : '失败'}!`, { onOk: () => router.goBack() });
}
return (
<Shell styleShell={{ marginTop: 0 }}>
<Spin spinning={loading}>
{data && (
<>
<HistoryForm
data={data} // 'affair/getIdFormDetail' 接口返回数据
form={form} // form控件
isNewForm={data.isSecond??false} // 是否渲染需要当前用户填写的审核表单 为false只会渲染历史回显表单
isNewForm={data.isSecond ?? false} // 是否渲染需要当前用户填写的审核表单 为false只会渲染历史回显表单
/>
{data.isSecond && (
<div style={{ padding: 16, textAlign: 'center' }}>
<SubmitButton form={form} appId={appId} text="提交" callback={submitCb} />
</div>
)}
</>
)}
</Spin>
</Shell>
......
......@@ -400,7 +400,9 @@ export default class ZdyTable extends Component {
case 'web':
return (
<Form {...formItemLayout} className="login-form" >
<Form
{...formItemLayout}
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) {
......@@ -423,9 +425,18 @@ export default class ZdyTable extends Component {
<Row>
<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>
{items.map((row, i) => {
const allhidden = this.checkAllHidden(row)
......@@ -440,15 +451,43 @@ export default class ZdyTable extends Component {
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 ?
""
: <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={{
overflow: "auto",
textAlign: cell.content&&cell.content.calign?cell.content.calign:"left",
...isBorder?(cell.content.comName=="InputHidden"||!cell?.content?.comName?{}:borderStyle):{},
...isBorder?(cell?.content?.comName=="InputHidden"||!cell?.content?.comName?{}:borderStyle):{},
...styles
}} >
<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 || {}} />
<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>}
)
......@@ -493,11 +532,38 @@ export default class ZdyTable extends Component {
{
items.map((item, i) => {
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) => {
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>)
......
......@@ -104,14 +104,23 @@ const CreateForm = Form.create()(props => {
handleAdd(params, isAdd);
});
};
console.log("isView",isView)
//需要获取动态表单
return (
<Modal
width="700px"
maskClosable={false}
destroyOnClose
title={isAdd ? '新增' : '编辑'}
title={isView?"查看详情":(isAdd ? '新增' : '编辑')}
visible={modalVisible}
footer={isView?null:[
<Button key="back" onClick={() => handleModalVisible()}>
取消
</Button>,
<Button key="submit" type="primary" onClick={okHandle}>
确定
</Button>
]}
onOk={okHandle}
onCancel={() => handleModalVisible()}
>
......@@ -872,6 +881,7 @@ class FormList extends React.Component {
} = this.props;
const {
showMobileDiv,
isView
} = this.state
......@@ -890,7 +900,7 @@ class FormList extends React.Component {
formItem: this.state.formItem,
isAdd: this.state.isAdd,
getItem: this.getItem,
isView:isView,
};
......@@ -908,8 +918,6 @@ class FormList extends React.Component {
}
if(this.columns.length>0&&this.columns[this.columns.length-1].title=="操作"){
this.columns[this.columns.length-1]=column;
}else{
this.columns.push(column);
}
}else{
const column = {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论