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

28974 辅导员考核相关需求,有疑问联系我

onestop 增加 步骤条组件
上级 cdcb10b2
import React, { useState, useEffect, useMemo, useCallback } from 'react'; import React, { useState, useEffect, useMemo, useCallback } from 'react';
import { Steps } from 'antd'; import { Steps } from 'antd';
import ZdyTable from '@/webPublic/one_stop_public/Table';
const { Step } = Steps; const { Step } = Steps;
export default function StepDiy(props) { export default function StepDiy(props) {
const { value, onChange, json, form } = props; const { value, json, partFormProps, dataColumn, onChange } = props;
const diyProps = useMemo(() => { const diyProps = useMemo(() => {
let b = {}; let b = {};
if (value && typeof value === 'object') { if (value && typeof value === 'object') {
b = { b = {
...value, ...value,
}; };
delete b.formValues;
} }
if (json.otherProps && typeof json.otherProps === 'string') { if (json.otherProps && typeof json.otherProps === 'string') {
try { try {
...@@ -30,21 +32,65 @@ export default function StepDiy(props) { ...@@ -30,21 +32,65 @@ export default function StepDiy(props) {
} }
}, [json.otherProps, value]); }, [json.otherProps, value]);
/** const [current, setCurrent] = useState(diyProps?.StepsProps?.current || 0);
* 按姚鑫国的要求 在切换步骤时将表单的值保存起来 const [formValues, setFormValues] = useState({});
* */
const partFormKey = useMemo(() => {
if (typeof current !== 'undefined') {
let item = diyProps.Step.find((g, index) => {
return index === current;
});
if (item) {
return item.formKey;
}
}
return undefined;
}, [current]);
useEffect(() => { useEffect(() => {
console.log(JSON.stringify(form.getFieldsValue())); if (diyProps?.StepsProps?.current !== current) {
}, [diyProps?.StepsProps.current]); const oldValues = partFormProps.form.getFieldsValue();
let newV = {
...oldValues,
};
delete newV[dataColumn.base52];
setFormValues({
...formValues,
...newV,
});
}
setCurrent(diyProps?.StepsProps?.current);
}, [diyProps?.StepsProps?.current]);
useEffect(() => {
onChange({
...value,
formValues,
})
}, [formValues]);
console.log(value);
return ( return (
<div style={diyProps.outSideDivStyle}> <div style={diyProps.outSideDivStyle}>
<Steps {...diyProps.StepsProps}> <Steps {...diyProps.StepsProps}
current={current}>
{Array.isArray(diyProps.Step) && {Array.isArray(diyProps.Step) &&
diyProps.Step.map(g => { diyProps.Step.map(g => {
return <Step {...g} key={g.title} />; return <Step {...g} key={g.title} />;
})} })}
</Steps> </Steps>
{!!partFormKey && (
<div>
<ZdyTable
{...partFormProps}
currentFormTitle={'Steps组件的子表单' + partFormKey}
key={partFormKey}
currentFormKey={partFormKey}
{...partFormProps?.datas[partFormKey]}
/>
</div>
)}
</div> </div>
); );
} }
...@@ -80,16 +80,11 @@ import getOneStopUploadUrl from '@/webPublic/one_stop_public/Base16/getOneStopUp ...@@ -80,16 +80,11 @@ import getOneStopUploadUrl from '@/webPublic/one_stop_public/Base16/getOneStopUp
import SwitchWeb from '@/webPublic/one_stop_public/tableCompon/Split_Index/SwitchWeb'; import SwitchWeb from '@/webPublic/one_stop_public/tableCompon/Split_Index/SwitchWeb';
import CronEditorDiy from '@/webPublic/one_stop_public/tableCompon/Split_Index/CronEditorDiy/index'; import CronEditorDiy from '@/webPublic/one_stop_public/tableCompon/Split_Index/CronEditorDiy/index';
import ButtonDiy from '@/webPublic/one_stop_public/tableCompon/Split_Index/ButtonDiy'; import ButtonDiy from '@/webPublic/one_stop_public/tableCompon/Split_Index/ButtonDiy';
import giveVarcharRules import giveVarcharRules from '@/webPublic/one_stop_public/tableCompon/Split_Index/giveVarcharLength';
from '@/webPublic/one_stop_public/tableCompon/Split_Index/giveVarcharLength'; import getPopupContainer from '@/webPublic/one_stop_public/tableCompon/Split_Index/getPopupContainer';
import getPopupContainer
from '@/webPublic/one_stop_public/tableCompon/Split_Index/getPopupContainer';
import StepDiy from '@/webPublic/one_stop_public/tableCompon/Split_Index/StepDiy'; import StepDiy from '@/webPublic/one_stop_public/tableCompon/Split_Index/StepDiy';
const { const { MonthPicker, WeekPicker } = DatePicker;
MonthPicker,
WeekPicker,
} = DatePicker;
/** /**
* 日期组件antd3.x有bug 详情见禅道 27152 毕业跟踪调查管理 毕业时间改为年级筛选 * 日期组件antd3.x有bug 详情见禅道 27152 毕业跟踪调查管理 毕业时间改为年级筛选
*/ */
...@@ -111,12 +106,7 @@ const giveRender = (column = {}) => { ...@@ -111,12 +106,7 @@ const giveRender = (column = {}) => {
return column; return column;
}; };
@connect(({ @connect(({ DataColumn, SqlManageEntity, formList, loading }) => ({
DataColumn,
SqlManageEntity,
formList,
loading,
}) => ({
DataColumn, DataColumn,
SqlManageEntity, SqlManageEntity,
formList, formList,
...@@ -163,13 +153,12 @@ export default class TableCom extends Component { ...@@ -163,13 +153,12 @@ export default class TableCom extends Component {
}); });
}; };
changeTabsActiveKey = (activeKey) => { changeTabsActiveKey = activeKey => {
this.setState({ this.setState({
activeKey, activeKey,
}); });
}; };
showModal = (fk, title, data, modalProps) => { showModal = (fk, title, data, modalProps) => {
// console.log(fk, title, data, modalProps); // console.log(fk, title, data, modalProps);
...@@ -230,12 +219,7 @@ export default class TableCom extends Component { ...@@ -230,12 +219,7 @@ export default class TableCom extends Component {
}; };
getColumnSearchProps = (dataIndex, title) => ({ getColumnSearchProps = (dataIndex, title) => ({
filterDropdown: ({ filterDropdown: ({ setSelectedKeys, selectedKeys, confirm, clearFilters }) => (
setSelectedKeys,
selectedKeys,
confirm,
clearFilters,
}) => (
<div style={{ padding: 8 }}> <div style={{ padding: 8 }}>
<Input <Input
ref={node => { ref={node => {
...@@ -252,11 +236,11 @@ export default class TableCom extends Component { ...@@ -252,11 +236,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,
...@@ -267,14 +251,14 @@ export default class TableCom extends Component { ...@@ -267,14 +251,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]
...@@ -322,11 +306,7 @@ export default class TableCom extends Component { ...@@ -322,11 +306,7 @@ export default class TableCom extends Component {
}; };
componentWillReceiveProps(props) { componentWillReceiveProps(props) {
const { const { json, mapData, obj } = props;
json,
mapData,
obj,
} = props;
if (json == null || this.props.safe) { if (json == null || this.props.safe) {
return; return;
} }
...@@ -439,10 +419,7 @@ export default class TableCom extends Component { ...@@ -439,10 +419,7 @@ export default class TableCom extends Component {
dataFilter = ['Select', 'Radio', 'Checkbox', 'Cascader']; dataFilter = ['Select', 'Radio', 'Checkbox', 'Cascader'];
getData = (json, dataColumn, obj, init) => { getData = (json, dataColumn, obj, init) => {
const { const { formKey, uuid } = this.props;
formKey,
uuid,
} = this.props;
let jsonStatic = json; let jsonStatic = json;
json = { json = {
...jsonStatic, ...jsonStatic,
...@@ -453,10 +430,7 @@ export default class TableCom extends Component { ...@@ -453,10 +430,7 @@ export default class TableCom extends Component {
allValues = JSON.stringify(allValues); allValues = JSON.stringify(allValues);
if (json.comName === 'TableSelect') { if (json.comName === 'TableSelect') {
const { dispatch } = this.props; const { dispatch } = this.props;
const { const { sqlKey, optionType } = json;
sqlKey,
optionType,
} = json;
if (optionType === 'sql') { if (optionType === 'sql') {
dispatch({ dispatch({
type: 'SqlManageEntity/find', type: 'SqlManageEntity/find',
...@@ -478,8 +452,7 @@ export default class TableCom extends Component { ...@@ -478,8 +452,7 @@ export default class TableCom extends Component {
if ( if (
['DATE', 'DATETIME', 'TIME', 'TIMESTAMP', 'YEAR'].includes(datas[i].type) ['DATE', 'DATETIME', 'TIME', 'TIMESTAMP', 'YEAR'].includes(datas[i].type)
) { ) {
column.render = val => moment(val) column.render = val => moment(val).format('YYYY-MM-DD HH:mm:ss');
.format('YYYY-MM-DD HH:mm:ss');
} }
column = giveRender(column); column = giveRender(column);
...@@ -516,8 +489,7 @@ export default class TableCom extends Component { ...@@ -516,8 +489,7 @@ export default class TableCom extends Component {
break; break;
} }
column.render = val => moment(parseInt(val)) column.render = val => moment(parseInt(val)).format(ff);
.format(ff);
} }
if (cll[k].isQuery) { if (cll[k].isQuery) {
column = { column = {
...@@ -563,8 +535,7 @@ export default class TableCom extends Component { ...@@ -563,8 +535,7 @@ export default class TableCom extends Component {
column.title = datas[i].title; column.title = datas[i].title;
column.dataIndex = datas[i].name; column.dataIndex = datas[i].name;
if (['DATE', 'DATETIME', 'TIME', 'TIMESTAMP', 'YEAR'].includes(datas[i].type)) { if (['DATE', 'DATETIME', 'TIME', 'TIMESTAMP', 'YEAR'].includes(datas[i].type)) {
column.render = val => moment(val) column.render = val => moment(val).format('YYYY-MM-DD HH:mm:ss');
.format('YYYY-MM-DD HH:mm:ss');
} }
column = giveRender(column); column = giveRender(column);
columns.push(column); columns.push(column);
...@@ -803,8 +774,7 @@ export default class TableCom extends Component { ...@@ -803,8 +774,7 @@ export default class TableCom extends Component {
delete params[i]; delete params[i];
} }
} }
noPrefixRequest(url, params) noPrefixRequest(url, params).then(data => {
.then(data => {
// if (!data || !Array.isArray(data)) { // if (!data || !Array.isArray(data)) {
// data = []; // data = [];
// } // }
...@@ -1006,8 +976,7 @@ export default class TableCom extends Component { ...@@ -1006,8 +976,7 @@ export default class TableCom extends Component {
if (getToken() != null) { if (getToken() != null) {
pp.token = getToken(); pp.token = getToken();
} }
uaaRequest(url, pp) uaaRequest(url, pp).then(data => {
.then(data => {
const { sqlKeys } = this.state; const { sqlKeys } = this.state;
sqlKeys[sqlKey].data = data; sqlKeys[sqlKey].data = data;
this.setState({ sqlKeys }); this.setState({ sqlKeys });
...@@ -1108,7 +1077,6 @@ export default class TableCom extends Component { ...@@ -1108,7 +1077,6 @@ export default class TableCom extends Component {
}; };
} }
let obj = {}; let obj = {};
if (!isEdit && fatherCode) { if (!isEdit && fatherCode) {
obj = { obj = {
...@@ -1178,7 +1146,6 @@ export default class TableCom extends Component { ...@@ -1178,7 +1146,6 @@ export default class TableCom extends Component {
messageData, messageData,
concealModel, concealModel,
}; };
}; };
getFunctionValue = (fun, column, json, callback) => { getFunctionValue = (fun, column, json, callback) => {
...@@ -1277,12 +1244,7 @@ export default class TableCom extends Component { ...@@ -1277,12 +1244,7 @@ export default class TableCom extends Component {
}; };
componentDidMount() { componentDidMount() {
const { const { json, mapData, obj, init } = this.props;
json,
mapData,
obj,
init,
} = this.props;
if (json == null) { if (json == null) {
return; return;
} }
...@@ -1327,13 +1289,7 @@ export default class TableCom extends Component { ...@@ -1327,13 +1289,7 @@ export default class TableCom extends Component {
} }
fetchData3 = (obj, dataColumn, init, json, allValues) => { fetchData3 = (obj, dataColumn, init, json, allValues) => {
const { const { sqlKey, labelName, valueName, isMeta, filterSql } = json;
sqlKey,
labelName,
valueName,
isMeta,
filterSql,
} = json;
if (isMeta) { if (isMeta) {
// 2022年7月5日 2022 姚鑫国说的 如果是元数据 不需要传这个allValues // 2022年7月5日 2022 姚鑫国说的 如果是元数据 不需要传这个allValues
// 解决禅道bug 28017 // 解决禅道bug 28017
...@@ -1573,10 +1529,7 @@ export default class TableCom extends Component { ...@@ -1573,10 +1529,7 @@ export default class TableCom extends Component {
} }
}; };
getColumn = key => { getColumn = key => {
let { let { mapData, json } = this.props;
mapData,
json,
} = this.props;
const columnIds = json?.columnIds; const columnIds = json?.columnIds;
...@@ -1632,20 +1585,8 @@ export default class TableCom extends Component { ...@@ -1632,20 +1585,8 @@ export default class TableCom extends Component {
// console.log(formKey, json); // console.log(formKey, json);
// } // }
const { const { options, labels, selectDis, modalCode, modalTitle, modalInit, modalProps } = this.state;
options, const { getFieldDecorator, getFieldError, getFieldProps } = this.props.form;
labels,
selectDis,
modalCode,
modalTitle,
modalInit,
modalProps,
} = this.state;
const {
getFieldDecorator,
getFieldError,
getFieldProps,
} = 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;
if (json?.label === '账号') { if (json?.label === '账号') {
...@@ -1683,53 +1624,64 @@ export default class TableCom extends Component { ...@@ -1683,53 +1624,64 @@ 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 (['PartForm', 'Steps'].includes(json.comName)) {
this.partFormProps = {
taskId: this.props.taskId,
importExcel: this.props.importExcel,
setRealTimeValues: this.props.setRealTimeValues,
hfInstance: this.props.hfInstance,
getCellValue: getCellValue,
taskAssignee: taskAssignee,
isWebPrint: this.props.isWebPrint || false,
userId: userId,
isPreview: isPreview,
modalInit: modalInit,
datas: datas,
trees: this.props.trees,
get: get,
isChild: true,
isEdit: isEdit,
obj: obj,
init: init,
formCode: this.props.formCode,
formId: this.props.formId,
form: this.props.form,
mapData: mapData,
sqlData: sqlData,
defaultValues: defaultValues,
// currentFormTitle={
// this.props.getCurrentFormTitle ? this.props.getCurrentFormTitle(fk) : null
// }
// key={fk}
// currentFormKey={fk}
// {...datas[fk]}
};
}
if (json.comName == 'PartForm') { if (json.comName === 'PartForm') {
const fk = this.props.form.getFieldsValue()[uuid] || json.childFormKey; const fk = this.props.form.getFieldsValue()[uuid] || json.childFormKey;
if (fk == null) { if (fk == null) {
return <></>; return <></>;
} }
if (formKey == fk) { if (formKey === fk) {
return <>片段表单key不能和自身相同</>; return <>片段表单key不能和自身相同</>;
} }
return ( return (
<> <>
{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} {...this.partFormProps}
importExcel={this.props.importExcel}
setRealTimeValues={this.props.setRealTimeValues}
hfInstance={this.props.hfInstance}
currentFormTitle={ currentFormTitle={
this.props.getCurrentFormTitle ? this.props.getCurrentFormTitle(fk) : null this.props.getCurrentFormTitle ? this.props.getCurrentFormTitle(fk) : null
} }
getCellValue={getCellValue}
taskAssignee={taskAssignee}
isWebPrint={this.props.isWebPrint || false}
userId={userId}
key={fk} key={fk}
isPreview={isPreview}
modalInit={modalInit}
datas={datas}
trees={this.props.trees}
get={get}
isChild={true}
currentFormKey={fk} currentFormKey={fk}
isEdit={isEdit}
obj={obj}
init={init}
formCode={this.props.formCode}
formId={this.props.formId}
form={this.props.form}
mapData={mapData}
sqlData={sqlData}
{...datas[fk]} {...datas[fk]}
defaultValues={defaultValues}
/> />
</> </>
); );
...@@ -1775,7 +1727,7 @@ export default class TableCom extends Component { ...@@ -1775,7 +1727,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' : '',
...@@ -1792,7 +1744,7 @@ export default class TableCom extends Component { ...@@ -1792,7 +1744,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' : '',
...@@ -1884,8 +1836,7 @@ export default class TableCom extends Component { ...@@ -1884,8 +1836,7 @@ export default class TableCom extends Component {
case 'DatePicker': case 'DatePicker':
cm = value ? ( cm = value ? (
<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>
) : ( ) : (
...@@ -1901,7 +1852,7 @@ export default class TableCom extends Component { ...@@ -1901,7 +1852,7 @@ 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>
...@@ -1921,7 +1872,7 @@ export default class TableCom extends Component { ...@@ -1921,7 +1872,7 @@ 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>
...@@ -2014,7 +1965,7 @@ export default class TableCom extends Component { ...@@ -2014,7 +1965,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" />)}
</> </>
); );
} }
...@@ -2027,7 +1978,7 @@ export default class TableCom extends Component { ...@@ -2027,7 +1978,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" />)}
</> </>
); );
} }
...@@ -2121,7 +2072,7 @@ export default class TableCom extends Component { ...@@ -2121,7 +2072,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" />)}
</> </>
); );
} }
...@@ -2134,7 +2085,7 @@ export default class TableCom extends Component { ...@@ -2134,7 +2085,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" />)}
</> </>
); );
} }
...@@ -2215,12 +2166,15 @@ export default class TableCom extends Component { ...@@ -2215,12 +2166,15 @@ export default class TableCom extends Component {
if (!value || value === 'null') { if (!value || value === 'null') {
return <div />; return <div />;
} }
cm = <MobileCard value={value} cm = (
<MobileCard
value={value}
json={json} json={json}
getArguments={this.functionArguments} getArguments={this.functionArguments}
tableComProps={this.props} tableComProps={this.props}
dataColumn={dataColumn} dataColumn={dataColumn}
/>; />
);
break; break;
case 'WangEditor': case 'WangEditor':
let textV = obj[dataColumn.base52]; let textV = obj[dataColumn.base52];
...@@ -2329,7 +2283,7 @@ ${obj[dataColumn.base52]} ...@@ -2329,7 +2283,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}
/> />
...@@ -2361,13 +2315,11 @@ ${obj[dataColumn.base52]} ...@@ -2361,13 +2315,11 @@ ${obj[dataColumn.base52]}
} else { } else {
cm = ( cm = (
<span> <span>
{moment(parseInt(obj[begin.base52])) {moment(parseInt(obj[begin.base52])).format(
.format(
json.format ? json.format : 'YYYY-MM-DD HH:mm:ss', json.format ? json.format : 'YYYY-MM-DD HH:mm:ss',
)}{' '} )}{' '}
{' '} {' '}
{moment(parseInt(obj[end.base52])) {moment(parseInt(obj[end.base52])).format(
.format(
json.format ? json.format : 'YYYY-MM-DD HH:mm:ss', json.format ? json.format : 'YYYY-MM-DD HH:mm:ss',
)} )}
</span> </span>
...@@ -2383,16 +2335,14 @@ ${obj[dataColumn.base52]} ...@@ -2383,16 +2335,14 @@ ${obj[dataColumn.base52]}
if (vTime && typeof vTime === 'string' && vTime.indexOf('-') <= -1) { if (vTime && typeof vTime === 'string' && vTime.indexOf('-') <= -1) {
cm = ( cm = (
<span> <span>
{moment(parseInt(vTime)) {moment(parseInt(vTime)).format(json.format ? json.format : 'YYYY-MM-DD HH:mm:ss')}
.format(json.format ? json.format : 'YYYY-MM-DD HH:mm:ss')}
</span> </span>
); );
} else { } else {
cm = ( cm = (
<span> <span>
{vTime {vTime
? moment(+new Date(vTime)) ? moment(+new Date(vTime)).format(
.format(
json.format ? json.format : 'YYYY-MM-DD HH:mm:ss', json.format ? json.format : 'YYYY-MM-DD HH:mm:ss',
) )
: ''} : ''}
...@@ -2500,7 +2450,7 @@ ${obj[dataColumn.base52]} ...@@ -2500,7 +2450,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>
...@@ -2527,7 +2477,7 @@ ${obj[dataColumn.base52]} ...@@ -2527,7 +2477,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>
...@@ -2630,14 +2580,14 @@ ${obj[dataColumn.base52]} ...@@ -2630,14 +2580,14 @@ ${obj[dataColumn.base52]}
marginLeft: 5, marginLeft: 5,
width: width:
get === 'mobile' get === 'mobile'
? document.documentElement.clientWidth - 10 || document.body.clientWidth - 10 ? document.documentElement.clientWidth - 10 ||
document.body.clientWidth - 10
: json.width, : json.width,
height: get === 'mobile' ? '' : json.height, height: get === 'mobile' ? '' : json.height,
}} }}
/> />
); );
} }
} }
break; break;
...@@ -2698,7 +2648,7 @@ ${obj[dataColumn.base52]} ...@@ -2698,7 +2648,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} />;
} }
} }
...@@ -2781,7 +2731,7 @@ ${obj[dataColumn.base52]} ...@@ -2781,7 +2731,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} />;
} }
} }
...@@ -2922,10 +2872,7 @@ ${obj[dataColumn.base52]} ...@@ -2922,10 +2872,7 @@ ${obj[dataColumn.base52]}
otherProps = {}; otherProps = {};
} }
} }
const { const { disabledInputStyle = {}, addonAfter } = otherProps;
disabledInputStyle = {},
addonAfter,
} = otherProps;
let inputStyle = { let inputStyle = {
width: json.width, width: json.width,
}; };
...@@ -2975,7 +2922,7 @@ ${obj[dataColumn.base52]} ...@@ -2975,7 +2922,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) {
...@@ -3042,11 +2989,9 @@ ${obj[dataColumn.base52]} ...@@ -3042,11 +2989,9 @@ ${obj[dataColumn.base52]}
const tabPaneProps = configOption.tabPaneProps || {}; const tabPaneProps = configOption.tabPaneProps || {};
let activeKey = this.state.activeKey || configOption.data[0].key; let activeKey = this.state.activeKey || configOption.data[0].key;
console.log(configOption); console.log(configOption);
cm = <Tabs cm = (
onChange={this.changeTabsActiveKey} <Tabs onChange={this.changeTabsActiveKey} activeKey={activeKey} {...tabsProps}>
activeKey={activeKey} {configOption.data.map(r => {
{...tabsProps}>
{configOption.data.map((r) => {
return ( return (
<Tabs.TabPane tab={r.title} key={r.key} {...tabPaneProps}> <Tabs.TabPane tab={r.title} key={r.key} {...tabPaneProps}>
{activeKey === r.key ? ( {activeKey === r.key ? (
...@@ -3072,7 +3017,7 @@ ${obj[dataColumn.base52]} ...@@ -3072,7 +3017,7 @@ ${obj[dataColumn.base52]}
{...datas[r.key]} {...datas[r.key]}
defaultValues={defaultValues} defaultValues={defaultValues}
/> />
/** ) : /**
<ZdyTable <ZdyTable
key={r} key={r}
modalInit={modalInit} modalInit={modalInit}
...@@ -3102,11 +3047,12 @@ ${obj[dataColumn.base52]} ...@@ -3102,11 +3047,12 @@ ${obj[dataColumn.base52]}
defaultValues={defaultValues} defaultValues={defaultValues}
/> />
* */ * */
) : null} null}
</Tabs.TabPane> </Tabs.TabPane>
); );
})} })}
</Tabs>; </Tabs>
);
break; break;
/** /**
* 为Radio为单选 * 为Radio为单选
...@@ -3151,7 +3097,7 @@ ${obj[dataColumn.base52]} ...@@ -3151,7 +3097,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:
...@@ -3234,7 +3180,7 @@ ${obj[dataColumn.base52]} ...@@ -3234,7 +3180,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' // 移动端取消输入键盘弹出
...@@ -3255,8 +3201,7 @@ ${obj[dataColumn.base52]} ...@@ -3255,8 +3201,7 @@ ${obj[dataColumn.base52]}
}} }}
filterOption={(input, option) => filterOption={(input, option) =>
option option
? option.props.children.toLowerCase() ? option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
.indexOf(input.toLowerCase()) >= 0
: false : false
} }
{...otherProps} {...otherProps}
...@@ -3313,8 +3258,7 @@ ${obj[dataColumn.base52]} ...@@ -3313,8 +3258,7 @@ ${obj[dataColumn.base52]}
} }
const filterF = function filter(inputValue, path) { const filterF = function filter(inputValue, path) {
return path.some( return path.some(
option => option?.label?.toLowerCase() option => option?.label?.toLowerCase()?.indexOf(inputValue.toLowerCase()) > -1,
?.indexOf(inputValue.toLowerCase()) > -1,
); );
}; };
// if(this.props.uuid === 'id_32691685234912400529714267d34dc585a2'){ // if(this.props.uuid === 'id_32691685234912400529714267d34dc585a2'){
...@@ -3467,13 +3411,11 @@ ${obj[dataColumn.base52]} ...@@ -3467,13 +3411,11 @@ ${obj[dataColumn.base52]}
if (!isEdit) { if (!isEdit) {
cm = ( cm = (
<span> <span>
{moment(parseInt(obj[begin.base52])) {moment(parseInt(obj[begin.base52])).format(
.format(
json.format ? json.format : 'YYYY-MM-DD HH:mm:ss', json.format ? json.format : 'YYYY-MM-DD HH:mm:ss',
)}{' '} )}{' '}
{' '} {' '}
{moment(parseInt(obj[end.base52])) {moment(parseInt(obj[end.base52])).format(
.format(
json.format ? json.format : 'YYYY-MM-DD HH:mm:ss', json.format ? json.format : 'YYYY-MM-DD HH:mm:ss',
)} )}
</span> </span>
...@@ -3586,8 +3528,7 @@ ${obj[dataColumn.base52]} ...@@ -3586,8 +3528,7 @@ ${obj[dataColumn.base52]}
} }
}); });
} }
: () => { : () => {}
}
} }
format={json.format ? json.format : 'YYYY-MM-DD HH:mm:ss'} format={json.format ? json.format : 'YYYY-MM-DD HH:mm:ss'}
{...otherProps} {...otherProps}
...@@ -3723,12 +3664,15 @@ ${obj[dataColumn.base52]} ...@@ -3723,12 +3664,15 @@ ${obj[dataColumn.base52]}
case 'Steps': case 'Steps':
cm = getFieldDecorator(dataColumn.base52, { cm = getFieldDecorator(dataColumn.base52, {
initialValue: initValue, initialValue: initValue,
})(<StepDiy json={json} })(
<StepDiy
json={json}
dataColumn={dataColumn} dataColumn={dataColumn}
disabled={disabled} disabled={disabled}
uuid={uuid} uuid={uuid}
form={this.props.form} partFormProps={this.partFormProps}
/>); />,
);
break; break;
case 'MobileCard': case 'MobileCard':
cm = getFieldDecorator(dataColumn.base52, { cm = getFieldDecorator(dataColumn.base52, {
...@@ -3740,7 +3684,8 @@ ${obj[dataColumn.base52]} ...@@ -3740,7 +3684,8 @@ ${obj[dataColumn.base52]}
getArguments={this.functionArguments} getArguments={this.functionArguments}
tableComProps={this.props} tableComProps={this.props}
dataColumn={dataColumn} dataColumn={dataColumn}
/>); />,
);
break; break;
case 'RichText': case 'RichText':
cm = getFieldDecorator(dataColumn.base52, { cm = getFieldDecorator(dataColumn.base52, {
...@@ -3801,8 +3746,7 @@ ${obj[dataColumn.base52]} ...@@ -3801,8 +3746,7 @@ ${obj[dataColumn.base52]}
let errors = []; let errors = [];
console.log(valueThis); console.log(valueThis);
if ( if (
(!valueThis || !JSON.stringify(valueThis) (!valueThis || !JSON.stringify(valueThis).includes('address')) &&
.includes('address')) &&
required required
) { ) {
errors.push(new Error('请获取定位信息', rule.field)); errors.push(new Error('请获取定位信息', rule.field));
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论