Browse Source

下发页面

master
zhaoy 9 months ago
parent
commit
22931018c5
3 changed files with 57 additions and 7 deletions
  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 View File

@@ -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 { 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 (
<Modal
title={props.values.id ? '编辑' : '新建'}
title={'下发数据'}
width={640}
visible={props.createModalVisible}
bodyStyle={{ padding: '32px 40px 1px 48px' }}
footer={null}
okText="保存"
cancelText="取消"
onOk={() => {
}}
onCancel={() => {
props.onCancel();
}}
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>
);
};


+ 1
- 1
src/pages/device/devicepush/index.jsx View File

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


+ 5
- 0
src/pages/device/devicepush/services.js View File

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

Loading…
Cancel
Save