Coder Social home page Coder Social logo

Comments (7)

lxfu1 avatar lxfu1 commented on August 18, 2024

目前是支持自兴义的,看下自定义表单,xflow 里面用法一样。

from xflow.

qq296565890 avatar qq296565890 commented on August 18, 2024

目前是支持自兴义的,看下自定义表单,xflow 里面用法一样。

谢谢您的解答,但我的项目需要嵌入Formily表单设计器的设计成果,现有的功能未能满足我的需求,还请亲帮忙开放一下这个功能,再次对您表示感谢!

from xflow.

lxfu1 avatar lxfu1 commented on August 18, 2024

目前 getCustomRenderComponent 也是支持的(但会有类型错误提示),你可以试下是否满足需求,类型错误随后会解掉。

const getCustomRenderComponent = (targetType, targetData) => {
  if (targetType === 'node') {
    return () => (
      <div className="custom-form-component"> node: {targetData?.label} custom componnet </div>
    )
  }
  if (targetType === 'canvas') {
    return () => <div className="custom-form-component"> canvas custom componnet </div>
  }

  return null
}

<FlowchartFormPanel
    show={true}
    position={{ width: 200, top: 40, bottom: 0, right: 0 }}
    getCustomRenderComponent={getCustomRenderComponent}
  />

from xflow.

qq296565890 avatar qq296565890 commented on August 18, 2024

目前 getCustomRenderComponent 也是支持的(但会有类型错误提示),你可以试下是否满足需求,类型错误随后会解掉。

const getCustomRenderComponent = (targetType, targetData) => {
  if (targetType === 'node') {
    return () => (
      <div className="custom-form-component"> node: {targetData?.label} custom componnet </div>
    )
  }
  if (targetType === 'canvas') {
    return () => <div className="custom-form-component"> canvas custom componnet </div>
  }

  return null
}

<FlowchartFormPanel
    show={true}
    position={{ width: 200, top: 40, bottom: 0, right: 0 }}
    getCustomRenderComponent={getCustomRenderComponent}
  />

非常感谢亲能帮助我解决难题。这已经可以满足我的需求。示例代码如下:

// #region getCustomRenderComponent定义
export const getCustomRenderComponent: NsJsonSchemaForm.ICustomRender = (
     targetType,
     targetData,
     // commandService // 暂时不支持此参数,如果以后能支持就更好了
   ) => {
     const commandService = useXFlowApp();
     const updateNode = (node: NsGraph.INodeConfig) => {
       return commandService.executeCommand<NsNodeCmd.UpdateNode.IArgs>(
         XFlowNodeCommands.UPDATE_NODE.id,
         { nodeConfig: node },
       )
     }
......
// #endregion
// 我期望FlowchartFormPanel 能够像 JsonSchemaForm 一样使用。

// #region 使用方式
<FlowchartFormPanel
    show={true}
    position={{ width: 400, top: 40, bottom: 0, right: 0 }}
    getCustomRenderComponent={NsJsonForm.getCustomRenderComponent}
/>
// #endregion

更多使用细节请参考:
CustomPanel
自定义渲染getCustomRenderComponent
image

from xflow.

xflow-bot avatar xflow-bot commented on August 18, 2024

Hiya!

This issue has gone quiet. Spooky quiet. 👻

We get a lot of issues, so we currently close issues after 60 days of inactivity. It’s been at least 20 days since the last update here. If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not-stale" to keep this issue open!

As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out contribute for more information about opening PRs, triaging issues, and contributing!

Thanks for being a part of the AntV community! 💪💯

from xflow.

xflow-bot avatar xflow-bot commented on August 18, 2024

Hey again!

It’s been 60 days since anything happened on this issue, so our friendly neighborhood robot (that’s me!) is going to close it. Please keep in mind that I’m only a robot 🤖, so if I’ve closed this issue in error, I’m HUMAN_EMOTION_SORRY. Please feel free to comment on this issue or create a new one if you need anything else.

As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out contribute for more information about opening PRs, triaging issues, and contributing!

Thanks again for being part of the AntV community! 💪💯

from xflow.

xflow-bot avatar xflow-bot commented on August 18, 2024

This thread has been automatically locked because it has not had recent activity.

Please open a new issue for related bugs and link to relevant comments in this thread.

from xflow.

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.