Browse Source

复制问题

tmp
zhaoy 7 months ago
parent
commit
3b5f2b63c3
3 changed files with 75 additions and 22 deletions
  1. +27
    -8
      src/pages/push/batchingpush/index.jsx
  2. +24
    -7
      src/pages/push/goodspush/index.jsx
  3. +24
    -7
      src/pages/push/technologypush/index.jsx

+ 27
- 8
src/pages/push/batchingpush/index.jsx View File

@@ -1,11 +1,11 @@
import { PlusOutlined } from '@ant-design/icons';
import { Button, message, Input, Drawer, Popconfirm } 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,
@@ -23,6 +23,7 @@ const goodspush = () => {
const actionRef = useRef();
const [currentRow, setCurrentRow] = useState();
const [selectedRowsState, setSelectedRows] = useState([]);
const { Paragraph, Text } = Typography;
/** 国际化修改 */
useEffect(() => {
@@ -159,6 +160,7 @@ const HandleOk= async(values)=>{
}
})
}

return (
<PageContainer host header={{
title: '',
@@ -267,11 +269,28 @@ const HandleOk= async(values)=>{
<ProDescriptions.Item label="下发设备" valueType="text">
{currentRow?.deviceName}
</ProDescriptions.Item>
<ProDescriptions.Item label="topic" valueType="text" copyable={true}>
<a href='#'>{currentRow?.topic}</a>
<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>
)}


+ 24
- 7
src/pages/push/goodspush/index.jsx View File

@@ -1,11 +1,11 @@
import { PlusOutlined } from '@ant-design/icons';
import { Button, message, Input, Drawer, Popconfirm } from 'antd';
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,
@@ -23,6 +23,7 @@ const goodspush = () => {
const actionRef = useRef();
const [currentRow, setCurrentRow] = useState();
const [selectedRowsState, setSelectedRows] = useState([]);
const { Paragraph, Text } = Typography;
/** 国际化修改 */
useEffect(() => {
@@ -267,11 +268,27 @@ const HandleOk= async(values)=>{
<ProDescriptions.Item label="下发设备" valueType="text">
{currentRow?.deviceName}
</ProDescriptions.Item>
<ProDescriptions.Item label="topic" valueType="text" copyable={true}>
<a href='#'>{currentRow?.topic}</a>
<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>
)}


+ 24
- 7
src/pages/push/technologypush/index.jsx View File

@@ -1,11 +1,11 @@
import { PlusOutlined } from '@ant-design/icons';
import { Button, message, Input, Drawer, Popconfirm } from 'antd';
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,
@@ -23,6 +23,7 @@ const goodspush = () => {
const actionRef = useRef();
const [currentRow, setCurrentRow] = useState();
const [selectedRowsState, setSelectedRows] = useState([]);
const { Paragraph, Text } = Typography;
/** 国际化修改 */
useEffect(() => {
@@ -267,11 +268,27 @@ const HandleOk= async(values)=>{
<ProDescriptions.Item label="下发设备" valueType="text">
{currentRow?.deviceName}
</ProDescriptions.Item>
<ProDescriptions.Item label="topic" valueType="text" copyable={true}>
<a href='#'>{currentRow?.topic}</a>
<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>
)}


Loading…
Cancel
Save