input-table内公式列initSet计算后不更新data域,造成显示值和实际值不一致
Open
Nobody has claimed this yet.
need confirm
- Dominant language
- TypeScript
- Stars
- 18.9k
- Forks
- 2.7k
- PR merge metrics
- No merged PRs in 30d
Description
描述问题:
input-table内假如有公式列,设置initSet:true计算后显示的列值变了,但是开了form的debug看,没有更新data域,造成显示值和实际值不一致
截图或视频:


如何复现(请务必完整填写下面内容):
- 你是如何使用 amis 的?
sdk、npm或其他...
sdk - amis 版本是什么?请先在最新 beta 版本测试问题是否存在
v1.8.0 - 粘贴有问题的完整
amis schema代码:
const schema = {
type: 'page',
title: '表单页面',
data: {
aclPermissions: aclStore.getPermission,
},
body: [
{
type: 'form',
mode: 'horizontal',
api: 'post:/test/mock',
debug: true,
data: {
items: [
{ a: 1, b: 1, c: 0 },
{ a: 2, b: 2, c: 0 },
{ a: 3, b: 3, c: 0 },
],
},
body: [
{
label: 'Name',
type: 'input-text',
name: 'name',
visibleOn: 'this.aclPermissions.includes("delete:system")',
},
{
label: 'Email',
type: 'input-email',
name: 'email',
},
{
type: 'input-table',
name: 'items',
label: '订单明细',
columns: [
{
type: 'input-number',
name: 'a',
label: '单价',
},
{
type: 'input-number',
name: 'b',
label: '数量',
},
{
type: 'input-number',
name: 'c',
label: '总价',
},
{
type: 'formula',
formula: '${a*b}',
name: 'c',
initSet: true,
autoSet: true,
},
],
},
],
},
],
}
- 操作步骤
请简单描述一下复现的操作步骤...
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the provided amis SDK schema with the input-table formula column, initSet enabled, and form debug enabled. Compare the formula column's displayed value with the form data after initialization; done means both values remain consistent for the sample items.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100