|
|
@@ -74,78 +74,6 @@ const GoodsTypeManage = () => { |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
//添加 |
|
|
|
const handleAdd = async (fields) => { |
|
|
|
try { |
|
|
|
fields.productUrl=currentImage?.materialPath[0]; |
|
|
|
message.loading('正在添加', key); |
|
|
|
await AddDeviceVesion(JSON.stringify(fields)).then((r) => { |
|
|
|
message.destroy(key); |
|
|
|
if (r.data) { |
|
|
|
message.success('添加成功'); |
|
|
|
actionRef.current?.reloadAndRest?.(); |
|
|
|
return true; |
|
|
|
} else { |
|
|
|
message.error('添加失败'); |
|
|
|
return false; |
|
|
|
} |
|
|
|
}); |
|
|
|
} catch (error) { |
|
|
|
message.error('添加失败请重试!'); |
|
|
|
return false; |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
//修改 |
|
|
|
const handleUpdate = async (fields) => { |
|
|
|
try { |
|
|
|
fields.productUrl=currentImage?.materialPath[0]; |
|
|
|
debugger |
|
|
|
message.loading('正在修改', key); |
|
|
|
message.destroy(key); |
|
|
|
await UpdateDeviceVesion(JSON.stringify(fields)).then((r) => { |
|
|
|
message.destroy(key); |
|
|
|
if (r.data) { |
|
|
|
message.success('修改成功',); |
|
|
|
actionRef.current?.reloadAndRest?.(); |
|
|
|
return true; |
|
|
|
} else { |
|
|
|
message.success('修改失败'); |
|
|
|
return false; |
|
|
|
} |
|
|
|
}); |
|
|
|
} catch (error) { |
|
|
|
message.error('修改失败请重试!'); |
|
|
|
return false; |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
//删除 |
|
|
|
const handleRemove = async (selectedRows) => { |
|
|
|
try { |
|
|
|
message.loading('正在删除'); |
|
|
|
let ids = []; |
|
|
|
selectedRows.forEach((item) => { |
|
|
|
ids.push(item.id); |
|
|
|
}); |
|
|
|
await DelDeviceVesion(ids).then((r) => { |
|
|
|
if (r.data) { |
|
|
|
message.success('删除成功'); |
|
|
|
actionRef.current?.reloadAndRest?.(); |
|
|
|
return true; |
|
|
|
} else { |
|
|
|
message.error(r.errors); |
|
|
|
return false; |
|
|
|
} |
|
|
|
}); |
|
|
|
} catch (error) { |
|
|
|
message.error('删除失败请重试!'); |
|
|
|
return false; |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
const columns = [ |
|
|
|
{ |
|
|
|
title: '主键', |
|
|
|