@@ -1,5 +1,5 @@ | |||||
import React, {useState,useEffect } from 'react'; | import React, {useState,useEffect } from 'react'; | ||||
import { Modal, Form, Input, Button, Select } from 'antd'; | |||||
import { Modal, Form, Input, Button, Select,Image } from 'antd'; | |||||
import { | import { | ||||
EditableProTable | EditableProTable | ||||
} from '@ant-design/pro-table'; | } from '@ant-design/pro-table'; | ||||
@@ -9,6 +9,7 @@ const CreateForm = (props) => { | |||||
const [dataSource, setDataSource] = useState([]); | const [dataSource, setDataSource] = useState([]); | ||||
const [editableKeys, setEditableRowKeys] = useState([]); | const [editableKeys, setEditableRowKeys] = useState([]); | ||||
const [options,setoptions]=useState([]); | const [options,setoptions]=useState([]); | ||||
const [ProductUrl,setProductUrl]=useState(''); | |||||
useEffect(() => { | useEffect(() => { | ||||
console.log("props.values",props.values) | console.log("props.values",props.values) | ||||
if(props.values.id){ | if(props.values.id){ | ||||
@@ -82,6 +83,8 @@ const CreateForm = (props) => { | |||||
console.log("ary",ary) | console.log("ary",ary) | ||||
setEditableRowKeys(ary.map((item) => item.id)) | setEditableRowKeys(ary.map((item) => item.id)) | ||||
setDataSource(ary); | setDataSource(ary); | ||||
setProductUrl(device.productUrl) | |||||
} | } | ||||
} | } | ||||
const headleOk=()=>{ | const headleOk=()=>{ | ||||
@@ -136,7 +139,12 @@ const CreateForm = (props) => { | |||||
</Form.Item> | </Form.Item> | ||||
<Form.Item label={"设备仓位图"} name="productUrl" rules={[{ required: false,max:50}]} > | |||||
<Image | |||||
width={120} | |||||
src={ProductUrl} | |||||
/> | |||||
</Form.Item> | |||||
{/* <Form.Item> | {/* <Form.Item> | ||||
<Button type="primary" htmlType="submit"> | <Button type="primary" htmlType="submit"> | ||||
保存 | 保存 | ||||
@@ -30,9 +30,9 @@ const PushFrom = (props) => { | |||||
const handleChange=(value)=>{ | const handleChange=(value)=>{ | ||||
setDeviceIds(value) | setDeviceIds(value) | ||||
var de=DeviceInfo.find(x=>x.id==value); | var de=DeviceInfo.find(x=>x.id==value); | ||||
GetProductTopicslist({productId:de?.productId,productVesionId:de?.productVersionId,IsDefault:true}).then((r)=>{ | |||||
setTopicsData(r.data) | |||||
}) | |||||
// GetProductTopicslist({productId:de?.productId,productVesionId:de?.productVersionId,IsDefault:true}).then((r)=>{ | |||||
// setTopicsData(r.data) | |||||
// }) | |||||
} | } | ||||
const HandleOk= async(values)=>{ | const HandleOk= async(values)=>{ | ||||
await DevicePushRecodeAdd(values).then((res)=>{ | await DevicePushRecodeAdd(values).then((res)=>{ | ||||
@@ -86,7 +86,7 @@ const handleStopChange=(value)=>{ | |||||
if(selectedRowsState.length==0){ | if(selectedRowsState.length==0){ | ||||
message.error('请选择物料数据'); | message.error('请选择物料数据'); | ||||
}else{ | }else{ | ||||
var parm={deviceId:de.id,deviceName:de.name,deviceAutoKey:de.autoKey,type:2,data:selectedRowsState,productVersion:de.vesion,productName:de.productName,productKey:de.prductKey,topicsData:TopicsData} | |||||
var parm={deviceId:de.id,deviceName:de.name,deviceAutoKey:de.autoKey,type:2,data:selectedRowsState,productVersion:de.vesion,productName:de.productName,productKey:de.prductKey} | |||||
HandleOk(parm) | HandleOk(parm) | ||||
console.log(de) | console.log(de) | ||||
@@ -1,5 +1,5 @@ | |||||
import { PlusOutlined,CopyOutlined } from '@ant-design/icons'; | import { PlusOutlined,CopyOutlined } from '@ant-design/icons'; | ||||
import { Button, message, Input, Drawer, Popconfirm,Typography } from 'antd'; | |||||
import { Button, message, Input, Drawer, Popconfirm,Typography,Collapse } from 'antd'; | |||||
import React, { useState, useRef, useEffect} from 'react'; | import React, { useState, useRef, useEffect} from 'react'; | ||||
import { PageContainer, FooterToolbar } from '@ant-design/pro-layout'; | import { PageContainer, FooterToolbar } from '@ant-design/pro-layout'; | ||||
import ProTable from '@ant-design/pro-table'; | import ProTable from '@ant-design/pro-table'; | ||||
@@ -25,6 +25,7 @@ const goodspush = () => { | |||||
const [selectedRowsState, setSelectedRows] = useState([]); | const [selectedRowsState, setSelectedRows] = useState([]); | ||||
const [StopData, setStopData] = useState([]); | const [StopData, setStopData] = useState([]); | ||||
const { Paragraph, Text } = Typography; | const { Paragraph, Text } = Typography; | ||||
const { Panel } = Collapse; | |||||
/** 国际化修改 */ | /** 国际化修改 */ | ||||
useEffect(() => { | useEffect(() => { | ||||
GetStop().then((t)=>{ | GetStop().then((t)=>{ | ||||
@@ -65,7 +66,7 @@ const goodspush = () => { | |||||
<a | <a | ||||
onClick={() => { | onClick={() => { | ||||
setCurrentRow(entity); | setCurrentRow(entity); | ||||
setShowDetail(true); | |||||
//setShowDetail(true); | |||||
}} | }} | ||||
> | > | ||||
{dom} | {dom} | ||||
@@ -85,13 +86,17 @@ const goodspush = () => { | |||||
dataIndex: 'status', | dataIndex: 'status', | ||||
ellipsis: true, | ellipsis: true, | ||||
valueEnum: { | valueEnum: { | ||||
0: { | |||||
text: '下发中', | |||||
status: 'Processing', | |||||
}, | |||||
1: { | 1: { | ||||
text: '成功', | text: '成功', | ||||
status: 'Success', | status: 'Success', | ||||
}, | }, | ||||
2: { | 2: { | ||||
text: '失败', | text: '失败', | ||||
status: 'Processing', | |||||
status: 'Error', | |||||
}, | }, | ||||
}, | }, | ||||
}, | }, | ||||
@@ -162,6 +167,7 @@ const HandleOk= async(values)=>{ | |||||
title: '', | title: '', | ||||
breadcrumb: {}, | breadcrumb: {}, | ||||
}}> | }}> | ||||
<ProTable | <ProTable | ||||
headerTitle="" | headerTitle="" | ||||
actionRef={actionRef} | actionRef={actionRef} | ||||
@@ -258,40 +264,81 @@ const HandleOk= async(values)=>{ | |||||
closable={false} | closable={false} | ||||
> | > | ||||
{currentRow?.deviceName && ( | {currentRow?.deviceName && ( | ||||
<ProDescriptions | |||||
column={1} | |||||
title="下发详情" | |||||
> | |||||
<ProDescriptions.Item label="下发设备" valueType="text"> | |||||
<ProDescriptions column={1}> | |||||
<ProDescriptions.Item label="下发设备" valueType="text"> | |||||
{currentRow?.deviceName} | {currentRow?.deviceName} | ||||
</ProDescriptions.Item> | |||||
<ProDescriptions.Item label="topic" copyable valueType="text"> | |||||
{currentRow?.topic} | |||||
</ProDescriptions.Item> | |||||
<ProDescriptions.Item label="下发状态" valueType="text"> | |||||
{currentRow?.description} | |||||
</ProDescriptions.Item> | |||||
<ProDescriptions.Item contentStyle={{ maxWidth: '85%'}} label="下发数据"> | |||||
<a | |||||
</ProDescriptions.Item> | |||||
<ProDescriptions.Item label="消息id" valueType="text"> | |||||
{currentRow?.messageId} | |||||
</ProDescriptions.Item> | |||||
<ProDescriptions.Item> | |||||
<Collapse defaultActiveKey={['1']} > | |||||
<Panel header="下发详情" key="1"> | |||||
<ProDescriptions column={1}> | |||||
<ProDescriptions.Item label="下发topic" copyable valueType="text"> | |||||
{currentRow?.topic} | |||||
</ProDescriptions.Item> | |||||
<ProDescriptions.Item label="下发状态" valueType="text"> | |||||
{currentRow?.description} | |||||
</ProDescriptions.Item> | |||||
<ProDescriptions.Item contentStyle={{ maxWidth: '85%'}} label="下发数据"> | |||||
<a | |||||
onClick={() => { | onClick={() => { | ||||
let oInput = document.createElement('input'); | |||||
oInput.value = currentRow.dataResore; | |||||
document.body.appendChild(oInput); | |||||
oInput.select(); // 选择对象 | |||||
document.execCommand('Copy'); // 执行浏览器复制命令 | |||||
message.success('复制成功'); | |||||
oInput.remove(); | |||||
}} | |||||
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' }}> | |||||
<CopyOutlined /> | |||||
<div style={{ width:'444px', overflow: 'scroll', overflowX: 'auto' }}> | |||||
<Field text={currentRow?.dataResore} valueType="jsonCode" /> | <Field text={currentRow?.dataResore} valueType="jsonCode" /> | ||||
</div> | </div> | ||||
</a> | </a> | ||||
</ProDescriptions.Item> | |||||
</ProDescriptions> | |||||
</Panel> | |||||
<Panel header="回调详情" key="2"> | |||||
<ProDescriptions column={1}> | |||||
<ProDescriptions.Item label="回调topic" copyable valueType="text"> | |||||
{currentRow?.topicRely} | |||||
</ProDescriptions.Item> | |||||
<ProDescriptions.Item label="回调状态" valueType="text"> | |||||
{currentRow?.descriptionRely} | |||||
</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={{width:'444px', overflow: 'scroll', overflowX: 'auto' }}> | |||||
<Field text={currentRow?.dataResoreRely} valueType="jsonCode" /> | |||||
</div> | |||||
</a> | |||||
</ProDescriptions.Item> | |||||
</ProDescriptions> | |||||
</Panel> | |||||
</Collapse> | |||||
</ProDescriptions.Item> | </ProDescriptions.Item> | ||||
</ProDescriptions> | |||||
</ProDescriptions> | |||||
)} | )} | ||||
</Drawer> | </Drawer> | ||||
</PageContainer> | </PageContainer> | ||||
@@ -1,5 +1,5 @@ | |||||
import { PlusOutlined,CopyOutlined } from '@ant-design/icons'; | import { PlusOutlined,CopyOutlined } from '@ant-design/icons'; | ||||
import { Button, message, Input, Drawer, Popconfirm,Typography } from 'antd'; | |||||
import { Button, message, Input, Drawer, Popconfirm,Typography,Collapse } from 'antd'; | |||||
import React, { useState, useRef, useEffect } from 'react'; | import React, { useState, useRef, useEffect } from 'react'; | ||||
import { PageContainer, FooterToolbar } from '@ant-design/pro-layout'; | import { PageContainer, FooterToolbar } from '@ant-design/pro-layout'; | ||||
import ProTable from '@ant-design/pro-table'; | import ProTable from '@ant-design/pro-table'; | ||||
@@ -25,6 +25,7 @@ const goodspush = () => { | |||||
const [selectedRowsState, setSelectedRows] = useState([]); | const [selectedRowsState, setSelectedRows] = useState([]); | ||||
const [StopData, setStopData] = useState([]); | const [StopData, setStopData] = useState([]); | ||||
const { Paragraph, Text } = Typography; | const { Paragraph, Text } = Typography; | ||||
const { Panel } = Collapse; | |||||
/** 国际化修改 */ | /** 国际化修改 */ | ||||
useEffect(() => { | useEffect(() => { | ||||
GetStop().then((t)=>{ | GetStop().then((t)=>{ | ||||
@@ -85,6 +86,10 @@ const goodspush = () => { | |||||
dataIndex: 'status', | dataIndex: 'status', | ||||
ellipsis: true, | ellipsis: true, | ||||
valueEnum: { | valueEnum: { | ||||
0: { | |||||
text: '下发中', | |||||
status: 'Processing', | |||||
}, | |||||
1: { | 1: { | ||||
text: '成功', | text: '成功', | ||||
status: 'Success', | status: 'Success', | ||||
@@ -257,40 +262,81 @@ const HandleOk= async(data)=>{ | |||||
closable={false} | closable={false} | ||||
> | > | ||||
{currentRow?.deviceName && ( | {currentRow?.deviceName && ( | ||||
<ProDescriptions | |||||
column={1} | |||||
title="下发详情" | |||||
> | |||||
<ProDescriptions.Item label="下发设备" valueType="text"> | |||||
<ProDescriptions column={1}> | |||||
<ProDescriptions.Item label="下发设备" valueType="text"> | |||||
{currentRow?.deviceName} | {currentRow?.deviceName} | ||||
</ProDescriptions.Item> | |||||
<ProDescriptions.Item label="topic" copyable valueType="text"> | |||||
{currentRow?.topic} | |||||
</ProDescriptions.Item> | |||||
<ProDescriptions.Item label="下发状态" valueType="text"> | |||||
{currentRow?.description} | |||||
</ProDescriptions.Item> | |||||
<ProDescriptions.Item contentStyle={{ maxWidth: '85%'}} label="下发数据"> | |||||
<a | |||||
</ProDescriptions.Item> | |||||
<ProDescriptions.Item label="消息id" valueType="text"> | |||||
{currentRow?.messageId} | |||||
</ProDescriptions.Item> | |||||
<ProDescriptions.Item> | |||||
<Collapse defaultActiveKey={['1']} > | |||||
<Panel header="下发详情" key="1"> | |||||
<ProDescriptions column={1}> | |||||
<ProDescriptions.Item label="下发topic" copyable valueType="text"> | |||||
{currentRow?.topic} | |||||
</ProDescriptions.Item> | |||||
<ProDescriptions.Item label="下发状态" valueType="text"> | |||||
{currentRow?.description} | |||||
</ProDescriptions.Item> | |||||
<ProDescriptions.Item contentStyle={{ maxWidth: '85%'}} label="下发数据"> | |||||
<a | |||||
onClick={() => { | onClick={() => { | ||||
let oInput = document.createElement('input'); | |||||
oInput.value = currentRow.dataResore; | |||||
document.body.appendChild(oInput); | |||||
oInput.select(); // 选择对象 | |||||
document.execCommand('Copy'); // 执行浏览器复制命令 | |||||
message.success('复制成功'); | |||||
oInput.remove(); | |||||
}} | |||||
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' }}> | |||||
<CopyOutlined /> | |||||
<div style={{ width:'444px', overflow: 'scroll', overflowX: 'auto' }}> | |||||
<Field text={currentRow?.dataResore} valueType="jsonCode" /> | <Field text={currentRow?.dataResore} valueType="jsonCode" /> | ||||
</div> | </div> | ||||
</a> | </a> | ||||
</ProDescriptions.Item> | |||||
</ProDescriptions> | |||||
</Panel> | |||||
<Panel header="回调详情" key="2"> | |||||
<ProDescriptions column={1}> | |||||
<ProDescriptions.Item label="回调topic" copyable valueType="text"> | |||||
{currentRow?.topicRely} | |||||
</ProDescriptions.Item> | |||||
<ProDescriptions.Item label="回调状态" valueType="text"> | |||||
{currentRow?.descriptionRely} | |||||
</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={{width:'444px', overflow: 'scroll', overflowX: 'auto' }}> | |||||
<Field text={currentRow?.dataResoreRely} valueType="jsonCode" /> | |||||
</div> | |||||
</a> | |||||
</ProDescriptions.Item> | |||||
</ProDescriptions> | |||||
</Panel> | |||||
</Collapse> | |||||
</ProDescriptions.Item> | </ProDescriptions.Item> | ||||
</ProDescriptions> | |||||
</ProDescriptions> | |||||
)} | )} | ||||
</Drawer> | </Drawer> | ||||
</PageContainer> | </PageContainer> | ||||
@@ -1,5 +1,5 @@ | |||||
import { PlusOutlined,CopyOutlined } from '@ant-design/icons'; | import { PlusOutlined,CopyOutlined } from '@ant-design/icons'; | ||||
import { Button, message, Input, Drawer, Popconfirm,Typography } from 'antd'; | |||||
import { Button, message, Input, Drawer, Popconfirm,Typography,Collapse } from 'antd'; | |||||
import React, { useState, useRef, useEffect } from 'react'; | import React, { useState, useRef, useEffect } from 'react'; | ||||
import { PageContainer, FooterToolbar } from '@ant-design/pro-layout'; | import { PageContainer, FooterToolbar } from '@ant-design/pro-layout'; | ||||
import ProTable from '@ant-design/pro-table'; | import ProTable from '@ant-design/pro-table'; | ||||
@@ -25,6 +25,7 @@ const goodspush = () => { | |||||
const [selectedRowsState, setSelectedRows] = useState([]); | const [selectedRowsState, setSelectedRows] = useState([]); | ||||
const [StopData, setStopData] = useState([]); | const [StopData, setStopData] = useState([]); | ||||
const { Paragraph, Text } = Typography; | const { Paragraph, Text } = Typography; | ||||
const { Panel } = Collapse; | |||||
/** 国际化修改 */ | /** 国际化修改 */ | ||||
useEffect(() => { | useEffect(() => { | ||||
@@ -257,40 +258,81 @@ const HandleOk= async(data)=>{ | |||||
closable={false} | closable={false} | ||||
> | > | ||||
{currentRow?.deviceName && ( | {currentRow?.deviceName && ( | ||||
<ProDescriptions | |||||
column={1} | |||||
title="下发详情" | |||||
> | |||||
<ProDescriptions.Item label="下发设备" valueType="text"> | |||||
<ProDescriptions column={1}> | |||||
<ProDescriptions.Item label="下发设备" valueType="text"> | |||||
{currentRow?.deviceName} | {currentRow?.deviceName} | ||||
</ProDescriptions.Item> | |||||
<ProDescriptions.Item label="topic" copyable valueType="text"> | |||||
{currentRow?.topic} | |||||
</ProDescriptions.Item> | |||||
<ProDescriptions.Item label="下发状态" valueType="text"> | |||||
{currentRow?.description} | |||||
</ProDescriptions.Item> | |||||
<ProDescriptions.Item contentStyle={{ maxWidth: '85%'}} label="下发数据"> | |||||
<a | |||||
</ProDescriptions.Item> | |||||
<ProDescriptions.Item label="消息id" valueType="text"> | |||||
{currentRow?.messageId} | |||||
</ProDescriptions.Item> | |||||
<ProDescriptions.Item> | |||||
<Collapse defaultActiveKey={['1']} > | |||||
<Panel header="下发详情" key="1"> | |||||
<ProDescriptions column={1}> | |||||
<ProDescriptions.Item label="下发topic" copyable valueType="text"> | |||||
{currentRow?.topic} | |||||
</ProDescriptions.Item> | |||||
<ProDescriptions.Item label="下发状态" valueType="text"> | |||||
{currentRow?.description} | |||||
</ProDescriptions.Item> | |||||
<ProDescriptions.Item contentStyle={{ maxWidth: '85%'}} label="下发数据"> | |||||
<a | |||||
onClick={() => { | onClick={() => { | ||||
let oInput = document.createElement('input'); | |||||
oInput.value = currentRow.dataResore; | |||||
document.body.appendChild(oInput); | |||||
oInput.select(); // 选择对象 | |||||
document.execCommand('Copy'); // 执行浏览器复制命令 | |||||
message.success('复制成功'); | |||||
oInput.remove(); | |||||
}} | |||||
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' }}> | |||||
<CopyOutlined /> | |||||
<div style={{ width:'444px', overflow: 'scroll', overflowX: 'auto' }}> | |||||
<Field text={currentRow?.dataResore} valueType="jsonCode" /> | <Field text={currentRow?.dataResore} valueType="jsonCode" /> | ||||
</div> | </div> | ||||
</a> | </a> | ||||
</ProDescriptions.Item> | |||||
</ProDescriptions> | |||||
</Panel> | |||||
<Panel header="回调详情" key="2"> | |||||
<ProDescriptions column={1}> | |||||
<ProDescriptions.Item label="回调topic" copyable valueType="text"> | |||||
{currentRow?.topicRely} | |||||
</ProDescriptions.Item> | |||||
<ProDescriptions.Item label="回调状态" valueType="text"> | |||||
{currentRow?.descriptionRely} | |||||
</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={{width:'444px', overflow: 'scroll', overflowX: 'auto' }}> | |||||
<Field text={currentRow?.dataResoreRely} valueType="jsonCode" /> | |||||
</div> | |||||
</a> | |||||
</ProDescriptions.Item> | |||||
</ProDescriptions> | |||||
</Panel> | |||||
</Collapse> | |||||
</ProDescriptions.Item> | </ProDescriptions.Item> | ||||
</ProDescriptions> | |||||
</ProDescriptions> | |||||
)} | )} | ||||
</Drawer> | </Drawer> | ||||
</PageContainer> | </PageContainer> | ||||