perf: 保存产品: 信息变更字段+多语种信息

dev/2025b
Lei OT 2 months ago
parent a95992cb8e
commit d3aba13a08

@ -61,7 +61,7 @@ const ProductInfo = ({ ...props }) => {
const onValuesChange = (changedValues) => { const onValuesChange = (changedValues) => {
// console.log('onValuesChange', changedValues); // console.log('onValuesChange', changedValues);
const changedKeys = objectMapper(changedValues, { 'city': 'city_id', 'dept': 'dept_id', 'product_title': 'title'}); const changedKeys = objectMapper(changedValues, { 'city': 'city_id', 'dept': 'dept_id', 'product_title': 'title', 'lgc_details_mapped': 'lgc_details'});
setEditKeys(prev => unique([...prev, ...Object.keys(changedKeys)])); setEditKeys(prev => unique([...prev, ...Object.keys(changedKeys)]));
// const preValues = pick(editingProduct.info, editKeys); // const preValues = pick(editingProduct.info, editKeys);
if ('product_title' in changedValues) { if ('product_title' in changedValues) {
@ -79,7 +79,8 @@ const ProductInfo = ({ ...props }) => {
const onSave = async (err, values, forms) => { const onSave = async (err, values, forms) => {
values.travel_agency_id = activeAgency.travel_agency_id; values.travel_agency_id = activeAgency.travel_agency_id;
const editChanged = pick(editingProduct.info, editKeys); const editChanged = pick(editingProduct.info, editKeys);
// console.log("editKeys pre values", editKeys, editChanged); (editKeys.includes('lgc_details') ? editChanged.lgc_details = editingProduct.lgc_details.map(l => l.lgc) : false);
// console.log("editKeys pre values", editKeys, editChanged, '\neditingProduct', );
const copyNewProduct = structuredClone(newProductRecord); const copyNewProduct = structuredClone(newProductRecord);
const poster = { const poster = {

Loading…
Cancel
Save