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

28131 2.0选项卡组件搬到1.0来

上级 66222046
...@@ -13,16 +13,16 @@ export default class ChildForm extends React.Component { ...@@ -13,16 +13,16 @@ export default class ChildForm extends React.Component {
this.state = value; this.state = value;
} }
triggerChange = (changedValue) => { triggerChange = changedValue => {
// Should provide an event to pass value to Form. // Should provide an event to pass value to Form.
const onChange = this.props.onChange; const onChange = this.props.onChange;
console.log('ChildForm', changedValue); console.log('ChildForm', changedValue);
if (onChange) { if (onChange) {
if(changedValue && typeof changedValue === 'object' && !Object.keys(changedValue).length){ if (changedValue && typeof changedValue === 'object' && !Object.keys(changedValue).length) {
onChange(changedValue); onChange(changedValue);
// onChange(null); // onChange(null);
}else{ } else {
onChange(changedValue); onChange(changedValue);
} }
} }
...@@ -57,7 +57,7 @@ export default class ChildForm extends React.Component { ...@@ -57,7 +57,7 @@ export default class ChildForm extends React.Component {
} }
} }
}; };
delete = (uuid) => { delete = uuid => {
const objs = this.state; const objs = this.state;
const { const {
json: { numCode }, json: { numCode },
...@@ -139,7 +139,7 @@ export default class ChildForm extends React.Component { ...@@ -139,7 +139,7 @@ export default class ChildForm extends React.Component {
return <div>还没有配置子表单key</div>; return <div>还没有配置子表单key</div>;
} }
if(!objs){ if (!objs) {
return null; return null;
} }
...@@ -149,7 +149,7 @@ export default class ChildForm extends React.Component { ...@@ -149,7 +149,7 @@ export default class ChildForm extends React.Component {
{Object.keys(objs).length > 1 || rights.includes('add') ? ( {Object.keys(objs).length > 1 || rights.includes('add') ? (
<Card> <Card>
<Card.Body style={{ minHeight: 10 }}> <Card.Body style={{ minHeight: 10 }}>
{Object.keys(objs).map((r) => { {Object.keys(objs).map(r => {
if (r == '') { if (r == '') {
return ''; return '';
} }
...@@ -159,7 +159,8 @@ export default class ChildForm extends React.Component { ...@@ -159,7 +159,8 @@ export default class ChildForm extends React.Component {
style={{ style={{
zIndex: 55, zIndex: 55,
}} }}
span={isEdit ? 24 : span}> span={isEdit ? 24 : span}
>
<ZdyTable <ZdyTable
changedValues={this.props.changedValues} changedValues={this.props.changedValues}
setRealTimeValues={this.props.setRealTimeValues} setRealTimeValues={this.props.setRealTimeValues}
...@@ -171,7 +172,6 @@ export default class ChildForm extends React.Component { ...@@ -171,7 +172,6 @@ export default class ChildForm extends React.Component {
currentFormTitle={ currentFormTitle={
getCurrentFormTitle ? getCurrentFormTitle(json.childFormKey) : null getCurrentFormTitle ? getCurrentFormTitle(json.childFormKey) : null
} }
hfInstance={hfInstance}
getCellValue={getCellValue} getCellValue={getCellValue}
formCode={this.props.formCode} formCode={this.props.formCode}
formId={this.props.formId} formId={this.props.formId}
...@@ -214,7 +214,8 @@ export default class ChildForm extends React.Component { ...@@ -214,7 +214,8 @@ export default class ChildForm extends React.Component {
type="primary" type="primary"
size="small" size="small"
style={{ margin: 'auto' }} style={{ margin: 'auto' }}
onClick={this.add}> onClick={this.add}
>
{addName || '新增'} {addName || '新增'}
</Button>{' '} </Button>{' '}
</Col> </Col>
...@@ -237,7 +238,7 @@ export default class ChildForm extends React.Component { ...@@ -237,7 +238,7 @@ export default class ChildForm extends React.Component {
return ( return (
<div style={{ width: '100%' }}> <div style={{ width: '100%' }}>
<Row gutter={gutter}> <Row gutter={gutter}>
{Object.keys(objs).map((r) => { {Object.keys(objs).map(r => {
if (r == '') { if (r == '') {
return ''; return '';
} }
...@@ -292,7 +293,8 @@ export default class ChildForm extends React.Component { ...@@ -292,7 +293,8 @@ export default class ChildForm extends React.Component {
lineHeight: '10px', lineHeight: '10px',
}} }}
type="danger" type="danger"
onClick={this.delete.bind(this, r)}> onClick={this.delete.bind(this, r)}
>
{deleteName || '-'} {deleteName || '-'}
</Button> </Button>
) : ( ) : (
......
...@@ -23,6 +23,7 @@ import { ...@@ -23,6 +23,7 @@ import {
Select, Select,
Switch, Switch,
Table, Table,
Tabs,
} from 'antd'; } from 'antd';
import UUID from 'react-native-uuid'; import UUID from 'react-native-uuid';
import QRCode from 'qrcode.react'; import QRCode from 'qrcode.react';
...@@ -86,7 +87,7 @@ import getPopupContainer ...@@ -86,7 +87,7 @@ import getPopupContainer
const { const {
MonthPicker, MonthPicker,
WeekPicker WeekPicker,
} = DatePicker; } = DatePicker;
/** /**
* 日期组件antd3.x有bug 详情见禅道 27152 毕业跟踪调查管理 毕业时间改为年级筛选 * 日期组件antd3.x有bug 详情见禅道 27152 毕业跟踪调查管理 毕业时间改为年级筛选
...@@ -94,6 +95,7 @@ const { ...@@ -94,6 +95,7 @@ const {
const { TextArea } = Input; const { TextArea } = Input;
const { Option } = Select; const { Option } = Select;
const { RangePicker } = DatePicker; const { RangePicker } = DatePicker;
const { TabPane } = Tabs;
const giveRender = (column = {}) => { const giveRender = (column = {}) => {
if (!column?.render) { if (!column?.render) {
...@@ -112,7 +114,7 @@ const giveRender = (column = {}) => { ...@@ -112,7 +114,7 @@ const giveRender = (column = {}) => {
DataColumn, DataColumn,
SqlManageEntity, SqlManageEntity,
formList, formList,
loading loading,
}) => ({ }) => ({
DataColumn, DataColumn,
SqlManageEntity, SqlManageEntity,
...@@ -159,6 +161,14 @@ export default class TableCom extends Component { ...@@ -159,6 +161,14 @@ export default class TableCom extends Component {
callback: callback, callback: callback,
}); });
}; };
changeTabsActiveKey = (activeKey) => {
this.setState({
activeKey,
});
};
showModal = (fk, title, data, modalProps) => { showModal = (fk, title, data, modalProps) => {
// console.log(fk, title, data, modalProps); // console.log(fk, title, data, modalProps);
...@@ -223,7 +233,7 @@ export default class TableCom extends Component { ...@@ -223,7 +233,7 @@ export default class TableCom extends Component {
setSelectedKeys, setSelectedKeys,
selectedKeys, selectedKeys,
confirm, confirm,
clearFilters clearFilters,
}) => ( }) => (
<div style={{ padding: 8 }}> <div style={{ padding: 8 }}>
<Input <Input
...@@ -241,11 +251,11 @@ export default class TableCom extends Component { ...@@ -241,11 +251,11 @@ export default class TableCom extends Component {
}} }}
/> />
<Button <Button
type="primary" type='primary'
onClick={() => this.handleSearch(selectedKeys, confirm)} onClick={() => this.handleSearch(selectedKeys, confirm)}
icon="search" icon='search'
loading={this.props.loading} loading={this.props.loading}
size="small" size='small'
style={{ style={{
width: 90, width: 90,
marginRight: 8, marginRight: 8,
...@@ -256,14 +266,14 @@ export default class TableCom extends Component { ...@@ -256,14 +266,14 @@ export default class TableCom extends Component {
<Button <Button
loading={this.props.loading} loading={this.props.loading}
onClick={() => this.handleReset(clearFilters)} onClick={() => this.handleReset(clearFilters)}
size="small" size='small'
style={{ width: 90 }} style={{ width: 90 }}
> >
重置 重置
</Button> </Button>
</div> </div>
), ),
filterIcon: filtered => <Icon type="search" style={{ color: filtered ? '#1890ff' : 'red' }}/>, filterIcon: filtered => <Icon type='search' style={{ color: filtered ? '#1890ff' : 'red' }} />,
onFilter: (value, record) => onFilter: (value, record) =>
record[dataIndex] record[dataIndex]
? record[dataIndex] ? record[dataIndex]
...@@ -314,7 +324,7 @@ export default class TableCom extends Component { ...@@ -314,7 +324,7 @@ export default class TableCom extends Component {
const { const {
json, json,
mapData, mapData,
obj obj,
} = props; } = props;
if (json == null || this.props.safe) { if (json == null || this.props.safe) {
return; return;
...@@ -430,7 +440,7 @@ export default class TableCom extends Component { ...@@ -430,7 +440,7 @@ export default class TableCom extends Component {
getData = (json, dataColumn, obj, init) => { getData = (json, dataColumn, obj, init) => {
const { const {
formKey, formKey,
uuid uuid,
} = this.props; } = this.props;
let jsonStatic = json; let jsonStatic = json;
json = { json = {
...@@ -444,7 +454,7 @@ export default class TableCom extends Component { ...@@ -444,7 +454,7 @@ export default class TableCom extends Component {
const { dispatch } = this.props; const { dispatch } = this.props;
const { const {
sqlKey, sqlKey,
optionType optionType,
} = json; } = json;
if (optionType === 'sql') { if (optionType === 'sql') {
dispatch({ dispatch({
...@@ -755,7 +765,7 @@ export default class TableCom extends Component { ...@@ -755,7 +765,7 @@ export default class TableCom extends Component {
); );
//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)
} }
} else if (['Echart', 'QRCode', 'Graph'].includes(json.comName)) { } else if (['Echart', 'QRCode', 'Graph', 'Tabs'].includes(json.comName)) {
try { try {
const x = callback(data); const x = callback(data);
if (x != null) { if (x != null) {
...@@ -831,7 +841,7 @@ export default class TableCom extends Component { ...@@ -831,7 +841,7 @@ export default class TableCom extends Component {
e, e,
); );
} }
} else if (['Echart', 'QRCode', 'Graph'].includes(json.comName)) { } else if (['Echart', 'QRCode', 'Graph', 'Tabs'].includes(json.comName)) {
try { try {
const x = callback(data); const x = callback(data);
if (x != null) { if (x != null) {
...@@ -944,7 +954,7 @@ export default class TableCom extends Component { ...@@ -944,7 +954,7 @@ export default class TableCom extends Component {
e, e,
); );
} }
} else if (['Echart', 'QRCode', 'Graph'].includes(json.comName)) { } else if (['Echart', 'QRCode', 'Graph', 'Tabs'].includes(json.comName)) {
try { try {
const x = callback(data); const x = callback(data);
if (x != null) { if (x != null) {
...@@ -1029,11 +1039,7 @@ export default class TableCom extends Component { ...@@ -1029,11 +1039,7 @@ export default class TableCom extends Component {
e, e,
); );
} }
} else if ( } else if (['Echart', 'QRCode', 'Graph', 'Tabs'].includes(json.comName)) {
json.comName == 'Echart' ||
json.comName == 'QRCode' ||
json.comName == 'Graph'
) {
try { try {
const x = callback(data); const x = callback(data);
if (x != null) { if (x != null) {
...@@ -1172,7 +1178,7 @@ export default class TableCom extends Component { ...@@ -1172,7 +1178,7 @@ export default class TableCom extends Component {
concealModel, concealModel,
}; };
} };
getFunctionValue = (fun, column, json, callback) => { getFunctionValue = (fun, column, json, callback) => {
if (this.props.safe) return; if (this.props.safe) return;
...@@ -1245,7 +1251,7 @@ export default class TableCom extends Component { ...@@ -1245,7 +1251,7 @@ export default class TableCom extends Component {
}, },
); );
} }
} else if (['Echart', 'QRCode', 'Graph'].includes(json.comName)) { } else if (['Echart', 'QRCode', 'Graph', 'Tabs'].includes(json.comName)) {
this.setState({ option: value }); this.setState({ option: value });
} else { } else {
try { try {
...@@ -1274,7 +1280,7 @@ export default class TableCom extends Component { ...@@ -1274,7 +1280,7 @@ export default class TableCom extends Component {
json, json,
mapData, mapData,
obj, obj,
init init,
} = this.props; } = this.props;
if (json == null) { if (json == null) {
return; return;
...@@ -1325,7 +1331,7 @@ export default class TableCom extends Component { ...@@ -1325,7 +1331,7 @@ export default class TableCom extends Component {
labelName, labelName,
valueName, valueName,
isMeta, isMeta,
filterSql filterSql,
} = json; } = json;
if (isMeta) { if (isMeta) {
// 2022年7月5日 2022 姚鑫国说的 如果是元数据 不需要传这个allValues // 2022年7月5日 2022 姚鑫国说的 如果是元数据 不需要传这个allValues
...@@ -1568,7 +1574,7 @@ export default class TableCom extends Component { ...@@ -1568,7 +1574,7 @@ export default class TableCom extends Component {
getColumn = key => { getColumn = key => {
let { let {
mapData, mapData,
json json,
} = this.props; } = this.props;
const columnIds = json?.columnIds; const columnIds = json?.columnIds;
...@@ -1632,12 +1638,12 @@ export default class TableCom extends Component { ...@@ -1632,12 +1638,12 @@ export default class TableCom extends Component {
modalCode, modalCode,
modalTitle, modalTitle,
modalInit, modalInit,
modalProps modalProps,
} = this.state; } = this.state;
const { const {
getFieldDecorator, getFieldDecorator,
getFieldError, getFieldError,
getFieldProps getFieldProps,
} = this.props.form; } = this.props.form;
const disabled = json != null ? json.disabled : false; const disabled = json != null ? json.disabled : false;
const permRank = json != null ? (json.permRank != null ? json.permRank : 0) : 0; const permRank = json != null ? (json.permRank != null ? json.permRank : 0) : 0;
...@@ -1661,7 +1667,7 @@ export default class TableCom extends Component { ...@@ -1661,7 +1667,7 @@ export default class TableCom extends Component {
) { ) {
return <></>; return <></>;
} }
return <QRCode {...this.state.option} key={uuid}/>; return <QRCode {...this.state.option} key={uuid} />;
} }
if (json.comName == 'Echart') { if (json.comName == 'Echart') {
return ( return (
...@@ -1677,7 +1683,7 @@ export default class TableCom extends Component { ...@@ -1677,7 +1683,7 @@ export default class TableCom extends Component {
); );
} }
if (json.comName == 'Graph') { if (json.comName == 'Graph') {
return <Neo4jD3Com key={uuid} json={json} option={this.state.option || []}/>; return <Neo4jD3Com key={uuid} json={json} option={this.state.option || []} />;
} }
if (json.comName == 'PartForm') { if (json.comName == 'PartForm') {
...@@ -1692,7 +1698,7 @@ export default class TableCom extends Component { ...@@ -1692,7 +1698,7 @@ export default class TableCom extends Component {
<> <>
{this.props.form.getFieldDecorator(uuid, { {this.props.form.getFieldDecorator(uuid, {
initialValue: fk, initialValue: fk,
})(<Input type="hidden"/>)}{' '} })(<Input type='hidden' />)}{' '}
<ZdyTable <ZdyTable
taskId={this.props.taskId} taskId={this.props.taskId}
importExcel={this.props.importExcel} importExcel={this.props.importExcel}
...@@ -1768,7 +1774,7 @@ export default class TableCom extends Component { ...@@ -1768,7 +1774,7 @@ export default class TableCom extends Component {
<> <>
{this.props.form.getFieldDecorator(uid, { {this.props.form.getFieldDecorator(uid, {
initialValue: obj[uuid] || json.initialValue, initialValue: obj[uuid] || json.initialValue,
})(<Input type="hidden"/>)} })(<Input type='hidden' />)}
<span <span
style={{ style={{
fontWeight: get === 'mobile' ? 'bold' : '', fontWeight: get === 'mobile' ? 'bold' : '',
...@@ -1785,7 +1791,7 @@ export default class TableCom extends Component { ...@@ -1785,7 +1791,7 @@ export default class TableCom extends Component {
<> <>
{this.props.form.getFieldDecorator(uid, { {this.props.form.getFieldDecorator(uid, {
initialValue: this.props.form.getFieldsValue()[uid] || json.initialValue, initialValue: this.props.form.getFieldsValue()[uid] || json.initialValue,
})(<Input type="hidden"/>)} })(<Input type='hidden' />)}
<span <span
style={{ style={{
fontWeight: get === 'mobile' ? 'bold' : '', fontWeight: get === 'mobile' ? 'bold' : '',
...@@ -1834,7 +1840,7 @@ export default class TableCom extends Component { ...@@ -1834,7 +1840,7 @@ export default class TableCom extends Component {
cm = ( cm = (
<span style={{ paddingRight: get === 'mobile' ? 8 : '' }}> <span style={{ paddingRight: get === 'mobile' ? 8 : '' }}>
{value} {value}
{get === 'mobile' ? <br/> : ''} {get === 'mobile' ? <br /> : ''}
</span> </span>
); );
break; break;
...@@ -1842,7 +1848,7 @@ export default class TableCom extends Component { ...@@ -1842,7 +1848,7 @@ export default class TableCom extends Component {
cm = ( cm = (
<span> <span>
{value} {value}
{get === 'mobile' ? <br/> : ''} {get === 'mobile' ? <br /> : ''}
</span> </span>
); );
...@@ -1860,7 +1866,7 @@ export default class TableCom extends Component { ...@@ -1860,7 +1866,7 @@ export default class TableCom extends Component {
cm = ( cm = (
<span style={{ paddingRight: get == 'mobile' ? 8 : '' }}> <span style={{ paddingRight: get == 'mobile' ? 8 : '' }}>
{value} {value}
{get === 'mobile' ? <br/> : ''} {get === 'mobile' ? <br /> : ''}
</span> </span>
); );
...@@ -1869,7 +1875,7 @@ export default class TableCom extends Component { ...@@ -1869,7 +1875,7 @@ export default class TableCom extends Component {
cm = ( cm = (
<span> <span>
{value} {value}
{get === 'mobile' ? <br/> : ''} {get === 'mobile' ? <br /> : ''}
</span> </span>
); );
...@@ -1879,7 +1885,7 @@ export default class TableCom extends Component { ...@@ -1879,7 +1885,7 @@ export default class TableCom extends Component {
<span> <span>
{moment(parseInt(value)) {moment(parseInt(value))
.format('YYYY-MM-DD HH:mm:ss')} .format('YYYY-MM-DD HH:mm:ss')}
{get === 'mobile' ? <br/> : ''} {get === 'mobile' ? <br /> : ''}
</span> </span>
) : ( ) : (
'' ''
...@@ -1894,14 +1900,14 @@ export default class TableCom extends Component { ...@@ -1894,14 +1900,14 @@ export default class TableCom extends Component {
{filesX.map((f, index2) => { {filesX.map((f, index2) => {
return ( return (
<li key={index2}> <li key={index2}>
<a target="_blank" key={f.path} href={queryFileUrl(f.path)}> <a target='_blank' key={f.path} href={queryFileUrl(f.path)}>
{f.name} {f.name}
</a> </a>
</li> </li>
); );
})} })}
</ul> </ul>
{get === 'mobile' ? <br/> : ''} {get === 'mobile' ? <br /> : ''}
</> </>
); );
...@@ -1914,14 +1920,14 @@ export default class TableCom extends Component { ...@@ -1914,14 +1920,14 @@ export default class TableCom extends Component {
{files.map((f, index2) => { {files.map((f, index2) => {
return ( return (
<li key={index2}> <li key={index2}>
<a target="_blank" key={f.path} href={queryFileUrl(f.path)}> <a target='_blank' key={f.path} href={queryFileUrl(f.path)}>
{f.name} {f.name}
</a> </a>
</li> </li>
); );
})} })}
</ul> </ul>
{get === 'mobile' ? <br/> : ''} {get === 'mobile' ? <br /> : ''}
</> </>
); );
...@@ -1946,7 +1952,7 @@ export default class TableCom extends Component { ...@@ -1946,7 +1952,7 @@ export default class TableCom extends Component {
height: json.height, height: json.height,
}} }}
/> />
{get === 'mobile' ? <br/> : ''} {get === 'mobile' ? <br /> : ''}
</> </>
); );
} }
...@@ -1972,7 +1978,7 @@ export default class TableCom extends Component { ...@@ -1972,7 +1978,7 @@ export default class TableCom extends Component {
height: json.height, height: json.height,
}} }}
/> />
{get === 'mobile' ? <br/> : ''} {get === 'mobile' ? <br /> : ''}
</> </>
); );
} }
...@@ -2007,7 +2013,7 @@ export default class TableCom extends Component { ...@@ -2007,7 +2013,7 @@ export default class TableCom extends Component {
</MobileItem> </MobileItem>
{this.props.form.getFieldDecorator(`defaultValues.${formKey}.${key}`, { {this.props.form.getFieldDecorator(`defaultValues.${formKey}.${key}`, {
initialValue: value, initialValue: value,
})(<Input type="hidden"/>)} })(<Input type='hidden' />)}
</> </>
); );
} }
...@@ -2020,7 +2026,7 @@ export default class TableCom extends Component { ...@@ -2020,7 +2026,7 @@ export default class TableCom extends Component {
{cm} {cm}
{this.props.form.getFieldDecorator(`defaultValues.${formKey}.${key}`, { {this.props.form.getFieldDecorator(`defaultValues.${formKey}.${key}`, {
initialValue: value, initialValue: value,
})(<Input type="hidden"/>)} })(<Input type='hidden' />)}
</> </>
); );
} }
...@@ -2114,7 +2120,7 @@ export default class TableCom extends Component { ...@@ -2114,7 +2120,7 @@ export default class TableCom extends Component {
</Form.Item> </Form.Item>
{this.props.form.getFieldDecorator(`defaultValues.${formKey}.${key}`, { {this.props.form.getFieldDecorator(`defaultValues.${formKey}.${key}`, {
initialValue: value, initialValue: value,
})(<Input type="hidden"/>)} })(<Input type='hidden' />)}
</> </>
); );
} }
...@@ -2127,7 +2133,7 @@ export default class TableCom extends Component { ...@@ -2127,7 +2133,7 @@ export default class TableCom extends Component {
{cm} {cm}
{this.props.form.getFieldDecorator(`defaultValues.${formKey}.${key}`, { {this.props.form.getFieldDecorator(`defaultValues.${formKey}.${key}`, {
initialValue: value, initialValue: value,
})(<Input type="hidden"/>)} })(<Input type='hidden' />)}
</> </>
); );
} }
...@@ -2206,7 +2212,7 @@ export default class TableCom extends Component { ...@@ -2206,7 +2212,7 @@ export default class TableCom extends Component {
case 'MobileCard': case 'MobileCard':
let value = obj[dataColumn.base52]; let value = obj[dataColumn.base52];
if (!value || value === 'null') { if (!value || value === 'null') {
return <div/>; return <div />;
} }
cm = <MobileCard value={value} cm = <MobileCard value={value}
json={json} json={json}
...@@ -2218,7 +2224,7 @@ export default class TableCom extends Component { ...@@ -2218,7 +2224,7 @@ export default class TableCom extends Component {
case 'WangEditor': case 'WangEditor':
let textV = obj[dataColumn.base52]; let textV = obj[dataColumn.base52];
if (!textV || textV === 'null') { if (!textV || textV === 'null') {
return <div/>; return <div />;
} }
cm = ( cm = (
<div <div
...@@ -2322,7 +2328,7 @@ ${obj[dataColumn.base52]} ...@@ -2322,7 +2328,7 @@ ${obj[dataColumn.base52]}
<Table <Table
get={get} get={get}
columns={this.state.columns} columns={this.state.columns}
size="small" size='small'
dataSource={ds} dataSource={ds}
pagination={false} pagination={false}
/> />
...@@ -2493,7 +2499,7 @@ ${obj[dataColumn.base52]} ...@@ -2493,7 +2499,7 @@ ${obj[dataColumn.base52]}
} }
return ( return (
<li key={index2}> <li key={index2}>
<a target="_blank" key={f.path} href={queryFileUrl(f.path)}> <a target='_blank' key={f.path} href={queryFileUrl(f.path)}>
{f.name} {f.name}
</a> </a>
</li> </li>
...@@ -2520,7 +2526,7 @@ ${obj[dataColumn.base52]} ...@@ -2520,7 +2526,7 @@ ${obj[dataColumn.base52]}
} }
return ( return (
<li key={index2}> <li key={index2}>
<a target="_blank" key={f.filePath} href={queryFileUrl(f.filePath)}> <a target='_blank' key={f.filePath} href={queryFileUrl(f.filePath)}>
{f.fileName} {f.fileName}
</a> </a>
</li> </li>
...@@ -2691,7 +2697,7 @@ ${obj[dataColumn.base52]} ...@@ -2691,7 +2697,7 @@ ${obj[dataColumn.base52]}
if (json.isLink) { if (json.isLink) {
cm = <a {...ev} />; cm = <a {...ev} />;
} else { } else {
cm = <ButtonDiy loading={this.props.loading} type="primary" {...ev} />; cm = <ButtonDiy loading={this.props.loading} type='primary' {...ev} />;
} }
} }
...@@ -2774,7 +2780,7 @@ ${obj[dataColumn.base52]} ...@@ -2774,7 +2780,7 @@ ${obj[dataColumn.base52]}
if (json.isLink) { if (json.isLink) {
cm = <a {...ev} />; cm = <a {...ev} />;
} else { } else {
cm = <ButtonDiy loading={this.props.loading} type="primary" {...ev} />; cm = <ButtonDiy loading={this.props.loading} type='primary' {...ev} />;
} }
} }
...@@ -2836,7 +2842,7 @@ ${obj[dataColumn.base52]} ...@@ -2836,7 +2842,7 @@ ${obj[dataColumn.base52]}
message: '请选择' + title, message: '请选择' + title,
}, },
], ],
})(<SwitchWeb json={json} disabled={disabled}/>); })(<SwitchWeb json={json} disabled={disabled} />);
break; break;
case 'TextArea': case 'TextArea':
...@@ -2917,7 +2923,7 @@ ${obj[dataColumn.base52]} ...@@ -2917,7 +2923,7 @@ ${obj[dataColumn.base52]}
} }
const { const {
disabledInputStyle = {}, disabledInputStyle = {},
addonAfter addonAfter,
} = otherProps; } = otherProps;
let inputStyle = { let inputStyle = {
width: json.width, width: json.width,
...@@ -2968,7 +2974,7 @@ ${obj[dataColumn.base52]} ...@@ -2968,7 +2974,7 @@ ${obj[dataColumn.base52]}
case 'InputHidden': case 'InputHidden':
cm = getFieldDecorator(dataColumn.base52, { cm = getFieldDecorator(dataColumn.base52, {
initialValue: initValue, initialValue: initValue,
})(<Input type="hidden"/>); })(<Input type='hidden' />);
break; break;
case 'InputNumber': case 'InputNumber':
if (json?.otherProps) { if (json?.otherProps) {
...@@ -3021,7 +3027,86 @@ ${obj[dataColumn.base52]} ...@@ -3021,7 +3027,86 @@ ${obj[dataColumn.base52]}
} }
} }
break; break;
case 'Tabs':
let configOption = this.state.option;
if (
!configOption ||
!configOption.data ||
!Array.isArray(configOption.data) ||
!configOption.data.length
) {
return null;
}
const tabsProps = configOption.tabsProps || {};
const tabPaneProps = configOption.tabPaneProps || {};
let activeKey = this.state.activeKey || configOption.data[0].key;
console.log(configOption);
cm = <Tabs
onChange={this.changeTabsActiveKey}
activeKey={activeKey}
{...tabsProps}>
{configOption.data.map((r) => {
return (
<Tabs.TabPane tab={r.title} key={r.key} {...tabPaneProps}>
{activeKey === r.key ? (
<ZdyTable
changedValues={this.props.changedValues}
setRealTimeValues={this.props.setRealTimeValues}
trees={this.props.trees}
taskId={this.props.taskId}
taskAssignee={taskAssignee}
userId={userId}
modalInit={modalInit}
key={r.key}
datas={datas}
get={get}
isChild={true}
currentFormKey={r.key}
isEdit={isEdit}
obj={obj}
init={init}
form={this.props.form}
mapData={mapData}
sqlData={sqlData}
{...datas[r.key]}
defaultValues={defaultValues}
/>
/**
<ZdyTable
key={r}
modalInit={modalInit}
hfInstance={hfInstance}
currentFormTitle={
getCurrentFormTitle ? getCurrentFormTitle(json.childFormKey) : null
}
getCellValue={getCellValue}
formCode={this.props.formCode}
formId={this.props.formId}
isPreview={isPreview}
currentFormKey={json.childFormKey}
formConfig={datas}
get="mobile"
fatherCode={base52}
isEdit={isEdit}
index={r}
obj={objs[r]}
fatherObj={this.props.fatherObj}
init={objs}
isChild={true}
form={form}
mapData={mapData}
sqlData={sqlData}
datas={datasAll}
{...datas}
defaultValues={defaultValues}
/>
* */
) : null}
</Tabs.TabPane>
);
})}
</Tabs>;
break;
/** /**
* 为Radio为单选 * 为Radio为单选
*/ */
...@@ -3037,7 +3122,7 @@ ${obj[dataColumn.base52]} ...@@ -3037,7 +3122,7 @@ ${obj[dataColumn.base52]}
message: '请选择' + dataColumn.title, message: '请选择' + dataColumn.title,
}, },
], ],
})(<Radio.Group options={options} disabled={disabled}/>); })(<Radio.Group options={options} disabled={disabled} />);
if (get == 'mobile') { if (get == 'mobile') {
cm = <div>{cm}</div>; cm = <div>{cm}</div>;
if ( if (
...@@ -3065,7 +3150,7 @@ ${obj[dataColumn.base52]} ...@@ -3065,7 +3150,7 @@ ${obj[dataColumn.base52]}
case 'Checkbox': case 'Checkbox':
if (get === 'mobile') { if (get === 'mobile') {
cm = ( cm = (
<Flex direction="column" align="start"> <Flex direction='column' align='start'>
{getFieldDecorator(dataColumn.base52, { {getFieldDecorator(dataColumn.base52, {
initialValue: initValue, // 默认值 initialValue: initValue, // 默认值
rules: rules:
...@@ -3077,7 +3162,7 @@ ${obj[dataColumn.base52]} ...@@ -3077,7 +3162,7 @@ ${obj[dataColumn.base52]}
message: '请选择' + dataColumn.title, message: '请选择' + dataColumn.title,
}, },
], ],
})(<Checkbox.Group options={options} disabled={disabled}/>)} })(<Checkbox.Group options={options} disabled={disabled} />)}
</Flex> </Flex>
); );
...@@ -3131,7 +3216,7 @@ ${obj[dataColumn.base52]} ...@@ -3131,7 +3216,7 @@ ${obj[dataColumn.base52]}
} }
} }
cm = getFieldDecorator(dataColumn.base52, { cm = getFieldDecorator(dataColumn.base52, {
initialValue: !initValue && otherProps?.mode === 'multiple' ? undefined : initValue , initialValue: !initValue && otherProps?.mode === 'multiple' ? undefined : initValue,
rules: rules:
json.vlds && json.vlds.length > 0 json.vlds && json.vlds.length > 0
? json.vlds ? json.vlds
...@@ -3148,7 +3233,7 @@ ${obj[dataColumn.base52]} ...@@ -3148,7 +3233,7 @@ ${obj[dataColumn.base52]}
disabled={selectDis || disabled} disabled={selectDis || disabled}
placeholder={json.placeholder} placeholder={json.placeholder}
style={{ width: json.width }} style={{ width: json.width }}
optionFilterProp="children" optionFilterProp='children'
getPopupContainer={getPopupContainer(this.props.isDynamic, uuid)} getPopupContainer={getPopupContainer(this.props.isDynamic, uuid)}
onFocus={() => { onFocus={() => {
get === 'mobile' // 移动端取消输入键盘弹出 get === 'mobile' // 移动端取消输入键盘弹出
...@@ -3276,7 +3361,7 @@ ${obj[dataColumn.base52]} ...@@ -3276,7 +3361,7 @@ ${obj[dataColumn.base52]}
message: '请选择' + dataColumn.title, message: '请选择' + dataColumn.title,
}, },
], ],
})(<MobileCascader options={options} label={title} disabled={disabled} json={json}/>); })(<MobileCascader options={options} label={title} disabled={disabled} json={json} />);
} }
if ( if (
...@@ -3446,7 +3531,7 @@ ${obj[dataColumn.base52]} ...@@ -3446,7 +3531,7 @@ ${obj[dataColumn.base52]}
message: '请选择起止时间', message: '请选择起止时间',
}, },
], ],
})(<RangePickerDiy json={json} disabled={disabled} uuid={uuid}/>); })(<RangePickerDiy json={json} disabled={disabled} uuid={uuid} />);
} }
if (json.label == null) title = '起止时间'; if (json.label == null) title = '起止时间';
break; break;
...@@ -3632,7 +3717,7 @@ ${obj[dataColumn.base52]} ...@@ -3632,7 +3717,7 @@ ${obj[dataColumn.base52]}
message: '请输入', message: '请输入',
}, },
], ],
})(<WangEditor json={json} dataColumn={dataColumn} disabled={disabled} uuid={uuid}/>); })(<WangEditor json={json} dataColumn={dataColumn} disabled={disabled} uuid={uuid} />);
break; break;
case 'MobileCard': case 'MobileCard':
cm = getFieldDecorator(dataColumn.base52, { cm = getFieldDecorator(dataColumn.base52, {
...@@ -3658,7 +3743,7 @@ ${obj[dataColumn.base52]} ...@@ -3658,7 +3743,7 @@ ${obj[dataColumn.base52]}
message: '请输入', message: '请输入',
}, },
], ],
})(<DraftEditorCom placeholder={json.placeholder} disabled={json.disabled}/>); })(<DraftEditorCom placeholder={json.placeholder} disabled={json.disabled} />);
if ( if (
get === 'mobile' && get === 'mobile' &&
((json.isMobileLabel != null && json.isMobileLabel) || ((json.isMobileLabel != null && json.isMobileLabel) ||
...@@ -3689,7 +3774,7 @@ ${obj[dataColumn.base52]} ...@@ -3689,7 +3774,7 @@ ${obj[dataColumn.base52]}
message: '请输入' + title, message: '请输入' + title,
}, },
], ],
})(<CronEditorDiy/>); })(<CronEditorDiy />);
break; break;
case 'LocationCom': case 'LocationCom':
cm = getFieldDecorator(dataColumn.base52, { cm = getFieldDecorator(dataColumn.base52, {
...@@ -3805,7 +3890,7 @@ ${obj[dataColumn.base52]} ...@@ -3805,7 +3890,7 @@ ${obj[dataColumn.base52]}
message: '请上传图片', message: '请上传图片',
}, },
], ],
})(<ImgUploadCom json={json} disabled={disabled}/>); })(<ImgUploadCom json={json} disabled={disabled} />);
if ( if (
get === 'mobile' && get === 'mobile' &&
((json.isMobileLabel != null && json.isMobileLabel) || ((json.isMobileLabel != null && json.isMobileLabel) ||
...@@ -3836,7 +3921,7 @@ ${obj[dataColumn.base52]} ...@@ -3836,7 +3921,7 @@ ${obj[dataColumn.base52]}
message: '请上传视频', message: '请上传视频',
}, },
], ],
})(<VideoUploadCom json={json} disabled={disabled}/>); })(<VideoUploadCom json={json} disabled={disabled} />);
if ( if (
get === 'mobile' && get === 'mobile' &&
((json.isMobileLabel != null && json.isMobileLabel) || ((json.isMobileLabel != null && json.isMobileLabel) ||
...@@ -3867,7 +3952,7 @@ ${obj[dataColumn.base52]} ...@@ -3867,7 +3952,7 @@ ${obj[dataColumn.base52]}
message: '请进行签名', message: '请进行签名',
}, },
], ],
})(<Signature width={json.width} height={json.height} get={get}/>); })(<Signature width={json.width} height={json.height} get={get} />);
if ( if (
get === 'mobile' && get === 'mobile' &&
((json.isMobileLabel != null && json.isMobileLabel) || ((json.isMobileLabel != null && json.isMobileLabel) ||
...@@ -4087,7 +4172,7 @@ ${obj[dataColumn.base52]} ...@@ -4087,7 +4172,7 @@ ${obj[dataColumn.base52]}
label={title} label={title}
data-cell-component-name={json.comName || 'no_com'} data-cell-component-name={json.comName || 'no_com'}
> >
<ShowComName json={json}/> <ShowComName json={json} />
{cm} {cm}
</Form.Item> </Form.Item>
</> </>
...@@ -4182,12 +4267,12 @@ ${obj[dataColumn.base52]} ...@@ -4182,12 +4267,12 @@ ${obj[dataColumn.base52]}
wrapperCol={{ span: json.wrapperSpan }} wrapperCol={{ span: json.wrapperSpan }}
label={title} label={title}
> >
<ShowComName json={json}/> <ShowComName json={json} />
{cm} {cm}
</Form.Item> </Form.Item>
) : ( ) : (
<Form.Item> <Form.Item>
<ShowComName json={json}/> <ShowComName json={json} />
{cm} {cm}
</Form.Item> </Form.Item>
) )
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论