Commit b2288f17 authored by 左玲玲's avatar 左玲玲 😬

1111

parent 355184c3
......@@ -585,7 +585,7 @@ function LinkSelect({ item, colProps, formRef, name, curindex }) {
formRef?.current?.setFieldsValue({ [curkey]: ifclean });
}
return item.showAll && res?.data?.dataList?.length > 0 ? [{ label: '全部', key: 'all' }, ...res?.data?.dataList] : [];
return item.showAll ? [{ label: '全部', value: 'all' }, ...(res?.data?.dataList ?? [])] : [];
}}
showSearch
/>
......@@ -604,13 +604,13 @@ function NolinkSelect({ item, colProps }) {
if (Array.isArray(curoption)) {
options = {
options: item.showAll && curoption?.length > 0 ? [{ label: '全部', key: 'all' }] : [...curoption],
options: item.showAll ? [{ label: '全部', value: 'all' }] : [...curoption],
};
} else if (curoption) {
options = {
request: async (params) => {
let list = await doFetch({ url: curoption?.path, params: curoption?.params });
return item.showAll && list?.data?.dataList?.length > 0 ? [{ label: '全部', key: 'all' }, ...list?.data?.dataList] : [];
return item.showAll ? [{ label: '全部', value: 'all' }, ...(list?.data?.dataList ?? [])] : [];
},
};
}
......
......@@ -33,14 +33,14 @@ let FormRender = memo(({ fields = [], colProps, proformRef }) => {
item.formItemProps = item.formItemProps ?? { rules: [] };
if (item.valueType == 'split') {
return (
<div className={styles.title} style={{ borderWidth: index == 0 ? 0 : 1 }}>
<div key={index} className={styles.title} style={{ borderWidth: index == 0 ? 0 : 1 }}>
{item.title}
</div>
);
}
if (item?.valueType == 'nosubmit') {
return (
<Col {...(item.colProps ?? { span: 12 })} style={{ marginBottom: 24 }}>
<Col key={index} {...(item.colProps ?? { span: 12 })} style={{ marginBottom: 24 }}>
<label style={{ marginBottom: 8, display: 'block' }}>{item?.title}</label>
<Input disabled value={item?.initialValue} />
</Col>
......@@ -49,7 +49,7 @@ let FormRender = memo(({ fields = [], colProps, proformRef }) => {
if (hideInForm && Object.keys(hideInForm)) {
return (
<ProFormDependency name={Object.keys(hideInForm)}>
<ProFormDependency key={index} name={Object.keys(hideInForm)}>
{(params) => {
let ifs = true;
let res = Object.keys(hideInForm).map((its) => {
......@@ -64,31 +64,23 @@ let FormRender = memo(({ fields = [], colProps, proformRef }) => {
if (ifs) {
return;
} else {
return (
<>
{createElement(FormItems[key], {
item: item,
colProps: colProps,
key: item.dataIndex,
formRef: proformRef,
})}
</>
);
return createElement(FormItems[key], {
item: item,
colProps: colProps,
key: item.dataIndex,
formRef: proformRef,
});
}
}}
</ProFormDependency>
);
} else {
return (
<>
{createElement(FormItems[key], {
item: item,
colProps: colProps,
key: item.dataIndex,
formRef: proformRef,
})}
</>
);
return createElement(FormItems[key], {
item: item,
colProps: colProps,
key: item.dataIndex,
formRef: proformRef,
});
}
})}
</>
......@@ -160,24 +152,24 @@ function InitForm(props) {
//反填参数 格式化
const relationSupplierList = res?.data?.data?.relationSupplierList
? {
relationSupplierList: res?.data?.data?.relationSupplierList?.map?.((it, i) => {
return {
...it,
id: it?.supplierId,
};
}),
}
relationSupplierList: res?.data?.data?.relationSupplierList?.map?.((it, i) => {
return {
...it,
id: it?.supplierId,
};
}),
}
: {};
const supplierList = res?.data?.data?.supplierList
? {
supplierList: res?.data?.data?.supplierList?.map?.((it, i) => {
return {
...it,
id: it?.supplierId,
};
}),
}
supplierList: res?.data?.data?.supplierList?.map?.((it, i) => {
return {
...it,
id: it?.supplierId,
};
}),
}
: {};
let result = res?.data?.data;
......
......@@ -236,6 +236,7 @@ function getcolumns(setDrawer, ifs, formRef) {
searchKey: 'factoryNames',
searchValueType: 'input',
options: { path: '/auth/sysFactory/getAllFactorySelection', params: {} },
showAll: true
},
{
title: '负责车间',
......
......@@ -137,8 +137,7 @@ function getcolumns(ifs) {
},
fieldProps: {
placeholder: '请输入排序号,默认为0',
min: 0,
defaultValue: 0,
min: 0
},
search: false,
precision: 0,
......
......@@ -209,6 +209,7 @@ function Field(props) {
fieldChar: '1',
formName: drawer?.formName,
formId: drawer?.formId,
sort: 0
},
title: '新增',
val: 'add',
......@@ -237,7 +238,7 @@ function Field(props) {
},
},
}}
// x={1500}
// x={1500}
/>
</Content>
</Layout>
......
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