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

干预情况组件修改

上级 17f1a944
......@@ -79,15 +79,10 @@ import getOneStopUploadUrl from '@/webPublic/one_stop_public/Base16/getOneStopUp
import SwitchWeb from '@/webPublic/one_stop_public/tableCompon/Split_Index/SwitchWeb';
import CronEditorDiy from '@/webPublic/one_stop_public/tableCompon/Split_Index/CronEditorDiy/index';
import ButtonDiy from '@/webPublic/one_stop_public/tableCompon/Split_Index/ButtonDiy';
import giveVarcharRules
from '@/webPublic/one_stop_public/tableCompon/Split_Index/giveVarcharLength';
import getPopupContainer
from '@/webPublic/one_stop_public/tableCompon/Split_Index/getPopupContainer';
const {
MonthPicker,
WeekPicker
} = DatePicker;
import giveVarcharRules from '@/webPublic/one_stop_public/tableCompon/Split_Index/giveVarcharLength';
import getPopupContainer from '@/webPublic/one_stop_public/tableCompon/Split_Index/getPopupContainer';
const { MonthPicker, WeekPicker } = DatePicker;
/**
* 日期组件antd3.x有bug 详情见禅道 27152 毕业跟踪调查管理 毕业时间改为年级筛选
*/
......@@ -108,12 +103,7 @@ const giveRender = (column = {}) => {
return column;
};
@connect(({
DataColumn,
SqlManageEntity,
formList,
loading
}) => ({
@connect(({ DataColumn, SqlManageEntity, formList, loading }) => ({
DataColumn,
SqlManageEntity,
formList,
......@@ -186,7 +176,7 @@ export default class TableCom extends Component {
file = {
name: 'file',
action: getOneStopUploadUrl(),
onChange: info => {
onChange: (info) => {
if (info.file.status !== 'uploading') {
this.setState({
img: info.file.response,
......@@ -207,7 +197,7 @@ export default class TableCom extends Component {
this.setState({ searchText: selectedKeys[0] });
};
handleReset = clearFilters => {
handleReset = (clearFilters) => {
clearFilters();
this.resetSearchText();
};
......@@ -219,20 +209,15 @@ export default class TableCom extends Component {
};
getColumnSearchProps = (dataIndex, title) => ({
filterDropdown: ({
setSelectedKeys,
selectedKeys,
confirm,
clearFilters
}) => (
filterDropdown: ({ setSelectedKeys, selectedKeys, confirm, clearFilters }) => (
<div style={{ padding: 8 }}>
<Input
ref={node => {
ref={(node) => {
this.searchInput = node;
}}
placeholder={`请输入${title}`}
value={selectedKeys[0]}
onChange={e => setSelectedKeys(e.target.value ? [e.target.value] : [])}
onChange={(e) => setSelectedKeys(e.target.value ? [e.target.value] : [])}
onPressEnter={() => this.handleSearch(selectedKeys, confirm)}
style={{
width: 188,
......@@ -249,21 +234,21 @@ export default class TableCom extends Component {
style={{
width: 90,
marginRight: 8,
}}
>
}}>
搜索
</Button>
<Button
loading={this.props.loading}
onClick={() => this.handleReset(clearFilters)}
size="small"
style={{ width: 90 }}
>
style={{ width: 90 }}>
重置
</Button>
</div>
),
filterIcon: filtered => <Icon type="search" style={{ color: filtered ? '#1890ff' : 'red' }}/>,
filterIcon: (filtered) => (
<Icon type="search" style={{ color: filtered ? '#1890ff' : 'red' }} />
),
onFilter: (value, record) =>
record[dataIndex]
? record[dataIndex]
......@@ -271,12 +256,12 @@ export default class TableCom extends Component {
.toLowerCase()
.includes(value.toLowerCase())
: '',
onFilterDropdownVisibleChange: visible => {
onFilterDropdownVisibleChange: (visible) => {
if (visible) {
setTimeout(() => this.searchInput.select());
}
},
render: text => {
render: (text) => {
if (text != null) {
return (
<Highlighter
......@@ -311,11 +296,7 @@ export default class TableCom extends Component {
};
componentWillReceiveProps(props) {
const {
json,
mapData,
obj
} = props;
const { json, mapData, obj } = props;
if (json == null || this.props.safe) {
return;
}
......@@ -428,10 +409,7 @@ export default class TableCom extends Component {
dataFilter = ['Select', 'Radio', 'Checkbox', 'Cascader'];
getData = (json, dataColumn, obj, init) => {
const {
formKey,
uuid
} = this.props;
const { formKey, uuid } = this.props;
let jsonStatic = json;
json = {
...jsonStatic,
......@@ -442,21 +420,18 @@ export default class TableCom extends Component {
allValues = JSON.stringify(allValues);
if (json.comName === 'TableSelect') {
const { dispatch } = this.props;
const {
sqlKey,
optionType
} = json;
const { sqlKey, optionType } = json;
if (optionType === 'sql') {
dispatch({
type: 'SqlManageEntity/find',
payload: { sqlKey },
callback: sqlModel => {
callback: (sqlModel) => {
this.setState({ sqlModel });
if (sqlModel.dataObjId) {
dispatch({
type: 'formList/getHead',
payload: { dataObjId: sqlModel.dataObjId },
callback: datas => {
callback: (datas) => {
if (datas) {
const columns = [];
for (var i = 0; i < datas.length; i++) {
......@@ -467,8 +442,7 @@ export default class TableCom extends Component {
if (
['DATE', 'DATETIME', 'TIME', 'TIMESTAMP', 'YEAR'].includes(datas[i].type)
) {
column.render = val => moment(val)
.format('YYYY-MM-DD HH:mm:ss');
column.render = (val) => moment(val).format('YYYY-MM-DD HH:mm:ss');
}
column = giveRender(column);
......@@ -505,8 +479,7 @@ export default class TableCom extends Component {
break;
}
column.render = val => moment(parseInt(val))
.format(ff);
column.render = (val) => moment(parseInt(val)).format(ff);
}
if (cll[k].isQuery) {
column = {
......@@ -528,7 +501,7 @@ export default class TableCom extends Component {
sqlKey,
allValues,
},
callback: list => {
callback: (list) => {
const x = {
list: list,
pagination: false,
......@@ -543,7 +516,7 @@ export default class TableCom extends Component {
dispatch({
type: 'formList/getHead',
payload: { dataObjId: dataColumn.referenceObjId },
callback: datas => {
callback: (datas) => {
if (datas) {
const columns = [];
for (var i = 0; i < datas.length; i++) {
......@@ -552,8 +525,7 @@ export default class TableCom extends Component {
column.title = datas[i].title;
column.dataIndex = datas[i].name;
if (['DATE', 'DATETIME', 'TIME', 'TIMESTAMP', 'YEAR'].includes(datas[i].type)) {
column.render = val => moment(val)
.format('YYYY-MM-DD HH:mm:ss');
column.render = (val) => moment(val).format('YYYY-MM-DD HH:mm:ss');
}
column = giveRender(column);
columns.push(column);
......@@ -792,8 +764,7 @@ export default class TableCom extends Component {
delete params[i];
}
}
noPrefixRequest(url, params)
.then(data => {
noPrefixRequest(url, params).then((data) => {
// if (!data || !Array.isArray(data)) {
// data = [];
// }
......@@ -995,8 +966,7 @@ export default class TableCom extends Component {
if (getToken() != null) {
pp.token = getToken();
}
uaaRequest(url, pp)
.then(data => {
uaaRequest(url, pp).then((data) => {
const { sqlKeys } = this.state;
sqlKeys[sqlKey].data = data;
this.setState({ sqlKeys });
......@@ -1101,7 +1071,6 @@ export default class TableCom extends Component {
};
}
let obj = {};
if (!isEdit && fatherCode) {
obj = {
......@@ -1123,8 +1092,8 @@ export default class TableCom extends Component {
* 动态生成表单配置函数所使用
*/
let functionObj = {};
formulaList.map(item => {
item.children.map(arr => {
formulaList.map((item) => {
item.children.map((arr) => {
functionObj[arr.callKey] = arr.function;
});
});
......@@ -1171,8 +1140,7 @@ export default class TableCom extends Component {
messageData,
concealModel,
};
}
};
getFunctionValue = (fun, column, json, callback) => {
if (this.props.safe) return;
......@@ -1270,12 +1238,7 @@ export default class TableCom extends Component {
};
componentDidMount() {
const {
json,
mapData,
obj,
init
} = this.props;
const { json, mapData, obj, init } = this.props;
if (json == null) {
return;
}
......@@ -1284,7 +1247,7 @@ export default class TableCom extends Component {
dispatch({
type: 'SqlManageEntity/find',
payload: { sqlKey: json.sqlKey },
callback: res => {
callback: (res) => {
this.setState({ sqlContent: res.sql });
},
});
......@@ -1320,13 +1283,7 @@ export default class TableCom extends Component {
}
fetchData3 = (obj, dataColumn, init, json, allValues) => {
const {
sqlKey,
labelName,
valueName,
isMeta,
filterSql
} = json;
const { sqlKey, labelName, valueName, isMeta, filterSql } = json;
if (isMeta) {
// 2022年7月5日 2022 姚鑫国说的 如果是元数据 不需要传这个allValues
// 解决禅道bug 28017
......@@ -1349,7 +1306,7 @@ export default class TableCom extends Component {
dispatch({
type: 'DataColumn/getSqlOptions',
payload: params,
callback: options => {
callback: (options) => {
const optionsx = [];
let base52 = dataColumn.base52;
let vl = this.props.form.getFieldsValue()[base52];
......@@ -1401,7 +1358,7 @@ export default class TableCom extends Component {
dispatch({
type: 'DataColumn/getSqlLabels',
payload: params,
callback: labels => {
callback: (labels) => {
this.setState({
getSqlOptionsCache,
labels,
......@@ -1426,7 +1383,7 @@ export default class TableCom extends Component {
dispatch({
type: 'DataColumn/getSqlOptions',
payload: params,
callback: options => {
callback: (options) => {
// console.log(options);
let base52 = dataColumn.base52;
let vl = this.props.form.getFieldsValue()[base52];
......@@ -1509,7 +1466,7 @@ export default class TableCom extends Component {
filterSql,
allValues,
},
callback: options => {
callback: (options) => {
const optionsx = [];
for (var i = 0; i < options.length; i++) {
optionsx.push({
......@@ -1533,7 +1490,7 @@ export default class TableCom extends Component {
filterSql,
allValues,
},
callback: labels => {
callback: (labels) => {
this.setState({
labels,
selectDis: false,
......@@ -1549,7 +1506,7 @@ export default class TableCom extends Component {
filterSql,
allValues,
},
callback: options => {
callback: (options) => {
const optionsx = [];
for (var i = 0; i < options.length; i++) {
optionsx.push({
......@@ -1565,11 +1522,8 @@ export default class TableCom extends Component {
});
}
};
getColumn = key => {
let {
mapData,
json
} = this.props;
getColumn = (key) => {
let { mapData, json } = this.props;
const columnIds = json?.columnIds;
......@@ -1621,24 +1575,13 @@ export default class TableCom extends Component {
...getActiveJson(formKey, uuid),
};
}
// if(uuid === 'violation_type_id'){
// console.log(formKey, json);
// if (uuid === 'violation_type_id') {
// console.log(formKey, json.options);
// }
const {
options,
labels,
selectDis,
modalCode,
modalTitle,
modalInit,
modalProps
} = this.state;
const {
getFieldDecorator,
getFieldError,
getFieldProps
} = this.props.form;
const { options, labels, selectDis, modalCode, modalTitle, modalInit, modalProps } = this.state;
const { getFieldDecorator, getFieldError, getFieldProps } = this.props.form;
const disabled = json != null ? json.disabled : false;
const permRank = json != null ? (json.permRank != null ? json.permRank : 0) : 0;
if (json?.label === '账号') {
......@@ -1661,7 +1604,7 @@ export default class TableCom extends Component {
) {
return <></>;
}
return <QRCode {...this.state.option} key={uuid}/>;
return <QRCode {...this.state.option} key={uuid} />;
}
if (json.comName == 'Echart') {
return (
......@@ -1677,7 +1620,7 @@ export default class TableCom extends Component {
);
}
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') {
......@@ -1692,7 +1635,7 @@ export default class TableCom extends Component {
<>
{this.props.form.getFieldDecorator(uuid, {
initialValue: fk,
})(<Input type="hidden"/>)}{' '}
})(<Input type="hidden" />)}{' '}
<ZdyTable
taskId={this.props.taskId}
importExcel={this.props.importExcel}
......@@ -1746,8 +1689,7 @@ export default class TableCom extends Component {
style={{
textAlign: 'center',
height: value == null ? 20 : null,
}}
>
}}>
{value}
</div>
);
......@@ -1768,14 +1710,13 @@ export default class TableCom extends Component {
<>
{this.props.form.getFieldDecorator(uid, {
initialValue: obj[uuid] || json.initialValue,
})(<Input type="hidden"/>)}
})(<Input type="hidden" />)}
<span
style={{
fontWeight: get === 'mobile' ? 'bold' : '',
marginRight: get === 'mobile' ? 12 : '',
}}
{...json.props}
>
{...json.props}>
{obj[uuid] || json.initialValue}
</span>
</>
......@@ -1785,14 +1726,13 @@ export default class TableCom extends Component {
<>
{this.props.form.getFieldDecorator(uid, {
initialValue: this.props.form.getFieldsValue()[uid] || json.initialValue,
})(<Input type="hidden"/>)}
})(<Input type="hidden" />)}
<span
style={{
fontWeight: get === 'mobile' ? 'bold' : '',
marginRight: get === 'mobile' ? 12 : '',
}}
{...json.props}
>
{...json.props}>
{this.props.form.getFieldsValue()[uid]}
</span>
</>
......@@ -1834,7 +1774,7 @@ export default class TableCom extends Component {
cm = (
<span style={{ paddingRight: get === 'mobile' ? 8 : '' }}>
{value}
{get === 'mobile' ? <br/> : ''}
{get === 'mobile' ? <br /> : ''}
</span>
);
break;
......@@ -1842,7 +1782,7 @@ export default class TableCom extends Component {
cm = (
<span>
{value}
{get === 'mobile' ? <br/> : ''}
{get === 'mobile' ? <br /> : ''}
</span>
);
......@@ -1860,7 +1800,7 @@ export default class TableCom extends Component {
cm = (
<span style={{ paddingRight: get == 'mobile' ? 8 : '' }}>
{value}
{get === 'mobile' ? <br/> : ''}
{get === 'mobile' ? <br /> : ''}
</span>
);
......@@ -1869,7 +1809,7 @@ export default class TableCom extends Component {
cm = (
<span>
{value}
{get === 'mobile' ? <br/> : ''}
{get === 'mobile' ? <br /> : ''}
</span>
);
......@@ -1877,9 +1817,8 @@ export default class TableCom extends Component {
case 'DatePicker':
cm = value ? (
<span>
{moment(parseInt(value))
.format('YYYY-MM-DD HH:mm:ss')}
{get === 'mobile' ? <br/> : ''}
{moment(parseInt(value)).format('YYYY-MM-DD HH:mm:ss')}
{get === 'mobile' ? <br /> : ''}
</span>
) : (
''
......@@ -1901,7 +1840,7 @@ export default class TableCom extends Component {
);
})}
</ul>
{get === 'mobile' ? <br/> : ''}
{get === 'mobile' ? <br /> : ''}
</>
);
......@@ -1921,7 +1860,7 @@ export default class TableCom extends Component {
);
})}
</ul>
{get === 'mobile' ? <br/> : ''}
{get === 'mobile' ? <br /> : ''}
</>
);
......@@ -1946,7 +1885,7 @@ export default class TableCom extends Component {
height: json.height,
}}
/>
{get === 'mobile' ? <br/> : ''}
{get === 'mobile' ? <br /> : ''}
</>
);
}
......@@ -1972,7 +1911,7 @@ export default class TableCom extends Component {
height: json.height,
}}
/>
{get === 'mobile' ? <br/> : ''}
{get === 'mobile' ? <br /> : ''}
</>
);
}
......@@ -1989,8 +1928,7 @@ export default class TableCom extends Component {
isPreview={isPreview}
labelCol={{ span: json.mLabelSpan || json.labelSpan }}
wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }}
label={json.label ? json.label : sqlData[key] ? sqlData[key].title : ''}
>
label={json.label ? json.label : sqlData[key] ? sqlData[key].title : ''}>
{cm}
</MobileItem>
);
......@@ -2001,13 +1939,12 @@ export default class TableCom extends Component {
isPreview={isPreview}
labelCol={{ span: json.mLabelSpan || json.labelSpan }}
wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }}
label={json.label ? json.label : sqlData[key] ? sqlData[key].title : ''}
>
label={json.label ? json.label : sqlData[key] ? sqlData[key].title : ''}>
{cm}
</MobileItem>
{this.props.form.getFieldDecorator(`defaultValues.${formKey}.${key}`, {
initialValue: value,
})(<Input type="hidden"/>)}
})(<Input type="hidden" />)}
</>
);
}
......@@ -2020,7 +1957,7 @@ export default class TableCom extends Component {
{cm}
{this.props.form.getFieldDecorator(`defaultValues.${formKey}.${key}`, {
initialValue: value,
})(<Input type="hidden"/>)}
})(<Input type="hidden" />)}
</>
);
}
......@@ -2034,8 +1971,7 @@ export default class TableCom extends Component {
style={{
minHeight: 40,
lineHeight: '40px',
}}
>
}}>
<Col
className={json.label ? json.label : sqlData[key] ? styles.row_col_div : ''}
span={json.labelSpan}
......@@ -2046,8 +1982,7 @@ export default class TableCom extends Component {
overflow: 'hidden',
fontSize: 14,
color: 'rgba(0,0,0,0.85)',
}}
>
}}>
{json.label ? (
<>
{json.label}
......@@ -2056,8 +1991,7 @@ export default class TableCom extends Component {
position: 'relative',
top: '-0.5px',
margin: '0 8px 0 2px',
}}
>
}}>
:
</span>
</>
......@@ -2069,8 +2003,7 @@ export default class TableCom extends Component {
position: 'relative',
top: '-0.5px',
margin: '0 8px 0 2px',
}}
>
}}>
:
</span>
</>
......@@ -2085,8 +2018,7 @@ export default class TableCom extends Component {
lineHeight: '40px',
zoom: 1,
fontSize: 14,
}}
>
}}>
{cm}
</Col>
</Row>
......@@ -2096,8 +2028,7 @@ export default class TableCom extends Component {
<Form.Item
labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }}
label={json.label ? json.label : sqlData[key] ? sqlData[key].title : ''}
>
label={json.label ? json.label : sqlData[key] ? sqlData[key].title : ''}>
{cm}
</Form.Item>
);
......@@ -2108,13 +2039,12 @@ export default class TableCom extends Component {
<Form.Item
labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }}
label={json.label ? json.label : sqlData[key] ? sqlData[key].title : ''}
>
label={json.label ? json.label : sqlData[key] ? sqlData[key].title : ''}>
{cm}
</Form.Item>
{this.props.form.getFieldDecorator(`defaultValues.${formKey}.${key}`, {
initialValue: value,
})(<Input type="hidden"/>)}
})(<Input type="hidden" />)}
</>
);
}
......@@ -2127,7 +2057,7 @@ export default class TableCom extends Component {
{cm}
{this.props.form.getFieldDecorator(`defaultValues.${formKey}.${key}`, {
initialValue: value,
})(<Input type="hidden"/>)}
})(<Input type="hidden" />)}
</>
);
}
......@@ -2206,19 +2136,22 @@ export default class TableCom extends Component {
case 'MobileCard':
let value = obj[dataColumn.base52];
if (!value || value === 'null') {
return <div/>;
return <div />;
}
cm = <MobileCard value={value}
cm = (
<MobileCard
value={value}
json={json}
getArguments={this.functionArguments}
tableComProps={this.props}
dataColumn={dataColumn}
/>;
/>
);
break;
case 'WangEditor':
let textV = obj[dataColumn.base52];
if (!textV || textV === 'null') {
return <div/>;
return <div />;
}
cm = (
<div
......@@ -2235,8 +2168,7 @@ ${obj[dataColumn.base52]}
<span
style={{
wordBreak: 'break-all',
}}
>
}}>
{obj[dataColumn.base52]}
</span>
);
......@@ -2252,8 +2184,7 @@ ${obj[dataColumn.base52]}
data-obj-comname={'Input'}
style={{
wordBreak: 'break-all',
}}
>
}}>
{obj[dataColumn.base52]}
</span>
);
......@@ -2282,7 +2213,8 @@ ${obj[dataColumn.base52]}
cm = (
<span>
{labels != null
? labels.map((r, i) =>
? labels.map(
(r, i) =>
i == 0 ? (
typeof r == 'string' ? (
<span>{r}</span>
......@@ -2305,6 +2237,12 @@ ${obj[dataColumn.base52]}
let stringLabels = labels != null && labels.length > 0 ? labels.join(' ') : '';
if (Array.isArray(labels) && labels.length && typeof labels[0] === 'object') {
stringLabels = Object.values(labels[0]);
}
if(!stringLabels && Array.isArray(json.options) && obj[dataColumn.base52]){
let findLabels = json.options.find((g) => obj[dataColumn.base52] === g.value);
if(findLabels){
stringLabels = findLabels.label;
}
}
cm = <span>{stringLabels}</span>;
......@@ -2354,13 +2292,11 @@ ${obj[dataColumn.base52]}
} else {
cm = (
<span>
{moment(parseInt(obj[begin.base52]))
.format(
{moment(parseInt(obj[begin.base52])).format(
json.format ? json.format : 'YYYY-MM-DD HH:mm:ss',
)}{' '}
{' '}
{moment(parseInt(obj[end.base52]))
.format(
{moment(parseInt(obj[end.base52])).format(
json.format ? json.format : 'YYYY-MM-DD HH:mm:ss',
)}
</span>
......@@ -2376,16 +2312,14 @@ ${obj[dataColumn.base52]}
if (vTime && typeof vTime === 'string' && vTime.indexOf('-') <= -1) {
cm = (
<span>
{moment(parseInt(vTime))
.format(json.format ? json.format : 'YYYY-MM-DD HH:mm:ss')}
{moment(parseInt(vTime)).format(json.format ? json.format : 'YYYY-MM-DD HH:mm:ss')}
</span>
);
} else {
cm = (
<span>
{vTime
? moment(+new Date(vTime))
.format(
? moment(+new Date(vTime)).format(
json.format ? json.format : 'YYYY-MM-DD HH:mm:ss',
)
: ''}
......@@ -2536,8 +2470,7 @@ ${obj[dataColumn.base52]}
display: 'inline-block',
width: '100%',
textAlign: 'center',
}}
>
}}>
暂无附件
</span>
);
......@@ -2623,14 +2556,14 @@ ${obj[dataColumn.base52]}
marginLeft: 5,
width:
get === 'mobile'
? document.documentElement.clientWidth - 10 || document.body.clientWidth - 10
? document.documentElement.clientWidth - 10 ||
document.body.clientWidth - 10
: json.width,
height: get === 'mobile' ? '' : json.height,
}}
/>
);
}
}
break;
......@@ -2807,15 +2740,14 @@ ${obj[dataColumn.base52]}
],
})}
disabled={disabled}
onClick={checked => {
onClick={(checked) => {
// set new value
this.props.form.setFieldsValue({
[dataColumn.base52]: checked,
});
}}
/>
}
>
}>
{(json.isMobileLabel != null && json.isMobileLabel) ||
(json.isMobileLabel == null && json.isLabel)
? title
......@@ -2836,7 +2768,7 @@ ${obj[dataColumn.base52]}
message: '请选择' + title,
},
],
})(<SwitchWeb json={json} disabled={disabled}/>);
})(<SwitchWeb json={json} disabled={disabled} />);
break;
case 'TextArea':
......@@ -2877,8 +2809,7 @@ ${obj[dataColumn.base52]}
isPreview={isPreview}
labelCol={{ span: json.mLabelSpan || json.labelSpan }}
wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }}
label={title}
>
label={title}>
{cm}
</MobileItem>
);
......@@ -2915,10 +2846,7 @@ ${obj[dataColumn.base52]}
otherProps = {};
}
}
const {
disabledInputStyle = {},
addonAfter
} = otherProps;
const { disabledInputStyle = {}, addonAfter } = otherProps;
let inputStyle = {
width: json.width,
};
......@@ -2957,8 +2885,7 @@ ${obj[dataColumn.base52]}
isPreview={isPreview}
labelCol={{ span: json.mLabelSpan || json.labelSpan }}
wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }}
label={title}
>
label={title}>
{cm}
</MobileItem>
);
......@@ -2968,7 +2895,7 @@ ${obj[dataColumn.base52]}
case 'InputHidden':
cm = getFieldDecorator(dataColumn.base52, {
initialValue: initValue,
})(<Input type="hidden"/>);
})(<Input type="hidden" />);
break;
case 'InputNumber':
if (json?.otherProps) {
......@@ -3013,8 +2940,7 @@ ${obj[dataColumn.base52]}
isPreview={isPreview}
labelCol={{ span: json.mLabelSpan || json.labelSpan }}
wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }}
label={title}
>
label={title}>
{cm}
</MobileItem>
);
......@@ -3037,7 +2963,7 @@ ${obj[dataColumn.base52]}
message: '请选择' + dataColumn.title,
},
],
})(<Radio.Group options={options} disabled={disabled}/>);
})(<Radio.Group options={options} disabled={disabled} />);
if (get == 'mobile') {
cm = <div>{cm}</div>;
if (
......@@ -3050,8 +2976,7 @@ ${obj[dataColumn.base52]}
isPreview={isPreview}
labelCol={{ span: json.mLabelSpan || json.labelSpan }}
wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }}
label={title}
>
label={title}>
{cm}
</MobileItem>
);
......@@ -3077,7 +3002,7 @@ ${obj[dataColumn.base52]}
message: '请选择' + dataColumn.title,
},
],
})(<Checkbox.Group options={options} disabled={disabled}/>)}
})(<Checkbox.Group options={options} disabled={disabled} />)}
</Flex>
);
......@@ -3091,8 +3016,7 @@ ${obj[dataColumn.base52]}
isPreview={isPreview}
labelCol={{ span: json.mLabelSpan || json.labelSpan }}
wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }}
label={title}
>
label={title}>
{cm}
</MobileItem>
);
......@@ -3130,9 +3054,16 @@ ${obj[dataColumn.base52]}
otherProps = {};
}
}
console.log(initValue);
// if (uuid === 'violation_type_id') {
// console.log(json.options);
// }
const optionsDiy = Array.isArray(json.options)
? json.options
: Array.isArray(options)
? options
: [];
cm = getFieldDecorator(dataColumn.base52, {
initialValue: !initValue && otherProps?.mode === 'multiple' ? undefined : initValue ,
initialValue: !initValue && otherProps?.mode === 'multiple' ? undefined : initValue,
rules:
json.vlds && json.vlds.length > 0
? json.vlds
......@@ -3156,7 +3087,7 @@ ${obj[dataColumn.base52]}
? setTimeout(() => {
if (document.querySelectorAll(`.ant-select-search__field`).length > 0) {
let ary = [...document.querySelectorAll(`.ant-select-search__field`)];
ary.map(item => {
ary.map((item) => {
item.setAttribute('readonly', 'readonly');
// setTimeout(() => {
// ary.map(arr => {
......@@ -3170,27 +3101,17 @@ ${obj[dataColumn.base52]}
}}
filterOption={(input, option) =>
option
? option.props.children.toLowerCase()
.indexOf(input.toLowerCase()) >= 0
? option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
: false
}
{...otherProps}
>
{json.options && Array.isArray(json.options)
? json.options.map(r => {
{...otherProps}>
{optionsDiy.map((r) => {
return (
<Option key={r.value} value={r.value}>
{r.label}
</Option>
);
})
: options && options instanceof Array
? options.map(r => (
<Option key={r.value} value={r.value}>
{r.label}
</Option>
))
: ''}
})}
</Select>,
);
if (
......@@ -3204,8 +3125,7 @@ ${obj[dataColumn.base52]}
isPreview={isPreview}
labelCol={{ span: json.mLabelSpan || json.labelSpan }}
wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }}
label={title}
>
label={title}>
{cm}
</MobileItem>
);
......@@ -3228,8 +3148,7 @@ ${obj[dataColumn.base52]}
}
const filterF = function filter(inputValue, path) {
return path.some(
option => option?.label?.toLowerCase()
?.indexOf(inputValue.toLowerCase()) > -1,
(option) => option?.label?.toLowerCase()?.indexOf(inputValue.toLowerCase()) > -1,
);
};
// if(this.props.uuid === 'id_32691685234912400529714267d34dc585a2'){
......@@ -3277,7 +3196,7 @@ ${obj[dataColumn.base52]}
message: '请选择' + dataColumn.title,
},
],
})(<MobileCascader options={options} label={title} disabled={disabled} json={json}/>);
})(<MobileCascader options={options} label={title} disabled={disabled} json={json} />);
}
if (
......@@ -3291,8 +3210,7 @@ ${obj[dataColumn.base52]}
isPreview={isPreview}
labelCol={{ span: json.mLabelSpan || json.labelSpan }}
wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }}
label={title}
>
label={title}>
{cm}
</MobileItem>
);
......@@ -3348,8 +3266,7 @@ ${obj[dataColumn.base52]}
isPreview={isPreview}
labelCol={{ span: json.mLabelSpan || json.labelSpan }}
wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }}
label={title}
>
label={title}>
{cm}
</MobileItem>
);
......@@ -3382,13 +3299,11 @@ ${obj[dataColumn.base52]}
if (!isEdit) {
cm = (
<span>
{moment(parseInt(obj[begin.base52]))
.format(
{moment(parseInt(obj[begin.base52])).format(
json.format ? json.format : 'YYYY-MM-DD HH:mm:ss',
)}{' '}
{' '}
{moment(parseInt(obj[end.base52]))
.format(
{moment(parseInt(obj[end.base52])).format(
json.format ? json.format : 'YYYY-MM-DD HH:mm:ss',
)}
</span>
......@@ -3426,8 +3341,7 @@ ${obj[dataColumn.base52]}
labelCol={{ span: json.mLabelSpan || json.labelSpan }}
wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }}
label={title}
required={required}
>
required={required}>
{cm}
</MobileItem>
);
......@@ -3447,7 +3361,7 @@ ${obj[dataColumn.base52]}
message: '请选择起止时间',
},
],
})(<RangePickerDiy json={json} disabled={disabled} uuid={uuid}/>);
})(<RangePickerDiy json={json} disabled={disabled} uuid={uuid} />);
}
if (json.label == null) title = '起止时间';
break;
......@@ -3501,8 +3415,7 @@ ${obj[dataColumn.base52]}
}
});
}
: () => {
}
: () => {}
}
format={json.format ? json.format : 'YYYY-MM-DD HH:mm:ss'}
{...otherProps}
......@@ -3519,8 +3432,7 @@ ${obj[dataColumn.base52]}
isPreview={isPreview}
labelCol={{ span: json.mLabelSpan || json.labelSpan }}
wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }}
label={title}
>
label={title}>
{cm}
</MobileItem>
);
......@@ -3563,8 +3475,7 @@ ${obj[dataColumn.base52]}
isPreview={isPreview}
labelCol={{ span: json.mLabelSpan || json.labelSpan }}
wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }}
label={title}
>
label={title}>
{cm}
</MobileItem>
);
......@@ -3614,8 +3525,7 @@ ${obj[dataColumn.base52]}
isPreview={isPreview}
labelCol={{ span: json.mLabelSpan || json.labelSpan }}
wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }}
label={title}
>
label={title}>
{cm}
</MobileItem>
);
......@@ -3633,7 +3543,7 @@ ${obj[dataColumn.base52]}
message: '请输入',
},
],
})(<WangEditor json={json} dataColumn={dataColumn} disabled={disabled} uuid={uuid}/>);
})(<WangEditor json={json} dataColumn={dataColumn} disabled={disabled} uuid={uuid} />);
break;
case 'MobileCard':
cm = getFieldDecorator(dataColumn.base52, {
......@@ -3645,7 +3555,8 @@ ${obj[dataColumn.base52]}
getArguments={this.functionArguments}
tableComProps={this.props}
dataColumn={dataColumn}
/>);
/>,
);
break;
case 'RichText':
cm = getFieldDecorator(dataColumn.base52, {
......@@ -3659,7 +3570,7 @@ ${obj[dataColumn.base52]}
message: '请输入',
},
],
})(<DraftEditorCom placeholder={json.placeholder} disabled={json.disabled}/>);
})(<DraftEditorCom placeholder={json.placeholder} disabled={json.disabled} />);
if (
get === 'mobile' &&
((json.isMobileLabel != null && json.isMobileLabel) ||
......@@ -3671,8 +3582,7 @@ ${obj[dataColumn.base52]}
isPreview={isPreview}
labelCol={{ span: json.mLabelSpan || json.labelSpan }}
wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }}
label={title}
>
label={title}>
{cm}
</MobileItem>
);
......@@ -3690,7 +3600,7 @@ ${obj[dataColumn.base52]}
message: '请输入' + title,
},
],
})(<CronEditorDiy/>);
})(<CronEditorDiy />);
break;
case 'LocationCom':
cm = getFieldDecorator(dataColumn.base52, {
......@@ -3706,8 +3616,7 @@ ${obj[dataColumn.base52]}
let errors = [];
console.log(valueThis);
if (
(!valueThis || !JSON.stringify(valueThis)
.includes('address')) &&
(!valueThis || !JSON.stringify(valueThis).includes('address')) &&
required
) {
errors.push(new Error('请获取定位信息', rule.field));
......@@ -3737,15 +3646,16 @@ ${obj[dataColumn.base52]}
isPreview={isPreview}
labelCol={{ span: json.mLabelSpan || json.labelSpan }}
wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }}
label={title}
>
label={title}>
{cm}
</MobileItem>
);
}
break;
case 'ChildForm':
// console.log(datas, json);
if(typeof initValue !== 'object'){
initValue = null;
}
cm = getFieldDecorator(dataColumn.base52, { initialValue: initValue || {} })(
<ChildForm
taskId={this.props.taskId}
......@@ -3787,8 +3697,7 @@ ${obj[dataColumn.base52]}
isPreview={isPreview}
labelCol={{ span: json.mLabelSpan || json.labelSpan }}
wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }}
label={title}
>
label={title}>
{cm}
</MobileItem>
);
......@@ -3806,7 +3715,7 @@ ${obj[dataColumn.base52]}
message: '请上传图片',
},
],
})(<ImgUploadCom json={json} disabled={disabled}/>);
})(<ImgUploadCom json={json} disabled={disabled} />);
if (
get === 'mobile' &&
((json.isMobileLabel != null && json.isMobileLabel) ||
......@@ -3818,8 +3727,7 @@ ${obj[dataColumn.base52]}
isPreview={isPreview}
labelCol={{ span: json.mLabelSpan || json.labelSpan }}
wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }}
label={title}
>
label={title}>
{cm}
</MobileItem>
);
......@@ -3837,7 +3745,7 @@ ${obj[dataColumn.base52]}
message: '请上传视频',
},
],
})(<VideoUploadCom json={json} disabled={disabled}/>);
})(<VideoUploadCom json={json} disabled={disabled} />);
if (
get === 'mobile' &&
((json.isMobileLabel != null && json.isMobileLabel) ||
......@@ -3849,8 +3757,7 @@ ${obj[dataColumn.base52]}
isPreview={isPreview}
labelCol={{ span: json.mLabelSpan || json.labelSpan }}
wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }}
label={title}
>
label={title}>
{cm}
</MobileItem>
);
......@@ -3868,7 +3775,7 @@ ${obj[dataColumn.base52]}
message: '请进行签名',
},
],
})(<Signature width={json.width} height={json.height} get={get}/>);
})(<Signature width={json.width} height={json.height} get={get} />);
if (
get === 'mobile' &&
((json.isMobileLabel != null && json.isMobileLabel) ||
......@@ -3880,8 +3787,7 @@ ${obj[dataColumn.base52]}
isPreview={isPreview}
labelCol={{ span: json.mLabelSpan || json.labelSpan }}
wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }}
label={title}
>
label={title}>
{cm}
</MobileItem>
);
......@@ -3925,15 +3831,13 @@ ${obj[dataColumn.base52]}
margin: 5,
border: '1px solid #ccc',
}}
className={styles.mobileList}
>
className={styles.mobileList}>
{modalCode ? (
<FormModal
{...modalProps}
visible={this.props.DataColumn.isShowModal[modalCode]}
handleCancel={this.closeModal.bind(this, modalCode)}
title={modalTitle}
>
title={modalTitle}>
<ZdyTable
taskId={this.props.taskId}
taskAssignee={taskAssignee}
......@@ -3974,8 +3878,7 @@ ${obj[dataColumn.base52]}
style={{
minHeight: 40,
lineHeight: '40px',
}}
>
}}>
<Col
className={title ? styles.row_col_div : ''}
span={json.labelSpan}
......@@ -3986,8 +3889,7 @@ ${obj[dataColumn.base52]}
overflow: 'hidden',
fontSize: 14,
color: 'rgba(0,0,0,0.85)',
}}
>
}}>
{title}
{title && (
<span
......@@ -3996,8 +3898,7 @@ ${obj[dataColumn.base52]}
position: 'relative',
top: '-0.5px',
margin: '0 8px 0 2px',
}}
>
}}>
:
</span>
)}
......@@ -4009,8 +3910,7 @@ ${obj[dataColumn.base52]}
lineHeight: '40px',
zoom: 1,
fontSize: 14,
}}
>
}}>
{cm}
</Col>
{modalCode ? (
......@@ -4018,8 +3918,7 @@ ${obj[dataColumn.base52]}
{...modalProps}
visible={this.props.DataColumn.isShowModal[modalCode]}
handleCancel={this.closeModal.bind(this, modalCode)}
title={modalTitle}
>
title={modalTitle}>
<ZdyTable
taskId={this.props.taskId}
taskAssignee={taskAssignee}
......@@ -4055,8 +3954,7 @@ ${obj[dataColumn.base52]}
{...modalProps}
visible={this.props.DataColumn.isShowModal[modalCode]}
handleCancel={this.closeModal.bind(this, modalCode)}
title={modalTitle}
>
title={modalTitle}>
<ZdyTable
taskId={this.props.taskId}
taskAssignee={taskAssignee}
......@@ -4086,9 +3984,8 @@ ${obj[dataColumn.base52]}
labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }}
label={title}
data-cell-component-name={json.comName || 'no_com'}
>
<ShowComName json={json}/>
data-cell-component-name={json.comName || 'no_com'}>
<ShowComName json={json} />
{cm}
</Form.Item>
</>
......@@ -4102,8 +3999,7 @@ ${obj[dataColumn.base52]}
{...modalProps}
visible={this.props.DataColumn.isShowModal[modalCode]}
handleCancel={this.closeModal.bind(this, modalCode)}
title={modalTitle}
>
title={modalTitle}>
<ZdyTable
taskId={this.props.taskId}
taskAssignee={taskAssignee}
......@@ -4141,8 +4037,7 @@ ${obj[dataColumn.base52]}
{...modalProps}
visible={this.props.DataColumn.isShowModal[modalCode]}
handleCancel={this.closeModal.bind(this, modalCode)}
title={modalTitle}
>
title={modalTitle}>
<ZdyTable
taskId={this.props.taskId}
taskAssignee={taskAssignee}
......@@ -4172,8 +4067,7 @@ ${obj[dataColumn.base52]}
isPreview={isPreview}
labelCol={{ span: json.mLabelSpan || json.labelSpan }}
wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }}
label={title}
>
label={title}>
{cm}
</MobileItem>
) : isEdit && get == 'web' ? (
......@@ -4181,14 +4075,13 @@ ${obj[dataColumn.base52]}
<Form.Item
labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }}
label={title}
>
<ShowComName json={json}/>
label={title}>
<ShowComName json={json} />
{cm}
</Form.Item>
) : (
<Form.Item>
<ShowComName json={json}/>
<ShowComName json={json} />
{cm}
</Form.Item>
)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论