Commit f0901b4a authored by TZW's avatar TZW

sader

parent 769d3272
...@@ -1312,7 +1312,31 @@ function Diyrules({ item, colProps, formRef }) { ...@@ -1312,7 +1312,31 @@ function Diyrules({ item, colProps, formRef }) {
let curkey = item.key ?? item.dataIndex; let curkey = item.key ?? item.dataIndex;
return ( return (
<Col {...col}> <Col {...col}>
<ProForm.Item name={curkey} label={item.title} {...item.formItemProps}> <ProForm.Item
convertValue={(value) => {
console.log(value);
if (value?.other) return value;
let obj = {
noTypeId: value?.[0]?.noTypeId,
nrList: {
other: {},
value: [],
},
};
value?.forEach((it) => {
if (it?.noRuleCode == 'increasing_order') {
obj.nrList.other = it;
} else {
obj.nrList.value.push(it);
}
});
console.log(obj);
return obj;
}}
name={curkey}
label={item.title}
{...item.formItemProps}
>
<Diyrule /> <Diyrule />
</ProForm.Item> </ProForm.Item>
</Col> </Col>
......
...@@ -103,8 +103,6 @@ function InitForm({ ...@@ -103,8 +103,6 @@ function InitForm({
}) { }) {
let proformRef = useRef(); let proformRef = useRef();
proformRef = formRef ?? proformRef; proformRef = formRef ?? proformRef;
console.log(detailpath);
console.log(detailFormat());
return ( return (
<ProForm <ProForm
style={{ overflow: 'hidden' }} style={{ overflow: 'hidden' }}
...@@ -135,11 +133,6 @@ function InitForm({ ...@@ -135,11 +133,6 @@ function InitForm({
...obj, ...obj,
...defaultFormValue, ...defaultFormValue,
}; };
} else if (detailFormat) {
return {
...detailFormat(res?.data),
...defaultFormValue,
};
} }
return { return {
...(res?.data?.data ?? {}), ...(res?.data?.data ?? {}),
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: Li Hanlin * @Author: Li Hanlin
* @Date: 2022-11-09 14:44:44 * @Date: 2022-11-09 14:44:44
* @Last Modified by: Li Hanlin * @Last Modified by: Li Hanlin
* @Last Modified time: 2022-12-14 15:55:13 * @Last Modified time: 2022-12-14 16:38:10
*/ */
import * as React from 'react'; import * as React from 'react';
...@@ -62,21 +62,6 @@ function Rules(props) { ...@@ -62,21 +62,6 @@ function Rules(props) {
visible: true, visible: true,
detailpath: urlParams.detail, detailpath: urlParams.detail,
params: { noTypeId: row?.id }, params: { noTypeId: row?.id },
detailFormat: (res) => {
console.log('res:', res);
let nrList = {};
res?.data?.nrList?.forEach((it) => {
if (it?.noRuleCode == 'increasing_order') {
nrList.other = it;
} else {
nrList.value.push(it);
}
});
delete res?.data?.nrList;
console.log(res?.data?.nrList);
// res.data.nrList = nrList;
return res;
},
title: '编辑', title: '编辑',
val: 'edit', val: 'edit',
onFinish: async (vals) => { onFinish: async (vals) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment