Code Monkey home page Code Monkey logo

Comments (4)

tianbocheng avatar tianbocheng commented on June 5, 2024

找个一个解决办法

image

在 src/plugins/formCreate/index.ts 中设置 formCreate.fetch

// 第一个是原fetch用到的option,第二个没找到源码中引用的地方不知道有什么用
const overrideFetch = (option: any, effectArgs: any) => {
  // console.log('--fetch option--', option)
  service({
    url: option.action,
    method: option.method,
    data: option.data,
    headers: option.headers,
    withCredentials: option.withCredentials
  })
    .then((res) => {
      try {
        if (option._parse) {
          // 使用内置 api 处理解析函数字符串转化为 函数类型
          const parseFn = formCreate.parseFn(option._parse)
          res.data = parseFn(res)
        }
      } catch (e) {
        console.log('--parseFn error--', e)
      }
      option.onSuccess?.(res)
    })
    .catch((e) => {
      option.onError?.(e)
    })

  return option
}



// 参考 http://www.form-create.com/v3/element-ui/auto-import.html 文档
export const setupFormCreate = (app: App<Element>) => {
  components.forEach((component) => {
    app.component(component.name, component)
  })
  formCreate.use(install)
  formCreate.fetch = overrideFetch
  app.use(formCreate)
  app.use(FcDesigner)
}



参考链接:https://blog.csdn.net/lister1005/article/details/131306732

from ruoyi-vue-pro.

YunaiV avatar YunaiV commented on June 5, 2024

收到,我们正在搞哈

from ruoyi-vue-pro.

tianbocheng avatar tianbocheng commented on June 5, 2024

还有个问题是 @YunaiV 保存 解析函数 无法没有保存

  • 下拉框组件,点击 修改解析函数,点击保存
  • 第二次进入,重新编辑查看,没有将解析函数保存
image
  • 在 vue debug 插件下是有这个参数的
image

from ruoyi-vue-pro.

YunaiV avatar YunaiV commented on June 5, 2024

还有个问题是 @YunaiV 保存 解析函数 无法没有保存

  • 下拉框组件,点击 修改解析函数,点击保存
  • 第二次进入,重新编辑查看,没有将解析函数保存
image * 在 vue debug 插件下是有这个参数的 image

#499 重复,统一跟进

from ruoyi-vue-pro.

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.