Giter Site home page Giter Site logo

Comments (8)

github-actions avatar github-actions commented on April 30, 2024

👍 Thanks for this!
🏷 I have applied any labels matching special text in your issue.

Please review the labels and make any necessary changes.

from amis.

yinlianghui avatar yinlianghui commented on April 30, 2024

@2betop 麻烦帮修正下此问题,谢谢

from amis.

lengqingfeng avatar lengqingfeng commented on April 30, 2024

@2betop autofill 后自定义脚本获取不到数据,这个希望解决下。

from amis.

2betop avatar 2betop commented on April 30, 2024

@2betop autofill 后自定义脚本获取不到数据,这个希望解决下。

没看懂

from amis.

lengqingfeng avatar lengqingfeng commented on April 30, 2024

@2betop autofill 后自定义脚本获取不到数据,这个希望解决下。

没看懂

有个向导,第一步有个下拉框,接口数据源,有个值自动填充的例如字段a,然后切换下一步,有个自定义脚本,event.data.a,第一次获取不到数据,只能后退到第一步,在下一步才能拿到数据

from amis.

lengqingfeng avatar lengqingfeng commented on April 30, 2024

@2betop autofill 后自定义脚本获取不到数据,这个希望解决下。

没看懂
类似这种

{
  "type": "page",
  "title": "Hello low code",
  "body": [
    {
      "type": "wizard",
      "steps": [
        {
          "title": "第一步",
          "body": [
            {
              "type": "select",
              "label": "选项",
              "name": "a",
              "id": "u:3378b16e7556",
              "autoFill": {
                "componentId": "${componentId}"
              },
              "multiple": false,
              "source": {
                "url": "xxxx接口",
                "method": "get"
              }
            }
          ],
          "id": "u:323644b9d2c3",
          "mode": "normal"
        },
        {
          "title": "第二步",
          "body": [
            {
              "type": "input-text",
              "label": "文本2",
              "name": "var2",
              "id": "u:f91ebdd9567f"
            }
          ],
          "mode": "normal"
        }
      ],
      "id": "u:c3e52828ca37",
      "mode": "horizontal",
      "onEvent": {
        "stepChange": {
          "weight": 0,
          "actions": [
            {
              "ignoreError": false,
              "script": "console.log(\"data=========\", event.data.componentId)",
              "actionType": "custom"
            }
          ]
        }
      }
    }
  ],
  "id": "u:2865c2a99bd7",
  "asideResizor": false,
  "themeCss": {
    "baseControlClassName": {
      "boxShadow:default": " 0px 0px 0px 0px transparent"
    },
    "bodyControlClassName": {
      "boxShadow:default": " 0px 0px 0px 0px transparent"
    },
    "headerControlClassName": {
      "boxShadow:default": " 0px 0px 0px 0px transparent"
    },
    "toolbarControlClassName": {
      "boxShadow:default": " 0px 0px 0px 0px transparent"
    },
    "asideControlClassName": {
      "boxShadow:default": " 0px 0px 0px 0px transparent"
    }
  }
}

from amis.

yinlianghui avatar yinlianghui commented on April 30, 2024

@2betop select组件配置了source接口也有此问题,不过需要另外配置了hiddenOn表达式的情况下才能重现,见: #9742

另外picker在配置了hiddenOn表达式的情况下也应该避免一样的问题出现,麻烦一并处理掉吧,谢谢。

from amis.

2betop avatar 2betop commented on April 30, 2024

@2betop autofill 后自定义脚本获取不到数据,这个希望解决下。

没看懂
类似这种

{
  "type": "page",
  "title": "Hello low code",
  "body": [
    {
      "type": "wizard",
      "steps": [
        {
          "title": "第一步",
          "body": [
            {
              "type": "select",
              "label": "选项",
              "name": "a",
              "id": "u:3378b16e7556",
              "autoFill": {
                "componentId": "${componentId}"
              },
              "multiple": false,
              "source": {
                "url": "xxxx接口",
                "method": "get"
              }
            }
          ],
          "id": "u:323644b9d2c3",
          "mode": "normal"
        },
        {
          "title": "第二步",
          "body": [
            {
              "type": "input-text",
              "label": "文本2",
              "name": "var2",
              "id": "u:f91ebdd9567f"
            }
          ],
          "mode": "normal"
        }
      ],
      "id": "u:c3e52828ca37",
      "mode": "horizontal",
      "onEvent": {
        "stepChange": {
          "weight": 0,
          "actions": [
            {
              "ignoreError": false,
              "script": "console.log(\"data=========\", event.data.componentId)",
              "actionType": "custom"
            }
          ]
        }
      }
    }
  ],
  "id": "u:2865c2a99bd7",
  "asideResizor": false,
  "themeCss": {
    "baseControlClassName": {
      "boxShadow:default": " 0px 0px 0px 0px transparent"
    },
    "bodyControlClassName": {
      "boxShadow:default": " 0px 0px 0px 0px transparent"
    },
    "headerControlClassName": {
      "boxShadow:default": " 0px 0px 0px 0px transparent"
    },
    "toolbarControlClassName": {
      "boxShadow:default": " 0px 0px 0px 0px transparent"
    },
    "asideControlClassName": {
      "boxShadow:default": " 0px 0px 0px 0px transparent"
    }
  }
}

没复现这个问题,我看可以打印出来值

image

{
  "type": "page",
  "title": "Hello low code",
  "body": [
    {
      "type": "wizard",
      "steps": [
        {
          "title": "第一步",
          "body": [
            {
              "type": "select",
              "label": "选项",
              "name": "a",
              "id": "u:3378b16e7556",
              "autoFill": {
                "componentId": "233"
              },
              "multiple": false,
              "source": {
                "url": "xxxx接口",
                "method": "get",
                "mockResponse": {
                  "status": 200,
                  "data": {
                    "status": 0,
                    "data": {
                      "options": [
                        {
                          "label": "选项1",
                          "value": "1"
                        },
                        {
                          "label": "选项2",
                          "value": "2"
                        }
                      ]
                    }
                  }
                }
              }
            }
          ],
          "id": "u:323644b9d2c3",
          "mode": "normal"
        },
        {
          "title": "第二步",
          "body": [
            {
              "type": "input-text",
              "label": "文本2",
              "name": "var2",
              "id": "u:f91ebdd9567f"
            }
          ],
          "mode": "normal"
        }
      ],
      "id": "u:c3e52828ca37",
      "mode": "horizontal",
      "onEvent": {
        "stepChange": {
          "weight": 0,
          "actions": [
            {
              "ignoreError": false,
              "script": "console.log(\"data=========\", event.data.componentId)",
              "actionType": "custom"
            }
          ]
        }
      }
    }
  ],
  "id": "u:2865c2a99bd7",
  "asideResizor": false,
  "themeCss": {
    "baseControlClassName": {
      "boxShadow:default": " 0px 0px 0px 0px transparent"
    },
    "bodyControlClassName": {
      "boxShadow:default": " 0px 0px 0px 0px transparent"
    },
    "headerControlClassName": {
      "boxShadow:default": " 0px 0px 0px 0px transparent"
    },
    "toolbarControlClassName": {
      "boxShadow:default": " 0px 0px 0px 0px transparent"
    },
    "asideControlClassName": {
      "boxShadow:default": " 0px 0px 0px 0px transparent"
    }
  }
}

from amis.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.