From 982488f565eb56a3852bd730d4ee2378cd4b1a44 Mon Sep 17 00:00:00 2001 From: zhaoy <137053305@qq.com> Date: Wed, 24 Jan 2024 17:54:35 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8F=9C=E5=8D=95=E5=85=A8=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../push/goodspush/components/PushFrom.jsx | 137 ++++++++++++++++++ src/pages/sys/menus/components/CreateForm.jsx | 1 + src/pages/sys/menus/index.jsx | 3 + 3 files changed, 141 insertions(+) create mode 100644 src/pages/push/goodspush/components/PushFrom.jsx diff --git a/src/pages/push/goodspush/components/PushFrom.jsx b/src/pages/push/goodspush/components/PushFrom.jsx new file mode 100644 index 0000000..b92e5bf --- /dev/null +++ b/src/pages/push/goodspush/components/PushFrom.jsx @@ -0,0 +1,137 @@ +import React, { useState, useEffect,useRef } from 'react'; +import { Modal, Row, Col, Checkbox, Select} from 'antd'; +import ProTable from '@ant-design/pro-table'; +import { + GetDeviceList, + GetGoodsPage, + GetGoodsTypeTree +} from '../services'; +const PushFrom = (props) => { + const [deviceData, setdeviceData] = useState([]); + const [selectedRowsState, setSelectedRows] = useState([]); + const [dataSource,setdataSource]= useState([]); + const [treeData, setTreeData] = useState(); + const [DeviceIds, setDeviceIds] = useState([]); + const [DeviceInfo, setDeviceInfo] = useState([]); + const actionRef = useRef(); + useEffect(() => { + console.log(props.values) + GetDeviceList().then((r)=>{ + setDeviceInfo(r.data); + var data=r.data.map(x=>{ + return {value:x.id,label:x.name} + }) + setdeviceData(data) + }) + GetGoodsTypeTree().then((r) => { + setTreeData(r.data); + }); + var params={current:1,pageSize:10} + GetGoodsPage(params).then((r) => { + setdataSource(r.data.data); + //console.log(goodsData) + //total = r.data.total; + }); + },[props.values]) + const handleChange=(value)=>{ + setDeviceIds(value) + } + const columns=[ + { + title: '编码', + dataIndex: 'code', + valueType: 'textarea', + hideInTable: true, + hideInSearch: true, + }, + { + title: '名称', + dataIndex: 'name', + valueType: 'textarea', + }, + { + title: '商品类型', + dataIndex: 'goodsTypeName', + valueType: 'treeSelect', + fieldProps: { + showSearch:true, + allowClear:true, + options: treeData + }, + }, + ] + return ( + { + console.log(selectedRowsState) + console.log(DeviceIds) + if(DeviceIds.length>0){ + + } + }} + onCancel={() => { + props.onCancel(); + }} + destroyOnClose + > + + + 选择设备: +