@@ -47,7 +47,7 @@ const PayTemplate = () => { | |||
del(input).then((re) => { | |||
if (re.data) { | |||
message.success('删除成功'); | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
} else { | |||
message.error('删除失败'); | |||
} | |||
@@ -116,7 +116,7 @@ const PayTemplate = () => { | |||
if (re.data) { | |||
message.success('修改成功'); | |||
setDrawerVisible(false); | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
} else { | |||
message.error(re.errors||'修改失败'); | |||
} | |||
@@ -126,7 +126,7 @@ const PayTemplate = () => { | |||
if (re.data) { | |||
message.success('添加成功'); | |||
setDrawerVisible(false); | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
} else { | |||
message.error(re.errors||'添加失败'); | |||
} | |||
@@ -82,7 +82,7 @@ const PayTemplate = () => { | |||
deletepaytemplate(input).then((re) => { | |||
if (re.data) { | |||
message.success('删除成功'); | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
} else { | |||
message.error(re.errors||'删除失败'); | |||
} | |||
@@ -167,7 +167,7 @@ const PayTemplate = () => { | |||
if (re.data) { | |||
message.success('修改成功'); | |||
setDrawerVisible(false); | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
} else { | |||
message.error(re.errors||'修改失败'); | |||
} | |||
@@ -177,7 +177,7 @@ const PayTemplate = () => { | |||
if (re.data) { | |||
message.success('添加成功'); | |||
setDrawerVisible(false); | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
} else { | |||
message.error(re.errors||'添加失败'); | |||
} | |||
@@ -210,7 +210,7 @@ const Material = () => { | |||
if (response.statusCode === 200) { | |||
message.success('更新成功'); | |||
setIsModalVisible(false); | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
} else { | |||
message.error(response.errors||'更新失败') | |||
} | |||
@@ -219,7 +219,7 @@ const Material = () => { | |||
if (response.statusCode === 200) { | |||
message.success('添加成功'); | |||
setIsModalVisible(false); | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
} else { | |||
message.error(response.errors||'添加失败') | |||
} | |||
@@ -265,7 +265,7 @@ const Material = () => { | |||
const onDeleteMaterial = async (record) => { | |||
const response = await appletAPI.DeleteMiniMaterial(record.id); | |||
if (response.statusCode === 200) { | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
message.success('删除成功'); | |||
} else { | |||
message.error(response.errors || '删除失败'); | |||
@@ -308,11 +308,11 @@ const Material = () => { | |||
if (!selectedStore) return; | |||
onFetchMiniPageList(); | |||
if(!selectedPage) return; | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
}, [selectedStore]); | |||
useEffect(() => { | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
}, [selectedPage]); | |||
return <PageContainer header={{ | |||
@@ -342,7 +342,7 @@ const Material = () => { | |||
</div> | |||
<Select style={{ width: 300 }} value={selectedPage} onChange={(value) => { | |||
setSelectedPage(value); | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
}}> | |||
{ | |||
miniPageList.map(item => { | |||
@@ -208,7 +208,7 @@ const Material = () => { | |||
if (response.statusCode === 200) { | |||
message.success('更新成功'); | |||
setIsModalVisible(false); | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
} else { | |||
message.error('更新失败') | |||
} | |||
@@ -217,7 +217,7 @@ const Material = () => { | |||
if (response.statusCode === 200) { | |||
message.success('添加成功'); | |||
setIsModalVisible(false); | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
} else { | |||
message.error('添加失败') | |||
} | |||
@@ -263,7 +263,7 @@ const Material = () => { | |||
const onDeleteMaterial = async (record) => { | |||
const response = await appletAPI.DeleteMiniMaterial(record.id); | |||
if (response.statusCode === 200) { | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
message.success('删除成功'); | |||
} else { | |||
message.error(response.errors || '删除失败'); | |||
@@ -304,7 +304,7 @@ const Material = () => { | |||
useEffect(() => { | |||
if (!selectedStore) return; | |||
onFetchMiniPageList(); | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
}, [selectedStore]); | |||
return <PageContainer> | |||
@@ -332,11 +332,11 @@ const Material = () => { | |||
editable={{ | |||
type: 'multiple', | |||
}} | |||
request={async () => { | |||
request={async (params) => { | |||
if (!selectedStore) return; | |||
const jsonData = { | |||
"current": currentPage, | |||
"pageSize": pageSize, | |||
"current": params.current, | |||
"pageSize": params.pageSize, | |||
"storeId": selectedStore | |||
} | |||
const response = await appletAPI.MinimaterialListByStore(jsonData); | |||
@@ -69,7 +69,7 @@ const pageManage = () => { | |||
if (response.statusCode === 200) { | |||
message.success('修改成功'); | |||
setIsModalVisible(false); | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
} else { | |||
message.error(response.errors); | |||
} | |||
@@ -78,7 +78,7 @@ const pageManage = () => { | |||
if (response.statusCode === 200) { | |||
message.success('添加成功'); | |||
setIsModalVisible(false); | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
} else { | |||
message.error(response.errors); | |||
} | |||
@@ -93,7 +93,7 @@ const pageManage = () => { | |||
const response = await appletAPI.MiniPageDelete(record.id); | |||
if (response.statusCode === 200) { | |||
message.success('删除成功'); | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
} else { | |||
message.error(response.errors); | |||
} | |||
@@ -117,7 +117,7 @@ const pageManage = () => { | |||
}, []); | |||
useEffect(() => { | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
}, [selectedStore]); | |||
return <PageContainer> | |||
@@ -144,11 +144,11 @@ const pageManage = () => { | |||
editable={{ | |||
type: 'multiple', | |||
}} | |||
request={async () => { | |||
request={async (params) => { | |||
if (!selectedStore) return; | |||
const jsonData = { | |||
"current": currentPage, | |||
"pageSize": pageSize, | |||
"current": params.current, | |||
"pageSize": params.pageSize, | |||
"storeId": selectedStore | |||
} | |||
const response = await appletAPI.MiniPageList(jsonData); | |||
@@ -78,7 +78,7 @@ const pageManage = () => { | |||
if (response.statusCode === 200) { | |||
message.success('修改成功'); | |||
setIsModalVisible(false); | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
} else { | |||
message.error(response.errors); | |||
} | |||
@@ -87,7 +87,7 @@ const pageManage = () => { | |||
if (response.statusCode === 200) { | |||
message.success('添加成功'); | |||
setIsModalVisible(false); | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
} else { | |||
message.error(response.errors); | |||
} | |||
@@ -102,7 +102,7 @@ const pageManage = () => { | |||
const response = await appletAPI.MiniPageDelete(record.id); | |||
if (response.statusCode === 200) { | |||
message.success('删除成功'); | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
} else { | |||
message.error(response.errors); | |||
} | |||
@@ -126,7 +126,7 @@ const pageManage = () => { | |||
}, []); | |||
useEffect(() => { | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
}, [selectedStore]); | |||
return <PageContainer header={{ | |||
@@ -162,11 +162,11 @@ const pageManage = () => { | |||
editable={{ | |||
type: 'multiple', | |||
}} | |||
request={async () => { | |||
request={async (params) => { | |||
if (!selectedStore) return; | |||
const jsonData = { | |||
"current": currentPage, | |||
"pageSize": pageSize, | |||
"current": params.current, | |||
"pageSize": params.pageSize, | |||
"storeId": selectedStore | |||
} | |||
const response = await appletAPI.MiniPageList(jsonData); | |||
@@ -221,7 +221,7 @@ const companyManage = () => { | |||
api.removeCompany([record.id]).then((r) => { | |||
message.success('删除成功,即将刷新'); | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
}); | |||
}} | |||
onCancel={() => { }} | |||
@@ -345,7 +345,7 @@ const companyManage = () => { | |||
setCurrentRow(undefined); | |||
if (actionRef.current) { | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
} | |||
} | |||
actionRef.current?.reload(); | |||
@@ -371,7 +371,7 @@ const companyManage = () => { | |||
handleUpdateMenuModalVisible(false); | |||
setStepFormValues({}); | |||
if (actionRef.current) { | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
} | |||
} | |||
}} | |||
@@ -228,7 +228,7 @@ const ProductManage = () => { | |||
api.removeProduct([record.id]).then((r) => { | |||
if (r.succeeded) { | |||
message.success('删除成功'); | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
} else { | |||
message.error(e.error); | |||
} | |||
@@ -335,11 +335,11 @@ const ProductManage = () => { | |||
handleModalVisible(false); | |||
if (actionRef.current) { | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
} | |||
} | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
}} | |||
onCancel={() => { | |||
handleModalVisible(false); | |||
@@ -253,7 +253,7 @@ const Advanced = (props) => { | |||
if(r.succeeded){ | |||
message.success('修改成功'); | |||
setUpdateBomVisible(false); | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
setBomId('') | |||
}else{ | |||
message.error(r.errors); | |||
@@ -268,7 +268,7 @@ const Advanced = (props) => { | |||
if(r.succeeded){ | |||
message.success('修改成功'); | |||
setBomBatchingVisible(false); | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
setBomId('') | |||
}else{ | |||
message.error(r.errors); | |||
@@ -343,12 +343,12 @@ const Advanced = (props) => { | |||
DelGoodsBom(record.id); | |||
hide(); | |||
message.success('删除成功,即将刷新'); | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
return true; | |||
} catch (error) { | |||
hide(); | |||
message.error('删除失败,请重试'); | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
return false; | |||
} | |||
}} | |||
@@ -564,7 +564,7 @@ const Advanced = (props) => { | |||
if (success) { | |||
handleGoodsBomModalVisible(false); | |||
} | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
}} | |||
onCancel={() => { | |||
handleGoodsBomModalVisible(false); | |||
@@ -585,7 +585,7 @@ const Advanced = (props) => { | |||
}else{ | |||
message.error("添加失败") | |||
} | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
}) | |||
}} | |||
goodsid={props.location.query.values?.id} | |||
@@ -53,7 +53,7 @@ const goodsattribute = (props) => { | |||
await deletegoodsattribute(selectedRows.map((row) => row.id)).then((r) => { | |||
if (r.succeeded) { | |||
message.success('删除成功'); | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
} else { | |||
message.error(r.errors); | |||
} | |||
@@ -72,7 +72,7 @@ const handleAdd = async (fields) => { | |||
await addgoodsattribute(JSON.stringify(fields)).then((r) => { | |||
if (r.succeeded) { | |||
message.success('添加成功'); | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
} else { | |||
message.error(r.errors); | |||
} | |||
@@ -102,7 +102,7 @@ const handleUpdate = async (fields) => { | |||
}).then((r) => { | |||
if (r.succeeded) { | |||
message.success('修改成功'); | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
} else { | |||
message.error(r.errors); | |||
} | |||
@@ -192,7 +192,7 @@ const handleUpdate = async (fields) => { | |||
await deletegoodsattribute([record.id]).then((r) => { | |||
if (r.succeeded) { | |||
message.success('删除成功'); | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
} else { | |||
message.error(r.errors); | |||
} | |||
@@ -305,7 +305,7 @@ const handleUpdate = async (fields) => { | |||
setCurrentRow(undefined); | |||
if (actionRef.current) { | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
} | |||
} | |||
}} | |||
@@ -330,7 +330,7 @@ const handleUpdate = async (fields) => { | |||
if(r.data){ | |||
message.success('保存成功'); | |||
handleMattrodalVisible(false); | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
}else{ | |||
message.error("保存失败"); | |||
} | |||
@@ -51,7 +51,7 @@ const goodsattribute = (props) => { | |||
await deletegoodsattribute(selectedRows.map((row) => row.id)).then((r) => { | |||
if (r.succeeded) { | |||
message.success('删除成功'); | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
} else { | |||
message.error(r.errors); | |||
} | |||
@@ -70,7 +70,7 @@ const handleAdd = async (fields) => { | |||
await addgoodsattribute(JSON.stringify(fields)).then((r) => { | |||
if (r.succeeded) { | |||
message.success('添加成功'); | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
} else { | |||
message.error(r.errors); | |||
} | |||
@@ -95,7 +95,7 @@ const handleUpdate = async (fields) => { | |||
await addgoodsattribute(fields).then((r) => { | |||
if (r.succeeded) { | |||
message.success('修改成功'); | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
} else { | |||
message.error(r.errors); | |||
} | |||
@@ -185,7 +185,7 @@ const handleUpdate = async (fields) => { | |||
await deletegoodsattribute([record.id]).then((r) => { | |||
if (r.succeeded) { | |||
message.success('删除成功'); | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
} else { | |||
message.error(r.errors); | |||
} | |||
@@ -297,7 +297,7 @@ const handleUpdate = async (fields) => { | |||
setCurrentRow(undefined); | |||
if (actionRef.current) { | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
} | |||
} | |||
}} | |||
@@ -310,7 +310,7 @@ const handleUpdate = async (fields) => { | |||
deletegoodsattributevalue(id).then((r)=>{ | |||
if (r.succeeded) { | |||
message.success('删除成功'); | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
} else { | |||
message.error(r.errors); | |||
} | |||
@@ -43,7 +43,7 @@ const CreateForm = (props) => { | |||
// await deletegoodsattribute([record.id]).then((r) => { | |||
// if (r.succeeded) { | |||
// message.success('删除成功'); | |||
// actionRef.current.reload(); | |||
// actionRef.current.reloadAndRest(); | |||
// } else { | |||
// message.error(r.errors); | |||
// } | |||
@@ -111,7 +111,7 @@ const handleAdd = async (fields) => { | |||
await DeleteGoodsTypes(selectedRows.map((row) => row.id)).then((r) => { | |||
if (r.succeeded) { | |||
message.success('删除成功'); | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
intDicData() | |||
} else { | |||
message.error(r.errors); | |||
@@ -198,7 +198,7 @@ const handleAdd = async (fields) => { | |||
await DeleteGoodsType(record.id).then((r) => { | |||
if (r.succeeded) { | |||
message.success('删除成功'); | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
} else { | |||
message.error(r.errors); | |||
} | |||
@@ -323,7 +323,7 @@ const handleAdd = async (fields) => { | |||
setCurrentRow(undefined); | |||
if (actionRef.current) { | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
} | |||
} | |||
}} | |||
@@ -259,7 +259,7 @@ const GoodsManage = () => { | |||
removeGoods(record.id).then((r) => { | |||
if (r.succeeded) { | |||
message.success('删除成功'); | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
} else { | |||
message.error(r.errors); | |||
} | |||
@@ -465,10 +465,10 @@ const GoodsManage = () => { | |||
setCurrentRow(undefined); | |||
if (actionRef.current) { | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
} | |||
} | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
}} | |||
onCancel={() => { | |||
handleModalVisible(false); | |||
@@ -218,7 +218,7 @@ const GoodsTypeManage = () => { | |||
// onClick={() => { | |||
// CopyDevice({ id: record.id }).then((r) => { | |||
// if (r.data) { | |||
// actionRef.current.reload(); | |||
// actionRef.current.reloadAndRest(); | |||
// } | |||
// }); | |||
// }} | |||
@@ -277,7 +277,7 @@ const handleAdd = async (fields) => { | |||
if (r.succeeded) { | |||
message.success('添加成功'); | |||
handleModalVisible(false); | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
} else { | |||
message.error(r.errors) | |||
return false; | |||
@@ -291,7 +291,7 @@ const handleUpdate = async (fields) => { | |||
if (r.succeeded) { | |||
message.success('添加成功'); | |||
handleModalVisible(false); | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
} else { | |||
message.error(r.errors) | |||
return false; | |||
@@ -111,7 +111,7 @@ const GoodsTypeManage = () => { | |||
setIsAddGoodsTemplate(false); | |||
if (info.file.status === 'done') { | |||
setIsModalOpen(false); | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
message.success(`${info.file.name} 文件上传成功.`); | |||
} else if (info.file.status === 'error') { | |||
message.error(`${info.file.name} 文件上载失败.`); | |||
@@ -172,7 +172,7 @@ const GoodsTypeManage = () => { | |||
if (r.data) { | |||
message.success('删除成功'); | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
} else { | |||
message.error(r.errors); | |||
} | |||
@@ -320,7 +320,7 @@ const GoodsTypeManage = () => { | |||
handleModalVisible(false); | |||
setCurrentRow(undefined); | |||
} | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
}} | |||
onCancel={() => { | |||
handleModalVisible(false); | |||
@@ -68,7 +68,7 @@ const GoodsTypeManage = () => { | |||
DelProduct([record.id]).then((r) => { | |||
message.success('删除成功,即将刷新'); | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
}); | |||
}} | |||
onCancel={() => { }} | |||
@@ -87,7 +87,7 @@ const GoodsTypeManage = () => { | |||
message.destroy(key); | |||
if (r.succeeded) { | |||
message.success('添加成功'); | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
return true; | |||
} else { | |||
message.error(r.errors); | |||
@@ -110,7 +110,7 @@ const GoodsTypeManage = () => { | |||
message.destroy(key); | |||
if (r.succeeded) { | |||
message.success('修改成功',); | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
return true; | |||
} else { | |||
message.error(r.errors); | |||
@@ -135,7 +135,7 @@ const GoodsTypeManage = () => { | |||
await DelProduct(ids).then((r) => { | |||
if (r.data) { | |||
message.success('删除成功'); | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
return true; | |||
} else { | |||
message.error(r.errors); | |||
@@ -229,7 +229,7 @@ const GoodsTypeManage = () => { | |||
handleModalVisible(false); | |||
setCurrentRow(undefined); | |||
} | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
}} | |||
onCancel={() => { | |||
handleModalVisible(false); | |||
@@ -149,7 +149,7 @@ const ActionForm = (props) => { | |||
deletetechnologyaction(ids).then((r) => { | |||
if (r.data) { | |||
message.success('删除成功'); | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
} else { | |||
message.error(r.errors); | |||
} | |||
@@ -220,7 +220,7 @@ const ActionForm = (props) => { | |||
if (success) { | |||
handleModalVisible(false); | |||
if (actionRef.current) { | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
} | |||
} | |||
}} | |||
@@ -407,7 +407,7 @@ const handleAdd = async (fields) => { | |||
LoadfunData(params) | |||
handleModalVisible(false); | |||
if (actionRef.current) { | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
} | |||
} else { | |||
message.error(r.errors); | |||
@@ -458,7 +458,7 @@ const handleRemove = async (ids) => { | |||
LoadfunData(params) | |||
handleModalVisible(false); | |||
if (actionRef.current) { | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
} | |||
} else { | |||
message.error(r.errors); | |||
@@ -87,7 +87,7 @@ const MemberManage = () => { | |||
} | |||
}); | |||
//刷新数据 | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
return true; | |||
} catch (error) { | |||
message.destroy(key); | |||
@@ -109,7 +109,7 @@ const MemberManage = () => { | |||
} | |||
}); | |||
//刷新数据 | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
return true; | |||
} catch (error) { | |||
message.destroy(key); | |||
@@ -132,7 +132,7 @@ const MemberManage = () => { | |||
} | |||
}); | |||
//刷新数据 | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
return true; | |||
} catch (error) { | |||
message.destroy(key); | |||
@@ -159,7 +159,7 @@ const MemberManage = () => { | |||
} | |||
}); | |||
//刷新数据 | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
return true; | |||
} catch (error) { | |||
message.destroy(key); | |||
@@ -565,7 +565,7 @@ const MemberManage = () => { | |||
if (success) { | |||
SetCreateModalVisible(false); | |||
if (actionRef.current) { | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
} | |||
} | |||
}} | |||
@@ -34,7 +34,7 @@ const memberInfoListManage = (props) => { | |||
} | |||
}); | |||
//刷新数据 | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
return true; | |||
} catch (error) { | |||
message.error('分配会员失败,请重试'); | |||
@@ -35,7 +35,7 @@ const MemberTagManage = () => { | |||
if (r.data) { | |||
message.success('添加成功'); | |||
//刷新数据 | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
} else { | |||
message.success('添加失败请重试!'); | |||
} | |||
@@ -58,12 +58,12 @@ const MemberTagManage = () => { | |||
api.updateMemberTag(fields).then((r) => { | |||
if (r.data) { | |||
message.success('更新成功'); | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
} else { | |||
message.error('更新失败请重试!'); | |||
} | |||
}); | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
return true; | |||
} catch (error) { | |||
message.error('更新失败请重试!'); | |||
@@ -86,7 +86,7 @@ const MemberTagManage = () => { | |||
} | |||
}); | |||
//刷新数据 | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
return true; | |||
} catch (error) { | |||
message.error('删除失败,请重试'); | |||
@@ -197,7 +197,7 @@ const MemberTagManage = () => { | |||
api.removeMemberTag([record.id]).then((r) => { | |||
if (r.data) { | |||
message.success('删除成功,即将刷新'); | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
} else { | |||
message.error('删除失败,请重试'); | |||
} | |||
@@ -319,7 +319,7 @@ const MemberTagManage = () => { | |||
if (success) { | |||
handleModalVisible(false); | |||
if (actionRef.current) { | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
} | |||
} | |||
}} | |||
@@ -117,7 +117,7 @@ const GetGateSetUp =async (gateId) => { | |||
}} | |||
onOk={() => { | |||
sendCoupon(props); | |||
props.actionRef.current.reload(); | |||
props.actionRef.current.reloadAndRest(); | |||
}} | |||
> | |||
<PageContainer | |||
@@ -108,7 +108,7 @@ const setGateFood = (props) => { | |||
}} | |||
onOk={() => { | |||
sendCoupon(props); | |||
props.actionRef.current.reload(); | |||
props.actionRef.current.reloadAndRest(); | |||
}} | |||
> | |||
<PageContainer | |||
@@ -154,7 +154,7 @@ const GetGateFoodList =async (gateId) => { | |||
if (response.statusCode === 200) { | |||
message.success('更新档口成功!'); | |||
setIsModalOpen(false); | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
} else { | |||
message.error(response.errors || '更新失败'); | |||
} | |||
@@ -165,7 +165,7 @@ const GetGateFoodList =async (gateId) => { | |||
if (response.statusCode === 200) { | |||
message.success('新增档口成功!'); | |||
setIsModalOpen(false); | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
} else { | |||
message.error(response.errors || '新增失败'); | |||
} | |||
@@ -243,7 +243,7 @@ const GetGateFoodList =async (gateId) => { | |||
var res = await cardAPI.Del(record.id); | |||
if (res.data) { | |||
message.success('删除成功'); | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
} else { | |||
message.error('删除失败'); | |||
} | |||
@@ -265,7 +265,7 @@ const GetGateFoodList =async (gateId) => { | |||
if (response.statusCode == "200") { | |||
setStoreList(response.data); | |||
setSelectedStore(response.data[0]?.id); | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
} else { | |||
message.error(response.msg || '获取场景列表失败'); | |||
} | |||
@@ -326,7 +326,7 @@ const GetGateFoodList =async (gateId) => { | |||
</div> | |||
<Select style={{ width: 300 }} value={selectedStore} onChange={(value) => { | |||
setSelectedStore(value); | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
}}> | |||
{ | |||
storeList.map(item => { | |||
@@ -59,7 +59,7 @@ const Machine = () => { | |||
if (response.statusCode === 200) { | |||
setIsModalOpen(false); | |||
message.success('更新成功!'); | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
setCurrentOption({}); | |||
} else { | |||
message.error(response.errors || '更新失败'); | |||
@@ -70,7 +70,7 @@ const Machine = () => { | |||
if (response.statusCode === 200) { | |||
setIsModalOpen(false); | |||
message.success('新增成功!'); | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
} else { | |||
message.error(response.errors || '新增失败'); | |||
} | |||
@@ -137,7 +137,7 @@ const Machine = () => { | |||
var res = await cardAPI.DelPayCard(record.id); | |||
if (res.data) { | |||
message.success('删除成功'); | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
} else { | |||
message.error('删除失败'); | |||
} | |||
@@ -256,7 +256,7 @@ const Machine = () => { | |||
</div> | |||
<Select style={{ width: 300 }} value={selectedGate} onChange={(value) => { | |||
setSelectedGate(value); | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
}}> | |||
{ | |||
gateList.map(item => { | |||
@@ -71,7 +71,7 @@ const storedValueCard = () => { | |||
}); | |||
if (response.data === true) { | |||
message.success('绑定成功'); | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
setBindMemberDrawer(false); | |||
} else { | |||
message.error(response.errors ||'绑定失败'); | |||
@@ -99,7 +99,7 @@ const storedValueCard = () => { | |||
if (response.statusCode === 200) { | |||
message.success('更新成功'); | |||
setIsModalOpen(false); | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
} else { | |||
message.error(response.errors || '更新储值卡失败'); | |||
} | |||
@@ -111,7 +111,7 @@ const storedValueCard = () => { | |||
if (response.statusCode === 200) { | |||
message.success('添加成功'); | |||
setIsModalOpen(false); | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
} else { | |||
message.error(response.errors || '添加储值卡失败'); | |||
} | |||
@@ -102,7 +102,7 @@ const app = () => { | |||
var res = await api.Del(record.id); | |||
if (res.data) { | |||
message.success('删除成功'); | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
} else { | |||
message.error(response.errors ||'删除失败'); | |||
} | |||
@@ -138,7 +138,7 @@ const app = () => { | |||
var res = await api.Update(form.getFieldsValue()); | |||
if (res.data) { | |||
message.success('修改成功'); | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
setIsModalOpen(false); | |||
form.resetFields(); | |||
} else { | |||
@@ -149,7 +149,7 @@ const app = () => { | |||
var res = await api.Add(form.getFieldsValue()); | |||
if (res.data) { | |||
message.success('新增成功'); | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
setIsModalOpen(false); | |||
form.resetFields(); | |||
} else { | |||
@@ -69,7 +69,7 @@ const Manage = () => { | |||
if (re.data) { | |||
message.success('修改成功'); | |||
setIsModalOpen(false); | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
} else { | |||
message.error('修改失败'); | |||
} | |||
@@ -92,7 +92,7 @@ const Manage = () => { | |||
if (re.data) { | |||
message.success('删除成功'); | |||
setIsModalOpen(false); | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
} else { | |||
message.error('删除成功'); | |||
} | |||
@@ -159,7 +159,7 @@ const Manage = () => { | |||
if (re.data) { | |||
message.success('修改成功'); | |||
handleModalVisible(false); | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
} else { | |||
message.error('修改失败'); | |||
} | |||
@@ -169,7 +169,7 @@ const Manage = () => { | |||
if (re.data) { | |||
setIsModalOpen(false); | |||
message.success('添加成功'); | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
} else { | |||
message.error(re.errors || '添加失败'); | |||
} | |||
@@ -164,7 +164,7 @@ const TableList = () => { | |||
if (r.data) { | |||
message.success('删除成功'); | |||
initfranchiseeType(); | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
} else { | |||
message.error(r.errors); | |||
} | |||
@@ -197,7 +197,7 @@ const TableList = () => { | |||
// console.log(r) | |||
// if(r.succeeded){ | |||
// setauthcode(r.data) | |||
// actionRef.current.reload(); | |||
// actionRef.current.reloadAndRest(); | |||
// message.success('生成成功'); | |||
// }else{ | |||
// message.error('生成失败'); | |||
@@ -342,7 +342,7 @@ const TableList = () => { | |||
gettree().then((r) => { | |||
setTreeData(r.data); | |||
}); | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
} | |||
} | |||
}} | |||
@@ -117,7 +117,7 @@ const roleManager = () => { | |||
await removeRole([record.id]).then(r => { | |||
if(r.succeeded){ | |||
message.success("删除成功"); | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
}else{ | |||
message.error(r.data); | |||
} | |||
@@ -157,7 +157,7 @@ const roleManager = () => { | |||
// handleRemove(record); | |||
// // removeRole([record.id]).then(r => { | |||
// // message.success(r); | |||
// // actionRef.current.reload(); | |||
// // actionRef.current.reloadAndRest(); | |||
// // }) | |||
// }} | |||
> | |||
@@ -317,7 +317,7 @@ const roleManager = () => { | |||
if (success) { | |||
handleModalVisible(false); | |||
if (actionRef.current) { | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
} | |||
} | |||
}} | |||
@@ -341,7 +341,7 @@ const roleManager = () => { | |||
handleUpdateMenuModalVisible(false); | |||
setStepFormValues({}); | |||
if (actionRef.current) { | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
} | |||
} | |||
}} | |||
@@ -368,7 +368,7 @@ const roleManager = () => { | |||
handleUpdateOrgModalVisible(false); | |||
setStepFormValues({}); | |||
if (actionRef.current) { | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
} | |||
} | |||
}} | |||
@@ -107,7 +107,7 @@ const userManager = () => { | |||
await api.RemoveUser(selectedRows.map((row) => row.id)).then((r) => { | |||
if (r.data) { | |||
message.success('删除成功,即将刷新'); | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
} else { | |||
message.error('删除失败,请重试'); | |||
} | |||
@@ -305,10 +305,10 @@ const userManager = () => { | |||
setStepFormValues({}); | |||
if (actionRef.current) { | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
} | |||
} | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
}} | |||
onCancel={() => { | |||
handleModalVisible(false); | |||
@@ -367,7 +367,7 @@ const userManager = () => { | |||
handleUpdateOrgModalVisible(false); | |||
setStepFormValues({}); | |||
if (actionRef.current) { | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
} | |||
} | |||
}} | |||
@@ -53,7 +53,6 @@ const PushFrom = (props) => { | |||
] | |||
return ( | |||
<Modal | |||
maskClosable={false} | |||
title={'下发数据'} | |||
width={1040} | |||
visible={props.createModalVisible} | |||
@@ -1,15 +1,16 @@ | |||
import { PlusOutlined } from '@ant-design/icons'; | |||
import { Button, message, Input, Drawer, Popconfirm, Typography } from 'antd'; | |||
import React, { useState, useRef, useEffect } from 'react'; | |||
import { PlusOutlined,CopyOutlined } from '@ant-design/icons'; | |||
import { Button, message, Input, Drawer, Popconfirm,Typography } from 'antd'; | |||
import React, { useState, useRef, useEffect} from 'react'; | |||
import { PageContainer, FooterToolbar } from '@ant-design/pro-layout'; | |||
import ProTable from '@ant-design/pro-table'; | |||
import ProDescriptions from '@ant-design/pro-descriptions'; | |||
import PushFrom from './components/PushFrom'; | |||
import Field from '@ant-design/pro-field'; | |||
import { | |||
GetDevicePushRecodePage, | |||
DevicePushRecodeAdd, | |||
DevicePushRecodeDelete | |||
GetDevicePushRecodePage, | |||
DevicePushRecodeAdd, | |||
DevicePushRecodeDelete, | |||
DevicePushRecodeUpdate | |||
} from './services'; | |||
@@ -22,12 +23,11 @@ const goodspush = () => { | |||
const actionRef = useRef(); | |||
const [currentRow, setCurrentRow] = useState(); | |||
const [selectedRowsState, setSelectedRows] = useState([]); | |||
const { Paragraph } = Typography; | |||
const { Paragraph, Text } = Typography; | |||
/** 国际化修改 */ | |||
useEffect(() => { | |||
}, []); | |||
/** | |||
@@ -35,14 +35,14 @@ const goodspush = () => { | |||
* | |||
* @param selectedRows | |||
*/ | |||
const handleRemove = async (selectedRows) => { | |||
const hide = message.loading('正在删除'); | |||
if (!selectedRows) return true; | |||
await DevicePushRecodeDelete(selectedRows.map((row) => row.id)).then((r) => { | |||
if (r.succeeded) { | |||
message.success('删除成功'); | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
} else { | |||
message.error(r.errors); | |||
} | |||
@@ -77,17 +77,21 @@ const goodspush = () => { | |||
ellipsis: true, | |||
}, | |||
// { | |||
// title: '下发数据', | |||
// dataIndex: 'type', | |||
// ellipsis: true, | |||
// valueEnum: { | |||
// 2: { | |||
// text: '物料', | |||
// }, | |||
// }, | |||
// }, | |||
{ | |||
title: '下发状态', | |||
dataIndex: 'status', | |||
ellipsis: true, | |||
valueEnum: { | |||
0: { | |||
text: '成功', | |||
status: 'Success', | |||
}, | |||
1: { | |||
text: '失败', | |||
status: 'Processing', | |||
}, | |||
}, | |||
}, | |||
{ | |||
title: '下发时间', | |||
dataIndex: 'createAt', | |||
@@ -107,40 +111,56 @@ const goodspush = () => { | |||
> | |||
下发详情 | |||
</a>, | |||
// <Popconfirm | |||
// type="primary" | |||
// key="primary" | |||
// title="确认删除吗?" | |||
// okText="是" | |||
// cancelText="否" | |||
// onConfirm={async () => { | |||
// await DeleteGoodsType(record.id).then((r) => { | |||
// if (r.succeeded) { | |||
// message.success('删除成功'); | |||
// actionRef.current.reload(); | |||
// } else { | |||
// message.error(r.errors); | |||
// } | |||
// }); | |||
// }} | |||
// onCancel={() => { }} | |||
// > | |||
// <a href="#">删除</a> | |||
// </Popconfirm>, | |||
<a | |||
key="config" | |||
onClick={() => { | |||
DevicePushRecodeUpdate(record.id).then((r)=>{ | |||
if(r.data){ | |||
message.success('操作成功'); | |||
actionRef.current.reloadAndRest(); | |||
}else{ | |||
message.error('操作失败'); | |||
} | |||
}) | |||
}} | |||
> | |||
重发 | |||
</a>, | |||
<Popconfirm | |||
type="primary" | |||
key="primary" | |||
title="确认删除吗?" | |||
okText="是" | |||
cancelText="否" | |||
onConfirm={async () => { | |||
await DeleteGoodsType(record.id).then((r) => { | |||
if (r.succeeded) { | |||
message.success('删除成功'); | |||
actionRef.current.reloadAndRest(); | |||
} else { | |||
message.error(r.errors); | |||
} | |||
}); | |||
}} | |||
onCancel={() => {}} | |||
> | |||
<a href="#">删除</a> | |||
</Popconfirm>, | |||
], | |||
}, | |||
]; | |||
const HandleOk = async (values) => { | |||
await DevicePushRecodeAdd(values).then((res) => { | |||
if (res.data) { | |||
message.success('操作成功'); | |||
handleModalVisible(false); | |||
actionRef.current.reload(); | |||
} else { | |||
message.error(res.errors); | |||
} | |||
}) | |||
} | |||
const HandleOk= async(values)=>{ | |||
await DevicePushRecodeAdd(values).then((res)=>{ | |||
if(res.data){ | |||
message.success('操作成功'); | |||
handleModalVisible(false); | |||
actionRef.current.reloadAndRest(); | |||
}else{ | |||
message.error(res.errors); | |||
} | |||
}) | |||
} | |||
return ( | |||
<PageContainer host header={{ | |||
title: '', | |||
@@ -168,7 +188,7 @@ const goodspush = () => { | |||
request={async (params) => { | |||
var goodsData = []; | |||
var total = 0; | |||
params.type = 2 | |||
params.type=2 | |||
await GetDevicePushRecodePage(params).then((r) => { | |||
goodsData = r.data.data; | |||
total = r.data.total; | |||
@@ -220,7 +240,7 @@ const goodspush = () => { | |||
<PushFrom | |||
onFinish={async (value) => { | |||
}} | |||
onCancel={() => { | |||
handleModalVisible(false); | |||
@@ -244,18 +264,35 @@ const goodspush = () => { | |||
<ProDescriptions | |||
column={1} | |||
title="下发详情" | |||
> | |||
<ProDescriptions.Item label="下发设备" valueType="text"> | |||
<ProDescriptions.Item label="下发设备" valueType="text"> | |||
{currentRow?.deviceName} | |||
</ProDescriptions.Item> | |||
<ProDescriptions.Item label="topic" valueType="text" > | |||
<Paragraph copyable>{currentRow?.topic}</Paragraph> | |||
</ProDescriptions.Item> | |||
<ProDescriptions.Item contentStyle={{ maxWidth: '85%' }} label="下发数据" valueType="jsonCode" > | |||
{currentRow?.dataResore} | |||
</ProDescriptions.Item> | |||
</ProDescriptions> | |||
</ProDescriptions.Item> | |||
<ProDescriptions.Item label="topic" copyable valueType="text"> | |||
{currentRow?.topic} | |||
</ProDescriptions.Item> | |||
<ProDescriptions.Item contentStyle={{ maxWidth: '85%'}} label="下发数据"> | |||
<a | |||
onClick={() => { | |||
let oInput = document.createElement('input'); | |||
oInput.value = currentRow.dataResore; | |||
document.body.appendChild(oInput); | |||
oInput.select(); // 选择对象 | |||
document.execCommand('Copy'); // 执行浏览器复制命令 | |||
message.success('复制成功'); | |||
oInput.remove(); | |||
}} | |||
> | |||
<CopyOutlined /> | |||
<div style={{ overflow: 'scroll', overflowX: 'auto' }}> | |||
<Field text={currentRow?.dataResore} valueType="jsonCode" /> | |||
</div> | |||
</a> | |||
</ProDescriptions.Item> | |||
</ProDescriptions> | |||
)} | |||
</Drawer> | |||
</PageContainer> | |||
@@ -1,5 +1,5 @@ | |||
import React, { useState, useEffect, useRef } from 'react'; | |||
import { Modal, Row, Col, Checkbox, Select, message, Switch } from 'antd'; | |||
import React, { useState, useEffect,useRef } from 'react'; | |||
import { Modal, Row, Col, Checkbox, Select,message,Switch} from 'antd'; | |||
import ProTable from '@ant-design/pro-table'; | |||
import { | |||
GetDeviceList, | |||
@@ -9,7 +9,7 @@ import { | |||
const PushFrom = (props) => { | |||
const [deviceData, setdeviceData] = useState([]); | |||
const [selectedRowsState, setSelectedRows] = useState([]); | |||
const [dataSource, setdataSource] = useState([]); | |||
const [dataSource,setdataSource]= useState([]); | |||
const [treeData, setTreeData] = useState(); | |||
const [DeviceIds, setDeviceIds] = useState(); | |||
const [DeviceInfo, setDeviceInfo] = useState([]); | |||
@@ -17,67 +17,66 @@ const PushFrom = (props) => { | |||
const actionRef = useRef(); | |||
useEffect(() => { | |||
console.log(props.values) | |||
GetDeviceList().then((r) => { | |||
GetDeviceList().then((r)=>{ | |||
setDeviceInfo(r.data) | |||
var data = r.data.map(x => { | |||
return { value: x.id, label: x.name } | |||
}) | |||
setdeviceData(data) | |||
var data=r.data.map(x=>{ | |||
return {value:x.id,label:x.name} | |||
}) | |||
setdeviceData(data) | |||
}) | |||
GetGoodsTypeTree().then((r) => { | |||
setTreeData(r.data); | |||
}); | |||
var params = { current: 1, pageSize: 10 } | |||
GetGoodsData(params) | |||
}, [props.values]) | |||
const GetGoodsData = (params) => { | |||
setTreeData(r.data); | |||
}); | |||
var params={current:1,pageSize:10} | |||
GetGoodsData(params) | |||
},[props.values]) | |||
const GetGoodsData=(params)=>{ | |||
GetGoodsPage(params).then((r) => { | |||
setdataSource(r.data.data); | |||
//console.log(goodsData) | |||
//total = r.data.total; | |||
}); | |||
setdataSource(r.data.data); | |||
//console.log(goodsData) | |||
//total = r.data.total; | |||
}); | |||
} | |||
const handleChange = (value) => { | |||
const handleChange=(value)=>{ | |||
setDeviceIds(value) | |||
var params = { current: 1, pageSize: 10, deviceId: value } | |||
var params={current:1,pageSize:10,deviceId:value} | |||
GetGoodsData(params) | |||
} | |||
const onChange=(checked)=>{ | |||
if(!DeviceIds){ | |||
message.error('请先选择设备'); | |||
}else{ | |||
setisGlogy(checked) | |||
} | |||
const onChange = (checked) => { | |||
if (!DeviceIds) { | |||
message.error('请先选择设备'); | |||
} else { | |||
setisGlogy(checked) | |||
} | |||
} | |||
const columns = [ | |||
{ | |||
title: '编码', | |||
dataIndex: 'code', | |||
valueType: 'textarea', | |||
hideInTable: true, | |||
hideInSearch: true, | |||
}, | |||
} | |||
const columns=[ | |||
{ | |||
title: '名称', | |||
dataIndex: 'name', | |||
valueType: 'textarea', | |||
}, | |||
{ | |||
title: '商品类型', | |||
dataIndex: 'goodsTypeName', | |||
valueType: 'treeSelect', | |||
fieldProps: { | |||
showSearch: true, | |||
allowClear: true, | |||
options: treeData | |||
title: '编码', | |||
dataIndex: 'code', | |||
valueType: 'textarea', | |||
hideInTable: true, | |||
hideInSearch: true, | |||
}, | |||
{ | |||
title: '名称', | |||
dataIndex: 'name', | |||
valueType: 'textarea', | |||
}, | |||
{ | |||
title: '商品类型', | |||
dataIndex: 'goodsTypeName', | |||
valueType: 'treeSelect', | |||
fieldProps: { | |||
showSearch:true, | |||
allowClear:true, | |||
options: treeData | |||
}, | |||
}, | |||
}, | |||
] | |||
] | |||
return ( | |||
<Modal | |||
maskClosable={false} | |||
title={'下发数据'} | |||
width={1040} | |||
visible={props.createModalVisible} | |||
@@ -85,16 +84,16 @@ const PushFrom = (props) => { | |||
okText="确定" | |||
cancelText="取消" | |||
onOk={() => { | |||
if (!DeviceIds) { | |||
if(!DeviceIds){ | |||
message.error('请选择设备'); | |||
} else { | |||
var de = DeviceInfo.find(x => x.id == DeviceIds); | |||
var data = { goodsinfo: [] }; | |||
}else{ | |||
var de=DeviceInfo.find(x=>x.id==DeviceIds); | |||
var data={goodsinfo:[]}; | |||
// if(isGlogy){ | |||
// data.goodstechnology=[] | |||
// } | |||
selectedRowsState.map(x => { | |||
var pa = { id: x.id, code: x.code, goodsTypeId: x.goodsTypeId, goodsTypeName: x.goodsTypeName, goodsUintId: x.goodsUintId, imgUrl: x.imgUrl, isAttrubute: x.isAttrubute, name: x.name, price: x.price, design: x.design, remark: x.remark } | |||
selectedRowsState.map(x=>{ | |||
var pa={id:x.id,code:x.code,goodsTypeId:x.goodsTypeId,goodsTypeName:x.goodsTypeName,goodsUintId:x.goodsUintId,imgUrl:x.imgUrl,isAttrubute:x.isAttrubute,name:x.name,price:x.price,design:x.design,remark:x.remark} | |||
data.goodsinfo.push(pa); | |||
// if(isGlogy){ | |||
// //data.goodstechnology=[] | |||
@@ -103,7 +102,7 @@ const PushFrom = (props) => { | |||
// } | |||
// } | |||
}) | |||
var parm = { deviceId: de.id, deviceName: de.name, deviceAutoKey: de.autoKey, type: 1, data: data } | |||
var parm={deviceId:de.id,deviceName:de.name,deviceAutoKey:de.autoKey,type:1,data:data} | |||
props.HandleOk(parm) | |||
console.log(de) | |||
} | |||
@@ -113,48 +112,48 @@ const PushFrom = (props) => { | |||
}} | |||
destroyOnClose | |||
> | |||
<Row gutter={26} style={{ marginBottom: 20 }}> | |||
<Col lg={24} md={24} sm={24}> | |||
选择设备: | |||
<Select | |||
allowClear | |||
style={{ width: '60%' }} | |||
placeholder="请选择要下发设备" | |||
onChange={handleChange} | |||
options={deviceData} | |||
/> | |||
</Col> | |||
</Row> | |||
{/* <Row style={{marginBottom:20}}> | |||
<Row gutter={26} style={{marginBottom:20}}> | |||
<Col lg={24} md={24} sm={24}> | |||
选择设备: | |||
<Select | |||
allowClear | |||
style={{width: '60%'}} | |||
placeholder="请选择要下发设备" | |||
onChange={handleChange} | |||
options={deviceData} | |||
/> | |||
</Col> | |||
</Row> | |||
{/* <Row style={{marginBottom:20}}> | |||
<Col lg={24} md={24} sm={24}> | |||
是否包含工艺: | |||
<Switch checkedChildren="是" unCheckedChildren="否" checked={isGlogy} value={isGlogy} onChange={onChange} /> | |||
</Col> | |||
</Row> */} | |||
<Row gutter={26}> | |||
<Col span={24}> | |||
选择数据: | |||
<ProTable | |||
headerTitle="" | |||
actionRef={actionRef} | |||
rowKey="id" | |||
pagination={{ defaultPageSize: 10 }} | |||
search={{ | |||
labelWidth: 120, | |||
}} | |||
dataSource={dataSource} | |||
columns={columns} | |||
rowSelection={{ | |||
onChange: (_, selectedRows) => { | |||
setSelectedRows(selectedRows); | |||
}, | |||
}} | |||
> | |||
<Row gutter={26}> | |||
<Col span={24}> | |||
选择数据: | |||
<ProTable | |||
headerTitle="" | |||
actionRef={actionRef} | |||
rowKey="id" | |||
pagination={{ defaultPageSize: 10 }} | |||
search={{ | |||
labelWidth: 120, | |||
}} | |||
dataSource={dataSource} | |||
columns={columns} | |||
rowSelection={{ | |||
onChange: (_, selectedRows) => { | |||
setSelectedRows(selectedRows); | |||
}, | |||
}} | |||
> | |||
</ProTable> | |||
</Col> | |||
</Row> | |||
</Col> | |||
</Row> | |||
</Modal> | |||
); | |||
}; | |||
@@ -1,15 +1,16 @@ | |||
import { PlusOutlined } from '@ant-design/icons'; | |||
import { PlusOutlined,CopyOutlined } from '@ant-design/icons'; | |||
import { Button, message, Input, Drawer, Popconfirm,Typography } from 'antd'; | |||
import React, { useState, useRef, useEffect } from 'react'; | |||
import { PageContainer, FooterToolbar } from '@ant-design/pro-layout'; | |||
import ProTable from '@ant-design/pro-table'; | |||
import ProDescriptions from '@ant-design/pro-descriptions'; | |||
import PushFrom from './components/PushFrom'; | |||
import Field from '@ant-design/pro-field'; | |||
import { | |||
GetDevicePushRecodePage, | |||
DevicePushRecodeAdd, | |||
DevicePushRecodeDelete | |||
DevicePushRecodeDelete, | |||
DevicePushRecodeUpdate | |||
} from './services'; | |||
@@ -22,7 +23,7 @@ const goodspush = () => { | |||
const actionRef = useRef(); | |||
const [currentRow, setCurrentRow] = useState(); | |||
const [selectedRowsState, setSelectedRows] = useState([]); | |||
const { Paragraph } = Typography; | |||
const { Paragraph, Text } = Typography; | |||
/** 国际化修改 */ | |||
useEffect(() => { | |||
@@ -41,7 +42,7 @@ const goodspush = () => { | |||
await DevicePushRecodeDelete(selectedRows.map((row) => row.id)).then((r) => { | |||
if (r.succeeded) { | |||
message.success('删除成功'); | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
} else { | |||
message.error(r.errors); | |||
} | |||
@@ -76,17 +77,21 @@ const goodspush = () => { | |||
ellipsis: true, | |||
}, | |||
// { | |||
// title: '下发数据', | |||
// dataIndex: 'type', | |||
// ellipsis: true, | |||
// valueEnum: { | |||
// 1: { | |||
// text: '商品', | |||
// }, | |||
// }, | |||
// }, | |||
{ | |||
title: '下发状态', | |||
dataIndex: 'status', | |||
ellipsis: true, | |||
valueEnum: { | |||
0: { | |||
text: '成功', | |||
status: 'Success', | |||
}, | |||
1: { | |||
text: '失败', | |||
status: 'Processing', | |||
}, | |||
}, | |||
}, | |||
{ | |||
title: '下发时间', | |||
dataIndex: 'createAt', | |||
@@ -106,26 +111,41 @@ const goodspush = () => { | |||
> | |||
下发详情 | |||
</a>, | |||
// <Popconfirm | |||
// type="primary" | |||
// key="primary" | |||
// title="确认删除吗?" | |||
// okText="是" | |||
// cancelText="否" | |||
// onConfirm={async () => { | |||
// await DeleteGoodsType(record.id).then((r) => { | |||
// if (r.succeeded) { | |||
// message.success('删除成功'); | |||
// actionRef.current.reload(); | |||
// } else { | |||
// message.error(r.errors); | |||
// } | |||
// }); | |||
// }} | |||
// onCancel={() => {}} | |||
// > | |||
// <a href="#">删除</a> | |||
// </Popconfirm>, | |||
<a | |||
key="config" | |||
onClick={() => { | |||
DevicePushRecodeUpdate(record.id).then((r)=>{ | |||
if(r.data){ | |||
message.success('操作成功'); | |||
actionRef.current.reloadAndRest(); | |||
}else{ | |||
message.error('操作失败'); | |||
} | |||
}) | |||
}} | |||
> | |||
重发 | |||
</a>, | |||
<Popconfirm | |||
type="primary" | |||
key="primary" | |||
title="确认删除吗?" | |||
okText="是" | |||
cancelText="否" | |||
onConfirm={async () => { | |||
await DeleteGoodsType(record.id).then((r) => { | |||
if (r.succeeded) { | |||
message.success('删除成功'); | |||
actionRef.current.reloadAndRest(); | |||
} else { | |||
message.error(r.errors); | |||
} | |||
}); | |||
}} | |||
onCancel={() => {}} | |||
> | |||
<a href="#">删除</a> | |||
</Popconfirm>, | |||
], | |||
}, | |||
]; | |||
@@ -134,7 +154,7 @@ const HandleOk= async(values)=>{ | |||
if(res.data){ | |||
message.success('操作成功'); | |||
handleModalVisible(false); | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
}else{ | |||
message.error('操作失败'); | |||
} | |||
@@ -248,11 +268,27 @@ const HandleOk= async(values)=>{ | |||
<ProDescriptions.Item label="下发设备" valueType="text"> | |||
{currentRow?.deviceName} | |||
</ProDescriptions.Item> | |||
<ProDescriptions.Item label="topic" valueType="text"> | |||
<Paragraph copyable>{currentRow?.topic}</Paragraph> | |||
<ProDescriptions.Item label="topic" copyable valueType="text"> | |||
{currentRow?.topic} | |||
</ProDescriptions.Item> | |||
<ProDescriptions.Item contentStyle={{ maxWidth: '85%'}} label="下发数据" valueType="jsonCode" > | |||
{currentRow?.dataResore} | |||
<ProDescriptions.Item contentStyle={{ maxWidth: '85%'}} label="下发数据"> | |||
<a | |||
onClick={() => { | |||
let oInput = document.createElement('input'); | |||
oInput.value = currentRow.dataResore; | |||
document.body.appendChild(oInput); | |||
oInput.select(); // 选择对象 | |||
document.execCommand('Copy'); // 执行浏览器复制命令 | |||
message.success('复制成功'); | |||
oInput.remove(); | |||
}} | |||
> | |||
<CopyOutlined /> | |||
<div style={{ width: '500px', overflow: 'scroll', overflowX: 'auto' }}> | |||
<Field text={currentRow?.dataResore} valueType="jsonCode" /> | |||
</div> | |||
</a> | |||
</ProDescriptions.Item> | |||
</ProDescriptions> | |||
)} | |||
@@ -1,5 +1,5 @@ | |||
import React, { useState, useEffect, useRef } from 'react'; | |||
import { Modal, Row, Col, Checkbox, Select, message, Switch } from 'antd'; | |||
import React, { useState, useEffect,useRef } from 'react'; | |||
import { Modal, Row, Col, Checkbox, Select,message,Switch} from 'antd'; | |||
import ProTable from '@ant-design/pro-table'; | |||
import { | |||
GetDeviceList, | |||
@@ -9,7 +9,7 @@ import { | |||
const PushFrom = (props) => { | |||
const [deviceData, setdeviceData] = useState([]); | |||
const [selectedRowsState, setSelectedRows] = useState([]); | |||
const [dataSource, setdataSource] = useState([]); | |||
const [dataSource,setdataSource]= useState([]); | |||
const [treeData, setTreeData] = useState(); | |||
const [DeviceIds, setDeviceIds] = useState(); | |||
const [DeviceInfo, setDeviceInfo] = useState([]); | |||
@@ -17,67 +17,69 @@ const PushFrom = (props) => { | |||
const actionRef = useRef(); | |||
useEffect(() => { | |||
console.log(props.values) | |||
GetDeviceList().then((r) => { | |||
GetDeviceList().then((r)=>{ | |||
setDeviceInfo(r.data) | |||
var data = r.data.map(x => { | |||
return { value: x.id, label: x.name } | |||
}) | |||
setdeviceData(data) | |||
if(r.data.length>0){ | |||
var data=r.data.map(x=>{ | |||
return {value:x.id,label:x.name} | |||
}) | |||
setdeviceData(data) | |||
} | |||
}) | |||
GetGoodsTypeTree().then((r) => { | |||
setTreeData(r.data); | |||
}); | |||
var params = { current: 1, pageSize: 10 } | |||
GetGoodsData(params) | |||
}, [props.values]) | |||
const GetGoodsData = (params) => { | |||
setTreeData(r.data); | |||
}); | |||
var params={current:1,pageSize:10} | |||
GetGoodsData(params) | |||
},[props.values]) | |||
const GetGoodsData=(params)=>{ | |||
GetGoodsPage(params).then((r) => { | |||
setdataSource(r.data.data); | |||
//console.log(goodsData) | |||
//total = r.data.total; | |||
}); | |||
setdataSource(r.data.data); | |||
//console.log(goodsData) | |||
//total = r.data.total; | |||
}); | |||
} | |||
const handleChange = (value) => { | |||
const handleChange=(value)=>{ | |||
setDeviceIds(value) | |||
var params = { current: 1, pageSize: 10, deviceId: value } | |||
var params={current:1,pageSize:10,deviceId:value} | |||
GetGoodsData(params) | |||
} | |||
const onChange=(checked)=>{ | |||
if(!DeviceIds){ | |||
message.error('请先选择设备'); | |||
}else{ | |||
setisGlogy(checked) | |||
} | |||
const onChange = (checked) => { | |||
if (!DeviceIds) { | |||
message.error('请先选择设备'); | |||
} else { | |||
setisGlogy(checked) | |||
} | |||
} | |||
const columns = [ | |||
{ | |||
title: '编码', | |||
dataIndex: 'code', | |||
valueType: 'textarea', | |||
hideInTable: true, | |||
hideInSearch: true, | |||
}, | |||
{ | |||
title: '名称', | |||
dataIndex: 'name', | |||
valueType: 'textarea', | |||
}, | |||
} | |||
const columns=[ | |||
{ | |||
title: '商品类型', | |||
dataIndex: 'goodsTypeName', | |||
valueType: 'treeSelect', | |||
fieldProps: { | |||
showSearch: true, | |||
allowClear: true, | |||
options: treeData | |||
title: '编码', | |||
dataIndex: 'code', | |||
valueType: 'textarea', | |||
hideInTable: true, | |||
hideInSearch: true, | |||
}, | |||
}, | |||
] | |||
{ | |||
title: '名称', | |||
dataIndex: 'name', | |||
valueType: 'textarea', | |||
}, | |||
{ | |||
title: '商品类型', | |||
dataIndex: 'goodsTypeName', | |||
valueType: 'treeSelect', | |||
fieldProps: { | |||
showSearch:true, | |||
allowClear:true, | |||
options: treeData | |||
}, | |||
}, | |||
] | |||
return ( | |||
<Modal | |||
maskClosable={false} | |||
title={'下发数据'} | |||
width={1040} | |||
visible={props.createModalVisible} | |||
@@ -85,32 +87,32 @@ const PushFrom = (props) => { | |||
okText="确定" | |||
cancelText="取消" | |||
onOk={() => { | |||
if (!DeviceIds) { | |||
if(!DeviceIds){ | |||
message.error('请选择设备'); | |||
} else { | |||
var de = DeviceInfo.find(x => x.id == DeviceIds); | |||
var data = { goodstechnology: [] }; | |||
}else{ | |||
var de=DeviceInfo.find(x=>x.id==DeviceIds); | |||
var data={goodstechnology:[]}; | |||
// if(isGlogy){ | |||
// data.goodstechnology=[] | |||
// } | |||
selectedRowsState.map(x => { | |||
selectedRowsState.map(x=>{ | |||
// var pa={id:x.id,code:x.code,goodsTypeId:x.goodsTypeId,goodsTypeName:x.goodsTypeName,goodsUintId:x.goodsUintId,imgUrl:x.imgUrl,isAttrubute:x.isAttrubute,name:x.name,price:x.price,design:x.design,remark:x.remark} | |||
// data.goodsinfo.push(pa); | |||
// if(isGlogy){ | |||
// //data.goodstechnology=[] | |||
if (x.goodstechnology.length > 0) { | |||
data.goodstechnology.push(x.goodstechnology) | |||
} | |||
if(x.goodstechnology.length>0){ | |||
data.goodstechnology.push(x.goodstechnology) | |||
} | |||
// } | |||
}) | |||
if (data.goodstechnology.length == 0) { | |||
if(data.goodstechnology.length==0){ | |||
message.error('选择的商品还没有工艺'); | |||
} else { | |||
var parm = { deviceId: de.id, deviceName: de.name, deviceAutoKey: de.autoKey, type: 4, data: data } | |||
}else{ | |||
var parm={deviceId:de.id,deviceName:de.name,deviceAutoKey:de.autoKey,type:4,data:data} | |||
props.HandleOk(parm) | |||
console.log(de) | |||
} | |||
} | |||
}} | |||
onCancel={() => { | |||
@@ -118,48 +120,48 @@ const PushFrom = (props) => { | |||
}} | |||
destroyOnClose | |||
> | |||
<Row gutter={26} style={{ marginBottom: 20 }}> | |||
<Col lg={24} md={24} sm={24}> | |||
选择设备: | |||
<Select | |||
allowClear | |||
style={{ width: '60%' }} | |||
placeholder="请选择要下发设备" | |||
onChange={handleChange} | |||
options={deviceData} | |||
/> | |||
</Col> | |||
</Row> | |||
{/* <Row style={{marginBottom:20}}> | |||
<Row gutter={26} style={{marginBottom:20}}> | |||
<Col lg={24} md={24} sm={24}> | |||
选择设备: | |||
<Select | |||
allowClear | |||
style={{width: '60%'}} | |||
placeholder="请选择要下发设备" | |||
onChange={handleChange} | |||
options={deviceData} | |||
/> | |||
</Col> | |||
</Row> | |||
{/* <Row style={{marginBottom:20}}> | |||
<Col lg={24} md={24} sm={24}> | |||
是否包含工艺: | |||
<Switch checkedChildren="是" unCheckedChildren="否" checked={isGlogy} value={isGlogy} onChange={onChange} /> | |||
</Col> | |||
</Row> */} | |||
<Row gutter={26}> | |||
<Col span={24}> | |||
选择数据: | |||
<ProTable | |||
headerTitle="" | |||
actionRef={actionRef} | |||
rowKey="id" | |||
pagination={{ defaultPageSize: 10 }} | |||
search={{ | |||
labelWidth: 120, | |||
}} | |||
dataSource={dataSource} | |||
columns={columns} | |||
rowSelection={{ | |||
onChange: (_, selectedRows) => { | |||
setSelectedRows(selectedRows); | |||
}, | |||
}} | |||
> | |||
<Row gutter={26}> | |||
<Col span={24}> | |||
选择数据: | |||
<ProTable | |||
headerTitle="" | |||
actionRef={actionRef} | |||
rowKey="id" | |||
pagination={{ defaultPageSize: 10 }} | |||
search={{ | |||
labelWidth: 120, | |||
}} | |||
dataSource={dataSource} | |||
columns={columns} | |||
rowSelection={{ | |||
onChange: (_, selectedRows) => { | |||
setSelectedRows(selectedRows); | |||
}, | |||
}} | |||
> | |||
</ProTable> | |||
</Col> | |||
</Row> | |||
</Col> | |||
</Row> | |||
</Modal> | |||
); | |||
}; | |||
@@ -1,15 +1,16 @@ | |||
import { PlusOutlined } from '@ant-design/icons'; | |||
import { PlusOutlined,CopyOutlined } from '@ant-design/icons'; | |||
import { Button, message, Input, Drawer, Popconfirm,Typography } from 'antd'; | |||
import React, { useState, useRef, useEffect } from 'react'; | |||
import { PageContainer, FooterToolbar } from '@ant-design/pro-layout'; | |||
import ProTable from '@ant-design/pro-table'; | |||
import ProDescriptions from '@ant-design/pro-descriptions'; | |||
import PushFrom from './components/PushFrom'; | |||
import Field from '@ant-design/pro-field'; | |||
import { | |||
GetDevicePushRecodePage, | |||
DevicePushRecodeAdd, | |||
DevicePushRecodeDelete | |||
DevicePushRecodeDelete, | |||
DevicePushRecodeUpdate | |||
} from './services'; | |||
@@ -22,7 +23,7 @@ const goodspush = () => { | |||
const actionRef = useRef(); | |||
const [currentRow, setCurrentRow] = useState(); | |||
const [selectedRowsState, setSelectedRows] = useState([]); | |||
const { Paragraph } = Typography; | |||
const { Paragraph, Text } = Typography; | |||
/** 国际化修改 */ | |||
useEffect(() => { | |||
@@ -41,7 +42,7 @@ const goodspush = () => { | |||
await DevicePushRecodeDelete(selectedRows.map((row) => row.id)).then((r) => { | |||
if (r.succeeded) { | |||
message.success('删除成功'); | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
} else { | |||
message.error(r.errors); | |||
} | |||
@@ -76,16 +77,21 @@ const goodspush = () => { | |||
ellipsis: true, | |||
}, | |||
// { | |||
// title: '下发数据', | |||
// dataIndex: 'type', | |||
// ellipsis: true, | |||
// valueEnum: { | |||
// 4: { | |||
// text: '工艺', | |||
// }, | |||
// }, | |||
// }, | |||
{ | |||
title: '下发状态', | |||
dataIndex: 'status', | |||
ellipsis: true, | |||
valueEnum: { | |||
0: { | |||
text: '成功', | |||
status: 'Success', | |||
}, | |||
1: { | |||
text: '失败', | |||
status: 'Processing', | |||
}, | |||
}, | |||
}, | |||
{ | |||
title: '下发时间', | |||
dataIndex: 'createAt', | |||
@@ -105,26 +111,41 @@ const goodspush = () => { | |||
> | |||
下发详情 | |||
</a>, | |||
// <Popconfirm | |||
// type="primary" | |||
// key="primary" | |||
// title="确认删除吗?" | |||
// okText="是" | |||
// cancelText="否" | |||
// onConfirm={async () => { | |||
// await DeleteGoodsType(record.id).then((r) => { | |||
// if (r.succeeded) { | |||
// message.success('删除成功'); | |||
// actionRef.current.reload(); | |||
// } else { | |||
// message.error(r.errors); | |||
// } | |||
// }); | |||
// }} | |||
// onCancel={() => {}} | |||
// > | |||
// <a href="#">删除</a> | |||
// </Popconfirm>, | |||
<a | |||
key="config" | |||
onClick={() => { | |||
DevicePushRecodeUpdate(record.id).then((r)=>{ | |||
if(r.data){ | |||
message.success('操作成功'); | |||
actionRef.current.reloadAndRest(); | |||
}else{ | |||
message.error('操作失败'); | |||
} | |||
}) | |||
}} | |||
> | |||
重发 | |||
</a>, | |||
<Popconfirm | |||
type="primary" | |||
key="primary" | |||
title="确认删除吗?" | |||
okText="是" | |||
cancelText="否" | |||
onConfirm={async () => { | |||
await DeleteGoodsType(record.id).then((r) => { | |||
if (r.succeeded) { | |||
message.success('删除成功'); | |||
actionRef.current.reloadAndRest(); | |||
} else { | |||
message.error(r.errors); | |||
} | |||
}); | |||
}} | |||
onCancel={() => {}} | |||
> | |||
<a href="#">删除</a> | |||
</Popconfirm>, | |||
], | |||
}, | |||
]; | |||
@@ -133,7 +154,7 @@ const HandleOk= async(values)=>{ | |||
if(res.data){ | |||
message.success('操作成功'); | |||
handleModalVisible(false); | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
}else{ | |||
message.error('操作失败'); | |||
} | |||
@@ -247,11 +268,27 @@ const HandleOk= async(values)=>{ | |||
<ProDescriptions.Item label="下发设备" valueType="text"> | |||
{currentRow?.deviceName} | |||
</ProDescriptions.Item> | |||
<ProDescriptions.Item label="topic" valueType="text"> | |||
<Paragraph copyable>{currentRow?.topic}</Paragraph> | |||
<ProDescriptions.Item label="topic" copyable valueType="text"> | |||
{currentRow?.topic} | |||
</ProDescriptions.Item> | |||
<ProDescriptions.Item contentStyle={{ maxWidth: '85%'}} label="下发数据" valueType="jsonCode" > | |||
{currentRow?.dataResore} | |||
<ProDescriptions.Item contentStyle={{ maxWidth: '85%'}} label="下发数据"> | |||
<a | |||
onClick={() => { | |||
let oInput = document.createElement('input'); | |||
oInput.value = currentRow.dataResore; | |||
document.body.appendChild(oInput); | |||
oInput.select(); // 选择对象 | |||
document.execCommand('Copy'); // 执行浏览器复制命令 | |||
message.success('复制成功'); | |||
oInput.remove(); | |||
}} | |||
> | |||
<CopyOutlined /> | |||
<div style={{ overflow: 'scroll', overflowX: 'auto' }}> | |||
<Field text={currentRow?.dataResore} valueType="jsonCode" /> | |||
</div> | |||
</a> | |||
</ProDescriptions.Item> | |||
</ProDescriptions> | |||
)} | |||
@@ -187,7 +187,7 @@ const DictDataManage = (props) => { | |||
api.removeDictData([record.id]).then((r) => { | |||
if (r.data) { | |||
message.success('删除成功,即将刷新'); | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
} else { | |||
message.error('删除失败,请重试'); | |||
} | |||
@@ -292,10 +292,10 @@ const DictDataManage = (props) => { | |||
setCurrentRow(undefined); | |||
if (actionRef.current) { | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
} | |||
} | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
}} | |||
onCancel={() => { | |||
handleModalVisible(false); | |||
@@ -162,7 +162,7 @@ const DictTypeManage = () => { | |||
api.removeDictType([record.id]).then((r) => { | |||
if (r.data) { | |||
message.success('删除成功,即将刷新'); | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
} else { | |||
message.error('删除失败,请重试'); | |||
} | |||
@@ -273,10 +273,10 @@ const DictTypeManage = () => { | |||
setCurrentRow(undefined); | |||
if (actionRef.current) { | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
} | |||
} | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
}} | |||
onCancel={() => { | |||
handleModalVisible(false); | |||
@@ -32,7 +32,7 @@ const menuManager = () => { | |||
await api.add({ ...fields }).then((r) => { | |||
if (r.succeeded) { | |||
message.success('添加成功'); | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
handleModalVisible(false); | |||
}else{ | |||
message.error(r.errors); | |||
@@ -50,7 +50,7 @@ const handleUpdate = async (fields) => { | |||
api.update(fields).then((r) => { | |||
if (r.succeeded) { | |||
message.success('更新成功'); | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
handleModalVisible(false); | |||
}else{ | |||
message.error(r.errors); | |||
@@ -85,7 +85,7 @@ const handleUpdate = async (fields) => { | |||
// <a | |||
// onClick={() => { | |||
// api.remove([record.id]).then((r) => { | |||
// actionRef.current.reload(); | |||
// actionRef.current.reloadAndRest(); | |||
// }); | |||
// }} | |||
// > | |||
@@ -101,7 +101,7 @@ const handleUpdate = async (fields) => { | |||
api.remove([record.id]).then((r) => { | |||
if (r.succeeded) { | |||
message.success('操作成功'); | |||
actionRef.current.reload(); | |||
actionRef.current.reloadAndRest(); | |||
}else{ | |||
message.error(r.errors); | |||
} | |||