Browse Source

数据下发

kitchenmanage
zhaoy 10 months ago
parent
commit
995d22d361
5 changed files with 235 additions and 92 deletions
  1. +10
    -2
      src/pages/device/warehousepostion/components/CreateForm.jsx
  2. +4
    -4
      src/pages/push/batchingpush/components/PushFrom.jsx
  3. +77
    -30
      src/pages/push/batchingpush/index.jsx
  4. +74
    -28
      src/pages/push/goodspush/index.jsx
  5. +70
    -28
      src/pages/push/technologypush/index.jsx

+ 10
- 2
src/pages/device/warehousepostion/components/CreateForm.jsx View File

@@ -1,5 +1,5 @@
import React, {useState,useEffect } from 'react';
import { Modal, Form, Input, Button, Select } from 'antd';
import { Modal, Form, Input, Button, Select,Image } from 'antd';
import {
EditableProTable
} from '@ant-design/pro-table';
@@ -9,6 +9,7 @@ const CreateForm = (props) => {
const [dataSource, setDataSource] = useState([]);
const [editableKeys, setEditableRowKeys] = useState([]);
const [options,setoptions]=useState([]);
const [ProductUrl,setProductUrl]=useState('');
useEffect(() => {
console.log("props.values",props.values)
if(props.values.id){
@@ -82,6 +83,8 @@ const CreateForm = (props) => {
console.log("ary",ary)
setEditableRowKeys(ary.map((item) => item.id))
setDataSource(ary);
setProductUrl(device.productUrl)
}
}
const headleOk=()=>{
@@ -136,7 +139,12 @@ const CreateForm = (props) => {
</Form.Item>
<Form.Item label={"设备仓位图"} name="productUrl" rules={[{ required: false,max:50}]} >
<Image
width={120}
src={ProductUrl}
/>
</Form.Item>
{/* <Form.Item>
<Button type="primary" htmlType="submit">
保存


+ 4
- 4
src/pages/push/batchingpush/components/PushFrom.jsx View File

@@ -30,9 +30,9 @@ const PushFrom = (props) => {
const handleChange=(value)=>{
setDeviceIds(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)=>{
await DevicePushRecodeAdd(values).then((res)=>{
@@ -86,7 +86,7 @@ const handleStopChange=(value)=>{
if(selectedRowsState.length==0){
message.error('请选择物料数据');
}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)
console.log(de)


+ 77
- 30
src/pages/push/batchingpush/index.jsx View File

@@ -1,5 +1,5 @@
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 { PageContainer, FooterToolbar } from '@ant-design/pro-layout';
import ProTable from '@ant-design/pro-table';
@@ -25,6 +25,7 @@ const goodspush = () => {
const [selectedRowsState, setSelectedRows] = useState([]);
const [StopData, setStopData] = useState([]);
const { Paragraph, Text } = Typography;
const { Panel } = Collapse;
/** 国际化修改 */
useEffect(() => {
GetStop().then((t)=>{
@@ -65,7 +66,7 @@ const goodspush = () => {
<a
onClick={() => {
setCurrentRow(entity);
setShowDetail(true);
//setShowDetail(true);
}}
>
{dom}
@@ -85,13 +86,17 @@ const goodspush = () => {
dataIndex: 'status',
ellipsis: true,
valueEnum: {
0: {
text: '下发中',
status: 'Processing',
},
1: {
text: '成功',
status: 'Success',
},
2: {
text: '失败',
status: 'Processing',
status: 'Error',
},
},
},
@@ -162,6 +167,7 @@ const HandleOk= async(values)=>{
title: '',
breadcrumb: {},
}}>
<ProTable
headerTitle=""
actionRef={actionRef}
@@ -258,40 +264,81 @@ const HandleOk= async(values)=>{
closable={false}
>
{currentRow?.deviceName && (
<ProDescriptions
column={1}
title="下发详情"
>
<ProDescriptions.Item label="下发设备" valueType="text">
<ProDescriptions column={1}>
<ProDescriptions.Item label="下发设备" valueType="text">
{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={() => {
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" />
</div>
</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>
</ProDescriptions>
)}
</Drawer>
</PageContainer>


+ 74
- 28
src/pages/push/goodspush/index.jsx View File

@@ -1,5 +1,5 @@
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 { PageContainer, FooterToolbar } from '@ant-design/pro-layout';
import ProTable from '@ant-design/pro-table';
@@ -25,6 +25,7 @@ const goodspush = () => {
const [selectedRowsState, setSelectedRows] = useState([]);
const [StopData, setStopData] = useState([]);
const { Paragraph, Text } = Typography;
const { Panel } = Collapse;
/** 国际化修改 */
useEffect(() => {
GetStop().then((t)=>{
@@ -85,6 +86,10 @@ const goodspush = () => {
dataIndex: 'status',
ellipsis: true,
valueEnum: {
0: {
text: '下发中',
status: 'Processing',
},
1: {
text: '成功',
status: 'Success',
@@ -257,40 +262,81 @@ const HandleOk= async(data)=>{
closable={false}
>
{currentRow?.deviceName && (
<ProDescriptions
column={1}
title="下发详情"
>
<ProDescriptions.Item label="下发设备" valueType="text">
<ProDescriptions column={1}>
<ProDescriptions.Item label="下发设备" valueType="text">
{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={() => {
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" />
</div>
</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>
</ProDescriptions>
)}
</Drawer>
</PageContainer>


+ 70
- 28
src/pages/push/technologypush/index.jsx View File

@@ -1,5 +1,5 @@
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 { PageContainer, FooterToolbar } from '@ant-design/pro-layout';
import ProTable from '@ant-design/pro-table';
@@ -25,6 +25,7 @@ const goodspush = () => {
const [selectedRowsState, setSelectedRows] = useState([]);
const [StopData, setStopData] = useState([]);
const { Paragraph, Text } = Typography;
const { Panel } = Collapse;
/** 国际化修改 */
useEffect(() => {
@@ -257,40 +258,81 @@ const HandleOk= async(data)=>{
closable={false}
>
{currentRow?.deviceName && (
<ProDescriptions
column={1}
title="下发详情"
>
<ProDescriptions.Item label="下发设备" valueType="text">
<ProDescriptions column={1}>
<ProDescriptions.Item label="下发设备" valueType="text">
{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={() => {
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" />
</div>
</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>
</ProDescriptions>
)}
</Drawer>
</PageContainer>


Loading…
Cancel
Save