From 5807fc22aba974b4ca85a8049ecd983673b0ca28 Mon Sep 17 00:00:00 2001
From: skyouc <958836976@qq.com>
Date: 星期一, 20 十月 2025 16:59:34 +0800
Subject: [PATCH] 1. 添加大屏接口 2. 任务站点确认修改
---
rsf-admin/src/page/waitPakin/SelectSiteModel.jsx | 44 +++++++++++++++++++++++++++-----------------
1 files changed, 27 insertions(+), 17 deletions(-)
diff --git a/rsf-admin/src/page/waitPakin/SelectSiteModel.jsx b/rsf-admin/src/page/waitPakin/SelectSiteModel.jsx
index 26ed4ed..cb61972 100644
--- a/rsf-admin/src/page/waitPakin/SelectSiteModel.jsx
+++ b/rsf-admin/src/page/waitPakin/SelectSiteModel.jsx
@@ -19,6 +19,27 @@
},
}));
+const SelectSiteButton = (props) => {
+ const { source, setOpen, refresh, notify } = props;
+ const record = useRecordContext();
+
+ const handleClick = async () => {
+ setOpen(false);
+ const id = record.id;
+ const res = await request.post(`/waitPakin/merge`, {waitPakins: source, siteId: id});
+ if (res?.data?.code === 200) {
+ refresh();
+ notify(res.data.msg);
+ } else {
+ notify(res.data.msg);
+ }
+ };
+
+ return (
+ <Button label="toolbar.selectSite" onClick={handleClick} />
+ );
+};
+
const SelectSiteModel = (props) => {
const { open, setOpen, source } = props;
const translate = useTranslate();
@@ -30,11 +51,10 @@
setOpen(false);
}
};
- console.log(source);
return (
<Box>
<Dialog
- sx={{width: '90%'}}
+ sx={{width: '100%'}}
open={open}
onClose={handleClose}
fullWidth
@@ -43,10 +63,12 @@
>
<DialogTitle>
{translate('toolbar.selectSite')}
+ <DialogCloseButton onClose={() => setOpen(false)} />
</DialogTitle>
<DialogContent>
<List
resource='deviceSite'
+ filter={{type : 1}}
sx={{
flexGrow: 1,
transition: (theme) =>
@@ -68,17 +90,7 @@
<StyledDatagrid
preferenceKey='deviceSite'
bulkActionButtons={false}
- rowClick='toggleSelection'
- onToggleItem={async (id)=>{
- setOpen(false);
- const res = await request.post(`/waitPakin/merge`, {waitPakins: source, siteId: id});
- if (res?.data?.code === 200) {
- refresh();
- notify(res.data.msg);
- } else {
- notify(res.data.msg);
- }
- }}
+ rowClick={false}
omit={['id','name', 'createTime','label', 'createBy', 'memo', 'updateBy$', 'createBy$', 'createTime', 'updateTime']}
>
<NumberField source="id" />
@@ -97,13 +109,11 @@
<BooleanField source="statusBool" label="common.field.status" sortable={false} />
<TextField source="memo" label="common.field.memo" sortable={false} />
<WrapperField cellClassName="opt" label="common.field.opt">
- <Button label="toolbar.selectSite" onClick={(event)=>{
- setOpen(false)
- }}/>
+ <SelectSiteButton source={source} setOpen={setOpen} refresh={refresh} notify={notify} />
</WrapperField>
</StyledDatagrid>
</List>
- </DialogContent>
+ </DialogContent>
</Dialog>
</Box>
)
--
Gitblit v1.9.1