feat: 分布式设备/设备列表

develop
JINGYJ 1 year ago
parent 04770db8ae
commit df386de507

@ -142,7 +142,7 @@ const CreateForm: React.FC<CreateFormProps> = (props) => {
/> />
} }
/> />
<ProFormText {/* <ProFormText
width={proFormItemStyleProps.column2Width} width={proFormItemStyleProps.column2Width}
name="position" name="position"
label={<FormattedMessage id="device.device.table.list.position" defaultMessage="$$$" />} label={<FormattedMessage id="device.device.table.list.position" defaultMessage="$$$" />}
@ -205,7 +205,7 @@ const CreateForm: React.FC<CreateFormProps> = (props) => {
}; };
}); });
}} }}
/> /> */}
<ProFormText <ProFormText
width={proFormItemStyleProps.column2Width} width={proFormItemStyleProps.column2Width}

@ -114,7 +114,7 @@ const UpdateForm: React.FC<UpdateFormProps> = (props) => {
}, },
]} ]}
/> />
<ProFormText {/* <ProFormText
width={proFormItemStyleProps.column2Width} width={proFormItemStyleProps.column2Width}
name="position" name="position"
label={<FormattedMessage id="device.device.table.list.position" defaultMessage="$$$" />} label={<FormattedMessage id="device.device.table.list.position" defaultMessage="$$$" />}
@ -211,7 +211,7 @@ const UpdateForm: React.FC<UpdateFormProps> = (props) => {
}; };
}); });
}} }}
/> /> */}
<ProFormText <ProFormText
width={proFormItemStyleProps.column2Width} width={proFormItemStyleProps.column2Width}
@ -228,14 +228,14 @@ const UpdateForm: React.FC<UpdateFormProps> = (props) => {
initialValue={props.values.remark} initialValue={props.values.remark}
disabled={false} disabled={false}
/> />
<ProFormSwitch {/* <ProFormSwitch
width={proFormItemStyleProps.column2Width} width={proFormItemStyleProps.column2Width}
name="isEnable" name="isEnable"
label={<FormattedMessage id="device.device.table.list.isEnable" defaultMessage="$$$" />} label={<FormattedMessage id="device.device.table.list.isEnable" defaultMessage="$$$" />}
initialValue={props.values.isEnable} initialValue={props.values.isEnable}
disabled={false} disabled={false}
/> /> */}
<ProFormDateTimePicker {/* <ProFormDateTimePicker
width={proFormItemStyleProps.column2Width} width={proFormItemStyleProps.column2Width}
name="createTime" name="createTime"
label={<FormattedMessage id="device.device.table.list.createTime" defaultMessage="$$$" />} label={<FormattedMessage id="device.device.table.list.createTime" defaultMessage="$$$" />}
@ -264,7 +264,7 @@ const UpdateForm: React.FC<UpdateFormProps> = (props) => {
required={false} required={false}
initialValue={props.values.updateTime} initialValue={props.values.updateTime}
disabled={true} disabled={true}
/> /> */}
</ProForm.Group> </ProForm.Group>
</ModalForm> </ModalForm>
); );

