跳到主要内容
明道云社区 发帖
发帖 登录
兰生秋水

数据汇总到表格

兰生秋水Lv.3修习 2025-10-22 14:14:13 问答 子表汇总  收藏
  • 新浪微博
  • 微信扫一扫
8 回复734 浏览

各位大佬帮忙看看,我需要按规格去统计重量,用表格显示,有什么好方法吗

image.png

有0人点赞
请 登录后发表观点
兰生秋水
兰生秋水 Lv.3修习 2025-10-16 11:21:34
明道小杨 2025-10-12 08:44:12

没隐藏前跟你表单一样,
image.png

字段隐藏了以后,就是这个效果
image.png

自定义字段自己编个代码就好了
// <free_field_name> 型号规格表格 </free_field_name>
// <file_name>ModelSpecTable_v1.jsx</file_name>
function ModelSpecTable({ formData }) {
// 定义型号数据配置
const modelConfigs = [
{
modelName: "8010",
weightControlId: "68eaf8d7e42c3406e3c56109",
lengthControlId: "68eaf8d7e42c3406e3c5610a"
},
{
modelName: "40
6",
weightControlId: "68eaf8d7e42c3406e3c5610b",
lengthControlId: "68eaf8d7e42c3406e3c5610c"
},
{
modelName: "206",
weightControlId: "68eaf8d7e42c3406e3c5610d",
lengthControlId: "68eaf8d7e42c3406e3c5610e"
},
{
modelName: "30
4",
weightControlId: "68eaf8d7e42c3406e3c5610f",
lengthControlId: "68eaf8d7e42c3406e3c56110"
}
];

return (

{modelConfigs.map((config, index) => { const weightValue = config.weightControlId ? formData[config.weightControlId]?.value : null; const lengthValue = config.lengthControlId ? formData[config.lengthControlId]?.value : null;
return (
          <tr key={config.modelName} className={index % 2 === 0 ? 'bg-white' : 'bg-gray-50'}>
            <td className="px-3 py-2 border-b border-gray-200 font-medium">{config.modelName}</td>
            <td className="px-3 py-2 border-b border-gray-200">
              {weightValue !== null && weightValue !== undefined ? weightValue : '-'}
            </td>
            <td className="px-3 py-2 border-b border-gray-200">
              {lengthValue !== null && lengthValue !== undefined ? lengthValue : '-'}
            </td>
          </tr>
        );
      })}
    </tbody>
  </table>
</div>

);
}

型号 重量 长度

好的,谢谢

兰生秋水
兰生秋水 Lv.3修习 2025-10-16 11:21:24
lan开 2025-10-13 16:59:01

透视表
image.png

谢谢

lan开
lan开 Lv.4悟道 2025-10-13 16:59:01

透视表
image.png

明道小杨
明道小杨 Lv.6传道 2025-10-12 08:44:12

没隐藏前跟你表单一样,
image.png

字段隐藏了以后,就是这个效果
image.png

自定义字段自己编个代码就好了
// <free_field_name> 型号规格表格 </free_field_name>
// <file_name>ModelSpecTable_v1.jsx</file_name>
function ModelSpecTable({ formData }) {
// 定义型号数据配置
const modelConfigs = [
{
modelName: "8010",
weightControlId: "68eaf8d7e42c3406e3c56109",
lengthControlId: "68eaf8d7e42c3406e3c5610a"
},
{
modelName: "40
6",
weightControlId: "68eaf8d7e42c3406e3c5610b",
lengthControlId: "68eaf8d7e42c3406e3c5610c"
},
{
modelName: "206",
weightControlId: "68eaf8d7e42c3406e3c5610d",
lengthControlId: "68eaf8d7e42c3406e3c5610e"
},
{
modelName: "30
4",
weightControlId: "68eaf8d7e42c3406e3c5610f",
lengthControlId: "68eaf8d7e42c3406e3c56110"
}
];

return (

{modelConfigs.map((config, index) => { const weightValue = config.weightControlId ? formData[config.weightControlId]?.value : null; const lengthValue = config.lengthControlId ? formData[config.lengthControlId]?.value : null;
return (
          <tr key={config.modelName} className={index % 2 === 0 ? 'bg-white' : 'bg-gray-50'}>
            <td className="px-3 py-2 border-b border-gray-200 font-medium">{config.modelName}</td>
            <td className="px-3 py-2 border-b border-gray-200">
              {weightValue !== null && weightValue !== undefined ? weightValue : '-'}
            </td>
            <td className="px-3 py-2 border-b border-gray-200">
              {lengthValue !== null && lengthValue !== undefined ? lengthValue : '-'}
            </td>
          </tr>
        );
      })}
    </tbody>
  </table>
</div>

);
}

型号 重量 长度
兰生秋水
兰生秋水 Lv.3修习 2025-10-11 15:35:40
明道小杨 2025-10-11 14:57:10

汇总加个筛选就可以了吧,要表格的话,自定义字段搞一个

现在就是汇总的,感觉不够简洁;自定义字段可以说下怎么弄吗

兰生秋水
兰生秋水 Lv.3修习 2025-10-11 15:35:08
铁北100 2025-10-11 11:42:38

统计表嵌入进去

可能不太行,有其他项目的

明道小杨
明道小杨 Lv.6传道 2025-10-11 14:57:10

汇总加个筛选就可以了吧,要表格的话,自定义字段搞一个

铁北100
铁北100 Lv.6传道 2025-10-11 11:42:38

统计表嵌入进去

发表话题
兰生秋水
兰生秋水Lv.3修习
  • 积分
    53
  • 注册排名
    3762
明道云社区 · 探索与分享企业数字化实践浏览讨论分享经验
你已晋入「」