提交 1bb62ce7 authored 作者: tb53863844's avatar tb53863844

开发

上级 899dcf0d
......@@ -415,9 +415,9 @@ export default class tableCom extends Component {
onFilter: (value, record) =>
record[dataIndex]
? record[dataIndex]
.toString()
.toLowerCase()
.includes(value.toLowerCase())
.toString()
.toLowerCase()
.includes(value.toLowerCase())
: '',
onFilterDropdownVisibleChange: visible => {
if (visible) {
......@@ -490,7 +490,7 @@ export default class tableCom extends Component {
if (this.count.length > 10) {
console.log(
`页面${this.props.currentFormTitle} ${this.props.formKey} ${json.comName}${this.props.i + 1}行,第${this.props.j +
1}列:存在循环风险,1秒内执行超过10次,现已停止执行,请检查,`,
1}列:存在循环风险,1秒内执行超过10次,现已停止执行,请检查,`,
);
return;
......@@ -512,9 +512,9 @@ export default class tableCom extends Component {
this.props.fatherCode != null
? bindObj
? {
...bindObj,
base52: `${this.props.fatherCode}.[${this.props.index}].${bindObj.base52}`,
}
...bindObj,
base52: `${this.props.fatherCode}.[${this.props.index}].${bindObj.base52}`,
}
: { base52: `${this.props.fatherCode}.[${this.props.index}].${this.props.uuid}` }
: bindObj;
if (this.props.fatherCode == null && dataColumn == null)
......@@ -754,7 +754,7 @@ export default class tableCom extends Component {
} catch (e) {
console.log(
`页面${this.props.currentFormTitle} ${this.props.formKey} ${json.comName}${this.props.i + 1}行,第${this.props.j +
1}列:公式配置有误,回调函数内部错误,`,
1}列:公式配置有误,回调函数内部错误,`,
e,
);
}
......@@ -810,12 +810,12 @@ export default class tableCom extends Component {
} catch (e) {
console.log(
`页面${this.props.currentFormTitle} ${this.props.formKey} ${json.comName}${this.props.i + 1}行,第${this.props.j +
1}列:公式配置有误,回调函数内部错误,`,
1}列:公式配置有误,回调函数内部错误,`,
e,
);
//message.error(`页面${this.props.formKey}第${this.props.i + 1}行,第${this.props.j + 1}列:公式配置有误,回调函数内部错误${e}`, 10)
}
} else if (json.comName == 'Echart' || json.comName == 'QRCode'|| json.comName == 'Graph') {
} else if (json.comName == 'Echart' || json.comName == 'QRCode' || json.comName == 'Graph') {
try {
const x = callback(data);
if (x != null) {
......@@ -824,7 +824,7 @@ export default class tableCom extends Component {
} catch (e) {
console.log(
`页面${this.props.currentFormTitle} ${this.props.formKey} ${json.comName}${this.props.i + 1}行,第${this.props.j +
1}列:公式配置有误,回调函数内部错误,`,
1}列:公式配置有误,回调函数内部错误,`,
e,
);
}
......@@ -836,7 +836,7 @@ export default class tableCom extends Component {
} catch (e) {
console.log(
`页面${this.props.formKey} ${json.comName}${this.props.i + 1}行,第${this.props.j +
1}列:公式配置有误,回调函数内部错误,`,
1}列:公式配置有误,回调函数内部错误,`,
e,
);
}
......@@ -845,82 +845,83 @@ export default class tableCom extends Component {
}
return 'norefeshxxxxxxxxxxxxxxxxxxxx';
}
this.setState({}, () => {
for (let i in params) {
if (params[i] == null) {
delete params[i];
}
}
if (getToken() != null) {
params.token = getToken();
for (let i in params) {
if (params[i] == null) {
delete params[i];
}
}
if (getToken() != null) {
params.token = getToken();
}
const requestParams = params;
const umiRequest = extend({
errorHandler, // 默认错误处理
credentials: 'omit', // 默认请求是否带上cookie
mode: 'cors',
...options,
});
umiRequest(url, {
data: requestParams,
method: method,
requestType: 'form',
}).then(data => {
const { reqUrls } = this.state;
reqUrls[url].data = data;
this.setState({ res: data, reqUrls }, () => {
if (callback) {
if (json.optionType && json.optionType == 'func') {
const res = callback(data);
if (res != null && !(typeof res === 'function')) {
this.setState({ options: res, selectDis: false }, () => {
if (orgCallback) orgCallback();
});
}
} else if (json.comName == 'Button') {
try {
callback(data);
} catch (e) {
console.log(
`页面${this.props.currentFormTitle} ${this.props.formKey} ${json.comName}${this.props.i + 1}行,第${this.props.j +
1}列:公式配置有误,回调函数内部错误,`,
e,
);
const requestParams = params;
const umiRequest = extend({
errorHandler, // 默认错误处理
credentials: 'omit', // 默认请求是否带上cookie
mode: 'cors',
...options,
});
umiRequest(url, {
data: requestParams,
method: method,
requestType: 'form',
}).then(data => {
const { reqUrls } = this.state;
reqUrls[url].data = data;
this.setState({ res: data, reqUrls }, () => {
if (callback) {
if (json.optionType && json.optionType == 'func') {
const res = callback(data);
if (res != null && !(typeof res === 'function')) {
this.setState({ options: res, selectDis: false }, () => {
if (orgCallback) orgCallback();
});
}
} else if (json.comName == 'Button') {
try {
callback(data);
} catch (e) {
console.log(
`页面${this.props.currentFormTitle} ${this.props.formKey} ${json.comName}${this.props.i + 1}行,第${this.props.j +
1}列:公式配置有误,回调函数内部错误,`,
e,
);
}
} else if (json.comName == 'Echart' || json.comName == 'QRCode' || json.comName == 'Graph') {
try {
const x = callback(data);
if (x != null) {
this.setState({ option: x });
}
} else if (json.comName == 'Echart' || json.comName == 'QRCode'|| json.comName == 'Graph') {
} catch (e) {
console.log(
`页面${this.props.currentFormTitle} ${this.props.formKey} ${json.comName}${this.props.i + 1}行,第${this.props.j +
1}列:公式配置有误,回调函数内部错误,`,
e,
);
}
} else {
if (base52) {
try {
const x = callback(data);
if (x != null) {
this.setState({ option: x });
}
if (x == null || x != 'NaN') this.props.form.setFieldsValue({ [base52]: x });
} catch (e) {
console.log(
`页面${this.props.currentFormTitle} ${this.props.formKey} ${json.comName}${this.props.i + 1}行,第${this.props.j +
1}列:公式配置有误,回调函数内部错误,`,
1}列:公式配置有误,回调函数内部错误,`,
e,
);
}
} else {
if (base52) {
try {
const x = callback(data);
if (x == null || x != 'NaN') this.props.form.setFieldsValue({ [base52]: x });
} catch (e) {
console.log(
`页面${this.props.currentFormTitle} ${this.props.formKey} ${json.comName}${this.props.i + 1}行,第${this.props.j +
1}列:公式配置有误,回调函数内部错误,`,
e,
);
}
}
}
}
});
}
});
});
return 'norefeshxxxxxxxxxxxxxxxxxxxx';
};
sqlUtil = (base52, json, orgCallback, sqlKey, params, callback, options = {}) => {
......@@ -941,8 +942,23 @@ export default class tableCom extends Component {
}
}
}
if (!isChange) {
const os = sqlKeys[sqlKey].options;
if (Object.keys(options).length != Object.keys(os).length) {
isChange = true;
} else {
for (var k in options) {
if (os[k] == null || options[k] != os[k]) {
isChange = true;
break;
}
}
}
}
} else {
sqlKeys[sqlKey] = { params: params };
sqlKeys[sqlKey] = { params: params, options: options };
isChange = true;
}
if (!isChange) {
......@@ -961,11 +977,11 @@ export default class tableCom extends Component {
} catch (e) {
console.log(
`页面${this.props.currentFormTitle} ${this.props.formKey} ${json.comName}${this.props.i + 1}行,第${this.props.j +
1}列:公式配置有误,回调函数内部错误,`,
1}列:公式配置有误,回调函数内部错误,`,
e,
);
}
} else if (json.comName == 'Echart' || json.comName == 'QRCode'||json.comName == 'Graph') {
} else if (json.comName == 'Echart' || json.comName == 'QRCode' || json.comName == 'Graph') {
try {
const x = callback(data);
if (x != null) {
......@@ -974,7 +990,7 @@ export default class tableCom extends Component {
} catch (e) {
console.log(
`页面${this.props.currentFormTitle} ${this.props.formKey} ${json.comName}${this.props.i + 1}行,第${this.props.j +
1}列:公式配置有误,回调函数内部错误,`,
1}列:公式配置有误,回调函数内部错误,`,
e,
);
}
......@@ -986,7 +1002,7 @@ export default class tableCom extends Component {
} catch (e) {
console.log(
`页面${this.props.currentFormTitle} ${this.props.formKey} ${json.comName}${this.props.i + 1}行,第${this.props.j +
1}列:公式配置有误,回调函数内部错误,`,
1}列:公式配置有误,回调函数内部错误,`,
e,
);
}
......@@ -996,14 +1012,14 @@ export default class tableCom extends Component {
return 'norefeshxxxxxxxxxxxxxxxxxxxx';
}
const url = queryApiActionPath() + '/DataColumnApi/getSqlData';
this.setState({ sqlKeys }, () => {
const umiRequest = extend({
errorHandler, // 默认错误处理
credentials: options.credentials||'omit', // 默认请求是否带上cookie
mode: options.mode||'cors'
credentials: options.credentials || 'omit', // 默认请求是否带上cookie
mode: options.mode || 'cors'
});
const allValues = JSON.stringify({
...this.props.obj,
......@@ -1015,7 +1031,7 @@ export default class tableCom extends Component {
if (getToken() != null) {
pp.token = getToken();
}
umiRequest(url, {
data: pp,
method: 'POST',
......@@ -1043,11 +1059,11 @@ export default class tableCom extends Component {
} catch (e) {
console.log(
`页面${this.props.currentFormTitle} ${this.props.formKey} ${json.comName}${this.props.i + 1}行,第${this.props.j +
1}列:公式配置有误,回调函数内部错误,`,
1}列:公式配置有误,回调函数内部错误,`,
e,
);
}
} else if (json.comName == 'Echart' || json.comName == 'QRCode'||json.comName=="Graph") {
} else if (json.comName == 'Echart' || json.comName == 'QRCode' || json.comName == "Graph") {
try {
const x = callback(data);
if (x != null) {
......@@ -1056,7 +1072,7 @@ export default class tableCom extends Component {
} catch (e) {
console.log(
`页面${this.props.currentFormTitle} ${this.props.formKey} ${json.comName}${this.props.i + 1}行,第${this.props.j +
1}列:公式配置有误,回调函数内部错误,`,
1}列:公式配置有误,回调函数内部错误,`,
e,
);
}
......@@ -1068,7 +1084,7 @@ export default class tableCom extends Component {
} catch (e) {
console.log(
`页面${this.props.currentFormTitle} ${this.props.formKey} ${json.comName}${this.props.i + 1}行,第${this.props.j +
1}列:公式配置有误,回调函数内部错误,`,
1}列:公式配置有误,回调函数内部错误,`,
e,
);
}
......@@ -1082,7 +1098,7 @@ export default class tableCom extends Component {
};
getFunctionValue = (fun, column, json, callback) => {
if(this.props.safe) return
if (this.props.safe) return
const base52 = column.base52;
/**
......@@ -1121,7 +1137,7 @@ export default class tableCom extends Component {
};
} else {
obj = {
...(this.props.fatherObj?this.props.fatherObj:{}),
...(this.props.fatherObj ? this.props.fatherObj : {}),
...this.props.obj,
...this.props.form.getFieldsValue(),
...this.props.defaultValues[this.props.formKey],
......@@ -1147,7 +1163,7 @@ export default class tableCom extends Component {
moment: moment,
sql: this.sqlUtil.bind(this, base52, json, callback),
message: message,
importExcel:this.props.importExcel,
importExcel: this.props.importExcel,
router: router,
uuid: UUID,
setValues: this.setValues.bind(this, base52, json),
......@@ -1182,7 +1198,7 @@ export default class tableCom extends Component {
if (callback) callback();
});
}
} else if (json.comName == 'Echart' || json.comName == 'QRCode'||json.comName == 'Graph' ) {
} else if (json.comName == 'Echart' || json.comName == 'QRCode' || json.comName == 'Graph') {
this.setState({ option: value });
} else {
try {
......@@ -1190,7 +1206,7 @@ export default class tableCom extends Component {
} catch {
console.log(
`页面${this.props.currentFormTitle} ${this.props.formKey} ${json.comName}${this.props.i + 1}行,第${this.props.j +
1}列:公式配置有误,函数内部错误,`,
1}列:公式配置有误,函数内部错误,`,
e,
);
}
......@@ -1200,7 +1216,7 @@ export default class tableCom extends Component {
} catch (e) {
console.log(
`页面${this.props.currentFormTitle} ${this.props.formKey} ${json.comName}${this.props.i + 1}行,第${this.props.j +
1}列:公式配置有误,暂存失败,`,
1}列:公式配置有误,暂存失败,`,
e,
);
}
......@@ -1227,9 +1243,9 @@ export default class tableCom extends Component {
this.props.fatherCode != null
? bindObj
? {
...bindObj,
base52: `${this.props.fatherCode}.[${this.props.index}].${bindObj.base52}`,
}
...bindObj,
base52: `${this.props.fatherCode}.[${this.props.index}].${bindObj.base52}`,
}
: { base52: `${this.props.fatherCode}.[${this.props.index}].${this.props.uuid}` }
: bindObj;
if (this.props.fatherCode == null && dataColumn == null)
......@@ -1428,7 +1444,7 @@ export default class tableCom extends Component {
isEdit,
datas,
taskAssignee,
userId,i,
userId, i,
j,
isPreview,
currentFormTitle,
......@@ -1474,7 +1490,7 @@ export default class tableCom extends Component {
<Neo4jD3Com
key={this.props.uuid}
json={json}
option={this.state.option || []}/>
option={this.state.option || []} />
);
}
......@@ -1495,7 +1511,7 @@ export default class tableCom extends Component {
})(<Input type="hidden" />)}{' '}
<ZdyTable
hfInstance={this.props.hfInstance}
currentFormTitle={this.props.getCurrentFormTitle?this.props.getCurrentFormTitle(fk):null}
currentFormTitle={this.props.getCurrentFormTitle ? this.props.getCurrentFormTitle(fk) : null}
getCellValue={getCellValue}
taskAssignee={taskAssignee}
isWebPrint={this.props.isWebPrint || false}
......@@ -1521,9 +1537,9 @@ export default class tableCom extends Component {
</>
);
}
if(json.comName=='Excel'){
const value= getCellValue(i,j,currentFormTitle)
const xx=<div style={{textAlign:"center",height:value==null?20:null}}>{value}</div>
if (json.comName == 'Excel') {
const value = getCellValue(i, j, currentFormTitle)
const xx = <div style={{ textAlign: "center", height: value == null ? 20 : null }}>{value}</div>
return xx;
}
if (json.comName == 'Label') {
......@@ -1633,8 +1649,8 @@ export default class tableCom extends Component {
{get === 'mobile' ? <br /> : ''}
</span>
) : (
''
);
''
);
break;
case 'UploadCom':
......@@ -1783,8 +1799,8 @@ export default class tableCom extends Component {
</span>
</>
) : (
''
)}
''
)}
</Col>
<Col
span={json.wrapperSpan}
......@@ -1851,9 +1867,9 @@ export default class tableCom extends Component {
this.props.fatherCode != null
? bindObj
? {
...bindObj,
base52: `${this.props.fatherCode}.[${this.props.index}].${bindObj.base52}`,
}
...bindObj,
base52: `${this.props.fatherCode}.[${this.props.index}].${bindObj.base52}`,
}
: { base52: `${this.props.fatherCode}.[${this.props.index}].${this.props.uuid}` }
: bindObj;
......@@ -1962,18 +1978,18 @@ export default class tableCom extends Component {
<span>
{labels != null
? labels.map((r, i) =>
i == 0 ? (
typeof r == 'string' ? (
<span>{r}</span>
) : (
i == 0 ? (
typeof r == 'string' ? (
<span>{r}</span>
) : (
Object.values(r)
)
) : typeof r == 'string' ? (
<span style={{ marginLeft: 12 }}>{r}</span>
) : (
',' + Object.values(r)
),
)
) : typeof r == 'string' ? (
<span style={{ marginLeft: 12 }}>{r}</span>
) : (
',' + Object.values(r)
),
)
: ''}
</span>
);
......@@ -2051,8 +2067,8 @@ export default class tableCom extends Component {
<span>
{obj[dataColumn.base52]
? moment(+new Date(obj[dataColumn.base52])).format(
json.format ? json.format : 'YYYY-MM-DD HH:mm:ss',
)
json.format ? json.format : 'YYYY-MM-DD HH:mm:ss',
)
: ''}
</span>
);
......@@ -2166,11 +2182,11 @@ export default class tableCom extends Component {
height={json.height}
/>
) : (
<img
src={config.httpServer + obj[dataColumn.base52]}
style={{ width: json.width, height: json.height }}
/>
);
<img
src={config.httpServer + obj[dataColumn.base52]}
style={{ width: json.width, height: json.height }}
/>
);
}
break;
......@@ -2193,7 +2209,7 @@ export default class tableCom extends Component {
case 'ChildForm':
const xxxxx = obj[dataColumn.base52];
if (xxxxx == null) {
cm = <></>;Chil
cm = <></>; Chil
break;
}
if (Object.keys(xxxxx).length > 0) {
......@@ -2403,7 +2419,7 @@ export default class tableCom extends Component {
}
>
{(json.isMobileLabel != null && json.isMobileLabel) ||
(json.isMobileLabel == null && json.isLabel)
(json.isMobileLabel == null && json.isLabel)
? title
: ''}
</MobileList.Item>
......@@ -2600,25 +2616,25 @@ export default class tableCom extends Component {
getPopupContainer={
this.props.isDynamic && document.querySelector('#dynamic_div')
? () => {
return document.querySelector('#dynamic_div');
}
return document.querySelector('#dynamic_div');
}
: ''
}
onFocus={() => {
get === 'mobile' // 移动端取消输入键盘弹出
? setTimeout(() => {
if (document.querySelectorAll(`.ant-select-search__field`).length > 0) {
let ary = [...document.querySelectorAll(`.ant-select-search__field`)];
ary.map(item => {
item.setAttribute('readonly', 'readonly');
// setTimeout(() => {
// ary.map(arr => {
// arr.removeAttribute('readonly');
// })
// });
});
}
})
if (document.querySelectorAll(`.ant-select-search__field`).length > 0) {
let ary = [...document.querySelectorAll(`.ant-select-search__field`)];
ary.map(item => {
item.setAttribute('readonly', 'readonly');
// setTimeout(() => {
// ary.map(arr => {
// arr.removeAttribute('readonly');
// })
// });
});
}
})
: null;
}}
filterOption={(input, option) =>
......@@ -2629,10 +2645,10 @@ export default class tableCom extends Component {
>
{options
? options.map(r => (
<Option key={r.value} value={r.value}>
{r.label}
</Option>
))
<Option key={r.value} value={r.value}>
{r.label}
</Option>
))
: ''}
</Select>,
);
......@@ -2665,22 +2681,22 @@ export default class tableCom extends Component {
json.vlds && json.vlds.length > 0
? json.vlds
: [
{
validator: (rule, value, callback) => {
if (
(Object.keys(value).length == 0 ||
Object.keys(value.selects).length == 0) &&
required != null &&
required
) {
var errors = [];
errors.push(new Error('请选择至少一个', rule.field));
}
callback(errors);
},
required: required,
{
validator: (rule, value, callback) => {
if (
(Object.keys(value).length == 0 ||
Object.keys(value.selects).length == 0) &&
required != null &&
required
) {
var errors = [];
errors.push(new Error('请选择至少一个', rule.field));
}
callback(errors);
},
],
required: required,
},
],
})(
<TableSelect
get={get}
......@@ -2795,21 +2811,21 @@ export default class tableCom extends Component {
onOpenChange={
get === 'mobile'
? () => {
// 取消唤起移动端小键盘
setTimeout(() => {
if (document.querySelector('.ant-calendar-input ')) {
// 取消唤起移动端小键盘
setTimeout(() => {
if (document.querySelector('.ant-calendar-input ')) {
document
.querySelector('.ant-calendar-input ')
.setAttribute('readonly', 'readonly');
setTimeout(() => {
document
.querySelector('.ant-calendar-input ')
.setAttribute('readonly', 'readonly');
setTimeout(() => {
document
.querySelector('.ant-calendar-input ')
.removeAttribute('readonly');
});
}
});
}
: () => {}
.removeAttribute('readonly');
});
}
});
}
: () => { }
}
format={json.format ? json.format : 'YYYY-MM-DD HH:mm:ss'}
/>,
......@@ -3100,8 +3116,8 @@ export default class tableCom extends Component {
/>
</FormModal>
) : (
''
)}
''
)}
<Card.Header title={<span style={{ fontSize: 14 }}>{title}:</span>} />
<Card.Body>{cm}</Card.Body>
</Card>
......@@ -3179,8 +3195,8 @@ export default class tableCom extends Component {
/>
</FormModal>
) : (
''
)}
''
)}
</Row>
);
} else {
......@@ -3213,8 +3229,8 @@ export default class tableCom extends Component {
/>
</FormModal>
) : (
''
)}
''
)}
<Form.Item
labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }}
......@@ -3255,8 +3271,8 @@ export default class tableCom extends Component {
/>
</FormModal>
) : (
''
)}
''
)}
{cm}
</>
);
......@@ -3291,8 +3307,8 @@ export default class tableCom extends Component {
/>
</FormModal>
) : (
''
)}
''
)}
{json.isMobileLabel && !isEdit && get == 'mobile' ? (
<MobileItem
isPreview={isPreview}
......@@ -3312,11 +3328,11 @@ export default class tableCom extends Component {
{cm}
</Form.Item>
) : (
<Form.Item>{cm}</Form.Item>
)
<Form.Item>{cm}</Form.Item>
)
) : (
cm
)}
cm
)}
</>
);
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论