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

1111

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