Commit 519317b1 authored by 赵啸非's avatar 赵啸非

更新资源部署

parent 23b0b91c
......@@ -76,8 +76,11 @@ export default {
if(row.selected==1){
this.$post("/device/module/distribute/selected", {id:row.id,selected:0})
.then(res => {
if(res.code==1){
row.selected=0;
if (res && res.code && res.code == 1) {
this.getData();
this.loading = false;
}else{
this.$message.error(res.msg);
}
})
.catch(error => {
......@@ -86,15 +89,18 @@ export default {
}else{
this.$post("/device/module/distribute/selected", {id:row.id,selected:1})
.then(res => {
if(res.code==1){
row.selected=1;
if (res && res.code && res.code == 1) {
this.getData();
this.loading = false;
}else{
this.$message.error(res.msg);
}
})
.catch(error => {
this.$message.error(error.message);
})
}
this.getData();
},
distribute(row) {
......
......@@ -121,11 +121,11 @@ public class DeviceModuleDistributeServiceImpl extends AbstractCRUDServiceImpl<D
List<DeviceModuleDistributeEntity> deviceModuleDistributeEntities = this.find(query, context);
if (ObjectUtils.isEmpty(deviceModuleDistributeEntities))
throw new AppException("当前产品选择切换后没有默认选择,不能切换!");
throw new AppException("当前产品默认选择取消后没有默认选择,不能切换!");
DeviceModuleDistributeEntity moduleDistribute = deviceModuleDistributeEntities.stream().filter(f -> f.getSelected() == YesNoEnum.YES.getValue()).findFirst().orElseGet(() -> null);
if (ObjectUtils.isEmpty(moduleDistribute))
throw new AppException("当前产品选择切换后没有默认选择,不能切换!");
throw new AppException("当前产品默认选择取消后没有默认选择,不能切换!");
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment