@@ -4,6 +4,7 @@ import ProTable from '@ant-design/pro-table'; | |||
import { | |||
GetDeviceList, | |||
GetBatchingPage, | |||
GetProductTopicslist | |||
} from '../services'; | |||
const PushFrom = (props) => { | |||
const [deviceData, setdeviceData] = useState([]); | |||
@@ -11,6 +12,7 @@ const PushFrom = (props) => { | |||
const [dataSource,setdataSource]= useState([]); | |||
const [DeviceIds, setDeviceIds] = useState(); | |||
const [DeviceInfo, setDeviceInfo] = useState([]); | |||
const [TopicsData, setTopicsData] = useState([]); | |||
const actionRef = useRef(); | |||
useEffect(() => { | |||
console.log(props.values) | |||
@@ -35,6 +37,11 @@ const PushFrom = (props) => { | |||
setDeviceIds(value) | |||
var params={current:1,pageSize:10,deviceId:value} | |||
GetGoodsData(params) | |||
var de=DeviceInfo.find(x=>x.id==value); | |||
console.log("ddddd",de) | |||
GetProductTopicslist({productId:de?.productId,productVesionId:de?.productVersionId,IsDefault:true}).then((r)=>{ | |||
setTopicsData(r.data) | |||
}) | |||
} | |||
const columns=[ | |||
@@ -64,7 +71,7 @@ const PushFrom = (props) => { | |||
message.error('请选择设备'); | |||
}else{ | |||
var de=DeviceInfo.find(x=>x.id==DeviceIds); | |||
var parm={deviceId:de.id,deviceName:de.name,deviceAutoKey:de.autoKey,type:2,data:selectedRowsState} | |||
var parm={deviceId:de.id,deviceName:de.name,deviceAutoKey:de.autoKey,type:2,data:selectedRowsState,productVersion:de.vesion,productKey:de.prductKey,topicsData:TopicsData} | |||
props.HandleOk(parm) | |||
console.log(de) | |||
} | |||
@@ -82,11 +82,11 @@ const goodspush = () => { | |||
dataIndex: 'status', | |||
ellipsis: true, | |||
valueEnum: { | |||
0: { | |||
1: { | |||
text: '成功', | |||
status: 'Success', | |||
}, | |||
1: { | |||
2: { | |||
text: '失败', | |||
status: 'Processing', | |||
}, | |||
@@ -126,26 +126,26 @@ const goodspush = () => { | |||
> | |||
重发 | |||
</a>, | |||
<Popconfirm | |||
type="primary" | |||
key="primary" | |||
title="确认删除吗?" | |||
okText="是" | |||
cancelText="否" | |||
onConfirm={async () => { | |||
await DeleteGoodsType(record.id).then((r) => { | |||
if (r.succeeded) { | |||
message.success('删除成功'); | |||
actionRef.current.reload(); | |||
} else { | |||
message.error(r.errors); | |||
} | |||
}); | |||
}} | |||
onCancel={() => {}} | |||
> | |||
<a href="#">删除</a> | |||
</Popconfirm>, | |||
// <Popconfirm | |||
// type="primary" | |||
// key="primary" | |||
// title="确认删除吗?" | |||
// okText="是" | |||
// cancelText="否" | |||
// onConfirm={async () => { | |||
// await DeleteGoodsType(record.id).then((r) => { | |||
// if (r.succeeded) { | |||
// message.success('删除成功'); | |||
// actionRef.current.reload(); | |||
// } else { | |||
// message.error(r.errors); | |||
// } | |||
// }); | |||
// }} | |||
// onCancel={() => {}} | |||
// > | |||
// <a href="#">删除</a> | |||
// </Popconfirm>, | |||
], | |||
}, | |||
]; | |||
@@ -272,7 +272,9 @@ const HandleOk= async(values)=>{ | |||
<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={() => { | |||
@@ -37,3 +37,11 @@ export async function GetDevicePushRecodePage(data) { | |||
// ...(options || {}), | |||
}); | |||
} | |||
export async function GetProductTopicslist(data) { | |||
return request(getDataBaseUrl()+`/api/producttopics/list`, { | |||
method: 'Post', | |||
data: data, | |||
// params: { ...params }, | |||
// ...(options || {}), | |||
}); | |||
} |
@@ -4,7 +4,8 @@ import ProTable from '@ant-design/pro-table'; | |||
import { | |||
GetDeviceList, | |||
GetGoodsPage, | |||
GetGoodsTypeTree | |||
GetGoodsTypeTree, | |||
GetProductTopicslist | |||
} from '../services'; | |||
const PushFrom = (props) => { | |||
const [deviceData, setdeviceData] = useState([]); | |||
@@ -14,6 +15,7 @@ const PushFrom = (props) => { | |||
const [DeviceIds, setDeviceIds] = useState(); | |||
const [DeviceInfo, setDeviceInfo] = useState([]); | |||
const [isGlogy, setisGlogy] = useState(false); | |||
const [TopicsData, setTopicsData] = useState([]); | |||
const actionRef = useRef(); | |||
useEffect(() => { | |||
console.log(props.values) | |||
@@ -41,6 +43,11 @@ const PushFrom = (props) => { | |||
setDeviceIds(value) | |||
var params={current:1,pageSize:10,deviceId:value} | |||
GetGoodsData(params) | |||
var de=DeviceInfo.find(x=>x.id==value); | |||
console.log("ddddd",de) | |||
GetProductTopicslist({productId:de?.productId,productVesionId:de?.productVersionId,IsDefault:true}).then((r)=>{ | |||
setTopicsData(r.data) | |||
}) | |||
} | |||
const onChange=(checked)=>{ | |||
if(!DeviceIds){ | |||
@@ -102,7 +109,7 @@ const PushFrom = (props) => { | |||
// } | |||
// } | |||
}) | |||
var parm={deviceId:de.id,deviceName:de.name,deviceAutoKey:de.autoKey,type:1,data:data} | |||
var parm={deviceId:de.id,deviceName:de.name,deviceAutoKey:de.autoKey,type:1,data:data,productVersion:de.vesion,productKey:de.prductKey,topicsData:TopicsData} | |||
props.HandleOk(parm) | |||
console.log(de) | |||
} | |||
@@ -82,11 +82,11 @@ const goodspush = () => { | |||
dataIndex: 'status', | |||
ellipsis: true, | |||
valueEnum: { | |||
0: { | |||
1: { | |||
text: '成功', | |||
status: 'Success', | |||
}, | |||
1: { | |||
2: { | |||
text: '失败', | |||
status: 'Processing', | |||
}, | |||
@@ -126,26 +126,26 @@ const goodspush = () => { | |||
> | |||
重发 | |||
</a>, | |||
<Popconfirm | |||
type="primary" | |||
key="primary" | |||
title="确认删除吗?" | |||
okText="是" | |||
cancelText="否" | |||
onConfirm={async () => { | |||
await DeleteGoodsType(record.id).then((r) => { | |||
if (r.succeeded) { | |||
message.success('删除成功'); | |||
actionRef.current.reload(); | |||
} else { | |||
message.error(r.errors); | |||
} | |||
}); | |||
}} | |||
onCancel={() => {}} | |||
> | |||
<a href="#">删除</a> | |||
</Popconfirm>, | |||
// <Popconfirm | |||
// type="primary" | |||
// key="primary" | |||
// title="确认删除吗?" | |||
// okText="是" | |||
// cancelText="否" | |||
// onConfirm={async () => { | |||
// await DeleteGoodsType(record.id).then((r) => { | |||
// if (r.succeeded) { | |||
// message.success('删除成功'); | |||
// actionRef.current.reload(); | |||
// } else { | |||
// message.error(r.errors); | |||
// } | |||
// }); | |||
// }} | |||
// onCancel={() => {}} | |||
// > | |||
// <a href="#">删除</a> | |||
// </Popconfirm>, | |||
], | |||
}, | |||
]; | |||
@@ -271,6 +271,9 @@ const HandleOk= async(values)=>{ | |||
<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={() => { | |||
@@ -44,3 +44,11 @@ export async function GetDevicePushRecodePage(data) { | |||
// ...(options || {}), | |||
}); | |||
} | |||
export async function GetProductTopicslist(data) { | |||
return request(getDataBaseUrl()+`/api/producttopics/list`, { | |||
method: 'Post', | |||
data: data, | |||
// params: { ...params }, | |||
// ...(options || {}), | |||
}); | |||
} |
@@ -4,7 +4,8 @@ import ProTable from '@ant-design/pro-table'; | |||
import { | |||
GetDeviceList, | |||
GetGoodsPage, | |||
GetGoodsTypeTree | |||
GetGoodsTypeTree, | |||
GetProductTopicslist | |||
} from '../services'; | |||
const PushFrom = (props) => { | |||
const [deviceData, setdeviceData] = useState([]); | |||
@@ -13,10 +14,12 @@ const PushFrom = (props) => { | |||
const [treeData, setTreeData] = useState(); | |||
const [DeviceIds, setDeviceIds] = useState(); | |||
const [DeviceInfo, setDeviceInfo] = useState([]); | |||
const [TopicsData, setTopicsData] = useState([]); | |||
const [isGlogy, setisGlogy] = useState(false); | |||
const actionRef = useRef(); | |||
useEffect(() => { | |||
console.log(props.values) | |||
GetDeviceList().then((r)=>{ | |||
setDeviceInfo(r.data) | |||
if(r.data.length>0){ | |||
@@ -25,7 +28,7 @@ const PushFrom = (props) => { | |||
}) | |||
setdeviceData(data) | |||
} | |||
}) | |||
GetGoodsTypeTree().then((r) => { | |||
setTreeData(r.data); | |||
@@ -44,6 +47,11 @@ const PushFrom = (props) => { | |||
setDeviceIds(value) | |||
var params={current:1,pageSize:10,deviceId:value} | |||
GetGoodsData(params) | |||
var de=DeviceInfo.find(x=>x.id==value); | |||
console.log("ddddd",de) | |||
GetProductTopicslist({productId:de?.productId,productVesionId:de?.productVersionId,IsDefault:true}).then((r)=>{ | |||
setTopicsData(r.data) | |||
}) | |||
} | |||
const onChange=(checked)=>{ | |||
if(!DeviceIds){ | |||
@@ -92,14 +100,8 @@ const PushFrom = (props) => { | |||
}else{ | |||
var de=DeviceInfo.find(x=>x.id==DeviceIds); | |||
var data={goodstechnology:[]}; | |||
// if(isGlogy){ | |||
// data.goodstechnology=[] | |||
// } | |||
console.log("de",de) | |||
selectedRowsState.map(x=>{ | |||
// var pa={id:x.id,code:x.code,goodsTypeId:x.goodsTypeId,goodsTypeName:x.goodsTypeName,goodsUintId:x.goodsUintId,imgUrl:x.imgUrl,isAttrubute:x.isAttrubute,name:x.name,price:x.price,design:x.design,remark:x.remark} | |||
// data.goodsinfo.push(pa); | |||
// if(isGlogy){ | |||
// //data.goodstechnology=[] | |||
if(x.goodstechnology.length>0){ | |||
data.goodstechnology.push(x.goodstechnology) | |||
} | |||
@@ -108,7 +110,8 @@ const PushFrom = (props) => { | |||
if(data.goodstechnology.length==0){ | |||
message.error('选择的商品还没有工艺'); | |||
}else{ | |||
var parm={deviceId:de.id,deviceName:de.name,deviceAutoKey:de.autoKey,type:4,data:data} | |||
var parm={deviceId:de.id,deviceName:de.name,deviceAutoKey:de.autoKey,type:4,data:data,productVersion:de.vesion,productKey:de.prductKey,topicsData:TopicsData} | |||
console.log("parm",parm) | |||
props.HandleOk(parm) | |||
console.log(de) | |||
} | |||
@@ -82,11 +82,11 @@ const goodspush = () => { | |||
dataIndex: 'status', | |||
ellipsis: true, | |||
valueEnum: { | |||
0: { | |||
1: { | |||
text: '成功', | |||
status: 'Success', | |||
}, | |||
1: { | |||
2: { | |||
text: '失败', | |||
status: 'Processing', | |||
}, | |||
@@ -126,26 +126,26 @@ const goodspush = () => { | |||
> | |||
重发 | |||
</a>, | |||
<Popconfirm | |||
type="primary" | |||
key="primary" | |||
title="确认删除吗?" | |||
okText="是" | |||
cancelText="否" | |||
onConfirm={async () => { | |||
await DeleteGoodsType(record.id).then((r) => { | |||
if (r.succeeded) { | |||
message.success('删除成功'); | |||
actionRef.current.reload(); | |||
} else { | |||
message.error(r.errors); | |||
} | |||
}); | |||
}} | |||
onCancel={() => {}} | |||
> | |||
<a href="#">删除</a> | |||
</Popconfirm>, | |||
// <Popconfirm | |||
// type="primary" | |||
// key="primary" | |||
// title="确认删除吗?" | |||
// okText="是" | |||
// cancelText="否" | |||
// onConfirm={async () => { | |||
// await DeleteGoodsType(record.id).then((r) => { | |||
// if (r.succeeded) { | |||
// message.success('删除成功'); | |||
// actionRef.current.reload(); | |||
// } else { | |||
// message.error(r.errors); | |||
// } | |||
// }); | |||
// }} | |||
// onCancel={() => {}} | |||
// > | |||
// <a href="#">删除</a> | |||
// </Popconfirm>, | |||
], | |||
}, | |||
]; | |||
@@ -271,6 +271,9 @@ const HandleOk= async(values)=>{ | |||
<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={() => { | |||
@@ -44,3 +44,11 @@ export async function GetDevicePushRecodePage(data) { | |||
// ...(options || {}), | |||
}); | |||
} | |||
export async function GetProductTopicslist(data) { | |||
return request(getDataBaseUrl()+`/api/producttopics/list`, { | |||
method: 'Post', | |||
data: data, | |||
// params: { ...params }, | |||
// ...(options || {}), | |||
}); | |||
} |
@@ -110,13 +110,13 @@ const Login = () => { | |||
<img alt="logo" className={styles.logo} src="/logo.png" /> | |||
</div> | |||
</Link> | |||
<div className={styles.desc}>智慧餐饮解决方案服务商</div> | |||
<div className={styles.desc}>黑菠萝智慧后厨解决方案</div> | |||
</div> | |||
</div> | |||
</div> | |||
<div className={styles.main}> | |||
<div className={styles.title}>连锁经营平台</div> | |||
<div className={styles.title}>黑菠萝智慧后厨管理</div> | |||
<ProForm | |||
initialValues={{ | |||
autoLogin: true, | |||