@@ -4,6 +4,7 @@ import ProTable from '@ant-design/pro-table'; | |||||
import { | import { | ||||
GetDeviceList, | GetDeviceList, | ||||
GetBatchingPage, | GetBatchingPage, | ||||
GetProductTopicslist | |||||
} from '../services'; | } from '../services'; | ||||
const PushFrom = (props) => { | const PushFrom = (props) => { | ||||
const [deviceData, setdeviceData] = useState([]); | const [deviceData, setdeviceData] = useState([]); | ||||
@@ -11,6 +12,7 @@ const PushFrom = (props) => { | |||||
const [dataSource,setdataSource]= useState([]); | const [dataSource,setdataSource]= useState([]); | ||||
const [DeviceIds, setDeviceIds] = useState(); | const [DeviceIds, setDeviceIds] = useState(); | ||||
const [DeviceInfo, setDeviceInfo] = useState([]); | const [DeviceInfo, setDeviceInfo] = useState([]); | ||||
const [TopicsData, setTopicsData] = useState([]); | |||||
const actionRef = useRef(); | const actionRef = useRef(); | ||||
useEffect(() => { | useEffect(() => { | ||||
console.log(props.values) | console.log(props.values) | ||||
@@ -35,6 +37,11 @@ const PushFrom = (props) => { | |||||
setDeviceIds(value) | setDeviceIds(value) | ||||
var params={current:1,pageSize:10,deviceId:value} | var params={current:1,pageSize:10,deviceId:value} | ||||
GetGoodsData(params) | 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=[ | const columns=[ | ||||
@@ -64,7 +71,7 @@ const PushFrom = (props) => { | |||||
message.error('请选择设备'); | message.error('请选择设备'); | ||||
}else{ | }else{ | ||||
var de=DeviceInfo.find(x=>x.id==DeviceIds); | 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) | props.HandleOk(parm) | ||||
console.log(de) | console.log(de) | ||||
} | } | ||||
@@ -82,11 +82,11 @@ const goodspush = () => { | |||||
dataIndex: 'status', | dataIndex: 'status', | ||||
ellipsis: true, | ellipsis: true, | ||||
valueEnum: { | valueEnum: { | ||||
0: { | |||||
1: { | |||||
text: '成功', | text: '成功', | ||||
status: 'Success', | status: 'Success', | ||||
}, | }, | ||||
1: { | |||||
2: { | |||||
text: '失败', | text: '失败', | ||||
status: 'Processing', | status: 'Processing', | ||||
}, | }, | ||||
@@ -126,26 +126,26 @@ const goodspush = () => { | |||||
> | > | ||||
重发 | 重发 | ||||
</a>, | </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"> | <ProDescriptions.Item label="topic" copyable valueType="text"> | ||||
{currentRow?.topic} | {currentRow?.topic} | ||||
</ProDescriptions.Item> | </ProDescriptions.Item> | ||||
<ProDescriptions.Item label="下发状态" valueType="text"> | |||||
{currentRow?.description} | |||||
</ProDescriptions.Item> | |||||
<ProDescriptions.Item contentStyle={{ maxWidth: '85%'}} label="下发数据"> | <ProDescriptions.Item contentStyle={{ maxWidth: '85%'}} label="下发数据"> | ||||
<a | <a | ||||
onClick={() => { | onClick={() => { | ||||
@@ -37,3 +37,11 @@ export async function GetDevicePushRecodePage(data) { | |||||
// ...(options || {}), | // ...(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 { | import { | ||||
GetDeviceList, | GetDeviceList, | ||||
GetGoodsPage, | GetGoodsPage, | ||||
GetGoodsTypeTree | |||||
GetGoodsTypeTree, | |||||
GetProductTopicslist | |||||
} from '../services'; | } from '../services'; | ||||
const PushFrom = (props) => { | const PushFrom = (props) => { | ||||
const [deviceData, setdeviceData] = useState([]); | const [deviceData, setdeviceData] = useState([]); | ||||
@@ -14,6 +15,7 @@ const PushFrom = (props) => { | |||||
const [DeviceIds, setDeviceIds] = useState(); | const [DeviceIds, setDeviceIds] = useState(); | ||||
const [DeviceInfo, setDeviceInfo] = useState([]); | const [DeviceInfo, setDeviceInfo] = useState([]); | ||||
const [isGlogy, setisGlogy] = useState(false); | const [isGlogy, setisGlogy] = useState(false); | ||||
const [TopicsData, setTopicsData] = useState([]); | |||||
const actionRef = useRef(); | const actionRef = useRef(); | ||||
useEffect(() => { | useEffect(() => { | ||||
console.log(props.values) | console.log(props.values) | ||||
@@ -41,6 +43,11 @@ const PushFrom = (props) => { | |||||
setDeviceIds(value) | setDeviceIds(value) | ||||
var params={current:1,pageSize:10,deviceId:value} | var params={current:1,pageSize:10,deviceId:value} | ||||
GetGoodsData(params) | 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)=>{ | const onChange=(checked)=>{ | ||||
if(!DeviceIds){ | 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) | props.HandleOk(parm) | ||||
console.log(de) | console.log(de) | ||||
} | } | ||||
@@ -82,11 +82,11 @@ const goodspush = () => { | |||||
dataIndex: 'status', | dataIndex: 'status', | ||||
ellipsis: true, | ellipsis: true, | ||||
valueEnum: { | valueEnum: { | ||||
0: { | |||||
1: { | |||||
text: '成功', | text: '成功', | ||||
status: 'Success', | status: 'Success', | ||||
}, | }, | ||||
1: { | |||||
2: { | |||||
text: '失败', | text: '失败', | ||||
status: 'Processing', | status: 'Processing', | ||||
}, | }, | ||||
@@ -126,26 +126,26 @@ const goodspush = () => { | |||||
> | > | ||||
重发 | 重发 | ||||
</a>, | </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"> | <ProDescriptions.Item label="topic" copyable valueType="text"> | ||||
{currentRow?.topic} | {currentRow?.topic} | ||||
</ProDescriptions.Item> | </ProDescriptions.Item> | ||||
<ProDescriptions.Item label="下发状态" valueType="text"> | |||||
{currentRow?.description} | |||||
</ProDescriptions.Item> | |||||
<ProDescriptions.Item contentStyle={{ maxWidth: '85%'}} label="下发数据"> | <ProDescriptions.Item contentStyle={{ maxWidth: '85%'}} label="下发数据"> | ||||
<a | <a | ||||
onClick={() => { | onClick={() => { | ||||
@@ -44,3 +44,11 @@ export async function GetDevicePushRecodePage(data) { | |||||
// ...(options || {}), | // ...(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 { | import { | ||||
GetDeviceList, | GetDeviceList, | ||||
GetGoodsPage, | GetGoodsPage, | ||||
GetGoodsTypeTree | |||||
GetGoodsTypeTree, | |||||
GetProductTopicslist | |||||
} from '../services'; | } from '../services'; | ||||
const PushFrom = (props) => { | const PushFrom = (props) => { | ||||
const [deviceData, setdeviceData] = useState([]); | const [deviceData, setdeviceData] = useState([]); | ||||
@@ -13,10 +14,12 @@ const PushFrom = (props) => { | |||||
const [treeData, setTreeData] = useState(); | const [treeData, setTreeData] = useState(); | ||||
const [DeviceIds, setDeviceIds] = useState(); | const [DeviceIds, setDeviceIds] = useState(); | ||||
const [DeviceInfo, setDeviceInfo] = useState([]); | const [DeviceInfo, setDeviceInfo] = useState([]); | ||||
const [TopicsData, setTopicsData] = useState([]); | |||||
const [isGlogy, setisGlogy] = useState(false); | const [isGlogy, setisGlogy] = useState(false); | ||||
const actionRef = useRef(); | const actionRef = useRef(); | ||||
useEffect(() => { | useEffect(() => { | ||||
console.log(props.values) | console.log(props.values) | ||||
GetDeviceList().then((r)=>{ | GetDeviceList().then((r)=>{ | ||||
setDeviceInfo(r.data) | setDeviceInfo(r.data) | ||||
if(r.data.length>0){ | if(r.data.length>0){ | ||||
@@ -25,7 +28,7 @@ const PushFrom = (props) => { | |||||
}) | }) | ||||
setdeviceData(data) | setdeviceData(data) | ||||
} | } | ||||
}) | }) | ||||
GetGoodsTypeTree().then((r) => { | GetGoodsTypeTree().then((r) => { | ||||
setTreeData(r.data); | setTreeData(r.data); | ||||
@@ -44,6 +47,11 @@ const PushFrom = (props) => { | |||||
setDeviceIds(value) | setDeviceIds(value) | ||||
var params={current:1,pageSize:10,deviceId:value} | var params={current:1,pageSize:10,deviceId:value} | ||||
GetGoodsData(params) | 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)=>{ | const onChange=(checked)=>{ | ||||
if(!DeviceIds){ | if(!DeviceIds){ | ||||
@@ -92,14 +100,8 @@ const PushFrom = (props) => { | |||||
}else{ | }else{ | ||||
var de=DeviceInfo.find(x=>x.id==DeviceIds); | var de=DeviceInfo.find(x=>x.id==DeviceIds); | ||||
var data={goodstechnology:[]}; | var data={goodstechnology:[]}; | ||||
// if(isGlogy){ | |||||
// data.goodstechnology=[] | |||||
// } | |||||
console.log("de",de) | |||||
selectedRowsState.map(x=>{ | 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){ | if(x.goodstechnology.length>0){ | ||||
data.goodstechnology.push(x.goodstechnology) | data.goodstechnology.push(x.goodstechnology) | ||||
} | } | ||||
@@ -108,7 +110,8 @@ const PushFrom = (props) => { | |||||
if(data.goodstechnology.length==0){ | if(data.goodstechnology.length==0){ | ||||
message.error('选择的商品还没有工艺'); | message.error('选择的商品还没有工艺'); | ||||
}else{ | }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) | props.HandleOk(parm) | ||||
console.log(de) | console.log(de) | ||||
} | } | ||||
@@ -82,11 +82,11 @@ const goodspush = () => { | |||||
dataIndex: 'status', | dataIndex: 'status', | ||||
ellipsis: true, | ellipsis: true, | ||||
valueEnum: { | valueEnum: { | ||||
0: { | |||||
1: { | |||||
text: '成功', | text: '成功', | ||||
status: 'Success', | status: 'Success', | ||||
}, | }, | ||||
1: { | |||||
2: { | |||||
text: '失败', | text: '失败', | ||||
status: 'Processing', | status: 'Processing', | ||||
}, | }, | ||||
@@ -126,26 +126,26 @@ const goodspush = () => { | |||||
> | > | ||||
重发 | 重发 | ||||
</a>, | </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"> | <ProDescriptions.Item label="topic" copyable valueType="text"> | ||||
{currentRow?.topic} | {currentRow?.topic} | ||||
</ProDescriptions.Item> | </ProDescriptions.Item> | ||||
<ProDescriptions.Item label="下发状态" valueType="text"> | |||||
{currentRow?.description} | |||||
</ProDescriptions.Item> | |||||
<ProDescriptions.Item contentStyle={{ maxWidth: '85%'}} label="下发数据"> | <ProDescriptions.Item contentStyle={{ maxWidth: '85%'}} label="下发数据"> | ||||
<a | <a | ||||
onClick={() => { | onClick={() => { | ||||
@@ -44,3 +44,11 @@ export async function GetDevicePushRecodePage(data) { | |||||
// ...(options || {}), | // ...(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" /> | <img alt="logo" className={styles.logo} src="/logo.png" /> | ||||
</div> | </div> | ||||
</Link> | </Link> | ||||
<div className={styles.desc}>智慧餐饮解决方案服务商</div> | |||||
<div className={styles.desc}>黑菠萝智慧后厨解决方案</div> | |||||
</div> | </div> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
<div className={styles.main}> | <div className={styles.main}> | ||||
<div className={styles.title}>连锁经营平台</div> | |||||
<div className={styles.title}>黑菠萝智慧后厨管理</div> | |||||
<ProForm | <ProForm | ||||
initialValues={{ | initialValues={{ | ||||
autoLogin: true, | autoLogin: true, | ||||