瀏覽代碼

下发页面

master
zhaoy 9 月之前
父節點
當前提交
22931018c5
共有 3 個文件被更改,包括 57 次插入7 次删除
  1. +51
    -6
      src/pages/device/devicepush/components/PushFrom.jsx
  2. +1
    -1
      src/pages/device/devicepush/index.jsx
  3. +5
    -0
      src/pages/device/devicepush/services.js

+ 51
- 6
src/pages/device/devicepush/components/PushFrom.jsx 查看文件

@@ -1,20 +1,65 @@
import React from 'react';
import { Modal, Form, Input, Button, Select,InputNumber,TreeSelect } from 'antd';

import React, { useState, useEffect,useRef } from 'react';
import { Modal, Row, Col, Checkbox, Select} from 'antd';
import {
GetDeviceList,
} from '../services';
const PushFrom = (props) => { const PushFrom = (props) => {
const { Option, OptGroup } = Select;
const [deviceData, setdeviceData] = useState([]);
useEffect(() => {
console.log(props.values)
GetDeviceList().then((r)=>{
var data=r.data.map(x=>{
return {value:x.id,label:x.name}
})
setdeviceData(data)
})
},[props.values])
const handleChange=()=>{

}
const onChangedata=()=>{

}
return ( return (
<Modal <Modal
title={props.values.id ? '编辑' : '新建'}
title={'下发数据'}
width={640} width={640}
visible={props.createModalVisible} visible={props.createModalVisible}
bodyStyle={{ padding: '32px 40px 1px 48px' }} bodyStyle={{ padding: '32px 40px 1px 48px' }}
footer={null}
okText="保存"
cancelText="取消"
onOk={() => {
}}
onCancel={() => { onCancel={() => {
props.onCancel(); props.onCancel();
}} }}
destroyOnClose destroyOnClose
> >
<Row gutter={26}>
<Col lg={24} md={24} sm={24}>
选择设备:
<Select
mode="multiple"
allowClear
style={{width: '60%'}}
placeholder="请选择要下发设备"
onChange={handleChange}
options={deviceData}
/>
</Col>
</Row>
<Row gutter={26}>
<Col span={24}>
选择数据:
<Checkbox.Group defaultValue={['1','2']} onChange={onChangedata} >
<Checkbox value="1">商品</Checkbox><a style={{marginLeft:2,marginRight:30}}>【选择商品】</a>
<Checkbox value="2">物料 </Checkbox><a style={{marginLeft:2,marginRight:30}}>【选择物料】</a>
<Checkbox value="3">工艺</Checkbox><a style={{marginLeft:2,marginRight:30}}>【选择工艺】</a>
<Checkbox value="4">配方</Checkbox><a style={{marginLeft:2,marginRight:30}}>【选择配方】</a>
</Checkbox.Group>
</Col>
</Row>
</Modal> </Modal>
); );
}; };


+ 1
- 1
src/pages/device/devicepush/index.jsx 查看文件

@@ -157,7 +157,7 @@ const DevicePush = () => {
handleModalVisible(true); handleModalVisible(true);
}} }}
> >
<PlusOutlined /> 新建
<PlusOutlined /> 下发数据
</Button>, </Button>,
]} ]}
request={async (params) => { request={async (params) => {


+ 5
- 0
src/pages/device/devicepush/services.js 查看文件

@@ -23,3 +23,8 @@ export async function GetDevicePushRecodePage(data) {
data: data, data: data,
}); });
} }
export async function GetDeviceList() {
return request(`/saasbase/api/device/list`, {
method: 'GET',
});
}

Loading…
取消
儲存