@ -244,140 +244,140 @@ const DeviceList: React.FC = () => {
hideInSearch: true, hideInSearch: true,
}, },
{ // {
title: <FormattedMessage id="DCSDeviceList.device.table.list.position" defaultMessage="$$$" />, // title: <FormattedMessage id="DCSDeviceList.device.table.list.position" defaultMessage="$$$" />,
dataIndex: 'position', // dataIndex: 'position',
hideInSearch: true, // hideInSearch: true,
}, // },
{ // {
title: <FormattedMessage id="DCSDeviceList.device.table.list.param" defaultMessage="$$$" />, // title: <FormattedMessage id="DCSDeviceList.device.table.list.param" defaultMessage="$$$" />,
dataIndex: 'param', // dataIndex: 'param',
hideInSearch: true, // hideInSearch: true,
}, // },
{ // {
title: <FormattedMessage id="DCSDeviceList.device.table.list.spec" defaultMessage="$$$" />, // title: <FormattedMessage id="DCSDeviceList.device.table.list.spec" defaultMessage="$$$" />,
dataIndex: 'spec', // dataIndex: 'spec',
hideInSearch: true, // hideInSearch: true,
}, // },
{ // {
title: <FormattedMessage id="DCSDeviceList.device.table.list.categoryFkId" defaultMessage="$$$" />, // title: <FormattedMessage id="DCSDeviceList.device.table.list.categoryFkId" defaultMessage="$$$" />,
dataIndex: 'categoryFkId', // dataIndex: 'categoryFkId',
hideInSearch: true, // hideInSearch: true,
render: (text, record) => { // render: (text, record) => {
if (category_fk_id_column_open) { // if (category_fk_id_column_open) {
return ( // return (
<a // <a
onClick={() => { // onClick={() => {
handle_category_fk_id(record.categoryFkId); // handle_category_fk_id(record.categoryFkId);
}} // }}
> // >
{record?.categoryFkId ? categoryFkIdMap[record.categoryFkId] : undefined} // {record?.categoryFkId ? categoryFkIdMap[record.categoryFkId] : undefined}
</a> // </a>
); // );
} else { // } else {
return ( // return (
<a // <a
onClick={() => { // onClick={() => {
handle_category_fk_id(record.categoryFkId); // handle_category_fk_id(record.categoryFkId);
}} // }}
> // >
{record.categoryFkId} // {record.categoryFkId}
</a> // </a>
); // );
} // }
}, // },
renderFormItem: () => { // renderFormItem: () => {
return ( // return (
// value 和 onchange 会通过 form 自动注入。 // // value 和 onchange 会通过 form 自动注入。
<ProFormSelect // <ProFormSelect
placeholder={`${intl.formatMessage({ // placeholder={`${intl.formatMessage({
id: 'common.please_select', // id: 'common.please_select',
defaultMessage: '$$$', // defaultMessage: '$$$',
})}`} // })}`}
required={false} // required={false}
showSearch // showSearch
debounceTime={1000} // debounceTime={1000}
request={async (keyWord) => { // request={async (keyWord) => {
const resp = await postDeviceCategoryGetDeviceCategoryFkSelect({ // const resp = await postDeviceCategoryGetDeviceCategoryFkSelect({
keyword: keyWord?.keyWords || '', // keyword: keyWord?.keyWords || '',
}); // });
return resp.data.list.map((v: any) => { // return resp.data.list.map((v: any) => {
return { // return {
label: v.name, // label: v.name,
value: v.id, // value: v.id,
}; // };
}); // });
}} // }}
/> // />
); // );
}, // },
}, // },
{ // {
title: <FormattedMessage id="DCSDeviceList.device.table.list.groupFkId" defaultMessage="$$$" />, // title: <FormattedMessage id="DCSDeviceList.device.table.list.groupFkId" defaultMessage="$$$" />,
dataIndex: 'groupFkId', // dataIndex: 'groupFkId',
hideInSearch: true, // hideInSearch: true,
render: (text, record) => { // render: (text, record) => {
if (group_fk_id_column_open) { // if (group_fk_id_column_open) {
return ( // return (
<a // <a
onClick={() => { // onClick={() => {
handle_group_fk_id(record.groupFkId); // handle_group_fk_id(record.groupFkId);
}} // }}
> // >
{record?.groupFkId ? groupFkIdMap[record.groupFkId] : undefined} // {record?.groupFkId ? groupFkIdMap[record.groupFkId] : undefined}
</a> // </a>
); // );
} else { // } else {
return ( // return (
<a // <a
onClick={() => { // onClick={() => {
handle_group_fk_id(record.groupFkId); // handle_group_fk_id(record.groupFkId);
}} // }}
> // >
{record.groupFkId} // {record.groupFkId}
</a> // </a>
); // );
} // }
}, // },
renderFormItem: () => { // renderFormItem: () => {
return ( // return (
// value 和 onchange 会通过 form 自动注入。 // // value 和 onchange 会通过 form 自动注入。
<ProFormSelect // <ProFormSelect
placeholder={`${intl.formatMessage({ // placeholder={`${intl.formatMessage({
id: 'common.please_select', // id: 'common.please_select',
defaultMessage: '$$$', // defaultMessage: '$$$',
})}`} // })}`}
required={false} // required={false}
showSearch // showSearch
debounceTime={1000} // debounceTime={1000}
request={async (keyWord) => { // request={async (keyWord) => {
const resp = await postDeviceGroupGetDeviceGroupFkSelect({ // const resp = await postDeviceGroupGetDeviceGroupFkSelect({
keyword: keyWord?.keyWords || '', // keyword: keyWord?.keyWords || '',
}); // });
return resp.data.list.map((v: any) => { // return resp.data.list.map((v: any) => {
return { // return {
label: v.name, // label: v.name,
value: v.id, // value: v.id,
}; // };
}); // });
}} // }}
/> // />
); // );
}, // },
}, // },
{ // {
title: <FormattedMessage id="DCSDeviceList.device.table.list.isEnable" defaultMessage="$$$" />, // title: <FormattedMessage id="DCSDeviceList.device.table.list.isEnable" defaultMessage="$$$" />,
dataIndex: 'isEnable', // dataIndex: 'isEnable',
filters: true, // filters: true,
onFilter: true, // onFilter: true,
hideInSearch: true, // hideInSearch: true,
valueType: 'switch', // valueType: 'switch',
}, // },
{ {
title: <FormattedMessage id="DCSDeviceList.device.table.list.remark" defaultMessage="$$$" />, title: <FormattedMessage id="DCSDeviceList.device.table.list.remark" defaultMessage="$$$" />,
@ -579,7 +579,7 @@ const DeviceList: React.FC = () => {
accessible={access.canUpdate(history.location.pathname)} accessible={access.canUpdate(history.location.pathname)}
key={`${history.location.pathname}-add`} key={`${history.location.pathname}-add`}
> >
<Button {/* <Button
type="primary" type="primary"
key="category_fk_id_show" key="category_fk_id_show"
onClick={() => { onClick={() => {
@ -610,7 +610,7 @@ const DeviceList: React.FC = () => {
<FormattedMessage id="common.show" defaultMessage="$$$" /> <FormattedMessage id="common.show" defaultMessage="$$$" />
)} )}
<FormattedMessage id="DCSDeviceList.device.table.list.groupFkId" defaultMessage="$$$" /> <FormattedMessage id="DCSDeviceList.device.table.list.groupFkId" defaultMessage="$$$" />
</Button> </Button> */}
<Button <Button
type="primary" type="primary"

Loading…
Cancel
Save