Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.0版本,crud字段交互的bug #129

Open
fsg-herbie opened this issue Mar 11, 2024 · 1 comment
Open

2.0版本,crud字段交互的bug #129

fsg-herbie opened this issue Mar 11, 2024 · 1 comment

Comments

@fsg-herbie
Copy link
Contributor

fsg-herbie commented Mar 11, 2024

按照官方菜单示例代码

onControl: (value, maFormObject) => {
  const service = maFormObject.getColumnService()
  const dataIndexList = ['icon', 'route', 'component', 'redirect', 'sort', 'is_hidden', 'restful']
  if ( value === 'B' ) {
    dataIndexList.map(name => service.get(name).setAttr('display', false))
    return
  }
  if ( ['I', 'L'].includes(value) ) {
    dataIndexList.map(name => service.get(name).setAttr('display', ['icon', 'route', 'sort', 'is_hidden'].includes(name)) )
    return
  }
  dataIndexList.map(name => service.get(name).setAttr('display', true))
},

没有任何问题,但是当我要隐藏的字段类型为children-form类型时,操作隐藏children-form的字段不生效,需要关闭model弹窗再开才生效
配置代码如下

const columns = reactive([
{
    title: "付平台", dataIndex: "support_platforms",
    formType: "radio", search: true,
    dict: {
      data(){
        return [
          {label: "微信", value: 1},
          {label: "支付宝", value: 2},
          {label: "网银", value: 3},
        ];
      }
    },
    commonRules: {required: true, message: "请选择支持平台"},
    onControl: (value, maFormObject) => {
      const service = maFormObject.getColumnService()
      const dataIndexList = ['mch_id', 'mch_secret_key', 'mch_secret_cert', 'mch_public_cert_path', 'wechat_public_cert_path']
      if ( value === 1 ) {
        dataIndexList.map(name => service.get(name).setAttr('display', false))
      }
    },
  },
  {
    title: "支付配置", dataIndex: "config_data",
    formType: "children-form", hide: true,
    hideDelete:true, hideAdd:true, required: true,
    type: 'group',
    formList:[
        {dataIndex: "mch_id",title:"商户号", required: true,labelWidth:'130px'},
        {dataIndex: "mch_secret_key",title:"商户秘钥", required: true,labelWidth:'130px'},
        {dataIndex: "mch_secret_cert",title:"商户私钥证书", required: true,labelWidth:'130px'},
        {dataIndex: "mch_public_cert_path",title:"商户公钥证书", required: true,labelWidth:'130px'},
        {dataIndex: "wechat_public_cert_path",title:"微信公钥证书", required: true,labelWidth:'130px'},
    ]
  }
])
@kanyxmo
Copy link
Member

kanyxmo commented Mar 12, 2024

好的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants