Commit 0da2f8a1 authored by wuhao's avatar wuhao 🎯

asd

parent 029f1993
...@@ -392,8 +392,8 @@ const Mtable = (props) => { ...@@ -392,8 +392,8 @@ const Mtable = (props) => {
}} }}
columns={ columns={
resizeable resizeable
? columnes?.filter?.((it) => it.valueType != 'split') ?? [] ? columnes?.filter?.((it) => ['split', 'nosubmit'].indexOf(it.valueType) == -1) ?? []
: columncs?.filter?.((it) => it.valueType != 'split') ?? [] : columncs?.filter?.((it) => ['split', 'nosubmit'].indexOf(it.valueType) == -1) ?? []
} }
style={style || {}} style={style || {}}
actionRef={actionRefs} actionRef={actionRefs}
......
...@@ -59,33 +59,35 @@ function DetailPro(props) { ...@@ -59,33 +59,35 @@ function DetailPro(props) {
return ( return (
<ProDescriptions column={3} {...dataProps} title={props.title}> <ProDescriptions column={3} {...dataProps} title={props.title}>
{fields?.filter(it => !it.hideInDescriptions && it?.valueType != "option")?.map((it, i) => { {fields
const dataIndexs = ?.filter((it) => !it.hideInDescriptions && it?.valueType != 'option')
!it?.render || it?.valueType == 'option' ?.map((it, i) => {
? { dataIndex: it.dataIndex, valueType: it.valueType } const dataIndexs =
: {}; !it?.render || it?.valueType == 'option'
if (it.valueType == 'split') { ? { dataIndex: it.dataIndex, valueType: it.valueType }
: {};
if (it.valueType == 'split') {
return (
<>
<Col span={24}>
<div className={styles.title} style={{ borderWidth: i == 0 ? 0 : 1 }}>
{it.title}
</div>
</Col>
</>
);
}
return ( return (
<> <Item
<Col span={24}> span={it?.span ? it?.span : fields[i + 1]?.valueType == 'split' ? 3 : 1}
<div className={styles.title} style={{ borderWidth: i == 0 ? 0 : 1 }}> key={it.dataIndex}
{it.title} label={it.title}
</div> {...dataIndexs}
</Col> >
</> {it?.render ? it?.render?.(curitem[it.dataIndex], curitem) : ''}
</Item>
); );
} })}
return (
<Item
span={it?.span ? it?.span : fields[i + 1]?.valueType == 'split' ? 3 : 1}
key={it.dataIndex}
label={it.title}
{...dataIndexs}
>
{it?.render ? it?.render?.(curitem[it.dataIndex], curitem) : ''}
</Item>
);
})}
</ProDescriptions> </ProDescriptions>
); );
} }
......
...@@ -148,7 +148,7 @@ let FormRender = memo(({ fields = [], name, curindex, formRef }) => { ...@@ -148,7 +148,7 @@ let FormRender = memo(({ fields = [], name, curindex, formRef }) => {
{createElement(FormItems[key], { {createElement(FormItems[key], {
item: item, item: item,
colProps: item.colProps, colProps: item.colProps,
key: item.dataIndex, key: item?.dataIndex,
name: name, name: name,
formRef, formRef,
curindex, curindex,
...@@ -165,7 +165,7 @@ let FormRender = memo(({ fields = [], name, curindex, formRef }) => { ...@@ -165,7 +165,7 @@ let FormRender = memo(({ fields = [], name, curindex, formRef }) => {
{createElement(FormItems[key], { {createElement(FormItems[key], {
item: item, item: item,
colProps: item.colProps, colProps: item.colProps,
key: item.dataIndex, key: item?.dataIndex,
name: name, name: name,
formRef, formRef,
curindex, curindex,
...@@ -180,7 +180,7 @@ let FormRender = memo(({ fields = [], name, curindex, formRef }) => { ...@@ -180,7 +180,7 @@ let FormRender = memo(({ fields = [], name, curindex, formRef }) => {
// colProps 默认删格 // colProps 默认删格
function Input({ item, colProps }) { function Input({ item, colProps }) {
let keys = item.key ?? item.dataIndex ?? ''; let keys = item?.key ?? item?.dataIndex ?? '';
keys = keys ?? ''; keys = keys ?? '';
const defaultrule = const defaultrule =
keys.indexOf('phone') != -1 keys.indexOf('phone') != -1
...@@ -243,7 +243,7 @@ function MyAutoComplete({ item, colProps, formRef }) { ...@@ -243,7 +243,7 @@ function MyAutoComplete({ item, colProps, formRef }) {
}); });
}, [username]); }, [username]);
let col = item.colProps ?? colProps; let col = item.colProps ?? colProps;
let curkey = item.key ?? item.dataIndex; let curkey = item?.key ?? item?.dataIndex;
return ( return (
<Col span={12}> <Col span={12}>
<ProForm.Item name={curkey} label={item.title} {...item.formItemProps}> <ProForm.Item name={curkey} label={item.title} {...item.formItemProps}>
...@@ -272,7 +272,7 @@ function Password({ item, colProps }) { ...@@ -272,7 +272,7 @@ function Password({ item, colProps }) {
<ProFormText.Password <ProFormText.Password
fieldProps={item?.fieldProps} fieldProps={item?.fieldProps}
formItemProps={item.formItemProps} formItemProps={item.formItemProps}
name={item.key ?? item.dataIndex} name={item?.key ?? item?.dataIndex}
colProps={item.colProps ?? colProps} colProps={item.colProps ?? colProps}
label={item.title} label={item.title}
placeholder={`请输入${item.title}`} placeholder={`请输入${item.title}`}
...@@ -288,7 +288,7 @@ function Money({ item, colProps }) { ...@@ -288,7 +288,7 @@ function Money({ item, colProps }) {
locale="zh-CN" locale="zh-CN"
fieldProps={item?.fieldProps} fieldProps={item?.fieldProps}
formItemProps={item.formItemProps} formItemProps={item.formItemProps}
name={item.key ?? item.dataIndex} name={item?.key ?? item?.dataIndex}
colProps={item.colProps ?? colProps} colProps={item.colProps ?? colProps}
label={item.title} label={item.title}
placeholder={`请输入${item.title}`} placeholder={`请输入${item.title}`}
...@@ -306,7 +306,7 @@ function Textarea({ item, colProps }) { ...@@ -306,7 +306,7 @@ function Textarea({ item, colProps }) {
<ProFormTextArea <ProFormTextArea
fieldProps={item?.fieldProps} fieldProps={item?.fieldProps}
formItemProps={item.formItemProps} formItemProps={item.formItemProps}
name={item.key ?? item.dataIndex} name={item?.key ?? item?.dataIndex}
colProps={item.colProps ?? { span: 24 }} colProps={item.colProps ?? { span: 24 }}
label={item.title} label={item.title}
placeholder={`请输入${item.title}`} placeholder={`请输入${item.title}`}
...@@ -321,7 +321,7 @@ function Digit({ item, colProps }) { ...@@ -321,7 +321,7 @@ function Digit({ item, colProps }) {
<> <>
<ProFormDigit <ProFormDigit
formItemProps={item.formItemProps} formItemProps={item.formItemProps}
name={item.key ?? item.dataIndex} name={item?.key ?? item?.dataIndex}
colProps={item.colProps ?? colProps} colProps={item.colProps ?? colProps}
label={item.title} label={item.title}
placeholder={`请输入${item.title}`} placeholder={`请输入${item.title}`}
...@@ -339,7 +339,7 @@ function DigitRange({ item, colProps }) { ...@@ -339,7 +339,7 @@ function DigitRange({ item, colProps }) {
<> <>
<ProFormDigitRange <ProFormDigitRange
formItemProps={item.formItemProps} formItemProps={item.formItemProps}
name={item.key ?? item.dataIndex} name={item?.key ?? item?.dataIndex}
colProps={item.colProps ?? colProps} colProps={item.colProps ?? colProps}
label={item.title} label={item.title}
placeholder={['请输入最小值', '请输入最大值']} placeholder={['请输入最小值', '请输入最大值']}
...@@ -358,7 +358,7 @@ function Date({ item, colProps }) { ...@@ -358,7 +358,7 @@ function Date({ item, colProps }) {
<ProFormDatePicker <ProFormDatePicker
fieldProps={item?.fieldProps} fieldProps={item?.fieldProps}
formItemProps={item.formItemProps} formItemProps={item.formItemProps}
name={item.key ?? item.dataIndex} name={item?.key ?? item?.dataIndex}
colProps={item.colProps ?? colProps} colProps={item.colProps ?? colProps}
label={item.title} label={item.title}
placeholder={`请选择${item.title}`} placeholder={`请选择${item.title}`}
...@@ -379,7 +379,7 @@ function DateWeek({ item, colProps }) { ...@@ -379,7 +379,7 @@ function DateWeek({ item, colProps }) {
<ProFormDatePicker <ProFormDatePicker
fieldProps={{ ...item?.fieldProps, picker: 'week', format: customWeekStartEndFormat }} fieldProps={{ ...item?.fieldProps, picker: 'week', format: customWeekStartEndFormat }}
formItemProps={item.formItemProps} formItemProps={item.formItemProps}
name={item.key ?? item.dataIndex} name={item?.key ?? item?.dataIndex}
colProps={item.colProps ?? colProps} colProps={item.colProps ?? colProps}
label={item.title} label={item.title}
placeholder={`请选择${item.title}`} placeholder={`请选择${item.title}`}
...@@ -395,7 +395,7 @@ function DateMonth({ item, colProps }) { ...@@ -395,7 +395,7 @@ function DateMonth({ item, colProps }) {
<ProFormDatePicker <ProFormDatePicker
fieldProps={{ ...item?.fieldProps, picker: 'month', format: 'YYYY-MM' }} fieldProps={{ ...item?.fieldProps, picker: 'month', format: 'YYYY-MM' }}
formItemProps={item.formItemProps} formItemProps={item.formItemProps}
name={item.key ?? item.dataIndex} name={item?.key ?? item?.dataIndex}
colProps={item.colProps ?? colProps} colProps={item.colProps ?? colProps}
label={item.title} label={item.title}
placeholder={`请选择${item.title}`} placeholder={`请选择${item.title}`}
...@@ -416,7 +416,7 @@ function DateQuarter({ item, colProps }) { ...@@ -416,7 +416,7 @@ function DateQuarter({ item, colProps }) {
<ProFormDatePicker <ProFormDatePicker
fieldProps={{ ...item?.fieldProps, picker: 'quarter', format: customWeekStartEndFormat }} fieldProps={{ ...item?.fieldProps, picker: 'quarter', format: customWeekStartEndFormat }}
formItemProps={item.formItemProps} formItemProps={item.formItemProps}
name={item.key ?? item.dataIndex} name={item?.key ?? item?.dataIndex}
colProps={item.colProps ?? colProps} colProps={item.colProps ?? colProps}
label={item.title} label={item.title}
placeholder={`请选择${item.title}`} placeholder={`请选择${item.title}`}
...@@ -432,7 +432,7 @@ function DateYear({ item, colProps }) { ...@@ -432,7 +432,7 @@ function DateYear({ item, colProps }) {
<ProFormDatePicker <ProFormDatePicker
fieldProps={{ ...item?.fieldProps, picker: 'year', format: 'YYYY' }} fieldProps={{ ...item?.fieldProps, picker: 'year', format: 'YYYY' }}
formItemProps={item.formItemProps} formItemProps={item.formItemProps}
name={item.key ?? item.dataIndex} name={item?.key ?? item?.dataIndex}
colProps={item.colProps ?? colProps} colProps={item.colProps ?? colProps}
label={item.title} label={item.title}
placeholder={`请选择${item.title}`} placeholder={`请选择${item.title}`}
...@@ -449,7 +449,7 @@ function DateTime({ item, colProps }) { ...@@ -449,7 +449,7 @@ function DateTime({ item, colProps }) {
<ProFormDateTimePicker <ProFormDateTimePicker
fieldProps={item?.fieldProps} fieldProps={item?.fieldProps}
formItemProps={item.formItemProps} formItemProps={item.formItemProps}
name={item.key ?? item.dataIndex} name={item?.key ?? item?.dataIndex}
colProps={item.colProps ?? colProps} colProps={item.colProps ?? colProps}
label={item.title} label={item.title}
placeholder={`请选择${item.title}`} placeholder={`请选择${item.title}`}
...@@ -465,7 +465,7 @@ function DateRange({ item, colProps }) { ...@@ -465,7 +465,7 @@ function DateRange({ item, colProps }) {
<ProFormDateRangePicker <ProFormDateRangePicker
fieldProps={item?.fieldProps} fieldProps={item?.fieldProps}
formItemProps={item.formItemProps} formItemProps={item.formItemProps}
name={item.key ?? item.dataIndex} name={item?.key ?? item?.dataIndex}
colProps={item.colProps ?? colProps} colProps={item.colProps ?? colProps}
label={item.title} label={item.title}
placeholder={['请选择开始日期', '请选择结束日期']} placeholder={['请选择开始日期', '请选择结束日期']}
...@@ -481,7 +481,7 @@ function DateTimeRange({ item, colProps }) { ...@@ -481,7 +481,7 @@ function DateTimeRange({ item, colProps }) {
<ProFormDateTimeRangePicker <ProFormDateTimeRangePicker
fieldProps={item?.fieldProps} fieldProps={item?.fieldProps}
formItemProps={item.formItemProps} formItemProps={item.formItemProps}
name={item.key ?? item.dataIndex} name={item?.key ?? item?.dataIndex}
colProps={item.colProps ?? colProps} colProps={item.colProps ?? colProps}
label={item.title} label={item.title}
placeholder={['请选择开始时间', '请选择结束时间']} placeholder={['请选择开始时间', '请选择结束时间']}
...@@ -497,7 +497,7 @@ function Time({ item, colProps }) { ...@@ -497,7 +497,7 @@ function Time({ item, colProps }) {
<ProFormTimePicker <ProFormTimePicker
fieldProps={item?.fieldProps} fieldProps={item?.fieldProps}
formItemProps={item.formItemProps} formItemProps={item.formItemProps}
name={item.key ?? item.dataIndex} name={item?.key ?? item?.dataIndex}
colProps={item.colProps ?? colProps} colProps={item.colProps ?? colProps}
label={item.title} label={item.title}
placeholder={`请选择${item.title}`} placeholder={`请选择${item.title}`}
...@@ -513,7 +513,7 @@ function TimeRange({ item, colProps }) { ...@@ -513,7 +513,7 @@ function TimeRange({ item, colProps }) {
<ProFormTimePicker.RangePicker <ProFormTimePicker.RangePicker
fieldProps={item?.fieldProps} fieldProps={item?.fieldProps}
formItemProps={item.formItemProps} formItemProps={item.formItemProps}
name={item.key ?? item.dataIndex} name={item?.key ?? item?.dataIndex}
colProps={item.colProps ?? colProps} colProps={item.colProps ?? colProps}
label={item.title} label={item.title}
placeholder={['请选择开始时间', '请选择结束时间']} placeholder={['请选择开始时间', '请选择结束时间']}
...@@ -531,7 +531,7 @@ function LinkSelect({ item, colProps, formRef, name, curindex }) { ...@@ -531,7 +531,7 @@ function LinkSelect({ item, colProps, formRef, name, curindex }) {
<> <>
<ProFormDependency name={Object.keys(curlinkparams)}> <ProFormDependency name={Object.keys(curlinkparams)}>
{(params) => { {(params) => {
const curkey = item.key ?? item.dataIndex; const curkey = item?.key ?? item?.dataIndex;
return ( return (
<ProFormSelect <ProFormSelect
convertValue={(value) => { convertValue={(value) => {
...@@ -618,7 +618,7 @@ function NolinkSelect({ item, colProps }) { ...@@ -618,7 +618,7 @@ function NolinkSelect({ item, colProps }) {
<ProFormSelect <ProFormSelect
fieldProps={item.fieldProps} fieldProps={item.fieldProps}
formItemProps={item.formItemProps} formItemProps={item.formItemProps}
name={item.key ?? item.dataIndex} name={item?.key ?? item?.dataIndex}
colProps={item.colProps ?? colProps} colProps={item.colProps ?? colProps}
label={item.title} label={item.title}
placeholder={`请选择${item.title}`} placeholder={`请选择${item.title}`}
...@@ -648,7 +648,7 @@ function LinkTreeSelect({ item, colProps, formRef, name, curindex }) { ...@@ -648,7 +648,7 @@ function LinkTreeSelect({ item, colProps, formRef, name, curindex }) {
<> <>
<ProFormDependency name={Object.keys(curlinkparams)}> <ProFormDependency name={Object.keys(curlinkparams)}>
{(params) => { {(params) => {
const curkey = item.key ?? item.dataIndex; const curkey = item?.key ?? item?.dataIndex;
return ( return (
<ProFormTreeSelect <ProFormTreeSelect
fieldProps={{ fieldProps={{
...@@ -690,7 +690,7 @@ function LinkTreeSelect({ item, colProps, formRef, name, curindex }) { ...@@ -690,7 +690,7 @@ function LinkTreeSelect({ item, colProps, formRef, name, curindex }) {
//树结构所有value提取到数组 //树结构所有value提取到数组
let allvalue = []; let allvalue = [];
treeForeach(res?.data?.dataList, (node) => { treeForeach(res?.data?.dataList, (node) => {
allvalue.push(node.key); allvalue.push(node?.key);
}); });
//过滤存在的value //过滤存在的value
...@@ -745,7 +745,7 @@ function NolinkTreeSelect({ item, colProps }) { ...@@ -745,7 +745,7 @@ function NolinkTreeSelect({ item, colProps }) {
showSearch: true, showSearch: true,
}} }}
formItemProps={item.formItemProps} formItemProps={item.formItemProps}
name={item.key ?? item.dataIndex} name={item?.key ?? item?.dataIndex}
colProps={item.colProps ?? colProps} colProps={item.colProps ?? colProps}
label={item.title} label={item.title}
placeholder={`请选择${item.title}`} placeholder={`请选择${item.title}`}
...@@ -771,7 +771,7 @@ function CheckboxItem({ item, colProps }) { ...@@ -771,7 +771,7 @@ function CheckboxItem({ item, colProps }) {
<ProFormCheckbox <ProFormCheckbox
fieldProps={item.fieldProps} fieldProps={item.fieldProps}
formItemProps={item.formItemProps} formItemProps={item.formItemProps}
name={item.key ?? item.dataIndex} name={item?.key ?? item?.dataIndex}
colProps={item.colProps ?? colProps} colProps={item.colProps ?? colProps}
label={item.title} label={item.title}
placeholder={`请选择${item.title}`} placeholder={`请选择${item.title}`}
...@@ -788,7 +788,7 @@ function LinkCheckbox({ item, colProps, formRef, name, curindex }) { ...@@ -788,7 +788,7 @@ function LinkCheckbox({ item, colProps, formRef, name, curindex }) {
<> <>
<ProFormDependency name={Object.keys(curlinkparams)}> <ProFormDependency name={Object.keys(curlinkparams)}>
{(params) => { {(params) => {
const curkey = item.key ?? item.dataIndex; const curkey = item?.key ?? item?.dataIndex;
return ( return (
<ProFormCheckbox.Group <ProFormCheckbox.Group
fieldProps={item?.fieldProps} fieldProps={item?.fieldProps}
...@@ -865,7 +865,7 @@ function NolinkCheckbox({ item, colProps }) { ...@@ -865,7 +865,7 @@ function NolinkCheckbox({ item, colProps }) {
<ProFormCheckbox.Group <ProFormCheckbox.Group
fieldProps={item.fieldProps} fieldProps={item.fieldProps}
formItemProps={item.formItemProps} formItemProps={item.formItemProps}
name={item.key ?? item.dataIndex} name={item?.key ?? item?.dataIndex}
colProps={item.colProps ?? colProps} colProps={item.colProps ?? colProps}
label={item.title} label={item.title}
placeholder={`请选择${item.title}`} placeholder={`请选择${item.title}`}
...@@ -891,7 +891,7 @@ function RadioItem({ item, colProps }) { ...@@ -891,7 +891,7 @@ function RadioItem({ item, colProps }) {
<ProFormRadio <ProFormRadio
fieldProps={item.fieldProps} fieldProps={item.fieldProps}
formItemProps={item.formItemProps} formItemProps={item.formItemProps}
name={item.key ?? item.dataIndex} name={item?.key ?? item?.dataIndex}
colProps={item.colProps ?? colProps} colProps={item.colProps ?? colProps}
label={item.title} label={item.title}
placeholder={`请选择${item.title}`} placeholder={`请选择${item.title}`}
...@@ -908,7 +908,7 @@ function LinkRadio({ item, colProps, formRef, name, curindex }) { ...@@ -908,7 +908,7 @@ function LinkRadio({ item, colProps, formRef, name, curindex }) {
<> <>
<ProFormDependency name={Object.keys(curlinkparams)}> <ProFormDependency name={Object.keys(curlinkparams)}>
{(params) => { {(params) => {
const curkey = item.key ?? item.dataIndex; const curkey = item?.key ?? item?.dataIndex;
return ( return (
<ProFormRadio.Group <ProFormRadio.Group
fieldProps={item?.fieldProps} fieldProps={item?.fieldProps}
...@@ -985,7 +985,7 @@ function NolinkRadio({ item, colProps }) { ...@@ -985,7 +985,7 @@ function NolinkRadio({ item, colProps }) {
<ProFormRadio.Group <ProFormRadio.Group
fieldProps={item.fieldProps} fieldProps={item.fieldProps}
formItemProps={item.formItemProps} formItemProps={item.formItemProps}
name={item.key ?? item.dataIndex} name={item?.key ?? item?.dataIndex}
colProps={item.colProps ?? colProps} colProps={item.colProps ?? colProps}
label={item.title} label={item.title}
placeholder={`请选择${item.title}`} placeholder={`请选择${item.title}`}
...@@ -1014,7 +1014,7 @@ function LinkCascader({ item, colProps, formRef, name, curindex }) { ...@@ -1014,7 +1014,7 @@ function LinkCascader({ item, colProps, formRef, name, curindex }) {
<> <>
<ProFormDependency name={Object.keys(curlinkparams)}> <ProFormDependency name={Object.keys(curlinkparams)}>
{(params) => { {(params) => {
const curkey = item.key ?? item.dataIndex; const curkey = item?.key ?? item?.dataIndex;
return ( return (
<ProFormCascader <ProFormCascader
fieldProps={{ fieldProps={{
...@@ -1103,7 +1103,7 @@ function NolinkCascader({ item, colProps }) { ...@@ -1103,7 +1103,7 @@ function NolinkCascader({ item, colProps }) {
showSearch: true, showSearch: true,
}} }}
formItemProps={item.formItemProps} formItemProps={item.formItemProps}
name={item.key ?? item.dataIndex} name={item?.key ?? item?.dataIndex}
colProps={item.colProps ?? colProps} colProps={item.colProps ?? colProps}
label={item.title} label={item.title}
placeholder={`请选择${item.title}`} placeholder={`请选择${item.title}`}
...@@ -1130,7 +1130,7 @@ function Switch({ item, colProps }) { ...@@ -1130,7 +1130,7 @@ function Switch({ item, colProps }) {
<ProFormSwitch <ProFormSwitch
fieldProps={item?.fieldProps} fieldProps={item?.fieldProps}
formItemProps={item.formItemProps} formItemProps={item.formItemProps}
name={item.key ?? item.dataIndex} name={item?.key ?? item?.dataIndex}
colProps={item.colProps ?? colProps} colProps={item.colProps ?? colProps}
label={item.title} label={item.title}
placeholder={`请输入${item.title}`} placeholder={`请输入${item.title}`}
...@@ -1146,7 +1146,7 @@ function Rate({ item, colProps }) { ...@@ -1146,7 +1146,7 @@ function Rate({ item, colProps }) {
<ProFormRate <ProFormRate
fieldProps={item?.fieldProps} fieldProps={item?.fieldProps}
formItemProps={item.formItemProps} formItemProps={item.formItemProps}
name={item.key ?? item.dataIndex} name={item?.key ?? item?.dataIndex}
colProps={item.colProps ?? colProps} colProps={item.colProps ?? colProps}
label={item.title} label={item.title}
/> />
...@@ -1162,7 +1162,7 @@ function Slider({ item, colProps }) { ...@@ -1162,7 +1162,7 @@ function Slider({ item, colProps }) {
{...item?.fieldProps} {...item?.fieldProps}
fieldProps={item?.fieldProps} fieldProps={item?.fieldProps}
formItemProps={item.formItemProps} formItemProps={item.formItemProps}
name={item.key ?? item.dataIndex} name={item?.key ?? item?.dataIndex}
colProps={item.colProps ?? colProps} colProps={item.colProps ?? colProps}
label={item.title} label={item.title}
/> />
...@@ -1193,7 +1193,7 @@ function UploadBtn({ item, colProps }) { ...@@ -1193,7 +1193,7 @@ function UploadBtn({ item, colProps }) {
}, },
}} }}
transform={(value) => { transform={(value) => {
const key = item.key ?? item.dataIndex; const key = item?.key ?? item?.dataIndex;
const transvalue = value?.map((it) => { const transvalue = value?.map((it) => {
if (it.response) { if (it.response) {
return it?.response?.data?.dataList[0]; return it?.response?.data?.dataList[0];
...@@ -1206,7 +1206,7 @@ function UploadBtn({ item, colProps }) { ...@@ -1206,7 +1206,7 @@ function UploadBtn({ item, colProps }) {
}; };
}} }}
formItemProps={item.formItemProps} formItemProps={item.formItemProps}
name={item.key ?? item.dataIndex} name={item?.key ?? item?.dataIndex}
colProps={item.colProps ?? colProps} colProps={item.colProps ?? colProps}
label={item.title} label={item.title}
title={`上传${item.title}`} title={`上传${item.title}`}
...@@ -1325,7 +1325,7 @@ function UploadImage({ item, colProps }) { ...@@ -1325,7 +1325,7 @@ function UploadImage({ item, colProps }) {
let col = item.colProps ?? colProps; let col = item.colProps ?? colProps;
return ( return (
<Col {...col}> <Col {...col}>
<Form.Item name={item.key ?? item.dataIndex} label={item.title} {...item.formItemProps}> <Form.Item name={item?.key ?? item?.dataIndex} label={item.title} {...item.formItemProps}>
<UploadImg fieldProps={{ ...item?.fieldProps }} /> <UploadImg fieldProps={{ ...item?.fieldProps }} />
</Form.Item> </Form.Item>
</Col> </Col>
...@@ -1355,7 +1355,7 @@ function UploadDragger({ item, colProps }) { ...@@ -1355,7 +1355,7 @@ function UploadDragger({ item, colProps }) {
}, },
}} }}
transform={(value) => { transform={(value) => {
const key = item.key ?? item.dataIndex; const key = item?.key ?? item?.dataIndex;
const transvalue = value?.map((it) => { const transvalue = value?.map((it) => {
if (it.response) { if (it.response) {
return it?.response?.data?.dataList[0]; return it?.response?.data?.dataList[0];
...@@ -1368,7 +1368,7 @@ function UploadDragger({ item, colProps }) { ...@@ -1368,7 +1368,7 @@ function UploadDragger({ item, colProps }) {
}; };
}} }}
formItemProps={item.formItemProps} formItemProps={item.formItemProps}
name={item.key ?? item.dataIndex} name={item?.key ?? item?.dataIndex}
colProps={item.colProps ?? colProps} colProps={item.colProps ?? colProps}
label={item.title} label={item.title}
/> />
...@@ -1379,7 +1379,7 @@ function UploadDragger({ item, colProps }) { ...@@ -1379,7 +1379,7 @@ function UploadDragger({ item, colProps }) {
// editor // editor
function Editor({ item, colProps, formRef }) { function Editor({ item, colProps, formRef }) {
let col = item.colProps ?? colProps; let col = item.colProps ?? colProps;
let curkey = item.key ?? item.dataIndex; let curkey = item?.key ?? item?.dataIndex;
return ( return (
<Col {...col}> <Col {...col}>
<ProForm.Item <ProForm.Item
...@@ -1410,7 +1410,7 @@ function Editor({ item, colProps, formRef }) { ...@@ -1410,7 +1410,7 @@ function Editor({ item, colProps, formRef }) {
// editor // editor
function Diyrules({ item, colProps, formRef }) { function Diyrules({ item, colProps, formRef }) {
let col = item.colProps ?? colProps; let col = item.colProps ?? colProps;
let curkey = item.key ?? item.dataIndex; let curkey = item?.key ?? item?.dataIndex;
return ( return (
<Col {...col}> <Col {...col}>
<ProForm.Item <ProForm.Item
...@@ -1446,7 +1446,7 @@ function FormList({ item, colProps, formRef }) { ...@@ -1446,7 +1446,7 @@ function FormList({ item, colProps, formRef }) {
return ( return (
<Col {...col}> <Col {...col}>
<ProFormList <ProFormList
name={item.key ?? item.dataIndex} name={item?.key ?? item?.dataIndex}
label={item.title} label={item.title}
min={item.min ?? 0} min={item.min ?? 0}
max={item.max ?? 100} max={item.max ?? 100}
...@@ -1463,7 +1463,7 @@ function FormList({ item, colProps, formRef }) { ...@@ -1463,7 +1463,7 @@ function FormList({ item, colProps, formRef }) {
action={action} action={action}
curindex={index} curindex={index}
formRef={formRef} formRef={formRef}
name={item.key ?? item.dataIndex} name={item?.key ?? item?.dataIndex}
/> />
); );
}} }}
...@@ -1682,7 +1682,7 @@ function LinkSelectList({ item, colProps, formRef, name, curindex }) { ...@@ -1682,7 +1682,7 @@ function LinkSelectList({ item, colProps, formRef, name, curindex }) {
<Col {...col}> <Col {...col}>
<ProFormDependency name={Object.keys(curlinkparams)}> <ProFormDependency name={Object.keys(curlinkparams)}>
{(params) => { {(params) => {
const curkey = item.key ?? item.dataIndex; const curkey = item?.key ?? item?.dataIndex;
let result = {}; let result = {};
for (let key in curlinkparams) { for (let key in curlinkparams) {
let reversekey = !curlinkparams[key] ? key : curlinkparams[key]; let reversekey = !curlinkparams[key] ? key : curlinkparams[key];
...@@ -1701,7 +1701,7 @@ function LinkSelectList({ item, colProps, formRef, name, curindex }) { ...@@ -1701,7 +1701,7 @@ function LinkSelectList({ item, colProps, formRef, name, curindex }) {
function NolinkSelectList({ item, colProps, formRef }) { function NolinkSelectList({ item, colProps, formRef }) {
let col = item.colProps ?? colProps; let col = item.colProps ?? colProps;
let curkey = item.key ?? item.dataIndex; //获取key let curkey = item?.key ?? item?.dataIndex; //获取key
return ( return (
<Col {...col}> <Col {...col}>
<Form.Item name={curkey} label={item.title} {...item.formItemProps}> <Form.Item name={curkey} label={item.title} {...item.formItemProps}>
......
...@@ -13,6 +13,7 @@ import { doFetch } from '@/utils/doFetch'; ...@@ -13,6 +13,7 @@ import { doFetch } from '@/utils/doFetch';
import styles from './index.less'; import styles from './index.less';
import FormItems from './FormItems'; import FormItems from './FormItems';
import ExtendField from '@/components/ExtendField'; import ExtendField from '@/components/ExtendField';
import { Input, Col } from 'antd';
function upperCase(str) { function upperCase(str) {
const newStr = str.slice(0, 1).toUpperCase() + str.slice(1); const newStr = str.slice(0, 1).toUpperCase() + str.slice(1);
...@@ -35,6 +36,15 @@ let FormRender = memo(({ fields = [], colProps, proformRef }) => { ...@@ -35,6 +36,15 @@ let FormRender = memo(({ fields = [], colProps, proformRef }) => {
</div> </div>
); );
} }
if (item?.valueType == 'nosubmit') {
return (
<Col {...(item.colProps ?? { span: 12 })} style={{ marginBottom: 24 }}>
<label style={{ marginBottom: 8, display: 'block' }}>{item?.title}</label>
<Input disabled value={item?.initialValue} />
</Col>
);
}
if (hideInForm && Object.keys(hideInForm)) { if (hideInForm && Object.keys(hideInForm)) {
return ( return (
<ProFormDependency name={Object.keys(hideInForm)}> <ProFormDependency name={Object.keys(hideInForm)}>
......
...@@ -158,6 +158,13 @@ function getcolumns(setdrawer) { ...@@ -158,6 +158,13 @@ function getcolumns(setdrawer) {
key: 'inWarehouseName', key: 'inWarehouseName',
hideInForm: true, hideInForm: true,
}, },
{
title: '入库仓库',
dataIndex: 'nosubmits',
initialValue: '备件仓库',
valueType: 'nosubmit',
hideInDescriptions: true,
},
{ {
title: '出库仓库', title: '出库仓库',
dataIndex: 'outWarehouseName', dataIndex: 'outWarehouseName',
...@@ -322,6 +329,13 @@ function getcolumns(setdrawer) { ...@@ -322,6 +329,13 @@ function getcolumns(setdrawer) {
key: 'inWarehouseName', key: 'inWarehouseName',
hideInForm: true, hideInForm: true,
}, },
{
title: '入库仓库',
dataIndex: 'nosubmits',
initialValue: '备件仓库',
valueType: 'nosubmit',
hideInDescriptions: true,
},
{ {
title: '出库仓库', title: '出库仓库',
dataIndex: 'outWarehouseName', dataIndex: 'outWarehouseName',
......
...@@ -139,6 +139,13 @@ function getcolumns(setdrawer) { ...@@ -139,6 +139,13 @@ function getcolumns(setdrawer) {
], ],
}, },
}, },
{
title: '出库仓库',
dataIndex: 'nosubmits',
initialValue: '备件仓库',
valueType: 'nosubmit',
hideInDescriptions: true,
},
{ {
title: '出库仓库', title: '出库仓库',
dataIndex: 'outWarehouseName', dataIndex: 'outWarehouseName',
...@@ -317,6 +324,13 @@ function getcolumns(setdrawer) { ...@@ -317,6 +324,13 @@ function getcolumns(setdrawer) {
], ],
}, },
}, },
{
title: '出库仓库',
dataIndex: 'nosubmits',
initialValue: '备件仓库',
valueType: 'nosubmit',
hideInDescriptions: true,
},
{ {
title: '出库仓库', title: '出库仓库',
dataIndex: 'outWarehouseName', dataIndex: 'outWarehouseName',
......
import AutoTable from '@/components/AutoTable/mtable'; import AutoTable from '@/components/AutoTable/mtable';
function getcolumns(type) { function getcolumns(type, fullName) {
const columns = [ const columns = [
{ {
title: '备件料号', title: '备件料号',
...@@ -82,6 +82,14 @@ function getcolumns(type) { ...@@ -82,6 +82,14 @@ function getcolumns(type) {
}, },
], ],
}, },
{
title: '入库仓库(个人)',
dataIndex: 'nosubmit',
initialValue: fullName,
valueType: 'nosubmit',
hideInForm: type !== 1,
hideInDescriptions: true,
},
{ {
title: '入库仓库', title: '入库仓库',
dataIndex: 'inWarehouseName', dataIndex: 'inWarehouseName',
...@@ -95,6 +103,13 @@ function getcolumns(type) { ...@@ -95,6 +103,13 @@ function getcolumns(type) {
}, },
hideInForm: type == 1, hideInForm: type == 1,
}, },
{
title: '出库仓库',
dataIndex: 'nosubmits',
initialValue: '备件仓库',
valueType: 'nosubmit',
hideInDescriptions: true,
},
{ {
title: '出库仓库', title: '出库仓库',
dataIndex: 'outWarehouseName', dataIndex: 'outWarehouseName',
...@@ -147,6 +162,7 @@ function getcolumns(type) { ...@@ -147,6 +162,7 @@ function getcolumns(type) {
key: 'status', key: 'status',
hideInForm: true, hideInForm: true,
valueType: 'select', valueType: 'select',
span: 3,
options: [ options: [
{ {
label: '待审批', label: '待审批',
...@@ -279,6 +295,14 @@ function getcolumns(type) { ...@@ -279,6 +295,14 @@ function getcolumns(type) {
}, },
], ],
}, },
{
title: '入库仓库(个人)',
dataIndex: 'nosubmit',
initialValue: fullName,
valueType: 'nosubmit',
hideInForm: type !== 1,
hideInDescriptions: true,
},
{ {
title: '入库仓库', title: '入库仓库',
dataIndex: 'inWarehouseName', dataIndex: 'inWarehouseName',
...@@ -292,6 +316,13 @@ function getcolumns(type) { ...@@ -292,6 +316,13 @@ function getcolumns(type) {
}, },
hideInForm: type == 1, hideInForm: type == 1,
}, },
{
title: '出库仓库',
dataIndex: 'nosubmits',
initialValue: '备件仓库',
valueType: 'nosubmit',
hideInDescriptions: true,
},
{ {
title: '出库仓库', title: '出库仓库',
dataIndex: 'outWarehouseName', dataIndex: 'outWarehouseName',
...@@ -355,6 +386,7 @@ function getcolumns(type) { ...@@ -355,6 +386,7 @@ function getcolumns(type) {
key: 'status', key: 'status',
hideInForm: true, hideInForm: true,
valueType: 'select', valueType: 'select',
span: 3,
options: [ options: [
{ {
label: '已驳回', label: '已驳回',
......
...@@ -9,6 +9,7 @@ import { useRequest } from 'ahooks'; ...@@ -9,6 +9,7 @@ import { useRequest } from 'ahooks';
import { doFetch } from '@/utils/doFetch'; import { doFetch } from '@/utils/doFetch';
import InitForm from '@/components/InitForm'; import InitForm from '@/components/InitForm';
import { message, Divider } from 'antd'; import { message, Divider } from 'antd';
import { useModel } from '@umijs/max';
function Requisition(props) { function Requisition(props) {
const actionRef = useRef(), const actionRef = useRef(),
...@@ -17,6 +18,9 @@ function Requisition(props) { ...@@ -17,6 +18,9 @@ function Requisition(props) {
open: false, open: false,
}), }),
[activeTabKey, setactiveTabKey] = useState('1'); [activeTabKey, setactiveTabKey] = useState('1');
const {
initialState: { currentUser },
} = useModel('@@initialState');
const { run, loading } = useRequest(doFetch, { const { run, loading } = useRequest(doFetch, {
manual: true, manual: true,
...@@ -134,7 +138,9 @@ function Requisition(props) { ...@@ -134,7 +138,9 @@ function Requisition(props) {
}; };
const columns = useMemo(() => { const columns = useMemo(() => {
let defcolumn = getcolumns(drawer?.type).filter((it) => it.key == activeTabKey)[0]?.columns; let defcolumn = getcolumns(drawer?.type, currentUser?.fullName).filter(
(it) => it.key == activeTabKey,
)[0]?.columns;
let defpath = let defpath =
getcolumns(drawer?.type).filter((it) => it.key == activeTabKey)[0]?.pathconfig ?? {}; getcolumns(drawer?.type).filter((it) => it.key == activeTabKey)[0]?.pathconfig ?? {};
return defcolumn.concat({ return defcolumn.concat({
......
import AutoTable from '@/components/AutoTable/mtable'; import AutoTable from '@/components/AutoTable/mtable';
function getcolumns(type) { function getcolumns(type, fullName) {
const columns = [ const columns = [
{ {
title: '备件料号', title: '备件料号',
...@@ -96,6 +96,21 @@ function getcolumns(type) { ...@@ -96,6 +96,21 @@ function getcolumns(type) {
key: 'inWarehouseName', key: 'inWarehouseName',
hideInForm: true, hideInForm: true,
}, },
{
title: '入库仓库',
dataIndex: 'nosubmits',
initialValue: '备件仓库',
valueType: 'nosubmit',
hideInDescriptions: true,
},
{
title: '出库仓库(个人)',
dataIndex: 'nosubmit',
initialValue: fullName,
valueType: 'nosubmit',
hideInForm: type !== 1,
hideInDescriptions: true,
},
{ {
title: '出库仓库', title: '出库仓库',
dataIndex: 'outWarehouseName', dataIndex: 'outWarehouseName',
...@@ -308,6 +323,21 @@ function getcolumns(type) { ...@@ -308,6 +323,21 @@ function getcolumns(type) {
key: 'inWarehouseName', key: 'inWarehouseName',
hideInForm: true, hideInForm: true,
}, },
{
title: '入库仓库',
dataIndex: 'nosubmits',
initialValue: '备件仓库',
valueType: 'nosubmit',
hideInDescriptions: true,
},
{
title: '出库仓库(个人)',
dataIndex: 'nosubmit',
initialValue: fullName,
valueType: 'nosubmit',
hideInForm: type !== 1,
hideInDescriptions: true,
},
{ {
title: '出库仓库', title: '出库仓库',
dataIndex: 'outWarehouseName', dataIndex: 'outWarehouseName',
......
...@@ -8,6 +8,7 @@ import { useRequest } from 'ahooks'; ...@@ -8,6 +8,7 @@ import { useRequest } from 'ahooks';
import { doFetch } from '@/utils/doFetch'; import { doFetch } from '@/utils/doFetch';
import InitForm from '@/components/InitForm'; import InitForm from '@/components/InitForm';
import { message, Divider } from 'antd'; import { message, Divider } from 'antd';
import { useModel } from '@umijs/max';
function Spareback(props) { function Spareback(props) {
const actionRef = useRef(), const actionRef = useRef(),
...@@ -16,7 +17,9 @@ function Spareback(props) { ...@@ -16,7 +17,9 @@ function Spareback(props) {
open: false, open: false,
}), }),
[activeTabKey, setactiveTabKey] = useState('1'); [activeTabKey, setactiveTabKey] = useState('1');
const {
initialState: { currentUser },
} = useModel('@@initialState');
const { run, loading } = useRequest(doFetch, { const { run, loading } = useRequest(doFetch, {
manual: true, manual: true,
onSuccess: (res, params) => { onSuccess: (res, params) => {
...@@ -133,7 +136,9 @@ function Spareback(props) { ...@@ -133,7 +136,9 @@ function Spareback(props) {
}; };
const columns = useMemo(() => { const columns = useMemo(() => {
let defcolumn = getcolumns(drawer?.type).filter((it) => it.key == activeTabKey)[0]?.columns; let defcolumn = getcolumns(drawer?.type, currentUser?.fullName).filter(
(it) => it.key == activeTabKey,
)[0]?.columns;
let defpath = let defpath =
getcolumns(drawer?.type).filter((it) => it.key == activeTabKey)[0]?.pathconfig ?? {}; getcolumns(drawer?.type).filter((it) => it.key == activeTabKey)[0]?.pathconfig ?? {};
return defcolumn.concat({ return defcolumn.concat({
......
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